H5P.AdvancedText = (function ($, EventDispatcher) {

  /**
   * A simple library for displaying text with advanced styling.
   *
   * @class H5P.AdvancedText
   * @param {Object} parameters
   * @param {Object} [parameters.text='New text']
   * @param {number} id
   */
  function AdvancedText(parameters, id) {
    var self = this;
    EventDispatcher.call(this);

    var html = (parameters.text === undefined ? '<em>New text</em>' : parameters.text);

    /**
     * Wipe container and add text html.
     *
     * @alias H5P.AdvancedText#attach
     * @param {H5P.jQuery} $container
     */
    self.attach = function ($container) {
      $container.addClass('h5p-advanced-text').html(html);
    };
  }

  AdvancedText.prototype = Object.create(EventDispatcher.prototype);
  AdvancedText.prototype.constructor = AdvancedText;

  return AdvancedText;

})(H5P.jQuery, H5P.EventDispatcher);
;var H5P = H5P || {};

/**
 * Constructor.
 *
 * @param {Object} params Options for this library.
 * @param {Number} id Content identifier
 * @returns {undefined}
 */
(function ($) {
  H5P.Image = function (params, id, extras) {
    H5P.EventDispatcher.call(this);
    this.extras = extras;

    if (params.file === undefined || !(params.file instanceof Object)) {
      this.placeholder = true;
    }
    else {
      this.source = H5P.getPath(params.file.path, id);
      this.width = params.file.width;
      this.height = params.file.height;
    }

    this.alt = (!params.decorative && params.alt !== undefined) ?
      this.stripHTML(this.htmlDecode(params.alt)) :
      '';

    if (params.title !== undefined) {
      this.title = this.stripHTML(this.htmlDecode(params.title));
    }
  };

  H5P.Image.prototype = Object.create(H5P.EventDispatcher.prototype);
  H5P.Image.prototype.constructor = H5P.Image;

  /**
   * Wipe out the content of the wrapper and put our HTML in it.
   *
   * @param {jQuery} $wrapper
   * @returns {undefined}
   */
  H5P.Image.prototype.attach = function ($wrapper) {
    var self = this;
    var source = this.source;

    if (self.$img === undefined) {
      if(self.placeholder) {
        self.$img = $('<div>', {
          width: '100%',
          height: '100%',
          class: 'h5p-placeholder',
          title: this.title === undefined ? '' : this.title,
          on: {
            load: function () {
              self.trigger('loaded');
            }
          }
        });
      } else {
        self.$img = $('<img>', {
          width: '100%',
          height: '100%',
          src: source,
          alt: this.alt,
          title: this.title === undefined ? '' : this.title,
          on: {
            load: function () {
              self.trigger('loaded');
            }
          }
        });
      }
    }

    $wrapper.addClass('h5p-image').html(self.$img);
  };

  /**
   * Retrieve decoded HTML encoded string.
   *
   * @param {string} input HTML encoded string.
   * @returns {string} Decoded string.
   */
  H5P.Image.prototype.htmlDecode = function (input) {
    const dparser = new DOMParser().parseFromString(input, 'text/html');
    return dparser.documentElement.textContent;
  };

  /**
   * Retrieve string without HTML tags.
   *
   * @param {string} input Input string.
   * @returns {string} Output string.
   */
  H5P.Image.prototype.stripHTML = function (html) {
    const div = document.createElement('div');
    div.innerHTML = html;
    return div.textContent || div.innerText || '';
  };

  return H5P.Image;
}(H5P.jQuery));
;!function(){"use strict";var e={697:function(e,t,n){var r,i,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},a=function(){return"object"===("undefined"==typeof window?"undefined":s(window))},c=a()?window:n.g,o=!!a()&&document.attachEvent,d=!1,h=null,l=null,u=null,p=null,b=function(e){var t=e.__resizeTriggers__,n=t.firstElementChild,r=t.lastElementChild,i=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,i.style.width=n.offsetWidth+1+"px",i.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight},g=(r=c.requestAnimationFrame||c.mozRequestAnimationFrame||c.webkitRequestAnimationFrame||function(e){return setTimeout(e,20)},function(e){return r(e)}),m=(i=c.cancelAnimationFrame||c.mozCancelAnimationFrame||c.webkitCancelAnimationFrame||c.clearTimeout,function(e){return i(e)}),y=function(e){var t=this;b(this),this.__resizeRAF__&&m(this.__resizeRAF__),this.__resizeRAF__=g((function(){(function(e){return e.offsetWidth!=e.__resizeLast__.width||e.offsetHeight!=e.__resizeLast__.height})(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach((function(n){n.call(t,e)})))}))};if(a()&&!o){var v=!1,f="";p="animationstart";var S="Webkit Moz O ms".split(" "),L="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),x="",I=document.createElement("fakeelement");if(void 0!==I.style.animationName&&(v=!0),!1===v)for(var B=0;B<S.length;B++)if(void 0!==I.style[S[B]+"AnimationName"]){(x=S[B])+"Animation",f="-"+x.toLowerCase()+"-",p=L[B],v=!0;break}l="@"+f+"keyframes "+(h="resizeanim")+" { from { opacity: 0; } to { opacity: 0; } } ",u=f+"animation: 1ms "+h+"; "}t.w9=function(e,t){o?e.attachEvent("onresize",t):a()&&(e.__resizeTriggers__||("static"==getComputedStyle(e).position&&(e.style.position="relative"),function(){if(!d){var e=(l||"")+".resize-triggers { "+(u||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n),d=!0}}(),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=document.createElement("div")).className="resize-triggers",e.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',e.appendChild(e.__resizeTriggers__),b(e),e.addEventListener("scroll",y,!0),p&&e.__resizeTriggers__.addEventListener(p,(function(t){t.animationName==h&&b(e)}))),e.__resizeListeners__.push(t))}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();let i=function(e){var t,n;function i(t){var n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(n=e.call(this)||this).parent=t,n.screenData=r,n.isShowing=n.screenData.isStartScreen,n.isFeedbackAvailable=!1,n.screenWrapper=document.createElement("div"),n.screenWrapper.classList.add(n.screenData.isStartScreen?"h5p-start-screen":"h5p-end-screen"),n.screenWrapper.classList.add(n.screenData.isCurrentScreen?"h5p-current-screen":"h5p-next-screen"),n.screenData.isCurrentScreen?n.parent.currentHeight="45em":n.screenWrapper.classList.add("h5p-branching-hidden");const i=document.createElement("div");i.classList.add("h5p-branching-scenario-screen-content"),n.feedbackText=document.createElement("div"),n.feedbackText.classList.add("h5p-feedback-content-content"),i.appendChild(n.feedbackText);const s=document.createElement("h1");s.className="h5p-branching-scenario-title-text",s.innerHTML=n.screenData.titleText;const a=document.createElement("div");a.className="h5p-branching-scenario-subtitle-text",a.innerHTML=n.screenData.subtitleText;const c=document.createElement("button");c.classList.add(n.screenData.isStartScreen?"h5p-start-button":"h5p-end-button"),c.classList.add("transition"),c.addEventListener("click",(()=>{n.screenData.isStartScreen?n.parent.trigger("started"):n.parent.trigger("restarted");let e=document.getElementsByClassName("h5p-start-screen")[0];n.screenData.isStartScreen||(e.style.height=""),n.parent.navigating=!0})),n.navButton=c;const o=document.createTextNode(n.screenData.buttonText);if(c.appendChild(o),n.feedbackText.appendChild(s),n.feedbackText.appendChild(a),i.appendChild(c),n.screenData.showScore&&void 0!==n.screenData.score&&(n.scoreWrapper=n.createResultContainer(n.screenData.scoreText,n.screenData.score,n.screenData.maxScore),i.insertBefore(n.scoreWrapper,i.firstChild)),H5P.fullscreenSupported){const e=document.createElement("button");e.className="h5p-branching-full-screen",e.setAttribute("aria-label",n.parent.params.l10n.fullscreenAria),e.addEventListener("click",(()=>{n.trigger("toggleFullScreen")})),n.screenWrapper.appendChild(e)}return n.screenWrapper.appendChild(n.createScreenBackground(n.screenData.isStartScreen,n.screenData.image,n.screenData.altText)),n.screenWrapper.appendChild(i),(n.screenData.showScore&&void 0!==n.screenData.score||""!==n.screenData.titleText||""!==n.screenData.subtitleText)&&(n.feedbackText.tabIndex=-1,n.isFeedbackAvailable=!0),n}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,r(t,n);var s=i.prototype;return s.getScore=function(){return this.screenData.score},s.getMaxScore=function(){return this.screenData.maxScore},s.getRecreationData=function(){return{endScreenTitle:this.screenData.titleText,endScreenSubtitle:this.screenData.subtitleText,endScreenImage:this.screenData.image,endScreenScore:this.screenData.score}},s.checkIntroReset=function(){let e=document.getElementsByClassName("h5p-start-screen")[0];["h5p-end-screen","h5p-current-screen"].every((e=>this.screenWrapper.classList.contains(e)))?e.classList.add("h5p-reset-start"):e.classList.contains("h5p-reset-start")&&e.classList.remove("h5p-reset-start")},s.getElement=function(){return this.screenWrapper},s.setScore=function(e){this.scoreValue&&"number"==typeof e&&(this.scoreValue.textContent=e.toString())},s.setMaxScore=function(e){this.maxScoreValue&&"number"==typeof e&&(this.maxScoreValue.textContent=e.toString())},s.createResultContainer=function(e,t,n){const r=document.createElement("div");r.classList.add("h5p-result-wrapper");const i=document.createElement("div");i.classList.add("h5p-result-container");const s=document.createElement("div");s.classList.add("h5p-score-text"),s.appendChild(document.createTextNode(e));const a=document.createElement("div");a.classList.add("h5p-score-circle");const c=document.createElement("span");c.className="h5p-score-value",this.scoreValue=document.createTextNode(t.toString()),c.appendChild(this.scoreValue),a.appendChild(c);const o=document.createElement("span");o.className="h5p-score-delimiter",o.textContent="/",a.appendChild(o);const d=document.createElement("span");return d.className="h5p-max-score",this.maxScoreValue=document.createTextNode(n.toString()),d.appendChild(this.maxScoreValue),a.appendChild(d),i.appendChild(s),i.appendChild(a),r.appendChild(i),r},s.createScreenBackground=function(e,t,n){const r=document.createElement("div");r.classList.add("h5p-screen-background");const i=document.createElement("div");i.classList.add("h5p-screen-banner");const s=document.createElement("img");return s.classList.add("h5p-background-image"),s.src=t?.path?H5P.getPath(t.path,this.parent.contentId):e?this.parent.getLibraryFilePath("dist/assets/start-screen-default.jpg"):this.parent.getLibraryFilePath("dist/assets/end-screen-default.jpg"),n?.length&&s.setAttribute("aria-label",n),s.addEventListener("load",(()=>{this.parent.trigger("resize")})),r.appendChild(i),r.appendChild(s),r},s.show=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isShowing=!0,e.slideBack=e.slideBack&&!e.skipAnimation,e.slideBack&&(this.screenWrapper.classList.remove("h5p-next-screen"),this.screenWrapper.classList.add("h5p-previous"));const t=()=>{e.slideBack&&this.screenWrapper.classList.remove("h5p-previous"),this.screenWrapper.classList.remove("h5p-next-screen"),this.screenWrapper.classList.remove("h5p-slide-in"),this.screenWrapper.classList.add("h5p-current-screen"),this.screenWrapper.setAttribute("aria-hidden",!1),this.parent.trigger("resize"),e.skipFocus||(this.isFeedbackAvailable?this.feedbackText.focus():this.navButton.focus()),this.checkIntroReset()};this.parent.libraryScreen.contentOverlays?.forEach((e=>{e.hide()})),this.parent.libraryScreen.branchingQuestions?.forEach((e=>{e.remove()})),this.parent.libraryScreen.overlay?.remove(),e.skipAnimation?(this.screenWrapper.classList.remove("h5p-branching-hidden"),t()):(this.screenWrapper.classList.add("h5p-slide-in"),this.screenWrapper.classList.remove("h5p-branching-hidden"),this.screenWrapper.addEventListener("animationend",(e=>{"slide-in"===e.animationName&&t()})))},s.hide=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isShowing=!1;const t=()=>{this.screenWrapper.classList.add("h5p-branching-hidden"),this.screenWrapper.classList.remove("h5p-current-screen"),this.screenWrapper.classList.add("h5p-next-screen"),this.screenWrapper.classList.remove("h5p-slide-out")};e.skipAnimation?t():(this.screenWrapper.classList.add("h5p-slide-out"),this.screenWrapper.addEventListener("animationend",(e=>{"slide-out"===e.animationName&&t()})))},i}(H5P.EventDispatcher),s=function(){function e(e){this.hidden=!0,this.parent=e,this.overlay=document.createElement("div"),this.overlay.classList.add("h5p-content-overlay"),this.overlay.classList.add("h5p-hidden"),this.buttonsContainer=document.createElement("div"),this.buttonsContainer.classList.add("h5p-content-overlay-buttons-container"),this.overlay.appendChild(this.buttonsContainer),this.buttons={}}var t=e.prototype;return t.getDOM=function(){return this.overlay},t.show=function(){this.overlay.classList.remove("h5p-hidden"),window.requestAnimationFrame((()=>{this.buttonsContainer.classList.remove("h5p-hidden"),this.hidden=!1,Object.values(this.buttons)[Object.keys(this.buttons).length-1].focus()}))},t.hide=function(){this.hidden=!0,this.overlay.classList.add("h5p-hidden"),this.buttonsContainer.classList.add("h5p-hidden")},t.isVisible=function(){return!this.hidden},t.addButton=function(e,t,n){if(!e&&0!==e||!t||"function"!=typeof n||this.buttons[e])return null;const r=document.createElement("button");return r.classList.add("transition"),r.classList.add("h5p-nav-button"),r.classList.add(`h5p-nav-button-${e}`),r.innerText=t,r.addEventListener("click",(()=>{n(e)})),this.buttons[e]=r,this.buttonsContainer.appendChild(r),r},t.removeButton=function(e){(e||0===e)&&this.buttons[e]&&(this.buttonsContainer.removeChild(this.buttons[e]),delete this.buttons[e])},e}();var a=n(697);function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}let o=function(e){var t,n;function r(t,n,r,i){var s;let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;(s=e.call(this)||this).parent=t,s.previousState=i??{},s.lastNodeId=a,s.currentLibraryElement,s.currentLibraryInstance,s.currentLibraryId=0,s.nextLibraryId=r.nextContentId,s.libraryFeedback=r.feedback,s.nextLibraries={},s.libraryInstances={},s.libraryFinishingRequirements=[],s.libraryTitle,s.branchingQuestions=[],s.navButton,s.header,s.isShowing=!1,s.contentOverlays=[];const c=r.type&&r.type.metadata&&r.type.metadata.title?r.type.metadata.title:"";s.wrapper=s.createWrapper(n,c||"Untitled Content",r.showContentTitle&&c),s.wrapper.classList.add("h5p-next-screen"),s.wrapper.classList.add("h5p-branching-hidden");const o=s.createLibraryElement(r,!1);return s.currentLibraryWrapper=o,s.currentLibraryElement=o.getElementsByClassName("h5p-branching-scenario-content")[0],s.currentLibraryInstance=s.libraryInstances[0],s.createNextLibraries(r),s.wrapper.appendChild(o),s.createNavButtons(),s.parent.on("enterFullScreen",(()=>{setTimeout((()=>{s.currentLibraryInstance&&s.currentLibraryInstance.trigger("resize")}),500)})),s}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,c(t,n);var i=r.prototype;return i.handleLibraryResize=function(){if(this.parent.isFullScreen())return this.currentLibraryWrapper.style.height="",void(this.wrapper.style.minHeight="");this.currentLibraryWrapper.style.height=`${this.currentLibraryElement.clientHeight+40}px`,this.wrapper.style.minHeight=`${this.currentLibraryElement.clientHeight+40+70.17}px`,this.currentLibraryWrapper.offsetHeight<this.currentLibraryElement.scrollHeight&&(this.currentLibraryElement.tabIndex=0)},i.createWrapper=function(e,t,n){const r=document.createElement("div"),i=document.createElement("div");if(i.classList.add("h5p-title-wrapper"),H5P.fullscreenSupported){const e=document.createElement("button");e.className="h5p-branching-full-screen",e.setAttribute("aria-label",this.parent.params.l10n.fullscreenAria),e.addEventListener("click",(()=>{this.trigger("toggleFullScreen")})),i.appendChild(e)}const s=document.createElement("div");s.className="h5p-branching-header";const c=document.createElement("h1");c.innerHTML=e,s.appendChild(c);const o=document.createElement("h2");o.classList.add("library-subtitle"),o.innerHTML=n?t:"&nbsp;",o.setAttribute("tabindex","-1"),o.setAttribute("aria-label",t),s.appendChild(o),i.appendChild(s),this.libraryTitle=o;const d=document.createElement("div");d.classList.add("h5p-screen-header"),this.header=d,d.appendChild(i),r.appendChild(d);return(0,a.w9)(r,(()=>{this.wrapper.clientHeight>500&&(this.wrapper.style.minHeight=`${this.wrapper.clientHeight}px`)})),r.addEventListener("animationend",(e=>{"slide-in"===e.animationName&&this.currentLibraryElement&&(this.parent.trigger("resize"),window.setTimeout((()=>{(0,a.w9)(this.currentLibraryElement,(()=>{this.handleLibraryResize(),this.parent.bubblingUpwards=!0,this.parent.trigger("resize"),this.parent.bubblingUpwards=!1}))}),100))})),r},i.createBackButton=function(e){const t=document.createElement("button");return t.classList.add("transition"),t.classList.add("h5p-back-button"),t.addEventListener("click",(e=>{if(e.currentTarget.hasAttribute("isBQ"))return this.overlay&&(null!==this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=void 0,this.branchingQuestions.forEach((e=>{null!==e.parentNode&&e.parentNode.removeChild(e)})),this.showBackgroundToReadspeaker()),"H5P.BranchingQuestion"===this.parent.params.content[0].type.library.split(" ")[0]&&0===this.parent.currentId?(this.parent.trigger("restarted",{keepStates:!0}),t):void this.parent.trigger("navigated",{reverse:!0});if(!0!==this.parent.navigating){if(0===this.currentLibraryId&&"H5P.BranchingQuestion"!==this.parent.params.content[this.parent.currentId].type.library.split(" ")[0])return this.parent.isReverseTransition=!0,this.parent.trigger("restarted",{keepStates:!0}),t;this.parent.trigger("navigated",{reverse:!0}),this.parent.navigating=!0}})),t.appendChild(document.createTextNode(e)),t},i.handleProceed=function(){let e=!0;if(!1===this.parent.navigating){const t=this.libraryFeedback.title&&this.libraryFeedback.title.trim(),n=this.libraryFeedback.subtitle&&this.libraryFeedback.subtitle.trim(),r=!!(t||n||this.libraryFeedback.image);if(r&&-1!==this.nextLibraryId){void 0===this.overlay&&(this.overlay=document.createElement("div"),this.overlay.className="h5p-branching-scenario-overlay",this.wrapper.appendChild(this.overlay),this.hideBackgroundFromReadspeaker());const e=document.createElement("div");e.classList.add("h5p-branching-question-wrapper"),e.classList.add("h5p-branching-scenario-feedback-dialog");const t=document.createElement("div");t.classList.add("h5p-branching-question-container"),e.appendChild(t);const n=this.createFeedbackScreen(this.libraryFeedback,this.nextLibraryId);t.appendChild(n),t.classList.add("h5p-start-outside"),t.classList.add("h5p-fly-in"),this.currentLibraryWrapper.style.zIndex=0,setTimeout((()=>{this.wrapper.appendChild(e),parseInt(this.currentLibraryWrapper.style.height)<t.offsetHeight&&(this.currentLibraryElement.style.height=t.offsetHeight+"px",this.wrapper.style.height=t.offsetHeight+"px",this.parent.trigger("resize"))}),100),n.focus(),this.parent.navigating=!0}else{const t={nextContentId:this.nextLibraryId};(r||void 0!==this.libraryFeedback.endScreenScore)&&(t.feedback=this.libraryFeedback),e=!1,new Promise((e=>{e(this.parent.trigger("navigated",t))})).then((()=>{requestAnimationFrame((()=>{this.parent.trigger("resize")})),this.parent.proceedButtonInProgress=!1,this.parent.navigating=!0}))}}if(e)return e},i.createFeedbackScreen=function(e,t){const n="h5p-branching-feedback-title-"+r.idCounter++,i=document.createElement("div");if(i.classList.add("h5p-branching-question"),i.classList.add(void 0!==e.image?"h5p-feedback-has-image":"h5p-feedback-default"),i.setAttribute("role","dialog"),i.setAttribute("tabindex","-1"),i.setAttribute("aria-labelledby",n),void 0!==e.image&&void 0!==e.image.path){const t=document.createElement("div");t.classList.add("h5p-branching-question"),t.classList.add("h5p-feedback-image");const n=document.createElement("img");n.src=H5P.getPath(e.image.path,this.parent.contentId),t.appendChild(n),i.appendChild(t)}const s=document.createElement("div");s.classList.add("h5p-branching-question"),s.classList.add("h5p-feedback-content");const a=document.createElement("div");a.classList.add("h5p-feedback-content-content"),s.appendChild(a);const c=document.createElement("h1");if(c.id=n,c.innerHTML=e.title||"",a.appendChild(c),e.subtitle){const t=document.createElement("div");t.innerHTML=e.subtitle||"",a.appendChild(t)}const o=document.createElement("button");o.addEventListener("click",(()=>{this.parent.trigger("navigated",{nextContentId:t}),requestAnimationFrame((()=>{this.parent.trigger("resize")}))}));const d=this.parent.getLibrary(this.currentLibraryId).proceedButtonText,h=document.createTextNode(d);return o.appendChild(h),s.appendChild(o),i.appendChild(s),i},i.createLibraryElement=function(e,t){const n=document.createElement("div");n.classList.add("h5p-library-wrapper");const r=document.createElement("div");r.classList.add("h5p-branching-scenario-content"),this.appendRunnable(r,e.type,e.contentId);const i=e.type?.library.split(" ")[0];return this.contentOverlays[e.contentId]=new s(this),n.appendChild(this.contentOverlays[e.contentId].getDOM()),"H5P.InteractiveVideo"!==i&&"H5P.Video"!==i||(this.contentOverlays[e.contentId].addButton("replay",this.parent.params.l10n.replayButtonText,(()=>{this.handleReplayVideo(i,e)})),this.contentOverlays[e.contentId].addButton("proceed",e.proceedButtonText,(()=>{this.handleProceedAfterVideo()}))),n.appendChild(r),t&&(n.classList.add("h5p-next"),r.classList.add("h5p-branching-hidden")),"H5P.BranchingQuestion"===i&&r.classList.add("h5p-branching-hidden"),n},i.handleReplayVideo=function(e,t){this.contentOverlays[this.currentLibraryId].hide(),!0===this.libraryFinishingRequirements[t.contentId]&&this.hasValidVideo(t)&&this.parent.disableNavButton(),this.currentLibraryInstance.currentState=3,this.currentLibraryInstance.seek(0),this.currentLibraryInstance.play(),"H5P.InteractiveVideo"===e&&this.resetIVProgress()},i.resetIVProgress=function(){this.currentLibraryInstance.interactions.forEach((e=>{e.resetTask()}));let e=this.currentLibraryInstance;e.addSliderInteractions(),e.endscreen&&(e.endscreen.update(),e.endscreen.$closeButton[0].click(),this.wrapper.getElementsByClassName("h5p-star-foreground")[0].classList.remove("h5p-star-active"))},i.handleProceedAfterVideo=function(){this.contentOverlays[this.currentLibraryId].hide(),this.handleProceed()},i.appendRunnable=function(e,t,n){const r=t.library.split(" ")[0];if("H5P.Video"===r)t.params.visuals.fit=!1;else if("H5P.BranchingQuestion"===r){const e=this.parent.getLibrary(n).proceedButtonText;t.params.proceedButtonText=e}const i=window.structuredClone?structuredClone(t):H5P.jQuery.extend(!0,{},t),s={parent:this.parent},a="number"==typeof this.lastNodeId&&this.lastNodeId===n;this.previousState&&a&&(s.previousState=this.previousState);const c=H5P.newRunnable(i,this.parent.contentId,H5P.jQuery(e),!0,s);if(("enabled"===this.parent.params.content[n].forceContentFinished||"useBehavioural"===this.parent.params.content[n].forceContentFinished&&!0===this.parent.params.behaviour.forceContentFinished)&&(this.libraryFinishingRequirements[n]=this.forceContentFinished(c,r),this.addFinishedListeners(c,r)),c.setActivityStarted(),"H5P.Video"===r&&this.nextIsBranching(n)?c.on("stateChange",(e=>{e.data===H5P.Video.ENDED&&this.navButton&&this.handleProceed()})):"H5P.Image"===r&&c.on("loaded",(()=>{this.handleLibraryResize(),this.parent.trigger("resize")})),"H5P.Video"===r||"H5P.InteractiveVideo"===r){const e="H5P.Video"===r?c:c.video;e.on("loaded",(()=>{this.handleLibraryResize()})),e.on("error",(()=>{this.parent.enableNavButton()}))}c.on("navigated",(e=>{this.parent.trigger("navigated",e.data)})),this.libraryInstances[n]=c,this.bubbleUp(c,"resize",this.parent),this.disableFullscreen(c)},i.getCurrentState=function(){return this.currentLibraryInstance?.getCurrentState?.()},i.stopPlayback=function(e){const t=this.libraryInstances[e];if(t)try{"function"==typeof t.pause?t.pause():"function"==typeof t.video?.pause?t.video.pause():"function"==typeof t.stop?t.stop():"function"==typeof t.pauseMedia&&t.elementInstances[t.currentSlideIndex]&&t.elementInstances[t.currentSlideIndex].forEach((e=>{t.pauseMedia(e)}))}catch(e){H5P.error(e)}},i.forceContentFinished=function(e,t){let n=!1;return e&&(n=n||"function"==typeof e?.getScore),t&&(n=n||"H5P.Audio"===t||"H5P.Video"===t),("H5P.CoursePresentation"===t&&e?.children.length+(e.isTask?1:0)===1||!0===e?.activeSurface)&&(n=!1),n},i.addFinishedListeners=function(e,t){if("string"==typeof t&&e)switch(t){case"H5P.CoursePresentation":e.on("xAPI",(t=>{if("progressed"===t.data.statement.verb.display["en-US"]){parseInt(t.data.statement.object.definition.extensions["http://id.tincanapi.com/extension/ending-point"])===e.children.length+(e.isTask?1:0)&&this.navButton.classList.contains("h5p-disabled")&&this.parent.enableNavButton(!0)}}));break;case"H5P.InteractiveVideo":e.on("xAPI",(e=>{"completed"===e.data.statement.verb.display["en-US"]&&this.handleVideoOver()})),e.video.on("stateChange",(t=>{if(t.data===H5P.Video.ENDED||t.data===H5P.Video.PLAYING&&!1===this.contentOverlays[this.currentLibraryId].hidden){const t=e.interactions.filter((e=>void 0!==e.getProgress()));e.hasStar&&t.length>0?this.parent.enableNavButton():this.handleVideoOver(),this.pause()}}));break;case"H5P.Video":e.on("stateChange",(e=>{e.data===H5P.Video.ENDED&&(this.nextIsBranching(this.currentLibraryId)||this.handleVideoOver())}));break;case"H5P.Audio":e.audio.on("ended",(()=>{this.parent.enableNavButton()}));break;default:"function"==typeof e.getAnswerGiven&&e.on("xAPI",(e=>{"answered"!==e.data.statement.verb.display["en-US"]&&"completed"!==e.data.statement.verb.display["en-US"]||this.parent.enableNavButton()}))}},i.handleVideoOver=function(){this.nextIsBranching(this.currentLibraryId)?this.handleProceed():this.showContentOverlay(),this.parent.enableNavButton()},i.showContentOverlay=function(){this.contentOverlays[this.currentLibraryId].show()},i.hideContentOverlay=function(){this.contentOverlays[this.currentLibraryId].hide()},i.getXAPIData=function(e){if(this.libraryInstances[e]&&this.libraryInstances[e].getXAPIData)return this.libraryInstances[e].getXAPIData()},i.nextIsBranching=function(e){const t=void 0!==e?this.parent.params.content[e].nextContentId:void 0;return void 0!==t&&t>0&&r.isBranching(this.parent.params.content[t])},i.createNextLibraries=function(e){this.removeNextLibraries(),this.nextLibraries={},this.loadLibrary(e)},i.createNextLibrary=function(e){this.removeNextLibraries(),this.nextLibraries={},this.loadLibrary(e,e.contentId)},i.loadLibrary=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=null!==t?t:e.nextContentId;if("H5P.BranchingQuestion"!==e.type.library.split(" ")[0]){const e=this.parent.getLibrary(n);if(!1===e)return;"H5P.BranchingQuestion"!==e?.type.library.split(" ")[0]&&(this.nextLibraries[n]=this.createLibraryElement(e,!0),this.wrapper.appendChild(this.nextLibraries[n]))}else{(e.type.params.branchingQuestion.alternatives||[]).map((e=>e.nextContentId)).forEach((e=>{const t=this.parent.getLibrary(e);!1!==t&&"H5P.BranchingQuestion"!==t?.type.library.split(" ")[0]&&(this.nextLibraries[e]=this.createLibraryElement(t,!0),this.wrapper.appendChild(this.nextLibraries[e]))}))}},i.removeNextLibraries=function(){[...this.wrapper.getElementsByClassName("h5p-next")].forEach((e=>{e.parentNode.removeChild(e)}))},i.disableFullscreen=function(e){switch(e.libraryInfo.machineName){case"H5P.CoursePresentation":e.$fullScreenButton&&e.$fullScreenButton.remove();break;case"H5P.InteractiveVideo":e.on("controls",(()=>{e.controls.$fullscreen&&e.controls.$fullscreen.remove()}))}},i.bubbleUp=function(e,t,n){e.on(t,(e=>{n.bubblingUpwards=!0,n.trigger(t,e),n.bubblingUpwards=!1}))},i.hasValidVideo=function(e){const t=e.type,n=t.metadata.contentType;let r="Interactive Video"===n?t.params.interactiveVideo.video.files:t.params.sources;return!(!t||"Interactive Video"!==n&&"Video"!==n||!r||!r[0].mime||"video/unknown"===r[0].mime||!("video/webm"!==r[0].mime&&"video/mp4"!==r[0].mime||H5P.VideoHtml5.canPlay(r)))},i.show=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this.parent.params.content[this.currentLibraryId];!0!==this.libraryFinishingRequirements[this.currentLibraryId]||!this.hasValidVideo(t)&&"H5P.CoursePresentation"!==t.type.library.split(" ")[0]||(this.contentOverlays[this.currentLibraryId].hide(),this.parent.disableNavButton()),this.isShowing=!0,this.wrapper.classList.remove("h5p-branching-hidden");const n=()=>{this.wrapper.classList.remove("h5p-next-screen"),this.wrapper.classList.remove("h5p-slide-in"),this.wrapper.classList.add("h5p-current-screen"),this.parent.navigating=!1,this.wrapper.style.minHeight=this.parent.currentHeight,e.skipFocus||this.libraryTitle.focus()};e.skipAnimation?n():(this.wrapper.classList.add("h5p-slide-in"),this.wrapper.addEventListener("animationend",(e=>{"h5p-next-screen h5p-slide-in"===e.target.className&&n()})))},i.hide=function(e){this.isShowing=!1;for(let e=0;e<this.nextLibraries.length;e++)this.nextLibraries[e].style.display="none",null!==this.nextLibraries[e].parentNode&&this.nextLibraries[e].parentNode.removeChild(this.nextLibraries[e]);this.overlay&&(null!==this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=void 0,this.branchingQuestions.forEach((e=>{null!==e.parentNode&&e.parentNode.removeChild(e)}))),this.wrapper.classList.add("h5p-slide-out");const t=()=>{this.wrapper.classList.remove("h5p-current-screen"),this.wrapper.classList.add("h5p-next-screen"),this.wrapper.classList.remove("h5p-slide-out"),this.wrapper.classList.remove("h5p-slide-out-reverse"),this.wrapper.classList.remove("h5p-slide-pseudo"),setTimeout((()=>{null!==this.wrapper.parentNode&&(this.wrapper.parentNode.removeChild(this.wrapper),this.remove(),this.parent.trigger("resize"))}),100)};e?window.setTimeout((()=>{t()}),800):this.wrapper.addEventListener("animationend",(()=>{t()}))},i.hideFeedbackDialogs=function(){this.overlay&&(null!==this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=void 0,this.showBackgroundToReadspeaker());const e=document.querySelector(".h5p-current-screen");if(!e)return;const t=e.querySelector(".h5p-branching-question-wrapper");t&&t.parentNode.removeChild(t)},i.resizeScreen=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.questionContainer)return;let t=e?this.parent.startScreen.screenWrapper:this.wrapper;const n=window.getComputedStyle(this.questionContainer,null),r=parseInt(n.getPropertyValue("padding-top"));t.style.height=`${this.questionContainer.offsetHeight+r}px`},i.showNextLibrary=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.nextLibraryId=e.nextContentId,this.libraryFeedback=e.feedback,r.isBranching(e)){!0===this.parent.params.behaviour&&this.parent.disableNavButton(),this.branchingQuestions.forEach((e=>{null!==e.parentNode&&e.parentNode.removeChild(e)}));const t=document.querySelector(".h5p-current-screen");void 0===this.overlay&&(this.overlay=document.createElement("div"),this.overlay.className="h5p-branching-scenario-overlay",t.appendChild(this.overlay),this.hideBackgroundFromReadspeaker());const s=document.createElement("div");s.classList.add("h5p-nav-button-wrapper"),-1!==this.parent.backwardsAllowedFlags.indexOf(!0)&&(this.bqBackButton=this.createBackButton(this.parent.params.l10n.backButtonText),this.bqBackButton.setAttribute("isBQ",!0),!1===this.parent.canEnableBackButton(e.contentId)&&(this.bqBackButton.classList.add("h5p-disabled"),this.bqBackButton.setAttribute("disabled",!0)),s.appendChild(this.bqBackButton));const a=document.createElement("div");a.className="h5p-branching-question-wrapper",this.appendRunnable(a,e.type,e.contentId),t.appendChild(a),this.branchingQuestions.push(a),this.currentLibraryId=e.contentId,this.currentLibraryInstance=this.libraryInstances[e.contentId];const c="h5p-branching-question-title-"+r.idCounter++,o=a.querySelector(".h5p-branching-question-container");this.questionContainer=o,o.setAttribute("role","dialog"),o.setAttribute("tabindex","-1"),o.setAttribute("aria-labelledby",c),n||o.classList.add("h5p-start-outside"),o.classList.add("h5p-fly-in"),a.querySelector(".h5p-branching-question-title").id=c;const d=a.querySelector(".h5p-multichoice-wrapper");d.setAttribute("role","group"),d.setAttribute("aria-labelledby",c),document.querySelector(".h5p-branching-question").appendChild(s),this.currentLibraryWrapper.style.zIndex=0;const h=this.parent.isFullScreen(),l=this.parent.container.classList.contains("h5p-mobile-screen");""!==this.currentLibraryWrapper.style.height||this.parent.startScreen.isShowing||h||l?this.parent.startScreen.isShowing&&!h?this.resizeScreen(!0):parseInt(this.currentLibraryWrapper.style.height)<o.offsetHeight&&(this.currentLibraryWrapper.style.height=o.offsetHeight+"px"):this.resizeScreen(),this.createNextLibraries(e),this.parent.navigating=!1,a.addEventListener("animationend",(()=>{const e=a.querySelectorAll(".h5p-branching-question-alternative")[0];i||void 0===e||o.focus()}))}else{let r=!0;!0!==this.libraryFinishingRequirements[e.contentId]||!this.hasValidVideo(e)&&"H5P.CoursePresentation"!==e.type.library.split(" ")[0]||(this.contentOverlays[this.currentLibraryId]?.hide(),this.parent.disableNavButton(),r=!1);document.querySelector(".h5p-proceed-button").innerHTML=e.proceedButtonText;const s=e.type&&e.type.metadata&&e.type.metadata.title?e.type.metadata.title:"";this.libraryTitle.setAttribute("aria-label",s||"Untitled Content"),this.libraryTitle.innerHTML=e.showContentTitle&&s?s:"&nbsp;",n||(this.currentLibraryId===e.contentId?this.currentLibraryWrapper.classList.add("h5p-slide-pseudo"):t?this.currentLibraryWrapper.classList.add("h5p-slide-out-reverse"):this.currentLibraryWrapper.classList.add("h5p-slide-out")),this.overlay&&(null!==this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=void 0,this.branchingQuestions.forEach((e=>{null!==e.parentNode&&e.parentNode.removeChild(e)})),this.showBackgroundToReadspeaker()),this.nextLibraries[e.contentId]||this.createNextLibrary(e);const a=this.nextLibraries[e.contentId];if(!a.offsetParent){const e=document.querySelector(".h5p-screen-footer");this.wrapper.insertBefore(a,e)}t&&(a.classList.remove("h5p-next"),a.classList.add("h5p-previous"));const c=()=>{null!==this.currentLibraryWrapper.parentNode&&this.currentLibraryWrapper.parentNode.removeChild(this.currentLibraryWrapper),this.currentLibraryWrapper=a,this.wrapper.setAttribute("aria-hidden",!1),this.currentLibraryWrapper.classList.remove("h5p-previous"),this.currentLibraryWrapper.classList.remove("h5p-next"),this.currentLibraryWrapper.classList.remove("h5p-slide-in"),this.currentLibraryElement=a.getElementsByClassName("h5p-branching-scenario-content")[0],this.createNextLibraries(e),this.parent.navigating=!1,i||this.libraryTitle.focus(),r&&this.parent.enableNavButton(),this.resize(new H5P.Event("resize",{element:o}))};n||a.classList.add("h5p-slide-in");const o=a.getElementsByClassName("h5p-branching-scenario-content")[0];o.classList.remove("h5p-branching-hidden"),this.currentLibraryId=e.contentId,this.currentLibraryInstance=this.libraryInstances[e.contentId],this.currentLibraryInstance.resize&&this.currentLibraryInstance.resize(),n?c():this.currentLibraryWrapper.addEventListener("animationend",(()=>{c()}))}},i.hideBackgroundFromReadspeaker=function(){this.header.setAttribute("aria-hidden","true"),this.currentLibraryWrapper.setAttribute("aria-hidden","true");let e=document.querySelector(".h5p-container");if(!e&&(e=document.querySelector(".preview-wrapper"),!e))return;this.tabbables=[],e.querySelectorAll("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button, iframe, object, embed, *[tabindex], *[contenteditable], video, audio").forEach((e=>{if(e instanceof HTMLMediaElement)e.controls&&(e.controls=!1,this.tabbables.push({element:e}));else{const t=e.classList.contains("ui-slider-handle")?0:e.getAttribute("tabindex");e.setAttribute("tabindex","-1"),this.tabbables.push({element:e,tabindex:t})}}))},i.showBackgroundToReadspeaker=function(){this.header.setAttribute("aria-hidden","false"),this.currentLibraryWrapper.setAttribute("aria-hidden","false"),this.tabbables&&(this.tabbables.forEach((e=>{const t=e.element;t instanceof HTMLMediaElement?t.controls=!0:void 0!==e.tabindex&&null!==e.tabindex?t.setAttribute("tabindex",e.tabindex):t.removeAttribute("tabindex")})),this.tabbables=null)},i.getElement=function(){return this.wrapper},i.remove=function(){null!==this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper)},i.resize=function(e){const t=this.currentLibraryInstance,n=e?.data?.element??this.currentLibraryElement,r="H5P.Image"===t?.libraryInfo.machineName,i="H5P.CoursePresentation"===t?.libraryInfo.machineName,s="H5P.ImageHotspots"===t?.libraryInfo.machineName,a="H5P.Video"===t?.libraryInfo.machineName,c="H5P.InteractiveVideo"===t?.libraryInfo.machineName,o=t?.width&&t.height,d=n.classList.contains("h5p-youtube"),h=o&&(r||i)||s||a;if(h&&(n.style.width="",n.style.height="",s&&(n.style.maxWidth="")),this.parent.isFullScreen()){if(n.classList.add("h5p-fullscreen"),c&&t.$videoWrapper[0].firstChild.style&&(t.videoHeight=t.$videoWrapper[0].firstChild.style.height),h){const e=a&&void 0!==this.parent.params.content[this.currentLibraryId].type.params.sources?n.getBoundingClientRect():null;if(a&&void 0===this.parent.params.content[this.currentLibraryId].type.params.sources?n.classList.add("h5p-video-no-source"):n.classList.remove("h5p-video-no-source"),e||s||i||r){const r=s?t.options.image.height:a?e.height:t.height,o=s?t.options.image.width:i?t.ratio*r:a?e.width:t.width,h=r/o,l=c?n.lastChild:n,u=l.getBoundingClientRect();if(h>u.height/u.width){const e=u.height*(o/r)+"px";s?l.style.maxWidth=e:l.style.width=e}else{const e=u.width*h+"px";l.style.height=e,d&&null!==n.querySelector("iframe")&&(n.querySelector("iframe").style.height=e)}}}}else{this.parent.startScreen.isShowing?this.resizeScreen(!0):this.overlay?this.resizeScreen():this.wrapper.style.height="";const e=n.getElementsByClassName("h5p-video-wrapper");if(c&&e.length>0){let n=e[0].firstChild;n.style&&(n.style.height=t.videoHeight)}else d&&null!==n.querySelector("iframe")&&(n.querySelector("iframe").style.height="");n.classList.remove("h5p-fullscreen")}t&&(t.trigger("resize",e),this.handleLibraryResize())},r.isBranching=function(e){return!!e?.type?.library&&0===e.type.library.indexOf("H5P.BranchingQuestion ")},i.createNavButtons=function(){const e=document.createElement("div");e.classList.add("h5p-nav-button-wrapper"),-1!==this.parent.backwardsAllowedFlags.indexOf(!0)&&(this.backButton=this.createBackButton(this.parent.params.l10n.backButtonText),e.appendChild(this.backButton)),this.navButton=document.createElement("button"),this.navButton.classList.add("transition"),this.navButton.addEventListener("animationend",(()=>{this.parent.unanimateNavButton()})),this.navButton.addEventListener("click",(()=>{this.parent.proceedButtonInProgress||(this.parent.proceedButtonInProgress=!0,new Promise((e=>{this.handleProceed()&&e(!0)})).then((()=>{this.parent.proceedButtonInProgress=!1})))})),this.navButton.classList.add("h5p-nav-button","h5p-proceed-button");const t=this.parent.getLibrary(this.currentLibraryId).proceedButtonText;this.navButton.appendChild(document.createTextNode(t)),e.appendChild(this.navButton);const n=document.createElement("div");n.classList.add("h5p-screen-footer"),n.appendChild(e),this.wrapper.appendChild(n)},i.resetInstance=function(e){const t=e?this.libraryInstances[e]:this.currentLibraryInstance;t&&t.resetTask?.(),delete this.previousState,delete this.lastNodeId},r}(H5P.EventDispatcher);o.idCounter=0;let d=function(){function e(e){this.params=e,this.scores=[],this.visitedIndex=0}var t=e.prototype;return t.hasEndScreenScore=function(e){return void 0!==e?.feedback?.endScreenScore},t.findBranchingPaths=function(e,t){if(!this.isBranchingQuestion(e))return this.findBranchingEndings(e,t);let n=[];return e.type.params.branchingQuestion.alternatives.forEach(((e,r)=>{const i=t.concat({type:"alternative",index:r,alternativeParent:t[t.length-1].index}),s=this.findBranchingEndings(e,i);n=n.concat(s)})),n},t.findBranchingEndings=function(e,t){if(-1===e.nextContentId)return[t];if(!t.some((t=>"content"===t.type&&t.index===e.nextContentId))){const n=this.params.content[e.nextContentId],r=t.concat({type:"content",index:e.nextContentId,alternativeParent:null});return this.findBranchingPaths(n,r)}return[]},t.calculateMaxScore=function(){return this.params.scoringOptionGroup.scoringOption===h.STATIC_SCORE?this.calculateStaticMaxScore():this.params.scoringOptionGroup.scoringOption===h.DYNAMIC_SCORE?this.calculateDynamicMaxScore():0},t.calculateStaticMaxScore=function(){const e=this.params.endScreens[0].endScreenScore,t=void 0!==e?e:0;return this.params.content.reduce(((e,t)=>{let n=[t];return this.isBranchingQuestion(t)&&(n=t.type.params.branchingQuestion.alternatives),e.concat(n)}),[]).filter((e=>-1===e.nextContentId)).reduce(((e,n)=>{let r=this.hasEndScreenScore(n)?n.feedback.endScreenScore:t;return e>=r?e:r}),0)},t.calculateDynamicMaxScore=function(){return this.scores.reduce(((e,t)=>e+t.maxScore),0)},t.getAlternativeScore=function(e,t){if(!(t>=0))return 0;if(!(e&&e.type&&e.type.params&&e.type.params.branchingQuestion&&e.type.params.branchingQuestion.alternatives&&e.type.params.branchingQuestion.alternatives[t]))return 0;const n=e.type.params.branchingQuestion.alternatives[t];return!this.hasEndScreenScore(n)||void 0===n.nextContentId||n.nextContentId<0?0:n.feedback.endScreenScore},t.getQuestionMaxScore=function(e,t){if(!(t>=0))return 0;const n=e.type.params.branchingQuestion.alternatives;let r=0;return n.forEach(((e,t)=>{n[t].feedback.endScreenScore>r&&-1!==n[t].nextContentId&&(r=n[t].feedback.endScreenScore)})),r},t.getScore=function(e){return this.params.scoringOptionGroup.scoringOption===h.DYNAMIC_SCORE?this.scores.reduce(((e,t)=>e+t.score),0):this.params.scoringOptionGroup.scoringOption===h.STATIC_SCORE?e:0},t.getMaxScore=function(){return this.calculateMaxScore()},t.getCurrentState=function(){return{scores:this.scores,visitedIndex:this.visitedIndex}},t.setState=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.scores&&(this.scores=e.scores),e.visitedIndex&&(this.visitedIndex=e.visitedIndex)},t.restart=function(){this.scores=[],this.visitedIndex=0},t.addLibraryScore=function(e,t,n,r){this.visitedIndex++;const i=this.params.content[e];let s=0,a=0;this.isBranchingQuestion(i)?(s=this.getAlternativeScore(i,n),a=this.getQuestionMaxScore(i,n)):(this.hasEndScreenScore(i)&&i.nextContentId&&i.nextContentId>-1&&(s=i.feedback.endScreenScore,a=i.feedback.endScreenScore),this.params.scoringOptionGroup.includeInteractionsScores&&0!==Object.entries(r).length&&(s+=r.score,a+=r.maxScore));let c=!1,o=null,d=-1;this.scores.forEach(((t,n)=>{if(t.id===e){t.score=s,t.visitedIndex=this.visitedIndex,d=t.visitedIndex;this.scores.length>n+1&&this.params.content[t.id].nextContentId===this.scores[n+1].id?c=!0:o=n}})),c?(this.scores=this.scores.filter((e=>e.visitedIndex<=d)),this.visitedIndex=d):(null!==o&&this.scores.splice(o,1),this.scores.push({visitedIndex:this.visitedIndex,id:e,score:s,maxScore:a}))},t.isBranchingQuestion=function(e){return"H5P.BranchingQuestion"===(e?.type?.library??e).split(" ")[0]},t.isDynamicScoring=function(){return this.params.scoringOptionGroup.scoringOption===h.DYNAMIC_SCORE},t.shouldShowScore=function(){return this.params.scoringOptionGroup.scoringOption===h.STATIC_SCORE||this.isDynamicScoring()},e}();const h={STATIC_SCORE:"static-end-score",DYNAMIC_SCORE:"dynamic-score",NO_SCORE:"no-score"},l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(let e=1;e<t.length;e++)for(let n in t[e])Object.prototype.hasOwnProperty.call(t[e],n)&&("object"==typeof t[0][n]&&"object"==typeof t[e][n]?l(t[0][n],t[e][n]):t[0][n]=t[e][n]);return t[0]};function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}let p=function(e){var t,n;function r(t,n){var r;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(r=e.call(this,"")||this).contentId=n,r.extras=i,r.startScreen={},r.libraryScreen={},r.endScreens={},r.navigating,r.currentHeight,r.currentId=-1,r.userPath=[],r.xAPIData=[],r.backwardsAllowedFlags=[],r.proceedButtonInProgress=!1,r.isReverseTransition=!1,r.params=l({content:[],startScreen:{startScreenTitle:"",startScreenSubtitle:""},endScreens:[{endScreenTitle:"",endScreenSubtitle:"",contentId:-1}],scoringOptionGroup:{scoringOption:"no-score"},l10n:{startScreenButtonText:"Start the course",endScreenButtonText:"Restart the course",proceedButtonText:"Proceed",scoreText:"Your score:",backButtonText:"Back",fullscreenAria:"Fullscreen",replayButtonText:"Replay the video",disableProceedButtonText:"Require to complete the current module"},behaviour:"individual"},t.branchingScenario),r.params.content.forEach(((e,t)=>{e.contentId=t,void 0===e.nextContentId&&(e.nextContentId=-1),r.params.behaviour.randomizeBranchingQuestions&&-1!==e.type.library.indexOf("H5P.BranchingQuestion")&&(e.type.params.branchingQuestion.randomize=!0),e.proceedButtonText=e.proceedButtonText||r.params.l10n.proceedButtonText})),r.backwardsAllowedFlags=r.params.content.map((e=>"useBehavioural"===e.contentBehaviour?r.params.behaviour.enableBackwardsNavigation:"enabled"===e.contentBehaviour)),r.scoring=new d(r.params),r.restoreState(r.extras.previousState),r.on("exitFullScreen",(()=>{window.setTimeout((()=>{r.trigger("resize")}),100)})),r.on("started",(()=>{const e=r.params.content[0];!1===r.canEnableBackButton(0)?r.disableBackButton():r.enableBackButton(),"H5P.BranchingQuestion"===e?.type?.library?.split(" ")[0]?r.trigger("navigated",{nextContentId:0}):(r.startScreen.hide(),r.libraryScreen.show(),r.triggerXAPI("progressed"),0===r.userPath.length&&r.userPath.push(0)),r.currentId=0})),r.on("navigated",(e=>{e.data.reverse&&(r.libraryScreen?.wrapper&&(r.libraryScreen.wrapper.style.height=""),r.userPath.pop(),e.data.nextContentId=r.userPath.pop()||0);const t=parseInt(e.data.nextContentId),n=r.container.querySelector('.h5p-back-button[isBQ="true"]');r.currentId>-1&&o.isBranching(r.getLibrary(r.currentId))&&n&&n.remove();const i=r.getLibrary(t);let s=!0;if(r.libraryScreen.stopPlayback(r.currentId),!r.params.preventXAPI){const e=r.libraryScreen.getXAPIData(r.currentId),t=o.isBranching(r.getLibrary(r.currentId)),n=t&&void 0!==e.statement?.result?.response;!e||t&&!n||r.xAPIData.push(e)}if(e.data.isResuming||o.isBranching(r.getLibrary(r.currentId))&&r.libraryScreen.resetInstance(),o.isBranching(r.getLibrary(r.currentId))&&document.querySelector(".h5p-current-screen").setAttribute("aria-hidden",!0),r.currentEndScreen?.isShowing?i?o.isBranching(i)||(r.currentEndScreen.hide(),r.currentEndScreen=null,r.libraryScreen.show({skipAnimation:e.data.isResuming})):(r.libraryScreen.hideFeedbackDialogs(),r.currentEndScreen.hide({skipAnimation:e.data.isResuming}),r.currentEndScreen=null):r.startScreen?.isShowing&&i?o.isBranching(i)||(r.startScreen.hide({skipAnimation:e.data.isResuming}),r.libraryScreen.show({skipAnimation:e.data.isResuming,skipFocus:e.data.isResuming}),s=!1):r.libraryScreen.hideFeedbackDialogs(),s&&r.trigger("resize"),-1!==r.currentId){r.triggerXAPI("progressed");let t={};r.libraryScreen.currentLibraryInstance?.getScore&&(t={score:r.libraryScreen.currentLibraryInstance.getScore(),maxScore:r.libraryScreen.currentLibraryInstance.getMaxScore()}),r.scoring.addLibraryScore(r.currentId,r.libraryScreen.currentLibraryId,e.data.chosenAlternative,t)}if(!1===i){if(r.currentEndScreen=r.endScreens[t],e.data.feedback){const t=r.createEndScreen({endScreenTitle:e.data.feedback.title||"",endScreenSubtitle:e.data.feedback.subtitle||"",endScreenImage:e.data.feedback.image,endScreenScore:e.data.feedback.endScreenScore});r.container.append(t.getElement()),r.currentEndScreen=t}else r.scoring.isDynamicScoring()&&(r.currentEndScreen.setScore(r.getScore()),r.currentEndScreen.setMaxScore(r.getMaxScore()));r.startScreen.hide(),r.libraryScreen.hide(!0),r.currentEndScreen.show(),r.triggerXAPICompleted(r.scoring.getScore(r.currentEndScreen.getScore()),r.scoring.getMaxScore())}else r.libraryScreen.showNextLibrary(i,e.data.reverse,e.data.isResuming,e.data.isResuming),!1===r.canEnableBackButton(t)?r.disableBackButton():r.enableBackButton(),r.currentId=t;if(0!==e.data.nextContentId&&document.querySelector(".h5p-start-screen").classList.contains("h5p-current-screen")){const e=r.libraryScreen.wrapper.querySelector(".h5p-slide-in");e&&(e.classList.remove("h5p-next"),r.startScreen.hide(),r.libraryScreen.show())}e.data.isResuming||r.userPath.push(t)})),r.on("restarted",(e=>{r.resetTask({keepStates:e.data?.keepStates??!1})})),r.on("resize",(e=>{if(r.bubblingUpwards)return;r.changeLayoutToFitWidth(),r.libraryScreen?.resize?.(e);const t=r.container.getBoundingClientRect();t.width<=480?r.container.classList.add("h5p-phone-size"):r.container.classList.remove("h5p-phone-size"),t.width<768?r.container.classList.add("h5p-medium-tablet-size"):r.container.classList.remove("h5p-medium-tablet-size")})),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,u(t,n);var s=r.prototype;return s.restoreState=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.scoring&&this.scoring.setState(e.scoring),this.userPath=e.userPath||[],this.xAPIData=e.xAPIData||[]},s.restoreView=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===this.userPath.length);else if(e.endScreen){const t=this.createEndScreen({...e.endScreen,isCurrentScreen:!0});this.container.append(t.getElement()),this.currentEndScreen=t,this.startScreen.hide({skipAnimation:!0}),this.libraryScreen.hide(!0),this.currentEndScreen.show({skipAnimation:!0,skipFocus:!0})}else{const e=this.userPath[this.userPath.length-1];if(o.isBranching(this.getLibrary(e))&&this.userPath.length>1){const e=this.userPath[this.userPath.length-2];this.trigger("navigated",{nextContentId:e,isResuming:!0})}this.trigger("navigated",{nextContentId:e,isResuming:!0})}},s.createStartScreen=function(e,t){let{startScreenTitle:n,startScreenSubtitle:r,startScreenImage:s,startScreenAltText:a}=e;const c=new i(this,{isStartScreen:!0,titleText:n,subtitleText:r,image:s,altText:a,fullscreenAria:this.params.l10n.fullscreenAria,buttonText:this.params.l10n.startScreenButtonText,isCurrentScreen:t});return c.on("toggleFullScreen",(()=>{this.toggleFullScreen()})),c},s.createEndScreen=function(e){const t=new i(this,{isStartScreen:!1,titleText:e.endScreenTitle,subtitleText:e.endScreenSubtitle,image:e.endScreenImage,buttonText:this.params.l10n.endScreenButtonText,fullscreenAria:this.params.l10n.fullscreenAria,isCurrentScreen:!1,scoreText:this.params.l10n.scoreText,score:this.scoring.getScore(e.endScreenScore),maxScore:this.scoring.getMaxScore(),showScore:this.scoring.shouldShowScore()});return t.on("toggleFullScreen",(()=>{this.toggleFullScreen()})),t},s.getLibrary=function(e){return void 0!==this.params.content[e]&&this.params.content[e]},s.toggleFullScreen=function(){this.isFullScreen()?H5P.exitFullScreen?.():H5P.fullScreen(H5P.jQuery(this.container),this)},s.isFullScreen=function(){return H5P.isFullscreen||this.container?.classList.contains("h5p-fullscreen")||this.container?.classList.contains("h5p-semi-fullscreen")},s.disableNavButton=function(){this.libraryScreen.navButton&&(this.libraryScreen.navButton.classList.add("h5p-disabled"),this.libraryScreen.navButton.setAttribute("disabled",!0),this.libraryScreen.navButton.setAttribute("title",this.params.l10n.disableProceedButtonText))},s.enableNavButton=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.libraryScreen.navButton&&(this.libraryScreen.navButton.classList.remove("h5p-disabled"),this.libraryScreen.navButton.removeAttribute("disabled"),this.libraryScreen.navButton.removeAttribute("title"),e&&this.animateNavButton())},s.hideNavButton=function(){this.libraryScreen.navButton&&this.libraryScreen.navButton.classList.add("h5p-hidden")},s.showNavButton=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.libraryScreen.navButton)return;this.libraryScreen.navButton.classList.remove("h5p-hidden"),document.activeElement.blur();e&&this.animateNavButton(),setTimeout((()=>{this.libraryScreen.navButton.focus()}),100)},s.animateNavButton=function(){this.libraryScreen.navButton.classList.contains("h5p-animate")||this.libraryScreen.navButton.classList.add("h5p-animate")},s.unanimateNavButton=function(){this.libraryScreen.navButton.classList.remove("h5p-animate")},s.getScore=function(){return this.scoring.getScore()},s.getMaxScore=function(){return this.scoring.getMaxScore()},s.resetTask=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.currentEndScreen&&(this.currentEndScreen.hide(),this.currentEndScreen=null),this.scoring.restart(),this.startScreen.screenWrapper.style.height="",this.startScreen.screenWrapper.classList.remove("h5p-slide-out"),this.startScreen.show({slideBack:this.isReverseTransition}),this.isReverseTransition=!1,this.currentId=-1,this.userPath=[],this.xAPIData=[],e.keepStates||delete this.extras.previousState,this.libraryScreen&&this.libraryScreen.remove(),this.libraryScreen=new o(this,this.params.startScreen.startScreenTitle,this.getLibrary(0),this.extras.previousState?.child),this.libraryScreen.on("toggleFullScreen",(()=>{this.toggleFullScreen()})),this.container.append(this.libraryScreen.getElement())},s.changeLayoutToFitWidth=function(){const e=window.getComputedStyle(document.getElementsByTagName("body")[0]),t=parseInt(e.fontSize,10);this.container.offsetWidth/t>43?this.container.classList.add("h5p-wide-screen"):this.container.classList.add("h5p-mobile-screen")},s.disableBackButton=function(){this.libraryScreen?.backButton&&(this.libraryScreen.backButton.classList.add("h5p-disabled"),this.libraryScreen.backButton.setAttribute("disabled",!0))},s.enableBackButton=function(){this.libraryScreen?.backButton&&(this.libraryScreen.backButton.classList.remove("h5p-disabled"),this.libraryScreen.backButton.removeAttribute("disabled"))},s.canEnableBackButton=function(e){return"number"==typeof e&&(!(e<0||e>this.backwardsAllowedFlags.length-1)&&this.backwardsAllowedFlags[e])},s.attach=function(e){if(void 0!==this.isRoot&&this.isRoot()&&this.setActivityStarted(),this.container=e.get(0),this.container.classList.add("h5p-branching-scenario"),this.container.innerHTML="",!this.params.content?.length){const e=document.createElement("div");return e.innerHTML="No content",void this.container.append(e)}this.startScreen=this.createStartScreen(this.params.startScreen,!0),this.container.append(this.startScreen.getElement()),this.currentId=-1,this.libraryScreen=new o(this,this.params.startScreen.startScreenTitle,this.getLibrary(0),this.extras.previousState?.child,this.extras.previousState?.userPath?.slice(-1)[0]),this.libraryScreen.on("toggleFullScreen",(()=>{this.toggleFullScreen()})),this.container.append(this.libraryScreen.getElement()),this.params.endScreens.forEach((e=>{this.endScreens[e.contentId]=this.createEndScreen(e),this.container.append(this.endScreens[e.contentId].getElement())})),this.restoreView(this.extras.previousState)},s.getXAPIData=function(){if(!this.currentEndScreen)return;const e=this.createXAPIEventTemplate("answered");let t=e.getVerifiedStatementValue(["object","definition"]);l(t,{interactionType:"compound",type:"http://adlnet.gov/expapi/activities/cmi.interaction"}),l(t.extensions,{"https://h5p.org/x-api/no-question-score":1});const n=this.scoring.getScore(this.currentEndScreen.getScore()),r=this.scoring.getMaxScore();return e.setScoredResult(n,r,this,!0,n===r),{statement:e.data.statement,children:this.xAPIData}},s.getCurrentState=function(){if(!this.libraryScreen.getCurrentState)return null;if(0===this.userPath.length)return null;const e={userPath:this.userPath,scoring:this.scoring.getCurrentState(),child:this.libraryScreen.getCurrentState(),xAPIData:this.xAPIData};return this.currentEndScreen&&(e.endScreen=this.currentEndScreen.getRecreationData()),e},r}(H5P.EventDispatcher);H5P.BranchingScenario=p}();;H5P.BranchingQuestion = (function () {

  /**
   * @param {object} parameters Parameters passed by the editor.
   * @param {number} contentId Content's id.
   * @param {object} [extras] Saved state, metadata, etc.
   */
  function BranchingQuestion(parameters, contentid, extras = {}) {
    var self = this;
    H5P.EventDispatcher.call(self);
    this.container = null;
    self.alternativeDOMs = {};
    let alternativesOrder = extras.previousState?.order ?? [];
    let answered;
    let timestamp;

    /**
     * Get closest ancestor of DOM element that matches selector.
     *
     * Mimics Element.closest(), workaround for IE11.
     *
     * @param {Element} element DOM element.
     * @param {string} selector CSS selector.
     * @return {Element|null} Element, if found. Else null.
     */
    const getClosestParent = function (element, selector) {
      if (!document.documentElement.contains(element)) {
        return null;
      }
      if (!Element.prototype.matches) {
        Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
      }

      do {
        if (element.matches(selector)) {
          return element;
        }
        element = element.parentElement || element.parentNode;
      }
      while (element !== null && element.nodeType === 1);
      return null;
    };

    var createWrapper = function () {
      var wrapper = document.createElement('div');
      wrapper.classList.add('h5p-branching-question');

      var icon = document.createElement('img');
      icon.classList.add('h5p-branching-question-icon');
      icon.src = self.getLibraryFilePath('branching-question-icon.svg');

      wrapper.appendChild(icon);

      return wrapper;
    };

    var appendMultiChoiceSection = function (parameters, wrapper) {
      var questionWrapper = document.createElement('div');
      questionWrapper.classList.add('h5p-multichoice-wrapper');

      var title = document.createElement('div');
      title.classList.add('h5p-branching-question-title');
      if (parameters.branchingQuestion.question) {
        title.innerHTML = parameters.branchingQuestion.question;
      }

      questionWrapper.appendChild(title);

      const alternatives = parameters.branchingQuestion.alternatives || [] ;
      alternatives.forEach(function (altParams, index, array) {
        const alternative = createAlternativeContainer(altParams.text, index);
        alternative.nextContentId = altParams.nextContentId;

        // Create feedback screen if it exists
        const hasFeedback = altParams.feedback && !!(
          altParams.feedback.title && altParams.feedback.title.trim() ||
          altParams.feedback.subtitle && altParams.feedback.subtitle.trim() ||
          altParams.feedback.image
        );
        if (hasFeedback && altParams.nextContentId !== -1) {
          alternative.feedbackScreen = createFeedbackScreen(
            altParams.feedback,
            alternative.nextContentId,
            index
          );
          alternative.proceedButton = alternative.feedbackScreen.querySelectorAll('button')[0];
        }
        alternative.hasFeedback = altParams.feedback && !!(hasFeedback || altParams.feedback.endScreenScore !== undefined);
        alternative.feedback = altParams.feedback;

        alternative.addEventListener('keyup', function (event) {
          if (event.which === 13 || event.which === 32) {
            this.click();
          }
        });

        alternative.onclick = function (e) {
          if (this.feedbackScreen !== undefined) {
            if (self.container) {
              self.container.classList.add('h5p-branching-scenario-feedback-dialog');
            }
            wrapper.innerHTML = '';
            wrapper.appendChild(this.feedbackScreen);
            self.parent.trigger('resize');
            answered = index;
            timestamp = new Date().toISOString();
            const container = document.querySelector('.h5p-branching-question-container');
            if (container?.hasAttribute('role')) {
              container.removeAttribute('role');
              container.removeAttribute('aria-labelledby');
            }
            this.feedbackScreen.setAttribute('role', 'dialog');
            this.feedbackScreen.setAttribute('aria-labelledby', 'h5p-feedback-content-title');
            this.feedbackScreen.setAttribute('aria-describedby', 'h5p-feedback-content-content');
            this.proceedButton.focus();
            self.triggerXAPI('interacted');
          }
          else {

            var currentAlt = e.target.classList.contains('.h5p-branching-question-alternative') ?
              e.target : getClosestParent(e.target, '.h5p-branching-question-alternative');
            var alts = questionWrapper.querySelectorAll('.h5p-branching-question-alternative');
            var index2;
            for (var i = 0; i < alts.length; i++) {
              if (alts[i] === currentAlt) {
                index2 = +alts[i].getAttribute('data-id');
                break;
              }
            }
            answered = index2;
            timestamp = new Date().toISOString();

            var nextScreen = {
              nextContentId: this.nextContentId,
              chosenAlternative: index2,
            };

            const currentAltParams = parameters.branchingQuestion.alternatives[index2];
            const currentAltHasFeedback = !!(currentAltParams.feedback.title
              || currentAltParams.feedback.subtitle
              || currentAltParams.feedback.image
              || currentAltParams.feedback.endScreenScore !== undefined
            );

            if (index2 >= 0 && currentAltHasFeedback) {
              nextScreen.feedback = currentAltParams.feedback;
            }
            self.trigger('navigated', nextScreen);
          }
        };

        self.alternativeDOMs[index] = alternative;
        questionWrapper.appendChild(alternative);
      });

      if (parameters.branchingQuestion.randomize && !questionWrapper.dataset.shuffled) {

        const alternatives = [...questionWrapper.querySelectorAll('button.h5p-branching-question-alternative')];
        let shuffledAlternatives;
        /*
         * Within Branching Question, once the order of the alternatives has
         * been randomized, it should remain the same until the Branching
         * Scenario is restarted. That means the order must always be part of
         * the state.
         */
        if (alternativesOrder.length) {
          shuffledAlternatives = alternativesOrder.map((index) => {
            return alternatives[index];
          });
        }
        else {
          // H5P.shuffleArray works in place, so we need to create a copy
          shuffledAlternatives = H5P.shuffleArray([...alternatives]);

          alternativesOrder = shuffledAlternatives.map((alternative) => {
            return alternatives.indexOf(alternative);
          });
        }

        // Reorder the alternatives according to shuffledAlternatives
        shuffledAlternatives.forEach(function (alternative) {
          questionWrapper.appendChild(alternative);
        });

        // Prevent shuffling more than once
        questionWrapper.setAttribute('data-shuffled', true);
      }

      wrapper.appendChild(questionWrapper);
      return wrapper;
    };

    var createAlternativeContainer = function (text, id) {
      var wrapper = document.createElement('button');
      wrapper.classList.add('h5p-branching-question-alternative');
      wrapper.tabIndex = 0;
      wrapper.setAttribute('data-id', id);

      var alternativeText = document.createElement('p');
      alternativeText.innerHTML = text;

      wrapper.appendChild(alternativeText);
      return wrapper;
    };

    var createFeedbackScreen = function (feedback, nextContentId, chosenAlternativeIndex) {

      var wrapper = document.createElement('div');
      wrapper.classList.add('h5p-branching-question');
      wrapper.classList.add(feedback.image !== undefined ? 'h5p-feedback-has-image' : 'h5p-feedback-default');

      if (feedback.image !== undefined && feedback.image.path !== undefined) {
        var imageContainer = document.createElement('div');
        imageContainer.classList.add('h5p-branching-question');
        imageContainer.classList.add('h5p-feedback-image');
        var image = document.createElement('img');
        image.src = H5P.getPath(feedback.image.path, self.contentId);
        imageContainer.appendChild(image);
        wrapper.appendChild(imageContainer);
      }

      var feedbackContent = document.createElement('div');
      feedbackContent.classList.add('h5p-branching-question');
      feedbackContent.classList.add('h5p-feedback-content');

      var feedbackText = document.createElement('div');
      feedbackText.classList.add('h5p-feedback-content-content');
      feedbackContent.appendChild(feedbackText);

      var title = document.createElement('h1');
      title.innerHTML = feedback.title || '';
      title.id = 'h5p-feedback-content-title';
      feedbackText.appendChild(title);

      if (feedback.subtitle) {
        var subtitle = document.createElement('div');
        subtitle.id = 'h5p-feedback-content-content';
        subtitle.innerHTML = feedback.subtitle || '';
        feedbackText.appendChild(subtitle);
      }

      var navButton = document.createElement('button');
      navButton.onclick = function () {
        self.trigger('navigated', {
          nextContentId: nextContentId,
          chosenAlternative: chosenAlternativeIndex
        });
      };

      var text = document.createTextNode(parameters.proceedButtonText);
      navButton.appendChild(text);

      feedbackContent.appendChild(navButton);

      wrapper.appendChild(feedbackContent);

      return wrapper;
    };

    /**
     * Get xAPI data.
     * Contract used by report rendering engine.
     *
     * @see contract at {@link https://h5p.org/documentation/developers/contracts#guides-header-6}
     */
    self.getXAPIData = function () {
      var xAPIEvent = this.createXAPIEventTemplate('answered');
      addQuestionToXAPI(xAPIEvent);
      xAPIEvent.setScoredResult(undefined, undefined, self, true);
      xAPIEvent.data.statement.result.response = answered;
      xAPIEvent.data.statement.timestamp = timestamp;
      return {
        statement: xAPIEvent.data.statement
      };
    };

    /**
     * If the chosen answer contains feedback data, adds an extension to the
     * provided extensions object, so that it can be included in reports.
     *
     * @param {object} extensions Existing object to use
     */
    var addFeedbackInfoExtension = function (extensions) {
      const alternatives = parameters.branchingQuestion.alternatives;
      const chosen = alternatives[answered];
      const feedback = chosen.feedback;

      if (!feedback.title && !feedback.subtitle && !feedback.image) {
        return; // Nothing to add
      }

      const xapiFeedback = {};
      const converter = document.createElement('div');

      if (feedback.image) {
        xapiFeedback.imageUrl = H5P.getPath(
          feedback.image.path,
          self.parent.contentId
        );
      }

      if (feedback.title) {
        converter.innerHTML = feedback.title;
        xapiFeedback.title = converter.innerText.trim();
      }

      if (feedback.subtitle) {
        converter.innerHTML = feedback.subtitle;
        xapiFeedback.subtitle = converter.innerText.trim();
      }

      const key = 'https://h5p.org/x-api/branching-choice-feedback';
      extensions[key] = xapiFeedback;
    };

    /**
     * Determine whether the Branching Scenario is using dynamic score.
     *
     * @return {boolean}
     */
    var contentIsUsingDynamicScore = function () {
      return (
        self.parent &&
        self.parent.params &&
        self.parent.params.scoringOptionGroup &&
        self.parent.params.scoringOptionGroup.scoringOption === 'dynamic-score'
      );
    };

    /**
     * If applicable, adds scoring and correctness information to the xAPI
     * statement for use in reports.
     *
     * @param {object} definition xAPI object definition
     * @param {array} alternatives Available branching choices
     */
    var addScoringAndCorrectness = function (definition, alternatives) {
      // Only include scoring and correctness data for dynamic score option
      if (!contentIsUsingDynamicScore()) {
        return;
      }

      // Track each possible score and the alternatives that award it
      const scoreMap = new Map();

      for (let i = 0; i < alternatives.length; i++) {
        const currentScore = alternatives[i].feedback.endScreenScore;

        if (typeof currentScore === 'number' && currentScore > 0) {
          if (scoreMap.has(currentScore)) {
            scoreMap.get(currentScore).push(i);
          }
          else {
            scoreMap.set(currentScore, [i]);
          }
        }
      }

      if (scoreMap.size > 0) {
        // All alternatives that give the max score are considered correct
        // See https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#correct-responses-pattern
        const maxScore = Math.max(...scoreMap.keys());
        definition.correctResponsesPattern = scoreMap.get(maxScore);

        // Use an extension in order to provide the points awarded by each alternative
        const extensionKey = 'https://h5p.org/x-api/alternatives-with-score';
        definition.extensions[extensionKey] = {};
        scoreMap.forEach((alternatives, score) => {
          alternatives.forEach(alternative => {
            definition.extensions[extensionKey][alternative] = score;
          });
        });

        // Remove extension that indicates there is no correct answer
        delete definition.extensions['https://h5p.org/x-api/no-correct-answer'];
      }
    };

    /**
     * Add the question to the given xAPIEvent
     *
     * @param {H5P.XAPIEvent} xAPIEvent
     */
    var addQuestionToXAPI = function (xAPIEvent) {
      const converter = document.createElement('div');

      var definition = xAPIEvent.getVerifiedStatementValue(['object', 'definition']);
      converter.innerHTML = parameters.branchingQuestion.question;
      definition.description = {
        'en-US': converter.innerText
      };
      definition.type = 'http://adlnet.gov/expapi/activities/cmi.interaction';
      definition.interactionType = 'choice';
      definition.correctResponsesPattern = [];
      definition.choices = [];
      definition.extensions = {
        'https://h5p.org/x-api/no-correct-answer': 1
      };

      const alternatives = parameters.branchingQuestion.alternatives;
      for (let i = 0; i < alternatives.length; i++) {
        converter.innerHTML = alternatives[i].text;
        definition.choices[i] = {
          'id': i + '',
          'description': {
            'en-US': converter.innerText
          }
        };
      }

      addScoringAndCorrectness(definition, alternatives);
      if (answered !== undefined) {
        addFeedbackInfoExtension(definition.extensions);
      }
    };

    /**
     * TODO
     */
    self.attach = function ($container) {
      this.container = $container[0];

      this.questionContainer = document.createElement('div');
      this.questionContainer.classList.add('h5p-branching-question-container');

      var branchingQuestion = createWrapper(parameters);
      branchingQuestion = appendMultiChoiceSection(parameters, branchingQuestion);
      this.questionContainer.appendChild(branchingQuestion);

      this.container.append(this.questionContainer);

      if (typeof extras.previousState?.answered === 'number') {
        /*
         * Using click() as a cheap way of recreating the feedback without
         * having to refactor large parts of the code.
         */
        window.requestAnimationFrame(() => {
          self.alternativeDOMs[extras.previousState.answered]?.click();
        });
      }
    };

    /**
     * Reset task.
     * @see contract at {@link https://h5p.org/documentation/developers/contracts#guides-header-5}
     */
    self.resetTask = function () {
      answered = undefined;
      timestamp = undefined;
      delete extras.previousState;

      /*
       * Remove feedback dialog if it exists and reset the container.
       * Note that resetting will remove the "Back" button that was injected by
       * Branching Scenario and will need to be re-created there if it
       * gets necessary.
       */
      if (
        self.container.classList
          .contains('h5p-branching-scenario-feedback-dialog')
      ) {
        self.container.classList
          .remove('h5p-branching-scenario-feedback-dialog');
        self.container.innerHTML = '';
        self.attach(H5P.jQuery(self.container));
      }
    };

    /**
     * Get current state.
     * @returns {object} Current state to be retrieved later.
     * @see contract at {@link https://h5p.org/documentation/developers/contracts#guides-header-7}
     */
    self.getCurrentState = () => {
      /*
       * A content type should normally not return a state if the user has
       * not interacted with the content type yet. However, the order of the
       * answer options should remain the same until the Branching Scenario
       * is restarted. That means the order must always be part of the state.
       * Since the Branching Question is only used in the Branching Scenario,
       * we can safely return the state even if the user has not interacted to
       * prevent adding more complexity to Branching Scenario for keeping track
       * of the order and for restoring it here.
       */
      return {
        order: alternativesOrder,
        answered: answered
      };
    };
  }

  return BranchingQuestion;

})();
;		(function(xopen, fetch, dataurls) {

			switch(location.protocol.split(':')[0]) {
				case 'http':
				case 'https':
					return;
			};

			const url2data	= function(oldurl) {
					switch(oldurl.split(':')[0]) {
						case 'blob':
							console.log('blob', oldurl);
						case 'data':
							return oldurl;
					}
					let urltoks	 = oldurl.replace(H5PIntegration.url, '.').split('/');
					if(urltoks[0] == '.') {
						urltoks.shift();
						const url	= urltoks.join('/');
						if(typeof dataurls[url]!=='undefined') {
							if(dataurls[url][0]=='application/json') {
								return 'data:application/json;text,' + dataurls[url][1];
							}
							return 'data:' + dataurls[url].join(';base64,');
						}
					}
					console.error('url not found:', oldurl);
					return "data:;text,";
			};
			window.fetch = function() {
				arguments[0]	= url2data(arguments[0]);
				return fetch.apply(this, arguments);
			};
			XMLHttpRequest.prototype.open = function() {
				arguments[1]	= url2data(arguments[1]);
				return xopen.apply(this, arguments);
			};
		})(XMLHttpRequest.prototype.open, window.fetch, {"libraries\/H5P.AdvancedText-1.1\/library.json":["application\/json","{\"title\":\"Text\",\"description\":\"A simple library that displays text with all kinds of styling.\",\"majorVersion\":1,\"minorVersion\":1,\"patchVersion\":16,\"runnable\":0,\"machineName\":\"H5P.AdvancedText\",\"author\":\"Joubel\",\"preloadedJs\":[{\"path\":\"text.js\"}],\"preloadedCss\":[{\"path\":\"text.css\"}],\"metadataSettings\":{\"disable\":0,\"disableExtraTitleField\":1}}"],"libraries\/H5P.Image-1.1\/library.json":["application\/json","{\"title\":\"Image\",\"contentType\":\"Media\",\"description\":\"Simple library that displays an image.\",\"majorVersion\":1,\"minorVersion\":1,\"patchVersion\":22,\"runnable\":0,\"machineName\":\"H5P.Image\",\"author\":\"Joubel\",\"coreApi\":{\"majorVersion\":1,\"minorVersion\":19},\"preloadedJs\":[{\"path\":\"image.js\"}],\"preloadedCss\":[{\"path\":\"image.css\"}],\"metadataSettings\":{\"disable\":0,\"disableExtraTitleField\":1},\"editorDependencies\":[{\"machineName\":\"H5PEditor.ShowWhen\",\"majorVersion\":1,\"minorVersion\":0}]}"],"libraries\/H5PEditor.ShowWhen-1.0\/library.json":["application\/json","{\"machineName\":\"H5PEditor.ShowWhen\",\"title\":\"Toggle visibility of a field based on rules\",\"license\":\"MIT\",\"author\":\"fnoks\",\"majorVersion\":1,\"minorVersion\":0,\"patchVersion\":9,\"runnable\":0,\"preloadedJs\":[{\"path\":\"h5p-show-when.js\"}],\"preloadedCss\":[{\"path\":\"h5p-show-when.css\"}]}"],"libraries\/H5P.BranchingQuestion-1.0\/library.json":["application\/json","{\"title\":\"Branching Question\",\"description\":\"description\",\"majorVersion\":1,\"minorVersion\":0,\"patchVersion\":20,\"runnable\":0,\"metadata\":0,\"author\":\"Joubel AS\",\"license\":\"MIT\",\"machineName\":\"H5P.BranchingQuestion\",\"preloadedJs\":[{\"path\":\"branchingQuestion.js\"}],\"preloadedCss\":[{\"path\":\"branchingQuestion.css\"}],\"preloadedDependencies\":[{\"machineName\":\"FontAwesome\",\"majorVersion\":4,\"minorVersion\":5}],\"editorDependencies\":[{\"machineName\":\"H5PEditor.ShowWhen\",\"majorVersion\":1,\"minorVersion\":0},{\"machineName\":\"H5PEditor.BranchingQuestion\",\"majorVersion\":1,\"minorVersion\":0}]}"],"libraries\/FontAwesome-4.5\/library.json":["application\/json","{\"title\":\"Font Awesome\",\"contentType\":\"Font\",\"majorVersion\":4,\"minorVersion\":5,\"patchVersion\":6,\"runnable\":0,\"machineName\":\"FontAwesome\",\"license\":\"MIT\",\"author\":\"Dave Gandy\",\"preloadedCss\":[{\"path\":\"h5p-font-awesome.min.css\"}]}"],"libraries\/H5PEditor.BranchingQuestion-1.0\/library.json":["application\/json","{\"title\":\"Branching Question Editor\",\"majorVersion\":1,\"minorVersion\":0,\"patchVersion\":5,\"runnable\":0,\"machineName\":\"H5PEditor.BranchingQuestion\",\"author\":\"thomasmars\",\"coreApi\":{\"majorVersion\":1,\"minorVersion\":24},\"preloadedJs\":[{\"path\":\"index.js\"}]}"],"libraries\/H5P.BranchingScenario-1.8\/library.json":["application\/json","{\"title\":\"Branching Scenario\",\"description\":\"description\",\"majorVersion\":1,\"minorVersion\":8,\"patchVersion\":14,\"runnable\":1,\"embedTypes\":[\"iframe\"],\"coreApi\":{\"majorVersion\":1,\"minorVersion\":26},\"author\":\"Joubel AS\",\"license\":\"MIT\",\"machineName\":\"H5P.BranchingScenario\",\"preloadedJs\":[{\"path\":\"dist\\\/h5p-branching-scenario.js\"}],\"preloadedCss\":[{\"path\":\"dist\\\/h5p-branching-scenario.css\"}],\"preloadedDependencies\":[{\"machineName\":\"FontAwesome\",\"majorVersion\":4,\"minorVersion\":5}],\"editorDependencies\":[{\"machineName\":\"H5P.BranchingScenario\",\"majorVersion\":1,\"minorVersion\":8},{\"machineName\":\"H5PEditor.ShowWhen\",\"majorVersion\":1,\"minorVersion\":0},{\"machineName\":\"H5PEditor.BranchingScenario\",\"majorVersion\":1,\"minorVersion\":5}]}"],"libraries\/H5PEditor.BranchingScenario-1.5\/library.json":["application\/json","{\"title\":\"Branching Scenario Editor\",\"description\":\"description\",\"majorVersion\":1,\"minorVersion\":5,\"patchVersion\":7,\"runnable\":0,\"author\":\"Joubel\",\"license\":\"MIT\",\"machineName\":\"H5PEditor.BranchingScenario\",\"coreApi\":{\"majorVersion\":1,\"minorVersion\":24},\"preloadedJs\":[{\"path\":\"dist\\\/dist.js\"}],\"preloadedDependencies\":[{\"machineName\":\"H5P.MaterialDesignIcons\",\"majorVersion\":1,\"minorVersion\":0},{\"machineName\":\"H5P.BranchingQuestion\",\"majorVersion\":1,\"minorVersion\":0},{\"machineName\":\"H5P.CoursePresentation\",\"majorVersion\":1,\"minorVersion\":25},{\"machineName\":\"H5P.AdvancedText\",\"majorVersion\":1,\"minorVersion\":1},{\"machineName\":\"H5P.Image\",\"majorVersion\":1,\"minorVersion\":1},{\"machineName\":\"H5P.ImageHotspots\",\"majorVersion\":1,\"minorVersion\":10},{\"machineName\":\"H5P.InteractiveVideo\",\"majorVersion\":1,\"minorVersion\":26},{\"machineName\":\"H5P.Video\",\"majorVersion\":1,\"minorVersion\":6}]}"],"libraries\/H5P.MaterialDesignIcons-1.0\/library.json":["application\/json","{\"title\":\"Material Design Icons\",\"contentType\":\"Font\",\"majorVersion\":1,\"minorVersion\":0,\"patchVersion\":0,\"runnable\":0,\"machineName\":\"H5P.MaterialDesignIcons\",\"license\":\"GPL3\",\"author\":\"Joubel\",\"preloadedCss\":[{\"path\":\"h5p-material-icons.css\"}]}"],"libraries\/H5P.CoursePresentation-1.25\/library.json":["application\/json","{\"title\":\"Course Presentation\",\"contentType\":\"Library\",\"majorVersion\":1,\"minorVersion\":25,\"patchVersion\":31,\"runnable\":1,\"fullscreen\":1,\"embedTypes\":[\"iframe\"],\"machineName\":\"H5P.CoursePresentation\",\"author\":\"Joubel\",\"license\":\"MIT\",\"coreApi\":{\"majorVersion\":1,\"minorVersion\":26},\"preloadedJs\":[{\"path\":\"dist\\\/h5p-course-presentation.js\"}],\"preloadedCss\":[{\"path\":\"dist\\\/h5p-course-presentation.css\"}],\"preloadedDependencies\":[{\"machineName\":\"FontAwesome\",\"majorVersion\":4,\"minorVersion\":5},{\"machineName\":\"H5P.JoubelUI\",\"majorVersion\":1,\"minorVersion\":3},{\"machineName\":\"H5P.FontIcons\",\"majorVersion\":1,\"minorVersion\":0}],\"editorDependencies\":[{\"machineName\":\"H5P.CoursePresentation\",\"majorVersion\":1,\"minorVersion\":25},{\"machineName\":\"H5PEditor.ShowWhen\",\"majorVersion\":1,\"minorVersion\":0},{\"machineName\":\"H5PEditor.CoursePresentation\",\"majorVersion\":1,\"minorVersion\":25}]}"],"libraries\/H5P.ImageHotspots-1.10\/library.json":["application\/json","{\"title\":\"Image Hotspots\",\"description\":\"Add hotspots with useful information and media to an image.\",\"majorVersion\":1,\"minorVersion\":10,\"patchVersion\":17,\"runnable\":1,\"author\":\"Joubel\",\"license\":\"MIT\",\"machineName\":\"H5P.ImageHotspots\",\"fullscreen\":1,\"coreApi\":{\"majorVersion\":1,\"minorVersion\":19},\"embedTypes\":[\"iframe\"],\"preloadedJs\":[{\"path\":\"scripts\\\/image-hotspots.js\"},{\"path\":\"scripts\\\/hotspot.js\"},{\"path\":\"scripts\\\/popup.js\"}],\"preloadedCss\":[{\"path\":\"styles\\\/image-hotspots.css\"}],\"preloadedDependencies\":[{\"machineName\":\"FontAwesome\",\"majorVersion\":4,\"minorVersion\":5},{\"machineName\":\"H5P.Transition\",\"majorVersion\":1,\"minorVersion\":0}],\"editorDependencies\":[{\"machineName\":\"H5PEditor.ImageCoordinateSelector\",\"majorVersion\":1,\"minorVersion\":2},{\"machineName\":\"H5PEditor.ColorSelector\",\"majorVersion\":1,\"minorVersion\":3},{\"machineName\":\"H5PEditor.ShowWhen\",\"majorVersion\":1,\"minorVersion\":0}]}"],"libraries\/H5P.InteractiveVideo-1.26\/library.json":["application\/json","{\"title\":\"Interactive Video\",\"description\":\"Put texts, tasks and other medias on top of your video.\",\"license\":\"MIT\",\"contentType\":\"Media\",\"majorVersion\":1,\"minorVersion\":26,\"patchVersion\":35,\"machineName\":\"H5P.InteractiveVideo\",\"author\":\"Joubel\",\"embedTypes\":[\"iframe\"],\"runnable\":1,\"fullscreen\":1,\"coreApi\":{\"majorVersion\":1,\"minorVersion\":26},\"preloadedJs\":[{\"path\":\"dist\\\/h5p-interactive-video.js\"}],\"preloadedCss\":[{\"path\":\"dist\\\/h5p-interactive-video.css\"}],\"preloadedDependencies\":[{\"machineName\":\"FontAwesome\",\"majorVersion\":4,\"minorVersion\":5},{\"machineName\":\"jQuery.ui\",\"majorVersion\":1,\"minorVersion\":10},{\"machineName\":\"H5P.Video\",\"majorVersion\":1,\"minorVersion\":6},{\"machineName\":\"H5P.DragNBar\",\"majorVersion\":1,\"minorVersion\":5}],\"editorDependencies\":[{\"machineName\":\"H5P.InteractiveVideo\",\"majorVersion\":1,\"minorVersion\":26},{\"machineName\":\"H5PEditor.Wizard\",\"majorVersion\":1,\"minorVersion\":2},{\"machineName\":\"H5PEditor.InteractiveVideo\",\"majorVersion\":1,\"minorVersion\":25}]}"],"libraries\/H5P.Video-1.6\/library.json":["application\/json","{\"machineName\":\"H5P.Video\",\"title\":\"Video\",\"contentType\":\"Media\",\"description\":\"Plays video from multiple sources.\",\"license\":\"MIT\",\"author\":\"Joubel\",\"majorVersion\":1,\"minorVersion\":6,\"patchVersion\":66,\"runnable\":0,\"coreApi\":{\"majorVersion\":1,\"minorVersion\":19},\"preloadedJs\":[{\"path\":\"scripts\\\/vimeo.js\"},{\"path\":\"scripts\\\/youtube.js\"},{\"path\":\"scripts\\\/panopto.js\"},{\"path\":\"scripts\\\/echo360.js\"},{\"path\":\"scripts\\\/html5.js\"},{\"path\":\"scripts\\\/video.js\"}],\"preloadedCss\":[{\"path\":\"styles\\\/video.css\"}]}"]});		H5PIntegration	= (function(x){
			let url	= window.location.href.split('/');
			url.pop();
			x.url	= url.join('/');
			return x;
		})({"baseUrl":"","url":"","siteUrl":"","l10n":{"H5P":{"fullscreen":"Vollbild","disableFullscreen":"Kein Vollbild","download":"Download","copyrights":"Nutzungsrechte","embed":"Einbetten","size":"Size","showAdvanced":"Show advanced","hideAdvanced":"Hide advanced","advancedHelp":"Include this script on your website if you want dynamic sizing of the embedded content:","copyrightInformation":"Nutzungsrechte","close":"Schlie\u00dfen","title":"Titel","author":"Autor","year":"Jahr","source":"Quelle","license":"Lizenz","thumbnail":"Thumbnail","noCopyrights":"Keine Copyright-Informationen vorhanden","reuse":"Wiederverwenden","reuseContent":"Verwende Inhalt","reuseDescription":"Verwende Inhalt.","downloadDescription":"Lade den Inhalt als H5P-Datei herunter.","copyrightsDescription":"Zeige Urheberinformationen an.","embedDescription":"Zeige den Code f\u00fcr die Einbettung an.","h5pDescription":"Visit H5P.org to check out more cool content.","contentChanged":"Dieser Inhalt hat sich seit Ihrer letzten Nutzung ver\u00e4ndert.","startingOver":"Sie beginnen von vorne.","by":"von","showMore":"Zeige mehr","showLess":"Zeige weniger","subLevel":"Sublevel","confirmDialogHeader":"Best\u00e4tige Aktion","confirmDialogBody":"Please confirm that you wish to proceed. This action is not reversible.","cancelLabel":"Abbrechen","confirmLabel":"Best\u00e4tigen","licenseU":"Undisclosed","licenseCCBY":"Attribution","licenseCCBYSA":"Attribution-ShareAlike","licenseCCBYND":"Attribution-NoDerivs","licenseCCBYNC":"Attribution-NonCommercial","licenseCCBYNCSA":"Attribution-NonCommercial-ShareAlike","licenseCCBYNCND":"Attribution-NonCommercial-NoDerivs","licenseCC40":"4.0 International","licenseCC30":"3.0 Unported","licenseCC25":"2.5 Generic","licenseCC20":"2.0 Generic","licenseCC10":"1.0 Generic","licenseGPL":"General Public License","licenseV3":"Version 3","licenseV2":"Version 2","licenseV1":"Version 1","licensePD":"Public Domain","licenseCC010":"CC0 1.0 Universal (CC0 1.0) Public Domain Dedication","licensePDM":"Public Domain Mark","licenseC":"Copyright","contentType":"Inhaltstyp","licenseExtras":"License Extras","changes":"Changelog","contentCopied":"Inhalt wurde ins Clipboard kopiert","connectionLost":"Connection lost. Results will be stored and sent when you regain connection.","connectionReestablished":"Connection reestablished.","resubmitScores":"Attempting to submit stored results.","offlineDialogHeader":"Your connection to the server was lost","offlineDialogBody":"We were unable to send information about your completion of this task. Please check your internet connection.","offlineDialogRetryMessage":"Versuche es wieder in :num....","offlineDialogRetryButtonLabel":"Jetzt nochmal probieren","offlineSuccessfulSubmit":"Erfolgreich Ergebnisse gesendet."}},"hubIsEnabled":false,"reportingIsEnabled":false,"libraryConfig":null,"crossorigin":null,"crossoriginCacheBuster":null,"pluginCacheBuster":"","libraryUrl":".\/libraries\/h5pcore\/js","contents":{"cid-assets":{"displayOptions":{"copy":false,"copyright":false,"embed":false,"export":false,"frame":false,"icon":false},"embedCode":"","exportUrl":false,"fullScreen":false,"contentUserData":[],"metadata":{"title":"odigies_xrisis","license":null},"library":"H5P.BranchingScenario 1.8","jsonContent":"{\"branchingScenario\":{\"content\":[{\"type\":{\"library\":\"H5P.AdvancedText 1.1\",\"params\":{\"text\":\"<p><span style=\\\"font-size:1.5em;\\\"><strong>\\u0395\\u03c0\\u03b9\\u03bb\\u03ad\\u03b3\\u03c9 \\u03ad\\u03bd\\u03b1 \\u03b1\\u03c0\\u03cc \\u03c4\\u03b1 \\u03cc\\u03c1\\u03b3\\u03b1\\u03bd\\u03b1 \\u03c4\\u03bf\\u03c5 \\u03b5\\u03c1\\u03b3\\u03b1\\u03c3\\u03c4\\u03b7\\u03c1\\u03af\\u03bf\\u03c5 \\u03a6\\u03c5\\u03c3\\u03b9\\u03ba\\u03ae\\u03c2 \\u03ba\\u03b1\\u03b9 \\u03b3\\u03c1\\u03ac\\u03c6\\u03c9 \\u03c4\\u03b9\\u03c2 \\u03bf\\u03b4\\u03b7\\u03b3\\u03af\\u03b5\\u03c2 \\u03c7\\u03c1\\u03ae\\u03c3\\u03b7\\u03c2 \\u03c4\\u03bf\\u03c5 \\u03b3\\u03b9\\u03b1 \\u03c4\\u03bf\\u03c5\\u03c2 \\u03bc\\u03b1\\u03b8\\u03b7\\u03c4\\u03ad\\u03c2 \\u03c4\\u03bf\\u03c5 \\u03c3\\u03c7\\u03bf\\u03bb\\u03b5\\u03af\\u03bf\\u03c5 \\u03bc\\u03bf\\u03c5.<\\\/strong><\\\/span><\\\/p>\\n\\n<p>&nbsp;<\\\/p>\\n\"},\"subContentId\":\"c5a1c9c2-f337-4cdd-838d-5bad6330e7f2\",\"metadata\":{\"contentType\":\"Text\",\"license\":\"U\",\"title\":\"Untitled Text\"}},\"showContentTitle\":false,\"proceedButtonText\":\"\\u03a3\\u03a5\\u039d\\u0395\\u03a7\\u0395\\u0399\\u0391\",\"forceContentFinished\":\"useBehavioural\",\"feedback\":{\"subtitle\":\"\"},\"contentBehaviour\":\"useBehavioural\",\"nextContentId\":2},{\"type\":{\"library\":\"H5P.Image 1.1\",\"params\":{\"decorative\":false,\"contentName\":\"\\u0395\\u03b9\\u03ba\\u03cc\\u03bd\\u03b1\",\"expandImage\":\"Expand Image\",\"minimizeImage\":\"Minimize Image\",\"alt\":\"\\u0395\\u03b9\\u03ba\\u03cc\\u03bd\\u03b1 \\u03b7\\u03bb\\u03b5\\u03ba\\u03c4\\u03c1\\u03bf\\u03c3\\u03ba\\u03bf\\u03c0\\u03af\\u03bf\\u03c5\",\"title\":\"\\u0397\\u03bb\\u03b5\\u03ba\\u03c4\\u03c1\\u03bf\\u03c3\\u03ba\\u03cc\\u03c0\\u03b9\\u03bf \\u03a6\\u03cd\\u03bb\\u03bb\\u03bf\\u03c5, \\u03c0\\u03b7\\u03b3\\u03ae: stradon.gr\",\"file\":{\"path\":\"images\\\/file-685b17bd9ad65.jpeg\",\"mime\":\"image\\\/jpeg\",\"copyright\":{\"license\":\"U\"},\"width\":500,\"height\":500}},\"subContentId\":\"e5ba656c-54d8-4acf-9996-bf3d60dbed6a\",\"metadata\":{\"contentType\":\"Image\",\"license\":\"U\",\"title\":\"\\u0397\\u03bb\\u03b5\\u03ba\\u03c4\\u03c1\\u03bf\\u03c3\\u03ba\\u03cc\\u03c0\\u03b9\\u03bf\"}},\"showContentTitle\":true,\"proceedButtonText\":\"\\u03a3\\u03a5\\u039d\\u0395\\u03a7\\u0395\\u0399\\u0391\",\"forceContentFinished\":\"useBehavioural\",\"feedback\":{\"subtitle\":\"\",\"title\":\"\"},\"contentBehaviour\":\"useBehavioural\",\"nextContentId\":-1},{\"type\":{\"library\":\"H5P.BranchingQuestion 1.0\",\"params\":{\"branchingQuestion\":{\"alternatives\":[{\"nextContentId\":3,\"feedback\":{},\"text\":\"(\\u03b1) \\u03c4\\u03bf\\u03bd \\u03b6\\u03c5\\u03b3\\u03cc \\u03c3\\u03cd\\u03b3\\u03ba\\u03c1\\u03b9\\u03c3\\u03b7\\u03c2 \\u03bc\\u03b5 \\u03c3\\u03c4\\u03b1\\u03b8\\u03bc\\u03ac \\u03b3\\u03bd\\u03c9\\u03c3\\u03c4\\u03ae\\u03c2 \\u03bc\\u03ac\\u03b6\\u03b1\\u03c2\"},{\"nextContentId\":1,\"feedback\":{},\"text\":\"(\\u03b2) \\u03c4\\u03bf \\u03b7\\u03bb\\u03b5\\u03ba\\u03c4\\u03c1\\u03bf\\u03c3\\u03ba\\u03cc\\u03c0\\u03b9\\u03bf\"}],\"question\":\"<p>\\u0395\\u03bd\\u03b4\\u03b5\\u03b9\\u03ba\\u03c4\\u03b9\\u03ba\\u03ac, \\u03bc\\u03c0\\u03bf\\u03c1\\u03ce \\u03bd\\u03b1 \\u03b5\\u03c0\\u03b9\\u03bb\\u03ad\\u03be\\u03c9:<\\\/p>\\n\"}},\"subContentId\":\"cfacc256-a333-4c66-a564-a7d3e7c99c31\",\"metadata\":{\"contentType\":\"Branching Question\",\"license\":\"U\",\"title\":\"\\u039f\\u03b4\\u03b7\\u03b3\\u03af\\u03b5\\u03c2 \\u03c7\\u03c1\\u03ae\\u03c3\\u03b7\\u03c2 \\u03c3\\u03c5\\u03c3\\u03ba\\u03b5\\u03c5\\u03ae\\u03c2\"}},\"showContentTitle\":false,\"proceedButtonText\":\"Proceed\",\"forceContentFinished\":\"useBehavioural\",\"feedback\":{},\"contentBehaviour\":\"useBehavioural\"},{\"type\":{\"library\":\"H5P.Image 1.1\",\"params\":{\"decorative\":false,\"contentName\":\"\\u0395\\u03b9\\u03ba\\u03cc\\u03bd\\u03b1\",\"expandImage\":\"Expand Image\",\"minimizeImage\":\"Minimize Image\",\"alt\":\"\\u0396\\u03c5\\u03b3\\u03cc\\u03c2 \\u03c3\\u03cd\\u03b3\\u03ba\\u03c1\\u03b9\\u03c3\\u03b7\\u03c2\",\"title\":\"\\u0396\\u03c5\\u03b3\\u03cc\\u03c2 \\u03c3\\u03cd\\u03b3\\u03ba\\u03c1\\u03b9\\u03c3\\u03b7\\u03c2, \\u03c0\\u03b7\\u03b3\\u03ae \\u03b5\\u03b9\\u03ba\\u03cc\\u03bd\\u03b1\\u03c2: \\u0399\\u03a4\\u03a5\\u0395\",\"file\":{\"path\":\"images\\\/file-685b1786122e5.jpeg\",\"mime\":\"image\\\/jpeg\",\"copyright\":{\"license\":\"U\"},\"width\":493,\"height\":223}},\"subContentId\":\"d1c31d9c-e5fe-4ddb-9873-7b5344ed7eed\",\"metadata\":{\"contentType\":\"Image\",\"license\":\"U\",\"title\":\"\\u0396\\u03c5\\u03b3\\u03cc\\u03c2 \\u03c3\\u03cd\\u03b3\\u03ba\\u03c1\\u03b9\\u03c3\\u03b7\\u03c2\"}},\"showContentTitle\":false,\"proceedButtonText\":\"\\u03a3\\u03a5\\u039d\\u0395\\u03a7\\u0395\\u0399\\u0391\",\"forceContentFinished\":\"useBehavioural\",\"feedback\":{\"title\":\"\",\"subtitle\":\"\"},\"contentBehaviour\":\"useBehavioural\",\"nextContentId\":-1}],\"endScreens\":[{\"endScreenTitle\":\"\",\"endScreenSubtitle\":\"\",\"contentId\":-1,\"endScreenScore\":0}],\"scoringOptionGroup\":{\"scoringOption\":\"no-score\",\"includeInteractionsScores\":true},\"startScreen\":{\"startScreenTitle\":\"<p><strong>\\u03a3\\u03a4\\u039f \\u0395\\u03a1\\u0393\\u0391\\u03a3\\u03a4\\u0397\\u03a1\\u0399\\u039f \\u03a6\\u03a5\\u03a3\\u0399\\u039a\\u0397\\u03a3<\\\/strong><\\\/p>\\n\",\"startScreenSubtitle\":\"\"},\"behaviour\":{\"enableBackwardsNavigation\":false,\"forceContentFinished\":false,\"randomizeBranchingQuestions\":false},\"l10n\":{\"startScreenButtonText\":\"\\u039e\\u03b5\\u03ba\\u03af\\u03bd\\u03b7\\u03c3\\u03b5\",\"endScreenButtonText\":\"\\u039e\\u03b5\\u03ba\\u03af\\u03bd\\u03b7\\u03c3\\u03b5 \\u03be\\u03b1\\u03bd\\u03ac\",\"backButtonText\":\"\\u03a3\\u03c5\\u03bd\\u03ad\\u03c7\\u03b9\\u03c3\\u03b5\",\"disableProceedButtonText\":\"Require to complete the current module\",\"replayButtonText\":\"\\u0397 \\u03b2\\u03b1\\u03b8\\u03bc\\u03bf\\u03bb\\u03bf\\u03b3\\u03af\\u03b1 \\u03c3\\u03bf\\u03c5:\",\"scoreText\":\"\\u0397 \\u03b2\\u03b1\\u03b8\\u03bc\\u03bf\\u03bb\\u03bf\\u03b3\\u03af\\u03b1 \\u03c3\\u03b1\\u03c2:\",\"fullscreenAria\":\"\\u03a0\\u03bb\\u03ae\\u03c1\\u03b7\\u03c2 \\u03bf\\u03b8\\u03cc\\u03bd\\u03b7\"}}}"}}});