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oBvDC,WAAYR,EACZG,SAAUD,EACVG,uBAAwBD,EACxBK,kBApBuClB,EAAAA,EAAAA,GAAS,CAChDC,OAAQA,IAAM,iCAA6BC,MAAMC,GAAMA,EAAEe,qBAoBzDC,eAjB6BnB,EAAAA,EAAAA,GAAS,CACtCC,OAAQA,IAAM,iCAA0BC,MAAMC,GAAMA,EAAEgB,kBAiBtDC,WAdyBpB,EAAAA,EAAAA,GAAS,CAClCC,OAAQA,IAAM,+BAAsBC,MAAMC,GAAMA,EAAEiB,eAgBtCvB,EAAqFwB,IAAiB,IAAhB,QAAEvB,GAASuB,EAC7G,OACCzB,EAAAA,EAAAA,KAAA0B,EAAAA,SAAA,CAAAC,SACEzB,EAAQ0B,KAAKC,IACb,MAAMC,EAAkBX,EAAQU,EAAOE,UAEvC,OAAIC,EAAAA,EAAAA,IAAYF,GAAyB,MAIxC9B,EAAAA,EAAAA,KAACiC,EAAAA,SAAQ,CAAAN,UAER3B,EAAAA,EAAAA,KAAC8B,EAAe,IAAKD,KAFPA,EAAOE,SAGX,KAGX,C","sources":["webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/@packages/dataQuery/useDataQuery.ts","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/@packages/dataQuery/adapters/useQueryV5.ts","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/modules/customPage/const.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/modules/customPage/hooks/useCustomPageDataQuery.ts","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/modules/customPage/api.ts","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/modules/customPage/privacyStatement/PrivacyStatement.tsx","webpack://helloFlexReact/./Themes/Glued/Content/ReactSharedScripts/modules/customPage/widgets/CustomPageWidgets.tsx"],"sourcesContent":["import { QueryConfig, QueryResult } from './types/dataQuery';\r\nimport { useQueryV5 } from './adapters/useQueryV5';\r\nimport { QueryFunction, QueryKey } from './types';\r\n\r\nexport function useDataQuery(\r\n\tqueryKey: QueryKey,\r\n\tqueryFn: QueryFunction,\r\n\tqueryConfig?: QueryConfig,\r\n): QueryResult;\r\n\r\nexport function useDataQuery(queryKey, queryFn, queryConfig) {\r\n\treturn useQueryV5(queryKey, queryFn, queryConfig);\r\n}\r\n","import { useQuery } from '@tanstack/react-query';\r\nimport { useMemo } from 'react';\r\nimport { QueryConfig, QueryFunction, QueryKey } from '../types';\r\nimport {\r\n\tbuildDataQueryConfig,\r\n\tnormalizeReactQueryKey,\r\n\tparseEnabledProp,\r\n\tuseOnStateCallbacksReactQuery,\r\n\tuseRefetchReactQueryOnDemand,\r\n} from './utils';\r\nimport isFunction from 'lodash/isFunction';\r\n\r\nexport function useQueryV5(\r\n\tqueryKey: QueryKey,\r\n\tqueryFn: QueryFunction,\r\n\tqueryConfig: QueryConfig = {},\r\n) {\r\n\tconst normalizedQueryKey = useMemo(() => normalizeReactQueryKey(queryKey), [queryKey]);\r\n\tconst normalizedEnabled = parseEnabledProp(queryConfig);\r\n\tconst newReactQueryConfig = buildDataQueryConfig(queryConfig);\r\n\tconst queryResult = useQuery({\r\n\t\tqueryKey: normalizedQueryKey,\r\n\t\tqueryFn: queryFn,\r\n\t\t...newReactQueryConfig,\r\n\t});\r\n\tconst placeholderData = isFunction(newReactQueryConfig.placeholderData)\r\n\t\t? newReactQueryConfig.placeholderData()\r\n\t\t: newReactQueryConfig.placeholderData;\r\n\tconst {\r\n\t\tdata,\r\n\t\terror,\r\n\t\tisError,\r\n\t\tisFetched,\r\n\t\tisFetching,\r\n\t\tisLoading,\r\n\t\tisSuccess,\r\n\t\trefetch,\r\n\t\tstatus,\r\n\t\tisPending,\r\n\t\tfetchStatus,\r\n\t} = queryResult;\r\n\r\n\tuseOnStateCallbacksReactQuery({\r\n\t\tqueryConfig,\r\n\t\tqueryResult,\r\n\t});\r\n\r\n\tuseRefetchReactQueryOnDemand({\r\n\t\tqueryKey: normalizedQueryKey,\r\n\t\tqueryResult,\r\n\t\tenabled: normalizedEnabled,\r\n\t});\r\n\r\n\treturn useMemo(() => {\r\n\t\treturn {\r\n\t\t\tdata: data || placeholderData,\r\n\t\t\terror,\r\n\t\t\tisError,\r\n\t\t\tisFetched,\r\n\t\t\tisFetching,\r\n\t\t\tisLoading,\r\n\t\t\tisPending,\r\n\t\t\tisSuccess,\r\n\t\t\trefetch,\r\n\t\t\tstatus,\r\n\t\t\tfetchStatus,\r\n\t\t};\r\n\t}, [\r\n\t\tplaceholderData,\r\n\t\tdata,\r\n\t\terror,\r\n\t\tisError,\r\n\t\tisFetched,\r\n\t\tisFetching,\r\n\t\tisLoading,\r\n\t\tisPending,\r\n\t\tisSuccess,\r\n\t\trefetch,\r\n\t\tstatus,\r\n\t\tfetchStatus,\r\n\t]);\r\n}\r\n\r\n/*\r\nif (typeof queryConfig.staleTime === 'number') {\r\n\t\tnewReactQueryConfig.staleTime = queryConfig.staleTime;\r\n\t}\r\n\r\n\tif (!isUndefined(placeholderDataRef.current)) {\r\n\t\tnewReactQueryConfig.placeholderData = placeholderDataRef.current;\r\n\t}\r\n\r\n\tif (!isUndefined(initialDataRef.current)) {\r\n\t\tnewReactQueryConfig.initialData = initialDataRef.current;\r\n\t}\r\n\r\n\tnewReactQueryConfig.enabled = parsedEnabled;\r\n\r\n\tif (typeof queryConfig.cacheTime === 'number') {\r\n\t\tnewReactQueryConfig.gcTime = queryConfig.cacheTime;\r\n\t}\r\n\r\n\t\t// useEffect(() => {\r\n\t// \tplaceholderDataRef.current = queryConfig.placeholderData;\r\n\t// }, [queryConfig.placeholderData]);\r\n\r\n\t// useEffect(() => {\r\n\t// \tinitialDataRef.current = queryConfig.initialData;\r\n\t// }, [queryConfig.initialData]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (\r\n\t\t\tisFetched &&\r\n\t\t\tisSuccess &&\r\n\t\t\tisFetchedAfterMount &&\r\n\t\t\t!isPlaceholderData &&\r\n\t\t\t!isLoading &&\r\n\t\t\t!isFetching &&\r\n\t\t\t!isPending &&\r\n\t\t\t!isRefetching &&\r\n\t\t\t!isError &&\r\n\t\t\t!isUndefined(data) &&\r\n\t\t\ttypeof onSuccessRef.current === 'function'\r\n\t\t) {\r\n\t\t\tonSuccessRef.current(data as TResult);\r\n\t\t}\r\n\t}, [\r\n\t\tdata,\r\n\t\tisFetched,\r\n\t\tisSuccess,\r\n\t\tisPlaceholderData,\r\n\t\tisLoading,\r\n\t\tisFetching,\r\n\t\tisPending,\r\n\t\tisError,\r\n\t\tisRefetching,\r\n\t\tisFetchedAfterMount,\r\n\t]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (\r\n\t\t\tisFetchedAfterMount &&\r\n\t\t\t!isLoading &&\r\n\t\t\t!isFetching &&\r\n\t\t\t!isPending &&\r\n\t\t\t!isRefetching &&\r\n\t\t\terror &&\r\n\t\t\ttypeof onErrorRef.current === 'function'\r\n\t\t) {\r\n\t\t\tconsole.log(error);\r\n\t\t\tonErrorRef.current(error as TError);\r\n\t\t}\r\n\t}, [error, isFetchedAfterMount, isFetching, isLoading, isPending, isRefetching]);\r\n*/\r\n","export const FETCH_CUSTOM_PAGE_URL = '/page/customJson';\r\n","import { fetchCustomPageData } from '../api';\r\nimport { FETCH_CUSTOM_PAGE_URL } from '../const';\r\nimport { useDataQuery } from '@packages/dataQuery';\r\nimport { CustomPagePath, CustomPageWidgets } from '../types';\r\nimport { useStoragePerUserData } from '../../user';\r\nimport { LocalStorageKeys } from '../../../utils/storageManager';\r\nimport { isNull } from '../../../predicates/type';\r\nimport isArray from 'lodash/isArray';\r\n\r\nconst DEFAULT_DATA: CustomPageWidgets = [];\r\n\r\nfunction isValidData(data: CustomPageWidgets | null) {\r\n\treturn !isNull(data) && isArray(data);\r\n}\r\n\r\nexport function useCustomPageDataQuery(path: CustomPagePath) {\r\n\tconst { data, setData } = useStoragePerUserData(`${LocalStorageKeys.CustomPage}_${path}`);\r\n\r\n\tconst dataQuery = useDataQuery([FETCH_CUSTOM_PAGE_URL], () => fetchCustomPageData(path), {\r\n\t\tplaceholderData: () => {\r\n\t\t\tif (isValidData(data)) {\r\n\t\t\t\treturn data;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonSuccess: (newData) => {\r\n\t\t\tif (isValidData(newData)) {\r\n\t\t\t\tsetData(newData);\r\n\t\t\t}\r\n\t\t},\r\n\t\tstaleTime: 2000,\r\n\t});\r\n\r\n\treturn {\r\n\t\t...dataQuery,\r\n\t\tdata: dataQuery.data || DEFAULT_DATA,\r\n\t};\r\n}\r\n","import { FETCH_CUSTOM_PAGE_URL } from './const';\r\nimport { CustomPagePath, CustomPageWidgets } from './types';\r\nimport { GET } from '@packages/dataFetch';\r\n\r\nexport async function fetchCustomPageData(path: CustomPagePath) {\r\n\tconst response = await GET(FETCH_CUSTOM_PAGE_URL, {\r\n\t\tparams: { path },\r\n\t\tpageContentRequestHeader: true,\r\n\t});\r\n\r\n\treturn response.data;\r\n}\r\n","import React, { FC } from 'react';\r\nimport { useCustomPageDataQuery } from '../hooks';\r\nimport { CustomPageWidgets } from '../widgets';\r\nimport { PUBLIC_CUSTOM_PAGE_PATH } from '../../../utils/const';\r\n\r\nexport const PrivacyStatement: FC = () => {\r\n\tconst { data } = useCustomPageDataQuery(PUBLIC_CUSTOM_PAGE_PATH.privacyStatement);\r\n\r\n\treturn ;\r\n};\r\n","import React, { FC, Fragment } from 'react';\r\nimport Loadable from 'react-loadable';\r\nimport { isUndefined } from '../../../predicates/type';\r\nimport { CustomPageWidgetComponents, CustomPageWidgets as CustomPageWidgetsType } from '../types';\r\n\r\nconst LoadableHomePageImage = Loadable({\r\n\tloader: () => import('./HomePageImage').then((m) => m.HomePageImage),\r\n});\r\nexport const LoadableHomeJobCategory = Loadable({\r\n\tloader: () => import('./JobCategory').then((m) => m.JobCategory),\r\n});\r\nexport const LoadableHomeLatestPublicNews = Loadable({\r\n\tloader: () => import('./LatestPublicNews').then((m) => m.LatestPublicNews),\r\n});\r\nexport const LoadableCustomHtml = Loadable({\r\n\tloader: () => import('./CustomHtml').then((m) => m.CustomHtml),\r\n});\r\nexport const LoadableHomeFindJobs = Loadable({\r\n\tloader: () => import('./FindJobs').then((m) => m.FindJobs),\r\n});\r\nexport const LoadablePublicRegistrationForm = Loadable({\r\n\tloader: () => import('./PublicRegistrationForm').then((m) => m.PublicRegistrationForm),\r\n});\r\nexport const LoadableHowItWorks = Loadable({\r\n\tloader: () => import('./HomeHowItWorks').then((m) => m.HowItWorks),\r\n});\r\n\r\nexport const LoadableRecentPublicJobs = Loadable({\r\n\tloader: () => import('./RecentPublicJobs').then((m) => m.RecentPublicJobs),\r\n});\r\n\r\nconst LoadableCaoWijzerHome = Loadable({\r\n\tloader: () => import('./CaoWijzerHome').then((m) => m.CaoWijzerHome),\r\n});\r\n\r\nconst LoadableEmployers = Loadable({\r\n\tloader: () => import('./Employers').then((m) => m.Employers),\r\n});\r\n\r\nconst WIDGETS: CustomPageWidgetComponents = {\r\n\tHomePageImage: LoadableHomePageImage,\r\n\tJobCategory: LoadableHomeJobCategory,\r\n\tLatestPublicNews: LoadableHomeLatestPublicNews,\r\n\tHowItWorks: LoadableHowItWorks,\r\n\tCustomTile: LoadableCustomHtml,\r\n\tFindJobs: LoadableHomeFindJobs,\r\n\tPublicRegistrationForm: LoadablePublicRegistrationForm,\r\n\tRecentPublicJobs: LoadableRecentPublicJobs,\r\n\tCaoWijzerHome: LoadableCaoWijzerHome,\r\n\tEmployers: LoadableEmployers,\r\n};\r\n\r\nexport const CustomPageWidgets: FC> = ({ widgets }) => {\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{widgets.map((widget) => {\r\n\t\t\t\tconst WidgetComponent = WIDGETS[widget.tileType];\r\n\r\n\t\t\t\tif (isUndefined(WidgetComponent)) return null;\r\n\r\n\t\t\t\t// Todo: remove ts-ignore and found correct solution for describe types for widgets\r\n\t\t\t\treturn (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{/*// @ts-ignore*/}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t);\r\n\t\t\t})}\r\n\t\t\r\n\t);\r\n};\r\n"],"names":["useDataQuery","queryKey","queryFn","queryConfig","arguments","length","undefined","normalizedQueryKey","useMemo","normalizeReactQueryKey","normalizedEnabled","parseEnabledProp","newReactQueryConfig","buildDataQueryConfig","queryResult","useQuery","placeholderData","isFunction","data","error","isError","isFetched","isFetching","isLoading","isSuccess","refetch","status","isPending","fetchStatus","useOnStateCallbacksReactQuery","useRefetchReactQueryOnDemand","enabled","useQueryV5","FETCH_CUSTOM_PAGE_URL","DEFAULT_DATA","isValidData","isNull","isArray","useCustomPageDataQuery","path","setData","useStoragePerUserData","LocalStorageKeys","CustomPage","dataQuery","async","GET","params","pageContentRequestHeader","fetchCustomPageData","onSuccess","newData","staleTime","PrivacyStatement","PUBLIC_CUSTOM_PAGE_PATH","privacyStatement","_jsx","CustomPageWidgets","widgets","LoadableHomePageImage","Loadable","loader","then","m","HomePageImage","LoadableHomeJobCategory","JobCategory","LoadableHomeLatestPublicNews","LatestPublicNews","LoadableCustomHtml","CustomHtml","LoadableHomeFindJobs","FindJobs","LoadablePublicRegistrationForm","PublicRegistrationForm","WIDGETS","HowItWorks","CustomTile","RecentPublicJobs","CaoWijzerHome","Employers","_ref","_Fragment","children","map","widget","WidgetComponent","tileType","isUndefined","Fragment"],"sourceRoot":""}