var e=Object.defineProperty,a=Object.defineProperties,t=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,l=(a,t,r)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,n=(e,a)=>{for(var t in a||(a={}))s.call(a,t)&&l(e,t,a[t]);if(r)for(var t of r(a))i.call(a,t)&&l(e,t,a[t]);return e};import{x as o,H as c,_ as d}from"./index-ANzWZHpw.js";import{d as m,r as p,k as u,o as v,H as f,a0 as h,a3 as _,f as g,a8 as b,a1 as y}from"./vendor-DezibNX8.js";import{u as k,i as P,a as w,b as O,c as L}from"./installCanvasRenderer-6BeeRync.js";import{i as j,a as D}from"./install-C_w2vyTz.js";import{R as T}from"./antd-CKo75OZH.js";import"./utils-D7vwahzQ.js";const Y=m({components:{},setup(){let e,r=p({dataList:{}}),s=p({rangePickerValue:[]}),i=()=>{return e=null,a=null,t=function*(){var e,a;let t=(null==(e=s.rangePickerValue)?void 0:e[0])?s.rangePickerValue[0]+" 00:00:00":"",i={endTime:(null==(a=s.rangePickerValue)?void 0:a[1])?s.rangePickerValue[1]+" 23:59:59":"",startTime:t};c.axiosGet(c.httpUrls.conversionRate,{params:i}).then(e=>{if(e){let a=Object.entries(e),t=[];for(let[e,r]of a){let a;if("conversionRate"!=e){a="trialToOfficialCount"==e?"Trial To Official":"Trial User";let s={name:a,value:r};t.push(s)}}r.dataList=t,l(t)}})},new Promise((r,s)=>{var i=e=>{try{n(t.next(e))}catch(a){s(a)}},l=e=>{try{n(t.throw(e))}catch(a){s(a)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,l);n((t=t.apply(e,a)).next())});var e,a,t},l=a=>{if(e)e.setOption({series:[{data:a}]});else{k([w,O,j,L,D]);var t,r=d.value;e=P(r),(t={tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{top:"10%",left:"center"},series:[{name:"Rate",type:"pie",radius:["40%","70%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:10},label:{show:!1,position:"center"},emphasis:{label:{show:!0,fontSize:30,fontWeight:"bold"}},labelLine:{show:!1},data:a}]})&&e.setOption(t)}},d=u();return v(()=>{i()}),m=n(n({},f(r)),f(s)),a(m,t({lastGeTrialList:e=>{let a,t=new Date,r=Math.floor(t.getTime()/1e3);"year"==e?a=r-31104e3:"month"==e?a=r-2592e3:"week"==e&&(a=r-604800),s.rangePickerValue=[o(a,"YYYY-MM-DD"),o(r,"YYYY-MM-DD")],i()},searchHistoryList:()=>{i()},gettrialList:i,pageChartDom:d}));var m},data:()=>({}),methods:{}}),C={class:"recentNewUserChart admin_page"},x={class:"admin_table_search"},V={class:"admin_state"},H={class:"admin_state_item"},M={class:"admin_search"},R={class:"admin_state_list"},S={class:"admin_table_content",ref:"pageChartDom"};const G=d(Y,[["render",function(e,a,t,r,s,i){const l=T;return y(),h("div",C,[_("div",x,[_("div",V,[_("div",H,[a[6]||(a[6]=_("span",null,"Select Time:",-1)),g(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:b(()=>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",R,[_("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{G as default};
