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AAA,CAANpG,EAAG,KAAY,OAAToG,EAAInI,IAAI,CACpD,EACAwG,UAAW,2BAAgF,OAArD4B,EAAa,kBAAoB,8BAEtEnH,CAAAA,EAAAA,EAAAA,EAAAA,CAAYA,CAACkH,EAAID,IAAI,GANjBC,EAAID,IAAI,EAQf,UAAC3B,MAAAA,CACCC,UAAW,6DAA6G,OAAhD4B,EAAa,gBAAkB,sBAXjGX,EAed,IAGN","sources":["webpack://_N_E/./app/utils/hooks/useActiveRouteBanner.tsx","webpack://_N_E/./app/@subnavbar/default.tsx","webpack://_N_E/./node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js","webpack://_N_E/../useInfiniteQuery.ts","webpack://_N_E/./app/hooks/queries/useEventQueries.ts","webpack://_N_E/./app/components/icons/SearchBar.tsx","webpack://_N_E/./app/events/_components/categoriesNav.tsx","webpack://_N_E/?9ed7","webpack://_N_E/./app/events/_components/EventTabList.tsx"],"sourcesContent":["import { usePathname } from 'next/navigation'\nimport { useMemo, useState } from 'react'\nimport { toPascalCase } from '../typeConverters'\ntype CategoriesRoute = {\n path: string\n}\nexport const categories = [\n {\n path: 'music',\n },\n {\n path: 'art',\n },\n {\n path: 'online',\n },\n {\n path: 'sports',\n },\n]\nexport default function useActiveRouteBanner() {\n const [activeRoute, setActiveRoute] = useState('')\n const [banner, setBanner] = useState('')\n // verifies if routeName is the one active (in browser input)\n const pathname = usePathname()\n\n useMemo(() => {\n const bannerSplit = (routeName: string) => {\n const split = routeName.split('/')\n return split[split.length - 1]\n }\n const handleActiveRoute = (route: CategoriesRoute) => {\n const isActive = pathname?.includes(route.path)\n if (isActive) {\n setActiveRoute(route.path)\n setBanner(bannerSplit(toPascalCase(route.path)))\n }\n }\n\n categories.forEach((route: CategoriesRoute) => {\n handleActiveRoute(route)\n })\n }, [pathname])\n\n return { activeRoute, banner }\n}\n","'use client'\nimport { usePathname } from 'next/navigation'\nimport CategoriesNav from '../events/_components/categoriesNav'\nimport EventTabList from '../events/_components/EventTabList'\n\nexport default function Default() {\n const pathname = usePathname()\n const isEvents = pathname.includes('search')\n const isDetails = pathname.includes('details')\n const isCreate = pathname.includes('create')\n\n if (isEvents) {\n return \n }\n if (isDetails) {\n return \n }\n if (isCreate) {\n return \n }\n return \n}\n","// src/infiniteQueryObserver.ts\nimport { QueryObserver } from \"./queryObserver.js\";\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior\n} from \"./infiniteQueryBehavior.js\";\nvar InfiniteQueryObserver = class extends QueryObserver {\n constructor(client, options) {\n super(client, options);\n }\n bindMethods() {\n super.bindMethods();\n this.fetchNextPage = this.fetchNextPage.bind(this);\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this);\n }\n setOptions(options) {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior()\n });\n }\n getOptimisticResult(options) {\n options.behavior = infiniteQueryBehavior();\n return super.getOptimisticResult(options);\n }\n fetchNextPage(options) {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: \"forward\" }\n }\n });\n }\n fetchPreviousPage(options) {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: \"backward\" }\n }\n });\n }\n createResult(query, options) {\n const { state } = query;\n const parentResult = super.createResult(query, options);\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult;\n const fetchDirection = state.fetchMeta?.fetchMore?.direction;\n const isFetchNextPageError = isError && fetchDirection === \"forward\";\n const isFetchingNextPage = isFetching && fetchDirection === \"forward\";\n const isFetchPreviousPageError = isError && fetchDirection === \"backward\";\n const isFetchingPreviousPage = isFetching && fetchDirection === \"backward\";\n const result = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage\n };\n return result;\n }\n};\nexport {\n InfiniteQueryObserver\n};\n//# sourceMappingURL=infiniteQueryObserver.js.map","'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n","import { useInfiniteQuery, useQuery, useQueryClient } from '@tanstack/react-query'\nimport { usePathname } from 'next/navigation'\nimport { useCallback, useEffect, useState } from 'react'\nimport { EVENTSMODEL, GENRESEENUM } from '../../types/graphql/API'\nexport interface EventFilters {\n category?: GENRESEENUM\n page?: number\n search?: string\n}\n\nexport interface EventsResponse {\n _embedded: {\n events: EVENTSMODEL[]\n }\n _links: {\n self: { href: string }\n first: { href: string }\n last: { href: string }\n next: { href: string }\n prev: { href: string }\n }\n page: {\n totalElements: number\n number: number\n size: number\n totalPages: number\n }\n}\n\nexport const eventKeys = {\n all: ['events'] as const,\n lists: () => [...eventKeys.all, 'list'] as const,\n list: (filters: EventFilters) => [...eventKeys.lists(), filters] as const,\n active: () => [...eventKeys.all, 'active'] as const,\n detail: (id: string) => [...eventKeys.all, 'detail', id] as const,\n}\n\nasync function fetchEvents(filters: EventFilters): Promise {\n const params = new URLSearchParams()\n if (filters.category) params.set('category', filters.category)\n if (filters.page) params.set('page', filters.page.toString())\n const url = new URL(`/api/getevents?${params.toString()}`, process.env.NEXT_PUBLIC_BASE_URL)\n const response = await fetch(url)\n if (!response.ok) {\n throw new Error('Failed to fetch events')\n }\n return response.json()\n}\n\nasync function fetchEvent(id: string): Promise {\n if (!id) return null\n console.log('Fetching event with ID:', id)\n const url = new URL(`/api/getEvent?id=${id}`, process.env.NEXT_PUBLIC_BASE_URL)\n\n try {\n const response = await fetch(url)\n if (!response.ok) return null\n\n const data = await response.json()\n return data.item || null\n } catch (error) {\n console.error('Error fetching event:', error)\n return null\n }\n}\n\nexport function useEventsInfiniteQuery(filters: Omit) {\n return useInfiniteQuery({\n queryKey: eventKeys.list(filters),\n queryFn: ({ pageParam = 0 }) => fetchEvents({ ...filters, page: pageParam }),\n initialPageParam: 0,\n getNextPageParam: (lastPage) => {\n if (lastPage.page.number < lastPage.page.totalPages - 1) {\n return lastPage.page.number + 1\n }\n return undefined\n },\n select: (data) => ({\n pages: data.pages,\n pageParams: data.pageParams,\n events: data.pages.flatMap((page) => page._embedded.events),\n total: data.pages[0]?.page.totalElements || 0,\n }),\n })\n}\n\nexport function useEventQuery(id: string) {\n const queryClient = useQueryClient()\n console.log('useEventQuery called with ID:', id)\n\n return useQuery({\n queryKey: eventKeys.detail(id),\n queryFn: async () => {\n console.log('Query function executing for ID:', id)\n if (!id) return null\n return fetchEvent(id)\n },\n initialData: () => {\n // Try to find the event in the infinite query cache first\n const infiniteData = queryClient.getQueryData<{\n pages: EventsResponse[]\n }>(eventKeys.lists())\n\n if (infiniteData) {\n const event = infiniteData.pages.flatMap((page) => page._embedded.events).find((event) => event.id === id)\n\n if (event) {\n console.log('Found event in cache:', event)\n return event\n }\n }\n return undefined // Let it fetch if not in cache\n },\n enabled: !!id,\n refetchOnMount: true, // Always refetch on mount to ensure fresh data\n staleTime: 0, // Consider data immediately stale to trigger refetch\n })\n}\n\n// Hook to manage active event state\nexport function useActiveEvent(id?: string) {\n const queryClient = useQueryClient()\n const { data: event } = useEventQuery(id)\n\n // Pre-fetch related data when an event becomes active\n const preFetchEventData = async (eventId: string) => {\n const event = await fetchEvent(eventId)\n queryClient.setQueryData(eventKeys.detail(eventId), event)\n\n // Pre-fetch related data like tickets, contract info, etc.\n // This will be implemented when we add those queries\n }\n\n return {\n event,\n preFetchEventData,\n }\n}\n\nexport function useEventDetails() {\n const pathname = usePathname()\n const [correctPath, setCorrectPath] = useState(false)\n const [currentTab, setCurrentTab] = useState()\n const [category, setCategory] = useState()\n const [id, setId] = useState('')\n const [parent, setParent] = useState()\n\n const calculateDetails = useCallback(() => {\n console.log('eventTabList ', pathname)\n const splitPathName = pathname.split('/')\n setCorrectPath(splitPathName.length == 5)\n setCurrentTab(splitPathName[splitPathName.length - 1])\n setCategory(splitPathName[2])\n setId(splitPathName[3] || '')\n setParent(splitPathName[1])\n }, [pathname])\n\n useEffect(() => {\n calculateDetails()\n }, [pathname])\n\n return { correctPath, currentTab, category, id, parent }\n}\n","export function SearchBar(props: {\n variant?: string\n background?: string\n children?: JSX.Element\n placeholder?: string\n borderRadius?: string | number\n [x: string]: any\n}) {\n const { variant, background, children, placeholder, borderRadius, ...rest } = props\n\n return (\n
\n
\n \n \n \n \n \n \n
\n
\n )\n}\n","'use client'\nimport Link from 'next/link'\nimport { SearchBar } from '../../components/icons/SearchBar'\nimport useActiveRouteBanner, { categories } from '../../utils/hooks/useActiveRouteBanner'\nimport { toPascalCase } from '../../utils/typeConverters'\n\nexport default function CategoriesNav() {\n const { activeRoute, banner } = useActiveRouteBanner()\n return (\n
\n
\n \n
\n
\n

Trending {banner}

\n
\n
\n
\n \n
\n
\n )\n}\n\nexport function MainRoutes({ activeRoute }: { activeRoute: string }) {\n return (\n
\n {categories.map((route, index: number) => {\n const isActive = route.path === activeRoute.toLowerCase()\n return (\n
\n \n {toPascalCase(route.path)}\n \n
\n
\n )\n })}\n
\n )\n}\n\nexport function EventNav() {\n const { activeRoute, banner } = useActiveRouteBanner()\n return (\n
\n
\n \n
\n
\n

Trending {banner}

\n
\n
\n
\n \n
\n
\n )\n}\n","import(/* webpackMode: \"eager\" */ \"/codebuild/output/src1784519652/src/soti/app/@subnavbar/default.tsx\");\n","'use client'\n\nimport { useWallet } from '@txnlab/use-wallet'\nimport Link from 'next/link'\nimport { useMemo } from 'react'\nimport { useEventDetails } from '../../hooks/queries/useEventQueries'\nimport { toPascalCase } from '../../utils/typeConverters'\n\ninterface Route {\n name: string\n path: string\n}\n\nexport default function EventTabList() {\n const { currentTab, category, id, parent } = useEventDetails()\n const { activeAddress } = useWallet()\n\n const routes = useMemo(() => {\n const baseRoutes = [\n {\n name: 'Details',\n path: 'Details',\n },\n {\n name: 'Tickets',\n path: 'Tickets',\n },\n ]\n\n if (activeAddress) {\n return [\n ...baseRoutes,\n {\n name: 'Claim Ticket',\n path: 'Claim',\n },\n {\n name: 'Redeem Ticket',\n path: 'Redeem',\n },\n ]\n }\n\n return [...baseRoutes]\n }, [activeAddress])\n\n return (\n
\n {routes.map((cat, index) => {\n const isSelected = cat.path === currentTab\n return (\n
\n \n {toPascalCase(cat.name)}\n \n \n
\n )\n })}\n
\n )\n}\n"],"names":["categories","path","useActiveRouteBanner","activeRoute","setActiveRoute","useState","banner","setBanner","pathname","usePathname","useMemo","bannerSplit","split","routeName","length","handleActiveRoute","includes","route","toPascalCase","forEach","Default","isEvents","isDetails","CategoriesNav","EventTabList","eventKeys","all","lists","list","filters","active","detail","id","fetchEvents","params","URLSearchParams","category","set","page","toString","url","URL","process","response","fetch","ok","json","fetchEvent","console","log","data","item","error","useEventsInfiniteQuery","queryKey","useInfiniteQuery","queryFn","pageParam","initialPageParam","getNextPageParam","lastPage","number","totalPages","select","pages","pageParams","events","flatMap","_embedded","total","totalElements","useEventQuery","queryClient","useQueryClient","useQuery","initialData","infiniteData","getQueryData","event","find","enabled","refetchOnMount","staleTime","useEventDetails","correctPath","setCorrectPath","currentTab","setCurrentTab","setCategory","setId","parent","setParent","calculateDetails","useCallback","splitPathName","useEffect","SearchBar","props","variant","background","children","placeholder","borderRadius","rest","div","className","input","type","button","aria-label","svg","fill","stroke","viewBox","xmlns","strokeLinecap","strokeLinejoin","strokeWidth","d","MainRoutes","h1","map","index","isActive","toLowerCase","Link","href","activeAddress","useWallet","routes","baseRoutes","name","cat","isSelected"],"sourceRoot":"","ignoreList":[2]}