diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 870ebebe..15e0c442 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,22 @@ jobs: strategy: matrix: - node-version: [ 8.x, 10.x, 12.x ] + node: [ 12.x, 14.x, 16.x ] steps: - name: Checkout uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + cache: 'yarn' + + - name: Install dependencies + run: yarn --frozen-lockfile + + - name: Build project + run: yarn build + - name: Cypress.io uses: cypress-io/github-action@v2 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e1fcd9b6..70ca40e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,26 +11,24 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Cache node modules - uses: actions/cache@v2 + - uses: actions/setup-node@v2 with: - path: | - ~/.cache/yarn - ~/.cache/Cypress - **/node_modules - key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} - - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' + node-version: ${{ matrix.node }} + cache: 'yarn' - name: Install dependencies run: yarn --frozen-lockfile + - name: Build project + run: yarn build + - name: Test uses: cypress-io/github-action@v2 + - name: Compress Github release files + run: | + zip -r h5p-standalone-release.zip dist/ README.md + - name: Release uses: cycjimmy/semantic-release-action@v2 env: diff --git a/.gitignore b/.gitignore index e7c660a9..4d09ff3d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules .DS_Store -cypress/videos \ No newline at end of file +cypress/videos +dist \ No newline at end of file diff --git a/.npmignore b/.npmignore index 47e698c5..8e09ff55 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,7 @@ test vendor -cypress \ No newline at end of file +cypress +.github +.circleci +.eslintrc.json +cypress.json \ No newline at end of file diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 00000000..bdf43814 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,19 @@ +{ + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/npm", + [ + "@semantic-release/github", + { + "assets": [ + { + "path": "h5p-standalone-release.zip", + "name": "h5p-standalone-${nextRelease.version}.zip", + "label": "h5p-standalone-${nextRelease.version}.zip" + } + ] + } + ] + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 5325fbca..cbd27245 100644 --- a/README.md +++ b/README.md @@ -228,8 +228,8 @@ frameBorder="0" scrolling="no" styles="width:100%"> - - - - - -{ - "fontFamily": "h5p-core-26", - "description": "Font generated by IcoMoon.", - "majorVersion": 1, - "minorVersion": 1, - "copyright": "H5P", - "fontURL": "", - "version": "Version 1.1", - "fontId": "h5p-core-26", - "psName": "h5p-core-26", - "subFamily": "Regular", - "fullName": "h5p-core-26" -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dist/fonts/h5p-core-27.ttf b/dist/fonts/h5p-core-27.ttf deleted file mode 100644 index 9c63eb7e..00000000 Binary files a/dist/fonts/h5p-core-27.ttf and /dev/null differ diff --git a/dist/fonts/h5p-core-27.woff b/dist/fonts/h5p-core-27.woff deleted file mode 100644 index 049e31a3..00000000 Binary files a/dist/fonts/h5p-core-27.woff and /dev/null differ diff --git a/dist/fonts/h5p-hub-publish.eot b/dist/fonts/h5p-hub-publish.eot deleted file mode 100644 index 6afdd28d..00000000 Binary files a/dist/fonts/h5p-hub-publish.eot and /dev/null differ diff --git a/dist/fonts/h5p-hub-publish.svg b/dist/fonts/h5p-hub-publish.svg deleted file mode 100644 index e32badd4..00000000 --- a/dist/fonts/h5p-hub-publish.svg +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - -{ - "fontFamily": "h5p-hub", - "description": "Font generated by IcoMoon.", - "majorVersion": 1, - "minorVersion": 3, - "version": "Version 1.3", - "fontId": "h5p-hub", - "psName": "h5p-hub", - "subFamily": "Regular", - "fullName": "h5p-hub" -} - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dist/fonts/h5p-hub-publish.ttf b/dist/fonts/h5p-hub-publish.ttf deleted file mode 100644 index d1d40dd3..00000000 Binary files a/dist/fonts/h5p-hub-publish.ttf and /dev/null differ diff --git a/dist/fonts/h5p-hub-publish.woff b/dist/fonts/h5p-hub-publish.woff deleted file mode 100644 index c0535345..00000000 Binary files a/dist/fonts/h5p-hub-publish.woff and /dev/null differ diff --git a/dist/frame.bundle.js b/dist/frame.bundle.js deleted file mode 100644 index 9a5e94c6..00000000 --- a/dist/frame.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see frame.bundle.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["h5p-standalone"]=t():e.H5PStandalone=t()}(self,(function(){return(()=>{var e={41:()=>{H5P.ActionBar=function(e,t){"use strict";function n(e){t.call(this);var n=this,r=!1,i=H5P.jQuery(''),o=function(e,t){var o=function(){n.trigger(e)};H5P.jQuery("
  • ",{class:"h5p-button h5p-noselect h5p-"+(t||e),role:"button",tabindex:0,title:H5P.t(e+"Description"),html:H5P.t(e),on:{click:o,keypress:function(e){32===e.which&&(o(),e.preventDefault())}},appendTo:i}),r=!0};(e.export||e.copy)&&o("reuse","export"),e.copyright&&o("copyrights"),e.embed&&o("embed"),e.icon&&(H5P.jQuery('
  • ').appendTo(i),r=!0),n.getDOMElement=function(){return i},n.hasActions=function(){return r}}return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n}(H5P.jQuery,H5P.EventDispatcher)},644:()=>{H5P.ConfirmationDialog=function(e){"use strict";function t(t){e.call(this);var n=this;H5P.ConfirmationDialog.uniqueId+=1;var r=H5P.ConfirmationDialog.uniqueId;function i(e){n.hide(),n.trigger("confirmed"),e.preventDefault()}function o(e){n.hide(),n.trigger("canceled"),e.preventDefault()}function a(e,t){e.focus(),t.preventDefault()}(t=t||{}).headerText=t.headerText||H5P.t("confirmDialogHeader"),t.dialogText=t.dialogText||H5P.t("confirmDialogBody"),t.cancelText=t.cancelText||H5P.t("cancelLabel"),t.confirmText=t.confirmText||H5P.t("confirmLabel");var s=!1,c=document.createElement("div");c.classList.add("h5p-confirmation-dialog-background","hidden","hiding");var l=document.createElement("div");l.classList.add("h5p-confirmation-dialog-popup","hidden"),t.classes&&t.classes.forEach((function(e){l.classList.add(e)})),l.setAttribute("role","dialog"),l.setAttribute("aria-labelledby","h5p-confirmation-dialog-dialog-text-"+r),c.appendChild(l),l.addEventListener("keydown",(function(e){27===e.which&&o(e)}));var u=document.createElement("div");u.classList.add("h5p-confirmation-dialog-header"),l.appendChild(u);var d=document.createElement("div");d.classList.add("h5p-confirmation-dialog-header-text"),d.innerHTML=t.headerText,u.appendChild(d);var f=document.createElement("div");f.classList.add("h5p-confirmation-dialog-body"),l.appendChild(f);var p=document.createElement("div");p.classList.add("h5p-confirmation-dialog-text"),p.innerHTML=t.dialogText,p.id="h5p-confirmation-dialog-dialog-text-"+r,f.appendChild(p);var h=document.createElement("div");h.classList.add("h5p-confirmation-dialog-buttons"),f.appendChild(h);var g=document.createElement("button");g.classList.add("h5p-core-cancel-button"),g.textContent=t.cancelText;var v=document.createElement("button");v.classList.add("h5p-core-button"),v.classList.add("h5p-confirmation-dialog-confirm-button"),v.textContent=t.confirmText;var m,y,b=document.createElement("button");b.classList.add("h5p-confirmation-dialog-exit"),b.setAttribute("aria-hidden","true"),b.tabIndex=-1,b.title=t.cancelText,g.addEventListener("click",o),g.addEventListener("keydown",(function(e){32===e.which?o(e):9===e.which&&e.shiftKey&&a(v,e)})),t.hideCancel?h.classList.add("center"):h.appendChild(g),v.addEventListener("click",i),v.addEventListener("keydown",(function(e){32===e.which?i(e):9!==e.which||e.shiftKey||a(t.hideCancel?v:g,e)})),h.appendChild(v),b.addEventListener("click",o),b.addEventListener("keydown",(function(e){32===e.which&&o(e)})),t.hideExit||l.appendChild(b);var x,w=[],C=[];this.appendTo=function(e){return m=e,this};var T=function(e){c.contains(e.target)||(e.preventDefault(),v.focus())},P=function(e){var t,n=[],r=e.parentNode.children;for(t=0;tm.offsetHeight&&(t=m.offsetHeight-l.offsetHeight-8),t-32<=0&&(t=40,s=!0),l.style.top=t+"px"}(e),setTimeout((function(){l.classList.remove("hidden"),c.classList.remove("hiding"),setTimeout((function(){if(v.focus(),s&&t.instance){var e=parseInt(l.offsetHeight,10)+32+16;n.setViewPortMinimumHeight(e),t.instance.trigger("resize"),s=!1}}),100)}),0),this},this.hide=function(){return c.classList.add("hiding"),l.classList.add("hidden"),y.removeAttribute("aria-hidden"),y.removeEventListener("focus",T,!0),t.skipRestoreFocus||x.focus(),E(m,w),E(c,C),setTimeout((function(){c.classList.add("hidden"),m.removeChild(c),n.setViewPortMinimumHeight(null)}),100),this},this.getElement=function(){return l},this.getPreviouslyFocused=function(){return x},this.setViewPortMinimumHeight=function(e){(document.querySelector(".h5p-container")||document.body).style.minHeight="number"==typeof e?e+"px":e}}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}(H5P.EventDispatcher),H5P.ConfirmationDialog.uniqueId=-1},798:()=>{H5P.ContentType=function(e){function t(){}return t.prototype=new H5P.EventDispatcher,t.prototype.isRoot=function(){return e},t.prototype.getLibraryFilePath=function(e){return H5P.getLibraryPath(this.libraryInfo.versionedNameNoSpaces)+"/"+e},t}},449:()=>{var e=window.H5P=window.H5P||{};e.Event=function(e,t,n){this.type=e,this.data=t;var r=!1,i=!1,o=!1;void 0===n&&(n={}),!0===n.bubbles&&(r=!0),!0===n.external&&(i=!0),this.preventBubbling=function(){r=!1},this.getBubbles=function(){return r},this.scheduleForExternal=function(){return!(!i||o||(o=!0,0))}},e.EventDispatcher=function(){var t=this,n={};this.on=function(e,r,i){if("function"!=typeof r)throw TypeError("listener must be a function");t.trigger("newListener",{type:e,listener:r});var o={listener:r,thisArg:i};n[e]?n[e].push(o):n[e]=[o]},this.once=function(e,n,r){if(!(n instanceof Function))throw TypeError("listener must be a function");var i=function(e){t.off(e.type,i),n.call(this,e)};t.on(e,i,r)},this.off=function(e,r){if(void 0!==r&&!(r instanceof Function))throw TypeError("listener must be a function");if(void 0!==n[e]){if(void 0===r)return delete n[e],void t.trigger("removeListener",e);for(var i=0;i{var e=window.H5P=window.H5P||{};e.XAPIEvent=function(){e.Event.call(this,"xAPI",{statement:{}},{bubbles:!0,external:!0})},e.XAPIEvent.prototype=Object.create(e.Event.prototype),e.XAPIEvent.prototype.constructor=e.XAPIEvent,e.XAPIEvent.prototype.setScoredResult=function(e,t,n,r,i){if(this.data.statement.result={},void 0!==e&&(void 0===t?this.data.statement.result.score={raw:e}:(this.data.statement.result.score={min:0,max:t,raw:e},t>0&&(this.data.statement.result.score.scaled=Math.round(e/t*1e4)/1e4))),this.data.statement.result.completion=void 0===r?"completed"===this.getVerb()||"answered"===this.getVerb():r,void 0!==i&&(this.data.statement.result.success=i),n&&n.activityStartTime){var o=Math.round((Date.now()-n.activityStartTime)/10)/100;this.data.statement.result.duration="PT"+o+"S"}},e.XAPIEvent.prototype.setVerb=function(t){-1!==e.jQuery.inArray(t,e.XAPIEvent.allowedXAPIVerbs)?this.data.statement.verb={id:"http://adlnet.gov/expapi/verbs/"+t,display:{"en-US":t}}:void 0!==t.id&&(this.data.statement.verb=t)},e.XAPIEvent.prototype.getVerb=function(e){var t=this.data.statement;return"verb"in t?!0===e?t.verb:t.verb.id.slice(31):null},e.XAPIEvent.prototype.setObject=function(t){if(t.contentId)if(this.data.statement.object={id:this.getContentXAPIId(t),objectType:"Activity",definition:{extensions:{"http://h5p.org/x-api/h5p-local-content-id":t.contentId}}},t.subContentId)this.data.statement.object.definition.extensions["http://h5p.org/x-api/h5p-subContentId"]=t.subContentId,"function"==typeof t.getTitle&&(this.data.statement.object.definition.name={"en-US":t.getTitle()});else{var n=e.getContentForInstance(t.contentId);n&&n.metadata&&n.metadata.title&&(this.data.statement.object.definition.name={"en-US":e.createTitle(n.metadata.title)})}else this.data.statement.object={definition:{}}},e.XAPIEvent.prototype.setContext=function(e){e.parent&&(e.parent.contentId||e.parent.subContentId)&&(this.data.statement.context={contextActivities:{parent:[{id:this.getContentXAPIId(e.parent),objectType:"Activity"}]}}),e.libraryInfo&&(void 0===this.data.statement.context&&(this.data.statement.context={contextActivities:{}}),this.data.statement.context.contextActivities.category=[{id:"http://h5p.org/libraries/"+e.libraryInfo.versionedNameNoSpaces,objectType:"Activity"}])},e.XAPIEvent.prototype.setActor=function(){if(void 0!==H5PIntegration.user)this.data.statement.actor={name:H5PIntegration.user.name,mbox:"mailto:"+H5PIntegration.user.mail,objectType:"Agent"};else{var t;try{localStorage.H5PUserUUID?t=localStorage.H5PUserUUID:(t=e.createUUID(),localStorage.H5PUserUUID=t)}catch(n){t="not-trackable-"+e.createUUID()}this.data.statement.actor={account:{name:t,homePage:H5PIntegration.siteUrl},objectType:"Agent"}}},e.XAPIEvent.prototype.getMaxScore=function(){return this.getVerifiedStatementValue(["result","score","max"])},e.XAPIEvent.prototype.getScore=function(){return this.getVerifiedStatementValue(["result","score","raw"])},e.XAPIEvent.prototype.getContentXAPIId=function(e){var t;return e.contentId&&H5PIntegration&&H5PIntegration.contents&&H5PIntegration.contents["cid-"+e.contentId]&&(t=H5PIntegration.contents["cid-"+e.contentId].url,e.subContentId&&(t+="?subContentId="+e.subContentId)),t},e.XAPIEvent.prototype.isFromChild=function(){var e=this.getVerifiedStatementValue(["context","contextActivities","parent",0,"id"]);return!e||-1===e.indexOf("subContentId")},e.XAPIEvent.prototype.getVerifiedStatementValue=function(e){for(var t=this.data.statement,n=0;n{var e=window.H5P=window.H5P||{};e.externalDispatcher=new e.EventDispatcher,e.EventDispatcher.prototype.triggerXAPI=function(e,t){this.trigger(this.createXAPIEventTemplate(e,t))},e.EventDispatcher.prototype.createXAPIEventTemplate=function(t,n){var r=new e.XAPIEvent;if(r.setActor(),r.setVerb(t),void 0!==n)for(var i in n)r.data.statement[i]=n[i];return"object"in r.data.statement||r.setObject(this),"context"in r.data.statement||r.setContext(this),r},e.EventDispatcher.prototype.triggerXAPICompleted=function(e,t,n){this.triggerXAPIScored(e,t,"completed",!0,n)},e.EventDispatcher.prototype.triggerXAPIScored=function(e,t,n,r,i){var o=this.createXAPIEventTemplate(n);o.setScoredResult(e,t,this,r,i),this.trigger(o)},e.EventDispatcher.prototype.setActivityStarted=function(){void 0===this.activityStartTime&&(void 0!==this.contentId&&void 0!==H5PIntegration.contents&&void 0!==H5PIntegration.contents["cid-"+this.contentId]&&this.triggerXAPI("attempted"),this.activityStartTime=Date.now())},e.xAPICompletedListener=function(t){if(("completed"===t.getVerb()||"answered"===t.getVerb())&&!t.getVerifiedStatementValue(["context","contextActivities","parent"])){var n=t.getScore(),r=t.getMaxScore(),i=t.getVerifiedStatementValue(["object","definition","extensions","http://h5p.org/x-api/h5p-local-content-id"]);e.setFinished(i,n,r)}}},357:function(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(r,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,c=o.flat?function(e){return o.flat.call(e)}:function(e){return o.concat.apply([],e)},l=o.push,u=o.indexOf,d={},f=d.toString,p=d.hasOwnProperty,h=p.toString,g=h.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},y=function(e){return null!=e&&e===e.window},b=r.document,x={type:!0,src:!0,nonce:!0,noModule:!0};function w(e,t,n){var r,i,o=(n=n||b).createElement("script");if(o.text=e,t)for(r in x)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function C(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[f.call(e)]||"object":typeof e}var T="3.5.1",P=function(e,t){return new P.fn.init(e,t)};function E(e){var t=!!e&&"length"in e&&e.length,n=C(e);return!m(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+F+")"+F+"*"),V=new RegExp(F+"|>"),X=new RegExp(B),W=new RegExp("^"+R+"$"),_={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,J=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){f()},ae=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{L.apply(k=N.call(w.childNodes),w.childNodes),k[w.childNodes.length].nodeType}catch(t){L={apply:k.length?function(e,t){j.apply(e,N.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var o,s,l,u,d,h,m,y=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(f(t),t=t||p,g)){if(11!==w&&(d=Z.exec(e)))if(o=d[1]){if(9===w){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(y&&(l=y.getElementById(o))&&b(t,l)&&l.id===o)return r.push(l),r}else{if(d[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!H[e+" "]&&(!v||!v.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(m=e,y=t,1===w&&(V.test(e)||$.test(e))){for((y=ee.test(e)&&me(t.parentNode)||t)===t&&n.scope||((u=t.getAttribute("id"))?u=u.replace(re,ie):t.setAttribute("id",u=x)),s=(h=a(e)).length;s--;)h[s]=(u?"#"+u:":scope")+" "+be(h[s]);m=h.join(",")}try{return L.apply(r,y.querySelectorAll(m)),r}catch(t){H(e,!0)}finally{u===x&&t.removeAttribute("id")}}}return c(e.replace(z,"$1"),t,r,i)}function ce(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function le(e){return e[x]=!0,e}function ue(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function fe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ge(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ve(e){return le((function(t){return t=+t,le((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function me(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},f=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=p&&9===a.nodeType&&a.documentElement&&(h=(p=a).documentElement,g=!o(p),w!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ue((function(e){return h.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ue((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ue((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(p.getElementsByClassName),n.getById=ue((function(e){return h.appendChild(e).id=x,!p.getElementsByName||!p.getElementsByName(x).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},m=[],v=[],(n.qsa=K.test(p.querySelectorAll))&&(ue((function(e){var t;h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+F+"*(?:value|"+O+")"),e.querySelectorAll("[id~="+x+"-]").length||v.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+F+"*name"+F+"*="+F+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")})),ue((function(e){e.innerHTML="";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+F+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")}))),(n.matchesSelector=K.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),m.push("!=",B)})),v=v.length&&new RegExp(v.join("|")),m=m.length&&new RegExp(m.join("|")),t=K.test(h.compareDocumentPosition),b=t||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},I=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==p||e.ownerDocument==w&&b(w,e)?-1:t==p||t.ownerDocument==w&&b(w,t)?1:u?q(u,e)-q(u,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==p?-1:t==p?1:i?-1:o?1:u?q(u,e)-q(u,t):0;if(i===o)return fe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?fe(a[r],s[r]):a[r]==w?-1:s[r]==w?1:0}),p},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(f(e),n.matchesSelector&&g&&!H[t+" "]&&(!m||!m.test(t))&&(!v||!v.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){H(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return _.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=P[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&P(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return m(t)?P.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?P.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?P.grep(e,(function(e){return-1)[^>]*|#([\w-]+))$/;(P.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||L,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:N.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof P?t[0]:t,P.merge(this,P.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),A.test(r[1])&&P.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=b.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(P):P.makeArray(e,this)}).prototype=P.fn,L=P(b);var q=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function F(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}P.fn.extend({has:function(e){var t=P(e,this),n=t.length;return this.filter((function(){for(var e=0;e\x20\t\r\n\f]*)/i,me=/^$|^module$|\/(?:java|ecma)script/i;pe=b.createDocumentFragment().appendChild(b.createElement("div")),(he=b.createElement("input")).setAttribute("type","radio"),he.setAttribute("checked","checked"),he.setAttribute("name","t"),pe.appendChild(he),v.checkClone=pe.cloneNode(!0).cloneNode(!0).lastChild.checked,pe.innerHTML="",v.noCloneChecked=!!pe.cloneNode(!0).lastChild.defaultValue,pe.innerHTML="",v.option=!!pe.lastChild;var ye={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function be(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&k(e,t)?P.merge([e],n):n}function xe(e,t){for(var n=0,r=e.length;n",""]);var we=/<|&#?\w+;/;function Ce(e,t,n,r,i){for(var o,a,s,c,l,u,d=t.createDocumentFragment(),f=[],p=0,h=e.length;p\s*$/g;function Ne(e,t){return k(e,"table")&&k(11!==t.nodeType?t:t.firstChild,"tr")&&P(e).children("tbody")[0]||e}function qe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(K.hasData(e)&&(s=K.get(e).events))for(i in K.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),b.head.appendChild(t[0])},abort:function(){n&&n()}}}));var _t,Yt=[],Jt=/(=)\?(?=&|$)|\?\?/;P.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||P.expando+"_"+St.guid++;return this[e]=!0,e}}),P.ajaxPrefilter("json jsonp",(function(e,t,n){var i,o,a,s=!1!==e.jsonp&&(Jt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Jt.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Jt,"$1"+i):!1!==e.jsonp&&(e.url+=(Ht.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||P.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=r[i],r[i]=function(){a=arguments},n.always((function(){void 0===o?P(r).removeProp(i):r[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,Yt.push(i)),a&&m(o)&&o(a[0]),a=o=void 0})),"script"})),v.createHTMLDocument=((_t=b.implementation.createHTMLDocument("").body).innerHTML="
    ",2===_t.childNodes.length),P.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=b.implementation.createHTMLDocument("")).createElement("base")).href=b.location.href,t.head.appendChild(r)):t=b),o=!n&&[],(i=A.exec(e))?[t.createElement(i[1])]:(i=Ce([e],t,o),o&&o.length&&P(o).remove(),P.merge([],i.childNodes)));var r,i,o},P.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(P.parseHTML(e)).find(r):e)})).always(n&&function(e,t){a.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},P.expr.pseudos.animated=function(e){return P.grep(P.timers,(function(t){return e===t.elem})).length},P.offset={setOffset:function(e,t,n){var r,i,o,a,s,c,l=P.css(e,"position"),u=P(e),d={};"static"===l&&(e.style.position="relative"),s=u.offset(),o=P.css(e,"top"),c=P.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+c).indexOf("auto")?(a=(r=u.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(c)||0),m(t)&&(t=t.call(e,n,P.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):("number"==typeof d.top&&(d.top+="px"),"number"==typeof d.left&&(d.left+="px"),u.css(d))}},P.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){P.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===P.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===P.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=P(e).offset()).top+=P.css(e,"borderTopWidth",!0),i.left+=P.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-P.css(r,"marginTop",!0),left:t.left-i.left-P.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===P.css(e,"position");)e=e.offsetParent;return e||ae}))}}),P.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;P.fn[e]=function(r){return V(this,(function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i}),e,r,arguments.length)}})),P.each(["top","left"],(function(e,t){P.cssHooks[t]=Ve(v.pixelPosition,(function(e,n){if(n)return n=$e(e,t),Be.test(n)?P(e).position()[t]+"px":n}))})),P.each({Height:"height",Width:"width"},(function(e,t){P.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){P.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return V(this,(function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?P.css(t,n,s):P.style(t,n,i,s)}),t,a?i:void 0,a)}}))})),P.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){P.fn[t]=function(e){return this.on(t,e)}})),P.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),P.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){P.fn[t]=function(e,n){return 0{var e,t;H5P.RequestQueue=function(e,t){const n=function(e){t.call(this),this.processingQueue=!1,e=e||{},this.showToast=e.showToast,this.itemName="requestQueue"};return n.prototype.add=function(e,t){if(!window.localStorage)return!1;let n=this.getStoredRequests();return n||(n=[]),n.push({url:e,data:t}),window.localStorage.setItem(this.itemName,JSON.stringify(n)),this.trigger("requestQueued",{storedStatements:n,processingQueue:this.processingQueue}),!0},n.prototype.getStoredRequests=function(){if(!window.localStorage)return!1;const e=window.localStorage.getItem(this.itemName);return e?JSON.parse(e):[]},n.prototype.clearQueue=function(){return!!window.localStorage&&(window.localStorage.removeItem(this.itemName),!0)},n.prototype.resumeQueue=function(){if(!H5PIntegration||!window.navigator||!window.localStorage)return!1;if(this.processingQueue)return!1;const e=this.getStoredRequests(),t=e.length;return this.clearQueue(),t?(this.processingQueue=!0,this.processQueue(e),!0):(this.trigger("emptiedQueue",e),!0)},n.prototype.processQueue=function(t){if(!t.length)return;this.trigger("processingQueue");const n=t.shift(),r=this;e.post(n.url,n.data).fail(r.onQueuedRequestFail.bind(r,n)).always(r.onQueuedRequestProcessed.bind(r,t))},n.prototype.onQueuedRequestFail=function(e){window.navigator.onLine||this.add(e.url,e.data)},n.prototype.onQueuedRequestProcessed=function(e){if(e.length)return void this.processQueue(e);this.processingQueue=!1;const t=this.getStoredRequests();this.trigger("queueEmptied",t)},n.prototype.displayToastMessage=function(e,t,n){if(!this.showToast&&!t)return;const r=H5P.jQuery.extend(!0,{},{position:{horizontal:"centered",vertical:"centered",noOverflowX:!0}},n);H5P.attachToastTo(H5P.jQuery(".h5p-content:first")[0],e,r)},n}(H5P.jQuery,H5P.EventDispatcher),H5P.OfflineRequestQueue=(e=H5P.RequestQueue,t=H5P.ConfirmationDialog,function(n){const r=new e;r.clearQueue();let i=null;const o=[10,20,40,60,120,300,600];let a=-1,s=null,c=!1,l=!1,u=!1;const d=n.instance,f=new t({headerText:H5P.t("offlineDialogHeader"),dialogText:H5P.t("offlineDialogBody"),confirmText:H5P.t("offlineDialogRetryButtonLabel"),hideCancel:!0,hideExit:!0,classes:["offline"],instance:d,skipRestoreFocus:!0}),p=f.getElement(),h=document.createElement("div");h.classList.add("count-down"),h.innerHTML=H5P.t("offlineDialogRetryMessage").replace(":num",'0'),p.querySelector(".h5p-confirmation-dialog-text").appendChild(h);const g=h.querySelector(".count-down-num"),v=document.createElement("div");v.classList.add("throbber-wrapper");const m=document.createElement("div");m.classList.add("sending-requests-throbber"),v.appendChild(m),r.on("requestQueued",function(e){if(!e.data||!e.data.processingQueue){if(!c){const e=document.body.querySelector(".h5p-content");if(!e)return;f.appendTo(e),e.appendChild(v),c=!0}x()}}.bind(this)),r.on("queueEmptied",function(e){e.data&&e.data.length?x(!0):(clearInterval(s),y(!1),a=-1,l&&(f.hide(),l=!1),r.displayToastMessage(H5P.t("offlineSuccessfulSubmit"),!0,{position:{vertical:"top",offsetVertical:"100"}}))}.bind(this)),f.on("confirmed",function(){l=!1,setTimeout((function(){b()}),100)}.bind(this)),window.addEventListener("online",function(){b()}.bind(this)),window.addEventListener("message",function(e){window.parent===e.source&&"h5p"===e.data.context&&"queueRequest"===e.data.action&&this.add(e.data.url,e.data.data)}.bind(this));const y=function(e){u=!u,void 0!==e&&(u=e),u&&l&&(f.hide(),l=!1),u?v.classList.add("show"):v.classList.remove("show")},b=function(){clearInterval(s),y(!0),r.resumeQueue()},x=function(e){l||(y(!1),l||(e?setTimeout((function(){f.show(0)}),100):f.show(0)),l=!0,i=(new Date).getTime(),a+=1,a>=o.length&&(a=o.length-1),clearInterval(s),s=setInterval(w,100))},w=function(){const e=(new Date).getTime(),t=Math.floor((e-i)/1e3),n=o[a]-t;g.textContent=n.toString(),n<=0&&b()};this.add=function(e,t){if(window.navigator.onLine)return!1;r.add(e,t)}})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{"use strict";n.d(r,{default:()=>a});var e=n(357),t=n.n(e),i=window.H5P=window.H5P||{};i.jQuery=t().noConflict(!0),i.jQuery.fn.__originalLoad=i.jQuery.load,i.jQuery.fn.load=function(e,t,n){if("function"==typeof e){console.warn("You are using a deprecated H5P library. Please upgrade!");let e=Array.prototype.slice.call(arguments);return e.unshift("load"),i.jQuery.fn.on.apply(this,e)}return i.jQuery.fn.__originalLoad.apply(this,arguments)},i.isFramed=window.self!==window.parent,i.$window=i.jQuery(window),i.instances=[],document.documentElement.requestFullScreen?i.fullScreenBrowserPrefix="":document.documentElement.webkitRequestFullScreen?(i.safariBrowser=navigator.userAgent.match(/version\/([.\d]+)/i),i.safariBrowser=null===i.safariBrowser?0:parseInt(i.safariBrowser[1]),(0===i.safariBrowser||i.safariBrowser>6)&&(i.fullScreenBrowserPrefix="webkit")):document.documentElement.mozRequestFullScreen?i.fullScreenBrowserPrefix="moz":document.documentElement.msRequestFullscreen&&(i.fullScreenBrowserPrefix="ms"),i.opened={},i.init=function(e){void 0===i.$body&&(i.$body=i.jQuery(document.body)),void 0===i.fullscreenSupported&&(i.fullscreenSupported=!(H5PIntegration.fullscreenDisabled||i.fullscreenDisabled||i.isFramed&&!1!==i.externalEmbed&&!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled))),void 0===i.canHasFullScreen&&(i.canHasFullScreen=i.fullscreenSupported),i.jQuery(".h5p-content:not(.h5p-initialized)",e).each((function(){var e=i.jQuery(this).addClass("h5p-initialized"),t=i.jQuery('
    ').appendTo(e),n=e.data("content-id"),r=H5PIntegration.contents["cid-"+n];if(void 0===r)return i.error("No data for content id "+n+". Perhaps the library is gone?");var o={library:r.library,params:JSON.parse(r.jsonContent),metadata:r.metadata};i.getUserData(n,"state",(function(e,s){if(s)o.userDatas={state:s};else if(null===s&&H5PIntegration.saveFreq){delete r.contentUserData;var c=new i.Dialog("content-user-data-reset","Data Reset","

    "+i.t("contentChanged")+"

    "+i.t("startingOver")+'

    OK
    ',t);i.jQuery(c).on("dialog-opened",(function(e,t){var r=function(e){"click"!==e.type&&32!==e.which||(c.close(),i.deleteUserData(n,"state",0))};t.find(".h5p-dialog-ok-button").click(r).keypress(r),i.trigger(a,"resize")})).on("dialog-closed",(function(){i.trigger(a,"resize")})),c.open()}}));var a=i.newRunnable(o,n,t,!0,{standalone:!0});i.offlineRequestQueue=new i.OfflineRequestQueue({instance:a}),1==r.fullScreen&&i.fullscreenSupported&&i.jQuery('
    ').prependTo(t).children().click((function(){i.fullScreen(t,a)})).keydown((function(e){if(32===e.which||13===e.which)return i.fullScreen(t,a),!1}));var s,c=r.displayOptions,l=!1;if(c.frame){if(c.copyright){var u=i.getCopyrights(a,o.params,n,o.metadata);u||(c.copyright=!1)}var d=new i.ActionBar(c),f=d.getDOMElement();d.on("reuse",(function(){i.openReuseDialog(f,r,o,a,n),a.triggerXAPI("accessed-reuse")})),d.on("copyrights",(function(){new i.Dialog("copyrights",i.t("copyrightInformation"),u,t).open(!0),a.triggerXAPI("accessed-copyright")})),d.on("embed",(function(){i.openEmbedDialog(f,r.embedCode,r.resizeCode,{width:e.width(),height:e.height()},a),a.triggerXAPI("accessed-embed")})),d.hasActions()&&(l=!0,f.insertAfter(t))}if(e.addClass(l?"h5p-frame":"h5p-no-frame"),i.opened[n]=new Date,i.on(a,"finish",(function(e){void 0!==e.data&&i.setFinished(n,e.data.score,e.data.maxScore,e.data.time)})),i.on(a,"xAPI",i.xAPICompletedListener),!1!==H5PIntegration.saveFreq&&(a.getCurrentState instanceof Function||"function"==typeof a.getCurrentState)){var p,h=function(){var e=a.getCurrentState();void 0!==e&&i.setUserData(n,"state",e,{deleteOnChange:!0}),H5PIntegration.saveFreq&&(p=setTimeout(h,1e3*H5PIntegration.saveFreq))};H5PIntegration.saveFreq&&(p=setTimeout(h,1e3*H5PIntegration.saveFreq)),i.on(a,"xAPI",(function(e){var t=e.getVerb();"completed"!==t&&"progressed"!==t||(clearTimeout(p),p=setTimeout(h,3e3))}))}if(i.isFramed)if(!1===i.externalEmbed){var g=window.frameElement;i.on(a,"resize",(function(){clearTimeout(s),s=setTimeout((function(){!function(){if(!window.parent.H5P.isFullscreen){var e=g.parentElement.style.height;g.parentElement.style.height=g.parentElement.clientHeight+"px",g.getBoundingClientRect(),g.style.height="1px",g.style.height=g.contentDocument.body.scrollHeight+"px",g.parentElement.style.height=e}}()}),1)}))}else if(i.communicator){var v=!1;i.communicator.on("ready",(function(){i.communicator.send("hello")})),i.communicator.on("hello",(function(){v=!0,document.body.style.height="auto",document.body.style.overflow="hidden",i.trigger(a,"resize")})),i.communicator.on("resizePrepared",(function(){i.communicator.send("resize",{scrollHeight:document.body.scrollHeight})})),i.communicator.on("resize",(function(){i.trigger(a,"resize")})),i.on(a,"resize",(function(){i.isFullscreen||(clearTimeout(s),s=setTimeout((function(){v?i.communicator.send("prepareResize",{scrollHeight:document.body.scrollHeight,clientHeight:document.body.clientHeight}):i.communicator.send("hello")}),0))}))}i.isFramed&&!1!==i.externalEmbed||i.jQuery(window.parent).resize((function(){window.parent.H5P.isFullscreen,i.trigger(a,"resize")})),i.instances.push(a),i.trigger(a,"resize"),e.addClass("using-mouse"),e.on("mousedown keydown keyup",(function(t){e.toggleClass("using-mouse","mousedown"===t.type)})),i.externalDispatcher&&i.externalDispatcher.trigger("initialized")})),i.jQuery("iframe.h5p-iframe:not(.h5p-initialized)",e).each((function(){var e=i.jQuery(this).addClass("h5p-initialized").data("content-id");const t=H5PIntegration.contents["cid-"+e],n=t&&t.metadata&&t.metadata.defaultLanguage?t.metadata.defaultLanguage:"en";this.contentDocument.open(),this.contentDocument.write(''+i.getHeadTags(e)+'
    '),this.contentDocument.close()}))},i.getHeadTags=function(e){var t=function(e){for(var t="",n=0;n';return t},n=function(e){for(var t="",n=0;n<\/script>';return t};return''+t(H5PIntegration.core.styles)+t(H5PIntegration.contents["cid-"+e].styles)+n(H5PIntegration.core.scripts)+n(H5PIntegration.contents["cid-"+e].scripts)+"