@inploi/plugin-job-search 0.23.5 → 0.23.7

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 (54) hide show
  1. package/cdn/index.js +15 -15
  2. package/dist/components/alerts-button.d.ts +11 -0
  3. package/dist/components/button.d.ts +60 -0
  4. package/dist/components/current-value-tag.d.ts +10 -0
  5. package/dist/components/error-boundary.d.ts +23 -0
  6. package/dist/components/filter-content.active.d.ts +74 -0
  7. package/dist/components/filter-section.d.ts +13 -0
  8. package/dist/components/filter.d.ts +23 -0
  9. package/dist/components/icon.d.ts +28 -0
  10. package/dist/components/job-card.d.ts +13 -0
  11. package/dist/components/job-search.d.ts +24 -0
  12. package/dist/components/keyword-search.d.ts +5 -0
  13. package/dist/components/palette-debugger.d.ts +1 -0
  14. package/dist/components/results-section.d.ts +20 -0
  15. package/dist/components/skeleton-text.d.ts +3 -0
  16. package/dist/components/tag.d.ts +60 -0
  17. package/dist/datetime-3eccae90.cjs +1 -0
  18. package/dist/datetime-796d4b37.js +32 -0
  19. package/dist/index.cjs +7 -6233
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.js +3680 -4930
  22. package/dist/job-search.api.d.ts +6 -4
  23. package/dist/job-search.d.ts +3 -0
  24. package/dist/job-search.schemas.d.ts +3 -2
  25. package/dist/lib/cache-key.d.ts +7 -0
  26. package/dist/lib/cache-key.test.d.ts +1 -0
  27. package/dist/lib/currency.d.ts +10 -0
  28. package/dist/lib/currency.test.d.ts +1 -0
  29. package/dist/lib/datetime.d.ts +11 -0
  30. package/dist/lib/deep-set.d.ts +8 -0
  31. package/dist/lib/deep-set.test.d.ts +1 -0
  32. package/dist/lib/hooks.d.ts +8 -0
  33. package/dist/lib/match.d.ts +35 -0
  34. package/dist/lib/match.test.d.ts +1 -0
  35. package/dist/lib/translation.d.ts +44 -0
  36. package/dist/lib/translation.terms.d.ts +216 -0
  37. package/dist/lib/translation.test.d.ts +1 -0
  38. package/dist/lib/type-utils.d.ts +55 -0
  39. package/dist/lib/utils.d.ts +4 -0
  40. package/dist/mocks/browser.d.ts +1 -0
  41. package/dist/mocks/handlers.d.ts +15 -0
  42. package/dist/plugin-job-alerts-4b46b097.cjs +1050 -0
  43. package/dist/plugin-job-alerts-6f8dbd69.js +5613 -0
  44. package/dist/style/theme.d.ts +3 -0
  45. package/dist/style/theme.utils.d.ts +6 -0
  46. package/dist/style/tokens.d.ts +149 -0
  47. package/dist/style.css +1 -1742
  48. package/dist/utils.cjs +1 -18
  49. package/dist/utils.js +12 -13
  50. package/package.json +2 -2
  51. package/dist/datetime-5adbbd63.cjs +0 -55
  52. package/dist/datetime-ef341067.js +0 -56
  53. package/dist/plugin-job-alerts-2ce58f09.js +0 -6040
  54. package/dist/plugin-job-alerts-e8471004.cjs +0 -6040
@@ -0,0 +1,11 @@
1
+ import { AnalyticsService, ApiClient, Logger } from '@inploi/sdk';
2
+ import { JobSearchPluginParams } from '..';
3
+ import { FilterValue } from './filter';
4
+
5
+ export declare const AlertsButton: ({ analytics, apiClient, logger, theme, appliedFilters, }: {
6
+ analytics: AnalyticsService;
7
+ apiClient: ApiClient;
8
+ logger: Logger;
9
+ theme: JobSearchPluginParams['theme'];
10
+ appliedFilters: Record<string, FilterValue | undefined>;
11
+ }) => import("preact").JSX.Element;
@@ -0,0 +1,60 @@
1
+ export declare const btnClass: (props?: ({
2
+ variant?: "neutral" | "accent" | undefined;
3
+ icon?: "none" | "right" | "left" | "only" | undefined;
4
+ position?: "relative" | "absolute" | undefined;
5
+ size?: "sm" | "lg" | undefined;
6
+ } & ({
7
+ class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
8
+ [x: string]: any;
9
+ } | null | undefined)[] | {
10
+ [x: string]: any;
11
+ } | null | undefined)[] | {
12
+ [x: string]: any;
13
+ } | null | undefined)[] | {
14
+ [x: string]: any;
15
+ } | null | undefined)[] | {
16
+ [x: string]: any;
17
+ } | null | undefined)[] | {
18
+ [x: string]: any;
19
+ } | null | undefined)[] | {
20
+ [x: string]: any;
21
+ } | null | undefined)[] | {
22
+ [x: string]: any;
23
+ } | null | undefined)[] | {
24
+ [x: string]: any;
25
+ } | null | undefined)[] | {
26
+ [x: string]: any;
27
+ } | null | undefined)[] | {
28
+ [x: string]: any;
29
+ } | null | undefined)[] | {
30
+ [x: string]: any;
31
+ } | null | undefined;
32
+ className?: undefined;
33
+ } | {
34
+ class?: undefined;
35
+ className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
36
+ [x: string]: any;
37
+ } | null | undefined)[] | {
38
+ [x: string]: any;
39
+ } | null | undefined)[] | {
40
+ [x: string]: any;
41
+ } | null | undefined)[] | {
42
+ [x: string]: any;
43
+ } | null | undefined)[] | {
44
+ [x: string]: any;
45
+ } | null | undefined)[] | {
46
+ [x: string]: any;
47
+ } | null | undefined)[] | {
48
+ [x: string]: any;
49
+ } | null | undefined)[] | {
50
+ [x: string]: any;
51
+ } | null | undefined)[] | {
52
+ [x: string]: any;
53
+ } | null | undefined)[] | {
54
+ [x: string]: any;
55
+ } | null | undefined)[] | {
56
+ [x: string]: any;
57
+ } | null | undefined)[] | {
58
+ [x: string]: any;
59
+ } | null | undefined;
60
+ })) | undefined) => string;
@@ -0,0 +1,10 @@
1
+ import { FilterProperty } from '../job-search';
2
+ import { GetAvailableFiltersResponse, QueryState } from '../job-search.api';
3
+
4
+ type CurrentValueTagProps = {
5
+ query: QueryState<GetAvailableFiltersResponse>;
6
+ property: FilterProperty;
7
+ selectedValues: string[];
8
+ };
9
+ export declare const CurrentValueTag: ({ query, property, selectedValues }: CurrentValueTagProps) => import("preact").JSX.Element | null;
10
+ export {};
@@ -0,0 +1,23 @@
1
+ import { Component, ComponentProps, FunctionComponent, VNode } from 'preact';
2
+
3
+ type ErrorBoundaryProps = {
4
+ children?: VNode | VNode[];
5
+ Fallback: FunctionComponent<FallbackProps>;
6
+ };
7
+ type FallbackProps = {
8
+ error: Error;
9
+ resetError: () => void;
10
+ };
11
+ export declare const UnstyledErrorView: ({ error, resetError }: FallbackProps) => import("preact").JSX.Element;
12
+ export declare const ErrorView: ({ error, resetError, class: className, ...props }: FallbackProps & ComponentProps<'div'>) => import("preact").JSX.Element;
13
+ export declare class ErrorBoundary extends Component<ErrorBoundaryProps> {
14
+ state: {
15
+ error: Error | null;
16
+ };
17
+ static getDerivedStateFromError(error: Error): {
18
+ error: string;
19
+ };
20
+ componentDidCatch(error: Error): void;
21
+ render(): import("preact").JSX.Element | (VNode<{}> & object) | (VNode<{}>[] & object) | undefined;
22
+ }
23
+ export {};
@@ -0,0 +1,74 @@
1
+ import { SWRResponse } from 'swr';
2
+ import { FilterProperty } from '../job-search';
3
+ import { GetAvailableFiltersResponse, QueryState } from '../job-search.api';
4
+ import { FilterValue } from './filter';
5
+
6
+ export declare const inputClass: (props?: ({
7
+ hasValue?: boolean | undefined;
8
+ size?: "md" | "unsized" | undefined;
9
+ } & ({
10
+ class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
11
+ [x: string]: any;
12
+ } | null | undefined)[] | {
13
+ [x: string]: any;
14
+ } | null | undefined)[] | {
15
+ [x: string]: any;
16
+ } | null | undefined)[] | {
17
+ [x: string]: any;
18
+ } | null | undefined)[] | {
19
+ [x: string]: any;
20
+ } | null | undefined)[] | {
21
+ [x: string]: any;
22
+ } | null | undefined)[] | {
23
+ [x: string]: any;
24
+ } | null | undefined)[] | {
25
+ [x: string]: any;
26
+ } | null | undefined)[] | {
27
+ [x: string]: any;
28
+ } | null | undefined)[] | {
29
+ [x: string]: any;
30
+ } | null | undefined)[] | {
31
+ [x: string]: any;
32
+ } | null | undefined)[] | {
33
+ [x: string]: any;
34
+ } | null | undefined;
35
+ className?: undefined;
36
+ } | {
37
+ class?: undefined;
38
+ className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
39
+ [x: string]: any;
40
+ } | null | undefined)[] | {
41
+ [x: string]: any;
42
+ } | null | undefined)[] | {
43
+ [x: string]: any;
44
+ } | null | undefined)[] | {
45
+ [x: string]: any;
46
+ } | null | undefined)[] | {
47
+ [x: string]: any;
48
+ } | null | undefined)[] | {
49
+ [x: string]: any;
50
+ } | null | undefined)[] | {
51
+ [x: string]: any;
52
+ } | null | undefined)[] | {
53
+ [x: string]: any;
54
+ } | null | undefined)[] | {
55
+ [x: string]: any;
56
+ } | null | undefined)[] | {
57
+ [x: string]: any;
58
+ } | null | undefined)[] | {
59
+ [x: string]: any;
60
+ } | null | undefined)[] | {
61
+ [x: string]: any;
62
+ } | null | undefined;
63
+ })) | undefined) => string;
64
+ type FilterContentActiveProps = {
65
+ value: FilterValue;
66
+ property: FilterProperty;
67
+ unfilteredQuery: QueryState<GetAvailableFiltersResponse>;
68
+ onSkip: () => void;
69
+ onValueChange: (value: FilterValue | undefined) => void;
70
+ onRender: () => void;
71
+ useQuery: () => SWRResponse<GetAvailableFiltersResponse>;
72
+ };
73
+ export declare const FilterContentActive: ({ value, property, onSkip, useQuery, onValueChange, unfilteredQuery, onRender, }: FilterContentActiveProps) => import("preact").JSX.Element;
74
+ export {};
@@ -0,0 +1,13 @@
1
+ import { ApiClient, Logger } from '@inploi/sdk';
2
+ import { FilterProperty } from '..';
3
+ import { FilterValue } from './filter';
4
+
5
+ type FilterSectionProps = {
6
+ properties: FilterProperty[];
7
+ appliedFilters: Record<string, FilterValue | undefined>;
8
+ onFilterValueChange: (key: string, value: FilterValue | undefined) => void;
9
+ apiClient: ApiClient;
10
+ logger: Logger;
11
+ };
12
+ export declare const FilterSection: ({ properties, appliedFilters, onFilterValueChange, apiClient, logger, }: FilterSectionProps) => import("preact").JSX.Element;
13
+ export {};
@@ -0,0 +1,23 @@
1
+ import { SWRResponse } from 'swr';
2
+ import { GetAvailableFiltersResponse, QueryState } from '../job-search.api';
3
+ import { FilterProperty } from '..';
4
+
5
+ export type FilterValue = {
6
+ select: 'one';
7
+ value: string | undefined;
8
+ } | {
9
+ select: 'many';
10
+ value: string[] | undefined;
11
+ };
12
+ export declare const getSelectedValues: (current: FilterValue) => string[];
13
+ export type FilterProps = {
14
+ active: boolean;
15
+ value: FilterValue;
16
+ unfilteredQuery: QueryState<GetAvailableFiltersResponse>;
17
+ onActiveChange: (active: boolean) => void;
18
+ property: FilterProperty;
19
+ onSkip: () => void;
20
+ onValueChange: (value: FilterValue | undefined) => void;
21
+ useQuery: () => SWRResponse<GetAvailableFiltersResponse>;
22
+ };
23
+ export declare const Filter: ({ active, value, onActiveChange, property, onSkip, onValueChange, unfilteredQuery, useQuery, }: FilterProps) => import("preact").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { ComponentProps } from 'preact';
2
+ import { JobSearchPluginParams } from '../job-search';
3
+
4
+ declare const icons: {
5
+ briefcase: import("preact").JSX.Element;
6
+ brand: import("preact").JSX.Element;
7
+ building: import("preact").JSX.Element;
8
+ circles: import("preact").JSX.Element;
9
+ clock: import("preact").JSX.Element;
10
+ filter: import("preact").JSX.Element;
11
+ globe: import("preact").JSX.Element;
12
+ magnifier: import("preact").JSX.Element;
13
+ magnifierSimple: import("preact").JSX.Element;
14
+ mapPin: import("preact").JSX.Element;
15
+ pay: import("preact").JSX.Element;
16
+ sunset: import("preact").JSX.Element;
17
+ x: import("preact").JSX.Element;
18
+ plus: import("preact").JSX.Element;
19
+ 'chevron-right': import("preact").JSX.Element;
20
+ };
21
+ export type IconName = keyof typeof icons;
22
+ export declare const IconSpritesheet: ({ theme }: {
23
+ theme: JobSearchPluginParams['theme'];
24
+ }) => import("preact").JSX.Element;
25
+ export declare const Icon: ({ name, ...props }: {
26
+ name: IconName;
27
+ } & ComponentProps<'svg'>) => import("preact").JSX.Element;
28
+ export {};
@@ -0,0 +1,13 @@
1
+ import { JobSchema } from '../job-search.schemas';
2
+ import { JobSearchPluginParams } from '../job-search.ts';
3
+
4
+ export declare const JobCard: ({ job, config, onJobClick, }: {
5
+ job: JobSchema;
6
+ config: JobSearchPluginParams['jobCard'];
7
+ onJobClick?: (job: JobSchema) => void;
8
+ }) => import("preact/compat").JSX.Element;
9
+ export declare const JobCardSkeleton: ({ config, animationDelay, seed, }: {
10
+ config: JobSearchPluginParams['jobCard'];
11
+ animationDelay: number;
12
+ seed: number;
13
+ }) => import("preact/compat").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { AnalyticsService, ApiClient, Logger } from '@inploi/sdk';
2
+ import { JobSearchPluginParams } from '../job-search';
3
+ import { getJobSearchResults } from '../job-search.api';
4
+ import { FilterValue } from './filter';
5
+
6
+ type JobSearchProps = {
7
+ properties: JobSearchPluginParams['properties'];
8
+ apiClient: ApiClient;
9
+ logger: Logger;
10
+ analytics: AnalyticsService;
11
+ class?: string;
12
+ params: JobSearchPluginParams;
13
+ initialData?: {
14
+ jobs: Awaited<ReturnType<typeof getJobSearchResults>>;
15
+ };
16
+ onFilterChange?: (params: Record<string, FilterValue | undefined>) => void;
17
+ onKeywordChange?: (keyword: string | undefined) => void;
18
+ onResultsUpdate?: (data: {
19
+ totalCount: number;
20
+ }) => void;
21
+ };
22
+ export declare const getFilterDefaults: (properties: JobSearchPluginParams['properties'], field?: 'value' | 'defaultValue') => Record<string, FilterValue | undefined>;
23
+ export declare const JobSearch: ({ apiClient, logger, properties, class: className, analytics, initialData, onFilterChange, onKeywordChange, params, }: JobSearchProps) => import("preact").JSX.Element;
24
+ export {};
@@ -0,0 +1,5 @@
1
+ type KeywordSearchProps = {
2
+ onKeywordChange?: (keyword: string | undefined) => void;
3
+ };
4
+ export declare const KeywordSearch: ({ onKeywordChange }: KeywordSearchProps) => import("preact").JSX.Element;
5
+ export {};
@@ -0,0 +1 @@
1
+ export declare const PaletteDebugger: () => import("preact").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { ApiClient, Logger } from '@inploi/sdk';
2
+ import { getJobSearchResults } from '../job-search.api';
3
+ import { JobSchema } from '../job-search.schemas';
4
+ import { JobSearchPluginParams } from '../job-search.ts';
5
+ import { FilterValue } from './filter';
6
+
7
+ type ResultsSectionProps = {
8
+ appliedFilters: Record<string, FilterValue | undefined>;
9
+ apiClient: ApiClient;
10
+ logger: Logger;
11
+ jobCardConfig: JobSearchPluginParams['jobCard'];
12
+ initialData?: Awaited<ReturnType<typeof getJobSearchResults>>;
13
+ onResultsUpdate?: (data: {
14
+ totalCount: number;
15
+ }) => void;
16
+ onJobClick: (job: JobSchema, page: number) => void;
17
+ onPaginate: (page: number) => void;
18
+ };
19
+ export declare const ResultsSection: ({ appliedFilters, apiClient, logger, jobCardConfig, initialData, onResultsUpdate, onJobClick, onPaginate, }: ResultsSectionProps) => import("preact").JSX.Element;
20
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const SkeletonText: ({ chars }: {
2
+ chars: number;
3
+ }) => import("preact").JSX.Element;
@@ -0,0 +1,60 @@
1
+ export declare const tagClass: (props?: ({
2
+ variant?: "neutralWeak" | "neutralStrong" | "accentStrong" | "monetaryWeak" | undefined;
3
+ interactive?: boolean | undefined;
4
+ size?: "xs" | "sm" | "lg" | undefined;
5
+ disabled?: boolean | undefined;
6
+ } & ({
7
+ class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
8
+ [x: string]: any;
9
+ } | null | undefined)[] | {
10
+ [x: string]: any;
11
+ } | null | undefined)[] | {
12
+ [x: string]: any;
13
+ } | null | undefined)[] | {
14
+ [x: string]: any;
15
+ } | null | undefined)[] | {
16
+ [x: string]: any;
17
+ } | null | undefined)[] | {
18
+ [x: string]: any;
19
+ } | null | undefined)[] | {
20
+ [x: string]: any;
21
+ } | null | undefined)[] | {
22
+ [x: string]: any;
23
+ } | null | undefined)[] | {
24
+ [x: string]: any;
25
+ } | null | undefined)[] | {
26
+ [x: string]: any;
27
+ } | null | undefined)[] | {
28
+ [x: string]: any;
29
+ } | null | undefined)[] | {
30
+ [x: string]: any;
31
+ } | null | undefined;
32
+ className?: undefined;
33
+ } | {
34
+ class?: undefined;
35
+ className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
36
+ [x: string]: any;
37
+ } | null | undefined)[] | {
38
+ [x: string]: any;
39
+ } | null | undefined)[] | {
40
+ [x: string]: any;
41
+ } | null | undefined)[] | {
42
+ [x: string]: any;
43
+ } | null | undefined)[] | {
44
+ [x: string]: any;
45
+ } | null | undefined)[] | {
46
+ [x: string]: any;
47
+ } | null | undefined)[] | {
48
+ [x: string]: any;
49
+ } | null | undefined)[] | {
50
+ [x: string]: any;
51
+ } | null | undefined)[] | {
52
+ [x: string]: any;
53
+ } | null | undefined)[] | {
54
+ [x: string]: any;
55
+ } | null | undefined)[] | {
56
+ [x: string]: any;
57
+ } | null | undefined)[] | {
58
+ [x: string]: any;
59
+ } | null | undefined;
60
+ })) | undefined) => string;
@@ -0,0 +1 @@
1
+ "use strict";const y={ANNUALLY:"per year",DAILY:"per day",HOURLY:"per hour",MONTHLY:"per month",WEEKLY:"per week"},s=a=>{const{salary:e,config:i}=a,t=new Intl.NumberFormat(i.locales,{style:"currency",currency:e.pay_currency,trailingZeroDisplay:"stripIfInteger"});if(e.pay_display===!1)return;if(e.pay_mask)return a.t("competitive");if(e.pay_max&&isNaN(+e.pay_max)||e.pay_min&&isNaN(+e.pay_min)||e.pay&&isNaN(+e.pay))return a.t("invalid_salary");const r=e.pay_type&&e.pay_type in y?y[e.pay_type]:void 0;return e.pay?[t.format(+e.pay),r].filter(Boolean).join(" "):e.pay_max&&e.pay_min?[t.formatRange(+e.pay_min,+e.pay_max),r].filter(Boolean).join(" "):e.pay_max?a.t("up_to")+" "+[t.format(+e.pay_max),r].filter(Boolean).join(" "):e.pay_min?a.t("from")+" "+[t.format(+e.pay_min),r].filter(Boolean).join(" "):a.t("invalid_salary")},f=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"}),l=({from:a=new Date,to:e,formatter:i=f,t})=>{const o=(e instanceof Date?e:new Date(e)).getTime()-a.getTime(),n={days:Math.round(o/1e3/60/60/24),months:Math.round(o/1e3/60/60/24/30)};return n.days===0?t("today"):Math.abs(n.days)<30?i.format(n.days,"days"):Math.abs(n.days)<3?i.format(n.months,"months"):n.months<0?t("over_30_days_ago"):t("in_over_30_days")};exports.getRelativeTimeDifference=l;exports.getSalaryAsText=s;
@@ -0,0 +1,32 @@
1
+ const y = {
2
+ ANNUALLY: "per year",
3
+ DAILY: "per day",
4
+ HOURLY: "per hour",
5
+ MONTHLY: "per month",
6
+ WEEKLY: "per week"
7
+ }, f = (e) => {
8
+ const { salary: a, config: i } = e, t = new Intl.NumberFormat(i.locales, {
9
+ style: "currency",
10
+ currency: a.pay_currency,
11
+ // @ts-expect-error - it exists, but TS doesn't know it
12
+ trailingZeroDisplay: "stripIfInteger"
13
+ });
14
+ if (a.pay_display === !1)
15
+ return;
16
+ if (a.pay_mask)
17
+ return e.t("competitive");
18
+ if (a.pay_max && isNaN(+a.pay_max) || a.pay_min && isNaN(+a.pay_min) || a.pay && isNaN(+a.pay))
19
+ return e.t("invalid_salary");
20
+ const r = a.pay_type && a.pay_type in y ? y[a.pay_type] : void 0;
21
+ return a.pay ? [t.format(+a.pay), r].filter(Boolean).join(" ") : a.pay_max && a.pay_min ? [t.formatRange(+a.pay_min, +a.pay_max), r].filter(Boolean).join(" ") : a.pay_max ? e.t("up_to") + " " + [t.format(+a.pay_max), r].filter(Boolean).join(" ") : a.pay_min ? e.t("from") + " " + [t.format(+a.pay_min), r].filter(Boolean).join(" ") : e.t("invalid_salary");
22
+ }, s = new Intl.RelativeTimeFormat(void 0, { numeric: "auto" }), p = ({ from: e = /* @__PURE__ */ new Date(), to: a, formatter: i = s, t }) => {
23
+ const o = (a instanceof Date ? a : new Date(a)).getTime() - e.getTime(), n = {
24
+ days: Math.round(o / 1e3 / 60 / 60 / 24),
25
+ months: Math.round(o / 1e3 / 60 / 60 / 24 / 30)
26
+ };
27
+ return n.days === 0 ? t("today") : Math.abs(n.days) < 30 ? i.format(n.days, "days") : Math.abs(n.days) < 3 ? i.format(n.months, "months") : n.months < 0 ? t("over_30_days_ago") : t("in_over_30_days");
28
+ };
29
+ export {
30
+ p as a,
31
+ f as g
32
+ };