@opengis/bi 1.2.2 → 1.2.4

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.
@@ -1,3543 +0,0 @@
1
- import { createElementBlock as _, openBlock as x, createElementVNode as g, Fragment as P, renderList as U, normalizeStyle as Le, normalizeClass as Q, createCommentVNode as N, toDisplayString as E, ref as Ee, computed as Ke, onUnmounted as It, createTextVNode as pt, defineAsyncComponent as T, defineComponent as zt, mergeModels as Xe, useModel as Mt, withDirectives as Ht, vModelCheckbox as qt, resolveComponent as I, createBlock as M, createVNode as Ue, resolveDynamicComponent as Wt, createStaticVNode as mt, withCtx as Jt } from "vue";
2
- function z(e, t) {
3
- return e != null && e.value ? isNaN(e == null ? void 0 : e.value) ? e == null ? void 0 : e.value : new Intl.NumberFormat("en", t || {
4
- notation: "compact"
5
- }).format(e == null ? void 0 : e.value) : isNaN(e) ? e : new Intl.NumberFormat("en", t || {
6
- notation: "compact"
7
- }).format(e);
8
- }
9
- function Be(e) {
10
- if (!(e != null && e.includes("T")))
11
- return e;
12
- const [t, s, r] = e.split("T")[0].split("-");
13
- return `${r}.${s}.${t}`;
14
- }
15
- function Qi(e) {
16
- return Intl.NumberFormat("en").format(e);
17
- }
18
- function gt(e, t) {
19
- return function() {
20
- return e.apply(t, arguments);
21
- };
22
- }
23
- const { toString: Kt } = Object.prototype, { getPrototypeOf: je } = Object, { iterator: ye, toStringTag: bt } = Symbol, xe = /* @__PURE__ */ ((e) => (t) => {
24
- const s = Kt.call(t);
25
- return e[s] || (e[s] = s.slice(8, -1).toLowerCase());
26
- })(/* @__PURE__ */ Object.create(null)), B = (e) => (e = e.toLowerCase(), (t) => xe(t) === e), _e = (e) => (t) => typeof t === e, { isArray: te } = Array, ee = _e("undefined");
27
- function oe(e) {
28
- return e !== null && !ee(e) && e.constructor !== null && !ee(e.constructor) && F(e.constructor.isBuffer) && e.constructor.isBuffer(e);
29
- }
30
- const wt = B("ArrayBuffer");
31
- function Xt(e) {
32
- let t;
33
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && wt(e.buffer), t;
34
- }
35
- const Gt = _e("string"), F = _e("function"), yt = _e("number"), ae = (e) => e !== null && typeof e == "object", Qt = (e) => e === !0 || e === !1, pe = (e) => {
36
- if (xe(e) !== "object")
37
- return !1;
38
- const t = je(e);
39
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(bt in e) && !(ye in e);
40
- }, Zt = (e) => {
41
- if (!ae(e) || oe(e))
42
- return !1;
43
- try {
44
- return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
45
- } catch {
46
- return !1;
47
- }
48
- }, Yt = B("Date"), es = B("File"), ts = B("Blob"), ss = B("FileList"), rs = (e) => ae(e) && F(e.pipe), ns = (e) => {
49
- let t;
50
- return e && (typeof FormData == "function" && e instanceof FormData || F(e.append) && ((t = xe(e)) === "formdata" || // detect form-data instance
51
- t === "object" && F(e.toString) && e.toString() === "[object FormData]"));
52
- }, is = B("URLSearchParams"), [os, as, ls, cs] = ["ReadableStream", "Request", "Response", "Headers"].map(B), us = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
53
- function le(e, t, { allOwnKeys: s = !1 } = {}) {
54
- if (e === null || typeof e > "u")
55
- return;
56
- let r, n;
57
- if (typeof e != "object" && (e = [e]), te(e))
58
- for (r = 0, n = e.length; r < n; r++)
59
- t.call(null, e[r], r, e);
60
- else {
61
- if (oe(e))
62
- return;
63
- const i = s ? Object.getOwnPropertyNames(e) : Object.keys(e), o = i.length;
64
- let a;
65
- for (r = 0; r < o; r++)
66
- a = i[r], t.call(null, e[a], a, e);
67
- }
68
- }
69
- function xt(e, t) {
70
- if (oe(e))
71
- return null;
72
- t = t.toLowerCase();
73
- const s = Object.keys(e);
74
- let r = s.length, n;
75
- for (; r-- > 0; )
76
- if (n = s[r], t === n.toLowerCase())
77
- return n;
78
- return null;
79
- }
80
- const X = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, _t = (e) => !ee(e) && e !== X;
81
- function Te() {
82
- const { caseless: e, skipUndefined: t } = _t(this) && this || {}, s = {}, r = (n, i) => {
83
- const o = e && xt(s, i) || i;
84
- pe(s[o]) && pe(n) ? s[o] = Te(s[o], n) : pe(n) ? s[o] = Te({}, n) : te(n) ? s[o] = n.slice() : (!t || !ee(n)) && (s[o] = n);
85
- };
86
- for (let n = 0, i = arguments.length; n < i; n++)
87
- arguments[n] && le(arguments[n], r);
88
- return s;
89
- }
90
- const ds = (e, t, s, { allOwnKeys: r } = {}) => (le(t, (n, i) => {
91
- s && F(n) ? e[i] = gt(n, s) : e[i] = n;
92
- }, { allOwnKeys: r }), e), fs = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), hs = (e, t, s, r) => {
93
- e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
94
- value: t.prototype
95
- }), s && Object.assign(e.prototype, s);
96
- }, ps = (e, t, s, r) => {
97
- let n, i, o;
98
- const a = {};
99
- if (t = t || {}, e == null) return t;
100
- do {
101
- for (n = Object.getOwnPropertyNames(e), i = n.length; i-- > 0; )
102
- o = n[i], (!r || r(o, e, t)) && !a[o] && (t[o] = e[o], a[o] = !0);
103
- e = s !== !1 && je(e);
104
- } while (e && (!s || s(e, t)) && e !== Object.prototype);
105
- return t;
106
- }, ms = (e, t, s) => {
107
- e = String(e), (s === void 0 || s > e.length) && (s = e.length), s -= t.length;
108
- const r = e.indexOf(t, s);
109
- return r !== -1 && r === s;
110
- }, gs = (e) => {
111
- if (!e) return null;
112
- if (te(e)) return e;
113
- let t = e.length;
114
- if (!yt(t)) return null;
115
- const s = new Array(t);
116
- for (; t-- > 0; )
117
- s[t] = e[t];
118
- return s;
119
- }, bs = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && je(Uint8Array)), ws = (e, t) => {
120
- const r = (e && e[ye]).call(e);
121
- let n;
122
- for (; (n = r.next()) && !n.done; ) {
123
- const i = n.value;
124
- t.call(e, i[0], i[1]);
125
- }
126
- }, ys = (e, t) => {
127
- let s;
128
- const r = [];
129
- for (; (s = e.exec(t)) !== null; )
130
- r.push(s);
131
- return r;
132
- }, xs = B("HTMLFormElement"), _s = (e) => e.toLowerCase().replace(
133
- /[-_\s]([a-z\d])(\w*)/g,
134
- function(s, r, n) {
135
- return r.toUpperCase() + n;
136
- }
137
- ), Ge = (({ hasOwnProperty: e }) => (t, s) => e.call(t, s))(Object.prototype), Ds = B("RegExp"), Dt = (e, t) => {
138
- const s = Object.getOwnPropertyDescriptors(e), r = {};
139
- le(s, (n, i) => {
140
- let o;
141
- (o = t(n, i, e)) !== !1 && (r[i] = o || n);
142
- }), Object.defineProperties(e, r);
143
- }, Ss = (e) => {
144
- Dt(e, (t, s) => {
145
- if (F(e) && ["arguments", "caller", "callee"].indexOf(s) !== -1)
146
- return !1;
147
- const r = e[s];
148
- if (F(r)) {
149
- if (t.enumerable = !1, "writable" in t) {
150
- t.writable = !1;
151
- return;
152
- }
153
- t.set || (t.set = () => {
154
- throw Error("Can not rewrite read-only method '" + s + "'");
155
- });
156
- }
157
- });
158
- }, ks = (e, t) => {
159
- const s = {}, r = (n) => {
160
- n.forEach((i) => {
161
- s[i] = !0;
162
- });
163
- };
164
- return te(e) ? r(e) : r(String(e).split(t)), s;
165
- }, vs = () => {
166
- }, Es = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
167
- function Cs(e) {
168
- return !!(e && F(e.append) && e[bt] === "FormData" && e[ye]);
169
- }
170
- const Os = (e) => {
171
- const t = new Array(10), s = (r, n) => {
172
- if (ae(r)) {
173
- if (t.indexOf(r) >= 0)
174
- return;
175
- if (oe(r))
176
- return r;
177
- if (!("toJSON" in r)) {
178
- t[n] = r;
179
- const i = te(r) ? [] : {};
180
- return le(r, (o, a) => {
181
- const f = s(o, n + 1);
182
- !ee(f) && (i[a] = f);
183
- }), t[n] = void 0, i;
184
- }
185
- }
186
- return r;
187
- };
188
- return s(e, 0);
189
- }, Rs = B("AsyncFunction"), $s = (e) => e && (ae(e) || F(e)) && F(e.then) && F(e.catch), St = ((e, t) => e ? setImmediate : t ? ((s, r) => (X.addEventListener("message", ({ source: n, data: i }) => {
190
- n === X && i === s && r.length && r.shift()();
191
- }, !1), (n) => {
192
- r.push(n), X.postMessage(s, "*");
193
- }))(`axios@${Math.random()}`, []) : (s) => setTimeout(s))(
194
- typeof setImmediate == "function",
195
- F(X.postMessage)
196
- ), Ts = typeof queueMicrotask < "u" ? queueMicrotask.bind(X) : typeof process < "u" && process.nextTick || St, Ns = (e) => e != null && F(e[ye]), l = {
197
- isArray: te,
198
- isArrayBuffer: wt,
199
- isBuffer: oe,
200
- isFormData: ns,
201
- isArrayBufferView: Xt,
202
- isString: Gt,
203
- isNumber: yt,
204
- isBoolean: Qt,
205
- isObject: ae,
206
- isPlainObject: pe,
207
- isEmptyObject: Zt,
208
- isReadableStream: os,
209
- isRequest: as,
210
- isResponse: ls,
211
- isHeaders: cs,
212
- isUndefined: ee,
213
- isDate: Yt,
214
- isFile: es,
215
- isBlob: ts,
216
- isRegExp: Ds,
217
- isFunction: F,
218
- isStream: rs,
219
- isURLSearchParams: is,
220
- isTypedArray: bs,
221
- isFileList: ss,
222
- forEach: le,
223
- merge: Te,
224
- extend: ds,
225
- trim: us,
226
- stripBOM: fs,
227
- inherits: hs,
228
- toFlatObject: ps,
229
- kindOf: xe,
230
- kindOfTest: B,
231
- endsWith: ms,
232
- toArray: gs,
233
- forEachEntry: ws,
234
- matchAll: ys,
235
- isHTMLForm: xs,
236
- hasOwnProperty: Ge,
237
- hasOwnProp: Ge,
238
- // an alias to avoid ESLint no-prototype-builtins detection
239
- reduceDescriptors: Dt,
240
- freezeMethods: Ss,
241
- toObjectSet: ks,
242
- toCamelCase: _s,
243
- noop: vs,
244
- toFiniteNumber: Es,
245
- findKey: xt,
246
- global: X,
247
- isContextDefined: _t,
248
- isSpecCompliantForm: Cs,
249
- toJSONObject: Os,
250
- isAsyncFn: Rs,
251
- isThenable: $s,
252
- setImmediate: St,
253
- asap: Ts,
254
- isIterable: Ns
255
- };
256
- function D(e, t, s, r, n) {
257
- Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), s && (this.config = s), r && (this.request = r), n && (this.response = n, this.status = n.status ? n.status : null);
258
- }
259
- l.inherits(D, Error, {
260
- toJSON: function() {
261
- return {
262
- // Standard
263
- message: this.message,
264
- name: this.name,
265
- // Microsoft
266
- description: this.description,
267
- number: this.number,
268
- // Mozilla
269
- fileName: this.fileName,
270
- lineNumber: this.lineNumber,
271
- columnNumber: this.columnNumber,
272
- stack: this.stack,
273
- // Axios
274
- config: l.toJSONObject(this.config),
275
- code: this.code,
276
- status: this.status
277
- };
278
- }
279
- });
280
- const kt = D.prototype, vt = {};
281
- [
282
- "ERR_BAD_OPTION_VALUE",
283
- "ERR_BAD_OPTION",
284
- "ECONNABORTED",
285
- "ETIMEDOUT",
286
- "ERR_NETWORK",
287
- "ERR_FR_TOO_MANY_REDIRECTS",
288
- "ERR_DEPRECATED",
289
- "ERR_BAD_RESPONSE",
290
- "ERR_BAD_REQUEST",
291
- "ERR_CANCELED",
292
- "ERR_NOT_SUPPORT",
293
- "ERR_INVALID_URL"
294
- // eslint-disable-next-line func-names
295
- ].forEach((e) => {
296
- vt[e] = { value: e };
297
- });
298
- Object.defineProperties(D, vt);
299
- Object.defineProperty(kt, "isAxiosError", { value: !0 });
300
- D.from = (e, t, s, r, n, i) => {
301
- const o = Object.create(kt);
302
- l.toFlatObject(e, o, function(u) {
303
- return u !== Error.prototype;
304
- }, (d) => d !== "isAxiosError");
305
- const a = e && e.message ? e.message : "Error", f = t == null && e ? e.code : t;
306
- return D.call(o, a, f, s, r, n), e && o.cause == null && Object.defineProperty(o, "cause", { value: e, configurable: !0 }), o.name = e && e.name || "Error", i && Object.assign(o, i), o;
307
- };
308
- const Fs = null;
309
- function Ne(e) {
310
- return l.isPlainObject(e) || l.isArray(e);
311
- }
312
- function Et(e) {
313
- return l.endsWith(e, "[]") ? e.slice(0, -2) : e;
314
- }
315
- function Qe(e, t, s) {
316
- return e ? e.concat(t).map(function(n, i) {
317
- return n = Et(n), !s && i ? "[" + n + "]" : n;
318
- }).join(s ? "." : "") : t;
319
- }
320
- function As(e) {
321
- return l.isArray(e) && !e.some(Ne);
322
- }
323
- const Ps = l.toFlatObject(l, {}, null, function(t) {
324
- return /^is[A-Z]/.test(t);
325
- });
326
- function De(e, t, s) {
327
- if (!l.isObject(e))
328
- throw new TypeError("target must be an object");
329
- t = t || new FormData(), s = l.toFlatObject(s, {
330
- metaTokens: !0,
331
- dots: !1,
332
- indexes: !1
333
- }, !1, function(p, m) {
334
- return !l.isUndefined(m[p]);
335
- });
336
- const r = s.metaTokens, n = s.visitor || u, i = s.dots, o = s.indexes, f = (s.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(t);
337
- if (!l.isFunction(n))
338
- throw new TypeError("visitor must be a function");
339
- function d(c) {
340
- if (c === null) return "";
341
- if (l.isDate(c))
342
- return c.toISOString();
343
- if (l.isBoolean(c))
344
- return c.toString();
345
- if (!f && l.isBlob(c))
346
- throw new D("Blob is not supported. Use a Buffer instead.");
347
- return l.isArrayBuffer(c) || l.isTypedArray(c) ? f && typeof Blob == "function" ? new Blob([c]) : Buffer.from(c) : c;
348
- }
349
- function u(c, p, m) {
350
- let k = c;
351
- if (c && !m && typeof c == "object") {
352
- if (l.endsWith(p, "{}"))
353
- p = r ? p : p.slice(0, -2), c = JSON.stringify(c);
354
- else if (l.isArray(c) && As(c) || (l.isFileList(c) || l.endsWith(p, "[]")) && (k = l.toArray(c)))
355
- return p = Et(p), k.forEach(function(y, C) {
356
- !(l.isUndefined(y) || y === null) && t.append(
357
- // eslint-disable-next-line no-nested-ternary
358
- o === !0 ? Qe([p], C, i) : o === null ? p : p + "[]",
359
- d(y)
360
- );
361
- }), !1;
362
- }
363
- return Ne(c) ? !0 : (t.append(Qe(m, p, i), d(c)), !1);
364
- }
365
- const h = [], w = Object.assign(Ps, {
366
- defaultVisitor: u,
367
- convertValue: d,
368
- isVisitable: Ne
369
- });
370
- function b(c, p) {
371
- if (!l.isUndefined(c)) {
372
- if (h.indexOf(c) !== -1)
373
- throw Error("Circular reference detected in " + p.join("."));
374
- h.push(c), l.forEach(c, function(k, S) {
375
- (!(l.isUndefined(k) || k === null) && n.call(
376
- t,
377
- k,
378
- l.isString(S) ? S.trim() : S,
379
- p,
380
- w
381
- )) === !0 && b(k, p ? p.concat(S) : [S]);
382
- }), h.pop();
383
- }
384
- }
385
- if (!l.isObject(e))
386
- throw new TypeError("data must be an object");
387
- return b(e), t;
388
- }
389
- function Ze(e) {
390
- const t = {
391
- "!": "%21",
392
- "'": "%27",
393
- "(": "%28",
394
- ")": "%29",
395
- "~": "%7E",
396
- "%20": "+",
397
- "%00": "\0"
398
- };
399
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
400
- return t[r];
401
- });
402
- }
403
- function Ve(e, t) {
404
- this._pairs = [], e && De(e, this, t);
405
- }
406
- const Ct = Ve.prototype;
407
- Ct.append = function(t, s) {
408
- this._pairs.push([t, s]);
409
- };
410
- Ct.toString = function(t) {
411
- const s = t ? function(r) {
412
- return t.call(this, r, Ze);
413
- } : Ze;
414
- return this._pairs.map(function(n) {
415
- return s(n[0]) + "=" + s(n[1]);
416
- }, "").join("&");
417
- };
418
- function Ls(e) {
419
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
420
- }
421
- function Ot(e, t, s) {
422
- if (!t)
423
- return e;
424
- const r = s && s.encode || Ls;
425
- l.isFunction(s) && (s = {
426
- serialize: s
427
- });
428
- const n = s && s.serialize;
429
- let i;
430
- if (n ? i = n(t, s) : i = l.isURLSearchParams(t) ? t.toString() : new Ve(t, s).toString(r), i) {
431
- const o = e.indexOf("#");
432
- o !== -1 && (e = e.slice(0, o)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
433
- }
434
- return e;
435
- }
436
- class Ye {
437
- constructor() {
438
- this.handlers = [];
439
- }
440
- /**
441
- * Add a new interceptor to the stack
442
- *
443
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
444
- * @param {Function} rejected The function to handle `reject` for a `Promise`
445
- *
446
- * @return {Number} An ID used to remove interceptor later
447
- */
448
- use(t, s, r) {
449
- return this.handlers.push({
450
- fulfilled: t,
451
- rejected: s,
452
- synchronous: r ? r.synchronous : !1,
453
- runWhen: r ? r.runWhen : null
454
- }), this.handlers.length - 1;
455
- }
456
- /**
457
- * Remove an interceptor from the stack
458
- *
459
- * @param {Number} id The ID that was returned by `use`
460
- *
461
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
462
- */
463
- eject(t) {
464
- this.handlers[t] && (this.handlers[t] = null);
465
- }
466
- /**
467
- * Clear all interceptors from the stack
468
- *
469
- * @returns {void}
470
- */
471
- clear() {
472
- this.handlers && (this.handlers = []);
473
- }
474
- /**
475
- * Iterate over all the registered interceptors
476
- *
477
- * This method is particularly useful for skipping over any
478
- * interceptors that may have become `null` calling `eject`.
479
- *
480
- * @param {Function} fn The function to call for each interceptor
481
- *
482
- * @returns {void}
483
- */
484
- forEach(t) {
485
- l.forEach(this.handlers, function(r) {
486
- r !== null && t(r);
487
- });
488
- }
489
- }
490
- const Rt = {
491
- silentJSONParsing: !0,
492
- forcedJSONParsing: !0,
493
- clarifyTimeoutError: !1
494
- }, Us = typeof URLSearchParams < "u" ? URLSearchParams : Ve, Bs = typeof FormData < "u" ? FormData : null, js = typeof Blob < "u" ? Blob : null, Vs = {
495
- isBrowser: !0,
496
- classes: {
497
- URLSearchParams: Us,
498
- FormData: Bs,
499
- Blob: js
500
- },
501
- protocols: ["http", "https", "file", "blob", "url", "data"]
502
- }, Ie = typeof window < "u" && typeof document < "u", Fe = typeof navigator == "object" && navigator || void 0, Is = Ie && (!Fe || ["ReactNative", "NativeScript", "NS"].indexOf(Fe.product) < 0), zs = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
503
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Ms = Ie && window.location.href || "http://localhost", Hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
504
- __proto__: null,
505
- hasBrowserEnv: Ie,
506
- hasStandardBrowserEnv: Is,
507
- hasStandardBrowserWebWorkerEnv: zs,
508
- navigator: Fe,
509
- origin: Ms
510
- }, Symbol.toStringTag, { value: "Module" })), R = {
511
- ...Hs,
512
- ...Vs
513
- };
514
- function qs(e, t) {
515
- return De(e, new R.classes.URLSearchParams(), {
516
- visitor: function(s, r, n, i) {
517
- return R.isNode && l.isBuffer(s) ? (this.append(r, s.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
518
- },
519
- ...t
520
- });
521
- }
522
- function Ws(e) {
523
- return l.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
524
- }
525
- function Js(e) {
526
- const t = {}, s = Object.keys(e);
527
- let r;
528
- const n = s.length;
529
- let i;
530
- for (r = 0; r < n; r++)
531
- i = s[r], t[i] = e[i];
532
- return t;
533
- }
534
- function $t(e) {
535
- function t(s, r, n, i) {
536
- let o = s[i++];
537
- if (o === "__proto__") return !0;
538
- const a = Number.isFinite(+o), f = i >= s.length;
539
- return o = !o && l.isArray(n) ? n.length : o, f ? (l.hasOwnProp(n, o) ? n[o] = [n[o], r] : n[o] = r, !a) : ((!n[o] || !l.isObject(n[o])) && (n[o] = []), t(s, r, n[o], i) && l.isArray(n[o]) && (n[o] = Js(n[o])), !a);
540
- }
541
- if (l.isFormData(e) && l.isFunction(e.entries)) {
542
- const s = {};
543
- return l.forEachEntry(e, (r, n) => {
544
- t(Ws(r), n, s, 0);
545
- }), s;
546
- }
547
- return null;
548
- }
549
- function Ks(e, t, s) {
550
- if (l.isString(e))
551
- try {
552
- return (t || JSON.parse)(e), l.trim(e);
553
- } catch (r) {
554
- if (r.name !== "SyntaxError")
555
- throw r;
556
- }
557
- return (s || JSON.stringify)(e);
558
- }
559
- const ce = {
560
- transitional: Rt,
561
- adapter: ["xhr", "http", "fetch"],
562
- transformRequest: [function(t, s) {
563
- const r = s.getContentType() || "", n = r.indexOf("application/json") > -1, i = l.isObject(t);
564
- if (i && l.isHTMLForm(t) && (t = new FormData(t)), l.isFormData(t))
565
- return n ? JSON.stringify($t(t)) : t;
566
- if (l.isArrayBuffer(t) || l.isBuffer(t) || l.isStream(t) || l.isFile(t) || l.isBlob(t) || l.isReadableStream(t))
567
- return t;
568
- if (l.isArrayBufferView(t))
569
- return t.buffer;
570
- if (l.isURLSearchParams(t))
571
- return s.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
572
- let a;
573
- if (i) {
574
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
575
- return qs(t, this.formSerializer).toString();
576
- if ((a = l.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
577
- const f = this.env && this.env.FormData;
578
- return De(
579
- a ? { "files[]": t } : t,
580
- f && new f(),
581
- this.formSerializer
582
- );
583
- }
584
- }
585
- return i || n ? (s.setContentType("application/json", !1), Ks(t)) : t;
586
- }],
587
- transformResponse: [function(t) {
588
- const s = this.transitional || ce.transitional, r = s && s.forcedJSONParsing, n = this.responseType === "json";
589
- if (l.isResponse(t) || l.isReadableStream(t))
590
- return t;
591
- if (t && l.isString(t) && (r && !this.responseType || n)) {
592
- const o = !(s && s.silentJSONParsing) && n;
593
- try {
594
- return JSON.parse(t, this.parseReviver);
595
- } catch (a) {
596
- if (o)
597
- throw a.name === "SyntaxError" ? D.from(a, D.ERR_BAD_RESPONSE, this, null, this.response) : a;
598
- }
599
- }
600
- return t;
601
- }],
602
- /**
603
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
604
- * timeout is not created.
605
- */
606
- timeout: 0,
607
- xsrfCookieName: "XSRF-TOKEN",
608
- xsrfHeaderName: "X-XSRF-TOKEN",
609
- maxContentLength: -1,
610
- maxBodyLength: -1,
611
- env: {
612
- FormData: R.classes.FormData,
613
- Blob: R.classes.Blob
614
- },
615
- validateStatus: function(t) {
616
- return t >= 200 && t < 300;
617
- },
618
- headers: {
619
- common: {
620
- Accept: "application/json, text/plain, */*",
621
- "Content-Type": void 0
622
- }
623
- }
624
- };
625
- l.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
626
- ce.headers[e] = {};
627
- });
628
- const Xs = l.toObjectSet([
629
- "age",
630
- "authorization",
631
- "content-length",
632
- "content-type",
633
- "etag",
634
- "expires",
635
- "from",
636
- "host",
637
- "if-modified-since",
638
- "if-unmodified-since",
639
- "last-modified",
640
- "location",
641
- "max-forwards",
642
- "proxy-authorization",
643
- "referer",
644
- "retry-after",
645
- "user-agent"
646
- ]), Gs = (e) => {
647
- const t = {};
648
- let s, r, n;
649
- return e && e.split(`
650
- `).forEach(function(o) {
651
- n = o.indexOf(":"), s = o.substring(0, n).trim().toLowerCase(), r = o.substring(n + 1).trim(), !(!s || t[s] && Xs[s]) && (s === "set-cookie" ? t[s] ? t[s].push(r) : t[s] = [r] : t[s] = t[s] ? t[s] + ", " + r : r);
652
- }), t;
653
- }, et = Symbol("internals");
654
- function ne(e) {
655
- return e && String(e).trim().toLowerCase();
656
- }
657
- function me(e) {
658
- return e === !1 || e == null ? e : l.isArray(e) ? e.map(me) : String(e);
659
- }
660
- function Qs(e) {
661
- const t = /* @__PURE__ */ Object.create(null), s = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
662
- let r;
663
- for (; r = s.exec(e); )
664
- t[r[1]] = r[2];
665
- return t;
666
- }
667
- const Zs = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
668
- function Ce(e, t, s, r, n) {
669
- if (l.isFunction(r))
670
- return r.call(this, t, s);
671
- if (n && (t = s), !!l.isString(t)) {
672
- if (l.isString(r))
673
- return t.indexOf(r) !== -1;
674
- if (l.isRegExp(r))
675
- return r.test(t);
676
- }
677
- }
678
- function Ys(e) {
679
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, s, r) => s.toUpperCase() + r);
680
- }
681
- function er(e, t) {
682
- const s = l.toCamelCase(" " + t);
683
- ["get", "set", "has"].forEach((r) => {
684
- Object.defineProperty(e, r + s, {
685
- value: function(n, i, o) {
686
- return this[r].call(this, t, n, i, o);
687
- },
688
- configurable: !0
689
- });
690
- });
691
- }
692
- let A = class {
693
- constructor(t) {
694
- t && this.set(t);
695
- }
696
- set(t, s, r) {
697
- const n = this;
698
- function i(a, f, d) {
699
- const u = ne(f);
700
- if (!u)
701
- throw new Error("header name must be a non-empty string");
702
- const h = l.findKey(n, u);
703
- (!h || n[h] === void 0 || d === !0 || d === void 0 && n[h] !== !1) && (n[h || f] = me(a));
704
- }
705
- const o = (a, f) => l.forEach(a, (d, u) => i(d, u, f));
706
- if (l.isPlainObject(t) || t instanceof this.constructor)
707
- o(t, s);
708
- else if (l.isString(t) && (t = t.trim()) && !Zs(t))
709
- o(Gs(t), s);
710
- else if (l.isObject(t) && l.isIterable(t)) {
711
- let a = {}, f, d;
712
- for (const u of t) {
713
- if (!l.isArray(u))
714
- throw TypeError("Object iterator must return a key-value pair");
715
- a[d = u[0]] = (f = a[d]) ? l.isArray(f) ? [...f, u[1]] : [f, u[1]] : u[1];
716
- }
717
- o(a, s);
718
- } else
719
- t != null && i(s, t, r);
720
- return this;
721
- }
722
- get(t, s) {
723
- if (t = ne(t), t) {
724
- const r = l.findKey(this, t);
725
- if (r) {
726
- const n = this[r];
727
- if (!s)
728
- return n;
729
- if (s === !0)
730
- return Qs(n);
731
- if (l.isFunction(s))
732
- return s.call(this, n, r);
733
- if (l.isRegExp(s))
734
- return s.exec(n);
735
- throw new TypeError("parser must be boolean|regexp|function");
736
- }
737
- }
738
- }
739
- has(t, s) {
740
- if (t = ne(t), t) {
741
- const r = l.findKey(this, t);
742
- return !!(r && this[r] !== void 0 && (!s || Ce(this, this[r], r, s)));
743
- }
744
- return !1;
745
- }
746
- delete(t, s) {
747
- const r = this;
748
- let n = !1;
749
- function i(o) {
750
- if (o = ne(o), o) {
751
- const a = l.findKey(r, o);
752
- a && (!s || Ce(r, r[a], a, s)) && (delete r[a], n = !0);
753
- }
754
- }
755
- return l.isArray(t) ? t.forEach(i) : i(t), n;
756
- }
757
- clear(t) {
758
- const s = Object.keys(this);
759
- let r = s.length, n = !1;
760
- for (; r--; ) {
761
- const i = s[r];
762
- (!t || Ce(this, this[i], i, t, !0)) && (delete this[i], n = !0);
763
- }
764
- return n;
765
- }
766
- normalize(t) {
767
- const s = this, r = {};
768
- return l.forEach(this, (n, i) => {
769
- const o = l.findKey(r, i);
770
- if (o) {
771
- s[o] = me(n), delete s[i];
772
- return;
773
- }
774
- const a = t ? Ys(i) : String(i).trim();
775
- a !== i && delete s[i], s[a] = me(n), r[a] = !0;
776
- }), this;
777
- }
778
- concat(...t) {
779
- return this.constructor.concat(this, ...t);
780
- }
781
- toJSON(t) {
782
- const s = /* @__PURE__ */ Object.create(null);
783
- return l.forEach(this, (r, n) => {
784
- r != null && r !== !1 && (s[n] = t && l.isArray(r) ? r.join(", ") : r);
785
- }), s;
786
- }
787
- [Symbol.iterator]() {
788
- return Object.entries(this.toJSON())[Symbol.iterator]();
789
- }
790
- toString() {
791
- return Object.entries(this.toJSON()).map(([t, s]) => t + ": " + s).join(`
792
- `);
793
- }
794
- getSetCookie() {
795
- return this.get("set-cookie") || [];
796
- }
797
- get [Symbol.toStringTag]() {
798
- return "AxiosHeaders";
799
- }
800
- static from(t) {
801
- return t instanceof this ? t : new this(t);
802
- }
803
- static concat(t, ...s) {
804
- const r = new this(t);
805
- return s.forEach((n) => r.set(n)), r;
806
- }
807
- static accessor(t) {
808
- const r = (this[et] = this[et] = {
809
- accessors: {}
810
- }).accessors, n = this.prototype;
811
- function i(o) {
812
- const a = ne(o);
813
- r[a] || (er(n, o), r[a] = !0);
814
- }
815
- return l.isArray(t) ? t.forEach(i) : i(t), this;
816
- }
817
- };
818
- A.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
819
- l.reduceDescriptors(A.prototype, ({ value: e }, t) => {
820
- let s = t[0].toUpperCase() + t.slice(1);
821
- return {
822
- get: () => e,
823
- set(r) {
824
- this[s] = r;
825
- }
826
- };
827
- });
828
- l.freezeMethods(A);
829
- function Oe(e, t) {
830
- const s = this || ce, r = t || s, n = A.from(r.headers);
831
- let i = r.data;
832
- return l.forEach(e, function(a) {
833
- i = a.call(s, i, n.normalize(), t ? t.status : void 0);
834
- }), n.normalize(), i;
835
- }
836
- function Tt(e) {
837
- return !!(e && e.__CANCEL__);
838
- }
839
- function se(e, t, s) {
840
- D.call(this, e ?? "canceled", D.ERR_CANCELED, t, s), this.name = "CanceledError";
841
- }
842
- l.inherits(se, D, {
843
- __CANCEL__: !0
844
- });
845
- function Nt(e, t, s) {
846
- const r = s.config.validateStatus;
847
- !s.status || !r || r(s.status) ? e(s) : t(new D(
848
- "Request failed with status code " + s.status,
849
- [D.ERR_BAD_REQUEST, D.ERR_BAD_RESPONSE][Math.floor(s.status / 100) - 4],
850
- s.config,
851
- s.request,
852
- s
853
- ));
854
- }
855
- function tr(e) {
856
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
857
- return t && t[1] || "";
858
- }
859
- function sr(e, t) {
860
- e = e || 10;
861
- const s = new Array(e), r = new Array(e);
862
- let n = 0, i = 0, o;
863
- return t = t !== void 0 ? t : 1e3, function(f) {
864
- const d = Date.now(), u = r[i];
865
- o || (o = d), s[n] = f, r[n] = d;
866
- let h = i, w = 0;
867
- for (; h !== n; )
868
- w += s[h++], h = h % e;
869
- if (n = (n + 1) % e, n === i && (i = (i + 1) % e), d - o < t)
870
- return;
871
- const b = u && d - u;
872
- return b ? Math.round(w * 1e3 / b) : void 0;
873
- };
874
- }
875
- function rr(e, t) {
876
- let s = 0, r = 1e3 / t, n, i;
877
- const o = (d, u = Date.now()) => {
878
- s = u, n = null, i && (clearTimeout(i), i = null), e(...d);
879
- };
880
- return [(...d) => {
881
- const u = Date.now(), h = u - s;
882
- h >= r ? o(d, u) : (n = d, i || (i = setTimeout(() => {
883
- i = null, o(n);
884
- }, r - h)));
885
- }, () => n && o(n)];
886
- }
887
- const be = (e, t, s = 3) => {
888
- let r = 0;
889
- const n = sr(50, 250);
890
- return rr((i) => {
891
- const o = i.loaded, a = i.lengthComputable ? i.total : void 0, f = o - r, d = n(f), u = o <= a;
892
- r = o;
893
- const h = {
894
- loaded: o,
895
- total: a,
896
- progress: a ? o / a : void 0,
897
- bytes: f,
898
- rate: d || void 0,
899
- estimated: d && a && u ? (a - o) / d : void 0,
900
- event: i,
901
- lengthComputable: a != null,
902
- [t ? "download" : "upload"]: !0
903
- };
904
- e(h);
905
- }, s);
906
- }, tt = (e, t) => {
907
- const s = e != null;
908
- return [(r) => t[0]({
909
- lengthComputable: s,
910
- total: e,
911
- loaded: r
912
- }), t[1]];
913
- }, st = (e) => (...t) => l.asap(() => e(...t)), nr = R.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (s) => (s = new URL(s, R.origin), e.protocol === s.protocol && e.host === s.host && (t || e.port === s.port)))(
914
- new URL(R.origin),
915
- R.navigator && /(msie|trident)/i.test(R.navigator.userAgent)
916
- ) : () => !0, ir = R.hasStandardBrowserEnv ? (
917
- // Standard browser envs support document.cookie
918
- {
919
- write(e, t, s, r, n, i) {
920
- const o = [e + "=" + encodeURIComponent(t)];
921
- l.isNumber(s) && o.push("expires=" + new Date(s).toGMTString()), l.isString(r) && o.push("path=" + r), l.isString(n) && o.push("domain=" + n), i === !0 && o.push("secure"), document.cookie = o.join("; ");
922
- },
923
- read(e) {
924
- const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
925
- return t ? decodeURIComponent(t[3]) : null;
926
- },
927
- remove(e) {
928
- this.write(e, "", Date.now() - 864e5);
929
- }
930
- }
931
- ) : (
932
- // Non-standard browser env (web workers, react-native) lack needed support.
933
- {
934
- write() {
935
- },
936
- read() {
937
- return null;
938
- },
939
- remove() {
940
- }
941
- }
942
- );
943
- function or(e) {
944
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
945
- }
946
- function ar(e, t) {
947
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
948
- }
949
- function Ft(e, t, s) {
950
- let r = !or(t);
951
- return e && (r || s == !1) ? ar(e, t) : t;
952
- }
953
- const rt = (e) => e instanceof A ? { ...e } : e;
954
- function Z(e, t) {
955
- t = t || {};
956
- const s = {};
957
- function r(d, u, h, w) {
958
- return l.isPlainObject(d) && l.isPlainObject(u) ? l.merge.call({ caseless: w }, d, u) : l.isPlainObject(u) ? l.merge({}, u) : l.isArray(u) ? u.slice() : u;
959
- }
960
- function n(d, u, h, w) {
961
- if (l.isUndefined(u)) {
962
- if (!l.isUndefined(d))
963
- return r(void 0, d, h, w);
964
- } else return r(d, u, h, w);
965
- }
966
- function i(d, u) {
967
- if (!l.isUndefined(u))
968
- return r(void 0, u);
969
- }
970
- function o(d, u) {
971
- if (l.isUndefined(u)) {
972
- if (!l.isUndefined(d))
973
- return r(void 0, d);
974
- } else return r(void 0, u);
975
- }
976
- function a(d, u, h) {
977
- if (h in t)
978
- return r(d, u);
979
- if (h in e)
980
- return r(void 0, d);
981
- }
982
- const f = {
983
- url: i,
984
- method: i,
985
- data: i,
986
- baseURL: o,
987
- transformRequest: o,
988
- transformResponse: o,
989
- paramsSerializer: o,
990
- timeout: o,
991
- timeoutMessage: o,
992
- withCredentials: o,
993
- withXSRFToken: o,
994
- adapter: o,
995
- responseType: o,
996
- xsrfCookieName: o,
997
- xsrfHeaderName: o,
998
- onUploadProgress: o,
999
- onDownloadProgress: o,
1000
- decompress: o,
1001
- maxContentLength: o,
1002
- maxBodyLength: o,
1003
- beforeRedirect: o,
1004
- transport: o,
1005
- httpAgent: o,
1006
- httpsAgent: o,
1007
- cancelToken: o,
1008
- socketPath: o,
1009
- responseEncoding: o,
1010
- validateStatus: a,
1011
- headers: (d, u, h) => n(rt(d), rt(u), h, !0)
1012
- };
1013
- return l.forEach(Object.keys({ ...e, ...t }), function(u) {
1014
- const h = f[u] || n, w = h(e[u], t[u], u);
1015
- l.isUndefined(w) && h !== a || (s[u] = w);
1016
- }), s;
1017
- }
1018
- const At = (e) => {
1019
- const t = Z({}, e);
1020
- let { data: s, withXSRFToken: r, xsrfHeaderName: n, xsrfCookieName: i, headers: o, auth: a } = t;
1021
- if (t.headers = o = A.from(o), t.url = Ot(Ft(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && o.set(
1022
- "Authorization",
1023
- "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1024
- ), l.isFormData(s)) {
1025
- if (R.hasStandardBrowserEnv || R.hasStandardBrowserWebWorkerEnv)
1026
- o.setContentType(void 0);
1027
- else if (l.isFunction(s.getHeaders)) {
1028
- const f = s.getHeaders(), d = ["content-type", "content-length"];
1029
- Object.entries(f).forEach(([u, h]) => {
1030
- d.includes(u.toLowerCase()) && o.set(u, h);
1031
- });
1032
- }
1033
- }
1034
- if (R.hasStandardBrowserEnv && (r && l.isFunction(r) && (r = r(t)), r || r !== !1 && nr(t.url))) {
1035
- const f = n && i && ir.read(i);
1036
- f && o.set(n, f);
1037
- }
1038
- return t;
1039
- }, lr = typeof XMLHttpRequest < "u", cr = lr && function(e) {
1040
- return new Promise(function(s, r) {
1041
- const n = At(e);
1042
- let i = n.data;
1043
- const o = A.from(n.headers).normalize();
1044
- let { responseType: a, onUploadProgress: f, onDownloadProgress: d } = n, u, h, w, b, c;
1045
- function p() {
1046
- b && b(), c && c(), n.cancelToken && n.cancelToken.unsubscribe(u), n.signal && n.signal.removeEventListener("abort", u);
1047
- }
1048
- let m = new XMLHttpRequest();
1049
- m.open(n.method.toUpperCase(), n.url, !0), m.timeout = n.timeout;
1050
- function k() {
1051
- if (!m)
1052
- return;
1053
- const y = A.from(
1054
- "getAllResponseHeaders" in m && m.getAllResponseHeaders()
1055
- ), $ = {
1056
- data: !a || a === "text" || a === "json" ? m.responseText : m.response,
1057
- status: m.status,
1058
- statusText: m.statusText,
1059
- headers: y,
1060
- config: e,
1061
- request: m
1062
- };
1063
- Nt(function(L) {
1064
- s(L), p();
1065
- }, function(L) {
1066
- r(L), p();
1067
- }, $), m = null;
1068
- }
1069
- "onloadend" in m ? m.onloadend = k : m.onreadystatechange = function() {
1070
- !m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(k);
1071
- }, m.onabort = function() {
1072
- m && (r(new D("Request aborted", D.ECONNABORTED, e, m)), m = null);
1073
- }, m.onerror = function(C) {
1074
- const $ = C && C.message ? C.message : "Network Error", J = new D($, D.ERR_NETWORK, e, m);
1075
- J.event = C || null, r(J), m = null;
1076
- }, m.ontimeout = function() {
1077
- let C = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded";
1078
- const $ = n.transitional || Rt;
1079
- n.timeoutErrorMessage && (C = n.timeoutErrorMessage), r(new D(
1080
- C,
1081
- $.clarifyTimeoutError ? D.ETIMEDOUT : D.ECONNABORTED,
1082
- e,
1083
- m
1084
- )), m = null;
1085
- }, i === void 0 && o.setContentType(null), "setRequestHeader" in m && l.forEach(o.toJSON(), function(C, $) {
1086
- m.setRequestHeader($, C);
1087
- }), l.isUndefined(n.withCredentials) || (m.withCredentials = !!n.withCredentials), a && a !== "json" && (m.responseType = n.responseType), d && ([w, c] = be(d, !0), m.addEventListener("progress", w)), f && m.upload && ([h, b] = be(f), m.upload.addEventListener("progress", h), m.upload.addEventListener("loadend", b)), (n.cancelToken || n.signal) && (u = (y) => {
1088
- m && (r(!y || y.type ? new se(null, e, m) : y), m.abort(), m = null);
1089
- }, n.cancelToken && n.cancelToken.subscribe(u), n.signal && (n.signal.aborted ? u() : n.signal.addEventListener("abort", u)));
1090
- const S = tr(n.url);
1091
- if (S && R.protocols.indexOf(S) === -1) {
1092
- r(new D("Unsupported protocol " + S + ":", D.ERR_BAD_REQUEST, e));
1093
- return;
1094
- }
1095
- m.send(i || null);
1096
- });
1097
- }, ur = (e, t) => {
1098
- const { length: s } = e = e ? e.filter(Boolean) : [];
1099
- if (t || s) {
1100
- let r = new AbortController(), n;
1101
- const i = function(d) {
1102
- if (!n) {
1103
- n = !0, a();
1104
- const u = d instanceof Error ? d : this.reason;
1105
- r.abort(u instanceof D ? u : new se(u instanceof Error ? u.message : u));
1106
- }
1107
- };
1108
- let o = t && setTimeout(() => {
1109
- o = null, i(new D(`timeout ${t} of ms exceeded`, D.ETIMEDOUT));
1110
- }, t);
1111
- const a = () => {
1112
- e && (o && clearTimeout(o), o = null, e.forEach((d) => {
1113
- d.unsubscribe ? d.unsubscribe(i) : d.removeEventListener("abort", i);
1114
- }), e = null);
1115
- };
1116
- e.forEach((d) => d.addEventListener("abort", i));
1117
- const { signal: f } = r;
1118
- return f.unsubscribe = () => l.asap(a), f;
1119
- }
1120
- }, dr = function* (e, t) {
1121
- let s = e.byteLength;
1122
- if (s < t) {
1123
- yield e;
1124
- return;
1125
- }
1126
- let r = 0, n;
1127
- for (; r < s; )
1128
- n = r + t, yield e.slice(r, n), r = n;
1129
- }, fr = async function* (e, t) {
1130
- for await (const s of hr(e))
1131
- yield* dr(s, t);
1132
- }, hr = async function* (e) {
1133
- if (e[Symbol.asyncIterator]) {
1134
- yield* e;
1135
- return;
1136
- }
1137
- const t = e.getReader();
1138
- try {
1139
- for (; ; ) {
1140
- const { done: s, value: r } = await t.read();
1141
- if (s)
1142
- break;
1143
- yield r;
1144
- }
1145
- } finally {
1146
- await t.cancel();
1147
- }
1148
- }, nt = (e, t, s, r) => {
1149
- const n = fr(e, t);
1150
- let i = 0, o, a = (f) => {
1151
- o || (o = !0, r && r(f));
1152
- };
1153
- return new ReadableStream({
1154
- async pull(f) {
1155
- try {
1156
- const { done: d, value: u } = await n.next();
1157
- if (d) {
1158
- a(), f.close();
1159
- return;
1160
- }
1161
- let h = u.byteLength;
1162
- if (s) {
1163
- let w = i += h;
1164
- s(w);
1165
- }
1166
- f.enqueue(new Uint8Array(u));
1167
- } catch (d) {
1168
- throw a(d), d;
1169
- }
1170
- },
1171
- cancel(f) {
1172
- return a(f), n.return();
1173
- }
1174
- }, {
1175
- highWaterMark: 2
1176
- });
1177
- }, it = 64 * 1024, { isFunction: he } = l, pr = (({ Request: e, Response: t }) => ({
1178
- Request: e,
1179
- Response: t
1180
- }))(l.global), {
1181
- ReadableStream: ot,
1182
- TextEncoder: at
1183
- } = l.global, lt = (e, ...t) => {
1184
- try {
1185
- return !!e(...t);
1186
- } catch {
1187
- return !1;
1188
- }
1189
- }, mr = (e) => {
1190
- e = l.merge.call({
1191
- skipUndefined: !0
1192
- }, pr, e);
1193
- const { fetch: t, Request: s, Response: r } = e, n = t ? he(t) : typeof fetch == "function", i = he(s), o = he(r);
1194
- if (!n)
1195
- return !1;
1196
- const a = n && he(ot), f = n && (typeof at == "function" ? /* @__PURE__ */ ((c) => (p) => c.encode(p))(new at()) : async (c) => new Uint8Array(await new s(c).arrayBuffer())), d = i && a && lt(() => {
1197
- let c = !1;
1198
- const p = new s(R.origin, {
1199
- body: new ot(),
1200
- method: "POST",
1201
- get duplex() {
1202
- return c = !0, "half";
1203
- }
1204
- }).headers.has("Content-Type");
1205
- return c && !p;
1206
- }), u = o && a && lt(() => l.isReadableStream(new r("").body)), h = {
1207
- stream: u && ((c) => c.body)
1208
- };
1209
- n && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((c) => {
1210
- !h[c] && (h[c] = (p, m) => {
1211
- let k = p && p[c];
1212
- if (k)
1213
- return k.call(p);
1214
- throw new D(`Response type '${c}' is not supported`, D.ERR_NOT_SUPPORT, m);
1215
- });
1216
- });
1217
- const w = async (c) => {
1218
- if (c == null)
1219
- return 0;
1220
- if (l.isBlob(c))
1221
- return c.size;
1222
- if (l.isSpecCompliantForm(c))
1223
- return (await new s(R.origin, {
1224
- method: "POST",
1225
- body: c
1226
- }).arrayBuffer()).byteLength;
1227
- if (l.isArrayBufferView(c) || l.isArrayBuffer(c))
1228
- return c.byteLength;
1229
- if (l.isURLSearchParams(c) && (c = c + ""), l.isString(c))
1230
- return (await f(c)).byteLength;
1231
- }, b = async (c, p) => {
1232
- const m = l.toFiniteNumber(c.getContentLength());
1233
- return m ?? w(p);
1234
- };
1235
- return async (c) => {
1236
- let {
1237
- url: p,
1238
- method: m,
1239
- data: k,
1240
- signal: S,
1241
- cancelToken: y,
1242
- timeout: C,
1243
- onDownloadProgress: $,
1244
- onUploadProgress: J,
1245
- responseType: L,
1246
- headers: ke,
1247
- withCredentials: ue = "same-origin",
1248
- fetchOptions: ze
1249
- } = At(c), Me = t || fetch;
1250
- L = L ? (L + "").toLowerCase() : "text";
1251
- let de = ur([S, y && y.toAbortSignal()], C), re = null;
1252
- const K = de && de.unsubscribe && (() => {
1253
- de.unsubscribe();
1254
- });
1255
- let He;
1256
- try {
1257
- if (J && d && m !== "get" && m !== "head" && (He = await b(ke, k)) !== 0) {
1258
- let q = new s(p, {
1259
- method: "POST",
1260
- body: k,
1261
- duplex: "half"
1262
- }), Y;
1263
- if (l.isFormData(k) && (Y = q.headers.get("content-type")) && ke.setContentType(Y), q.body) {
1264
- const [ve, fe] = tt(
1265
- He,
1266
- be(st(J))
1267
- );
1268
- k = nt(q.body, it, ve, fe);
1269
- }
1270
- }
1271
- l.isString(ue) || (ue = ue ? "include" : "omit");
1272
- const j = i && "credentials" in s.prototype, qe = {
1273
- ...ze,
1274
- signal: de,
1275
- method: m.toUpperCase(),
1276
- headers: ke.normalize().toJSON(),
1277
- body: k,
1278
- duplex: "half",
1279
- credentials: j ? ue : void 0
1280
- };
1281
- re = i && new s(p, qe);
1282
- let H = await (i ? Me(re, ze) : Me(p, qe));
1283
- const We = u && (L === "stream" || L === "response");
1284
- if (u && ($ || We && K)) {
1285
- const q = {};
1286
- ["status", "statusText", "headers"].forEach((Je) => {
1287
- q[Je] = H[Je];
1288
- });
1289
- const Y = l.toFiniteNumber(H.headers.get("content-length")), [ve, fe] = $ && tt(
1290
- Y,
1291
- be(st($), !0)
1292
- ) || [];
1293
- H = new r(
1294
- nt(H.body, it, ve, () => {
1295
- fe && fe(), K && K();
1296
- }),
1297
- q
1298
- );
1299
- }
1300
- L = L || "text";
1301
- let Vt = await h[l.findKey(h, L) || "text"](H, c);
1302
- return !We && K && K(), await new Promise((q, Y) => {
1303
- Nt(q, Y, {
1304
- data: Vt,
1305
- headers: A.from(H.headers),
1306
- status: H.status,
1307
- statusText: H.statusText,
1308
- config: c,
1309
- request: re
1310
- });
1311
- });
1312
- } catch (j) {
1313
- throw K && K(), j && j.name === "TypeError" && /Load failed|fetch/i.test(j.message) ? Object.assign(
1314
- new D("Network Error", D.ERR_NETWORK, c, re),
1315
- {
1316
- cause: j.cause || j
1317
- }
1318
- ) : D.from(j, j && j.code, c, re);
1319
- }
1320
- };
1321
- }, gr = /* @__PURE__ */ new Map(), Pt = (e) => {
1322
- let t = e ? e.env : {};
1323
- const { fetch: s, Request: r, Response: n } = t, i = [
1324
- r,
1325
- n,
1326
- s
1327
- ];
1328
- let o = i.length, a = o, f, d, u = gr;
1329
- for (; a--; )
1330
- f = i[a], d = u.get(f), d === void 0 && u.set(f, d = a ? /* @__PURE__ */ new Map() : mr(t)), u = d;
1331
- return d;
1332
- };
1333
- Pt();
1334
- const Ae = {
1335
- http: Fs,
1336
- xhr: cr,
1337
- fetch: {
1338
- get: Pt
1339
- }
1340
- };
1341
- l.forEach(Ae, (e, t) => {
1342
- if (e) {
1343
- try {
1344
- Object.defineProperty(e, "name", { value: t });
1345
- } catch {
1346
- }
1347
- Object.defineProperty(e, "adapterName", { value: t });
1348
- }
1349
- });
1350
- const ct = (e) => `- ${e}`, br = (e) => l.isFunction(e) || e === null || e === !1, Lt = {
1351
- getAdapter: (e, t) => {
1352
- e = l.isArray(e) ? e : [e];
1353
- const { length: s } = e;
1354
- let r, n;
1355
- const i = {};
1356
- for (let o = 0; o < s; o++) {
1357
- r = e[o];
1358
- let a;
1359
- if (n = r, !br(r) && (n = Ae[(a = String(r)).toLowerCase()], n === void 0))
1360
- throw new D(`Unknown adapter '${a}'`);
1361
- if (n && (l.isFunction(n) || (n = n.get(t))))
1362
- break;
1363
- i[a || "#" + o] = n;
1364
- }
1365
- if (!n) {
1366
- const o = Object.entries(i).map(
1367
- ([f, d]) => `adapter ${f} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
1368
- );
1369
- let a = s ? o.length > 1 ? `since :
1370
- ` + o.map(ct).join(`
1371
- `) : " " + ct(o[0]) : "as no adapter specified";
1372
- throw new D(
1373
- "There is no suitable adapter to dispatch the request " + a,
1374
- "ERR_NOT_SUPPORT"
1375
- );
1376
- }
1377
- return n;
1378
- },
1379
- adapters: Ae
1380
- };
1381
- function Re(e) {
1382
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1383
- throw new se(null, e);
1384
- }
1385
- function ut(e) {
1386
- return Re(e), e.headers = A.from(e.headers), e.data = Oe.call(
1387
- e,
1388
- e.transformRequest
1389
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Lt.getAdapter(e.adapter || ce.adapter, e)(e).then(function(r) {
1390
- return Re(e), r.data = Oe.call(
1391
- e,
1392
- e.transformResponse,
1393
- r
1394
- ), r.headers = A.from(r.headers), r;
1395
- }, function(r) {
1396
- return Tt(r) || (Re(e), r && r.response && (r.response.data = Oe.call(
1397
- e,
1398
- e.transformResponse,
1399
- r.response
1400
- ), r.response.headers = A.from(r.response.headers))), Promise.reject(r);
1401
- });
1402
- }
1403
- const Ut = "1.12.2", Se = {};
1404
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1405
- Se[e] = function(r) {
1406
- return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1407
- };
1408
- });
1409
- const dt = {};
1410
- Se.transitional = function(t, s, r) {
1411
- function n(i, o) {
1412
- return "[Axios v" + Ut + "] Transitional option '" + i + "'" + o + (r ? ". " + r : "");
1413
- }
1414
- return (i, o, a) => {
1415
- if (t === !1)
1416
- throw new D(
1417
- n(o, " has been removed" + (s ? " in " + s : "")),
1418
- D.ERR_DEPRECATED
1419
- );
1420
- return s && !dt[o] && (dt[o] = !0, console.warn(
1421
- n(
1422
- o,
1423
- " has been deprecated since v" + s + " and will be removed in the near future"
1424
- )
1425
- )), t ? t(i, o, a) : !0;
1426
- };
1427
- };
1428
- Se.spelling = function(t) {
1429
- return (s, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1430
- };
1431
- function wr(e, t, s) {
1432
- if (typeof e != "object")
1433
- throw new D("options must be an object", D.ERR_BAD_OPTION_VALUE);
1434
- const r = Object.keys(e);
1435
- let n = r.length;
1436
- for (; n-- > 0; ) {
1437
- const i = r[n], o = t[i];
1438
- if (o) {
1439
- const a = e[i], f = a === void 0 || o(a, i, e);
1440
- if (f !== !0)
1441
- throw new D("option " + i + " must be " + f, D.ERR_BAD_OPTION_VALUE);
1442
- continue;
1443
- }
1444
- if (s !== !0)
1445
- throw new D("Unknown option " + i, D.ERR_BAD_OPTION);
1446
- }
1447
- }
1448
- const ge = {
1449
- assertOptions: wr,
1450
- validators: Se
1451
- }, V = ge.validators;
1452
- let G = class {
1453
- constructor(t) {
1454
- this.defaults = t || {}, this.interceptors = {
1455
- request: new Ye(),
1456
- response: new Ye()
1457
- };
1458
- }
1459
- /**
1460
- * Dispatch a request
1461
- *
1462
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1463
- * @param {?Object} config
1464
- *
1465
- * @returns {Promise} The Promise to be fulfilled
1466
- */
1467
- async request(t, s) {
1468
- try {
1469
- return await this._request(t, s);
1470
- } catch (r) {
1471
- if (r instanceof Error) {
1472
- let n = {};
1473
- Error.captureStackTrace ? Error.captureStackTrace(n) : n = new Error();
1474
- const i = n.stack ? n.stack.replace(/^.+\n/, "") : "";
1475
- try {
1476
- r.stack ? i && !String(r.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (r.stack += `
1477
- ` + i) : r.stack = i;
1478
- } catch {
1479
- }
1480
- }
1481
- throw r;
1482
- }
1483
- }
1484
- _request(t, s) {
1485
- typeof t == "string" ? (s = s || {}, s.url = t) : s = t || {}, s = Z(this.defaults, s);
1486
- const { transitional: r, paramsSerializer: n, headers: i } = s;
1487
- r !== void 0 && ge.assertOptions(r, {
1488
- silentJSONParsing: V.transitional(V.boolean),
1489
- forcedJSONParsing: V.transitional(V.boolean),
1490
- clarifyTimeoutError: V.transitional(V.boolean)
1491
- }, !1), n != null && (l.isFunction(n) ? s.paramsSerializer = {
1492
- serialize: n
1493
- } : ge.assertOptions(n, {
1494
- encode: V.function,
1495
- serialize: V.function
1496
- }, !0)), s.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? s.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : s.allowAbsoluteUrls = !0), ge.assertOptions(s, {
1497
- baseUrl: V.spelling("baseURL"),
1498
- withXsrfToken: V.spelling("withXSRFToken")
1499
- }, !0), s.method = (s.method || this.defaults.method || "get").toLowerCase();
1500
- let o = i && l.merge(
1501
- i.common,
1502
- i[s.method]
1503
- );
1504
- i && l.forEach(
1505
- ["delete", "get", "head", "post", "put", "patch", "common"],
1506
- (c) => {
1507
- delete i[c];
1508
- }
1509
- ), s.headers = A.concat(o, i);
1510
- const a = [];
1511
- let f = !0;
1512
- this.interceptors.request.forEach(function(p) {
1513
- typeof p.runWhen == "function" && p.runWhen(s) === !1 || (f = f && p.synchronous, a.unshift(p.fulfilled, p.rejected));
1514
- });
1515
- const d = [];
1516
- this.interceptors.response.forEach(function(p) {
1517
- d.push(p.fulfilled, p.rejected);
1518
- });
1519
- let u, h = 0, w;
1520
- if (!f) {
1521
- const c = [ut.bind(this), void 0];
1522
- for (c.unshift(...a), c.push(...d), w = c.length, u = Promise.resolve(s); h < w; )
1523
- u = u.then(c[h++], c[h++]);
1524
- return u;
1525
- }
1526
- w = a.length;
1527
- let b = s;
1528
- for (; h < w; ) {
1529
- const c = a[h++], p = a[h++];
1530
- try {
1531
- b = c(b);
1532
- } catch (m) {
1533
- p.call(this, m);
1534
- break;
1535
- }
1536
- }
1537
- try {
1538
- u = ut.call(this, b);
1539
- } catch (c) {
1540
- return Promise.reject(c);
1541
- }
1542
- for (h = 0, w = d.length; h < w; )
1543
- u = u.then(d[h++], d[h++]);
1544
- return u;
1545
- }
1546
- getUri(t) {
1547
- t = Z(this.defaults, t);
1548
- const s = Ft(t.baseURL, t.url, t.allowAbsoluteUrls);
1549
- return Ot(s, t.params, t.paramsSerializer);
1550
- }
1551
- };
1552
- l.forEach(["delete", "get", "head", "options"], function(t) {
1553
- G.prototype[t] = function(s, r) {
1554
- return this.request(Z(r || {}, {
1555
- method: t,
1556
- url: s,
1557
- data: (r || {}).data
1558
- }));
1559
- };
1560
- });
1561
- l.forEach(["post", "put", "patch"], function(t) {
1562
- function s(r) {
1563
- return function(i, o, a) {
1564
- return this.request(Z(a || {}, {
1565
- method: t,
1566
- headers: r ? {
1567
- "Content-Type": "multipart/form-data"
1568
- } : {},
1569
- url: i,
1570
- data: o
1571
- }));
1572
- };
1573
- }
1574
- G.prototype[t] = s(), G.prototype[t + "Form"] = s(!0);
1575
- });
1576
- let yr = class Bt {
1577
- constructor(t) {
1578
- if (typeof t != "function")
1579
- throw new TypeError("executor must be a function.");
1580
- let s;
1581
- this.promise = new Promise(function(i) {
1582
- s = i;
1583
- });
1584
- const r = this;
1585
- this.promise.then((n) => {
1586
- if (!r._listeners) return;
1587
- let i = r._listeners.length;
1588
- for (; i-- > 0; )
1589
- r._listeners[i](n);
1590
- r._listeners = null;
1591
- }), this.promise.then = (n) => {
1592
- let i;
1593
- const o = new Promise((a) => {
1594
- r.subscribe(a), i = a;
1595
- }).then(n);
1596
- return o.cancel = function() {
1597
- r.unsubscribe(i);
1598
- }, o;
1599
- }, t(function(i, o, a) {
1600
- r.reason || (r.reason = new se(i, o, a), s(r.reason));
1601
- });
1602
- }
1603
- /**
1604
- * Throws a `CanceledError` if cancellation has been requested.
1605
- */
1606
- throwIfRequested() {
1607
- if (this.reason)
1608
- throw this.reason;
1609
- }
1610
- /**
1611
- * Subscribe to the cancel signal
1612
- */
1613
- subscribe(t) {
1614
- if (this.reason) {
1615
- t(this.reason);
1616
- return;
1617
- }
1618
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
1619
- }
1620
- /**
1621
- * Unsubscribe from the cancel signal
1622
- */
1623
- unsubscribe(t) {
1624
- if (!this._listeners)
1625
- return;
1626
- const s = this._listeners.indexOf(t);
1627
- s !== -1 && this._listeners.splice(s, 1);
1628
- }
1629
- toAbortSignal() {
1630
- const t = new AbortController(), s = (r) => {
1631
- t.abort(r);
1632
- };
1633
- return this.subscribe(s), t.signal.unsubscribe = () => this.unsubscribe(s), t.signal;
1634
- }
1635
- /**
1636
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1637
- * cancels the `CancelToken`.
1638
- */
1639
- static source() {
1640
- let t;
1641
- return {
1642
- token: new Bt(function(n) {
1643
- t = n;
1644
- }),
1645
- cancel: t
1646
- };
1647
- }
1648
- };
1649
- function xr(e) {
1650
- return function(s) {
1651
- return e.apply(null, s);
1652
- };
1653
- }
1654
- function _r(e) {
1655
- return l.isObject(e) && e.isAxiosError === !0;
1656
- }
1657
- const Pe = {
1658
- Continue: 100,
1659
- SwitchingProtocols: 101,
1660
- Processing: 102,
1661
- EarlyHints: 103,
1662
- Ok: 200,
1663
- Created: 201,
1664
- Accepted: 202,
1665
- NonAuthoritativeInformation: 203,
1666
- NoContent: 204,
1667
- ResetContent: 205,
1668
- PartialContent: 206,
1669
- MultiStatus: 207,
1670
- AlreadyReported: 208,
1671
- ImUsed: 226,
1672
- MultipleChoices: 300,
1673
- MovedPermanently: 301,
1674
- Found: 302,
1675
- SeeOther: 303,
1676
- NotModified: 304,
1677
- UseProxy: 305,
1678
- Unused: 306,
1679
- TemporaryRedirect: 307,
1680
- PermanentRedirect: 308,
1681
- BadRequest: 400,
1682
- Unauthorized: 401,
1683
- PaymentRequired: 402,
1684
- Forbidden: 403,
1685
- NotFound: 404,
1686
- MethodNotAllowed: 405,
1687
- NotAcceptable: 406,
1688
- ProxyAuthenticationRequired: 407,
1689
- RequestTimeout: 408,
1690
- Conflict: 409,
1691
- Gone: 410,
1692
- LengthRequired: 411,
1693
- PreconditionFailed: 412,
1694
- PayloadTooLarge: 413,
1695
- UriTooLong: 414,
1696
- UnsupportedMediaType: 415,
1697
- RangeNotSatisfiable: 416,
1698
- ExpectationFailed: 417,
1699
- ImATeapot: 418,
1700
- MisdirectedRequest: 421,
1701
- UnprocessableEntity: 422,
1702
- Locked: 423,
1703
- FailedDependency: 424,
1704
- TooEarly: 425,
1705
- UpgradeRequired: 426,
1706
- PreconditionRequired: 428,
1707
- TooManyRequests: 429,
1708
- RequestHeaderFieldsTooLarge: 431,
1709
- UnavailableForLegalReasons: 451,
1710
- InternalServerError: 500,
1711
- NotImplemented: 501,
1712
- BadGateway: 502,
1713
- ServiceUnavailable: 503,
1714
- GatewayTimeout: 504,
1715
- HttpVersionNotSupported: 505,
1716
- VariantAlsoNegotiates: 506,
1717
- InsufficientStorage: 507,
1718
- LoopDetected: 508,
1719
- NotExtended: 510,
1720
- NetworkAuthenticationRequired: 511
1721
- };
1722
- Object.entries(Pe).forEach(([e, t]) => {
1723
- Pe[t] = e;
1724
- });
1725
- function jt(e) {
1726
- const t = new G(e), s = gt(G.prototype.request, t);
1727
- return l.extend(s, G.prototype, t, { allOwnKeys: !0 }), l.extend(s, t, null, { allOwnKeys: !0 }), s.create = function(n) {
1728
- return jt(Z(e, n));
1729
- }, s;
1730
- }
1731
- const v = jt(ce);
1732
- v.Axios = G;
1733
- v.CanceledError = se;
1734
- v.CancelToken = yr;
1735
- v.isCancel = Tt;
1736
- v.VERSION = Ut;
1737
- v.toFormData = De;
1738
- v.AxiosError = D;
1739
- v.Cancel = v.CanceledError;
1740
- v.all = function(t) {
1741
- return Promise.all(t);
1742
- };
1743
- v.spread = xr;
1744
- v.isAxiosError = _r;
1745
- v.mergeConfig = Z;
1746
- v.AxiosHeaders = A;
1747
- v.formToJSON = (e) => $t(l.isHTMLForm(e) ? new FormData(e) : e);
1748
- v.getAdapter = Lt.getAdapter;
1749
- v.HttpStatusCode = Pe;
1750
- v.default = v;
1751
- const {
1752
- Axios: eo,
1753
- AxiosError: to,
1754
- CanceledError: so,
1755
- isCancel: ro,
1756
- CancelToken: no,
1757
- VERSION: io,
1758
- all: oo,
1759
- Cancel: ao,
1760
- isAxiosError: lo,
1761
- spread: co,
1762
- toFormData: uo,
1763
- AxiosHeaders: fo,
1764
- HttpStatusCode: ho,
1765
- formToJSON: po,
1766
- getAdapter: mo,
1767
- mergeConfig: go
1768
- } = v;
1769
- class Dr {
1770
- static getTooltipOptions(t = !0) {
1771
- return {
1772
- show: t,
1773
- axisPointer: {
1774
- type: "cross",
1775
- label: {
1776
- backgroundColor: "#6a7985"
1777
- }
1778
- }
1779
- };
1780
- }
1781
- }
1782
- class we {
1783
- static getLabelOptions(t = {}) {
1784
- return {
1785
- show: (t == null ? void 0 : t.show_label) || (t == null ? void 0 : t.show) || !1,
1786
- fontSize: "10",
1787
- position: (t == null ? void 0 : t.position) || "inside",
1788
- formatter: (t == null ? void 0 : t.formatter) || "{d}%",
1789
- ...t
1790
- };
1791
- }
1792
- static getLegendOpions(t = {}) {
1793
- return {
1794
- ...t,
1795
- position: (t == null ? void 0 : t.position) || "bottom"
1796
- };
1797
- }
1798
- }
1799
- const Sr = {
1800
- show_label: !1,
1801
- show_legend: !1,
1802
- label: null,
1803
- legend: { position: null },
1804
- colors: null,
1805
- color: null,
1806
- title: null
1807
- };
1808
- function kr() {
1809
- const e = "0123456789ABCDEF";
1810
- let t = "#";
1811
- for (let s = 0; s < 6; s += 1)
1812
- t += e[Math.floor(Math.random() * 16)];
1813
- return t;
1814
- }
1815
- function ie(e = Sr) {
1816
- var s;
1817
- const t = {
1818
- label: {
1819
- show: e == null ? void 0 : e.show_label,
1820
- formatter: (e == null ? void 0 : e.formatter) || ((r) => z(r)),
1821
- ...(e == null ? void 0 : e.label) || {}
1822
- },
1823
- legend: {
1824
- ...(e == null ? void 0 : e.legend) || {},
1825
- [((s = e == null ? void 0 : e.legend) == null ? void 0 : s.position) || "bottom"]: "0",
1826
- show: (e == null ? void 0 : e.show_legend) || !1
1827
- },
1828
- barWidth: "70%",
1829
- grid: {
1830
- borderColor: "#e5e7eb"
1831
- },
1832
- title: { ...(e == null ? void 0 : e.title) || {} }
1833
- };
1834
- return (e != null && e.colors || e != null && e.color) && (t.color = (e == null ? void 0 : e.colors) || (e == null ? void 0 : e.color) || null), t;
1835
- }
1836
- function ft(e) {
1837
- return {
1838
- color: "#9ca3af",
1839
- fontSize: 10,
1840
- fontFamily: "Inter, ui-sans-serif, system-ui",
1841
- fontWeight: 400,
1842
- label: e == null ? void 0 : e.label,
1843
- show: !0,
1844
- formatter: (e == null ? void 0 : e.formatter) || ((s) => z(s)),
1845
- margin: (e == null ? void 0 : e.margin) || 7,
1846
- interval: (e == null ? void 0 : e.interval) || "auto",
1847
- rotate: (e == null ? void 0 : e.rotate) || 0
1848
- };
1849
- }
1850
- const ht = [
1851
- "#d3c7e6",
1852
- "#bedae3",
1853
- "#f8e9cb",
1854
- "#ff8c8c",
1855
- "#c5d8be",
1856
- "#ffc6c6",
1857
- "#ffc39a",
1858
- "#fff7c5",
1859
- "#d8ffc0",
1860
- "#d4f7ff"
1861
- ], W = {
1862
- props: [
1863
- "source",
1864
- "style",
1865
- "widget",
1866
- "dashboard",
1867
- "title",
1868
- "currentWidget",
1869
- "widgetData",
1870
- "prefix"
1871
- ],
1872
- data() {
1873
- return {
1874
- sourceData: null,
1875
- styleData: null,
1876
- widgetName: "",
1877
- dimensions: [],
1878
- dashboardName: "",
1879
- titleCharts: "",
1880
- widgetInstance: null
1881
- };
1882
- },
1883
- mounted() {
1884
- window.addEventListener("resize", this.handleResize), window.addEventListener(`update-data-${this.widget}`, this.checkCustomEvent), window.addEventListener(`update-style-${this.widget}`, this.checkCustomStyleEvent);
1885
- },
1886
- unmounted() {
1887
- window.removeEventListener(`update-data-${this.widget}`, this.checkCustomEvent), window.removeEventListener(`update-style-${this.widget}`, this.checkCustomStyleEvent);
1888
- },
1889
- watch: {
1890
- sourceData: {
1891
- async handler() {
1892
- setTimeout(() => {
1893
- this == null || this.onChangedData();
1894
- }, 0);
1895
- }
1896
- }
1897
- },
1898
- methods: {
1899
- checkCustomStyleEvent(e) {
1900
- this.changeOptionsByName(e.chartId, e.options);
1901
- },
1902
- checkCustomEvent({ filterUrl: e }) {
1903
- this.getDataFromURL(e);
1904
- },
1905
- handleResize() {
1906
- this.widgetInstance && this.widgetInstance.resize();
1907
- },
1908
- async getDataFromURL(e) {
1909
- var t, s, r, n;
1910
- try {
1911
- const i = await v.get(e);
1912
- this.sourceData = ((t = i.data) == null ? void 0 : t.source) || [], this.$emit("update:widgetData", i.data), this.dimensions = Object.keys(((s = this.sourceData) == null ? void 0 : s[0]) || {}), this.titleCharts = this.style ? this.style : ((r = i.data) == null ? void 0 : r.title) || "", this.styleData = ((n = i.data) == null ? void 0 : n.style) || {};
1913
- } catch (i) {
1914
- const o = { message: "Дані не знайдено", title: "Помилка!", type: "error", status: 400, id: this.widgetName };
1915
- (i == null ? void 0 : i.status) == "404" && (o.status = 404, o.message = "Дані не знайдено"), (i == null ? void 0 : i.status) == "400" && (o.message = "Перевірте налаштування або зверніться до адміністратора"), (i == null ? void 0 : i.status) == "500" && (o.message = "Сталася помилка сервера"), this.$emit("update:widgetData", o);
1916
- }
1917
- },
1918
- getValues() {
1919
- return this.sourceData.map((e) => {
1920
- var t;
1921
- return parseFloat(e[(t = this.columns) == null ? void 0 : t[1]]);
1922
- });
1923
- },
1924
- formatDate(e) {
1925
- const t = new Date(e);
1926
- if (isNaN(t)) return e;
1927
- const s = String(t.getDate()).padStart(2, "0"), n = [
1928
- "січня",
1929
- "лютого",
1930
- "березня",
1931
- "квітня",
1932
- "травня",
1933
- "червня",
1934
- "липня",
1935
- "серпня",
1936
- "вересня",
1937
- "жовтня",
1938
- "листопада",
1939
- "грудня"
1940
- ][t.getMonth()], i = t.getFullYear();
1941
- return `${s} ${n} ${i}`;
1942
- },
1943
- async getData() {
1944
- var e;
1945
- try {
1946
- if (this.source)
1947
- this.sourceData = [...this.source], this.styleData = this.style, this.titleCharts = this.title, this.dimensions = Object.keys(((e = this.sourceData) == null ? void 0 : e[0]) || {});
1948
- else {
1949
- this.widgetName = this.widget, this.dashboardName = this.dashboard;
1950
- const t = this.dashboardName ? `${this.prefix || ""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}` : `${this.prefix || ""}/bi-data?&widget=${this.widgetName}`;
1951
- await this.getDataFromURL(t);
1952
- }
1953
- } catch (t) {
1954
- console.error(t);
1955
- }
1956
- },
1957
- async initChart(e, t, s) {
1958
- var r, n, i, o, a, f, d;
1959
- this.widgetInstance && this.widgetInstance.clear();
1960
- try {
1961
- const u = this.$refs.chart, h = echarts == null ? void 0 : echarts.init(u), w = {
1962
- tooltip: {
1963
- trigger: "axis",
1964
- axisPointer: { type: "shadow" },
1965
- backgroundColor: "transparent",
1966
- shadowColor: "transparent",
1967
- padding: [0, 0, 0, 0],
1968
- borderWidth: 0,
1969
- formatter: (b) => {
1970
- var k;
1971
- const c = (k = b[0]) == null ? void 0 : k.axisValue;
1972
- let m = `
1973
- <div style="background-color: rgba(255, 255, 255, 0.7)" class="border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700 min-w-28">
1974
- <div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200 px-2 py-1">
1975
- ${c ? this.formatDate(c) : "N/A"}
1976
- </div>
1977
- `;
1978
- return b.forEach((S) => {
1979
- m += `
1980
- <div class="flex justify-between items-center text-xs px-2 py-0.5 text-gray-500 dark:text-neutral-400">
1981
- <span class="flex items-center">
1982
- <span class="w-2.5 h-2.5 me-1.5 rounded-sm" style="background-color: ${S.color};"></span>
1983
- <span class="font-medium mr-[6px]">${(S == null ? void 0 : S.seriesName) === "metric" ? "Значення" : S == null ? void 0 : S.seriesName}</span>
1984
- </span>
1985
- <span>${this.getMetricValue(S == null ? void 0 : S.data)}</span>
1986
- </div>
1987
- `;
1988
- }), m += "</div>", m;
1989
- }
1990
- },
1991
- xAxis: {
1992
- data: t != null && t.length ? t : null,
1993
- type: t ? "category" : "value",
1994
- name: ((n = (r = this.styleData) == null ? void 0 : r.x_axis) == null ? void 0 : n.name) || "",
1995
- axisLabel: {
1996
- ...ft((i = this.styleData) == null ? void 0 : i.x_axis),
1997
- formatter: (b) => {
1998
- var p, m;
1999
- const c = this.formatDate(b);
2000
- return ((m = (p = this.styleData) == null ? void 0 : p.x_axis) == null ? void 0 : m.overflow) === "ellipsis" && c.length > 10 ? `${c.slice(0, 10)}...` : c;
2001
- }
2002
- }
2003
- },
2004
- yAxis: {
2005
- data: s != null && s.length ? s : null,
2006
- type: s ? "category" : "value",
2007
- name: ((a = (o = this.styleData) == null ? void 0 : o.y_axis) == null ? void 0 : a.name) || "",
2008
- axisLabel: ft((f = this.styleData) == null ? void 0 : f.y_axis)
2009
- },
2010
- series: e != null && e.length ? e : null,
2011
- ...ie(this.styleData),
2012
- grid: {
2013
- bottom: "0%",
2014
- right: "0%",
2015
- left: "0%",
2016
- top: "20px",
2017
- containLabel: !0,
2018
- ...((d = this.styleData) == null ? void 0 : d.grid) || {}
2019
- }
2020
- };
2021
- await h.setOption(w), h.resize(), this.widgetInstance = h, this.$emit("update:currentWidget", h);
2022
- } catch (u) {
2023
- console.error(u);
2024
- }
2025
- },
2026
- async setSeriesOption(e, t) {
2027
- const s = e.getOption(), { series: r = [] } = s, n = r.map((i) => ({
2028
- ...i,
2029
- ...t
2030
- }));
2031
- e.setOption({
2032
- ...s,
2033
- series: n
2034
- });
2035
- },
2036
- async changeOptionsByName(e, t) {
2037
- const s = document.getElementById(e);
2038
- if (!s) return null;
2039
- const r = echarts.getInstanceByDom(s);
2040
- if (!r) return null;
2041
- const n = r.getOption();
2042
- t.seriesOptions && this.setSeriesOption(r, t.seriesOptions), r.setOption({
2043
- ...n,
2044
- ...t.options,
2045
- tooltip: {
2046
- ...Dr.getTooltipOptions(t.options.tooltip.show)
2047
- }
2048
- });
2049
- },
2050
- async changeData(e) {
2051
- var t;
2052
- try {
2053
- let s = this.dashboard ? `${this.prefix || ""}/bi-data?dashboard=${this.dashboard}&widget=${this.widget}` : `${this.prefix || ""}/bi-data?&widget=${this.widget}`;
2054
- (t = e == null ? void 0 : e.granularity) != null && t.length && (s += `&granularity=${e.granularity}`), e != null && e.metrics && (s += `&metrics=${e.metrics}`), this.getDataFromURL(s);
2055
- } catch (s) {
2056
- console.error(s);
2057
- }
2058
- },
2059
- async setFilter(e) {
2060
- const t = `${this.prefix || ""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}${e || ""}`;
2061
- await this.getDataFromURL(t);
2062
- },
2063
- async changeStyle(e, t) {
2064
- this.styleData[e] = t, this.onChangedData();
2065
- },
2066
- getMetricValue(e) {
2067
- var r;
2068
- const t = (e == null ? void 0 : e.metric) || e;
2069
- return parseFloat(t) ? (r = z(t, { notation: "standard" })) == null ? void 0 : r.replaceAll(
2070
- ",",
2071
- " "
2072
- ) : t;
2073
- }
2074
- }
2075
- }, vr = {
2076
- name: "VsBar",
2077
- mixins: [W],
2078
- data() {
2079
- return {
2080
- resizeObserver: null
2081
- };
2082
- },
2083
- computed: {
2084
- uniqueID() {
2085
- return this.widget;
2086
- }
2087
- },
2088
- async mounted() {
2089
- var t;
2090
- this.getData(), this.onChangedData();
2091
- const e = (t = this.$refs) == null ? void 0 : t.chart;
2092
- e && (this.resizeObserver = new ResizeObserver(() => {
2093
- var s;
2094
- this.widgetInstance && ((s = this.widgetInstance) == null || s.resize());
2095
- }), this.resizeObserver.observe(e));
2096
- },
2097
- unmounted() {
2098
- this.resizeObserver.disconnect();
2099
- },
2100
- methods: {
2101
- async onChangedData() {
2102
- try {
2103
- if (this.sourceData) {
2104
- await this.$nextTick();
2105
- const { series: e, xs: t, ys: s } = this.prepareData();
2106
- e && (this == null || this.initChart(e, t, s));
2107
- }
2108
- } catch (e) {
2109
- console.error(e);
2110
- }
2111
- },
2112
- prepareData() {
2113
- var e, t, s, r, n, i;
2114
- try {
2115
- if (!((e = this.sourceData) != null && e.length))
2116
- return { series: [], xs: [], ys: void 0 };
2117
- const o = Array.from(
2118
- new Set(
2119
- this.sourceData.filter((w) => w[this.dimensions[0]]).map((w) => w[this.dimensions[0]])
2120
- )
2121
- );
2122
- let a;
2123
- this.dimensions[0].includes("date") ? a = o.map((w) => Be(w)) : a = [...o];
2124
- let f, d;
2125
- ((t = this.styleData) == null ? void 0 : t.horizontal) === !0 ? d = [...a] : f = [...a];
2126
- const u = this.sourceData.filter(
2127
- (w) => parseFloat(w[this.dimensions[1]]) && w[this.dimensions[0]]
2128
- ).map((w) => parseFloat(w[this.dimensions[1]]));
2129
- let h;
2130
- return ((s = this.styleData) == null ? void 0 : s.stack) !== !1 ? h = this.prepareStackData() : ((r = this.styleData) == null ? void 0 : r.negative_waterfall) === !0 ? h = this.prepareNegativeWaterfall() : ((n = this.styleData) == null ? void 0 : n.waterfall) === !0 ? h = this.prepareWaterfallData(u) : ((i = this.styleData) == null ? void 0 : i.accumulative) === !0 ? h = this.prepareAccumulative(u) : h = this.dimensions.slice(1).map((b, c) => ({
2131
- name: b,
2132
- type: "bar",
2133
- stack: `a${c}`,
2134
- data: this.sourceData.filter((p) => parseFloat(p[b]) && b).map((p) => parseFloat(p[b]))
2135
- })), { series: h, xs: f, ys: d };
2136
- } catch (o) {
2137
- return console.error(o), { series: [], xs: [], ys: [] };
2138
- }
2139
- },
2140
- prepareWaterfallData(e) {
2141
- let t = e.reduce((i, o) => i + o, 0);
2142
- const s = [t, ...e], r = s.map((i, o) => {
2143
- if (o === 0) return 0;
2144
- const a = t - i;
2145
- return t -= i, a >= 0 ? a : 0;
2146
- });
2147
- return [
2148
- {
2149
- type: "bar",
2150
- stack: "Total",
2151
- itemStyle: {
2152
- borderColor: "transparent",
2153
- color: "transparent"
2154
- },
2155
- data: r,
2156
- tooltip: {
2157
- show: !1
2158
- }
2159
- },
2160
- {
2161
- name: this.title ? this.title : this.dimensions[0],
2162
- type: "bar",
2163
- stack: "Total",
2164
- data: s
2165
- }
2166
- ];
2167
- },
2168
- prepareStackData() {
2169
- return this.dimensions.slice(1).map((s) => ({
2170
- name: s,
2171
- type: "bar",
2172
- stack: "a",
2173
- data: this.sourceData.filter((r) => parseFloat(r[s]) && s).map((r) => parseFloat(r[s]))
2174
- }));
2175
- },
2176
- prepareNegativeWaterfall() {
2177
- const e = this.sourceData.map(
2178
- (i) => Number.isNaN(i[this.dimensions[1]]) ? 0 : Number(i[this.dimensions[1]])
2179
- ), t = this.sourceData.map(
2180
- (i) => Number.isNaN(i[this.dimensions[2]]) ? 0 : Number(i[this.dimensions[2]])
2181
- );
2182
- let s = 0;
2183
- const r = e.map((i, o) => {
2184
- const a = s;
2185
- return s += Number.isNaN(i) ? 0 : i, o === 0 && (s -= Number.isNaN(t[o]) ? 0 : t[o]), s -= Number.isNaN(t[o + 1]) ? 0 : t[o + 1], a >= 0 ? a : 0;
2186
- });
2187
- return [
2188
- {
2189
- type: "bar",
2190
- stack: "a",
2191
- itemStyle: {
2192
- borderColor: "transparent",
2193
- color: "transparent"
2194
- },
2195
- data: r,
2196
- tooltip: {
2197
- show: !1
2198
- }
2199
- },
2200
- {
2201
- name: this.dimensions[1],
2202
- type: "bar",
2203
- stack: "a",
2204
- data: e
2205
- },
2206
- {
2207
- name: this.dimensions[2],
2208
- type: "bar",
2209
- stack: "a",
2210
- data: t
2211
- }
2212
- ];
2213
- },
2214
- prepareAccumulative(e) {
2215
- let t = 0;
2216
- const s = e.map((n) => (t += n, t));
2217
- return [
2218
- {
2219
- name: this.titleCharts,
2220
- type: "bar",
2221
- stack: "Total",
2222
- data: s
2223
- }
2224
- ];
2225
- }
2226
- }
2227
- }, O = (e, t) => {
2228
- const s = e.__vccOpts || e;
2229
- for (const [r, n] of t)
2230
- s[r] = n;
2231
- return s;
2232
- }, Er = ["id"];
2233
- function Cr(e, t, s, r, n, i) {
2234
- return x(), _("div", {
2235
- id: i.uniqueID,
2236
- ref: "chart",
2237
- class: "h-full w-full min-h-[200px]"
2238
- }, null, 8, Er);
2239
- }
2240
- const Or = /* @__PURE__ */ O(vr, [["render", Cr]]), Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2241
- __proto__: null,
2242
- default: Or
2243
- }, Symbol.toStringTag, { value: "Module" })), $r = {
2244
- name: "VsPie",
2245
- props: ["currentWidget"],
2246
- mixins: [W],
2247
- data() {
2248
- return {
2249
- chartInstance: null,
2250
- // Unused variable – оставлен для потенциального будущего использования
2251
- resizeObserver: null
2252
- };
2253
- },
2254
- computed: {
2255
- // Генерируем уникальный ID на основе свойства widget из миксина
2256
- uniqueID() {
2257
- return this.widget;
2258
- }
2259
- },
2260
- async mounted() {
2261
- var s;
2262
- await this.$nextTick(), await this.getData();
2263
- const { series: e } = this.prepareData() || {};
2264
- e && this.initChart(e);
2265
- const t = (s = this.$refs) == null ? void 0 : s.chart;
2266
- t && (this.resizeObserver = new ResizeObserver(() => {
2267
- this.chartInstance && this.chartInstance.resize();
2268
- }), this.resizeObserver.observe(t));
2269
- },
2270
- beforeUnmount() {
2271
- var e;
2272
- (e = this.resizeObserver) == null || e.disconnect();
2273
- },
2274
- methods: {
2275
- // Не используется, оставлен для потенциального будущего применения
2276
- onChangedData() {
2277
- try {
2278
- if (this.sourceData) {
2279
- const { series: e, xs: t, ys: s } = this.prepareData();
2280
- e && this.initChart(e, t, s);
2281
- }
2282
- } catch (e) {
2283
- console.error(e);
2284
- }
2285
- },
2286
- buildTooltipForDonut(e, t) {
2287
- const { name: s, value: r, percent: n } = e;
2288
- return `
2289
- <div style="background-color:${t[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
2290
- ${s == null ? void 0 : s.replace("null", "Не визначено")}: ${z(r)} (${n}%)
2291
- </div>`;
2292
- },
2293
- prepareData() {
2294
- var e, t, s, r, n, i;
2295
- try {
2296
- if (this.styleData = this.styleData || {}, !((e = this.sourceData) != null && e.length))
2297
- return console.warn("No source data available"), null;
2298
- const o = Array.from(
2299
- new Set(
2300
- (this.sourceData || []).map((c) => c[this.dimensions[0]])
2301
- )
2302
- ), a = Array.from(
2303
- new Set(
2304
- (this.sourceData || []).map((c) => c[this.dimensions[1]])
2305
- )
2306
- ), f = parseInt(
2307
- (this.sourceData || []).reduce(
2308
- (c, p) => c + parseFloat((p == null ? void 0 : p.metric) || 0),
2309
- 0
2310
- ),
2311
- 10
2312
- ), d = o.map((c, p) => {
2313
- const m = (a[p] / f * 100).toFixed(2);
2314
- return {
2315
- name: `${c} (${m}%)`,
2316
- value: a[p]
2317
- };
2318
- }), u = ((t = this.styleData) == null ? void 0 : t.innerRadius) || "80%", h = ((s = this.styleData) == null ? void 0 : s.outerRadius) || "100%", w = [u, h];
2319
- return this.styleData.legend = we.getLegendOpions({
2320
- borderRadius: 10,
2321
- height: "100%",
2322
- padding: 10,
2323
- bottom: "0",
2324
- type: "scroll",
2325
- itemWidth: 14,
2326
- itemHeight: 14,
2327
- formatter: (c) => {
2328
- var p;
2329
- return (p = c == null ? void 0 : c.replace("null", "Не визначено")) == null ? void 0 : p.replace("NaN", "0.00");
2330
- },
2331
- ...((r = this.styleData) == null ? void 0 : r.legend) || {}
2332
- }), this.styleData.label = we.getLabelOptions(
2333
- (n = this.styleData) == null ? void 0 : n.label
2334
- ), this.styleData.show_legend = ((i = this.styleData) == null ? void 0 : i.show_legend) ?? !0, { series: [
2335
- {
2336
- name: this.titleCharts ? this.titleCharts : this.dimensions[0],
2337
- type: "pie",
2338
- radius: w,
2339
- center: ["50%", "60%"],
2340
- height: "75%",
2341
- ...ie(this.styleData),
2342
- data: d
2343
- }
2344
- ] };
2345
- } catch (o) {
2346
- return console.error("Error in prepareData:", o), null;
2347
- }
2348
- },
2349
- async initChart(e) {
2350
- try {
2351
- if (!e) {
2352
- console.warn("No series data available for chart initialization");
2353
- return;
2354
- }
2355
- const t = this.$refs.chart;
2356
- if (!t) {
2357
- console.warn("Chart DOM element not found");
2358
- return;
2359
- }
2360
- this.chartInstance = echarts.init(t);
2361
- const s = parseInt(
2362
- (this.sourceData || []).reduce(
2363
- (n, i) => n + parseFloat((i == null ? void 0 : i.metric) || 0),
2364
- 0
2365
- ),
2366
- 10
2367
- ), r = {
2368
- tooltip: {
2369
- trigger: "item",
2370
- formatter: (n) => this.buildTooltipForDonut(n, [n.color]),
2371
- borderWidth: 0,
2372
- appendToBody: !0,
2373
- borderColor: "transparent",
2374
- textStyle: { color: "#000" },
2375
- padding: [15, 15],
2376
- shadowColor: "transparent",
2377
- backgroundColor: "transparent"
2378
- },
2379
- series: e,
2380
- ...ie(this.styleData || {}),
2381
- title: {
2382
- text: z(s),
2383
- left: "center",
2384
- top: "41%",
2385
- textStyle: {
2386
- color: "black",
2387
- fontWeight: 400,
2388
- fontSize: "22px"
2389
- }
2390
- }
2391
- };
2392
- this.chartInstance.setOption(r), this.$emit("update:currentWidget", this.chartInstance), this.chartInstance.resize(), window.addEventListener("resize", () => {
2393
- var n;
2394
- (n = this.chartInstance) == null || n.resize();
2395
- });
2396
- } catch (t) {
2397
- console.error("Error in initChart:", t);
2398
- }
2399
- }
2400
- }
2401
- }, Tr = ["id"];
2402
- function Nr(e, t, s, r, n, i) {
2403
- return x(), _("div", {
2404
- id: i.uniqueID,
2405
- ref: "chart",
2406
- class: "h-full min-h-[200px] flex items-center"
2407
- }, null, 8, Tr);
2408
- }
2409
- const Fr = /* @__PURE__ */ O($r, [["render", Nr]]), Ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2410
- __proto__: null,
2411
- default: Fr
2412
- }, Symbol.toStringTag, { value: "Module" })), Pr = {
2413
- name: "VsPie",
2414
- props: ["currentWidget"],
2415
- mixins: [W],
2416
- data() {
2417
- return {
2418
- chartInstance: null,
2419
- // Unused переменная, оставлена для возможного будущего использования
2420
- resizeObserver: null
2421
- };
2422
- },
2423
- computed: {
2424
- // Используем computed для генерации уникального ID на основе виджета
2425
- uniqueID() {
2426
- return this.widget;
2427
- }
2428
- },
2429
- async mounted() {
2430
- var s;
2431
- await this.$nextTick(), await this.getData();
2432
- const { series: e } = this.prepareData() || {};
2433
- e && this.initChart(e);
2434
- const t = (s = this.$refs) == null ? void 0 : s.chart;
2435
- t && (this.resizeObserver = new ResizeObserver(() => {
2436
- this.chartInstance && this.chartInstance.resize();
2437
- }), this.resizeObserver.observe(t));
2438
- },
2439
- unmounted() {
2440
- var e;
2441
- (e = this.resizeObserver) == null || e.disconnect();
2442
- },
2443
- methods: {
2444
- // Метод не вызывается в компоненте, но оставлен для возможного будущего использования
2445
- onChangedData() {
2446
- try {
2447
- if (this.sourceData) {
2448
- const { series: e, xs: t, ys: s } = this.prepareData();
2449
- e && this.initChart(e, t, s);
2450
- }
2451
- } catch (e) {
2452
- console.error(e);
2453
- }
2454
- },
2455
- buildTooltipForDonut(e, t) {
2456
- const { name: s, value: r, percent: n } = e;
2457
- return `
2458
- <div style="background-color:${t[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
2459
- ${s == null ? void 0 : s.replace("null", "Не визначено")}: ${z(r)} (${n}%)
2460
- </div>`;
2461
- },
2462
- prepareData() {
2463
- var e, t, s, r, n;
2464
- try {
2465
- this.styleData = this.styleData || {};
2466
- const i = Array.from(
2467
- new Set(
2468
- (this.sourceData || []).map((b) => b[this.dimensions[0]])
2469
- )
2470
- ), o = Array.from(
2471
- new Set(
2472
- (this.sourceData || []).map((b) => b[this.dimensions[1]])
2473
- )
2474
- ), a = parseInt(
2475
- (this.sourceData || []).reduce(
2476
- (b, c) => b + parseFloat(c == null ? void 0 : c.metric),
2477
- 0
2478
- ),
2479
- 10
2480
- ), f = i.map((b, c) => {
2481
- const p = (o[c] / a * 100).toFixed(2);
2482
- return {
2483
- name: `${b} (${p}%)`,
2484
- value: o[c]
2485
- };
2486
- }), d = ((e = this.styleData) == null ? void 0 : e.innerRadius) || "0%", u = ((t = this.styleData) == null ? void 0 : t.outerRadius) || "100%", h = [d, u];
2487
- return this.styleData.legend = we.getLegendOpions({
2488
- borderRadius: 10,
2489
- height: "100%",
2490
- padding: 10,
2491
- type: "scroll",
2492
- itemWidth: 14,
2493
- itemHeight: 14,
2494
- formatter: (b) => b == null ? void 0 : b.replace("null", "Не визначено"),
2495
- textStyle: { fontSize: "14px" },
2496
- ...((s = this.styleData) == null ? void 0 : s.legend) || {}
2497
- }), this.styleData.label = we.getLabelOptions(
2498
- (r = this.styleData) == null ? void 0 : r.label
2499
- ), this.styleData.show_legend = ((n = this.styleData) == null ? void 0 : n.show_legend) ?? !0, { series: [
2500
- {
2501
- name: this.titleCharts ? this.titleCharts : this.dimensions[0],
2502
- type: "pie",
2503
- radius: h,
2504
- center: ["50%", "60%"],
2505
- height: "75%",
2506
- ...ie(this.styleData),
2507
- data: f
2508
- }
2509
- ] };
2510
- } catch (i) {
2511
- return console.error("Error in prepareData:", i), null;
2512
- }
2513
- },
2514
- async initChart(e) {
2515
- try {
2516
- if (!e) {
2517
- console.warn("No series data available for chart initialization");
2518
- return;
2519
- }
2520
- const t = this.$refs.chart;
2521
- if (!t) {
2522
- console.warn("Chart DOM element not found");
2523
- return;
2524
- }
2525
- this.chartInstance = echarts.init(t);
2526
- const s = {
2527
- tooltip: {
2528
- trigger: "item",
2529
- formatter: (r) => this.buildTooltipForDonut(r, [r.color]),
2530
- borderWidth: 0,
2531
- appendToBody: !0,
2532
- borderColor: "transparent",
2533
- textStyle: { color: "#000" },
2534
- padding: [15, 15],
2535
- shadowColor: "transparent",
2536
- backgroundColor: "transparent"
2537
- },
2538
- series: e,
2539
- ...ie(this.styleData || {})
2540
- };
2541
- this.chartInstance.setOption(s), this.$emit("update:currentWidget", this.chartInstance), this.chartInstance.resize(), window.addEventListener("resize", () => {
2542
- var r;
2543
- (r = this.chartInstance) == null || r.resize();
2544
- });
2545
- } catch (t) {
2546
- console.error("Error in initChart:", t);
2547
- }
2548
- }
2549
- }
2550
- }, Lr = ["id"];
2551
- function Ur(e, t, s, r, n, i) {
2552
- return x(), _("div", {
2553
- id: i.uniqueID,
2554
- ref: "chart",
2555
- class: "h-full min-h-[200px] flex items-center"
2556
- }, null, 8, Lr);
2557
- }
2558
- const Br = /* @__PURE__ */ O(Pr, [["render", Ur]]), jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2559
- __proto__: null,
2560
- default: Br
2561
- }, Symbol.toStringTag, { value: "Module" })), Vr = {
2562
- name: "VsLine",
2563
- mixins: [W],
2564
- data() {
2565
- return {
2566
- chartInstance: null,
2567
- uniqueID: null
2568
- };
2569
- },
2570
- async mounted() {
2571
- this.uniqueID = this.widget, await this.$nextTick(), await this.getData();
2572
- const { series: e, xs: t } = this.prepareData();
2573
- e && this.initChart(e, t);
2574
- },
2575
- methods: {
2576
- onChangedData() {
2577
- try {
2578
- if (this.sourceData) {
2579
- const { series: e, xs: t, ys: s } = this.prepareData();
2580
- e && (this == null || this.initChart(e, t, s));
2581
- }
2582
- } catch (e) {
2583
- console.error(e);
2584
- }
2585
- },
2586
- prepareData() {
2587
- var e, t;
2588
- try {
2589
- const s = Array.from(
2590
- new Set(this.sourceData.map((o) => o[this.dimensions[0]]))
2591
- );
2592
- let r;
2593
- this.dimensions[0].includes("date") ? r = s.map((o) => Be(o)) : r = [...s];
2594
- const n = this.sourceData.map(
2595
- (o) => parseFloat(o[this.dimensions[1]])
2596
- );
2597
- let i;
2598
- return (e = this.styleData) != null && e.stack ? i = this.dimensions.slice(1).map((a) => ({
2599
- name: a,
2600
- type: "line",
2601
- stack: "a",
2602
- areaStyle: this.styleData.area ? {} : null,
2603
- data: this.sourceData.filter((f) => parseFloat(f[a])).map((f) => parseFloat(f[a]))
2604
- })) : i = [
2605
- {
2606
- name: this.title,
2607
- type: "line",
2608
- areaStyle: (t = this.styleData) != null && t.area ? {} : null,
2609
- data: n,
2610
- stack: "a"
2611
- }
2612
- ], { series: i, xs: r };
2613
- } catch (s) {
2614
- return console.error(s), null;
2615
- }
2616
- }
2617
- }
2618
- }, Ir = ["id"];
2619
- function zr(e, t, s, r, n, i) {
2620
- return x(), _("div", {
2621
- id: n.uniqueID,
2622
- ref: "chart",
2623
- style: { height: "400px" }
2624
- }, null, 8, Ir);
2625
- }
2626
- const Mr = /* @__PURE__ */ O(Vr, [["render", zr]]), Hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2627
- __proto__: null,
2628
- default: Mr
2629
- }, Symbol.toStringTag, { value: "Module" })), qr = {
2630
- name: "VsStat",
2631
- mixins: [W],
2632
- data() {
2633
- return {
2634
- restDimensions: [],
2635
- sumValue: 0,
2636
- columns: null,
2637
- showTooltip: -1
2638
- };
2639
- },
2640
- async mounted() {
2641
- await this.getData(), this.prepareData();
2642
- },
2643
- methods: {
2644
- onChangedData() {
2645
- try {
2646
- this.sourceData && this.prepareData();
2647
- } catch {
2648
- }
2649
- },
2650
- prepareData() {
2651
- this.columns = Object.keys(this.sourceData[0]);
2652
- const e = this.getValues();
2653
- this.sumValue = e.reduce((t, s) => t + s, 0), this.sourceData.forEach((t, s) => {
2654
- t.color = s < ht.length - 1 ? ht[s] : kr();
2655
- });
2656
- },
2657
- formattedValue(e) {
2658
- const t = parseFloat(e);
2659
- return z(t);
2660
- }
2661
- }
2662
- }, Wr = { class: "flex flex-col w-full h-full pt-[16px] rounded-xl" }, Jr = { class: "flex flex-col justify-between w-full h-full" }, Kr = { class: "w-full h-full pb-6 space-y-4" }, Xr = { class: "flex w-full h-3 rounded-full gap-x-1 min-h-3 custom-x-scrollbar" }, Gr = ["onMouseover"], Qr = {
2663
- key: 0,
2664
- class: "absolute top-[-1] left-1/2 transform -translate-x-1/2 -translate-y-full bg-black text-white rounded px-2 py-1"
2665
- }, Zr = { class: "h-[calc(100%-20px)] w-full custom-scrollbar" }, Yr = { class: "grid items-center justify-between grid-cols-2 py-2 gap-x-4" }, en = { class: "flex items-center" }, tn = { class: "text-sm text-gray-800" }, sn = { class: "text-end" }, rn = { class: "text-sm text-gray-500" };
2666
- function nn(e, t, s, r, n, i) {
2667
- return x(), _("div", Wr, [
2668
- g("div", Jr, [
2669
- g("div", Kr, [
2670
- g("div", Xr, [
2671
- (x(!0), _(P, null, U(e.sourceData, (o, a) => {
2672
- var f, d, u, h;
2673
- return x(), _("div", {
2674
- class: Q(["flex flex-col min-w-[5px] justify-center min-h-2.5 h-2.5 text-xs text-white text-center whitespace-nowrap", `bg-[${o.color}]`]),
2675
- style: Le({
2676
- width: `${parseFloat(o == null ? void 0 : o[(f = n.columns) == null ? void 0 : f[1]]) / n.sumValue * 100}%`
2677
- }),
2678
- role: "progressbar",
2679
- "aria-valuenow": "42",
2680
- "aria-valuemin": "0",
2681
- "aria-valuemax": "100",
2682
- onMouseover: (w) => n.showTooltip = a,
2683
- onMouseleave: t[0] || (t[0] = (w) => n.showTooltip = -1)
2684
- }, [
2685
- n.showTooltip > -1 ? (x(), _("div", Qr, E(e.sourceData[n.showTooltip][n.columns[0]]) + " " + E((parseFloat((h = (d = e.sourceData) == null ? void 0 : d[n.showTooltip]) == null ? void 0 : h[(u = n.columns) == null ? void 0 : u[1]]) / n.sumValue * 100).toFixed(2)) + "% ", 1)) : N("", !0)
2686
- ], 46, Gr);
2687
- }), 256))
2688
- ]),
2689
- g("ul", Zr, [
2690
- (x(!0), _(P, null, U(e.sourceData, (o) => {
2691
- var a, f;
2692
- return x(), _("li", Yr, [
2693
- g("div", en, [
2694
- g("span", {
2695
- class: Q(["shrink-0 size-2.5 inline-block rounded-sm me-2.5 min-w-[10px] w-[10px] h-[10px] min-h-[10px]", `bg-[${o.color}]`])
2696
- }, null, 2),
2697
- g("span", tn, E((o == null ? void 0 : o[(a = n.columns) == null ? void 0 : a[0]]) || "Не визначено"), 1)
2698
- ]),
2699
- g("div", sn, [
2700
- g("span", rn, E(i.formattedValue(o == null ? void 0 : o[(f = n.columns) == null ? void 0 : f[1]]) || "-"), 1)
2701
- ])
2702
- ]);
2703
- }), 256))
2704
- ])
2705
- ])
2706
- ])
2707
- ]);
2708
- }
2709
- const on = /* @__PURE__ */ O(qr, [["render", nn]]), an = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2710
- __proto__: null,
2711
- default: on
2712
- }, Symbol.toStringTag, { value: "Module" })), ln = {
2713
- name: "VsProgressBar",
2714
- mixins: [W],
2715
- data() {
2716
- return {
2717
- restDimensions: [],
2718
- maxValue: 0,
2719
- columns: null
2720
- };
2721
- },
2722
- async mounted() {
2723
- await this.getData(), this.prepareData();
2724
- },
2725
- methods: {
2726
- onChangedData() {
2727
- try {
2728
- this.sourceData && this.prepareData();
2729
- } catch {
2730
- }
2731
- },
2732
- prepareData() {
2733
- var t;
2734
- this.columns = Object.keys((t = this.sourceData) == null ? void 0 : t[0]) || null;
2735
- const e = this.getValues();
2736
- this.maxValue = Math.max(...e);
2737
- },
2738
- formattedValue(e) {
2739
- return z(e);
2740
- }
2741
- }
2742
- }, cn = {
2743
- key: 0,
2744
- class: "flex flex-col h-full pt-[16px] rounded-xl"
2745
- }, un = { class: "h-full pt-0 pb-6 space-y-4" }, dn = { class: "h-full space-y-4 custom-scrollbar" }, fn = { class: "flex items-center justify-between mr-2 gap-x-2" }, hn = { class: "grid items-center w-full grid-cols-2 gap-x-2" }, pn = { class: "text-sm text-gray-800" }, mn = {
2746
- class: "flex justify-end",
2747
- role: "progressbar",
2748
- "aria-valuenow": "100",
2749
- "aria-valuemin": "0",
2750
- "aria-valuemax": "100"
2751
- }, gn = { class: "min-w-[60px] text-end" }, bn = { class: "text-sm text-gray-500" };
2752
- function wn(e, t, s, r, n, i) {
2753
- return n.columns ? (x(), _("div", cn, [
2754
- g("div", un, [
2755
- g("ul", dn, [
2756
- (x(!0), _(P, null, U(e.sourceData, (o, a) => (x(), _("li", fn, [
2757
- g("div", hn, [
2758
- g("span", pn, E(o[n.columns[0]]), 1),
2759
- g("div", mn, [
2760
- g("div", {
2761
- class: "h-1.5 flex flex-col justify-center overflow-hidden bg-indigo-500 rounded-full text-xs text-white text-center whitespace-nowrap",
2762
- style: Le({
2763
- width: `${parseFloat(o[n.columns[1]]) / n.maxValue * 100}%`
2764
- })
2765
- }, null, 4)
2766
- ])
2767
- ]),
2768
- g("div", gn, [
2769
- g("span", bn, E(i.formattedValue(o[n.columns[1]])), 1)
2770
- ])
2771
- ]))), 256))
2772
- ])
2773
- ])
2774
- ])) : N("", !0);
2775
- }
2776
- const yn = /* @__PURE__ */ O(ln, [["render", wn]]), xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2777
- __proto__: null,
2778
- default: yn
2779
- }, Symbol.toStringTag, { value: "Module" })), _n = {
2780
- name: "VsListbar",
2781
- mixins: [W],
2782
- props: ["source"],
2783
- data() {
2784
- return {
2785
- restDimensions: [],
2786
- maxValue: 0,
2787
- columns: null
2788
- };
2789
- },
2790
- async mounted() {
2791
- await this.getData(), this.prepareData();
2792
- },
2793
- methods: {
2794
- onChangedData() {
2795
- try {
2796
- this.sourceData && this.prepareData();
2797
- } catch (e) {
2798
- console.error(e);
2799
- }
2800
- },
2801
- prepareData() {
2802
- var t, s, r;
2803
- this.columns = Object.keys(((t = this.sourceData) == null ? void 0 : t[0]) || {});
2804
- const e = (s = this.sourceData) == null ? void 0 : s.map((n) => {
2805
- var i;
2806
- return n == null ? void 0 : n[(i = this.columns) == null ? void 0 : i[1]];
2807
- });
2808
- this.maxValue = Math.max(...e || []), this.restDimensions = (r = this.columns) == null ? void 0 : r.filter((n, i) => i !== 0);
2809
- },
2810
- formattedValue(e) {
2811
- return z(e);
2812
- },
2813
- getWidth(e) {
2814
- return `${e / this.maxValue * 100}%`;
2815
- }
2816
- }
2817
- }, Dn = { class: "h-full pt-[20px] list-bar" }, Sn = { class: "space-y-2 custom-scrollbar h-full h-[calc(100%-20px)]" }, kn = { class: "relative w-full truncate" }, vn = { class: "relative z-[1] text-sm block py-1 px-2 w-full text-sm truncate text-gray-800" }, En = { class: "text-[14px] text-gray-500" };
2818
- function Cn(e, t, s, r, n, i) {
2819
- return x(), _("div", Dn, [
2820
- g("ul", Sn, [
2821
- (x(!0), _(P, null, U(e.sourceData, (o, a) => {
2822
- var f, d, u;
2823
- return x(), _("li", {
2824
- key: a,
2825
- class: "flex items-center justify-between w-full gap-x-2"
2826
- }, [
2827
- g("div", kn, [
2828
- g("span", vn, E((o == null ? void 0 : o[(f = n.columns) == null ? void 0 : f[0]]) || "Без категорії"), 1),
2829
- g("div", {
2830
- class: Q(["absolute inset-y-0 h-full rounded start-0", o != null && o[(d = n.columns) == null ? void 0 : d[0]] ? "bg-indigo-100" : "bg-gray-100"]),
2831
- style: Le({ width: i.getWidth(o == null ? void 0 : o[(u = n.columns) == null ? void 0 : u[1]]) })
2832
- }, null, 6)
2833
- ]),
2834
- (x(!0), _(P, null, U(n.restDimensions, (h, w) => (x(), _("div", {
2835
- key: w,
2836
- class: "w-20 mr-2 text-end"
2837
- }, [
2838
- g("span", En, E(i.formattedValue(o == null ? void 0 : o[h])), 1)
2839
- ]))), 128))
2840
- ]);
2841
- }), 128))
2842
- ])
2843
- ]);
2844
- }
2845
- const On = /* @__PURE__ */ O(_n, [["render", Cn]]), Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2846
- __proto__: null,
2847
- default: On
2848
- }, Symbol.toStringTag, { value: "Module" })), $e = {
2849
- week: "Тиждень",
2850
- month: "Місяць",
2851
- quarter: "Квартал",
2852
- year: "Рік"
2853
- }, $n = ["onClick"], Tn = { class: "flex items-center justify-between w-full" }, Nn = { key: 0 }, Fn = {
2854
- __name: "vs-bi-dropdown",
2855
- props: {
2856
- title: String,
2857
- options: [Array, String],
2858
- value: { type: String }
2859
- },
2860
- emits: ["selected"],
2861
- setup(e, { emit: t }) {
2862
- const s = e, r = t, n = Ee(!1), i = Ee(s.value || null), o = Ee(null), a = Ke(() => typeof s.options == "string" ? s.options.split(",").map((b, c) => ({ id: c, text: b.trim() })) : s.options), f = Ke(() => {
2863
- const b = a.value.find(
2864
- (c) => (c.id || c) === i.value
2865
- );
2866
- return b ? b.text || b : s.title;
2867
- }), d = (b) => {
2868
- i.value = b.id || b, n.value = !1, r("selected", (b == null ? void 0 : b.id) || b), document.removeEventListener("click", u);
2869
- }, u = (b) => {
2870
- o.value && !o.value.contains(b.target) && (n.value = !1, document.removeEventListener("click", u));
2871
- }, h = () => {
2872
- n.value = !n.value, n.value ? setTimeout(() => {
2873
- document.addEventListener("click", u);
2874
- }, 200) : document.removeEventListener("click", u);
2875
- }, w = (b) => ($e == null ? void 0 : $e[b]) || b;
2876
- return It(() => {
2877
- document.removeEventListener("click", u);
2878
- }), (b, c) => (x(), _(P, null, [
2879
- g("button", {
2880
- type: "button",
2881
- "aria-expanded": "true",
2882
- class: "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",
2883
- onClick: h
2884
- }, [
2885
- pt(E(w(f.value)) + " ", 1),
2886
- c[0] || (c[0] = g("svg", {
2887
- class: "shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",
2888
- xmlns: "http://www.w3.org/2000/svg",
2889
- width: "16",
2890
- height: "16",
2891
- viewBox: "0 0 24 24",
2892
- fill: "none",
2893
- stroke: "currentColor",
2894
- "stroke-width": "2",
2895
- "stroke-linecap": "round",
2896
- "stroke-linejoin": "round"
2897
- }, [
2898
- g("path", { d: "m6 9 6 6 6-6" })
2899
- ], -1))
2900
- ]),
2901
- n.value ? (x(), _("div", {
2902
- key: 0,
2903
- ref_key: "biDropdown",
2904
- ref: o,
2905
- "data-hs-select-dropdown": "",
2906
- class: "absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",
2907
- role: "listbox",
2908
- tabindex: "-1",
2909
- "aria-orientation": "vertical",
2910
- style: { "margin-top": "10px" }
2911
- }, [
2912
- (x(!0), _(P, null, U(a.value, (p) => (x(), _("div", {
2913
- key: p.id || p,
2914
- class: "cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",
2915
- onClick: (m) => d(p)
2916
- }, [
2917
- g("div", Tn, [
2918
- g("span", null, E(w(p.text || p)), 1),
2919
- i.value === (p.id || p) ? (x(), _("span", Nn, [...c[1] || (c[1] = [
2920
- g("svg", {
2921
- class: "shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",
2922
- xmlns: "http:.w3.org/2000/svg",
2923
- width: "24",
2924
- height: "24",
2925
- viewBox: "0 0 24 24",
2926
- fill: "none",
2927
- stroke: "currentColor",
2928
- "stroke-width": "2",
2929
- "stroke-linecap": "round",
2930
- "stroke-linejoin": "round"
2931
- }, [
2932
- g("polyline", { points: "20 6 9 17 4 12" })
2933
- ], -1)
2934
- ])])) : N("", !0)
2935
- ])
2936
- ], 8, $n))), 128))
2937
- ], 512)) : N("", !0)
2938
- ], 64));
2939
- }
2940
- }, An = {
2941
- "bi-bar": T(() => Promise.resolve().then(() => Rr)),
2942
- "bi-number": T(() => import("./vs-number-Dd_21nn-.js")),
2943
- "bi-text": T(() => import("./vs-text-DEJjWxDu.js")),
2944
- "bi-listbar": T(() => Promise.resolve().then(() => Rn)),
2945
- "bi-pie": T(() => Promise.resolve().then(() => jr)),
2946
- "bi-donut": T(() => Promise.resolve().then(() => Ar)),
2947
- "bi-line": T(() => Promise.resolve().then(() => Hr)),
2948
- "bi-stat": T(() => Promise.resolve().then(() => an)),
2949
- "bi-pivot": T(() => Promise.resolve().then(() => Xi)),
2950
- "bi-progress": T(() => Promise.resolve().then(() => xn)),
2951
- "bi-funnel": T(() => import("./vs-funnel-bar-T330oJNS.js")),
2952
- "bi-map": T(() => import("./vs-map-Skt608pM.js")),
2953
- "bi-cluster": T(() => import("./vs-map-cluster-BRUiY_90.js")),
2954
- "bi-table": T(() => import("./vs-table-BwC29Zyc.js"))
2955
- }, Pn = { class: "flex items-center space-x-2" }, Ln = /* @__PURE__ */ zt({
2956
- __name: "vs-bi-switch",
2957
- props: /* @__PURE__ */ Xe({
2958
- leftLabel: {},
2959
- rightLabel: {},
2960
- modelValue: { type: Boolean }
2961
- }, {
2962
- modelValue: {
2963
- default: () => !1,
2964
- type: Boolean
2965
- },
2966
- modelModifiers: {}
2967
- }),
2968
- emits: /* @__PURE__ */ Xe(["update:is-enabled"], ["update:modelValue"]),
2969
- setup(e, { emit: t }) {
2970
- const s = t, r = Mt(e, "modelValue"), n = () => {
2971
- s("update:is-enabled", r);
2972
- };
2973
- return (i, o) => (x(), _("div", Pn, [
2974
- e.leftLabel ? (x(), _("div", {
2975
- key: 0,
2976
- class: Q(["transition-colors", { "text-blue-500": !r.value }])
2977
- }, E(e.leftLabel), 3)) : N("", !0),
2978
- Ht(g("input", {
2979
- "onUpdate:modelValue": o[0] || (o[0] = (a) => r.value = a),
2980
- type: "checkbox",
2981
- class: "relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",
2982
- onChange: n
2983
- }, null, 544), [
2984
- [qt, r.value]
2985
- ]),
2986
- e.rightLabel ? (x(), _("div", {
2987
- key: 1,
2988
- class: Q(["transition-colors", { "text-blue-500": r.value }])
2989
- }, E(e.rightLabel), 3)) : N("", !0)
2990
- ]));
2991
- }
2992
- }), Un = {}, Bn = { class: "flex items-center justify-center h-full" };
2993
- function jn(e, t) {
2994
- return x(), _("div", Bn, [...t[0] || (t[0] = [
2995
- g("div", { class: "text-center text-gray-500" }, [
2996
- g("h2", { class: "text-2xl font-bold" }, "No data available")
2997
- ], -1)
2998
- ])]);
2999
- }
3000
- const Vn = /* @__PURE__ */ O(Un, [["render", jn]]), In = {}, zn = {
3001
- xmlns: "http://www.w3.org/2000/svg",
3002
- viewBox: "0 0 24 24",
3003
- fill: "none",
3004
- stroke: "currentColor",
3005
- "stroke-width": "2",
3006
- "stroke-linecap": "round",
3007
- "stroke-linejoin": "round",
3008
- class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
3009
- };
3010
- function Mn(e, t, s, r, n, i) {
3011
- return x(), _("svg", zn, [...t[0] || (t[0] = [
3012
- g("path", {
3013
- stroke: "none",
3014
- d: "M0 0h24v24H0z",
3015
- fill: "none"
3016
- }, null, -1),
3017
- g("path", { d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2" }, null, -1),
3018
- g("path", { d: "M7 11l5 5l5 -5" }, null, -1),
3019
- g("path", { d: "M12 4l0 12" }, null, -1)
3020
- ])]);
3021
- }
3022
- const Hn = /* @__PURE__ */ O(In, [["render", Mn]]), qn = {
3023
- components: {
3024
- VsBiDropdown: Fn,
3025
- VsBiSwitch: Ln,
3026
- VsNoDataChart: Vn,
3027
- IconDownload: Hn,
3028
- ...An
3029
- },
3030
- props: {
3031
- dashboard: { type: String },
3032
- prefix: { type: String, default: "" },
3033
- widget: { type: String },
3034
- filterURl: { type: String },
3035
- dashboardWidgets: { type: Object },
3036
- selectedWidget: { type: String }
3037
- },
3038
- data() {
3039
- return {
3040
- checked: [],
3041
- selected: [],
3042
- currentWidget: null,
3043
- widgetData: []
3044
- };
3045
- },
3046
- computed: {
3047
- computedTitle() {
3048
- var t, s;
3049
- const e = (t = this.dashboardWidgets) == null ? void 0 : t.find(
3050
- (r) => r.name === this.widget
3051
- );
3052
- return ((s = e == null ? void 0 : e.data) == null ? void 0 : s.title) || (e == null ? void 0 : e.title) || "";
3053
- },
3054
- computedType() {
3055
- var t;
3056
- const e = (t = this.dashboardWidgets) == null ? void 0 : t.find(
3057
- (s) => s.name === this.widget
3058
- );
3059
- return (e == null ? void 0 : e.type) || "text";
3060
- },
3061
- controls() {
3062
- var t;
3063
- return Object.keys(((t = this.widgetData) == null ? void 0 : t.controls) || {}).map(
3064
- (s) => {
3065
- var r, n, i;
3066
- return {
3067
- name: s,
3068
- options: typeof ((r = this.widgetData) == null ? void 0 : r.controls) == "boolean" ? !1 : (i = (n = this.widgetData) == null ? void 0 : n.controls) == null ? void 0 : i[s]
3069
- };
3070
- }
3071
- );
3072
- }
3073
- },
3074
- mounted() {
3075
- this.prefix && (v.defaults.baseURL = this.prefix);
3076
- },
3077
- watch: {
3078
- filterURl(e) {
3079
- var t, s;
3080
- (s = (t = this.$refs) == null ? void 0 : t.chart) == null || s.setFilter(e);
3081
- },
3082
- selectedWidget(e, t) {
3083
- var s;
3084
- e !== t && e === ((s = this.widgetData) == null ? void 0 : s.id) && this.$emit("update:current-widget-data", this.widgetData);
3085
- },
3086
- widgetData(e, t) {
3087
- if ((e == null ? void 0 : e.id) === (t == null ? void 0 : t.id)) return;
3088
- const r = new URLSearchParams(window.top.location.search).get("widget");
3089
- r && r === (e == null ? void 0 : e.id) && this.$emit("update:current-widget-data", e);
3090
- }
3091
- },
3092
- methods: {
3093
- changeStyleHandler(e, t) {
3094
- var s;
3095
- (s = this.$refs.chart) == null || s.changeStyle(e, t);
3096
- },
3097
- selectedOptionHandler(e, t) {
3098
- let s = !0;
3099
- this.selected.forEach((r) => {
3100
- r.name === t && (r.option = e, s = !1);
3101
- }), s && this.selected.push({ name: t, option: e }), this.makeUpUrl();
3102
- },
3103
- makeUpUrl() {
3104
- var t;
3105
- let e = `/bi-data?dashboard=${this.dashboard}&widget=${this.widget}`;
3106
- this.selected.forEach((s, r) => {
3107
- e += `&${s.name}=${s.option}`;
3108
- }), (t = this.$refs.chart) == null || t.getDataFromURL(e);
3109
- },
3110
- exportChart() {
3111
- if (this.currentWidget) {
3112
- const e = this.currentWidget.getDataURL({
3113
- type: "png",
3114
- pixelRatio: 2,
3115
- backgroundColor: "#ffffff"
3116
- }), t = document.createElement("a");
3117
- t.href = e, t.download = "chart.png", document.body.appendChild(t), t.click(), document.body.removeChild(t);
3118
- }
3119
- }
3120
- }
3121
- }, Wn = {
3122
- key: 0,
3123
- class: "text-[16px] flex max-w-full items-center min-h-0 flex justify-between max-h-[50px] h-fit shrink-0"
3124
- }, Jn = { class: "flex items-center justify-between w-full" }, Kn = { class: "grid" }, Xn = { class: "text-gray-800 max-h-[30px] inline-block text-nowrap font-semibold" }, Gn = { class: "flex flex-col justify-end" }, Qn = {
3125
- key: 0,
3126
- class: "flex items-center justify-end w-full gap-2"
3127
- }, Zn = { class: "w-full h-full" };
3128
- function Yn(e, t, s, r, n, i) {
3129
- var u, h, w, b, c, p, m, k, S;
3130
- const o = I("VsBiDropdown"), a = I("VsBiSwitch"), f = I("IconDownload"), d = I("VsNoDataChart");
3131
- return x(), _("div", {
3132
- ref: "widget",
3133
- class: Q(["box-border relative h-full p-4 bg-white border border-gray-200 select-auto rounded-xl", [
3134
- (h = (u = n.widgetData) == null ? void 0 : u.style) != null && h.height ? `max-h-[${(b = (w = n.widgetData) == null ? void 0 : w.style) == null ? void 0 : b.height}px] h-[${(p = (c = n.widgetData) == null ? void 0 : c.style) == null ? void 0 : p.height}px]` : "max-h-[460px]"
3135
- ]])
3136
- }, [
3137
- ["text", "cluster", "map"].includes(i.computedType) ? N("", !0) : (x(), _("div", Wn, [
3138
- g("div", Jn, [
3139
- g("div", Kn, [
3140
- g("span", Xn, E(i.computedTitle), 1)
3141
- ]),
3142
- g("div", Gn, [
3143
- (m = i.controls) != null && m.length ? (x(), _("span", Qn, [
3144
- (x(!0), _(P, null, U((k = i.controls) == null ? void 0 : k.filter(
3145
- (y) => (y == null ? void 0 : y.options) && (y == null ? void 0 : y.name) !== "export"
3146
- ), (y) => {
3147
- var C;
3148
- return x(), _("div", null, [
3149
- Array.isArray(y == null ? void 0 : y.options) ? (x(), M(o, {
3150
- key: 0,
3151
- title: y == null ? void 0 : y.name,
3152
- options: y == null ? void 0 : y.options,
3153
- value: (C = n.widgetData) == null ? void 0 : C.data[y == null ? void 0 : y.name],
3154
- onSelected: ($) => i.selectedOptionHandler($, y == null ? void 0 : y.name)
3155
- }, null, 8, ["title", "options", "value", "onSelected"])) : typeof y.options == "boolean" ? (x(), M(a, {
3156
- key: 1,
3157
- "left-label": y == null ? void 0 : y.name,
3158
- "is-enabled": y == null ? void 0 : y.options,
3159
- "onUpdate:isEnabled": ($) => i.changeStyleHandler(y == null ? void 0 : y.name, $)
3160
- }, null, 8, ["left-label", "is-enabled", "onUpdate:isEnabled"])) : N("", !0)
3161
- ]);
3162
- }), 256)),
3163
- (S = i.controls) != null && S.some((y) => (y == null ? void 0 : y.name) === "export") ? (x(), _("button", {
3164
- key: 0,
3165
- onClick: t[0] || (t[0] = (...y) => i.exportChart && i.exportChart(...y)),
3166
- class: "h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center"
3167
- }, [
3168
- Ue(f, {
3169
- height: "16",
3170
- width: "16",
3171
- class: "text-gray-800"
3172
- })
3173
- ])) : N("", !0)
3174
- ])) : N("", !0)
3175
- ])
3176
- ])
3177
- ])),
3178
- g("div", Zn, [
3179
- n.widgetData ? (x(), M(Wt("bi-" + i.computedType), {
3180
- key: 0,
3181
- currentWidget: n.currentWidget,
3182
- "onUpdate:currentWidget": t[1] || (t[1] = (y) => n.currentWidget = y),
3183
- widgetData: n.widgetData,
3184
- "onUpdate:widgetData": t[2] || (t[2] = (y) => n.widgetData = y),
3185
- ref: "chart",
3186
- dashboard: s.dashboard,
3187
- title: i.computedTitle,
3188
- widget: s.widget
3189
- }, null, 40, ["currentWidget", "widgetData", "dashboard", "title", "widget"])) : (x(), M(d, {
3190
- key: 1,
3191
- class: "w-full h-full"
3192
- }))
3193
- ])
3194
- ], 2);
3195
- }
3196
- const ei = /* @__PURE__ */ O(qn, [["render", Yn]]), ti = {
3197
- props: {
3198
- title: { type: String, default: () => "Дані для відображення відсутні" },
3199
- text: {
3200
- type: String,
3201
- default: () => "Змініть параметри пошуку або спробуйте пізніше"
3202
- }
3203
- }
3204
- }, si = { class: "w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit" }, ri = { class: "p-5 min-h-[500px] flex flex-col justify-center items-center text-center" }, ni = { class: "max-w-sm mx-auto mt-6" }, ii = { class: "font-medium text-gray-800 dark:text-neutral-200" }, oi = { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" };
3205
- function ai(e, t, s, r, n, i) {
3206
- return x(), _("div", si, [
3207
- g("div", null, [
3208
- g("div", ri, [
3209
- t[0] || (t[0] = mt('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>', 1)),
3210
- g("div", ni, [
3211
- g("p", ii, E(s.title), 1),
3212
- g("p", oi, E(s.text), 1)
3213
- ])
3214
- ])
3215
- ])
3216
- ]);
3217
- }
3218
- const li = /* @__PURE__ */ O(ti, [["render", ai]]), ci = {}, ui = {
3219
- class: "flex-shrink-0 size-3.5",
3220
- xmlns: "http://www.w3.org/2000/svg",
3221
- width: "22",
3222
- height: "22",
3223
- viewBox: "0 0 24 24",
3224
- fill: "none",
3225
- stroke: "currentColor",
3226
- "stroke-width": "2",
3227
- "stroke-linecap": "round",
3228
- "stroke-linejoin": "round"
3229
- };
3230
- function di(e, t) {
3231
- return x(), _("svg", ui, [...t[0] || (t[0] = [
3232
- mt('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>', 9)
3233
- ])]);
3234
- }
3235
- const fi = /* @__PURE__ */ O(ci, [["render", di]]), hi = {}, pi = {
3236
- xmlns: "http://www.w3.org/2000/svg",
3237
- viewBox: "0 0 24 24",
3238
- fill: "none",
3239
- stroke: "currentColor",
3240
- "stroke-width": "1",
3241
- "stroke-linecap": "round",
3242
- "stroke-linejoin": "round",
3243
- class: "icon icon-tabler icons-tabler-outline icon-tabler-refresh"
3244
- };
3245
- function mi(e, t) {
3246
- return x(), _("svg", pi, [...t[0] || (t[0] = [
3247
- g("path", {
3248
- stroke: "none",
3249
- d: "M0 0h24v24H0z",
3250
- fill: "none"
3251
- }, null, -1),
3252
- g("path", { d: "M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" }, null, -1),
3253
- g("path", { d: "M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" }, null, -1)
3254
- ])]);
3255
- }
3256
- const gi = /* @__PURE__ */ O(hi, [["render", mi]]), bi = {
3257
- components: { filterIcon: fi, refreshIcon: gi },
3258
- props: ["filterScheme"],
3259
- emits: ["filters:changed"],
3260
- data() {
3261
- return {
3262
- rows: [],
3263
- isFilterVisible: !1,
3264
- rowList: [],
3265
- activeFilters: "",
3266
- filters: {}
3267
- };
3268
- },
3269
- async mounted() {
3270
- const t = await (await new URLSearchParams(window.top.location.search)).get("filter");
3271
- this.filters.url = t || "";
3272
- },
3273
- computed: {
3274
- activeFiltersCount() {
3275
- var e, t;
3276
- return (e = this.filters) != null && e.url ? ((t = this.filters) == null ? void 0 : t.url.split("=").length) - 1 : 0;
3277
- }
3278
- },
3279
- methods: {
3280
- toggleFilterShown() {
3281
- this.isFilterVisible = !this.isFilterVisible;
3282
- },
3283
- handleFilterChange(e) {
3284
- var t, s;
3285
- this.filters = e, this.activeFilters = (s = (t = this.$refs) == null ? void 0 : t.filter) == null ? void 0 : s.activeFilters, this.$emit("filters:changed", this.filters);
3286
- },
3287
- resetFilters() {
3288
- this.$refs.filter && this.$refs.filter.clearAll(), this.isFilterVisible = !1, this.$emit("filters:changed", ""), this.activeFilters = null;
3289
- },
3290
- closeFilter({ target: e }) {
3291
- this.isFilterVisible && e.classList.contains("filter-container") && (this.isFilterVisible = !1);
3292
- }
3293
- }
3294
- }, wi = { class: "flex items-center" }, yi = {
3295
- key: 0,
3296
- class: "font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"
3297
- };
3298
- function xi(e, t, s, r, n, i) {
3299
- const o = I("filterIcon"), a = I("VsFilterList");
3300
- return x(), _("div", wi, [
3301
- s.filterScheme ? (x(), M(a, {
3302
- key: 0,
3303
- ref: "filter",
3304
- scheme: s.filterScheme,
3305
- closeFilterBtn: !0,
3306
- onFilterClose: t[1] || (t[1] = (f) => n.isFilterVisible = !1),
3307
- layout: "default",
3308
- "apply-vue-router": "",
3309
- history: "",
3310
- view: "plain",
3311
- token: e.table,
3312
- name: "filter",
3313
- footer: !0,
3314
- background: !0,
3315
- onFilterChange: i.handleFilterChange
3316
- }, {
3317
- button: Jt(() => [
3318
- g("button", {
3319
- type: "button",
3320
- class: "py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",
3321
- onClick: t[0] || (t[0] = (...f) => i.toggleFilterShown && i.toggleFilterShown(...f))
3322
- }, [
3323
- Ue(o),
3324
- t[2] || (t[2] = pt(" Фільтри ", -1)),
3325
- i.activeFiltersCount >= 1 ? (x(), _("span", yi, E(i.activeFiltersCount), 1)) : N("", !0)
3326
- ])
3327
- ]),
3328
- _: 1
3329
- }, 8, ["scheme", "token", "onFilterChange"])) : N("", !0)
3330
- ]);
3331
- }
3332
- const _i = /* @__PURE__ */ O(bi, [["render", xi]]), Di = {
3333
- props: ["dashboardData", "filters"],
3334
- components: { VsFilterHeader: _i }
3335
- }, Si = { class: "bg-white px-5 flex gap-4 h-[90px] border border-gray-200 mt-2 rounded-xl mb-2 pt-[3px] justify-between items-center" }, ki = { class: "grow" }, vi = { class: "text-lg font-semibold text-stone-800 dark:text-neutral-200" }, Ei = {
3336
- type: "button",
3337
- class: "inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400",
3338
- "data-clipboard-target": "#hs-erc",
3339
- "data-clipboard-action": "copy",
3340
- "data-clipboard-success-text": "Copied"
3341
- };
3342
- function Ci(e, t, s, r, n, i) {
3343
- var a, f;
3344
- const o = I("VsFilterHeader");
3345
- return x(), _("div", Si, [
3346
- g("div", ki, [
3347
- g("h1", vi, E((a = s.dashboardData) == null ? void 0 : a.title), 1),
3348
- g("button", Ei, E((f = s.dashboardData) == null ? void 0 : f.description), 1)
3349
- ]),
3350
- Ue(o, {
3351
- filterScheme: s.filters,
3352
- "onFilters:changed": t[0] || (t[0] = (d) => e.$emit("filters:changed", d))
3353
- }, null, 8, ["filterScheme"])
3354
- ]);
3355
- }
3356
- const Oi = /* @__PURE__ */ O(Di, [["render", Ci]]), Ri = {
3357
- components: { VsWidget: ei, VsNewNodata: li, VsHeader: Oi },
3358
- props: ["id", "prefix"],
3359
- data() {
3360
- return {
3361
- widgets: [],
3362
- panels: [],
3363
- error: !1,
3364
- selectedPanel: "",
3365
- filterURl: null,
3366
- dashboardData: null
3367
- };
3368
- },
3369
- async mounted() {
3370
- v.defaults.baseURL = this.prefix || "/api", await this.fetchData();
3371
- },
3372
- methods: {
3373
- async fetchData() {
3374
- if (this.id)
3375
- try {
3376
- const { data: e } = await v.get(`/bi-dashboard/${this.id}`);
3377
- this.dashboardData = e;
3378
- } catch (e) {
3379
- console.error(e);
3380
- }
3381
- },
3382
- columnClass(e) {
3383
- const t = e != null && e.col ? e == null ? void 0 : e.col : 12;
3384
- return {
3385
- 1: "md:w-1/12 sm:w-full",
3386
- 2: "md:w-1/6 sm:w-full",
3387
- 3: "md:w-1/4 sm:w-full",
3388
- 4: "md:w-1/3 sm:w-full",
3389
- 6: "md:w-1/2 sm:w-full",
3390
- 8: "md:w-2/3 sm:w-full",
3391
- 10: "md:w-5/6 sm:w-full",
3392
- 12: "w-full"
3393
- }[t] || "w-full";
3394
- },
3395
- async filterHandler(e) {
3396
- var s;
3397
- this.filterURl = "";
3398
- let t = "&filter=";
3399
- (s = e == null ? void 0 : e.url) != null && s.length && (e.url.split("|").forEach((n) => {
3400
- const i = n.split("=");
3401
- t += `${i[0]}=${i[1]}`;
3402
- }), this.filterURl += t);
3403
- }
3404
- }
3405
- }, $i = { class: "w-full pb-8 overflow-y-auto" }, Ti = { class: "grid flex-grow w-full grid-cols-12 gap-4 h-fit" };
3406
- function Ni(e, t, s, r, n, i) {
3407
- var d, u, h;
3408
- const o = I("VsHeader"), a = I("VsNewNodata"), f = I("VsWidget");
3409
- return x(), _("div", $i, [
3410
- g("div", null, [
3411
- (d = n.dashboardData) != null && d.filters ? (x(), M(o, {
3412
- key: 0,
3413
- filters: (u = n.dashboardData) == null ? void 0 : u.filters,
3414
- dashboardData: n.dashboardData,
3415
- "onFilters:changed": t[0] || (t[0] = (w) => i.filterHandler(w))
3416
- }, null, 8, ["filters", "dashboardData"])) : N("", !0)
3417
- ]),
3418
- g("div", Ti, [
3419
- n.error || !n.dashboardData ? (x(), M(a, {
3420
- key: 0,
3421
- class: "col-span-12"
3422
- })) : N("", !0),
3423
- (x(!0), _(P, null, U(((h = n.dashboardData) == null ? void 0 : h.panels) || [], (w, b) => {
3424
- var c;
3425
- return x(), _("div", {
3426
- key: b,
3427
- class: Q([`col-span-${w.col || 12}`, "flex flex-col gap-[10px]"])
3428
- }, [
3429
- (c = w.widgets) != null && c.length ? (x(!0), _(P, { key: 0 }, U(w.widgets, (p) => (x(), M(f, {
3430
- key: p,
3431
- dashboard: s.id,
3432
- widget: p,
3433
- "dashboard-widgets": n.dashboardData.widgets,
3434
- "filter-u-rl": n.filterURl
3435
- }, null, 8, ["dashboard", "widget", "dashboard-widgets", "filter-u-rl"]))), 128)) : (x(), M(f, {
3436
- key: 1,
3437
- class: "flex flex-col",
3438
- dashboard: s.id,
3439
- widget: w.widget,
3440
- "dashboard-widgets": n.dashboardData.widgets,
3441
- "filter-u-rl": n.filterURl
3442
- }, null, 8, ["dashboard", "widget", "dashboard-widgets", "filter-u-rl"]))
3443
- ], 2);
3444
- }), 128))
3445
- ])
3446
- ]);
3447
- }
3448
- const bo = /* @__PURE__ */ O(Ri, [["render", Ni]]), Fi = {
3449
- name: "VsPivotTable",
3450
- mixins: [W],
3451
- data() {
3452
- return {
3453
- values: null,
3454
- xs: null,
3455
- products: null
3456
- };
3457
- },
3458
- async mounted() {
3459
- await this.getData(), this.prepareData();
3460
- },
3461
- methods: {
3462
- onChangedData() {
3463
- try {
3464
- this.sourceData && this.prepareData();
3465
- } catch {
3466
- }
3467
- },
3468
- prepareData() {
3469
- try {
3470
- const e = Array.from(
3471
- new Set(this.sourceData.map((t) => t[this.dimensions[0]]))
3472
- );
3473
- this.dimensions[0].includes("date") ? this.xs = e.map((t) => Be(t)) : this.xs = [...e], this.products = this.dimensions.filter((t, s) => s != 0), this.values = this.products.map((t, s) => ({
3474
- name: t,
3475
- data: this.sourceData.filter((r) => parseFloat(r[t])).map((r) => z(parseFloat(r[t])))
3476
- }));
3477
- } catch (e) {
3478
- console.error(e);
3479
- }
3480
- }
3481
- }
3482
- }, Ai = { class: "flex flex-col h-full p-5 space-y-4 rounded-xl custom-scrollbar" }, Pi = { class: "overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 custom-scrollbar" }, Li = { class: "inline-block min-w-full align-middle" }, Ui = { class: "min-w-full divide-y divide-gray-200" }, Bi = { class: "space-x-2" }, ji = {
3483
- scope: "col",
3484
- class: "xl:min-w-[120px] min-w-48"
3485
- }, Vi = { class: "py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500" }, Ii = { class: "divide-y divide-gray-200 text-[12px]" }, zi = { class: "py-3 size-px whitespace-nowrap" }, Mi = { class: "flex items-center gap-x-3" }, Hi = { class: "font-medium text-gray-800" }, qi = { class: "py-3 size-px whitespace-nowrap" }, Wi = { class: "text-gray-600" };
3486
- function Ji(e, t, s, r, n, i) {
3487
- return x(), _("div", Ai, [
3488
- g("div", Pi, [
3489
- g("div", Li, [
3490
- g("table", Ui, [
3491
- g("thead", null, [
3492
- g("tr", Bi, [
3493
- t[0] || (t[0] = g("th", {
3494
- scope: "col",
3495
- class: "min-w-[200px]"
3496
- }, [
3497
- g("div", { class: "py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500" })
3498
- ], -1)),
3499
- (x(!0), _(P, null, U(n.xs, (o) => (x(), _("th", ji, [
3500
- g("div", Vi, E(o), 1)
3501
- ]))), 256))
3502
- ])
3503
- ]),
3504
- (x(!0), _(P, null, U(n.values, (o) => (x(), _("tbody", Ii, [
3505
- g("tr", null, [
3506
- g("td", zi, [
3507
- g("div", Mi, [
3508
- g("span", Hi, E(o.name), 1)
3509
- ])
3510
- ]),
3511
- (x(!0), _(P, null, U(n.xs, (a, f) => (x(), _("td", qi, [
3512
- g("span", Wi, E(o.data[f]), 1)
3513
- ]))), 256))
3514
- ])
3515
- ]))), 256))
3516
- ])
3517
- ])
3518
- ])
3519
- ]);
3520
- }
3521
- const Ki = /* @__PURE__ */ O(Fi, [["render", Ji]]), Xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3522
- __proto__: null,
3523
- default: Ki
3524
- }, Symbol.toStringTag, { value: "Module" }));
3525
- export {
3526
- Or as V,
3527
- O as _,
3528
- ie as a,
3529
- Be as b,
3530
- W as c,
3531
- z as d,
3532
- v as e,
3533
- Qi as f,
3534
- Br as g,
3535
- Mr as h,
3536
- on as i,
3537
- yn as j,
3538
- On as k,
3539
- Ki as l,
3540
- bo as m,
3541
- ei as n,
3542
- Fr as v
3543
- };