@silurus/ooxml 0.78.1 → 0.79.1

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.
Files changed (46) hide show
  1. package/README.md +39 -1
  2. package/THIRD_PARTY_NOTICES.md +13 -0
  3. package/dist/{canvas-viewer-mechanics-B4K_t5X_.js → canvas-viewer-mechanics-DJ9yfiLN.js} +1 -1
  4. package/dist/chart-number-format-tjYUR9eS.js +435 -0
  5. package/dist/dash-CMzZIDz_.js +824 -0
  6. package/dist/{document-pull-client-5AakVD6e.js → document-pull-client-DYoybVCn.js} +2119 -2113
  7. package/dist/{docx-bjhRwb2u.js → docx-CSk_-kj_.js} +65 -56
  8. package/dist/docx.mjs +4 -4
  9. package/dist/docx_parser_bg.wasm +0 -0
  10. package/dist/index.mjs +3 -3
  11. package/dist/{line-distribute-BVFW1-Hs.js → line-distribute-CU7vu7XS.js} +1 -1
  12. package/dist/{line-metrics-DS0NS2Iq.js → line-metrics-A77J_KRx.js} +4229 -3233
  13. package/dist/math.mjs +1 -1
  14. package/dist/node.mjs +322 -322
  15. package/dist/{pptx-D1rCrHGR.js → pptx-CO1Ut97p.js} +192 -183
  16. package/dist/pptx.mjs +5 -5
  17. package/dist/pptx_parser_bg.wasm +0 -0
  18. package/dist/region-map.mjs +12708 -0
  19. package/dist/{render-DhlT5jxZ.js → render-C5m7Ddwx.js} +1 -1
  20. package/dist/render-worker-host-BhMT5U73.js +27 -0
  21. package/dist/render-worker-host-DNMxGh5s.js +27 -0
  22. package/dist/render-worker-host-DWyg7wio.js +27 -0
  23. package/dist/{resource-measurement-BA-4Q-II.js → resource-measurement-COxqtfGk.js} +1 -1
  24. package/dist/{session-C_HGxbRD.js → session-CJwZaquG.js} +10 -10
  25. package/dist/{slide-pull-client-BiC4sVGi.js → slide-pull-client-CFHNk0ek.js} +584 -583
  26. package/dist/three-d.mjs +2426 -0
  27. package/dist/types/docx.d.ts +251 -16
  28. package/dist/types/index.d.ts +266 -20
  29. package/dist/types/math.d.ts +1 -1
  30. package/dist/types/node.d.ts +225 -1
  31. package/dist/types/pptx.d.ts +253 -16
  32. package/dist/types/region-map.d.ts +586 -0
  33. package/dist/types/three-d.d.ts +586 -0
  34. package/dist/types/xlsx.d.ts +256 -16
  35. package/dist/{worksheet-pull-client-BnvgeqfG.js → worksheet-pull-client-CziyJf24.js} +13 -13
  36. package/dist/{xlsx-BG_WYSc0.js → xlsx-DHQmjAfh.js} +1246 -1073
  37. package/dist/xlsx.mjs +5 -5
  38. package/dist/xlsx_parser_bg.wasm +0 -0
  39. package/package.json +13 -1
  40. package/dist/render-worker-host-CtJo7hc9.js +0 -27
  41. package/dist/render-worker-host-D8vv-Asx.js +0 -27
  42. package/dist/render-worker-host-DAjG9nmw.js +0 -27
  43. /package/dist/{highlight-rect-CAkCWJ37.js → highlight-rect-cCvVU-MW.js} +0 -0
  44. /package/dist/{mathjax-CMjda8Ip.js → mathjax-Dqo857oC.js} +0 -0
  45. /package/dist/{transfer-DCu4c2BL.js → transfer-3QEJrsJa.js} +0 -0
  46. /package/dist/{visible-index-CgyJLAS_.js → visible-index-CKvgpUrf.js} +0 -0
@@ -0,0 +1,2426 @@
1
+ import { S as e, b as t, c as n, d as r, g as i, h as a, l as o, m as s, r as c, t as l, u, v as d, x as f } from "./chart-number-format-tjYUR9eS.js";
2
+ import { A as p, S as m, T as h, b as g, c as _, d as v, f as y, l as b, n as x, p as S, s as C, u as w } from "./dash-CMzZIDz_.js";
3
+ //#region packages/core/src/chart/three-d.ts
4
+ function T(e, t, n, r, i) {
5
+ let a = Number.isFinite(e) && e > 0 ? e : 0, o = Number.isFinite(t) ? k(t, 0, 500) : 150, s = Math.max(1, Math.trunc(r)), c = k(Math.trunc(n), 0, s - 1), l = i ? 1 : s, u = a / (l + o / 100);
6
+ return {
7
+ offset: (a - u * l) / 2 + (i ? 0 : c * u),
8
+ size: u
9
+ };
10
+ }
11
+ function E(e, t, n) {
12
+ if (![
13
+ e,
14
+ t,
15
+ n
16
+ ].every(Number.isFinite)) return 1;
17
+ let r = e >= 0 ? n : t;
18
+ return 1 - Math.min(1, Math.abs(e) / Math.max(Number.MIN_VALUE, Math.abs(r)));
19
+ }
20
+ function D(e, t, n, r = .06) {
21
+ if (!t.length || t.length > 1e5 || ![
22
+ n.x,
23
+ n.y,
24
+ n.w,
25
+ n.h
26
+ ].every(Number.isFinite) || n.w <= 0 || n.h <= 0) return e;
27
+ let i = t.map((t) => e.project(t.x, t.y, t.depth));
28
+ if (!i.every((e) => Number.isFinite(e.x) && Number.isFinite(e.y))) return e;
29
+ let a = Infinity, o = -Infinity, s = Infinity, c = -Infinity;
30
+ for (let e of i) a = Math.min(a, e.x), o = Math.max(o, e.x), s = Math.min(s, e.y), c = Math.max(c, e.y);
31
+ let l = o - a, u = c - s;
32
+ if (!(l > 2 ** -52) || !(u > 2 ** -52)) return e;
33
+ let d = k(O(r, .06), 0, .45), f = n.w * (1 - 2 * d), p = n.h * (1 - 2 * d), m = Math.min(f / l, p / u);
34
+ if (!(m > 0) || !Number.isFinite(m)) return e;
35
+ let h = {
36
+ x: (a + o) / 2,
37
+ y: (s + c) / 2
38
+ }, g = {
39
+ x: n.x + n.w / 2,
40
+ y: n.y + n.h / 2
41
+ }, _ = e.project, v = (e, t, n) => {
42
+ let r = _(e, t, n);
43
+ return {
44
+ x: g.x + (r.x - h.x) * m,
45
+ y: g.y + (r.y - h.y) * m
46
+ };
47
+ };
48
+ return {
49
+ ...e,
50
+ project: v,
51
+ depthX: e.depthX * m,
52
+ depthY: e.depthY * m
53
+ };
54
+ }
55
+ var O = (e, t) => typeof e == "number" && Number.isFinite(e) ? e : t, k = (e, t, n) => Math.min(n, Math.max(t, e));
56
+ function A(e, t, n = {}) {
57
+ if (![
58
+ t.x,
59
+ t.y,
60
+ t.w,
61
+ t.h
62
+ ].every(Number.isFinite) || t.w <= 0 || t.h <= 0) return null;
63
+ let r = k(O(e.rotationX, 15), -90, 90), i = (k(O(e.rotationY, 20), 0, 360) + 180) % 360 - 180, a = k(O(e.depthPercent, 100), 20, 2e3), o = k(O(e.perspective, 30), 0, 240), s = k(O(e.gapDepthPercent, 150), 0, 500), c = e.heightPercent != null && Number.isFinite(e.heightPercent) ? k(e.heightPercent, 5, 500) : null, l = n.sceneHeightScale != null && Number.isFinite(n.sceneHeightScale) ? k(n.sceneHeightScale * 100, 5, 500) : null, u = c ?? l, d = t;
64
+ if (u != null) {
65
+ let e = u / 100, n = Math.min(t.w, t.h / e), r = n * e;
66
+ d = {
67
+ x: t.x + (t.w - n) / 2,
68
+ y: t.y + (t.h - r) / 2,
69
+ w: n,
70
+ h: r
71
+ };
72
+ }
73
+ let f = Math.PI / 180, p = k(O(n.sceneDepthScale, .1), .01, 2), m = d.w * p * (a / 100), h = d.x + d.w / 2, g = d.y + d.h / 2, _ = -i * f, v = r * f, y = Math.cos(_), b = Math.sin(_), x = Math.cos(v), S = Math.sin(v), C = e.rightAngleAxes !== !0 && o > 0, w = k(o * .25, .25, 60) * f, T = k(O(n.perspectiveTangentGain, 2), .25, 4), E = Math.atan(T * Math.tan(w)), D = Math.hypot(d.w, d.h, m), A = C ? D * .5 / Math.tan(E) : Infinity, j = (e, t, n) => {
74
+ let r = e - h, i = g - t, a = (.5 - k(Number.isFinite(n) ? n : 0, 0, 1)) * m, o = y * r + b * a, s = -b * r + y * a;
75
+ return {
76
+ x: o,
77
+ y: x * i - S * s,
78
+ z: S * i + x * s
79
+ };
80
+ }, M = (e) => {
81
+ if (e.length < 3) return null;
82
+ let t = e.map((e) => j(e.x, e.y, e.depth)), n = t[0], r = null;
83
+ for (let e = 1; e + 1 < t.length && !r; e++) for (let i = e + 1; i < t.length; i++) {
84
+ let a = t[e], o = t[i], s = {
85
+ x: a.x - n.x,
86
+ y: a.y - n.y,
87
+ z: a.z - n.z
88
+ }, c = {
89
+ x: o.x - n.x,
90
+ y: o.y - n.y,
91
+ z: o.z - n.z
92
+ }, l = {
93
+ x: s.y * c.z - s.z * c.y,
94
+ y: s.z * c.x - s.x * c.z,
95
+ z: s.x * c.y - s.y * c.x
96
+ }, u = Math.hypot(l.x, l.y, l.z);
97
+ if (u > 2 ** -52) {
98
+ r = {
99
+ x: l.x / u,
100
+ y: l.y / u,
101
+ z: l.z / u
102
+ };
103
+ break;
104
+ }
105
+ }
106
+ return r ? {
107
+ normal: r,
108
+ centroid: t.reduce((e, n) => ({
109
+ x: e.x + n.x / t.length,
110
+ y: e.y + n.y / t.length,
111
+ z: e.z + n.z / t.length
112
+ }), {
113
+ x: 0,
114
+ y: 0,
115
+ z: 0
116
+ })
117
+ } : null;
118
+ }, N = -Infinity;
119
+ for (let e of [d.x, d.x + d.w]) for (let t of [d.y, d.y + d.h]) for (let n of [0, 1]) N = Math.max(N, j(e, t, n).z);
120
+ let P = C ? Math.max(A, N + D * .01) : Infinity, F = (e, t, n) => {
121
+ let r = j(e, t, n);
122
+ if (!C) return {
123
+ x: r.x,
124
+ y: -r.y
125
+ };
126
+ let i = P / Math.max(P * 1e-9, P - r.z);
127
+ return {
128
+ x: r.x * i,
129
+ y: -r.y * i
130
+ };
131
+ }, I = [];
132
+ for (let e of [d.x, d.x + d.w]) for (let t of [d.y, d.y + d.h]) for (let n of [0, 1]) I.push(F(e, t, n));
133
+ let L = Math.min(...I.map((e) => e.x)), ee = Math.max(...I.map((e) => e.x)), R = Math.min(...I.map((e) => e.y)), z = Math.max(...I.map((e) => e.y)), B = Math.max(Number.MIN_VALUE, ee - L), V = Math.max(Number.MIN_VALUE, z - R), H = Math.min(t.w / B, t.h / V) * .94, U = t.x + (t.w - B * H) / 2 - L * H, W = t.y + (t.h - V * H) / 2 - R * H, G = (e, t, n) => {
134
+ let r = F(e, t, n);
135
+ return {
136
+ x: U + r.x * H,
137
+ y: W + r.y * H
138
+ };
139
+ }, K = { ...d }, te = G(h, g, 0), q = G(h, g, 1), J = q.x - te.x, ne = q.y - te.y, Y = (e, t) => j(e === "x" ? t === "min" ? d.x : d.x + d.w : h, e === "y" ? t === "min" ? d.y : d.y + d.h : g, e === "depth" ? t === "min" ? 0 : 1 : .5).z, re = Y("x", "min") <= Y("x", "max") ? "min" : "max", ie = Y("y", "min") <= Y("y", "max") ? "min" : "max", ae = Y("depth", "min") >= Y("depth", "max") ? 0 : 1, oe = +(ae === 0), se = (e) => {
140
+ let t = e === "min" ? d.x : d.x + d.w, n = G(t, d.y, ae), r = G(t, d.y + d.h, ae);
141
+ return (n.x + r.x) / 2;
142
+ }, ce = (e) => {
143
+ let t = e === "min" ? d.y : d.y + d.h, n = G(d.x, t, ae), r = G(d.x + d.w, t, ae);
144
+ return (n.y + r.y) / 2;
145
+ }, le = se("min") <= se("max") ? "min" : "max", ue = ce("min") >= ce("max") ? "min" : "max", de = (e) => 1 / Math.max(1, Math.trunc(e)) / (1 + s / 100), fe = (e, t, n = !1) => n || t <= 1 ? .5 : (k(Math.trunc(e), 0, Math.max(0, t - 1)) + .5) / t;
146
+ return {
147
+ scene: d,
148
+ front: K,
149
+ depthX: J,
150
+ depthY: ne,
151
+ modelDepth: m,
152
+ pieScaleY: k(Math.sin(Math.max(1, Math.abs(r)) * f) ** 1.15, .2, 1),
153
+ pieThicknessFraction: .3 * Math.max(0, Math.cos(Math.abs(r) * f)),
154
+ project: G,
155
+ cameraDepth(e, t, n) {
156
+ return j(e, t, n).z;
157
+ },
158
+ cameraProjectionWeight(e, t, n) {
159
+ if (!C) return 1;
160
+ let r = j(e, t, n).z;
161
+ return 1 / Math.max(P * 1e-9, P - r);
162
+ },
163
+ cameraFacing(e) {
164
+ let t = M(e);
165
+ if (!t) return !1;
166
+ let { normal: n, centroid: r } = t, i = C ? {
167
+ x: -r.x,
168
+ y: -r.y,
169
+ z: P - r.z
170
+ } : {
171
+ x: 0,
172
+ y: 0,
173
+ z: 1
174
+ }, a = n.x * i.x + n.y * i.y + n.z * i.z, o = Math.hypot(i.x, i.y, i.z);
175
+ return o > 0 && a > o * 1e-10;
176
+ },
177
+ cameraNormal(e) {
178
+ return M(e)?.normal ?? null;
179
+ },
180
+ topology: {
181
+ farX: re,
182
+ farY: ie,
183
+ axisX: le,
184
+ axisY: ue,
185
+ nearDepth: ae,
186
+ farDepth: oe
187
+ },
188
+ seriesDepth: fe,
189
+ prismDepth: de,
190
+ prismInterval(e, t, n = !1) {
191
+ let r = fe(e, t, n), i = de(n ? 1 : t) / 2;
192
+ return {
193
+ near: k(r - i, 0, 1),
194
+ far: k(r + i, 0, 1)
195
+ };
196
+ }
197
+ };
198
+ }
199
+ function j(e) {
200
+ switch (e) {
201
+ case "cylinder":
202
+ case "cone":
203
+ case "coneToMax":
204
+ case "pyramid":
205
+ case "pyramidToMax": return e;
206
+ default: return "box";
207
+ }
208
+ }
209
+ var M = (e) => Math.max(0, Math.min(1, e));
210
+ function N(e, t) {
211
+ if (t.length < 3) return null;
212
+ let n = e[t[0]];
213
+ for (let r = 1; r + 1 < t.length; r++) for (let i = r + 1; i < t.length; i++) {
214
+ let a = e[t[r]], o = e[t[i]], s = {
215
+ x: a.x - n.x,
216
+ y: a.y - n.y,
217
+ depth: a.depth - n.depth
218
+ }, c = {
219
+ x: o.x - n.x,
220
+ y: o.y - n.y,
221
+ depth: o.depth - n.depth
222
+ }, l = {
223
+ x: s.y * c.depth - s.depth * c.y,
224
+ y: s.depth * c.x - s.x * c.depth,
225
+ depth: s.x * c.y - s.y * c.x
226
+ }, u = Math.hypot(l.x, l.y, l.depth);
227
+ if (u > 2 ** -52) return {
228
+ x: l.x / u,
229
+ y: l.y / u,
230
+ depth: l.depth / u
231
+ };
232
+ }
233
+ return null;
234
+ }
235
+ function P(e, t) {
236
+ let n = e.reduce((t, n) => ({
237
+ x: t.x + n.x / e.length,
238
+ y: t.y + n.y / e.length,
239
+ depth: t.depth + n.depth / e.length
240
+ }), {
241
+ x: 0,
242
+ y: 0,
243
+ depth: 0
244
+ });
245
+ return t.map((t) => {
246
+ let r = N(e, t.indices);
247
+ if (!r) return t;
248
+ let i = t.indices.reduce((n, r) => ({
249
+ x: n.x + e[r].x / t.indices.length,
250
+ y: n.y + e[r].y / t.indices.length,
251
+ depth: n.depth + e[r].depth / t.indices.length
252
+ }), {
253
+ x: 0,
254
+ y: 0,
255
+ depth: 0
256
+ }), a = {
257
+ x: i.x - n.x,
258
+ y: i.y - n.y,
259
+ depth: i.depth - n.depth
260
+ };
261
+ return r.x * a.x + r.y * a.y + r.depth * a.depth >= 0 ? t : {
262
+ ...t,
263
+ indices: [...t.indices].reverse()
264
+ };
265
+ });
266
+ }
267
+ function F(e) {
268
+ let { horizontal: t, crossStart: n, crossSize: r, baseCoord: i, endCoord: a, nearDepth: o, farDepth: s } = e;
269
+ if (![
270
+ n,
271
+ r,
272
+ i,
273
+ a,
274
+ o,
275
+ s
276
+ ].every(Number.isFinite) || r <= 0 || i === a || o === s) return null;
277
+ let c = j(e.shape), l = c === "cylinder" || c === "cone" || c === "coneToMax", u = c !== "box" && c !== "cylinder", d = c === "coneToMax" || c === "pyramidToMax", f = l ? Math.max(8, Math.min(64, Math.trunc(e.roundSegments ?? 32))) : 4, p = M(e.baseScale ?? (d ? e.toMaxBaseScale ?? 1 : 1)), m = M(e.endScale ?? (u ? d ? e.toMaxEndScale ?? 0 : 0 : 1));
278
+ if (p === 0 && m === 0) return null;
279
+ let h = n + r / 2, g = r / 2, _ = (o + s) / 2, v = Math.abs(s - o) / 2, y = [], b = (e, n) => {
280
+ if (n === 0) {
281
+ let n = y.length;
282
+ return y.push(t ? {
283
+ x: e,
284
+ y: h,
285
+ depth: _
286
+ } : {
287
+ x: h,
288
+ y: e,
289
+ depth: _
290
+ }), [n];
291
+ }
292
+ let r = [];
293
+ for (let i = 0; i < f; i++) {
294
+ let a = l ? i / f * Math.PI * 2 : Math.PI / 4 + i / f * Math.PI * 2, o = l ? 1 : Math.SQRT2, s = h + Math.cos(a) * g * n * o, c = _ + Math.sin(a) * v * n * o;
295
+ r.push(y.length), y.push(t ? {
296
+ x: e,
297
+ y: s,
298
+ depth: c
299
+ } : {
300
+ x: s,
301
+ y: e,
302
+ depth: c
303
+ });
304
+ }
305
+ return r;
306
+ }, x = b(i, p), S = b(a, m), C = l, w = [];
307
+ x.length > 1 && e.omitBaseCap !== !0 && w.push({
308
+ indices: x,
309
+ role: "baseCap",
310
+ smoothSurface: C
311
+ }), S.length > 1 && e.omitEndCap !== !0 && w.push({
312
+ indices: S,
313
+ role: "endCap",
314
+ smoothSurface: C
315
+ });
316
+ let T = [], E = Math.max(x.length, S.length);
317
+ for (let e = 0; e < E; e++) {
318
+ let t = (e + 1) % E, n = x.length === 1 ? x[0] : x[e], r = x.length === 1 ? x[0] : x[t], i = S.length === 1 ? S[0] : S[e], a = S.length === 1 ? S[0] : S[t], o = x.length === 1 ? [
319
+ n,
320
+ a,
321
+ i
322
+ ] : S.length === 1 ? [
323
+ n,
324
+ r,
325
+ i
326
+ ] : [
327
+ n,
328
+ r,
329
+ a,
330
+ i
331
+ ];
332
+ w.push({
333
+ indices: o,
334
+ role: "side",
335
+ smoothSurface: C,
336
+ segmentIndex: e,
337
+ baseRimEdge: x.length > 1 ? [n, r] : void 0,
338
+ endRimEdge: S.length > 1 ? [i, a] : void 0
339
+ }), T.push([n, i]);
340
+ }
341
+ return {
342
+ shape: c,
343
+ vertices: y,
344
+ faces: P(y, w),
345
+ silhouetteEdges: T
346
+ };
347
+ }
348
+ function I(e) {
349
+ let { x0: t, x1: n, lower0: r, lower1: i, upper0: a, upper1: o, nearDepth: s, farDepth: c, capStart: l, capEnd: u } = e;
350
+ if (![
351
+ t,
352
+ n,
353
+ r,
354
+ i,
355
+ a,
356
+ o,
357
+ s,
358
+ c
359
+ ].every(Number.isFinite) || t === n || s === c) return null;
360
+ n < t && ([t, n] = [n, t], [r, i] = [i, r], [a, o] = [o, a], [l, u] = [u, l]);
361
+ let d = Math.min(s, c), f = Math.max(s, c), p = Math.min(r, a), m = Math.min(i, o), h = Math.max(r, a), g = Math.max(i, o);
362
+ if (Math.max(h - p, g - m) < 1e-9) return null;
363
+ let _ = [
364
+ {
365
+ x: t,
366
+ y: p,
367
+ depth: d
368
+ },
369
+ {
370
+ x: n,
371
+ y: m,
372
+ depth: d
373
+ },
374
+ {
375
+ x: n,
376
+ y: g,
377
+ depth: d
378
+ },
379
+ {
380
+ x: t,
381
+ y: h,
382
+ depth: d
383
+ },
384
+ {
385
+ x: t,
386
+ y: p,
387
+ depth: f
388
+ },
389
+ {
390
+ x: n,
391
+ y: m,
392
+ depth: f
393
+ },
394
+ {
395
+ x: n,
396
+ y: g,
397
+ depth: f
398
+ },
399
+ {
400
+ x: t,
401
+ y: h,
402
+ depth: f
403
+ }
404
+ ];
405
+ return {
406
+ shape: "areaStrip",
407
+ vertices: _,
408
+ faces: P(_, [
409
+ {
410
+ indices: [
411
+ 0,
412
+ 3,
413
+ 2,
414
+ 1
415
+ ],
416
+ role: "side",
417
+ smoothSurface: !1
418
+ },
419
+ {
420
+ indices: [
421
+ 4,
422
+ 5,
423
+ 6,
424
+ 7
425
+ ],
426
+ role: "side",
427
+ smoothSurface: !1
428
+ },
429
+ {
430
+ indices: [
431
+ 0,
432
+ 4,
433
+ 7,
434
+ 3
435
+ ],
436
+ role: "baseCap",
437
+ smoothSurface: !1
438
+ },
439
+ {
440
+ indices: [
441
+ 1,
442
+ 2,
443
+ 6,
444
+ 5
445
+ ],
446
+ role: "endCap",
447
+ smoothSurface: !1
448
+ },
449
+ {
450
+ indices: [
451
+ 0,
452
+ 1,
453
+ 5,
454
+ 4
455
+ ],
456
+ role: "side",
457
+ smoothSurface: !1
458
+ },
459
+ {
460
+ indices: [
461
+ 3,
462
+ 7,
463
+ 6,
464
+ 2
465
+ ],
466
+ role: "side",
467
+ smoothSurface: !1
468
+ }
469
+ ].filter((e) => (e.role !== "baseCap" || l) && (e.role !== "endCap" || u))),
470
+ silhouetteEdges: []
471
+ };
472
+ }
473
+ function L(e) {
474
+ let t = e.upper0 - e.lower0, n = e.upper1 - e.lower1;
475
+ if (Number.isFinite(t) && Number.isFinite(n) && t * n < 0) {
476
+ let r = t / (t - n), i = e.x0 + (e.x1 - e.x0) * r, a = e.lower0 + (e.lower1 - e.lower0) * r;
477
+ return [I({
478
+ ...e,
479
+ x1: i,
480
+ lower1: a,
481
+ upper1: a,
482
+ capEnd: !1
483
+ }), I({
484
+ ...e,
485
+ x0: i,
486
+ lower0: a,
487
+ upper0: a,
488
+ capStart: !1
489
+ })].filter((e) => e != null);
490
+ }
491
+ let r = I(e);
492
+ return r ? [r] : [];
493
+ }
494
+ function ee(e) {
495
+ let { centerX: t, centerY: n, centerDepth: r, radius: i, modelDepth: a, thickness: o, startAngle: s, endAngle: c } = e;
496
+ if (![
497
+ t,
498
+ n,
499
+ r,
500
+ i,
501
+ a,
502
+ o,
503
+ s,
504
+ c
505
+ ].every(Number.isFinite) || !(i > 0) || !(a > 0) || !(o > 0) || !(c > s)) return null;
506
+ let l = Math.min(Math.PI * 2, c - s), u = l >= Math.PI * 2 - 1e-9, d = Math.max(2, Math.min(128, Math.trunc(e.segments ?? Math.ceil(32 * l / (Math.PI * 2))))), f = n - o / 2, p = n + o / 2, m = [{
507
+ x: t,
508
+ y: f,
509
+ depth: r
510
+ }, {
511
+ x: t,
512
+ y: p,
513
+ depth: r
514
+ }], h = [], g = [], _ = u ? d : d + 1;
515
+ for (let e = 0; e < _; e++) {
516
+ let n = s + l * e / d, o = t + Math.cos(n) * i, c = r + Math.sin(n) * i / a;
517
+ h.push(m.length), m.push({
518
+ x: o,
519
+ y: f,
520
+ depth: c
521
+ }), g.push(m.length), m.push({
522
+ x: o,
523
+ y: p,
524
+ depth: c
525
+ });
526
+ }
527
+ let v = u ? [{
528
+ indices: [...h],
529
+ role: "baseCap",
530
+ smoothSurface: !0
531
+ }, {
532
+ indices: [...g],
533
+ role: "endCap",
534
+ smoothSurface: !0
535
+ }] : [
536
+ {
537
+ indices: [0, ...h],
538
+ role: "baseCap",
539
+ smoothSurface: !0
540
+ },
541
+ {
542
+ indices: [1, ...g],
543
+ role: "endCap",
544
+ smoothSurface: !0
545
+ },
546
+ {
547
+ indices: [
548
+ 0,
549
+ 1,
550
+ g[0],
551
+ h[0]
552
+ ],
553
+ role: "baseCap",
554
+ smoothSurface: !1
555
+ },
556
+ {
557
+ indices: [
558
+ 0,
559
+ h.at(-1),
560
+ g.at(-1),
561
+ 1
562
+ ],
563
+ role: "endCap",
564
+ smoothSurface: !1
565
+ }
566
+ ];
567
+ for (let e = 0; e < d; e++) {
568
+ let t = u ? (e + 1) % d : e + 1;
569
+ v.push({
570
+ indices: [
571
+ h[e],
572
+ g[e],
573
+ g[t],
574
+ h[t]
575
+ ],
576
+ role: "side",
577
+ smoothSurface: !0,
578
+ segmentIndex: e,
579
+ baseRimEdge: [h[e], h[t]],
580
+ endRimEdge: [g[e], g[t]]
581
+ });
582
+ }
583
+ return {
584
+ shape: "pieSector",
585
+ vertices: m,
586
+ faces: P(m, v),
587
+ silhouetteEdges: h.slice(0, u ? void 0 : -1).map((e, t) => [e, g[t]])
588
+ };
589
+ }
590
+ //#endregion
591
+ //#region packages/core/src/chart/three-d-scene.ts
592
+ function R(e, t) {
593
+ if (![e, t].every(Number.isFinite)) return null;
594
+ let n = t - e;
595
+ if (n === 0) return e >= 0 && e <= 1 ? {
596
+ startT: 0,
597
+ endT: 1
598
+ } : null;
599
+ let r = -e / n, i = (1 - e) / n, a = Math.max(0, Math.min(r, i)), o = Math.min(1, Math.max(r, i));
600
+ return a <= o ? {
601
+ startT: a,
602
+ endT: o
603
+ } : null;
604
+ }
605
+ function z(e, t, n, r) {
606
+ if (![
607
+ e,
608
+ t,
609
+ n,
610
+ r
611
+ ].every(Number.isFinite)) return [];
612
+ let i = [0, 1], a = (e, t) => {
613
+ let n = t - e;
614
+ if (n !== 0) for (let t of [0, 1]) {
615
+ let r = (t - e) / n;
616
+ r > 0 && r < 1 && Number.isFinite(r) && i.push(r);
617
+ }
618
+ };
619
+ a(e, t), a(n, r), i.sort((e, t) => e - t);
620
+ let o = i.filter((e, t) => t === 0 || Math.abs(e - i[t - 1]) > 1e-12), s = (e, t, n) => e + (t - e) * n, c = (e) => Math.max(0, Math.min(1, e)), l = [];
621
+ for (let i = 0; i + 1 < o.length; i++) {
622
+ let a = o[i], u = o[i + 1], d = (a + u) / 2, f = c(s(e, t, d)), p = c(s(n, r, d));
623
+ Math.abs(p - f) <= 1e-12 || l.push({
624
+ startT: a,
625
+ endT: u,
626
+ lowerStart: c(s(e, t, a)),
627
+ lowerEnd: c(s(e, t, u)),
628
+ upperStart: c(s(n, r, a)),
629
+ upperEnd: c(s(n, r, u))
630
+ });
631
+ }
632
+ return l;
633
+ }
634
+ var B = (e) => ({
635
+ minX: Math.min(...e.map((e) => e.x)),
636
+ maxX: Math.max(...e.map((e) => e.x)),
637
+ minY: Math.min(...e.map((e) => e.y)),
638
+ maxY: Math.max(...e.map((e) => e.y))
639
+ }), V = (e, t) => {
640
+ let n = !1;
641
+ for (let r = 0, i = e.length - 1; r < e.length; i = r++) {
642
+ let a = e[r], o = e[i], s = (a.x - t.x) * (o.y - t.y) - (a.y - t.y) * (o.x - t.x), c = Math.max(1, Math.abs(a.x), Math.abs(a.y), Math.abs(o.x), Math.abs(o.y));
643
+ if (Math.abs(s) <= c * 1e-9 && t.x >= Math.min(a.x, o.x) - 1e-9 && t.x <= Math.max(a.x, o.x) + 1e-9 && t.y >= Math.min(a.y, o.y) - 1e-9 && t.y <= Math.max(a.y, o.y) + 1e-9) return !0;
644
+ a.y > t.y != o.y > t.y && t.x < (o.x - a.x) * (t.y - a.y) / (o.y - a.y) + a.x && (n = !n);
645
+ }
646
+ return n;
647
+ }, H = (e, t, n, r) => {
648
+ let i = {
649
+ x: t.x - e.x,
650
+ y: t.y - e.y
651
+ }, a = {
652
+ x: r.x - n.x,
653
+ y: r.y - n.y
654
+ }, o = i.x * a.y - i.y * a.x;
655
+ if (Math.abs(o) < 1e-12) return null;
656
+ let s = {
657
+ x: n.x - e.x,
658
+ y: n.y - e.y
659
+ }, c = (s.x * a.y - s.y * a.x) / o, l = (s.x * i.y - s.y * i.x) / o;
660
+ return c < -1e-9 || c > 1.000000001 || l < -1e-9 || l > 1.000000001 ? null : {
661
+ x: e.x + i.x * c,
662
+ y: e.y + i.y * c
663
+ };
664
+ };
665
+ function U(e, t, n, r) {
666
+ let i = [], a = (e) => {
667
+ i.length >= 12 || i.some((t) => Math.hypot(t.x - e.x, t.y - e.y) < 1e-7) || i.push(e);
668
+ }, o = {
669
+ x: (Math.max(n.minX, r.minX) + Math.min(n.maxX, r.maxX)) / 2,
670
+ y: (Math.max(n.minY, r.minY) + Math.min(n.maxY, r.maxY)) / 2
671
+ };
672
+ V(e, o) && V(t, o) && a(o);
673
+ for (let n of e) V(t, n) && a(n);
674
+ for (let n of t) V(e, n) && a(n);
675
+ for (let n = 0; n < e.length && i.length < 12; n++) for (let r = 0; r < t.length && i.length < 12; r++) {
676
+ let i = H(e[n], e[(n + 1) % e.length], t[r], t[(r + 1) % t.length]);
677
+ i && a(i);
678
+ }
679
+ return i;
680
+ }
681
+ function W(e, t) {
682
+ let n = e.cameraDepths;
683
+ if (!n || n.length !== e.points.length || e.points.length < 3) return e.cameraDepth;
684
+ let r = e.cameraWeights?.length === e.points.length ? e.cameraWeights : e.points.map(() => 1), i = e.points[0];
685
+ for (let a = 1; a + 1 < e.points.length; a++) {
686
+ let o = e.points[a], s = e.points[a + 1], c = (o.y - s.y) * (i.x - s.x) + (s.x - o.x) * (i.y - s.y);
687
+ if (Math.abs(c) < 1e-12) continue;
688
+ let l = ((o.y - s.y) * (t.x - s.x) + (s.x - o.x) * (t.y - s.y)) / c, u = ((s.y - i.y) * (t.x - s.x) + (i.x - s.x) * (t.y - s.y)) / c, d = 1 - l - u;
689
+ if (Math.min(l, u, d) < -1e-7) continue;
690
+ let f = l * r[0] + u * r[a] + d * r[a + 1];
691
+ if (Math.abs(f) > 2 ** -52) return (l * n[0] * r[0] + u * n[a] * r[a] + d * n[a + 1] * r[a + 1]) / f;
692
+ }
693
+ return e.cameraDepth;
694
+ }
695
+ function G(e) {
696
+ if (e.length < 2) return [...e];
697
+ let t = [...e.keys()].sort((t, n) => e[t].cameraDepth - e[n].cameraDepth || t - n), n = e.map((e) => B(e.points)), r = [...e.keys()].sort((e, t) => n[e].minX - n[t].minX || e - t), i = e.map(() => /* @__PURE__ */ new Set()), a = e.map(() => 0), o = [], s = 0;
698
+ for (let c of r) {
699
+ for (let e = o.length - 1; e >= 0; e--) n[o[e]].maxX < n[c].minX - 1e-9 && o.splice(e, 1);
700
+ for (let r of o) {
701
+ if (++s > 2e5) return t.map((t) => e[t]);
702
+ if (n[r].maxY < n[c].minY - 1e-9 || n[c].maxY < n[r].minY - 1e-9) continue;
703
+ let o = U(e[r].points, e[c].points, n[r], n[c]), l = 0;
704
+ for (let t of o) {
705
+ let n = W(e[r], t) - W(e[c], t), i = 1e-8 * Math.max(1, Math.abs(e[r].cameraDepth), Math.abs(e[c].cameraDepth));
706
+ if (Math.abs(n) <= i) continue;
707
+ let a = n < 0 ? -1 : 1;
708
+ if (l !== 0 && l !== a) {
709
+ l = 0;
710
+ break;
711
+ }
712
+ l = a;
713
+ }
714
+ if (l === 0) continue;
715
+ let u = l < 0 ? r : c, d = l < 0 ? c : r;
716
+ i[u].has(d) || (i[u].add(d), a[d]++);
717
+ }
718
+ o.push(c);
719
+ }
720
+ let c = new Set(e.keys()), l = [];
721
+ for (; c.size;) {
722
+ let n = t.find((e) => c.has(e) && a[e] === 0);
723
+ if (n ??= t.find((e) => c.has(e)), n == null) break;
724
+ c.delete(n), l.push(e[n]);
725
+ for (let e of i[n]) a[e]--;
726
+ }
727
+ return l;
728
+ }
729
+ //#endregion
730
+ //#region packages/core/src/chart/three-d-stroke.ts
731
+ var K = 1e-9, te = 1e4, q = (e, t, n) => ({
732
+ x: e.x + (t.x - e.x) * n,
733
+ y: e.y + (t.y - e.y) * n,
734
+ cameraDepth: e.cameraDepth + (t.cameraDepth - e.cameraDepth) * n,
735
+ cameraWeight: (e.cameraWeight ?? 1) + ((t.cameraWeight ?? 1) - (e.cameraWeight ?? 1)) * n
736
+ }), J = (e, t) => Math.hypot(e.x - t.x, e.y - t.y) <= K;
737
+ function ne(e, t, n = 0) {
738
+ let r = t.filter((e) => Number.isFinite(e) && e > K);
739
+ if (r.length === 0) return e.length >= 2 ? [[...e]] : [];
740
+ r.length % 2 == 1 && r.push(...r);
741
+ let i = [], a = 0, o = r[0], s = !0, c = r.reduce((e, t) => e + t, 0), l = c > K && Number.isFinite(n) ? (n % c + c) % c : 0;
742
+ for (; l > K;) {
743
+ let e = Math.min(l, o);
744
+ l -= e, o -= e, o <= K && (a = (a + 1) % r.length, o = r[a], s = a % 2 == 0);
745
+ }
746
+ let u = null;
747
+ for (let t = 0; t + 1 < e.length; t++) {
748
+ let n = e[t], c = e[t + 1], l = Math.hypot(c.x - n.x, c.y - n.y);
749
+ if (!(l > K)) continue;
750
+ let d = 0;
751
+ for (; d < l - K;) {
752
+ let e = Math.min(o, l - d), t = q(n, c, d / l), f = q(n, c, (d + e) / l);
753
+ if (s && (u ??= [], (u.length === 0 || !J(u.at(-1), t)) && u.push(t), u.push(f)), d += e, o -= e, o <= K) {
754
+ if (s && u && u.length >= 2) {
755
+ if (i.length >= 1e4) return null;
756
+ i.push(u);
757
+ }
758
+ u = null, a = (a + 1) % r.length, o = r[a], s = a % 2 == 0;
759
+ }
760
+ }
761
+ }
762
+ if (s && u && u.length >= 2) {
763
+ if (i.length >= 1e4) return null;
764
+ i.push(u);
765
+ }
766
+ if (i.length > 1 && J(e[0], e.at(-1)) && J(i[0][0], e[0]) && J(i.at(-1).at(-1), e.at(-1))) {
767
+ let e = i.shift(), t = i.pop();
768
+ i.unshift([...t, ...e.slice(1)]);
769
+ }
770
+ return i;
771
+ }
772
+ var Y = (e, t) => ({
773
+ kind: e,
774
+ points: t.map(({ x: e, y: t }) => ({
775
+ x: e,
776
+ y: t
777
+ })),
778
+ cameraDepths: t.map((e) => e.cameraDepth),
779
+ cameraWeights: t.map((e) => e.cameraWeight ?? 1),
780
+ cameraDepth: t.reduce((e, t) => e + t.cameraDepth, 0) / t.length
781
+ }), re = (e, t, n) => {
782
+ let r = [];
783
+ for (let n = 0; n < 12; n++) {
784
+ let i = Math.PI * 2 * n / 12;
785
+ r.push({
786
+ ...e,
787
+ x: e.x + Math.cos(i) * t,
788
+ y: e.y + Math.sin(i) * t
789
+ });
790
+ }
791
+ return Y(n, r);
792
+ };
793
+ function ie(e, t, n) {
794
+ let r = Number.isFinite(n.width) ? Math.max(0, n.width) : 0;
795
+ if (!(r > K) || t.length < 3) return null;
796
+ let i = r / 2;
797
+ if ((n.lineJoin ?? "miter") === "round") return re(e, i, "join");
798
+ let a = [];
799
+ for (let n of t) {
800
+ let t = n.x - e.x, r = n.y - e.y, o = Math.hypot(t, r);
801
+ if (!(o > K)) continue;
802
+ let s = -r / o * i, c = t / o * i;
803
+ a.push({
804
+ ...e,
805
+ x: e.x + s,
806
+ y: e.y + c
807
+ }, {
808
+ ...e,
809
+ x: e.x - s,
810
+ y: e.y - c
811
+ });
812
+ }
813
+ if (a.length < 3) return null;
814
+ a.sort((e, t) => e.x - t.x || e.y - t.y);
815
+ let o = (e, t, n) => (t.x - e.x) * (n.y - e.y) - (t.y - e.y) * (n.x - e.x), s = [];
816
+ for (let e of a) {
817
+ for (; s.length >= 2 && o(s.at(-2), s.at(-1), e) <= K;) s.pop();
818
+ s.push(e);
819
+ }
820
+ let c = [];
821
+ for (let e of [...a].reverse()) {
822
+ for (; c.length >= 2 && o(c.at(-2), c.at(-1), e) <= K;) c.pop();
823
+ c.push(e);
824
+ }
825
+ let l = [...s.slice(0, -1), ...c.slice(0, -1)];
826
+ return l.length >= 3 ? Y("join", l) : null;
827
+ }
828
+ var ae = (e, t, n, r) => {
829
+ let i = t.x * r.y - t.y * r.x;
830
+ if (Math.abs(i) <= K) return null;
831
+ let a = {
832
+ x: n.x - e.x,
833
+ y: n.y - e.y
834
+ }, o = (a.x * r.y - a.y * r.x) / i;
835
+ return {
836
+ x: e.x + t.x * o,
837
+ y: e.y + t.y * o
838
+ };
839
+ };
840
+ function oe(e, t) {
841
+ let n = Number.isFinite(t.width) ? Math.max(0, t.width) : 0;
842
+ if (!(n > K) || e.length < 2) return [];
843
+ let r = n / 2, i = t.lineCap ?? "butt", a = t.lineJoin ?? "miter", o = Math.max(1, t.miterLimit ?? 10), s = [], c = ne(e, t.dash ?? [], t.dashOffset);
844
+ if (c == null) return null;
845
+ let l = (e) => s.length >= 1e4 ? !1 : (s.push(e), !0);
846
+ for (let n = 0; n < c.length; n++) {
847
+ let s = c[n], u = s.length > 2 && J(s[0], s.at(-1)), d = n === 0 && J(s[0], e[0]) ? t.startCap ?? i : i, f = n + 1 === c.length && J(s.at(-1), e.at(-1)) ? t.endCap ?? i : i, p = [];
848
+ for (let e = 0; e + 1 < s.length; e++) {
849
+ let t = s[e], n = s[e + 1], r = Math.hypot(n.x - t.x, n.y - t.y);
850
+ p.push(r > K ? {
851
+ x: (n.x - t.x) / r,
852
+ y: (n.y - t.y) / r
853
+ } : null);
854
+ }
855
+ for (let e = 0; e + 1 < s.length; e++) {
856
+ let n = p[e];
857
+ if (!n) continue;
858
+ let i = {
859
+ x: -n.y * r,
860
+ y: n.x * r
861
+ }, a = e === 0, o = e + 2 === s.length, c = Math.min(.5, r / 2), m = u || !a || t.overlapStart === !0, h = u || !o || t.overlapEnd === !0, g = !u && a && d === "square" ? r : m ? c : 0, _ = !u && o && f === "square" ? r : h ? c : 0, v = {
862
+ ...s[e],
863
+ x: s[e].x - n.x * g,
864
+ y: s[e].y - n.y * g
865
+ }, y = {
866
+ ...s[e + 1],
867
+ x: s[e + 1].x + n.x * _,
868
+ y: s[e + 1].y + n.y * _
869
+ };
870
+ if (!l(Y("segment", [
871
+ {
872
+ ...v,
873
+ x: v.x + i.x,
874
+ y: v.y + i.y
875
+ },
876
+ {
877
+ ...y,
878
+ x: y.x + i.x,
879
+ y: y.y + i.y
880
+ },
881
+ {
882
+ ...y,
883
+ x: y.x - i.x,
884
+ y: y.y - i.y
885
+ },
886
+ {
887
+ ...v,
888
+ x: v.x - i.x,
889
+ y: v.y - i.y
890
+ }
891
+ ]))) return null;
892
+ }
893
+ if (!u && d === "round" && !l(re(s[0], r, "cap")) || !u && f === "round" && !l(re(s.at(-1), r, "cap"))) return null;
894
+ let m = (e, t, n) => {
895
+ if (!t || !n) return !0;
896
+ let i = t.x * n.y - t.y * n.x;
897
+ if (Math.abs(i) <= K) return !0;
898
+ if (a === "round") return l(re(e, r, "join"));
899
+ let s = i > 0 ? -1 : 1, c = {
900
+ ...e,
901
+ x: e.x + -t.y * r * s,
902
+ y: e.y + t.x * r * s
903
+ }, u = {
904
+ ...e,
905
+ x: e.x + -n.y * r * s,
906
+ y: e.y + n.x * r * s
907
+ };
908
+ if (a === "miter") {
909
+ let i = ae(c, t, u, n);
910
+ if (i && Math.hypot(i.x - e.x, i.y - e.y) <= r * o) return !!l(Y("join", [
911
+ c,
912
+ {
913
+ ...e,
914
+ ...i
915
+ },
916
+ u
917
+ ]));
918
+ }
919
+ return l(Y("join", [
920
+ c,
921
+ e,
922
+ u
923
+ ]));
924
+ };
925
+ for (let e = 1; e + 1 < s.length; e++) if (!m(s[e], p[e - 1], p[e])) return null;
926
+ if (u && !m(s[0], p.at(-1) ?? null, p[0] ?? null)) return null;
927
+ }
928
+ return s;
929
+ }
930
+ //#endregion
931
+ //#region packages/core/src/chart/three-d-outline.ts
932
+ var se = 1e-9, ce = (e, t) => Math.hypot(e.x - t.x, e.y - t.y, e.depth - t.depth) <= se, le = (e, t) => e.x - t.x || e.y - t.y || e.depth - t.depth, ue = (e, t) => {
933
+ let n = Math.min(e.length, t.length);
934
+ for (let r = 0; r < n; r++) {
935
+ let n = le(e[r], t[r]);
936
+ if (n !== 0) return n;
937
+ }
938
+ return e.length - t.length;
939
+ };
940
+ function de(e) {
941
+ let t = [...e].reverse();
942
+ return ue(e, t) <= 0 ? e : t;
943
+ }
944
+ function fe(e) {
945
+ let t = ce(e[0], e.at(-1)) ? e.slice(0, -1) : [...e];
946
+ if (t.length === 0) return [];
947
+ let n = 0;
948
+ for (let e = 1; e < t.length; e++) le(t[e], t[n]) < 0 && (n = e);
949
+ let r = t.map((e, r) => t[(n + r) % t.length]), i = t.map((e, r) => t[(n - r + t.length) % t.length]), a = ue(r, i) <= 0 ? r : i;
950
+ return [...a, a[0]];
951
+ }
952
+ function pe(e) {
953
+ let t = [], n = (e) => {
954
+ let n = t.find((t) => ce(t.point, e));
955
+ if (n) return le(e, n.point) < 0 && (n.point = e), n;
956
+ let r = {
957
+ point: e,
958
+ edges: [],
959
+ order: -1
960
+ };
961
+ return t.push(r), r;
962
+ }, r = [];
963
+ for (let [t, i] of e) {
964
+ if (ce(t, i)) continue;
965
+ let e = n(t), a = n(i);
966
+ e !== a && r.push([e, a]);
967
+ }
968
+ t.sort((e, t) => le(e.point, t.point)), t.forEach((e, t) => {
969
+ e.order = t;
970
+ });
971
+ let i = [], a = /* @__PURE__ */ new Set();
972
+ for (let [e, t] of r) {
973
+ let n = e.order < t.order ? e : t, r = e.order < t.order ? t : e, o = `${n.order}:${r.order}`;
974
+ a.has(o) || (a.add(o), i.push({
975
+ first: n,
976
+ second: r,
977
+ key: o
978
+ }));
979
+ }
980
+ i.sort((e, t) => e.key.localeCompare(t.key)), i.forEach((e, t) => {
981
+ e.first.edges.push(t), e.second.edges.push(t);
982
+ });
983
+ for (let e of t) e.edges.sort((e, t) => e - t);
984
+ let o = /* @__PURE__ */ new Set(), s = (e, t) => {
985
+ let n = [e.point], r = e, a = t;
986
+ for (; !o.has(a);) {
987
+ o.add(a);
988
+ let e = i[a], t = e.first === r ? e.second : e.first;
989
+ if (n.push(t.point), t.edges.length !== 2) break;
990
+ let s = t.edges.find((e) => !o.has(e));
991
+ if (s === void 0) break;
992
+ r = t, a = s;
993
+ }
994
+ return n;
995
+ }, c = [];
996
+ for (let e of t) if (e.edges.length !== 2) for (let t of e.edges) o.has(t) || c.push(de(s(e, t)));
997
+ for (let e = 0; e < i.length; e++) {
998
+ if (o.has(e)) continue;
999
+ let t = i[e], n = t.first.order <= t.second.order ? t.first : t.second;
1000
+ c.push(fe(s(n, e)));
1001
+ }
1002
+ let l = t.filter((e) => e.edges.length > 2).map((e) => ({
1003
+ point: e.point,
1004
+ neighbours: e.edges.map((t) => {
1005
+ let n = i[t];
1006
+ return n.first === e ? n.second.point : n.first.point;
1007
+ }).sort(le)
1008
+ }));
1009
+ return {
1010
+ paths: c.sort(ue),
1011
+ junctions: l
1012
+ };
1013
+ }
1014
+ //#endregion
1015
+ //#region packages/core/src/chart/three-d-renderer.ts
1016
+ var me = [
1017
+ "4472C4",
1018
+ "ED7D31",
1019
+ "70AD47",
1020
+ "A5A5A5",
1021
+ "FFC000",
1022
+ "5B9BD5"
1023
+ ], he = new Set([
1024
+ "line",
1025
+ "stackedLine",
1026
+ "stackedLinePct",
1027
+ "area",
1028
+ "stackedArea",
1029
+ "stackedAreaPct",
1030
+ "clusteredBar",
1031
+ "clusteredBarH",
1032
+ "stackedBar",
1033
+ "stackedBarH",
1034
+ "stackedBarPct",
1035
+ "stackedBarHPct"
1036
+ ]);
1037
+ function ge(e, t) {
1038
+ let n = Number.isFinite(t) && t > 0 ? t / m : 1, r = Number.isFinite(e) && e >= 0 ? e / g : 0;
1039
+ return Math.max(.25, r) * n;
1040
+ }
1041
+ function _e(e, t) {
1042
+ let n = Number.isSafeInteger(t) && t > 0 ? t : 0, r = Array.from({ length: n }, () => []);
1043
+ for (let t of e) {
1044
+ let e = t.categoryIndex;
1045
+ Number.isSafeInteger(e) && e >= 0 && e < n && r[e].push(t);
1046
+ }
1047
+ return r;
1048
+ }
1049
+ var ve = (e, t) => `#${t?.color ?? me[e % me.length]}`;
1050
+ function ye(e, t) {
1051
+ if (t?.lineHidden != null || t?.lineColor != null || t?.lineWidthEmu != null || t?.lineDash != null) return t.lineHidden !== !0;
1052
+ let n = e.chartexStyle;
1053
+ return (e.lineHidden != null || e.lineColor != null || e.lineWidthEmu != null || n?.lineHidden != null || n?.lineNoStyle != null || n?.lineColors != null || n?.lineWidthEmu != null || n?.lineDash != null || n?.lineCap != null || n?.lineJoin != null) && e.lineHidden !== !0 && n?.lineHidden !== !0;
1054
+ }
1055
+ function be(e, t) {
1056
+ let n = e.replace(/^#/, "");
1057
+ if (!/^[0-9a-f]{6}$/i.test(n)) return e;
1058
+ let r = (e) => Math.max(0, Math.min(255, Math.round(parseInt(n.slice(e, e + 2), 16) * t))).toString(16).padStart(2, "0");
1059
+ return `#${r(0)}${r(2)}${r(4)}`;
1060
+ }
1061
+ function xe(e, t) {
1062
+ let n = e.cameraNormal(t);
1063
+ if (!n) return 1;
1064
+ let r = {
1065
+ x: -.2,
1066
+ y: .25,
1067
+ z: 1
1068
+ }, i = Math.hypot(r.x, r.y, r.z), a = Math.max(0, (n.x * r.x + n.y * r.y + n.z * r.z) / i);
1069
+ return Math.max(.78, Math.min(1, .78 + .24 * a));
1070
+ }
1071
+ var Se = (e) => `"${e && !e.startsWith("+") ? e.replace(/["\\]/g, "") : "Arial"}"`, X = (e, t, n = "minor") => Se((t?.startsWith("+mj-") ? e.themeMajorFontLatin : t?.startsWith("+mn-") ? e.themeMinorFontLatin : t) ?? (n === "major" ? e.themeMajorFontLatin : e.themeMinorFontLatin));
1072
+ function Ce(e, t) {
1073
+ if (t.length) {
1074
+ e.beginPath(), e.moveTo(t[0].x, t[0].y);
1075
+ for (let n = 1; n < t.length; n++) e.lineTo(t[n].x, t[n].y);
1076
+ e.closePath();
1077
+ }
1078
+ }
1079
+ var we = (e) => e === "transparent" || e === "#00000000" || e === "rgba(0,0,0,0)";
1080
+ function Te(e, t, n, r) {
1081
+ we(n) || (Ce(e, t), e.fillStyle = n, e.fill(), r > 0 && (Ce(e, t), e.fillStyle = `rgba(0,0,0,${r})`, e.fill()));
1082
+ }
1083
+ function Ee(e, t, n, r, i, a, o, s, c, l, u, d) {
1084
+ return L({
1085
+ x0: t,
1086
+ x1: n,
1087
+ lower0: r,
1088
+ lower1: i,
1089
+ upper0: a,
1090
+ upper1: o,
1091
+ nearDepth: s,
1092
+ farDepth: c,
1093
+ capStart: u,
1094
+ capEnd: d
1095
+ }).flatMap((t) => Oe(e, t, l).map((e) => ({
1096
+ ...e,
1097
+ outline: !1,
1098
+ outlineSegments: void 0
1099
+ })));
1100
+ }
1101
+ function De(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m = !1, h = !1, g, _) {
1102
+ if (![
1103
+ r,
1104
+ i,
1105
+ a,
1106
+ o,
1107
+ s,
1108
+ c,
1109
+ l,
1110
+ u
1111
+ ].every(Number.isFinite) || a <= 0 || o <= 0 || s === c) return [];
1112
+ let v = F({
1113
+ shape: t,
1114
+ horizontal: n,
1115
+ crossStart: n ? i : r,
1116
+ crossSize: n ? o : a,
1117
+ baseCoord: s,
1118
+ endCoord: c,
1119
+ nearDepth: l,
1120
+ farDepth: u,
1121
+ baseScale: f,
1122
+ endScale: p,
1123
+ omitBaseCap: m,
1124
+ omitEndCap: h
1125
+ });
1126
+ return v ? Oe(e, v, d, g, _) : [];
1127
+ }
1128
+ function Oe(e, t, n, r, i, a = !1) {
1129
+ if (i?.exceeded) return [];
1130
+ let o = t.faces.map((r) => {
1131
+ let i = r.indices.map((e) => t.vertices[e]), a = e.cameraFacing(i);
1132
+ if (!a) return {
1133
+ meshFace: r,
1134
+ facing: a,
1135
+ face: null
1136
+ };
1137
+ let o = i.map((t) => e.project(t.x, t.y, t.depth)), s = o.reduce((e, t, n) => {
1138
+ let r = o[(n + 1) % o.length];
1139
+ return e + t.x * r.y - t.y * r.x;
1140
+ }, 0);
1141
+ return !Number.isFinite(s) || Math.abs(s) < 1e-7 ? {
1142
+ meshFace: r,
1143
+ facing: a,
1144
+ face: null
1145
+ } : {
1146
+ meshFace: r,
1147
+ facing: a,
1148
+ face: {
1149
+ points: o,
1150
+ color: be(n, xe(e, i)),
1151
+ shade: 0,
1152
+ cameraDepth: i.reduce((t, n) => t + e.cameraDepth(n.x, n.y, n.depth), 0) / i.length,
1153
+ cameraDepths: i.map((t) => e.cameraDepth(t.x, t.y, t.depth)),
1154
+ cameraWeights: i.map((t) => e.cameraProjectionWeight(t.x, t.y, t.depth)),
1155
+ outline: !1
1156
+ }
1157
+ };
1158
+ }), s = a ? [] : o.map((e) => e.face).filter((e) => e != null);
1159
+ if (i) {
1160
+ if (s.length > i.remaining) return i.exceeded = !0, [];
1161
+ i.remaining -= s.length;
1162
+ }
1163
+ let c = /* @__PURE__ */ new Map(), l = (e, t) => {
1164
+ if (e === t) return;
1165
+ let n = e < t ? `${e}:${t}` : `${t}:${e}`;
1166
+ c.has(n) || c.set(n, [e, t]);
1167
+ };
1168
+ for (let e of o) {
1169
+ if (!e.facing || !e.face) continue;
1170
+ let { indices: t, smoothSurface: n, role: r } = e.meshFace;
1171
+ if (!(n && r === "side")) for (let e = 0; e < t.length; e++) l(t[e], t[(e + 1) % t.length]);
1172
+ }
1173
+ let u = o.filter((e) => e.meshFace.role === "side").sort((e, t) => (e.meshFace.segmentIndex ?? 0) - (t.meshFace.segmentIndex ?? 0));
1174
+ if (t.silhouetteEdges.length === u.length && u.length > 0) for (let e = 0; e < u.length; e++) {
1175
+ let n = u[(e + u.length - 1) % u.length], r = u[e];
1176
+ if (n.facing === r.facing || !(r.facing ? r.face : n.face)) continue;
1177
+ let [i, a] = t.silhouetteEdges[e];
1178
+ l(i, a);
1179
+ }
1180
+ let d = o.some((e) => e.meshFace.role === "baseCap" && e.facing && e.face != null), f = o.some((e) => e.meshFace.role === "endCap" && e.facing && e.face != null);
1181
+ for (let e of u) {
1182
+ if (!e.facing || !e.face) continue;
1183
+ let t = [d ? void 0 : e.meshFace.baseRimEdge, f ? void 0 : e.meshFace.endRimEdge].filter((e) => e != null);
1184
+ for (let [e, n] of t) l(e, n);
1185
+ }
1186
+ let p = pe([...c.values()].map(([e, n]) => [t.vertices[e], t.vertices[n]]));
1187
+ if (!r) return s;
1188
+ let m = (e, t) => Math.hypot(e.x - t.x, e.y - t.y, e.depth - t.depth) <= 1e-9, h = (e) => p.junctions.some((t) => m(t.point, e));
1189
+ for (let t of p.paths) {
1190
+ let n = t.map((t) => e.project(t.x, t.y, t.depth)), a = t.map((t) => e.cameraDepth(t.x, t.y, t.depth)), o = t.map((t) => e.cameraProjectionWeight(t.x, t.y, t.depth)), c = oe(n.map((e, t) => ({
1191
+ ...e,
1192
+ cameraDepth: a[t],
1193
+ cameraWeight: o[t]
1194
+ })), {
1195
+ width: r.width,
1196
+ dash: r.dash,
1197
+ lineCap: r.cap,
1198
+ startCap: h(t[0]) ? "butt" : r.cap,
1199
+ endCap: h(t.at(-1)) ? "butt" : r.cap,
1200
+ overlapStart: h(t[0]),
1201
+ overlapEnd: h(t.at(-1)),
1202
+ lineJoin: r.join
1203
+ });
1204
+ if (!c || i && c.length > i.remaining) return i && (i.exceeded = !0), [];
1205
+ i && (i.remaining -= c.length), s.push(...c.map((e) => {
1206
+ let t = 1e-6 * Math.max(1, Math.abs(e.cameraDepth));
1207
+ return {
1208
+ points: e.points,
1209
+ color: r.color,
1210
+ shade: 0,
1211
+ cameraDepth: e.cameraDepth + t,
1212
+ cameraDepths: e.cameraDepths?.map((e) => e + t),
1213
+ cameraWeights: e.cameraWeights,
1214
+ outline: !1
1215
+ };
1216
+ }));
1217
+ }
1218
+ for (let t of p.junctions) {
1219
+ let n = ie({
1220
+ ...e.project(t.point.x, t.point.y, t.point.depth),
1221
+ cameraDepth: e.cameraDepth(t.point.x, t.point.y, t.point.depth),
1222
+ cameraWeight: e.cameraProjectionWeight(t.point.x, t.point.y, t.point.depth)
1223
+ }, t.neighbours.map((t) => ({
1224
+ ...e.project(t.x, t.y, t.depth),
1225
+ cameraDepth: e.cameraDepth(t.x, t.y, t.depth),
1226
+ cameraWeight: e.cameraProjectionWeight(t.x, t.y, t.depth)
1227
+ })), {
1228
+ width: r.width,
1229
+ lineJoin: r.join
1230
+ });
1231
+ if (!n) continue;
1232
+ if (i && i.remaining < 1) return i.exceeded = !0, [];
1233
+ i && --i.remaining;
1234
+ let a = 1e-6 * Math.max(1, Math.abs(n.cameraDepth));
1235
+ s.push({
1236
+ points: n.points,
1237
+ color: r.color,
1238
+ shade: 0,
1239
+ cameraDepth: n.cameraDepth + a,
1240
+ cameraDepths: n.cameraDepths?.map((e) => e + a),
1241
+ cameraWeights: n.cameraWeights,
1242
+ outline: !1
1243
+ });
1244
+ }
1245
+ return s;
1246
+ }
1247
+ function ke(e, t, n, r, i, a, o) {
1248
+ if (!t.length || o.exceeded) return [];
1249
+ let s = [...t].sort((e, t) => e.start - t.start), c = n - i / 2, l = n + i / 2, u = s[0], d = e.cameraDepth(u.centerX, c, u.centerDepth) >= e.cameraDepth(u.centerX, l, u.centerDepth) ? c : l, f = d === c ? l : c, p = (t, n, i) => ({
1250
+ x: t.centerX + Math.cos(n) * r,
1251
+ y: i,
1252
+ depth: t.centerDepth + Math.sin(n) * r / e.modelDepth
1253
+ }), m = (e) => ({
1254
+ x: e.centerX,
1255
+ y: d,
1256
+ depth: e.centerDepth
1257
+ }), h = [], g = (t, n = !1) => {
1258
+ if (t.length < 2 || o.exceeded) return;
1259
+ let r = t[0], i = t.at(-1), s = Math.hypot(r.x - i.x, r.y - i.y, r.depth - i.depth) <= 1e-9, c = oe((n && !s ? [...t, r] : [...t]).map((t) => ({
1260
+ ...e.project(t.x, t.y, t.depth),
1261
+ cameraDepth: e.cameraDepth(t.x, t.y, t.depth),
1262
+ cameraWeight: e.cameraProjectionWeight(t.x, t.y, t.depth)
1263
+ })), {
1264
+ width: a.width,
1265
+ dash: a.dash,
1266
+ lineCap: a.cap,
1267
+ startCap: "butt",
1268
+ endCap: "butt",
1269
+ lineJoin: a.join
1270
+ });
1271
+ if (!c || c.length > o.remaining) {
1272
+ o.exceeded = !0;
1273
+ return;
1274
+ }
1275
+ o.remaining -= c.length;
1276
+ for (let e of c) {
1277
+ let t = 1e-6 * Math.max(1, Math.abs(e.cameraDepth));
1278
+ h.push({
1279
+ points: e.points,
1280
+ color: a.color,
1281
+ shade: 0,
1282
+ cameraDepth: e.cameraDepth + t,
1283
+ cameraDepths: e.cameraDepths?.map((e) => e + t),
1284
+ cameraWeights: e.cameraWeights,
1285
+ outline: !1
1286
+ });
1287
+ }
1288
+ }, _ = [], v = [], y = [], b = /* @__PURE__ */ new Set(), x = (e) => {
1289
+ let t = Math.PI * 2, n = (e % t + t) % t;
1290
+ return (n < 1e-8 || t - n < 1e-8 ? 0 : n).toFixed(8);
1291
+ }, S = /* @__PURE__ */ new Map();
1292
+ for (let t of s) {
1293
+ S.set(x(t.start), {
1294
+ slice: t,
1295
+ angle: t.start
1296
+ }), S.set(x(t.end), {
1297
+ slice: t,
1298
+ angle: t.end
1299
+ });
1300
+ for (let n = 0; n <= t.segments; n++) {
1301
+ let r = t.start + (t.end - t.start) * n / t.segments, i = p(t, r, d);
1302
+ if ((!_.length || Math.hypot(_.at(-1).x - i.x, _.at(-1).y - i.y, _.at(-1).depth - i.depth) > 1e-9) && _.push(i), n === t.segments) continue;
1303
+ let a = t.start + (t.end - t.start) * (n + 1) / t.segments, o = p(t, r, c), s = p(t, r, l), u = p(t, a, l), m = p(t, a, c);
1304
+ if (e.cameraFacing([
1305
+ o,
1306
+ s,
1307
+ u,
1308
+ m
1309
+ ])) {
1310
+ let e = p(t, r, f), n = p(t, a, f);
1311
+ y.length || y.push(e), y.push(n), b.add(x(r)), b.add(x(a));
1312
+ } else y.length && (v.push(y), y = []);
1313
+ }
1314
+ }
1315
+ if (y.length && v.push(y), v.length > 1) {
1316
+ let e = v[0], t = v.at(-1), n = e[0], r = t.at(-1);
1317
+ Math.hypot(n.x - r.x, n.y - r.y, n.depth - r.depth) <= 1e-9 && (v[0] = [...t, ...e.slice(1)], v.pop());
1318
+ }
1319
+ g(_, !0);
1320
+ let C = /* @__PURE__ */ new Map();
1321
+ for (let { slice: e, angle: t } of S.values()) g([m(e), p(e, t, d)]), b.has(x(t)) && C.set(x(t), {
1322
+ slice: e,
1323
+ angle: t
1324
+ });
1325
+ for (let t of v) {
1326
+ g(t);
1327
+ for (let n of [t[0], t.at(-1)]) {
1328
+ let t = Math.atan2((n.depth - u.centerDepth) * e.modelDepth, n.x - u.centerX);
1329
+ C.set(x(t), {
1330
+ slice: u,
1331
+ angle: t
1332
+ });
1333
+ }
1334
+ }
1335
+ for (let { slice: e, angle: t } of C.values()) g([p(e, t, d), p(e, t, f)]);
1336
+ return h;
1337
+ }
1338
+ function Ae(e, t) {
1339
+ Te(e, t.points, t.color, t.shade), t.outline && (e.strokeStyle = t.outlineColor ?? "rgba(0,0,0,0.42)", e.lineWidth = t.outlineWidth ?? .75, e.setLineDash(x(t.outlineDash ?? "solid", e.lineWidth)), e.lineCap = t.outlineCap ?? "butt", e.lineJoin = t.outlineJoin ?? "miter", t.outline && (Ce(e, t.points), e.stroke()), e.setLineDash([]));
1340
+ }
1341
+ function je(e, t, n) {
1342
+ t.points.length < 3 || we(n) || (Ce(e, t.points), e.fillStyle = n, e.fill());
1343
+ }
1344
+ function Me(e, t) {
1345
+ e.fillStyle = "#888", e.font = "12px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText("(too many data points)", t.x + t.w / 2, t.y + t.h / 2);
1346
+ }
1347
+ function Z(e, t, n, r = !1) {
1348
+ let i = Math.max(0, t - 1), a = Number.isFinite(e) ? Math.max(0, Math.min(i, e)) : 0, o = n ? (a + .5) / Math.max(1, t) : t === 1 ? .5 : a / i;
1349
+ return r ? 1 - o : o;
1350
+ }
1351
+ function Ne(e) {
1352
+ let t = e.catAxisLabelRotation;
1353
+ return t == null ? null : !Number.isFinite(t) || Math.abs(t) > 54e5 ? 0 : t / 6e4 * Math.PI / 180;
1354
+ }
1355
+ function Pe(e, t, n, r, i, a = 1) {
1356
+ if (i || r === 0) {
1357
+ e.textAlign = i ? "right" : "center", e.textBaseline = i ? "middle" : a < 0 ? "bottom" : "top", e.fillText(t, n.x + (i ? -6 : 0), n.y + (i ? 0 : a * 6));
1358
+ return;
1359
+ }
1360
+ e.save(), e.translate(n.x, n.y + a * 6), e.rotate(r), e.textAlign = a < 0 ? "left" : "right", e.textBaseline = "middle", e.fillText(t, 0, 0), e.restore();
1361
+ }
1362
+ function Fe(e, t, n, r, i, a, o) {
1363
+ if (!(r > 0) || !Number.isFinite(t.x) || !Number.isFinite(t.y)) return;
1364
+ let s = r / 2;
1365
+ switch (e.beginPath(), n) {
1366
+ case "square":
1367
+ e.rect(t.x - s, t.y - s, r, r);
1368
+ break;
1369
+ case "diamond":
1370
+ e.moveTo(t.x, t.y - s), e.lineTo(t.x + s, t.y), e.lineTo(t.x, t.y + s), e.lineTo(t.x - s, t.y), e.closePath();
1371
+ break;
1372
+ case "triangle":
1373
+ e.moveTo(t.x, t.y - s), e.lineTo(t.x + s, t.y + s), e.lineTo(t.x - s, t.y + s), e.closePath();
1374
+ break;
1375
+ case "x":
1376
+ case "plus":
1377
+ case "dash": {
1378
+ if (n === "dash") {
1379
+ e.moveTo(t.x - s, t.y), e.lineTo(t.x + s, t.y), e.strokeStyle = a, e.lineWidth = o, e.stroke();
1380
+ return;
1381
+ }
1382
+ let r = n === "x";
1383
+ e.moveTo(t.x - s, t.y + (r ? -s : 0)), e.lineTo(t.x + s, t.y + (r ? s : 0)), e.moveTo(t.x + (r ? -s : 0), t.y + s), e.lineTo(t.x + (r ? s : 0), t.y - s), e.strokeStyle = a, e.lineWidth = o, e.stroke();
1384
+ return;
1385
+ }
1386
+ case "star":
1387
+ for (let n = 0; n < 10; n++) {
1388
+ let r = -Math.PI / 2 + n * Math.PI / 5, i = n % 2 == 0 ? s : s * .4, a = t.x + Math.cos(r) * i, o = t.y + Math.sin(r) * i;
1389
+ n ? e.lineTo(a, o) : e.moveTo(a, o);
1390
+ }
1391
+ e.closePath();
1392
+ break;
1393
+ case "dot":
1394
+ e.arc(t.x, t.y, Math.max(1, s * .35), 0, Math.PI * 2);
1395
+ break;
1396
+ case "picture": return;
1397
+ default:
1398
+ e.arc(t.x, t.y, s, 0, Math.PI * 2);
1399
+ break;
1400
+ }
1401
+ i !== "transparent" && (e.fillStyle = i, e.fill()), e.strokeStyle = a, e.lineWidth = o, e.stroke();
1402
+ }
1403
+ function Ie(e, t, n, r, i, a, o, s, c, l = 0, u, f, p = "t", m = o, h = !0, b) {
1404
+ let x = f;
1405
+ if (x?.deleted) return;
1406
+ let S = n.seriesDataLabels, T = x?.showVal ?? S?.showVal ?? t.showDataLabels, E = x?.showCatName ?? S?.showCatName ?? !1, D = x?.showSerName ?? S?.showSerName ?? !1, O = x?.showPercent ?? S?.showPercent ?? !1, k = x?.text, A = w({
1407
+ customText: k,
1408
+ showCategory: E,
1409
+ showSeries: D,
1410
+ showValue: T,
1411
+ showPercent: O,
1412
+ category: n.categories?.[i] ?? t.categories[i] ?? `${i + 1}`,
1413
+ seriesName: n.name || `Series ${r + 1}`,
1414
+ sourceValue: a,
1415
+ valueDivisor: b?.divisor,
1416
+ percentRatio: u != null && Number.isFinite(u) ? u : void 0,
1417
+ formatCode: x?.formatCode ?? S?.formatCode ?? t.dataLabelFormatCode ?? n.valFormatCode,
1418
+ percentFormatCode: x?.formatCode ?? S?.formatCode ?? t.dataLabelFormatCode ?? "0%",
1419
+ date1904: t.date1904,
1420
+ separator: x?.separator ?? S?.separator
1421
+ });
1422
+ if (!A) return;
1423
+ let j = d(x?.fontSizeHpt ?? S?.fontSizeHpt ?? t.dataLabelFontSizeHpt, c) ?? 9 * c, M = x?.fontBold ?? S?.fontBold ?? t.dataLabelFontBold ?? !1, N = X(t, x?.fontFace ?? S?.fontFace ?? t.dataLabelFontFace);
1424
+ e.font = `${M ? "bold " : ""}${j}px ${N}`;
1425
+ let P = `#${x?.fontColor ?? S?.fontColor ?? n.labelColor ?? t.dataLabelFontColor ?? "111111"}`, F = k && x?.richRuns?.length ? y(e, {
1426
+ runs: x.richRuns,
1427
+ ptToPx: c,
1428
+ fontFamily: N,
1429
+ fallbackBold: M,
1430
+ fontFamilyForFace: (e) => X(t, e)
1431
+ }, j, P) : null, I = F ? [] : C(A, Math.max(j, s.w * .45), Math.max(j * 1.2, s.h * .35), j * 1.2, (t) => e.measureText(t).width);
1432
+ if (!F && !I.length) return;
1433
+ let L = F?.width ?? Math.max(...I.map((t) => e.measureText(t).width)), ee = F?.height ?? I.length * j * 1.2, R = _({
1434
+ kind: "point",
1435
+ x: o.x,
1436
+ y: o.y,
1437
+ position: x?.position ?? S?.position ?? t.dataLabelPosition ?? p,
1438
+ markerGap: l
1439
+ }, s, {
1440
+ w: L,
1441
+ h: ee
1442
+ }, j, x?.manualLayout, s);
1443
+ if (!R) return;
1444
+ let z = x?.labelBox ?? S?.labelBox;
1445
+ if (S?.showLeaderLines && h && (e.beginPath(), e.moveTo(m.x, m.y), e.lineTo(Math.max(R.rect.x, Math.min(m.x, R.rect.x + R.rect.w)), Math.max(R.rect.y, Math.min(m.y, R.rect.y + R.rect.h))), e.strokeStyle = `#${S.leaderLineColor ?? "808080"}`, e.lineWidth = S.leaderLineWidthEmu == null ? .75 * c : Math.max(.25, S.leaderLineWidthEmu / g * c), e.stroke()), z && (z.fill && (e.fillStyle = `#${z.fill}`, e.fillRect(R.rect.x, R.rect.y, R.rect.w, R.rect.h)), z.borderColor && (e.strokeStyle = `#${z.borderColor}`, e.lineWidth = z.borderWidthEmu == null ? .75 * c : Math.max(.25, z.borderWidthEmu / g * c), e.strokeRect(R.rect.x, R.rect.y, R.rect.w, R.rect.h))), e.save(), e.beginPath(), e.rect(R.clip.x, R.clip.y, R.clip.w, R.clip.h), e.clip(), F) {
1446
+ v(e, F, R.x, R.y, R.textAlign, R.textBaseline), e.restore();
1447
+ return;
1448
+ }
1449
+ e.fillStyle = P, e.textAlign = R.textAlign, e.textBaseline = "middle";
1450
+ let B = j * 1.2, V = R.y - (I.length - 1) * B / 2;
1451
+ I.forEach((t, n) => e.fillText(t, R.x, V + n * B)), e.restore();
1452
+ }
1453
+ function Le(e, t, n) {
1454
+ if (n?.deleted) return !1;
1455
+ if (n?.text) return !0;
1456
+ let r = t.seriesDataLabels;
1457
+ return (n?.showVal ?? r?.showVal ?? e.showDataLabels) || (n?.showCatName ?? r?.showCatName ?? !1) || (n?.showSerName ?? r?.showSerName ?? !1) || (n?.showPercent ?? r?.showPercent ?? !1);
1458
+ }
1459
+ function Re(n, c, l, u, f) {
1460
+ let p = r(c, l.h, u);
1461
+ if (c.title) {
1462
+ n.font = `${c.titleFontBold === !1 ? "" : "bold "}${p.fontPx}px ${Se(c.titleFontFace)}`, n.fillStyle = c.titleFontColor ? `#${c.titleFontColor}` : "#111111", n.textAlign = "center", n.textBaseline = "top";
1463
+ let t = n.measureText(c.title).width, r = {
1464
+ x: l.x + (l.w - t) / 2,
1465
+ y: l.y + p.topPad,
1466
+ w: t,
1467
+ h: Math.max(1, p.fontPx)
1468
+ }, i = c.titleManualLayout ? e({
1469
+ ...c.titleManualLayout,
1470
+ w: void 0,
1471
+ h: void 0
1472
+ }, l, r) : null;
1473
+ n.fillText(c.title, i ? i.x + i.w / 2 : l.x + l.w / 2, i?.y ?? r.y);
1474
+ }
1475
+ let m = d(c.legendFontSizeHpt, u) ?? 9 * u;
1476
+ n.save(), n.font = `${c.legendFontBold ? "bold " : ""}${m}px ${Se(c.legendFontFace)}`;
1477
+ let h = c.chartType === "pie" ? c.series[0]?.categories?.length ? c.series[0].categories : c.categories : c.series.map((e, t) => e.name || `Series ${t + 1}`), g = i(c, l.w, l.h, .23, {
1478
+ itemWidths: h.map((e) => 7 * u + 4 + n.measureText(e).width),
1479
+ rowHeight: Math.max(m * 1.45, 12),
1480
+ itemGap: 12,
1481
+ horizontalPadding: 8,
1482
+ verticalPadding: 4
1483
+ });
1484
+ n.restore();
1485
+ let _ = a(g), v = s(c, l.w, l.h, u), y = f === "horizontal" ? c.catAxisTitle ? v.catFontPx + o(l.w) + 4 : 0 : f === "vertical" ? v.valBandW : 0, b = f === "horizontal" ? c.valAxisTitle ? v.valFontPx + o(l.h) + 4 : 0 : f === "vertical" ? v.catBandH : 0, x = t(c, l.x, l.y, l.w, l.h, u, {
1486
+ titleBand: p,
1487
+ legendSideReserveFrac: .23,
1488
+ legendReserve: g,
1489
+ pad: {
1490
+ t: p.bandH + _.legTopH + l.h * .04,
1491
+ r: _.legRightW + l.w * .05,
1492
+ b: _.legBottomH + l.h * .19 + b,
1493
+ l: _.legLeftW + l.w * .13 + y
1494
+ },
1495
+ honorPlotAreaManualLayout: !0,
1496
+ manualOuterInsets: {
1497
+ t: p.bandH,
1498
+ r: _.legRightW,
1499
+ b: _.legBottomH + b,
1500
+ l: _.legLeftW + y
1501
+ }
1502
+ }), S = {
1503
+ x: x.plotRect.px0,
1504
+ y: x.plotRect.py0,
1505
+ w: Math.max(1, x.plotRect.pw),
1506
+ h: Math.max(1, x.plotRect.ph)
1507
+ }, C = g ? g.side === "r" ? {
1508
+ x: l.x + l.w - g.reserveW,
1509
+ y: S.y,
1510
+ w: g.reserveW,
1511
+ h: S.h
1512
+ } : g.side === "l" ? {
1513
+ x: l.x,
1514
+ y: S.y,
1515
+ w: g.reserveW,
1516
+ h: S.h
1517
+ } : g.side === "t" ? {
1518
+ x: l.x + 4,
1519
+ y: l.y + p.bandH,
1520
+ w: Math.max(1, l.w - 8),
1521
+ h: g.reserveH
1522
+ } : {
1523
+ x: l.x + 4,
1524
+ y: l.y + l.h - g.reserveH,
1525
+ w: Math.max(1, l.w - 8),
1526
+ h: g.reserveH
1527
+ } : null;
1528
+ return {
1529
+ plot: S,
1530
+ legend: (C && c.legendManualLayout ? e(c.legendManualLayout, l, C) : null) ?? C
1531
+ };
1532
+ }
1533
+ function ze(t, n, r, i, a, o, s, c, l, d, f, p, m, h) {
1534
+ t.save(), t.font = `${d ? "italic " : ""}${l ? "bold " : ""}${o}px ${s}`, t.fillStyle = c ? `#${c}` : "#555";
1535
+ let g = m ? n : S(t, n, h), _ = u(a, f, p), v = i;
1536
+ if (m) {
1537
+ let n = t.measureText(g).width, a = Math.abs(Math.cos(_)), s = Math.abs(Math.sin(_)), c = {
1538
+ x: i.x - (n * a + o * s) / 2,
1539
+ y: i.y - (n * s + o * a) / 2,
1540
+ w: n * a + o * s,
1541
+ h: n * s + o * a
1542
+ }, l = e({
1543
+ ...m,
1544
+ w: void 0,
1545
+ h: void 0
1546
+ }, r, c);
1547
+ l && (v = {
1548
+ x: l.x + l.w / 2,
1549
+ y: l.y + l.h / 2
1550
+ });
1551
+ }
1552
+ t.translate(v.x, v.y), _ && t.rotate(_), t.textAlign = "center", t.textBaseline = "middle", t.fillText(g, 0, 0), t.restore();
1553
+ }
1554
+ function Be(e, t, r, i, a, s) {
1555
+ if (t.valAxisTitle) {
1556
+ let c = n(t.valAxisTitleFontSizeHpt, s), l = a ? "horizontal" : "left";
1557
+ ze(e, t.valAxisTitle, r, a ? {
1558
+ x: i.x + i.w / 2,
1559
+ y: i.y + i.h + o(r.h) + c / 2
1560
+ } : {
1561
+ x: i.x - o(r.w) - c / 2,
1562
+ y: i.y + i.h / 2
1563
+ }, l, c, X(t, t.valAxisTitleFontFace, "major"), t.valAxisTitleFontColor, t.valAxisTitleFontBold ?? !0, t.valAxisTitleFontItalic ?? !1, t.valAxisTitleRotation, t.valAxisTitleVerticalMode, t.valAxisTitleManualLayout, a ? i.w : i.h);
1564
+ }
1565
+ if (t.catAxisTitle) {
1566
+ let c = n(t.catAxisTitleFontSizeHpt, s), l = a ? "left" : "horizontal";
1567
+ ze(e, t.catAxisTitle, r, a ? {
1568
+ x: i.x - o(r.w) - c / 2,
1569
+ y: i.y + i.h / 2
1570
+ } : {
1571
+ x: i.x + i.w / 2,
1572
+ y: i.y + i.h + o(r.h) + c / 2
1573
+ }, l, c, X(t, t.catAxisTitleFontFace, "major"), t.catAxisTitleFontColor, t.catAxisTitleFontBold ?? !0, t.catAxisTitleFontItalic ?? !1, t.catAxisTitleRotation, t.catAxisTitleVerticalMode, t.catAxisTitleManualLayout, a ? i.h : i.w);
1574
+ }
1575
+ }
1576
+ function Ve(e, t, r, i, a, o, s, c, l, u) {
1577
+ let f = t.threeD?.seriesAxis;
1578
+ if (!f || f.hidden || t.threeD?.barGrouping !== "standard" || t.series.length === 0) return;
1579
+ let p = Xe(t, i, a, o, s, c, l), m = Ge(i), h = l === "vertical" ? m.seriesAxisX : p.axisX, g = l === "horizontal" ? m.floorY === i.front.y ? i.front.y + i.front.h : i.front.y : m.floorY, _ = i.project(h, g, i.topology.nearDepth), v = i.project(h, g, i.topology.farDepth), y = Math.hypot(v.x - _.x, v.y - _.y);
1580
+ if (!(y > 1e-6)) return;
1581
+ let b = {
1582
+ x: (v.x - _.x) / y,
1583
+ y: (v.y - _.y) / y
1584
+ }, x = {
1585
+ x: -b.y,
1586
+ y: b.x
1587
+ }, S = i.project(i.front.x + i.front.w / 2, i.front.y + i.front.h / 2, .5), C = {
1588
+ x: (_.x + v.x) / 2,
1589
+ y: (_.y + v.y) / 2
1590
+ };
1591
+ (C.x - S.x) * x.x + (C.y - S.y) * x.y < 0 && (x = {
1592
+ x: -x.x,
1593
+ y: -x.y
1594
+ }), (f.tickLabelPos === "low" && x.y < 0 || f.tickLabelPos === "high" && x.y > 0) && (x = {
1595
+ x: -x.x,
1596
+ y: -x.y
1597
+ }), f.lineHidden || ($(e, Q(f.lineColor, f.lineWidthEmu, null, u, "898989", 1)), e.beginPath(), e.moveTo(_.x, _.y), e.lineTo(v.x, v.y), e.stroke());
1598
+ let w = Math.max(1, Math.floor(f.tickMarkSkip ?? 1)), T = Math.max(1, Math.floor(f.tickLabelSkip ?? 1)), E = f.majorTickMark ?? "out", D = d(f.fontSizeHpt, u) ?? 9 * u;
1599
+ e.font = `${f.fontItalic ? "italic " : ""}${f.fontBold ? "bold " : ""}${D}px ${X(t, f.fontFace)}`, e.fillStyle = f.fontColor ? `#${f.fontColor}` : "#595959", e.textAlign = Math.abs(x.x) < .2 ? "center" : x.x < 0 ? "right" : "left", e.textBaseline = Math.abs(x.y) < .2 ? "middle" : x.y < 0 ? "bottom" : "top";
1600
+ for (let n = 0; n < t.series.length; n++) {
1601
+ let r = i.seriesDepth(n, t.series.length, !1), a = f.orientation === "maxMin" ? 1 - r : r, o = i.project(h, g, a);
1602
+ if (!f.lineHidden && n % w === 0 && E !== "none") {
1603
+ let t = 6 * u, n = E === "cross" ? t / 2 : E === "out" ? t : 0, r = E === "cross" ? t / 2 : E === "in" ? t : 0;
1604
+ e.beginPath(), e.moveTo(o.x + x.x * n, o.y + x.y * n), e.lineTo(o.x - x.x * r, o.y - x.y * r), e.stroke();
1605
+ }
1606
+ f.tickLabelPos !== "none" && n % T === 0 && e.fillText(t.series[n].name || `Series ${n + 1}`, o.x + x.x * (6 * u + 3), o.y + x.y * (6 * u + 3));
1607
+ }
1608
+ if (e.setLineDash([]), f.title) {
1609
+ let a = n(f.titleFontSizeHpt, u);
1610
+ ze(e, f.title, r, {
1611
+ x: C.x + x.x * (D + a + 12),
1612
+ y: C.y + x.y * (D + a + 12)
1613
+ }, "horizontal", a, X(t, f.titleFontFace, "major"), f.titleFontColor, f.titleFontBold ?? !0, f.titleFontItalic ?? !1, f.titleRotation, f.titleVerticalMode, f.titleManualLayout, Math.max(i.front.w, i.front.h));
1614
+ }
1615
+ }
1616
+ function He(e, t, n, r, i = !1) {
1617
+ if (!n) return;
1618
+ b(e, t, n, r);
1619
+ let a = new Map(t.series[0]?.dataPointOverrides?.map((e) => [e.idx, e]) ?? []), o = i ? (t.series[0]?.categories?.length ? t.series[0].categories : t.categories).map((e, n) => {
1620
+ let r = t.series[0]?.dataPointColors?.[n];
1621
+ return {
1622
+ label: e,
1623
+ color: r === "00000000" ? "transparent" : r ? `#${r}` : ve(n),
1624
+ series: t.series[0],
1625
+ point: a.get(n)
1626
+ };
1627
+ }) : t.series.map((e, t) => ({
1628
+ label: e.name || `Series ${t + 1}`,
1629
+ color: ve(t, e),
1630
+ series: e,
1631
+ point: void 0
1632
+ })), s = d(t.legendFontSizeHpt, r) ?? 9 * r;
1633
+ e.font = `${t.legendFontBold ? "bold " : ""}${s}px ${Se(t.legendFontFace)}`, e.textAlign = "left", e.textBaseline = "middle";
1634
+ let c = Math.max(s * 1.45, 12), l = Math.min(7 * r, c * .7);
1635
+ if (t.legendPos === "t" || t.legendPos === "b" || t.legendManualLayout != null && n.w >= n.h) {
1636
+ let a = o.map((t) => l + 4 + e.measureText(t.label).width), s = f(a, Math.max(1, n.w - 8), 12).slice(0, Math.max(0, Math.floor((n.h - 4 + 1e-6) / c))), u = n.y + 2 + c / 2;
1637
+ for (let d of s) {
1638
+ let s = d.map((e) => Math.min(n.w, a[e])), f = s.reduce((e, t) => e + t, 0) + Math.max(0, d.length - 1) * 12, p = n.x + Math.max(4, (n.w - f) / 2);
1639
+ for (let n = 0; n < d.length; n++) {
1640
+ let a = o[d[n]], c = Math.max(0, s[n] - l - 4);
1641
+ if (!i && t.chartType.toLowerCase().includes("line") && a.series?.lineHidden !== !0) {
1642
+ let t = a.series?.lineWidthEmu == null ? Math.max(1, 2 * r) : Math.max(.5, a.series.lineWidthEmu / g * r);
1643
+ e.beginPath(), e.moveTo(p, u), e.lineTo(p + l, u), e.strokeStyle = a.series?.lineColor ? `#${a.series.lineColor}` : be(a.color, .7), e.lineWidth = t, e.setLineDash(x(a.series?.chartexStyle?.lineDash ?? "solid", t)), e.stroke(), e.setLineDash([]);
1644
+ } else {
1645
+ a.color !== "transparent" && (e.fillStyle = a.color, e.fillRect(p, u - l / 2, l, l));
1646
+ let t = a.point?.lineHidden ?? a.series?.lineHidden, n = a.point?.lineColor ?? a.series?.lineColor;
1647
+ t !== !0 && n && (e.strokeStyle = `#${n}`, e.lineWidth = (a.point?.lineWidthEmu ?? a.series?.lineWidthEmu) == null ? .75 * r : Math.max(.25, (a.point?.lineWidthEmu ?? a.series?.lineWidthEmu ?? 0) / g * r), e.setLineDash(x(a.point?.lineDash ?? a.series?.chartexStyle?.lineDash ?? "solid", e.lineWidth)), e.strokeRect(p, u - l / 2, l, l), e.setLineDash([]));
1648
+ }
1649
+ e.fillStyle = t.legendFontColor ? `#${t.legendFontColor}` : "#595959", e.fillText(S(e, a.label, c), p + l + 4, u), p += s[n] + 12;
1650
+ }
1651
+ u += c;
1652
+ }
1653
+ return;
1654
+ }
1655
+ let u = n.y;
1656
+ for (let a = 0; a < o.length; a++) {
1657
+ let d = o[a], f = n.x + 8 + l, p = Math.max(0, n.x + n.w - 4 - f), m = Math.max(s * 1.2, 10), h = C(d.label, p, m * (i ? 1 : 2), m, (t) => e.measureText(t).width);
1658
+ if (h.length === 0) continue;
1659
+ let _ = Math.max(c, h.length * m + 2);
1660
+ if (u + _ > n.y + n.h + 1e-6) break;
1661
+ let v = u + _ / 2;
1662
+ if (!i && t.chartType.toLowerCase().includes("line")) {
1663
+ let t = d.series?.lineWidthEmu == null ? Math.max(1, 2 * r) : Math.max(.5, d.series.lineWidthEmu / g * r);
1664
+ d.series?.lineHidden !== !0 && (e.beginPath(), e.moveTo(n.x + 4, v), e.lineTo(n.x + 4 + l, v), e.strokeStyle = d.series?.lineColor ? `#${d.series.lineColor}` : be(d.color, .7), e.lineWidth = t, e.setLineDash(x(d.series?.chartexStyle?.lineDash ?? "solid", t)), e.stroke(), e.setLineDash([]));
1665
+ } else {
1666
+ d.color !== "transparent" && (e.fillStyle = d.color, e.fillRect(n.x + 4, v - l / 2, l, l));
1667
+ let t = d.point?.lineHidden ?? d.series?.lineHidden, i = d.point?.lineColor ?? d.series?.lineColor;
1668
+ t !== !0 && i && (e.strokeStyle = `#${i}`, e.lineWidth = (d.point?.lineWidthEmu ?? d.series?.lineWidthEmu) == null ? .75 * r : Math.max(.25, (d.point?.lineWidthEmu ?? d.series?.lineWidthEmu ?? 0) / g * r), e.setLineDash(x(d.point?.lineDash ?? d.series?.chartexStyle?.lineDash ?? "solid", e.lineWidth)), e.strokeRect(n.x + 4, v - l / 2, l, l), e.setLineDash([]));
1669
+ }
1670
+ e.fillStyle = t.legendFontColor ? `#${t.legendFontColor}` : "#595959";
1671
+ let y = v - (h.length - 1) * m / 2;
1672
+ h.forEach((t, n) => e.fillText(t, f, y + n * m)), u += _;
1673
+ }
1674
+ }
1675
+ function Ue(e, t, n, r, i, a) {
1676
+ let o = i ? 100 : 1, s = e.valAxisMinorTickMark ?? "cross";
1677
+ return p({
1678
+ dataMin: t,
1679
+ dataMax: n,
1680
+ explicitMin: e.valMin == null ? i ? t : null : e.valMin * o,
1681
+ explicitMax: e.valMax == null ? i ? n : null : e.valMax * o,
1682
+ majorUnit: e.valAxisMajorUnit == null ? null : e.valAxisMajorUnit * o,
1683
+ minorUnit: e.valAxisMinorUnit == null ? null : e.valAxisMinorUnit * o,
1684
+ axisLenPt: r,
1685
+ axisOrientation: a,
1686
+ logBase: e.valAxisLogBase,
1687
+ reversed: e.valAxisOrientation === "maxMin",
1688
+ needMinor: e.valAxisMinorGridlines === !0 || s !== "none"
1689
+ });
1690
+ }
1691
+ function We(e, t, n) {
1692
+ let r = e != null && Number.isFinite(e) ? (e % 360 + 360) % 360 : 0, i = Number.isFinite(t) ? Math.max(0, Math.min(1, t)) : 0, a = Number.isFinite(n) ? Math.max(0, Math.min(1 - i, n)) : 0, o = Math.PI / 2 - (r * Math.PI / 180 + i * Math.PI * 2), s = o - a * Math.PI * 2;
1693
+ return {
1694
+ start: Math.min(o, s),
1695
+ end: Math.max(o, s),
1696
+ middle: (o + s) / 2,
1697
+ leading: o
1698
+ };
1699
+ }
1700
+ function Ge(e) {
1701
+ let { front: t } = e, n = t.x, r = t.x + t.w, i = e.topology.farX === "min" ? n : r, a = i === n ? r : n, o = e.topology.axisY === "min" ? t.y : t.y + t.h, s = o === t.y ? t.y + t.h : t.y, { nearDepth: c, farDepth: l } = e.topology, u = e.project(n, o, c), d = e.project(r, o, c), f = e.project(r, o, l), p = e.project(n, o, l), m = e.project(n, s, l), h = e.project(r, s, l), g = e.project(i, o, c), _ = e.project(i, o, l), v = e.project(i, s, l), y = e.project(i, s, c);
1702
+ return {
1703
+ floor: [
1704
+ u,
1705
+ d,
1706
+ f,
1707
+ p
1708
+ ],
1709
+ sideWall: [
1710
+ g,
1711
+ _,
1712
+ v,
1713
+ y
1714
+ ],
1715
+ backWall: [
1716
+ p,
1717
+ f,
1718
+ h,
1719
+ m
1720
+ ],
1721
+ sideX: i,
1722
+ seriesAxisX: a,
1723
+ floorY: o,
1724
+ oppositeFloorY: s,
1725
+ nearDepth: c,
1726
+ farDepth: l
1727
+ };
1728
+ }
1729
+ function Q(e, t, n, r, i = "A6A6A6", a = .75) {
1730
+ let o = t != null && Number.isFinite(t) && t >= 0 ? Math.max(.25, t / g * r) : a * r;
1731
+ return {
1732
+ color: `#${e ?? i}`,
1733
+ width: o,
1734
+ dash: x(n ?? "solid", o)
1735
+ };
1736
+ }
1737
+ function $(e, t) {
1738
+ e.strokeStyle = t.color, e.lineWidth = t.width, e.setLineDash(t.dash);
1739
+ }
1740
+ function Ke(e, t, n, r, i, a, o, s, c) {
1741
+ let { front: l } = n, u = l.x, d = l.x + l.w, f = Ge(n), { sideX: p, floorY: m, oppositeFloorY: h, nearDepth: g, farDepth: _ } = f, v = (t, n) => {
1742
+ n?.fillHidden === !0 || !n?.fillColor || Te(e, t, `#${n.fillColor}`, 0);
1743
+ };
1744
+ v(f.floor, t.threeD?.floor), v(f.sideWall, t.threeD?.sideWall), v(f.backWall, t.threeD?.backWall);
1745
+ let y = (t, a) => {
1746
+ $(e, a);
1747
+ for (let a of t) if (i === "horizontal") {
1748
+ let t = l.x + r.fraction(a) * l.w, i = n.project(t, m, _), o = n.project(t, h, _);
1749
+ e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(o.x, o.y), e.stroke();
1750
+ } else {
1751
+ let t = l.y + l.h - r.fraction(a) * l.h, i = n.project(p, t, g), o = n.project(p, t, _), s = n.project(p === u ? d : u, t, _);
1752
+ e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(o.x, o.y), e.stroke(), e.beginPath(), e.moveTo(o.x, o.y), e.lineTo(s.x, s.y), e.stroke();
1753
+ }
1754
+ };
1755
+ t.valAxisMinorGridlines === !0 && y(r.minorTicks, Q(t.valAxisMinorGridlineColor, t.valAxisMinorGridlineWidthEmu, t.valAxisMinorGridlineDash, c, "D9D9D9", .5)), t.valAxisMajorGridlines !== !1 && y(r.majorTicks, Q(t.valAxisGridlineColor, t.valAxisGridlineWidthEmu, t.valAxisGridlineDash, c, "898989", 1)), $(e, Q(null, null, null, c, "898989", 1));
1756
+ for (let t = 0; t < a; t++) if (i === "vertical") {
1757
+ let r = l.x + Z(t, a, o, s) * l.w, i = n.project(r, m, g), c = n.project(r, m, _);
1758
+ e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(c.x, c.y), e.stroke();
1759
+ } else {
1760
+ let r = l.y + Z(t, a, o, s) * l.h, i = n.project(p, r, g), c = n.project(p, r, _);
1761
+ e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(c.x, c.y), e.stroke();
1762
+ }
1763
+ let b = (t, n) => {
1764
+ if (!(n?.lineHidden === !0 || t.length < 2)) {
1765
+ $(e, Q(n?.lineColor, n?.lineWidthEmu, n?.lineDash, c, "898989", 1)), e.beginPath(), e.moveTo(t[0].x, t[0].y);
1766
+ for (let n = 1; n < t.length; n++) e.lineTo(t[n].x, t[n].y);
1767
+ e.lineTo(t[0].x, t[0].y), e.closePath(), e.stroke();
1768
+ }
1769
+ };
1770
+ b(f.floor, t.threeD?.floor), b(f.sideWall, t.threeD?.sideWall), b(f.backWall, t.threeD?.backWall), e.setLineDash([]);
1771
+ }
1772
+ function qe(e, t, n, r, i, a, o, s, c) {
1773
+ let l = Xe(t, n, r, i, a, o, c), u = c === "vertical" ? !t.catAxisHidden && !t.catAxisLineHidden : !t.valAxisHidden && !t.valAxisLineHidden, d = c === "vertical" ? !t.valAxisHidden && !t.valAxisLineHidden : !t.catAxisHidden && !t.catAxisLineHidden;
1774
+ u && ($(e, Q(c === "vertical" ? t.catAxisLineColor : t.valAxisLineColor, c === "vertical" ? t.catAxisLineWidthEmu : t.valAxisLineWidthEmu, null, s, "898989", 1)), e.beginPath(), e.moveTo(l.horizontalStart.x, l.horizontalStart.y), e.lineTo(l.horizontalEnd.x, l.horizontalEnd.y), e.stroke()), d && ($(e, Q(c === "vertical" ? t.valAxisLineColor : t.catAxisLineColor, c === "vertical" ? t.valAxisLineWidthEmu : t.catAxisLineWidthEmu, null, s, "898989", 1)), e.beginPath(), e.moveTo(l.verticalStart.x, l.verticalStart.y), e.lineTo(l.verticalEnd.x, l.verticalEnd.y), e.stroke()), e.setLineDash([]);
1775
+ }
1776
+ function Je(e, t, n, r) {
1777
+ let i = {
1778
+ x: (e.x + t.x) / 2,
1779
+ y: (e.y + t.y) / 2
1780
+ };
1781
+ return r === "horizontal" ? {
1782
+ x: i.x <= n.x ? -1 : 1,
1783
+ y: 0
1784
+ } : {
1785
+ x: 0,
1786
+ y: i.y <= n.y ? -1 : 1
1787
+ };
1788
+ }
1789
+ function Ye(e, t, n, r, i, a, o, s, c) {
1790
+ if (!t || t === "none") return;
1791
+ let l = Je(r, i, a, o), u = (s === "minor" ? 4 : 6) * c, d = t === "cross" ? u / 2 : u, f = t === "out" || t === "cross" ? d : 0, p = t === "in" || t === "cross" ? d : 0;
1792
+ e.beginPath(), e.moveTo(n.x + l.x * f, n.y + l.y * f), e.lineTo(n.x - l.x * p, n.y - l.y * p), e.stroke();
1793
+ }
1794
+ function Xe(e, t, n, r, i, a, o) {
1795
+ let { front: s } = t, c = (e) => Math.max(0, Math.min(1, e)), l = t.topology.axisX === "min" ? s.x : s.x + s.w, u = t.topology.axisY === "min" ? s.y : s.y + s.h, d = () => {
1796
+ if (e.catAxisCrossesAt != null && Number.isFinite(e.catAxisCrossesAt)) {
1797
+ let t = e.chartType.endsWith("Pct") ? e.catAxisCrossesAt * 100 : e.catAxisCrossesAt;
1798
+ return c(n.fraction(t));
1799
+ }
1800
+ let t = e.catAxisCrosses ?? "autoZero";
1801
+ return c(t === "min" ? n.fraction(n.min) : t === "max" ? n.fraction(n.max) : n.fraction(0));
1802
+ }, f = () => {
1803
+ let t = e.valAxisCrossesAt;
1804
+ if (t != null && Number.isFinite(t)) return Z(t - 1, r, i, a);
1805
+ let n = e.valAxisCrosses;
1806
+ if (n !== "min" && n !== "max") return null;
1807
+ let o = +(n === "max");
1808
+ return a ? 1 - o : o;
1809
+ }, p = d(), m = f(), h = o === "horizontal" ? s.x + p * s.w : m == null ? l : s.x + m * s.w, g = o === "vertical" ? s.y + s.h - p * s.h : m == null ? u : s.y + m * s.h, _ = t.topology.nearDepth;
1810
+ return {
1811
+ axisX: h,
1812
+ axisY: g,
1813
+ depth: _,
1814
+ horizontalStart: t.project(s.x, g, _),
1815
+ horizontalEnd: t.project(s.x + s.w, g, _),
1816
+ verticalStart: t.project(h, s.y + s.h, _),
1817
+ verticalEnd: t.project(h, s.y, _)
1818
+ };
1819
+ }
1820
+ function Ze(e, t, n, r, i, a, o, s, c) {
1821
+ let { front: l } = n, u = Xe(t, n, r, i, a, o, s), { axisX: d, axisY: f, depth: p } = u, m = n.project(l.x + l.w / 2, l.y + l.h / 2, p), h = t.valAxisMinorTickMark ?? "cross";
1822
+ if (!t.valAxisHidden && !t.valAxisLineHidden) {
1823
+ $(e, Q(t.valAxisLineColor, t.valAxisLineWidthEmu, null, c, "898989", 1));
1824
+ let i = (e) => s === "horizontal" ? n.project(l.x + r.fraction(e) * l.w, f, p) : n.project(d, l.y + l.h - r.fraction(e) * l.h, p), a = s === "horizontal" ? u.horizontalStart : u.verticalStart, o = s === "horizontal" ? u.horizontalEnd : u.verticalEnd;
1825
+ for (let n of r.majorTicks) Ye(e, t.valAxisMajorTickMark, i(n), a, o, m, s === "vertical" ? "horizontal" : "vertical", "major", c);
1826
+ for (let t of r.minorTicks) Ye(e, h, i(t), a, o, m, s === "vertical" ? "horizontal" : "vertical", "minor", c);
1827
+ }
1828
+ if (!t.catAxisHidden && !t.catAxisLineHidden) {
1829
+ $(e, Q(t.catAxisLineColor, t.catAxisLineWidthEmu, null, c, "898989", 1));
1830
+ let r = s === "vertical" ? u.horizontalStart : u.verticalStart, h = s === "vertical" ? u.horizontalEnd : u.verticalEnd, g = Math.max(1, Math.floor(t.catAxisTickMarkSkip ?? 1));
1831
+ for (let u = 0; u < i; u += g) {
1832
+ let g = Z(u, i, a, o), _ = s === "vertical" ? n.project(l.x + g * l.w, f, p) : n.project(d, l.y + g * l.h, p);
1833
+ Ye(e, t.catAxisMajorTickMark, _, r, h, m, s === "vertical" ? "vertical" : "horizontal", "major", c);
1834
+ }
1835
+ let _ = t.catAxisMinorUnit;
1836
+ if (t.catAxisMinorTickMark && t.catAxisMinorTickMark !== "none" && _ != null && Number.isFinite(_) && _ > 0) {
1837
+ let u = t.catAxisMajorUnit != null && Number.isFinite(t.catAxisMajorUnit) && t.catAxisMajorUnit > 0 ? t.catAxisMajorUnit : g, v = Math.min(512, Math.ceil(i / _));
1838
+ for (let g = 1; g < v; g++) {
1839
+ let v = g * _;
1840
+ if (!(v < i)) break;
1841
+ if (Math.abs(v / u - Math.round(v / u)) < 1e-9) continue;
1842
+ let y = Z(v, i, a, o), b = s === "vertical" ? n.project(l.x + y * l.w, f, p) : n.project(d, l.y + y * l.h, p);
1843
+ Ye(e, t.catAxisMinorTickMark, b, r, h, m, s === "vertical" ? "vertical" : "horizontal", "minor", c);
1844
+ }
1845
+ }
1846
+ }
1847
+ e.setLineDash([]);
1848
+ }
1849
+ function Qe(e, t, n, r) {
1850
+ if (!t.threeD) return !1;
1851
+ let i = t.chartType === "clusteredBar" || t.chartType === "clusteredBarH" || t.chartType.startsWith("stackedBar"), a = t.chartType.endsWith("H") || t.chartType.includes("BarH"), o = t.chartType.startsWith("stacked"), s = i && !o && t.threeD.barGrouping === "standard", { plot: u, legend: f } = Re(e, t, n, r, a ? "horizontal" : "vertical"), p = A(t.threeD, u, {
1852
+ sceneDepthScale: i ? s ? .65 : .1 : .4,
1853
+ perspectiveTangentGain: s ? 1 : 2
1854
+ });
1855
+ if (!p) return !0;
1856
+ let _ = t.chartType.endsWith("Pct"), v = t.series.find((e) => (e.categories?.length ?? 0) > 0)?.categories ?? t.categories, y = Math.max(1, v.length, ...t.series.map((e) => e.values.length)), b = t.catAxisOrientation === "maxMin", S = t.catAxisCrossBetween === "between", C = t.dispBlanksAs ?? "gap", w = t.valAxisLogBase != null && Number.isFinite(t.valAxisLogBase) && t.valAxisLogBase >= 2, D = (e, n) => {
1857
+ let r = t.series[e]?.values[n];
1858
+ return r != null && Number.isFinite(r) && (!w || r > 0) || r == null && (o || C === "zero");
1859
+ }, O = (e, n) => {
1860
+ let r = t.series[e]?.values[n] ?? 0;
1861
+ if (!Number.isFinite(r)) return 0;
1862
+ if (!_) return r;
1863
+ let i = 0;
1864
+ for (let e of t.series) {
1865
+ let t = e.values[n];
1866
+ t != null && Number.isFinite(t) && (i = Math.max(i, Math.abs(t)));
1867
+ }
1868
+ if (!(i > 0)) return 0;
1869
+ let a = 0;
1870
+ for (let e of t.series) {
1871
+ let t = e.values[n];
1872
+ t != null && Number.isFinite(t) && (a += Math.abs(t) / i);
1873
+ }
1874
+ return a > 0 ? r / i / a * 100 : 0;
1875
+ }, k = (e, t) => {
1876
+ let n = e + t;
1877
+ return Number.isFinite(n) ? n : t < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
1878
+ }, j = 0, M = 0;
1879
+ if (o) {
1880
+ for (let e = 0; e < y; e++) {
1881
+ let n = 0, r = 0;
1882
+ for (let i = 0; i < t.series.length; i++) {
1883
+ let t = O(i, e);
1884
+ t >= 0 ? n = k(n, t) : r = k(r, t);
1885
+ }
1886
+ j = Math.min(j, r), M = Math.max(M, n);
1887
+ }
1888
+ _ && (j = j < 0 ? -100 : 0, M = M > 0 ? 100 : 0, j === 0 && M === 0 && (M = 1));
1889
+ } else {
1890
+ let e = h(t.series.flatMap((e) => e.values).filter((e) => e != null && Number.isFinite(e) && (!w || e > 0)), w ? {
1891
+ min: 1,
1892
+ max: 10
1893
+ } : {
1894
+ min: 0,
1895
+ max: 1
1896
+ });
1897
+ j = w ? e.min : Math.min(0, e.min), M = w ? e.max : Math.max(0, e.max);
1898
+ }
1899
+ let N = Ue(t, j, M, (a ? p.front.w : p.front.h) / r, _, a ? "horizontal" : "vertical"), P = (e) => Number.isFinite(e) ? Math.max(N.min, Math.min(N.max, e)) : N.min;
1900
+ Ke(e, t, p, N, a ? "horizontal" : "vertical", y, S, b, r);
1901
+ let { front: F } = p, I = Math.max(1, t.series.length), L = [], ee = t.series.map((e) => new Map(e.dataPointOverrides?.map((e) => [e.idx, e]) ?? [])), B = t.series.map((e) => new Map(e.dataLabelOverrides?.map((e) => [e.idx, e]) ?? []));
1902
+ if (i) {
1903
+ let i = p.prismInterval(0, 1, !0), c = [], l = Array(y).fill(0), u = Array(y).fill(0), d = (a ? F.h : F.w) / y, f = t.barGapWidth != null && Number.isFinite(t.barGapWidth) && t.barGapWidth >= 0 ? t.barGapWidth : 150;
1904
+ for (let e = 0; e < t.series.length; e++) {
1905
+ let n = t.series[e], h = s ? p.prismInterval(e, I, !1) : i, g = T(d, f, s ? 0 : e, s ? 1 : I, o || s);
1906
+ for (let i = 0; i < y; i++) {
1907
+ if (!D(e, i)) continue;
1908
+ let s = O(e, i), f = ee[e].get(i), p = f?.fillHidden === !0 ? "transparent" : f?.color ?? n.dataPointColors?.[i], v = p === "00000000" ? "transparent" : p ? `#${p}` : n.color === "00000000" ? "transparent" : ve(e, n), x = ye(n, f), S = f?.lineColor ?? n.lineColor, C = f?.lineWidthEmu ?? n.lineWidthEmu, T = f?.lineDash ?? n.chartexStyle?.lineDash ?? "solid", A = n.chartexStyle?.lineCap === "rnd" ? "round" : n.chartexStyle?.lineCap === "sq" ? "square" : "butt", j = n.chartexStyle?.lineJoin === "round" || n.chartexStyle?.lineJoin === "bevel" ? n.chartexStyle.lineJoin : "miter", M = o ? s >= 0 ? l[i] : u[i] : 0, I = k(M, s);
1909
+ o && (s >= 0 ? l[i] = I : u[i] = I);
1910
+ let L = P(M), R = P(I), z = n.threeDShape ?? t.threeD.shape ?? "box", B = z === "cone" || z === "pyramid", V = z === "coneToMax" || z === "pyramidToMax", H = (e) => {
1911
+ if (!B) return 1;
1912
+ let t = w && !(M > 0) ? N.min : M, n = N.fraction(t), r = N.fraction(I), i = N.fraction(e), a = r - n;
1913
+ return a === 0 || !Number.isFinite(a) || !Number.isFinite(i - n) ? +(e === t) : Math.max(0, Math.min(1, 1 - (i - n) / a));
1914
+ }, U = (e) => {
1915
+ if (!V) return 1;
1916
+ let t = I >= M ? N.max : N.min, n = w ? N.min : 0, r = N.fraction(t), i = N.fraction(n), a = N.fraction(e), o = Math.abs(r - i);
1917
+ return !(o > 0) || ![
1918
+ r,
1919
+ i,
1920
+ a
1921
+ ].every(Number.isFinite) ? E(e, N.min, N.max) : Math.max(0, Math.min(1, Math.abs(r - a) / o));
1922
+ }, W = V ? U(L) : H(L), G = V ? U(R) : H(R);
1923
+ if (a) {
1924
+ let t = F.x + N.fraction(L) * F.w, n = F.x + N.fraction(R) * F.w, a = b ? y - 1 - i : i, o = F.y + a * d + g.offset;
1925
+ c.push({
1926
+ x: Math.min(t, n),
1927
+ y: o,
1928
+ width: Math.abs(n - t),
1929
+ height: g.size,
1930
+ nearDepth: h.near,
1931
+ farDepth: h.far,
1932
+ categoryIndex: i,
1933
+ seriesIndex: e,
1934
+ color: v,
1935
+ shape: z,
1936
+ baseCoord: t,
1937
+ endCoord: n,
1938
+ baseScale: W,
1939
+ endScale: G,
1940
+ omitBaseCap: !1,
1941
+ omitEndCap: !1,
1942
+ outline: x,
1943
+ outlineColor: S ? `#${S}` : "rgba(0,0,0,0.42)",
1944
+ outlineWidth: C == null ? .75 * r / m : ge(C, r),
1945
+ outlineDash: T,
1946
+ outlineCap: A,
1947
+ outlineJoin: j,
1948
+ labelValue: _ ? s / 100 : s
1949
+ });
1950
+ } else {
1951
+ let t = F.y + F.h - N.fraction(L) * F.h, n = F.y + F.h - N.fraction(R) * F.h, a = b ? y - 1 - i : i, o = F.x + a * d + g.offset;
1952
+ c.push({
1953
+ x: o,
1954
+ y: Math.min(t, n),
1955
+ width: g.size,
1956
+ height: Math.abs(n - t),
1957
+ nearDepth: h.near,
1958
+ farDepth: h.far,
1959
+ categoryIndex: i,
1960
+ seriesIndex: e,
1961
+ color: v,
1962
+ shape: z,
1963
+ baseCoord: t,
1964
+ endCoord: n,
1965
+ baseScale: W,
1966
+ endScale: G,
1967
+ omitBaseCap: !1,
1968
+ omitEndCap: !1,
1969
+ outline: x,
1970
+ outlineColor: S ? `#${S}` : "rgba(0,0,0,0.42)",
1971
+ outlineWidth: C == null ? .75 * r / m : ge(C, r),
1972
+ outlineDash: T,
1973
+ outlineCap: A,
1974
+ outlineJoin: j,
1975
+ labelValue: _ ? s / 100 : s
1976
+ });
1977
+ }
1978
+ }
1979
+ }
1980
+ if (o) {
1981
+ let e = _e(c, y);
1982
+ for (let t = 0; t < y; t++) {
1983
+ let n = e[t];
1984
+ for (let e of [-1, 1]) {
1985
+ let t = n.filter((t) => Math.sign(t.labelValue) === e && !we(t.color) && Math.abs(t.endCoord - t.baseCoord) > 1e-9).sort((e, t) => e.seriesIndex - t.seriesIndex);
1986
+ for (let e = 0; e + 1 < t.length; e++) {
1987
+ let n = t[e], r = t[e + 1], i = 1e-8 * Math.max(1, Math.abs(n.endCoord), Math.abs(r.baseCoord));
1988
+ n.shape !== r.shape || Math.abs(n.endCoord - r.baseCoord) > i || Math.abs(n.endScale - r.baseScale) > 1e-9 || n.nearDepth !== r.nearDepth || n.farDepth !== r.farDepth || (n.omitEndCap = !0, r.omitBaseCap = !0);
1989
+ }
1990
+ }
1991
+ let r = n.find((e) => e.labelValue > 0 && !we(e.color)), i = n.find((e) => e.labelValue < 0 && !we(e.color));
1992
+ if (r && i) {
1993
+ let e = 1e-8 * Math.max(1, Math.abs(r.baseCoord), Math.abs(i.baseCoord));
1994
+ r.shape === i.shape && Math.abs(r.baseCoord - i.baseCoord) <= e && Math.abs(r.baseScale - i.baseScale) <= 1e-9 && r.nearDepth === i.nearDepth && r.farDepth === i.farDepth && (r.omitBaseCap = !0, i.omitBaseCap = !0);
1995
+ }
1996
+ }
1997
+ }
1998
+ let h = {
1999
+ remaining: te,
2000
+ exceeded: !1
2001
+ }, g = c.flatMap((e) => De(p, e.shape, a, e.x, e.y, e.width, e.height, e.baseCoord, e.endCoord, e.nearDepth, e.farDepth, e.color, e.baseScale, e.endScale, e.omitBaseCap, e.omitEndCap, e.outline && e.outlineColor ? {
2002
+ color: e.outlineColor,
2003
+ width: e.outlineWidth,
2004
+ dash: x(e.outlineDash, e.outlineWidth),
2005
+ cap: e.outlineCap,
2006
+ join: e.outlineJoin
2007
+ } : void 0, h));
2008
+ if (h.exceeded) return Me(e, n), !0;
2009
+ for (let t of G(g)) Ae(e, t);
2010
+ for (let i of c) {
2011
+ let o = t.series[i.seriesIndex], s = a ? p.project(i.endCoord, i.y + i.height / 2, (i.nearDepth + i.farDepth) / 2) : p.project(i.x + i.width / 2, i.endCoord, (i.nearDepth + i.farDepth) / 2), c = B[i.seriesIndex].get(i.categoryIndex);
2012
+ Le(t, o, c) && L.push(() => Ie(e, t, o, i.seriesIndex, i.categoryIndex, i.labelValue, s, n, r, 0, void 0, c, "t", s, !0, t.valAxisDisplayUnits));
2013
+ }
2014
+ } else {
2015
+ let i = t.series.map(() => Array(y).fill(0)), a = t.series.map(() => Array(y).fill(0));
2016
+ if (o) {
2017
+ let e = Array(y).fill(0), n = Array(y).fill(0);
2018
+ for (let r = 0; r < t.series.length; r++) for (let t = 0; t < y; t++) {
2019
+ let o = O(r, t), s = o >= 0 ? e[t] : n[t];
2020
+ i[r][t] = s, a[r][t] = k(s, o), o >= 0 ? e[t] = k(e[t], o) : n[t] = k(n[t], o);
2021
+ }
2022
+ }
2023
+ let s = (e) => {
2024
+ let t = p.seriesDepth(e, I, o), n = 0, r = 0;
2025
+ for (let i = 0; i < y; i++) {
2026
+ if (!D(e, i)) continue;
2027
+ let s = o ? a[e][i] : O(e, i), c = F.x + Z(i, y, S, b) * F.w, l = F.y + F.h - N.fraction(P(s)) * F.h;
2028
+ n += p.cameraDepth(c, l, t), r++;
2029
+ }
2030
+ return r > 0 ? n / r : -Infinity;
2031
+ }, c = t.series.map((e, t) => t).sort((e, t) => s(e) - s(t) || t - e), l = [], u = [], d = !1;
2032
+ for (let s of c) {
2033
+ if (d) break;
2034
+ let c = t.series[s], f = ve(s, c), m = o ? p.prismInterval(0, 1, !0) : p.prismInterval(s, I, !1), h = F.x + F.w / 2, v = F.y + F.h / 2, w = p.cameraDepth(h, v, m.near) >= p.cameraDepth(h, v, m.far) ? m.near : m.far, T = [], E = [], k = [], A = [], j = [], M = [], P = [], V = [], H = [], U = [];
2035
+ for (let e = 0; e < y; e++) {
2036
+ if (!D(s, e)) {
2037
+ T.push(null), E.push(null), k.push(null), A.push(null), j.push(null), M.push(null), P.push(null), V.push(null), H.push(null), U.push(null);
2038
+ continue;
2039
+ }
2040
+ let n = o ? a[s][e] : O(s, e), r = o ? i[s][e] : 0, c = F.x + Z(e, y, S, b) * F.w, l = N.fraction(n), u = N.fraction(r), d = Number.isFinite(u) ? u : r <= N.min ? 0 : 1, f = Number.isFinite(l) && l >= 0 && l <= 1, m = Number.isFinite(l) ? Math.max(0, Math.min(1, l)) : n <= N.min ? 0 : 1, h = F.y + F.h - m * F.h, g = F.y + F.h - Math.max(0, Math.min(1, d)) * F.h;
2041
+ T.push(t.chartType.toLowerCase().includes("area") || f ? p.project(c, h, w) : null), E.push(p.project(c, g, w)), k.push(f ? p.cameraDepth(c, h, w) : null), A.push(p.cameraDepth(c, g, w)), j.push(n), M.push(c), P.push(h), V.push(g), H.push(l), U.push(d);
2042
+ }
2043
+ let W = [], G = null;
2044
+ for (let e = 0; e < T.length; e++) {
2045
+ let t = T[e], n = E[e];
2046
+ if (!t || !n) {
2047
+ C === "gap" && (G && W.push(G), G = null);
2048
+ continue;
2049
+ }
2050
+ G ??= {
2051
+ upper: [],
2052
+ lower: [],
2053
+ upperDepths: [],
2054
+ lowerDepths: [],
2055
+ indices: [],
2056
+ sceneXs: [],
2057
+ upperYs: [],
2058
+ lowerYs: [],
2059
+ upperFractions: [],
2060
+ lowerFractions: []
2061
+ }, G.upper.push(t), G.lower.push(n), G.upperDepths.push(k[e] ?? 0), G.lowerDepths.push(A[e] ?? 0), G.indices.push(e), G.sceneXs.push(M[e] ?? 0), G.upperYs.push(P[e] ?? 0), G.lowerYs.push(V[e] ?? 0), G.upperFractions.push(H[e] ?? 0), G.lowerFractions.push(U[e] ?? 0);
2062
+ }
2063
+ G && W.push(G);
2064
+ let K = [];
2065
+ if (t.chartType.toLowerCase().includes("area")) for (let t of W) {
2066
+ let n = null;
2067
+ for (let r = 0; r + 1 < t.upper.length; r++) {
2068
+ let i = z(t.lowerFractions[r], t.lowerFractions[r + 1], t.upperFractions[r], t.upperFractions[r + 1]);
2069
+ for (let a = 0; a < i.length; a++) {
2070
+ let o = i[a], s = t.sceneXs[r] + (t.sceneXs[r + 1] - t.sceneXs[r]) * o.startT, c = t.sceneXs[r] + (t.sceneXs[r + 1] - t.sceneXs[r]) * o.endT, u = F.y + F.h - o.lowerStart * F.h, h = F.y + F.h - o.lowerEnd * F.h, g = F.y + F.h - o.upperStart * F.h, _ = F.y + F.h - o.upperEnd * F.h, v = {
2071
+ ...p.project(s, g, w),
2072
+ cameraDepth: p.cameraDepth(s, g, w),
2073
+ cameraWeight: p.cameraProjectionWeight(s, g, w)
2074
+ }, y = {
2075
+ ...p.project(c, _, w),
2076
+ cameraDepth: p.cameraDepth(c, _, w),
2077
+ cameraWeight: p.cameraProjectionWeight(c, _, w)
2078
+ };
2079
+ n != null && Math.hypot(n.at(-1).x - v.x, n.at(-1).y - v.y) <= 1e-8 ? n.push(y) : (n && n.length >= 2 && K.push(n), n = [v, y]);
2080
+ let b = Ee(p, s, c, u, h, g, _, m.near, m.far, f, r === 0 && a === 0 && o.startT === 0, r + 2 === t.upper.length && a + 1 === i.length && o.endT === 1);
2081
+ for (let t of b) {
2082
+ if (l.length >= 1e4) {
2083
+ d = !0;
2084
+ break;
2085
+ }
2086
+ l.push({
2087
+ points: t.points,
2088
+ cameraDepth: t.cameraDepth,
2089
+ cameraDepths: t.cameraDepths,
2090
+ cameraWeights: t.cameraWeights,
2091
+ layer: 0,
2092
+ paint: () => Ae(e, t)
2093
+ });
2094
+ }
2095
+ if (d) break;
2096
+ }
2097
+ if (d) break;
2098
+ }
2099
+ if (n && n.length >= 2 && K.push(n), d) break;
2100
+ }
2101
+ let te = [];
2102
+ if (!t.chartType.toLowerCase().includes("area")) {
2103
+ let e = [], t = null;
2104
+ for (let n = 0; n < y; n++) {
2105
+ let r = j[n], i = r == null ? NaN : N.fraction(r);
2106
+ if (r == null || !Number.isFinite(i)) {
2107
+ C === "gap" && t && (e.push(t), t = null);
2108
+ continue;
2109
+ }
2110
+ t ??= [], t.push({
2111
+ x: F.x + Z(n, y, S, b) * F.w,
2112
+ fraction: i
2113
+ });
2114
+ }
2115
+ t && e.push(t);
2116
+ let n = (e) => {
2117
+ let t = Math.max(0, Math.min(1, e.fraction)), n = F.y + F.h - t * F.h;
2118
+ return {
2119
+ ...p.project(e.x, n, w),
2120
+ cameraDepth: p.cameraDepth(e.x, n, w),
2121
+ cameraWeight: p.cameraProjectionWeight(e.x, n, w)
2122
+ };
2123
+ }, r = (e) => {
2124
+ e && e.path.length >= 2 && te.push(e);
2125
+ };
2126
+ for (let t of e) {
2127
+ if (t.length < 2) continue;
2128
+ let e = [t[0]];
2129
+ for (let n = 0; n + 1 < t.length; n++) {
2130
+ let r = t[n - 1] ?? t[n], i = t[n], a = t[n + 1], o = t[n + 2] ?? a;
2131
+ if (c.smooth !== !0 || t.length < 3) {
2132
+ e.push(a);
2133
+ continue;
2134
+ }
2135
+ let s = {
2136
+ x: i.x + (a.x - r.x) / 6,
2137
+ fraction: i.fraction + (a.fraction - r.fraction) / 6
2138
+ }, l = {
2139
+ x: a.x - (o.x - i.x) / 6,
2140
+ fraction: a.fraction - (o.fraction - i.fraction) / 6
2141
+ };
2142
+ for (let t = 1; t <= 12; t++) {
2143
+ let n = t / 12, r = 1 - n;
2144
+ e.push({
2145
+ x: r * r * r * i.x + 3 * r * r * n * s.x + 3 * r * n * n * l.x + n * n * n * a.x,
2146
+ fraction: r * r * r * i.fraction + 3 * r * r * n * s.fraction + 3 * r * n * n * l.fraction + n * n * n * a.fraction
2147
+ });
2148
+ }
2149
+ }
2150
+ let i = null, a = 0;
2151
+ for (let t = 0; t + 1 < e.length; t++) {
2152
+ let o = e[t], s = e[t + 1], c = (e) => p.project(e.x, F.y + F.h - e.fraction * F.h, w), l = c(o), u = c(s), d = Math.hypot(u.x - l.x, u.y - l.y), f = Number.isFinite(d) ? d : Math.hypot(s.x - o.x, (s.fraction - o.fraction) * F.h), m = R(o.fraction, s.fraction);
2153
+ if (!m || m.endT - m.startT <= 1e-12) {
2154
+ r(i), i = null, a += f;
2155
+ continue;
2156
+ }
2157
+ let h = (e) => ({
2158
+ x: o.x + (s.x - o.x) * e,
2159
+ fraction: o.fraction + (s.fraction - o.fraction) * e
2160
+ }), g = c(h(m.startT)), _ = Math.hypot(g.x - l.x, g.y - l.y), v = n(h(m.startT)), y = n(h(m.endT));
2161
+ i != null && Math.hypot(i.path.at(-1).x - v.x, i.path.at(-1).y - v.y) <= 1e-8 ? (i.path.push(y), i.endClipped = t + 1 < e.length - 1 || m.endT < 1) : (r(i), i = {
2162
+ path: [v, y],
2163
+ startClipped: t > 0 || m.startT > 0,
2164
+ endClipped: t + 1 < e.length - 1 || m.endT < 1,
2165
+ dashOffset: a + (Number.isFinite(_) ? _ : f * m.startT)
2166
+ }), a += f;
2167
+ }
2168
+ r(i);
2169
+ }
2170
+ }
2171
+ let q = t.chartType.toLowerCase().includes("area"), J = c.lineHidden != null || c.lineColor != null || c.lineWidthEmu != null || c.chartexStyle?.lineHidden != null || c.chartexStyle?.lineColors?.some(Boolean) || c.chartexStyle?.lineWidthEmu != null || c.chartexStyle?.lineDash != null || c.chartexStyle?.lineCap != null || c.chartexStyle?.lineJoin != null;
2172
+ if (c.lineHidden !== !0 && (!q || J)) {
2173
+ let t = c.lineColor ? `#${c.lineColor}` : be(f, .7), n = c.lineWidthEmu ? Math.max(.5, c.lineWidthEmu / g) * r : q ? .75 * r : Math.max(1, 2 * r), i = x(c.chartexStyle?.lineDash ?? "solid", n), a = c.chartexStyle?.lineCap === "rnd" ? "round" : c.chartexStyle?.lineCap === "sq" ? "square" : "butt", o = c.chartexStyle?.lineJoin === "round" || c.chartexStyle?.lineJoin === "bevel" ? c.chartexStyle.lineJoin : "miter", s = (r, s, c = s, u = 0) => {
2174
+ let f = oe(r, {
2175
+ width: n,
2176
+ dash: i,
2177
+ dashOffset: u,
2178
+ lineCap: a,
2179
+ startCap: s,
2180
+ endCap: c,
2181
+ lineJoin: o
2182
+ });
2183
+ if (f == null) {
2184
+ d = !0;
2185
+ return;
2186
+ }
2187
+ if (l.length + f.length > 1e4) {
2188
+ d = !0;
2189
+ return;
2190
+ }
2191
+ for (let n of f) l.push({
2192
+ points: n.points,
2193
+ cameraDepth: n.cameraDepth,
2194
+ cameraDepths: n.cameraDepths,
2195
+ cameraWeights: n.cameraWeights,
2196
+ layer: 1,
2197
+ paint: () => je(e, n, t)
2198
+ });
2199
+ };
2200
+ if (q) for (let e of K) s(e, a);
2201
+ else for (let e of te) s(e.path, e.startClipped ? "butt" : a, e.endClipped ? "butt" : a, e.dashOffset);
2202
+ }
2203
+ let ne = c.dataPointOverrides?.some((e) => e.markerSymbol != null && e.markerSymbol !== "none") === !0;
2204
+ if (t.chartType.toLowerCase().includes("line") && (c.showMarker === !0 || ne)) for (let t = 0; t < T.length; t++) {
2205
+ let n = T[t];
2206
+ if (!n) continue;
2207
+ let i = ee[s].get(t), a = i?.markerSymbol ?? (c.showMarker === !0 ? c.markerSymbol ?? "circle" : "none");
2208
+ if (a === "none") continue;
2209
+ let o = i?.markerSize ?? c.markerSize ?? 5, l = i?.markerFill ?? c.markerFill ?? c.color ?? me[s % me.length], d = i?.markerLine ?? c.markerLine ?? c.lineColor ?? c.color ?? me[s % me.length], f = (i?.markerLineWidthEmu ?? c.markerLineWidthEmu) == null ? Math.max(.75, c.lineWidthEmu == null ? r : c.lineWidthEmu / g * r) : Math.max(.25, (i?.markerLineWidthEmu ?? c.markerLineWidthEmu ?? 0) / g * r);
2210
+ u.push(() => Fe(e, n, a, Math.max(2, o) * r, l === "00000000" ? "transparent" : `#${l}`, `#${d}`, f));
2211
+ }
2212
+ for (let i = 0; i < T.length; i++) {
2213
+ let a = T[i];
2214
+ if (!a) continue;
2215
+ let o = O(s, i), l = ee[s].get(i), u = l?.markerSize ?? c.markerSize ?? 5, d = B[s].get(i);
2216
+ Le(t, c, d) && L.push(() => Ie(e, t, c, s, i, _ ? o / 100 : o, a, n, r, c.showMarker === !0 || l?.markerSymbol != null ? u * r / 2 : 0, void 0, d, "t", a, !0, t.valAxisDisplayUnits));
2217
+ }
2218
+ }
2219
+ if (d) return Me(e, n), !0;
2220
+ for (let e of G(l)) e.paint();
2221
+ for (let e of u) e();
2222
+ }
2223
+ qe(e, t, p, N, y, S, b, r, a ? "horizontal" : "vertical"), Ze(e, t, p, N, y, S, b, a ? "horizontal" : "vertical", r), Ve(e, t, n, p, N, y, S, b, a ? "horizontal" : "vertical", r);
2224
+ let V = Xe(t, p, N, y, S, b, a ? "horizontal" : "vertical"), H = (e, t) => {
2225
+ if (t !== "low" && t !== "high") return V;
2226
+ let n = p.topology.nearDepth, r = V.axisX, i = V.axisY;
2227
+ if (e === "value" === a) {
2228
+ let e = F.y, r = F.y + F.h, a = p.project(F.x + F.w / 2, e, n), o = p.project(F.x + F.w / 2, r, n), s = a.y >= o.y ? e : r;
2229
+ i = t === "low" ? s : s === e ? r : e;
2230
+ } else {
2231
+ let e = F.x, i = F.x + F.w, a = p.project(e, F.y + F.h / 2, n), o = p.project(i, F.y + F.h / 2, n), s = a.x <= o.x ? e : i;
2232
+ r = t === "low" ? s : s === e ? i : e;
2233
+ }
2234
+ return {
2235
+ axisX: r,
2236
+ axisY: i,
2237
+ depth: n,
2238
+ horizontalStart: p.project(F.x, i, n),
2239
+ horizontalEnd: p.project(F.x + F.w, i, n),
2240
+ verticalStart: p.project(r, F.y + F.h, n),
2241
+ verticalEnd: p.project(r, F.y, n)
2242
+ };
2243
+ }, U = H("value", t.valAxisTickLabelPos), W = H("category", t.catAxisTickLabelPos), K = d(t.valAxisFontSizeHpt, r) ?? 9 * r;
2244
+ if (e.font = `${t.valAxisFontItalic ? "italic " : ""}${t.valAxisFontBold ? "bold " : ""}${K}px ${Se(t.valAxisFontFace)}`, e.fillStyle = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#595959", e.textAlign = a ? "center" : "right", e.textBaseline = a ? "top" : "middle", !t.valAxisHidden && t.valAxisTickLabelPos !== "none") {
2245
+ let { axisX: n, axisY: r, depth: i } = U, o = p.project(F.x + F.w / 2, F.y + F.h / 2, i), s = Je(a ? U.horizontalStart : U.verticalStart, a ? U.horizontalEnd : U.verticalEnd, o, a ? "vertical" : "horizontal");
2246
+ e.textAlign = Math.abs(s.x) < .2 ? "center" : s.x < 0 ? "right" : "left", e.textBaseline = Math.abs(s.y) < .2 ? "middle" : s.y < 0 ? "bottom" : "top";
2247
+ let l = t.valAxisDisplayUnits?.divisor;
2248
+ for (let o of N.majorTicks) {
2249
+ let u = a ? p.project(F.x + N.fraction(o) * F.w, r, i) : p.project(n, F.y + F.h - N.fraction(o) * F.h, i);
2250
+ e.fillText(c(_ ? o / 100 : l != null && Number.isFinite(l) && l > 0 ? o / l : o, _ ? t.valAxisFormatCode ?? "0%" : t.valAxisFormatCode, t.date1904), u.x + s.x * 5, u.y + s.y * 5);
2251
+ }
2252
+ }
2253
+ let q = d(t.catAxisFontSizeHpt, r) ?? 9 * r;
2254
+ if (e.font = `${t.catAxisFontItalic ? "italic " : ""}${t.catAxisFontBold ? "bold " : ""}${q}px ${Se(t.catAxisFontFace)}`, e.fillStyle = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#595959", !t.catAxisHidden && t.catAxisTickLabelPos !== "none") {
2255
+ let n = Array.from({ length: y }, (e, n) => l(String(v[n] ?? n + 1), t.catAxisFormatCode, t.date1904)), r = Ne(t);
2256
+ if (r == null && (r = 0, !a && y > 1)) {
2257
+ let t = Infinity, i = null, a = W.axisY;
2258
+ for (let e = 0; e < y; e++) {
2259
+ let n = Z(e, y, S, b), r = p.project(F.x + n * F.w, a, p.topology.nearDepth);
2260
+ i && (t = Math.min(t, Math.hypot(r.x - i.x, r.y - i.y))), i = r;
2261
+ }
2262
+ Math.max(0, ...n.map((t) => e.measureText(t).width)) > t * .9 && (r = -Math.PI / 4);
2263
+ }
2264
+ let i = Math.max(1, Math.floor(t.catAxisTickLabelSkip ?? 1));
2265
+ for (let t = 0; t < y; t += i) {
2266
+ let i = Z(t, y, S, b), { axisX: o, axisY: s, depth: c } = W, l = a ? p.project(o, F.y + Z(t, y, S, b) * F.h, c) : p.project(F.x + i * F.w, s, c);
2267
+ if (a) {
2268
+ let r = p.project(o, F.y + F.h / 2, c), i = p.project(F.x + F.w / 2, F.y + F.h / 2, c), a = r.x <= i.x;
2269
+ e.textAlign = a ? "right" : "left", e.textBaseline = "middle", e.fillText(n[t], l.x + (a ? -6 : 6), l.y);
2270
+ } else {
2271
+ let i = p.project(F.x + F.w / 2, F.y + F.h / 2, c), o = Je(W.horizontalStart, W.horizontalEnd, i, "vertical");
2272
+ Pe(e, n[t], l, r, a, o.y < 0 ? -1 : 1);
2273
+ }
2274
+ }
2275
+ }
2276
+ Be(e, t, n, u, a, r);
2277
+ for (let e of L) e();
2278
+ return He(e, t, f, r), !0;
2279
+ }
2280
+ function $e(e, t, n, r) {
2281
+ if (!t.threeD || t.chartType !== "pie") return !1;
2282
+ let i = t.series[0];
2283
+ if (!i) return !0;
2284
+ let a = i.values.flatMap((e, t) => e != null && Number.isFinite(e) ? [{
2285
+ index: t,
2286
+ value: Math.abs(e)
2287
+ }] : []), o = 0;
2288
+ for (let e of a) o = Math.max(o, e.value);
2289
+ if (!(o > 0)) return !0;
2290
+ let s = a.reduce((e, t) => e + t.value / o, 0);
2291
+ if (!(s > 0) || !Number.isFinite(s)) return !0;
2292
+ let { plot: c, legend: l } = Re(e, t, n, r, "radial"), u = A({
2293
+ ...t.threeD,
2294
+ rotationY: t.threeD.rotationY ?? 0,
2295
+ depthPercent: 100
2296
+ }, c, {
2297
+ sceneDepthScale: 1,
2298
+ sceneHeightScale: .15
2299
+ });
2300
+ if (!u) return !0;
2301
+ let f = new Map(i.dataPointOverrides?.map((e) => [e.idx, e]) ?? []), p = 0;
2302
+ for (let e of f.values()) e.explosion != null && Number.isFinite(e.explosion) && (p = Math.max(p, Math.max(0, Math.min(100, e.explosion)) / 100));
2303
+ let { scene: m } = u, h = Math.min(m.w * .45 / (1 + p), u.modelDepth * .45 / (1 + p), m.h / .45);
2304
+ if (!(h > 0)) return !0;
2305
+ let _ = m.x + m.w / 2, v = m.y + m.h / 2, b = .5, S = h * .3, C = 0, T = [], E = new Map(i.dataLabelOverrides?.map((e) => [e.idx, e]) ?? []), O = Math.max(48, Math.min(128, Math.ceil(Math.PI * 2 * h / 4)));
2306
+ for (let e of a) {
2307
+ let n = e.value / o / s, r = We(t.firstSliceAngle, C, n), a = f.get(e.index), c = a?.fillHidden === !0 ? "00000000" : a?.color ?? i.dataPointColors?.[e.index] ?? i.color, l = r.middle, d = a?.explosion != null && Number.isFinite(a.explosion) ? Math.max(0, Math.min(100, a.explosion)) / 100 : 0, p = _ + Math.cos(l) * h * d, m = b + Math.sin(l) * h * d / u.modelDepth, g = Math.max(2, Math.ceil(O * n)), y = ee({
2308
+ centerX: p,
2309
+ centerY: v,
2310
+ centerDepth: m,
2311
+ radius: h,
2312
+ modelDepth: u.modelDepth,
2313
+ thickness: S,
2314
+ startAngle: r.start,
2315
+ endAngle: r.end,
2316
+ segments: g
2317
+ });
2318
+ if (!y) {
2319
+ C += n;
2320
+ continue;
2321
+ }
2322
+ T.push({
2323
+ index: e.index,
2324
+ start: r.start,
2325
+ end: r.end,
2326
+ color: c === "00000000" ? "transparent" : c ? `#${c}` : ve(e.index),
2327
+ value: e.value,
2328
+ percentValue: n,
2329
+ centerX: p,
2330
+ centerDepth: m,
2331
+ segments: g,
2332
+ mesh: y,
2333
+ lineHidden: a?.lineHidden ?? i.lineHidden ?? !1,
2334
+ lineColor: a?.lineColor ?? i.lineColor ?? null,
2335
+ lineWidthEmu: a?.lineWidthEmu ?? i.lineWidthEmu ?? null,
2336
+ lineDash: a?.lineDash ?? i.chartexStyle?.lineDash ?? "solid",
2337
+ lineCap: i.chartexStyle?.lineCap === "rnd" ? "round" : i.chartexStyle?.lineCap === "sq" ? "square" : "butt",
2338
+ lineJoin: i.chartexStyle?.lineJoin === "round" || i.chartexStyle?.lineJoin === "bevel" ? i.chartexStyle.lineJoin : "miter"
2339
+ }), C += n;
2340
+ }
2341
+ u = D(u, T.flatMap((e) => e.mesh.vertices), c, .08);
2342
+ let k = [], j = {
2343
+ remaining: te,
2344
+ exceeded: !1
2345
+ }, M = (e) => {
2346
+ let t = e.lineWidthEmu == null ? .75 * r : Math.max(.25, e.lineWidthEmu / g * r);
2347
+ return !e.lineHidden && e.lineColor ? {
2348
+ color: `#${e.lineColor}`,
2349
+ width: t,
2350
+ dash: x(e.lineDash, t),
2351
+ cap: e.lineCap,
2352
+ join: e.lineJoin
2353
+ } : void 0;
2354
+ }, N = T.flatMap((e) => Oe(u, e.mesh, e.color, void 0, j)), P = [], F = T.map(M), I = F[0], L = (e) => e == null ? null : [
2355
+ e.color,
2356
+ e.width,
2357
+ e.dash.join(","),
2358
+ e.cap,
2359
+ e.join
2360
+ ].join("|"), R = I != null && F.every((e) => L(e) === L(I)) && T.every((e) => Math.abs(e.centerX - _) < 1e-9 && Math.abs(e.centerDepth - b) < 1e-9);
2361
+ if (R) P.push(...ke(u, T, v, h, S, I, j));
2362
+ else for (let e = 0; e < T.length; e++) {
2363
+ let t = F[e];
2364
+ t && P.push(...Oe(u, T[e].mesh, "transparent", t, j, !0));
2365
+ }
2366
+ if (j.exceeded) return Me(e, n), !0;
2367
+ if (R) {
2368
+ for (let t of G(N)) Ae(e, t);
2369
+ for (let t of G(P)) Ae(e, t);
2370
+ } else for (let t of G([...N, ...P])) Ae(e, t);
2371
+ for (let n of T) {
2372
+ let a = (n.start + n.end) / 2, o = E.get(n.index);
2373
+ if (Le(t, i, o)) {
2374
+ let s = i.seriesDataLabels, l = d(o?.fontSizeHpt ?? s?.fontSizeHpt ?? t.dataLabelFontSizeHpt, r) ?? 9 * r;
2375
+ e.font = `${o?.fontBold ?? s?.fontBold ?? t.dataLabelFontBold ? "bold " : ""}${l}px ${X(t, o?.fontFace ?? s?.fontFace ?? t.dataLabelFontFace)}`;
2376
+ let f = w({
2377
+ customText: o?.text,
2378
+ showCategory: o?.showCatName ?? s?.showCatName ?? !1,
2379
+ showSeries: o?.showSerName ?? s?.showSerName ?? !1,
2380
+ showValue: o?.showVal ?? s?.showVal ?? t.showDataLabels,
2381
+ showPercent: o?.showPercent ?? s?.showPercent ?? !1,
2382
+ category: i.categories?.[n.index] ?? t.categories[n.index] ?? `${n.index + 1}`,
2383
+ seriesName: i.name || "Series 1",
2384
+ sourceValue: n.value,
2385
+ percentRatio: n.percentValue,
2386
+ formatCode: o?.formatCode ?? s?.formatCode ?? t.dataLabelFormatCode ?? i.valFormatCode,
2387
+ separator: o?.separator ?? s?.separator,
2388
+ date1904: t.date1904
2389
+ }), p = X(t, o?.fontFace ?? s?.fontFace ?? t.dataLabelFontFace), m = o?.text && o.richRuns?.length ? y(e, {
2390
+ runs: o.richRuns,
2391
+ ptToPx: r,
2392
+ fontFamily: p,
2393
+ fallbackBold: o.fontBold ?? s?.fontBold ?? t.dataLabelFontBold ?? !1,
2394
+ fontFamilyForFace: (e) => X(t, e)
2395
+ }, l, `#${o.fontColor ?? s?.fontColor ?? i.labelColor ?? t.dataLabelFontColor ?? "111111"}`) : null, g = o?.position ?? s?.position ?? t.dataLabelPosition, _ = v - S / 2, b = v + S / 2, x = u.cameraDepth(n.centerX, _, n.centerDepth) >= u.cameraDepth(n.centerX, b, n.centerDepth) ? _ : b, C = 0, T = null;
2396
+ for (let e = 0; e <= 12; e++) {
2397
+ let t = n.start + (n.end - n.start) * e / 12, r = u.project(n.centerX + Math.cos(t) * h * .64, x, n.centerDepth + Math.sin(t) * h * .64 / u.modelDepth);
2398
+ T && (C += Math.hypot(r.x - T.x, r.y - T.y)), T = r;
2399
+ }
2400
+ let E = (g == null || g === "bestFit") && (n.percentValue === 0 || C < (m?.width ?? e.measureText(f).width)) || g === "outEnd", D = h * (E ? 1.12 : .64), O = u.project(n.centerX + Math.cos(a) * D, x, n.centerDepth + Math.sin(a) * D / u.modelDepth), A = u.project(n.centerX + Math.cos(a) * h, x, n.centerDepth + Math.sin(a) * h / u.modelDepth);
2401
+ k.push(() => Ie(e, t, i, 0, n.index, n.value, O, c, r, 0, n.percentValue, o, "ctr", A, E));
2402
+ }
2403
+ }
2404
+ for (let e of k) e();
2405
+ let z = i.categories?.length ? i.categories : t.categories, B = Array.from({ length: z.length }, (e, t) => {
2406
+ let n = f.get(t), r = n?.fillHidden === !0 ? "00000000" : n?.color ?? i.dataPointColors?.[t] ?? i.color;
2407
+ return r === "00000000" ? "00000000" : be(r ? `#${r}` : ve(t), .8).replace(/^#/, "");
2408
+ });
2409
+ return He(e, {
2410
+ ...t,
2411
+ categories: z,
2412
+ series: [{
2413
+ ...i,
2414
+ categories: z,
2415
+ dataPointColors: B
2416
+ }]
2417
+ }, l, r, !0), !0;
2418
+ }
2419
+ function et(e, t, n, r) {
2420
+ return t.threeD ? $e(e, t, n, r) ? !0 : he.has(t.chartType) ? Qe(e, t, n, r) : !1 : !1;
2421
+ }
2422
+ //#endregion
2423
+ //#region src/three-d.ts
2424
+ var tt = { render: et };
2425
+ //#endregion
2426
+ export { tt as threeD };