@beyondwords/player 0.0.0-alpha5 → 0.0.0-alpha6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es.js +6 -2
- package/dist/es.js.map +1 -1
- package/dist/umd.js +2 -2
- package/dist/umd.js.map +1 -1
- package/package.json +1 -1
package/dist/umd.js
CHANGED
|
@@ -17,8 +17,8 @@ Url: ${an(t)}`),!0)}function Hl(t,e){return t.type||!e||!e.length?!1:Xl(t).some(
|
|
|
17
17
|
`;for(let O=0;O<=1;O+=a){const m=e+(r-e)*s(O);C+=O*100+`%{${o(m,1-m)}}
|
|
18
18
|
`}const c=C+`100% {${o(r,1-r)}}
|
|
19
19
|
}`,R=`__svelte_${lf(c)}_${l}`,A=Ks(t),{stylesheet:F,rules:x}=dn.get(A)||uf(A,t);x[R]||(x[R]=!0,F.insertRule(`@keyframes ${R} ${c}`,F.cssRules.length));const S=t.style.animation||"";return t.style.animation=`${S?`${S}, `:""}${R} ${n}ms linear ${i}ms 1 both`,hn+=1,R}function ff(t,e){const r=(t.style.animation||"").split(", "),n=r.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),i=r.length-n.length;i&&(t.style.animation=n.join(", "),hn-=i,hn||cf())}function cf(){fn(()=>{hn||(dn.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&oe(e)}),dn.clear())})}let kr;function Mr(t){kr=t}function Gs(){if(!kr)throw new Error("Function called outside component initialization");return kr}function oi(t){Gs().$$.on_mount.push(t)}function df(t){Gs().$$.on_destroy.push(t)}const dr=[],He=[];let hr=[];const li=[],Hs=Promise.resolve();let ui=!1;function Vs(){ui||(ui=!0,Hs.then(Y))}function hf(){return Vs(),Hs}function Zt(t){hr.push(t)}function _t(t){li.push(t)}const fi=new Set;let gr=0;function Y(){if(gr!==0)return;const t=kr;do{try{for(;gr<dr.length;){const e=dr[gr];gr++,Mr(e),gf(e.$$)}}catch(e){throw dr.length=0,gr=0,e}for(Mr(null),dr.length=0,gr=0;He.length;)He.pop()();for(let e=0;e<hr.length;e+=1){const r=hr[e];fi.has(r)||(fi.add(r),r())}hr.length=0}while(dr.length);for(;li.length;)li.pop()();ui=!1,fi.clear(),Mr(t)}function gf(t){if(t.fragment!==null){t.update(),Qe(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Zt)}}function vf(t){const e=[],r=[];hr.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),hr=e}let wr;function mf(){return wr||(wr=Promise.resolve(),wr.then(()=>{wr=null})),wr}function ci(t,e,r){t.dispatchEvent(of(`${e?"intro":"outro"}${r}`))}const gn=new Set;let Ot;function Ue(){Ot={r:0,c:[],p:Ot}}function Ne(){Ot.r||Qe(Ot.c),Ot=Ot.p}function $(t,e){t&&t.i&&(gn.delete(t),t.i(e))}function re(t,e,r,n){if(t&&t.o){if(gn.has(t))return;gn.add(t),Ot.c.push(()=>{gn.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}const _f={duration:0};function Ys(t,e,r,n){const i={direction:"both"};let s=e(t,r,i),o=n?0:1,l=null,a=null,C=null;function c(){C&&ff(t,C)}function R(F,x){const S=F.b-o;return x*=Math.abs(S),{a:o,b:F.b,d:S,duration:x,start:F.start,end:F.start+x,group:F.group}}function A(F){const{delay:x=0,duration:S=300,easing:O=Qu,tick:m=ce,css:y}=s||_f,u={start:$u()+x,b:F};F||(u.group=Ot,Ot.r+=1),l||a?a=u:(y&&(c(),C=Ws(t,o,F,S,x,O,y)),F&&m(0,1),l=R(u,S),Zt(()=>ci(t,F,"start")),ef(L=>{if(a&&L>a.start&&(l=R(a,S),a=null,ci(t,l.b,"start"),y&&(c(),C=Ws(t,o,l.b,l.duration,0,O,s.css))),l){if(L>=l.end)m(o=l.b,1-o),ci(t,l.b,"end"),a||(l.b?c():--l.group.r||Qe(l.group.c)),l=null;else if(L>=l.start){const g=L-l.start;o=l.a+l.d*O(g/l.duration),m(o,1-o)}}return!!(l||a)}))}return{run(F){fr(s)?mf().then(()=>{s=s(i),A(F)}):A(F)},end(){c(),l=a=null}}}function pt(t,e,r){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=r,r(t.$$.ctx[n]))}function ye(t){t&&t.c()}function _e(t,e,r,n){const{fragment:i,after_update:s}=t.$$;i&&i.m(e,r),n||Zt(()=>{const o=t.$$.on_mount.map(Ms).filter(fr);t.$$.on_destroy?t.$$.on_destroy.push(...o):Qe(o),t.$$.on_mount=[]}),s.forEach(Zt)}function pe(t,e){const r=t.$$;r.fragment!==null&&(vf(r.after_update),Qe(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function pf(t,e){t.$$.dirty[0]===-1&&(dr.push(t),Vs(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Le(t,e,r,n,i,s,o,l=[-1]){const a=kr;Mr(t);const C=t.$$={fragment:null,ctx:[],props:s,update:ce,not_equal:i,bound:ws(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:ws(),dirty:l,skip_bound:!1,root:e.target||a.$$.root};o&&o(C.root);let c=!1;if(C.ctx=r?r(t,e.props||{},(R,A,...F)=>{const x=F.length?F[0]:A;return C.ctx&&i(C.ctx[R],C.ctx[R]=x)&&(!C.skip_bound&&C.bound[R]&&C.bound[R](x),c&&pf(t,R)),A}):[],C.update(),c=!0,Qe(C.before_update),C.fragment=n?n(C.ctx):!1,e.target){if(e.hydrate){const R=nf(e.target);C.fragment&&C.fragment.l(R),R.forEach(oe)}else C.fragment&&C.fragment.c();e.intro&&$(t.$$.fragment),_e(t,e.target,e.anchor,e.customElement),Y()}Mr(a)}class Ae{$destroy(){pe(this,1),this.$destroy=ce}$on(e,r){if(!fr(r))return ce;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!qu(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}var Fr="<unknown>";function yf(t){var e=t.split(`
|
|
20
|
-
`);return e.reduce(function(r,n){var i=bf(n)||Lf(n)||Df(n)||Rf(n)||Cf(n);return i&&r.push(i),r},[])}var Ef=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Tf=/\((\S*)(?::(\d+))(?::(\d+))\)/;function bf(t){var e=Ef.exec(t);if(!e)return null;var r=e[2]&&e[2].indexOf("native")===0,n=e[2]&&e[2].indexOf("eval")===0,i=Tf.exec(e[2]);return n&&i!=null&&(e[2]=i[1],e[3]=i[2],e[4]=i[3]),{file:r?null:e[2],methodName:e[1]||Fr,arguments:r?[e[2]]:[],lineNumber:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}var Sf=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Lf(t){var e=Sf.exec(t);return e?{file:e[2],methodName:e[1]||Fr,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}var Af=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Pf=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Df(t){var e=Af.exec(t);if(!e)return null;var r=e[3]&&e[3].indexOf(" > eval")>-1,n=Pf.exec(e[3]);return r&&n!=null&&(e[3]=n[1],e[4]=n[2],e[5]=null),{file:e[3],methodName:e[1]||Fr,arguments:e[2]?e[2].split(","):[],lineNumber:e[4]?+e[4]:null,column:e[5]?+e[5]:null}}var xf=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Cf(t){var e=xf.exec(t);return e?{file:e[3],methodName:e[1]||Fr,arguments:[],lineNumber:+e[4],column:e[5]?+e[5]:null}:null}var Of=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Rf(t){var e=Of.exec(t);return e?{file:e[2],methodName:e[1]||Fr,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}const If="@beyondwords/player",zs="0.0.0-
|
|
21
|
-
`)))},Xs=t=>{var e;return(e=yf((t==null?void 0:t.stack)||"")[0])==null?void 0:e.file},wf=t=>{var r,n;const e=((n=(r=window.BeyondWords)==null?void 0:r.Player)==null?void 0:n.instances())||[];for(const[i,s]of e.entries()){const o=`BeyondWords.Player.instances()[${i}]`;t.contexts=t.contexts||{},t.contexts[o]=di(s)}return t};Mf();const Br="data-beyondwords-marker",hi=["beyondwords-highlight","bwp"],Zs=["beyondwords-clickable","bwp"],Qs=(t,e,r,n)=>{const i=new Set(Nf(t)),s=Uf().filter(o=>!i.has(o));Ff(i,e,r,n),Bf(s,e)},Ff=(t,e,r,n)=>{for(const i of t){const s=Js(i)||jf(i);s.classList.add(e),s.style.background=r,qs({fromElement:i,toElement:s}),n&&Zs.forEach(o=>i.classList.add(o))}},Bf=(t,e)=>{const r=new Set([...hi,e]);for(const n of t){const i=Js(n);Kf(i,r)?i.classList.remove(e):i&&(qs({fromElement:i,toElement:n}),i.remove(),Zs.forEach(s=>n.classList.remove(s)))}},Uf=()=>[...document.querySelectorAll(`[${Br}]`)],Nf=t=>t!=null&&t.marker?document.querySelectorAll(`[${Br}="${t.marker}"]`):[],Js=t=>t.
|
|
20
|
+
`);return e.reduce(function(r,n){var i=bf(n)||Lf(n)||Df(n)||Rf(n)||Cf(n);return i&&r.push(i),r},[])}var Ef=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Tf=/\((\S*)(?::(\d+))(?::(\d+))\)/;function bf(t){var e=Ef.exec(t);if(!e)return null;var r=e[2]&&e[2].indexOf("native")===0,n=e[2]&&e[2].indexOf("eval")===0,i=Tf.exec(e[2]);return n&&i!=null&&(e[2]=i[1],e[3]=i[2],e[4]=i[3]),{file:r?null:e[2],methodName:e[1]||Fr,arguments:r?[e[2]]:[],lineNumber:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}var Sf=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Lf(t){var e=Sf.exec(t);return e?{file:e[2],methodName:e[1]||Fr,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}var Af=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Pf=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Df(t){var e=Af.exec(t);if(!e)return null;var r=e[3]&&e[3].indexOf(" > eval")>-1,n=Pf.exec(e[3]);return r&&n!=null&&(e[3]=n[1],e[4]=n[2],e[5]=null),{file:e[3],methodName:e[1]||Fr,arguments:e[2]?e[2].split(","):[],lineNumber:e[4]?+e[4]:null,column:e[5]?+e[5]:null}}var xf=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Cf(t){var e=xf.exec(t);return e?{file:e[3],methodName:e[1]||Fr,arguments:[],lineNumber:+e[4],column:e[5]?+e[5]:null}:null}var Of=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Rf(t){var e=Of.exec(t);return e?{file:e[2],methodName:e[1]||Fr,arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}:null}const If="@beyondwords/player",zs="0.0.0-alpha6",di=t=>{const e=Object.getOwnPropertyDescriptors(t),i=Object.entries(e).filter(([s,{set:o}])=>o).map(([s,o])=>s).filter(s=>!kf.has(s)).map(s=>[s,t[s]]);return Object.fromEntries(i)},kf=new Set(["addEventListener","removeEventListener","mediaElement","userInterface","widgetInterface","controller"]),Mf=()=>{const t=Xs(new Error),e=t==null?void 0:t.match(/initializeSentry/);zu({...t?{}:{defaultIntegrations:!1},dsn:"https://ea2f0f2a070b4934994dc8543b8d16e1@o271781.ingest.sentry.io/4504853792882688",environment:e?"development":"production",release:zs,beforeSend(n,{originalException:i}){var C;const o=Xs(i)===t,l=(C=i==null?void 0:i.message)==null?void 0:C.match(/request was interrupted/);if(e||o||l)return wf(n)}}),!t&&cs(new Error(["Unable to determine the filename of the BeyondWords player script.","We therefore can't filter errors to only those originating from the player.","To avoid receiving unrelated errors from publishers, Sentry has been disabled."].join(`
|
|
21
|
+
`)))},Xs=t=>{var e;return(e=yf((t==null?void 0:t.stack)||"")[0])==null?void 0:e.file},wf=t=>{var r,n;const e=((n=(r=window.BeyondWords)==null?void 0:r.Player)==null?void 0:n.instances())||[];for(const[i,s]of e.entries()){const o=`BeyondWords.Player.instances()[${i}]`;t.contexts=t.contexts||{},t.contexts[o]=di(s)}return t};Mf();const Br="data-beyondwords-marker",hi=["beyondwords-highlight","bwp"],Zs=["beyondwords-clickable","bwp"],Qs=(t,e,r,n)=>{const i=new Set(Nf(t)),s=Uf().filter(o=>!i.has(o));Ff(i,e,r,n),Bf(s,e)},Ff=(t,e,r,n)=>{for(const i of t){const s=Js(i)||jf(i);s.classList.add(e),s.style.background=r,qs({fromElement:i,toElement:s}),n&&Zs.forEach(o=>i.classList.add(o))}},Bf=(t,e)=>{const r=new Set([...hi,e]);for(const n of t){const i=Js(n);Kf(i,r)?i.classList.remove(e):i&&(qs({fromElement:i,toElement:n}),i.remove(),Zs.forEach(s=>n.classList.remove(s)))}},Uf=()=>[...document.querySelectorAll(`[${Br}]`)],Nf=t=>t!=null&&t.marker?document.querySelectorAll(`[${Br}="${t.marker}"]`):[],Js=t=>{for(const e of t.children)if(!(!(e.nodeName.toLowerCase()==="mark")||!hi.every(i=>e.classList.contains(i))))return e},jf=t=>{const e=document.createElement("mark");return e.classList.add(...hi),t.appendChild(e),e},Kf=(t,e)=>{if(!t)return!1;for(const r of t.classList)if(!e.has(r))return!0},qs=({fromElement:t,toElement:e})=>{for(let r=0;r<t.childNodes.length;r+=1){const n=t.childNodes[r];n!==e&&(e.appendChild(n),r-=1)}},ct=(t,e)=>{t=[t].flat().join(`
|
|
22
22
|
`);let r=`${If}:
|
|
23
23
|
|
|
24
24
|
${t}`;if(e){r+=`
|