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AAH,EAAsB,GAAED,GACvC,CAACC,GAET,C,uECTO,SAASlM,EAA4BsM,GACxC,MAAMC,GAAcC,EAAAA,EAAAA,QAAUF,GAM9B,OAJAG,EAAAA,EAAAA,YAAU,KACNF,EAAYlM,QAAUiM,CAAQ,GAC/B,CAACA,IAEGC,CACX,C,sBCTA,KAAgB,QAAU,uBAAuB,QAAU,uBAAuB,mBAAqB,uBAAuB,KAAO,uBAAuB,UAAY,uBAAuB,yBAAyB,uBAAuB,YAAc,uBAAuB,KAAO,uB","sources":["webpack://Kristiania.Web/./Features/Messaging/useMessageHandler.ts","webpack://Kristiania.Web/./Features/Pages/SubjectInfoPage/Components/Shared/SubjectDescription.module.css?6a38","webpack://Kristiania.Web/./Features/Pages/SubjectInfoPage/Components/SubjectData/SubjectData.tsx","webpack://Kristiania.Web/./Features/Pages/SubjectInfoPage/Components/SubjectInfoDescription/SubjectInfoDescription.tsx","webpack://Kristiania.Web/./Features/Pages/SubjectInfoPage/Components/Content/Content.module.css?1b5f","webpack://Kristiania.Web/./Features/Pages/SubjectInfoPage/Components/Content/Content.tsx","webpack://Kristiania.Web/./Features/Pages/SubjectInfoPage/Components/SubjectInfo/SubjectInfo.tsx","webpack://Kristiania.Web/./Features/Pages/SubjectInfoPage/Components/SubjectInfo/SubjectInfo.module.css?a5d3","webpack://Kristiania.Web/./Features/Pages/SubjectInfoPage/Components/SubjectInfoContent.tsx","webpack://Kristiania.Web/./Features/Partials/Controls/Utils/asHtmlString.ts","webpack://Kristiania.Web/./Features/Partials/Dropdown/Dropdown.tsx","webpack://Kristiania.Web/./Features/Partials/Dropdown/Dropdown.module.css?b752","webpack://Kristiania.Web/./Features/Partials/SearchBase/Events/QueryParametersChanged.ts","webpack://Kristiania.Web/./Features/Partials/SearchBase/QueryParameterUtils.ts","webpack://Kristiania.Web/./Features/Utils/Hooks/useDebounce.ts","webpack://Kristiania.Web/./Features/Utils/Hooks/useVariableWithStableRef.ts","webpack://Kristiania.Web/./Features/Pages/SyllabusListPage/SyllabusInfoPageBase.module.css?274d"],"sourcesContent":["import { useLayoutEffect } from 'react';\nimport { MessageBroker } from '~/Features/Messaging/MessageBroker';\nimport type { Message, MessageHandler } from '~/Features/Messaging/types';\nimport { useVariableWithStableRef } from '~/Utils/Hooks/useVariableWithStableRef';\n\nexport const useMessageHandler = (messageId: string, onMessage: MessageHandler['handle']) => {\n const onMessageRef = useVariableWithStableRef(onMessage);\n\n // We use LayoutEffect here because it is important that the handler is subscribed before the first message is published.\n // It could happen if the children of the component that uses this hook publish a message in their useEffect.\n useLayoutEffect(() => {\n const handler = {\n handle: (event: Message) => onMessageRef.current(event),\n };\n\n MessageBroker.subscribe(handler, messageId);\n\n return () => MessageBroker.unsubscribe(handler, messageId);\n }, [onMessageRef, messageId]);\n};\n","// extracted by mini-css-extract-plugin\nexport default {\"ClearText\":\"geQ6wBlwl4S4mWEbhUHa\"};","import * as React from 'react';\nimport styles from '../Shared/SubjectDescription.module.css';\nimport type { SubjectContentTranslations } from '~/Pages/SubjectInfoPage/SubjectContentTranslations.csharp';\nimport type { SubjectInfoDescriptionViewModel } from '~/Pages/SubjectInfoPage/SubjectInfoDescriptionViewModel.csharp';\nimport { HtmlDiv } from '~/Partials/Controls/HtmlDiv';\n\nexport interface SubjectDataProps {\n subjectInfoDescription: SubjectInfoDescriptionViewModel;\n translations: SubjectContentTranslations;\n}\n\nexport const SubjectData: React.FC = props => {\n const { subjectInfoDescription, translations } = props;\n\n return (\n <>\n {subjectInfoDescription.semesterInformation && (\n
  • \n

    {translations.semester}

    \n \n \n \n
  • \n )}\n {!!subjectInfoDescription.numberOfSemester && (\n
  • \n

    {translations.numberOfSemesters}

    \n {subjectInfoDescription.numberOfSemester}\n
  • \n )}\n {!!subjectInfoDescription.subjectCoordinators && (\n
  • \n

    {translations.subjectCoordinator}

    \n {subjectInfoDescription.subjectCoordinators}\n
  • \n )}\n {!!subjectInfoDescription.subjectTeachingLanguage && (\n
  • \n

    {translations.teachingLanguage}

    \n {subjectInfoDescription.subjectTeachingLanguage}\n
  • \n )}\n\n {!!subjectInfoDescription.decision && (\n
  • \n

    {translations.decision}

    \n \n \n \n
  • \n )}\n \n );\n};\n","import * as React from 'react';\nimport styles from '../Shared/SubjectDescription.module.css';\nimport type { HtmlString } from '~/Features/Types/HtmlString.csharp';\nimport type { DescriptionItemViewModel } from '~/Pages/SubjectInfoPage/DescriptionItemViewModel.csharp';\nimport { HtmlDiv } from '~/Partials/Controls/HtmlDiv';\nimport { asHtmlString } from '~/Partials/Controls/Utils/asHtmlString';\n\nexport interface SubjectInfoDescriptionProps {\n placeholder?: HtmlString;\n manualContent?: HtmlString;\n description?: DescriptionItemViewModel[];\n}\n\nexport const SubjectInfoDescription: React.FC = model => {\n const { manualContent, description, placeholder } = model;\n\n if (manualContent) {\n return ;\n }\n\n if (description && description.length > 0) {\n return (\n <>\n {description?.map(paragraph => (\n
    \n

    {paragraph.heading}

    \n {paragraph.body && }\n
    \n ))}\n \n );\n }\n\n return ;\n};\n","// extracted by mini-css-extract-plugin\nexport default {\"InfoTable\":\"Sl85FTimsMA7ocJeHRr0\",\"Select\":\"l4b8pZqmFUqVQZ4FpZla\",\"Pdf\":\"rvDgMe9V4KvHw2bbfUxw\",\"StudyRedirect\":\"RJbnguI_UwgnYJ4UfE1e\",\"Description\":\"ITCWRVYz9OiXyW1khZfQ\"};","import classNames from 'classnames';\nimport * as React from 'react';\nimport type { HtmlString } from '~/Features/Types/HtmlString.csharp';\nimport { SubjectData } from '~/Pages/SubjectInfoPage/Components/SubjectData/SubjectData';\nimport { SubjectInfoDescription } from '~/Pages/SubjectInfoPage/Components/SubjectInfoDescription/SubjectInfoDescription';\nimport type { SubjectContentTranslations } from '~/Pages/SubjectInfoPage/SubjectContentTranslations.csharp';\nimport type { SubjectInfoDescriptionViewModel } from '~/Pages/SubjectInfoPage/SubjectInfoDescriptionViewModel.csharp';\nimport type { SemesterDropdownItem } from '~/Pages/SubjectInfoPage/ViewModel/SemesterDropdownItem.csharp';\nimport baseStyles from '~/Pages/SyllabusListPage/SyllabusInfoPageBase.module.css';\nimport { Button } from '~/Partials/Button/Button';\nimport { ButtonSize } from '~/Partials/Button/ButtonSize.csharp';\nimport { ButtonTier } from '~/Partials/Button/ButtonTier.csharp';\nimport { ButtonType } from '~/Partials/Button/ButtonType.csharp';\nimport { Dropdown } from '~/Partials/Dropdown/Dropdown';\nimport { Link } from '~/Partials/Link/Link';\nimport { LinkType } from '~/Partials/Link/LinkType.csharp';\nimport styles from './Content.module.css';\n\nexport interface ContentProps {\n translations: SubjectContentTranslations;\n semesterDropdownItems: SemesterDropdownItem[];\n onlineSubjectPageUrl: string;\n studyLevel: string;\n code: string;\n points: number;\n version: string;\n englishName: string;\n setCurrentSemester: (newSemester: SemesterDropdownItem) => void;\n setQueryParams: (semester: SemesterDropdownItem) => void;\n subjectInfoDescription?: SubjectInfoDescriptionViewModel;\n placeholder?: HtmlString;\n currentSemester?: SemesterDropdownItem;\n}\n\nexport const Content: React.FC = props => {\n const {\n studyLevel,\n setCurrentSemester,\n currentSemester,\n placeholder,\n semesterDropdownItems,\n englishName,\n points,\n subjectInfoDescription,\n code,\n version,\n onlineSubjectPageUrl,\n setQueryParams,\n translations,\n } = props;\n\n const onDropdownValueChanged = (value: string) => {\n const newSemester = JSON.parse(value);\n setCurrentSemester(newSemester);\n setQueryParams(newSemester);\n };\n\n const dropdownOptions = semesterDropdownItems.map(item => ({\n text: item.displayName,\n value: JSON.stringify(item),\n }));\n\n const renderHeading = (heading: string, subheading: string | number) => (\n
  • \n

    {heading}

    \n {subheading}\n
  • \n );\n\n return (\n <>\n
    \n
    \n {!!currentSemester && (\n <>\n

    {currentSemester.displayName}

    \n \n \n )}\n {!!currentSemester &&\n (!!currentSemester.pdfPath ? (\n \n ) : (\n window.print()}\n className={styles.Pdf}\n tier={ButtonTier.LegacyPrimary}\n type={ButtonType.Outline}\n size={ButtonSize.Large}\n >\n {translations.print}\n \n ))}\n
      \n {renderHeading(translations.subjectCode, code)}\n {renderHeading(translations.version, version)}\n {!!englishName && (\n
    • \n

      {translations.englishName}

      \n {englishName}\n
    • \n )}\n {renderHeading(translations.studyPoints, points)}\n\n {!!translations.studyLevel && renderHeading(translations.studyLevel, studyLevel)}\n {!!subjectInfoDescription && (\n \n )}\n
    \n {!!onlineSubjectPageUrl && (\n \n )}\n
    \n
    \n
    \n \n
    \n \n );\n};\n","import * as React from 'react';\nimport type { HtmlString } from '~/Features/Types/HtmlString.csharp';\nimport { Content } from '~/Pages/SubjectInfoPage/Components/Content/Content';\nimport type { SubjectContentTranslations } from '~/Pages/SubjectInfoPage/SubjectContentTranslations.csharp';\nimport type { SubjectInfoDescriptionViewModel } from '~/Pages/SubjectInfoPage/SubjectInfoDescriptionViewModel.csharp';\nimport type { SemesterDropdownItem } from '~/Pages/SubjectInfoPage/ViewModel/SemesterDropdownItem.csharp';\nimport { ActivityIndicator } from '~/Partials/ActivityIndicator/ActivityIndicator';\nimport styles from './SubjectInfo.module.css';\n\nexport interface SubjectInfoProps {\n selectedSemester: SemesterDropdownItem;\n subjectDescription: SubjectInfoDescriptionViewModel;\n isLoading: boolean;\n translations: SubjectContentTranslations;\n onlineSubjectPageUrl: string;\n englishName: string;\n code: string;\n points: number;\n semesterDropdownItems: SemesterDropdownItem[];\n studyLevel: string;\n version: string;\n setCurrentSemester: (newSemester: SemesterDropdownItem) => void;\n setQueryParams: (semester: SemesterDropdownItem) => void;\n placeholder?: HtmlString;\n fetchingError?: string;\n subjectData?: SubjectInfoDescriptionViewModel;\n}\n\nexport const SubjectInfo: React.FC = props => {\n const {\n selectedSemester,\n subjectDescription,\n subjectData,\n isLoading,\n translations,\n fetchingError,\n ...contentProps\n } = props;\n\n const shouldRenderSubjectDescription =\n selectedSemester.semester.period === subjectDescription.period &&\n selectedSemester.semester.year === subjectDescription.year;\n\n if (shouldRenderSubjectDescription) {\n return (\n \n );\n }\n\n return (\n <>\n {subjectData && (\n \n )}\n {fetchingError &&
    {translations.errorInfo}
    }\n \n \n );\n};\n","// extracted by mini-css-extract-plugin\nexport default {\"Error\":\"ybHWpmKzosZnLllkjS6G\"};","import * as React from 'react';\nimport { useCallback } from 'react';\nimport type { Semester } from '~/Features/Semester.csharp';\nimport { Content } from '~/Pages/SubjectInfoPage/Components/Content/Content';\nimport { SubjectInfo } from '~/Pages/SubjectInfoPage/Components/SubjectInfo/SubjectInfo';\nimport type { SubjectInfoDescriptionViewModel } from '~/Pages/SubjectInfoPage/SubjectInfoDescriptionViewModel.csharp';\nimport type { SemesterDropdownItem } from '~/Pages/SubjectInfoPage/ViewModel/SemesterDropdownItem.csharp';\nimport type { SubjectContentViewModel } from '~/Pages/SubjectInfoPage/ViewModel/SubjectContentViewModel.csharp';\nimport baseStyles from '~/Pages/SyllabusListPage/SyllabusInfoPageBase.module.css';\nimport { useFetchData } from '~/Partials/FetchData/useFetchData';\nimport { changeQueryParametersInActiveUrl, formatQueryParameters } from '~/Partials/SearchBase/QueryParameterUtils';\n\nexport const SubjectInfoContent: React.FC> = props => {\n const {\n name,\n code,\n version,\n description,\n getDescriptionUrl,\n onlineSubjectPageUrl,\n placeholder,\n semesterDropdownItems,\n englishName,\n points,\n studyLevel,\n translations,\n } = props;\n const [currentSemester, setCurrentSemester] = React.useState();\n\n React.useEffect(() => {\n const initSemester = semesterDropdownItems.find(\n item => item.semester.year === description.year && item.semester.period === description.period\n );\n\n if (initSemester) {\n setCurrentSemester(initSemester);\n }\n }, []);\n\n const getQueryParams = (semester: SemesterDropdownItem) => [\n { name: 'year', value: semester.semester.year.toString() },\n { name: 'period', value: semester.semester.period.toString() },\n ];\n\n const setQueryParams = useCallback((semester: SemesterDropdownItem) => {\n const queryParameters = getQueryParams(semester);\n changeQueryParametersInActiveUrl(queryParameters);\n }, []);\n\n const descriptionUrl = currentSemester\n ? `${getDescriptionUrl}${formatQueryParameters(getQueryParams(currentSemester))}`\n : '';\n\n const { loading, error, data } = useFetchData({\n url: descriptionUrl,\n shouldMakeRequest: !!descriptionUrl,\n });\n\n const subjectName = data?.name ?? name;\n\n return (\n
    \n
    \n

    \n {translations.subjectDescription} {code}\n

    \n

    {subjectName}

    \n
    \n {currentSemester && description ? (\n \n ) : (\n \n )}\n
    \n );\n};\n","import type { HtmlString } from '~/Features/Types/HtmlString.csharp';\n\nexport const asHtmlString = (content: string): HtmlString => ({ value: content });\n","import classNames from 'classnames';\nimport uniqueId from 'lodash/uniqueId';\nimport * as React from 'react';\nimport { useTheme } from '~/Features/Layouts/Theme/Context/ThemeContextProvider';\nimport styles from './Dropdown.module.css';\n\nexport interface DropdownProps {\n options: DropdownItem[];\n onValueChanged: (value: string) => void;\n placeholder?: string;\n label?: string;\n selectedValue?: string;\n className?: string;\n disabled?: boolean;\n errorMessage?: string;\n disableArrow?: boolean;\n}\n\nexport interface DropdownItem {\n value: string;\n text: string;\n className?: string;\n}\n\nexport const Dropdown = (props: DropdownProps) => {\n const {\n selectedValue,\n onValueChanged,\n options,\n label,\n placeholder,\n errorMessage,\n disabled,\n disableArrow,\n className,\n } = props;\n\n const { withRoundedCorners, withBoxShadow } = useTheme();\n\n const makeOption = (item: DropdownItem, index: number) => (\n \n );\n\n const handleValueChanged = (e: React.ChangeEvent) => {\n onValueChanged(e.target.value);\n };\n\n const id = uniqueId('Form__dropdown__');\n\n return (\n \n {label && (\n \n )}\n
    \n \n {placeholder && (\n \n )}\n {options.map(makeOption)}\n \n
    \n {!!errorMessage && {errorMessage}}\n \n );\n};\n","// extracted by mini-css-extract-plugin\nexport default {\"Select\":\"yAkM5G149svWESq8b94M\",\"Label\":\"XEMVqKqdSgu2F10P4ITv\",\"Variant--disabled\":\"gPPJD7rXQTc6ZtRg5dWt\",\"Variant--rounded\":\"Q_HIF9MqDbZubA1dJx6M\",\"Variant--shadowed\":\"V9FP4TWDABS8qqFfjUnc\",\"Variant--withoutArrow\":\"VPk_uyMZQQnocPx2y9G8\"};","import type { QueryParameter } from '../QueryParameterUtils';\nimport { Event } from '~/Features/Messaging/types';\n\nexport class QueryParametersChanged extends Event {\n public static readonly id = 'QueryParametersChanged';\n\n constructor(\n public queryParams: QueryParameter[],\n public storedInHistory: boolean\n ) {\n super(QueryParametersChanged.id);\n }\n}\n","import { useState } from 'react';\nimport ExecutionContext from '../../ExecutionContext';\nimport { toUrl } from '../Utils/utils';\nimport { MessageBroker } from '~/Features/Messaging/MessageBroker';\nimport { useMessageHandler } from '~/Features/Messaging/useMessageHandler';\nimport { QueryParametersChanged } from '~/Partials/SearchBase/Events/QueryParametersChanged';\n\nexport type QueryParameter = { name: string; value: string };\n\nexport const formatQueryParameters = (params: QueryParameter[]) =>\n params.length === 0 ? '' : `?${params.map(param => `${param.name}=${param.value}`).join('&')}`;\n\nexport const getQueryParametersFromUrl = (url: string): QueryParameter[] => {\n const result = [] as QueryParameter[];\n\n if (ExecutionContext.IsServerSide()) {\n return result;\n }\n\n const params = toUrl(url).searchParams;\n params.forEach((value, key) => result.push({ name: key, value }));\n\n return result;\n};\n\nexport const buildAbsoluteUrlWithQueryParameters = (baseUrl: string, queryParams: QueryParameter[]) => {\n if (ExecutionContext.IsServerSide() || queryParams.length === 0) {\n return baseUrl;\n }\n\n const newUrl = toUrl(baseUrl);\n newUrl.search = '';\n\n queryParams.forEach(param => newUrl.searchParams.append(param.name, param.value));\n\n return newUrl.toString();\n};\n\nexport const changeQueryParametersInActiveUrl = (queryParameters: QueryParameter[], addHistoryEntry = true) => {\n ExecutionContext.ThrowIfServerSide();\n\n const urlWithSearchParams = buildAbsoluteUrlWithQueryParameters(window.location.pathname, queryParameters);\n\n if (addHistoryEntry) {\n document.URL !== urlWithSearchParams && window.history.pushState('', '', urlWithSearchParams);\n } else {\n window.history.replaceState('', '', urlWithSearchParams);\n }\n\n MessageBroker.publish(new QueryParametersChanged(queryParameters, addHistoryEntry));\n};\n\nexport const useQueryParametersObserver = (onlyStoredInHistory = true) => {\n const [queryParams, setQueryParams] = useState([]);\n\n useMessageHandler(QueryParametersChanged.id, (event: QueryParametersChanged) => {\n if (onlyStoredInHistory && !event.storedInHistory) {\n return;\n }\n\n setQueryParams(event.queryParams);\n });\n\n return queryParams;\n};\n","import debounce from 'lodash/debounce';\nimport * as React from 'react';\nimport { useVariableWithStableRef } from './useVariableWithStableRef';\n\nexport function useDebounce(callback: () => void, debounceTime: number) {\n const handlerRef = useVariableWithStableRef(callback);\n\n return React.useCallback(\n debounce(() => handlerRef.current?.(), debounceTime),\n [handlerRef]\n );\n}\n","import { useEffect, useRef } from 'react';\n\nexport function useVariableWithStableRef(variable: T) {\n const variableRef = useRef(variable);\n\n useEffect(() => {\n variableRef.current = variable;\n }, [variable]);\n\n return variableRef;\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"Content\":\"mwAFSm5DcUZsuF6vhDTx\",\"Heading\":\"dii3U8PsHydfSwRg8Poj\",\"InfoTableContainer\":\"gswLHTFJzwwOs_2CUbkW\",\"Name\":\"JQevbKNPnFsy5WpVBF4J\",\"InfoTable\":\"H6iPuIOAX8Tuy4tCqbua\",\"CurrentSemester--print\":\"kbrr0YIdwM29G6FRJUfQ\",\"Description\":\"SJt6pGgWy0erCiJniyRF\",\"Code\":\"EB7_DAx79D0lLaZVGrNf\"};"],"names":["useMessageHandler","messageId","onMessage","onMessageRef","useVariableWithStableRef","useLayoutEffect","handler","handle","event","current","MessageBroker","subscribe","unsubscribe","SubjectData","props","subjectInfoDescription","translations","React","semesterInformation","semester","HtmlDiv","className","styles","html","numberOfSemester","numberOfSemesters","subjectCoordinators","subjectCoordinator","subjectTeachingLanguage","teachingLanguage","decision","SubjectInfoDescription","model","manualContent","description","placeholder","length","map","paragraph","key","heading","body","asHtmlString","Content","studyLevel","setCurrentSemester","currentSemester","semesterDropdownItems","englishName","points","code","version","onlineSubjectPageUrl","setQueryParams","dropdownOptions","item","text","displayName","value","JSON","stringify","renderHeading","subheading","baseStyles","InfoTableContainer","classNames","InfoTable","Dropdown","label","teachingPeriod","options","onValueChanged","newSemester","parse","selectedValue","pdfPath","Link","href","downloadPdf","type","LinkType","Button","buttonType","ButtonType","Outline","download","onClick","window","print","tier","ButtonTier","LegacyPrimary","size","ButtonSize","Large","subjectCode","lang","studyPoints","goToStudyOffers","Description","SubjectInfo","selectedSemester","subjectDescription","subjectData","isLoading","fetchingError","contentProps","_objectWithoutProperties","_excluded","period","year","_extends","errorInfo","ActivityIndicator","cover","active","SubjectInfoContent","_data$name","name","getDescriptionUrl","initSemester","find","getQueryParams","toString","useCallback","queryParameters","changeQueryParametersInActiveUrl","descriptionUrl","concat","formatQueryParameters","loading","error","data","useFetchData","url","shouldMakeRequest","subjectName","Heading","Code","Name","content","errorMessage","disabled","disableArrow","withRoundedCorners","withBoxShadow","useTheme","id","uniqueId","htmlFor","undefined","defaultValue","onChange","e","target","hidden","makeOption","index","QueryParametersChanged","Event","constructor","queryParams","storedInHistory","super","params","param","join","getQueryParametersFromUrl","result","ExecutionContext","IsServerSide","toUrl","searchParams","forEach","push","buildAbsoluteUrlWithQueryParameters","baseUrl","newUrl","search","append","addHistoryEntry","arguments","ThrowIfServerSide","urlWithSearchParams","location","pathname","document","URL","history","pushState","replaceState","publish","useQueryParametersObserver","onlyStoredInHistory","useState","useDebounce","callback","debounceTime","handlerRef","debounce","_handlerRef$current","call","variable","variableRef","useRef","useEffect"],"sourceRoot":""}