@m4l/gclick 0.21.0 → 0.22.0

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 (29) hide show
  1. package/components/ReportsViewer/subcomponents/SectionRenderer/SeriesChartSectionRenderer/ReportsViewerChartSeries.d.ts.map +1 -1
  2. package/components/ReportsViewer/subcomponents/SectionRenderer/SeriesChartSectionRenderer/ReportsViewerChartSeries.js +17 -16
  3. package/components/ReportsViewer/subcomponents/SectionRenderer/SeriesChartSectionRenderer/helpers/generateReportsViewerChartSeriesOptions.d.ts +4 -1
  4. package/components/ReportsViewer/subcomponents/SectionRenderer/SeriesChartSectionRenderer/helpers/generateReportsViewerChartSeriesOptions.d.ts.map +1 -1
  5. package/components/ReportsViewer/subcomponents/SectionRenderer/SeriesChartSectionRenderer/helpers/generateReportsViewerChartSeriesOptions.js +70 -55
  6. package/components/VideoTimeLineSelector/helpers/clusterEvents/clusterEvents.d.ts +5 -5
  7. package/components/VideoTimeLineSelector/helpers/clusterEvents/clusterEvents.d.ts.map +1 -1
  8. package/components/VideoTimeLineSelector/helpers/clusterEvents/clusterEvents.js +55 -41
  9. package/components/VideoTimeLineSelector/helpers/getIntersectedSegments/getIntersectedSegments.d.ts +2 -2
  10. package/components/VideoTimeLineSelector/helpers/getIntersectedSegments/getIntersectedSegments.d.ts.map +1 -1
  11. package/components/VideoTimeLineSelector/helpers/getIntersectedSegments/getIntersectedSegments.js +16 -9
  12. package/components/VideoTimeLineSelector/helpers/getTimeLinePosition/getTimeLinePosition.d.ts +1 -1
  13. package/components/VideoTimeLineSelector/helpers/getTimeLinePosition/getTimeLinePosition.d.ts.map +1 -1
  14. package/components/VideoTimeLineSelector/helpers/getTimeLinePosition/getTimeLinePosition.js +6 -5
  15. package/components/VideoTimeLineSelector/helpers/getTimeLinePosition/types.d.ts +1 -0
  16. package/components/VideoTimeLineSelector/helpers/getTimeLinePosition/types.d.ts.map +1 -1
  17. package/components/VideoTimeLineSelector/helpers/playbackRange/playbackRange.d.ts +6 -6
  18. package/components/VideoTimeLineSelector/helpers/playbackRange/playbackRange.d.ts.map +1 -1
  19. package/components/VideoTimeLineSelector/helpers/playbackRange/playbackRange.js +82 -49
  20. package/components/VideoTimeLineSelector/helpers/playbackRange/types.d.ts +1 -0
  21. package/components/VideoTimeLineSelector/helpers/playbackRange/types.d.ts.map +1 -1
  22. package/components/VideoTimeLineSelector/subcomponents/BaseVideoTimeLineSelector/BaseVideoTimeLineSelector.d.ts.map +1 -1
  23. package/components/VideoTimeLineSelector/subcomponents/BaseVideoTimeLineSelector/BaseVideoTimeLineSelector.js +69 -64
  24. package/components/VideoTimeLineSelector/subcomponents/ChartTimeLine/ChartTimeLine.d.ts.map +1 -1
  25. package/components/VideoTimeLineSelector/subcomponents/ChartTimeLine/ChartTimeLine.js +205 -192
  26. package/components/VideoTimeLineSelector/subcomponents/EventCluster/EventCluster.d.ts +2 -2
  27. package/components/VideoTimeLineSelector/subcomponents/EventCluster/EventCluster.d.ts.map +1 -1
  28. package/components/VideoTimeLineSelector/subcomponents/EventCluster/EventCluster.js +32 -24
  29. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"ReportsViewerChartSeries.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/gclick/src/components/ReportsViewer/subcomponents/SectionRenderer/SeriesChartSectionRenderer/ReportsViewerChartSeries.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAkB9D,MAAM,WAAW,6BAA6B;IAC5C,iEAAiE;IACjE,MAAM,EAAE,uBAAuB,CAAC;IAChC,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,MAAM,EACN,UAAkB,GACnB,EAAE,6BAA6B,oDAmC/B"}
1
+ {"version":3,"file":"ReportsViewerChartSeries.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/gclick/src/components/ReportsViewer/subcomponents/SectionRenderer/SeriesChartSectionRenderer/ReportsViewerChartSeries.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAkB9D,MAAM,WAAW,6BAA6B;IAC5C,iEAAiE;IACjE,MAAM,EAAE,uBAAuB,CAAC;IAChC,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,MAAM,EACN,UAAkB,GACnB,EAAE,6BAA6B,oDAqC/B"}
@@ -1,45 +1,46 @@
1
1
  import { jsx as e } from "@emotion/react/jsx-runtime";
2
2
  import u from "echarts-for-react";
3
- import { useTheme as f, styled as n } from "@mui/material/styles";
4
- import { useRef as d, useMemo as R } from "react";
5
- import { useUserPreferences as y, useModuleDictionary as C } from "@m4l/core";
6
- import { resolveChartSeriesCompactNumberDictionary as w } from "@m4l/widgets";
7
- import { generateReportsViewerChartSeriesOptions as g } from "./helpers/generateReportsViewerChartSeriesOptions.js";
8
- import { useReportsViewerChartResize as S } from "./hooks/useReportsViewerChartResize.js";
9
- const b = n("div")({
3
+ import { useTheme as d, styled as n } from "@mui/material/styles";
4
+ import { useRef as R, useMemo as y } from "react";
5
+ import { useUserPreferences as C, useModuleDictionary as w } from "@m4l/core";
6
+ import { resolveChartSeriesCompactNumberDictionary as g } from "@m4l/widgets";
7
+ import { generateReportsViewerChartSeriesOptions as S } from "./helpers/generateReportsViewerChartSeriesOptions.js";
8
+ import { useReportsViewerChartResize as b } from "./hooks/useReportsViewerChartResize.js";
9
+ const V = n("div")({
10
10
  containerName: "root",
11
11
  containerType: "size",
12
12
  width: "100%",
13
13
  height: "100%"
14
- }), V = n("div")({
14
+ }), v = n("div")({
15
15
  width: "100%",
16
16
  height: "100%",
17
17
  minWidth: "500px",
18
18
  minHeight: "300px"
19
19
  });
20
- function O({
20
+ function P({
21
21
  values: a,
22
22
  scrollable: m = !1
23
23
  }) {
24
- const t = d(null), c = f(), { locale: r, decimalSymbol: o, thousandsSymbol: i } = y(), { getLabel: s } = C(), h = S(t), l = R(
24
+ const t = R(null), c = d(), { locale: r, decimalSymbol: o, thousandsSymbol: i, formatDate: h } = C(), { getLabel: s } = w(), l = b(t), p = y(
25
25
  () => ({
26
26
  locale: r ?? Intl.NumberFormat().resolvedOptions().locale,
27
27
  decimalSymbol: o,
28
28
  thousandsSymbol: i,
29
- compactDictionary: w(s)
29
+ compactDictionary: g(s)
30
30
  }),
31
31
  [o, s, r, i]
32
- ), p = g(
32
+ ), f = S(
33
33
  a,
34
34
  c,
35
35
  m,
36
- l
36
+ p,
37
+ h
37
38
  );
38
- return /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(V, { ref: h, children: /* @__PURE__ */ e(
39
+ return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(v, { ref: l, children: /* @__PURE__ */ e(
39
40
  u,
40
41
  {
41
42
  ref: t,
42
- option: p,
43
+ option: f,
43
44
  style: { height: "100%", width: "100%" },
44
45
  notMerge: !0,
45
46
  lazyUpdate: !0
@@ -47,5 +48,5 @@ function O({
47
48
  ) }) });
48
49
  }
49
50
  export {
50
- O as ReportsViewerChartSeries
51
+ P as ReportsViewerChartSeries
51
52
  };
@@ -1,8 +1,11 @@
1
1
  import { Theme } from '@mui/material/styles';
2
+ import { ResolveDatePresentationOptions } from '@m4l/core';
2
3
  import { CompactNumberLocalizationOptions } from '@m4l/widgets';
3
4
  import { ChartSeriesParsedConfig } from '../../../../types';
5
+ type ReportsViewerChartDateFormatter = (options: ResolveDatePresentationOptions) => string;
4
6
  /**
5
7
  * Builds the ECharts options for ReportsViewer's local ChartSeries renderer.
6
8
  */
7
- export declare function generateReportsViewerChartSeriesOptions(values: ChartSeriesParsedConfig, theme: Theme, scrollable: boolean, numberLocalization?: CompactNumberLocalizationOptions): object;
9
+ export declare function generateReportsViewerChartSeriesOptions(values: ChartSeriesParsedConfig, theme: Theme, scrollable: boolean, numberLocalization?: CompactNumberLocalizationOptions, formatDate?: ReportsViewerChartDateFormatter): object;
10
+ export {};
8
11
  //# sourceMappingURL=generateReportsViewerChartSeriesOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateReportsViewerChartSeriesOptions.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/gclick/src/components/ReportsViewer/subcomponents/SectionRenderer/SeriesChartSectionRenderer/helpers/generateReportsViewerChartSeriesOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AA8FjE;;GAEG;AACH,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,uBAAuB,EAC/B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,OAAO,EACnB,kBAAkB,CAAC,EAAE,gCAAgC,GACpD,MAAM,CAsQR"}
1
+ {"version":3,"file":"generateReportsViewerChartSeriesOptions.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/gclick/src/components/ReportsViewer/subcomponents/SectionRenderer/SeriesChartSectionRenderer/helpers/generateReportsViewerChartSeriesOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAEhE,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAQjE,KAAK,+BAA+B,GAAG,CACrC,OAAO,EAAE,8BAA8B,KACpC,MAAM,CAAC;AA2HZ;;GAEG;AACH,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,uBAAuB,EAC/B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,OAAO,EACnB,kBAAkB,CAAC,EAAE,gCAAgC,EACrD,UAAU,CAAC,EAAE,+BAA+B,GAC3C,MAAM,CA2QR"}
@@ -1,57 +1,67 @@
1
- import * as m from "echarts";
2
- import { BASE_TAG_OBJECT_COLORS_LIGHT as x } from "@m4l/styles";
3
- import { formatCompactNumber as g } from "@m4l/widgets";
4
- import { remapReportsViewerChartSeriesTooltip as C } from "./remapReportsViewerChartSeriesTooltip.js";
5
- const p = "#9ca3af", b = 48;
1
+ import * as x from "echarts";
2
+ import { BASE_TAG_OBJECT_COLORS_LIGHT as g } from "@m4l/styles";
3
+ import { formatCompactNumber as C } from "@m4l/widgets";
4
+ import { remapReportsViewerChartSeriesTooltip as b } from "./remapReportsViewerChartSeriesTooltip.js";
5
+ const p = "#9ca3af", h = 48, S = /^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:[Zz]|[+-]\d{2}:?\d{2})$/;
6
6
  function s(t) {
7
7
  if (t === null || typeof t != "string")
8
8
  return p;
9
9
  if (t.includes("#"))
10
10
  return t;
11
- const r = t.replace("var(", "").replace(")", "");
12
- return getComputedStyle(document.documentElement).getPropertyValue(r).trim() || p;
11
+ const e = t.replace("var(", "").replace(")", "");
12
+ return getComputedStyle(document.documentElement).getPropertyValue(e).trim() || p;
13
13
  }
14
- function c(t, r = "contained", l = "backgroundColorTone") {
14
+ function d(t, e = "contained", l = "backgroundColorTone") {
15
15
  if (t.includes("#"))
16
16
  return t;
17
17
  if (!t?.trim())
18
18
  return p;
19
- const n = x[t];
20
- return n ? n[r][l] : p;
19
+ const n = g[t];
20
+ return n ? n[e][l] : p;
21
21
  }
22
- function h(t) {
23
- return t ? Object.keys(t).reduce((r, l) => {
22
+ function T(t) {
23
+ return t ? Object.keys(t).reduce((e, l) => {
24
24
  const n = t[l];
25
- return n && typeof n == "object" && "v" in n && (r[l] = String(n.v).replace(/[0-9.\s]+/g, "")), r;
25
+ return n && typeof n == "object" && "v" in n && (e[l] = String(n.v).replace(/[0-9.\s]+/g, "")), e;
26
26
  }, {}) : {};
27
27
  }
28
- function S(t, r) {
29
- return typeof t == "string" && t.trim() !== "" ? t.trim() : typeof r == "string" && r.trim() !== "" ? r.trim() : "";
28
+ function A(t, e) {
29
+ return typeof t == "string" && t.trim() !== "" ? t.trim() : typeof e == "string" && e.trim() !== "" ? e.trim() : "";
30
30
  }
31
- function A(t, r) {
32
- return r ? `${t} (${r})` : t;
31
+ function _(t, e) {
32
+ return e ? `${t} (${e})` : t;
33
33
  }
34
- function L(t, r, l, n) {
35
- const e = {
34
+ function L(t) {
35
+ return typeof t != "string" || !S.test(t) ? !1 : !Number.isNaN(new Date(t).getTime());
36
+ }
37
+ function k(t, e) {
38
+ return !e || !L(t) ? t : e({
39
+ fallbackValue: t,
40
+ presentationType: "datetime",
41
+ value: t
42
+ });
43
+ }
44
+ function P(t, e, l, n, f) {
45
+ const r = {
36
46
  textPrimaryColor: s(
37
- r.vars?.palette?.text?.primary
47
+ e.vars?.palette?.text?.primary
38
48
  ),
39
49
  textDisabledColor: s(
40
- r.vars?.palette?.text?.disabled
50
+ e.vars?.palette?.text?.disabled
41
51
  ),
42
52
  themeBackgroundColor: s(
43
- r.vars?.palette?.background?.default
53
+ e.vars?.palette?.background?.default
44
54
  ),
45
55
  contrastTextColor: s(
46
- r.vars?.palette?.text?.contrastText
56
+ e.vars?.palette?.text?.contrastText
47
57
  ),
48
58
  backgroundNeutralColor: s(
49
- r.vars?.palette?.background?.neutral
59
+ e.vars?.palette?.background?.neutral
50
60
  ),
51
61
  contrastDefaultColor: s(
52
- r.vars?.palette?.background?.contrastDefault
62
+ e.vars?.palette?.background?.contrastDefault
53
63
  )
54
- }, f = h(t.values[0]);
64
+ }, u = T(t.values[0]);
55
65
  return {
56
66
  baseOption: {
57
67
  tooltip: {
@@ -61,25 +71,25 @@ function L(t, r, l, n) {
61
71
  shadowColor: "transparent",
62
72
  borderWidth: 0,
63
73
  textStyle: {
64
- color: e.contrastTextColor,
74
+ color: r.contrastTextColor,
65
75
  fontFamily: "Inter",
66
76
  fontSize: 13,
67
77
  fontWeight: 700
68
78
  },
69
- formatter: (o) => C(o, t, e),
79
+ formatter: (o) => b(o, t, r),
70
80
  axisPointer: {
71
81
  type: "cross",
72
82
  lineStyle: {
73
- color: e.textDisabledColor,
83
+ color: r.textDisabledColor,
74
84
  type: "solid"
75
85
  },
76
86
  crossStyle: {
77
- color: e.textDisabledColor,
87
+ color: r.textDisabledColor,
78
88
  type: "solid"
79
89
  },
80
90
  label: {
81
- backgroundColor: e.backgroundNeutralColor,
82
- color: e.textPrimaryColor,
91
+ backgroundColor: r.backgroundNeutralColor,
92
+ color: r.textPrimaryColor,
83
93
  fontFamily: "Inter",
84
94
  fontSize: 13,
85
95
  fontWeight: 400,
@@ -116,13 +126,18 @@ function L(t, r, l, n) {
116
126
  itemHeight: 11,
117
127
  textStyle: {
118
128
  fontSize: 12,
119
- color: e.textPrimaryColor
129
+ color: r.textPrimaryColor
120
130
  },
121
131
  data: t.series.map((o) => o.title)
122
132
  },
123
133
  xAxis: t.xAxis.map((o, a) => ({
124
134
  type: "category",
125
- data: t.values.map((i) => i[o.field]),
135
+ data: t.values.map(
136
+ (i) => k(
137
+ i[o.field],
138
+ f
139
+ )
140
+ ),
126
141
  offset: a > 1 ? (a - 1) * 20 : 0,
127
142
  axisLine: { show: !1 },
128
143
  axisTick: { show: !1 },
@@ -133,23 +148,23 @@ function L(t, r, l, n) {
133
148
  fontSize: 11,
134
149
  fontWeight: 500,
135
150
  hideOverlap: !0,
136
- color: e.textPrimaryColor
151
+ color: r.textPrimaryColor
137
152
  }
138
153
  })),
139
154
  yAxis: t.yAxis.map((o, a) => {
140
155
  const i = t.series.find(
141
- (d) => d.yAxisId === o.id
142
- ), u = S(
156
+ (c) => c.yAxisId === o.id
157
+ ), m = A(
143
158
  o.unit,
144
- f[i?.field || ""]
145
- ), y = c(
159
+ u[i?.field || ""]
160
+ ), y = d(
146
161
  i?.pallet_color || "",
147
162
  "contained",
148
163
  "backgroundColorTone"
149
164
  );
150
165
  return {
151
166
  type: "value",
152
- name: A(o.title, u),
167
+ name: _(o.title, m),
153
168
  position: a === 0 ? "left" : "right",
154
169
  offset: a > 1 ? (a - 1) * 70 : 0,
155
170
  alignTicks: !0,
@@ -157,32 +172,32 @@ function L(t, r, l, n) {
157
172
  show: !0,
158
173
  lineStyle: {
159
174
  type: "dashed",
160
- color: e.textDisabledColor,
175
+ color: r.textDisabledColor,
161
176
  opacity: 0.3,
162
177
  width: 1,
163
178
  dashOffset: 0
164
179
  }
165
180
  },
166
181
  nameTextStyle: {
167
- color: e.textDisabledColor,
182
+ color: r.textDisabledColor,
168
183
  fontFamily: "Inter",
169
184
  fontSize: "12px",
170
185
  fontWeight: 500
171
186
  },
172
187
  nameRotate: 90,
173
188
  nameLocation: "middle",
174
- nameGap: b,
189
+ nameGap: h,
175
190
  axisLabel: {
176
- color: e.textPrimaryColor,
191
+ color: r.textPrimaryColor,
177
192
  fontFamily: "Jura",
178
193
  fontSize: "13px",
179
194
  fontWeight: 700,
180
195
  /**
181
196
  * Format y-axis values with locale-aware compact notation.
182
197
  */
183
- formatter: (d) => g({
184
- value: d,
185
- fallbackValue: `${d}`,
198
+ formatter: (c) => C({
199
+ value: c,
200
+ fallbackValue: `${c}`,
186
201
  ...n
187
202
  })
188
203
  },
@@ -208,10 +223,10 @@ function L(t, r, l, n) {
208
223
  type: o.type,
209
224
  yAxisIndex: a !== -1 ? a : 0,
210
225
  areaStyle: {
211
- color: new m.graphic.LinearGradient(0, 0, 0, 1, [
226
+ color: new x.graphic.LinearGradient(0, 0, 0, 1, [
212
227
  {
213
228
  offset: 0,
214
- color: c(
229
+ color: d(
215
230
  o?.pallet_color || "",
216
231
  "contained",
217
232
  "backgroundColor"
@@ -231,16 +246,16 @@ function L(t, r, l, n) {
231
246
  symbolSize: 10,
232
247
  itemStyle: {
233
248
  borderWidth: 2,
234
- borderColor: c(
249
+ borderColor: d(
235
250
  o.pallet_color,
236
251
  "contained",
237
252
  "backgroundColorTone"
238
253
  ),
239
- color: e.themeBackgroundColor
254
+ color: r.themeBackgroundColor
240
255
  },
241
256
  lineStyle: {
242
257
  width: 2,
243
- color: c(
258
+ color: d(
244
259
  o.pallet_color,
245
260
  "contained",
246
261
  "backgroundColorTone"
@@ -248,7 +263,7 @@ function L(t, r, l, n) {
248
263
  },
249
264
  emphasis: {
250
265
  itemStyle: {
251
- color: c(
266
+ color: d(
252
267
  o.pallet_color,
253
268
  "contained",
254
269
  "backgroundColorTone"
@@ -263,7 +278,7 @@ function L(t, r, l, n) {
263
278
  itemStyle: {
264
279
  borderRadius: [6, 6, 0, 0]
265
280
  },
266
- color: c(
281
+ color: d(
267
282
  o.pallet_color,
268
283
  "contained",
269
284
  "backgroundColorTone"
@@ -275,5 +290,5 @@ function L(t, r, l, n) {
275
290
  };
276
291
  }
277
292
  export {
278
- L as generateReportsViewerChartSeriesOptions
293
+ P as generateReportsViewerChartSeriesOptions
279
294
  };
@@ -10,10 +10,10 @@ export interface ClusteredEvent {
10
10
  jumpNextTimeVisible: TimeVisible | null;
11
11
  }
12
12
  /**
13
- * Agrupa eventos que están muy cerca temporalmente en clústers
14
- * @param events - Array de eventos a agrupar
15
- * @param clusterThreshold - Umbral en minutos para considerar eventos como cercanos (default: 5 minutos)
16
- * @returns Array de eventos individuales y clústers
13
+ * Group nearby timeline events into single-event markers or clusters.
14
+ * @param events - Event array to group.
15
+ * @param clusterThreshold - Minutes used to consider events nearby.
16
+ * @returns Single-event markers and clusters.
17
17
  */
18
- export declare const clusterEvents: (events: EventType<unknown>[], clusterThreshold: number | undefined, containerWidth: number) => ClusteredEvent[];
18
+ export declare const clusterEvents: (events: EventType<unknown>[], clusterThreshold: number | undefined, containerWidth: number, timeZoneName?: string | null) => ClusteredEvent[];
19
19
  //# sourceMappingURL=clusterEvents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clusterEvents.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoTimeLineSelector/helpers/clusterEvents/clusterEvents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAyCrD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7B,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB,EAAE,WAAW,GAAG,IAAI,CAAC;CACzC;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,SAAS,CAAC,OAAO,CAAC,EAAE,EAC5B,oCAAoB,EACpB,gBAAgB,MAAM,KACrB,cAAc,EA4ChB,CAAC"}
1
+ {"version":3,"file":"clusterEvents.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoTimeLineSelector/helpers/clusterEvents/clusterEvents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkCrD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7B,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB,EAAE,WAAW,GAAG,IAAI,CAAC;CACzC;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,SAAS,CAAC,OAAO,CAAC,EAAE,EAC5B,oCAAoB,EACpB,gBAAgB,MAAM,EACtB,eAAe,MAAM,GAAG,IAAI,KAC3B,cAAc,EA+ChB,CAAC"}
@@ -1,67 +1,81 @@
1
- import { TIME_SCALES as f } from "../../constants.js";
2
- import { getTimeLinePosition as g } from "../getTimeLinePosition/getTimeLinePosition.js";
3
- const T = (i) => {
4
- if (i.length < 2)
1
+ import { TIME_SCALES as g } from "../../constants.js";
2
+ import { getTimeLinePosition as p } from "../getTimeLinePosition/getTimeLinePosition.js";
3
+ const a = (e) => {
4
+ if (e.length < 2)
5
5
  return null;
6
- const m = [...i].sort((s, t) => s.startTime.getTime() - t.startTime.getTime()), l = (m[1].startTime.getTime() - m[0].startTime.getTime()) / (1e3 * 60);
7
- if (l === 0)
6
+ const l = [...e].sort((s, r) => s.startTime.getTime() - r.startTime.getTime()), n = (l[1].startTime.getTime() - l[0].startTime.getTime()) / (1e3 * 60);
7
+ if (n === 0)
8
8
  return null;
9
- const n = ["24h", "6h", "2h", "1h", "10min"];
10
- for (const s of n) {
11
- const t = f[s];
12
- if (l > t.clusterThresholdMinutes)
9
+ const o = ["24h", "6h", "2h", "1h", "10min"];
10
+ for (const s of o) {
11
+ const r = g[s];
12
+ if (n > r.clusterThresholdMinutes)
13
13
  return s;
14
14
  }
15
15
  return "10min";
16
- }, d = (i, m = 5, l) => {
17
- if (!i || i.length === 0)
16
+ }, C = (e, l = 5, n, o) => {
17
+ if (!e || e.length === 0)
18
18
  return [];
19
- const n = [...i].sort((r, e) => r.startTime.getTime() - e.startTime.getTime()), s = [];
20
- let t = [], o = null;
21
- for (let r = 0; r < n.length; r++) {
22
- const e = n[r];
23
- if (t.length === 0)
24
- t = [e], o = e.startTime;
25
- else if ((e.startTime.getTime() - (o?.getTime() ?? 0)) / 6e4 <= m)
26
- t.push(e);
19
+ const s = [...e].sort((m, t) => m.startTime.getTime() - t.startTime.getTime()), r = [];
20
+ let i = [], u = null;
21
+ for (let m = 0; m < s.length; m++) {
22
+ const t = s[m];
23
+ if (i.length === 0)
24
+ i = [t], u = t.startTime;
25
+ else if ((t.startTime.getTime() - (u?.getTime() ?? 0)) / 6e4 <= l)
26
+ i.push(t);
27
27
  else {
28
- const c = T(t);
29
- s.push(a(t, l, c)), t = [e], o = e.startTime;
28
+ const f = a(i);
29
+ r.push(c(
30
+ i,
31
+ n,
32
+ f,
33
+ o
34
+ )), i = [t], u = t.startTime;
30
35
  }
31
36
  }
32
- if (t.length > 0) {
33
- const r = T(t);
34
- s.push(a(t, l, r));
37
+ if (i.length > 0) {
38
+ const m = a(i);
39
+ r.push(c(
40
+ i,
41
+ n,
42
+ m,
43
+ o
44
+ ));
35
45
  }
36
- return s;
37
- }, a = (i, m, l) => {
38
- const { left: n } = g({ startTime: i[0].startTime, endTime: i[0].startTime }), s = 5.5, t = 7, o = parseFloat(n) - s * 100 / m, r = parseFloat(n) - t * 100 / m;
39
- if (i.length === 1) {
40
- const e = i[0];
46
+ return r;
47
+ }, c = (e, l, n, o) => {
48
+ const { left: s } = p({
49
+ startTime: e[0].startTime,
50
+ endTime: e[0].startTime,
51
+ timeZoneName: o
52
+ }), r = 5.5, i = 7, u = parseFloat(s) - r * 100 / l, m = parseFloat(s) - i * 100 / l;
53
+ if (e.length === 1) {
54
+ const t = e[0];
41
55
  return {
42
- id: `event-${e.startTime.getTime()}`,
43
- events: [e],
44
- startTime: e.startTime,
56
+ id: `event-${t.startTime.getTime()}`,
57
+ events: [t],
58
+ startTime: t.startTime,
45
59
  position: {
46
- left: `${o.toString()}%`
60
+ left: `${u.toString()}%`
47
61
  },
48
62
  isCluster: !1,
49
63
  jumpNextTimeVisible: null
50
64
  };
51
65
  } else {
52
- const e = new Date(Math.min(...i.map((u) => u.startTime.getTime())));
66
+ const t = new Date(Math.min(...e.map((T) => T.startTime.getTime())));
53
67
  return {
54
- id: `cluster-${e.getTime()}`,
55
- events: i,
56
- startTime: e,
68
+ id: `cluster-${t.getTime()}`,
69
+ events: e,
70
+ startTime: t,
57
71
  position: {
58
- left: `${r.toString()}%`
72
+ left: `${m.toString()}%`
59
73
  },
60
74
  isCluster: !0,
61
- jumpNextTimeVisible: l
75
+ jumpNextTimeVisible: n
62
76
  };
63
77
  }
64
78
  };
65
79
  export {
66
- d as clusterEvents
80
+ C as clusterEvents
67
81
  };
@@ -1,6 +1,6 @@
1
1
  import { ActiveChannel, IntersectedSegmentType, SegmentType } from '../../types';
2
2
  /**
3
- * Obtiene los segmentos intersectados con la línea de tiempo, solamente para los canales activos
3
+ * Resolve the active-channel segments intersecting the selected wall-clock time.
4
4
  */
5
- export declare const getIntersectedSegments: (currentTime: number, activeChannels: ActiveChannel[], segments: SegmentType<any>[]) => IntersectedSegmentType[];
5
+ export declare const getIntersectedSegments: (currentTime: number, activeChannels: ActiveChannel[], segments: SegmentType<any>[], timeZoneName?: string | null) => IntersectedSegmentType[];
6
6
  //# sourceMappingURL=getIntersectedSegments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getIntersectedSegments.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoTimeLineSelector/helpers/getIntersectedSegments/getIntersectedSegments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,aAAa,MAAM,EAAE,gBAAgB,aAAa,EAAE,EAAE,UAAU,WAAW,CAAC,GAAG,CAAC,EAAE,6BAoCxH,CAAC"}
1
+ {"version":3,"file":"getIntersectedSegments.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoTimeLineSelector/helpers/getIntersectedSegments/getIntersectedSegments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGjF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,MAAM,EACnB,gBAAgB,aAAa,EAAE,EAC/B,UAAU,WAAW,CAAC,GAAG,CAAC,EAAE,EAC5B,eAAe,MAAM,GAAG,IAAI,6BA+B7B,CAAC"}
@@ -1,19 +1,26 @@
1
- const a = (t, d, i) => {
2
- const c = i.filter(
3
- (n) => d.includes(n.channelId)
4
- ), s = [];
5
- return c.forEach((n) => {
1
+ import { dateToDaySeconds as d } from "../playbackRange/playbackRange.js";
2
+ const S = (t, o, i, s) => {
3
+ const r = i.filter(
4
+ (n) => o.includes(n.channelId)
5
+ ), c = [];
6
+ return r.forEach((n) => {
6
7
  n.segmentsList.forEach((e) => {
7
- const o = e.startTime.getHours() * 3600 + e.startTime.getMinutes() * 60 + e.startTime.getSeconds(), r = e.endTime.getHours() * 3600 + e.endTime.getMinutes() * 60 + e.endTime.getSeconds();
8
- o <= t && r >= t && s.push({
8
+ const a = d(
9
+ e.startTime,
10
+ s
11
+ ), T = d(
12
+ e.endTime,
13
+ s
14
+ );
15
+ a <= t && T >= t && c.push({
9
16
  channelId: n.channelId,
10
17
  segmentId: e.segmentId,
11
18
  startTime: e.startTime,
12
19
  endTime: e.endTime
13
20
  });
14
21
  });
15
- }), s;
22
+ }), c;
16
23
  };
17
24
  export {
18
- a as getIntersectedSegments
25
+ S as getIntersectedSegments
19
26
  };
@@ -1,6 +1,6 @@
1
1
  import { GetTimeLinePositionProps } from './types';
2
2
  /**
3
- * Obtiene la posición y el ancho de un punto en la línea de tiempo dado un rango de tiempo
3
+ * Resolve the timeline position and width for one wall-clock time range.
4
4
  */
5
5
  export declare const getTimeLinePosition: (props: GetTimeLinePositionProps) => {
6
6
  width: string;
@@ -1 +1 @@
1
- {"version":3,"file":"getTimeLinePosition.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoTimeLineSelector/helpers/getTimeLinePosition/getTimeLinePosition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB;;;CAoBlE,CAAC"}
1
+ {"version":3,"file":"getTimeLinePosition.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoTimeLineSelector/helpers/getTimeLinePosition/getTimeLinePosition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAGnD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB;;;CAelE,CAAC"}
@@ -1,10 +1,11 @@
1
- const u = (n) => {
2
- const { startTime: e, endTime: t } = n, i = e.getHours() + e.getMinutes() / 60 + e.getSeconds() / 3600 + e.getMilliseconds() / 36e5;
1
+ import { dateToDaySeconds as n } from "../playbackRange/playbackRange.js";
2
+ const T = (o) => {
3
+ const { startTime: i, endTime: s, timeZoneName: e } = o, m = n(i, e), a = n(s, e), t = m / 3600;
3
4
  return {
4
- width: `${(t.getHours() + t.getMinutes() / 60 + t.getSeconds() / 3600 + t.getMilliseconds() / 36e5 - i) / 24 * 100}%`,
5
- left: `${i * 100 / 24}%`
5
+ width: `${(a / 3600 - t) / 24 * 100}%`,
6
+ left: `${t * 100 / 24}%`
6
7
  };
7
8
  };
8
9
  export {
9
- u as getTimeLinePosition
10
+ T as getTimeLinePosition
10
11
  };
@@ -1,5 +1,6 @@
1
1
  export type GetTimeLinePositionProps = {
2
2
  startTime: Date;
3
3
  endTime: Date;
4
+ timeZoneName?: string | null;
4
5
  };
5
6
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoTimeLineSelector/helpers/getTimeLinePosition/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;CACf,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/gclick/src/components/VideoTimeLineSelector/helpers/getTimeLinePosition/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,IAAI,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAA"}