UNPKG

vue-data-ui

Version:

A user-empowering data visualization Vue 3 components library for eloquent data storytelling

1,190 lines • 78.4 kB
import { defineAsyncComponent as $e, ref as w, computed as N, toRefs as aa, watch as Ie, shallowRef as It, onMounted as la, onBeforeUnmount as Et, nextTick as Tt, watchEffect as oa, createElementBlock as o, openBlock as a, normalizeStyle as O, normalizeClass as ce, createBlock as Ee, createCommentVNode as g, createElementVNode as L, createVNode as ke, unref as r, createSlots as na, withCtx as ee, renderSlot as U, normalizeProps as he, guardReactiveProps as fe, toDisplayString as F, Fragment as p, renderList as I, Teleport as ia, mergeProps as et } from "vue"; import { u as ua, c as ra, t as sa, a as va, p as G, b as da, C as We, d as ca, G as ha, f as fa, o as ga, e as tt, m as ma, D as Pt, X as pa, n as xa, q as at, r as Te, k as te, i as W, I as Ot, V as Rt, h as ae, y as Xe, z as lt } from "./index-q-LPw2IT.js"; import { t as Mt, u as ya } from "./useResponsive-DfdjqQps.js"; import { u as ka } from "./usePrinter-DX7efa1s.js"; import { u as Ft } from "./useNestedProp-04aFeUYu.js"; import { u as ba } from "./useTimeLabels-DkzmKfZn.js"; import { u as Sa } from "./useChartAccessibility-9icAAmYg.js"; import { u as wa } from "./useTimeLabelCollider-CIsgDrl9.js"; import Aa from "./img-Ctts6JQb.js"; import { S as La } from "./Slicer-BarTZZDU.js"; import { u as _a, B as za } from "./useLoading-D7YHNtLX.js"; import { _ as Ca } from "./_plugin-vue_export-helper-CHgC5LLL.js"; const z = { LINE: "LINE", BAR: "BAR", DONUT: "DONUT" }, $a = ["SERIE", "SERIES", "DATA", "VALUE", "VALUES", "NUM"]; function Ia({ dataset: h, barLineSwitch: P = 6, debug: S = !0 }) { let B = null, H = null, oe = 0; if ((typeof h == "number" || typeof h == "string") && S && console.warn(`The provided dataset (${h}) is not sufficient to build a chart`), Pe(h) && (le(h) && (h.length < P ? B = z.BAR : B = z.LINE, H = h, oe = h.length), je(h))) { if (!Ta(h)) return S && console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."), !1; const Se = Object.keys(h[0]), M = Object.values(h[0]); if (!Se.some((R) => Pa(R))) return S && console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."), !1; Nt(M, (R) => typeof R == "number") && (B = z.DONUT, H = h), Nt(M, (R) => Array.isArray(R) && le(R)) && (Bt(h) > P ? B = z.LINE : B = z.BAR, oe = Bt(h), H = h.map((R) => ({ ...R, data: Oa(R, (Oe) => le(Oe)) }))), h = h.map((R) => Dt(R)), H = H.map((R) => Dt(R)); } return Pe(h) && [...new Set(h.flatMap((Se) => Array.isArray(Se)))][0], { dataset: h, type: B, usableDataset: H, maxSeriesLength: oe }; } function Ut(h) { return !h || Pe(h) && !h.length; } function Pe(h) { return Array.isArray(h); } function le(h) { if (!Pe(h) || Ut(h)) return !1; const P = h.map((S) => Number(S)); return ![...new Set(P.flatMap((S) => typeof S == "number" && !isNaN(S)))].includes(!1); } function je(h) { return !Pe(h) || Ut(h) || !![...new Set(h.flatMap((S) => typeof S == "object" && !Array.isArray(S)))].includes(!1) ? !1 : !h.map((S) => Object.keys(S).length > 0).includes(!1); } function Ea(h, P) { const S = Object.keys(h).sort(), B = Object.keys(P).sort(); if (S.length !== B.length) return !1; for (let H = 0; H < S.length; H += 1) { const oe = S[H], be = B[H]; if (oe !== be || typeof h[oe] != typeof P[be]) return !1; } return !0; } function Ta(h) { if (h.length <= 1) return !0; for (let P = 0; P < h.length; P += 1) for (let S = P + 1; S < h.length; S += 1) if (!Ea(h[P], h[S])) return !1; return !0; } function Pa(h) { return $a.includes(h.toUpperCase()); } function Nt(h, P) { let S = []; for (let B = 0; B < h.length; B += 1) S.push(P(h[B])); return S.includes(!0); } function Bt(h) { return Math.max(...[...h].flatMap((P) => Object.values(P).filter((S) => le(S)).map((S) => S.length))); } function Oa(h, P) { return Object.values(h).filter((S) => P(S))[0]; } function Dt(h) { const P = {}; for (let S in h) h.hasOwnProperty(S) && (P[S.toUpperCase()] = h[S]); return P; } const Ra = ["id"], Ma = ["id"], Fa = ["xmlns", "viewBox"], Na = ["x", "y", "width", "height"], Ba = ["x", "y", "width", "height"], Da = ["width", "height"], Ua = ["id"], Va = ["id"], Ha = ["id"], qa = ["flood-color"], Wa = { key: 0, class: "donut-label-connectors" }, Xa = ["d", "stroke", "stroke-width", "filter"], ja = ["cx", "cy", "r", "fill", "filter"], Ga = { class: "donut" }, Ya = ["d", "fill", "stroke", "stroke-width", "filter"], Za = ["d", "onMouseenter", "onMouseout", "onClick"], Ja = { key: 1, class: "donut-labels quick-animation" }, Qa = ["cx", "cy", "fill", "stroke", "filter"], Ka = ["text-anchor", "x", "y", "fill", "font-size", "filter"], el = ["text-anchor", "x", "y", "fill", "font-size", "filter"], tl = { key: 2, class: "donut-hollow quick-animation" }, al = ["x", "y", "font-size", "fill"], ll = ["x", "y", "font-size", "fill"], ol = { key: 0, class: "line-grid" }, nl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], il = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ul = { key: 1, class: "line-axis" }, rl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], sl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], vl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], dl = ["x", "y", "font-size", "fill"], cl = { key: 3, class: "periodLabels" }, hl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], fl = { key: 0 }, gl = ["font-size", "text-anchor", "fill", "transform"], ml = ["font-size", "text-anchor", "fill", "transform", "innerHTML"], pl = { class: "plots" }, xl = { class: "line-plot-series" }, yl = ["d", "stroke", "stroke-width"], kl = ["d", "stroke", "stroke-width"], bl = ["d", "stroke", "stroke-width"], Sl = ["d", "stroke", "stroke-width"], wl = ["cx", "cy", "fill", "stroke"], Al = { key: 4, class: "dataLabels" }, Ll = ["font-size", "fill", "x", "y"], _l = { key: 5, class: "tooltip-traps" }, zl = ["x", "y", "height", "width", "fill", "onMouseenter", "onMouseleave", "onClick"], Cl = { key: 0, class: "line-grid" }, $l = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Il = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], El = { key: 1, class: "line-axis" }, Tl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Pl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ol = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Rl = ["x", "y", "font-size", "fill"], Ml = { key: 3, class: "periodLabels" }, Fl = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Nl = { key: 0 }, Bl = ["font-size", "text-anchor", "fill", "transform"], Dl = ["font-size", "text-anchor", "fill", "transform", "innerHTML"], Ul = { class: "plots" }, Vl = ["x", "width", "height", "y", "fill", "stroke", "stroke-width"], Hl = ["to"], ql = ["from", "to"], Wl = { key: 4, class: "dataLabels" }, Xl = ["x", "y", "font-size", "fill"], jl = { key: 5, class: "tooltip-traps" }, Gl = ["x", "y", "height", "width", "fill", "onMouseenter", "onMouseleave", "onClick"], Yl = { key: 6, class: "axis-labels" }, Zl = ["font-size", "fill", "x", "y"], Jl = ["font-size", "fill", "x", "y"], Ql = ["font-size", "fill", "transform"], Kl = ["font-size", "fill", "transform"], eo = { key: 5, class: "vue-data-ui-watermark" }, to = ["id"], ao = ["onClick"], lo = ["onClick"], oo = ["onClick"], no = { key: 1, class: "vue-ui-quick-chart-not-processable" }, io = { __name: "vue-ui-quick-chart", props: { config: { type: Object, default() { return {}; } }, dataset: { type: [Array, Object, String, Number], default() { return null; } } }, emits: ["selectDatapoint", "selectLegend"], setup(h, { expose: P, emit: S }) { const B = $e(() => import("./BaseIcon-CCivwZUq.js")), H = $e(() => import("./PackageVersion-5ZjKSIei.js")), oe = $e(() => import("./PenAndPaper-BJ0hcgsa.js")), be = $e(() => import("./Tooltip-BMOddG-M.js")), ot = $e(() => import("./UserOptions-DVzyjG-W.js")), { vue_ui_quick_chart: Se } = ua(), M = h, R = w(null), Oe = w(null), nt = w(null), it = w(null), X = w(ra()), re = w(!1), we = w(null), se = w(""), Z = w(null), ut = w(null), rt = w(null), A = w([]), st = w(0), Re = w(0), vt = w(!1), J = w(null), Me = w(null), dt = w(null), ct = w(null), Fe = w("#FFFFFF"), e = w(Ze()), Ge = N(() => !!e.value.debug), { loading: D, FINAL_DATASET: Vt, manualLoading: ht } = _a({ ...aa(M), FINAL_CONFIG: e, prepareConfig: Ze, skeletonDataset: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89], skeletonConfig: sa({ defaultConfig: e.value, userConfig: { backgroundColor: "#99999930", customPalette: ["#BABABA"], showDataLabels: !1, paletteStartIndex: 0, showUserOptions: !1, showTooltip: !1, xAxisLabel: "", yAxisLabel: "", xyAxisStroke: "#999999", xyGridStroke: "#99999950", xyPeriods: [], xyShowScale: !1, xyPaddingLeft: 6, xyPaddingBottom: 12, zoomXy: !1, zoomStartIndex: null, zoomEndIndex: null } }) }), { svgRef: ft } = Sa({ config: { text: e.value.title } }), Ht = N(() => e.value.showUserOptionsOnChartHover), gt = N(() => e.value.keepUserOptionsStateOnChartLeave), Ne = w(!e.value.showUserOptionsOnChartHover), Ye = w(!1); function mt(l = !1) { Ye.value = l, Ht.value && (Ne.value = l); } function Ze() { const l = Ft({ userConfig: M.config, defaultConfig: Se }); let c = {}; return l.theme ? c = { ...Ft({ userConfig: da.vue_ui_quick_chart[l.theme] || M.config, defaultConfig: l }), customPalette: va[l.theme] || G } : c = l, M.config && We(M.config, "zoomStartIndex") ? c.zoomStartIndex = M.config.zoomStartIndex : c.zoomStartIndex = null, M.config && We(M.config, "zoomEndIndex") ? c.zoomEndIndex = M.config.zoomEndIndex : c.zoomEndIndex = null, M.config && !We(M.config, "donutStroke") ? We(M.config, "backgroundColor") ? Fe.value = M.config.backgroundColor : Fe.value = "#FFFFFF" : Fe.value = M.config.donutStroke, c; } Ie(() => M.config, (l) => { D.value || (e.value = Ze()), b.value.width = e.value.width, b.value.height = e.value.height, Ne.value = !e.value.showUserOptionsOnChartHover, yt(), me.value.showTooltip = e.value.showTooltip; }, { deep: !0 }), Ie(() => M.dataset, (l) => { k.value = Le.value, m.value.start = 0, m.value.end = k.value.maxSeriesLength, Re.value += 1; }, { deep: !0 }), Ie(() => M.dataset, (l) => { Array.isArray(l) && l.length > 0 && (ht.value = !1); }, { immediate: !0 }); const Ae = N(() => ca(e.value.customPalette)), ge = S, Le = N(() => { const l = Ia({ debug: Ge.value, dataset: ha(Vt.value, [ "serie", "series", "data", "value", "values", "num" ]), barLineSwitch: e.value.chartIsBarUnderDatasetLength }); return !l && Ge.value && console.error("VueUiQuickChart : Dataset is not processable"), l; }), k = w(Le.value), qt = N(() => !!k.value), $ = N(() => k.value ? k.value.type : null); Ie(() => $.value, (l) => { l || fa({ componentName: "VueUiQuickChart", type: "dataset", debug: Ge.value }); }, { immediate: !0 }); const { isPrinting: Be, isImaging: De, generatePdf: pt, generateImage: xt } = ka({ elementId: `${$.value}_${X.value}`, fileName: e.value.title || $.value, options: e.value.userOptionsPrint }), Wt = N(() => e.value.showUserOptions && !e.value.title), b = w({ width: e.value.width, height: e.value.height }), me = w({ showTooltip: e.value.showTooltip }); Ie(e, () => { me.value = { showTooltip: e.value.showTooltip }; }, { immediate: !0 }); const ne = It(null), pe = It(null); la(() => { vt.value = !0, yt(); }); function yt() { if (ga(M.dataset) || (ht.value = e.value.loading), e.value.responsive) { const l = Mt(() => { const { width: c, height: t } = ya({ chart: R.value, title: e.value.title ? Oe.value : null, legend: e.value.showLegend ? nt.value : null, slicer: [z.BAR, z.LINE].includes($.value) && e.value.zoomXy && k.value.maxSeriesLength > 1 ? it.value : null, source: ut.value, noTitle: rt.value }); requestAnimationFrame(() => { b.value.width = c, b.value.height = t; }); }); ne.value && (pe.value && ne.value.unobserve(pe.value), ne.value.disconnect()), ne.value = new ResizeObserver(l), pe.value = R.value.parentNode, ne.value.observe(pe.value); } _t(); } Et(() => { ne.value && (pe.value && ne.value.unobserve(pe.value), ne.value.disconnect()); }); const Xt = N(() => { switch ($.value) { case z.LINE: return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`; case z.BAR: return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`; case z.DONUT: return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`; default: return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`; } }); function kt(l) { return [...l].map((c) => c.value).reduce((c, t) => c + t, 0); } function _e(l) { return e.value.blurOnHover && ![null, void 0].includes(Z.value) && Z.value !== l ? `url(#blur_${X.value})` : ""; } function bt(l, c) { A.value.includes(l) ? A.value = A.value.filter((t) => t !== l) : A.value.length < c && A.value.push(l); } const St = w(null), wt = w(null), Ue = w(!1); function jt(l, c) { Ue.value = !0; let t = l.value; const i = Le.value.dataset.find((u, x) => l.id === `donut_${x}`).VALUE; if (A.value.includes(l.id)) { let u = function() { t > i ? (Ue.value = !1, cancelAnimationFrame(wt.value), k.value = { ...k.value, dataset: k.value.dataset.map((x, _) => l.id === `donut_${_}` ? { ...x, value: i, VALUE: i } : x) }) : (t += i * 0.025, k.value = { ...k.value, dataset: k.value.dataset.map((x, _) => l.id === `donut_${_}` ? { ...x, value: t, VALUE: t } : x) }, wt.value = requestAnimationFrame(u)); }; A.value = A.value.filter((x) => x !== l.id), u(); } else if (c.length > 1) { let u = function() { t < i / 100 ? (Ue.value = !1, cancelAnimationFrame(St.value), A.value.push(l.id), k.value = { ...k.value, dataset: k.value.dataset.map((x, _) => l.id === `donut_${_}` ? { ...x, value: 0, VALUE: 0 } : x) }) : (t /= 1.1, k.value = { ...k.value, dataset: k.value.dataset.map((x, _) => l.id === `donut_${_}` ? { ...x, value: t, VALUE: t } : x) }, St.value = requestAnimationFrame(u)); }; u(); } } const Q = w(null); function Gt(l) { Q.value = l; } const At = N(() => e.value.donutThicknessRatio < 0.01 ? 0.01 : e.value.donutThicknessRatio > 0.4 ? 0.4 : e.value.donutThicknessRatio), T = N(() => { if ($.value !== z.DONUT) return null; const l = k.value.dataset.map((f, C) => ({ ...f, value: f.VALUE || f.DATA || f.SERIE || f.VALUES || f.NUM || 0, name: f.NAME || f.DESCRIPTION || f.TITLE || f.LABEL || `Serie ${C}`, id: `donut_${C}` })).map((f, C) => ({ ...f, color: f.COLOR ? tt(f.COLOR) : Ae.value[C + e.value.paletteStartIndex] || G[C + e.value.paletteStartIndex] || G[(C + e.value.paletteStartIndex) % G.length], immutableValue: f.value })); function c(f, C) { return W({ v: isNaN(f.value / kt(C)) ? 0 : f.value / kt(C) * 100, s: "%", r: e.value.dataLabelRoundingPercentage }); } function t(f) { return f.proportion * 100 > e.value.donutHideLabelUnderPercentage; } function i(f, C) { const v = Le.value.dataset.find((y, E) => `donut_${E}` === f).VALUE; return Math.abs(String(Number(v.toFixed(0))).length - String(Number(C.toFixed(0))).length); } function u({ datapoint: f, seriesIndex: C }) { we.value = { datapoint: f, seriesIndex: C, config: e.value, dataset: l }, Z.value = f.id; const v = e.value.tooltipCustomFormat; if (e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: f, seriesIndex: C }), Xe(v) && lt(() => v({ datapoint: f, seriesIndex: C, series: l, config: e.value }))) se.value = v({ datapoint: f, seriesIndex: C, series: l, config: e.value }); else { let n = ""; n += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${f.name}</div>`, n += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${f.color}"/></svg>`, n += `<b>${te( e.value.formatter, f.value, W({ p: e.value.valuePrefix, v: f.value, s: e.value.valueSuffix, r: e.value.dataLabelRoundingValue }), { datapoint: f, seriesIndex: C } )}</b>`, n += `<span>(${W({ v: f.proportion * 100, s: "%", r: e.value.dataLabelRoundingPercentage })})</span></div>`, se.value = `<div>${n}</div>`; } re.value = !0; } function x({ datapoint: f, seriesIndex: C }) { e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: f, seriesIndex: C }), re.value = !1, Z.value = null, Q.value = null; } function _({ datapoint: f, seriesIndex: C }) { e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: f, seriesIndex: C }), ge("selectDatapoint", f); } const ie = { centerX: b.value.width / 2, centerY: b.value.height / 2 }, j = l.filter((f) => !A.value.includes(f.id)).map((f) => f.value || 0).reduce((f, C) => f + C, 0), ye = l.map((f, C) => ({ ...f, proportion: (f.value || 0) / j, value: f.value || 0, absoluteValue: Le.value.dataset.find((v, n) => `donut_${n}` === f.id).VALUE })), ve = b.value.width / 2, ue = b.value.height / 2, K = b.value.height * e.value.donutRadiusRatio; return { dataset: ye.filter((f) => !A.value.includes(f.id)), legend: ye, drawingArea: ie, displayArcPercentage: c, isArcBigEnough: t, useTooltip: u, killTooltip: x, selectDatapoint: _, getSpaces: i, total: j, cx: ve, cy: ue, radius: K, chart: ma( { series: l.filter((f) => !A.value.includes(f.id)) }, ve, ue, K, K, 1.99999, 2, 1, 360, 105.25, b.value.height * At.value ) }; }), m = w({ start: 0, end: k.value.maxSeriesLength }); function Yt() { _t(); } const Lt = w(null); async function _t() { await Tt(), await Tt(); const { zoomStartIndex: l, zoomEndIndex: c } = e.value, t = Lt.value; (l != null || c != null) && t ? (l != null && t.setStartValue(l), c != null && t.setEndValue(Zt(c + 1))) : (m.value = { start: 0, end: k.value.maxSeriesLength }, Re.value += 1); } function Zt(l) { const c = k.value.maxSeriesLength; return l > c ? c : l < 0 || e.value.zoomStartIndex !== null && l < e.value.zoomStartIndex ? e.value.zoomStartIndex !== null ? e.value.zoomStartIndex + 1 : 1 : l; } const Jt = N(() => { if (!e.value.zoomMinimap.show || $.value === z.DONUT) return []; let l = []; le(k.value.dataset) && (l = k.value.dataset), je(k.value.dataset) && (l = k.value.dataset.map((u, x) => ({ values: u.VALUE || u.DATA || u.SERIE || u.SERIES || u.VALUES || u.NUM || 0, id: $.value === z.LINE ? `line_${x}` : `bar_${x}` })).filter((u) => !A.value.includes(u.id))); const c = le(l) ? l.length : Math.max(...l.map((u) => u.values.length)); let t = []; if (le(l)) t = l; else for (let u = 0; u < c; u += 1) t.push(l.map((x) => x.values[u] || 0).reduce((x, _) => (x || 0) + (_ || 0), 0)); const i = Math.min(...t); return t.map((u) => u + (i < 0 ? Math.abs(i) : 0)); }); function zt() { let l = 0; return Me.value && (l = Array.from(Me.value.querySelectorAll("text")).reduce((i, u) => { const x = u.getComputedTextLength(); return x > i ? x : i; }, 0)), l + 4; } const Je = w(0), Qt = Mt((l) => { Je.value = l; }, 100); oa((l) => { const c = J.value; if (!c) return; const t = new ResizeObserver((i) => { Qt(i[0].contentRect.height); }); t.observe(c), l(() => t.disconnect()); }), Et(() => { Je.value = 0; }); const Ve = N(() => { let l = 0, c = 0; return J.value && (c = Je.value), l + c; }), d = N(() => { if ($.value !== z.LINE) return null; const l = { height: b.value.height, width: b.value.width }; let c = zt(); if (J.value) { const v = J.value.getBBox().x; v < 0 && (c += Math.abs(v)); } const t = { left: c + e.value.xyPaddingLeft, top: e.value.xyPaddingTop, right: l.width - e.value.xyPaddingRight, bottom: l.height - e.value.xyPaddingBottom - Ve.value, width: Math.max(10, l.width - e.value.xyPaddingLeft - e.value.xyPaddingRight - c), height: Math.max(10, l.height - e.value.xyPaddingTop - e.value.xyPaddingBottom - Ve.value) }; let i = []; le(k.value.dataset) && (i = [ { values: k.value.dataset.slice(m.value.start, m.value.end), absoluteIndices: k.value.dataset.map((v, n) => n).slice(m.value.start, m.value.end), name: e.value.title, color: Ae.value[e.value.paletteStartIndex] || G[e.value.paletteStartIndex], id: "line_0" } ]), je(k.value.dataset) && (i = k.value.dataset.map((v, n) => ({ ...v, values: v.VALUE || v.DATA || v.SERIE || v.SERIES || v.VALUES || v.NUM || 0, name: v.NAME || v.DESCRIPTION || v.TITLE || v.LABEL || `Serie ${n}`, id: `line_${n}` })).map((v, n) => ({ ...v, color: v.COLOR ? tt(v.COLOR) : Ae.value[n + e.value.paletteStartIndex] || G[n + e.value.paletteStartIndex] || G[(n + e.value.paletteStartIndex) % G.length], values: v.values.slice(m.value.start, m.value.end), absoluteIndices: v.values.map((y, E) => E).slice(m.value.start, m.value.end) }))); const u = { max: Math.max(...i.filter((v) => !A.value.includes(v.id)).flatMap((v) => v.values)), min: Math.min(...i.filter((v) => !A.value.includes(v.id)).flatMap((v) => v.values)), maxSeries: Math.max(...i.map((v) => v.values.length)) }, x = Pt(u.min < 0 ? u.min : 0, u.max < 0 ? 0 : u.max, e.value.xyScaleSegments), _ = u.min < 0 ? Math.abs(u.min) : 0, ie = u.max < 0 ? t.top : t.bottom - _ / (x.max + _) * t.height, j = t.width / u.maxSeries, ye = x.ticks.map((v) => ({ y: t.bottom - t.height * ((v + _) / (x.max + _)), x: t.left - 8, value: v })), ve = i.map((v, n) => ({ ...v, coordinates: v.values.map((y, E) => ({ x: t.left + j * (E + 1) - j / 2, y: t.bottom - (y + _) / (x.max + _) * t.height, value: y })) })).map((v) => { let n = []; return v.coordinates.forEach((y) => { n.push(`${y.x},${y.y} `); }), { ...v, linePath: n.join(" ") }; }); function ue(v) { return i.map((n) => ({ ...n, value: n.values[v], absoluteIndex: n.absoluteIndices[v] })).filter((n) => !A.value.includes(n.id)); } function K(v) { Z.value = v, Q.value = v; const n = ue(v); we.value = { datapoint: n, seriesIndex: v, config: e.value, dataset: i }; const y = e.value.tooltipCustomFormat; if (e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: n, seriesIndex: v + m.value.start }), Xe(y) && lt(() => y({ datapoint: n, seriesIndex: v, series: i, config: e.value }))) se.value = y({ datapoint: n, seriesIndex: v, series: i, config: e.value }); else { let E = ""; Y.value[n[0].absoluteIndex] && (E += `<div style="border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${Y.value[n[0].absoluteIndex].text}</div>`), n.forEach((V, q) => { E += ` <div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;"> <svg viewBox="0 0 12 12" height="14" width="12"><circle cx="6" cy="6" r="6" stroke="none" fill="${V.color}"/></svg> <span>${V.name}:</span> <b>${te( e.value.formatter, V.value, W({ p: e.value.valuePrefix, v: V.value, s: e.value.valueSuffix, r: e.value.dataLabelRoundingValue }), { datapoint: V, seriesIndex: q } )} </b> </div> `; }), se.value = E; } re.value = !0; } function f(v) { const n = ue(v); e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: n, seriesIndex: v + m.value.start }), Z.value = null, Q.value = null, re.value = !1; } function C(v) { const n = ue(v); e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: n, seriesIndex: v + m.value.start }), ge("selectDatapoint", n); } return { absoluteZero: ie, dataset: ve.filter((v) => !A.value.includes(v.id)), legend: ve, drawingArea: t, extremes: u, slotSize: j, yLabels: ye, useTooltip: K, killTooltip: f, selectDatapoint: C }; }), s = N(() => { if ($.value !== z.BAR) return null; const l = { height: b.value.height, width: b.value.width }; let c = zt(); if (J.value) { const n = J.value.getBBox().x; n < 0 && (c += Math.abs(n)); } const t = { left: c + e.value.xyPaddingLeft, top: e.value.xyPaddingTop, right: l.width - e.value.xyPaddingRight, bottom: l.height - e.value.xyPaddingBottom - Ve.value, width: Math.max(10, l.width - e.value.xyPaddingLeft - e.value.xyPaddingRight - c), height: Math.max(10, l.height - e.value.xyPaddingTop - e.value.xyPaddingBottom - Ve.value) }; let i = []; le(k.value.dataset) && (i = [ { values: k.value.dataset.slice(m.value.start, m.value.end), absoluteIndices: k.value.dataset.map((n, y) => y).slice(m.value.start, m.value.end), name: e.value.title, color: Ae.value[e.value.paletteStartIndex] || G[e.value.paletteStartIndex], id: "bar_0" } ]), je(k.value.dataset) && (i = k.value.dataset.map((n, y) => ({ ...n, values: n.VALUE || n.DATA || n.SERIE || n.SERIES || n.VALUES || n.NUM || 0, name: n.NAME || n.DESCRIPTION || n.TITLE || n.LABEL || `Serie ${y}`, id: `bar_${y}` })).map((n, y) => ({ ...n, color: n.COLOR ? tt(n.COLOR) : Ae.value[y + e.value.paletteStartIndex] || G[y + e.value.paletteStartIndex] || G[(y + e.value.paletteStartIndex) % G.length], values: n.values.slice(m.value.start, m.value.end), absoluteIndices: n.values.map((E, V) => V).slice(m.value.start, m.value.end) }))); const u = { max: Math.max(...i.filter((n) => !A.value.includes(n.id)).flatMap((n) => n.values)) < 0 ? 0 : Math.max(...i.filter((n) => !A.value.includes(n.id)).flatMap((n) => n.values)), min: Math.min(...i.filter((n) => !A.value.includes(n.id)).flatMap((n) => n.values)), maxSeries: Math.max(...i.filter((n) => !A.value.includes(n.id)).map((n) => n.values.length)) }, x = Pt(u.min < 0 ? u.min : 0, u.max, e.value.xyScaleSegments), _ = x.min < 0 ? Math.abs(x.min) : 0, ie = t.bottom - _ / (x.max + _) * t.height, j = t.width / u.maxSeries, ye = x.ticks.map((n) => ({ y: t.bottom - t.height * ((n + _) / (x.max + _)), x: t.left - 8, value: n })), ve = i.map((n, y) => ({ ...n, coordinates: n.values.map((E, V) => { const q = (E + _) / (u.max + _) * t.height, ze = Math.abs(E) / Math.abs(u.min) * (t.height - ie), Ke = _ / (u.max + _) * t.height, Ce = j / i.filter((de) => !A.value.includes(de.id)).length - e.value.barGap / i.filter((de) => !A.value.includes(de.id)).length; return { x: t.left + j * V + Ce * y + e.value.barGap / 2, y: E > 0 ? t.bottom - q : ie, height: E > 0 ? q - Ke : ze, value: E, width: Ce }; }) })), ue = i.filter((n) => !A.value.includes(n.id)).map((n, y) => ({ ...n, coordinates: n.values.map((E, V) => { const q = (E + _) / (u.max + _) * t.height, ze = Math.abs(E) / (u.max + _) * t.height, Ke = _ / (u.max + _) * t.height, Ce = j / i.filter((de) => !A.value.includes(de.id)).length - e.value.barGap / i.filter((de) => !A.value.includes(de.id)).length; return { x: t.left + j * V + Ce * y + e.value.barGap / 2, y: E > 0 ? t.bottom - q : ie, height: E > 0 ? q - Ke : ze, value: E, width: Ce }; }) })); function K(n) { return i.map((y) => ({ ...y, value: y.values[n], absoluteIndex: y.absoluteIndices[n] })).filter((y) => !A.value.includes(y.id)); } function f(n) { Z.value = n, Q.value = n; const y = K(n); we.value = { datapoint: y, seriesIndex: n, config: e.value, dataset: i }; const E = e.value.tooltipCustomFormat; if (e.value.events.datapointEnter && e.value.events.datapointEnter({ datapoint: y, seriesIndex: n + m.value.start }), Xe(E) && lt(() => E({ datapoint: y, seriesIndex: n, series: i, config: e.value }))) se.value = E({ point: y, seriesIndex: n, series: i, config: e.value }); else { let V = ""; Y.value[y[0].absoluteIndex] && (V += `<div style="border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${Y.value[y[0].absoluteIndex].text}</div>`), y.forEach((q, ze) => { V += ` <div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;"> <svg viewBox="0 0 12 12" height="14" width="12"><rect x=0 y="0" width="12" height="12" rx="1" stroke="none" fill="${q.color}"/></svg> <span>${q.name}:</span> <b>${te( e.value.formatter, q.value, W({ p: e.value.valuePrefix, v: q.value, s: e.value.valueSuffix, r: e.value.dataLabelRoundingValue }), { datapoint: q, seriesIndex: ze } )} </b> </div> `; }), se.value = V; } re.value = !0; } function C(n) { const y = K(n); e.value.events.datapointLeave && e.value.events.datapointLeave({ datapoint: y, seriesIndex: n + m.value.start }), re.value = !1, Z.value = null, Q.value = null; } function v(n) { const y = K(n); e.value.events.datapointClick && e.value.events.datapointClick({ datapoint: y, seriesIndex: n + m.value.start }), ge("selectDatapoint", y); } return { absoluteZero: ie, dataset: ue.filter((n) => !A.value.includes(n.id)), legend: ve, drawingArea: t, extremes: u, slotSize: j, yLabels: ye, useTooltip: f, killTooltip: C, selectDatapoint: v }; }), Y = N(() => ba({ values: e.value.xyPeriods, maxDatapoints: k.value.maxSeriesLength, formatter: e.value.datetimeFormatter, start: m.value.start, end: m.value.end })), xe = N(() => { const l = e.value.xyPeriodsModulo; return e.value.xyPeriods.length ? Math.min(l, [...new Set(Y.value.map((c) => c.text))].length) : l; }), He = w(!1); function Ct(l) { He.value = l, st.value += 1; } function $t() { me.value.showTooltip = !me.value.showTooltip; } const qe = w(!1); function Qe() { qe.value = !qe.value; } async function Kt({ scale: l = 2 } = {}) { if (!R.value) return; const { width: c, height: t } = R.value.getBoundingClientRect(), i = c / t, { imageUri: u, base64: x } = await Aa({ domElement: R.value, base64: !0, img: !0, scale: l }); return { imageUri: u, base64: x, title: e.value.title, width: c, height: t, aspectRatio: i }; } const ea = N(() => b.value.width), ta = N(() => b.value.height); return wa({ timeLabelsEls: J, timeLabels: Y, slicer: m, configRef: e, rotationPath: ["xyPeriodLabelsRotation"], autoRotatePath: ["xyPeriodLabelsAutoRotate", "enable"], isAutoSize: !1, rotation: e.value.xyPeriodLabelsAutoRotate.angle, height: ta.value, width: ea.value }), P({ getImage: Kt, generatePdf: pt, generateImage: xt, toggleTooltip: $t, toggleAnnotator: Qe, toggleFullscreen: Ct }), (l, c) => qt.value ? (a(), o("div", { key: 0, id: `${$.value}_${X.value}`, ref_key: "quickChart", ref: R, class: ce({ "vue-ui-quick-chart": !0, "vue-data-ui-wrapper-fullscreen": He.value }), style: O(`background:${e.value.backgroundColor};color:${e.value.color};font-family:${e.value.fontFamily}; position: relative; ${e.value.responsive ? "height: 100%" : ""}`), onMouseenter: c[2] || (c[2] = () => mt(!0)), onMouseleave: c[3] || (c[3] = () => mt(!1)) }, [ e.value.userOptionsButtons.annotator ? (a(), Ee(r(oe), { key: 0, svgRef: r(ft), backgroundColor: e.value.backgroundColor, color: e.value.color, active: qe.value, onClose: Qe }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : g("", !0), Wt.value ? (a(), o("div", { key: 1, ref_key: "noTitle", ref: rt, class: "vue-data-ui-no-title-space", style: "height:36px; width: 100%;background:transparent" }, null, 512)) : g("", !0), e.value.showUserOptions && (gt.value || Ne.value) ? (a(), Ee(r(ot), { ref: "details", key: `user_option_${st.value}`, backgroundColor: e.value.backgroundColor, color: e.value.color, isPrinting: r(Be), isImaging: r(De), uid: X.value, hasTooltip: e.value.userOptionsButtons.tooltip && e.value.showTooltip, hasPdf: e.value.userOptionsButtons.pdf, hasImg: e.value.userOptionsButtons.img, hasFullscreen: e.value.userOptionsButtons.fullscreen, hasXls: !1, isTooltip: me.value.showTooltip, isFullscreen: He.value, titles: { ...e.value.userOptionsButtonTitles }, chartElement: R.value, position: e.value.userOptionsPosition, hasAnnotator: e.value.userOptionsButtons.annotator, isAnnotation: qe.value, callbacks: e.value.userOptionsCallbacks, printScale: e.value.userOptionsPrint.scale, onToggleFullscreen: Ct, onGeneratePdf: r(pt), onGenerateImage: r(xt), onToggleTooltip: $t, onToggleAnnotator: Qe, style: O({ visibility: gt.value ? Ne.value ? "visible" : "hidden" : "visible" }) }, na({ _: 2 }, [ l.$slots.menuIcon ? { name: "menuIcon", fn: ee(({ isOpen: t, color: i }) => [ U(l.$slots, "menuIcon", he(fe({ isOpen: t, color: i })), void 0, !0) ]), key: "0" } : void 0, l.$slots.optionTooltip ? { name: "optionTooltip", fn: ee(() => [ U(l.$slots, "optionTooltip", {}, void 0, !0) ]), key: "1" } : void 0, l.$slots.optionPdf ? { name: "optionPdf", fn: ee(() => [ U(l.$slots, "optionPdf", {}, void 0, !0) ]), key: "2" } : void 0, l.$slots.optionImg ? { name: "optionImg", fn: ee(() => [ U(l.$slots, "optionImg", {}, void 0, !0) ]), key: "3" } : void 0, l.$slots.optionFullscreen ? { name: "optionFullscreen", fn: ee(({ toggleFullscreen: t, isFullscreen: i }) => [ U(l.$slots, "optionFullscreen", he(fe({ toggleFullscreen: t, isFullscreen: i })), void 0, !0) ]), key: "4" } : void 0, l.$slots.optionAnnotator ? { name: "optionAnnotator", fn: ee(({ toggleAnnotator: t, isAnnotator: i }) => [ U(l.$slots, "optionAnnotator", he(fe({ toggleAnnotator: t, isAnnotator: i })), void 0, !0) ]), key: "5" } : void 0 ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasFullscreen", "isTooltip", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "callbacks", "printScale", "onGeneratePdf", "onGenerateImage", "style"])) : g("", !0), e.value.title ? (a(), o("div", { key: 3, ref_key: "quickChartTitle", ref: Oe, class: "vue-ui-quick-chart-title", style: O(`background:transparent;color:${e.value.color};font-size:${e.value.titleFontSize}px;font-weight:${e.value.titleBold ? "bold" : "normal"};text-align:${e.value.titleTextAlign}`) }, F(e.value.title), 5)) : g("", !0), L("div", { id: `legend-top-${X.value}` }, null, 8, Ma), $.value ? (a(), o("svg", { key: 4, ref_key: "svgRef", ref: ft, xmlns: r(pa), viewBox: Xt.value, style: O(`max-width:100%;overflow:visible;background:transparent;color:${e.value.color}`) }, [ ke(r(H)), l.$slots["chart-background"] && $.value === z.BAR ? (a(), o("foreignObject", { key: 0, x: s.value.drawingArea.left, y: s.value.drawingArea.top, width: s.value.drawingArea.width, height: s.value.drawingArea.height, style: { pointerEvents: "none" } }, [ U(l.$slots, "chart-background", {}, void 0, !0) ], 8, Na)) : g("", !0), l.$slots["chart-background"] && $.value === z.LINE ? (a(), o("foreignObject", { key: 1, x: d.value.drawingArea.left, y: d.value.drawingArea.top, width: d.value.drawingArea.width, height: d.value.drawingArea.height, style: { pointerEvents: "none" } }, [ U(l.$slots, "chart-background", {}, void 0, !0) ], 8, Ba)) : g("", !0), l.$slots["chart-background"] && $.value === z.DONUT ? (a(), o("foreignObject", { key: 2, x: 0, y: 0, width: b.value.width, height: b.value.height, style: { pointerEvents: "none" } }, [ U(l.$slots, "chart-background", {}, void 0, !0) ], 8, Da)) : g("", !0), L("defs", null, [ L("filter", { id: `blur_${X.value}`, x: "-50%", y: "-50%", width: "200%", height: "200%" }, [ L("feGaussianBlur", { in: "SourceGraphic", stdDeviation: 2, id: `blur_std_${X.value}` }, null, 8, Va), c[4] || (c[4] = L("feColorMatrix", { type: "saturate", values: "0" }, null, -1)) ], 8, Ua), L("filter", { id: `shadow_${X.value}`, "color-interpolation-filters": "sRGB" }, [ L("feDropShadow", { dx: "0", dy: "0", stdDeviation: "10", "flood-opacity": "0.5", "flood-color": e.value.donutShadowColor }, null, 8, qa) ], 8, Ha) ]), $.value === z.DONUT ? (a(), o(p, { key: 3 }, [ e.value.showDataLabels ? (a(), o("g", Wa, [ (a(!0), o(p, null, I(T.value.chart, (t, i) => (a(), o(p, null, [ T.value.isArcBigEnough(t) ? (a(), o("path", { key: 0, d: r(xa)(t, { x: b.value.width / 2, y: b.value.height / 2 }, 16, 16, !1, !1, b.value.height * At.value, 12, e.value.donutCurvedMarkers), stroke: t.color, "stroke-width": e.value.donutLabelMarkerStrokeWidth, "stroke-linecap": "round", "stroke-linejoin": "round", fill: "none", filter: _e(t.id) }, null, 8, Xa)) : g("", !0) ], 64))), 256)) ])) : g("", !0), L("circle", { cx: T.value.cx, cy: T.value.cy, r: T.value.radius, fill: e.value.backgroundColor, filter: e.value.donutUseShadow ? `url(#shadow_${X.value})` : "" }, null, 8, ja), L("g", Ga, [ (a(!0), o(p, null, I(T.value.chart, (t, i) => (a(), o("path", { d: t.arcSlice, fill: t.color, stroke: Fe.value, "stroke-width": e.value.donutStrokeWidth, filter: _e(t.id) }, null, 8, Ya))), 256)), (a(!0), o(p, null, I(T.value.chart, (t, i) => (a(), o("path", { d: t.arcSlice, fill: "transparent", onMouseenter: (u) => T.value.useTooltip({ datapoint: t, seriesIndex: i }), onMouseout: (u) => T.value.killTooltip({ datapoint: t, seriesIndex: i }), onClick: (u) => T.value.selectDatapoint({ datapoint: t, seriesIndex: i }) }, null, 40, Za))), 256)) ]), e.value.showDataLabels ? (a(), o("g", Ja, [ (a(!0), o(p, null, I(T.value.chart, (t, i) => (a(), o(p, null, [ T.value.isArcBigEnough(t) ? (a(), o("circle", { key: 0, cx: r(Te)(t).x, cy: r(at)(t) - 3.7, fill: t.color, stroke: e.value.backgroundColor, "stroke-width": 1, r: 3, filter: _e(t.id) }, null, 8, Qa)) : g("", !0), T.value.isArcBigEnough(t) ? (a(), o("text", { key: 1, "text-anchor": r(Te)(t, !0, 20).anchor, x: r(Te)(t, !0).x, y: r(at)(t), fill: e.value.color, "font-size": e.value.dataLabelFontSize, filter: _e(t.id) }, F(T.value.displayArcPercentage(t, T.value.chart)) + " (" + F(r(te)( e.value.formatter, t.value, r(W)({ p: e.value.valuePrefix, v: t.value, s: e.value.valueSuffix, r: e.value.dataLabelRoundingValue }), { datapoint: t, seriesIndex: i } )) + ") ", 9, Ka)) : g("", !0), T.value.isArcBigEnough(t, !0, 20) ? (a(), o("text", { key: 2, "text-anchor": r(Te)(t).anchor, x: r(Te)(t, !0).x, y: r(at)(t) + e.value.dataLabelFontSize, fill: e.value.color, "font-size": e.value.dataLabelFontSize, filter: _e(t.id) }, F(t.name), 9, el)) : g("", !0) ], 64))), 256)) ])) : g("", !0), e.value.donutShowTotal ? (a(), o("g", tl, [ L("text", { "text-anchor": "middle", x: T.value.drawingArea.centerX, y: T.value.drawingArea.centerY - e.value.donutTotalLabelFontSize / 2, "font-size": e.value.donutTotalLabelFontSize, fill: e.value.color }, F(e.value.donutTotalLabelText), 9, al), L("text", { "text-anchor": "middle", x: T.value.drawingArea.centerX, y: T.value.drawingArea.centerY + e.value.donutTotalLabelFontSize, "font-size": e.value.donutTotalLabelFontSize, fill: e.value.color }, F(r(W)({ p: e.value.valuePrefix, v: T.value.total, s: e.value.valueSuffix, r: e.value.dataLabelRoundingValue })), 9, ll) ])) : g("", !0) ], 64)) : g("", !0), $.value === z.LINE ? (a(), o(p, { key: 4 }, [ e.value.xyShowGrid ? (a(), o("g", ol, [ (a(!0), o(p, null, I(d.value.yLabels, (t) => (a(), o(p, null, [ t.y <= d.value.drawingArea.bottom ? (a(), o("line", { key: 0, x1: d.value.drawingArea.left, x2: d.value.drawingArea.right, y1: t.y, y2: t.y, stroke: e.value.xyGridStroke, "stroke-width": e.value.xyGridStrokeWidth, "stroke-linecap": "round" }, null, 8, nl)) : g("", !0) ], 64))), 256)), (a(!0), o(p, null, I(d.value.extremes.maxSeries + 1, (t, i) => (a(), o("line", { x1: d.value.drawingArea.left + d.value.slotSize * i, x2: d.value.drawingArea.left + d.value.slotSize * i, y1: d.value.drawingArea.top, y2: d.value.drawingArea.bottom, stroke: e.value.xyGridStroke, "stroke-width": e.value.xyGridStrokeWidth, "stroke-linecap": "round" }, null, 8, il))), 256)) ])) : g("", !0), e.value.xyShowAxis ? (a(), o("g", ul, [ L("line", { x1: d.value.drawingArea.left, x2: d.value.drawingArea.left, y1: d.value.drawingArea.top, y2: d.value.drawingArea.bottom, stroke: e.value.xyAxisStroke, "stroke-width": e.value.xyAxisStrokeWidth, "stroke-linecap": "round" }, null, 8, rl), L("line", { x1: d.value.drawingArea.left, x2: d.value.drawingArea.right, y1: isNaN(d.value.absoluteZero) ? d.value.drawingArea.bottom : d.value.absoluteZero, y2: isNaN(d.value.absoluteZero) ? d.value.drawingArea.bottom : d.value.absoluteZero, stroke: e.value.xyAxisStroke, "stroke-width": e.value.xyAxisStrokeWidth, "stroke-linecap": "round" }, null, 8, sl) ])) : g("", !0), e.value.xyShowScale ? (a(), o("g", { key: 2, class: "yLabels", ref_key: "scaleLabels", ref: Me }, [ (a(!0), o(p, null, I(d.value.yLabels, (t, i) => (a(), o(p, null, [ t.y <= d.value.drawingArea.bottom ? (a(), o("line", { key: 0, x1: t.x + 4, x2: d.value.drawingArea.left, y1: t.y, y2: t.y, stroke: e.value.xyAxisStroke, "stroke-width": e.value.xyAxisStrokeWidth, "stroke-linecap": "round" }, null, 8, vl)) : g("", !0), t.y <= d.value.drawingArea.bottom ? (a(), o("text", { key: 1, x: t.x, y: t.y + e.value.xyLabelsYFontSize / 3, "text-anchor": "end", "font-size": e.value.xyLabelsYFontSize, fill: e.value.color }, F(r(te)( e.value.formatter, t.value, r(W)({ p: e.value.valuePrefix, v: t.value, s: e.value.valueSuffix, r: e.value.dataLabelRoundingValue }), { datapoint: t, seriesIndex: i } )), 9, dl)) : g("", !0) ], 64))), 256)) ], 512)) :