Files
ArtPlayer/dist/artplayer-react.js
T
2019-04-16 11:39:40 +08:00

9 lines
118 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*!
* artplayer-react.js v3.1.3
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2019 Harvey Zack
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self)["artplayer-react"]=e()}(this,function(){"use strict";var a=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],0<=e.indexOf(n)||(i[n]=t[n]);return i};var r=function(t,e){if(null==t)return{};var n,r,i=a(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],0<=e.indexOf(n)||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i};var i=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(t){i(e,t,n[t])})}return e},jt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(t,e){return t(e={exports:{}},e.exports),e.exports}var s=t(function(e){function n(t){return(n="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})(t)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(t){return n(t)}:e.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(t)}e.exports=r});var c=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var e=function(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),t};var n=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var l=function(t,e){return!e||"object"!==s(e)&&"function"!=typeof e?n(t):e},f=t(function(e){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}e.exports=n}),p=t(function(n){function r(t,e){return n.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}n.exports=r});var d=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)},h=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var $t=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,r,i=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),o=1;o<arguments.length;o++){for(var a in n=Object(arguments[o]))y.call(n,a)&&(i[a]=n[a]);if(h){r=h(n);for(var s=0;s<r.length;s++)v.call(n,r[s])&&(i[r[s]]=n[r[s]])}}return i},m="function"==typeof Symbol&&Symbol.for,g=m?Symbol.for("react.element"):60103,b=m?Symbol.for("react.portal"):60106,w=m?Symbol.for("react.fragment"):60107,x=m?Symbol.for("react.strict_mode"):60108,k=m?Symbol.for("react.profiler"):60114,S=m?Symbol.for("react.provider"):60109,E=m?Symbol.for("react.context"):60110,P=m?Symbol.for("react.concurrent_mode"):60111,$=m?Symbol.for("react.forward_ref"):60112,_=m?Symbol.for("react.suspense"):60113,O=m?Symbol.for("react.memo"):60115,R=m?Symbol.for("react.lazy"):60116,C="function"==typeof Symbol&&Symbol.iterator;function j(t){for(var e=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);!function(t,e,n,r,i,o,a,s){if(!t){if((t=void 0)===e)t=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,a,s],u=0;(t=Error(e.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw t.framesToPop=1,t}}(!1,"Minified React error #"+t+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L={};function M(t,e,n){this.props=t,this.context=e,this.refs=L,this.updater=n||T}function A(){}function D(t,e,n){this.props=t,this.context=e,this.refs=L,this.updater=n||T}M.prototype.isReactComponent={},M.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t&&j("85"),this.updater.enqueueSetState(this,t,e,"setState")},M.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},A.prototype=M.prototype;var z=D.prototype=new A;z.constructor=D,$t(z,M.prototype),z.isPureReactComponent=!0;var q={current:null},W={current:null},I=Object.prototype.hasOwnProperty,F={key:!0,ref:!0,__self:!0,__source:!0};function N(t,e,n){var r=void 0,i={},o=null,a=null;if(null!=e)for(r in void 0!==e.ref&&(a=e.ref),void 0!==e.key&&(o=""+e.key),e)I.call(e,r)&&!F.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(1===s)i.children=n;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];i.children=c}if(t&&t.defaultProps)for(r in s=t.defaultProps)void 0===i[r]&&(i[r]=s[r]);return{$$typeof:g,type:t,key:o,ref:a,props:i,_owner:W.current}}function H(t){return"object"==typeof t&&null!==t&&t.$$typeof===g}var B=/\/+/g,U=[];function V(t,e,n,r){if(U.length){var i=U.pop();return i.result=t,i.keyPrefix=e,i.func=n,i.context=r,i.count=0,i}return{result:t,keyPrefix:e,func:n,context:r,count:0}}function Y(t){t.result=null,t.keyPrefix=null,t.func=null,t.context=null,t.count=0,U.length<10&&U.push(t)}function J(t,e,n){return null==t?0:function t(e,n,r,i){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case g:case b:a=!0}}if(a)return r(i,e,""===n?"."+Q(e,0):n),1;if(a=0,n=""===n?".":n+":",Array.isArray(e))for(var s=0;s<e.length;s++){var c=n+Q(o=e[s],s);a+=t(o,c,r,i)}else if("function"==typeof(c=null===e||"object"!=typeof e?null:"function"==typeof(c=C&&e[C]||e["@@iterator"])?c:null))for(e=c.call(e),s=0;!(o=e.next()).done;)a+=t(o=o.value,c=n+Q(o,s++),r,i);else"object"===o&&j("31","[object Object]"==(r=""+e)?"object with keys {"+Object.keys(e).join(", ")+"}":r,"");return a}(t,"",e,n)}function Q(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,function(t){return e[t]})}(t.key):e.toString(36)}function X(t,e){t.func.call(t.context,e,t.count++)}function Z(t,e,n){var r=t.result,i=t.keyPrefix;t=t.func.call(t.context,e,t.count++),Array.isArray(t)?G(t,r,n,function(t){return t}):null!=t&&(H(t)&&(t=function(t,e){return{$$typeof:g,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(t,i+(!t.key||e&&e.key===t.key?"":(""+t.key).replace(B,"$&/")+"/")+n)),r.push(t))}function G(t,e,n,r,i){var o="";null!=n&&(o=(""+n).replace(B,"$&/")+"/"),J(t,Z,e=V(e,o,r,i)),Y(e)}function K(){var t=q.current;return null===t&&j("321"),t}var tt={Children:{map:function(t,e,n){if(null==t)return t;var r=[];return G(t,r,null,e,n),r},forEach:function(t,e,n){if(null==t)return t;J(t,X,e=V(null,null,e,n)),Y(e)},count:function(t){return J(t,function(){return null},null)},toArray:function(t){var e=[];return G(t,e,null,function(t){return t}),e},only:function(t){return H(t)||j("143"),t}},createRef:function(){return{current:null}},Component:M,PureComponent:D,createContext:function(t,e){return void 0===e&&(e=null),(t={$$typeof:E,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:S,_context:t},t.Consumer=t},forwardRef:function(t){return{$$typeof:$,render:t}},lazy:function(t){return{$$typeof:R,_ctor:t,_status:-1,_result:null}},memo:function(t,e){return{$$typeof:O,type:t,compare:void 0===e?null:e}},useCallback:function(t,e){return K().useCallback(t,e)},useContext:function(t,e){return K().useContext(t,e)},useEffect:function(t,e){return K().useEffect(t,e)},useImperativeHandle:function(t,e,n){return K().useImperativeHandle(t,e,n)},useDebugValue:function(){},useLayoutEffect:function(t,e){return K().useLayoutEffect(t,e)},useMemo:function(t,e){return K().useMemo(t,e)},useReducer:function(t,e,n){return K().useReducer(t,e,n)},useRef:function(t){return K().useRef(t)},useState:function(t){return K().useState(t)},Fragment:w,StrictMode:x,Suspense:_,createElement:N,cloneElement:function(t,e,n){null==t&&j("267",t);var r=void 0,i=$t({},t.props),o=t.key,a=t.ref,s=t._owner;if(null!=e){void 0!==e.ref&&(a=e.ref,s=W.current),void 0!==e.key&&(o=""+e.key);var c=void 0;for(r in t.type&&t.type.defaultProps&&(c=t.type.defaultProps),e)I.call(e,r)&&!F.hasOwnProperty(r)&&(i[r]=void 0===e[r]&&void 0!==c?c[r]:e[r])}if(1===(r=arguments.length-2))i.children=n;else if(1<r){c=Array(r);for(var u=0;u<r;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:g,type:t.type,key:o,ref:a,props:i,_owner:s}},createFactory:function(t){var e=N.bind(null,t);return e.type=t,e},isValidElement:H,version:"16.8.6",unstable_ConcurrentMode:P,unstable_Profiler:k,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:q,ReactCurrentOwner:W,assign:$t}},et=tt.default||tt,nt=function(){};if("production"!==process.env.NODE_ENV){var rt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",it={},ot=Function.call.bind(Object.prototype.hasOwnProperty);nt=function(t){var e="Warning: "+t;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(t){}}}function at(t,e,n,r,i){if("production"!==process.env.NODE_ENV)for(var o in t)if(ot(t,o)){var a;try{if("function"!=typeof t[o]){var s=Error((r||"React class")+": "+n+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[o]+"`.");throw s.name="Invariant Violation",s}a=t[o](e,o,r,n,null,rt)}catch(t){a=t}if(!a||a instanceof Error||nt((r||"React class")+": type specification of "+n+" `"+o+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in it)){it[a.message]=!0;var c=i?i():"";nt("Failed "+n+" type: "+a.message+(null!=c?c:""))}}}at.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(it={})};var st,_t=at,ct=t(function(Pt){"production"!==process.env.NODE_ENV&&function(){var h=$t,i=_t,t="function"==typeof Symbol&&Symbol.for,m=t?Symbol.for("react.element"):60103,g=t?Symbol.for("react.portal"):60106,u=t?Symbol.for("react.fragment"):60107,n=t?Symbol.for("react.strict_mode"):60108,r=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,o=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,l=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,d="function"==typeof Symbol&&Symbol.iterator,y="@@iterator";function b(t){if(null===t||"object"!=typeof t)return null;var e=d&&t[d]||t[y];return"function"==typeof e?e:null}var v=function(){};function w(t,e,n,r,i,o,a,s){if(v(e),!t){var c=void 0;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,a,s],l=0;(c=new Error(e.replace(/%s/g,function(){return u[l++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}v=function(t){if(void 0===t)throw new Error("invariant requires an error message argument")};var x=function(t,e){if(void 0===e)throw new Error("`lowPriorityWarning(condition, format, ...args)` requires a warning message argument");if(!t){for(var n=arguments.length,r=Array(2<n?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];(function(t){for(var e=arguments.length,n=Array(1<e?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=0,o="Warning: "+t.replace(/%s/g,function(){return n[i++]});"undefined"!=typeof console&&console.warn(o);try{throw new Error(o)}catch(t){}}).apply(void 0,[e].concat(r))}},k=function(t,e){for(var n=arguments.length,r=Array(2<n?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(void 0===e)throw new Error("`warningWithoutStack(condition, format, ...args)` requires a warning message argument");if(8<r.length)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!t){if("undefined"!=typeof console){var o=r.map(function(t){return""+t});o.unshift("Warning: "+e),Function.prototype.apply.call(console.error,console,o)}try{var a=0,s="Warning: "+e.replace(/%s/g,function(){return r[a++]});throw new Error(s)}catch(t){}}},S={};function E(t,e){var n=t.constructor,r=n&&(n.displayName||n.name)||"ReactClass",i=r+"."+e;S[i]||(k(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",e,r),S[i]=!0)}var P={isMounted:function(t){return!1},enqueueForceUpdate:function(t,e,n){E(t,"forceUpdate")},enqueueReplaceState:function(t,e,n,r){E(t,"replaceState")},enqueueSetState:function(t,e,n,r){E(t,"setState")}},$={};function _(t,e,n){this.props=t,this.context=e,this.refs=$,this.updater=n||P}Object.freeze($),_.prototype.isReactComponent={},_.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t&&w(!1,"setState(...): takes an object of state variables to update or a function which returns an object of state variables."),this.updater.enqueueSetState(this,t,e,"setState")},_.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};var e={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},O=function(t,e){Object.defineProperty(_.prototype,t,{get:function(){x(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",e[0],e[1])}})};for(var R in e)e.hasOwnProperty(R)&&O(R,e[R]);function C(){}function j(t,e,n){this.props=t,this.context=e,this.refs=$,this.updater=n||P}C.prototype=_.prototype;var T=j.prototype=new C;T.constructor=j,h(T,_.prototype),T.isPureReactComponent=!0;var L={current:null},M={current:null},A=/^(.*)[\\\/]/,D=1;function z(t){if(null==t)return null;if("number"==typeof t.tag&&k(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case o:return"ConcurrentMode";case u:return"Fragment";case g:return"Portal";case r:return"Profiler";case n:return"StrictMode";case l:return"Suspense"}if("object"==typeof t)switch(t.$$typeof){case s:return"Context.Consumer";case a:return"Context.Provider";case c:return function(t,e,n){var r=e.displayName||e.name||"";return t.displayName||(""!==r?n+"("+r+")":n)}(t,t.render,"ForwardRef");case f:return z(t.type);case p:var e=function(t){return t._status===D?t._result:null}(t);if(e)return z(e)}return null}var q={},W=null;function I(t){W=t}q.getCurrentStack=null,q.getStackAddendum=function(){var t="";if(W){var e=z(W.type),n=W._owner;t+=function(t,e,n){var r="";if(e){var i=e.fileName,o=i.replace(A,"");if(/^index\./.test(o)){var a=i.match(A);if(a){var s=a[1];s&&(o=s.replace(A,"")+"/"+o)}}r=" (at "+o+":"+e.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(t||"Unknown")+r}(e,W._source,n&&z(n.type))}var r=q.getCurrentStack;return r&&(t+=r()||""),t};var F={ReactCurrentDispatcher:L,ReactCurrentOwner:M,assign:h};h(F,{ReactDebugCurrentFrame:q,ReactComponentTreeHook:{}});var N=function(t,e){if(!t){for(var n=F.ReactDebugCurrentFrame.getStackAddendum(),r=arguments.length,i=Array(2<r?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];k.apply(void 0,[!1,e+"%s"].concat(i,[n]))}},H=Object.prototype.hasOwnProperty,B={key:!0,ref:!0,__self:!0,__source:!0},U=void 0,V=void 0;function Y(t){if(H.call(t,"ref")){var e=Object.getOwnPropertyDescriptor(t,"ref").get;if(e&&e.isReactWarning)return!1}return void 0!==t.ref}function J(t){if(H.call(t,"key")){var e=Object.getOwnPropertyDescriptor(t,"key").get;if(e&&e.isReactWarning)return!1}return void 0!==t.key}var Q=function(t,e,n,r,i,o,a){var s={$$typeof:m,type:t,key:e,ref:n,props:a,_owner:o,_store:{}};return Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function X(t,e,n){var r=void 0,i={},o=null,a=null,s=null,c=null;if(null!=e)for(r in Y(e)&&(a=e.ref),J(e)&&(o=""+e.key),s=void 0===e.__self?null:e.__self,c=void 0===e.__source?null:e.__source,e)H.call(e,r)&&!B.hasOwnProperty(r)&&(i[r]=e[r]);var u=arguments.length-2;if(1==u)i.children=n;else if(1<u){for(var l=Array(u),f=0;f<u;f++)l[f]=arguments[f+2];Object.freeze&&Object.freeze(l),i.children=l}if(t&&t.defaultProps){var p=t.defaultProps;for(r in p)void 0===i[r]&&(i[r]=p[r])}if(o||a){var d="function"==typeof t?t.displayName||t.name||"Unknown":t;o&&function(t,e){var n=function(){U||k(!(U=!0),"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",e)};n.isReactWarning=!0,Object.defineProperty(t,"key",{get:n,configurable:!0})}(i,d),a&&function(t,e){var n=function(){V||k(!(V=!0),"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",e)};n.isReactWarning=!0,Object.defineProperty(t,"ref",{get:n,configurable:!0})}(i,d)}return Q(t,o,a,s,c,M.current,i)}function Z(t){return"object"==typeof t&&null!==t&&t.$$typeof===m}var G=".",K=":";var tt=!1,et=/\/+/g;function nt(t){return(""+t).replace(et,"$&/")}var rt=10,it=[];function ot(t,e,n,r){if(it.length){var i=it.pop();return i.result=t,i.keyPrefix=e,i.func=n,i.context=r,i.count=0,i}return{result:t,keyPrefix:e,func:n,context:r,count:0}}function at(t){t.result=null,t.keyPrefix=null,t.func=null,t.context=null,t.count=0,it.length<rt&&it.push(t)}function st(t,e,n){return null==t?0:function t(e,n,r,i){var o=typeof e;"undefined"!=o&&"boolean"!=o||(e=null);var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case m:case g:a=!0}}if(a)return r(i,e,""===n?G+ct(e,0):n),1;var s=void 0,c=0,u=""===n?G:n+K;if(Array.isArray(e))for(var l=0;l<e.length;l++)c+=t(s=e[l],u+ct(s,l),r,i);else{var f=b(e);if("function"==typeof f){f===e.entries&&(tt||N(!1,"Using Maps as children is unsupported and will likely yield unexpected results. Convert it to a sequence/iterable of keyed ReactElements instead."),tt=!0);for(var p=f.call(e),d=void 0,h=0;!(d=p.next()).done;)c+=t(s=d.value,u+ct(s,h++),r,i)}else if("object"==o){var y;y=" If you meant to render a collection of children, use an array instead."+q.getStackAddendum();var v=""+e;w(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"==v?"object with keys {"+Object.keys(e).join(", ")+"}":v,y)}}return c}(t,"",e,n)}function ct(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,function(t){return e[t]})}(t.key):e.toString(36)}function ut(t,e,n){var r=t.func,i=t.context;r.call(i,e,t.count++)}function lt(t,e,n){var r=t.result,i=t.keyPrefix,o=t.func,a=t.context,s=o.call(a,e,t.count++);Array.isArray(s)?ft(s,r,n,function(t){return t}):null!=s&&(Z(s)&&(s=function(t,e){return Q(t.type,e,t.ref,t._self,t._source,t._owner,t.props)}(s,i+(!s.key||e&&e.key===s.key?"":nt(s.key)+"/")+n)),r.push(s))}function ft(t,e,n,r,i){var o="";null!=n&&(o=nt(n)+"/");var a=ot(e,o,r,i);st(t,lt,a),at(a)}function pt(t){return"string"==typeof t||"function"==typeof t||t===u||t===o||t===r||t===n||t===l||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===f||t.$$typeof===a||t.$$typeof===s||t.$$typeof===c)}function dt(){var t=L.current;return null===t&&w(!1,"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem."),t}var ht=void 0;function yt(){if(M.current){var t=z(M.current.type);if(t)return"\n\nCheck the render method of `"+t+"`."}return""}ht=!1;var vt={};function mt(t,e){if(t._store&&!t._store.validated&&null==t.key){t._store.validated=!0;var n=function(t){var e=yt();if(!e){var n="string"==typeof t?t:t.displayName||t.name;n&&(e="\n\nCheck the top-level render call using <"+n+">.")}return e}(e);if(!vt[n]){vt[n]=!0;var r="";t&&t._owner&&t._owner!==M.current&&(r=" It was passed a child from "+z(t._owner.type)+"."),I(t),N(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),I(null)}}}function gt(t,e){if("object"==typeof t)if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];Z(r)&&mt(r,e)}else if(Z(t))t._store&&(t._store.validated=!0);else if(t){var i=b(t);if("function"==typeof i&&i!==t.entries)for(var o=i.call(t),a=void 0;!(a=o.next()).done;)Z(a.value)&&mt(a.value,e)}}function bt(t){var e=t.type;if(null!=e&&"string"!=typeof e){var n=z(e),r=void 0;if("function"==typeof e)r=e.propTypes;else{if("object"!=typeof e||e.$$typeof!==c&&e.$$typeof!==f)return;r=e.propTypes}r?(I(t),i(r,t.props,"prop",n,q.getStackAddendum),I(null)):void 0===e.PropTypes||ht||k(!(ht=!0),"Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown"),"function"==typeof e.getDefaultProps&&(e.getDefaultProps.isReactClassApproved||k(!1,"getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."))}}function wt(t,e,n){var r=pt(t);if(!r){var i="";(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var o=function(t){if(null==t||void 0===t.__source)return"";var e=t.__source;return"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+"."}(e);i+=o||yt();var a=void 0;null===t?a="null":Array.isArray(t)?a="array":void 0!==t&&t.$$typeof===m?(a="<"+(z(t.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):a=typeof t,N(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",a,i)}var s=X.apply(this,arguments);if(null==s)return s;if(r)for(var c=2;c<arguments.length;c++)gt(arguments[c],t);return t===u?function(t){I(t);for(var e=Object.keys(t.props),n=0;n<e.length;n++){var r=e[n];if("children"!==r&&"key"!==r){N(!1,"Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r);break}}null!==t.ref&&N(!1,"Invalid attribute `ref` supplied to `React.Fragment`."),I(null)}(s):bt(s),s}var xt={Children:{map:function(t,e,n){if(null==t)return t;var r=[];return ft(t,r,null,e,n),r},forEach:function(t,e,n){if(null==t)return t;var r=ot(null,null,e,n);st(t,ut,r),at(r)},count:function(t){return st(t,function(){return null},null)},toArray:function(t){var e=[];return ft(t,e,null,function(t){return t}),e},only:function(t){return Z(t)||w(!1,"React.Children.only expected to receive a single React element child."),t}},createRef:function(){var t={current:null};return Object.seal(t),t},Component:_,PureComponent:j,createContext:function(t,e){void 0===e?e=null:null!==e&&"function"!=typeof e&&k(!1,"createContext: Expected the optional second argument to be a function. Instead received: %s",e);var n={$$typeof:s,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},r=(n.Provider={$$typeof:a,_context:n},!1),i=!1,o={$$typeof:s,_context:n,_calculateChangedBits:n._calculateChangedBits};return Object.defineProperties(o,{Provider:{get:function(){return i||N(!(i=!0),"Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?"),n.Provider},set:function(t){n.Provider=t}},_currentValue:{get:function(){return n._currentValue},set:function(t){n._currentValue=t}},_currentValue2:{get:function(){return n._currentValue2},set:function(t){n._currentValue2=t}},_threadCount:{get:function(){return n._threadCount},set:function(t){n._threadCount=t}},Consumer:{get:function(){return r||N(!(r=!0),"Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"),n.Consumer}}}),n.Consumer=o,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(t){return null!=t&&t.$$typeof===f?k(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof t?k(!1,"forwardRef requires a render function but was given %s.",null===t?"null":typeof t):0!==t.length&&2!==t.length&&k(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===t.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=t&&(null!=t.defaultProps||null!=t.propTypes)&&k(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:c,render:t}},lazy:function(t){var e={$$typeof:p,_ctor:t,_status:-1,_result:null},n=void 0,r=void 0;return Object.defineProperties(e,{defaultProps:{configurable:!0,get:function(){return n},set:function(t){N(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=t,Object.defineProperty(e,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(t){N(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=t,Object.defineProperty(e,"propTypes",{enumerable:!0})}}}),e},memo:function(t,e){return pt(t)||k(!1,"memo: The first argument must be a component. Instead received: %s",null===t?"null":typeof t),{$$typeof:f,type:t,compare:void 0===e?null:e}},useCallback:function(t,e){return dt().useCallback(t,e)},useContext:function(t,e){var n=dt();if(void 0!==e&&N(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",e,"number"==typeof e&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==t._context){var r=t._context;r.Consumer===t?N(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===t&&N(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(t,e)},useEffect:function(t,e){return dt().useEffect(t,e)},useImperativeHandle:function(t,e,n){return dt().useImperativeHandle(t,e,n)},useDebugValue:function(t,e){return dt().useDebugValue(t,e)},useLayoutEffect:function(t,e){return dt().useLayoutEffect(t,e)},useMemo:function(t,e){return dt().useMemo(t,e)},useReducer:function(t,e,n){return dt().useReducer(t,e,n)},useRef:function(t){return dt().useRef(t)},useState:function(t){return dt().useState(t)},Fragment:u,StrictMode:n,Suspense:l,createElement:wt,cloneElement:function(t,e,n){for(var r=function(t,e,n){null==t&&w(!1,"React.cloneElement(...): The argument must be a React element, but you passed %s.",t);var r=void 0,i=h({},t.props),o=t.key,a=t.ref,s=t._self,c=t._source,u=t._owner;if(null!=e){Y(e)&&(a=e.ref,u=M.current),J(e)&&(o=""+e.key);var l=void 0;for(r in t.type&&t.type.defaultProps&&(l=t.type.defaultProps),e)H.call(e,r)&&!B.hasOwnProperty(r)&&(void 0===e[r]&&void 0!==l?i[r]=l[r]:i[r]=e[r])}var f=arguments.length-2;if(1==f)i.children=n;else if(1<f){for(var p=Array(f),d=0;d<f;d++)p[d]=arguments[d+2];i.children=p}return Q(t.type,o,a,s,c,u,i)}.apply(this,arguments),i=2;i<arguments.length;i++)gt(arguments[i],r.type);return bt(r),r},createFactory:function(t){var e=wt.bind(null,t);return e.type=t,Object.defineProperty(e,"type",{enumerable:!1,get:function(){return x(!1,"Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:t}),t}}),e},isValidElement:Z,version:"16.8.6",unstable_ConcurrentMode:o,unstable_Profiler:r,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:F},kt=Object.freeze({default:xt}),St=kt&&xt||kt,Et=St.default||St;Pt.exports=Et}()}),ut=t(function(t){"production"===process.env.NODE_ENV?t.exports=et:t.exports=ct}),lt=t(function(t,e){t.exports=function(){var a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t},o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==jt?jt:"undefined"!=typeof self?self:{};function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=e(function(e){function n(t){return(n="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})(t)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(t){return n(t)}:e.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(t)}e.exports=r}),s=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},c=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?s(t):e},u=e(function(e){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}e.exports=n}),l=e(function(n){function r(t,e){return n.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}n.exports=r}),f=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)};function p(){}p.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var r=this;function i(){r.off(t,i),e.apply(n,arguments)}return i._=e,this.on(t,i,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,i=n.length;r<i;r++)n[r].fn.apply(n[r].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),r=n[t],i=[];if(r&&e)for(var o=0,a=r.length;o<a;o++)r[o].fn!==e&&r[o].fn._!==e&&i.push(r[o]);return i.length?n[t]=i:delete n[t],this}};var d=p,h=p;d.TinyEmitter=h;var y=e(function(t,e){t.exports=function(){function s(t){return(s="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})(t)}var c=Object.prototype.toString,a=function(t){if(void 0===t)return"undefined";if(null===t)return"null";var e,n,r,i,o,a=s(t);if("boolean"===a)return"boolean";if("string"===a)return"string";if("number"===a)return"number";if("symbol"===a)return"symbol";if("function"===a)return"GeneratorFunction"===u(t)?"generatorfunction":"function";if(e=t,Array.isArray?Array.isArray(e):e instanceof Array)return"array";if(function(t){return!(!t.constructor||"function"!=typeof t.constructor.isBuffer)&&t.constructor.isBuffer(t)}(t))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(t){if(-1!==t.message.indexOf("callee"))return!0}return!1}(t))return"arguments";if((n=t)instanceof Date||"function"==typeof n.toDateString&&"function"==typeof n.getDate&&"function"==typeof n.setDate)return"date";if((r=t)instanceof Error||"string"==typeof r.message&&r.constructor&&"number"==typeof r.constructor.stackTraceLimit)return"error";if((i=t)instanceof RegExp||"string"==typeof i.flags&&"boolean"==typeof i.ignoreCase&&"boolean"==typeof i.multiline&&"boolean"==typeof i.global)return"regexp";switch(u(t)){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"==typeof(o=t).throw&&"function"==typeof o.return&&"function"==typeof o.next)return"generator";switch(a=c.call(t)){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 a.slice(8,-1).toLowerCase().replace(/\s/g,"")};function u(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];for(var r in f(t,e,n),p(t,e,n),d(t,e,n),e)if(e.hasOwnProperty(r)){var i=t[r],o=e[r],a=n.concat(r);if(l(t,r,o,a))continue;f(i,o,a),p(i,o,a),d(i,o,a)}}function l(t,e,n,r){if(!Object.prototype.hasOwnProperty.call(t,e)){if(!0===n.__required__||!0===n.required)throw new TypeError("'".concat(r.join("."),"' is required"));return!0}}function f(t,e,n){var r;if("string"===a(e)?r=e:"function"===a(e)?e.___validator__=e:e.__type__?r=e.__type__:e.type&&(r=e.type),r&&"string"===a(r)){r=r.trim().toLowerCase();var i=a(t),o=i===r;if(-1<r.indexOf("|")&&(o=r.split("|").filter(Boolean).some(function(t){return i===t.trim()})),!o)throw new TypeError("'".concat(n.join("."),"' require '").concat(r,"' type, but got '").concat(i,"'"))}}function p(t,e,n){var r;if(e.___validator__?r=e.___validator__:e.validator&&(r=e.validator),"function"===a(r)){var i=r(n,t,a(t));if(!0!==i)throw new TypeError("The scheme for '".concat(n.join("."),"' validator function require return true, but got '").concat(i,"'"))}}function d(t,e,n){var r;if(e.___child__?r=e.___child__:e.child&&(r=e.child),"object"===a(r)){var i=a(t);"object"===i?o(t,r,n):"array"===i&&t.forEach(function(t,e){o(t,r,n.concat(e))})}}return o.kindOf=a,window.optionValidator=o}()}),v=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},m=e(function(r){function i(t,e,n){return function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?r.exports=i=Reflect.construct:r.exports=i=function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&l(i,n.prototype),i},i.apply(null,arguments)}r.exports=i}),g=function(t){function r(t,e){var n;return a(this,r),n=c(this,u(r).call(this,t)),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(n),e||n.constructor),n.name="ArtPlayerError",n}return f(r,t),r}(e(function(e){function r(t){var n="function"==typeof Map?new Map:void 0;return e.exports=r=function(t){if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return m(t,arguments,u(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),l(e,t)},r(t)}e.exports=r})(Error));function b(t,e){if(!t)throw new g(e)}function w(t,e,n){return Math.max(Math.min(t,Math.max(e,n)),Math.min(e,n))}function x(t){return t.includes("?")?x(t.split("?")[0]):t.includes("#")?x(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function k(t){var e=Math.floor(t/3600),n=Math.floor((t-3600*e)/60),r=Math.floor(t-3600*e-60*n);return(0<e?[e,n,r]:[n,r]).map(function(t){return t<10?"0".concat(t):String(t)}).join(":")}function S(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;return new Promise(function(t){return setTimeout(t,e)})}function E(r,i,o){var a;function t(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];clearTimeout(a),a=setTimeout(function(){a=null,r.apply(o,e)},i)}return t.clearTimeout=function(){clearTimeout(a)},t}function P(t){return t&&"object"===n(t)&&!Array.isArray(t)}function $(t){return t instanceof Element}function _(n,r){var i=Object.assign({},n);return P(n)&&P(r)&&Object.keys(r).forEach(function(t){var e=r[t];P(e)&&!$(e)&&t in n?i[t]=_(n[t],e):Object.assign(i,v({},t,e))}),i}function O(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.lastElementChild}function R(t,e,n){var r=Array.from(t.children);e.dataset.index=n;var i=r.find(function(t){return Number(t.dataset.index)>=Number(n)});return i?i.insertAdjacentElement("beforebegin",e):O(t,e),e}function C(t,e,n){return t.style[e]=n,t}function j(e,n){return Object.keys(n).forEach(function(t){C(e,t,n[t])}),e}function T(t,e){var n=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],r=window.getComputedStyle(t,null).getPropertyValue(e);return n?parseFloat(r):r}function L(e){return Array.from(e.parentElement.children).filter(function(t){return t!==e})}function M(t,e){L(t).forEach(function(t){return t.classList.remove(e)}),t.classList.add(e)}function A(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"up";t.setAttribute("data-balloon",e),t.setAttribute("data-balloon-pos",n)}function D(t){return"WEBVTT \r\n\r\n".concat(t.replace(/\{\\([ibu])\}/g,"</$1>").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"</$1>").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function z(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function q(t,e){var n=document.createElement("a");C(n,"display","none"),n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var W=Object.freeze({ArtPlayerError:g,errorHandle:b,clamp:w,getExt:x,secondToTime:k,sleep:S,debounce:E,isObject:P,isElement:$,mergeDeep:_,append:O,remove:function(t){return t.parentNode.removeChild(t)},insertByIndex:R,setStyle:C,setStyles:j,getStyle:T,sublings:L,inverseClass:M,tooltip:A,srtToVtt:D,vttToBlob:z,downloadImage:q});function I(t,e,n){if("string"===n){if(""===e.trim())throw new g("".concat(t.join(".")," can not be empty"));return!0}if(e instanceof Element)return!0;throw new g("".concat(t.join(".")," require 'string' or 'Element' type, but got '").concat(n,"'"))}var F={container:{validator:I,required:!0},url:{type:"string|function",required:!0},poster:"string",title:"string",type:{type:"string"},mimeCodec:"string",theme:"string",volume:"number",isLive:"boolean",muted:"boolean",autoplay:"boolean",autoSize:"boolean",loop:"boolean",playbackRate:"boolean",aspectRatio:"boolean",screenshot:"boolean",setting:"boolean",hotkey:"boolean",pip:"boolean",mutex:"boolean",fullscreen:"boolean",fullscreenWeb:"boolean",plugins:{type:"array",child:{type:"function"}},whitelist:{type:"array",child:{type:"string|function|regexp"}},layers:{type:"array",child:{type:"object|function",disable:"boolean",name:"string",index:"number",html:I,style:"object",click:"function"}},contextmenu:{type:"array",child:{type:"object|function",disable:"boolean",name:"string",index:"number",html:I,style:"object",click:"function"}},quality:{type:"array",child:{default:"boolean",name:"string",url:"string"}},controls:{type:"array",child:{type:"object|function",disable:"boolean",name:"string",index:"number",html:I,style:"object",click:"function",position:function(t,e){return["top","left","right"].includes(e)}}},highlight:{type:"array",child:{type:"object",time:"number",text:"string"}},thumbnails:{type:"object",child:{type:"object",url:"string",number:"number",width:"number",height:"number",column:"number"}},subtitle:{type:"object",child:{type:"object",url:"string",style:"object"}},moreVideoAttr:"object",icons:"object",customType:"object",lang:"string"},N={mimeCodec:{mp4:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',webm:'video/webm; codecs="vorbis, vp8"',ts:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"'},mse:{mediaSource:{propertys:["activeSourceBuffers","duration","readyState","sourceBuffers"],methods:["addSourceBuffer","endOfStream","removeSourceBuffer","clearLiveSeekableRange","setLiveSeekableRange"],events:["sourceclose","sourceended","sourceopen"]},sourceBuffer:{propertys:["mode","updating","buffered","timestampOffset","audioTracks","videoTracks","textTracks","appendWindowStart","appendWindowEnd","trackDefaults"],methods:["appendBuffer","appendStream","abort","remove"],events:["abort","error","update","updateend","updatestart"]},sourceBufferList:{propertys:["length"],events:["addsourcebuffer","removesourcebuffer"]}},video:{propertys:["audioTracks","autoplay","buffered","controller","controls","crossOrigin","currentSrc","currentTime","defaultMuted","defaultPlaybackRate","duration","ended","error","loop","mediaGroup","muted","networkState","paused","playbackRate","played","preload","readyState","seekable","seeking","src","startDate","textTracks","videoTracks","volume"],methods:["addTextTrack","canPlayType","load","play","pause"],events:["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"]}},H=function t(e){var n=this;a(this,t);var r=e.option.whitelist;this.userAgent=window.navigator.userAgent,this.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.userAgent),this.state=!this.isMobile||r.some(function(t){var e=!1;switch(y.kindOf(t)){case"string":e=-1<n.userAgent.indexOf(t);break;case"function":e=t(n.userAgent);break;case"regexp":e=t.test(n.userAgent)}return e})},B=function(){function n(t){var e=this;a(this,n),t.option.container instanceof Element?this.$container=t.option.container:this.$container=document.querySelector(t.option.container),t.constructor.instances.some(function(t){return t.template.$container===e.$container})&&b(!1,"Cannot mount multiple instances on the same dom element"),t.whitelist.state?this.initDesktop():this.initMobile()}return i(n,[{key:"initDesktop",value:function(){this.$container.innerHTML='\n <div class="artplayer-video-player">\n <video class="artplayer-video"></video>\n <div class="artplayer-subtitle"></div>\n <div class="artplayer-layers"></div>\n <div class="artplayer-mask"></div>\n <div class="artplayer-bottom">\n <div class="artplayer-progress"></div>\n <div class="artplayer-controls">\n <div class="artplayer-controls-left"></div>\n <div class="artplayer-controls-right"></div>\n </div>\n </div>\n <div class="artplayer-loading"></div>\n <div class="artplayer-notice">\n <div class="artplayer-notice-inner"></div>\n </div>\n <div class="artplayer-setting">\n <div class="artplayer-setting-inner">\n <div class="artplayer-setting-body"></div>\n <div class="artplayer-setting-close">×</div>\n </div>\n </div>\n <div class="artplayer-info">\n <div class="artplayer-info-panel"></div>\n <div class="artplayer-info-close">[x]</div>\n </div>\n <div class="artplayer-pip-header">\n <div class="artplayer-pip-title"></div>\n <div class="artplayer-pip-close">×</div>\n </div>\n <div class="artplayer-contextmenu"></div>\n </div>\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video"),this.$subtitle=this.$container.querySelector(".artplayer-subtitle"),this.$bottom=this.$container.querySelector(".artplayer-bottom"),this.$progress=this.$container.querySelector(".artplayer-progress"),this.$controls=this.$container.querySelector(".artplayer-controls"),this.$controlsLeft=this.$container.querySelector(".artplayer-controls-left"),this.$controlsRight=this.$container.querySelector(".artplayer-controls-right"),this.$layers=this.$container.querySelector(".artplayer-layers"),this.$loading=this.$container.querySelector(".artplayer-loading"),this.$notice=this.$container.querySelector(".artplayer-notice"),this.$noticeInner=this.$container.querySelector(".artplayer-notice-inner"),this.$mask=this.$container.querySelector(".artplayer-mask"),this.$setting=this.$container.querySelector(".artplayer-setting"),this.$settingInner=this.$container.querySelector(".artplayer-setting-inner"),this.$settingBody=this.$container.querySelector(".artplayer-setting-body"),this.$settingClose=this.$container.querySelector(".artplayer-setting-close"),this.$info=this.$container.querySelector(".artplayer-info"),this.$infoPanel=this.$container.querySelector(".artplayer-info-panel"),this.$infoClose=this.$container.querySelector(".artplayer-info-close"),this.$pipHeader=this.$container.querySelector(".artplayer-pip-header"),this.$pipTitle=this.$container.querySelector(".artplayer-pip-title"),this.$pipClose=this.$container.querySelector(".artplayer-pip-close"),this.$contextmenu=this.$container.querySelector(".artplayer-contextmenu")}},{key:"initMobile",value:function(){this.$container.innerHTML='\n <div class="artplayer-video-player">\n <video class="artplayer-video"></video>\n </div>\n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),U={"zh-cn":{"About author":"关于作者","Video info":"视频统计信息",Close:"关闭","Video load failed":"视频加载失败",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"视频翻转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器"},"zh-tw":{"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器"}},V=function(){function e(t){a(this,e),this.art=t,this.init()}return i(e,[{key:"init",value:function(){this.language=U[this.art.option.lang.toLowerCase()]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){U=_(U,t),this.init()}}]),e}(),Y=e(function(t){var o,e,i,a,r,n;o="undefined"!=typeof window&&void 0!==window.document?window.document:{},e=t.exports,i="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,a=function(){for(var t,e=[["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"]],n=0,r=e.length,i={};n<r;n++)if((t=e[n])&&t[1]in o){for(n=0;n<t.length;n++)i[e[0][n]]=t[n];return i}return!1}(),r={change:a.fullscreenchange,error:a.fullscreenerror},n={request:function(r){return new Promise(function(t){var e=a.requestFullscreen,n=function(){this.off("change",n),t()}.bind(this);r=r||o.documentElement,/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)?r[e]():r[e](i?Element.ALLOW_KEYBOARD_INPUT:{}),this.on("change",n)}.bind(this))},exit:function(){return new Promise(function(t){if(this.isFullscreen){var e=function(){this.off("change",e),t()}.bind(this);o[a.exitFullscreen](),this.on("change",e)}else t()}.bind(this))},toggle:function(t){return this.isFullscreen?this.exit():this.request(t)},onchange:function(t){this.on("change",t)},onerror:function(t){this.on("error",t)},on:function(t,e){var n=r[t];n&&o.addEventListener(n,e,!1)},off:function(t,e){var n=r[t];n&&o.removeEventListener(n,e,!1)},raw:a},a?(Object.defineProperties(n,{isFullscreen:{get:function(){return Boolean(o[a.fullscreenElement])}},element:{enumerable:!0,get:function(){return o[a.fullscreenElement]}},enabled:{enumerable:!0,get:function(){return Boolean(o[a.fullscreenEnabled])}}}),e?(t.exports=n,t.exports.default=n):window.screenfull=n):e?t.exports=!1:window.screenfull=!1}),J=e(function(t){var e,n;e=window,n=function(){function g(t){var e=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(e)&&e}var n="undefined"==typeof console?function(){}:function(t){console.error(t)},b=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],w=b.length;function x(t){var e=getComputedStyle(t);return e||n("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}var k,S=!1;return function r(t){if(function(){if(!S){S=!0;var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(t);var n=x(t);k=200==Math.round(g(n.width)),r.isBoxSizeOuter=k,e.removeChild(t)}}(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var e=x(t);if("none"==e.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<w;e++)t[b[e]]=0;return t}();var n={};n.width=t.offsetWidth,n.height=t.offsetHeight;for(var i=n.isBorderBox="border-box"==e.boxSizing,o=0;o<w;o++){var a=b[o],s=e[a],c=parseFloat(s);n[a]=isNaN(c)?0:c}var u=n.paddingLeft+n.paddingRight,l=n.paddingTop+n.paddingBottom,f=n.marginLeft+n.marginRight,p=n.marginTop+n.marginBottom,d=n.borderLeftWidth+n.borderRightWidth,h=n.borderTopWidth+n.borderBottomWidth,y=i&&k,v=g(e.width);!1!==v&&(n.width=v+(y?0:u+d));var m=g(e.height);return!1!==m&&(n.height=m+(y?0:l+h)),n.innerWidth=n.width-(u+d),n.innerHeight=n.height-(l+h),n.outerWidth=n.width+f,n.outerHeight=n.height+p,n}}},t.exports?t.exports=n():e.getSize=n()}),Q=e(function(t){var e,n;e="undefined"!=typeof window?window:o,n=function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},r=n[t]=n[t]||[];return-1==r.indexOf(e)&&r.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var r=n.indexOf(e);return-1!=r&&n.splice(r,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),e=e||[];for(var r=this._onceEvents&&this._onceEvents[t],i=0;i<n.length;i++){var o=n[i];r&&r[o]&&(this.off(t,o),delete r[o]),o.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t},t.exports?t.exports=n():e.EvEmitter=n()}),X=e(function(t){var e,n;e=window,n=function(i,t){function e(){}var n=e.prototype=Object.create(t.prototype);n.bindStartEvent=function(t){this._bindStartEvent(t,!0)},n.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},n._bindStartEvent=function(t,e){var n=(e=void 0===e||e)?"addEventListener":"removeEventListener",r="mousedown";i.PointerEvent?r="pointerdown":"ontouchstart"in i&&(r="touchstart"),t[n](r,this)},n.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},n.getTouch=function(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.identifier==this.pointerIdentifier)return n}},n.onmousedown=function(t){var e=t.button;e&&0!==e&&1!==e||this._pointerDown(t,t)},n.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])},n.onpointerdown=function(t){this._pointerDown(t,t)},n._pointerDown=function(t,e){t.button||this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==e.pointerId?e.pointerId:e.identifier,this.pointerDown(t,e))},n.pointerDown=function(t,e){this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,e])};var r={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};return n._bindPostStartEvents=function(t){if(t){var e=r[t.type];e.forEach(function(t){i.addEventListener(t,this)},this),this._boundPointerEvents=e}},n._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach(function(t){i.removeEventListener(t,this)},this),delete this._boundPointerEvents)},n.onmousemove=function(t){this._pointerMove(t,t)},n.onpointermove=function(t){t.pointerId==this.pointerIdentifier&&this._pointerMove(t,t)},n.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerMove(t,e)},n._pointerMove=function(t,e){this.pointerMove(t,e)},n.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])},n.onmouseup=function(t){this._pointerUp(t,t)},n.onpointerup=function(t){t.pointerId==this.pointerIdentifier&&this._pointerUp(t,t)},n.ontouchend=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerUp(t,e)},n._pointerUp=function(t,e){this._pointerDone(),this.pointerUp(t,e)},n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])},n._pointerDone=function(){this._pointerReset(),this._unbindPostStartEvents(),this.pointerDone()},n._pointerReset=function(){this.isPointerDown=!1,delete this.pointerIdentifier},n.pointerDone=function(){},n.onpointercancel=function(t){t.pointerId==this.pointerIdentifier&&this._pointerCancel(t,t)},n.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerCancel(t,e)},n._pointerCancel=function(t,e){this._pointerDone(),this.pointerCancel(t,e)},n.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])},e.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}},e},t.exports?t.exports=n(e,Q):e.Unipointer=n(e,e.EvEmitter)}),Z=e(function(t){var e,n;e=window,n=function(o,t){function e(){}var n=e.prototype=Object.create(t.prototype);n.bindHandles=function(){this._bindHandles(!0)},n.unbindHandles=function(){this._bindHandles(!1)},n._bindHandles=function(t){for(var e=(t=void 0===t||t)?"addEventListener":"removeEventListener",n=t?this._touchActionValue:"",r=0;r<this.handles.length;r++){var i=this.handles[r];this._bindStartEvent(i,t),i[e]("click",this),o.PointerEvent&&(i.style.touchAction=n)}},n._touchActionValue="none",n.pointerDown=function(t,e){this.okayPointerDown(t)&&(this.pointerDownPointer=e,t.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,e]))};var i={TEXTAREA:!0,INPUT:!0,SELECT:!0,OPTION:!0},a={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};return n.okayPointerDown=function(t){var e=i[t.target.nodeName],n=a[t.target.type],r=!e||n;return r||this._pointerReset(),r},n.pointerDownBlur=function(){var t=document.activeElement;t&&t.blur&&t!=document.body&&t.blur()},n.pointerMove=function(t,e){var n=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,n]),this._dragMove(t,e,n)},n._dragPointerMove=function(t,e){var n={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this._dragStart(t,e),n},n.hasDragStarted=function(t){return 3<Math.abs(t.x)||3<Math.abs(t.y)},n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]),this._dragPointerUp(t,e)},n._dragPointerUp=function(t,e){this.isDragging?this._dragEnd(t,e):this._staticClick(t,e)},n._dragStart=function(t,e){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(t,e)},n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])},n._dragMove=function(t,e,n){this.isDragging&&this.dragMove(t,e,n)},n.dragMove=function(t,e,n){t.preventDefault(),this.emitEvent("dragMove",[t,e,n])},n._dragEnd=function(t,e){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(t,e)},n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])},n.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},n._staticClick=function(t,e){this.isIgnoringMouseUp&&"mouseup"==t.type||(this.staticClick(t,e),"mouseup"!=t.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])},e.getPointerPoint=t.getPointerPoint,e},t.exports?t.exports=n(e,X):e.Unidragger=n(e,e.Unipointer)}),G=e(function(t){var e,n;e=window,n=function(o,c,t){function n(t,e){for(var n in e)t[n]=e[n];return t}var r=o.jQuery;function e(t,e){this.element="string"==typeof t?document.querySelector(t):t,r&&(this.$element=r(this.element)),this.options=n({},this.constructor.defaults),this.option(e),this._create()}var i=e.prototype=Object.create(t.prototype);e.defaults={},i.option=function(t){n(this.options,t)};var a={relative:!0,absolute:!0,fixed:!0};function u(t,e,n){return n=n||"round",e?Math[n](t/e)*e:t}return i._create=function(){this.position={},this._getPosition(),this.startPoint={x:0,y:0},this.dragPoint={x:0,y:0},this.startPosition=n({},this.position);var t=getComputedStyle(this.element);a[t.position]||(this.element.style.position="relative"),this.on("pointerDown",this.onPointerDown),this.on("pointerMove",this.onPointerMove),this.on("pointerUp",this.onPointerUp),this.enable(),this.setHandles()},i.setHandles=function(){this.handles=this.options.handle?this.element.querySelectorAll(this.options.handle):[this.element],this.bindHandles()},i.dispatchEvent=function(t,e,n){var r=[e].concat(n);this.emitEvent(t,r),this.dispatchJQueryEvent(t,e,n)},i.dispatchJQueryEvent=function(t,e,n){var r=o.jQuery;if(r&&this.$element){var i=r.Event(e);i.type=t,this.$element.trigger(i,n)}},i._getPosition=function(){var t=getComputedStyle(this.element),e=this._getPositionCoord(t.left,"width"),n=this._getPositionCoord(t.top,"height");this.position.x=isNaN(e)?0:e,this.position.y=isNaN(n)?0:n,this._addTransformPosition(t)},i._getPositionCoord=function(t,e){if(-1==t.indexOf("%"))return parseInt(t,10);var n=c(this.element.parentNode);return n?parseFloat(t)/100*n[e]:0},i._addTransformPosition=function(t){var e=t.transform;if(0===e.indexOf("matrix")){var n=e.split(","),r=0===e.indexOf("matrix3d")?12:4,i=parseInt(n[r],10),o=parseInt(n[1+r],10);this.position.x+=i,this.position.y+=o}},i.onPointerDown=function(t,e){this.element.classList.add("is-pointer-down"),this.dispatchJQueryEvent("pointerDown",t,[e])},i.dragStart=function(t,e){this.isEnabled&&(this._getPosition(),this.measureContainment(),this.startPosition.x=this.position.x,this.startPosition.y=this.position.y,this.setLeftTop(),this.dragPoint.x=0,this.dragPoint.y=0,this.element.classList.add("is-dragging"),this.dispatchEvent("dragStart",t,[e]),this.animate())},i.measureContainment=function(){var t=this.getContainer();if(t){var e=c(this.element),n=c(t),r=this.element.getBoundingClientRect(),i=t.getBoundingClientRect(),o=n.borderLeftWidth+n.borderRightWidth,a=n.borderTopWidth+n.borderBottomWidth,s=this.relativeStartPosition={x:r.left-(i.left+n.borderLeftWidth),y:r.top-(i.top+n.borderTopWidth)};this.containSize={width:n.width-o-s.x-e.width,height:n.height-a-s.y-e.height}}},i.getContainer=function(){var t=this.options.containment;if(t)return t instanceof HTMLElement?t:"string"==typeof t?document.querySelector(t):this.element.parentNode},i.onPointerMove=function(t,e,n){this.dispatchJQueryEvent("pointerMove",t,[e,n])},i.dragMove=function(t,e,n){if(this.isEnabled){var r=n.x,i=n.y,o=this.options.grid,a=o&&o[0],s=o&&o[1];r=u(r,a),i=u(i,s),r=this.containDrag("x",r,a),i=this.containDrag("y",i,s),r="y"==this.options.axis?0:r,i="x"==this.options.axis?0:i,this.position.x=this.startPosition.x+r,this.position.y=this.startPosition.y+i,this.dragPoint.x=r,this.dragPoint.y=i,this.dispatchEvent("dragMove",t,[e,n])}},i.containDrag=function(t,e,n){if(!this.options.containment)return e;var r="x"==t?"width":"height",i=u(-this.relativeStartPosition[t],n,"ceil"),o=this.containSize[r];return o=u(o,n,"floor"),Math.max(i,Math.min(o,e))},i.onPointerUp=function(t,e){this.element.classList.remove("is-pointer-down"),this.dispatchJQueryEvent("pointerUp",t,[e])},i.dragEnd=function(t,e){this.isEnabled&&(this.element.style.transform="",this.setLeftTop(),this.element.classList.remove("is-dragging"),this.dispatchEvent("dragEnd",t,[e]))},i.animate=function(){if(this.isDragging){this.positionDrag();var t=this;requestAnimationFrame(function(){t.animate()})}},i.setLeftTop=function(){this.element.style.left=this.position.x+"px",this.element.style.top=this.position.y+"px"},i.positionDrag=function(){this.element.style.transform="translate3d( "+this.dragPoint.x+"px, "+this.dragPoint.y+"px, 0)"},i.staticClick=function(t,e){this.dispatchEvent("staticClick",t,[e])},i.setPosition=function(t,e){this.position.x=t,this.position.y=e,this.setLeftTop()},i.enable=function(){this.isEnabled=!0},i.disable=function(){this.isEnabled=!1,this.isDragging&&this.dragEnd()},i.destroy=function(){this.disable(),this.element.style.transform="",this.element.style.left="",this.element.style.top="",this.element.style.position="",this.unbindHandles(),this.$element&&this.$element.removeData("draggabilly")},i._init=function(){},r&&r.bridget&&r.bridget("draggabilly",e),e},t.exports?t.exports=n(e,J,Z):e.Draggabilly=n(e,e.getSize,e.Unidragger)}),K=function t(e){a(this,t),function(r,t){var e=r.option,i=e.type,o=e.customType,a=r.template.$video;Object.defineProperty(t,"attachUrl",{value:function(t){return S().then(function(){function e(t){var e=i||x(t),n=o[e];return e&&n?(r.loading.show(),r.emit("beforeCustomType",e),n.call(r,a,t,r),r.emit("afterCustomType",e)):(r.emit("beforeAttachUrl"),a.src=t,r.emit("afterAttachUrl")),Promise.resolve(t)}return"function"==typeof t?t.call(r).then(function(t){return r.loading.show(),e(t)}):e(t)})}})}(e,this),function(e,t){var n=e.option,r=e.events.proxy,i=e.template,o=i.$player,a=i.$video,s=e.i18n,c=e.notice,u=!1,l=0;r(a,"click",function(){t.toggle()}),N.video.events.forEach(function(t){r(a,t,function(t){e.emit("video:".concat(t.type),t)})}),e.on("video:canplay",function(){u||(u=!0,n.autoplay&&t.play(),e.emit("firstCanplay")),l=0,e.controls.show(),e.mask.show(),e.loading.hide()}),e.on("video:ended",function(){e.controls.show(),e.mask.show(),n.loop&&(t.seek(0),t.play())}),e.on("video:error",function(){l<5?S(1e3).then(function(){l+=1,t.attachUrl(n.url),c.show("".concat(s.get("Reconnect"),": ").concat(l))}):(e.loading.hide(),e.controls.hide(),o.classList.add("artplayer-error"),S(1e3).then(function(){c.show(s.get("Video load failed"),!1),e.destroy()}))}),e.on("video:loadedmetadata",function(){n.autoSize&&t.autoSize()}),e.on("video:loadstart",function(){e.loading.show()}),e.on("video:pause",function(){e.controls.show(),e.mask.show()}),e.on("video:play",function(){e.controls.hide(),e.mask.hide()}),e.on("video:playing",function(){e.controls.hide(),e.mask.hide()}),e.on("video:seeked",function(){e.loading.hide()}),e.on("video:seeking",function(){e.loading.show()}),e.on("video:timeupdate",function(){e.controls.hide(),e.mask.hide()}),e.on("video:waiting",function(){e.loading.show()})}(e,this),function(t,e){var n=t.option,r=t.template.$video;Object.keys(n.moreVideoAttr).forEach(function(t){r[t]=n.moreVideoAttr[t]}),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=w(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),e.attachUrl(n.url)}(e,this),function(e,t){var n=e.template.$video,r=e.i18n,i=e.notice,o=e.option.mutex;Object.defineProperty(t,"play",{value:function(){var t=n.play();void 0!==t&&t.then().catch(function(t){i.show(t,!0,3e3),console.warn(t)}),o&&e.constructor.instances.filter(function(t){return t!==e}).forEach(function(t){return t.player.pause()}),i.show(r.get("Play")),e.emit("play")}})}(e,this),function(t,e){var n=t.template.$video,r=t.i18n,i=t.notice;Object.defineProperty(e,"pause",{value:function(){n.pause(),i.show(r.get("Pause")),t.emit("pause")}})}(e,this),function(t,e){Object.defineProperty(e,"toggle",{value:function(){e.playing?e.pause():e.play()}})}(0,this),function(n,r){var i=n.notice;Object.defineProperty(r,"seek",{value:function(t){var e=Math.max(t,0);r.duration&&(e=Math.min(e,r.duration)),r.currentTime=e,i.show("".concat(k(e)," / ").concat(k(r.duration))),n.emit("seek",e)}})}(e,this),function(e,t){var n=e.template.$video,r=e.i18n,i=e.notice,o=e.storage;Object.defineProperty(t,"volume",{get:function(){return n.volume||0},set:function(t){void 0!==t&&(n.volume=w(t,0,1),i.show("".concat(r.get("Volume"),": ").concat(parseInt(100*n.volume,10))),0!==n.volume&&o.set("volume",n.volume),e.emit("volumeChange",n.volume))}}),Object.defineProperty(t,"muted",{get:function(){return n.muted},set:function(t){n.muted=t,e.emit("volumeChange",n.volume)}})}(e,this),function(e,t){Object.defineProperty(t,"currentTime",{get:function(){return e.template.$video.currentTime||0},set:function(t){e.template.$video.currentTime=t}})}(e,this),function(t,e){Object.defineProperty(e,"duration",{get:function(){return t.template.$video.duration||0}})}(e,this),function(i,o){var a=i.i18n,s=i.notice,c=i.option;Object.defineProperty(o,"switchQuality",{value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"unknown";if(t!==c.url){var n=o.currentTime,r=o.playing;o.attachUrl(t).then(function(){c.url=t,o.playbackRateRemove(),o.aspectRatioRemove(),o.seek(n),r&&o.play(),s.show("".concat(a.get("Switch video"),": ").concat(e)),i.emit("switch",t)})}}})}(e,this),function(n,e){var t=n.template,r=t.$video,i=t.$player,o=n.i18n,a=n.notice;Object.defineProperty(e,"playbackRateState",{get:function(){return i.dataset.playbackRate}}),Object.defineProperty(e,"playbackRate",{value:function(t){var e=[.5,.75,1,1.25,1.5,2];b(e.includes(t),"'playbackRate' only accept ".concat(e.toString()," as parameters")),t!==i.dataset.playbackRate&&(r.playbackRate=t,i.dataset.playbackRate=t,a.show("".concat(o.get("Rate"),": ").concat(1===t?o.get("Normal"):"".concat(t,"x"))),n.emit("playbackRateChange",t))}}),Object.defineProperty(e,"playbackRateRemove",{value:function(){e.$playbackRateState&&(e.playbackRate(1),delete i.dataset.playbackRate,n.emit("playbackRateRemove"))}}),Object.defineProperty(e,"playbackRateReset",{value:function(){var t=i.dataset.playbackRate;t&&(e.playbackRate(Number(t)),n.emit("playbackRateReset"))}})}(e,this),function(f,p){var t=f.template,d=t.$video,h=t.$player,y=f.i18n,v=f.notice;Object.defineProperty(p,"aspectRatioState",{get:function(){return h.dataset.aspectRatio||""}}),Object.defineProperty(p,"aspectRatio",{value:function(t){var e=["default","4:3","16:9"];if(b(e.includes(t),"'aspectRatio' only accept ".concat(e.toString()," as parameters")),"default"===t)p.aspectRatioRemove();else{var n=t.split(":"),r=d.videoWidth,i=d.videoHeight,o=h.clientWidth,a=h.clientHeight,s=r/i,c=n[0]/n[1];if(c<s){var u=c*i/r;C(d,"width","".concat(100*u,"%")),C(d,"height","100%"),C(d,"padding","0 ".concat((o-o*u)/2,"px"))}else{var l=r/c/i;C(d,"width","100%"),C(d,"height","".concat(100*l,"%")),C(d,"padding","".concat((a-a*l)/2,"px 0"))}}h.dataset.aspectRatio=t,v.show("".concat(y.get("Aspect ratio"),": ").concat("default"===t?y.get("Default"):t)),f.emit("aspectRatioChange",t)}}),Object.defineProperty(p,"aspectRatioRemove",{value:function(){p.aspectRatioState&&(C(d,"width",null),C(d,"height",null),C(d,"padding",null),delete h.dataset.aspectRatio,f.emit("aspectRatioRemove"))}}),Object.defineProperty(p,"aspectRatioReset",{value:function(){var t=h.dataset.aspectRatio;t&&(p.aspectRatio(t),f.emit("aspectRatioReset"))}})}(e,this),function(e,t){var n=e.option,r=e.notice,i=e.template.$video;Object.defineProperty(t,"screenshot",{value:function(){try{var t=function(){var t=document.createElement("canvas");t.width=i.videoWidth,t.height=i.videoHeight,t.getContext("2d").drawImage(i,0,0);var e=t.toDataURL("image/png");return q(e,"".concat(n.title||"artplayer","_").concat(k(i.currentTime),".png")),e}();e.emit("screenshot",t)}catch(t){r.show(t),console.warn(t)}}})}(e,this),function(t,e){var n=t.notice,r=t.events.destroyEvents,i=t.template.$player,o=function(){t.emit("fullscreen",Y.isFullscreen)},a=function(){n.show("Your browser does not seem to support full screen functionality.")};try{Y.on("change",o),Y.on("error",a),r.push(function(){Y.off("change",o),Y.off("error",a)})}catch(t){console.error(t)}Object.defineProperty(e,"fullscreenState",{get:function(){return Y.isFullscreen}}),Object.defineProperty(e,"fullscreenEnabled",{value:function(){e.fullscreenWebState&&e.fullscreenWebExit(),i.classList.add("artplayer-fullscreen"),Y.request(i),e.aspectRatioReset(),t.emit("fullscreen:enabled")}}),Object.defineProperty(e,"fullscreenExit",{value:function(){e.fullscreenState&&(e.fullscreenWebExit(),i.classList.remove("artplayer-fullscreen"),Y.exit(),e.aspectRatioReset(),t.emit("fullscreen:exit"))}}),Object.defineProperty(e,"fullscreenToggle",{value:function(){e.fullscreenState?e.fullscreenExit():e.fullscreenEnabled()}})}(e,this),function(t,e){var n=t.template.$player;Object.defineProperty(e,"fullscreenWebState",{get:function(){return n.classList.contains("artplayer-web-fullscreen")}}),Object.defineProperty(e,"fullscreenWebEnabled",{value:function(){e.fullscreenState&&e.fullscreenExit(),n.classList.add("artplayer-web-fullscreen"),e.aspectRatioReset(),t.emit("fullscreenWeb:enabled")}}),Object.defineProperty(e,"fullscreenWebExit",{value:function(){e.fullscreenWebState&&(e.fullscreenExit(),n.classList.remove("artplayer-web-fullscreen"),e.aspectRatioReset(),t.emit("fullscreenWeb:exit"))}}),Object.defineProperty(e,"fullscreenWebToggle",{value:function(){e.fullscreenWebState?e.fullscreenWebExit():e.fullscreenWebEnabled()}})}(e,this),function(t,e){document.pictureInPictureEnabled?function(t,e){var n=t.notice,r=t.template.$video,i=t.events.proxy;r.disablePictureInPicture=!1,Object.defineProperty(e,"pipState",{get:function(){return document.pictureInPictureElement}}),Object.defineProperty(e,"pipEnabled",{value:function(){r.requestPictureInPicture().catch(function(t){n.show(t,!0,3e3),console.warn(t)})}}),Object.defineProperty(e,"pipExit",{value:function(){document.exitPictureInPicture().catch(function(t){n.show(t,!0,3e3),console.warn(t)})}}),i(r,"enterpictureinpicture",function(){t.emit("pipEnabled")}),i(r,"leavepictureinpicture",function(){t.emit("pipExit")}),t.on("destroy",function(){e.pipState&&e.pipExit()})}(t,e):function(t,e){var n=t.option,r=t.i18n,i=t.template,o=i.$player,a=i.$pipClose,s=i.$pipTitle,c=t.events,u=c.destroyEvents,l=c.proxy,f=null,p=null;Object.defineProperty(e,"pipState",{get:function(){return o.classList.contains("artplayer-pip")}}),Object.defineProperty(e,"pipEnabled",{value:function(){e.autoSizeState&&e.autoSizeRemove(),p?(C(o,"left","".concat(f.x,"px")),C(o,"top","".concat(f.y,"px"))):(p=new G(o,{handle:".artplayer-pip-header"}),O(s,n.title||r.get("Mini player")),l(a,"click",function(){e.pipExit()}),u.push(function(){p.destroy()})),o.classList.add("artplayer-pip"),e.fullscreenExit(),e.fullscreenWebExit(),e.aspectRatioRemove(),e.playbackRateRemove(),t.emit("pipEnabled")}}),Object.defineProperty(e,"pipExit",{value:function(){e.pipState&&(o.classList.remove("artplayer-pip"),f=p.position,C(o,"left",null),C(o,"top",null),e.fullscreenExit(),e.fullscreenWebExit(),e.aspectRatioRemove(),e.playbackRateRemove(),t.emit("pipExit"))}})}(t,e),Object.defineProperty(e,"pipToggle",{value:function(){e.pipState?e.pipExit():e.pipEnabled()}})}(e,this),function(t,e){var n=t.template.$video;Object.defineProperty(e,"loaded",{get:function(){return n.buffered.length?n.buffered.end(n.buffered.length-1)/n.duration:0}})}(e,this),function(t,e){Object.defineProperty(e,"played",{get:function(){return t.template.$video.currentTime/t.template.$video.duration}})}(e,this),function(t,e){var n=t.template.$video;Object.defineProperty(e,"playing",{get:function(){return!!(0<n.currentTime&&!n.paused&&!n.ended&&2<n.readyState)}})}(e,this),function(c,t){var e=c.template,u=e.$container,l=e.$player,f=e.$video;Object.defineProperty(t,"autoSizeState",{get:function(){return u.classList.contains("artplayer-auto-size")}}),Object.defineProperty(t,"autoSize",{value:function(){var t=f.videoWidth,e=f.videoHeight,n=u.getBoundingClientRect(),r=n.width,i=n.height,o=t/e,a=r/i;if(u.classList.add("artplayer-auto-size"),o<a)C(l,"width","".concat(i*o/r*100,"%")),C(l,"height","100%");else{var s=r/o/i*100;C(l,"width","100%"),C(l,"height","".concat(s,"%"))}c.emit("autoSizeChange")}}),Object.defineProperty(t,"autoSizeRemove",{value:function(){u.classList.remove("artplayer-auto-size"),C(l,"width",null),C(l,"height",null),c.emit("autoSizeRemove")}})}(e,this),function(n,t){Object.defineProperty(t,"flipState",{get:function(){return n.template.$player.dataset.flip}}),Object.defineProperty(t,"flip",{value:function(t){var e=["normal","horizontal","vertical"];b(e.includes(t),"'flip' only accept ".concat(e.toString()," as parameters")),n.template.$player.dataset.flip=t,n.emit("flipChange",t)}}),Object.defineProperty(t,"flipRemove",{value:function(){delete n.template.$player.dataset.flip,n.emit("flipRemove")}})}(e,this)};function tt(e,n,t,r,i,o){var a="function"==typeof r?r(e):r;if(!a.disable){n.id+=1;var s=a.name||"".concat(o).concat(n.id),c=document.createElement("div");c.classList.value="art-".concat(o," art-").concat(o,"-").concat(s),a.html&&O(c,a.html),a.style&&j(c,a.style),a.click&&e.events.proxy(c,"click",function(t){t.preventDefault(),a.click.call(n,t),e.emit("".concat(o,":click"),c)}),Object.defineProperty(a,"$ref",{get:function(){return c}}),Object.defineProperty(a,"hide",{value:function(){C(c,"display","none"),e.emit("".concat(o,":hide"),c)}}),Object.defineProperty(a,"show",{value:function(){C(c,"display","block"),e.emit("".concat(o,":show"),c)}}),R(t,c,a.index||n.id),a.mounted&&a.mounted(c),i&&i(c),n[s]=a,e.emit("".concat(o,":add"),a)}}var et,nt,rt=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(t){v(e,t,n[t])})}return e},it=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()},ot=(et={loading:'<svg xmlns="http://www.w3.org/2000/svg" width="50px" height="50px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-default">\n <rect x="0" y="0" width="100" height="100" fill="none" class="bk"/>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(0 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-1s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(30 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(60 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(90 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.75s" repeatCount="indefinite"/></rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(120 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(150 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(180 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.5s" repeatCount="indefinite"/></rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(210 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(240 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(270 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.25s" repeatCount="indefinite"/></rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(300 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(330 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"/>\n </rect>\n</svg>',playBig:'<svg xmlns="http://www.w3.org/2000/svg" height="60" width="60" style="filter: drop-shadow(0px 1px 1px black);" viewBox="0 0 24 24">\n <path d="M20,2H4C1.8,2,0,3.8,0,6v12c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V6C24,3.8,22.2,2,20,2z M15.6,12.8L10.5,16 C9.9,16.5,9,16,9,15.2V8.8C9,8,9.9,7.5,10.5,8l5.1,3.2C16.3,11.5,16.3,12.5,15.6,12.8z"/>\n</svg>',play:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M17.982 9.275L8.06 3.27A2.013 2.013 0 0 0 5 4.994v12.011a2.017 2.017 0 0 0 3.06 1.725l9.922-6.005a2.017 2.017 0 0 0 0-3.45z"></path>\n</svg>',pause:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M7 3a2 2 0 0 0-2 2v12a2 2 0 1 0 4 0V5a2 2 0 0 0-2-2zM15 3a2 2 0 0 0-2 2v12a2 2 0 1 0 4 0V5a2 2 0 0 0-2-2z"></path>\n</svg>',volume:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M10.188 4.65L6 8H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h1l4.188 3.35a.5.5 0 0 0 .812-.39V5.04a.498.498 0 0 0-.812-.39zM14.446 3.778a1 1 0 0 0-.862 1.804 6.002 6.002 0 0 1-.007 10.838 1 1 0 0 0 .86 1.806A8.001 8.001 0 0 0 19 11a8.001 8.001 0 0 0-4.554-7.222z"></path>\n <path d="M15 11a3.998 3.998 0 0 0-2-3.465v6.93A3.998 3.998 0 0 0 15 11z"></path>\n</svg>',volumeClose:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M15 11a3.998 3.998 0 0 0-2-3.465v2.636l1.865 1.865A4.02 4.02 0 0 0 15 11z"></path>\n <path d="M13.583 5.583A5.998 5.998 0 0 1 17 11a6 6 0 0 1-.585 2.587l1.477 1.477a8.001 8.001 0 0 0-3.446-11.286 1 1 0 0 0-.863 1.805zM18.778 18.778l-2.121-2.121-1.414-1.414-1.415-1.415L13 13l-2-2-3.889-3.889-3.889-3.889a.999.999 0 1 0-1.414 1.414L5.172 8H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h1l4.188 3.35a.5.5 0 0 0 .812-.39v-3.131l2.587 2.587-.01.005a1 1 0 0 0 .86 1.806c.215-.102.424-.214.627-.333l2.3 2.3a1.001 1.001 0 0 0 1.414-1.416zM11 5.04a.5.5 0 0 0-.813-.39L8.682 5.854 11 8.172V5.04z"></path>\n</svg>',subtitle:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 48 48">\n <path d="M0 0h48v48H0z" fill="none"/>\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"/>\n</svg>',screenshot:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 50 50">\n\t<path d="M 19.402344 6 C 17.019531 6 14.96875 7.679688 14.5 10.011719 L 14.097656 12 L 9 12 C 6.238281 12 4 14.238281 4 17 L 4 38 C 4 40.761719 6.238281 43 9 43 L 41 43 C 43.761719 43 46 40.761719 46 38 L 46 17 C 46 14.238281 43.761719 12 41 12 L 35.902344 12 L 35.5 10.011719 C 35.03125 7.679688 32.980469 6 30.597656 6 Z M 25 17 C 30.519531 17 35 21.480469 35 27 C 35 32.519531 30.519531 37 25 37 C 19.480469 37 15 32.519531 15 27 C 15 21.480469 19.480469 17 25 17 Z M 25 19 C 20.589844 19 17 22.589844 17 27 C 17 31.410156 20.589844 35 25 35 C 29.410156 35 33 31.410156 33 27 C 33 22.589844 29.410156 19 25 19 Z "/>\n</svg>\n',setting:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <circle cx="11" cy="11" r="2"></circle>\n <path d="M19.164 8.861L17.6 8.6a6.978 6.978 0 0 0-1.186-2.099l.574-1.533a1 1 0 0 0-.436-1.217l-1.997-1.153a1.001 1.001 0 0 0-1.272.23l-1.008 1.225a7.04 7.04 0 0 0-2.55.001L8.716 2.829a1 1 0 0 0-1.272-.23L5.447 3.751a1 1 0 0 0-.436 1.217l.574 1.533A6.997 6.997 0 0 0 4.4 8.6l-1.564.261A.999.999 0 0 0 2 9.847v2.306c0 .489.353.906.836.986l1.613.269a7 7 0 0 0 1.228 2.075l-.558 1.487a1 1 0 0 0 .436 1.217l1.997 1.153c.423.244.961.147 1.272-.23l1.04-1.263a7.089 7.089 0 0 0 2.272 0l1.04 1.263a1 1 0 0 0 1.272.23l1.997-1.153a1 1 0 0 0 .436-1.217l-.557-1.487c.521-.61.94-1.31 1.228-2.075l1.613-.269a.999.999 0 0 0 .835-.986V9.847a.999.999 0 0 0-.836-.986zM11 15a4 4 0 1 1 0-8 4 4 0 0 1 0 8z"></path>\n</svg>',fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36">\n\t<path d="m 10,16 2,0 0,-4 4,0 0,-2 L 10,10 l 0,6 0,0 z"></path>\n\t<path d="m 20,10 0,2 4,0 0,4 2,0 L 26,10 l -6,0 0,0 z"></path>\n\t<path d="m 24,24 -4,0 0,2 L 26,26 l 0,-6 -2,0 0,4 0,0 z"></path>\n\t<path d="M 12,20 10,20 10,26 l 6,0 0,-2 -4,0 0,-4 0,0 z"></path>\n</svg>',fullscreenWeb:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" height="36" width="36">\n\t<path d="m 28,11 0,14 -20,0 0,-14 z m -18,2 16,0 0,10 -16,0 0,-10 z" fill-rule="evenodd"></path>\n</svg>',pip:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" height="32" width="32">\n <path d="M25,17 L17,17 L17,23 L25,23 L25,17 L25,17 Z M29,25 L29,10.98 C29,9.88 28.1,9 27,9 L9,9 C7.9,9 7,9.88 7,10.98 L7,25 C7,26.1 7.9,27 9,27 L27,27 C28.1,27 29,26.1 29,25 L29,25 Z M27,25.02 L9,25.02 L9,10.97 L27,10.97 L27,25.02 L27,25.02 Z"></path>\n</svg>',prev:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36">\n <path d="m 12,12 h 2 v 12 h -2 z m 3.5,6 8.5,6 V 12 z"></path>\n</svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36">\n <path d="M 12,24 20.5,18 12,12 V 24 z M 22,12 v 12 h 2 V 12 h -2 z"></path>\n</svg>'},nt={},Object.keys(et).forEach(function(t){var e=document.createElement("div");e.innerHTML='<i class="art-icon art-icon-'.concat(t,'">').concat(et[t],"</i>");var n=it(e.childNodes,1);nt[t]=n[0]}),nt);function at(t,e){var n=t.template.$progress,r=t.player,i=n.getBoundingClientRect().left,o=w(e.x-i,0,n.clientWidth),a=o/n.clientWidth*r.duration;return{second:a,time:k(a),width:o,percentage:w(o/n.clientWidth,0,1)}}var st=function(){function n(t){var e=this;a(this,n),this.id=0,this.art=t,this.art.on("firstCanplay",function(){e.init()})}return i(n,[{key:"init",value:function(){var e=this,t=this.art.option;this.add(function(r){return function(l){var t=l.option,e=t.highlight,n=t.theme,f=l.events.proxy,p=l.player;return rt({},r,{html:'\n <div class="art-control-progress-inner">\n <div class="art-progress-loaded"></div>\n <div class="art-progress-played" style="background: '.concat(n,'"></div>\n <div class="art-progress-highlight"></div>\n <div class="art-progress-indicator" style="background: ').concat(n,'"></div>\n <div class="art-progress-tip art-tip"></div>\n </div>\n '),mounted:function(o){var i=!1,n=o.querySelector(".art-progress-loaded"),r=o.querySelector(".art-progress-played"),a=o.querySelector(".art-progress-highlight"),s=o.querySelector(".art-progress-indicator"),c=o.querySelector(".art-progress-tip");function u(t,e){"loaded"===t&&C(n,"width","".concat(100*e,"%")),"played"===t&&(C(r,"width","".concat(100*e,"%")),C(s,"left","calc(".concat(100*e,"% - ").concat(T(s,"width")/2,"px)")))}e.forEach(function(t){var e=w(t.time,0,p.duration)/p.duration*100;O(a,'<span data-text="'.concat(t.text,'" data-time="').concat(t.time,'" style="left: ').concat(e,'%"></span>'))}),u("loaded",p.loaded),l.on("video:progress",function(){u("loaded",p.loaded)}),l.on("video:timeupdate",function(){u("played",p.played)}),l.on("video:ended",function(){u("played",1)}),f(o,"mousemove",function(t){C(c,"display","block"),-1<t.composedPath().indexOf(a)?function(t){var e=t.target.dataset,n=e.text,r=e.time;c.innerHTML=n;var i=Number(r)/l.player.duration*o.clientWidth+t.target.clientWidth/2-c.clientWidth/2;C(c,"left","".concat(i,"px"))}(t):function(t){var e=at(l,t),n=e.width,r=e.time,i=c.clientWidth;c.innerHTML=r,n<=i/2?C(c,"left",0):n>o.clientWidth-i/2?C(c,"left","".concat(o.clientWidth-i,"px")):C(c,"left","".concat(n-i/2,"px"))}(t)}),f(o,"mouseout",function(){C(c,"display","none")}),f(o,"click",function(t){if(t.target!==s){var e=at(l,t),n=e.second;u("played",e.percentage),p.seek(n)}}),f(s,"mousedown",function(){i=!0}),f(document,"mousemove",function(t){if(i){var e=at(l,t),n=e.second,r=e.percentage;s.classList.add("art-show-indicator"),u("played",r),p.seek(n)}}),f(document,"mouseup",function(){i&&(i=!1,s.classList.remove("art-show-indicator"))})}})}}({name:"progress",disable:t.isLive,position:"top",index:10})),this.add(function(t){return function(h){return rt({},t,{mounted:function(p){var d=h.template.$progress,t=h.events,e=t.proxy,n=t.loadImg,r=!1,i=!1;e(d,"mousemove",function(t){r||(r=!0,n(h.option.thumbnails.url).then(function(){i=!0})),i&&(C(p,"display","block"),function(t){var e=at(h,t).width,n=h.option.thumbnails,r=n.url,i=n.height,o=n.width,a=n.number,s=n.column,c=d.clientWidth/a,u=Math.ceil(e/c),l=Math.ceil(u/s)-1,f=u%s||s-1;C(p,"backgroundImage","url(".concat(r,")")),C(p,"height","".concat(i,"px")),C(p,"width","".concat(o,"px")),C(p,"backgroundPosition","-".concat(f*o,"px -").concat(l*i,"px")),e<=o/2?C(p,"left",0):e>d.clientWidth-o/2?C(p,"left","".concat(d.clientWidth-o,"px")):C(p,"left","".concat(e-o/2,"px"))}(t))}),e(d,"mouseout",function(){C(p,"display","none")})}})}}({name:"thumbnails",disable:!t.thumbnails.url||t.isLive,position:"top",index:20})),this.add(function(t){return function(c){return rt({},t,{mounted:function(t){var e=c.events.proxy,n=c.player,r=c.i18n,i=O(t,ot.play),o=O(t,ot.pause);function a(){C(i,"display","flex"),C(o,"display","none")}function s(){C(i,"display","none"),C(o,"display","flex")}A(i,r.get("Play")),A(o,r.get("Pause")),e(i,"click",function(){n.play()}),e(o,"click",function(){n.pause()}),n.playing?s():a(),c.on("video:playing",function(){s()}),c.on("video:pause",function(){a()})}})}}({name:"playAndPause",disable:!1,position:"left",index:10})),this.add(function(t){return function(f){return rt({},t,{mounted:function(t){var e=f.events.proxy,i=f.player,n=f.i18n,r=!1,o=O(t,ot.volume),a=O(t,ot.volumeClose),s=O(t,'<div class="art-volume-panel"></div>'),c=O(s,'<div class="art-volume-slider-handle"></div>');function u(t){var e=s.getBoundingClientRect(),n=e.left,r=e.width,i=c.getBoundingClientRect().width;return w(t.x-n-i/2,0,r-i/2)/(r-i)}function l(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:.7;if(i.muted||0===t)C(o,"display","none"),C(a,"display","flex"),C(c,"left","0");else{var e=T(s,"width")||60,n=T(c,"width"),r=n/2+(e-n)*t-n/2;C(o,"display","flex"),C(a,"display","none"),C(c,"left","".concat(r,"px"))}}A(o,n.get("Mute")),C(a,"display","none"),l(i.volume),f.on("video:volumechange",function(){l(i.volume)}),e(o,"click",function(){i.muted=!0}),e(a,"click",function(){i.muted=!1}),e(s,"click",function(t){i.muted=!1,i.volume=u(t)}),e(c,"mousedown",function(){r=!0}),e(c,"mousemove",function(t){r&&(i.muted=!1,i.volume=u(t))}),e(document,"mouseup",function(){r&&(r=!1)})}})}}({name:"volume",disable:!1,position:"left",index:20})),this.add(function(t){return function(r){return rt({},t,{mounted:function(e){function n(){var t="".concat(k(r.player.currentTime)," / ").concat(k(r.player.duration));t!==e.innerHTML&&(e.innerHTML=t)}n(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach(function(t){r.on(t,n)})}})}}({name:"time",disable:t.isLive,position:"left",index:30})),this.add(function(t){return function(i){return rt({},t,{mounted:function(t){var o=i.option,e=i.events.proxy,a=i.player,s=-1,n=o.quality.find(function(t){return t.default})||o.quality[0];s=o.quality.indexOf(n);var c=O(t,'<div class="art-quality-name">'.concat(n.name,"</div>")),r=o.quality.map(function(t,e){return'<div class="art-quality-item" data-index="'.concat(e,'">').concat(t.name,"</div>")}).join("");e(O(t,'<div class="art-qualitys">'.concat(r,"</div>")),"click",function(t){var e=Number(t.target.dataset.index),n=o.quality[e],r=n.url,i=n.name;r&&i&&s!==e&&(a.switchQuality(r,i),c.innerHTML=i,s=e)})}})}}({name:"quality",disable:0===t.quality.length,position:"right",index:10})),this.add(function(t){return function(o){return rt({},t,{mounted:function(t){var e=o.events.proxy,n=o.i18n,r=o.player,i=O(t,ot.screenshot);A(i,n.get("Screenshot")),e(i,"click",function(){r.screenshot()})}})}}({name:"screenshot",disable:!t.screenshot,position:"right",index:20})),this.add(function(t){return function(o){return rt({},t,{mounted:function(t){var e=o.events.proxy,n=o.i18n,r=o.subtitle,i=O(t,ot.subtitle);A(i,n.get("Hide subtitle")),e(t,"click",function(){r.toggle()}),o.on("subtitle:show",function(){C(i,"opacity","1"),A(i,n.get("Hide subtitle"))}),o.on("subtitle:hide",function(){C(i,"opacity","0.8"),A(i,n.get("Show subtitle"))})}})}}({name:"subtitle",disable:!t.subtitle.url,position:"right",index:30})),this.add(function(t){return function(o){return rt({},t,{mounted:function(t){var e=o.events.proxy,n=o.i18n,r=o.setting,i=O(t,ot.setting);A(i,n.get("Show setting")),e(t,"click",function(){r.toggle()}),o.on("setting:show",function(){C(i,"opacity","0.8"),A(i,n.get("Hide setting"))}),o.on("setting:hide",function(){C(i,"opacity","1"),A(i,n.get("Show setting"))})}})}}({name:"setting",disable:!t.setting,position:"right",index:40})),this.add(function(t){return function(i){return rt({},t,{mounted:function(t){var e=i.events.proxy,n=i.i18n,r=i.player;A(O(t,ot.pip),n.get("Mini player")),e(t,"click",function(){r.pipEnabled()})}})}}({name:"pip",disable:!t.pip,position:"right",index:50})),this.add(function(t){return function(o){return rt({},t,{mounted:function(t){var e=o.events.proxy,n=o.i18n,r=o.player,i=O(t,ot.fullscreenWeb);A(i,n.get("Web fullscreen")),e(t,"click",function(){r.fullscreenWebToggle()}),o.on("fullscreenWeb:enabled",function(){C(i,"opacity","0.8"),A(i,n.get("Exit web fullscreen"))}),o.on("fullscreenWeb:exit",function(){C(i,"opacity","1"),A(i,n.get("Web fullscreen"))})}})}}({name:"fullscreenWeb",disable:!t.fullscreenWeb,position:"right",index:60})),this.add(function(t){return function(o){return rt({},t,{mounted:function(t){var e=o.events.proxy,n=o.i18n,r=o.player,i=O(t,ot.fullscreen);A(i,n.get("Fullscreen")),e(t,"click",function(){r.fullscreenToggle()}),o.on("fullscreen:enabled",function(){C(i,"opacity","0.8"),A(i,n.get("Exit fullscreen"))}),o.on("fullscreen:exit",function(){C(i,"opacity","1"),A(i,n.get("Fullscreen"))})}})}}({name:"fullscreen",disable:!t.fullscreen,position:"right",index:70})),t.controls.forEach(function(t){e.add(t)})}},{key:"add",value:function(t,e){var n,r="function"==typeof t?t(this.art):t,i=this.art.template,o=i.$progress,a=i.$controlsLeft,s=i.$controlsRight;switch(r.position){case"top":n=o;break;case"left":n=a;break;case"right":n=s}n&&tt(this.art,this,n,r,e,"control")}},{key:"show",value:function(){this.art.template.$player.classList.add("artplayer-controls-show")}},{key:"hide",value:function(){this.art.template.$player.classList.remove("artplayer-controls-show")}}]),n}(),ct=function(){function n(t){var e=this;a(this,n),this.id=0,this.art=t,this.art.on("firstCanplay",function(){e.init()})}return i(n,[{key:"init",value:function(){var e=this,t=this.art,n=t.option,r=t.template,i=r.$player,o=r.$contextmenu,a=t.events.proxy;this.add(function(e){return function(n){var t=n.i18n,r=n.player;return rt({},e,{html:"\n ".concat(t.get("Play speed"),':\n <span data-rate="0.5">0.5</span>\n <span data-rate="0.75">0.75</span>\n <span data-rate="1.0" class="normal current">').concat(t.get("Normal"),'</span>\n <span data-rate="1.25">1.25</span>\n <span data-rate="1.5">1.5</span>\n <span data-rate="2.0">2.0</span>\n '),click:function(t){var e=t.target.dataset.rate;e&&(r.playbackRate(Number(e)),n.contextmenu.hide())},mounted:function(t){n.on("playbackRateChange",function(e){M(Array.from(t.querySelectorAll("span")).find(function(t){return Number(t.dataset.rate)===e}),"current")})}})}}({disable:!n.playbackRate,name:"playbackRate",index:10})),this.add(function(e){return function(n){var t=n.i18n,r=n.player;return rt({},e,{html:"\n ".concat(t.get("Aspect ratio"),':\n <span data-ratio="default" class="default current">').concat(t.get("Default"),'</span>\n <span data-ratio="4:3">4:3</span>\n <span data-ratio="16:9">16:9</span>\n '),click:function(t){var e=t.target.dataset.ratio;e&&(r.aspectRatio(e),n.contextmenu.hide())},mounted:function(t){n.on("aspectRatioChange",function(e){M(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.ratio===e}),"current")})}})}}({disable:!n.aspectRatio,name:"aspectRatio",index:20})),this.add(function(e){return function(t){return rt({},e,{html:t.i18n.get("Video info"),click:function(){t.info.show(),t.contextmenu.hide()}})}}({disable:!1,name:"info",index:30})),this.add(rt({},{disable:!1,name:"version",index:40},{html:'<a href="https://github.com/zhw2590582/artplayer" target="_blank">ArtPlayer 1.0.7</a>'})),this.add(function(e){return function(t){return rt({},e,{html:t.i18n.get("Close"),click:function(){t.contextmenu.hide()}})}}({disable:!1,name:"close",index:50})),n.contextmenu.forEach(function(t){e.add(t)}),a(i,"contextmenu",function(t){t.preventDefault(),e.show(),e.setPos(t)}),a(i,"click",function(t){t.composedPath().includes(o)||e.hide()})}},{key:"add",value:function(t,e){var n=this.art.template.$contextmenu;tt(this.art,this,n,t,e,"contextmenu")}},{key:"setPos",value:function(t){var e=this.art.template,n=e.$player,r=e.$contextmenu,i=t.clientX,o=t.clientY,a=n.getBoundingClientRect(),s=a.height,c=a.width,u=a.left,l=a.top,f=r.getBoundingClientRect(),p=f.height,d=f.width,h=i-u,y=o-l;u+c<i+d&&(h=c-d),l+s<o+p&&(y=s-p),C(r,"left","".concat(h,"px")),C(r,"top","".concat(y,"px"))}},{key:"hide",value:function(){var t=this.art.template.$contextmenu;C(t,"display","none"),this.art.emit("contextmenu:hide",t)}},{key:"show",value:function(){var t=this.art.template.$contextmenu;C(t,"display","block"),this.art.emit("contextmenu:show",t)}}]),n}(),ut=function(){function e(t){a(this,e),this.art=t,this.init()}return i(e,[{key:"init",value:function(){var t=this,e=this.art,n=e.template.$infoClose;(0,e.events.proxy)(n,"click",function(){t.hide()})}},{key:"show",value:function(){var t=this.art.template,e=t.$info,n=t.$infoPanel;C(e,"display","block"),n.innerHTML||O(n,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show",e)}},{key:"creatInfo",value:function(){var t=[];return t.push('\n <div class="art-info-item ">\n <div class="art-info-title">Player version:</div>\n <div class="art-info-content">1.0.7</div>\n </div>\n '),t.push('\n <div class="art-info-item">\n <div class="art-info-title">Video url:</div>\n <div class="art-info-content">'.concat(this.art.option.url,"</div>\n </div>\n ")),t.push('\n <div class="art-info-item">\n <div class="art-info-title">Video volume:</div>\n <div class="art-info-content" data-video="volume"></div>\n </div>\n '),t.push('\n <div class="art-info-item">\n <div class="art-info-title">Video time:</div>\n <div class="art-info-content" data-video="currentTime"></div>\n </div>\n '),t.push('\n <div class="art-info-item">\n <div class="art-info-title">Video duration:</div>\n <div class="art-info-content" data-video="duration"></div>\n </div>\n '),t.push('\n <div class="art-info-item">\n <div class="art-info-title">Video resolution:</div>\n <div class="art-info-content">\n <span data-video="videoWidth"></span> x <span data-video="videoHeight"></span>\n </div>\n </div>\n '),t.join("")}},{key:"readInfo",value:function(){var t=this.art.template,e=t.$infoPanel,n=t.$video;Array.from(e.querySelectorAll("[data-video]")).forEach(function(t){var e=n[t.dataset.video];t.innerHTML=void 0!==e?e:"unknown"})}},{key:"loop",value:function(){var t=this;this.readInfo(),this.timer=setTimeout(function(){t.readInfo(),t.loop()},1e3)}},{key:"hide",value:function(){var t=this.art.template.$info;C(t,"display","none"),clearTimeout(this.timer),this.art.emit("info:hide",t)}}]),e}(),lt=function(){function n(t){a(this,n),this.art=t,this.state=!0;var e=this.art.option.subtitle.url;e&&this.init(e)}return i(n,[{key:"init",value:function(t){var r=this,e=this.art,i=e.events.proxy,n=e.option.subtitle,o=e.template,a=o.$video,s=o.$subtitle,c=o.$track;if(j(s,n.style||{}),!c){var u=document.createElement("track");u.default=!0,u.kind="metadata",a.appendChild(u),this.art.template.$track=u}this.load(t).then(function(t){if(r.art.template.$track.src=t,r.art.emit("subtitle:load",t),a.textTracks&&a.textTracks[0]){var n=it(a.textTracks,1)[0];i(n,"cuechange",function(){var t=it(n.activeCues,1)[0];if(s.innerHTML="",t){var e=document.createElement("div");e.appendChild(t.getCueAsHTML()),s.innerHTML=e.innerHTML.split(/\r?\n/).map(function(t){return"<p>".concat(t,"</p>")}).join("")}r.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,r=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?z(D(t)):e}).catch(function(t){r.show(t),console.warn(t)})}},{key:"show",value:function(){var t=this.art,e=t.template.$subtitle,n=t.i18n,r=t.notice;C(e,"display","block"),this.state=!0,r.show(n.get("Show subtitle")),this.art.emit("subtitle:show",e)}},{key:"hide",value:function(){var t=this.art,e=t.template.$subtitle,n=t.i18n,r=t.notice;C(e,"display","none"),this.state=!1,r.show(n.get("Hide subtitle")),this.art.emit("subtitle:hide",e)}},{key:"toggle",value:function(){this.state?this.hide():this.show()}}]),n}(),ft=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ContentRect=function(t){if("getBBox"in t){var e=t.getBBox();return Object.freeze({height:e.height,left:0,top:0,width:e.width})}var n=window.getComputedStyle(t);return Object.freeze({height:parseFloat(n.height||"0"),left:parseFloat(n.paddingLeft||"0"),top:parseFloat(n.paddingTop||"0"),width:parseFloat(n.width||"0")})}});t(ft),ft.ContentRect;var pt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.target=t,this.$$broadcastWidth=this.$$broadcastHeight=0}return Object.defineProperty(t.prototype,"broadcastWidth",{get:function(){return this.$$broadcastWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"broadcastHeight",{get:function(){return this.$$broadcastHeight},enumerable:!0,configurable:!0}),t.prototype.isActive=function(){var t=ft.ContentRect(this.target);return!!t&&(t.width!==this.broadcastWidth||t.height!==this.broadcastHeight)},t}();e.ResizeObservation=n});t(pt),pt.ResizeObservation;var dt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ResizeObserverEntry=function(t){this.target=t,this.contentRect=ft.ContentRect(t)}});t(dt),dt.ResizeObserverEntry;var ht=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=[],r=function(){function t(t){this.$$observationTargets=[],this.$$activeTargets=[],this.$$skippedTargets=[];var e=function(t){return void 0===t?"Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.":"function"!=typeof t?"Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.":void 0}(t);if(e)throw TypeError(e);this.$$callback=t,n.push(this)}return t.prototype.observe=function(t){var e=i("observe",t);if(e)throw TypeError(e);0<o(this.$$observationTargets,t)||(this.$$observationTargets.push(new pt.ResizeObservation(t)),l())},t.prototype.unobserve=function(t){var e=i("unobserve",t);if(e)throw TypeError(e);var n=o(this.$$observationTargets,t);n<0||(this.$$observationTargets.splice(n,1),p())},t.prototype.disconnect=function(){this.$$observationTargets=[],this.$$activeTargets=[]},t}();function i(t,e){return void 0===e?"Failed to execute '"+t+"' on 'ResizeObserver': 1 argument required, but only 0 present.":e instanceof window.Element?void 0:"Failed to execute '"+t+"' on 'ResizeObserver': parameter 1 is not of type 'Element'."}function o(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1}e.ResizeObserver=r;var a,s=function(r){n.forEach(function(n){n.$$activeTargets=[],n.$$skippedTargets=[],n.$$observationTargets.forEach(function(t){if(t.isActive()){var e=u(t.target);r<e?n.$$activeTargets.push(t):n.$$skippedTargets.push(t)}})})},c=function(){var i=1/0;return n.forEach(function(t){if(t.$$activeTargets.length){var r=[];t.$$activeTargets.forEach(function(t){var e=new dt.ResizeObserverEntry(t.target);r.push(e),t.$$broadcastWidth=e.contentRect.width,t.$$broadcastHeight=e.contentRect.height;var n=u(t.target);n<i&&(i=n)}),t.$$callback(r,t),t.$$activeTargets=[]}}),i},u=function(t){for(var e=0;t.parentNode;)t=t.parentNode,e+=1;return e},l=function(){a||f()},f=function(){a=window.requestAnimationFrame(function(){(function(){var t=0;for(s(t);n.some(function(t){return!!t.$$activeTargets.length});)t=c(),s(t);n.some(function(t){return!!t.$$skippedTargets.length})&&function(){var t=new window.ErrorEvent("ResizeLoopError",{message:"ResizeObserver loop completed with undelivered notifications."});window.dispatchEvent(t)}()})(),f()})},p=function(){a&&!n.some(function(t){return!!t.$$observationTargets.length})&&(window.cancelAnimationFrame(a),a=void 0)};e.install=function(){return window.ResizeObserver=r}});t(ht);var yt=ht.ResizeObserver;ht.install;var vt=function(){function n(t){var e=this;a(this,n),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),t.on("firstCanplay",function(){!function(e,t){var n=e.template.$player;t.proxy(document,["click","contextmenu"],function(t){-1<t.composedPath().indexOf(n)?e.isFocus=!0:(e.isFocus=!1,e.contextmenu.hide())})}(t,e),function(t,e){var n=t.template.$player;e.hover(n,function(){n.classList.add("artplayer-hover"),t.emit("hoverenter")},function(){n.classList.remove("artplayer-hover"),t.emit("hoverleave")})}(t,e),function(e,t){var n=e.template,r=n.$player,i=n.$video,o=e.player,a=E(function(){r.classList.add("artplayer-hide-cursor"),r.classList.remove("artplayer-hover"),e.controls.hide()},5e3);e.on("hoverleave",function(){o.playing&&a()}),t.proxy(r,"mousemove",function(t){a.clearTimeout(),r.classList.remove("artplayer-hide-cursor"),e.controls.show(),!e.player.pipState&&o.playing&&t.target===i&&a()})}(t,e),function(t,e){var n=t.option,r=t.template.$player,i=new yt(function(){n.autoSize&&(t.player.fullscreenState||t.player.fullscreenWebState||t.player.pipState?t.player.autoSizeRemove():t.player.autoSize()),t.player.aspectRatioReset(),t.emit("resize",r)});i.observe(r),e.destroyEvents.push(function(){i.unobserve(r)})}(t,e)})}return i(n,[{key:"proxy",value:function(e,t,n){var r=this,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};Array.isArray(t)?t.forEach(function(t){return r.proxy(e,t,n,i)}):(e.addEventListener(t,n,i),this.destroyEvents.push(function(){e.removeEventListener(t,n,i)}))}},{key:"hover",value:function(t,e,n){this.proxy(t,"mouseenter",e),this.proxy(t,"mouseleave",n)}},{key:"loadImg",value:function(r){var i=this;return new Promise(function(t,e){var n;if(r instanceof HTMLImageElement)n=r;else{if("string"!=typeof r)return e(r);(n=new Image).src=r}return n.complete?t(n):(i.proxy(n,"load",function(){return t(n)}),i.proxy(n,"error",function(){return e(n)}),r)})}},{key:"destroy",value:function(){this.destroyEvents.forEach(function(t){return t()})}}]),n}(),mt=function(){function n(t){var e=this;a(this,n),this.art=t,this.art.option.hotkey&&this.art.on("firstCanplay",function(){e.init()})}return i(n,[{key:"init",value:function(){var r=this,t=this.art,i=t.player;(0,t.events.proxy)(window,"keydown",function(t){if(r.art.isFocus){var e=document.activeElement.tagName.toUpperCase(),n=document.activeElement.getAttribute("contenteditable");if("INPUT"!==e&&"TEXTAREA"!==e&&""!==n&&"true"!==n)switch(r.art.emit("hotkey",t),t.keyCode){case 39:t.preventDefault(),i.seek(i.currentTime+10);break;case 37:t.preventDefault(),i.seek(i.currentTime-10);break;case 38:t.preventDefault(),i.volume+=.05;break;case 40:t.preventDefault(),i.volume-=.05;break;case 32:t.preventDefault(),i.toggle()}}})}}]),n}(),gt=function(){function n(t){var e=this;a(this,n),this.id=0,this.art=t,this.add=this.add.bind(this),this.art.option.layers.forEach(function(t){e.add(t)})}return i(n,[{key:"add",value:function(t,e){var n=this.art.template.$layers;tt(this.art,this,n,t,e,"layer")}},{key:"show",value:function(){var t=this.art.template.$layers;C(t,"display","block"),this.art.emit("layers:show",t)}},{key:"hide",value:function(){var t=this.art.template.$layers;C(t,"display","none"),this.art.emit("layers:hide",t)}}]),n}(),bt=function(){function n(t){a(this,n);var e=(this.art=t).option;O(t.template.$loading,e.icons.loading||ot.loading)}return i(n,[{key:"hide",value:function(){var t=this.art.template.$loading;C(t,"display","none"),this.art.emit("loading:hide",t)}},{key:"show",value:function(){var t=this.art.template.$loading;C(t,"display","flex"),this.art.emit("loading:show",t)}}]),n}(),wt=function(){function e(t){a(this,e),this.art=t,this.timer=null}return i(e,[{key:"show",value:function(t){var e=this,n=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1e3,i=this.art.template,o=i.$notice,a=i.$noticeInner;C(o,"display","block"),a.innerHTML=t instanceof Error?t.message.trim():t,clearTimeout(this.timer),n&&(this.timer=setTimeout(function(){e.hide()},r)),this.art.emit("notice:show",o)}},{key:"hide",value:function(){var t=this.art.template.$notice;C(t,"display","none"),this.art.emit("notice:hide",t)}}]),e}(),xt=function(){function n(t){a(this,n);var e=(this.art=t).option;O(O(t.template.$mask,'<div class="art-playBig"></div>'),e.icons.playBig||ot.playBig)}return i(n,[{key:"show",value:function(){var t=this.art.template.$mask;C(t,"display","flex"),this.art.emit("mask:show",t)}},{key:"hide",value:function(){var t=this.art.template.$mask;C(t,"display","none"),this.art.emit("mask:show",t)}}]),n}(),kt=function(){function n(t){var e=this;a(this,n),this.id=0,this.art=t,this.state=!1,t.option.setting&&this.art.on("firstCanplay",function(){e.init()})}return i(n,[{key:"init",value:function(){var t=this,e=this.art,n=e.template.$settingClose;(0,e.events.proxy)(n,"click",function(){t.hide()}),this.add(function(r){return function(e){var t=e.i18n,n=e.player;return rt({},r,{html:'\n <div class="art-setting-header">'.concat(t.get("Flip"),'</div>\n <div class="art-setting-body">\n <div class="art-setting-btns">\n <div class="art-setting-btn current">\n <span data-flip="normal">').concat(t.get("Normal"),'</span>\n </div>\n <div class="art-setting-btn">\n <span data-flip="horizontal">').concat(t.get("Horizontal"),'</span>\n </div>\n <div class="art-setting-btn">\n <span data-flip="vertical">').concat(t.get("Vertical"),"</span>\n </div>\n </div>\n </div>\n "),click:function(t){var e=t.target.dataset.flip;e&&n.flip(e)},mounted:function(t){e.on("flipChange",function(e){M(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.flip===e}).parentElement,"current")})}})}}({disable:!1,name:"flip",index:10}))}},{key:"add",value:function(t,e){var n=this.art.template.$settingBody;tt(this.art,this,n,t,e,"setting")}},{key:"show",value:function(){var t=this.art.template.$setting;C(t,"display","flex"),this.state=!0,this.art.emit("setting:show",t)}},{key:"hide",value:function(){var t=this.art.template.$setting;C(t,"display","none"),this.state=!1,this.art.emit("setting:hide",t)}},{key:"toggle",value:function(){this.state?this.hide():this.show()}}]),n}(),St=function(){function e(t){a(this,e),this.art=t,this.storageName="artplayer_settings",this.init()}return i(e,[{key:"init",value:function(){var t=this.art.option,e=this.get("volume");e&&(t.volume=e)}},{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.storageName))||{};return t?e[t]:{}}},{key:"set",value:function(t,e){var n=Object.assign({},this.get(),v({},t,e));localStorage.setItem(this.storageName,JSON.stringify(n))}}]),e}();function Et(r){var t=r.i18n,i=r.events.proxy;return{title:"Subtitle",name:"subtitle",index:20,html:'\n <div class="art-setting-header">\n '.concat(t.get("Subtitle offset time"),': <span class="art-subtitle-value">0</span>s\n </div>\n <div class="art-setting-body">\n <input\n style="width: 100%;height: 3px;outline: none;appearance: none;-moz-appearance: none;-webkit-appearance: none;background-color: #fff;"\n class="art-subtitle-range"\n type="range"\n min="-5"\n max="5"\n step="0.5"\n >\n </div>\n '),mounted:function(t){var e=t.querySelector(".art-subtitle-range"),n=t.querySelector(".art-subtitle-value");i(e,"change",function(){var t=e.value;n.innerText=t,r.plugins.subtitle.offset(Number(t))}),r.on("subtitle:switch",function(){e.value=0,n.innerText=0}),r.on("artplayerPluginSubtitle:set",function(t){e.value!==t&&(e.value=t,n.innerText=t)})}}}function Pt(r){var i=r.constructor.utils.clamp,t=r.setting,o=r.notice,a=r.template,s=r.i18n;!function(t){t.update({"zh-cn":{"Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},"zh-tw":{"Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"}})}(s),t.add(Et);var c=[];return r.on("subtitle:switch",function(){c=[]}),{name:"subtitle",offset:function(t){if(a.$track&&a.$track.track){var e=Array.from(a.$track.track.cues),n=i(t,-5,5);e.forEach(function(t,e){c[e]||(c[e]={startTime:t.startTime,endTime:t.endTime}),t.startTime=c[e].startTime+n,t.endTime=c[e].endTime+n}),o.show("".concat(s.get("Subtitle offset time"),": ").concat(t,"s")),r.emit("artplayerPluginSubtitle:set",t)}else o.show("".concat(s.get("No subtitles found"))),r.emit("artplayerPluginSubtitle:set",0)}}}function $t(i){var t=i.constructor.utils,n=t.append,r=t.setStyle,o=t.setStyles,a=t.sleep,s=i.events.proxy,c=i.option,u=i.notice,l=i.i18n,f=i.template,p=i.player;function d(t){if(t){var e=f.$video.canPlayType(t.type);if("maybe"===e||"probably"===e){var n=URL.createObjectURL(t);p.playbackRateRemove(),p.aspectRatioRemove(),f.$video.src=n,a(1e3).then(function(){p.currentTime=0}),c.url=n,i.emit("switch",n),u.show(l.get("Load local video successfully"))}else{var r="".concat(l.get("Playback of this file format is not supported"),": ").concat(t.type);u.show(r,!0,3e3),console.warn(r)}}}return function(t){t.update({"zh-cn":{"Playback of this file format is not supported":"不支持播放该文件格式","Load local video successfully":"加载本地视频成功"},"zh-tw":{"Playback of this file format is not supported":"不支持播放該文件格式","Load local video successfully":"加載本地視頻成功"}})}(l),s(f.$player,"dragover",function(t){t.preventDefault(),u.show(l.get("Load local video successfully"))}),s(f.$player,"drop",function(t){t.preventDefault(),d(t.dataTransfer.files[0])}),{name:"localPreview",attach:function(t){var e=n(t,'<input type="file">');r(t,"position","relative"),o(e,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),s(e,"change",function(){d(e.files[0])})}}}var _t=function(){function n(t){var e=this;a(this,n),this.art=t,this.id=0,this.add(Pt),this.add($t),t.option.plugins.forEach(function(t){e.add(t)})}return i(n,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art);return this[e&&e.name?e.name:t.name?t.name:"plugin".concat(this.id)]=e,this.art.emit("plugin:add",t),this}}]),n}(),Ot=function t(e){a(this,t);var n=e.option,r=e.template.$video;Object.keys(n.moreVideoAttr).forEach(function(t){r[t]=n.moreVideoAttr[t]}),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=w(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),r.controls=!0;var i=n.type||x(n.url),o=n.customType[i];i&&o?(e.emit("beforeCustomType",i),o(r,n.url,e),e.emit("afterCustomType",i)):(e.emit("beforeAttachUrl",n.url),r.src=n.url,e.emit("afterAttachUrl",r.src))},Rt=0,Ct=function(t){function n(t){var e;return a(this,n),e=c(this,u(n).call(this)),b("function"==typeof window.Promise,"Unsupported 'Promise' method"),e.option=_(n.DEFAULTS,t),y(e.option,F),e.init(),e}return f(n,d),i(n,[{key:"init",value:function(){this.whitelist=new H(this),this.template=new B(this),this.whitelist.state?(this.isFocus=!1,this.storage=new St(this),this.i18n=new V(this),this.notice=new wt(this),this.events=new vt(this),this.player=new K(this),this.layers=new gt(this),this.controls=new st(this),this.contextmenu=new ct(this),this.subtitle=new lt(this),this.info=new ut(this),this.loading=new bt(this),this.hotkey=new mt(this),this.mask=new xt(this),this.setting=new kt(this),this.plugins=new _t(this)):this.mobile=new Ot(this),Rt+=1,this.id=Rt,n.instances.push(this)}},{key:"destroy",value:function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.events&&this.events.destroy(),this.template.destroy(t),n.instances.splice(n.instances.indexOf(this),1),this.emit("destroy")}}],[{key:"version",get:function(){return"1.0.7"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return N}},{key:"utils",get:function(){return W}},{key:"DEFAULTS",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",type:"",mimeCodec:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,loop:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,fullscreen:!1,fullscreenWeb:!1,layers:[],contextmenu:[],quality:[],controls:[],highlight:[],plugins:[],whitelist:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{}},moreVideoAttr:{controls:!1,preload:"auto"},icons:{loading:"",playBig:""},customType:{},lang:navigator.language.toLowerCase()}}}]),n}();return Object.defineProperty(Ct,"instances",{value:[]}),window.Artplayer=Ct}()}),ft=(st=lt)&&st.__esModule&&Object.prototype.hasOwnProperty.call(st,"default")?st.default:st;return function(t){function n(t){var e;return c(this,n),e=l(this,f(n).call(this,t)),ft.utils.errorHandle(t.option&&"object"===s(t.option),"The prop 'option' object cannot be missing"),e.instance=null,e.artRef=ut.createRef(),e}return d(n,t),e(n,[{key:"componentDidMount",value:function(){var t=this.props,e=t.option,n=t.getInstance;this.instance=new ft(o({},e,{container:this.artRef.current})),n&&"function"==typeof n&&n(this.instance)}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.destroy&&this.instance.destroy()}},{key:"render",value:function(){var t=this.props,e=(t.option,t.getInstance,r(t,["option","getInstance"]));return ut.createElement("div",o({ref:this.artRef},e))}}]),n}(ut.Component)});