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

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,58 @@ 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", moveBothLabels = true) {
127
+ for (let index2 = 1; index2 < labelPositions.length; index2++) {
128
+ const previousElement = labelPositions[index2 - 1];
129
+ const element = labelPositions[index2];
130
+ const overlap = previousElement[coordinate] - (element[coordinate] - labelSize);
131
+ if (overlap < 0) {
132
+ continue;
133
+ }
134
+ if (moveBothLabels) {
135
+ previousElement[coordinate] -= overlap / 2;
136
+ element[coordinate] += overlap / 2;
137
+ } else {
138
+ previousElement[coordinate] -= overlap;
139
+ }
140
+ return labelPositions;
141
+ }
142
+ }
143
+ function uniqueBy(array, key) {
144
+ return [...array.reduce((map, d2) => map.set(d2[key], d2), /* @__PURE__ */ new Map()).values()];
145
+ }
146
+ function positionLabels(labels, labelSize = 12, coordinate = "y", moveBothLabels = true) {
147
+ labels = uniqueBy(labels, "value");
148
+ labels.sort((a, b) => a[coordinate] - b[coordinate]);
149
+ return preventOverlap(labels, 0, labelSize, coordinate, moveBothLabels);
150
+ }
151
+ function scaleLinear(domain, range) {
152
+ const [domainMin, domainMax] = domain;
153
+ const [rangeMin, rangeMax] = range;
154
+ const slope = (rangeMax - rangeMin) / (domainMax - domainMin);
155
+ const intercept = rangeMin - slope * domainMin;
156
+ return function(x) {
157
+ return slope * x + intercept;
158
+ };
159
+ }
160
+ const LabelType = {
161
+ hanging: "hanging",
162
+ inline: "inline"
163
+ };
123
164
  function StackedBar({
124
165
  stack,
125
166
  width,
126
167
  height,
127
- hideLabels = true,
168
+ hideLabels = false,
169
+ labelType = LabelType.inline,
128
170
  showBackgroundRect = false,
129
171
  createSVG = true,
130
172
  styles: styles2
@@ -132,11 +174,32 @@ function StackedBar({
132
174
  const rectElements = useRef([]);
133
175
  const textElements = useRef([]);
134
176
  styles2 = mergeStyles({
135
- ...defaultStyles$q
177
+ ...defaultStyles$r
136
178
  }, styles2);
179
+ const svgHeight = labelType === LabelType.hanging && !hideLabels ? height + 20 : height;
180
+ const renderLabel = (config, i) => jsx("text", {
181
+ ref: (element) => textElements.current[i] = element,
182
+ "text-rendering": "optimizeLegibility",
183
+ className: styles2.label,
184
+ style: {
185
+ display: "visible"
186
+ },
187
+ x: config.x,
188
+ y: config.y,
189
+ textAnchor: config.textAnchor,
190
+ alignmentBaseline: config.alignmentBaseline,
191
+ children: config.value
192
+ }, `label-${i}`);
137
193
  let totalWidth = 0;
138
194
  const content2 = stack.map((d2, index2) => {
139
195
  const itemWidth = d2.fraction * width;
196
+ const labelConfig = {
197
+ value: d2.label,
198
+ x: itemWidth - 4,
199
+ y: height / 2,
200
+ textAnchor: "end",
201
+ alignmentBaseline: "central"
202
+ };
140
203
  const value = jsxs("g", {
141
204
  transform: `translate(${totalWidth}, 0)`,
142
205
  children: [jsx("rect", {
@@ -148,23 +211,27 @@ function StackedBar({
148
211
  fill: d2.fill
149
212
  },
150
213
  "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
- })]
214
+ }), labelType === LabelType.inline && !hideLabels && renderLabel(labelConfig, index2)]
164
215
  }, index2);
165
216
  totalWidth += itemWidth;
166
217
  return value;
167
218
  });
219
+ const hangingLabelConfig = useMemo(() => {
220
+ let totalW = 0;
221
+ let labels = stack.map((d2) => {
222
+ const itemWidth = d2.fraction * width;
223
+ const labelConfig = {
224
+ x: itemWidth + totalW,
225
+ y: height + 4,
226
+ value: d2.label,
227
+ textAnchor: "end",
228
+ alignmentBaseline: "hanging"
229
+ };
230
+ totalW += itemWidth;
231
+ return labelConfig;
232
+ });
233
+ return preventOverlap(labels, 0, 20, "x", false);
234
+ }, [stack, height, width]);
168
235
  const backgroundRect2 = jsx("g", {
169
236
  children: jsx("rect", {
170
237
  x: "0",
@@ -178,14 +245,16 @@ function StackedBar({
178
245
  return jsxs("svg", {
179
246
  overflow: "hidden",
180
247
  width,
181
- height,
182
- viewBox: `0 0 ${width} ${height}`,
248
+ height: svgHeight,
249
+ viewBox: `0 0 ${width} ${svgHeight}`,
183
250
  xmlns: "http://www.w3.org/2000/svg",
184
- children: [showBackgroundRect && backgroundRect2, content2]
251
+ children: [showBackgroundRect && backgroundRect2, jsxs("g", {
252
+ children: [content2, labelType === LabelType.hanging && !hideLabels && hangingLabelConfig.map((config, i) => renderLabel(config, i))]
253
+ })]
185
254
  });
186
255
  }
187
- return jsx(Fragment, {
188
- children: content2
256
+ return jsxs("g", {
257
+ children: [content2, labelType === LabelType.hanging && !hideLabels && hangingLabelConfig.map((config, i) => renderLabel(config, i))]
189
258
  });
190
259
  }
191
260
  function shouldUpdate(oldState, newState) {
@@ -245,7 +314,7 @@ const [useGradients, setGradients, getGradients] = createStore({});
245
314
  const svg$8 = "_svg_1cajk_6";
246
315
  const previous = "_previous_1cajk_12";
247
316
  const next = "_next_1cajk_16";
248
- const defaultStyles$p = {
317
+ const defaultStyles$q = {
249
318
  svg: svg$8,
250
319
  previous,
251
320
  next
@@ -256,7 +325,7 @@ const GradientIcon = (props) => {
256
325
  next: next2,
257
326
  styles: styles2
258
327
  } = props;
259
- styles2 = mergeStyles(defaultStyles$p, styles2);
328
+ styles2 = mergeStyles(defaultStyles$q, styles2);
260
329
  const gradientId = `gv-gradient-def-${previous2}-${next2}`;
261
330
  const gradients = useGradients();
262
331
  useEffect(() => {
@@ -323,9 +392,9 @@ function GradientDefs({
323
392
  })
324
393
  });
325
394
  }
326
- const button$4 = "_button_kpmyt_1";
327
- const svg$7 = "_svg_kpmyt_14";
328
- const defaultStyles$o = {
395
+ const button$4 = "_button_oqopj_1";
396
+ const svg$7 = "_svg_oqopj_15";
397
+ const defaultStyles$p = {
329
398
  button: button$4,
330
399
  svg: svg$7
331
400
  };
@@ -334,7 +403,7 @@ const InfoButton = ({
334
403
  styles: styles2
335
404
  }) => {
336
405
  styles2 = mergeStyles({
337
- ...defaultStyles$o
406
+ ...defaultStyles$p
338
407
  }, styles2);
339
408
  return jsx("button", {
340
409
  class: styles2.button,
@@ -352,7 +421,7 @@ const InfoButton = ({
352
421
  const svg$6 = "_svg_1v49v_1";
353
422
  const circle$1 = "_circle_1v49v_5";
354
423
  const pulse = "_pulse_1v49v_9";
355
- const defaultStyles$n = {
424
+ const defaultStyles$o = {
356
425
  svg: svg$6,
357
426
  circle: circle$1,
358
427
  pulse
@@ -362,7 +431,7 @@ const CircleIcon = ({
362
431
  pulse: pulse2 = false,
363
432
  styles: styles2
364
433
  }) => {
365
- styles2 = mergeStyles(defaultStyles$n, styles2);
434
+ styles2 = mergeStyles(defaultStyles$o, styles2);
366
435
  return jsx("svg", {
367
436
  style: styles2.svg,
368
437
  fill: "none",
@@ -382,7 +451,7 @@ const CircleIcon = ({
382
451
  });
383
452
  };
384
453
  const text$3 = "_text_1okyv_1";
385
- const defaultStyles$m = {
454
+ const defaultStyles$n = {
386
455
  text: text$3
387
456
  };
388
457
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -732,7 +801,7 @@ const RelativeTimeSentence = ({
732
801
  styles: styles2
733
802
  }) => {
734
803
  styles2 = mergeStyles({
735
- ...defaultStyles$m
804
+ ...defaultStyles$n
736
805
  }, styles2);
737
806
  let timeSince = dayjs(timeStamp).fromNow();
738
807
  return jsx("span", {
@@ -742,7 +811,7 @@ const RelativeTimeSentence = ({
742
811
  };
743
812
  const pageContainer = "_pageContainer_1s0yq_9";
744
813
  const sideBorders = "_sideBorders_1s0yq_42";
745
- const defaultStyles$l = {
814
+ const defaultStyles$m = {
746
815
  pageContainer,
747
816
  sideBorders
748
817
  };
@@ -754,15 +823,19 @@ function Container({
754
823
  const {
755
824
  pageContainer: pageContainer2,
756
825
  sideBorders: sideBordersStyle
757
- } = mergeStyles(defaultStyles$l, styles2);
826
+ } = mergeStyles(defaultStyles$m, styles2);
758
827
  return jsx("div", {
759
828
  className: [pageContainer2, sideBorders2 && sideBordersStyle].join(" "),
760
829
  children
761
830
  });
762
831
  }
763
- const bar$1 = "_bar_17pyf_9";
764
- const defaultStyles$k = {
765
- bar: bar$1
832
+ const wrapper = "_wrapper_5oj1x_9";
833
+ const bar$1 = "_bar_5oj1x_14";
834
+ const zero = "_zero_5oj1x_19";
835
+ const defaultStyles$l = {
836
+ wrapper,
837
+ bar: bar$1,
838
+ zero
766
839
  };
767
840
  function ChangeBar({
768
841
  fraction,
@@ -778,23 +851,27 @@ function ChangeBar({
778
851
  let posleft = `${centre}px`;
779
852
  let thisStyles = ` height: ${height}; width: ${barwidth}px; ${positive ? `left: ${posleft}` : `left: ${negleft}`}`;
780
853
  let thisColor = ` bg-color--${party}`;
854
+ let zeroStyles = ` height: ${height};`;
781
855
  styles2 = mergeStyles({
782
- ...defaultStyles$k
856
+ ...defaultStyles$l
783
857
  }, styles2);
784
- return jsx("div", {
858
+ return jsxs("div", {
785
859
  className: styles2.wrapper,
786
860
  style: `width: ${width}px`,
787
- children: jsx("div", {
861
+ children: [jsx("div", {
788
862
  className: styles2.bar.concat(thisColor),
789
863
  style: thisStyles
790
- })
864
+ }), jsx("div", {
865
+ className: styles2.zero,
866
+ style: zeroStyles
867
+ })]
791
868
  });
792
869
  }
793
870
  const svg$5 = "_svg_886i1_9";
794
871
  const dividingLineColor = "_dividingLineColor_886i1_16";
795
872
  const square = "_square_886i1_20";
796
873
  const corner = "_corner_886i1_24";
797
- const defaultStyles$j = {
874
+ const defaultStyles$k = {
798
875
  svg: svg$5,
799
876
  dividingLineColor,
800
877
  square,
@@ -807,7 +884,7 @@ const SquareCutCornerIcon = ({
807
884
  styles: styles2
808
885
  }) => {
809
886
  styles2 = mergeStyles({
810
- ...defaultStyles$j
887
+ ...defaultStyles$k
811
888
  }, styles2);
812
889
  let cornerSize = squareSize * 0.625;
813
890
  let cornerMargin = squareSize < 100 ? squareSize / 6 : 10;
@@ -840,12 +917,12 @@ const SquareCutCornerIcon = ({
840
917
  })
841
918
  });
842
919
  };
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 = {
920
+ const stackedGridContainer = "_stackedGridContainer_6whof_1";
921
+ const stackedGridRotateItems0 = "_stackedGridRotateItems0_6whof_11";
922
+ const stackedGridRotateItems90 = "_stackedGridRotateItems90_6whof_17";
923
+ const stackedGridRotateItems180 = "_stackedGridRotateItems180_6whof_23";
924
+ const stackedGridRotateItems270 = "_stackedGridRotateItems270_6whof_29";
925
+ const defaultStyles$j = {
849
926
  stackedGridContainer,
850
927
  stackedGridRotateItems0,
851
928
  stackedGridRotateItems90,
@@ -871,29 +948,23 @@ const getContainerFlip = (fromBottom, fromLeft) => {
871
948
  const StackedGrid = ({
872
949
  fromLeft,
873
950
  fromBottom,
874
- containerWidth,
875
951
  children,
876
952
  styles: styles2
877
953
  }) => {
878
954
  let containerFlip = getContainerFlip(fromBottom, fromLeft);
879
955
  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);
956
+ styles2 = mergeStyles(defaultStyles$j, styles2);
888
957
  return jsx("div", {
889
- style: flexStyles,
958
+ style: {
959
+ transform: containerFlip
960
+ },
890
961
  className: `${styles2.stackedGridContainer} ${styles2[itemRotateClass]}`,
891
962
  children
892
963
  });
893
964
  };
894
965
  const svg$4 = "_svg_l2fsl_9";
895
966
  const squareFill = "_squareFill_l2fsl_16";
896
- const defaultStyles$h = {
967
+ const defaultStyles$i = {
897
968
  svg: svg$4,
898
969
  squareFill
899
970
  };
@@ -903,7 +974,7 @@ const SquareIcon = ({
903
974
  styles: styles2
904
975
  }) => {
905
976
  styles2 = mergeStyles({
906
- ...defaultStyles$h
977
+ ...defaultStyles$i
907
978
  }, styles2);
908
979
  return jsx("svg", {
909
980
  width: size,
@@ -921,7 +992,7 @@ const SquareIcon = ({
921
992
  };
922
993
  const button$3 = "_button_1fees_1";
923
994
  const icon = "_icon_1fees_6";
924
- const defaultStyles$g = {
995
+ const defaultStyles$h = {
925
996
  button: button$3,
926
997
  icon
927
998
  };
@@ -931,7 +1002,7 @@ function ArrowButton({
931
1002
  styles: styles2,
932
1003
  onClick
933
1004
  }) {
934
- styles2 = mergeStyles(defaultStyles$g, styles2);
1005
+ styles2 = mergeStyles(defaultStyles$h, styles2);
935
1006
  return jsx("button", {
936
1007
  className: styles2.button,
937
1008
  disabled,
@@ -955,9 +1026,9 @@ function ArrowButton({
955
1026
  })
956
1027
  });
957
1028
  }
958
- const button$2 = "_button_19t7j_1";
959
- const buttonInner$1 = "_buttonInner_19t7j_6";
960
- const defaultStyles$f = {
1029
+ const button$2 = "_button_3521c_1";
1030
+ const buttonInner$1 = "_buttonInner_3521c_6";
1031
+ const defaultStyles$g = {
961
1032
  button: button$2,
962
1033
  buttonInner: buttonInner$1
963
1034
  };
@@ -967,7 +1038,7 @@ function Button({
967
1038
  styles: styles2,
968
1039
  children
969
1040
  }) {
970
- styles2 = mergeStyles(defaultStyles$f, styles2);
1041
+ styles2 = mergeStyles(defaultStyles$g, styles2);
971
1042
  return jsx("button", {
972
1043
  className: styles2.button,
973
1044
  "data-type": type,
@@ -978,11 +1049,11 @@ function Button({
978
1049
  })
979
1050
  });
980
1051
  }
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 = {
1052
+ const button$1 = "_button_125im_1";
1053
+ const buttonBorder = "_buttonBorder_125im_11";
1054
+ const svg$3 = "_svg_125im_19";
1055
+ const path$3 = "_path_125im_25";
1056
+ const defaultStyles$f = {
986
1057
  button: button$1,
987
1058
  buttonBorder,
988
1059
  svg: svg$3,
@@ -993,7 +1064,7 @@ function CloseButton({
993
1064
  onClick,
994
1065
  styles: styles2
995
1066
  }) {
996
- styles2 = mergeStyles(defaultStyles$e, styles2);
1067
+ styles2 = mergeStyles(defaultStyles$f, styles2);
997
1068
  return jsx("button", {
998
1069
  className: [styles2.button, border && styles2.buttonBorder].join(" "),
999
1070
  onClick,
@@ -1011,6 +1082,39 @@ function CloseButton({
1011
1082
  })
1012
1083
  });
1013
1084
  }
1085
+ const container$4 = "_container_tq3ke_1";
1086
+ const slot = "_slot_tq3ke_5";
1087
+ const defaultStyles$e = {
1088
+ container: container$4,
1089
+ slot
1090
+ };
1091
+ function AdSlot({
1092
+ name: name2,
1093
+ sizeMapping,
1094
+ styles: styles2
1095
+ }) {
1096
+ var _a, _b, _c;
1097
+ const slotId = `dfp-ad--${name2}`;
1098
+ styles2 = mergeStyles(defaultStyles$e, styles2);
1099
+ const mobileSizes = (_a = sizeMapping.mobile) == null ? void 0 : _a.map((size) => size.join(",")).join("|");
1100
+ const tabletSizes = (_b = sizeMapping.tablet) == null ? void 0 : _b.map((size) => size.join(",")).join("|");
1101
+ const desktopSizes = (_c = sizeMapping.desktop) == null ? void 0 : _c.map((size) => size.join(",")).join("|");
1102
+ return jsx("div", {
1103
+ className: ["ad-slot-container", styles2.container].join(" "),
1104
+ children: jsx("div", {
1105
+ id: slotId,
1106
+ className: ["js-ad-slot", "ad-slot", "interactive-ad-slot", styles2.slot].join(" "),
1107
+ "data-link-name": `ad slot ${name2}`,
1108
+ "data-name": `${name2}`,
1109
+ "data-label-show": "true",
1110
+ "ad-label-text": "Advertisement",
1111
+ "aria-hidden": "true",
1112
+ "data-mobile": mobileSizes,
1113
+ "data-tablet": tabletSizes,
1114
+ "data-desktop": desktopSizes
1115
+ })
1116
+ });
1117
+ }
1014
1118
  const sortAscending = (accessor) => {
1015
1119
  return (a, b) => {
1016
1120
  const valueA = a[accessor];
@@ -1129,13 +1233,13 @@ class CellModel {
1129
1233
  return this.row[this.column.accessor].toString();
1130
1234
  }
1131
1235
  }
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";
1236
+ const table = "_table_1dg64_9";
1237
+ const hideHeader = "_hideHeader_1dg64_19";
1238
+ const hideHeaderNoBorder = "_hideHeaderNoBorder_1dg64_28";
1239
+ const headerCell = "_headerCell_1dg64_32";
1240
+ const headerCellButton = "_headerCellButton_1dg64_40";
1241
+ const bodyRow = "_bodyRow_1dg64_49";
1242
+ const bodyCell = "_bodyCell_1dg64_54";
1139
1243
  const defaultStyles$d = {
1140
1244
  table,
1141
1245
  hideHeader,
@@ -1180,6 +1284,8 @@ function Table({
1180
1284
  styles2 = mergeStyles(defaultStyles$d, styles2);
1181
1285
  return jsxs("table", {
1182
1286
  className: styles2.table,
1287
+ cellSpacing: 0,
1288
+ cellPadding: 0,
1183
1289
  children: [jsx("thead", {
1184
1290
  className: hideHeader2 && styles2.hideHeader,
1185
1291
  children: jsx("tr", {
@@ -1237,42 +1343,6 @@ function HeaderCell({
1237
1343
  })]
1238
1344
  });
1239
1345
  }
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
1346
  function useWindowSize() {
1277
1347
  const [windowSize, setWindowSize] = useState(() => {
1278
1348
  if (typeof window === "undefined")
@@ -1745,16 +1815,17 @@ const ControlChange = ({
1745
1815
  })
1746
1816
  });
1747
1817
  };
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";
1818
+ const toplineResult = "_toplineResult_49z3u_9";
1819
+ const primaryname = "_primaryname_49z3u_14";
1820
+ const secondaryname = "_secondaryname_49z3u_29";
1821
+ const name = "_name_49z3u_36";
1822
+ const displayNumbers = "_displayNumbers_49z3u_50";
1823
+ const mainNumber = "_mainNumber_49z3u_61";
1824
+ const mainNumberSuffix = "_mainNumberSuffix_49z3u_66";
1825
+ const secondaryNumber = "_secondaryNumber_49z3u_69";
1826
+ const displayRow = "_displayRow_49z3u_76";
1827
+ const displayColumn = "_displayColumn_49z3u_82";
1828
+ const topRow = "_topRow_49z3u_86";
1758
1829
  const defaultStyles$9 = {
1759
1830
  toplineResult,
1760
1831
  primaryname,
@@ -1762,6 +1833,7 @@ const defaultStyles$9 = {
1762
1833
  name,
1763
1834
  displayNumbers,
1764
1835
  mainNumber,
1836
+ mainNumberSuffix,
1765
1837
  secondaryNumber,
1766
1838
  displayRow,
1767
1839
  displayColumn,
@@ -1771,6 +1843,7 @@ const ToplineResult = ({
1771
1843
  name: name2,
1772
1844
  secondaryName,
1773
1845
  mainNumber: mainNumber2,
1846
+ mainNumberSuffix: mainNumberSuffix2,
1774
1847
  secondaryNumber: secondaryNumber2,
1775
1848
  styles: styles2,
1776
1849
  displayRow: displayRow2 = false,
@@ -1783,64 +1856,66 @@ const ToplineResult = ({
1783
1856
  ...defaultStyles$9
1784
1857
  }, styles2);
1785
1858
  const displayStyle = displayRow2 ? styles2.displayRow : styles2.displayColumn;
1786
- return !secondaryName ? jsxs(Fragment, {
1787
- children: [" ", jsxs("div", {
1788
- class: styles2.toplineResult,
1789
- onMouseOver,
1859
+ return !secondaryName ? jsxs("div", {
1860
+ class: styles2.toplineResult,
1861
+ onMouseOver,
1862
+ children: [jsxs("div", {
1863
+ class: styles2.topRow,
1864
+ children: [jsx("span", {
1865
+ class: `${styles2.name} before-color--${abbreviation}`,
1866
+ children: name2
1867
+ }), " ", showInfoButton && jsx("span", {
1868
+ class: styles2.infoButton,
1869
+ children: jsx(InfoButton, {
1870
+ onClick: onInfoPress
1871
+ })
1872
+ })]
1873
+ }), jsxs("div", {
1874
+ class: `${styles2.displayNumbers} ${displayStyle}`,
1790
1875
  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
1876
+ class: styles2.mainNumber,
1877
+ children: [mainNumber2, mainNumberSuffix2 && jsx("span", {
1878
+ className: styles2.mainNumberSuffix,
1879
+ children: mainNumberSuffix2
1809
1880
  })]
1881
+ }), jsx("div", {
1882
+ class: styles2.secondaryNumber,
1883
+ children: secondaryNumber2
1810
1884
  })]
1811
1885
  })]
1812
- }) : jsx(Fragment, {
1813
- children: jsxs("div", {
1814
- class: styles2.toplineResult,
1815
- onMouseOver,
1886
+ }) : jsxs("div", {
1887
+ class: styles2.toplineResult,
1888
+ onMouseOver,
1889
+ children: [jsxs("div", {
1890
+ class: styles2.topRow,
1891
+ children: [jsx("span", {
1892
+ class: `${styles2.primaryname} before-color--${abbreviation}`,
1893
+ children: name2
1894
+ }), " ", showInfoButton && jsx("span", {
1895
+ class: styles2.infoButton,
1896
+ children: jsx(InfoButton, {
1897
+ onClick: onInfoPress
1898
+ })
1899
+ })]
1900
+ }), jsxs("div", {
1901
+ class: styles2.subhead,
1902
+ children: [jsx("span", {
1903
+ class: styles2.secondaryname,
1904
+ children: secondaryName
1905
+ }), " "]
1906
+ }), jsxs("div", {
1907
+ class: `${styles2.displayNumbers} ${displayStyle}`,
1816
1908
  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
1909
+ class: styles2.mainNumber,
1910
+ children: [mainNumber2, mainNumberSuffix2 && jsx("span", {
1911
+ className: styles2.mainNumberSuffix,
1912
+ children: mainNumberSuffix2
1841
1913
  })]
1914
+ }), jsx("div", {
1915
+ class: styles2.secondaryNumber,
1916
+ children: secondaryNumber2
1842
1917
  })]
1843
- })
1918
+ })]
1844
1919
  });
1845
1920
  };
1846
1921
  const section = "_section_12aiu_9";
@@ -2714,14 +2789,14 @@ function SearchIcon() {
2714
2789
  })
2715
2790
  });
2716
2791
  }
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";
2792
+ const searchContainer = "_searchContainer_1883t_1";
2793
+ const input = "_input_1883t_5";
2794
+ const searchIcon = "_searchIcon_1883t_23";
2795
+ const clearButton = "_clearButton_1883t_32";
2796
+ const suggestions = "_suggestions_1883t_38";
2797
+ const suggestion = "_suggestion_1883t_38";
2798
+ const selected = "_selected_1883t_61";
2799
+ const highlighted = "_highlighted_1883t_65";
2725
2800
  const defaultStyles$3 = {
2726
2801
  searchContainer,
2727
2802
  input,
@@ -3122,15 +3197,15 @@ function Gradient() {
3122
3197
  })]
3123
3198
  });
3124
3199
  }
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";
3200
+ const ticker = "_ticker_1as05_9";
3201
+ const tickerItems = "_tickerItems_1as05_21";
3202
+ const tickerScroll = "_tickerScroll_1as05_26";
3203
+ const tickerItem = "_tickerItem_1as05_21";
3204
+ const controls = "_controls_1as05_48";
3205
+ const gradient = "_gradient_1as05_63";
3206
+ const buttons = "_buttons_1as05_75";
3207
+ const button = "_button_1as05_75";
3208
+ const buttonInner = "_buttonInner_1as05_100";
3134
3209
  const styles = {
3135
3210
  ticker,
3136
3211
  tickerItems,
@@ -3221,7 +3296,7 @@ function Ticker({
3221
3296
  }), jsx("div", {
3222
3297
  className: styles.button,
3223
3298
  children: jsx(Button, {
3224
- type: "small",
3299
+ type: "regular",
3225
3300
  styles: {
3226
3301
  buttonInner: styles.buttonInner
3227
3302
  },
@@ -3233,6 +3308,7 @@ function Ticker({
3233
3308
  });
3234
3309
  }
3235
3310
  export {
3311
+ AdSlot,
3236
3312
  ArrowButton,
3237
3313
  Button,
3238
3314
  ChangeBar,
@@ -3246,6 +3322,7 @@ export {
3246
3322
  GradientIcon,
3247
3323
  GridType,
3248
3324
  InfoButton,
3325
+ LabelType,
3249
3326
  LegendItem,
3250
3327
  Map$1 as Map,
3251
3328
  MapConfiguration,