@popsure/dirty-swan 0.54.2 → 0.54.4

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 (108) hide show
  1. package/dist/cjs/index.js +355 -262
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/components/table/components/TableCell/BaseCell/BaseCell.d.ts +17 -0
  4. package/dist/cjs/lib/components/table/components/TableCell/BaseCell/BaseCell.stories.d.ts +22 -0
  5. package/dist/cjs/lib/components/table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar.d.ts +3 -0
  6. package/dist/cjs/lib/components/table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar.stories.d.ts +25 -0
  7. package/dist/cjs/lib/components/table/components/TableCell/ButtonCell/ButtonCell.d.ts +9 -0
  8. package/dist/cjs/lib/components/table/components/TableCell/ButtonCell/ButtonCell.stories.d.ts +17 -0
  9. package/dist/cjs/lib/components/table/components/TableCell/CTACell/CTACell.d.ts +10 -0
  10. package/dist/cjs/lib/components/table/components/TableCell/CTACell/CTACell.stories.d.ts +18 -0
  11. package/dist/cjs/lib/components/table/components/TableCell/TableCell.d.ts +5 -17
  12. package/dist/cjs/lib/components/table/types.d.ts +19 -2
  13. package/dist/cjs/lib/components/table/utils/useTableNavigation/useTableNavigation.d.ts +1 -2
  14. package/dist/esm/TableSection-f6d0028e.js +80 -0
  15. package/dist/esm/TableSection-f6d0028e.js.map +1 -0
  16. package/dist/esm/components/cards/card/index.stories.js +2 -2
  17. package/dist/esm/components/cards/card/index.stories.js.map +1 -1
  18. package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js +2 -2
  19. package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js.map +1 -1
  20. package/dist/esm/components/comparisonTable/index.js +3 -1526
  21. package/dist/esm/components/comparisonTable/index.js.map +1 -1
  22. package/dist/esm/components/comparisonTable/index.stories.js +1 -0
  23. package/dist/esm/components/comparisonTable/index.stories.js.map +1 -1
  24. package/dist/esm/components/icon/icons/Info.js +2 -2
  25. package/dist/esm/components/icon/icons/Info.js.map +1 -1
  26. package/dist/esm/components/icon/icons.stories.js +1 -1
  27. package/dist/esm/components/icon/index.stories.js +1 -1
  28. package/dist/esm/components/table/Table.js +22 -13
  29. package/dist/esm/components/table/Table.js.map +1 -1
  30. package/dist/esm/components/table/Table.stories.js +100 -32
  31. package/dist/esm/components/table/Table.stories.js.map +1 -1
  32. package/dist/esm/components/table/Table.test.js +15 -12
  33. package/dist/esm/components/table/Table.test.js.map +1 -1
  34. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.js +50 -0
  35. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.js.map +1 -0
  36. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.stories.js +43 -0
  37. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.stories.js.map +1 -0
  38. package/dist/esm/components/table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar.js +15 -0
  39. package/dist/esm/components/table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar.js.map +1 -0
  40. package/dist/esm/components/table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar.stories.js +31 -0
  41. package/dist/esm/components/table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar.stories.js.map +1 -0
  42. package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.js +23 -0
  43. package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.js.map +1 -0
  44. package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.stories.js +28 -0
  45. package/dist/esm/components/table/components/TableCell/ButtonCell/ButtonCell.stories.js.map +1 -0
  46. package/dist/esm/components/table/components/TableCell/CTACell/CTACell.js +21 -0
  47. package/dist/esm/components/table/components/TableCell/CTACell/CTACell.js.map +1 -0
  48. package/dist/esm/components/table/components/TableCell/CTACell/CTACell.stories.js +26 -0
  49. package/dist/esm/components/table/components/TableCell/CTACell/CTACell.stories.js.map +1 -0
  50. package/dist/esm/components/table/components/TableCell/TableCell.js +24 -20
  51. package/dist/esm/components/table/components/TableCell/TableCell.js.map +1 -1
  52. package/dist/esm/components/table/components/TableCell/TableCell.test.js +26 -14
  53. package/dist/esm/components/table/components/TableCell/TableCell.test.js.map +1 -1
  54. package/dist/esm/components/table/components/TableContents/TableContents.js +11 -3
  55. package/dist/esm/components/table/components/TableContents/TableContents.js.map +1 -1
  56. package/dist/esm/components/table/components/TableContents/TableContents.test.js +14 -7
  57. package/dist/esm/components/table/components/TableContents/TableContents.test.js.map +1 -1
  58. package/dist/esm/components/table/components/TableSection/TableSection.js +17 -53
  59. package/dist/esm/components/table/components/TableSection/TableSection.js.map +1 -1
  60. package/dist/esm/components/table/components/TableSection/TableSection.test.js +12 -5
  61. package/dist/esm/components/table/components/TableSection/TableSection.test.js.map +1 -1
  62. package/dist/esm/components/table/utils/useTableNavigation/useTableNavigation.test.js +1 -5
  63. package/dist/esm/components/table/utils/useTableNavigation/useTableNavigation.test.js.map +1 -1
  64. package/dist/esm/index-3d286178.js +1529 -0
  65. package/dist/esm/index-3d286178.js.map +1 -0
  66. package/dist/esm/{index-0bb5a2ee.js → index-7506ae25.js} +3 -3
  67. package/dist/esm/{index-0bb5a2ee.js.map → index-7506ae25.js.map} +1 -1
  68. package/dist/esm/index.js +7 -2
  69. package/dist/esm/index.js.map +1 -1
  70. package/dist/esm/lib/components/table/components/TableCell/BaseCell/BaseCell.d.ts +17 -0
  71. package/dist/esm/lib/components/table/components/TableCell/BaseCell/BaseCell.stories.d.ts +22 -0
  72. package/dist/esm/lib/components/table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar.d.ts +3 -0
  73. package/dist/esm/lib/components/table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar.stories.d.ts +25 -0
  74. package/dist/esm/lib/components/table/components/TableCell/ButtonCell/ButtonCell.d.ts +9 -0
  75. package/dist/esm/lib/components/table/components/TableCell/ButtonCell/ButtonCell.stories.d.ts +17 -0
  76. package/dist/esm/lib/components/table/components/TableCell/CTACell/CTACell.d.ts +10 -0
  77. package/dist/esm/lib/components/table/components/TableCell/CTACell/CTACell.stories.d.ts +18 -0
  78. package/dist/esm/lib/components/table/components/TableCell/TableCell.d.ts +5 -17
  79. package/dist/esm/lib/components/table/types.d.ts +19 -2
  80. package/dist/esm/lib/components/table/utils/useTableNavigation/useTableNavigation.d.ts +1 -2
  81. package/dist/esm/{useTableNavigation-8e50b121.js → useTableNavigation-2899712c.js} +12 -16
  82. package/dist/esm/useTableNavigation-2899712c.js.map +1 -0
  83. package/package.json +1 -1
  84. package/src/lib/components/table/Table.stories.tsx +87 -25
  85. package/src/lib/components/table/Table.test.tsx +3 -6
  86. package/src/lib/components/table/Table.tsx +11 -9
  87. package/src/lib/components/table/components/TableCell/BaseCell/BaseCell.module.scss +36 -0
  88. package/src/lib/components/table/components/TableCell/BaseCell/BaseCell.stories.tsx +45 -0
  89. package/src/lib/components/table/components/TableCell/BaseCell/BaseCell.tsx +158 -0
  90. package/src/lib/components/table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar.module.scss +44 -0
  91. package/src/lib/components/table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar.stories.tsx +29 -0
  92. package/src/lib/components/table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar.tsx +35 -0
  93. package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.module.scss +43 -0
  94. package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.stories.tsx +65 -0
  95. package/src/lib/components/table/components/TableCell/ButtonCell/ButtonCell.tsx +40 -0
  96. package/src/lib/components/table/components/TableCell/CTACell/CTACell.module.scss +3 -0
  97. package/src/lib/components/table/components/TableCell/CTACell/CTACell.stories.tsx +37 -0
  98. package/src/lib/components/table/components/TableCell/CTACell/CTACell.tsx +42 -0
  99. package/src/lib/components/table/components/TableCell/TableCell.module.scss +0 -43
  100. package/src/lib/components/table/components/TableCell/TableCell.test.tsx +26 -13
  101. package/src/lib/components/table/components/TableCell/TableCell.tsx +20 -122
  102. package/src/lib/components/table/components/TableContents/TableContents.test.tsx +6 -6
  103. package/src/lib/components/table/components/TableSection/TableSection.test.tsx +5 -5
  104. package/src/lib/components/table/components/TableSection/TableSection.tsx +67 -41
  105. package/src/lib/components/table/types.ts +16 -2
  106. package/src/lib/components/table/utils/useTableNavigation/useTableNavigation.test.tsx +0 -4
  107. package/src/lib/components/table/utils/useTableNavigation/useTableNavigation.ts +13 -20
  108. package/dist/esm/useTableNavigation-8e50b121.js.map +0 -1
@@ -3,7 +3,12 @@ import classNames from 'classnames';
3
3
  import styles from './TableSection.module.scss';
4
4
  import { TableCell, TableCellProps } from '../TableCell/TableCell';
5
5
  import { ReactNode, useCallback } from 'react';
6
- import { ModalData, ModalFunction, TableCellRowData } from '../../types';
6
+ import {
7
+ isBaseCell,
8
+ ModalData,
9
+ ModalFunction,
10
+ TableCellRowData,
11
+ } from '../../types';
7
12
 
8
13
  export interface TableSectionProps {
9
14
  className?: string;
@@ -24,22 +29,32 @@ const TableSection = ({
24
29
  }: TableSectionProps) => {
25
30
  const headerRow = tableCellRows?.[0];
26
31
 
27
- const getColumnContentByKey = useCallback(
28
- (key: number) => tableCellRows?.[0]?.[key]?.content || '',
29
- [tableCellRows]
30
- );
32
+ const getModalTitleFromColumnHeader = (cellIndex: number) => {
33
+ const firstCellInColumn = tableCellRows?.[0]?.[cellIndex];
34
+ let titleFromColumn;
35
+
36
+ switch (firstCellInColumn.type) {
37
+ case 'BUTTON':
38
+ titleFromColumn = firstCellInColumn.buttonCaption;
39
+ break;
40
+ case 'CTA':
41
+ titleFromColumn = firstCellInColumn.title;
42
+ break;
43
+ case undefined:
44
+ titleFromColumn = firstCellInColumn.text || '';
45
+ break;
46
+ }
47
+
48
+ return titleFromColumn;
49
+ };
31
50
 
32
- const handleOpenModal = ({
33
- cellIndex,
34
- body,
35
- title,
36
- }: ModalData & {
37
- cellIndex: number;
38
- }) =>
39
- openModal?.({
40
- body,
41
- title: title || getColumnContentByKey(cellIndex),
42
- });
51
+ const getModalTitleFromRowHeader = (currentRow: TableCellRowData) => {
52
+ const firstCellInRow = currentRow?.[0];
53
+ const titleFromRow =
54
+ (isBaseCell(firstCellInRow) && firstCellInRow.text) || '';
55
+
56
+ return titleFromRow;
57
+ };
43
58
 
44
59
  return (
45
60
  <table
@@ -51,23 +66,28 @@ const TableSection = ({
51
66
  {headerRow && (
52
67
  <thead className={hideHeader ? 'sr-only' : ''}>
53
68
  <tr>
54
- {headerRow.map((tableCellProps, cellIndex) => {
69
+ {headerRow.map((tableCellData, cellIndex) => {
55
70
  const isFirstCellInRow = cellIndex === 0;
71
+
56
72
  return (
57
73
  <TableCell
58
74
  key={cellIndex}
59
75
  isHeader
60
76
  isFirstCellInRow={isFirstCellInRow}
61
77
  isTopLeftCell={isFirstCellInRow}
62
- align={isFirstCellInRow ? 'left' : 'center'}
63
- openModal={(body) =>
64
- handleOpenModal({
65
- cellIndex,
66
- body,
67
- title: tableCellProps?.content,
68
- })
69
- }
70
- {...tableCellProps}
78
+ {...tableCellData}
79
+ {...(isBaseCell(tableCellData)
80
+ ? {
81
+ openModal: (body: ReactNode) =>
82
+ openModal?.({
83
+ body,
84
+ title:
85
+ tableCellData.text ||
86
+ getModalTitleFromColumnHeader(cellIndex),
87
+ }),
88
+ align: isFirstCellInRow ? 'left' : 'center',
89
+ }
90
+ : {})}
71
91
  />
72
92
  );
73
93
  })}
@@ -82,28 +102,34 @@ const TableSection = ({
82
102
  return (
83
103
  rowIndex > 0 && (
84
104
  <tr key={rowIndex} className={styles.tr}>
85
- {row.map((tableCellProps, cellIndex) => {
105
+ {row.map((tableCellData, cellIndex) => {
86
106
  const key = `${rowIndex}-${cellIndex}`;
87
107
  const isFirstCellInRow = cellIndex === 0;
88
108
 
89
- const onCelInfoClick = (body: ReactNode) =>
90
- handleOpenModal({
91
- cellIndex,
92
- body,
93
- title: isFirstCellInRow
94
- ? tableCellProps.content
95
- : undefined,
96
- });
97
-
98
109
  return (
99
110
  <TableCell
100
- align={
101
- isFirstCellInRow && !isSingleCell ? 'left' : 'center'
102
- }
103
111
  isFirstCellInRow={isFirstCellInRow}
104
- openModal={onCelInfoClick}
105
112
  key={key}
106
- {...tableCellProps}
113
+ {...tableCellData}
114
+ {...(isBaseCell(tableCellData)
115
+ ? {
116
+ openModal: (body: ReactNode) => {
117
+ const titleFromRow =
118
+ getModalTitleFromRowHeader(row);
119
+ const titleFromColumnOrRow =
120
+ getModalTitleFromColumnHeader(cellIndex) ||
121
+ getModalTitleFromRowHeader(row);
122
+
123
+ return openModal?.({
124
+ body,
125
+ title: isFirstCellInRow
126
+ ? titleFromRow
127
+ : titleFromColumnOrRow,
128
+ });
129
+ },
130
+ align: isFirstCellInRow ? 'left' : 'center',
131
+ }
132
+ : {})}
107
133
  />
108
134
  );
109
135
  })}
@@ -1,5 +1,19 @@
1
1
  import { ReactNode } from 'react';
2
- import type { TableCellProps } from './components/TableCell/TableCell';
2
+ import { BaseCellProps } from './components/TableCell/BaseCell/BaseCell';
3
+ import { CTACellProps } from './components/TableCell/CTACell/CTACell';
4
+ import { ButtonCellProps } from './components/TableCell/ButtonCell/ButtonCell';
5
+
6
+ type BaseCellData = BaseCellProps & { type?: undefined; cellId?: string };
7
+ type CTACellData = CTACellProps & { type: 'CTA'; cellId?: string };
8
+ type ButtonCellData = ButtonCellProps & { type: 'BUTTON'; cellId?: string };
9
+
10
+ export type TableCellData = BaseCellData | CTACellData | ButtonCellData;
11
+
12
+ export const isBaseCell = (
13
+ tableCellData: TableCellData
14
+ ): tableCellData is BaseCellData => {
15
+ return !tableCellData.type;
16
+ };
3
17
 
4
18
  export type TableSectionType = {
5
19
  title?: string;
@@ -11,7 +25,7 @@ export type ModalData = {
11
25
  body?: ReactNode;
12
26
  };
13
27
 
14
- export type TableCellRowData = TableCellProps[];
28
+ export type TableCellRowData = TableCellData[];
15
29
 
16
30
  export type TableSectionData = {
17
31
  section?: TableSectionType;
@@ -11,7 +11,6 @@ const defaultContainerRef = {
11
11
  } as unknown as RefObject<HTMLElement>;
12
12
 
13
13
  describe('useTableNavigation', () => {
14
- const columnsLength = 4;
15
14
  let onSelectionChanged = jest.fn();
16
15
  let containerRef = defaultContainerRef;
17
16
 
@@ -25,7 +24,6 @@ describe('useTableNavigation', () => {
25
24
  useTableNavigation({
26
25
  enabled: false,
27
26
  containerRef,
28
- columnsLength,
29
27
  onSelectionChanged,
30
28
  })
31
29
  );
@@ -44,7 +42,6 @@ describe('useTableNavigation', () => {
44
42
  useTableNavigation({
45
43
  enabled: true,
46
44
  containerRef,
47
- columnsLength,
48
45
  onSelectionChanged,
49
46
  })
50
47
  );
@@ -67,7 +64,6 @@ describe('useTableNavigation', () => {
67
64
  useTableNavigation({
68
65
  enabled: true,
69
66
  containerRef,
70
- columnsLength,
71
67
  onSelectionChanged,
72
68
  })
73
69
  );
@@ -8,7 +8,6 @@ interface UseTableNavigationReturn {
8
8
 
9
9
  interface UseTableNavigationProps {
10
10
  containerRef: React.RefObject<HTMLElement>,
11
- columnsLength: number,
12
11
  enabled?: boolean,
13
12
  onSelectionChanged?: (index: number) => void
14
13
  }
@@ -16,22 +15,18 @@ interface UseTableNavigationProps {
16
15
  export const useTableNavigation = ({
17
16
  enabled,
18
17
  containerRef,
19
- columnsLength,
20
18
  onSelectionChanged
21
19
  }: UseTableNavigationProps): UseTableNavigationReturn => {
22
- const [activeSection, setActiveSection] = useState(1);
23
- const [isIncrease, setIsIncrease] = useState<boolean>();
20
+ const [activeSection, setActiveSection] = useState(0);
24
21
 
25
22
  const handleScrollToSection = (increase?: boolean) => {
26
23
  if (!enabled) {
27
24
  return;
28
25
  }
29
26
 
30
- setActiveSection((prevSection) => {
31
- setIsIncrease(!!increase);
32
-
33
- return prevSection + (increase ? 1 : -1);
34
- });
27
+ setActiveSection((prevSection) =>
28
+ prevSection + (increase ? 1 : -1)
29
+ );
35
30
  };
36
31
 
37
32
  const handleTableScroll = useCallback(() => {
@@ -39,14 +34,12 @@ export const useTableNavigation = ({
39
34
  return;
40
35
  }
41
36
 
42
- const scrollLeft = containerRef.current.scrollLeft;
43
37
  const containerWidth = containerRef.current.getBoundingClientRect().width;
44
- const cellWidth = containerWidth / (columnsLength - 1);
45
- const newValue = Math.floor(scrollLeft / cellWidth * 0.8) + 1;
38
+ const scrollLeft = containerRef.current.scrollLeft;
39
+ const cellWidth = containerWidth / 2;
46
40
 
47
- setIsIncrease(newValue > activeSection);
48
- setActiveSection(newValue);
49
- }, [activeSection, columnsLength, containerRef, enabled]);
41
+ setActiveSection(Math.floor(scrollLeft / cellWidth));
42
+ }, [activeSection, containerRef, enabled]);
50
43
 
51
44
  const debouncedTableScroll = debounce(handleTableScroll, 150);
52
45
 
@@ -61,26 +54,26 @@ export const useTableNavigation = ({
61
54
  }, [enabled]);
62
55
 
63
56
  useEffect(() => {
64
- if (!enabled || typeof isIncrease === 'undefined') {
57
+ if (!enabled) {
65
58
  return
66
59
  }
67
60
 
68
- onSelectionChanged?.(activeSection);
61
+ onSelectionChanged?.(activeSection + 1);
69
62
 
70
63
  if (containerRef.current) {
71
64
  const containerWidth = containerRef.current.getBoundingClientRect().width;
72
- const cellWidth = containerWidth / columnsLength;
65
+ const cellWidth = containerWidth / 2;
73
66
 
74
67
  containerRef.current.scroll({
75
68
  top: 0,
76
- left: (cellWidth * activeSection) * (isIncrease ? 1.2 : 0.8),
69
+ left: cellWidth * activeSection,
77
70
  behavior: 'smooth',
78
71
  });
79
72
  }
80
73
  }, [enabled, activeSection]);
81
74
 
82
75
  return {
83
- activeSection,
76
+ activeSection: activeSection + 1,
84
77
  navigateTable: handleScrollToSection,
85
78
  }
86
79
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTableNavigation-8e50b121.js","sources":["../../../src/lib/components/table/utils/useTableNavigation/useTableNavigation.ts"],"sourcesContent":["import debounce from \"lodash.debounce\";\nimport { useCallback, useEffect, useState } from \"react\";\n\ninterface UseTableNavigationReturn {\n activeSection: number;\n navigateTable: (increase?: boolean) => void;\n}\n\ninterface UseTableNavigationProps {\n containerRef: React.RefObject<HTMLElement>,\n columnsLength: number,\n enabled?: boolean,\n onSelectionChanged?: (index: number) => void\n}\n\nexport const useTableNavigation = ({\n enabled,\n containerRef,\n columnsLength,\n onSelectionChanged\n}: UseTableNavigationProps): UseTableNavigationReturn => {\n const [activeSection, setActiveSection] = useState(1);\n const [isIncrease, setIsIncrease] = useState<boolean>();\n\n const handleScrollToSection = (increase?: boolean) => {\n if (!enabled) {\n return;\n }\n\n setActiveSection((prevSection) => {\n setIsIncrease(!!increase);\n\n return prevSection + (increase ? 1 : -1);\n });\n };\n\n const handleTableScroll = useCallback(() => {\n if (!containerRef.current || !enabled) {\n return;\n }\n\n const scrollLeft = containerRef.current.scrollLeft;\n const containerWidth = containerRef.current.getBoundingClientRect().width;\n const cellWidth = containerWidth / (columnsLength - 1);\n const newValue = Math.floor(scrollLeft / cellWidth * 0.8) + 1;\n\n setIsIncrease(newValue > activeSection);\n setActiveSection(newValue);\n }, [activeSection, columnsLength, containerRef, enabled]);\n\n const debouncedTableScroll = debounce(handleTableScroll, 150);\n\n useEffect(() => {\n const container = containerRef.current;\n\n container?.addEventListener('scroll', debouncedTableScroll, {\n passive: true,\n });\n\n return container?.removeEventListener('scroll', handleTableScroll);\n }, [enabled]);\n\n useEffect(() => {\n if (!enabled || typeof isIncrease === 'undefined') {\n return\n }\n\n onSelectionChanged?.(activeSection);\n\n if (containerRef.current) {\n const containerWidth = containerRef.current.getBoundingClientRect().width;\n const cellWidth = containerWidth / columnsLength;\n\n containerRef.current.scroll({\n top: 0,\n left: (cellWidth * activeSection) * (isIncrease ? 1.2 : 0.8),\n behavior: 'smooth',\n });\n }\n }, [enabled, activeSection]);\n\n return {\n activeSection,\n navigateTable: handleScrollToSection,\n }\n}"],"names":["debounce"],"mappings":";;;IAea,kBAAkB,GAAG,UAAC,EAKT;QAJxB,OAAO,aAAA,EACP,YAAY,kBAAA,EACZ,aAAa,mBAAA,EACb,kBAAkB,wBAA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