index.8b460b16.js 126 KB

12
  1. var Ht=Object.defineProperty,Vt=Object.defineProperties;var Ft=Object.getOwnPropertyDescriptors;var ye=Object.getOwnPropertySymbols;var Je=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable;var Qe=Math.pow,Ye=(e,i,t)=>i in e?Ht(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t,V=(e,i)=>{for(var t in i||(i={}))Je.call(i,t)&&Ye(e,t,i[t]);if(ye)for(var t of ye(i))Ge.call(i,t)&&Ye(e,t,i[t]);return e},ne=(e,i)=>Vt(e,Ft(i));var Xe=(e,i)=>{var t={};for(var s in e)Je.call(e,s)&&i.indexOf(s)<0&&(t[s]=e[s]);if(e!=null&&ye)for(var s of ye(e))i.indexOf(s)<0&&Ge.call(e,s)&&(t[s]=e[s]);return t};var U=(e,i,t)=>new Promise((s,a)=>{var n=c=>{try{o(t.next(c))}catch(u){a(u)}},l=c=>{try{o(t.throw(c))}catch(u){a(u)}},o=c=>c.done?s(c.value):Promise.resolve(c.value).then(n,l);o((t=t.apply(e,i)).next())});import{T as Bt}from"./index.e59b975b.js";import{k as Ut}from"./knowledgeTypeData.3b15dd0b.js";import{d as Ee,ai as dt,u as Fe,a as ie,r as Wt,B as ht,U as zt,i as w,l as X,aj as _e,N as Kt,a0 as Yt,_ as Jt,a9 as te,p as W,k as H,cg as mt,ao as Gt,b as Qt,q as Ze,di as et,db as ae,ae as Xt,bn as Zt,e as ei,c as ti,H as be,at as ii,dm as si,aa as ni,dp as tt,bC as ve}from"./index.4b748407.js";import{q as ai,r as li,s as ri,t as oi,v as ci}from"./api.637af224.js";import{S as ui}from"./index.6bbb4f91.js";import{P as di}from"./index.c7cee102.js";import{f as hi}from"./api.32f07a11.js";import{N as mi}from"./Cascader.99821734.js";import{N as pi}from"./PageHeader.8336533b.js";import"./tabsView.4d342dfd.js";import"./searchs.b637f0d6.js";const gi={VIDEO:"\u89C6\u9891",IMG:"\u89C6\u9891",SONG:"\u66F2\u76EE"},fi=Ee({name:"addMaterialTraining",props:{parentData:{type:Object,default:()=>{}}},emits:["close","handleSuccess"],setup(e,{emit:i}){console.log("\u{1F680} ~ props",e.parentData.id),dt();const t=Fe(),s=ie({loading:!1,saveLoading:!1,pagination:{page:1,rows:10,pageTotal:10},dataList:[],checkList:[],selectCheckList:[]}),a=ie({keyword:"",knowledgePointIds:null}),n=ie({list:[],index:-1,loading:!1}),l=()=>U(this,null,function*(){try{const{data:m}=yield hi({courseTypeCode:e.parentData.courseTypeCode,page:1,rows:1e3});console.log(m);const p=m.rows||[];n.list=p}catch(m){}}),o=()=>[{type:"selection",disabled(m){return!m.knowledgePointId}},{title:"\u7D20\u6750\u540D\u79F0",key:"materialName",fixed:"left"},{title:"\u7D20\u6750\u7C7B\u578B",key:"materialCategoryName",render(m){return gi[m.type]}},{title:"\u5206\u6BB5\u7F16\u53F7",key:"sn"},{title:"\u8BFE\u7A0B\u7C7B\u578B",key:"courseTypeName",width:200,ellipsis:!0,render(m){return w(Gt,{placement:"left-start"},{default:()=>m.courseTypeName,trigger:()=>m.courseTypeName})}},{title:"\u77E5\u8BC6\u70B9\u5206\u7C7B",key:"knowledgePointName"}],c=Wt(),u=()=>{s.pagination.page=1,h()},d=()=>{var m;(m=c.value)==null||m.submit()},v=()=>{a.knowledgePointIds=null,a.keyword="",d()},h=()=>U(this,null,function*(){try{s.loading=!0;const m=ne(V({lessonTrainingId:e.parentData.id},a),{courseTypeCode:e.parentData.courseTypeCode,page:s.pagination.page,rows:s.pagination.rows,knowledgePointId:null}),{data:p}=yield ai(m);s.loading=!1,s.pagination.pageTotal=Number(p.total);const A=p.rows||[];A.forEach(T=>{T.tempIndex=new Date().getTime()+""+Math.random()}),console.log(A,"rows"),s.dataList=A}catch(m){s.loading=!1}});ht(()=>U(this,null,function*(){yield l(),zt(()=>U(this,null,function*(){yield h()}))}));const b=()=>U(this,null,function*(){s.saveLoading=!0;const m=s.checkList.map(p=>{const A=s.selectCheckList.find(T=>T.tempIndex===p);return{materialId:A.materialId,knowledgePointId:A.knowledgePointId,lessonTrainingId:e.parentData.id}});try{const p=yield li(m);t.success("\u4FDD\u5B58\u6210\u529F"),i("handleSuccess")}catch(p){}s.saveLoading=!1});return()=>w(_e,null,[w(ui,{style:{padding:0,boxShadow:"none"},ref:c,"label-width":"",model:a,onSubmit:u,onSetModel:m=>Object.assign(a,m),saveKey:"addMaterialTraining-abc-key-class"},{default:()=>[w(X,{label:"\u77E5\u8BC6\u70B9\u5206\u7C7B",path:"knowledgePointIds"},{default:()=>[w(mi,{value:a.knowledgePointIds,"onUpdate:value":m=>a.knowledgePointIds=m,options:n.list,multiple:!0,clearable:!0,filterable:!0,childrenField:"children",expandTrigger:"hover",valueField:"id",labelField:"name",checkStrategy:"all",cascade:!0,showPath:!0,maxTagCount:"responsive"},{empty:()=>n.loading?w(_e,null,[w(Kt,{description:"\u52A0\u8F7D\u4E2D"},{icon:()=>w(Yt,{size:"30"},{default:()=>[w("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},[w("path",{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 0 0-94.3-139.9a437.71 437.71 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36z",fill:"currentColor"},null)])]})})]):null})]}),w(X,{label:"\u7D20\u6750\u540D\u79F0/\u7F16\u53F7",path:"keyword"},{default:()=>[w(Jt,{value:a.keyword,"onUpdate:value":m=>a.keyword=m,onKeydown:m=>{m.code==="Enter"&&u()},clearable:!0},null)]}),w(X,null,{default:()=>[w(te,null,{default:()=>[w(W,{type:"primary",onClick:d},{default:()=>[H("\u641C\u7D22")]}),w(W,{type:"default",onClick:v},{default:()=>[H("\u91CD\u7F6E")]})]})]})]}),w(mt,{loading:s.loading,maxHeight:"calc(100vh - 270px)",rowKey:m=>m.tempIndex,columns:o(),data:s.dataList,checkedRowKeys:s.checkList,"onUpdate:checkedRowKeys":[m=>s.checkList=m,(m,p,A)=>{const T=[];s.selectCheckList.forEach(S=>{s.checkList.includes(S.tempIndex)&&T.push(S)}),s.checkList.forEach(S=>{const f=s.dataList.find(I=>I.tempIndex===S);s.selectCheckList.findIndex(I=>I.tempIndex===S)<=-1&&T.push(f)}),s.selectCheckList=[...T]}]},null),w(di,{page:s.pagination.page,"onUpdate:page":m=>s.pagination.page=m,pageTotal:s.pagination.pageTotal,"onUpdate:pageTotal":m=>s.pagination.pageTotal=m,pageSize:s.pagination.rows,"onUpdate:pageSize":m=>s.pagination.rows=m,onList:h,sync:!0,saveKey:"addMaterialTraining-abc-key-class"},null),w(W,{type:"primary",disabled:!s.checkList.length,loading:s.saveLoading,onClick:()=>b()},{default:()=>[H("\u786E\u8BA4")]})])}}),yi="_plyr__poster_1xm4u_9",bi={"video-container":"_video-container_1xm4u_1",plyr__poster:yi};function y(e,i,t){return(i=wi(i))in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}function vi(e,i){if(typeof e!="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var s=t.call(e,i||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(e)}function wi(e){var i=vi(e,"string");return typeof i=="symbol"?i:String(i)}function Ti(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}function it(e,i){for(var t=0;t<i.length;t++){var s=i[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function ki(e,i,t){return i&&it(e.prototype,i),t&&it(e,t),e}function Ci(e,i,t){return i in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}function st(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);i&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,s)}return t}function nt(e){for(var i=1;i<arguments.length;i++){var t=arguments[i]!=null?arguments[i]:{};i%2?st(Object(t),!0).forEach(function(s){Ci(e,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):st(Object(t)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(t,s))})}return e}var at={addCSS:!0,thumbWidth:15,watch:!0};function Si(e,i){return function(){return Array.from(document.querySelectorAll(i)).includes(this)}.call(e,i)}function Ai(e,i){if(e&&i){var t=new Event(i,{bubbles:!0});e.dispatchEvent(t)}}var me=function(e){return e!=null?e.constructor:null},Be=function(e,i){return!!(e&&i&&e instanceof i)},pt=function(e){return e==null},gt=function(e){return me(e)===Object},Ei=function(e){return me(e)===Number&&!Number.isNaN(e)},ft=function(e){return me(e)===String},Pi=function(e){return me(e)===Boolean},xi=function(e){return me(e)===Function},yt=function(e){return Array.isArray(e)},bt=function(e){return Be(e,NodeList)},Mi=function(e){return Be(e,Element)},Ni=function(e){return Be(e,Event)},Ii=function(e){return pt(e)||(ft(e)||yt(e)||bt(e))&&!e.length||gt(e)&&!Object.keys(e).length},j={nullOrUndefined:pt,object:gt,number:Ei,string:ft,boolean:Pi,function:xi,array:yt,nodeList:bt,element:Mi,event:Ni,empty:Ii};function Li(e){var i="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return i?Math.max(0,(i[1]?i[1].length:0)-(i[2]?+i[2]:0)):0}function $i(e,i){if(1>i){var t=Li(i);return parseFloat(e.toFixed(t))}return Math.round(e/i)*i}var _i=function(){function e(i,t){Ti(this,e),j.element(i)?this.element=i:j.string(i)&&(this.element=document.querySelector(i)),j.element(this.element)&&j.empty(this.element.rangeTouch)&&(this.config=nt({},at,{},t),this.init())}return ki(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(i){var t=this,s=i?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(a){t.element[s](a,function(n){return t.set(n)},!1)})}},{key:"get",value:function(i){if(!e.enabled||!j.event(i))return null;var t,s=i.target,a=i.changedTouches[0],n=parseFloat(s.getAttribute("min"))||0,l=parseFloat(s.getAttribute("max"))||100,o=parseFloat(s.getAttribute("step"))||1,c=s.getBoundingClientRect(),u=100/c.width*(this.config.thumbWidth/2)/100;return 0>(t=100/c.width*(a.clientX-c.left))?t=0:100<t&&(t=100),50>t?t-=(100-2*t)*u:50<t&&(t+=2*(t-50)*u),n+$i(t/100*(l-n),o)}},{key:"set",value:function(i){e.enabled&&j.event(i)&&!i.target.disabled&&(i.preventDefault(),i.target.value=this.get(i),Ai(i.target,i.type==="touchend"?"change":"input"))}}],[{key:"setup",value:function(i){var t=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},s=null;if(j.empty(i)||j.string(i)?s=Array.from(document.querySelectorAll(j.string(i)?i:'input[type="range"]')):j.element(i)?s=[i]:j.nodeList(i)?s=Array.from(i):j.array(i)&&(s=i.filter(j.element)),j.empty(s))return null;var a=nt({},at,{},t);if(j.string(i)&&a.watch){var n=new MutationObserver(function(l){Array.from(l).forEach(function(o){Array.from(o.addedNodes).forEach(function(c){j.element(c)&&Si(c,i)&&new e(c,a)})})});n.observe(document.body,{childList:!0,subtree:!0})}return s.map(function(l){return new e(l,t)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const pe=e=>e!=null?e.constructor:null,K=(e,i)=>Boolean(e&&i&&e instanceof i),Ue=e=>e==null,vt=e=>pe(e)===Object,Oi=e=>pe(e)===Number&&!Number.isNaN(e),Pe=e=>pe(e)===String,Di=e=>pe(e)===Boolean,wt=e=>typeof e=="function",Tt=e=>Array.isArray(e),ji=e=>K(e,WeakMap),kt=e=>K(e,NodeList),Ri=e=>pe(e)===Text,qi=e=>K(e,Event),Hi=e=>K(e,KeyboardEvent),Vi=e=>K(e,window.TextTrackCue)||K(e,window.VTTCue),Fi=e=>K(e,TextTrack)||!Ue(e)&&Pe(e.kind),Bi=e=>K(e,Promise)&&wt(e.then),Ui=e=>e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object",Ct=e=>Ue(e)||(Pe(e)||Tt(e)||kt(e))&&!e.length||vt(e)&&!Object.keys(e).length,Wi=e=>{if(K(e,window.URL))return!0;if(!Pe(e))return!1;let i=e;e.startsWith("http://")&&e.startsWith("https://")||(i=`http://${e}`);try{return!Ct(new URL(i).hostname)}catch(t){return!1}};var r={nullOrUndefined:Ue,object:vt,number:Oi,string:Pe,boolean:Di,function:wt,array:Tt,weakMap:ji,nodeList:kt,element:Ui,textNode:Ri,event:qi,keyboardEvent:Hi,cue:Vi,track:Fi,promise:Bi,url:Wi,empty:Ct};const Oe=(()=>{const e=document.createElement("span"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},t=Object.keys(i).find(s=>e.style[s]!==void 0);return!!r.string(t)&&i[t]})();function St(e,i){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(t){}},i)}const zi=Boolean(window.document.documentMode),Ki=/Edge/g.test(navigator.userAgent),Yi="WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),Ji=/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,Gi=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Qi=/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var D={isIE:zi,isEdge:Ki,isWebKit:Yi,isIPhone:Ji,isIPadOS:Gi,isIos:Qi};function Xi(e){return JSON.parse(JSON.stringify(e))}function At(e,i){return i.split(".").reduce((t,s)=>t&&t[s],e)}function L(e={},...i){if(!i.length)return e;const t=i.shift();return r.object(t)?(Object.keys(t).forEach(s=>{r.object(t[s])?(Object.keys(e).includes(s)||Object.assign(e,{[s]:{}}),L(e[s],t[s])):Object.assign(e,{[s]:t[s]})}),L(e,...i)):e}function Et(e,i){const t=e.length?e:[e];Array.from(t).reverse().forEach((s,a)=>{const n=a>0?i.cloneNode(!0):i,l=s.parentNode,o=s.nextSibling;n.appendChild(s),o?l.insertBefore(n,o):l.appendChild(n)})}function De(e,i){r.element(e)&&!r.empty(i)&&Object.entries(i).filter(([,t])=>!r.nullOrUndefined(t)).forEach(([t,s])=>e.setAttribute(t,s))}function k(e,i,t){const s=document.createElement(e);return r.object(i)&&De(s,i),r.string(t)&&(s.innerText=t),s}function Zi(e,i){r.element(e)&&r.element(i)&&i.parentNode.insertBefore(e,i.nextSibling)}function lt(e,i,t,s){r.element(i)&&i.appendChild(k(e,t,s))}function z(e){r.nodeList(e)||r.array(e)?Array.from(e).forEach(z):r.element(e)&&r.element(e.parentNode)&&e.parentNode.removeChild(e)}function we(e){if(!r.element(e))return;let{length:i}=e.childNodes;for(;i>0;)e.removeChild(e.lastChild),i-=1}function Ce(e,i){return r.element(i)&&r.element(i.parentNode)&&r.element(e)?(i.parentNode.replaceChild(e,i),e):null}function F(e,i){if(!r.string(e)||r.empty(e))return{};const t={},s=L({},i);return e.split(",").forEach(a=>{const n=a.trim(),l=n.replace(".",""),o=n.replace(/[[\]]/g,"").split("="),[c]=o,u=o.length>1?o[1].replace(/["']/g,""):"";switch(n.charAt(0)){case".":r.string(s.class)?t.class=`${s.class} ${l}`:t.class=l;break;case"#":t.id=n.replace("#","");break;case"[":t[c]=u}}),L(s,t)}function Q(e,i){if(!r.element(e))return;let t=i;r.boolean(t)||(t=!e.hidden),e.hidden=t}function M(e,i,t){if(r.nodeList(e))return Array.from(e).map(s=>M(s,i,t));if(r.element(e)){let s="toggle";return t!==void 0&&(s=t?"add":"remove"),e.classList[s](i),e.classList.contains(i)}return!1}function Se(e,i){return r.element(e)&&e.classList.contains(i)}function Z(e,i){const{prototype:t}=Element;return(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||function(){return Array.from(document.querySelectorAll(i)).includes(this)}).call(e,i)}function es(e,i){const{prototype:t}=Element;return(t.closest||function(){let s=this;do{if(Z.matches(s,i))return s;s=s.parentElement||s.parentNode}while(s!==null&&s.nodeType===1);return null}).call(e,i)}function ce(e){return this.elements.container.querySelectorAll(e)}function _(e){return this.elements.container.querySelector(e)}function Ne(e=null,i=!1){r.element(e)&&e.focus({preventScroll:!0,focusVisible:i})}const rt={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},$={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,i){const t=$[e]||i!=="html5";return{api:t,ui:t&&$.rangeInput}},pip:!(D.isIPhone||!r.function(k("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||k("video").disablePictureInPicture)),airplay:r.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(r.empty(e))return!1;const[i]=e.split("/");let t=e;if(!this.isHTML5||i!==this.type)return!1;Object.keys(rt).includes(t)&&(t+=`; codecs="${rt[e]}"`);try{return Boolean(t&&this.media.canPlayType(t).replace(/no/,""))}catch(s){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range",e.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:Oe!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},ts=(()=>{let e=!1;try{const i=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,i),window.removeEventListener("test",null,i)}catch(i){}return e})();function ue(e,i,t,s=!1,a=!0,n=!1){if(!e||!("addEventListener"in e)||r.empty(i)||!r.function(t))return;const l=i.split(" ");let o=n;ts&&(o={passive:a,capture:n}),l.forEach(c=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:c,callback:t,options:o}),e[s?"addEventListener":"removeEventListener"](c,t,o)})}function P(e,i="",t,s=!0,a=!1){ue.call(this,e,i,t,!0,s,a)}function xe(e,i="",t,s=!0,a=!1){ue.call(this,e,i,t,!1,s,a)}function We(e,i="",t,s=!0,a=!1){const n=(...l)=>{xe(e,i,n,s,a),t.apply(this,l)};ue.call(this,e,i,n,!0,s,a)}function C(e,i="",t=!1,s={}){if(!r.element(e)||r.empty(i))return;const a=new CustomEvent(i,{bubbles:t,detail:ne(V({},s),{plyr:this})});e.dispatchEvent(a)}function is(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:i,type:t,callback:s,options:a}=e;i.removeEventListener(t,s,a)}),this.eventListeners=[])}function ss(){return new Promise(e=>this.ready?setTimeout(e,0):P.call(this,this.elements.container,"ready",e)).then(()=>{})}function B(e){r.promise(e)&&e.then(null,()=>{})}function je(e){return r.array(e)?e.filter((i,t)=>e.indexOf(i)===t):e}function Pt(e,i){return r.array(e)&&e.length?e.reduce((t,s)=>Math.abs(s-i)<Math.abs(t-i)?s:t):null}function xt(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const ot=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((e,[i,t])=>ne(V({},e),{[i/t]:[i,t]}),{});function Mt(e){return r.array(e)||r.string(e)&&e.includes(":")?(r.array(e)?e:e.split(":")).map(Number).every(r.number):!1}function Ae(e){if(!r.array(e)||!e.every(r.number))return null;const[i,t]=e,s=(n,l)=>l===0?n:s(l,n%l),a=s(i,t);return[i/a,t/a]}function ze(e){const i=s=>Mt(s)?s.split(":").map(Number):null;let t=i(e);if(t===null&&(t=i(this.config.ratio)),t===null&&!r.empty(this.embed)&&r.array(this.embed.ratio)&&({ratio:t}=this.embed),t===null&&this.isHTML5){const{videoWidth:s,videoHeight:a}=this.media;t=[s,a]}return Ae(t)}function se(e){if(!this.isVideo)return{};const{wrapper:i}=this.elements,t=ze.call(this,e);if(!r.array(t))return{};const[s,a]=Ae(t),n=100/s*a;if(xt(`aspect-ratio: ${s}/${a}`)?i.style.aspectRatio=`${s}/${a}`:i.style.paddingBottom=`${n}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const l=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),o=(l-n)/(l/50);this.fullscreen.active?i.style.paddingBottom=null:this.media.style.transform=`translateY(-${o}%)`}else this.isHTML5&&i.classList.add(this.config.classNames.videoFixedRatio);return{padding:n,ratio:t}}function Nt(e,i,t=.05){const s=e/i,a=Pt(Object.keys(ot),s);return Math.abs(a-s)<=t?ot[a]:[e,i]}function ns(){return[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)]}const G={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(e=>{const i=e.getAttribute("type");return!!r.empty(i)||$.mime.call(this,i)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:G.getSources.call(this).map(e=>Number(e.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,r.empty(this.config.ratio)||se.call(e),Object.defineProperty(e.media,"quality",{get(){const i=G.getSources.call(e).find(t=>t.getAttribute("src")===e.source);return i&&Number(i.getAttribute("size"))},set(i){if(e.quality!==i){if(e.config.quality.forced&&r.function(e.config.quality.onChange))e.config.quality.onChange(i);else{const t=G.getSources.call(e).find(c=>Number(c.getAttribute("size"))===i);if(!t)return;const{currentTime:s,paused:a,preload:n,readyState:l,playbackRate:o}=e.media;e.media.src=t.getAttribute("src"),(n!=="none"||l)&&(e.once("loadedmetadata",()=>{e.speed=o,e.currentTime=s,a||B(e.play())}),e.media.load())}C.call(e,e.media,"qualitychange",!1,{quality:i})}}})},cancelRequests(){this.isHTML5&&(z(G.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function as(e){return`${e}-${Math.floor(1e4*Math.random())}`}function Re(e,...i){return r.empty(e)?e:e.toString().replace(/{(\d+)}/g,(t,s)=>i[s].toString())}function ls(e,i){return e===0||i===0||Number.isNaN(e)||Number.isNaN(i)?0:(e/i*100).toFixed(2)}const oe=(e="",i="",t="")=>e.replace(new RegExp(i.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),t.toString()),It=(e="")=>e.toString().replace(/\w\S*/g,i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase());function rs(e=""){let i=e.toString();return i=oe(i,"-"," "),i=oe(i,"_"," "),i=It(i),oe(i," ","")}function os(e=""){let i=e.toString();return i=rs(i),i.charAt(0).toLowerCase()+i.slice(1)}function cs(e){const i=document.createDocumentFragment(),t=document.createElement("div");return i.appendChild(t),t.innerHTML=e,i.firstChild.innerText}function us(e){const i=document.createElement("div");return i.appendChild(e),i.innerHTML}const ct={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},O={get(e="",i={}){if(r.empty(e)||r.empty(i))return"";let t=At(i.i18n,e);if(r.empty(t))return Object.keys(ct).includes(e)?ct[e]:"";const s={"{seektime}":i.seekTime,"{title}":i.title};return Object.entries(s).forEach(([a,n])=>{t=oe(t,a,n)}),t}};class de{constructor(i){y(this,"get",t=>{if(!de.supported||!this.enabled)return null;const s=window.localStorage.getItem(this.key);if(r.empty(s))return null;const a=JSON.parse(s);return r.string(t)&&t.length?a[t]:a}),y(this,"set",t=>{if(!de.supported||!this.enabled||!r.object(t))return;let s=this.get();r.empty(s)&&(s={}),L(s,t);try{window.localStorage.setItem(this.key,JSON.stringify(s))}catch(a){}}),this.enabled=i.config.storage.enabled,this.key=i.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const i="___test";return window.localStorage.setItem(i,i),window.localStorage.removeItem(i),!0}catch(i){return!1}}}function ge(e,i="text"){return new Promise((t,s)=>{try{const a=new XMLHttpRequest;if(!("withCredentials"in a))return;a.addEventListener("load",()=>{if(i==="text")try{t(JSON.parse(a.responseText))}catch(n){t(a.responseText)}else t(a.response)}),a.addEventListener("error",()=>{throw new Error(a.status)}),a.open("GET",e,!0),a.responseType=i,a.send()}catch(a){s(a)}})}function Lt(e,i){if(!r.string(e))return;const t="cache",s=r.string(i);let a=!1;const n=()=>document.getElementById(i)!==null,l=(o,c)=>{o.innerHTML=c,s&&n()||document.body.insertAdjacentElement("afterbegin",o)};if(!s||!n()){const o=de.supported,c=document.createElement("div");if(c.setAttribute("hidden",""),s&&c.setAttribute("id",i),o){const u=window.localStorage.getItem(`${t}-${i}`);if(a=u!==null,a){const d=JSON.parse(u);l(c,d.content)}}ge(e).then(u=>{if(!r.empty(u)){if(o)try{window.localStorage.setItem(`${t}-${i}`,JSON.stringify({content:u}))}catch(d){}l(c,u)}}).catch(()=>{})}}const $t=e=>Math.trunc(e/60/60%60,10),ds=e=>Math.trunc(e/60%60,10),hs=e=>Math.trunc(e%60,10);function Me(e=0,i=!1,t=!1){if(!r.number(e))return Me(void 0,i,t);const s=o=>`0${o}`.slice(-2);let a=$t(e);const n=ds(e),l=hs(e);return a=i||a>0?`${a}:`:"",`${t&&e>0?"-":""}${a}${s(n)}:${s(l)}`}const g={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),i=window.location.host?window.location.host:window.top.location.host,t=e.host!==i||D.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:t}},findElements(){try{return this.elements.controls=_.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:ce.call(this,this.config.selectors.buttons.play),pause:_.call(this,this.config.selectors.buttons.pause),restart:_.call(this,this.config.selectors.buttons.restart),rewind:_.call(this,this.config.selectors.buttons.rewind),fastForward:_.call(this,this.config.selectors.buttons.fastForward),mute:_.call(this,this.config.selectors.buttons.mute),pip:_.call(this,this.config.selectors.buttons.pip),airplay:_.call(this,this.config.selectors.buttons.airplay),settings:_.call(this,this.config.selectors.buttons.settings),captions:_.call(this,this.config.selectors.buttons.captions),fullscreen:_.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=_.call(this,this.config.selectors.progress),this.elements.inputs={seek:_.call(this,this.config.selectors.inputs.seek),volume:_.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:_.call(this,this.config.selectors.display.buffer),currentTime:_.call(this,this.config.selectors.display.currentTime),duration:_.call(this,this.config.selectors.display.duration)},r.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,i){const t="http://www.w3.org/2000/svg",s=g.getIconUrl.call(this),a=`${s.cors?"":s.url}#${this.config.iconPrefix}`,n=document.createElementNS(t,"svg");De(n,L(i,{"aria-hidden":"true",focusable:"false"}));const l=document.createElementNS(t,"use"),o=`${a}-${e}`;return"href"in l&&l.setAttributeNS("http://www.w3.org/1999/xlink","href",o),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),n.appendChild(l),n},createLabel(e,i={}){const t=O.get(e,this.config);return k("span",ne(V({},i),{class:[i.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),t)},createBadge(e){if(r.empty(e))return null;const i=k("span",{class:this.config.classNames.menu.value});return i.appendChild(k("span",{class:this.config.classNames.menu.badge},e)),i},createButton(e,i){const t=L({},i);let s=os(e);const a={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(l=>{Object.keys(t).includes(l)&&(a[l]=t[l],delete t[l])}),a.element!=="button"||Object.keys(t).includes("type")||(t.type="button"),Object.keys(t).includes("class")?t.class.split(" ").some(l=>l===this.config.classNames.control)||L(t,{class:`${t.class} ${this.config.classNames.control}`}):t.class=this.config.classNames.control,e){case"play":a.toggle=!0,a.label="play",a.labelPressed="pause",a.icon="play",a.iconPressed="pause";break;case"mute":a.toggle=!0,a.label="mute",a.labelPressed="unmute",a.icon="volume",a.iconPressed="muted";break;case"captions":a.toggle=!0,a.label="enableCaptions",a.labelPressed="disableCaptions",a.icon="captions-off",a.iconPressed="captions-on";break;case"fullscreen":a.toggle=!0,a.label="enterFullscreen",a.labelPressed="exitFullscreen",a.icon="enter-fullscreen",a.iconPressed="exit-fullscreen";break;case"play-large":t.class+=` ${this.config.classNames.control}--overlaid`,s="play",a.label="play",a.icon="play";break;default:r.empty(a.label)&&(a.label=s),r.empty(a.icon)&&(a.icon=e)}const n=k(a.element);return a.toggle?(n.appendChild(g.createIcon.call(this,a.iconPressed,{class:"icon--pressed"})),n.appendChild(g.createIcon.call(this,a.icon,{class:"icon--not-pressed"})),n.appendChild(g.createLabel.call(this,a.labelPressed,{class:"label--pressed"})),n.appendChild(g.createLabel.call(this,a.label,{class:"label--not-pressed"}))):(n.appendChild(g.createIcon.call(this,a.icon)),n.appendChild(g.createLabel.call(this,a.label))),L(t,F(this.config.selectors.buttons[s],t)),De(n,t),s==="play"?(r.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(n)):this.elements.buttons[s]=n,n},createRange(e,i){const t=k("input",L(F(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":O.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},i));return this.elements.inputs[e]=t,g.updateRangeFill.call(this,t),_i.setup(t),t},createProgress(e,i){const t=k("progress",L(F(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},i));if(e!=="volume"){t.appendChild(k("span",null,"0"));const s={played:"played",buffer:"buffered"}[e],a=s?O.get(s,this.config):"";t.innerText=`% ${a.toLowerCase()}`}return this.elements.display[e]=t,t},createTime(e,i){const t=F(this.config.selectors.display[e],i),s=k("div",L(t,{class:`${t.class?t.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":O.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,i){P.call(this,e,"keydown keyup",t=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(t.key)||(t.preventDefault(),t.stopPropagation(),t.type==="keydown"))return;const s=Z(e,'[role="menuitemradio"]');if(!s&&[" ","ArrowRight"].includes(t.key))g.showMenuPanel.call(this,i,!0);else{let a;t.key!==" "&&(t.key==="ArrowDown"||s&&t.key==="ArrowRight"?(a=e.nextElementSibling,r.element(a)||(a=e.parentNode.firstElementChild)):(a=e.previousElementSibling,r.element(a)||(a=e.parentNode.lastElementChild)),Ne.call(this,a,!0))}},!1),P.call(this,e,"keyup",t=>{t.key==="Return"&&g.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:i,type:t,title:s,badge:a=null,checked:n=!1}){const l=F(this.config.selectors.inputs[t]),o=k("button",L(l,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${l.class?l.class:""}`.trim(),"aria-checked":n,value:e})),c=k("span");c.innerHTML=s,r.element(a)&&c.appendChild(a),o.appendChild(c),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>o.getAttribute("aria-checked")==="true",set(u){u&&Array.from(o.parentNode.children).filter(d=>Z(d,'[role="menuitemradio"]')).forEach(d=>d.setAttribute("aria-checked","false")),o.setAttribute("aria-checked",u?"true":"false")}}),this.listeners.bind(o,"click keyup",u=>{if(!r.keyboardEvent(u)||u.key===" "){switch(u.preventDefault(),u.stopPropagation(),o.checked=!0,t){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}g.showMenuPanel.call(this,"home",r.keyboardEvent(u))}},t,!1),g.bindMenuItemShortcuts.call(this,o,t),i.appendChild(o)},formatTime(e=0,i=!1){return r.number(e)?Me(e,$t(this.duration)>0,i):e},updateTimeDisplay(e=null,i=0,t=!1){r.element(e)&&r.number(i)&&(e.innerText=g.formatTime(i,t))},updateVolume(){this.supported.ui&&(r.element(this.elements.inputs.volume)&&g.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),r.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(e,i=0){r.element(e)&&(e.value=i,g.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!r.event(e))return;let i=0;const t=(s,a)=>{const n=r.number(a)?a:0,l=r.element(s)?s:this.elements.display.buffer;if(r.element(l)){l.value=n;const o=l.getElementsByTagName("span")[0];r.element(o)&&(o.childNodes[0].nodeValue=n)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":i=ls(this.currentTime,this.duration),e.type==="timeupdate"&&g.setRange.call(this,this.elements.inputs.seek,i);break;case"playing":case"progress":t(this.elements.display.buffer,100*this.buffered)}},updateRangeFill(e){const i=r.event(e)?e.target:e;if(r.element(i)&&i.getAttribute("type")==="range"){if(Z(i,this.config.selectors.inputs.seek)){i.setAttribute("aria-valuenow",this.currentTime);const t=g.formatTime(this.currentTime),s=g.formatTime(this.duration),a=O.get("seekLabel",this.config);i.setAttribute("aria-valuetext",a.replace("{currentTime}",t).replace("{duration}",s))}else if(Z(i,this.config.selectors.inputs.volume)){const t=100*i.value;i.setAttribute("aria-valuenow",t),i.setAttribute("aria-valuetext",`${t.toFixed(1)}%`)}else i.setAttribute("aria-valuenow",i.value);(D.isWebKit||D.isIPadOS)&&i.style.setProperty("--value",i.value/i.max*100+"%")}},updateSeekTooltip(e){var i,t;if(!this.config.tooltips.seek||!r.element(this.elements.inputs.seek)||!r.element(this.elements.display.seekTooltip)||this.duration===0)return;const s=this.elements.display.seekTooltip,a=`${this.config.classNames.tooltip}--visible`,n=d=>M(s,a,d);if(this.touch)return void n(!1);let l=0;const o=this.elements.progress.getBoundingClientRect();if(r.event(e))l=100/o.width*(e.pageX-o.left);else{if(!Se(s,a))return;l=parseFloat(s.style.left,10)}l<0?l=0:l>100&&(l=100);const c=this.duration/100*l;s.innerText=g.formatTime(c);const u=(i=this.config.markers)===null||i===void 0||(t=i.points)===null||t===void 0?void 0:t.find(({time:d})=>d===Math.round(c));u&&s.insertAdjacentHTML("afterbegin",`${u.label}<br>`),s.style.left=`${l}%`,r.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&n(e.type==="mouseenter")},timeUpdate(e){const i=!r.element(this.elements.display.duration)&&this.config.invertTime;g.updateTimeDisplay.call(this,this.elements.display.currentTime,i?this.duration-this.currentTime:this.currentTime,i),e&&e.type==="timeupdate"&&this.media.seeking||g.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=Qe(2,32))return Q(this.elements.display.currentTime,!0),void Q(this.elements.progress,!0);r.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=r.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&g.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&g.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&g.setMarkers.call(this),g.updateSeekTooltip.call(this)},toggleMenuButton(e,i){Q(this.elements.settings.buttons[e],!i)},updateSetting(e,i,t){const s=this.elements.settings.panels[e];let a=null,n=i;if(e==="captions")a=this.currentTrack;else{if(a=r.empty(t)?this[e]:t,r.empty(a)&&(a=this.config[e].default),!r.empty(this.options[e])&&!this.options[e].includes(a))return void this.debug.warn(`Unsupported value of '${a}' for ${e}`);if(!this.config[e].options.includes(a))return void this.debug.warn(`Disabled value of '${a}' for ${e}`)}if(r.element(n)||(n=s&&s.querySelector('[role="menu"]')),!r.element(n))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=g.getLabel.call(this,e,a);const l=n&&n.querySelector(`[value="${a}"]`);r.element(l)&&(l.checked=!0)},getLabel(e,i){switch(e){case"speed":return i===1?O.get("normal",this.config):`${i}&times;`;case"quality":if(r.number(i)){const t=O.get(`qualityLabel.${i}`,this.config);return t.length?t:`${i}p`}return It(i);case"captions":return x.getLabel.call(this);default:return null}},setQualityMenu(e){if(!r.element(this.elements.settings.panels.quality))return;const i="quality",t=this.elements.settings.panels.quality.querySelector('[role="menu"]');r.array(e)&&(this.options.quality=je(e).filter(n=>this.config.quality.options.includes(n)));const s=!r.empty(this.options.quality)&&this.options.quality.length>1;if(g.toggleMenuButton.call(this,i,s),we(t),g.checkMenu.call(this),!s)return;const a=n=>{const l=O.get(`qualityBadge.${n}`,this.config);return l.length?g.createBadge.call(this,l):null};this.options.quality.sort((n,l)=>{const o=this.config.quality.options;return o.indexOf(n)>o.indexOf(l)?1:-1}).forEach(n=>{g.createMenuItem.call(this,{value:n,list:t,type:i,title:g.getLabel.call(this,"quality",n),badge:a(n)})}),g.updateSetting.call(this,i,t)},setCaptionsMenu(){if(!r.element(this.elements.settings.panels.captions))return;const e="captions",i=this.elements.settings.panels.captions.querySelector('[role="menu"]'),t=x.getTracks.call(this),s=Boolean(t.length);if(g.toggleMenuButton.call(this,e,s),we(i),g.checkMenu.call(this),!s)return;const a=t.map((n,l)=>({value:l,checked:this.captions.toggled&&this.currentTrack===l,title:x.getLabel.call(this,n),badge:n.language&&g.createBadge.call(this,n.language.toUpperCase()),list:i,type:"language"}));a.unshift({value:-1,checked:!this.captions.toggled,title:O.get("disabled",this.config),list:i,type:"language"}),a.forEach(g.createMenuItem.bind(this)),g.updateSetting.call(this,e,i)},setSpeedMenu(){if(!r.element(this.elements.settings.panels.speed))return;const e="speed",i=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(s=>s>=this.minimumSpeed&&s<=this.maximumSpeed);const t=!r.empty(this.options.speed)&&this.options.speed.length>1;g.toggleMenuButton.call(this,e,t),we(i),g.checkMenu.call(this),t&&(this.options.speed.forEach(s=>{g.createMenuItem.call(this,{value:s,list:i,type:e,title:g.getLabel.call(this,"speed",s)})}),g.updateSetting.call(this,e,i))},checkMenu(){const{buttons:e}=this.elements.settings,i=!r.empty(e)&&Object.values(e).some(t=>!t.hidden);Q(this.elements.settings.menu,!i)},focusFirstMenuItem(e,i=!1){if(this.elements.settings.popup.hidden)return;let t=e;r.element(t)||(t=Object.values(this.elements.settings.panels).find(a=>!a.hidden));const s=t.querySelector('[role^="menuitem"]');Ne.call(this,s,i)},toggleMenu(e){const{popup:i}=this.elements.settings,t=this.elements.buttons.settings;if(!r.element(i)||!r.element(t))return;const{hidden:s}=i;let a=s;if(r.boolean(e))a=e;else if(r.keyboardEvent(e)&&e.key==="Escape")a=!1;else if(r.event(e)){const n=r.function(e.composedPath)?e.composedPath()[0]:e.target,l=i.contains(n);if(l||!l&&e.target!==t&&a)return}t.setAttribute("aria-expanded",a),Q(i,!a),M(this.elements.container,this.config.classNames.menu.open,a),a&&r.keyboardEvent(e)?g.focusFirstMenuItem.call(this,null,!0):a||s||Ne.call(this,t,r.keyboardEvent(e))},getMenuSize(e){const i=e.cloneNode(!0);i.style.position="absolute",i.style.opacity=0,i.removeAttribute("hidden"),e.parentNode.appendChild(i);const t=i.scrollWidth,s=i.scrollHeight;return z(i),{width:t,height:s}},showMenuPanel(e="",i=!1){const t=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!r.element(t))return;const s=t.parentNode,a=Array.from(s.children).find(n=>!n.hidden);if($.transitions&&!$.reducedMotion){s.style.width=`${a.scrollWidth}px`,s.style.height=`${a.scrollHeight}px`;const n=g.getMenuSize.call(this,t),l=o=>{o.target===s&&["width","height"].includes(o.propertyName)&&(s.style.width="",s.style.height="",xe.call(this,s,Oe,l))};P.call(this,s,Oe,l),s.style.width=`${n.width}px`,s.style.height=`${n.height}px`}Q(a,!0),Q(t,!1),g.focusFirstMenuItem.call(this,t,i)},setDownloadUrl(){const e=this.elements.buttons.download;r.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:i,createButton:t,createProgress:s,createRange:a,createTime:n,setQualityMenu:l,setSpeedMenu:o,showMenuPanel:c}=g;this.elements.controls=null,r.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(t.call(this,"play-large"));const u=k("div",F(this.config.selectors.controls.wrapper));this.elements.controls=u;const d={class:"plyr__controls__item"};return je(r.array(this.config.controls)?this.config.controls:[]).forEach(v=>{if(v==="restart"&&u.appendChild(t.call(this,"restart",d)),v==="rewind"&&u.appendChild(t.call(this,"rewind",d)),v==="play"&&u.appendChild(t.call(this,"play",d)),v==="fast-forward"&&u.appendChild(t.call(this,"fast-forward",d)),v==="progress"){const h=k("div",{class:`${d.class} plyr__progress__container`}),b=k("div",F(this.config.selectors.progress));if(b.appendChild(a.call(this,"seek",{id:`plyr-seek-${e.id}`})),b.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const m=k("span",{class:this.config.classNames.tooltip},"00:00");b.appendChild(m),this.elements.display.seekTooltip=m}this.elements.progress=b,h.appendChild(this.elements.progress),u.appendChild(h)}if(v==="current-time"&&u.appendChild(n.call(this,"currentTime",d)),v==="duration"&&u.appendChild(n.call(this,"duration",d)),v==="mute"||v==="volume"){let{volume:h}=this.elements;if(r.element(h)&&u.contains(h)||(h=k("div",L({},d,{class:`${d.class} plyr__volume`.trim()})),this.elements.volume=h,u.appendChild(h)),v==="mute"&&h.appendChild(t.call(this,"mute")),v==="volume"&&!D.isIos&&!D.isIPadOS){const b={max:1,step:.05,value:this.config.volume};h.appendChild(a.call(this,"volume",L(b,{id:`plyr-volume-${e.id}`})))}}if(v==="captions"&&u.appendChild(t.call(this,"captions",d)),v==="settings"&&!r.empty(this.config.settings)){const h=k("div",L({},d,{class:`${d.class} plyr__menu`.trim(),hidden:""}));h.appendChild(t.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const b=k("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),m=k("div"),p=k("div",{id:`plyr-settings-${e.id}-home`}),A=k("div",{role:"menu"});p.appendChild(A),m.appendChild(p),this.elements.settings.panels.home=p,this.config.settings.forEach(T=>{const S=k("button",L(F(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));i.call(this,S,T),P.call(this,S,"click",()=>{c.call(this,T,!1)});const f=k("span",null,O.get(T,this.config)),E=k("span",{class:this.config.classNames.menu.value});E.innerHTML=e[T],f.appendChild(E),S.appendChild(f),A.appendChild(S);const I=k("div",{id:`plyr-settings-${e.id}-${T}`,hidden:""}),R=k("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});R.appendChild(k("span",{"aria-hidden":!0},O.get(T,this.config))),R.appendChild(k("span",{class:this.config.classNames.hidden},O.get("menuBack",this.config))),P.call(this,I,"keydown",Y=>{Y.key==="ArrowLeft"&&(Y.preventDefault(),Y.stopPropagation(),c.call(this,"home",!0))},!1),P.call(this,R,"click",()=>{c.call(this,"home",!1)}),I.appendChild(R),I.appendChild(k("div",{role:"menu"})),m.appendChild(I),this.elements.settings.buttons[T]=S,this.elements.settings.panels[T]=I}),b.appendChild(m),h.appendChild(b),u.appendChild(h),this.elements.settings.popup=b,this.elements.settings.menu=h}if(v==="pip"&&$.pip&&u.appendChild(t.call(this,"pip",d)),v==="airplay"&&$.airplay&&u.appendChild(t.call(this,"airplay",d)),v==="download"){const h=L({},d,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(h.download="");const{download:b}=this.config.urls;!r.url(b)&&this.isEmbed&&L(h,{icon:`logo-${this.provider}`,label:this.provider}),u.appendChild(t.call(this,"download",h))}v==="fullscreen"&&u.appendChild(t.call(this,"fullscreen",d))}),this.isHTML5&&l.call(this,G.getQualityOptions.call(this)),o.call(this),u},inject(){if(this.config.loadSprite){const a=g.getIconUrl.call(this);a.cors&&Lt(a.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const i={id:this.id,seektime:this.config.seekTime,title:this.config.title};let t=!0;r.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,i)),this.config.controls||(this.config.controls=[]),r.element(this.config.controls)||r.string(this.config.controls)?e=this.config.controls:(e=g.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:x.getLabel.call(this)}),t=!1);let s;if(t&&r.string(this.config.controls)&&(e=(a=>{let n=a;return Object.entries(i).forEach(([l,o])=>{n=oe(n,`{${l}}`,o)}),n})(e)),r.string(this.config.selectors.controls.container)&&(s=document.querySelector(this.config.selectors.controls.container)),r.element(s)||(s=this.elements.container),s[r.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),r.element(this.elements.controls)||g.findElements.call(this),!r.empty(this.elements.buttons)){const a=n=>{const l=this.config.classNames.controlPressed;n.setAttribute("aria-pressed","false"),Object.defineProperty(n,"pressed",{configurable:!0,enumerable:!0,get:()=>Se(n,l),set(o=!1){M(n,l,o),n.setAttribute("aria-pressed",o?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(n=>{r.array(n)||r.nodeList(n)?Array.from(n).filter(Boolean).forEach(a):a(n)})}if(D.isEdge&&St(s),this.config.tooltips.controls){const{classNames:a,selectors:n}=this.config,l=`${n.controls.wrapper} ${n.labels} .${a.hidden}`,o=ce.call(this,l);Array.from(o).forEach(c=>{M(c,this.config.classNames.hidden,!1),M(c,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch(e){}},setMarkers(){var e,i;if(!this.duration||this.elements.markers)return;const t=(e=this.config.markers)===null||e===void 0||(i=e.points)===null||i===void 0?void 0:i.filter(({time:c})=>c>0&&c<this.duration);if(t==null||!t.length)return;const s=document.createDocumentFragment(),a=document.createDocumentFragment();let n=null;const l=`${this.config.classNames.tooltip}--visible`,o=c=>M(n,l,c);t.forEach(c=>{const u=k("span",{class:this.config.classNames.marker},""),d=c.time/this.duration*100+"%";n&&(u.addEventListener("mouseenter",()=>{c.label||(n.style.left=d,n.innerHTML=c.label,o(!0))}),u.addEventListener("mouseleave",()=>{o(!1)})),u.addEventListener("click",()=>{this.currentTime=c.time}),u.style.left=d,a.appendChild(u)}),s.appendChild(a),this.config.tooltips.seek||(n=k("span",{class:this.config.classNames.tooltip},""),s.appendChild(n)),this.elements.markers={points:a,tip:n},this.elements.progress.appendChild(s)}};function _t(e,i=!0){let t=e;if(i){const s=document.createElement("a");s.href=t,t=s.href}try{return new URL(t)}catch(s){return null}}function Ot(e){const i=new URLSearchParams;return r.object(e)&&Object.entries(e).forEach(([t,s])=>{i.set(t,s)}),i}const x={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!$.textTracks)return void(r.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&g.setCaptionsMenu.call(this));if(r.element(this.elements.captions)||(this.elements.captions=k("div",F(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),Zi(this.elements.captions,this.elements.wrapper)),D.isIE&&window.URL){const s=this.media.querySelectorAll("track");Array.from(s).forEach(a=>{const n=a.getAttribute("src"),l=_t(n);l!==null&&l.hostname!==window.location.href.hostname&&["http:","https:"].includes(l.protocol)&&ge(n,"blob").then(o=>{a.setAttribute("src",window.URL.createObjectURL(o))}).catch(()=>{z(a)})})}const e=je((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(s=>s.split("-")[0]));let i=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();i==="auto"&&([i]=e);let t=this.storage.get("captions");if(r.boolean(t)||({active:t}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:t,language:i,languages:e}),this.isHTML5){const s=this.config.captions.update?"addtrack removetrack":"removetrack";P.call(this,this.media.textTracks,s,x.update.bind(this))}setTimeout(x.update.bind(this),0)},update(){const e=x.getTracks.call(this,!0),{active:i,language:t,meta:s,currentTrackNode:a}=this.captions,n=Boolean(e.find(l=>l.language===t));this.isHTML5&&this.isVideo&&e.filter(l=>!s.get(l)).forEach(l=>{this.debug.log("Track added",l),s.set(l,{default:l.mode==="showing"}),l.mode==="showing"&&(l.mode="hidden"),P.call(this,l,"cuechange",()=>x.updateCues.call(this))}),(n&&this.language!==t||!e.includes(a))&&(x.setLanguage.call(this,t),x.toggle.call(this,i&&n)),this.elements&&M(this.elements.container,this.config.classNames.captions.enabled,!r.empty(e)),r.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&g.setCaptionsMenu.call(this)},toggle(e,i=!0){if(!this.supported.ui)return;const{toggled:t}=this.captions,s=this.config.classNames.captions.active,a=r.nullOrUndefined(e)?!t:e;if(a!==t){if(i||(this.captions.active=a,this.storage.set({captions:a})),!this.language&&a&&!i){const n=x.getTracks.call(this),l=x.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=l.language,void x.set.call(this,n.indexOf(l))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=a),M(this.elements.container,s,a),this.captions.toggled=a,g.updateSetting.call(this,"captions"),C.call(this,this.media,a?"captionsenabled":"captionsdisabled")}setTimeout(()=>{a&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(e,i=!0){const t=x.getTracks.call(this);if(e!==-1)if(r.number(e))if(e in t){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=t[e],{language:a}=s||{};this.captions.currentTrackNode=s,g.updateSetting.call(this,"captions"),i||(this.captions.language=a,this.storage.set({language:a})),this.isVimeo&&this.embed.enableTextTrack(a),C.call(this,this.media,"languagechange")}x.toggle.call(this,!0,i),this.isHTML5&&this.isVideo&&x.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else x.toggle.call(this,!1,i)},setLanguage(e,i=!0){if(!r.string(e))return void this.debug.warn("Invalid language argument",e);const t=e.toLowerCase();this.captions.language=t;const s=x.getTracks.call(this),a=x.findTrack.call(this,[t]);x.set.call(this,s.indexOf(a),i)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter(i=>!this.isHTML5||e||this.captions.meta.has(i)).filter(i=>["captions","subtitles"].includes(i.kind))},findTrack(e,i=!1){const t=x.getTracks.call(this),s=l=>Number((this.captions.meta.get(l)||{}).default),a=Array.from(t).sort((l,o)=>s(o)-s(l));let n;return e.every(l=>(n=a.find(o=>o.language===l),!n)),n||(i?a[0]:void 0)},getCurrentTrack(){return x.getTracks.call(this)[this.currentTrack]},getLabel(e){let i=e;return!r.track(i)&&$.textTracks&&this.captions.toggled&&(i=x.getCurrentTrack.call(this)),r.track(i)?r.empty(i.label)?r.empty(i.language)?O.get("enabled",this.config):e.language.toUpperCase():i.label:O.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!r.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!r.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let i=e;if(!i){const s=x.getCurrentTrack.call(this);i=Array.from((s||{}).activeCues||[]).map(a=>a.getCueAsHTML()).map(us)}const t=i.map(s=>s.trim()).join(`
  2. `);if(t!==this.elements.captions.innerHTML){we(this.elements.captions);const s=k("span",F(this.config.selectors.caption));s.innerHTML=t,this.elements.captions.appendChild(s),C.call(this,this.media,"cuechange")}}},Dt={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.8/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},Ie={active:"picture-in-picture",inactive:"inline"},J={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Le={audio:"audio",video:"video"};function ms(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?J.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?J.vimeo:null}const $e=()=>{};class ps{constructor(i=!1){this.enabled=window.console&&i,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):$e}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):$e}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):$e}}class q{constructor(i){y(this,"onChange",()=>{if(!this.supported)return;const t=this.player.elements.buttons.fullscreen;r.element(t)&&(t.pressed=this.active);const s=this.target===this.player.media?this.target:this.player.elements.container;C.call(this.player,s,this.active?"enterfullscreen":"exitfullscreen",!0)}),y(this,"toggleFallback",(t=!1)=>{var s,a;if(t?this.scrollPosition={x:(s=window.scrollX)!=null?s:0,y:(a=window.scrollY)!=null?a:0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=t?"hidden":"",M(this.target,this.player.config.classNames.fullscreen.fallback,t),D.isIos){let n=document.head.querySelector('meta[name="viewport"]');const l="viewport-fit=cover";n||(n=document.createElement("meta"),n.setAttribute("name","viewport"));const o=r.string(n.content)&&n.content.includes(l);t?(this.cleanupViewport=!o,o||(n.content+=`,${l}`)):this.cleanupViewport&&(n.content=n.content.split(",").filter(c=>c.trim()!==l).join(","))}this.onChange()}),y(this,"trapFocus",t=>{if(D.isIos||D.isIPadOS||!this.active||t.key!=="Tab")return;const s=document.activeElement,a=ce.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[n]=a,l=a[a.length-1];s!==l||t.shiftKey?s===n&&t.shiftKey&&(l.focus(),t.preventDefault()):(n.focus(),t.preventDefault())}),y(this,"update",()=>{if(this.supported){let t;t=this.forceFallback?"Fallback (forced)":q.nativeSupported?"Native":"Fallback",this.player.debug.log(`${t} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");M(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),y(this,"enter",()=>{this.supported&&(D.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!q.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?r.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),y(this,"exit",()=>{if(this.supported)if(D.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),B(this.player.play());else if(!q.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!r.empty(this.prefix)){const t=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${t}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),y(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=i,this.prefix=q.prefix,this.property=q.property,this.scrollPosition={x:0,y:0},this.forceFallback=i.config.fullscreen.fallback==="force",this.player.elements.fullscreen=i.config.fullscreen.container&&es(this.player.elements.container,i.config.fullscreen.container),P.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),P.call(this.player,this.player.elements.container,"dblclick",t=>{r.element(this.player.elements.controls)&&this.player.elements.controls.contains(t.target)||this.player.listeners.proxy(t,this.toggle,"fullscreen")}),P.call(this,this.player.elements.container,"keydown",t=>this.trapFocus(t)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return q.nativeSupported&&!this.forceFallback}static get prefix(){if(r.function(document.exitFullscreen))return"";let i="";return["webkit","moz","ms"].some(t=>!(!r.function(document[`${t}ExitFullscreen`])&&!r.function(document[`${t}CancelFullScreen`]))&&(i=t,!0)),i}static get property(){return this.prefix==="moz"?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,q.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||q.nativeSupported||!D.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!q.nativeSupported||this.forceFallback)return Se(this.target,this.player.config.classNames.fullscreen.fallback);const i=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return i&&i.shadowRoot?i===this.target.getRootNode().host:i===this.target}get target(){var i;return D.isIos&&this.player.config.fullscreen.iosNative?this.player.media:(i=this.player.elements.fullscreen)!=null?i:this.player.elements.container}}function Te(e,i=1){return new Promise((t,s)=>{const a=new Image,n=()=>{delete a.onload,delete a.onerror,(a.naturalWidth>=i?t:s)(a)};Object.assign(a,{onload:n,onerror:n,src:e})})}const N={addStyleHook(){M(this.elements.container,this.config.selectors.container.replace(".",""),!0),M(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void N.toggleNativeControls.call(this,!0);r.element(this.elements.controls)||(g.inject.call(this),this.listeners.controls()),N.toggleNativeControls.call(this),this.isHTML5&&x.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,g.updateVolume.call(this),g.timeUpdate.call(this),g.durationUpdate.call(this),N.checkPlaying.call(this),M(this.elements.container,this.config.classNames.pip.supported,$.pip&&this.isHTML5&&this.isVideo),M(this.elements.container,this.config.classNames.airplay.supported,$.airplay&&this.isHTML5),M(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{C.call(this,this.media,"ready")},0),N.setTitle.call(this),this.poster&&N.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&g.durationUpdate.call(this),this.config.mediaMetadata&&g.setMediaMetadata.call(this)},setTitle(){let e=O.get("play",this.config);if(r.string(this.config.title)&&!r.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(i=>{i.setAttribute("aria-label",e)}),this.isEmbed){const i=_.call(this,"iframe");if(!r.element(i))return;const t=r.empty(this.config.title)?"video":this.config.title,s=O.get("frameTitle",this.config);i.setAttribute("title",s.replace("{title}",t))}},togglePoster(e){M(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,i=!0){return i&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),ss.call(this).then(()=>Te(e)).catch(t=>{throw e===this.poster&&N.togglePoster.call(this,!1),t}).then(()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),N.togglePoster.call(this,!0),e)))},checkPlaying(e){M(this.elements.container,this.config.classNames.playing,this.playing),M(this.elements.container,this.config.classNames.paused,this.paused),M(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(i=>{Object.assign(i,{pressed:this.playing}),i.setAttribute("aria-label",O.get(this.playing?"pause":"play",this.config))}),r.event(e)&&e.type==="timeupdate"||N.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{M(this.elements.container,this.config.classNames.loading,this.loading),N.toggleControls.call(this)},this.loading?250:0)},toggleControls(e){const{controls:i}=this.elements;if(i&&this.config.hideControls){const t=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||i.pressed||i.hover||t))}},migrateStyles(){Object.values(V({},this.media.style)).filter(e=>!r.empty(e)&&r.string(e)&&e.startsWith("--plyr")).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),r.empty(this.media.style)&&this.media.removeAttribute("style")}};class gs{constructor(i){y(this,"firstTouch",()=>{const{player:t}=this,{elements:s}=t;t.touch=!0,M(s.container,t.config.classNames.isTouch,!0)}),y(this,"global",(t=!0)=>{const{player:s}=this;s.config.keyboard.global&&ue.call(s,window,"keydown keyup",this.handleKey,t,!1),ue.call(s,document.body,"click",this.toggleMenu,t),We.call(s,document.body,"touchstart",this.firstTouch)}),y(this,"container",()=>{const{player:t}=this,{config:s,elements:a,timers:n}=t;!s.keyboard.global&&s.keyboard.focused&&P.call(t,a.container,"keydown keyup",this.handleKey,!1),P.call(t,a.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",c=>{const{controls:u}=a;u&&c.type==="enterfullscreen"&&(u.pressed=!1,u.hover=!1);let d=0;["touchstart","touchmove","mousemove"].includes(c.type)&&(N.toggleControls.call(t,!0),d=t.touch?3e3:2e3),clearTimeout(n.controls),n.controls=setTimeout(()=>N.toggleControls.call(t,!1),d)});const l=()=>{if(!t.isVimeo||t.config.vimeo.premium)return;const c=a.wrapper,{active:u}=t.fullscreen,[d,v]=ze.call(t),h=xt(`aspect-ratio: ${d} / ${v}`);if(!u)return void(h?(c.style.width=null,c.style.height=null):(c.style.maxWidth=null,c.style.margin=null));const[b,m]=ns(),p=b/m>d/v;h?(c.style.width=p?"auto":"100%",c.style.height=p?"100%":"auto"):(c.style.maxWidth=p?m/v*d+"px":null,c.style.margin=p?"0 auto":null)},o=()=>{clearTimeout(n.resized),n.resized=setTimeout(l,50)};P.call(t,a.container,"enterfullscreen exitfullscreen",c=>{const{target:u}=t.fullscreen;u===a.container&&(!t.isEmbed&&r.empty(t.config.ratio)||(l(),(c.type==="enterfullscreen"?P:xe).call(t,window,"resize",o)))})}),y(this,"media",()=>{const{player:t}=this,{elements:s}=t;if(P.call(t,t.media,"timeupdate seeking seeked",n=>g.timeUpdate.call(t,n)),P.call(t,t.media,"durationchange loadeddata loadedmetadata",n=>g.durationUpdate.call(t,n)),P.call(t,t.media,"ended",()=>{t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())}),P.call(t,t.media,"progress playing seeking seeked",n=>g.updateProgress.call(t,n)),P.call(t,t.media,"volumechange",n=>g.updateVolume.call(t,n)),P.call(t,t.media,"playing play pause ended emptied timeupdate",n=>N.checkPlaying.call(t,n)),P.call(t,t.media,"waiting canplay seeked playing",n=>N.checkLoading.call(t,n)),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){const n=_.call(t,`.${t.config.classNames.video}`);if(!r.element(n))return;P.call(t,s.container,"click",l=>{([s.container,n].includes(l.target)||n.contains(l.target))&&(t.touch&&t.config.hideControls||(t.ended?(this.proxy(l,t.restart,"restart"),this.proxy(l,()=>{B(t.play())},"play")):this.proxy(l,()=>{B(t.togglePlay())},"play")))})}t.supported.ui&&t.config.disableContextMenu&&P.call(t,s.wrapper,"contextmenu",n=>{n.preventDefault()},!1),P.call(t,t.media,"volumechange",()=>{t.storage.set({volume:t.volume,muted:t.muted})}),P.call(t,t.media,"ratechange",()=>{g.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})}),P.call(t,t.media,"qualitychange",n=>{g.updateSetting.call(t,"quality",null,n.detail.quality)}),P.call(t,t.media,"ready qualitychange",()=>{g.setDownloadUrl.call(t)});const a=t.config.events.concat(["keyup","keydown"]).join(" ");P.call(t,t.media,a,n=>{let{detail:l={}}=n;n.type==="error"&&(l=t.media.error),C.call(t,s.container,n.type,!0,l)})}),y(this,"proxy",(t,s,a)=>{const{player:n}=this,l=n.config.listeners[a];let o=!0;r.function(l)&&(o=l.call(n,t)),o!==!1&&r.function(s)&&s.call(n,t)}),y(this,"bind",(t,s,a,n,l=!0)=>{const{player:o}=this,c=o.config.listeners[n],u=r.function(c);P.call(o,t,s,d=>this.proxy(d,a,n),l&&!u)}),y(this,"controls",()=>{const{player:t}=this,{elements:s}=t,a=D.isIE?"change":"input";if(s.buttons.play&&Array.from(s.buttons.play).forEach(n=>{this.bind(n,"click",()=>{B(t.togglePlay())},"play")}),this.bind(s.buttons.restart,"click",t.restart,"restart"),this.bind(s.buttons.rewind,"click",()=>{t.lastSeekTime=Date.now(),t.rewind()},"rewind"),this.bind(s.buttons.fastForward,"click",()=>{t.lastSeekTime=Date.now(),t.forward()},"fastForward"),this.bind(s.buttons.mute,"click",()=>{t.muted=!t.muted},"mute"),this.bind(s.buttons.captions,"click",()=>t.toggleCaptions()),this.bind(s.buttons.download,"click",()=>{C.call(t,t.media,"download")},"download"),this.bind(s.buttons.fullscreen,"click",()=>{t.fullscreen.toggle()},"fullscreen"),this.bind(s.buttons.pip,"click",()=>{t.pip="toggle"},"pip"),this.bind(s.buttons.airplay,"click",t.airplay,"airplay"),this.bind(s.buttons.settings,"click",n=>{n.stopPropagation(),n.preventDefault(),g.toggleMenu.call(t,n)},null,!1),this.bind(s.buttons.settings,"keyup",n=>{[" ","Enter"].includes(n.key)&&(n.key!=="Enter"?(n.preventDefault(),n.stopPropagation(),g.toggleMenu.call(t,n)):g.focusFirstMenuItem.call(t,null,!0))},null,!1),this.bind(s.settings.menu,"keydown",n=>{n.key==="Escape"&&g.toggleMenu.call(t,n)}),this.bind(s.inputs.seek,"mousedown mousemove",n=>{const l=s.progress.getBoundingClientRect(),o=100/l.width*(n.pageX-l.left);n.currentTarget.setAttribute("seek-value",o)}),this.bind(s.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",n=>{const l=n.currentTarget,o="play-on-seeked";if(r.keyboardEvent(n)&&!["ArrowLeft","ArrowRight"].includes(n.key))return;t.lastSeekTime=Date.now();const c=l.hasAttribute(o),u=["mouseup","touchend","keyup"].includes(n.type);c&&u?(l.removeAttribute(o),B(t.play())):!u&&t.playing&&(l.setAttribute(o,""),t.pause())}),D.isIos){const n=ce.call(t,'input[type="range"]');Array.from(n).forEach(l=>this.bind(l,a,o=>St(o.target)))}this.bind(s.inputs.seek,a,n=>{const l=n.currentTarget;let o=l.getAttribute("seek-value");r.empty(o)&&(o=l.value),l.removeAttribute("seek-value"),t.currentTime=o/l.max*t.duration},"seek"),this.bind(s.progress,"mouseenter mouseleave mousemove",n=>g.updateSeekTooltip.call(t,n)),this.bind(s.progress,"mousemove touchmove",n=>{const{previewThumbnails:l}=t;l&&l.loaded&&l.startMove(n)}),this.bind(s.progress,"mouseleave touchend click",()=>{const{previewThumbnails:n}=t;n&&n.loaded&&n.endMove(!1,!0)}),this.bind(s.progress,"mousedown touchstart",n=>{const{previewThumbnails:l}=t;l&&l.loaded&&l.startScrubbing(n)}),this.bind(s.progress,"mouseup touchend",n=>{const{previewThumbnails:l}=t;l&&l.loaded&&l.endScrubbing(n)}),D.isWebKit&&Array.from(ce.call(t,'input[type="range"]')).forEach(n=>{this.bind(n,"input",l=>g.updateRangeFill.call(t,l.target))}),t.config.toggleInvert&&!r.element(s.display.duration)&&this.bind(s.display.currentTime,"click",()=>{t.currentTime!==0&&(t.config.invertTime=!t.config.invertTime,g.timeUpdate.call(t))}),this.bind(s.inputs.volume,a,n=>{t.volume=n.target.value},"volume"),this.bind(s.controls,"mouseenter mouseleave",n=>{s.controls.hover=!t.touch&&n.type==="mouseenter"}),s.fullscreen&&Array.from(s.fullscreen.children).filter(n=>!n.contains(s.container)).forEach(n=>{this.bind(n,"mouseenter mouseleave",l=>{s.controls&&(s.controls.hover=!t.touch&&l.type==="mouseenter")})}),this.bind(s.controls,"mousedown mouseup touchstart touchend touchcancel",n=>{s.controls.pressed=["mousedown","touchstart"].includes(n.type)}),this.bind(s.controls,"focusin",()=>{const{config:n,timers:l}=t;M(s.controls,n.classNames.noTransition,!0),N.toggleControls.call(t,!0),setTimeout(()=>{M(s.controls,n.classNames.noTransition,!1)},0);const o=this.touch?3e3:4e3;clearTimeout(l.controls),l.controls=setTimeout(()=>N.toggleControls.call(t,!1),o)}),this.bind(s.inputs.volume,"wheel",n=>{const l=n.webkitDirectionInvertedFromDevice,[o,c]=[n.deltaX,-n.deltaY].map(v=>l?-v:v),u=Math.sign(Math.abs(o)>Math.abs(c)?o:c);t.increaseVolume(u/50);const{volume:d}=t.media;(u===1&&d<1||u===-1&&d>0)&&n.preventDefault()},"volume",!1)}),this.player=i,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(i){const{player:t}=this,{elements:s}=t,{key:a,type:n,altKey:l,ctrlKey:o,metaKey:c,shiftKey:u}=i,d=n==="keydown",v=d&&a===this.lastKey;if(!(l||o||c||u)&&!!a){if(d){const b=document.activeElement;if(r.element(b)){const{editable:m}=t.config.selectors,{seek:p}=s.inputs;if(b!==p&&Z(b,m)||i.key===" "&&Z(b,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(a)&&(i.preventDefault(),i.stopPropagation()),a){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":v||(h=parseInt(a,10),t.currentTime=t.duration/10*h);break;case" ":case"k":v||B(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":v||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":v||t.toggleCaptions();break;case"l":t.loop=!t.loop}a==="Escape"&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=a}else this.lastKey=null;var h}}toggleMenu(i){g.toggleMenu.call(this.player,i)}}function fs(e,i){return e(i={exports:{}},i.exports),i.exports}var ys=fs(function(e,i){e.exports=function(){var t=function(){},s={},a={},n={};function l(h,b){h=h.push?h:[h];var m,p,A,T=[],S=h.length,f=S;for(m=function(E,I){I.length&&T.push(E),--f||b(T)};S--;)p=h[S],(A=a[p])?m(p,A):(n[p]=n[p]||[]).push(m)}function o(h,b){if(h){var m=n[h];if(a[h]=b,m)for(;m.length;)m[0](h,b),m.splice(0,1)}}function c(h,b){h.call&&(h={success:h}),b.length?(h.error||t)(b):(h.success||t)(h)}function u(h,b,m,p){var A,T,S=document,f=m.async,E=(m.numRetries||0)+1,I=m.before||t,R=h.replace(/[\?|#].*$/,""),Y=h.replace(/^(css|img)!/,"");p=p||0,/(^css!|\.css$)/.test(R)?((T=S.createElement("link")).rel="stylesheet",T.href=Y,(A="hideFocus"in T)&&T.relList&&(A=0,T.rel="preload",T.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(R)?(T=S.createElement("img")).src=Y:((T=S.createElement("script")).src=h,T.async=f===void 0||f),T.onload=T.onerror=T.onbeforeload=function(ee){var fe=ee.type[0];if(A)try{T.sheet.cssText.length||(fe="e")}catch(qt){qt.code!=18&&(fe="e")}if(fe=="e"){if((p+=1)<E)return u(h,b,m,p)}else if(T.rel=="preload"&&T.as=="style")return T.rel="stylesheet";b(h,fe,ee.defaultPrevented)},I(h,T)!==!1&&S.head.appendChild(T)}function d(h,b,m){var p,A,T=(h=h.push?h:[h]).length,S=T,f=[];for(p=function(E,I,R){if(I=="e"&&f.push(E),I=="b"){if(!R)return;f.push(E)}--T||b(f)},A=0;A<S;A++)u(h[A],p,m)}function v(h,b,m){var p,A;if(b&&b.trim&&(p=b),A=(p?m:b)||{},p){if(p in s)throw"LoadJS";s[p]=!0}function T(S,f){d(h,function(E){c(A,E),S&&c({success:S,error:f},E),o(p,E)},A)}if(A.returnPromise)return new Promise(T);T()}return v.ready=function(h,b){return l(h,function(m){c(b,m)}),v},v.done=function(h){o(h,[])},v.reset=function(){s={},a={},n={}},v.isDefined=function(h){return h in s},v}()});function Ke(e){return new Promise((i,t)=>{ys(e,{success:i,error:t})})}function bs(e){return r.empty(e)?null:r.number(Number(e))?e:e.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:e}function vs(e){const i=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return i&&i.length===5?i[4]:null}function le(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,C.call(this,this.media,e?"play":"pause"))}const qe={setup(){const e=this;M(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,se.call(e),r.object(window.Vimeo)?qe.ready.call(e):Ke(e.config.urls.vimeo.sdk).then(()=>{qe.ready.call(e)}).catch(i=>{e.debug.warn("Vimeo SDK (player.js) failed to load",i)})},ready(){const e=this,i=e.config.vimeo,S=i,{premium:t,referrerPolicy:s}=S,a=Xe(S,["premium","referrerPolicy"]);let n=e.media.getAttribute("src"),l="";r.empty(n)?(n=e.media.getAttribute(e.config.attributes.embed.id),l=e.media.getAttribute(e.config.attributes.embed.hash)):l=vs(n);const o=l?{h:l}:{};t&&Object.assign(a,{controls:!1,sidedock:!1});const c=Ot(V(V({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline},o),a)),u=bs(n),d=k("iframe"),v=Re(e.config.urls.vimeo.iframe,u,c);if(d.setAttribute("src",v),d.setAttribute("allowfullscreen",""),d.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),r.empty(s)||d.setAttribute("referrerPolicy",s),t||!i.customControls)d.setAttribute("data-poster",e.poster),e.media=Ce(d,e.media);else{const f=k("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});f.appendChild(d),e.media=Ce(f,e.media)}i.customControls||ge(Re(e.config.urls.vimeo.api,v)).then(f=>{!r.empty(f)&&f.thumbnail_url&&N.setPoster.call(e,f.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(d,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(le.call(e,!0),e.embed.play()),e.media.pause=()=>(le.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:h}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>h,set(f){const{embed:E,media:I,paused:R,volume:Y}=e,ee=R&&!E.hasPlayed;I.seeking=!0,C.call(e,I,"seeking"),Promise.resolve(ee&&E.setVolume(0)).then(()=>E.setCurrentTime(f)).then(()=>ee&&E.pause()).then(()=>ee&&E.setVolume(Y)).catch(()=>{})}});let b=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>b,set(f){e.embed.setPlaybackRate(f).then(()=>{b=f,C.call(e,e.media,"ratechange")}).catch(()=>{e.options.speed=[1]})}});let{volume:m}=e.config;Object.defineProperty(e.media,"volume",{get:()=>m,set(f){e.embed.setVolume(f).then(()=>{m=f,C.call(e,e.media,"volumechange")})}});let{muted:p}=e.config;Object.defineProperty(e.media,"muted",{get:()=>p,set(f){const E=!!r.boolean(f)&&f;e.embed.setMuted(!!E||e.config.muted).then(()=>{p=E,C.call(e,e.media,"volumechange")})}});let A,{loop:T}=e.config;Object.defineProperty(e.media,"loop",{get:()=>T,set(f){const E=r.boolean(f)?f:e.config.loop.active;e.embed.setLoop(E).then(()=>{T=E})}}),e.embed.getVideoUrl().then(f=>{A=f,g.setDownloadUrl.call(e)}).catch(f=>{this.debug.warn(f)}),Object.defineProperty(e.media,"currentSrc",{get:()=>A}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(f=>{const[E,I]=f;e.embed.ratio=Nt(E,I),se.call(this)}),e.embed.setAutopause(e.config.autopause).then(f=>{e.config.autopause=f}),e.embed.getVideoTitle().then(f=>{e.config.title=f,N.setTitle.call(this)}),e.embed.getCurrentTime().then(f=>{h=f,C.call(e,e.media,"timeupdate")}),e.embed.getDuration().then(f=>{e.media.duration=f,C.call(e,e.media,"durationchange")}),e.embed.getTextTracks().then(f=>{e.media.textTracks=f,x.setup.call(e)}),e.embed.on("cuechange",({cues:f=[]})=>{const E=f.map(I=>cs(I.text));x.updateCues.call(e,E)}),e.embed.on("loaded",()=>{e.embed.getPaused().then(f=>{le.call(e,!f),f||C.call(e,e.media,"playing")}),r.element(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)}),e.embed.on("bufferstart",()=>{C.call(e,e.media,"waiting")}),e.embed.on("bufferend",()=>{C.call(e,e.media,"playing")}),e.embed.on("play",()=>{le.call(e,!0),C.call(e,e.media,"playing")}),e.embed.on("pause",()=>{le.call(e,!1)}),e.embed.on("timeupdate",f=>{e.media.seeking=!1,h=f.seconds,C.call(e,e.media,"timeupdate")}),e.embed.on("progress",f=>{e.media.buffered=f.percent,C.call(e,e.media,"progress"),parseInt(f.percent,10)===1&&C.call(e,e.media,"canplaythrough"),e.embed.getDuration().then(E=>{E!==e.media.duration&&(e.media.duration=E,C.call(e,e.media,"durationchange"))})}),e.embed.on("seeked",()=>{e.media.seeking=!1,C.call(e,e.media,"seeked")}),e.embed.on("ended",()=>{e.media.paused=!0,C.call(e,e.media,"ended")}),e.embed.on("error",f=>{e.media.error=f,C.call(e,e.media,"error")}),i.customControls&&setTimeout(()=>N.build.call(e),0)}};function ws(e){return r.empty(e)?null:e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:e}function re(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,C.call(this,this.media,e?"play":"pause"))}function Ts(e){return e.noCookie?"https://www.youtube-nocookie.com":window.location.protocol==="http:"?"http://www.youtube.com":void 0}const ke={setup(){if(M(this.elements.wrapper,this.config.classNames.embed,!0),r.object(window.YT)&&r.function(window.YT.Player))ke.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{r.function(e)&&e(),ke.ready.call(this)},Ke(this.config.urls.youtube.sdk).catch(i=>{this.debug.warn("YouTube API failed to load",i)})}},getTitle(e){ge(Re(this.config.urls.youtube.api,e)).then(i=>{if(r.object(i)){const{title:t,height:s,width:a}=i;this.config.title=t,N.setTitle.call(this),this.embed.ratio=Nt(a,s)}se.call(this)}).catch(()=>{se.call(this)})},ready(){const e=this,i=e.config.youtube,t=e.media&&e.media.getAttribute("id");if(!r.empty(t)&&t.startsWith("youtube-"))return;let s=e.media.getAttribute("src");r.empty(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const a=ws(s),n=k("div",{id:as(e.provider),"data-poster":i.customControls?e.poster:void 0});if(e.media=Ce(n,e.media),i.customControls){const l=o=>`https://i.ytimg.com/vi/${a}/${o}default.jpg`;Te(l("maxres"),121).catch(()=>Te(l("sd"),121)).catch(()=>Te(l("hq"))).then(o=>N.setPoster.call(e,o.src)).then(o=>{o.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:a,host:Ts(i),playerVars:L({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&i.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},i),events:{onError(l){if(!e.media.error){const o=l.data,c={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[o]||"An unknown error occurred";e.media.error={code:o,message:c},C.call(e,e.media,"error")}},onPlaybackRateChange(l){const o=l.target;e.media.playbackRate=o.getPlaybackRate(),C.call(e,e.media,"ratechange")},onReady(l){if(r.function(e.media.play))return;const o=l.target;ke.getTitle.call(e,a),e.media.play=()=>{re.call(e,!0),o.playVideo()},e.media.pause=()=>{re.call(e,!1),o.pauseVideo()},e.media.stop=()=>{o.stopVideo()},e.media.duration=o.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(o.getCurrentTime()),set(v){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,C.call(e,e.media,"seeking"),o.seekTo(v)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>o.getPlaybackRate(),set(v){o.setPlaybackRate(v)}});let{volume:c}=e.config;Object.defineProperty(e.media,"volume",{get:()=>c,set(v){c=v,o.setVolume(100*c),C.call(e,e.media,"volumechange")}});let{muted:u}=e.config;Object.defineProperty(e.media,"muted",{get:()=>u,set(v){const h=r.boolean(v)?v:u;u=h,o[h?"mute":"unMute"](),o.setVolume(100*c),C.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>o.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const d=o.getAvailablePlaybackRates();e.options.speed=d.filter(v=>e.config.speed.options.includes(v)),e.supported.ui&&i.customControls&&e.media.setAttribute("tabindex",-1),C.call(e,e.media,"timeupdate"),C.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(()=>{e.media.buffered=o.getVideoLoadedFraction(),(e.media.lastBuffered===null||e.media.lastBuffered<e.media.buffered)&&C.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,e.media.buffered===1&&(clearInterval(e.timers.buffering),C.call(e,e.media,"canplaythrough"))},200),i.customControls&&setTimeout(()=>N.build.call(e),50)},onStateChange(l){const o=l.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(l.data)&&(e.media.seeking=!1,C.call(e,e.media,"seeked")),l.data){case-1:C.call(e,e.media,"timeupdate"),e.media.buffered=o.getVideoLoadedFraction(),C.call(e,e.media,"progress");break;case 0:re.call(e,!1),e.media.loop?(o.stopVideo(),o.playVideo()):C.call(e,e.media,"ended");break;case 1:i.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(re.call(e,!0),C.call(e,e.media,"playing"),e.timers.playing=setInterval(()=>{C.call(e,e.media,"timeupdate")},50),e.media.duration!==o.getDuration()&&(e.media.duration=o.getDuration(),C.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),re.call(e,!1);break;case 3:C.call(e,e.media,"waiting")}C.call(e,e.elements.container,"statechange",!1,{code:l.data})}}})}},jt={setup(){this.media?(M(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),M(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&M(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=k("div",{class:this.config.classNames.video}),Et(this.media,this.elements.wrapper),this.elements.poster=k("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?G.setup.call(this):this.isYouTube?ke.setup.call(this):this.isVimeo&&qe.setup.call(this)):this.debug.warn("No media element found!")}};class ks{constructor(i){y(this,"load",()=>{this.enabled&&(r.object(window.google)&&r.object(window.google.ima)?this.ready():Ke(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),y(this,"ready",()=>{var t;this.enabled||((t=this).manager&&t.manager.destroy(),t.elements.displayContainer&&t.elements.displayContainer.destroy(),t.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),y(this,"setupIMA",()=>{this.elements.container=k("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,t=>this.onAdsManagerLoaded(t),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,t=>this.onAdError(t),!1),this.requestAds()}),y(this,"requestAds",()=>{const{container:t}=this.player.elements;try{const s=new google.ima.AdsRequest;s.adTagUrl=this.tagUrl,s.linearAdSlotWidth=t.offsetWidth,s.linearAdSlotHeight=t.offsetHeight,s.nonLinearAdSlotWidth=t.offsetWidth,s.nonLinearAdSlotHeight=t.offsetHeight,s.forceNonLinearFullSlot=!1,s.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(s)}catch(s){this.onAdError(s)}}),y(this,"pollCountdown",(t=!1)=>{if(!t)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(()=>{const s=Me(Math.max(this.manager.getRemainingTime(),0)),a=`${O.get("advertisement",this.player.config)} - ${s}`;this.elements.container.setAttribute("data-badge-text",a)},100)}),y(this,"onAdsManagerLoaded",t=>{if(!this.enabled)return;const s=new google.ima.AdsRenderingSettings;s.restoreCustomPlaybackStateOnAdBreakComplete=!0,s.enablePreloading=!0,this.manager=t.getAdsManager(this.player,s),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,a=>this.onAdError(a)),Object.keys(google.ima.AdEvent.Type).forEach(a=>{this.manager.addEventListener(google.ima.AdEvent.Type[a],n=>this.onAdEvent(n))}),this.trigger("loaded")}),y(this,"addCuePoints",()=>{r.empty(this.cuePoints)||this.cuePoints.forEach(t=>{if(t!==0&&t!==-1&&t<this.player.duration){const s=this.player.elements.progress;if(r.element(s)){const a=100/this.player.duration*t,n=k("span",{class:this.player.config.classNames.cues});n.style.left=`${a.toString()}%`,s.appendChild(n)}}})}),y(this,"onAdEvent",t=>{const{container:s}=this.player.elements,a=t.getAd(),n=t.getAdData();switch((l=>{C.call(this.player,this.player.media,`ads${l.replace(/_/g,"").toLowerCase()}`)})(t.type),t.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),a.isLinear()||(a.width=s.offsetWidth,a.height=s.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:n.adError&&this.player.debug.warn(`Non-fatal ad error: ${n.adError.getMessage()}`)}}),y(this,"onAdError",t=>{this.cancel(),this.player.debug.warn("Ads error",t)}),y(this,"listeners",()=>{const{container:t}=this.player.elements;let s;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{s=this.player.currentTime}),this.player.on("seeked",()=>{const a=this.player.currentTime;r.empty(this.cuePoints)||this.cuePoints.forEach((n,l)=>{s<n&&n<a&&(this.manager.discardAdBreak(),this.cuePoints.splice(l,1))})}),window.addEventListener("resize",()=>{this.manager&&this.manager.resize(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL)})}),y(this,"play",()=>{const{container:t}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(s){this.onAdError(s)}}).catch(()=>{})}),y(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,B(this.player.media.play())}),y(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),y(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),y(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(t=>{this.on("loaded",t),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),y(this,"trigger",(t,...s)=>{const a=this.events[t];r.array(a)&&a.forEach(n=>{r.function(n)&&n.apply(this,s)})}),y(this,"on",(t,s)=>(r.array(this.events[t])||(this.events[t]=[]),this.events[t].push(s),this)),y(this,"startSafetyTimer",(t,s)=>{this.player.debug.log(`Safety timer invoked from: ${s}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},t)}),y(this,"clearSafetyTimer",t=>{r.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${t}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=i,this.config=i.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((t,s)=>{this.on("loaded",t),this.on("error",s)}),this.load()}get enabled(){const{config:i}=this;return this.player.isHTML5&&this.player.isVideo&&i.enabled&&(!r.empty(i.publisherId)||r.url(i.tagUrl))}get tagUrl(){const{config:i}=this;return r.url(i.tagUrl)?i.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${Ot({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:i.publisherId})}`}}function Rt(e=0,i=0,t=255){return Math.min(Math.max(e,i),t)}const Cs=e=>{const i=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach(t=>{const s={};t.split(/\r\n|\n|\r/).forEach(a=>{if(r.number(s.startTime)){if(!r.empty(a.trim())&&r.empty(s.text)){const n=a.trim().split("#xywh=");[s.text]=n,n[1]&&([s.x,s.y,s.w,s.h]=n[1].split(","))}}else{const n=a.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);n&&(s.startTime=60*Number(n[1]||0)*60+60*Number(n[2])+Number(n[3])+Number(`0.${n[4]}`),s.endTime=60*Number(n[6]||0)*60+60*Number(n[7])+Number(n[8])+Number(`0.${n[9]}`))}}),s.text&&i.push(s)}),i},ut=(e,i)=>{const t={};return e>i.width/i.height?(t.width=i.width,t.height=1/e*i.width):(t.height=i.height,t.width=e*i.height),t};class He{constructor(i){y(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),y(this,"getThumbnails",()=>new Promise(t=>{const{src:s}=this.player.config.previewThumbnails;if(r.empty(s))throw new Error("Missing previewThumbnails.src config attribute");const a=()=>{this.thumbnails.sort((n,l)=>n.height-l.height),this.player.debug.log("Preview thumbnails",this.thumbnails),t()};if(r.function(s))s(n=>{this.thumbnails=n,a()});else{const n=(r.string(s)?[s]:s).map(l=>this.getThumbnail(l));Promise.all(n).then(a)}})),y(this,"getThumbnail",t=>new Promise(s=>{ge(t).then(a=>{const n={frames:Cs(a),height:null,urlPrefix:""};n.frames[0].text.startsWith("/")||n.frames[0].text.startsWith("http://")||n.frames[0].text.startsWith("https://")||(n.urlPrefix=t.substring(0,t.lastIndexOf("/")+1));const l=new Image;l.onload=()=>{n.height=l.naturalHeight,n.width=l.naturalWidth,this.thumbnails.push(n),s()},l.src=n.urlPrefix+n.frames[0].text})})),y(this,"startMove",t=>{if(this.loaded&&r.event(t)&&["touchmove","mousemove"].includes(t.type)&&this.player.media.duration){if(t.type==="touchmove")this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var s,a;const n=this.player.elements.progress.getBoundingClientRect(),l=100/n.width*(t.pageX-n.left);this.seekTime=this.player.media.duration*(l/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=t.pageX,this.elements.thumb.time.innerText=Me(this.seekTime);const o=(s=this.player.config.markers)===null||s===void 0||(a=s.points)===null||a===void 0?void 0:a.find(({time:c})=>c===Math.round(this.seekTime));o&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${o.label}<br>`)}this.showImageAtCurrentTime()}}),y(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),y(this,"startScrubbing",t=>{(r.nullOrUndefined(t.button)||t.button===!1||t.button===0)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),y(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):We.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),y(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),y(this,"render",()=>{this.elements.thumb.container=k("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=k("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const t=k("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=k("span",{},"00:00"),t.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(t),r.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=k("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),y(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),y(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const t=this.thumbnails[0].frames.findIndex(n=>this.seekTime>=n.startTime&&this.seekTime<=n.endTime),s=t>=0;let a=0;this.mouseDown||this.toggleThumbContainer(s),s&&(this.thumbnails.forEach((n,l)=>{this.loadedImages.includes(n.frames[t].text)&&(a=l)}),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(a)))}),y(this,"loadImage",(t=0)=>{const s=this.showingThumb,a=this.thumbnails[t],{urlPrefix:n}=a,l=a.frames[s],o=a.frames[s].text,c=n+o;if(this.currentImageElement&&this.currentImageElement.dataset.filename===o)this.showImage(this.currentImageElement,l,t,s,o,!1),this.currentImageElement.dataset.index=s,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const u=new Image;u.src=c,u.dataset.index=s,u.dataset.filename=o,this.showingThumbFilename=o,this.player.debug.log(`Loading image: ${c}`),u.onload=()=>this.showImage(u,l,t,s,o,!0),this.loadingImage=u,this.removeOldImages(u)}}),y(this,"showImage",(t,s,a,n,l,o=!0)=>{this.player.debug.log(`Showing thumb: ${l}. num: ${n}. qual: ${a}. newimg: ${o}`),this.setImageSizeAndOffset(t,s),o&&(this.currentImageContainer.appendChild(t),this.currentImageElement=t,this.loadedImages.includes(l)||this.loadedImages.push(l)),this.preloadNearby(n,!0).then(this.preloadNearby(n,!1)).then(this.getHigherQuality(a,t,s,l))}),y(this,"removeOldImages",t=>{Array.from(this.currentImageContainer.children).forEach(s=>{if(s.tagName.toLowerCase()!=="img")return;const a=this.usingSprites?500:1e3;if(s.dataset.index!==t.dataset.index&&!s.dataset.deleting){s.dataset.deleting=!0;const{currentImageContainer:n}=this;setTimeout(()=>{n.removeChild(s),this.player.debug.log(`Removing thumb: ${s.dataset.filename}`)},a)}})}),y(this,"preloadNearby",(t,s=!0)=>new Promise(a=>{setTimeout(()=>{const n=this.thumbnails[0].frames[t].text;if(this.showingThumbFilename===n){let l;l=s?this.thumbnails[0].frames.slice(t):this.thumbnails[0].frames.slice(0,t).reverse();let o=!1;l.forEach(c=>{const u=c.text;if(u!==n&&!this.loadedImages.includes(u)){o=!0,this.player.debug.log(`Preloading thumb filename: ${u}`);const{urlPrefix:d}=this.thumbnails[0],v=d+u,h=new Image;h.src=v,h.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${u}`),this.loadedImages.includes(u)||this.loadedImages.push(u),a()}}}),o||a()}},300)})),y(this,"getHigherQuality",(t,s,a,n)=>{if(t<this.thumbnails.length-1){let l=s.naturalHeight;this.usingSprites&&(l=a.h),l<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===n&&(this.player.debug.log(`Showing higher quality thumb for: ${n}`),this.loadImage(t+1))},300)}}),y(this,"toggleThumbContainer",(t=!1,s=!1)=>{const a=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(a,t),!t&&s&&(this.showingThumb=null,this.showingThumbFilename=null)}),y(this,"toggleScrubbingContainer",(t=!1)=>{const s=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(s,t),t||(this.showingThumb=null,this.showingThumbFilename=null)}),y(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),y(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:t}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(t.clientHeight>20&&t.clientWidth<20){const s=Math.floor(t.clientHeight*this.thumbAspectRatio);t.style.width=`${s}px`}else if(t.clientHeight<20&&t.clientWidth>20){const s=Math.floor(t.clientWidth/this.thumbAspectRatio);t.style.height=`${s}px`}}else{const s=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);t.style.height=`${this.thumbContainerHeight}px`,t.style.width=`${s}px`}this.setThumbContainerPos()}),y(this,"setThumbContainerPos",()=>{const t=this.player.elements.progress.getBoundingClientRect(),s=this.player.elements.container.getBoundingClientRect(),{container:a}=this.elements.thumb,n=s.left-t.left+10,l=s.right-t.left-a.clientWidth-10,o=this.mousePosX-t.left-a.clientWidth/2,c=Rt(o,n,l);a.style.left=`${c}px`,a.style.setProperty("--preview-arrow-offset",o-c+"px")}),y(this,"setScrubbingContainerSize",()=>{const{width:t,height:s}=ut(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${t}px`,this.elements.scrubbing.container.style.height=`${s}px`}),y(this,"setImageSizeAndOffset",(t,s)=>{if(!this.usingSprites)return;const a=this.thumbContainerHeight/s.h;t.style.height=t.naturalHeight*a+"px",t.style.width=t.naturalWidth*a+"px",t.style.left=`-${s.x*a}px`,t.style.top=`-${s.y*a}px`}),this.player=i,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:i}=ut(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return i}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(i){this.mouseDown?this.currentScrubbingImageElement=i:this.currentThumbnailImageElement=i}}const Ve={insertElements(e,i){r.string(i)?lt(e,this.media,{src:i}):r.array(i)&&i.forEach(t=>{lt(e,this.media,t)})},change(e){At(e,"sources.length")?(G.cancelRequests.call(this),this.destroy.call(this,()=>{this.options.quality=[],z(this.media),this.media=null,r.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:i,type:t}=e,[{provider:s=J.html5,src:a}]=i,n=s==="html5"?t:"div",l=s==="html5"?{}:{src:a};Object.assign(this,{provider:s,type:t,supported:$.check(t,s,this.config.playsinline),media:k(n,l)}),this.elements.container.appendChild(this.media),r.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),r.empty(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),N.addStyleHook.call(this),this.isHTML5&&Ve.insertElements.call(this,"source",i),this.config.title=e.title,jt.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&Ve.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&N.build.call(this),this.isHTML5&&this.media.load(),r.empty(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new He(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};class he{constructor(i,t){if(y(this,"play",()=>r.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>B(this.media.play())),this.media.play()):null),y(this,"pause",()=>this.playing&&r.function(this.media.pause)?this.media.pause():null),y(this,"togglePlay",o=>(r.boolean(o)?o:!this.playing)?this.play():this.pause()),y(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):r.function(this.media.stop)&&this.media.stop()}),y(this,"restart",()=>{this.currentTime=0}),y(this,"rewind",o=>{this.currentTime-=r.number(o)?o:this.config.seekTime}),y(this,"forward",o=>{this.currentTime+=r.number(o)?o:this.config.seekTime}),y(this,"increaseVolume",o=>{const c=this.media.muted?0:this.volume;this.volume=c+(r.number(o)?o:0)}),y(this,"decreaseVolume",o=>{this.increaseVolume(-o)}),y(this,"airplay",()=>{$.airplay&&this.media.webkitShowPlaybackTargetPicker()}),y(this,"toggleControls",o=>{if(this.supported.ui&&!this.isAudio){const c=Se(this.elements.container,this.config.classNames.hideControls),u=o===void 0?void 0:!o,d=M(this.elements.container,this.config.classNames.hideControls,u);if(d&&r.array(this.config.controls)&&this.config.controls.includes("settings")&&!r.empty(this.config.settings)&&g.toggleMenu.call(this,!1),d!==c){const v=d?"controlshidden":"controlsshown";C.call(this,this.media,v)}return!d}return!1}),y(this,"on",(o,c)=>{P.call(this,this.elements.container,o,c)}),y(this,"once",(o,c)=>{We.call(this,this.elements.container,o,c)}),y(this,"off",(o,c)=>{xe(this.elements.container,o,c)}),y(this,"destroy",(o,c=!1)=>{if(!this.ready)return;const u=()=>{document.body.style.overflow="",this.embed=null,c?(Object.keys(this.elements).length&&(z(this.elements.buttons.play),z(this.elements.captions),z(this.elements.controls),z(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),r.function(o)&&o()):(is.call(this),G.cancelRequests.call(this),Ce(this.elements.original,this.elements.container),C.call(this,this.elements.original,"destroyed",!0),r.function(o)&&o.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(N.toggleNativeControls.call(this,!0),u()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&r.function(this.embed.destroy)&&this.embed.destroy(),u()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(u),setTimeout(u,200))}),y(this,"supports",o=>$.mime.call(this,o)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=$.touch,this.media=i,r.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||r.nodeList(this.media)||r.array(this.media))&&(this.media=this.media[0]),this.config=L({},Dt,he.defaults,t||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch(o){return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new ps(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",$),r.nullOrUndefined(this.media)||!r.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!$.check().api)return void this.debug.error("Setup failed: no support");const s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;const a=this.media.tagName.toLowerCase();let n=null,l=null;switch(a){case"div":if(n=this.media.querySelector("iframe"),r.element(n)){if(l=_t(n.getAttribute("src")),this.provider=ms(l.toString()),this.elements.container=this.media,this.media=n,this.elements.container.className="",l.search.length){const o=["1","true"];o.includes(l.searchParams.get("autoplay"))&&(this.config.autoplay=!0),o.includes(l.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=o.includes(l.searchParams.get("playsinline")),this.config.youtube.hl=l.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(r.empty(this.provider)||!Object.values(J).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Le.video;break;case"video":case"audio":this.type=a,this.provider=J.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=$.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new gs(this),this.storage=new de(this),this.media.plyr=this,r.element(this.elements.container)||(this.elements.container=k("div"),Et(this.media,this.elements.container)),N.migrateStyles.call(this),N.addStyleHook.call(this),jt.setup.call(this),this.config.debug&&P.call(this,this.elements.container,this.config.events.join(" "),o=>{this.debug.log(`event: ${o.type}`)}),this.fullscreen=new q(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&N.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new ks(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>B(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new He(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===J.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===J.youtube}get isVimeo(){return this.provider===J.vimeo}get isVideo(){return this.type===Le.video}get isAudio(){return this.type===Le.audio}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&this.currentTime===0)}get ended(){return Boolean(this.media.ended)}set currentTime(i){if(!this.duration)return;const t=r.number(i)&&i>0;this.media.currentTime=t?Math.min(i,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:i}=this.media;return r.number(i)?i:i&&i.length&&this.duration>0?i.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const i=parseFloat(this.config.duration),t=(this.media||{}).duration,s=r.number(t)&&t!==1/0?t:0;return i||s}set volume(i){let t=i;r.string(t)&&(t=Number(t)),r.number(t)||(t=this.storage.get("volume")),r.number(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!r.empty(i)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(i){let t=i;r.boolean(t)||(t=this.storage.get("muted")),r.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}set speed(i){let t=null;r.number(i)&&(t=i),r.number(t)||(t=this.storage.get("speed")),r.number(t)||(t=this.config.speed.selected);const{minimumSpeed:s,maximumSpeed:a}=this;t=Rt(t,s,a),this.config.speed.selected=t,setTimeout(()=>{this.media&&(this.media.playbackRate=t)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(i){const t=this.config.quality,s=this.options.quality;if(!s.length)return;let a=[!r.empty(i)&&Number(i),this.storage.get("quality"),t.selected,t.default].find(r.number),n=!0;if(!s.includes(a)){const l=Pt(s,a);this.debug.warn(`Unsupported quality option: ${a}, using ${l} instead`),a=l,n=!1}t.selected=a,this.media.quality=a,n&&this.storage.set({quality:a})}get quality(){return this.media.quality}set loop(i){const t=r.boolean(i)?i:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(i){Ve.change.call(this,i)}get source(){return this.media.currentSrc}get download(){const{download:i}=this.config.urls;return r.url(i)?i:this.source}set download(i){r.url(i)&&(this.config.urls.download=i,g.setDownloadUrl.call(this))}set poster(i){this.isVideo?N.setPoster.call(this,i,!1).catch(()=>{}):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const i=Ae(ze.call(this));return r.array(i)?i.join(":"):i}set ratio(i){this.isVideo?r.string(i)&&Mt(i)?(this.config.ratio=Ae(i),se.call(this)):this.debug.error(`Invalid aspect ratio specified (${i})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(i){this.config.autoplay=r.boolean(i)?i:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(i){x.toggle.call(this,i,!1)}set currentTrack(i){x.set.call(this,i,!1),x.setup.call(this)}get currentTrack(){const{toggled:i,currentTrack:t}=this.captions;return i?t:-1}set language(i){x.setLanguage.call(this,i,!1)}get language(){return(x.getCurrentTrack.call(this)||{}).language}set pip(i){if(!$.pip)return;const t=r.boolean(i)?i:!this.pip;r.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?Ie.active:Ie.inactive),r.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return $.pip?r.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Ie.active:null}setPreviewThumbnails(i){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,i),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new He(this))}static supported(i,t){return $.check(i,t)}static loadSprite(i,t){return Lt(i,t)}static setup(i,t={}){let s=null;return r.string(i)?s=Array.from(document.querySelectorAll(i)):r.nodeList(i)?s=Array.from(i):r.array(i)&&(s=i.filter(r.element)),r.empty(s)?null:s.map(a=>new he(a,t))}}he.defaults=Xi(Dt);const Ss=Ee({name:"colVideo",props:{setting:{type:Object,default:()=>{}},controls:Boolean,height:String,src:{type:String,default:""},poster:{type:String,default:""},styleValue:{type:Object,default:()=>({})}},data(){return{player:null}},mounted(){this._init()},methods:{_init(){let e=["play-large","play","progress","captions","fullscreen","duration"];this.player=new he(this.$refs.video,V({controls:e},this.setting))}},render(){return w("div",{class:bi["video-container"]},[w("video",{"object-fit":"fill",ref:"video",src:this.src,poster:this.poster,style:V({},this.styleValue)},null)])}});function As(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Zt(e)}const Es=Ee({name:"addTrainStandard",props:{item:{type:Object,default:()=>{}}},emits:["handleAdd","close"],setup(e,{emit:i}){var u,d,v;console.log("\u{1F680} ~ props",e.item);const t=Qt(),a=(/(localhost|192)/.test(location.host)?"https://ponline.colexiu.com":location.origin)+`/orchestra-music-score/?_t=${Date.now()}&id=${e.item.content}&modelType=practice&Authorization=${t.getToken}`,n=Fe(),l=ie({current:1,list:[{id:1,name:"\u5355\u56E2\u5B66\u751F",materialType:(u=e.item)==null?void 0:u.type,practiceTimes:"",startSection:"",endSection:"",speed:"",practiceDuration:""},{id:2,name:"\u53CC\u56E2\u5B66\u751F",materialType:(d=e.item)==null?void 0:d.type,practiceTimes:"",startSection:"",endSection:"",speed:"",practiceDuration:""},{id:3,name:"\u591A\u56E2\u5B66\u751F",materialType:(v=e.item)==null?void 0:v.type,practiceTimes:"",startSection:"",endSection:"",speed:"",practiceDuration:""}]});(()=>{var h;if(Array.isArray((h=e==null?void 0:e.item)==null?void 0:h.standards))for(let b=0;b<e.item.standards.length;b++){let m={};try{m=JSON.parse(e.item.standards[b].trainingConfigJson)}catch(p){}l.list[b].practiceTimes=m.practiceTimes,l.list[b].startSection=m.startSection,l.list[b].endSection=m.endSection,l.list[b].speed=m.speed,l.list[b].practiceDuration=m.practiceDuration}})();const c=()=>U(this,null,function*(){var b,m;if(((b=e.item)==null?void 0:b.type)=="VIDEO")for(let p=0;p<l.list.length;p++){if(!l.list[p].practiceTimes){n.error(`\u8BF7\u5B8C\u5584${l.list[p].name}\u7684\u89C2\u770B\u6B21\u6570`);return}if(!/^\+?[1-9]\d*$/.test(l.list[p].practiceTimes)){n.error(`\u8BF7\u8F93\u5165${l.list[p].name}\u6B63\u786E\u7684\u6570\u5B57\u89C2\u770B\u6B21\u6570`);return}}if(((m=e.item)==null?void 0:m.type)=="SONG")for(let p=0;p<l.list.length;p++){if(!l.list[p].startSection||!l.list[p].endSection||!l.list[p].speed||!l.list[p].practiceDuration){n.error(`\u8BF7\u5B8C\u5584${l.list[p].name}\u7684\u8BAD\u7EC3\u8981\u6C42`);return}if(!/^\+?[1-9]\d*$/.test(l.list[p].startSection)||!/^\+?[1-9]\d*$/.test(l.list[p].endSection)||!/^\+?[1-9]\d*$/.test(l.list[p].speed)||!/^\+?[1-9]\d*$/.test(l.list[p].practiceDuration)){n.error(`\u8BF7\u8F93\u5165${l.list[p].name}\u6B63\u786E\u7684\u6570\u5B57`);return}}let h=l.list.map((p,A)=>{var T,S;return{studentLevel:A+1,lessonTrainingId:(T=e.item)==null?void 0:T.lessonTrainingId,lessonTrainingDetailId:(S=e.item)==null?void 0:S.id,trainingConfigJson:JSON.stringify({materialType:p.materialType,practiceTimes:p.practiceTimes,startSection:p.startSection,endSection:p.endSection,speed:p.speed,practiceDuration:p.practiceDuration})}});console.log("\u{1F680} ~ list",h);try{const p=yield ri(h);n.success("\u4FDD\u5B58\u6210\u529F")}catch(p){}i("handleAdd")});return window.addEventListener("message",h=>{console.log(h.data);const b=h.data;b.api==="admin-selectMusicMeasure"&&l.list.forEach(m=>{m.startSection=m.startSection&&!b.change?m.startSection:b.start+"",m.endSection=m.endSection&&!b.change?m.endSection:b.end+"",m.speed=m.speed&&!b.change?m.speed:b.speed+""})}),console.log(l.list,"state.list"),()=>{var b,m,p,A,T;let h;return w("div",null,[w("div",null,[(b=e.item)==null?void 0:b.materialName]),((m=e.item)==null?void 0:m.type)=="VIDEO"&&w("div",null,[w(Ss,{styleValue:{width:"100%",height:"375px"},src:e.item.content},null),l.list.map(S=>w(Ze,{labelPlacement:"left"},{default:()=>[w(et,{title:S.name,showIcon:!1,bordered:!0,style:{marginBottom:"12px"}},null),w(X,{required:!0,label:"\u89C2\u770B\u6B21\u6570"},{default:()=>[w(ae,{placeholder:"\u8BF7\u8F93\u5165\u89C2\u770B\u6B21\u6570",showButton:!1,value:S.practiceTimes,"onUpdate:value":f=>S.practiceTimes=f,min:0},null)]})]}))]),((p=e.item)==null?void 0:p.type)==="SONG"&&w("div",null,[w("iframe",{width:"667px",height:"375px",frameborder:"0",src:a},null),w(Ze,{labelPlacement:"left"},As(h=l.list.map(S=>w(_e,null,[w(et,{title:S.name,showIcon:!1,bordered:!0,style:{marginBottom:"12px"}},null),w(X,{required:!0,label:"\u7EC3\u4E60\u5C0F\u8282"},{default:()=>[w(ae,{showButton:!1,placeholder:"\u5F00\u59CB\u5C0F\u8282",value:S.startSection,"onUpdate:value":f=>S.startSection=f,min:0,style:{width:"180px"}},null),H("~"),w(ae,{showButton:!1,placeholder:"\u7ED3\u675F\u5C0F\u8282",value:S.endSection,"onUpdate:value":f=>S.endSection=f,min:0,style:{width:"180px"}},null)]}),w(X,{label:"\u7EC3\u4E60\u901F\u5EA6",required:!0},{default:()=>[w(ae,{showButton:!1,placeholder:"\u7EC3\u4E60\u901F\u5EA6",value:S.speed,"onUpdate:value":f=>S.speed=f,min:0,style:{width:"180px"}},null)]}),w(X,{label:"\u7EC3\u4E60\u65F6\u957F",required:!0},{default:()=>[w(ae,{value:S.practiceDuration,"onUpdate:value":f=>S.practiceDuration=f,showButton:!1,min:0,style:{width:"180px"}},{suffix:()=>"\u5206\u949F"})]})])))?h:{default:()=>[h]})]),((A=e.item)==null?void 0:A.type)==="IMG"&&w("div",null,[w(Xt,{width:200,height:200,src:(T=e==null?void 0:e.item)==null?void 0:T.content},null)]),w(te,{justify:"end"},{default:()=>[w(W,{onClick:()=>i("close")},{default:()=>[H("\u53D6\u6D88")]}),w(W,{type:"primary",onClick:()=>c()},{default:()=>[H("\u786E\u8BA4")]})]})])}}}),Ps={VIDEO:"\u89C6\u9891",IMG:"\u56FE\u7247",SONG:"\u66F2\u76EE"},Hs=Ee({name:"after-class-training-detail",setup(){const e=Fe(),i=dt(),t=ei(),s=ti(),a=ie({name:t.query.name||"\u65B0\u5EFA\u8BFE\u540E\u4F5C\u4E1A",id:t.query.id,courseTypeCode:t.query.courseTypeCode}),n=ie({pagination:{page:1,rows:10,pageTotal:0},hasUpdate:!1,loading:!1,dataList:[],checkList:[],isMover:!1,visiableKnowledge:!1,trainModel:!1,trainItem:null,modalType:"add",detailData:{}}),l=()=>[{type:"selection"},{title:"\u7D20\u6750\u540D\u79F0",key:"materialName",render(d){return w(Bt,{authLink:"material/page1750897012676493314",to:{path:"/educationalManage/educationalManage",query:{id:d.materialId}}},{default:()=>[d.materialName]})}},{title:"\u8BFE\u7A0B\u7C7B\u578B",key:"courseTypeCode",render(d){var v;return((v=d==null?void 0:d.courseTypeCode)==null?void 0:v.split(",").map(h=>Ut[h]).join(","))||""}},{title:"\u7D20\u6750\u7C7B\u578B",key:"type",render(d){return Ps[d.type]}},{title:"\u7EC3\u4E60\u6807\u51C6",key:"standards",render(d){return Array.isArray(d.standards)&&d.standards.length?w(te,{size:"small",align:"center"},{default:()=>[w(tt,{dot:!0,type:"success"},null),w("span",null,[H("\u5DF2\u8BBE\u7F6E")])]}):w(te,{size:"small",align:"center"},{default:()=>[w(tt,{dot:!0,type:"error"},null),w("span",null,[H("\u672A\u8BBE\u7F6E")])]})}},{title:"\u64CD\u4F5C",key:"operation",fixed:"right",render(d,v){return w(te,null,{default:()=>[be(w(W,{text:!0,type:"primary",onClick:()=>{n.trainModel=!0,n.trainItem=d}},{default:()=>[Array.isArray(d.standards)&&d.standards.length?"\u4FEE\u6539\u8BAD\u7EC3\u6807\u51C6":"\u8BBE\u7F6E\u8BAD\u7EC3\u6807\u51C6"]}),[[ve("auth"),"lessonTrainingDetailTemp/batchUpSet1750902708004454402"]]),be(w(W,{text:!0,type:"primary",onClick:()=>c(d)},{default:()=>[H("\u5220\u9664")]}),[[ve("auth"),"lessonTrainingDetail/remove1608722927511257089"]])]})}}],o=()=>U(this,null,function*(){if(!!a.id){n.loading=!0;try{const{data:d}=yield oi({lessonTrainingId:a.id,page:1,rows:1e3});Array.isArray(d==null?void 0:d.rows)&&(n.dataList=d.rows,n.pagination.pageTotal=d.total)}catch(d){}n.loading=!1}});ht(()=>{o()});const c=d=>{if(n.hasUpdate){e.error("\u8FD8\u6709\u6CA1\u4FDD\u5B58\u7684\u5185\u5BB9,\u8BF7\u5148\u4FDD\u5B58");return}const v=i.warning({title:"\u8B66\u544A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\u8FD9\u4E9B\u7D20\u6750\u5173\u8054?",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>U(this,null,function*(){v.loading=!0;const h=d?[d.id]:n.checkList;try{const b=yield ci({ids:h.join(","),trainingId:a.id});(b==null?void 0:b.code)===200&&(n.checkList=[],e.success("\u5220\u9664\u6210\u529F"),o())}catch(b){}v.loading=!1})})},u=()=>{const d=n.dataList.find(v=>!v.standards.length);console.log("\u{1F680} ~ isOk",d),d?i.warning({title:"\u8B66\u544A",content:"\u8FD8\u6709\u7D20\u6750\u6CA1\u6709\u8BBE\u7F6E\u8BAD\u7EC3\u6807\u51C6,\u662F\u5426\u8FD4\u56DE?",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>{s.push("/afterClassTrainingManage")}}):s.push("/afterClassTrainingManage")};return()=>w("div",{class:"section-container"},[w(pi,{"on-back":()=>u(),title:a.name},null),w(te,{style:{padding:"15px 0"}},{default:()=>[be(w(W,{type:"primary",onClick:()=>n.visiableKnowledge=!0},{default:()=>[H("\u65B0\u589E\u8BAD\u7EC3\u5185\u5BB9")]}),[[ve("auth"),"lessonTrainingDetail/batchInsert1609121819994202113"]]),be(w(W,{type:"error",disabled:!n.checkList.length,onClick:()=>c()},{default:()=>[H("\u6279\u91CF\u5220\u9664")]}),[[ve("auth"),"lessonTrainingDetail/remove1608722927511257089"]])]}),w(mt,{loading:n.loading,rowKey:d=>d.id,columns:l(),data:n.dataList,onUpdateCheckedRowKeys:d=>{n.checkList=d}},null),w(ii,{width:"80vw",show:n.visiableKnowledge,"onUpdate:show":d=>n.visiableKnowledge=d},{default:()=>[w(si,{title:"\u65B0\u589E\u7D20\u6750\u5173\u8054",closable:!0},{default:()=>[w(fi,{parentData:a,onHandleSuccess:()=>{n.visiableKnowledge=!1,o()},onClose:d=>{n.visiableKnowledge=!1}},null)]})]}),w(ni,{show:n.trainModel,"onUpdate:show":d=>n.trainModel=d,preset:"dialog",showIcon:!1,title:"\u8BAD\u7EC3\u6807\u51C6\u8BBE\u7F6E",style:{width:"723px"}},{default:()=>[w(Es,{item:n.trainItem,onClose:()=>n.trainModel=!1,onHandleAdd:()=>{n.trainModel=!1,o()}},null)]})])}});export{Hs as default};