From d8dc8e37c6253121dcbe815bf6dc393aca6a7fac Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Mon, 18 Nov 2024 11:20:43 -0500 Subject: [PATCH] chore: prepare v1.5.2, including updating bundle --- package-lock.json | 6 +++--- packages/ngx-web-component/package.json | 4 ++-- packages/studio-web/package.json | 4 ++-- packages/studio-web/src/assets/bundle.js | 6 +++--- packages/web-component/package.json | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index f9d7ce49..1b0ac0e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27605,11 +27605,11 @@ }, "packages/ngx-web-component": { "name": "@readalongs/ngx-web-component", - "version": "1.5.1", + "version": "1.5.2", "peerDependencies": { "@angular/common": "^17", "@angular/core": "^17", - "@readalongs/web-component": "1.5.1" + "@readalongs/web-component": "1.5.2" } }, "packages/studio-web": { @@ -27618,7 +27618,7 @@ }, "packages/web-component": { "name": "@readalongs/web-component", - "version": "1.5.1", + "version": "1.5.2", "license": "MIT", "dependencies": { "audio-recorder-polyfill": "^0.4.1", diff --git a/packages/ngx-web-component/package.json b/packages/ngx-web-component/package.json index 489bf188..d680fd79 100644 --- a/packages/ngx-web-component/package.json +++ b/packages/ngx-web-component/package.json @@ -1,12 +1,12 @@ { "name": "@readalongs/ngx-web-component", "type": "module", - "version": "1.5.1", + "version": "1.5.2", "private": false, "peerDependencies": { "@angular/core": "^17", "@angular/common": "^17", - "@readalongs/web-component": "1.5.1" + "@readalongs/web-component": "1.5.2" }, "nx": { "implicitDependencies": [ diff --git a/packages/studio-web/package.json b/packages/studio-web/package.json index d86d5619..83378871 100644 --- a/packages/studio-web/package.json +++ b/packages/studio-web/package.json @@ -12,6 +12,6 @@ "test:once": "ng test --watch=false --browsers ChromeHeadlessCI" }, "private": true, - "singleFileBundleVersion": "1.5.1", - "singleFileBundleTimestamp": "2024-10-17+16-04-06" + "singleFileBundleVersion": "1.5.2", + "singleFileBundleTimestamp": "2024-11-18+11-19-49" } diff --git a/packages/studio-web/src/assets/bundle.js b/packages/studio-web/src/assets/bundle.js index d2b548c8..e399aa9f 100644 --- a/packages/studio-web/src/assets/bundle.js +++ b/packages/studio-web/src/assets/bundle.js @@ -1,4 +1,4 @@ -(()=>{var e={19:(e,t,n)=>{"use strict";n.d(t,{b:()=>K,g:()=>v,h:()=>p,p:()=>me,r:()=>ie});let o,r,i=!1,a=!1,s=!1;const l="slot-fb{display:contents}slot-fb[hidden]{display:none}",d="http://www.w3.org/1999/xlink",c={},u=e=>"object"===(e=typeof e)||"function"===e;function h(e){var t,n,o;return null!==(o=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==o?o:void 0}const p=(e,t,...n)=>{let o=null,r=null,i=!1,a=!1;const s=[],l=t=>{for(let n=0;ne[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,s,m);const d=g(e,null);return d.$attrs$=t,s.length>0&&(d.$children$=s),d.$key$=r,d},g=(e,t)=>{const n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null};return n},_={},m={forEach:(e,t)=>e.map(f).forEach(t),map:(e,t)=>e.map(f).map(t).map(b)},f=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),b=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),p(e.vtag,t,...e.vchildren||[])}const t=g(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},v=e=>re(e).$hostElement$,y=new WeakMap,w=e=>{const t=e.$cmpMeta$,n=e.$hostElement$,o=t.$flags$,r=(t.$tagName$,()=>{}),i=((e,t,n)=>{var o;const r=x(t),i=ue.get(r);if(e=11===e.nodeType?e:pe,i)if("string"==typeof i){e=e.head||e;let n,a=y.get(e);if(a||y.set(e,a=new Set),!a.has(r)){{n=pe.createElement("style"),n.innerHTML=i;const t=null!==(o=ge.$nonce$)&&void 0!==o?o:h(pe);null!=t&&n.setAttribute("nonce",t),e.insertBefore(n,e.querySelector("link"))}4&t.$flags$&&(n.innerHTML+=l),a&&a.add(r)}}else e.adoptedStyleSheets.includes(i)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,i]);return r})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&o&&(n["s-sc"]=i,n.classList.add(i+"-h")),r()},x=(e,t)=>"sc-"+e.$tagName$,$=(e,t,n,o,r,i)=>{if(n!==o){let a=se(e,t),s=t.toLowerCase();if("class"===t){const t=e.classList,r=k(n),i=k(o);t.remove(...r.filter((e=>e&&!i.includes(e)))),t.add(...i.filter((e=>e&&!r.includes(e))))}else if("style"===t){for(const t in n)o&&null!=o[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in o)n&&o[t]===n[t]||(t.includes("-")?e.style.setProperty(t,o[t]):e.style[t]=o[t])}else if("key"===t);else if("ref"===t)o&&o(e);else if(a||"o"!==t[0]||"n"!==t[1]){const l=u(o);if((a||l&&null!==o)&&!r)try{if(e.tagName.includes("-"))e[t]=o;else{const r=null==o?"":o;"list"===t?a=!1:null!=n&&e[t]==r||(e[t]=r)}}catch(e){}let c=!1;s!==(s=s.replace(/^xlink\:?/,""))&&(t=s,c=!0),null==o||!1===o?!1===o&&""!==e.getAttribute(t)||(c?e.removeAttributeNS(d,t):e.removeAttribute(t)):(!a||4&i||r)&&!l&&(o=!0===o?"":o,c?e.setAttributeNS(d,t,o):e.setAttribute(t,o))}else if(t="-"===t[2]?t.slice(3):se(he,s)?s.slice(2):s[2]+t.slice(3),n||o){const r=t.endsWith(S);t=t.replace(T,""),n&&ge.rel(e,t,n,r),o&&ge.ael(e,t,o,r)}}},A=/\s/,k=e=>e?e.split(A):[],S="Capture",T=new RegExp(S+"$"),I=(e,t,n,o)=>{const r=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||c,a=t.$attrs$||c;for(o of P(Object.keys(i)))o in a||$(r,o,i[o],void 0,n,t.$flags$);for(o of P(Object.keys(a)))$(r,o,i[o],a[o],n,t.$flags$)};function P(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}const E=(e,t,n,i)=>{const s=t.$children$[n];let l,d,c=0;if(null!==s.$text$)l=s.$elm$=pe.createTextNode(s.$text$);else if(l=s.$elm$=pe.createElement(s.$tag$),I(null,s,a),null!=o&&l["s-si"]!==o&&l.classList.add(l["s-si"]=o),s.$children$)for(c=0;c{let s,l=e;for(l.shadowRoot&&l.tagName===r&&(l=l.shadowRoot);i<=a;++i)o[i]&&(s=E(null,n,i),s&&(o[i].$elm$=s,l.insertBefore(s,t)))},L=(e,t,n)=>{for(let o=t;o<=n;++o){const t=e[o];if(t){const e=t.$elm$;M(t),e&&e.remove()}}},R=(e,t,n=!1)=>e.$tag$===t.$tag$&&(!!n||e.$key$===t.$key$),C=(e,t,n=!1)=>{const o=t.$elm$=e.$elm$,r=e.$children$,s=t.$children$,l=t.$tag$,d=t.$text$;null===d?(("slot"!==l||i)&&I(e,t,a),null!==r&&null!==s?((e,t,n,o,r=!1)=>{let i,a,s=0,l=0,d=0,c=0,u=t.length-1,h=t[0],p=t[u],g=o.length-1,_=o[0],m=o[g];for(;s<=u&&l<=g;)if(null==h)h=t[++s];else if(null==p)p=t[--u];else if(null==_)_=o[++l];else if(null==m)m=o[--g];else if(R(h,_,r))C(h,_,r),h=t[++s],_=o[++l];else if(R(p,m,r))C(p,m,r),p=t[--u],m=o[--g];else if(R(h,m,r))C(h,m,r),e.insertBefore(h.$elm$,p.$elm$.nextSibling),h=t[++s],m=o[--g];else if(R(p,_,r))C(p,_,r),e.insertBefore(p.$elm$,h.$elm$),p=t[--u],_=o[++l];else{for(d=-1,c=s;c<=u;++c)if(t[c]&&null!==t[c].$key$&&t[c].$key$===_.$key$){d=c;break}d>=0?(a=t[d],a.$tag$!==_.$tag$?i=E(t&&t[l],n,d):(C(a,_,r),t[d]=void 0,i=a.$elm$),_=o[++l]):(i=E(t&&t[l],n,l),_=o[++l]),i&&h.$elm$.parentNode.insertBefore(i,h.$elm$)}s>u?O(e,null==o[g+1]?null:o[g+1].$elm$,n,o,l,g):l>g&&L(t,s,u)})(o,r,t,s,n):null!==s?(null!==e.$text$&&(o.textContent=""),O(o,null,t,s,0,s.length-1)):null!==r&&L(r,0,r.length-1)):e.$text$!==d&&(o.data=d)},M=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(M)},F=(e,t,n=!1)=>{const a=e.$hostElement$,s=e.$cmpMeta$,l=e.$vnode$||g(null,null),d=(c=t)&&c.$tag$===_?t:p(null,null,t);var c;if(r=a.tagName,s.$attrsToReflect$&&(d.$attrs$=d.$attrs$||{},s.$attrsToReflect$.map((([e,t])=>d.$attrs$[t]=a[e]))),n&&d.$attrs$)for(const e of Object.keys(d.$attrs$))a.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(d.$attrs$[e]=a[e]);d.$tag$=null,d.$flags$|=4,e.$vnode$=d,d.$elm$=l.$elm$=a.shadowRoot||a,o=a["s-sc"],i=!!(1&s.$flags$),C(l,d,n)},D=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.$onRenderResolve$=t)))},B=(e,t)=>{if(e.$flags$|=16,4&e.$flags$)return void(e.$flags$|=512);D(e,e.$ancestorComponent$);return Ae((()=>j(e,t)))},j=(e,t)=>{const n=(e.$cmpMeta$.$tagName$,()=>{}),o=e.$lazyInstance$;let r;return t&&(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.map((([e,t])=>U(o,e,t))),e.$queuedListeners$=void 0),r=U(o,"componentWillLoad")),n(),q(r,(()=>N(e,o,t)))},q=(e,t)=>H(e)?e.then(t):t(),H=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,N=async(e,t,n)=>{var o;const r=e.$hostElement$,i=(e.$cmpMeta$.$tagName$,()=>{}),a=r["s-rc"];n&&w(e);const s=(e.$cmpMeta$.$tagName$,()=>{});z(e,t,r,n),a&&(a.map((e=>e())),r["s-rc"]=void 0),s(),i();{const t=null!==(o=r["s-p"])&&void 0!==o?o:[],n=()=>V(e);0===t.length?n():(Promise.all(t).then(n),e.$flags$|=4,t.length=0)}},z=(e,t,n,o)=>{try{t=t.render(),e.$flags$&=-17,e.$flags$|=2,F(e,t,o)}catch(t){le(t,e.$hostElement$)}return null},V=e=>{e.$cmpMeta$.$tagName$;const t=e.$hostElement$,n=()=>{},o=e.$lazyInstance$,r=e.$ancestorComponent$;U(o,"componentDidRender"),64&e.$flags$?(U(o,"componentDidUpdate"),n()):(e.$flags$|=64,W(t),U(o,"componentDidLoad"),n(),e.$onReadyResolve$(t),r||G()),e.$onInstanceResolve$(t),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),512&e.$flags$&&$e((()=>B(e,!1))),e.$flags$&=-517},G=e=>{W(pe.documentElement),$e((()=>((e,t,n)=>{const o=ge.ce(t,n);return e.dispatchEvent(o),o})(he,"appload",{detail:{namespace:"web-component"}})))},U=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){le(e)}},W=e=>e.classList.add("hydrated"),X=(e,t,n,o)=>{const r=re(e),i=r.$hostElement$,a=r.$instanceValues$.get(t),s=r.$flags$,l=r.$lazyInstance$;var d,c;d=n,c=o.$members$[t][0],n=null==d||u(d)?d:4&c?"false"!==d&&(""===d||!!d):2&c?parseFloat(d):1&c?String(d):d;const h=Number.isNaN(a)&&Number.isNaN(n);if((!(8&s)||void 0===a)&&(n!==a&&!h)&&(r.$instanceValues$.set(t,n),l)){if(o.$watchers$&&128&s){const e=o.$watchers$[t];e&&e.map((e=>{try{l[e](n,a,t)}catch(e){le(e,i)}}))}2==(18&s)&&B(r,!1)}},Y=(e,t,n)=>{var o;const r=e.prototype;if(t.$members$){e.watchers&&(t.$watchers$=e.watchers);const i=Object.entries(t.$members$);if(i.map((([e,[o]])=>{31&o||2&n&&32&o?Object.defineProperty(r,e,{get(){return t=e,re(this).$instanceValues$.get(t);var t},set(n){X(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&o&&Object.defineProperty(r,e,{value(...t){var n;const o=re(this);return null===(n=null==o?void 0:o.$onInstancePromise$)||void 0===n?void 0:n.then((()=>{var n;return null===(n=o.$lazyInstance$)||void 0===n?void 0:n[e](...t)}))}})})),1&n){const n=new Map;r.attributeChangedCallback=function(e,o,i){ge.jmp((()=>{var a;const s=n.get(e);if(this.hasOwnProperty(s))i=this[s],delete this[s];else{if(r.hasOwnProperty(s)&&"number"==typeof this[s]&&this[s]==i)return;if(null==s){const n=re(this),r=null==n?void 0:n.$flags$;if(r&&!(8&r)&&128&r&&i!==o){const r=n.$lazyInstance$,s=null===(a=t.$watchers$)||void 0===a?void 0:a[e];null==s||s.forEach((t=>{null!=r[t]&&r[t].call(r,i,o,e)}))}return}}this[s]=(null!==i||"boolean"!=typeof this[s])&&i}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!==(o=t.$watchers$)&&void 0!==o?o:{}),...i.filter((([e,t])=>15&t[0])).map((([e,o])=>{var r;const i=o[1]||e;return n.set(i,e),512&o[0]&&(null===(r=t.$attrsToReflect$)||void 0===r||r.push([e,i])),i}))]))}}return e},Q=async(e,t,n,o)=>{let r;if(!(32&t.$flags$)){t.$flags$|=32;if(n.$lazyBundleId$){if(r=ce(n),r.then){const e=()=>{};r=await r,e()}r.isProxied||(n.$watchers$=r.watchers,Y(r,n,2),r.isProxied=!0);const e=(n.$tagName$,()=>{});t.$flags$|=8;try{new r(t)}catch(e){le(e)}t.$flags$&=-9,t.$flags$|=128,e()}else r=e.constructor,customElements.whenDefined(n.$tagName$).then((()=>t.$flags$|=128));if(r.style){let e=r.style;const t=x(n);if(!ue.has(t)){const o=(n.$tagName$,()=>{});((e,t,n)=>{let o=ue.get(e);fe&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=t:o.replaceSync(t)):o=t,ue.set(e,o)})(t,e,!!(1&n.$flags$)),o()}}}const i=t.$ancestorComponent$,a=()=>B(t,!0);i&&i["s-rc"]?i["s-rc"].push(a):a()},Z=e=>{U(e,"disconnectedCallback")},K=(e,t={})=>{var n;const o=()=>{},r=[],i=t.exclude||[],a=he.customElements,s=pe.head,d=s.querySelector("meta[charset]"),c=pe.createElement("style"),u=[];let p,g=!0;Object.assign(ge,t),ge.$resourcesUrl$=new URL(t.resourcesUrl||"./",pe.baseURI).href;let _=!1;if(e.map((e=>{e[1].map((t=>{var n;const o={$flags$:t[0],$tagName$:t[1],$members$:t[2],$listeners$:t[3]};4&o.$flags$&&(_=!0),o.$members$=t[2],o.$listeners$=t[3],o.$attrsToReflect$=[],o.$watchers$=null!==(n=t[4])&&void 0!==n?n:{};const s=o.$tagName$,l=class extends HTMLElement{constructor(e){super(e),ae(e=this,o),1&o.$flags$&&e.attachShadow({mode:"open"})}connectedCallback(){p&&(clearTimeout(p),p=null),g?u.push(this):ge.jmp((()=>(e=>{if(!(1&ge.$flags$)){const t=re(e),n=t.$cmpMeta$,o=(n.$tagName$,()=>{});if(1&t.$flags$)J(e,t,n.$listeners$),(null==t?void 0:t.$lazyInstance$)||(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then((()=>{}));else{t.$flags$|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){D(t,t.$ancestorComponent$=n);break}}n.$members$&&Object.entries(n.$members$).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),Q(e,t,n)}o()}})(this)))}disconnectedCallback(){ge.jmp((()=>(async e=>{if(!(1&ge.$flags$)){const t=re(e);t.$rmListeners$&&(t.$rmListeners$.map((e=>e())),t.$rmListeners$=void 0),(null==t?void 0:t.$lazyInstance$)?Z(t.$lazyInstance$):(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then((()=>Z(t.$lazyInstance$)))}})(this)))}componentOnReady(){return re(this).$onReadyPromise$}};o.$lazyBundleId$=e[0],i.includes(s)||a.get(s)||(r.push(s),a.define(s,Y(l,o,1)))}))})),r.length>0&&(_&&(c.textContent+=l),c.textContent+=r+"{visibility:hidden}.hydrated{visibility:inherit}",c.innerHTML.length)){c.setAttribute("data-styles","");const e=null!==(n=ge.$nonce$)&&void 0!==n?n:h(pe);null!=e&&c.setAttribute("nonce",e),s.insertBefore(c,d?d.nextSibling:s.firstChild)}g=!1,u.length?u.map((e=>e.connectedCallback())):ge.jmp((()=>p=setTimeout(G,30))),o()},J=(e,t,n,o)=>{n&&n.map((([n,o,r])=>{const i=te(e,n),a=ee(t,r),s=ne(n);ge.ael(i,o,a,s),(t.$rmListeners$=t.$rmListeners$||[]).push((()=>ge.rel(i,o,a,s)))}))},ee=(e,t)=>n=>{try{256&e.$flags$?e.$lazyInstance$[t](n):(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,n])}catch(e){le(e)}},te=(e,t)=>8&t?he:e,ne=e=>_e?{passive:!!(1&e),capture:!!(2&e)}:!!(2&e),oe=new WeakMap,re=e=>oe.get(e),ie=(e,t)=>oe.set(t.$lazyInstance$=e,t),ae=(e,t)=>{const n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return n.$onInstancePromise$=new Promise((e=>n.$onInstanceResolve$=e)),n.$onReadyPromise$=new Promise((e=>n.$onReadyResolve$=e)),e["s-p"]=[],e["s-rc"]=[],J(e,n,t.$listeners$),oe.set(e,n)},se=(e,t)=>t in e,le=(e,t)=>(0,console.error)(e,t),de=new Map,ce=(e,t,o)=>{const r=e.$tagName$.replace(/-/g,"_"),i=e.$lazyBundleId$,a=de.get(i);if(a)return a[r];if(!o||!BUILD.hotModuleReplacement){const e=e=>(de.set(i,e),e[r]);if("read-along"===i)return Promise.resolve().then(n.bind(n,704)).then(e,le)}return n(131)(`./${i}.entry.js`).then((e=>(de.set(i,e),e[r])),le)},ue=new Map,he="undefined"!=typeof window?window:{},pe=he.document||{head:{}},ge={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o),ce:(e,t)=>new CustomEvent(e,t)},_e=(()=>{let e=!1;try{pe.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch(e){}return e})(),me=e=>Promise.resolve(e),fe=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),be=[],ve=[],ye=(e,t)=>n=>{e.push(n),s||(s=!0,t&&4&ge.$flags$?$e(xe):ge.raf(xe))},we=e=>{for(let t=0;t{we(be),we(ve),(s=be.length>0)&&ge.raf(xe)},$e=e=>me().then(e),Ae=ye(ve,!0)},704:(e,t,n)=>{"use strict";n.r(t),n.d(t,{read_along:()=>Z});var o,r=n(19),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},a={};function s(e){return"function"==typeof e}function l(e){const t=e((e=>{Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t} +(()=>{var e={50:(e,t,n)=>{"use strict";n.d(t,{F:()=>J,b:()=>K,g:()=>v,h:()=>p,p:()=>fe,r:()=>ae});let o,i,r=!1,a=!1,s=!1;const l="slot-fb{display:contents}slot-fb[hidden]{display:none}",d="http://www.w3.org/1999/xlink",c={},u=e=>"object"===(e=typeof e)||"function"===e;function h(e){var t,n,o;return null!==(o=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==o?o:void 0}const p=(e,t,...n)=>{let o=null,i=null,r=!1,a=!1;const s=[],l=t=>{for(let n=0;ne[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,s,m);const d=g(e,null);return d.$attrs$=t,s.length>0&&(d.$children$=s),d.$key$=i,d},g=(e,t)=>{const n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null};return n},_={},m={forEach:(e,t)=>e.map(f).forEach(t),map:(e,t)=>e.map(f).map(t).map(b)},f=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),b=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),p(e.vtag,t,...e.vchildren||[])}const t=g(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},v=e=>re(e).$hostElement$,y=new WeakMap,w=e=>{const t=e.$cmpMeta$,n=e.$hostElement$,o=t.$flags$,i=(t.$tagName$,()=>{}),r=((e,t,n)=>{var o;const i=x(t),r=he.get(i);if(e=11===e.nodeType?e:ge,r)if("string"==typeof r){e=e.head||e;let n,a=y.get(e);if(a||y.set(e,a=new Set),!a.has(i)){{n=ge.createElement("style"),n.innerHTML=r;const t=null!==(o=_e.$nonce$)&&void 0!==o?o:h(ge);null!=t&&n.setAttribute("nonce",t),e.insertBefore(n,e.querySelector("link"))}4&t.$flags$&&(n.innerHTML+=l),a&&a.add(i)}}else e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]);return i})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&o&&(n["s-sc"]=r,n.classList.add(r+"-h")),i()},x=(e,t)=>"sc-"+e.$tagName$,$=(e,t,n,o,i,r)=>{if(n!==o){let a=le(e,t),s=t.toLowerCase();if("class"===t){const t=e.classList,i=k(n),r=k(o);t.remove(...i.filter((e=>e&&!r.includes(e)))),t.add(...r.filter((e=>e&&!i.includes(e))))}else if("style"===t){for(const t in n)o&&null!=o[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in o)n&&o[t]===n[t]||(t.includes("-")?e.style.setProperty(t,o[t]):e.style[t]=o[t])}else if("key"===t);else if("ref"===t)o&&o(e);else if(a||"o"!==t[0]||"n"!==t[1]){const l=u(o);if((a||l&&null!==o)&&!i)try{if(e.tagName.includes("-"))e[t]=o;else{const i=null==o?"":o;"list"===t?a=!1:null!=n&&e[t]==i||(e[t]=i)}}catch(e){}let c=!1;s!==(s=s.replace(/^xlink\:?/,""))&&(t=s,c=!0),null==o||!1===o?!1===o&&""!==e.getAttribute(t)||(c?e.removeAttributeNS(d,t):e.removeAttribute(t)):(!a||4&r||i)&&!l&&(o=!0===o?"":o,c?e.setAttributeNS(d,t,o):e.setAttribute(t,o))}else if(t="-"===t[2]?t.slice(3):le(pe,s)?s.slice(2):s[2]+t.slice(3),n||o){const i=t.endsWith(S);t=t.replace(T,""),n&&_e.rel(e,t,n,i),o&&_e.ael(e,t,o,i)}}},A=/\s/,k=e=>e?e.split(A):[],S="Capture",T=new RegExp(S+"$"),I=(e,t,n,o)=>{const i=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,r=e&&e.$attrs$||c,a=t.$attrs$||c;for(o of P(Object.keys(r)))o in a||$(i,o,r[o],void 0,n,t.$flags$);for(o of P(Object.keys(a)))$(i,o,r[o],a[o],n,t.$flags$)};function P(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}const E=(e,t,n,r)=>{const s=t.$children$[n];let l,d,c=0;if(null!==s.$text$)l=s.$elm$=ge.createTextNode(s.$text$);else if(l=s.$elm$=ge.createElement(s.$tag$),I(null,s,a),null!=o&&l["s-si"]!==o&&l.classList.add(l["s-si"]=o),s.$children$)for(c=0;c{let s,l=e;for(l.shadowRoot&&l.tagName===i&&(l=l.shadowRoot);r<=a;++r)o[r]&&(s=E(null,n,r),s&&(o[r].$elm$=s,l.insertBefore(s,t)))},L=(e,t,n)=>{for(let o=t;o<=n;++o){const t=e[o];if(t){const e=t.$elm$;M(t),e&&e.remove()}}},C=(e,t,n=!1)=>e.$tag$===t.$tag$&&(!!n||e.$key$===t.$key$),R=(e,t,n=!1)=>{const o=t.$elm$=e.$elm$,i=e.$children$,s=t.$children$,l=t.$tag$,d=t.$text$;null===d?(("slot"!==l||r)&&I(e,t,a),null!==i&&null!==s?((e,t,n,o,i=!1)=>{let r,a,s=0,l=0,d=0,c=0,u=t.length-1,h=t[0],p=t[u],g=o.length-1,_=o[0],m=o[g];for(;s<=u&&l<=g;)if(null==h)h=t[++s];else if(null==p)p=t[--u];else if(null==_)_=o[++l];else if(null==m)m=o[--g];else if(C(h,_,i))R(h,_,i),h=t[++s],_=o[++l];else if(C(p,m,i))R(p,m,i),p=t[--u],m=o[--g];else if(C(h,m,i))R(h,m,i),e.insertBefore(h.$elm$,p.$elm$.nextSibling),h=t[++s],m=o[--g];else if(C(p,_,i))R(p,_,i),e.insertBefore(p.$elm$,h.$elm$),p=t[--u],_=o[++l];else{for(d=-1,c=s;c<=u;++c)if(t[c]&&null!==t[c].$key$&&t[c].$key$===_.$key$){d=c;break}d>=0?(a=t[d],a.$tag$!==_.$tag$?r=E(t&&t[l],n,d):(R(a,_,i),t[d]=void 0,r=a.$elm$),_=o[++l]):(r=E(t&&t[l],n,l),_=o[++l]),r&&h.$elm$.parentNode.insertBefore(r,h.$elm$)}s>u?O(e,null==o[g+1]?null:o[g+1].$elm$,n,o,l,g):l>g&&L(t,s,u)})(o,i,t,s,n):null!==s?(null!==e.$text$&&(o.textContent=""),O(o,null,t,s,0,s.length-1)):null!==i&&L(i,0,i.length-1)):e.$text$!==d&&(o.data=d)},M=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(M)},F=(e,t,n=!1)=>{const a=e.$hostElement$,s=e.$cmpMeta$,l=e.$vnode$||g(null,null),d=(c=t)&&c.$tag$===_?t:p(null,null,t);var c;if(i=a.tagName,s.$attrsToReflect$&&(d.$attrs$=d.$attrs$||{},s.$attrsToReflect$.map((([e,t])=>d.$attrs$[t]=a[e]))),n&&d.$attrs$)for(const e of Object.keys(d.$attrs$))a.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(d.$attrs$[e]=a[e]);d.$tag$=null,d.$flags$|=4,e.$vnode$=d,d.$elm$=l.$elm$=a.shadowRoot||a,o=a["s-sc"],r=!!(1&s.$flags$),R(l,d,n)},D=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.$onRenderResolve$=t)))},B=(e,t)=>{if(e.$flags$|=16,4&e.$flags$)return void(e.$flags$|=512);D(e,e.$ancestorComponent$);return ke((()=>j(e,t)))},j=(e,t)=>{const n=(e.$cmpMeta$.$tagName$,()=>{}),o=e.$lazyInstance$;let i;return t&&(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.map((([e,t])=>U(o,e,t))),e.$queuedListeners$=void 0),i=U(o,"componentWillLoad")),n(),H(i,(()=>N(e,o,t)))},H=(e,t)=>q(e)?e.then(t):t(),q=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,N=async(e,t,n)=>{var o;const i=e.$hostElement$,r=(e.$cmpMeta$.$tagName$,()=>{}),a=i["s-rc"];n&&w(e);const s=(e.$cmpMeta$.$tagName$,()=>{});z(e,t,i,n),a&&(a.map((e=>e())),i["s-rc"]=void 0),s(),r();{const t=null!==(o=i["s-p"])&&void 0!==o?o:[],n=()=>V(e);0===t.length?n():(Promise.all(t).then(n),e.$flags$|=4,t.length=0)}},z=(e,t,n,o)=>{try{t=t.render(),e.$flags$&=-17,e.$flags$|=2,F(e,t,o)}catch(t){de(t,e.$hostElement$)}return null},V=e=>{e.$cmpMeta$.$tagName$;const t=e.$hostElement$,n=()=>{},o=e.$lazyInstance$,i=e.$ancestorComponent$;U(o,"componentDidRender"),64&e.$flags$?(U(o,"componentDidUpdate"),n()):(e.$flags$|=64,W(t),U(o,"componentDidLoad"),n(),e.$onReadyResolve$(t),i||G()),e.$onInstanceResolve$(t),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),512&e.$flags$&&Ae((()=>B(e,!1))),e.$flags$&=-517},G=e=>{W(ge.documentElement),Ae((()=>((e,t,n)=>{const o=_e.ce(t,n);return e.dispatchEvent(o),o})(pe,"appload",{detail:{namespace:"web-component"}})))},U=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){de(e)}},W=e=>e.classList.add("hydrated"),X=(e,t,n,o)=>{const i=re(e),r=i.$hostElement$,a=i.$instanceValues$.get(t),s=i.$flags$,l=i.$lazyInstance$;var d,c;d=n,c=o.$members$[t][0],n=null==d||u(d)?d:4&c?"false"!==d&&(""===d||!!d):2&c?parseFloat(d):1&c?String(d):d;const h=Number.isNaN(a)&&Number.isNaN(n);if((!(8&s)||void 0===a)&&(n!==a&&!h)&&(i.$instanceValues$.set(t,n),l)){if(o.$watchers$&&128&s){const e=o.$watchers$[t];e&&e.map((e=>{try{l[e](n,a,t)}catch(e){de(e,r)}}))}2==(18&s)&&B(i,!1)}},Y=(e,t,n)=>{var o;const i=e.prototype;if(t.$members$){e.watchers&&(t.$watchers$=e.watchers);const r=Object.entries(t.$members$);if(r.map((([e,[o]])=>{31&o||2&n&&32&o?Object.defineProperty(i,e,{get(){return t=e,re(this).$instanceValues$.get(t);var t},set(n){X(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&o&&Object.defineProperty(i,e,{value(...t){var n;const o=re(this);return null===(n=null==o?void 0:o.$onInstancePromise$)||void 0===n?void 0:n.then((()=>{var n;return null===(n=o.$lazyInstance$)||void 0===n?void 0:n[e](...t)}))}})})),1&n){const n=new Map;i.attributeChangedCallback=function(e,o,r){_e.jmp((()=>{var a;const s=n.get(e);if(this.hasOwnProperty(s))r=this[s],delete this[s];else{if(i.hasOwnProperty(s)&&"number"==typeof this[s]&&this[s]==r)return;if(null==s){const n=re(this),i=null==n?void 0:n.$flags$;if(i&&!(8&i)&&128&i&&r!==o){const i=n.$lazyInstance$,s=null===(a=t.$watchers$)||void 0===a?void 0:a[e];null==s||s.forEach((t=>{null!=i[t]&&i[t].call(i,r,o,e)}))}return}}this[s]=(null!==r||"boolean"!=typeof this[s])&&r}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!==(o=t.$watchers$)&&void 0!==o?o:{}),...r.filter((([e,t])=>15&t[0])).map((([e,o])=>{var i;const r=o[1]||e;return n.set(r,e),512&o[0]&&(null===(i=t.$attrsToReflect$)||void 0===i||i.push([e,r])),r}))]))}}return e},Q=async(e,t,n,o)=>{let i;if(!(32&t.$flags$)){t.$flags$|=32;if(n.$lazyBundleId$){if(i=ue(n),i.then){const e=()=>{};i=await i,e()}i.isProxied||(n.$watchers$=i.watchers,Y(i,n,2),i.isProxied=!0);const e=(n.$tagName$,()=>{});t.$flags$|=8;try{new i(t)}catch(e){de(e)}t.$flags$&=-9,t.$flags$|=128,e()}else i=e.constructor,customElements.whenDefined(n.$tagName$).then((()=>t.$flags$|=128));if(i.style){let e=i.style;const t=x(n);if(!he.has(t)){const o=(n.$tagName$,()=>{});((e,t,n)=>{let o=he.get(e);be&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=t:o.replaceSync(t)):o=t,he.set(e,o)})(t,e,!!(1&n.$flags$)),o()}}}const r=t.$ancestorComponent$,a=()=>B(t,!0);r&&r["s-rc"]?r["s-rc"].push(a):a()},Z=e=>{U(e,"disconnectedCallback")},K=(e,t={})=>{var n;const o=()=>{},i=[],r=t.exclude||[],a=pe.customElements,s=ge.head,d=s.querySelector("meta[charset]"),c=ge.createElement("style"),u=[];let p,g=!0;Object.assign(_e,t),_e.$resourcesUrl$=new URL(t.resourcesUrl||"./",ge.baseURI).href;let _=!1;if(e.map((e=>{e[1].map((t=>{var n;const o={$flags$:t[0],$tagName$:t[1],$members$:t[2],$listeners$:t[3]};4&o.$flags$&&(_=!0),o.$members$=t[2],o.$listeners$=t[3],o.$attrsToReflect$=[],o.$watchers$=null!==(n=t[4])&&void 0!==n?n:{};const s=o.$tagName$,l=class extends HTMLElement{constructor(e){super(e),se(e=this,o),1&o.$flags$&&e.attachShadow({mode:"open"})}connectedCallback(){p&&(clearTimeout(p),p=null),g?u.push(this):_e.jmp((()=>(e=>{if(!(1&_e.$flags$)){const t=re(e),n=t.$cmpMeta$,o=(n.$tagName$,()=>{});if(1&t.$flags$)ee(e,t,n.$listeners$),(null==t?void 0:t.$lazyInstance$)||(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then((()=>{}));else{t.$flags$|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){D(t,t.$ancestorComponent$=n);break}}n.$members$&&Object.entries(n.$members$).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),Q(e,t,n)}o()}})(this)))}disconnectedCallback(){_e.jmp((()=>(async e=>{if(!(1&_e.$flags$)){const t=re(e);t.$rmListeners$&&(t.$rmListeners$.map((e=>e())),t.$rmListeners$=void 0),(null==t?void 0:t.$lazyInstance$)?Z(t.$lazyInstance$):(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then((()=>Z(t.$lazyInstance$)))}})(this)))}componentOnReady(){return re(this).$onReadyPromise$}};o.$lazyBundleId$=e[0],r.includes(s)||a.get(s)||(i.push(s),a.define(s,Y(l,o,1)))}))})),i.length>0&&(_&&(c.textContent+=l),c.textContent+=i+"{visibility:hidden}.hydrated{visibility:inherit}",c.innerHTML.length)){c.setAttribute("data-styles","");const e=null!==(n=_e.$nonce$)&&void 0!==n?n:h(ge);null!=e&&c.setAttribute("nonce",e),s.insertBefore(c,d?d.nextSibling:s.firstChild)}g=!1,u.length?u.map((e=>e.connectedCallback())):_e.jmp((()=>p=setTimeout(G,30))),o()},J=(e,t)=>t,ee=(e,t,n,o)=>{n&&n.map((([n,o,i])=>{const r=ne(e,n),a=te(t,i),s=oe(n);_e.ael(r,o,a,s),(t.$rmListeners$=t.$rmListeners$||[]).push((()=>_e.rel(r,o,a,s)))}))},te=(e,t)=>n=>{try{256&e.$flags$?e.$lazyInstance$[t](n):(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,n])}catch(e){de(e)}},ne=(e,t)=>8&t?pe:e,oe=e=>me?{passive:!!(1&e),capture:!!(2&e)}:!!(2&e),ie=new WeakMap,re=e=>ie.get(e),ae=(e,t)=>ie.set(t.$lazyInstance$=e,t),se=(e,t)=>{const n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return n.$onInstancePromise$=new Promise((e=>n.$onInstanceResolve$=e)),n.$onReadyPromise$=new Promise((e=>n.$onReadyResolve$=e)),e["s-p"]=[],e["s-rc"]=[],ee(e,n,t.$listeners$),ie.set(e,n)},le=(e,t)=>t in e,de=(e,t)=>(0,console.error)(e,t),ce=new Map,ue=(e,t,o)=>{const i=e.$tagName$.replace(/-/g,"_"),r=e.$lazyBundleId$,a=ce.get(r);if(a)return a[i];if(!o||!BUILD.hotModuleReplacement){const e=e=>(ce.set(r,e),e[i]);if("read-along"===r)return Promise.resolve().then(n.bind(n,704)).then(e,de)}return n(131)(`./${r}.entry.js`).then((e=>(ce.set(r,e),e[i])),de)},he=new Map,pe="undefined"!=typeof window?window:{},ge=pe.document||{head:{}},_e={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o),ce:(e,t)=>new CustomEvent(e,t)},me=(()=>{let e=!1;try{ge.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch(e){}return e})(),fe=e=>Promise.resolve(e),be=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),ve=[],ye=[],we=(e,t)=>n=>{e.push(n),s||(s=!0,t&&4&_e.$flags$?Ae($e):_e.raf($e))},xe=e=>{for(let t=0;t{xe(ve),xe(ye),(s=ve.length>0)&&_e.raf($e)},Ae=e=>fe().then(e),ke=we(ye,!0)},704:(e,t,n)=>{"use strict";n.r(t),n.d(t,{read_along:()=>K});var o,i=n(50),r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},a={};function s(e){return"function"==typeof e}function l(e){const t=e((e=>{Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t} /*! * howler.js v2.2.4 * howlerjs.com @@ -8,7 +8,7 @@ * * MIT License */ -o=a,function(){var e=function(){this.init()};e.prototype={init:function(){var e=this||t;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var n=this||t;if(e=parseFloat(e),n.ctx||u(),void 0!==e&&e>=0&&e<=1){if(n._volume=e,n._muted)return n;n.usingWebAudio&&n.masterGain.gain.setValueAtTime(e,t.ctx.currentTime);for(var o=0;o=0;n--)e._howls[n].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,u()),e},codecs:function(e){return(this||t)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||t;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||t,n=null;try{n="undefined"!=typeof Audio?new Audio:null}catch(t){return e}if(!n||"function"!=typeof n.canPlayType)return e;var o=n.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",i=r.match(/OPR\/(\d+)/g),a=i&&parseInt(i[0].split("/")[1],10)<33,s=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),l=r.match(/Version\/(.*?) /),d=s&&l&&parseInt(l[1],10)<15;return e._codecs={mp3:!(a||!o&&!n.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!o,opus:!!n.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(n.canPlayType('audio/wav; codecs="1"')||n.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!n.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!n.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(n.canPlayType("audio/x-m4a;")||n.canPlayType("audio/m4a;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(n.canPlayType("audio/x-m4b;")||n.canPlayType("audio/m4b;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(n.canPlayType("audio/x-mp4;")||n.canPlayType("audio/mp4;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(d||!n.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(d||!n.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!n.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(n.canPlayType("audio/x-flac;")||n.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||t;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var n=function(t){for(;e._html5AudioPool.length0?s._seek:o._sprite[e][0]/1e3),c=Math.max(0,(o._sprite[e][0]+o._sprite[e][1])/1e3-d),u=1e3*c/Math.abs(s._rate),h=o._sprite[e][0]/1e3,p=(o._sprite[e][0]+o._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var g=function(){s._paused=!1,s._seek=d,s._start=h,s._stop=p,s._loop=!(!s._loop&&!o._sprite[e][2])};if(!(d>=p)){var _=s._node;if(o._webAudio){var m=function(){o._playLock=!1,g(),o._refreshBuffer(s);var e=s._muted||o._muted?0:s._volume;_.gain.setValueAtTime(e,t.ctx.currentTime),s._playStart=t.ctx.currentTime,void 0===_.bufferSource.start?s._loop?_.bufferSource.noteGrainOn(0,d,86400):_.bufferSource.noteGrainOn(0,d,c):s._loop?_.bufferSource.start(0,d,86400):_.bufferSource.start(0,d,c),u!==1/0&&(o._endTimers[s._id]=setTimeout(o._ended.bind(o,s),u)),n||setTimeout((function(){o._emit("play",s._id),o._loadQueue()}),0)};"running"===t.state&&"interrupted"!==t.ctx.state?m():(o._playLock=!0,o.once("resume",m),o._clearTimer(s._id))}else{var f=function(){_.currentTime=d,_.muted=s._muted||o._muted||t._muted||_.muted,_.volume=s._volume*t.volume(),_.playbackRate=s._rate;try{var r=_.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(o._playLock=!0,g(),r.then((function(){o._playLock=!1,_._unlocked=!0,n?o._loadQueue():o._emit("play",s._id)})).catch((function(){o._playLock=!1,o._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0}))):n||(o._playLock=!1,g(),o._emit("play",s._id)),_.playbackRate=s._rate,_.paused)return void o._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||s._loop?o._endTimers[s._id]=setTimeout(o._ended.bind(o,s),u):(o._endTimers[s._id]=function(){o._ended(s),_.removeEventListener("ended",o._endTimers[s._id],!1)},_.addEventListener("ended",o._endTimers[s._id],!1))}catch(e){o._emit("playerror",s._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===_.src&&(_.src=o._src,_.load());var b=window&&window.ejecta||!_.readyState&&t._navigator.isCocoonJS;if(_.readyState>=3||b)f();else{o._playLock=!0,o._state="loading";var v=function(){o._state="loaded",f(),_.removeEventListener(t._canPlayEvent,v,!1)};_.addEventListener(t._canPlayEvent,v,!1),o._clearTimer(s._id)}}return s._id}o._ended(s)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),o=0;o=0?n=parseInt(i[0],10):e=parseFloat(i[0]):i.length>=2&&(e=parseFloat(i[0]),n=parseInt(i[1],10)),!(void 0!==e&&e>=0&&e<=1))return(o=n?r._soundById(n):r._sounds[0])?o._volume:0;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"volume",action:function(){r.volume.apply(r,i)}}),r;void 0===n&&(r._volume=e),n=r._getSoundIds(n);for(var a=0;a0?o/d:o),u=Date.now();e._fadeTo=n,e._interval=setInterval((function(){var r=(Date.now()-u)/o;u=Date.now(),s+=l*r,s=Math.round(100*s)/100,s=l<0?Math.max(n,s):Math.min(n,s),a._webAudio?e._volume=s:a.volume(s,e._id,!0),i&&(a._volume=s),(nt&&s>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,a.volume(n,e._id),a._emit("fade",e._id))}),c)},_stopFade:function(e){var n=this,o=n._soundById(e);return o&&o._interval&&(n._webAudio&&o._node.gain.cancelScheduledValues(t.ctx.currentTime),clearInterval(o._interval),o._interval=null,n.volume(o._fadeTo,e),o._fadeTo=null,n._emit("fade",e)),n},loop:function(){var e,t,n,o=this,r=arguments;if(0===r.length)return o._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(n=o._soundById(parseInt(r[0],10)))&&n._loop;e=r[0],o._loop=e}else 2===r.length&&(e=r[0],t=parseInt(r[1],10));for(var i=o._getSoundIds(t),a=0;a=0?n=parseInt(i[0],10):e=parseFloat(i[0]):2===i.length&&(e=parseFloat(i[0]),n=parseInt(i[1],10)),"number"!=typeof e)return(o=r._soundById(n))?o._rate:r._rate;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"rate",action:function(){r.rate.apply(r,i)}}),r;void 0===n&&(r._rate=e),n=r._getSoundIds(n);for(var a=0;a=0?n=parseInt(r[0],10):o._sounds.length&&(n=o._sounds[0]._id,e=parseFloat(r[0])):2===r.length&&(e=parseFloat(r[0]),n=parseInt(r[1],10)),void 0===n)return 0;if("number"==typeof e&&("loaded"!==o._state||o._playLock))return o._queue.push({event:"seek",action:function(){o.seek.apply(o,r)}}),o;var i=o._soundById(n);if(i){if(!("number"==typeof e&&e>=0)){if(o._webAudio){var a=o.playing(n)?t.ctx.currentTime-i._playStart:0,s=i._rateSeek?i._rateSeek-i._seek:0;return i._seek+(s+a*Math.abs(i._rate))}return i._node.currentTime}var l=o.playing(n);l&&o.pause(n,!0),i._seek=e,i._ended=!1,o._clearTimer(n),o._webAudio||!i._node||isNaN(i._node.duration)||(i._node.currentTime=e);var d=function(){l&&o.play(n,!0),o._emit("seek",n)};if(l&&!o._webAudio){var c=function(){o._playLock?setTimeout(c,0):d()};setTimeout(c,0)}else d()}return o},playing:function(e){var t=this;if("number"==typeof e){var n=t._soundById(e);return!!n&&!n._paused}for(var o=0;o=0&&t._howls.splice(r,1);var i=!0;for(o=0;o=0){i=!1;break}return a&&i&&delete a[e._src],t.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,o){var r=this["_on"+e];return"function"==typeof t&&r.push(o?{id:n,fn:t,once:o}:{id:n,fn:t}),this},off:function(e,t,n){var o=this,r=o["_on"+e],i=0;if("number"==typeof t&&(n=t,t=null),t||n)for(i=0;i=0;i--)r[i].id&&r[i].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(o,r[i].fn),0),r[i].once&&o.off(e,r[i].fn,r[i].id));return o._loadQueue(e),o},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action()}return t},_ended:function(e){var n=this,o=e._sprite;if(!n._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;o--){if(n<=t)return;e._sounds[o]._ended&&(e._webAudio&&e._sounds[o]._node&&e._sounds[o]._node.disconnect(0),e._sounds.splice(o,1),n--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],n=0;n=0;if(!e.bufferSource)return this;if(t._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),n))try{e.bufferSource.buffer=t._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(t._navigator&&t._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var r=function(e){this._parent=e,this.init()};r.prototype={init:function(){var e=this,n=e._parent;return e._muted=n._muted,e._loop=n._loop,e._volume=n._volume,e._rate=n._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++t._counter,n._sounds.push(e),e.create(),e},create:function(){var e=this,n=e._parent,o=t._muted||e._muted||e._parent._muted?0:e._volume;return n._webAudio?(e._node=void 0===t.ctx.createGain?t.ctx.createGainNode():t.ctx.createGain(),e._node.gain.setValueAtTime(o,t.ctx.currentTime),e._node.paused=!0,e._node.connect(t.masterGain)):t.noAudio||(e._node=t._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(t._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=n._src,e._node.preload=!0===n._preload?"auto":n._preload,e._node.volume=o*t.volume(),e._node.load()),e},reset:function(){var e=this,n=e._parent;return e._muted=n._muted,e._loop=n._loop,e._volume=n._volume,e._rate=n._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++t._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,n=e._parent;n._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(n._sprite).length&&(n._sprite={__default:[0,1e3*n._duration]}),"loaded"!==n._state&&(n._state="loaded",n._emit("load"),n._loadQueue()),e._node.removeEventListener(t._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var a={},s=function(e){var t=e._src;if(a[t])return e._duration=a[t].duration,void c(e);if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),o=new Uint8Array(n.length),r=0;r0?(a[n._src]=e,c(n,e)):o()};"undefined"!=typeof Promise&&1===t.ctx.decodeAudioData.length?t.ctx.decodeAudioData(e).then(r).catch(o):t.ctx.decodeAudioData(e,r,o)},c=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},u=function(){if(t.usingWebAudio){try{"undefined"!=typeof AudioContext?t.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?t.ctx=new webkitAudioContext:t.usingWebAudio=!1}catch(e){t.usingWebAudio=!1}t.ctx||(t.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(t._navigator&&t._navigator.platform),n=t._navigator&&t._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),o=n?parseInt(n[1],10):null;if(e&&o&&o<9){var r=/safari/.test(t._navigator&&t._navigator.userAgent.toLowerCase());t._navigator&&!r&&(t.usingWebAudio=!1)}t.usingWebAudio&&(t.masterGain=void 0===t.ctx.createGain?t.ctx.createGainNode():t.ctx.createGain(),t.masterGain.gain.setValueAtTime(t._muted?0:t._volume,t.ctx.currentTime),t.masterGain.connect(t.ctx.destination)),t._setup()}};o.Howler=t,o.Howl=n,void 0!==i?(i.HowlerGlobal=e,i.Howler=t,i.Howl=n,i.Sound=r):"undefined"!=typeof window&&(window.HowlerGlobal=e,window.Howler=t,window.Howl=n,window.Sound=r)}(), +o=a,function(){var e=function(){this.init()};e.prototype={init:function(){var e=this||t;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var n=this||t;if(e=parseFloat(e),n.ctx||u(),void 0!==e&&e>=0&&e<=1){if(n._volume=e,n._muted)return n;n.usingWebAudio&&n.masterGain.gain.setValueAtTime(e,t.ctx.currentTime);for(var o=0;o=0;n--)e._howls[n].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,u()),e},codecs:function(e){return(this||t)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||t;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||t,n=null;try{n="undefined"!=typeof Audio?new Audio:null}catch(t){return e}if(!n||"function"!=typeof n.canPlayType)return e;var o=n.canPlayType("audio/mpeg;").replace(/^no$/,""),i=e._navigator?e._navigator.userAgent:"",r=i.match(/OPR\/(\d+)/g),a=r&&parseInt(r[0].split("/")[1],10)<33,s=-1!==i.indexOf("Safari")&&-1===i.indexOf("Chrome"),l=i.match(/Version\/(.*?) /),d=s&&l&&parseInt(l[1],10)<15;return e._codecs={mp3:!(a||!o&&!n.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!o,opus:!!n.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(n.canPlayType('audio/wav; codecs="1"')||n.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!n.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!n.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(n.canPlayType("audio/x-m4a;")||n.canPlayType("audio/m4a;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(n.canPlayType("audio/x-m4b;")||n.canPlayType("audio/m4b;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(n.canPlayType("audio/x-mp4;")||n.canPlayType("audio/mp4;")||n.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(d||!n.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(d||!n.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!n.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(n.canPlayType("audio/x-flac;")||n.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||t;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var n=function(t){for(;e._html5AudioPool.length0?s._seek:o._sprite[e][0]/1e3),c=Math.max(0,(o._sprite[e][0]+o._sprite[e][1])/1e3-d),u=1e3*c/Math.abs(s._rate),h=o._sprite[e][0]/1e3,p=(o._sprite[e][0]+o._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var g=function(){s._paused=!1,s._seek=d,s._start=h,s._stop=p,s._loop=!(!s._loop&&!o._sprite[e][2])};if(!(d>=p)){var _=s._node;if(o._webAudio){var m=function(){o._playLock=!1,g(),o._refreshBuffer(s);var e=s._muted||o._muted?0:s._volume;_.gain.setValueAtTime(e,t.ctx.currentTime),s._playStart=t.ctx.currentTime,void 0===_.bufferSource.start?s._loop?_.bufferSource.noteGrainOn(0,d,86400):_.bufferSource.noteGrainOn(0,d,c):s._loop?_.bufferSource.start(0,d,86400):_.bufferSource.start(0,d,c),u!==1/0&&(o._endTimers[s._id]=setTimeout(o._ended.bind(o,s),u)),n||setTimeout((function(){o._emit("play",s._id),o._loadQueue()}),0)};"running"===t.state&&"interrupted"!==t.ctx.state?m():(o._playLock=!0,o.once("resume",m),o._clearTimer(s._id))}else{var f=function(){_.currentTime=d,_.muted=s._muted||o._muted||t._muted||_.muted,_.volume=s._volume*t.volume(),_.playbackRate=s._rate;try{var i=_.play();if(i&&"undefined"!=typeof Promise&&(i instanceof Promise||"function"==typeof i.then)?(o._playLock=!0,g(),i.then((function(){o._playLock=!1,_._unlocked=!0,n?o._loadQueue():o._emit("play",s._id)})).catch((function(){o._playLock=!1,o._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0}))):n||(o._playLock=!1,g(),o._emit("play",s._id)),_.playbackRate=s._rate,_.paused)return void o._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||s._loop?o._endTimers[s._id]=setTimeout(o._ended.bind(o,s),u):(o._endTimers[s._id]=function(){o._ended(s),_.removeEventListener("ended",o._endTimers[s._id],!1)},_.addEventListener("ended",o._endTimers[s._id],!1))}catch(e){o._emit("playerror",s._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===_.src&&(_.src=o._src,_.load());var b=window&&window.ejecta||!_.readyState&&t._navigator.isCocoonJS;if(_.readyState>=3||b)f();else{o._playLock=!0,o._state="loading";var v=function(){o._state="loaded",f(),_.removeEventListener(t._canPlayEvent,v,!1)};_.addEventListener(t._canPlayEvent,v,!1),o._clearTimer(s._id)}}return s._id}o._ended(s)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),o=0;o=0?n=parseInt(r[0],10):e=parseFloat(r[0]):r.length>=2&&(e=parseFloat(r[0]),n=parseInt(r[1],10)),!(void 0!==e&&e>=0&&e<=1))return(o=n?i._soundById(n):i._sounds[0])?o._volume:0;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"volume",action:function(){i.volume.apply(i,r)}}),i;void 0===n&&(i._volume=e),n=i._getSoundIds(n);for(var a=0;a0?o/d:o),u=Date.now();e._fadeTo=n,e._interval=setInterval((function(){var i=(Date.now()-u)/o;u=Date.now(),s+=l*i,s=Math.round(100*s)/100,s=l<0?Math.max(n,s):Math.min(n,s),a._webAudio?e._volume=s:a.volume(s,e._id,!0),r&&(a._volume=s),(nt&&s>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,a.volume(n,e._id),a._emit("fade",e._id))}),c)},_stopFade:function(e){var n=this,o=n._soundById(e);return o&&o._interval&&(n._webAudio&&o._node.gain.cancelScheduledValues(t.ctx.currentTime),clearInterval(o._interval),o._interval=null,n.volume(o._fadeTo,e),o._fadeTo=null,n._emit("fade",e)),n},loop:function(){var e,t,n,o=this,i=arguments;if(0===i.length)return o._loop;if(1===i.length){if("boolean"!=typeof i[0])return!!(n=o._soundById(parseInt(i[0],10)))&&n._loop;e=i[0],o._loop=e}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var r=o._getSoundIds(t),a=0;a=0?n=parseInt(r[0],10):e=parseFloat(r[0]):2===r.length&&(e=parseFloat(r[0]),n=parseInt(r[1],10)),"number"!=typeof e)return(o=i._soundById(n))?o._rate:i._rate;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"rate",action:function(){i.rate.apply(i,r)}}),i;void 0===n&&(i._rate=e),n=i._getSoundIds(n);for(var a=0;a=0?n=parseInt(i[0],10):o._sounds.length&&(n=o._sounds[0]._id,e=parseFloat(i[0])):2===i.length&&(e=parseFloat(i[0]),n=parseInt(i[1],10)),void 0===n)return 0;if("number"==typeof e&&("loaded"!==o._state||o._playLock))return o._queue.push({event:"seek",action:function(){o.seek.apply(o,i)}}),o;var r=o._soundById(n);if(r){if(!("number"==typeof e&&e>=0)){if(o._webAudio){var a=o.playing(n)?t.ctx.currentTime-r._playStart:0,s=r._rateSeek?r._rateSeek-r._seek:0;return r._seek+(s+a*Math.abs(r._rate))}return r._node.currentTime}var l=o.playing(n);l&&o.pause(n,!0),r._seek=e,r._ended=!1,o._clearTimer(n),o._webAudio||!r._node||isNaN(r._node.duration)||(r._node.currentTime=e);var d=function(){l&&o.play(n,!0),o._emit("seek",n)};if(l&&!o._webAudio){var c=function(){o._playLock?setTimeout(c,0):d()};setTimeout(c,0)}else d()}return o},playing:function(e){var t=this;if("number"==typeof e){var n=t._soundById(e);return!!n&&!n._paused}for(var o=0;o=0&&t._howls.splice(i,1);var r=!0;for(o=0;o=0){r=!1;break}return a&&r&&delete a[e._src],t.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,o){var i=this["_on"+e];return"function"==typeof t&&i.push(o?{id:n,fn:t,once:o}:{id:n,fn:t}),this},off:function(e,t,n){var o=this,i=o["_on"+e],r=0;if("number"==typeof t&&(n=t,t=null),t||n)for(r=0;r=0;r--)i[r].id&&i[r].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(o,i[r].fn),0),i[r].once&&o.off(e,i[r].fn,i[r].id));return o._loadQueue(e),o},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action()}return t},_ended:function(e){var n=this,o=e._sprite;if(!n._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;o--){if(n<=t)return;e._sounds[o]._ended&&(e._webAudio&&e._sounds[o]._node&&e._sounds[o]._node.disconnect(0),e._sounds.splice(o,1),n--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],n=0;n=0;if(!e.bufferSource)return this;if(t._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),n))try{e.bufferSource.buffer=t._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(t._navigator&&t._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var i=function(e){this._parent=e,this.init()};i.prototype={init:function(){var e=this,n=e._parent;return e._muted=n._muted,e._loop=n._loop,e._volume=n._volume,e._rate=n._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++t._counter,n._sounds.push(e),e.create(),e},create:function(){var e=this,n=e._parent,o=t._muted||e._muted||e._parent._muted?0:e._volume;return n._webAudio?(e._node=void 0===t.ctx.createGain?t.ctx.createGainNode():t.ctx.createGain(),e._node.gain.setValueAtTime(o,t.ctx.currentTime),e._node.paused=!0,e._node.connect(t.masterGain)):t.noAudio||(e._node=t._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(t._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=n._src,e._node.preload=!0===n._preload?"auto":n._preload,e._node.volume=o*t.volume(),e._node.load()),e},reset:function(){var e=this,n=e._parent;return e._muted=n._muted,e._loop=n._loop,e._volume=n._volume,e._rate=n._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++t._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,n=e._parent;n._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(n._sprite).length&&(n._sprite={__default:[0,1e3*n._duration]}),"loaded"!==n._state&&(n._state="loaded",n._emit("load"),n._loadQueue()),e._node.removeEventListener(t._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var a={},s=function(e){var t=e._src;if(a[t])return e._duration=a[t].duration,void c(e);if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),o=new Uint8Array(n.length),i=0;i0?(a[n._src]=e,c(n,e)):o()};"undefined"!=typeof Promise&&1===t.ctx.decodeAudioData.length?t.ctx.decodeAudioData(e).then(i).catch(o):t.ctx.decodeAudioData(e,i,o)},c=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},u=function(){if(t.usingWebAudio){try{"undefined"!=typeof AudioContext?t.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?t.ctx=new webkitAudioContext:t.usingWebAudio=!1}catch(e){t.usingWebAudio=!1}t.ctx||(t.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(t._navigator&&t._navigator.platform),n=t._navigator&&t._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),o=n?parseInt(n[1],10):null;if(e&&o&&o<9){var i=/safari/.test(t._navigator&&t._navigator.userAgent.toLowerCase());t._navigator&&!i&&(t.usingWebAudio=!1)}t.usingWebAudio&&(t.masterGain=void 0===t.ctx.createGain?t.ctx.createGainNode():t.ctx.createGain(),t.masterGain.gain.setValueAtTime(t._muted?0:t._volume,t.ctx.currentTime),t.masterGain.connect(t.ctx.destination)),t._setup()}};o.Howler=t,o.Howl=n,void 0!==r?(r.HowlerGlobal=e,r.Howler=t,r.Howl=n,r.Sound=i):"undefined"!=typeof window&&(window.HowlerGlobal=e,window.Howler=t,window.Howl=n,window.Sound=i)}(), /*! * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported. * @@ -20,4 +20,4 @@ o=a,function(){var e=function(){this.init()};e.prototype={init:function(){var e= * * MIT License */ -function(){var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;n>=0;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var o=this;return o.ctx&&o.ctx.listener?(t="number"!=typeof t?o._pos[1]:t,n="number"!=typeof n?o._pos[2]:n,"number"!=typeof e?o._pos:(o._pos=[e,t,n],void 0!==o.ctx.listener.positionX?(o.ctx.listener.positionX.setTargetAtTime(o._pos[0],Howler.ctx.currentTime,.1),o.ctx.listener.positionY.setTargetAtTime(o._pos[1],Howler.ctx.currentTime,.1),o.ctx.listener.positionZ.setTargetAtTime(o._pos[2],Howler.ctx.currentTime,.1)):o.ctx.listener.setPosition(o._pos[0],o._pos[1],o._pos[2]),o)):o},HowlerGlobal.prototype.orientation=function(e,t,n,o,r,i){var a=this;if(!a.ctx||!a.ctx.listener)return a;var s=a._orientation;return t="number"!=typeof t?s[1]:t,n="number"!=typeof n?s[2]:n,o="number"!=typeof o?s[3]:o,r="number"!=typeof r?s[4]:r,i="number"!=typeof i?s[5]:i,"number"!=typeof e?s:(a._orientation=[e,t,n,o,r,i],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(o,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(r,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(i,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(e,t,n,o,r,i),a)},Howl.prototype.init=(e=Howl.prototype.init,function(t){var n=this;return n._orientation=t.orientation||[1,0,0],n._stereo=t.stereo||null,n._pos=t.pos||null,n._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},n._onstereo=t.onstereo?[{fn:t.onstereo}]:[],n._onpos=t.onpos?[{fn:t.onpos}]:[],n._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,n){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"stereo",action:function(){o.stereo(e,n)}}),o;var r=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof e)return o._stereo;o._stereo=e,o._pos=[e,0,0]}for(var i=o._getSoundIds(n),a=0;afunction(t){e(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map(((e,t)=>`${t+1}) ${e.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t}));function c(e,t){if(e){const n=e.indexOf(t);0<=n&&e.splice(n,1)}}class u{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;const{_parentage:t}=this;if(t)if(this._parentage=null,Array.isArray(t))for(const e of t)e.remove(this);else t.remove(this);const{initialTeardown:n}=this;if(s(n))try{n()}catch(t){e=t instanceof d?t.errors:[t]}const{_finalizers:o}=this;if(o){this._finalizers=null;for(const t of o)try{g(t)}catch(t){e=null!=e?e:[],t instanceof d?e=[...e,...t.errors]:e.push(t)}}if(e)throw new d(e)}}add(e){var t;if(e&&e!==this)if(this.closed)g(e);else{if(e instanceof u){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(t=this._finalizers)&&void 0!==t?t:[]).push(e)}}_hasParent(e){const{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){const{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e}_removeParent(e){const{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&c(t,e)}remove(e){const{_finalizers:t}=this;t&&c(t,e),e instanceof u&&e._removeParent(this)}}u.EMPTY=(()=>{const e=new u;return e.closed=!0,e})();const h=u.EMPTY;function p(e){return e instanceof u||e&&"closed"in e&&s(e.remove)&&s(e.add)&&s(e.unsubscribe)}function g(e){s(e)?e():e.unsubscribe()}const _={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},m={setTimeout(e,t,...n){const{delegate:o}=m;return(null==o?void 0:o.setTimeout)?o.setTimeout(e,t,...n):setTimeout(e,t,...n)},clearTimeout(e){const{delegate:t}=m;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function f(){}const b=v("C",void 0,void 0);function v(e,t,n){return{kind:e,value:t,error:n}}let y=null;function w(e){if(_.useDeprecatedSynchronousErrorHandling){const t=!y;if(t&&(y={errorThrown:!1,error:null}),e(),t){const{errorThrown:e,error:t}=y;if(y=null,e)throw t}}else e()}class x extends u{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,p(e)&&e.add(this)):this.destination=P}static create(e,t,n){return new S(e,t,n)}next(e){this.isStopped?I(function(e){return v("N",e,void 0)}(e),this):this._next(e)}error(e){this.isStopped?I(v("E",void 0,e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?I(b,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const $=Function.prototype.bind;function A(e,t){return $.call(e,t)}class k{constructor(e){this.partialObserver=e}next(e){const{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(e){T(e)}}error(e){const{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(e){T(e)}else T(e)}complete(){const{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(e){T(e)}}}class S extends x{constructor(e,t,n){let o;if(super(),s(e)||!e)o={next:null!=e?e:void 0,error:null!=t?t:void 0,complete:null!=n?n:void 0};else{let t;this&&_.useDeprecatedNextContext?(t=Object.create(e),t.unsubscribe=()=>this.unsubscribe(),o={next:e.next&&A(e.next,t),error:e.error&&A(e.error,t),complete:e.complete&&A(e.complete,t)}):o=e}this.destination=new k(o)}}function T(e){var t;t=e,m.setTimeout((()=>{const{onUnhandledError:e}=_;if(!e)throw t;e(t)}))}function I(e,t){const{onStoppedNotification:n}=_;n&&m.setTimeout((()=>n(e,t)))}const P={closed:!0,next:f,error:function(e){throw e},complete:f},E="function"==typeof Symbol&&Symbol.observable||"@@observable";function O(e){return e}class L{constructor(e){e&&(this._subscribe=e)}lift(e){const t=new L;return t.source=this,t.operator=e,t}subscribe(e,t,n){const o=(r=e)&&r instanceof x||function(e){return e&&s(e.next)&&s(e.error)&&s(e.complete)}(r)&&p(r)?e:new S(e,t,n);var r;return w((()=>{const{operator:e,source:t}=this;o.add(e?e.call(o,t):t?this._subscribe(o):this._trySubscribe(o))})),o}_trySubscribe(e){try{return this._subscribe(e)}catch(t){e.error(t)}}forEach(e,t){return new(t=R(t))(((t,n)=>{const o=new S({next:t=>{try{e(t)}catch(e){n(e),o.unsubscribe()}},error:n,complete:t});this.subscribe(o)}))}_subscribe(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)}[E](){return this}pipe(...e){return(0===(t=e).length?O:1===t.length?t[0]:function(e){return t.reduce(((e,t)=>t(e)),e)})(this);var t}toPromise(e){return new(e=R(e))(((e,t)=>{let n;this.subscribe((e=>n=e),(e=>t(e)),(()=>e(n)))}))}}function R(e){var t;return null!==(t=null!=e?e:_.Promise)&&void 0!==t?t:Promise}function C(e){return t=>{if(function(e){return s(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}L.create=e=>new L(e);class M extends x{constructor(e,t,n,o,r,i){super(e),this.onFinalize=r,this.shouldUnsubscribe=i,this._next=t?function(n){try{t(n)}catch(t){e.error(t)}}:super._next,this._error=o?function(t){try{o(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(t){e.error(t)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:t}=this;super.unsubscribe(),!t&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}}}const F=l((e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class D extends L{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(e){const t=new B(this,this);return t.operator=e,t}_throwIfClosed(){if(this.closed)throw new F}next(e){w((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const t of this.currentObservers)t.next(e)}}))}error(e){w((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=e;const{observers:t}=this;for(;t.length;)t.shift().error(e)}}))}complete(){w((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:e}=this;for(;e.length;)e.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0}_trySubscribe(e){return this._throwIfClosed(),super._trySubscribe(e)}_subscribe(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)}_innerSubscribe(e){const{hasError:t,isStopped:n,observers:o}=this;return t||n?h:(this.currentObservers=null,o.push(e),new u((()=>{this.currentObservers=null,c(o,e)})))}_checkFinalizedStatuses(e){const{hasError:t,thrownError:n,isStopped:o}=this;t?e.error(n):o&&e.complete()}asObservable(){const e=new L;return e.source=this,e}}D.create=(e,t)=>new B(e,t);class B extends D{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)}error(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)}complete(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)}_subscribe(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:h}}class j extends D{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return!t.closed&&e.next(this._value),t}getValue(){const{hasError:e,thrownError:t,_value:n}=this;if(e)throw t;return this._throwIfClosed(),n}next(e){super.next(this._value=e)}}function q(e,t=O){return e=null!=e?e:H,C(((n,o)=>{let r,i=!0;var a,s,l;n.subscribe(new M(o,(n=>{const a=t(n);!i&&e(r,a)||(i=!1,r=a,o.next(n))}),a,s,l))}))}function H(e,t){return e===t}const N="RAUserPreferences",z="0.1";function V(e){return Array.from(e.querySelectorAll("div[type=page]")).map((e=>{let t=e.querySelector("graphic[url]"),n=e.querySelectorAll("p"),o={id:e.getAttribute("id"),paragraphs:Array.from(n)};return null!==t&&(o.img=t.getAttribute("url")),e.attributes&&(o.attributes=e.attributes),o}))}function G(e){let t={};return Array.from(e.querySelectorAll("meta")).forEach((e=>{const n=e.getAttribute("name");let o=e.getAttribute("content");t[n]=o.trim()})),t}var U=function(e){var t=this;t.sounds=[],t._sprite=e.sprite,t._reading$=new D,t._tinySprite=Object.keys(e.sprite).map((e=>[t._sprite[e][0],e,t._sprite[e][0]+t._sprite[e][1]])),t._tinySprite.pop(),t._percentPlayed=new j("0%"),t.sound=new a.Howl({src:e.src,sprite:e.sprite,rate:e.rate,onend:function(){t._reading$.next("")}}),requestAnimationFrame(t.step.bind(t))};async function W(e){return new Promise((function(t,n){let o=new XMLHttpRequest;o.open("HEAD",e),o.onload=function(){this.status>=200&&this.status<300?t(!0):t(!1)},o.onerror=function(){t(!1)},o.send()}))}U.prototype={play:function(e){var t=this;t._spriteLeft=t._tinySprite;var n=e;return t.sound.play(n)},pause:function(){return this.sound.pause(),this.sound.id},goBack:function(e,t){var n=this;if(n._spriteLeft=n._tinySprite,n.sound.seek(e)-t>0){e=n.sound.seek(n.sound.seek(e)-t,e);for(var o=n.sound.seek(e),r=0;r=n._spriteLeft[r][0]&&(1e3*o<=n._spriteLeft[r][2]&&n._reading$.next(n._spriteLeft[r][1]),n._spriteLeft=n._spriteLeft.slice(r,n._spriteLeft.length));n._reading$.next(n._spriteLeft[0][1])}else{e=n.sound.seek(0,e);n._reading$.next(n._spriteLeft[0][1])}return e},goTo:function(e,t){var n=this;n._spriteLeft=n._tinySprite;e=n.sound.seek(t,e);for(var o=1e3*n.sound.seek(e),r=0;r=n._spriteLeft[r][0]&&o<=n._spriteLeft[r][2]){n._reading$.next(n._spriteLeft[r][1]),e=n.sound.seek(n._spriteLeft[r][0],e),n.sound.seek(e),n._spriteLeft=n._spriteLeft.slice(r,n._spriteLeft.length);break}if(n.sounds.length){const o=(Math.round(t/n.sound.duration(e)*100)||0)+"%";n.sounds[0].style.width=o,n.sounds[0].setAttribute("offset",o)}return e},stop:function(){return this._reading$.next(""),this.sound.stop()},step:function(){for(var e=this,t=0;t0&&1e3*n>=e._spriteLeft[o][0]&&(1e3*n<=e._spriteLeft[o][2]&&e._reading$.next(e._spriteLeft[o][1]),e._spriteLeft=e._spriteLeft.slice(o,e._spriteLeft.length));let r=(n/e.sound.duration()*100||0)+"%";e.sounds[t].style.width=r,e.sounds[t].setAttribute("offset",r)}requestAnimationFrame(e.step.bind(e))}};const X={page:"Page",speed:"Playback Speed","re-align":"Re-align with audio","loading-error":'Error: the file "" could not be loaded.',"parse-error":'Error: the file "" could not be parsed.',"alignment-error":"Error: No alignments were found.",loading:"Loading...","line-placeholder":"Type your text here","upload-image":"Upload an image for this page","choose-file":"Choose a file","play-tooltip":"Play/pause audio recording","rewind-tooltip":"Rewind 5 seconds","stop-tooltip":"Stop audio playback","theme-tooltip":"Toggle dark/light mode","full-screen-tooltip":"Full screen mode","translation-tooltip":"Toggle translations","add-translation":"Add a translation, transliteration or gloss","configuration-tooltip":"Preferences",settings:"My preferences","page-animation":"Animated page transitions","auto-pause":"Pause at the end of each page",language:"Interface language","save-settings":"Remember my preferences for this site",eng:"English",fra:"French",spa:"Spanish",close:"Close","annotations-tooltip":"Annotations"},Y={page:"Page",speed:"Vitesse de Lecture","re-align":"Réaligner avec l'audio","loading-error":'Erreur: le fichier "" n\'a pas pu être chargé.',"parse-error":'Erreur: le fichier "" n\'a pas pu être analysé.',"alignment-error":"Erreur: aucun alignement n'a été trouvé.",loading:"Chargement en cours","line-placeholder":"Écrivez votre texte ici","upload-image":"Ajouter une image à cette page","choose-file":"Choisir un fichier","play-tooltip":"Écouter/mettre en pause l'enregistrement","rewind-tooltip":"Reculer de 5 secondes","stop-tooltip":"Arrêter la lecture","theme-tooltip":"Basculer en mode sombre/clair","full-screen-tooltip":"Mode plein écran","translation-tooltip":"Afficher ou cacher les traductions","add-translation":"Ajouter une traduction, une translitération ou une glose","configuration-tooltip":"Préférences",settings:"Mes préférences","page-animation":"Transitions de page animées","auto-pause":"Pause à la fin de chaque page",language:"Langue de l'interface","save-settings":"Sauvegarder mes préférences pour ce site",eng:"Anglais",fra:"Français",spa:"Espagnol",close:"Fermer","annotations-tooltip":"Annotations"},Q={page:"Página",speed:"Velocidad de reproducción","re-align":"Re-alinear con el audio","loading-error":'Error: el fichero "" no se pudo cargar.',"parse-error":'Error: el fichero "" no se pudo analizar.',"alignment-error":"Error: No se encontró ningún alineamiento.",loading:"Cargando...","line-placeholder":"Escriba su texto aquí","upload-image":"Cargue una imagen para esta página","choose-file":"Seleccione un fichero","play-tooltip":"Reproducir/pausar grabación de audio","rewind-tooltip":"Rebobine (rewind) 5 segundos","stop-tooltip":"Pare la reproducción de audio","theme-tooltip":"Cambie la paleta de colores","full-screen-tooltip":"Modo pantalla completa","translation-tooltip":"Active o desactive las traducciones","add-translation":"Añada una traducción, transliteración o glosa","configuration-tooltip":"Preferencias",settings:"Mis preferencias","page-animation":"Transiciónes de página animadas","auto-pause":"Pausa al final de cada página",language:"Idioma de la interfaz","save-settings":"Recordar mis preferencias para este sitio",eng:"Inglés",fra:"Francés",spa:"Español",close:"Cerrar","annotations-tooltip":"Anotaciones"},Z=class{constructor(e){(0,r.r)(this,e),this.reading$=new D,this.i18nStrings={eng:X,fra:Y,spa:Q},this.playback_rate=1,this.showGuide=!1,this.hasTextTranslations=!1,this.assetsStatus={AUDIO:0,RAS:0},this.alignment_failed=!1,this.isScrolling=!1,this.scrollTimer=null,this.endOfPageTags={},this.meta={},this.Guide=()=>(0,r.h)("button",{class:"scroll-guide__container ripple ui-button theme--"+this.theme,onClick:()=>this.hideGuideAndScroll()},(0,r.h)("span",{class:"scroll-guide__text theme--"+this.theme},this.getI18nString("re-align"))),this.Overlay=()=>(0,r.h)("object",{onClick:e=>this.goToSeekFromProgress(e),id:"overlay__object",type:"image/svg+xml",data:this.svgOverlay}),this.RemoveImg=e=>(0,r.h)("button",{"data-cy":"delete-button","aria-label":"Delete",title:"Delete image",onClick:()=>this.deleteImage(e.pageIndex),id:"img-remover",class:"ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons"},"delete")),this.Img=e=>(0,r.h)("div",{class:"image__container page__col__image theme--"+this.theme},(0,r.h)("img",{alt:"image",class:"image",src:e.imgURL})),this.ImgPlaceHolder=e=>(0,r.h)("div",{class:"image__container page__col__image theme--"+this.theme},(0,r.h)("div",{class:"drop-area"},(0,r.h)("form",{class:"my-form"},(0,r.h)("p",{class:"theme--"+this.theme},this.getI18nString("upload-image")),(0,r.h)("input",{type:"file",class:"fileElem",id:"fileElem--"+e.pageID,accept:"image/*",onChange:t=>this.handleFiles(t.target.files[0],e.pageIndex)}),(0,r.h)("label",{class:"button",htmlFor:"fileElem--"+e.pageID},this.getI18nString("choose-file"))))),this.PageCount=e=>(0,r.h)("div",{class:"page__counter color--"+this.theme},this.getI18nString("page")," ",(0,r.h)("span",{"data-cy":"page-count__current"},e.currentPage)," / ",(0,r.h)("span",{"data-cy":"page-count__total"},e.pgCount)),this.ImgContainer=e=>(0,r.h)("div",{class:"image__container"},(0,r.h)("span",{id:"image-container"},"EDIT"===this.mode&&e.pageIndex in this.images&&null!==this.images[e.pageIndex]?(0,r.h)(this.RemoveImg,{pageIndex:e.pageIndex}):null,e.pageIndex in this.images&&null!==this.images[e.pageIndex]?(0,r.h)(this.Img,{imgURL:this.images[e.pageIndex]}):null),"EDIT"!==this.mode||e.pageIndex in this.images&&null!==this.images[e.pageIndex]?null:(0,r.h)(this.ImgPlaceHolder,{pageID:e.pageID,pageIndex:e.pageIndex})),this.Page=e=>(0,r.h)("div",{class:"page page__container page--multi animate-transition theme--"+this.theme+" "+(e.pageData.attributes.class?e.pageData.attributes.class.value:""),id:e.pageData.id},this.parsed_text.length>1?(0,r.h)(this.PageCount,{pgCount:this.parsed_text.length,currentPage:this.parsed_text.indexOf(e.pageData)+1}):null,(0,r.h)(this.ImgContainer,{pageID:e.pageData.id,pageIndex:this.parsed_text.indexOf(e.pageData)}),(0,r.h)("div",{class:"page__col__text paragraph__container theme--"+this.theme},e.pageData.paragraphs.map((e=>(0,r.h)(this.Paragraph,{sentences:Array.from(e.childNodes),attributes:e.attributes}))))),this.Paragraph=e=>(0,r.h)("div",{class:"paragraph sentence__container theme--"+this.theme+" "+(e.attributes.class?e.attributes.class.value:"")},e.sentences.map((e=>e.childNodes.length>0&&(0,r.h)(this.Sentence,{sentenceData:e})))),this.Sentence=e=>{let t=Array.from(e.sentenceData.childNodes),n=e.sentenceData.id;!this.hasTextTranslations&&e.sentenceData.hasAttribute("class")&&(this.hasTextTranslations=/translation/.test(e.sentenceData.getAttribute("class")));let o={};for(const t of["annotation-id","do-not-align","lang"])e.sentenceData.hasAttribute(t)&&(o[t]=e.sentenceData.getAttribute(t));return e.sentenceData.hasAttribute("xml:lang")&&(o.lang=e.sentenceData.getAttribute("xml:lang")),(0,r.h)("div",Object.assign({},o,{class:"sentence "+(e.sentenceData.hasAttribute("class")?e.sentenceData.getAttribute("class"):"")+(o["annotation-id"]?" invisible":"")}),t.map(((t,n)=>{if("#text"===t.nodeName)return(0,r.h)(this.NonWordText,{text:t.textContent,attributes:t.attributes,id:(e.sentenceData.hasAttribute("id")?e.sentenceData.getAttribute("id"):"P")+"text"+n});if("w"===t.nodeName||"W"===t.nodeName)return(0,r.h)(this.Word,{text:t.textContent,id:t.id,attributes:t.attributes});if(t){let o={};return t.hasAttribute("xml:lang")&&(o.lang=e.sentenceData.getAttribute("xml:lang")),t.hasAttribute("lang")&&(o.lang=e.sentenceData.getAttribute("lang")),(0,r.h)("span",Object.assign({},o,{class:"sentence__text theme--"+this.theme+" "+t.className,id:t.id?t.id:"text_"+n}),t.textContent)}})),(()=>"EDIT"!==this.mode||/translation/.test(e.sentenceData.getAttribute("class"))?null:n in this.translations&&n in this.translations&&null!==this.translations[n]?(0,r.h)("span",{class:"sentence__translation"},(0,r.h)("button",{title:"Remove translation","aria-label":"Remove translation","data-cy":"remove-translation-button",onClick:()=>this.removeLine(e.sentenceData),class:"sentence__translation__button remove"},(0,r.h)("i",{class:"material-icons"},"remove")),(0,r.h)("p",{id:n+"translation","data-cy":"translation-line",class:"sentence__text editable__translation",onInput:e=>{this.updateTranslation(n,e.currentTarget.innerText)},contentEditable:!0,onKeyDown:e=>{"Enter"==e.key&&e.preventDefault()},"data-placeholder":this.getI18nString("line-placeholder")})):(0,r.h)("button",{title:this.getI18nString("add-translation"),"aria-label":"Add translation","data-cy":"add-translation-button",class:"sentence__translation sentence__translation__button",onClick:()=>this.addLine(e.sentenceData)},(0,r.h)("i",{class:"material-icons"},"add")))())},this.NonWordText=e=>{let t={};return e.attributes&&e.attributes["xml:lang"]&&(t.lang=e.attributes["xml:lang"].value),e.attributes&&e.attributes.lang&&(t.lang=e.attributes.lang.value),(0,r.h)("span",Object.assign({},t,{class:"sentence__text theme--"+this.theme,id:e.id}),e.text)},this.Word=e=>{let t={};return e.attributes&&e.attributes["xml:lang"]&&(t.lang=e.attributes["xml:lang"].value),e.attributes&&e.attributes.lang&&(t.lang=e.attributes.lang.value),(0,r.h)("span",Object.assign({},t,{class:"sentence__word theme--"+this.theme+" "+(e&&e.attributes.class?e.attributes.class.value:""),id:e.id,onClick:e=>this.playSprite(e)}),e.text)},this.PlayControl=()=>(0,r.h)("button",{"data-cy":"play-button",disabled:!this.isReadyToPlay(),"aria-label":"Play",title:this.getI18nString("play-tooltip"),onClick:()=>{this.playing?this.pause():this.play()},class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme,tabindex:1},(0,r.h)("i",{class:"material-icons"},this.playing?"pause":"play_arrow")),this.ReplayControl=()=>(0,r.h)("button",{"data-cy":"replay-button",disabled:this.hasLoaded<2,"aria-label":"Rewind",title:this.getI18nString("rewind-tooltip"),onClick:()=>this.goBack(5),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons"},"replay_5")),this.StopControl=()=>(0,r.h)("button",{"data-cy":"stop-button",disabled:this.hasLoaded<2,"aria-label":"Stop",title:this.getI18nString("stop-tooltip"),onClick:()=>this.stop(),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons"},"stop")),this.PlaybackSpeedControl=()=>(0,r.h)("div",null,(0,r.h)("h5",{class:"control-panel__buttons__header color--"+this.theme,id:"speed-slider-label"},this.getI18nString("speed")),(0,r.h)("input",{type:"range",min:100-this.playbackRateRange,max:100+this.playbackRateRange,value:100*this.playback_rate,class:"slider control-panel__control",id:"myRange","aria-labelledby":"speed-slider-label",onInput:e=>{console.log("v",e),this.changePlayback(e)}})),this.StyleControl=()=>(0,r.h)("button",{"aria-label":"Change theme",title:this.getI18nString("theme-tooltip"),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons-outlined"},"style")),this.FullScreenControl=()=>(0,r.h)("button",{"aria-label":"Full screen mode",onClick:()=>this.toggleFullscreen(),title:this.getI18nString("full-screen-tooltip"),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons","aria-label":"Full screen mode"},this.fullscreen?"fullscreen_exit":"fullscreen")),this.TextAnnotationsControl=()=>(0,r.h)("button",{"data-test-id":"annotations-toggle","aria-label":"Toggle Annotations",title:this.getI18nString("annotations-tooltip"),onClick:()=>this.annotationsMenuVisible=!this.annotationsMenuVisible,class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons-outlined"},"layers")),this.TextTranslationDisplayControl=()=>(0,r.h)("button",{"data-cy":"translation-toggle","aria-label":"Toggle Translation",title:this.getI18nString("translation-tooltip"),onClick:()=>this.toggleTextTranslation(),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons-outlined"},"subtitles")),this.ToggleSettingsControl=()=>(0,r.h)("button",{"data-test-id":"settings-button",title:this.getI18nString("configuration-tooltip"),onClick:()=>this.toggleSettings(),id:"settings-button",class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,r.h)("i",{class:"material-icons","aria-label":"Show settings"},"settings")),this.ErrorMessage=e=>(0,r.h)("p",{"data-cy":e.data_cy,class:"alert status-error"},(0,r.h)("span",{class:"material-icons"},"error_outline")," ",e.msg),this.ControlPanel=()=>(0,r.h)("div",{"data-cy":"control-panel",class:"control-panel theme--"+this.theme+" background--"+this.theme},(0,r.h)("div",{class:"control-panel__buttons--left"},(0,r.h)(this.PlayControl,null),(0,r.h)(this.ReplayControl,null),(0,r.h)(this.StopControl,null)),(0,r.h)("div",{class:"control-panel__buttons--center"},(0,r.h)(this.PlaybackSpeedControl,null)),(0,r.h)("div",{class:"control-panel__buttons--right"},this.annotations.length>0?(0,r.h)(this.TextAnnotationsControl,null):this.hasTextTranslations&&(0,r.h)(this.TextTranslationDisplayControl,null),window.document.fullscreenEnabled&&(0,r.h)(this.FullScreenControl,null),(0,r.h)(this.ToggleSettingsControl,null))),this.Settings=()=>(0,r.h)("div",{id:"settings","data-test-id":"settings",class:"settings theme--"+this.theme},(0,r.h)("button",{class:"close","data-test-id":"settings-close-button",onClick:()=>{this.toggleSettings()}},"×"," "),(0,r.h)("h3",null,this.getI18nString("settings")),(0,r.h)("p",null,(0,r.h)("label",null,(0,r.h)("select",{title:this.getI18nString("language"),onChange:e=>{this.language=e.target.value,this.userPreferencesDirty=!0},"data-test-id":"settings-language",tabindex:2},(0,r.h)("option",{selected:"eng"==this.language,value:"eng"},this.getI18nString("eng")),(0,r.h)("option",{selected:"fra"==this.language,value:"fra"},this.getI18nString("fra")),(0,r.h)("option",{selected:"spa"==this.language,value:"spa"},this.getI18nString("spa"))),this.getI18nString("language"))),(0,r.h)("p",{onClick:()=>{this.changeTheme(),this.userPreferencesDirty=!0},tabindex:3},(0,r.h)(this.StyleControl,null),this.getI18nString("theme-tooltip")),(0,r.h)("p",{onClick:()=>{this.toggleScrollBehavior(),this.userPreferencesDirty=!0},tabindex:4},(0,r.h)("button",{class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme,title:this.getI18nString("page-animation"),"data-test-id":"settings-scroll-behavior"},(0,r.h)("i",{class:"material-icons-outlined"},"smooth"===this.scrollBehaviour?"check_box":"check_box_outline_blank")),this.getI18nString("page-animation")),(0,r.h)("p",{onClick:()=>{this.autoPauseAtEndOfPage=!this.autoPauseAtEndOfPage,this.userPreferencesDirty=!0},tabindex:5},(0,r.h)("button",{class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme,title:this.getI18nString("auto-pause"),"data-test-id":"settings-auto-pause"},(0,r.h)("i",{class:"material-icons-outlined"},this.autoPauseAtEndOfPage?"check_box":"check_box_outline_blank")),this.getI18nString("auto-pause")),(0,r.h)("p",{class:"version"},"@readalongs/web-component version: ","1.5.1"),(0,r.h)("div",{class:"footer"},(0,r.h)("button",{type:"button",class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme,title:this.getI18nString("save-settings"),onClick:()=>{var e;e={version:z,autoPauseAtEndOfPage:this.autoPauseAtEndOfPage,scrollBehaviour:this.scrollBehaviour,language:this.language,theme:this.theme},window.localStorage.setItem(N,JSON.stringify(e)),this.userPreferencesDirty=!1},"data-test-id":"settings-save",disabled:!this.userPreferencesDirty,tabindex:6},this.getI18nString("save-settings")),(0,r.h)("div",null),(0,r.h)("button",{onClick:()=>this.toggleSettings(),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme,tabindex:7},this.getI18nString("close")))),this.AnnotationsMenu=()=>(0,r.h)("div",{id:"annotationsMenu",class:"annotations-menu theme--"+this.theme},this.annotations.map((e=>(0,r.h)("button",{"data-test-id":"toggle-annotation-"+e.id,class:"ripple theme--"+this.theme+" background--"+this.theme,onClick:()=>this.toggleTextAnnotation(e.id)},(0,r.h)("i",{class:"material-icons-outlined"}," ",e.isVisible?"check_box":"check_box_outline_blank")," ",e.name))),(0,r.h)("button",{"data-test-id":"toggle-all-annotations",class:"ripple theme--"+this.theme+" background--"+this.theme,onClick:()=>this.toggleTextAnnotation("*")},(0,r.h)("i",{class:"material-icons-outlined"},"layers")," All")),this.href=void 0,this.audio=void 0,this.svgOverlay=void 0,this.theme="light",this.language="eng",this.cssUrl=void 0,this.useAssetsFolder=void 0,this.imageAssetsFolder="assets/",this.pageScrolling="horizontal",this.mode="VIEW",this.scrollBehaviour="smooth",this.displayTranslation=!0,this.playbackRateRange=15,this.autoPauseAtEndOfPage=!1,this.playing=!1,this.fullscreen=!1,this.autoScroll=!0,this.hasLoaded=0,this.images=void 0,this.translations=void 0,this.settingsVisible=!1,this.userPreferencesDirty=!1,this.annotations=[],this.annotationsMenuVisible=!1}handleScrollEvent(){this.isScrolling=!0,this.scrollTimer&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout((()=>{this.isScrolling=!1}),125)}wheelHandler(e){if(this.el.shadowRoot.querySelector(".reading")&&e.path&&e.path.length>0&&(e.path[0].classList.contains("sentence__word")||e.path[0].classList.contains("sentence__container")||e.path[0].classList.contains("sentence"))&&this.autoScroll){let e=this.el.shadowRoot.querySelector(".reading");e&&(this.autoScroll=!this.inPageContentOverflow(e),this.showGuide=!this.autoScroll)}}fullScreenHandler(){this.fullscreen=null!=window.document.fullscreenElement}handleKeyDown(e){"Escape"===e.key&&this.settingsVisible&&(this.settingsVisible=!1)}urlTransform(e){return void 0!==this.useAssetsFolder?this.useAssetsFolder&&t(e)&&!e.startsWith("blob")?"assets/"+e:e:this.imageAssetsFolder&&t(e)&&!e.startsWith("blob")?(this.imageAssetsFolder&&!this.imageAssetsFolder.endsWith("/")&&(this.imageAssetsFolder+="/"),this.imageAssetsFolder+e):e;function t(e){return!/^(https?:[/][/]|assets[/]|data:)/.test(e)}}buildSprite(e,t){return new U({src:[e],sprite:t,rate:this.playback_rate})}tagToQuery(e){return"#"+(e=(e=e.replace(".","\\.")).replace("#","\\#"))}returnWordClosestTo(e){let t=Object.keys(this.processed_alignment);t.pop();for(let n=1;nthis.processed_alignment[t[n]][0]&&this.processed_alignment[t[n+1]]&&1e3*ethis.autoScroll=!0),100)}goTo(e){void 0===this.play_id&&(this.play(),this.pause()),this.autoScroll=!0,e/=1e3,this.audio_howl_sprites.goTo(this.play_id,e),setTimeout((()=>this.autoScroll=!0),100)}goToSeekAtEl(e){let t=e.currentTarget.id,n=this.processed_alignment[t][0];return this.goTo(n),t}goToSeekFromProgress(e){let t=e.currentTarget.getBoundingClientRect(),n=t.left,o=t.width,r=(e.pageX-n)/o*this.duration*1e3;this.goTo(r)}pause(){this.playing&&(this.playing=!1,this.audio_howl_sprites.pause())}play(){void 0!==this.audio_howl_sprites&&(this.playing=!0,void 0!==this.play_id?this.play_id=this.audio_howl_sprites.play(this.play_id):this.play_id=this.audio_howl_sprites.play("all"),this.animateProgress())}playSprite(e){let t=this.goToSeekAtEl(e);this.playing||this.audio_howl_sprites.play(t)}stop(){this.playing=!1,this.play_id=void 0,this.audio_howl_sprites&&this.audio_howl_sprites.stop(),this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.autoScroll||(this.autoScroll=!0,this.showGuide=!1)}toggleTextTranslation(){this.el.shadowRoot.querySelectorAll(".translation, .sentence__translation, [annotation-id]").forEach((e=>e.classList.toggle("invisible")))}toggleTextAnnotation(e){this.el.shadowRoot.querySelectorAll("[annotation-id"+("*"===e?"]":'="'+e+'"]')).forEach((e=>e.classList.toggle("invisible"))),this.annotations=this.annotations.map((t=>(t.id!=e&&"*"!==e||(t.isVisible=!t.isVisible),t)))}addHighlightingTo(e){this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),e.classList.add("reading")}animateProgressWithOverlay(){let e=this.el.shadowRoot.querySelector("#overlay__object"),t=e.contentDocument.querySelector("#progress-fill"),n=e.contentDocument.querySelector("#progress-trail"),o=e.contentDocument.querySelector("#progress-base");t.classList.add("stop-color--"+this.theme),o.classList.add("stop-color--"+this.theme),this.audio_howl_sprites.sounds.push(t),this.audio_howl_sprites.sounds.push(n),this.audio_howl_sprites.sound.once("end",(()=>{this.audio_howl_sprites.sounds.forEach((e=>{e.setAttribute("offset","0%")})),this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.playing=!1}),this.play_id)}animateProgressDefault(e,t){let n=document.createElement("div");n.className="progress theme--"+this.theme,n.id=e.toString(),n.dataset.sprite=t;let o=this.tagToQuery(t);this.el.shadowRoot.querySelector(o).appendChild(n),this.audio_howl_sprites.sounds.push(n),this.audio_howl_sprites.sound.once("end",(()=>{this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.playing=!1}),this.play_id)}animateProgress(e=this.play_id){this.svgOverlay?this.animateProgressWithOverlay():e&&this.animateProgressDefault(e,"all")}changeFill(){let e=this.el.shadowRoot.querySelector(".sentence__word"),t=window.getComputedStyle(e).color,n=this.el.shadowRoot.querySelector("#overlay__object"),o=n.contentDocument.querySelector("#progress-fill"),r=n.contentDocument.querySelector("#progress-base");n.contentDocument.querySelector("#polygon").setAttribute("stroke",t),r.setAttribute("stop-color",t),o.setAttribute("stop-color",t)}async getCurrentWord(){return this.reading$}async getImages(){return this.images}async updateSpriteAlignments(e){this.stop(),this.processed_alignment=e,this.attachScrollingLogicToAudio()}async getReadAlongElement(){return this.el}async getAlignments(){return this.processed_alignment}async getTranslations(){return this.translations}async changeTheme(){"light"===this.theme?this.theme="dark":this.theme="light"}static _getSentenceContainerOfWord(e){return e.parentElement.parentElement.parentElement}toggleFullscreen(){let e;if(this.fullscreen){let t=this.el.ownerDocument;t.exitFullscreen?e=t.exitFullscreen():t.mozCancelFullScreen?e=t.mozCancelFullScreen():t.webkitExitFullscreen?e=t.webkitExitFullscreen():t.msExitFullscreen&&(e=t.msExitFullscreen()),e.then((()=>{this.fullscreen=!1,this.el.shadowRoot.getElementById("read-along-container").classList.remove("read-along-container--fullscreen")}))}else{let t=this.el.shadowRoot.getElementById("read-along-container");t.requestFullscreen?e=t.requestFullscreen():t.mozRequestFullScreen?e=t.mozRequestFullScreen():t.webkitRequestFullscreen?e=t.webkitRequestFullscreen():t.msRequestFullscreen&&(e=t.msRequestFullscreen()),e.then((()=>{this.fullscreen=!0,this.el.shadowRoot.getElementById("read-along-container").classList.add("read-along-container--fullscreen")}))}}hideGuideAndScroll(){let e=this.el.shadowRoot.querySelector(".reading"),t=new IntersectionObserver((n=>{let[o]=n;o.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),t.unobserve(e))}));t.observe(e),this.scrollTo(e)}inParagraphContentOverflow(e){let t=Z._getSentenceContainerOfWord(e).getBoundingClientRect(),n=e.getBoundingClientRect(),o=n.rightt.right,i=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),i.unobserve(e))}));return i.observe(e),o||r}inPageContentOverflow(e){let t=this.el.shadowRoot.querySelector("#"+this.current_page).getBoundingClientRect(),n=e.getBoundingClientRect(),o=n.top+n.height>t.top+t.height,r=n.top{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),r=o=!1,i.unobserve(e))}));return i.observe(e),r||o}inPage(e){let t=Z._getSentenceContainerOfWord(e).getBoundingClientRect(),n=e.getBoundingClientRect(),o=n.top+n.height>t.top+t.height,r=n.top+n.height<0,i=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),i.unobserve(e))}));return i.observe(e),r||o}scrollToPage(e){let t=this.el.shadowRoot.querySelector(".pages__container"),n=this.el.shadowRoot.querySelector("#"+e);t.scrollBy({top:null!=this.pageScrolling.match("vertical")?n.offsetTop-t.scrollTop:0,left:null!=this.pageScrolling.match("vertical")?0:n.offsetLeft-t.scrollLeft,behavior:this.scrollBehaviour}),n.scrollTo(0,0)}scrollByHeight(e){let t=Z._getSentenceContainerOfWord(e),n=e.parentElement.getBoundingClientRect(),o=new IntersectionObserver((r=>{let[i]=r;i.isIntersecting?o.unobserve(e):t.scrollTo({top:t.getBoundingClientRect().height-n.height,left:0,behavior:this.scrollBehaviour})}),{root:t,threshold:[0,.25,.5,.75,1]});o.observe(e)}scrollByWidth(e){let t=Z._getSentenceContainerOfWord(e),n=e.getBoundingClientRect();t.scrollTo({left:n.left-10,top:0,behavior:this.scrollBehaviour})}scrollTo(e){e.scrollIntoView({behavior:this.scrollBehaviour})}disconnectedCallback(){this.stop()}componentDidUpdate(){this.svgOverlay&&this.changeFill()}async componentWillLoad(){window.matchMedia&&(window.matchMedia("prefers-color-scheme: dark").matches?this.theme="dark":this.theme="light");const e=(()=>{const e=window.localStorage.getItem(N);if(e&&e.length){const t=JSON.parse(e);if(t.version&&t.version===z)return t}return null})();null!==e&&e.version===z&&(this.language=e.language,this.scrollBehaviour=e.scrollBehaviour,this.autoPauseAtEndOfPage=e.autoPauseAtEndOfPage,this.theme=e.theme||this.theme),this.language.length<3&&(null!=this.language.match("fr")?this.language="fra":null!==this.language.match("es")?this.language="spa":this.language="eng"),"smooth"!==this.scrollBehaviour&&"auto"!==this.scrollBehaviour&&(console.error("Invalid scroll-behaviour value, using default (smooth)"),this.scrollBehaviour="smooth"),(isNaN(this.playbackRateRange)||this.playbackRateRange<0||this.playbackRateRange>99)&&(console.error("Invalid playback-rate-range value, using default (15)."),this.playbackRateRange=15);const t=this.el.querySelector("read-along > text");if(t)this.parsed_text=V(t),this.meta=G(this.el);else{const e=await async function(e){let t=await fetch(e);if(!t.ok)return console.error(`fetch(${e}) failed with status ${t.status}`),{pages:null,meta:null};let n=await t.text(),o=(new DOMParser).parseFromString(n,"text/xml");return{pages:V(o),meta:G(o)}}(this.href);this.parsed_text=e.pages,this.meta=e.meta}if(null===this.parsed_text)this.parsed_text=[],this.assetsStatus.RAS=3;else if(0===this.parsed_text.length)this.assetsStatus.RAS=2;else{this.images={},this.translations={};for(const[e,t]of this.parsed_text.entries()){if("img"in t){var n=this.urlTransform(t.img);if(this.images[e]=this.urlTransform(t.img),/^(https?:[/]|assets)[/]\b/.test(n)){await W(n)||(this.images[e]=null)}}else this.images[e]=null;if("paragraphs"in t)try{const e=t.paragraphs,n=e[e.length-1].querySelectorAll("s:not(.translation)"),o=n[n.length-1].querySelector("w:last-of-type");this.endOfPageTags[o.id]=[parseFloat(o.getAttribute("time")),1e3*parseFloat(o.getAttribute("dur"))],this.finalTaggedWord=o.id}catch(e){}}if(this.meta["annotations-ids"]){const e=",",t=this.meta["annotations-labels-"+this.language]?this.meta["annotations-labels-"+this.language]:this.meta["annotations-labels"],n=t?t.split(e):[];this.meta["annotations-ids"].split(e).forEach(((e,t)=>{var o;this.annotations.push({isVisible:!1,name:null!==(o=n[t].trim())&&void 0!==o?o:e.trim(),id:e.trim()})}))}this.assetsStatus.RAS=1}this.hasLoaded+=1}componentDidLoad(){const e="https://unpkg.com/@bcgov/bc-sans@1.0.1/css/BCSans.css",t="https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined&display=swap";let n=document.querySelector(`link[href="${t}"]`),o=document.querySelector(`link[href="${e}"]`);n||(n=document.createElement("link"),n.setAttribute("rel","stylesheet"),n.setAttribute("href",t),document.head.appendChild(n)),o||(o=document.createElement("link"),o.setAttribute("rel","stylesheet"),o.setAttribute("href",e),document.head.appendChild(o)),this.processed_alignment=function(e){let t={};for(const n of e)for(const e of n.paragraphs)for(const n of Array.from(e.querySelectorAll("w[time][dur]"))){const e=n.getAttribute("time"),o=n.getAttribute("dur");null!==e&&null!==o&&(t[n.getAttribute("id")]=[Math.round(1e3*parseFloat(e)),Math.round(1e3*parseFloat(o))])}return t}(this.parsed_text),this.alignment_failed=0==Object.keys(this.processed_alignment).length,this.audio_howl=new a.Howl({src:[this.audio],preload:!1}),this.audio_howl.once("load",(()=>{this.attachScrollingLogicToAudio()})),this.audio_howl.once("loaderror",(()=>{this.hasLoaded+=1,this.assetsStatus.AUDIO=3})),this.audio_howl.load()}attachScrollingLogicToAudio(){this.processed_alignment.all=[0,1e3*this.audio_howl.duration()],this.duration=this.audio_howl.duration(),this.audio_howl_sprites=this.buildSprite(this.audio,this.processed_alignment),this.audio_howl_sprites._reading$.pipe(q()).subscribe((e=>{if(this.reading$.next(e),""==e)return;this.playing&&this.autoPauseAtEndOfPage&&e in this.endOfPageTags&&this.finalTaggedWord!==e&&(this.autoPauseTimer&&window.clearTimeout(this.autoPauseTimer),this.autoPauseTimer=window.setTimeout((()=>{this.pause()}),this.endOfPageTags[e][1]-25));let t=this.tagToQuery(e);if(void 0===t)return;let n=this.el.shadowRoot.querySelector(t);this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),n.classList.add("reading");let o=Z._getSentenceContainerOfWord(n).parentElement.id;o!==this.current_page&&(void 0===this.current_page||this.isScrolling||this.scrollToPage(o),this.current_page=o);const r=Math.ceil(this.el.shadowRoot.querySelector(".pages__container").getBoundingClientRect().left)+1,i=Math.ceil(this.el.shadowRoot.querySelector("#"+this.current_page).getBoundingClientRect().left);(n.getBoundingClientRect().left<0||i!==r)&&(this.isScrolling||this.scrollToPage(o)),this.inPageContentOverflow(n)&&this.autoScroll&&(n.scrollIntoView({block:"start",inline:"nearest"}),this.isScrolling||this.scrollByHeight(n)),this.inParagraphContentOverflow(n)&&this.autoScroll&&(n.scrollIntoView(!1),this.isScrolling||this.scrollByWidth(n))})),this.hasLoaded+=1,this.assetsStatus.AUDIO=1}componentDidRender(){if(!this.displayTranslation&&this.parsed_text&&this.parsed_text.length>0&&(this.toggleTextTranslation(),this.displayTranslation=!0),this.latestTranslation){this.el.shadowRoot.querySelector(this.latestTranslation).focus(),this.latestTranslation=""}}isReadyToPlay(){return!(this.hasLoaded<2)&&(void 0!==this.audio_howl_sprites&&void 0!==this.audio_howl_sprites.sound)}getRawI18nString(e){return this.i18nStrings[this.language]&&this.i18nStrings[this.language][e]?this.i18nStrings[this.language][e]:this.i18nStrings.eng[e]?this.i18nStrings.eng[e]:e}getI18nString(e,t={}){let n=this.getRawI18nString(e);for(const[e,o]of Object.entries(t))n=n.replace("<"+e+">",o);return n}addLine(e){this.hasTextTranslations||(this.hasTextTranslations=!0);let t={};t[e.id]="",this.translations=Object.assign(Object.assign({},this.translations),t),this.latestTranslation="#"+e.id+"translation"}removeLine(e){let t={};t[e.id]=null,this.translations=Object.assign(Object.assign({},this.translations),t)}updateTranslation(e,t){this.translations[e]=t}async handleFiles(e,t){let n=URL.createObjectURL(e),o={};o[t]=n,this.images=Object.assign(Object.assign({},this.images),o)}deleteImage(e){let t={};t[e]=null,this.images=Object.assign(Object.assign({},this.images),t)}render(){return(0,r.h)("div",{key:"1a4bf96a76db44082666065f972deb6b6d9173de",id:"read-along-container",class:"read-along-container"},(0,r.h)("div",{key:"ec345f2a1aa0ede323537bcadfa7882e97d91e1c",id:"title__slot__container"},(0,r.h)("h1",{key:"41d333bdf97ec77601a8257cb19d4bc60a5c5ee3",class:"slot__header"},(0,r.h)("slot",{key:"250d291a0334a35fe2d9e5745226a0fd25072c08",name:"read-along-header"})),(0,r.h)("h3",{key:"519eaf5c9a83ab84050e4f67674d5bc31b350d9b",class:"slot__subheader"},(0,r.h)("slot",{key:"2e832f14876055bf4efd1d4c4f415aff36622df2",name:"read-along-subheader"}))),Object.entries(this.assetsStatus).map((e=>{let t=e[0],n=e[1];if(2===n){let e=this.getPathFromAssetType(t);return(0,r.h)(this.ErrorMessage,{msg:this.getI18nString("parse-error",{FILETYPE:t,FILENAME:e}),data_cy:t+"-error"})}if(3===n){let e=this.getPathFromAssetType(t);return(0,r.h)(this.ErrorMessage,{msg:this.getI18nString("loading-error",{FILETYPE:t,FILENAME:e}),data_cy:t+"-error"})}})),this.alignment_failed&&1===this.assetsStatus.RAS&&(0,r.h)(this.ErrorMessage,{key:"1892334bb7ce6a1f1e2201552baf0aac1857c4a7",msg:this.getI18nString("alignment-error"),data_cy:"alignment-error"}),(0,r.h)("div",{key:"9b2acc7c78305b80cc134777b3275c3f0ed66a1d",onScroll:()=>{this.handleScrollEvent()},"data-cy":"text-container",class:"pages__container theme--"+this.theme+" "+this.pageScrolling},this.showGuide?(0,r.h)(this.Guide,null):null,1==this.assetsStatus.RAS&&this.parsed_text.map((e=>(0,r.h)(this.Page,{pageData:e}))),this.hasLoaded<2&&(0,r.h)("div",{key:"60f6f0a00cbce1cb80fedc5b6a93d587eba7a02d",class:"loader"})),this.settingsVisible&&(0,r.h)("div",{key:"3f86a078f8089ecc9324170e6afce64a6f2fa1fe",class:"settings-background",onClick:()=>this.settingsVisible=!1}),this.settingsVisible&&(0,r.h)(this.Settings,{key:"6adb557b5fbf8c5e5eac547c55c6eb9471a7afea"}),this.alignment_failed||(0,r.h)("div",{key:"7470779159f2c8a4800a3c565c594e31dc3eded8",onClick:e=>this.goToSeekFromProgress(e),id:"all","data-cy":"progress-bar",class:"overlay__container theme--"+this.theme+" background--"+this.theme},this.svgOverlay?(0,r.h)(this.Overlay,null):null),this.annotationsMenuVisible&&(0,r.h)(this.AnnotationsMenu,{key:"273d6bb80949665a0a10503c5e60879361ff48da"}),1==this.assetsStatus.AUDIO&&(0,r.h)(this.ControlPanel,{key:"12991a8cf31ec6c9ad979e5d8a4863bfb2da9615"}),this.cssUrl&&null!=this.cssUrl.match(".css")&&(0,r.h)("link",{key:"bd63fbcf1d03133972c8ed4737ae60f4974d2a00",href:this.cssUrl,rel:"stylesheet"}))}static get assetsDirs(){return["assets"]}get el(){return(0,r.g)(this)}static get watchers(){return{audio_howl_sprites:["wheelHandler"]}}};Z.style='.font-weight--100{font-weight:100}.font-weight--200{font-weight:200}.font-weight--300{font-weight:300}.font-weight--400{font-weight:400}.font-weight--500{font-weight:500}.font-weight--600{font-weight:600}.font-weight--700{font-weight:700}.font-weight--800{font-weight:800}.font-weight--900{font-weight:900}.shadowed{text-shadow:0.3px 0.2px black}.theme--light.settings,.theme--light.sentence,.theme--light.page__col__image,.theme--light.page__container,.theme--light.scroll-guide__container{background-color:#fff}.theme--dark.settings,.theme--dark.sentence,.theme--dark.page__col__image,.theme--dark.page__container,.theme--dark.scroll-guide__container{background-color:#3c4369}.sentence__word,.sentence__text,.scroll-guide__text{line-height:1.5;border-radius:0.3125em;position:relative;padding:0.0625em;font-size:1em}.theme--light.ripple,.theme--light.reading,.theme--light.sentence__word,.theme--light.sentence__text,.theme--light.scroll-guide__text{color:#040508}.theme--dark.ripple,.theme--dark.reading,.theme--dark.sentence__word,.theme--dark.sentence__text,.theme--dark.scroll-guide__text{color:#fff}.theme--light.ripple:active,.theme--light.reading:active,.theme--light.sentence__word:hover{color:#fff;background:gray radial-gradient(circle, transparent 1%, gray 1%) center/15000%}.theme--dark.ripple:active,.theme--dark.reading:active,.theme--dark.sentence__word:hover{color:#fff;background:#a6a6a6 radial-gradient(circle, transparent 1%, #a6a6a6 1%) center/15000%}.theme--light.sentence__word.reading{color:#fff;background:#666666 radial-gradient(circle, transparent 1%, #666666 1%) center/15000%}.theme--dark.sentence__word.reading{color:#040508;background:#fff radial-gradient(circle, transparent 1%, #fff 1%) center/15000%}.theme--light.page__col__img-placeholder{border:0.046875em dotted gray}.theme--dark.page__col__img-placeholder{border:0.046875em dotted #a6a6a6}.theme--light.scroll-guide__container,.theme--light.overlay__container{border:0.046875em solid gray}.theme--dark.scroll-guide__container,.theme--dark.overlay__container{border:0.046875em solid #a6a6a6}.theme--light#annotationsMenu,.theme--light.settings,.theme--light.page--multi,.theme--light.pages__container,.theme--light.control-panel{border-left:0.046875em solid gray}.theme--dark#annotationsMenu,.theme--dark.settings,.theme--dark.page--multi,.theme--dark.pages__container,.theme--dark.control-panel{border-left:0.046875em solid #a6a6a6}.theme--light#annotationsMenu,.theme--light.settings,.theme--light.page--multi,.theme--light.pages__container,.theme--light.control-panel{border-right:0.046875em solid gray}.theme--dark#annotationsMenu,.theme--dark.settings,.theme--dark.page--multi,.theme--dark.pages__container,.theme--dark.control-panel{border-right:0.046875em solid #a6a6a6}#annotationsMenu button.theme--light,.theme--light#annotationsMenu,.settings>.theme--light.footer,.theme--light.settings,.theme--light.pages__container{border-top:0.046875em solid gray}#annotationsMenu button.theme--dark,.theme--dark#annotationsMenu,.settings>.theme--dark.footer,.theme--dark.settings,.theme--dark.pages__container{border-top:0.046875em solid #a6a6a6}#annotationsMenu button.theme--light,#annotationsMenu h3.theme--light,.theme--light#annotationsMenu,.theme--light.settings,.theme--light.control-panel{border-bottom:0.046875em solid gray}#annotationsMenu button.theme--dark,#annotationsMenu h3.theme--dark,.theme--dark#annotationsMenu,.theme--dark.settings,.theme--dark.control-panel{border-bottom:0.046875em solid #a6a6a6}.ripple:hover,.reading:hover,.sentence__word:hover{cursor:pointer}@viewport{width:device-width}button{border:0;cursor:pointer}html{background-color:#fff;box-sizing:border-box;height:100%}*:before,*:after{box-sizing:inherit}body{-webkit-font-smoothing:antialiased;color:#040508;font-family:"BCSans", "Noto Sans", Verdana, Arial, sans-serif;min-height:100%;overflow-x:hidden;overflow-y:hidden;text-rendering:optimizeLegibility}a{background:transparent;color:#c69;text-decoration:none;transition:color 0.2s;outline:none}a:active,a:focus{outline:none}img{height:90%;max-width:90%;object-fit:cover}h1,h2,h3,h4,h5,h6{font-family:"BCSans", "Noto Sans", Verdana, Arial, sans-serif;font-weight:normal}p,mat-chip,mat-tab-label,span,button,div,a{font-family:"BCSans", "Noto Sans", Verdana, Arial, sans-serif}.theme--light::-webkit-scrollbar{width:0.5em;height:0.5em}.theme--light::-webkit-scrollbar-track{background:#fff}.theme--light::-webkit-scrollbar-thumb{background:#040508;border-radius:0.3125em;height:0.625em;width:0.625em}.theme--dark::-webkit-scrollbar{width:0.5em;height:0.5em}.theme--dark::-webkit-scrollbar-track{background:#3c4369}.theme--dark::-webkit-scrollbar-thumb{background:#fff;border-radius:0.3125em;height:0.625em;width:0.625em}.bg-img{background-image:url("../assets/img/bg.jpg");height:100vh;overflow:overlay;overflow-x:hidden;background-position:center;background-repeat:no-repeat;background-size:cover;min-height:100%}.shadow-box{box-shadow:0 0.3125rem 1rem 0 rgba(0, 0, 0, 0.24);padding:25px;background:rgba(255, 255, 255, 0.94);border-radius:5px}.font-xs{font-size:0.5em}.font-sm{font-size:0.75em}.font-md{font-size:1em}.font-lg{font-size:1.25em}.font-xl{font-size:1.5em}.font-xxl{font-size:2em}.faded{opacity:0.2;color:black}table{table-layout:fixed}.center{margin-left:auto;margin-right:auto;text-align:center}.container{max-width:80em}.background--light{background:#fff}.stop-color--light{fill:#fff}.color--light{color:#040508}.background--dark{background:#3c4369}.stop-color--dark{fill:#3c4369}.color--dark{color:#fff}.abs{position:absolute}.top-0{top:0}.left-0{left:0}.right-0{right:0}.top-5{top:0.3125em}.left-5{left:0.3125em}.right-5{right:0.3125em}.top-10{top:0.625em}.left-10{left:0.625em}.right-10{right:0.625em}.top-15{top:0.9375em}.left-15{left:0.9375em}.right-15{right:0.9375em}.top-20{top:1.25em}.left-20{left:1.25em}.right-20{right:1.25em}.top-25{top:1.5625em}.left-25{left:1.5625em}.right-25{right:1.5625em}.top-30{top:1.875em}.left-30{left:1.875em}.right-30{right:1.875em}.top-35{top:2.1875em}.left-35{left:2.1875em}.right-35{right:2.1875em}.top-40{top:2.5em}.left-40{left:2.5em}.right-40{right:2.5em}.top-45{top:2.8125em}.left-45{left:2.8125em}.right-45{right:2.8125em}.top-50{top:3.125em}.left-50{left:3.125em}.right-50{right:3.125em}.invisible{visibility:hidden !important}.control-panel{border-radius:0 0 0.3125em 0.3125em;position:relative;min-width:100%;display:inline-flex}.control-panel__buttons--left{width:25%;float:left;margin-top:0.3125em;padding:0.3125em}.control-panel__buttons--center{width:25%;text-align:center;margin:0 auto}.control-panel__buttons--right{width:25%;text-align:right;float:right;margin-top:0.3125em;margin-right:0.3125em}.control-panel__buttons__header{margin:0.3125em}.control-panel__control{border-radius:0.3125em;margin:0.5em auto}.control-panel__control:focus{outline:none}.settings{margin-left:0;margin-right:0;text-align:center}.settings__option__header{margin-bottom:0.5em}#waveform{background-size:contain;background-repeat:no-repeat;background-position:center center;width:100%;height:100%;position:absolute;top:0;left:0}.low{z-index:700}.overlay__container{width:100%;max-width:100%;height:3.125em;position:relative;z-index:800}#overlay__object{z-index:700;max-height:100%;min-width:100%;fill:"transparent"}#overlay__object.theme--light{stroke:gray}#overlay__object.theme--dark{stroke:#a6a6a6}.scroll-guide__container{text-align:center;z-index:700;width:20%;position:fixed;left:50%;transform:translate(-50%, 0)}.scroll-guide__text{font-size:1.25em}.pages__container{overflow:auto;max-height:55vh;height:100%;max-width:100%;width:100%;position:relative;display:-webkit-inline-flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;border-radius:0.3125em 0.3125em 0 0;transition:margin-right 0.5s}.page{overflow-y:hidden;overflow-x:auto;flex-grow:1;min-width:99.6%;width:100%;max-width:55em}.page__container{display:grid;grid-template-columns:[col-start] [col-end];grid-template-rows:[row-start] 5% [row-end] 95%;grid-template-areas:"image page-no" "image text";justify-items:stretch}.page__counter{grid-area:page-no;margin:0.625em 0 0 0.9375em;text-align:right;padding-right:0.9375em;max-height:5rem}.page__col__image{grid-area:image;max-height:100%;text-align:center;margin:5%;padding:0;border-radius:0 0 0 0;position:relative}.page__col__image img{max-height:55vh;max-width:95%;object-fit:contain}.page__col__img-placeholder{cursor:pointer}.page__col__text{grid-area:text}.page.two-column-layout-page{grid-template-columns:40% auto}.page.one-column-layout-page{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;overflow-y:auto}.page.one-column-layout-page .page__col__image img{max-height:33vh !important}.page.one-column-layout-page .page__counter{width:100%;display:block;text-align:center}.hide-page-counter .page__counter{display:none}.pages__container.vertical{flex-direction:column !important}.pages__container.vertical>.page{min-height:100%}.paragraph__container{overflow-y:auto;min-width:40%;padding-bottom:0.75em}.sentence{margin:0 1.5em;text-align:left;max-width:90%}.sentence__container{margin:3.75em 0.625em 3.75em 0.625em;scroll-behavior:smooth;max-width:100%;position:relative;overflow-y:auto;overflow-x:hidden}.sentence__container__buttons{position:absolute;top:0;right:0}.sentence__text{font-size:1.5em;padding:0}.sentence__word{font-size:1.5em}.sentence__translation .sentence__text,.sentence[annotation-id] .sentence__text,.sentence__translation .sentence__word{color:#777;font-style:italic;font-size:95%}.sentence__translation__button{margin-left:10px}.sentence__translation__button i{font-size:medium}.paragraph.visually_aligned .sentence .sentence__text,.paragraph.visually_aligned .sentence .sentence__word{display:table-cell}.paragraph.visually_aligned .sentence .sentence__text:empty{display:none}.paragraph.visually_aligned{display:table}.paragraph.visually_aligned .sentence{display:table-row}.read-along-container{max-width:75em;margin:0 auto;overflow-y:hidden;overflow-x:hidden;padding:0.3125em;position:relative}.read-along-container--fullscreen{max-width:80%;min-width:80%}.slot__header{margin-bottom:0.3125em}.slot__subheader{margin-top:0;margin-left:1em}.settings-background{position:fixed;top:0;left:0;height:100vh;width:100vw;background-color:rgba(0, 0, 0, 0.075);z-index:900;-webkit-backdrop-filter:blur(5px) !important;backdrop-filter:blur(5px) !important}.settings{height:55vh;max-height:55vh;width:375px;max-width:375px;position:fixed;z-index:1000;top:15vh;left:calc((100% - 375px) / 2);overflow-x:hidden;transition:0.5s}.settings h3{border-bottom:1px solid #ccc;padding:10px;margin:0}.settings h3 button{float:inline-start;margin-top:0;margin-bottom:0}.settings>.close{position:relative;float:inline-end;background-color:inherit;color:inherit;font-size:18px;display:inline-block;padding:0.275rem 0.75rem;font-weight:400;line-height:1.5;text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;border:0;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out}.settings>.close:hover{color:#fff;background-color:#bb2d3b;border-color:#bb2d3b;box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075)}.settings p{cursor:pointer;text-align:left;color:inherit;margin:0.5em 1em}.settings p select,.settings p button{margin-right:1em;width:80px;text-align:justify}.settings p button{margin:0 1em 0 0;padding:0 0.0625em}.settings>.footer{position:absolute;bottom:0;right:0;left:0;padding:0.01em 1em;height:3em;display:flex;flex-grow:0;flex-shrink:0;flex-direction:row;align-content:space-between;justify-content:space-between}.settings>.footer>div{flex-grow:8}.settings>.footer>button{border:1px solid #ccc;padding:0.25em 0.5em !important}.settings>.footer>button:hover{background-color:rgba(0, 0, 0, 0.15);box-shadow:1px 1px 1px rgba(0, 0, 0, 0.15)}.settings button:disabled{background-color:rgba(200, 200, 200, 0.15);color:#ccc}.settings p.version{padding:1em;font-size:0.7em;font-weight:100;color:#ccc}.settings.theme--dark{color:#fff}@media screen and (max-width: 385px){.settings{width:95vw;max-width:95vw;left:2.5vw;overflow:auto}.settings p{margin-bottom:1em;border-bottom:1px solid #ccc}.settings p select,.settings p button{display:block;width:80%}}button:focus,input:focus{box-shadow:0 1px 1px rgba(0, 0, 0, 0.15)}#annotationsMenu{position:absolute;bottom:4em;right:0.3125em;z-index:1000;width:fit-content;width:-moz-fit-content;display:flex;flex-direction:column;border-radius:0.3125em}#annotationsMenu h3{margin:0.3125em 0;padding:0.3125em 0.5em}#annotationsMenu button{display:flex;justify-content:flex-start;align-content:baseline;font-size:medium;padding:0.5em}#annotationsMenu button .material-icons-outlined{font-size:inherit;border-radius:0;margin-right:0.3125em}.sentence.invisible[annotation-id]{display:none}.loader{border:16px solid #eee;border-radius:50%;border-right-color:#aa0;border-bottom-color:#a33;border-left-color:#111;width:10rem;height:10rem;-webkit-animation:spin 3s linear infinite;animation:spin 3s linear infinite;position:fixed;top:calc(50vh - 10rem);left:calc(50vw - 10rem);z-index:1000;box-shadow:0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.alert{position:relative;padding:1rem 1rem;margin-bottom:1rem;border:1px solid transparent;border-radius:0.25rem;transition-delay:2s;transition:visibility 5s height 5s}.alert.status-success{color:#0f5132;background-color:#d1e7dd;border-color:#badbcc}.alert.status-error{color:#842029;background-color:#f8d7da;border-color:#f5c2c7}.alert.fade{visibility:collapse;height:0 !important;overflow:hidden !important;line-height:0 !important;padding:0 !important;margin:0 !important;border:0 !important}.animate-transition,.ripple,.reading{transition:background 0.4s}.animate-transition:active,.ripple:active,.reading:active{transition:background 0s}.ripple,.reading{background-position:center;padding:0.0625em}.ripple:active,.reading:active{background-size:100%}.progress{position:absolute;top:0;left:0;height:100%;width:0}.progress.theme--light{background-color:rgba(128, 128, 128, 0.2)}.progress.theme--dark{background-color:rgba(166, 166, 166, 0.2)}.material-icons{font-family:"Material Icons";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}.material-icons-outlined{font-family:"Material Icons Outlined";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}[contenteditable][data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:gray;cursor:text;background-color:transparent}.drop-area{border:2px dashed #ccc;border-radius:20px;width:50%;font-family:sans-serif;margin:50px auto;padding:20px}.drop-area.highlight{border-color:purple}p{margin-top:0}.my-form{margin-bottom:10px}#gallery{margin-top:10px}#gallery img{width:150px;margin-bottom:10px;margin-right:10px;vertical-align:middle}.button{display:inline-block;padding:10px;background:#ccc;cursor:pointer;border-radius:5px;border:1px solid #ccc}.button:hover{background:#ddd}.fileElem{display:none}#img-remover{margin:60px;position:absolute;z-index:700;border-radius:50px;color:red}#image-container{display:contents}'},131:(e,t,n)=>{var o={"./read-along.entry.js":[704,179]};function r(e){if(!n.o(o,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=o[e],r=t[0];return n.e(t[1]).then((()=>n(r)))}r.keys=()=>Object.keys(o),r.id=131,e.exports=r}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=n(19);(()=>{const t="file:///gpfs/fs3c/nrc/ict/portage/u/joa125/sandboxes/Studio-Web/dist/packages/web-component/dist/esm/web-component.js",n={};return n.resourcesUrl=new URL(".",t).href,(0,e.p)(n)})().then((async t=>(await void 0,(0,e.b)([["read-along",[[1,"read-along",{href:[1],audio:[1],svgOverlay:[1,"svg-overlay"],theme:[1537],language:[1537],cssUrl:[1,"css-url"],useAssetsFolder:[4,"use-assets-folder"],imageAssetsFolder:[1,"image-assets-folder"],pageScrolling:[1,"page-scrolling"],mode:[1],scrollBehaviour:[1537,"scroll-behaviour"],displayTranslation:[4,"display-translation"],playbackRateRange:[2,"playback-rate-range"],autoPauseAtEndOfPage:[1540,"auto-pause-at-end-of-page"],playing:[32],fullscreen:[32],autoScroll:[32],hasLoaded:[32],images:[32],translations:[32],settingsVisible:[32],userPreferencesDirty:[32],annotations:[32],annotationsMenuVisible:[32],getCurrentWord:[64],getImages:[64],updateSpriteAlignments:[64],getReadAlongElement:[64],getAlignments:[64],getTranslations:[64],changeTheme:[64]},[[9,"wheel","wheelHandler"],[0,"fullscreenchange","fullScreenHandler"],[0,"keydown","handleKeyDown"]],{audio_howl_sprites:["wheelHandler"]}]]]],t))))})()})(); \ No newline at end of file +function(){var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;n>=0;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var o=this;return o.ctx&&o.ctx.listener?(t="number"!=typeof t?o._pos[1]:t,n="number"!=typeof n?o._pos[2]:n,"number"!=typeof e?o._pos:(o._pos=[e,t,n],void 0!==o.ctx.listener.positionX?(o.ctx.listener.positionX.setTargetAtTime(o._pos[0],Howler.ctx.currentTime,.1),o.ctx.listener.positionY.setTargetAtTime(o._pos[1],Howler.ctx.currentTime,.1),o.ctx.listener.positionZ.setTargetAtTime(o._pos[2],Howler.ctx.currentTime,.1)):o.ctx.listener.setPosition(o._pos[0],o._pos[1],o._pos[2]),o)):o},HowlerGlobal.prototype.orientation=function(e,t,n,o,i,r){var a=this;if(!a.ctx||!a.ctx.listener)return a;var s=a._orientation;return t="number"!=typeof t?s[1]:t,n="number"!=typeof n?s[2]:n,o="number"!=typeof o?s[3]:o,i="number"!=typeof i?s[4]:i,r="number"!=typeof r?s[5]:r,"number"!=typeof e?s:(a._orientation=[e,t,n,o,i,r],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(o,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(r,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(e,t,n,o,i,r),a)},Howl.prototype.init=(e=Howl.prototype.init,function(t){var n=this;return n._orientation=t.orientation||[1,0,0],n._stereo=t.stereo||null,n._pos=t.pos||null,n._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},n._onstereo=t.onstereo?[{fn:t.onstereo}]:[],n._onpos=t.onpos?[{fn:t.onpos}]:[],n._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,n){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"stereo",action:function(){o.stereo(e,n)}}),o;var i=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof e)return o._stereo;o._stereo=e,o._pos=[e,0,0]}for(var r=o._getSoundIds(n),a=0;afunction(t){e(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map(((e,t)=>`${t+1}) ${e.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t}));function c(e,t){if(e){const n=e.indexOf(t);0<=n&&e.splice(n,1)}}class u{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;const{_parentage:t}=this;if(t)if(this._parentage=null,Array.isArray(t))for(const e of t)e.remove(this);else t.remove(this);const{initialTeardown:n}=this;if(s(n))try{n()}catch(t){e=t instanceof d?t.errors:[t]}const{_finalizers:o}=this;if(o){this._finalizers=null;for(const t of o)try{g(t)}catch(t){e=null!=e?e:[],t instanceof d?e=[...e,...t.errors]:e.push(t)}}if(e)throw new d(e)}}add(e){var t;if(e&&e!==this)if(this.closed)g(e);else{if(e instanceof u){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(t=this._finalizers)&&void 0!==t?t:[]).push(e)}}_hasParent(e){const{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){const{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e}_removeParent(e){const{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&c(t,e)}remove(e){const{_finalizers:t}=this;t&&c(t,e),e instanceof u&&e._removeParent(this)}}u.EMPTY=(()=>{const e=new u;return e.closed=!0,e})();const h=u.EMPTY;function p(e){return e instanceof u||e&&"closed"in e&&s(e.remove)&&s(e.add)&&s(e.unsubscribe)}function g(e){s(e)?e():e.unsubscribe()}const _={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},m={setTimeout(e,t,...n){const{delegate:o}=m;return(null==o?void 0:o.setTimeout)?o.setTimeout(e,t,...n):setTimeout(e,t,...n)},clearTimeout(e){const{delegate:t}=m;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function f(){}const b=v("C",void 0,void 0);function v(e,t,n){return{kind:e,value:t,error:n}}let y=null;function w(e){if(_.useDeprecatedSynchronousErrorHandling){const t=!y;if(t&&(y={errorThrown:!1,error:null}),e(),t){const{errorThrown:e,error:t}=y;if(y=null,e)throw t}}else e()}class x extends u{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,p(e)&&e.add(this)):this.destination=P}static create(e,t,n){return new S(e,t,n)}next(e){this.isStopped?I(function(e){return v("N",e,void 0)}(e),this):this._next(e)}error(e){this.isStopped?I(v("E",void 0,e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?I(b,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const $=Function.prototype.bind;function A(e,t){return $.call(e,t)}class k{constructor(e){this.partialObserver=e}next(e){const{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(e){T(e)}}error(e){const{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(e){T(e)}else T(e)}complete(){const{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(e){T(e)}}}class S extends x{constructor(e,t,n){let o;if(super(),s(e)||!e)o={next:null!=e?e:void 0,error:null!=t?t:void 0,complete:null!=n?n:void 0};else{let t;this&&_.useDeprecatedNextContext?(t=Object.create(e),t.unsubscribe=()=>this.unsubscribe(),o={next:e.next&&A(e.next,t),error:e.error&&A(e.error,t),complete:e.complete&&A(e.complete,t)}):o=e}this.destination=new k(o)}}function T(e){var t;t=e,m.setTimeout((()=>{const{onUnhandledError:e}=_;if(!e)throw t;e(t)}))}function I(e,t){const{onStoppedNotification:n}=_;n&&m.setTimeout((()=>n(e,t)))}const P={closed:!0,next:f,error:function(e){throw e},complete:f},E="function"==typeof Symbol&&Symbol.observable||"@@observable";function O(e){return e}class L{constructor(e){e&&(this._subscribe=e)}lift(e){const t=new L;return t.source=this,t.operator=e,t}subscribe(e,t,n){const o=(i=e)&&i instanceof x||function(e){return e&&s(e.next)&&s(e.error)&&s(e.complete)}(i)&&p(i)?e:new S(e,t,n);var i;return w((()=>{const{operator:e,source:t}=this;o.add(e?e.call(o,t):t?this._subscribe(o):this._trySubscribe(o))})),o}_trySubscribe(e){try{return this._subscribe(e)}catch(t){e.error(t)}}forEach(e,t){return new(t=C(t))(((t,n)=>{const o=new S({next:t=>{try{e(t)}catch(e){n(e),o.unsubscribe()}},error:n,complete:t});this.subscribe(o)}))}_subscribe(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)}[E](){return this}pipe(...e){return(0===(t=e).length?O:1===t.length?t[0]:function(e){return t.reduce(((e,t)=>t(e)),e)})(this);var t}toPromise(e){return new(e=C(e))(((e,t)=>{let n;this.subscribe((e=>n=e),(e=>t(e)),(()=>e(n)))}))}}function C(e){var t;return null!==(t=null!=e?e:_.Promise)&&void 0!==t?t:Promise}function R(e){return t=>{if(function(e){return s(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}L.create=e=>new L(e);class M extends x{constructor(e,t,n,o,i,r){super(e),this.onFinalize=i,this.shouldUnsubscribe=r,this._next=t?function(n){try{t(n)}catch(t){e.error(t)}}:super._next,this._error=o?function(t){try{o(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(t){e.error(t)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:t}=this;super.unsubscribe(),!t&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}}}const F=l((e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class D extends L{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(e){const t=new B(this,this);return t.operator=e,t}_throwIfClosed(){if(this.closed)throw new F}next(e){w((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const t of this.currentObservers)t.next(e)}}))}error(e){w((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=e;const{observers:t}=this;for(;t.length;)t.shift().error(e)}}))}complete(){w((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:e}=this;for(;e.length;)e.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0}_trySubscribe(e){return this._throwIfClosed(),super._trySubscribe(e)}_subscribe(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)}_innerSubscribe(e){const{hasError:t,isStopped:n,observers:o}=this;return t||n?h:(this.currentObservers=null,o.push(e),new u((()=>{this.currentObservers=null,c(o,e)})))}_checkFinalizedStatuses(e){const{hasError:t,thrownError:n,isStopped:o}=this;t?e.error(n):o&&e.complete()}asObservable(){const e=new L;return e.source=this,e}}D.create=(e,t)=>new B(e,t);class B extends D{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)}error(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)}complete(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)}_subscribe(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:h}}class j extends D{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){const t=super._subscribe(e);return!t.closed&&e.next(this._value),t}getValue(){const{hasError:e,thrownError:t,_value:n}=this;if(e)throw t;return this._throwIfClosed(),n}next(e){super.next(this._value=e)}}function H(e,t=O){return e=null!=e?e:q,R(((n,o)=>{let i,r=!0;var a,s,l;n.subscribe(new M(o,(n=>{const a=t(n);!r&&e(i,a)||(r=!1,i=a,o.next(n))}),a,s,l))}))}function q(e,t){return e===t}const N="RAUserPreferences",z="0.1";function V(e){return Array.from(e.querySelectorAll("div[type=page]")).map((e=>{let t=e.querySelector("graphic[url]"),n=e.querySelectorAll("p"),o={id:e.getAttribute("id"),paragraphs:Array.from(n)};return null!==t&&(o.img=t.getAttribute("url")),e.attributes&&(o.attributes=e.attributes),o}))}function G(e){let t={};return Array.from(e.querySelectorAll("meta")).forEach((e=>{const n=e.getAttribute("name");let o=e.getAttribute("content");t[n]=o.trim()})),t}var U=function(e){var t=this;t.sounds=[],t._sprite=e.sprite,t._reading$=new D,t._tinySprite=Object.keys(e.sprite).map((e=>[t._sprite[e][0],e,t._sprite[e][0]+t._sprite[e][1]])),t._tinySprite.pop(),t._percentPlayed=new j("0%"),t.sound=new a.Howl({src:e.src,sprite:e.sprite,rate:e.rate,onend:function(){t._reading$.next("")}}),requestAnimationFrame(t.step.bind(t))};async function W(e){return new Promise((function(t,n){let o=new XMLHttpRequest;o.open("HEAD",e),o.onload=function(){this.status>=200&&this.status<300?t(!0):t(!1)},o.onerror=function(){t(!1)},o.send()}))}U.prototype={play:function(e){var t=this;t._spriteLeft=t._tinySprite;var n=e;return t.sound.play(n)},pause:function(){return this.sound.pause(),this.sound.id},goBack:function(e,t){var n=this;if(n._spriteLeft=n._tinySprite,n.sound.seek(e)-t>0){e=n.sound.seek(n.sound.seek(e)-t,e);for(var o=n.sound.seek(e),i=0;i=n._spriteLeft[i][0]&&(1e3*o<=n._spriteLeft[i][2]&&n._reading$.next(n._spriteLeft[i][1]),n._spriteLeft=n._spriteLeft.slice(i,n._spriteLeft.length));n._reading$.next(n._spriteLeft[0][1])}else{e=n.sound.seek(0,e);n._reading$.next(n._spriteLeft[0][1])}return e},goTo:function(e,t){var n=this;n._spriteLeft=n._tinySprite;e=n.sound.seek(t,e);for(var o=1e3*n.sound.seek(e),i=0;i=n._spriteLeft[i][0]&&o<=n._spriteLeft[i][2]){n._reading$.next(n._spriteLeft[i][1]),e=n.sound.seek(n._spriteLeft[i][0],e),n.sound.seek(e),n._spriteLeft=n._spriteLeft.slice(i,n._spriteLeft.length);break}if(n.sounds.length){const o=(Math.round(t/n.sound.duration(e)*100)||0)+"%";n.sounds[0].style.width=o,n.sounds[0].setAttribute("offset",o)}return e},stop:function(){return this._reading$.next(""),this.sound.stop()},step:function(){for(var e=this,t=0;t0&&1e3*n>=e._spriteLeft[o][0]&&(1e3*n<=e._spriteLeft[o][2]&&e._reading$.next(e._spriteLeft[o][1]),e._spriteLeft=e._spriteLeft.slice(o,e._spriteLeft.length));let i=(n/e.sound.duration()*100||0)+"%";e.sounds[t].style.width=i,e.sounds[t].setAttribute("offset",i)}requestAnimationFrame(e.step.bind(e))}};const X=e=>e.innerHTML.includes(""),Y={page:"Page",speed:"Playback Speed","re-align":"Re-align with audio","loading-error":'Error: the file "" could not be loaded.',"parse-error":'Error: the file "" could not be parsed.',"alignment-error":"Error: No alignments were found.",loading:"Loading...","line-placeholder":"Type your text here","upload-image":"Upload an image for this page","choose-file":"Choose a file","play-tooltip":"Play/pause audio recording","rewind-tooltip":"Rewind 5 seconds","stop-tooltip":"Stop audio playback","theme-tooltip":"Toggle dark/light mode","full-screen-tooltip":"Full screen mode","translation-tooltip":"Toggle translations","add-translation":"Add a translation, transliteration or gloss","configuration-tooltip":"Preferences",settings:"My preferences","page-animation":"Animated page transitions","auto-pause":"Pause at the end of each page",language:"Interface language","save-settings":"Remember my preferences for this site",eng:"English",fra:"French",spa:"Spanish",close:"Close","annotations-tooltip":"Annotations"},Q={page:"Page",speed:"Vitesse de Lecture","re-align":"Réaligner avec l'audio","loading-error":'Erreur: le fichier "" n\'a pas pu être chargé.',"parse-error":'Erreur: le fichier "" n\'a pas pu être analysé.',"alignment-error":"Erreur: aucun alignement n'a été trouvé.",loading:"Chargement en cours","line-placeholder":"Écrivez votre texte ici","upload-image":"Ajouter une image à cette page","choose-file":"Choisir un fichier","play-tooltip":"Écouter/mettre en pause l'enregistrement","rewind-tooltip":"Reculer de 5 secondes","stop-tooltip":"Arrêter la lecture","theme-tooltip":"Basculer en mode sombre/clair","full-screen-tooltip":"Mode plein écran","translation-tooltip":"Afficher ou cacher les traductions","add-translation":"Ajouter une traduction, une translitération ou une glose","configuration-tooltip":"Préférences",settings:"Mes préférences","page-animation":"Transitions de page animées","auto-pause":"Pause à la fin de chaque page",language:"Langue de l'interface","save-settings":"Sauvegarder mes préférences pour ce site",eng:"Anglais",fra:"Français",spa:"Espagnol",close:"Fermer","annotations-tooltip":"Annotations"},Z={page:"Página",speed:"Velocidad de reproducción","re-align":"Re-alinear con el audio","loading-error":'Error: el fichero "" no se pudo cargar.',"parse-error":'Error: el fichero "" no se pudo analizar.',"alignment-error":"Error: No se encontró ningún alineamiento.",loading:"Cargando...","line-placeholder":"Escriba su texto aquí","upload-image":"Cargue una imagen para esta página","choose-file":"Seleccione un fichero","play-tooltip":"Reproducir/pausar grabación de audio","rewind-tooltip":"Rebobine (rewind) 5 segundos","stop-tooltip":"Pare la reproducción de audio","theme-tooltip":"Cambie la paleta de colores","full-screen-tooltip":"Modo pantalla completa","translation-tooltip":"Active o desactive las traducciones","add-translation":"Añada una traducción, transliteración o glosa","configuration-tooltip":"Preferencias",settings:"Mis preferencias","page-animation":"Transiciónes de página animadas","auto-pause":"Pausa al final de cada página",language:"Idioma de la interfaz","save-settings":"Recordar mis preferencias para este sitio",eng:"Inglés",fra:"Francés",spa:"Español",close:"Cerrar","annotations-tooltip":"Anotaciones"},K=class{constructor(e){(0,i.r)(this,e),this.reading$=new D,this.i18nStrings={eng:Y,fra:Q,spa:Z},this.playback_rate=1,this.showGuide=!1,this.hasTextTranslations=!1,this.assetsStatus={AUDIO:0,RAS:0},this.alignment_failed=!1,this.isScrolling=!1,this.scrollTimer=null,this.endOfPageTags={},this.meta={},this.Guide=()=>(0,i.h)("button",{class:"scroll-guide__container ripple ui-button theme--"+this.theme,onClick:()=>this.hideGuideAndScroll()},(0,i.h)("span",{class:"scroll-guide__text theme--"+this.theme},this.getI18nString("re-align"))),this.Overlay=()=>(0,i.h)("object",{onClick:e=>this.goToSeekFromProgress(e),id:"overlay__object",type:"image/svg+xml",data:this.svgOverlay}),this.RemoveImg=e=>(0,i.h)("button",{"data-test-id":"delete-button","aria-label":"Delete",title:"Delete image",onClick:()=>this.deleteImage(e.pageIndex),id:"img-remover",class:"ripple theme--"+this.theme+" background--"+this.theme},(0,i.h)("i",{class:"material-icons"},"delete")),this.Img=e=>(0,i.h)("div",{class:"image__container page__col__image theme--"+this.theme},(0,i.h)("img",{alt:"image",class:"image",src:e.imgURL})),this.ImgPlaceHolder=e=>(0,i.h)("div",{class:"image__container page__col__image theme--"+this.theme},(0,i.h)("div",{class:"drop-area"},(0,i.h)("form",{class:"my-form"},(0,i.h)("p",{class:"theme--"+this.theme},this.getI18nString("upload-image")),(0,i.h)("input",{type:"file",class:"fileElem",id:"fileElem--"+e.pageID,accept:"image/*",onChange:t=>this.handleFiles(t.target.files[0],e.pageIndex)}),(0,i.h)("label",{class:"button",htmlFor:"fileElem--"+e.pageID},this.getI18nString("choose-file"))))),this.PageCount=e=>(0,i.h)("div",{class:"page__counter color--"+this.theme},this.getI18nString("page")," ",(0,i.h)("span",{"data-test-id":"page-count__current"},e.currentPage)," / ",(0,i.h)("span",{"data-test-id":"page-count__total"},e.pgCount)),this.ImgContainer=e=>(0,i.h)("div",{class:"image__container"},(0,i.h)("span",{id:"image-container"},"EDIT"===this.mode&&e.pageIndex in this.images&&null!==this.images[e.pageIndex]?(0,i.h)(this.RemoveImg,{pageIndex:e.pageIndex}):null,e.pageIndex in this.images&&null!==this.images[e.pageIndex]?(0,i.h)(this.Img,{imgURL:this.images[e.pageIndex]}):null),"EDIT"!==this.mode||e.pageIndex in this.images&&null!==this.images[e.pageIndex]?null:(0,i.h)(this.ImgPlaceHolder,{pageID:e.pageID,pageIndex:e.pageIndex})),this.Page=e=>(0,i.h)("div",{class:"page page__container page--multi animate-transition theme--"+this.theme+" "+(e.pageData.attributes.class?e.pageData.attributes.class.value:""),id:e.pageData.id},this.parsed_text.length>1?(0,i.h)(this.PageCount,{pgCount:this.parsed_text.length,currentPage:this.parsed_text.indexOf(e.pageData)+1}):null,(0,i.h)(this.ImgContainer,{pageID:e.pageData.id,pageIndex:this.parsed_text.indexOf(e.pageData)}),(0,i.h)("div",{class:"page__col__text paragraph__container theme--"+this.theme},e.pageData.paragraphs.map((e=>(0,i.h)(this.Paragraph,{sentences:Array.from(e.childNodes),attributes:e.attributes}))))),this.Paragraph=e=>(0,i.h)("div",{class:"paragraph sentence__container theme--"+this.theme+" "+(e.attributes.class?e.attributes.class.value:"")},e.sentences.map((e=>e.childNodes.length>0&&(0,i.h)(this.Sentence,{sentenceData:e})))),this.Sentence=e=>{let t=Array.from(e.sentenceData.childNodes),n=e.sentenceData.id;!this.hasTextTranslations&&e.sentenceData.hasAttribute("class")&&(this.hasTextTranslations=/translation/.test(e.sentenceData.getAttribute("class")));let o={};for(const t of["annotation-id","do-not-align","lang"])e.sentenceData.hasAttribute(t)&&(o[t]=e.sentenceData.getAttribute(t));return e.sentenceData.hasAttribute("xml:lang")&&(o.lang=e.sentenceData.getAttribute("xml:lang")),"EDIT"===this.mode&&/translation/.test(e.sentenceData.getAttribute("class"))?(0,i.h)(i.F,null):(0,i.h)("div",Object.assign({},o,{class:"sentence "+(e.sentenceData.hasAttribute("class")?e.sentenceData.getAttribute("class"):"")+(o["annotation-id"]?" invisible":"")}),t.map(((t,n)=>{if("#text"===t.nodeName)return(0,i.h)(this.NonWordText,{text:t.textContent,attributes:t.attributes,id:(e.sentenceData.hasAttribute("id")?e.sentenceData.getAttribute("id"):"P")+"text"+n});if("w"===t.nodeName||"W"===t.nodeName)return(0,i.h)(this.Word,{text:t.textContent,id:t.id,attributes:t.attributes});if(t){let o={};return t.hasAttribute("xml:lang")&&(o.lang=e.sentenceData.getAttribute("xml:lang")),t.hasAttribute("lang")&&(o.lang=e.sentenceData.getAttribute("lang")),(0,i.h)("span",Object.assign({},o,{class:"sentence__text theme--"+this.theme+" "+t.className,id:t.id?t.id:"text_"+n}),t.textContent)}})),(()=>"EDIT"!==this.mode||/translation/.test(e.sentenceData.getAttribute("class"))?null:n in this.translations&&n in this.translations&&null!==this.translations[n]?(0,i.h)("span",{class:"sentence__translation"},(0,i.h)("button",{title:"Remove translation","aria-label":"Remove translation","data-test-id":"remove-translation-button",onClick:()=>this.removeLine(e.sentenceData),class:"sentence__translation__button remove"},(0,i.h)("i",{class:"material-icons"},"remove")),(0,i.h)("p",{id:n+"translation","data-test-id":"translation-line",class:"sentence__text editable__translation",onInput:e=>{this.updateTranslation(n,e.currentTarget.innerText)},contentEditable:!0,onKeyDown:e=>{"Enter"==e.key&&e.preventDefault()},"data-placeholder":this.getI18nString("line-placeholder"),innerHTML:this.translations[n]})):(0,i.h)("button",{title:this.getI18nString("add-translation"),"aria-label":"Add translation","data-test-id":"add-translation-button",class:"sentence__translation sentence__translation__button",onClick:()=>this.addLine(e.sentenceData)},(0,i.h)("i",{class:"material-icons"},"add")))())},this.NonWordText=e=>{let t={};return e.attributes&&e.attributes["xml:lang"]&&(t.lang=e.attributes["xml:lang"].value),e.attributes&&e.attributes.lang&&(t.lang=e.attributes.lang.value),(0,i.h)("span",Object.assign({},t,{class:"sentence__text theme--"+this.theme,id:e.id}),e.text)},this.Word=e=>{let t={};return e.attributes&&e.attributes["xml:lang"]&&(t.lang=e.attributes["xml:lang"].value),e.attributes&&e.attributes.lang&&(t.lang=e.attributes.lang.value),(0,i.h)("span",Object.assign({},t,{class:"sentence__word theme--"+this.theme+" "+(e&&e.attributes.class?e.attributes.class.value:""),id:e.id,onClick:e=>this.playSprite(e)}),e.text)},this.PlayControl=()=>(0,i.h)("button",{"data-test-id":"play-button",disabled:!this.isReadyToPlay(),"aria-label":"Play",title:this.getI18nString("play-tooltip"),onClick:()=>{this.playing?this.pause():this.play()},class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme,tabindex:1},(0,i.h)("i",{class:"material-icons"},this.playing?"pause":"play_arrow")),this.ReplayControl=()=>(0,i.h)("button",{"data-test-id":"replay-button",disabled:this.hasLoaded<2,"aria-label":"Rewind",title:this.getI18nString("rewind-tooltip"),onClick:()=>this.goBack(5),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,i.h)("i",{class:"material-icons"},"replay_5")),this.StopControl=()=>(0,i.h)("button",{"data-test-id":"stop-button",disabled:this.hasLoaded<2,"aria-label":"Stop",title:this.getI18nString("stop-tooltip"),onClick:()=>this.stop(),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,i.h)("i",{class:"material-icons"},"stop")),this.PlaybackSpeedControl=()=>(0,i.h)("div",null,(0,i.h)("h5",{class:"control-panel__buttons__header color--"+this.theme,id:"speed-slider-label"},this.getI18nString("speed")),(0,i.h)("input",{type:"range",min:100-this.playbackRateRange,max:100+this.playbackRateRange,value:100*this.playback_rate,class:"slider control-panel__control",id:"myRange","aria-labelledby":"speed-slider-label",onInput:e=>{console.log("v",e),this.changePlayback(e)}})),this.StyleControl=()=>(0,i.h)("button",{"aria-label":"Change theme",title:this.getI18nString("theme-tooltip"),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,i.h)("i",{class:"material-icons-outlined"},"style")),this.FullScreenControl=()=>(0,i.h)("button",{"aria-label":"Full screen mode",onClick:()=>this.toggleFullscreen(),title:this.getI18nString("full-screen-tooltip"),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,i.h)("i",{class:"material-icons","aria-label":"Full screen mode"},this.fullscreen?"fullscreen_exit":"fullscreen")),this.TextAnnotationsControl=()=>(0,i.h)("button",{"data-test-id":"annotations-toggle","aria-label":"Toggle Annotations",title:this.getI18nString("annotations-tooltip"),onClick:()=>this.annotationsMenuVisible=!this.annotationsMenuVisible,class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,i.h)("i",{class:"material-icons-outlined"},"layers")),this.TextTranslationDisplayControl=()=>(0,i.h)("button",{"data-test-id":"translation-toggle","aria-label":"Toggle Translation",title:this.getI18nString("translation-tooltip"),onClick:()=>this.toggleTextTranslation(),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,i.h)("i",{class:"material-icons-outlined"},"subtitles")),this.ToggleSettingsControl=()=>(0,i.h)("button",{"data-test-id":"settings-button",title:this.getI18nString("configuration-tooltip"),onClick:()=>this.toggleSettings(),id:"settings-button",class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme},(0,i.h)("i",{class:"material-icons","aria-label":"Show settings"},"settings")),this.ErrorMessage=e=>(0,i.h)("p",{"data-test-id":e.data_cy,class:"alert status-error"},(0,i.h)("span",{class:"material-icons"},"error_outline")," ",e.msg),this.ControlPanel=()=>(0,i.h)("div",{"data-test-id":"control-panel",class:"control-panel theme--"+this.theme+" background--"+this.theme},(0,i.h)("div",{class:"control-panel__buttons--left"},(0,i.h)(this.PlayControl,null),(0,i.h)(this.ReplayControl,null),(0,i.h)(this.StopControl,null)),(0,i.h)("div",{class:"control-panel__buttons--center"},(0,i.h)(this.PlaybackSpeedControl,null)),(0,i.h)("div",{class:"control-panel__buttons--right"},this.annotations.length>0?(0,i.h)(this.TextAnnotationsControl,null):this.hasTextTranslations&&(0,i.h)(this.TextTranslationDisplayControl,null),window.document.fullscreenEnabled&&(0,i.h)(this.FullScreenControl,null),(0,i.h)(this.ToggleSettingsControl,null))),this.Settings=()=>(0,i.h)("div",{id:"settings","data-test-id":"settings",class:"settings theme--"+this.theme},(0,i.h)("button",{class:"close","data-test-id":"settings-close-button",onClick:()=>{this.toggleSettings()}},"×"," "),(0,i.h)("h3",null,this.getI18nString("settings")),(0,i.h)("p",null,(0,i.h)("label",null,(0,i.h)("select",{title:this.getI18nString("language"),onChange:e=>{this.language=e.target.value,this.userPreferencesDirty=!0},"data-test-id":"settings-language",tabindex:2},(0,i.h)("option",{selected:"eng"==this.language,value:"eng"},this.getI18nString("eng")),(0,i.h)("option",{selected:"fra"==this.language,value:"fra"},this.getI18nString("fra")),(0,i.h)("option",{selected:"spa"==this.language,value:"spa"},this.getI18nString("spa"))),this.getI18nString("language"))),(0,i.h)("p",{onClick:()=>{this.changeTheme(),this.userPreferencesDirty=!0},tabindex:3},(0,i.h)(this.StyleControl,null),this.getI18nString("theme-tooltip")),(0,i.h)("p",{onClick:()=>{this.toggleScrollBehavior(),this.userPreferencesDirty=!0},tabindex:4},(0,i.h)("button",{class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme,title:this.getI18nString("page-animation"),"data-test-id":"settings-scroll-behavior"},(0,i.h)("i",{class:"material-icons-outlined"},"smooth"===this.scrollBehaviour?"check_box":"check_box_outline_blank")),this.getI18nString("page-animation")),(0,i.h)("p",{onClick:()=>{this.autoPauseAtEndOfPage=!this.autoPauseAtEndOfPage,this.userPreferencesDirty=!0},tabindex:5},(0,i.h)("button",{class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme,title:this.getI18nString("auto-pause"),"data-test-id":"settings-auto-pause"},(0,i.h)("i",{class:"material-icons-outlined"},this.autoPauseAtEndOfPage?"check_box":"check_box_outline_blank")),this.getI18nString("auto-pause")),(0,i.h)("p",{class:"version"},"@readalongs/web-component version: ","1.5.2"),(0,i.h)("div",{class:"footer"},(0,i.h)("button",{type:"button",class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme,title:this.getI18nString("save-settings"),onClick:()=>{var e;e={version:z,autoPauseAtEndOfPage:this.autoPauseAtEndOfPage,scrollBehaviour:this.scrollBehaviour,language:this.language,theme:this.theme},window.localStorage.setItem(N,JSON.stringify(e)),this.userPreferencesDirty=!1},"data-test-id":"settings-save",disabled:!this.userPreferencesDirty,tabindex:6},this.getI18nString("save-settings")),(0,i.h)("div",null),(0,i.h)("button",{onClick:()=>this.toggleSettings(),class:"control-panel__control ripple theme--"+this.theme+" background--"+this.theme,tabindex:7},this.getI18nString("close")))),this.AnnotationsMenu=()=>(0,i.h)("div",{id:"annotationsMenu",class:"annotations-menu theme--"+this.theme},this.annotations.map((e=>(0,i.h)("button",{"data-test-id":"toggle-annotation-"+e.id,class:"ripple theme--"+this.theme+" background--"+this.theme,onClick:()=>this.toggleTextAnnotation(e.id)},(0,i.h)("i",{class:"material-icons-outlined"}," ",e.isVisible?"check_box":"check_box_outline_blank")," ",e.name))),(0,i.h)("button",{"data-test-id":"toggle-all-annotations",class:"ripple theme--"+this.theme+" background--"+this.theme,onClick:()=>this.toggleTextAnnotation("*")},(0,i.h)("i",{class:"material-icons-outlined"},"layers")," All")),this.href=void 0,this.audio=void 0,this.svgOverlay=void 0,this.theme="light",this.language="eng",this.cssUrl=void 0,this.useAssetsFolder=void 0,this.imageAssetsFolder="assets/",this.pageScrolling="horizontal",this.mode="VIEW",this.scrollBehaviour="smooth",this.displayTranslation=!0,this.playbackRateRange=15,this.autoPauseAtEndOfPage=!1,this.playing=!1,this.fullscreen=!1,this.autoScroll=!0,this.hasLoaded=0,this.images=void 0,this.translations=void 0,this.settingsVisible=!1,this.userPreferencesDirty=!1,this.annotations=[],this.annotationsMenuVisible=!1}handleScrollEvent(){this.isScrolling=!0,this.scrollTimer&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout((()=>{this.isScrolling=!1}),125)}wheelHandler(e){if(this.el.shadowRoot.querySelector(".reading")&&e.path&&e.path.length>0&&(e.path[0].classList.contains("sentence__word")||e.path[0].classList.contains("sentence__container")||e.path[0].classList.contains("sentence"))&&this.autoScroll){let e=this.el.shadowRoot.querySelector(".reading");e&&(this.autoScroll=!this.inPageContentOverflow(e),this.showGuide=!this.autoScroll)}}fullScreenHandler(){this.fullscreen=null!=window.document.fullscreenElement}handleKeyDown(e){"Escape"===e.key&&this.settingsVisible&&(this.settingsVisible=!1)}urlTransform(e){return void 0!==this.useAssetsFolder?this.useAssetsFolder&&t(e)&&!e.startsWith("blob")?"assets/"+e:e:this.imageAssetsFolder&&t(e)&&!e.startsWith("blob")?(this.imageAssetsFolder&&!this.imageAssetsFolder.endsWith("/")&&(this.imageAssetsFolder+="/"),this.imageAssetsFolder+e):e;function t(e){return!/^(https?:[/][/]|assets[/]|data:)/.test(e)}}buildSprite(e,t){return new U({src:[e],sprite:t,rate:this.playback_rate})}tagToQuery(e){return"#"+(e=(e=e.replace(".","\\.")).replace("#","\\#"))}returnWordClosestTo(e){let t=Object.keys(this.processed_alignment);t.pop();for(let n=1;nthis.processed_alignment[t[n]][0]&&this.processed_alignment[t[n+1]]&&1e3*ethis.autoScroll=!0),100)}goTo(e){void 0===this.play_id&&(this.play(),this.pause()),this.autoScroll=!0,e/=1e3,this.audio_howl_sprites.goTo(this.play_id,e),setTimeout((()=>this.autoScroll=!0),100)}goToSeekAtEl(e){let t=e.currentTarget.id,n=this.processed_alignment[t][0];return this.goTo(n),t}goToSeekFromProgress(e){let t=e.currentTarget.getBoundingClientRect(),n=t.left,o=t.width,i=(e.pageX-n)/o*this.duration*1e3;this.goTo(i)}pause(){this.playing&&(this.playing=!1,this.audio_howl_sprites.pause())}play(){void 0!==this.audio_howl_sprites&&(this.playing=!0,void 0!==this.play_id?this.play_id=this.audio_howl_sprites.play(this.play_id):this.play_id=this.audio_howl_sprites.play("all"),this.animateProgress())}playSprite(e){let t=this.goToSeekAtEl(e);this.playing||this.audio_howl_sprites.play(t)}stop(){this.playing=!1,this.play_id=void 0,this.audio_howl_sprites&&this.audio_howl_sprites.stop(),this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.autoScroll||(this.autoScroll=!0,this.showGuide=!1)}toggleTextTranslation(){this.el.shadowRoot.querySelectorAll(".translation, .sentence__translation, [annotation-id]").forEach((e=>e.classList.toggle("invisible")))}toggleTextAnnotation(e){this.el.shadowRoot.querySelectorAll("[annotation-id"+("*"===e?"]":'="'+e+'"]')).forEach((e=>e.classList.toggle("invisible"))),this.annotations=this.annotations.map((t=>(t.id!=e&&"*"!==e||(t.isVisible=!t.isVisible),t)))}addHighlightingTo(e){this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),e.classList.add("reading")}animateProgressWithOverlay(){let e=this.el.shadowRoot.querySelector("#overlay__object"),t=e.contentDocument.querySelector("#progress-fill"),n=e.contentDocument.querySelector("#progress-trail"),o=e.contentDocument.querySelector("#progress-base");t.classList.add("stop-color--"+this.theme),o.classList.add("stop-color--"+this.theme),this.audio_howl_sprites.sounds.push(t),this.audio_howl_sprites.sounds.push(n),this.audio_howl_sprites.sound.once("end",(()=>{this.audio_howl_sprites.sounds.forEach((e=>{e.setAttribute("offset","0%")})),this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.playing=!1}),this.play_id)}animateProgressDefault(e,t){let n=document.createElement("div");n.className="progress theme--"+this.theme,n.id=e.toString(),n.dataset.sprite=t;let o=this.tagToQuery(t);this.el.shadowRoot.querySelector(o).appendChild(n),this.audio_howl_sprites.sounds.push(n),this.audio_howl_sprites.sound.once("end",(()=>{this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),this.playing=!1}),this.play_id)}animateProgress(e=this.play_id){this.svgOverlay?this.animateProgressWithOverlay():e&&this.animateProgressDefault(e,"all")}changeFill(){let e=this.el.shadowRoot.querySelector(".sentence__word"),t=window.getComputedStyle(e).color,n=this.el.shadowRoot.querySelector("#overlay__object"),o=n.contentDocument.querySelector("#progress-fill"),i=n.contentDocument.querySelector("#progress-base");n.contentDocument.querySelector("#polygon").setAttribute("stroke",t),i.setAttribute("stop-color",t),o.setAttribute("stop-color",t)}async getCurrentWord(){return this.reading$}async getImages(){return this.images}async updateSpriteAlignments(e){this.stop(),this.processed_alignment=e,this.attachScrollingLogicToAudio()}async getReadAlongElement(){return this.el}async getAlignments(){return this.processed_alignment}async getTranslations(){return this.translations}async changeTheme(){"light"===this.theme?this.theme="dark":this.theme="light"}static _getSentenceContainerOfWord(e){return e.parentElement.parentElement.parentElement}toggleFullscreen(){let e;if(this.fullscreen){let t=this.el.ownerDocument;t.exitFullscreen?e=t.exitFullscreen():t.mozCancelFullScreen?e=t.mozCancelFullScreen():t.webkitExitFullscreen?e=t.webkitExitFullscreen():t.msExitFullscreen&&(e=t.msExitFullscreen()),e.then((()=>{this.fullscreen=!1,this.el.shadowRoot.getElementById("read-along-container").classList.remove("read-along-container--fullscreen")}))}else{let t=this.el.shadowRoot.getElementById("read-along-container");t.requestFullscreen?e=t.requestFullscreen():t.mozRequestFullScreen?e=t.mozRequestFullScreen():t.webkitRequestFullscreen?e=t.webkitRequestFullscreen():t.msRequestFullscreen&&(e=t.msRequestFullscreen()),e.then((()=>{this.fullscreen=!0,this.el.shadowRoot.getElementById("read-along-container").classList.add("read-along-container--fullscreen")}))}}hideGuideAndScroll(){let e=this.el.shadowRoot.querySelector(".reading"),t=new IntersectionObserver((n=>{let[o]=n;o.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),t.unobserve(e))}));t.observe(e),this.scrollTo(e)}inParagraphContentOverflow(e){let t=K._getSentenceContainerOfWord(e).getBoundingClientRect(),n=e.getBoundingClientRect(),o=n.rightt.right,r=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),r.unobserve(e))}));return r.observe(e),o||i}inPageContentOverflow(e){let t=this.el.shadowRoot.querySelector("#"+this.current_page).getBoundingClientRect(),n=e.getBoundingClientRect(),o=n.top+n.height>t.top+t.height,i=n.top{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),i=o=!1,r.unobserve(e))}));return r.observe(e),i||o}inPage(e){let t=K._getSentenceContainerOfWord(e).getBoundingClientRect(),n=e.getBoundingClientRect(),o=n.top+n.height>t.top+t.height,i=n.top+n.height<0,r=new IntersectionObserver((t=>{let[n]=t;n.isIntersecting&&(setTimeout((()=>{this.showGuide=!1,this.autoScroll=!0}),100),r.unobserve(e))}));return r.observe(e),i||o}scrollToPage(e){let t=this.el.shadowRoot.querySelector(".pages__container"),n=this.el.shadowRoot.querySelector("#"+e);t.scrollBy({top:null!=this.pageScrolling.match("vertical")?n.offsetTop-t.scrollTop:0,left:null!=this.pageScrolling.match("vertical")?0:n.offsetLeft-t.scrollLeft,behavior:this.scrollBehaviour}),n.scrollTo(0,0)}scrollByHeight(e){let t=K._getSentenceContainerOfWord(e),n=e.parentElement.getBoundingClientRect(),o=new IntersectionObserver((i=>{let[r]=i;r.isIntersecting?o.unobserve(e):t.scrollTo({top:t.getBoundingClientRect().height-n.height,left:0,behavior:this.scrollBehaviour})}),{root:t,threshold:[0,.25,.5,.75,1]});o.observe(e)}scrollByWidth(e){let t=K._getSentenceContainerOfWord(e),n=e.getBoundingClientRect();t.scrollTo({left:n.left-10,top:0,behavior:this.scrollBehaviour})}scrollTo(e){e.scrollIntoView({behavior:this.scrollBehaviour})}disconnectedCallback(){this.stop()}componentDidUpdate(){this.svgOverlay&&this.changeFill()}async componentWillLoad(){window.matchMedia&&(window.matchMedia("prefers-color-scheme: dark").matches?this.theme="dark":this.theme="light");const e=(()=>{const e=window.localStorage.getItem(N);if(e&&e.length){const t=JSON.parse(e);if(t.version&&t.version===z)return t}return null})();null!==e&&e.version===z&&(this.language=e.language,this.scrollBehaviour=e.scrollBehaviour,this.autoPauseAtEndOfPage=e.autoPauseAtEndOfPage,this.theme=e.theme||this.theme),this.language.length<3&&(null!=this.language.match("fr")?this.language="fra":null!==this.language.match("es")?this.language="spa":this.language="eng"),"smooth"!==this.scrollBehaviour&&"auto"!==this.scrollBehaviour&&(console.error("Invalid scroll-behaviour value, using default (smooth)"),this.scrollBehaviour="smooth"),(isNaN(this.playbackRateRange)||this.playbackRateRange<0||this.playbackRateRange>99)&&(console.error("Invalid playback-rate-range value, using default (15)."),this.playbackRateRange=15);const t=this.el.querySelector("read-along > text");if(t)this.parsed_text=V(t),this.meta=G(this.el);else{const e=await async function(e){let t=await fetch(e);if(!t.ok)return console.error(`fetch(${e}) failed with status ${t.status}`),{pages:null,meta:null};let n=await t.text(),o=(new DOMParser).parseFromString(n,"text/xml");return{pages:V(o),meta:G(o)}}(this.href);this.parsed_text=e.pages,this.meta=e.meta}if(null===this.parsed_text)this.parsed_text=[],this.assetsStatus.RAS=3;else if(0===this.parsed_text.length)this.assetsStatus.RAS=2;else{this.images={},this.translations={};for(const[e,t]of this.parsed_text.entries()){if("img"in t){var n=this.urlTransform(t.img);if(this.images[e]=this.urlTransform(t.img),/^(https?:[/]|assets)[/]\b/.test(n)){await W(n)||(this.images[e]=null)}}else this.images[e]=null;if("paragraphs"in t){try{const e=t.paragraphs,n=e[e.length-1].querySelectorAll("s:not(.translation), s:not(.sentence__translation)"),o=n[n.length-1].querySelector("w:last-of-type");this.endOfPageTags[o.id]=[parseFloat(o.getAttribute("time")),1e3*parseFloat(o.getAttribute("dur"))],this.finalTaggedWord=o.id}catch(e){}let e=null;t.paragraphs.map((e=>e.querySelectorAll("s"))).forEach((t=>{t.length&&t.forEach((t=>{if(t.id&&X(t))e=`${t.id}`;else if(/translation/.test(t.className)){const n={};if(t.hasAttribute("sentence-id")){n[t.getAttribute("sentence-id")]=t.textContent,this.translations=Object.assign(Object.assign({},this.translations),n)}else null!=e&&(n[e]=t.textContent,e=null,this.translations=Object.assign(Object.assign({},this.translations),n))}}))}))}}if(this.meta["annotations-ids"]){const e=",",t=this.meta["annotations-labels-"+this.language]?this.meta["annotations-labels-"+this.language]:this.meta["annotations-labels"],n=t?t.split(e):[];this.meta["annotations-ids"].split(e).forEach(((e,t)=>{var o;this.annotations.push({isVisible:!1,name:null!==(o=n[t].trim())&&void 0!==o?o:e.trim(),id:e.trim()})}))}this.assetsStatus.RAS=1}this.hasLoaded+=1}componentDidLoad(){const e="https://unpkg.com/@bcgov/bc-sans@1.0.1/css/BCSans.css",t="https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined&display=swap";let n=document.querySelector(`link[href="${t}"]`),o=document.querySelector(`link[href="${e}"]`);n||(n=document.createElement("link"),n.setAttribute("rel","stylesheet"),n.setAttribute("href",t),document.head.appendChild(n)),o||(o=document.createElement("link"),o.setAttribute("rel","stylesheet"),o.setAttribute("href",e),document.head.appendChild(o)),this.processed_alignment=function(e){let t={};for(const n of e)for(const e of n.paragraphs)for(const n of Array.from(e.querySelectorAll("w[time][dur]"))){const e=n.getAttribute("time"),o=n.getAttribute("dur");null!==e&&null!==o&&(t[n.getAttribute("id")]=[Math.round(1e3*parseFloat(e)),Math.round(1e3*parseFloat(o))])}return t}(this.parsed_text),this.alignment_failed=0==Object.keys(this.processed_alignment).length,this.audio_howl=new a.Howl({src:[this.audio],preload:!1}),this.audio_howl.once("load",(()=>{this.attachScrollingLogicToAudio()})),this.audio_howl.once("loaderror",(()=>{this.hasLoaded+=1,this.assetsStatus.AUDIO=3})),this.audio_howl.load()}attachScrollingLogicToAudio(){this.processed_alignment.all=[0,1e3*this.audio_howl.duration()],this.duration=this.audio_howl.duration(),this.audio_howl_sprites=this.buildSprite(this.audio,this.processed_alignment),this.audio_howl_sprites._reading$.pipe(H()).subscribe((e=>{if(this.reading$.next(e),""==e)return;this.playing&&this.autoPauseAtEndOfPage&&e in this.endOfPageTags&&this.finalTaggedWord!==e&&(this.autoPauseTimer&&window.clearTimeout(this.autoPauseTimer),this.autoPauseTimer=window.setTimeout((()=>{this.pause()}),this.endOfPageTags[e][1]-25));let t=this.tagToQuery(e);if(void 0===t)return;let n=this.el.shadowRoot.querySelector(t);this.el.shadowRoot.querySelectorAll(".reading").forEach((e=>e.classList.remove("reading"))),n.classList.add("reading");let o=K._getSentenceContainerOfWord(n).parentElement.id;o!==this.current_page&&(void 0===this.current_page||this.isScrolling||this.scrollToPage(o),this.current_page=o);const i=Math.ceil(this.el.shadowRoot.querySelector(".pages__container").getBoundingClientRect().left)+1,r=Math.ceil(this.el.shadowRoot.querySelector("#"+this.current_page).getBoundingClientRect().left);(n.getBoundingClientRect().left<0||r!==i)&&(this.isScrolling||this.scrollToPage(o)),this.inPageContentOverflow(n)&&this.autoScroll&&(n.scrollIntoView({block:"start",inline:"nearest"}),this.isScrolling||this.scrollByHeight(n)),this.inParagraphContentOverflow(n)&&this.autoScroll&&(n.scrollIntoView(!1),this.isScrolling||this.scrollByWidth(n))})),this.hasLoaded+=1,this.assetsStatus.AUDIO=1}componentDidRender(){if(!this.displayTranslation&&this.parsed_text&&this.parsed_text.length>0&&(this.toggleTextTranslation(),this.displayTranslation=!0),this.latestTranslation){this.el.shadowRoot.querySelector(this.latestTranslation).focus(),this.latestTranslation=""}}isReadyToPlay(){return!(this.hasLoaded<2)&&(void 0!==this.audio_howl_sprites&&void 0!==this.audio_howl_sprites.sound)}getRawI18nString(e){return this.i18nStrings[this.language]&&this.i18nStrings[this.language][e]?this.i18nStrings[this.language][e]:this.i18nStrings.eng[e]?this.i18nStrings.eng[e]:e}getI18nString(e,t={}){let n=this.getRawI18nString(e);for(const[e,o]of Object.entries(t))n=n.replace("<"+e+">",o);return n}addLine(e){this.hasTextTranslations||(this.hasTextTranslations=!0);let t={};t[e.id]="",this.translations=Object.assign(Object.assign({},this.translations),t),this.latestTranslation="#"+e.id+"translation"}removeLine(e){delete this.translations[e.id],this.translations=Object.assign({},this.translations)}updateTranslation(e,t){this.translations[e]=t}async handleFiles(e,t){let n=URL.createObjectURL(e),o={};o[t]=n,this.images=Object.assign(Object.assign({},this.images),o)}deleteImage(e){let t={};t[e]=null,this.images=Object.assign(Object.assign({},this.images),t)}render(){return(0,i.h)("div",{key:"46c6d912ec340d9b63d9a1aa2e4acf42c64e2af5",id:"read-along-container",class:"read-along-container"},(0,i.h)("div",{key:"8f20ab2cee1d0966e67016193615411f4b61a0a5",id:"title__slot__container"},(0,i.h)("h1",{key:"35d4ed846e10e3f8a83a11e9bd96cd850a4111d3",class:"slot__header"},(0,i.h)("slot",{key:"d5276cfa23397b7a99620e72f7893a64abb1aaa0",name:"read-along-header"})),(0,i.h)("h3",{key:"c083a93acdca7b32f501c555d101d24d2278cac2",class:"slot__subheader"},(0,i.h)("slot",{key:"e008cc6f55a10bc6e4de9b84181b08c0b1a725a1",name:"read-along-subheader"}))),Object.entries(this.assetsStatus).map((e=>{let t=e[0],n=e[1];if(2===n){let e=this.getPathFromAssetType(t);return(0,i.h)(this.ErrorMessage,{msg:this.getI18nString("parse-error",{FILETYPE:t,FILENAME:e}),data_cy:t+"-error"})}if(3===n){let e=this.getPathFromAssetType(t);return(0,i.h)(this.ErrorMessage,{msg:this.getI18nString("loading-error",{FILETYPE:t,FILENAME:e}),data_cy:t+"-error"})}})),this.alignment_failed&&1===this.assetsStatus.RAS&&(0,i.h)(this.ErrorMessage,{key:"998842b94677f01729f78da4d8b97659d493c2d1",msg:this.getI18nString("alignment-error"),data_cy:"alignment-error"}),(0,i.h)("div",{key:"dddb2e1efa306f5357dfd937ad115cdebff6a468",onScroll:()=>{this.handleScrollEvent()},"data-test-id":"text-container",class:"pages__container theme--"+this.theme+" "+this.pageScrolling},this.showGuide?(0,i.h)(this.Guide,null):null,1==this.assetsStatus.RAS&&this.parsed_text.map((e=>(0,i.h)(this.Page,{pageData:e}))),this.hasLoaded<2&&(0,i.h)("div",{key:"d8671a7916e73ef3195f7af42513e4c933d054f9",class:"loader"})),this.settingsVisible&&(0,i.h)("div",{key:"487fcdbb3634ee5aaff603be88685363c2e5f9a5",class:"settings-background",onClick:()=>this.settingsVisible=!1}),this.settingsVisible&&(0,i.h)(this.Settings,{key:"c56a9bf7f7975143a7e97816d79f9a8aa4dab352"}),this.alignment_failed||(0,i.h)("div",{key:"65683679711bc6e81d6e98c5560b5d5bcc087638",onClick:e=>this.goToSeekFromProgress(e),id:"all","data-test-id":"progress-bar",class:"overlay__container theme--"+this.theme+" background--"+this.theme},this.svgOverlay?(0,i.h)(this.Overlay,null):null),this.annotationsMenuVisible&&(0,i.h)(this.AnnotationsMenu,{key:"65ad13ebac082d596d28ba40fd796489660131ff"}),1==this.assetsStatus.AUDIO&&(0,i.h)(this.ControlPanel,{key:"ec312960e479c319c054c10150d2cacc48706235"}),this.cssUrl&&null!=this.cssUrl.match(".css")&&(0,i.h)("link",{key:"6237476772acd8f4874ef1a4bc0921ec0826c834",href:this.cssUrl,rel:"stylesheet"}))}static get assetsDirs(){return["assets"]}get el(){return(0,i.g)(this)}static get watchers(){return{audio_howl_sprites:["wheelHandler"]}}};K.style='.font-weight--100{font-weight:100}.font-weight--200{font-weight:200}.font-weight--300{font-weight:300}.font-weight--400{font-weight:400}.font-weight--500{font-weight:500}.font-weight--600{font-weight:600}.font-weight--700{font-weight:700}.font-weight--800{font-weight:800}.font-weight--900{font-weight:900}.shadowed{text-shadow:0.3px 0.2px black}.theme--light.settings,.theme--light.sentence,.theme--light.page__col__image,.theme--light.page__container,.theme--light.scroll-guide__container{background-color:#fff}.theme--dark.settings,.theme--dark.sentence,.theme--dark.page__col__image,.theme--dark.page__container,.theme--dark.scroll-guide__container{background-color:#3c4369}.sentence__word,.sentence__text,.scroll-guide__text{line-height:1.5;border-radius:0.3125em;position:relative;padding:0.0625em;font-size:1em}.theme--light.ripple,.theme--light.reading,.theme--light.sentence__word,.theme--light.sentence__text,.theme--light.scroll-guide__text{color:#040508}.theme--dark.ripple,.theme--dark.reading,.theme--dark.sentence__word,.theme--dark.sentence__text,.theme--dark.scroll-guide__text{color:#fff}.theme--light.ripple:active,.theme--light.reading:active,.theme--light.sentence__word:hover{color:#fff;background:gray radial-gradient(circle, transparent 1%, gray 1%) center/15000%}.theme--dark.ripple:active,.theme--dark.reading:active,.theme--dark.sentence__word:hover{color:#fff;background:#a6a6a6 radial-gradient(circle, transparent 1%, #a6a6a6 1%) center/15000%}.theme--light.sentence__word.reading{color:#fff;background:#666666 radial-gradient(circle, transparent 1%, #666666 1%) center/15000%}.theme--dark.sentence__word.reading{color:#040508;background:#fff radial-gradient(circle, transparent 1%, #fff 1%) center/15000%}.theme--light.page__col__img-placeholder{border:0.046875em dotted gray}.theme--dark.page__col__img-placeholder{border:0.046875em dotted #a6a6a6}.theme--light.scroll-guide__container,.theme--light.overlay__container{border:0.046875em solid gray}.theme--dark.scroll-guide__container,.theme--dark.overlay__container{border:0.046875em solid #a6a6a6}.theme--light#annotationsMenu,.theme--light.settings,.theme--light.page--multi,.theme--light.pages__container,.theme--light.control-panel{border-left:0.046875em solid gray}.theme--dark#annotationsMenu,.theme--dark.settings,.theme--dark.page--multi,.theme--dark.pages__container,.theme--dark.control-panel{border-left:0.046875em solid #a6a6a6}.theme--light#annotationsMenu,.theme--light.settings,.theme--light.page--multi,.theme--light.pages__container,.theme--light.control-panel{border-right:0.046875em solid gray}.theme--dark#annotationsMenu,.theme--dark.settings,.theme--dark.page--multi,.theme--dark.pages__container,.theme--dark.control-panel{border-right:0.046875em solid #a6a6a6}#annotationsMenu button.theme--light,.theme--light#annotationsMenu,.settings>.theme--light.footer,.theme--light.settings,.theme--light.pages__container{border-top:0.046875em solid gray}#annotationsMenu button.theme--dark,.theme--dark#annotationsMenu,.settings>.theme--dark.footer,.theme--dark.settings,.theme--dark.pages__container{border-top:0.046875em solid #a6a6a6}#annotationsMenu button.theme--light,#annotationsMenu h3.theme--light,.theme--light#annotationsMenu,.theme--light.settings,.theme--light.control-panel{border-bottom:0.046875em solid gray}#annotationsMenu button.theme--dark,#annotationsMenu h3.theme--dark,.theme--dark#annotationsMenu,.theme--dark.settings,.theme--dark.control-panel{border-bottom:0.046875em solid #a6a6a6}.ripple:hover,.reading:hover,.sentence__word:hover{cursor:pointer}@viewport{width:device-width}button{border:0;cursor:pointer}html{background-color:#fff;box-sizing:border-box;height:100%}*:before,*:after{box-sizing:inherit}body{-webkit-font-smoothing:antialiased;color:#040508;font-family:"BCSans", "Noto Sans", Verdana, Arial, sans-serif;min-height:100%;overflow-x:hidden;overflow-y:hidden;text-rendering:optimizeLegibility}a{background:transparent;color:#c69;text-decoration:none;transition:color 0.2s;outline:none}a:active,a:focus{outline:none}img{height:90%;max-width:90%;object-fit:cover}h1,h2,h3,h4,h5,h6{font-family:"BCSans", "Noto Sans", Verdana, Arial, sans-serif;font-weight:normal}p,mat-chip,mat-tab-label,span,button,div,a{font-family:"BCSans", "Noto Sans", Verdana, Arial, sans-serif}.theme--light::-webkit-scrollbar{width:0.5em;height:0.5em}.theme--light::-webkit-scrollbar-track{background:#fff}.theme--light::-webkit-scrollbar-thumb{background:#040508;border-radius:0.3125em;height:0.625em;width:0.625em}.theme--dark::-webkit-scrollbar{width:0.5em;height:0.5em}.theme--dark::-webkit-scrollbar-track{background:#3c4369}.theme--dark::-webkit-scrollbar-thumb{background:#fff;border-radius:0.3125em;height:0.625em;width:0.625em}.bg-img{background-image:url("../assets/img/bg.jpg");height:100vh;overflow:overlay;overflow-x:hidden;background-position:center;background-repeat:no-repeat;background-size:cover;min-height:100%}.shadow-box{box-shadow:0 0.3125rem 1rem 0 rgba(0, 0, 0, 0.24);padding:25px;background:rgba(255, 255, 255, 0.94);border-radius:5px}.font-xs{font-size:0.5em}.font-sm{font-size:0.75em}.font-md{font-size:1em}.font-lg{font-size:1.25em}.font-xl{font-size:1.5em}.font-xxl{font-size:2em}.faded{opacity:0.2;color:black}table{table-layout:fixed}.center{margin-left:auto;margin-right:auto;text-align:center}.container{max-width:80em}.background--light{background:#fff}.stop-color--light{fill:#fff}.color--light{color:#040508}.background--dark{background:#3c4369}.stop-color--dark{fill:#3c4369}.color--dark{color:#fff}.abs{position:absolute}.top-0{top:0}.left-0{left:0}.right-0{right:0}.top-5{top:0.3125em}.left-5{left:0.3125em}.right-5{right:0.3125em}.top-10{top:0.625em}.left-10{left:0.625em}.right-10{right:0.625em}.top-15{top:0.9375em}.left-15{left:0.9375em}.right-15{right:0.9375em}.top-20{top:1.25em}.left-20{left:1.25em}.right-20{right:1.25em}.top-25{top:1.5625em}.left-25{left:1.5625em}.right-25{right:1.5625em}.top-30{top:1.875em}.left-30{left:1.875em}.right-30{right:1.875em}.top-35{top:2.1875em}.left-35{left:2.1875em}.right-35{right:2.1875em}.top-40{top:2.5em}.left-40{left:2.5em}.right-40{right:2.5em}.top-45{top:2.8125em}.left-45{left:2.8125em}.right-45{right:2.8125em}.top-50{top:3.125em}.left-50{left:3.125em}.right-50{right:3.125em}.invisible{visibility:hidden !important}.control-panel{border-radius:0 0 0.3125em 0.3125em;position:relative;min-width:100%;display:inline-flex}.control-panel__buttons--left{width:25%;float:left;margin-top:0.3125em;padding:0.3125em}.control-panel__buttons--center{width:25%;text-align:center;margin:0 auto}.control-panel__buttons--right{width:25%;text-align:right;float:right;margin-top:0.3125em;margin-right:0.3125em}.control-panel__buttons__header{margin:0.3125em}.control-panel__control{border-radius:0.3125em;margin:0.5em auto}.control-panel__control:focus{outline:none}.settings{margin-left:0;margin-right:0;text-align:center}.settings__option__header{margin-bottom:0.5em}#waveform{background-size:contain;background-repeat:no-repeat;background-position:center center;width:100%;height:100%;position:absolute;top:0;left:0}.low{z-index:700}.overlay__container{width:100%;max-width:100%;height:3.125em;position:relative;z-index:800}#overlay__object{z-index:700;max-height:100%;min-width:100%;fill:"transparent"}#overlay__object.theme--light{stroke:gray}#overlay__object.theme--dark{stroke:#a6a6a6}.scroll-guide__container{text-align:center;z-index:700;width:20%;position:fixed;left:50%;transform:translate(-50%, 0)}.scroll-guide__text{font-size:1.25em}.pages__container{overflow:auto;max-height:55vh;height:100%;max-width:100%;width:100%;position:relative;display:-webkit-inline-flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;border-radius:0.3125em 0.3125em 0 0;transition:margin-right 0.5s}.page{overflow-y:hidden;overflow-x:auto;flex-grow:1;min-width:99.6%;width:100%;max-width:55em}.page__container{display:grid;grid-template-columns:[col-start] [col-end];grid-template-rows:[row-start] 5% [row-end] 95%;grid-template-areas:"image page-no" "image text";justify-items:stretch}.page__counter{grid-area:page-no;margin:0.625em 0 0 0.9375em;text-align:right;padding-right:0.9375em;max-height:5rem}.page__col__image{grid-area:image;max-height:100%;text-align:center;margin:5%;padding:0;border-radius:0 0 0 0;position:relative}.page__col__image img{max-height:55vh;max-width:95%;object-fit:contain}.page__col__img-placeholder{cursor:pointer}.page__col__text{grid-area:text}.page.two-column-layout-page{grid-template-columns:40% auto}.page.one-column-layout-page{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;overflow-y:auto}.page.one-column-layout-page .page__col__image img{max-height:33vh !important}.page.one-column-layout-page .page__counter{width:100%;display:block;text-align:center}.hide-page-counter .page__counter{display:none}.pages__container.vertical{flex-direction:column !important}.pages__container.vertical>.page{min-height:100%}.paragraph__container{overflow-y:auto;min-width:40%;padding-bottom:0.75em}.sentence{margin:0 1.5em;text-align:left;max-width:90%}.sentence__container{margin:3.75em 0.625em 3.75em 0.625em;scroll-behavior:smooth;max-width:100%;position:relative;overflow-y:auto;overflow-x:hidden}.sentence__container__buttons{position:absolute;top:0;right:0}.sentence__text{font-size:1.5em;padding:0}.sentence__word{font-size:1.5em}.sentence__translation .sentence__text,.sentence[annotation-id] .sentence__text,.sentence__translation .sentence__word{color:#777;font-style:italic;font-size:95%}.sentence__translation__button{margin-left:10px}.sentence__translation__button i{font-size:medium}.paragraph.visually_aligned .sentence .sentence__text,.paragraph.visually_aligned .sentence .sentence__word{display:table-cell}.paragraph.visually_aligned .sentence .sentence__text:empty{display:none}.paragraph.visually_aligned{display:table}.paragraph.visually_aligned .sentence{display:table-row}.read-along-container{max-width:75em;margin:0 auto;overflow-y:hidden;overflow-x:hidden;padding:0.3125em;position:relative}.read-along-container--fullscreen{max-width:80%;min-width:80%}.slot__header{margin-bottom:0.3125em}.slot__subheader{margin-top:0;margin-left:1em}.settings-background{position:fixed;top:0;left:0;height:100vh;width:100vw;background-color:rgba(0, 0, 0, 0.075);z-index:900;-webkit-backdrop-filter:blur(5px) !important;backdrop-filter:blur(5px) !important}.settings{height:55vh;max-height:55vh;width:375px;max-width:375px;position:fixed;z-index:1000;top:15vh;left:calc((100% - 375px) / 2);overflow-x:hidden;transition:0.5s}.settings h3{border-bottom:1px solid #ccc;padding:10px;margin:0}.settings h3 button{float:inline-start;margin-top:0;margin-bottom:0}.settings>.close{position:relative;float:inline-end;background-color:inherit;color:inherit;font-size:18px;display:inline-block;padding:0.275rem 0.75rem;font-weight:400;line-height:1.5;text-align:center;text-decoration:none;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;border:0;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out}.settings>.close:hover{color:#fff;background-color:#bb2d3b;border-color:#bb2d3b;box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075)}.settings p{cursor:pointer;text-align:left;color:inherit;margin:0.5em 1em}.settings p select,.settings p button{margin-right:1em;width:80px;text-align:justify}.settings p button{margin:0 1em 0 0;padding:0 0.0625em}.settings>.footer{position:absolute;bottom:0;right:0;left:0;padding:0.01em 1em;height:3em;display:flex;flex-grow:0;flex-shrink:0;flex-direction:row;align-content:space-between;justify-content:space-between}.settings>.footer>div{flex-grow:8}.settings>.footer>button{border:1px solid #ccc;padding:0.25em 0.5em !important}.settings>.footer>button:hover{background-color:rgba(0, 0, 0, 0.15);box-shadow:1px 1px 1px rgba(0, 0, 0, 0.15)}.settings button:disabled{background-color:rgba(200, 200, 200, 0.15);color:#ccc}.settings p.version{padding:1em;font-size:0.7em;font-weight:100;color:#ccc}.settings.theme--dark{color:#fff}@media screen and (max-width: 385px){.settings{width:95vw;max-width:95vw;left:2.5vw;overflow:auto}.settings p{margin-bottom:1em;border-bottom:1px solid #ccc}.settings p select,.settings p button{display:block;width:80%}}button:focus,input:focus{box-shadow:0 1px 1px rgba(0, 0, 0, 0.15)}#annotationsMenu{position:absolute;bottom:4em;right:0.3125em;z-index:1000;width:fit-content;width:-moz-fit-content;display:flex;flex-direction:column;border-radius:0.3125em}#annotationsMenu h3{margin:0.3125em 0;padding:0.3125em 0.5em}#annotationsMenu button{display:flex;justify-content:flex-start;align-content:baseline;font-size:medium;padding:0.5em}#annotationsMenu button .material-icons-outlined{font-size:inherit;border-radius:0;margin-right:0.3125em}.sentence.invisible[annotation-id]{display:none}.loader{border:16px solid #eee;border-radius:50%;border-right-color:#aa0;border-bottom-color:#a33;border-left-color:#111;width:10rem;height:10rem;-webkit-animation:spin 3s linear infinite;animation:spin 3s linear infinite;position:fixed;top:calc(50vh - 10rem);left:calc(50vw - 10rem);z-index:1000;box-shadow:0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.alert{position:relative;padding:1rem 1rem;margin-bottom:1rem;border:1px solid transparent;border-radius:0.25rem;transition-delay:2s;transition:visibility 5s height 5s}.alert.status-success{color:#0f5132;background-color:#d1e7dd;border-color:#badbcc}.alert.status-error{color:#842029;background-color:#f8d7da;border-color:#f5c2c7}.alert.fade{visibility:collapse;height:0 !important;overflow:hidden !important;line-height:0 !important;padding:0 !important;margin:0 !important;border:0 !important}.animate-transition,.ripple,.reading{transition:background 0.4s}.animate-transition:active,.ripple:active,.reading:active{transition:background 0s}.ripple,.reading{background-position:center;padding:0.0625em}.ripple:active,.reading:active{background-size:100%}.progress{position:absolute;top:0;left:0;height:100%;width:0}.progress.theme--light{background-color:rgba(128, 128, 128, 0.2)}.progress.theme--dark{background-color:rgba(166, 166, 166, 0.2)}.material-icons{font-family:"Material Icons";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}.material-icons-outlined{font-family:"Material Icons Outlined";font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}[contenteditable][data-placeholder]:empty:before{content:attr(data-placeholder);position:absolute;color:gray;cursor:text;background-color:transparent}.drop-area{border:2px dashed #ccc;border-radius:20px;width:50%;font-family:sans-serif;margin:50px auto;padding:20px}.drop-area.highlight{border-color:purple}p{margin-top:0}.my-form{margin-bottom:10px}#gallery{margin-top:10px}#gallery img{width:150px;margin-bottom:10px;margin-right:10px;vertical-align:middle}.button{display:inline-block;padding:10px;background:#ccc;cursor:pointer;border-radius:5px;border:1px solid #ccc}.button:hover{background:#ddd}.fileElem{display:none}#img-remover{margin:60px;position:absolute;z-index:700;border-radius:50px;color:red}#image-container{display:contents}'},131:(e,t,n)=>{var o={"./read-along.entry.js":[704,179]};function i(e){if(!n.o(o,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=o[e],i=t[0];return n.e(t[1]).then((()=>n(i)))}i.keys=()=>Object.keys(o),i.id=131,e.exports=i}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.e=()=>Promise.resolve(),n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=n(50);(()=>{const t="file:///C:/Users/joanise/sandboxes/Studio-Web/dist/packages/web-component/dist/esm/web-component.js",n={};return n.resourcesUrl=new URL(".",t).href,(0,e.p)(n)})().then((async t=>(await void 0,(0,e.b)([["read-along",[[1,"read-along",{href:[1],audio:[1],svgOverlay:[1,"svg-overlay"],theme:[1537],language:[1537],cssUrl:[1,"css-url"],useAssetsFolder:[4,"use-assets-folder"],imageAssetsFolder:[1,"image-assets-folder"],pageScrolling:[1,"page-scrolling"],mode:[1],scrollBehaviour:[1537,"scroll-behaviour"],displayTranslation:[4,"display-translation"],playbackRateRange:[2,"playback-rate-range"],autoPauseAtEndOfPage:[1540,"auto-pause-at-end-of-page"],playing:[32],fullscreen:[32],autoScroll:[32],hasLoaded:[32],images:[32],translations:[32],settingsVisible:[32],userPreferencesDirty:[32],annotations:[32],annotationsMenuVisible:[32],getCurrentWord:[64],getImages:[64],updateSpriteAlignments:[64],getReadAlongElement:[64],getAlignments:[64],getTranslations:[64],changeTheme:[64]},[[9,"wheel","wheelHandler"],[0,"fullscreenchange","fullScreenHandler"],[0,"keydown","handleKeyDown"]],{audio_howl_sprites:["wheelHandler"]}]]]],t))))})()})(); \ No newline at end of file diff --git a/packages/web-component/package.json b/packages/web-component/package.json index fb6ce5f6..4ed44cd9 100644 --- a/packages/web-component/package.json +++ b/packages/web-component/package.json @@ -1,6 +1,6 @@ { "name": "@readalongs/web-component", - "version": "1.5.1", + "version": "1.5.2", "description": "ReadAlong Web Component", "main": "dist/index.cjs.js", "module": "dist/index.js",