@sparkle-learning/core 0.0.22 → 0.0.25

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.
Files changed (42) hide show
  1. package/dist/cjs/header-mobile-collapse_60.cjs.entry.js +1 -1
  2. package/dist/cjs/{index.es-6a9d5ef8.js → index.es-c12b0714.js} +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{purify-9804ff8d.js → purify-e34cd5cf.js} +1 -1
  5. package/dist/cjs/sparkle-animation-player.cjs.entry.js +6 -3
  6. package/dist/cjs/sparkle-core.cjs.js +1 -1
  7. package/dist/cjs/sparkle-youtube.cjs.entry.js +14 -168
  8. package/dist/collection/assets/img/forward.svg +5 -0
  9. package/dist/collection/assets/img/pause.svg +5 -0
  10. package/dist/collection/assets/img/play-symbol.svg +8 -0
  11. package/dist/collection/assets/img/play.svg +4 -0
  12. package/dist/collection/assets/img/rewind.svg +5 -0
  13. package/dist/collection/components/sparkle-animation-player/assets/play-button-disabled-overlay.png +0 -0
  14. package/dist/collection/components/sparkle-animation-player/assets/play-button-overlay.png +0 -0
  15. package/dist/collection/components/sparkle-animation-player/sparkle-animation-player.css +1 -1
  16. package/dist/collection/components/sparkle-animation-player/sparkle-animation-player.js +10 -7
  17. package/dist/collection/components/sparkle-root/sparkle-root.css +3 -0
  18. package/dist/collection/components/sparkle-youtube/sparkle-youtube.css +16 -0
  19. package/dist/collection/components/sparkle-youtube/sparkle-youtube.js +25 -307
  20. package/dist/collection/pages/course/welcome-to-mind-body/introduction/animation/m4l1p1_part1.js +2727 -0
  21. package/dist/collection/pages/course/welcome-to-mind-body/introduction/animation/m4l1p1_part2.js +2042 -0
  22. package/dist/esm/header-mobile-collapse_60.entry.js +1 -1
  23. package/dist/esm/{index.es-8ad3b6a1.js → index.es-34d81aa0.js} +1 -1
  24. package/dist/esm/loader.js +1 -1
  25. package/dist/esm/{purify-76634fc8.js → purify-76414f98.js} +1 -1
  26. package/dist/esm/sparkle-animation-player.entry.js +7 -4
  27. package/dist/esm/sparkle-core.js +1 -1
  28. package/dist/esm/sparkle-youtube.entry.js +15 -169
  29. package/dist/sparkle-core/assets/play-button-disabled-overlay.png +0 -0
  30. package/dist/sparkle-core/assets/play-button-overlay.png +0 -0
  31. package/dist/sparkle-core/{p-17507402.entry.js → p-1af89970.entry.js} +1 -1
  32. package/dist/sparkle-core/p-1e1f5e98.entry.js +1 -0
  33. package/dist/sparkle-core/{p-b2d4840f.js → p-315af535.js} +1 -1
  34. package/dist/sparkle-core/p-80bc3b53.entry.js +1 -0
  35. package/dist/sparkle-core/{p-660fccf6.js → p-ba79a250.js} +1 -1
  36. package/dist/sparkle-core/{p-ec2e029e.js → p-fc739e6b.js} +3 -3
  37. package/dist/sparkle-core/sparkle-core.esm.js +1 -1
  38. package/dist/types/components/sparkle-youtube/sparkle-youtube.d.ts +6 -20
  39. package/dist/types/components.d.ts +3 -14
  40. package/package.json +1 -1
  41. package/dist/sparkle-core/p-0bd3e81f.entry.js +0 -1
  42. package/dist/sparkle-core/p-d069b834.entry.js +0 -1
@@ -1,187 +1,33 @@
1
- import { r as registerInstance, h, H as Host, d as getElement } from './index-55fc9f5e.js';
1
+ import { r as registerInstance, h, d as getElement } from './index-55fc9f5e.js';
2
2
 
3
- const sparkleYoutubeCss = ":host(.loaded) div.youtube-container{opacity:var(--sparkle-youtube-opacity-loaded, 1)}div.youtube-container{opacity:var(--sparkle-youtube-opacity-not-loaded, 0);transition:var(--sparkle-youtube-transition, opacity 0.15s linear)}";
3
+ const sparkleYoutubeCss = ":host(.loaded) div.youtube-container{opacity:var(--sparkle-youtube-opacity-loaded, 1)}div.youtube-container{opacity:var(--sparkle-youtube-opacity-not-loaded, 0);transition:var(--sparkle-youtube-transition, opacity 0.15s linear)}.embed-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%}.embed-container iframe,.embed-container object,.embed-container embed{position:absolute;top:0;left:0;width:100%;height:100%}";
4
4
 
5
5
  const SparkleYoutube = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
- this.allowFullscreen = true;
9
- this.instant = false;
10
- this.loading = false;
11
- this.loaded = false;
8
+ this.video_thumbnail = '';
12
9
  }
13
- async componentWillLoad() {
14
- await this.addPreconnectLink();
10
+ componentDidLoad() {
11
+ this.classMode = this.initialClassMode;
12
+ this.classModeChanged();
15
13
  }
16
- async componentDidLoad() {
17
- if (this.instant) {
18
- await this.lazyLoadContent();
19
- }
20
- }
21
- async updateIFrame(width, height) {
22
- const iframe = this.el.shadowRoot.querySelector('iframe');
23
- if (iframe) {
24
- iframe.width = '' + width;
25
- iframe.height = '' + height;
26
- }
27
- }
28
- lazyLoadContent() {
29
- return this.createIFrame();
30
- }
31
- async onSrcUpdate() {
32
- await this.createIFrame();
33
- }
34
- play() {
35
- return this.playPauseVideo(true);
36
- }
37
- pause() {
38
- return this.playPauseVideo(false);
39
- }
40
- addPreconnectLink() {
41
- return new Promise((resolve) => {
42
- if (!this.src || !document) {
43
- resolve();
44
- return;
45
- }
46
- const links = document.head.querySelectorAll("link[rel='preconnect'][youtube]");
47
- if (links && links.length > 0) {
48
- resolve();
49
- return;
50
- }
51
- const link = document.createElement('link');
52
- link.rel = 'preconnect';
53
- link.href = 'https://www.youtube.com';
54
- link.setAttribute('youtube', '');
55
- document.head.appendChild(link);
56
- resolve();
57
- });
58
- }
59
- createIFrame() {
60
- return new Promise(async (resolve) => {
61
- if (!this.src) {
62
- resolve();
63
- return;
64
- }
65
- if (this.loading) {
66
- resolve();
67
- return;
14
+ classModeChanged() {
15
+ if (this.classMode) {
16
+ var youtube_video_id = this.src.match(/youtube\.com.*(\?v=|\/embed\/)(.{11})/).pop();
17
+ if (youtube_video_id.length == 11) {
18
+ this.video_thumbnail = '//img.youtube.com/vi/' + youtube_video_id + '/0.jpg';
68
19
  }
69
- const iframe = this.el.shadowRoot.querySelector('iframe');
70
- if (iframe && !iframe.parentElement) {
71
- resolve();
72
- return;
73
- }
74
- this.loading = true;
75
- this.loaded = false;
76
- if (iframe) {
77
- iframe.parentElement.removeChild(iframe);
78
- }
79
- const element = document.createElement('iframe');
80
- const allow = document.createAttribute('allow');
81
- allow.value = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture';
82
- this.setAttributeNode(element, allow);
83
- if (this.allowFullscreen) {
84
- const allowFullScreen = document.createAttribute('allowfullscreen');
85
- allowFullScreen.value = '';
86
- this.setAttributeNode(element, allowFullScreen);
87
- }
88
- let src = await this.formatSrc();
89
- if (!this.allowFullscreen) {
90
- // Not auto fullscreen on iOS: https://developers.google.com/youtube/player_parameters
91
- const playsinline = document.createAttribute('playsinline');
92
- playsinline.value = '1';
93
- this.setAttributeNode(element, playsinline);
94
- const split = src.split('?');
95
- src += `${split && split.length > 0 ? '&' : '?'}playsinline=1`;
96
- }
97
- element.src = src;
98
- element.width = '' + this.width;
99
- element.height = '' + this.height;
100
- element.frameBorder = '0';
101
- element.title = this.frameTitle;
102
- const div = this.el.shadowRoot.querySelector('div');
103
- if (!div) {
104
- resolve();
105
- return;
106
- }
107
- div.appendChild(element);
108
- this.loading = false;
109
- this.loaded = true;
110
- resolve();
111
- });
112
- }
113
- setAttributeNode(element, attr) {
114
- // Stencil prerendering
115
- if (element.setAttributeNode === 'function') {
116
- element.setAttributeNode(attr);
117
20
  }
118
21
  }
119
- formatSrc() {
120
- return new Promise(async (resolve) => {
121
- // Direct URL can't be embedded, like https://www.youtube.com/watch?v=oUOjJIfPIjw or https://youtu.be/e63Cgln6Yag
122
- const videoId = await this.findVideoId();
123
- if (videoId) {
124
- // In such a case return a link which could be embedded
125
- resolve('https://www.youtube.com/embed/' + videoId + '?enablejsapi=1');
126
- }
127
- else {
128
- // Otherwise we try the provided url
129
- if (!this.src) {
130
- resolve(this.src);
131
- return;
132
- }
133
- // But first, if an embed link, like https://www.youtube.com/embed/PnSNT5WpauE, would be passed, a parameter to enable js should be added otherwise play and pause could not be triggered
134
- // Therefore we add enablejsapi if needed in any case
135
- const url = new URL(this.src);
136
- if (!url.searchParams.get('enablejsapi')) {
137
- url.searchParams.append('enablejsapi', '1');
138
- }
139
- resolve(url.href);
140
- }
141
- });
142
- }
143
- findVideoId() {
144
- return new Promise((resolve) => {
145
- const url = new URL(this.src);
146
- let videoId = url.searchParams.get('v');
147
- if (!videoId) {
148
- const host = url.host;
149
- if (host === 'youtu.be') {
150
- // For shortened url
151
- const pathname = url.pathname;
152
- if (pathname) {
153
- const split = url.pathname.split('/');
154
- if (split && split.length >= 2) {
155
- videoId = url.pathname.split('/')[1];
156
- }
157
- }
158
- }
159
- }
160
- resolve(videoId);
161
- });
162
- }
163
- playPauseVideo(play) {
164
- return new Promise(async (resolve) => {
165
- const iframe = this.el.shadowRoot.querySelector('iframe');
166
- if (!iframe) {
167
- resolve();
168
- return;
169
- }
170
- iframe.contentWindow.postMessage(JSON.stringify({
171
- event: 'command',
172
- func: play ? 'playVideo' : 'pauseVideo',
173
- args: '',
174
- }), '*');
175
- resolve();
176
- });
22
+ classRoomModeChanged(val) {
23
+ this.classMode = val;
177
24
  }
178
25
  render() {
179
- const hostClass = this.loaded ? 'loaded' : '';
180
- return (h(Host, { class: hostClass }, h("div", { class: "youtube-container" })));
26
+ return (h("div", null, !this.classMode ? (h("div", { class: "embed-container" }, h("iframe", { src: this.src.replace("watch?v=", "embed/"), frameborder: "0", allowFullScreen: true }))) : (h("div", null, h("img", { src: this.video_thumbnail })))));
181
27
  }
182
28
  get el() { return getElement(this); }
183
29
  static get watchers() { return {
184
- "src": ["onSrcUpdate"]
30
+ "classMode": ["classModeChanged"]
185
31
  }; }
186
32
  };
187
33
  SparkleYoutube.style = sparkleYoutubeCss;
@@ -1 +1 @@
1
- import"./p-d63406d8.js";import"./p-770128c8.js";import"./p-bc568dcb.js";import"./p-b226f54d.js";import"./p-9a443f51.js";import"./p-7f3d5344.js";export{H as header_mobile_collapse,A as ion_avatar,B as ion_button,C as ion_card,b as ion_card_content,d as ion_checkbox,e as ion_col,G as ion_grid,I as ion_icon,f as ion_input,h as ion_item,L as ion_label,i as ion_list,j as ion_list_header,R as ion_radio,k as ion_radio_group,l as ion_range,m as ion_ripple_effect,n as ion_row,S as ion_spinner,T as ion_text,o as sparkle_button,p as sparkle_card,q as sparkle_cards,r as sparkle_course_root,s as sparkle_dropdown,E as sparkle_export_lessons,t as sparkle_facilitator_dashboard,u as sparkle_facilitator_header,F as sparkle_facilitator_notes,v as sparkle_facilitator_page,w as sparkle_forgot_password,x as sparkle_goal_item,y as sparkle_goal_progress,z as sparkle_goals,D as sparkle_gww,J as sparkle_gww_item,K as sparkle_header,M as sparkle_health,P as sparkle_login,N as sparkle_menu,O as sparkle_menu_toggle,Q as sparkle_mood,U as sparkle_nav,V as sparkle_online_students,W as sparkle_page,X as sparkle_page_footer,Y as sparkle_pagination,Z as sparkle_reset_password,_ as sparkle_root,$ as sparkle_signup,a0 as sparkle_unauthorized,a1 as sparkle_user_enrollment,a2 as sparkle_user_profile,a3 as sparkle_validation_error,a4 as stencil_route,a5 as stencil_route_link,a6 as stencil_route_switch,a7 as stencil_router,a8 as stencil_router_redirect}from"./p-ec2e029e.js";import"./p-f8063d7b.js";import"./p-4b7db0e6.js";import"./p-f2660943.js";import"./p-0e1c7c8c.js";import"./p-c466ee32.js";import"./p-03eb2164.js";import"./p-7840618d.js";import"./p-417a8dd6.js";import"./p-6d506f4e.js";import"./p-6f0ecbe3.js";import"./p-090f2624.js";import"./p-3be0a218.js";
1
+ import"./p-d63406d8.js";import"./p-770128c8.js";import"./p-bc568dcb.js";import"./p-b226f54d.js";import"./p-9a443f51.js";import"./p-7f3d5344.js";export{H as header_mobile_collapse,A as ion_avatar,B as ion_button,C as ion_card,b as ion_card_content,d as ion_checkbox,e as ion_col,G as ion_grid,I as ion_icon,f as ion_input,h as ion_item,L as ion_label,i as ion_list,j as ion_list_header,R as ion_radio,k as ion_radio_group,l as ion_range,m as ion_ripple_effect,n as ion_row,S as ion_spinner,T as ion_text,o as sparkle_button,p as sparkle_card,q as sparkle_cards,r as sparkle_course_root,s as sparkle_dropdown,E as sparkle_export_lessons,t as sparkle_facilitator_dashboard,u as sparkle_facilitator_header,F as sparkle_facilitator_notes,v as sparkle_facilitator_page,w as sparkle_forgot_password,x as sparkle_goal_item,y as sparkle_goal_progress,z as sparkle_goals,D as sparkle_gww,J as sparkle_gww_item,K as sparkle_header,M as sparkle_health,P as sparkle_login,N as sparkle_menu,O as sparkle_menu_toggle,Q as sparkle_mood,U as sparkle_nav,V as sparkle_online_students,W as sparkle_page,X as sparkle_page_footer,Y as sparkle_pagination,Z as sparkle_reset_password,_ as sparkle_root,$ as sparkle_signup,a0 as sparkle_unauthorized,a1 as sparkle_user_enrollment,a2 as sparkle_user_profile,a3 as sparkle_validation_error,a4 as stencil_route,a5 as stencil_route_link,a6 as stencil_route_switch,a7 as stencil_router,a8 as stencil_router_redirect}from"./p-fc739e6b.js";import"./p-f8063d7b.js";import"./p-4b7db0e6.js";import"./p-f2660943.js";import"./p-0e1c7c8c.js";import"./p-c466ee32.js";import"./p-03eb2164.js";import"./p-7840618d.js";import"./p-417a8dd6.js";import"./p-6d506f4e.js";import"./p-6f0ecbe3.js";import"./p-090f2624.js";import"./p-3be0a218.js";
@@ -0,0 +1 @@
1
+ import{r as e,h as t,d as o}from"./p-d63406d8.js";const i=class{constructor(t){e(this,t),this.video_thumbnail=""}componentDidLoad(){this.classMode=this.initialClassMode,this.classModeChanged()}classModeChanged(){if(this.classMode){var e=this.src.match(/youtube\.com.*(\?v=|\/embed\/)(.{11})/).pop();11==e.length&&(this.video_thumbnail="//img.youtube.com/vi/"+e+"/0.jpg")}}classRoomModeChanged(e){this.classMode=e}render(){return t("div",null,this.classMode?t("div",null,t("img",{src:this.video_thumbnail})):t("div",{class:"embed-container"},t("iframe",{src:this.src.replace("watch?v=","embed/"),frameborder:"0",allowFullScreen:!0})))}get el(){return o(this)}static get watchers(){return{classMode:["classModeChanged"]}}};i.style=":host(.loaded) div.youtube-container{opacity:var(--sparkle-youtube-opacity-loaded, 1)}div.youtube-container{opacity:var(--sparkle-youtube-opacity-not-loaded, 0);transition:var(--sparkle-youtube-transition, opacity 0.15s linear)}.embed-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%}.embed-container iframe,.embed-container object,.embed-container embed{position:absolute;top:0;left:0;width:100%;height:100%}";export{i as sparkle_youtube}
@@ -1,3 +1,3 @@
1
- import{c as e,a as t}from"./p-ec2e029e.js";var n=e((function(e){
1
+ import{c as e,a as t}from"./p-fc739e6b.js";var n=e((function(e){
2
2
  /*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */
3
3
  e.exports=function(){var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,i=Object.getOwnPropertyDescriptor,o=Object.freeze,a=Object.seal,l=Object.create,s="undefined"!=typeof Reflect&&Reflect,c=s.apply,f=s.construct;c||(c=function(e,t,n){return e.apply(t,n)}),o||(o=function(e){return e}),a||(a=function(e){return e}),f||(f=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var u,d=k(Array.prototype.forEach),m=k(Array.prototype.pop),p=k(Array.prototype.push),g=k(String.prototype.toLowerCase),h=k(String.prototype.match),y=k(String.prototype.replace),v=k(String.prototype.indexOf),b=k(String.prototype.trim),x=k(RegExp.prototype.test),w=(u=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return f(u,t)});function k(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return c(e,t,r)}}function S(e,r){t&&t(e,null);for(var i=r.length;i--;){var o=r[i];if("string"==typeof o){var a=g(o);a!==o&&(n(r)||(r[i]=a),o=a)}e[o]=!0}return e}function A(t){var n=l(null),r=void 0;for(r in t)c(e,t,[r])&&(n[r]=t[r]);return n}function z(e,t){for(;null!==e;){var n=i(e,t);if(n){if(n.get)return k(n.get);if("function"==typeof n.value)return k(n.value)}e=r(e)}return function(e){return console.warn("fallback value for",e),null}}var j=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),O=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),F=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),T=o(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),D=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),L=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),M=o(["#text"]),R=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns"]),E=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),B=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),q=a(/\{\{[\s\S]*|[\s\S]*\}\}/gm),N=a(/<%[\s\S]*|[\s\S]*%>/gm),I=a(/^data-[\-\w.\u00B7-\uFFFF]/),G=a(/^aria-[\-\w]+$/),C=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),U=a(/^(?:\w+script|data):/i),H=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function W(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var $=function(){return"undefined"==typeof window?null:window},V=function(e,t){if("object"!==(void 0===e?"undefined":P(e))||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$(),n=function(t){return e(t)};if(n.version="2.2.7",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,i=t.document,a=t.DocumentFragment,l=t.HTMLTemplateElement,s=t.Node,c=t.Element,f=t.NodeFilter,u=t.NamedNodeMap,k=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,Y=t.Text,J=t.Comment,K=t.DOMParser,Q=t.trustedTypes,X=c.prototype,Z=z(X,"cloneNode"),ee=z(X,"nextSibling"),te=z(X,"childNodes"),ne=z(X,"parentNode");if("function"==typeof l){var re=i.createElement("template");re.content&&re.content.ownerDocument&&(i=re.content.ownerDocument)}var ie=V(Q,r),oe=ie&&Be?ie.createHTML(""):"",ae=i.implementation,le=i.createNodeIterator,se=i.getElementsByTagName,ce=i.createDocumentFragment,fe=r.importNode,ue={};try{ue=A(i).documentMode?i.documentMode:{}}catch(e){}var de={};n.isSupported="function"==typeof ne&&ae&&void 0!==ae.createHTMLDocument&&9!==ue;var me=q,pe=N,ge=I,he=G,ye=U,ve=H,be=C,xe=null,we=S({},[].concat(W(j),W(O),W(F),W(D),W(M))),ke=null,Se=S({},[].concat(W(R),W(E),W(_),W(B))),Ae=null,ze=null,je=!0,Oe=!0,Fe=!1,Te=!1,De=!1,Le=!1,Me=!1,Re=!1,Ee=!1,_e=!0,Be=!1,qe=!0,Ne=!0,Ie=!1,Ge={},Ce=S({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ue=null,He=S({},["audio","video","img","source","image","track"]),Pe=null,We=S({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),$e=null,Ve=i.createElement("form"),Ye=function(e){$e&&$e===e||(e&&"object"===(void 0===e?"undefined":P(e))||(e={}),e=A(e),xe="ALLOWED_TAGS"in e?S({},e.ALLOWED_TAGS):we,ke="ALLOWED_ATTR"in e?S({},e.ALLOWED_ATTR):Se,Pe="ADD_URI_SAFE_ATTR"in e?S(A(We),e.ADD_URI_SAFE_ATTR):We,Ue="ADD_DATA_URI_TAGS"in e?S(A(He),e.ADD_DATA_URI_TAGS):He,Ae="FORBID_TAGS"in e?S({},e.FORBID_TAGS):{},ze="FORBID_ATTR"in e?S({},e.FORBID_ATTR):{},je=!1!==e.ALLOW_ARIA_ATTR,Oe=!1!==e.ALLOW_DATA_ATTR,Fe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,De=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,_e=!1!==e.RETURN_DOM_IMPORT,Be=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,qe=!1!==e.SANITIZE_DOM,Ne=!1!==e.KEEP_CONTENT,Ie=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||be,(Te=e.SAFE_FOR_TEMPLATES||!1)&&(Oe=!1),(Ee=e.RETURN_DOM_FRAGMENT||!1)&&(Re=!0),(Ge="USE_PROFILES"in e&&e.USE_PROFILES)&&(xe=S({},[].concat(W(M))),ke=[],!0===Ge.html&&(S(xe,j),S(ke,R)),!0===Ge.svg&&(S(xe,O),S(ke,E),S(ke,B)),!0===Ge.svgFilters&&(S(xe,F),S(ke,E),S(ke,B)),!0===Ge.mathMl&&(S(xe,D),S(ke,_),S(ke,B))),e.ADD_TAGS&&(xe===we&&(xe=A(xe)),S(xe,e.ADD_TAGS)),e.ADD_ATTR&&(ke===Se&&(ke=A(ke)),S(ke,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&S(Pe,e.ADD_URI_SAFE_ATTR),Ne&&(xe["#text"]=!0),De&&S(xe,["html","head","body"]),xe.table&&(S(xe,["tbody"]),delete Ae.tbody),o&&o(e),$e=e)},Je=S({},["mi","mo","mn","ms","mtext"]),Ke=S({},["foreignobject","desc","title","annotation-xml"]),Qe=S({},O);S(Qe,F),S(Qe,T);var Xe=S({},D);S(Xe,L);var Ze="http://www.w3.org/1998/Math/MathML",et="http://www.w3.org/2000/svg",tt="http://www.w3.org/1999/xhtml",nt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:tt,tagName:"template"});var n=g(e.tagName),r=g(t.tagName);if(e.namespaceURI===et)return t.namespaceURI===tt?"svg"===n:t.namespaceURI===Ze?"svg"===n&&("annotation-xml"===r||Je[r]):Boolean(Qe[n]);if(e.namespaceURI===Ze)return t.namespaceURI===tt?"math"===n:t.namespaceURI===et?"math"===n&&Ke[r]:Boolean(Xe[n]);if(e.namespaceURI===tt){if(t.namespaceURI===et&&!Ke[r])return!1;if(t.namespaceURI===Ze&&!Je[r])return!1;var i=S({},["title","style","font","a","script"]);return!Xe[n]&&(i[n]||!Qe[n])}return!1},rt=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=oe}catch(t){e.remove()}}},it=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ke[e])if(Re||Ee)try{rt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ot=function(e){var t=void 0,n=void 0;if(Me)e="<remove></remove>"+e;else{var r=h(e,/^[\r\n\t ]+/);n=r&&r[0]}var o=ie?ie.createHTML(e):e;try{t=(new K).parseFromString(o,"text/html")}catch(e){}if(!t||!t.documentElement){var a=(t=ae.createHTMLDocument("")).body;a.parentNode.removeChild(a.parentNode.firstElementChild),a.outerHTML=o}return e&&n&&t.body.insertBefore(i.createTextNode(n),t.body.childNodes[0]||null),se.call(t,De?"html":"body")[0]},at=function(e){return le.call(e.ownerDocument||e,e,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT,(function(){return f.FILTER_ACCEPT}),!1)},lt=function(e){return!(e instanceof Y||e instanceof J||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof k&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},st=function(e){return"object"===(void 0===s?"undefined":P(s))?e instanceof s:e&&"object"===(void 0===e?"undefined":P(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},ct=function(e,t,r){de[e]&&d(de[e],(function(e){e.call(n,t,r,$e)}))},ft=function(e){var t=void 0;if(ct("beforeSanitizeElements",e,null),lt(e))return rt(e),!0;if(h(e.nodeName,/[\u0080-\uFFFF]/))return rt(e),!0;var r=g(e.nodeName);if(ct("uponSanitizeElement",e,{tagName:r,allowedTags:xe}),!st(e.firstElementChild)&&(!st(e.content)||!st(e.content.firstElementChild))&&x(/<[/\w]/g,e.innerHTML)&&x(/<[/\w]/g,e.textContent))return rt(e),!0;if(!xe[r]||Ae[r]){if(Ne&&!Ce[r]){var i=ne(e),o=te(e);if(o&&i)for(var a=o.length-1;a>=0;--a)i.insertBefore(Z(o[a],!0),ee(e))}return rt(e),!0}return e instanceof c&&!nt(e)?(rt(e),!0):"noscript"!==r&&"noembed"!==r||!x(/<\/no(script|embed)/i,e.innerHTML)?(Te&&3===e.nodeType&&(t=y(t=e.textContent,me," "),t=y(t,pe," "),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),ct("afterSanitizeElements",e,null),!1):(rt(e),!0)},ut=function(e,t,n){if(qe&&("id"===t||"name"===t)&&(n in i||n in Ve))return!1;if(Oe&&x(ge,t));else if(je&&x(he,t));else{if(!ke[t]||ze[t])return!1;if(Pe[t]);else if(x(be,y(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!Ue[e])if(Fe&&!x(ye,y(n,ve,"")));else if(n)return!1}return!0},dt=function(e){var t=void 0,r=void 0,i=void 0,o=void 0;ct("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ke};for(o=a.length;o--;){var s=(t=a[o]).name,c=t.namespaceURI;if(r=b(t.value),i=g(s),l.attrName=i,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,ct("uponSanitizeAttribute",e,l),r=l.attrValue,!l.forceKeepAttr&&(it(s,e),l.keepAttr))if(x(/\/>/i,r))it(s,e);else{Te&&(r=y(r,me," "),r=y(r,pe," "));var f=e.nodeName.toLowerCase();if(ut(f,i,r))try{c?e.setAttributeNS(c,s,r):e.setAttribute(s,r),m(n.removed)}catch(e){}}}ct("afterSanitizeAttributes",e,null)}},mt=function e(t){var n=void 0,r=at(t);for(ct("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)ct("uponSanitizeShadowNode",n,null),ft(n)||(n.content instanceof a&&e(n.content),dt(n));ct("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,i){var o=void 0,l=void 0,c=void 0,f=void 0,u=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!st(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!n.isSupported){if("object"===P(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(st(e))return t.toStaticHTML(e.outerHTML)}return e}if(Le||Ye(i),n.removed=[],"string"==typeof e&&(Ie=!1),Ie);else if(e instanceof s)1===(l=(o=ot("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?o=l:o.appendChild(l);else{if(!Re&&!Te&&!De&&-1===e.indexOf("<"))return ie&&Be?ie.createHTML(e):e;if(!(o=ot(e)))return Re?null:oe}o&&Me&&rt(o.firstChild);for(var d=at(Ie?e:o);c=d.nextNode();)3===c.nodeType&&c===f||ft(c)||(c.content instanceof a&&mt(c.content),dt(c),f=c);if(f=null,Ie)return e;if(Re){if(Ee)for(u=ce.call(o.ownerDocument);o.firstChild;)u.appendChild(o.firstChild);else u=o;return _e&&(u=fe.call(r,u,!0)),u}var m=De?o.outerHTML:o.innerHTML;return Te&&(m=y(m,me," "),m=y(m,pe," ")),ie&&Be?ie.createHTML(m):m},n.setConfig=function(e){Ye(e),Le=!0},n.clearConfig=function(){$e=null,Le=!1},n.isValidAttribute=function(e,t,n){$e||Ye({});var r=g(e),i=g(t);return ut(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(de[e]=de[e]||[],p(de[e],t))},n.removeHook=function(e){de[e]&&m(de[e])},n.removeHooks=function(e){de[e]&&(de[e]=[])},n.removeAllHooks=function(){de={}},n}()}()}));const r=Object.freeze(Object.assign(Object.create(null),n,{default:n}));export{r as p}
@@ -0,0 +1 @@
1
+ import{r as t,h as i,a as s,d as e}from"./p-d63406d8.js";class a{constructor(){this.pItems={}}fromSrt(t,i){var s=!!i;(t=(t=t.replace(/\r/g,"")).split(/(\d+)\n(\d{2}:\d{2}:\d{2},\d{3}) --> (\d{2}:\d{2}:\d{2},\d{3})/g)).shift();for(var e={},a=0;a<t.length;a+=4)e[s?this.timeS(t[a+1].trim()):t[a+1].trim()]=t[a+3].trim();return e}toSrt(t){if(!(t instanceof Array))return"";for(var i="",s=0;s<t.length;s++){var e=t[s];isNaN(e.startTime)||isNaN(e.endTime)||(e.startTime=this.msTime(parseInt(e.startTime,10)),e.endTime=this.msTime(parseInt(e.endTime,10))),i+=e.id+"\r\n",i+=e.startTime+" --\x3e "+e.endTime+"\r\n",i+=e.text.replace("\n","\r\n")+"\r\n\r\n"}return i}timeS(t){var i=/(\d+):(\d{2}):(\d{2}),(\d{3})/.exec(t);if(null===i)return 0;for(var s=1;s<5;s++)i[s]=parseInt(i[s],10).toString(),isNaN(parseInt(i[s],10))&&(i[s]="0");return 3600*parseInt(i[1],10)+60*parseInt(i[2],10)+parseInt(i[3],10)+Math.floor(parseInt(i[4],10)/1e3)}msTime(t){var i=[36e5,6e4,1e3],s=[];for(var e in i){var a=(t/i[e]>>0).toString();a.length<2&&(a="0"+a),t%=i[e],s.push(a)}var n=t.toString();if(n.length<3)for(let t=0;t<=3-n.length;t++)n="0"+n;return s.join(":")+","+n}}const n=class{constructor(i){t(this,i),this.showCaption=!1,this.paused=!0,this.dataLoaded=!1,this.currentProgressWidth=0,this.captionText="",this.firstFramePath="",this.isBusy=!1,this.animationVideoProgress="0",this.captionData={}}closedCaptionChange(t){this.showCaption=!this.showCaption}componentWillLoad(){this.classMode=this.initialClassMode;const t=document.createElement("script");this.firstFramePath=this.src.replace(".js",".png"),t.src=this.src,document.body.appendChild(t),this.readTextFile(this.src.replace(".js",".srt")),this.rergisterSoundControls()}readTextFile(t){let i=this;var s=new XMLHttpRequest;s.open("GET",t,!1),s.onreadystatechange=function(){if(4===s.readyState&&(200===s.status||0==s.status)){var t=s.responseText,e=new a;i.captionData=e.fromSrt(t,!0)}},s.send(null)}isScriptLoaded(t){for(var i=document.getElementsByTagName("script"),s=i.length;s--;)if(i[s].getAttribute("src")==t)return!0;return!1}rergisterSoundControls(){window.playSound=t=>(this.sound&&this.sound.stop(),this.sound=createjs.Sound.play(t,{interrupt:createjs.Sound.INTERRUPT_EARLY,loop:0,volume:1}),this.sound),window.resetToStart=()=>{console.log("reset"),this.rewindAnimationToStart()}}startLoading(){this.isBusy=!0,this.paused=!1}doneLoading(){this.isBusy=!1,this.dataLoaded=!0,this.paused=!1}handleFileLoad(t){var i=this.comp.getImages();t&&"image"==t.item.type&&(i[t.item.id]=t.result)}handleQueueProgress(t){return t=>{this.animationVideoProgress=t.loaded?(100*t.loaded).toFixed(0):"0",1==t.loaded&&this.doneLoading()}}handleComplete(t){for(var i=this.comp.getSpriteSheet(),s=t.target,e=this.library.ssMetadata,a=0;a<e.length;a++)i[e[a].name]=new createjs.SpriteSheet({images:[s.getResult(e[a].name)],frames:e[a].frames});var n=this.src.substring(this.src.lastIndexOf("/")+1,this.src.lastIndexOf("."));this.exportRoot=new this.library[n],this.stage=new this.library.Stage(this.canvas),this.makeResponsive(!0,"both",!1,1),AdobeAn.compositionLoaded(this.library.properties.id),this.stage.addChild(this.exportRoot),createjs.Ticker.framerate=this.library.properties.fps,createjs.Ticker.paused=!1,createjs.Ticker.addEventListener("tick",this.stage),createjs.Ticker.addEventListener("tick",(t=>{this.tickHandler(t)})),console.log(createjs.Ticker)}loadAnimation(){this.startLoading(),createjs.Sound.initializeDefaultPlugins()&&(this.canvas=this.el.querySelector(".video-canvas"),this.anim_container=this.el.querySelector(".canvas-container"),this.comp=AdobeAn.getComposition(this.composition),this.canvas.style.width="100%",console.log(this.canvas.offsetWidth),this.canvas.style.height=this.canvas.offsetWidth+"px",this.anim_container.style.height=this.canvas.offsetWidth+"px",this.library=this.comp.getLibrary(),this.loader=new createjs.LoadQueue(!1),this.loader.setMaxConnections(3),this.loader.maintainScriptOrder=!0,this.loader.installPlugin(createjs.Sound),this.loader.addEventListener("complete",(t=>{this.handleComplete(t)})),this.loader.addEventListener("fileload",(t=>{this.handleFileLoad(t)})),this.loader.addEventListener("progress",this.handleQueueProgress(this)),this.loader.loadManifest(this.library.properties.manifest,!0,this.src.substring(0,this.src.lastIndexOf("/")+1)))}playButtonAction(){this.dataLoaded?this.playPauseAnimation():this.loadAnimation()}playPauseAnimation(){createjs.Ticker.paused?this.playAnimation():this.pauseAnimation()}async playAnimation(){if(null!=this.loader&&this.loader.close(),createjs&&createjs.Ticker){let t=!1,i=this.sound;i&&(i.paused=t),createjs.Ticker.paused=t,createjs.Ticker.addEventListener("tick",this.stage),this.paused=t}}async pauseAnimation(){if(null!=this.loader&&this.loader.close(),createjs&&createjs.Ticker){let t=!0,i=this.sound;i&&(i.paused=t),createjs.Ticker.paused=t,createjs.Ticker.removeEventListener("tick",this.stage),this.paused=t}}disconnectedCallback(){this.pauseAnimation(),createjs.Sound.removeAllSounds()}async classRoomModeChanged(t){this.classMode=t}async destroyAnimation(){this.pauseAnimation()}makeResponsive(t,i,s,e){window.addEventListener("resize",(()=>this.resizeCanvas(t,i,s,e))),this.resizeCanvas(t,i,s,e)}resizeCanvas(t,i,s,e){var a,n,o=1,r=this.library.properties.width,h=this.library.properties.height,l=window.innerWidth,c=window.innerHeight,d=window.devicePixelRatio||1,p=l/r,u=c/h,v=1;t&&("width"==i&&a==l||"height"==i&&n==c?v=o:s?1==e?v=Math.min(p,u):2==e&&(v=Math.max(p,u)):(l<r||c<h)&&(v=Math.min(p,u)));var g=this.el.querySelector(".canvas-container");this.canvas.width=r*d*v,this.canvas.height=h*d*v,this.canvas.style.width="100%",this.canvas.style.height=this.canvas.offsetWidth+"px",g.style.height=this.canvas.offsetWidth+"px",this.stage.scaleX=d*v,this.stage.scaleY=d*v,a=l,n=c,o=v,this.sizeOfCanvas=this.canvas.offsetWidth;var m=this.el.querySelector(".progressBar");this.sizeofProgressBar=m.offsetWidth,this.stage.tickOnUpdate=!1,this.stage.update(),this.stage.tickOnUpdate=!0}tickHandler(t){t.paused||(this.timeline=this.stage.children[0].timeline,this.captionData[Math.floor(this.timeline.position/this.library.properties.fps)]&&(this.captionText=this.captionData[Math.floor(this.timeline.position/this.library.properties.fps)]),this.timeline.position%10==0&&(this.currentProgressWidth=parseFloat((this.timeline.position/this.timeline.duration*this.sizeofProgressBar).toFixed(0))))}rewindAnimationTo(t){let i=this.sound;i&&(i.paused=!0);let s=this.stage.children[0],e=s.timeline;t<0&&(t=0),t>e.duration&&(t=e.duration-10),this.paused?(s.gotoAndStop(t),this.stage.update(),i&&!i.getPaused()&&(createjs.Ticker.paused=!0)):(s.gotoAndPlay(t),createjs.Ticker.paused=!1)}rewindAnimationToStart(){this.paused=!0,this.rewindAnimationTo(0)}rewindAnimation(t){t.stopPropagation();let i=Math.round(t.offsetX/this.sizeofProgressBar*this.stage.children[0].timeline.duration);this.rewindAnimationTo(i)}rewind5Sec(){this.rewindAnimationTo(this.stage.children[0].timeline.position-5*this.library.properties.fps)}fastForward5Sec(){this.rewindAnimationTo(this.stage.children[0].timeline.position+5*this.library.properties.fps)}muteVolume(){let t=this.sound;t&&(t.volume=0)}downVolume(){let t=this.sound;t&&t._getVolume()>.9&&(t.volume=t._getVolume()-.1)}upVolume(){let t=this.sound;t&&t._getVolume()<1&&(t.volume=t._getVolume()+.1)}render(){return i("div",{class:"cavase-main-container"},i("div",{class:"canvas-container",id:"canvas-container"},this.classMode?"":i("div",null,i("canvas",{class:"video-canvas",onClick:()=>this.playButtonAction()}),this.showCaption?i("div",{class:"caption"},this.captionText):""),this.dataLoaded?"":i("img",{class:"frame-img",src:this.firstFramePath}),this.classMode?i("img",{class:"overlay-img",src:s("./assets/play-button-disabled-overlay.png")}):"",!this.classMode&&this.paused?i("img",{class:"overlay-img",onClick:()=>this.playButtonAction(),src:s("./assets/play-button-overlay.png")}):"",this.isBusy?i("div",{class:"loading-container"},i("div",{class:"uil-ring-css"},i("div",null),i("a",null,"Loading ",this.animationVideoProgress,"%"))):""),this.dataLoaded?i("div",{class:"navControls"},i("div",{class:"progressBar",onClick:t=>this.rewindAnimation(t)},i("div",{class:"currentProgress",style:{width:this.currentProgressWidth+"px"}})),i("div",{class:"button-panel"},i("ion-button",{size:"small",color:"transperant",onClick:()=>this.rewind5Sec()}," ",i("ion-icon",{name:"play-back-outline"})," "),i("ion-button",{size:"small",color:"transperant",onClick:()=>this.playButtonAction()}," ",i("ion-icon",this.paused?{name:"pause-outline"}:{name:"play-outline"})),i("ion-button",{size:"small",color:"transperant",onClick:()=>this.fastForward5Sec()}," ",i("ion-icon",{name:"play-forward-outline"})))):"",this.dataLoaded&&this.captionText?i("div",{class:"closed-caption"},i("ion-item",{lines:"none"},i("ion-label",null,"Closed Caption"),i("ion-toggle",{slot:"end",color:"primary",checked:this.showCaption}))):"")}static get assetsDirs(){return["assets"]}get el(){return e(this)}};n.style='.video-canvas{position:absolute;display:block;background-color:#f5f5f5;width:auto}.closed-caption{justify-content:flex-end;width:100%;display:flex}sparkle-animation-player{width:100%;margin:0 auto}.caption{position:absolute;bottom:0px;color:white;text-align:center;width:100%;text-shadow:1px 1px 2px #e50539}.canvas-container{width:680px;height:680px;background-color:#f5f5f5;border-radius:10px;position:relative}.frame-img{position:absolute;display:block;max-width:100%;width:100%;height:auto}.overlay-img{position:absolute;z-index:9999;top:0px;display:block;max-width:100%;width:100%;height:auto}.button-panel{display:flex;justify-content:center}ion-icon{color:var(--ion-color-primary)}.navControls{width:680px;background:transparent;border-radius:10px;position:relative;padding-top:15px;display:flex;flex-direction:column;align-items:center}.navControls .progressBar{flex:100%;border-radius:20px;position:relative;left:0;right:0;height:4px;background-color:rgba(205, 205, 205, 0.7);width:100%}.navControls .progressBar .currentProgress{border-radius:20px;position:absolute;height:25px;background-color:var(--ion-color-primary);transition:width 0.5s;width:100%}.navControls .progressBar .currentProgress:before{position:absolute;top:62%;right:4px;content:" ";display:block;width:12px;height:12px;margin-top:-10px;background:#e5053a;border-radius:10px;border:4px solid #d9d4d4;z-index:10}#dom_overlay_container{pointer-events:none;overflow:hidden;position:absolute;left:0px;top:0px;display:block}.cavase-main-container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;padding:15px;background-position:center;background-size:cover;background-repeat:no-repeat}.loading-container{height:100%;display:flex;justify-content:center;align-items:center}.uil-ring-css{position:absolute}ion-button{--ion-color-base:transparent;--ion-color-contrast:var(--ion-color-primary);--box-shadow:none !important}@media screen and (min-width: 760px){.navControls{flex-direction:row}.navControls .progressBar{height:24px;flex:75%;width:75%}.button-panel{flex:25%;width:25%}}';export{n as sparkle_animation_player}