import{f as createNamespace,d as defineComponent,b as createVNode,h as addUnit,i as numericProp,w as withInstall,j as getSizeStyle,k as makeStringProp,l as makeNumericProp,t as truthProp,p as mergeProps,F as Fragment,N as NoticeBar,s as state,I as IPlatform,q as browser$1,u as toRefs,r as reactive,v as ref,x as onUnmounted,y as computed,z as storeData,A as createTextVNode,P as Popup,B as EvaluatingReportDriver,C as api_back,n as nextTick,g as getQuery,D as onBeforeMount,G as api_setStatusBarVisibility,o as onMounted,H as api_musicPracticeRecordDetail,J as getMusicDetail,K as watch,T as Transition,M as MusicScore,L as isSpecialShapedScreen,O as formateTimes,Q as api_cloudLoading}from"./instrument-db4fe0cc.js";const[name$3,bem$3]=createNamespace("skeleton-title"),skeletonTitleProps={round:Boolean,titleWidth:numericProp};var stdin_default$6=defineComponent({name:name$3,props:skeletonTitleProps,setup(e){return()=>createVNode("h3",{class:bem$3([{round:e.round}]),style:{width:addUnit(e.titleWidth)}},null)}});const SkeletonTitle=withInstall(stdin_default$6);var stdin_default$5=SkeletonTitle;const[name$2,bem$2]=createNamespace("skeleton-avatar"),skeletonAvatarProps={avatarSize:numericProp,avatarShape:makeStringProp("round")};var stdin_default$4=defineComponent({name:name$2,props:skeletonAvatarProps,setup(e){return()=>createVNode("div",{class:bem$2([e.avatarShape]),style:getSizeStyle(e.avatarSize)},null)}});const SkeletonAvatar=withInstall(stdin_default$4);var stdin_default$3=SkeletonAvatar;const DEFAULT_ROW_WIDTH="100%",skeletonParagraphProps={round:Boolean,rowWidth:{type:numericProp,default:DEFAULT_ROW_WIDTH}},[name$1,bem$1]=createNamespace("skeleton-paragraph");var stdin_default$2=defineComponent({name:name$1,props:skeletonParagraphProps,setup(e){return()=>createVNode("div",{class:bem$1([{round:e.round}]),style:{width:e.rowWidth}},null)}});const SkeletonParagraph=withInstall(stdin_default$2);var stdin_default$1=SkeletonParagraph;const[name,bem]=createNamespace("skeleton"),DEFAULT_LAST_ROW_WIDTH="60%",skeletonProps={row:makeNumericProp(0),round:Boolean,title:Boolean,titleWidth:numericProp,avatar:Boolean,avatarSize:numericProp,avatarShape:makeStringProp("round"),loading:truthProp,animate:truthProp,rowWidth:{type:[Number,String,Array],default:DEFAULT_ROW_WIDTH}};var stdin_default=defineComponent({name,inheritAttrs:!1,props:skeletonProps,setup(e,{slots:i,attrs:t}){const s=()=>{if(e.avatar)return createVNode(stdin_default$3,{avatarShape:e.avatarShape,avatarSize:e.avatarSize},null)},n=()=>{if(e.title)return createVNode(stdin_default$5,{round:e.round,titleWidth:e.titleWidth},null)},a=l=>{const{rowWidth:c}=e;return c===DEFAULT_ROW_WIDTH&&l===+e.row-1?DEFAULT_LAST_ROW_WIDTH:Array.isArray(c)?c[l]:c},o=()=>Array(+e.row).fill("").map((l,c)=>createVNode(stdin_default$1,{key:c,round:e.round,rowWidth:addUnit(a(c))},null)),r=()=>i.template?i.template():createVNode(Fragment,null,[s(),createVNode("div",{class:bem("content")},[n(),o()])]);return()=>{var l;return e.loading?createVNode("div",mergeProps({class:bem({animate:e.animate,round:e.round})},t),[r()]):(l=i.default)==null?void 0:l.call(i)}}});const Skeleton=withInstall(stdin_default),detail="_detail_16zle_5",skeleton="_skeleton_16zle_12",pageBg="_pageBg_16zle_28",headHeight="_headHeight_16zle_43",headHide="_headHide_16zle_52",container$1="_container_16zle_55",musicName="_musicName_16zle_70",right$1="_right_16zle_77",inaccuracy="_inaccuracy_16zle_81",wrong="_wrong_16zle_85",notPlay="_notPlay_16zle_89",intonation_wrong="_intonation_wrong_16zle_93",intonation_high="_intonation_high_16zle_97",intonation_low="_intonation_low_16zle_101",cadence_wrong="_cadence_wrong_16zle_105",cadence_fast="_cadence_fast_16zle_109",cadence_slow="_cadence_slow_16zle_113",integrity_wrong="_integrity_wrong_16zle_117",arrowSvg="_arrowSvg_16zle_121",bg2Left="_bg2Left_16zle_126",bg2Right="_bg2Right_16zle_132",styles$2={detail,skeleton,pageBg,headHeight,headHide,container:container$1,musicName,right:right$1,inaccuracy,wrong,notPlay,intonation_wrong,intonation_high,intonation_low,cadence_wrong,cadence_fast,cadence_slow,integrity_wrong,arrowSvg,bg2Left,bg2Right},headerTop="_headerTop_1dnwk_1",android="_android_1dnwk_12",back="_back_1dnwk_15",disabled="_disabled_1dnwk_27",left="_left_1dnwk_30",leftContent="_leftContent_1dnwk_34",lcName="_lcName_1dnwk_34",lcScore="_lcScore_1dnwk_52",center="_center_1dnwk_58",cItem="_cItem_1dnwk_63",active="_active_1dnwk_85",middle="_middle_1dnwk_92",mScore="_mScore_1dnwk_113",mLabel="_mLabel_1dnwk_119",padMiddle="_padMiddle_1dnwk_135",right="_right_1dnwk_138",btn="_btn_1dnwk_142",iconBtn="_iconBtn_1dnwk_158",btnWrap="_btnWrap_1dnwk_168",popup="_popup_1dnwk_173",playerBoxContent="_playerBoxContent_1dnwk_187",playerBoxCon="_playerBoxCon_1dnwk_187",padPlayerBox="_padPlayerBox_1dnwk_197",playerBox="_playerBox_1dnwk_187",videoBox="_videoBox_1dnwk_290",audioBox="_audioBox_1dnwk_294",audioBga="_audioBga_1dnwk_303",audioBga1="_audioBga1_1dnwk_307",audioBga2="_audioBga2_1dnwk_313",audioVisualizer="_audioVisualizer_1dnwk_326",videoPlayerBox="_videoPlayerBox_1dnwk_334",demos="_demos_1dnwk_360",shiyiClose$1="_shiyiClose_1dnwk_393",shiyiPopup="_shiyiPopup_1dnwk_401",shiyiTop$1="_shiyiTop_1dnwk_409",shiyiTitle="_shiyiTitle_1dnwk_416",items="_items_1dnwk_422",item="_item_1dnwk_422",itemTone="_itemTone_1dnwk_445",tyImg$1="_tyImg_1dnwk_466",playLarge="_playLarge_1dnwk_474",playIngShow="_playIngShow_1dnwk_486",gramoBox="_gramoBox_1dnwk_489",gramoPan="_gramoPan_1dnwk_503",rotateImg="_rotateImg_1dnwk_1",imgRotate="_imgRotate_1dnwk_514",audioImg="_audioImg_1dnwk_517",audioPoint="_audioPoint_1dnwk_523",audioZhen="_audioZhen_1dnwk_534",styles$1={headerTop,android,back,disabled,left,leftContent,lcName,lcScore,center,cItem,active,middle,mScore,mLabel,padMiddle,right,btn,iconBtn,btnWrap,popup,playerBoxContent,playerBoxCon,padPlayerBox,playerBox,videoBox,audioBox,audioBga,audioBga1,audioBga2,audioVisualizer,videoPlayerBox,demos,shiyiClose:shiyiClose$1,shiyiPopup,shiyiTop:shiyiTop$1,shiyiTitle,items,item,itemTone,tyImg:tyImg$1,playLarge,playIngShow,gramoBox,gramoPan,rotateImg,imgRotate,audioImg,audioPoint,audioZhen},iconBack="data:image/png;base64,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",iconShiyi=""+new URL("../png/icon-shiyi-d9070602.png",import.meta.url).href,iconhuifang="data:image/png;base64,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",shiyiTop=""+new URL("../png/shiyi-top-3e1d9297.png",import.meta.url).href,shiyiClose=""+new URL("../png/closeImg-5487d70c.png",import.meta.url).href,musicBg=""+new URL("../png/music_bg-7bc33289.png",import.meta.url).href,tyImg=""+new URL("../png/ty-56e3a830.png",import.meta.url).href,videobg=""+new URL("../png/videobg-28992a9b.png",import.meta.url).href,plyr="";function _defineProperty$1(e,i,t){return(i=_toPropertyKey(i))in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}function _toPrimitive(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 _toPropertyKey(e){var i=_toPrimitive(e,"string");return typeof i=="symbol"?i:String(i)}function _classCallCheck(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,i){for(var t=0;ti){var t=getDecimalPlaces(i);return parseFloat(e.toFixed(t))}return Math.round(e/i)*i}var RangeTouch=function(){function e(i,t){_classCallCheck(this,e),is$1.element(i)?this.element=i:is$1.string(i)&&(this.element=document.querySelector(i)),is$1.element(this.element)&&is$1.empty(this.element.rangeTouch)&&(this.config=_objectSpread2({},defaults$1,{},t),this.init())}return _createClass(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(n){t.element[s](n,function(a){return t.set(a)},!1)})}},{key:"get",value:function(i){if(!e.enabled||!is$1.event(i))return null;var t,s=i.target,n=i.changedTouches[0],a=parseFloat(s.getAttribute("min"))||0,o=parseFloat(s.getAttribute("max"))||100,r=parseFloat(s.getAttribute("step"))||1,l=s.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(t=100/l.width*(n.clientX-l.left))?t=0:100t?t-=(100-2*t)*c:50e!=null?e.constructor:null,instanceOf=(e,i)=>!!(e&&i&&e instanceof i),isNullOrUndefined=e=>e==null,isObject=e=>getConstructor(e)===Object,isNumber=e=>getConstructor(e)===Number&&!Number.isNaN(e),isString=e=>getConstructor(e)===String,isBoolean=e=>getConstructor(e)===Boolean,isFunction=e=>typeof e=="function",isArray=e=>Array.isArray(e),isWeakMap=e=>instanceOf(e,WeakMap),isNodeList=e=>instanceOf(e,NodeList),isTextNode=e=>getConstructor(e)===Text,isEvent=e=>instanceOf(e,Event),isKeyboardEvent=e=>instanceOf(e,KeyboardEvent),isCue=e=>instanceOf(e,window.TextTrackCue)||instanceOf(e,window.VTTCue),isTrack=e=>instanceOf(e,TextTrack)||!isNullOrUndefined(e)&&isString(e.kind),isPromise=e=>instanceOf(e,Promise)&&isFunction(e.then),isElement=e=>e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object",isEmpty=e=>isNullOrUndefined(e)||(isString(e)||isArray(e)||isNodeList(e))&&!e.length||isObject(e)&&!Object.keys(e).length,isUrl=e=>{if(instanceOf(e,window.URL))return!0;if(!isString(e))return!1;let i=e;e.startsWith("http://")&&e.startsWith("https://")||(i=`http://${e}`);try{return!isEmpty(new URL(i).hostname)}catch(t){return!1}};var is={nullOrUndefined:isNullOrUndefined,object:isObject,number:isNumber,string:isString,boolean:isBoolean,function:isFunction,array:isArray,weakMap:isWeakMap,nodeList:isNodeList,element:isElement,textNode:isTextNode,event:isEvent,keyboardEvent:isKeyboardEvent,cue:isCue,track:isTrack,promise:isPromise,url:isUrl,empty:isEmpty};const transitionEndEvent=(()=>{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!!is.string(t)&&i[t]})();function repaint(e,i){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(t){}},i)}const isIE=!!window.document.documentMode,isEdge=/Edge/g.test(navigator.userAgent),isWebKit="WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),isIPhone=/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,isIPadOS=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,isIos=/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var browser={isIE,isEdge,isWebKit,isIPhone,isIPadOS,isIos};function cloneDeep(e){return JSON.parse(JSON.stringify(e))}function getDeep(e,i){return i.split(".").reduce((t,s)=>t&&t[s],e)}function extend(e={},...i){if(!i.length)return e;const t=i.shift();return is.object(t)?(Object.keys(t).forEach(s=>{is.object(t[s])?(Object.keys(e).includes(s)||Object.assign(e,{[s]:{}}),extend(e[s],t[s])):Object.assign(e,{[s]:t[s]})}),extend(e,...i)):e}function wrap(e,i){const t=e.length?e:[e];Array.from(t).reverse().forEach((s,n)=>{const a=n>0?i.cloneNode(!0):i,o=s.parentNode,r=s.nextSibling;a.appendChild(s),r?o.insertBefore(a,r):o.appendChild(a)})}function setAttributes(e,i){is.element(e)&&!is.empty(i)&&Object.entries(i).filter(([,t])=>!is.nullOrUndefined(t)).forEach(([t,s])=>e.setAttribute(t,s))}function createElement(e,i,t){const s=document.createElement(e);return is.object(i)&&setAttributes(s,i),is.string(t)&&(s.innerText=t),s}function insertAfter(e,i){is.element(e)&&is.element(i)&&i.parentNode.insertBefore(e,i.nextSibling)}function insertElement(e,i,t,s){is.element(i)&&i.appendChild(createElement(e,t,s))}function removeElement(e){is.nodeList(e)||is.array(e)?Array.from(e).forEach(removeElement):is.element(e)&&is.element(e.parentNode)&&e.parentNode.removeChild(e)}function emptyElement(e){if(!is.element(e))return;let{length:i}=e.childNodes;for(;i>0;)e.removeChild(e.lastChild),i-=1}function replaceElement(e,i){return is.element(i)&&is.element(i.parentNode)&&is.element(e)?(i.parentNode.replaceChild(e,i),e):null}function getAttributesFromSelector(e,i){if(!is.string(e)||is.empty(e))return{};const t={},s=extend({},i);return e.split(",").forEach(n=>{const a=n.trim(),o=a.replace(".",""),r=a.replace(/[[\]]/g,"").split("="),[l]=r,c=r.length>1?r[1].replace(/["']/g,""):"";switch(a.charAt(0)){case".":is.string(s.class)?t.class=`${s.class} ${o}`:t.class=o;break;case"#":t.id=a.replace("#","");break;case"[":t[l]=c}}),extend(s,t)}function toggleHidden(e,i){if(!is.element(e))return;let t=i;is.boolean(t)||(t=!e.hidden),e.hidden=t}function toggleClass(e,i,t){if(is.nodeList(e))return Array.from(e).map(s=>toggleClass(s,i,t));if(is.element(e)){let s="toggle";return t!==void 0&&(s=t?"add":"remove"),e.classList[s](i),e.classList.contains(i)}return!1}function hasClass(e,i){return is.element(e)&&e.classList.contains(i)}function matches(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 closest$1(e,i){const{prototype:t}=Element;return(t.closest||function(){let s=this;do{if(matches.matches(s,i))return s;s=s.parentElement||s.parentNode}while(s!==null&&s.nodeType===1);return null}).call(e,i)}function getElements(e){return this.elements.container.querySelectorAll(e)}function getElement(e){return this.elements.container.querySelector(e)}function setFocus(e=null,i=!1){is.element(e)&&e.focus({preventScroll:!0,focusVisible:i})}const defaultCodecs={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},support={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,i){const t=support[e]||i!=="html5";return{api:t,ui:t&&support.rangeInput}},pip:!(browser.isIPhone||!is.function(createElement("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||createElement("video").disablePictureInPicture)),airplay:is.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(is.empty(e))return!1;const[i]=e.split("/");let t=e;if(!this.isHTML5||i!==this.type)return!1;Object.keys(defaultCodecs).includes(t)&&(t+=`; codecs="${defaultCodecs[e]}"`);try{return!!(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:transitionEndEvent!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},supportsPassiveListeners=(()=>{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 toggleListener(e,i,t,s=!1,n=!0,a=!1){if(!e||!("addEventListener"in e)||is.empty(i)||!is.function(t))return;const o=i.split(" ");let r=a;supportsPassiveListeners&&(r={passive:n,capture:a}),o.forEach(l=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:l,callback:t,options:r}),e[s?"addEventListener":"removeEventListener"](l,t,r)})}function on(e,i="",t,s=!0,n=!1){toggleListener.call(this,e,i,t,!0,s,n)}function off(e,i="",t,s=!0,n=!1){toggleListener.call(this,e,i,t,!1,s,n)}function once(e,i="",t,s=!0,n=!1){const a=(...o)=>{off(e,i,a,s,n),t.apply(this,o)};toggleListener.call(this,e,i,a,!0,s,n)}function triggerEvent(e,i="",t=!1,s={}){if(!is.element(e)||is.empty(i))return;const n=new CustomEvent(i,{bubbles:t,detail:{...s,plyr:this}});e.dispatchEvent(n)}function unbindListeners(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:i,type:t,callback:s,options:n}=e;i.removeEventListener(t,s,n)}),this.eventListeners=[])}function ready(){return new Promise(e=>this.ready?setTimeout(e,0):on.call(this,this.elements.container,"ready",e)).then(()=>{})}function silencePromise(e){is.promise(e)&&e.then(null,()=>{})}function dedupe(e){return is.array(e)?e.filter((i,t)=>e.indexOf(i)===t):e}function closest(e,i){return is.array(e)&&e.length?e.reduce((t,s)=>Math.abs(s-i)({...e,[i/t]:[i,t]}),{});function validateAspectRatio(e){return is.array(e)||is.string(e)&&e.includes(":")?(is.array(e)?e:e.split(":")).map(Number).every(is.number):!1}function reduceAspectRatio(e){if(!is.array(e)||!e.every(is.number))return null;const[i,t]=e,s=(a,o)=>o===0?a:s(o,a%o),n=s(i,t);return[i/n,t/n]}function getAspectRatio(e){const i=s=>validateAspectRatio(s)?s.split(":").map(Number):null;let t=i(e);if(t===null&&(t=i(this.config.ratio)),t===null&&!is.empty(this.embed)&&is.array(this.embed.ratio)&&({ratio:t}=this.embed),t===null&&this.isHTML5){const{videoWidth:s,videoHeight:n}=this.media;t=[s,n]}return reduceAspectRatio(t)}function setAspectRatio(e){if(!this.isVideo)return{};const{wrapper:i}=this.elements,t=getAspectRatio.call(this,e);if(!is.array(t))return{};const[s,n]=reduceAspectRatio(t),a=100/s*n;if(supportsCSS(`aspect-ratio: ${s}/${n}`)?i.style.aspectRatio=`${s}/${n}`:i.style.paddingBottom=`${a}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const o=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),r=(o-a)/(o/50);this.fullscreen.active?i.style.paddingBottom=null:this.media.style.transform=`translateY(-${r}%)`}else this.isHTML5&&i.classList.add(this.config.classNames.videoFixedRatio);return{padding:a,ratio:t}}function roundAspectRatio(e,i,t=.05){const s=e/i,n=closest(Object.keys(standardRatios),s);return Math.abs(n-s)<=t?standardRatios[n]:[e,i]}function getViewportSize(){return[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)]}const html5={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(e=>{const i=e.getAttribute("type");return!!is.empty(i)||support.mime.call(this,i)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:html5.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,is.empty(this.config.ratio)||setAspectRatio.call(e),Object.defineProperty(e.media,"quality",{get(){const i=html5.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&&is.function(e.config.quality.onChange))e.config.quality.onChange(i);else{const t=html5.getSources.call(e).find(l=>Number(l.getAttribute("size"))===i);if(!t)return;const{currentTime:s,paused:n,preload:a,readyState:o,playbackRate:r}=e.media;e.media.src=t.getAttribute("src"),(a!=="none"||o)&&(e.once("loadedmetadata",()=>{e.speed=r,e.currentTime=s,n||silencePromise(e.play())}),e.media.load())}triggerEvent.call(e,e.media,"qualitychange",!1,{quality:i})}}})},cancelRequests(){this.isHTML5&&(removeElement(html5.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function generateId(e){return`${e}-${Math.floor(1e4*Math.random())}`}function format(e,...i){return is.empty(e)?e:e.toString().replace(/{(\d+)}/g,(t,s)=>i[s].toString())}function getPercentage(e,i){return e===0||i===0||Number.isNaN(e)||Number.isNaN(i)?0:(e/i*100).toFixed(2)}const replaceAll=(e="",i="",t="")=>e.replace(new RegExp(i.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),t.toString()),toTitleCase=(e="")=>e.toString().replace(/\w\S*/g,i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase());function toPascalCase(e=""){let i=e.toString();return i=replaceAll(i,"-"," "),i=replaceAll(i,"_"," "),i=toTitleCase(i),replaceAll(i," ","")}function toCamelCase(e=""){let i=e.toString();return i=toPascalCase(i),i.charAt(0).toLowerCase()+i.slice(1)}function stripHTML(e){const i=document.createDocumentFragment(),t=document.createElement("div");return i.appendChild(t),t.innerHTML=e,i.firstChild.innerText}function getHTML(e){const i=document.createElement("div");return i.appendChild(e),i.innerHTML}const resources={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},i18n={get(e="",i={}){if(is.empty(e)||is.empty(i))return"";let t=getDeep(i.i18n,e);if(is.empty(t))return Object.keys(resources).includes(e)?resources[e]:"";const s={"{seektime}":i.seekTime,"{title}":i.title};return Object.entries(s).forEach(([n,a])=>{t=replaceAll(t,n,a)}),t}};class Storage{constructor(i){_defineProperty$1(this,"get",t=>{if(!Storage.supported||!this.enabled)return null;const s=window.localStorage.getItem(this.key);if(is.empty(s))return null;const n=JSON.parse(s);return is.string(t)&&t.length?n[t]:n}),_defineProperty$1(this,"set",t=>{if(!Storage.supported||!this.enabled||!is.object(t))return;let s=this.get();is.empty(s)&&(s={}),extend(s,t);try{window.localStorage.setItem(this.key,JSON.stringify(s))}catch(n){}}),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 fetch(e,i="text"){return new Promise((t,s)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;n.addEventListener("load",()=>{if(i==="text")try{t(JSON.parse(n.responseText))}catch(a){t(n.responseText)}else t(n.response)}),n.addEventListener("error",()=>{throw new Error(n.status)}),n.open("GET",e,!0),n.responseType=i,n.send()}catch(n){s(n)}})}function loadSprite(e,i){if(!is.string(e))return;const t="cache",s=is.string(i);let n=!1;const a=()=>document.getElementById(i)!==null,o=(r,l)=>{r.innerHTML=l,s&&a()||document.body.insertAdjacentElement("afterbegin",r)};if(!s||!a()){const r=Storage.supported,l=document.createElement("div");if(l.setAttribute("hidden",""),s&&l.setAttribute("id",i),r){const c=window.localStorage.getItem(`${t}-${i}`);if(n=c!==null,n){const h=JSON.parse(c);o(l,h.content)}}fetch(e).then(c=>{if(!is.empty(c)){if(r)try{window.localStorage.setItem(`${t}-${i}`,JSON.stringify({content:c}))}catch(h){}o(l,c)}}).catch(()=>{})}}const getHours=e=>Math.trunc(e/60/60%60,10),getMinutes=e=>Math.trunc(e/60%60,10),getSeconds=e=>Math.trunc(e%60,10);function formatTime(e=0,i=!1,t=!1){if(!is.number(e))return formatTime(void 0,i,t);const s=r=>`0${r}`.slice(-2);let n=getHours(e);const a=getMinutes(e),o=getSeconds(e);return n=i||n>0?`${n}:`:"",`${t&&e>0?"-":""}${n}${s(a)}:${s(o)}`}const controls={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||browser.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:t}},findElements(){try{return this.elements.controls=getElement.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:getElements.call(this,this.config.selectors.buttons.play),pause:getElement.call(this,this.config.selectors.buttons.pause),restart:getElement.call(this,this.config.selectors.buttons.restart),rewind:getElement.call(this,this.config.selectors.buttons.rewind),fastForward:getElement.call(this,this.config.selectors.buttons.fastForward),mute:getElement.call(this,this.config.selectors.buttons.mute),pip:getElement.call(this,this.config.selectors.buttons.pip),airplay:getElement.call(this,this.config.selectors.buttons.airplay),settings:getElement.call(this,this.config.selectors.buttons.settings),captions:getElement.call(this,this.config.selectors.buttons.captions),fullscreen:getElement.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=getElement.call(this,this.config.selectors.progress),this.elements.inputs={seek:getElement.call(this,this.config.selectors.inputs.seek),volume:getElement.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:getElement.call(this,this.config.selectors.display.buffer),currentTime:getElement.call(this,this.config.selectors.display.currentTime),duration:getElement.call(this,this.config.selectors.display.duration)},is.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=controls.getIconUrl.call(this),n=`${s.cors?"":s.url}#${this.config.iconPrefix}`,a=document.createElementNS(t,"svg");setAttributes(a,extend(i,{"aria-hidden":"true",focusable:"false"}));const o=document.createElementNS(t,"use"),r=`${n}-${e}`;return"href"in o&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",r),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),a.appendChild(o),a},createLabel(e,i={}){const t=i18n.get(e,this.config);return createElement("span",{...i,class:[i.class,this.config.classNames.hidden].filter(Boolean).join(" ")},t)},createBadge(e){if(is.empty(e))return null;const i=createElement("span",{class:this.config.classNames.menu.value});return i.appendChild(createElement("span",{class:this.config.classNames.menu.badge},e)),i},createButton(e,i){const t=extend({},i);let s=toCamelCase(e);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(o=>{Object.keys(t).includes(o)&&(n[o]=t[o],delete t[o])}),n.element!=="button"||Object.keys(t).includes("type")||(t.type="button"),Object.keys(t).includes("class")?t.class.split(" ").some(o=>o===this.config.classNames.control)||extend(t,{class:`${t.class} ${this.config.classNames.control}`}):t.class=this.config.classNames.control,e){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":t.class+=` ${this.config.classNames.control}--overlaid`,s="play",n.label="play",n.icon="play";break;default:is.empty(n.label)&&(n.label=s),is.empty(n.icon)&&(n.icon=e)}const a=createElement(n.element);return n.toggle?(a.appendChild(controls.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(controls.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(controls.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(controls.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(controls.createIcon.call(this,n.icon)),a.appendChild(controls.createLabel.call(this,n.label))),extend(t,getAttributesFromSelector(this.config.selectors.buttons[s],t)),setAttributes(a,t),s==="play"?(is.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(a)):this.elements.buttons[s]=a,a},createRange(e,i){const t=createElement("input",extend(getAttributesFromSelector(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":i18n.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},i));return this.elements.inputs[e]=t,controls.updateRangeFill.call(this,t),RangeTouch.setup(t),t},createProgress(e,i){const t=createElement("progress",extend(getAttributesFromSelector(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},i));if(e!=="volume"){t.appendChild(createElement("span",null,"0"));const s={played:"played",buffer:"buffered"}[e],n=s?i18n.get(s,this.config):"";t.innerText=`% ${n.toLowerCase()}`}return this.elements.display[e]=t,t},createTime(e,i){const t=getAttributesFromSelector(this.config.selectors.display[e],i),s=createElement("div",extend(t,{class:`${t.class?t.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":i18n.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,i){on.call(this,e,"keydown keyup",t=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(t.key)||(t.preventDefault(),t.stopPropagation(),t.type==="keydown"))return;const s=matches(e,'[role="menuitemradio"]');if(!s&&[" ","ArrowRight"].includes(t.key))controls.showMenuPanel.call(this,i,!0);else{let n;t.key!==" "&&(t.key==="ArrowDown"||s&&t.key==="ArrowRight"?(n=e.nextElementSibling,is.element(n)||(n=e.parentNode.firstElementChild)):(n=e.previousElementSibling,is.element(n)||(n=e.parentNode.lastElementChild)),setFocus.call(this,n,!0))}},!1),on.call(this,e,"keyup",t=>{t.key==="Return"&&controls.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:i,type:t,title:s,badge:n=null,checked:a=!1}){const o=getAttributesFromSelector(this.config.selectors.inputs[t]),r=createElement("button",extend(o,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${o.class?o.class:""}`.trim(),"aria-checked":a,value:e})),l=createElement("span");l.innerHTML=s,is.element(n)&&l.appendChild(n),r.appendChild(l),Object.defineProperty(r,"checked",{enumerable:!0,get:()=>r.getAttribute("aria-checked")==="true",set(c){c&&Array.from(r.parentNode.children).filter(h=>matches(h,'[role="menuitemradio"]')).forEach(h=>h.setAttribute("aria-checked","false")),r.setAttribute("aria-checked",c?"true":"false")}}),this.listeners.bind(r,"click keyup",c=>{if(!is.keyboardEvent(c)||c.key===" "){switch(c.preventDefault(),c.stopPropagation(),r.checked=!0,t){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}controls.showMenuPanel.call(this,"home",is.keyboardEvent(c))}},t,!1),controls.bindMenuItemShortcuts.call(this,r,t),i.appendChild(r)},formatTime(e=0,i=!1){return is.number(e)?formatTime(e,getHours(this.duration)>0,i):e},updateTimeDisplay(e=null,i=0,t=!1){is.element(e)&&is.number(i)&&(e.innerText=controls.formatTime(i,t))},updateVolume(){this.supported.ui&&(is.element(this.elements.inputs.volume)&&controls.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),is.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(e,i=0){is.element(e)&&(e.value=i,controls.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!is.event(e))return;let i=0;const t=(s,n)=>{const a=is.number(n)?n:0,o=is.element(s)?s:this.elements.display.buffer;if(is.element(o)){o.value=a;const r=o.getElementsByTagName("span")[0];is.element(r)&&(r.childNodes[0].nodeValue=a)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":i=getPercentage(this.currentTime,this.duration),e.type==="timeupdate"&&controls.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=is.event(e)?e.target:e;if(is.element(i)&&i.getAttribute("type")==="range"){if(matches(i,this.config.selectors.inputs.seek)){i.setAttribute("aria-valuenow",this.currentTime);const t=controls.formatTime(this.currentTime),s=controls.formatTime(this.duration),n=i18n.get("seekLabel",this.config);i.setAttribute("aria-valuetext",n.replace("{currentTime}",t).replace("{duration}",s))}else if(matches(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);(browser.isWebKit||browser.isIPadOS)&&i.style.setProperty("--value",i.value/i.max*100+"%")}},updateSeekTooltip(e){var i,t;if(!this.config.tooltips.seek||!is.element(this.elements.inputs.seek)||!is.element(this.elements.display.seekTooltip)||this.duration===0)return;const s=this.elements.display.seekTooltip,n=`${this.config.classNames.tooltip}--visible`,a=h=>toggleClass(s,n,h);if(this.touch)return void a(!1);let o=0;const r=this.elements.progress.getBoundingClientRect();if(is.event(e))o=100/r.width*(e.pageX-r.left);else{if(!hasClass(s,n))return;o=parseFloat(s.style.left,10)}o<0?o=0:o>100&&(o=100);const l=this.duration/100*o;s.innerText=controls.formatTime(l);const c=(i=this.config.markers)===null||i===void 0||(t=i.points)===null||t===void 0?void 0:t.find(({time:h})=>h===Math.round(l));c&&s.insertAdjacentHTML("afterbegin",`${c.label}
`),s.style.left=`${o}%`,is.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&a(e.type==="mouseenter")},timeUpdate(e){const i=!is.element(this.elements.display.duration)&&this.config.invertTime;controls.updateTimeDisplay.call(this,this.elements.display.currentTime,i?this.duration-this.currentTime:this.currentTime,i),e&&e.type==="timeupdate"&&this.media.seeking||controls.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return toggleHidden(this.elements.display.currentTime,!0),void toggleHidden(this.elements.progress,!0);is.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=is.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&controls.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&controls.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&controls.setMarkers.call(this),controls.updateSeekTooltip.call(this)},toggleMenuButton(e,i){toggleHidden(this.elements.settings.buttons[e],!i)},updateSetting(e,i,t){const s=this.elements.settings.panels[e];let n=null,a=i;if(e==="captions")n=this.currentTrack;else{if(n=is.empty(t)?this[e]:t,is.empty(n)&&(n=this.config[e].default),!is.empty(this.options[e])&&!this.options[e].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${e}`);if(!this.config[e].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${e}`)}if(is.element(a)||(a=s&&s.querySelector('[role="menu"]')),!is.element(a))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=controls.getLabel.call(this,e,n);const o=a&&a.querySelector(`[value="${n}"]`);is.element(o)&&(o.checked=!0)},getLabel(e,i){switch(e){case"speed":return i===1?i18n.get("normal",this.config):`${i}×`;case"quality":if(is.number(i)){const t=i18n.get(`qualityLabel.${i}`,this.config);return t.length?t:`${i}p`}return toTitleCase(i);case"captions":return captions.getLabel.call(this);default:return null}},setQualityMenu(e){if(!is.element(this.elements.settings.panels.quality))return;const i="quality",t=this.elements.settings.panels.quality.querySelector('[role="menu"]');is.array(e)&&(this.options.quality=dedupe(e).filter(a=>this.config.quality.options.includes(a)));const s=!is.empty(this.options.quality)&&this.options.quality.length>1;if(controls.toggleMenuButton.call(this,i,s),emptyElement(t),controls.checkMenu.call(this),!s)return;const n=a=>{const o=i18n.get(`qualityBadge.${a}`,this.config);return o.length?controls.createBadge.call(this,o):null};this.options.quality.sort((a,o)=>{const r=this.config.quality.options;return r.indexOf(a)>r.indexOf(o)?1:-1}).forEach(a=>{controls.createMenuItem.call(this,{value:a,list:t,type:i,title:controls.getLabel.call(this,"quality",a),badge:n(a)})}),controls.updateSetting.call(this,i,t)},setCaptionsMenu(){if(!is.element(this.elements.settings.panels.captions))return;const e="captions",i=this.elements.settings.panels.captions.querySelector('[role="menu"]'),t=captions.getTracks.call(this),s=!!t.length;if(controls.toggleMenuButton.call(this,e,s),emptyElement(i),controls.checkMenu.call(this),!s)return;const n=t.map((a,o)=>({value:o,checked:this.captions.toggled&&this.currentTrack===o,title:captions.getLabel.call(this,a),badge:a.language&&controls.createBadge.call(this,a.language.toUpperCase()),list:i,type:"language"}));n.unshift({value:-1,checked:!this.captions.toggled,title:i18n.get("disabled",this.config),list:i,type:"language"}),n.forEach(controls.createMenuItem.bind(this)),controls.updateSetting.call(this,e,i)},setSpeedMenu(){if(!is.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=!is.empty(this.options.speed)&&this.options.speed.length>1;controls.toggleMenuButton.call(this,e,t),emptyElement(i),controls.checkMenu.call(this),t&&(this.options.speed.forEach(s=>{controls.createMenuItem.call(this,{value:s,list:i,type:e,title:controls.getLabel.call(this,"speed",s)})}),controls.updateSetting.call(this,e,i))},checkMenu(){const{buttons:e}=this.elements.settings,i=!is.empty(e)&&Object.values(e).some(t=>!t.hidden);toggleHidden(this.elements.settings.menu,!i)},focusFirstMenuItem(e,i=!1){if(this.elements.settings.popup.hidden)return;let t=e;is.element(t)||(t=Object.values(this.elements.settings.panels).find(n=>!n.hidden));const s=t.querySelector('[role^="menuitem"]');setFocus.call(this,s,i)},toggleMenu(e){const{popup:i}=this.elements.settings,t=this.elements.buttons.settings;if(!is.element(i)||!is.element(t))return;const{hidden:s}=i;let n=s;if(is.boolean(e))n=e;else if(is.keyboardEvent(e)&&e.key==="Escape")n=!1;else if(is.event(e)){const a=is.function(e.composedPath)?e.composedPath()[0]:e.target,o=i.contains(a);if(o||!o&&e.target!==t&&n)return}t.setAttribute("aria-expanded",n),toggleHidden(i,!n),toggleClass(this.elements.container,this.config.classNames.menu.open,n),n&&is.keyboardEvent(e)?controls.focusFirstMenuItem.call(this,null,!0):n||s||setFocus.call(this,t,is.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 removeElement(i),{width:t,height:s}},showMenuPanel(e="",i=!1){const t=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!is.element(t))return;const s=t.parentNode,n=Array.from(s.children).find(a=>!a.hidden);if(support.transitions&&!support.reducedMotion){s.style.width=`${n.scrollWidth}px`,s.style.height=`${n.scrollHeight}px`;const a=controls.getMenuSize.call(this,t),o=r=>{r.target===s&&["width","height"].includes(r.propertyName)&&(s.style.width="",s.style.height="",off.call(this,s,transitionEndEvent,o))};on.call(this,s,transitionEndEvent,o),s.style.width=`${a.width}px`,s.style.height=`${a.height}px`}toggleHidden(n,!0),toggleHidden(t,!1),controls.focusFirstMenuItem.call(this,t,i)},setDownloadUrl(){const e=this.elements.buttons.download;is.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:i,createButton:t,createProgress:s,createRange:n,createTime:a,setQualityMenu:o,setSpeedMenu:r,showMenuPanel:l}=controls;this.elements.controls=null,is.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(t.call(this,"play-large"));const c=createElement("div",getAttributesFromSelector(this.config.selectors.controls.wrapper));this.elements.controls=c;const h={class:"plyr__controls__item"};return dedupe(is.array(this.config.controls)?this.config.controls:[]).forEach(m=>{if(m==="restart"&&c.appendChild(t.call(this,"restart",h)),m==="rewind"&&c.appendChild(t.call(this,"rewind",h)),m==="play"&&c.appendChild(t.call(this,"play",h)),m==="fast-forward"&&c.appendChild(t.call(this,"fast-forward",h)),m==="progress"){const u=createElement("div",{class:`${h.class} plyr__progress__container`}),g=createElement("div",getAttributesFromSelector(this.config.selectors.progress));if(g.appendChild(n.call(this,"seek",{id:`plyr-seek-${e.id}`})),g.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const y=createElement("span",{class:this.config.classNames.tooltip},"00:00");g.appendChild(y),this.elements.display.seekTooltip=y}this.elements.progress=g,u.appendChild(this.elements.progress),c.appendChild(u)}if(m==="current-time"&&c.appendChild(a.call(this,"currentTime",h)),m==="duration"&&c.appendChild(a.call(this,"duration",h)),m==="mute"||m==="volume"){let{volume:u}=this.elements;if(is.element(u)&&c.contains(u)||(u=createElement("div",extend({},h,{class:`${h.class} plyr__volume`.trim()})),this.elements.volume=u,c.appendChild(u)),m==="mute"&&u.appendChild(t.call(this,"mute")),m==="volume"&&!browser.isIos&&!browser.isIPadOS){const g={max:1,step:.05,value:this.config.volume};u.appendChild(n.call(this,"volume",extend(g,{id:`plyr-volume-${e.id}`})))}}if(m==="captions"&&c.appendChild(t.call(this,"captions",h)),m==="settings"&&!is.empty(this.config.settings)){const u=createElement("div",extend({},h,{class:`${h.class} plyr__menu`.trim(),hidden:""}));u.appendChild(t.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const g=createElement("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),y=createElement("div"),b=createElement("div",{id:`plyr-settings-${e.id}-home`}),w=createElement("div",{role:"menu"});b.appendChild(w),y.appendChild(b),this.elements.settings.panels.home=b,this.config.settings.forEach(p=>{const d=createElement("button",extend(getAttributesFromSelector(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,d,p),on.call(this,d,"click",()=>{l.call(this,p,!1)});const f=createElement("span",null,i18n.get(p,this.config)),v=createElement("span",{class:this.config.classNames.menu.value});v.innerHTML=e[p],f.appendChild(v),d.appendChild(f),w.appendChild(d);const T=createElement("div",{id:`plyr-settings-${e.id}-${p}`,hidden:""}),k=createElement("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});k.appendChild(createElement("span",{"aria-hidden":!0},i18n.get(p,this.config))),k.appendChild(createElement("span",{class:this.config.classNames.hidden},i18n.get("menuBack",this.config))),on.call(this,T,"keydown",N=>{N.key==="ArrowLeft"&&(N.preventDefault(),N.stopPropagation(),l.call(this,"home",!0))},!1),on.call(this,k,"click",()=>{l.call(this,"home",!1)}),T.appendChild(k),T.appendChild(createElement("div",{role:"menu"})),y.appendChild(T),this.elements.settings.buttons[p]=d,this.elements.settings.panels[p]=T}),g.appendChild(y),u.appendChild(g),c.appendChild(u),this.elements.settings.popup=g,this.elements.settings.menu=u}if(m==="pip"&&support.pip&&c.appendChild(t.call(this,"pip",h)),m==="airplay"&&support.airplay&&c.appendChild(t.call(this,"airplay",h)),m==="download"){const u=extend({},h,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(u.download="");const{download:g}=this.config.urls;!is.url(g)&&this.isEmbed&&extend(u,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(t.call(this,"download",u))}m==="fullscreen"&&c.appendChild(t.call(this,"fullscreen",h))}),this.isHTML5&&o.call(this,html5.getQualityOptions.call(this)),r.call(this),c},inject(){if(this.config.loadSprite){const n=controls.getIconUrl.call(this);n.cors&&loadSprite(n.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;is.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,i)),this.config.controls||(this.config.controls=[]),is.element(this.config.controls)||is.string(this.config.controls)?e=this.config.controls:(e=controls.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:captions.getLabel.call(this)}),t=!1);let s;if(t&&is.string(this.config.controls)&&(e=(n=>{let a=n;return Object.entries(i).forEach(([o,r])=>{a=replaceAll(a,`{${o}}`,r)}),a})(e)),is.string(this.config.selectors.controls.container)&&(s=document.querySelector(this.config.selectors.controls.container)),is.element(s)||(s=this.elements.container),s[is.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),is.element(this.elements.controls)||controls.findElements.call(this),!is.empty(this.elements.buttons)){const n=a=>{const o=this.config.classNames.controlPressed;a.setAttribute("aria-pressed","false"),Object.defineProperty(a,"pressed",{configurable:!0,enumerable:!0,get:()=>hasClass(a,o),set(r=!1){toggleClass(a,o,r),a.setAttribute("aria-pressed",r?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(a=>{is.array(a)||is.nodeList(a)?Array.from(a).filter(Boolean).forEach(n):n(a)})}if(browser.isEdge&&repaint(s),this.config.tooltips.controls){const{classNames:n,selectors:a}=this.config,o=`${a.controls.wrapper} ${a.labels} .${n.hidden}`,r=getElements.call(this,o);Array.from(r).forEach(l=>{toggleClass(l,this.config.classNames.hidden,!1),toggleClass(l,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:l})=>l>0&&ltoggleClass(a,o,l);t.forEach(l=>{const c=createElement("span",{class:this.config.classNames.marker},""),h=l.time/this.duration*100+"%";a&&(c.addEventListener("mouseenter",()=>{l.label||(a.style.left=h,a.innerHTML=l.label,r(!0))}),c.addEventListener("mouseleave",()=>{r(!1)})),c.addEventListener("click",()=>{this.currentTime=l.time}),c.style.left=h,n.appendChild(c)}),s.appendChild(n),this.config.tooltips.seek||(a=createElement("span",{class:this.config.classNames.tooltip},""),s.appendChild(a)),this.elements.markers={points:n,tip:a},this.elements.progress.appendChild(s)}};function parseUrl(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 buildUrlParams(e){const i=new URLSearchParams;return is.object(e)&&Object.entries(e).forEach(([t,s])=>{i.set(t,s)}),i}const captions={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!support.textTracks)return void(is.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&controls.setCaptionsMenu.call(this));if(is.element(this.elements.captions)||(this.elements.captions=createElement("div",getAttributesFromSelector(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),insertAfter(this.elements.captions,this.elements.wrapper)),browser.isIE&&window.URL){const s=this.media.querySelectorAll("track");Array.from(s).forEach(n=>{const a=n.getAttribute("src"),o=parseUrl(a);o!==null&&o.hostname!==window.location.href.hostname&&["http:","https:"].includes(o.protocol)&&fetch(a,"blob").then(r=>{n.setAttribute("src",window.URL.createObjectURL(r))}).catch(()=>{removeElement(n)})})}const e=dedupe((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(is.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";on.call(this,this.media.textTracks,s,captions.update.bind(this))}setTimeout(captions.update.bind(this),0)},update(){const e=captions.getTracks.call(this,!0),{active:i,language:t,meta:s,currentTrackNode:n}=this.captions,a=!!e.find(o=>o.language===t);this.isHTML5&&this.isVideo&&e.filter(o=>!s.get(o)).forEach(o=>{this.debug.log("Track added",o),s.set(o,{default:o.mode==="showing"}),o.mode==="showing"&&(o.mode="hidden"),on.call(this,o,"cuechange",()=>captions.updateCues.call(this))}),(a&&this.language!==t||!e.includes(n))&&(captions.setLanguage.call(this,t),captions.toggle.call(this,i&&a)),this.elements&&toggleClass(this.elements.container,this.config.classNames.captions.enabled,!is.empty(e)),is.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&controls.setCaptionsMenu.call(this)},toggle(e,i=!0){if(!this.supported.ui)return;const{toggled:t}=this.captions,s=this.config.classNames.captions.active,n=is.nullOrUndefined(e)?!t:e;if(n!==t){if(i||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!i){const a=captions.getTracks.call(this),o=captions.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=o.language,void captions.set.call(this,a.indexOf(o))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),toggleClass(this.elements.container,s,n),this.captions.toggled=n,controls.updateSetting.call(this,"captions"),triggerEvent.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout(()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(e,i=!0){const t=captions.getTracks.call(this);if(e!==-1)if(is.number(e))if(e in t){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=t[e],{language:n}=s||{};this.captions.currentTrackNode=s,controls.updateSetting.call(this,"captions"),i||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),triggerEvent.call(this,this.media,"languagechange")}captions.toggle.call(this,!0,i),this.isHTML5&&this.isVideo&&captions.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else captions.toggle.call(this,!1,i)},setLanguage(e,i=!0){if(!is.string(e))return void this.debug.warn("Invalid language argument",e);const t=e.toLowerCase();this.captions.language=t;const s=captions.getTracks.call(this),n=captions.findTrack.call(this,[t]);captions.set.call(this,s.indexOf(n),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=captions.getTracks.call(this),s=o=>Number((this.captions.meta.get(o)||{}).default),n=Array.from(t).sort((o,r)=>s(r)-s(o));let a;return e.every(o=>(a=n.find(r=>r.language===o),!a)),a||(i?n[0]:void 0)},getCurrentTrack(){return captions.getTracks.call(this)[this.currentTrack]},getLabel(e){let i=e;return!is.track(i)&&support.textTracks&&this.captions.toggled&&(i=captions.getCurrentTrack.call(this)),is.track(i)?is.empty(i.label)?is.empty(i.language)?i18n.get("enabled",this.config):e.language.toUpperCase():i.label:i18n.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!is.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!is.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let i=e;if(!i){const s=captions.getCurrentTrack.call(this);i=Array.from((s||{}).activeCues||[]).map(n=>n.getCueAsHTML()).map(getHTML)}const t=i.map(s=>s.trim()).join(` `);if(t!==this.elements.captions.innerHTML){emptyElement(this.elements.captions);const s=createElement("span",getAttributesFromSelector(this.config.selectors.caption));s.innerHTML=t,this.elements.captions.appendChild(s),triggerEvent.call(this,this.media,"cuechange")}}},defaults={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:[]}},pip={active:"picture-in-picture",inactive:"inline"},providers={html5:"html5",youtube:"youtube",vimeo:"vimeo"},types={audio:"audio",video:"video"};function getProviderByUrl(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?providers.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?providers.vimeo:null}const noop=()=>{};class Console{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):noop}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):noop}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):noop}}class Fullscreen{constructor(i){_defineProperty$1(this,"onChange",()=>{if(!this.supported)return;const t=this.player.elements.buttons.fullscreen;is.element(t)&&(t.pressed=this.active);const s=this.target===this.player.media?this.target:this.player.elements.container;triggerEvent.call(this.player,s,this.active?"enterfullscreen":"exitfullscreen",!0)}),_defineProperty$1(this,"toggleFallback",(t=!1)=>{var s,n;if(t?this.scrollPosition={x:(s=window.scrollX)!=null?s:0,y:(n=window.scrollY)!=null?n:0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=t?"hidden":"",toggleClass(this.target,this.player.config.classNames.fullscreen.fallback,t),browser.isIos){let a=document.head.querySelector('meta[name="viewport"]');const o="viewport-fit=cover";a||(a=document.createElement("meta"),a.setAttribute("name","viewport"));const r=is.string(a.content)&&a.content.includes(o);t?(this.cleanupViewport=!r,r||(a.content+=`,${o}`)):this.cleanupViewport&&(a.content=a.content.split(",").filter(l=>l.trim()!==o).join(","))}this.onChange()}),_defineProperty$1(this,"trapFocus",t=>{if(browser.isIos||browser.isIPadOS||!this.active||t.key!=="Tab")return;const s=document.activeElement,n=getElements.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[a]=n,o=n[n.length-1];s!==o||t.shiftKey?s===a&&t.shiftKey&&(o.focus(),t.preventDefault()):(a.focus(),t.preventDefault())}),_defineProperty$1(this,"update",()=>{if(this.supported){let t;t=this.forceFallback?"Fallback (forced)":Fullscreen.nativeSupported?"Native":"Fallback",this.player.debug.log(`${t} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");toggleClass(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),_defineProperty$1(this,"enter",()=>{this.supported&&(browser.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!Fullscreen.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?is.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),_defineProperty$1(this,"exit",()=>{if(this.supported)if(browser.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),silencePromise(this.player.play());else if(!Fullscreen.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!is.empty(this.prefix)){const t=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${t}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),_defineProperty$1(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=i,this.prefix=Fullscreen.prefix,this.property=Fullscreen.property,this.scrollPosition={x:0,y:0},this.forceFallback=i.config.fullscreen.fallback==="force",this.player.elements.fullscreen=i.config.fullscreen.container&&closest$1(this.player.elements.container,i.config.fullscreen.container),on.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),on.call(this.player,this.player.elements.container,"dblclick",t=>{is.element(this.player.elements.controls)&&this.player.elements.controls.contains(t.target)||this.player.listeners.proxy(t,this.toggle,"fullscreen")}),on.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 Fullscreen.nativeSupported&&!this.forceFallback}static get prefix(){if(is.function(document.exitFullscreen))return"";let i="";return["webkit","moz","ms"].some(t=>!(!is.function(document[`${t}ExitFullscreen`])&&!is.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,Fullscreen.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||Fullscreen.nativeSupported||!browser.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!Fullscreen.nativeSupported||this.forceFallback)return hasClass(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 browser.isIos&&this.player.config.fullscreen.iosNative?this.player.media:(i=this.player.elements.fullscreen)!=null?i:this.player.elements.container}}function loadImage(e,i=1){return new Promise((t,s)=>{const n=new Image,a=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=i?t:s)(n)};Object.assign(n,{onload:a,onerror:a,src:e})})}const ui={addStyleHook(){toggleClass(this.elements.container,this.config.selectors.container.replace(".",""),!0),toggleClass(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 ui.toggleNativeControls.call(this,!0);is.element(this.elements.controls)||(controls.inject.call(this),this.listeners.controls()),ui.toggleNativeControls.call(this),this.isHTML5&&captions.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,controls.updateVolume.call(this),controls.timeUpdate.call(this),controls.durationUpdate.call(this),ui.checkPlaying.call(this),toggleClass(this.elements.container,this.config.classNames.pip.supported,support.pip&&this.isHTML5&&this.isVideo),toggleClass(this.elements.container,this.config.classNames.airplay.supported,support.airplay&&this.isHTML5),toggleClass(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{triggerEvent.call(this,this.media,"ready")},0),ui.setTitle.call(this),this.poster&&ui.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&controls.durationUpdate.call(this),this.config.mediaMetadata&&controls.setMediaMetadata.call(this)},setTitle(){let e=i18n.get("play",this.config);if(is.string(this.config.title)&&!is.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=getElement.call(this,"iframe");if(!is.element(i))return;const t=is.empty(this.config.title)?"video":this.config.title,s=i18n.get("frameTitle",this.config);i.setAttribute("title",s.replace("{title}",t))}},togglePoster(e){toggleClass(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"),ready.call(this).then(()=>loadImage(e)).catch(t=>{throw e===this.poster&&ui.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:""}),ui.togglePoster.call(this,!0),e)))},checkPlaying(e){toggleClass(this.elements.container,this.config.classNames.playing,this.playing),toggleClass(this.elements.container,this.config.classNames.paused,this.paused),toggleClass(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",i18n.get(this.playing?"pause":"play",this.config))}),is.event(e)&&e.type==="timeupdate"||ui.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{toggleClass(this.elements.container,this.config.classNames.loading,this.loading),ui.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(!!(e||this.loading||this.paused||i.pressed||i.hover||t))}},migrateStyles(){Object.values({...this.media.style}).filter(e=>!is.empty(e)&&is.string(e)&&e.startsWith("--plyr")).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),is.empty(this.media.style)&&this.media.removeAttribute("style")}};class Listeners{constructor(i){_defineProperty$1(this,"firstTouch",()=>{const{player:t}=this,{elements:s}=t;t.touch=!0,toggleClass(s.container,t.config.classNames.isTouch,!0)}),_defineProperty$1(this,"global",(t=!0)=>{const{player:s}=this;s.config.keyboard.global&&toggleListener.call(s,window,"keydown keyup",this.handleKey,t,!1),toggleListener.call(s,document.body,"click",this.toggleMenu,t),once.call(s,document.body,"touchstart",this.firstTouch)}),_defineProperty$1(this,"container",()=>{const{player:t}=this,{config:s,elements:n,timers:a}=t;!s.keyboard.global&&s.keyboard.focused&&on.call(t,n.container,"keydown keyup",this.handleKey,!1),on.call(t,n.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",l=>{const{controls:c}=n;c&&l.type==="enterfullscreen"&&(c.pressed=!1,c.hover=!1);let h=0;["touchstart","touchmove","mousemove"].includes(l.type)&&(ui.toggleControls.call(t,!0),h=t.touch?3e3:2e3),clearTimeout(a.controls),a.controls=setTimeout(()=>ui.toggleControls.call(t,!1),h)});const o=()=>{if(!t.isVimeo||t.config.vimeo.premium)return;const l=n.wrapper,{active:c}=t.fullscreen,[h,m]=getAspectRatio.call(t),u=supportsCSS(`aspect-ratio: ${h} / ${m}`);if(!c)return void(u?(l.style.width=null,l.style.height=null):(l.style.maxWidth=null,l.style.margin=null));const[g,y]=getViewportSize(),b=g/y>h/m;u?(l.style.width=b?"auto":"100%",l.style.height=b?"100%":"auto"):(l.style.maxWidth=b?y/m*h+"px":null,l.style.margin=b?"0 auto":null)},r=()=>{clearTimeout(a.resized),a.resized=setTimeout(o,50)};on.call(t,n.container,"enterfullscreen exitfullscreen",l=>{const{target:c}=t.fullscreen;c===n.container&&(!t.isEmbed&&is.empty(t.config.ratio)||(o(),(l.type==="enterfullscreen"?on:off).call(t,window,"resize",r)))})}),_defineProperty$1(this,"media",()=>{const{player:t}=this,{elements:s}=t;if(on.call(t,t.media,"timeupdate seeking seeked",a=>controls.timeUpdate.call(t,a)),on.call(t,t.media,"durationchange loadeddata loadedmetadata",a=>controls.durationUpdate.call(t,a)),on.call(t,t.media,"ended",()=>{t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())}),on.call(t,t.media,"progress playing seeking seeked",a=>controls.updateProgress.call(t,a)),on.call(t,t.media,"volumechange",a=>controls.updateVolume.call(t,a)),on.call(t,t.media,"playing play pause ended emptied timeupdate",a=>ui.checkPlaying.call(t,a)),on.call(t,t.media,"waiting canplay seeked playing",a=>ui.checkLoading.call(t,a)),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){const a=getElement.call(t,`.${t.config.classNames.video}`);if(!is.element(a))return;on.call(t,s.container,"click",o=>{([s.container,a].includes(o.target)||a.contains(o.target))&&(t.touch&&t.config.hideControls||(t.ended?(this.proxy(o,t.restart,"restart"),this.proxy(o,()=>{silencePromise(t.play())},"play")):this.proxy(o,()=>{silencePromise(t.togglePlay())},"play")))})}t.supported.ui&&t.config.disableContextMenu&&on.call(t,s.wrapper,"contextmenu",a=>{a.preventDefault()},!1),on.call(t,t.media,"volumechange",()=>{t.storage.set({volume:t.volume,muted:t.muted})}),on.call(t,t.media,"ratechange",()=>{controls.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})}),on.call(t,t.media,"qualitychange",a=>{controls.updateSetting.call(t,"quality",null,a.detail.quality)}),on.call(t,t.media,"ready qualitychange",()=>{controls.setDownloadUrl.call(t)});const n=t.config.events.concat(["keyup","keydown"]).join(" ");on.call(t,t.media,n,a=>{let{detail:o={}}=a;a.type==="error"&&(o=t.media.error),triggerEvent.call(t,s.container,a.type,!0,o)})}),_defineProperty$1(this,"proxy",(t,s,n)=>{const{player:a}=this,o=a.config.listeners[n];let r=!0;is.function(o)&&(r=o.call(a,t)),r!==!1&&is.function(s)&&s.call(a,t)}),_defineProperty$1(this,"bind",(t,s,n,a,o=!0)=>{const{player:r}=this,l=r.config.listeners[a],c=is.function(l);on.call(r,t,s,h=>this.proxy(h,n,a),o&&!c)}),_defineProperty$1(this,"controls",()=>{const{player:t}=this,{elements:s}=t,n=browser.isIE?"change":"input";if(s.buttons.play&&Array.from(s.buttons.play).forEach(a=>{this.bind(a,"click",()=>{silencePromise(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",()=>{triggerEvent.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",a=>{a.stopPropagation(),a.preventDefault(),controls.toggleMenu.call(t,a)},null,!1),this.bind(s.buttons.settings,"keyup",a=>{[" ","Enter"].includes(a.key)&&(a.key!=="Enter"?(a.preventDefault(),a.stopPropagation(),controls.toggleMenu.call(t,a)):controls.focusFirstMenuItem.call(t,null,!0))},null,!1),this.bind(s.settings.menu,"keydown",a=>{a.key==="Escape"&&controls.toggleMenu.call(t,a)}),this.bind(s.inputs.seek,"mousedown mousemove",a=>{const o=s.progress.getBoundingClientRect(),r=100/o.width*(a.pageX-o.left);a.currentTarget.setAttribute("seek-value",r)}),this.bind(s.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",a=>{const o=a.currentTarget,r="play-on-seeked";if(is.keyboardEvent(a)&&!["ArrowLeft","ArrowRight"].includes(a.key))return;t.lastSeekTime=Date.now();const l=o.hasAttribute(r),c=["mouseup","touchend","keyup"].includes(a.type);l&&c?(o.removeAttribute(r),silencePromise(t.play())):!c&&t.playing&&(o.setAttribute(r,""),t.pause())}),browser.isIos){const a=getElements.call(t,'input[type="range"]');Array.from(a).forEach(o=>this.bind(o,n,r=>repaint(r.target)))}this.bind(s.inputs.seek,n,a=>{const o=a.currentTarget;let r=o.getAttribute("seek-value");is.empty(r)&&(r=o.value),o.removeAttribute("seek-value"),t.currentTime=r/o.max*t.duration},"seek"),this.bind(s.progress,"mouseenter mouseleave mousemove",a=>controls.updateSeekTooltip.call(t,a)),this.bind(s.progress,"mousemove touchmove",a=>{const{previewThumbnails:o}=t;o&&o.loaded&&o.startMove(a)}),this.bind(s.progress,"mouseleave touchend click",()=>{const{previewThumbnails:a}=t;a&&a.loaded&&a.endMove(!1,!0)}),this.bind(s.progress,"mousedown touchstart",a=>{const{previewThumbnails:o}=t;o&&o.loaded&&o.startScrubbing(a)}),this.bind(s.progress,"mouseup touchend",a=>{const{previewThumbnails:o}=t;o&&o.loaded&&o.endScrubbing(a)}),browser.isWebKit&&Array.from(getElements.call(t,'input[type="range"]')).forEach(a=>{this.bind(a,"input",o=>controls.updateRangeFill.call(t,o.target))}),t.config.toggleInvert&&!is.element(s.display.duration)&&this.bind(s.display.currentTime,"click",()=>{t.currentTime!==0&&(t.config.invertTime=!t.config.invertTime,controls.timeUpdate.call(t))}),this.bind(s.inputs.volume,n,a=>{t.volume=a.target.value},"volume"),this.bind(s.controls,"mouseenter mouseleave",a=>{s.controls.hover=!t.touch&&a.type==="mouseenter"}),s.fullscreen&&Array.from(s.fullscreen.children).filter(a=>!a.contains(s.container)).forEach(a=>{this.bind(a,"mouseenter mouseleave",o=>{s.controls&&(s.controls.hover=!t.touch&&o.type==="mouseenter")})}),this.bind(s.controls,"mousedown mouseup touchstart touchend touchcancel",a=>{s.controls.pressed=["mousedown","touchstart"].includes(a.type)}),this.bind(s.controls,"focusin",()=>{const{config:a,timers:o}=t;toggleClass(s.controls,a.classNames.noTransition,!0),ui.toggleControls.call(t,!0),setTimeout(()=>{toggleClass(s.controls,a.classNames.noTransition,!1)},0);const r=this.touch?3e3:4e3;clearTimeout(o.controls),o.controls=setTimeout(()=>ui.toggleControls.call(t,!1),r)}),this.bind(s.inputs.volume,"wheel",a=>{const o=a.webkitDirectionInvertedFromDevice,[r,l]=[a.deltaX,-a.deltaY].map(m=>o?-m:m),c=Math.sign(Math.abs(r)>Math.abs(l)?r:l);t.increaseVolume(c/50);const{volume:h}=t.media;(c===1&&h<1||c===-1&&h>0)&&a.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:n,type:a,altKey:o,ctrlKey:r,metaKey:l,shiftKey:c}=i,h=a==="keydown",m=h&&n===this.lastKey;if(!(o||r||l||c)&&n){if(h){const g=document.activeElement;if(is.element(g)){const{editable:y}=t.config.selectors,{seek:b}=s.inputs;if(g!==b&&matches(g,y)||i.key===" "&&matches(g,'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(n)&&(i.preventDefault(),i.stopPropagation()),n){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":m||(u=parseInt(n,10),t.currentTime=t.duration/10*u);break;case" ":case"k":m||silencePromise(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":m||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":m||t.toggleCaptions();break;case"l":t.loop=!t.loop}n==="Escape"&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null;var u}}toggleMenu(i){controls.toggleMenu.call(this.player,i)}}function createCommonjsModule(e,i){return e(i={exports:{}},i.exports),i.exports}var loadjs_umd=createCommonjsModule(function(e,i){e.exports=function(){var t=function(){},s={},n={},a={};function o(u,g){u=u.push?u:[u];var y,b,w,p=[],d=u.length,f=d;for(y=function(v,T){T.length&&p.push(v),--f||g(p)};d--;)b=u[d],(w=n[b])?y(b,w):(a[b]=a[b]||[]).push(y)}function r(u,g){if(u){var y=a[u];if(n[u]=g,y)for(;y.length;)y[0](u,g),y.splice(0,1)}}function l(u,g){u.call&&(u={success:u}),g.length?(u.error||t)(g):(u.success||t)(u)}function c(u,g,y,b){var w,p,d=document,f=y.async,v=(y.numRetries||0)+1,T=y.before||t,k=u.replace(/[\?|#].*$/,""),N=u.replace(/^(css|img)!/,"");b=b||0,/(^css!|\.css$)/.test(k)?((p=d.createElement("link")).rel="stylesheet",p.href=N,(w="hideFocus"in p)&&p.relList&&(w=0,p.rel="preload",p.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(k)?(p=d.createElement("img")).src=N:((p=d.createElement("script")).src=u,p.async=f===void 0||f),p.onload=p.onerror=p.onbeforeload=function(S){var A=S.type[0];if(w)try{p.sheet.cssText.length||(A="e")}catch(V){V.code!=18&&(A="e")}if(A=="e"){if((b+=1){loadjs_umd(e,{success:i,error:t})})}function parseId$1(e){return is.empty(e)?null:is.number(Number(e))?e:e.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:e}function parseHash(e){const i=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return i&&i.length===5?i[4]:null}function assurePlaybackState$1(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,triggerEvent.call(this,this.media,e?"play":"pause"))}const vimeo={setup(){const e=this;toggleClass(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,setAspectRatio.call(e),is.object(window.Vimeo)?vimeo.ready.call(e):loadScript(e.config.urls.vimeo.sdk).then(()=>{vimeo.ready.call(e)}).catch(i=>{e.debug.warn("Vimeo SDK (player.js) failed to load",i)})},ready(){const e=this,i=e.config.vimeo,{premium:t,referrerPolicy:s,...n}=i;let a=e.media.getAttribute("src"),o="";is.empty(a)?(a=e.media.getAttribute(e.config.attributes.embed.id),o=e.media.getAttribute(e.config.attributes.embed.hash)):o=parseHash(a);const r=o?{h:o}:{};t&&Object.assign(n,{controls:!1,sidedock:!1});const l=buildUrlParams({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...r,...n}),c=parseId$1(a),h=createElement("iframe"),m=format(e.config.urls.vimeo.iframe,c,l);if(h.setAttribute("src",m),h.setAttribute("allowfullscreen",""),h.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),is.empty(s)||h.setAttribute("referrerPolicy",s),t||!i.customControls)h.setAttribute("data-poster",e.poster),e.media=replaceElement(h,e.media);else{const d=createElement("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});d.appendChild(h),e.media=replaceElement(d,e.media)}i.customControls||fetch(format(e.config.urls.vimeo.api,m)).then(d=>{!is.empty(d)&&d.thumbnail_url&&ui.setPoster.call(e,d.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(h,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(assurePlaybackState$1.call(e,!0),e.embed.play()),e.media.pause=()=>(assurePlaybackState$1.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:u}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>u,set(d){const{embed:f,media:v,paused:T,volume:k}=e,N=T&&!f.hasPlayed;v.seeking=!0,triggerEvent.call(e,v,"seeking"),Promise.resolve(N&&f.setVolume(0)).then(()=>f.setCurrentTime(d)).then(()=>N&&f.pause()).then(()=>N&&f.setVolume(k)).catch(()=>{})}});let g=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>g,set(d){e.embed.setPlaybackRate(d).then(()=>{g=d,triggerEvent.call(e,e.media,"ratechange")}).catch(()=>{e.options.speed=[1]})}});let{volume:y}=e.config;Object.defineProperty(e.media,"volume",{get:()=>y,set(d){e.embed.setVolume(d).then(()=>{y=d,triggerEvent.call(e,e.media,"volumechange")})}});let{muted:b}=e.config;Object.defineProperty(e.media,"muted",{get:()=>b,set(d){const f=!!is.boolean(d)&&d;e.embed.setMuted(!!f||e.config.muted).then(()=>{b=f,triggerEvent.call(e,e.media,"volumechange")})}});let w,{loop:p}=e.config;Object.defineProperty(e.media,"loop",{get:()=>p,set(d){const f=is.boolean(d)?d:e.config.loop.active;e.embed.setLoop(f).then(()=>{p=f})}}),e.embed.getVideoUrl().then(d=>{w=d,controls.setDownloadUrl.call(e)}).catch(d=>{this.debug.warn(d)}),Object.defineProperty(e.media,"currentSrc",{get:()=>w}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(d=>{const[f,v]=d;e.embed.ratio=roundAspectRatio(f,v),setAspectRatio.call(this)}),e.embed.setAutopause(e.config.autopause).then(d=>{e.config.autopause=d}),e.embed.getVideoTitle().then(d=>{e.config.title=d,ui.setTitle.call(this)}),e.embed.getCurrentTime().then(d=>{u=d,triggerEvent.call(e,e.media,"timeupdate")}),e.embed.getDuration().then(d=>{e.media.duration=d,triggerEvent.call(e,e.media,"durationchange")}),e.embed.getTextTracks().then(d=>{e.media.textTracks=d,captions.setup.call(e)}),e.embed.on("cuechange",({cues:d=[]})=>{const f=d.map(v=>stripHTML(v.text));captions.updateCues.call(e,f)}),e.embed.on("loaded",()=>{e.embed.getPaused().then(d=>{assurePlaybackState$1.call(e,!d),d||triggerEvent.call(e,e.media,"playing")}),is.element(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)}),e.embed.on("bufferstart",()=>{triggerEvent.call(e,e.media,"waiting")}),e.embed.on("bufferend",()=>{triggerEvent.call(e,e.media,"playing")}),e.embed.on("play",()=>{assurePlaybackState$1.call(e,!0),triggerEvent.call(e,e.media,"playing")}),e.embed.on("pause",()=>{assurePlaybackState$1.call(e,!1)}),e.embed.on("timeupdate",d=>{e.media.seeking=!1,u=d.seconds,triggerEvent.call(e,e.media,"timeupdate")}),e.embed.on("progress",d=>{e.media.buffered=d.percent,triggerEvent.call(e,e.media,"progress"),parseInt(d.percent,10)===1&&triggerEvent.call(e,e.media,"canplaythrough"),e.embed.getDuration().then(f=>{f!==e.media.duration&&(e.media.duration=f,triggerEvent.call(e,e.media,"durationchange"))})}),e.embed.on("seeked",()=>{e.media.seeking=!1,triggerEvent.call(e,e.media,"seeked")}),e.embed.on("ended",()=>{e.media.paused=!0,triggerEvent.call(e,e.media,"ended")}),e.embed.on("error",d=>{e.media.error=d,triggerEvent.call(e,e.media,"error")}),i.customControls&&setTimeout(()=>ui.build.call(e),0)}};function parseId(e){return is.empty(e)?null:e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:e}function assurePlaybackState(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,triggerEvent.call(this,this.media,e?"play":"pause"))}function getHost(e){return e.noCookie?"https://www.youtube-nocookie.com":window.location.protocol==="http:"?"http://www.youtube.com":void 0}const youtube={setup(){if(toggleClass(this.elements.wrapper,this.config.classNames.embed,!0),is.object(window.YT)&&is.function(window.YT.Player))youtube.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{is.function(e)&&e(),youtube.ready.call(this)},loadScript(this.config.urls.youtube.sdk).catch(i=>{this.debug.warn("YouTube API failed to load",i)})}},getTitle(e){fetch(format(this.config.urls.youtube.api,e)).then(i=>{if(is.object(i)){const{title:t,height:s,width:n}=i;this.config.title=t,ui.setTitle.call(this),this.embed.ratio=roundAspectRatio(n,s)}setAspectRatio.call(this)}).catch(()=>{setAspectRatio.call(this)})},ready(){const e=this,i=e.config.youtube,t=e.media&&e.media.getAttribute("id");if(!is.empty(t)&&t.startsWith("youtube-"))return;let s=e.media.getAttribute("src");is.empty(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const n=parseId(s),a=createElement("div",{id:generateId(e.provider),"data-poster":i.customControls?e.poster:void 0});if(e.media=replaceElement(a,e.media),i.customControls){const o=r=>`https://i.ytimg.com/vi/${n}/${r}default.jpg`;loadImage(o("maxres"),121).catch(()=>loadImage(o("sd"),121)).catch(()=>loadImage(o("hq"))).then(r=>ui.setPoster.call(e,r.src)).then(r=>{r.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:n,host:getHost(i),playerVars:extend({},{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(o){if(!e.media.error){const r=o.data,l={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."}[r]||"An unknown error occurred";e.media.error={code:r,message:l},triggerEvent.call(e,e.media,"error")}},onPlaybackRateChange(o){const r=o.target;e.media.playbackRate=r.getPlaybackRate(),triggerEvent.call(e,e.media,"ratechange")},onReady(o){if(is.function(e.media.play))return;const r=o.target;youtube.getTitle.call(e,n),e.media.play=()=>{assurePlaybackState.call(e,!0),r.playVideo()},e.media.pause=()=>{assurePlaybackState.call(e,!1),r.pauseVideo()},e.media.stop=()=>{r.stopVideo()},e.media.duration=r.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(r.getCurrentTime()),set(m){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,triggerEvent.call(e,e.media,"seeking"),r.seekTo(m)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>r.getPlaybackRate(),set(m){r.setPlaybackRate(m)}});let{volume:l}=e.config;Object.defineProperty(e.media,"volume",{get:()=>l,set(m){l=m,r.setVolume(100*l),triggerEvent.call(e,e.media,"volumechange")}});let{muted:c}=e.config;Object.defineProperty(e.media,"muted",{get:()=>c,set(m){const u=is.boolean(m)?m:c;c=u,r[u?"mute":"unMute"](),r.setVolume(100*l),triggerEvent.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>r.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const h=r.getAvailablePlaybackRates();e.options.speed=h.filter(m=>e.config.speed.options.includes(m)),e.supported.ui&&i.customControls&&e.media.setAttribute("tabindex",-1),triggerEvent.call(e,e.media,"timeupdate"),triggerEvent.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(()=>{e.media.buffered=r.getVideoLoadedFraction(),(e.media.lastBuffered===null||e.media.lastBufferedui.build.call(e),50)},onStateChange(o){const r=o.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(o.data)&&(e.media.seeking=!1,triggerEvent.call(e,e.media,"seeked")),o.data){case-1:triggerEvent.call(e,e.media,"timeupdate"),e.media.buffered=r.getVideoLoadedFraction(),triggerEvent.call(e,e.media,"progress");break;case 0:assurePlaybackState.call(e,!1),e.media.loop?(r.stopVideo(),r.playVideo()):triggerEvent.call(e,e.media,"ended");break;case 1:i.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(assurePlaybackState.call(e,!0),triggerEvent.call(e,e.media,"playing"),e.timers.playing=setInterval(()=>{triggerEvent.call(e,e.media,"timeupdate")},50),e.media.duration!==r.getDuration()&&(e.media.duration=r.getDuration(),triggerEvent.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),assurePlaybackState.call(e,!1);break;case 3:triggerEvent.call(e,e.media,"waiting")}triggerEvent.call(e,e.elements.container,"statechange",!1,{code:o.data})}}})}},media={setup(){this.media?(toggleClass(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),toggleClass(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&toggleClass(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=createElement("div",{class:this.config.classNames.video}),wrap(this.media,this.elements.wrapper),this.elements.poster=createElement("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?html5.setup.call(this):this.isYouTube?youtube.setup.call(this):this.isVimeo&&vimeo.setup.call(this)):this.debug.warn("No media element found!")}};class Ads{constructor(i){_defineProperty$1(this,"load",()=>{this.enabled&&(is.object(window.google)&&is.object(window.google.ima)?this.ready():loadScript(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),_defineProperty$1(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()}),_defineProperty$1(this,"setupIMA",()=>{this.elements.container=createElement("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()}),_defineProperty$1(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)}}),_defineProperty$1(this,"pollCountdown",(t=!1)=>{if(!t)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(()=>{const s=formatTime(Math.max(this.manager.getRemainingTime(),0)),n=`${i18n.get("advertisement",this.player.config)} - ${s}`;this.elements.container.setAttribute("data-badge-text",n)},100)}),_defineProperty$1(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,n=>this.onAdError(n)),Object.keys(google.ima.AdEvent.Type).forEach(n=>{this.manager.addEventListener(google.ima.AdEvent.Type[n],a=>this.onAdEvent(a))}),this.trigger("loaded")}),_defineProperty$1(this,"addCuePoints",()=>{is.empty(this.cuePoints)||this.cuePoints.forEach(t=>{if(t!==0&&t!==-1&&t{const{container:s}=this.player.elements,n=t.getAd(),a=t.getAdData();switch((o=>{triggerEvent.call(this.player,this.player.media,`ads${o.replace(/_/g,"").toLowerCase()}`)})(t.type),t.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),n.isLinear()||(n.width=s.offsetWidth,n.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:a.adError&&this.player.debug.warn(`Non-fatal ad error: ${a.adError.getMessage()}`)}}),_defineProperty$1(this,"onAdError",t=>{this.cancel(),this.player.debug.warn("Ads error",t)}),_defineProperty$1(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 n=this.player.currentTime;is.empty(this.cuePoints)||this.cuePoints.forEach((a,o)=>{s{this.manager&&this.manager.resize(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL)})}),_defineProperty$1(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(()=>{})}),_defineProperty$1(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,silencePromise(this.player.media.play())}),_defineProperty$1(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),_defineProperty$1(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),_defineProperty$1(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(()=>{})}),_defineProperty$1(this,"trigger",(t,...s)=>{const n=this.events[t];is.array(n)&&n.forEach(a=>{is.function(a)&&a.apply(this,s)})}),_defineProperty$1(this,"on",(t,s)=>(is.array(this.events[t])||(this.events[t]=[]),this.events[t].push(s),this)),_defineProperty$1(this,"startSafetyTimer",(t,s)=>{this.player.debug.log(`Safety timer invoked from: ${s}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},t)}),_defineProperty$1(this,"clearSafetyTimer",t=>{is.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&&(!is.empty(i.publisherId)||is.url(i.tagUrl))}get tagUrl(){const{config:i}=this;return is.url(i.tagUrl)?i.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${buildUrlParams({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 clamp(e=0,i=0,t=255){return Math.min(Math.max(e,i),t)}const parseVtt=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(n=>{if(is.number(s.startTime)){if(!is.empty(n.trim())&&is.empty(s.text)){const a=n.trim().split("#xywh=");[s.text]=a,a[1]&&([s.x,s.y,s.w,s.h]=a[1].split(","))}}else{const a=n.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})/);a&&(s.startTime=60*Number(a[1]||0)*60+60*Number(a[2])+Number(a[3])+ +`0.${a[4]}`,s.endTime=60*Number(a[6]||0)*60+60*Number(a[7])+Number(a[8])+ +`0.${a[9]}`)}}),s.text&&i.push(s)}),i},fitRatio=(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 PreviewThumbnails{constructor(i){_defineProperty$1(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)})}),_defineProperty$1(this,"getThumbnails",()=>new Promise(t=>{const{src:s}=this.player.config.previewThumbnails;if(is.empty(s))throw new Error("Missing previewThumbnails.src config attribute");const n=()=>{this.thumbnails.sort((a,o)=>a.height-o.height),this.player.debug.log("Preview thumbnails",this.thumbnails),t()};if(is.function(s))s(a=>{this.thumbnails=a,n()});else{const a=(is.string(s)?[s]:s).map(o=>this.getThumbnail(o));Promise.all(a).then(n)}})),_defineProperty$1(this,"getThumbnail",t=>new Promise(s=>{fetch(t).then(n=>{const a={frames:parseVtt(n),height:null,urlPrefix:""};a.frames[0].text.startsWith("/")||a.frames[0].text.startsWith("http://")||a.frames[0].text.startsWith("https://")||(a.urlPrefix=t.substring(0,t.lastIndexOf("/")+1));const o=new Image;o.onload=()=>{a.height=o.naturalHeight,a.width=o.naturalWidth,this.thumbnails.push(a),s()},o.src=a.urlPrefix+a.frames[0].text})})),_defineProperty$1(this,"startMove",t=>{if(this.loaded&&is.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,n;const a=this.player.elements.progress.getBoundingClientRect(),o=100/a.width*(t.pageX-a.left);this.seekTime=this.player.media.duration*(o/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=formatTime(this.seekTime);const r=(s=this.player.config.markers)===null||s===void 0||(n=s.points)===null||n===void 0?void 0:n.find(({time:l})=>l===Math.round(this.seekTime));r&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${r.label}
`)}this.showImageAtCurrentTime()}}),_defineProperty$1(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),_defineProperty$1(this,"startScrubbing",t=>{(is.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()))}),_defineProperty$1(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):once.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),_defineProperty$1(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})}),_defineProperty$1(this,"render",()=>{this.elements.thumb.container=createElement("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=createElement("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const t=createElement("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=createElement("span",{},"00:00"),t.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(t),is.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=createElement("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),_defineProperty$1(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),_defineProperty$1(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const t=this.thumbnails[0].frames.findIndex(a=>this.seekTime>=a.startTime&&this.seekTime<=a.endTime),s=t>=0;let n=0;this.mouseDown||this.toggleThumbContainer(s),s&&(this.thumbnails.forEach((a,o)=>{this.loadedImages.includes(a.frames[t].text)&&(n=o)}),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(n)))}),_defineProperty$1(this,"loadImage",(t=0)=>{const s=this.showingThumb,n=this.thumbnails[t],{urlPrefix:a}=n,o=n.frames[s],r=n.frames[s].text,l=a+r;if(this.currentImageElement&&this.currentImageElement.dataset.filename===r)this.showImage(this.currentImageElement,o,t,s,r,!1),this.currentImageElement.dataset.index=s,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const c=new Image;c.src=l,c.dataset.index=s,c.dataset.filename=r,this.showingThumbFilename=r,this.player.debug.log(`Loading image: ${l}`),c.onload=()=>this.showImage(c,o,t,s,r,!0),this.loadingImage=c,this.removeOldImages(c)}}),_defineProperty$1(this,"showImage",(t,s,n,a,o,r=!0)=>{this.player.debug.log(`Showing thumb: ${o}. num: ${a}. qual: ${n}. newimg: ${r}`),this.setImageSizeAndOffset(t,s),r&&(this.currentImageContainer.appendChild(t),this.currentImageElement=t,this.loadedImages.includes(o)||this.loadedImages.push(o)),this.preloadNearby(a,!0).then(this.preloadNearby(a,!1)).then(this.getHigherQuality(n,t,s,o))}),_defineProperty$1(this,"removeOldImages",t=>{Array.from(this.currentImageContainer.children).forEach(s=>{if(s.tagName.toLowerCase()!=="img")return;const n=this.usingSprites?500:1e3;if(s.dataset.index!==t.dataset.index&&!s.dataset.deleting){s.dataset.deleting=!0;const{currentImageContainer:a}=this;setTimeout(()=>{a.removeChild(s),this.player.debug.log(`Removing thumb: ${s.dataset.filename}`)},n)}})}),_defineProperty$1(this,"preloadNearby",(t,s=!0)=>new Promise(n=>{setTimeout(()=>{const a=this.thumbnails[0].frames[t].text;if(this.showingThumbFilename===a){let o;o=s?this.thumbnails[0].frames.slice(t):this.thumbnails[0].frames.slice(0,t).reverse();let r=!1;o.forEach(l=>{const c=l.text;if(c!==a&&!this.loadedImages.includes(c)){r=!0,this.player.debug.log(`Preloading thumb filename: ${c}`);const{urlPrefix:h}=this.thumbnails[0],m=h+c,u=new Image;u.src=m,u.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${c}`),this.loadedImages.includes(c)||this.loadedImages.push(c),n()}}}),r||n()}},300)})),_defineProperty$1(this,"getHigherQuality",(t,s,n,a)=>{if(t{this.showingThumbFilename===a&&(this.player.debug.log(`Showing higher quality thumb for: ${a}`),this.loadImage(t+1))},300)}}),_defineProperty$1(this,"toggleThumbContainer",(t=!1,s=!1)=>{const n=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(n,t),!t&&s&&(this.showingThumb=null,this.showingThumbFilename=null)}),_defineProperty$1(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)}),_defineProperty$1(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),_defineProperty$1(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()}),_defineProperty$1(this,"setThumbContainerPos",()=>{const t=this.player.elements.progress.getBoundingClientRect(),s=this.player.elements.container.getBoundingClientRect(),{container:n}=this.elements.thumb,a=s.left-t.left+10,o=s.right-t.left-n.clientWidth-10,r=this.mousePosX-t.left-n.clientWidth/2,l=clamp(r,a,o);n.style.left=`${l}px`,n.style.setProperty("--preview-arrow-offset",r-l+"px")}),_defineProperty$1(this,"setScrubbingContainerSize",()=>{const{width:t,height:s}=fitRatio(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`}),_defineProperty$1(this,"setImageSizeAndOffset",(t,s)=>{if(!this.usingSprites)return;const n=this.thumbContainerHeight/s.h;t.style.height=t.naturalHeight*n+"px",t.style.width=t.naturalWidth*n+"px",t.style.left=`-${s.x*n}px`,t.style.top=`-${s.y*n}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}=fitRatio(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 source={insertElements(e,i){is.string(i)?insertElement(e,this.media,{src:i}):is.array(i)&&i.forEach(t=>{insertElement(e,this.media,t)})},change(e){getDeep(e,"sources.length")?(html5.cancelRequests.call(this),this.destroy.call(this,()=>{this.options.quality=[],removeElement(this.media),this.media=null,is.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:i,type:t}=e,[{provider:s=providers.html5,src:n}]=i,a=s==="html5"?t:"div",o=s==="html5"?{}:{src:n};Object.assign(this,{provider:s,type:t,supported:support.check(t,s,this.config.playsinline),media:createElement(a,o)}),this.elements.container.appendChild(this.media),is.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),is.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","")),ui.addStyleHook.call(this),this.isHTML5&&source.insertElements.call(this,"source",i),this.config.title=e.title,media.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&source.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&ui.build.call(this),this.isHTML5&&this.media.load(),is.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 PreviewThumbnails(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};class Plyr{constructor(i,t){if(_defineProperty$1(this,"play",()=>is.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>silencePromise(this.media.play())),this.media.play()):null),_defineProperty$1(this,"pause",()=>this.playing&&is.function(this.media.pause)?this.media.pause():null),_defineProperty$1(this,"togglePlay",r=>(is.boolean(r)?r:!this.playing)?this.play():this.pause()),_defineProperty$1(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):is.function(this.media.stop)&&this.media.stop()}),_defineProperty$1(this,"restart",()=>{this.currentTime=0}),_defineProperty$1(this,"rewind",r=>{this.currentTime-=is.number(r)?r:this.config.seekTime}),_defineProperty$1(this,"forward",r=>{this.currentTime+=is.number(r)?r:this.config.seekTime}),_defineProperty$1(this,"increaseVolume",r=>{const l=this.media.muted?0:this.volume;this.volume=l+(is.number(r)?r:0)}),_defineProperty$1(this,"decreaseVolume",r=>{this.increaseVolume(-r)}),_defineProperty$1(this,"airplay",()=>{support.airplay&&this.media.webkitShowPlaybackTargetPicker()}),_defineProperty$1(this,"toggleControls",r=>{if(this.supported.ui&&!this.isAudio){const l=hasClass(this.elements.container,this.config.classNames.hideControls),c=r===void 0?void 0:!r,h=toggleClass(this.elements.container,this.config.classNames.hideControls,c);if(h&&is.array(this.config.controls)&&this.config.controls.includes("settings")&&!is.empty(this.config.settings)&&controls.toggleMenu.call(this,!1),h!==l){const m=h?"controlshidden":"controlsshown";triggerEvent.call(this,this.media,m)}return!h}return!1}),_defineProperty$1(this,"on",(r,l)=>{on.call(this,this.elements.container,r,l)}),_defineProperty$1(this,"once",(r,l)=>{once.call(this,this.elements.container,r,l)}),_defineProperty$1(this,"off",(r,l)=>{off(this.elements.container,r,l)}),_defineProperty$1(this,"destroy",(r,l=!1)=>{if(!this.ready)return;const c=()=>{document.body.style.overflow="",this.embed=null,l?(Object.keys(this.elements).length&&(removeElement(this.elements.buttons.play),removeElement(this.elements.captions),removeElement(this.elements.controls),removeElement(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),is.function(r)&&r()):(unbindListeners.call(this),html5.cancelRequests.call(this),replaceElement(this.elements.original,this.elements.container),triggerEvent.call(this,this.elements.original,"destroyed",!0),is.function(r)&&r.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?(ui.toggleNativeControls.call(this,!0),c()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&is.function(this.embed.destroy)&&this.embed.destroy(),c()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(c),setTimeout(c,200))}),_defineProperty$1(this,"supports",r=>support.mime.call(this,r)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=support.touch,this.media=i,is.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||is.nodeList(this.media)||is.array(this.media))&&(this.media=this.media[0]),this.config=extend({},defaults,Plyr.defaults,t||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch(r){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 Console(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",support),is.nullOrUndefined(this.media)||!is.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(!support.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 n=this.media.tagName.toLowerCase();let a=null,o=null;switch(n){case"div":if(a=this.media.querySelector("iframe"),is.element(a)){if(o=parseUrl(a.getAttribute("src")),this.provider=getProviderByUrl(o.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",o.search.length){const r=["1","true"];r.includes(o.searchParams.get("autoplay"))&&(this.config.autoplay=!0),r.includes(o.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=r.includes(o.searchParams.get("playsinline")),this.config.youtube.hl=o.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(is.empty(this.provider)||!Object.values(providers).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=types.video;break;case"video":case"audio":this.type=n,this.provider=providers.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=support.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new Listeners(this),this.storage=new Storage(this),this.media.plyr=this,is.element(this.elements.container)||(this.elements.container=createElement("div"),wrap(this.media,this.elements.container)),ui.migrateStyles.call(this),ui.addStyleHook.call(this),media.setup.call(this),this.config.debug&&on.call(this,this.elements.container,this.config.events.join(" "),r=>{this.debug.log(`event: ${r.type}`)}),this.fullscreen=new Fullscreen(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&ui.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new Ads(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>silencePromise(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new PreviewThumbnails(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===providers.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===providers.youtube}get isVimeo(){return this.provider===providers.vimeo}get isVideo(){return this.type===types.video}get isAudio(){return this.type===types.audio}get playing(){return!!(this.ready&&!this.paused&&!this.ended)}get paused(){return!!this.media.paused}get stopped(){return!!(this.paused&&this.currentTime===0)}get ended(){return!!this.media.ended}set currentTime(i){if(!this.duration)return;const t=is.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 is.number(i)?i:i&&i.length&&this.duration>0?i.end(0)/this.duration:0}get seeking(){return!!this.media.seeking}get duration(){const i=parseFloat(this.config.duration),t=(this.media||{}).duration,s=is.number(t)&&t!==1/0?t:0;return i||s}set volume(i){let t=i;is.string(t)&&(t=Number(t)),is.number(t)||(t=this.storage.get("volume")),is.number(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!is.empty(i)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(i){let t=i;is.boolean(t)||(t=this.storage.get("muted")),is.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return!!this.media.muted}get hasAudio(){return!this.isHTML5||!!this.isAudio||!!this.media.mozHasAudio||!!this.media.webkitAudioDecodedByteCount||!!(this.media.audioTracks&&this.media.audioTracks.length)}set speed(i){let t=null;is.number(i)&&(t=i),is.number(t)||(t=this.storage.get("speed")),is.number(t)||(t=this.config.speed.selected);const{minimumSpeed:s,maximumSpeed:n}=this;t=clamp(t,s,n),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 n=[!is.empty(i)&&Number(i),this.storage.get("quality"),t.selected,t.default].find(is.number),a=!0;if(!s.includes(n)){const o=closest(s,n);this.debug.warn(`Unsupported quality option: ${n}, using ${o} instead`),n=o,a=!1}t.selected=n,this.media.quality=n,a&&this.storage.set({quality:n})}get quality(){return this.media.quality}set loop(i){const t=is.boolean(i)?i:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return!!this.media.loop}set source(i){source.change.call(this,i)}get source(){return this.media.currentSrc}get download(){const{download:i}=this.config.urls;return is.url(i)?i:this.source}set download(i){is.url(i)&&(this.config.urls.download=i,controls.setDownloadUrl.call(this))}set poster(i){this.isVideo?ui.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=reduceAspectRatio(getAspectRatio.call(this));return is.array(i)?i.join(":"):i}set ratio(i){this.isVideo?is.string(i)&&validateAspectRatio(i)?(this.config.ratio=reduceAspectRatio(i),setAspectRatio.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=is.boolean(i)?i:this.config.autoplay}get autoplay(){return!!this.config.autoplay}toggleCaptions(i){captions.toggle.call(this,i,!1)}set currentTrack(i){captions.set.call(this,i,!1),captions.setup.call(this)}get currentTrack(){const{toggled:i,currentTrack:t}=this.captions;return i?t:-1}set language(i){captions.setLanguage.call(this,i,!1)}get language(){return(captions.getCurrentTrack.call(this)||{}).language}set pip(i){if(!support.pip)return;const t=is.boolean(i)?i:!this.pip;is.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?pip.active:pip.inactive),is.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return support.pip?is.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===pip.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 PreviewThumbnails(this))}static supported(i,t){return support.check(i,t)}static loadSprite(i,t){return loadSprite(i,t)}static setup(i,t={}){let s=null;return is.string(i)?s=Array.from(document.querySelectorAll(i)):is.nodeList(i)?s=Array.from(i):is.array(i)&&(s=i.filter(is.element)),is.empty(s)?null:s.map(n=>new Plyr(n,t))}}Plyr.defaults=cloneDeep(defaults);const Note=defineComponent({name:"NoteSvg",props:{fill:String,shadow:{type:Boolean,defalut:!1},shadowFill:{type:String,default:""},x:{type:Number,default:0},y:{type:Number,default:0}},render(){return createVNode("svg",{width:"14",height:"24",viewBox:"0 0 14 24"},[createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[createVNode("rect",{x:"0",y:"0",width:"14",height:"24"},null),createVNode("g",{fill:this.fill},[this.shadow&&createVNode("ellipse",{fill:this.shadowFill||this.fill,transform:`translate(4.685927, 18.917813) scale(-1, -1) rotate(-32.000000) translate(${this.x+-4.685927}, ${this.y+-18.917813})`,cx:"4.68592654",cy:"18.9178127",rx:"3.70078457",ry:"2.92022453"},null),createVNode("path",{d:"M1.95251677,0.68258909 C3.68583115,-0.400505943 5.78379192,-0.169765229 6.63844331,1.1979629 C7.4930947,2.56569103 6.78079761,4.55247575 5.04748323,5.63557079 C3.85503595,6.38069455 2.49000663,6.50399819 1.47594704,6.06306368 L1.47635248,22.0768926 L0.0162402201,22.0768926 L0.0154715991,4.11169688 C-0.117424115,2.8976469 0.612367024,1.52000759 1.95251677,0.68258909 Z",transform:"scale(-1, -1) translate(-10, -23) "},null)])])])}}),container="_container_1rrce_1",noticeBar="_noticeBar_1rrce_10",pcContainer="_pcContainer_1rrce_14",icon="_icon_1rrce_17",status="_status_1rrce_22",styles={container,noticeBar,pcContainer,icon,status},Title=defineComponent({name:"detail-title",props:{text:{type:String,default:""},rightView:{type:Boolean,default:!0},onClick:{type:Function}},render(){return createVNode("div",{class:[styles.container,state.platform===IPlatform.PC&&styles.pcContainer]},[createVNode(NoticeBar,{text:this.text,color:"#000",class:styles.noticeBar,background:"none"},null)])}}),ShareTop=defineComponent({name:"header-top",props:{scoreData:{type:Object,default:()=>({})}},setup(e,{expose:i}){var w;const t=browser$1(),{scoreData:s}=toRefs(e),n=reactive({show:!1,shiyiShow:!1,isInitPlyr:!1,_plrl:null}),a={BEGINNER:"入门级",ADVANCED:"进阶级",PERFORMER:"大师级"},o={high:"#EF231D",low:"#0E79FF",right:"#01B996",wrong:"#8F4EFB",lack:"#FF8219",not:"#ADADAD",fast:"#F63582",slow:"#FFAA00"},r=ref(state.isPercussion?"cadence":"intonation"),l=ref(!1),c=()=>{api_back()};onUnmounted(()=>{var p;(p=n._plrl)==null||p.destroy()});const h=p=>{r.value=p,s.value.itemType=p},m=computed(()=>{const p=(s.value.videoFilePath||"").split(".").pop();return p==="wav"||p==="mp3"||p==="m4a"?"audio":"video"}),u=((w=navigator==null?void 0:navigator.userAgent)==null?void 0:w.includes("UAWEIVRD-W09"))||(t==null?void 0:t.iPad)||t.isTablet,g=()=>{n.show=!0,!n.isInitPlyr&&nextTick(()=>{const p=m.value==="audio"?"#audioSrc":"#videoSrc";n._plrl=new Plyr(p,{controls:["play-large","play","progress","current-time","duration"],fullscreen:{enabled:!1}}),m.value==="audio"&&setTimeout(()=>{const d=document.querySelector("#audioSrc"),f=document.querySelector("#audioVisualizer"),{pauseVisualDraw:v,playVisualDraw:T}=y(d,f);n._plrl.on("play",()=>{l.value=!0,T()}),n._plrl.on("pause",()=>{l.value=!1,v()})},600),n.isInitPlyr=!0})};function y(p,d,f=128){const v=d.getContext("2d");let{width:T,height:k}=d.getBoundingClientRect();T=Math.ceil(T),k=Math.ceil(k),d.width=T,d.height=k;const N=(E,x,{lineGap:_,canvWidth:R,canvHeight:z,canvFillColor:q,lineColor:H})=>{if(!x)return;const O=R,j=z;S(x,O,j,q);const $=E.length;let P=(O/2-_*$)/$;P<1&&(P=1);const U=O/2,L=j/2;let B=U;for(let C=0;C<$;C++){const F=E[C]/255*L;v.fillStyle=H,C===0&&(B-=_/2),v.fillRect(B-P,L-F,P,F),v.fillRect(B-P,L,P,F),B-=P+_}let M=U;for(let C=0;C<$;C++){const F=E[C]/255*L;v.fillStyle=H,C===0&&(M+=_/2),v.fillRect(M,L-F,P,F),v.fillRect(M,L,P,F),M+=P+_}},S=(E,x,_,R)=>{E.clearRect(0,0,x,_),E.fillStyle=R,E.fillRect(0,0,x,_)},A=()=>{const E=setInterval(()=>{if(V){clearInterval(E);return}N(b(48),v,{lineGap:2,canvWidth:T,canvHeight:k,canvFillColor:"transparent",lineColor:"rgba(255, 251, 251, 1)"})},300)};let V=!0;return{playVisualDraw:()=>{V=!1,A()},pauseVisualDraw:()=>{V=!0,requestAnimationFrame(()=>{v.clearRect(0,0,T,k)})}}}function b(p){const d=new Uint8Array(p),f=30,v=.01,T=.2;let N=150,S=v+Math.random()*(T-v);for(let A=0;AcreateVNode(Fragment,null,[createVNode("div",{class:[styles$1.headerTop,t.android&&styles$1.android]},[createVNode("div",{class:styles$1.left},[createVNode("div",{class:[styles$1.back,!storeData.isApp&&styles$1.disabled],onClick:c},[createVNode("img",{src:iconBack},null)]),createVNode("div",{class:styles$1.leftContent},[createVNode(Title,{class:styles$1.lcName,text:state.examSongName,rightView:!1},null),createVNode("div",{class:styles$1.lcScore},[a[s.value.heardLevel],createTextVNode("|速度:"),Math.floor(s.value.speed),createTextVNode("|综合分数:"),s.value.score,createTextVNode("分")])])]),createVNode("div",{class:[styles$1.middle,u&&styles$1.padMiddle]},[state.isPercussion?null:createVNode("div",{onClick:()=>h("intonation"),class:[styles$1.cItem,"evaluting-report-1",r.value==="intonation"&&styles$1.active]},[createVNode("span",{class:styles$1.mScore},[s.value.intonation,createTextVNode("分")]),createVNode("span",{class:styles$1.mLabel},[createTextVNode("音准")])]),createVNode("div",{onClick:()=>h("cadence"),class:[styles$1.cItem,"evaluting-report-2",r.value==="cadence"&&styles$1.active]},[createVNode("span",{class:styles$1.mScore},[s.value.cadence,createTextVNode("分")]),createVNode("span",{class:styles$1.mLabel},[createTextVNode("节奏")])]),state.isPercussion?null:createVNode("div",{onClick:()=>h("integrity"),class:[styles$1.cItem,"evaluting-report-3",r.value==="integrity"&&styles$1.active]},[createVNode("span",{class:styles$1.mScore},[s.value.integrity,createTextVNode("分")]),createVNode("span",{class:styles$1.mLabel},[createTextVNode("完成度")])])]),createVNode("div",{class:styles$1.right},[createVNode("div",{style:{display:s.value.videoFilePath?"":"none"},class:[styles$1.btn,"evaluting-report-4"],onClick:g},[createVNode("img",{class:styles$1.iconBtn,src:iconhuifang},null),createVNode("span",null,[createTextVNode("回放")])]),createVNode("div",{class:styles$1.btn,onClick:()=>n.shiyiShow=!0},[createVNode("img",{class:styles$1.iconBtn,src:iconShiyi},null),createVNode("span",null,[createTextVNode("释义")])])]),s.value.musicType==="staff"?createVNode(Fragment,null,[createVNode("div",{class:styles$1.demos},[r.value==="intonation"&&createVNode(Fragment,null,[createVNode("div",null,[createVNode(Note,{fill:"#EF231D"},null),createVNode("span",null,[createTextVNode("演奏偏高")])]),createVNode("div",null,[createVNode(Note,{fill:"#0E79FF"},null),createVNode("span",null,[createTextVNode("演奏偏低")])])]),r.value==="cadence"&&createVNode(Fragment,null,[createVNode("div",null,[createVNode(Note,{fill:"#F63582"},null),createVNode("span",null,[createTextVNode("节奏偏快")])]),createVNode("div",null,[createVNode(Note,{fill:"#FFAA00"},null),createVNode("span",null,[createTextVNode("节奏偏慢")])])]),(r.value==="intonation"||r.value==="cadence")&&createVNode(Fragment,null,[createVNode("div",null,[createVNode(Note,{fill:"#01B996"},null),createVNode("span",null,[createTextVNode("演奏正确")])]),createVNode("div",null,[createVNode(Note,{fill:"#8F4EFB"},null),createVNode("span",null,[createTextVNode("演奏错误")])])]),r.value==="integrity"&&createVNode("div",null,[createVNode(Note,{fill:"#FF8219"},null),createVNode("span",null,[createTextVNode("时值不足")])]),r.value==="integrity"&&createVNode("div",null,[createVNode(Note,{fill:"#01B996"},null),createVNode("span",null,[createTextVNode("演奏正确")])]),createVNode("div",null,[createVNode(Note,{fill:"#ADADAD"},null),createVNode("span",null,[createTextVNode("未演奏")])])])]):createVNode(Fragment,null,[createVNode("div",{class:styles$1.demos},[r.value==="intonation"&&createVNode(Fragment,null,[createVNode("div",null,[createVNode("i",{style:{background:o.high}},null),createVNode("span",null,[createTextVNode("演奏偏高")])]),createVNode("div",null,[createVNode("i",{style:{background:o.low}},null),createVNode("span",null,[createTextVNode("演奏偏低")])])]),r.value==="cadence"&&createVNode(Fragment,null,[createVNode("div",null,[createVNode("i",{style:{background:o.fast}},null),createVNode("span",null,[createTextVNode("节奏偏快")])]),createVNode("div",null,[createVNode("i",{style:{background:o.slow}},null),createVNode("span",null,[createTextVNode("节奏偏慢")])])]),(r.value==="intonation"||r.value==="cadence")&&createVNode(Fragment,null,[createVNode("div",null,[createVNode("i",{style:{background:o.right}},null),createVNode("span",null,[createTextVNode("演奏正确")])]),createVNode("div",null,[createVNode("i",{style:{background:o.wrong}},null),createVNode("span",null,[createTextVNode("演奏错误")])])]),r.value==="integrity"&&createVNode("div",null,[createVNode("i",{style:{background:o.lack}},null),createVNode("span",null,[createTextVNode("时值不足")])]),r.value==="integrity"&&createVNode("div",null,[createVNode("i",{style:{background:o.right}},null),createVNode("span",null,[createTextVNode("演奏正确")])]),createVNode("div",null,[createVNode("i",{style:{background:o.not}},null),createVNode("span",null,[createTextVNode("未演奏")])])])]),createVNode(Popup,{teleport:"body",class:["popup-custom","van-scale",styles$1.popup],transition:"van-scale",show:n.show,"onUpdate:show":p=>n.show=p,closeable:!0,onClose:()=>{var p;(p=n._plrl)==null||p.pause()}},{default:()=>[createVNode("div",{class:styles$1.playerBoxContent},[createVNode("div",{class:[styles$1.playerBoxCon,u&&styles$1.padPlayerBox]},[createVNode("div",{class:[styles$1.playerBox,m.value==="video"&&styles$1.videoPlayerBox]},[m.value==="audio"?createVNode("div",{class:styles$1.audioBox},[createVNode("div",{class:styles$1.gramoBox},[createVNode("div",{class:[styles$1.gramoPan,!l.value&&styles$1.imgRotate]},[createVNode("img",{class:styles$1.audioImg,src:musicBg},null)]),createVNode("i",{class:styles$1.audioPoint},null),createVNode("i",{class:[styles$1.audioZhen,!l.value&&styles$1.active]},null)]),createVNode("img",{src:tyImg,class:styles$1.tyImg},null),createVNode("canvas",{class:styles$1.audioVisualizer,id:"audioVisualizer"},null),createVNode("audio",{crossorigin:"anonymous",id:"audioSrc",src:s.value.videoFilePath,controls:"false",preload:"metadata",playsinline:!0},null),createVNode("div",{onClick:()=>{n._plrl.play()},class:[styles$1.playLarge,!l.value&&styles$1.playIngShow]},null)]):createVNode("video",{id:"videoSrc",class:styles$1.videoBox,src:s.value.videoFilePath,"data-poster":videobg,preload:"metadata",playsinline:!0},null)])])])]}),createVNode(Popup,{show:n.shiyiShow,"onUpdate:show":p=>n.shiyiShow=p,class:"popup-custom van-scale center-closeBtn shiyiBox",transition:"van-scale",teleport:"body",closeable:!0},{default:()=>[createVNode("img",{onClick:()=>n.shiyiShow=!1,class:styles$1.shiyiClose,src:shiyiClose},null),s.value.musicType==="staff"?createVNode("div",{class:styles$1.shiyiPopup},[createVNode("img",{class:styles$1.shiyiTop,src:shiyiTop},null),createVNode("div",{class:styles$1.items},[createVNode("div",{class:styles$1.item},[createVNode(Note,{fill:"#EF231D"},null),createVNode("span",null,[createTextVNode("红色音符:演奏偏高")])]),createVNode("div",{class:styles$1.item},[createVNode(Note,{fill:"#01B996"},null),createVNode("span",null,[createTextVNode("绿色音符:演奏正确")])]),createVNode("div",{class:styles$1.item},[createVNode(Note,{fill:"#0E79FF"},null),createVNode("span",null,[createTextVNode("蓝色音符:演奏偏低")])]),createVNode("div",{class:styles$1.item},[createVNode(Note,{fill:"#8F4EFB"},null),createVNode("span",null,[createTextVNode("紫色音符:演奏错误")])]),createVNode("div",{class:styles$1.item},[createVNode(Note,{fill:"#F63582"},null),createVNode("span",null,[createTextVNode("玫红色音符:节奏偏快")])]),createVNode("div",{class:styles$1.item},[createVNode(Note,{fill:"#FF8219"},null),createVNode("span",null,[createTextVNode("橙色音符:时值不足")])]),createVNode("div",{class:styles$1.item},[createVNode(Note,{fill:"#FFAA00"},null),createVNode("span",null,[createTextVNode("黄色音符:节奏偏慢")])]),createVNode("div",{class:styles$1.item},[createVNode(Note,{fill:"#ADADAD"},null),createVNode("span",null,[createTextVNode("灰色音符:未演奏")])])])]):createVNode("div",{class:styles$1.shiyiPopup},[createVNode("img",{class:styles$1.shiyiTop,src:shiyiTop},null),createVNode("div",{class:styles$1.items},[createVNode("div",{class:styles$1.itemTone},[createVNode("i",{style:{background:o.high}},null),createVNode("span",null,[createTextVNode("玫红色音符:演奏偏高")])]),createVNode("div",{class:styles$1.itemTone},[createVNode("i",{style:{background:"#01B996"}},null),createVNode("span",null,[createTextVNode("绿色音符:演奏正确")])]),createVNode("div",{class:styles$1.itemTone},[createVNode("i",{style:{background:o.low}},null),createVNode("span",null,[createTextVNode("蓝色音符:演奏偏低")])]),createVNode("div",{class:styles$1.itemTone},[createVNode("i",{style:{background:o.wrong}},null),createVNode("span",null,[createTextVNode("紫色音符:演奏错误")])]),createVNode("div",{class:styles$1.itemTone},[createVNode("i",{style:{background:o.fast}},null),createVNode("span",null,[createTextVNode("玫红色音符:节奏偏快")])]),createVNode("div",{class:styles$1.itemTone},[createVNode("i",{style:{background:o.lack}},null),createVNode("span",null,[createTextVNode("橙色音符:时值不足")])]),createVNode("div",{class:styles$1.itemTone},[createVNode("i",{style:{background:o.slow}},null),createVNode("span",null,[createTextVNode("黄色音符:节奏偏慢")])]),createVNode("div",{class:styles$1.itemTone},[createVNode("i",{style:{background:o.not}},null),createVNode("span",null,[createTextVNode("灰色音符:未演奏")])])])])]})]),createVNode(EvaluatingReportDriver,{videoFilePath:s.value.videoFilePath},null)])}}),TopArrow=defineComponent({name:"ArrowSvg",props:{fill:String},render(){return createVNode("svg",{id:"topSvg",width:"15px",height:"10px",viewBox:"0 0 10 7",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[createVNode("g",{id:"页面-1",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[createVNode("path",{d:"M1.61932444,0 L8.38067556,0 C8.84091285,1.06606835e-15 9.2140089,0.373096042 9.2140089,0.833333333 C9.2140089,1.00701915 9.15973962,1.17636453 9.05878679,1.31769849 L5.67811123,6.05064428 C5.41060373,6.42515477 4.89014533,6.51189784 4.51563484,6.24439035 C4.44080524,6.19094063 4.37533849,6.12547388 4.32188877,6.05064428 L0.941213211,1.31769849 C0.673705719,0.943188006 0.760448786,0.422729599 1.13495928,0.155222107 C1.27629324,0.0542692786 1.44563862,-3.01161341e-16 1.61932444,0 Z",id:"上",fill:"#FF9200",transform:"translate(5.000000, 3.500000) scale(1, -1) translate(-5.000000, -3.500000) "},null)])])}}),BottomArrow=defineComponent({name:"ArrowSvg",props:{fill:String},render(){return createVNode("svg",{id:"bottomSvg",width:"15px",height:"10px",viewBox:"0 0 10 7",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[createVNode("g",{id:"页面-223",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[createVNode("path",{d:"M1.61932444,0 L8.38067556,0 C8.84091285,1.06606835e-15 9.2140089,0.373096042 9.2140089,0.833333333 C9.2140089,1.00701915 9.15973962,1.17636453 9.05878679,1.31769849 L5.67811123,6.05064428 C5.41060373,6.42515477 4.89014533,6.51189784 4.51563484,6.24439035 C4.44080524,6.19094063 4.37533849,6.12547388 4.32188877,6.05064428 L0.941213211,1.31769849 C0.673705719,0.943188006 0.760448786,0.422729599 1.13495928,0.155222107 C1.27629324,0.0542692786 1.44563862,-3.01161341e-16 1.61932444,0 Z",id:"下",fill:"#FF9200",transform:"translate(5.000000, 3.500000) scale(1, -1) rotate(-180.000000) translate(-5.000000, -3.500000) "},null)])])}}),LeftArrow=defineComponent({name:"ArrowSvg",props:{fill:String},render(){return createVNode("svg",{id:"leftSvg",width:"15px",height:"10px",viewBox:"0 0 10 7",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[createVNode("g",{id:"页面-1",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[createVNode("path",{d:"M0.119324437,1.5 L6.88067556,1.5 C7.34091285,1.5 7.7140089,1.87309604 7.7140089,2.33333333 C7.7140089,2.50701915 7.65973962,2.67636453 7.55878679,2.81769849 L4.17811123,7.55064428 C3.91060373,7.92515477 3.39014533,8.01189784 3.01563484,7.74439035 C2.94080524,7.69094063 2.87533849,7.62547388 2.82188877,7.55064428 L-0.558786789,2.81769849 C-0.826294281,2.44318801 -0.739551214,1.9227296 -0.365040725,1.65522211 C-0.223706765,1.55426928 -0.0543613774,1.5 0.119324437,1.5 Z",id:"左",fill:"#FF9200",transform:"translate(3.500000, 5.000000) scale(-1, -1) rotate(-90.000000) translate(-3.500000, -5.000000) "},null)])])}}),RightArrow=defineComponent({name:"ArrowSvg",props:{fill:String},render(){return createVNode("svg",{id:"rightSvg",width:"15px",height:"10px",viewBox:"0 0 10 7",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[createVNode("g",{id:"页面-1",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[createVNode("path",{d:"M0.119324437,1.5 L6.88067556,1.5 C7.34091285,1.5 7.7140089,1.87309604 7.7140089,2.33333333 C7.7140089,2.50701915 7.65973962,2.67636453 7.55878679,2.81769849 L4.17811123,7.55064428 C3.91060373,7.92515477 3.39014533,8.01189784 3.01563484,7.74439035 C2.94080524,7.69094063 2.87533849,7.62547388 2.82188877,7.55064428 L-0.558786789,2.81769849 C-0.826294281,2.44318801 -0.739551214,1.9227296 -0.365040725,1.65522211 C-0.223706765,1.55426928 -0.0543613774,1.5 0.119324437,1.5 Z",id:"右",fill:"#FF9200",transform:"translate(3.500000, 5.000000) scale(1, -1) rotate(-90.000000) translate(-3.500000, -5.000000) "},null)])])}}),colorsClass={RIGHT:styles$2.right,WRONG:styles$2.wrong,NOT_PLAYED:styles$2.notPlay,EARLY:styles$2.cadence_fast,LATE:styles$2.cadence_slow,HIGH:styles$2.intonation_high,LOW:styles$2.intonation_low,SHORT:styles$2.integrity_wrong},index=defineComponent({name:"music-list",setup(){const query=getQuery(),useedid=ref([]),allNote=ref([]),scoreData=reactive({videoFilePath:"",cadence:0,integrity:0,intonation:0,score:0,speed:0,heardLevel:"",itemType:"intonation",musicType:"staff"}),detailData=reactive({isLoading:!0,paddingLeft:"",headerHide:!1,musicalNotesPlayStats:[],userMeasureScore:{},isNewReport:!0}),getAPPData=async()=>{const e=await isSpecialShapedScreen();if(e!=null&&e.content){const{isSpecialShapedScreen:i,notchHeight:t}=e.content;i&&(detailData.paddingLeft="25px")}detailData.paddingLeft="20px"};onBeforeMount(()=>{getAPPData(),api_setStatusBarVisibility()}),onMounted(async()=>{var e,i,t,s,n,a,o,r,l,c,h,m;state.isEvaluatReport=!0;const res=await api_musicPracticeRecordDetail(query.id);state.partIndex=Number((e=res==null?void 0:res.data)==null?void 0:e.partIndex);let resultData={};try{resultData=eval("("+((i=res==null?void 0:res.data)==null?void 0:i.scoreData)+")")}catch(u){console.error("解析评测结果:",u)}console.log("结果11",resultData),detailData.musicalNotesPlayStats=((t=resultData.musicalNotesPlayStats)==null?void 0:t.notesData)||[],detailData.userMeasureScore=resultData.userMeasureScore||{},detailData.isNewReport=!!res.data.practiceTime,scoreData.heardLevel=(s=res.data)==null?void 0:s.heardLevel,scoreData.cadence=(n=res.data)==null?void 0:n.cadence,scoreData.integrity=(a=res.data)==null?void 0:a.integrity,scoreData.intonation=(o=res.data)==null?void 0:o.intonation,scoreData.score=(r=res.data)==null?void 0:r.score,scoreData.speed=(l=res.data)==null?void 0:l.speed,scoreData.videoFilePath=((c=res.data)==null?void 0:c.videoFilePath)||((h=res.data)==null?void 0:h.recordFilePath),await getMusicDetail((m=resultData.musicalNotesPlayStats)==null?void 0:m.examSongId),state.isSingleLine=!1,scoreData.musicType=query.musicRenderType?query.musicRenderType:resultData.musicType?resultData.musicType:state.musicRenderType,state.musicRenderType=scoreData.musicType,detailData.isLoading=!1});const filterNotes=()=>{let e=detailData.isNewReport?["RIGHT","WRONG","NOT_PLAYED"]:["RIGHT","WRONG","NOT_PLAY"];return scoreData.itemType==="intonation"?e.push("HIGH","LOW"):scoreData.itemType==="cadence"?e.push("EARLY","LATE"):scoreData.itemType==="integrity"&&(e=detailData.isNewReport?["SHORT","NORMAL","NOT_PLAYED"]:["INTEGRITY_WRONG","RIGHT","NOT_PLAY"]),scoreData.itemType==="cadence"?detailData.musicalNotesPlayStats.filter(i=>e.includes(i.rhythmicAssessment?i.rhythmicAssessment.result:i.musicalErrorType)):scoreData.itemType==="integrity"?detailData.musicalNotesPlayStats.filter(i=>{var t;return e.includes(i.integrityAssessment?(t=i.integrityAssessment)==null?void 0:t.result:i.musicalErrorType)}):detailData.musicalNotesPlayStats.filter(i=>{let t=i.pitchAssessment?i.pitchAssessment.result:i.musicalErrorType;return e.includes(t)})},setViewColor=()=>{var i;clearViewColor();const e=filterNotes();console.log("评测报告111");for(const t of e){const s=t.musicalNotesIndex!==void 0?t.musicalNotesIndex:t.index,n=detailData.isNewReport?((i=e[0])==null?void 0:i.measureRenderIndex)!=0?allNote.value[s]:allNote.value.find(a=>a.i===s):allNote.value[s];setTimeout(()=>{if(!(n!=null&&n.id)||n!=null&&n.id&&useedid.value.includes(n==null?void 0:n.id))return;useedid.value.push(n.id);const a=document.getElementById("vf-"+n.id),o=document.getElementById("vf-"+n.id+"-stem");let r="";detailData.isNewReport?r=scoreData.itemType==="cadence"?t.rhythmicAssessment.result:scoreData.itemType==="integrity"?t.integrityAssessment.result:t.pitchAssessment.result:r=t.musicalErrorType;const l=!1;detailData.isNewReport?scoreData.itemType==="integrity"&&(r=r=t.integrityAssessment.result==="NORMAL"?"RIGHT":t.integrityAssessment.result==="SHORT"?"SHORT":r):r=t.musicalErrorType,detailData.isNewReport||(r=r=="NOT_PLAY"?"NOT_PLAYED":r=="INTEGRITY_WRONG"?"SHORT":r),o==null||o.classList.add(colorsClass[r]),a==null||a.classList.add(colorsClass[r]),console.log(123456,"添加颜色",r),a&&l&&(o==null||o.classList.remove(colorsClass[r]),a==null||a.classList.remove(colorsClass[r]),scoreData.musicType==="staff"&&(o==null||o.classList.add(colorsClass.RIGHT),a==null||a.classList.add(colorsClass.RIGHT)),scoreData.musicType)},300)}},removeClass=e=>{if(!e)return;const i=e.classList.values();for(const t of i)(t==null?void 0:t.indexOf("vf-"))!==0&&e.classList.remove(t)},clearViewColor=()=>{for(const e of useedid.value){removeClass(document.getElementById("vf-"+e)),removeClass(document.getElementById("vf-"+e+"-stem"));const i="vf-"+e+"-copy",t=document.getElementById(i);t&&t.remove()}useedid.value=[]},handleRendered=e=>{var n,a,o,r;state.musicRendered=!0,state.osmd=e,allNote.value=formateTimes(e),console.log("🚀 ~ state.times:",allNote.value);const i=(a=(n=detailData.musicalNotesPlayStats)==null?void 0:n[0])==null?void 0:a.measureRenderIndex,t=(r=(o=detailData.musicalNotesPlayStats)==null?void 0:o.last())==null?void 0:r.measureRenderIndex;allNote.value=allNote.value.filter(l=>l.MeasureNumberXML>=i+1&&l.MeasureNumberXML<=t+1),Array.from(new Set(document.getElementsByClassName("vf-beam"))).forEach(l=>{l.classList.add(styles$2.beam)}),setViewColor(),api_cloudLoading()};return watch(()=>scoreData.itemType,()=>{setViewColor()}),()=>createVNode("div",{class:[styles$2.detail,state.setting.eyeProtection&&"eyeProtection",styles$2.shareBox],style:{paddingLeft:detailData.paddingLeft}},[createVNode(Transition,{name:"van-fade"},{default:()=>[!state.musicRendered&&createVNode("div",{class:styles$2.skeleton},[createVNode(Skeleton,{class:styles$2.skeleton,row:8},null)])]}),createVNode("div",{class:["headHeight",styles$2.headHeight,detailData.headerHide&&styles$2.headHide],onClick:e=>e.stopPropagation()},[createVNode(Transition,{name:"van-slide-down"},{default:()=>[state.musicRendered&&createVNode(ShareTop,{scoreData},null)]})]),createVNode("div",{id:"scrollContainer",class:[styles$2.container,!state.setting.displayCursor&&"hideCursor"]},[!detailData.isLoading&&createVNode(MusicScore,{musicColor:"#1B1B1B",onRendered:handleRendered},null),createVNode("div",{class:styles$2.arrowSvg},[createVNode(TopArrow,null,null),createVNode(BottomArrow,null,null),createVNode(LeftArrow,null,null),createVNode(RightArrow,null,null)])])])}});export{index as default};