{"version":3,"file":"app-e20250dd.f584a1446b2fc034d810.bundle.js","mappings":"AAGA","sources":["webpack://lernplattform-admin-frontend/../common/aurelia-components/button-exam-classic/button-exam-classic.html","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-exam/button-exam.html","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-lightswitch/button-lightswitch.html","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-round/button-round.html","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-smaller/button-smaller.html","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-exam-classic/button-exam-classic.ts","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-exam-classic/index.ts","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-exam/button-exam.ts","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-exam/index.ts","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-lightswitch/button-lightswitch.ts","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-lightswitch/index.ts","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-round/button-round.ts","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-round/index.ts","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-smaller/button-smaller.ts","webpack://lernplattform-admin-frontend/../common/aurelia-components/button-smaller/index.ts"],"sourcesContent":["// Module\nvar code = \"<template class=\\\"button-exam-classic ${ selected ? 'button-exam-classic--selected' : '' }\\\"> <span class=\\\"button-exam-classic__number-or-selected\\\" click.delegate=\\\"sendAnswerChangedEvent()\\\" use-as-button aria-checked.to-view=\\\"selected\\\" aria-labelledby=\\\"button-exam-classic-text-${id}\\\" role=\\\"checkbox\\\">${selected ? 'X' : answerId}</span> <span id=\\\"button-exam-classic-text-${id}\\\" class=\\\"button-exam-classic__text\\\">${btnText}</span> </template>\";\n// Exports\nexport default code;","// Module\nvar code = \"<template class=\\\"button-exam button-exam--theme-${theme} ${ uppercase ? 'button-exam--uppercase' : '' } ${ isAudioAnswer ? 'button-exam--audio' : '' } ${ isFrp ? 'button-exam--frp' : '' } button-exam--responsiveness-${responsiveness} button-exam--contrast-${contrastMode} button-exam--vertical-display-mode-${verticalDisplayMode}\\\"> <div if.to-view=\\\"btnPictureUrl\\\" ref=\\\"toolboxElement\\\" class=\\\"button-exam__tool-box mdc-button mdc-button--outlined\\\" use-as-button t=\\\"[aria-label]common.course-question.zoom\\\" click.trigger=\\\"openImageOverlay()\\\"> <safe-icon class=\\\"button-exam__tool-icon\\\" data-test-selector=\\\"testexam-answer-zoom-button\\\" icon-name=\\\"System/Zoom\\\"></safe-icon> </div> <div if.to-view=\\\"!btnPictureUrl && voiceOverEnabled && btnAudioUrl\\\" ref=\\\"toolboxElement\\\" t=\\\"[aria-label]common.audio-service-button.play\\\" use-as-button mouseenter.trigger=\\\"setAudioButtonHighlighted(true)\\\" mouseleave.trigger=\\\"setAudioButtonHighlighted(false)\\\" class=\\\"button-exam__tool-box mdc-button mdc-button--outlined mdc-button--unelevated\\\" click.delegate=\\\"togglePlay()\\\"> <div class=\\\"mdc-button__ripple\\\"></div> <audio-service-button view-model.ref=\\\"audioServiceButton\\\" class=\\\"button-exam__tool-icon button-exam__tool-icon--audio\\\" tabindex=\\\"-1\\\" btn-state.to-view=\\\"audioButtonHighlighted ? `highlighted` : `normal`\\\" data-test-selector=\\\"testexam-answer-voice-over-button\\\" src.to-view=\\\"btnAudioUrl\\\"></audio-service-button> </div> <input class=\\\"button-exam__checkbox\\\" change.trigger=\\\"answerChanged(answerId, $event.target.checked)\\\" checked.to-view=\\\"selected\\\" data-test-selector=\\\"testexam-answer-select-button\\\" disabled.to-view=\\\"disabled || revealed\\\" id.to-view=\\\"btnId\\\" model.bind=\\\"btnId\\\" name=\\\"answers\\\" type=\\\"checkbox\\\"/> <label for.to-view=\\\"btnId\\\" ref=\\\"labelElement\\\" class=\\\"button-exam__label mdc-button mdc-button--outlined mdc-button--unelevated ${ voiceOverEnabled && !btnPictureUrl && btnAudioUrl ? `button-exam__label--voiceover` : '' } ${ btnPictureUrl ? `button-exam__label--picture` : '' } ${ getRevealClass(revealed, correct)} ${ readonly ? `button-exam__label--readonly` : '' }\\\"> <div class=\\\"mdc-button__ripple\\\"></div> <aspect-ratio-container if.to-view=\\\"btnPictureUrl && pictureLoading\\\" class=\\\"button-exam__blurhash-container\\\" ratio.to-view=\\\"16/9\\\" mode=\\\"width-and-height-dependent\\\"> <blurhash class=\\\"button-exam__blurhash\\\" hash.to-view=\\\"btnPictureBlurHash\\\" ratio.to-view=\\\"16/9\\\"></blurhash> </aspect-ratio-container> <img if.to-view=\\\"btnPictureUrl\\\" show.to-view=\\\"!pictureLoading\\\" class=\\\"button-exam__picture\\\" src.to-view=\\\"btnPictureUrl\\\" load.trigger=\\\"handlePictureLoaded()\\\"/> <safe-icon if.to-view=\\\"!btnPictureUrl && (theme === QuestionTheme.AttendeeLocal || theme === QuestionTheme.Lecturer)\\\" class=\\\"button-exam__icon\\\" icon-name.to-view=\\\"`LectureQuiz/${letter}`\\\"></safe-icon> <span if.to-view=\\\"!btnPictureUrl && theme !== QuestionTheme.AttendeeLocal\\\" class=\\\"button-exam__text\\\">${btnText}</span> </label> <slot></slot> </template>\";\n// Exports\nexport default code;","// Module\nvar code = \"<template class=\\\"button-lightswitch button-lightswitch--theme-${theme} ${ labelBefore ? 'button-lightswitch--label-before' : '' }\\\"> <div ref=\\\"formFieldElement\\\" class=\\\"mdc-form-field ${ labelBefore ? 'mdc-form-field--align-end' : '' }\\\"> <div ref=\\\"switchElement\\\" class=\\\"mdc-switch button-lightswitch__button ${ value ? 'mdc-switch--checked button-lightswitch__button--checked' : '' } ${ disabled ? 'mdc-switch--disabled' : '' }\\\" data-test-selector=\\\"button-lightswitch-container\\\"> <div class=\\\"mdc-switch__track button-lightswitch__track\\\"></div> <div class=\\\"mdc-switch__thumb-underlay button-lightswitch__underlay\\\"> <div class=\\\"mdc-switch__thumb button-lightswitch__thumb\\\"> <input id=\\\"${id}\\\" class=\\\"mdc-switch__native-control\\\" aria-labelledby.to-view=\\\"labelId\\\" type=\\\"checkbox\\\" role=\\\"switch\\\" aria-checked.to-view=\\\"value\\\" checked.two-way=\\\"value\\\" data-test-selector=\\\"button-lightswitch-value\\\"> <div class=\\\"button-lightswitch__focus-ring\\\"></div> </div> </div> </div> <label if.to-view=\\\"label\\\" class=\\\"button-lightswitch__label\\\" for=\\\"${id}\\\">${label}</label> <slot></slot> </div> </template>\";\n// Exports\nexport default code;","// Module\nvar code = \"<template class=\\\"button-round\\\"> <button ref=\\\"domElement\\\" class=\\\"mdc-button button-round__button--${color} button-round__button mdc-button--unelevated\\\" aria-label.to-view=\\\"ariaLabel\\\"> <div class=\\\"button-round__focus-ring\\\"></div> <div class=\\\"mdc-button__ripple\\\"></div> <safe-icon class=\\\"mdc-button__icon button-round__icon\\\" aria-hidden=\\\"true\\\" icon-name.to-view=\\\"iconName\\\"></safe-icon> </button> <div if.to-view=\\\"tooltipTk\\\" class=\\\"button-round__tooltip\\\"> <span t.to-view=\\\"tooltipTk\\\" t-params.to-view=\\\"tooltipTkParams\\\"></span> </div> </template>\";\n// Exports\nexport default code;","// Module\nvar code = \"<template class=\\\"button-smaller button-smaller--icon-${iconPosition} ${ disabled ? `button-smaller--disabled` : `` }\\\"> <button class=\\\"mdc-button button-smaller__button mdc-button--outlined mdc-button--unelevated button-smaller__button--${btnType} button-smaller__button--${btnStyle}\\\" disabled.to-view=\\\"disabled\\\" ref=\\\"domElement\\\" aria-label.to-view=\\\"ariaLabel\\\"> <div class=\\\"mdc-button__ripple\\\"></div> <span if.to-view=\\\"btnText\\\" class=\\\"mdc-button__label button-smaller__label\\\">${btnText}</span> <safe-icon if.to-view=\\\"iconName\\\" class=\\\"button-smaller__actual-icon\\\" icon-name.to-view=\\\"iconName\\\"></safe-icon> </button> </template>\";\n// Exports\nexport default code;","import { autoinject, bindable, PLATFORM, useView } from 'aurelia-framework';\nimport { IdGeneratorService } from 'common/aurelia-services/IdGeneratorService';\nimport { SubscriptionManager, SubscriptionManagerService } from 'common/aurelia-services/SubscriptionManagerService';\nimport { DomUtils } from 'common/utils/DomUtils';\n\n/**\n * @event {MCAnswerChangedEvent} mc-answer-changed\n */\n@autoinject()\n@useView(PLATFORM.moduleName('./button-exam-classic.html'))\nexport class ButtonExamClassic {\n  @bindable() public answerId: number | null = null;\n  @bindable() public btnId: string | null = null;\n  @bindable() public btnText: string | null = null;;\n  @bindable() public disabled = false;\n  @bindable() public selected = false;\n\n  private readonly element: HTMLElement;\n  private subscriptionManager: SubscriptionManager;\n  private id: string;\n\n  constructor(\n    element: Element,\n    subscriptionManagerService: SubscriptionManagerService,\n    idGenerator: IdGeneratorService,\n  ) {\n    this.id = idGenerator.getId().toString();\n    this.element = element as HTMLElement;\n    this.subscriptionManager = subscriptionManagerService.createSubscriptionManager();\n  }\n\n  protected attached(): void {\n    if(this.answerId != null) {\n      this.subscriptionManager.subscribeToKeyboardEventWithKeyString(window, `${this.answerId}`, () => {\n        if(!this.disabled) {\n          this.sendAnswerChangedEvent();\n        }\n      });\n    }\n  }\n\n  protected detached(): void {\n    this.subscriptionManager.disposeSubscriptions();\n  }\n\n  private sendAnswerChangedEvent(): void {\n    if(this.answerId != null) {\n      DomUtils.fireEvent(this.element, {\n        bubbles: true,\n        detail: {\n          answer: this.answerId,\n          selected: !this.selected,\n        },\n        name: 'mc-classic-answer-changed',\n      });\n    }\n  }\n}\n\nexport type MCClassicAnswerChangeEvent = Event & { detail: { answer: number; selected: boolean } };\n","import { PLATFORM, FrameworkConfiguration } from 'aurelia-framework';\n\nexport function configure(config: FrameworkConfiguration): void {\n  config.globalResources(PLATFORM.moduleName('common/aurelia-components/button-exam-classic/button-exam-classic'));\n}\n","import { MDCRipple } from '@material/ripple';\nimport { autoinject, bindable, observable, PLATFORM, useView } from 'aurelia-framework';\nimport { AudioServiceButton } from 'common/aurelia-components/audio-service-button/audio-service-button';\nimport { QuestionTheme } from 'common/enum/question-theme.enum';\nimport { ContrastMode } from 'common/enum/quiz.attempt.status.enum';\nimport { VerticalDisplayMode, ResponsivenessMode } from 'common/enum/responsiveness-mode.enum';\nimport { AppUtils } from 'common/utils/AppUtils';\nimport { assertNotNullOrUndefined } from 'common/utils/assert';\nimport { DomUtils } from 'common/utils/DomUtils';\nimport { ExamMediaUtils } from 'common/utils/ExamMediaUtils';\n\nexport type AnswerLetter = 'A' | 'B' | 'C' | 'D';\n\n/**\n * @event {MCAnswerChangedEvent} mc-answer-changed\n * @event {OpenImageOverlayEvent} open-image-overlay\n *\n * css variables:\n * |name|description|\n * |----|-----------|\n * |--button-exam-scale-factor|scaling factor|\n */\n@autoinject()\n@useView(PLATFORM.moduleName('./button-exam.html'))\nexport class ButtonExam {\n  @bindable() public answerId: number | null = null;\n  @bindable() public letter: AnswerLetter | null = null;\n  @bindable() public btnId: string | null = null;\n  @bindable() public btnText: string | null = null;\n  @bindable() public btnPictureUrl?: string;\n  @bindable() public btnPictureBlurHash?: string;\n  @bindable() public btnAudioUrl?: string;\n  @bindable() public isAudioAnswer = false;\n  @bindable() public disabled = false;\n  @bindable() public voiceOverEnabled = true;\n  @bindable() public theme: QuestionTheme = QuestionTheme.Exam;\n  @bindable() public responsiveness = ResponsivenessMode.Auto;\n  @bindable() public contrastMode: ContrastMode = ContrastMode.High;\n  @bindable() public uppercase = false;\n  @bindable() public correct = false;\n  @bindable() public selected = false;\n  @bindable() public revealed = false;\n  @bindable() public readonly = false;\n  @bindable() public verticalDisplayMode = VerticalDisplayMode.Scale;\n\n  private QuestionTheme = QuestionTheme;\n\n  private readonly element: HTMLElement;\n  private labelElement: HTMLElement | null = null;\n  @observable() private toolboxElement: HTMLElement | null = null;\n  private audioServiceButton: AudioServiceButton | null = null;\n\n  private ripple: MDCRipple | null = null;\n  private toolboxRipple: MDCRipple | null = null;\n  private audioButtonHighlighted = false;\n  private pictureLoading = true;\n  private isFrp = AppUtils.isFrp;\n\n  constructor(element: Element) {\n    this.element = element as HTMLElement;\n  }\n\n  public attached(): void {\n    assertNotNullOrUndefined(this.labelElement, 'forgot to ref labelElement');\n    this.ripple = new MDCRipple(this.labelElement);\n  }\n\n  public detached(): void {\n    if(this.ripple) this.ripple.destroy();\n    if(this.toolboxRipple) this.toolboxRipple.destroy();\n  }\n\n  public answerChanged(answer: number, selected: boolean): void {\n    DomUtils.fireEvent(this.element, {\n      bubbles: true,\n      detail: {\n        answer,\n        selected,\n      },\n      name: 'mc-answer-changed',\n    });\n  }\n\n  private toolboxElementChanged(): void {\n    this.toolboxRipple?.destroy();\n    if(this.toolboxElement) this.toolboxRipple = new MDCRipple(this.toolboxElement);\n  }\n\n  private openImageOverlay(): void {\n    if(this.btnPictureUrl) {\n      ExamMediaUtils.emitOpenImageOverlayEvent(this.element, { imgSrc: this.btnPictureUrl });\n    }\n  }\n\n  private togglePlay(): void {\n    if(this.audioServiceButton) {\n      this.audioServiceButton.togglePlay();\n    }\n  }\n\n  private getRevealClass(revealed: boolean, correct: boolean): string {\n    if(!revealed) {\n      return '';\n    }\n\n    return correct ? 'button-exam__label--correct' : 'button-exam__label--wrong';\n  }\n\n  private setAudioButtonHighlighted(highlighted: boolean): void {\n    this.audioButtonHighlighted = highlighted;\n  }\n\n  private handlePictureLoaded(): void {\n    this.pictureLoading = false;\n  }\n}\n\nexport type MCAnswerChangeEvent = Event & { detail: { answer: number; selected: boolean } };\n","import { PLATFORM, FrameworkConfiguration } from 'aurelia-framework';\n\nexport function configure(config: FrameworkConfiguration): void {\n  config.globalResources(PLATFORM.moduleName('common/aurelia-components/button-exam/button-exam'));\n}\n","import { MDCFormField } from '@material/form-field';\nimport { MDCSwitch } from '@material/switch';\nimport { autoinject, bindable, PLATFORM, useView } from 'aurelia-framework';\nimport { assertNotNullOrUndefined } from 'common/utils/assert';\nimport { DomUtils } from 'common/utils/DomUtils';\n\nexport enum Theme {\n  Yellow = 'yellow',\n  Uce = 'uce',\n  Admin = 'admin',\n}\n\nlet switchId = 0;\n\n@autoinject()\n@useView(PLATFORM.moduleName('./button-lightswitch.html'))\nexport class ButtonLightswitch {\n  @bindable() public label: string | null = null;\n  @bindable() public labelBefore = false;\n  @bindable() public value: boolean | null = null;\n  @bindable() public theme: Theme = Theme.Yellow;\n  @bindable() public labelId: string = '';\n  @bindable() public disabled = false;\n\n  private id = `button-lightswitch-id-${switchId++}`;\n\n  private formFieldElement: HTMLElement | null = null;\n  private switchElement: HTMLElement | null = null;\n\n  private formField: MDCFormField | null = null;\n  private switch: MDCSwitch | null = null;\n\n  protected attached(): void {\n    assertNotNullOrUndefined(this.formFieldElement, 'forgot to ref formFieldElement');\n    assertNotNullOrUndefined(this.switchElement, 'forgot to ref switchElement');\n    this.formField = new MDCFormField(this.formFieldElement);\n    this.switch = new MDCSwitch(this.switchElement);\n    this.formField.input = this.switch;\n    if(this.value != null) {\n      this.switch.checked = this.value;\n    }\n  }\n\n  protected detached(): void {\n    this.formField?.destroy();\n    this.switch?.destroy();\n  }\n\n  private valueChanged(newValue: boolean, previousValue: boolean | null): void {\n    if(this.switch) {\n      this.switch.checked = newValue;\n    }\n\n    if(this.switchElement && previousValue != null) {\n      DomUtils.fireEvent<IButtonLightswitchValueChangedEventDetail>(this.switchElement, {\n        name: 'value-changed',\n        bubbles: true,\n        detail: {\n          value: newValue,\n        },\n      });\n    }\n  }\n}\n\nexport interface IButtonLightswitchValueChangedEventDetail {\n  value: boolean;\n}\n\nexport type ButtonLightswitchValueChangedEvent = CustomEvent<IButtonLightswitchValueChangedEventDetail>;\n","import { PLATFORM, FrameworkConfiguration } from 'aurelia-framework';\n\nexport function configure(config: FrameworkConfiguration): void {\n  config.globalResources(PLATFORM.moduleName('common/aurelia-components/button-lightswitch/button-lightswitch'));\n}\n","import { bindable, PLATFORM, useView } from 'aurelia-framework';\nimport { MDCRipple } from '@material/ripple';\nimport { ThemeColorType } from 'common/aurelia-classes/SiteThemer';\nimport { assertNotNullOrUndefined } from 'common/utils/assert';\n\n@useView(PLATFORM.moduleName('./button-round.html'))\nexport class ButtonRound {\n  @bindable() public iconName = '';\n  @bindable() public color: ThemeColorType = ThemeColorType.Primary;\n  @bindable() public ariaLabel: string | null = null;\n  @bindable() public tooltipTk: string | null = null;\n  @bindable() public tooltipTkParams: Record<string, string> | null = {};\n  private ripple: MDCRipple | null = null;\n  private domElement: HTMLElement | null = null;\n\n  protected attached(): void {\n    assertNotNullOrUndefined(this.domElement, 'forgot to ref domElement');\n    this.ripple = new MDCRipple(this.domElement);\n  }\n\n  protected detached(): void {\n    this.ripple?.destroy();\n  }\n}\n","import { PLATFORM, FrameworkConfiguration } from 'aurelia-framework';\n\nexport function configure(config: FrameworkConfiguration): void {\n  config.globalResources(PLATFORM.moduleName('common/aurelia-components/button-round/button-round'));\n}\n","import { MDCRipple } from '@material/ripple';\nimport { bindable, PLATFORM, useView } from 'aurelia-framework';\nimport { assertNotNullOrUndefined } from 'common/utils/assert';\n\nexport enum ButtonType {\n  Contained = 'contained',\n  Icon = 'icon',\n}\n\nexport enum ButtonIconPosition {\n  Left = 'left',\n  Right = 'right'\n}\n\nexport enum ButtonStyle {\n  Regular = 'regular',\n  Inverted = 'inverted',\n  Bright = 'bright',\n  Text = 'text'\n}\n\n@useView(PLATFORM.moduleName('./button-smaller.html'))\nexport class ButtonSmaller {\n  @bindable() public btnText = '';\n  @bindable() public btnType = ButtonType.Contained;\n  @bindable() public btnStyle = ButtonStyle.Regular;\n  @bindable() public iconName = '';\n  @bindable() public iconPosition: ButtonIconPosition | null = null;\n  @bindable() public disabled = false;\n  @bindable() public ariaLabel = '';\n  private domElement: HTMLElement | null = null;\n  private ripple: MDCRipple | null = null;\n\n  protected attached(): void {\n    assertNotNullOrUndefined(this.domElement, 'domElement cannot be null or undefined');\n    this.ripple = new MDCRipple(this.domElement);\n  }\n\n  protected detached(): void {\n    this.ripple?.destroy();\n  }\n}\n","import { FrameworkConfiguration, PLATFORM } from 'aurelia-framework';\n\nexport function configure(config: FrameworkConfiguration): void {\n  config.globalResources(PLATFORM.moduleName('common/aurelia-components/button-smaller/button-smaller'));\n}\n"],"names":[],"sourceRoot":""}