{"version":3,"file":"index.DjCV9xzJ.js","sources":["../../../src/tjenestepanel-container/tiles.ts","../../../src/store/contentApi.ts","../../../src/store/tilesApi.ts","../../../src/store/reducer.ts","../../../src/store/index.ts"],"sourcesContent":["/// \n\nimport { createSlice, PayloadAction } from '@reduxjs/toolkit';\n\nimport { GetTilesOperationResult, TextMessage, Tile } from '@helsenorge/framework-utils/types/entities';\n\nimport { AppDispatch, RootState } from '../store';\n\nexport interface TilesState {\n loading: boolean;\n errorLoad?: TextMessage;\n helsetjenester?: Tile[];\n innsynstjenester?: Tile[];\n eksterneTjenester?: Tile[];\n loaded: boolean;\n}\n\nconst initialState: TilesState = {\n helsetjenester: [],\n innsynstjenester: [],\n eksterneTjenester: [],\n loading: false,\n errorLoad: undefined,\n loaded: false,\n};\n\nexport const fetchTiles =\n () =>\n (dispatch: AppDispatch): void => {\n if (window.HN?.Commands?.GetTiles) {\n dispatch(requestTiles());\n dispatch(loadedTiles());\n dispatch(receiveTiles(window.HN.Commands.GetTiles));\n }\n };\n\nexport function getLoading(state: RootState): boolean {\n return state.tiles.loading;\n}\n\nexport function getLoaded(state: RootState): boolean {\n return state.tiles.loaded;\n}\n\nexport function getError(state: RootState): TextMessage | undefined {\n return state.tiles.errorLoad;\n}\n\nexport function getHelsetjenesterTiles(state: RootState): Array | undefined {\n return state.tiles.helsetjenester;\n}\n\nexport function getInnsynstjenesterTiles(state: RootState): Array | undefined {\n return state.tiles.innsynstjenester;\n}\n\nexport function getEksterneTjenesterTiles(state: RootState): Array | undefined {\n return state.tiles.eksterneTjenester;\n}\n\nconst tilesSlice = createSlice({\n name: 'tiles',\n initialState,\n reducers: {\n requestTiles(state) {\n state.loading = true;\n },\n receiveTiles(state, action: PayloadAction) {\n state.helsetjenester = action.payload.Helsetjenester;\n state.innsynstjenester = action.payload.Innsynstjenester;\n state.eksterneTjenester = action.payload.EksterneTjenester;\n state.loading = false;\n },\n loadFailed(state, action: PayloadAction<{ error: TextMessage }>) {\n state.errorLoad = action.payload.error;\n state.loading = false;\n },\n loadedTiles(state) {\n state.loaded = true;\n },\n },\n});\n\nexport const { requestTiles, receiveTiles, loadedTiles } = tilesSlice.actions;\n\nexport default tilesSlice.reducer;\n","import { createApi } from '@reduxjs/toolkit/query/react';\n\nimport { ForsideDto } from '@helsenorge/core-cms/types/entities/cms.v1entities';\nimport LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport { getBaseQuery } from '@helsenorge/framework-utils/cms-content-api-service';\n\nconst contentApi = createApi({\n reducerPath: 'contentApi',\n baseQuery: getBaseQuery,\n endpoints: builder => ({\n getForside: builder.query({\n query: language => ['forside', { languageCode: language }],\n }),\n }),\n});\n\nexport const { useGetForsideQuery } = contentApi;\n\nexport default contentApi;\n","import { createApi } from '@reduxjs/toolkit/query/react';\n\nimport { GetAuthenticatedTilesResponse } from '@helsenorge/core-cms/types/entities/Helsenorge.CoreFrontend.InternalApiEntities';\nimport LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport { getBaseQuery } from '@helsenorge/framework-utils/hn-proxy-service';\n\nconst tilesApi = createApi({\n reducerPath: 'tilesApi',\n baseQuery: getBaseQuery,\n endpoints: builder => ({\n getTiles: builder.query({\n query: language => ['corefrontendinternal', 'AuthenticatedTiles/v1', { culture: language.toLowerCase() }],\n }),\n }),\n});\n\nexport const { useGetTilesQuery } = tilesApi;\n\nexport default tilesApi;\n","import { combineReducers } from '@reduxjs/toolkit';\n\nimport pendingChanges from '@helsenorge/core-framework/pending-changes/pending-changes-state';\nimport hjelpeskuff from '@helsenorge/core-framework/prosesshjelp/hjelpeskuff/hjelpeskuff-state';\nimport LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport cmsTjenesteTekster from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nimport getFeatureToggle from '@helsenorge/framework-utils/hn-feature-toggle';\nimport language, { createLanguageReducer } from '@helsenorge/framework-utils/language';\nimport resources from '@helsenorge/framework-utils/resources';\n\nimport contentApi from './contentApi';\nimport tilesApi from './tilesApi';\nimport tiles from '../tjenestepanel-container/tiles';\n\nconst rootReducer = combineReducers({\n language: getFeatureToggle('NyForside2025')\n ? createLanguageReducer([LanguageLocales.NORWEGIAN, LanguageLocales.ENGLISH, LanguageLocales.SAMI_NORTHERN])\n : language,\n resources,\n hjelpeskuff,\n tiles,\n pendingChanges,\n cmsTjenesteTekster,\n [contentApi.reducerPath]: contentApi.reducer,\n [tilesApi.reducerPath]: tilesApi.reducer,\n});\n\nexport default rootReducer;\n","import { configureStore } from '@reduxjs/toolkit';\n\nimport contentApi from './contentApi';\nimport rootReducer from './reducer';\nimport tilesApi from './tilesApi';\n\nexport const store = configureStore({\n reducer: rootReducer,\n middleware: getDefaultMiddleware => getDefaultMiddleware().concat(contentApi.middleware).concat(tilesApi.middleware),\n});\n\nexport type RootState = ReturnType;\n\nexport type AppDispatch = typeof store.dispatch;\n"],"names":["initialState","fetchTiles","dispatch","_b","_a","requestTiles","loadedTiles","receiveTiles","getLoading","state","getLoaded","getError","getHelsetjenesterTiles","getInnsynstjenesterTiles","getEksterneTjenesterTiles","tilesSlice","createSlice","action","tiles","contentApi","createApi","getBaseQuery","builder","language","useGetForsideQuery","tilesApi","useGetTilesQuery","rootReducer","combineReducers","getFeatureToggle","createLanguageReducer","LanguageLocales","resources","hjelpeskuff","pendingChanges","cmsTjenesteTekster","store","configureStore","getDefaultMiddleware"],"mappings":"8KAiBA,MAAMA,EAA2B,CAC/B,eAAgB,CAAC,EACjB,iBAAkB,CAAC,EACnB,kBAAmB,CAAC,EACpB,QAAS,GACT,UAAW,OACX,OAAQ,EACV,EAEaC,EACX,IACCC,GAAgC,UAC3BC,GAAAC,EAAA,OAAO,KAAP,YAAAA,EAAW,WAAX,MAAAD,EAAqB,WACvBD,EAASG,GAAc,EACvBH,EAASI,GAAa,EACtBJ,EAASK,EAAa,OAAO,GAAG,SAAS,QAAQ,CAAC,EAEtD,EAEK,SAASC,EAAWC,EAA2B,CACpD,OAAOA,EAAM,MAAM,OACrB,CAEO,S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