@abcagency/hc-ui-components 1.3.18 → 1.3.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.
Files changed (190) hide show
  1. package/dist/apis/hcApi.js +85 -183
  2. package/dist/apis/hcApi.js.map +1 -1
  3. package/dist/components/HireControlMap.js +10 -5
  4. package/dist/components/HireControlMap.js.map +1 -1
  5. package/dist/components/modules/accordions/MapAccordionItem.js +10 -67
  6. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  7. package/dist/components/modules/filter/index.js.map +1 -1
  8. package/dist/components/modules/filter/radio-item.js +1 -2
  9. package/dist/components/modules/filter/radio-item.js.map +1 -1
  10. package/dist/components/modules/jobListing/listing-details-container.js +45 -0
  11. package/dist/components/modules/jobListing/listing-details-container.js.map +1 -0
  12. package/dist/components/modules/jobListing/listing-details.js +25 -24
  13. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  14. package/dist/components/modules/{maps/list → list}/field-mapper.js +8 -7
  15. package/dist/components/modules/list/field-mapper.js.map +1 -0
  16. package/dist/components/modules/{maps/list → list}/header-item.js +2 -2
  17. package/dist/components/modules/list/header-item.js.map +1 -0
  18. package/dist/components/modules/{maps/list → list}/header.js +6 -4
  19. package/dist/components/modules/list/header.js.map +1 -0
  20. package/dist/components/modules/list/index.js +36 -0
  21. package/dist/components/modules/list/index.js.map +1 -0
  22. package/dist/components/modules/{maps/list → list}/item-expand-card/index.js +3 -1
  23. package/dist/components/modules/list/item-expand-card/index.js.map +1 -0
  24. package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-contact-nav.js +2 -2
  25. package/dist/components/modules/list/item-expand-card/recruiter-contact-nav.js.map +1 -0
  26. package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-details.js +1 -1
  27. package/dist/components/modules/list/item-expand-card/recruiter-details.js.map +1 -0
  28. package/dist/components/modules/list/item-expand-card/recruiter-headshot.js.map +1 -0
  29. package/dist/components/modules/list/item-list.js +131 -0
  30. package/dist/components/modules/list/item-list.js.map +1 -0
  31. package/dist/components/modules/list/list-item/index.js +75 -0
  32. package/dist/components/modules/list/list-item/index.js.map +1 -0
  33. package/dist/components/modules/list/list-item/list-item-container.js +47 -0
  34. package/dist/components/modules/list/list-item/list-item-container.js.map +1 -0
  35. package/dist/components/modules/{maps/list/list-item/index.js → list/list-item/list-item.js} +29 -33
  36. package/dist/components/modules/list/list-item/list-item.js.map +1 -0
  37. package/dist/components/modules/maps/map-list.js +3 -3
  38. package/dist/components/modules/maps/map-list.js.map +1 -1
  39. package/dist/contexts/mapContext.js +84 -113
  40. package/dist/contexts/mapContext.js.map +1 -1
  41. package/dist/contexts/mapListContext.js +181 -293
  42. package/dist/contexts/mapListContext.js.map +1 -1
  43. package/dist/contexts/trackEventContext.js +1 -1
  44. package/dist/services/configService.js +10 -28
  45. package/dist/services/configService.js.map +1 -1
  46. package/dist/services/googlePlacesNearbyService.js +33 -58
  47. package/dist/services/googlePlacesNearbyService.js.map +1 -1
  48. package/dist/services/listingAggregatorService.js +35 -75
  49. package/dist/services/listingAggregatorService.js.map +1 -1
  50. package/dist/services/listingEntityService.js +10 -31
  51. package/dist/services/listingEntityService.js.map +1 -1
  52. package/dist/services/listingService.js +26 -60
  53. package/dist/services/listingService.js.map +1 -1
  54. package/dist/services/recruiterService.js +11 -31
  55. package/dist/services/recruiterService.js.map +1 -1
  56. package/dist/types/apis/hcApi.d.ts +5 -0
  57. package/dist/types/clientToken.d.ts +2 -0
  58. package/dist/types/components/modules/accordions/MapAccordionItem.d.ts +9 -0
  59. package/dist/types/components/modules/accordions/default.d.ts +19 -0
  60. package/dist/types/components/modules/buttons/button-group-apply.d.ts +24 -0
  61. package/dist/types/components/modules/buttons/commute-pill.d.ts +5 -0
  62. package/dist/types/components/modules/buttons/default.d.ts +48 -0
  63. package/dist/types/components/modules/buttons/pill-wrapper.d.ts +3 -0
  64. package/dist/types/components/modules/dialogs/apply-dialog.d.ts +8 -0
  65. package/dist/types/components/modules/filter/sort.d.ts +8 -0
  66. package/dist/types/components/modules/grid.d.ts +8 -0
  67. package/dist/types/components/modules/icon.d.ts +10 -0
  68. package/dist/types/components/modules/jobListing/listing-details-container.d.ts +6 -0
  69. package/dist/types/components/modules/jobListing/listing-details.d.ts +18 -0
  70. package/dist/types/components/modules/list/field-mapper.d.ts +10 -0
  71. package/dist/types/components/modules/list/header-item.d.ts +11 -0
  72. package/dist/types/components/modules/list/header.d.ts +11 -0
  73. package/dist/types/components/modules/list/index.d.ts +9 -0
  74. package/dist/types/components/modules/list/item-expand-card/index.d.ts +7 -0
  75. package/dist/types/components/modules/list/item-expand-card/recruiter-contact-nav.d.ts +17 -0
  76. package/dist/types/components/modules/list/item-expand-card/recruiter-details.d.ts +21 -0
  77. package/dist/types/components/modules/list/item-expand-card/recruiter-headshot.d.ts +8 -0
  78. package/dist/types/components/modules/list/item-list.d.ts +21 -0
  79. package/dist/types/components/modules/list/list-item/index.d.ts +12 -0
  80. package/dist/types/components/modules/list/list-item/list-item-container.d.ts +14 -0
  81. package/dist/types/components/modules/list/list-item/list-item.d.ts +3 -0
  82. package/dist/types/constants/eventTypes.d.ts +13 -0
  83. package/dist/types/contexts/mapContext.d.ts +29 -0
  84. package/dist/types/contexts/mapListContext.d.ts +58 -0
  85. package/dist/types/contexts/trackEventContext.d.ts +6 -0
  86. package/dist/types/enums/SectionType.d.ts +9 -0
  87. package/dist/types/hooks/useList.d.ts +13 -0
  88. package/dist/types/services/configService.d.ts +6 -0
  89. package/dist/types/services/googlePlacesNearbyService.d.ts +5 -0
  90. package/dist/types/services/listingAggregatorService.d.ts +12 -0
  91. package/dist/types/services/listingEntityService.d.ts +6 -0
  92. package/dist/types/services/listingService.d.ts +9 -0
  93. package/dist/types/services/recruiterService.d.ts +6 -0
  94. package/dist/types/types/Address.d.ts +7 -0
  95. package/dist/types/types/ContentSection.d.ts +8 -0
  96. package/dist/types/types/GetListingParams.d.ts +8 -0
  97. package/dist/types/types/LatLng.d.ts +4 -0
  98. package/dist/types/types/ListingEntity.d.ts +10 -0
  99. package/dist/types/types/ListingFields.d.ts +20 -0
  100. package/dist/types/types/Listings.d.ts +31 -0
  101. package/dist/types/types/Recruiter.d.ts +9 -0
  102. package/dist/types/types/SimilarListing.d.ts +24 -0
  103. package/dist/types/types/config/Colors.d.ts +8 -0
  104. package/dist/types/types/config/MapConfig.d.ts +29 -0
  105. package/dist/types/types/config/PointsOfInterestConfig.d.ts +13 -0
  106. package/dist/types/types/config/SearchConfig.d.ts +4 -0
  107. package/dist/types/util/filterUtil.d.ts +28 -0
  108. package/dist/types/util/loading.d.ts +3 -0
  109. package/dist/types/util/localStorageUtil.d.ts +3 -0
  110. package/dist/types/util/mapUtil.d.ts +15 -0
  111. package/dist/types/util/sortUtil.d.ts +1 -0
  112. package/dist/types/util/stringUtils.d.ts +1 -0
  113. package/dist/util/filterUtil.js +1 -3
  114. package/dist/util/filterUtil.js.map +1 -1
  115. package/dist/util/localStorageUtil.js +37 -28
  116. package/dist/util/localStorageUtil.js.map +1 -1
  117. package/dist/util/mapUtil.js.map +1 -1
  118. package/package.json +23 -17
  119. package/rollup.config.mjs +23 -19
  120. package/src/apis/{hcApi.js → hcApi.ts} +27 -11
  121. package/src/components/HireControlMap.js +132 -129
  122. package/src/components/modules/accordions/MapAccordionItem.js +32 -74
  123. package/src/components/modules/filter/index.js +89 -89
  124. package/src/components/modules/filter/radio-item.js +0 -1
  125. package/src/components/modules/jobListing/listing-details-container.js +40 -0
  126. package/src/components/modules/jobListing/listing-details.js +209 -99
  127. package/src/components/modules/{maps/list → list}/field-mapper.js +114 -112
  128. package/src/components/modules/{maps/list → list}/header.js +49 -47
  129. package/src/components/modules/list/index.tsx +83 -0
  130. package/src/components/modules/{maps/list → list}/item-expand-card/index.js +24 -22
  131. package/src/components/modules/list/item-list.tsx +198 -0
  132. package/src/components/modules/list/list-item/index.js +70 -0
  133. package/src/components/modules/list/list-item/list-item-container.js +43 -0
  134. package/src/components/modules/{maps/list/list-item/index.js → list/list-item/list-item.js} +32 -38
  135. package/src/components/modules/maps/map-list.js +74 -74
  136. package/src/contexts/mapContext.tsx +129 -0
  137. package/src/contexts/mapListContext.tsx +297 -0
  138. package/src/enums/SectionType.ts +9 -0
  139. package/src/services/{configService.js → configService.ts} +16 -16
  140. package/src/services/{googlePlacesNearbyService.js → googlePlacesNearbyService.ts} +11 -2
  141. package/src/services/listingAggregatorService.ts +76 -0
  142. package/src/services/listingEntityService.ts +16 -0
  143. package/src/services/listingService.ts +40 -0
  144. package/src/services/{recruiterService.js → recruiterService.ts} +18 -17
  145. package/src/types/Address.ts +7 -0
  146. package/src/types/ContentSection.ts +9 -0
  147. package/src/types/GetListingParams.ts +8 -0
  148. package/src/types/LatLng.ts +4 -0
  149. package/src/types/ListingEntity.ts +11 -0
  150. package/src/types/ListingFields.ts +20 -0
  151. package/src/types/Listings.ts +32 -0
  152. package/src/types/Recruiter.ts +9 -0
  153. package/src/types/SimilarListing.ts +24 -0
  154. package/src/types/config/Colors.ts +8 -0
  155. package/src/types/config/MapConfig.ts +30 -0
  156. package/src/types/config/PointsOfInterestConfig.ts +13 -0
  157. package/src/types/config/SearchConfig.ts +4 -0
  158. package/src/util/filterUtil.js +239 -239
  159. package/src/util/localStorageUtil.ts +34 -0
  160. package/src/util/mapUtil.js +91 -91
  161. package/tsconfig.json +23 -0
  162. package/dist/components/modules/maps/list/field-mapper.js.map +0 -1
  163. package/dist/components/modules/maps/list/header-item.js.map +0 -1
  164. package/dist/components/modules/maps/list/header.js.map +0 -1
  165. package/dist/components/modules/maps/list/index.js +0 -102
  166. package/dist/components/modules/maps/list/index.js.map +0 -1
  167. package/dist/components/modules/maps/list/item-expand-card/index.js.map +0 -1
  168. package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +0 -1
  169. package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +0 -1
  170. package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +0 -1
  171. package/dist/components/modules/maps/list/list-item/index.js.map +0 -1
  172. package/dist/services/_virtual/_rollupPluginBabelHelpers.js +0 -372
  173. package/dist/services/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  174. package/dist/services/apis/hcApi.js +0 -189
  175. package/dist/services/apis/hcApi.js.map +0 -1
  176. package/dist/services/clientToken.js +0 -7
  177. package/dist/services/clientToken.js.map +0 -1
  178. package/dist/services/styles/index.css +0 -3
  179. package/src/components/modules/maps/list/index.js +0 -112
  180. package/src/contexts/mapContext.js +0 -101
  181. package/src/contexts/mapListContext.js +0 -242
  182. package/src/services/listingAggregatorService.js +0 -50
  183. package/src/services/listingEntityService.js +0 -15
  184. package/src/services/listingService.js +0 -26
  185. package/src/util/localStorageUtil.js +0 -27
  186. /package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-headshot.js +0 -0
  187. /package/src/components/modules/{maps/list → list}/header-item.js +0 -0
  188. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-contact-nav.js +0 -0
  189. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-details.js +0 -0
  190. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-headshot.js +0 -0
@@ -0,0 +1,6 @@
1
+ import { Recruiter } from '~/types/Recruiter';
2
+ export declare const getRecruiters: (recruiterIds: number[]) => Promise<Recruiter[]>;
3
+ declare const _default: {
4
+ getRecruiters: (recruiterIds: number[]) => Promise<Recruiter[]>;
5
+ };
6
+ export default _default;
@@ -0,0 +1,7 @@
1
+ export type Address = {
2
+ location?: string;
3
+ street?: string;
4
+ city?: string;
5
+ state?: string;
6
+ zip?: string;
7
+ };
@@ -0,0 +1,8 @@
1
+ import { SectionType } from '../enums/SectionType';
2
+ export type ContentSection = {
3
+ title?: string;
4
+ contentFormatted?: string;
5
+ contentRaw?: string;
6
+ sectionType: SectionType;
7
+ sortIndex: number;
8
+ };
@@ -0,0 +1,8 @@
1
+ export type GetListingsParams = {
2
+ location?: string[];
3
+ category?: string[];
4
+ categoryClass?: string[];
5
+ education?: string[];
6
+ city?: string[];
7
+ state?: string[];
8
+ };
@@ -0,0 +1,4 @@
1
+ export type LatLng = {
2
+ lat: number;
3
+ lng: number;
4
+ };
@@ -0,0 +1,10 @@
1
+ import { Address } from './Address';
2
+ export type ListingEntity = {
3
+ id: number;
4
+ listingId: number;
5
+ latitude: number;
6
+ longitude: number;
7
+ entityDisplayName?: string;
8
+ address?: Address;
9
+ travelTime?: string;
10
+ };
@@ -0,0 +1,20 @@
1
+ export type ListingFields = {
2
+ posted?: string;
3
+ subTitle?: string;
4
+ education?: string;
5
+ position?: string;
6
+ category?: string;
7
+ categoryClass?: string;
8
+ shift?: string;
9
+ cityState?: string;
10
+ city?: string;
11
+ state?: string;
12
+ schedule?: string;
13
+ customFlag1?: number;
14
+ bonus?: number;
15
+ remote?: number;
16
+ useClientJobUrl?: boolean;
17
+ dateCreated: Date;
18
+ dateLastEdited?: Date;
19
+ travelTime?: string;
20
+ };
@@ -0,0 +1,31 @@
1
+ import { ListingFields } from './ListingFields';
2
+ import { Recruiter } from './Recruiter';
3
+ import { ListingEntity } from './ListingEntity';
4
+ import { ContentSection } from './ContentSection';
5
+ import { SimilarListing } from './SimilarListing';
6
+ export type Listing = {
7
+ id: number;
8
+ fields?: ListingFields;
9
+ entityId?: number;
10
+ applyUrl?: string;
11
+ applyOnline?: number;
12
+ detailsUrl?: string;
13
+ displayOnSite: number;
14
+ displayRecruiter: number;
15
+ recruiterId?: number;
16
+ description1?: string;
17
+ description2?: string;
18
+ description3?: string;
19
+ description4?: string;
20
+ custom1: string;
21
+ custom2: string;
22
+ custom3: string;
23
+ custom4: string;
24
+ custom5: string;
25
+ customFlag1: number;
26
+ slug?: string;
27
+ recruiter?: Recruiter;
28
+ entity?: ListingEntity;
29
+ contentSections?: ContentSection[];
30
+ similarListings?: SimilarListing[];
31
+ };
@@ -0,0 +1,9 @@
1
+ export type Recruiter = {
2
+ id?: number;
3
+ email?: string;
4
+ firstName?: string;
5
+ lastName?: string;
6
+ linkedInUrl?: string;
7
+ mobilePhone?: string;
8
+ headshot?: string;
9
+ };
@@ -0,0 +1,24 @@
1
+ export type SimilarListing = {
2
+ id: number;
3
+ city: string;
4
+ companyName: string;
5
+ companyId: number;
6
+ domain: string;
7
+ refreshedPubDate?: Date;
8
+ clientJobUrl: string;
9
+ refreshNum: number;
10
+ requestURI: string;
11
+ schedule: string;
12
+ scheduleId?: number;
13
+ shift: string;
14
+ sponsored: boolean;
15
+ stateAbbrev: string;
16
+ subTitle: string;
17
+ title: string;
18
+ uniqueId: string;
19
+ zip: string;
20
+ slug?: string;
21
+ dateCreated: Date;
22
+ categoryId: number;
23
+ categoryClassId: number;
24
+ };
@@ -0,0 +1,8 @@
1
+ export type Colors = {
2
+ uiText: string;
3
+ uiAccent: string;
4
+ primary: string;
5
+ primaryDark: string;
6
+ secondary: string;
7
+ secondaryDark: string;
8
+ };
@@ -0,0 +1,29 @@
1
+ import { Colors } from "./Colors";
2
+ import { PointsOfInterestConfig } from "./PointsOfInterestConfig";
3
+ import { SearchConfig } from "./SearchConfig";
4
+ export type MapConfig = {
5
+ title: string;
6
+ titleShort: string;
7
+ description: string;
8
+ jobsDomain: string;
9
+ useDetailsPostMessage: boolean;
10
+ author: string;
11
+ url: string;
12
+ logo: string;
13
+ companyName: string;
14
+ shareImage: string;
15
+ clientAuthKey: string;
16
+ colors: Colors;
17
+ hideLocations: boolean;
18
+ fieldsShown: string[];
19
+ fieldFiltersShown: string[];
20
+ locationFiltersShown: string[];
21
+ fieldNames: Record<string, string>;
22
+ specialFeatures: Record<string, string>;
23
+ searchConfig: SearchConfig;
24
+ internalApplyLink: string;
25
+ useApplyDialog: boolean;
26
+ pointsOfInterestConfig: PointsOfInterestConfig;
27
+ showMap: boolean;
28
+ companyId: string;
29
+ };
@@ -0,0 +1,13 @@
1
+ export type PointsOfInterestConfig = {
2
+ title: string;
3
+ pointsOfInterestNames: Record<string, string>;
4
+ pointsOfInterestIcons: Record<string, string>;
5
+ placeMarkerColors: {
6
+ innerFillColor: string;
7
+ innerStrokeColor: string;
8
+ outerFillColor: string;
9
+ outerStrokeColor: string;
10
+ };
11
+ placeMarkerSize: number;
12
+ placeMappings: Record<string, string[]>;
13
+ };
@@ -0,0 +1,4 @@
1
+ export type SearchConfig = {
2
+ label: string;
3
+ placeholder: string;
4
+ };
@@ -0,0 +1,28 @@
1
+ export function getFilterOptions(listings: any, filteredListings: any, field: any, excludeZeroCount?: null): {
2
+ name: any;
3
+ count: any;
4
+ }[];
5
+ export function getSpecialFeatureOptions(listings: any, filteredListings: any, siteConfig: any, favorites: any): {
6
+ name: string;
7
+ count: any;
8
+ }[];
9
+ export function generateFilterOptions(filteredListings: any, allListings: any, siteConfig: any, filterOptions: any, parentField: any, favorites: any): {
10
+ filters: any;
11
+ locations: any;
12
+ pointsOfInterest: {
13
+ id: string;
14
+ title: any;
15
+ items: {
16
+ key: string;
17
+ name: any;
18
+ }[];
19
+ };
20
+ } | null;
21
+ export function applyFilters(allListings: any, selectedFilters: any, query: any, listingEntities: any, favorites: any, siteConfig: any): {
22
+ filteredListings: any;
23
+ mapItems: any[];
24
+ };
25
+ export function filterListingsByLocation(allListings: any, selectedLocation: any, listingEntities: any): {
26
+ filteredListings: any;
27
+ mapItems: any[];
28
+ };
@@ -0,0 +1,3 @@
1
+ export default Loading;
2
+ declare function Loading(): React.JSX.Element;
3
+ import React from "react";
@@ -0,0 +1,3 @@
1
+ export declare const getStorageObject: <T>(item: string, defaultItem?: T | null) => T | null;
2
+ export declare const getStorageItem: (item: string, defaultItem?: string | null) => string | null;
3
+ export declare const setStorageObject: (key: string, item: any) => void;
@@ -0,0 +1,15 @@
1
+ export function getDistinctItemsByProximity(items: any, listingEntitiesDetails: any): any[];
2
+ export function findCloseItems(itemsObj: any): {
3
+ item1: any;
4
+ item2: any;
5
+ }[];
6
+ export function adjustItemPositions(itemsObj: any, closeItemPairs: any): any;
7
+ export function clusterOptions(clusterGridSize: any, fillColor: any): {
8
+ gridSize: any;
9
+ styles: {
10
+ url: string;
11
+ textColor: string;
12
+ height: number;
13
+ width: number;
14
+ }[];
15
+ };
@@ -0,0 +1 @@
1
+ export function dynamicSort(items: any, fieldName: any, order?: string): any;
@@ -0,0 +1 @@
1
+ export function capitalize(str: any): any;
@@ -83,9 +83,7 @@ var getPointsOfInterestOptions = function getPointsOfInterestOptions(pointsOfInt
83
83
  };
84
84
  });
85
85
  };
86
- var generateFilterOptions = function generateFilterOptions(filteredListings, allListings, siteConfig, filterOptions) {
87
- var parentField = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
88
- var favorites = arguments.length > 5 ? arguments[5] : undefined;
86
+ var generateFilterOptions = function generateFilterOptions(filteredListings, allListings, siteConfig, filterOptions, parentField, favorites) {
89
87
  if (allListings.length > 0) {
90
88
  var dynamicFilters = siteConfig.fieldFiltersShown.map(function (fieldName) {
91
89
  if (fieldName === parentField && filterOptions !== null && filterOptions !== void 0 && filterOptions.filters) {
@@ -1 +1 @@
1
- {"version":3,"file":"filterUtil.js","sources":["../../src/util/filterUtil.js"],"sourcesContent":["import { getDistinctItemsByProximity } from '~/util/mapUtil';\n\nimport Fuse from 'fuse.js';\n\nexport const getFilterOptions = (listings, filteredListings, field, excludeZeroCount = null) => {\n\tconst options = new Set();\n\tlistings.forEach(listing => {\n\t\tif (listing.fields[field]) {\n\t\t\toptions.add(listing.fields[field]);\n\t\t}\n\t});\n\n\tconst optionCounts = {};\n\toptions.forEach(option => {\n\t\toptionCounts[option] = 0;\n\t});\n\n\tfilteredListings.forEach(listing => {\n\t\tconst value = listing.fields[field];\n\t\tif (value && optionCounts.hasOwnProperty(value)) {\n\t\t\toptionCounts[value] += 1;\n\t\t}\n\t});\n\n\treturn Array.from(options)\n\t\t.sort()\n\t\t.map(option => ({\n\t\t\tname: option,\n\t\t\tcount: optionCounts[option] || 0\n\t\t}))\n\t\t.filter(option => !(excludeZeroCount === true && option.count === 0));\n};\n\nexport const getSpecialFeatureOptions = (listings, filteredListings, siteConfig, favorites) => {\n\tconst specialFeatures = siteConfig.specialFeatures;\n\tconst featureCounts = Object.keys(specialFeatures).sort().reduce((acc, key) => {\n\t\tacc[specialFeatures[key]] = 0;\n\t\treturn acc;\n\t}, {});\n\n\tfilteredListings.forEach(listing => {\n\t\tObject.entries(specialFeatures).forEach(([featureKey, featureName]) => {\n\t\t\tif (listing.fields[featureKey] === 1) {\n\t\t\t\tfeatureCounts[featureName] += 1;\n\t\t\t}\n\t\t});\n\t});\n\n\tconst specialFeatureOptions = Object.entries(featureCounts).map(([name, count]) => ({\n\t\tname,\n\t\tcount\n\t}));\n\n\tfor (let option of specialFeatureOptions) {\n\t\tif (option.name === 'Favorite') {\n\t\t\toption.count = filteredListings.filter(x => favorites.includes(x.id)).length;\n\t\t}\n\t}\n\n\treturn specialFeatureOptions;\n};\n\nconst getPointsOfInterestOptions = pointsOfInterestNames => {\n\treturn Object.entries(pointsOfInterestNames).sort().map(([key, name]) => ({\n\t\tkey,\n\t\tname\n\t}));\n};\n\nexport const generateFilterOptions = (\n\tfilteredListings,\n\tallListings,\n\tsiteConfig,\n\tfilterOptions,\n\tparentField = null,\n\tfavorites\n) => {\n\tif (allListings.length > 0) {\n\t\tconst dynamicFilters = siteConfig.fieldFiltersShown.map(fieldName => {\n\t\t\tif (fieldName === parentField && filterOptions?.filters) {\n\t\t\t\treturn filterOptions.filters.find(filter => filter.id === fieldName);\n\t\t\t}\n\t\t\tif (fieldName == \"specialFeatures\") {\n\t\t\t\treturn {\n\t\t\t\t\tid: fieldName,\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\titems: getSpecialFeatureOptions(allListings, filteredListings, siteConfig, favorites).sort()\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tid: fieldName,\n\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\titems: getFilterOptions(allListings, filteredListings, fieldName)\n\t\t\t};\n\t\t});\n\n\t\tconst locations =\n\t\t\tsiteConfig.locationFiltersShown.map((fieldName, index) => {\n\t\t\t\tif (index === 0 && filterOptions?.locations) {\n\t\t\t\t\treturn filterOptions.locations.find(filter => filter.id === fieldName);\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tid: fieldName,\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\n\t\t\t\t\titems: getFilterOptions(allListings, filteredListings, fieldName, true)\n\t\t\t\t};\n\t\t\t});\n\n\t\tconst pointsOfInterest = {\n\t\t\tid: \"pointsOfInterest\",\n\t\t\ttitle: siteConfig.pointsOfInterestConfig.title,\n\t\t\titems: getPointsOfInterestOptions(\n\t\t\t\tsiteConfig.pointsOfInterestConfig.pointsOfInterestNames\n\t\t\t)\n\t\t};\n\n\t\treturn {\n\t\t\tfilters: dynamicFilters,\n\t\t\tlocations: locations,\n\t\t\tpointsOfInterest: pointsOfInterest\n\t\t};\n\t}\n\n\treturn null;\n};\n\nexport const applyFilters = (\n\tallListings,\n\tselectedFilters,\n\tquery,\n\tlistingEntities,\n\tfavorites,\n\tsiteConfig\n) => {\n\tlet results = allListings;\n\tlet invertedSpecialFeaturesMap;\n\tif (siteConfig.specialFeatures) {\n\t\tinvertedSpecialFeaturesMap = Object.entries(siteConfig.specialFeatures).reduce((acc, [key, value]) => {\n\t\t\tacc[value] = key;\n\t\t\treturn acc;\n\t\t}, {});\n\n\t}\n\tconst hasFavorite = !!selectedFilters.specialFeatures && !!selectedFilters.specialFeatures.Favorite;\n\n\tif (hasFavorite && selectedFilters.specialFeatures.Favorite == true) {\n\t\tresults = results.filter(x => favorites.includes(x.id));\n\t}\n\tvar favorite;\n\tif (hasFavorite) {\n\t\tfavorite = selectedFilters.specialFeatures.Favorite;\n\t\tdelete selectedFilters.specialFeatures.Favorite;\n\t}\n\tfor (const [field, filterItems] of Object.entries(selectedFilters)) {\n\t\tconst formattedField = field;\n\t\tif (field === \"pointsOfInterest\") continue;\n\t\tif (field === \"specialFeatures\" && invertedSpecialFeaturesMap && Object.keys(filterItems).length > 0) {\n\t\t\tresults = results.filter(listing => {\n\t\t\t\treturn Object.entries(filterItems).some(([filterName, filterValue]) => {\n\t\t\t\t\tconst listingFieldName = invertedSpecialFeaturesMap[filterName];\n\t\t\t\t\treturn filterValue && listing.fields[listingFieldName] === 1;\n\t\t\t\t});\n\t\t\t});\n\t\t} else if (Object.keys(filterItems).length > 0) {\n\t\t\tresults = results.filter(listing =>\n\t\t\t\tfilterItems.hasOwnProperty(listing.fields[formattedField])\n\t\t\t);\n\t\t}\n\t}\n\tif (query) {\n\t\tresults = searchResults(results, query);\n\t}\n\tconst distinctItems = getDistinctItemsByProximity(results, listingEntities);\n\tif (hasFavorite) {\n\t\tselectedFilters.specialFeatures.Favorite = favorite;\n\t}\n\treturn { filteredListings: results, mapItems: distinctItems };\n};\n\nfunction searchResults(results, query) {\n\tconst fields = [\n\t\t'id',\n\t\t'fields.posted',\n\t\t'fields.subtitle',\n\t\t'fields.education',\n\t\t'fields.position',\n\t\t'fields.category',\n\t\t'fields.categoryclass',\n\t\t'fields.shift',\n\t\t'fields.citystate',\n\t\t'fields.city',\n\t\t'fields.state',\n\t\t'fields.schedule',\n\t\t'fields.customflag1',\n\t\t'fields.bonus',\n\t\t'fields.remote',\n\t\t'fields.useclientjoburl',\n\t\t'fields.datecreated',\n\t\t'fields.datelastedited'\n\t];\n\n\tconst options = {\n\t\tincludeScore: true,\n\t\tthreshold: 0.3,\n\t\tkeys: fields\n\t};\n\n\tconst fuse = new Fuse(results, options);\n\tconst lowerCaseQuery = query.toLowerCase();\n\tconst queryTerms = lowerCaseQuery.split(' ');\n\n\tconst exactIdMatch = results.find(result => result.id.toString() === query);\n\tif (exactIdMatch) {\n\t\treturn [exactIdMatch];\n\t}\n\n\tconst fuseQuery = queryTerms.map(term => ({\n\t\t$or: fields.map(field => ({ [field]: term }))\n\t}));\n\n\tconst fuseResults = fuse.search({ $and: fuseQuery });\n\n\treturn fuseResults.map(result => result.item);\n}\n\nexport const filterListingsByLocation = (\n\tallListings,\n\tselectedLocation,\n\tlistingEntities\n) => {\n\tlet results = allListings;\n\tif (selectedLocation !== null) {\n\t\tresults = results.filter(item =>\n\t\t\tselectedLocation.items.hasOwnProperty(item.id)\n\t\t);\n\t}\n\tconst mapItems = getDistinctItemsByProximity(results, listingEntities);\n\treturn { filteredListings: results, mapItems: mapItems };\n};\n"],"names":["getFilterOptions","listings","filteredListings","field","excludeZeroCount","arguments","length","undefined","options","Set","forEach","listing","fields","add","optionCounts","option","value","hasOwnProperty","Array","from","sort","map","name","count","filter","getSpecialFeatureOptions","siteConfig","favorites","specialFeatures","featureCounts","Object","keys","reduce","acc","key","entries","_ref","_ref2","_slicedToArray","featureKey","featureName","specialFeatureOptions","_ref3","_ref4","_iterator","_createForOfIteratorHelper","_step","s","n","done","x","includes","id","err","e","f","getPointsOfInterestOptions","pointsOfInterestNames","_ref5","_ref6","generateFilterOptions","allListings","filterOptions","parentField","dynamicFilters","fieldFiltersShown","fieldName","filters","find","title","fieldNames","items","locations","locationFiltersShown","index","pointsOfInterest","pointsOfInterestConfig","applyFilters","selectedFilters","query","listingEntities","results","invertedSpecialFeaturesMap","_ref7","_ref8","hasFavorite","Favorite","favorite","_loop","_Object$entries$_i","_Object$entries","_i","filterItems","formattedField","some","_ref9","_ref10","filterName","filterValue","listingFieldName","searchResults","distinctItems","getDistinctItemsByProximity","mapItems","includeScore","threshold","fuse","Fuse","lowerCaseQuery","toLowerCase","queryTerms","split","exactIdMatch","result","toString","fuseQuery","term","$or","_defineProperty","fuseResults","search","$and","item","filterListingsByLocation","selectedLocation"],"mappings":";;;;AAIO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,QAAQ,EAAEC,gBAAgB,EAAEC,KAAK,EAA8B;AAAA,EAAA,IAA5BC,gBAAgB,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,IAAI,CAAA;AAC1F,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WAAW,CAAA;EACzB,IAAI+D,gBAAgB,KAAK,IAAI,EAAE;AAC9B3C,IAAAA,OAAO,GAAGA,OAAO,CAACzD,MAAM,CAAC,UAAAkG,IAAI,EAAA;MAAA,OAC5BE,gBAAgB,CAACrD,KAAK,CAACtD,cAAc,CAACyG,IAAI,CAACtE,EAAE,CAAC,CAAA;AAAA,KAC/C,CAAC,CAAA;AACF,GAAA;AACA,EAAA,IAAMmD,QAAQ,GAAGD,2BAA2B,CAACrB,OAAO,EAAED,eAAe,CAAC,CAAA;EACtE,OAAO;AAAE9E,IAAAA,gBAAgB,EAAE+E,OAAO;AAAEsB,IAAAA,QAAQ,EAAEA,QAAAA;GAAU,CAAA;AACzD;;;;"}
1
+ {"version":3,"file":"filterUtil.js","sources":["../../src/util/filterUtil.js"],"sourcesContent":["import { getDistinctItemsByProximity } from '~/util/mapUtil';\r\n\r\nimport Fuse from 'fuse.js';\r\n\r\nexport const getFilterOptions = (listings, filteredListings, field, excludeZeroCount = null) => {\r\n\tconst options = new Set();\r\n\tlistings.forEach(listing => {\r\n\t\tif (listing.fields[field]) {\r\n\t\t\toptions.add(listing.fields[field]);\r\n\t\t}\r\n\t});\r\n\r\n\tconst optionCounts = {};\r\n\toptions.forEach(option => {\r\n\t\toptionCounts[option] = 0;\r\n\t});\r\n\r\n\tfilteredListings.forEach(listing => {\r\n\t\tconst value = listing.fields[field];\r\n\t\tif (value && optionCounts.hasOwnProperty(value)) {\r\n\t\t\toptionCounts[value] += 1;\r\n\t\t}\r\n\t});\r\n\r\n\treturn Array.from(options)\r\n\t\t.sort()\r\n\t\t.map(option => ({\r\n\t\t\tname: option,\r\n\t\t\tcount: optionCounts[option] || 0\r\n\t\t}))\r\n\t\t.filter(option => !(excludeZeroCount === true && option.count === 0));\r\n};\r\n\r\nexport const getSpecialFeatureOptions = (listings, filteredListings, siteConfig, favorites) => {\r\n\tconst specialFeatures = siteConfig.specialFeatures;\r\n\tconst featureCounts = Object.keys(specialFeatures).sort().reduce((acc, key) => {\r\n\t\tacc[specialFeatures[key]] = 0;\r\n\t\treturn acc;\r\n\t}, {});\r\n\r\n\tfilteredListings.forEach(listing => {\r\n\t\tObject.entries(specialFeatures).forEach(([featureKey, featureName]) => {\r\n\t\t\tif (listing.fields[featureKey] === 1) {\r\n\t\t\t\tfeatureCounts[featureName] += 1;\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\r\n\tconst specialFeatureOptions = Object.entries(featureCounts).map(([name, count]) => ({\r\n\t\tname,\r\n\t\tcount\r\n\t}));\r\n\r\n\tfor (let option of specialFeatureOptions) {\r\n\t\tif (option.name === 'Favorite') {\r\n\t\t\toption.count = filteredListings.filter(x => favorites.includes(x.id)).length;\r\n\t\t}\r\n\t}\r\n\r\n\treturn specialFeatureOptions;\r\n};\r\n\r\nconst getPointsOfInterestOptions = pointsOfInterestNames => {\r\n\treturn Object.entries(pointsOfInterestNames).sort().map(([key, name]) => ({\r\n\t\tkey,\r\n\t\tname\r\n\t}));\r\n};\r\n\r\nexport const generateFilterOptions = (\r\n\tfilteredListings,\r\n\tallListings,\r\n\tsiteConfig,\r\n\tfilterOptions,\r\n\tparentField,\r\n\tfavorites\r\n) => {\r\n\tif (allListings.length > 0) {\r\n\t\tconst dynamicFilters = siteConfig.fieldFiltersShown.map(fieldName => {\r\n\t\t\tif (fieldName === parentField && filterOptions?.filters) {\r\n\t\t\t\treturn filterOptions.filters.find(filter => filter.id === fieldName);\r\n\t\t\t}\r\n\t\t\tif (fieldName == \"specialFeatures\") {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tid: fieldName,\r\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\r\n\t\t\t\t\titems: getSpecialFeatureOptions(allListings, filteredListings, siteConfig, favorites).sort()\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\treturn {\r\n\t\t\t\tid: fieldName,\r\n\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\r\n\t\t\t\titems: getFilterOptions(allListings, filteredListings, fieldName)\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tconst locations =\r\n\t\t\tsiteConfig.locationFiltersShown.map((fieldName, index) => {\r\n\t\t\t\tif (index === 0 && filterOptions?.locations) {\r\n\t\t\t\t\treturn filterOptions.locations.find(filter => filter.id === fieldName);\r\n\t\t\t\t}\r\n\t\t\t\treturn {\r\n\t\t\t\t\tid: fieldName,\r\n\t\t\t\t\ttitle: siteConfig.fieldNames[fieldName],\r\n\t\t\t\t\titems: getFilterOptions(allListings, filteredListings, fieldName, true)\r\n\t\t\t\t};\r\n\t\t\t});\r\n\r\n\t\tconst pointsOfInterest = {\r\n\t\t\tid: \"pointsOfInterest\",\r\n\t\t\ttitle: siteConfig.pointsOfInterestConfig.title,\r\n\t\t\titems: getPointsOfInterestOptions(\r\n\t\t\t\tsiteConfig.pointsOfInterestConfig.pointsOfInterestNames\r\n\t\t\t)\r\n\t\t};\r\n\r\n\t\treturn {\r\n\t\t\tfilters: dynamicFilters,\r\n\t\t\tlocations: locations,\r\n\t\t\tpointsOfInterest: pointsOfInterest\r\n\t\t};\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nexport const applyFilters = (\r\n\tallListings,\r\n\tselectedFilters,\r\n\tquery,\r\n\tlistingEntities,\r\n\tfavorites,\r\n\tsiteConfig\r\n) => {\r\n\tlet results = allListings;\r\n\tlet invertedSpecialFeaturesMap;\r\n\tif (siteConfig.specialFeatures) {\r\n\t\tinvertedSpecialFeaturesMap = Object.entries(siteConfig.specialFeatures).reduce((acc, [key, value]) => {\r\n\t\t\tacc[value] = key;\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\t}\r\n\tconst hasFavorite = !!selectedFilters.specialFeatures && !!selectedFilters.specialFeatures.Favorite;\r\n\r\n\tif (hasFavorite && selectedFilters.specialFeatures.Favorite == true) {\r\n\t\tresults = results.filter(x => favorites.includes(x.id));\r\n\t}\r\n\tvar favorite;\r\n\tif (hasFavorite) {\r\n\t\tfavorite = selectedFilters.specialFeatures.Favorite;\r\n\t\tdelete selectedFilters.specialFeatures.Favorite;\r\n\t}\r\n\tfor (const [field, filterItems] of Object.entries(selectedFilters)) {\r\n\t\tconst formattedField = field;\r\n\t\tif (field === \"pointsOfInterest\") continue;\r\n\t\tif (field === \"specialFeatures\" && invertedSpecialFeaturesMap && Object.keys(filterItems).length > 0) {\r\n\t\t\tresults = results.filter(listing => {\r\n\t\t\t\treturn Object.entries(filterItems).some(([filterName, filterValue]) => {\r\n\t\t\t\t\tconst listingFieldName = invertedSpecialFeaturesMap[filterName];\r\n\t\t\t\t\treturn filterValue && listing.fields[listingFieldName] === 1;\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t} else if (Object.keys(filterItems).length > 0) {\r\n\t\t\tresults = results.filter(listing =>\r\n\t\t\t\tfilterItems.hasOwnProperty(listing.fields[formattedField])\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\tif (query) {\r\n\t\tresults = searchResults(results, query);\r\n\t}\r\n\tconst distinctItems = getDistinctItemsByProximity(results, listingEntities);\r\n\tif (hasFavorite) {\r\n\t\tselectedFilters.specialFeatures.Favorite = favorite;\r\n\t}\r\n\treturn { filteredListings: results, mapItems: distinctItems };\r\n};\r\n\r\nfunction searchResults(results, query) {\r\n\tconst fields = [\r\n\t\t'id',\r\n\t\t'fields.posted',\r\n\t\t'fields.subtitle',\r\n\t\t'fields.education',\r\n\t\t'fields.position',\r\n\t\t'fields.category',\r\n\t\t'fields.categoryclass',\r\n\t\t'fields.shift',\r\n\t\t'fields.citystate',\r\n\t\t'fields.city',\r\n\t\t'fields.state',\r\n\t\t'fields.schedule',\r\n\t\t'fields.customflag1',\r\n\t\t'fields.bonus',\r\n\t\t'fields.remote',\r\n\t\t'fields.useclientjoburl',\r\n\t\t'fields.datecreated',\r\n\t\t'fields.datelastedited'\r\n\t];\r\n\r\n\tconst options = {\r\n\t\tincludeScore: true,\r\n\t\tthreshold: 0.3,\r\n\t\tkeys: fields\r\n\t};\r\n\r\n\tconst fuse = new Fuse(results, options);\r\n\tconst lowerCaseQuery = query.toLowerCase();\r\n\tconst queryTerms = lowerCaseQuery.split(' ');\r\n\r\n\tconst exactIdMatch = results.find(result => result.id.toString() === query);\r\n\tif (exactIdMatch) {\r\n\t\treturn [exactIdMatch];\r\n\t}\r\n\r\n\tconst fuseQuery = queryTerms.map(term => ({\r\n\t\t$or: fields.map(field => ({ [field]: term }))\r\n\t}));\r\n\r\n\tconst fuseResults = fuse.search({ $and: fuseQuery });\r\n\r\n\treturn fuseResults.map(result => result.item);\r\n}\r\n\r\nexport const filterListingsByLocation = (\r\n\tallListings,\r\n\tselectedLocation,\r\n\tlistingEntities\r\n) => {\r\n\tlet results = allListings;\r\n\tif (selectedLocation !== null) {\r\n\t\tresults = results.filter(item =>\r\n\t\t\tselectedLocation.items.hasOwnProperty(item.id)\r\n\t\t);\r\n\t}\r\n\tconst mapItems = getDistinctItemsByProximity(results, listingEntities);\r\n\treturn { filteredListings: results, mapItems: mapItems };\r\n};\r\n"],"names":["getFilterOptions","listings","filteredListings","field","excludeZeroCount","arguments","length","undefined","options","Set","forEach","listing","fields","add","optionCounts","option","value","hasOwnProperty","Array","from","sort","map","name","count","filter","getSpecialFeatureOptions","siteConfig","favorites","specialFeatures","featureCounts","Object","keys","reduce","acc","key","entries","_ref","_ref2","_slicedToArray","featureKey","featureName","specialFeatureOptions","_ref3","_ref4","_iterator","_createForOfIteratorHelper","_step","s","n","done","x","includes","id","err","e","f","getPointsOfInterestOptions","pointsOfInterestNames","_ref5","_ref6","generateFilterOptions","allListings","filterOptions","parentField","dynamicFilters","fieldFiltersShown","fieldName","filters","find","title","fieldNames","items","locations","locationFiltersShown","index","pointsOfInterest","pointsOfInterestConfig","applyFilters","selectedFilters","query","listingEntities","results","invertedSpecialFeaturesMap","_ref7","_ref8","hasFavorite","Favorite","favorite","_loop","_Object$entries$_i","_Object$entries","_i","filterItems","formattedField","some","_ref9","_ref10","filterName","filterValue","listingFieldName","searchResults","distinctItems","getDistinctItemsByProximity","mapItems","includeScore","threshold","fuse","Fuse","lowerCaseQuery","toLowerCase","queryTerms","split","exactIdMatch","result","toString","fuseQuery","term","$or","_defineProperty","fuseResults","search","$and","item","filterListingsByLocation","selectedLocation"],"mappings":";;;;AAIO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,QAAQ,EAAEC,gBAAgB,EAAEC,KAAK,EAA8B;AAAA,EAAA,IAA5BC,gBAAgB,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,IAAI,CAAA;AAC1F,EAAA,IAAMG,OAAO,GAAG,IAAIC,GAAG,EAAE,CAAA;AACzBR,EAAAA,QAAQ,CAACS,OAAO,CAAC,UAAAC,OAAO,EAAI;AAC3B,IAAA,IAAIA,OAAO,CAACC,MAAM,CAACT,KAAK,CAAC,EAAE;MAC1BK,OAAO,CAACK,GAAG,CAACF,OAAO,CAACC,MAAM,CAACT,KAAK,CAAC,CAAC,CAAA;AACnC,KAAA;AACD,GAAC,CAAC,CAAA;EAEF,IAAMW,YAAY,GAAG,EAAE,CAAA;AACvBN,EAAAA,OAAO,CAACE,OAAO,CAAC,UAAAK,MAAM,EAAI;AACzBD,IAAAA,YAAY,CAACC,MAAM,CAAC,GAAG,CAAC,CAAA;AACzB,GAAC,CAAC,CAAA;AAEFb,EAAAA,gBAAgB,CAACQ,OAAO,CAAC,UAAAC,OAAO,EAAI;AACnC,IAAA,IAAMK,KAAK,GAAGL,OAAO,CAACC,MAAM,CAACT,KAAK,CAAC,CAAA;IACnC,IAAIa,KAAK,IAAIF,YAAY,CAACG,cAAc,CAACD,KAAK,CAAC,EAAE;AAChDF,MAAAA,YAAY,CAACE,KAAK,CAAC,IAAI,CAAC,CAAA;AACzB,KAAA;AACD,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOE,KAAK,CAACC,IAAI,CAACX,OAAO,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A,OAAIA,MAAM,CAACS,IAAI,CAAA;GAAC,CAAA,CAAA;AAC9C,CAAA;AAEO,IAAMC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CACpC9D,WAAW,EACX+D,gBAAgB,EAChB5C,eAAe,EACX;EACJ,IAAIC,OAAO,GAAGpB,WAAW,CAAA;EACzB,IAAI+D,gBAAgB,KAAK,IAAI,EAAE;AAC9B3C,IAAAA,OAAO,GAAGA,OAAO,CAACzD,MAAM,CAAC,UAAAkG,IAAI,EAAA;MAAA,OAC5BE,gBAAgB,CAACrD,KAAK,CAACtD,cAAc,CAACyG,IAAI,CAACtE,EAAE,CAAC,CAAA;AAAA,KAC/C,CAAC,CAAA;AACF,GAAA;AACA,EAAA,IAAMmD,QAAQ,GAAGD,2BAA2B,CAACrB,OAAO,EAAED,eAAe,CAAC,CAAA;EACtE,OAAO;AAAE9E,IAAAA,gBAAgB,EAAE+E,OAAO;AAAEsB,IAAAA,QAAQ,EAAEA,QAAAA;GAAU,CAAA;AACzD;;;;"}
@@ -1,31 +1,40 @@
1
- var getStorageObject = function getStorageObject(item) {
2
- var _JSON$parse;
3
- var defaultItem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
4
- if (typeof window == 'undefined') return defaultItem;
5
- if (localStorage.getItem(item) == null) return defaultItem;
6
- if (localStorage.getItem(item) == 'undefined') {
7
- localStorage.removeItem(item);
8
- }
9
- return (_JSON$parse = JSON.parse(localStorage.getItem(item))) !== null && _JSON$parse !== void 0 ? _JSON$parse : defaultItem;
10
- };
11
- var getStorageItem = function getStorageItem(item) {
12
- var _localStorage$getItem;
13
- var defaultItem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
14
- if (typeof window == 'undefined') return defaultItem;
15
- if (localStorage.getItem(item) == null) return defaultItem;
16
- if (localStorage.getItem(item) == 'undefined') {
17
- localStorage.removeItem(item);
18
- }
19
- return (_localStorage$getItem = localStorage.getItem(item)) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : defaultItem;
20
- };
21
- var setStorageObject = function setStorageObject(key, item) {
22
- if (typeof window == 'undefined') return;
23
- if (item == undefined) return;
24
- try {
25
- localStorage.setItem(key, JSON.stringify(item));
26
- } catch (err) {
27
- console.log(err);
28
- }
1
+ const getStorageObject = (item, defaultItem = null) => {
2
+ if (typeof window === 'undefined')
3
+ return defaultItem;
4
+ const storageItem = localStorage.getItem(item);
5
+ if (storageItem === null || storageItem === 'undefined') {
6
+ localStorage.removeItem(item);
7
+ return defaultItem;
8
+ }
9
+ try {
10
+ return JSON.parse(storageItem) ?? defaultItem;
11
+ }
12
+ catch (error) {
13
+ console.error(`Error parsing JSON for ${item}:`, error);
14
+ return defaultItem;
15
+ }
16
+ };
17
+ const getStorageItem = (item, defaultItem = null) => {
18
+ if (typeof window === 'undefined')
19
+ return defaultItem;
20
+ const storageItem = localStorage.getItem(item);
21
+ if (storageItem === null || storageItem === 'undefined') {
22
+ localStorage.removeItem(item);
23
+ return defaultItem;
24
+ }
25
+ return storageItem ?? defaultItem;
26
+ };
27
+ const setStorageObject = (key, item) => {
28
+ if (typeof window === 'undefined')
29
+ return;
30
+ if (item === undefined)
31
+ return;
32
+ try {
33
+ localStorage.setItem(key, JSON.stringify(item));
34
+ }
35
+ catch (err) {
36
+ console.error(`Error setting item ${key} in localStorage:`, err);
37
+ }
29
38
  };
30
39
 
31
40
  export { getStorageItem, getStorageObject, setStorageObject };
@@ -1 +1 @@
1
- {"version":3,"file":"localStorageUtil.js","sources":["../../src/util/localStorageUtil.js"],"sourcesContent":["export const getStorageObject = (item, defaultItem = null) =>{\r\n\tif(typeof window == 'undefined') return defaultItem;\r\n\tif(localStorage.getItem(item) == null) return defaultItem;\r\n\tif(localStorage.getItem(item) == 'undefined'){\r\n\t\tlocalStorage.removeItem(item);\r\n\t}\r\n\treturn JSON.parse(localStorage.getItem(item)) ?? defaultItem;\r\n};\r\n\r\nexport const getStorageItem = (item, defaultItem = null) =>{\r\n\tif(typeof window == 'undefined') return defaultItem;\r\n\tif(localStorage.getItem(item) == null) return defaultItem;\r\n\tif(localStorage.getItem(item) == 'undefined'){\r\n\t\tlocalStorage.removeItem(item);\r\n\t}\r\n\treturn localStorage.getItem(item) ?? defaultItem;\r\n};\r\n\r\nexport const setStorageObject = (key, item) =>{\r\n\tif(typeof window == 'undefined') return;\r\n\tif(item == undefined)return;\r\n\ttry{\r\n\t\tlocalStorage.setItem(key, JSON.stringify(item));\r\n\t}catch(err){\r\n\t\tconsole.log(err);\r\n\t}\r\n};"],"names":["getStorageObject","item","_JSON$parse","defaultItem","arguments","length","undefined","window","localStorage","getItem","removeItem","JSON","parse","getStorageItem","_localStorage$getItem","setStorageObject","key","setItem","stringify","err","console","log"],"mappings":"IAAaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAI,EAAwB;AAAA,EAAA,IAAAC,WAAA,CAAA;AAAA,EAAA,IAAtBC,WAAW,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,IAAI,CAAA;AACxD,EAAA,IAAG,OAAOG,MAAM,IAAI,WAAW,EAAE,OAAOJ,WAAW,CAAA;EACnD,IAAGK,YAAY,CAACC,OAAO,CAACR,IAAI,CAAC,IAAI,IAAI,EAAE,OAAOE,WAAW,CAAA;EACzD,IAAGK,YAAY,CAACC,OAAO,CAACR,IAAI,CAAC,IAAI,WAAW,EAAC;AAC5CO,IAAAA,YAAY,CAACE,UAAU,CAACT,IAAI,CAAC,CAAA;AAC9B,GAAA;AACA,EAAA,OAAA,CAAAC,WAAA,GAAOS,IAAI,CAACC,KAAK,CAACJ,YAAY,CAACC,OAAO,CAACR,IAAI,CAAC,CAAC,MAAA,IAAA,IAAAC,WAAA,KAAAA,KAAAA,CAAAA,GAAAA,WAAA,GAAIC,WAAW,CAAA;AAC7D,EAAC;IAEYU,cAAc,GAAG,SAAjBA,cAAcA,CAAIZ,IAAI,EAAwB;AAAA,EAAA,IAAAa,qBAAA,CAAA;AAAA,EAAA,IAAtBX,WAAW,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,IAAI,CAAA;AACtD,EAAA,IAAG,OAAOG,MAAM,IAAI,WAAW,EAAE,OAAOJ,WAAW,CAAA;EACnD,IAAGK,YAAY,CAACC,OAAO,CAACR,IAAI,CAAC,IAAI,IAAI,EAAE,OAAOE,WAAW,CAAA;EACzD,IAAGK,YAAY,CAACC,OAAO,CAACR,IAAI,CAAC,IAAI,WAAW,EAAC;AAC5CO,IAAAA,YAAY,CAACE,UAAU,CAACT,IAAI,CAAC,CAAA;AAC9B,GAAA;AACA,EAAA,OAAA,CAAAa,qBAAA,GAAON,YAAY,CAACC,OAAO,CAACR,IAAI,CAAC,MAAAa,IAAAA,IAAAA,qBAAA,KAAAA,KAAAA,CAAAA,GAAAA,qBAAA,GAAIX,WAAW,CAAA;AACjD,EAAC;AAEM,IAAMY,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,GAAG,EAAEf,IAAI,EAAI;AAC7C,EAAA,IAAG,OAAOM,MAAM,IAAI,WAAW,EAAE,OAAA;EACjC,IAAGN,IAAI,IAAIK,SAAS,EAAC,OAAA;EACrB,IAAG;IACFE,YAAY,CAACS,OAAO,CAACD,GAAG,EAAEL,IAAI,CAACO,SAAS,CAACjB,IAAI,CAAC,CAAC,CAAA;GAC/C,CAAA,OAAMkB,GAAG,EAAC;AACVC,IAAAA,OAAO,CAACC,GAAG,CAACF,GAAG,CAAC,CAAA;AACjB,GAAA;AACD;;;;"}
1
+ {"version":3,"file":"localStorageUtil.js","sources":["../../src/util/localStorageUtil.ts"],"sourcesContent":["export const getStorageObject = <T>(item: string, defaultItem: T | null = null): T | null => {\r\n\tif (typeof window === 'undefined') return defaultItem;\r\n\tconst storageItem = localStorage.getItem(item);\r\n\tif (storageItem === null || storageItem === 'undefined') {\r\n\t\tlocalStorage.removeItem(item);\r\n\t\treturn defaultItem;\r\n\t}\r\n\ttry {\r\n\t\treturn JSON.parse(storageItem) ?? defaultItem;\r\n\t} catch (error) {\r\n\t\tconsole.error(`Error parsing JSON for ${item}:`, error);\r\n\t\treturn defaultItem;\r\n\t}\r\n};\r\n\r\nexport const getStorageItem = (item: string, defaultItem: string | null = null): string | null => {\r\n\tif (typeof window === 'undefined') return defaultItem;\r\n\tconst storageItem = localStorage.getItem(item);\r\n\tif (storageItem === null || storageItem === 'undefined') {\r\n\t\tlocalStorage.removeItem(item);\r\n\t\treturn defaultItem;\r\n\t}\r\n\treturn storageItem ?? defaultItem;\r\n};\r\n\r\nexport const setStorageObject = (key: string, item: any): void => {\r\n\tif (typeof window === 'undefined') return;\r\n\tif (item === undefined) return;\r\n\ttry {\r\n\t\tlocalStorage.setItem(key, JSON.stringify(item));\r\n\t} catch (err) {\r\n\t\tconsole.error(`Error setting item ${key} in localStorage:`, err);\r\n\t}\r\n};\r\n"],"names":[],"mappings":"AAAa,MAAA,gBAAgB,GAAG,CAAI,IAAY,EAAE,WAAA,GAAwB,IAAI,KAAc;IAC3F,IAAI,OAAO,MAAM,KAAK,WAAW;AAAE,QAAA,OAAO,WAAW,CAAC;IACtD,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/C,IAAA,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,WAAW,EAAE;AACxD,QAAA,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC9B,QAAA,OAAO,WAAW,CAAC;AACnB,KAAA;IACD,IAAI;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC;AAC9C,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;QACf,OAAO,CAAC,KAAK,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAAG,CAAA,CAAA,EAAE,KAAK,CAAC,CAAC;AACxD,QAAA,OAAO,WAAW,CAAC;AACnB,KAAA;AACF,EAAE;AAEW,MAAA,cAAc,GAAG,CAAC,IAAY,EAAE,WAAA,GAA6B,IAAI,KAAmB;IAChG,IAAI,OAAO,MAAM,KAAK,WAAW;AAAE,QAAA,OAAO,WAAW,CAAC;IACtD,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/C,IAAA,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,WAAW,EAAE;AACxD,QAAA,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC9B,QAAA,OAAO,WAAW,CAAC;AACnB,KAAA;IACD,OAAO,WAAW,IAAI,WAAW,CAAC;AACnC,EAAE;MAEW,gBAAgB,GAAG,CAAC,GAAW,EAAE,IAAS,KAAU;IAChE,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAC1C,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO;IAC/B,IAAI;AACH,QAAA,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAChD,KAAA;AAAC,IAAA,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,CAAA,mBAAA,EAAsB,GAAG,CAAmB,iBAAA,CAAA,EAAE,GAAG,CAAC,CAAC;AACjE,KAAA;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"mapUtil.js","sources":["../../src/util/mapUtil.js"],"sourcesContent":["export const getDistinctItemsByProximity = (items, listingEntitiesDetails) => {\r\n\tconst clusters = {};\r\n\r\n\tif (!listingEntitiesDetails) return [];\r\n\r\n\tconst closeItemPairs = findCloseItems(listingEntitiesDetails);\r\n\tif (closeItemPairs.length > 0) {\r\n\t\tlistingEntitiesDetails = adjustItemPositions(\r\n\t\t\tlistingEntitiesDetails,\r\n\t\t\tcloseItemPairs\r\n\t\t);\r\n\t}\r\n\r\n\titems?.forEach(item => {\r\n\t\tif(item.entityId !== -1){\r\n\r\n\t\t\tconst entityDetails = listingEntitiesDetails[item.entityId];\r\n\r\n\t\t\tif (!entityDetails) {\r\n\t\t\t\tconsole.error(`Details not found for entityId: ${item.entityId}`);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\titem.mapDetails = entityDetails;\r\n\r\n\t\t\tif (!clusters[item.entityId]) {\r\n\t\t\t\tclusters[item.entityId] = {\r\n\t\t\t\t\t...item.mapDetails,\r\n\t\t\t\t\titems: { [item.id]: item }\r\n\t\t\t\t};\r\n\t\t\t} else {\r\n\t\t\t\tclusters[item.entityId].items[item.id] = item;\r\n\t\t\t}}\r\n\t});\r\n\r\n\treturn Object.values(clusters);\r\n};\r\n\r\nexport const findCloseItems = itemsObj => {\r\n\tconst closeItems = [];\r\n\tconst items = Object.values(itemsObj); // Convert object to array for iteration\r\n\tconst proximityThreshold = 0.0001;\r\n\r\n\tfor (let i = 0; i < items.length; i++) {\r\n\t\tfor (let j = i + 1; j < items.length; j++) {\r\n\t\t\tconst distanceLat = Math.abs(items[i].latitude - items[j].latitude);\r\n\t\t\tconst distanceLng = Math.abs(items[i].longitude - items[j].longitude);\r\n\t\t\tif (\r\n\t\t\t\tdistanceLat < proximityThreshold &&\r\n\t\t\t\tdistanceLng < proximityThreshold\r\n\t\t\t) {\r\n\t\t\t\tcloseItems.push({ item1: items[i], item2: items[j] });\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn closeItems;\r\n};\r\n\r\nexport const adjustItemPositions = (itemsObj, closeItemPairs) => {\r\n\tconst adjustmentValue = 0.0001;\r\n\tconst adjustedItems = { ...itemsObj }; // Create a shallow copy of the object\r\n\r\n\tcloseItemPairs.forEach(pair => {\r\n\t\tif (adjustedItems[pair.item1.id] && adjustedItems[pair.item2.id]) {\r\n\t\t\tadjustedItems[pair.item2.id].latitude += adjustmentValue;\r\n\t\t\tadjustedItems[pair.item2.id].longitude += adjustmentValue;\r\n\t\t}\r\n\t});\r\n\r\n\treturn adjustedItems;\r\n};\r\n\r\nexport const clusterOptions = (clusterGridSize, fillColor) => {\r\n\treturn {\r\n\t\tgridSize: clusterGridSize,\r\n\t\tstyles:[{\r\n\t\t\turl: createSvgDataUri(fillColor),\r\n\t\t\ttextColor:'white',\r\n\t\t\theight: 40,\r\n\t\t\twidth: 40\r\n\t\t}]\r\n\t};\r\n};\r\n\r\nfunction createSvgDataUri(fillColor) {\r\n\tconst svg = `<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\r\n\t <circle cx=\"25\" cy=\"25\" r=\"20\" fill=\"${fillColor}\" />\r\n\t</svg>`;\r\n\treturn `data:image/svg+xml;base64,${btoa(svg)}`;\r\n}\r\n"],"names":["getDistinctItemsByProximity","items","listingEntitiesDetails","clusters","closeItemPairs","findCloseItems","length","adjustItemPositions","forEach","item","entityId","entityDetails","console","error","concat","mapDetails","_objectSpread","_defineProperty","id","Object","values","itemsObj","closeItems","proximityThreshold","i","j","distanceLat","Math","abs","latitude","distanceLng","longitude","push","item1","item2","adjustmentValue","adjustedItems","pair","clusterOptions","clusterGridSize","fillColor","gridSize","styles","url","createSvgDataUri","textColor","height","width","svg","btoa"],"mappings":";;AAAO,IAAMA,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,KAAK,EAAEC,sBAAsB,EAAK;EAC7E,IAAMC,QAAQ,GAAG,EAAE,CAAA;AAEnB,EAAA,IAAI,CAACD,sBAAsB,EAAE,OAAO,EAAE,CAAA;AAEtC,EAAA,IAAME,cAAc,GAAGC,cAAc,CAACH,sBAAsB,CAAC,CAAA;AAC7D,EAAA,IAAIE,cAAc,CAACE,MAAM,GAAG,CAAC,EAAE;AAC9BJ,IAAAA,sBAAsB,GAAGK,mBAAmB,CAC3CL,sBAAsB,EACtBE,cACD,CAAC,CAAA;AACF,GAAA;EAEAH,KAAK,KAAA,IAAA,IAALA,KAAK,KAALA,KAAAA,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ChB,EAAE,CAAC,CAACW,QAAQ,IAAIM,eAAe,CAAA;MACxDC,aAAa,CAACC,IAAI,CAACH,KAAK,CAAChB,EAAE,CAAC,CAACa,SAAS,IAAII,eAAe,CAAA;AAC1D,KAAA;AACD,GAAC,CAAC,CAAA;AAEF,EAAA,OAAOC,aAAa,CAAA;AACrB,EAAC;AAEM,IAAME,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,eAAe,EAAEC,SAAS,EAAK;EAC7D,OAAO;AACNC,IAAAA,QAAQ,EAAEF,eAAe;AACzBG,IAAAA,MAAM,EAAC,CAAC;AACPC,MAAAA,GAAG,EAAEC,gBAAgB,CAACJ,SAAS,CAAC;AAChCK,MAAAA,SAAS,EAAC,OAAO;AACjBC,MAAAA,MAAM,EAAE,EAAE;AACVC,MAAAA,KAAK,EAAE,EAAA;KACP,CAAA;GACD,CAAA;AACF,EAAC;AAED,SAASH,gBAAgBA,CAACJ,SAAS,EAAE;AACpC,EAAA,IAAMQ,GAAG,GAAA,yHAAA,CAAAlC,MAAA,CACgC0B,SAAS,EAC3C,iBAAA,CAAA,CAAA;AACP,EAAA,OAAA,4BAAA,CAAA1B,MAAA,CAAoCmC,IAAI,CAACD,GAAG,CAAC,CAAA,CAAA;AAC9C;;;;"}
1
+ {"version":3,"file":"mapUtil.js","sources":["../../src/util/mapUtil.js"],"sourcesContent":["export const getDistinctItemsByProximity = (items, listingEntitiesDetails) => {\n\tconst clusters = {};\n\n\tif (!listingEntitiesDetails) return [];\n\n\tconst closeItemPairs = findCloseItems(listingEntitiesDetails);\n\tif (closeItemPairs.length > 0) {\n\t\tlistingEntitiesDetails = adjustItemPositions(\n\t\t\tlistingEntitiesDetails,\n\t\t\tcloseItemPairs\n\t\t);\n\t}\n\n\titems?.forEach(item => {\n\t\tif(item.entityId !== -1){\n\n\t\t\tconst entityDetails = listingEntitiesDetails[item.entityId];\n\n\t\t\tif (!entityDetails) {\n\t\t\t\tconsole.error(`Details not found for entityId: ${item.entityId}`);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\titem.mapDetails = entityDetails;\n\n\t\t\tif (!clusters[item.entityId]) {\n\t\t\t\tclusters[item.entityId] = {\n\t\t\t\t\t...item.mapDetails,\n\t\t\t\t\titems: { [item.id]: item }\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tclusters[item.entityId].items[item.id] = item;\n\t\t\t}}\n\t});\n\n\treturn Object.values(clusters);\n};\n\nexport const findCloseItems = itemsObj => {\n\tconst closeItems = [];\n\tconst items = Object.values(itemsObj); // Convert object to array for iteration\n\tconst proximityThreshold = 0.0001;\n\n\tfor (let i = 0; i < items.length; i++) {\n\t\tfor (let j = i + 1; j < items.length; j++) {\n\t\t\tconst distanceLat = Math.abs(items[i].latitude - items[j].latitude);\n\t\t\tconst distanceLng = Math.abs(items[i].longitude - items[j].longitude);\n\t\t\tif (\n\t\t\t\tdistanceLat < proximityThreshold &&\n\t\t\t\tdistanceLng < proximityThreshold\n\t\t\t) {\n\t\t\t\tcloseItems.push({ item1: items[i], item2: items[j] });\n\t\t\t}\n\t\t}\n\t}\n\n\treturn closeItems;\n};\n\nexport const adjustItemPositions = (itemsObj, closeItemPairs) => {\n\tconst adjustmentValue = 0.0001;\n\tconst adjustedItems = { ...itemsObj }; // Create a shallow copy of the object\n\n\tcloseItemPairs.forEach(pair => {\n\t\tif (adjustedItems[pair.item1.id] && adjustedItems[pair.item2.id]) {\n\t\t\tadjustedItems[pair.item2.id].latitude += adjustmentValue;\n\t\t\tadjustedItems[pair.item2.id].longitude += adjustmentValue;\n\t\t}\n\t});\n\n\treturn adjustedItems;\n};\n\nexport const clusterOptions = (clusterGridSize, fillColor) => {\n\treturn {\n\t\tgridSize: clusterGridSize,\n\t\tstyles:[{\n\t\t\turl: createSvgDataUri(fillColor),\n\t\t\ttextColor:'white',\n\t\t\theight: 40,\n\t\t\twidth: 40\n\t\t}]\n\t};\n};\n\nfunction createSvgDataUri(fillColor) {\n\tconst svg = `<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\n\t <circle cx=\"25\" cy=\"25\" r=\"20\" fill=\"${fillColor}\" />\n\t</svg>`;\n\treturn `data:image/svg+xml;base64,${btoa(svg)}`;\n}\n"],"names":["getDistinctItemsByProximity","items","listingEntitiesDetails","clusters","closeItemPairs","findCloseItems","length","adjustItemPositions","forEach","item","entityId","entityDetails","console","error","concat","mapDetails","_objectSpread","_defineProperty","id","Object","values","itemsObj","closeItems","proximityThreshold","i","j","distanceLat","Math","abs","latitude","distanceLng","longitude","push","item1","item2","adjustmentValue","adjustedItems","pair","clusterOptions","clusterGridSize","fillColor","gridSize","styles","url","createSvgDataUri","textColor","height","width","svg","btoa"],"mappings":";;AAAO,IAAMA,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,KAAK,EAAEC,sBAAsB,EAAK;EAC7E,IAAMC,QAAQ,GAAG,EAAE,CAAA;AAEnB,EAAA,IAAI,CAACD,sBAAsB,EAAE,OAAO,EAAE,CAAA;AAEtC,EAAA,IAAME,cAAc,GAAGC,cAAc,CAACH,sBAAsB,CAAC,CAAA;AAC7D,EAAA,IAAIE,cAAc,CAACE,MAAM,GAAG,CAAC,EAAE;AAC9BJ,IAAAA,sBAAsB,GAAGK,mBAAmB,CAC3CL,sBAAsB,EACtBE,cACD,CAAC,CAAA;AACF,GAAA;EAEAH,KAAK,KAAA,IAAA,IAALA,KAAK,KAALA,KAAAA,CAAAA,IAAAA,KAAK,CAAEO,OAAO,CAAC,UAAAC,IAAI,EAAI;AACtB,IAAA,IAAGA,IAAI,CAACC,QAAQ,KAAK,CAAC,CAAC,EAAC;AAEvB,MAAA,IAAMC,aAAa,GAAGT,sBAAsB,CAACO,IAAI,CAACC,QAAQ,CAAC,CAAA;MAE3D,IAAI,CAACC,aAAa,EAAE;QACnBC,OAAO,CAACC,KAAK,CAAAC,kCAAAA,CAAAA,MAAA,CAAoCL,IAAI,CAACC,QAAQ,CAAE,CAAC,CAAA;AACjE,QAAA,OAAA;AACD,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AAC,CAAC;AACPC,MAAAA,GAAG,EAAEC,gBAAgB,CAACJ,SAAS,CAAC;AAChCK,MAAAA,SAAS,EAAC,OAAO;AACjBC,MAAAA,MAAM,EAAE,EAAE;AACVC,MAAAA,KAAK,EAAE,EAAA;KACP,CAAA;GACD,CAAA;AACF,EAAC;AAED,SAASH,gBAAgBA,CAACJ,SAAS,EAAE;AACpC,EAAA,IAAMQ,GAAG,GAAA,yHAAA,CAAAlC,MAAA,CACgC0B,SAAS,EAC3C,iBAAA,CAAA,CAAA;AACP,EAAA,OAAA,4BAAA,CAAA1B,MAAA,CAAoCmC,IAAI,CAACD,GAAG,CAAC,CAAA,CAAA;AAC9C;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abcagency/hc-ui-components",
3
- "version": "1.3.18",
3
+ "version": "1.3.20",
4
4
  "description": "UI Components for HireControl",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -15,41 +15,46 @@
15
15
  "author": "Aloysius Butler & Clark",
16
16
  "license": "ISC",
17
17
  "peerDependencies": {
18
- "@react-google-maps/api": "^2.0.0",
18
+ "@headlessui/react": "^1.0.0",
19
+ "@iconify/react": "4.0.0",
19
20
  "@radix-ui/react-accordion": "^1.1.2",
20
21
  "@radix-ui/react-dialog": "^1.0.5",
21
22
  "@radix-ui/react-select": "^2.0.0",
22
23
  "@radix-ui/react-tabs": "^1.0.4",
23
- "@iconify/react": "^1.0.0",
24
- "@headlessui/react": "^1.0.0",
25
- "use-places-autocomplete": "^1.0.0",
26
- "fuse.js": "^7.0.0"
24
+ "@react-google-maps/api": "^2.0.0",
25
+ "fuse.js": "^7.0.0",
26
+ "use-places-autocomplete": "^1.0.0"
27
27
  },
28
28
  "devDependencies": {
29
- "cross-env": "^7.0.3",
30
- "eslint": "^8.0.0",
31
- "eslint-config-prettier": "^9.1.0",
32
- "eslint-plugin-import": "^2.29.1",
33
- "eslint-plugin-jsx-a11y": "^6.8.0",
34
- "eslint-plugin-prettier": "^5.1.3",
35
- "eslint-plugin-react": "^7.34.2",
36
- "eslint-plugin-react-hooks": "^4.6.2",
37
- "@babel/eslint-parser": "^7.24.6",
38
29
  "@babel/cli": "^7.24.6",
39
30
  "@babel/core": "^7.24.6",
31
+ "@babel/eslint-parser": "^7.24.6",
40
32
  "@babel/preset-env": "^7.24.6",
41
33
  "@babel/preset-react": "^7.24.6",
34
+ "@iconify/react": "^4.1.1",
42
35
  "@rollup/plugin-alias": "^5.1.0",
43
36
  "@rollup/plugin-babel": "^6.0.4",
44
37
  "@rollup/plugin-commonjs": "^25.0.8",
45
38
  "@rollup/plugin-node-resolve": "^15.2.3",
46
39
  "@rollup/plugin-replace": "^5.0.5",
47
- "@iconify/react": "^4.1.1",
40
+ "@rollup/plugin-typescript": "^11.1.6",
48
41
  "@tailwindcss/aspect-ratio": "^0.4.2",
49
42
  "@tailwindcss/forms": "^0.5.7",
50
43
  "@tailwindcss/typography": "^0.5.13",
44
+ "@types/node": "^20.14.2",
45
+ "@types/react": "^18.3.3",
46
+ "@typescript-eslint/eslint-plugin": "^7.13.0",
47
+ "@typescript-eslint/parser": "^7.13.0",
51
48
  "autoprefixer": "^10.4.19",
49
+ "cross-env": "^7.0.3",
52
50
  "dotenv": "^16.4.5",
51
+ "eslint": "^8.57.0",
52
+ "eslint-config-prettier": "^9.1.0",
53
+ "eslint-plugin-import": "^2.29.1",
54
+ "eslint-plugin-jsx-a11y": "^6.8.0",
55
+ "eslint-plugin-prettier": "^5.1.3",
56
+ "eslint-plugin-react": "^7.34.2",
57
+ "eslint-plugin-react-hooks": "^4.6.2",
53
58
  "postcss": "^8.4.38",
54
59
  "postcss-prefixer": "^3.0.0",
55
60
  "postcss-preset-env": "^9.5.14",
@@ -57,6 +62,7 @@
57
62
  "rollup-plugin-peer-deps-external": "^2.2.4",
58
63
  "rollup-plugin-postcss": "^4.0.2",
59
64
  "tailwindcss": "^3.4.3",
60
- "tailwindcss-animate": "^1.0.7"
65
+ "tailwindcss-animate": "^1.0.7",
66
+ "typescript": "^4.9.5"
61
67
  }
62
68
  }