var e=Object.defineProperty,a=Object.defineProperties,t=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,l=(a,t,s)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,n=(e,a)=>{for(var t in a||(a={}))r.call(a,t)&&l(e,t,a[t]);if(s)for(var t of s(a))i.call(a,t)&&l(e,t,a[t]);return e};import{w as o,H as c,_ as d}from"./index--YmvTphz.js";import{d as m,r as u,k as p,o as v,H as f,a0 as h,a3 as _,f as y,a8 as g,a1 as b}from"./vendor-C4fU48ba.js";import{u as k,i as P,a as w,b as j,c as D}from"./installCanvasRenderer-6BeeRync.js";import{i as L,a as O}from"./install-C_w2vyTz.js";import{R as Y}from"./antd-31u6eFi9.js";import"./utils-uTUGmQQn.js";const C=m({components:{},setup(){let e,s=u({dataList:{}}),r=u({rangePickerValue:[],userType:""}),i=p([{label:"all",value:""},{label:"visitor",value:"visitor"},{label:"trial",value:"trial"},{label:"official",value:"official"}]),l=()=>{return e=null,a=null,t=function*(){var e,a;let t=(null==(e=r.rangePickerValue)?void 0:e[0])?r.rangePickerValue[0]+" 00:00:00":"",i={endTime:(null==(a=r.rangePickerValue)?void 0:a[1])?r.rangePickerValue[1]+" 23:59:59":"",startTime:t};c.axiosGet(c.httpUrls.trialUserCountry,{params:i}).then(e=>{if(e){let a=[];e.names.forEach((t,s)=>{let r={name:t,value:e.values[s]};a.push(r)}),s.dataList=a,d(a)}})},new Promise((s,r)=>{var i=e=>{try{n(t.next(e))}catch(a){r(a)}},l=e=>{try{n(t.throw(e))}catch(a){r(a)}},n=e=>e.done?s(e.value):Promise.resolve(e.value).then(i,l);n((t=t.apply(e,a)).next())});var e,a,t},d=a=>{if(e)e.setOption({series:[{data:a}]});else{k([w,j,L,D,O]);var t,s=m.value;e=P(s),(t={tooltip:{trigger:"item"},legend:{top:"5%",left:"center"},series:[{type:"pie",radius:"55%",center:["50%","55%"],data:a,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]})&&e.setOption(t)}},m=p();return v(()=>{l()}),h=n(n({},f(s)),f(r)),a(h,t({lastGeTrialList:e=>{let a,t=new Date,s=Math.floor(t.getTime()/1e3);"year"==e?a=s-31104e3:"month"==e?a=s-2592e3:"week"==e&&(a=s-604800),r.rangePickerValue=[o(a,"YYYY-MM-DD"),o(s,"YYYY-MM-DD")],l()},state:i,searchHistoryList:()=>{l()},gettrialList:l,pageChartDom:m}));var h},data:()=>({}),methods:{}}),T={class:"recentNewUserChart admin_page"},V={class:"admin_table_search"},x={class:"admin_state"},H={class:"admin_state_item"},M={class:"admin_search"},G={class:"admin_state_list"},S={class:"admin_table_content",ref:"pageChartDom"};const U=d(C,[["render",function(e,a,t,s,r,i){const l=Y;return b(),h("div",T,[_("div",V,[_("div",x,[_("div",H,[a[6]||(a[6]=_("span",null,"Select Time:",-1)),y(l,{style:{width:"250px"},class:"range_picker",value:e.rangePickerValue,"onUpdate:value":a[0]||(a[0]=a=>e.rangePickerValue=a),placeholder:[e.$t("HistoryPage.StartDate"),e.$t("HistoryPage.EndDate")],valueFormat:"YYYY-MM-DD"},{suffixIcon:g(()=>a[5]||(a[5]=[_("span",{class:"icon iconfont range_picker_icon icon-rili"},null,-1)])),_:1},8,["value","placeholder"])])]),_("div",M,[_("div",{class:"admin_search_item",onClick:a[1]||(a[1]=(...a)=>e.searchHistoryList&&e.searchHistoryList(...a))},"Search")]),_("div",G,[_("div",{class:"admin_state_list_item",onClick:a[2]||(a[2]=a=>e.lastGeTrialList("year"))},"Nearly a year"),_("div",{class:"admin_state_list_item",onClick:a[3]||(a[3]=a=>e.lastGeTrialList("month"))},"Last month"),_("div",{class:"admin_state_list_item",onClick:a[4]||(a[4]=a=>e.lastGeTrialList("week"))},"Last week")])]),_("div",S,null,512)])}]]);export{U as default};
