@platox/pivot-table 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +97 -97
- package/lib/index.js +6 -1
- package/lib/index.umd.cjs +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
export interface ModuleValueType {
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
|
-
id?: any;
|
|
4
|
-
type?:
|
|
5
|
-
| "text"
|
|
6
|
-
| "statistics"
|
|
7
|
-
| "chart-bar"
|
|
8
|
-
| "chart-bar-pile"
|
|
9
|
-
| "chart-bar-percentage"
|
|
10
|
-
| "chart-line"
|
|
11
|
-
| "chart-line-smooth"
|
|
12
|
-
| "chart-strip-bar"
|
|
13
|
-
| "chart-strip-bar-pile"
|
|
14
|
-
| "chart-strip-bar-percentage"
|
|
15
|
-
| "chart-pie"
|
|
16
|
-
| "chart-pie-circular"
|
|
17
|
-
| "calendar";
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
-
customData?: any;
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
-
customeStyle?: any;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface ModuleData {
|
|
25
|
-
id?: string;
|
|
26
|
-
i?: string;
|
|
27
|
-
w: number;
|
|
28
|
-
h: number;
|
|
29
|
-
x: number;
|
|
30
|
-
y: number;
|
|
31
|
-
type: ModuleValueType["type"];
|
|
32
|
-
customData?: ModuleValueType["customData"];
|
|
33
|
-
customeStyle?: ModuleValueType["customeStyle"];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface SourceDataFieldsTypes {
|
|
37
|
-
label: string;
|
|
38
|
-
enum: string | number[];
|
|
39
|
-
value: string;
|
|
40
|
-
type: "int" | "timestamp" | "string" | "bool";
|
|
41
|
-
}
|
|
42
|
-
export interface SourceDataTypes {
|
|
43
|
-
fields: SourceDataFieldsTypes[];
|
|
44
|
-
label: string;
|
|
45
|
-
value: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export type ModuleConfigDataTypes = ModuleData[];
|
|
49
|
-
|
|
50
|
-
export type ModuleDataApi = ({
|
|
51
|
-
id,
|
|
52
|
-
query,
|
|
53
|
-
}: {
|
|
54
|
-
id?: string;
|
|
55
|
-
query?: string;
|
|
56
|
-
}) => Promise<unknown>;
|
|
57
|
-
|
|
58
|
-
export type EnumDataApi = (url?: string) => Promise<unknown> | undefined;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export interface DashboardWorkbenchProps {
|
|
62
|
-
sourceData?: SourceDataTypes[];
|
|
63
|
-
moduleConfigData?: ModuleConfigDataTypes;
|
|
64
|
-
fieldMap?: Record<string, string>;
|
|
65
|
-
lang?: "zh_CN" | "en_US";
|
|
66
|
-
moduleDataApi?: ModuleDataApi;
|
|
67
|
-
enumDataApi?: EnumDataApi;
|
|
68
|
-
onCreateModule?: (val: ModuleData) => Promise<ModuleData>;
|
|
69
|
-
onUpdateModule?: (val: ModuleData) => Promise<ModuleData>;
|
|
70
|
-
onDeleteModule?: (val: string) => Promise<void>;
|
|
71
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
-
onLayoutChange?: (layout: any) => void;
|
|
73
|
-
className?: string;
|
|
74
|
-
cols?: { lg: number; md: number; sm: number; xs: number; xxs: number };
|
|
75
|
-
rowHeight?: number;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
declare module "pivot-table" {
|
|
80
|
-
|
|
81
|
-
interface PivotTableProps {
|
|
82
|
-
sourceData?: SourceDataTypes[];
|
|
83
|
-
moduleConfigData?: ModuleConfigDataTypes;
|
|
84
|
-
fieldMap?: Record<string, string>;
|
|
85
|
-
lang?: "zh_CN" | "en_US";
|
|
86
|
-
moduleDataApi?: ModuleDataApi;
|
|
87
|
-
enumDataApi?: EnumDataApi;
|
|
88
|
-
onCreateModule?: (val: ModuleData) => Promise<ModuleData>;
|
|
89
|
-
onUpdateModule?: (val: ModuleData) => Promise<ModuleData>;
|
|
90
|
-
onDeleteModule?: (val: string) => Promise<void>;
|
|
91
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
-
onLayoutChange?: (layout: any) => void;
|
|
93
|
-
className?: string;
|
|
94
|
-
cols?: { lg: number; md: number; sm: number; xs: number; xxs: number };
|
|
95
|
-
rowHeight?: number;
|
|
96
|
-
}
|
|
97
|
-
export const PivotTable: React.FC<PivotTableProps>;
|
|
1
|
+
export interface ModuleValueType {
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
|
+
id?: any;
|
|
4
|
+
type?:
|
|
5
|
+
| "text"
|
|
6
|
+
| "statistics"
|
|
7
|
+
| "chart-bar"
|
|
8
|
+
| "chart-bar-pile"
|
|
9
|
+
| "chart-bar-percentage"
|
|
10
|
+
| "chart-line"
|
|
11
|
+
| "chart-line-smooth"
|
|
12
|
+
| "chart-strip-bar"
|
|
13
|
+
| "chart-strip-bar-pile"
|
|
14
|
+
| "chart-strip-bar-percentage"
|
|
15
|
+
| "chart-pie"
|
|
16
|
+
| "chart-pie-circular"
|
|
17
|
+
| "calendar";
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
customData?: any;
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
customeStyle?: any;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ModuleData {
|
|
25
|
+
id?: string;
|
|
26
|
+
i?: string;
|
|
27
|
+
w: number;
|
|
28
|
+
h: number;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
type: ModuleValueType["type"];
|
|
32
|
+
customData?: ModuleValueType["customData"];
|
|
33
|
+
customeStyle?: ModuleValueType["customeStyle"];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface SourceDataFieldsTypes {
|
|
37
|
+
label: string;
|
|
38
|
+
enum: string | number[];
|
|
39
|
+
value: string;
|
|
40
|
+
type: "int" | "timestamp" | "string" | "bool";
|
|
41
|
+
}
|
|
42
|
+
export interface SourceDataTypes {
|
|
43
|
+
fields: SourceDataFieldsTypes[];
|
|
44
|
+
label: string;
|
|
45
|
+
value: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type ModuleConfigDataTypes = ModuleData[];
|
|
49
|
+
|
|
50
|
+
export type ModuleDataApi = ({
|
|
51
|
+
id,
|
|
52
|
+
query,
|
|
53
|
+
}: {
|
|
54
|
+
id?: string;
|
|
55
|
+
query?: string;
|
|
56
|
+
}) => Promise<unknown>;
|
|
57
|
+
|
|
58
|
+
export type EnumDataApi = (url?: string) => Promise<unknown> | undefined;
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
export interface DashboardWorkbenchProps {
|
|
62
|
+
sourceData?: SourceDataTypes[];
|
|
63
|
+
moduleConfigData?: ModuleConfigDataTypes;
|
|
64
|
+
fieldMap?: Record<string, string>;
|
|
65
|
+
lang?: "zh_CN" | "en_US";
|
|
66
|
+
moduleDataApi?: ModuleDataApi;
|
|
67
|
+
enumDataApi?: EnumDataApi;
|
|
68
|
+
onCreateModule?: (val: ModuleData) => Promise<ModuleData>;
|
|
69
|
+
onUpdateModule?: (val: ModuleData) => Promise<ModuleData>;
|
|
70
|
+
onDeleteModule?: (val: string) => Promise<void>;
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
+
onLayoutChange?: (layout: any) => void;
|
|
73
|
+
className?: string;
|
|
74
|
+
cols?: { lg: number; md: number; sm: number; xs: number; xxs: number };
|
|
75
|
+
rowHeight?: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
declare module "pivot-table" {
|
|
80
|
+
|
|
81
|
+
interface PivotTableProps {
|
|
82
|
+
sourceData?: SourceDataTypes[];
|
|
83
|
+
moduleConfigData?: ModuleConfigDataTypes;
|
|
84
|
+
fieldMap?: Record<string, string>;
|
|
85
|
+
lang?: "zh_CN" | "en_US";
|
|
86
|
+
moduleDataApi?: ModuleDataApi;
|
|
87
|
+
enumDataApi?: EnumDataApi;
|
|
88
|
+
onCreateModule?: (val: ModuleData) => Promise<ModuleData>;
|
|
89
|
+
onUpdateModule?: (val: ModuleData) => Promise<ModuleData>;
|
|
90
|
+
onDeleteModule?: (val: string) => Promise<void>;
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
+
onLayoutChange?: (layout: any) => void;
|
|
93
|
+
className?: string;
|
|
94
|
+
cols?: { lg: number; md: number; sm: number; xs: number; xxs: number };
|
|
95
|
+
rowHeight?: number;
|
|
96
|
+
}
|
|
97
|
+
export const PivotTable: React.FC<PivotTableProps>;
|
|
98
98
|
}
|
package/lib/index.js
CHANGED
|
@@ -52021,7 +52021,12 @@ const Iue = () => /* @__PURE__ */ A.jsx(
|
|
|
52021
52021
|
return je(() => {
|
|
52022
52022
|
h({ fieldMap: r, sourceData: t });
|
|
52023
52023
|
}, [r, h, t]), je(() => {
|
|
52024
|
-
g(
|
|
52024
|
+
g(
|
|
52025
|
+
(e == null ? void 0 : e.map((G) => ({
|
|
52026
|
+
...G,
|
|
52027
|
+
i: G.i ? G.i : G.id
|
|
52028
|
+
}))) || []
|
|
52029
|
+
);
|
|
52025
52030
|
}, [e]), je(() => {
|
|
52026
52031
|
D.changeLanguage(l || "zh_CN");
|
|
52027
52032
|
}, [D, l]), /* @__PURE__ */ A.jsxs("div", { className: "pivot-table", children: [
|
package/lib/index.umd.cjs
CHANGED
|
@@ -175,4 +175,4 @@ echarts.use([`+R+"]);":"Unknown series "+E))}return}if(c==="tooltip"){if(b){proc
|
|
|
175
175
|
`,"Illegal config:",f,`.
|
|
176
176
|
`)),Ke(n));var y=h?dR(h):null;h&&!y&&(process.env.NODE_ENV!=="production"&&(n=Or("Invalid parser name "+h+`.
|
|
177
177
|
`,"Illegal config:",f,`.
|
|
178
|
-
`)),Ke(n)),a.push({dimIdx:m.index,parser:y,comparator:new vR(d,v)})});var o=e.sourceFormat;o!==mr&&o!==fn&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),Ke(n));for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(f,c){for(var d=0;d<a.length;d++){var h=a[d],v=e.retrieveValueFromItem(f,h.dimIdx),g=e.retrieveValueFromItem(c,h.dimIdx);h.parser&&(v=h.parser(v),g=h.parser(g));var p=h.comparator.evaluate(v,g);if(p!==0)return p}return 0}),{data:s}}};function Mne(t){t.registerTransform(One),t.registerTransform(Rne)}var Pne=function(t){ve(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,n,i){t.prototype.init.call(this,r,n,i),this._sourceManager=new _R(this),CR(this)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),CR(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:ti},e}(rt),Bne=function(t){ve(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(qr);function Ine(t){t.registerComponentModel(Pne),t.registerComponentView(Bne)}var oi=Oi.CMD;function Cl(t,e){return Math.abs(t-e)<1e-5}function R1(t){var e=t.data,r=t.len(),n=[],i,a=0,o=0,s=0,l=0;function u(M,P){i&&i.length>2&&n.push(i),i=[M,P]}function f(M,P,B,F){Cl(M,B)&&Cl(P,F)||i.push(M,P,B,F,B,F)}function c(M,P,B,F,H,j){var W=Math.abs(P-M),L=Math.tan(W/4)*4/3,q=P<M?-1:1,J=Math.cos(M),ee=Math.sin(M),ae=Math.cos(P),U=Math.sin(P),I=J*H+B,Y=ee*j+F,z=ae*H+B,G=U*j+F,Q=H*L*q,K=j*L*q;i.push(I-Q*ee,Y+K*J,z+Q*U,G-K*ae,z,G)}for(var d,h,v,g,p=0;p<r;){var m=e[p++],y=p===1;switch(y&&(a=e[p],o=e[p+1],s=a,l=o,(m===oi.L||m===oi.C||m===oi.Q)&&(i=[s,l])),m){case oi.M:a=s=e[p++],o=l=e[p++],u(s,l);break;case oi.L:d=e[p++],h=e[p++],f(a,o,d,h),a=d,o=h;break;case oi.C:i.push(e[p++],e[p++],e[p++],e[p++],a=e[p++],o=e[p++]);break;case oi.Q:d=e[p++],h=e[p++],v=e[p++],g=e[p++],i.push(a+2/3*(d-a),o+2/3*(h-o),v+2/3*(d-v),g+2/3*(h-g),v,g),a=v,o=g;break;case oi.A:var b=e[p++],C=e[p++],_=e[p++],w=e[p++],x=e[p++],D=e[p++]+x;p+=1;var S=!e[p++];d=Math.cos(x)*_+b,h=Math.sin(x)*w+C,y?(s=d,l=h,u(s,l)):f(a,o,d,h),a=Math.cos(D)*_+b,o=Math.sin(D)*w+C;for(var T=(S?-1:1)*Math.PI/2,E=x;S?E>D:E<D;E+=T){var R=S?Math.max(E+T,D):Math.min(E+T,D);c(E,R,b,C,_,w)}break;case oi.R:s=a=e[p++],l=o=e[p++],d=s+e[p++],h=l+e[p++],u(d,l),f(d,l,d,h),f(d,h,s,h),f(s,h,s,l),f(s,l,d,l);break;case oi.Z:i&&f(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&n.push(i),n}function M1(t,e,r,n,i,a,o,s,l,u){if(Cl(t,r)&&Cl(e,n)&&Cl(i,o)&&Cl(a,s)){l.push(o,s);return}var f=2/u,c=f*f,d=o-t,h=s-e,v=Math.sqrt(d*d+h*h);d/=v,h/=v;var g=r-t,p=n-e,m=i-o,y=a-s,b=g*g+p*p,C=m*m+y*y;if(b<c&&C<c){l.push(o,s);return}var _=d*g+h*p,w=-d*m-h*y,x=b-_*_,D=C-w*w;if(x<c&&_>=0&&D<c&&w>=0){l.push(o,s);return}var S=[],T=[];ia(t,r,i,o,.5,S),ia(e,n,a,s,.5,T),M1(S[0],T[0],S[1],T[1],S[2],T[2],S[3],T[3],l,u),M1(S[4],T[4],S[5],T[5],S[6],T[6],S[7],T[7],l,u)}function Nne(t,e){var r=R1(t),n=[];e=e||1;for(var i=0;i<r.length;i++){var a=r[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var f=a[u++],c=a[u++],d=a[u++],h=a[u++],v=a[u++],g=a[u++];M1(s,l,f,c,d,h,v,g,o,e),s=v,l=g}n.push(o)}return n}function CI(t,e,r){var n=t[e],i=t[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*r)),s=Math.floor(r/o);s===0&&(s=1,o=r);for(var l=[],u=0;u<o;u++)l.push(s);var f=o*s,c=r-f;if(c>0)for(var u=0;u<c;u++)l[u%o]+=1;return l}function wI(t,e,r){for(var n=t.r0,i=t.r,a=t.startAngle,o=t.endAngle,s=Math.abs(o-a),l=s*i,u=i-n,f=l>Math.abs(u),c=CI([l,u],f?0:1,e),d=(f?s:u)/c.length,h=0;h<c.length;h++)for(var v=(f?u:s)/c[h],g=0;g<c[h];g++){var p={};f?(p.startAngle=a+d*h,p.endAngle=a+d*(h+1),p.r0=n+v*g,p.r=n+v*(g+1)):(p.startAngle=a+v*g,p.endAngle=a+v*(g+1),p.r0=n+d*h,p.r=n+d*(h+1)),p.clockwise=t.clockwise,p.cx=t.cx,p.cy=t.cy,r.push(p)}}function Fne(t,e,r){for(var n=t.width,i=t.height,a=n>i,o=CI([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",f=a?"y":"x",c=t[s]/o.length,d=0;d<o.length;d++)for(var h=t[l]/o[d],v=0;v<o[d];v++){var g={};g[u]=d*c,g[f]=v*h,g[s]=c,g[l]=h,g.x+=t.x,g.y+=t.y,r.push(g)}}function xI(t,e,r,n){return t*n-r*e}function Lne(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,f=o-i,c=s-a,d=xI(f,c,l,u);if(Math.abs(d)<1e-6)return null;var h=t-i,v=e-a,g=xI(h,v,f,c)/d;return g<0||g>1?null:new Ee(g*l+t,g*u+e)}function kne(t,e,r){var n=new Ee;Ee.sub(n,r,e),n.normalize();var i=new Ee;Ee.sub(i,t,e);var a=i.dot(n);return a}function wl(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function jne(t,e,r){for(var n=t.length,i=[],a=0;a<n;a++){var o=t[a],s=t[(a+1)%n],l=Lne(o[0],o[1],s[0],s[1],e.x,e.y,r.x,r.y);l&&i.push({projPt:kne(l,e,r),pt:l,idx:a})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(p,m){return p.projPt-m.projPt});var u=i[0],f=i[i.length-1];if(f.idx<u.idx){var c=u;u=f,f=c}for(var d=[u.pt.x,u.pt.y],h=[f.pt.x,f.pt.y],v=[d],g=[h],a=u.idx+1;a<=f.idx;a++)wl(v,t[a].slice());wl(v,h),wl(v,d);for(var a=f.idx+1;a<=u.idx+n;a++)wl(g,t[a%n].slice());return wl(g,d),wl(g,h),[{points:v},{points:g}]}function DI(t){var e=t.points,r=[],n=[];XT(e,r,n);var i=new Ze(r[0],r[1],n[0]-r[0],n[1]-r[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new Ee,f=new Ee;return a>o?(u.x=f.x=s+a/2,u.y=l,f.y=l+o):(u.y=f.y=l+o/2,u.x=s,f.x=s+a),jne(e,u,f)}function Av(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);Av(t,a[0],i,n),Av(t,a[1],r-i,n)}return n}function zne(t,e){for(var r=[],n=0;n<e;n++)r.push(gy(t));return r}function Hne(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function Vne(t){for(var e=[],r=0;r<t.length;)e.push([t[r++],t[r++]]);return e}function Wne(t,e){var r=[],n=t.shape,i;switch(t.type){case"rect":Fne(n,e,r),i=Nt;break;case"sector":wI(n,e,r),i=Jn;break;case"circle":wI({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,r),i=Jn;break;default:var a=t.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=we(Nne(t.getUpdatedPathProxy(),o),function(m){return Vne(m)}),l=s.length;if(l===0)Av(DI,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var f=0,c=we(s,function(m){var y=[],b=[];XT(m,y,b);var C=(b[1]-y[1])*(b[0]-y[0]);return f+=C,{poly:m,area:C}});c.sort(function(m,y){return y.area-m.area});for(var d=e,u=0;u<l;u++){var h=c[u];if(d<=0)break;var v=u===l-1?d:Math.ceil(h.area/f*e);v<0||(Av(DI,{points:h.poly},v,r),d-=v)}}i=ch;break}if(!i)return zne(t,e);for(var g=[],u=0;u<r.length;u++){var p=new i;p.setShape(r[u]),Hne(t,p),g.push(p)}return g}function $ne(t,e){var r=t.length,n=e.length;if(r===n)return[t,e];for(var i=[],a=[],o=r<n?t:e,s=Math.min(r,n),l=Math.abs(n-r)/6,u=(s-2)/6,f=Math.ceil(l/u)+1,c=[o[0],o[1]],d=l,h=2;h<s;){var v=o[h-2],g=o[h-1],p=o[h++],m=o[h++],y=o[h++],b=o[h++],C=o[h++],_=o[h++];if(d<=0){c.push(p,m,y,b,C,_);continue}for(var w=Math.min(d,f-1)+1,x=1;x<=w;x++){var D=x/w;ia(v,p,y,C,D,i),ia(g,m,b,_,D,a),v=i[3],g=a[3],c.push(i[1],a[1],i[2],a[2],v,g),p=i[5],m=a[5],y=i[6],b=a[6]}d-=w-1}return o===t?[c,e]:[t,c]}function SI(t,e){for(var r=t.length,n=t[r-2],i=t[r-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function Gne(t,e){for(var r,n,i,a=[],o=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],f=void 0,c=void 0;l?u?(r=$ne(l,u),f=r[0],c=r[1],n=f,i=c):(c=SI(i||l,l),f=l):(f=SI(n||u,u),c=u),a.push(f),o.push(c)}return[a,o]}function EI(t){for(var e=0,r=0,n=0,i=t.length,a=0,o=i-2;a<i;o=a,a+=2){var s=t[o],l=t[o+1],u=t[a],f=t[a+1],c=s*f-u*l;e+=c,r+=(s+u)*c,n+=(l+f)*c}return e===0?[t[0]||0,t[1]||0]:[r/e/3,n/e/3,e]}function Une(t,e,r,n){for(var i=(t.length-2)/6,a=1/0,o=0,s=t.length,l=s-2,u=0;u<i;u++){for(var f=u*6,c=0,d=0;d<s;d+=2){var h=d===0?f:(f+d-2)%l+2,v=t[h]-r[0],g=t[h+1]-r[1],p=e[d]-n[0],m=e[d+1]-n[1],y=p-v,b=m-g;c+=y*y+b*b}c<a&&(a=c,o=u)}return o}function qne(t){for(var e=[],r=t.length,n=0;n<r;n+=2)e[n]=t[r-n-2],e[n+1]=t[r-n-1];return e}function Yne(t,e,r,n){for(var i=[],a,o=0;o<t.length;o++){var s=t[o],l=e[o],u=EI(s),f=EI(l);a==null&&(a=u[2]<0!=f[2]<0);var c=[],d=[],h=0,v=1/0,g=[],p=s.length;a&&(s=qne(s));for(var m=Une(s,l,u,f)*6,y=p-2,b=0;b<y;b+=2){var C=(m+b)%y+2;c[b+2]=s[C]-u[0],c[b+3]=s[C+1]-u[1]}c[0]=s[m]-u[0],c[1]=s[m+1]-u[1];for(var _=n/r,w=-n/2;w<=n/2;w+=_){for(var x=Math.sin(w),D=Math.cos(w),S=0,b=0;b<s.length;b+=2){var T=c[b],E=c[b+1],R=l[b]-f[0],M=l[b+1]-f[1],P=R*D-M*x,B=R*x+M*D;g[b]=P,g[b+1]=B;var F=P-T,H=B-E;S+=F*F+H*H}if(S<v){v=S,h=w;for(var j=0;j<g.length;j++)d[j]=g[j]}}i.push({from:c,to:d,fromCp:u,toCp:f,rotation:-h})}return i}function Tv(t){return t.__isCombineMorphing}var AI="__mOriginal_";function Ov(t,e,r){var n=AI+e,i=t[n]||t[e];t[n]||(t[n]=t[e]);var a=r.replace,o=r.after,s=r.before;t[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function Ef(t,e){var r=AI+e;t[r]&&(t[e]=t[r],t[r]=null)}function TI(t,e){for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function OI(t,e){var r=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=Gne(R1(r),R1(n)),a=i[0],o=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&TI(a,s),l&&TI(o,l),Ov(e,"updateTransform",{replace:u}),e.transform=null;var f=Yne(a,o,10,Math.PI),c=[];Ov(e,"buildPath",{replace:function(d){for(var h=e.__morphT,v=1-h,g=[],p=0;p<f.length;p++){var m=f[p],y=m.from,b=m.to,C=m.rotation*h,_=m.fromCp,w=m.toCp,x=Math.sin(C),D=Math.cos(C);yd(g,_,w,h);for(var S=0;S<y.length;S+=2){var T=y[S],E=y[S+1],R=b[S],M=b[S+1],P=T*v+R*h,B=E*v+M*h;c[S]=P*D-B*x+g[0],c[S+1]=P*x+B*D+g[1]}var F=c[0],H=c[1];d.moveTo(F,H);for(var S=2;S<y.length;){var R=c[S++],M=c[S++],j=c[S++],W=c[S++],L=c[S++],q=c[S++];F===R&&H===M&&j===L&&W===q?d.lineTo(L,q):d.bezierCurveTo(R,M,j,W,L,q),F=L,H=q}}}})}function P1(t,e,r){if(!t||!e)return e;var n=r.done,i=r.during;OI(t,e),e.__morphT=0;function a(){Ef(e,"buildPath"),Ef(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},$e({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},r)),e}function Xne(t,e,r,n,i,a){var o=16;t=i===r?0:Math.round(32767*(t-r)/(i-r)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var f=0,c=0;(t&u)>0&&(f=1),(e&u)>0&&(c=1),s+=u*u*(3*f^c),c===0&&(f===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function Rv(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=we(t,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),f=l.x+l.width/2+(u?u[4]:0),c=l.y+l.height/2+(u?u[5]:0);return e=Math.min(f,e),r=Math.min(c,r),n=Math.max(f,n),i=Math.max(c,i),[f,c]}),o=we(a,function(s,l){return{cp:s,z:Xne(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function RI(t){return Wne(t.path,t.count)}function B1(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Zne(t,e,r){var n=[];function i(_){for(var w=0;w<_.length;w++){var x=_[w];Tv(x)?i(x.childrenRef()):x instanceof Ge&&n.push(x)}}i(t);var a=n.length;if(!a)return B1();var o=r.dividePath||RI,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),B1();n=Rv(n),s=Rv(s);for(var l=r.done,u=r.during,f=r.individualDelay,c=new Ou,d=0;d<a;d++){var h=n[d],v=s[d];v.parent=e,v.copyTransform(c),f||OI(h,v)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function g(_){for(var w=0;w<s.length;w++)s[w].addSelfToZr(_)}Ov(e,"addSelfToZr",{after:function(_){g(_)}}),Ov(e,"removeSelfFromZr",{after:function(_){for(var w=0;w<s.length;w++)s[w].removeSelfFromZr(_)}});function p(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,Ef(e,"addSelfToZr"),Ef(e,"removeSelfFromZr")}var m=s.length;if(f)for(var y=m,b=function(){y--,y===0&&(p(),l&&l())},d=0;d<m;d++){var C=f?$e({delay:(r.delay||0)+f(d,m,n[d],s[d]),done:b},r):r;P1(n[d],s[d],C)}else e.__morphT=0,e.animateTo({__morphT:1},$e({during:function(_){for(var w=0;w<m;w++){var x=s[w];x.__morphT=e.__morphT,x.dirtyShape()}u&&u(_)},done:function(){p();for(var _=0;_<t.length;_++)Ef(t[_],"updateTransform");l&&l()}},r));return e.__zr&&g(e.__zr),{fromIndividuals:n,toIndividuals:s,count:m}}function Kne(t,e,r){var n=e.length,i=[],a=r.dividePath||RI;function o(h){for(var v=0;v<h.length;v++){var g=h[v];Tv(g)?o(g.childrenRef()):g instanceof Ge&&i.push(g)}}if(Tv(t)){o(t.childrenRef());var s=i.length;if(s<n)for(var l=0,u=s;u<n;u++)i.push(gy(i[l++%s]));i.length=n}else{i=a({path:t,count:n});for(var f=t.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(f);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),B1()}i=Rv(i),e=Rv(e);for(var c=r.individualDelay,u=0;u<n;u++){var d=c?$e({delay:(r.delay||0)+c(u,n,i[u],e[u])},r):r;P1(i[u],e[u],d)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function MI(t){return ge(t[0])}function PI(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push({one:t[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)r[o%n].many.push(e[i][o])}for(var s=0,i=n-1;i>=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var Qne={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var i=gy(t.path);i.setStyle("opacity",r),e.push(i)}return e},split:null};function I1(t,e,r,n,i,a){if(!t.length||!e.length)return;var o=Js("update",n,i);if(!(o&&o.duration>0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,f;MI(t)&&(u=t,f=e),MI(e)&&(u=e,f=t);function c(m,y,b,C,_){var w=m.many,x=m.one;if(w.length===1&&!_){var D=y?w[0]:x,S=y?x:w[0];if(Tv(D))c({many:[D],one:S},!0,b,C,!0);else{var T=s?$e({delay:s(b,C)},l):l;P1(D,S,T),a(D,S,D,S,T)}}else for(var E=$e({dividePath:Qne[r],individualDelay:s&&function(H,j,W,L){return s(H+b,C)}},l),R=y?Zne(w,x,E):Kne(x,w,E),M=R.fromIndividuals,P=R.toIndividuals,B=M.length,F=0;F<B;F++){var T=s?$e({delay:s(F,B)},l):l;a(M[F],P[F],y?w[F]:m.one,y?m.one:w[F],T)}}for(var d=u?u===t:t.length>e.length,h=u?PI(f,u):PI(d?e:t,[d?t:e]),v=0,g=0;g<h.length;g++)v+=h[g].many.length;for(var p=0,g=0;g<h.length;g++)c(h[g],d,p,v),p+=h[g].many.length}function Xo(t){if(!t)return[];if(ge(t)){for(var e=[],r=0;r<t.length;r++)e.push(Xo(t[r]));return e}var n=[];return t.traverse(function(i){i instanceof Ge&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var BI=1e4,Jne=0,II=1,NI=2,eie=gt();function tie(t,e){for(var r=t.dimensions,n=0;n<r.length;n++){var i=t.getDimensionInfo(r[n]);if(i&&i.otherDims[e]===0)return r[n]}}function rie(t,e,r){var n=t.getDimensionInfo(r),i=n&&n.ordinalMeta;if(n){var a=t.get(n.name,e);return i&&i.categories[a]||a+""}}function FI(t,e,r,n){var i=n?"itemChildGroupId":"itemGroupId",a=tie(t,i);if(a){var o=rie(t,e,a);return o}var s=t.getRawDataItem(e),l=n?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!n)return r||t.getId(e)}function LI(t){var e=[];return k(t,function(r){var n=r.data,i=r.dataGroupId;if(n.count()>BI){process.env.NODE_ENV!=="production"&&It("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:FI(n,o,i,!1),childGroupId:FI(n,o,i,!0),divide:r.divide,dataIndex:o})}),e}function N1(t,e,r){t.traverse(function(n){n instanceof Ge&&sr(n,{style:{opacity:0}},e,{dataIndex:r,isFrom:!0})})}function F1(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function xl(t){t.stopAnimation(),t.isGroup&&t.traverse(function(e){e.stopAnimation()})}function nie(t,e,r){var n=Js("update",r,e);n&&t.traverse(function(i){if(i instanceof la){var a=fX(i);a&&i.animateFrom({style:a},n)}})}function iie(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++){var i=t[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function kI(t,e,r){var n=LI(t),i=LI(e);function a(b,C,_,w,x){(_||b)&&C.animateFrom({style:_&&_!==b?le(le({},_.style),b.style):b.style},x)}var o=!1,s=Jne,l=Be(),u=Be();n.forEach(function(b){b.groupId&&l.set(b.groupId,!0),b.childGroupId&&u.set(b.childGroupId,!0)});for(var f=0;f<i.length;f++){var c=i[f].groupId;if(u.get(c)){s=II;break}var d=i[f].childGroupId;if(d&&l.get(d)){s=NI;break}}function h(b,C){return function(_){var w=_.data,x=_.dataIndex;return C?w.getId(x):b?s===II?_.childGroupId:_.groupId:s===NI?_.childGroupId:_.groupId}}var v=iie(n,i),g={};if(!v)for(var f=0;f<i.length;f++){var p=i[f],m=p.data.getItemGraphicEl(p.dataIndex);m&&(g[m.id]=!0)}function y(b,C){var _=n[C],w=i[b],x=w.data.hostModel,D=_.data.getItemGraphicEl(_.dataIndex),S=w.data.getItemGraphicEl(w.dataIndex);if(D===S){S&&nie(S,w.dataIndex,x);return}D&&g[D.id]||S&&(xl(S),D?(xl(D),F1(D),o=!0,I1(Xo(D),Xo(S),w.divide,x,b,a)):N1(S,x,b))}new Rb(n,i,h(!0,v),h(!1,v),null,"multiple").update(y).updateManyToOne(function(b,C){var _=i[b],w=_.data,x=w.hostModel,D=w.getItemGraphicEl(_.dataIndex),S=Tt(we(C,function(T){return n[T].data.getItemGraphicEl(n[T].dataIndex)}),function(T){return T&&T!==D&&!g[T.id]});D&&(xl(D),S.length?(k(S,function(T){xl(T),F1(T)}),o=!0,I1(Xo(S),Xo(D),_.divide,x,b,a)):N1(D,x,_.dataIndex))}).updateOneToMany(function(b,C){var _=n[C],w=_.data.getItemGraphicEl(_.dataIndex);if(!(w&&g[w.id])){var x=Tt(we(b,function(S){return i[S].data.getItemGraphicEl(i[S].dataIndex)}),function(S){return S&&S!==w}),D=i[b[0]].data.hostModel;x.length&&(k(x,function(S){return xl(S)}),w?(xl(w),F1(w),o=!0,I1(Xo(w),Xo(x),_.divide,D,b[0],a)):k(x,function(S){return N1(S,D,b[0])}))}}).updateManyToMany(function(b,C){new Rb(C,b,function(_){return n[_].data.getId(n[_].dataIndex)},function(_){return i[_].data.getId(i[_].dataIndex)}).update(function(_,w){y(b[_],C[w])}).execute()}).execute(),o&&k(e,function(b){var C=b.data,_=C.hostModel,w=_&&r.getViewOfSeriesModel(_),x=Js("update",_,0);w&&_.isAnimationEnabled()&&x&&x.duration>0&&w.group.traverse(function(D){D instanceof Ge&&!D.animators.length&&D.animateFrom({style:{opacity:0}},x)})})}function jI(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function zI(t){return ge(t)?t.sort().join(","):t}function Sa(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function aie(t,e){var r=Be(),n=Be(),i=Be();k(t.oldSeries,function(o,s){var l=t.oldDataGroupIds[s],u=t.oldData[s],f=jI(o),c=zI(f);n.set(c,{dataGroupId:l,data:u}),ge(f)&&k(f,function(d){i.set(d,{key:c,dataGroupId:l,data:u})})});function a(o){r.get(o)&&It("Duplicated seriesKey in universalTransition "+o)}return k(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=jI(o),f=zI(u),c=n.get(f);if(c)process.env.NODE_ENV!=="production"&&a(f),r.set(f,{oldSeries:[{dataGroupId:c.dataGroupId,divide:Sa(c.data),data:c.data}],newSeries:[{dataGroupId:s,divide:Sa(l),data:l}]});else if(ge(u)){process.env.NODE_ENV!=="production"&&a(f);var d=[];k(u,function(g){var p=n.get(g);p.data&&d.push({dataGroupId:p.dataGroupId,divide:Sa(p.data),data:p.data})}),d.length&&r.set(f,{oldSeries:d,newSeries:[{dataGroupId:s,data:l,divide:Sa(l)}]})}else{var h=i.get(u);if(h){var v=r.get(h.key);v||(v={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:Sa(h.data)}],newSeries:[]},r.set(h.key,v)),v.newSeries.push({dataGroupId:s,data:l,divide:Sa(l)})}}}}),r}function HI(t,e){for(var r=0;r<t.length;r++){var n=e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id;if(n)return r}}function oie(t,e,r,n){var i=[],a=[];k(xt(t.from),function(o){var s=HI(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:Sa(e.oldData[s]),groupIdDim:o.dimension})}),k(xt(t.to),function(o){var s=HI(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:Sa(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&kI(i,a,n)}function sie(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){k(xt(n.seriesTransition),function(i){k(xt(i.to),function(a){for(var o=n.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][Vh]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(e,r,n){var i=eie(r);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)k(xt(a),function(h){oie(h,i,n,r)});else{var o=aie(i,n);k(o.keys(),function(h){var v=o.get(h);kI(v.oldSeries,v.newSeries,r)})}k(n.updatedSeries,function(h){h[Vh]&&(h[Vh]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],f=i.oldData=[],c=0;c<s.length;c++){var d=s[c].getData();d.count()<BI&&(l.push(s[c]),u.push(s[c].get("dataGroupId")),f.push(d))}})}function VI(t,e,r){var n=Ts.createCanvas(),i=e.getWidth(),a=e.getHeight(),o=n.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=i+"px",o.height=a+"px",n.setAttribute("data-zr-dom-id",t)),n.width=i*r,n.height=a*r,n}var L1=function(t){ve(e,t);function e(r,n,i){var a=t.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var o;i=i||jd,typeof r=="string"?o=VI(r,n,i):De(r)&&(o=r,r=o.id),a.id=r,a.dom=o;var s=o.style;return s&&(EA(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),a.painter=n,a.dpr=i,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=VI("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,n,i,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,u=new Ze(0,0,0,0);function f(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var b=new Ze(0,0,0,0);b.copy(y),o.push(b)}else{for(var C=!1,_=1/0,w=0,x=0;x<o.length;++x){var D=o[x];if(D.intersect(y)){var S=new Ze(0,0,0,0);S.copy(D),S.union(y),o[x]=S,C=!0;break}else if(l){u.copy(y),u.union(D);var T=y.width*y.height,E=D.width*D.height,R=u.width*u.height,M=R-T-E;M<_&&(_=M,w=x)}}if(l&&(o[w].union(y),C=!0),!C){var b=new Ze(0,0,0,0);b.copy(y),o.push(b)}l||(l=o.length>=s)}}for(var c=this.__startIndex;c<this.__endIndex;++c){var d=r[c];if(d){var h=d.shouldBePainted(i,a,!0,!0),v=d.__isRendered&&(d.__dirty&Gr||!h)?d.getPrevPaintRect():null;v&&f(v);var g=h&&(d.__dirty&Gr||!d.__isRendered)?d.getPaintRect():null;g&&f(g)}}for(var c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var d=n[c],h=d&&d.shouldBePainted(i,a,!0,!0);if(d&&(!h||!d.__zr)&&d.__isRendered){var v=d.getPrevPaintRect();v&&f(v)}}var p;do{p=!1;for(var c=0;c<o.length;){if(o[c].isZero()){o.splice(c,1);continue}for(var m=c+1;m<o.length;)o[c].intersect(o[m])?(p=!0,o[c].union(o[m]),o.splice(m,1)):m++;c++}}while(p);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,n){var i=this.dpr,a=this.dom,o=a.style,s=this.domBack;o&&(o.width=r+"px",o.height=n+"px"),a.width=r*i,a.height=n*i,s&&(s.width=r*i,s.height=n*i,i!==1&&this.ctxBack.scale(i,i))},e.prototype.clear=function(r,n,i){var a=this.dom,o=this.ctx,s=a.width,l=a.height;n=n||this.clearColor;var u=this.motionBlur&&!r,f=this.lastFrameAlpha,c=this.dpr,d=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(a,0,0,s/c,l/c));var h=this.domBack;function v(g,p,m,y){if(o.clearRect(g,p,m,y),n&&n!=="transparent"){var b=void 0;if(pd(n)){var C=n.global||n.__width===m&&n.__height===y;b=C&&n.__canvasGradient||cb(o,n,{x:0,y:0,width:m,height:y}),n.__canvasGradient=b,n.__width=m,n.__height=y}else IG(n)&&(n.scaleX=n.scaleX||c,n.scaleY=n.scaleY||c,b=db(o,n,{dirty:function(){d.setUnpainted(),d.painter.refresh()}}));o.save(),o.fillStyle=b||n,o.fillRect(g,p,m,y),o.restore()}u&&(o.save(),o.globalAlpha=f,o.drawImage(h,g,p,m,y),o.restore())}!i||u?v(0,0,s,l):i.length&&k(i,function(g){v(g.x*c,g.y*c,g.width*c,g.height*c)})},e}($n),WI=1e5,Zo=314159,Mv=.01,lie=.001;function uie(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function fie(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var cie=function(){function t(e,r,n,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var a=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=n=le({},n||{}),this.dpr=n.devicePixelRatio||jd,this._singleCanvas=a,this.root=e;var o=e.style;o&&(EA(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(a){var f=e,c=f.width,d=f.height;n.width!=null&&(c=n.width),n.height!=null&&(d=n.height),this.dpr=n.devicePixelRatio||1,f.width=c*this.dpr,f.height=d*this.dpr,this._width=c,this._height=d;var h=new L1(f,this,this.dpr);h.__builtin__=!0,h.initContext(),l[Zo]=h,h.zlevel=Zo,s.push(Zo),this._domRoot=e}else{this._width=Yh(e,0,n),this._height=Yh(e,1,n);var u=this._domRoot=fie(this._width,this._height);e.appendChild(u)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),n=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,n,e,this._redrawId);for(var a=0;a<i.length;a++){var o=i[a],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=a===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,n=this._hoverlayer;if(n&&n.clear(),!!r){for(var i={inHover:!0,viewWidth:this._width,viewHeight:this._height},a,o=0;o<r;o++){var s=e[o];s.__inHover&&(n||(n=this._hoverlayer=this.getLayer(WI)),a||(a=n.ctx,a.save()),Vo(a,s,i,o===r-1))}a&&a.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(WI)},t.prototype.paintOne=function(e,r){cM(e,r)},t.prototype._paintList=function(e,r,n,i){if(this._redrawId===i){n=n||!1,this._updateLayerStatus(e);var a=this._doPaintList(e,r,n),o=a.finished,s=a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;xd(function(){l._paintList(e,r,n,i)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(Zo).ctx,r=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,r,n),this.eachBuiltinLayer(function(i){i.virtual&&e.drawImage(i.dom,0,0,r,n)})},t.prototype._doPaintList=function(e,r,n){for(var i=this,a=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||n)&&a.push(u)}for(var f=!0,c=!1,d=function(g){var p=a[g],m=p.ctx,y=o&&p.createRepaintRects(e,r,h._width,h._height),b=n?p.__startIndex:p.__drawIndex,C=!n&&p.incremental&&Date.now,_=C&&Date.now(),w=p.zlevel===h._zlevelList[0]?h._backgroundColor:null;if(p.__startIndex===p.__endIndex)p.clear(!1,w,y);else if(b===p.__startIndex){var x=e[b];(!x.incremental||!x.notClear||n)&&p.clear(!1,w,y)}b===-1&&(console.error("For some unknown reason. drawIndex is -1"),b=p.__startIndex);var D,S=function(M){var P={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(D=b;D<p.__endIndex;D++){var B=e[D];if(B.__inHover&&(c=!0),i._doPaintEl(B,p,o,M,P,D===p.__endIndex-1),C){var F=Date.now()-_;if(F>15)break}}P.prevElClipPaths&&m.restore()};if(y)if(y.length===0)D=p.__endIndex;else for(var T=h.dpr,E=0;E<y.length;++E){var R=y[E];m.save(),m.beginPath(),m.rect(R.x*T,R.y*T,R.width*T,R.height*T),m.clip(),S(R),m.restore()}else m.save(),S(),m.restore();p.__drawIndex=D,p.__drawIndex<p.__endIndex&&(f=!1)},h=this,v=0;v<a.length;v++)d(v);return Fe.wxa&&k(this._layers,function(g){g&&g.ctx&&g.ctx.draw&&g.ctx.draw()}),{finished:f,needsRefreshHover:c}},t.prototype._doPaintEl=function(e,r,n,i,a,o){var s=r.ctx;if(n){var l=e.getPaintRect();(!i||l&&l.intersect(i))&&(Vo(s,e,a,o),e.setPrevPaintRect(l))}else Vo(s,e,a,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Zo);var n=this._layers[e];return n||(n=new L1("zr_"+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?ot(n,this._layerConfig[e],!0):this._layerConfig[e-Mv]&&ot(n,this._layerConfig[e-Mv],!0),r&&(n.virtual=r),this.insertLayer(e,n),n.initContext()),n},t.prototype.insertLayer=function(e,r){var n=this._layers,i=this._zlevelList,a=i.length,o=this._domRoot,s=null,l=-1;if(n[e]){process.env.NODE_ENV!=="production"&&fo("ZLevel "+e+" has been used already");return}if(!uie(r)){process.env.NODE_ENV!=="production"&&fo("Layer of zlevel "+e+" is not valid");return}if(a>0&&e>i[0]){for(l=0;l<a-1&&!(i[l]<e&&i[l+1]>e);l++);s=n[i[l]]}if(i.splice(l+1,0,e),n[e]=r,!r.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(r.dom,u.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)},t.prototype.eachLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i];e.call(r,this._layers[a],a)}},t.prototype.eachBuiltinLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__&&e.call(r,o,a)}},t.prototype.eachOtherLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__||e.call(r,o,a)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(c,d){c.__dirty=c.__used=!1});function r(c){a&&(a.__endIndex!==c&&(a.__dirty=!0),a.__endIndex=c)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var i=e[n];if(i.zlevel!==e[n-1].zlevel||i.incremental){this._needsManuallyCompositing=!0;break}}var a=null,o=0,s,l;for(l=0;l<e.length;l++){var i=e[l],u=i.zlevel,f=void 0;s!==u&&(s=u,o=0),i.incremental?(f=this.getLayer(u+lie,this._needsManuallyCompositing),f.incremental=!0,o=1):f=this.getLayer(u+(o>0?Mv:0),this._needsManuallyCompositing),f.__builtin__||fo("ZLevel "+u+" has been used by unkown layer "+f.id),f!==a&&(f.__used=!0,f.__startIndex!==l&&(f.__dirty=!0),f.__startIndex=l,f.incremental?f.__drawIndex=-1:f.__drawIndex=l,r(l),a=f),i.__dirty&Gr&&!i.__inHover&&(f.__dirty=!0,f.incremental&&f.__drawIndex<0&&(f.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(c,d){!c.__used&&c.getElementCount()>0&&(c.__dirty=!0,c.__startIndex=c.__endIndex=c.__drawIndex=0),c.__dirty&&c.__drawIndex<0&&(c.__drawIndex=c.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,k(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?ot(n[e],r,!0):n[e]=r;for(var i=0;i<this._zlevelList.length;i++){var a=this._zlevelList[i];if(a===e||a===e+Mv){var o=this._layers[a];ot(o,n[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,n=this._zlevelList,i=r[e];i&&(i.dom.parentNode.removeChild(i.dom),delete r[e],n.splice(Xe(n,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,a=this.root;if(e!=null&&(i.width=e),r!=null&&(i.height=r),e=Yh(a,0,i),r=Yh(a,1,i),n.style.display="",this._width!==e||r!==this._height){n.style.width=e+"px",n.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer(Zo).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[Zo].dom;var r=new L1("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=r.dom.width,a=r.dom.height;this.eachLayer(function(c){c.__builtin__?n.drawImage(c.dom,0,0,i,a):c.renderToCanvas&&(n.save(),c.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){var f=s[l];Vo(n,f,o,l===u-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}();function die(t){t.registerPainter("canvas",cie)}ya([jre,yne,lne,ane,Rre,Ine,Mne,ete,jee,hte,pee,sie,die]);const hie=N.memo(({options:t,echartRef:e})=>{const r=N.useRef(null),n=N.useRef(null);return N.useEffect(()=>(r.current&&(n.current=IQ(r.current)),()=>{n.current&&n.current.dispose()}),[]),N.useEffect(()=>{n.current&&(n.current.clear(),t&&Object.keys(t).length>0&&n.current.setOption({...t}))},[t]),N.useImperativeHandle(e,()=>({resize:()=>{n.current&&n.current.resize()},getWidth:()=>{n.current&&n.current.getWidth()}})),A.jsx("div",{ref:r,style:{width:"100%",height:"100%"}})}),ke=t=>typeof t=="string",Af=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},$I=t=>t==null?"":""+t,vie=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},pie=/###/g,GI=t=>t&&t.indexOf("###")>-1?t.replace(pie,"."):t,UI=t=>!t||ke(t),Tf=(t,e,r)=>{const n=ke(e)?e.split("."):e;let i=0;for(;i<n.length-1;){if(UI(t))return{};const a=GI(n[i]);!t[a]&&r&&(t[a]=new r),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++i}return UI(t)?{}:{obj:t,k:GI(n[i])}},qI=(t,e,r)=>{const{obj:n,k:i}=Tf(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let a=e[e.length-1],o=e.slice(0,e.length-1),s=Tf(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Tf(t,o,Object),s&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},gie=(t,e,r,n)=>{const{obj:i,k:a}=Tf(t,e,Object);i[a]=i[a]||[],i[a].push(r)},Pv=(t,e)=>{const{obj:r,k:n}=Tf(t,e);if(r)return r[n]},mie=(t,e,r)=>{const n=Pv(t,r);return n!==void 0?n:Pv(e,r)},YI=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in t?ke(t[n])||t[n]instanceof String||ke(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):YI(t[n],e[n],r):t[n]=e[n]);return t},Dl=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var yie={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const bie=t=>ke(t)?t.replace(/[&<>"'\/]/g,e=>yie[e]):t;class _ie{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Cie=[" ",",","?","!",";"],wie=new _ie(20),xie=(t,e,r)=>{e=e||"",r=r||"";const n=Cie.filter(o=>e.indexOf(o)<0&&r.indexOf(o)<0);if(n.length===0)return!0;const i=wie.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(r);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},k1=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const n=e.split(r);let i=t;for(let a=0;a<n.length;){if(!i||typeof i!="object")return;let o,s="";for(let l=a;l<n.length;++l)if(l!==a&&(s+=r),s+=n[l],o=i[s],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&l<n.length-1)continue;a+=l-a+1;break}i=o}return i},Bv=t=>t&&t.replace("_","-"),Die={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class Iv{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,r)}init(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=e||Die,this.options=r,this.debug=r.debug}log(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}warn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}error(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"error","")}deprecate(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(ke(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new Iv(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Iv(this.logger,e)}}var si=new Iv;class Nv{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}emit(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[s,l]=o;for(let u=0;u<l;u++)s(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[s,l]=o;for(let u=0;u<l;u++)s.apply(s,[e,...n])})}}class XI extends Nv{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}getResource(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,r],n&&(Array.isArray(n)?s.push(...n):ke(n)&&a?s.push(...n.split(a)):s.push(n)));const l=Pv(this.data,s);return!l&&!r&&!n&&e.indexOf(".")>-1&&(e=s[0],r=s[1],n=s.slice(2).join(".")),l||!o||!ke(n)?l:k1(this.data&&this.data[e]&&this.data[e][r],n,a)}addResource(e,r,n,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,r];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(s=e.split("."),i=r,r=s[1]),this.addNamespaces(r),qI(this.data,s,i),a.silent||this.emit("added",e,r,n,i)}addResources(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in n)(ke(n[a])||Array.isArray(n[a]))&&this.addResource(e,r,a,n[a],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[e,r];e.indexOf(".")>-1&&(s=e.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let l=Pv(this.data,s)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?YI(l,n,a):l={...l,...n},qI(this.data,s,l),o.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,r)}:this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var ZI={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(a=>{this.processors[a]&&(e=this.processors[a].process(e,r,n,i))}),e}};const KI={};class Fv extends Nv{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),vie(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=si.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const n=this.resolve(e,r);return n&&n.res!==void 0}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!xie(e,n,i);if(o&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:a};const u=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(u[0])>-1)&&(a=u.shift()),e=u.join(i)}return ke(a)&&(a=[a]),{key:e,namespaces:a}}translate(e,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1],u=r.lng||this.language,f=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(f){const C=r.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${C}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${C}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:o}const c=this.resolve(e,r);let d=c&&c.res;const h=c&&c.usedKey||o,v=c&&c.exactUsedKey||o,g=Object.prototype.toString.apply(d),p=["[object Number]","[object Function]","[object RegExp]"],m=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=!ke(d)&&typeof d!="boolean"&&typeof d!="number";if(y&&d&&b&&p.indexOf(g)<0&&!(ke(m)&&Array.isArray(d))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,d,{...r,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(c.res=C,c.usedParams=this.getUsedParamsDetails(r),c):C}if(a){const C=Array.isArray(d),_=C?[]:{},w=C?v:h;for(const x in d)if(Object.prototype.hasOwnProperty.call(d,x)){const D=`${w}${a}${x}`;_[x]=this.translate(D,{...r,joinArrays:!1,ns:s}),_[x]===D&&(_[x]=d[x])}d=_}}else if(y&&ke(m)&&Array.isArray(d))d=d.join(m),d&&(d=this.extendTranslation(d,e,r,n));else{let C=!1,_=!1;const w=r.count!==void 0&&!ke(r.count),x=Fv.hasDefaultValue(r),D=w?this.pluralResolver.getSuffix(u,r.count,r):"",S=r.ordinal&&w?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",T=w&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),E=T&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${D}`]||r[`defaultValue${S}`]||r.defaultValue;!this.isValidLookup(d)&&x&&(C=!0,d=E),this.isValidLookup(d)||(_=!0,d=o);const M=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&_?void 0:d,P=x&&E!==d&&this.options.updateMissing;if(_||C||P){if(this.logger.log(P?"updateKey":"missingKey",u,l,o,P?E:d),a){const j=this.resolve(o,{...r,keySeparator:!1});j&&j.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let B=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let j=0;j<F.length;j++)B.push(F[j]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(r.lng||this.language):B.push(r.lng||this.language);const H=(j,W,L)=>{const q=x&&L!==d?L:M;this.options.missingKeyHandler?this.options.missingKeyHandler(j,l,W,q,P,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(j,l,W,q,P,r),this.emit("missingKey",j,l,W,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?B.forEach(j=>{const W=this.pluralResolver.getSuffixes(j,r);T&&r[`defaultValue${this.options.pluralSeparator}zero`]&&W.indexOf(`${this.options.pluralSeparator}zero`)<0&&W.push(`${this.options.pluralSeparator}zero`),W.forEach(L=>{H([j],o+L,r[`defaultValue${L}`]||E)})}):H(B,o,E))}d=this.extendTranslation(d,e,r,c,n),_&&d===o&&this.options.appendNamespaceToMissingKey&&(d=`${l}:${o}`),(_||C)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,C?d:void 0):d=this.options.parseMissingKeyHandler(d))}return i?(c.res=d,c.usedParams=this.getUsedParamsDetails(r),c):d}extendTranslation(e,r,n,i,a){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const u=ke(e)&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const d=e.match(this.interpolator.nestingRegexp);f=d&&d.length}let c=n.replace&&!ke(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,n.lng||this.language||i.usedLng,n),u){const d=e.match(this.interpolator.nestingRegexp),h=d&&d.length;f<h&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(n.lng=this.language||i.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var d=arguments.length,h=new Array(d),v=0;v<d;v++)h[v]=arguments[v];return a&&a[0]===h[0]&&!n.context?(o.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${r[0]}`),null):o.translate(...h,r)},n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,l=ke(s)?[s]:s;return e!=null&&l&&l.length&&n.applyPostProcessor!==!1&&(e=ZI.handle(l,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,i,a,o,s;return ke(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(l,r),f=u.key;i=f;let c=u.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=r.count!==void 0&&!ke(r.count),h=d&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),v=r.context!==void 0&&(ke(r.context)||typeof r.context=="number")&&r.context!=="",g=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);c.forEach(p=>{this.isValidLookup(n)||(s=p,!KI[`${g[0]}-${p}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(KI[`${g[0]}-${p}`]=!0,this.logger.warn(`key "${i}" for languages "${g.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(m=>{if(this.isValidLookup(n))return;o=m;const y=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,f,m,p,r);else{let C;d&&(C=this.pluralResolver.getSuffix(m,r.count,r));const _=`${this.options.pluralSeparator}zero`,w=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(y.push(f+C),r.ordinal&&C.indexOf(w)===0&&y.push(f+C.replace(w,this.options.pluralSeparator)),h&&y.push(f+_)),v){const x=`${f}${this.options.contextSeparator}${r.context}`;y.push(x),d&&(y.push(x+C),r.ordinal&&C.indexOf(w)===0&&y.push(x+C.replace(w,this.options.pluralSeparator)),h&&y.push(x+_))}}let b;for(;b=y.pop();)this.isValidLookup(n)||(a=b,n=this.getResource(m,p,b,r))}))})}),{res:n,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!ke(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r===n.substring(0,r.length)&&e[n]!==void 0)return!0;return!1}}const j1=t=>t.charAt(0).toUpperCase()+t.slice(1);class QI{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=si.create("languageUtils")}getScriptPartFromCode(e){if(e=Bv(e),!e||e.indexOf("-")<0)return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=Bv(e),!e||e.indexOf("-")<0)return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(ke(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let i=Intl.getCanonicalLocales(e)[0];if(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)return i}catch{}const r=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map(i=>i.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=j1(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=j1(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=j1(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find(a=>{if(a===i)return a;if(!(a.indexOf("-")<0&&i.indexOf("-")<0)&&(a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1))return a})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),ke(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],e),i=[],a=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return ke(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):ke(e)&&a(this.formatLanguageCode(e)),n.forEach(o=>{i.indexOf(o)<0&&a(this.formatLanguageCode(o))}),i}}let Sie=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Eie={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const Aie=["v1","v2","v3"],Tie=["v4"],JI={zero:0,one:1,two:2,few:3,many:4,other:5},Oie=()=>{const t={};return Sie.forEach(e=>{e.lngs.forEach(r=>{t[r]={numbers:e.nr,plurals:Eie[e.fc]}})}),t};class Rie{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=r,this.logger=si.create("pluralResolver"),(!this.options.compatibilityJSON||Tie.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Oie(),this.pluralRulesCache={}}addRule(e,r){this.rules[e]=r}clearCache(){this.pluralRulesCache={}}getRule(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const n=Bv(e==="dev"?"en":e),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];const o=new Intl.PluralRules(n,{type:i});return this.pluralRulesCache[a]=o,o}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(e,r);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(e,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((i,a)=>JI[i]-JI[a]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):n.numbers.map(i=>this.getSuffix(e,i,r)):[]}getSuffix(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,n);return i?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:this.getSuffixRetroCompatible(i,r):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,r){const n=e.noAbs?e.plurals(r):e.plurals(Math.abs(r));let i=e.numbers[n];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const a=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?a():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!Aie.includes(this.options.compatibilityJSON)}}const eN=function(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=mie(t,e,r);return!a&&i&&ke(r)&&(a=k1(t,r,n),a===void 0&&(a=k1(e,r,n))),a},z1=t=>t.replace(/\$/g,"$$$$");class Mie{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=si.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(r=>r),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:s,suffixEscaped:l,formatSeparator:u,unescapeSuffix:f,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:v,nestingSuffixEscaped:g,nestingOptionsSeparator:p,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=r!==void 0?r:bie,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?Dl(a):o||"{{",this.suffix=s?Dl(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Dl(d):h||Dl("$t("),this.nestingSuffix=v?Dl(v):g||Dl(")"),this.nestingOptionsSeparator=p||",",this.maxReplaces=m||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>r&&r.source===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,r,n,i){let a,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=h=>{if(h.indexOf(this.formatSeparator)<0){const m=eN(r,l,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(m,void 0,n,{...i,...r,interpolationkey:h}):m}const v=h.split(this.formatSeparator),g=v.shift().trim(),p=v.join(this.formatSeparator).trim();return this.format(eN(r,l,g,this.options.keySeparator,this.options.ignoreJSONStructure),p,n,{...i,...r,interpolationkey:g})};this.resetRegExp();const f=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,c=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>z1(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?z1(this.escape(h)):z1(h)}].forEach(h=>{for(s=0;a=h.regex.exec(e);){const v=a[1].trim();if(o=u(v),o===void 0)if(typeof f=="function"){const p=f(e,a,i);o=ke(p)?p:""}else if(i&&Object.prototype.hasOwnProperty.call(i,v))o="";else if(c){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`),o="";else!ke(o)&&!this.useRawValueToEscape&&(o=$I(o));const g=h.safeValue(o);if(e=e.replace(a[0],g),c?(h.regex.lastIndex+=o.length,h.regex.lastIndex-=a[0].length):h.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,a,o;const s=(l,u)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const c=l.split(new RegExp(`${f}[ ]*{`));let d=`{${c[1]}`;l=c[0],d=this.interpolate(d,o);const h=d.match(/'/g),v=d.match(/"/g);(h&&h.length%2===0&&!v||v.length%2!==0)&&(d=d.replace(/'/g,'"'));try{o=JSON.parse(d),u&&(o={...u,...o})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,g),`${l}${f}${d}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...n},o=o.replace&&!ke(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const f=i[1].split(this.formatSeparator).map(c=>c.trim());i[1]=f.shift(),l=f,u=!0}if(a=r(s.call(this,i[1].trim(),o),o),a&&i[0]===e&&!ke(a))return a;ke(a)||(a=$I(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),u&&(a=l.reduce((f,c)=>this.format(f,c,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],a),this.regexp.lastIndex=0}return e}}const Pie=t=>{let e=t.toLowerCase().trim();const r={};if(t.indexOf("(")>-1){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);e==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(o=>{if(o){const[s,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),f=s.trim();r[f]||(r[f]=u),u==="false"&&(r[f]=!1),u==="true"&&(r[f]=!0),isNaN(u)||(r[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:r}},Sl=t=>{const e={};return(r,n,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=n+JSON.stringify(a);let s=e[o];return s||(s=t(Bv(n),i),e[o]=s),s(r)}};class Bie{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=si.create("formatter"),this.options=e,this.formats={number:Sl((r,n)=>{const i=new Intl.NumberFormat(r,{...n});return a=>i.format(a)}),currency:Sl((r,n)=>{const i=new Intl.NumberFormat(r,{...n,style:"currency"});return a=>i.format(a)}),datetime:Sl((r,n)=>{const i=new Intl.DateTimeFormat(r,{...n});return a=>i.format(a)}),relativetime:Sl((r,n)=>{const i=new Intl.RelativeTimeFormat(r,{...n});return a=>i.format(a,n.range||"day")}),list:Sl((r,n)=>{const i=new Intl.ListFormat(r,{...n});return a=>i.format(a)})},this.init(e)}init(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=r.interpolation.formatSeparator||","}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=Sl(r)}format(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=r.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(s=>s.indexOf(")")>-1)){const s=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,s)].join(this.formatSeparator)}return a.reduce((s,l)=>{const{formatName:u,formatOptions:f}=Pie(l);if(this.formats[u]){let c=s;try{const d=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},h=d.locale||d.lng||i.locale||i.lng||n;c=this.formats[u](s,h,{...f,...i,...d})}catch(d){this.logger.warn(d)}return c}else this.logger.warn(`there was no format function for ${u}`);return s},e)}}const Iie=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Nie extends Nv{constructor(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=si.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,i.backend,i)}queueLoad(e,r,n,i){const a={},o={},s={},l={};return e.forEach(u=>{let f=!0;r.forEach(c=>{const d=`${u}|${c}`;!n.reload&&this.store.hasResourceBundle(u,c)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?o[d]===void 0&&(o[d]=!0):(this.state[d]=1,f=!1,o[d]===void 0&&(o[d]=!0),a[d]===void 0&&(a[d]=!0),l[c]===void 0&&(l[c]=!0)))}),f||(s[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const i=e.split("|"),a=i[0],o=i[1];r&&this.emit("failedLoading",a,o,r),!r&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const s={};this.queue.forEach(l=>{gie(l.loaded,[a],o),Iie(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const f=l.loaded[u];f.length&&f.forEach(c=>{s[u][c]===void 0&&(s[u][c]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(u&&f&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,r,n,i+1,a*2,o)},a);return}o(u,f)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const u=l(e,r);u&&typeof u.then=="function"?u.then(f=>s(null,f)).catch(s):s(null,u)}catch(u){s(u)}return}return l(e,r,s)}prepareLoading(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();ke(e)&&(e=this.languageUtils.toResolveHierarchy(e)),ke(r)&&(r=[r]);const a=this.queueLoad(e,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=e.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,s),this.loaded(e,o,s)})}saveMissing(e,r,n,i,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend&&this.backend.create){const l={...o,isUpdate:a},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(e,r,n,i,l):f=u(e,r,n,i),f&&typeof f.then=="function"?f.then(c=>s(null,c)).catch(s):s(null,f)}catch(f){s(f)}else u(e,r,n,i,s,l)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const tN=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),ke(t[1])&&(e.defaultValue=t[1]),ke(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),rN=t=>(ke(t.ns)&&(t.ns=[t.ns]),ke(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),ke(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Lv=()=>{},Fie=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class Of extends Nv{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=rN(e),this.services={},this.logger=si,this.modules={external:[]},Fie(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(){var e=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(n=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(ke(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=tN();this.options={...i,...this.options,...rN(r)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const a=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?si.init(a(this.modules.logger),this.options):si.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=Bie);const c=new QI(this.options);this.store=new XI(this.options.resources,this.options);const d=this.services;d.logger=si,d.resourceStore=this.store,d.languageUtils=c,d.pluralResolver=new Rie(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(d.formatter=a(f),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new Mie(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new Nie(a(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(h){for(var v=arguments.length,g=new Array(v>1?v-1:0),p=1;p<v;p++)g[p-1]=arguments[p];e.emit(h,...g)}),this.modules.languageDetector&&(d.languageDetector=a(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=a(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new Fv(this.services,this.options),this.translator.on("*",function(h){for(var v=arguments.length,g=new Array(v>1?v-1:0),p=1;p<v;p++)g[p-1]=arguments[p];e.emit(h,...g)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Lv),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=function(){return e.store[f](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=function(){return e.store[f](...arguments),e}});const l=Af(),u=()=>{const f=(c,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(d),n(c,d)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lv;const i=ke(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],o=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(u=>{u!=="cimode"&&a.indexOf(u)<0&&a.push(u)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload&&this.options.preload.forEach(s=>o(s)),this.services.backendConnector.load(a,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(s)})}else n(null)}reloadResources(e,r,n){const i=Af();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=Lv),this.services.backendConnector.reload(e,r,a=>{i.resolve(),n(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&ZI.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(e,r){var n=this;this.isLanguageChangingTo=e;const i=Af();this.emit("languageChanging",e);const a=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,u)=>{u?(a(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return n.t(...arguments)}),r&&r(l,function(){return n.t(...arguments)})},s=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);const u=ke(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||a(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,f=>{o(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),i}getFixedT(e,r,n){var i=this;const a=function(o,s){let l;if(typeof s!="object"){for(var u=arguments.length,f=new Array(u>2?u-2:0),c=2;c<u;c++)f[c-2]=arguments[c];l=i.options.overloadTranslationOptionHandler([o,s].concat(f))}else l={...s};l.lng=l.lng||a.lng,l.lngs=l.lngs||a.lngs,l.ns=l.ns||a.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||a.keyPrefix);const d=i.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(o)?h=o.map(v=>`${l.keyPrefix}${d}${v}`):h=l.keyPrefix?`${l.keyPrefix}${d}${o}`:o,i.t(h,l)};return ke(e)?a.lng=e:a.lngs=e,a.ns=r,a.keyPrefix=n,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===0||u===2};if(r.precheck){const s=r.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}loadNamespaces(e,r){const n=Af();return this.options.ns?(ke(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=Af();ke(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services&&this.services.languageUtils||new QI(tN());return r.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Of(e,r)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lv;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new Of(i);return(e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n&&(a.store=new XI(this.store.data,i),a.services.resourceStore=a.store),a.translator=new Fv(a.services,i),a.translator.on("*",function(s){for(var l=arguments.length,u=new Array(l>1?l-1:0),f=1;f<l;f++)u[f-1]=arguments[f];a.emit(s,...u)}),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ae=Of.createInstance();Ae.createInstance=Of.createInstance,Ae.createInstance,Ae.dir,Ae.init,Ae.loadResources,Ae.reloadResources,Ae.use,Ae.changeLanguage,Ae.getFixedT;const H1=Ae.t;Ae.exists,Ae.setDefaultNamespace,Ae.hasLoadedNamespace,Ae.loadNamespaces,Ae.loadLanguages;const Lie=(t,e)=>({"chart-bar":{xAxis:{type:"category",data:e},yAxis:{type:"value"}},"chart-bar-pile":{xAxis:{type:"category",data:e},yAxis:{type:"value"}},"chart-bar-percentage":{xAxis:{type:"category",data:e},yAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}}},"chart-line":{xAxis:{type:"category",data:e},yAxis:{type:"value"}},"chart-line-smooth":{xAxis:{type:"category",data:e},yAxis:{type:"value"}},"chart-pie":{xAxis:{show:!1},yAxis:{show:!1}},"chart-pie-circular":{xAxis:{show:!1},yAxis:{show:!1}},"chart-strip-bar":{xAxis:{type:"value"},yAxis:{type:"category",data:e}},"chart-strip-bar-pile":{xAxis:{type:"value"},yAxis:{type:"category",data:e}},"chart-strip-bar-percentage":{xAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}},yAxis:{type:"category",data:e}}})[t],nN=({type:t,data:e,label:r,name:n,isGroup:i,groupField:a,labels:o})=>{let s;return t==="chart-pie"?s={data:e.map((l,u)=>({value:l,name:o[u]})),name:n,type:"pie",radius:"50%",label:{...r,position:"outside"},labelLine:{normal:{show:!0}}}:t==="chart-pie-circular"?s={data:e.map((l,u)=>({value:l,name:o[u]})),type:"pie",name:n,radius:["40%","70%"],label:{...r,position:"outside"},labelLine:{normal:{show:!0}}}:t==="chart-line"?s={data:e,name:n,type:"line",label:r}:t==="chart-line-smooth"?s={data:e,name:n,type:"line",smooth:!0,label:r}:s={data:e,name:n,type:"bar",label:r},(t==="chart-bar-percentage"||t==="chart-bar-pile"||t==="chart-strip-bar-pile"||t==="chart-strip-bar-percentage")&&i&&a&&(s.stack=a),s},kie=({series:t,chartConfig:e,width:r})=>{var y;const n=b=>{const C=Math.max(...(b==null?void 0:b.map(x=>String(x==null?void 0:x.name).length))||[]),_=Math.max(...(b==null?void 0:b.flatMap(x=>x.data.map(D=>String(D).length)))||[]),w=Math.max(...(b==null?void 0:b.flatMap(x=>x.data.length))||[]);return{maxNameLength:C,maxValueLength:_,maxArrLength:w}},i=b=>b==null?void 0:b.reduce((C,_)=>{const w=String(_).length;return Math.max(C,w)},0);let a=18;const o=50;let s="",l="",u="45px";const f="30px",{maxValueLength:c,maxArrLength:d}=n(t),h=i(((y=e==null?void 0:e.xAxis)==null?void 0:y.data)||[]);let v=0;d>3?(h>15&&(v=90),h>5&&(v=45),r<3&&(v=90)):a=55;const g=v===45?8:v===90?10:0,p=6;h>15?s=`${15*g+a}px`:s=`${h*g+a}px`,l=`${c*p+o}px`;const m=Math.floor(t.length/4);return m===1?u="60px":u=`${m*18+45}px`,{top:u,left:l,right:f,bottom:s,axisLabelRotate:v}},jie=({moduleDataApi:t,customData:e,customeStyle:r,width:n=2,height:i=2})=>{const{globalData:a}=lo(),[o,s]=N.useState(),[l,u]=N.useState(),[f,c]=N.useState(),[d,h]=N.useState(),v=N.useRef(),g=N.useCallback(async()=>{var m,y;if(u([]),e){c(!0);let b="";const C=(e==null?void 0:e.xAxis)==="tags"?"tag":e==null?void 0:e.xAxis,_=(e==null?void 0:e.groupField)==="tags"?"tag":e==null?void 0:e.groupField;e.isGroup?(e.yAxis==="recordTotal"&&(b+=`select=${C},${_},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(b+=`select=${C},${_},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`)):(e.yAxis==="recordTotal"&&(b+=`select=${C},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(b+=`select=${C},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`)),e!=null&&e.conditionData&&((y=(m=e==null?void 0:e.conditionData)==null?void 0:m.conditionList)==null?void 0:y.length)>0&&(b+=`&${nu(e==null?void 0:e.conditionData)}`),e!=null&&e.dataSourceId&&(t==null||t({id:e==null?void 0:e.dataSourceId,query:b}).then(w=>{if(!w.success){X.message.error(w.message);return}u(w.data)}).finally(()=>{c(!1)}))}else u([])},[e==null?void 0:e.dataSourceId,e==null?void 0:e.conditionData,e==null?void 0:e.xAxis,e==null?void 0:e.yAxis,e==null?void 0:e.yAxisField,e==null?void 0:e.yAxisFieldType,e==null?void 0:e.isGroup,e==null?void 0:e.groupField]);N.useEffect(()=>{e&&g()},[e==null?void 0:e.dataSourceId,e==null?void 0:e.conditionData,e==null?void 0:e.xAxis,e==null?void 0:e.yAxis,e==null?void 0:e.yAxisField,e==null?void 0:e.yAxisFieldType,e==null?void 0:e.isGroup,e==null?void 0:e.groupField]);const p=N.useCallback(()=>{var m,y,b,C,_,w,x,D,S,T,E,R,M,P,B,F,H;if(e&&l&&e.type&&l.length>0){const j={show:((m=e==null?void 0:e.chartOptions)==null?void 0:m.includes("label"))||((y=r==null?void 0:r.xchartOptions)==null?void 0:y.includes("label")),position:"top",formatter:"{c}"},W=(e==null?void 0:e.xAxis)==="tags"?"tag":e==null?void 0:e.xAxis,L=(e==null?void 0:e.groupField)==="tags"?"tag":e==null?void 0:e.groupField,q=(b=e==null?void 0:e.chartOptions)==null?void 0:b.includes("legend"),J=he=>{const de=o==null?void 0:o.find(pe=>pe.value===he);return de==null?void 0:de.label},ee=({item:he,field:de})=>cd({fieldOptions:o,val:he[de],field:de,fieldMap:a==null?void 0:a.fieldMap}),ae=(he,de,pe)=>{const Re=pe==="asc"?1:-1;return[...he].sort((nt,je)=>{let Qe,$t;switch(de){case"xAxis":Qe=ee({item:nt,field:W}),$t=ee({item:je,field:W});break;case"yAxisField":Qe=nt[e==null?void 0:e.yAxisFieldType]||0,$t=je[e==null?void 0:e.yAxisFieldType]||0;break;case"recordValue":default:Qe=e.yAxis==="recordTotal"?nt==null?void 0:nt.count:nt[e==null?void 0:e.yAxisFieldType]||0,$t=e.yAxis==="recordTotal"?je==null?void 0:je.count:je[e==null?void 0:e.yAxisFieldType]||0;break}return Qe>$t?1*Re:Qe<$t?-1*Re:0})},U={},I={},Y={},z={},G=new Set,Q=new Set;if(l.forEach(he=>{const de=ee({item:he,field:W});G.add(de);const pe=e.yAxis==="recordTotal"?he==null?void 0:he.count:he[e==null?void 0:e.yAxisFieldType]||0;if(e!=null&&e.isGroup&&(e!=null&&e.groupField)){const Re=ee({item:he,field:L}),nt=de??H1("unknown");Q.add(Re),Y[Re]||(Y[Re]={}),Y[Re][nt]=pe}else{const Re=de??H1("unknown");U[Re]=pe}}),e!=null&&e.isGroup&&(e!=null&&e.groupField)){const he={};Object.keys(Y).forEach(de=>{Object.entries(Y[de]).forEach(([pe,Re])=>{he[pe]=(he[pe]||0)+Re})}),Object.keys(Y).forEach(de=>{z[de]={},Object.entries(Y[de]).forEach(([pe,Re])=>{const nt=he[pe]||1;z[de][pe]=Re/nt*100})})}else Object.entries(U).forEach(([he,de])=>{const pe=de||1;I[he]=de/pe*100});if(e!=null&&e.sortField&&(e!=null&&e.sortOrder)){const de=ae(l,e.sortField,e.sortOrder).map(pe=>ee({item:pe,field:W}));G.clear(),de.forEach(pe=>G.add(pe))}const K=Array.from(G),Z=Array.from(Q),ce=Lie(e.type,K),se=[];if(e!=null&&e.isGroup&&(e!=null&&e.groupField))Z.forEach(he=>{const de=e.type==="chart-bar-percentage"||e.type==="chart-strip-bar-percentage"?K.map(pe=>{var Re;return((Re=z[he][pe])==null?void 0:Re.toFixed(2))||0}):K.map(pe=>Y[he][pe]||0);se.push(nN({type:e.type,data:de,label:j,name:he,isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:K}))});else{const he=e.type==="chart-bar-percentage"||e.type==="chart-strip-bar-percentage"?K.map(de=>{var pe;return((pe=I[de])==null?void 0:pe.toFixed(2))||0}):K.map(de=>U[de]||0);se.push(nN({type:e.type,data:he,label:j,name:e.yAxis==="recordTotal"?H1("pb.statisticsText"):J(e==null?void 0:e.yAxisField),isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:K}))}const Ce=kie({series:se,chartConfig:ce,width:n}),_e={legend:{left:"center",right:"center",top:"0",show:q,itemWidth:12,itemHeight:12,data:(se==null?void 0:se.map(he=>(he==null?void 0:he.name)||""))||[]},grid:{top:Ce.top,left:Ce.left,right:Ce.right,bottom:Ce.bottom},graphic:{elements:[{type:"text",left:"center",bottom:"10px",style:{text:(r==null?void 0:r.xtitle)||"",fill:"#333",fontSize:12,fontWeight:"bold"}},{type:"text",left:"10px",top:"center",style:{text:(r==null?void 0:r.ytitle)||"",fill:"#333",fontSize:12,fontWeight:"bold"},rotation:Math.PI/2}]},xAxis:{...ce.xAxis,axisTick:{show:(C=e==null?void 0:e.chartOptions)==null?void 0:C.includes("axis")},axisLine:{show:((_=e==null?void 0:e.chartOptions)==null?void 0:_.includes("axis"))||((w=r==null?void 0:r.xchartOptions)==null?void 0:w.includes("axisLine"))},axisLabel:{show:((x=e==null?void 0:e.chartOptions)==null?void 0:x.includes("label"))||((D=r==null?void 0:r.xchartOptions)==null?void 0:D.includes("label")),rotate:Ce.axisLabelRotate,interval:0,formatter:he=>he.length>15?`${he.slice(0,15)}...`:he,...(S=ce.xAxis)==null?void 0:S.axisLabel},splitLine:{show:(T=e==null?void 0:e.chartOptions)==null?void 0:T.includes("splitLine")}},yAxis:{...ce.yAxis,axisTick:{show:(E=e==null?void 0:e.chartOptions)==null?void 0:E.includes("axis")},axisLine:{show:((R=e==null?void 0:e.chartOptions)==null?void 0:R.includes("axis"))||((M=r==null?void 0:r.ychartOptions)==null?void 0:M.includes("axisLine"))},axisLabel:{show:((P=e==null?void 0:e.chartOptions)==null?void 0:P.includes("label"))||((B=r==null?void 0:r.ychartOptions)==null?void 0:B.includes("label")),formatter:he=>he.length>15?`${he.slice(0,15)}...`:he,...(F=ce.yAxis)==null?void 0:F.axisLabel},splitLine:{show:(H=e==null?void 0:e.chartOptions)==null?void 0:H.includes("splitLine")}},series:se,tooltip:{trigger:"item",axisPointer:{type:"shadow"}}};h(_e)}else h({})},[e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.type,e==null?void 0:e.chartOptions,r,l,n,i,o]);return N.useEffect(()=>{p()},[e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.type,e==null?void 0:e.chartOptions,r,l,n,i,o]),N.useEffect(()=>{var m;a!=null&&a.sourceData&&(e!=null&&e.dataSourceId)&&s((m=a==null?void 0:a.sourceData.find(y=>y.value===(e==null?void 0:e.dataSourceId)))==null?void 0:m.fields)},[a,e==null?void 0:e.dataSourceId]),N.useEffect(()=>{(n||i)&&setTimeout(()=>{var m;(m=v==null?void 0:v.current)==null||m.resize()},300)},[n,i]),A.jsx("div",{style:{width:"100%",height:"100%"},children:!f&&d?A.jsx(hie,{echartRef:v,options:d}):A.jsx(X.Spin,{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},spinning:f})})},iN=N.memo(jie);var aN=typeof global=="object"&&global&&global.Object===Object&&global,zie=typeof self=="object"&&self&&self.Object===Object&&self,li=aN||zie||Function("return this")(),El=li.Symbol,oN=Object.prototype,Hie=oN.hasOwnProperty,Vie=oN.toString,Rf=El?El.toStringTag:void 0;function Wie(t){var e=Hie.call(t,Rf),r=t[Rf];try{t[Rf]=void 0;var n=!0}catch{}var i=Vie.call(t);return n&&(e?t[Rf]=r:delete t[Rf]),i}var $ie=Object.prototype,Gie=$ie.toString;function Uie(t){return Gie.call(t)}var qie="[object Null]",Yie="[object Undefined]",sN=El?El.toStringTag:void 0;function Al(t){return t==null?t===void 0?Yie:qie:sN&&sN in Object(t)?Wie(t):Uie(t)}function Tl(t){return t!=null&&typeof t=="object"}var Xie="[object Symbol]";function Zie(t){return typeof t=="symbol"||Tl(t)&&Al(t)==Xie}var kv=Array.isArray,Kie=/\s/;function Qie(t){for(var e=t.length;e--&&Kie.test(t.charAt(e)););return e}var Jie=/^\s+/;function eae(t){return t&&t.slice(0,Qie(t)+1).replace(Jie,"")}function Mf(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var lN=NaN,tae=/^[-+]0x[0-9a-f]+$/i,rae=/^0b[01]+$/i,nae=/^0o[0-7]+$/i,iae=parseInt;function uN(t){if(typeof t=="number")return t;if(Zie(t))return lN;if(Mf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Mf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=eae(t);var r=rae.test(t);return r||nae.test(t)?iae(t.slice(2),r?2:8):tae.test(t)?lN:+t}var aae="[object AsyncFunction]",oae="[object Function]",sae="[object GeneratorFunction]",lae="[object Proxy]";function fN(t){if(!Mf(t))return!1;var e=Al(t);return e==oae||e==sae||e==aae||e==lae}var V1=li["__core-js_shared__"],cN=function(){var t=/[^.]+$/.exec(V1&&V1.keys&&V1.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function uae(t){return!!cN&&cN in t}var fae=Function.prototype,cae=fae.toString;function Ko(t){if(t!=null){try{return cae.call(t)}catch{}try{return t+""}catch{}}return""}var dae=/[\\^$.*+?()[\]{}|]/g,hae=/^\[object .+?Constructor\]$/,vae=Function.prototype,pae=Object.prototype,gae=vae.toString,mae=pae.hasOwnProperty,yae=RegExp("^"+gae.call(mae).replace(dae,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function bae(t){if(!Mf(t)||uae(t))return!1;var e=fN(t)?yae:hae;return e.test(Ko(t))}function _ae(t,e){return t==null?void 0:t[e]}function Ol(t,e){var r=_ae(t,e);return bae(r)?r:void 0}var W1=Ol(li,"WeakMap"),Cae=9007199254740991,wae=/^(?:0|[1-9]\d*)$/;function xae(t,e){var r=typeof t;return e=e??Cae,!!e&&(r=="number"||r!="symbol"&&wae.test(t))&&t>-1&&t%1==0&&t<e}function dN(t,e){return t===e||t!==t&&e!==e}var Dae=9007199254740991;function hN(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Dae}function Sae(t){return t!=null&&hN(t.length)&&!fN(t)}var Eae=Object.prototype;function Aae(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Eae;return t===r}function Tae(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Oae="[object Arguments]";function vN(t){return Tl(t)&&Al(t)==Oae}var pN=Object.prototype,Rae=pN.hasOwnProperty,Mae=pN.propertyIsEnumerable,Pae=vN(function(){return arguments}())?vN:function(t){return Tl(t)&&Rae.call(t,"callee")&&!Mae.call(t,"callee")};function Bae(){return!1}var gN=typeof Yt=="object"&&Yt&&!Yt.nodeType&&Yt,mN=gN&&typeof module=="object"&&module&&!module.nodeType&&module,Iae=mN&&mN.exports===gN,yN=Iae?li.Buffer:void 0,Nae=yN?yN.isBuffer:void 0,$1=Nae||Bae,Fae="[object Arguments]",Lae="[object Array]",kae="[object Boolean]",jae="[object Date]",zae="[object Error]",Hae="[object Function]",Vae="[object Map]",Wae="[object Number]",$ae="[object Object]",Gae="[object RegExp]",Uae="[object Set]",qae="[object String]",Yae="[object WeakMap]",Xae="[object ArrayBuffer]",Zae="[object DataView]",Kae="[object Float32Array]",Qae="[object Float64Array]",Jae="[object Int8Array]",eoe="[object Int16Array]",toe="[object Int32Array]",roe="[object Uint8Array]",noe="[object Uint8ClampedArray]",ioe="[object Uint16Array]",aoe="[object Uint32Array]",_t={};_t[Kae]=_t[Qae]=_t[Jae]=_t[eoe]=_t[toe]=_t[roe]=_t[noe]=_t[ioe]=_t[aoe]=!0,_t[Fae]=_t[Lae]=_t[Xae]=_t[kae]=_t[Zae]=_t[jae]=_t[zae]=_t[Hae]=_t[Vae]=_t[Wae]=_t[$ae]=_t[Gae]=_t[Uae]=_t[qae]=_t[Yae]=!1;function ooe(t){return Tl(t)&&hN(t.length)&&!!_t[Al(t)]}function soe(t){return function(e){return t(e)}}var bN=typeof Yt=="object"&&Yt&&!Yt.nodeType&&Yt,Pf=bN&&typeof module=="object"&&module&&!module.nodeType&&module,loe=Pf&&Pf.exports===bN,G1=loe&&aN.process,_N=function(){try{var t=Pf&&Pf.require&&Pf.require("util").types;return t||G1&&G1.binding&&G1.binding("util")}catch{}}(),CN=_N&&_N.isTypedArray,wN=CN?soe(CN):ooe,uoe=Object.prototype,foe=uoe.hasOwnProperty;function coe(t,e){var r=kv(t),n=!r&&Pae(t),i=!r&&!n&&$1(t),a=!r&&!n&&!i&&wN(t),o=r||n||i||a,s=o?Tae(t.length,String):[],l=s.length;for(var u in t)foe.call(t,u)&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||xae(u,l)))&&s.push(u);return s}function doe(t,e){return function(r){return t(e(r))}}var hoe=doe(Object.keys,Object),voe=Object.prototype,poe=voe.hasOwnProperty;function goe(t){if(!Aae(t))return hoe(t);var e=[];for(var r in Object(t))poe.call(t,r)&&r!="constructor"&&e.push(r);return e}function moe(t){return Sae(t)?coe(t):goe(t)}var Bf=Ol(Object,"create");function yoe(){this.__data__=Bf?Bf(null):{},this.size=0}function boe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var _oe="__lodash_hash_undefined__",Coe=Object.prototype,woe=Coe.hasOwnProperty;function xoe(t){var e=this.__data__;if(Bf){var r=e[t];return r===_oe?void 0:r}return woe.call(e,t)?e[t]:void 0}var Doe=Object.prototype,Soe=Doe.hasOwnProperty;function Eoe(t){var e=this.__data__;return Bf?e[t]!==void 0:Soe.call(e,t)}var Aoe="__lodash_hash_undefined__";function Toe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Bf&&e===void 0?Aoe:e,this}function Qo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Qo.prototype.clear=yoe,Qo.prototype.delete=boe,Qo.prototype.get=xoe,Qo.prototype.has=Eoe,Qo.prototype.set=Toe;function Ooe(){this.__data__=[],this.size=0}function jv(t,e){for(var r=t.length;r--;)if(dN(t[r][0],e))return r;return-1}var Roe=Array.prototype,Moe=Roe.splice;function Poe(t){var e=this.__data__,r=jv(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Moe.call(e,r,1),--this.size,!0}function Boe(t){var e=this.__data__,r=jv(e,t);return r<0?void 0:e[r][1]}function Ioe(t){return jv(this.__data__,t)>-1}function Noe(t,e){var r=this.__data__,n=jv(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Li(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Li.prototype.clear=Ooe,Li.prototype.delete=Poe,Li.prototype.get=Boe,Li.prototype.has=Ioe,Li.prototype.set=Noe;var If=Ol(li,"Map");function Foe(){this.size=0,this.__data__={hash:new Qo,map:new(If||Li),string:new Qo}}function Loe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function zv(t,e){var r=t.__data__;return Loe(e)?r[typeof e=="string"?"string":"hash"]:r.map}function koe(t){var e=zv(this,t).delete(t);return this.size-=e?1:0,e}function joe(t){return zv(this,t).get(t)}function zoe(t){return zv(this,t).has(t)}function Hoe(t,e){var r=zv(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Jo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Jo.prototype.clear=Foe,Jo.prototype.delete=koe,Jo.prototype.get=joe,Jo.prototype.has=zoe,Jo.prototype.set=Hoe;function Voe(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function Woe(){this.__data__=new Li,this.size=0}function $oe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Goe(t){return this.__data__.get(t)}function Uoe(t){return this.__data__.has(t)}var qoe=200;function Yoe(t,e){var r=this.__data__;if(r instanceof Li){var n=r.__data__;if(!If||n.length<qoe-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Jo(n)}return r.set(t,e),this.size=r.size,this}function Ea(t){var e=this.__data__=new Li(t);this.size=e.size}Ea.prototype.clear=Woe,Ea.prototype.delete=$oe,Ea.prototype.get=Goe,Ea.prototype.has=Uoe,Ea.prototype.set=Yoe;function Xoe(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var o=t[r];e(o,r,t)&&(a[i++]=o)}return a}function Zoe(){return[]}var Koe=Object.prototype,Qoe=Koe.propertyIsEnumerable,xN=Object.getOwnPropertySymbols,Joe=xN?function(t){return t==null?[]:(t=Object(t),Xoe(xN(t),function(e){return Qoe.call(t,e)}))}:Zoe;function ese(t,e,r){var n=e(t);return kv(t)?n:Voe(n,r(t))}function DN(t){return ese(t,moe,Joe)}var U1=Ol(li,"DataView"),q1=Ol(li,"Promise"),Y1=Ol(li,"Set"),SN="[object Map]",tse="[object Object]",EN="[object Promise]",AN="[object Set]",TN="[object WeakMap]",ON="[object DataView]",rse=Ko(U1),nse=Ko(If),ise=Ko(q1),ase=Ko(Y1),ose=Ko(W1),Aa=Al;(U1&&Aa(new U1(new ArrayBuffer(1)))!=ON||If&&Aa(new If)!=SN||q1&&Aa(q1.resolve())!=EN||Y1&&Aa(new Y1)!=AN||W1&&Aa(new W1)!=TN)&&(Aa=function(t){var e=Al(t),r=e==tse?t.constructor:void 0,n=r?Ko(r):"";if(n)switch(n){case rse:return ON;case nse:return SN;case ise:return EN;case ase:return AN;case ose:return TN}return e});var RN=li.Uint8Array,sse="__lodash_hash_undefined__";function lse(t){return this.__data__.set(t,sse),this}function use(t){return this.__data__.has(t)}function Hv(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Jo;++e<r;)this.add(t[e])}Hv.prototype.add=Hv.prototype.push=lse,Hv.prototype.has=use;function fse(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function cse(t,e){return t.has(e)}var dse=1,hse=2;function MN(t,e,r,n,i,a){var o=r&dse,s=t.length,l=e.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(t),f=a.get(e);if(u&&f)return u==e&&f==t;var c=-1,d=!0,h=r&hse?new Hv:void 0;for(a.set(t,e),a.set(e,t);++c<s;){var v=t[c],g=e[c];if(n)var p=o?n(g,v,c,e,t,a):n(v,g,c,t,e,a);if(p!==void 0){if(p)continue;d=!1;break}if(h){if(!fse(e,function(m,y){if(!cse(h,y)&&(v===m||i(v,m,r,n,a)))return h.push(y)})){d=!1;break}}else if(!(v===g||i(v,g,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function vse(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function pse(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var gse=1,mse=2,yse="[object Boolean]",bse="[object Date]",_se="[object Error]",Cse="[object Map]",wse="[object Number]",xse="[object RegExp]",Dse="[object Set]",Sse="[object String]",Ese="[object Symbol]",Ase="[object ArrayBuffer]",Tse="[object DataView]",PN=El?El.prototype:void 0,X1=PN?PN.valueOf:void 0;function Ose(t,e,r,n,i,a,o){switch(r){case Tse:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ase:return!(t.byteLength!=e.byteLength||!a(new RN(t),new RN(e)));case yse:case bse:case wse:return dN(+t,+e);case _se:return t.name==e.name&&t.message==e.message;case xse:case Sse:return t==e+"";case Cse:var s=vse;case Dse:var l=n&gse;if(s||(s=pse),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;n|=mse,o.set(t,e);var f=MN(s(t),s(e),n,i,a,o);return o.delete(t),f;case Ese:if(X1)return X1.call(t)==X1.call(e)}return!1}var Rse=1,Mse=Object.prototype,Pse=Mse.hasOwnProperty;function Bse(t,e,r,n,i,a){var o=r&Rse,s=DN(t),l=s.length,u=DN(e),f=u.length;if(l!=f&&!o)return!1;for(var c=l;c--;){var d=s[c];if(!(o?d in e:Pse.call(e,d)))return!1}var h=a.get(t),v=a.get(e);if(h&&v)return h==e&&v==t;var g=!0;a.set(t,e),a.set(e,t);for(var p=o;++c<l;){d=s[c];var m=t[d],y=e[d];if(n)var b=o?n(y,m,d,e,t,a):n(m,y,d,t,e,a);if(!(b===void 0?m===y||i(m,y,r,n,a):b)){g=!1;break}p||(p=d=="constructor")}if(g&&!p){var C=t.constructor,_=e.constructor;C!=_&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof _=="function"&&_ instanceof _)&&(g=!1)}return a.delete(t),a.delete(e),g}var Ise=1,BN="[object Arguments]",IN="[object Array]",Vv="[object Object]",Nse=Object.prototype,NN=Nse.hasOwnProperty;function Fse(t,e,r,n,i,a){var o=kv(t),s=kv(e),l=o?IN:Aa(t),u=s?IN:Aa(e);l=l==BN?Vv:l,u=u==BN?Vv:u;var f=l==Vv,c=u==Vv,d=l==u;if(d&&$1(t)){if(!$1(e))return!1;o=!0,f=!1}if(d&&!f)return a||(a=new Ea),o||wN(t)?MN(t,e,r,n,i,a):Ose(t,e,l,r,n,i,a);if(!(r&Ise)){var h=f&&NN.call(t,"__wrapped__"),v=c&&NN.call(e,"__wrapped__");if(h||v){var g=h?t.value():t,p=v?e.value():e;return a||(a=new Ea),i(g,p,r,n,a)}}return d?(a||(a=new Ea),Bse(t,e,r,n,i,a)):!1}function FN(t,e,r,n,i){return t===e?!0:t==null||e==null||!Tl(t)&&!Tl(e)?t!==t&&e!==e:Fse(t,e,r,n,FN,i)}var Z1=function(){return li.Date.now()},Lse="Expected a function",kse=Math.max,jse=Math.min;function zse(t,e,r){var n,i,a,o,s,l,u=0,f=!1,c=!1,d=!0;if(typeof t!="function")throw new TypeError(Lse);e=uN(e)||0,Mf(r)&&(f=!!r.leading,c="maxWait"in r,a=c?kse(uN(r.maxWait)||0,e):a,d="trailing"in r?!!r.trailing:d);function h(w){var x=n,D=i;return n=i=void 0,u=w,o=t.apply(D,x),o}function v(w){return u=w,s=setTimeout(m,e),f?h(w):o}function g(w){var x=w-l,D=w-u,S=e-x;return c?jse(S,a-D):S}function p(w){var x=w-l,D=w-u;return l===void 0||x>=e||x<0||c&&D>=a}function m(){var w=Z1();if(p(w))return y(w);s=setTimeout(m,g(w))}function y(w){return s=void 0,d&&n?h(w):(n=i=void 0,o)}function b(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function C(){return s===void 0?o:y(Z1())}function _(){var w=Z1(),x=p(w);if(n=arguments,i=this,l=w,x){if(s===void 0)return v(l);if(c)return clearTimeout(s),s=setTimeout(m,e),h(l)}return s===void 0&&(s=setTimeout(m,e)),o}return _.cancel=b,_.flush=C,_}function Hse(t,e){return FN(t,e)}function Vse(t,e){return Hse(t.module,e.module)}const Wse=N.memo(({module:t,onUpdate:e,moduleDataApi:r,rowWidth:n,rowHeight:i})=>{var a,o;return A.jsx("div",{className:"chart-content isNoCanDrag",style:{overflow:(a=t.type)!=null&&a.includes("chart")?"inherit":"hidden"},children:A.jsxs("div",{className:"dashboard-grid-container",children:[t.type==="text"?A.jsx(h9,{defaultValue:t.customData.editor,onChange:s=>{t.id&&e(t.id,{type:"text",customData:{title:t.customData.title,editor:s}})}}):null,t.type==="statistics"?A.jsx(HD,{customData:t.customData,customeStyle:t.customeStyle,moduleDataApi:r,width:t.w,height:t.h,rowWidth:n,rowHeight:i}):null,t.type==="calendar"?A.jsx(gA,{customData:t.customData,moduleDataApi:r,width:t.w,height:t.h,rowWidth:n,rowHeight:i}):null,(o=t.type)!=null&&o.includes("chart")?A.jsx(iN,{width:t.w,height:t.h,customData:t.customData,customeStyle:t.customeStyle,moduleDataApi:r}):null]})})},Vse),LN=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"17",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"28",y:"24",width:"6",height:"16",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"39",y:"8",width:"6",height:"32",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"50",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"})]}),kN=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("path",{d:"M17 33.5L29.5 15L45 23L58 10",stroke:"#959bee",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),A.jsx("path",{d:"M16.5 15L30 31.5L45 28L57 33.5",stroke:"#5b65f4",strokeWidth:"1.5",strokeLinecap:"round"})]}),jN=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("circle",{cx:"16",cy:"16",r:"16",transform:"matrix(-1 0 0 1 52 8)",fill:"#5b65f4"}),A.jsx("path",{d:"M36 8.5C36 8.22386 36.224 7.99918 36.5 8.00781C40.5621 8.13468 44.4312 9.80377 47.3137 12.6863C50.3143 15.6869 52 19.7565 52 24C52 28.2435 50.3143 32.3131 47.3137 35.3137C44.4312 38.1962 40.5621 39.8653 36.5 39.9922C36.224 40.0008 36 39.7761 36 39.5L36 24V8.5Z",fill:"#959bee"}),A.jsx("path",{d:"M46.9602 34.9602C47.1554 35.1554 47.1559 35.4726 46.9547 35.6617C45.5468 36.9842 43.91 38.0418 42.1229 38.7821C40.3358 39.5223 38.4306 39.9318 36.4999 39.9922C36.2239 40.0008 36 39.7761 36 39.5L36 25.2071C36 24.7617 36.5386 24.5386 36.8536 24.8536L46.9602 34.9602Z",fill:"#cdcff9"})]}),zN=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"31",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 31 11)",fill:"#5b65f5"}),A.jsx("rect",{x:"44",y:"18",width:"4",height:"28",rx:"0.5",transform:"rotate(90 44 18)",fill:"#5b65f5"}),A.jsx("rect",{x:"56",y:"25",width:"4",height:"40",rx:"0.5",transform:"rotate(90 56 25)",fill:"#5b65f5"}),A.jsx("rect",{x:"36",y:"32",width:"4",height:"20",rx:"0.5",transform:"rotate(90 36 32)",fill:"#5b65f5"})]}),$se=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("path",{d:"M59.3348 27.8581C59.3348 28.6621 59.0708 29.2801 58.5428 29.7121C58.0268 30.1441 57.3848 30.3601 56.6168 30.3601C55.8488 30.3601 55.2008 30.1441 54.6728 29.7121C54.1568 29.2801 53.8988 28.6621 53.8988 27.8581V26.1481C53.8988 25.3441 54.1568 24.7261 54.6728 24.2941C55.2008 23.8621 55.8488 23.6461 56.6168 23.6461C57.3848 23.6461 58.0268 23.8621 58.5428 24.2941C59.0708 24.7261 59.3348 25.3441 59.3348 26.1481V27.8581ZM50.9648 21.5401C50.9648 22.3441 50.7008 22.9621 50.1728 23.3941C49.6568 23.8261 49.0148 24.0421 48.2468 24.0421C47.4788 24.0421 46.8308 23.8261 46.3028 23.3941C45.7868 22.9621 45.5288 22.3441 45.5288 21.5401V19.8301C45.5288 19.0261 45.7868 18.4081 46.3028 17.9761C46.8308 17.5441 47.4788 17.3281 48.2468 17.3281C49.0148 17.3281 49.6568 17.5441 50.1728 17.9761C50.7008 18.4081 50.9648 19.0261 50.9648 19.8301V21.5401ZM56.6168 17.4361L50.5148 30.2521H48.2468L54.3488 17.4361H56.6168ZM48.8768 21.4681V19.9021C48.8768 19.4341 48.6668 19.2001 48.2468 19.2001C47.8268 19.2001 47.6168 19.4341 47.6168 19.9021V21.4681C47.6168 21.9361 47.8268 22.1701 48.2468 22.1701C48.6668 22.1701 48.8768 21.9361 48.8768 21.4681ZM57.2468 27.7861V26.2201C57.2468 25.7521 57.0368 25.5181 56.6168 25.5181C56.1968 25.5181 55.9868 25.7521 55.9868 26.2201V27.7861C55.9868 28.2541 56.1968 28.4881 56.6168 28.4881C57.0368 28.4881 57.2468 28.2541 57.2468 27.7861Z",fill:"#5b65f4"}),A.jsx("path",{d:"M44.0049 26.4181C44.0049 27.6901 43.5969 28.6681 42.7809 29.3521C41.9649 30.0241 40.9509 30.3601 39.7389 30.3601C38.9829 30.3601 38.2929 30.2341 37.6689 29.9821C37.0569 29.7181 36.5349 29.2741 36.1029 28.6501C35.6829 28.0261 35.4729 27.2581 35.4729 26.3461H38.4249C38.4249 26.7781 38.5449 27.1141 38.7849 27.3541C39.0369 27.5821 39.3549 27.6961 39.7389 27.6961C40.1349 27.6961 40.4529 27.5821 40.6929 27.3541C40.9329 27.1141 41.0529 26.7721 41.0529 26.3281C41.0529 25.9441 40.9209 25.6261 40.6569 25.3741C40.4049 25.1101 40.0809 24.9781 39.6849 24.9781H39.2709V22.4221H39.6849C40.0929 22.4221 40.3989 22.3021 40.6029 22.0621C40.8069 21.8221 40.9089 21.5401 40.9089 21.2161C40.9089 20.8321 40.7949 20.5321 40.5669 20.3161C40.3389 20.1001 40.0629 19.9921 39.7389 19.9921C39.4149 19.9921 39.1389 20.1001 38.9109 20.3161C38.6829 20.5321 38.5689 20.8261 38.5689 21.1981H35.6169C35.6169 20.0221 36.0069 19.0861 36.7869 18.3901C37.5789 17.6821 38.5629 17.3281 39.7389 17.3281C40.9269 17.3281 41.9109 17.6881 42.6909 18.4081C43.4709 19.1161 43.8609 20.0221 43.8609 21.1261C43.8609 22.2301 43.4169 23.0641 42.5289 23.6281C43.5129 24.3121 44.0049 25.2421 44.0049 26.4181Z",fill:"#5b65f4"}),A.jsx("path",{d:"M33.9128 30.2521H25.6688V27.5881L30.3128 22.5481C30.7448 22.0801 30.9608 21.6241 30.9608 21.1801C30.9608 20.8201 30.8588 20.5321 30.6548 20.3161C30.4628 20.1001 30.1808 19.9921 29.8088 19.9921C29.4848 19.9921 29.2028 20.0881 28.9628 20.2801C28.7348 20.4721 28.6208 20.7901 28.6208 21.2341H25.6688C25.6688 20.0221 26.0648 19.0681 26.8568 18.3721C27.6608 17.6761 28.6448 17.3281 29.8088 17.3281C31.0208 17.3281 32.0048 17.6761 32.7608 18.3721C33.5288 19.0681 33.9128 20.0101 33.9128 21.1981C33.9128 21.8221 33.7928 22.3501 33.5528 22.7821C33.3128 23.2141 32.9048 23.7361 32.3288 24.3481L29.2688 27.5881H33.9128V30.2521Z",fill:"#5b65f4"}),A.jsx("path",{d:"M22.021 30.2525H19.069V20.5865L16.333 22.9625V19.8125L19.069 17.4365H22.021V30.2525Z",fill:"#5b65f4"})]}),Gse=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"58",y:"25",width:"4",height:"44",rx:"0.5",transform:"rotate(90 58 25)",fill:"#5b65f4"}),A.jsx("rect",{x:"29.5",y:"33",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 29.5 33)",fill:"#959bee"}),A.jsx("path",{d:"M14.584 19L17.085 12.2832H18.8377L21.3008 19H19.7566L19.264 17.5695H16.5829L16.0808 19H14.584ZM17.0377 16.2716H18.8093L17.9282 13.7232L17.0377 16.2716ZM22.1459 19V12.2832H24.609C25.9259 12.2832 26.6933 13.0505 26.6933 14.0832C26.6933 14.7842 26.2575 15.3432 25.708 15.5232C26.3333 15.6747 26.9017 16.2432 26.9017 17.1053C26.9017 18.2042 26.068 19 24.808 19H22.1459ZM23.529 15.0116H24.3911C24.9406 15.0116 25.3006 14.7084 25.3006 14.2347C25.3006 13.7705 24.9785 13.4674 24.3722 13.4674H23.529V15.0116ZM23.529 17.8347H24.5143C25.1206 17.8347 25.4901 17.5126 25.4901 17.0105C25.4901 16.5179 25.1396 16.1768 24.5238 16.1768H23.529V17.8347ZM31.0425 19.1421C29.1383 19.1421 27.5751 17.7684 27.5751 15.6558C27.5751 13.5432 29.1762 12.1411 31.0236 12.1411C32.9751 12.1411 33.8941 13.3726 34.1309 14.3863L32.7951 14.8126C32.672 14.2726 32.1983 13.5147 31.0236 13.5147C30.0857 13.5147 29.0436 14.1968 29.0436 15.6558C29.0436 16.9821 30.0099 17.7305 31.0425 17.7305C32.2078 17.7305 32.7004 16.9726 32.8615 16.4232L34.2067 16.8211C33.9699 17.7968 33.0509 19.1421 31.0425 19.1421Z",fill:"#5b65f4"})]}),Use=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{width:"26",height:"19",rx:"1",transform:"matrix(1 0 0 -1 23 36.5)",fill:"#E9EAFB"}),A.jsx("rect",{width:"26",height:"3",rx:"1",transform:"matrix(1 0 0 -1 23 14.5)",fill:"#5b65f4"}),A.jsx("rect",{width:"11",height:"3",rx:"0.5",transform:"matrix(1 0 0 -1 27 25.5)",fill:"#5b65f4"}),A.jsx("rect",{width:"11",height:"3",rx:"0.5",transform:"matrix(1 0 0 -1 34 31.5)",fill:"#959bee"})]}),qse=({onOk:t})=>{const{t:e}=Er(),r=[{title:e("add.add1"),child:[{title:e("add.add2"),type:"chart-bar",icon:A.jsx(LN,{})},{title:e("add.add3"),type:"chart-line",icon:A.jsx(kN,{})},{title:e("add.add4"),type:"chart-pie",icon:A.jsx(jN,{})},{title:e("add.add5"),type:"chart-strip-bar",icon:A.jsx(zN,{})}]},{title:e("add.add6"),child:[{title:e("add.add7"),type:"statistics",icon:A.jsx($se,{})},{title:e("add.add8"),type:"text",icon:A.jsx(Gse,{})},{title:e("add.add9"),type:"calendar",icon:A.jsx(Use,{})}]}],[n,i]=N.useState(!1),a=o=>{i(!1),t==null||t(o)};return A.jsx(A.Fragment,{children:A.jsx(X.Popover,{placement:"bottomRight",open:n,onOpenChange:i,content:A.jsx("div",{className:"pivot-table-modal box-widget-popover-item-container",children:r.map((o,s)=>A.jsxs("div",{className:"box-widget-popover-item-group",children:[A.jsx("p",{className:"box-widget-popover-item-group-header",children:o.title}),A.jsx("div",{className:"box-widget-popover-item-group-content",children:o.child.map((l,u)=>A.jsxs("div",{onClick:()=>{a(l.type)},className:"box-widget-popover-item",children:[A.jsx("div",{className:"img",children:l.icon}),A.jsx("div",{className:"title",children:l.title})]},u))})]},s))}),trigger:"click",children:A.jsx(X.Button,{children:e("add.add10")})})})},Yse=[{label:Ae.t("add.add13"),value:"="},{label:Ae.t("add.add14"),value:"<"},{label:Ae.t("add.add15"),value:">"},{label:Ae.t("add.add16"),value:"contain"},{label:Ae.t("add.add17"),value:"null"},{label:Ae.t("add.add18"),value:"notnull"}],Xse=[{label:Ae.t("add.add13"),value:"="}],HN=[{label:Ae.t("add.add13"),value:"="},{label:Ae.t("add.add19"),value:"!="},{label:Ae.t("add.add20"),value:">"},{label:Ae.t("add.add21"),value:">="},{label:Ae.t("add.add22"),value:"<"},{label:Ae.t("add.add23"),value:"=<"},{label:Ae.t("add.add16"),value:"contain"},{label:Ae.t("add.add17"),value:"null"},{label:Ae.t("add.add18"),value:"notnull"}],VN=[{label:Ae.t("add.add13"),value:"="},{label:Ae.t("add.add19"),value:"!="},{label:Ae.t("add.add24"),value:"include"},{label:Ae.t("add.add25"),value:"notinclude"},{label:Ae.t("add.add17"),value:"null"},{label:Ae.t("add.add18"),value:"notnull"}],Zse=[{label:Ae.t("add.add26"),value:"exactdate"},{label:Ae.t("add.add27"),value:"today"},{label:Ae.t("add.add28"),value:"yesterday"},{label:Ae.t("add.add29"),value:"thisweek"},{label:Ae.t("add.add30"),value:"lastweek"},{label:Ae.t("add.add31"),value:"thismonth"},{label:Ae.t("add.add32"),value:"lastmonth"},{label:Ae.t("add.add33"),value:"last7days"},{label:Ae.t("add.add34"),value:"last30days"}],Kse=[{label:Ae.t("add.add26"),value:"exactdate"},{label:Ae.t("add.add27"),value:"today"},{label:Ae.t("add.add28"),value:"yesterday"}],Qse={int:HN,timestamp:Yse,string:VN,bool:Xse,float:HN,enum:VN};function Jse({fetchOptions:t,debounceTimeout:e=800,...r}){const[n,i]=N.useState(!1),[a,o]=N.useState([]),s=N.useRef(0),l=N.useMemo(()=>zse(f=>{s.current+=1;const c=s.current;o([]),i(!0),t(f).then(d=>{c===s.current&&(o(d),i(!1))})},e),[t,e]);return N.useEffect(()=>{l("")},[]),A.jsx(X.Select,{labelInValue:!0,showSearch:!0,filterOption:!1,onSearch:l,notFoundContent:n?A.jsx(X.Spin,{size:"small"}):null,...r,options:a})}const K1=({open:t,onClose:e,onOk:r,fieldOptions:n,value:i,enumDataApi:a})=>{const[o]=X.Form.useForm(),s=N.useRef(),{t:l}=Er(),{globalData:u}=lo(),f=N.useCallback(()=>{if(i!=null&&i.conditionList){const c=JSON.parse(JSON.stringify(i==null?void 0:i.conditionList));o.setFieldsValue({conditionList:c.map(d=>(d.type==="timestamp"&&(d.val&&(d.val=Cn(new Date(d.val))),d.val2&&(d.val2=Cn(new Date(d.val2)))),(d.val===void 0||d.val==="")&&(d.val=""),(d.val2===void 0||d.val2==="")&&(d.val2=""),d)),conditionType:i.conditionType})}else o.setFieldsValue({conditionList:[],conditionType:"all"})},[i]);return N.useEffect(()=>{f()},[i]),A.jsx(A.Fragment,{children:A.jsx(X.Modal,{title:l("setFilteringCriteria"),open:t,destroyOnClose:!0,width:"650px",onOk:()=>{const c=o.getFieldsValue(),d=c.conditionList?JSON.parse(JSON.stringify(c.conditionList)):"",h=c.conditionType||"all",v={conditionList:d.map(g=>(g.type==="timestamp"&&(g.val&&(g.val=Cn(g.val).format("YYYY-MM-DD")),g.val2&&(g.val2=g.val2?Cn(g.val2).format("YYYY-MM-DD"):"")),g)),conditionType:h};s.current=v,e==null||e(),r==null||r(v)},onCancel:()=>{f(),e==null||e(),o.setFieldsValue(s.current)},children:A.jsxs(X.Form,{name:"dynamicForm",form:o,initialValues:{conditionType:"all"},style:{maxWidth:650,marginTop:"30px"},children:[A.jsx(X.Form.Item,{noStyle:!0,dependencies:["conditionList"],children:({getFieldValue:c})=>{var d;return((d=c("conditionList"))==null?void 0:d.length)>1?A.jsxs(X.Flex,{align:"center",gap:5,style:{marginBottom:"20px"},children:[l("conformTo"),A.jsx(X.Form.Item,{name:"conditionType",noStyle:!0,children:A.jsx(X.Select,{style:{width:"150px"},options:[{label:l("all"),value:"all"},{label:l("everyone"),value:"any"}]})})," ",l("condition")]}):null}}),A.jsx(X.Form.List,{name:"conditionList",children:(c,{add:d,remove:h})=>A.jsxs(A.Fragment,{children:[c.map(({key:v,name:g,...p})=>A.jsxs(X.Space,{style:{display:"flex",marginBottom:8},align:"baseline",children:[A.jsx(X.Form.Item,{...p,name:[g,"field"],noStyle:!0,children:A.jsx(X.Select,{style:{width:"150px"},options:n||[],onChange:m=>{const y=o.getFieldValue("conditionList"),b=n==null?void 0:n.find(C=>C.value===m);y[g].condition="=",y[g].type=b==null?void 0:b.type,y[g].val="",y[g].val2="",(b==null?void 0:b.type)==="timestamp"&&(y[g].rdate="exactdate"),o.setFieldsValue({conditionList:y})}})}),A.jsx(X.Form.Item,{noStyle:!0,dependencies:[["conditionList",g,"field"]],children:({getFieldValue:m})=>{var b;const y=(b=n==null?void 0:n.find(C=>C.value===m(["conditionList",g,"field"])))==null?void 0:b.type;return A.jsx(A.Fragment,{children:A.jsx(X.Form.Item,{...p,name:[g,"condition"],noStyle:!0,children:A.jsx(X.Select,{style:{width:"100px"},options:y?Qse[y]:[],onChange:()=>{const C=o.getFieldValue("conditionList");y==="timestamp"&&(C[g].rdate="exactdate"),o.setFieldsValue({conditionList:C})}})})})}}),A.jsx(X.Form.Item,{noStyle:!0,dependencies:[["conditionList",g,"field"],["conditionList",g,"condition"],["conditionList",g,"rdate"]],children:({getFieldValue:m})=>{var S;const y=m(["conditionList",g,"field"]),b=n==null?void 0:n.find(T=>T.value===y),C=b==null?void 0:b.type,_=(S=b==null?void 0:b.enum)==null?void 0:S.map(T=>{var E;return{...T,label:((E=u==null?void 0:u.fieldMap)==null?void 0:E[T.label])||T.label}}),w=b==null?void 0:b.dynamic_call_enum_api,x=m(["conditionList",g,"condition"]),D=m(["conditionList",g,"rdate"]);return A.jsxs(A.Fragment,{children:[["int","float"].includes(C)&&!["null","notnull"].includes(x)?A.jsxs(A.Fragment,{children:[A.jsx(X.Form.Item,{...p,name:[g,"val"],noStyle:!0,children:A.jsx(X.InputNumber,{style:{width:"100px"},placeholder:l("pleaseEnter")})}),x==="contain"?A.jsx(X.Form.Item,{...p,name:[g,"val2"],noStyle:!0,children:A.jsx(X.InputNumber,{style:{width:"100px",marginLeft:"5px"},placeholder:l("pleaseEnter")})}):null]}):null,C==="timestamp"&&!["null","notnull"].includes(x)?A.jsxs(A.Fragment,{children:[x==="="||x==="<"||x===">"?A.jsx(X.Form.Item,{...p,name:[g,"rdate"],noStyle:!0,children:A.jsx(X.Select,{showSearch:!0,optionFilterProp:"label",style:{width:"150px"},options:x==="="?Zse:Kse})}):null,D=="exactdate"?A.jsx(X.Form.Item,{...p,name:[g,"val"],noStyle:!0,children:A.jsx(X.DatePicker,{style:{width:"150px"}})}):null,x==="contain"?A.jsx(X.Form.Item,{...p,name:[g,"val2"],noStyle:!0,children:A.jsx(X.DatePicker,{style:{width:"150px",marginLeft:"5px"}})}):null]}):null,["string"].includes(C)&&!["null","notnull"].includes(x)?A.jsxs(A.Fragment,{children:[A.jsx(X.Form.Item,{...p,name:[g,"val"],noStyle:!0,children:A.jsx(X.Input,{style:{width:"150px"},placeholder:l("pleaseEnter")})}),x==="contain"?A.jsx(X.Form.Item,{...p,name:[g,"val2"],noStyle:!0,children:A.jsx(X.Input,{style:{width:"150px",marginLeft:"5px"},placeholder:l("pleaseEnter")})}):null]}):null,["bool"].includes(C)?A.jsx(A.Fragment,{children:A.jsx(X.Form.Item,{...p,name:[g,"val"],noStyle:!0,children:A.jsx(X.Switch,{})})}):null,["enum"].includes(C)&&!["null","notnull"].includes(x)?A.jsx(A.Fragment,{children:A.jsx(X.Form.Item,{...p,name:[g,"val"],noStyle:!0,children:(_==null?void 0:_.length)>0?A.jsx(X.Select,{showSearch:!0,optionFilterProp:"label",style:{width:"150px"},options:_}):w?A.jsx(Jse,{style:{width:"150px"},fetchOptions:async T=>{var R;let E=w;return T&&(E=`${E}?q=${T}`),await((R=a==null?void 0:a(E))==null?void 0:R.then(M=>{var P;return(P=M.data)==null?void 0:P.list}))}}):null})}):null]})}}),A.jsx(pD,{onClick:()=>h(g)})]},v)),A.jsx(X.Form.Item,{children:A.jsx(X.Button,{type:"dashed",onClick:()=>{const v=n==null?void 0:n[0].value;d(v!=="timestamp"?{field:n==null?void 0:n[0].value,condition:"=",type:n==null?void 0:n[0].type,val:"",val2:""}:{field:n==null?void 0:n[0].value,condition:"=",type:n==null?void 0:n[0].type,exactdate:"exactdate",val:"",val2:""})},block:!0,icon:A.jsx(mD,{}),children:l("addCondition")})})]})})]})})})},ele=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=lo(),[i]=X.Form.useForm(),[a,o]=N.useState(),[s,l]=N.useState(),[u,f]=N.useState(!1),c=N.useRef(),[d,h]=N.useState({conditionList:[],conditionType:"all"}),[v,g]=N.useState(0),{t:p}=Er(),m={dataSourceId:"",statisticalMethod:"recordTotal",field:""},y=()=>{setTimeout(()=>{e==null||e({...i.getFieldsValue(),conditionData:c.current})})},b=_=>{var x,D;const w=(D=(x=n==null?void 0:n.sourceData)==null?void 0:x.find(S=>S.value===_))==null?void 0:D.fields;o(w),l(w==null?void 0:w.filter(S=>S.type==="int"||S.type==="float"))},C=_=>{var w;h(_),c.current=_,g(((w=_==null?void 0:_.conditionList)==null?void 0:w.length)||0)};return N.useEffect(()=>{var _,w;if(t!=null&&t.customData){const x=t.customData;i.setFieldsValue(x),b(x==null?void 0:x.dataSourceId)}else{const x=(_=n==null?void 0:n.sourceData)==null?void 0:_[0];i.setFieldsValue({...m,dataSourceId:x==null?void 0:x.value}),b(x==null?void 0:x.value),y()}C((w=t==null?void 0:t.customData)==null?void 0:w.conditionData)},[t,n]),A.jsxs(A.Fragment,{children:[A.jsxs(X.Form,{form:i,name:"customData",layout:"vertical",initialValues:m,children:[A.jsx(X.Form.Item,{label:p("dataSource"),name:"dataSourceId",children:A.jsx(X.Select,{options:n==null?void 0:n.sourceData,onChange:_=>{i.setFieldsValue({statisticalMethod:"recordTotal"}),b(_),y()}})}),A.jsxs(X.Form.Item,{label:p("dataRange"),children:[A.jsx(X.Button,{style:{marginLeft:"-15px"},onClick:()=>{f(!0)},type:"link",children:p("filterData")}),v>0?`${p("selectNcondition",{n:v})}`:null]}),A.jsx(X.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),A.jsx(X.Form.Item,{label:p("statisticstMethods"),name:"statisticalMethod",children:A.jsx(X.Select,{onChange:_=>{i.setFieldsValue({field:_==="fieldValue"?s==null?void 0:s[0].value:"",statisticalType:"sum"}),y()},options:[{value:"recordTotal",label:p("statisticstRecordNum")},{value:"fieldValue",label:p("statisticstFieldVal")}]})}),A.jsx(X.Form.Item,{dependencies:["statisticalMethod"],children:({getFieldValue:_})=>_("statisticalMethod")==="fieldValue"?A.jsx(X.Form.Item,{label:p("selectField"),children:A.jsxs(X.Space.Compact,{children:[A.jsx(X.Form.Item,{noStyle:!0,name:"field",children:A.jsx(X.Select,{style:{width:"100px"},onChange:()=>{y()},options:s})}),A.jsx(X.Form.Item,{name:"statisticalType",noStyle:!0,children:A.jsx(X.Select,{style:{width:"100px"},onChange:()=>{y()},options:[{value:"sum",label:p("sumVal")},{value:"max",label:p("maxVal")},{value:"min",label:p("minVal")},{value:"avg",label:p("averageVal")}]})})]})}):null})]}),A.jsx(K1,{open:u,value:d,fieldOptions:a,enumDataApi:r,onClose:()=>{f(!1)},onOk:_=>{C(_),y()}})]})},tle=({value:t,onChange:e})=>{const[r,n]=N.useState(),i=["#373c43","#3370ff","#4954e6","#34c724","#14c0ff","#ffc60a","#f80","#f76964"];return N.useEffect(()=>{n(t)},[t]),A.jsx("div",{className:"pane-item-body item-body-column",children:A.jsx("div",{className:"panel-single-color-selector",children:i.map((a,o)=>A.jsxs("div",{className:"panel-single-color-selector-color-item",onClick:()=>{n(a),e==null||e(a)},children:[A.jsx("div",{className:"panel-single-color-selector-color-item-background",style:{background:a}}),r===a?A.jsx("span",{className:"panel-icon",children:A.jsx(cD,{})}):null]},o))})})},rle=({selectModuleData:t,onAllValuesChange:e})=>{const[r]=X.Form.useForm(),{t:n}=Er(),i={color:"#373c43",unit:"1",precision:"",desc:""},a=()=>{setTimeout(()=>{e==null||e(r.getFieldsValue())})};return N.useEffect(()=>{t!=null&&t.customeStyle?r.setFieldsValue(t.customeStyle):r.setFieldsValue(i)},[t]),A.jsxs(X.Form,{form:r,name:"customeStyle",layout:"vertical",initialValues:i,children:[A.jsx(X.Form.Item,{label:n("statistics.t1"),name:"color",children:A.jsx(tle,{onChange:()=>{a()}})}),A.jsx(X.Form.Item,{label:n("statistics.t2"),extra:n("statistics.t3"),children:A.jsxs(X.Space.Compact,{children:[A.jsx(X.Form.Item,{name:"precision",noStyle:!0,children:A.jsx(X.InputNumber,{min:1,max:10,style:{width:"60%"},placeholder:n("statistics.t4"),onChange:()=>{a()}})}),A.jsx(X.Form.Item,{name:"unit",noStyle:!0,children:A.jsxs(X.Select,{onChange:()=>{a()},children:[A.jsx(X.Select.Option,{value:"1",children:n("statistics.t5")}),A.jsx(X.Select.Option,{value:"2",children:n("statistics.t6")}),A.jsx(X.Select.Option,{value:"3",children:n("statistics.t7")}),A.jsx(X.Select.Option,{value:"4",children:n("statistics.t8")}),A.jsx(X.Select.Option,{value:"5",children:n("statistics.t9")})]})})]})}),A.jsx(X.Form.Item,{label:n("statistics.t10"),name:"desc",children:A.jsx(X.Input,{onChange:()=>{a()}})})]})},nle=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{const{t:o}=Er(),[s,l]=N.useState(),[u,f]=N.useState(),c=()=>{e==null||e()};return N.useEffect(()=>{i&&(l(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]),A.jsx(A.Fragment,{children:A.jsx(X.Modal,{width:"65%",title:o("statisticsText"),footer:null,open:t,onOk:c,onCancel:e,closeIcon:A.jsx(Pc,{}),styles:{header:{padding:"10px",borderBottom:"1px solid #dee0e3",marginBottom:"10px"},content:{padding:0},body:{overflowY:"auto",flex:1}},children:A.jsxs("div",{className:"config-widget-dialog-container",children:[A.jsx("div",{className:"config-widget-dialog-content",children:A.jsx("div",{className:"config-widget-dialog-preview",children:A.jsx(HD,{customData:s,customeStyle:u,moduleDataApi:n})})}),A.jsxs("div",{className:"config-widget-dialog-panel",children:[A.jsx("div",{className:"bitable-dashboard edit-panel-container",children:A.jsx(X.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:A.jsx(ele,{selectModuleData:i,enumDataApi:a,onAllValuesChange:d=>{l(d)}})},{key:"2",label:o("customStyle"),children:A.jsx(rle,{selectModuleData:i,onAllValuesChange:d=>{f(d)}})}]})}),A.jsx("div",{className:"button-container",children:A.jsx(X.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,customData:s,customeStyle:u})},children:o("confirm")})})]})]})})})},ile=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=lo(),[i]=X.Form.useForm(),[a,o]=N.useState(),[s,l]=N.useState(!1),u=N.useRef(),[f,c]=N.useState({conditionList:[],conditionType:"all"}),[d,h]=N.useState(0),[v,g]=N.useState(),{t:p}=Er(),m={dataSourceId:"",startDateField:"",endDateField:"",titleField:""},y=()=>{setTimeout(()=>{e==null||e({...i.getFieldsValue(),conditionData:u.current})})},b=_=>{var x,D;const w=(D=(x=n==null?void 0:n.sourceData)==null?void 0:x.find(S=>S.value===_))==null?void 0:D.fields;return o(w),g(w==null?void 0:w.filter(S=>S.type==="timestamp")),w},C=_=>{var w;c(_),u.current=_,h(((w=_==null?void 0:_.conditionList)==null?void 0:w.length)||0)};return N.useEffect(()=>{var _,w,x,D,S,T;if(t!=null&&t.customData)i.setFieldsValue(t.customData),b((_=t==null?void 0:t.customData)==null?void 0:_.dataSourceId);else{const E=(w=n==null?void 0:n.sourceData)==null?void 0:w[0],R=(x=E==null?void 0:E.fields)==null?void 0:x.filter(M=>M.type==="timestamp");i.setFieldsValue({...m,dataSourceId:E==null?void 0:E.value,titleField:(S=(D=E==null?void 0:E.fields)==null?void 0:D[0])==null?void 0:S.value,startDateField:R==null?void 0:R[0].value,endDateField:R==null?void 0:R[0].value}),b(E==null?void 0:E.value),y()}C((T=t==null?void 0:t.customData)==null?void 0:T.conditionData)},[t,n]),A.jsxs(A.Fragment,{children:[A.jsxs(X.Form,{form:i,name:"customData",labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:m,children:[A.jsx("div",{style:{fontSize:"14px",marginBottom:"5px"},children:p("data")}),A.jsx(X.Form.Item,{label:p("dataSource"),name:"dataSourceId",children:A.jsx(X.Select,{options:n==null?void 0:n.sourceData,onChange:_=>{var x;const w=b(_);i.setFieldsValue({titleField:(x=w==null?void 0:w[0])==null?void 0:x.value}),y()}})}),A.jsxs(X.Form.Item,{label:p("dataRange"),children:[A.jsx(X.Button,{style:{marginLeft:"-15px"},onClick:()=>{l(!0)},type:"link",children:p("filterData")}),d>0?`${p("selectNcondition",{n:d})}`:null]}),A.jsx(X.Divider,{orientation:"left",orientationMargin:"0",children:p("calendar.t1")}),A.jsx(X.Form.Item,{label:p("calendar.t2"),name:"startDateField",children:A.jsx(X.Select,{onChange:()=>{y()},options:v})}),A.jsx(X.Form.Item,{label:p("calendar.t3"),name:"endDateField",children:A.jsx(X.Select,{onChange:()=>{y()},options:v})}),A.jsx(X.Form.Item,{label:p("calendar.t4"),name:"titleField",children:A.jsx(X.Select,{onChange:()=>{y()},options:a})})]}),A.jsx(K1,{open:s,value:f,fieldOptions:a,enumDataApi:r,onClose:()=>{l(!1)},onOk:_=>{C(_),y()}})]})},ale=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{const{t:o}=Er(),[s,l]=N.useState(),u=()=>{e==null||e()};return N.useEffect(()=>{i&&l(i==null?void 0:i.customData)},[i]),A.jsx(A.Fragment,{children:A.jsx(X.Modal,{width:"65%",title:o("calendarText"),footer:null,open:t,onOk:u,onCancel:e,closeIcon:A.jsx(Pc,{}),styles:{header:{padding:"10px",borderBottom:"1px solid #dee0e3",marginBottom:"10px"},content:{padding:0},body:{overflowY:"auto",flex:1}},children:A.jsxs("div",{className:"config-widget-dialog-container",children:[A.jsx("div",{className:"config-widget-dialog-content",children:A.jsx("div",{className:"config-widget-dialog-preview",style:{borderRight:"1px solid #e0e0e0"},children:A.jsx(gA,{customData:s,moduleDataApi:n})})}),A.jsxs("div",{className:"config-widget-dialog-panel",style:{borderLeft:"none"},children:[A.jsx("div",{className:"bitable-dashboard edit-panel-container",style:{paddingTop:"20px"},children:A.jsx(ile,{enumDataApi:a,selectModuleData:i,onAllValuesChange:f=>{l(f)}})}),A.jsx("div",{className:"button-container",children:A.jsx(X.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,customData:s})},children:o("confirm")})})]})]})})})},ole=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"17",y:"8",width:"6",height:"15.5",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"17",y:"24.5",width:"6",height:"15.5",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"28",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"28",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"50",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"50",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"})]}),sle=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"17",y:"21",width:"6",height:"6",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"17",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"28",y:"24",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"28",y:"34",width:"6",height:"6",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"50",y:"18",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"50",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"})]}),lle=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"58",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 58 11)",fill:"#959bee"}),A.jsx("rect",{x:"42",y:"11",width:"4",height:"28",rx:"0.5",transform:"rotate(90 42 11)",fill:"#5b65f5"}),A.jsx("rect",{x:"58",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 58 18)",fill:"#959bee"}),A.jsx("rect",{x:"35.5",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 35.5 18)",fill:"#5b65f5"}),A.jsx("rect",{x:"58",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 58 25)",fill:"#959bee"}),A.jsx("rect",{x:"23",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 23 25)",fill:"#5b65f5"}),A.jsx("rect",{x:"58",y:"32",width:"4",height:"17",rx:"0.5",transform:"rotate(90 58 32)",fill:"#959bee"}),A.jsx("rect",{x:"40",y:"32",width:"4",height:"26",rx:"0.5",transform:"rotate(90 40 32)",fill:"#5b65f5"})]}),ule=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"40",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 40 11)",fill:"#959bee"}),A.jsx("rect",{x:"24",y:"11",width:"4",height:"8",rx:"0.5",transform:"rotate(90 24 11)",fill:"#5b65f5"}),A.jsx("rect",{x:"48",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 48 18)",fill:"#959bee"}),A.jsx("rect",{x:"31.5",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 31.5 18)",fill:"#5b65f5"}),A.jsx("rect",{x:"60",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 60 25)",fill:"#959bee"}),A.jsx("rect",{x:"25",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 25 25)",fill:"#5b65f5"}),A.jsx("rect",{x:"43",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 43 32)",fill:"#959bee"}),A.jsx("rect",{x:"29",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 29 32)",fill:"#5b65f5"})]}),fle=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("path",{d:"M15.5 33.5C20.2023 32.3804 23.5007 28.5533 25.7095 24.6682C28.3082 20.0974 34.0857 17.3668 38.758 19.7783L39.8066 20.3195C42.9001 21.9162 46.671 21.329 49.1326 18.8674L58 10",stroke:"#959bee",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),A.jsx("path",{d:"M16.5 15L26.844 27.6427C28.7759 30.0039 31.8825 31.0607 34.8535 30.3675L42.3359 28.6216C44.0629 28.2187 45.8748 28.401 47.4869 29.1398L57 33.5",stroke:"#5b65f4",strokeWidth:"1.5",strokeLinecap:"round"})]}),cle=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("path",{d:"M20 24C20 32.8366 27.1634 40 36 40C44.8366 40 52 32.8366 52 24C52 15.1634 44.8366 8 36 8C27.1634 8 20 15.1634 20 24ZM46.3944 24C46.3944 29.7407 41.7407 34.3944 36 34.3944C30.2593 34.3944 25.6056 29.7407 25.6056 24C25.6056 18.2593 30.2593 13.6056 36 13.6056C41.7407 13.6056 46.3944 18.2593 46.3944 24Z",fill:"#5b65f4"}),A.jsx("path",{d:"M52 24C52 19.7565 50.3143 15.6869 47.3137 12.6863C44.3131 9.68571 40.2435 8 36 8V13.6056C38.7568 13.6056 41.4006 14.7007 43.35 16.65C45.2993 18.5994 46.3944 21.2432 46.3944 24H52Z",fill:"#959bee"}),A.jsx("path",{d:"M52 24C52 20.9896 51.1507 18.0403 49.5497 15.4909L44.8026 18.4721C45.8427 20.1283 46.3944 22.0443 46.3944 24H52Z",fill:"#cdcff9"})]}),dle=({selectModuleData:t,onAllValuesChange:e,onValuesChange:r,enumDataApi:n})=>{const{globalData:i}=lo(),[a]=X.Form.useForm(),[o,s]=N.useState(),[l,u]=N.useState(),[f,c]=N.useState(),[d,h]=N.useState(!1),v=N.useRef(),[g,p]=N.useState({conditionList:[],conditionType:"all"}),[m,y]=N.useState(0),{t:b}=Er(),C=X.Form.useWatch("type",a),_={dataSourceId:"",yAxis:"recordTotal",chartOptions:["legend","label","axis","splitLine"],sortField:"xAxis",sortOrder:"asc"},w=()=>{setTimeout(()=>{e==null||e({...a.getFieldsValue(),conditionData:v.current})},100)},x=S=>{var E,R;const T=(R=(E=i==null?void 0:i.sourceData)==null?void 0:E.find(M=>M.value===S))==null?void 0:R.fields;return s(T),c(T==null?void 0:T.filter(M=>M.type==="int"||M.type==="float")),u(T==null?void 0:T.filter(M=>M.value!==S)),T},D=S=>{var T;p(S),v.current=S,y(((T=S==null?void 0:S.conditionList)==null?void 0:T.length)||0)};return N.useEffect(()=>{var S,T,E;if(t!=null&&t.customData){const R=t.customData;x(R==null?void 0:R.dataSourceId),a.setFieldsValue(R)}else{const R=(S=i==null?void 0:i.sourceData)==null?void 0:S[0],M=x(R==null?void 0:R.value)||[];a.setFieldsValue({..._,dataSourceId:R==null?void 0:R.value,type:t==null?void 0:t.type,xAxis:(T=M==null?void 0:M[0])==null?void 0:T.value})}D((E=t==null?void 0:t.customData)==null?void 0:E.conditionData),w()},[t,i]),A.jsxs("div",{style:{height:"50vh",overflowX:"auto"},children:[A.jsxs(X.Form,{form:a,name:"customData",layout:"vertical",onValuesChange:r,initialValues:_,children:[A.jsx(X.Form.Item,{label:b("dataSource"),name:"dataSourceId",children:A.jsx(X.Select,{options:i==null?void 0:i.sourceData,onChange:S=>{var E;const T=x(S);a.setFieldsValue({yAxis:"recordTotal",xAxis:(E=T==null?void 0:T[0])==null?void 0:E.value}),w()}})}),A.jsxs(X.Form.Item,{label:b("dataRange"),children:[A.jsx(X.Button,{style:{marginLeft:"-15px"},onClick:()=>{h(!0)},type:"link",children:b("filterData")}),m>0?`${b("selectNcondition",{n:m})}`:null]}),A.jsx(X.Form.Item,{label:b("chart.t1"),name:"type",children:A.jsx(X.Select,{onChange:()=>{w()},options:[{label:b("chart.t2"),value:"chart-bar",icon:A.jsx(LN,{})},{label:b("chart.t3"),value:"chart-bar-pile",icon:A.jsx(sle,{})},{label:b("chart.t4"),value:"chart-bar-percentage",icon:A.jsx(ole,{})},{label:b("chart.t5"),value:"chart-strip-bar",icon:A.jsx(zN,{})},{label:b("chart.t6"),value:"chart-strip-bar-pile",icon:A.jsx(ule,{})},{label:b("chart.t7"),value:"chart-strip-bar-percentage",icon:A.jsx(lle,{})},{label:b("chart.t8"),value:"chart-line",icon:A.jsx(kN,{})},{label:b("chart.t9"),value:"chart-line-smooth",icon:A.jsx(fle,{})},{label:b("chart.t10"),value:"chart-pie",icon:A.jsx(jN,{})},{label:b("chart.t11"),value:"chart-pie-circular",icon:A.jsx(cle,{})}],optionRender:S=>A.jsxs(X.Flex,{align:"center",children:[A.jsx("span",{role:"img",style:{marginTop:"5px"},"aria-label":S.data.label,children:S.data.icon}),S.data.label]})})}),A.jsx(X.Form.Item,{name:"chartOptions",label:b("chart.t12"),children:A.jsxs(X.Checkbox.Group,{onChange:()=>{w()},children:[A.jsx(X.Checkbox,{value:"legend",style:{lineHeight:"32px"},children:b("chart.t13")}),A.jsx(X.Checkbox,{value:"label",style:{lineHeight:"32px"},children:b("chart.t14")}),["chart-pie","chart-pie-circular"].includes(C)?null:A.jsxs(A.Fragment,{children:[A.jsx(X.Checkbox,{value:"axis",style:{lineHeight:"32px"},children:b("chart.t15")}),A.jsx(X.Checkbox,{value:"splitLine",style:{lineHeight:"32px"},children:b("chart.t16")})]})]})}),A.jsx(X.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),A.jsx(X.Form.Item,{label:C!=null&&C.includes("pie")?b("chart.t17"):b("chart.t18"),name:"xAxis",children:A.jsx(X.Select,{onChange:S=>{const T=o==null?void 0:o.filter(E=>E.value!==S);u(T),a.setFieldsValue({groupField:T==null?void 0:T[0].value}),w()},options:o})}),A.jsx(X.Form.Item,{dependencies:["type"],children:({getFieldValue:S})=>{var T;return(T=S("type"))!=null&&T.includes("pie")?null:A.jsxs(A.Fragment,{children:[A.jsx(X.Form.Item,{name:"sortField",label:b("chart.t31"),children:A.jsxs(X.Radio.Group,{onChange:()=>{w()},children:[A.jsx(X.Radio,{value:"xAxis",children:b("chart.t32")}),A.jsx(X.Radio,{value:"yAxisField",children:b("chart.t33")}),A.jsx(X.Radio,{value:"recordValue",children:b("chart.t34")})]})}),A.jsx(X.Form.Item,{name:"sortOrder",label:b("chart.t35"),children:A.jsxs(X.Radio.Group,{onChange:()=>{w()},children:[A.jsx(X.Radio,{value:"asc",children:b("chart.t36")}),A.jsx(X.Radio,{value:"desc",children:b("chart.t37")})]})})]})}}),A.jsx(X.Form.Item,{label:C!=null&&C.includes("pie")?b("chart.t19"):b("chart.t20"),name:"yAxis",children:A.jsx(X.Select,{onChange:S=>{a.setFieldsValue({yAxisField:S==="fieldValue"?f==null?void 0:f[0].value:"",yAxisFieldType:"sum"}),w()},options:[{value:"recordTotal",label:b("statisticstRecordNum")},{value:"fieldValue",label:b("statisticstFieldVal")}]})}),A.jsx(X.Form.Item,{dependencies:["yAxis"],noStyle:!0,children:({getFieldValue:S})=>S("yAxis")==="fieldValue"?A.jsx(X.Form.Item,{label:b("selectField"),children:A.jsxs(X.Space.Compact,{children:[A.jsx(X.Form.Item,{noStyle:!0,name:"yAxisField",children:A.jsx(X.Select,{style:{width:"100px"},onChange:()=>{w()},options:f})}),A.jsx(X.Form.Item,{name:"yAxisFieldType",noStyle:!0,children:A.jsx(X.Select,{style:{width:"100px"},onChange:()=>{w()},options:[{value:"sum",label:b("sumVal")},{value:"max",label:b("maxVal")},{value:"min",label:b("minVal")},{value:"avg",label:b("averageVal")}]})})]})}):null}),A.jsx(X.Form.Item,{dependencies:["type"],children:({getFieldValue:S})=>{var T;return(T=S("type"))!=null&&T.includes("pie")?null:A.jsxs(X.Form.Item,{children:[A.jsx(X.Form.Item,{name:"isGroup",valuePropName:"checked",noStyle:!0,children:A.jsx(X.Checkbox,{onChange:E=>{if(E){const R=a.getFieldValue("xAxis"),M=o==null?void 0:o.filter(P=>P.value!==R);u(M),a.setFieldsValue({groupField:M==null?void 0:M[0].value})}w()},style:{marginBottom:"5px"},children:"分组聚合"})}),A.jsx(X.Form.Item,{dependencies:["isGroup"],children:({getFieldValue:E})=>E("isGroup")?A.jsx(X.Form.Item,{name:"groupField",children:A.jsx(X.Select,{options:l,onChange:()=>{w()}})}):null})]})}})]}),A.jsx(K1,{open:d,value:g,fieldOptions:o,enumDataApi:n,onClose:()=>{h(!1)},onOk:S=>{D(S),w()}})]})},hle=({customData:t,selectModuleData:e,onAllValuesChange:r})=>{var s,l;const[n]=X.Form.useForm(),{t:i}=Er(),a={xtitle:"",ytitle:"",xchartOptions:[],ychartOptions:[]},o=()=>{setTimeout(()=>{r==null||r(n.getFieldsValue())})};return N.useEffect(()=>{e!=null&&e.customeStyle?n.setFieldsValue(e.customeStyle):n.setFieldsValue(a)},[e]),A.jsx("div",{style:{height:"50vh",overflowX:"auto"},children:A.jsxs(X.Form,{form:n,name:"customeStyle",layout:"vertical",initialValues:a,children:[A.jsx(X.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t21")}),(s=t==null?void 0:t.type)!=null&&s.includes("pie")?null:A.jsx(X.Form.Item,{label:i("chart.t22"),name:"xtitle",children:A.jsx(X.Input,{onChange:()=>{o()}})}),A.jsx(X.Form.Item,{name:"xchartOptions",label:i("chart.t23"),children:A.jsx(X.Checkbox.Group,{onChange:()=>{o()},children:A.jsxs(X.Row,{children:[A.jsx(X.Col,{span:12,children:A.jsx(X.Checkbox,{value:"label",style:{lineHeight:"32px"},children:i("chart.t24")})}),A.jsx(X.Col,{span:12,children:A.jsx(X.Checkbox,{value:"axisLine",style:{lineHeight:"32px"},children:i("chart.t25")})})]})})}),A.jsx(X.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t26")}),(l=t==null?void 0:t.type)!=null&&l.includes("pie")?null:A.jsx(X.Form.Item,{label:i("chart.t27"),name:"ytitle",children:A.jsx(X.Input,{onChange:()=>{o()}})}),A.jsx(X.Form.Item,{name:"ychartOptions",label:i("chart.t28"),children:A.jsx(X.Checkbox.Group,{onChange:()=>{o()},children:A.jsxs(X.Row,{children:[A.jsx(X.Col,{span:12,children:A.jsx(X.Checkbox,{value:"label",style:{lineHeight:"32px"},children:i("chart.t29")})}),A.jsx(X.Col,{span:12,children:A.jsx(X.Checkbox,{value:"axisLine",style:{lineHeight:"32px"},children:i("chart.t30")})})]})})})]})})},vle=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{const{t:o}=Er(),[s,l]=N.useState(),[u,f]=N.useState(),c=()=>{e==null||e()};return N.useEffect(()=>{i&&(l(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]),A.jsx(A.Fragment,{children:A.jsx(X.Modal,{width:"65%",title:o("chartText"),footer:null,open:t,onOk:c,onCancel:e,destroyOnClose:!0,closeIcon:A.jsx(Pc,{}),styles:{header:{padding:"10px",borderBottom:"1px solid #dee0e3",marginBottom:"10px"},content:{padding:0},body:{overflowY:"auto",flex:1}},children:A.jsxs("div",{className:"config-widget-dialog-container",children:[A.jsx("div",{className:"config-widget-dialog-content",children:A.jsx("div",{className:"config-widget-dialog-preview",children:A.jsx(iN,{customData:s,customeStyle:u,moduleDataApi:n})})}),A.jsxs("div",{className:"config-widget-dialog-panel",children:[A.jsx("div",{className:"bitable-dashboard edit-panel-container",children:A.jsx(X.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:A.jsx(dle,{enumDataApi:a,selectModuleData:i,onAllValuesChange:d=>{l(d)}})},{key:"2",label:o("customStyle"),children:A.jsx(hle,{customData:s,selectModuleData:i,onAllValuesChange:d=>{f(d)}})}]})}),A.jsx("div",{className:"button-container",children:A.jsx(X.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,type:i==null?void 0:i.type,customData:s,customeStyle:u})},children:o("confirm")})})]})]})})})},ple={...{title:"仪表盘",text:"文本",confirm:"确定",pleaseEnter:"请输入",configuration:"配置",copy:"复制",delete:"删除",calendarText:"日历",chartText:"图表",promptTitle:"提示",promptContentDeleteComponents:"确认删除组件?",unnamedRecord:"未命名记录",setFilteringCriteria:"设置筛选条件",all:"所有",everyone:"任一",condition:"条件",addCondition:"添加条件",equalto:"等于",notequalto:"不等于",contain:"包含",notcontain:"不包含",null:"为空",notnull:"不为空",conformTo:"符合以下",statisticsText:"统计文字",typeData:"类型与数据",customStyle:"自定义样式",dataSource:"数据源",dataRange:"数据范围",data:"数据",filterData:"筛选数据",selectNcondition:"已选{{n}}个条件",allData:"全部数据",statisticstMethods:"统计方式",statisticstRecordNum:"统计记录总数",statisticstFieldVal:"统计字段数值",selectField:"选择字段",sumVal:"求和",maxVal:"最大值",minVal:"最小值",averageVal:"平均值"},pb:{text:"文本",statisticsText:"统计",unknown:"未知"},statistics:{t1:"配色方案",t2:"数值设置",t3:"小数位数与格式",t4:"请输入小数位数",t5:"数字(千分位)",t6:"数字",t7:"百分比",t8:"人名币",t9:"美元",t10:"统计数值说明",t11:"",t12:"",t13:""},chart:{t1:"图表类型",t2:"基础柱状图",t3:"堆积柱状图",t4:"百分比堆积柱状图",t5:"基础条形图",t6:"堆积条形图",t7:"百分比堆积条形图",t8:"折线图",t9:"平滑折线图",t10:"饼图",t11:"环形图",t12:"图标选项",t13:"图例",t14:"数据标签",t15:"坐标轴",t16:"网格线",t17:"扇形分区",t18:"横轴(类别)",t19:"扇形数值",t20:"纵轴(字段)",t21:"横轴",t22:"横轴标题",t23:"坐标轴选项",t24:"显示标签",t25:"显示轴线",t26:"纵轴",t27:"纵轴标题",t28:"坐标轴选项",t29:"显示标签",t30:"显示轴线",t31:"排序依据",t32:"横轴值",t33:"纵轴值",t34:"记录循序",t35:"排序规则",t36:"正序",t37:"倒序",t38:"分组聚合"},calendar:{t1:"视图配置",t2:"开始日期",t3:"结束日期",t4:"标题展示"},add:{add1:"图表",add2:"柱状图",add3:"折线图",add4:"饼图",add5:"条形图",add6:"其他",add7:"统计数字",add8:"文本",add9:"日历",add10:"添加组件",add11:"等于",add12:"不等于",add13:"等于",add14:"早于",add15:"晚于",add16:"范围内",add17:"为空",add18:"不为空",add19:"不等于",add20:"大于",add21:"大于等于",add22:"小于",add23:"小于等于",add24:"包含",add25:"不包含",add26:"具体日期",add27:"今天",add28:"昨天",add29:"本周",add30:"上周",add31:"本月",add32:"上月",add33:"过去7天",add34:"过去30天"}},gle={...{title:"Dashboard",text:"Text",confirm:"Confirm",pleaseEnter:"Please enter",configuration:"Configuration",copy:"Copy",delete:"Delete",calendarText:"Calendar",chartText:"Chart",promptTitle:"Prompt",promptContentDeleteComponents:"Are you sure you want to delete this component?",unnamedRecord:"Unnamed Record",setFilteringCriteria:"Set filtering criteria",all:"All",everyone:"Anyone",condition:"Condition",addCondition:"Add condition",equalto:"Equal to",notequalto:"Not equal to",contain:"Contains",notcontain:"Does not contain",null:"Is empty",notnull:"Is not empty",conformTo:"Conform to the following",statisticsText:"Statistics Text",typeData:"Type and Data",customStyle:"Custom Style",dataSource:"Data Source",dataRange:"Data Range",data:"Data",filterData:"Filter Data",selectNcondition:"Selected {{n}} conditions",allData:"All Data",statisticstMethods:"Statistical Methods",statisticstRecordNum:"Total Number of Records",statisticstFieldVal:"Statistical Field Values",selectField:"Select Field",sumVal:"Sum",maxVal:"Maximum Value",minVal:"Minimum Value",averageVal:"Average Value"},pb:{text:"text",statisticsText:"Statistics",unknown:"unknown"},statistics:{t1:"Color Scheme",t2:"Value Settings",t3:"Decimal Places and Format",t4:"Please enter decimal places",t5:"Number (Thousand Separator)",t6:"Number",t7:"Percentage",t8:"Renminbi",t9:"Dollar",t10:"Statistical Value Description",t11:"",t12:"",t13:""},chart:{t1:"Chart Type",t2:"Basic Bar Chart",t3:"Stacked Bar Chart",t4:"Percentage Bar Chart",t5:"Basic Horizontal Bar Chart",t6:"Stacked Horizontal Bar Chart",t7:"Percentage Stacked Horizontal Bar Chart",t8:"Line Chart",t9:"Smooth Line Chart",t10:"Pie Chart",t11:"Doughnut Chart",t12:"Chart Options",t13:"Legend",t14:"Data Label",t15:"Axis",t16:"Grid Line",t17:"Sector Division",t18:"Horizontal Axis (Category)",t19:"Sector Value",t20:"Vertical Axis (Field)",t21:"Horizontal Axis",t22:"Horizontal Axis Title",t23:"Axis Options",t24:"Show Labels",t25:"Show Axis Line",t26:"Vertical Axis",t27:"Vertical Axis Title",t28:"Axis Options",t29:"Show Labels",t30:"Show Axis Line",t31:"Sort By",t32:"Horizontal Axis Value",t33:"Vertical Axis Value",t34:"Record Sequence",t35:"Sort Order",t36:"Ascending",t37:"Descending",t38:"Grouping And Aggregation"},calendar:{t1:"View Configuration",t2:"Start Date",t3:"End Date",t4:"Title Display"},add:{add1:"Chart",add2:"Bar Chart",add3:"Line Chart",add4:"Pie Chart",add5:"Bar Graph",add6:"Other",add7:"Statistics",add8:"Text",add9:"Calendar",add10:"Add Component",add11:"Equal to",add12:"Not Equal to",add13:"Equal to",add14:"Before",add15:"After",add16:"Within Range",add17:"Is Empty",add18:"Is Not Empty",add19:"Not Equal to",add20:"Greater than",add21:"Greater than or Equal to",add22:"Less than",add23:"Less than or Equal to",add24:"Contains",add25:"Does Not Contain",add26:"Specific Date",add27:"Today",add28:"Yesterday",add29:"This Week",add30:"Last Week",add31:"This Month",add32:"Last Month",add33:"Past 7 Days",add34:"Past 30 Days"}};Ae.use(t9).init({resources:{"zh-CN":{translation:ple},"en-US":{translation:gle}},lng:"zh-CN",fallbackLng:"zh-CN",interpolation:{escapeValue:!1}});const mle=()=>A.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-icon":"MoreVerticalOutlined",children:A.jsx("path",{d:"M12 5.5A1.75 1.75 0 1 1 12 2a1.75 1.75 0 0 1 0 3.5Zm0 8.225a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5ZM12 22a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5Z",fill:"currentColor"})}),yle=()=>A.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-icon":"DragOutlined",children:A.jsx("path",{d:"M8.25 6.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Zm0 7.25a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Zm1.75 5.5a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0ZM14.753 6.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5ZM16.5 12a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0Zm-1.747 9a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Z",fill:"#999"})}),ble=({defaultValue:t,onChange:e,module:r,onDropdownItem:n,onMouseDown:i,onMouseUp:a})=>{const[o,s]=N.useState(!1),[l,u]=N.useState(""),f=N.useRef(null),c=_D(g=>{e==null||e(g)},300),{t:d}=Er();N.useEffect(()=>{u(l)},[t]);const h=()=>{var p;((p=f.current)==null?void 0:p.input).select()},v=g=>{g.key==="Enter"&&s(!1)};return A.jsxs("div",{className:"layout-item-head isCanDrag",onMouseDown:()=>{i==null||i()},onMouseUp:()=>{a==null||a()},children:[A.jsxs("div",{className:"head-inner",children:[A.jsx("span",{className:"title",children:A.jsx("span",{className:"title-child",onDoubleClick:g=>{g.stopPropagation(),s(!0),setTimeout(()=>{var p;(p=f.current)==null||p.focus()},100)},children:o?A.jsx(X.Input,{defaultValue:t,onBlur:()=>{s(!1)},ref:f,onKeyDown:v,onDoubleClick:h,onChange:g=>{u(g.target.value),c(g.target.value)}}):t})}),A.jsx("div",{className:"menu-slot isNoCanDrag",children:A.jsx(X.Dropdown,{trigger:["click"],menu:{items:[r.type!=="text"?{label:d("configuration"),key:"edit"}:null,{label:d("copy"),key:"copy"},{key:"delete",danger:!0,label:d("delete")}],onClick:({key:g})=>{n==null||n(g)}},children:A.jsx("button",{type:"button",className:"dashboard-grid-menu-button",children:A.jsx("span",{className:"universe-icon",children:A.jsx(mle,{})})})})})]}),A.jsx("div",{className:"drag isCanDrag",children:A.jsx("span",{className:"universe-icon drag-icon",children:A.jsx(yle,{})})})]})},_le=N.memo(ble),Cle=bC.WidthProvider(bC.Responsive),wle=({sourceData:t,moduleConfigData:e,fieldMap:r,moduleDataApi:n,enumDataApi:i,onCreateModule:a,onUpdateModule:o,onDeleteModule:s,lang:l,className:u="layout",cols:f={lg:12,md:12,sm:12,xs:12,xxs:12},rowHeight:c=79})=>{const d=[10,10],{setGlobalData:h}=lo(),[v,g]=N.useState([]),[p,m]=N.useState(0),[y,b]=N.useState(),[C,_]=N.useState(),[w,x]=N.useState(!1),{i18n:D,t:S}=Er(),[T,E]=N.useState(!1),[R,M]=N.useState(!1),[P,B]=N.useState(!1),F={text:S("pb.text"),calendar:S("calendarText"),statistics:S("chartText")},[,H]=N.useState(f.lg),j=async U=>{const I=U.type==="calendar"?5:4,Y=U.type==="calendar"?5:3;if(Array.isArray(v)&&U.type){const z={x:0,y:0,w:I,h:Y,title:U.type.includes("chart")?S("chartText"):F[U.type],...U,type:U.type};await(a==null?void 0:a(z).then(G=>{var Q,K;if(!G.success){X.message.error(G.message);return}g([...v,{...z,i:(Q=G.data)==null?void 0:Q.id,id:(K=G.data)==null?void 0:K.id}])}))}},W=async(U,I)=>{if(v!=null&&v.length){const z={...v.find(Q=>Q.id===U),...I},G=v.map(Q=>Q.id===U?z:Q);g(G),await(o==null?void 0:o(z).then(Q=>{if(!Q.success){X.message.error(Q.message);return}}))}},L=async U=>{if(!(v!=null&&v.length)||!(U!=null&&U.length))return;const I=v.map(Y=>{const z=U.find(G=>G.id===Y.id);return z?{...Y,...z}:Y});g(I);try{for(const Y of U){const z=await(o==null?void 0:o(Y));if(!(z!=null&&z.success))throw new Error((z==null?void 0:z.message)||`Failed to update module: ${Y.id}`)}}catch(Y){g(v),X.message.error(Y.message||"Failed to update modules")}},q=async U=>{v!=null&&v.length&&(g(v.filter(I=>I.id!==U)),await(s==null?void 0:s(U||"")))},J=(U,I)=>{H(I)},ee=U=>{if(U==="text"){const I={type:U,customData:{title:S("text"),editor:[{type:"paragraph",children:[{text:""}]}]}};j(I)}else U==="statistics"?E(!0):U==="calendar"?M(!0):U!=null&&U.includes("chart")&&B(!0);_({title:"",type:U,w:0,h:0,x:0,y:0})},ae=U=>{const I=mG(U,v);L(I.map(Y=>({...v==null?void 0:v.find(G=>G.i===Y.i),...Y})))};return N.useEffect(()=>{h({fieldMap:r,sourceData:t})},[r,h,t]),N.useEffect(()=>{g(e||[])},[e]),N.useEffect(()=>{D.changeLanguage(l||"zh_CN")},[D,l]),A.jsxs("div",{className:"pivot-table",children:[A.jsxs("div",{className:"bitable-block-dashboard",children:[A.jsx("div",{className:"bitable-block-dashboard-toolbar bitable-toolbar",children:A.jsx("div",{className:"bitable-block-dashboard-toolbar--left",children:A.jsx(qse,{onOk:U=>{ee(U)}})})}),A.jsx("div",{className:"bitable-block-dashboard__mount",children:A.jsx("div",{className:"dashboard-container",children:A.jsx("div",{className:`dashboard-content-container ${w?"isResizableDraggable":""}`,children:A.jsx(Cle,{onBreakpointChange:J,className:u,compactType:"vertical",preventCollision:!1,cols:f,margin:d,rowHeight:c,measureBeforeMount:!1,draggableHandle:".isCanDrag",onWidthChange:(U,I,Y)=>{m(U/Y-1)},onDragStart:()=>{x(!0)},onDragStop:U=>{x(!1),ae(U)},onResizeStart:()=>{x(!0)},onResizeStop:U=>{x(!1),ae(U)},style:{backgroundSize:`${p}px ${c+d[0]}px`,backgroundPosition:`${d[0]}px ${d[0]}px`,minHeight:"100vh"},children:v==null?void 0:v.map(U=>A.jsxs("div",{className:`box-dashboard ${y===U.id?"active":""}`,onClick:()=>{b(U.id)},"data-grid":{i:U.id,x:U.x||0,y:U.y||0,w:U.w||2,h:U.h||2,minW:2,minH:2},children:[A.jsx(_le,{module:U,defaultValue:U.title,onChange:I=>W(U.id,{title:I}),onDropdownItem:I=>{var Y;if(I==="edit")b(U.id),_(U),U.type==="statistics"&&E(!0),(Y=U.type)!=null&&Y.includes("chart")&&B(!0),U.type==="calendar"&&M(!0);else if(I==="delete")X.Modal.confirm({title:S("promptTitle"),icon:A.jsx(hD,{}),content:S("promptContentDeleteComponents"),onOk(){q(U.id)}});else if(I==="copy"){const z=JSON.parse(JSON.stringify(U));delete z.id,delete z.i,j(z)}}}),A.jsx(Wse,{module:U,onUpdate:W,moduleDataApi:n,activeId:y,onClick:()=>{b(U.id)},rowWidth:p,rowHeight:c,onEdit:()=>{var I;b(U.id),_(U),U.type==="statistics"&&E(!0),(I=U.type)!=null&&I.includes("chart")&&B(!0),U.type==="calendar"&&M(!0)},onDelete:()=>{q(U.id)},onCopy:()=>{const I=JSON.parse(JSON.stringify(U));delete I.id,delete I.i,j(I)},onStartDragOrResize:()=>{x(!0)},onStopDragOrResize:()=>{x(!1)}})]},U.id))})})})})]}),A.jsx(nle,{open:T,selectModuleData:C,onClose:()=>{E(!1)},onOk:({id:U,customData:I,customeStyle:Y})=>{U?W(U,{type:"statistics",customData:I,customeStyle:Y}):j({type:"statistics",customData:I,customeStyle:Y}),E(!1)},moduleDataApi:n,enumDataApi:i}),A.jsx(ale,{open:R,selectModuleData:C,onClose:()=>{M(!1)},onOk:({id:U,customData:I})=>{U?W(U,{type:"calendar",customData:I}):j({type:"calendar",customData:I}),M(!1)},moduleDataApi:n,enumDataApi:i}),A.jsx(vle,{open:P,selectModuleData:C,onClose:()=>{B(!1)},onOk:({id:U,type:I,customData:Y,customeStyle:z})=>{U?W(U,{type:I,customData:Y,customeStyle:z}):j({type:I,customData:Y,customeStyle:z}),B(!1)},moduleDataApi:n,enumDataApi:i})]})},xle=N.memo(t=>A.jsx(gG,{children:A.jsx(wle,{...t})}));Yt.PivotTable=xle,Object.defineProperty(Yt,Symbol.toStringTag,{value:"Module"})});
|
|
178
|
+
`)),Ke(n)),a.push({dimIdx:m.index,parser:y,comparator:new vR(d,v)})});var o=e.sourceFormat;o!==mr&&o!==fn&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),Ke(n));for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(f,c){for(var d=0;d<a.length;d++){var h=a[d],v=e.retrieveValueFromItem(f,h.dimIdx),g=e.retrieveValueFromItem(c,h.dimIdx);h.parser&&(v=h.parser(v),g=h.parser(g));var p=h.comparator.evaluate(v,g);if(p!==0)return p}return 0}),{data:s}}};function Mne(t){t.registerTransform(One),t.registerTransform(Rne)}var Pne=function(t){ve(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,n,i){t.prototype.init.call(this,r,n,i),this._sourceManager=new _R(this),CR(this)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),CR(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:ti},e}(rt),Bne=function(t){ve(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(qr);function Ine(t){t.registerComponentModel(Pne),t.registerComponentView(Bne)}var oi=Oi.CMD;function Cl(t,e){return Math.abs(t-e)<1e-5}function R1(t){var e=t.data,r=t.len(),n=[],i,a=0,o=0,s=0,l=0;function u(M,P){i&&i.length>2&&n.push(i),i=[M,P]}function f(M,P,B,F){Cl(M,B)&&Cl(P,F)||i.push(M,P,B,F,B,F)}function c(M,P,B,F,H,j){var W=Math.abs(P-M),L=Math.tan(W/4)*4/3,q=P<M?-1:1,J=Math.cos(M),ee=Math.sin(M),ae=Math.cos(P),U=Math.sin(P),I=J*H+B,Y=ee*j+F,z=ae*H+B,G=U*j+F,Q=H*L*q,K=j*L*q;i.push(I-Q*ee,Y+K*J,z+Q*U,G-K*ae,z,G)}for(var d,h,v,g,p=0;p<r;){var m=e[p++],y=p===1;switch(y&&(a=e[p],o=e[p+1],s=a,l=o,(m===oi.L||m===oi.C||m===oi.Q)&&(i=[s,l])),m){case oi.M:a=s=e[p++],o=l=e[p++],u(s,l);break;case oi.L:d=e[p++],h=e[p++],f(a,o,d,h),a=d,o=h;break;case oi.C:i.push(e[p++],e[p++],e[p++],e[p++],a=e[p++],o=e[p++]);break;case oi.Q:d=e[p++],h=e[p++],v=e[p++],g=e[p++],i.push(a+2/3*(d-a),o+2/3*(h-o),v+2/3*(d-v),g+2/3*(h-g),v,g),a=v,o=g;break;case oi.A:var b=e[p++],C=e[p++],_=e[p++],w=e[p++],x=e[p++],D=e[p++]+x;p+=1;var S=!e[p++];d=Math.cos(x)*_+b,h=Math.sin(x)*w+C,y?(s=d,l=h,u(s,l)):f(a,o,d,h),a=Math.cos(D)*_+b,o=Math.sin(D)*w+C;for(var T=(S?-1:1)*Math.PI/2,E=x;S?E>D:E<D;E+=T){var R=S?Math.max(E+T,D):Math.min(E+T,D);c(E,R,b,C,_,w)}break;case oi.R:s=a=e[p++],l=o=e[p++],d=s+e[p++],h=l+e[p++],u(d,l),f(d,l,d,h),f(d,h,s,h),f(s,h,s,l),f(s,l,d,l);break;case oi.Z:i&&f(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&n.push(i),n}function M1(t,e,r,n,i,a,o,s,l,u){if(Cl(t,r)&&Cl(e,n)&&Cl(i,o)&&Cl(a,s)){l.push(o,s);return}var f=2/u,c=f*f,d=o-t,h=s-e,v=Math.sqrt(d*d+h*h);d/=v,h/=v;var g=r-t,p=n-e,m=i-o,y=a-s,b=g*g+p*p,C=m*m+y*y;if(b<c&&C<c){l.push(o,s);return}var _=d*g+h*p,w=-d*m-h*y,x=b-_*_,D=C-w*w;if(x<c&&_>=0&&D<c&&w>=0){l.push(o,s);return}var S=[],T=[];ia(t,r,i,o,.5,S),ia(e,n,a,s,.5,T),M1(S[0],T[0],S[1],T[1],S[2],T[2],S[3],T[3],l,u),M1(S[4],T[4],S[5],T[5],S[6],T[6],S[7],T[7],l,u)}function Nne(t,e){var r=R1(t),n=[];e=e||1;for(var i=0;i<r.length;i++){var a=r[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var f=a[u++],c=a[u++],d=a[u++],h=a[u++],v=a[u++],g=a[u++];M1(s,l,f,c,d,h,v,g,o,e),s=v,l=g}n.push(o)}return n}function CI(t,e,r){var n=t[e],i=t[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*r)),s=Math.floor(r/o);s===0&&(s=1,o=r);for(var l=[],u=0;u<o;u++)l.push(s);var f=o*s,c=r-f;if(c>0)for(var u=0;u<c;u++)l[u%o]+=1;return l}function wI(t,e,r){for(var n=t.r0,i=t.r,a=t.startAngle,o=t.endAngle,s=Math.abs(o-a),l=s*i,u=i-n,f=l>Math.abs(u),c=CI([l,u],f?0:1,e),d=(f?s:u)/c.length,h=0;h<c.length;h++)for(var v=(f?u:s)/c[h],g=0;g<c[h];g++){var p={};f?(p.startAngle=a+d*h,p.endAngle=a+d*(h+1),p.r0=n+v*g,p.r=n+v*(g+1)):(p.startAngle=a+v*g,p.endAngle=a+v*(g+1),p.r0=n+d*h,p.r=n+d*(h+1)),p.clockwise=t.clockwise,p.cx=t.cx,p.cy=t.cy,r.push(p)}}function Fne(t,e,r){for(var n=t.width,i=t.height,a=n>i,o=CI([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",f=a?"y":"x",c=t[s]/o.length,d=0;d<o.length;d++)for(var h=t[l]/o[d],v=0;v<o[d];v++){var g={};g[u]=d*c,g[f]=v*h,g[s]=c,g[l]=h,g.x+=t.x,g.y+=t.y,r.push(g)}}function xI(t,e,r,n){return t*n-r*e}function Lne(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,f=o-i,c=s-a,d=xI(f,c,l,u);if(Math.abs(d)<1e-6)return null;var h=t-i,v=e-a,g=xI(h,v,f,c)/d;return g<0||g>1?null:new Ee(g*l+t,g*u+e)}function kne(t,e,r){var n=new Ee;Ee.sub(n,r,e),n.normalize();var i=new Ee;Ee.sub(i,t,e);var a=i.dot(n);return a}function wl(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function jne(t,e,r){for(var n=t.length,i=[],a=0;a<n;a++){var o=t[a],s=t[(a+1)%n],l=Lne(o[0],o[1],s[0],s[1],e.x,e.y,r.x,r.y);l&&i.push({projPt:kne(l,e,r),pt:l,idx:a})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(p,m){return p.projPt-m.projPt});var u=i[0],f=i[i.length-1];if(f.idx<u.idx){var c=u;u=f,f=c}for(var d=[u.pt.x,u.pt.y],h=[f.pt.x,f.pt.y],v=[d],g=[h],a=u.idx+1;a<=f.idx;a++)wl(v,t[a].slice());wl(v,h),wl(v,d);for(var a=f.idx+1;a<=u.idx+n;a++)wl(g,t[a%n].slice());return wl(g,d),wl(g,h),[{points:v},{points:g}]}function DI(t){var e=t.points,r=[],n=[];XT(e,r,n);var i=new Ze(r[0],r[1],n[0]-r[0],n[1]-r[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new Ee,f=new Ee;return a>o?(u.x=f.x=s+a/2,u.y=l,f.y=l+o):(u.y=f.y=l+o/2,u.x=s,f.x=s+a),jne(e,u,f)}function Av(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);Av(t,a[0],i,n),Av(t,a[1],r-i,n)}return n}function zne(t,e){for(var r=[],n=0;n<e;n++)r.push(gy(t));return r}function Hne(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function Vne(t){for(var e=[],r=0;r<t.length;)e.push([t[r++],t[r++]]);return e}function Wne(t,e){var r=[],n=t.shape,i;switch(t.type){case"rect":Fne(n,e,r),i=Nt;break;case"sector":wI(n,e,r),i=Jn;break;case"circle":wI({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,r),i=Jn;break;default:var a=t.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=we(Nne(t.getUpdatedPathProxy(),o),function(m){return Vne(m)}),l=s.length;if(l===0)Av(DI,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var f=0,c=we(s,function(m){var y=[],b=[];XT(m,y,b);var C=(b[1]-y[1])*(b[0]-y[0]);return f+=C,{poly:m,area:C}});c.sort(function(m,y){return y.area-m.area});for(var d=e,u=0;u<l;u++){var h=c[u];if(d<=0)break;var v=u===l-1?d:Math.ceil(h.area/f*e);v<0||(Av(DI,{points:h.poly},v,r),d-=v)}}i=ch;break}if(!i)return zne(t,e);for(var g=[],u=0;u<r.length;u++){var p=new i;p.setShape(r[u]),Hne(t,p),g.push(p)}return g}function $ne(t,e){var r=t.length,n=e.length;if(r===n)return[t,e];for(var i=[],a=[],o=r<n?t:e,s=Math.min(r,n),l=Math.abs(n-r)/6,u=(s-2)/6,f=Math.ceil(l/u)+1,c=[o[0],o[1]],d=l,h=2;h<s;){var v=o[h-2],g=o[h-1],p=o[h++],m=o[h++],y=o[h++],b=o[h++],C=o[h++],_=o[h++];if(d<=0){c.push(p,m,y,b,C,_);continue}for(var w=Math.min(d,f-1)+1,x=1;x<=w;x++){var D=x/w;ia(v,p,y,C,D,i),ia(g,m,b,_,D,a),v=i[3],g=a[3],c.push(i[1],a[1],i[2],a[2],v,g),p=i[5],m=a[5],y=i[6],b=a[6]}d-=w-1}return o===t?[c,e]:[t,c]}function SI(t,e){for(var r=t.length,n=t[r-2],i=t[r-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function Gne(t,e){for(var r,n,i,a=[],o=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],f=void 0,c=void 0;l?u?(r=$ne(l,u),f=r[0],c=r[1],n=f,i=c):(c=SI(i||l,l),f=l):(f=SI(n||u,u),c=u),a.push(f),o.push(c)}return[a,o]}function EI(t){for(var e=0,r=0,n=0,i=t.length,a=0,o=i-2;a<i;o=a,a+=2){var s=t[o],l=t[o+1],u=t[a],f=t[a+1],c=s*f-u*l;e+=c,r+=(s+u)*c,n+=(l+f)*c}return e===0?[t[0]||0,t[1]||0]:[r/e/3,n/e/3,e]}function Une(t,e,r,n){for(var i=(t.length-2)/6,a=1/0,o=0,s=t.length,l=s-2,u=0;u<i;u++){for(var f=u*6,c=0,d=0;d<s;d+=2){var h=d===0?f:(f+d-2)%l+2,v=t[h]-r[0],g=t[h+1]-r[1],p=e[d]-n[0],m=e[d+1]-n[1],y=p-v,b=m-g;c+=y*y+b*b}c<a&&(a=c,o=u)}return o}function qne(t){for(var e=[],r=t.length,n=0;n<r;n+=2)e[n]=t[r-n-2],e[n+1]=t[r-n-1];return e}function Yne(t,e,r,n){for(var i=[],a,o=0;o<t.length;o++){var s=t[o],l=e[o],u=EI(s),f=EI(l);a==null&&(a=u[2]<0!=f[2]<0);var c=[],d=[],h=0,v=1/0,g=[],p=s.length;a&&(s=qne(s));for(var m=Une(s,l,u,f)*6,y=p-2,b=0;b<y;b+=2){var C=(m+b)%y+2;c[b+2]=s[C]-u[0],c[b+3]=s[C+1]-u[1]}c[0]=s[m]-u[0],c[1]=s[m+1]-u[1];for(var _=n/r,w=-n/2;w<=n/2;w+=_){for(var x=Math.sin(w),D=Math.cos(w),S=0,b=0;b<s.length;b+=2){var T=c[b],E=c[b+1],R=l[b]-f[0],M=l[b+1]-f[1],P=R*D-M*x,B=R*x+M*D;g[b]=P,g[b+1]=B;var F=P-T,H=B-E;S+=F*F+H*H}if(S<v){v=S,h=w;for(var j=0;j<g.length;j++)d[j]=g[j]}}i.push({from:c,to:d,fromCp:u,toCp:f,rotation:-h})}return i}function Tv(t){return t.__isCombineMorphing}var AI="__mOriginal_";function Ov(t,e,r){var n=AI+e,i=t[n]||t[e];t[n]||(t[n]=t[e]);var a=r.replace,o=r.after,s=r.before;t[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function Ef(t,e){var r=AI+e;t[r]&&(t[e]=t[r],t[r]=null)}function TI(t,e){for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function OI(t,e){var r=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=Gne(R1(r),R1(n)),a=i[0],o=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&TI(a,s),l&&TI(o,l),Ov(e,"updateTransform",{replace:u}),e.transform=null;var f=Yne(a,o,10,Math.PI),c=[];Ov(e,"buildPath",{replace:function(d){for(var h=e.__morphT,v=1-h,g=[],p=0;p<f.length;p++){var m=f[p],y=m.from,b=m.to,C=m.rotation*h,_=m.fromCp,w=m.toCp,x=Math.sin(C),D=Math.cos(C);yd(g,_,w,h);for(var S=0;S<y.length;S+=2){var T=y[S],E=y[S+1],R=b[S],M=b[S+1],P=T*v+R*h,B=E*v+M*h;c[S]=P*D-B*x+g[0],c[S+1]=P*x+B*D+g[1]}var F=c[0],H=c[1];d.moveTo(F,H);for(var S=2;S<y.length;){var R=c[S++],M=c[S++],j=c[S++],W=c[S++],L=c[S++],q=c[S++];F===R&&H===M&&j===L&&W===q?d.lineTo(L,q):d.bezierCurveTo(R,M,j,W,L,q),F=L,H=q}}}})}function P1(t,e,r){if(!t||!e)return e;var n=r.done,i=r.during;OI(t,e),e.__morphT=0;function a(){Ef(e,"buildPath"),Ef(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},$e({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},r)),e}function Xne(t,e,r,n,i,a){var o=16;t=i===r?0:Math.round(32767*(t-r)/(i-r)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var f=0,c=0;(t&u)>0&&(f=1),(e&u)>0&&(c=1),s+=u*u*(3*f^c),c===0&&(f===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function Rv(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=we(t,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),f=l.x+l.width/2+(u?u[4]:0),c=l.y+l.height/2+(u?u[5]:0);return e=Math.min(f,e),r=Math.min(c,r),n=Math.max(f,n),i=Math.max(c,i),[f,c]}),o=we(a,function(s,l){return{cp:s,z:Xne(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function RI(t){return Wne(t.path,t.count)}function B1(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Zne(t,e,r){var n=[];function i(_){for(var w=0;w<_.length;w++){var x=_[w];Tv(x)?i(x.childrenRef()):x instanceof Ge&&n.push(x)}}i(t);var a=n.length;if(!a)return B1();var o=r.dividePath||RI,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),B1();n=Rv(n),s=Rv(s);for(var l=r.done,u=r.during,f=r.individualDelay,c=new Ou,d=0;d<a;d++){var h=n[d],v=s[d];v.parent=e,v.copyTransform(c),f||OI(h,v)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function g(_){for(var w=0;w<s.length;w++)s[w].addSelfToZr(_)}Ov(e,"addSelfToZr",{after:function(_){g(_)}}),Ov(e,"removeSelfFromZr",{after:function(_){for(var w=0;w<s.length;w++)s[w].removeSelfFromZr(_)}});function p(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,Ef(e,"addSelfToZr"),Ef(e,"removeSelfFromZr")}var m=s.length;if(f)for(var y=m,b=function(){y--,y===0&&(p(),l&&l())},d=0;d<m;d++){var C=f?$e({delay:(r.delay||0)+f(d,m,n[d],s[d]),done:b},r):r;P1(n[d],s[d],C)}else e.__morphT=0,e.animateTo({__morphT:1},$e({during:function(_){for(var w=0;w<m;w++){var x=s[w];x.__morphT=e.__morphT,x.dirtyShape()}u&&u(_)},done:function(){p();for(var _=0;_<t.length;_++)Ef(t[_],"updateTransform");l&&l()}},r));return e.__zr&&g(e.__zr),{fromIndividuals:n,toIndividuals:s,count:m}}function Kne(t,e,r){var n=e.length,i=[],a=r.dividePath||RI;function o(h){for(var v=0;v<h.length;v++){var g=h[v];Tv(g)?o(g.childrenRef()):g instanceof Ge&&i.push(g)}}if(Tv(t)){o(t.childrenRef());var s=i.length;if(s<n)for(var l=0,u=s;u<n;u++)i.push(gy(i[l++%s]));i.length=n}else{i=a({path:t,count:n});for(var f=t.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(f);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),B1()}i=Rv(i),e=Rv(e);for(var c=r.individualDelay,u=0;u<n;u++){var d=c?$e({delay:(r.delay||0)+c(u,n,i[u],e[u])},r):r;P1(i[u],e[u],d)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function MI(t){return ge(t[0])}function PI(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push({one:t[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)r[o%n].many.push(e[i][o])}for(var s=0,i=n-1;i>=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var Qne={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var i=gy(t.path);i.setStyle("opacity",r),e.push(i)}return e},split:null};function I1(t,e,r,n,i,a){if(!t.length||!e.length)return;var o=Js("update",n,i);if(!(o&&o.duration>0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,f;MI(t)&&(u=t,f=e),MI(e)&&(u=e,f=t);function c(m,y,b,C,_){var w=m.many,x=m.one;if(w.length===1&&!_){var D=y?w[0]:x,S=y?x:w[0];if(Tv(D))c({many:[D],one:S},!0,b,C,!0);else{var T=s?$e({delay:s(b,C)},l):l;P1(D,S,T),a(D,S,D,S,T)}}else for(var E=$e({dividePath:Qne[r],individualDelay:s&&function(H,j,W,L){return s(H+b,C)}},l),R=y?Zne(w,x,E):Kne(x,w,E),M=R.fromIndividuals,P=R.toIndividuals,B=M.length,F=0;F<B;F++){var T=s?$e({delay:s(F,B)},l):l;a(M[F],P[F],y?w[F]:m.one,y?m.one:w[F],T)}}for(var d=u?u===t:t.length>e.length,h=u?PI(f,u):PI(d?e:t,[d?t:e]),v=0,g=0;g<h.length;g++)v+=h[g].many.length;for(var p=0,g=0;g<h.length;g++)c(h[g],d,p,v),p+=h[g].many.length}function Xo(t){if(!t)return[];if(ge(t)){for(var e=[],r=0;r<t.length;r++)e.push(Xo(t[r]));return e}var n=[];return t.traverse(function(i){i instanceof Ge&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var BI=1e4,Jne=0,II=1,NI=2,eie=gt();function tie(t,e){for(var r=t.dimensions,n=0;n<r.length;n++){var i=t.getDimensionInfo(r[n]);if(i&&i.otherDims[e]===0)return r[n]}}function rie(t,e,r){var n=t.getDimensionInfo(r),i=n&&n.ordinalMeta;if(n){var a=t.get(n.name,e);return i&&i.categories[a]||a+""}}function FI(t,e,r,n){var i=n?"itemChildGroupId":"itemGroupId",a=tie(t,i);if(a){var o=rie(t,e,a);return o}var s=t.getRawDataItem(e),l=n?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!n)return r||t.getId(e)}function LI(t){var e=[];return k(t,function(r){var n=r.data,i=r.dataGroupId;if(n.count()>BI){process.env.NODE_ENV!=="production"&&It("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:FI(n,o,i,!1),childGroupId:FI(n,o,i,!0),divide:r.divide,dataIndex:o})}),e}function N1(t,e,r){t.traverse(function(n){n instanceof Ge&&sr(n,{style:{opacity:0}},e,{dataIndex:r,isFrom:!0})})}function F1(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function xl(t){t.stopAnimation(),t.isGroup&&t.traverse(function(e){e.stopAnimation()})}function nie(t,e,r){var n=Js("update",r,e);n&&t.traverse(function(i){if(i instanceof la){var a=fX(i);a&&i.animateFrom({style:a},n)}})}function iie(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++){var i=t[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function kI(t,e,r){var n=LI(t),i=LI(e);function a(b,C,_,w,x){(_||b)&&C.animateFrom({style:_&&_!==b?le(le({},_.style),b.style):b.style},x)}var o=!1,s=Jne,l=Be(),u=Be();n.forEach(function(b){b.groupId&&l.set(b.groupId,!0),b.childGroupId&&u.set(b.childGroupId,!0)});for(var f=0;f<i.length;f++){var c=i[f].groupId;if(u.get(c)){s=II;break}var d=i[f].childGroupId;if(d&&l.get(d)){s=NI;break}}function h(b,C){return function(_){var w=_.data,x=_.dataIndex;return C?w.getId(x):b?s===II?_.childGroupId:_.groupId:s===NI?_.childGroupId:_.groupId}}var v=iie(n,i),g={};if(!v)for(var f=0;f<i.length;f++){var p=i[f],m=p.data.getItemGraphicEl(p.dataIndex);m&&(g[m.id]=!0)}function y(b,C){var _=n[C],w=i[b],x=w.data.hostModel,D=_.data.getItemGraphicEl(_.dataIndex),S=w.data.getItemGraphicEl(w.dataIndex);if(D===S){S&&nie(S,w.dataIndex,x);return}D&&g[D.id]||S&&(xl(S),D?(xl(D),F1(D),o=!0,I1(Xo(D),Xo(S),w.divide,x,b,a)):N1(S,x,b))}new Rb(n,i,h(!0,v),h(!1,v),null,"multiple").update(y).updateManyToOne(function(b,C){var _=i[b],w=_.data,x=w.hostModel,D=w.getItemGraphicEl(_.dataIndex),S=Tt(we(C,function(T){return n[T].data.getItemGraphicEl(n[T].dataIndex)}),function(T){return T&&T!==D&&!g[T.id]});D&&(xl(D),S.length?(k(S,function(T){xl(T),F1(T)}),o=!0,I1(Xo(S),Xo(D),_.divide,x,b,a)):N1(D,x,_.dataIndex))}).updateOneToMany(function(b,C){var _=n[C],w=_.data.getItemGraphicEl(_.dataIndex);if(!(w&&g[w.id])){var x=Tt(we(b,function(S){return i[S].data.getItemGraphicEl(i[S].dataIndex)}),function(S){return S&&S!==w}),D=i[b[0]].data.hostModel;x.length&&(k(x,function(S){return xl(S)}),w?(xl(w),F1(w),o=!0,I1(Xo(w),Xo(x),_.divide,D,b[0],a)):k(x,function(S){return N1(S,D,b[0])}))}}).updateManyToMany(function(b,C){new Rb(C,b,function(_){return n[_].data.getId(n[_].dataIndex)},function(_){return i[_].data.getId(i[_].dataIndex)}).update(function(_,w){y(b[_],C[w])}).execute()}).execute(),o&&k(e,function(b){var C=b.data,_=C.hostModel,w=_&&r.getViewOfSeriesModel(_),x=Js("update",_,0);w&&_.isAnimationEnabled()&&x&&x.duration>0&&w.group.traverse(function(D){D instanceof Ge&&!D.animators.length&&D.animateFrom({style:{opacity:0}},x)})})}function jI(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function zI(t){return ge(t)?t.sort().join(","):t}function Sa(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function aie(t,e){var r=Be(),n=Be(),i=Be();k(t.oldSeries,function(o,s){var l=t.oldDataGroupIds[s],u=t.oldData[s],f=jI(o),c=zI(f);n.set(c,{dataGroupId:l,data:u}),ge(f)&&k(f,function(d){i.set(d,{key:c,dataGroupId:l,data:u})})});function a(o){r.get(o)&&It("Duplicated seriesKey in universalTransition "+o)}return k(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=jI(o),f=zI(u),c=n.get(f);if(c)process.env.NODE_ENV!=="production"&&a(f),r.set(f,{oldSeries:[{dataGroupId:c.dataGroupId,divide:Sa(c.data),data:c.data}],newSeries:[{dataGroupId:s,divide:Sa(l),data:l}]});else if(ge(u)){process.env.NODE_ENV!=="production"&&a(f);var d=[];k(u,function(g){var p=n.get(g);p.data&&d.push({dataGroupId:p.dataGroupId,divide:Sa(p.data),data:p.data})}),d.length&&r.set(f,{oldSeries:d,newSeries:[{dataGroupId:s,data:l,divide:Sa(l)}]})}else{var h=i.get(u);if(h){var v=r.get(h.key);v||(v={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:Sa(h.data)}],newSeries:[]},r.set(h.key,v)),v.newSeries.push({dataGroupId:s,data:l,divide:Sa(l)})}}}}),r}function HI(t,e){for(var r=0;r<t.length;r++){var n=e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id;if(n)return r}}function oie(t,e,r,n){var i=[],a=[];k(xt(t.from),function(o){var s=HI(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:Sa(e.oldData[s]),groupIdDim:o.dimension})}),k(xt(t.to),function(o){var s=HI(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:Sa(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&kI(i,a,n)}function sie(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){k(xt(n.seriesTransition),function(i){k(xt(i.to),function(a){for(var o=n.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][Vh]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(e,r,n){var i=eie(r);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)k(xt(a),function(h){oie(h,i,n,r)});else{var o=aie(i,n);k(o.keys(),function(h){var v=o.get(h);kI(v.oldSeries,v.newSeries,r)})}k(n.updatedSeries,function(h){h[Vh]&&(h[Vh]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],f=i.oldData=[],c=0;c<s.length;c++){var d=s[c].getData();d.count()<BI&&(l.push(s[c]),u.push(s[c].get("dataGroupId")),f.push(d))}})}function VI(t,e,r){var n=Ts.createCanvas(),i=e.getWidth(),a=e.getHeight(),o=n.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=i+"px",o.height=a+"px",n.setAttribute("data-zr-dom-id",t)),n.width=i*r,n.height=a*r,n}var L1=function(t){ve(e,t);function e(r,n,i){var a=t.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var o;i=i||jd,typeof r=="string"?o=VI(r,n,i):De(r)&&(o=r,r=o.id),a.id=r,a.dom=o;var s=o.style;return s&&(EA(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),a.painter=n,a.dpr=i,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=VI("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,n,i,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,u=new Ze(0,0,0,0);function f(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var b=new Ze(0,0,0,0);b.copy(y),o.push(b)}else{for(var C=!1,_=1/0,w=0,x=0;x<o.length;++x){var D=o[x];if(D.intersect(y)){var S=new Ze(0,0,0,0);S.copy(D),S.union(y),o[x]=S,C=!0;break}else if(l){u.copy(y),u.union(D);var T=y.width*y.height,E=D.width*D.height,R=u.width*u.height,M=R-T-E;M<_&&(_=M,w=x)}}if(l&&(o[w].union(y),C=!0),!C){var b=new Ze(0,0,0,0);b.copy(y),o.push(b)}l||(l=o.length>=s)}}for(var c=this.__startIndex;c<this.__endIndex;++c){var d=r[c];if(d){var h=d.shouldBePainted(i,a,!0,!0),v=d.__isRendered&&(d.__dirty&Gr||!h)?d.getPrevPaintRect():null;v&&f(v);var g=h&&(d.__dirty&Gr||!d.__isRendered)?d.getPaintRect():null;g&&f(g)}}for(var c=this.__prevStartIndex;c<this.__prevEndIndex;++c){var d=n[c],h=d&&d.shouldBePainted(i,a,!0,!0);if(d&&(!h||!d.__zr)&&d.__isRendered){var v=d.getPrevPaintRect();v&&f(v)}}var p;do{p=!1;for(var c=0;c<o.length;){if(o[c].isZero()){o.splice(c,1);continue}for(var m=c+1;m<o.length;)o[c].intersect(o[m])?(p=!0,o[c].union(o[m]),o.splice(m,1)):m++;c++}}while(p);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,n){var i=this.dpr,a=this.dom,o=a.style,s=this.domBack;o&&(o.width=r+"px",o.height=n+"px"),a.width=r*i,a.height=n*i,s&&(s.width=r*i,s.height=n*i,i!==1&&this.ctxBack.scale(i,i))},e.prototype.clear=function(r,n,i){var a=this.dom,o=this.ctx,s=a.width,l=a.height;n=n||this.clearColor;var u=this.motionBlur&&!r,f=this.lastFrameAlpha,c=this.dpr,d=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(a,0,0,s/c,l/c));var h=this.domBack;function v(g,p,m,y){if(o.clearRect(g,p,m,y),n&&n!=="transparent"){var b=void 0;if(pd(n)){var C=n.global||n.__width===m&&n.__height===y;b=C&&n.__canvasGradient||cb(o,n,{x:0,y:0,width:m,height:y}),n.__canvasGradient=b,n.__width=m,n.__height=y}else IG(n)&&(n.scaleX=n.scaleX||c,n.scaleY=n.scaleY||c,b=db(o,n,{dirty:function(){d.setUnpainted(),d.painter.refresh()}}));o.save(),o.fillStyle=b||n,o.fillRect(g,p,m,y),o.restore()}u&&(o.save(),o.globalAlpha=f,o.drawImage(h,g,p,m,y),o.restore())}!i||u?v(0,0,s,l):i.length&&k(i,function(g){v(g.x*c,g.y*c,g.width*c,g.height*c)})},e}($n),WI=1e5,Zo=314159,Mv=.01,lie=.001;function uie(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function fie(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var cie=function(){function t(e,r,n,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var a=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=n=le({},n||{}),this.dpr=n.devicePixelRatio||jd,this._singleCanvas=a,this.root=e;var o=e.style;o&&(EA(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(a){var f=e,c=f.width,d=f.height;n.width!=null&&(c=n.width),n.height!=null&&(d=n.height),this.dpr=n.devicePixelRatio||1,f.width=c*this.dpr,f.height=d*this.dpr,this._width=c,this._height=d;var h=new L1(f,this,this.dpr);h.__builtin__=!0,h.initContext(),l[Zo]=h,h.zlevel=Zo,s.push(Zo),this._domRoot=e}else{this._width=Yh(e,0,n),this._height=Yh(e,1,n);var u=this._domRoot=fie(this._width,this._height);e.appendChild(u)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),n=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,n,e,this._redrawId);for(var a=0;a<i.length;a++){var o=i[a],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=a===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,n=this._hoverlayer;if(n&&n.clear(),!!r){for(var i={inHover:!0,viewWidth:this._width,viewHeight:this._height},a,o=0;o<r;o++){var s=e[o];s.__inHover&&(n||(n=this._hoverlayer=this.getLayer(WI)),a||(a=n.ctx,a.save()),Vo(a,s,i,o===r-1))}a&&a.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(WI)},t.prototype.paintOne=function(e,r){cM(e,r)},t.prototype._paintList=function(e,r,n,i){if(this._redrawId===i){n=n||!1,this._updateLayerStatus(e);var a=this._doPaintList(e,r,n),o=a.finished,s=a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;xd(function(){l._paintList(e,r,n,i)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(Zo).ctx,r=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,r,n),this.eachBuiltinLayer(function(i){i.virtual&&e.drawImage(i.dom,0,0,r,n)})},t.prototype._doPaintList=function(e,r,n){for(var i=this,a=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||n)&&a.push(u)}for(var f=!0,c=!1,d=function(g){var p=a[g],m=p.ctx,y=o&&p.createRepaintRects(e,r,h._width,h._height),b=n?p.__startIndex:p.__drawIndex,C=!n&&p.incremental&&Date.now,_=C&&Date.now(),w=p.zlevel===h._zlevelList[0]?h._backgroundColor:null;if(p.__startIndex===p.__endIndex)p.clear(!1,w,y);else if(b===p.__startIndex){var x=e[b];(!x.incremental||!x.notClear||n)&&p.clear(!1,w,y)}b===-1&&(console.error("For some unknown reason. drawIndex is -1"),b=p.__startIndex);var D,S=function(M){var P={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(D=b;D<p.__endIndex;D++){var B=e[D];if(B.__inHover&&(c=!0),i._doPaintEl(B,p,o,M,P,D===p.__endIndex-1),C){var F=Date.now()-_;if(F>15)break}}P.prevElClipPaths&&m.restore()};if(y)if(y.length===0)D=p.__endIndex;else for(var T=h.dpr,E=0;E<y.length;++E){var R=y[E];m.save(),m.beginPath(),m.rect(R.x*T,R.y*T,R.width*T,R.height*T),m.clip(),S(R),m.restore()}else m.save(),S(),m.restore();p.__drawIndex=D,p.__drawIndex<p.__endIndex&&(f=!1)},h=this,v=0;v<a.length;v++)d(v);return Fe.wxa&&k(this._layers,function(g){g&&g.ctx&&g.ctx.draw&&g.ctx.draw()}),{finished:f,needsRefreshHover:c}},t.prototype._doPaintEl=function(e,r,n,i,a,o){var s=r.ctx;if(n){var l=e.getPaintRect();(!i||l&&l.intersect(i))&&(Vo(s,e,a,o),e.setPrevPaintRect(l))}else Vo(s,e,a,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Zo);var n=this._layers[e];return n||(n=new L1("zr_"+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?ot(n,this._layerConfig[e],!0):this._layerConfig[e-Mv]&&ot(n,this._layerConfig[e-Mv],!0),r&&(n.virtual=r),this.insertLayer(e,n),n.initContext()),n},t.prototype.insertLayer=function(e,r){var n=this._layers,i=this._zlevelList,a=i.length,o=this._domRoot,s=null,l=-1;if(n[e]){process.env.NODE_ENV!=="production"&&fo("ZLevel "+e+" has been used already");return}if(!uie(r)){process.env.NODE_ENV!=="production"&&fo("Layer of zlevel "+e+" is not valid");return}if(a>0&&e>i[0]){for(l=0;l<a-1&&!(i[l]<e&&i[l+1]>e);l++);s=n[i[l]]}if(i.splice(l+1,0,e),n[e]=r,!r.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(r.dom,u.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)},t.prototype.eachLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i];e.call(r,this._layers[a],a)}},t.prototype.eachBuiltinLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__&&e.call(r,o,a)}},t.prototype.eachOtherLayer=function(e,r){for(var n=this._zlevelList,i=0;i<n.length;i++){var a=n[i],o=this._layers[a];o.__builtin__||e.call(r,o,a)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(c,d){c.__dirty=c.__used=!1});function r(c){a&&(a.__endIndex!==c&&(a.__dirty=!0),a.__endIndex=c)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var i=e[n];if(i.zlevel!==e[n-1].zlevel||i.incremental){this._needsManuallyCompositing=!0;break}}var a=null,o=0,s,l;for(l=0;l<e.length;l++){var i=e[l],u=i.zlevel,f=void 0;s!==u&&(s=u,o=0),i.incremental?(f=this.getLayer(u+lie,this._needsManuallyCompositing),f.incremental=!0,o=1):f=this.getLayer(u+(o>0?Mv:0),this._needsManuallyCompositing),f.__builtin__||fo("ZLevel "+u+" has been used by unkown layer "+f.id),f!==a&&(f.__used=!0,f.__startIndex!==l&&(f.__dirty=!0),f.__startIndex=l,f.incremental?f.__drawIndex=-1:f.__drawIndex=l,r(l),a=f),i.__dirty&Gr&&!i.__inHover&&(f.__dirty=!0,f.incremental&&f.__drawIndex<0&&(f.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(c,d){!c.__used&&c.getElementCount()>0&&(c.__dirty=!0,c.__startIndex=c.__endIndex=c.__drawIndex=0),c.__dirty&&c.__drawIndex<0&&(c.__drawIndex=c.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,k(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?ot(n[e],r,!0):n[e]=r;for(var i=0;i<this._zlevelList.length;i++){var a=this._zlevelList[i];if(a===e||a===e+Mv){var o=this._layers[a];ot(o,n[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,n=this._zlevelList,i=r[e];i&&(i.dom.parentNode.removeChild(i.dom),delete r[e],n.splice(Xe(n,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,a=this.root;if(e!=null&&(i.width=e),r!=null&&(i.height=r),e=Yh(a,0,i),r=Yh(a,1,i),n.style.display="",this._width!==e||r!==this._height){n.style.width=e+"px",n.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer(Zo).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[Zo].dom;var r=new L1("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var i=r.dom.width,a=r.dom.height;this.eachLayer(function(c){c.__builtin__?n.drawImage(c.dom,0,0,i,a):c.renderToCanvas&&(n.save(),c.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){var f=s[l];Vo(n,f,o,l===u-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}();function die(t){t.registerPainter("canvas",cie)}ya([jre,yne,lne,ane,Rre,Ine,Mne,ete,jee,hte,pee,sie,die]);const hie=N.memo(({options:t,echartRef:e})=>{const r=N.useRef(null),n=N.useRef(null);return N.useEffect(()=>(r.current&&(n.current=IQ(r.current)),()=>{n.current&&n.current.dispose()}),[]),N.useEffect(()=>{n.current&&(n.current.clear(),t&&Object.keys(t).length>0&&n.current.setOption({...t}))},[t]),N.useImperativeHandle(e,()=>({resize:()=>{n.current&&n.current.resize()},getWidth:()=>{n.current&&n.current.getWidth()}})),A.jsx("div",{ref:r,style:{width:"100%",height:"100%"}})}),ke=t=>typeof t=="string",Af=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},$I=t=>t==null?"":""+t,vie=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},pie=/###/g,GI=t=>t&&t.indexOf("###")>-1?t.replace(pie,"."):t,UI=t=>!t||ke(t),Tf=(t,e,r)=>{const n=ke(e)?e.split("."):e;let i=0;for(;i<n.length-1;){if(UI(t))return{};const a=GI(n[i]);!t[a]&&r&&(t[a]=new r),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++i}return UI(t)?{}:{obj:t,k:GI(n[i])}},qI=(t,e,r)=>{const{obj:n,k:i}=Tf(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let a=e[e.length-1],o=e.slice(0,e.length-1),s=Tf(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Tf(t,o,Object),s&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},gie=(t,e,r,n)=>{const{obj:i,k:a}=Tf(t,e,Object);i[a]=i[a]||[],i[a].push(r)},Pv=(t,e)=>{const{obj:r,k:n}=Tf(t,e);if(r)return r[n]},mie=(t,e,r)=>{const n=Pv(t,r);return n!==void 0?n:Pv(e,r)},YI=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in t?ke(t[n])||t[n]instanceof String||ke(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):YI(t[n],e[n],r):t[n]=e[n]);return t},Dl=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var yie={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const bie=t=>ke(t)?t.replace(/[&<>"'\/]/g,e=>yie[e]):t;class _ie{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Cie=[" ",",","?","!",";"],wie=new _ie(20),xie=(t,e,r)=>{e=e||"",r=r||"";const n=Cie.filter(o=>e.indexOf(o)<0&&r.indexOf(o)<0);if(n.length===0)return!0;const i=wie.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(r);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},k1=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const n=e.split(r);let i=t;for(let a=0;a<n.length;){if(!i||typeof i!="object")return;let o,s="";for(let l=a;l<n.length;++l)if(l!==a&&(s+=r),s+=n[l],o=i[s],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&l<n.length-1)continue;a+=l-a+1;break}i=o}return i},Bv=t=>t&&t.replace("_","-"),Die={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class Iv{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,r)}init(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=e||Die,this.options=r,this.debug=r.debug}log(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}warn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}error(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"error","")}deprecate(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(ke(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new Iv(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Iv(this.logger,e)}}var si=new Iv;class Nv{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}emit(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[s,l]=o;for(let u=0;u<l;u++)s(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[s,l]=o;for(let u=0;u<l;u++)s.apply(s,[e,...n])})}}class XI extends Nv{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}getResource(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,r],n&&(Array.isArray(n)?s.push(...n):ke(n)&&a?s.push(...n.split(a)):s.push(n)));const l=Pv(this.data,s);return!l&&!r&&!n&&e.indexOf(".")>-1&&(e=s[0],r=s[1],n=s.slice(2).join(".")),l||!o||!ke(n)?l:k1(this.data&&this.data[e]&&this.data[e][r],n,a)}addResource(e,r,n,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,r];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(s=e.split("."),i=r,r=s[1]),this.addNamespaces(r),qI(this.data,s,i),a.silent||this.emit("added",e,r,n,i)}addResources(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in n)(ke(n[a])||Array.isArray(n[a]))&&this.addResource(e,r,a,n[a],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[e,r];e.indexOf(".")>-1&&(s=e.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let l=Pv(this.data,s)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?YI(l,n,a):l={...l,...n},qI(this.data,s,l),o.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,r)}:this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var ZI={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(a=>{this.processors[a]&&(e=this.processors[a].process(e,r,n,i))}),e}};const KI={};class Fv extends Nv{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),vie(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=si.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const n=this.resolve(e,r);return n&&n.res!==void 0}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!xie(e,n,i);if(o&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:a};const u=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(u[0])>-1)&&(a=u.shift()),e=u.join(i)}return ke(a)&&(a=[a]),{key:e,namespaces:a}}translate(e,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1],u=r.lng||this.language,f=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(f){const C=r.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${C}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${C}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:o}const c=this.resolve(e,r);let d=c&&c.res;const h=c&&c.usedKey||o,v=c&&c.exactUsedKey||o,g=Object.prototype.toString.apply(d),p=["[object Number]","[object Function]","[object RegExp]"],m=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=!ke(d)&&typeof d!="boolean"&&typeof d!="number";if(y&&d&&b&&p.indexOf(g)<0&&!(ke(m)&&Array.isArray(d))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,d,{...r,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(c.res=C,c.usedParams=this.getUsedParamsDetails(r),c):C}if(a){const C=Array.isArray(d),_=C?[]:{},w=C?v:h;for(const x in d)if(Object.prototype.hasOwnProperty.call(d,x)){const D=`${w}${a}${x}`;_[x]=this.translate(D,{...r,joinArrays:!1,ns:s}),_[x]===D&&(_[x]=d[x])}d=_}}else if(y&&ke(m)&&Array.isArray(d))d=d.join(m),d&&(d=this.extendTranslation(d,e,r,n));else{let C=!1,_=!1;const w=r.count!==void 0&&!ke(r.count),x=Fv.hasDefaultValue(r),D=w?this.pluralResolver.getSuffix(u,r.count,r):"",S=r.ordinal&&w?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",T=w&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),E=T&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${D}`]||r[`defaultValue${S}`]||r.defaultValue;!this.isValidLookup(d)&&x&&(C=!0,d=E),this.isValidLookup(d)||(_=!0,d=o);const M=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&_?void 0:d,P=x&&E!==d&&this.options.updateMissing;if(_||C||P){if(this.logger.log(P?"updateKey":"missingKey",u,l,o,P?E:d),a){const j=this.resolve(o,{...r,keySeparator:!1});j&&j.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let B=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let j=0;j<F.length;j++)B.push(F[j]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(r.lng||this.language):B.push(r.lng||this.language);const H=(j,W,L)=>{const q=x&&L!==d?L:M;this.options.missingKeyHandler?this.options.missingKeyHandler(j,l,W,q,P,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(j,l,W,q,P,r),this.emit("missingKey",j,l,W,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?B.forEach(j=>{const W=this.pluralResolver.getSuffixes(j,r);T&&r[`defaultValue${this.options.pluralSeparator}zero`]&&W.indexOf(`${this.options.pluralSeparator}zero`)<0&&W.push(`${this.options.pluralSeparator}zero`),W.forEach(L=>{H([j],o+L,r[`defaultValue${L}`]||E)})}):H(B,o,E))}d=this.extendTranslation(d,e,r,c,n),_&&d===o&&this.options.appendNamespaceToMissingKey&&(d=`${l}:${o}`),(_||C)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,C?d:void 0):d=this.options.parseMissingKeyHandler(d))}return i?(c.res=d,c.usedParams=this.getUsedParamsDetails(r),c):d}extendTranslation(e,r,n,i,a){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const u=ke(e)&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const d=e.match(this.interpolator.nestingRegexp);f=d&&d.length}let c=n.replace&&!ke(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,n.lng||this.language||i.usedLng,n),u){const d=e.match(this.interpolator.nestingRegexp),h=d&&d.length;f<h&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(n.lng=this.language||i.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var d=arguments.length,h=new Array(d),v=0;v<d;v++)h[v]=arguments[v];return a&&a[0]===h[0]&&!n.context?(o.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${r[0]}`),null):o.translate(...h,r)},n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,l=ke(s)?[s]:s;return e!=null&&l&&l.length&&n.applyPostProcessor!==!1&&(e=ZI.handle(l,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,i,a,o,s;return ke(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(l,r),f=u.key;i=f;let c=u.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=r.count!==void 0&&!ke(r.count),h=d&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),v=r.context!==void 0&&(ke(r.context)||typeof r.context=="number")&&r.context!=="",g=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);c.forEach(p=>{this.isValidLookup(n)||(s=p,!KI[`${g[0]}-${p}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(KI[`${g[0]}-${p}`]=!0,this.logger.warn(`key "${i}" for languages "${g.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(m=>{if(this.isValidLookup(n))return;o=m;const y=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,f,m,p,r);else{let C;d&&(C=this.pluralResolver.getSuffix(m,r.count,r));const _=`${this.options.pluralSeparator}zero`,w=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(y.push(f+C),r.ordinal&&C.indexOf(w)===0&&y.push(f+C.replace(w,this.options.pluralSeparator)),h&&y.push(f+_)),v){const x=`${f}${this.options.contextSeparator}${r.context}`;y.push(x),d&&(y.push(x+C),r.ordinal&&C.indexOf(w)===0&&y.push(x+C.replace(w,this.options.pluralSeparator)),h&&y.push(x+_))}}let b;for(;b=y.pop();)this.isValidLookup(n)||(a=b,n=this.getResource(m,p,b,r))}))})}),{res:n,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!ke(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const a of r)delete i[a]}return i}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r===n.substring(0,r.length)&&e[n]!==void 0)return!0;return!1}}const j1=t=>t.charAt(0).toUpperCase()+t.slice(1);class QI{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=si.create("languageUtils")}getScriptPartFromCode(e){if(e=Bv(e),!e||e.indexOf("-")<0)return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=Bv(e),!e||e.indexOf("-")<0)return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(ke(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let i=Intl.getCanonicalLocales(e)[0];if(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)return i}catch{}const r=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map(i=>i.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=j1(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=j1(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=j1(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find(a=>{if(a===i)return a;if(!(a.indexOf("-")<0&&i.indexOf("-")<0)&&(a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1))return a})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),ke(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],e),i=[],a=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return ke(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):ke(e)&&a(this.formatLanguageCode(e)),n.forEach(o=>{i.indexOf(o)<0&&a(this.formatLanguageCode(o))}),i}}let Sie=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Eie={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const Aie=["v1","v2","v3"],Tie=["v4"],JI={zero:0,one:1,two:2,few:3,many:4,other:5},Oie=()=>{const t={};return Sie.forEach(e=>{e.lngs.forEach(r=>{t[r]={numbers:e.nr,plurals:Eie[e.fc]}})}),t};class Rie{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=r,this.logger=si.create("pluralResolver"),(!this.options.compatibilityJSON||Tie.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Oie(),this.pluralRulesCache={}}addRule(e,r){this.rules[e]=r}clearCache(){this.pluralRulesCache={}}getRule(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const n=Bv(e==="dev"?"en":e),i=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];const o=new Intl.PluralRules(n,{type:i});return this.pluralRulesCache[a]=o,o}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(e,r);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(e,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((i,a)=>JI[i]-JI[a]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):n.numbers.map(i=>this.getSuffix(e,i,r)):[]}getSuffix(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,n);return i?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:this.getSuffixRetroCompatible(i,r):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,r){const n=e.noAbs?e.plurals(r):e.plurals(Math.abs(r));let i=e.numbers[n];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const a=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?a():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!Aie.includes(this.options.compatibilityJSON)}}const eN=function(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=mie(t,e,r);return!a&&i&&ke(r)&&(a=k1(t,r,n),a===void 0&&(a=k1(e,r,n))),a},z1=t=>t.replace(/\$/g,"$$$$");class Mie{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=si.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(r=>r),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:s,suffixEscaped:l,formatSeparator:u,unescapeSuffix:f,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:v,nestingSuffixEscaped:g,nestingOptionsSeparator:p,maxReplaces:m,alwaysFormat:y}=e.interpolation;this.escape=r!==void 0?r:bie,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?Dl(a):o||"{{",this.suffix=s?Dl(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Dl(d):h||Dl("$t("),this.nestingSuffix=v?Dl(v):g||Dl(")"),this.nestingOptionsSeparator=p||",",this.maxReplaces=m||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>r&&r.source===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,r,n,i){let a,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=h=>{if(h.indexOf(this.formatSeparator)<0){const m=eN(r,l,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(m,void 0,n,{...i,...r,interpolationkey:h}):m}const v=h.split(this.formatSeparator),g=v.shift().trim(),p=v.join(this.formatSeparator).trim();return this.format(eN(r,l,g,this.options.keySeparator,this.options.ignoreJSONStructure),p,n,{...i,...r,interpolationkey:g})};this.resetRegExp();const f=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,c=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>z1(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?z1(this.escape(h)):z1(h)}].forEach(h=>{for(s=0;a=h.regex.exec(e);){const v=a[1].trim();if(o=u(v),o===void 0)if(typeof f=="function"){const p=f(e,a,i);o=ke(p)?p:""}else if(i&&Object.prototype.hasOwnProperty.call(i,v))o="";else if(c){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`),o="";else!ke(o)&&!this.useRawValueToEscape&&(o=$I(o));const g=h.safeValue(o);if(e=e.replace(a[0],g),c?(h.regex.lastIndex+=o.length,h.regex.lastIndex-=a[0].length):h.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,a,o;const s=(l,u)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const c=l.split(new RegExp(`${f}[ ]*{`));let d=`{${c[1]}`;l=c[0],d=this.interpolate(d,o);const h=d.match(/'/g),v=d.match(/"/g);(h&&h.length%2===0&&!v||v.length%2!==0)&&(d=d.replace(/'/g,'"'));try{o=JSON.parse(d),u&&(o={...u,...o})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,g),`${l}${f}${d}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...n},o=o.replace&&!ke(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const f=i[1].split(this.formatSeparator).map(c=>c.trim());i[1]=f.shift(),l=f,u=!0}if(a=r(s.call(this,i[1].trim(),o),o),a&&i[0]===e&&!ke(a))return a;ke(a)||(a=$I(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),u&&(a=l.reduce((f,c)=>this.format(f,c,n.lng,{...n,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],a),this.regexp.lastIndex=0}return e}}const Pie=t=>{let e=t.toLowerCase().trim();const r={};if(t.indexOf("(")>-1){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);e==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(o=>{if(o){const[s,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),f=s.trim();r[f]||(r[f]=u),u==="false"&&(r[f]=!1),u==="true"&&(r[f]=!0),isNaN(u)||(r[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:r}},Sl=t=>{const e={};return(r,n,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=n+JSON.stringify(a);let s=e[o];return s||(s=t(Bv(n),i),e[o]=s),s(r)}};class Bie{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=si.create("formatter"),this.options=e,this.formats={number:Sl((r,n)=>{const i=new Intl.NumberFormat(r,{...n});return a=>i.format(a)}),currency:Sl((r,n)=>{const i=new Intl.NumberFormat(r,{...n,style:"currency"});return a=>i.format(a)}),datetime:Sl((r,n)=>{const i=new Intl.DateTimeFormat(r,{...n});return a=>i.format(a)}),relativetime:Sl((r,n)=>{const i=new Intl.RelativeTimeFormat(r,{...n});return a=>i.format(a,n.range||"day")}),list:Sl((r,n)=>{const i=new Intl.ListFormat(r,{...n});return a=>i.format(a)})},this.init(e)}init(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=r.interpolation.formatSeparator||","}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=Sl(r)}format(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=r.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(s=>s.indexOf(")")>-1)){const s=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,s)].join(this.formatSeparator)}return a.reduce((s,l)=>{const{formatName:u,formatOptions:f}=Pie(l);if(this.formats[u]){let c=s;try{const d=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},h=d.locale||d.lng||i.locale||i.lng||n;c=this.formats[u](s,h,{...f,...i,...d})}catch(d){this.logger.warn(d)}return c}else this.logger.warn(`there was no format function for ${u}`);return s},e)}}const Iie=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Nie extends Nv{constructor(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=si.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,i.backend,i)}queueLoad(e,r,n,i){const a={},o={},s={},l={};return e.forEach(u=>{let f=!0;r.forEach(c=>{const d=`${u}|${c}`;!n.reload&&this.store.hasResourceBundle(u,c)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?o[d]===void 0&&(o[d]=!0):(this.state[d]=1,f=!1,o[d]===void 0&&(o[d]=!0),a[d]===void 0&&(a[d]=!0),l[c]===void 0&&(l[c]=!0)))}),f||(s[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const i=e.split("|"),a=i[0],o=i[1];r&&this.emit("failedLoading",a,o,r),!r&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const s={};this.queue.forEach(l=>{gie(l.loaded,[a],o),Iie(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const f=l.loaded[u];f.length&&f.forEach(c=>{s[u][c]===void 0&&(s[u][c]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(u&&f&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,r,n,i+1,a*2,o)},a);return}o(u,f)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const u=l(e,r);u&&typeof u.then=="function"?u.then(f=>s(null,f)).catch(s):s(null,u)}catch(u){s(u)}return}return l(e,r,s)}prepareLoading(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();ke(e)&&(e=this.languageUtils.toResolveHierarchy(e)),ke(r)&&(r=[r]);const a=this.queueLoad(e,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=e.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,s),this.loaded(e,o,s)})}saveMissing(e,r,n,i,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend&&this.backend.create){const l={...o,isUpdate:a},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(e,r,n,i,l):f=u(e,r,n,i),f&&typeof f.then=="function"?f.then(c=>s(null,c)).catch(s):s(null,f)}catch(f){s(f)}else u(e,r,n,i,s,l)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const tN=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),ke(t[1])&&(e.defaultValue=t[1]),ke(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),rN=t=>(ke(t.ns)&&(t.ns=[t.ns]),ke(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),ke(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Lv=()=>{},Fie=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class Of extends Nv{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=rN(e),this.services={},this.logger=si,this.modules={external:[]},Fie(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(){var e=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(n=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(ke(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=tN();this.options={...i,...this.options,...rN(r)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const a=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?si.init(a(this.modules.logger),this.options):si.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=Bie);const c=new QI(this.options);this.store=new XI(this.options.resources,this.options);const d=this.services;d.logger=si,d.resourceStore=this.store,d.languageUtils=c,d.pluralResolver=new Rie(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(d.formatter=a(f),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new Mie(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new Nie(a(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(h){for(var v=arguments.length,g=new Array(v>1?v-1:0),p=1;p<v;p++)g[p-1]=arguments[p];e.emit(h,...g)}),this.modules.languageDetector&&(d.languageDetector=a(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=a(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new Fv(this.services,this.options),this.translator.on("*",function(h){for(var v=arguments.length,g=new Array(v>1?v-1:0),p=1;p<v;p++)g[p-1]=arguments[p];e.emit(h,...g)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Lv),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=function(){return e.store[f](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=function(){return e.store[f](...arguments),e}});const l=Af(),u=()=>{const f=(c,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(d),n(c,d)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lv;const i=ke(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],o=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(u=>{u!=="cimode"&&a.indexOf(u)<0&&a.push(u)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload&&this.options.preload.forEach(s=>o(s)),this.services.backendConnector.load(a,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(s)})}else n(null)}reloadResources(e,r,n){const i=Af();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=Lv),this.services.backendConnector.reload(e,r,a=>{i.resolve(),n(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&ZI.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(e,r){var n=this;this.isLanguageChangingTo=e;const i=Af();this.emit("languageChanging",e);const a=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,u)=>{u?(a(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return n.t(...arguments)}),r&&r(l,function(){return n.t(...arguments)})},s=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);const u=ke(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||a(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,f=>{o(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),i}getFixedT(e,r,n){var i=this;const a=function(o,s){let l;if(typeof s!="object"){for(var u=arguments.length,f=new Array(u>2?u-2:0),c=2;c<u;c++)f[c-2]=arguments[c];l=i.options.overloadTranslationOptionHandler([o,s].concat(f))}else l={...s};l.lng=l.lng||a.lng,l.lngs=l.lngs||a.lngs,l.ns=l.ns||a.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||a.keyPrefix);const d=i.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(o)?h=o.map(v=>`${l.keyPrefix}${d}${v}`):h=l.keyPrefix?`${l.keyPrefix}${d}${o}`:o,i.t(h,l)};return ke(e)?a.lng=e:a.lngs=e,a.ns=r,a.keyPrefix=n,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===0||u===2};if(r.precheck){const s=r.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}loadNamespaces(e,r){const n=Af();return this.options.ns?(ke(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=Af();ke(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services&&this.services.languageUtils||new QI(tN());return r.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Of(e,r)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lv;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new Of(i);return(e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n&&(a.store=new XI(this.store.data,i),a.services.resourceStore=a.store),a.translator=new Fv(a.services,i),a.translator.on("*",function(s){for(var l=arguments.length,u=new Array(l>1?l-1:0),f=1;f<l;f++)u[f-1]=arguments[f];a.emit(s,...u)}),a.init(i,r),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ae=Of.createInstance();Ae.createInstance=Of.createInstance,Ae.createInstance,Ae.dir,Ae.init,Ae.loadResources,Ae.reloadResources,Ae.use,Ae.changeLanguage,Ae.getFixedT;const H1=Ae.t;Ae.exists,Ae.setDefaultNamespace,Ae.hasLoadedNamespace,Ae.loadNamespaces,Ae.loadLanguages;const Lie=(t,e)=>({"chart-bar":{xAxis:{type:"category",data:e},yAxis:{type:"value"}},"chart-bar-pile":{xAxis:{type:"category",data:e},yAxis:{type:"value"}},"chart-bar-percentage":{xAxis:{type:"category",data:e},yAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}}},"chart-line":{xAxis:{type:"category",data:e},yAxis:{type:"value"}},"chart-line-smooth":{xAxis:{type:"category",data:e},yAxis:{type:"value"}},"chart-pie":{xAxis:{show:!1},yAxis:{show:!1}},"chart-pie-circular":{xAxis:{show:!1},yAxis:{show:!1}},"chart-strip-bar":{xAxis:{type:"value"},yAxis:{type:"category",data:e}},"chart-strip-bar-pile":{xAxis:{type:"value"},yAxis:{type:"category",data:e}},"chart-strip-bar-percentage":{xAxis:{type:"value",max:100,axisLabel:{formatter:"{value} %"}},yAxis:{type:"category",data:e}}})[t],nN=({type:t,data:e,label:r,name:n,isGroup:i,groupField:a,labels:o})=>{let s;return t==="chart-pie"?s={data:e.map((l,u)=>({value:l,name:o[u]})),name:n,type:"pie",radius:"50%",label:{...r,position:"outside"},labelLine:{normal:{show:!0}}}:t==="chart-pie-circular"?s={data:e.map((l,u)=>({value:l,name:o[u]})),type:"pie",name:n,radius:["40%","70%"],label:{...r,position:"outside"},labelLine:{normal:{show:!0}}}:t==="chart-line"?s={data:e,name:n,type:"line",label:r}:t==="chart-line-smooth"?s={data:e,name:n,type:"line",smooth:!0,label:r}:s={data:e,name:n,type:"bar",label:r},(t==="chart-bar-percentage"||t==="chart-bar-pile"||t==="chart-strip-bar-pile"||t==="chart-strip-bar-percentage")&&i&&a&&(s.stack=a),s},kie=({series:t,chartConfig:e,width:r})=>{var y;const n=b=>{const C=Math.max(...(b==null?void 0:b.map(x=>String(x==null?void 0:x.name).length))||[]),_=Math.max(...(b==null?void 0:b.flatMap(x=>x.data.map(D=>String(D).length)))||[]),w=Math.max(...(b==null?void 0:b.flatMap(x=>x.data.length))||[]);return{maxNameLength:C,maxValueLength:_,maxArrLength:w}},i=b=>b==null?void 0:b.reduce((C,_)=>{const w=String(_).length;return Math.max(C,w)},0);let a=18;const o=50;let s="",l="",u="45px";const f="30px",{maxValueLength:c,maxArrLength:d}=n(t),h=i(((y=e==null?void 0:e.xAxis)==null?void 0:y.data)||[]);let v=0;d>3?(h>15&&(v=90),h>5&&(v=45),r<3&&(v=90)):a=55;const g=v===45?8:v===90?10:0,p=6;h>15?s=`${15*g+a}px`:s=`${h*g+a}px`,l=`${c*p+o}px`;const m=Math.floor(t.length/4);return m===1?u="60px":u=`${m*18+45}px`,{top:u,left:l,right:f,bottom:s,axisLabelRotate:v}},jie=({moduleDataApi:t,customData:e,customeStyle:r,width:n=2,height:i=2})=>{const{globalData:a}=lo(),[o,s]=N.useState(),[l,u]=N.useState(),[f,c]=N.useState(),[d,h]=N.useState(),v=N.useRef(),g=N.useCallback(async()=>{var m,y;if(u([]),e){c(!0);let b="";const C=(e==null?void 0:e.xAxis)==="tags"?"tag":e==null?void 0:e.xAxis,_=(e==null?void 0:e.groupField)==="tags"?"tag":e==null?void 0:e.groupField;e.isGroup?(e.yAxis==="recordTotal"&&(b+=`select=${C},${_},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(b+=`select=${C},${_},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`)):(e.yAxis==="recordTotal"&&(b+=`select=${C},id.count()`),e.yAxis==="fieldValue"&&(e!=null&&e.yAxisField)&&(b+=`select=${C},${e==null?void 0:e.yAxisField}.${e==null?void 0:e.yAxisFieldType}()`)),e!=null&&e.conditionData&&((y=(m=e==null?void 0:e.conditionData)==null?void 0:m.conditionList)==null?void 0:y.length)>0&&(b+=`&${nu(e==null?void 0:e.conditionData)}`),e!=null&&e.dataSourceId&&(t==null||t({id:e==null?void 0:e.dataSourceId,query:b}).then(w=>{if(!w.success){X.message.error(w.message);return}u(w.data)}).finally(()=>{c(!1)}))}else u([])},[e==null?void 0:e.dataSourceId,e==null?void 0:e.conditionData,e==null?void 0:e.xAxis,e==null?void 0:e.yAxis,e==null?void 0:e.yAxisField,e==null?void 0:e.yAxisFieldType,e==null?void 0:e.isGroup,e==null?void 0:e.groupField]);N.useEffect(()=>{e&&g()},[e==null?void 0:e.dataSourceId,e==null?void 0:e.conditionData,e==null?void 0:e.xAxis,e==null?void 0:e.yAxis,e==null?void 0:e.yAxisField,e==null?void 0:e.yAxisFieldType,e==null?void 0:e.isGroup,e==null?void 0:e.groupField]);const p=N.useCallback(()=>{var m,y,b,C,_,w,x,D,S,T,E,R,M,P,B,F,H;if(e&&l&&e.type&&l.length>0){const j={show:((m=e==null?void 0:e.chartOptions)==null?void 0:m.includes("label"))||((y=r==null?void 0:r.xchartOptions)==null?void 0:y.includes("label")),position:"top",formatter:"{c}"},W=(e==null?void 0:e.xAxis)==="tags"?"tag":e==null?void 0:e.xAxis,L=(e==null?void 0:e.groupField)==="tags"?"tag":e==null?void 0:e.groupField,q=(b=e==null?void 0:e.chartOptions)==null?void 0:b.includes("legend"),J=he=>{const de=o==null?void 0:o.find(pe=>pe.value===he);return de==null?void 0:de.label},ee=({item:he,field:de})=>cd({fieldOptions:o,val:he[de],field:de,fieldMap:a==null?void 0:a.fieldMap}),ae=(he,de,pe)=>{const Re=pe==="asc"?1:-1;return[...he].sort((nt,je)=>{let Qe,$t;switch(de){case"xAxis":Qe=ee({item:nt,field:W}),$t=ee({item:je,field:W});break;case"yAxisField":Qe=nt[e==null?void 0:e.yAxisFieldType]||0,$t=je[e==null?void 0:e.yAxisFieldType]||0;break;case"recordValue":default:Qe=e.yAxis==="recordTotal"?nt==null?void 0:nt.count:nt[e==null?void 0:e.yAxisFieldType]||0,$t=e.yAxis==="recordTotal"?je==null?void 0:je.count:je[e==null?void 0:e.yAxisFieldType]||0;break}return Qe>$t?1*Re:Qe<$t?-1*Re:0})},U={},I={},Y={},z={},G=new Set,Q=new Set;if(l.forEach(he=>{const de=ee({item:he,field:W});G.add(de);const pe=e.yAxis==="recordTotal"?he==null?void 0:he.count:he[e==null?void 0:e.yAxisFieldType]||0;if(e!=null&&e.isGroup&&(e!=null&&e.groupField)){const Re=ee({item:he,field:L}),nt=de??H1("unknown");Q.add(Re),Y[Re]||(Y[Re]={}),Y[Re][nt]=pe}else{const Re=de??H1("unknown");U[Re]=pe}}),e!=null&&e.isGroup&&(e!=null&&e.groupField)){const he={};Object.keys(Y).forEach(de=>{Object.entries(Y[de]).forEach(([pe,Re])=>{he[pe]=(he[pe]||0)+Re})}),Object.keys(Y).forEach(de=>{z[de]={},Object.entries(Y[de]).forEach(([pe,Re])=>{const nt=he[pe]||1;z[de][pe]=Re/nt*100})})}else Object.entries(U).forEach(([he,de])=>{const pe=de||1;I[he]=de/pe*100});if(e!=null&&e.sortField&&(e!=null&&e.sortOrder)){const de=ae(l,e.sortField,e.sortOrder).map(pe=>ee({item:pe,field:W}));G.clear(),de.forEach(pe=>G.add(pe))}const K=Array.from(G),Z=Array.from(Q),ce=Lie(e.type,K),se=[];if(e!=null&&e.isGroup&&(e!=null&&e.groupField))Z.forEach(he=>{const de=e.type==="chart-bar-percentage"||e.type==="chart-strip-bar-percentage"?K.map(pe=>{var Re;return((Re=z[he][pe])==null?void 0:Re.toFixed(2))||0}):K.map(pe=>Y[he][pe]||0);se.push(nN({type:e.type,data:de,label:j,name:he,isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:K}))});else{const he=e.type==="chart-bar-percentage"||e.type==="chart-strip-bar-percentage"?K.map(de=>{var pe;return((pe=I[de])==null?void 0:pe.toFixed(2))||0}):K.map(de=>U[de]||0);se.push(nN({type:e.type,data:he,label:j,name:e.yAxis==="recordTotal"?H1("pb.statisticsText"):J(e==null?void 0:e.yAxisField),isGroup:e==null?void 0:e.isGroup,groupField:e==null?void 0:e.groupField,labels:K}))}const Ce=kie({series:se,chartConfig:ce,width:n}),_e={legend:{left:"center",right:"center",top:"0",show:q,itemWidth:12,itemHeight:12,data:(se==null?void 0:se.map(he=>(he==null?void 0:he.name)||""))||[]},grid:{top:Ce.top,left:Ce.left,right:Ce.right,bottom:Ce.bottom},graphic:{elements:[{type:"text",left:"center",bottom:"10px",style:{text:(r==null?void 0:r.xtitle)||"",fill:"#333",fontSize:12,fontWeight:"bold"}},{type:"text",left:"10px",top:"center",style:{text:(r==null?void 0:r.ytitle)||"",fill:"#333",fontSize:12,fontWeight:"bold"},rotation:Math.PI/2}]},xAxis:{...ce.xAxis,axisTick:{show:(C=e==null?void 0:e.chartOptions)==null?void 0:C.includes("axis")},axisLine:{show:((_=e==null?void 0:e.chartOptions)==null?void 0:_.includes("axis"))||((w=r==null?void 0:r.xchartOptions)==null?void 0:w.includes("axisLine"))},axisLabel:{show:((x=e==null?void 0:e.chartOptions)==null?void 0:x.includes("label"))||((D=r==null?void 0:r.xchartOptions)==null?void 0:D.includes("label")),rotate:Ce.axisLabelRotate,interval:0,formatter:he=>he.length>15?`${he.slice(0,15)}...`:he,...(S=ce.xAxis)==null?void 0:S.axisLabel},splitLine:{show:(T=e==null?void 0:e.chartOptions)==null?void 0:T.includes("splitLine")}},yAxis:{...ce.yAxis,axisTick:{show:(E=e==null?void 0:e.chartOptions)==null?void 0:E.includes("axis")},axisLine:{show:((R=e==null?void 0:e.chartOptions)==null?void 0:R.includes("axis"))||((M=r==null?void 0:r.ychartOptions)==null?void 0:M.includes("axisLine"))},axisLabel:{show:((P=e==null?void 0:e.chartOptions)==null?void 0:P.includes("label"))||((B=r==null?void 0:r.ychartOptions)==null?void 0:B.includes("label")),formatter:he=>he.length>15?`${he.slice(0,15)}...`:he,...(F=ce.yAxis)==null?void 0:F.axisLabel},splitLine:{show:(H=e==null?void 0:e.chartOptions)==null?void 0:H.includes("splitLine")}},series:se,tooltip:{trigger:"item",axisPointer:{type:"shadow"}}};h(_e)}else h({})},[e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.type,e==null?void 0:e.chartOptions,r,l,n,i,o]);return N.useEffect(()=>{p()},[e==null?void 0:e.sortField,e==null?void 0:e.sortOrder,e==null?void 0:e.type,e==null?void 0:e.chartOptions,r,l,n,i,o]),N.useEffect(()=>{var m;a!=null&&a.sourceData&&(e!=null&&e.dataSourceId)&&s((m=a==null?void 0:a.sourceData.find(y=>y.value===(e==null?void 0:e.dataSourceId)))==null?void 0:m.fields)},[a,e==null?void 0:e.dataSourceId]),N.useEffect(()=>{(n||i)&&setTimeout(()=>{var m;(m=v==null?void 0:v.current)==null||m.resize()},300)},[n,i]),A.jsx("div",{style:{width:"100%",height:"100%"},children:!f&&d?A.jsx(hie,{echartRef:v,options:d}):A.jsx(X.Spin,{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},spinning:f})})},iN=N.memo(jie);var aN=typeof global=="object"&&global&&global.Object===Object&&global,zie=typeof self=="object"&&self&&self.Object===Object&&self,li=aN||zie||Function("return this")(),El=li.Symbol,oN=Object.prototype,Hie=oN.hasOwnProperty,Vie=oN.toString,Rf=El?El.toStringTag:void 0;function Wie(t){var e=Hie.call(t,Rf),r=t[Rf];try{t[Rf]=void 0;var n=!0}catch{}var i=Vie.call(t);return n&&(e?t[Rf]=r:delete t[Rf]),i}var $ie=Object.prototype,Gie=$ie.toString;function Uie(t){return Gie.call(t)}var qie="[object Null]",Yie="[object Undefined]",sN=El?El.toStringTag:void 0;function Al(t){return t==null?t===void 0?Yie:qie:sN&&sN in Object(t)?Wie(t):Uie(t)}function Tl(t){return t!=null&&typeof t=="object"}var Xie="[object Symbol]";function Zie(t){return typeof t=="symbol"||Tl(t)&&Al(t)==Xie}var kv=Array.isArray,Kie=/\s/;function Qie(t){for(var e=t.length;e--&&Kie.test(t.charAt(e)););return e}var Jie=/^\s+/;function eae(t){return t&&t.slice(0,Qie(t)+1).replace(Jie,"")}function Mf(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var lN=NaN,tae=/^[-+]0x[0-9a-f]+$/i,rae=/^0b[01]+$/i,nae=/^0o[0-7]+$/i,iae=parseInt;function uN(t){if(typeof t=="number")return t;if(Zie(t))return lN;if(Mf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Mf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=eae(t);var r=rae.test(t);return r||nae.test(t)?iae(t.slice(2),r?2:8):tae.test(t)?lN:+t}var aae="[object AsyncFunction]",oae="[object Function]",sae="[object GeneratorFunction]",lae="[object Proxy]";function fN(t){if(!Mf(t))return!1;var e=Al(t);return e==oae||e==sae||e==aae||e==lae}var V1=li["__core-js_shared__"],cN=function(){var t=/[^.]+$/.exec(V1&&V1.keys&&V1.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function uae(t){return!!cN&&cN in t}var fae=Function.prototype,cae=fae.toString;function Ko(t){if(t!=null){try{return cae.call(t)}catch{}try{return t+""}catch{}}return""}var dae=/[\\^$.*+?()[\]{}|]/g,hae=/^\[object .+?Constructor\]$/,vae=Function.prototype,pae=Object.prototype,gae=vae.toString,mae=pae.hasOwnProperty,yae=RegExp("^"+gae.call(mae).replace(dae,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function bae(t){if(!Mf(t)||uae(t))return!1;var e=fN(t)?yae:hae;return e.test(Ko(t))}function _ae(t,e){return t==null?void 0:t[e]}function Ol(t,e){var r=_ae(t,e);return bae(r)?r:void 0}var W1=Ol(li,"WeakMap"),Cae=9007199254740991,wae=/^(?:0|[1-9]\d*)$/;function xae(t,e){var r=typeof t;return e=e??Cae,!!e&&(r=="number"||r!="symbol"&&wae.test(t))&&t>-1&&t%1==0&&t<e}function dN(t,e){return t===e||t!==t&&e!==e}var Dae=9007199254740991;function hN(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Dae}function Sae(t){return t!=null&&hN(t.length)&&!fN(t)}var Eae=Object.prototype;function Aae(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Eae;return t===r}function Tae(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Oae="[object Arguments]";function vN(t){return Tl(t)&&Al(t)==Oae}var pN=Object.prototype,Rae=pN.hasOwnProperty,Mae=pN.propertyIsEnumerable,Pae=vN(function(){return arguments}())?vN:function(t){return Tl(t)&&Rae.call(t,"callee")&&!Mae.call(t,"callee")};function Bae(){return!1}var gN=typeof Yt=="object"&&Yt&&!Yt.nodeType&&Yt,mN=gN&&typeof module=="object"&&module&&!module.nodeType&&module,Iae=mN&&mN.exports===gN,yN=Iae?li.Buffer:void 0,Nae=yN?yN.isBuffer:void 0,$1=Nae||Bae,Fae="[object Arguments]",Lae="[object Array]",kae="[object Boolean]",jae="[object Date]",zae="[object Error]",Hae="[object Function]",Vae="[object Map]",Wae="[object Number]",$ae="[object Object]",Gae="[object RegExp]",Uae="[object Set]",qae="[object String]",Yae="[object WeakMap]",Xae="[object ArrayBuffer]",Zae="[object DataView]",Kae="[object Float32Array]",Qae="[object Float64Array]",Jae="[object Int8Array]",eoe="[object Int16Array]",toe="[object Int32Array]",roe="[object Uint8Array]",noe="[object Uint8ClampedArray]",ioe="[object Uint16Array]",aoe="[object Uint32Array]",_t={};_t[Kae]=_t[Qae]=_t[Jae]=_t[eoe]=_t[toe]=_t[roe]=_t[noe]=_t[ioe]=_t[aoe]=!0,_t[Fae]=_t[Lae]=_t[Xae]=_t[kae]=_t[Zae]=_t[jae]=_t[zae]=_t[Hae]=_t[Vae]=_t[Wae]=_t[$ae]=_t[Gae]=_t[Uae]=_t[qae]=_t[Yae]=!1;function ooe(t){return Tl(t)&&hN(t.length)&&!!_t[Al(t)]}function soe(t){return function(e){return t(e)}}var bN=typeof Yt=="object"&&Yt&&!Yt.nodeType&&Yt,Pf=bN&&typeof module=="object"&&module&&!module.nodeType&&module,loe=Pf&&Pf.exports===bN,G1=loe&&aN.process,_N=function(){try{var t=Pf&&Pf.require&&Pf.require("util").types;return t||G1&&G1.binding&&G1.binding("util")}catch{}}(),CN=_N&&_N.isTypedArray,wN=CN?soe(CN):ooe,uoe=Object.prototype,foe=uoe.hasOwnProperty;function coe(t,e){var r=kv(t),n=!r&&Pae(t),i=!r&&!n&&$1(t),a=!r&&!n&&!i&&wN(t),o=r||n||i||a,s=o?Tae(t.length,String):[],l=s.length;for(var u in t)foe.call(t,u)&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||xae(u,l)))&&s.push(u);return s}function doe(t,e){return function(r){return t(e(r))}}var hoe=doe(Object.keys,Object),voe=Object.prototype,poe=voe.hasOwnProperty;function goe(t){if(!Aae(t))return hoe(t);var e=[];for(var r in Object(t))poe.call(t,r)&&r!="constructor"&&e.push(r);return e}function moe(t){return Sae(t)?coe(t):goe(t)}var Bf=Ol(Object,"create");function yoe(){this.__data__=Bf?Bf(null):{},this.size=0}function boe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var _oe="__lodash_hash_undefined__",Coe=Object.prototype,woe=Coe.hasOwnProperty;function xoe(t){var e=this.__data__;if(Bf){var r=e[t];return r===_oe?void 0:r}return woe.call(e,t)?e[t]:void 0}var Doe=Object.prototype,Soe=Doe.hasOwnProperty;function Eoe(t){var e=this.__data__;return Bf?e[t]!==void 0:Soe.call(e,t)}var Aoe="__lodash_hash_undefined__";function Toe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Bf&&e===void 0?Aoe:e,this}function Qo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Qo.prototype.clear=yoe,Qo.prototype.delete=boe,Qo.prototype.get=xoe,Qo.prototype.has=Eoe,Qo.prototype.set=Toe;function Ooe(){this.__data__=[],this.size=0}function jv(t,e){for(var r=t.length;r--;)if(dN(t[r][0],e))return r;return-1}var Roe=Array.prototype,Moe=Roe.splice;function Poe(t){var e=this.__data__,r=jv(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Moe.call(e,r,1),--this.size,!0}function Boe(t){var e=this.__data__,r=jv(e,t);return r<0?void 0:e[r][1]}function Ioe(t){return jv(this.__data__,t)>-1}function Noe(t,e){var r=this.__data__,n=jv(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Li(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Li.prototype.clear=Ooe,Li.prototype.delete=Poe,Li.prototype.get=Boe,Li.prototype.has=Ioe,Li.prototype.set=Noe;var If=Ol(li,"Map");function Foe(){this.size=0,this.__data__={hash:new Qo,map:new(If||Li),string:new Qo}}function Loe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function zv(t,e){var r=t.__data__;return Loe(e)?r[typeof e=="string"?"string":"hash"]:r.map}function koe(t){var e=zv(this,t).delete(t);return this.size-=e?1:0,e}function joe(t){return zv(this,t).get(t)}function zoe(t){return zv(this,t).has(t)}function Hoe(t,e){var r=zv(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function Jo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Jo.prototype.clear=Foe,Jo.prototype.delete=koe,Jo.prototype.get=joe,Jo.prototype.has=zoe,Jo.prototype.set=Hoe;function Voe(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function Woe(){this.__data__=new Li,this.size=0}function $oe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Goe(t){return this.__data__.get(t)}function Uoe(t){return this.__data__.has(t)}var qoe=200;function Yoe(t,e){var r=this.__data__;if(r instanceof Li){var n=r.__data__;if(!If||n.length<qoe-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Jo(n)}return r.set(t,e),this.size=r.size,this}function Ea(t){var e=this.__data__=new Li(t);this.size=e.size}Ea.prototype.clear=Woe,Ea.prototype.delete=$oe,Ea.prototype.get=Goe,Ea.prototype.has=Uoe,Ea.prototype.set=Yoe;function Xoe(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var o=t[r];e(o,r,t)&&(a[i++]=o)}return a}function Zoe(){return[]}var Koe=Object.prototype,Qoe=Koe.propertyIsEnumerable,xN=Object.getOwnPropertySymbols,Joe=xN?function(t){return t==null?[]:(t=Object(t),Xoe(xN(t),function(e){return Qoe.call(t,e)}))}:Zoe;function ese(t,e,r){var n=e(t);return kv(t)?n:Voe(n,r(t))}function DN(t){return ese(t,moe,Joe)}var U1=Ol(li,"DataView"),q1=Ol(li,"Promise"),Y1=Ol(li,"Set"),SN="[object Map]",tse="[object Object]",EN="[object Promise]",AN="[object Set]",TN="[object WeakMap]",ON="[object DataView]",rse=Ko(U1),nse=Ko(If),ise=Ko(q1),ase=Ko(Y1),ose=Ko(W1),Aa=Al;(U1&&Aa(new U1(new ArrayBuffer(1)))!=ON||If&&Aa(new If)!=SN||q1&&Aa(q1.resolve())!=EN||Y1&&Aa(new Y1)!=AN||W1&&Aa(new W1)!=TN)&&(Aa=function(t){var e=Al(t),r=e==tse?t.constructor:void 0,n=r?Ko(r):"";if(n)switch(n){case rse:return ON;case nse:return SN;case ise:return EN;case ase:return AN;case ose:return TN}return e});var RN=li.Uint8Array,sse="__lodash_hash_undefined__";function lse(t){return this.__data__.set(t,sse),this}function use(t){return this.__data__.has(t)}function Hv(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Jo;++e<r;)this.add(t[e])}Hv.prototype.add=Hv.prototype.push=lse,Hv.prototype.has=use;function fse(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function cse(t,e){return t.has(e)}var dse=1,hse=2;function MN(t,e,r,n,i,a){var o=r&dse,s=t.length,l=e.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(t),f=a.get(e);if(u&&f)return u==e&&f==t;var c=-1,d=!0,h=r&hse?new Hv:void 0;for(a.set(t,e),a.set(e,t);++c<s;){var v=t[c],g=e[c];if(n)var p=o?n(g,v,c,e,t,a):n(v,g,c,t,e,a);if(p!==void 0){if(p)continue;d=!1;break}if(h){if(!fse(e,function(m,y){if(!cse(h,y)&&(v===m||i(v,m,r,n,a)))return h.push(y)})){d=!1;break}}else if(!(v===g||i(v,g,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function vse(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function pse(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var gse=1,mse=2,yse="[object Boolean]",bse="[object Date]",_se="[object Error]",Cse="[object Map]",wse="[object Number]",xse="[object RegExp]",Dse="[object Set]",Sse="[object String]",Ese="[object Symbol]",Ase="[object ArrayBuffer]",Tse="[object DataView]",PN=El?El.prototype:void 0,X1=PN?PN.valueOf:void 0;function Ose(t,e,r,n,i,a,o){switch(r){case Tse:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ase:return!(t.byteLength!=e.byteLength||!a(new RN(t),new RN(e)));case yse:case bse:case wse:return dN(+t,+e);case _se:return t.name==e.name&&t.message==e.message;case xse:case Sse:return t==e+"";case Cse:var s=vse;case Dse:var l=n&gse;if(s||(s=pse),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;n|=mse,o.set(t,e);var f=MN(s(t),s(e),n,i,a,o);return o.delete(t),f;case Ese:if(X1)return X1.call(t)==X1.call(e)}return!1}var Rse=1,Mse=Object.prototype,Pse=Mse.hasOwnProperty;function Bse(t,e,r,n,i,a){var o=r&Rse,s=DN(t),l=s.length,u=DN(e),f=u.length;if(l!=f&&!o)return!1;for(var c=l;c--;){var d=s[c];if(!(o?d in e:Pse.call(e,d)))return!1}var h=a.get(t),v=a.get(e);if(h&&v)return h==e&&v==t;var g=!0;a.set(t,e),a.set(e,t);for(var p=o;++c<l;){d=s[c];var m=t[d],y=e[d];if(n)var b=o?n(y,m,d,e,t,a):n(m,y,d,t,e,a);if(!(b===void 0?m===y||i(m,y,r,n,a):b)){g=!1;break}p||(p=d=="constructor")}if(g&&!p){var C=t.constructor,_=e.constructor;C!=_&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof _=="function"&&_ instanceof _)&&(g=!1)}return a.delete(t),a.delete(e),g}var Ise=1,BN="[object Arguments]",IN="[object Array]",Vv="[object Object]",Nse=Object.prototype,NN=Nse.hasOwnProperty;function Fse(t,e,r,n,i,a){var o=kv(t),s=kv(e),l=o?IN:Aa(t),u=s?IN:Aa(e);l=l==BN?Vv:l,u=u==BN?Vv:u;var f=l==Vv,c=u==Vv,d=l==u;if(d&&$1(t)){if(!$1(e))return!1;o=!0,f=!1}if(d&&!f)return a||(a=new Ea),o||wN(t)?MN(t,e,r,n,i,a):Ose(t,e,l,r,n,i,a);if(!(r&Ise)){var h=f&&NN.call(t,"__wrapped__"),v=c&&NN.call(e,"__wrapped__");if(h||v){var g=h?t.value():t,p=v?e.value():e;return a||(a=new Ea),i(g,p,r,n,a)}}return d?(a||(a=new Ea),Bse(t,e,r,n,i,a)):!1}function FN(t,e,r,n,i){return t===e?!0:t==null||e==null||!Tl(t)&&!Tl(e)?t!==t&&e!==e:Fse(t,e,r,n,FN,i)}var Z1=function(){return li.Date.now()},Lse="Expected a function",kse=Math.max,jse=Math.min;function zse(t,e,r){var n,i,a,o,s,l,u=0,f=!1,c=!1,d=!0;if(typeof t!="function")throw new TypeError(Lse);e=uN(e)||0,Mf(r)&&(f=!!r.leading,c="maxWait"in r,a=c?kse(uN(r.maxWait)||0,e):a,d="trailing"in r?!!r.trailing:d);function h(w){var x=n,D=i;return n=i=void 0,u=w,o=t.apply(D,x),o}function v(w){return u=w,s=setTimeout(m,e),f?h(w):o}function g(w){var x=w-l,D=w-u,S=e-x;return c?jse(S,a-D):S}function p(w){var x=w-l,D=w-u;return l===void 0||x>=e||x<0||c&&D>=a}function m(){var w=Z1();if(p(w))return y(w);s=setTimeout(m,g(w))}function y(w){return s=void 0,d&&n?h(w):(n=i=void 0,o)}function b(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function C(){return s===void 0?o:y(Z1())}function _(){var w=Z1(),x=p(w);if(n=arguments,i=this,l=w,x){if(s===void 0)return v(l);if(c)return clearTimeout(s),s=setTimeout(m,e),h(l)}return s===void 0&&(s=setTimeout(m,e)),o}return _.cancel=b,_.flush=C,_}function Hse(t,e){return FN(t,e)}function Vse(t,e){return Hse(t.module,e.module)}const Wse=N.memo(({module:t,onUpdate:e,moduleDataApi:r,rowWidth:n,rowHeight:i})=>{var a,o;return A.jsx("div",{className:"chart-content isNoCanDrag",style:{overflow:(a=t.type)!=null&&a.includes("chart")?"inherit":"hidden"},children:A.jsxs("div",{className:"dashboard-grid-container",children:[t.type==="text"?A.jsx(h9,{defaultValue:t.customData.editor,onChange:s=>{t.id&&e(t.id,{type:"text",customData:{title:t.customData.title,editor:s}})}}):null,t.type==="statistics"?A.jsx(HD,{customData:t.customData,customeStyle:t.customeStyle,moduleDataApi:r,width:t.w,height:t.h,rowWidth:n,rowHeight:i}):null,t.type==="calendar"?A.jsx(gA,{customData:t.customData,moduleDataApi:r,width:t.w,height:t.h,rowWidth:n,rowHeight:i}):null,(o=t.type)!=null&&o.includes("chart")?A.jsx(iN,{width:t.w,height:t.h,customData:t.customData,customeStyle:t.customeStyle,moduleDataApi:r}):null]})})},Vse),LN=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"17",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"28",y:"24",width:"6",height:"16",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"39",y:"8",width:"6",height:"32",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"50",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"})]}),kN=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("path",{d:"M17 33.5L29.5 15L45 23L58 10",stroke:"#959bee",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),A.jsx("path",{d:"M16.5 15L30 31.5L45 28L57 33.5",stroke:"#5b65f4",strokeWidth:"1.5",strokeLinecap:"round"})]}),jN=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("circle",{cx:"16",cy:"16",r:"16",transform:"matrix(-1 0 0 1 52 8)",fill:"#5b65f4"}),A.jsx("path",{d:"M36 8.5C36 8.22386 36.224 7.99918 36.5 8.00781C40.5621 8.13468 44.4312 9.80377 47.3137 12.6863C50.3143 15.6869 52 19.7565 52 24C52 28.2435 50.3143 32.3131 47.3137 35.3137C44.4312 38.1962 40.5621 39.8653 36.5 39.9922C36.224 40.0008 36 39.7761 36 39.5L36 24V8.5Z",fill:"#959bee"}),A.jsx("path",{d:"M46.9602 34.9602C47.1554 35.1554 47.1559 35.4726 46.9547 35.6617C45.5468 36.9842 43.91 38.0418 42.1229 38.7821C40.3358 39.5223 38.4306 39.9318 36.4999 39.9922C36.2239 40.0008 36 39.7761 36 39.5L36 25.2071C36 24.7617 36.5386 24.5386 36.8536 24.8536L46.9602 34.9602Z",fill:"#cdcff9"})]}),zN=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"31",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 31 11)",fill:"#5b65f5"}),A.jsx("rect",{x:"44",y:"18",width:"4",height:"28",rx:"0.5",transform:"rotate(90 44 18)",fill:"#5b65f5"}),A.jsx("rect",{x:"56",y:"25",width:"4",height:"40",rx:"0.5",transform:"rotate(90 56 25)",fill:"#5b65f5"}),A.jsx("rect",{x:"36",y:"32",width:"4",height:"20",rx:"0.5",transform:"rotate(90 36 32)",fill:"#5b65f5"})]}),$se=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("path",{d:"M59.3348 27.8581C59.3348 28.6621 59.0708 29.2801 58.5428 29.7121C58.0268 30.1441 57.3848 30.3601 56.6168 30.3601C55.8488 30.3601 55.2008 30.1441 54.6728 29.7121C54.1568 29.2801 53.8988 28.6621 53.8988 27.8581V26.1481C53.8988 25.3441 54.1568 24.7261 54.6728 24.2941C55.2008 23.8621 55.8488 23.6461 56.6168 23.6461C57.3848 23.6461 58.0268 23.8621 58.5428 24.2941C59.0708 24.7261 59.3348 25.3441 59.3348 26.1481V27.8581ZM50.9648 21.5401C50.9648 22.3441 50.7008 22.9621 50.1728 23.3941C49.6568 23.8261 49.0148 24.0421 48.2468 24.0421C47.4788 24.0421 46.8308 23.8261 46.3028 23.3941C45.7868 22.9621 45.5288 22.3441 45.5288 21.5401V19.8301C45.5288 19.0261 45.7868 18.4081 46.3028 17.9761C46.8308 17.5441 47.4788 17.3281 48.2468 17.3281C49.0148 17.3281 49.6568 17.5441 50.1728 17.9761C50.7008 18.4081 50.9648 19.0261 50.9648 19.8301V21.5401ZM56.6168 17.4361L50.5148 30.2521H48.2468L54.3488 17.4361H56.6168ZM48.8768 21.4681V19.9021C48.8768 19.4341 48.6668 19.2001 48.2468 19.2001C47.8268 19.2001 47.6168 19.4341 47.6168 19.9021V21.4681C47.6168 21.9361 47.8268 22.1701 48.2468 22.1701C48.6668 22.1701 48.8768 21.9361 48.8768 21.4681ZM57.2468 27.7861V26.2201C57.2468 25.7521 57.0368 25.5181 56.6168 25.5181C56.1968 25.5181 55.9868 25.7521 55.9868 26.2201V27.7861C55.9868 28.2541 56.1968 28.4881 56.6168 28.4881C57.0368 28.4881 57.2468 28.2541 57.2468 27.7861Z",fill:"#5b65f4"}),A.jsx("path",{d:"M44.0049 26.4181C44.0049 27.6901 43.5969 28.6681 42.7809 29.3521C41.9649 30.0241 40.9509 30.3601 39.7389 30.3601C38.9829 30.3601 38.2929 30.2341 37.6689 29.9821C37.0569 29.7181 36.5349 29.2741 36.1029 28.6501C35.6829 28.0261 35.4729 27.2581 35.4729 26.3461H38.4249C38.4249 26.7781 38.5449 27.1141 38.7849 27.3541C39.0369 27.5821 39.3549 27.6961 39.7389 27.6961C40.1349 27.6961 40.4529 27.5821 40.6929 27.3541C40.9329 27.1141 41.0529 26.7721 41.0529 26.3281C41.0529 25.9441 40.9209 25.6261 40.6569 25.3741C40.4049 25.1101 40.0809 24.9781 39.6849 24.9781H39.2709V22.4221H39.6849C40.0929 22.4221 40.3989 22.3021 40.6029 22.0621C40.8069 21.8221 40.9089 21.5401 40.9089 21.2161C40.9089 20.8321 40.7949 20.5321 40.5669 20.3161C40.3389 20.1001 40.0629 19.9921 39.7389 19.9921C39.4149 19.9921 39.1389 20.1001 38.9109 20.3161C38.6829 20.5321 38.5689 20.8261 38.5689 21.1981H35.6169C35.6169 20.0221 36.0069 19.0861 36.7869 18.3901C37.5789 17.6821 38.5629 17.3281 39.7389 17.3281C40.9269 17.3281 41.9109 17.6881 42.6909 18.4081C43.4709 19.1161 43.8609 20.0221 43.8609 21.1261C43.8609 22.2301 43.4169 23.0641 42.5289 23.6281C43.5129 24.3121 44.0049 25.2421 44.0049 26.4181Z",fill:"#5b65f4"}),A.jsx("path",{d:"M33.9128 30.2521H25.6688V27.5881L30.3128 22.5481C30.7448 22.0801 30.9608 21.6241 30.9608 21.1801C30.9608 20.8201 30.8588 20.5321 30.6548 20.3161C30.4628 20.1001 30.1808 19.9921 29.8088 19.9921C29.4848 19.9921 29.2028 20.0881 28.9628 20.2801C28.7348 20.4721 28.6208 20.7901 28.6208 21.2341H25.6688C25.6688 20.0221 26.0648 19.0681 26.8568 18.3721C27.6608 17.6761 28.6448 17.3281 29.8088 17.3281C31.0208 17.3281 32.0048 17.6761 32.7608 18.3721C33.5288 19.0681 33.9128 20.0101 33.9128 21.1981C33.9128 21.8221 33.7928 22.3501 33.5528 22.7821C33.3128 23.2141 32.9048 23.7361 32.3288 24.3481L29.2688 27.5881H33.9128V30.2521Z",fill:"#5b65f4"}),A.jsx("path",{d:"M22.021 30.2525H19.069V20.5865L16.333 22.9625V19.8125L19.069 17.4365H22.021V30.2525Z",fill:"#5b65f4"})]}),Gse=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"58",y:"25",width:"4",height:"44",rx:"0.5",transform:"rotate(90 58 25)",fill:"#5b65f4"}),A.jsx("rect",{x:"29.5",y:"33",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 29.5 33)",fill:"#959bee"}),A.jsx("path",{d:"M14.584 19L17.085 12.2832H18.8377L21.3008 19H19.7566L19.264 17.5695H16.5829L16.0808 19H14.584ZM17.0377 16.2716H18.8093L17.9282 13.7232L17.0377 16.2716ZM22.1459 19V12.2832H24.609C25.9259 12.2832 26.6933 13.0505 26.6933 14.0832C26.6933 14.7842 26.2575 15.3432 25.708 15.5232C26.3333 15.6747 26.9017 16.2432 26.9017 17.1053C26.9017 18.2042 26.068 19 24.808 19H22.1459ZM23.529 15.0116H24.3911C24.9406 15.0116 25.3006 14.7084 25.3006 14.2347C25.3006 13.7705 24.9785 13.4674 24.3722 13.4674H23.529V15.0116ZM23.529 17.8347H24.5143C25.1206 17.8347 25.4901 17.5126 25.4901 17.0105C25.4901 16.5179 25.1396 16.1768 24.5238 16.1768H23.529V17.8347ZM31.0425 19.1421C29.1383 19.1421 27.5751 17.7684 27.5751 15.6558C27.5751 13.5432 29.1762 12.1411 31.0236 12.1411C32.9751 12.1411 33.8941 13.3726 34.1309 14.3863L32.7951 14.8126C32.672 14.2726 32.1983 13.5147 31.0236 13.5147C30.0857 13.5147 29.0436 14.1968 29.0436 15.6558C29.0436 16.9821 30.0099 17.7305 31.0425 17.7305C32.2078 17.7305 32.7004 16.9726 32.8615 16.4232L34.2067 16.8211C33.9699 17.7968 33.0509 19.1421 31.0425 19.1421Z",fill:"#5b65f4"})]}),Use=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{width:"26",height:"19",rx:"1",transform:"matrix(1 0 0 -1 23 36.5)",fill:"#E9EAFB"}),A.jsx("rect",{width:"26",height:"3",rx:"1",transform:"matrix(1 0 0 -1 23 14.5)",fill:"#5b65f4"}),A.jsx("rect",{width:"11",height:"3",rx:"0.5",transform:"matrix(1 0 0 -1 27 25.5)",fill:"#5b65f4"}),A.jsx("rect",{width:"11",height:"3",rx:"0.5",transform:"matrix(1 0 0 -1 34 31.5)",fill:"#959bee"})]}),qse=({onOk:t})=>{const{t:e}=Er(),r=[{title:e("add.add1"),child:[{title:e("add.add2"),type:"chart-bar",icon:A.jsx(LN,{})},{title:e("add.add3"),type:"chart-line",icon:A.jsx(kN,{})},{title:e("add.add4"),type:"chart-pie",icon:A.jsx(jN,{})},{title:e("add.add5"),type:"chart-strip-bar",icon:A.jsx(zN,{})}]},{title:e("add.add6"),child:[{title:e("add.add7"),type:"statistics",icon:A.jsx($se,{})},{title:e("add.add8"),type:"text",icon:A.jsx(Gse,{})},{title:e("add.add9"),type:"calendar",icon:A.jsx(Use,{})}]}],[n,i]=N.useState(!1),a=o=>{i(!1),t==null||t(o)};return A.jsx(A.Fragment,{children:A.jsx(X.Popover,{placement:"bottomRight",open:n,onOpenChange:i,content:A.jsx("div",{className:"pivot-table-modal box-widget-popover-item-container",children:r.map((o,s)=>A.jsxs("div",{className:"box-widget-popover-item-group",children:[A.jsx("p",{className:"box-widget-popover-item-group-header",children:o.title}),A.jsx("div",{className:"box-widget-popover-item-group-content",children:o.child.map((l,u)=>A.jsxs("div",{onClick:()=>{a(l.type)},className:"box-widget-popover-item",children:[A.jsx("div",{className:"img",children:l.icon}),A.jsx("div",{className:"title",children:l.title})]},u))})]},s))}),trigger:"click",children:A.jsx(X.Button,{children:e("add.add10")})})})},Yse=[{label:Ae.t("add.add13"),value:"="},{label:Ae.t("add.add14"),value:"<"},{label:Ae.t("add.add15"),value:">"},{label:Ae.t("add.add16"),value:"contain"},{label:Ae.t("add.add17"),value:"null"},{label:Ae.t("add.add18"),value:"notnull"}],Xse=[{label:Ae.t("add.add13"),value:"="}],HN=[{label:Ae.t("add.add13"),value:"="},{label:Ae.t("add.add19"),value:"!="},{label:Ae.t("add.add20"),value:">"},{label:Ae.t("add.add21"),value:">="},{label:Ae.t("add.add22"),value:"<"},{label:Ae.t("add.add23"),value:"=<"},{label:Ae.t("add.add16"),value:"contain"},{label:Ae.t("add.add17"),value:"null"},{label:Ae.t("add.add18"),value:"notnull"}],VN=[{label:Ae.t("add.add13"),value:"="},{label:Ae.t("add.add19"),value:"!="},{label:Ae.t("add.add24"),value:"include"},{label:Ae.t("add.add25"),value:"notinclude"},{label:Ae.t("add.add17"),value:"null"},{label:Ae.t("add.add18"),value:"notnull"}],Zse=[{label:Ae.t("add.add26"),value:"exactdate"},{label:Ae.t("add.add27"),value:"today"},{label:Ae.t("add.add28"),value:"yesterday"},{label:Ae.t("add.add29"),value:"thisweek"},{label:Ae.t("add.add30"),value:"lastweek"},{label:Ae.t("add.add31"),value:"thismonth"},{label:Ae.t("add.add32"),value:"lastmonth"},{label:Ae.t("add.add33"),value:"last7days"},{label:Ae.t("add.add34"),value:"last30days"}],Kse=[{label:Ae.t("add.add26"),value:"exactdate"},{label:Ae.t("add.add27"),value:"today"},{label:Ae.t("add.add28"),value:"yesterday"}],Qse={int:HN,timestamp:Yse,string:VN,bool:Xse,float:HN,enum:VN};function Jse({fetchOptions:t,debounceTimeout:e=800,...r}){const[n,i]=N.useState(!1),[a,o]=N.useState([]),s=N.useRef(0),l=N.useMemo(()=>zse(f=>{s.current+=1;const c=s.current;o([]),i(!0),t(f).then(d=>{c===s.current&&(o(d),i(!1))})},e),[t,e]);return N.useEffect(()=>{l("")},[]),A.jsx(X.Select,{labelInValue:!0,showSearch:!0,filterOption:!1,onSearch:l,notFoundContent:n?A.jsx(X.Spin,{size:"small"}):null,...r,options:a})}const K1=({open:t,onClose:e,onOk:r,fieldOptions:n,value:i,enumDataApi:a})=>{const[o]=X.Form.useForm(),s=N.useRef(),{t:l}=Er(),{globalData:u}=lo(),f=N.useCallback(()=>{if(i!=null&&i.conditionList){const c=JSON.parse(JSON.stringify(i==null?void 0:i.conditionList));o.setFieldsValue({conditionList:c.map(d=>(d.type==="timestamp"&&(d.val&&(d.val=Cn(new Date(d.val))),d.val2&&(d.val2=Cn(new Date(d.val2)))),(d.val===void 0||d.val==="")&&(d.val=""),(d.val2===void 0||d.val2==="")&&(d.val2=""),d)),conditionType:i.conditionType})}else o.setFieldsValue({conditionList:[],conditionType:"all"})},[i]);return N.useEffect(()=>{f()},[i]),A.jsx(A.Fragment,{children:A.jsx(X.Modal,{title:l("setFilteringCriteria"),open:t,destroyOnClose:!0,width:"650px",onOk:()=>{const c=o.getFieldsValue(),d=c.conditionList?JSON.parse(JSON.stringify(c.conditionList)):"",h=c.conditionType||"all",v={conditionList:d.map(g=>(g.type==="timestamp"&&(g.val&&(g.val=Cn(g.val).format("YYYY-MM-DD")),g.val2&&(g.val2=g.val2?Cn(g.val2).format("YYYY-MM-DD"):"")),g)),conditionType:h};s.current=v,e==null||e(),r==null||r(v)},onCancel:()=>{f(),e==null||e(),o.setFieldsValue(s.current)},children:A.jsxs(X.Form,{name:"dynamicForm",form:o,initialValues:{conditionType:"all"},style:{maxWidth:650,marginTop:"30px"},children:[A.jsx(X.Form.Item,{noStyle:!0,dependencies:["conditionList"],children:({getFieldValue:c})=>{var d;return((d=c("conditionList"))==null?void 0:d.length)>1?A.jsxs(X.Flex,{align:"center",gap:5,style:{marginBottom:"20px"},children:[l("conformTo"),A.jsx(X.Form.Item,{name:"conditionType",noStyle:!0,children:A.jsx(X.Select,{style:{width:"150px"},options:[{label:l("all"),value:"all"},{label:l("everyone"),value:"any"}]})})," ",l("condition")]}):null}}),A.jsx(X.Form.List,{name:"conditionList",children:(c,{add:d,remove:h})=>A.jsxs(A.Fragment,{children:[c.map(({key:v,name:g,...p})=>A.jsxs(X.Space,{style:{display:"flex",marginBottom:8},align:"baseline",children:[A.jsx(X.Form.Item,{...p,name:[g,"field"],noStyle:!0,children:A.jsx(X.Select,{style:{width:"150px"},options:n||[],onChange:m=>{const y=o.getFieldValue("conditionList"),b=n==null?void 0:n.find(C=>C.value===m);y[g].condition="=",y[g].type=b==null?void 0:b.type,y[g].val="",y[g].val2="",(b==null?void 0:b.type)==="timestamp"&&(y[g].rdate="exactdate"),o.setFieldsValue({conditionList:y})}})}),A.jsx(X.Form.Item,{noStyle:!0,dependencies:[["conditionList",g,"field"]],children:({getFieldValue:m})=>{var b;const y=(b=n==null?void 0:n.find(C=>C.value===m(["conditionList",g,"field"])))==null?void 0:b.type;return A.jsx(A.Fragment,{children:A.jsx(X.Form.Item,{...p,name:[g,"condition"],noStyle:!0,children:A.jsx(X.Select,{style:{width:"100px"},options:y?Qse[y]:[],onChange:()=>{const C=o.getFieldValue("conditionList");y==="timestamp"&&(C[g].rdate="exactdate"),o.setFieldsValue({conditionList:C})}})})})}}),A.jsx(X.Form.Item,{noStyle:!0,dependencies:[["conditionList",g,"field"],["conditionList",g,"condition"],["conditionList",g,"rdate"]],children:({getFieldValue:m})=>{var S;const y=m(["conditionList",g,"field"]),b=n==null?void 0:n.find(T=>T.value===y),C=b==null?void 0:b.type,_=(S=b==null?void 0:b.enum)==null?void 0:S.map(T=>{var E;return{...T,label:((E=u==null?void 0:u.fieldMap)==null?void 0:E[T.label])||T.label}}),w=b==null?void 0:b.dynamic_call_enum_api,x=m(["conditionList",g,"condition"]),D=m(["conditionList",g,"rdate"]);return A.jsxs(A.Fragment,{children:[["int","float"].includes(C)&&!["null","notnull"].includes(x)?A.jsxs(A.Fragment,{children:[A.jsx(X.Form.Item,{...p,name:[g,"val"],noStyle:!0,children:A.jsx(X.InputNumber,{style:{width:"100px"},placeholder:l("pleaseEnter")})}),x==="contain"?A.jsx(X.Form.Item,{...p,name:[g,"val2"],noStyle:!0,children:A.jsx(X.InputNumber,{style:{width:"100px",marginLeft:"5px"},placeholder:l("pleaseEnter")})}):null]}):null,C==="timestamp"&&!["null","notnull"].includes(x)?A.jsxs(A.Fragment,{children:[x==="="||x==="<"||x===">"?A.jsx(X.Form.Item,{...p,name:[g,"rdate"],noStyle:!0,children:A.jsx(X.Select,{showSearch:!0,optionFilterProp:"label",style:{width:"150px"},options:x==="="?Zse:Kse})}):null,D=="exactdate"?A.jsx(X.Form.Item,{...p,name:[g,"val"],noStyle:!0,children:A.jsx(X.DatePicker,{style:{width:"150px"}})}):null,x==="contain"?A.jsx(X.Form.Item,{...p,name:[g,"val2"],noStyle:!0,children:A.jsx(X.DatePicker,{style:{width:"150px",marginLeft:"5px"}})}):null]}):null,["string"].includes(C)&&!["null","notnull"].includes(x)?A.jsxs(A.Fragment,{children:[A.jsx(X.Form.Item,{...p,name:[g,"val"],noStyle:!0,children:A.jsx(X.Input,{style:{width:"150px"},placeholder:l("pleaseEnter")})}),x==="contain"?A.jsx(X.Form.Item,{...p,name:[g,"val2"],noStyle:!0,children:A.jsx(X.Input,{style:{width:"150px",marginLeft:"5px"},placeholder:l("pleaseEnter")})}):null]}):null,["bool"].includes(C)?A.jsx(A.Fragment,{children:A.jsx(X.Form.Item,{...p,name:[g,"val"],noStyle:!0,children:A.jsx(X.Switch,{})})}):null,["enum"].includes(C)&&!["null","notnull"].includes(x)?A.jsx(A.Fragment,{children:A.jsx(X.Form.Item,{...p,name:[g,"val"],noStyle:!0,children:(_==null?void 0:_.length)>0?A.jsx(X.Select,{showSearch:!0,optionFilterProp:"label",style:{width:"150px"},options:_}):w?A.jsx(Jse,{style:{width:"150px"},fetchOptions:async T=>{var R;let E=w;return T&&(E=`${E}?q=${T}`),await((R=a==null?void 0:a(E))==null?void 0:R.then(M=>{var P;return(P=M.data)==null?void 0:P.list}))}}):null})}):null]})}}),A.jsx(pD,{onClick:()=>h(g)})]},v)),A.jsx(X.Form.Item,{children:A.jsx(X.Button,{type:"dashed",onClick:()=>{const v=n==null?void 0:n[0].value;d(v!=="timestamp"?{field:n==null?void 0:n[0].value,condition:"=",type:n==null?void 0:n[0].type,val:"",val2:""}:{field:n==null?void 0:n[0].value,condition:"=",type:n==null?void 0:n[0].type,exactdate:"exactdate",val:"",val2:""})},block:!0,icon:A.jsx(mD,{}),children:l("addCondition")})})]})})]})})})},ele=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=lo(),[i]=X.Form.useForm(),[a,o]=N.useState(),[s,l]=N.useState(),[u,f]=N.useState(!1),c=N.useRef(),[d,h]=N.useState({conditionList:[],conditionType:"all"}),[v,g]=N.useState(0),{t:p}=Er(),m={dataSourceId:"",statisticalMethod:"recordTotal",field:""},y=()=>{setTimeout(()=>{e==null||e({...i.getFieldsValue(),conditionData:c.current})})},b=_=>{var x,D;const w=(D=(x=n==null?void 0:n.sourceData)==null?void 0:x.find(S=>S.value===_))==null?void 0:D.fields;o(w),l(w==null?void 0:w.filter(S=>S.type==="int"||S.type==="float"))},C=_=>{var w;h(_),c.current=_,g(((w=_==null?void 0:_.conditionList)==null?void 0:w.length)||0)};return N.useEffect(()=>{var _,w;if(t!=null&&t.customData){const x=t.customData;i.setFieldsValue(x),b(x==null?void 0:x.dataSourceId)}else{const x=(_=n==null?void 0:n.sourceData)==null?void 0:_[0];i.setFieldsValue({...m,dataSourceId:x==null?void 0:x.value}),b(x==null?void 0:x.value),y()}C((w=t==null?void 0:t.customData)==null?void 0:w.conditionData)},[t,n]),A.jsxs(A.Fragment,{children:[A.jsxs(X.Form,{form:i,name:"customData",layout:"vertical",initialValues:m,children:[A.jsx(X.Form.Item,{label:p("dataSource"),name:"dataSourceId",children:A.jsx(X.Select,{options:n==null?void 0:n.sourceData,onChange:_=>{i.setFieldsValue({statisticalMethod:"recordTotal"}),b(_),y()}})}),A.jsxs(X.Form.Item,{label:p("dataRange"),children:[A.jsx(X.Button,{style:{marginLeft:"-15px"},onClick:()=>{f(!0)},type:"link",children:p("filterData")}),v>0?`${p("selectNcondition",{n:v})}`:null]}),A.jsx(X.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),A.jsx(X.Form.Item,{label:p("statisticstMethods"),name:"statisticalMethod",children:A.jsx(X.Select,{onChange:_=>{i.setFieldsValue({field:_==="fieldValue"?s==null?void 0:s[0].value:"",statisticalType:"sum"}),y()},options:[{value:"recordTotal",label:p("statisticstRecordNum")},{value:"fieldValue",label:p("statisticstFieldVal")}]})}),A.jsx(X.Form.Item,{dependencies:["statisticalMethod"],children:({getFieldValue:_})=>_("statisticalMethod")==="fieldValue"?A.jsx(X.Form.Item,{label:p("selectField"),children:A.jsxs(X.Space.Compact,{children:[A.jsx(X.Form.Item,{noStyle:!0,name:"field",children:A.jsx(X.Select,{style:{width:"100px"},onChange:()=>{y()},options:s})}),A.jsx(X.Form.Item,{name:"statisticalType",noStyle:!0,children:A.jsx(X.Select,{style:{width:"100px"},onChange:()=>{y()},options:[{value:"sum",label:p("sumVal")},{value:"max",label:p("maxVal")},{value:"min",label:p("minVal")},{value:"avg",label:p("averageVal")}]})})]})}):null})]}),A.jsx(K1,{open:u,value:d,fieldOptions:a,enumDataApi:r,onClose:()=>{f(!1)},onOk:_=>{C(_),y()}})]})},tle=({value:t,onChange:e})=>{const[r,n]=N.useState(),i=["#373c43","#3370ff","#4954e6","#34c724","#14c0ff","#ffc60a","#f80","#f76964"];return N.useEffect(()=>{n(t)},[t]),A.jsx("div",{className:"pane-item-body item-body-column",children:A.jsx("div",{className:"panel-single-color-selector",children:i.map((a,o)=>A.jsxs("div",{className:"panel-single-color-selector-color-item",onClick:()=>{n(a),e==null||e(a)},children:[A.jsx("div",{className:"panel-single-color-selector-color-item-background",style:{background:a}}),r===a?A.jsx("span",{className:"panel-icon",children:A.jsx(cD,{})}):null]},o))})})},rle=({selectModuleData:t,onAllValuesChange:e})=>{const[r]=X.Form.useForm(),{t:n}=Er(),i={color:"#373c43",unit:"1",precision:"",desc:""},a=()=>{setTimeout(()=>{e==null||e(r.getFieldsValue())})};return N.useEffect(()=>{t!=null&&t.customeStyle?r.setFieldsValue(t.customeStyle):r.setFieldsValue(i)},[t]),A.jsxs(X.Form,{form:r,name:"customeStyle",layout:"vertical",initialValues:i,children:[A.jsx(X.Form.Item,{label:n("statistics.t1"),name:"color",children:A.jsx(tle,{onChange:()=>{a()}})}),A.jsx(X.Form.Item,{label:n("statistics.t2"),extra:n("statistics.t3"),children:A.jsxs(X.Space.Compact,{children:[A.jsx(X.Form.Item,{name:"precision",noStyle:!0,children:A.jsx(X.InputNumber,{min:1,max:10,style:{width:"60%"},placeholder:n("statistics.t4"),onChange:()=>{a()}})}),A.jsx(X.Form.Item,{name:"unit",noStyle:!0,children:A.jsxs(X.Select,{onChange:()=>{a()},children:[A.jsx(X.Select.Option,{value:"1",children:n("statistics.t5")}),A.jsx(X.Select.Option,{value:"2",children:n("statistics.t6")}),A.jsx(X.Select.Option,{value:"3",children:n("statistics.t7")}),A.jsx(X.Select.Option,{value:"4",children:n("statistics.t8")}),A.jsx(X.Select.Option,{value:"5",children:n("statistics.t9")})]})})]})}),A.jsx(X.Form.Item,{label:n("statistics.t10"),name:"desc",children:A.jsx(X.Input,{onChange:()=>{a()}})})]})},nle=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{const{t:o}=Er(),[s,l]=N.useState(),[u,f]=N.useState(),c=()=>{e==null||e()};return N.useEffect(()=>{i&&(l(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]),A.jsx(A.Fragment,{children:A.jsx(X.Modal,{width:"65%",title:o("statisticsText"),footer:null,open:t,onOk:c,onCancel:e,closeIcon:A.jsx(Pc,{}),styles:{header:{padding:"10px",borderBottom:"1px solid #dee0e3",marginBottom:"10px"},content:{padding:0},body:{overflowY:"auto",flex:1}},children:A.jsxs("div",{className:"config-widget-dialog-container",children:[A.jsx("div",{className:"config-widget-dialog-content",children:A.jsx("div",{className:"config-widget-dialog-preview",children:A.jsx(HD,{customData:s,customeStyle:u,moduleDataApi:n})})}),A.jsxs("div",{className:"config-widget-dialog-panel",children:[A.jsx("div",{className:"bitable-dashboard edit-panel-container",children:A.jsx(X.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:A.jsx(ele,{selectModuleData:i,enumDataApi:a,onAllValuesChange:d=>{l(d)}})},{key:"2",label:o("customStyle"),children:A.jsx(rle,{selectModuleData:i,onAllValuesChange:d=>{f(d)}})}]})}),A.jsx("div",{className:"button-container",children:A.jsx(X.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,customData:s,customeStyle:u})},children:o("confirm")})})]})]})})})},ile=({selectModuleData:t,onAllValuesChange:e,enumDataApi:r})=>{const{globalData:n}=lo(),[i]=X.Form.useForm(),[a,o]=N.useState(),[s,l]=N.useState(!1),u=N.useRef(),[f,c]=N.useState({conditionList:[],conditionType:"all"}),[d,h]=N.useState(0),[v,g]=N.useState(),{t:p}=Er(),m={dataSourceId:"",startDateField:"",endDateField:"",titleField:""},y=()=>{setTimeout(()=>{e==null||e({...i.getFieldsValue(),conditionData:u.current})})},b=_=>{var x,D;const w=(D=(x=n==null?void 0:n.sourceData)==null?void 0:x.find(S=>S.value===_))==null?void 0:D.fields;return o(w),g(w==null?void 0:w.filter(S=>S.type==="timestamp")),w},C=_=>{var w;c(_),u.current=_,h(((w=_==null?void 0:_.conditionList)==null?void 0:w.length)||0)};return N.useEffect(()=>{var _,w,x,D,S,T;if(t!=null&&t.customData)i.setFieldsValue(t.customData),b((_=t==null?void 0:t.customData)==null?void 0:_.dataSourceId);else{const E=(w=n==null?void 0:n.sourceData)==null?void 0:w[0],R=(x=E==null?void 0:E.fields)==null?void 0:x.filter(M=>M.type==="timestamp");i.setFieldsValue({...m,dataSourceId:E==null?void 0:E.value,titleField:(S=(D=E==null?void 0:E.fields)==null?void 0:D[0])==null?void 0:S.value,startDateField:R==null?void 0:R[0].value,endDateField:R==null?void 0:R[0].value}),b(E==null?void 0:E.value),y()}C((T=t==null?void 0:t.customData)==null?void 0:T.conditionData)},[t,n]),A.jsxs(A.Fragment,{children:[A.jsxs(X.Form,{form:i,name:"customData",labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:m,children:[A.jsx("div",{style:{fontSize:"14px",marginBottom:"5px"},children:p("data")}),A.jsx(X.Form.Item,{label:p("dataSource"),name:"dataSourceId",children:A.jsx(X.Select,{options:n==null?void 0:n.sourceData,onChange:_=>{var x;const w=b(_);i.setFieldsValue({titleField:(x=w==null?void 0:w[0])==null?void 0:x.value}),y()}})}),A.jsxs(X.Form.Item,{label:p("dataRange"),children:[A.jsx(X.Button,{style:{marginLeft:"-15px"},onClick:()=>{l(!0)},type:"link",children:p("filterData")}),d>0?`${p("selectNcondition",{n:d})}`:null]}),A.jsx(X.Divider,{orientation:"left",orientationMargin:"0",children:p("calendar.t1")}),A.jsx(X.Form.Item,{label:p("calendar.t2"),name:"startDateField",children:A.jsx(X.Select,{onChange:()=>{y()},options:v})}),A.jsx(X.Form.Item,{label:p("calendar.t3"),name:"endDateField",children:A.jsx(X.Select,{onChange:()=>{y()},options:v})}),A.jsx(X.Form.Item,{label:p("calendar.t4"),name:"titleField",children:A.jsx(X.Select,{onChange:()=>{y()},options:a})})]}),A.jsx(K1,{open:s,value:f,fieldOptions:a,enumDataApi:r,onClose:()=>{l(!1)},onOk:_=>{C(_),y()}})]})},ale=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{const{t:o}=Er(),[s,l]=N.useState(),u=()=>{e==null||e()};return N.useEffect(()=>{i&&l(i==null?void 0:i.customData)},[i]),A.jsx(A.Fragment,{children:A.jsx(X.Modal,{width:"65%",title:o("calendarText"),footer:null,open:t,onOk:u,onCancel:e,closeIcon:A.jsx(Pc,{}),styles:{header:{padding:"10px",borderBottom:"1px solid #dee0e3",marginBottom:"10px"},content:{padding:0},body:{overflowY:"auto",flex:1}},children:A.jsxs("div",{className:"config-widget-dialog-container",children:[A.jsx("div",{className:"config-widget-dialog-content",children:A.jsx("div",{className:"config-widget-dialog-preview",style:{borderRight:"1px solid #e0e0e0"},children:A.jsx(gA,{customData:s,moduleDataApi:n})})}),A.jsxs("div",{className:"config-widget-dialog-panel",style:{borderLeft:"none"},children:[A.jsx("div",{className:"bitable-dashboard edit-panel-container",style:{paddingTop:"20px"},children:A.jsx(ile,{enumDataApi:a,selectModuleData:i,onAllValuesChange:f=>{l(f)}})}),A.jsx("div",{className:"button-container",children:A.jsx(X.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,customData:s})},children:o("confirm")})})]})]})})})},ole=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"17",y:"8",width:"6",height:"15.5",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"17",y:"24.5",width:"6",height:"15.5",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"28",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"28",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"50",y:"8",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"50",y:"18",width:"6",height:"22",rx:"0.5",fill:"#5b65f5"})]}),sle=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"17",y:"21",width:"6",height:"6",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"17",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"28",y:"24",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"28",y:"34",width:"6",height:"6",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"39",y:"8",width:"6",height:"19",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"39",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"}),A.jsx("rect",{x:"50",y:"18",width:"6",height:"9",rx:"0.5",fill:"#959bee"}),A.jsx("rect",{x:"50",y:"28",width:"6",height:"12",rx:"0.5",fill:"#5b65f5"})]}),lle=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"58",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 58 11)",fill:"#959bee"}),A.jsx("rect",{x:"42",y:"11",width:"4",height:"28",rx:"0.5",transform:"rotate(90 42 11)",fill:"#5b65f5"}),A.jsx("rect",{x:"58",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 58 18)",fill:"#959bee"}),A.jsx("rect",{x:"35.5",y:"18",width:"4",height:"21.5",rx:"0.5",transform:"rotate(90 35.5 18)",fill:"#5b65f5"}),A.jsx("rect",{x:"58",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 58 25)",fill:"#959bee"}),A.jsx("rect",{x:"23",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 23 25)",fill:"#5b65f5"}),A.jsx("rect",{x:"58",y:"32",width:"4",height:"17",rx:"0.5",transform:"rotate(90 58 32)",fill:"#959bee"}),A.jsx("rect",{x:"40",y:"32",width:"4",height:"26",rx:"0.5",transform:"rotate(90 40 32)",fill:"#5b65f5"})]}),ule=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("rect",{x:"40",y:"11",width:"4",height:"15",rx:"0.5",transform:"rotate(90 40 11)",fill:"#959bee"}),A.jsx("rect",{x:"24",y:"11",width:"4",height:"8",rx:"0.5",transform:"rotate(90 24 11)",fill:"#5b65f5"}),A.jsx("rect",{x:"48",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 48 18)",fill:"#959bee"}),A.jsx("rect",{x:"31.5",y:"18",width:"4",height:"15.5",rx:"0.5",transform:"rotate(90 31.5 18)",fill:"#5b65f5"}),A.jsx("rect",{x:"60",y:"25",width:"4",height:"34",rx:"0.5",transform:"rotate(90 60 25)",fill:"#959bee"}),A.jsx("rect",{x:"25",y:"25",width:"4",height:"9",rx:"0.5",transform:"rotate(90 25 25)",fill:"#5b65f5"}),A.jsx("rect",{x:"43",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 43 32)",fill:"#959bee"}),A.jsx("rect",{x:"29",y:"32",width:"4",height:"13",rx:"0.5",transform:"rotate(90 29 32)",fill:"#5b65f5"})]}),fle=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("path",{d:"M15.5 33.5C20.2023 32.3804 23.5007 28.5533 25.7095 24.6682C28.3082 20.0974 34.0857 17.3668 38.758 19.7783L39.8066 20.3195C42.9001 21.9162 46.671 21.329 49.1326 18.8674L58 10",stroke:"#959bee",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),A.jsx("path",{d:"M16.5 15L26.844 27.6427C28.7759 30.0039 31.8825 31.0607 34.8535 30.3675L42.3359 28.6216C44.0629 28.2187 45.8748 28.401 47.4869 29.1398L57 33.5",stroke:"#5b65f4",strokeWidth:"1.5",strokeLinecap:"round"})]}),cle=()=>A.jsxs("svg",{width:"72",height:"48",viewBox:"0 0 72 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[A.jsx("path",{d:"M20 24C20 32.8366 27.1634 40 36 40C44.8366 40 52 32.8366 52 24C52 15.1634 44.8366 8 36 8C27.1634 8 20 15.1634 20 24ZM46.3944 24C46.3944 29.7407 41.7407 34.3944 36 34.3944C30.2593 34.3944 25.6056 29.7407 25.6056 24C25.6056 18.2593 30.2593 13.6056 36 13.6056C41.7407 13.6056 46.3944 18.2593 46.3944 24Z",fill:"#5b65f4"}),A.jsx("path",{d:"M52 24C52 19.7565 50.3143 15.6869 47.3137 12.6863C44.3131 9.68571 40.2435 8 36 8V13.6056C38.7568 13.6056 41.4006 14.7007 43.35 16.65C45.2993 18.5994 46.3944 21.2432 46.3944 24H52Z",fill:"#959bee"}),A.jsx("path",{d:"M52 24C52 20.9896 51.1507 18.0403 49.5497 15.4909L44.8026 18.4721C45.8427 20.1283 46.3944 22.0443 46.3944 24H52Z",fill:"#cdcff9"})]}),dle=({selectModuleData:t,onAllValuesChange:e,onValuesChange:r,enumDataApi:n})=>{const{globalData:i}=lo(),[a]=X.Form.useForm(),[o,s]=N.useState(),[l,u]=N.useState(),[f,c]=N.useState(),[d,h]=N.useState(!1),v=N.useRef(),[g,p]=N.useState({conditionList:[],conditionType:"all"}),[m,y]=N.useState(0),{t:b}=Er(),C=X.Form.useWatch("type",a),_={dataSourceId:"",yAxis:"recordTotal",chartOptions:["legend","label","axis","splitLine"],sortField:"xAxis",sortOrder:"asc"},w=()=>{setTimeout(()=>{e==null||e({...a.getFieldsValue(),conditionData:v.current})},100)},x=S=>{var E,R;const T=(R=(E=i==null?void 0:i.sourceData)==null?void 0:E.find(M=>M.value===S))==null?void 0:R.fields;return s(T),c(T==null?void 0:T.filter(M=>M.type==="int"||M.type==="float")),u(T==null?void 0:T.filter(M=>M.value!==S)),T},D=S=>{var T;p(S),v.current=S,y(((T=S==null?void 0:S.conditionList)==null?void 0:T.length)||0)};return N.useEffect(()=>{var S,T,E;if(t!=null&&t.customData){const R=t.customData;x(R==null?void 0:R.dataSourceId),a.setFieldsValue(R)}else{const R=(S=i==null?void 0:i.sourceData)==null?void 0:S[0],M=x(R==null?void 0:R.value)||[];a.setFieldsValue({..._,dataSourceId:R==null?void 0:R.value,type:t==null?void 0:t.type,xAxis:(T=M==null?void 0:M[0])==null?void 0:T.value})}D((E=t==null?void 0:t.customData)==null?void 0:E.conditionData),w()},[t,i]),A.jsxs("div",{style:{height:"50vh",overflowX:"auto"},children:[A.jsxs(X.Form,{form:a,name:"customData",layout:"vertical",onValuesChange:r,initialValues:_,children:[A.jsx(X.Form.Item,{label:b("dataSource"),name:"dataSourceId",children:A.jsx(X.Select,{options:i==null?void 0:i.sourceData,onChange:S=>{var E;const T=x(S);a.setFieldsValue({yAxis:"recordTotal",xAxis:(E=T==null?void 0:T[0])==null?void 0:E.value}),w()}})}),A.jsxs(X.Form.Item,{label:b("dataRange"),children:[A.jsx(X.Button,{style:{marginLeft:"-15px"},onClick:()=>{h(!0)},type:"link",children:b("filterData")}),m>0?`${b("selectNcondition",{n:m})}`:null]}),A.jsx(X.Form.Item,{label:b("chart.t1"),name:"type",children:A.jsx(X.Select,{onChange:()=>{w()},options:[{label:b("chart.t2"),value:"chart-bar",icon:A.jsx(LN,{})},{label:b("chart.t3"),value:"chart-bar-pile",icon:A.jsx(sle,{})},{label:b("chart.t4"),value:"chart-bar-percentage",icon:A.jsx(ole,{})},{label:b("chart.t5"),value:"chart-strip-bar",icon:A.jsx(zN,{})},{label:b("chart.t6"),value:"chart-strip-bar-pile",icon:A.jsx(ule,{})},{label:b("chart.t7"),value:"chart-strip-bar-percentage",icon:A.jsx(lle,{})},{label:b("chart.t8"),value:"chart-line",icon:A.jsx(kN,{})},{label:b("chart.t9"),value:"chart-line-smooth",icon:A.jsx(fle,{})},{label:b("chart.t10"),value:"chart-pie",icon:A.jsx(jN,{})},{label:b("chart.t11"),value:"chart-pie-circular",icon:A.jsx(cle,{})}],optionRender:S=>A.jsxs(X.Flex,{align:"center",children:[A.jsx("span",{role:"img",style:{marginTop:"5px"},"aria-label":S.data.label,children:S.data.icon}),S.data.label]})})}),A.jsx(X.Form.Item,{name:"chartOptions",label:b("chart.t12"),children:A.jsxs(X.Checkbox.Group,{onChange:()=>{w()},children:[A.jsx(X.Checkbox,{value:"legend",style:{lineHeight:"32px"},children:b("chart.t13")}),A.jsx(X.Checkbox,{value:"label",style:{lineHeight:"32px"},children:b("chart.t14")}),["chart-pie","chart-pie-circular"].includes(C)?null:A.jsxs(A.Fragment,{children:[A.jsx(X.Checkbox,{value:"axis",style:{lineHeight:"32px"},children:b("chart.t15")}),A.jsx(X.Checkbox,{value:"splitLine",style:{lineHeight:"32px"},children:b("chart.t16")})]})]})}),A.jsx(X.Divider,{style:{borderColor:"#e2e2e2",marginTop:0}}),A.jsx(X.Form.Item,{label:C!=null&&C.includes("pie")?b("chart.t17"):b("chart.t18"),name:"xAxis",children:A.jsx(X.Select,{onChange:S=>{const T=o==null?void 0:o.filter(E=>E.value!==S);u(T),a.setFieldsValue({groupField:T==null?void 0:T[0].value}),w()},options:o})}),A.jsx(X.Form.Item,{dependencies:["type"],children:({getFieldValue:S})=>{var T;return(T=S("type"))!=null&&T.includes("pie")?null:A.jsxs(A.Fragment,{children:[A.jsx(X.Form.Item,{name:"sortField",label:b("chart.t31"),children:A.jsxs(X.Radio.Group,{onChange:()=>{w()},children:[A.jsx(X.Radio,{value:"xAxis",children:b("chart.t32")}),A.jsx(X.Radio,{value:"yAxisField",children:b("chart.t33")}),A.jsx(X.Radio,{value:"recordValue",children:b("chart.t34")})]})}),A.jsx(X.Form.Item,{name:"sortOrder",label:b("chart.t35"),children:A.jsxs(X.Radio.Group,{onChange:()=>{w()},children:[A.jsx(X.Radio,{value:"asc",children:b("chart.t36")}),A.jsx(X.Radio,{value:"desc",children:b("chart.t37")})]})})]})}}),A.jsx(X.Form.Item,{label:C!=null&&C.includes("pie")?b("chart.t19"):b("chart.t20"),name:"yAxis",children:A.jsx(X.Select,{onChange:S=>{a.setFieldsValue({yAxisField:S==="fieldValue"?f==null?void 0:f[0].value:"",yAxisFieldType:"sum"}),w()},options:[{value:"recordTotal",label:b("statisticstRecordNum")},{value:"fieldValue",label:b("statisticstFieldVal")}]})}),A.jsx(X.Form.Item,{dependencies:["yAxis"],noStyle:!0,children:({getFieldValue:S})=>S("yAxis")==="fieldValue"?A.jsx(X.Form.Item,{label:b("selectField"),children:A.jsxs(X.Space.Compact,{children:[A.jsx(X.Form.Item,{noStyle:!0,name:"yAxisField",children:A.jsx(X.Select,{style:{width:"100px"},onChange:()=>{w()},options:f})}),A.jsx(X.Form.Item,{name:"yAxisFieldType",noStyle:!0,children:A.jsx(X.Select,{style:{width:"100px"},onChange:()=>{w()},options:[{value:"sum",label:b("sumVal")},{value:"max",label:b("maxVal")},{value:"min",label:b("minVal")},{value:"avg",label:b("averageVal")}]})})]})}):null}),A.jsx(X.Form.Item,{dependencies:["type"],children:({getFieldValue:S})=>{var T;return(T=S("type"))!=null&&T.includes("pie")?null:A.jsxs(X.Form.Item,{children:[A.jsx(X.Form.Item,{name:"isGroup",valuePropName:"checked",noStyle:!0,children:A.jsx(X.Checkbox,{onChange:E=>{if(E){const R=a.getFieldValue("xAxis"),M=o==null?void 0:o.filter(P=>P.value!==R);u(M),a.setFieldsValue({groupField:M==null?void 0:M[0].value})}w()},style:{marginBottom:"5px"},children:"分组聚合"})}),A.jsx(X.Form.Item,{dependencies:["isGroup"],children:({getFieldValue:E})=>E("isGroup")?A.jsx(X.Form.Item,{name:"groupField",children:A.jsx(X.Select,{options:l,onChange:()=>{w()}})}):null})]})}})]}),A.jsx(K1,{open:d,value:g,fieldOptions:o,enumDataApi:n,onClose:()=>{h(!1)},onOk:S=>{D(S),w()}})]})},hle=({customData:t,selectModuleData:e,onAllValuesChange:r})=>{var s,l;const[n]=X.Form.useForm(),{t:i}=Er(),a={xtitle:"",ytitle:"",xchartOptions:[],ychartOptions:[]},o=()=>{setTimeout(()=>{r==null||r(n.getFieldsValue())})};return N.useEffect(()=>{e!=null&&e.customeStyle?n.setFieldsValue(e.customeStyle):n.setFieldsValue(a)},[e]),A.jsx("div",{style:{height:"50vh",overflowX:"auto"},children:A.jsxs(X.Form,{form:n,name:"customeStyle",layout:"vertical",initialValues:a,children:[A.jsx(X.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t21")}),(s=t==null?void 0:t.type)!=null&&s.includes("pie")?null:A.jsx(X.Form.Item,{label:i("chart.t22"),name:"xtitle",children:A.jsx(X.Input,{onChange:()=>{o()}})}),A.jsx(X.Form.Item,{name:"xchartOptions",label:i("chart.t23"),children:A.jsx(X.Checkbox.Group,{onChange:()=>{o()},children:A.jsxs(X.Row,{children:[A.jsx(X.Col,{span:12,children:A.jsx(X.Checkbox,{value:"label",style:{lineHeight:"32px"},children:i("chart.t24")})}),A.jsx(X.Col,{span:12,children:A.jsx(X.Checkbox,{value:"axisLine",style:{lineHeight:"32px"},children:i("chart.t25")})})]})})}),A.jsx(X.Divider,{orientation:"left",orientationMargin:"0",children:i("chart.t26")}),(l=t==null?void 0:t.type)!=null&&l.includes("pie")?null:A.jsx(X.Form.Item,{label:i("chart.t27"),name:"ytitle",children:A.jsx(X.Input,{onChange:()=>{o()}})}),A.jsx(X.Form.Item,{name:"ychartOptions",label:i("chart.t28"),children:A.jsx(X.Checkbox.Group,{onChange:()=>{o()},children:A.jsxs(X.Row,{children:[A.jsx(X.Col,{span:12,children:A.jsx(X.Checkbox,{value:"label",style:{lineHeight:"32px"},children:i("chart.t29")})}),A.jsx(X.Col,{span:12,children:A.jsx(X.Checkbox,{value:"axisLine",style:{lineHeight:"32px"},children:i("chart.t30")})})]})})})]})})},vle=({open:t,onClose:e,onOk:r,moduleDataApi:n,selectModuleData:i,enumDataApi:a})=>{const{t:o}=Er(),[s,l]=N.useState(),[u,f]=N.useState(),c=()=>{e==null||e()};return N.useEffect(()=>{i&&(l(i==null?void 0:i.customData),f(i==null?void 0:i.customeStyle))},[i]),A.jsx(A.Fragment,{children:A.jsx(X.Modal,{width:"65%",title:o("chartText"),footer:null,open:t,onOk:c,onCancel:e,destroyOnClose:!0,closeIcon:A.jsx(Pc,{}),styles:{header:{padding:"10px",borderBottom:"1px solid #dee0e3",marginBottom:"10px"},content:{padding:0},body:{overflowY:"auto",flex:1}},children:A.jsxs("div",{className:"config-widget-dialog-container",children:[A.jsx("div",{className:"config-widget-dialog-content",children:A.jsx("div",{className:"config-widget-dialog-preview",children:A.jsx(iN,{customData:s,customeStyle:u,moduleDataApi:n})})}),A.jsxs("div",{className:"config-widget-dialog-panel",children:[A.jsx("div",{className:"bitable-dashboard edit-panel-container",children:A.jsx(X.Tabs,{defaultActiveKey:"1",items:[{key:"1",label:o("typeData"),children:A.jsx(dle,{enumDataApi:a,selectModuleData:i,onAllValuesChange:d=>{l(d)}})},{key:"2",label:o("customStyle"),children:A.jsx(hle,{customData:s,selectModuleData:i,onAllValuesChange:d=>{f(d)}})}]})}),A.jsx("div",{className:"button-container",children:A.jsx(X.Button,{type:"primary",onClick:()=>{r==null||r({id:i==null?void 0:i.id,type:i==null?void 0:i.type,customData:s,customeStyle:u})},children:o("confirm")})})]})]})})})},ple={...{title:"仪表盘",text:"文本",confirm:"确定",pleaseEnter:"请输入",configuration:"配置",copy:"复制",delete:"删除",calendarText:"日历",chartText:"图表",promptTitle:"提示",promptContentDeleteComponents:"确认删除组件?",unnamedRecord:"未命名记录",setFilteringCriteria:"设置筛选条件",all:"所有",everyone:"任一",condition:"条件",addCondition:"添加条件",equalto:"等于",notequalto:"不等于",contain:"包含",notcontain:"不包含",null:"为空",notnull:"不为空",conformTo:"符合以下",statisticsText:"统计文字",typeData:"类型与数据",customStyle:"自定义样式",dataSource:"数据源",dataRange:"数据范围",data:"数据",filterData:"筛选数据",selectNcondition:"已选{{n}}个条件",allData:"全部数据",statisticstMethods:"统计方式",statisticstRecordNum:"统计记录总数",statisticstFieldVal:"统计字段数值",selectField:"选择字段",sumVal:"求和",maxVal:"最大值",minVal:"最小值",averageVal:"平均值"},pb:{text:"文本",statisticsText:"统计",unknown:"未知"},statistics:{t1:"配色方案",t2:"数值设置",t3:"小数位数与格式",t4:"请输入小数位数",t5:"数字(千分位)",t6:"数字",t7:"百分比",t8:"人名币",t9:"美元",t10:"统计数值说明",t11:"",t12:"",t13:""},chart:{t1:"图表类型",t2:"基础柱状图",t3:"堆积柱状图",t4:"百分比堆积柱状图",t5:"基础条形图",t6:"堆积条形图",t7:"百分比堆积条形图",t8:"折线图",t9:"平滑折线图",t10:"饼图",t11:"环形图",t12:"图标选项",t13:"图例",t14:"数据标签",t15:"坐标轴",t16:"网格线",t17:"扇形分区",t18:"横轴(类别)",t19:"扇形数值",t20:"纵轴(字段)",t21:"横轴",t22:"横轴标题",t23:"坐标轴选项",t24:"显示标签",t25:"显示轴线",t26:"纵轴",t27:"纵轴标题",t28:"坐标轴选项",t29:"显示标签",t30:"显示轴线",t31:"排序依据",t32:"横轴值",t33:"纵轴值",t34:"记录循序",t35:"排序规则",t36:"正序",t37:"倒序",t38:"分组聚合"},calendar:{t1:"视图配置",t2:"开始日期",t3:"结束日期",t4:"标题展示"},add:{add1:"图表",add2:"柱状图",add3:"折线图",add4:"饼图",add5:"条形图",add6:"其他",add7:"统计数字",add8:"文本",add9:"日历",add10:"添加组件",add11:"等于",add12:"不等于",add13:"等于",add14:"早于",add15:"晚于",add16:"范围内",add17:"为空",add18:"不为空",add19:"不等于",add20:"大于",add21:"大于等于",add22:"小于",add23:"小于等于",add24:"包含",add25:"不包含",add26:"具体日期",add27:"今天",add28:"昨天",add29:"本周",add30:"上周",add31:"本月",add32:"上月",add33:"过去7天",add34:"过去30天"}},gle={...{title:"Dashboard",text:"Text",confirm:"Confirm",pleaseEnter:"Please enter",configuration:"Configuration",copy:"Copy",delete:"Delete",calendarText:"Calendar",chartText:"Chart",promptTitle:"Prompt",promptContentDeleteComponents:"Are you sure you want to delete this component?",unnamedRecord:"Unnamed Record",setFilteringCriteria:"Set filtering criteria",all:"All",everyone:"Anyone",condition:"Condition",addCondition:"Add condition",equalto:"Equal to",notequalto:"Not equal to",contain:"Contains",notcontain:"Does not contain",null:"Is empty",notnull:"Is not empty",conformTo:"Conform to the following",statisticsText:"Statistics Text",typeData:"Type and Data",customStyle:"Custom Style",dataSource:"Data Source",dataRange:"Data Range",data:"Data",filterData:"Filter Data",selectNcondition:"Selected {{n}} conditions",allData:"All Data",statisticstMethods:"Statistical Methods",statisticstRecordNum:"Total Number of Records",statisticstFieldVal:"Statistical Field Values",selectField:"Select Field",sumVal:"Sum",maxVal:"Maximum Value",minVal:"Minimum Value",averageVal:"Average Value"},pb:{text:"text",statisticsText:"Statistics",unknown:"unknown"},statistics:{t1:"Color Scheme",t2:"Value Settings",t3:"Decimal Places and Format",t4:"Please enter decimal places",t5:"Number (Thousand Separator)",t6:"Number",t7:"Percentage",t8:"Renminbi",t9:"Dollar",t10:"Statistical Value Description",t11:"",t12:"",t13:""},chart:{t1:"Chart Type",t2:"Basic Bar Chart",t3:"Stacked Bar Chart",t4:"Percentage Bar Chart",t5:"Basic Horizontal Bar Chart",t6:"Stacked Horizontal Bar Chart",t7:"Percentage Stacked Horizontal Bar Chart",t8:"Line Chart",t9:"Smooth Line Chart",t10:"Pie Chart",t11:"Doughnut Chart",t12:"Chart Options",t13:"Legend",t14:"Data Label",t15:"Axis",t16:"Grid Line",t17:"Sector Division",t18:"Horizontal Axis (Category)",t19:"Sector Value",t20:"Vertical Axis (Field)",t21:"Horizontal Axis",t22:"Horizontal Axis Title",t23:"Axis Options",t24:"Show Labels",t25:"Show Axis Line",t26:"Vertical Axis",t27:"Vertical Axis Title",t28:"Axis Options",t29:"Show Labels",t30:"Show Axis Line",t31:"Sort By",t32:"Horizontal Axis Value",t33:"Vertical Axis Value",t34:"Record Sequence",t35:"Sort Order",t36:"Ascending",t37:"Descending",t38:"Grouping And Aggregation"},calendar:{t1:"View Configuration",t2:"Start Date",t3:"End Date",t4:"Title Display"},add:{add1:"Chart",add2:"Bar Chart",add3:"Line Chart",add4:"Pie Chart",add5:"Bar Graph",add6:"Other",add7:"Statistics",add8:"Text",add9:"Calendar",add10:"Add Component",add11:"Equal to",add12:"Not Equal to",add13:"Equal to",add14:"Before",add15:"After",add16:"Within Range",add17:"Is Empty",add18:"Is Not Empty",add19:"Not Equal to",add20:"Greater than",add21:"Greater than or Equal to",add22:"Less than",add23:"Less than or Equal to",add24:"Contains",add25:"Does Not Contain",add26:"Specific Date",add27:"Today",add28:"Yesterday",add29:"This Week",add30:"Last Week",add31:"This Month",add32:"Last Month",add33:"Past 7 Days",add34:"Past 30 Days"}};Ae.use(t9).init({resources:{"zh-CN":{translation:ple},"en-US":{translation:gle}},lng:"zh-CN",fallbackLng:"zh-CN",interpolation:{escapeValue:!1}});const mle=()=>A.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-icon":"MoreVerticalOutlined",children:A.jsx("path",{d:"M12 5.5A1.75 1.75 0 1 1 12 2a1.75 1.75 0 0 1 0 3.5Zm0 8.225a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5ZM12 22a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5Z",fill:"currentColor"})}),yle=()=>A.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-icon":"DragOutlined",children:A.jsx("path",{d:"M8.25 6.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Zm0 7.25a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Zm1.75 5.5a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0ZM14.753 6.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5ZM16.5 12a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0Zm-1.747 9a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Z",fill:"#999"})}),ble=({defaultValue:t,onChange:e,module:r,onDropdownItem:n,onMouseDown:i,onMouseUp:a})=>{const[o,s]=N.useState(!1),[l,u]=N.useState(""),f=N.useRef(null),c=_D(g=>{e==null||e(g)},300),{t:d}=Er();N.useEffect(()=>{u(l)},[t]);const h=()=>{var p;((p=f.current)==null?void 0:p.input).select()},v=g=>{g.key==="Enter"&&s(!1)};return A.jsxs("div",{className:"layout-item-head isCanDrag",onMouseDown:()=>{i==null||i()},onMouseUp:()=>{a==null||a()},children:[A.jsxs("div",{className:"head-inner",children:[A.jsx("span",{className:"title",children:A.jsx("span",{className:"title-child",onDoubleClick:g=>{g.stopPropagation(),s(!0),setTimeout(()=>{var p;(p=f.current)==null||p.focus()},100)},children:o?A.jsx(X.Input,{defaultValue:t,onBlur:()=>{s(!1)},ref:f,onKeyDown:v,onDoubleClick:h,onChange:g=>{u(g.target.value),c(g.target.value)}}):t})}),A.jsx("div",{className:"menu-slot isNoCanDrag",children:A.jsx(X.Dropdown,{trigger:["click"],menu:{items:[r.type!=="text"?{label:d("configuration"),key:"edit"}:null,{label:d("copy"),key:"copy"},{key:"delete",danger:!0,label:d("delete")}],onClick:({key:g})=>{n==null||n(g)}},children:A.jsx("button",{type:"button",className:"dashboard-grid-menu-button",children:A.jsx("span",{className:"universe-icon",children:A.jsx(mle,{})})})})})]}),A.jsx("div",{className:"drag isCanDrag",children:A.jsx("span",{className:"universe-icon drag-icon",children:A.jsx(yle,{})})})]})},_le=N.memo(ble),Cle=bC.WidthProvider(bC.Responsive),wle=({sourceData:t,moduleConfigData:e,fieldMap:r,moduleDataApi:n,enumDataApi:i,onCreateModule:a,onUpdateModule:o,onDeleteModule:s,lang:l,className:u="layout",cols:f={lg:12,md:12,sm:12,xs:12,xxs:12},rowHeight:c=79})=>{const d=[10,10],{setGlobalData:h}=lo(),[v,g]=N.useState([]),[p,m]=N.useState(0),[y,b]=N.useState(),[C,_]=N.useState(),[w,x]=N.useState(!1),{i18n:D,t:S}=Er(),[T,E]=N.useState(!1),[R,M]=N.useState(!1),[P,B]=N.useState(!1),F={text:S("pb.text"),calendar:S("calendarText"),statistics:S("chartText")},[,H]=N.useState(f.lg),j=async U=>{const I=U.type==="calendar"?5:4,Y=U.type==="calendar"?5:3;if(Array.isArray(v)&&U.type){const z={x:0,y:0,w:I,h:Y,title:U.type.includes("chart")?S("chartText"):F[U.type],...U,type:U.type};await(a==null?void 0:a(z).then(G=>{var Q,K;if(!G.success){X.message.error(G.message);return}g([...v,{...z,i:(Q=G.data)==null?void 0:Q.id,id:(K=G.data)==null?void 0:K.id}])}))}},W=async(U,I)=>{if(v!=null&&v.length){const z={...v.find(Q=>Q.id===U),...I},G=v.map(Q=>Q.id===U?z:Q);g(G),await(o==null?void 0:o(z).then(Q=>{if(!Q.success){X.message.error(Q.message);return}}))}},L=async U=>{if(!(v!=null&&v.length)||!(U!=null&&U.length))return;const I=v.map(Y=>{const z=U.find(G=>G.id===Y.id);return z?{...Y,...z}:Y});g(I);try{for(const Y of U){const z=await(o==null?void 0:o(Y));if(!(z!=null&&z.success))throw new Error((z==null?void 0:z.message)||`Failed to update module: ${Y.id}`)}}catch(Y){g(v),X.message.error(Y.message||"Failed to update modules")}},q=async U=>{v!=null&&v.length&&(g(v.filter(I=>I.id!==U)),await(s==null?void 0:s(U||"")))},J=(U,I)=>{H(I)},ee=U=>{if(U==="text"){const I={type:U,customData:{title:S("text"),editor:[{type:"paragraph",children:[{text:""}]}]}};j(I)}else U==="statistics"?E(!0):U==="calendar"?M(!0):U!=null&&U.includes("chart")&&B(!0);_({title:"",type:U,w:0,h:0,x:0,y:0})},ae=U=>{const I=mG(U,v);L(I.map(Y=>({...v==null?void 0:v.find(G=>G.i===Y.i),...Y})))};return N.useEffect(()=>{h({fieldMap:r,sourceData:t})},[r,h,t]),N.useEffect(()=>{g((e==null?void 0:e.map(U=>({...U,i:U.i?U.i:U.id})))||[])},[e]),N.useEffect(()=>{D.changeLanguage(l||"zh_CN")},[D,l]),A.jsxs("div",{className:"pivot-table",children:[A.jsxs("div",{className:"bitable-block-dashboard",children:[A.jsx("div",{className:"bitable-block-dashboard-toolbar bitable-toolbar",children:A.jsx("div",{className:"bitable-block-dashboard-toolbar--left",children:A.jsx(qse,{onOk:U=>{ee(U)}})})}),A.jsx("div",{className:"bitable-block-dashboard__mount",children:A.jsx("div",{className:"dashboard-container",children:A.jsx("div",{className:`dashboard-content-container ${w?"isResizableDraggable":""}`,children:A.jsx(Cle,{onBreakpointChange:J,className:u,compactType:"vertical",preventCollision:!1,cols:f,margin:d,rowHeight:c,measureBeforeMount:!1,draggableHandle:".isCanDrag",onWidthChange:(U,I,Y)=>{m(U/Y-1)},onDragStart:()=>{x(!0)},onDragStop:U=>{x(!1),ae(U)},onResizeStart:()=>{x(!0)},onResizeStop:U=>{x(!1),ae(U)},style:{backgroundSize:`${p}px ${c+d[0]}px`,backgroundPosition:`${d[0]}px ${d[0]}px`,minHeight:"100vh"},children:v==null?void 0:v.map(U=>A.jsxs("div",{className:`box-dashboard ${y===U.id?"active":""}`,onClick:()=>{b(U.id)},"data-grid":{i:U.id,x:U.x||0,y:U.y||0,w:U.w||2,h:U.h||2,minW:2,minH:2},children:[A.jsx(_le,{module:U,defaultValue:U.title,onChange:I=>W(U.id,{title:I}),onDropdownItem:I=>{var Y;if(I==="edit")b(U.id),_(U),U.type==="statistics"&&E(!0),(Y=U.type)!=null&&Y.includes("chart")&&B(!0),U.type==="calendar"&&M(!0);else if(I==="delete")X.Modal.confirm({title:S("promptTitle"),icon:A.jsx(hD,{}),content:S("promptContentDeleteComponents"),onOk(){q(U.id)}});else if(I==="copy"){const z=JSON.parse(JSON.stringify(U));delete z.id,delete z.i,j(z)}}}),A.jsx(Wse,{module:U,onUpdate:W,moduleDataApi:n,activeId:y,onClick:()=>{b(U.id)},rowWidth:p,rowHeight:c,onEdit:()=>{var I;b(U.id),_(U),U.type==="statistics"&&E(!0),(I=U.type)!=null&&I.includes("chart")&&B(!0),U.type==="calendar"&&M(!0)},onDelete:()=>{q(U.id)},onCopy:()=>{const I=JSON.parse(JSON.stringify(U));delete I.id,delete I.i,j(I)},onStartDragOrResize:()=>{x(!0)},onStopDragOrResize:()=>{x(!1)}})]},U.id))})})})})]}),A.jsx(nle,{open:T,selectModuleData:C,onClose:()=>{E(!1)},onOk:({id:U,customData:I,customeStyle:Y})=>{U?W(U,{type:"statistics",customData:I,customeStyle:Y}):j({type:"statistics",customData:I,customeStyle:Y}),E(!1)},moduleDataApi:n,enumDataApi:i}),A.jsx(ale,{open:R,selectModuleData:C,onClose:()=>{M(!1)},onOk:({id:U,customData:I})=>{U?W(U,{type:"calendar",customData:I}):j({type:"calendar",customData:I}),M(!1)},moduleDataApi:n,enumDataApi:i}),A.jsx(vle,{open:P,selectModuleData:C,onClose:()=>{B(!1)},onOk:({id:U,type:I,customData:Y,customeStyle:z})=>{U?W(U,{type:I,customData:Y,customeStyle:z}):j({type:I,customData:Y,customeStyle:z}),B(!1)},moduleDataApi:n,enumDataApi:i})]})},xle=N.memo(t=>A.jsx(gG,{children:A.jsx(wle,{...t})}));Yt.PivotTable=xle,Object.defineProperty(Yt,Symbol.toStringTag,{value:"Module"})});
|