HEX
Server: nginx/1.27.1
System: Linux in-3 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
User: ivenus-clone (3297)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v4513/tepnot/public_html/wp-content/plugins/dokan-pro/assets/js/analytics-report-orders.js
(globalThis.webpackChunkdokan_pro=globalThis.webpackChunkdokan_pro||[]).push([[7202],{331:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(8468);function o(e,t=[]){return(0,a.find)(t,{key:e})||t[0]}},2694:(e,t,r)=>{"use strict";var a=r(6925);function o(){}function s(){}s.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,s,n){if(n!==a){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:o};return r.PropTypes=r,r}},2703:(e,t,r)=>{"use strict";r.d(t,{A:()=>C});var a=r(7723),o=r(6087),s=r(9491),n=r(8443),i=r(7143),l=r(8468),d=r(5556),c=r.n(d),u=r(8846),p=r(314),m=r(7374),_=r(4111),y=r(4351),h=r(6476);function g(e,t,r={}){if(!e||0===e.length)return null;const a=e.slice(0),o=a.pop();if(o.showFilters(t,r)){const e=(0,h.flattenFilters)(o.filters),r=t[o.param]||o.defaultValue||"all";return(0,l.find)(e,{value:r})}return g(a,t,r)}function f(e){return t=>(0,n.format)(e,t)}function b(e){if(e?.data?.intervals?.length>1){const t=e.data.intervals[0].date_start,r=e.data.intervals[e.data.intervals.length-1].date_end;if(m.containsLeapYear&&(0,m.containsLeapYear)(t,r))return!0}return!1}var v=r(790);class k extends o.Component{shouldComponentUpdate(e){return e.isRequesting!==this.props.isRequesting||e.primaryData.isRequesting!==this.props.primaryData.isRequesting||e.secondaryData.isRequesting!==this.props.secondaryData.isRequesting||!(0,l.isEqual)(e.query,this.props.query)}getItemChartData(){const{primaryData:e,selectedChart:t}=this.props;return e.data.intervals.map(function(e){const r={};return e.subtotals.segments.forEach(function(e){if(e.segment_label){const a=r[e.segment_label]?e.segment_label+" (#"+e.segment_id+")":e.segment_label;r[e.segment_id]={label:a,value:e.subtotals[t.key]||0}}}),{date:(0,n.format)("Y-m-d\\TH:i:s",e.date_start),...r}})}getTimeChartData(){const{query:e,primaryData:t,secondaryData:r,selectedChart:a,defaultDateRange:o}=this.props,s=(0,m.getIntervalForQuery)(e,o),{primary:i,secondary:l}=(0,m.getCurrentDates)(e,o);return function(e,t,r,a,o,s,i){const l=b(e),d=b(t),c=[...e.data.intervals],u=[...t.data.intervals],p=[];for(let e=0;e<c.length;e++){const t=c[e],_=(0,n.format)("Y-m-d\\TH:i:s",t.date_start),y=`${r.label} (${r.range})`,h=t.date_start,g=t.subtotals[s]||0,f=u[e],b=`${a.label} (${a.range})`;let v=(0,m.getPreviousDate)(t.date_start,r.after,a.after,o,i).format("YYYY-MM-DD HH:mm:ss"),k=f&&f.subtotals[s]||0;if("day"===i&&l&&!d&&u?.[e]){const r=new Date(t.date_start),a=new Date(u[e].date_start);(0,m.isLeapYear)(r.getFullYear())&&1===r.getMonth()&&29===r.getDate()&&2===a.getMonth()&&1===a.getDate()&&(v="-",k=0,u.splice(e,0,u[e]))}p.push({date:_,primary:{label:y,labelDate:h,value:g},secondary:{label:b,labelDate:v,value:k}})}return p}(t,r,i,l,e.compare,a.key,s)}getTimeChartTotals(){const{primaryData:e,secondaryData:t,selectedChart:r}=this.props;return{primary:(0,l.get)(e,["data","totals",r.key],null),secondary:(0,l.get)(t,["data","totals",r.key],null)}}renderChart(e,t,r,o){const{emptySearchResults:s,filterParam:n,interactiveLegend:i,itemsLabel:l,legendPosition:d,path:c,query:_,selectedChart:y,showHeaderControls:h,primaryData:g,defaultDateRange:b}=this.props,k=(0,m.getIntervalForQuery)(_,b),C=(0,m.getAllowedIntervalsForQuery)(_,b),S=(0,m.getDateFormatsForInterval)(k,g.data.intervals.length,{type:"php"}),x=s?(0,a.__)("No data for the current search","dokan"):(0,a.__)("No data for the selected date range","dokan"),{formatAmount:R,getCurrencyConfig:q}=this.context;return(0,v.jsx)(u.Chart,{allowedIntervals:C,data:r,dateParser:"%Y-%m-%dT%H:%M:%S",emptyMessage:x,filterParam:n,interactiveLegend:i,interval:k,isRequesting:t,itemsLabel:l,legendPosition:d,legendTotals:o,mode:e,path:c,query:_,screenReaderFormat:f(S.screenReaderFormat),showHeaderControls:h,title:y.label,tooltipLabelFormat:f(S.tooltipLabelFormat),tooltipTitle:"time-comparison"===e&&y.label||null,tooltipValueFormat:(0,p.getTooltipValueFormat)(y.type,R),chartType:(0,m.getChartTypeForQuery)(_),valueType:y.type,xFormat:f(S.xFormat),x2Format:f(S.x2Format),currency:q()})}renderItemComparison(){const{isRequesting:e,primaryData:t}=this.props;if(t.isError)return(0,v.jsx)(y.A,{});const r=e||t.isRequesting,a=this.getItemChartData();return this.renderChart("item-comparison",r,a)}renderTimeComparison(){const{isRequesting:e,primaryData:t,secondaryData:r}=this.props;if(!t||t.isError||r.isError)return(0,v.jsx)(y.A,{});const a=e||t.isRequesting||r.isRequesting,o=this.getTimeChartData(),s=this.getTimeChartTotals();return this.renderChart("time-comparison",a,o,s)}render(){const{mode:e}=this.props;return"item-comparison"===e?this.renderItemComparison():this.renderTimeComparison()}}k.contextType=_.CurrencyContext,k.propTypes={filters:c().array,isRequesting:c().bool,itemsLabel:c().string,limitProperties:c().array,mode:c().string,path:c().string.isRequired,primaryData:c().object,query:c().object.isRequired,secondaryData:c().object,selectedChart:c().shape({key:c().string.isRequired,label:c().string.isRequired,order:c().oneOf(["asc","desc"]),orderby:c().string,type:c().oneOf(["average","number","currency"]).isRequired}).isRequired},k.defaultProps={isRequesting:!1,primaryData:{data:{intervals:[]},isError:!1,isRequesting:!1},secondaryData:{data:{intervals:[]},isError:!1,isRequesting:!1}};const C=(0,s.compose)((0,i.withSelect)((e,t)=>{const{charts:r,endpoint:a,filters:o,isRequesting:s,limitProperties:n,query:i,advancedFilters:d}=t,c=n||[a],u=g(o,i),m=(0,l.get)(u,["settings","param"]),_=t.mode||function(e,t){if(e&&t){const r=(0,l.get)(e,["settings","param"]);if(!r||Object.keys(t).includes(r))return(0,l.get)(e,["chartMode"])}return null}(u,i)||"time-comparison",{woocommerce_default_date_range:y}=e(p.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings"),h=e(p.REPORTS_STORE_NAME),f={mode:_,filterParam:m,defaultDateRange:y};if(s)return f;const b=c.some(e=>i[e]&&i[e].length);if(i.search&&!b)return{...f,emptySearchResults:!0};const v=r&&r.map(e=>e.key),k=(0,p.getReportChartData)({endpoint:a,dataType:"primary",query:i,selector:h,limitBy:c,filters:o,advancedFilters:d,defaultDateRange:y,fields:v});if("item-comparison"===_)return{...f,primaryData:k};const C=(0,p.getReportChartData)({endpoint:a,dataType:"secondary",query:i,selector:h,limitBy:c,filters:o,advancedFilters:d,defaultDateRange:y,fields:v});return{...f,primaryData:k,secondaryData:C}}))(k)},4351:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var a=r(7723),o=r(5556),s=r.n(o),n=r(8846),i=r(790);function l({className:e}){const t=(0,a.__)("There was an error getting your stats. Please try again.","dokan"),r=(0,a.__)("Reload","dokan");return(0,i.jsx)(n.EmptyContent,{className:e,title:t,actionLabel:r,actionCallback:()=>{window.location.reload()}})}l.propTypes={className:s().string};const d=l},4924:(e,t,r)=>{"use strict";r.d(t,{H:()=>o});var a=r(7723);function o(e){return[e.country,e.state,e.name||(0,a.__)("TAX","dokan"),e.priority].map(e=>e.toString().toUpperCase().trim()).filter(Boolean).join("-")}},5556:(e,t,r)=>{e.exports=r(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7057:(e,t,r)=>{"use strict";r.d(t,{Dn:()=>u,U4:()=>m,aG:()=>p,b8:()=>f,jx:()=>h,p0:()=>y,wd:()=>_,xP:()=>g});var a=r(3832),o=r(1455),s=r.n(o),n=r(8468),i=r(6476),l=r(4924),d=r(274);const c="/wc-analytics";function u(e,t=n.identity){return function(r="",o){const n="function"==typeof e?e(o):e,l=(0,i.getIdsFromQuery)(r);if(l.length<1)return Promise.resolve([]);const d={include:l.join(","),per_page:l.length};return s()({path:(0,a.addQueryArgs)(n,d)}).then(e=>e.map(t))}}u(c+"/products/attributes",e=>({key:e.id,label:e.name}));const p=u(c+"/products/categories",e=>({key:e.id,label:e.name})),m=u(c+"/coupons",e=>({key:e.id,label:e.code})),_=u(c+"/customers",e=>({key:e.id,label:e.name})),y=u(c+"/products",e=>({key:e.id,label:e.name})),h=u(c+"/taxes",e=>({key:e.id,label:(0,l.H)(e)}));function g({attributes:e,name:t}){const r=(0,d.Qk)("variationTitleAttributesSeparator"," - ");if(t&&t.indexOf(r)>-1)return t;const a=(e||[]).map(({option:e})=>e).join(", ");return a?t+r+a:t}const f=u(({products:e})=>e?c+`/products/${e}/variations`:c+"/variations",e=>({key:e.id,label:g(e)}))},8222:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var a=r(6087),o=r(9491),s=r(5556),n=r.n(s),i=r(8468),l=r(7143),d=r(7752),c=r(8846),u=r(314),p=r(7374),m=r(3306),_=r(4111),y=r(274),h=r(790);class g extends a.Component{constructor(){super(),this.onDateSelect=this.onDateSelect.bind(this),this.onFilterSelect=this.onFilterSelect.bind(this),this.onAdvancedFilterAction=this.onAdvancedFilterAction.bind(this)}onDateSelect(e){const{report:t,addCesSurveyForAnalytics:r}=this.props;r(),(0,m.recordEvent)("datepicker_update",{report:t,...(0,i.omitBy)(e,i.isUndefined)})}onFilterSelect(e){const{report:t,addCesSurveyForAnalytics:r}=this.props,a=e.filter||e["filter-variations"];["single_product","single_category","single_coupon","single_variation"].includes(a)&&r();const o={report:t,filter:e.filter||"all"};"single_product"===e.filter&&(o.filter_variation=e["filter-variations"]||"all"),(0,m.recordEvent)("analytics_filter",o)}onAdvancedFilterAction(e,t){const{report:r,addCesSurveyForAnalytics:a}=this.props;switch(e){case"add":(0,m.recordEvent)("analytics_filters_add",{report:r,filter:t.key});break;case"remove":(0,m.recordEvent)("analytics_filters_remove",{report:r,filter:t.key});break;case"filter":const e=Object.keys(t).reduce((e,r)=>(e[(0,i.snakeCase)(r)]=t[r],e),{});a(),(0,m.recordEvent)("analytics_filters_filter",{report:r,...e});break;case"clear_all":(0,m.recordEvent)("analytics_filters_clear_all",{report:r});break;case"match":(0,m.recordEvent)("analytics_filters_all_any",{report:r,value:t.match})}}render(){const{advancedFilters:e,filters:t,path:r,query:a,showDatePicker:o,defaultDateRange:s}=this.props,{period:n,compare:i,before:l,after:d}=(0,p.getDateParamsFromQuery)(a,s),{primary:u,secondary:m}=(0,p.getCurrentDates)(a,s),_={period:n,compare:i,before:l,after:d,primaryDate:u,secondaryDate:m},g=this.context;return(0,h.jsx)(c.ReportFilters,{query:a,siteLocale:y.ne.siteLocale,currency:g.getCurrencyConfig(),path:r,filters:t,advancedFilters:e,showDatePicker:o,onDateSelect:this.onDateSelect,onFilterSelect:this.onFilterSelect,onAdvancedFilterAction:this.onAdvancedFilterAction,dateQuery:_,isoDateFormat:p.isoDateFormat})}}g.contextType=_.CurrencyContext;const f=(0,o.compose)((0,l.withSelect)(e=>{const{woocommerce_default_date_range:t}=e(u.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{defaultDateRange:t}}),(0,l.withDispatch)(e=>{const{addCesSurveyForAnalytics:t}=e(d.STORE_KEY);return{addCesSurveyForAnalytics:t}}))(g);g.propTypes={advancedFilters:n().object,filters:n().array,path:n().string.isRequired,query:n().object,showDatePicker:n().bool,report:n().string.isRequired}},8660:(e,t,r)=>{"use strict";r.d(t,{A:()=>R});var a=r(6427),o=r(2619),s=r(6087),n=r(9491),i=r(8107),l=r(7143),d=r(8468),c=r(7723),u=r(5556),p=r.n(u),m=r(7752),_=r(8846),y=r(6476),h=r(1554),g=r(314),f=r(3306),b=r(790);const v=()=>(0,b.jsx)("svg",{role:"img","aria-hidden":"true",focusable:"false",version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{d:"M18,9c-0.009,0-0.017,0.002-0.025,0.003C17.72,5.646,14.922,3,11.5,3C7.91,3,5,5.91,5,9.5c0,0.524,0.069,1.031,0.186,1.519 C5.123,11.016,5.064,11,5,11c-2.209,0-4,1.791-4,4c0,1.202,0.541,2.267,1.38,3h18.593C22.196,17.089,23,15.643,23,14 C23,11.239,20.761,9,18,9z M12,16l-4-5h3V8h2v3h3L12,16z"})});var k=r(4351);const C=e=>{const{getHeadersContent:t,getRowsContent:r,getSummary:n,isRequesting:l,primaryData:u,tableData:p,endpoint:m,itemIdField:C,tableQuery:S,compareBy:x,compareParam:R,searchBy:q,labels:w={},...D}=e,{query:T,columnPrefsKey:F}=e,{items:E,query:A}=p,P=T[R]?(0,y.getIdsFromQuery)(T[x]):[],[j,N]=(0,s.useState)(P),O=(0,s.useRef)(null),{updateUserPreferences:L,...I}=(0,g.useUserPreferences)();if(p.isError||u.isError)return(0,b.jsx)(k.A,{});let Q=[];F&&(Q=I&&I[F]?I[F]:Q);const V=(e,a,s)=>{const i=n?n(a,s):null;return(0,o.applyFilters)("dokan_analytics_report_table",{endpoint:m,headers:t(),rows:r(e),totals:a,summary:i,items:E})},M=t=>{const{ids:r}=e;N(t?r:[])},B=(t,r)=>{const{ids:a}=e;if(r)N((0,d.uniq)([a[t],...j]));else{const e=j.indexOf(a[t]);N([...j.slice(0,e),...j.slice(e+1)])}},H=t=>{const{ids:r=[]}=e,o=-1!==j.indexOf(r[t]);return{display:(0,b.jsx)(a.CheckboxControl,{onChange:(0,d.partial)(B,t),checked:o}),value:!1}},Y=l||p.isRequesting||u.isRequesting,U=(0,d.get)(u,["data","totals"],{}),$=E.totalResults||0,G=$>0,K=(0,y.getSearchWords)(T).map(e=>({key:e,label:e})),{data:W}=E,z=V(W,U,$);let{headers:X,rows:J}=z;const{summary:Z}=z;x&&(J=J.map((e,t)=>[H(t),...e]),X=[(()=>{const{ids:t=[]}=e,r=t.length>0,o=r&&t.length===j.length;return{cellClassName:"is-checkbox-column",key:"compare",label:(0,b.jsx)(a.CheckboxControl,{onChange:M,"aria-label":(0,c.__)("Select All","dokan"),checked:o,disabled:!r}),required:!0}})(),...X]);const ee=((e,t)=>t?e.map(e=>({...e,visible:e.required||!t.includes(e.key)})):e.map(e=>({...e,visible:e.required||!e.hiddenByDefault})))(X,Q);return(0,b.jsxs)(s.Fragment,{children:[(0,b.jsx)("div",{className:"woocommerce-report-table__scroll-point",ref:O,"aria-hidden":!0}),(0,b.jsx)(_.TableCard,{className:"woocommerce-report-table",hasSearch:!!q,actions:[x&&(0,b.jsx)(_.CompareButton,{className:"woocommerce-table__compare",count:j.length,helpText:w.helpText||(0,c.__)("Check at least two items below to compare","dokan"),onClick:()=>{x&&(0,y.onQueryChange)("compare")(x,R,j.join(","))},disabled:!G,children:w.compareButton||(0,c.__)("Compare","dokan")},"compare"),q&&(0,b.jsx)(_.Search,{allowFreeTextSearch:!0,inlineTags:!0,onChange:t=>{const{baseSearchQuery:r,addCesSurveyForCustomerSearch:a}=e,o=t.map(e=>e.label.replace(",","%2C"));o.length?((0,y.updateQueryString)({filter:void 0,[R]:void 0,[q]:void 0,...r,search:(0,d.uniq)(o).join(",")}),a()):(0,y.updateQueryString)({search:void 0}),(0,f.recordEvent)("analytics_table_filter",{report:m})},placeholder:w.placeholder||(0,c.__)("Search by item name","dokan"),selected:K,showClearButton:!0,type:q,disabled:!G},"search"),G&&(0,b.jsxs)(a.Button,{className:"woocommerce-table__download-button",disabled:Y,onClick:()=>{const{createNotice:t,startExport:r,title:a}=e,o=Object.assign({},T),{data:s,totalResults:n}=E;let i="browser";if(delete o.extended_info,o.search&&delete o[q],s&&s.length===n){const{headers:e,rows:t}=V(s,n);(0,h.downloadCSVFile)((0,h.generateCSVFileName)(a,o),(0,h.generateCSVDataFromTable)(e,t))}else i="email",r(m,A).then(()=>t("success",(0,c.sprintf)(/* translators: %s = type of report */ /* translators: %s = type of report */
(0,c.__)("Your %s Report will be emailed to you.","dokan"),a))).catch(e=>t("error",e.message||(0,c.sprintf)(/* translators: %s = type of report */ /* translators: %s = type of report */
(0,c.__)("There was a problem exporting your %s Report. Please try again.","dokan"),a)));(0,f.recordEvent)("analytics_table_download",{report:m,rows:n,download_type:i})},children:[(0,b.jsx)(v,{}),(0,b.jsx)("span",{className:"woocommerce-table__download-button__label",children:w.downloadButton||(0,c.__)("Download","dokan")})]},"download")],headers:ee,isLoading:Y,onQueryChange:y.onQueryChange,onColumnsChange:(e,t)=>{const r=X.map(e=>e.key).filter(t=>!e.includes(t));if(F&&L({[F]:r}),t){const r={report:m,column:t,status:e.includes(t)?"on":"off"};(0,f.recordEvent)("analytics_table_header_toggle",r)}},onSort:(e,t)=>{(0,y.onQueryChange)("sort")(e,t);const r={report:m,column:e,direction:t};(0,f.recordEvent)("analytics_table_sort",r)},onPageChange:(e,t)=>{O.current.scrollIntoView();const r=O.current.nextSibling.querySelector(".woocommerce-table__table"),a=i.focus.focusable.find(r);a.length&&a[0].focus(),t&&("goto"===t?(0,f.recordEvent)("analytics_table_go_to_page",{report:m,page:e}):(0,f.recordEvent)("analytics_table_page_click",{report:m,direction:t}))},rows:J,rowsPerPage:parseInt(A.per_page,10)||g.QUERY_DEFAULTS.pageSize,summary:Z,totalRows:$,...D})]})};C.propTypes={baseSearchQuery:p().object,compareBy:p().string,compareParam:p().string,columnPrefsKey:p().string,endpoint:p().string,extendItemsMethodNames:p().shape({getError:p().string,isRequesting:p().string,load:p().string}),extendedItemsStoreName:p().string,getHeadersContent:p().func.isRequired,getRowsContent:p().func.isRequired,getSummary:p().func,itemIdField:p().string,labels:p().shape({compareButton:p().string,downloadButton:p().string,helpText:p().string,placeholder:p().string}),primaryData:p().object,searchBy:p().string,summaryFields:p().arrayOf(p().string),tableData:p().object.isRequired,tableQuery:p().object,title:p().string.isRequired},C.defaultProps={primaryData:{},tableData:{items:{data:[],totalResults:0},query:{}},tableQuery:{},compareParam:"filter",downloadable:!1,onSearch:d.noop,baseSearchQuery:{}};const S=[],x={},R=(0,n.compose)((0,l.withSelect)((e,t)=>{const{endpoint:r,getSummary:a,isRequesting:o,itemIdField:s,query:n,tableData:i,tableQuery:l,filters:c,advancedFilters:u,summaryFields:p,extendedItemsStoreName:m}=t,_=e(g.REPORTS_STORE_NAME),y=m?e(m):null,{woocommerce_default_date_range:h}=e(g.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings"),f=n.search&&!(n[r]&&n[r].length);if(o||f)return x;const b="categories"===r?"products":r,v=a?(0,g.getReportChartData)({endpoint:b,selector:_,dataType:"primary",query:n,filters:c,advancedFilters:u,defaultDateRange:h,fields:p}):x,k=i||(0,g.getReportTableData)({endpoint:r,query:n,selector:_,tableQuery:l,filters:c,advancedFilters:u,defaultDateRange:h}),C=y?function(e,t,r){const{extendItemsMethodNames:a,itemIdField:o}=t,s=r.items.data;if(!(Array.isArray(s)&&s.length&&a&&o))return r;const{[a.getError]:n,[a.isRequesting]:i,[a.load]:l}=e,c={include:s.map(e=>e[o]).join(","),per_page:s.length},u=l(c),p=!!i&&i(c),m=!!n&&n(c),_=s.map(e=>{const t=(0,d.first)(u.filter(t=>e.id===t.id));return{...e,...t}}),y=r.isRequesting||p,h=r.isError||m;return{...r,isRequesting:y,isError:h,items:{...r.items,data:_}}}(y,t,k):k;return{primaryData:v,ids:s&&C.items.data?C.items.data.map(e=>e[s]):S,tableData:C,query:n}}),(0,l.withDispatch)(e=>{const{startExport:t}=e(g.EXPORT_STORE_NAME),{createNotice:r}=e("core/notices"),{addCesSurveyForCustomerSearch:a}=e(m.STORE_KEY);return{createNotice:r,startExport:t,addCesSurveyForCustomerSearch:a}}))(C)},9281:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>w});var a=r(6087),o=r(5556),s=r.n(o),n=r(7723),i=r(2619),l=r(7057),d=r(274);const c=(0,i.applyFilters)("dokan_analytics_orders_report_charts",[{key:"orders_count",label:(0,n.__)("Orders","dokan"),type:"number"},{key:"net_revenue",label:(0,n.__)("Net sales","dokan"),order:"desc",orderby:"net_total",type:"currency"},{key:"avg_order_value",label:(0,n.__)("Average order value","dokan"),type:"currency"},{key:"avg_items_per_order",label:(0,n.__)("Average items per order","dokan"),order:"desc",orderby:"num_items_sold",type:"average"}]),u=(0,i.applyFilters)("dokan_analytics_orders_report_filters",[{label:(0,n.__)("Show","dokan"),staticParams:["chartType","paged","per_page"],param:"filter",showFilters:()=>!0,filters:[{label:(0,n.__)("All orders","dokan"),value:"all"},{label:(0,n.__)("Advanced filters","dokan"),value:"advanced"}]}]),p=(0,i.applyFilters)("dokan_analytics_orders_report_advanced_filters",{title:(0,n._x)("Orders match <select/> filters","A sentence describing filters for Orders. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ","dokan"),filters:{status:{labels:{add:(0,n.__)("Order status","dokan"),remove:(0,n.__)("Remove order status filter","dokan"),rule:(0,n.__)("Select an order status filter match","dokan"),
/* translators: A sentence describing an Order Status filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ */
title:(0,n.__)("<title>Order status</title> <rule/> <filter/>","dokan"),filter:(0,n.__)("Select an order status","dokan")},rules:[{value:"is",
/* translators: Sentence fragment, logical, "Is" refers to searching for orders matching a chosen order status. Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Is","order status","dokan")},{value:"is_not",
/* translators: Sentence fragment, logical, "Is Not" refers to searching for orders that don\'t match a chosen order status. Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Is Not","order status","dokan")}],input:{component:"SelectControl",options:Object.keys(d.wm).map(e=>({value:e,label:d.wm[e]}))}},product:{labels:{add:(0,n.__)("Product","dokan"),placeholder:(0,n.__)("Search products","dokan"),remove:(0,n.__)("Remove product filter","dokan"),rule:(0,n.__)("Select a product filter match","dokan"),
/* translators: A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ */
title:(0,n.__)("<title>Product</title> <rule/> <filter/>","dokan"),filter:(0,n.__)("Select products","dokan")},rules:[{value:"includes",
/* translators: Sentence fragment, logical, "Includes" refers to orders including a given product(s). Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Includes","products","dokan")},{value:"excludes",
/* translators: Sentence fragment, logical, "Excludes" refers to orders excluding a given product(s). Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Excludes","products","dokan")}],input:{component:"Search",type:"products",getLabels:l.p0}},variation:{labels:{add:(0,n.__)("Product variation","dokan"),placeholder:(0,n.__)("Search product variations","dokan"),remove:(0,n.__)("Remove product variation filter","dokan"),rule:(0,n.__)("Select a product variation filter match","dokan"),
/* translators: A sentence describing a Variation filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ */
title:(0,n.__)("<title>Product variation</title> <rule/> <filter/>","dokan"),filter:(0,n.__)("Select variation","dokan")},rules:[{value:"includes",
/* translators: Sentence fragment, logical, "Includes" refers to orders including a given variation(s). Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Includes","variations","dokan")},{value:"excludes",
/* translators: Sentence fragment, logical, "Excludes" refers to orders excluding a given variation(s). Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Excludes","variations","dokan")}],input:{component:"Search",type:"variations",getLabels:l.b8}},coupon:{labels:{add:(0,n.__)("Coupon code","dokan"),placeholder:(0,n.__)("Search coupons","dokan"),remove:(0,n.__)("Remove coupon filter","dokan"),rule:(0,n.__)("Select a coupon filter match","dokan"),
/* translators: A sentence describing a Coupon filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ */
title:(0,n.__)("<title>Coupon code</title> <rule/> <filter/>","dokan"),filter:(0,n.__)("Select coupon codes","dokan")},rules:[{value:"includes",
/* translators: Sentence fragment, logical, "Includes" refers to orders including a given coupon code(s). Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Includes","coupon code","dokan")},{value:"excludes",
/* translators: Sentence fragment, logical, "Excludes" refers to orders excluding a given coupon code(s). Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Excludes","coupon code","dokan")}],input:{component:"Search",type:"coupons",getLabels:l.U4}},customer_type:{labels:{add:(0,n.__)("Customer type","dokan"),remove:(0,n.__)("Remove customer filter","dokan"),rule:(0,n.__)("Select a customer filter match","dokan"),
/* translators: A sentence describing a Customer filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ */
title:(0,n.__)("<title>Customer is</title> <filter/>","dokan"),filter:(0,n.__)("Select a customer type","dokan")},input:{component:"SelectControl",options:[{value:"new",label:(0,n.__)("New","dokan")},{value:"returning",label:(0,n.__)("Returning","dokan")}],defaultOption:"new"}},refunds:{labels:{add:(0,n.__)("Refund","dokan"),remove:(0,n.__)("Remove refund filter","dokan"),rule:(0,n.__)("Select a refund filter match","dokan"),title:(0,n.__)("<title>Refund</title> <filter/>","dokan"),filter:(0,n.__)("Select a refund type","dokan")},input:{component:"SelectControl",options:[{value:"all",label:(0,n.__)("All","dokan")},{value:"partial",label:(0,n.__)("Partially refunded","dokan")},{value:"full",label:(0,n.__)("Fully refunded","dokan")},{value:"none",label:(0,n.__)("None","dokan")}],defaultOption:"all"}},tax_rate:{labels:{add:(0,n.__)("Tax rate","dokan"),placeholder:(0,n.__)("Search tax rates","dokan"),remove:(0,n.__)("Remove tax rate filter","dokan"),rule:(0,n.__)("Select a tax rate filter match","dokan"),
/* translators: A sentence describing a tax rate filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ */
title:(0,n.__)("<title>Tax Rate</title> <rule/> <filter/>","dokan"),filter:(0,n.__)("Select tax rates","dokan")},rules:[{value:"includes",
/* translators: Sentence fragment, logical, "Includes" refers to orders including a given tax rate(s). Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Includes","tax rate","dokan")},{value:"excludes",
/* translators: Sentence fragment, logical, "Excludes" refers to orders excluding a given tax rate(s). Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Excludes","tax rate","dokan")}],input:{component:"Search",type:"taxes",getLabels:l.jx}},attribute:{allowMultiple:!0,labels:{add:(0,n.__)("Product attribute","dokan"),placeholder:(0,n.__)("Search product attributes","dokan"),remove:(0,n.__)("Remove product attribute filter","dokan"),rule:(0,n.__)("Select a product attribute filter match","dokan"),
/* translators: A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cSsUY9VeCVJ */
title:(0,n.__)("<title>Product attribute</title> <rule/> <filter/>","dokan"),filter:(0,n.__)("Select attributes","dokan")},rules:[{value:"is",
/* translators: Sentence fragment, logical, "Is" refers to searching for products matching a chosen attribute. Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Is","product attribute","dokan")},{value:"is_not",
/* translators: Sentence fragment, logical, "Is Not" refers to searching for products that don\'t match a chosen attribute. Screenshot for context: https://cloudup.com/cSsUY9VeCVJ */
label:(0,n._x)("Is Not","product attribute","dokan")}],input:{component:"ProductAttribute"}}}});var m=r(331),_=r(8468),y=r(8846),h=r(3577),g=r(6476),f=r(7374),b=r(4111),v=r(8660),k=r(790);class C extends a.Component{constructor(){super(),this.getHeadersContent=this.getHeadersContent.bind(this),this.getRowsContent=this.getRowsContent.bind(this),this.getSummary=this.getSummary.bind(this)}getHeadersContent(){return[{label:(0,n.__)("Date","dokan"),key:"date",required:!0,defaultSort:!0,isLeftAligned:!0,isSortable:!0},{label:(0,n.__)("Order #","dokan"),screenReaderLabel:(0,n.__)("Order Number","dokan"),key:"order_number",required:!0},{label:(0,n.__)("Status","dokan"),key:"status",required:!1,isSortable:!1},{label:(0,n.__)("Customer","dokan"),key:"customer_id",required:!1,isSortable:!1},{label:(0,n.__)("Customer type","dokan"),key:"customer_type",required:!1,isSortable:!1},{label:(0,n.__)("Product(s)","dokan"),screenReaderLabel:(0,n.__)("Products","dokan"),key:"products",required:!1,isSortable:!1},{label:(0,n.__)("Items sold","dokan"),key:"num_items_sold",required:!1,isSortable:!0,isNumeric:!0},{label:(0,n.__)("Coupon(s)","dokan"),screenReaderLabel:(0,n.__)("Coupons","dokan"),key:"coupons",required:!1,isSortable:!1},{label:(0,n.__)("Net sales","dokan"),screenReaderLabel:(0,n.__)("Net sales","dokan"),key:"net_total",required:!0,isSortable:!0,isNumeric:!0},{label:(0,n.__)("Attribution","dokan"),screenReaderLabel:(0,n.__)("Attribution","dokan"),key:"attribution",required:!1,isSortable:!1}]}getCustomerName(e){const{first_name:t,last_name:r}=e||{};return t||r?[t,r].join(" "):""}getRowsContent(e){const{query:t}=this.props,r=(0,g.getPersistedQuery)(t),a=(0,d.Qk)("dateFormat",f.defaultTableDateFormat),{render:o,getCurrencyConfig:s}=this.context;return(0,_.map)(e,e=>{const{currency:t,date:i,net_total:l,num_items_sold:c,order_id:u,order_number:p,parent_id:m,status:_,customer_type:f}=e,b=e.extended_info||{},{coupons:v,customer:C,products:S}=b,x=S.sort((e,t)=>t.quantity-e.quantity).map(e=>({label:e.name,quantity:e.quantity,href:(0,g.getNewPath)(r,"/analytics/products",{filter:"single_product",products:e.id})})),R=v.map(e=>({label:e.code,href:(0,g.getNewPath)(r,"/analytics/coupons",{filter:"single_coupon",coupons:e.id})}));return[{display:(0,k.jsx)(y.Date,{date:i,visibleFormat:a}),value:i},{display:(0,k.jsx)(y.Link,{href:vendorAnalyticsDokanConfig.orderListPageUlr+"?order_id="+(m||u)+"&_wpnonce="+dokan?.order_nonce,type:"external",children:p}),value:p},{display:(0,k.jsx)(y.OrderStatus,{className:"woocommerce-orders-table__status",order:{status:_},labelPositionToLeft:!0,orderStatusMap:(0,d.Qk)("orderStatuses",{})}),value:_},{display:this.getCustomerName(C),value:this.getCustomerName(C)},{display:(q=f,q.charAt(0).toUpperCase()+q.slice(1)),value:f},{display:this.renderList(x.length?[x[0]]:[],x.map(e=>({label:(0,n.sprintf)(/* translators: 1: quantity, 2: product name */ /* translators: 1: quantity, 2: product name */
(0,n.__)("%1$s× %2$s","dokan"),e.quantity,e.label),href:e.href}))),value:x.map(({quantity:e,label:t})=>(0,n.sprintf)(/* translators: %1$s: quantity, %2$s: product name */ /* translators: %1$s: quantity, %2$s: product name */
(0,n.__)("%1$s× %2$s","dokan"),e,t)).join(", ")},{display:(0,h.formatValue)(s(),"number",c),value:c},{display:this.renderList(R.length?[R[0]]:[],R),value:R.map(e=>e.label).join(", ")},{display:o(l,t),value:l},{display:b.attribution.origin,value:b.attribution.origin}];var q})}getSummary(e){const{orders_count:t=0,total_customers:r=0,products:a=0,num_items_sold:o=0,coupons_count:s=0,net_revenue:i=0}=e,{formatAmount:l,getCurrencyConfig:d}=this.context,c=d();return[{label:(0,n._n)("Order","Orders",t,"dokan"),value:(0,h.formatValue)(c,"number",t)},{label:(0,n._n)(" Customer"," Customers",r,"dokan"),value:(0,h.formatValue)(c,"number",r)},{label:(0,n._n)("Product","Products",a,"dokan"),value:(0,h.formatValue)(c,"number",a)},{label:(0,n._n)("Item sold","Items sold",o,"dokan"),value:(0,h.formatValue)(c,"number",o)},{label:(0,n._n)("Coupon","Coupons",s,"dokan"),value:(0,h.formatValue)(c,"number",s)},{label:(0,n.__)("net sales","dokan"),value:l(i)}]}renderLinks(e=[]){return e.map((e,t)=>(0,k.jsx)(y.Link,{href:e.href.replace("admin.php",""),type:"wc-admin",children:e.label},t))}renderList(e,t){return(0,k.jsxs)(a.Fragment,{children:[this.renderLinks(e),t.length>1&&(0,k.jsx)(y.ViewMoreList,{items:this.renderLinks(t)})]})}render(){const{query:e,filters:t,advancedFilters:r}=this.props;return(0,k.jsx)(v.A,{endpoint:"orders",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["orders_count","total_customers","products","num_items_sold","coupons_count","net_revenue"],query:e,tableQuery:{extended_info:!0},title:(0,n.__)("Orders","dokan"),columnPrefsKey:"orders_report_columns",filters:t,advancedFilters:r})}}C.contextType=b.CurrencyContext;const S=C;var x=r(2703),R=r(9581),q=r(8222);class w extends a.Component{render(){const{path:e,query:t}=this.props;return(0,k.jsxs)(a.Fragment,{children:[(0,k.jsx)(q.A,{query:t,path:e,filters:u,advancedFilters:p,report:"orders"}),(0,k.jsx)(R.A,{charts:c,endpoint:"orders",query:t,selectedChart:(0,m.A)(t.chart,c),filters:u,advancedFilters:p}),(0,k.jsx)(x.A,{charts:c,endpoint:"orders",path:e,query:t,selectedChart:(0,m.A)(t.chart,c),filters:u,advancedFilters:p}),(0,k.jsx)(S,{query:t,filters:u,advancedFilters:p})]})}}w.propTypes={path:s().string.isRequired,query:s().object.isRequired}},9581:(e,t,r)=>{"use strict";r.d(t,{A:()=>b});var a=r(7723),o=r(6087),s=r(9491),n=r(7143),i=r(5556),l=r.n(i),d=r(6476),c=r(8846),u=r(3577),p=r(314),m=r(7374),_=r(3306),y=r(4111),h=r(4351),g=r(790);class f extends o.Component{formatVal(e,t){const{formatAmount:r,getCurrencyConfig:a}=this.context;return"currency"===t?r(e):(0,u.formatValue)(a(),t,e)}getValues(e,t){const{emptySearchResults:r,summaryData:a}=this.props,{totals:o}=a,s=o.primary?o.primary[e]:0,n=o.secondary?o.secondary[e]:0,i=r?0:s,l=r?0:n;return{delta:(0,u.calculateDelta)(i,l),prevValue:this.formatVal(l,t),value:this.formatVal(i,t)}}render(){const{charts:e,query:t,selectedChart:r,summaryData:o,endpoint:s,report:n,defaultDateRange:i}=this.props,{isError:l,isRequesting:u}=o;if(l)return(0,g.jsx)(h.A,{});if(u)return(0,g.jsx)(c.SummaryListPlaceholder,{numberOfItems:e.length});const{compare:p}=(0,m.getDateParamsFromQuery)(t,i);return(0,g.jsx)(c.SummaryList,{children:({onToggle:t})=>e.map(e=>{const{key:o,order:i,orderby:l,label:u,type:m,isReverseTrend:y,labelTooltipText:h}=e,f={chart:o};l&&(f.orderby=l),i&&(f.order=i);const b=(0,d.getNewPath)(f),v=r.key===o,{delta:k,prevValue:C,value:S}=this.getValues(o,m);return(0,g.jsx)(c.SummaryNumber,{delta:k,href:b,label:u,reverseTrend:y,prevLabel:"previous_period"===p?(0,a.__)("Previous period:","dokan"):(0,a.__)("Previous year:","dokan"),prevValue:C,selected:v,value:S,labelTooltipText:h,onLinkClickCallback:()=>{t&&t(),(0,_.recordEvent)("analytics_chart_tab_click",{report:n||s,key:o})}},o)})})}}f.propTypes={charts:l().array.isRequired,endpoint:l().string.isRequired,limitProperties:l().array,query:l().object.isRequired,selectedChart:l().shape({key:l().string.isRequired,label:l().string.isRequired,order:l().oneOf(["asc","desc"]),orderby:l().string,type:l().oneOf(["average","number","currency"]).isRequired}).isRequired,summaryData:l().object,report:l().string},f.defaultProps={summaryData:{totals:{primary:{},secondary:{}},isError:!1}},f.contextType=y.CurrencyContext;const b=(0,s.compose)((0,n.withSelect)((e,t)=>{const{charts:r,endpoint:a,limitProperties:o,query:s,filters:n,advancedFilters:i}=t,l=o||[a],d=l.some(e=>s[e]&&s[e].length);if(s.search&&!d)return{emptySearchResults:!0};const c=r&&r.map(e=>e.key),{woocommerce_default_date_range:u}=e(p.SETTINGS_STORE_NAME).getSetting("wc_admin","wcAdminSettings");return{summaryData:(0,p.getSummaryNumbers)({endpoint:a,query:s,select:e,limitBy:l,filters:n,advancedFilters:i,defaultDateRange:u,fields:c}),defaultDateRange:u}}))(f)}}]);