@agg-build/ui 1.3.0 → 2.1.0
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.
- package/dist/{chunk-ONVP7YWS.mjs → chunk-3OI2ZLLT.mjs} +94 -39
- package/dist/{chunk-UFC7L74C.mjs → chunk-C5M2OOM3.mjs} +1 -1
- package/dist/{chunk-QUZWA34R.mjs → chunk-DXF2LMNN.mjs} +512 -503
- package/dist/{chunk-5ALBEKAT.mjs → chunk-R6FBYAY5.mjs} +246 -194
- package/dist/{chunk-6PQ6O6M5.mjs → chunk-Y6PVXAUQ.mjs} +34 -90
- package/dist/{chunk-YWJIYEJV.mjs → chunk-YAEA6EDG.mjs} +31 -18
- package/dist/{chunk-55ODXLOS.mjs → chunk-YMVD6Q2A.mjs} +1 -1
- package/dist/events.js +894 -903
- package/dist/events.mjs +3 -3
- package/dist/index.js +2609 -2530
- package/dist/index.mjs +9 -7
- package/dist/modals.js +278 -171
- package/dist/modals.mjs +5 -3
- package/dist/pages.js +2014 -1991
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +526 -475
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +28 -15
- package/dist/trading.mjs +4 -4
- package/dist/types/events/list/category-sidebar.d.mts +33 -0
- package/dist/types/events/list/category-sidebar.d.ts +33 -0
- package/dist/types/events/list/event-list-tabs.d.mts +2 -0
- package/dist/types/events/list/event-list-tabs.d.ts +2 -0
- package/dist/types/events/list/event-list.utils.d.mts +0 -4
- package/dist/types/events/list/event-list.utils.d.ts +0 -4
- package/dist/types/events/list/index.d.mts +1 -0
- package/dist/types/events/list/index.d.ts +1 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +1 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +1 -0
- package/dist/types/pages/user-profile/index.d.mts +1 -1
- package/dist/types/pages/user-profile/index.d.ts +1 -1
- package/dist/types/pages/user-profile/user-profile.types.d.mts +1 -0
- package/dist/types/pages/user-profile/user-profile.types.d.ts +1 -0
- package/dist/types/shared/use-horizontal-scroll-state.d.mts +15 -0
- package/dist/types/shared/use-horizontal-scroll-state.d.ts +15 -0
- package/dist/types/withdraw/index.d.mts +9 -1
- package/dist/types/withdraw/index.d.ts +9 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +10 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +10 -1
- package/dist/types/withdraw/withdraw-modal.types.d.mts +8 -0
- package/dist/types/withdraw/withdraw-modal.types.d.ts +8 -0
- package/package.json +3 -3
|
@@ -22,12 +22,13 @@ import {
|
|
|
22
22
|
resolveUnifiedOrderBookEntries,
|
|
23
23
|
sortOutcomeSelectorOutcomes,
|
|
24
24
|
useEventTradingContext
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-C5M2OOM3.mjs";
|
|
26
26
|
import {
|
|
27
27
|
AutocompleteSelect,
|
|
28
28
|
Badge,
|
|
29
29
|
Button,
|
|
30
30
|
Card,
|
|
31
|
+
CloseIcon,
|
|
31
32
|
Icon,
|
|
32
33
|
LineChart,
|
|
33
34
|
MOBILE_TABS_MEDIA_QUERY,
|
|
@@ -69,11 +70,9 @@ import {
|
|
|
69
70
|
resolveVenueLabel,
|
|
70
71
|
resolveYesOutcome,
|
|
71
72
|
sortCategoriesForNavigation,
|
|
72
|
-
sortMarketsByVolumeDesc,
|
|
73
|
-
sortMarketsByYesOddsDesc,
|
|
74
73
|
sortOutcomes,
|
|
75
74
|
splitEventsByLifecycle
|
|
76
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-DXF2LMNN.mjs";
|
|
77
76
|
|
|
78
77
|
// src/events/item/index.tsx
|
|
79
78
|
import {
|
|
@@ -127,7 +126,7 @@ var resolveOutcomeRows = ({
|
|
|
127
126
|
outcome
|
|
128
127
|
}));
|
|
129
128
|
}
|
|
130
|
-
return
|
|
129
|
+
return venueMarkets.map((market) => {
|
|
131
130
|
const outcome = resolveDisplayOutcome(market);
|
|
132
131
|
if (!outcome) return void 0;
|
|
133
132
|
return {
|
|
@@ -2484,13 +2483,12 @@ var EventListItemDetailsContent = ({
|
|
|
2484
2483
|
() => resolvedEventTradingState.displayMarkets,
|
|
2485
2484
|
[resolvedEventTradingState.displayMarkets]
|
|
2486
2485
|
);
|
|
2487
|
-
const sortedVenueMarkets = useMemo5(() => sortMarketsByVolumeDesc(venueMarkets), [venueMarkets]);
|
|
2488
2486
|
const marketOptions = useMemo5(
|
|
2489
|
-
() =>
|
|
2487
|
+
() => venueMarkets.map((vm) => ({
|
|
2490
2488
|
value: vm.id,
|
|
2491
2489
|
label: vm.question
|
|
2492
2490
|
})),
|
|
2493
|
-
[
|
|
2491
|
+
[venueMarkets]
|
|
2494
2492
|
);
|
|
2495
2493
|
const volumeLabel = useMemo5(() => {
|
|
2496
2494
|
const resolvedVolume = resolveDisplayVolume(event.volume, venueMarkets);
|
|
@@ -4497,8 +4495,7 @@ var MarketDetailsList = ({
|
|
|
4497
4495
|
return resolveIsResolvedEvent(sourceMarkets, eventTradingState);
|
|
4498
4496
|
}, [eventTradingState, sourceMarkets]);
|
|
4499
4497
|
const groupedMarkets = useMemo6(() => {
|
|
4500
|
-
|
|
4501
|
-
if (sortedMarkets.length === 0) {
|
|
4498
|
+
if (sourceMarkets.length === 0) {
|
|
4502
4499
|
return {
|
|
4503
4500
|
primary: [],
|
|
4504
4501
|
closed: [],
|
|
@@ -4507,9 +4504,9 @@ var MarketDetailsList = ({
|
|
|
4507
4504
|
};
|
|
4508
4505
|
}
|
|
4509
4506
|
if (isResolvedEvent) {
|
|
4510
|
-
const winnerMarketId = resolveResolvedWinnerMarketId(
|
|
4507
|
+
const winnerMarketId = resolveResolvedWinnerMarketId(sourceMarkets, eventTradingState);
|
|
4511
4508
|
return {
|
|
4512
|
-
primary: moveMarketToFront(
|
|
4509
|
+
primary: moveMarketToFront(sourceMarkets, winnerMarketId),
|
|
4513
4510
|
upcoming: [],
|
|
4514
4511
|
resolved: []
|
|
4515
4512
|
};
|
|
@@ -4518,7 +4515,7 @@ var MarketDetailsList = ({
|
|
|
4518
4515
|
const upcoming = [];
|
|
4519
4516
|
const resolved = [];
|
|
4520
4517
|
const closed = [];
|
|
4521
|
-
|
|
4518
|
+
sourceMarkets.forEach((market) => {
|
|
4522
4519
|
const marketStateKind = resolveMarketTradingState(market).kind;
|
|
4523
4520
|
if (marketStateKind === "resolved") {
|
|
4524
4521
|
resolved.push(market);
|
|
@@ -4696,11 +4693,128 @@ import {
|
|
|
4696
4693
|
} from "@agg-build/hooks";
|
|
4697
4694
|
import { VENUES } from "@agg-build/sdk";
|
|
4698
4695
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
4699
|
-
import { useEffect as useEffect6, useMemo as
|
|
4696
|
+
import { useEffect as useEffect6, useMemo as useMemo9, useRef as useRef7, useState as useState6 } from "react";
|
|
4697
|
+
|
|
4698
|
+
// src/events/list/category-sidebar.tsx
|
|
4699
|
+
import { useMemo as useMemo7 } from "react";
|
|
4700
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
4701
|
+
var rowBase = cn(
|
|
4702
|
+
"flex min-h-11 w-full items-center gap-3 rounded-[6px] px-3 py-3",
|
|
4703
|
+
"text-left text-agg-sm font-agg-normal leading-agg-5",
|
|
4704
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-1 focus-visible:ring-offset-agg-secondary"
|
|
4705
|
+
);
|
|
4706
|
+
var idleRowClassName = cn(
|
|
4707
|
+
rowBase,
|
|
4708
|
+
"cursor-pointer text-agg-foreground hover:bg-agg-secondary-hover"
|
|
4709
|
+
);
|
|
4710
|
+
var selectedRowClassName = cn(rowBase, "cursor-pointer bg-agg-primary/10 text-agg-primary");
|
|
4711
|
+
var CategorySidebar = ({
|
|
4712
|
+
baseCategoryId,
|
|
4713
|
+
childrenByParentId,
|
|
4714
|
+
categoryPath,
|
|
4715
|
+
collapsedCategoryIds,
|
|
4716
|
+
totalEventCount,
|
|
4717
|
+
labels,
|
|
4718
|
+
onSelectAll,
|
|
4719
|
+
onToggleCategory
|
|
4720
|
+
}) => {
|
|
4721
|
+
const isDrilledIn = categoryPath.length > 0;
|
|
4722
|
+
const sortedBaseChildren = useMemo7(() => {
|
|
4723
|
+
var _a;
|
|
4724
|
+
if (!baseCategoryId) return [];
|
|
4725
|
+
const children = [...(_a = childrenByParentId.get(baseCategoryId)) != null ? _a : []];
|
|
4726
|
+
return children.sort((a, b) => {
|
|
4727
|
+
var _a2, _b, _c, _d;
|
|
4728
|
+
const aHasChildren = ((_b = (_a2 = childrenByParentId.get(a.id)) == null ? void 0 : _a2.length) != null ? _b : 0) > 0;
|
|
4729
|
+
const bHasChildren = ((_d = (_c = childrenByParentId.get(b.id)) == null ? void 0 : _c.length) != null ? _d : 0) > 0;
|
|
4730
|
+
if (aHasChildren === bHasChildren) return 0;
|
|
4731
|
+
return aHasChildren ? -1 : 1;
|
|
4732
|
+
});
|
|
4733
|
+
}, [baseCategoryId, childrenByParentId]);
|
|
4734
|
+
const renderRow = ({
|
|
4735
|
+
entry,
|
|
4736
|
+
isExpanded,
|
|
4737
|
+
isSelected,
|
|
4738
|
+
onClick
|
|
4739
|
+
}) => {
|
|
4740
|
+
var _a, _b;
|
|
4741
|
+
const hasKnownChildren = ((_b = (_a = childrenByParentId.get(entry.id)) == null ? void 0 : _a.length) != null ? _b : 0) > 0;
|
|
4742
|
+
return /* @__PURE__ */ jsxs8(
|
|
4743
|
+
"button",
|
|
4744
|
+
{
|
|
4745
|
+
type: "button",
|
|
4746
|
+
"aria-current": isSelected ? "true" : void 0,
|
|
4747
|
+
className: isSelected ? selectedRowClassName : idleRowClassName,
|
|
4748
|
+
onClick,
|
|
4749
|
+
children: [
|
|
4750
|
+
/* @__PURE__ */ jsx10("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: entry.label }),
|
|
4751
|
+
hasKnownChildren ? /* @__PURE__ */ jsx10(
|
|
4752
|
+
Icon,
|
|
4753
|
+
{
|
|
4754
|
+
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
4755
|
+
size: "small",
|
|
4756
|
+
color: "currentColor",
|
|
4757
|
+
className: "shrink-0 text-agg-muted-foreground"
|
|
4758
|
+
}
|
|
4759
|
+
) : /* @__PURE__ */ jsx10("span", { className: "shrink-0 text-agg-muted-foreground", children: entry.eventCount })
|
|
4760
|
+
]
|
|
4761
|
+
},
|
|
4762
|
+
entry.id
|
|
4763
|
+
);
|
|
4764
|
+
};
|
|
4765
|
+
const renderBranch = (category, depth) => {
|
|
4766
|
+
var _a, _b, _c, _d, _e;
|
|
4767
|
+
const label = (_a = category.displayName) != null ? _a : category.name;
|
|
4768
|
+
const entry = {
|
|
4769
|
+
id: category.id,
|
|
4770
|
+
label,
|
|
4771
|
+
eventCount: (_b = category.eventCount) != null ? _b : 0
|
|
4772
|
+
};
|
|
4773
|
+
const childCategories = (_c = childrenByParentId.get(category.id)) != null ? _c : [];
|
|
4774
|
+
const hasKnownChildren = childCategories.length > 0;
|
|
4775
|
+
const isExpanded = ((_d = categoryPath[depth]) == null ? void 0 : _d.id) === category.id && !collapsedCategoryIds.has(category.id);
|
|
4776
|
+
const isSelected = ((_e = categoryPath[depth]) == null ? void 0 : _e.id) === category.id && categoryPath.length === depth + 1;
|
|
4777
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex w-full flex-col", children: [
|
|
4778
|
+
renderRow({
|
|
4779
|
+
entry,
|
|
4780
|
+
isExpanded,
|
|
4781
|
+
isSelected,
|
|
4782
|
+
onClick: () => onToggleCategory({ entry, depth, hasKnownChildren, isExpanded, isSelected })
|
|
4783
|
+
}),
|
|
4784
|
+
/* @__PURE__ */ jsx10(
|
|
4785
|
+
"div",
|
|
4786
|
+
{
|
|
4787
|
+
className: cn(
|
|
4788
|
+
"grid transition-[grid-template-rows] duration-150 ease-in-out motion-reduce:transition-none",
|
|
4789
|
+
isExpanded ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
4790
|
+
),
|
|
4791
|
+
children: /* @__PURE__ */ jsx10("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx10("div", { className: "flex w-full flex-col gap-1 pl-4 pt-1", children: childCategories.map((child) => renderBranch(child, depth + 1)) }) })
|
|
4792
|
+
}
|
|
4793
|
+
)
|
|
4794
|
+
] }, category.id);
|
|
4795
|
+
};
|
|
4796
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex w-full flex-col gap-1", children: [
|
|
4797
|
+
/* @__PURE__ */ jsxs8(
|
|
4798
|
+
"button",
|
|
4799
|
+
{
|
|
4800
|
+
type: "button",
|
|
4801
|
+
"aria-current": !isDrilledIn ? "true" : void 0,
|
|
4802
|
+
className: !isDrilledIn ? selectedRowClassName : idleRowClassName,
|
|
4803
|
+
onClick: onSelectAll,
|
|
4804
|
+
children: [
|
|
4805
|
+
/* @__PURE__ */ jsx10("span", { className: "min-w-0 flex-1 truncate", children: labels.subcategoriesAll }),
|
|
4806
|
+
/* @__PURE__ */ jsx10("span", { className: "shrink-0 text-agg-muted-foreground", children: totalEventCount })
|
|
4807
|
+
]
|
|
4808
|
+
}
|
|
4809
|
+
),
|
|
4810
|
+
sortedBaseChildren.map((category) => renderBranch(category, 0))
|
|
4811
|
+
] });
|
|
4812
|
+
};
|
|
4813
|
+
CategorySidebar.displayName = "CategorySidebar";
|
|
4700
4814
|
|
|
4701
4815
|
// src/events/list/event-list-tabs.tsx
|
|
4702
4816
|
import { getVenueAvailabilityState, useAppConfig, useGeoBlock, useLabels as useLabels7 } from "@agg-build/hooks";
|
|
4703
|
-
import { useCallback as useCallback3, useEffect as useEffect5, useMemo as
|
|
4817
|
+
import { useCallback as useCallback3, useEffect as useEffect5, useMemo as useMemo8, useRef as useRef6, useState as useState5 } from "react";
|
|
4704
4818
|
|
|
4705
4819
|
// src/events/list/event-list.constants.ts
|
|
4706
4820
|
import { MatchStatus, Venue as Venue2 } from "@agg-build/sdk";
|
|
@@ -4767,16 +4881,16 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
4767
4881
|
};
|
|
4768
4882
|
|
|
4769
4883
|
// src/events/list/event-list-tabs.tsx
|
|
4770
|
-
import { jsx as
|
|
4884
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
4771
4885
|
var renderTabIcon = (tab, isActive) => {
|
|
4772
4886
|
if (tab.iconName === "warning-filled") {
|
|
4773
|
-
return /* @__PURE__ */
|
|
4887
|
+
return /* @__PURE__ */ jsx11(Icon, { name: "warning-filled", size: "small", color: "currentColor" });
|
|
4774
4888
|
}
|
|
4775
4889
|
if (tab.venueLogo) {
|
|
4776
|
-
return /* @__PURE__ */
|
|
4890
|
+
return /* @__PURE__ */ jsx11(VenueLogo, { venue: tab.venueLogo, size: "small" });
|
|
4777
4891
|
}
|
|
4778
4892
|
if (!tab.iconName) return null;
|
|
4779
|
-
return /* @__PURE__ */
|
|
4893
|
+
return /* @__PURE__ */ jsx11(
|
|
4780
4894
|
Icon,
|
|
4781
4895
|
{
|
|
4782
4896
|
name: tab.iconName,
|
|
@@ -4789,7 +4903,7 @@ var useEventListTabs = (tabs) => {
|
|
|
4789
4903
|
const labels = useLabels7();
|
|
4790
4904
|
const { disabledVenues } = useAppConfig();
|
|
4791
4905
|
const { isLocationBlocked } = useGeoBlock();
|
|
4792
|
-
return
|
|
4906
|
+
return useMemo8(() => {
|
|
4793
4907
|
const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
|
|
4794
4908
|
return baseTabs.flatMap((tab) => {
|
|
4795
4909
|
if (!tab.venueLogo) return [tab];
|
|
@@ -4824,7 +4938,7 @@ var EventListTabs = ({
|
|
|
4824
4938
|
if (resolvedTabs.some((tab) => tab.value === activeTab && !tab.disabled)) return;
|
|
4825
4939
|
onTabChange(fallbackTab.value);
|
|
4826
4940
|
}, [activeTab, onTabChange, resolvedTabs]);
|
|
4827
|
-
const items =
|
|
4941
|
+
const items = useMemo8(() => {
|
|
4828
4942
|
return resolvedTabs.map((tab) => {
|
|
4829
4943
|
const isActive = tab.value === activeTab;
|
|
4830
4944
|
return {
|
|
@@ -4836,7 +4950,7 @@ var EventListTabs = ({
|
|
|
4836
4950
|
};
|
|
4837
4951
|
});
|
|
4838
4952
|
}, [activeTab, resolvedTabs]);
|
|
4839
|
-
return /* @__PURE__ */
|
|
4953
|
+
return /* @__PURE__ */ jsx11(
|
|
4840
4954
|
Tabs,
|
|
4841
4955
|
{
|
|
4842
4956
|
ariaLabel,
|
|
@@ -4922,20 +5036,7 @@ var useEventListTabsHeaderOverflow = (recomputeOn, options) => {
|
|
|
4922
5036
|
};
|
|
4923
5037
|
|
|
4924
5038
|
// src/events/list/index.tsx
|
|
4925
|
-
import {
|
|
4926
|
-
var subcategoryMenuRowClassName = cn(
|
|
4927
|
-
"flex min-h-11 w-full items-center justify-between rounded-[6px] px-3 py-3",
|
|
4928
|
-
"text-left text-agg-sm font-agg-normal leading-agg-5",
|
|
4929
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-agg-primary focus-visible:ring-offset-1 focus-visible:ring-offset-agg-secondary"
|
|
4930
|
-
);
|
|
4931
|
-
var subcategoryMenuIdleRowClassName = cn(
|
|
4932
|
-
subcategoryMenuRowClassName,
|
|
4933
|
-
"cursor-pointer text-agg-foreground hover:bg-agg-secondary-hover"
|
|
4934
|
-
);
|
|
4935
|
-
var subcategoryMenuSelectedRowClassName = cn(
|
|
4936
|
-
subcategoryMenuRowClassName,
|
|
4937
|
-
"cursor-pointer bg-agg-primary/10 text-agg-primary"
|
|
4938
|
-
);
|
|
5039
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
4939
5040
|
var SORT_ICON_BY_VALUE = {
|
|
4940
5041
|
volume24hr: "sort-volume-24hr",
|
|
4941
5042
|
topArbitrage: "sort-top-arbitrage",
|
|
@@ -4972,7 +5073,7 @@ var EventList = ({
|
|
|
4972
5073
|
initialLoadedPageCount,
|
|
4973
5074
|
stateRef
|
|
4974
5075
|
}) => {
|
|
4975
|
-
var _a, _b, _c;
|
|
5076
|
+
var _a, _b, _c, _d, _e;
|
|
4976
5077
|
const labels = useLabels8();
|
|
4977
5078
|
const { disabledVenues } = useAppConfig2();
|
|
4978
5079
|
const {
|
|
@@ -4980,7 +5081,7 @@ var EventList = ({
|
|
|
4980
5081
|
} = useSdkUiConfig4();
|
|
4981
5082
|
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
4982
5083
|
const resolvedTabs = useEventListTabs();
|
|
4983
|
-
const visibleVenues =
|
|
5084
|
+
const visibleVenues = useMemo9(
|
|
4984
5085
|
() => disabledVenues.length === 0 ? void 0 : getVisibleVenueIdsByConfig(VENUES, disabledVenues),
|
|
4985
5086
|
[disabledVenues]
|
|
4986
5087
|
);
|
|
@@ -4991,28 +5092,27 @@ var EventList = ({
|
|
|
4991
5092
|
const [isSubcategoriesModalOpen, setIsSubcategoriesModalOpen] = useState6(false);
|
|
4992
5093
|
const [categoryPath, setCategoryPath] = useState6([]);
|
|
4993
5094
|
const [collapsedCategoryIds, setCollapsedCategoryIds] = useState6(() => /* @__PURE__ */ new Set());
|
|
4994
|
-
const
|
|
4995
|
-
const sortItems = useMemo8(() => {
|
|
5095
|
+
const sortItems = useMemo9(() => {
|
|
4996
5096
|
return [
|
|
4997
5097
|
{
|
|
4998
5098
|
value: "volume24hr",
|
|
4999
5099
|
label: labels.eventList.sortBy24hVolume,
|
|
5000
|
-
icon: /* @__PURE__ */
|
|
5100
|
+
icon: /* @__PURE__ */ jsx12(Icon, { name: SORT_ICON_BY_VALUE.volume24hr, size: "small", color: "currentColor" })
|
|
5001
5101
|
},
|
|
5002
5102
|
{
|
|
5003
5103
|
value: "topArbitrage",
|
|
5004
5104
|
label: labels.eventList.sortByTopArbitrage,
|
|
5005
|
-
icon: /* @__PURE__ */
|
|
5105
|
+
icon: /* @__PURE__ */ jsx12(Icon, { name: SORT_ICON_BY_VALUE.topArbitrage, size: "small", color: "currentColor" })
|
|
5006
5106
|
},
|
|
5007
5107
|
{
|
|
5008
5108
|
value: "volume",
|
|
5009
5109
|
label: labels.eventList.sortByTotalVolume,
|
|
5010
|
-
icon: /* @__PURE__ */
|
|
5110
|
+
icon: /* @__PURE__ */ jsx12(Icon, { name: SORT_ICON_BY_VALUE.volume, size: "small", color: "currentColor" })
|
|
5011
5111
|
},
|
|
5012
5112
|
{
|
|
5013
5113
|
value: "endDate",
|
|
5014
5114
|
label: labels.eventList.sortByEndingSoon,
|
|
5015
|
-
icon: /* @__PURE__ */
|
|
5115
|
+
icon: /* @__PURE__ */ jsx12(Icon, { name: SORT_ICON_BY_VALUE.endDate, size: "small", color: "currentColor" })
|
|
5016
5116
|
}
|
|
5017
5117
|
];
|
|
5018
5118
|
}, [
|
|
@@ -5024,12 +5124,7 @@ var EventList = ({
|
|
|
5024
5124
|
const baseCategoryId = (_c = categoryIds == null ? void 0 : categoryIds[0]) != null ? _c : null;
|
|
5025
5125
|
useEffect6(() => {
|
|
5026
5126
|
if (!isDiscoveryFiltersEnabled) return;
|
|
5027
|
-
|
|
5028
|
-
setCategoryPath([]);
|
|
5029
|
-
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
5030
|
-
return;
|
|
5031
|
-
}
|
|
5032
|
-
setCategoryPath([{ id: baseCategoryId, label: baseCategoryId, eventCount: 0 }]);
|
|
5127
|
+
setCategoryPath([]);
|
|
5033
5128
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
5034
5129
|
}, [baseCategoryId, isDiscoveryFiltersEnabled]);
|
|
5035
5130
|
const { categories: topLevelCategories } = useCategories({
|
|
@@ -5037,10 +5132,10 @@ var EventList = ({
|
|
|
5037
5132
|
enabled: isDiscoveryFiltersEnabled,
|
|
5038
5133
|
limit: 100
|
|
5039
5134
|
});
|
|
5040
|
-
const sortedTopLevelCategories =
|
|
5135
|
+
const sortedTopLevelCategories = useMemo9(() => {
|
|
5041
5136
|
return sortCategoriesForNavigation(topLevelCategories);
|
|
5042
5137
|
}, [topLevelCategories]);
|
|
5043
|
-
const baseCategoryChildPrefetchIds =
|
|
5138
|
+
const baseCategoryChildPrefetchIds = useMemo9(() => {
|
|
5044
5139
|
return Array.from(
|
|
5045
5140
|
/* @__PURE__ */ new Set([
|
|
5046
5141
|
...sortedTopLevelCategories.map((category) => category.id),
|
|
@@ -5054,23 +5149,28 @@ var EventList = ({
|
|
|
5054
5149
|
parentIds: baseCategoryChildPrefetchIds,
|
|
5055
5150
|
limit: 100
|
|
5056
5151
|
});
|
|
5057
|
-
const visibleChildPrefetchIds =
|
|
5058
|
-
var _a2;
|
|
5152
|
+
const visibleChildPrefetchIds = useMemo9(() => {
|
|
5153
|
+
var _a2, _b2;
|
|
5059
5154
|
const ids = /* @__PURE__ */ new Set();
|
|
5155
|
+
if (baseCategoryId) {
|
|
5156
|
+
for (const child of (_a2 = baseChildrenByParentId.get(baseCategoryId)) != null ? _a2 : []) {
|
|
5157
|
+
ids.add(child.id);
|
|
5158
|
+
}
|
|
5159
|
+
}
|
|
5060
5160
|
for (const expandedCategory of categoryPath) {
|
|
5061
|
-
for (const childCategory of (
|
|
5161
|
+
for (const childCategory of (_b2 = baseChildrenByParentId.get(expandedCategory.id)) != null ? _b2 : []) {
|
|
5062
5162
|
ids.add(childCategory.id);
|
|
5063
5163
|
}
|
|
5064
5164
|
}
|
|
5065
5165
|
return Array.from(ids);
|
|
5066
|
-
}, [baseChildrenByParentId, categoryPath]);
|
|
5166
|
+
}, [baseCategoryId, baseChildrenByParentId, categoryPath]);
|
|
5067
5167
|
const { childrenByParentId: visibleChildrenByParentId } = useCategoryChildren({
|
|
5068
5168
|
queryKeyScope: "event-list-category-children",
|
|
5069
5169
|
enabled: isDiscoveryFiltersEnabled,
|
|
5070
5170
|
parentIds: visibleChildPrefetchIds,
|
|
5071
5171
|
limit: 100
|
|
5072
5172
|
});
|
|
5073
|
-
const visibleGrandchildPrefetchIds =
|
|
5173
|
+
const visibleGrandchildPrefetchIds = useMemo9(() => {
|
|
5074
5174
|
var _a2;
|
|
5075
5175
|
const ids = /* @__PURE__ */ new Set();
|
|
5076
5176
|
for (const expandedCategory of categoryPath) {
|
|
@@ -5086,43 +5186,41 @@ var EventList = ({
|
|
|
5086
5186
|
parentIds: visibleGrandchildPrefetchIds,
|
|
5087
5187
|
limit: 100
|
|
5088
5188
|
});
|
|
5089
|
-
const childrenByParentId =
|
|
5189
|
+
const childrenByParentId = useMemo9(() => {
|
|
5090
5190
|
return new Map([
|
|
5091
5191
|
...baseChildrenByParentId,
|
|
5092
5192
|
...visibleChildrenByParentId,
|
|
5093
5193
|
...visibleGrandchildrenByParentId
|
|
5094
5194
|
]);
|
|
5095
5195
|
}, [baseChildrenByParentId, visibleChildrenByParentId, visibleGrandchildrenByParentId]);
|
|
5096
|
-
const shouldRenderSubcategoryFilters = isDiscoveryFiltersEnabled && (
|
|
5097
|
-
const
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
}, [sortedTopLevelCategories]);
|
|
5103
|
-
const resolvedCategoryIds = useMemo8(() => {
|
|
5196
|
+
const shouldRenderSubcategoryFilters = isDiscoveryFiltersEnabled && baseCategoryId !== null && (((_e = (_d = childrenByParentId.get(baseCategoryId)) == null ? void 0 : _d.length) != null ? _e : 0) > 0 || categoryPath.length > 0);
|
|
5197
|
+
const baseCategoryEventCount = useMemo9(() => {
|
|
5198
|
+
var _a2, _b2;
|
|
5199
|
+
return (_b2 = (_a2 = sortedTopLevelCategories.find((c) => c.id === baseCategoryId)) == null ? void 0 : _a2.eventCount) != null ? _b2 : 0;
|
|
5200
|
+
}, [baseCategoryId, sortedTopLevelCategories]);
|
|
5201
|
+
const resolvedCategoryIds = useMemo9(() => {
|
|
5104
5202
|
if (!isDiscoveryFiltersEnabled) return categoryIds;
|
|
5105
|
-
return resolveCategoryIdsFromPath(categoryPath, void 0);
|
|
5106
|
-
}, [categoryIds, categoryPath, isDiscoveryFiltersEnabled]);
|
|
5107
|
-
const sortQueryParams =
|
|
5203
|
+
return resolveCategoryIdsFromPath(categoryPath, baseCategoryId ? [baseCategoryId] : void 0);
|
|
5204
|
+
}, [baseCategoryId, categoryIds, categoryPath, isDiscoveryFiltersEnabled]);
|
|
5205
|
+
const sortQueryParams = useMemo9(() => {
|
|
5108
5206
|
return resolveSortQueryParams(selectedSort);
|
|
5109
5207
|
}, [selectedSort]);
|
|
5110
|
-
const activeTab =
|
|
5208
|
+
const activeTab = useMemo9(() => {
|
|
5111
5209
|
return resolvedTabs.find((tab) => tab.value === activeTabValue);
|
|
5112
5210
|
}, [activeTabValue, resolvedTabs]);
|
|
5113
|
-
const venues =
|
|
5211
|
+
const venues = useMemo9(() => {
|
|
5114
5212
|
return resolveTabVenus(activeTab, visibleVenues);
|
|
5115
5213
|
}, [activeTab, visibleVenues]);
|
|
5116
|
-
const matchStatus =
|
|
5214
|
+
const matchStatus = useMemo9(() => {
|
|
5117
5215
|
return activeTabValue === "matched" ? activeTab == null ? void 0 : activeTab.matchStatus : void 0;
|
|
5118
5216
|
}, [activeTabValue, activeTab]);
|
|
5119
|
-
const resolvedMaxVisibleItems =
|
|
5217
|
+
const resolvedMaxVisibleItems = useMemo9(() => {
|
|
5120
5218
|
if (!Number.isFinite(maxVisibleItems)) return void 0;
|
|
5121
5219
|
return Math.max(1, Math.floor(maxVisibleItems));
|
|
5122
5220
|
}, [maxVisibleItems]);
|
|
5123
5221
|
const requestLimit = resolvedMaxVisibleItems != null ? resolvedMaxVisibleItems : limit;
|
|
5124
5222
|
const shouldPaginate = resolvedMaxVisibleItems == null;
|
|
5125
|
-
const endDateFrom =
|
|
5223
|
+
const endDateFrom = useMemo9(() => {
|
|
5126
5224
|
if (search) return void 0;
|
|
5127
5225
|
const BUCKET_MINUTES = 5;
|
|
5128
5226
|
const bucket = /* @__PURE__ */ new Date();
|
|
@@ -5156,16 +5254,16 @@ var EventList = ({
|
|
|
5156
5254
|
stateRef.current = { venueTab: activeTabValue, loadedPageCount };
|
|
5157
5255
|
}
|
|
5158
5256
|
}, [stateRef, activeTabValue, loadedPageCount]);
|
|
5159
|
-
const filteredEvents =
|
|
5257
|
+
const filteredEvents = useMemo9(() => {
|
|
5160
5258
|
return filterEventsByTabValue(events, activeTabValue);
|
|
5161
5259
|
}, [events, activeTabValue]);
|
|
5162
|
-
const groupedEvents =
|
|
5260
|
+
const groupedEvents = useMemo9(() => {
|
|
5163
5261
|
return splitEventsByLifecycle(filteredEvents);
|
|
5164
5262
|
}, [filteredEvents]);
|
|
5165
|
-
const orderedEvents =
|
|
5263
|
+
const orderedEvents = useMemo9(() => {
|
|
5166
5264
|
return groupedEvents.open;
|
|
5167
5265
|
}, [groupedEvents.open]);
|
|
5168
|
-
const tileEvents =
|
|
5266
|
+
const tileEvents = useMemo9(() => {
|
|
5169
5267
|
const normalizedEvents = orderedEvents.map((event) => mapEventToEventListItemEvent(event)).filter((event) => event != null);
|
|
5170
5268
|
if (resolvedMaxVisibleItems == null) return normalizedEvents;
|
|
5171
5269
|
return normalizedEvents.slice(0, resolvedMaxVisibleItems);
|
|
@@ -5199,11 +5297,10 @@ var EventList = ({
|
|
|
5199
5297
|
const gridClassName = cn(
|
|
5200
5298
|
"grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] md:grid-cols-[repeat(auto-fill,minmax(360px,1fr))] gap-4"
|
|
5201
5299
|
);
|
|
5202
|
-
const isDrilledIn = categoryPath.length > 0;
|
|
5203
5300
|
const handleSelectAllCategories = () => {
|
|
5204
5301
|
setCategoryPath([]);
|
|
5205
5302
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
5206
|
-
onCategoryRootChange == null ? void 0 : onCategoryRootChange(void 0);
|
|
5303
|
+
onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
|
|
5207
5304
|
setIsSubcategoriesModalOpen(false);
|
|
5208
5305
|
};
|
|
5209
5306
|
const handleToggleSubcategory = ({
|
|
@@ -5213,7 +5310,6 @@ var EventList = ({
|
|
|
5213
5310
|
isExpanded,
|
|
5214
5311
|
isSelected
|
|
5215
5312
|
}) => {
|
|
5216
|
-
var _a2;
|
|
5217
5313
|
setCategoryPath((prev) => [...prev.slice(0, depth), entry]);
|
|
5218
5314
|
setCollapsedCategoryIds((prev) => {
|
|
5219
5315
|
const next = new Set(prev);
|
|
@@ -5224,122 +5320,41 @@ var EventList = ({
|
|
|
5224
5320
|
next.delete(entry.id);
|
|
5225
5321
|
return next;
|
|
5226
5322
|
});
|
|
5227
|
-
onCategoryRootChange == null ? void 0 : onCategoryRootChange(
|
|
5228
|
-
};
|
|
5229
|
-
const renderSubcategoryTreeRow = ({
|
|
5230
|
-
entry,
|
|
5231
|
-
isExpanded,
|
|
5232
|
-
isSelected,
|
|
5233
|
-
onClick
|
|
5234
|
-
}) => {
|
|
5235
|
-
var _a2, _b2;
|
|
5236
|
-
const hasKnownChildren = ((_b2 = (_a2 = childrenByParentId.get(entry.id)) == null ? void 0 : _a2.length) != null ? _b2 : 0) > 0;
|
|
5237
|
-
return /* @__PURE__ */ jsxs8(
|
|
5238
|
-
"button",
|
|
5239
|
-
{
|
|
5240
|
-
type: "button",
|
|
5241
|
-
"aria-current": isSelected ? "true" : void 0,
|
|
5242
|
-
className: isSelected ? subcategoryMenuSelectedRowClassName : subcategoryMenuIdleRowClassName,
|
|
5243
|
-
onClick,
|
|
5244
|
-
children: [
|
|
5245
|
-
/* @__PURE__ */ jsx11("span", { className: "min-w-0 truncate first-letter:uppercase", children: entry.label }),
|
|
5246
|
-
hasKnownChildren ? /* @__PURE__ */ jsx11(
|
|
5247
|
-
Icon,
|
|
5248
|
-
{
|
|
5249
|
-
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
5250
|
-
size: "small",
|
|
5251
|
-
color: "currentColor",
|
|
5252
|
-
className: "shrink-0 text-agg-muted-foreground"
|
|
5253
|
-
}
|
|
5254
|
-
) : /* @__PURE__ */ jsx11("span", { className: "shrink-0 text-agg-muted-foreground", children: entry.eventCount })
|
|
5255
|
-
]
|
|
5256
|
-
},
|
|
5257
|
-
entry.id
|
|
5258
|
-
);
|
|
5259
|
-
};
|
|
5260
|
-
const renderSubcategoryBranch = (category, depth) => {
|
|
5261
|
-
var _a2, _b2, _c2, _d, _e;
|
|
5262
|
-
const label = (_a2 = category.displayName) != null ? _a2 : category.name;
|
|
5263
|
-
const entry = {
|
|
5264
|
-
id: category.id,
|
|
5265
|
-
label,
|
|
5266
|
-
eventCount: (_b2 = category.eventCount) != null ? _b2 : 0
|
|
5267
|
-
};
|
|
5268
|
-
const childCategories = (_c2 = childrenByParentId.get(category.id)) != null ? _c2 : [];
|
|
5269
|
-
const hasKnownChildren = childCategories.length > 0;
|
|
5270
|
-
const isExpanded = ((_d = categoryPath[depth]) == null ? void 0 : _d.id) === category.id && !collapsedCategoryIds.has(category.id);
|
|
5271
|
-
const isSelected = ((_e = categoryPath[depth]) == null ? void 0 : _e.id) === category.id && categoryPath.length === depth + 1;
|
|
5272
|
-
return /* @__PURE__ */ jsxs8("div", { className: "flex w-full flex-col gap-1", children: [
|
|
5273
|
-
renderSubcategoryTreeRow({
|
|
5274
|
-
entry,
|
|
5275
|
-
isExpanded,
|
|
5276
|
-
isSelected,
|
|
5277
|
-
onClick: () => handleToggleSubcategory({
|
|
5278
|
-
entry,
|
|
5279
|
-
depth,
|
|
5280
|
-
hasKnownChildren,
|
|
5281
|
-
isExpanded,
|
|
5282
|
-
isSelected
|
|
5283
|
-
})
|
|
5284
|
-
}),
|
|
5285
|
-
isExpanded ? /* @__PURE__ */ jsx11("div", { className: "flex w-full flex-col gap-1 pl-4", children: childCategories.map(
|
|
5286
|
-
(childCategory) => renderSubcategoryBranch(childCategory, depth + 1)
|
|
5287
|
-
) }) : null
|
|
5288
|
-
] }, category.id);
|
|
5323
|
+
onCategoryRootChange == null ? void 0 : onCategoryRootChange(baseCategoryId != null ? baseCategoryId : void 0);
|
|
5289
5324
|
};
|
|
5290
|
-
const subcategoriesListContent = /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5291
|
-
/* @__PURE__ */ jsxs8(
|
|
5292
|
-
"button",
|
|
5293
|
-
{
|
|
5294
|
-
type: "button",
|
|
5295
|
-
"aria-current": !isDrilledIn ? "true" : void 0,
|
|
5296
|
-
className: !isDrilledIn ? subcategoryMenuSelectedRowClassName : subcategoryMenuIdleRowClassName,
|
|
5297
|
-
onClick: handleSelectAllCategories,
|
|
5298
|
-
children: [
|
|
5299
|
-
/* @__PURE__ */ jsx11("span", { className: "min-w-0 truncate", children: labels.eventList.subcategoriesAll }),
|
|
5300
|
-
/* @__PURE__ */ jsx11("span", { className: "text-agg-muted-foreground", children: totalTopLevelEventCount })
|
|
5301
|
-
]
|
|
5302
|
-
}
|
|
5303
|
-
),
|
|
5304
|
-
sortedTopLevelCategories.map((category) => renderSubcategoryBranch(category, 0))
|
|
5305
|
-
] });
|
|
5306
5325
|
if (shouldRenderLoadingState) {
|
|
5307
|
-
return /* @__PURE__ */
|
|
5326
|
+
return /* @__PURE__ */ jsx12(
|
|
5308
5327
|
Skeleton,
|
|
5309
5328
|
{
|
|
5310
5329
|
view: "event-list",
|
|
5311
5330
|
ariaLabel: labels.eventList.loading(title),
|
|
5312
|
-
withSidebar:
|
|
5331
|
+
withSidebar: shouldRenderSubcategoryFilters
|
|
5313
5332
|
}
|
|
5314
5333
|
);
|
|
5315
5334
|
}
|
|
5316
|
-
return /* @__PURE__ */
|
|
5317
|
-
/* @__PURE__ */
|
|
5335
|
+
return /* @__PURE__ */ jsxs9("section", { className: "agg-event-list flex w-full flex-col gap-2 md:gap-5 t", children: [
|
|
5336
|
+
/* @__PURE__ */ jsxs9(
|
|
5318
5337
|
"header",
|
|
5319
5338
|
{
|
|
5320
|
-
ref: headerRef,
|
|
5321
5339
|
className: cn(
|
|
5322
5340
|
"agg-event-list-header",
|
|
5323
5341
|
"flex flex-col w-full items-start justify-between",
|
|
5324
5342
|
"gap-2 sm:flex-row sm:items-center sm:gap-4"
|
|
5325
5343
|
),
|
|
5326
5344
|
children: [
|
|
5327
|
-
/* @__PURE__ */
|
|
5328
|
-
/* @__PURE__ */
|
|
5329
|
-
/* @__PURE__ */
|
|
5345
|
+
/* @__PURE__ */ jsx12("div", { className: "agg-event-list-title min-w-32", children: /* @__PURE__ */ jsx12(Typography, { as: "h2", variant: "title", className: "truncate first-letter:uppercase", children: title }) }),
|
|
5346
|
+
/* @__PURE__ */ jsxs9("div", { className: "hidden min-w-0 max-w-full items-center gap-3 md:flex", children: [
|
|
5347
|
+
/* @__PURE__ */ jsx12(
|
|
5330
5348
|
EventListTabs,
|
|
5331
5349
|
{
|
|
5332
5350
|
ariaLabel: labels.eventList.tabsAria(title),
|
|
5333
|
-
className:
|
|
5334
|
-
"agg-event-list-tabs w-fit max-w-full flex-1",
|
|
5335
|
-
shouldUseSelectOverflow ? "min-w-[220px]" : "min-w-[400px]"
|
|
5336
|
-
),
|
|
5351
|
+
className: "agg-event-list-tabs min-w-0 flex-1 max-w-[600px]!",
|
|
5337
5352
|
activeTab: activeTabValue,
|
|
5338
5353
|
onTabChange: setActiveTabValue,
|
|
5339
|
-
overflowBehavior:
|
|
5354
|
+
overflowBehavior: "scroll"
|
|
5340
5355
|
}
|
|
5341
5356
|
),
|
|
5342
|
-
/* @__PURE__ */
|
|
5357
|
+
/* @__PURE__ */ jsx12(
|
|
5343
5358
|
Select,
|
|
5344
5359
|
{
|
|
5345
5360
|
ariaLabel: labels.eventList.sortByLabel,
|
|
@@ -5355,8 +5370,8 @@ var EventList = ({
|
|
|
5355
5370
|
]
|
|
5356
5371
|
}
|
|
5357
5372
|
),
|
|
5358
|
-
/* @__PURE__ */
|
|
5359
|
-
/* @__PURE__ */
|
|
5373
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex w-full gap-2 md:hidden mb-3", children: [
|
|
5374
|
+
/* @__PURE__ */ jsx12(
|
|
5360
5375
|
EventListTabs,
|
|
5361
5376
|
{
|
|
5362
5377
|
ariaLabel: labels.eventList.tabsAria(title),
|
|
@@ -5366,7 +5381,7 @@ var EventList = ({
|
|
|
5366
5381
|
overflowBehavior: "select"
|
|
5367
5382
|
}
|
|
5368
5383
|
),
|
|
5369
|
-
/* @__PURE__ */
|
|
5384
|
+
/* @__PURE__ */ jsx12(
|
|
5370
5385
|
Select,
|
|
5371
5386
|
{
|
|
5372
5387
|
ariaLabel: labels.eventList.sortByLabel,
|
|
@@ -5377,24 +5392,36 @@ var EventList = ({
|
|
|
5377
5392
|
contentClassName: "rounded-[12px] py-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]"
|
|
5378
5393
|
}
|
|
5379
5394
|
),
|
|
5380
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */
|
|
5395
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx12(
|
|
5381
5396
|
"button",
|
|
5382
5397
|
{
|
|
5383
5398
|
type: "button",
|
|
5384
5399
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-[8px] border-2 border-agg-primary bg-agg-secondary text-agg-foreground cursor-pointer",
|
|
5385
5400
|
"aria-label": labels.eventList.subcategoriesOpenAria,
|
|
5386
5401
|
onClick: () => setIsSubcategoriesModalOpen(true),
|
|
5387
|
-
children: /* @__PURE__ */
|
|
5402
|
+
children: /* @__PURE__ */ jsx12(Icon, { name: "apps", size: "small", color: "currentColor" })
|
|
5388
5403
|
}
|
|
5389
5404
|
) : null
|
|
5390
5405
|
] }),
|
|
5391
|
-
/* @__PURE__ */
|
|
5406
|
+
/* @__PURE__ */ jsxs9(
|
|
5392
5407
|
"div",
|
|
5393
5408
|
{
|
|
5394
5409
|
className: cn("flex w-full gap-6", shouldRenderSubcategoryFilters ? "md:items-start" : ""),
|
|
5395
5410
|
children: [
|
|
5396
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */
|
|
5397
|
-
|
|
5411
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx12("aside", { className: "hidden w-[200px] shrink-0 md:block self-start sticky top-4", children: /* @__PURE__ */ jsx12("div", { className: "agg-sidebar max-h-[calc(100vh-19rem)] overflow-y-auto rounded-[8px] border border-agg-separator bg-agg-secondary p-2", children: /* @__PURE__ */ jsx12(
|
|
5412
|
+
CategorySidebar,
|
|
5413
|
+
{
|
|
5414
|
+
baseCategoryId,
|
|
5415
|
+
childrenByParentId,
|
|
5416
|
+
categoryPath,
|
|
5417
|
+
collapsedCategoryIds,
|
|
5418
|
+
totalEventCount: baseCategoryEventCount,
|
|
5419
|
+
labels: { subcategoriesAll: labels.eventList.subcategoriesAll },
|
|
5420
|
+
onSelectAll: handleSelectAllCategories,
|
|
5421
|
+
onToggleCategory: handleToggleSubcategory
|
|
5422
|
+
}
|
|
5423
|
+
) }) }) : null,
|
|
5424
|
+
/* @__PURE__ */ jsxs9(
|
|
5398
5425
|
"div",
|
|
5399
5426
|
{
|
|
5400
5427
|
className: cn(
|
|
@@ -5405,7 +5432,7 @@ var EventList = ({
|
|
|
5405
5432
|
gridClassName
|
|
5406
5433
|
),
|
|
5407
5434
|
children: [
|
|
5408
|
-
tileEvents.map((event) => /* @__PURE__ */
|
|
5435
|
+
tileEvents.map((event) => /* @__PURE__ */ jsx12(
|
|
5409
5436
|
EventListItem,
|
|
5410
5437
|
{
|
|
5411
5438
|
event,
|
|
@@ -5420,7 +5447,7 @@ var EventList = ({
|
|
|
5420
5447
|
},
|
|
5421
5448
|
event.id
|
|
5422
5449
|
)),
|
|
5423
|
-
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */
|
|
5450
|
+
shouldRenderPaginationLoadingItems ? Array.from({ length: 6 }).map((_, index) => /* @__PURE__ */ jsx12(
|
|
5424
5451
|
EventListItem,
|
|
5425
5452
|
{
|
|
5426
5453
|
isLoading: true,
|
|
@@ -5430,20 +5457,20 @@ var EventList = ({
|
|
|
5430
5457
|
},
|
|
5431
5458
|
`loading-${index}`
|
|
5432
5459
|
)) : null,
|
|
5433
|
-
shouldRenderEmptyState ? /* @__PURE__ */
|
|
5460
|
+
shouldRenderEmptyState ? /* @__PURE__ */ jsx12("div", { className: "col-span-full w-full", children: /* @__PURE__ */ jsx12(
|
|
5434
5461
|
StateMessage,
|
|
5435
5462
|
{
|
|
5436
5463
|
title: labels.eventList.emptyTitle,
|
|
5437
5464
|
description: labels.eventList.emptyDescription,
|
|
5438
|
-
icon: /* @__PURE__ */
|
|
5465
|
+
icon: /* @__PURE__ */ jsx12(Icon, { name: "search-empty" })
|
|
5439
5466
|
}
|
|
5440
5467
|
) }) : null,
|
|
5441
|
-
isError ? /* @__PURE__ */
|
|
5468
|
+
isError ? /* @__PURE__ */ jsx12("div", { className: "col-span-full w-full", children: /* @__PURE__ */ jsx12(
|
|
5442
5469
|
StateMessage,
|
|
5443
5470
|
{
|
|
5444
5471
|
title: labels.eventList.errorTitle,
|
|
5445
5472
|
description: labels.eventList.errorDescription,
|
|
5446
|
-
icon: /* @__PURE__ */
|
|
5473
|
+
icon: /* @__PURE__ */ jsx12(Icon, { name: "warning" })
|
|
5447
5474
|
}
|
|
5448
5475
|
) }) : null
|
|
5449
5476
|
]
|
|
@@ -5452,20 +5479,45 @@ var EventList = ({
|
|
|
5452
5479
|
]
|
|
5453
5480
|
}
|
|
5454
5481
|
),
|
|
5455
|
-
shouldRenderSubcategoryFilters ? /* @__PURE__ */
|
|
5482
|
+
shouldRenderSubcategoryFilters ? /* @__PURE__ */ jsx12(Modal, { open: isSubcategoriesModalOpen, onOpenChange: setIsSubcategoriesModalOpen, children: /* @__PURE__ */ jsx12(
|
|
5456
5483
|
Modal.Container,
|
|
5457
5484
|
{
|
|
5458
5485
|
classNames: {
|
|
5459
|
-
|
|
5486
|
+
// pointer-events-none lets clicks on the empty area above the panel pass through
|
|
5487
|
+
// to Dialog.Overlay, which triggers Radix's outside-click dismiss.
|
|
5488
|
+
content: "items-end p-0 pointer-events-none",
|
|
5460
5489
|
container: "w-full max-w-none border-0 bg-transparent shadow-none"
|
|
5461
5490
|
},
|
|
5462
|
-
children: [
|
|
5463
|
-
/* @__PURE__ */
|
|
5464
|
-
/* @__PURE__ */
|
|
5465
|
-
|
|
5491
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "pointer-events-auto w-full rounded-t-[12px] border border-agg-separator bg-agg-secondary", children: [
|
|
5492
|
+
/* @__PURE__ */ jsx12("div", { className: "flex justify-center pb-1 pt-3", "aria-hidden": "true", children: /* @__PURE__ */ jsx12("div", { className: "h-1 w-10 rounded-full bg-agg-muted-foreground/30" }) }),
|
|
5493
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between px-4 pb-2 pt-1", children: [
|
|
5494
|
+
/* @__PURE__ */ jsx12(Dialog.Title, { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.eventList.subcategoriesLabel }),
|
|
5495
|
+
/* @__PURE__ */ jsx12(
|
|
5496
|
+
Dialog.Close,
|
|
5497
|
+
{
|
|
5498
|
+
className: "flex cursor-pointer items-center justify-center rounded-full p-1 text-agg-muted-foreground hover:bg-agg-secondary-hover",
|
|
5499
|
+
"aria-label": labels.common.close,
|
|
5500
|
+
children: /* @__PURE__ */ jsx12(CloseIcon, { className: "h-5 w-5" })
|
|
5501
|
+
}
|
|
5502
|
+
)
|
|
5503
|
+
] }),
|
|
5504
|
+
/* @__PURE__ */ jsx12("div", { className: "flex flex-col gap-1 px-4 pb-4", children: /* @__PURE__ */ jsx12(
|
|
5505
|
+
CategorySidebar,
|
|
5506
|
+
{
|
|
5507
|
+
baseCategoryId,
|
|
5508
|
+
childrenByParentId,
|
|
5509
|
+
categoryPath,
|
|
5510
|
+
collapsedCategoryIds,
|
|
5511
|
+
totalEventCount: baseCategoryEventCount,
|
|
5512
|
+
labels: { subcategoriesAll: labels.eventList.subcategoriesAll },
|
|
5513
|
+
onSelectAll: handleSelectAllCategories,
|
|
5514
|
+
onToggleCategory: handleToggleSubcategory
|
|
5515
|
+
}
|
|
5516
|
+
) })
|
|
5517
|
+
] })
|
|
5466
5518
|
}
|
|
5467
5519
|
) }) : null,
|
|
5468
|
-
shouldPaginate && hasNextPage ? /* @__PURE__ */
|
|
5520
|
+
shouldPaginate && hasNextPage ? /* @__PURE__ */ jsx12("div", { ref: loadMoreRef, className: "agg-event-list-sentinel h-px w-full", "aria-hidden": true }) : null
|
|
5469
5521
|
] });
|
|
5470
5522
|
};
|
|
5471
5523
|
EventList.displayName = "EventList";
|