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OAAOqG,GAAK,CAACA,EAAE,SAAS,MAAM,GAC/B,IAAKg+B,GAAU,CACZA,EAAM,SAAS,MAAM,EACrBN,EAAiB,GAAG,OAAAP,EAAM,KAAI,OAAAa,EAAO,EAGrCJ,EAAa,GAAG,OAAAT,EAAM,KAAI,OAAAa,EAAO,CAEzD,KAIgBnkC,GAAAH,EAAA+jC,EAAOL,CAAS,IAAhB,YAAA1jC,EAAmB,MAAnB,MAAAG,EAAwB,IAAImkC,GAAS,CACjCN,EAAiB,GAAG,OAAAP,EAAM,KAAI,OAAAa,EAAO,CACzD,GACgBP,EAAOL,CAAS,GAAKQ,EAAa,GAAG,OAAAT,EAAM,KAAI,QAAAvjC,EAAA6jC,EAAOL,CAAS,IAAhB,YAAAxjC,EAAmB,MAAQ,QAAQ,EAEzF,GACI,MAAMS,GAAK,CACZkG,GAAMlG,EAAGmjC,CAAS,CAC9B,CAAS,CACT,CACI,OAAO,QAAQ,QAAS,CAC5B","names":["LanguageLocales","decapitalize","s","format","args","allowEmptyStrings","match","number","DateFormat","initialize","setDefaultOptions","nb","safeParseJSON","date","_date","parseJSONDF","toCentralEuropeanTime","cetDate","formatCET","formatStr","options","formatDF","safeFormatCET","getFeatureToggle","featureName","getFeatureToggles","_b","_a","_d","_c","_e","LOGGED_IN_COOKIE_NAME","SESSION_ID_COOKIE_NAME","hasCookie","cookieName","value","cookie","e","getSuffix","suffix","hasCookieWithSuffix","hasLoggedInCookie","getCookieValue","name","cookieWithSuffix","getHostnameWithoutSubdomain","IdentityProvider","SamtykkeType","SamtykkeLevel","FullmaktType","SamtykkeStatusType","RepresentasjonforholdType","StatusKodeType","SessionTimeoutAction","PersonverninnstillingKategori","TjenesteTilgangStatus","Personverninnstilling","CmsContentApiVersions","getVisPersonvelger","getErRepresentasjon","getScopes","hasScope","scope","getHarAktivtForeldreSamtykke","getPersonverninnstillinger","hasPersonverninnstilling","guid","HeaderFooterEvents","CmsBlocksEvents","CommonEvents","WebComponents","StepEvents","handleIOSSafariUA","ua","iOS","isAppleMobileDevice","webkit","isAndroid","pushToDataLayer","payload","trackSelfService","trackAction","serviceName","action","flow","trackTool","type","labels","trackProsesshjelp","trackPageview","hasContent","trackError","level","details","trackNavigation","label","pageSection","trackLanguage","language","__cookieOptions__","getCookieDomainAndPath","setSharedCookie","maxAgeInDays","maxAgeInSeconds","dispatchCustomEvent","selector","eventType","detail","element","HNeventShowAppInvitation","onAppOpen","onWebLogin","onClose","HNeventSetRedirectTo","redirectTo","HNeventSetRedirectToUrlAfterLogin","redirectToUrlAfterLogin","LANGUAGE_COOKIE_NAME","LANGUAGE_COOKIE_EXPIRES_IN_DAYS","getUserLanguage","setUserLanguage","getIsoLanguageName","setDocumentLanguage","isoLanguage","parseParams","params","queryString","key","x","createBaseHeaders","checkStatus","response","contentType","correlationId","getCorrelationIdFromResponse","error","HelsenorgeHttpError","decycle","object","objects","paths","derez","path","i","nu","LogLevel","unwrapError","potentialError","HelsenorgeProxyError","innerError","generateEntry","message","optionalParams","fullMessage","previous","current","postLogEntry","logEntry","getTjenesterUrl","logToServer","logLevel","getServerLogLevel","exportFunctions","captureErrors","stack","debug","allowConsoleOutput","info","trace","warn","assert","test","clear","count","countTitle","dir","dirxml","group","groupTitle","groupCollapsed","groupEnd","log","profile","reportName","profileEnd","table","data","time","timerName","timeEnd","isProxyErrorResponse","isPascalCaseProxyErrorResponse","mapPascalCaseErrorToCamelCase","saveCorrelationId","getCorrelationIdList","statusCode","getTjenesterApiUrl","proxyName","endpoint","apiUrl","getRequestHeaders","headers","createHeaders","getHelsenorgeUrl","handleError","baseCrud","method","baseUrl","requestBody","get","endPoint","post","remove","getContentApiUrl","getContentApiPreviewUrl","enableContentApiPreview","version","preview","hostName","credentials","languageCode","restParams","patch","REQUEST","RECEIVE","FAILURE","SETDEFAULTHJELPETEKST","ADDSPESIFIKKEHJELPETEKSTER","getTjenesteTeksterKey","cmsTjenesteTekster","tjenesteTeksterState","tjenesteTeksterKey","existingData","updatedData","selectCmsTjenesteTekster","state","selectCmsTjenesteTekstForHjelpetekstId","hjelpetekstId","t","_h","_g","_f","h","selectFeedbackResources","shouldFetchTjenesteTekster","fetchTjenesteTekster","dispatch","getState","tjenesteTekster","Projects","getPath","getAssetsUrl","getSidetittelId","isDebug","requestResources","project","receiveResources","receiveResourcesFailed","resources","resourcesState","stringifiedKey","getResources","getResourcesFromState","getResourceWithId","json","getModifiedResourcesForTest","resourceText","shouldFetchResources","fetchResources","getResourceFile","success","failure","Samtykke","getSamtykke","hasSamtykke","Breadcrumb","homeLabel","homeUrl","link","ariaLabel","hoverRef","isHovered","useHover","innerContent","_jsxs","_Fragment","_jsx","Icon","ChevronLeft","styles","handleLinkClick","Link","currentConfiguration","resolve","originalKey","getCurrentConfiguration","getRedirectToUrlAfterLogin","configuration","getDelAvForeldresamtykke","getBreadcrumbLink","contentResources","pageConfiguration","url","helsenorgeUrlPlaceholder","getCmsBreadcrumbLink","BreadcrumbComponent","ErrorMessage","labelId","description","NotificationPanel","Spacer","React","withErrorBoundary","COMPONENT","GuardedComponent","props","logError","ErrorPanel","ErrorBoundary","getIcon","EmoticonDelighted","EmoticonHappy","EmoticonMeh","EmoticonDisappointed","EmoticonAnnoyed","ScoreInput","disabled","expanded","selected","rest","ref","id","classNames","theme","SuccessMessage","children","PaperPlane","scoreValueList","trackScore","score","trackComment","sanitizeValue","string","createFeedback","body","updateFeedback","sanitized","useEffect","FeedbackFormState","useFeedbackForm","isSubmitting","setIsSubmitting","useState","isSubmitSuccessful","setIsSubmitSuccessful","setId","setScore","comment","setComment","commentError","setCommentError","setError","scoreRegister","changeEvent","commentRegister","createFeedbackResponse","api.createFeedback","api.updateFeedback","handleUpdate","debouncedUpdate","teardown","debounce","commentIsValid","CHARACTER_LIMIT","handleSubmit","onSubmit","event","formState","TEXTAREA_ID","DESCRIPTION_ID","FeedbackForm","pageTitle","showComment","getButtonAriaLabel","Label","TextArea","Button","Feedback","useAppDispatch","useDispatch","useAppSelector","useSelector","FeedbackContainer","tjenesteNavn","feedbackResources","__glob","map","fn","globImport_json","__vitePreload","HN_Core_Framework_NPM_JS_enGB$1","HN_Core_Framework_NPM_JS_ltLT$1","HN_Core_Framework_NPM_JS_nbNO","HN_Core_Framework_NPM_JS_nnNO$1","HN_Core_Framework_NPM_JS_plPL$1","HN_Core_Framework_NPM_JS_roRO$1","HN_Core_Framework_NPM_JS_ruRU$1","HN_Core_Framework_NPM_JS_seNO$1","HN_CoreFrontend_NPM_Packages_CMS_nbNO$1","HN_CoreFrontend_NPM_Packages_Framework_nbNO$1","HN_CoreFrontend_Web_Forside_nbNO$1","HN_MinHelse_Common_JS_enGB$1","HN_MinHelse_Common_JS_ltLT$1","HN_MinHelse_Common_JS_nbNO$1","HN_MinHelse_Common_JS_nnNO$1","HN_MinHelse_Common_JS_plPL$1","HN_MinHelse_Common_JS_roRO$1","HN_MinHelse_Common_JS_ruRU$1","HN_MinHelse_Common_JS_seNO$1","HN_MinHelse_Content_enGB$1","HN_MinHelse_Content_nbNO$1","HN_MinHelse_Content_nnNO$1","HN_MinHelse_Content_seNO$1","HN_Tjenester_Content_enGB$1","HN_Tjenester_Content_nbNO","HN_Tjenester_Content_nnNO$1","getResourceItem","projectName","Languages","frameworkNbNo","contentNbNo","LanguagePicker","languages","selectedLanguage","changeLanguage","className","testId","languageChangedMessage","setLanguageChangedMessage","handleLanguageChange","locale","currentLanguage","l","IconSize","Globe","index","LanguagePickerWrapper","languageConfig","envSafeUrl","DOMPurify","TRUSTED_TYPES_FEATURE_NAME","hasDefaultTrustedTypesPolicy","isTrustedTypesEnabled","DefaultSanitizeConfig","sanitize","html","SafeHTML","tagName","CustomTag","designsystemtypography","Markdown","Title","AnchorLink","List","aria","domEl","siblings","sibling","child","keyCode","getEventTarget","getDocumentActiveElement","logCallback","domNode","root","TrapFocus","isTriggerWithinTrappedArea","activeElement","target","tabbable","itemWithFocus","currentFocusIndex","previousElement","previousFocusIndex","nextElement","nextFocusIndex","item","radioGrouItems","selectedItems","EkspanderendeTekstBlock","title","mainContent","Expander","PortableText","EkspanderendeBlock","EkspanderendeBlockComponent","PromoBlockType","PromoBlockColors","ImageType","WindowActionEnum","Size","VideoType","CardsPerRow","VideoTheme","Image","imageUrl","caption","copyright","size","alternativeText","figureClass","imageClass","captionClass","typography","cmsstyles","ImageBlock","ImageBlockComponent","CmsLinkList","color","links","chevron","LinkList","href","text","iconName","LazyIcon","LinkListBlock","titleHtmlMarkup","additionalLinkList","useGridLayout","contentClassName","cn","useContext","backgroundColor","PortableTextContext","LinkListBlockComponent","getAppUrl","LoginButton","htmlMarkup","icon","rightSideIcon","appUrl","setAppUrl","buttonRef","triggerOriginalBehaviour","useAppUrl","mobileOnClick","getIconColor","bindClassNames","Panel","emphasize","linkTitle","intro","colorName","linkTarget","large","iconComponent","iconOrEmphasisComponent","spacingClassNames","titleComponent","ArrowRight","renderSection","linkClassNames","LoginBlock","authenticatedTitle","authenticatedIntro","hideIfAuthenticated","buttonText","showOnlyButton","isAuthenticated","setIsAuthenticated","isAuthorized","getColorName","contextColor","blockColor","LoginBlockComponent","TextBlockComponent","titleAppearance","mainIntro","mainBody","fontStyles","TextBlock","RichTextTitle","htmlMarkupAppearanceMap","VimeoSubtitleLanguageCodes","useRef","YouTubeTermsOfService","handleAccept","checkboxRef","Checkbox","YOUTUBE_TOS_COOKIE_NAME","YOUTUBE_EVENT_NAME","YOUTUBE_COOKIE_AGE_DAYS","VideoSpiller","videoId","videoType","altText","showTextContent","subtitleLanguageCode","tosAccepted","setTosAccepted","remember","handleAcceptEvent","getVideoUrl","getAllowAttribute","videoUrl","allowAttribute","showTermsOfService","renderTextContent","VideoBlock","VideoSpillerComponent","AnalyticsId","VideoKort","onClick","wrapperClassName","hasFullWidth","cardsPerRow","playVideoLabel","uuid","useUuid","buttonId","titleId","descriptionId","wrapperClasses","videoCardClasses","imageClasses","buttonAriaLabelledBy","buttonAriaDescribedBy","playLabelClasses","titleClasses","designTheme","Play","VideoMatrise","videoCards","currentIndex","setIndex","matriseRef","card","VideoMatriseBlock","VideoMatriseComponent","isVideoThemeColor","globalComponents","createContext","components","PortableTextReact","Seksjon","seksjon","errorMessage","seksjonComponent","loader","Loader","sectionClasses","ChevronUp","ChevronDown","Collapse","HjelpeskuffComponent","isVisible","defaultSeksjon","seksjoner","breakpoint","useBreakpoint","disableTransition","setDisableTransition","helpTitleRef","helpDrawerRef","helpContentsRef","prevAriaHiddens","setPrevAriaHiddens","trapFocus","setTrapFocus","prevFocus","setPrevFocus","useFocusToggle","trackToggleOpen","activeSeksjonId","isOpen","activeSeksjon","enableTrapFocus","toggleFocus","node","releaseFocus","handleToggleClick","elementIsInHelpDrawer","eventTarget","elementIsInHjelpetrigger","isMobile","Breakpoint","isOpenInHistoryState","removePreventscroll","isLightboxOpen","setScroll","open","close","disableTransitionToPreventDoubleAnimation","callback","popStateListener","helpDrawerOpen","clickListener","eventPath","removeSeksjon","triggerId","helpDrawerClasses","defaultSeksjonComponent","seksjonerComponent","style","ariaLabelTitleText","HelpSign","ChevronRight","X","TOGGLE_SHOW","TOGGLE_SHOW_HELPITEM","SET_ACTIVE_HELPBUBBLE","HIDE","SHOW","REMOVE_SEKSJON","TOGGLE_EXPANDED","ADD_HJELPETRIGGER","REMOVE_HJELPETRIGGER","POPULATE_SKUFF","initialState","collapseAll","isDefaultTrigger","processToggleShowHelp","activeTriggerComponentId","sameTriggerId","sameTriggerComponentId","getBlankSeksjonIdIfActiv","removeSection","reducer","toggleShowHjelpeskuff","toggleShowHelpItem","triggerComponentId","removeSeksjonTekst","toggleExpanded","hideHjelpeskuff","showHjelpeskuff","addHjelpetrigger","removeHjelpetrigger","setActiveBubble","populateSkuff","getTriggerData","triggerData","sporsmaalTekst","hjelpeboble","hjelpetekst","overskrift","getActiveBubble","getDefaultTekst","spesifikkHjelpetekst","tjenesteTeksterDetails","getSeksjonTekst","hjelpeteksterForTjeneste","ht","TriggerHelpItemEvent","AddHjelpetrigger","RemoveHjelpetrigger","HjelpeskuffContainer","triggerComponentIds","mount","other","mapStateToProps","mapDispatchToProps","connect","HjelpetriggerComponent","sporsmalstekst","classes","isHelpBubbleTrigger","helpBubbleIsExpanded","stopPropagation","useCustomEvent","ariaAttributes","handleHelpClick","helpElement","triggerHelpItemEvent","trigger","HelpQuestion","Trigger","HjelpebobleComponent","onChange","onShowMoreClick","visible","bubbleText","moreHelpText","hjelpetriggerRef","showMoreButton","renderBubbleContent","showMoreClickHandler","renderBubble","HelpBubble","HjelpetriggerContainer","addHjelpetriggerEvent","getResourcesEvent","GetResourcesEvent","removeHjelpetriggerEvent","isDefault","Hjelpetrigger","overrideHelpetekstId","overrideTjenesteNavn","activeBubble","extraProps","helpTriggerItem","SharingStatus","selectedStatusType","sharingStatus","FrankensteinSharingStatus","Eye","NoEye","PageHeader","subtitle","delAvForeldresamtykke","headerClassName","headerSubtitleClassName","headerTitleClassName","headerIngressClassName","showHjelpetrigger","hasHjelpetrigger","renderHjelpetrigger","frameworkstyles","pageHeaderClasses","Personvelger","webcompIsReady","setWebcompIsReady","location","useLocation","Master","prevProps","mainAriaLabelledby","visPersonvelger","breadcrumbLink","hasFullwidth","noBreadcrumb","noDriftspanel","showFeedbackForm","hasPageHeader","showHjelpeskuffInPageHeader","pageBreadcrumbLinks","getTitleId","canShowHjelpetekstInPageHeader","spesifikkHjelpeTekst","defaultHjelpetekst","useTrackPageView","enabled","previousPathname","TrackPageView","PageRoot","noHjelpeskuff","pageDescription","enablePageviewTracking","Hjelpeskuff","PageRoot$1","hashIsAuthorized","LayoutUtils","layoutChange","LayoutChangeComponent","forwardedRef","originalProps","RefForwardingFactory","defaultResources","ResourcesContext","useResourcesContext","ResourcesContextProvider","NoScroll","OffCanvas","isOpened","setIsVisible","wrapperRef","handleTransitionEnd","useFocusTrap","useKeyboardEvent","KeyboardEventKey","contentClasses","FilterGroup","placeholder","showMobileFilterState","setShowMobileFilterState","handleToggleMobileFilterState","offCanvasHeader","FormGroup","Dropdown","DesktopSort","maxLabelLength","setMaxLabelLength","handleSort","newMaxLabelLength","Select","useStateValue","stateValue","setStateValue","MobileSort","setIsOpen","sortKey","setSortKey","resetSortKey","handleOpen","handleClose","cb","handleShowResults","RadioButton","FilterSortWrapper","FilterSort","Status","moveSortLast","a","b","Filter","afterHeadingChildren","afterActiveFiltersChildren","activeFilters","extraFilterOptions","showFilters","filterOptions","footerContent","isAlwaysOpen","isDisabled","allowMobileView","numResults","status","statusText","onFilterOpen","searchBelowFilter","searchFilter","isMobileUA","prevActiveFilters","setPrevActiveFilters","showFiltersState","setShowFiltersState","isLoading","isSlowSearch","toggleShowMainFilter","onSubmitHandler","isFilterResultSubmitted","resetActiveFilters","af","activeFilterTag","renderActiveFilters","renderTags","renderChips","TagList","Tag","Chip","NoFilter","renderFilterOptions","isInsideFilter","sortedFilterOptions","renderChildren","isComponent","fo","renderSlowSearchSubmitButton","renderFilter","renderDesktopFilter","renderAfterHeadingChildren","noBottomPaddingClass","ExpanderSize","counter","useFilters","filters","setFilters","delayedFilters","setDelayedFilters","searchQuery","setSearchQuery","setFilter","prevState","setDelayedFilter","updateFilters","removeFilterFromState","_","isEmpty","obj","PageLoader","warning","spinning","SubContent","countShowing","showMorePageSize","showMoreButtonClasses","showMoreButtonText","updateCountShowing","subContentClasses","classnames","reverseSortDirection","sortDir","SortDirection","columns","colSortDirs","onHeaderClickSortChange","initialSortColumnKey","sortDisabled","sortColumnKey","expandableRow","isTwoDimensional","sortedData","TableHeadCell","column","altTitle","headerkey","sortDirection","Cell","highlight","highlightStartIndex","highlightEndIndex","textStart","textHighlight","textEnd","highlightText","childProps","highlightedChildren","columnKey","content","TableCell","Row","expandableRowKey","rowKey","toggle","rowData","tableId","showDetailsText","hideDetailsText","newColumns","expandableRowId","TableExpanderCell","processedJsonObjectName","rowValue","processedColName","rowClasses","cells","TableRow","sortIndexes","useNumericSort","customSetSortValue","valueA","valueB","processedColNameValue","tempA","tempB","columnValue","compareOptions","sortVal","isTableTwoDimensional","createLevel2Rows","isExpanded","rows","childRows","j","childRowKey","createRows","toggleExpandRow","getOrCreateRowRef","rowKeyColumnKey","emptyContentText","emptyContentElement","expandedRows","isExpandableRow","level2Rows","isColumn","checkChildren","updateColumns","DataTable","_prevProps","isClicked","newCountShowing","initialSortDirIsAsc","disableTwoDimensional","childrenProps","nextProps","updatedState","nextSortColumnKey","nextSortColumDir","newData","currentColumnCount","nextColumnCount","wrapperClassNames","tableClassNames","breakpointConfig","noAnchorLinkWrapper","rowClassNames","mode","tableClasses","captionId","Table","TableHead","HeaderCategory","TableBody","Column","ExpandableRow","colspan","childrenElement","TableExpandedRow","setTabIndex","newPrevTabIndexes","updatedTabbableElements","el","resetTabIndex","tabbableElements","previousTabIndexes","currentTabIndex","isCustomElementRegistered","isTemplateRenderedServerSide","templateElement","createMicrowebTemplate","templateName","isWebpackAssetsJson","getHelsenorgeCssUrl","elementList","linkElement","blockUntilEvent","fetchWebComp","domain","entryName","componentName","includeHelsenorgeCss","microwebTemplate","assetsUrl","assets","appendStylesheet","cssElement","appendScript","src","scriptElement","helsenorgeCssUrl","asset"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117],"sources":["../../../node_modules/@helsenorge/core-utils/constants/languages.js","../../../node_modules/@helsenorge/core-utils/string-utils.js","../../../node_modules/@helsenorge/core-utils/date-fns-utils.js","../../../node_modules/@helsenorge/framework-utils/hn-feature-toggle.js","../../../node_modules/@helsenorge/framework-utils/cookie.js","../../../node_modules/@helsenorge/framework-utils/types/entities.js","../../../node_modules/@helsenorge/framework-utils/hn-user.js","../../../node_modules/@helsenorge/framework-utils/web-component/constants.js","../../../node_modules/@helsenorge/core-utils/user-agents-utils.js","../../../node_modules/@helsenorge/framework-utils/adobe-analytics.js","../../../node_modules/@helsenorge/framework-utils/shared-cookies.js","../../../node_modules/@helsenorge/framework-utils/web-component/events.js","../../../node_modules/@helsenorge/framework-utils/hn-language.js","../../../node_modules/@helsenorge/framework-utils/hn-service.js","../../../node_modules/@helsenorge/framework-utils/cycle.js","../../../node_modules/@helsenorge/framework-utils/logger.js","../../../node_modules/@helsenorge/framework-utils/hn-proxy-service.js","../../../node_modules/@helsenorge/framework-utils/cms-content-api-service.js","../../../node_modules/@helsenorge/framework-utils/cms-tjeneste-tekster.js","../../../node_modules/@helsenorge/framework-utils/constants/projects.js","../../../node_modules/@helsenorge/framework-utils/hn-page.js","../../../node_modules/@helsenorge/framework-utils/hn-debug.js","../../../node_modules/@helsenorge/framework-utils/resources.js","../../../node_modules/@helsenorge/framework-utils/samtykke-utils.js","../../../node_modules/@helsenorge/core-cms/breadcrumb/index.js","../../../node_modules/@helsenorge/core-framework/common/configuration.js","../../../node_modules/@helsenorge/core-framework/breadcrumb/index.js","../../../node_modules/@helsenorge/core-framework/error-message/index.js","../../../node_modules/@helsenorge/core-framework/error-boundary/with-error-boundary.js","../../../node_modules/@helsenorge/core-framework/error-boundary/index.js","../../../node_modules/@helsenorge/core-framework/feedback/score-input/utils.js","../../../node_modules/@helsenorge/core-framework/feedback/score-input/index.js","../../../node_modules/@helsenorge/core-framework/feedback/success-message/index.js","../../../node_modules/@helsenorge/core-framework/feedback/utils/entities.js","../../../node_modules/@helsenorge/core-framework/feedback/utils/analytics.js","../../../node_modules/@helsenorge/core-cms/userfeedback/utils/string.js","../../../node_modules/@helsenorge/core-framework/feedback/utils/api.js","../../../node_modules/@helsenorge/core-framework/feedback/utils/form.js","../../../node_modules/@helsenorge/core-framework/feedback/index.js","../../../node_modules/@helsenorge/core-framework/store/hooks.js","../../../node_modules/@helsenorge/core-framework/feedback/container/index.js","../../../node_modules/@helsenorge/core-framework/resources/index.js","../../../node_modules/@helsenorge/core-framework/language-picker/index.js","../../../node_modules/@helsenorge/core-framework/language-picker-wrapper/index.js","../../../node_modules/@helsenorge/framework-utils/components/safe-html/safe-html.js","../../../node_modules/@helsenorge/framework-utils/trusted-types.js","../../../node_modules/@helsenorge/framework-utils/components/safe-html/index.js","../../../node_modules/@helsenorge/core-utils/aria-hidden.js","../../../node_modules/@helsenorge/core-utils/constants/key-code.js","../../../node_modules/@helsenorge/core-utils/events.js","../../../node_modules/@helsenorge/core-utils/focus-utils.js","../../../node_modules/@helsenorge/core-utils/trapfocus.js","../../../node_modules/@helsenorge/core-cms/behandlingsvalg/ekspanderendeblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/ekspanderendeblock/index.js","../../../node_modules/@helsenorge/core-cms/types/entities.js","../../../node_modules/@helsenorge/core-cms/image/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/imageblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/link/index.js","../../../node_modules/@helsenorge/core-cms/linklistblock/linklist/index.js","../../../node_modules/@helsenorge/core-cms/linklistblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/linklistblock/index.js","../../../node_modules/@helsenorge/framework-utils/url.js","../../../node_modules/@helsenorge/core-cms/loginblock/LoginButton.js","../../../node_modules/@helsenorge/core-cms/shared/getIconColor.js","../../../node_modules/@helsenorge/core-cms/panel/index.js","../../../node_modules/@helsenorge/core-cms/loginblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/loginblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/textblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/title/index.js","../../../node_modules/@helsenorge/core-cms/videospiller/constants.js","../../../node_modules/@helsenorge/core-cms/videospiller/youtube-terms-of-service.js","../../../node_modules/@helsenorge/core-cms/videospiller/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/videoblock/index.js","../../../node_modules/@helsenorge/core-cms/shared/analytics.js","../../../node_modules/@helsenorge/core-cms/videokort/index.js","../../../node_modules/@helsenorge/core-cms/videomatrise/index.js","../../../node_modules/@helsenorge/core-cms/richtext/components/videomatriseblock/index.js","../../../node_modules/@helsenorge/core-cms/richtext/portable-text-utils.js","../../../node_modules/@helsenorge/core-cms/richtext/index.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpeskuff/seksjon.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpeskuff/hjelpeskuff-component.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpeskuff/hjelpeskuff-state.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpeskuff/index.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpetrigger/hjelpetrigger-component.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpetrigger/hjelpeboble-component.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpetrigger/hjelpetrigger-container.js","../../../node_modules/@helsenorge/core-framework/prosesshjelp/hjelpetrigger/index.js","../../../node_modules/@helsenorge/core-framework/sharing-status/index.js","../../../node_modules/@helsenorge/core-framework/page-header/index.js","../../../node_modules/@helsenorge/core-framework/personvelger/index.js","../../../node_modules/@helsenorge/core-framework/pageroot/master.js","../../../node_modules/@helsenorge/core-framework/track-pageview/useTrackPageView.js","../../../node_modules/@helsenorge/core-framework/track-pageview/index.js","../../../node_modules/@helsenorge/core-framework/pageroot/index.js","../../../node_modules/@helsenorge/framework-utils/hn-authorize.js","../../../node_modules/@helsenorge/core-utils/layout.js","../../../node_modules/@helsenorge/core-utils/hoc/layout-change.js","../../../node_modules/@helsenorge/filter/components/filter/resources.js","../../../node_modules/@helsenorge/filter/components/offcanvas/index.js","../../../node_modules/@helsenorge/filter/components/filter/filter-group.js","../../../node_modules/@helsenorge/filter/components/filter/desktop-sort.js","../../../node_modules/@helsenorge/filter/components/filter/useStateValue.js","../../../node_modules/@helsenorge/filter/components/filter/mobile-sort.js","../../../node_modules/@helsenorge/filter/components/filter/filter-sort.js","../../../node_modules/@helsenorge/filter/components/filter/index.js","../../../node_modules/@helsenorge/filter/components/filter/useFilters.js","../../../node_modules/@helsenorge/core-framework/page-loader/page-loader.js","../../../node_modules/@helsenorge/data-table/components/table/sub-content.js","../../../node_modules/@helsenorge/data-table/components/table/table-head-helper.js","../../../node_modules/@helsenorge/data-table/components/table/cell.js","../../../node_modules/@helsenorge/data-table/components/table/row.js","../../../node_modules/@helsenorge/data-table/components/table/table-helper.js","../../../node_modules/@helsenorge/data-table/components/table/table.js","../../../node_modules/@helsenorge/data-table/components/table/column.js","../../../node_modules/@helsenorge/data-table/components/table/expandable-row.js","../../../node_modules/@helsenorge/core-utils/tabbable-utils.js","../../../node_modules/@helsenorge/framework-utils/web-component/register.js","../../../node_modules/@helsenorge/framework-utils/web-component/fetcher.js"],"sourcesContent":["export var LanguageLocales;\n(function (LanguageLocales) {\n LanguageLocales[\"NORWEGIAN\"] = \"nb-NO\";\n LanguageLocales[\"NORWEGIAN_NYNORSK\"] = \"nn-NO\";\n LanguageLocales[\"ENGLISH\"] = \"en-GB\";\n LanguageLocales[\"LITHUANIAN\"] = \"lt-LT\";\n LanguageLocales[\"POLISH\"] = \"pl-PL\";\n LanguageLocales[\"RUSSIAN\"] = \"ru-RU\";\n LanguageLocales[\"ROMANIAN\"] = \"ro-RO\";\n LanguageLocales[\"SAMI_NORTHERN\"] = \"se-NO\";\n})(LanguageLocales || (LanguageLocales = {}));\nexport default LanguageLocales;\n","import { unescapeHexEntities, unescapeHtmlEntities } from './html-entities';\n/**\n * Returnerer true når en streng er null, undefined eller tom\n * @param s - streng som skal sjekkes\n */\nexport const isEmpty = (string) => {\n if (string && string.trim)\n string = string.trim();\n return string === '' || string === null || string === undefined;\n};\n/**\n * Returnerer true når strengen inneholder følgende symboler: \"!#¤%=?`´^¨~*:;£${[\\]}|§€><\\|\n * @param s - streng som skal sjekkes\n */\nexport const hasInvalidCharacters = (s) => {\n return /[\"\"!#¤%=?`´^¨~*:;£${[\\]}|§€><\\|]/.test(s);\n};\n/**\n * Returnerer en streng med uppercase på første bokstav\n * @param s - streng å konvertere\n */\nexport const capitalize = (s) => {\n const capitalized = s.charAt(0).toUpperCase() + s.substring(1);\n return capitalized;\n};\n/**\n * Returnerer en streng uten uppercase på første bokstav\n * @param s - streng å konvertere\n */\nexport const decapitalize = (s) => {\n const decapitalized = s.charAt(0).toLowerCase() + s.substring(1);\n return decapitalized;\n};\n/**\n * Returns true if the input corresponds with a norwegian phone number format\n * @param phoneNumber - string or number of the phone number\n */\nexport const isNorwegianPhoneNumber = (phoneNumber) => {\n const regexString = '^(0047|[+]47)?[4|9][0-9]{7,7}$';\n return new RegExp(regexString, 'i').test(phoneNumber.toString().replace(new RegExp(' ', 'g'), ''));\n};\n/**\n * Returns a new string where plaeholders {number} have been replaced by items\n * ex: 'my string {0} ' where 0 will be replaced by the first element in args array\n * Note: The order of elements in string decide what order it should be replaced, not number!\n * @param s - string to format\n * @param args is a array in order you want them replaced ex: ['foo', 'bar']\n * @param allowEmptyStrings if '' is allowed or not\n */\nexport const format = (s, args, allowEmptyStrings) => {\n return s.replace(/{(\\d+)}/g, function replace(match, number) {\n if (allowEmptyStrings) {\n return args[number];\n }\n return args[number] ? args[number] : match;\n });\n};\nconst regexEmoticonsRule = /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\u0023-\\u0039]\\ufe0f?\\u20e3|\\u3299|\\u3297|\\u303d|\\u3030|\\u24c2|\\ud83c[\\udd70-\\udd71]|\\ud83c[\\udd7e-\\udd7f]|\\ud83c\\udd8e|\\ud83c[\\udd91-\\udd9a]|\\ud83c[\\udde6-\\uddff]|\\ud83c[\\ude01-\\ude02]|\\ud83c\\ude1a|\\ud83c\\ude2f|\\ud83c[\\ude32-\\ude3a]|\\ud83c[\\ude50-\\ude51]|\\u203c|\\u2049|[\\u25aa-\\u25ab]|\\u25b6|\\u25c0|[\\u25fb-\\u25fe]|\\u00a9|\\u00ae|\\u2122|\\u2139|\\ud83c\\udc04|[\\u2600-\\u26FF]|\\u2b05|\\u2b06|\\u2b07|\\u2b1b|\\u2b1c|\\u2b50|\\u2b55|\\u231a|\\u231b|\\u2328|\\u23cf|[\\u23e9-\\u23f3]|[\\u23f8-\\u23fa]|\\ud83c\\udccf|\\u2934|\\u2935|[\\u2190-\\u21ff])/g;\n/**\n * Returns en Array med alle html tags som er funnet i en string <...>\n * @param s - string som skal sjekkes\n */\nexport const invalidNodes = (s) => {\n const tagsMatches = unescapeHtmlEntities(unescapeHexEntities(s)).match(/<.*?>/g);\n const tags = tagsMatches ? tagsMatches.map(i => i.toString()) : [];\n const emoticonsMatches = s.match(regexEmoticonsRule);\n const emoticons = emoticonsMatches ? emoticonsMatches.map(i => i.toString()) : [];\n return tags.concat(emoticons);\n};\n/**\n * Returns true når strengen ikke inneholder emoticon og tags\n * @param s - string som skal sjekkes\n */\nexport const isValid = (s) => {\n return (!/<.*?>/g.test(s) &&\n !regexEmoticonsRule.test(s) &&\n !/<.*?>/g.test(unescapeHtmlEntities(s)) &&\n !/<.*?>/g.test(unescapeHtmlEntities(unescapeHexEntities(s))));\n};\n","import { setDefaultOptions, format as formatDF, isEqual as isEqualDF, isSameDay as isSameDayDF, parseJSON as parseJSONDF, isBefore as isBeforeDF, isAfter as isAfterDF, startOfDay as startOfDayDF, isSameMonth as isSameMonthDF, } from 'date-fns';\nimport { nb } from 'date-fns/locale';\nimport { capitalize as ucfirst } from './string-utils';\n/**\n * Vanlige datoformater brukt på helsenorge.no\n *\n * Eksemplene viser formattert dato med norsk bokmål (nb) locale\n */\nexport var DateFormat;\n(function (DateFormat) {\n /** 02:08 */\n DateFormat[\"Time\"] = \"p\";\n /** 09.02.2023 */\n DateFormat[\"ShortDate\"] = \"P\";\n /** 09.02.2023 02:08 */\n DateFormat[\"ShortDateTime\"] = \"Pp\";\n /** 9. feb. 2023 */\n DateFormat[\"MediumDate\"] = \"PP\";\n /** 9. feb. 2023 02:08 */\n DateFormat[\"MediumDateTime\"] = \"PPp\";\n /** 9. februar 2023 */\n DateFormat[\"LongDate\"] = \"PPP\";\n /** 9. februar 2023 kl. 02:08 */\n DateFormat[\"LongDateTime\"] = \"PPPp\";\n /** torsdag 9. februar 2023 kl. 02:08 */\n DateFormat[\"LongDateWeekdayTime\"] = \"PPPPp\";\n /** feb. 2023 */\n DateFormat[\"ShortMonthYear\"] = \"MMM yyyy\";\n /** februar 2023 */\n DateFormat[\"MonthYear\"] = \"MMMM yyyy\";\n})(DateFormat || (DateFormat = {}));\n/**\n * Initialiserer date-fns med norsk bokmål locale\n */\nexport const initialize = () => setDefaultOptions({ locale: nb });\n/**\n * Parser en dato-streng til en gyldig Date.\n *\n * @param date Dato som skal parses\n * @returns En gyldig Date, eller undefined hvis dato ikke kan parses\n */\nexport const safeParseJSON = (date) => {\n if (!date) {\n return;\n }\n if (date instanceof Date && isNaN(date.getTime())) {\n return;\n }\n if (date instanceof Date) {\n return date;\n }\n const _date = parseJSONDF(date);\n if (isNaN(_date.getTime())) {\n return;\n }\n return _date;\n};\n/**\n * Konverterer en Date til Central European Time (tidssonen i Norge).\n * Merk at datoer i JS ikke inneholder informasjon om tidssone.\n * Denne funksjonen endrer datoen slik at den vises som norsk tid selv\n * om brukerens datamaskin er stilt inn på en annen tidssone.\n *\n * @param date Dato som skal konverteres til CET\n * @returns Dato justert slik at den vises som norsk tid selv om brukerens\n * datamaskin er stilt inn på en annen tidssone.\n */\nexport const toCentralEuropeanTime = (date) => {\n const cetDate = new Date(date.toLocaleString('en-US', {\n timeZone: 'CET',\n }));\n return isNaN(cetDate.getTime()) ? date : cetDate;\n};\n/**\n * Konverterer dato til CET og formatterer den\n *\n * @param date Dato\n * @param formatStr Format\n * @param options Innstillinger for formattering\n * @returns Formattert dato\n */\nexport const formatCET = (date, formatStr, options) => formatDF(toCentralEuropeanTime(date), formatStr, options);\n/**\n * Parser en dato med safeParseJSON og formatterer datoen dersom den er gyldig.\n * Dersom datoen ikke er gyldig, returneres tom streng.\n *\n * @param date Dato som skal parses\n * @param formatStr Datoformat\n * @returns Formattert dato, eller tom streng\n */\nexport const safeFormatCET = (date, formatStr) => {\n const _date = safeParseJSON(date);\n if (!_date) {\n return '';\n }\n return formatCET(_date, formatStr);\n};\n/**\n * Formatterer dato som:\n * 22. mai 2020 kl. 09:05\n *\n * @param a - Dato som skal formatteres\n */\nexport const longDateTime = (date) => formatDF(date, DateFormat.LongDateTime);\n/**\n * Formatterer dato som:\n * 22. mai 2020 eller 22. mai 2020 kl. 09:05\n *\n * @param a - Dato som skal formatteres\n */\nexport const longDate = (date) => {\n const startOfDay = startOfDayDF(date);\n return isEqualDF(date, startOfDay) ? formatDF(date, DateFormat.LongDate) : formatDF(date, DateFormat.LongDateTime);\n};\n/**\n * Formatterer dato som:\n * fredag 22. mai 2020 kl. 09:05\n *\n * @param date Dato som skal formatteres\n */\nexport const longDateNumbersClock = (date) => formatDF(date, DateFormat.LongDateWeekdayTime);\n/**\n * Formatterer dato som:\n * 22. mai 2020 09:05\n *\n * @param date Dato som skal formatteres\n */\nexport const mediumDate = (date) => formatDF(date, DateFormat.MediumDateTime);\n/**\n * Formatterer dato som:\n * 22.05.2020 09:05\n *\n * @param date Dato som skal formatteres\n */\nexport const mediumDateNumbers = (date) => formatDF(date, DateFormat.ShortDateTime);\n/**\n * Formatterer dato som:\n * 5. nov. 2020\n *\n * @param date Dato som skal formatteres\n */\nexport const shortDate = (date) => formatDF(date, DateFormat.MediumDate);\n/**\n * Formatterer dato som:\n * 5. november 2020\n *\n * @param date Dato som skal formatteres\n */\nexport const shortDateFullMonth = (date) => formatDF(date, DateFormat.LongDate);\n/**\n * Formatterer dato som:\n * 05.11.2020\n *\n * @param date Dato som skal formatteres\n */\nexport const shortDateNumbers = (date) => formatDF(date, DateFormat.ShortDate);\n/**\n * Formatterer tidspunkt som tom streng hvis tiden er midnatt, eller som:\n * 09:08\n *\n * @param date Dato som skal sjekkes\n * @param prefix - Tekst før formattert dato\n */\nexport const timeOfDay = (start, prefix = '') => {\n let value = '';\n const startOfDay = startOfDayDF(start);\n if (!isEqualDF(start, startOfDay)) {\n value = prefix + formatDF(start, DateFormat.Time);\n }\n return value;\n};\n/**\n * Formatterer dato som:\n * November 2020\n *\n * @param date Dato som skal formatteres\n */\nexport const monthYear = (date) => ucfirst(formatDF(date, DateFormat.MonthYear));\n/**\n * Formatterer dato som:\n * Nov 2020\n *\n * @param date Dato som skal formatteres\n */\nexport const shortMonthYear = (date) => ucfirst(formatDF(date, DateFormat.ShortMonthYear).replace('.', ''));\n/**\n * Formatterer to datoer som:\n * Mai 2020 – August 2020\n *\n * @param start Startdato\n * @param end Sluttdato\n */\nexport const monthRange = (start, end) => {\n let range;\n if (isSameMonthDF(start, end)) {\n range = ucfirst(formatDF(start, DateFormat.MonthYear));\n }\n else {\n range =\n ucfirst(formatDF(start, DateFormat.MonthYear)) +\n String.fromCharCode(160) +\n String.fromCharCode(8211) +\n String.fromCharCode(160) +\n ucfirst(formatDF(end, DateFormat.MonthYear));\n }\n return range;\n};\n/**\n * Formatterer to datoer som:\n * 22. mai 2020, mellom kl. 08:32 og 12:54\n * Forutsetter at begge tidspunktene er på samme dag\n *\n * @param start Startdato\n * @param end Sluttdato\n * @param betweenText \", mellom kl. \"\n * @param andText \"og\"\n */\nexport const timeRangeBetween = (start, end, between = ', mellom kl. ', andText = ' og ') => {\n let range;\n if (isEqualDF(start, end)) {\n range = formatDF(start, DateFormat.LongDateTime);\n }\n else {\n range = formatDF(start, DateFormat.MediumDate) + between + formatDF(start, DateFormat.Time) + andText + formatDF(end, DateFormat.Time);\n }\n return range;\n};\n/**\n * Formatterer to datoer som:\n * 22. mai 2020 kl. 08:32 - 12:54\n * Forutsetter at begge tidspunktene er på samme dag\n *\n * @param start Startdato\n * @param end Sluttdato\n */\nexport const timeRange = (start, end) => {\n let range;\n if (isEqualDF(start, end)) {\n range = formatDF(start, DateFormat.LongDateTime);\n }\n else {\n range = formatDF(start, DateFormat.LongDateTime) + ' - ' + formatDF(end, DateFormat.Time);\n }\n return range;\n};\n/**\n * Formatterer to datoer som:\n * Fredag 22. mai 2020 kl. 08:32 - 12:54\n * Forutsetter at begge tidspunktene er på samme dag\n *\n * @param start Startdato\n * @param end Sluttdato\n */\nexport const longTimeRange = (start, end) => {\n let range = formatDF(start, DateFormat.LongDateWeekdayTime);\n if (end) {\n range = range + ' - ' + formatDF(end, DateFormat.Time);\n }\n return ucfirst(range);\n};\n/**\n * Returnerer true hvis dato a er før dato b\n * @param a Dato som skal sammenlignes\n * @param b Dato som skal sammenlignes\n */\nexport const isBeforeDay = (a, b) => isBeforeDF(a.setHours(0, 0, 0, 0), b.setHours(0, 0, 0, 0));\n/**\n * Returnerer true hvis dato a er etter dato b\n * @param a Dato som skal sammenlignes\n * @param b Dato som skal sammenlignes\n */\nexport const isAfterDay = (a, b) => isAfterDF(a.setHours(0, 0, 0, 0), b.setHours(0, 0, 0, 0));\n/**\n * Returnerer true hvis dato a er på samme dag eller etter dato b\n * @param a Dato som skal sammenlignes\n * @param b Dato som skal sammenlignes\n */\nexport const isInclusivelyAfterDay = (a, b) => isSameDayDF(a, b) || isAfterDay(a, b);\n/**\n * Returnerer true hvis input (inkludert minutter) er etter nåtid\n * @param date Dato som skal sammenlignes\n */\nexport const isAfter = (date) => isAfterDF(date, new Date());\n/**\n * Returnerer true hvis input er etter dagens dato\n * Forskjell med 'isAfter' er at denne tar utgangspunkt i dager\n * @param date Dato som skal sammenlignes\n */\nexport const isAfterToday = (date) => isAfterDF(date.setHours(0, 0, 0, 0), new Date().setHours(0, 0, 0, 0));\n/**\n * Sammenligner to datoer og returnerer true hvis den første datoen er etter den andre (fungerer også med tid)\n * @param a - Date\n * @param max - maksimum dato grense\n */\nexport const isAfterMaxDate = (a, b) => !!b && isAfterDF(a, b);\n/**\n * Returnerer true hvis dato a er på samme dag eller før dato b\n * @param a Dato som skal sammenlignes\n * @param b Dato som skal sammenlignes\n */\nexport const isInclusivelyBeforeDay = (a, b) => isSameDayDF(a, b) || isBeforeDay(a, b);\n/**\n * Returnerer true hvis input (inkludert minutter) er før nåtid\n * @param date Dato som skal sammenlignes\n */\nexport const isBefore = (date) => isBeforeDF(date, new Date());\n/**\n * Returnerer true hvis input er før dagens dato\n * Forskjell med 'isBefore' er at denne tar utgangspunkt i dager\n * @param date Dato som skal sammenlignes\n */\nexport const isBeforeToday = (date) => isBeforeDF(date.setHours(0, 0, 0, 0), new Date().setHours(0, 0, 0, 0));\n/**\n * Sammenligner to datoer og returnerer true hvis den første datoen er før den andre (fungerer også med tid)\n * @param date - Date\n * @param min - minimum dato grense\n */\nexport const isBeforeMinDate = (a, b) => !!b && isBeforeDF(a, b);\n/**\n * Returnerer true hvis input er dagens dato og tid er tidligere enn nåtid\n * @param date Dato som skal sammenlignes\n */\nexport const isEarlierToday = (date) => {\n const now = new Date();\n return isSameDayDF(date, now) && isBeforeDF(date, now);\n};\n/**\n * Returnerer true hvis input er lik 0001-01-01T00:00:00\n * @param date Dato som skal sammenlignes\n */\nexport const isDotNetMinDate = (date) => isEqualDF(date, new Date('0001-01-01T00:00:00'));\n","/**\n * Get feature-toggle from window.HN.\n * @param featureName name of feature\n */\nexport default function getFeatureToggle(featureName) {\n const getFeatureToggles = window.HN?.PortalCommands?.GetFeatureToggles || window.HN?.Commands?.GetFeatureToggles;\n return !!getFeatureToggles?.FeatureToggles?.[featureName];\n}\n","/** Cookie-navn for om man er logget inn */\nexport const LOGGED_IN_COOKIE_NAME = 'MH_LoggedIn';\n/** Cookie-navn for sesjons-ID */\nexport const SESSION_ID_COOKIE_NAME = 'MH_SessionId';\n/** Cookie-navn for måten man har logget inn på */\nexport const IDENTITY_PROVIDER_COOKIE_NAME = 'MH_Idp';\n/**\n * Sjekker om cookie finnes og om den har verdi\n * @param cookieName navn på cookie\n * @param value cookie verdi\n */\nexport const hasCookie = (cookieName, value) => {\n if (typeof document === 'undefined') {\n return false;\n }\n const cookie = document.cookie;\n if (cookie === undefined) {\n return false;\n }\n if (value === undefined) {\n return cookie.split('; ').find(e => e.split('=')[0] === cookieName) !== undefined;\n }\n const cookieValue = '; '.concat(document.cookie);\n const parts = cookieValue.split('; '.concat(cookieName).concat('='));\n if (parts.length === 2) {\n const lastPart = parts.pop();\n return lastPart ? lastPart.split(';').shift() === value.toString() : false;\n }\n return false;\n};\n/**\n * Henter cookienavn inkludert eventuelt suffix for å støtte ulike domener.\n * @param cookieName navn på cookie\n */\nexport const getSuffix = (cookieName) => {\n let suffix = '';\n if (window.HN?.Rest?.Environment) {\n suffix = '_' + window.HN.Rest.Environment;\n }\n return cookieName + suffix;\n};\n/**\n * Sjekker om cookie finnes og om den har verdi\n * @param cookieName navn på cookie\n */\nexport const hasCookieWithSuffix = (cookieName) => {\n return hasCookie(getSuffix(cookieName));\n};\n/**\n * Sjekker om bruker er logget inn basert på cookie\n */\nexport const hasLoggedInCookie = () => {\n return hasCookieWithSuffix(LOGGED_IN_COOKIE_NAME) || hasCookieWithSuffix(SESSION_ID_COOKIE_NAME);\n};\n/**\n * Setter en cookie med van + verdi\n * @param cookieName navn på cookie\n * @param value cookie verdi\n */\nexport const setCookie = (name, value = '') => {\n document.cookie = `${name}=${value};path=/;`;\n};\n/**\n * Sletter en cookie basert på navnet\n * @param cookieName navn på cookie\n */\nexport const deleteCookie = (name) => {\n document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n};\n/**\n * Henter verdien til en cookie basert på navnet\n * @param cookieName navn på cookie\n */\nexport const getCookieValue = (name) => {\n const cookie = hasCookie(name);\n const cookieWithSuffix = hasCookieWithSuffix(name);\n if (!cookie && !cookieWithSuffix) {\n return undefined;\n }\n const cookieName = cookieWithSuffix ? getSuffix(name) : name;\n return document.cookie\n .split('; ')\n .find(e => e.split('=')[0] === cookieName)\n ?.split('=')[1];\n};\n/**\n * Returnerer domenenavnet uten subdomene, f.eks. \"helsenorge.no\" dersom domenet er \"www.helsenorge.no\" eller \"tjenester.helsenorge.no\"\n * @returns domenenavn for bruk i cookie\n */\nexport const getHostnameWithoutSubdomain = () => window.location.hostname.substr(window.location.hostname.indexOf('.') + 1);\nexport var IdentityProvider;\n(function (IdentityProvider) {\n IdentityProvider[\"HnApp\"] = \"hnapp\";\n IdentityProvider[\"HnAppUngdom\"] = \"idportenlevel3\";\n IdentityProvider[\"IdPorten\"] = \"idporten\";\n IdentityProvider[\"IdPortenLevel4\"] = \"idportenlevel4\";\n})(IdentityProvider || (IdentityProvider = {}));\n/**\n * Henter måten bruker har logget inn på\n * @returns IdentityProvider\n */\nexport const getIdentityProvider = () => getCookieValue(IDENTITY_PROVIDER_COOKIE_NAME);\n","export const EmptyAction = {\n type: '',\n};\n/* FULLMAKT OG SAMTYKKE */\nexport var SamtykkeType;\n(function (SamtykkeType) {\n SamtykkeType[SamtykkeType[\"None\"] = 0] = \"None\";\n SamtykkeType[SamtykkeType[\"Pha\"] = 1] = \"Pha\";\n SamtykkeType[SamtykkeType[\"Bruksvilkar\"] = 2] = \"Bruksvilkar\";\n SamtykkeType[SamtykkeType[\"RefusjonPasientreiser\"] = 3] = \"RefusjonPasientreiser\";\n SamtykkeType[SamtykkeType[\"UngdomsLosning\"] = 4] = \"UngdomsLosning\";\n})(SamtykkeType || (SamtykkeType = {}));\nexport var SamtykkeLevel;\n(function (SamtykkeLevel) {\n SamtykkeLevel[SamtykkeLevel[\"None\"] = 0] = \"None\";\n SamtykkeLevel[SamtykkeLevel[\"Registerinnsyn\"] = 1] = \"Registerinnsyn\";\n SamtykkeLevel[SamtykkeLevel[\"Journalinnsyn\"] = 2] = \"Journalinnsyn\";\n SamtykkeLevel[SamtykkeLevel[\"Helsetjeneste\"] = 3] = \"Helsetjeneste\";\n})(SamtykkeLevel || (SamtykkeLevel = {}));\nexport var FullmaktType;\n(function (FullmaktType) {\n FullmaktType[FullmaktType[\"OrdinaerFullmakt\"] = 3] = \"OrdinaerFullmakt\";\n FullmaktType[FullmaktType[\"BekreftetFullmakt\"] = 4] = \"BekreftetFullmakt\";\n FullmaktType[FullmaktType[\"UtenSamtykkekompenanseOver12\"] = 7] = \"UtenSamtykkekompenanseOver12\";\n})(FullmaktType || (FullmaktType = {}));\nexport var SamtykkeStatusType;\n(function (SamtykkeStatusType) {\n SamtykkeStatusType[SamtykkeStatusType[\"Samtykket\"] = 0] = \"Samtykket\";\n SamtykkeStatusType[SamtykkeStatusType[\"Trukket\"] = 1] = \"Trukket\";\n SamtykkeStatusType[SamtykkeStatusType[\"Utsatt\"] = 2] = \"Utsatt\";\n})(SamtykkeStatusType || (SamtykkeStatusType = {}));\n/**\n * Representasjoner, samtykke og personverninnstillinger\n */\nexport var RepresentasjonforholdType;\n(function (RepresentasjonforholdType) {\n RepresentasjonforholdType[RepresentasjonforholdType[\"InnloggetBruker\"] = 0] = \"InnloggetBruker\";\n RepresentasjonforholdType[RepresentasjonforholdType[\"Fullmakt\"] = 1] = \"Fullmakt\";\n RepresentasjonforholdType[RepresentasjonforholdType[\"Foreldrerepresentasjon\"] = 2] = \"Foreldrerepresentasjon\";\n RepresentasjonforholdType[RepresentasjonforholdType[\"Saksbehandler\"] = 3] = \"Saksbehandler\";\n RepresentasjonforholdType[RepresentasjonforholdType[\"SaksbehandlerFullmakt\"] = 4] = \"SaksbehandlerFullmakt\";\n})(RepresentasjonforholdType || (RepresentasjonforholdType = {}));\nexport var StatusKodeType;\n(function (StatusKodeType) {\n StatusKodeType[StatusKodeType[\"Reservert\"] = 1] = \"Reservert\";\n StatusKodeType[StatusKodeType[\"IkkeReservert\"] = 2] = \"IkkeReservert\";\n StatusKodeType[StatusKodeType[\"Samtykket\"] = 3] = \"Samtykket\";\n StatusKodeType[StatusKodeType[\"IkkeSamtykket\"] = 4] = \"IkkeSamtykket\";\n StatusKodeType[StatusKodeType[\"TilgangsbegrensningOpprettet\"] = 5] = \"TilgangsbegrensningOpprettet\";\n StatusKodeType[StatusKodeType[\"TilgangsbegrensningFjernet\"] = 6] = \"TilgangsbegrensningFjernet\";\n StatusKodeType[StatusKodeType[\"AnmodningTilbakeTrekkingSamtykke\"] = 7] = \"AnmodningTilbakeTrekkingSamtykke\";\n})(StatusKodeType || (StatusKodeType = {}));\nexport var SessionTimeoutAction;\n(function (SessionTimeoutAction) {\n SessionTimeoutAction[SessionTimeoutAction[\"Default\"] = 0] = \"Default\";\n SessionTimeoutAction[SessionTimeoutAction[\"RequestExtension\"] = 1] = \"RequestExtension\";\n SessionTimeoutAction[SessionTimeoutAction[\"RequestLogout\"] = 2] = \"RequestLogout\";\n})(SessionTimeoutAction || (SessionTimeoutAction = {}));\nexport var PersonverninnstillingKategori;\n(function (PersonverninnstillingKategori) {\n PersonverninnstillingKategori[PersonverninnstillingKategori[\"Samtykke\"] = 1] = \"Samtykke\";\n PersonverninnstillingKategori[PersonverninnstillingKategori[\"Reservasjon\"] = 2] = \"Reservasjon\";\n PersonverninnstillingKategori[PersonverninnstillingKategori[\"Tilgangsbegrensning\"] = 3] = \"Tilgangsbegrensning\";\n})(PersonverninnstillingKategori || (PersonverninnstillingKategori = {}));\nexport var TjenesteTilgangStatus;\n(function (TjenesteTilgangStatus) {\n TjenesteTilgangStatus[TjenesteTilgangStatus[\"None\"] = 0] = \"None\";\n TjenesteTilgangStatus[TjenesteTilgangStatus[\"Ja\"] = 1] = \"Ja\";\n TjenesteTilgangStatus[TjenesteTilgangStatus[\"Nei\"] = 2] = \"Nei\";\n TjenesteTilgangStatus[TjenesteTilgangStatus[\"VetIkke\"] = 3] = \"VetIkke\";\n})(TjenesteTilgangStatus || (TjenesteTilgangStatus = {}));\nexport var Personverninnstilling;\n(function (Personverninnstilling) {\n Personverninnstilling[\"SamtykkeDigitalHelsetjeneste\"] = \"fb640456-ae6f-4664-92c8-c6739d76caec\";\n Personverninnstilling[\"SamtykkeJournalinnsyn\"] = \"dc5b5d14-deed-48e5-bf6d-99ed77f08a09\";\n Personverninnstilling[\"SamtykkeRegisterinnsyn\"] = \"6ea1aa04-fad7-48c8-8432-1acb3fbf6d7b\";\n})(Personverninnstilling || (Personverninnstilling = {}));\nexport class TjenesteType {\n}\nObject.defineProperty(TjenesteType, \"TekniskTjeneste\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -1\n});\nObject.defineProperty(TjenesteType, \"IkkeInnloggetTjeneste\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 0\n});\nObject.defineProperty(TjenesteType, \"Timeavtaler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 1\n});\nObject.defineProperty(TjenesteType, \"Fastlegetjenester\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 6\n});\nObject.defineProperty(TjenesteType, \"Legemidler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 7\n});\nObject.defineProperty(TjenesteType, \"PersonligHelsearkiv\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 8\n});\nObject.defineProperty(TjenesteType, \"Fastlegevisning\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 9\n});\nObject.defineProperty(TjenesteType, \"InnsynPasientjournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 10\n});\nObject.defineProperty(TjenesteType, \"InnsynKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 11\n});\nObject.defineProperty(TjenesteType, \"Egenandeler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 12\n});\nObject.defineProperty(TjenesteType, \"Profil\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 13\n});\nObject.defineProperty(TjenesteType, \"MinHelseForside\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 15\n});\nObject.defineProperty(TjenesteType, \"EksterneTjenester\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 16\n});\nObject.defineProperty(TjenesteType, \"Henvisninger\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 17\n});\nObject.defineProperty(TjenesteType, \"Pasientreiser\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 18\n});\nObject.defineProperty(TjenesteType, \"Forlopskoordinator\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 19\n});\nObject.defineProperty(TjenesteType, \"Meldinger\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 20\n});\nObject.defineProperty(TjenesteType, \"ByttFastlege\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 21\n});\nObject.defineProperty(TjenesteType, \"DialogForlop\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 22\n});\nObject.defineProperty(TjenesteType, \"DialogHelsehjelp\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 23\n});\nObject.defineProperty(TjenesteType, \"Fullmaktsadministrasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 24\n});\nObject.defineProperty(TjenesteType, \"Helsekontakter\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 25\n});\nObject.defineProperty(TjenesteType, \"DialogOkonomi\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 26\n});\nObject.defineProperty(TjenesteType, \"Beslutningsstotte\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 27\n});\nObject.defineProperty(TjenesteType, \"DialogInnsyn\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 28\n});\nObject.defineProperty(TjenesteType, \"DialogPersonvern\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 29\n});\nObject.defineProperty(TjenesteType, \"Helseregistre\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 30\n});\nObject.defineProperty(TjenesteType, \"LoggOverBrukAvResepter\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 31\n});\nObject.defineProperty(TjenesteType, \"SykdomOgKritiskInformasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 32\n});\nObject.defineProperty(TjenesteType, \"Forskning\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 33\n});\nObject.defineProperty(TjenesteType, \"MinHelse\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 34\n});\nObject.defineProperty(TjenesteType, \"Timeadministrasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 35\n});\nObject.defineProperty(TjenesteType, \"Foreldresamtykke\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 36\n});\nObject.defineProperty(TjenesteType, \"DialogEgenHelseUngdom\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 37\n});\nObject.defineProperty(TjenesteType, \"KprTjenester\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 38\n});\nObject.defineProperty(TjenesteType, \"Vaksiner\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 39\n});\nObject.defineProperty(TjenesteType, \"LegemidlerLiB\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 40\n});\nObject.defineProperty(TjenesteType, \"InnsynRegisterinnhold\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 41\n});\nObject.defineProperty(TjenesteType, \"InnsynRegisterbruk\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 42\n});\nObject.defineProperty(TjenesteType, \"EKonsultasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 43\n});\nObject.defineProperty(TjenesteType, \"Reseptfornyelse\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 44\n});\nObject.defineProperty(TjenesteType, \"EKontakt\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 45\n});\nObject.defineProperty(TjenesteType, \"Timebestilling\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 46\n});\nObject.defineProperty(TjenesteType, \"KritiskInfo\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 47\n});\nObject.defineProperty(TjenesteType, \"AapneKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 48\n});\nObject.defineProperty(TjenesteType, \"ProfildataOgKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 49\n});\nObject.defineProperty(TjenesteType, \"HelsekontakterIKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 50\n});\nObject.defineProperty(TjenesteType, \"LegemidlerFraKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 51\n});\nObject.defineProperty(TjenesteType, \"ProfildataOgKjernejournalReservasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 52\n});\nObject.defineProperty(TjenesteType, \"PersonopplysningerFraKjernejournal\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 53\n});\nObject.defineProperty(TjenesteType, \"Donorkort\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 54\n});\nObject.defineProperty(TjenesteType, \"Samtykkeforesporsel\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 55\n});\nObject.defineProperty(TjenesteType, \"DialogForlopInformasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 56\n});\nObject.defineProperty(TjenesteType, \"Pasientreiseradministrasjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 57\n});\nObject.defineProperty(TjenesteType, \"NyttHelsenorgeSamtykke\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 58\n});\nObject.defineProperty(TjenesteType, \"InngripendeForPersonvern\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 59\n});\nObject.defineProperty(TjenesteType, \"Skjemautfyller\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 60\n});\nObject.defineProperty(TjenesteType, \"SamvalgUtenLagring\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 61\n});\nObject.defineProperty(TjenesteType, \"MeldeFeilIBesokshistorikkKj\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 62\n});\nObject.defineProperty(TjenesteType, \"Verktoy\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 63\n});\nObject.defineProperty(TjenesteType, \"VerktoyUtforelse\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 64\n});\nObject.defineProperty(TjenesteType, \"InnsynRegisterinnholdReseptformidler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 65\n});\nObject.defineProperty(TjenesteType, \"DialogSkjemaRegisterinnsyn\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 66\n});\nObject.defineProperty(TjenesteType, \"DialogSkjemaJournalinnsyn\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 67\n});\nObject.defineProperty(TjenesteType, \"DialogSkjemaHelsetjeneste\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 68\n});\nObject.defineProperty(TjenesteType, \"DialogSkjemaHelsetjenesteStreng\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 69\n});\nObject.defineProperty(TjenesteType, \"RegisterinnsynNasjonaleKvalitetsregister\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 70\n});\nObject.defineProperty(TjenesteType, \"ReiserMedRekvisisjon\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 71\n});\n/* CMS-CONTENT-API-SERVICE */\nexport var CmsContentApiVersions;\n(function (CmsContentApiVersions) {\n CmsContentApiVersions[\"V1\"] = \"v1/\";\n CmsContentApiVersions[\"V2\"] = \"v2/\";\n})(CmsContentApiVersions || (CmsContentApiVersions = {}));\n","import { getIdentityProvider, IdentityProvider } from './cookie';\nimport { FullmaktType } from './types/entities';\n/**\n * Returnerer verdien satt på HN User LastLogOn\n */\nexport const getSistPalogget = () => {\n return window.HN?.User?.SistPalogget;\n};\n/**\n * Returnerer verdien satt på HN User Name\n */\nexport const getInnloggetFulltNavn = () => {\n return window.HN?.User?.InnloggetFulltNavn;\n};\n/**\n * Returnerer verdien satt på HN User FirstName\n */\nexport const getInnloggetFornavn = () => {\n return window.HN?.User?.InnloggetFornavn;\n};\n/**\n * Returnerer verdien satt på HN User RepresentertBruker\n */\nexport const getRepresentertBruker = () => {\n return window.HN?.User?.RepresentertBruker;\n};\n/**\n * Returnerer verdien satt på HN User HasRepresentation\n */\nexport const getHarRepresentasjon = () => {\n return window.HN?.User?.HarRepresentasjon;\n};\n/**\n * Returnerer verdien satt på HN User VisPersonvelger\n */\nexport const getVisPersonvelger = () => {\n return window.HN?.User?.VisPersonvelger;\n};\n/**\n * Setter verdien til HN User VisPersonvelger\n */\nexport const setVisPersonvelger = (visPersonvelger) => {\n window.HN = window.HN || {};\n window.HN.User = window.HN.User || {};\n window.HN.User.VisPersonvelger = visPersonvelger;\n};\n/**\n * Returnerer verdien satt på HN User ErRepresentasjon\n */\nexport const getErRepresentasjon = () => {\n return window.HN?.User?.ErRepresentasjon;\n};\n/**\n * Returnerer true når innnbygger representerer en annen via fullmakt\n */\nexport const getErRepresentasjonViaFullmakt = () => getErRepresentasjon() === true && window.HN?.User?.FullmaktEgenskaper !== null;\n/**\n * Returnerer true når innnbygger representerer en annen de har foreldreansvar for\n */\nexport const getErRepresentasjonMedForeldreansvar = () => getErRepresentasjon() === true && window.HN?.User?.ForeldreansvarEgenskaper !== null;\n/**\n * Returnerer verdien satt på HN User SamtykkekonverteringInformert\n */\nexport const getSamtykkekonverteringInformert = () => {\n return window.HN?.User?.SamtykkekonverteringInformert;\n};\n/**\n * Returnerer verdien satt på HN User ErMellom12Og16\n */\nexport const getErMellom12Og16 = () => {\n return window.HN?.User?.ErMellom12Og16;\n};\n/**\n * Returnerer verdien satt på HN User RequiredSamtykkeLevel\n */\nexport const getRequiredSamtykkeLevel = () => {\n return window.HN?.User?.RequiredSamtykkeLevel;\n};\n/**\n * Bestemmer om bruker kan navigere vekk fra siden, uten å måtte bekrefte først\n */\nexport const getAllowNavigation = () => {\n return window.HN?.User?.AllowNavigation ?? false;\n};\n/**\n * @deprecated Skifter navn til getAllowNavigation\n */\nexport const getIsNavigatingToSignOut = getAllowNavigation;\n/**\n * Bestemmer om bruker kan navigere vekk fra siden, uten å måtte bekrefte først\n * @param value true dersom navigasjon skal være lov, false dersom bruker må bekrefte eventuelle endringer først\n */\nexport const setAllowNavigation = (value) => {\n window.HN = window.HN || {};\n window.HN.User = window.HN.User || {};\n window.HN.User.AllowNavigation = value;\n};\n/**\n * @deprecated Skifter navn til setAllowNavigation\n */\nexport const setIsNavigatingToSignOut = setAllowNavigation;\n/**\n * Returnerer true når FullmaktEgenskaper er analog og ordinær\n */\nexport const getErOrdinaerAnalogFullmakt = () => window.HN?.User?.FullmaktEgenskaper?.FullmaktType === FullmaktType.OrdinaerFullmakt;\n/**\n * Returnerer true når FullmaktEgenskaper er analog og UtenSamtykkekompenanseOver12\n */\nexport const getErIkkeSamtykkeKompetentFullmakt = () => !!window.HN?.User?.FullmaktEgenskaper?.Analog &&\n window.HN?.User?.FullmaktEgenskaper?.FullmaktType === FullmaktType.UtenSamtykkekompenanseOver12;\n/**\n * Returnerer true når bruker er logget inn via helsenorge-app\n */\nexport const getErInnloggetViaHnApp = () => getIdentityProvider() === IdentityProvider.HnApp;\n/**\n * Returnerer true når bruker er logget inn via helsenorge-app for ungdom\n */\nexport const getErInnloggetViaHnAppUngdom = () => getIdentityProvider() === IdentityProvider.HnAppUngdom;\n/**\n * Hent brukerens scopes\n * @returns Liste med scopes fra HN.User.Scopes, eller tom liste\n */\nexport const getScopes = () => {\n return window.HN?.User?.Scopes ?? [];\n};\n/**\n * Sjekk om bruker har scope\n * @param scope Navn på scope i HN.User.Scopes\n * @returns true dersom bruker har scope\n */\nexport const hasScope = (scope) => {\n return getScopes().includes(scope) ?? false;\n};\n/**\n * Sjekk om bruker har innsynssperre\n * @returns true dersom bruker har innsynssperre\n */\nexport const getHarInnsynssperre = () => {\n return window.HN?.User?.HarInnsynssperre;\n};\n/**\n * Sjekk om bruker har reservasjon mot egen bruk av Helsenorge\n * @returns true dersom bruker har reservasjon mot egen bruk av Helsenorge\n */\nexport const getHarReservasjonAktivPaaHelsenorge = () => {\n return window.HN?.User?.HarReservasjonAktivPaaHelsenorge;\n};\n/**\n * Sjekk om bruker har aktivt foreldresamtykke.\n * Denne brukes når en foreldre har samtykket på vegne av barnet at de kan bruke helsenorge selv,\n * og da tilgjengeliggjøres et sett med forhåndsdefinerte tjenester.\n * @returns true dersom bruker har foreldresamtykke\n */\nexport const getHarAktivtForeldreSamtykke = () => {\n return window.HN?.User?.HarAktivtForeldreSamtykke;\n};\n/**\n * Hent innbyggers personverninnstillinger\n * @returns Liste med guids fra HN.User.AktiveUtvalgtePersonverninnstillinger, eller tom liste\n */\nexport const getPersonverninnstillinger = () => {\n return window.HN?.User?.AktiveUtvalgtePersonverninnstillinger ?? [];\n};\n/**\n * Sjekk om bruker har personverninnstilling\n * @param guid Guid i HN.User.AktiveUtvalgtePersonverninnstillinger\n * @returns true dersom bruker har personverninnstilling\n */\nexport const hasPersonverninnstilling = (guid) => {\n return getPersonverninnstillinger().includes(guid) ?? false;\n};\n","export var HeaderFooterEvents;\n(function (HeaderFooterEvents) {\n HeaderFooterEvents[\"setlistenerready\"] = \"hn-webcomp-header-footer-event-setlistenerready\";\n HeaderFooterEvents[\"setfirsttimelogin\"] = \"hn-webcomp-header-footer-event-setfirsttimelogin\";\n HeaderFooterEvents[\"setanonymousheader\"] = \"hn-webcomp-header-footer-event-setanonymousheader\";\n HeaderFooterEvents[\"sethiddenheader\"] = \"hn-webcomp-header-footer-event-sethiddenheader\";\n HeaderFooterEvents[\"setdriftsmeldingpath\"] = \"hn-webcomp-header-footer-event-setdriftsmeldingpath\";\n HeaderFooterEvents[\"sethiddenfooter\"] = \"hn-webcomp-header-footer-event-sethiddenfooter\";\n HeaderFooterEvents[\"setnomarginfooter\"] = \"hn-webcomp-header-footer-event-setnomarginfooter\";\n HeaderFooterEvents[\"setvarslinger\"] = \"hn-webcomp-header-footer-event-setvarslinger\";\n HeaderFooterEvents[\"refreshvarslinger\"] = \"hn-webcomp-header-footer-event-refreshvarslinger\";\n /** @deprecated Slett refreshvarslingeroghendelsesmeny, refreshvarslinger brukes i stedet */\n HeaderFooterEvents[\"refreshvarslingeroghendelsesmeny\"] = \"hn-webcomp-header-footer-event-refreshvarslingeroghendelsesmeny\";\n HeaderFooterEvents[\"setonshowsignoutbox\"] = \"hn-webcomp-header-footer-event-setonshowsignoutbox\";\n /**\n * @deprecated Slett når alle har tatt i bruk v31\n */\n HeaderFooterEvents[\"setfromlocation\"] = \"hn-webcomp-header-footer-event-setfromlocation\";\n HeaderFooterEvents[\"setredirectto\"] = \"hn-webcomp-header-footer-event-setredirectto\";\n HeaderFooterEvents[\"setredirecttourlafterlogin\"] = \"hn-webcomp-header-footer-event-setredirecttourlafterlogin\";\n HeaderFooterEvents[\"setnavigate\"] = \"hn-webcomp-header-footer-event-setnavigate\";\n HeaderFooterEvents[\"setlocation\"] = \"hn-webcomp-header-footer-event-setlocation\";\n HeaderFooterEvents[\"setuserloading\"] = \"hn-webcomp-header-footer-event-setuserloading\";\n HeaderFooterEvents[\"setvispersonvelger\"] = \"hn-webcomp-header-footer-event-setvispersonvelger\";\n HeaderFooterEvents[\"setsurveys\"] = \"hn-webcomp-header-footer-event-setsurveys\";\n HeaderFooterEvents[\"setfooterdata\"] = \"hn-webcomp-header-footer-event-setfooterdata\";\n HeaderFooterEvents[\"soonautosignout\"] = \"hn-webcomp-header-footer-event-soonautosignout\";\n HeaderFooterEvents[\"showappinvitation\"] = \"hn-webcomp-header-footer-event-showappinvitation\";\n})(HeaderFooterEvents || (HeaderFooterEvents = {}));\nexport var CmsBlocksEvents;\n(function (CmsBlocksEvents) {\n CmsBlocksEvents[\"setHiddenPromopanel\"] = \"hn-webcomp-cms-blocks-event-sethiddenpromopanel\";\n})(CmsBlocksEvents || (CmsBlocksEvents = {}));\nexport var CommonEvents;\n(function (CommonEvents) {\n CommonEvents[\"isMounted\"] = \"hn-webcomp-common-ismounted\";\n CommonEvents[\"setLanguage\"] = \"hn-language-event-set-language\";\n})(CommonEvents || (CommonEvents = {}));\nexport var WebComponents;\n(function (WebComponents) {\n WebComponents[\"Promopanel\"] = \"hn-webcomp-cms-block-promopanel\";\n})(WebComponents || (WebComponents = {}));\nexport var StepEvents;\n(function (StepEvents) {\n StepEvents[\"Navigate\"] = \"hn-step-navigate\";\n StepEvents[\"SendFromWebComponent\"] = \"hn-step-send-from-web-component\";\n})(StepEvents || (StepEvents = {}));\n","/**\n * Returns true når brukeren er på mobil (native check on user agent)\n */\nexport const isMobileUA = () => {\n let check = false;\n (function (a) {\n const regexString = '(android|bbd+|meego).+mobile|avantgo|bada/|blackberry\\\n |blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|\\\n midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|\\\n pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows ce|xda|\\\n xiino';\n const regexString2 = '1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|\\\n ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|\\\n avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55/|capi|ccwa|cdm-|cell|\\\n chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|\\\n el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|\\\n gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|\\\n hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|/)|ibro|idea|\\\n ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |/)|klon|kpt |\\\n kwc-|kyo(c|k)|le(no|xi)|lg( g|/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50/|\\\n ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |\\\n o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|\\\n ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|\\\n pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|\\\n qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55/|sa(ge|ma|\\\n mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|\\\n sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|\\\n t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|\\\n m-|m3|m5)|tx-9|up(.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|\\\n vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|\\\n whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-';\n const regex = new RegExp(regexString, 'i');\n const regex2 = new RegExp(regexString2, 'i');\n if (regex.test(a) || regex2.test(a.substr(0, 4))) {\n check = true;\n }\n })(navigator.userAgent || navigator.vendor || window.opera);\n return check;\n};\n/**\n * Legger til 'ios-safari' className på body når nettleseren er safari (native check on user agent)\n */\nexport const handleIOSSafariUA = () => {\n if (!document.body.classList.contains('ios-safari')) {\n const ua = window.navigator.userAgent;\n const iOS = isAppleMobileDevice();\n const webkit = !!ua.match(/WebKit/i);\n const iOSSafari = iOS && webkit && !ua.match(/CriOS/i) && !ua.match(/OPiOS/i);\n if (iOSSafari) {\n document.body.classList.add('ios-safari');\n }\n }\n};\nexport const isAndroid = () => {\n return navigator.userAgent.toLowerCase().indexOf('android') > -1;\n};\nexport const isAppleMobileDevice = () => {\n const ua = navigator.userAgent;\n return !!ua.match(/iPad/i) || !!ua.match(/iPhone/i);\n};\n","/**\n * Send data til Adobe Analytics via adobeDataLayer\n *\n * @param payload Data som skal spores\n */\nexport const pushToDataLayer = (payload) => {\n window.adobeDataLayer = window.adobeDataLayer || [];\n window.adobeDataLayer.push(payload);\n};\n/**\n * Spor handling i tjeneste\n * @param trackAction type handling som skal spores\n * @param serviceName navnet på tjenesten, f.eks. \"pasientreiser\"\n * @param action spesifiserer hvilken handling man utfører, f.eks. \"send søknad\"\n * @param flow type prosess\n */\nexport const trackSelfService = (trackAction, serviceName, action, flow) => {\n const payload = {\n event: `self service ${trackAction}`,\n selfService: {\n name: `${serviceName}: ${action}`,\n flow,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor bruk av samtykkeflyt\n * @param action definerer consentStart, consentFunnel eller consentComplete videre\n * @param stepName definerer consentFunnelStep på ConsentSelfService\n * @param stepNumber definerer selfServiceFunnelStepNumber på ConsentSelfService\n * @param type definerer consentType på ConsentSelfService\n */\nexport const trackConsent = (action, stepName, stepNumber, type) => {\n const payload = {\n event: `consent ${action}`,\n consent: {\n stepName,\n stepNumber,\n type,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor bruk av filterkomponent\n * @param name definerer navnet fil Filter\n * @param action definerer type tracking: 'usage' | 'expand' | 'search' | 'group expand'\n */\nexport const trackFilters = (name, action) => {\n const payload = {\n event: `filter ${action}`,\n filter: {\n name,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor partner - setter informasjon om tjenesteeier\n * @param partner definerer partner\n */\nexport const updatePagePartner = (partner) => {\n const payload = {\n page: {\n partner,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Setter informasjon om innlogget status i window.adobeDataLayer\n * @param loggedIn Om bruker er logget inn eller ikke\n */\nexport const updateLoginStatus = (loggedIn) => {\n const payload = {\n user: {\n loggedIn,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor uleste varslinger\n * @param unreadAlerts Antall uleste varslinger\n */\nexport const trackUnreadAlert = (unreadAlerts) => {\n const payload = {\n event: 'unread alerts',\n notifications: {\n unreadAlerts,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor uleste meldinger\n * @param unreadMessages Antall uleste meldinger\n */\nexport const trackUnreadMessage = (unreadMessages) => {\n const payload = {\n event: 'unread messages',\n notifications: {\n unreadMessages,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor leste meldinger med type.\n * @param type Meldingstype\n */\nexport const trackReadMessageType = (type) => {\n const payload = {\n event: 'message read',\n message: {\n type,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor internsøk\n * @param phrase nøkkelord som settes på search searchTerm\n * @param type type som settes på search searchType\n * @param resultsCount antall søkeresultater som settes på search resultsCount\n */\nexport const trackSearch = (phrase, type, resultsCount) => {\n const payload = {\n event: 'internal search',\n search: {\n phrase,\n type,\n resultsCount,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor klikk på internsøkeresultater\n * @param searchPosition position til søkeresultatet som lagres på search searchposition\n */\nexport const trackSearchThrough = (searchPosition) => {\n const payload = {\n event: 'search click through',\n search: {\n searchPosition,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor endring av profilinnstillinger\n * @param interactionName navn som lagres på user profileInteractionName\n */\nexport const trackProfileInteraction = (interactionName) => {\n const payload = {\n event: 'profile interaction',\n profile: {\n interactionName,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * spor handlinger med kun ett steg, e.g.\n * trackTool('kontaktskjema', 'hjelp', 'bytte fastlege', 'send')\n * @param name navn som lagres på tool toolName\n * @param type type som lagres på tool toolType\n * @param labels label som lagres på tool toolLabels\n * @param action handlingen som utføres\n */\nexport const trackTool = (name, type, labels, action) => {\n const payload = {\n event: 'use tool',\n tool: {\n name,\n type,\n labels,\n action,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor åpning/lukking av hjelpeskuff\n * @param name navn som lagres på tool.name\n * @param type type som lagres på tool.type\n * @param labels labels som lagres på tool.labels\n * @param action 'Close' | 'Open'\n */\nexport const trackProsesshjelp = (name, type, labels, action) => {\n trackTool(name, type, labels, action);\n};\n/**\n * Oppdater data om brukeren, f.eks.\n * updateUserAttributes({ userStatus: \"something\" })\n * @param userAttributes objekt med verdier som enten legges til eller oppdaterer eksisterende data om brukeren\n */\nexport const updateUserAttributes = (userAttributes) => {\n const payload = {\n user: userAttributes,\n };\n pushToDataLayer(payload);\n};\n/**\n * spor sidevisninger, e.g.\n * trackPageview()\n * @param hasContent (valgfri) om siden har innhold\n */\nexport const trackPageview = (hasContent) => {\n const payload = {\n event: 'pageview',\n page: {\n hasContent: !!hasContent,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor om en tjeneste har innhold eller ikke\n * @param hasContent Boolean som sier om det er innhold i tjenesten eller ikke\n */\nexport const trackHasContent = (hasContent) => {\n trackPageview(hasContent);\n};\n/**\n * Spor feil, f.eks.\n * trackError(\"level1\", \"Beskrivelse av feilen\")\n * @param level Alvorlighetsgrad (level1, level2, level3 eller level4)\n * @param details Tekst som beskriver feilen\n */\nexport const trackError = (level, details) => {\n const payload = {\n event: 'site error',\n error: {\n level,\n details,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor klikk i toppmenyen\n * @param name string\n * @param label navigationLabel\n * @param pageSection navigationPageSection\n */\nexport const trackNavigation = (name, label, pageSection) => {\n const payload = {\n event: 'navigation',\n navigation: {\n name,\n label,\n pageSection,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor tilbakemelding i invitasjon til spørreundersøkelse\n * @param name string\n * @param label string\n */\nexport const trackFeedback = (name, label) => {\n const payload = {\n event: 'feedback',\n feedback: {\n name,\n label,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor 404-feil\n */\nexport const track404 = () => {\n const payload = {\n event: '404 not found',\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor at bruker bytter språk.\n * trackLanguage('English')\n * @param language Språket bruker valgte.\n */\nexport const trackLanguage = (language) => {\n const payload = {\n event: 'change language',\n page: {\n language,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor endring i hvem brukeren representerer\n * @param onBehalfOf Hvilken type representasjon er det\n * @param role Hvilken rolle har bruker i representasjonen\n */\nexport const trackRepresentation = (onBehalfOf, role) => {\n const payload = {\n user: {\n representation: {\n onBehalfOf,\n role,\n },\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor visning av informasjon\n * @param type Hvilken type informasjon som vises\n * @param name Navn på informasjonen\n */\nexport const trackInfoShown = (type, name) => {\n const payload = {\n event: 'info shown',\n info: {\n type,\n name,\n },\n };\n pushToDataLayer(payload);\n};\n/**\n * Spor klikk på informasjon\n * @param type Hvilken type informasjon som vises\n * @param name Navn på informasjonen\n * @param option Navn på informasjonen\n */\nexport const trackInfoClick = (type, name, option) => {\n const payload = {\n event: 'info click',\n info: {\n type,\n name,\n option,\n },\n };\n pushToDataLayer(payload);\n};\n","import { getHostnameWithoutSubdomain } from './cookie';\nexport const __cookieOptions__ = { secure: 'secure' };\n/**\n * Returnerer domene og path for bruk i cookie som skal gjelde på tvers av åpne sider og tjenester\n * @returns domain og path for bruk i cookie\n */\nexport const getCookieDomainAndPath = () => `domain=${getHostnameWithoutSubdomain()}; path=/;`;\n/**\n * Lagrer cookie på tvers av åpne sider og tjenester\n * @param name navn på cookie\n * @param value verdi på cookie\n * @param maxAgeInDays levetid på cookie i dager\n */\nexport const setSharedCookie = (name, value, maxAgeInDays = 365) => {\n const maxAgeInSeconds = maxAgeInDays * 24 * 60 * 60;\n document.cookie = `${name}=${value}; ${getCookieDomainAndPath()} max-age=${maxAgeInSeconds}; ${__cookieOptions__.secure}`;\n};\n/**\n * Sletter cookie på tvers av åpne sider og tjenester\n * @param name navn på cookie\n */\nexport const deleteSharedCookie = (name) => {\n document.cookie = `${name}=; ${getCookieDomainAndPath()} expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n};\n","import { useEffect } from 'react';\nimport { HeaderFooterEvents, CmsBlocksEvents, CommonEvents, WebComponents, StepEvents } from './constants';\nimport { setVisPersonvelger } from '../hn-user';\nconst dispatchCustomEvent = (selector, eventType, detail) => {\n const element = document.querySelector(selector);\n if (element?.dispatchEvent) {\n element.dispatchEvent(new CustomEvent(eventType, {\n cancelable: true,\n detail,\n }));\n }\n};\nexport const HNeventSetFirstTimeLogin = (isFirstTime = true) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.setfirsttimelogin, { firstTimeLogin: isFirstTime });\nexport const HNeventSetAnonymousHeader = (isAnonymous = true) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.setanonymousheader, { anonymousHeader: isAnonymous });\nexport const HNeventSetHiddenHeader = (isHidden = true) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.sethiddenheader, { hiddenHeader: isHidden });\nexport const HNeventSetHiddenFooter = (isHidden = true) => dispatchCustomEvent('hn-webcomp-footer', HeaderFooterEvents.sethiddenfooter, {\n hiddenFooter: isHidden,\n});\nexport const HNeventSetNoMarginFooter = (noMargin = true) => dispatchCustomEvent('hn-webcomp-footer', HeaderFooterEvents.setnomarginfooter, {\n noMarginFooter: noMargin,\n});\nexport const HNeventRefreshVarslinger = () => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.refreshvarslinger, {});\nexport const HNeventSetDriftsmeldingPath = (path) => dispatchCustomEvent('hn-webcomp-driftspanel', HeaderFooterEvents.setdriftsmeldingpath, { path });\n/**\n * @deprecated Bruk HNeventRefreshVarslinger\n */\nexport const HNeventRefreshVarslingerOgHendelsesmeny = () => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.refreshvarslingeroghendelsesmeny, {});\nexport const HNeventSetOnShowSignoutbox = (fn) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.setonshowsignoutbox, { onShowSignOutBox: fn });\nexport const HNeventSetUserLoading = (userLoading) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.setuserloading, { userLoading });\nexport const HNeventSoonAutoSignOut = () => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.soonautosignout, {});\nexport const HNeventShowAppInvitation = (onAppOpen, onWebLogin, onClose) => dispatchCustomEvent('hn-webcomp-header', HeaderFooterEvents.showappinvitation, { onAppOpen, onWebLogin, onClose });\nexport const HNeventSetRedirectTo = (redirectTo) => dispatchCustomEvent('hn-webcomp-personvelger', HeaderFooterEvents.setredirectto, { redirectTo });\nexport const HNeventSetRedirectToUrlAfterLogin = (redirectToUrlAfterLogin) => dispatchCustomEvent('hn-webcomp-personvelger', HeaderFooterEvents.setredirecttourlafterlogin, {\n redirectToUrlAfterLogin,\n});\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const HNeventSetSurveys = (surveys) => dispatchCustomEvent('hn-webcomp-footer', HeaderFooterEvents.setsurveys, { surveys });\nexport const HNeventSetFooterData = (data) => dispatchCustomEvent('hn-webcomp-footer', HeaderFooterEvents.setfooterdata, data);\nexport const HNeventSetVisPersonvelger = (visPersonvelger) => {\n setVisPersonvelger(visPersonvelger);\n window.dispatchEvent(new CustomEvent(HeaderFooterEvents.setvispersonvelger, {\n detail: { visPersonvelger },\n }));\n};\nexport const HNeventSetHiddenPromopanel = (isHidden) => dispatchCustomEvent(WebComponents.Promopanel, CmsBlocksEvents.setHiddenPromopanel, { hiddenPromopanel: isHidden });\nexport const HNeventIsMicroFrontendMounted = (webcomponentName) => {\n const webcomponent = document.querySelector(webcomponentName);\n if (webcomponent?.dispatchEvent) {\n webcomponent.dispatchEvent(new CustomEvent(CommonEvents.isMounted));\n }\n};\nexport const HNaddEventListener = (event, element, handler, passive = false) => {\n useEffect(() => {\n if (element)\n element.addEventListener(event, handler, passive);\n return function cleanup() {\n if (element)\n element.removeEventListener(event, handler);\n };\n });\n};\nexport const HNeventNavigateStep = (stepId, detail) => dispatchCustomEvent(`#${stepId}`, StepEvents.Navigate, detail);\nexport const HNeventSendFromWebComponent = (stepId, detail) => dispatchCustomEvent(`#${stepId}`, StepEvents.SendFromWebComponent, detail);\n","import { LanguageLocales } from '@helsenorge/core-utils/constants/languages';\nimport { getCookieValue } from './cookie';\nimport { setSharedCookie } from './shared-cookies';\nimport { CommonEvents } from './web-component/constants';\nimport { HNaddEventListener } from './web-component/events';\n/**\n * Navn på cookie som brukes til å lagre brukerens språk\n */\nconst LANGUAGE_COOKIE_NAME = 'hn-language';\n/**\n * Hvor lang tid cookien varer\n */\nconst LANGUAGE_COOKIE_EXPIRES_IN_DAYS = 1;\n/**\n * Hent brukerens språk fra cookie\n * @returns Valgt språk\n */\nexport const getUserLanguage = () => {\n const language = getCookieValue(LANGUAGE_COOKIE_NAME);\n if (typeof language === 'string' && Object.values(LanguageLocales).includes(language)) {\n return language;\n }\n};\n/**\n * Lagre brukerens språk i cookie og dispatch event for bytte av språk\n * @param language Valgt språk\n */\nexport const setUserLanguage = (language) => {\n setSharedCookie(LANGUAGE_COOKIE_NAME, language, LANGUAGE_COOKIE_EXPIRES_IN_DAYS);\n document.dispatchEvent(new CustomEvent(CommonEvents.setLanguage, { detail: { language } }));\n};\n/**\n * Lytt på endringer i brukerens språk\n * @param callback Funksjon som kalles når brukeren endrer språk\n */\nexport const useSetUserLanguageEvent = (callback) => HNaddEventListener(CommonEvents.setLanguage, document, event => callback(event.detail.language));\n/**\n * Hent riktig språkkode for bruk i -atributtet\n * @param language Valgt språk\n * @returns ISO 639-1 språkkode https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\n */\nexport const getIsoLanguageName = (language) => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n return 'no';\n case LanguageLocales.NORWEGIAN_NYNORSK:\n return 'nn';\n case LanguageLocales.ENGLISH:\n return 'en';\n case LanguageLocales.LITHUANIAN:\n return 'lt';\n case LanguageLocales.POLISH:\n return 'pl';\n case LanguageLocales.RUSSIAN:\n return 'ru';\n case LanguageLocales.ROMANIAN:\n return 'ro';\n case LanguageLocales.SAMI_NORTHERN:\n return 'se';\n default:\n return undefined;\n }\n};\n/**\n * Oppdater -atributtet med valgt språk ihht ISO 639-1-standard. Brukes på tjenester, på åpne sider settes dette av backend.\n * @param language Valgt språk\n */\nexport const setDocumentLanguage = (language) => {\n const isoLanguage = getIsoLanguageName(language);\n if (isoLanguage) {\n document.documentElement.lang = isoLanguage;\n }\n};\n","import { HelsenorgeHttpError, getCorrelationIdFromResponse } from './hn-proxy-service';\n/**\n * Returnerer en url-friendly string fra et objekt, f.eks. ?a=b&x=y\n * @param params Objekt med parametere som skal gjøres om til en string { a : 'b', x: 'y' }\n */\nexport const parseParams = (params) => {\n if (params) {\n const queryString = Object.keys(params)\n .map(key => {\n if (Object.prototype.hasOwnProperty.call(params, key) && typeof params[key] !== 'undefined') {\n return `${key}=${params[key]}`;\n }\n })\n .filter(x => !!x)\n .join('&');\n if (queryString) {\n return `?${queryString}`;\n }\n }\n return '';\n};\n/**\n * Oppretter nytt Header-objekt med Accept og Content-type\n * @param type application/json er default\n */\nexport const createBaseHeaders = (type = 'application/json') => new Headers({\n Accept: type,\n 'Content-Type': type,\n});\n/**\n * Sjekker status på en Response og returnerer en Promise avhengig av status\n * @param response Response objektet fra HTTP request\n * @throws {HelsenorgeHttpError} Dersom APIet svarer med en feil som ikke er i standard-format\n * @throws {Error} Dersom det skjer andre feil\n */\nexport const checkStatus = (response) => {\n const contentType = response.headers.get('content-type');\n const correlationId = getCorrelationIdFromResponse(response);\n if (contentType?.indexOf('application/json') !== -1) {\n if (response.status === 204) {\n return Promise.resolve(null);\n }\n if (response.ok) {\n return response.json();\n }\n return response\n .json()\n .then(error => {\n // Håndtering av feil der serveren har respondert med gyldig JSON\n throw new HelsenorgeHttpError(response.status, 'Det har skjedd en teknisk feil. Prøv igjen senere.', correlationId, error);\n })\n .catch(error => {\n if (error instanceof HelsenorgeHttpError) {\n throw error;\n }\n // Håndtering av feil der serveren har respondert med ugyldig JSON\n throw new HelsenorgeHttpError(response.status, 'Det har skjedd en teknisk feil. Prøv igjen senere.', correlationId);\n });\n }\n throw new Error('Det har skjedd en teknisk feil. Prøv igjen senere.');\n};\n","/*\n cycle.js\n 2013-02-19\n\n Public Domain.\n\n NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n\n This code should be minified before deployment.\n See http://javascript.crockford.com/jsmin.html\n\n USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n NOT CONTROL.\n*/\nexport const decycle = (object) => {\n // Make a deep copy of an object or array, assuring that there is at most\n // one instance of each object or array in the resulting structure. The\n // duplicate references (which might be forming cycles) are replaced with\n // an object of the form\n // {$ref: PATH}\n // where the PATH is a JSONPath string that locates the first occurance.\n // So,\n // var a = [];\n // a[0] = a;\n // return JSON.stringify(JSON.decycle(a));\n // produces the string '[{\"$ref\":\"$\"}]'.\n // JSONPath is used to locate the unique object. $ indicates the top level of\n // the object or array. [NUMBER] or [STRING] indicates a child member or\n // property.\n const objects = [], // Keep a reference to each unique object or array\n paths = []; // Keep the path to each unique object or array\n return (function derez(value, path) {\n // The derez recurses through the object, producing the deep copy.\n let i, // The loop counter\n name, // Property name\n nu; // The new object or array\n // typeof null === 'object', so go on if this value is really an object but not\n // one of the weird builtin objects.\n if (typeof value === 'object' &&\n value !== null &&\n !(value instanceof Boolean) &&\n !(value instanceof Date) &&\n !(value instanceof Number) &&\n !(value instanceof RegExp) &&\n !(value instanceof String)) {\n // If the value is an object or array, look to see if we have already\n // encountered it. If so, return a $ref/path object. This is a hard way,\n // linear search that will get slower as the number of unique objects grows.\n for (i = 0; i < objects.length; i += 1) {\n if (objects[i] === value) {\n return { $ref: paths[i] };\n }\n }\n // Otherwise, accumulate the unique value and its path.\n objects.push(value);\n paths.push(path);\n // If it is an array, replicate the array.\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n nu = [];\n for (i = 0; i < value.length; i += 1) {\n nu[i] = derez(value[i], path + '[' + i + ']');\n }\n }\n else {\n // If it is an object, replicate the object.\n nu = {};\n for (name in value) {\n if (Object.prototype.hasOwnProperty.call(value, name)) {\n nu[name] = derez(value[name], path + '[' + JSON.stringify(name) + ']');\n }\n }\n }\n return nu;\n }\n return value;\n })(object, '$');\n};\n","/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-use-before-define */\nimport { decycle } from './cycle';\nimport { getServerLogLevel, getTjenesterUrl, HelsenorgeHttpError, HelsenorgeProxyError } from './hn-proxy-service';\nimport { createBaseHeaders } from './hn-service';\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[LogLevel[\"Trace\"] = 0] = \"Trace\";\n LogLevel[LogLevel[\"Debug\"] = 1] = \"Debug\";\n LogLevel[LogLevel[\"Info\"] = 2] = \"Info\";\n LogLevel[LogLevel[\"Warn\"] = 3] = \"Warn\";\n LogLevel[LogLevel[\"Error\"] = 4] = \"Error\";\n LogLevel[LogLevel[\"Fatal\"] = 5] = \"Fatal\";\n LogLevel[LogLevel[\"Off\"] = 6] = \"Off\";\n})(LogLevel || (LogLevel = {}));\nconst unwrapError = (potentialError) => {\n if (potentialError instanceof HelsenorgeProxyError) {\n return `${potentialError.message} Status code: ${potentialError.statusCode} CorrelationId: ${potentialError.correlationId} Stack: ${potentialError.stack}`;\n }\n else if (potentialError instanceof HelsenorgeHttpError) {\n return `${potentialError.message} Status code: ${potentialError.statusCode} Stack: ${potentialError.stack}`;\n }\n else if (potentialError instanceof Error) {\n return `${potentialError.message} Stack: ${potentialError.stack}`;\n }\n else if (typeof potentialError === 'string' || potentialError instanceof String) {\n return potentialError;\n }\n else if (potentialError.length > 0) {\n const innerError = potentialError[0];\n return unwrapError(innerError);\n }\n else {\n return JSON.stringify(decycle(potentialError));\n }\n};\nconst generateEntry = (level, message, ...optionalParams) => {\n let fullMessage = message;\n fullMessage = optionalParams.reduce((previous, current) => {\n return previous + ' ' + unwrapError(current);\n }, fullMessage ?? '');\n return {\n Level: level,\n Message: fullMessage,\n Url: window.location.href,\n };\n};\nconst postLogEntry = (logEntry) => {\n fetch(getTjenesterUrl() + '/api/v1/Frontend/Log', {\n method: 'post',\n headers: createBaseHeaders(),\n credentials: 'include',\n body: JSON.stringify(logEntry),\n }).catch();\n};\n/**\n * Logger error til serveren\n */\nexport const logToServer = (level, message, ...optionalParams) => {\n const logLevel = getServerLogLevel();\n if (logLevel !== null && level >= logLevel) {\n exportFunctions.postLogEntry(generateEntry(level, message, optionalParams));\n }\n};\n/**\n * Lager en event listener på errors og logger error til serveren\n */\nexport const captureErrors = () => {\n window.addEventListener('error', function (e) {\n let message = e.message;\n const error = e.error;\n if (error) {\n message = error;\n const stack = error.stack;\n if (stack) {\n message = stack;\n }\n }\n else {\n message = message + '. Access to error information is restricted on this domain!';\n if (e.filename) {\n message = message + ' Filename:' + e.filename;\n }\n }\n exportFunctions.logToServer(LogLevel.Error, message);\n });\n};\n/**\n * Lager en console.debug og logger til serveren\n * @param message - string som sendes i console.debug og logges til serveren\n * @param optionalParams params som sendes til console.debug og logges til serveren\n */\nexport const debug = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.debug(message, optionalParams);\n }\n exportFunctions.logToServer(LogLevel.Debug, message, optionalParams);\n};\n/**\n * Lager en console.error og logger til serveren\n * @param message - string som sendes i console.error og logges til serveren\n * @param optionalParams params som sendes til console.error og logges til serveren\n */\nexport const error = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.error(message, optionalParams);\n }\n exportFunctions.logToServer(LogLevel.Error, message, optionalParams);\n};\n/**\n * Lager en console.info og logger til serveren\n * @param message - string som sendes i console.info og logges til serveren\n * @param optionalParams params som sendes til console.info og logges til serveren\n */\nexport const info = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.info(message, optionalParams);\n }\n exportFunctions.logToServer(LogLevel.Info, message, optionalParams);\n};\n/**\n * Lager en console.trace og logger til serveren\n * @param message - string som sendes i console.trace og til serveren\n * @param optionalParams params som sendes til console.trace og til serveren\n */\nexport const trace = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.trace(message, optionalParams);\n }\n exportFunctions.logToServer(LogLevel.Trace, message, optionalParams);\n};\n/**\n * Lager en console.warn og logger til serveren\n * @param message - string som sendes i console.warn og til serveren\n * @param optionalParams params som sendes til console.warn og til serveren\n */\nexport const warn = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.warn(message, optionalParams);\n }\n exportFunctions.logToServer(LogLevel.Warn, message, optionalParams);\n};\nexport const allowConsoleOutput = () => !['production', 'test'].includes(process.env.NODE_ENV ?? '');\n/**\n * Lager en console.assert\n * @param test - test som sendes til console assert\n * @param message - message som sendes til console assert\n * @param optionalParams params som sendes til console assert\n */\nexport const assert = (test, message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.assert(test, message, optionalParams);\n }\n};\n/**\n * Lager en console.clear\n */\nexport const clear = () => {\n if (allowConsoleOutput()) {\n console.clear();\n }\n};\n/**\n * Lager en console.count\n * @param countTitle - string som sendes i console.count\n */\nexport const count = (countTitle) => {\n if (allowConsoleOutput()) {\n console.count(countTitle);\n }\n};\n/**\n * Lager en console.dir\n * @param value - string som sendes i console.dir og logges til serveren\n * @param optionalParams params som sendes til console.dir og logges til serveren\n */\nexport const dir = (value, ...optionalParams) => {\n if (allowConsoleOutput()) {\n console.dir(value, optionalParams);\n }\n};\n/**\n * Lager en console.dirxml\n * @param value - string som sendes i console.dirxml og logges til serveren\n */\nexport const dirxml = (value) => {\n if (allowConsoleOutput()) {\n console.dirxml(value);\n }\n};\n/**\n * Lager en console.group\n * @param groupTitle - string som sendes i console.group\n */\nexport const group = (groupTitle) => {\n if (allowConsoleOutput()) {\n console.group(groupTitle);\n }\n};\n/**\n * Lager en console.groupCollapsed\n * @param groupTitle - string som sendes i console.groupCollapsed\n */\nexport const groupCollapsed = (groupTitle) => {\n if (allowConsoleOutput()) {\n console.groupCollapsed(groupTitle);\n }\n};\n/**\n * Lager en console.groupEnd\n */\nexport const groupEnd = () => {\n if (allowConsoleOutput()) {\n console.groupEnd();\n }\n};\n/**\n * Lager en console.log\n * @param message - string som sendes i console.log\n * @param optionalParams params som sendes til console.log\n */\nexport const log = (message, ...optionalParams) => {\n if (allowConsoleOutput()) {\n if (optionalParams && optionalParams.length > 0) {\n console.log(message, optionalParams);\n }\n else {\n console.log(message);\n }\n }\n};\n/**\n * Lager en console.profile\n * @param reportName - string som sendes i console.groupCollapsed\n */\nexport const profile = (reportName) => {\n if (allowConsoleOutput()) {\n console.profile(reportName);\n }\n};\n/**\n * Lager en console.profileEnd\n */\nexport const profileEnd = () => {\n if (allowConsoleOutput()) {\n console.profileEnd();\n }\n};\n/**\n * Lager en console.table\n * @param data - array av ukjent data som sendes videre til console.table\n */\nexport const table = (...data) => {\n if (allowConsoleOutput()) {\n console.table(data);\n }\n};\n/**\n * Lager en console.time\n * @param timerName - string som sendes videre til console.time\n */\nexport const time = (timerName) => {\n if (allowConsoleOutput()) {\n console.time(timerName);\n }\n};\n/**\n * Lager en console.timeEnd\n * @param timerName - string som sendes videre til console.timeEnd\n */\nexport const timeEnd = (timerName) => {\n if (allowConsoleOutput()) {\n console.timeEnd(timerName);\n }\n};\n// This wrapping is necessary for being able to Mock function in vi-tests\nconst exportFunctions = {\n postLogEntry,\n logToServer,\n debug,\n error,\n info,\n trace,\n warn,\n assert,\n clear,\n count,\n dir,\n dirxml,\n group,\n groupCollapsed,\n groupEnd,\n log,\n profile,\n profileEnd,\n table,\n time,\n timeEnd,\n};\nexport default exportFunctions;\n","import { format } from 'date-fns';\nimport { trackError } from './adobe-analytics';\nimport { getCookieValue } from './cookie';\nimport { parseParams } from './hn-service';\nimport { warn, error as logError } from './logger';\nconst isProxyErrorResponse = (response) => {\n return (typeof response === 'object' &&\n response !== null &&\n response.code !== undefined &&\n response.errorCategory !== undefined &&\n response.message !== undefined);\n};\nconst isPascalCaseProxyErrorResponse = (response) => {\n return (typeof response === 'object' &&\n response !== null &&\n response.Code !== undefined &&\n response.ErrorCategory !== undefined &&\n response.Message !== undefined);\n};\nconst mapPascalCaseErrorToCamelCase = (response) => ({\n code: response.Code,\n errorCategory: response.ErrorCategory,\n message: response.Message,\n});\nconst saveCorrelationId = (correlationId) => {\n window.HN = window.HN || {};\n window.HN.CorrelationIdList = window.HN.CorrelationIdList || [];\n window.HN.CorrelationIdList.push(correlationId);\n};\n/**\n * Hent correlationId fra API-respons\n * @param response Response fra APIet\n * @returns correlationId som guid\n */\nexport const getCorrelationIdFromResponse = (response) => {\n const correlationId = response.headers.get('CorrelationId');\n if (correlationId) {\n saveCorrelationId(correlationId);\n }\n return correlationId;\n};\nexport const getCorrelationIdList = () => window.HN?.CorrelationIdList;\n/**\n * Custom error i tilfelle APIet returnerer en 4XX- eller 5XX-feil, og en standard\n * Helsenorge-feilrespons med code, errorCategory og message.\n *\n * Eksempel på bruk med get():\n *\n * try {\n * await get('koronasertifikat', 'v1/CoronaCertificate');\n * } catch (error) {\n * if (error instanceof HelsenorgeProxyError && error.response.code === \"HFU-100400\") {\n * // I tilfelle backend svarer med en spesiell feilkode\n * }\n * // Gjør noe annet for andre feil\n * }\n */\nexport class HelsenorgeProxyError extends Error {\n constructor(statusCode, message, correlationId, response, ...params) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(...params);\n Object.defineProperty(this, \"statusCode\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"correlationId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"response\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HelsenorgeProxyError);\n }\n this.name = 'HelsenorgeProxyError';\n // Custom debugging information\n this.statusCode = statusCode;\n this.message = message;\n this.correlationId = correlationId;\n this.response = response;\n }\n}\n/**\n * Custom error i tilfelle APIet returnerer en 4XX- eller 5XX-feil, men der responsen\n * ikke er i henhold til standard.\n */\nexport class HelsenorgeHttpError extends Error {\n constructor(statusCode, message, correlationId, response, ...params) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n super(...params);\n Object.defineProperty(this, \"statusCode\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"correlationId\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"response\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, HelsenorgeHttpError);\n }\n this.name = 'HelsenorgeHttpError';\n // Custom debugging information\n this.statusCode = statusCode;\n this.message = message;\n this.correlationId = correlationId;\n this.response = response;\n }\n}\n/**\n * Returnerer baseUrl til Tjenester basert på HN Rest objektet\n */\nexport const getTjenesterUrl = () => {\n return window.HN?.Rest?.TjenesterUrl ?? '';\n};\n/**\n * Returnerer true når window urlen er lik tjenester baseUrl\n */\nexport const erTjenester = () => {\n if (window && window.location) {\n return window.location.origin === getTjenesterUrl();\n }\n return false;\n};\n/**\n * Returnerer proxy url med MinHelse baseUrl og proxynavnet\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n */\nexport const getTjenesterApiUrl = (proxyName, endpoint) => {\n const apiUrl = window.HN?.Rest?.TjenesterApiUrl ?? '';\n return `${apiUrl}/proxy/${proxyName}/${endpoint}`;\n};\nexport function getServerLogLevel() {\n return window.HN?.Rest?.LogLevel ?? null;\n}\n/**\n * Returnerer default params som trengs i en vanlig request\n * @returns Objekt med headers\n */\nconst getRequestHeaders = () => {\n const headers = {};\n if (window.HN?.Rest?.HendelseLoggType) {\n headers['X-hn-hendelselogg'] = window.HN.Rest.HendelseLoggType;\n }\n if (getCookieValue('HN_CSRF_Token')) {\n headers['X-HN-CSRF-Token'] = getCookieValue('HN_CSRF_Token');\n }\n return headers;\n};\n/**\n * Returnerer true når window urlen er lik Helsenorge baseUrl\n */\nexport const erHelsenorge = () => {\n return window.location.origin === getHelsenorgeUrl();\n};\n/**\n * Returnerer Headers som trengs i en vanlig request\n * @param type optional content-type - default er json\n */\nexport const createHeaders = (type = 'application/json') => {\n const headers = new Headers(getRequestHeaders());\n headers.append('Accept', type);\n headers.append('Content-Type', type);\n return headers;\n};\n/**\n * Returnerer filnavn fra et Response-objekt ved nedlasting av filer\n * @param response Responsen fra et fetch-kall\n * @returns filnavn fra Content-Disposition-header, eller en fallback dersom headeren ikke finnes\n */\nexport const getFilenameFromResponse = (response) => {\n let filename = 'nedlasting-' + format(new Date(), 'yyyy-M-d') + '-helseNorge';\n const contentDisposition = response.headers.get('content-disposition');\n if (contentDisposition) {\n const utf8Regex = /filename\\*=utf-8''(.+)/i;\n const asciiRegex = /filename=\"(.+)\"/i;\n const asciiRegexWithoutQuotes = /filename=(.+)/i;\n const match = contentDisposition.match(utf8Regex) ??\n contentDisposition.match(asciiRegex) ??\n contentDisposition.match(asciiRegexWithoutQuotes) ??\n false;\n if (match) {\n try {\n filename = decodeURI(match[1]);\n }\n catch (e) {\n logError(`Responsen fra ${response.url} inneholder ugyldige tegn i filnavnet i Content-Disposition-headeren: ${contentDisposition}`);\n }\n }\n }\n return filename;\n};\n/**\n * Returnerer JSON error objekt - f.eks '{ \"Code\":\"EHAPI-100000\", \"Message\":\"Teknisk feil\", \"ErrorCategory\": 0}'\n * @param html ErrorMsg i html\n */\nexport const getErrorFromHTML = (html) => {\n const first = html.indexOf('{');\n const last = html.lastIndexOf('}');\n const everything = html.substring(first, last + 1);\n if (everything === '') {\n return null;\n }\n return JSON.parse(everything);\n};\n/**\n * Returnerer url basert på HN Rest objektet\n */\nexport function getHelsenorgeUrl() {\n return window.HN?.Rest?.HelseNorgeUrl ?? '';\n}\n/**\n * Returnerer full query string basert på parametrene sendt som argument '?param1=value¶m2=value'\n * @param params opjekt med parametrene\n */\nconst createQueryString = (params) => {\n return ('?' +\n Object.keys(params)\n .map((key) => {\n return Array.isArray(params[key])\n ? params[key].map((x) => `${key}=${x}`).join('&')\n : `${key}=${params[key]}`;\n })\n .join('&'));\n};\n/**\n * Sjekker status på en Response og returnerer en Promise avhengig av status\n * @param response Response objektet fra HTTP request\n * @throws {HelsenorgeProxyError} Dersom APIet svarer med en feil etter Helsenorge-standard\n * @throws {HelsenorgeHttpError} Dersom APIet svarer med en feil som ikke er i standard-format\n * @throws {Error} Dersom det skjer andre feil\n */\nexport const checkStatus = (response) => {\n const contentType = response.headers.get('content-type');\n const correlationId = getCorrelationIdFromResponse(response);\n if (contentType?.indexOf('application/json') !== -1) {\n if (response.status === 204) {\n return Promise.resolve(null);\n }\n if (response.status === 429) {\n throw new HelsenorgeHttpError(429, 'Denne tjenesten er ikke tilgjengelig for øyeblikket. Det er for mange som ønsker å bruke tjenesten samtidig.', correlationId);\n }\n if (response.ok) {\n return response.json();\n }\n return response.json().then(error => {\n if (isProxyErrorResponse(error) &&\n (error.code === 'SEC-110000' || error.code === 'EHSEC-110000') &&\n document.location?.href.indexOf('autosignout=1') === -1) {\n // redirect dersom token er utgått eller ugyldig\n window.location.href = `${getTjenesterUrl()}/auth/autosignout`;\n }\n if (isProxyErrorResponse(error)) {\n throw new HelsenorgeProxyError(response.status, error.message, correlationId, error);\n }\n if (isPascalCaseProxyErrorResponse(error)) {\n throw new HelsenorgeProxyError(response.status, error.Message, correlationId, mapPascalCaseErrorToCamelCase(error));\n }\n throw new HelsenorgeHttpError(response.status, 'Det har skjedd en teknisk feil. Prøv igjen senere.', correlationId, error);\n });\n }\n throw new Error('Det har skjedd en teknisk feil. Prøv igjen senere.');\n};\nconst handleError = (error, apiUrl) => {\n trackError('level1', 'Feil ved henting av data fra proxy');\n if (error instanceof TypeError && error.message === 'Failed to fetch') {\n warn(`Kall til følgende URL feilet: ${apiUrl}. Mottok ingen respons fra tjenesten.`);\n throw new Error('Det har skjedd en teknisk feil. Prøv igjen senere.');\n }\n throw error;\n};\n/**\n * baseCrud som brukes for å fetche. Logger eventuelle nettverksfeil med warn().\n * @param method\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param data\n * @throws {Error} Dersom det skjedde en feil under fetch-kallet\n */\nconst baseCrud = (method, proxyName, endpoint, params, data) => {\n const queryString = params && Object.keys(params).length > 0 ? createQueryString(params) : '';\n const baseUrl = getTjenesterApiUrl(proxyName, endpoint);\n const requestBody = data ? { body: JSON.stringify(data) } : {};\n const apiUrl = baseUrl + queryString;\n return fetch(apiUrl, {\n ...requestBody,\n method,\n credentials: 'include',\n headers: createHeaders(),\n })\n .then(response => checkStatus(response))\n .catch(error => handleError(error, apiUrl));\n};\n/**\n * get method\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n */\nexport const get = (proxyName, endPoint, params) => {\n return baseCrud('get', proxyName, endPoint, params);\n};\n/**\n * post method\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param data\n */\nexport const post = (proxyName, endPoint, data, params) => {\n return baseCrud('post', proxyName, endPoint, params, data);\n};\n/**\n * put method\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param data\n */\nexport const put = (proxyName, endpoint, data, params) => {\n return baseCrud('put', proxyName, endpoint, params, data);\n};\n/**\n * patch method\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param data\n */\nexport const patch = (proxyName, endpoint, data, params) => {\n return baseCrud('patch', proxyName, endpoint, params, data);\n};\n/**\n * remove method\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param data\n */\nexport const remove = (proxyName, endpoint, data, params) => {\n return baseCrud('delete', proxyName, endpoint, params, data);\n};\n/**\n * Konkatenerer url-lenke basert på environment, proxy, url, request params og custom params\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n */\nexport const link = (proxyName, endpoint, params) => {\n return getTjenesterApiUrl(proxyName, endpoint) + (params ? createQueryString(params) : '');\n};\n/**\n * Las ned en fil/Blob i nettleseren\n * @param download Info om fil som skal lastes ned\n */\nconst downloadFileInBrowser = async (download) => {\n const blob = await download.blob;\n const a = document.createElement('a');\n document.body.appendChild(a);\n const url = window.URL.createObjectURL(blob);\n a.href = url;\n a.download = download.fileName;\n a.click();\n window.URL.revokeObjectURL(url);\n};\n/**\n * Sjekker status på en Response og returnerer info om fil som skal nedlastes\n * @param response Response objektet fra HTTP request\n * @throws {HelsenorgeProxyError} Dersom APIet svarer med en feil etter Helsenorge-standard\n * @throws {HelsenorgeHttpError} Dersom APIet svarer med en feil som ikke er i standard-format\n */\nconst handleDownloadResponse = async (response) => {\n if (!response.ok) {\n const error = await response.text();\n const correlationId = getCorrelationIdFromResponse(response);\n if (error === '401') {\n window.location.reload();\n throw new HelsenorgeHttpError(401, 'Det har skjedd en teknisk feil. Prøv igjen senere.', correlationId, error);\n }\n else {\n logError('responseHtml', error);\n const errorResponse = getErrorFromHTML(error);\n if (isProxyErrorResponse(errorResponse)) {\n throw new HelsenorgeProxyError(response.status, errorResponse.message, correlationId, errorResponse);\n }\n else if (isPascalCaseProxyErrorResponse(errorResponse)) {\n throw new HelsenorgeProxyError(response.status, errorResponse.Message, correlationId, mapPascalCaseErrorToCamelCase(errorResponse));\n }\n throw new HelsenorgeHttpError(response.status, 'Det har skjedd en teknisk feil. Prøv igjen senere.', correlationId, error);\n }\n }\n const fileName = getFilenameFromResponse(response);\n const blob = response.blob();\n return { blob, fileName };\n};\n/**\n * Fetch for nedlasting av filer\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @param method HTTP-metode: get eller post\n * @param data Data som som sendes som body med fetch\n */\nexport const download = (proxyName, endpoint, params, method = 'get', data) => {\n const queryString = method === 'get' ? parseParams(params) : '';\n const baseUrl = getTjenesterApiUrl(proxyName, endpoint);\n const requestBody = data ? { body: JSON.stringify(data) } : {};\n const apiUrl = baseUrl + queryString;\n const headers = createHeaders();\n if (method === 'get') {\n headers.set('Content-Type', 'multipart/form-data');\n }\n return new Promise((resolve, reject) => {\n fetch(apiUrl, {\n ...requestBody,\n method,\n credentials: 'include',\n headers,\n })\n .then(handleDownloadResponse)\n .then(downloadFileInBrowser)\n .then(() => resolve())\n .catch(error => {\n trackError('level1', 'Feil ved nedlasting av fil');\n if (error instanceof TypeError && error.message === 'Failed to fetch') {\n reject(new Error('Det har skjedd en teknisk feil. Prøv igjen senere.'));\n }\n reject(error);\n });\n });\n};\n/**\n * Last opp fil\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param formData Fil som skal lastes opp\n * @param params parametere som sendes med som query string\n * @throws {Error} Dersom det skjedde en feil under fetch-kallet\n */\nexport const upload = (proxyName, endpoint, formData, params) => {\n const baseUrl = getTjenesterApiUrl(proxyName, endpoint);\n const queryString = params && Object.keys(params).length > 0 ? createQueryString(params) : '';\n const apiUrl = baseUrl + queryString;\n return fetch(apiUrl, {\n body: formData,\n method: 'POST',\n credentials: 'include',\n headers: new Headers(getRequestHeaders()),\n })\n .then(response => checkStatus(response))\n .catch(error => handleError(error, apiUrl));\n};\n/**\n * Hent XML fra proxy\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params parametere som sendes med som query string\n * @returns XML som string\n */\nexport const getXml = (proxyName, endpoint, params) => {\n const baseUrl = getTjenesterApiUrl(proxyName, endpoint);\n const apiUrl = baseUrl + parseParams(params);\n const headers = createHeaders('application/xml');\n const checkStatus = (response) => {\n const contentType = response.headers.get('content-type');\n if (contentType?.indexOf('application/xml') !== -1 && response.ok) {\n return response.text();\n }\n return response.text().then(error => {\n const correlationId = getCorrelationIdFromResponse(response);\n throw new HelsenorgeHttpError(response.status, 'Teknisk feil', correlationId, error);\n });\n };\n return fetch(apiUrl, {\n credentials: 'include',\n headers,\n })\n .then(checkStatus)\n .catch(error => handleError(error, apiUrl));\n};\n","import { trackError } from './adobe-analytics';\nimport { getUserLanguage } from './hn-language';\nimport { getHelsenorgeUrl } from './hn-proxy-service';\nimport { checkStatus, createBaseHeaders, parseParams } from './hn-service';\nimport { warn } from './logger';\nimport { CmsContentApiVersions } from './types/entities';\n/**\n * Returnerer CmsContentApiUrl fra window.HN.Rest\n */\nexport const getContentApiUrl = () => {\n return !!window.HN && !!window.HN.Rest && !!window.HN.Rest.CmsContentApiUrl ? window.HN.Rest.CmsContentApiUrl : '';\n};\n/**\n * Returnerer CmsContentApiPreviewUrl fra window.HN.Rest\n */\nexport const getContentApiPreviewUrl = () => {\n return !!window.HN && !!window.HN.Rest && !!window.HN.Rest.CmsContentApiPreviewUrl ? window.HN.Rest.CmsContentApiPreviewUrl : '';\n};\n/**\n * Returnerer true dersom URLen man står på inneholder content-api-preview=true\n */\nexport const enableContentApiPreview = () => {\n return !!window && window.location.href.indexOf('content-api-preview=true') !== -1;\n};\nconst handleError = (error, apiUrl) => {\n trackError('level1', 'Feil ved henting av data fra CMS');\n if (error instanceof TypeError && error.message === 'Failed to fetch') {\n warn(`Kall til content-apiet feilet: ${apiUrl}. Mottok ingen respons fra tjenesten.`);\n }\n else if (error instanceof Error) {\n warn(`Kall til content-apiet feilet: ${apiUrl}`, error);\n }\n throw error;\n};\n/**\n * Henter JSON fra content-apiet med fetch(). Returnerer et Promise.\n * Logger eventuelle feil med warn().\n * @param endpoint command strengen som sendes mot content-apiet\n * @param params object med parameters { param1 : 'myparam1', param2: 'myparam2'}\n * @param version setter hvilken versjon av conetnapi som skal kalles (v1/, v2/)\n * @throws {Error} Dersom det skjedde en feil under henting av data fra content-apiet.\n */\nexport const get = (endpoint, params = {}, version = CmsContentApiVersions.V1) => {\n const preview = enableContentApiPreview();\n const hostName = preview ? getContentApiPreviewUrl() : getContentApiUrl();\n const credentials = preview ? 'include' : 'omit'; // Må settes til omit for å kunne bruke wildcard for domener i CORS\n const headers = createBaseHeaders();\n if (preview) {\n headers.append('X-Preview', 'true');\n }\n const { languageCode = getUserLanguage(), ...restParams } = params;\n const apiUrl = `${hostName}/contentapi/internal/${version}${endpoint}${parseParams({ languageCode, ...restParams })}`;\n return fetch(apiUrl, {\n method: 'get',\n credentials,\n headers: headers,\n })\n .then(response => checkStatus(response))\n .catch(error => handleError(error, apiUrl));\n};\n/**\n * Send JSON til CMS-apiet med fetch() som POST-request. Returnerer et Promise.\n * Logger eventuelle feil med warn().\n * @param endpoint command strengen som sendes mot apiet\n * @param data object med data { param1 : 'myparam1', param2: 'myparam2'}\n * @param params object med parameters { param1 : 'myparam1', param2: 'myparam2'}\n * @throws {Error} Dersom det skjedde en feil under henting av data fra content-apiet.\n */\nexport const post = (endpoint, data, params = {}) => {\n const hostName = getContentApiUrl();\n const headers = createBaseHeaders();\n const apiUrl = `${hostName}/api/${endpoint}${parseParams(params)}`;\n return fetch(apiUrl, {\n method: 'POST',\n headers: headers,\n body: JSON.stringify(data),\n })\n .then(response => checkStatus(response))\n .catch(error => handleError(error, apiUrl));\n};\n/**\n * Send JSON til CMS-apiet med fetch() som PATCH-request. Returnerer et Promise.\n * Logger eventuelle feil med warn().\n * @param endpoint command strengen som sendes mot apiet\n * @param data object med data { param1 : 'myparam1', param2: 'myparam2'}\n * @param params object med parameters { param1 : 'myparam1', param2: 'myparam2'}\n * @throws {Error} Dersom det skjedde en feil under henting av data fra content-apiet.\n */\nexport const patch = (endpoint, data, params = {}) => {\n const hostName = getContentApiUrl();\n const headers = createBaseHeaders();\n const apiUrl = `${hostName}/api/${endpoint}${parseParams(params)}`;\n return fetch(apiUrl, {\n method: 'PATCH',\n headers: headers,\n body: JSON.stringify(data),\n })\n .then(response => checkStatus(response))\n .catch(error => handleError(error, apiUrl));\n};\n/**\n * Henter JSON fra Helsenorge-proxy (samme domene som content-apiet) med fetch().\n * Skal kun benyttes for åpne api-kall til tjenester der det er satt opp proxy (SOT).\n * Returnerer et Promise.\n * Logger eventuelle feil med warn().\n * @param proxyName navn på api-et/løsningsområdet. Eks pasientjournal eller velgbehandlingssted\n * @param endpoint path for endepunktet inkludert versjon. Eks: api/v1/Behandlinger eller v1/Behandlinger\n * @param params object med parameters { param1 : 'myparam1', param2: 'myparam2'}\n * @throws {Error} Dersom det skjedde en feil under henting av data fra content-apiet.\n */\nexport const getHelsenorgeProxy = (proxyName, endpoint, params) => {\n const apiUrl = getHelsenorgeUrl() + '/proxy/' + proxyName + '/' + endpoint + parseParams(params);\n return fetch(apiUrl, {\n method: 'get',\n credentials: 'omit', // Må settes til omit for å kunne bruke wildcard for domener i CORS\n headers: createBaseHeaders(),\n })\n .then(response => checkStatus(response))\n .catch(error => {\n if (error == 'TypeError: Failed to fetch') {\n warn(`Kall til helsenorge proxy: ${apiUrl}. Mottok ingen respons fra tjenesten.`);\n }\n else {\n warn(`Kall til helsenorge proxy feilet: ${apiUrl}. Feilmelding: ${JSON.stringify(error)}`);\n }\n throw error;\n });\n};\n","import LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport { get } from './cms-content-api-service';\nexport const REQUEST = 'cmsTjenesteTekster/REQUEST';\nexport const RECEIVE = 'cmsTjenesteTekster/RECEIVE';\nexport const FAILURE = 'cmsTjenesteTekster/FAILURE';\nexport const SETDEFAULTHJELPETEKST = 'cmsTjenesteTekster/SETDEFAULTHJELPETEKST';\nexport const ADDSPESIFIKKEHJELPETEKSTER = 'cmsTjenesteTekster/ADDSPESIFIKKEHJELPETEKSTER';\nconst getTjenesteTeksterKey = (name, languageCode) => `${name}.${languageCode}`;\nexport const cmsTjenesteTekster = (tjenesteTeksterState = {}, action) => {\n const tjenesteTeksterKey = action.type !== '' ? getTjenesteTeksterKey(action.name, action.language) : null;\n if (!tjenesteTeksterKey)\n return tjenesteTeksterState;\n switch (action.type) {\n case REQUEST: {\n return {\n ...tjenesteTeksterState,\n [tjenesteTeksterKey]: {\n error: false,\n loading: true,\n },\n };\n }\n case RECEIVE: {\n return {\n ...tjenesteTeksterState,\n [tjenesteTeksterKey]: {\n error: false,\n loading: false,\n data: action.data,\n },\n };\n }\n case SETDEFAULTHJELPETEKST: {\n const existingData = tjenesteTeksterState[tjenesteTeksterKey]?.data;\n const updatedData = {\n ...existingData,\n hjelpetekster: {\n ...existingData?.hjelpetekster,\n overskift: action.overskift,\n hjelpetekst: action.hjelpetekst,\n },\n };\n return {\n ...tjenesteTeksterState,\n [tjenesteTeksterKey]: {\n error: false,\n loading: false,\n data: updatedData,\n },\n };\n }\n case ADDSPESIFIKKEHJELPETEKSTER: {\n const existingData = tjenesteTeksterState[tjenesteTeksterKey]?.data;\n const updatedData = {\n ...existingData,\n hjelpetekster: {\n ...existingData?.hjelpetekster,\n spesifikkeHjelpetekster: [...(existingData?.hjelpetekster?.spesifikkeHjelpetekster || []), ...action.spesifikkeHjelpetekster],\n },\n };\n return {\n ...tjenesteTeksterState,\n [tjenesteTeksterKey]: {\n error: false,\n loading: false,\n data: updatedData,\n },\n };\n }\n case FAILURE: {\n return {\n ...tjenesteTeksterState,\n [tjenesteTeksterKey]: {\n error: true,\n loading: false,\n data: tjenesteTeksterState[tjenesteTeksterKey]?.data,\n },\n };\n }\n default:\n return tjenesteTeksterState;\n }\n};\nexport const selectCmsTjenesteTekster = (state, name, language) => state.cmsTjenesteTekster[getTjenesteTeksterKey(name, language)];\nexport const selectCmsTjenesteTekstForHjelpetekstId = (state, name, language, hjelpetekstId) => {\n if (typeof hjelpetekstId === 'string') {\n return selectCmsTjenesteTekster(state, name, language)?.data?.hjelpetekster?.spesifikkeHjelpetekster?.find(t => t.id?.toLowerCase() === hjelpetekstId?.toLowerCase());\n }\n return selectCmsTjenesteTekster(state, name, language)?.data?.hjelpetekster?.spesifikkeHjelpetekster?.find(t => hjelpetekstId.map(h => h.toLowerCase()).includes(t.id?.toLowerCase()));\n};\nexport const selectFeedbackResources = (state, name, language) => selectCmsTjenesteTekster(state, name, language)?.data?.feedback;\nexport const selectCmsTjenesteContent = (state, name, language) => selectCmsTjenesteTekster(state, name, language)?.data?.tjenesteContent;\nexport const selectWordExplanation = (state, name, language, word) => selectCmsTjenesteTekster(state, name, language)?.data?.oppslagsverk?.ordforklaringer?.find(o => {\n const wordTrimmed = word.trim().toLowerCase();\n const synonymList = o.synonyms?.split(';').map(s => s.trim().toLowerCase());\n return wordTrimmed === o.title?.trim().toLowerCase() || synonymList?.includes(wordTrimmed);\n});\nconst shouldFetchTjenesteTekster = (state, name, language) => !(getTjenesteTeksterKey(name, language) in state.cmsTjenesteTekster);\nexport const fetchTjenesteTekster = (name, language) => async (dispatch, getState) => {\n language ?? (language = LanguageLocales.NORWEGIAN);\n if (!shouldFetchTjenesteTekster(getState(), name, language))\n return;\n dispatch({ type: REQUEST, name, language });\n try {\n const tjenesteTekster = (await get('tjeneste', { navn: name, languageCode: language }));\n dispatch({ type: RECEIVE, name, language, data: tjenesteTekster });\n }\n catch {\n dispatch({ type: FAILURE, name, language });\n }\n};\nexport const setDefaultHjelpetekst = (dispatch, name, language, overskrift, hjelpetekst) => {\n dispatch({\n type: SETDEFAULTHJELPETEKST,\n name,\n language,\n overskift: overskrift,\n hjelpetekst,\n });\n};\nexport const addSpesifikkeHjelpetekster = (dispatch, name, language, spesifikkeHjelpetekster) => {\n dispatch({\n type: ADDSPESIFIKKEHJELPETEKSTER,\n name,\n language,\n spesifikkeHjelpetekster,\n });\n};\n","export default {\n COMMON: 'HN.MinHelse.Common.JS',\n FRAMEWORK: 'HN.Core.Framework.NPM.JS',\n PORTAL: 'HN.Portal',\n CONTENT: 'HN.Tjenester.Content',\n};\n","/**\n * Returnerer Path fra HN.Page objektet - eller tom string hvis den ikke finnes\n */\nexport const getPath = () => {\n return window.HN?.Page?.Path ?? '';\n};\n/**\n * Returnerer Version fra HN.Page objektet\n */\nexport const getVersion = () => {\n return window.HN?.Page?.Version;\n};\n/**\n * Returnerer Assets fra HN.Page objektet\n */\nexport const getAssets = () => {\n return window.HN?.Page?.Assets;\n};\n/**\n * Returnerer Assets fra HN.Page objektet - eller tom string hvis den ikke finnes\n */\nexport const getAssetsUrl = () => {\n return window.HN?.Page?.Assets ?? '';\n};\n/**\n * Returnerer VerticalAssetsPath fra HN.Page objektet - eller tom string hvis den ikke finnes\n */\nexport const getVerticalAssetsPath = () => {\n return window.HN?.Page?.VerticalAssetsPath ?? '';\n};\n/**\n * Oppdaterer Path key på HN.Page objektet\n * @param newPath verdien som settes i Path\n */\nexport const setPath = (newPath) => {\n window.HN = window.HN || {};\n window.HN.Page = window.HN.Page || {};\n window.HN.Page.Path = newPath;\n};\n/**\n * Hent ID som skal brukes på h1-elementet på siden\n * @returns ID\n */\nexport const getSidetittelId = () => 'sidetittel';\n","/**\n * Returnerer Debug fra HN objektet\n * @returns true dersom window.HN.Debug er satt\n */\nexport const isDebug = () => {\n return !!window?.HN?.Debug;\n};\n","import LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport { isDebug } from './hn-debug';\nexport const REQUEST = 'resources/REQUEST';\nexport const RECEIVE = 'resources/RECEIVE';\nexport const FAILURE = 'resources/FAILURE';\n/******************* REDUCERS *******************/\nfunction requestResources(project, language) {\n return {\n type: REQUEST,\n project,\n language,\n };\n}\nexport function receiveResources(data, project, language) {\n return {\n type: RECEIVE,\n data,\n project,\n language,\n };\n}\nexport function receiveResourcesFailed(project, language) {\n return {\n type: FAILURE,\n project,\n language,\n };\n}\n/**\n * Returnerer ResourcesState med oppdatert status avhengig av Action\n * @param resourcesState - incoming ResourcesState\n * @param action - ønsket ResourcesAction (Request, Receive, Failure, Empty)\n */\nexport const resources = (resourcesState = {}, action) => {\n const project = 'project' in action ? action.project : undefined;\n const language = 'language' in action ? action.language : undefined;\n const key = { project: project, language: language };\n const stringifiedKey = JSON.stringify(key);\n const resources = { ...resourcesState };\n switch (action.type) {\n case REQUEST:\n resources[stringifiedKey] = {\n error: false,\n loading: true,\n loaded: false,\n items: null,\n };\n return resources;\n case RECEIVE:\n resources[stringifiedKey] = {\n error: false,\n loading: false,\n loaded: true,\n items: action.data,\n };\n return resources;\n case FAILURE:\n resources[stringifiedKey] = {\n error: true,\n loading: false,\n loaded: false,\n items: null,\n };\n return resources;\n default:\n return resourcesState;\n }\n};\n/**\n * Returnerer ResourceItem fra resourcesState basert på project og language\n * @param resourcesState - incoming ResourcesState\n * @param project - project string\n * @param language - language string\n */\nexport const getResources = (resourcesState, project, language) => {\n const key = JSON.stringify({ project: project, language: language });\n return key in resourcesState ? resourcesState[key].items : {};\n};\n/**\n * Returnerer ResourceItem fra global Staten basert på project og language\n * @param state - incoming GlobalStateWithResources\n * @param project - project string\n * @param language - language string\n */\nexport const getResourcesFromState = (state, project, language) => {\n const key = JSON.stringify({ project: project, language: language });\n const value = state.resources[key];\n return value && value.loaded ? value.items : null;\n};\n/**\n * Returnerer Resource fra global Staten basert på project og language\n * Returnerer ny Resource med default status hvis den ikke finnes\n * @param state - incoming GlobalStateWithResources\n * @param project - project string\n * @param language - language string\n */\nexport const getResourcesObjectFromState = (state, project, language) => {\n const key = JSON.stringify({ project: project, language: language });\n return key in state.resources ? state.resources[key] : { error: false, loading: false, items: {}, loaded: false };\n};\nexport const getResourceWithId = (json) => {\n return Object.keys(json).reduce((previous, key) => {\n if (typeof json[key] === 'string') {\n previous[key] = json[key] + ' [' + key + ']';\n }\n return previous;\n }, {});\n};\nexport function getModifiedResourcesForTest(resourceText) {\n if (isDebug() && window.document.URL.includes('hjelpetekst=true')) {\n return getResourceWithId(resourceText);\n }\n if (process.env.NODE_ENV === 'test') {\n return Object.keys(resourceText).reduce((previous, current) => {\n previous[current] = current;\n return previous;\n }, {});\n }\n return resourceText;\n}\n/**\n * Returnerer false om resources allerede ligger i staten\n * @param state - incoming GlobalStateWithResources\n * @param project - project string\n * @param language - language string\n */\nexport const shouldFetchResources = (state, project, language) => {\n const key = JSON.stringify({ project: project, language: language });\n return !(key in state.resources);\n};\n/**\n * Returnerer en dispatch av requestResources basert på project name og language\n * @param project - project string\n * @param language - language string\n */\nexport const fetchResources = (project, language, getResourceFile) => {\n return (dispatch, getState) => {\n if (!language) {\n language = LanguageLocales.NORWEGIAN;\n }\n if (shouldFetchResources(getState(), project, language)) {\n dispatch(requestResources(project, language));\n const success = (data) => {\n const resourceText = getModifiedResourcesForTest(data);\n return dispatch(receiveResources(resourceText, project, language));\n };\n const failure = () => dispatch(receiveResourcesFailed(project, language));\n getResourceFile(project, language).then(success).catch(failure);\n }\n return null;\n };\n};\n","import { hasPersonverninnstilling } from './hn-user';\nimport { Personverninnstilling } from './types/entities';\nexport var Samtykke;\n(function (Samtykke) {\n /** Bruker har ikke samtykket til Helsenorge */\n Samtykke[Samtykke[\"Ingen\"] = 0] = \"Ingen\";\n /** Bruker har basis-samtykke */\n Samtykke[Samtykke[\"Basis\"] = 1] = \"Basis\";\n /** Bruker har Basis+-samtykke */\n Samtykke[Samtykke[\"BasisPluss\"] = 2] = \"BasisPluss\";\n /** Bruker har fullt samtykke */\n Samtykke[Samtykke[\"Full\"] = 3] = \"Full\";\n})(Samtykke || (Samtykke = {}));\n/**\n * Sjekker hvilket nivå av bruk av helsenorge innbygger har samtykket til.\n * @returns Full, BasisPluss, Basis eller Ingen\n */\nexport const getSamtykke = () => {\n if (hasPersonverninnstilling(Personverninnstilling.SamtykkeDigitalHelsetjeneste)) {\n return Samtykke.Full;\n }\n if (hasPersonverninnstilling(Personverninnstilling.SamtykkeJournalinnsyn)) {\n return Samtykke.BasisPluss;\n }\n if (hasPersonverninnstilling(Personverninnstilling.SamtykkeRegisterinnsyn)) {\n return Samtykke.Basis;\n }\n return Samtykke.Ingen;\n};\n/**\n * Sjekk om bruker har samtykket til bruk av Helsenorge\n * @returns true dersom bruker har samtykket\n */\nexport const hasSamtykke = () => getSamtykke() !== Samtykke.Ingen;\n/**\n * Sjekker etter om bruker har fullt samtykke\n * @returns true dersom bruker har fullt samtykke\n */\nexport const hasFulltSamtykke = () => getSamtykke() == Samtykke.Full;\n/**\n * Sjekker etter om bruker har samtykket til bare basis eller basis+\n * @returns true dersom bruker har samtykket til bare basis eller basis+\n */\nexport const hasBasisOrBasisPlussSamtykke = () => getSamtykke() == Samtykke.Basis || getSamtykke() == Samtykke.BasisPluss;\n/**\n * Sjekk om bruker ikke har samtykket til bruk av Helsenorge\n * @returns true dersom bruker ikke har samtykket\n */\nexport const doesNotHaveSamtykke = () => !hasSamtykke();\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Link } from 'react-router-dom';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronLeft from '@helsenorge/designsystem-react/components/Icons/ChevronLeft';\nimport { useHover } from '@helsenorge/designsystem-react';\nimport { trackNavigation } from '@helsenorge/framework-utils/adobe-analytics';\nimport styles from './styles.module.scss';\nconst Breadcrumb = ({ homeLabel, homeUrl, link, ariaLabel = 'Brødsmulesti' }) => {\n const { hoverRef, isHovered } = useHover();\n if (!homeLabel || !homeUrl) {\n return null;\n }\n const innerContent = (_jsxs(_Fragment, { children: [_jsx(Icon, { svgIcon: ChevronLeft, isHovered: isHovered }), _jsx(\"span\", { className: styles.breadcrumb__label, children: link ? link.name : homeLabel })] }));\n const handleLinkClick = () => trackNavigation('brødsmulesti', link ? link.name : homeLabel, 'brødsmulesti');\n return (_jsxs(_Fragment, { children: [_jsx(\"div\", { className: styles.border }), _jsx(\"div\", { className: 'container', children: _jsx(\"div\", { className: 'row', children: _jsx(\"div\", { className: 'col', children: _jsx(\"nav\", { className: styles.breadcrumb__content, \"aria-label\": ariaLabel, children: link?.renderAsRouterLink ? (_jsx(Link, { ref: hoverRef, className: styles.breadcrumb__link, to: link.url, onClick: handleLinkClick, children: innerContent })) : (_jsx(\"a\", { ref: hoverRef, className: styles.breadcrumb__link, href: link?.url ?? homeUrl, onClick: handleLinkClick, children: innerContent })) }) }) }) }), _jsx(\"div\", { className: styles.border })] }));\n};\nexport default Breadcrumb;\n","/// \nimport { decapitalize } from '@helsenorge/core-utils/string-utils';\nimport { error } from '@helsenorge/framework-utils/logger';\nexport function currentConfiguration() {\n return (window.HN?.Page ?? {});\n}\nexport function resolve(originalKey, resources) {\n const key = decapitalize(originalKey);\n if (Object.prototype.hasOwnProperty.call(resources, key)) {\n return resources[key];\n }\n error(`The key ${key} is missing in HNTjenesterContent`);\n return undefined;\n}\nexport function getCurrentConfiguration() {\n return (window.HN?.Page ?? {});\n}\nexport function getService(resources) {\n const configuration = getCurrentConfiguration();\n if (resources && configuration && configuration.Tjenestemeny) {\n return resolve(configuration.Tjenestemeny, resources);\n }\n return undefined;\n}\nexport function getRedirectToUrlAfterLogin() {\n const configuration = getCurrentConfiguration();\n if (configuration && configuration.RedirectToUrlAfterLogin) {\n return configuration.RedirectToUrlAfterLogin;\n }\n return;\n}\nexport function getDelAvForeldresamtykke() {\n const configuration = getCurrentConfiguration();\n if (configuration && configuration.DelAvForeldresamtykke) {\n return configuration.DelAvForeldresamtykke;\n }\n return undefined;\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport BreadcrumbComponent from '@helsenorge/core-cms/breadcrumb';\nimport { getTjenesterUrl, getHelsenorgeUrl } from '@helsenorge/framework-utils/hn-proxy-service';\nimport { resolve } from '../common/configuration';\nimport styles from './styles.module.scss';\nexport const getBreadcrumbLink = (contentResources, pageConfiguration) => {\n if (contentResources && pageConfiguration?.NavigateBackLinkTitle && pageConfiguration.NavigateBackLinkURL) {\n const name = resolve(pageConfiguration.NavigateBackLinkTitle, contentResources);\n let url = resolve(pageConfiguration.NavigateBackLinkURL, contentResources);\n if (name && url) {\n const helsenorgeUrlPlaceholder = '{HelsenorgeUrl}'; // TODO: Bør kanskje flyttes til utils-funksjon\n if (url.includes(helsenorgeUrlPlaceholder)) {\n url = url.replace(helsenorgeUrlPlaceholder, getHelsenorgeUrl());\n }\n return {\n name: name,\n url: url,\n };\n }\n else {\n return undefined;\n }\n }\n else {\n return undefined;\n }\n};\nconst Breadcrumb = ({ resources, contentResources, link }) => {\n const homeLabel = resources?.breadCrumb_Forsiden;\n const getCmsBreadcrumbLink = () => {\n let name = undefined;\n if (link && link.resourceId && contentResources) {\n name = contentResources[link.resourceId];\n }\n else if (link && link.name) {\n name = link.name;\n }\n return !name\n ? undefined\n : {\n name: name,\n url: link ? link.url : '',\n renderAsRouterLink: link?.renderAsRouterLink,\n };\n };\n return (_jsx(\"div\", { className: styles.breadcrumb, children: _jsx(BreadcrumbComponent, { homeLabel: homeLabel, homeUrl: getTjenesterUrl(), link: getCmsBreadcrumbLink() }) }));\n};\nexport default Breadcrumb;\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport NotificationPanel from '@helsenorge/designsystem-react/components/NotificationPanel';\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport styles from './styles.module.scss';\nconst ErrorMessage = ({ label, labelId, description, correlationId }) => {\n return (_jsxs(NotificationPanel, { role: \"alert\", variant: 'error', label: label, labelId: labelId, children: [description && _jsx(\"p\", { children: description }), correlationId && (_jsxs(_Fragment, { children: [_jsx(Spacer, { size: \"s\" }), _jsx(\"p\", { className: styles.errormessage__correlationid, children: `Id: ${correlationId}` })] }))] }));\n};\nexport default ErrorMessage;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { trackError } from '@helsenorge/framework-utils/adobe-analytics';\nimport { isDebug } from '@helsenorge/framework-utils/hn-debug';\nimport { HelsenorgeProxyError } from '@helsenorge/framework-utils/hn-proxy-service';\nimport { error as logError } from '@helsenorge/framework-utils/logger';\nimport ErrorMessage from '../error-message';\nexport default function withErrorBoundary(COMPONENT) {\n class GuardedComponent extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n error: false,\n };\n }\n componentDidCatch(error) {\n trackError('level3', 'Uhåndtert teknisk feil');\n this.setState({ error: true });\n if (error instanceof HelsenorgeProxyError) {\n this.setState({ correlationId: error.correlationId });\n }\n if (isDebug() || process.env.NODE_ENV !== 'production') {\n this.setState({ name: `${error.name} ${error.message}`, message: error.stack });\n }\n logError('Error in ' + COMPONENT.name + ' component or a child component', error);\n }\n render() {\n if (this.state.error) {\n return (_jsx(ErrorMessage, { label: this.state.name || (this.props.resources && this.props.resources.unknownError), description: this.state.message || (this.props.resources && this.props.resources.unknownErrorAction), correlationId: this.state.correlationId }));\n }\n return _jsx(COMPONENT, { ...this.props });\n }\n }\n return GuardedComponent;\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport withErrorBoundary from './with-error-boundary';\nclass ErrorPanel extends React.Component {\n render() {\n return _jsx(\"div\", { children: this.props.children });\n }\n}\nexport default withErrorBoundary(ErrorPanel);\n","import EmoticonAnnoyed from '@helsenorge/designsystem-react/components/Icons/EmoticonAnnoyed';\nimport EmoticonDelighted from '@helsenorge/designsystem-react/components/Icons/EmoticonDelighted';\nimport EmoticonDisappointed from '@helsenorge/designsystem-react/components/Icons/EmoticonDisappointed';\nimport EmoticonHappy from '@helsenorge/designsystem-react/components/Icons/EmoticonHappy';\nimport EmoticonMeh from '@helsenorge/designsystem-react/components/Icons/EmoticonMeh';\nexport const getIcon = (value) => {\n switch (value) {\n case '5':\n return EmoticonDelighted;\n case '4':\n return EmoticonHappy;\n case '3':\n return EmoticonMeh;\n case '2':\n return EmoticonDisappointed;\n case '1':\n return EmoticonAnnoyed;\n }\n};\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/* eslint-disable jsx-a11y/role-supports-aria-props */\nimport React from 'react';\nimport classNames from 'classnames';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport { theme, useHover } from '@helsenorge/designsystem-react';\nimport { getIcon } from './utils';\nimport styles from './styles.module.scss';\nconst ScoreInput = React.forwardRef(({ label, value, disabled, expanded, selected, ...rest }, ref) => {\n const { hoverRef, isHovered } = useHover();\n const id = `feedback-score-${value}`;\n return (_jsxs(\"label\", { htmlFor: id, className: classNames(styles.scoreinput, selected && styles['scoreinput--selected']), ref: hoverRef, children: [_jsx(\"input\", { type: \"radio\", value: value, disabled: disabled, \"aria-expanded\": expanded, className: styles.scoreinput__radio, id: id, ref: ref, ...rest }), _jsx(Icon, { svgIcon: getIcon(value), color: selected ? theme.palette.white : theme.palette.black, isHovered: isHovered }), _jsx(\"span\", { className: styles.scoreinput__text, children: label })] }));\n});\nScoreInput.displayName = 'ScoreInput';\nexport default ScoreInput;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport PaperPlane from '@helsenorge/designsystem-react/components/Icons/PaperPlane';\nimport styles from './styles.module.scss';\nconst SuccessMessage = ({ children }) => (_jsxs(\"div\", { className: styles.successmessage, children: [_jsx(Icon, { svgIcon: PaperPlane, className: styles.successmessage__icon }), _jsx(\"span\", { \"aria-live\": \"polite\", children: children })] }));\nexport default SuccessMessage;\n","export const scoreValueList = ['1', '2', '3', '4', '5'];\n","import { pushToDataLayer } from '@helsenorge/framework-utils/adobe-analytics';\nexport const trackScore = (score) => {\n const testData = {\n event: 'feedback',\n feedback: {\n name: 'brukertilfredshet: score',\n score: score,\n label: score,\n },\n };\n pushToDataLayer(testData);\n};\nexport const trackComment = () => {\n const testData = {\n event: 'feedback',\n feedback: {\n name: 'brukertilfredshet: tilbakemelding',\n },\n };\n pushToDataLayer(testData);\n};\n","// Removes specific characters from string\nexport const sanitizeValue = (string) => {\n return string\n .replace(//g, '') // script>\n .replace(/(\\\\|\\/)/, ''); // / or \\\n};\n// Remove email address from string\nexport const removeEmail = (string) => {\n return string.replace(/([^.@\\s]+)(\\.[^.@\\s]+)*@([^.@\\s]+\\.)+([^.@\\s]+)/, '*epost*');\n};\n","import { sanitizeValue } from '@helsenorge/core-cms/userfeedback/utils/string';\nimport { post, patch } from '@helsenorge/framework-utils/cms-content-api-service';\nexport const createFeedback = async (body) => post(`usertjenestefeedback`, body);\nexport const updateFeedback = async (body) => {\n const sanitized = { id: body.id, score: body.score, comment: body.comment && sanitizeValue(body.comment) };\n return patch(`usertjenestefeedback`, sanitized);\n};\n","import { useEffect, useState } from 'react';\nimport { debounce } from '@helsenorge/designsystem-react/utils/debounce';\nimport { error as logError } from '@helsenorge/framework-utils/logger';\nimport { trackComment, trackScore } from './analytics';\nimport * as api from './api';\nimport { CHARACTER_LIMIT } from '..';\nexport var FeedbackFormState;\n(function (FeedbackFormState) {\n FeedbackFormState[FeedbackFormState[\"Ready\"] = 0] = \"Ready\";\n FeedbackFormState[FeedbackFormState[\"Submitting\"] = 1] = \"Submitting\";\n FeedbackFormState[FeedbackFormState[\"Success\"] = 2] = \"Success\";\n FeedbackFormState[FeedbackFormState[\"Error\"] = 3] = \"Error\";\n})(FeedbackFormState || (FeedbackFormState = {}));\nexport const useFeedbackForm = (options) => {\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [isSubmitSuccessful, setIsSubmitSuccessful] = useState(false);\n const [id, setId] = useState();\n const [score, setScore] = useState();\n const [comment, setComment] = useState('');\n const [commentError, setCommentError] = useState();\n const [error, setError] = useState();\n const scoreRegister = {\n name: 'score',\n onChange: (changeEvent) => {\n setScore(changeEvent.target.value);\n },\n };\n const commentRegister = {\n name: 'comment',\n onChange: (changeEvent) => {\n setComment(changeEvent.target.value);\n },\n };\n const createFeedback = async (data) => {\n try {\n const createFeedbackResponse = await api.createFeedback(data);\n setId(createFeedbackResponse?.id);\n trackScore(data.score);\n }\n catch (e) {\n setError(options.resources.serverErrorMessage);\n }\n };\n const updateFeedback = async (data) => {\n try {\n if (id) {\n await api.updateFeedback(data);\n if (data.comment) {\n trackComment();\n }\n }\n }\n catch (e) {\n setError(options.resources.serverErrorMessage);\n throw e;\n }\n };\n useEffect(() => {\n if (!score) {\n return;\n }\n const handleUpdate = async () => {\n if (id) {\n updateFeedback({ id, score });\n trackScore(score);\n }\n };\n const [debouncedUpdate, teardown] = debounce(handleUpdate, 1000);\n if (id) {\n debouncedUpdate();\n }\n else {\n createFeedback({ score, url: options.url, pageTitle: options.pageTitle });\n }\n return () => {\n teardown();\n };\n }, [score]);\n const commentIsValid = (comment ?? '').length <= CHARACTER_LIMIT;\n const handleSubmit = async () => {\n if (!commentIsValid) {\n setCommentError(options.resources.commentTooLongErrorMessage);\n }\n else if (!id) {\n logError('Skjema for tilbakemelding fra bruker ble forsøkt sendt inn uten id.');\n }\n else {\n try {\n setIsSubmitting(true);\n await updateFeedback({\n id,\n score: score,\n comment,\n });\n setIsSubmitSuccessful(true);\n }\n catch {\n setIsSubmitSuccessful(false);\n }\n finally {\n setIsSubmitting(false);\n }\n }\n };\n const onSubmit = event => {\n event?.preventDefault();\n handleSubmit();\n };\n const formState = (() => {\n if (isSubmitting) {\n return FeedbackFormState.Submitting;\n }\n if (isSubmitSuccessful) {\n return FeedbackFormState.Success;\n }\n if (error) {\n return FeedbackFormState.Error;\n }\n return FeedbackFormState.Ready;\n })();\n return {\n onSubmit,\n showComment: !!id,\n score: {\n value: score,\n register: scoreRegister,\n },\n comment: {\n value: comment,\n register: commentRegister,\n error: commentError,\n },\n error,\n formState,\n };\n};\n","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Label from '@helsenorge/designsystem-react/components/Label';\nimport NotificationPanel from '@helsenorge/designsystem-react/components/NotificationPanel';\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport TextArea from '@helsenorge/designsystem-react/components/Textarea';\nimport ScoreInput from './score-input';\nimport SuccessMessage from './success-message';\nimport { scoreValueList } from './utils/entities';\nimport { FeedbackFormState, useFeedbackForm } from './utils/form';\nimport styles from './styles.module.scss';\nexport const CHARACTER_LIMIT = 250;\nexport const TEXTAREA_ID = 'textarea-description';\nexport const DESCRIPTION_ID = 'feedback-description';\nconst FeedbackForm = ({ url, pageTitle, resources }) => {\n const { onSubmit, showComment, score, comment, error, formState } = useFeedbackForm({ url, pageTitle, resources });\n if (formState === FeedbackFormState.Success) {\n return _jsx(SuccessMessage, { children: resources.successMessage });\n }\n if (formState === FeedbackFormState.Error) {\n return _jsx(NotificationPanel, { label: error, variant: \"error\", compactVariant: \"basic\", size: \"medium\" });\n }\n const getButtonAriaLabel = (value) => {\n switch (value) {\n case '5':\n return resources.veryPleasedText;\n case '4':\n return resources.slightlyPleasedText;\n case '3':\n return resources.neutralText;\n case '2':\n return resources.slightlyDispleasedText;\n case '1':\n return resources.displeasedText;\n }\n };\n return (_jsxs(\"form\", { onSubmit: onSubmit, children: [_jsxs(\"fieldset\", { className: styles.feedbackform__questionwrapper, children: [_jsx(\"legend\", { className: styles.feedbackform__question, children: resources.questionText }), _jsx(\"div\", { className: styles.feedbackform__scores, children: scoreValueList.map(value => (_jsx(ScoreInput, { label: getButtonAriaLabel(value), value: value, selected: score.value === value, disabled: formState === FeedbackFormState.Submitting, expanded: showComment, ...score.register }, value))) })] }), showComment && (_jsxs(_Fragment, { children: [_jsx(\"div\", { children: _jsx(Label, { htmlFor: TEXTAREA_ID, className: styles.feedbackform__commentlabel, labelTexts: [{ text: resources.commentLabel, type: 'semibold' }, { text: resources.commentSubLabel }] }) }), _jsx(\"div\", { id: DESCRIPTION_ID, className: styles.feedbackform__commentdescription, children: resources.commentDescription }), _jsx(TextArea, { textareaId: TEXTAREA_ID, \"aria-describedby\": DESCRIPTION_ID, maxCharacters: CHARACTER_LIMIT, maxText: resources.maxText, width: 48, disabled: formState === FeedbackFormState.Submitting, errorText: comment.error, ...comment.register }), _jsx(Spacer, { size: \"s\" }), _jsx(Button, { type: \"submit\", disabled: formState === FeedbackFormState.Submitting, className: styles.feedbackform__button, children: resources.submitButtonText })] }))] }));\n};\nconst Feedback = ({ ...props }) => (_jsx(\"div\", { className: styles.feedbackform, children: _jsx(FeedbackForm, { ...props }) }));\nexport default Feedback;\n","import { useDispatch, useSelector } from 'react-redux';\nexport const useAppDispatch = useDispatch.withTypes();\nexport const useAppSelector = useSelector.withTypes();\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect } from 'react';\nimport LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport { fetchTjenesteTekster, selectFeedbackResources } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nimport { getPath } from '@helsenorge/framework-utils/hn-page';\nimport FeedbackForm from '..';\nimport { useAppDispatch, useAppSelector } from '../../store/hooks';\nconst FeedbackContainer = ({ url, pageTitle, tjenesteNavn = getPath(), language = LanguageLocales.NORWEGIAN, }) => {\n const dispatch = useAppDispatch();\n const feedbackResources = useAppSelector(state => selectFeedbackResources(state, tjenesteNavn, language));\n useEffect(() => {\n dispatch(fetchTjenesteTekster(tjenesteNavn, language));\n }, [tjenesteNavn, language]);\n if (!feedbackResources) {\n return null;\n }\n return _jsx(FeedbackForm, { url: url, pageTitle: pageTitle, resources: feedbackResources });\n};\nexport default FeedbackContainer;\n","var __glob = (map) => (path) => {\n var fn = map[path];\n if (fn) return fn();\n throw new Error(\"Module not found in bundle: \" + path);\n};\n\n// src/resources/index.ts\nimport Languages from \"@helsenorge/core-utils/constants/languages\";\nimport Projects from \"@helsenorge/framework-utils/constants/projects\";\nimport { getModifiedResourcesForTest } from \"@helsenorge/framework-utils/resources\";\nimport frameworkNbNo from \"./HN.Core.Framework.NPM.JS.nb-NO.json\";\nimport contentNbNo from \"./HN.Tjenester.Content.nb-NO.json\";\n\n// import(\"./**/*.*.json\") in src/resources/index.ts\nvar globImport_json = __glob({\n \"./HN.Core.Framework.NPM.JS.en-GB.json\": () => import(\"./HN.Core.Framework.NPM.JS.en-GB.json\"),\n \"./HN.Core.Framework.NPM.JS.lt-LT.json\": () => import(\"./HN.Core.Framework.NPM.JS.lt-LT.json\"),\n \"./HN.Core.Framework.NPM.JS.nb-NO.json\": () => import(\"./HN.Core.Framework.NPM.JS.nb-NO.json\"),\n \"./HN.Core.Framework.NPM.JS.nn-NO.json\": () => import(\"./HN.Core.Framework.NPM.JS.nn-NO.json\"),\n \"./HN.Core.Framework.NPM.JS.pl-PL.json\": () => import(\"./HN.Core.Framework.NPM.JS.pl-PL.json\"),\n \"./HN.Core.Framework.NPM.JS.ro-RO.json\": () => import(\"./HN.Core.Framework.NPM.JS.ro-RO.json\"),\n \"./HN.Core.Framework.NPM.JS.ru-RU.json\": () => import(\"./HN.Core.Framework.NPM.JS.ru-RU.json\"),\n \"./HN.Core.Framework.NPM.JS.se-NO.json\": () => import(\"./HN.Core.Framework.NPM.JS.se-NO.json\"),\n \"./HN.CoreFrontend.NPM.Packages.CMS.nb-NO.json\": () => import(\"./HN.CoreFrontend.NPM.Packages.CMS.nb-NO.json\"),\n \"./HN.CoreFrontend.NPM.Packages.Framework.nb-NO.json\": () => import(\"./HN.CoreFrontend.NPM.Packages.Framework.nb-NO.json\"),\n \"./HN.CoreFrontend.Web.Forside.nb-NO.json\": () => import(\"./HN.CoreFrontend.Web.Forside.nb-NO.json\"),\n \"./HN.MinHelse.Common.JS.en-GB.json\": () => import(\"./HN.MinHelse.Common.JS.en-GB.json\"),\n \"./HN.MinHelse.Common.JS.lt-LT.json\": () => import(\"./HN.MinHelse.Common.JS.lt-LT.json\"),\n \"./HN.MinHelse.Common.JS.nb-NO.json\": () => import(\"./HN.MinHelse.Common.JS.nb-NO.json\"),\n \"./HN.MinHelse.Common.JS.nn-NO.json\": () => import(\"./HN.MinHelse.Common.JS.nn-NO.json\"),\n \"./HN.MinHelse.Common.JS.pl-PL.json\": () => import(\"./HN.MinHelse.Common.JS.pl-PL.json\"),\n \"./HN.MinHelse.Common.JS.ro-RO.json\": () => import(\"./HN.MinHelse.Common.JS.ro-RO.json\"),\n \"./HN.MinHelse.Common.JS.ru-RU.json\": () => import(\"./HN.MinHelse.Common.JS.ru-RU.json\"),\n \"./HN.MinHelse.Common.JS.se-NO.json\": () => import(\"./HN.MinHelse.Common.JS.se-NO.json\"),\n \"./HN.MinHelse.Content.en-GB.json\": () => import(\"./HN.MinHelse.Content.en-GB.json\"),\n \"./HN.MinHelse.Content.nb-NO.json\": () => import(\"./HN.MinHelse.Content.nb-NO.json\"),\n \"./HN.MinHelse.Content.nn-NO.json\": () => import(\"./HN.MinHelse.Content.nn-NO.json\"),\n \"./HN.MinHelse.Content.se-NO.json\": () => import(\"./HN.MinHelse.Content.se-NO.json\"),\n \"./HN.Tjenester.Content.en-GB.json\": () => import(\"./HN.Tjenester.Content.en-GB.json\"),\n \"./HN.Tjenester.Content.nb-NO.json\": () => import(\"./HN.Tjenester.Content.nb-NO.json\"),\n \"./HN.Tjenester.Content.nn-NO.json\": () => import(\"./HN.Tjenester.Content.nn-NO.json\"),\n \"./HN.Tjenester.Content.se-NO.json\": () => import(\"./HN.Tjenester.Content.se-NO.json\")\n});\n\n// src/resources/index.ts\nvar getResourceItem = (projectName, language) => {\n if (projectName === Projects.FRAMEWORK) {\n if (language === Languages.NORWEGIAN) {\n return frameworkNbNo;\n }\n }\n if (projectName === Projects.CONTENT) {\n if (language === Languages.NORWEGIAN) {\n return contentNbNo;\n }\n }\n};\nvar getResources = (projectName, language) => {\n const resources = getResourceItem(projectName, language);\n if (resources) {\n return Promise.resolve(resources);\n }\n return globImport_json(`./${projectName}.${language}.json`);\n};\nvar getResourcesTestHelper = (projectName, language) => {\n const resources = getResourceItem(projectName, language);\n if (resources) {\n return getModifiedResourcesForTest(resources);\n }\n throw new Error(`Mangler ressurs ${projectName}.${language}`);\n};\nexport {\n getResources,\n getResourcesTestHelper\n};\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useState } from 'react';\nimport classNames from 'classnames';\nimport Icon, { IconSize } from '@helsenorge/designsystem-react/components/Icon';\nimport Globe from '@helsenorge/designsystem-react/components/Icons/Globe';\nimport { theme } from '@helsenorge/designsystem-react';\nimport { trackLanguage } from '@helsenorge/framework-utils/adobe-analytics';\nimport Projects from '@helsenorge/framework-utils/constants/projects';\nimport { setUserLanguage } from '@helsenorge/framework-utils/hn-language';\nimport { getResources } from '../resources';\nimport styles from './styles.module.scss';\nexport const LanguagePicker = ({ languages, selectedLanguage, changeLanguage, className, testId }) => {\n const [languageChangedMessage, setLanguageChangedMessage] = useState();\n const handleLanguageChange = async ({ label, locale }) => {\n try {\n const resources = await getResources(Projects.FRAMEWORK, locale);\n setLanguageChangedMessage(resources['languageChanged']);\n }\n catch (e) {\n setLanguageChangedMessage(`Language changed to ${label}`);\n }\n trackLanguage(locale);\n setUserLanguage(locale);\n changeLanguage && changeLanguage(locale);\n };\n if (languages.length <= 0)\n return null;\n const currentLanguage = languages.find(l => l.locale === selectedLanguage);\n return (_jsxs(\"nav\", { className: classNames(styles['language-picker'], className), \"aria-label\": currentLanguage?.ariaLabel ?? 'Språkvalg', children: [_jsx(Icon, { className: styles['language-picker__icon'], size: IconSize.XSmall, svgIcon: Globe, color: theme.palette.blueberry700 }), _jsx(\"span\", { className: styles['language-picker__message'], \"aria-live\": \"polite\", children: languageChangedMessage }), _jsx(\"ul\", { className: styles['language-picker__list'], children: languages.map((language, index) => (_jsx(\"li\", { className: styles['language-picker__item'], \"data-testid\": testId && `${testId}-${language.locale}`, children: selectedLanguage === language.locale ? (language.label) : (_jsx(\"button\", { className: styles['language-picker__button'], type: \"button\", value: language.locale, onClick: () => handleLanguageChange(language), children: language.label })) }, index))) })] }));\n};\nexport default LanguagePicker;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport LanguagePicker from '../language-picker';\nimport styles from './styles.module.scss';\nexport const LanguagePickerWrapper = ({ selectedLanguage, languageConfig, }) => {\n // selectedLanguage må enten settes som egen prop, eller i languageConfig\n const language = selectedLanguage || languageConfig.selectedLanguage;\n if (!language) {\n return null;\n }\n return (_jsx(\"div\", { className: styles['language-picker-wrapper'], children: _jsx(\"div\", { className: \"container\", children: _jsx(\"div\", { className: \"row\", children: _jsx(\"div\", { className: \"col-12 col-lg-10\", children: _jsx(LanguagePicker, { selectedLanguage: language, ...languageConfig }) }) }) }) }));\n};\nexport default LanguagePickerWrapper;\n","import { getHelsenorgeUrl, getTjenesterUrl } from '../../hn-proxy-service';\n/**\n * Replaces \"{tjenesterUrl}\" and \"{helsenorgeUrl}\" with url according to environment.\n * @param url text that may include {tjenesterUrl} or {helsenorgeUrl}.\n */\nexport const envSafeUrl = (url) => {\n return url\n .replace(/{tjenesterUrl}/g, getTjenesterUrl())\n .replace(/{helsenorgeUrl}/g, getHelsenorgeUrl())\n .replace(/tjenesterUrl/g, getTjenesterUrl())\n .replace(/helsenorgeUrl/g, getHelsenorgeUrl());\n};\n","import DOMPurify from 'dompurify';\nimport getFeatureToggle from './hn-feature-toggle';\nexport const TRUSTED_TYPES_FEATURE_NAME = 'TrustedTypes';\nconst hasDefaultTrustedTypesPolicy = () => !!window.trustedTypes?.defaultPolicy;\n/**\n * Sjekk om det finnes en default policy for trusted types og om Trusted Types er togglet på.\n *\n * @returns true dersom Trusted Types skal enables\n */\nexport const isTrustedTypesEnabled = () => hasDefaultTrustedTypesPolicy() && getFeatureToggle(TRUSTED_TYPES_FEATURE_NAME);\nconst DefaultSanitizeConfig = {\n ADD_ATTR: ['target'],\n};\n/**\n * Sanitize html før den vises til bruker. Returnerer Trusted Types dersom dette er i bruk.\n *\n * @param html string med HTML som skal sanitizes\n * @returns sanitized HTML\n */\nexport const sanitize = (html) => {\n if (DOMPurify && typeof DOMPurify.sanitize === 'function') {\n return DOMPurify.sanitize(html ?? '', { ...DefaultSanitizeConfig, RETURN_TRUSTED_TYPE: isTrustedTypesEnabled() });\n }\n return '';\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport classNames from 'classnames';\nimport Markdown from 'markdown-to-jsx';\nimport AnchorLink from '@helsenorge/designsystem-react/components/AnchorLink';\nimport List from '@helsenorge/designsystem-react/components/List';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport { envSafeUrl } from './safe-html';\nimport { sanitize } from '../../trusted-types';\nimport styles from './styles.module.scss';\nconst SafeHTML = ({ html, tagName, testId, className, ...rest }) => {\n if (!html) {\n return null;\n }\n if (typeof html === 'string') {\n const CustomTag = tagName || 'span';\n return (_jsx(CustomTag, { className: classNames(designsystemtypography['anchorlink-wrapper'], styles['safe-html'], className), \"data-testid\": testId, dangerouslySetInnerHTML: { __html: sanitize(envSafeUrl(html)) }, ...rest }));\n }\n else {\n if (!html?.value) {\n return null;\n }\n const CustomTag = tagName || 'div';\n return (_jsx(CustomTag, { className: classNames(styles['safe-html'], className), \"data-testid\": testId, children: _jsx(Markdown, { options: {\n wrapper: React.Fragment,\n overrides: {\n h2: {\n component: Title,\n props: {\n htmlMarkup: 'h2',\n appearance: 'title2',\n },\n },\n h3: {\n component: Title,\n props: {\n htmlMarkup: 'h3',\n appearance: 'title3',\n },\n },\n h4: {\n component: Title,\n props: {\n htmlMarkup: 'h4',\n appearance: 'title4',\n },\n },\n h5: {\n component: Title,\n props: {\n htmlMarkup: 'h5',\n appearance: 'title5',\n },\n },\n a: {\n component: AnchorLink,\n },\n ul: {\n component: List,\n props: {\n variant: 'bullet',\n },\n },\n ol: {\n component: List,\n props: {\n variant: 'numbered',\n },\n },\n li: {\n component: List.Item,\n },\n },\n }, children: envSafeUrl(html.value) }) }));\n }\n};\nexport default SafeHTML;\n","/*\n * aria hidden\n * ----------------\n * Traverse dom upwards and set aria-hidden on all siblings.\n * Used on modals to hide all other content from screen readers when modal\n * is placed within wrappers in dom, and we are unable to set aria-hidden on the rest\n * of the page.\n *\n * Example:\n *
\n *
\n *

Page title

\n *
\n *
\n *\n *
\n *
\n *\n * Here we are unable to set aria-hidden on article as it would also hide the modal.\n * The script then traverses the dom upwards and set aria-hidden on all siblings of parent element\n * until it reaches the body element.\n *\n */\nexport default {\n setAriaHidden(domEl) {\n // Set aria hidden on siblings\n const siblings = this._getSiblings(domEl);\n for (let i = 0; i < siblings.allSiblings.length; i++) {\n siblings.allSiblings[i].setAttribute('aria-hidden', 'true');\n }\n // Return siblings so aria-hiddens can be restored later\n return siblings;\n },\n resetAriaHidden(siblings) {\n if (siblings) {\n siblings.allSiblings.forEach(sibling => {\n sibling.removeAttribute('aria-hidden');\n });\n siblings.ariaHiddens.forEach(sibling => {\n siblings.allSiblings[sibling.elIndex].setAttribute('aria-hidden', sibling.val);\n });\n return siblings;\n }\n },\n _getSiblings(domEl) {\n // Get siblings\n const siblings = { allSiblings: [], ariaHiddens: [] };\n let x = 0;\n while (domEl && domEl !== document.body) {\n if (domEl.parentElement) {\n for (let i = 0; i < domEl.parentElement.children.length; i++) {\n const child = domEl.parentElement.children[i];\n if (child.nodeType === 1 && child !== domEl) {\n // If element already has aria set, store it for later\n if (child.hasAttribute('aria-hidden')) {\n const value = child.getAttribute('aria-hidden');\n if (value) {\n siblings.ariaHiddens.push({ elIndex: x, val: value.toString() });\n }\n }\n siblings.allSiblings.push(child);\n x++;\n }\n }\n }\n domEl = domEl.parentElement;\n }\n return siblings;\n },\n};\n","export default {\n DOWN: 40,\n ESC: 27,\n ENTER: 13,\n LEFT: 37,\n RIGHT: 39,\n SPACE: 32,\n TAB: 9,\n UP: 38,\n};\n","/* This is a util to get the event target, wether it comes from the lightDOM or shadowDOM - this requires the Shadow DOM to be of type 'open' */\nexport const getEventTarget = (e) => e.composedPath()[0];\n","const allowConsoleOutput = () => !['production', 'test'].includes(process.env.NODE_ENV ?? '');\nconst log = (message, ...optionalParams) => {\n if (!allowConsoleOutput())\n return;\n // eslint-disable-next-line no-console\n console.log(message, optionalParams);\n};\n/**\n * Returnerer document.activeElement (element in focus), uavhengig av om den er i document-dom rllrt shadow-dom\n * @param element HtmlElement som den skal søke i\n * @param logCallback Funksjon som om det oppstår en feil. Brukes for å logge til server.\n */\nexport const getDocumentActiveElement = (element, logCallback) => {\n try {\n const domNode = typeof element === 'string' ? document.querySelector(element) : element;\n const root = domNode?.getRootNode();\n return root?.activeElement;\n }\n catch (e) {\n const logger = logCallback ?? log;\n logger('Feil ved å ta tak i active element basert på angitt node: ', element, e);\n return null;\n }\n};\n","import { tabbable } from 'tabbable';\nimport keyCode from './constants/key-code';\nimport { getEventTarget } from './events';\nimport { getDocumentActiveElement } from './focus-utils';\n/**\n * Class som ved init låser fokuset inne i én DOMElement. Bruksområder er f.eks Modalvinduer.\n * Tar imot en DomNode (HTMLElement eller string) som fokuset skal låses i.\n * @deprecated Bruk useFocusTrap-hook fra @helsenorge/designsystem-react i stedet\n */\nexport class TrapFocus {\n constructor(domNode, isTriggerWithinTrappedArea = false) {\n Object.defineProperty(this, \"domNode\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"previouslyFocusedItem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"focusableItems\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.domNode = typeof domNode === 'string' ? document.querySelector(domNode) : domNode;\n const activeElement = getDocumentActiveElement(domNode);\n this.previouslyFocusedItem = activeElement ? activeElement : document.activeElement;\n // Get focusable elements\n this.updateFocusableItems();\n // Set focus to element to be able to listen for keypress\n if (!isTriggerWithinTrappedArea && this.focusableItems.length) {\n this.focusableItems[0].focus();\n }\n window.addEventListener('keydown', this, false);\n }\n deactivate() {\n window.removeEventListener('keydown', this, false);\n this.focusableItems = [];\n this.domNode = null;\n if (this.previouslyFocusedItem && this.previouslyFocusedItem.focus) {\n this.previouslyFocusedItem.focus();\n }\n }\n handleEvent(e) {\n if (e.keyCode !== keyCode.TAB) {\n return null;\n }\n e.stopPropagation();\n e.preventDefault();\n const target = getEventTarget(e);\n this.updateFocusableItems();\n const currentFocusIndex = this.getItemIndex(target);\n // When the element focused is not in list, sets focus on the first focusable element of the list\n if (currentFocusIndex === -1) {\n if (this.focusableItems.length > 0 && this.focusableItems[0]) {\n this.focusableItems[0].focus();\n }\n return null;\n }\n if (e.shiftKey) {\n this.previousFocusableItem(target).focus();\n }\n else {\n this.nextFocusableItem(target).focus();\n }\n return null;\n }\n updateFocusableItems() {\n if (this.domNode) {\n this.focusableItems = tabbable(this.domNode);\n }\n }\n previousFocusableRadioButton(itemWithFocus) {\n const currentFocusIndex = this.getItemIndex(itemWithFocus);\n // Previous focusable item should not be a radio button in same group\n for (let i = currentFocusIndex; i >= 0; i--) {\n const previousElement = this.focusableItems[i];\n if (!this.isRadioButton(previousElement)) {\n return previousElement;\n }\n // Element is a radio button, but not in same group\n if (previousElement.name !== itemWithFocus.name) {\n return this.getSelectedRadioInGroup(previousElement);\n }\n }\n // All the previous items are in the same radio group, start from end\n for (let i = this.focusableItems.length - 1; i > currentFocusIndex; i--) {\n const previousElement = this.focusableItems[i];\n if (!this.isRadioButton(previousElement)) {\n return previousElement;\n }\n // Element is a radio button, but not in same group\n if (previousElement.name !== itemWithFocus.name) {\n return this.getSelectedRadioInGroup(previousElement);\n }\n }\n // Still no element found: we have only radio buttons in the same group\n return this.getSelectedRadioInGroup(itemWithFocus);\n }\n previousFocusableItem(itemWithFocus) {\n const currentFocusIndex = this.getItemIndex(itemWithFocus);\n if (!this.isRadioButton(itemWithFocus)) {\n let previousFocusIndex = currentFocusIndex - 1;\n // Wrap around\n if (previousFocusIndex < 0) {\n previousFocusIndex = this.focusableItems.length - 1;\n }\n return this.getSelectedRadioInGroup(this.focusableItems[previousFocusIndex]);\n }\n return this.previousFocusableRadioButton(itemWithFocus);\n }\n nextFocusableRadioButton(itemWithFocus) {\n const currentFocusIndex = this.getItemIndex(itemWithFocus);\n // Next focusable item should not be a radio button in same group\n for (let i = currentFocusIndex + 1; i < this.focusableItems.length; i++) {\n const nextElement = this.focusableItems[i];\n if (!this.isRadioButton(nextElement)) {\n return nextElement;\n }\n // Element is a radio button, but not in same group\n if (nextElement.name !== itemWithFocus.name) {\n return this.getSelectedRadioInGroup(nextElement);\n }\n }\n // All the next items are in the same radio group, start from beginning\n for (let i = 0; i < currentFocusIndex; i++) {\n const nextElement = this.focusableItems[i];\n if (!this.isRadioButton(nextElement)) {\n return nextElement;\n }\n // Element is a radio button, but not in same group\n if (nextElement.name !== itemWithFocus.name) {\n return this.getSelectedRadioInGroup(nextElement);\n }\n }\n // Still no element found: we have only radio buttons in the same group\n return this.getSelectedRadioInGroup(itemWithFocus);\n }\n nextFocusableItem(itemWithFocus) {\n const currentFocusIndex = this.getItemIndex(itemWithFocus);\n if (!this.isRadioButton(itemWithFocus)) {\n let nextFocusIndex = currentFocusIndex + 1;\n // Wrap around\n if (nextFocusIndex > this.focusableItems.length - 1) {\n nextFocusIndex = 0;\n }\n return this.getSelectedRadioInGroup(this.focusableItems[nextFocusIndex]);\n }\n return this.nextFocusableRadioButton(itemWithFocus);\n }\n // If user tabbed into a radio group, we need to focus the selected radio button in the group\n getSelectedRadioInGroup(item) {\n if (!this.isRadioButton(item)) {\n return item;\n }\n const currentFocusIndex = this.getItemIndex(item);\n const radioGrouItems = [];\n let i;\n for (i = currentFocusIndex; i < this.focusableItems.length; i++) {\n if (this.focusableItems[i].name === item.name) {\n radioGrouItems.push(this.focusableItems[i]);\n }\n else {\n break; // Element is not in radio group, no need to continue loop\n }\n }\n for (i = currentFocusIndex - 1; i >= 0; i--) {\n if (this.focusableItems[i].name === item.name) {\n radioGrouItems.push(this.focusableItems[i]);\n }\n else {\n break; // Element is not in radio group, no need to continue loop\n }\n }\n const selectedItems = radioGrouItems.filter(i => i.checked);\n if (selectedItems.length === 0) {\n return item; // No element in this group is selected\n }\n return selectedItems[0];\n }\n getItemIndex(item) {\n return this.focusableItems.indexOf(item);\n }\n isRadioButton(element) {\n return element.type === 'radio';\n }\n}\nexport default TrapFocus;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport Expander from '@helsenorge/designsystem-react/components/Expander';\nimport { PortableText } from '../../richtext';\nconst EkspanderendeTekstBlock = ({ title, mainContent, }) => {\n if (title.length === 0 || mainContent.length === 0) {\n return null;\n }\n return (_jsx(Expander, { title: title, noNestedLine: true, renderChildrenWhenClosed: true, children: _jsx(PortableText, { value: mainContent }) }));\n};\nexport default EkspanderendeTekstBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport EkspanderendeBlockComponent from '../../../behandlingsvalg/ekspanderendeblock';\nconst EkspanderendeBlock = ({ value }) => (_jsx(EkspanderendeBlockComponent, { title: value.title, mainContent: value.mainContent }));\nexport default EkspanderendeBlock;\n","export var PromoBlockType;\n(function (PromoBlockType) {\n PromoBlockType[\"promoboard\"] = \"promoboard\";\n PromoBlockType[\"diveboard\"] = \"diveboard\";\n})(PromoBlockType || (PromoBlockType = {}));\nexport var PromoBlockColors;\n(function (PromoBlockColors) {\n PromoBlockColors[\"blueberry50\"] = \"blueberry50\";\n PromoBlockColors[\"blueberry500\"] = \"blueberry500\";\n PromoBlockColors[\"cherry50\"] = \"cherry50\";\n PromoBlockColors[\"cherry500\"] = \"cherry500\";\n PromoBlockColors[\"neutral50\"] = \"neutral50\";\n PromoBlockColors[\"neutral700\"] = \"neutral700\";\n})(PromoBlockColors || (PromoBlockColors = {}));\nexport var ImageType;\n(function (ImageType) {\n ImageType[\"illustration\"] = \"illustration\";\n ImageType[\"photo\"] = \"photo\";\n})(ImageType || (ImageType = {}));\n// search\nexport var WindowActionEnum;\n(function (WindowActionEnum) {\n WindowActionEnum[WindowActionEnum[\"None\"] = 0] = \"None\";\n WindowActionEnum[WindowActionEnum[\"RefreshPage\"] = 1] = \"RefreshPage\";\n})(WindowActionEnum || (WindowActionEnum = {}));\nexport var Size;\n(function (Size) {\n Size[\"Small\"] = \"Small\";\n Size[\"Medium\"] = \"Medium\";\n Size[\"Large\"] = \"Large\";\n})(Size || (Size = {}));\nexport var VideoType;\n(function (VideoType) {\n VideoType[VideoType[\"notSupported\"] = 0] = \"notSupported\";\n VideoType[VideoType[\"youtube\"] = 1] = \"youtube\";\n VideoType[VideoType[\"vimeo\"] = 2] = \"vimeo\";\n VideoType[VideoType[\"vimeoShowcase\"] = 3] = \"vimeoShowcase\";\n})(VideoType || (VideoType = {}));\n// Setter antall cards per bootstrap rad (eks: four = 12/4)\nexport var CardsPerRow;\n(function (CardsPerRow) {\n CardsPerRow[CardsPerRow[\"four\"] = 3] = \"four\";\n CardsPerRow[CardsPerRow[\"three\"] = 4] = \"three\";\n CardsPerRow[CardsPerRow[\"two\"] = 6] = \"two\";\n CardsPerRow[CardsPerRow[\"one\"] = 12] = \"one\";\n})(CardsPerRow || (CardsPerRow = {}));\n// Setter fargetema for videokort\nexport var VideoTheme;\n(function (VideoTheme) {\n VideoTheme[\"neutral\"] = \"neutral\";\n VideoTheme[\"cherry\"] = \"cherry\";\n VideoTheme[\"blueberry\"] = \"blueberry\";\n})(VideoTheme || (VideoTheme = {}));\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport classNames from 'classnames';\nimport { Size } from '../types/entities';\nimport typography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport cmsstyles from './styles.module.scss';\nconst Image = ({ imageUrl, caption, copyright, size = Size.Large, alternativeText, }) => {\n const figureClass = 'row no-gutters';\n let imageClass = 'col-12 align-self-start';\n let captionClass = 'col-12';\n if (size === Size.Small) {\n imageClass = 'col-12 col-md-10 offset-md-1 col-lg-5 offset-lg-2 align-self-start';\n captionClass = classNames(typography['image-caption'], 'col-12 col-md-10 offset-md-1 col-lg-3 offset-lg-0 pl-lg-4');\n }\n else if (size === Size.Large) {\n captionClass = classNames(typography['image-caption'], 'col-12 col-lg-8');\n }\n else if (size === Size.Medium) {\n imageClass = 'col-12 col-md-10 offset-md-1 col-lg-8 offset-lg-2';\n captionClass = classNames(typography['image-caption'], 'col-12 col-md-10 offset-md-1 col-lg-8 offset-lg-2 ');\n }\n return (_jsxs(\"figure\", { className: figureClass, children: [_jsx(\"img\", { src: imageUrl, alt: alternativeText, className: imageClass }), _jsxs(\"figcaption\", { className: captionClass, children: [_jsx(\"p\", { className: classNames(cmsstyles.image, size === Size.Small && cmsstyles['image--small']), children: caption }), _jsx(\"p\", { className: classNames(typography['image-credit'], cmsstyles['image__copyright']), children: copyright })] })] }));\n};\nexport default Image;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport ImageBlockComponent from '../../../image';\nconst ImageBlock = ({ value }) => (_jsx(ImageBlockComponent, { imageUrl: value.imageUrl, caption: value.caption, copyright: value.copyright, size: value.size, alternativeText: value.alternativeText }));\nexport default ImageBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport AnchorLink from '@helsenorge/designsystem-react/components/AnchorLink';\nconst Link = ({ value, children }) => value ? (_jsx(AnchorLink, { href: value.href, target: value.target, children: children })) : null;\nexport default Link;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport LazyIcon from '@helsenorge/designsystem-react/components/LazyIcon';\nimport LinkList from '@helsenorge/designsystem-react/components/LinkList';\nconst CmsLinkList = ({ color, links, chevron = false, size, className }) => (_jsx(LinkList, { color: color, chevron: chevron, size: size, className: className, children: links.map(({ href, text, iconName, target, title }, index) => (_jsx(LinkList.Link, { href: href, icon: iconName ? _jsx(LazyIcon, { iconName: iconName }) : undefined, target: target ? target : undefined, title: title ? title : undefined, children: text }, index))) }));\nexport default CmsLinkList;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport cn from 'classnames';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport LinkList from './linklist';\nimport styles from './styles.module.scss';\nconst LinkListBlock = ({ links, title, titleHtmlMarkup = 'h2', additionalLinkList, color = 'neutral', useGridLayout = false, children, }) => {\n const contentClassName = cn(styles['linklistblock__content'], {\n [styles['linklistblock__content--neutral']]: color === 'neutral',\n [styles['linklistblock__content--cherry']]: color === 'cherry',\n [styles['linklistblock__content--blueberry']]: color === 'blueberry',\n [styles['linklistblock__content--grid']]: useGridLayout,\n });\n return (_jsx(\"div\", { className: styles['linklistblock'], children: _jsxs(\"div\", { className: contentClassName, children: [title && (_jsx(Title, { htmlMarkup: titleHtmlMarkup, appearance: \"title3\", margin: { marginTop: 0, marginBottom: 1 }, children: title })), children, _jsx(LinkList, { color: color, links: links, chevron: true }), additionalLinkList && (_jsx(LinkList, { links: additionalLinkList, color: color, chevron: false, size: \"small\", className: styles['linklistblock__additional-link-list'] }))] }) }));\n};\nexport default LinkListBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\n/* eslint-disable react/prop-types */\nimport { useContext } from 'react';\nimport { PortableTextContext } from '../..';\nimport LinkListBlockComponent from '../../../linklistblock';\nconst LinkListBlock = ({ value }) => {\n const backgroundColor = useContext(PortableTextContext)?.backgroundColor;\n return (_jsx(LinkListBlockComponent, { links: value.links, title: value.title, titleHtmlMarkup: value.titleHtmlMarkup, additionalLinkList: value.additionalLinkList, color: backgroundColor ? backgroundColor : value.color, useGridLayout: value.useGridLayout }));\n};\nexport default LinkListBlock;\n","import { getUrlHostname } from '@helsenorge/core-utils/url';\nimport { isAndroid, isAppleMobileDevice } from '@helsenorge/core-utils/user-agents-utils';\nimport { getAssetsUrl } from './hn-page';\nimport { getTjenesterUrl } from './hn-proxy-service';\n/**\n * Sjekk om URL peker til et helsenorge-domene\n * @param url En gyldig URL, f.eks. https://www.helsenorge.no/sykdom/\n * @returns returnerer true dersom domene er tjenester.helsenorge.no eller www.helsenorge.no\n */\nexport const isHelsenorgeUrl = (url) => {\n const hostname = getUrlHostname(url);\n return !!hostname && ['tjenester.helsenorge.no', 'www.helsenorge.no'].includes(hostname);\n};\nexport const getAppUrl = () => {\n if (isAndroid()) {\n return getAssetsUrl() + '/core/app-login/android.html';\n }\n else if (isAppleMobileDevice()) {\n return getAssetsUrl() + '/core/app-login/apple.html';\n }\n else {\n return undefined;\n }\n};\nexport const getSigninAppUrl = () => {\n const appUrl = getAppUrl();\n if (appUrl) {\n const urlSearch = new URL(window.location.href).search;\n return `${getAppUrl()}${urlSearch}`;\n }\n return undefined;\n};\nexport const getSigninTjenesteUrl = () => {\n const currentUrl = new URL(window.location.href);\n const tjenesteParam = currentUrl.searchParams.get('tjeneste') || '';\n const sourceUrl = `${getTjenesterUrl()}/${tjenesteParam}`;\n const signinUrl = new URL(`${getTjenesterUrl()}/auth/signin`);\n signinUrl.searchParams.set('Source', sourceUrl);\n return signinUrl.toString();\n};\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React from 'react';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport LazyIcon from '@helsenorge/designsystem-react/components/LazyIcon';\nimport { getAppUrl } from '@helsenorge/framework-utils/url';\nimport { HNeventShowAppInvitation } from '@helsenorge/framework-utils/web-component/events';\nconst LoginButton = ({ htmlMarkup, href, icon, rightSideIcon, children, ...rest }) => {\n const [appUrl, setAppUrl] = React.useState(undefined);\n const buttonRef = React.useRef(null);\n React.useEffect(() => {\n setAppUrl(getAppUrl());\n }, []);\n const triggerOriginalBehaviour = (e) => {\n rest.onClick && rest.onClick(e);\n if (href)\n window.location.href = href;\n };\n const useAppUrl = (appUrl) => {\n const url = new URL(href ? href : '');\n window.location.href = `${appUrl}?tjeneste=${url.pathname}${url.search}`;\n };\n const mobileOnClick = (e) => {\n if (appUrl) {\n e?.preventDefault();\n HNeventShowAppInvitation(() => {\n useAppUrl(appUrl);\n }, () => {\n triggerOriginalBehaviour();\n }, () => {\n buttonRef.current?.focus();\n });\n }\n };\n return (_jsxs(Button, { ...rest, href: appUrl ? undefined : href, onClick: appUrl ? mobileOnClick : rest.onClick, htmlMarkup: appUrl ? 'button' : htmlMarkup, ref: buttonRef, children: [!!icon && _jsx(LazyIcon, { iconName: icon }), children, !!rightSideIcon && _jsx(Icon, { svgIcon: rightSideIcon })] }));\n};\nLoginButton.defaultProps = {\n size: 'medium',\n concept: 'normal',\n href: '#',\n htmlMarkup: 'button',\n fluid: false,\n};\nexport default LoginButton;\n","import { theme } from '@helsenorge/designsystem-react';\nexport const getIconColor = (name) => {\n if (name === 'black') {\n return theme.palette.black;\n }\n else if (name === 'white') {\n return theme.palette.white;\n }\n else if (name === 'plum') {\n return theme.palette.plum600;\n }\n else if (name === 'neutral') {\n return theme.palette.neutral600;\n }\n else if (name === 'kiwi') {\n return theme.palette.kiwi600;\n }\n else if (name === 'cherry') {\n return theme.palette.cherry600;\n }\n else if (name === 'blueberry') {\n return theme.palette.blueberry600;\n }\n else if (name === 'banana') {\n return theme.palette.banana600;\n }\n return theme.palette.black;\n};\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport bindClassNames from 'classnames/bind';\nimport Icon, { IconSize } from '@helsenorge/designsystem-react/components/Icon';\nimport ArrowRight from '@helsenorge/designsystem-react/components/Icons/ArrowRight';\nimport LazyIcon from '@helsenorge/designsystem-react/components/LazyIcon';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport { useHover } from '@helsenorge/designsystem-react';\nimport { getIconColor } from '../shared/getIconColor';\nimport styles from './styles.module.scss';\nconst classNames = bindClassNames.bind(styles);\nconst Panel = ({ url, icon, emphasize, title, linkTitle, intro, colorName = 'neutral', children, linkTarget = '_self', className, large, }) => {\n const { hoverRef, isHovered } = useHover();\n const iconComponent = icon &&\n (large ? (_jsxs(_Fragment, { children: [_jsx(LazyIcon, { iconName: icon, size: IconSize.Medium, isHovered: isHovered, className: \"d-lg-none\" }), _jsx(LazyIcon, { iconName: icon, size: IconSize.Large, isHovered: isHovered, className: \"d-none d-lg-inline\" })] })) : (_jsx(LazyIcon, { iconName: icon, size: IconSize.Medium, isHovered: isHovered })));\n const iconOrEmphasisComponent = (icon || emphasize) && (_jsx(\"span\", { className: classNames('col-6', 'col-md-2', {\n 'pl-lg-7': icon && large && !emphasize,\n 'panel__emphasize pr-md-3': !icon && emphasize,\n }), children: icon ? iconComponent : emphasize }));\n const spacingClassNames = classNames(className, 'px-5', 'pt-5', 'pt-md-6', 'pb-7', 'pb-md-8', 'my-7', 'my-lg-8', `panel--${colorName}`, {\n 'pt-lg-5': large && iconOrEmphasisComponent,\n });\n const titleComponent = (_jsxs(Title, { htmlMarkup: \"h2\", appearance: \"title3\", className: classNames('my-0', 'row', 'no-gutters', 'align-items-center', {\n 'align-items-md-baseline': !icon && emphasize,\n }), children: [iconOrEmphasisComponent, url && (_jsx(\"span\", { className: classNames(styles.panel__arrow, 'align-self-md-baseline', {\n 'col-6 col-md-2 order-md-3': iconOrEmphasisComponent,\n 'col-2 order-3': !iconOrEmphasisComponent,\n }), children: _jsx(Icon, { size: IconSize.XSmall, svgIcon: ArrowRight, color: getIconColor('blueberry'), isHovered: isHovered }) })), _jsx(\"span\", { className: classNames({\n 'col-md-8 mt-5 mt-md-0': iconOrEmphasisComponent,\n 'col-10': !iconOrEmphasisComponent,\n }), children: title })] }));\n const renderSection = (_jsxs(\"div\", { className: classNames({\n [spacingClassNames]: !url,\n }), children: [title && titleComponent, (intro || children) && (_jsx(\"div\", { className: \"row no-gutters\", children: _jsxs(\"div\", { className: classNames('mt-3', 'mt-md-5', 'mb-0', {\n 'col-md-8 offset-md-2': icon || emphasize,\n 'col-md-10': !icon && !emphasize,\n }), children: [intro, children] }) }))] }));\n if (!url) {\n return renderSection;\n }\n const linkClassNames = classNames(styles.panel__link, `panel__link--${colorName}`);\n return (_jsx(\"a\", { href: url, className: classNames('d-block', linkClassNames, spacingClassNames), title: linkTitle ? linkTitle : title, ref: hoverRef, target: linkTarget, rel: linkTarget && linkTarget === '_blank' ? 'noopener noreferrer' : undefined, children: renderSection }));\n};\nexport default Panel;\n","import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useEffect, useState } from 'react';\nimport ArrowRight from '@helsenorge/designsystem-react/components/Icons/ArrowRight';\nimport { hasLoggedInCookie } from '@helsenorge/framework-utils/cookie';\nimport LoginButton from './LoginButton';\nimport Panel from '../panel';\nconst LoginBlock = ({ title, intro, authenticatedTitle, authenticatedIntro, hideIfAuthenticated = false, url, iconName, buttonText, colorName, showOnlyButton, }) => {\n const [isAuthenticated, setIsAuthenticated] = useState(false);\n useEffect(() => {\n const isAuthorized = hasLoggedInCookie();\n setIsAuthenticated(isAuthorized);\n }, []);\n if (isAuthenticated && hideIfAuthenticated) {\n return null;\n }\n return (_jsx(_Fragment, { children: showOnlyButton && !isAuthenticated ? (_jsx(LoginButton, { icon: iconName, concept: \"normal\", fluid: true, htmlMarkup: \"a\", rightSideIcon: ArrowRight, size: \"large\", href: url, children: buttonText })) : (_jsx(Panel, { icon: iconName, title: isAuthenticated && authenticatedTitle ? authenticatedTitle : title, intro: isAuthenticated && authenticatedIntro ? authenticatedIntro : intro, url: isAuthenticated ? url : '', colorName: colorName, children: !isAuthenticated && (_jsx(\"div\", { className: \"mt-5\", children: _jsx(LoginButton, { htmlMarkup: \"a\", href: url, children: buttonText }) })) })) }));\n};\nexport default LoginBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\n/* eslint-disable react/prop-types */\nimport { useContext } from 'react';\nimport { PortableTextContext } from '../..';\nimport LoginBlockComponent from '../../../loginblock';\nconst getColorName = (contextColor, blockColor) => {\n // Når farge på blokken er \"Ingen\", bruk farge hentet fra parent-komponent\n if (contextColor && blockColor === 'none') {\n return contextColor;\n }\n // Ellers, bruk farge fra blokken\n if (blockColor !== 'none') {\n return blockColor;\n }\n};\nconst LoginBlock = ({ value }) => {\n const backgroundColor = useContext(PortableTextContext)?.backgroundColor;\n const colorName = getColorName(backgroundColor, value.colorName);\n return (_jsx(LoginBlockComponent, { title: value.title, intro: value.intro, authenticatedTitle: value.authenticatedTitle, authenticatedIntro: value.authenticatedIntro, hideIfAuthenticated: value.hideIfAuthenticated, url: value.url, iconName: value.iconName, buttonText: value.buttonText, colorName: colorName, showOnlyButton: value.showOnlyButton }));\n};\nexport default LoginBlock;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport fontStyles from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport PortableText from '../..';\nconst TextBlockComponent = ({ title, titleHtmlMarkup = 'h2', titleAppearance = 'title2', mainIntro, mainBody, }) => (_jsxs(\"div\", { children: [_jsx(Title, { htmlMarkup: titleHtmlMarkup, appearance: titleAppearance, children: title }), mainIntro && _jsx(\"p\", { className: fontStyles.preamble, children: mainIntro }), _jsx(PortableText, { value: mainBody })] }));\nconst TextBlock = ({ value }) => (_jsx(TextBlockComponent, { title: value.title, titleHtmlMarkup: value.titleHtmlMarkup, titleAppearance: value.titleAppearance, mainIntro: value.mainIntro, mainBody: value.mainBody, removePadding: value.removePadding }));\nexport default TextBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport cmsstyles from './styles.module.scss';\nconst RichTextTitle = ({ htmlMarkup, children }) => {\n const htmlMarkupAppearanceMap = {\n h1: 'title1',\n h2: 'title2',\n h3: 'title3',\n h4: 'title4',\n h5: 'title5',\n span: 'title5',\n };\n return (_jsx(Title, { className: cmsstyles.richtext, htmlMarkup: htmlMarkup, appearance: htmlMarkupAppearanceMap[htmlMarkup], children: children }));\n};\nexport default RichTextTitle;\n","export var VimeoSubtitleLanguageCodes;\n(function (VimeoSubtitleLanguageCodes) {\n VimeoSubtitleLanguageCodes[\"NORWEGIAN\"] = \"nb\";\n VimeoSubtitleLanguageCodes[\"NORWEGIAN_NYNORSK\"] = \"nn\";\n VimeoSubtitleLanguageCodes[\"ENGLISH\"] = \"en-GB\";\n VimeoSubtitleLanguageCodes[\"LITHUANIAN\"] = \"lt\";\n VimeoSubtitleLanguageCodes[\"POLISH\"] = \"pl\";\n VimeoSubtitleLanguageCodes[\"RUSSIAN\"] = \"ru\";\n VimeoSubtitleLanguageCodes[\"ROMANIAN\"] = \"ro\";\n VimeoSubtitleLanguageCodes[\"SAMI_NORTHERN\"] = \"se\";\n})(VimeoSubtitleLanguageCodes || (VimeoSubtitleLanguageCodes = {}));\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useRef } from 'react';\nimport classNames from 'classnames';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Checkbox from '@helsenorge/designsystem-react/components/Checkbox';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport cmsstyles from './styles.module.scss';\nconst YouTubeTermsOfService = ({ title, imageUrl, resources, handleAccept, }) => {\n const checkboxRef = useRef(null);\n return (_jsxs(\"div\", { className: cmsstyles['tos-overlay'], style: {\n backgroundImage: imageUrl ? `linear-gradient(rgba(0, 0, 0, 0.60), rgba(0, 0, 0, 0.60)), url(${imageUrl})` : undefined,\n }, children: [title && (_jsx(Title, { className: cmsstyles['tos-overlay__title'], htmlMarkup: \"h2\", appearance: \"title3\", children: title })), _jsxs(\"div\", { className: cmsstyles['tos'], children: [_jsxs(\"p\", { className: classNames(cmsstyles['tos__text'], designsystemtypography['anchorlink-wrapper']), children: [resources.youtubeTosText, ' ', _jsx(\"a\", { href: resources.youtubeTosLinkHref ?? 'https://www.youtube.com/t/terms', target: \"_blank\", rel: \"noopener noreferrer\", children: resources.youtubeTosLinkText }), ' ', resources.youtubeTosTextSuffix] }), _jsx(\"div\", { className: cmsstyles['tos__remember'], children: _jsx(Checkbox, { label: resources.tosRememberLabel, ref: checkboxRef }) }), _jsx(Button, { onClick: () => handleAccept(checkboxRef.current?.checked ?? false), children: resources.tosButtonText })] })] }));\n};\nexport default YouTubeTermsOfService;\n","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useState, useEffect } from 'react';\nimport classNames from 'classnames';\nimport { VideoType } from '../types/entities';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport { hasCookie } from '@helsenorge/framework-utils/cookie';\nimport { setSharedCookie } from '@helsenorge/framework-utils/shared-cookies';\nimport { VimeoSubtitleLanguageCodes } from './constants';\nimport YouTubeTermsOfService from './youtube-terms-of-service';\nimport cmsstyles from './styles.module.scss';\n/**\n * Navn på cookien som brukes til å huske at brukeren har akseptert YouTubes vilkår\n */\nconst YOUTUBE_TOS_COOKIE_NAME = 'hn-youtube-tos-accepted';\n/**\n * Navn på event som brukes til å skjule vilkår fra alle YouTube-videoer samtidig.\n */\nconst YOUTUBE_EVENT_NAME = 'hn-youtube-settosaccepted';\n/**\n * Hvor mange dager før brukeren på nytt må ta stilling til YouTubes vilkår\n */\nconst YOUTUBE_COOKIE_AGE_DAYS = 365;\nconst VideoSpiller = props => {\n const { title, description, videoId, videoType, imageUrl, altText, showTextContent = false, resources, subtitleLanguageCode = VimeoSubtitleLanguageCodes.NORWEGIAN, className, } = props;\n const [tosAccepted, setTosAccepted] = useState(false);\n const handleAccept = (remember) => {\n setTosAccepted(true);\n document.dispatchEvent(new CustomEvent(YOUTUBE_EVENT_NAME));\n if (remember) {\n setSharedCookie(YOUTUBE_TOS_COOKIE_NAME, '1', YOUTUBE_COOKIE_AGE_DAYS);\n }\n };\n const handleAcceptEvent = () => {\n setTosAccepted(true);\n };\n useEffect(() => {\n setTosAccepted(hasCookie(YOUTUBE_TOS_COOKIE_NAME));\n document.addEventListener(YOUTUBE_EVENT_NAME, handleAcceptEvent);\n return () => {\n document.removeEventListener(YOUTUBE_EVENT_NAME, handleAcceptEvent);\n };\n }, []);\n const getVideoUrl = () => {\n if (videoType === VideoType.youtube) {\n return `https://www.youtube-nocookie.com/embed/${videoId}?&rel=0`;\n }\n else if (videoType === VideoType.vimeo) {\n return `https://player.vimeo.com/video/${videoId}?texttrack=${subtitleLanguageCode}`;\n }\n else if (videoType === VideoType.vimeoShowcase) {\n return `https://vimeo.com/showcase/${videoId}/embed?texttrack=${subtitleLanguageCode}`;\n }\n return '';\n };\n const getAllowAttribute = () => {\n if (videoType === VideoType.youtube) {\n return 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture';\n }\n else if (videoType === VideoType.vimeo) {\n return 'fullscreen;';\n }\n else if (videoType === VideoType.vimeoShowcase) {\n return 'fullscreen;';\n }\n return '';\n };\n const videoUrl = getVideoUrl();\n const allowAttribute = getAllowAttribute();\n const showTermsOfService = videoType === VideoType.youtube && !tosAccepted && resources;\n if (!allowAttribute || !videoUrl) {\n return null;\n }\n const renderTextContent = () => (_jsxs(\"div\", { className: cmsstyles.videobeskrivelse, children: [title && _jsx(\"h3\", { className: classNames(designsystemtypography.title3, cmsstyles.videobeskrivelse__title), children: title }), description && _jsx(\"p\", { className: cmsstyles.videobeskrivelse__description, children: description })] }));\n return (_jsxs(_Fragment, { children: [_jsxs(\"div\", { className: classNames(cmsstyles.videospiller, cmsstyles['videospiller--16by9'], className), children: [showTermsOfService && (_jsx(YouTubeTermsOfService, { title: title || altText, imageUrl: imageUrl, resources: resources, handleAccept: handleAccept })), _jsx(\"iframe\", { src: showTermsOfService ? '' : videoUrl, className: cmsstyles.videospiller__iframe, allow: allowAttribute, title: altText || title })] }), showTextContent && renderTextContent()] }));\n};\nVideoSpiller.displayName = 'VideoSpiller';\nexport default VideoSpiller;\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport VideoSpillerComponent from '../../../videospiller';\nconst VideoBlock = ({ value }) => (_jsxs(_Fragment, { children: [_jsx(VideoSpillerComponent, { title: value.title, description: value.description, videoId: value.videoId, videoType: value.videoType, altText: value.altText, imageUrl: value.imageUrl, resources: value.resources, showTextContent: true }), _jsx(Spacer, { size: \"m\" })] }));\nexport default VideoBlock;\n","export var AnalyticsId;\n(function (AnalyticsId) {\n AnalyticsId[\"Videokort\"] = \"videokort\";\n})(AnalyticsId || (AnalyticsId = {}));\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport classNames from 'classnames';\nimport { CardsPerRow, VideoTheme } from '../types/entities';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport Play from '@helsenorge/designsystem-react/components/Icons/Play';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport { theme as designTheme, useHover, useUuid } from '@helsenorge/designsystem-react';\nimport { AnalyticsId } from '../shared/analytics';\nimport cmsstyles from './styles.module.scss';\nconst VideoKort = ({ title, description, imageUrl, onClick, wrapperClassName, selected, theme = VideoTheme.cherry, hasFullWidth, cardsPerRow, testId, playVideoLabel = 'Spill av video', }) => {\n const uuid = useUuid();\n const buttonId = `videocard-button-${uuid}`;\n const titleId = `videocard-title-${uuid}`;\n const descriptionId = `videocard-description-${uuid}`;\n const { hoverRef, isHovered } = useHover();\n const wrapperClasses = classNames(wrapperClassName, cmsstyles['videocard-wrapper']);\n const videoCardClasses = classNames(cmsstyles.videocard, cmsstyles[`videocard--${theme}`], selected && cmsstyles['videocard--selected']);\n const imageClasses = classNames(cmsstyles.videocard__image, cardsPerRow == CardsPerRow.two && !hasFullWidth ? cmsstyles['videocard__image--medium-height'] : '', cardsPerRow == CardsPerRow.two && hasFullWidth ? cmsstyles['videocard__image--tall-height'] : '', cardsPerRow == CardsPerRow.four && hasFullWidth ? cmsstyles['videocard__image--tall-height-tablet'] : '', cardsPerRow == CardsPerRow.one ? cmsstyles['videocard__image--max-height'] : '');\n const buttonAriaLabelledBy = title ? `${buttonId} ${titleId}` : buttonId;\n const buttonAriaDescribedBy = description ? descriptionId : undefined;\n if (imageUrl?.length === 0) {\n return null;\n }\n const playLabelClasses = classNames(designsystemtypography.title3, cmsstyles.playbutton__label, {\n [cmsstyles['playbutton__label--active']]: isHovered || selected,\n });\n const titleClasses = classNames(designsystemtypography.title3, cmsstyles.videocard__title);\n return (_jsx(\"div\", { className: wrapperClasses, ref: hoverRef, children: _jsxs(\"div\", { className: videoCardClasses, \"data-analyticsid\": AnalyticsId.Videokort, \"data-testid\": testId, children: [_jsx(\"div\", { className: cmsstyles['videocard__image-wrapper'], children: _jsx(\"img\", { className: imageClasses, alt: \"\", src: imageUrl }) }), _jsxs(\"div\", { className: cmsstyles.videocard__content, children: [_jsxs(\"button\", { className: cmsstyles.playbutton, \"aria-labelledby\": buttonAriaLabelledBy, \"aria-describedby\": buttonAriaDescribedBy, \"aria-expanded\": selected, onClick: onClick, children: [_jsx(Icon, { size: 36, color: isHovered ? designTheme.palette.blueberry800 : designTheme.palette.blueberry700, svgIcon: Play, isHovered: isHovered }), _jsx(\"span\", { id: buttonId, className: playLabelClasses, children: playVideoLabel })] }), title && (_jsx(\"h3\", { id: titleId, className: titleClasses, children: title })), description && (_jsx(\"p\", { className: cmsstyles.videocard__description, id: buttonAriaDescribedBy, children: description }))] })] }) }));\n};\nexport default VideoKort;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React, { useRef } from 'react';\nimport classNames from 'classnames';\nimport { CardsPerRow, VideoTheme } from '../types/entities';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport VideoKort from '../videokort';\nimport VideoSpiller from './../videospiller';\nimport { VimeoSubtitleLanguageCodes } from '../videospiller/constants';\nimport styles from './styles.module.scss';\nconst VideoMatrise = ({ title, videoCards, cardsPerRow = CardsPerRow.four, theme = VideoTheme.cherry, hasFullWidth = false, resources, subtitleLanguageCode = VimeoSubtitleLanguageCodes.NORWEGIAN, }) => {\n const [currentIndex, setIndex] = React.useState();\n const matriseRef = useRef(null);\n React.useEffect(() => {\n const scrollToVideo = () => {\n if (typeof currentIndex !== 'undefined' && matriseRef.current) {\n matriseRef.current.scrollIntoView();\n }\n };\n scrollToVideo();\n }, [currentIndex]);\n if (videoCards.length === 0) {\n return null;\n }\n return (_jsxs(\"div\", { ref: matriseRef, children: [title && (_jsx(Title, { margin: 1.5, htmlMarkup: \"h2\", appearance: \"title3\", children: title })), _jsx(\"div\", { className: \"row\", children: videoCards.map((card, index) => {\n const wrapperClasses = classNames('col-12 col-md-6', {\n ['col-lg-3']: cardsPerRow === CardsPerRow.four,\n ['col-lg-4']: cardsPerRow === CardsPerRow.three,\n ['col-lg-6']: cardsPerRow === CardsPerRow.two,\n ['col-lg-12']: cardsPerRow === CardsPerRow.one,\n });\n return (_jsxs(React.Fragment, { children: [_jsx(VideoKort, { title: card.title, description: card.description, imageUrl: card.imageUrl, onClick: () => setIndex(index), wrapperClassName: wrapperClasses, cardsPerRow: cardsPerRow, selected: currentIndex === index, theme: theme, hasFullWidth: hasFullWidth, playVideoLabel: resources?.playVideo, testId: 'videoKort' }), currentIndex === index && (_jsx(VideoSpiller, { videoId: card.videoId, videoType: card.videoType, imageUrl: card.imageUrl, title: card.title, altText: card.altText, resources: resources, className: styles['videospiller--matrise'], subtitleLanguageCode: subtitleLanguageCode }))] }, index));\n }) })] }));\n};\nexport default VideoMatrise;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\n/* eslint-disable react/prop-types */\nimport { useContext } from 'react';\nimport { VideoTheme } from '../../../types/entities';\nimport { PortableTextContext } from '../..';\nimport VideoMatriseComponent from '../../../videomatrise';\nconst VideoMatriseBlock = ({ value }) => {\n const backgroundColor = useContext(PortableTextContext)?.backgroundColor;\n return (_jsx(VideoMatriseComponent, { title: value.title, videoCards: value.videoCards, cardsPerRow: value.cardsPerRow, theme: backgroundColor && isVideoThemeColor(backgroundColor) ? backgroundColor : value.theme, resources: value.resources }));\n};\nfunction isVideoThemeColor(value) {\n return Object.values(VideoTheme).includes(value);\n}\nexport default VideoMatriseBlock;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport EkspanderendeBlock from './components/ekspanderendeblock';\nimport ImageBlock from './components/imageblock';\nimport Link from './components/link';\nimport LinkListBlock from './components/linklistblock';\nimport LoginBlock from './components/loginblock';\nimport TextBlock from './components/textblock';\nimport RichTextTitle from './components/title';\nimport VideoBlock from './components/videoblock';\nimport VideoMatriseBlock from './components/videomatriseblock';\nexport const globalComponents = {\n types: {\n EkspanderendeBlock,\n ImageBlock,\n LinkListBlock,\n TextBlock,\n VideoBlock,\n VideoMatriseBlock,\n LoginBlock,\n },\n block: {\n h1: ({ children }) => _jsx(RichTextTitle, { htmlMarkup: \"h1\", children: children }),\n h2: ({ children }) => _jsx(RichTextTitle, { htmlMarkup: \"h2\", children: children }),\n h3: ({ children }) => _jsx(RichTextTitle, { htmlMarkup: \"h3\", children: children }),\n h4: ({ children }) => _jsx(RichTextTitle, { htmlMarkup: \"h4\", children: children }),\n h5: ({ children }) => _jsx(RichTextTitle, { htmlMarkup: \"h5\", children: children }),\n },\n marks: {\n link: Link,\n superscript: ({ children }) => _jsx(\"sup\", { children: children }),\n subscript: ({ children }) => _jsx(\"sub\", { children: children }),\n },\n};\nexport const isBlockModelList = (list) => Array.isArray(list) && list.length > 0 && list.every(item => '_type' in item);\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createContext } from 'react';\nimport { PortableText as PortableTextReact } from '@portabletext/react';\nimport { globalComponents } from './portable-text-utils';\nexport const PortableTextContext = createContext(undefined);\nexport const PortableText = ({ components, value, className, backgroundColor, ...rest }) => {\n if (!value) {\n return null;\n }\n return (_jsx(PortableTextContext.Provider, { value: { backgroundColor: backgroundColor }, children: _jsx(\"div\", { className: className, children: _jsx(PortableTextReact, { components: { ...globalComponents, ...components }, value: value, ...rest }) }) }));\n};\nexport default PortableText;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/* eslint-disable jsx-a11y/interactive-supports-focus */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport React from 'react';\nimport classNames from 'classnames';\nimport { Collapse } from 'react-collapse';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronDown from '@helsenorge/designsystem-react/components/Icons/ChevronDown';\nimport ChevronUp from '@helsenorge/designsystem-react/components/Icons/ChevronUp';\nimport Loader from '@helsenorge/designsystem-react/components/Loader';\nimport NotificationPanel from '@helsenorge/designsystem-react/components/NotificationPanel';\nimport PortableText from '@helsenorge/core-cms/richtext';\nimport { theme } from '@helsenorge/designsystem-react';\nimport { trackProsesshjelp } from '@helsenorge/framework-utils/adobe-analytics';\nexport class Seksjon extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n expanded: this.props.expanded,\n };\n this.toggleExpanded = this.toggleExpanded.bind(this);\n this.removeSeksjonClick = this.removeSeksjonClick.bind(this);\n }\n toggleExpanded() {\n if (this.props.toggleExpanded && this.props.seksjon) {\n if (this.props.seksjon.overskrift) {\n trackProsesshjelp('Prosesshjelp', 'Hjelp', this.props.seksjon.overskrift, !this.props.expanded ? 'Open' : 'Close');\n }\n this.props.toggleExpanded(this.props.seksjon.hjelpetekstId, this.props.seksjon.tjenesteNavn);\n }\n }\n removeSeksjonClick(event) {\n if (event !== undefined) {\n event.preventDefault();\n event.stopPropagation();\n }\n if (this.props.removeSeksjon && this.props.seksjon && this.props.seksjon.hjelpetekstId && this.props.seksjon.tjenesteNavn) {\n this.props.removeSeksjon(this.props.seksjon.hjelpetekstId, this.props.seksjon.tjenesteNavn);\n }\n }\n render() {\n const { resources, id, seksjon, expanded } = this.props;\n if (!seksjon || !resources) {\n return null;\n }\n let errorMessage;\n let seksjonComponent;\n const loader = seksjon.loading ? _jsx(Loader, { center: true, size: 'medium' }) : undefined;\n if (seksjon.error) {\n errorMessage = (_jsx(NotificationPanel, { label: resources.prosessHjelpError, variant: 'error', children: _jsx(\"p\", { children: resources.prosessHjelpErrorDescription }) }));\n }\n else {\n const sectionClasses = classNames('step', { open: expanded });\n seksjonComponent = (_jsxs(\"section\", { className: sectionClasses, children: [_jsx(\"div\", { className: \"org_helpdrawer__draweraccordionstepheader\", children: _jsx(\"h2\", { children: _jsxs(\"button\", { type: \"button\", onClick: this.toggleExpanded, className: \"org_helpdrawer__draweraccordionsteptitle\", \"aria-expanded\": expanded, \"aria-controls\": id, children: [_jsx(Icon, { svgIcon: expanded ? ChevronUp : ChevronDown, color: theme.palette.blueberry700 }), this.props.seksjon ? this.props.seksjon.overskrift : ''] }) }) }), _jsx(\"div\", { id: id, children: _jsx(Collapse, { isOpened: !!expanded, children: _jsx(\"div\", { children: _jsx(\"div\", { className: \"org_helpdrawer__draweraccordionstepcontents\", children: seksjon.brodtekst?.length && _jsx(PortableText, { value: seksjon.brodtekst }) }) }) }) })] }));\n }\n return (_jsxs(\"div\", { className: \"org_helpdrawer__draweraccordion\", children: [errorMessage, seksjonComponent, loader] }));\n }\n}\nObject.defineProperty(Seksjon, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n resources: undefined,\n }\n});\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n// Løses i forbindelse med #282399\n/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n/* eslint-disable jsx-a11y/role-has-required-aria-props */\nimport { useEffect, useState, useRef } from 'react';\nimport classNames from 'classnames';\nimport { Icon, IconSize } from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronLeft from '@helsenorge/designsystem-react/components/Icons/ChevronLeft';\nimport ChevronRight from '@helsenorge/designsystem-react/components/Icons/ChevronRight';\nimport HelpSign from '@helsenorge/designsystem-react/components/Icons/HelpSign';\nimport X from '@helsenorge/designsystem-react/components/Icons/X';\nimport aria from '@helsenorge/core-utils/aria-hidden';\nimport TrapFocus from '@helsenorge/core-utils/trapfocus';\nimport { Breakpoint, theme, useBreakpoint, useFocusToggle, useHover } from '@helsenorge/designsystem-react';\nimport { trackProsesshjelp } from '@helsenorge/framework-utils/adobe-analytics';\nimport { Seksjon } from './seksjon';\nimport styles from './styles.module.scss';\nimport './styles.scss';\nexport const HjelpeskuffComponent = props => {\n const { isVisible = true, defaultSeksjon, resources, seksjoner } = props;\n const breakpoint = useBreakpoint();\n const [disableTransition, setDisableTransition] = useState(false);\n const { hoverRef, isHovered } = useHover();\n const helpTitleRef = useRef(null);\n const helpDrawerRef = useRef(null);\n const helpContentsRef = useRef(null);\n const [prevAriaHiddens, setPrevAriaHiddens] = useState();\n const [trapFocus, setTrapFocus] = useState();\n const [prevFocus, setPrevFocus] = useState();\n useFocusToggle(helpContentsRef, props.isOpen);\n const trackToggleOpen = (activeSeksjonId, isOpen) => {\n let activeSeksjon;\n if (activeSeksjonId && seksjoner) {\n activeSeksjon = seksjoner.find((seksjon) => {\n return activeSeksjonId === seksjon.hjelpetekstId;\n });\n }\n else {\n activeSeksjon = props.defaultSeksjon;\n }\n if (activeSeksjon && activeSeksjon.overskrift) {\n trackProsesshjelp('Prosesshjelp', 'Hjelp', activeSeksjon.overskrift, isOpen ? 'Open' : 'Close');\n }\n };\n const enableTrapFocus = () => {\n if (trapFocus) {\n return; // Focus already trapped\n }\n setPrevFocus(document.activeElement);\n setTrapFocus(new TrapFocus(helpDrawerRef.current));\n };\n const toggleFocus = () => {\n if (props.isOpen && isVisible) {\n enableTrapFocus();\n const node = helpDrawerRef.current;\n if (node instanceof Element) {\n setPrevAriaHiddens(aria.setAriaHidden(node));\n if (helpTitleRef.current) {\n helpTitleRef.current.focus();\n }\n }\n }\n };\n const releaseFocus = () => {\n if (prevAriaHiddens) {\n aria.resetAriaHidden(prevAriaHiddens);\n }\n if (trapFocus) {\n trapFocus.deactivate();\n setTrapFocus(undefined);\n if (prevFocus) {\n prevFocus.focus();\n }\n setPrevFocus(undefined);\n }\n };\n const handleToggleClick = () => {\n if (props.toggleShowHjelpeskuff) {\n props.toggleShowHjelpeskuff();\n }\n };\n const elementIsInHelpDrawer = (eventTarget) => {\n for (const target of eventTarget) {\n if (target?.classList?.contains('org_helpdrawer')) {\n return true;\n }\n }\n return false;\n };\n const elementIsInHjelpetrigger = (eventTarget) => {\n for (const target of eventTarget) {\n if (target?.classList?.contains('js-prosesshjelp')) {\n return true;\n }\n }\n return false;\n };\n const isMobile = () => {\n return breakpoint <= Breakpoint.sm;\n };\n const isOpenInHistoryState = () => {\n return window.history.state && window.history.state.helpDrawerOpen;\n };\n const removePreventscroll = () => {\n document.documentElement.classList.remove('preventscroll');\n };\n const isLightboxOpen = () => {\n return document.querySelectorAll('.toolkit-lightbox').length > 0;\n };\n const setScroll = () => {\n if (document.documentElement.classList.contains('preventscroll') && !props.isOpen && !isLightboxOpen()) {\n removePreventscroll();\n }\n else {\n document.documentElement.classList.add('preventscroll');\n }\n };\n const open = () => {\n // Only push state to enable back/forward browser navigation if help drawer use the full width (mobile)\n if (isMobile() && !isOpenInHistoryState()) {\n window.history.pushState(Object.assign({}, window.history.state, { helpDrawerOpen: true }), '', window.location.href);\n }\n setScroll();\n };\n const close = () => {\n if (isMobile() && isOpenInHistoryState()) {\n window.history.back();\n }\n if (!isLightboxOpen()) {\n removePreventscroll();\n }\n };\n const disableTransitionToPreventDoubleAnimation = (callback) => {\n setDisableTransition(true);\n callback();\n window.setTimeout(() => {\n setDisableTransition(false);\n }, 500);\n };\n const popStateListener = () => {\n const helpDrawerOpen = window.history.state && window.history.state.helpDrawerOpen;\n if (helpDrawerOpen && !props.isOpen && props.showHjelpeskuff) {\n disableTransitionToPreventDoubleAnimation(props.showHjelpeskuff);\n }\n else if (!helpDrawerOpen && props.isOpen && props.hideHjelpeskuff) {\n disableTransitionToPreventDoubleAnimation(props.hideHjelpeskuff);\n }\n };\n const clickListener = (e) => {\n if (isVisible && props.isOpen) {\n const eventPath = e.composedPath();\n if (!elementIsInHelpDrawer(eventPath) && !elementIsInHjelpetrigger(eventPath) && props.hideHjelpeskuff) {\n props.hideHjelpeskuff();\n }\n }\n };\n const removeSeksjon = (triggerId, tjenesteNavn) => {\n toggleFocus();\n if (props.removeSeksjon) {\n props.removeSeksjon(triggerId, tjenesteNavn);\n }\n };\n useEffect(() => {\n toggleFocus();\n }, []);\n useEffect(() => {\n if (props.isOpen) {\n window.addEventListener('popstate', popStateListener);\n window.addEventListener('click', clickListener);\n toggleFocus();\n open();\n trackToggleOpen(props.activeSeksjonId, props.isOpen);\n }\n else {\n releaseFocus();\n close();\n }\n return () => {\n releaseFocus();\n window.removeEventListener('popstate', popStateListener);\n window.removeEventListener('click', clickListener);\n };\n }, [props.isOpen]);\n if (!isVisible || !resources) {\n return null;\n }\n const helpDrawerClasses = classNames({\n org_helpdrawer: true,\n open: props.isOpen,\n });\n let defaultSeksjonComponent;\n let seksjonerComponent;\n if (defaultSeksjon != null) {\n defaultSeksjonComponent = (_jsx(Seksjon, { id: \"default\", seksjon: defaultSeksjon, expanded: !!defaultSeksjon.expanded, resources: resources, toggleExpanded: props.toggleExpanded }));\n }\n if (seksjoner != null) {\n seksjonerComponent = (_jsx(\"div\", { children: seksjoner.map((seksjon, index) => (_jsx(Seksjon, { id: index.toString(), seksjon: seksjon, expanded: !!seksjon.expanded, resources: resources, removeSeksjon: removeSeksjon, toggleExpanded: props.toggleExpanded }, index.toString()))) }));\n }\n let style = {};\n if (disableTransition) {\n style = { transitionDuration: '0s' };\n }\n const ariaLabelTitleText = defaultSeksjon && defaultSeksjon.overskrift\n ? defaultSeksjon.overskrift\n : seksjoner && seksjoner.length && seksjoner[0].overskrift\n ? seksjoner[0].overskrift\n : '';\n return (_jsxs(\"div\", { ref: helpDrawerRef, className: helpDrawerClasses, style: style, children: [_jsx(\"span\", { className: \"org_helpdrawer__control\", children: _jsxs(\"button\", { className: \"org_helpdrawer__controlbutton\", type: \"button\", onClick: handleToggleClick, tabIndex: 0, \"aria-label\": props.isOpen ? resources.helpDrawerCloseHelpButton : resources.helpDrawerToggleHelpButton, \"data-testid\": 'helpdrawer', children: [_jsx(Icon, { svgIcon: HelpSign, color: theme.palette.white, className: 'org_helpdrawer__icon' }), props.isOpen ? (_jsx(Icon, { svgIcon: ChevronRight, color: theme.palette.white })) : (_jsx(Icon, { svgIcon: ChevronLeft, color: theme.palette.white }))] }) }), _jsxs(\"div\", { className: \"org_helpdrawer__contents\", \"aria-hidden\": !props.isOpen, ref: helpContentsRef, children: [_jsxs(\"div\", { className: \"org_helpdrawer__drawerheader\", children: [_jsxs(\"div\", { className: \"helptitle-wrap\", role: \"heading\", tabIndex: 0, \"aria-label\": `${resources.helpDrawerHelpIconLabel} ${ariaLabelTitleText}`, ref: helpTitleRef, children: [_jsx(Icon, { svgIcon: HelpSign, color: theme.palette.white, className: 'org_helpdrawer__icon' }), _jsx(\"h1\", { className: \"helptitle\", children: resources.helpDrawerTitle })] }), _jsxs(\"button\", { ref: hoverRef, className: styles['close-button'], onClick: props.hideHjelpeskuff, type: \"button\", children: [_jsx(Icon, { size: IconSize.XSmall, svgIcon: X, color: theme.palette.white, isHovered: isHovered }), _jsx(\"span\", { className: styles['close-button__screen-reader-text'], children: resources.helpDrawerCloseHelpButton })] })] }), _jsxs(\"div\", { children: [defaultSeksjonComponent, seksjonerComponent] })] })] }));\n};\nexport default HjelpeskuffComponent;\n","import { selectCmsTjenesteTekster, selectCmsTjenesteTekstForHjelpetekstId } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nconst TOGGLE_SHOW = 'hjelpeskuff/TOGGLE_SHOW';\nconst TOGGLE_SHOW_HELPITEM = 'hjelpeskuff/TOGGLE_SHOW_HELPITEM';\nconst SET_ACTIVE_HELPBUBBLE = 'hjelpeskuff/SET_ACTIVE_HELPBUBBLE';\nconst HIDE = 'hjelpeskuff/HIDE';\nconst SHOW = 'hjelpeskuff/SHOW';\nconst REMOVE_SEKSJON = 'hjelpeskuff/REMOVE_SEKSJON';\nconst TOGGLE_EXPANDED = 'hjelpeskuff/TOGGLE_EXPANDED';\nconst ADD_HJELPETRIGGER = 'hjelpeskuff/ADD_HJELPETRIGGER';\nconst REMOVE_HJELPETRIGGER = 'hjelpeskuff/ADD_HJELPETRIGGER';\nconst POPULATE_SKUFF = 'hjelpeskuff/POPULATE_SKUFF';\nconst initialState = {\n isOpen: false,\n activeBubble: undefined,\n activeSeksjonId: undefined,\n activeTriggerComponentId: undefined,\n seksjoner: [],\n defaultIsExpanded: undefined,\n triggerComponentIds: [],\n};\nfunction collapseAll(seksjoner) {\n return seksjoner.map((seksjon) => {\n if (seksjon.expanded) {\n return Object.assign({}, seksjon, {\n expanded: false,\n });\n }\n return seksjon;\n });\n}\nfunction isDefaultTrigger(action) {\n return action.hjelpetekstId === undefined;\n}\nexport function processToggleShowHelp(state = initialState, action) {\n const { activeSeksjonId, activeTriggerComponentId } = state;\n let seksjoner = state.seksjoner;\n const sameTriggerId = activeSeksjonId === action.hjelpetekstId;\n const sameTriggerComponentId = activeTriggerComponentId ? activeTriggerComponentId === action.triggerComponentId : false;\n if (!isDefaultTrigger(action)) {\n if (seksjoner && !seksjoner.some(s => s.hjelpetekstId === action.hjelpetekstId)) {\n seksjoner = collapseAll(seksjoner).concat({\n hjelpetekstId: action.hjelpetekstId,\n tjenesteNavn: action.tjenesteNavn,\n expanded: true,\n });\n }\n else {\n seksjoner =\n state.seksjoner &&\n state.seksjoner.map((seksjon) => {\n if (seksjon.hjelpetekstId === action.hjelpetekstId && seksjon.tjenesteNavn === action.tjenesteNavn) {\n return Object.assign({}, seksjon, { expanded: true });\n }\n if (seksjon.expanded) {\n return Object.assign({}, seksjon, { expanded: false });\n }\n return seksjon;\n });\n }\n }\n else if (seksjoner) {\n seksjoner = collapseAll(seksjoner);\n }\n if (!sameTriggerId || !state.isOpen) {\n // Add new helpsection to state\n return Object.assign({}, state, {\n isOpen: true,\n activeSeksjonId: action.hjelpetekstId,\n activeTriggerComponentId: action.triggerComponentId,\n tjenesteNavn: action.tjenesteNavn,\n activeBubble: undefined,\n seksjoner,\n defaultIsExpanded: isDefaultTrigger(action),\n });\n }\n else if (sameTriggerId && state.isOpen) {\n return Object.assign({}, state, {\n isOpen: false,\n activeSeksjonId: undefined,\n activeTriggerComponentId: undefined,\n activeBubble: undefined,\n });\n }\n else if (!sameTriggerComponentId) {\n // Add new active trigger id\n return Object.assign({}, state, {\n activeTriggerComponentId: action.triggerComponentId,\n });\n }\n // Same trigger clicked as last time, close drawer\n return Object.assign({}, state, {\n isOpen: false,\n activeSeksjonId: undefined,\n activeTriggerComponentId: undefined,\n activeBubble: undefined,\n });\n}\nfunction getBlankSeksjonIdIfActiv(action, state) {\n if (state.activeSeksjonId === action.hjelpetekstId) {\n return '';\n }\n return state.activeSeksjonId ? state.activeSeksjonId : '';\n}\nfunction removeSection(seksjoner, triggerId, tjenesteNavn) {\n if (triggerId != null && triggerId !== '' && seksjoner != null) {\n if (seksjoner.some(s => s.hjelpetekstId === triggerId)) {\n return seksjoner.filter(item => !(item.hjelpetekstId === triggerId && item.tjenesteNavn === tjenesteNavn));\n }\n }\n return seksjoner;\n}\nexport default function reducer(state = initialState, action) {\n switch (action.type) {\n case TOGGLE_SHOW:\n return Object.assign({}, state, {\n isOpen: !state.isOpen,\n activeBubble: undefined,\n activeTriggerComponentId: undefined,\n defaultIsExpanded: state.defaultIsExpanded === undefined ? true : state.defaultIsExpanded,\n });\n case TOGGLE_SHOW_HELPITEM:\n return processToggleShowHelp(state, action);\n case SET_ACTIVE_HELPBUBBLE:\n return Object.assign({}, state, {\n isOpen: false,\n activeBubble: action.triggerComponentId,\n activeSeksjonId: undefined,\n });\n case HIDE:\n return Object.assign({}, state, {\n isOpen: false,\n activeTriggerComponentId: undefined,\n });\n case SHOW:\n return Object.assign({}, state, {\n isOpen: true,\n defaultIsExpanded: state.defaultIsExpanded === undefined ? true : state.defaultIsExpanded,\n });\n case REMOVE_SEKSJON:\n return Object.assign({}, state, {\n activeSeksjonId: getBlankSeksjonIdIfActiv(action, state),\n seksjoner: removeSection(state.seksjoner ? state.seksjoner : [], action.hjelpetekstId ? action.hjelpetekstId : '', action.tjenesteNavn ? action.tjenesteNavn : ''),\n });\n case TOGGLE_EXPANDED:\n if (isDefaultTrigger(action)) {\n return Object.assign({}, state, { defaultIsExpanded: !state.defaultIsExpanded });\n }\n return Object.assign({}, state, {\n seksjoner: state.seksjoner\n ? state.seksjoner.map((seksjon) => {\n if (seksjon.hjelpetekstId === action.hjelpetekstId && seksjon.tjenesteNavn === action.tjenesteNavn) {\n return Object.assign({}, seksjon, {\n expanded: !seksjon.expanded,\n });\n }\n return seksjon;\n })\n : [],\n });\n case ADD_HJELPETRIGGER:\n return Object.assign({}, state, {\n triggerComponentIds: state.triggerComponentIds\n ? [...state.triggerComponentIds, action.triggerComponentId]\n : [action.triggerComponentId],\n });\n case REMOVE_HJELPETRIGGER:\n return Object.assign({}, state, {\n triggerComponentIds: state.triggerComponentIds ? state.triggerComponentIds.filter(id => id !== action.triggerComponentId) : [],\n });\n case POPULATE_SKUFF:\n return Object.assign({}, state, {\n seksjoner: state.seksjoner\n ? state.seksjoner.concat({\n hjelpetekstId: action.hjelpetekstId,\n tjenesteNavn: action.tjenesteNavn,\n expanded: true,\n })\n : [],\n });\n default:\n return state;\n }\n}\nexport function toggleShowHjelpeskuff() {\n return {\n type: TOGGLE_SHOW,\n };\n}\nexport function toggleShowHelpItem(triggerComponentId, hjelpetekstId, tjenesteNavn) {\n return {\n type: TOGGLE_SHOW_HELPITEM,\n triggerComponentId,\n hjelpetekstId,\n tjenesteNavn,\n };\n}\nexport function removeSeksjonTekst(hjelpetekstId, tjenesteNavn) {\n return {\n type: REMOVE_SEKSJON,\n hjelpetekstId,\n tjenesteNavn,\n };\n}\nexport function toggleExpanded(hjelpetekstId, tjenesteNavn) {\n return {\n type: TOGGLE_EXPANDED,\n hjelpetekstId,\n tjenesteNavn,\n };\n}\nexport function hideHjelpeskuff() {\n return {\n type: HIDE,\n };\n}\nexport function showHjelpeskuff() {\n return {\n type: SHOW,\n };\n}\nexport function addHjelpetrigger(triggerComponentId) {\n return {\n type: ADD_HJELPETRIGGER,\n triggerComponentId: triggerComponentId,\n };\n}\nexport function removeHjelpetrigger(triggerComponentId) {\n return {\n type: REMOVE_HJELPETRIGGER,\n triggerComponentId: triggerComponentId,\n };\n}\nexport function setActiveBubble(triggerComponentId) {\n return {\n type: SET_ACTIVE_HELPBUBBLE,\n triggerComponentId: triggerComponentId,\n };\n}\nexport function populateSkuff(hjelpetekstId, tjenesteNavn) {\n return {\n type: POPULATE_SKUFF,\n hjelpetekstId,\n tjenesteNavn,\n };\n}\nexport function getTriggerData(state, hjelpetekstId, tjenesteNavn, language) {\n const triggerData = selectCmsTjenesteTekstForHjelpetekstId(state, tjenesteNavn, language, hjelpetekstId);\n if (triggerData != null) {\n const { sporsmaalTekst, hjelpeboble, hjelpetekst, overskrift } = triggerData;\n return {\n sporsmalstekst: sporsmaalTekst,\n bobletekst: hjelpeboble,\n hasSeksjonText: !!hjelpetekst?.length && !!overskrift,\n };\n }\n return undefined;\n}\nexport function getActiveBubble(state) {\n const skuff = state.hjelpeskuff;\n return skuff.activeBubble ?? '';\n}\nexport function getDefaultTekst(state, tjenesteNavn, language, hjelpetekstId) {\n const getDefaultTjenesteTekst = () => {\n const tjenesteTeksterDetails = selectCmsTjenesteTekster(state, tjenesteNavn, language);\n return {\n overskrift: tjenesteTeksterDetails?.data?.hjelpetekster?.overskift,\n brodtekst: tjenesteTeksterDetails?.data?.hjelpetekster?.hjelpetekst,\n };\n };\n const getSpesifikkHjelpetekst = () => {\n const spesifikkHjelpetekst = hjelpetekstId\n ? selectCmsTjenesteTekstForHjelpetekstId(state, tjenesteNavn, language, hjelpetekstId)\n : undefined;\n return {\n overskrift: spesifikkHjelpetekst?.overskrift,\n brodtekst: spesifikkHjelpetekst?.hjelpetekst,\n };\n };\n const shouldUseSpesifikkHjelpetekst = !!hjelpetekstId;\n const hjelpetekst = shouldUseSpesifikkHjelpetekst ? getSpesifikkHjelpetekst() : getDefaultTjenesteTekst();\n if (hjelpetekst.brodtekst && hjelpetekst.overskrift) {\n return {\n overskrift: hjelpetekst?.overskrift,\n brodtekst: hjelpetekst?.brodtekst,\n loading: false,\n error: false,\n expanded: state.hjelpeskuff.defaultIsExpanded,\n };\n }\n return null;\n}\nexport function getSeksjonTekst(state, seksjon, language) {\n if (!seksjon.tjenesteNavn)\n return null;\n const hjelpeteksterForTjeneste = selectCmsTjenesteTekster(state, seksjon.tjenesteNavn, language);\n const hjelpetekst = hjelpeteksterForTjeneste?.data?.hjelpetekster?.spesifikkeHjelpetekster.find(ht => ht.id === seksjon.hjelpetekstId);\n if (hjelpetekst) {\n return {\n overskrift: hjelpetekst.overskrift,\n brodtekst: hjelpetekst.hjelpetekst,\n hjelpetekstId: seksjon.hjelpetekstId,\n tjenesteNavn: seksjon.tjenesteNavn,\n loading: false,\n error: false,\n expanded: seksjon.expanded,\n };\n }\n return null;\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { fetchTjenesteTekster } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nimport Projects from '@helsenorge/framework-utils/constants/projects';\nimport { getPath } from '@helsenorge/framework-utils/hn-page';\nimport { fetchResources, getResourcesFromState } from '@helsenorge/framework-utils/resources';\nimport HjelpeskuffComponent from './hjelpeskuff-component';\nimport { toggleShowHjelpeskuff, hideHjelpeskuff, showHjelpeskuff, getDefaultTekst, getSeksjonTekst, removeSeksjonTekst, toggleExpanded, toggleShowHelpItem, addHjelpetrigger, removeHjelpetrigger, } from './hjelpeskuff-state';\nimport { getResources } from '../../resources';\nexport const TriggerHelpItemEvent = 'HN-trigger-help-item';\nexport const AddHjelpetrigger = 'HN-add-hjelpetrigger';\nexport const RemoveHjelpetrigger = 'HN-remove-hjelpetrigger';\nclass HjelpeskuffContainer extends React.Component {\n constructor(props) {\n super(props);\n this.handleAddHjelpetriggerEvent = this.handleAddHjelpetriggerEvent.bind(this);\n this.handleRemoveHjelpetriggerEvent = this.handleRemoveHjelpetriggerEvent.bind(this);\n this.handleTriggerHelpEvent = this.handleTriggerHelpEvent.bind(this);\n }\n componentDidMount() {\n if (this.props.mount) {\n this.props.mount();\n }\n window.addEventListener(AddHjelpetrigger, this.handleAddHjelpetriggerEvent);\n window.addEventListener(RemoveHjelpetrigger, this.handleRemoveHjelpetriggerEvent);\n window.addEventListener(TriggerHelpItemEvent, this.handleTriggerHelpEvent);\n }\n componentWillUnmount() {\n window.removeEventListener(AddHjelpetrigger, this.handleAddHjelpetriggerEvent, false);\n window.removeEventListener(RemoveHjelpetrigger, this.handleRemoveHjelpetriggerEvent, false);\n window.removeEventListener(TriggerHelpItemEvent, this.handleTriggerHelpEvent, false);\n }\n handleAddHjelpetriggerEvent(event) {\n if (event.detail && this.props.addHjelpetrigger) {\n const triggerComponentId = event.detail.triggerComponentId;\n this.props.addHjelpetrigger(triggerComponentId);\n }\n }\n handleRemoveHjelpetriggerEvent(event) {\n if (event.detail && this.props.removeHjelpetrigger) {\n const triggerComponentId = event.detail.triggerComponentId;\n this.props.removeHjelpetrigger(triggerComponentId);\n }\n }\n handleTriggerHelpEvent(event) {\n if (event.detail && this.props.triggerHelpItem) {\n const hjelpetekstId = event.detail.hjelpetekstId;\n const tjenesteNavn = event.detail.tjenesteNavn;\n const triggerComponentId = event.detail.triggerComponentId;\n this.props.triggerHelpItem(hjelpetekstId, tjenesteNavn, triggerComponentId);\n }\n }\n render() {\n const { triggerComponentIds, mount, ...other } = this.props;\n if (!this.props.resources || (!this.props.defaultSeksjon && this.props.seksjoner && this.props.seksjoner.length === 0)) {\n return null;\n }\n return (_jsx(\"div\", { children: _jsx(HjelpeskuffComponent, { ...other }) }));\n }\n}\nfunction mapStateToProps(state, props) {\n const tjenesteNavn = props.tjenesteNavn ?? getPath();\n const defaultSeksjon = getDefaultTekst(state, tjenesteNavn, props.language, props.hjelpetekstId);\n const seksjoner = (state.hjelpeskuff.seksjoner?.map(seksjon => getSeksjonTekst(state, seksjon, props.language))?.filter(s => s != null) ??\n []);\n return {\n activeSeksjonId: state.hjelpeskuff.activeSeksjonId,\n seksjoner,\n defaultSeksjon,\n isOpen: state.hjelpeskuff.isOpen,\n triggerComponentIds: state.hjelpeskuff.triggerComponentIds,\n resources: getResourcesFromState(state, Projects.FRAMEWORK, props.language),\n };\n}\nfunction mapDispatchToProps(dispatch, props) {\n return {\n mount: () => {\n dispatch(fetchResources(Projects.FRAMEWORK, props.language, getResources));\n dispatch(fetchTjenesteTekster(props.tjenesteNavn ?? getPath(), props.language));\n },\n toggleExpanded: (hjelpetekstId, tjenesteNavn) => {\n dispatch(toggleExpanded(hjelpetekstId, tjenesteNavn));\n },\n toggleShowHjelpeskuff: () => {\n dispatch(toggleShowHjelpeskuff());\n },\n hideHjelpeskuff: () => {\n dispatch(hideHjelpeskuff());\n },\n showHjelpeskuff: () => {\n dispatch(showHjelpeskuff());\n },\n removeSeksjon: (hjelpetekstId, tjenesteNavn) => {\n dispatch(removeSeksjonTekst(hjelpetekstId, tjenesteNavn));\n },\n triggerHelpItem: (hjelpetekstId, tjenesteNavn, triggerComponentId) => {\n dispatch(toggleShowHelpItem(triggerComponentId ? triggerComponentId : '', hjelpetekstId, tjenesteNavn ?? ''));\n },\n addHjelpetrigger: (triggerComponentId) => {\n dispatch(addHjelpetrigger(triggerComponentId ? triggerComponentId : ''));\n },\n removeHjelpetrigger: (triggerComponentId) => {\n dispatch(removeHjelpetrigger(triggerComponentId ? triggerComponentId : ''));\n },\n language: props.language,\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(HjelpeskuffContainer);\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport HelpQuestion from '@helsenorge/designsystem-react/components/HelpQuestion';\nimport Trigger from '@helsenorge/designsystem-react/components/Trigger';\nimport { TriggerHelpItemEvent } from '../hjelpeskuff';\nconst HjelpetriggerComponent = React.forwardRef(({ resources, sporsmalstekst, classes, isHelpBubbleTrigger, tjenesteNavn, hjelpetekstId, helpBubbleIsExpanded, size, stopPropagation, useCustomEvent, onClick, }, ref) => {\n if (!resources) {\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let ariaAttributes;\n if (isHelpBubbleTrigger) {\n ariaAttributes = {\n 'aria-haspopup': true,\n 'aria-controls': hjelpetekstId,\n };\n }\n else {\n ariaAttributes = {};\n }\n const handleHelpClick = (event) => {\n if (stopPropagation && event) {\n event.stopPropagation();\n }\n if (useCustomEvent) {\n const helpElement = {\n hjelpetekstId: hjelpetekstId,\n tjenesteNavn,\n triggerComponentId: hjelpetekstId, // denne skal egentlig være unik\n };\n const triggerHelpItemEvent = new CustomEvent(TriggerHelpItemEvent, {\n detail: helpElement,\n });\n window.dispatchEvent(triggerHelpItemEvent);\n }\n if (onClick) {\n onClick();\n }\n };\n let trigger;\n if (sporsmalstekst) {\n trigger = (_jsx(HelpQuestion, { className: classes, onClick: handleHelpClick, ...ariaAttributes, ref: ref, children: sporsmalstekst }));\n }\n else {\n trigger = (_jsx(Trigger, { className: classes, onClick: handleHelpClick, ariaLabel: resources.helpTriggerLabel, selected: helpBubbleIsExpanded, size: size, ...ariaAttributes, ref: ref }));\n }\n return _jsx(\"span\", { className: \"js-prosesshjelp\", children: trigger });\n});\nHjelpetriggerComponent.displayName = 'HjelpetriggerComponent';\nexport default HjelpetriggerComponent;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React from 'react';\nimport HelpBubble from '@helsenorge/designsystem-react/components/HelpBubble';\nimport SafeHTML from '@helsenorge/framework-utils/components/safe-html';\nimport HjelpetriggerComponent from './hjelpetrigger-component';\nexport const HjelpebobleComponent = ({ hjelpetekstId, resources, onChange, onShowMoreClick, visible, triggerData, tjenesteNavn, bubbleText, moreHelpText, }) => {\n const hjelpetriggerRef = React.useRef(null);\n const showMoreButton = triggerData ? triggerData.hasSeksjonText : false;\n const renderBubbleContent = () => {\n return bubbleText ? _jsx(SafeHTML, { html: bubbleText }) : _jsx(\"span\", { children: triggerData?.bobletekst ?? '' });\n };\n const showMoreClickHandler = (event) => {\n event?.stopPropagation();\n if (onShowMoreClick) {\n onShowMoreClick(hjelpetekstId, tjenesteNavn);\n }\n };\n const renderBubble = () => {\n return (_jsx(HelpBubble, { controllerRef: hjelpetriggerRef, linkText: moreHelpText ? moreHelpText : resources?.moreHelp, onLinkClick: showMoreButton ? showMoreClickHandler : undefined, showBubble: visible, closeAriaLabel: resources?.helpBubbleClose, onClose: () => {\n onChange && onChange();\n }, children: renderBubbleContent() }));\n };\n if (!triggerData || !resources) {\n return _jsx(\"div\", {});\n }\n return (_jsxs(\"span\", { children: [_jsx(HjelpetriggerComponent, { ref: hjelpetriggerRef, hjelpetekstId: hjelpetekstId, resources: resources, sporsmalstekst: triggerData.sporsmalstekst, tjenesteNavn: tjenesteNavn, onClick: onChange, isHelpBubbleTrigger: true, helpBubbleIsExpanded: visible }), renderBubble()] }));\n};\nexport default HjelpebobleComponent;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { LanguageLocales } from '@helsenorge/core-utils/constants/languages';\nimport { fetchTjenesteTekster } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nimport Projects from '@helsenorge/framework-utils/constants/projects';\nimport { fetchResources, getResourcesFromState } from '@helsenorge/framework-utils/resources';\nimport { GetResourcesEvent } from './../hjelpetrigger';\nimport HjelpetriggerComponent from './hjelpetrigger-component';\nimport { getResources } from '../../resources';\nimport { AddHjelpetrigger, RemoveHjelpetrigger } from '../hjelpeskuff';\nexport class HjelpetriggerContainer extends React.Component {\n componentDidMount() {\n if (this.props.useCustomEvent) {\n const helpElement = {\n triggerComponentId: this.props.triggerComponentId, // denne skal egentlig være unik. this.createUniqueId() benyttes i container\n tjenesteNavn: this.props.tjenesteNavn,\n hjelpetekstId: this.props.hjelpetekstId,\n language: this.props.language,\n };\n const addHjelpetriggerEvent = new CustomEvent(AddHjelpetrigger, {\n detail: helpElement,\n });\n window.dispatchEvent(addHjelpetriggerEvent);\n const getResourcesEvent = new CustomEvent(GetResourcesEvent, {\n detail: helpElement,\n });\n window.dispatchEvent(getResourcesEvent);\n }\n }\n componentWillUnmount() {\n if (this.props.useCustomEvent) {\n const helpElement = {\n triggerComponentId: this.props.triggerComponentId, // denne skal egentlig være unik. this.createUniqueId() benyttes i container\n };\n const removeHjelpetriggerEvent = new CustomEvent(RemoveHjelpetrigger, {\n detail: helpElement,\n });\n window.dispatchEvent(removeHjelpetriggerEvent);\n }\n }\n render() {\n const { resources, sporsmalstekst, classes, isHelpBubbleTrigger, hjelpetekstId, isDefault, size, tjenesteNavn, onClick, helpBubbleIsExpanded, stopPropagation, useCustomEvent, } = this.props;\n return (_jsx(HjelpetriggerComponent, { hjelpetekstId: hjelpetekstId, isDefault: isDefault, resources: resources, classes: classes, size: size, sporsmalstekst: sporsmalstekst, tjenesteNavn: tjenesteNavn, onClick: onClick, isHelpBubbleTrigger: isHelpBubbleTrigger, helpBubbleIsExpanded: helpBubbleIsExpanded, stopPropagation: stopPropagation, useCustomEvent: useCustomEvent }));\n }\n}\nfunction mapStateToProps(state, props) {\n return {\n ...props,\n resources: getResourcesFromState(state, Projects.FRAMEWORK, props.language ?? LanguageLocales.NORWEGIAN),\n };\n}\nfunction mapDispatchToProps(dispatch, props) {\n const language = props.language ?? LanguageLocales.NORWEGIAN;\n return {\n ...props,\n mount: () => {\n dispatch(fetchResources(Projects.FRAMEWORK, language, getResources));\n if (props.tjenesteNavn) {\n dispatch(fetchTjenesteTekster(props.tjenesteNavn, language));\n }\n },\n dispatch,\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(HjelpetriggerContainer);\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { LanguageLocales } from '@helsenorge/core-utils/constants/languages';\nimport { uuid } from '@helsenorge/designsystem-react';\nimport { fetchTjenesteTekster } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nimport Projects from '@helsenorge/framework-utils/constants/projects';\nimport { getPath } from '@helsenorge/framework-utils/hn-page';\nimport { fetchResources, getResourcesFromState } from '@helsenorge/framework-utils/resources';\nimport HjelpebobleComponent from './hjelpeboble-component';\nimport HjelpetriggerContainer from './hjelpetrigger-container';\nimport { getResources } from '../../resources';\nimport { addHjelpetrigger, removeHjelpetrigger, populateSkuff, getTriggerData, getActiveBubble, setActiveBubble, toggleShowHelpItem, } from '../hjelpeskuff/hjelpeskuff-state';\nexport const GetResourcesEvent = 'HN-Get-Resources';\nclass Hjelpetrigger extends React.Component {\n constructor(props) {\n super(props);\n this.validateProps(props);\n this.handleBubbleClick = this.handleBubbleClick.bind(this);\n this.handleTriggerClick = this.handleTriggerClick.bind(this);\n this.getResourcesEvent = this.getResourcesEvent.bind(this);\n this.state = {\n triggerComponentId: this.createUniqueId(),\n };\n }\n componentDidMount() {\n if (this.props.mount) {\n this.props.mount();\n }\n const { dispatch } = this.props;\n if (!this.props.isDefault && dispatch && this.state.triggerComponentId) {\n dispatch(addHjelpetrigger(this.state.triggerComponentId));\n }\n if (this.props.populateSkuff && dispatch && this.props.hjelpetekstId && this.props.tjenesteNavn) {\n dispatch(populateSkuff(this.props.hjelpetekstId, this.props.tjenesteNavn));\n }\n window.addEventListener(GetResourcesEvent, this.getResourcesEvent);\n }\n componentWillUnmount() {\n const { dispatch } = this.props;\n if (!this.props.isDefault && dispatch && this.state.triggerComponentId) {\n dispatch(removeHjelpetrigger(this.state.triggerComponentId));\n }\n window.removeEventListener(GetResourcesEvent, this.getResourcesEvent);\n }\n getResourcesEvent(event) {\n if (event.detail && event.detail.tjenesteNavn && this.props.dispatch) {\n this.props.dispatch(fetchResources(Projects.FRAMEWORK, event.detail.language, getResources));\n this.props.dispatch(fetchTjenesteTekster(event.detail.tjenesteNavn, event.detail.language));\n }\n }\n createUniqueId() {\n return uuid();\n }\n validateProps(props) {\n if (props.isDefault) {\n this.validateDefaultProps(props);\n }\n else if (!props.hjelpetekstId) {\n throw new Error('HjelpetekstId må angis for helpTrigger');\n }\n }\n validateDefaultProps(props) {\n if (!props.isDefault) {\n return;\n }\n if (props.hjelpetekstId) {\n throw new Error('Default helptrigger kan ikke ha en hjelpetekstId...');\n }\n }\n handleBubbleClick() {\n const { dispatch } = this.props;\n const { triggerComponentId } = this.state;\n if (dispatch) {\n if (this.isBubbleVisible()) {\n dispatch(setActiveBubble(''));\n }\n else if (triggerComponentId) {\n dispatch(setActiveBubble(triggerComponentId));\n }\n }\n }\n handleTriggerClick(overrideHelpetekstId, overrideTjenesteNavn) {\n const { dispatch, hjelpetekstId, tjenesteNavn } = this.props;\n const { triggerComponentId } = this.state;\n const newHjelpetekstId = overrideHelpetekstId || hjelpetekstId;\n const newTjenesteNavn = overrideTjenesteNavn || tjenesteNavn;\n if (dispatch) {\n dispatch(toggleShowHelpItem(triggerComponentId ? triggerComponentId : '', newHjelpetekstId, newTjenesteNavn || ''));\n }\n }\n isBubbleVisible() {\n const { activeBubble } = this.props;\n const { triggerComponentId } = this.state;\n return activeBubble === triggerComponentId;\n }\n renderHjelpetrigger() {\n const { isDefault, triggerData, stopPropagation, ...other } = this.props;\n const extraProps = {\n triggerComponentId: this.state.triggerComponentId,\n };\n if (!isDefault && triggerData) {\n extraProps.sporsmalstekst = triggerData.sporsmalstekst;\n }\n return (_jsx(HjelpetriggerContainer, { size: this.props.size, ...other, ...extraProps, onClick: this.handleTriggerClick, stopPropagation: stopPropagation }));\n }\n render() {\n const { resources, triggerData, hjelpetekstId, tjenesteNavn, isDefault, bubbleText, moreHelpText } = this.props;\n if (!resources) {\n return null;\n }\n let helpTriggerItem;\n if (bubbleText || (triggerData && triggerData.bobletekst)) {\n helpTriggerItem = (_jsx(HjelpebobleComponent, { hjelpetekstId: hjelpetekstId, resources: resources, onChange: this.handleBubbleClick, onShowMoreClick: this.handleTriggerClick, visible: this.isBubbleVisible(), triggerData: triggerData, tjenesteNavn: tjenesteNavn, bubbleText: bubbleText, moreHelpText: moreHelpText }));\n }\n else if (isDefault || triggerData) {\n helpTriggerItem = this.renderHjelpetrigger();\n }\n return _jsx(\"span\", { children: helpTriggerItem });\n }\n}\nfunction mapStateToProps(state, props) {\n return {\n resources: getResourcesFromState(state, Projects.FRAMEWORK, props.language ?? LanguageLocales.NORWEGIAN),\n tjenesteNavn: props.tjenesteNavn || getPath(),\n triggerData: props.isDefault\n ? undefined\n : getTriggerData(state, props.hjelpetekstId || '', props.tjenesteNavn || getPath() || '', props.language || LanguageLocales.NORWEGIAN),\n activeBubble: getActiveBubble(state),\n };\n}\nfunction mapDispatchToProps(dispatch, props) {\n return {\n mount: () => {\n dispatch(fetchResources(Projects.FRAMEWORK, props.language ?? LanguageLocales.NORWEGIAN, getResources));\n const tjenesteNavn = props.tjenesteNavn ?? getPath();\n if (tjenesteNavn) {\n dispatch(fetchTjenesteTekster(tjenesteNavn, props.language ?? LanguageLocales.NORWEGIAN));\n }\n },\n dispatch,\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(Hjelpetrigger);\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport Eye from '@helsenorge/designsystem-react/components/Icons/Eye';\nimport NoEye from '@helsenorge/designsystem-react/components/Icons/NoEye';\nimport FrankensteinSharingStatus from '@helsenorge/designsystem-react/components/SharingStatus';\nimport LanguageLocales from '@helsenorge/core-utils/constants/languages';\nimport Projects from '@helsenorge/framework-utils/constants/projects';\nimport { getResourcesFromState, fetchResources } from '@helsenorge/framework-utils/resources';\nimport { getResources } from '../resources';\nimport { useAppDispatch, useAppSelector } from '../store/hooks';\nimport styles from './styles.module.scss';\nconst SharingStatus = ({ classNames, language = LanguageLocales.NORWEGIAN, selectedStatusType }) => {\n const dispatch = useAppDispatch();\n const resources = useAppSelector(state => getResourcesFromState(state, Projects.FRAMEWORK, language));\n React.useEffect(() => {\n dispatch(fetchResources(Projects.FRAMEWORK, language, getResources));\n }, []);\n if (!resources) {\n return null;\n }\n let sharingStatus = null;\n if (selectedStatusType === 'deltMedBarnet') {\n sharingStatus = (_jsx(FrankensteinSharingStatus, { icon: Eye, color: 'kiwi', className: styles['sharing-status-label'], children: resources.sharing_Status_Delt_Med_Barnet }));\n }\n if (selectedStatusType === 'bareSynligForDeg') {\n sharingStatus = (_jsx(FrankensteinSharingStatus, { icon: NoEye, color: 'cherry', className: styles['sharing-status-label'], children: resources.sharing_Status_Bare_Synlig_For_Deg }));\n }\n return _jsx(\"div\", { className: classNames, children: sharingStatus });\n};\nexport default SharingStatus;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport classNames from 'classnames';\nimport Title from '@helsenorge/designsystem-react/components/Title';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport { LanguageLocales } from '@helsenorge/core-utils/constants/languages';\nimport SafeHTML from '@helsenorge/framework-utils/components/safe-html';\nimport { getSidetittelId } from '@helsenorge/framework-utils/hn-page';\nimport { getErRepresentasjon, getHarAktivtForeldreSamtykke } from '@helsenorge/framework-utils/hn-user';\nimport { Hjelpetrigger } from '../prosesshjelp/index';\nimport SharingStatus from '../sharing-status';\nimport frameworkstyles from './styles.module.scss';\nconst PageHeader = ({ title, titleId = getSidetittelId(), subtitle, description, tjenesteNavn, hjelpetekstId, delAvForeldresamtykke, headerClassName, headerSubtitleClassName, headerTitleClassName, headerIngressClassName, showHjelpetrigger, language = LanguageLocales.NORWEGIAN, }) => {\n const hasHjelpetrigger = tjenesteNavn && showHjelpetrigger;\n const renderHjelpetrigger = () => (_jsx(\"span\", { className: frameworkstyles.pageheader__hjelpetrigger, children: _jsx(Hjelpetrigger, { size: 'large', isDefault: hjelpetekstId === undefined, tjenesteNavn: tjenesteNavn, hjelpetekstId: hjelpetekstId, language: language }) }));\n if (!title && !description) {\n return null;\n }\n const pageHeaderClasses = classNames('col-12', 'col-lg-10', frameworkstyles.pageheader, headerClassName);\n const titleClasses = classNames(frameworkstyles.pageheader__title, hasHjelpetrigger && frameworkstyles['pageheader__title--trigger'], headerTitleClassName);\n return (_jsx(\"div\", { className: \"row\", children: _jsxs(\"div\", { className: pageHeaderClasses, children: [subtitle && _jsx(\"div\", { className: classNames(frameworkstyles['pageheader__subtitle'], headerSubtitleClassName), children: subtitle }), _jsx(Title, { id: titleId, htmlMarkup: 'h1', appearance: 'title1', margin: 0, className: titleClasses, children: title }), hasHjelpetrigger && renderHjelpetrigger(), _jsx(\"hn-webcomp-infopanel\", {}), description && (_jsx(SafeHTML, { html: description, tagName: \"p\", className: classNames(designsystemtypography['anchorlink-wrapper'], frameworkstyles.pageheader__ingress, headerIngressClassName) })), getHarAktivtForeldreSamtykke() && getErRepresentasjon() && delAvForeldresamtykke && (_jsx(SharingStatus, { classNames: frameworkstyles['pageheader__sharing-status'], selectedStatusType: 'deltMedBarnet', language: language }))] }) }));\n};\nexport default PageHeader;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { HNeventSetRedirectTo, HNeventSetRedirectToUrlAfterLogin } from '@helsenorge/framework-utils/web-component/events';\nconst Personvelger = ({ redirectTo, redirectToUrlAfterLogin }) => {\n const [webcompIsReady, setWebcompIsReady] = useState(false);\n const location = useLocation();\n useEffect(() => {\n setWebcompIsReady(true);\n }, []);\n useEffect(() => {\n if (webcompIsReady) {\n if (redirectTo) {\n HNeventSetRedirectTo(redirectTo);\n }\n if (redirectToUrlAfterLogin) {\n HNeventSetRedirectToUrlAfterLogin(redirectToUrlAfterLogin);\n }\n }\n }, [redirectTo, redirectToUrlAfterLogin, history, location, webcompIsReady]);\n return _jsx(\"hn-webcomp-personvelger\", {});\n};\nexport default Personvelger;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { LanguageLocales } from '@helsenorge/core-utils/constants/languages';\nimport { handleIOSSafariUA } from '@helsenorge/core-utils/user-agents-utils';\nimport { selectCmsTjenesteTekster, selectCmsTjenesteTekstForHjelpetekstId } from '@helsenorge/framework-utils/cms-tjeneste-tekster';\nimport Projects from '@helsenorge/framework-utils/constants/projects';\nimport { setDocumentLanguage } from '@helsenorge/framework-utils/hn-language';\nimport { getPath, getSidetittelId } from '@helsenorge/framework-utils/hn-page';\nimport { getVisPersonvelger } from '@helsenorge/framework-utils/hn-user';\nimport { fetchResources, getResourcesFromState } from '@helsenorge/framework-utils/resources';\nimport { hasSamtykke } from '@helsenorge/framework-utils/samtykke-utils';\nimport Breadcrumb, { getBreadcrumbLink } from '../breadcrumb';\nimport { currentConfiguration, getRedirectToUrlAfterLogin, getDelAvForeldresamtykke } from '../common/configuration';\nimport ErrorBoundary from '../error-boundary';\nimport FeedbackContainer from '../feedback/container';\nimport LanguagePickerWrapper from '../language-picker-wrapper';\nimport PageHeader from '../page-header';\nimport Personvelger from '../personvelger';\nimport { getResources } from '../resources';\nimport './styles.scss';\nclass Master extends React.Component {\n constructor(props) {\n super(props);\n }\n componentDidMount() {\n handleIOSSafariUA();\n setDocumentLanguage(this.props.language);\n this.props.mount && this.props.mount();\n }\n componentDidUpdate(prevProps) {\n if (this.props.language !== prevProps.language) {\n setDocumentLanguage(this.props.language);\n }\n if (this.props.changeLanguage && this.props.language !== prevProps.language) {\n this.props.changeLanguage(this.props.language);\n }\n }\n render() {\n const { resources, title, description, mainAriaLabelledby, tjenesteNavn, className, visPersonvelger = getVisPersonvelger(), breadcrumbLink, contentResources, redirectTo, pageConfiguration, redirectToUrlAfterLogin, hasFullwidth, noBreadcrumb, noDriftspanel, showFeedbackForm, hasPageHeader, headerClassName, headerSubtitleClassName, headerTitleClassName, headerIngressClassName, language, languageConfig, showHjelpeskuffInPageHeader, subtitle, } = this.props;\n const pageBreadcrumbLinks = getBreadcrumbLink(contentResources, pageConfiguration);\n if (visPersonvelger && hasSamtykke()) {\n return _jsx(Personvelger, { redirectTo: redirectTo, redirectToUrlAfterLogin: redirectToUrlAfterLogin });\n }\n const getTitleId = () => {\n if (mainAriaLabelledby) {\n return mainAriaLabelledby;\n }\n if (title && hasPageHeader) {\n return getSidetittelId();\n }\n };\n return (_jsxs(\"div\", { className: className, children: [!noDriftspanel && _jsx(\"hn-webcomp-driftspanel\", {}), !noBreadcrumb && (_jsx(Breadcrumb, { resources: resources, contentResources: contentResources, link: breadcrumbLink || pageBreadcrumbLinks })), language && languageConfig && _jsx(LanguagePickerWrapper, { selectedLanguage: language, languageConfig: languageConfig }), _jsxs(\"main\", { className: !hasFullwidth ? 'container' : '', \"aria-labelledby\": getTitleId(), children: [hasPageHeader && (_jsx(PageHeader, { title: title, titleId: getTitleId(), subtitle: subtitle, showHjelpetrigger: !!showHjelpeskuffInPageHeader, delAvForeldresamtykke: getDelAvForeldresamtykke(), description: description, tjenesteNavn: tjenesteNavn, headerClassName: headerClassName, headerSubtitleClassName: headerSubtitleClassName, headerTitleClassName: headerTitleClassName, headerIngressClassName: headerIngressClassName })), _jsxs(ErrorBoundary, { resources: resources, children: [this.props.children, showFeedbackForm && (_jsx(FeedbackContainer, { url: getPath(), pageTitle: title ?? 'Uten tittel', tjenesteNavn: tjenesteNavn, language: language }))] })] })] }));\n }\n}\nObject.defineProperty(Master, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n hasPageHeader: true,\n noBreadcrumb: false,\n language: LanguageLocales.NORWEGIAN,\n }\n});\nfunction canShowHjelpetekstInPageHeader(state, tjenesteNavn, language, hjelpetekstId) {\n const spesifikkHjelpeTekst = hjelpetekstId\n ? selectCmsTjenesteTekstForHjelpetekstId(state, tjenesteNavn, language, hjelpetekstId)\n : undefined;\n const defaultHjelpetekst = selectCmsTjenesteTekster(state, tjenesteNavn, language);\n return !!spesifikkHjelpeTekst?.hjelpetekst || (defaultHjelpetekst?.data?.hjelpetekster?.hjelpetekst?.length ?? 0) > 0;\n}\nfunction mapStateToProps(state, props) {\n const tjenesteNavn = props.tjenesteNavn || getPath() || '';\n const contentResources = getResourcesFromState(state, Projects.CONTENT, props.language);\n return {\n resources: getResourcesFromState(state, Projects.FRAMEWORK, props.language),\n contentResources,\n title: props.title,\n description: props.description,\n tjenesteNavn: props.tjenesteNavn ?? getPath(),\n pageConfiguration: currentConfiguration(),\n redirectToUrlAfterLogin: getRedirectToUrlAfterLogin(),\n language: props.language,\n showHjelpeskuffInPageHeader: !!props.showHjelpeskuffInPageHeader && canShowHjelpetekstInPageHeader(state, tjenesteNavn, props.language, props.hjelpetekstId),\n };\n}\nfunction mapDispatchToProps(dispatch, props) {\n return {\n mount: () => {\n dispatch(fetchResources(Projects.CONTENT, props.language, getResources));\n dispatch(fetchResources(Projects.FRAMEWORK, props.language, getResources));\n },\n changeLanguage: (language) => {\n dispatch(fetchResources(Projects.CONTENT, language, getResources));\n dispatch(fetchResources(Projects.FRAMEWORK, language, getResources));\n },\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(Master);\n","import { useEffect, useRef } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { trackPageview } from '@helsenorge/framework-utils/adobe-analytics';\nconst useTrackPageView = (enabled = true) => {\n const location = useLocation();\n const previousPathname = useRef();\n useEffect(() => {\n if (enabled && previousPathname.current !== location.pathname) {\n trackPageview();\n previousPathname.current = location.pathname;\n }\n }, [location, enabled]);\n};\nexport default useTrackPageView;\n","import useTrackPageView from './useTrackPageView';\nconst TrackPageView = (props) => {\n useTrackPageView(props.enabled);\n return null;\n};\nexport default TrackPageView;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport React from 'react';\nimport { LanguageLocales } from '@helsenorge/core-utils/constants/languages';\nimport { initialize } from '@helsenorge/core-utils/date-fns-utils';\nimport getFeatureToggle from '@helsenorge/framework-utils/hn-feature-toggle';\nimport { getVisPersonvelger } from '@helsenorge/framework-utils/hn-user';\nimport { HeaderFooterEvents } from '@helsenorge/framework-utils/web-component/constants';\nimport Master from './master';\nimport withErrorBoundary from '../error-boundary/with-error-boundary';\nimport { Hjelpeskuff } from '../prosesshjelp/index';\nimport TrackPageView from '../track-pageview';\nclass PageRoot extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n visPersonvelger: !props.noPersonvelger && (getVisPersonvelger() || window.location.pathname.endsWith('/velg-person')),\n };\n this.handleVisPersonvelgerUpdate = this.handleVisPersonvelgerUpdate.bind(this);\n initialize();\n }\n componentDidMount() {\n window.addEventListener(HeaderFooterEvents.setvispersonvelger, this.handleVisPersonvelgerUpdate);\n }\n componentWillUnmount() {\n window.removeEventListener(HeaderFooterEvents.setvispersonvelger, this.handleVisPersonvelgerUpdate);\n }\n handleVisPersonvelgerUpdate(event) {\n this.setState({\n visPersonvelger: event.detail.visPersonvelger,\n });\n }\n render() {\n const { subtitle, breadcrumbLink, className, redirectTo, hasFullwidth, hasPageHeader, noBreadcrumb, noDriftspanel, showFeedbackForm = false, noHjelpeskuff, pageTitle, pageDescription, mainAriaLabelledby, headerClassName, headerSubtitleClassName, headerTitleClassName, headerIngressClassName, language = LanguageLocales.NORWEGIAN, languageConfig, tjenesteNavn, hjelpetekstId, enablePageviewTracking = true, } = this.props;\n return (_jsxs(Master, { title: pageTitle, subtitle: subtitle, description: pageDescription, mainAriaLabelledby: mainAriaLabelledby, className: className, breadcrumbLink: breadcrumbLink, redirectTo: redirectTo, hasFullwidth: hasFullwidth, hasPageHeader: hasPageHeader, noBreadcrumb: noBreadcrumb, noDriftspanel: noDriftspanel, showFeedbackForm: showFeedbackForm && !getFeatureToggle('DisableFeedbackForm'), headerClassName: headerClassName, headerTitleClassName: headerTitleClassName, headerSubtitleClassName: headerSubtitleClassName, headerIngressClassName: headerIngressClassName, language: language, languageConfig: languageConfig, visPersonvelger: this.state.visPersonvelger, tjenesteNavn: tjenesteNavn, hjelpetekstId: hjelpetekstId, showHjelpeskuffInPageHeader: !noHjelpeskuff, children: [_jsx(TrackPageView, { enabled: enablePageviewTracking }), this.props.children, !noHjelpeskuff && _jsx(Hjelpeskuff, { tjenesteNavn: tjenesteNavn, hjelpetekstId: hjelpetekstId, language: language })] }));\n }\n}\nexport default withErrorBoundary(PageRoot);\n","/**\n * Returnerer Authorized fra HN.rest objektet\n */\nexport const isAuthorized = () => {\n if (typeof document === 'undefined') {\n return false;\n }\n return !!window.HN?.Rest?.Authorized;\n};\n/**\n * Returnerer HashIsAuthorized fra HN.rest objektet\n */\nexport const hashIsAuthorized = () => {\n return window.HN?.Rest?.HashIsAuthorized ?? false;\n};\n","import { theme } from '@helsenorge/designsystem-react';\nexport default {\n isNullToXs: function () {\n return window.matchMedia(`screen and (max-width: ${theme.breakpoints.xs}px)`).matches;\n },\n isXsToSm: function () {\n return window.matchMedia(`screen and (max-width: ${theme.breakpoints.sm}px)`).matches;\n },\n isSmToMd: function () {\n return window.matchMedia(`screen and (max-width: ${theme.breakpoints.md}px)`).matches;\n },\n isMdToLg: function () {\n return window.matchMedia(`screen and (max-width: ${theme.breakpoints.lg}px)`).matches;\n },\n isLgToXl: function () {\n return window.matchMedia(`screen and (max-width: ${theme.breakpoints.xl}px)`).matches;\n },\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport LayoutUtils from '../layout';\n/**\n * @deprecated Bruk useBreakpoint-hook fra @helsenorge/designsystem-react i stedet\n */\nexport default function layoutChange(COMPONENT) {\n class LayoutChangeComponent extends React.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"processResizeEvent\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.updateState();\n }\n });\n Object.defineProperty(this, \"processLayoutChangeEvent\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.updateState();\n }\n });\n Object.defineProperty(this, \"processOrientationEvent\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.updateState();\n }\n });\n Object.defineProperty(this, \"updateState\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n this.setState({\n nullToXs: LayoutUtils.isNullToXs(),\n xsToSm: LayoutUtils.isXsToSm(),\n smToMd: LayoutUtils.isSmToMd(),\n mdToLg: LayoutUtils.isMdToLg(),\n lgToXl: LayoutUtils.isLgToXl(),\n });\n }\n });\n this.state = {\n nullToXs: LayoutUtils.isNullToXs(),\n xsToSm: LayoutUtils.isXsToSm(),\n smToMd: LayoutUtils.isSmToMd(),\n mdToLg: LayoutUtils.isMdToLg(),\n lgToXl: LayoutUtils.isLgToXl(),\n };\n }\n componentDidMount() {\n window.addEventListener('layoutchange', this.processLayoutChangeEvent);\n window.addEventListener('resize', this.processResizeEvent);\n window.addEventListener('orientationchange', this.processOrientationEvent);\n }\n componentWillUnmount() {\n window.removeEventListener('layoutchange', this.processLayoutChangeEvent);\n window.removeEventListener('resize', this.processResizeEvent);\n window.removeEventListener('orientationchange', this.processOrientationEvent);\n }\n render() {\n const { forwardedRef, ...originalProps } = this.props;\n return (_jsx(COMPONENT, { ref: forwardedRef, ...originalProps, nullToXs: this.state.nullToXs, xsToSm: this.state.xsToSm, smToMd: this.state.smToMd, mdToLg: this.state.mdToLg, lgToXl: this.state.lgToXl }));\n }\n }\n const RefForwardingFactory = (props, ref) => _jsx(LayoutChangeComponent, { ...props, forwardedRef: ref });\n return React.forwardRef(RefForwardingFactory);\n}\n","import { createContext, useContext } from 'react';\nimport resources from '../../resources/HN.Core.Filter.NPM.JS.nb-NO.json';\nexport const defaultResources = resources;\nconst ResourcesContext = createContext(defaultResources);\nexport const useResourcesContext = () => useContext(ResourcesContext);\nexport const ResourcesContextProvider = ResourcesContext.Provider;\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { KeyboardEventKey, useFocusToggle, useFocusTrap, useKeyboardEvent } from '@helsenorge/designsystem-react';\nimport styles from './styles.module.scss';\nconst NoScroll = () => (_jsx(\"style\", { children: `body {\n overflow: hidden;\n width: 100vw;\n min-width: 100%;\n}` }));\nconst OffCanvas = props => {\n const { isOpened } = props;\n const [isVisible, setIsVisible] = React.useState(isOpened);\n const wrapperRef = React.useRef(null);\n React.useEffect(() => {\n if (isOpened) {\n setIsVisible(true);\n }\n }, [isOpened]);\n const handleTransitionEnd = () => {\n if (!isOpened) {\n setIsVisible(false);\n }\n };\n useFocusTrap(wrapperRef, isOpened);\n useFocusToggle(wrapperRef, isOpened);\n const handleKeyboardEvent = (e) => {\n e.stopPropagation();\n e.preventDefault();\n props.onClose();\n };\n useKeyboardEvent(wrapperRef, handleKeyboardEvent, [KeyboardEventKey.Escape]);\n const wrapperClasses = classNames(styles.offcanvas, { [styles['offcanvas--open']]: isOpened, [styles['offcanvas--not-visible']]: !isVisible }, props.className);\n const contentClasses = classNames(styles.offcanvas__content, { [styles['offcanvas__content--is-loading']]: props.isLoading });\n return (_jsxs(\"div\", { ref: wrapperRef, className: wrapperClasses, onTransitionEnd: handleTransitionEnd, children: [isOpened && _jsx(NoScroll, {}), _jsx(\"div\", { className: styles.offcanvas__header, children: props.header }), _jsx(\"div\", { className: contentClasses, children: props.children }), props.afterContent] }));\n};\nexport default OffCanvas;\n","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React from 'react';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Dropdown from '@helsenorge/designsystem-react/components/Dropdown';\nimport FormGroup from '@helsenorge/designsystem-react/components/FormGroup';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronLeft from '@helsenorge/designsystem-react/components/Icons/ChevronLeft';\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport { useResourcesContext } from './resources';\nimport OffCanvas from '../offcanvas';\nimport styles from './styles.module.scss';\nconst FilterGroup = (props) => {\n const { isMobile, label, placeholder, children, onClose } = props;\n const [showMobileFilterState, setShowMobileFilterState] = React.useState(false);\n const resources = useResourcesContext();\n const handleToggleMobileFilterState = () => {\n setShowMobileFilterState(!showMobileFilterState);\n };\n const offCanvasHeader = (_jsx(_Fragment, { children: _jsxs(Button, { variant: 'borderless', onClick: handleToggleMobileFilterState, children: [_jsx(Icon, { svgIcon: ChevronLeft }), resources.mobileBackToFilters] }) }));\n return (_jsx(\"div\", { children: isMobile ? (_jsxs(_Fragment, { children: [_jsx(Button, { className: styles['filter-options__mobile-button'], \"aria-expanded\": showMobileFilterState, onClick: handleToggleMobileFilterState, arrow: \"icon\", fluid: true, variant: 'outline', children: label || resources.filterGroupLabel }), _jsxs(OffCanvas, { header: offCanvasHeader, isOpened: showMobileFilterState, onClose: () => {\n onClose && onClose();\n handleToggleMobileFilterState();\n }, children: [_jsx(FormGroup, { legend: label, name: label, children: children }), _jsx(Spacer, { size: 'xs' }), _jsx(Button, { onClick: () => {\n onClose && onClose();\n handleToggleMobileFilterState();\n }, className: \"right\", children: resources.mobileApplyFilter })] })] })) : (_jsx(\"div\", { className: styles['filter-options__dropdown'], children: _jsx(Dropdown, { onToggle: isOpened => {\n !isOpened && onClose && onClose();\n }, placeholder: placeholder || resources.filterGroupPlaceholder, label: label || resources.filterGroupLabel, closeText: resources.filterGroupClose, children: children }) })) }));\n};\nFilterGroup.displayName = 'FilterGroup';\nexport default FilterGroup;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport Select from '@helsenorge/designsystem-react/components/Select';\nconst DesktopSort = React.forwardRef((props, ref) => {\n const [maxLabelLength, setMaxLabelLength] = React.useState(10);\n const handleSort = event => {\n props.onSort && props.onSort(event.target.value);\n };\n React.useEffect(() => {\n if (props.children.length > 0) {\n const newMaxLabelLength = Math.max(10, ...props.children.map(child => (child.label ? child.label.length : child.value?.length || 10)));\n setMaxLabelLength(newMaxLabelLength);\n }\n }, [props.children]);\n return (_jsx(Select, { label: props.label, width: maxLabelLength, disabled: props.disabled, onChange: handleSort, ref: ref, defaultValue: props.sortKey, wrapperClassName: props.selectClasses, children: props.children.map(child => (_jsx(\"option\", { value: child.value, children: child.label || child.value }, child.key || child.label || child.value))) }));\n});\nDesktopSort.displayName = 'DesktopSort';\nexport default DesktopSort;\n","import { useEffect, useState } from 'react';\nexport const useStateValue = (value) => {\n const [stateValue, setStateValue] = useState(value);\n useEffect(() => {\n setStateValue(value);\n }, [value]);\n const resetStateValue = () => setStateValue(value);\n return [stateValue, setStateValue, resetStateValue];\n};\n","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport FormGroup from '@helsenorge/designsystem-react/components/FormGroup';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronLeft from '@helsenorge/designsystem-react/components/Icons/ChevronLeft';\nimport RadioButton from '@helsenorge/designsystem-react/components/RadioButton';\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport { useResourcesContext } from './resources';\nimport { useStateValue } from './useStateValue';\nimport OffCanvas from '../offcanvas';\nconst MobileSort = props => {\n const [isOpen, setIsOpen] = React.useState(false);\n const [sortKey, setSortKey, resetSortKey] = useStateValue(props.sortKey);\n const resources = useResourcesContext();\n const handleOpen = () => {\n setIsOpen(true);\n };\n const handleClose = (cb) => {\n setIsOpen(false);\n resetSortKey();\n if (cb) {\n cb(false);\n }\n };\n const handleShowResults = () => {\n props.onSort && sortKey && props.onSort(sortKey);\n handleClose(props.toggleShowFilters);\n };\n const handleSort = event => {\n setSortKey(event.target.value);\n };\n const offCanvasHeader = (_jsxs(_Fragment, { children: [_jsxs(Button, { variant: 'borderless', onClick: () => handleClose(), children: [_jsx(Icon, { svgIcon: ChevronLeft }), resources.mobileBackToFilters] }), _jsx(Spacer, { size: 'xs' }), _jsx(Button, { onClick: handleShowResults, className: \"right\", children: resources.mobileShowResults })] }));\n return (_jsxs(_Fragment, { children: [_jsx(Button, { \"aria-expanded\": isOpen, onClick: handleOpen, arrow: \"icon\", fluid: true, variant: 'outline', children: resources.mobileSortOn }), _jsx(OffCanvas, { header: offCanvasHeader, isOpened: isOpen, onClose: handleClose, children: _jsx(FormGroup, { legend: props.label, name: props.label, children: props.children.map(child => (_jsx(RadioButton, { disabled: props.disabled, defaultChecked: sortKey === child.value, label: child.label || child.value, value: child.value, ref: child.ref, onChange: handleSort }, child.key || child.label || child.value))) }) })] }));\n};\nexport default MobileSort;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from 'react';\nimport DesktopSort from './desktop-sort';\nimport MobileSort from './mobile-sort';\nimport styles from './styles.module.scss';\nconst FilterSortWrapper = ({ children }) => (_jsx(\"div\", { className: styles['filter-sort-wrapper'], children: children }));\nconst FilterSort = React.forwardRef((props, ref) => {\n if (props.isMobile) {\n return (_jsx(FilterSortWrapper, { children: _jsx(MobileSort, { sortKey: props.sortKey, disabled: props.disabled, label: props.label, onSort: props.onSort, toggleShowFilters: props.toggleShowFilters, children: props.children }) }));\n }\n return (_jsx(FilterSortWrapper, { children: _jsx(DesktopSort, { selectClasses: props.selectClasses, sortKey: props.sortKey, disabled: props.disabled, label: props.label, onSort: props.onSort, ref: ref, children: props.children }) }));\n});\nFilterSort.displayName = 'FilterSort';\nexport default FilterSort;\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport Checkbox from '@helsenorge/designsystem-react/components/Checkbox';\nimport Chip from '@helsenorge/designsystem-react/components/Chip';\nimport Expander, { ExpanderSize } from '@helsenorge/designsystem-react/components/Expander';\nimport FormGroup from '@helsenorge/designsystem-react/components/FormGroup';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport ChevronLeft from '@helsenorge/designsystem-react/components/Icons/ChevronLeft';\nimport NoFilter from '@helsenorge/designsystem-react/components/Icons/NoFilter';\nimport Loader from '@helsenorge/designsystem-react/components/Loader';\nimport Spacer from '@helsenorge/designsystem-react/components/Spacer';\nimport Tag from '@helsenorge/designsystem-react/components/Tag';\nimport TagList from '@helsenorge/designsystem-react/components/TagList';\nimport { isComponent } from '@helsenorge/designsystem-react/utils/component';\nimport { isMobileUA } from '@helsenorge/designsystem-react/utils/mobile';\nimport uuid from '@helsenorge/designsystem-react/utils/uuid';\nimport { DateFormat, safeFormatCET } from '@helsenorge/core-utils/date-fns-utils';\nimport FilterGroup from './filter-group';\nimport FilterSort from './filter-sort';\nimport { ResourcesContextProvider, defaultResources } from './resources';\nimport OffCanvas from '../offcanvas';\nimport styles from './styles.module.scss';\nexport var Status;\n(function (Status) {\n Status[\"Ready\"] = \"ready\";\n Status[\"LoadingResults\"] = \"loading-results\";\n})(Status || (Status = {}));\nconst moveSortLast = (a, b) => {\n if (a.type === 'sort' && b.type !== 'sort') {\n return 1; // Move filter-sort towards the end\n }\n else if (a.type !== 'sort' && b.type === 'sort') {\n return -1; // Keep other types towards the beginning\n }\n return 0; // Keep original order if same type\n};\nexport const Filter = props => {\n const { afterHeadingChildren, afterActiveFiltersChildren, activeFilters, extraFilterOptions, showFilters = false, filterOptions, footerContent, isAlwaysOpen, isDisabled, allowMobileView = true, numResults, status, statusText, onFilterOpen, onSubmit, searchBelowFilter, searchFilter, } = props;\n const resources = { ...defaultResources, ...props.resources };\n const isMobile = allowMobileView && isMobileUA();\n const [prevActiveFilters, setPrevActiveFilters] = React.useState(activeFilters);\n const [showFiltersState, setShowFiltersState] = React.useState(!isMobile && showFilters);\n const isLoading = status === Status.LoadingResults;\n const isSlowSearch = typeof onSubmit !== 'undefined';\n React.useEffect(() => {\n if (!isMobile && typeof showFilters !== 'undefined') {\n setShowFiltersState(showFilters);\n }\n }, [showFilters]);\n React.useEffect(() => {\n onFilterOpen && onFilterOpen(showFiltersState);\n }, [showFiltersState]);\n const toggleShowMainFilter = () => {\n if (!isDisabled) {\n setShowFiltersState(!showFiltersState);\n }\n };\n const onSubmitHandler = () => {\n setPrevActiveFilters(activeFilters ?? []);\n onSubmit && onSubmit();\n isMobile && toggleShowMainFilter();\n };\n const isFilterResultSubmitted = () => {\n return JSON.stringify(prevActiveFilters) === JSON.stringify(activeFilters);\n };\n const resetActiveFilters = () => {\n activeFilters?.forEach(af => {\n af.handleRemove();\n });\n };\n const activeFilterTag = (af) => {\n if (af.value instanceof Date) {\n return safeFormatCET(af.value, DateFormat.ShortDate);\n }\n else if (typeof af.value === 'object') {\n return af.value?.displayText ?? af.value?.value;\n }\n else if (af.value !== undefined) {\n return af.value;\n }\n else {\n return '';\n }\n };\n const renderActiveFilters = () => activeFilters &&\n activeFilters.length > 0 && (_jsx(\"div\", { className: classNames(styles['active-filters'], {\n [styles['active-filters--desktop']]: !isMobile,\n [styles['active-filters--no-bottom-spacing']]: (!isMobile && searchBelowFilter && showFiltersState) || afterActiveFiltersChildren,\n }), children: !isLoading && (_jsxs(_Fragment, { children: [_jsx(\"span\", { className: styles['active-filters__label'], children: resources.selectedFilters }), _jsx(\"div\", { className: styles['active-filters__tags-container'], children: isSlowSearch ? renderTags(activeFilters) : renderChips(activeFilters) })] })) }));\n const renderTags = (activeFilters) => {\n return (_jsx(TagList, { children: activeFilters.map(af => (_jsx(\"span\", { className: styles['active-filters__tag'], children: _jsx(Tag, { color: \"blueberry\", size: \"medium\", variant: \"normal\", children: activeFilterTag(af) }) }, af.name))) }));\n };\n const renderChips = (activeFilters) => {\n return (_jsxs(TagList, { children: [activeFilters.map(af => (_jsx(\"span\", { className: styles['active-filters__tag'], children: _jsx(Chip, { action: \"remove\", color: \"blueberry\", onClick: () => af.handleRemove(), size: \"medium\", variant: \"normal\", children: activeFilterTag(af) }) }, af.name))), activeFilters.length > 1 && (_jsxs(Button, { onClick: resetActiveFilters, variant: 'borderless', children: [_jsx(Icon, { svgIcon: NoFilter }), 'Nullstill filter'] }))] }));\n };\n const renderFilterOptions = (filterOptions, isInsideFilter) => {\n const sortedFilterOptions = isMobile ? [...filterOptions].sort(moveSortLast) : filterOptions;\n const renderChildren = (children) => {\n return React.Children.map(children, (child, index) => {\n if (isComponent(child, Checkbox)) {\n return (_jsx(\"div\", { className: styles['filter-options__checkbox'], children: child }, child.key || index + uuid()));\n }\n if (isComponent(child, React.Fragment)) {\n return React.Children.map(child.props.children, (child) => {\n return renderChildren(child);\n });\n }\n return _jsx(\"div\", { className: styles['filter-options__item'], children: child });\n });\n };\n return sortedFilterOptions.map((fo, index) => {\n switch (fo.type) {\n case 'inline':\n return renderChildren(fo.children);\n case 'sort': {\n return (_jsx(FilterSort, { selectClasses: classNames({ [styles['filter-sort-wrapper--right']]: !isInsideFilter }), sortKey: fo.defaultValue, isMobile: isMobile, onSort: fo.onSort, label: fo.label, toggleShowFilters: !onSubmit && isInsideFilter ? toggleShowMainFilter : undefined, children: fo.children }, index + uuid()));\n }\n case 'dropdown': {\n return (_jsx(FilterGroup, { onClose: fo.onClose, isMobile: isMobile, label: fo.label, placeholder: fo.placeholder, children: fo.children }));\n }\n }\n });\n };\n const renderSlowSearchSubmitButton = () => {\n return isSlowSearch ? (_jsx(Button, { onClick: onSubmitHandler, disabled: isFilterResultSubmitted(), wrapperClassName: classNames(!isMobile && styles['filter-options__submit-button-desktop']), children: isFilterResultSubmitted() ? resources.updateFilterButtonDisabledText : resources.updateFilterButtonText })) : isMobile ? (_jsx(Button, { onClick: toggleShowMainFilter, children: resources.showResults })) : null;\n };\n const renderFilter = isLoading ? (_jsx(Loader, { center: true, size: 'small', ariaLabel: resources.loadingResults })) : (_jsxs(\"div\", { className: styles['filters-content'], children: [searchFilter && !searchBelowFilter && _jsx(\"div\", { children: searchFilter }), filterOptions && (_jsxs(FormGroup, { htmlMarkup: 'div', fieldsetClassName: styles['filter-options'], renderError: false, children: [renderFilterOptions(filterOptions, true), !isMobile && renderSlowSearchSubmitButton()] })), extraFilterOptions && (_jsx(Expander, { title: resources.showSecondaryFilters, children: _jsx(FormGroup, { htmlMarkup: 'div', fieldsetClassName: classNames(styles['filter-options'], styles['filter-options--extra']), renderError: false, children: renderFilterOptions(extraFilterOptions, true) }) }))] }));\n const offCanvasHeader = (_jsxs(_Fragment, { children: [isSlowSearch && (_jsxs(_Fragment, { children: [_jsxs(Button, { variant: 'borderless', onClick: () => {\n toggleShowMainFilter();\n }, children: [_jsx(Icon, { svgIcon: ChevronLeft }), resources.cancel] }), _jsx(Spacer, { size: '2xs' })] })), renderSlowSearchSubmitButton()] }));\n const renderDesktopFilter = (children) => {\n const renderAfterHeadingChildren = afterHeadingChildren && (_jsx(\"div\", { className: classNames(styles['after-heading'], { [styles['after-heading--search-below-filter']]: searchBelowFilter }), children: afterHeadingChildren }));\n const noBottomPaddingClass = classNames({\n [styles['filter-desktop--no-bottom-spacing']]: searchBelowFilter || (activeFilters && activeFilters.length > 0),\n });\n return isAlwaysOpen ? (_jsxs(\"div\", { className: classNames(styles['filter-desktop'], noBottomPaddingClass), children: [_jsxs(\"div\", { className: styles['title-container'], children: [_jsx(\"span\", { className: styles['title'], children: resources.filterTitle }), renderAfterHeadingChildren] }), children] })) : (_jsxs(Expander, { renderChildrenWhenClosed: true, size: ExpanderSize.large, onExpand: (expanded) => setShowFiltersState(expanded), expanded: showFiltersState, noNestedLine: true, title: resources.filterTitle, contentClassNames: noBottomPaddingClass, children: [renderAfterHeadingChildren, children] }));\n };\n const counter = !isLoading ? _jsx(\"span\", { className: styles['numresults'], children: numResults }) : null;\n return (_jsxs(ResourcesContextProvider, { value: resources, children: [isMobile ? (_jsxs(_Fragment, { children: [_jsx(Button, { \"aria-expanded\": showFiltersState, onClick: toggleShowMainFilter, arrow: \"icon\", fluid: true, variant: 'outline', children: resources.toggleFilterAndSort }), _jsxs(OffCanvas, { header: offCanvasHeader, isLoading: isLoading, isOpened: showFiltersState, onClose: toggleShowMainFilter, children: [_jsxs(\"div\", { className: styles['title-container'], children: [_jsx(\"span\", { className: styles['title'], children: resources.filterHeading }), afterHeadingChildren && (_jsx(\"div\", { className: classNames(styles['after-heading'], { [styles['after-heading--mobile']]: isMobile }), children: afterHeadingChildren })), _jsxs(\"span\", { \"aria-live\": \"polite\", \"aria-atomic\": \"true\", children: [_jsxs(\"span\", { className: styles['numresults--hidden'], children: [resources.numResults, \" \"] }), counter] })] }), renderFilter] })] })) : (_jsx(\"div\", { className: styles['filters-wrapper'], children: renderDesktopFilter(renderFilter) })), renderActiveFilters(), afterActiveFiltersChildren && (_jsx(\"div\", { className: classNames(styles['after-active-filters'], {\n [styles['after-active-filters--desktop']]: !isMobile,\n }), children: afterActiveFiltersChildren })), searchFilter && searchBelowFilter && !isLoading && (showFiltersState || isMobile) && (_jsx(\"div\", { className: classNames(styles['filter-search-below-filter-wrapper'], {\n [styles['filter-search-below-filter-wrapper--mobile']]: isMobile,\n }), children: searchFilter })), _jsxs(\"div\", { className: classNames(styles['filter-footer'], { [styles['filter-footer--is-mobile']]: isMobile }), children: [statusText && (_jsx(\"span\", { className: styles['filter-footer__numresults'], \"aria-live\": \"polite\", \"aria-atomic\": \"true\", role: \"status\", children: isLoading ? (_jsx(Loader, { inline: true, size: 'tiny', ariaLabel: resources.loadingResults })) : (_jsxs(_Fragment, { children: [_jsx(\"span\", { className: styles['filter-footer__numresults--hidden'], children: resources.numResults }), ` ${statusText}`] })) })), footerContent && (_jsx(FormGroup, { className: styles['filter-options-wrapper'], htmlMarkup: 'div', fieldsetClassName: styles['filter-options'], renderError: false, children: renderFilterOptions(footerContent, false) }))] })] }));\n};\nexport default Filter;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useState } from 'react';\nexport const useFilters = (props) => {\n const [filters, setFilters] = useState(props?.defaultValues);\n const [delayedFilters, setDelayedFilters] = useState();\n const [searchQuery, setSearchQuery] = useState(props?.searchQuery);\n const [sortKey, setSortKey] = useState(props?.sortKey);\n const setFilter = (name, value) => setFilters(prevState => {\n return { ...prevState, [name]: value }; /** @todo fjern denne assertionen */\n });\n const setDelayedFilter = (name, value) => setDelayedFilters(prevState => {\n return { ...prevState, [name]: value }; /** @todo fjern denne assertionen */\n });\n const updateFilters = () => {\n setFilters(Object.assign({}, filters, delayedFilters));\n };\n const removeFilterFromState = (name, prevState) => {\n if (prevState) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [name]: _, ...rest } = prevState;\n return rest /** @todo fjern denne assertionen */;\n }\n };\n const activeFilters = filters &&\n Object.keys(filters)\n .filter(x => !!filters[x] &&\n filters[x] !== undefined &&\n filters[x] !== '' &&\n (typeof filters[x] !== 'object' || filters[x]?.value !== ''))\n .map(name => ({\n name,\n value: filters[name],\n handleRemove: () => {\n setFilters(prevState => removeFilterFromState(name, prevState));\n setDelayedFilters(prevState => removeFilterFromState(name, prevState));\n },\n }));\n return {\n filters,\n setFilter,\n setDelayedFilter,\n activeFilters,\n searchQuery,\n setSearchQuery,\n sortKey,\n setSortKey,\n updateFilters,\n };\n};\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport Loader from '@helsenorge/designsystem-react/components/Loader';\nimport NotificationPanel from '@helsenorge/designsystem-react/components/NotificationPanel';\nimport { getCorrelationIdList } from '@helsenorge/framework-utils/hn-proxy-service';\nimport ErrorMessage from '../error-message';\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction isEmpty(obj) {\n return !obj || Object.keys(obj).length === 0;\n}\nconst PageLoader = props => {\n let data;\n let error = null;\n let warning = null;\n let info = null;\n const spinning = (!props.ignoreResources && isEmpty(props.resources)) || props.loading;\n if (spinning) {\n data = _jsx(Loader, { center: true, ...props.loaderProps });\n }\n else {\n if (props.info) {\n info = (_jsx(NotificationPanel, { variant: 'info', label: props.info, labelId: props.labelId, children: _jsx(\"p\", { children: props.infoDescription }) }, \"info\"));\n }\n if (props.warning) {\n warning = (_jsxs(NotificationPanel, { variant: 'warn', label: props.warning, labelId: !props.info ? props.labelId : undefined, children: [_jsx(\"p\", { children: props.warningDescription }), _jsx(\"p\", { children: props.warningContent })] }, \"warning\"));\n }\n if (props.error) {\n const correlationId = getCorrelationIdList()?.join(', ');\n error = (_jsx(ErrorMessage, { label: props.error, labelId: !props.info && !props.warning ? props.labelId : undefined, description: props.errorDescription, correlationId: correlationId }));\n if (props.showChildrenOnError) {\n data = props.children;\n }\n }\n else {\n data = props.children;\n }\n }\n const ariaAttributes = props.live\n ? {\n 'aria-busy': spinning,\n 'aria-live': 'polite',\n }\n : undefined;\n return (_jsxs(\"div\", { ...ariaAttributes, \"data-testid\": props.testId, children: [info, warning, error, data] }));\n};\nexport default PageLoader;\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport classnames from 'classnames';\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport styles from './styles.module.scss';\nconst SubContent = ({ countShowing, error, data, showMorePageSize, showMoreButtonClasses, showMoreButtonText, updateCountShowing, }) => {\n const subContentClasses = classnames({\n [styles['table__sub-content']]: true,\n [styles['table__sub-content--has-error']]: !!error,\n });\n return (_jsxs(_Fragment, { children: [_jsx(\"div\", { className: subContentClasses, children: !!error && _jsx(\"p\", { children: `Temporary error msg: ${error.Title} ${error.Body}` }) }), showMorePageSize && countShowing && data && countShowing < data.length ? (_jsx(Button, { wrapperClassName: showMoreButtonClasses, onClick: updateCountShowing, children: showMoreButtonText })) : null] }));\n};\nexport default SubContent;\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { TableHeadCell, SortDirection } from '@helsenorge/designsystem-react/components/Table';\nfunction reverseSortDirection(sortDir) {\n return sortDir === SortDirection.desc ? SortDirection.asc : SortDirection.desc;\n}\nexport const createHeaders = (columns, colSortDirs, onHeaderClickSortChange, initialSortColumnKey, sortDisabled, sortColumnKey, expandableRow, isTwoDimensional, sortedData) => {\n const headers = [];\n if ((expandableRow || isTwoDimensional) && sortedData && sortedData.length > 0) {\n headers.push(_jsx(TableHeadCell, {}, \"expandableHeader\"));\n }\n for (let i = 0; i < columns.length; ++i) {\n const column = columns[i];\n const title = column.props.title;\n const altTitle = (_jsxs(_Fragment, { children: [column.props.altTitle, _jsx(\"br\", {})] })) ?? null;\n const name = column.props.name;\n const headerkey = `header${i}`;\n const sortDirection = colSortDirs[name];\n if (initialSortColumnKey && sortDisabled) {\n headers.push(_jsxs(TableHeadCell, { sortable: false, children: [altTitle, title] }));\n }\n else if (column.props.sortable && sortedData && sortedData.length > 0) {\n headers.push(_jsxs(TableHeadCell, { sortable: true, sortDir: sortDirection, onClick: () => {\n onHeaderClickSortChange(name, sortDirection ? reverseSortDirection(sortDirection) : 'asc');\n }, children: [altTitle, title] }, name));\n }\n else if (name === sortColumnKey && sortedData && sortedData.length > 0) {\n headers.push(_jsxs(TableHeadCell, { sortable: false, sortDir: sortDirection, children: [altTitle, title] }, name));\n }\n else {\n headers.push(_jsxs(TableHeadCell, { children: [altTitle, title] }, headerkey));\n }\n }\n return headers;\n};\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport { TableCell } from '@helsenorge/designsystem-react/components/Table';\nimport styles from '../table/styles.module.scss';\nexport class Cell extends React.Component {\n highlightText(text, highlight) {\n const highlightStartIndex = text.toLowerCase().indexOf(highlight.toLowerCase());\n if (highlightStartIndex >= 0) {\n const highlightEndIndex = highlightStartIndex + highlight.length;\n const textStart = text.substr(0, highlightStartIndex);\n const textHighlight = text.substr(highlightStartIndex, highlight.length);\n const textEnd = text.substr(highlightEndIndex);\n return (_jsxs(\"span\", { children: [textStart, _jsx(\"span\", { className: styles['table__highlight-text'], children: textHighlight }), textEnd] }));\n }\n return text;\n }\n highlightContent(children, highlightText) {\n const highlightedContent = React.Children.map(children, (child) => {\n if (typeof child === 'string') {\n return this.highlightText(child.toString(), highlightText);\n }\n if (child) {\n const childProps = child.props;\n if (childProps && childProps.children) {\n const highlightedChildren = this.highlightContent(childProps.children, highlightText);\n return Object.assign({}, child, { props: Object.assign({}, childProps, { children: highlightedChildren }) });\n }\n }\n return child;\n });\n return highlightedContent;\n }\n render() {\n const { children, highlightText, columnKey } = this.props;\n const content = highlightText ? this.highlightContent(children, highlightText) : children;\n return (_jsx(TableCell, { dataLabel: columnKey || '', textAlign: this.props.textAlign, children: content }));\n }\n}\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport { TableExpanderCell, TableRow } from '@helsenorge/designsystem-react/components/Table';\nimport { Cell } from './cell';\nexport class Row extends React.PureComponent {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"triggerRef\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"toggleClick\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n const { expandableRowKey, rowKey, toggle } = this.props;\n if (toggle && expandableRowKey) {\n toggle(expandableRowKey, rowKey);\n }\n }\n });\n Object.defineProperty(this, \"focusOnTrigger\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (this.triggerRef.current) {\n this.triggerRef.current.focus();\n }\n }\n });\n this.triggerRef = React.createRef();\n }\n createRow(columns, rowData, expandableRow, expanded) {\n const { tableId, expandableRowKey, isTwoDimensional, showDetailsText = 'Vis', hideDetailsText = 'Skjul', highlightText } = this.props;\n const newColumns = [];\n const expandableRowId = !isTwoDimensional ? `${tableId}-${expandableRowKey}` : '';\n if (expandableRow) {\n // Expand trigger column. Hidden on smaller screens.\n newColumns.push(_jsx(TableExpanderCell, { expanded: expanded, hideDetailsText: hideDetailsText, showDetailsText: showDetailsText, expandableRowId: expandableRowId }));\n }\n for (let i = 0; i < columns.length; ++i) {\n const column = columns[i];\n const element = column.props.cell;\n if (React.isValidElement(element)) {\n const props = {\n columnKey: `${column.props.altTitle ? `${column.props.altTitle} / ` : ``}${column.props.title}`,\n rowData,\n key: column.props.name,\n highlightText: highlightText,\n altTitle: column.props.altTitle,\n };\n if (column.props.cell) {\n newColumns.push(React.cloneElement(element, Object.assign({}, column.props.cell.props, props)));\n }\n }\n else {\n let processedJsonObjectName;\n let rowValue;\n const processedColName = column.props.name.split('.');\n if (processedColName.length > 1) {\n const temp = rowData[processedColName[0]];\n rowValue = temp[processedColName[1]];\n }\n else {\n processedJsonObjectName = processedColName[0];\n rowValue = rowData[processedJsonObjectName];\n }\n newColumns.push(_jsx(Cell, { columnKey: column.props.title, rowData: rowData, highlightText: highlightText, children: rowValue }, column.props.name));\n }\n }\n return newColumns;\n }\n render() {\n const { rowData, columns, rowClasses, expandableRow, expanded } = this.props;\n let cells = null;\n if (columns) {\n cells = this.createRow(columns, rowData, !!expandableRow, expanded);\n }\n return (_jsx(TableRow, { className: rowClasses, onClick: this.toggleClick, expandable: expandableRow, expanded: expanded, hideDetailsText: this.props.hideDetailsText, showDetailsText: this.props.showDetailsText, children: cells }, this.props.rowKey));\n }\n}\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport { SortDirection } from '@helsenorge/designsystem-react/components/Table';\nimport { Row } from './row';\nexport const sortIndexes = (columnKey, sortDir, data, useNumericSort, customSetSortValue) => {\n const sortIndexes = data.slice();\n sortIndexes.sort((a, b) => {\n let valueA;\n let valueB;\n const processedColNameValue = columnKey.split('.');\n if (processedColNameValue.length > 1) {\n const tempA = a[processedColNameValue[0]];\n const tempB = b[processedColNameValue[0]];\n valueA = tempA[processedColNameValue[1]];\n valueB = tempB[processedColNameValue[1]];\n }\n else {\n const columnValue = processedColNameValue[0];\n valueA = a[columnValue];\n valueB = b[columnValue];\n }\n if (!valueA) {\n valueA = '';\n }\n if (!valueB) {\n valueB = '';\n }\n if (customSetSortValue) {\n valueA = customSetSortValue(a, valueA, columnKey);\n valueB = customSetSortValue(b, valueB, columnKey);\n }\n const compareOptions = useNumericSort ? { numeric: true, sensitivity: 'base' } : {};\n let sortVal = 0;\n sortVal = valueA.localeCompare(valueB, 'nb', compareOptions);\n if (sortVal !== 0 && sortDir === SortDirection.desc) {\n sortVal = sortVal * -1;\n }\n return sortVal;\n });\n return sortIndexes;\n};\nexport const isTableTwoDimensional = (data, columns) => {\n for (const rowData of data) {\n for (const column of columns) {\n if (Array.isArray(rowData[column.props.name])) {\n return true;\n }\n }\n }\n return false;\n};\nexport const createLevel2Rows = (rowData, isExpanded, rowKey, columns) => {\n const rows = [];\n if (columns) {\n for (const column of columns) {\n if (!Array.isArray(rowData[column.props.name])) {\n continue;\n }\n if (!column.props.level2Cells) {\n continue;\n }\n const childRows = rowData[column.props.name];\n for (let j = 0; j < childRows.length; j++) {\n const childRowKey = `${rowKey}_${column.props.name}_${j}`;\n rows.push(React.cloneElement(column.props.level2Cells, {\n key: childRowKey,\n columns: columns,\n rowData: childRows[j],\n expandableRow: true,\n expanded: isExpanded,\n index: j,\n total: childRows.length,\n }));\n }\n }\n }\n return rows;\n};\nexport const createRows = (tableId, data, toggleExpandRow, getOrCreateRowRef, rowKeyColumnKey, highlightText, emptyContentText, emptyContentElement, columns, isTwoDimensional, expandableRow, expandedRows, className) => {\n const showDetailsText = 'Vis detaljer'; // TODO: Replace with resource values\n const hideDetailsText = 'Skjul detaljer'; // TODO: Replace with resource values\n const rows = [];\n for (let index = 0; index < data.length; ++index) {\n let rowKey = `row${index}`;\n const expandableRowKey = `expandableRow${index}`;\n const rowData = data[index];\n if (rowKeyColumnKey && rowData[rowKeyColumnKey]) {\n rowKey = rowData[rowKeyColumnKey];\n }\n const isExpanded = expandedRows ? !!expandedRows[expandableRowKey] : false;\n const isExpandableRow = expandableRow !== null || !!isTwoDimensional;\n rows.push(_jsx(Row, { tableId: tableId, ref: getOrCreateRowRef(rowKey), rowData: rowData, columns: columns, rowClasses: className, expandableRow: isExpandableRow, expanded: isExpanded, toggle: toggleExpandRow, highlightText: highlightText, showDetailsText: showDetailsText, hideDetailsText: hideDetailsText, rowKey: rowKey, expandableRowKey: expandableRowKey, isTwoDimensional: !!isTwoDimensional }, rowKey));\n const level2Rows = createLevel2Rows(rowData, isExpanded, rowKey, columns);\n rows.push(...level2Rows);\n if (expandableRow && React.isValidElement(expandableRow)) {\n const props = {\n colspan: columns ? columns.length + 1 : 0,\n rowData,\n key: expandableRowKey,\n open: isExpanded,\n toggle: toggleExpandRow,\n hideDetailsText: hideDetailsText,\n expandableRowKey,\n tableId: tableId,\n };\n rows.push(React.cloneElement(expandableRow, props));\n }\n }\n if (rows.length === 0) {\n // TODO: Replace fallback text with resource values\n const label = columns && columns[0] ? columns[0].props.title : '';\n rows.push(_jsx(\"tr\", { children: _jsxs(\"td\", { \"data-label\": label, colSpan: columns ? columns.length : 0, children: [_jsx(\"em\", { children: emptyContentText }), emptyContentElement ? emptyContentElement : null] }) }, 'noContentRow'));\n }\n return rows;\n};\nconst isColumn = (child) => child['type'].isExpandableRow || child['type'].isColumn;\nexport const checkChildren = (props) => {\n const columns = [];\n let expandableRow = null;\n React.Children.forEach(props.children, child => {\n if (child === null) {\n return;\n }\n if (isColumn(child)) {\n if (child['type'].isExpandableRow) {\n expandableRow = child;\n }\n if (child['type'].isColumn) {\n columns.push(child);\n }\n }\n });\n return { columns, expandableRow };\n};\nexport const updateColumns = (props) => {\n const childrenProps = checkChildren(props);\n return childrenProps.columns;\n};\n","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport classnames from 'classnames';\nimport Table, { TableBody, TableHead, HeaderCategory, SortDirection, TableRow, } from '@helsenorge/designsystem-react/components/Table';\nimport designsystemtypography from '@helsenorge/designsystem-react/scss/typography.module.scss';\nimport SubContent from './sub-content';\nimport { createHeaders } from './table-head-helper';\nimport { sortIndexes, isTableTwoDimensional, createRows, checkChildren, updateColumns } from './table-helper';\nimport styles from './styles.module.scss';\nexport class DataTable extends React.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"rowRefs\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"componentDidUpdate\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (_prevProps, prevState) => {\n // Fokus på siste rad idet Hent flere-knapp ikke vises lenger\n if (this.props.data?.length &&\n this.props.showMoreButtonText &&\n prevState.countShowing !== this.state.countShowing &&\n this.state.countShowing === this.props.data.length) {\n const rowKey = `row${this.props.data.length - 1}`;\n if (Object.prototype.hasOwnProperty.call(this.rowRefs, rowKey)) {\n this.rowRefs[rowKey].current?.focusOnTrigger();\n }\n }\n }\n });\n Object.defineProperty(this, \"getOrCreateRowRef\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (rowKey) => {\n if (!Object.prototype.hasOwnProperty.call(this.rowRefs, rowKey)) {\n this.rowRefs[rowKey] = React.createRef();\n }\n return this.rowRefs[rowKey];\n }\n });\n Object.defineProperty(this, \"onHeaderClickSortChange\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (columnKey, sortDir) => {\n if (this.props.sortDisabled) {\n this.setState({\n currentSortDir: sortDir,\n currentSortKey: columnKey,\n });\n if (this.props.onSortColumn) {\n this.props.onSortColumn(columnKey, sortDir === SortDirection.asc, true, true);\n }\n }\n else {\n this.onSortChange(columnKey, sortDir, this.state.sortedData ? this.state.sortedData : [], true);\n }\n }\n });\n Object.defineProperty(this, \"onSortChange\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (columnKey, sortDir, data, isClicked) => {\n const sortedData = sortIndexes(columnKey, sortDir, data, this.props.useNumericSort, this.props.customSetSortValue);\n this.setState({\n sortedData: sortedData,\n colSortDirs: {\n [columnKey]: sortDir,\n },\n currentSortDir: sortDir,\n currentSortKey: columnKey,\n sortedByUserClick: isClicked ? isClicked : false,\n expandedRows: {},\n }, this.sortStateChanged);\n }\n });\n Object.defineProperty(this, \"sortStateChanged\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (this.props.onSortColumn) {\n this.props.onSortColumn(this.state.currentSortKey ? this.state.currentSortKey : '', this.state.currentSortDir === SortDirection.asc, this.state.sortedByUserClick, this.props.sortDisabled);\n }\n }\n });\n Object.defineProperty(this, \"toggleExpandRow\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (expandableRowKey) => {\n const expanded = !!this.state.expandedRows && this.state.expandedRows[expandableRowKey];\n this.setState({ expandedRows: Object.assign({}, this.state.expandedRows, { [expandableRowKey]: !expanded }) });\n }\n });\n Object.defineProperty(this, \"updateCountShowing\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (event) => {\n if (event) {\n event.preventDefault();\n }\n if (this.props.data && this.props.showMorePageSize && this.state.countShowing) {\n const newCountShowing = this.state.countShowing + this.props.showMorePageSize;\n if (newCountShowing <= this.props.data.length) {\n this.setState({\n countShowing: newCountShowing,\n });\n }\n else if (this.state.countShowing < this.props.data.length) {\n this.setState({\n countShowing: this.props.data.length,\n });\n }\n }\n }\n });\n const { initialSortColumnKey, initialSortDirIsAsc, data, disableTwoDimensional, showMorePageSize } = props;\n const childrenProps = checkChildren(props);\n const colSortDirs = {};\n if (initialSortColumnKey) {\n colSortDirs[initialSortColumnKey] = initialSortDirIsAsc ? SortDirection.asc : SortDirection.desc;\n }\n this.rowRefs = {};\n this.state = {\n unsortedData: data ? data : [],\n sortedData: data ? data : [],\n colSortDirs,\n columns: childrenProps.columns,\n expandableRow: childrenProps.expandableRow,\n sortable: false,\n currentSortDir: undefined,\n currentSortKey: '',\n prevSortDir: undefined,\n prevSortKey: '',\n sortedByUserClick: false,\n expandedRows: {},\n isTwoDimensional: data && !disableTwoDimensional ? isTableTwoDimensional(data, childrenProps.columns) : false,\n countShowing: showMorePageSize,\n };\n }\n componentDidMount() {\n this.setState({ unsortedData: this.props.data });\n if (this.props.initialSortColumnKey && (!this.props.sortDisabled || this.props.doInitialSort) && this.props.data) {\n this.onSortChange(this.props.initialSortColumnKey, this.props.initialSortDirIsAsc ? SortDirection.asc : SortDirection.desc, this.props.data);\n }\n }\n static getDerivedStateFromProps(nextProps, prevState) {\n const updatedState = { ...prevState };\n if (nextProps.data !== prevState.unsortedData) {\n updatedState.unsortedData = nextProps.data ? nextProps.data : [];\n }\n if (nextProps.sortDisabled !== !!prevState.sortable) {\n updatedState.sortable = !nextProps.sortDisabled;\n }\n const nextSortColumnKey = nextProps.sortColumnKey ? nextProps.sortColumnKey : prevState.prevSortKey;\n const nextSortColumDir = nextProps.sortDirIsAsc !== null && typeof nextProps.sortDirIsAsc !== 'undefined'\n ? nextProps.sortDirIsAsc\n ? SortDirection.asc\n : SortDirection.desc\n : prevState.prevSortDir;\n // Sammenlikner sortprops med sortstates for å se om det har kommet nye oppdateringer utenfor klassen\n if (!nextProps.sortDisabled &&\n nextSortColumnKey &&\n nextProps.data &&\n nextSortColumDir &&\n (nextSortColumnKey !== prevState.prevSortKey ||\n nextSortColumDir !== prevState.prevSortDir ||\n nextProps.data !== prevState.unsortedData)) {\n // I stor grad samme håndtering som gjøres i onSortChange(), må kopieres nå som vi ikke har \"this\" her.\n updatedState.sortedData = sortIndexes(nextSortColumnKey, nextSortColumDir, nextProps.data ?? [], nextProps.useNumericSort, nextProps.customSetSortValue);\n updatedState.colSortDirs = {\n [nextSortColumnKey]: nextSortColumDir,\n };\n updatedState.currentSortDir = nextSortColumDir;\n updatedState.currentSortKey = nextSortColumnKey;\n updatedState.prevSortDir = nextSortColumDir;\n updatedState.prevSortKey = nextSortColumnKey;\n updatedState.expandedRows = {};\n if (nextProps.onSortColumn) {\n nextProps.onSortColumn(nextSortColumnKey, nextSortColumDir === SortDirection.asc, true, nextProps.sortDisabled);\n }\n }\n // Hvis vi har ny data, men ikke pga. ny sortering\n else {\n if (nextProps.data !== prevState.unsortedData) {\n const newData = nextProps.data ? nextProps.data : [];\n updatedState.unsortedData = newData;\n updatedState.sortedData = newData;\n }\n }\n const currentColumnCount = prevState.columns ? prevState.columns.length : 0;\n const nextColumnCount = checkChildren(nextProps).columns.length;\n if (currentColumnCount !== nextColumnCount) {\n updatedState.columns = updateColumns(nextProps);\n }\n if (updatedState !== prevState) {\n return updatedState;\n }\n else {\n return null;\n }\n }\n render() {\n const { sortedData, columns, isTwoDimensional, countShowing, colSortDirs, expandableRow, expandedRows } = this.state;\n const { id, caption, error, data, showMorePageSize, showMoreButtonClasses, showMoreButtonText, wrapperClassNames, tableClassNames, breakpointConfig, initialSortColumnKey, sortDisabled, sortColumnKey, rowKeyColumnKey, highlightText, emptyContentText, emptyContentElement, noAnchorLinkWrapper, rowClassNames, mode, } = this.props;\n const rows = sortedData\n ? createRows(id, countShowing ? sortedData.slice(0, countShowing) : sortedData, this.toggleExpandRow, this.getOrCreateRowRef, rowKeyColumnKey, highlightText, emptyContentText, emptyContentElement, columns, isTwoDimensional, expandableRow, expandedRows, rowClassNames)\n : [];\n const wrapperClasses = classnames({\n [`${styles['table']}`]: true,\n }, wrapperClassNames);\n const headers = createHeaders(columns ? columns : [], colSortDirs ? colSortDirs : {}, this.onHeaderClickSortChange, initialSortColumnKey, sortDisabled, sortColumnKey, expandableRow, isTwoDimensional, sortedData);\n const tableClasses = classnames({\n [`${designsystemtypography['anchorlink-wrapper']}`]: !noAnchorLinkWrapper,\n }, tableClassNames);\n const captionId = `${id}-caption`;\n return (_jsxs(\"div\", { className: wrapperClasses, children: [_jsxs(Table, { className: tableClasses, id: id, breakpointConfig: breakpointConfig, mode: mode, scrollAriaLabelledById: captionId, children: [_jsx(\"caption\", { className: `${styles.table__caption}`, id: captionId, children: caption }), _jsx(TableHead, { category: !sortDisabled ? HeaderCategory.sortable : this.props.transparentHeader ? HeaderCategory.transparent : HeaderCategory.normal, children: _jsx(TableRow, { children: headers }, \"head\") }), !error ? _jsx(TableBody, { children: rows }) : _jsx(_Fragment, {})] }), _jsx(SubContent, { countShowing: countShowing, error: error, data: data, showMorePageSize: showMorePageSize, showMoreButtonText: showMoreButtonText, showMoreButtonClasses: showMoreButtonClasses, updateCountShowing: this.updateCountShowing })] }));\n }\n}\nObject.defineProperty(DataTable, \"defaultProps\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {\n sortDisabled: false,\n caption: 'Dette er en tabell',\n id: 'Table1',\n }\n});\n","import * as React from 'react';\nexport class Column extends React.Component {\n render() {\n return null;\n }\n}\nObject.defineProperty(Column, \"isColumn\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: true\n});\n","import { Fragment as _Fragment, jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from 'react';\nimport { TableExpandedRow } from '@helsenorge/designsystem-react/components/Table';\nexport class ExpandableRow extends React.Component {\n constructor(props) {\n super(props);\n Object.defineProperty(this, \"rowRef\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"toggleClick\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: () => {\n if (this.props.expandableRowKey && this.props.toggle) {\n this.props.toggle(this.props.expandableRowKey);\n }\n }\n });\n this.rowRef = React.createRef();\n }\n render() {\n const { className, children, rowData, open, colspan, hideDetailsText, tableId, expandableRowKey } = this.props;\n let childrenElement;\n if (children) {\n if (React.isValidElement(children)) {\n const props = {\n rowData: rowData,\n expanded: open,\n };\n childrenElement = React.cloneElement(children, props);\n }\n else {\n childrenElement = children;\n }\n }\n return (_jsx(TableExpandedRow, { expanded: !!open, numberOfColumns: colspan || 1, hideDetailsText: hideDetailsText || '', toggleClick: this.toggleClick, id: `${tableId}-${expandableRowKey}`, className: className, children: _jsx(_Fragment, { children: childrenElement }) }, `${tableId}-${expandableRowKey}`));\n }\n}\nObject.defineProperty(ExpandableRow, \"isExpandableRow\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: true\n});\n","import { tabbable } from 'tabbable';\n/**\n * Goes through an HTML element, and returns all its tabable elements with their current tabindex attribute\n * @param element: container which tabbbale goes through\n */\nexport const setTabIndex = (element) => {\n const newPrevTabIndexes = [];\n const updatedTabbableElements = tabbable(element);\n updatedTabbableElements.forEach(el => {\n if (el.hasAttribute('tabindex')) {\n newPrevTabIndexes.push(el.tabIndex);\n }\n else {\n newPrevTabIndexes.push(null);\n }\n el.tabIndex = -1;\n });\n return {\n tabbableElements: updatedTabbableElements,\n previousTabIndexes: newPrevTabIndexes,\n };\n};\n/**\n * Resets tabIndex to its previous value so the expanded content is reachable again\n * @param tabbableElements: The array of tabbable Elements to reset\n * @param previousTabIndexes: The previous tabindex values to set back\n */\nexport const resetTabIndex = (tabbableElements, previousTabIndexes) => {\n const updatedTabbableElements = tabbableElements;\n if (!tabbableElements || tabbableElements.length < 1) {\n return [];\n }\n updatedTabbableElements.forEach((el, i) => {\n const currentTabIndex = previousTabIndexes[i];\n if (currentTabIndex !== null) {\n el.tabIndex = currentTabIndex;\n }\n else {\n el.removeAttribute('tabindex');\n }\n });\n return updatedTabbableElements;\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport ReactDOM, { render } from 'react-dom';\nimport { error } from './../logger';\nimport { RegisterWebCompSetup } from './helpers';\nexport const isCustomElementRegistered = (name) => {\n return !!window.customElements.get(name);\n};\nexport function registerWebComp(ChildComponent, name, config, templateName) {\n class WebComponent extends HTMLElement {\n constructor() {\n super();\n Object.defineProperty(this, \"mountPoint\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"props\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"observer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"eventDispatcher\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (event) => {\n this.dispatchEvent(event);\n }\n });\n // Listen to Events from outside\n Object.defineProperty(this, \"subscribeDispatcher\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (eventname, callback) => {\n this.addEventListener(eventname, e => {\n return callback(e);\n });\n }\n });\n }\n connectedCallback() {\n this.mountReactComponent();\n this.observer = new MutationObserver(mutations => {\n let shouldRerender = false;\n mutations.forEach(mutation => {\n if (mutation.type === 'attributes' &&\n mutation.oldValue !== mutation.target.getAttribute(mutation.attributeName)) {\n shouldRerender = true;\n }\n });\n if (shouldRerender) {\n this.renderReactComponent();\n }\n });\n this.observer.observe(this, { attributes: true });\n }\n disconnectedCallback() {\n this.mountPoint && ReactDOM.unmountComponentAtNode(this.mountPoint);\n this.observer?.disconnect();\n }\n get value() {\n return Array.from(this.attributes).reduce((p, c) => {\n p[c.name] = c.value;\n return p;\n }, {});\n }\n mountReactComponent() {\n this.mountPoint = document.createElement('div');\n if (!templateName) {\n error('Registrering av webcomp feiler: finner ikke template name');\n return null;\n }\n // TEMPLATE\n // Her settes id til templatet\n const tmpl = document.getElementById(templateName);\n if (!tmpl) {\n error(`Kunne ikke finne html