77 lines
1.1 MiB
JavaScript
77 lines
1.1 MiB
JavaScript
import{o as Ii,c as Xo,J as qR,d as iA,h as Bp,a as Ht,F as oA,p as sA,j as an,i as KR,w as lA,t as fn,_ as fl,K as jR,I as aa,g as Qe,x as JR,L as QR,b as Ps,e as tk,y as ek,G as rk,M as ak}from"./index-46ad6f18.js";import{m as nk,_ as ik}from"./index-f943fa9e.js";import{_ as ok}from"./BasicSelect.vue_vue_type_style_index_0_lang-95a4f715.js";import{_ as sk}from"./button.vue_vue_type_style_index_0_lang-00692d4d.js";import{_ as lk}from"./_plugin-vue_export-helper-296b8bb1.js";import{I as uk}from"./Icon-c7d1ee6c.js";import{u as fk}from"./usePrice-7afab779.js";import{a as vk}from"./useDataTime-d8f2c6fb.js";import"./styleChecker-1b8f3fec.js";import"./vnode-3f18e55e.js";import"./useState-ba6a6598.js";import"./index-7636dfa0.js";import"./BasicModal.vue_vue_type_style_index_0_lang-c4a9b750.js";import"./index-3e027524.js";const hk={},ck={class:"bg-gradient"};function dk(r,e){return Ii(),Xo("div",ck,[qR(r.$slots,"default")])}const pk=lk(hk,[["render",dk]]),gk="/assets/totalsales-b298228f.svg",yk="/assets/orders-4e5dd0bd.svg",mk="/assets/customers-aa15910e.svg",_k="/assets/salesnumber-bffd0c96.svg",Sk={class:"grid grid-cols-1 md:grid-cols-4 gap-3"},xk={class:"flex"},bk=["src","alt"],wk={class:"flex flex-col justify-between w-full mr-2"},Tk={class:"text-base font-bold"},Ck={class:"flex items-center justify-end"},Ak={class:"text-base font-bold"},Mk={class:"mr-1"},Dk=iA({__name:"Header",props:{statistics:{}},setup(r){const e=r,t=Bp(()=>{var a;return[{title:"تعداد پیام ها",alt:"total-sales",image:gk,value:((a=e.statistics.total_sale)==null?void 0:a.toLocaleString("fa-IR"))||"0",unit:"پیام"},{title:"پربازدیدترین قصه",alt:"orders",image:yk,value:e.statistics.count_order,unit:"بازدید"},{title:"کاربران جدید",alt:"customers",image:mk,value:e.statistics.new_customer,unit:"نفر"},{title:"تعداد کاربران",alt:"sales-number",image:_k,value:e.statistics.count_sale_order,unit:"نفر"}]});return(a,n)=>(Ii(),Xo("div",null,[Ht("div",Sk,[(Ii(!0),Xo(oA,null,sA(an(t),(i,o)=>(Ii(),KR(pk,{class:"h-[120px] p-5",key:o},{default:lA(()=>[Ht("div",xk,[Ht("div",null,[Ht("img",{class:"w-20 h-20",src:i.image,alt:i.alt},null,8,bk)]),Ht("div",wk,[Ht("div",null,[Ht("span",Tk,fn(i.title),1)]),Ht("div",Ck,[Ht("span",Ak,fn(i.value),1),Ht("span",Mk,fn(i.unit),1)])])])]),_:2},1024))),128))])]))}}),Lk=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,customRender:r=>r.index+1},{title:"نام",dataIndex:"fname",key:"fname"},{title:"نام خانوادگی",dataIndex:"lname",key:"lname"},{title:"شماره همراه",dataIndex:"mobile",key:"mobile"},{title:"زمان ثبت نام",dataIndex:"created_at",key:"created_at",customRender:r=>r.record.created_at?nk(r.record.created_at).add(3,"hours").add(30,"minutes").format("jYYYY/jMM/jDD-HH:mm:ss"):"-"},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1}],Ik=async r=>{const{TableEngineRequest:e}=await fl(()=>import("./buildSupabaseQuery-fd1cfe58.js"),["assets/buildSupabaseQuery-fd1cfe58.js","assets/index-46ad6f18.js","assets/index-44d4db91.css"]),t={...r};!t.sort&&!t.order&&(t.order="-created_at");const a=await e(t,"users");try{const n=Array.isArray(a==null?void 0:a.rows)?a.rows[0]:a}catch(n){console.log("[getCustomerTable] log error:",n)}try{if(Array.isArray(a==null?void 0:a.rows)){const n=a.rows.map(i=>({id:i.id??null,fname:i.first_name,lname:i.last_name,mobile:i.phone,...i}));return{...a,rows:n}}}catch(n){console.log("[getCustomerTable] normalize error:",n)}return a},Pk=async()=>await jR.get("/admin/report"),Rk=async r=>{const{type:e,item_id:t,date:a}=r,n=a?new Date(a):new Date;if(e==="hourly"){const i=n.toISOString().split("T")[0];let o=aa.from("user_views_hourly").select("*").eq("day",i).eq("type","story").order("hour");t&&(o=o.eq("item_id",t));const{data:s,error:l}=await o;if(l)throw l;return s||[]}else{const i=new Date(n);i.setDate(n.getDate()-29);const o=i.toISOString().split("T")[0],s=n.toISOString().split("T")[0];let l=aa.from("user_views_hourly").select("*").eq("type","story").gte("day",o).lte("day",s).order("day").or
|
||||
|
|
Copyright (c) Microsoft Corporation.
|
|||
|
|
|
|||
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|||
|
|
purpose with or without fee is hereby granted.
|
|||
|
|
|
|||
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|||
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|||
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|||
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|||
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|||
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|||
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|||
|
|
***************************************************************************** */var Np=function(r,e){return Np=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])},Np(r,e)};function V(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Np(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Nk=function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r}(),Vk=function(){function r(){this.browser=new Nk,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return r}(),nn=new Vk;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(nn.wxa=!0,nn.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?nn.worker=!0:!nn.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(nn.node=!0,nn.svgSupported=!0):zk(navigator.userAgent,nn);function zk(r,e){var t=e.browser,a=r.match(/Firefox\/([\d.]+)/),n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),i=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);a&&(t.firefox=!0,t.version=a[1]),n&&(t.ie=!0,t.version=n[1]),i&&(t.edge=!0,t.version=i[1],t.newEdge=+i[1].split(".")[0]>18),o&&(t.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11);var s=e.domSupported=typeof document<"u";if(s){var l=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in l||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}}const It=nn;var qy=12,uA="sans-serif",Ba=qy+"px "+uA,Gk=20,Fk=100,Hk="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function Wk(r){var e={};if(typeof JSON>"u")return e;for(var t=0;t<r.length;t++){var a=String.fromCharCode(t+32),n=(r.charCodeAt(t)-Gk)/Fk;e[a]=n}return e}var $k=Wk(Hk),Nr={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:function(){var r,e;return function(t,a){if(!r){var n=Nr.createCanvas();r=n&&n.getContext("2d")}if(r)return e!==a&&(e=r.font=a||Ba),r.measureText(t);t=t||"",a=a||Ba;var i=/((?:\d+)?\.?\d*)px/.exec(a),o=i&&+i[1]||qy,s=0;if(a.indexOf("mono")>=0)s=o*t.length;else for(var l=0;l<t.length;l++){var u=$k[t[l]];s+=u==null?o:u*o}return{width:s}}}(),loadImage:function(r,e,t){var a=new Image;return a.onload=e,a.onerror=t,a.src=r,a}},fA=da(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(r,e){return r["[object "+e+"]"]=!0,r},{}),vA=da(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(r,e){return r["[object "+e+"Array]"]=!0,r},{}),ds=Object.prototype.toString,_h=Array.prototype,Uk=_h.forEach,Yk=_h.filter,Ky=_h.slice,Zk=_h.map,S_=function(){}.constructor,Iu=S_?S_.prototype:null,jy="__proto__",Xk=2311;function hA(){return Xk++}function Jy(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];typeof console<"u"&&console.error.apply(console,r)}function rt(r){if(r==null||typeof r!="object")return r;var e=r,t=ds.call(r);if(t==="[object Array]"){if(!Tl(r)){e=[];for(var a=0,n=r.length;a<n;a++)e[a]=rt(r[a])}}else if(vA[t]){if(!Tl(r)){var i=r.constructor;if(i.from)e=i.from(r);else{e=new i(r.length);for(var a=0,n=r.length;a<n;a++)e[a]=r[a]}}}else if(!fA[t]&&!Tl(r)&&!ts(r)){e={};for(var o in r)r.hasOwnProperty(o)&&o!==jy&&(e[o]=rt(r[o]))}return e}function yt(r,e,t){if(!st(e)||!st(r))return t?rt(e):r;for(var a in e)if(e.hasOwnProperty(a)&
|
|||
|
|
Copyright (c) Microsoft Corporation.
|
|||
|
|
|
|||
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|||
|
|
purpose with or without fee is hereby granted.
|
|||
|
|
|
|||
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|||
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|||
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|||
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|||
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|||
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|||
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|||
|
|
***************************************************************************** */var zp=function(r,e){return zp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])},zp(r,e)};function Ut(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");zp(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ji(r,e){return r==null&&(r=0),e==null&&(e=0),[r,e]}function Ve(r,e){return r[0]=e[0],r[1]=e[1],r}function Pa(r){return[r[0],r[1]]}function em(r,e,t){return r[0]=e,r[1]=t,r}function b_(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}function Gp(r,e,t,a){return r[0]=e[0]+t[0]*a,r[1]=e[1]+t[1]*a,r}function bi(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}function Fp(r){return Math.sqrt(rE(r))}function rE(r){return r[0]*r[0]+r[1]*r[1]}function Yf(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r}function ps(r,e){var t=Fp(e);return t===0?(r[0]=0,r[1]=0):(r[0]=e[0]/t,r[1]=e[1]/t),r}function Hp(r,e){return Math.sqrt((r[0]-e[0])*(r[0]-e[0])+(r[1]-e[1])*(r[1]-e[1]))}var vn=Hp;function aE(r,e){return(r[0]-e[0])*(r[0]-e[0])+(r[1]-e[1])*(r[1]-e[1])}var Pi=aE;function Zf(r,e,t,a){return r[0]=e[0]+a*(t[0]-e[0]),r[1]=e[1]+a*(t[1]-e[1]),r}function re(r,e,t){var a=e[0],n=e[1];return r[0]=t[0]*a+t[2]*n+t[4],r[1]=t[1]*a+t[3]*n+t[5],r}function hn(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}function cn(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}var fo=function(){function r(e,t){this.target=e,this.topTarget=t&&t.topTarget}return r}(),nE=function(){function r(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return r.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new fo(t,e),"dragstart",e.event))},r.prototype._drag=function(e){var t=this._draggingTarget;if(t){var a=e.offsetX,n=e.offsetY,i=a-this._x,o=n-this._y;this._x=a,this._y=n,t.drift(i,o,e),this.handler.dispatchToElement(new fo(t,e),"drag",e.event);var s=this.handler.findHover(a,n,t).target,l=this._dropTarget;this._dropTarget=s,t!==s&&(l&&s!==l&&this.handler.dispatchToElement(new fo(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new fo(s,e),"dragenter",e.event))}},r.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new fo(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new fo(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},r}();const iE=nE;var oE=function(){function r(e){e&&(this._$eventProcessor=e)}return r.prototype.on=function(e,t,a,n){this._$handlers||(this._$handlers={});var i=this._$handlers;if(typeof t=="function"&&(n=a,a=t,t=null),!a||!e)return this;var o=this._$eventProcessor;t!=null&&o&&o.normalizeQuery&&(t=o.normalizeQuery(t)),i[e]||(i[e]=[]);for(var s=0;s<i[e].length;s++)if(i[e][s].h===a)return this;var l={h:a,query:t,ctx:n||this,callAtLast:a.zrEventfulCallAtLast},u=i[e].length-1,f=i[e][u];return f&&f.callAtLast?i[e].splice(u,0,l):i[e].push(l),this},r.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},r.prototype.off=function(e,t){var a=this._$handlers;if(!a)return this;if(!e)return this._$handlers={},this;if(t){if(a[e]){for(var n=[],i=0,o=a[e].length;i<o;i++)a[e][i].h!==t&&n.push(a[e][i]);a[e]=n}a[e]&&a[e].length===0&&delete a[e]}else delete a[e];return this},r.prototype.trigger=function(e){for(var t=[],a=1;a<arguments.length;a++)t[a-1]=arguments[a];if(!this._$handlers)return this;var n=this._$handlers[e],i=this._$eventProcessor;if(n)for(var o=t.length,s=n.length,l=0;l<s;l++){var u=n[l];if(!(i&&i.filter&&u.query!=null&&!i.filter(e,u.query)))switch(o){case 0:u.h.call(u.ctx);break;case 1:u.h.call(u.ctx,t[0]);bre
|
|||
|
|
`),i=n.length;if(i===1)return X_(n[0],e,t,a);for(var o=new lt(0,0,0,0),s=0;s<n.length;s++){var l=X_(n[s],e,t,a);s===0?o.copy(l):o.union(l)}return o}function rs(r,e,t,a){return t==="right"?a?r+=e:r-=e:t==="center"&&(a?r+=e/2:r-=e/2),r}function Ri(r,e,t,a){return t==="middle"?a?r+=e/2:r-=e/2:t==="bottom"&&(a?r+=e:r-=e),r}function du(r){return ha(r).stWideCharWidth}function zr(r,e){return typeof r=="string"?r.lastIndexOf("%")>=0?parseFloat(r)/100*e:parseFloat(r):r}function bv(r,e,t){var a=e.position||"inside",n=e.distance!=null?e.distance:5,i=t.height,o=t.width,s=i/2,l=t.x,u=t.y,f="left",v="top";if(a instanceof Array)l+=zr(a[0],t.width),u+=zr(a[1],t.height),f=null,v=null;else switch(a){case"left":l-=n,u+=s,f="right",v="middle";break;case"right":l+=n+o,u+=s,v="middle";break;case"top":l+=o/2,u-=n,f="center",v="bottom";break;case"bottom":l+=o/2,u+=i+n,f="center";break;case"inside":l+=o/2,u+=s,f="center",v="middle";break;case"insideLeft":l+=n,u+=s,v="middle";break;case"insideRight":l+=o-n,u+=s,f="right",v="middle";break;case"insideTop":l+=o/2,u+=n,f="center";break;case"insideBottom":l+=o/2,u+=i-n,f="center",v="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,f="right";break;case"insideBottomLeft":l+=n,u+=i-n,v="bottom";break;case"insideBottomRight":l+=o-n,u+=i-n,f="right",v="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=f,r.verticalAlign=v,r}var Cc="__zr_normal__",Ac=ga.concat(["ignore"]),mO=da(ga,function(r,e){return r[e]=!0,r},{ignore:!1}),co={},_O=new lt(0,0,0,0),zu=[],lm=function(){function r(e){this.id=hA(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return r.prototype._init=function(e){this.attr(e)},r.prototype.drift=function(e,t,a){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=e,n[5]+=t,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var a=this.textConfig,n=a.local,i=t.innerTransformable,o=void 0,s=void 0,l=!1;i.parent=n?this:null;var u=!1;i.copyTransform(t);var f=a.position!=null,v=a.autoOverflowArea,h=void 0;if((v||f)&&(h=_O,a.layoutRect?h.copy(a.layoutRect):h.copy(this.getBoundingRect()),n||h.applyTransform(this.transform)),f){this.calculateTextPosition?this.calculateTextPosition(co,a,h):bv(co,a,h),i.x=co.x,i.y=co.y,o=co.align,s=co.verticalAlign;var c=a.origin;if(c&&a.rotation!=null){var d=void 0,p=void 0;c==="center"?(d=h.width*.5,p=h.height*.5):(d=zr(c[0],h.width),p=zr(c[1],h.height)),u=!0,i.originX=-i.x+d+(n?0:h.x),i.originY=-i.y+p+(n?0:h.y)}}a.rotation!=null&&(i.rotation=a.rotation);var g=a.offset;g&&(i.x+=g[0],i.y+=g[1],u||(i.originX=-g[0],i.originY=-g[1]));var y=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(v){var m=y.overflowRect=y.overflowRect||new lt(0,0,0,0);i.getLocalTransform(zu),Vr(zu,zu),lt.copy(m,h),m.applyTransform(zu)}else y.overflowRect=null;var _=a.inside==null?typeof a.position=="string"&&a.position.indexOf("inside")>=0:a.inside,S=void 0,b=void 0,x=void 0;_&&this.canBeInsideText()?(S=a.insideFill,b=a.insideStroke,(S==null||S==="auto")&&(S=this.getInsideTextFill()),(b==null||b==="auto")&&(b=this.getInsideTextStroke(S),x=!0)):(S=a.outsideFill,b=a.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(b==null||b==="auto")&&(b=this.getOutsideStroke(S),x=!0)),S=S||"#000",(S!==y.fill||b!==y.stroke||x!==y.autoStroke||o!==y.align||s!==y.verticalAlign)&&(l=!0,y.fill=S,y.stroke=b,y.autoStroke=x,y.align=o,y.verticalAlign=s,t.setDefaultTextStyle(y)),t.__dirty|=ar,l&&t.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(e){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?ug:lg},r.prototype.getOutsid
|
|||
|
|
* ZRender, a high performance 2d drawing library.
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2013, Baidu Inc.
|
|||
|
|
* All rights reserved.
|
|||
|
|
*
|
|||
|
|
* LICENSE
|
|||
|
|
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
|
|||
|
|
*/var Qf={},UA={};function TO(r){delete UA[r]}function CO(r){if(!r)return!1;if(typeof r=="string")return mv(r,1)<sg;if(r.colorStops){for(var e=r.colorStops,t=0,a=e.length,n=0;n<a;n++)t+=mv(e[n].color,1);return t/=a,t<sg}return!1}var AO=function(){function r(e,t,a){var n=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,a=a||{},this.dom=t,this.id=e;var i=new OE,o=a.renderer||"canvas";Qf[o]||(o=bt(Qf)[0]),a.useDirtyRect=a.useDirtyRect==null?!1:a.useDirtyRect;var s=new Qf[o](t,i,a,e),l=a.ssr||s.ssrOnly;this.storage=i,this.painter=s;var u=!It.node&&!It.worker&&!l?new dO(s.getViewportRoot(),s.root):null,f=a.useCoarsePointer,v=f==null||f==="auto"?It.touchEventsSupported:!!f,h=44,c;v&&(c=Q(a.pointerSize,h)),this.handler=new IE(i,s,u,s.root,c),this.animation=new oO({stage:{update:l?null:function(){return n._flush(!0)}}}),l||this.animation.start()}return r.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},r.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},r.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},r.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=CO(e))},r.prototype.getBackgroundColor=function(){return this._backgroundColor},r.prototype.setDarkMode=function(e){this._darkMode=e},r.prototype.isDarkMode=function(){return this._darkMode},r.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},r.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},r.prototype.flush=function(){this._disposed||this._flush(!1)},r.prototype._flush=function(e){var t,a=Ho();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var n=Ho();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:n-a})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},r.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},r.prototype.on=function(e,t,a){return this._disposed||this.handler.on(e,t,a),this},r.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},r.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},r.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof at&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},r.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,TO(this.id))},r}();function q_(r,e){var t=new AO(hA(),r,e);return UA[t.id]=t,t}function MO(r,e){Qf[r]=e}var fg;function DO(r){if(typeof fg=="function"
|
|||
|
|
`);i=lM(t,a,n,i);for(var s=!1,l={},u=0,f=o.length;u<f;u++)uM(l,o[u],i),o[u]=l.textLine,s=s||l.isTruncated;r.text=o.join(`
|
|||
|
|
`),r.isTruncated=s}function lM(r,e,t,a){a=a||{};var n=G({},a);t=Q(t,"..."),n.maxIterations=Q(a.maxIterations,2);var i=n.minChar=Q(a.minChar,0),o=n.fontMeasureInfo=ha(e),s=o.asciiCharWidth;n.placeholder=Q(a.placeholder,"");for(var l=r=Math.max(0,r-1),u=0;u<i&&l>=s;u++)l-=s;var f=ca(o,t);return f>l&&(t="",f=0),l=r-f,n.ellipsis=t,n.ellipsisWidth=f,n.contentWidth=l,n.containerWidth=r,n}function uM(r,e,t){var a=t.containerWidth,n=t.contentWidth,i=t.fontMeasureInfo;if(!a){r.textLine="",r.isTruncated=!1;return}var o=ca(i,e);if(o<=a){r.textLine=e,r.isTruncated=!1;return}for(var s=0;;s++){if(o<=n||s>=t.maxIterations){e+=t.ellipsis;break}var l=s===0?dB(e,n,i):o>0?Math.floor(e.length*n/o):0;e=e.substr(0,l),o=ca(i,e)}e===""&&(e=t.placeholder),r.textLine=e,r.isTruncated=!0}function dB(r,e,t){for(var a=0,n=0,i=r.length;n<i&&a<e;n++)a+=FA(t,r.charCodeAt(n));return n}function pB(r,e,t,a){var n=dm(r),i=e.overflow,o=e.padding,s=o?o[1]+o[3]:0,l=o?o[0]+o[2]:0,u=e.font,f=i==="truncate",v=du(u),h=Q(e.lineHeight,v),c=e.lineOverflow==="truncate",d=!1,p=e.width;p==null&&t!=null&&(p=t-s);var g=e.height;g==null&&a!=null&&(g=a-l);var y;p!=null&&(i==="break"||i==="breakAll")?y=n?fM(n,e.font,p,i==="breakAll",0).lines:[]:y=n?n.split(`
|
|||
|
|
`):[];var m=y.length*h;if(g==null&&(g=m),m>g&&c){var _=Math.floor(g/h);d=d||y.length>_,y=y.slice(0,_),m=y.length*h}if(n&&f&&p!=null)for(var S=lM(p,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),b={},x=0;x<y.length;x++)uM(b,y[x],S),y[x]=b.textLine,d=d||b.isTruncated;for(var w=g,T=0,C=ha(u),x=0;x<y.length;x++)T=Math.max(ca(C,y[x]),T);p==null&&(p=T);var M=p;return w+=l,M+=s,{lines:y,height:g,outerWidth:M,outerHeight:w,lineHeight:h,calculatedLineHeight:v,contentWidth:T,contentHeight:m,width:p,isTruncated:d}}var gB=function(){function r(){}return r}(),n1=function(){function r(e){this.tokens=[],e&&(this.tokens=e)}return r}(),yB=function(){function r(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return r}();function mB(r,e,t,a,n){var i=new yB,o=dm(r);if(!o)return i;var s=e.padding,l=s?s[1]+s[3]:0,u=s?s[0]+s[2]:0,f=e.width;f==null&&t!=null&&(f=t-l);var v=e.height;v==null&&a!=null&&(v=a-u);for(var h=e.overflow,c=(h==="break"||h==="breakAll")&&f!=null?{width:f,accumWidth:0,breakAll:h==="breakAll"}:null,d=Pc.lastIndex=0,p;(p=Pc.exec(o))!=null;){var g=p.index;g>d&&Rc(i,o.substring(d,g),e,c),Rc(i,p[2],e,c,p[1]),d=Pc.lastIndex}d<o.length&&Rc(i,o.substring(d,o.length),e,c);var y=[],m=0,_=0,S=h==="truncate",b=e.lineOverflow==="truncate",x={};function w(At,Ot,vt){At.width=Ot,At.lineHeight=vt,m+=vt,_=Math.max(_,Ot)}t:for(var T=0;T<i.lines.length;T++){for(var C=i.lines[T],M=0,D=0,I=0;I<C.tokens.length;I++){var L=C.tokens[I],P=L.styleName&&e.rich[L.styleName]||{},k=L.textPadding=P.padding,R=k?k[1]+k[3]:0,O=L.font=P.font||e.font;L.contentHeight=du(O);var E=Q(P.height,L.contentHeight);if(L.innerHeight=E,k&&(E+=k[0]+k[2]),L.height=E,L.lineHeight=or(P.lineHeight,e.lineHeight,E),L.align=P&&P.align||n,L.verticalAlign=P&&P.verticalAlign||"middle",b&&v!=null&&m+L.lineHeight>v){var B=i.lines.length;I>0?(C.tokens=C.tokens.slice(0,I),w(C,D,M),i.lines=i.lines.slice(0,T+1)):i.lines=i.lines.slice(0,T),i.isTruncated=i.isTruncated||i.lines.length<B;break t}var z=P.width,F=z==null||z==="auto";if(typeof z=="string"&&z.charAt(z.length-1)==="%")L.percentWidth=z,y.push(L),L.contentWidth=ca(ha(O),L.text);else{if(F){var H=P.backgroundColor,U=H&&H.image;U&&(U=hB(U),Dh(U)&&(L.width=Math.max(L.width,U.width*E/U.height)))}var K=S&&f!=null?f-D:null;K!=null&&K<L.width?!F||K<R?(L.text="",L.width=L.contentWidth=0):(cB(x,L.text,K-R,O,e.ellipsis,{minChar:e.truncateMinChar}),L.text=x.text,i.isTruncated=i.isTruncated||x.isTruncated,L.width=L.contentWidth=ca(ha(O),L.text)):L.contentWidth=ca(ha(O),L.text)}L.width+=R,D+=L.width,P&&(M=Math.max(M,L.lineHeight))}w(C,D,M)}i.outerWidth=i.width=Q(f,_),i.outerHeight=i.height=Q(v,m),i.contentHeight=m,i.contentWidth=_,i.outerWidth+=l,i.outerHeight+=u;for(var T=0;T<y.length;T++){var L=y[T],ft=L.percentWidth;L.width=parseInt(ft,10)/100*i.width}return i}function Rc(r,e,t,a,n){var i=e==="",o=n&&t.rich[n]||{},s=r.lines,l=o.font||t.font,u=!1,f,v;if(a){var h=o.padding,c=h?h[1]+h[3]:0;if(o.width!=null&&o.width!=="auto"){var d=zr(o.width,a.width)+c;s.length>0&&d+a.accumWidth>a.width&&(f=e.split(`
|
|||
|
|
`),u=!0),a.accumWidth=d}else{var p=fM(e,l,a.width,a.breakAll,a.accumWidth);a.accumWidth=p.accumWidth+c,v=p.linesWidths,f=p.lines}}f||(f=e.split(`
|
|||
|
|
`));for(var g=ha(l),y=0;y<f.length;y++){var m=f[y],_=new gB;if(_.styleName=n,_.text=m,_.isLineHolder=!m&&!i,typeof o.width=="number"?_.width=o.width:_.width=v?v[y]:ca(g,m),!y&&!u){var S=(s[s.length-1]||(s[0]=new n1)).tokens,b=S.length;b===1&&S[0].isLineHolder?S[0]=_:(m||!b||i)&&S.push(_)}else s.push(new n1([_]))}}function _B(r){var e=r.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var SB=da(",&?/;] ".split(""),function(r,e){return r[e]=!0,r},{});function xB(r){return _B(r)?!!SB[r]:!0}function fM(r,e,t,a,n){for(var i=[],o=[],s="",l="",u=0,f=0,v=ha(e),h=0;h<r.length;h++){var c=r.charAt(h);if(c===`
|
|||
|
|
`){l&&(s+=l,f+=u),i.push(s),o.push(f),s="",l="",u=0,f=0;continue}var d=FA(v,c.charCodeAt(0)),p=a?!1:!xB(c);if(i.length?f+d>t:n+f+d>t){f?(s||l)&&(p?(s||(s=l,l="",u=0,f=u),i.push(s),o.push(f-u),l+=c,u+=d,s="",f=u):(l&&(s+=l,l="",u=0),i.push(s),o.push(f),s=c,f=d)):p?(i.push(l),o.push(u),l=c,u=d):(i.push(c),o.push(d));continue}f+=d,p?(l+=c,u+=d):(l&&(s+=l,l="",u=0),s+=c)}return l&&(s+=l),s&&(i.push(s),o.push(f)),i.length===1&&(f+=n),{accumWidth:f,lines:i,linesWidths:o}}function i1(r,e,t,a,n,i){if(r.baseX=t,r.baseY=a,r.outerWidth=r.outerHeight=null,!!e){var o=e.width*2,s=e.height*2;lt.set(o1,rs(t,o,n),Ri(a,s,i),o,s),lt.intersect(e,o1,null,s1);var l=s1.outIntersectRect;r.outerWidth=l.width,r.outerHeight=l.height,r.baseX=rs(l.x,l.width,n,!0),r.baseY=Ri(l.y,l.height,i,!0)}}var o1=new lt(0,0,0,0),s1={outIntersectRect:{},clamp:!0};function dm(r){return r!=null?r+="":r=""}function bB(r){var e=dm(r.text),t=r.font,a=ca(ha(t),e),n=du(t);return cg(r,a,n,null)}function cg(r,e,t,a){var n=new lt(rs(r.x||0,e,r.textAlign),Ri(r.y||0,t,r.textBaseline),e,t),i=a??(vM(r)?r.lineWidth:0);return i>0&&(n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i),n}function vM(r){var e=r.stroke;return e!=null&&e!=="none"&&r.lineWidth>0}var dg="__zr_style_"+Math.round(Math.random()*10),ki={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Lh={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};ki[dg]=!0;var l1=["z","z2","invisible"],wB=["invisible"],TB=function(r){Ut(e,r);function e(t){return r.call(this,t)||this}return e.prototype._init=function(t){for(var a=bt(t),n=0;n<a.length;n++){var i=a[n];i==="style"?this.useStyle(t[i]):r.prototype.attrKV.call(this,i,t[i])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(t,a,n,i){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&CB(this,t,a)||o&&!o[0]&&!o[3])return!1;if(n&&this.__clipPaths&&this.__clipPaths.length){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(i&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(t,a){return this.rectContain(t,a)},e.prototype.traverse=function(t,a){t.call(a,this)},e.prototype.rectContain=function(t,a){var n=this.transformCoordToLocal(t,a),i=this.getBoundingRect();return i.contain(n[0],n[1])},e.prototype.getPaintRect=function(){var t=this._paintRect;if(!this._paintRect||this.__dirty){var a=this.transform,n=this.getBoundingRect(),i=this.style,o=i.shadowBlur||0,s=i.shadowOffsetX||0,l=i.shadowOffsetY||0;t=this._paintRect||(this._paintRect=new lt(0,0,0,0)),a?lt.applyTransform(t,n,a):t.copy(n),(o||s||l)&&(t.width+=o*2+Math.abs(s),t.height+=o*2+Math.abs(l),t.x=Math.min(t.x,t.x+s-o),t.y=Math.min(t.y,t.y+l-o));var u=this.dirtyRectTolerance;t.isZero()||(t.x=Math.floor(t.x-u),t.y=Math.floor(t.y-u),t.width=Math.ceil(t.width+1+u*2),t.height=Math.ceil(t.height+1+u*2))}return t},e.prototype.setPrevPaintRect=function(t){t?(this._prevPaintRect=this._prevPaintRect||new lt(0,0,0,0),this._prevPaintRect.copy(t)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(t){return this.animate("style",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(t,a){t!=="style"?r.prototype.attrKV.call(this,t,a):this.style?this.setStyle(a):this.useStyle(a)},e.prototype.setStyle=function(t,a){return typeof t=="string"?this.style[t]=a:G(this.style,t),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(t){t||this.markRedraw(),this.__dirty|=hl,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&hl)},e.prototype.styleUpdated=function(){this.__dirty&=~hl},e.prototype.createStyle=function(t){return bh(ki,t)},e.prototyp
|
|||
|
|
`,`
|
|||
|
|
|
|||
|
|
`,`
|
|||
|
|
|
|||
|
|
|
|||
|
|
`];function se(r,e){return e.type=r,e}function Og(r){return r.type==="section"}function aL(r){return Og(r)?Vz:zz}function nL(r){if(Og(r)){var e=0,t=r.blocks.length,a=t>1||t>0&&!r.noHeader;return A(r.blocks,function(n){var i=nL(n);i>=e&&(e=i+ +(a&&(!i||Og(n)&&!n.noHeader)))}),e}return 0}function Vz(r,e,t,a){var n=e.noHeader,i=Gz(nL(e)),o=[],s=e.blocks||[];Oe(!s||W(s)),s=s||[];var l=r.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(q(u,l)){var f=new KD(u[l],null);s.sort(function(p,g){return f.evaluate(p.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}A(s,function(p,g){var y=e.valueFormatter,m=aL(p)(y?G(G({},r),{valueFormatter:y}):r,p,g>0?i.html:0,a);m!=null&&o.push(m)});var v=r.renderMode==="richText"?o.join(i.richText):Bg(a,o.join(""),n?t:i.html);if(n)return v;var h=Lg(e.header,"ordinal",r.useUTC),c=rL(a,r.renderMode).nameStyle,d=eL(a);return r.renderMode==="richText"?iL(r,h,c)+i.richText+v:Bg(a,'<div style="'+c+";"+d+';">'+Re(h)+"</div>"+v,t)}function zz(r,e,t,a){var n=r.renderMode,i=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=r.useUTC,f=e.valueFormatter||r.valueFormatter||function(S){return S=W(S)?S:[S],$(S,function(b,x){return Lg(b,W(c)?c[x]:c,u)})};if(!(i&&o)){var v=s?"":r.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||N.color.secondary,n),h=i?"":Lg(l,"ordinal",u),c=e.valueType,d=o?[]:f(e.value,e.dataIndex),p=!s||!i,g=!s&&i,y=rL(a,n),m=y.nameStyle,_=y.valueStyle;return n==="richText"?(s?"":v)+(i?"":iL(r,h,m))+(o?"":Wz(r,d,p,g,_)):Bg(a,(s?"":v)+(i?"":Fz(h,!s,m))+(o?"":Hz(d,p,g,_)),t)}}function gS(r,e,t,a,n,i){if(r){var o=aL(r),s={useUTC:n,renderMode:t,orderMode:a,markupStyleCreator:e,valueFormatter:r.valueFormatter};return o(s,r,0,i)}}function Gz(r){return{html:Bz[r],richText:Nz[r]}}function Bg(r,e,t){var a='<div style="clear:both"></div>',n="margin: "+t+"px 0 0",i=eL(r);return'<div style="'+n+";"+i+';">'+e+a+"</div>"}function Fz(r,e,t){var a=e?"margin-left:2px":"";return'<span style="'+t+";"+a+'">'+Re(r)+"</span>"}function Hz(r,e,t,a){var n=t?"10px":"20px",i=e?"float:right;margin-left:"+n:"";return r=W(r)?r:[r],'<span style="'+i+";"+a+'">'+$(r,function(o){return Re(o)}).join(" ")+"</span>"}function iL(r,e,t){return r.markupStyleCreator.wrapRichTextStyle(e,t)}function Wz(r,e,t,a,n){var i=[n],o=a?10:20;return t&&i.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(W(e)?e.join(" "):e,i)}function oL(r,e){var t=r.getData().getItemVisual(e,"style"),a=t[r.visualDrawType];return Zi(a)}function sL(r,e){var t=r.get("padding");return t??(e==="richText"?[8,10]:10)}var rd=function(){function r(){this.richTextStyles={},this._nextStyleNameId=jA()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(e,t,a){var n=a==="richText"?this._generateStyleName():null,i=MV({color:t,type:e,renderMode:a,markerId:n});return Z(i)?i:(this.richTextStyles[n]=i.style,i.content)},r.prototype.wrapRichTextStyle=function(e,t){var a={};W(t)?A(t,function(i){return G(a,i)}):G(a,t);var n=this._generateStyleName();return this.richTextStyles[n]=a,"{"+n+"|"+e+"}"},r}();function lL(r){var e=r.series,t=r.dataIndex,a=r.multipleSeries,n=e.getData(),i=n.mapDimensionsAll("defaultedTooltip"),o=i.length,s=e.getRawValue(t),l=W(s),u=oL(e,t),f,v,h,c;if(o>1||l&&!o){var d=$z(s,e,t,i,u);f=d.inlineValues,v=d.inlineValueTypes,h=d.blocks,c=d.inlineValues[0]}else if(o){var p=n.getDimensionInfo(i[0]);c=f=ns(n,t,i[0]),v=p.type}else c=f=l?s[0]:s;var g=fm(e),y=g&&e.name||"",m=n.getName(t),_=a?y:m;return se("section",{header:y,noHeader:a||!g,sortParam:c,blocks:[se("nameValue",{markerType:"item",markerColor:u,name:_,noName:!br(_),value:f,valueType:v,dataIndex:t})].concat(h||[])})}function $z(r,e,t,a,n){var i=e.getData(),o=da(r,function(v,h,c){var d=i.getDimensionInfo(c);return v=v||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];a.length?A(a,function(v){f(ns(i,t,v),v)}):A(r,f);function f(v,h){var c=i.getDimensionInfo(h);!c||c.otherDims.tooltip===!1||(o?u.push(se("nameValue",{markerType:"s
|
|||
|
|
`:"";function a(n){var i=n.children,o=n.tag,s=n.attrs,l=n.text;return pF(o,s)+(o!=="style"?Re(l):l||"")+(i?""+t+$(i,function(u){return a(u)}).join(t)+t:"")+gF(o)}return a(r)}function yF(r,e,t){t=t||{};var a=t.newline?`
|
|||
|
|
`:"",n=" {"+a,i=a+"}",o=$(bt(r),function(l){return l+n+$(bt(r[l]),function(u){return u+":"+r[l][u]+";"}).join(a)+i}).join(a),s=$(bt(e),function(l){return"@keyframes "+l+n+$(bt(e[l]),function(u){return u+n+$(bt(e[l][u]),function(f){var v=e[l][u][f];return f==="d"&&(v='path("'+v+'")'),f+":"+v+";"}).join(a)+i}).join(a)+i}).join(a);return!o&&!s?"":["<![CDATA[",o,s,"]]>"].join(a)}function ey(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function cx(r,e,t,a){return me("svg","root",{width:r,height:e,xmlns:PI,"xmlns:xlink":RI,version:"1.1",baseProfile:"full",viewBox:a?"0 0 "+r+" "+e:!1},t)}var mF=0;function EI(){return mF++}var dx={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},hi="transform-origin";function _F(r,e,t){var a=G({},r.shape);G(a,e),r.buildPath(t,a);var n=new II;return n.reset(BA(r)),t.rebuildPath(n,1),n.generateStr(),n.getStr()}function SF(r,e){var t=e.originX,a=e.originY;(t||a)&&(r[hi]=t+"px "+a+"px")}var xF={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function OI(r,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=r,t}function bF(r,e,t){var a=r.shape.paths,n={},i,o;if(A(a,function(l){var u=ey(t.zrId);u.animation=!0,Kh(l,{},u,!0);var f=u.cssAnims,v=u.cssNodes,h=bt(f),c=h.length;if(c){o=h[c-1];var d=f[o];for(var p in d){var g=d[p];n[p]=n[p]||{d:""},n[p].d+=g.d||""}for(var y in v){var m=v[y].animation;m.indexOf(o)>=0&&(i=m)}}}),!!i){e.d=!1;var s=OI(n,t);return i.replace(o,s)}}function px(r){return Z(r)?dx[r]?"cubic-bezier("+dx[r]+")":im(r)?r:"":""}function Kh(r,e,t,a){var n=r.animators,i=n.length,o=[];if(r instanceof Nh){var s=bF(r,e,t);if(s)o.push(s);else if(!i)return}else if(!i)return;for(var l={},u=0;u<i;u++){var f=n[u],v=[f.getMaxTime()/1e3+"s"],h=px(f.getClip().easing),c=f.getDelay();h?v.push(h):v.push("linear"),c&&v.push(c/1e3+"s"),f.getLoop()&&v.push("infinite");var d=v.join(" ");l[d]=l[d]||[d,[]],l[d][1].push(f)}function p(m){var _=m[1],S=_.length,b={},x={},w={},T="animation-timing-function";function C(vt,tt,dt){for(var J=vt.getTracks(),ht=vt.getMaxTime(),Bt=0;Bt<J.length;Bt++){var Tt=J[Bt];if(Tt.needsAnimate()){var Et=Tt.keyframes,Nt=Tt.propName;if(dt&&(Nt=dt(Nt)),Nt)for(var ge=0;ge<Et.length;ge++){var Je=Et[ge],Ue=Math.round(Je.time/ht*100)+"%",zn=px(Je.easing),uo=Je.rawValue;(Z(uo)||wt(uo))&&(tt[Ue]=tt[Ue]||{},tt[Ue][Nt]=Je.rawValue,zn&&(tt[Ue][T]=zn))}}}}for(var M=0;M<S;M++){var D=_[M],I=D.targetName;I?I==="shape"&&C(D,x):!a&&C(D,b)}for(var L in b){var P={};xv(P,r),G(P,b[L]);var k=NA(P),R=b[L][T];w[L]=k?{transform:k}:{},SF(w[L],P),R&&(w[L][T]=R)}var O,E=!0;for(var L in x){w[L]=w[L]||{};var B=!O,R=x[L][T];B&&(O=new ya);var z=O.len();O.reset(),w[L].d=_F(r,x[L],O);var F=O.len();if(!B&&z!==F){E=!1;break}R&&(w[L][T]=R)}if(!E)for(var L in w)delete w[L].d;if(!a)for(var M=0;M<S;M++){var D=_[M],I=D.targetName;I==="style"&&C(D,w,function(J){return xF[J]})}for(var H=bt(w),U=!0,K,M=1;M<H.length;M++){var ft=H[M-1],At=H[M];if(w[ft][hi]!==w[At][hi]){U=!1;break}K=w[ft][hi]}if(U&&K){for(var L in w)w[L][hi]&&delete w[L][hi];e[hi]=K}if(kt(H,function(vt){return bt(w[vt]).length>0}).length){var Ot=OI(w,t);return Ot+" "+m[0]+" both"}}for(var g in l){var s=p(l[g]);s&&o.push(s)}if(o.length){var y=t.zrId+"-cls-"+EI();t.cssNodes["."+y]={animation:o.join(",")},e.class=y}}function wF(r,e,t){if(!r.ignore)if(r.isSilent()){var a={"pointer-events":"none"};gx(a,e,t,!0)}else{var n=r.states.emphasi
|
|||
|
|
`+g.message)}var n=new at;n.add(a),n.isGeoSVGGraphicRoot=!0;var i=t.width,o=t.height,s=t.viewBoxRect,l=this._boundingRect;if(!l){var u=void 0,f=void 0,v=void 0,h=void 0;if(i!=null?(u=0,v=i):s&&(u=s.x,v=s.width),o!=null?(f=0,h=o):s&&(f=s.y,h=s.height),u==null||f==null){var c=a.getBoundingRect();u==null&&(u=c.x,v=c.width),f==null&&(f=c.y,h=c.height)}l=this._boundingRect=new lt(u,f,v,h)}if(s){var d=k2(s,l);a.scaleX=a.scaleY=d.scale,a.x=d.x,a.y=d.y}n.setClipPath(new _t({shape:l.plain()}));var p=[];return A(t.named,function(g){GW.get(g.svgNodeTagLower)!=null&&(p.push(g),HW(g.el))}),{root:n,boundingRect:l,named:p}},r.prototype.useGraphic=function(e){var t=this._usedGraphicMap,a=t.get(e);return a||(a=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),t.set(e,a),a)},r.prototype.freeGraphic=function(e){var t=this._usedGraphicMap,a=t.get(e);a&&(t.removeKey(e),this._freedGraphics.push(a))},r}();function HW(r){r.silent=!1,r.isGroup&&r.traverse(function(e){e.silent=!1})}function WW(r){var e=[],t=j();return A(r,function(a){if(a.namedFrom==null){var n=new M3(a.name,a.el);e.push(n),t.set(a.name,n)}}),{regions:e,regionsMap:t}}var hy=[126,25],xb="南海诸岛",ci=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]];for(var vi=0;vi<ci.length;vi++)for(var Ao=0;Ao<ci[vi].length;Ao++)ci[vi][Ao][0]/=10.5,ci[vi][Ao][1]/=-10.5/.75,ci[vi][Ao][0]+=hy[0],ci[vi][Ao][1]+=hy[1];function $W(r,e){if(r==="china"){for(var t=0;t<e.length;t++)if(e[t].name===xb)return;e.push(new dI(xb,$(ci,function(a){return{type:"polygon",exterior:a}}),hy))}}var UW={南海诸岛:[32,80],广东:[0,-10],香港:[10,5],澳门:[-10,10],天津:[5,5]};function YW(r,e){if(r==="china"){var t=UW[e.name];if(t){var a=e.getCenter();a[0]+=t[0]/10.5,a[1]+=-t[1]/(10.5/.75),e.setCenter(a)}}}var ZW=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];function XW(r,e){r==="china"&&e.name==="台湾"&&e.geometries.push({type:"polygon",exterior:ZW[0]})}var qW="name",KW=function(){function r(e,t,a){this.type="geoJSON",this._parsedMap=j(),this._mapName=e,this._specialAreas=a,this._geoJSON=JW(t)}return r.prototype.load=function(e,t){t=t||qW;var a=this._parsedMap.get(t);if(!a){var n=this._parseToRegions(t);a=this._parsedMap.set(t,{regions:n,boundingRect:jW(n)})}var i=j(),o=[];return A(a.regions,function(s){var l=s.name;e&&q(e,l)&&(s=s.cloneShallow(l=e[l])),o.push(s),i.set(l,s)}),{regions:o,boundingRect:a.boundingRect||new lt(0,0,0,0),regionsMap:i}},r.prototype._parseToRegions=function(e){var t=this._mapName,a=this._geoJSON,n;try{n=a?L3(a,e):[]}catch(i){throw new Error(`Invalid geoJson format
|
|||
|
|
`+i.message)}return $W(t,n),A(n,function(i){var o=i.name;YW(t,i),XW(t,i);var s=this._specialAreas&&this._specialAreas[o];s&&i.transformTo(s.left,s.top,s.width,s.height)},this),n},r.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},r}();function jW(r){for(var e,t=0;t<r.length;t++){var a=r[t].getBoundingRect();e=e||a.clone(),e.union(a)}return e}function JW(r){return Z(r)?typeof JSON<"u"&&JSON.parse?JSON.parse(r):new Function("return ("+r+");")():r}var Qs=j();const Wa={registerMap:function(r,e,t){if(e.svg){var a=new FW(r,e.svg);Qs.set(r,a)}else{var n=e.geoJson||e.geoJSON;n&&!e.features?t=e.specialAreas:n=e;var a=new KW(r,n,t);Qs.set(r,a)}},getGeoResource:function(r){return Qs.get(r)},getMapForUser:function(r){var e=Qs.get(r);return e&&e.type==="geoJSON"&&e.getMapForUser()},load:function(r,e,t){var a=Qs.get(r);if(a)return a.load(e,t)}};var w0=["rect","circle","line","ellipse","polygon","polyline","path"],QW=j(w0),t$=j(w0.concat(["g"])),e$=j(w0.concat(["g"])),E2=St();function wf(r){var e=r.getItemStyle(),t=r.get("areaColor");return t!=null&&(e.fill=t),e}function bb(r){var e=r.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var r$=function(){function r(e){var t=this.group=new at,a=this._transformGroup=new at;t.add(a),this.uid=bs("ec_map_draw"),this._controller=new so(e.getZr()),this._controllerHost={target:a},a.add(this._regionsGroup=new at),a.add(this._svgGroup=new at)}return r.prototype.draw=function(e,t,a,n,i){var o=e.mainType==="geo",s=e.getData&&e.getData();o&&t.eachComponent({mainType:"series",subType:"map"},function(_){!s&&_.getHostGeoModel()===e&&(s=_.getData())});var l=e.coordinateSystem,u=this._regionsGroup,f=this._transformGroup,v=l.getTransformInfo(),h=v.raw,c=v.roam,d=!u.childAt(0)||i,p=e.getShallow("clip",!0),g;p?(g=l.getViewRect().clone(),this.group.setClipPath(new _t({shape:g.clone()}))):this.group.removeClipPath(),d?(f.x=c.x,f.y=c.y,f.scaleX=c.scaleX,f.scaleY=c.scaleY,f.dirty()):Dt(f,c,e);var y=s&&s.getVisual("visualMeta")&&s.getVisual("visualMeta").length>0,m={api:a,geo:l,mapOrGeoModel:e,data:s,isVisualEncodedByVisualMap:y,isGeo:o,transformInfoRaw:h};l.resourceType==="geoJSON"?this._buildGeoJSON(m):l.resourceType==="geoSVG"&&this._buildSVG(m),this._updateController(e,g,t,a),this._updateMapSelectHandler(e,u,a,n)},r.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=j(),a=j(),n=this._regionsGroup,i=e.transformInfoRaw,o=e.mapOrGeoModel,s=e.data,l=e.geo.projection,u=l&&l.stream;function f(c,d){return d&&(c=d(c)),c&&[c[0]*i.scaleX+i.x,c[1]*i.scaleY+i.y]}function v(c){for(var d=[],p=!u&&l&&l.project,g=0;g<c.length;++g){var y=f(c[g],p);y&&d.push(y)}return d}function h(c){return{shape:{points:v(c)}}}n.removeAll(),A(e.geo.regions,function(c){var d=c.name,p=t.get(d),g=a.get(d)||{},y=g.dataIdx,m=g.regionModel;if(!p){p=t.set(d,new at),n.add(p),y=s?s.indexOfName(d):null,m=e.isGeo?o.getRegionModel(d):s?s.getItemModel(y):null;var _=m.get("silent",!0);_!=null&&(p.silent=_),a.set(d,{dataIdx:y,regionModel:m})}var S=[],b=[];A(c.geometries,function(T){if(T.type==="polygon"){var C=[T.exterior].concat(T.interiors||[]);u&&(C=Db(C,u)),A(C,function(D){S.push(new $e(h(D)))})}else{var M=T.points;u&&(M=Db(M,u,!0)),A(M,function(D){b.push(new Be(h(D)))})}});var x=f(c.getCenter(),l&&l.project);function w(T,C){if(T.length){var M=new Nh({culling:!0,segmentIgnoreThreshold:1,shape:{paths:T}});p.add(M),wb(e,M,y,m),Tb(e,M,d,m,o,y,x),C&&(bb(M),A(M.states,bb))}}w(S),w(b,!0)}),t.each(function(c,d){var p=a.get(d),g=p.dataIdx,y=p.regionModel;Cb(e,c,d,y,o,g),Ab(e,c,d,y,o),Mb(e,c,d,y,o)},this)},r.prototype._buildSVG=function(e){var t=e.geo.map,a=e.transformInfoRaw;this._svgGroup.x=a.x,this._svgGroup.y=a.y,this._svgGroup.scaleX=a.scaleX,this._svgGroup.scaleY=a.scaleY,this._svgResourceChanged(t)&&(this._freeSVG(),this._useSVG(t));var n=this._svgDispatcherMap=j(),i=!1;A(this._svgGraphicRecord.named,function(o){var s=o.name,l=e.mapOrGeoModel,u=e.data,f=o.svgNodeTagLower,v=o.el,h=u?u.indexOfName(s):null,c=l.getRegionModel(s);QW.get(f)!=null&&v instanceof Cr&&wb(e,v,h,c),
|
|||
|
|
`))}),e.join(`
|
|||
|
|
|
|||
|
|
`+ic+`
|
|||
|
|
|
|||
|
|
`)}function Cq(r){return $(r,function(e){var t=e.getRawData(),a=[e.name],n=[];return t.each(t.dimensions,function(){for(var i=arguments.length,o=arguments[i-1],s=t.getName(o),l=0;l<i-1;l++)n[l]=arguments[l];a.push((s?s+cs:"")+n.join(cs))}),a.join(`
|
|||
|
|
`)}).join(`
|
|||
|
|
|
|||
|
|
`+ic+`
|
|||
|
|
|
|||
|
|
`)}function Aq(r){var e=wq(r);return{value:kt([Tq(e.seriesGroupByCategoryAxis),Cq(e.other)],function(t){return!!t.replace(/[\n\t\s]/g,"")}).join(`
|
|||
|
|
|
|||
|
|
`+ic+`
|
|||
|
|
|
|||
|
|
`),meta:e.meta}}function fh(r){return r.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Mq(r){var e=r.slice(0,r.indexOf(`
|
|||
|
|
`));if(e.indexOf(cs)>=0)return!0}var Ey=new RegExp("["+cs+"]+","g");function Dq(r){for(var e=r.split(/\n+/g),t=fh(e.shift()).split(Ey),a=[],n=$(t,function(l){return{name:l,data:[]}}),i=0;i<e.length;i++){var o=fh(e[i]).split(Ey);a.push(o.shift());for(var s=0;s<o.length;s++)n[s]&&(n[s].data[i]=o[s])}return{series:n,categories:a}}function Lq(r){for(var e=r.split(/\n+/g),t=fh(e.shift()),a=[],n=0;n<e.length;n++){var i=fh(e[n]);if(i){var o=i.split(Ey),s="",l=void 0,u=!1;isNaN(o[0])?(u=!0,s=o[0],o=o.slice(1),a[n]={name:s,value:[]},l=a[n].value):l=a[n]=[];for(var f=0;f<o.length;f++)l.push(+o[f]);l.length===1&&(u?a[n].value=l[0]:a[n]=l[0])}}return{name:t,data:a}}function Iq(r,e){var t=r.split(new RegExp(`
|
|||
|
|
*`+ic+`
|
|||
|
|
*`,"g")),a={series:[]};return A(t,function(n,i){if(Mq(n)){var o=Dq(n),s=e[i],l=s.axisDim+"Axis";s&&(a[l]=a[l]||[],a[l][s.axisIndex]={data:o.categories},a.series=a.series.concat(o.series))}else{var o=Lq(n);a.series.push(o)}}),a}var Pq=function(r){V(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,a){setTimeout(function(){a.dispatchAction({type:"hideTip"})});var n=a.getDom(),i=this.model;this._dom&&n.removeChild(this._dom);var o=document.createElement("div");o.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",o.style.backgroundColor=i.get("backgroundColor")||N.color.neutral00;var s=document.createElement("h4"),l=i.get("lang")||[];s.innerHTML=l[0]||i.get("title"),s.style.cssText="margin:10px 20px",s.style.color=i.get("textColor");var u=document.createElement("div"),f=document.createElement("textarea");u.style.cssText="overflow:auto";var v=i.get("optionToContent"),h=i.get("contentToOption"),c=Aq(t);if(et(v)){var d=v(a.getOption());Z(d)?u.innerHTML=d:ts(d)&&u.appendChild(d)}else{f.readOnly=i.get("readOnly");var p=f.style;p.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",p.color=i.get("textColor"),p.borderColor=i.get("textareaBorderColor"),p.backgroundColor=i.get("textareaColor"),f.value=c.value,u.appendChild(f)}var g=c.meta,y=document.createElement("div");y.style.cssText="position:absolute;bottom:5px;left:0;right:0";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",_=document.createElement("div"),S=document.createElement("div");m+=";background-color:"+i.get("buttonColor"),m+=";color:"+i.get("buttonTextColor");var b=this;function x(){n.removeChild(o),b._dom=null}Yp(_,"click",x),Yp(S,"click",function(){if(h==null&&v!=null||h!=null&&v==null){x();return}var w;try{et(h)?w=h(u,a.getOption()):w=Iq(f.value,g)}catch(T){throw x(),new Error("Data view format error "+T)}w&&a.dispatchAction({type:"changeDataView",newOption:w}),x()}),_.innerHTML=l[1],S.innerHTML=l[2],S.style.cssText=_.style.cssText=m,!i.get("readOnly")&&y.appendChild(S),y.appendChild(_),o.appendChild(s),o.appendChild(u),o.appendChild(y),u.style.height=n.clientHeight-80+"px",n.appendChild(o),this._dom=o},e.prototype.remove=function(t,a){this._dom&&a.getDom().removeChild(this._dom)},e.prototype.dispose=function(t,a){this.remove(t,a)},e.getDefaultOption=function(t){var a={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:t.getLocaleModel().get(["toolbox","dataView","title"]),lang:t.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:N.color.background,textColor:N.color.primary,textareaColor:N.color.background,textareaBorderColor:N.color.border,buttonColor:N.color.accent50,buttonTextColor:N.color.neutral00};return a},e}(_r);function Rq(r,e){return $(r,function(t,a){var n=e&&e[a];if(st(n)&&!W(n)){var i=st(t)&&!W(t);i||(t={value:t});var o=n.name!=null&&t.name==null;return t=ot(t,n),o&&delete t.name,t}else return t})}Sa({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(r,e){var t=[];A(r.newOption.series,function(a){var n=e.getSeriesByName(a.name)[0];if(!n)t.push(G({type:"scatter"},a));else{var i=n.get("data");t.push({name:a.name,data:Rq(a.data,i)})}}),e.mergeOption(ot({series:t},r.newOption))});const kq=Pq;var mR=A,_R=St();function Eq(r,e){var t=u_(r);mR(e,function(a,n){for(var i=t.length-1;i>=0;i--){var o=t[i];if(o[n])break}if(i<0){var s=r.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(s){var l=s.getPercentRange();t[0][n]={dataZoomId:n,start:l[0],end:l[1]}}}}),t.push(e)}function Oq(r){var e=u_(r),t=e[e.length-1];e.length>1&&e.pop();var a={};return mR(t,function(n,i){for(var o=e.length-1;o>=0;o--)if(n=e[o][i],n){a[i]=n;break}}),a}function Bq(r){_R(r).snapshots=null}function Nq(r){return u_(r).length}function u_(r){var e=_R(r);return e.snap
|
|||
|
|
|
|||
|
|
`:"<br/>",y=v.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(s,c,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,y,u,Math.random()+"",o[0],o[1],c,null,h)})},e.prototype._showSeriesItemTooltip=function(t,a,n){var i=this._ecModel,o=ut(a),s=o.seriesIndex,l=i.getSeriesByIndex(s),u=o.dataModel||l,f=o.dataIndex,v=o.dataType,h=u.getData(v),c=this._renderMode,d=t.positionDefault,p=il([h.getItemModel(f),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),g=p.get("trigger");if(!(g!=null&&g!=="item")){var y=u.getDataParams(f,v),m=new rd;y.marker=m.makeTooltipMarker("item",Zi(y.color),c);var _=fS(u.formatTooltip(f,!1,v)),S=p.get("order"),b=p.get("valueFormatter"),x=_.frag,w=x?gS(b?G({valueFormatter:b},x):x,m,c,S,i.get("useUTC"),p.get("textStyle")):_.text,T="item_"+u.name+"_"+f;this._showOrMove(p,function(){this._showTooltipContent(p,w,y,T,t.offsetX,t.offsetY,t.position,t.target,m)}),n({type:"showTip",dataIndexInside:f,dataIndex:h.getRawIndex(f),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,a,n){var i=this._renderMode==="html",o=ut(a),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(Z(l)){var f=l;l={content:f,formatter:f},u=!0}u&&i&&l.content&&(l=rt(l),l.content=Re(l.content));var v=[l],h=this._ecModel.getComponent(o.componentMainType,o.componentIndex);h&&v.push(h),v.push({formatter:l.content});var c=t.positionDefault,d=il(v,this._tooltipModel,c?{position:c}:null),p=d.get("content"),g=Math.random()+"",y=new rd;this._showOrMove(d,function(){var m=rt(d.get("formatterParams")||{});this._showTooltipContent(d,p,m,g,t.offsetX,t.offsetY,t.position,a,y)}),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,a,n,i,o,s,l,u,f){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var v=this._tooltipContent;v.setEnterable(t.get("enterable"));var h=t.get("formatter");l=l||t.get("position");var c=a,d=this._getNearestPoint([o,s],n,t.get("trigger"),t.get("borderColor"),t.get("defaultBorderColor",!0)),p=d.color;if(h)if(Z(h)){var g=t.ecModel.get("useUTC"),y=W(n)?n[0]:n,m=y&&y.axisType&&y.axisType.indexOf("time")>=0;c=h,m&&(c=Fh(y.axisValue,c,g)),c=_D(c,n,!0)}else if(et(h)){var _=X(function(S,b){S===this._ticket&&(v.setContent(b,f,t,p,l),this._updatePosition(t,l,o,s,v,n,u))},this);this._ticket=i,c=h(n,i,_)}else c=h;v.setContent(c,f,t,p,l),v.show(t,p),this._updatePosition(t,l,o,s,v,n,u)}},e.prototype._getNearestPoint=function(t,a,n,i,o){if(n==="axis"||W(a))return{color:i||o};if(!W(a))return{color:i||a.color||a.borderColor}},e.prototype._updatePosition=function(t,a,n,i,o,s,l){var u=this._api.getWidth(),f=this._api.getHeight();a=a||t.get("position");var v=o.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),et(a)&&(a=a([n,i],s,o.el,d,{viewSize:[u,f],contentSize:v.slice()})),W(a))n=Y(a[0],u),i=Y(a[1],f);else if(st(a)){var p=a;p.width=v[0],p.height=v[1];var g=Zt(p,{width:u,height:f});n=g.x,i=g.y,h=null,c=null}else if(Z(a)&&l){var y=gK(a,d,v,t.get("borderWidth"));n=y[0],i=y[1]}else{var y=dK(n,i,o,u,f,h?null:20,c?null:20);n=y[0],i=y[1]}if(h&&(n-=QT(h)?v[0]/2:h==="right"?v[0]:0),c&&(i-=QT(c)?v[1]/2:c==="bottom"?v[1]:0),SR(t)){var y=pK(n,i,o,u,f);n=y[0],i=y[1]}o.moveTo(n,i)},e.prototype._updateContentNotChangedOnAxis=function(t,a){var n=this._lastDataByCoordSys,i=this._cbParamsList,o=!!n&&n.length===t.length;return o&&A(n,function(s,l){var u=s.dataByAxis||[],f=t[l]||{},v=f.dataByAxis||[];o=o&&u.length===v.length,o&&A(u,function(h,c){var d=v[c]||{},p=h.seriesDataIndices||[],g=d.seriesDataIndices||[];o=o&&h.value===d.value&&h.axisType===d.axisType&&h.axisId===d.axisId&&p.length===g.length,o&&A(p,function(y,m){var _=g[m];o=o&&y.seriesIndex===_.seriesIndex&&y.dataIndex===_.dataIndex}),i&&A(h.seriesDataIndices,function(y){var m=y.seriesIndex,_=a[m],S=i[m];_&&S&&S.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=a,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid
|
|||
|
|
`)){var m=new $f;m.newline=!0,u.add(m);return}var _=n.getSeriesByName(y)[0];if(!f.get(y))if(_){var S=_.getData(),b=S.getVisual("legendLineStyle")||{},x=S.getVisual("legendIcon"),w=S.getVisual("style"),T=this._createItem(_,y,p,d,a,t,b,w,x,v,i);T.on("click",ko(mC,y,null,i,c)).on("mouseover",ko(Hy,_.name,null,i,c)).on("mouseout",ko(Wy,_.name,null,i,c)),n.ssr&&T.eachChild(function(C){var M=ut(C);M.seriesIndex=_.seriesIndex,M.dataIndex=p,M.ssrType="legend"}),h&&T.eachChild(function(C){g.packEventData(C,a,_,p,y)}),f.set(y,!0)}else n.eachRawSeries(function(C){var M=this;if(!f.get(y)&&C.legendVisualProvider){var D=C.legendVisualProvider;if(!D.containName(y))return;var I=D.indexOfName(y),L=D.getItemVisual(I,"style"),P=D.getItemVisual(I,"legendIcon"),k=Ke(L.fill);k&&k[3]===0&&(k[3]=.2,L=G(G({},L),{fill:va(k,"rgba")}));var R=this._createItem(C,y,p,d,a,t,{},L,P,v,i);R.on("click",ko(mC,null,y,i,c)).on("mouseover",ko(Hy,null,y,i,c)).on("mouseout",ko(Wy,null,y,i,c)),n.ssr&&R.eachChild(function(O){var E=ut(O);E.seriesIndex=C.seriesIndex,E.dataIndex=p,E.ssrType="legend"}),h&&R.eachChild(function(O){M.packEventData(O,a,C,p,y)}),f.set(y,!0)}},this)},this),o&&this._createSelector(o,a,i,s,l)},e.prototype.packEventData=function(t,a,n,i,o){var s={componentType:"legend",componentIndex:a.componentIndex,dataIndex:i,value:o,seriesIndex:n.seriesIndex};ut(t).eventData=s},e.prototype._createSelector=function(t,a,n,i,o){var s=this.getSelectorGroup();Fy(t,function(u){var f=u.type,v=new Mt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:f==="all"?"legendAllSelect":"legendInverseSelect",legendId:a.id})}});s.add(v);var h=a.getModel("selectorLabel"),c=a.getModel(["emphasis","selectorLabel"]);_e(v,{normal:h,emphasis:c},{defaultText:u.title}),Oi(v)})},e.prototype._createItem=function(t,a,n,i,o,s,l,u,f,v,h){var c=t.visualDrawType,d=o.get("itemWidth"),p=o.get("itemHeight"),g=o.isSelected(a),y=i.get("symbolRotate"),m=i.get("symbolKeepAspect"),_=i.get("icon");f=_||f||"roundRect";var S=kj(f,i,l,u,c,g,h),b=new $f,x=i.getModel("textStyle");if(et(t.getLegendIcon)&&(!_||_==="inherit"))b.add(t.getLegendIcon({itemWidth:d,itemHeight:p,icon:f,iconRotate:y,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:m}));else{var w=_==="inherit"&&t.getData().getVisual("symbol")?y==="inherit"?t.getData().getVisual("symbolRotate"):y:0;b.add(Ej({itemWidth:d,itemHeight:p,icon:f,iconRotate:w,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:m}))}var T=s==="left"?d+5:-5,C=s,M=o.get("formatter"),D=a;Z(M)&&M?D=M.replace("{name}",a??""):et(M)&&(D=M(a));var I=g?x.getTextColor():i.get("inactiveColor");b.add(new Mt({style:Gt(x,{text:D,x:T,y:p/2,fill:I,align:C,verticalAlign:"middle"},{inheritColor:I})}));var L=new _t({shape:b.getBoundingRect(),style:{fill:"transparent"}}),P=i.getModel("tooltip");return P.get("show")&&Ya({el:L,componentModel:o,itemName:a,itemTooltipOption:P.option}),b.add(L),b.eachChild(function(k){k.silent=!0}),L.silent=!v,this.getContentGroup().add(b),Oi(b),b.__legendDataIndex=n,b},e.prototype.layoutInner=function(t,a,n,i,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Ni(t.get("orient"),l,t.get("itemGap"),n.width,n.height);var f=l.getBoundingRect(),v=[-f.x,-f.y];if(u.markRedraw(),l.markRedraw(),o){Ni("horizontal",u,t.get("selectorItemGap",!0));var h=u.getBoundingRect(),c=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,g=p===0?"width":"height",y=p===0?"height":"width",m=p===0?"y":"x";s==="end"?c[p]+=f[g]+d:v[p]+=h[g]+d,c[1-p]+=f[y]/2-h[y]/2,u.x=c[0],u.y=c[1],l.x=v[0],l.y=v[1];var _={x:0,y:0};return _[g]=f[g]+d+h[g],_[y]=Math.max(f[y],h[y]),_[m]=Math.min(0,h[m]+c[1-p]),_}else return l.x=v[0],l.y=v[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(Kt);function kj(r,e,t,a,n,i,o){function s(g,y){g.lineWidth==="auto"&&(g.lineWidth=y.lineWidth>0?2:0),Fy(g,function(m,_){g[_]==="inherit"&&(g[_]=y[_])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),f=r.lastIndexOf("empty",0)===0?"fill":"s
|
|||
|
|
`||n==="")){var i=r.isSelected(n);q(t,n)?t[n]=t[n]&&i:t[n]=i}}),t}function Bj(r){r.registerAction("legendToggleSelect","legendselectchanged",pt(sl,"toggleSelected")),r.registerAction("legendAllSelect","legendselectall",pt(sl,"allSelect")),r.registerAction("legendInverseSelect","legendinverseselect",pt(sl,"inverseSelect")),r.registerAction("legendSelect","legendselected",pt(sl,"select")),r.registerAction("legendUnSelect","legendunselected",pt(sl,"unSelect"))}function RR(r){r.registerComponentModel(Gy),r.registerComponentView(PR),r.registerProcessor(r.PRIORITY.PROCESSOR.SERIES_FILTER,Oj),r.registerSubTypeDefaulter("legend",function(){return"plain"}),Bj(r)}var Nj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(t,a,n){var i=eo(t);r.prototype.init.call(this,t,a,n),SC(this,t,i)},e.prototype.mergeOption=function(t,a){r.prototype.mergeOption.call(this,t,a),SC(this,this.option,t)},e.type="legend.scroll",e.defaultOption=Vn(Gy.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:N.color.accent50,pageIconInactiveColor:N.color.accent10,pageIconSize:15,pageTextStyle:{color:N.color.tertiary},animationDurationUpdate:800}),e}(Gy);function SC(r,e,t){var a=r.getOrient(),n=[1,1];n[a.index]=0,ma(e,t,{type:"box",ignoreSize:!!n})}const Vj=Nj;var xC=at,Mp=["width","height"],Dp=["x","y"],zj=function(r){V(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!0,t._currentIndex=0,t}return e.prototype.init=function(){r.prototype.init.call(this),this.group.add(this._containerGroup=new xC),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new xC)},e.prototype.resetInner=function(){r.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(t,a,n,i,o,s,l){var u=this;r.prototype.renderInner.call(this,t,a,n,i,o,s,l);var f=this._controllerGroup,v=a.get("pageIconSize",!0),h=W(v)?v:[v,v];d("pagePrev",0);var c=a.getModel("pageTextStyle");f.add(new Mt({name:"pageText",style:{text:"xx/xx",fill:c.getTextColor(),font:c.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),d("pageNext",1);function d(p,g){var y=p+"DataIndex",m=yu(a.get("pageIcons",!0)[a.getOrient().name][g],{onclick:X(u._pageGo,u,y,a,i)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});m.name=p,f.add(m)}},e.prototype.layoutInner=function(t,a,n,i,o,s){var l=this.getSelectorGroup(),u=t.getOrient().index,f=Mp[u],v=Dp[u],h=Mp[1-u],c=Dp[1-u];o&&Ni("horizontal",l,t.get("selectorItemGap",!0));var d=t.get("selectorButtonGap",!0),p=l.getBoundingRect(),g=[-p.x,-p.y],y=rt(n);o&&(y[f]=n[f]-p[f]-d);var m=this._layoutContentAndController(t,i,y,u,f,h,c,v);if(o){if(s==="end")g[u]+=m[f]+d;else{var _=p[f]+d;g[u]-=_,m[v]-=_}m[f]+=p[f]+d,g[1-u]+=m[c]+m[h]/2-p[h]/2,m[h]=Math.max(m[h],p[h]),m[c]=Math.min(m[c],p[c]+g[1-u]),l.x=g[0],l.y=g[1],l.markRedraw()}return m},e.prototype._layoutContentAndController=function(t,a,n,i,o,s,l,u){var f=this.getContentGroup(),v=this._containerGroup,h=this._controllerGroup;Ni(t.get("orient"),f,t.get("itemGap"),i?n.width:null,i?null:n.height),Ni("horizontal",h,t.get("pageButtonItemGap",!0));var c=f.getBoundingRect(),d=h.getBoundingRect(),p=this._showController=c[o]>n[o],g=[-c.x,-c.y];a||(g[i]=f[u]);var y=[0,0],m=[-d.x,-d.y],_=Q(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(p){var S=t.get("pageButtonPosition",!0);S==="end"?m[i]+=n[o]-d[o]:y[i]+=d[o]+_}m[1-i]+=c[s]/2-d[s]/2,f.setPosition(g),v.setPosition(y),h.setPosition(m);var b={x:0,y:0};if(b[o]=p?n[o]:c[o],b[s]=Math.max(c[s],d[s]),b[l]=Math.min(0,d[l]+m[1-i]),v.__rectSize=n[o],p){var x={x:0,y:0};x[o]=Math.max(n[o]-d[o]-_,0),x[s]=b[s],v.setClipPath(new _t({shape:x}))
|
|||
|
|
<div style="font-weight: bold; margin-bottom: 4px;">${w.name}</div>
|
|||
|
|
<div style="color: #60A5FA;">تعداد افراد: <span style="color: #fff; font-weight: bold;">${w.value.toLocaleString("fa-IR")}</span></div>
|
|||
|
|
</div>`}},grid:{left:"5%",right:"5%",bottom:"10%",top:"10%",containLabel:!0},xAxis:{type:"category",data:_,boundaryGap:!1,axisLine:{lineStyle:{color:"#E5E7EB",width:1}},axisTick:{show:!1},axisLabel:{color:"#6B7280",fontSize:11,fontFamily:"iran-sans",rotate:i.value==="daily"?45:0,margin:12},splitLine:{show:!1}},yAxis:{type:"value",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#6B7280",fontSize:11,fontFamily:"iran-sans",formatter:x=>Math.round(x).toLocaleString("fa-IR")},minInterval:1,scale:!1,splitLine:{lineStyle:{color:"#F3F4F6",type:"dashed",width:1}}},series:[{name:"تعداد افراد",type:"line",smooth:!0,symbol:"circle",symbolSize:6,showSymbol:!1,data:S,areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(37, 99, 235, 0.4)"},{offset:1,color:"rgba(37, 99, 235, 0.05)"}]}},lineStyle:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#3B82F6"},{offset:1,color:"#60A5FA"}]},shadowColor:"rgba(37, 99, 235, 0.5)",shadowBlur:10,shadowOffsetY:5},itemStyle:{color:"#3B82F6",borderColor:"#fff",borderWidth:2,shadowBlur:8,shadowColor:"rgba(37, 99, 235, 0.5)"},emphasis:{focus:"series",itemStyle:{color:"#2563EB",borderColor:"#fff",borderWidth:3,shadowBlur:12,shadowColor:"rgba(37, 99, 235, 0.8)"}},animation:!0,animationDuration:1e3,animationEasing:"cubicOut"}]};v.setOption(b,!0)},g=async()=>{try{const[_,S,b,x]=await Promise.allSettled([kk(),Ek(),Ok(),Bk()]);_.status==="fulfilled"?(s.value.count_sale_order=_.value.total,s.value.new_customer=_.value.today):(console.error("Error fetching users stats:",_.reason),s.value.count_sale_order=0,s.value.new_customer=0),S.status==="fulfilled"?s.value.count_order=S.value:(console.error("Error fetching most viewed story count:",S.reason),s.value.count_order=0),b.status==="fulfilled"?s.value.total_sale=String(b.value):(console.error("Error fetching total comments count:",b.reason),s.value.total_sale="0"),x.status==="fulfilled"?h.value=x.value||[]:(console.error("Error fetching latest lottery winners:",x.reason),h.value=[])}catch(_){console.error("Error in getDashboardReport:",_)}if(!t.value)try{const _=await Pk();s.value={...s.value,..._}}catch(_){console.error("Error fetching report:",_)}},y=async()=>{try{const _=new Date().toISOString().split("T")[0],S=await Rk({type:i.value,date:_});u.value=S||[];let b=[],x=[];if(i.value==="hourly"){const w={};u.value.forEach(T=>{const C=Number(T.hour)||0,M=Number((T==null?void 0:T.views)||0);w[C]=(w[C]||0)+M});for(let T=0;T<=24;T++){const C=w[T]||0,M=T===24?"24:00":`${T.toString().padStart(2,"0")}:00`;b.push(M),x.push(Math.round(C))}}else{const w={};u.value.forEach(T=>{const C=T.day||"",M=Number((T==null?void 0:T.views)||0);w[C]=(w[C]||0)+M}),Object.keys(w).sort().forEach(T=>{const C=w[T],M=vk(T);b.push(M),x.push(Math.round(C))})}p(b,x)}catch(_){console.error("Error fetching story views:",_),p([],[])}};JR(async()=>{await g(),await y(),window.addEventListener("resize",()=>{v&&v.resize()})}),QR(()=>{v&&(v.dispose(),v=null)});async function m(){if(h.value.length===0){const{message:_}=await fl(()=>import("./index-260c6c4b.js"),["assets/index-260c6c4b.js","assets/index-f943fa9e.js","assets/index-46ad6f18.js","assets/index-44d4db91.css","assets/button.vue_vue_type_style_index_0_lang-00692d4d.js","assets/Icon-c7d1ee6c.js","assets/_plugin-vue_export-helper-296b8bb1.js","assets/Icon-07033a75.css","assets/button-318cd43f.css","assets/styleChecker-1b8f3fec.js","assets/vnode-3f18e55e.js","assets/useState-ba6a6598.js","assets/index-7636dfa0.js","assets/BasicModal.vue_vue_type_style_index_0_lang-c4a9b750.js","assets/index-3e027524.js","assets/BasicModal-19054bcd.css","assets/index-88b85db9.css","assets/index-10949106.js","assets/Col-f3e9d12a.js","assets/index-e9d0cff4.js","assets/index-7154d232.js","assets/index-13e97f91.js","assets/index-c9af1953.js","assets/dayjs-2e8b8386.js"]);_.warning("دادهای برای خروجی وجود ندارد");return}try{c.value=!0;const _=h.value.map((M,D)=>({ردیف:D+1,رتبه:M.rank||"",نام:M.name||"","شماره همراه":M.mobile||"-",امتیاز
|