@abcagency/hc-ui-components 1.7.7 → 1.7.9

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,7 +1,10 @@
1
1
  export const getDistinctItemsByProximity = (items, listingEntitiesDetailsInput) => {
2
2
  const clusters = {};
3
3
 
4
- if (!listingEntitiesDetailsInput) return [];
4
+ if (!listingEntitiesDetailsInput) {
5
+ console.log('getDistinctItemsByProximity: No listingEntitiesDetailsInput');
6
+ return [];
7
+ }
5
8
 
6
9
  const listingEntitiesDetails = Array.isArray(listingEntitiesDetailsInput)
7
10
  ? listingEntitiesDetailsInput.reduce((acc, entity) => {
@@ -13,6 +16,9 @@ export const getDistinctItemsByProximity = (items, listingEntitiesDetailsInput)
13
16
  return acc;
14
17
  }, {});
15
18
 
19
+ console.log('getDistinctItemsByProximity: Processing', items?.length, 'items with', Object.keys(listingEntitiesDetails).length, 'entities');
20
+ console.log('Entity keys:', Object.keys(listingEntitiesDetails));
21
+
16
22
  const closeItemPairs = findCloseItems(listingEntitiesDetails);
17
23
  if (closeItemPairs.length > 0) {
18
24
  const adjusted = adjustItemPositions(listingEntitiesDetails, closeItemPairs);
@@ -24,7 +30,8 @@ export const getDistinctItemsByProximity = (items, listingEntitiesDetailsInput)
24
30
  if (!entityKey || entityKey === '-1') return;
25
31
  const entityDetails = listingEntitiesDetails[entityKey.toLowerCase()];
26
32
  if (!entityDetails) {
27
- console.error(`Details not found for entityKey: ${entityKey}`);
33
+ console.error(`Details not found for entityKey: "${entityKey}" (looking for "${entityKey.toLowerCase()}")`);
34
+ console.error('Available entity keys:', Object.keys(listingEntitiesDetails));
28
35
  return;
29
36
  }
30
37