@advt-gpt-chart/package 3.0.8 → 3.0.10
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/dist/Chart/ChartControllers/utils.d.ts +2 -2
- package/dist/Chart/DataSource/index.d.ts +2 -2
- package/dist/Chart/DataSource/metricInsight.d.ts +3 -2
- package/dist/index.es.js +83 -92
- package/dist/index.es.js.gz +0 -0
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.gz +0 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -21,13 +21,13 @@ export declare function handleMqlMetricsInfo(mql: string, controlInfo: any): {
|
|
|
21
21
|
metricsOptions: any[];
|
|
22
22
|
dataFormat: any;
|
|
23
23
|
};
|
|
24
|
-
export declare function handleMqlControlInfo(
|
|
24
|
+
export declare function handleMqlControlInfo(mqlParams: any, metricsInfo: any, dimensionsData: any[], metricTime: {
|
|
25
25
|
label: string;
|
|
26
26
|
value: string;
|
|
27
27
|
}): {
|
|
28
28
|
metrics: any;
|
|
29
29
|
dataFormat: any;
|
|
30
|
-
dimensions: any
|
|
30
|
+
dimensions: any;
|
|
31
31
|
dissionOptions: any[];
|
|
32
32
|
timeDimension: any;
|
|
33
33
|
filters: any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DataSourceType } from './types';
|
|
1
|
+
import { DataSource, DataSourceType } from './types';
|
|
2
2
|
export interface DataSourceMethods {
|
|
3
3
|
queryMql2Params: (params: any) => Promise<any>;
|
|
4
|
-
queryChartData: (
|
|
4
|
+
queryChartData: (dataSource: DataSource, params: any) => Promise<any>;
|
|
5
5
|
queryMetricId: (metricId: string) => Promise<any>;
|
|
6
6
|
queryDimensions: (params: any) => Promise<any>;
|
|
7
7
|
transformData: (params: any) => any;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { QueryData, TableData } from '../ChartControllers/TimeRange/types';
|
|
2
|
+
import { DataSource } from './types';
|
|
2
3
|
export declare const queryMetricId: (id: string) => Promise<any>;
|
|
3
4
|
export declare const queryDimensions: (metricIds: string[]) => Promise<any>;
|
|
4
5
|
export declare const queryMql2Params: (mql: any) => Promise<any>;
|
|
5
|
-
export declare const queryChartData: (
|
|
6
|
+
export declare const queryChartData: (dataSource: DataSource, queryData: QueryData) => Promise<any>;
|
|
6
7
|
export declare const queryParamsChartData: ({ timeRange, metrics, dimensions, timeGrain, filters, queryMetricOrgId, }: QueryData) => Promise<any>;
|
|
7
|
-
export declare const queryMqlChartData: ({ timeRange, metrics, dimensions, timeGrain, filters, queryMetricOrgId, queryType
|
|
8
|
+
export declare const queryMqlChartData: (dataSource: DataSource, { timeRange, metrics, dimensions, timeGrain, filters, queryMetricOrgId, queryType }: QueryData) => Promise<any>;
|
|
8
9
|
export declare const transformData: (params: {
|
|
9
10
|
data: TableData;
|
|
10
11
|
}) => {
|
package/dist/index.es.js
CHANGED
|
@@ -181673,7 +181673,7 @@ function VQe() {
|
|
|
181673
181673
|
throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");
|
|
181674
181674
|
return i;
|
|
181675
181675
|
}
|
|
181676
|
-
const Yxi = "3.0.
|
|
181676
|
+
const Yxi = "3.0.10", Sce = /* @__PURE__ */ Qy({});
|
|
181677
181677
|
function jQe(i) {
|
|
181678
181678
|
var e, t, n = "";
|
|
181679
181679
|
if (typeof i == "string" || typeof i == "number") n += i;
|
|
@@ -183112,7 +183112,7 @@ const awi = (i) => i ? i == null ? void 0 : i.map((e) => Me({}, e.subFilter)) :
|
|
|
183112
183112
|
var n;
|
|
183113
183113
|
return ((n = t == null ? void 0 : t.data) == null ? void 0 : n.items) || [];
|
|
183114
183114
|
});
|
|
183115
|
-
}, uwi = (i) => WR.post({ url: "/metricInsight/api/v1/mql/params", data: i }).then((t) => (t == null ? void 0 : t.data) || []), cwi = (i, e) => i
|
|
183115
|
+
}, uwi = (i) => WR.post({ url: "/metricInsight/api/v1/mql/params", data: i }).then((t) => (t == null ? void 0 : t.data) || []), cwi = (i, e) => i != null && i.mql ? dwi(i, e) : hwi(e), hwi = ({
|
|
183116
183116
|
timeRange: i,
|
|
183117
183117
|
metrics: e,
|
|
183118
183118
|
dimensions: t,
|
|
@@ -183138,40 +183138,32 @@ const awi = (i) => i ? i == null ? void 0 : i.map((e) => Me({}, e.subFilter)) :
|
|
|
183138
183138
|
})));
|
|
183139
183139
|
const d = `/metricInsight/api/v1/metric/${s}/preview`;
|
|
183140
183140
|
return WR.post({ url: d, data: h }).then((f) => (f == null ? void 0 : f.data) || []);
|
|
183141
|
-
}, dwi = ({
|
|
183142
|
-
|
|
183143
|
-
metrics: e,
|
|
183144
|
-
dimensions: t,
|
|
183145
|
-
timeGrain: n,
|
|
183146
|
-
filters: r,
|
|
183147
|
-
queryMetricOrgId: o,
|
|
183148
|
-
queryType: a
|
|
183149
|
-
}) => {
|
|
183150
|
-
const s = {
|
|
183141
|
+
}, dwi = (i, { timeRange: e, metrics: t, dimensions: n, timeGrain: r, filters: o, queryMetricOrgId: a, queryType: s }) => {
|
|
183142
|
+
const l = i == null ? void 0 : i.mql, u = {
|
|
183151
183143
|
dimensions: [],
|
|
183152
183144
|
metricDefinitions: {},
|
|
183153
183145
|
metrics: [],
|
|
183154
183146
|
timeConstraint: {},
|
|
183155
183147
|
filters: {},
|
|
183156
|
-
orders: {},
|
|
183157
|
-
|
|
183158
|
-
orgId:
|
|
183159
|
-
queryType:
|
|
183160
|
-
},
|
|
183161
|
-
let
|
|
183162
|
-
return
|
|
183148
|
+
orders: (l == null ? void 0 : l.orders) || {},
|
|
183149
|
+
limits: (l == null ? void 0 : l.limits) || {},
|
|
183150
|
+
orgId: a,
|
|
183151
|
+
queryType: s
|
|
183152
|
+
}, c = n == null ? void 0 : n.map((f) => {
|
|
183153
|
+
let g = (f == null ? void 0 : f.englishName) || (f == null ? void 0 : f.label);
|
|
183154
|
+
return f.value === "metricTime" && (g = "metric_time__" + r), g;
|
|
183163
183155
|
});
|
|
183164
|
-
|
|
183165
|
-
let
|
|
183166
|
-
var
|
|
183167
|
-
return
|
|
183168
|
-
}).filter((
|
|
183169
|
-
return
|
|
183170
|
-
const
|
|
183171
|
-
|
|
183172
|
-
}), WR.post({ url: "/metricInsight/api/v1/mql/query", data:
|
|
183173
|
-
var
|
|
183174
|
-
return ((
|
|
183156
|
+
u.dimensions = {};
|
|
183157
|
+
let h = o == null ? void 0 : o.map((f) => {
|
|
183158
|
+
var g;
|
|
183159
|
+
return f.type === "basic" ? gwi(f == null ? void 0 : f.basic) : f.type === "customSql" ? (g = f == null ? void 0 : f.sql) == null ? void 0 : g.filterCondition : null;
|
|
183160
|
+
}).filter((f) => f !== null && f.trim() !== "");
|
|
183161
|
+
return t == null || t.forEach((f) => {
|
|
183162
|
+
const g = (f == null ? void 0 : f.displayName) || (f == null ? void 0 : f.label);
|
|
183163
|
+
u.metrics.push(g), u.dimensions[g] = c, u.metricDefinitions[g] = f.metricDefinitions, u.filters[g] = h || [], u.timeConstraint[g] = e || {};
|
|
183164
|
+
}), WR.post({ url: "/metricInsight/api/v1/mql/query", data: u }).then((f) => {
|
|
183165
|
+
var g;
|
|
183166
|
+
return ((g = f == null ? void 0 : f.data) == null ? void 0 : g[0]) || [];
|
|
183175
183167
|
});
|
|
183176
183168
|
}, fwi = (i) => {
|
|
183177
183169
|
const { data: e } = i;
|
|
@@ -183308,18 +183300,18 @@ function bwi(i, e) {
|
|
|
183308
183300
|
}), { metricsOptions: r, dataFormat: o };
|
|
183309
183301
|
}
|
|
183310
183302
|
function ywi(i, e, t, n) {
|
|
183311
|
-
const {
|
|
183312
|
-
(f) =>
|
|
183313
|
-
(g) => (
|
|
183314
|
-
)
|
|
183315
|
-
);
|
|
183316
|
-
return (
|
|
183317
|
-
metrics:
|
|
183318
|
-
dataFormat:
|
|
183303
|
+
const { dimensions: r, timeDimension: o = {}, filters: a = [] } = i, { metricsOptions: s, dataFormat: l } = e, u = Di(Me({}, n), { dataType: "TIMESTAMP" }), c = uJe(s), h = Ice(t, c, n), d = (r == null ? void 0 : r.map(
|
|
183304
|
+
(f) => h.find(
|
|
183305
|
+
(g) => (f == null ? void 0 : f.displayName) === g.label || (f == null ? void 0 : f.dimensionId) === g.value
|
|
183306
|
+
)
|
|
183307
|
+
).filter(Boolean)) || [];
|
|
183308
|
+
return (o == null ? void 0 : o.dimensionName) === (n == null ? void 0 : n.value) && d.unshift(u), {
|
|
183309
|
+
metrics: s,
|
|
183310
|
+
dataFormat: l,
|
|
183319
183311
|
dimensions: d,
|
|
183320
183312
|
dissionOptions: h,
|
|
183321
|
-
timeDimension:
|
|
183322
|
-
filters:
|
|
183313
|
+
timeDimension: o,
|
|
183314
|
+
filters: a,
|
|
183323
183315
|
queryMetricOrgId: i == null ? void 0 : i.orgId
|
|
183324
183316
|
};
|
|
183325
183317
|
}
|
|
@@ -183573,89 +183565,88 @@ const xwi = [
|
|
|
183573
183565
|
}
|
|
183574
183566
|
} : i;
|
|
183575
183567
|
}, Dce = (i) => {
|
|
183576
|
-
const e = gd(), t = i.type,
|
|
183568
|
+
const e = gd(), t = i.type, { queryChartData: n, transformData: r } = sJe(t), { chartJson: o, drillBy: a, setLoading: s, setChartJson: l, setError: u, setDataSourceQueryInfo: c, setChartDrillBy: h } = fd();
|
|
183577
183569
|
return {
|
|
183578
|
-
queryChartDataFromDatasource: (
|
|
183579
|
-
var
|
|
183580
|
-
|
|
183581
|
-
|
|
183582
|
-
if (c({
|
|
183570
|
+
queryChartDataFromDatasource: (p, m) => aa(null, null, function* () {
|
|
183571
|
+
var S;
|
|
183572
|
+
const { metrics: v, dimensions: b, timeGrain: y, dataFormat: _ } = p;
|
|
183573
|
+
if (u({
|
|
183583
183574
|
visible: !1,
|
|
183584
183575
|
title: "",
|
|
183585
183576
|
message: ""
|
|
183586
|
-
}),
|
|
183587
|
-
const
|
|
183588
|
-
|
|
183577
|
+
}), p.timeRange = Owi(p.timeRange), v != null && v.length) {
|
|
183578
|
+
const x = yield n(i, p).catch((R) => {
|
|
183579
|
+
u({
|
|
183589
183580
|
visible: !0,
|
|
183590
183581
|
title: e.formatMessage({ id: "chartDataLoadingFailed" }),
|
|
183591
|
-
message:
|
|
183592
|
-
}),
|
|
183582
|
+
message: R.message
|
|
183583
|
+
}), s(!1);
|
|
183593
183584
|
});
|
|
183594
|
-
|
|
183595
|
-
fieldInfo: (
|
|
183596
|
-
fieldName:
|
|
183597
|
-
type:
|
|
183585
|
+
c({
|
|
183586
|
+
fieldInfo: (S = x == null ? void 0 : x.columns) == null ? void 0 : S.map((R) => ({
|
|
183587
|
+
fieldName: R == null ? void 0 : R.name,
|
|
183588
|
+
type: R.type
|
|
183598
183589
|
}))
|
|
183599
183590
|
});
|
|
183600
|
-
const
|
|
183601
|
-
let
|
|
183602
|
-
fje(
|
|
183603
|
-
let
|
|
183604
|
-
chartJson:
|
|
183605
|
-
metrics:
|
|
183606
|
-
dimensions:
|
|
183607
|
-
isInit:
|
|
183591
|
+
const w = r(x);
|
|
183592
|
+
let E = o;
|
|
183593
|
+
fje(o) && (E = yield gje(Di(Me({}, o), { data: w })));
|
|
183594
|
+
let A = l2e({
|
|
183595
|
+
chartJson: E,
|
|
183596
|
+
metrics: v,
|
|
183597
|
+
dimensions: b,
|
|
183598
|
+
isInit: m
|
|
183608
183599
|
});
|
|
183609
|
-
const
|
|
183610
|
-
data:
|
|
183611
|
-
timeGrain:
|
|
183612
|
-
dataFormat:
|
|
183600
|
+
const T = Di(Me({}, A), {
|
|
183601
|
+
data: w,
|
|
183602
|
+
timeGrain: y,
|
|
183603
|
+
dataFormat: _
|
|
183613
183604
|
});
|
|
183614
|
-
|
|
183605
|
+
l(T), s(!1), x && u({
|
|
183615
183606
|
visible: !1,
|
|
183616
183607
|
title: "",
|
|
183617
183608
|
message: ""
|
|
183618
183609
|
});
|
|
183619
183610
|
}
|
|
183620
183611
|
}),
|
|
183621
|
-
queryDrillByChartData: (
|
|
183622
|
-
var
|
|
183623
|
-
const { metrics:
|
|
183624
|
-
if (
|
|
183625
|
-
const
|
|
183626
|
-
|
|
183612
|
+
queryDrillByChartData: (b) => aa(null, [b], function* ({ queryData: p, setDrillLoading: m, setDrillError: v }) {
|
|
183613
|
+
var S;
|
|
183614
|
+
const { metrics: y, dimensions: _ } = p;
|
|
183615
|
+
if (y != null && y.length) {
|
|
183616
|
+
const x = yield n(i, p).catch((k) => {
|
|
183617
|
+
v({
|
|
183627
183618
|
visible: !0,
|
|
183628
183619
|
title: e.formatMessage({ id: "drillDataLoadingFailed" }),
|
|
183629
|
-
message:
|
|
183630
|
-
}),
|
|
183631
|
-
}),
|
|
183632
|
-
chartJson:
|
|
183633
|
-
metrics:
|
|
183634
|
-
dimensions:
|
|
183635
|
-
}),
|
|
183636
|
-
data:
|
|
183637
|
-
}),
|
|
183638
|
-
|
|
183620
|
+
message: k.message
|
|
183621
|
+
}), m(!1);
|
|
183622
|
+
}), w = r(x), E = l2e({
|
|
183623
|
+
chartJson: o,
|
|
183624
|
+
metrics: y,
|
|
183625
|
+
dimensions: _
|
|
183626
|
+
}), A = Di(Me({}, E), {
|
|
183627
|
+
data: w
|
|
183628
|
+
}), T = vle(A), R = a;
|
|
183629
|
+
h(Di(Me({}, R), {
|
|
183639
183630
|
chartState: {
|
|
183640
|
-
chartJson:
|
|
183641
|
-
dataset:
|
|
183631
|
+
chartJson: A,
|
|
183632
|
+
dataset: T,
|
|
183642
183633
|
history: [
|
|
183643
|
-
...((
|
|
183634
|
+
...((S = R.chartState) == null ? void 0 : S.history) || [],
|
|
183644
183635
|
{
|
|
183645
|
-
chartJson:
|
|
183646
|
-
dataset:
|
|
183636
|
+
chartJson: A,
|
|
183637
|
+
dataset: T
|
|
183647
183638
|
}
|
|
183648
183639
|
]
|
|
183649
183640
|
}
|
|
183650
|
-
})),
|
|
183641
|
+
})), m(!1), x && v({
|
|
183651
183642
|
visible: !1,
|
|
183652
183643
|
title: "",
|
|
183653
183644
|
message: ""
|
|
183654
183645
|
});
|
|
183655
183646
|
}
|
|
183656
183647
|
}),
|
|
183657
|
-
queyDetailTableData: (
|
|
183658
|
-
return
|
|
183648
|
+
queyDetailTableData: (p) => aa(null, null, function* () {
|
|
183649
|
+
return n(i, Di(Me({}, p), { queryType: "detailed" })).then((m) => r(m));
|
|
183659
183650
|
})
|
|
183660
183651
|
};
|
|
183661
183652
|
}, Iwi = Ms(fl)`
|
package/dist/index.es.js.gz
CHANGED
|
Binary file
|
package/dist/index.umd.js
CHANGED
|
@@ -10586,7 +10586,7 @@ For more details see https://formatjs.github.io/docs/getting-started/message-dis
|
|
|
10586
10586
|
`,HT=({loadingText:i})=>we.jsxs(H3i,{className:"gpt-vis-loading",children:[we.jsx("div",{className:"gpt-vis-loading-icon",children:we.jsxs("div",{className:"loading-svg-ele",children:[we.jsx("svg",{width:"0",height:"0",children:we.jsx("defs",{children:we.jsxs("linearGradient",{id:"loadingCircleStrokeGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[we.jsx("stop",{offset:"0%",stopColor:"#008CD6"}),we.jsx("stop",{offset:"100%",stopColor:"#00CC66"})]})})}),we.jsx("svg",{viewBox:"22 22 44 44",children:we.jsx("circle",{className:"loading-svg-circle",cx:"44",cy:"44",r:"20.2",fill:"none",strokeWidth:"3.6"})})]})}),we.jsx("p",{children:i})]});var Nae=new Map,FL=new WeakMap,MGe=0,$3i;function z3i(i){return i?(FL.has(i)||(MGe+=1,FL.set(i,MGe.toString())),FL.get(i)):"0"}function W3i(i){return Object.keys(i).sort().filter(e=>i[e]!==void 0).map(e=>`${e}_${e==="root"?z3i(i.root):i[e]}`).toString()}function V3i(i){const e=W3i(i);let t=Nae.get(e);if(!t){const n=new Map;let r;const o=new IntersectionObserver(a=>{a.forEach(s=>{var l;const u=s.isIntersecting&&r.some(c=>s.intersectionRatio>=c);i.trackVisibility&&typeof s.isVisible=="undefined"&&(s.isVisible=u),(l=n.get(s.target))==null||l.forEach(c=>{c(u,s)})})},i);r=o.thresholds||(Array.isArray(i.threshold)?i.threshold:[i.threshold||0]),t={id:e,observer:o,elements:n},Nae.set(e,t)}return t}function j3i(i,e,t={},n=$3i){if(typeof window.IntersectionObserver=="undefined"&&n!==void 0){const l=i.getBoundingClientRect();return e(n,{isIntersecting:n,target:i,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:r,observer:o,elements:a}=V3i(t),s=a.get(i)||[];return a.has(i)||a.set(i,s),s.push(e),o.observe(i),function(){s.splice(s.indexOf(e),1),s.length===0&&(a.delete(i),o.unobserve(i)),a.size===0&&(o.disconnect(),Nae.delete(r))}}function U3i({threshold:i,delay:e,trackVisibility:t,rootMargin:n,root:r,triggerOnce:o,skip:a,initialInView:s,fallbackInView:l,onChange:u}={}){var c;const[h,d]=M.useState(null),f=M.useRef(u),g=M.useRef(s),[p,m]=M.useState({inView:!!s,entry:void 0});f.current=u,M.useEffect(()=>{if(g.current===void 0&&(g.current=s),a||!h)return;let _;return _=j3i(h,(S,x)=>{const w=g.current;g.current=S,!(w===void 0&&!S)&&(m({inView:S,entry:x}),f.current&&f.current(S,x),x.isIntersecting&&o&&_&&(_(),_=void 0))},{root:r,rootMargin:n,threshold:i,trackVisibility:t,delay:e},l),()=>{_&&_()}},[Array.isArray(i)?i.toString():i,h,r,n,o,a,t,l,e]);const v=(c=p.entry)==null?void 0:c.target,b=M.useRef(void 0);!h&&v&&!o&&!a&&b.current!==v&&(b.current=v,m({inView:!!s,entry:void 0}),g.current=s);const y=[d,p.inView,p.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}const G3i=Es.div`
|
|
10587
10587
|
height: 100%;
|
|
10588
10588
|
width: 100%;
|
|
10589
|
-
`,Hae=({visible:i,title:e,message:t})=>i?we.jsx(G3i,{className:"error-container",children:we.jsx(QA,{status:"error",title:e,subTitle:t})}):null,kGe=ce.createContext(null);function OGe(){const i=ce.useContext(kGe);if(i===void 0||Object.keys(i).length===0)throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");return i}const IGe="3.0.8",$ae=ce.createContext({});function DGe(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var r=i.length;for(e=0;e<r;e++)i[e]&&(t=DGe(i[e]))&&(n&&(n+=" "),n+=t)}else for(t in i)i[t]&&(n&&(n+=" "),n+=t);return n}function zae(){for(var i,e,t=0,n="",r=arguments.length;t<r;t++)(i=arguments[t])&&(e=DGe(i))&&(n&&(n+=" "),n+=e);return n}const q3i={aliceblue:"9ehhb",antiquewhite:"9sgk7",aqua:"1ekf",aquamarine:"4zsno",azure:"9eiv3",beige:"9lhp8",bisque:"9zg04",black:"0",blanchedalmond:"9zhe5",blue:"73",blueviolet:"5e31e",brown:"6g016",burlywood:"8ouiv",cadetblue:"3qba8",chartreuse:"4zshs",chocolate:"87k0u",coral:"9yvyo",cornflowerblue:"3xael",cornsilk:"9zjz0",crimson:"8l4xo",cyan:"1ekf",darkblue:"3v",darkcyan:"rkb",darkgoldenrod:"776yz",darkgray:"6mbhl",darkgreen:"jr4",darkgrey:"6mbhl",darkkhaki:"7ehkb",darkmagenta:"5f91n",darkolivegreen:"3bzfz",darkorange:"9yygw",darkorchid:"5z6x8",darkred:"5f8xs",darksalmon:"9441m",darkseagreen:"5lwgf",darkslateblue:"2th1n",darkslategray:"1ugcv",darkslategrey:"1ugcv",darkturquoise:"14up",darkviolet:"5rw7n",deeppink:"9yavn",deepskyblue:"11xb",dimgray:"442g9",dimgrey:"442g9",dodgerblue:"16xof",firebrick:"6y7tu",floralwhite:"9zkds",forestgreen:"1cisi",fuchsia:"9y70f",gainsboro:"8m8kc",ghostwhite:"9pq0v",goldenrod:"8j4f4",gold:"9zda8",gray:"50i2o",green:"pa8",greenyellow:"6senj",grey:"50i2o",honeydew:"9eiuo",hotpink:"9yrp0",indianred:"80gnw",indigo:"2xcoy",ivory:"9zldc",khaki:"9edu4",lavenderblush:"9ziet",lavender:"90c8q",lawngreen:"4vk74",lemonchiffon:"9zkct",lightblue:"6s73a",lightcoral:"9dtog",lightcyan:"8s1rz",lightgoldenrodyellow:"9sjiq",lightgray:"89jo3",lightgreen:"5nkwg",lightgrey:"89jo3",lightpink:"9z6wx",lightsalmon:"9z2ii",lightseagreen:"19xgq",lightskyblue:"5arju",lightslategray:"4nwk9",lightslategrey:"4nwk9",lightsteelblue:"6wau6",lightyellow:"9zlcw",lime:"1edc",limegreen:"1zcxe",linen:"9shk6",magenta:"9y70f",maroon:"4zsow",mediumaquamarine:"40eju",mediumblue:"5p",mediumorchid:"79qkz",mediumpurple:"5r3rv",mediumseagreen:"2d9ip",mediumslateblue:"4tcku",mediumspringgreen:"1di2",mediumturquoise:"2uabw",mediumvioletred:"7rn9h",midnightblue:"z980",mintcream:"9ljp6",mistyrose:"9zg0x",moccasin:"9zfzp",navajowhite:"9zest",navy:"3k",oldlace:"9wq92",olive:"50hz4",olivedrab:"472ub",orange:"9z3eo",orangered:"9ykg0",orchid:"8iu3a",palegoldenrod:"9bl4a",palegreen:"5yw0o",paleturquoise:"6v4ku",palevioletred:"8k8lv",papayawhip:"9zi6t",peachpuff:"9ze0p",peru:"80oqn",pink:"9z8wb",plum:"8nba5",powderblue:"6wgdi",purple:"4zssg",rebeccapurple:"3zk49",red:"9y6tc",rosybrown:"7cv4f",royalblue:"2jvtt",saddlebrown:"5fmkz",salmon:"9rvci",sandybrown:"9jn1c",seagreen:"1tdnb",seashell:"9zje6",sienna:"6973h",silver:"7ir40",skyblue:"5arjf",slateblue:"45e4t",slategray:"4e100",slategrey:"4e100",snow:"9zke2",springgreen:"1egv",steelblue:"2r1kk",tan:"87yx8",teal:"pds",thistle:"8ggk8",tomato:"9yqfb",turquoise:"2j4r4",violet:"9b10u",wheat:"9ld4j",white:"9zldr",whitesmoke:"9lhpx",yellow:"9zl6o",yellowgreen:"61fzm"},ou=Math.round;function Wae(i,e){const t=i.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],n=t.map(r=>parseFloat(r));for(let r=0;r<3;r+=1)n[r]=e(n[r]||0,t[r]||"",r);return t[3]?n[3]=t[3].includes("%")?n[3]/100:n[3]:n[3]=1,n}const PGe=(i,e,t)=>t===0?i:i/100;function $T(i,e){const t=e||255;return i>t?t:i<0?0:i}class yS{constructor(e){sc(this,"isValid",!0);sc(this,"r",0);sc(this,"g",0);sc(this,"b",0);sc(this,"a",1);sc(this,"_h");sc(this,"_s");sc(this,"_l");sc(this,"_v");sc(this,"_max");sc(this,"_min");sc(this,"_brightness");function t(n){return n[0]in e&&n[1]in e&&n[2]in e}if(e)if(typeof e=="string"){let r=function(o){return n.startsWith(o)};const n=e.trim();if(/^#?[A-F\d]{3,8}$/i.test(n))this.fromHexString(n);else if(r("rgb"))this.fromRgbString(n);else if(r("hsl"))this.fromHslString(n);else if(r("hsv")||r("hsb"))this.fromHsvString(n);else{const o=q3i[n.toLowerCase()];o&&this.fromHexString(parseInt(o,36).toString(16).padStart(6,"0"))}}else if(e instanceof yS)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(t("rgb"))this.r=$T(e.r),this.g=$T(e.g),this.b=$T(e.b),this.a=typeof e.a=="number"?$T(e.a,1):1;else if(t("hsl"))this.fromHsl(e);else if(t("hsv"))this.fromHsv(e);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(o){const a=o/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)}const t=e(this.r),n=e(this.g),r=e(this.b);return .2126*t+.7152*n+.0722*r}getHue(){if(typeof this._h=="undefined"){const e=this.getMax()-this.getMin();e===0?this._h=0:this._h=ou(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(typeof this._s=="undefined"){const e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return typeof this._l=="undefined"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v=="undefined"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness=="undefined"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){const t=this.getHue(),n=this.getSaturation();let r=this.getLightness()-e/100;return r<0&&(r=0),this._c({h:t,s:n,l:r,a:this.a})}lighten(e=10){const t=this.getHue(),n=this.getSaturation();let r=this.getLightness()+e/100;return r>1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){const n=this._c(e),r=t/100,o=s=>(n[s]-this[s])*r+this[s],a={r:ou(o("r")),g:ou(o("g")),b:ou(o("b")),a:ou(o("a")*100)/100};return this._c(a)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const t=this._c(e),n=this.a+t.a*(1-this.a),r=o=>ou((this[o]*this.a+t[o]*t.a*(1-this.a))/n);return this._c({r:r("r"),g:r("g"),b:r("b"),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const t=(this.r||0).toString(16);e+=t.length===2?t:"0"+t;const n=(this.g||0).toString(16);e+=n.length===2?n:"0"+n;const r=(this.b||0).toString(16);if(e+=r.length===2?r:"0"+r,typeof this.a=="number"&&this.a>=0&&this.a<1){const o=ou(this.a*255).toString(16);e+=o.length===2?o:"0"+o}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),t=ou(this.getSaturation()*100),n=ou(this.getLightness()*100);return this.a!==1?`hsla(${e},${t}%,${n}%,${this.a})`:`hsl(${e},${t}%,${n}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,t,n){const r=this.clone();return r[e]=$T(t,n),r}_c(e){return new this.constructor(e)}getMax(){return typeof this._max=="undefined"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min=="undefined"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const t=e.replace("#","");function n(r,o){return parseInt(t[r]+t[o||r],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl({h:e,s:t,l:n,a:r}){if(this._h=e%360,this._s=t,this._l=n,this.a=typeof r=="number"?r:1,t<=0){const d=ou(n*255);this.r=d,this.g=d,this.b=d}let o=0,a=0,s=0;const l=e/60,u=(1-Math.abs(2*n-1))*t,c=u*(1-Math.abs(l%2-1));l>=0&&l<1?(o=u,a=c):l>=1&&l<2?(o=c,a=u):l>=2&&l<3?(a=u,s=c):l>=3&&l<4?(a=c,s=u):l>=4&&l<5?(o=c,s=u):l>=5&&l<6&&(o=u,s=c);const h=n-u/2;this.r=ou((o+h)*255),this.g=ou((a+h)*255),this.b=ou((s+h)*255)}fromHsv({h:e,s:t,v:n,a:r}){this._h=e%360,this._s=t,this._v=n,this.a=typeof r=="number"?r:1;const o=ou(n*255);if(this.r=o,this.g=o,this.b=o,t<=0)return;const a=e/60,s=Math.floor(a),l=a-s,u=ou(n*(1-t)*255),c=ou(n*(1-t*l)*255),h=ou(n*(1-t*(1-l))*255);switch(s){case 0:this.g=h,this.b=u;break;case 1:this.r=c,this.b=u;break;case 2:this.r=u,this.b=h;break;case 3:this.r=u,this.g=c;break;case 4:this.r=h,this.g=u;break;case 5:default:this.g=u,this.b=c;break}}fromHsvString(e){const t=Wae(e,PGe);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){const t=Wae(e,PGe);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){const t=Wae(e,(n,r)=>r.includes("%")?ou(n/100*255):n);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}}const NL=2,LGe=.16,Y3i=.05,X3i=.05,K3i=.15,BGe=5,FGe=4,Z3i=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function NGe(i,e,t){let n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-NL*e:Math.round(i.h)+NL*e:n=t?Math.round(i.h)+NL*e:Math.round(i.h)-NL*e,n<0?n+=360:n>=360&&(n-=360),n}function HGe(i,e,t){if(i.h===0&&i.s===0)return i.s;let n;return t?n=i.s-LGe*e:e===FGe?n=i.s+LGe:n=i.s+Y3i*e,n>1&&(n=1),t&&e===BGe&&n>.1&&(n=.1),n<.06&&(n=.06),Math.round(n*100)/100}function $Ge(i,e,t){let n;return t?n=i.v+X3i*e:n=i.v-K3i*e,n=Math.max(0,Math.min(1,n)),Math.round(n*100)/100}function Q3i(i,e={}){const t=[],n=new yS(i),r=n.toHsv();for(let o=BGe;o>0;o-=1){const a=new yS({h:NGe(r,o,!0),s:HGe(r,o,!0),v:$Ge(r,o,!0)});t.push(a)}t.push(n);for(let o=1;o<=FGe;o+=1){const a=new yS({h:NGe(r,o),s:HGe(r,o),v:$Ge(r,o)});t.push(a)}return e.theme==="dark"?Z3i.map(({index:o,amount:a})=>new yS(e.backgroundColor||"#141414").mix(t[o],a).toHexString()):t.map(o=>o.toHexString())}const Vae=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];Vae.primary=Vae[5];function J3i(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}function exi(i,e){if(!i)return!1;if(i.contains)return i.contains(e);let t=e;for(;t;){if(t===i)return!0;t=t.parentNode}return!1}const zGe="data-rc-order",WGe="data-rc-priority",txi="rc-util-key",jae=new Map;function VGe({mark:i}={}){return i?i.startsWith("data-")?i:`data-${i}`:txi}function Uae(i){return i.attachTo?i.attachTo:document.querySelector("head")||document.body}function ixi(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function Gae(i){return Array.from((jae.get(i)||i).children).filter(e=>e.tagName==="STYLE")}function jGe(i,e={}){if(!J3i())return null;const{csp:t,prepend:n,priority:r=0}=e,o=ixi(n),a=o==="prependQueue",s=document.createElement("style");s.setAttribute(zGe,o),a&&r&&s.setAttribute(WGe,`${r}`),t!=null&&t.nonce&&(s.nonce=t==null?void 0:t.nonce),s.innerHTML=i;const l=Uae(e),{firstChild:u}=l;if(n){if(a){const c=(e.styles||Gae(l)).filter(h=>{if(!["prepend","prependQueue"].includes(h.getAttribute(zGe)))return!1;const d=Number(h.getAttribute(WGe)||0);return r>=d});if(c.length)return l.insertBefore(s,c[c.length-1].nextSibling),s}l.insertBefore(s,u)}else l.appendChild(s);return s}function nxi(i,e={}){let{styles:t}=e;return t||(t=Gae(Uae(e))),t.find(n=>n.getAttribute(VGe(e))===i)}function rxi(i,e){const t=jae.get(i);if(!t||!exi(document,t)){const n=jGe("",e),{parentNode:r}=n;jae.set(i,r),i.removeChild(n)}}function oxi(i,e,t={}){var l,u,c;const n=Uae(t),r=Gae(n),o=Pi(ke({},t),{styles:r});rxi(n,o);const a=nxi(e,o);if(a)return(l=o.csp)!=null&&l.nonce&&a.nonce!==((u=o.csp)==null?void 0:u.nonce)&&(a.nonce=(c=o.csp)==null?void 0:c.nonce),a.innerHTML!==i&&(a.innerHTML=i),a;const s=jGe(i,o);return s.setAttribute(VGe(o),e),s}function UGe(i){var e;return(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i)}function axi(i){return UGe(i)instanceof ShadowRoot}function sxi(i){return axi(i)?UGe(i):null}var GGe={};let qae={};const Yae=[],lxi=i=>{Yae.push(i)};function uxi(i,e){if(GGe.NODE_ENV!=="production"&&!i&&console!==void 0){const t=Yae.reduce((n,r)=>r(n!=null?n:"","warning"),e);t&&console.error(`Warning: ${t}`)}}function cxi(i,e){if(GGe.NODE_ENV!=="production"&&!i&&console!==void 0){const t=Yae.reduce((n,r)=>r(n!=null?n:"","note"),e);t&&console.warn(`Note: ${t}`)}}function hxi(){qae={}}function qGe(i,e,t){!e&&!qae[t]&&(i(!1,t),qae[t]=!0)}function HL(i,e){qGe(uxi,i,e)}function dxi(i,e){qGe(cxi,i,e)}HL.preMessage=lxi,HL.resetWarned=hxi,HL.noteOnce=dxi;function fxi(i){return i.replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Xae(i,e){HL(i,`[@ant-design/icons] ${e}`)}function YGe(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function XGe(i={}){return Object.keys(i).reduce((e,t)=>{const n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:delete e[t],e[fxi(t)]=n}return e},{})}function Kae(i,e,t){return t?ce.createElement(i.tag,ke(ke({key:e},XGe(i.attrs)),t),(i.children||[]).map((n,r)=>Kae(n,`${e}-${i.tag}-${r}`))):ce.createElement(i.tag,ke({key:e},XGe(i.attrs)),(i.children||[]).map((n,r)=>Kae(n,`${e}-${i.tag}-${r}`)))}function KGe(i){return Q3i(i)[0]}function ZGe(i){return i?Array.isArray(i)?i:[i]:[]}const gxi={width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"},pxi=`
|
|
10589
|
+
`,Hae=({visible:i,title:e,message:t})=>i?we.jsx(G3i,{className:"error-container",children:we.jsx(QA,{status:"error",title:e,subTitle:t})}):null,kGe=ce.createContext(null);function OGe(){const i=ce.useContext(kGe);if(i===void 0||Object.keys(i).length===0)throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");return i}const IGe="3.0.10",$ae=ce.createContext({});function DGe(i){var e,t,n="";if(typeof i=="string"||typeof i=="number")n+=i;else if(typeof i=="object")if(Array.isArray(i)){var r=i.length;for(e=0;e<r;e++)i[e]&&(t=DGe(i[e]))&&(n&&(n+=" "),n+=t)}else for(t in i)i[t]&&(n&&(n+=" "),n+=t);return n}function zae(){for(var i,e,t=0,n="",r=arguments.length;t<r;t++)(i=arguments[t])&&(e=DGe(i))&&(n&&(n+=" "),n+=e);return n}const q3i={aliceblue:"9ehhb",antiquewhite:"9sgk7",aqua:"1ekf",aquamarine:"4zsno",azure:"9eiv3",beige:"9lhp8",bisque:"9zg04",black:"0",blanchedalmond:"9zhe5",blue:"73",blueviolet:"5e31e",brown:"6g016",burlywood:"8ouiv",cadetblue:"3qba8",chartreuse:"4zshs",chocolate:"87k0u",coral:"9yvyo",cornflowerblue:"3xael",cornsilk:"9zjz0",crimson:"8l4xo",cyan:"1ekf",darkblue:"3v",darkcyan:"rkb",darkgoldenrod:"776yz",darkgray:"6mbhl",darkgreen:"jr4",darkgrey:"6mbhl",darkkhaki:"7ehkb",darkmagenta:"5f91n",darkolivegreen:"3bzfz",darkorange:"9yygw",darkorchid:"5z6x8",darkred:"5f8xs",darksalmon:"9441m",darkseagreen:"5lwgf",darkslateblue:"2th1n",darkslategray:"1ugcv",darkslategrey:"1ugcv",darkturquoise:"14up",darkviolet:"5rw7n",deeppink:"9yavn",deepskyblue:"11xb",dimgray:"442g9",dimgrey:"442g9",dodgerblue:"16xof",firebrick:"6y7tu",floralwhite:"9zkds",forestgreen:"1cisi",fuchsia:"9y70f",gainsboro:"8m8kc",ghostwhite:"9pq0v",goldenrod:"8j4f4",gold:"9zda8",gray:"50i2o",green:"pa8",greenyellow:"6senj",grey:"50i2o",honeydew:"9eiuo",hotpink:"9yrp0",indianred:"80gnw",indigo:"2xcoy",ivory:"9zldc",khaki:"9edu4",lavenderblush:"9ziet",lavender:"90c8q",lawngreen:"4vk74",lemonchiffon:"9zkct",lightblue:"6s73a",lightcoral:"9dtog",lightcyan:"8s1rz",lightgoldenrodyellow:"9sjiq",lightgray:"89jo3",lightgreen:"5nkwg",lightgrey:"89jo3",lightpink:"9z6wx",lightsalmon:"9z2ii",lightseagreen:"19xgq",lightskyblue:"5arju",lightslategray:"4nwk9",lightslategrey:"4nwk9",lightsteelblue:"6wau6",lightyellow:"9zlcw",lime:"1edc",limegreen:"1zcxe",linen:"9shk6",magenta:"9y70f",maroon:"4zsow",mediumaquamarine:"40eju",mediumblue:"5p",mediumorchid:"79qkz",mediumpurple:"5r3rv",mediumseagreen:"2d9ip",mediumslateblue:"4tcku",mediumspringgreen:"1di2",mediumturquoise:"2uabw",mediumvioletred:"7rn9h",midnightblue:"z980",mintcream:"9ljp6",mistyrose:"9zg0x",moccasin:"9zfzp",navajowhite:"9zest",navy:"3k",oldlace:"9wq92",olive:"50hz4",olivedrab:"472ub",orange:"9z3eo",orangered:"9ykg0",orchid:"8iu3a",palegoldenrod:"9bl4a",palegreen:"5yw0o",paleturquoise:"6v4ku",palevioletred:"8k8lv",papayawhip:"9zi6t",peachpuff:"9ze0p",peru:"80oqn",pink:"9z8wb",plum:"8nba5",powderblue:"6wgdi",purple:"4zssg",rebeccapurple:"3zk49",red:"9y6tc",rosybrown:"7cv4f",royalblue:"2jvtt",saddlebrown:"5fmkz",salmon:"9rvci",sandybrown:"9jn1c",seagreen:"1tdnb",seashell:"9zje6",sienna:"6973h",silver:"7ir40",skyblue:"5arjf",slateblue:"45e4t",slategray:"4e100",slategrey:"4e100",snow:"9zke2",springgreen:"1egv",steelblue:"2r1kk",tan:"87yx8",teal:"pds",thistle:"8ggk8",tomato:"9yqfb",turquoise:"2j4r4",violet:"9b10u",wheat:"9ld4j",white:"9zldr",whitesmoke:"9lhpx",yellow:"9zl6o",yellowgreen:"61fzm"},ou=Math.round;function Wae(i,e){const t=i.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],n=t.map(r=>parseFloat(r));for(let r=0;r<3;r+=1)n[r]=e(n[r]||0,t[r]||"",r);return t[3]?n[3]=t[3].includes("%")?n[3]/100:n[3]:n[3]=1,n}const PGe=(i,e,t)=>t===0?i:i/100;function $T(i,e){const t=e||255;return i>t?t:i<0?0:i}class yS{constructor(e){sc(this,"isValid",!0);sc(this,"r",0);sc(this,"g",0);sc(this,"b",0);sc(this,"a",1);sc(this,"_h");sc(this,"_s");sc(this,"_l");sc(this,"_v");sc(this,"_max");sc(this,"_min");sc(this,"_brightness");function t(n){return n[0]in e&&n[1]in e&&n[2]in e}if(e)if(typeof e=="string"){let r=function(o){return n.startsWith(o)};const n=e.trim();if(/^#?[A-F\d]{3,8}$/i.test(n))this.fromHexString(n);else if(r("rgb"))this.fromRgbString(n);else if(r("hsl"))this.fromHslString(n);else if(r("hsv")||r("hsb"))this.fromHsvString(n);else{const o=q3i[n.toLowerCase()];o&&this.fromHexString(parseInt(o,36).toString(16).padStart(6,"0"))}}else if(e instanceof yS)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(t("rgb"))this.r=$T(e.r),this.g=$T(e.g),this.b=$T(e.b),this.a=typeof e.a=="number"?$T(e.a,1):1;else if(t("hsl"))this.fromHsl(e);else if(t("hsv"))this.fromHsv(e);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(o){const a=o/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)}const t=e(this.r),n=e(this.g),r=e(this.b);return .2126*t+.7152*n+.0722*r}getHue(){if(typeof this._h=="undefined"){const e=this.getMax()-this.getMin();e===0?this._h=0:this._h=ou(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(typeof this._s=="undefined"){const e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return typeof this._l=="undefined"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v=="undefined"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness=="undefined"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){const t=this.getHue(),n=this.getSaturation();let r=this.getLightness()-e/100;return r<0&&(r=0),this._c({h:t,s:n,l:r,a:this.a})}lighten(e=10){const t=this.getHue(),n=this.getSaturation();let r=this.getLightness()+e/100;return r>1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){const n=this._c(e),r=t/100,o=s=>(n[s]-this[s])*r+this[s],a={r:ou(o("r")),g:ou(o("g")),b:ou(o("b")),a:ou(o("a")*100)/100};return this._c(a)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const t=this._c(e),n=this.a+t.a*(1-this.a),r=o=>ou((this[o]*this.a+t[o]*t.a*(1-this.a))/n);return this._c({r:r("r"),g:r("g"),b:r("b"),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const t=(this.r||0).toString(16);e+=t.length===2?t:"0"+t;const n=(this.g||0).toString(16);e+=n.length===2?n:"0"+n;const r=(this.b||0).toString(16);if(e+=r.length===2?r:"0"+r,typeof this.a=="number"&&this.a>=0&&this.a<1){const o=ou(this.a*255).toString(16);e+=o.length===2?o:"0"+o}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),t=ou(this.getSaturation()*100),n=ou(this.getLightness()*100);return this.a!==1?`hsla(${e},${t}%,${n}%,${this.a})`:`hsl(${e},${t}%,${n}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,t,n){const r=this.clone();return r[e]=$T(t,n),r}_c(e){return new this.constructor(e)}getMax(){return typeof this._max=="undefined"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min=="undefined"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const t=e.replace("#","");function n(r,o){return parseInt(t[r]+t[o||r],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl({h:e,s:t,l:n,a:r}){if(this._h=e%360,this._s=t,this._l=n,this.a=typeof r=="number"?r:1,t<=0){const d=ou(n*255);this.r=d,this.g=d,this.b=d}let o=0,a=0,s=0;const l=e/60,u=(1-Math.abs(2*n-1))*t,c=u*(1-Math.abs(l%2-1));l>=0&&l<1?(o=u,a=c):l>=1&&l<2?(o=c,a=u):l>=2&&l<3?(a=u,s=c):l>=3&&l<4?(a=c,s=u):l>=4&&l<5?(o=c,s=u):l>=5&&l<6&&(o=u,s=c);const h=n-u/2;this.r=ou((o+h)*255),this.g=ou((a+h)*255),this.b=ou((s+h)*255)}fromHsv({h:e,s:t,v:n,a:r}){this._h=e%360,this._s=t,this._v=n,this.a=typeof r=="number"?r:1;const o=ou(n*255);if(this.r=o,this.g=o,this.b=o,t<=0)return;const a=e/60,s=Math.floor(a),l=a-s,u=ou(n*(1-t)*255),c=ou(n*(1-t*l)*255),h=ou(n*(1-t*(1-l))*255);switch(s){case 0:this.g=h,this.b=u;break;case 1:this.r=c,this.b=u;break;case 2:this.r=u,this.b=h;break;case 3:this.r=u,this.g=c;break;case 4:this.r=h,this.g=u;break;case 5:default:this.g=u,this.b=c;break}}fromHsvString(e){const t=Wae(e,PGe);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){const t=Wae(e,PGe);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){const t=Wae(e,(n,r)=>r.includes("%")?ou(n/100*255):n);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}}const NL=2,LGe=.16,Y3i=.05,X3i=.05,K3i=.15,BGe=5,FGe=4,Z3i=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function NGe(i,e,t){let n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=t?Math.round(i.h)-NL*e:Math.round(i.h)+NL*e:n=t?Math.round(i.h)+NL*e:Math.round(i.h)-NL*e,n<0?n+=360:n>=360&&(n-=360),n}function HGe(i,e,t){if(i.h===0&&i.s===0)return i.s;let n;return t?n=i.s-LGe*e:e===FGe?n=i.s+LGe:n=i.s+Y3i*e,n>1&&(n=1),t&&e===BGe&&n>.1&&(n=.1),n<.06&&(n=.06),Math.round(n*100)/100}function $Ge(i,e,t){let n;return t?n=i.v+X3i*e:n=i.v-K3i*e,n=Math.max(0,Math.min(1,n)),Math.round(n*100)/100}function Q3i(i,e={}){const t=[],n=new yS(i),r=n.toHsv();for(let o=BGe;o>0;o-=1){const a=new yS({h:NGe(r,o,!0),s:HGe(r,o,!0),v:$Ge(r,o,!0)});t.push(a)}t.push(n);for(let o=1;o<=FGe;o+=1){const a=new yS({h:NGe(r,o),s:HGe(r,o),v:$Ge(r,o)});t.push(a)}return e.theme==="dark"?Z3i.map(({index:o,amount:a})=>new yS(e.backgroundColor||"#141414").mix(t[o],a).toHexString()):t.map(o=>o.toHexString())}const Vae=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];Vae.primary=Vae[5];function J3i(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}function exi(i,e){if(!i)return!1;if(i.contains)return i.contains(e);let t=e;for(;t;){if(t===i)return!0;t=t.parentNode}return!1}const zGe="data-rc-order",WGe="data-rc-priority",txi="rc-util-key",jae=new Map;function VGe({mark:i}={}){return i?i.startsWith("data-")?i:`data-${i}`:txi}function Uae(i){return i.attachTo?i.attachTo:document.querySelector("head")||document.body}function ixi(i){return i==="queue"?"prependQueue":i?"prepend":"append"}function Gae(i){return Array.from((jae.get(i)||i).children).filter(e=>e.tagName==="STYLE")}function jGe(i,e={}){if(!J3i())return null;const{csp:t,prepend:n,priority:r=0}=e,o=ixi(n),a=o==="prependQueue",s=document.createElement("style");s.setAttribute(zGe,o),a&&r&&s.setAttribute(WGe,`${r}`),t!=null&&t.nonce&&(s.nonce=t==null?void 0:t.nonce),s.innerHTML=i;const l=Uae(e),{firstChild:u}=l;if(n){if(a){const c=(e.styles||Gae(l)).filter(h=>{if(!["prepend","prependQueue"].includes(h.getAttribute(zGe)))return!1;const d=Number(h.getAttribute(WGe)||0);return r>=d});if(c.length)return l.insertBefore(s,c[c.length-1].nextSibling),s}l.insertBefore(s,u)}else l.appendChild(s);return s}function nxi(i,e={}){let{styles:t}=e;return t||(t=Gae(Uae(e))),t.find(n=>n.getAttribute(VGe(e))===i)}function rxi(i,e){const t=jae.get(i);if(!t||!exi(document,t)){const n=jGe("",e),{parentNode:r}=n;jae.set(i,r),i.removeChild(n)}}function oxi(i,e,t={}){var l,u,c;const n=Uae(t),r=Gae(n),o=Pi(ke({},t),{styles:r});rxi(n,o);const a=nxi(e,o);if(a)return(l=o.csp)!=null&&l.nonce&&a.nonce!==((u=o.csp)==null?void 0:u.nonce)&&(a.nonce=(c=o.csp)==null?void 0:c.nonce),a.innerHTML!==i&&(a.innerHTML=i),a;const s=jGe(i,o);return s.setAttribute(VGe(o),e),s}function UGe(i){var e;return(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i)}function axi(i){return UGe(i)instanceof ShadowRoot}function sxi(i){return axi(i)?UGe(i):null}var GGe={};let qae={};const Yae=[],lxi=i=>{Yae.push(i)};function uxi(i,e){if(GGe.NODE_ENV!=="production"&&!i&&console!==void 0){const t=Yae.reduce((n,r)=>r(n!=null?n:"","warning"),e);t&&console.error(`Warning: ${t}`)}}function cxi(i,e){if(GGe.NODE_ENV!=="production"&&!i&&console!==void 0){const t=Yae.reduce((n,r)=>r(n!=null?n:"","note"),e);t&&console.warn(`Note: ${t}`)}}function hxi(){qae={}}function qGe(i,e,t){!e&&!qae[t]&&(i(!1,t),qae[t]=!0)}function HL(i,e){qGe(uxi,i,e)}function dxi(i,e){qGe(cxi,i,e)}HL.preMessage=lxi,HL.resetWarned=hxi,HL.noteOnce=dxi;function fxi(i){return i.replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Xae(i,e){HL(i,`[@ant-design/icons] ${e}`)}function YGe(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function XGe(i={}){return Object.keys(i).reduce((e,t)=>{const n=i[t];switch(t){case"class":e.className=n,delete e.class;break;default:delete e[t],e[fxi(t)]=n}return e},{})}function Kae(i,e,t){return t?ce.createElement(i.tag,ke(ke({key:e},XGe(i.attrs)),t),(i.children||[]).map((n,r)=>Kae(n,`${e}-${i.tag}-${r}`))):ce.createElement(i.tag,ke({key:e},XGe(i.attrs)),(i.children||[]).map((n,r)=>Kae(n,`${e}-${i.tag}-${r}`)))}function KGe(i){return Q3i(i)[0]}function ZGe(i){return i?Array.isArray(i)?i:[i]:[]}const gxi={width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"},pxi=`
|
|
10590
10590
|
.anticon {
|
|
10591
10591
|
display: inline-flex;
|
|
10592
10592
|
align-items: center;
|
|
@@ -10723,7 +10723,7 @@ ${r}
|
|
|
10723
10723
|
}
|
|
10724
10724
|
}
|
|
10725
10725
|
`}
|
|
10726
|
-
`,rd=i=>{var l;const s=i,{prefix:e,allowClear:t}=s,n=Rh(s,["prefix","allowClear"]),[r,o]=ce.useState((l=i==null?void 0:i.open)!=null?l:!1);ce.useEffect(()=>{(i==null?void 0:i.open)!==void 0&&o(i==null?void 0:i.open)},[i==null?void 0:i.open]);const a=u=>{if(i!=null&&i.onOpenChange){i==null||i.onOpenChange(u);return}o(u)};return we.jsxs(Yf,{theme:Xxi,children:[we.jsx(Zxi,{}),we.jsx(Kxi,{className:r?"open":"",children:we.jsx(hm,ke({prefix:e?we.jsx("span",{className:r?"open":"",children:e}):void 0,suffixIcon:we.jsxs(we.Fragment,{children:[r&&we.jsx("div",{className:"suffixIcon",children:we.jsx(rse,{style:{color:"#008CD6",pointerEvents:"none"}})}),!r&&we.jsx("div",{className:"suffixIcon",children:we.jsx(Jae,{style:{color:"#89898a",pointerEvents:"none"}})})]}),maxTagCount:"responsive",allowClear:t?{clearIcon:we.jsx(ase,{className:"clear-icon"})}:!1,onOpenChange:a},n))})]})},Qxi="http://localhost";class Jxi{constructor({baseURL:e=Qxi,host:t,protocol:n,timeout:r=6e5,headers:o}={}){var s,l,u;this.host=t||((s=window.location)==null?void 0:s.host),this.protocol=n||(["http:","https:"].includes((l=window==null?void 0:window.location)==null?void 0:l.protocol)?(u=window==null?void 0:window.location)==null?void 0:u.protocol:void 0);const a=new URL(this.host||this.protocol?`${this.protocol||"https:"}//${this.host||"localhost"}`:e,window.location.href);this.baseURL=a.href.replace(/\/+$/,""),this.host=a.host,this.protocol=a.protocol,this.timeout=r,this.headers=o||{"Content-Type":"application/json"},this.instance=Xs.create({baseURL:this.baseURL,timeout:this.timeout,headers:this.headers})}get(e){return ga(this,null,function*(){return this.request(Pi(ke({},e),{method:"GET"}))})}delete(e){return ga(this,null,function*(){return this.request(Pi(ke({},e),{method:"DELETE"}))})}put(e){return ga(this,null,function*(){return this.request(Pi(ke({},e),{method:"PUT"}))})}post(e){return ga(this,null,function*(){return this.request(Pi(ke({},e),{method:"POST"}))})}patch(e){return ga(this,null,function*(){return this.request(Pi(ke({},e),{method:"PATCH"}))})}ping(){return this.request({url:"/api/ping",method:"GET",retry:1})}request(e){return ga(this,null,function*(){return this.instance(e).then(t=>{const{status:n,config:r}=t;return(r==null?void 0:r.method)==="delete"&&(n===200||n===201)?{message:"delete success"}:{data:t.data}}).catch(t=>Promise.reject(t))})}}const WT=new Jxi,eSi=i=>mAt({},v$e,i,t=>{if(Array.isArray(t))return t}),tSi=[{key:"basic",label:"Basic",value:"basic"},{key:"customSql",label:"Custom SQL",value:"customSql"}],hse=[{key:"equal",label:"Equal",value:"equal"},{key:"notEqual",label:"Not equal",value:"not equal"},{key:"isNull",label:"Is null",value:"is null"},{key:"isNotNull",label:"Is not null",value:"is not null"},{key:"greaterThan",label:"Greater than",value:"greater than"},{key:"greaterThanOrEqualto",label:"Greater than or equal to",value:"greater than or equal to"},{key:"lessThan",label:"Less than",value:"less than"},{key:"lessThanEqualTo",label:"Less than or equal to",value:"less than or equal to"},{key:"contains",label:"Contains",value:"contains"},{key:"notContains",label:"Not contains",value:"not contains"},{key:"StartsWith",label:"Starts with",value:"starts with"},{key:"doesNotStartWith",label:"Does not start with",value:"does not start with"},{key:"endsWith",label:"Ends with",value:"ends with"},{key:"doesNotEndWith",label:"Does not end with",value:"does not end with"}],iSi={equal:"=",notEqual:"!=",isNull:"IS NULL",isNotNull:"IS NOT NULL",greaterThan:">",greaterThanOrEqualto:">=",lessThan:"<",lessThanEqualTo:"<=",contains:"LIKE",notContains:"NOT LIKE",StartsWith:"LIKE",doesNotStartWith:"NOT LIKE",endsWith:"LIKE",doesNotEndWith:"NOT LIKE"},nSi=[{key:"where",label:"WHERE",value:"WHERE"},{key:"having",label:"HAVING",value:"HAVING"}];function dse(i,e){const t=e==null?void 0:e.find(n=>n.value===i.dimensionId||n.label===i.name);return t?{datasetName:t.datasetName,dimensionColumn:t.dimensionColumn,englishName:t.englishName,dimensionId:t.value}:null}const rSi=i=>i?i==null?void 0:i.map(e=>ke({},e.subFilter)):[],oSi=i=>{const e="/metricInsight/api/v1/metric/"+i;return WT.get({url:e}).then(t=>t.data||[])},aSi=i=>{const e="/metricInsight/api/v1/dimension/metric?mode=intersect&metricIds="+i.join(",");return WT.get({url:e}).then(t=>{var n;return((n=t==null?void 0:t.data)==null?void 0:n.items)||[]})},sSi=i=>WT.post({url:"/metricInsight/api/v1/mql/params",data:i}).then(t=>(t==null?void 0:t.data)||[]),lSi=(i,e)=>i==="mql"?cSi(e):uSi(e),uSi=({timeRange:i,metrics:e,dimensions:t,timeGrain:n,filters:r,queryMetricOrgId:o})=>{const a=e==null?void 0:e.map(f=>f.value),s=a==null?void 0:a[0],l=t==null?void 0:t.some(f=>f.value==="metricTime");let u=t,c;l&&(u=t==null?void 0:t.filter(f=>f.value!=="metricTime"),c={dimensionName:"metricTime",dimensionUnit:n});const h={orgId:o,metricIds:a,timeRange:i,dimensionIds:u==null?void 0:u.map(f=>f.value)};(i==null?void 0:i.type)==="custom"&&(i!=null&&i.custom)&&(h.timeRange.custom={from:Ir(i.custom.from).format(GM),to:Ir(i.custom.to).format(GM)}),c&&(h.timeDimension=c),r&&r.length>0&&(h.filters=r.map(f=>({conjunction:"AND",subFilter:ke({},f)})));const d=`/metricInsight/api/v1/metric/${s}/preview`;return WT.post({url:d,data:h}).then(f=>(f==null?void 0:f.data)||[])},cSi=({timeRange:i,metrics:e,dimensions:t,timeGrain:n,filters:r,queryMetricOrgId:o,queryType:a})=>{const s={dimensions:[],metricDefinitions:{},metrics:[],timeConstraint:{},filters:{},orders:{},limit:{},orgId:o,queryType:a},l=t==null?void 0:t.map(h=>{let d=(h==null?void 0:h.englishName)||(h==null?void 0:h.label);return h.value==="metricTime"&&(d="metric_time__"+n),d});s.dimensions={};let u=r==null?void 0:r.map(h=>{var d;return h.type==="basic"?dSi(h==null?void 0:h.basic):h.type==="customSql"?(d=h==null?void 0:h.sql)==null?void 0:d.filterCondition:null}).filter(h=>h!==null&&h.trim()!=="");return e==null||e.forEach(h=>{const d=(h==null?void 0:h.displayName)||(h==null?void 0:h.label);s.metrics.push(d),s.dimensions[d]=l,s.metricDefinitions[d]=h.metricDefinitions,s.filters[d]=u||[],s.timeConstraint[d]=i||{}}),WT.post({url:"/metricInsight/api/v1/mql/query",data:s}).then(h=>{var d;return((d=h==null?void 0:h.data)==null?void 0:d[0])||[]})},hSi=i=>{const{data:e}=i;if(!e)return[];if(!(e!=null&&e.columns)||!(e!=null&&e.rows))return[];const{columns:t,rows:n}=e,r={};return t.forEach((a,s)=>{r[a.name]=s}),n.map(a=>{const s={};return t.forEach((l,u)=>{if(a.row[u]!==void 0){const c=l.name;s[c]=a.row[u].v}}),s})},dSi=i=>{var s;const e=(i==null?void 0:i.englishName)||(i==null?void 0:i.dimensionColumn),t=i==null?void 0:i.condition,n=i==null?void 0:i.value,r=(s=hse.find(l=>l.value===t))==null?void 0:s.key,o=iSi[r];if(!e||!o)throw new Error("Invalid filter configuration");if(r==="isNull"||r==="isNotNull")return`${e} ${o}`;if(o==="LIKE"||o==="NOT LIKE"){let l=n;return t==="contains"?l=`%${n}%`:t==="StartsWith"?l=`${n}%`:t==="endsWith"?l=`%${n}`:t==="notContains"?l=`%${n}%`:t==="doesNotStartWith"?l=`${n}%`:t==="doesNotEndWith"&&(l=`%${n}`),`${e} ${o} '${l}'`}const a=typeof n=="string"?`'${n}'`:n;return`${e} ${o} ${a}`},fSi={metricInsight:{queryMql2Params:sSi,queryChartData:lSi,queryMetricId:oSi,queryDimensions:aSi,transformData:hSi},simpleJson:{}},oqe=i=>{const e=Jh(),{setError:t,setLoading:n}=Qh();return ce.useMemo(()=>{const o=fSi[i];return{queryMql2Params:o.queryMql2Params?aqe(o.queryMql2Params,t,n,e):()=>Promise.resolve({}),queryMetricId:o.queryMetricId?aqe(o.queryMetricId,t,n,e):()=>Promise.resolve({}),queryDimensions:o.queryDimensions?o.queryDimensions:()=>Promise.resolve({}),queryChartData:o.queryChartData?o.queryChartData:()=>Promise.resolve({}),transformData:a=>o.transformData?o.transformData({data:a}):a}},[i])};function aqe(i,e,t,n){return((...r)=>ga(null,null,function*(){try{return yield i(...r)}catch(o){let a=o==null?void 0:o.message;throw typeof o=="string"&&(a=o),t(!1),e({visible:!0,title:n.formatMessage({id:"metricError"}),message:a||"error"}),o}}))}const sqe=[{key:"none",label:"None",value:"none"},{key:"number",label:"Number",value:"number"},{key:"percentage_raw",label:"Percentage (raw)",value:"percentage_raw",desc:"1→1%"},{key:"percentage_scaled",label:"Percentage (scaled)",value:"percentage_scaled",desc:"1→100%"}],gSi={none:"",number:"",percentage_raw:"%",percentage_scaled:"%",celsius:"°C",fahrenheit:"°F",CNY:"¥",USD:"$",GBP:"£",EUR:"€"};function lqe(i,e){if(!i&&!e)return"";let t="",n="";return i&&i!=="none"&&(t=i),e&&e!=="none"&&(n=gSi[e]||e),t+(n?" "+n:"")}function pSi(i,e,t){if(!i)return null;const{dimensionDetailList:n,displayName:r,metricId:o,derivationMethod:a}=i,s={value:o,label:r},l=fse(n,a,t),c=((e==null?void 0:e.dimensions)||[(e==null?void 0:e.xField)||(e==null?void 0:e.nameField)]).map(d=>l.find(f=>d===f.label||d===f.value)).filter(Boolean),h=ySi(r,i);return{metrics:[s],dimensions:c,dissionOptions:l,dataFormat:h}}function mSi(i,e){const{metrics:t}=e,n=cqe(i),r=[],o={};return((n==null?void 0:n.metrics)||[]).forEach(s=>{var p,m;const l=(p=n==null?void 0:n.metricDefinitions)==null?void 0:p[s],u=l==null?void 0:l.refMetric,c=l==null?void 0:l.variables;let h;!u&&c?h=Object.values(c).map(v=>v==null?void 0:v.refMetric):h=[u];let d=[],f=[],g=!1;((m=l==null?void 0:l.indirections)==null?void 0:m.length)>0&&!c&&(g=!0),t.forEach(v=>{if(!g&&v.englishName===u){const b=v==null?void 0:v.metricUnit;o[s]={formatType:(b==null?void 0:b.type)||"none",decimalPlaces:(b==null?void 0:b.decimal)||0,suffix:lqe(b==null?void 0:b.valueUnit,b==null?void 0:b.formatUnit)}}else o[s]={formatType:"none",decimalPlaces:0,suffix:""};h!=null&&h.includes(v==null?void 0:v.englishName)&&!f.includes(v==null?void 0:v.metricId)&&(d.push(v),f.push(v==null?void 0:v.metricId))}),r.push({isDerived:g,displayName:s,label:s,value:"uuid-"+IV(6),metricDefinitions:l,atomicMetricIds:f,atomicMetricsInfo:d})}),{metricsOptions:r,dataFormat:o}}function vSi(i,e,t,n){const{metricsOptions:r,dataFormat:o}=e,{dimensions:a,timeDimension:s={},filters:l=[]}=i,u=Pi(ke({},n),{dataType:"TIMESTAMP"}),c=uqe(r),h=fse(t,c,n),d=h.filter(f=>(a==null?void 0:a.some(g=>(g==null?void 0:g.displayName)===f.label||(g==null?void 0:g.dimensionId)===f.value))||f.defaultSelected);return(s==null?void 0:s.dimensionName)===(n==null?void 0:n.value)&&d.unshift(u),{metrics:r,dataFormat:o,dimensions:d,dissionOptions:h,timeDimension:s,filters:l,queryMetricOrgId:i==null?void 0:i.orgId}}function uqe(i){const e=[];return i==null||i.forEach(t=>{var n;t!=null&&t.atomicMetricsInfo&&((n=t==null?void 0:t.atomicMetricsInfo)==null||n.forEach(r=>{hl(r==null?void 0:r.derivationMethod)?e.push(...r.derivationMethod):Wh(r==null?void 0:r.derivationMethod)&&e.push(r.derivationMethod)}))}),e==null?void 0:e[0]}function bSi(i,e){var r,o,a,s,l;let t=!1,n=!1;if(!(e!=null&&e.enabled))return{defaultSelected:t,defaultDisabled:n};if((e==null?void 0:e.method)==="Ranking"&&(e!=null&&e.ranking)){const u=((r=e.ranking)==null?void 0:r.dimensions)||[],c=((o=e.ranking)==null?void 0:o.ranges)||[];return{defaultSelected:[...u,...c].includes(i),defaultDisabled:n}}if((e==null?void 0:e.method)==="Proportion"&&(e!=null&&e.proportion)){const u=((a=e.proportion)==null?void 0:a.dimensions)||[],c=((s=e.proportion)==null?void 0:s.ranges)||[];return{defaultSelected:[...u,...c].includes(i),defaultDisabled:n}}if((e==null?void 0:e.method)==="Custom"&&((l=e==null?void 0:e.custom)==null?void 0:l.length)>0){const u=e.custom,c=u.findIndex(h=>(h==null?void 0:h.dimension)===i);return c!==-1&&(c===u.length-1?t=!0:(t=!1,n=!0)),{defaultSelected:t,defaultDisabled:n}}return{defaultSelected:t,defaultDisabled:n}}const ySi=(i,e)=>{var t,n;if(i&&((t=e==null?void 0:e.computationalAttributes)!=null&&t.format)){const r=(n=e==null?void 0:e.computationalAttributes)==null?void 0:n.format;return{[i]:{formatType:(r==null?void 0:r.type)||"none",decimalPlaces:(r==null?void 0:r.decimal)||0,suffix:lqe(r==null?void 0:r.valueUnit,r==null?void 0:r.formatUnit)}}}return null};function cqe(i){let e={};if(typeof i=="object")e=i;else if(typeof i=="string")try{e=JSON.parse(i)}catch(t){console.error(t)}return e}function fse(i,e,t){const n=(i==null?void 0:i.map(r=>{const{defaultSelected:o,defaultDisabled:a}=bSi(r.dimensionId,e);return{label:r.displayName,value:r.dimensionId,englishName:r.englishName,dataType:r.dimensionColumnType,datasetName:r.datasetName,dimensionColumn:r.dimensionColumn,defaultSelected:o,defaultDisabled:a,disabled:o||a}}))||[];return n.unshift(Pi(ke({},t),{dataType:"TIMESTAMP",englishName:t.label,datasetName:void 0,dimensionColumn:void 0,defaultSelected:!1,defaultDisabled:!1,disabled:!1})),n}const _Si=[{key:"custom",label:"Custom",value:"custom"},{key:"today",label:"Today",value:"today"},{key:"last7Days",label:"Last 7 days",value:"last7Days"},{key:"last30Days",label:"Last 30 days",value:"last30Days"},{key:"last1Year",label:"Last year",value:"last1Year"},{key:"thisWeek",label:"This week",value:"thisWeek"},{key:"thisMonth",label:"This month",value:"thisMonth"},{key:"thisQuarter",label:"This quarter",value:"thisQuarter"},{key:"thisYear",label:"This year",value:"thisYear"},{key:"weekToDate",label:"Week-to-date",value:"weekToDate"},{key:"monthToDate",label:"Month-to-date",value:"monthToDate"},{key:"quarterToDate",label:"Quarter-to-date",value:"quarterToDate"},{key:"yearToDate",label:"Year-to-date",value:"yearToDate"},{key:"advanced",label:"Advanced",value:"advanced"}],CSi=[{key:"lastPeriod",label:"Last N period",value:"lastPeriod"},{key:"periodAgo",label:"N periods ago",value:"periodAgo"},{key:"periodBoundary",label:"Current/previous period boundary",value:"periodBoundary"}],xSi=[{key:"current",label:"Current",value:"current"},{key:"previous",label:"Previous",value:"previous"}],CS=[{key:"minute",label:"Minute",value:"minute"},{key:"hour",label:"Hour",value:"hour"},{key:"day",label:"Day",value:"day"},{key:"week",label:"Week",value:"week"},{key:"month",label:"Month",value:"month"},{key:"quarter",label:"Quarter",value:"quarter"},{key:"year",label:"Year",value:"year"}],hqe=[{key:"minute",label:"Minute",value:"minute"},{key:"hour",label:"Hour",value:"hour"},{key:"year",label:"Year",value:"year"},{key:"quarter",label:"Quarter",value:"quarter"},{key:"month",label:"Month",value:"month"},{key:"week",label:"Week",value:"week"},{key:"day",label:"Day",value:"day"}],SSi=[{key:"first",label:"First",value:"first"},{key:"last",label:"Last",value:"last"}],dqe={type:"lastPeriod",lastPeriod:{range:7,unit:"day"},periodAgo:{range:7,unit:"day"},periodBoundary:{periodType:"current",periodUnit:"month",periodRange:void 0,boundaryType:"first",boundaryUnit:"day"}},VT={second:0,minute:1,hour:2,day:3,week:4,month:5,quarter:6,year:7},wSi=i=>{if(i&&Object.prototype.hasOwnProperty.call(VT,i)){const e=VT[i];return CS.filter(t=>VT[t.value]<e)}return CS},ESi=i=>{const e=VT[i==null?void 0:i.toLowerCase()];return e!==void 0?hqe.filter(t=>VT[t.value]<e):hqe},ASi=(i,e,t)=>{var n,r,o,a,s,l;if((e==null?void 0:e.type)==="custom"&&(n=e==null?void 0:e.custom)!=null&&n.from&&(r=e==null?void 0:e.custom)!=null&&r.to){const u=Ir(e.custom.from).format(Ob),c=Ir(e.custom.to).format(Ob);return`${u}-${c}`}if((e==null?void 0:e.type)==="advanced"&&e.advanced){const u=e.advanced;let c="";if((u==null?void 0:u.type)==="lastPeriod")return t({id:"lastNUnits"},{range:(o=u==null?void 0:u.lastPeriod)==null?void 0:o.range,unit:t({id:"unit"+((a=u.lastPeriod)==null?void 0:a.unit)})});if((u==null?void 0:u.type)==="periodAgo")return t({id:"periodAgoNUnits"},{range:(s=u.periodAgo)==null?void 0:s.range,unit:t({id:"unit"+((l=u.periodAgo)==null?void 0:l.unit)})});if((u==null?void 0:u.type)==="periodBoundary"){const h=u.periodBoundary;if((h==null?void 0:h.periodType)==="current")return t({id:"currentNUnit"},{periodUnit:t({id:"unit"+h.periodUnit}),boundaryType:t({id:h.boundaryType}),boundaryUnit:t({id:"unit"+h.boundaryUnit})});if((h==null?void 0:h.periodType)==="previous")return t({id:"previousNUnits"},{periodRange:h.periodRange,periodUnit:t({id:"unit"+h.periodUnit}),boundaryType:t({id:h.boundaryType}),boundaryUnit:t({id:"unit"+h.boundaryUnit})})}return c}return i},TSi=i=>i==null?void 0:i.dimensionUnit,RSi=(i,e)=>{var t,n,r;if(!(i!=null&&i.type)){const o=e==null?void 0:e.mql;let a;if(a=(t=cqe(o))==null?void 0:t.timeConstraint,!a)return{};const s=Object.keys(a)[0],l=a[s];return l&&typeof l=="object"&&(l==null?void 0:l.type)==="advanced"&&((r=(n=l==null?void 0:l.advanced)==null?void 0:n.custom)!=null&&r.from)?{type:"custom",custom:{from:l.advanced.custom.from,to:l.advanced.custom.to||Ir().format("YYYY-MM-DD HH:mm:ss")}}:{}}return i},MSi=i=>{var e;return(i==null?void 0:i.type)==="custom"&&((e=i==null?void 0:i.custom)!=null&&e.from)?{type:"custom",custom:{from:Ir(i.custom.from).format("YYYY-MM-DD HH:mm:ss"),to:Ir(i.custom.to).format("YYYY-MM-DD HH:mm:ss")}}:i},gse=i=>{const e=Jh(),t=i.type,n=i!=null&&i.mql?"mql":"json",{queryChartData:r,transformData:o}=oqe(t),{chartJson:a,drillBy:s,setLoading:l,setChartJson:u,setError:c,setDataSourceQueryInfo:h,setChartDrillBy:d}=Qh();return{queryChartDataFromDatasource:(m,v)=>ga(null,null,function*(){var x;console.log("queryChartDataFromDatasource",m);const{metrics:b,dimensions:y,timeGrain:_,dataFormat:S}=m;if(c({visible:!1,title:"",message:""}),m.timeRange=MSi(m.timeRange),b!=null&&b.length){const w=yield r(n,m).catch(k=>{c({visible:!0,title:e.formatMessage({id:"chartDataLoadingFailed"}),message:k.message}),l(!1)});h({fieldInfo:(x=w==null?void 0:w.columns)==null?void 0:x.map(k=>({fieldName:k==null?void 0:k.name,type:k.type}))});const E=o(w);let A=a;jke(a)&&(A=yield Uke(Pi(ke({},a),{data:E})));let T=OV({chartJson:A,metrics:b,dimensions:y,isInit:v});const R=Pi(ke({},T),{data:E,timeGrain:_,dataFormat:S});u(R),l(!1),w&&c({visible:!1,title:"",message:""})}}),queryDrillByChartData:y=>ga(null,[y],function*({queryData:m,setDrillLoading:v,setDrillError:b}){var x;const{metrics:_,dimensions:S}=m;if(_!=null&&_.length){const w=yield r(n,m).catch(O=>{b({visible:!0,title:e.formatMessage({id:"drillDataLoadingFailed"}),message:O.message}),v(!1)}),E=o(w),A=OV({chartJson:a,metrics:_,dimensions:S}),T=Pi(ke({},A),{data:E}),R=zJ(T),k=s;d(Pi(ke({},k),{chartState:{chartJson:T,dataset:R,history:[...((x=k.chartState)==null?void 0:x.history)||[],{chartJson:T,dataset:R}]}})),v(!1),w&&b({visible:!1,title:"",message:""})}}),queyDetailTableData:m=>ga(null,null,function*(){return r(n,Pi(ke({},m),{queryType:"detailed"})).then(v=>o(v))})}},kSi=Es(pl)`
|
|
10726
|
+
`,rd=i=>{var l;const s=i,{prefix:e,allowClear:t}=s,n=Rh(s,["prefix","allowClear"]),[r,o]=ce.useState((l=i==null?void 0:i.open)!=null?l:!1);ce.useEffect(()=>{(i==null?void 0:i.open)!==void 0&&o(i==null?void 0:i.open)},[i==null?void 0:i.open]);const a=u=>{if(i!=null&&i.onOpenChange){i==null||i.onOpenChange(u);return}o(u)};return we.jsxs(Yf,{theme:Xxi,children:[we.jsx(Zxi,{}),we.jsx(Kxi,{className:r?"open":"",children:we.jsx(hm,ke({prefix:e?we.jsx("span",{className:r?"open":"",children:e}):void 0,suffixIcon:we.jsxs(we.Fragment,{children:[r&&we.jsx("div",{className:"suffixIcon",children:we.jsx(rse,{style:{color:"#008CD6",pointerEvents:"none"}})}),!r&&we.jsx("div",{className:"suffixIcon",children:we.jsx(Jae,{style:{color:"#89898a",pointerEvents:"none"}})})]}),maxTagCount:"responsive",allowClear:t?{clearIcon:we.jsx(ase,{className:"clear-icon"})}:!1,onOpenChange:a},n))})]})},Qxi="http://localhost";class Jxi{constructor({baseURL:e=Qxi,host:t,protocol:n,timeout:r=6e5,headers:o}={}){var s,l,u;this.host=t||((s=window.location)==null?void 0:s.host),this.protocol=n||(["http:","https:"].includes((l=window==null?void 0:window.location)==null?void 0:l.protocol)?(u=window==null?void 0:window.location)==null?void 0:u.protocol:void 0);const a=new URL(this.host||this.protocol?`${this.protocol||"https:"}//${this.host||"localhost"}`:e,window.location.href);this.baseURL=a.href.replace(/\/+$/,""),this.host=a.host,this.protocol=a.protocol,this.timeout=r,this.headers=o||{"Content-Type":"application/json"},this.instance=Xs.create({baseURL:this.baseURL,timeout:this.timeout,headers:this.headers})}get(e){return ga(this,null,function*(){return this.request(Pi(ke({},e),{method:"GET"}))})}delete(e){return ga(this,null,function*(){return this.request(Pi(ke({},e),{method:"DELETE"}))})}put(e){return ga(this,null,function*(){return this.request(Pi(ke({},e),{method:"PUT"}))})}post(e){return ga(this,null,function*(){return this.request(Pi(ke({},e),{method:"POST"}))})}patch(e){return ga(this,null,function*(){return this.request(Pi(ke({},e),{method:"PATCH"}))})}ping(){return this.request({url:"/api/ping",method:"GET",retry:1})}request(e){return ga(this,null,function*(){return this.instance(e).then(t=>{const{status:n,config:r}=t;return(r==null?void 0:r.method)==="delete"&&(n===200||n===201)?{message:"delete success"}:{data:t.data}}).catch(t=>Promise.reject(t))})}}const WT=new Jxi,eSi=i=>mAt({},v$e,i,t=>{if(Array.isArray(t))return t}),tSi=[{key:"basic",label:"Basic",value:"basic"},{key:"customSql",label:"Custom SQL",value:"customSql"}],hse=[{key:"equal",label:"Equal",value:"equal"},{key:"notEqual",label:"Not equal",value:"not equal"},{key:"isNull",label:"Is null",value:"is null"},{key:"isNotNull",label:"Is not null",value:"is not null"},{key:"greaterThan",label:"Greater than",value:"greater than"},{key:"greaterThanOrEqualto",label:"Greater than or equal to",value:"greater than or equal to"},{key:"lessThan",label:"Less than",value:"less than"},{key:"lessThanEqualTo",label:"Less than or equal to",value:"less than or equal to"},{key:"contains",label:"Contains",value:"contains"},{key:"notContains",label:"Not contains",value:"not contains"},{key:"StartsWith",label:"Starts with",value:"starts with"},{key:"doesNotStartWith",label:"Does not start with",value:"does not start with"},{key:"endsWith",label:"Ends with",value:"ends with"},{key:"doesNotEndWith",label:"Does not end with",value:"does not end with"}],iSi={equal:"=",notEqual:"!=",isNull:"IS NULL",isNotNull:"IS NOT NULL",greaterThan:">",greaterThanOrEqualto:">=",lessThan:"<",lessThanEqualTo:"<=",contains:"LIKE",notContains:"NOT LIKE",StartsWith:"LIKE",doesNotStartWith:"NOT LIKE",endsWith:"LIKE",doesNotEndWith:"NOT LIKE"},nSi=[{key:"where",label:"WHERE",value:"WHERE"},{key:"having",label:"HAVING",value:"HAVING"}];function dse(i,e){const t=e==null?void 0:e.find(n=>n.value===i.dimensionId||n.label===i.name);return t?{datasetName:t.datasetName,dimensionColumn:t.dimensionColumn,englishName:t.englishName,dimensionId:t.value}:null}const rSi=i=>i?i==null?void 0:i.map(e=>ke({},e.subFilter)):[],oSi=i=>{const e="/metricInsight/api/v1/metric/"+i;return WT.get({url:e}).then(t=>t.data||[])},aSi=i=>{const e="/metricInsight/api/v1/dimension/metric?mode=intersect&metricIds="+i.join(",");return WT.get({url:e}).then(t=>{var n;return((n=t==null?void 0:t.data)==null?void 0:n.items)||[]})},sSi=i=>WT.post({url:"/metricInsight/api/v1/mql/params",data:i}).then(t=>(t==null?void 0:t.data)||[]),lSi=(i,e)=>i!=null&&i.mql?cSi(i,e):uSi(e),uSi=({timeRange:i,metrics:e,dimensions:t,timeGrain:n,filters:r,queryMetricOrgId:o})=>{const a=e==null?void 0:e.map(f=>f.value),s=a==null?void 0:a[0],l=t==null?void 0:t.some(f=>f.value==="metricTime");let u=t,c;l&&(u=t==null?void 0:t.filter(f=>f.value!=="metricTime"),c={dimensionName:"metricTime",dimensionUnit:n});const h={orgId:o,metricIds:a,timeRange:i,dimensionIds:u==null?void 0:u.map(f=>f.value)};(i==null?void 0:i.type)==="custom"&&(i!=null&&i.custom)&&(h.timeRange.custom={from:Ir(i.custom.from).format(GM),to:Ir(i.custom.to).format(GM)}),c&&(h.timeDimension=c),r&&r.length>0&&(h.filters=r.map(f=>({conjunction:"AND",subFilter:ke({},f)})));const d=`/metricInsight/api/v1/metric/${s}/preview`;return WT.post({url:d,data:h}).then(f=>(f==null?void 0:f.data)||[])},cSi=(i,{timeRange:e,metrics:t,dimensions:n,timeGrain:r,filters:o,queryMetricOrgId:a,queryType:s})=>{const l=i==null?void 0:i.mql,u={dimensions:[],metricDefinitions:{},metrics:[],timeConstraint:{},filters:{},orders:(l==null?void 0:l.orders)||{},limits:(l==null?void 0:l.limits)||{},orgId:a,queryType:s},c=n==null?void 0:n.map(f=>{let g=(f==null?void 0:f.englishName)||(f==null?void 0:f.label);return f.value==="metricTime"&&(g="metric_time__"+r),g});u.dimensions={};let h=o==null?void 0:o.map(f=>{var g;return f.type==="basic"?dSi(f==null?void 0:f.basic):f.type==="customSql"?(g=f==null?void 0:f.sql)==null?void 0:g.filterCondition:null}).filter(f=>f!==null&&f.trim()!=="");return t==null||t.forEach(f=>{const g=(f==null?void 0:f.displayName)||(f==null?void 0:f.label);u.metrics.push(g),u.dimensions[g]=c,u.metricDefinitions[g]=f.metricDefinitions,u.filters[g]=h||[],u.timeConstraint[g]=e||{}}),WT.post({url:"/metricInsight/api/v1/mql/query",data:u}).then(f=>{var g;return((g=f==null?void 0:f.data)==null?void 0:g[0])||[]})},hSi=i=>{const{data:e}=i;if(!e)return[];if(!(e!=null&&e.columns)||!(e!=null&&e.rows))return[];const{columns:t,rows:n}=e,r={};return t.forEach((a,s)=>{r[a.name]=s}),n.map(a=>{const s={};return t.forEach((l,u)=>{if(a.row[u]!==void 0){const c=l.name;s[c]=a.row[u].v}}),s})},dSi=i=>{var s;const e=(i==null?void 0:i.englishName)||(i==null?void 0:i.dimensionColumn),t=i==null?void 0:i.condition,n=i==null?void 0:i.value,r=(s=hse.find(l=>l.value===t))==null?void 0:s.key,o=iSi[r];if(!e||!o)throw new Error("Invalid filter configuration");if(r==="isNull"||r==="isNotNull")return`${e} ${o}`;if(o==="LIKE"||o==="NOT LIKE"){let l=n;return t==="contains"?l=`%${n}%`:t==="StartsWith"?l=`${n}%`:t==="endsWith"?l=`%${n}`:t==="notContains"?l=`%${n}%`:t==="doesNotStartWith"?l=`${n}%`:t==="doesNotEndWith"&&(l=`%${n}`),`${e} ${o} '${l}'`}const a=typeof n=="string"?`'${n}'`:n;return`${e} ${o} ${a}`},fSi={metricInsight:{queryMql2Params:sSi,queryChartData:lSi,queryMetricId:oSi,queryDimensions:aSi,transformData:hSi},simpleJson:{}},oqe=i=>{const e=Jh(),{setError:t,setLoading:n}=Qh();return ce.useMemo(()=>{const o=fSi[i];return{queryMql2Params:o.queryMql2Params?aqe(o.queryMql2Params,t,n,e):()=>Promise.resolve({}),queryMetricId:o.queryMetricId?aqe(o.queryMetricId,t,n,e):()=>Promise.resolve({}),queryDimensions:o.queryDimensions?o.queryDimensions:()=>Promise.resolve({}),queryChartData:o.queryChartData?o.queryChartData:()=>Promise.resolve({}),transformData:a=>o.transformData?o.transformData({data:a}):a}},[i])};function aqe(i,e,t,n){return((...r)=>ga(null,null,function*(){try{return yield i(...r)}catch(o){let a=o==null?void 0:o.message;throw typeof o=="string"&&(a=o),t(!1),e({visible:!0,title:n.formatMessage({id:"metricError"}),message:a||"error"}),o}}))}const sqe=[{key:"none",label:"None",value:"none"},{key:"number",label:"Number",value:"number"},{key:"percentage_raw",label:"Percentage (raw)",value:"percentage_raw",desc:"1→1%"},{key:"percentage_scaled",label:"Percentage (scaled)",value:"percentage_scaled",desc:"1→100%"}],gSi={none:"",number:"",percentage_raw:"%",percentage_scaled:"%",celsius:"°C",fahrenheit:"°F",CNY:"¥",USD:"$",GBP:"£",EUR:"€"};function lqe(i,e){if(!i&&!e)return"";let t="",n="";return i&&i!=="none"&&(t=i),e&&e!=="none"&&(n=gSi[e]||e),t+(n?" "+n:"")}function pSi(i,e,t){if(!i)return null;const{dimensionDetailList:n,displayName:r,metricId:o,derivationMethod:a}=i,s={value:o,label:r},l=fse(n,a,t),c=((e==null?void 0:e.dimensions)||[(e==null?void 0:e.xField)||(e==null?void 0:e.nameField)]).map(d=>l.find(f=>d===f.label||d===f.value)).filter(Boolean),h=ySi(r,i);return{metrics:[s],dimensions:c,dissionOptions:l,dataFormat:h}}function mSi(i,e){const{metrics:t}=e,n=cqe(i),r=[],o={};return((n==null?void 0:n.metrics)||[]).forEach(s=>{var p,m;const l=(p=n==null?void 0:n.metricDefinitions)==null?void 0:p[s],u=l==null?void 0:l.refMetric,c=l==null?void 0:l.variables;let h;!u&&c?h=Object.values(c).map(v=>v==null?void 0:v.refMetric):h=[u];let d=[],f=[],g=!1;((m=l==null?void 0:l.indirections)==null?void 0:m.length)>0&&!c&&(g=!0),t.forEach(v=>{if(!g&&v.englishName===u){const b=v==null?void 0:v.metricUnit;o[s]={formatType:(b==null?void 0:b.type)||"none",decimalPlaces:(b==null?void 0:b.decimal)||0,suffix:lqe(b==null?void 0:b.valueUnit,b==null?void 0:b.formatUnit)}}else o[s]={formatType:"none",decimalPlaces:0,suffix:""};h!=null&&h.includes(v==null?void 0:v.englishName)&&!f.includes(v==null?void 0:v.metricId)&&(d.push(v),f.push(v==null?void 0:v.metricId))}),r.push({isDerived:g,displayName:s,label:s,value:"uuid-"+IV(6),metricDefinitions:l,atomicMetricIds:f,atomicMetricsInfo:d})}),{metricsOptions:r,dataFormat:o}}function vSi(i,e,t,n){const{dimensions:r,timeDimension:o={},filters:a=[]}=i,{metricsOptions:s,dataFormat:l}=e,u=Pi(ke({},n),{dataType:"TIMESTAMP"}),c=uqe(s),h=fse(t,c,n),d=(r==null?void 0:r.map(f=>h.find(g=>(f==null?void 0:f.displayName)===g.label||(f==null?void 0:f.dimensionId)===g.value)).filter(Boolean))||[];return(o==null?void 0:o.dimensionName)===(n==null?void 0:n.value)&&d.unshift(u),{metrics:s,dataFormat:l,dimensions:d,dissionOptions:h,timeDimension:o,filters:a,queryMetricOrgId:i==null?void 0:i.orgId}}function uqe(i){const e=[];return i==null||i.forEach(t=>{var n;t!=null&&t.atomicMetricsInfo&&((n=t==null?void 0:t.atomicMetricsInfo)==null||n.forEach(r=>{hl(r==null?void 0:r.derivationMethod)?e.push(...r.derivationMethod):Wh(r==null?void 0:r.derivationMethod)&&e.push(r.derivationMethod)}))}),e==null?void 0:e[0]}function bSi(i,e){var r,o,a,s,l;let t=!1,n=!1;if(!(e!=null&&e.enabled))return{defaultSelected:t,defaultDisabled:n};if((e==null?void 0:e.method)==="Ranking"&&(e!=null&&e.ranking)){const u=((r=e.ranking)==null?void 0:r.dimensions)||[],c=((o=e.ranking)==null?void 0:o.ranges)||[];return{defaultSelected:[...u,...c].includes(i),defaultDisabled:n}}if((e==null?void 0:e.method)==="Proportion"&&(e!=null&&e.proportion)){const u=((a=e.proportion)==null?void 0:a.dimensions)||[],c=((s=e.proportion)==null?void 0:s.ranges)||[];return{defaultSelected:[...u,...c].includes(i),defaultDisabled:n}}if((e==null?void 0:e.method)==="Custom"&&((l=e==null?void 0:e.custom)==null?void 0:l.length)>0){const u=e.custom,c=u.findIndex(h=>(h==null?void 0:h.dimension)===i);return c!==-1&&(c===u.length-1?t=!0:(t=!1,n=!0)),{defaultSelected:t,defaultDisabled:n}}return{defaultSelected:t,defaultDisabled:n}}const ySi=(i,e)=>{var t,n;if(i&&((t=e==null?void 0:e.computationalAttributes)!=null&&t.format)){const r=(n=e==null?void 0:e.computationalAttributes)==null?void 0:n.format;return{[i]:{formatType:(r==null?void 0:r.type)||"none",decimalPlaces:(r==null?void 0:r.decimal)||0,suffix:lqe(r==null?void 0:r.valueUnit,r==null?void 0:r.formatUnit)}}}return null};function cqe(i){let e={};if(typeof i=="object")e=i;else if(typeof i=="string")try{e=JSON.parse(i)}catch(t){console.error(t)}return e}function fse(i,e,t){const n=(i==null?void 0:i.map(r=>{const{defaultSelected:o,defaultDisabled:a}=bSi(r.dimensionId,e);return{label:r.displayName,value:r.dimensionId,englishName:r.englishName,dataType:r.dimensionColumnType,datasetName:r.datasetName,dimensionColumn:r.dimensionColumn,defaultSelected:o,defaultDisabled:a,disabled:o||a}}))||[];return n.unshift(Pi(ke({},t),{dataType:"TIMESTAMP",englishName:t.label,datasetName:void 0,dimensionColumn:void 0,defaultSelected:!1,defaultDisabled:!1,disabled:!1})),n}const _Si=[{key:"custom",label:"Custom",value:"custom"},{key:"today",label:"Today",value:"today"},{key:"last7Days",label:"Last 7 days",value:"last7Days"},{key:"last30Days",label:"Last 30 days",value:"last30Days"},{key:"last1Year",label:"Last year",value:"last1Year"},{key:"thisWeek",label:"This week",value:"thisWeek"},{key:"thisMonth",label:"This month",value:"thisMonth"},{key:"thisQuarter",label:"This quarter",value:"thisQuarter"},{key:"thisYear",label:"This year",value:"thisYear"},{key:"weekToDate",label:"Week-to-date",value:"weekToDate"},{key:"monthToDate",label:"Month-to-date",value:"monthToDate"},{key:"quarterToDate",label:"Quarter-to-date",value:"quarterToDate"},{key:"yearToDate",label:"Year-to-date",value:"yearToDate"},{key:"advanced",label:"Advanced",value:"advanced"}],CSi=[{key:"lastPeriod",label:"Last N period",value:"lastPeriod"},{key:"periodAgo",label:"N periods ago",value:"periodAgo"},{key:"periodBoundary",label:"Current/previous period boundary",value:"periodBoundary"}],xSi=[{key:"current",label:"Current",value:"current"},{key:"previous",label:"Previous",value:"previous"}],CS=[{key:"minute",label:"Minute",value:"minute"},{key:"hour",label:"Hour",value:"hour"},{key:"day",label:"Day",value:"day"},{key:"week",label:"Week",value:"week"},{key:"month",label:"Month",value:"month"},{key:"quarter",label:"Quarter",value:"quarter"},{key:"year",label:"Year",value:"year"}],hqe=[{key:"minute",label:"Minute",value:"minute"},{key:"hour",label:"Hour",value:"hour"},{key:"year",label:"Year",value:"year"},{key:"quarter",label:"Quarter",value:"quarter"},{key:"month",label:"Month",value:"month"},{key:"week",label:"Week",value:"week"},{key:"day",label:"Day",value:"day"}],SSi=[{key:"first",label:"First",value:"first"},{key:"last",label:"Last",value:"last"}],dqe={type:"lastPeriod",lastPeriod:{range:7,unit:"day"},periodAgo:{range:7,unit:"day"},periodBoundary:{periodType:"current",periodUnit:"month",periodRange:void 0,boundaryType:"first",boundaryUnit:"day"}},VT={second:0,minute:1,hour:2,day:3,week:4,month:5,quarter:6,year:7},wSi=i=>{if(i&&Object.prototype.hasOwnProperty.call(VT,i)){const e=VT[i];return CS.filter(t=>VT[t.value]<e)}return CS},ESi=i=>{const e=VT[i==null?void 0:i.toLowerCase()];return e!==void 0?hqe.filter(t=>VT[t.value]<e):hqe},ASi=(i,e,t)=>{var n,r,o,a,s,l;if((e==null?void 0:e.type)==="custom"&&(n=e==null?void 0:e.custom)!=null&&n.from&&(r=e==null?void 0:e.custom)!=null&&r.to){const u=Ir(e.custom.from).format(Ob),c=Ir(e.custom.to).format(Ob);return`${u}-${c}`}if((e==null?void 0:e.type)==="advanced"&&e.advanced){const u=e.advanced;let c="";if((u==null?void 0:u.type)==="lastPeriod")return t({id:"lastNUnits"},{range:(o=u==null?void 0:u.lastPeriod)==null?void 0:o.range,unit:t({id:"unit"+((a=u.lastPeriod)==null?void 0:a.unit)})});if((u==null?void 0:u.type)==="periodAgo")return t({id:"periodAgoNUnits"},{range:(s=u.periodAgo)==null?void 0:s.range,unit:t({id:"unit"+((l=u.periodAgo)==null?void 0:l.unit)})});if((u==null?void 0:u.type)==="periodBoundary"){const h=u.periodBoundary;if((h==null?void 0:h.periodType)==="current")return t({id:"currentNUnit"},{periodUnit:t({id:"unit"+h.periodUnit}),boundaryType:t({id:h.boundaryType}),boundaryUnit:t({id:"unit"+h.boundaryUnit})});if((h==null?void 0:h.periodType)==="previous")return t({id:"previousNUnits"},{periodRange:h.periodRange,periodUnit:t({id:"unit"+h.periodUnit}),boundaryType:t({id:h.boundaryType}),boundaryUnit:t({id:"unit"+h.boundaryUnit})})}return c}return i},TSi=i=>i==null?void 0:i.dimensionUnit,RSi=(i,e)=>{var t,n,r;if(!(i!=null&&i.type)){const o=e==null?void 0:e.mql;let a;if(a=(t=cqe(o))==null?void 0:t.timeConstraint,!a)return{};const s=Object.keys(a)[0],l=a[s];return l&&typeof l=="object"&&(l==null?void 0:l.type)==="advanced"&&((r=(n=l==null?void 0:l.advanced)==null?void 0:n.custom)!=null&&r.from)?{type:"custom",custom:{from:l.advanced.custom.from,to:l.advanced.custom.to||Ir().format("YYYY-MM-DD HH:mm:ss")}}:{}}return i},MSi=i=>{var e;return(i==null?void 0:i.type)==="custom"&&((e=i==null?void 0:i.custom)!=null&&e.from)?{type:"custom",custom:{from:Ir(i.custom.from).format("YYYY-MM-DD HH:mm:ss"),to:Ir(i.custom.to).format("YYYY-MM-DD HH:mm:ss")}}:i},gse=i=>{const e=Jh(),t=i.type,{queryChartData:n,transformData:r}=oqe(t),{chartJson:o,drillBy:a,setLoading:s,setChartJson:l,setError:u,setDataSourceQueryInfo:c,setChartDrillBy:h}=Qh();return{queryChartDataFromDatasource:(p,m)=>ga(null,null,function*(){var S;const{metrics:v,dimensions:b,timeGrain:y,dataFormat:_}=p;if(u({visible:!1,title:"",message:""}),p.timeRange=MSi(p.timeRange),v!=null&&v.length){const x=yield n(i,p).catch(R=>{u({visible:!0,title:e.formatMessage({id:"chartDataLoadingFailed"}),message:R.message}),s(!1)});c({fieldInfo:(S=x==null?void 0:x.columns)==null?void 0:S.map(R=>({fieldName:R==null?void 0:R.name,type:R.type}))});const w=r(x);let E=o;jke(o)&&(E=yield Uke(Pi(ke({},o),{data:w})));let A=OV({chartJson:E,metrics:v,dimensions:b,isInit:m});const T=Pi(ke({},A),{data:w,timeGrain:y,dataFormat:_});l(T),s(!1),x&&u({visible:!1,title:"",message:""})}}),queryDrillByChartData:b=>ga(null,[b],function*({queryData:p,setDrillLoading:m,setDrillError:v}){var S;const{metrics:y,dimensions:_}=p;if(y!=null&&y.length){const x=yield n(i,p).catch(k=>{v({visible:!0,title:e.formatMessage({id:"drillDataLoadingFailed"}),message:k.message}),m(!1)}),w=r(x),E=OV({chartJson:o,metrics:y,dimensions:_}),A=Pi(ke({},E),{data:w}),T=zJ(A),R=a;h(Pi(ke({},R),{chartState:{chartJson:A,dataset:T,history:[...((S=R.chartState)==null?void 0:S.history)||[],{chartJson:A,dataset:T}]}})),m(!1),x&&v({visible:!1,title:"",message:""})}}),queyDetailTableData:p=>ga(null,null,function*(){return n(i,Pi(ke({},p),{queryType:"detailed"})).then(m=>r(m))})}},kSi=Es(pl)`
|
|
10727
10727
|
${()=>bl`
|
|
10728
10728
|
&.advt-vis-chart-antd-btn {
|
|
10729
10729
|
color: #89898a;
|
package/dist/index.umd.js.gz
CHANGED
|
Binary file
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const version = "3.0.
|
|
1
|
+
declare const version = "3.0.10";
|
|
2
2
|
export default version;
|