@guardian/interactive-component-library 0.1.0-alpha.18 → 0.1.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,17 @@
1
1
  import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
2
- import { useRef, useCallback, useEffect, useMemo, useState, useLayoutEffect, useContext, useImperativeHandle } from "preact/hooks";
2
+ import { useRef, useMemo, useCallback, useEffect, useState, useLayoutEffect, useContext, useImperativeHandle } from "preact/hooks";
3
3
  import { render, createElement, cloneElement, createContext, toChildArray } from "preact";
4
4
  import { useSyncExternalStore, createPortal, forwardRef } from "preact/compat";
5
5
  import { scaleLinear as scaleLinear$1 } from "d3-scale";
6
6
  import { geoStream, geoAlbers, geoPath, geoContains, geoMercator } from "d3-geo";
7
7
  const main = "";
8
- const group = "_group_nq9z3_1";
9
- const rotated = "_rotated_nq9z3_6";
10
- const path$4 = "_path_nq9z3_10";
11
- const active = "_active_nq9z3_14";
12
- const defaultStyles$s = {
8
+ const svg$9 = "_svg_b5io0_1";
9
+ const group = "_group_b5io0_5";
10
+ const rotated = "_rotated_b5io0_10";
11
+ const path$4 = "_path_b5io0_14";
12
+ const active = "_active_b5io0_18";
13
+ const defaultStyles$t = {
14
+ svg: svg$9,
13
15
  group,
14
16
  rotated,
15
17
  path: path$4,
@@ -48,19 +50,20 @@ function Chevron({
48
50
  styles: styles2
49
51
  }) {
50
52
  const defaultStylesCopy = {
51
- ...defaultStyles$s
53
+ ...defaultStyles$t
52
54
  };
53
55
  if (active2) {
54
- defaultStylesCopy.path = mergeStyles(defaultStyles$s.path, defaultStyles$s.active);
56
+ defaultStylesCopy.path = mergeStyles(defaultStyles$t.path, defaultStyles$t.active);
55
57
  }
56
58
  if (direction === DIRECTION.up) {
57
- defaultStylesCopy.group = mergeStyles(defaultStyles$s.group, defaultStyles$s.rotated);
59
+ defaultStylesCopy.group = mergeStyles(defaultStyles$t.group, defaultStyles$t.rotated);
58
60
  }
59
61
  styles2 = mergeStyles(defaultStylesCopy, styles2);
60
62
  return jsx("svg", {
61
63
  width: "16",
62
64
  height: "24",
63
65
  viewBox: "0 0 16 24",
66
+ className: styles2.svg,
64
67
  fill: "none",
65
68
  xmlns: "http://www.w3.org/2000/svg",
66
69
  children: jsx("g", {
@@ -75,12 +78,12 @@ function Chevron({
75
78
  })
76
79
  });
77
80
  }
78
- const container$4 = "_container_jzalm_1";
81
+ const container$5 = "_container_jzalm_1";
79
82
  const dot = "_dot_jzalm_6";
80
83
  const circle$2 = "_circle_jzalm_13";
81
84
  const text$4 = "_text_jzalm_17";
82
- const defaultStyles$r = {
83
- container: container$4,
85
+ const defaultStyles$s = {
86
+ container: container$5,
84
87
  dot,
85
88
  circle: circle$2,
86
89
  text: text$4
@@ -96,10 +99,10 @@ const LegendItem = ({
96
99
  abbreviation
97
100
  }) => {
98
101
  const defaultStylesCopy = {
99
- ...defaultStyles$r
102
+ ...defaultStyles$s
100
103
  };
101
104
  if (dotType === DOT_TYPE.round) {
102
- defaultStylesCopy.dot = mergeStyles(defaultStyles$r.dot, defaultStyles$r.circle);
105
+ defaultStylesCopy.dot = mergeStyles(defaultStyles$s.dot, defaultStyles$s.circle);
103
106
  }
104
107
  styles2 = mergeStyles(defaultStylesCopy, styles2);
105
108
  return jsxs("div", {
@@ -112,19 +115,60 @@ const LegendItem = ({
112
115
  })]
113
116
  });
114
117
  };
115
- const bar$2 = "_bar_wmb0k_1";
116
- const label$1 = "_label_wmb0k_5";
117
- const backgroundRect = "_backgroundRect_wmb0k_11";
118
- const defaultStyles$q = {
118
+ const bar$2 = "_bar_bf839_1";
119
+ const label$1 = "_label_bf839_5";
120
+ const backgroundRect = "_backgroundRect_bf839_11";
121
+ const defaultStyles$r = {
119
122
  bar: bar$2,
120
123
  label: label$1,
121
124
  backgroundRect
122
125
  };
126
+ function preventOverlap(labelPositions, iteration = 0, labelSize = 12, coordinate = "y") {
127
+ const maxIterations = 10;
128
+ let totalOverlap = 0;
129
+ for (let index2 = 1; index2 < labelPositions.length; index2++) {
130
+ const previousElement = labelPositions[index2 - 1];
131
+ const element = labelPositions[index2];
132
+ const overlap = previousElement[coordinate] - (element[coordinate] - labelSize);
133
+ if (overlap < 0) {
134
+ continue;
135
+ }
136
+ previousElement[coordinate] -= overlap / 2;
137
+ element[coordinate] += overlap / 2;
138
+ totalOverlap += overlap;
139
+ }
140
+ if (totalOverlap > 0 && iteration < maxIterations) {
141
+ return preventOverlap(labelPositions, iteration + 1);
142
+ }
143
+ return labelPositions;
144
+ }
145
+ function uniqueBy(array, key) {
146
+ return [...array.reduce((map, d2) => map.set(d2[key], d2), /* @__PURE__ */ new Map()).values()];
147
+ }
148
+ function positionLabels(labels, coordinate = "y") {
149
+ labels = uniqueBy(labels, "value");
150
+ labels.sort((a, b) => a[coordinate] - b[coordinate]);
151
+ return preventOverlap(labels);
152
+ }
153
+ function scaleLinear(domain, range) {
154
+ const [domainMin, domainMax] = domain;
155
+ const [rangeMin, rangeMax] = range;
156
+ const slope = (rangeMax - rangeMin) / (domainMax - domainMin);
157
+ const intercept = rangeMin - slope * domainMin;
158
+ return function(x) {
159
+ return slope * x + intercept;
160
+ };
161
+ }
162
+ const LabelType = {
163
+ hanging: "hanging",
164
+ inline: "inline"
165
+ };
123
166
  function StackedBar({
124
167
  stack,
125
168
  width,
126
169
  height,
127
- hideLabels = true,
170
+ hideLabels = false,
171
+ labelType = LabelType.hanging,
128
172
  showBackgroundRect = false,
129
173
  createSVG = true,
130
174
  styles: styles2
@@ -132,11 +176,32 @@ function StackedBar({
132
176
  const rectElements = useRef([]);
133
177
  const textElements = useRef([]);
134
178
  styles2 = mergeStyles({
135
- ...defaultStyles$q
179
+ ...defaultStyles$r
136
180
  }, styles2);
181
+ const svgHeight = labelType === LabelType.hanging ? height + 20 : height;
182
+ const renderLabel = (config, i) => jsx("text", {
183
+ ref: (element) => textElements.current[i] = element,
184
+ "text-rendering": "optimizeLegibility",
185
+ className: styles2.label,
186
+ style: {
187
+ display: "visible"
188
+ },
189
+ x: config.x,
190
+ y: config.y,
191
+ textAnchor: config.textAnchor,
192
+ alignmentBaseline: config.alignmentBaseline,
193
+ children: config.value
194
+ }, `label-${i}`);
137
195
  let totalWidth = 0;
138
196
  const content2 = stack.map((d2, index2) => {
139
197
  const itemWidth = d2.fraction * width;
198
+ const labelConfig = {
199
+ value: d2.label,
200
+ x: itemWidth - 4,
201
+ y: height / 2,
202
+ textAnchor: "end",
203
+ alignmentBaseline: "central"
204
+ };
140
205
  const value = jsxs("g", {
141
206
  transform: `translate(${totalWidth}, 0)`,
142
207
  children: [jsx("rect", {
@@ -148,23 +213,28 @@ function StackedBar({
148
213
  fill: d2.fill
149
214
  },
150
215
  "shape-rendering": "crispEdges"
151
- }), !hideLabels && jsx("text", {
152
- ref: (element) => textElements.current[index2] = element,
153
- x: itemWidth - 4,
154
- y: height / 2,
155
- "text-anchor": "end",
156
- "alignment-baseline": "central",
157
- "text-rendering": "optimizeLegibility",
158
- className: styles2.label,
159
- style: {
160
- display: hideLabels ? "hidden" : "visible"
161
- },
162
- children: d2.label
163
- })]
216
+ }), labelType === LabelType.inline && !hideLabels && renderLabel(labelConfig, index2)]
164
217
  }, index2);
165
218
  totalWidth += itemWidth;
166
219
  return value;
167
220
  });
221
+ const hangingLabelConfig = useMemo(() => {
222
+ let totalW = 0;
223
+ let labels = stack.map((d2) => {
224
+ const itemWidth = d2.fraction * width;
225
+ const labelConfig = {
226
+ x: itemWidth + totalW,
227
+ y: height + 4,
228
+ value: d2.label,
229
+ textAnchor: "end",
230
+ alignmentBaseline: "hanging"
231
+ };
232
+ console.log(labelConfig);
233
+ totalW += itemWidth;
234
+ return labelConfig;
235
+ });
236
+ return preventOverlap(labels, 0, 20, "x");
237
+ }, [stack, height, width]);
168
238
  const backgroundRect2 = jsx("g", {
169
239
  children: jsx("rect", {
170
240
  x: "0",
@@ -178,14 +248,16 @@ function StackedBar({
178
248
  return jsxs("svg", {
179
249
  overflow: "hidden",
180
250
  width,
181
- height,
182
- viewBox: `0 0 ${width} ${height}`,
251
+ height: svgHeight,
252
+ viewBox: `0 0 ${width} ${svgHeight}`,
183
253
  xmlns: "http://www.w3.org/2000/svg",
184
- children: [showBackgroundRect && backgroundRect2, content2]
254
+ children: [showBackgroundRect && backgroundRect2, jsxs("g", {
255
+ children: [content2, labelType === LabelType.hanging && !hideLabels && hangingLabelConfig.map((config, i) => renderLabel(config, i))]
256
+ })]
185
257
  });
186
258
  }
187
- return jsx(Fragment, {
188
- children: content2
259
+ return jsxs("g", {
260
+ children: [content2, labelType === LabelType.hanging && !hideLabels && hangingLabelConfig.map((config, i) => renderLabel(config, i))]
189
261
  });
190
262
  }
191
263
  function shouldUpdate(oldState, newState) {
@@ -245,7 +317,7 @@ const [useGradients, setGradients, getGradients] = createStore({});
245
317
  const svg$8 = "_svg_1cajk_6";
246
318
  const previous = "_previous_1cajk_12";
247
319
  const next = "_next_1cajk_16";
248
- const defaultStyles$p = {
320
+ const defaultStyles$q = {
249
321
  svg: svg$8,
250
322
  previous,
251
323
  next
@@ -256,7 +328,7 @@ const GradientIcon = (props) => {
256
328
  next: next2,
257
329
  styles: styles2
258
330
  } = props;
259
- styles2 = mergeStyles(defaultStyles$p, styles2);
331
+ styles2 = mergeStyles(defaultStyles$q, styles2);
260
332
  const gradientId = `gv-gradient-def-${previous2}-${next2}`;
261
333
  const gradients = useGradients();
262
334
  useEffect(() => {
@@ -323,9 +395,9 @@ function GradientDefs({
323
395
  })
324
396
  });
325
397
  }
326
- const button$4 = "_button_kpmyt_1";
327
- const svg$7 = "_svg_kpmyt_14";
328
- const defaultStyles$o = {
398
+ const button$4 = "_button_oqopj_1";
399
+ const svg$7 = "_svg_oqopj_15";
400
+ const defaultStyles$p = {
329
401
  button: button$4,
330
402
  svg: svg$7
331
403
  };
@@ -334,7 +406,7 @@ const InfoButton = ({
334
406
  styles: styles2
335
407
  }) => {
336
408
  styles2 = mergeStyles({
337
- ...defaultStyles$o
409
+ ...defaultStyles$p
338
410
  }, styles2);
339
411
  return jsx("button", {
340
412
  class: styles2.button,
@@ -352,7 +424,7 @@ const InfoButton = ({
352
424
  const svg$6 = "_svg_1v49v_1";
353
425
  const circle$1 = "_circle_1v49v_5";
354
426
  const pulse = "_pulse_1v49v_9";
355
- const defaultStyles$n = {
427
+ const defaultStyles$o = {
356
428
  svg: svg$6,
357
429
  circle: circle$1,
358
430
  pulse
@@ -362,7 +434,7 @@ const CircleIcon = ({
362
434
  pulse: pulse2 = false,
363
435
  styles: styles2
364
436
  }) => {
365
- styles2 = mergeStyles(defaultStyles$n, styles2);
437
+ styles2 = mergeStyles(defaultStyles$o, styles2);
366
438
  return jsx("svg", {
367
439
  style: styles2.svg,
368
440
  fill: "none",
@@ -382,7 +454,7 @@ const CircleIcon = ({
382
454
  });
383
455
  };
384
456
  const text$3 = "_text_1okyv_1";
385
- const defaultStyles$m = {
457
+ const defaultStyles$n = {
386
458
  text: text$3
387
459
  };
388
460
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -732,7 +804,7 @@ const RelativeTimeSentence = ({
732
804
  styles: styles2
733
805
  }) => {
734
806
  styles2 = mergeStyles({
735
- ...defaultStyles$m
807
+ ...defaultStyles$n
736
808
  }, styles2);
737
809
  let timeSince = dayjs(timeStamp).fromNow();
738
810
  return jsx("span", {
@@ -742,7 +814,7 @@ const RelativeTimeSentence = ({
742
814
  };
743
815
  const pageContainer = "_pageContainer_1s0yq_9";
744
816
  const sideBorders = "_sideBorders_1s0yq_42";
745
- const defaultStyles$l = {
817
+ const defaultStyles$m = {
746
818
  pageContainer,
747
819
  sideBorders
748
820
  };
@@ -754,15 +826,19 @@ function Container({
754
826
  const {
755
827
  pageContainer: pageContainer2,
756
828
  sideBorders: sideBordersStyle
757
- } = mergeStyles(defaultStyles$l, styles2);
829
+ } = mergeStyles(defaultStyles$m, styles2);
758
830
  return jsx("div", {
759
831
  className: [pageContainer2, sideBorders2 && sideBordersStyle].join(" "),
760
832
  children
761
833
  });
762
834
  }
763
- const bar$1 = "_bar_17pyf_9";
764
- const defaultStyles$k = {
765
- bar: bar$1
835
+ const wrapper = "_wrapper_5oj1x_9";
836
+ const bar$1 = "_bar_5oj1x_14";
837
+ const zero = "_zero_5oj1x_19";
838
+ const defaultStyles$l = {
839
+ wrapper,
840
+ bar: bar$1,
841
+ zero
766
842
  };
767
843
  function ChangeBar({
768
844
  fraction,
@@ -778,23 +854,27 @@ function ChangeBar({
778
854
  let posleft = `${centre}px`;
779
855
  let thisStyles = ` height: ${height}; width: ${barwidth}px; ${positive ? `left: ${posleft}` : `left: ${negleft}`}`;
780
856
  let thisColor = ` bg-color--${party}`;
857
+ let zeroStyles = ` height: ${height};`;
781
858
  styles2 = mergeStyles({
782
- ...defaultStyles$k
859
+ ...defaultStyles$l
783
860
  }, styles2);
784
- return jsx("div", {
861
+ return jsxs("div", {
785
862
  className: styles2.wrapper,
786
863
  style: `width: ${width}px`,
787
- children: jsx("div", {
864
+ children: [jsx("div", {
788
865
  className: styles2.bar.concat(thisColor),
789
866
  style: thisStyles
790
- })
867
+ }), jsx("div", {
868
+ className: styles2.zero,
869
+ style: zeroStyles
870
+ })]
791
871
  });
792
872
  }
793
873
  const svg$5 = "_svg_886i1_9";
794
874
  const dividingLineColor = "_dividingLineColor_886i1_16";
795
875
  const square = "_square_886i1_20";
796
876
  const corner = "_corner_886i1_24";
797
- const defaultStyles$j = {
877
+ const defaultStyles$k = {
798
878
  svg: svg$5,
799
879
  dividingLineColor,
800
880
  square,
@@ -807,7 +887,7 @@ const SquareCutCornerIcon = ({
807
887
  styles: styles2
808
888
  }) => {
809
889
  styles2 = mergeStyles({
810
- ...defaultStyles$j
890
+ ...defaultStyles$k
811
891
  }, styles2);
812
892
  let cornerSize = squareSize * 0.625;
813
893
  let cornerMargin = squareSize < 100 ? squareSize / 6 : 10;
@@ -840,12 +920,12 @@ const SquareCutCornerIcon = ({
840
920
  })
841
921
  });
842
922
  };
843
- const stackedGridContainer = "_stackedGridContainer_1e05o_1";
844
- const stackedGridRotateItems0 = "_stackedGridRotateItems0_1e05o_13";
845
- const stackedGridRotateItems90 = "_stackedGridRotateItems90_1e05o_19";
846
- const stackedGridRotateItems180 = "_stackedGridRotateItems180_1e05o_25";
847
- const stackedGridRotateItems270 = "_stackedGridRotateItems270_1e05o_31";
848
- const defaultStyles$i = {
923
+ const stackedGridContainer = "_stackedGridContainer_6whof_1";
924
+ const stackedGridRotateItems0 = "_stackedGridRotateItems0_6whof_11";
925
+ const stackedGridRotateItems90 = "_stackedGridRotateItems90_6whof_17";
926
+ const stackedGridRotateItems180 = "_stackedGridRotateItems180_6whof_23";
927
+ const stackedGridRotateItems270 = "_stackedGridRotateItems270_6whof_29";
928
+ const defaultStyles$j = {
849
929
  stackedGridContainer,
850
930
  stackedGridRotateItems0,
851
931
  stackedGridRotateItems90,
@@ -871,29 +951,23 @@ const getContainerFlip = (fromBottom, fromLeft) => {
871
951
  const StackedGrid = ({
872
952
  fromLeft,
873
953
  fromBottom,
874
- containerWidth,
875
954
  children,
876
955
  styles: styles2
877
956
  }) => {
878
957
  let containerFlip = getContainerFlip(fromBottom, fromLeft);
879
958
  let itemRotateClass = getItemRotate(fromBottom, fromLeft);
880
- let flexStyles = {
881
- display: "flex",
882
- flexDirection: "row",
883
- flexWrap: "wrap",
884
- width: containerWidth,
885
- transform: containerFlip
886
- };
887
- styles2 = mergeStyles(defaultStyles$i, styles2);
959
+ styles2 = mergeStyles(defaultStyles$j, styles2);
888
960
  return jsx("div", {
889
- style: flexStyles,
961
+ style: {
962
+ transform: containerFlip
963
+ },
890
964
  className: `${styles2.stackedGridContainer} ${styles2[itemRotateClass]}`,
891
965
  children
892
966
  });
893
967
  };
894
968
  const svg$4 = "_svg_l2fsl_9";
895
969
  const squareFill = "_squareFill_l2fsl_16";
896
- const defaultStyles$h = {
970
+ const defaultStyles$i = {
897
971
  svg: svg$4,
898
972
  squareFill
899
973
  };
@@ -903,7 +977,7 @@ const SquareIcon = ({
903
977
  styles: styles2
904
978
  }) => {
905
979
  styles2 = mergeStyles({
906
- ...defaultStyles$h
980
+ ...defaultStyles$i
907
981
  }, styles2);
908
982
  return jsx("svg", {
909
983
  width: size,
@@ -921,7 +995,7 @@ const SquareIcon = ({
921
995
  };
922
996
  const button$3 = "_button_1fees_1";
923
997
  const icon = "_icon_1fees_6";
924
- const defaultStyles$g = {
998
+ const defaultStyles$h = {
925
999
  button: button$3,
926
1000
  icon
927
1001
  };
@@ -931,7 +1005,7 @@ function ArrowButton({
931
1005
  styles: styles2,
932
1006
  onClick
933
1007
  }) {
934
- styles2 = mergeStyles(defaultStyles$g, styles2);
1008
+ styles2 = mergeStyles(defaultStyles$h, styles2);
935
1009
  return jsx("button", {
936
1010
  className: styles2.button,
937
1011
  disabled,
@@ -955,9 +1029,9 @@ function ArrowButton({
955
1029
  })
956
1030
  });
957
1031
  }
958
- const button$2 = "_button_19t7j_1";
959
- const buttonInner$1 = "_buttonInner_19t7j_6";
960
- const defaultStyles$f = {
1032
+ const button$2 = "_button_3521c_1";
1033
+ const buttonInner$1 = "_buttonInner_3521c_6";
1034
+ const defaultStyles$g = {
961
1035
  button: button$2,
962
1036
  buttonInner: buttonInner$1
963
1037
  };
@@ -967,7 +1041,7 @@ function Button({
967
1041
  styles: styles2,
968
1042
  children
969
1043
  }) {
970
- styles2 = mergeStyles(defaultStyles$f, styles2);
1044
+ styles2 = mergeStyles(defaultStyles$g, styles2);
971
1045
  return jsx("button", {
972
1046
  className: styles2.button,
973
1047
  "data-type": type,
@@ -978,11 +1052,11 @@ function Button({
978
1052
  })
979
1053
  });
980
1054
  }
981
- const button$1 = "_button_6w12u_1";
982
- const buttonBorder = "_buttonBorder_6w12u_10";
983
- const svg$3 = "_svg_6w12u_18";
984
- const path$3 = "_path_6w12u_24";
985
- const defaultStyles$e = {
1055
+ const button$1 = "_button_125im_1";
1056
+ const buttonBorder = "_buttonBorder_125im_11";
1057
+ const svg$3 = "_svg_125im_19";
1058
+ const path$3 = "_path_125im_25";
1059
+ const defaultStyles$f = {
986
1060
  button: button$1,
987
1061
  buttonBorder,
988
1062
  svg: svg$3,
@@ -993,7 +1067,7 @@ function CloseButton({
993
1067
  onClick,
994
1068
  styles: styles2
995
1069
  }) {
996
- styles2 = mergeStyles(defaultStyles$e, styles2);
1070
+ styles2 = mergeStyles(defaultStyles$f, styles2);
997
1071
  return jsx("button", {
998
1072
  className: [styles2.button, border && styles2.buttonBorder].join(" "),
999
1073
  onClick,
@@ -1011,6 +1085,39 @@ function CloseButton({
1011
1085
  })
1012
1086
  });
1013
1087
  }
1088
+ const container$4 = "_container_tq3ke_1";
1089
+ const slot = "_slot_tq3ke_5";
1090
+ const defaultStyles$e = {
1091
+ container: container$4,
1092
+ slot
1093
+ };
1094
+ function AdSlot({
1095
+ name: name2,
1096
+ sizeMapping,
1097
+ styles: styles2
1098
+ }) {
1099
+ var _a, _b, _c;
1100
+ const slotId = `dfp-ad--${name2}`;
1101
+ styles2 = mergeStyles(defaultStyles$e, styles2);
1102
+ const mobileSizes = (_a = sizeMapping.mobile) == null ? void 0 : _a.map((size) => size.join(",")).join("|");
1103
+ const tabletSizes = (_b = sizeMapping.tablet) == null ? void 0 : _b.map((size) => size.join(",")).join("|");
1104
+ const desktopSizes = (_c = sizeMapping.desktop) == null ? void 0 : _c.map((size) => size.join(",")).join("|");
1105
+ return jsx("div", {
1106
+ className: ["ad-slot-container", styles2.container].join(" "),
1107
+ children: jsx("div", {
1108
+ id: slotId,
1109
+ className: ["js-ad-slot", "ad-slot", "interactive-ad-slot", styles2.slot].join(" "),
1110
+ "data-link-name": `ad slot ${name2}`,
1111
+ "data-name": `${name2}`,
1112
+ "data-label-show": "true",
1113
+ "ad-label-text": "Advertisement",
1114
+ "aria-hidden": "true",
1115
+ "data-mobile": mobileSizes,
1116
+ "data-tablet": tabletSizes,
1117
+ "data-desktop": desktopSizes
1118
+ })
1119
+ });
1120
+ }
1014
1121
  const sortAscending = (accessor) => {
1015
1122
  return (a, b) => {
1016
1123
  const valueA = a[accessor];
@@ -1129,13 +1236,13 @@ class CellModel {
1129
1236
  return this.row[this.column.accessor].toString();
1130
1237
  }
1131
1238
  }
1132
- const table = "_table_1b75c_9";
1133
- const hideHeader = "_hideHeader_1b75c_18";
1134
- const hideHeaderNoBorder = "_hideHeaderNoBorder_1b75c_27";
1135
- const headerCell = "_headerCell_1b75c_31";
1136
- const headerCellButton = "_headerCellButton_1b75c_39";
1137
- const bodyRow = "_bodyRow_1b75c_48";
1138
- const bodyCell = "_bodyCell_1b75c_53";
1239
+ const table = "_table_1dg64_9";
1240
+ const hideHeader = "_hideHeader_1dg64_19";
1241
+ const hideHeaderNoBorder = "_hideHeaderNoBorder_1dg64_28";
1242
+ const headerCell = "_headerCell_1dg64_32";
1243
+ const headerCellButton = "_headerCellButton_1dg64_40";
1244
+ const bodyRow = "_bodyRow_1dg64_49";
1245
+ const bodyCell = "_bodyCell_1dg64_54";
1139
1246
  const defaultStyles$d = {
1140
1247
  table,
1141
1248
  hideHeader,
@@ -1180,6 +1287,8 @@ function Table({
1180
1287
  styles2 = mergeStyles(defaultStyles$d, styles2);
1181
1288
  return jsxs("table", {
1182
1289
  className: styles2.table,
1290
+ cellSpacing: 0,
1291
+ cellPadding: 0,
1183
1292
  children: [jsx("thead", {
1184
1293
  className: hideHeader2 && styles2.hideHeader,
1185
1294
  children: jsx("tr", {
@@ -1237,42 +1346,6 @@ function HeaderCell({
1237
1346
  })]
1238
1347
  });
1239
1348
  }
1240
- function preventOverlap(labelPositions, iteration = 0, labelHeight = 12) {
1241
- const maxIterations = 10;
1242
- let totalOverlap = 0;
1243
- for (let index2 = 1; index2 < labelPositions.length; index2++) {
1244
- const previousElement = labelPositions[index2 - 1];
1245
- const element = labelPositions[index2];
1246
- const overlap = previousElement.y - (element.y - labelHeight);
1247
- if (overlap < 0) {
1248
- continue;
1249
- }
1250
- previousElement.y -= overlap / 2;
1251
- element.y += overlap / 2;
1252
- totalOverlap += overlap;
1253
- }
1254
- if (totalOverlap > 0 && iteration < maxIterations) {
1255
- return preventOverlap(labelPositions, iteration + 1);
1256
- }
1257
- return labelPositions;
1258
- }
1259
- function uniqueBy(array, key) {
1260
- return [...array.reduce((map, d2) => map.set(d2[key], d2), /* @__PURE__ */ new Map()).values()];
1261
- }
1262
- function positionLabels(labels) {
1263
- labels = uniqueBy(labels, "value");
1264
- labels.sort((a, b) => a.y - b.y);
1265
- return preventOverlap(labels);
1266
- }
1267
- function scaleLinear(domain, range) {
1268
- const [domainMin, domainMax] = domain;
1269
- const [rangeMin, rangeMax] = range;
1270
- const slope = (rangeMax - rangeMin) / (domainMax - domainMin);
1271
- const intercept = rangeMin - slope * domainMin;
1272
- return function(x) {
1273
- return slope * x + intercept;
1274
- };
1275
- }
1276
1349
  function useWindowSize() {
1277
1350
  const [windowSize, setWindowSize] = useState(() => {
1278
1351
  if (typeof window === "undefined")
@@ -1745,16 +1818,17 @@ const ControlChange = ({
1745
1818
  })
1746
1819
  });
1747
1820
  };
1748
- const toplineResult = "_toplineResult_w8o28_9";
1749
- const primaryname = "_primaryname_w8o28_12";
1750
- const secondaryname = "_secondaryname_w8o28_26";
1751
- const name = "_name_w8o28_32";
1752
- const displayNumbers = "_displayNumbers_w8o28_45";
1753
- const mainNumber = "_mainNumber_w8o28_54";
1754
- const secondaryNumber = "_secondaryNumber_w8o28_58";
1755
- const displayRow = "_displayRow_w8o28_65";
1756
- const displayColumn = "_displayColumn_w8o28_71";
1757
- const topRow = "_topRow_w8o28_75";
1821
+ const toplineResult = "_toplineResult_49z3u_9";
1822
+ const primaryname = "_primaryname_49z3u_14";
1823
+ const secondaryname = "_secondaryname_49z3u_29";
1824
+ const name = "_name_49z3u_36";
1825
+ const displayNumbers = "_displayNumbers_49z3u_50";
1826
+ const mainNumber = "_mainNumber_49z3u_61";
1827
+ const mainNumberSuffix = "_mainNumberSuffix_49z3u_66";
1828
+ const secondaryNumber = "_secondaryNumber_49z3u_69";
1829
+ const displayRow = "_displayRow_49z3u_76";
1830
+ const displayColumn = "_displayColumn_49z3u_82";
1831
+ const topRow = "_topRow_49z3u_86";
1758
1832
  const defaultStyles$9 = {
1759
1833
  toplineResult,
1760
1834
  primaryname,
@@ -1762,6 +1836,7 @@ const defaultStyles$9 = {
1762
1836
  name,
1763
1837
  displayNumbers,
1764
1838
  mainNumber,
1839
+ mainNumberSuffix,
1765
1840
  secondaryNumber,
1766
1841
  displayRow,
1767
1842
  displayColumn,
@@ -1771,6 +1846,7 @@ const ToplineResult = ({
1771
1846
  name: name2,
1772
1847
  secondaryName,
1773
1848
  mainNumber: mainNumber2,
1849
+ mainNumberSuffix: mainNumberSuffix2,
1774
1850
  secondaryNumber: secondaryNumber2,
1775
1851
  styles: styles2,
1776
1852
  displayRow: displayRow2 = false,
@@ -1783,64 +1859,66 @@ const ToplineResult = ({
1783
1859
  ...defaultStyles$9
1784
1860
  }, styles2);
1785
1861
  const displayStyle = displayRow2 ? styles2.displayRow : styles2.displayColumn;
1786
- return !secondaryName ? jsxs(Fragment, {
1787
- children: [" ", jsxs("div", {
1788
- class: styles2.toplineResult,
1789
- onMouseOver,
1862
+ return !secondaryName ? jsxs("div", {
1863
+ class: styles2.toplineResult,
1864
+ onMouseOver,
1865
+ children: [jsxs("div", {
1866
+ class: styles2.topRow,
1867
+ children: [jsx("span", {
1868
+ class: `${styles2.name} before-color--${abbreviation}`,
1869
+ children: name2
1870
+ }), " ", showInfoButton && jsx("span", {
1871
+ class: styles2.infoButton,
1872
+ children: jsx(InfoButton, {
1873
+ onClick: onInfoPress
1874
+ })
1875
+ })]
1876
+ }), jsxs("div", {
1877
+ class: `${styles2.displayNumbers} ${displayStyle}`,
1790
1878
  children: [jsxs("div", {
1791
- class: styles2.topRow,
1792
- children: [jsx("span", {
1793
- class: `${styles2.name} before-color--${abbreviation}`,
1794
- children: name2
1795
- }), " ", showInfoButton && jsx("span", {
1796
- class: styles2.infoButton,
1797
- children: jsx(InfoButton, {
1798
- onClick: onInfoPress
1799
- })
1800
- })]
1801
- }), jsxs("div", {
1802
- class: `${styles2.displayNumbers} ${displayStyle}`,
1803
- children: [jsx("div", {
1804
- class: styles2.mainNumber,
1805
- children: mainNumber2
1806
- }), jsx("div", {
1807
- class: styles2.secondaryNumber,
1808
- children: secondaryNumber2
1879
+ class: styles2.mainNumber,
1880
+ children: [mainNumber2, mainNumberSuffix2 && jsx("span", {
1881
+ className: styles2.mainNumberSuffix,
1882
+ children: mainNumberSuffix2
1809
1883
  })]
1884
+ }), jsx("div", {
1885
+ class: styles2.secondaryNumber,
1886
+ children: secondaryNumber2
1810
1887
  })]
1811
1888
  })]
1812
- }) : jsx(Fragment, {
1813
- children: jsxs("div", {
1814
- class: styles2.toplineResult,
1815
- onMouseOver,
1889
+ }) : jsxs("div", {
1890
+ class: styles2.toplineResult,
1891
+ onMouseOver,
1892
+ children: [jsxs("div", {
1893
+ class: styles2.topRow,
1894
+ children: [jsx("span", {
1895
+ class: `${styles2.primaryname} before-color--${abbreviation}`,
1896
+ children: name2
1897
+ }), " ", showInfoButton && jsx("span", {
1898
+ class: styles2.infoButton,
1899
+ children: jsx(InfoButton, {
1900
+ onClick: onInfoPress
1901
+ })
1902
+ })]
1903
+ }), jsxs("div", {
1904
+ class: styles2.subhead,
1905
+ children: [jsx("span", {
1906
+ class: styles2.secondaryname,
1907
+ children: secondaryName
1908
+ }), " "]
1909
+ }), jsxs("div", {
1910
+ class: `${styles2.displayNumbers} ${displayStyle}`,
1816
1911
  children: [jsxs("div", {
1817
- class: styles2.topRow,
1818
- children: [jsx("span", {
1819
- class: `${styles2.primaryname} before-color--${abbreviation}`,
1820
- children: name2
1821
- }), " ", showInfoButton && jsx("span", {
1822
- class: styles2.infoButton,
1823
- children: jsx(InfoButton, {
1824
- onClick: onInfoPress
1825
- })
1826
- })]
1827
- }), jsxs("div", {
1828
- class: styles2.subhead,
1829
- children: [jsx("span", {
1830
- class: styles2.secondaryname,
1831
- children: secondaryName
1832
- }), " "]
1833
- }), jsxs("div", {
1834
- class: `${styles2.displayNumbers} ${displayStyle}`,
1835
- children: [jsx("div", {
1836
- class: styles2.mainNumber,
1837
- children: mainNumber2
1838
- }), jsx("div", {
1839
- class: styles2.secondaryNumber,
1840
- children: secondaryNumber2
1912
+ class: styles2.mainNumber,
1913
+ children: [mainNumber2, mainNumberSuffix2 && jsx("span", {
1914
+ className: styles2.mainNumberSuffix,
1915
+ children: mainNumberSuffix2
1841
1916
  })]
1917
+ }), jsx("div", {
1918
+ class: styles2.secondaryNumber,
1919
+ children: secondaryNumber2
1842
1920
  })]
1843
- })
1921
+ })]
1844
1922
  });
1845
1923
  };
1846
1924
  const section = "_section_12aiu_9";
@@ -2714,14 +2792,14 @@ function SearchIcon() {
2714
2792
  })
2715
2793
  });
2716
2794
  }
2717
- const searchContainer = "_searchContainer_g5w44_1";
2718
- const input = "_input_g5w44_5";
2719
- const searchIcon = "_searchIcon_g5w44_21";
2720
- const clearButton = "_clearButton_g5w44_30";
2721
- const suggestions = "_suggestions_g5w44_36";
2722
- const suggestion = "_suggestion_g5w44_36";
2723
- const selected = "_selected_g5w44_59";
2724
- const highlighted = "_highlighted_g5w44_63";
2795
+ const searchContainer = "_searchContainer_1883t_1";
2796
+ const input = "_input_1883t_5";
2797
+ const searchIcon = "_searchIcon_1883t_23";
2798
+ const clearButton = "_clearButton_1883t_32";
2799
+ const suggestions = "_suggestions_1883t_38";
2800
+ const suggestion = "_suggestion_1883t_38";
2801
+ const selected = "_selected_1883t_61";
2802
+ const highlighted = "_highlighted_1883t_65";
2725
2803
  const defaultStyles$3 = {
2726
2804
  searchContainer,
2727
2805
  input,
@@ -3122,15 +3200,15 @@ function Gradient() {
3122
3200
  })]
3123
3201
  });
3124
3202
  }
3125
- const ticker = "_ticker_2eemh_9";
3126
- const tickerItems = "_tickerItems_2eemh_19";
3127
- const tickerScroll = "_tickerScroll_2eemh_24";
3128
- const tickerItem = "_tickerItem_2eemh_19";
3129
- const controls = "_controls_2eemh_46";
3130
- const gradient = "_gradient_2eemh_61";
3131
- const buttons = "_buttons_2eemh_75";
3132
- const button = "_button_2eemh_75";
3133
- const buttonInner = "_buttonInner_2eemh_101";
3203
+ const ticker = "_ticker_1as05_9";
3204
+ const tickerItems = "_tickerItems_1as05_21";
3205
+ const tickerScroll = "_tickerScroll_1as05_26";
3206
+ const tickerItem = "_tickerItem_1as05_21";
3207
+ const controls = "_controls_1as05_48";
3208
+ const gradient = "_gradient_1as05_63";
3209
+ const buttons = "_buttons_1as05_75";
3210
+ const button = "_button_1as05_75";
3211
+ const buttonInner = "_buttonInner_1as05_100";
3134
3212
  const styles = {
3135
3213
  ticker,
3136
3214
  tickerItems,
@@ -3221,7 +3299,7 @@ function Ticker({
3221
3299
  }), jsx("div", {
3222
3300
  className: styles.button,
3223
3301
  children: jsx(Button, {
3224
- type: "small",
3302
+ type: "regular",
3225
3303
  styles: {
3226
3304
  buttonInner: styles.buttonInner
3227
3305
  },
@@ -3233,6 +3311,7 @@ function Ticker({
3233
3311
  });
3234
3312
  }
3235
3313
  export {
3314
+ AdSlot,
3236
3315
  ArrowButton,
3237
3316
  Button,
3238
3317
  ChangeBar,
@@ -3246,6 +3325,7 @@ export {
3246
3325
  GradientIcon,
3247
3326
  GridType,
3248
3327
  InfoButton,
3328
+ LabelType,
3249
3329
  LegendItem,
3250
3330
  Map$1 as Map,
3251
3331
  MapConfiguration,