/*! * artplayer.js v5.4.1 * Github: https://github.com/zhw2590582/ArtPlayer * (c) 2017-2026 Harvey Zhao * Released under the MIT License. * * ArtPlayer bundled third-party notices * * * screenfull - reference v6.0.2, locally adapted * https://github.com/sindresorhus/screenfull * MIT License * * Copyright (c) Sindre Sorhus (https://sindresorhus.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Hint.css v2.7.0 - scoped and styled for ArtPlayer * https://github.com/chinchang/hint.css * MIT License * * Copyright (c) 2021 Kushagra Gour * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * option-validator v2.0.6 * https://github.com/zhw2590582/option-validator * MIT License * * Copyright (c) 2018 Harvey Zack * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ !function(t,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"==typeof define&&define.amd?(t.Artplayer=e(),define(function(){return t.Artplayer})):(t="undefined"!==typeof globalThis?globalThis:t||self).Artplayer=e()}(this,function(){"use strict";var t,e=Object.defineProperty,r=Object.defineProperties,o=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,s=(t,r,o)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o,l=(t,e)=>{for(var r in e||(e={}))a.call(e,r)&&s(t,r,e[r]);if(n)for(var r of n(e))i.call(e,r)&&s(t,r,e[r]);return t},c=(t,e)=>r(t,o(e)),d=(t,e,r)=>new Promise((o,n)=>{var a=t=>{try{s(r.next(t))}catch(e){n(e)}},i=t=>{try{s(r.throw(t))}catch(e){n(e)}},s=t=>t.done?o(t.value):Promise.resolve(t.value).then(a,i);s((r=r.apply(t,e)).next())});function p(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u,h={exports:{}};var f=(u||(u=1,h.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var e=Object.prototype.toString,r=function(r){if(void 0===r)return"undefined";if(null===r)return"null";var n=t(r);if("boolean"===n)return"boolean";if("string"===n)return"string";if("number"===n)return"number";if("symbol"===n)return"symbol";if("function"===n)return"GeneratorFunction"===o(r)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(r))return"array";if(function(t){return!(!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}(r))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(r))return"arguments";if(function(t){return t instanceof Date||"function"==typeof t.toDateString&&"function"==typeof t.getDate&&"function"==typeof t.setDate}(r))return"date";if(function(t){return t instanceof Error||"string"==typeof t.message&&t.constructor&&"number"==typeof t.constructor.stackTraceLimit}(r))return"error";if(function(t){return t instanceof RegExp||"string"==typeof t.flags&&"boolean"==typeof t.ignoreCase&&"boolean"==typeof t.multiline&&"boolean"==typeof t.global}(r))return"regexp";switch(o(r)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"==typeof t.throw&&"function"==typeof t.return&&"function"==typeof t.next}(r))return"generator";switch(n=e.call(r)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return n.slice(8,-1).toLowerCase().replace(/\s/g,"")};function o(t){return t.constructor?t.constructor.name:null}function n(t,e){var o=2{e&&(e=!1,this.cleanups.delete(r),t())};return this.closed?r():this.cleanups.add(r),r}child(){const t=new b,e=this.add(()=>{t.dispose()});return t.add(()=>{e()}),t}dispose(){if(this.closed)return;this.disposed=!0;const t=[];for(const r of Array.from(this.cleanups).reverse())try{r()}catch(e){e instanceof y?t.push(...e.errors):t.push(e)}if(t.length)throw new y(t)}}const w=new WeakMap,x=new WeakMap;function k(t){const e=w.get(t);if(!e)throw new Error("ArtPlayer lifecycle has not been initialized");return e}function $(t){return k(t).scope}function E(t){const e=k(t);return e.destroying||e.scope.closed}function T(t,e,r,o,n=!1){var a,i,s;const l=k(t);if(l.destroying||l.scope.closed)return;l.destroying=!0;const c=[],d=t=>{try{t()}catch(e){c.push(...e instanceof y?e.errors:[e])}};o&&(null==(a=t.template)?void 0:a.$video)&&d(()=>t.reset()),d(()=>l.scope.dispose()),d(()=>{var e;return null==(e=t.template)?void 0:e.destroy(r)});const p=e.indexOf(t);-1!==p&&e.splice(p,1),t.isDestroy=!0,n||(null==(i=l.releaseContainer)||i.call(l),l.releaseContainer=void 0),d(()=>t.emit("destroy")),n&&l.rollback&&d(l.rollback),l.rollback=void 0,null==(s=l.releaseContainer)||s.call(l),l.releaseContainer=void 0;for(const u of c.slice(1))console.warn("Additional ArtPlayer cleanup failure:",u);if(c.length)throw c[0]}const C=new WeakMap;function z(t,e){const r=$(t).child();return C.set(e,r),r}function S(t){const e=C.get(t);if(!e)throw new Error("ArtPlayer component has not been registered");return e}function L(t){var e;null==(e=C.get(t))||e.dispose()}function M(t,e){return{on:(r,o)=>{!function(t,e,r,o){const n=S(e);if(n.closed)return;const a=(...t)=>{if(!n.closed)return o(...t)};t.on(r,a),n.add(()=>{t.off(r,a)})}(t,e,r,o)},proxy:(r,o,n)=>function(t,e,r,o,n){const a=S(e);if(a.closed)return()=>{};const i=t.events.proxy(r,o,t=>{if(!a.closed)return n(t)});return a.add(()=>{t.events.remove(i)})}(t,e,r,o,n)}}const A=null!=(t=null==globalThis?void 0:globalThis.CUSTOM_USER_AGENT)?t:"undefined"!==typeof navigator?navigator.userAgent:"",P=/^(?:(?!chrome|android).)*safari/i.test(A),O=/iPad|iPhone|iPod/i.test(A)&&!window.MSStream,I=O||A.includes("Macintosh")&&navigator.maxTouchPoints>=1,R=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(A)||I,_="undefined"!==typeof window&&"undefined"!==typeof document;function V(t,e){let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{document.head.appendChild(r)}):(document.head||document.documentElement).appendChild(r)),r.textContent=e}function Y(t,e=document){return e.querySelector(t)}function D(t,e=document){return Array.from(e.querySelectorAll(t))}function N(t,e){return t.classList.add(e)}function F(t,e){return t.classList.remove(e)}function H(t,e){return t.classList.contains(e)}function B(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",String(e)),t.lastElementChild||t.lastChild}function W(t){return t.parentNode.removeChild(t)}function j(t,e,r){return t.style[e]=r,t}function q(t,e){for(const r in e)j(t,r,e[r]);return t}function U(t){return Array.from(t.parentElement.children).filter(e=>e!==t)}function X(t,e){U(t).forEach(t=>F(t,e)),N(t,e)}function G(t,e,r="top"){R||(t.setAttribute("aria-label",e),N(t,"hint--rounded"),N(t,`hint--${r}`))}function K(t,e=0){const r=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,a=r.top-e<=o&&r.top+r.height+e>=0,i=r.left-e<=n+e&&r.left+r.width+e>=0;return a&&i}function Z(t,e){return nt(t).includes(e)}function J(t,e){return e.parentNode.replaceChild(t,e),t}function Q(t){return document.createElement(t)}function tt(t="",e=""){const r=Q("i");return N(r,"art-icon"),N(r,`art-icon-${t}`),B(r,e),r}function et(){const t=document.createElement("div");return t.style.display="flex","flex"===t.style.display}function rt(t){return t.getBoundingClientRect()}function ot(t,e){return new Promise((r,o)=>{const n=new Image;n.onload=function(){if(e&&1!==e){const a=document.createElement("canvas"),i=a.getContext("2d");a.width=n.width*e,a.height=n.height*e,i.drawImage(n,0,0,a.width,a.height),a.toBlob(e=>{const n=URL.createObjectURL(e),a=new Image;a.onload=function(){r(a)},a.onerror=function(){URL.revokeObjectURL(n),o(new Error(`Image load failed: ${t}`))},a.src=n})}else r(n)},n.onerror=function(){o(new Error(`Image load failed: ${t}`))},n.src=t})}function nt(t){if(t.composedPath)return t.composedPath();const e=[];let r=t.target;for(;r;)e.push(r),r=r.parentNode;return e.includes(window)||void 0===window||e.push(window),e}function at(){const t=document.createElement("div");t.style.cssText="position:fixed;top:env(safe-area-inset-top,0px);right:env(safe-area-inset-right,0px);bottom:env(safe-area-inset-bottom,0px);left:env(safe-area-inset-left,0px);pointer-events:none;visibility:hidden;",document.body.appendChild(t);const e=getComputedStyle(t),r={top:Number.parseFloat(e.top)||0,right:Number.parseFloat(e.right)||0,bottom:Number.parseFloat(e.bottom)||0,left:Number.parseFloat(e.left)||0};return t.remove(),r}class it extends Error{constructor(t,e){super(t),"captureStackTrace"in Error&&"function"===typeof Error.captureStackTrace&&Error.captureStackTrace(this,e||this.constructor),this.name="ArtPlayerError"}}function st(t,e){if(!t)throw new it(e);return t}function lt(t){const e=t;return e&&"function"===typeof e.catch?e.catch(()=>{}):t}function ct(t){const e=t.search(/[?#]/),r=(e<0?t:t.slice(0,e)).trim().toLowerCase();return r.slice(r.lastIndexOf(".")+1)}function dt(t,e){const r=document.createElement("a");r.style.display="none",r.href=t,r.download=e,document.body.appendChild(r);try{r.click()}finally{r.remove()}}function pt(t,e,r){return Math.max(Math.min(t,Math.max(e,r)),Math.min(e,r))}function ut(t){return t.charAt(0).toUpperCase()+t.slice(1)}function ht(t){if(!t)return"00:00";const e=Math.floor(t/3600),r=Math.floor((t-3600*e)/60),o=Math.floor(t-3600*e-60*r);return(e>0?[e,r,o]:[r,o]).map(t=>t<10?`0${t}`:String(t)).join(":")}const ft={"&":"&","<":"<",">":">","'":"'",'"':"""},mt={"&":"&","<":"<",">":">","'":"'",""":'"'},gt=/(&|<|>|'|")/g;function vt(t){return t.replace(/[&<>'"]/g,t=>ft[t]||t)}const yt=Object.defineProperty,{hasOwnProperty:bt}=Object.prototype;function wt(t,e){return bt.call(t,e)}function xt(t,e){return Object.getOwnPropertyDescriptor(t,e)}function kt(...t){const e=t=>!!t&&"object"===typeof t&&!Array.isArray(t);return t.reduce((t,r)=>(Object.keys(r).forEach(o=>{const n=t[o],a=r[o];let i;i=Array.isArray(n)&&Array.isArray(a)?n.concat(...a):e(n)&&e(a)?kt(n,a):a,yt(t,o,{value:i,enumerable:!0,configurable:!0,writable:!0})}),t),{})}function $t(t){return"WEBVTT \r\n\r\n".concat((e=t,e.replace(/(\d\d:\d\d:\d\d)[,.](\d+)/g,(t,e,r)=>{let o=r.slice(0,3);return 1===r.length&&(o=`${r}00`),2===r.length&&(o=`${r}0`),`${e},${o}`})).replace(/\{\\([ibu])\}/g,"").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").replace(/\{[\s\S]*?\}/g,"").concat("\r\n\r\n"));var e}function Et(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function Tt(t){const e=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function r(t=""){return t.split(/[:.]/).map((t,e,r)=>{if(e===r.length-1){if(1===t.length)return`.${t}00`;if(2===t.length)return`.${t}0`}else if(1===t.length)return(0===e?"0":":0")+t;return 0===e?t:e===r.length-1?`.${t}`:`:${t}`}).join("")}return`WEBVTT\n\n${t.split(/\r?\n/).map(t=>{const o=t.match(e);if(!o)return null;const[,n="",a="",,,i=""]=o;return{start:r(n.trim()),end:r(a.trim()),text:i.replace(/\{[\s\S]*?\}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map(t=>t.trim()).join("\n")}}).filter(t=>t).map((t,e)=>t?`${e+1}\n${t.start} --\x3e ${t.end}\n${t.text}`:"").filter(t=>t.trim()).join("\n\n")}`}function Ct(t,e){let r=!1;return function(...o){r||(t.apply(this,o),r=!0,setTimeout(()=>{r=!1},e))}}const zt=Object.freeze(Object.defineProperty({__proto__:null,ArtPlayerError:it,addClass:N,append:B,assToVtt:Tt,capitalize:ut,clamp:pt,createElement:Q,debounce:function(t,e){let r;return function(...o){clearTimeout(r),r=setTimeout(()=>(r=void 0,t.apply(this,o)),e)}},def:yt,download:dt,errorHandle:st,escape:vt,get:xt,getComposedPath:nt,getExt:ct,getIcon:tt,getRect:rt,getSafeAreaInsets:at,getStyle:function(t,e,r=!0){const o=window.getComputedStyle(t,null).getPropertyValue(e);return r?Number.parseFloat(o):o},has:wt,hasClass:H,includeFromEvent:Z,inverseClass:X,isBrowser:_,isIOS:O,isIOS13:I,isInViewport:K,isMobile:R,isSafari:P,loadImg:ot,mergeDeep:kt,query:Y,queryAll:D,remove:W,removeClass:F,replaceElement:J,secondToTime:ht,setStyle:j,setStyleText:V,setStyles:q,siblings:U,silencePromise:lt,sleep:function(t=0){return new Promise(e=>setTimeout(e,t))},srtToVtt:$t,supportsFlex:et,throttle:Ct,tooltip:G,unescape:function(t){return t.replace(gt,t=>mt[t]||t)},userAgent:A,vttToBlob:Et},Symbol.toStringTag,{value:"Module"}));function St(t,e){return B(t,e)}function Lt(t,e){return e.querySelector(t)}const Mt="array",At="boolean",Pt="string",Ot="number",It="object",Rt="function";function _t(t,e,r){return st(e===Pt||e===Ot||t instanceof Element,`${r.join(".")} require '${Pt}' or 'Element' type`)}const Vt={html:_t,disable:`?${At}`,name:`?${Pt}`,index:`?${Ot}`,style:`?${It}`,click:`?${Rt}`,mounted:`?${Rt}`,tooltip:`?${Pt}|${Ot}`,width:`?${Ot}`,selector:`?${Mt}`,onSelect:`?${Rt}`,switch:`?${At}`,onSwitch:`?${Rt}`,range:`?${Mt}`,onRange:`?${Rt}`,onChange:`?${Rt}`},Yt={id:Pt,container:_t,url:Pt,poster:Pt,type:Pt,theme:Pt,lang:Pt,volume:Ot,isLive:At,muted:At,autoplay:At,autoSize:At,autoMini:At,loop:At,flip:At,playbackRate:At,aspectRatio:At,screenshot:At,setting:At,hotkey:At,pip:At,mutex:At,backdrop:At,fullscreen:At,fullscreenWeb:At,subtitleOffset:At,miniProgressBar:At,useSSR:At,playsInline:At,lock:At,gesture:At,fastForward:At,autoPlayback:At,autoOrientation:At,airplay:At,proxy:`?${Rt}`,plugins:[Rt],layers:[Vt],contextmenu:[Vt],settings:[Vt],controls:[c(l({},Vt),{position:(t,e,r)=>{const o=["top","left","right"];return st("string"===typeof t&&o.includes(t),`${r.join(".")} only accept ${o.toString()} as parameters`)}})],quality:[{default:`?${At}`,html:Pt,url:Pt}],highlight:[{time:Ot,text:Pt}],thumbnails:{url:Pt,number:Ot,column:Ot,width:Ot,height:Ot,scale:Ot},subtitle:{url:Pt,name:Pt,type:Pt,style:It,escape:At,encoding:Pt,onVttLoad:Rt},moreVideoAttr:It,i18n:It,icons:It,cssVar:It,customType:It},Dt=new WeakSet;class Nt{constructor(t){this.id=0,this.art=t,this.cache=new Map,this.add=this.add.bind(this),this.remove=this.remove.bind(this),this.update=this.update.bind(this)}get show(){return H(this.art.template.$player,`art-${this.name}-show`)}set show(t){const{$player:e}=this.art.template,r=`art-${this.name}-show`;t?N(e,r):F(e,r),this.art.emit(this.name,t)}toggle(){this.show=!this.show}add(t){var e;if(E(this.art))return;const r="function"===typeof t?t(this.art):t;if(E(this.art))return;if(r.html=r.html||"",m(r,Vt),!this.$parent||!this.name||r.disable)return;const o=r.name||`${this.name}${this.id}`,n=this.cache;st(!n.has(o),`Can't add an existing [${o}] to the [${this.name}]`),this.id+=1;const a=document.createElement("div"),i=z(this.art,a),s=[],l=Object.getOwnPropertyDescriptor(this,o);let c=!1;i.add(()=>{for(const t of s)this.art.events.remove(t)});try{if(i.closed)return;if(function(t,e,r,o,n,a){N(t,`art-${r}`),N(t,`art-${r}-${o}`);const i=Array.from(e.children);t.dataset.index=String(a.index||n);const s=i.find(e=>Number(e.dataset.index)>=Number(t.dataset.index));s?s.insertAdjacentElement("beforebegin",t):B(e,t),a.html&&B(t,a.html),a.style&&q(t,a.style),a.tooltip&&G(t,a.tooltip)}(a,this.$parent,this.name,o,this.id,r),i.closed)return;if(r.click){const t=this.art.events.proxy(a,"click",t=>{i.closed||(t.preventDefault(),r.click.call(this.art,this,t))});s.push(t)}if(r.selector&&["left","right"].includes(r.position)&&this.selector(r,a,s),i.closed)return;return function(t,e,r){const o=t;"__proto__"===e?Object.defineProperty(o,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[e]=r}(this,o,a),c=!0,n.set(o,{$ref:a,events:s,option:r}),r.mounted&&r.mounted.call(this.art,a),a}catch(d){try{L(a)}catch(p){console.warn("ArtPlayer component cleanup failed:",p)}throw(null==(e=n.get(o))?void 0:e.$ref)===a&&n.delete(o),c&&this[o]===a&&(l?Object.defineProperty(this,o,l):delete this[o]),a.remove(),d}}remove(t){st(this.cache.has(t),`Can't find [${t}] from the [${this.name}]`);const e=this.cache.get(t);if(!Dt.has(e)){Dt.add(e);try{e.option.beforeUnmount&&e.option.beforeUnmount.call(this.art,e.$ref);try{L(e.$ref)}finally{this.cache.get(t)===e&&(this.cache.delete(t),delete this[t]),e.$ref.remove()}}finally{Dt.delete(e)}}}update(t){if(this.cache.has(t.name)){const e=this.cache.get(t.name);t=Object.assign(e.option,t),this.remove(t.name)}return this.add(t)}}class Ft extends Nt{constructor(t){super(t),this.name="contextmenu",this.$parent=t.template.$contextmenu,z(t,this.$parent),R||this.init()}init(){const{option:t,template:{$player:e,$contextmenu:r}}=this.art,{on:o,proxy:n}=M(this.art,r);t.playbackRate&&this.add(function(t){return e=>{const{i18n:r,constructor:{PLAYBACK_RATE:o}}=e,n=o.map(t=>`${1===t?r.get("Normal"):t.toFixed(1)}`).join("");return c(l({},t),{html:`${r.get("Play Speed")}: ${n}`,click:(t,r)=>{const o=r.target instanceof HTMLElement?r.target.dataset.value:void 0;o&&(e.playbackRate=Number(o),t.show=!1)},mounted:t=>{const{on:r}=M(e,t),o=Y('[data-value="1"]',t);o&&X(o,"art-current"),r("video:ratechange",()=>{const r=Array.from(t.querySelectorAll("span")).find(t=>Number(t.dataset.value)===e.playbackRate);r&&X(r,"art-current")})}})}}({name:"playbackRate",index:10})),t.aspectRatio&&this.add(function(t){return e=>{const{i18n:r,constructor:{ASPECT_RATIO:o}}=e,n=o.map(t=>`${"default"===t?r.get("Default"):t}`).join("");return c(l({},t),{html:`${r.get("Aspect Ratio")}: ${n}`,click:(t,r)=>{const o=r.target instanceof HTMLElement?r.target.dataset.value:void 0;o&&(e.aspectRatio=o,t.show=!1)},mounted:t=>{const{on:r}=M(e,t),o=Y('[data-value="default"]',t);o&&X(o,"art-current"),r("aspectRatio",e=>{const r=Array.from(t.querySelectorAll("span")).find(t=>t.dataset.value===e);r&&X(r,"art-current")})}})}}({name:"aspectRatio",index:20})),t.flip&&this.add(function(t){return e=>{const{i18n:r,constructor:{FLIP:o}}=e,n=o.map(t=>`${r.get(ut(t))}`).join("");return c(l({},t),{html:`${r.get("Video Flip")}: ${n}`,click:(t,r)=>{const o=r.target instanceof HTMLElement?r.target.dataset.value:void 0;o&&(e.flip=o.toLowerCase(),t.show=!1)},mounted:t=>{const{on:r}=M(e,t),o=Y('[data-value="normal"]',t);o&&X(o,"art-current"),r("flip",e=>{const r=Array.from(t.querySelectorAll("span")).find(t=>t.dataset.value===e);r&&X(r,"art-current")})}})}}({name:"flip",index:30})),this.add(function(t){return e=>c(l({},t),{html:e.i18n.get("Video Info"),click:t=>{e.info.show=!0,t.show=!1}})}({name:"info",index:40})),this.add(function(t){return c(l({},t),{html:`ArtPlayer ${g}`})}({name:"version",index:50})),this.add(function(t){return e=>c(l({},t),{html:e.i18n.get("Close"),click:t=>{t.show=!1}})}({name:"close",index:60}));for(let a=0;a{if(!this.art.constructor.CONTEXTMENU)return;t.preventDefault(),this.show=!0;const o=t.clientX,n=t.clientY,{height:a,width:i,left:s,top:l}=rt(e),{height:c,width:d}=rt(r);let p=o-s,u=n-l;o+d>s+i&&(p=i-d),n+c>l+a&&(u=a-c),q(r,{top:`${u}px`,left:`${p}px`})}),n(e,"click",t=>{Z(t,r)||(this.show=!1)}),o("blur",()=>{this.show=!1})}}function Ht(t,e,r){if(t.closed)return()=>{};let o=!0,n=()=>{};const a=setTimeout(()=>{o&&(n(),t.closed||e())},r);return n=t.add(()=>{o=!1,clearTimeout(a)}),n}function Bt(t,e=0){return t.closed?Promise.resolve(!1):new Promise(r=>{let o=!1,n=()=>{};const a=setTimeout(()=>{o=!0,n(),r(!0)},e);n=t.add(()=>{clearTimeout(a),o||r(!1)})})}function Wt(t,e){const{$progress:r}=t.template,{left:o}=rt(r),n=pt((R?e.touches[0].clientX:e.clientX)-o,0,r.clientWidth),a=n/r.clientWidth*t.duration;return{second:a,time:ht(a),width:n,percentage:pt(n/r.clientWidth,0,1)}}function jt(t,e){if(t.isRotate){const r=(e.touches[0].clientY-t.top)/t.height,o=r*t.duration;t.emit("setBar","played",r,e),t.seek=o}else{const{second:r,percentage:o}=Wt(t,e);t.emit("setBar","played",o,e),t.seek=r}}function qt(t,e){const{icons:r,option:o}=t,{$player:n}=t.template,a=S(e),{on:i}=M(t,e);let s=()=>{};const l=Lt(".art-progress-hover",e),c=Lt(".art-progress-loaded",e),d=Lt(".art-progress-played",e),p=Lt(".art-progress-highlight",e),u=Lt(".art-progress-indicator",e),h=Lt(".art-progress-tip",e);function f(r,o){const{width:n,time:a}=o||Wt(t,r);h.textContent=a||"00:00";const i=h.clientWidth;n<=i/2?j(h,"left",0):n>e.clientWidth-i/2?j(h,"left",e.clientWidth-i+"px"):j(h,"left",n-i/2+"px")}r.indicator?B(u,r.indicator):j(u,"backgroundColor","var(--art-theme)"),i("setBar",function(r,o,i){const m="played"===r&&i&&R;if("loaded"===r&&j(c,"width",100*o+"%"),"hover"===r&&(j(l,"width",100*o+"%"),Z(i,p)?function(r){const{width:o}=Wt(t,r),n=r.target instanceof HTMLElement?r.target.dataset.text:void 0;h.textContent=null!=n?n:"";const a=h.clientWidth;o<=a/2?j(h,"left",0):o>e.clientWidth-a/2?j(h,"left",e.clientWidth-a+"px"):j(h,"left",o-a/2+"px")}(i):f(i),0===o?F(n,"art-progress-hover"):N(n,"art-progress-hover")),"played"===r&&(j(d,"width",100*o+"%"),j(u,"left",100*o+"%")),m){N(n,"art-progress-hover");f(i,{width:e.clientWidth*o,time:ht(o*t.duration)}),s(),s=Ht(a,()=>{F(n,"art-progress-hover")},500)}}),i("video:loadedmetadata",function(){p.textContent="";for(let e=0;e{t.emit("setBar","played",t.played),t.emit("setBar","loaded",t.loaded)}):(i("video:timeupdate",()=>{t.emit("setBar","played",t.played)}),i("video:progress",()=>{t.emit("setBar","loaded",t.loaded)}),i("video:ended",()=>{t.emit("setBar","played",1)})),t.emit("setBar","loaded",t.loaded||0)}function Ut(t){return e=>c(l({},t),{html:'\n
\n
\n
\n
\n
\n
\n
00:00
\n
\n ',mounted:t=>{qt(e,t),function(t,e){const{$progress:r}=t.template,o=e.querySelector(".art-progress-indicator"),{on:n,proxy:a}=M(t,e);if(!R){let e=!1;a(r,"click",e=>{e.target!==o&&jt(t,e)}),a(r,"mousemove",e=>{const{percentage:r}=Wt(t,e);t.emit("setBar","hover",r,e)}),a(r,"mouseleave",e=>{t.emit("setBar","hover",0,e)}),a(r,"mousedown",t=>{e=0===t.button}),n("document:mousemove",r=>{if(e){const{second:e,percentage:o}=Wt(t,r);t.emit("setBar","played",o,r),t.seek=e}}),n("document:mouseup",()=>{e&&(e=!1)})}}(e,t)}})}function Xt(t){const{option:e}=t.art;e.isLive||t.add(Ut({name:"progress",position:"top",index:10})),t.add({name:"thumbnails",position:"top",index:20}),t.add(function(t){return e=>c(l({},t),{mounted:t=>{const{on:r,proxy:o}=M(e,t),{icons:n,i18n:a}=e,i=St(t,n.play),s=St(t,n.pause);function l(){j(i,"display","flex"),j(s,"display","none")}function c(){j(i,"display","none"),j(s,"display","flex")}G(i,a.get("Play")),G(s,a.get("Pause")),o(i,"click",()=>{lt(e.play())}),o(s,"click",()=>{e.pause()}),e.playing?c():l(),r("video:playing",()=>{c()}),r("video:pause",()=>{l()})}})}({name:"playAndPause",position:"left",index:10})),t.add(function(t){return e=>c(l({},t),{mounted:t=>{const{on:r,proxy:o}=M(e,t),{icons:n}=e,a=St(t,n.volume),i=St(t,n.volumeClose),s=St(t,'
'),l=St(s,'
'),c=St(l,'
'),d=St(l,'
'),p=St(d,'
'),u=St(p,'
'),h=St(d,'
');function f(t){const{top:e,height:r}=rt(d);return 1-(t.clientY-e)/r}function m(){if(e.muted||0===e.volume)j(a,"display","none"),j(i,"display","flex"),j(h,"top","100%"),j(u,"top","100%"),c.textContent="0";else{const t=100*e.volume;j(a,"display","flex"),j(i,"display","none"),j(h,"top",100-t+"%"),j(u,"top",100-t+"%"),c.textContent=String(Math.floor(t))}}if(m(),r("video:volumechange",m),o(a,"click",()=>{e.muted=!0}),o(i,"click",()=>{e.muted=!1}),R)j(s,"display","none");else{let t=!1;o(d,"mousedown",r=>{t=0===r.button,e.volume=f(r)}),r("document:mousemove",r=>{t&&(e.muted=!1,e.volume=f(r))}),r("document:mouseup",()=>{t&&(t=!1)})}}})}({name:"volume",position:"left",index:20})),e.isLive||t.add(function(t){return e=>c(l({},t),{style:R?{fontSize:"12px",padding:"0 5px"}:{cursor:"auto",padding:"0 10px"},mounted:t=>{const{on:r}=M(e,t);function o(){const r=`${ht(e.currentTime)} / ${ht(e.duration)}`;r!==t.textContent&&(t.textContent=r)}o();const n=["video:loadedmetadata","video:timeupdate","video:progress"];for(let e=0;e{r&&!$(t.art).closed&&(t.art.quality=e.quality)}).catch(t=>{console.warn("ArtPlayer quality initialization failed:",t)}),e.screenshot&&!R&&t.add(function(t){return e=>c(l({},t),{tooltip:e.i18n.get("Screenshot"),mounted:t=>{const{proxy:r}=M(e,t),{icons:o}=e;St(t,o.screenshot),r(t,"click",()=>{e.screenshot()})}})}({name:"screenshot",position:"right",index:20})),e.setting&&t.add(function(t){return e=>c(l({},t),{tooltip:e.i18n.get("Show Setting"),mounted:t=>{const{on:r,proxy:o}=M(e,t),{icons:n,i18n:a}=e;St(t,n.setting),o(t,"click",()=>{e.setting.toggle(),e.setting.resize()}),r("setting",e=>{G(t,a.get(e?"Hide Setting":"Show Setting"))})}})}({name:"setting",position:"right",index:30})),e.pip&&t.add(function(t){return e=>c(l({},t),{tooltip:e.i18n.get("PIP Mode"),mounted:t=>{const{on:r,proxy:o}=M(e,t),{icons:n,i18n:a}=e;St(t,n.pip),o(t,"click",()=>{e.pip=!e.pip}),r("pip",e=>{G(t,a.get(e?"Exit PIP Mode":"PIP Mode"))})}})}({name:"pip",position:"right",index:40})),e.airplay&&"WebKitPlaybackTargetAvailabilityEvent"in window&&window.WebKitPlaybackTargetAvailabilityEvent&&t.add(function(t){return e=>c(l({},t),{tooltip:e.i18n.get("AirPlay"),mounted:t=>{const{proxy:r}=M(e,t),{icons:o}=e;St(t,o.airplay),r(t,"click",()=>e.airplay())}})}({name:"airplay",position:"right",index:50})),e.fullscreenWeb&&t.add(function(t){return e=>c(l({},t),{tooltip:e.i18n.get("Web Fullscreen"),mounted:t=>{const{on:r,proxy:o}=M(e,t),{icons:n,i18n:a}=e,i=St(t,n.fullscreenWebOn),s=St(t,n.fullscreenWebOff);j(s,"display","none"),o(t,"click",()=>{e.fullscreenWeb=!e.fullscreenWeb}),r("fullscreenWeb",e=>{e?(G(t,a.get("Exit Web Fullscreen")),j(i,"display","none"),j(s,"display","inline-flex")):(G(t,a.get("Web Fullscreen")),j(i,"display","inline-flex"),j(s,"display","none"))})}})}({name:"fullscreenWeb",position:"right",index:60})),e.fullscreen&&t.add(function(t){return e=>c(l({},t),{tooltip:e.i18n.get("Fullscreen"),mounted:t=>{const{on:r,proxy:o}=M(e,t),{icons:n,i18n:a}=e,i=St(t,n.fullscreenOn),s=St(t,n.fullscreenOff);j(s,"display","none"),o(t,"click",()=>{e.fullscreen=!e.fullscreen}),r("fullscreen",e=>{e?(G(t,a.get("Exit Fullscreen")),j(i,"display","none"),j(s,"display","inline-flex")):(G(t,a.get("Fullscreen")),j(i,"display","inline-flex"),j(s,"display","none"))})}})}({name:"fullscreen",position:"right",index:70}));for(let r=0;rKt.get(t).option.selector}),yt(t,"$control_item",{get:()=>Kt.get(t).item}),yt(t,"$control_value",{get:()=>Kt.get(t).value})),Kt.set(t,e)}function Jt(t,e){t.innerHTML=e}function Qt(t,e,r,o,n){const{proxy:a}=t.events,i=S(o),s=r.selector;N(o,"art-control-selector");const l=document.createElement("div");N(l,"art-selector-value"),B(l,r.html),o.textContent="",B(o,l);const c=St(o,'
');for(let d=0;dd(null,null,function*(){if(i.closed)return;const n=nt(o),a=r.selector.find(t=>n.includes(t.$control_item));if(!a)return;const s=++p,c=()=>!i.closed&&s===p,d=i.add(function(t,e){return Gt.set(t,e),()=>{Gt.get(t)===e&&Gt.delete(t)}}(o,c));try{if(e(a),i.closed)return;if(r.onSelect){const e=yield r.onSelect.call(t,a,a.$control_item,o);c()&&Jt(l,e)}}catch(u){console.warn("ArtPlayer selector failed:",u)}finally{d()}}));n.push(u)}class te extends Nt{constructor(t){super(t),this.isHover=!1,this.name="control",this.timer=Date.now();const{constructor:e}=t,{$player:r,$bottom:o}=this.art.template;z(t,o);const{on:n}=M(t,o);n("mousemove",()=>{R||(this.show=!0)}),n("click",()=>{R?this.toggle():this.show=!0}),n("document:mousemove",t=>{this.isHover=Z(t,o)}),n("video:timeupdate",()=>{!t.setting.show&&!this.isHover&&!t.isInput&&t.playing&&this.show&&Date.now()-this.timer>=e.CONTROL_HIDE_TIME&&(this.show=!1)}),n("control",t=>{t?(F(r,"art-hide-cursor"),N(r,"art-hover"),this.timer=Date.now()):(N(r,"art-hide-cursor"),F(r,"art-hover"))}),this.init(),$(t).closed||function(t){const{$bottom:e,$controls:r,$player:o}=t.template,n=S(e),{on:a}=M(t,e),i=()=>{if(n.closed)return;const t=r.offsetHeight;t>0&&o.style.getPropertyValue("--art-controls-height")!==`${t}px`&&o.style.setProperty("--art-controls-height",`${t}px`)};if(a("resize",i),"undefined"!==typeof ResizeObserver){const t=new ResizeObserver(i);t.observe(r),n.add(()=>{t.disconnect()})}else if("undefined"!==typeof MutationObserver){const t=new MutationObserver(i);t.observe(r,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),n.add(()=>{t.disconnect()})}i()}(t)}init(){Xt(this)}add(t){if(E(this.art))return;const e="function"===typeof t?t(this.art):t,{$progress:r,$controlsLeft:o,$controlsRight:n}=this.art.template;switch(e.position){case"top":this.$parent=r;break;case"left":this.$parent=o;break;case"right":this.$parent=n;break;default:st(!1,"Control option.position must one of 'top', 'left', 'right'")}super.add(e)}check(t){!function(t){if(t){Jt(t.$control_value,t.html);for(let e=0;ethis.check(t),t,e,r)}}function ee(t,e,r,o){const n=e-o,a=r-t;let i=0;if(Math.abs(a)<2&&Math.abs(n)<2)return i;const s=function(t,e){return 180*Math.atan2(e,t)/Math.PI}(a,n);return s>=-45&&s<45?i=4:s>=45&&s<135?i=1:s>=-135&&s<-45?i=2:(s>=135&&s<=180||s>=-180&&s<-135)&&(i=3),i}function re(t){if(t.constructor.USE_RAF){const e=$(t);let r=()=>{};!function o(){t.playing&&t.emit("raf"),t.isDestroy||(r=function(t,e){if(t.closed)return()=>{};let r=!0,o=()=>{};const n=requestAnimationFrame(n=>{r&&(o(),t.closed||e(n))});return o=t.add(()=>{r=!1,cancelAnimationFrame(n)}),o}(e,o))}(),t.on("destroy",()=>{r()})}}const oe=new WeakMap;class ne{constructor(t){this.destroyEvents=new Set;const e=$(t);oe.set(this,e),e.add(()=>this.destroy()),this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),function(t,e){const{constructor:r,template:{$player:o,$video:n}}=t;function a(e){Z(e,o)?(t.isInput="INPUT"===e.target.tagName,t.isFocus=!0,t.emit("focus",e)):(t.isInput=!1,t.isFocus=!1,t.emit("blur",e))}t.on("document:click",a),t.on("document:contextmenu",a);let i=[];e.proxy(n,"click",e=>{const o=Date.now();i.push(o);const{MOBILE_CLICK_PLAY:n,DBCLICK_TIME:a,MOBILE_DBCLICK_PLAY:s,DBCLICK_FULLSCREEN:l}=r,c=i.filter(t=>o-t<=a);switch(c.length){case 1:t.emit("click",e),R?!t.isLock&&n&<(t.toggle()):lt(t.toggle()),i=c;break;case 2:t.emit("dblclick",e),R?!t.isLock&&s&<(t.toggle()):l&&(t.fullscreen=!t.fullscreen),i=[];break;default:i=[]}})}(t,this),function(t,e){const{$player:r}=t.template;e.hover(r,e=>{N(r,"art-hover"),t.emit("hover",!0,e)},e=>{F(r,"art-hover"),t.emit("hover",!1,e)})}(t,this),function(t,e){const{$player:r}=t.template;e.proxy(r,"mousemove",e=>{t.emit("mousemove",e)})}(t,this),function(t,e){const{option:r,constructor:o}=t;t.on("resize",()=>{const{aspectRatio:e,notice:o}=t;"standard"===t.state&&r.autoSize&&t.autoSize(),t.aspectRatio=e,o.show=""});const n=$(t);let a=()=>{};const i=()=>{a(),a=Ht(n,()=>t.emit("resize"),o.RESIZE_TIME)};t.on("window:orientationchange",()=>i()),t.on("window:resize",()=>i()),screen&&screen.orientation&&screen.orientation.onchange&&e.proxy(screen.orientation,"change",()=>i())}(t,this),function(t,e){if(R&&!t.option.isLive){const{$video:r,$progress:o}=t.template;let n=null,a=!1,i=0,s=0,l=0;const c=e=>{if(1===e.touches.length&&!t.isLock){n===o&&jt(t,e),a=!0;const{pageX:r,pageY:c}=e.touches[0];i=r,s=c,l=t.currentTime}},d=e=>{if(1===e.touches.length&&a&&t.duration){const{pageX:o,pageY:a}=e.touches[0],c=ee(i,s,o,a),d=[3,4].includes(c),p=[1,2].includes(c);if(d&&!t.isRotate||p&&t.isRotate){const c=pt((o-i)/t.width,-1,1),d=pt((a-s)/t.height,-1,1),p=t.isRotate?d:c,u=n===r?t.constructor.TOUCH_MOVE_RATIO:1,h=pt(l+t.duration*p*u,0,t.duration);t.seek=h,t.emit("setBar","played",pt(h/t.duration,0,1),e),t.notice.show=`${ht(h)} / ${ht(t.duration)}`}}},p=()=>{a&&(i=0,s=0,l=0,a=!1,n=null)};t.option.gesture&&(e.proxy(r,"touchstart",t=>{n=r,c(t)}),e.proxy(r,"touchmove",d)),e.proxy(o,"touchstart",t=>{n=o,c(t)}),e.proxy(o,"touchmove",d),t.on("document:touchend",p)}}(t,this),function(t){const{option:e,constructor:r,template:{$container:o}}=t,n=Ct(()=>{t.emit("view",K(o,r.SCROLL_GAP))},r.SCROLL_TIME);t.on("window:scroll",()=>n()),t.on("view",r=>{e.autoMini&&(t.mini=!r)})}(t),function(t,e){const r=["click","mouseup","keydown","touchend","touchmove","mousemove","pointerup","contextmenu","pointermove","visibilitychange","webkitfullscreenchange"],o=["resize","scroll","orientationchange"],n=[];function a(a={}){for(let t=0;t{const o=a.document||i.ownerDocument||document,s=e.proxy(o,r,e=>{t.emit(`document:${r}`,e)});n.push(s)}),o.forEach(r=>{var o;const s=a.window||(null==(o=i.ownerDocument)?void 0:o.defaultView)||window,l=e.proxy(s,r,e=>{t.emit(`window:${r}`,e)});n.push(l)})}a(),e.bindGlobalEvents=a}(t,this),re(t)}proxy(t,e,r,o={}){if(Array.isArray(e))return e.map(e=>this.proxy(t,e,r,o));if(oe.get(this).closed)return()=>{};t.addEventListener(e,r,o);const n=()=>t.removeEventListener(e,r,o);return this.destroyEvents.add(n),n}hover(t,e,r){e&&this.proxy(t,"mouseenter",e),r&&this.proxy(t,"mouseleave",r)}remove(t){if(this.destroyEvents.has(t))try{t()}catch(e){console.warn("Failed to remove event listener:",e)}finally{this.destroyEvents.delete(t)}}destroy(){for(const e of this.destroyEvents)try{e()}catch(t){console.warn("Failed to destroy event listener:",t)}this.destroyEvents.clear()}}class ae{constructor(t){this.art=t,this.keys={},R||this.init()}init(){const{constructor:t}=this.art;this.art.option.hotkey&&(this.add("Escape",()=>{this.art.fullscreenWeb&&(this.art.fullscreenWeb=!1)}),this.add("Space",()=>{lt(this.art.toggle())}),this.add("ArrowLeft",()=>{this.art.backward=t.SEEK_STEP}),this.add("ArrowUp",()=>{this.art.volume+=t.VOLUME_STEP}),this.add("ArrowRight",()=>{this.art.forward=t.SEEK_STEP}),this.add("ArrowDown",()=>{this.art.volume-=t.VOLUME_STEP})),this.art.on("document:keydown",t=>{if(this.art.isFocus){const e=document.activeElement.tagName.toUpperCase(),r=document.activeElement.getAttribute("contenteditable");if("INPUT"!==e&&"TEXTAREA"!==e&&""!==r&&"true"!==r&&!t.altKey&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey){const e=this.keys[t.code];if(e){t.preventDefault();for(let r=0;r\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n',state:'\r\n\r\n\r\n',play:'\r\n \r\n',pause:'\r\n \r\n',check:'\r\n\r\n',volume:'\r\n \r\n \r\n',volumeClose:'\r\n \r\n \r\n',screenshot:'\r\n\t\r\n\r\n',setting:'\r\n \r\n \r\n',pip:'\r\n\r\n',arrowLeft:'\r\n \r\n',arrowRight:'\r\n \r\n',playbackRate:'',aspectRatio:'',config:'',lock:'\r\n\r\n\r\n\r\n\r\n',flip:'\r\n\r\n\r\n\r\n\r\n\r\n',unlock:'\r\n\r\n\r\n',fullscreenOff:'\r\n\r\n\r\n\r\n\r\n',fullscreenOn:'\r\n\r\n\r\n\r\n\r\n',fullscreenWebOff:'\r\n\r\n\r\n\r\n\r\n',fullscreenWebOn:'\r\n\r\n\r\n\r\n\r\n',switchOn:'\r\n\r\n\r\n \r\n',switchOff:'\r\n\r\n\r\n \r\n\r\n',error:'\r\n\r\n\r\n\r\n\r\n',close:'\r\n\r\n\r\n\r\n\r\n',airplay:'\r\n \r\n \r\n \r\n \r\n\r\n'};class ce{constructor(t){const e=l(l({},le),t.option.icons);for(const r in e)yt(this,r,{get:()=>tt(r,e[r])})}}class de extends Nt{constructor(t){super(t),this.name="info",R||this.init()}init(){const{proxy:t,constructor:e,template:{$infoPanel:r,$infoClose:o,$video:n}}=this.art;t(o,"click",()=>{this.show=!1});let a=()=>{};const i=D("[data-video]",r)||[];this.art.on("destroy",()=>a());const s=$(this.art);!function t(){for(let e=0;e{j(n,"display","none"),j(a,"display",null)}),o.proxy(e.$state,"click",()=>lt(t.play()))}}class fe{constructor(t){this.art=t,this.timer=null,$(t).add(()=>this.destroy()),t.on("destroy",()=>this.destroy())}destroy(){this.timer&&(clearTimeout(this.timer),this.timer=null)}set show(t){if($(this.art).closed)return;const{constructor:e,template:{$player:r,$noticeInner:o}}=this.art;t?(o.textContent=t instanceof Error?t.message.trim():t,N(r,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout(()=>{o.textContent="",F(r,"art-notice-show")},e.NOTICE_TIME)):F(r,"art-notice-show")}get show(){const{template:{$player:t}}=this.art;return t.classList.contains("art-notice-show")}}function me(t,e,r,o=!1){const n=e=>{E(t)||r(e)};t[o?"once":"on"](e,n),$(t).add(()=>{t.off(e,n)})}function ge(t,e,r){for(const[o,n]of e){if(E(t)||r&&!r())return;t[o].show=n}}const ve=new WeakMap,ye=new WeakMap,be=new WeakMap;function we(t){return be.get(t)||$(t)}function xe(t){const e=ve.get(t),r=be.get(t);return()=>ve.get(t)===e&&(!e||e.active())&&be.get(t)===r&&(!r||!r.closed)}function ke(t){const e=be.get(t),r=$(t).child(),o=r.child();be.set(t,r),r.add(()=>{be.get(t)===r&&be.delete(t)});const n={scope:o,assigned:!1,acceptingEvents:!1,active:()=>!E(t)&&!o.closed&&ve.get(t)===n};return ve.set(t,n),o.add(()=>{ve.get(t)===n&&ve.delete(t),n.onAssigned=void 0,n.onError=void 0}),null==e||e.dispose(),n}function $e(t){t.assigned=!0;const e=t.onAssigned;t.onAssigned=void 0,t.active()&&(null==e||e())}function Ee(t,e,r){ye.set(t,e),e.acceptingEvents=!0;try{t.url=r}finally{ye.get(t)===e&&(ye.delete(t),$e(e))}}function Te(t,e){t.active()&&(t.onError?t.onError(e):console.warn("Failed to initialize ArtPlayer source:",e),t.scope.dispose())}function Ce(t){const{option:e,constructor:r,i18n:o,notice:n,template:{$player:a}}=t;let i,s=we(t),l=0;return{reset(){l=0,null==i||i.dispose(),F(a,"art-error")},loadStart(){F(a,"art-error")},schedule(c){(c=>d(null,null,function*(){if(E(t))return;const d=we(t);if(d!==s&&(s=d,l=0),i&&!i.closed)return;const p=d.child();i=p,p.add(()=>{i===p&&(i=void 0)});const u=()=>!E(t)&&!p.closed&&d===we(t),h=l{console.warn("ArtPlayer reconnect failed:",t)})}}}function ze(t){!function(t){const{proxy:e,template:{$video:r}}=t;for(let o=0;o{E(t)||t.emit(`video:${e.type}`,e)})}(t);const e=Ce(t);!function(t,e){me(t,"video:canplay",()=>{e.reset(),ge(t,[["loading",!1]])}),me(t,"video:canplay",()=>{ge(t,[["loading",!1],["controls",!0],["mask",!0]]),E(t)||(t.isReady=!0,t.emit("ready"))},!0)}(t,e),function(t){const{option:e}=t;me(t,"video:ended",()=>{if(e.loop){const e=xe(t);if(t.seek=0,E(t)||!e())return;lt(t.play()),e()&&ge(t,[["controls",!1],["mask",!1]],e)}else ge(t,[["controls",!0],["mask",!0]])})}(t),me(t,"video:error",e.schedule),function(t,e){const{template:{$poster:r}}=t;me(t,"video:loadedmetadata",()=>{t.emit("resize"),R&&ge(t,[["loading",!1],["controls",!0],["mask",!0]])}),me(t,"video:loadstart",()=>{e.loadStart(),ge(t,[["loading",!0],["mask",!1],["controls",!0]])}),me(t,"video:pause",()=>{ge(t,[["controls",!0],["mask",!0]])}),me(t,"video:play",()=>{ge(t,[["mask",!1]]),E(t)||j(r,"display","none")}),me(t,"video:playing",()=>ge(t,[["mask",!1]])),me(t,"video:progress",()=>{t.playing&&ge(t,[["loading",!1]])}),me(t,"video:seeked",()=>ge(t,[["loading",!1],["mask",!0]])),me(t,"video:seeking",()=>ge(t,[["loading",!0],["mask",!1]])),me(t,"video:timeupdate",()=>ge(t,[["mask",!1]])),me(t,"video:waiting",()=>ge(t,[["loading",!0],["mask",!1]]))}(t,e)}const Se=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Le=(()=>{if("undefined"===typeof document)return!1;const t=Se[0],e={};for(const r of Se){if(r[1]in document){for(const[o,n]of r.entries())e[t[o]]=n;return e}}return!1})(),Me={change:Le.fullscreenchange,error:Le.fullscreenerror},Ae={request:(t=document.documentElement,e)=>new Promise((r,o)=>{const n=()=>{Ae.off("change",n),r()};Ae.on("change",n);const a=t[Le.requestFullscreen](e);a instanceof Promise&&a.then(n).catch(o)}),exit:()=>new Promise((t,e)=>{if(!Ae.isFullscreen)return void t();const r=()=>{Ae.off("change",r),t()};Ae.on("change",r);const o=document[Le.exitFullscreen]();o instanceof Promise&&o.then(r).catch(e)}),toggle:(t,e)=>Ae.isFullscreen?Ae.exit():Ae.request(t,e),onchange(t){Ae.on("change",t)},onerror(t){Ae.on("error",t)},on(t,e){const r=Me[t];r&&document.addEventListener(r,e,!1)},off(t,e){const r=Me[t];r&&document.removeEventListener(r,e,!1)},raw:Le};function Pe(t){const{i18n:e,notice:r,template:{$video:o,$player:n}}=t,a=t=>{Ae.on("change",()=>{t.emit("fullscreen",Ae.isFullscreen),Ae.isFullscreen?(t.state="fullscreen",N(n,"art-fullscreen")):F(n,"art-fullscreen"),t.emit("resize")}),Ae.on("error",e=>{t.emit("fullscreenError",e)}),yt(t,"fullscreen",{get:()=>Ae.isFullscreen,set(t){return d(this,null,function*(){t?yield Ae.request(n):yield Ae.exit()})}})};t.once("video:loadedmetadata",()=>{var n;Ae.isEnabled?a(t):o.webkitSupportsFullscreen?((n=t).on("document:webkitfullscreenchange",()=>{n.emit("fullscreen",n.fullscreen),n.emit("resize")}),yt(n,"fullscreen",{get:()=>document.fullscreenElement===o,set(t){t?(n.state="fullscreen",o.webkitEnterFullscreen()):o.webkitExitFullscreen()}})):yt(t,"fullscreen",{get:()=>!1,set(){r.show=e.get("Fullscreen Not Supported")}}),yt(t,"fullscreen",xt(t,"fullscreen"))})}function Oe(t){const{icons:e,proxy:r,storage:o,template:{$player:n,$video:a}}=t;let i=!1,s=0,l=0;function c(){const{$mini:e}=t.template;e&&(F(n,"art-mini"),j(e,"display","none"),n.prepend(a),t.emit("mini",!1))}function d(e,r){t.playing?(j(e,"display","none"),j(r,"display","flex")):(j(e,"display","flex"),j(r,"display","none"))}function p(){const{$mini:e}=t.template,r=rt(e),n=window.innerHeight-r.height-50,a=window.innerWidth-r.width-50;o.set("top",n),o.set("left",a),j(e,"top",`${n}px`),j(e,"left",`${a}px`)}yt(t,"mini",{get:()=>H(n,"art-mini"),set(u){if(u){t.state="mini",N(n,"art-mini");const u=function(){const{$mini:n}=t.template;if(n)return B(n,a),j(n,"display","flex");{const n=Q("div");N(n,"art-mini-popup"),B(document.body,n),t.template.$mini=n,B(n,a);const p=B(n,'
');B(p,e.close),r(p,"click",c);const u=B(n,'
'),h=B(u,e.play),f=B(u,e.pause);return r(h,"click",()=>lt(t.play())),r(f,"click",()=>t.pause()),d(h,f),t.on("video:playing",()=>d(h,f)),t.on("video:pause",()=>d(h,f)),t.on("video:timeupdate",()=>d(h,f)),r(n,"mousedown",t=>{i=0===t.button,s=t.pageX,l=t.pageY}),t.on("document:mousemove",t=>{if(i){N(n,"art-mini-dragging");const e=t.pageX-s,r=t.pageY-l;j(n,"transform",`translate(${e}px, ${r}px)`)}}),t.on("document:mouseup",()=>{if(i){i=!1,F(n,"art-mini-dragging");const t=rt(n);o.set("left",t.left),o.set("top",t.top),j(n,"left",`${t.left}px`),j(n,"top",`${t.top}px`),j(n,"transform",null)}}),n}}(),h=o.get("top"),f=o.get("left");"number"===typeof h&&"number"===typeof f?(j(u,"top",`${h}px`),j(u,"left",`${f}px`),K(u)||p()):p(),t.emit("mini",!0)}else c()}})}function Ie(t){const{i18n:e,notice:r,template:{$video:o}}=t;document.pictureInPictureEnabled?function(t){const{template:{$video:e},proxy:r,notice:o}=t;e.disablePictureInPicture=!1,yt(t,"pip",{get:()=>document.pictureInPictureElement,set(r){r?(t.state="pip",e.requestPictureInPicture().catch(t=>{throw o.show=t,t})):document.exitPictureInPicture().catch(t=>{throw o.show=t,t})}}),r(e,"enterpictureinpicture",()=>{t.emit("pip",!0)}),r(e,"leavepictureinpicture",()=>{t.emit("pip",!1)})}(t):o.webkitSupportsPresentationMode?function(t){const{$video:e}=t.template;e.webkitSetPresentationMode("inline"),yt(t,"pip",{get:()=>"picture-in-picture"===e.webkitPresentationMode,set(r){r?(t.state="pip",e.webkitSetPresentationMode("picture-in-picture"),t.emit("pip",!0)):(e.webkitSetPresentationMode("inline"),t.emit("pip",!1))}})}(t):yt(t,"pip",{get:()=>!1,set(){r.show=e.get("PIP Not Supported")}})}function Re(t){yt(t,"quality",{set(e){const{controls:r,notice:o,i18n:n}=t,a=e.find(t=>t.default)||e[0];r.update({name:"quality",position:"right",index:10,style:{marginRight:"10px"},html:(null==a?void 0:a.html)||"",selector:e,onSelect(e,r,a){return d(this,null,function*(){const r=function(t){return t&&Gt.get(t)||(()=>!0)}(a);if(yield t.switchQuality(e.url),!E(t)&&r()){const a=`${n.get("Switch Video")}: ${e.html}`;!E(t)&&r()&&(o.show=a)}return e.html})}})}})}function _e(t,e,r,o,n=!0){let a,i=!1;const s=e=>{t.closed||i||(n&&(i=!0,a()),o(e))};return e[n?"once":"on"](r,s),a=t.add(()=>{e.off(r,s)}),s}function Ve(t,e,r){return new Promise((o,n)=>{if(E(t)||e===t.url)return void o();const a=ke(t),i=a.scope.child();let s=!1;const l=(t=!1,e)=>{s||(s=!0,a.onError=void 0,a.onAssigned=void 0,i.dispose(),t?n(e):o(),t&&a.scope.dispose())};i.add(()=>{l()});const c=()=>!s&&a.active(),p=t=>l(!0,t);a.onError=p;try{const{playing:o,aspectRatio:n,playbackRate:s}=t;if(t.pause(),!c())return;const u=i.child(),h={"video:error":p,"video:loadedmetadata":()=>{if(c())try{t.currentTime=r}catch(e){p(e)}},"video:canplay":()=>{if(!c())return;u.dispose();d(null,null,function*(){if(t.playbackRate=s,c()&&(t.aspectRatio=n,c())){if(o)try{yield t.play()}catch(e){}c()&&(t.notice.show="",l())}}).catch(p)}},f=i.child(),m=[],g=Object.keys(h);for(const e of g)_e(f,t,e,t=>{a.acceptingEvents&&m.push([e,t])},!1);if(Ee(t,a,e),!c())return;if(t.notice.show="",!c())return;const v=()=>{if(f.dispose(),!e)return void l();const r={};for(const e of g)r[e]=_e(u,t,e,h[e]);for(const[t,e]of m){if(!c()||u.closed)break;r[t](e)}m.length=0};a.assigned?v():a.onAssigned=v}catch(u){p(u)}})}function Ye(t){const{option:e,template:{$progress:r,$video:o}}=t;let n=null,a=!1,i=null;t.on("setBar",(n,s,l)=>d(null,null,function*(){var c;const d=null==(c=t.controls)?void 0:c.thumbnails,{url:p,scale:u}=e.thumbnails;if(!d||!p)return;if("hover"===n||"played"===n&&l&&R){if(i||a||(a=!0,i=yield ot(p,u),a=!1),!i)return;const n=r.clientWidth*s;n>0&&nr.clientWidth-h/2?j(s,"left",r.clientWidth-h+"px"):j(s,"left",n-h/2+"px")}(n)}})),yt(t,"thumbnails",{get:()=>t.option.thumbnails,set(e){e.url&&!t.option.isLive&&(t.option.thumbnails=e,clearTimeout(n),n=null,a=!1,i=null)}})}function De(t){const{option:e,template:{$video:r}}=t;yt(t,"url",{get:()=>r.src,set(o){return d(this,null,function*(){if(E(t))return;const n=function(t){const e=ye.get(t);return ye.delete(t),e||ke(t)}(t);n.acceptingEvents=!1;try{if(!o)return void((yield Bt(n.scope))&&n.active()&&(t.loading.show=!0));const a=t.url,i=e.type||ct(o),s=e.customType[i];if(i&&s){if(!(yield Bt(n.scope))||!n.active())return;t.loading.show=!0}if(!n.active())return;const l=n.scope.child();let c=!1,d=!1;_e(l,t,"video:canplay",()=>{c=!d}),_e(l,t,"video:error",()=>{d=!0});try{if(n.acceptingEvents=!0,i&&s){const e=s.call(t,r,o,t);Promise.resolve(e).catch(t=>Te(n,t))}else{if(a&&URL.revokeObjectURL(a),!n.active())return;r.src=o}}finally{l.dispose()}if(!n.active())return;if(a!==t.url&&(t.option.url=o,n.active()&&t.isReady&&a)){const e=()=>{n.active()&&t.emit("restart",o)};c?e():d||_e(n.scope,t,"video:canplay",e)}}catch(a){Te(n,a)}finally{$e(n)}})}})}Object.defineProperties(Ae,{isFullscreen:{get:()=>Boolean(document[Le.fullscreenElement])},element:{enumerable:!0,get:()=>document[Le.fullscreenElement]},isEnabled:{enumerable:!0,get:()=>Boolean(document[Le.fullscreenEnabled])}});class Ne{constructor(t){De(t),function(t){const{template:{$video:e}}=t;yt(t,"attr",{value(t,r){if(void 0===r)return e[t];e[t]=r}})}(t),function(t){const{i18n:e,notice:r,option:o,constructor:{instances:n},template:{$video:a}}=t;yt(t,"play",{value(){return d(this,null,function*(){const i=xe(t),s=yield a.play();if(!i())return s;const l=e.get("Play");if(!i())return s;if(r.show=l,!i())return s;if(t.emit("play"),o.mutex)for(let e=0;et.playing?t.pause():t.play()})}(t),function(t){const{notice:e}=t;yt(t,"seek",{set(r){t.currentTime=r,t.duration&&(e.show=`${ht(t.currentTime)} / ${ht(t.duration)}`),t.emit("seek",t.currentTime,r)}});const r=t;yt(t,"forward",{set(e){r.seek=t.currentTime+e}}),yt(t,"backward",{set(e){r.seek=t.currentTime-e}})}(t),function(t){const{template:{$video:e},i18n:r,notice:o,storage:n}=t;yt(t,"volume",{get:()=>e.volume||0,set:t=>{e.volume=pt(t,0,1),o.show=`${r.get("Volume")}: ${Number.parseInt(String(100*e.volume),10)}`,0!==e.volume&&n.set("volume",e.volume)}}),yt(t,"muted",{get:()=>e.muted,set:r=>{e.muted=r,t.emit("muted",r)}})}(t),function(t){const{$video:e}=t.template;yt(t,"currentTime",{get:()=>e.currentTime||0,set:r=>{const o=Number.parseFloat(r);Number.isNaN(o)||(e.currentTime=pt(o,0,t.duration))}})}(t),function(t){yt(t,"duration",{get:()=>{const{duration:e}=t.template.$video;return e===1/0?0:e||0}})}(t),function(t){const e=e=>Ve(t,e,0);yt(t,"switchQuality",{value:e=>Ve(t,e,t.currentTime)}),yt(t,"switchUrl",{value:e}),yt(t,"switch",{set:e})}(t),function(t){const{template:{$video:e},i18n:r,notice:o}=t,n=t;yt(t,"playbackRate",{get:()=>e.playbackRate,set(t){if(t){if(t===e.playbackRate)return;e.playbackRate=t,o.show=`${r.get("Rate")}: ${1===t?r.get("Normal"):`${t}x`}`}else n.playbackRate=1}})}(t),function(t){const{i18n:e,notice:r,template:{$video:o,$player:n}}=t;yt(t,"aspectRatio",{get:()=>n.dataset.aspectRatio||"default",set(a){if(a||(a="default"),"default"===a)j(o,"width",null),j(o,"height",null),j(o,"margin",null),delete n.dataset.aspectRatio;else{const t=a.split(":").map(Number),{clientWidth:e,clientHeight:r}=n,i=e/r,s=t[0]/t[1];i>s?(j(o,"width",s*r+"px"),j(o,"height","100%"),j(o,"margin","0 auto")):(j(o,"width","100%"),j(o,"height",e/s+"px"),j(o,"margin","auto 0")),n.dataset.aspectRatio=a}r.show=`${e.get("Aspect Ratio")}: ${"default"===a?e.get("Default"):a}`,t.emit("aspectRatio",a)}})}(t),function(t){const{notice:e,template:{$video:r}}=t,o=Q("canvas");yt(t,"getDataURL",{value:()=>new Promise((t,n)=>{try{o.width=r.videoWidth,o.height=r.videoHeight,o.getContext("2d").drawImage(r,0,0),t(o.toDataURL("image/png"))}catch(a){e.show=a,n(a)}})}),yt(t,"getBlobUrl",{value:()=>new Promise((t,n)=>{try{o.width=r.videoWidth,o.height=r.videoHeight,o.getContext("2d").drawImage(r,0,0),o.toBlob(e=>{t(URL.createObjectURL(e))})}catch(a){e.show=a,n(a)}})}),yt(t,"screenshot",{value:e=>d(null,null,function*(){const o=yield t.getDataURL();return dt(o,`${e||`artplayer_${ht(r.currentTime)}`}.png`),t.emit("screenshot",o),o})})}(t),Pe(t),function(t){const{constructor:e,template:{$container:r,$player:o}}=t;let n="";yt(t,"fullscreenWeb",{get:()=>H(o,"art-fullscreen-web"),set(a){a?(n=o.style.cssText,e.FULLSCREEN_WEB_IN_BODY&&B(document.body,o),t.state="fullscreenWeb",j(o,"width","100%"),j(o,"height","100%"),N(o,"art-fullscreen-web"),t.emit("fullscreenWeb",!0)):(e.FULLSCREEN_WEB_IN_BODY&&B(r,o),n&&(o.style.cssText=n,n=""),F(o,"art-fullscreen-web"),t.emit("fullscreenWeb",!1)),t.emit("resize")}})}(t),Ie(t),function(t){const{$video:e}=t.template,r=t;yt(t,"loaded",{get:()=>r.loadedTime/e.duration}),yt(t,"loadedTime",{get:()=>e.buffered.length?e.buffered.end(e.buffered.length-1):0})}(t),function(t){yt(t,"played",{get:()=>t.currentTime/t.duration})}(t),function(t){const{$video:e}=t.template;yt(t,"playing",{get:()=>"boolean"===typeof e.playing?e.playing:!!(e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2)})}(t),function(t){const{$container:e,$player:r,$video:o}=t.template;yt(t,"autoSize",{value(){const{videoWidth:n,videoHeight:a}=o,{width:i,height:s}=rt(e),l=n/a;if(i/s>l)j(r,"width",s*l/i*100+"%"),j(r,"height","100%");else{const t=i/l/s*100;j(r,"width","100%"),j(r,"height",`${t}%`)}t.emit("autoSize",{width:t.width,height:t.height})}})}(t),function(t){const e=t;yt(t,"rect",{get:()=>rt(t.template.$player)});const r=["bottom","height","left","right","top","width"];for(let o=0;oe.rect[n]})}yt(t,"x",{get:()=>e.left+window.pageXOffset}),yt(t,"y",{get:()=>e.top+window.pageYOffset})}(t),function(t){const{template:{$player:e},i18n:r,notice:o}=t;yt(t,"flip",{get:()=>e.dataset.flip||"normal",set(n){n||(n="normal"),"normal"===n?delete e.dataset.flip:e.dataset.flip=n,o.show=`${r.get("Video Flip")}: ${r.get(ut(n))}`,t.emit("flip",n)}})}(t),Oe(t),function(t){const{template:{$poster:e}}=t;yt(t,"poster",{get:()=>{try{return e.style.backgroundImage.match(/"(.*)"/)[1]}catch(t){return""}},set(t){j(e,"backgroundImage",`url(${t})`)}})}(t),function(t){const{template:{$container:e,$video:r}}=t;yt(t,"autoHeight",{value(){const{clientWidth:o}=e,{videoHeight:n,videoWidth:a}=r,i=n*(o/a);j(e,"height",`${i}px`),t.emit("autoHeight",i)}})}(t),function(t){const{$player:e}=t.template;yt(t,"cssVar",{value:(t,r)=>r?e.style.setProperty(t,r):getComputedStyle(e).getPropertyValue(t)})}(t),function(t){yt(t,"theme",{get:()=>t.cssVar("--art-theme"),set(e){t.cssVar("--art-theme",e)}})}(t),function(t){yt(t,"type",{get:()=>t.option.type,set(e){t.option.type=e}})}(t),function(t){const e=["mini","pip","fullscreen","fullscreenWeb"];yt(t,"state",{get:()=>e.find(e=>t[e])||"standard",set(r){for(let o=0;o{switch(t.availability){case"available":a=!0;break;case"not-available":a=!1}}):a=!1,yt(t,"airplay",{value(){a?(n.webkitShowPlaybackTargetPicker(),t.emit("airplay")):r.show=e.get("AirPlay Not Available")}})}(t),Re(t),Ye(t),ze(t),function(t){const{option:e,storage:r,template:{$video:o,$poster:n}}=t;for(const i in e.moreVideoAttr)t.attr(i,e.moreVideoAttr[i]);e.muted&&(t.muted=e.muted),e.volume&&(o.volume=pt(e.volume,0,1));const a=r.get("volume");"number"===typeof a&&(o.volume=pt(a,0,1)),e.poster&&j(n,"backgroundImage",`url(${e.poster})`),e.autoplay&&(o.autoplay=e.autoplay),e.playsInline&&(o.playsInline=!0,o["webkit-playsinline"]=!0),e.theme&&(e.cssVar["--art-theme"]=e.theme);for(const i in e.cssVar)t.cssVar(i,e.cssVar[i]);t.url=e.url}(t)}}function Fe(t){const{notice:e,constructor:r,template:{$player:o,$video:n}}=t,a="art-auto-orientation",i="art-auto-orientation-fullscreen";let s=!1;function l(){const{videoWidth:t,videoHeight:e}=n,r=document.documentElement.clientWidth,o=document.documentElement.clientHeight;return t>e&&ro}return t.on("fullscreenWeb",e=>{var n;if(e){if(l()){const e=Number(null!=(n=r.AUTO_ORIENTATION_TIME)?n:0);setTimeout(()=>{t.fullscreenWeb&&!H(o,a)&&function(){const e=at(),r=document.documentElement.clientWidth,n=document.documentElement.clientHeight-e.top-e.bottom,i=r-e.left-e.right;j(o,"width",`${n}px`),j(o,"height",`${i}px`),j(o,"transform-origin","0 0"),j(o,"transform",`rotate(90deg) translate(${e.top}px, -${r-e.right}px)`),N(o,a),t.isRotate=!0,t.emit("resize")}()},e)}}else H(o,a)&&(j(o,"width",""),j(o,"height",""),j(o,"transform-origin",""),j(o,"transform",""),F(o,a),t.isRotate=!1,t.emit("resize"))}),t.on("fullscreen",t=>d(null,null,function*(){var r;const n=!!(null==(r=null==screen?void 0:screen.orientation)?void 0:r.lock);if(t){if(n&&l())try{const t=screen.orientation.type.startsWith("portrait")?"landscape":"portrait";yield screen.orientation.lock(t),s=!0,N(o,i)}catch(a){s=!1,e.show=a}}else if(H(o,i)&&F(o,i),n&&s){try{screen.orientation.unlock()}catch(c){}s=!1}})),{name:"autoOrientation",get state(){return H(o,a)}}}function He(t){const{i18n:e,icons:r,storage:o,constructor:n,proxy:a,template:{$poster:i}}=t,s=t.layers.add({name:"auto-playback",html:'\n
\n
\n
\n '}),l=Y(".art-auto-playback-last",s),c=Y(".art-auto-playback-jump",s),d=Y(".art-auto-playback-close",s);B(d,r.close);let p=null;function u(){const r=(o.get("times")||{})[t.option.id||t.option.url];clearTimeout(p),j(s,"display","none"),r&&r>=n.AUTO_PLAYBACK_MIN&&(j(s,"display","flex"),l.textContent=`${e.get("Last Seen")} ${ht(r)}`,c.textContent=e.get("Jump Play"),a(d,"click",()=>{j(s,"display","none")}),a(c,"click",()=>{t.seek=r,lt(t.play()),j(i,"display","none"),j(s,"display","none")}),t.once("video:timeupdate",()=>{p=setTimeout(()=>{j(s,"display","none")},n.AUTO_PLAYBACK_TIMEOUT)}))}return t.on("video:timeupdate",()=>{if(t.playing){const e=o.get("times")||{},r=Object.keys(e);r.length>n.AUTO_PLAYBACK_MAX&&delete e[r[0]],e[t.option.id||t.option.url]=t.currentTime,o.set("times",e)}}),t.on("ready",u),t.on("restart",u),{name:"auto-playback",get times(){return o.get("times")||{}},clear:()=>o.del("times"),delete(t){const e=o.get("times")||{};return delete e[t],o.set("times",e),e}}}function Be(t){const{constructor:e,proxy:r,template:{$player:o,$video:n}}=t;let a=null,i=!1,s=1;const l=()=>{clearTimeout(a),i&&(i=!1,t.playbackRate=s,F(o,"art-fast-forward"))};return r(n,"touchstart",r=>{1===r.touches.length&&t.playing&&!t.isLock&&(a=setTimeout(()=>{i=!0,s=t.playbackRate,t.playbackRate=e.FAST_FORWARD_VALUE,N(o,"art-fast-forward")},e.FAST_FORWARD_TIME))}),t.on("document:touchmove",l),t.on("document:touchend",l),{name:"fastForward",get state(){return H(o,"art-fast-forward")}}}function We(t){const{layers:e,icons:r,template:{$player:o}}=t;function n(){return H(o,"art-lock")}function a(){N(o,"art-lock"),t.isLock=!0,t.emit("lock",!0)}function i(){F(o,"art-lock"),t.isLock=!1,t.emit("lock",!1)}return e.add({name:"lock",mounted(e){const o=B(e,r.lock),n=B(e,r.unlock);j(o,"display","none"),t.on("lock",t=>{t?(j(o,"display","inline-flex"),j(n,"display","none")):(j(o,"display","none"),j(n,"display","inline-flex"))})},click(){n()?i():a()}}),{name:"lock",get state(){return n()},set state(t){t?a():i()}}}function je(t){return t.on("control",e=>{e?F(t.template.$player,"art-mini-progress-bar"):N(t.template.$player,"art-mini-progress-bar")}),{name:"mini-progress-bar"}}class qe{constructor(t){this.art=t,this.id=0;const{option:e}=t;!function(t,e){E(t.art)||!e.miniProgressBar||e.isLive||t.add(je),!E(t.art)&&e.lock&&R&&t.add(We),E(t.art)||!e.autoPlayback||e.isLive||t.add(He),!E(t.art)&&e.autoOrientation&&R&&t.add(Fe),!E(t.art)&&e.fastForward&&R&&!e.isLive&&t.add(Be)}(this,e);for(let r=0;rconsole.warn("Failed to initialize ArtPlayer plugin:",t))}}add(t){st(!E(this.art),"Cannot add a plugin after ArtPlayer is destroyed"),this.id+=1;const e=t.call(this.art,this.art);return e instanceof Promise?e.then(e=>this.next(t,e)):this.next(t,e)}next(t,e){return function(t,e,r){if(E(t.art))return t;const o=r&&r.name||e.name||`plugin${t.id}`;if(E(t.art))return t;let n=o;const a=wt(t,n);if(E(t.art))return t;const i=`Cannot add a plugin that already has the same name: ${o}`;return E(t.art)||(st(!a,i),("object"===typeof o&&null!==o||"function"===typeof o)&&(n=Reflect.ownKeys({[n]:void 0})[0]),E(t.art)||yt(t,n,{value:r})),t}(this,t,e)}}class Ue extends Nt{constructor(t){super(t);const{option:e,controls:r,template:{$setting:o}}=t;this.name="setting",this.$parent=o,this.id=0,this.active=null,this.cache=new Map,this.option=[...this.builtin,...e.settings],e.setting&&(this.format(),this.render(),t.on("blur",()=>{this.show&&(this.show=!1,this.render())}),t.on("focus",t=>{const e=Z(t,r.setting),o=Z(t,this.$parent);!this.show||e||o||(this.show=!1,this.render())}),t.on("resize",()=>this.resize()))}get builtin(){const t=[],{option:e}=this.art;return e.playbackRate&&t.push(function(t){const{i18n:e,icons:r,constructor:{SETTING_ITEM_WIDTH:o,PLAYBACK_RATE:n}}=t;function a(t){return 1===t?e.get("Normal"):t.toFixed(1)}function i(){const e=t.setting.find(`playback-rate-${t.playbackRate}`);t.setting.check(e)}return{width:o,name:"playback-rate",html:e.get("Play Speed"),tooltip:a(t.playbackRate),icon:r.playbackRate,selector:n.map(e=>({value:e,name:`playback-rate-${e}`,default:e===t.playbackRate,html:a(e)})),onSelect:e=>(t.playbackRate=e.value,e.html),mounted:()=>{i(),t.on("video:ratechange",()=>i())}}}(this.art)),e.aspectRatio&&t.push(function(t){const{i18n:e,icons:r,constructor:{SETTING_ITEM_WIDTH:o,ASPECT_RATIO:n}}=t;function a(t){return"default"===t?e.get("Default"):t}function i(){const e=t.setting.find(`aspect-ratio-${t.aspectRatio}`);t.setting.check(e)}return{width:o,name:"aspect-ratio",html:e.get("Aspect Ratio"),icon:r.aspectRatio,tooltip:a(t.aspectRatio),selector:n.map(e=>({value:e,name:`aspect-ratio-${e}`,default:e===t.aspectRatio,html:a(e)})),onSelect:e=>(t.aspectRatio=e.value,e.html),mounted:()=>{i(),t.on("aspectRatio",()=>i())}}}(this.art)),e.flip&&t.push(function(t){const{i18n:e,icons:r,constructor:{SETTING_ITEM_WIDTH:o,FLIP:n}}=t;function a(t){return e.get(ut(t))}function i(){const e=t.setting.find(`flip-${t.flip}`);t.setting.check(e)}return{width:o,name:"flip",html:e.get("Video Flip"),tooltip:a(t.flip),icon:r.flip,selector:n.map(e=>({value:e,name:`flip-${e}`,default:e===t.flip,html:a(e)})),onSelect:e=>(t.flip=e.value,e.html),mounted:()=>{i(),t.on("flip",()=>i())}}}(this.art)),e.subtitleOffset&&t.push(function(t){const{i18n:e,icons:r,constructor:o}=t;return{width:o.SETTING_ITEM_WIDTH,name:"subtitle-offset",html:e.get("Subtitle Offset"),icon:r.subtitle,tooltip:"0s",range:[0,-10,10,.1],onChange:e=>(t.subtitleOffset=e.range[0],`${e.range[0]}s`),mounted:(e,r)=>{t.on("subtitleOffset",t=>{r.$range.value=t,r.tooltip=`${t}s`})}}}(this.art)),t}traverse(t,e=this.option){var r;for(let o=0;o{e.default=e===t,e.default&&e.$item&&X(e.$item,"art-current")},t.$option),this.render(t.$parents))}format(t=this.option,e,r,o=[]){for(let n=0;ne}),yt(a,"$parents",{get:()=>r}),yt(a,"$option",{get:()=>t});const o=[];yt(a,"$events",{get:()=>o}),yt(a,"$formatted",{get:()=>!0})}this.format(a.selector||[],a,t,o)}this.option=t}find(t=""){let e=null;return this.traverse(r=>{r.name===t&&(e=r)}),e}resize(){var t,e;const{controls:r,constructor:{SETTING_WIDTH:o,SETTING_ITEM_HEIGHT:n},template:{$player:a,$setting:i}}=this.art;if(r.setting&&this.show){const s=(null==(e=null==(t=this.active[0])?void 0:t.$parent)?void 0:e.width)||o,{left:l,width:c}=rt(r.setting),{left:d,width:p}=rt(a),u=l-d+c/2-s/2;if(j(i,"height",`${this.active===this.option?this.active.length*n:(this.active.length+1)*n}px`),j(i,"width",`${s}px`),this.art.isRotate||R)return;u+s>p?(j(i,"left",null),j(i,"right",null)):(j(i,"left",`${u}px`),j(i,"right","auto"))}}inactivate(t){for(let e=0;e'),s=Q("div");N(s,"art-setting-item-left-icon"),B(s,o),B(i,s),B(i,t.$parent.html);const l=r(a,"click",()=>this.render(t.$parents));t.$parent.$events.push(l),B(e,a)}createItem(t,e=!1){var r,o;if(!this.cache.has(t.$option))return;const n=this.cache.get(t.$option),a=t.$item;let i="selector";wt(t,"switch")&&(i="switch"),wt(t,"range")&&(i="range"),wt(t,"onClick")&&(i="button");const{icons:s,proxy:l,constructor:c}=this.art,p=Q("div");N(p,"art-setting-item"),j(p,"height",`${c.SETTING_ITEM_HEIGHT}px`),p.dataset.name=t.name||"",p.dataset.value=t.value||"";const u=B(p,'
'),h=B(p,'
'),f=Q("div");switch(N(f,"art-setting-item-left-icon"),i){case"button":case"switch":case"range":B(f,t.icon||s.config);break;case"selector":(null==(r=t.selector)?void 0:r.length)?B(f,t.icon||s.config):B(f,s.check)}B(u,f),yt(t,"$icon",{configurable:!0,get:()=>f}),yt(t,"icon",{configurable:!0,get:()=>f.innerHTML,set(t){f.innerHTML="",B(f,t)}});const m=Q("div");N(m,"art-setting-item-left-text"),B(m,t.html||""),B(u,m),yt(t,"$html",{configurable:!0,get:()=>m}),yt(t,"html",{configurable:!0,get:()=>m.innerHTML,set(t){m.innerHTML="",B(m,t)}});const g=Q("div");switch(N(g,"art-setting-item-right-tooltip"),B(g,t.tooltip||""),B(h,g),yt(t,"$tooltip",{configurable:!0,get:()=>g}),yt(t,"tooltip",{configurable:!0,get:()=>g.innerHTML,set(t){g.innerHTML="",B(g,t)}}),i){case"switch":{const e=Q("div");N(e,"art-setting-item-right-icon");const r=B(e,s.switchOn),o=B(e,s.switchOff);j(t.switch?o:r,"display","none"),B(h,e),yt(t,"$switch",{configurable:!0,get:()=>e});let n=t.switch;yt(t,"switch",{configurable:!0,get:()=>n,set(t){n=t,t?(j(o,"display","none"),j(r,"display",null)):(j(o,"display",null),j(r,"display","none"))}});break}case"range":{const e=Q("div");N(e,"art-setting-item-right-icon");const r=B(e,'');r.value=t.range[0],r.min=t.range[1],r.max=t.range[2],r.step=t.range[3],N(r,"art-setting-range"),B(h,e),yt(t,"$range",{configurable:!0,get:()=>r});let o=[...t.range];yt(t,"range",{configurable:!0,get:()=>o,set(t){o=[...t],r.value=t[0],r.min=t[1],r.max=t[2],r.step=t[3]}})}break;case"selector":if(null==(o=t.selector)?void 0:o.length){const t=Q("div");N(t,"art-setting-item-right-icon"),B(t,s.arrowRight),B(h,t)}}switch(i){case"switch":if(t.onSwitch){const e=l(p,"click",e=>d(this,null,function*(){t.switch=yield t.onSwitch.call(this.art,t,p,e)}));t.$events.push(e)}break;case"range":if(t.$range){if(t.onRange){const e=l(t.$range,"change",e=>d(this,null,function*(){t.range[0]=t.$range.valueAsNumber,t.tooltip=yield t.onRange.call(this.art,t,p,e)}));t.$events.push(e)}if(t.onChange){const e=l(t.$range,"input",e=>d(this,null,function*(){t.range[0]=t.$range.valueAsNumber,t.tooltip=yield t.onChange.call(this.art,t,p,e)}));t.$events.push(e)}}break;case"selector":{const e=l(p,"click",e=>d(this,null,function*(){var r;(null==(r=t.selector)?void 0:r.length)?this.render(t.selector):(this.check(t),t.$parent.onSelect&&(t.$parent.tooltip=yield t.$parent.onSelect.call(this.art,t,p,e)))}));t.$events.push(e),t.default&&N(p,"art-current")}break;case"button":if(t.onClick){const e=l(p,"click",e=>d(this,null,function*(){t.tooltip=yield t.onClick.call(this.art,t,p,e)}));t.$events.push(e)}}yt(t,"$item",{configurable:!0,get:()=>p}),e?J(p,a):B(n,p),t.mounted&&Ht($(this.art),()=>t.mounted.call(this.art,t.$item,t),0)}render(t=this.option){var e;if(this.active=t,this.cache.has(t)){X(this.cache.get(t),"art-current")}else{const r=Q("div");this.cache.set(t,r),N(r,"art-setting-panel"),B(this.$parent,r),X(r,"art-current"),(null==(e=t[0])?void 0:e.$parent)&&this.createHeader(t[0]);for(let e=0;enull,this.init(t.option.subtitle);let e=!1;t.on("video:timeupdate",()=>{if(!this.url)return;const t=this.art.template.$video.webkitDisplayingFullscreen;"boolean"===typeof t&&t!==e&&(e=t,this.createTrack(t?"subtitles":"metadata",this.url))})}get url(){return this.art.template.$track.src}set url(t){this.switch(t)}get textTrack(){var t,e;return null==(e=null==(t=this.art.template.$video)?void 0:t.textTracks)?void 0:e[0]}get activeCues(){return this.textTrack?Array.from(this.textTrack.activeCues):[]}get cues(){return this.textTrack?Array.from(this.textTrack.cues):[]}style(t,e){const{$subtitle:r}=this.art.template;return"object"===typeof t?q(r,t):j(r,t,e)}update(){const{option:{subtitle:t},template:{$subtitle:e}}=this.art;e.innerHTML="",this.activeCues.length&&(this.art.emit("subtitleBeforeUpdate",this.activeCues),e.innerHTML=this.activeCues.map((e,r)=>e.text.split(/\r?\n/).filter(t=>t.trim()).map(e=>`
\n ${t.escape?vt(e):e}\n
`).join("")).join(""),this.art.emit("subtitleAfterUpdate",this.activeCues))}switch(t){return d(this,arguments,function*(t,e={}){const{i18n:r,notice:o,option:n}=this.art,a=c(l(l({},n.subtitle),e),{url:t}),i=yield this.init(a);return e.name&&(o.show=`${r.get("Switch Subtitle")}: ${e.name}`),i})}createTrack(t,e){const{template:r,proxy:o,option:n}=this.art,{$video:a,$track:i}=r,s=Q("track");s.default=!0,s.kind=t,s.src=e,s.label=n.subtitle.name||"Artplayer",s.track.mode="hidden",s.onload=()=>{this.art.emit("subtitleLoad",this.cues,this.option)},this.art.events.remove(this.destroyEvent),i.onload=null,W(i),B(a,s),r.$track=s,this.destroyEvent=o(this.textTrack,"cuechange",()=>this.update())}init(t){return d(this,null,function*(){const{notice:e,template:{$subtitle:r}}=this.art;return this.textTrack?(m(t,Yt.subtitle),t.url?(this.option=t,this.style(t.style),fetch(t.url).then(t=>t.arrayBuffer()).then(e=>{const r=new TextDecoder(t.encoding).decode(e);switch(t.type||ct(t.url)){case"srt":{const e=$t(r);return Et(t.onVttLoad(e))}case"ass":{const e=Tt(r);return Et(t.onVttLoad(e))}case"vtt":return Et(t.onVttLoad(r));default:return t.url}}).then(t=>(r.innerHTML="",this.url===t||(URL.revokeObjectURL(this.url),this.createTrack("metadata",t)),t)).catch(t=>{throw r.innerHTML="",e.show=t,t})):void 0):null})}}const Ze=`\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
Player version:
\n
${g}
\n
\n
\n
Video url:
\n
\n
\n
\n
Video volume:
\n
\n
\n
\n
Video time:
\n
\n
\n
\n
Video duration:
\n
\n
\n
\n
Video resolution:
\n
\n x \n
\n
\n
\n
[x]
\n
\n
\n
\n `;class Je{constructor(t){this.art=t;const{option:e,constructor:r}=t;e.container instanceof Element?this.$container=e.container:(this.$container=Y(e.container),st(this.$container,`No container element found by ${e.container}`)),st(et(),"The current browser does not support flex layout");const o=this.$container.tagName.toLowerCase();st("div"===o,`Unsupported container element type, only support 'div' but got '${o}'`),st(r.instances.every(t=>t.template.$container!==this.$container),"Cannot mount multiple instances on the same dom element"),this.query=this.query.bind(this),function(t,e,r){const o=x.get(e);if(o&&o!==t)throw new Error("Cannot mount multiple instances on the same dom element");const n=k(t);n.rollback=r,x.set(e,t),n.releaseContainer=()=>{x.get(e)===t&&x.delete(e)}}(t,this.$container,function(t){const e=[];return function t(r){const o=Array.from(r.childNodes);e.push({node:r,children:o,attributes:1===r.nodeType?Array.from(r.attributes,t=>[t.name,t.value]):void 0,value:r.nodeValue}),o.forEach(t)}(t),()=>{for(const{node:t,children:r,attributes:o,value:n}of e){for(;t.firstChild;)t.removeChild(t.firstChild);for(const e of r)t.appendChild(e);if(o){const e=t;for(const t of Array.from(e.attributes))e.removeAttribute(t.name);for(const[t,r]of o)e.setAttribute(t,r)}else t.nodeValue=n}}}(this.$container)),this.$container.dataset.artId=String(t.id),this.init()}static get html(){return Ze}query(t){return Y(t,this.$container)}init(){const{option:t}=this.art;var e;if(t.useSSR||(this.$container.innerHTML=Je.html),(e=this).$player=e.query(".art-video-player"),e.$video=e.query(".art-video"),e.$track=e.query("track"),e.$poster=e.query(".art-poster"),e.$subtitle=e.query(".art-subtitle"),e.$danmuku=e.query(".art-danmuku"),e.$bottom=e.query(".art-bottom"),e.$progress=e.query(".art-progress"),e.$controls=e.query(".art-controls"),e.$controlsLeft=e.query(".art-controls-left"),e.$controlsCenter=e.query(".art-controls-center"),e.$controlsRight=e.query(".art-controls-right"),e.$layer=e.query(".art-layers"),e.$loading=e.query(".art-loading"),e.$notice=e.query(".art-notice"),e.$noticeInner=e.query(".art-notice-inner"),e.$mask=e.query(".art-mask"),e.$state=e.query(".art-state"),e.$setting=e.query(".art-settings"),e.$info=e.query(".art-info"),e.$infoPanel=e.query(".art-info-panel"),e.$infoClose=e.query(".art-info-close"),e.$contextmenu=e.query(".art-contextmenus"),t.proxy){const e=t.proxy.call(this.art,this.art);!function(t){st(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement,"Function 'option.proxy' needs to return 'HTMLVideoElement' or 'HTMLCanvasElement'")}(e),J(e,this.$video),e.className="art-video",this.$video=e}t.backdrop&&N(this.$player,"art-backdrop"),R&&N(this.$player,"art-mobile")}destroy(t){t?this.$container.innerHTML="":N(this.$player,"art-destroy")}}const Qe=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);class tr{on(t,e,r){const o=this.e||(this.e={});let n=Qe(o,t)?o[t]:void 0;return n||(n=[],Object.defineProperty(o,t,{value:n,enumerable:!0,configurable:!0,writable:!0})),n.push({fn:e,ctx:r}),this}once(t,e,r){const o=this,n=e;let a=!1;function i(...e){a||(a=!0,o.off(t,i),n.apply(r,e))}return i._=e,this.on(t,i,r)}emit(t,...e){const r=this.e||(this.e={}),o=(Qe(r,t)&&r[t]||[]).slice();for(const n of o)n.fn.apply(n.ctx,e);return this}off(t,e){const r=this.e||(this.e={}),o=Qe(r,t)?r[t]:void 0,n=[];if(o&&e)for(let a=0,i=o.length;ae.call(this,this)),or.DEBUG){const t=t=>console.log(`[ART.${this.id}] -> ${t}`);t(`Version@${or.version}`);for(let e=0;et(`Event@${e.type}`))}(function(t){const e=k(t);return e.rollback=void 0,!e.scope.closed})(this)&&rr.push(this)}catch(o){try{T(this,rr,!0,or.REMOVE_SRC_WHEN_DESTROY,!0)}catch(n){console.warn("Failed to clean up ArtPlayer initialization:",n)}throw o}}static get instances(){return rr}static get version(){return g}static get config(){return v}static get utils(){return zt}static get scheme(){return Yt}static get Emitter(){return tr}static get validator(){return m}static get kindOf(){return m.kindOf}static get html(){return Je.html}static get option(){return{id:"",container:"#artplayer",url:"",poster:"",type:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,autoMini:!1,loop:!1,flip:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,backdrop:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,useSSR:!1,playsInline:!0,lock:!1,gesture:!0,fastForward:!1,autoPlayback:!1,autoOrientation:!1,airplay:!1,proxy:void 0,layers:[],contextmenu:[],controls:[],settings:[],quality:[],highlight:[],plugins:[],thumbnails:{url:"",number:60,column:10,width:0,height:0,scale:1},subtitle:{url:"",type:"",style:{},name:"",escape:!0,encoding:"utf-8",onVttLoad:t=>t},moreVideoAttr:{controls:!1,preload:P?"auto":"metadata"},i18n:{},icons:{},cssVar:{},customType:{},lang:null==navigator?void 0:navigator.language.toLowerCase()}}get proxy(){return this.events.proxy}get query(){return this.template.query}get video(){return this.template.$video}reset(){this.video.removeAttribute("src"),this.video.load()}destroy(t=!0){T(this,rr,t,or.REMOVE_SRC_WHEN_DESTROY)}}return or.STYLE=Ge,or.DEBUG=!1,or.CONTEXTMENU=!0,or.NOTICE_TIME=2e3,or.SETTING_WIDTH=250,or.SETTING_ITEM_WIDTH=200,or.SETTING_ITEM_HEIGHT=35,or.RESIZE_TIME=200,or.SCROLL_TIME=200,or.SCROLL_GAP=50,or.AUTO_PLAYBACK_MAX=10,or.AUTO_PLAYBACK_MIN=5,or.AUTO_PLAYBACK_TIMEOUT=3e3,or.RECONNECT_TIME_MAX=5,or.RECONNECT_SLEEP_TIME=1e3,or.CONTROL_HIDE_TIME=3e3,or.DBCLICK_TIME=300,or.DBCLICK_FULLSCREEN=!0,or.MOBILE_DBCLICK_PLAY=!0,or.MOBILE_CLICK_PLAY=!1,or.AUTO_ORIENTATION_TIME=200,or.INFO_LOOP_TIME=1e3,or.FAST_FORWARD_VALUE=3,or.FAST_FORWARD_TIME=1e3,or.TOUCH_MOVE_RATIO=.5,or.VOLUME_STEP=.1,or.SEEK_STEP=5,or.PLAYBACK_RATE=[.5,.75,1,1.25,1.5,2],or.ASPECT_RATIO=["default","4:3","16:9"],or.FLIP=["normal","horizontal","vertical"],or.FULLSCREEN_WEB_IN_BODY=!0,or.LOG_VERSION=!0,or.USE_RAF=!1,or.REMOVE_SRC_WHEN_DESTROY=!0,_&&(window.Artplayer=or,V("artplayer-style",Ge),setTimeout(()=>{or.LOG_VERSION&&console.log(`%c ArtPlayer %c ${or.version} %c https://artplayer.org`,"color: #fff; background: #5f5f5f","color: #fff; background: #4bc729","")},100)),or});