mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 03:46:16 -08:00
9 lines
113 KiB
JavaScript
9 lines
113 KiB
JavaScript
/*!
|
|
* artplayer-react.js v3.2.4
|
|
* Github: https://github.com/zhw2590582/ArtPlayer#readme
|
|
* (c) 2017-2019 Harvey Zack
|
|
* Released under the MIT License.
|
|
*/
|
|
|
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).ArtplayerReact=t()}(this,(function(){"use strict";var e=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o};var t=function(t,n){if(null==t)return{};var r,o,i=e(t,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o<a.length;o++)r=a[o],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i};var n=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(e,t){return e(t={exports:{}},t.exports),t.exports}var o=r((function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(r){return"function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?e.exports=n=function(e){return t(e)}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},n(r)}e.exports=n}));var i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var c=function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e};var u=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};var s=function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?u(e):t},l=r((function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t})),f=r((function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t}));var p=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)},d=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;function v(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var m=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,o=v(e),i=1;i<arguments.length;i++){for(var a in n=Object(arguments[i]))h.call(n,a)&&(o[a]=n[a]);if(d){r=d(n);for(var c=0;c<r.length;c++)y.call(n,r[c])&&(o[r[c]]=n[r[c]])}}return o},g="function"==typeof Symbol&&Symbol.for,b=g?Symbol.for("react.element"):60103,w=g?Symbol.for("react.portal"):60106,O=g?Symbol.for("react.fragment"):60107,j=g?Symbol.for("react.strict_mode"):60108,k=g?Symbol.for("react.profiler"):60114,x=g?Symbol.for("react.provider"):60109,P=g?Symbol.for("react.context"):60110,S=g?Symbol.for("react.forward_ref"):60112,E=g?Symbol.for("react.suspense"):60113,R=g?Symbol.for("react.memo"):60115,C=g?Symbol.for("react.lazy"):60116,$="function"==typeof Symbol&&Symbol.iterator;function D(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_={};function A(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||T}function L(){}function M(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||T}A.prototype.isReactComponent={},A.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(D(85));this.updater.enqueueSetState(this,e,t,"setState")},A.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},L.prototype=A.prototype;var q=M.prototype=new L;q.constructor=M,m(q,A.prototype),q.isPureReactComponent=!0;var z={current:null},I={current:null},V=Object.prototype.hasOwnProperty,F={key:!0,ref:!0,__self:!0,__source:!0};function W(e,t,n){var r,o={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)V.call(t,r)&&!F.hasOwnProperty(r)&&(o[r]=t[r]);var c=arguments.length-2;if(1===c)o.children=n;else if(1<c){for(var u=Array(c),s=0;s<c;s++)u[s]=arguments[s+2];o.children=u}if(e&&e.defaultProps)for(r in c=e.defaultProps)void 0===o[r]&&(o[r]=c[r]);return{$$typeof:b,type:e,key:i,ref:a,props:o,_owner:I.current}}function N(e){return"object"==typeof e&&null!==e&&e.$$typeof===b}var H=/\/+/g,U=[];function B(e,t,n,r){if(U.length){var o=U.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function Y(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>U.length&&U.push(e)}function X(e,t,n){return null==e?0:function e(t,n,r,o){var i=typeof t;"undefined"!==i&&"boolean"!==i||(t=null);var a=!1;if(null===t)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case b:case w:a=!0}}if(a)return r(o,t,""===n?"."+Z(t,0):n),1;if(a=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c<t.length;c++){var u=n+Z(i=t[c],c);a+=e(i,u,r,o)}else if(null===t||"object"!=typeof t?u=null:u="function"==typeof(u=$&&t[$]||t["@@iterator"])?u:null,"function"==typeof u)for(t=u.call(t),c=0;!(i=t.next()).done;)a+=e(i=i.value,u=n+Z(i,c++),r,o);else if("object"===i)throw r=""+t,Error(D(31,"[object Object]"===r?"object with keys {"+Object.keys(t).join(", ")+"}":r,""));return a}(e,"",t,n)}function Z(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function J(e,t){e.func.call(e.context,t,e.count++)}function G(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?Q(e,r,n,(function(e){return e})):null!=e&&(N(e)&&(e=function(e,t){return{$$typeof:b,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(H,"$&/")+"/")+n)),r.push(e))}function Q(e,t,n,r,o){var i="";null!=n&&(i=(""+n).replace(H,"$&/")+"/"),X(e,G,t=B(t,i,r,o)),Y(t)}function K(){var e=z.current;if(null===e)throw Error(D(321));return e}var ee={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return Q(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;X(e,J,t=B(null,null,t,n)),Y(t)},count:function(e){return X(e,(function(){return null}),null)},toArray:function(e){var t=[];return Q(e,t,null,(function(e){return e})),t},only:function(e){if(!N(e))throw Error(D(143));return e}},createRef:function(){return{current:null}},Component:A,PureComponent:M,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:P,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:x,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:S,render:e}},lazy:function(e){return{$$typeof:C,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:R,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return K().useCallback(e,t)},useContext:function(e,t){return K().useContext(e,t)},useEffect:function(e,t){return K().useEffect(e,t)},useImperativeHandle:function(e,t,n){return K().useImperativeHandle(e,t,n)},useDebugValue:function(){},useLayoutEffect:function(e,t){return K().useLayoutEffect(e,t)},useMemo:function(e,t){return K().useMemo(e,t)},useReducer:function(e,t,n){return K().useReducer(e,t,n)},useRef:function(e){return K().useRef(e)},useState:function(e){return K().useState(e)},Fragment:O,Profiler:k,StrictMode:j,Suspense:E,createElement:W,cloneElement:function(e,t,n){if(null==e)throw Error(D(267,e));var r=m({},e.props),o=e.key,i=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,a=I.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)V.call(t,u)&&!F.hasOwnProperty(u)&&(r[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)r.children=n;else if(1<u){c=Array(u);for(var s=0;s<u;s++)c[s]=arguments[s+2];r.children=c}return{$$typeof:b,type:e.type,key:o,ref:i,props:r,_owner:a}},createFactory:function(e){var t=W.bind(null,e);return t.type=e,t},isValidElement:N,version:"16.12.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:z,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:I,IsSomeRendererActing:{current:!1},assign:m}},te={default:ee},ne=te&&ee||te,re=ne.default||ne,oe=function(){};if("production"!==process.env.NODE_ENV){var ie="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ae={},ce=Function.call.bind(Object.prototype.hasOwnProperty);oe=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function ue(e,t,n,r,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(ce(e,i)){var a;try{if("function"!=typeof e[i]){var c=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.");throw c.name="Invariant Violation",c}a=e[i](t,i,r,n,null,ie)}catch(e){a=e}if(!a||a instanceof Error||oe((r||"React class")+": type specification of "+n+" `"+i+"` 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 ae)){ae[a.message]=!0;var u=o?o():"";oe("Failed "+n+" type: "+a.message+(null!=u?u:""))}}}ue.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(ae={})};var se=ue,le=r((function(e){"production"!==process.env.NODE_ENV&&function(){var t=m,n=se,r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119,O="function"==typeof Symbol&&Symbol.iterator,j="@@iterator";function k(e){if(null===e||"object"!=typeof e)return null;var t=O&&e[O]||e[j];return"function"==typeof t?t:null}var x=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,(function(){return n[o++]}));"undefined"!=typeof console&&console.warn(i);try{throw new Error(i)}catch(e){}},P=function(e,t){if(void 0===t)throw new Error("`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning message argument");if(!e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];x.apply(void 0,[t].concat(r))}},S=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(void 0===t)throw new Error("`warningWithoutStack(condition, format, ...args)` requires a warning message argument");if(r.length>8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!e){if("undefined"!=typeof console){var i=r.map((function(e){return""+e}));i.unshift("Warning: "+t),Function.prototype.apply.call(console.error,console,i)}try{var a=0,c="Warning: "+t.replace(/%s/g,(function(){return r[a++]}));throw new Error(c)}catch(e){}}},E={};function R(e,t){var n=e.constructor,r=n&&(n.displayName||n.name)||"ReactClass",o=r+"."+t;E[o]||(S(!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.",t,r),E[o]=!0)}var C={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){R(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,r){R(e,"replaceState")},enqueueSetState:function(e,t,n,r){R(e,"setState")}},$={};function D(e,t,n){this.props=e,this.context=t,this.refs=$,this.updater=n||C}Object.freeze($),D.prototype.isReactComponent={},D.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},D.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var T={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)."]},_=function(e,t){Object.defineProperty(D.prototype,e,{get:function(){P(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var A in T)T.hasOwnProperty(A)&&_(A,T[A]);function L(){}function M(e,t,n){this.props=e,this.context=t,this.refs=$,this.updater=n||C}L.prototype=D.prototype;var q=M.prototype=new L;q.constructor=M,t(q,D.prototype),q.isPureReactComponent=!0;var z={current:null},I={current:null},V=/^(.*)[\\\/]/,F=1;function W(e){if(null==e)return null;if("number"==typeof e.tag&&S(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case a:return"Fragment";case i:return"Portal";case u:return"Profiler";case c:return"StrictMode";case d:return"Suspense";case h:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case l:return"Context.Consumer";case s:return"Context.Provider";case p:return r=e,o=e.render,f="ForwardRef",m=o.displayName||o.name||"",r.displayName||(""!==m?f+"("+m+")":f);case y:return W(e.type);case v:var t=(n=e)._status===F?n._result:null;if(t)return W(t)}var n,r,o,f,m;return null}var N={},H=null;function U(e){H=e}N.getCurrentStack=null,N.getStackAddendum=function(){var e="";if(H){var t=W(H.type),n=H._owner;e+=function(e,t,n){var r="";if(t){var o=t.fileName,i=o.replace(V,"");if(/^index\./.test(i)){var a=o.match(V);if(a){var c=a[1];if(c)i=c.replace(V,"")+"/"+i}}r=" (at "+i+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(t,H._source,n&&W(n.type))}var r=N.getCurrentStack;return r&&(e+=r()||""),e};var B={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:I,IsSomeRendererActing:{current:!1},assign:t};t(B,{ReactDebugCurrentFrame:N,ReactComponentTreeHook:{}});var Y,X,Z=function(e,t){if(!e){for(var n=B.ReactDebugCurrentFrame,r=n.getStackAddendum(),o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];S.apply(void 0,[!1,t+"%s"].concat(i,[r]))}},J=Object.prototype.hasOwnProperty,G={key:!0,ref:!0,__self:!0,__source:!0};function Q(e){if(J.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function K(e){if(J.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}var ee=function(e,t,n,r,i,a,c){var u={$$typeof:o,type:e,key:t,ref:n,props:c,_owner:a,_store:{}};return Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function te(e,t,n){var r,o={},i=null,a=null,c=null,u=null;if(null!=t)for(r in Q(t)&&(a=t.ref),K(t)&&(i=""+t.key),c=void 0===t.__self?null:t.__self,u=void 0===t.__source?null:t.__source,t)J.call(t,r)&&!G.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(s>1){for(var l=Array(s),f=0;f<s;f++)l[f]=arguments[f+2];Object.freeze&&Object.freeze(l),o.children=l}if(e&&e.defaultProps){var p=e.defaultProps;for(r in p)void 0===o[r]&&(o[r]=p[r])}if(i||a){var d="function"==typeof e?e.displayName||e.name||"Unknown":e;i&&function(e,t){var n=function(){Y||(Y=!0,S(!1,"%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)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(o,d),a&&function(e,t){var n=function(){X||(X=!0,S(!1,"%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)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(o,d)}return ee(e,i,a,c,u,I.current,o)}function ne(e,n,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o,i,a=t({},e.props),c=e.key,u=e.ref,s=e._self,l=e._source,f=e._owner;if(null!=n)for(o in Q(n)&&(u=n.ref,f=I.current),K(n)&&(c=""+n.key),e.type&&e.type.defaultProps&&(i=e.type.defaultProps),n)J.call(n,o)&&!G.hasOwnProperty(o)&&(void 0===n[o]&&void 0!==i?a[o]=i[o]:a[o]=n[o]);var p=arguments.length-2;if(1===p)a.children=r;else if(p>1){for(var d=Array(p),h=0;h<p;h++)d[h]=arguments[h+2];a.children=d}return ee(e.type,c,u,s,l,f,a)}function re(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var oe=".",ie=":";var ae=!1,ce=/\/+/g;function ue(e){return(""+e).replace(ce,"$&/")}var le,fe=10,pe=[];function de(e,t,n,r){if(pe.length){var o=pe.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function he(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,pe.length<fe&&pe.push(e)}function ye(e,t,n){return null==e?0:function e(t,n,r,a){var c=typeof t;"undefined"!==c&&"boolean"!==c||(t=null);var u,s=!1;if(null===t)s=!0;else switch(c){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case o:case i:s=!0}}if(s)return r(a,t,""===n?oe+ve(t,0):n),1;var l=0,f=""===n?oe:n+ie;if(Array.isArray(t))for(var p=0;p<t.length;p++)l+=e(u=t[p],f+ve(u,p),r,a);else{var d=k(t);if("function"==typeof d){d===t.entries&&(ae||Z(!1,"Using Maps as children is unsupported and will likely yield unexpected results. Convert it to a sequence/iterable of keyed ReactElements instead."),ae=!0);for(var h,y=d.call(t),v=0;!(h=y.next()).done;)l+=e(u=h.value,f+ve(u,v++),r,a)}else if("object"===c){var m;m=" If you meant to render a collection of children, use an array instead."+N.getStackAddendum();var g=""+t;throw Error("Objects are not valid as a React child (found: "+("[object Object]"===g?"object with keys {"+Object.keys(t).join(", ")+"}":g)+")."+m)}}return l}(e,"",t,n)}function ve(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=e.key,r={"=":"=0",":":"=2"},"$"+(""+n).replace(/[=:]/g,(function(e){return r[e]}))):t.toString(36);var n,r}function me(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function ge(e,t,n){var r,o,i=e.result,a=e.keyPrefix,c=e.func,u=e.context,s=c.call(u,t,e.count++);Array.isArray(s)?be(s,i,n,(function(e){return e})):null!=s&&(re(s)&&(r=s,o=a+(!s.key||t&&t.key===s.key?"":ue(s.key)+"/")+n,s=ee(r.type,o,r.ref,r._self,r._source,r._owner,r.props)),i.push(s))}function be(e,t,n,r,o){var i="";null!=n&&(i=ue(n)+"/");var a=de(t,i,r,o);ye(e,ge,a),he(a)}function we(e){return"string"==typeof e||"function"==typeof e||e===a||e===f||e===u||e===c||e===d||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===y||e.$$typeof===s||e.$$typeof===l||e.$$typeof===p||e.$$typeof===g||e.$$typeof===b||e.$$typeof===w)}function Oe(){var e=z.current;if(null===e)throw Error("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.");return e}function je(){if(I.current){var e=W(I.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}le=!1;var ke={};function xe(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=je();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!ke[n]){ke[n]=!0;var r="";e&&e._owner&&e._owner!==I.current&&(r=" It was passed a child from "+W(e._owner.type)+"."),U(e),Z(!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),U(null)}}}function Pe(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];re(r)&&xe(r,t)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var o=k(e);if("function"==typeof o&&o!==e.entries)for(var i,a=o.call(e);!(i=a.next()).done;)re(i.value)&&xe(i.value,t)}}function Se(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,o=W(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==p&&t.$$typeof!==y)return;r=t.propTypes}r?(U(e),n(r,e.props,"prop",o,N.getStackAddendum),U(null)):void 0===t.PropTypes||le||(le=!0,S(!1,"Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")),"function"==typeof t.getDefaultProps&&(t.getDefaultProps.isReactClassApproved||S(!1,"getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."))}}function Ee(e,t,n){var r,i,c=we(e);if(!c){var u="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(u+=" 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 s,l=null!=(r=t)&&void 0!==(i=r.__source)?"\n\nCheck your code at "+i.fileName.replace(/^.*[\\\/]/,"")+":"+i.lineNumber+".":"";u+=l||je(),null===e?s="null":Array.isArray(e)?s="array":void 0!==e&&e.$$typeof===o?(s="<"+(W(e.type)||"Unknown")+" />",u=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,Z(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,u)}var f=te.apply(this,arguments);if(null==f)return f;if(c)for(var p=2;p<arguments.length;p++)Pe(arguments[p],e);return e===a?function(e){U(e);for(var t=Object.keys(e.props),n=0;n<t.length;n++){var r=t[n];if("children"!==r&&"key"!==r){Z(!1,"Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",r);break}}null!==e.ref&&Z(!1,"Invalid attribute `ref` supplied to `React.Fragment`."),U(null)}(f):Se(f),f}try{var Re=Object.freeze({}),Ce=new Map([[Re,null]]),$e=new Set([Re]);Ce.set(0,0),$e.add(0)}catch(e){}var De={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return be(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;var r=de(null,null,t,n);ye(e,me,r),he(r)},count:function(e){return ye(e,(function(){return null}),null)},toArray:function(e){var t=[];return be(e,t,null,(function(e){return e})),t},only:function(e){if(!re(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},createRef:function(){var e={current:null};return Object.seal(e),e},Component:D,PureComponent:M,createContext:function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&S(!1,"createContext: Expected the optional second argument to be a function. Instead received: %s",t);var n={$$typeof:l,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null};n.Provider={$$typeof:s,_context:n};var r=!1,o=!1,i={$$typeof:l,_context:n,_calculateChangedBits:n._calculateChangedBits};return Object.defineProperties(i,{Provider:{get:function(){return o||(o=!0,Z(!1,"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(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||(r=!0,Z(!1,"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=i,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(e){return null!=e&&e.$$typeof===y?S(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?S(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&S(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null!=e.defaultProps||null!=e.propTypes)&&S(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:p,render:e}},lazy:function(e){var t,n,r={$$typeof:v,_ctor:e,_status:-1,_result:null};return Object.defineProperties(r,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){Z(!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."),t=e,Object.defineProperty(r,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){Z(!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."),n=e,Object.defineProperty(r,"propTypes",{enumerable:!0})}}}),r},memo:function(e,t){return we(e)||S(!1,"memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:y,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return Oe().useCallback(e,t)},useContext:function(e,t){var n=Oe();if(void 0!==t&&Z(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&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!==e._context){var r=e._context;r.Consumer===e?Z(!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===e&&Z(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},useEffect:function(e,t){return Oe().useEffect(e,t)},useImperativeHandle:function(e,t,n){return Oe().useImperativeHandle(e,t,n)},useDebugValue:function(e,t){return Oe().useDebugValue(e,t)},useLayoutEffect:function(e,t){return Oe().useLayoutEffect(e,t)},useMemo:function(e,t){return Oe().useMemo(e,t)},useReducer:function(e,t,n){return Oe().useReducer(e,t,n)},useRef:function(e){return Oe().useRef(e)},useState:function(e){return Oe().useState(e)},Fragment:a,Profiler:u,StrictMode:c,Suspense:d,createElement:Ee,cloneElement:function(e,t,n){for(var r=ne.apply(this,arguments),o=2;o<arguments.length;o++)Pe(arguments[o],r.type);return Se(r),r},createFactory:function(e){var t=Ee.bind(null,e);return t.type=e,Object.defineProperty(t,"type",{enumerable:!1,get:function(){return P(!1,"Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},isValidElement:re,version:"16.12.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:B},Te=Object.freeze({default:De}),_e=Te&&De||Te,Ae=_e.default||_e;e.exports=Ae}()})),fe=r((function(e){"production"===process.env.NODE_ENV?e.exports=re:e.exports=le})),pe=r((function(e,t){e.exports=function(){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}var t=Object.prototype.toString,n=function(n){if(void 0===n)return"undefined";if(null===n)return"null";var o=e(n);if("boolean"===o)return"boolean";if("string"===o)return"string";if("number"===o)return"number";if("symbol"===o)return"symbol";if("function"===o)return function(e){return"GeneratorFunction"===r(e)}(n)?"generatorfunction":"function";if(function(e){return Array.isArray?Array.isArray(e):e instanceof Array}(n))return"array";if(function(e){return!(!e.constructor||"function"!=typeof e.constructor.isBuffer)&&e.constructor.isBuffer(e)}(n))return"buffer";if(function(e){try{if("number"==typeof e.length&&"function"==typeof e.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(n))return"arguments";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(n))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(n))return"error";if(function(e){return e instanceof RegExp||"string"==typeof e.flags&&"boolean"==typeof e.ignoreCase&&"boolean"==typeof e.multiline&&"boolean"==typeof e.global}(n))return"regexp";switch(r(n)){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(e){return"function"==typeof e.throw&&"function"==typeof e.return&&"function"==typeof e.next}(n))return"generator";switch(o=t.call(n)){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 o.slice(8,-1).toLowerCase().replace(/\s/g,"")};function r(e){return e.constructor?e.constructor.name:null}function o(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];return i(e,t,r),a(e,t,r),function(e,t,r){var c=n(t),u=n(e);if("object"===c){if("object"!==u)throw new Error("[Type Error]: '".concat(r.join("."),"' require 'object' type, but got '").concat(u,"'"));Object.keys(t).forEach((function(n){var c=e[n],u=t[n],s=r.slice();s.push(n),i(c,u,s),a(c,u,s),o(c,u,s)}))}if("array"===c){if("array"!==u)throw new Error("[Type Error]: '".concat(r.join("."),"' require 'array' type, but got '").concat(u,"'"));e.forEach((function(n,c){var u=e[c],s=t[c]||t[0],l=r.slice();l.push(c),i(u,s,l),a(u,s,l),o(u,s,l)}))}}(e,t,r),e}function i(e,t,r){if("string"===n(t)){var o=n(e);if(!(-1<t.indexOf("|")?t.split("|").map((function(e){return e.toLowerCase().trim()})).filter(Boolean).some((function(e){return o===e})):t.toLowerCase().trim()===o))throw new Error("[Type Error]: '".concat(r.join("."),"' require '").concat(t,"' type, but got '").concat(o,"'"))}}function a(e,t,r){if("function"===n(t)){var o=t(e,n(e),r);if(!0!==o){var i=n(o);throw"string"===i?new Error(o):"error"===i?o:new Error("[Validator Error]: The scheme for '".concat(r.join("."),"' validator require return true, but got '").concat(o,"'"))}}}return o.kindOf=n,o}()})),de=function(){function e(){i(this,e)}return c(e,[{key:"on",value:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this}},{key:"once",value:function(e,t,n){var r=this;function o(){r.off(e,o);for(var i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];t.apply(n,a)}return o._=t,this.on(e,o,n)}},{key:"emit",value:function(e){for(var t=((this.e||(this.e={}))[e]||[]).slice(),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=0;i<t.length;i+=1)t[i].fn.apply(t[i].ctx,r);return this}},{key:"off",value:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i+=1)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}}]),e}();function he(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector(e)}function ye(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(t.querySelectorAll(e))}function ve(e,t){return e.classList.add(t)}function me(e,t){return e.classList.remove(t)}function ge(e,t){return e.classList.contains(t)}function be(e,t){return t instanceof Element?e.appendChild(t):e.insertAdjacentHTML("beforeend",String(t)),e.lastElementChild||e.lastChild}function we(e,t,n){return e.style[t]=n,e}function Oe(e,t){return Object.keys(t).forEach((function(n){we(e,n,t[n])})),e}function je(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=window.getComputedStyle(e,null).getPropertyValue(t);return n?parseFloat(r):r}function ke(e){return Array.from(e.parentElement.children).filter((function(t){return t!==e}))}function xe(e,t){ke(e).forEach((function(e){return me(e,t)})),ve(e,t)}function Pe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"up";e.setAttribute("aria-label",t),e.setAttribute("data-balloon-pos",n)}var Se=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},Ee=r((function(e){function t(n,r,o){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(e){return!1}}()?e.exports=t=function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&f(o,n.prototype),o}:e.exports=t=Reflect.construct,t.apply(null,arguments)}e.exports=t})),Re=function(e){function t(e,n){var r;return i(this,t),r=s(this,l(t).call(this,e)),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u(r),n||r.constructor),r.name="ArtPlayerError",r}return p(t,e),t}(r((function(e){function t(n){var r="function"==typeof Map?new Map:void 0;return e.exports=t=function(e){if(null===e||!Se(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return Ee(e,arguments,l(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),f(t,e)},t(n)}e.exports=t}))(Error));function Ce(e,t){if(!e)throw new Re(t);return e}function $e(e){return"WEBVTT \r\n\r\n".concat(e.replace(/{[\s\S]*?}/g,"").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 De(e){return URL.createObjectURL(new Blob([e],{type:"text/vtt"}))}function Te(e){var t=new RegExp("Dialogue:\\s\\d,(\\d+:\\d\\d:\\d\\d.\\d\\d),(\\d+:\\d\\d:\\d\\d.\\d\\d),([^,]*),([^,]*),(?:[^,]*,){4}([\\s\\S]*)$","i");function n(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(/[:.]/).map((function(e,t,n){if(t===n.length-1){if(1===e.length)return".".concat(e,"00");if(2===e.length)return".".concat(e,"0")}else if(1===e.length)return(0===t?"0":":0")+e;return 0===t?e:t===n.length-1?".".concat(e):":".concat(e)})).join("")}return"WEBVTT\n\n".concat(e.split(/\r?\n/).map((function(e){var r=e.match(t);return r?{start:n(r[1].trim()),end:n(r[2].trim()),text:r[5].replace(/{[\s\S]*?}/g,"").replace(/(\\N)/g,"\n").trim().split(/\r?\n/).map((function(e){return e.trim()})).join("\n")}:null})).filter((function(e){return e})).map((function(e,t){return e?"".concat(t+1,"\n").concat(e.start," --\x3e ").concat(e.end,"\n").concat(e.text):""})).filter((function(e){return e.trim()})).join("\n\n"))}function _e(e){return e.includes("?")?_e(e.split("?")[0]):e.includes("#")?_e(e.split("#")[0]):e.trim().toLowerCase().split(".").pop()}function Ae(e,t){var n=document.createElement("a");n.style.display="none",n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var Le=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}};var Me=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)};var qe=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var ze=function(e){return Le(e)||Me(e)||qe()},Ie=Object.defineProperty,Ve=Object.prototype.hasOwnProperty;function Fe(e,t){return Ve.call(e,t)}function We(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((function(e,t){return Object.getOwnPropertyNames(t).forEach((function(n){Ce(!Fe(e,n),"Target attribute name is duplicated: ".concat(n)),Ie(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}),e)}function Ne(){for(var e=function(e){return e&&"object"===o(e)&&!Array.isArray(e)},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.reduce((function(t,n){return Object.keys(n).forEach((function(r){var o=t[r],i=n[r];Array.isArray(o)&&Array.isArray(i)?t[r]=o.concat.apply(o,ze(i)):!e(o)||!e(i)||i instanceof Element?t[r]=i:t[r]=Ne(o,i)})),t}),{})}function He(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}function Ue(e,t,n){var r;function o(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];clearTimeout(r),r=setTimeout((function(){r=null,e.apply(n,i)}),t)}return o.clearTimeout=function(){clearTimeout(r)},o}function Be(e,t){var n,r,o=!1;return function i(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];if(o)return n=c,void(r=this);o=!0,e.apply(this,c),setTimeout((function(){o=!1,n&&(i.apply(r,n),n=null,r=null)}),t)}}function Ye(e,t,n){return Math.max(Math.min(e,Math.max(t,n)),Math.min(t,n))}function Xe(e){var t=Math.floor(e/3600),n=Math.floor((e-3600*t)/60),r=Math.floor(e-3600*t-60*n);return(t>0?[t,n,r]:[n,r]).map((function(e){return e<10?"0".concat(e):String(e)})).join(":")}var Ze=Object.freeze({__proto__:null,query:he,queryAll:ye,addClass:ve,removeClass:me,hasClass:ge,append:be,remove:function(e){return e.parentNode.removeChild(e)},setStyle:we,setStyles:Oe,getStyle:je,sublings:ke,inverseClass:xe,tooltip:Pe,ArtPlayerError:Re,errorHandle:Ce,srtToVtt:$e,vttToBlob:De,assToVtt:Te,getExt:_e,downloadFile:Ae,def:Ie,has:Fe,proxyPropertys:We,mergeDeep:Ne,sleep:He,debounce:Ue,throttle:Be,clamp:Ye,secondToTime:Xe});function Je(e,t,n){return Ce("string"===t||e instanceof Element,"".concat(n.join(".")," require 'string' or 'Element' type"))}var Ge={container:Je,url:"string|function",poster:"string",title:"string",theme:"string",lang:"string",volume:"number",isLive:"boolean",muted:"boolean",autoplay:"boolean",autoSize:"boolean",loop:"boolean",flip:"boolean",playbackRate:"boolean",aspectRatio:"boolean",screenshot:"boolean",setting:"boolean",hotkey:"boolean",pip:"boolean",mutex:"boolean",fullscreen:"boolean",fullscreenWeb:"boolean",subtitleOffset:"boolean",miniProgressBar:"boolean",localVideo:"boolean",localSubtitle:"boolean",autoPip:"boolean",networkMonitor:"boolean",plugins:["function"],whitelist:["string|function|regexp"],layers:[{disable:"boolean|undefined",name:"string|undefined",index:"number|undefined",html:Je,style:"object|undefined",click:"function|undefined",mounted:"function|undefined",tooltip:"string|undefined"}],contextmenu:[{disable:"boolean|undefined",name:"string|undefined",index:"number|undefined",html:Je,style:"object|undefined",click:"function|undefined",mounted:"function|undefined",tooltip:"string|undefined"}],quality:[{default:"boolean|undefined",name:"string",url:"string"}],controls:[{disable:"boolean|undefined",name:"string|undefined",index:"number|undefined",html:Je,style:"object|undefined",click:"function|undefined",mounted:"function|undefined",tooltip:"string|undefined",position:function(e,t,n){var r=["top","left","right"];return Ce(r.includes(e),"".concat(n.join(".")," only accept ").concat(r.toString()," as parameters"))}}],highlight:[{time:"number",text:"string"}],thumbnails:{url:"string",number:"number",width:"number",height:"number",column:"number"},subtitle:{url:"string",style:"object"},moreVideoAttr:"object",icons:"object",customType:"object"},Qe={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"]}},Ke=function e(t){var n=this;i(this,e);var r=t.constructor.kindOf,o=t.option.whitelist;this.ua=window.navigator.userAgent,this.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.ua),this.state=!this.isMobile||o.some((function(e){switch(r(e)){case"string":return n.ua.indexOf(e)>-1;case"function":return e(n.ua);case"regexp":return e.test(n.ua);default:return!1}}))},et=function(){function e(t){var n=this;i(this,e),this.art=t,t.option.container instanceof Element?this.$container=t.option.container:(this.$container=he(t.option.container),Ce(this.$container,"No container element found by ".concat(t.option.container))),Ce(t.constructor.instances.every((function(e){return e.template.$container!==n.$container})),"Cannot mount multiple instances on the same dom element"),Ce(this.$container.clientWidth&&this.$container.clientHeight,"The width and height of the container cannot be 0"),t.whitelist.state?this.initDesktop():this.initMobile()}return c(e,[{key:"query",value:function(e){return he(e,this.$container)}},{key:"initDesktop",value:function(){this.$container.innerHTML='<div class="art-video-player art-subtitle-show art-layer-show" style="--theme: '.concat(this.art.option.theme,'"><video class="art-video"><track default kind="metadata"></track></video><div class="art-subtitle"></div><div class="art-danmuku"></div><div class="art-layers"></div><div class="art-mask"><div class="art-state"></div></div><div class="art-bottom"><div class="art-progress"></div><div class="art-controls"><div class="art-controls-left"></div><div class="art-controls-right"></div></div></div><div class="art-loading"></div><div class="art-notice"><div class="art-notice-inner"></div></div><div class="art-settings"><div class="art-setting-inner art-backdrop-filter"><div class="art-setting-body"></div></div></div><div class="art-info art-backdrop-filter"><div class="art-info-panel"><div class="art-info-item"><div class="art-info-title">Player version:</div><div class="art-info-content">3.2.4</div></div><div class="art-info-item"><div class="art-info-title">Video url:</div><div class="art-info-content" data-video="src"></div></div><div class="art-info-item"><div class="art-info-title">Video volume:</div><div class="art-info-content" data-video="volume"></div></div><div class="art-info-item"><div class="art-info-title">Video time:</div><div class="art-info-content" data-video="currentTime"></div></div><div class="art-info-item"><div class="art-info-title">Video duration:</div><div class="art-info-content" data-video="duration"></div></div><div class="art-info-item"><div class="art-info-title">Video resolution:</div><div class="art-info-content"><span data-video="videoWidth"></span> x <span data-video="videoHeight"></span></div></div></div><div class="art-info-close">[x]</div></div><div class="art-pip-header"><div class="art-pip-title"></div><div class="art-pip-close">xD7</div></div><div class="art-contextmenus art-backdrop-filter"></div></div>'),this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video"),this.$track=this.query(".art-video track"),this.$subtitle=this.query(".art-subtitle"),this.$danmuku=this.query(".art-danmuku"),this.$bottom=this.query(".art-bottom"),this.$progress=this.query(".art-progress"),this.$controls=this.query(".art-controls"),this.$controlsLeft=this.query(".art-controls-left"),this.$controlsRight=this.query(".art-controls-right"),this.$layer=this.query(".art-layers"),this.$loading=this.query(".art-loading"),this.$notice=this.query(".art-notice"),this.$noticeInner=this.query(".art-notice-inner"),this.$mask=this.query(".art-mask"),this.$state=this.query(".art-state"),this.$setting=this.query(".art-settings"),this.$settingInner=this.query(".art-setting-inner"),this.$settingBody=this.query(".art-setting-body"),this.$info=this.query(".art-info"),this.$infoPanel=this.query(".art-info-panel"),this.$infoClose=this.query(".art-info-close"),this.$pipHeader=this.query(".art-pip-header"),this.$pipTitle=this.query(".art-pip-title"),this.$pipClose=this.query(".art-pip-close"),this.$contextmenu=this.query(".art-contextmenus")}},{key:"initMobile",value:function(){this.$container.innerHTML='<div class="art-video-player"><video class="art-video"></video></div>',this.$player=this.query(".art-video-player"),this.$video=this.query(".art-video")}},{key:"destroy",value:function(e){e?this.$container.innerHTML="":ve(this.$player,"art-destroy")}}]),e}(),tt={"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:"正常",Open:"打开","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器","Does not support fullscreen":"不支持全屏","Local Subtitle":"本地字幕","Local Video":"本地视频","Subtitle offset time":"字幕偏移时间","No subtitles found":"未发现字幕"},nt={"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:"正常",Open:"打開","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器","Does not support fullscreen":"不支持全屏","Local Subtitle":"本地字幕","Local Video":"本地視頻","Subtitle offset time":"字幕偏移時間","No subtitles found":"未發現字幕"},rt=function(){function e(t){i(this,e),this.art=t,this.languages={"zh-cn":tt,"zh-tw":nt},this.init()}return c(e,[{key:"init",value:function(){var e=this.art.option.lang.toLowerCase();this.language=this.languages[e]||{}}},{key:"get",value:function(e){return this.language[e]||e}},{key:"update",value:function(e){this.languages=Ne(this.languages,e),this.init()}}]),e}();var ot=r((function(e){!function(){var t="undefined"!=typeof window&&void 0!==window.document?window.document:{},n=e.exports,r=function(){for(var e,n=[["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"]],r=0,o=n.length,i={};r<o;r++)if((e=n[r])&&e[1]in t){for(r=0;r<e.length;r++)i[n[0][r]]=e[r];return i}return!1}(),o={change:r.fullscreenchange,error:r.fullscreenerror},i={request:function(e){return new Promise(function(n,o){var i=function(){this.off("change",i),n()}.bind(this);this.on("change",i),e=e||t.documentElement,Promise.resolve(e[r.requestFullscreen]()).catch(o)}.bind(this))},exit:function(){return new Promise(function(e,n){if(this.isFullscreen){var o=function(){this.off("change",o),e()}.bind(this);this.on("change",o),Promise.resolve(t[r.exitFullscreen]()).catch(n)}else e()}.bind(this))},toggle:function(e){return this.isFullscreen?this.exit():this.request(e)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(e,n){var r=o[e];r&&t.addEventListener(r,n,!1)},off:function(e,n){var r=o[e];r&&t.removeEventListener(r,n,!1)},raw:r};r?(Object.defineProperties(i,{isFullscreen:{get:function(){return Boolean(t[r.fullscreenElement])}},element:{enumerable:!0,get:function(){return t[r.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(t[r.fullscreenEnabled])}}}),n?e.exports=i:window.screenfull=i):n?e.exports={isEnabled:!1}:window.screenfull={isEnabled:!1}}()}));ot.isEnabled;function it(e,t){var n=e.template.$video;document.pictureInPictureEnabled?function(e,t){var n=e.template.$video,r=e.events.proxy,o=e.notice;n.disablePictureInPicture=!1,Ie(t,"pip",{get:function(){return document.pictureInPictureElement},set:function(e){e?n.requestPictureInPicture().catch((function(e){throw o.show=e,e})):document.exitPictureInPicture().catch((function(e){throw o.show=e,e}))}}),r(n,"enterpictureinpicture",(function(){e.emit("pipEnabled")})),r(n,"leavepictureinpicture",(function(){e.emit("pipExit")})),e.on("destroy",(function(){t.pip&&(t.pip=!1)}))}(e,t):n.webkitSupportsPresentationMode?function(e,t){var n=e.template.$video;n.webkitSetPresentationMode("inline"),Ie(t,"pip",{get:function(){return"picture-in-picture"===n.webkitPresentationMode},set:function(t){t?(n.webkitSetPresentationMode("picture-in-picture"),e.emit("pipEnabled")):(n.webkitSetPresentationMode("inline"),e.emit("pipExit"))}})}(e,t):function(e,t){var n=e.option,r=e.i18n,o=e.template,i=o.$player,a=o.$pipClose,c=o.$pipTitle,u=o.$pipHeader,s=e.events.proxy,l="",f=!1,p=0,d=0,h=0,y=0;s(u,"mousedown",(function(e){f=!0,p=e.pageX,d=e.pageY,h=t.left,y=t.top})),s(u,"mousemove",(function(e){f&&(ve(i,"art-is-dragging"),we(i,"left","".concat(h+e.pageX-p,"px")),we(i,"top","".concat(y+e.pageY-d,"px")))})),s(document,"mouseup",(function(){f=!1,me(i,"art-is-dragging")})),s(a,"click",(function(){t.pip=!1,f=!1,me(i,"art-is-dragging")})),be(c,n.title||r.get("Mini player"));var v={get:function(){return ge(i,"art-pip")},set:function(n){if(n){t.autoSize=!1,l=i.style.cssText,ve(i,"art-pip");var r=document.body;we(i,"top","".concat(r.clientHeight-t.height-50,"px")),we(i,"left","".concat(r.clientWidth-t.width-50,"px")),t.fullscreen=!1,t.fullscreenWeb=!1,t.aspectRatio=!1,t.playbackRate=!1,e.emit("pipEnabled")}else t.pip&&(i.style.cssText=l,me(i,"art-pip"),we(i,"top",null),we(i,"left",null),t.fullscreen=!1,t.fullscreenWeb=!1,t.aspectRatio=!1,t.playbackRate=!1,t.autoSize=!0,e.emit("pipExit"))}};Ie(t,"pip",v)}(e,t),Ie(t,"pipToggle",{set:function(e){e&&(t.pip=!t.pip)}})}var at=function e(t){var n;i(this,e),function(e,t){var n=e.option,r=n.type,o=n.customType,i=e.template.$video;Ie(t,"url",{get:function(){return i.src}}),Ie(t,"attachUrl",{value:function(t){return He().then((function(){function n(t){var n=r||_e(t),a=o[n];return n&&a?(e.loading.show=!0,e.emit("beforeCustomType",n),a.call(e,i,t,e),e.emit("afterCustomType",n)):(e.emit("beforeAttachUrl",t),i.src=t,e.emit("afterAttachUrl",t)),Promise.resolve(t)}if("function"==typeof t){var a=t.call(e);return Ce("function"==typeof a.then,"If url is a function, it needs to return a promise."),a.then((function(t){return e.loading.show=!0,n(t)}))}return n(t)}))}})}(t,this),function(e,t){var n=e.option,r=e.events.proxy,o=e.template,i=o.$player,a=o.$video,c=e.i18n,u=e.notice,s=0;r(a,"click",(function(){t.toggle=!0})),Qe.video.events.forEach((function(t){r(a,t,(function(t){e.emit("video:".concat(t.type),t)}))})),e.on("video:canplay",(function(){s=0,e.controls.show=!0,e.mask.show=!0,e.loading.show=!1})),e.once("video:canplay",(function(){e.emit("ready")})),e.on("video:ended",(function(){e.controls.show=!0,e.mask.show=!0,n.loop&&(t.seek=0,t.play=!0)})),e.on("video:error",(function(){s<5?He(1e3).then((function(){s+=1,t.attachUrl(n.url),u.show="".concat(c.get("Reconnect"),": ").concat(s)})):(e.loading.show=!1,e.controls.show=!1,ve(i,"art-error"),He(1e3).then((function(){u.show=c.get("Video load failed"),e.destroy()})))})),e.on("video:loadedmetadata",(function(){n.autoSize&&(t.autoSize=!0)})),e.on("video:loadstart",(function(){e.loading.show=!0})),e.on("video:pause",(function(){e.controls.show=!0,e.mask.show=!0})),e.on("video:play",(function(){e.mask.show=!1})),e.on("video:playing",(function(){e.mask.show=!1})),e.on("video:seeked",(function(){e.loading.show=!1})),e.on("video:seeking",(function(){e.loading.show=!0})),e.on("video:timeupdate",(function(){e.mask.show=!1})),e.on("video:waiting",(function(){e.loading.show=!0}))}(t,this),function(e,t){var n=e.option,r=e.template.$video;Object.keys(n.moreVideoAttr).forEach((function(e){r[e]=n.moreVideoAttr[e]})),n.muted&&(r.muted=n.muted),n.volume&&(r.volume=Ye(n.volume,0,1)),n.poster&&(r.poster=n.poster),n.autoplay&&(r.autoplay=n.autoplay),r.controls=!1,t.attachUrl(n.url)}(t,this),function(e,t){var n=e.i18n,r=e.notice,o=e.option.mutex,i=e.template.$video;Ie(t,"play",{set:function(a){if(a){var c=i.play();void 0!==c&&c.then().catch((function(e){throw r.show=e,e})),o&&e.constructor.instances.filter((function(t){return t!==e})).forEach((function(e){e.player.pause=!0})),r.show=n.get("Play"),e.emit("play")}else t.pause=!0}})}(t,this),function(e,t){var n=e.template.$video,r=e.i18n,o=e.notice;Ie(t,"pause",{get:function(){return n.paused},set:function(i){i?(n.pause(),o.show=r.get("Pause"),e.emit("pause")):t.play=!0}})}(t,this),Ie(n=this,"toggle",{set:function(e){e&&(n.playing?n.pause=!0:n.play=!0)}}),function(e,t){var n=e.notice;Ie(t,"seek",{set:function(r){t.currentTime=r,n.show="".concat(Xe(r)," / ").concat(Xe(t.duration)),e.emit("seek",r)}})}(t,this),function(e,t){var n=e.template.$video,r=e.i18n,o=e.notice,i=e.storage;Ie(t,"volume",{get:function(){return n.volume||0},set:function(t){n.volume=Ye(t,0,1),o.show="".concat(r.get("Volume"),": ").concat(parseInt(100*n.volume,10)),0!==n.volume&&i.set("volume",n.volume),e.emit("volume",n.volume)}}),Ie(t,"muted",{get:function(){return n.muted},set:function(t){n.muted=t,e.emit("volume",n.volume)}})}(t,this),function(e,t){Ie(t,"currentTime",{get:function(){return e.template.$video.currentTime||0},set:function(n){e.template.$video.currentTime=Ye(n,0,t.duration)}})}(t,this),function(e,t){Ie(t,"duration",{get:function(){return e.template.$video.duration||0}})}(t,this),function(e,t){var n=e.i18n,r=e.notice,o=e.option;function i(i,a,c){return i===t.url?Promise.resolve(i):(URL.revokeObjectURL(t.url),t.attachUrl(i).then((function(){o.url=i,t.playbackRate=!1,t.aspectRatio=!1,e.once("video:canplay",(function(){t.currentTime=c})),t.playing&&(t.play=!0),a&&(r.show="".concat(n.get("Switch video"),": ").concat(a)),e.emit("switch",i)})))}Ie(t,"switchQuality",{value:function(e,n){return i(e,n,t.currentTime)}}),Ie(t,"switchUrl",{value:function(e,t){return i(e,t,0)}})}(t,this),function(e,t){var n=e.template,r=n.$video,o=n.$player,i=e.i18n,a=e.notice;Ie(t,"playbackRate",{get:function(){return o.dataset.playbackRate},set:function(n){if(n){if(n===o.dataset.playbackRate)return;var c=[.5,.75,1,1.25,1.5,1.75,2];Ce(c.includes(n),"'playbackRate' only accept ".concat(c.toString()," as parameters")),r.playbackRate=n,o.dataset.playbackRate=n,a.show="".concat(i.get("Rate"),": ").concat(1===n?i.get("Normal"):"".concat(n,"x")),e.emit("playbackRateChange",n)}else t.playbackRate&&(t.playbackRate=1,delete o.dataset.playbackRate,e.emit("playbackRateRemove"))}}),Ie(t,"playbackRateReset",{set:function(n){if(n){var r=o.dataset.playbackRate;r&&(t.playbackRate=Number(r),e.emit("playbackRateReset"))}}})}(t,this),function(e,t){var n=e.template,r=n.$video,o=n.$player,i=e.i18n,a=e.notice;Ie(t,"aspectRatio",{get:function(){return o.dataset.aspectRatio||""},set:function(n){if(n){var c=["default","4:3","16:9"];if(Ce(c.includes(n),"'aspectRatio' only accept ".concat(c.toString()," as parameters")),"default"===n)t.aspectRatio=!1;else{var u=n.split(":"),s=r.videoWidth,l=r.videoHeight,f=o.clientWidth,p=o.clientHeight,d=s/l,h=u[0]/u[1];if(d>h){var y=h*l/s;we(r,"width","".concat(100*y,"%")),we(r,"height","100%"),we(r,"padding","0 ".concat((f-f*y)/2,"px"))}else{var v=s/h/l;we(r,"width","100%"),we(r,"height","".concat(100*v,"%")),we(r,"padding","".concat((p-p*v)/2,"px 0"))}}o.dataset.aspectRatio=n,a.show="".concat(i.get("Aspect ratio"),": ").concat("default"===n?i.get("Default"):n),e.emit("aspectRatioChange",n)}else t.aspectRatio&&(we(r,"width",null),we(r,"height",null),we(r,"padding",null),delete o.dataset.aspectRatio,e.emit("aspectRatioRemove"))}}),Ie(t,"aspectRatioReset",{set:function(n){if(n&&t.aspectRatio){var r=t.aspectRatio;t.aspectRatio=r,e.emit("aspectRatioReset")}}})}(t,this),function(e,t){var n=e.option,r=e.notice,o=e.template.$video;Ie(t,"getScreenshotDataURL",{value:function(){try{var e=document.createElement("canvas");return e.width=o.videoWidth,e.height=o.videoHeight,e.getContext("2d").drawImage(o,0,0),e.toDataURL("image/png")}catch(e){throw r.show=e,e}}}),Ie(t,"getScreenshotBlobUrl",{value:function(){return new Promise((function(e,t){try{var n=document.createElement("canvas");n.width=o.videoWidth,n.height=o.videoHeight,n.getContext("2d").drawImage(o,0,0),n.toBlob((function(t){e(URL.createObjectURL(t))}))}catch(e){r.show=e,t(e)}}))}}),Ie(t,"screenshot",{value:function(){var r=t.getScreenshotDataURL();r&&(Ae(r,"".concat(n.title||"artplayer","_").concat(Xe(o.currentTime),".png")),e.emit("screenshot",r))}})}(t,this),function(e,t){var n=e.i18n,r=e.notice,o=e.events.destroyEvents,i=e.template.$player,a=function(){e.emit("fullscreenChange",ot.isFullscreen)},c=function(){r.show=n.get("Does not support fullscreen")};t.fullscreenIsEnabled&&(ot.on("change",a),ot.on("error",c),o.push((function(){ot.off("change",a),ot.off("error",c)}))),Ie(t,"fullscreen",{get:function(){return ot.isFullscreen},set:function(n){t.fullscreenIsEnabled?n?(t.fullscreenWeb&&(t.fullscreenWeb=!1),ot.request(i).then((function(){ve(i,"art-fullscreen"),t.aspectRatioReset=!0,e.emit("fullscreenEnabled")}))):(t.fullscreenWeb&&(t.fullscreenWeb=!1),ot.exit().then((function(){me(i,"art-fullscreen"),t.aspectRatioReset=!0,e.emit("fullscreenExit")}))):c()}}),Ie(t,"fullscreenToggle",{set:function(e){e&&(t.fullscreen=!t.fullscreen)}}),Ie(t,"fullscreenIsEnabled",{get:function(){return ot.isEnabled}})}(t,this),function(e,t){var n=e.template.$player;Ie(t,"fullscreenWeb",{get:function(){return ge(n,"art-web-fullscreen")},set:function(r){r?(t.fullscreen&&(t.fullscreen=!1),ve(n,"art-web-fullscreen"),t.aspectRatioReset=!0,e.emit("fullscreenWebEnabled")):(t.fullscreen&&(t.fullscreen=!1),me(n,"art-web-fullscreen"),t.aspectRatioReset=!0,e.emit("fullscreenWebExit"))}}),Ie(t,"fullscreenWebToggle",{set:function(e){e&&(t.fullscreenWeb=!t.fullscreenWeb)}})}(t,this),it(t,this),function(e,t){var n=e.template.$video;Ie(t,"loaded",{get:function(){return n.buffered.length?n.buffered.end(n.buffered.length-1)/n.duration:0}}),Ie(t,"loadedTime",{get:function(){return n.buffered.length?n.buffered.end(n.buffered.length-1):0}})}(t,this),function(e,t){Ie(t,"played",{get:function(){return e.template.$video.currentTime/e.template.$video.duration}})}(t,this),function(e,t){var n=e.template.$video;Ie(t,"playing",{get:function(){return!!(n.currentTime>0&&!n.paused&&!n.ended&&n.readyState>2)}})}(t,this),function(e,t){var n=e.template,r=n.$container,o=n.$player,i=n.$video;Ie(t,"autoSize",{get:function(){return ge(r,"art-auto-size")},set:function(n){if(n){var a=i.videoWidth,c=i.videoHeight,u=r.getBoundingClientRect(),s=u.width,l=u.height,f=a/c,p=s/l;if(ve(r,"art-auto-size"),p>f){we(o,"width","".concat(l*f/s*100,"%")),we(o,"height","100%")}else{var d=s/f/l*100;we(o,"width","100%"),we(o,"height","".concat(d,"%"))}e.emit("autoSizeChange",{width:t.width,height:t.height})}else me(r,"art-auto-size"),we(o,"width",null),we(o,"height",null),e.emit("autoSizeRemove")}})}(t,this),function(e,t){Ie(t,"rect",{get:function(){return e.template.$player.getBoundingClientRect()}}),["bottom","height","left","right","top","width"].forEach((function(e){Ie(t,e,{get:function(){return t.rect[e]}})})),Ie(t,"x",{get:function(){return t.left+window.pageXOffset}}),Ie(t,"y",{get:function(){return t.top+window.pageYOffset}})}(t,this),function(e,t){Ie(t,"flip",{get:function(){return e.template.$player.dataset.flip},set:function(t){if(t){var n=["normal","horizontal","vertical"];Ce(n.includes(t),"'flip' only accept ".concat(n.toString()," as parameters")),e.template.$player.dataset.flip=t,e.emit("flipChange",t)}else delete e.template.$player.dataset.flip,e.emit("flipRemove")}})}(t,this),We(t,this)};var ct=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e},ut=r((function(e){function t(n,r,o){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=t=Reflect.get:e.exports=t=function(e,t,n){var r=ct(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}},t(n,r,o||n)}e.exports=t})),st=function(){function e(t){i(this,e),this.id=0,this.art=t,this.add=this.add.bind(this),this.name=this.constructor.name.toLowerCase()}return c(e,[{key:"toggle",value:function(){this.show=!this.show}},{key:"add",value:function(e,t){var n=this,r="function"==typeof e?e(this.art):e;if(this.$parent&&!r.disable){this.id+=1;var o=r.name||"".concat(this.name).concat(this.id),i=document.createElement("div");i.classList.value="art-".concat(this.name," art-").concat(this.name,"-").concat(o),r.html&&be(i,r.html),r.style&&Oe(i,r.style),r.tooltip&&Pe(i,r.tooltip);var a=Array.from(this.$parent.children);i.dataset.index=r.index||this.id;var c=a.find((function(e){return Number(e.dataset.index)>=Number(i.dataset.index)}));c?c.insertAdjacentElement("beforebegin",i):be(this.$parent,i),r.click&&this.art.events.proxy(i,"click",(function(e){e.preventDefault(),r.click.call(n.art,n,e)})),r.mounted&&r.mounted(i,this,this.art),t&&t(i,this,this.art),this.art.emit("".concat(this.name,":add"),r)}}},{key:"show",get:function(){return ge(this.art.template.$player,"art-".concat(this.name,"-show"))},set:function(e){var t=this.art.template.$player,n="art-".concat(this.name,"-show");e?ve(t,n):me(t,n),this.art.emit("".concat(this.name,":toggle"),e)}}]),e}();function lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ft(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lt(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{mounted:function(e){var n=t.events.proxy,r=t.icons,o=t.i18n,i=t.player,a=be(e,r.fullscreen);Pe(a,o.get("Fullscreen")),n(e,"click",(function(){i.fullscreenToggle=!0})),t.on("fullscreenEnabled",(function(){we(a,"opacity","0.8"),Pe(a,o.get("Exit fullscreen"))})),t.on("fullscreenExit",(function(){we(a,"opacity","1"),Pe(a,o.get("Fullscreen"))}))}})}}function pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dt(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{mounted:function(e){var n=t.events.proxy,r=t.icons,o=t.i18n,i=t.player,a=be(e,r.fullscreenWeb);Pe(a,o.get("Web fullscreen")),n(e,"click",(function(){i.fullscreenWebToggle=!0})),t.on("fullscreenWebEnabled",(function(){we(a,"opacity","0.8"),Pe(a,o.get("Exit web fullscreen"))})),t.on("fullscreenWebExit",(function(){we(a,"opacity","1"),Pe(a,o.get("Web fullscreen"))}))}})}}function ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yt(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ht(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{mounted:function(e){var n=t.events.proxy,r=t.icons,o=t.i18n,i=t.player;Pe(be(e,r.pip),o.get("Mini player")),n(e,"click",(function(){i.pip=!0}))}})}}function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mt(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{mounted:function(e){var n=t.events.proxy,r=t.icons,o=t.i18n,i=t.player,a=be(e,r.play),c=be(e,r.pause);function u(){we(a,"display","flex"),we(c,"display","none")}function s(){we(a,"display","none"),we(c,"display","flex")}Pe(a,o.get("Play")),Pe(c,o.get("Pause")),n(a,"click",(function(){i.play=!0})),n(c,"click",(function(){i.pause=!0})),i.playing?s():u(),t.on("video:playing",(function(){s()})),t.on("video:pause",(function(){u()}))}})}}function gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bt(e,t){var n=e.template.$progress,r=e.player,o=n.getBoundingClientRect().left,i=Ye(t.pageX-o,0,n.clientWidth),a=i/n.clientWidth*r.duration;return{second:a,time:Xe(a),width:i,percentage:Ye(i/n.clientWidth,0,1)}}function wt(e){return function(t){var r=t.option,o=r.highlight,i=r.theme,a=t.events.proxy,c=t.player;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gt(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{html:'<div class="art-control-progress-inner"><div class="art-progress-loaded"></div><div class="art-progress-played" style="background: '.concat(i,'"></div><div class="art-progress-highlight"></div><div class="art-progress-indicator" style="background: ').concat(i,'"></div><div class="art-progress-tip art-tip"></div></div>'),mounted:function(e){var n=!1,r=he(".art-progress-loaded",e),i=he(".art-progress-played",e),u=he(".art-progress-highlight",e),s=he(".art-progress-indicator",e),l=he(".art-progress-tip",e);function f(e,t){"loaded"===e&&we(r,"width","".concat(100*t,"%")),"played"===e&&(we(i,"width","".concat(100*t,"%")),we(s,"left","calc(".concat(100*t,"% - ").concat(je(s,"width")/2,"px)")))}o.forEach((function(e){var t=Ye(e.time,0,c.duration)/c.duration*100;be(u,'<span data-text="'.concat(e.text,'" data-time="').concat(e.time,'" style="left: ').concat(t,'%"></span>'))})),f("loaded",c.loaded),t.on("video:progress",(function(){f("loaded",c.loaded)})),t.on("video:timeupdate",(function(){f("played",c.played)})),t.on("video:ended",(function(){f("played",1)})),a(e,"mousemove",(function(n){we(l,"display","block"),n.composedPath().indexOf(u)>-1?function(n){var r=bt(t,n).width,o=n.target.dataset.text;l.innerHTML=o;var i=l.clientWidth;r<=i/2?we(l,"left",0):r>e.clientWidth-i/2?we(l,"left","".concat(e.clientWidth-i,"px")):we(l,"left","".concat(r-i/2,"px"))}(n):function(n){var r=bt(t,n),o=r.width,i=r.time;l.innerHTML=i;var a=l.clientWidth;o<=a/2?we(l,"left",0):o>e.clientWidth-a/2?we(l,"left","".concat(e.clientWidth-a,"px")):we(l,"left","".concat(o-a/2,"px"))}(n)})),a(e,"mouseout",(function(){we(l,"display","none")})),a(e,"click",(function(e){if(e.target!==s){var n=bt(t,e),r=n.second;f("played",n.percentage),c.seek=r}})),a(s,"mousedown",(function(){n=!0})),a(document,"mousemove",(function(e){if(n){var r=bt(t,e),o=r.second,i=r.percentage;ve(s,"art-show-indicator"),f("played",i),c.seek=o}})),a(document,"mouseup",(function(){n&&(n=!1,me(s,"art-show-indicator"))}))}})}}function Ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jt(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{mounted:function(e){var n=t.events.proxy,r=t.icons,o=t.i18n,i=t.subtitle,a=be(e,r.subtitle);Pe(a,o.get("Hide subtitle")),n(e,"click",(function(){i.toggle()})),t.on("subtitle:toggle",(function(e){e?(we(a,"opacity","1"),Pe(a,o.get("Hide subtitle"))):(we(a,"opacity","0.8"),Pe(a,o.get("Show subtitle")))}))}})}}function kt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xt(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kt(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{mounted:function(e){function n(){var n="".concat(Xe(t.player.currentTime)," / ").concat(Xe(t.player.duration));n!==e.innerHTML&&(e.innerHTML=n)}n(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach((function(e){t.on(e,n)}))}})}}function Pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function St(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{mounted:function(e){var n=t.events.proxy,r=t.icons,o=t.player,i=t.i18n,a=!1,c=be(e,r.volume),u=be(e,r.volumeClose),s=be(e,'<div class="art-volume-panel"></div>'),l=be(s,'<div class="art-volume-slider-handle"></div>');function f(e){var t=s.getBoundingClientRect(),n=t.left,r=t.width,o=l.getBoundingClientRect().width;return Ye(e.pageX-n-o/2,0,r-o/2)/(r-o)}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.7;if(o.muted||0===e)we(c,"display","none"),we(u,"display","flex"),we(l,"left","0");else{var t=((je(s,"width")||60)-je(l,"width"))*e;we(c,"display","flex"),we(u,"display","none"),we(l,"left","".concat(t,"px"))}}Pe(c,i.get("Mute")),we(u,"display","none"),p(o.volume),t.on("video:volumechange",(function(){p(o.volume)})),n(c,"click",(function(){o.muted=!0})),n(u,"click",(function(){o.muted=!1})),n(s,"click",(function(e){o.muted=!1,o.volume=f(e)})),n(l,"mousedown",(function(){a=!0})),n(document,"mousemove",(function(e){a&&(o.muted=!1,o.volume=f(e))})),n(document,"mouseup",(function(){a&&(a=!1)}))}})}}function Et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rt(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Et(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{mounted:function(e){var n=t.events.proxy,r=t.icons,o=t.i18n,i=t.setting,a=be(e,r.setting);Pe(a,o.get("Show setting")),n(e,"click",(function(){i.toggle()})),t.on("setting:toggle",(function(e){e?(we(a,"opacity","0.8"),Pe(a,o.get("Hide setting"))):(we(a,"opacity","1"),Pe(a,o.get("Show setting")))}))}})}}function Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $t(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ct(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{mounted:function(e){var n=t.option.thumbnails,r=t.template.$progress,o=t.events,i=o.proxy,a=o.loadImg,c=!1,u=!1;i(r,"mousemove",(function(o){c||(c=!0,a(n.url).then((function(){u=!0}))),u&&(we(e,"display","block"),function(o){var i=bt(t,o).width,a=n.url,c=n.height,u=n.width,s=n.number,l=n.column,f=r.clientWidth/s,p=Math.floor(i/f),d=Math.ceil(p/l)-1,h=p%l||l-1;we(e,"backgroundImage","url(".concat(a,")")),we(e,"height","".concat(c,"px")),we(e,"width","".concat(u,"px")),we(e,"backgroundPosition","-".concat(h*u,"px -").concat(d*c,"px")),i<=u/2?we(e,"left",0):i>r.clientWidth-u/2?we(e,"left","".concat(r.clientWidth-u,"px")):we(e,"left","".concat(i-u/2,"px"))}(o))})),i(r,"mouseout",(function(){we(e,"display","none")}))}})}}function Dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tt(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dt(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{mounted:function(e){var n=t.events.proxy,r=t.icons,o=t.i18n,i=t.player,a=be(e,r.screenshot);Pe(a,o.get("Screenshot")),n(a,"click",(function(){i.screenshot()}))}})}}function _t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function At(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_t(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{mounted:function(e){var n=t.option.quality,r=t.events,o=r.proxy,i=r.hover,a=t.player,c=-1,u=n.find((function(e){return e.default}))||n[0];c=n.indexOf(u);var s=be(e,'<div class="art-quality-name">'.concat(u.name,"</div>")),l=n.map((function(e,t){return'<div class="art-quality-item" data-index="'.concat(t,'">').concat(e.name,"</div>")})).join(""),f=be(e,'<div class="art-qualitys">'.concat(l,"</div>"));i(e,(function(){f.style.left="-".concat(je(f,"width")/2-e.clientWidth/2,"px")})),o(f,"click",(function(e){var t=Number(e.target.dataset.index),r=n[t],o=r.url,i=r.name;o&&i&&c!==t&&(a.switchQuality(o,i),s.innerHTML=i,c=t)}))}})}}var Lt=function(e){function t(e){var n;i(this,t),n=s(this,l(t).call(this,e));var r=e.option;return e.on("ready",(function(){n.add(wt({name:"progress",disable:r.isLive,position:"top",index:10})),n.add($t({name:"thumbnails",disable:!r.thumbnails.url||r.isLive,position:"top",index:20})),n.add(mt({name:"playAndPause",disable:!1,position:"left",index:10})),n.add(St({name:"volume",disable:!1,position:"left",index:20})),n.add(xt({name:"time",disable:r.isLive,position:"left",index:30})),n.add(At({name:"quality",disable:0===r.quality.length,position:"right",index:10})),n.add(Tt({name:"screenshot",disable:!r.screenshot,position:"right",index:20})),n.add(jt({name:"subtitle",disable:!r.subtitle.url,position:"right",index:30})),n.add(Rt({name:"setting",disable:!r.setting,position:"right",index:40})),n.add(yt({name:"pip",disable:!r.pip,position:"right",index:50})),n.add(dt({name:"fullscreenWeb",disable:!r.fullscreenWeb,position:"right",index:60})),n.add(ft({name:"fullscreen",disable:!r.fullscreen,position:"right",index:70})),r.controls.forEach((function(e){n.add(e)}))})),n}return p(t,e),c(t,[{key:"add",value:function(e,n){var r=this,o="function"==typeof e?e(this.art):e;Ce(o.position,"Controls option.position can not be empty");var i=this.art.template,a=i.$progress,c=i.$controlsLeft,u=i.$controlsRight;switch(o.position){case"top":this.$parent=a;break;case"left":this.$parent=c;break;case"right":this.$parent=u}ut(l(t.prototype),"add",this).call(this,o,(function(e){o.disable||"top"===o.position||e.firstElementChild&&"I"===e.firstElementChild.tagName||ve(e,"art-control-onlyText"),n&&n(e,r,r.art)}))}}]),t}(st);function Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qt(e){return function(t){var r=t.i18n,o=t.player;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{html:"\n".concat(r.get("Play speed"),':<span data-rate="0.5">0.5</span><span data-rate="0.75">0.75</span><span data-rate="1.0" class="art-current">').concat(r.get("Normal"),'</span><span data-rate="1.25">1.25</span><span data-rate="1.5">1.5</span><span data-rate="2.0">2.0</span>'),click:function(e,t){var n=t.target.dataset.rate;n&&(o.playbackRate=Number(n),e.show=!1)},mounted:function(e){t.on("playbackRateChange",(function(t){var n=ye("span",e).find((function(e){return Number(e.dataset.rate)===t}));n&&xe(n,"art-current")}))}})}}function zt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function It(e){return function(t){var r=t.i18n,o=t.player;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zt(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{html:"\n".concat(r.get("Aspect ratio"),':<span data-ratio="default" class="art-current">').concat(r.get("Default"),'</span><span data-ratio="4:3">4:3</span><span data-ratio="16:9">16:9</span>'),click:function(e,t){var n=t.target.dataset.ratio;n&&(o.aspectRatio=n,e.show=!1)},mounted:function(e){t.on("aspectRatioChange",(function(t){var n=ye("span",e).find((function(e){return e.dataset.ratio===t}));n&&xe(n,"art-current")}))}})}}function Vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ft(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vt(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{html:t.i18n.get("Video info"),click:function(e){t.info.show=!0,e.show=!1}})}}function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nt(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{html:'<a href="https://artplayer.org" target="_blank">ArtPlayer 3.2.4</a>'})}function Ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ut(e){return function(t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ht(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ht(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{html:t.i18n.get("Close"),click:function(e){e.show=!1}})}}var Bt=function(e){function t(e){var n;i(this,t),n=s(this,l(t).call(this,e));var r=e.option,o=e.template,a=o.$player,c=o.$contextmenu,u=e.events.proxy;return n.$parent=c,e.on("ready",(function(){n.add(qt({disable:!r.playbackRate,name:"playbackRate",index:10})),n.add(It({disable:!r.aspectRatio,name:"aspectRatio",index:20})),n.add(Ft({disable:!1,name:"info",index:30})),n.add(Nt({disable:!1,name:"version",index:40})),n.add(Ut({disable:!1,name:"close",index:50})),r.contextmenu.forEach((function(e){n.add(e)})),u(a,"contextmenu",(function(e){e.preventDefault(),n.show=!0;var t=e.clientX,r=e.clientY,o=a.getBoundingClientRect(),i=o.height,u=o.width,s=o.left,l=o.top,f=c.getBoundingClientRect(),p=f.height,d=f.width,h=t-s,y=r-l;t+d>s+u&&(h=u-d),r+p>l+i&&(y=i-p),we(c,"left","".concat(h,"px")),we(c,"top","".concat(y,"px"))})),u(a,"click",(function(e){e.composedPath().includes(c)||(n.show=!1)})),e.on("blur",(function(){n.show=!1}))})),n}return p(t,e),t}(st),Yt=function(e){function t(e){var n;i(this,t),n=s(this,l(t).call(this,e));var r=e.template,o=r.$infoPanel,a=r.$infoClose,c=r.$video;(0,e.events.proxy)(a,"click",(function(){n.show=!1}));var u=null,f=ye("[data-video]",o);return e.on("destroy",(function(){clearTimeout(u)})),e.on("info:toggle",(function(e){clearTimeout(u),e&&function e(){f.forEach((function(e){var t=c[e.dataset.video];e.innerText="number"==typeof t?t.toFixed(2):t})),u=setTimeout((function(){e()}),1e3)}()})),n}return p(t,e),t}(st),Xt=function(e){function t(e){var n;i(this,t),n=s(this,l(t).call(this,e));var r=e.events.proxy,o=e.option.subtitle;return Oe(e.template.$subtitle,o.style),r(n.textTrack,"cuechange",n.update.bind(u(n))),o.url&&n.init(o.url),n}return p(t,e),c(t,[{key:"update",value:function(){var e=this.art.template.$subtitle;e.innerHTML="",this.activeCue&&(e.innerHTML=this.activeCue.text.split(/\r?\n/).map((function(e){return"<p>".concat(e,"</p>")})).join(""),this.art.emit("subtitle:update",this.activeCue.text))}},{key:"switch",value:function(e,t){var n=this,r=this.art,o=r.i18n,i=r.notice;return this.init(e).then((function(e){return t&&(i.show="".concat(o.get("Switch subtitle"),": ").concat(t)),n.art.emit("subtitle:switch",e),e}))}},{key:"init",value:function(e){var t=this,n=this.art,r=n.notice,o=n.template,i=o.$subtitle,a=o.$track;return fetch(e).then((function(e){return e.text()})).then((function(n){switch(t.art.emit("subtitle:load",e),_e(e)){case"srt":return De($e(n));case"ass":return De(Te(n));case"vtt":return De(n);default:return e}})).then((function(e){return i.innerHTML="",t.url===e?e:(URL.revokeObjectURL(t.url),a.src=e,e)})).catch((function(e){throw r.show=e,t.art.emit("subtitle:err",e),e}))}},{key:"url",get:function(){return this.art.template.$track.src}},{key:"textTrack",get:function(){return this.art.template.$video.textTracks[0]}},{key:"activeCue",get:function(){return this.textTrack.activeCues[0]}}]),t}(st);var Zt=function(){function e(t){var n=this;i(this,e),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),t.whitelist.state&&t.on("ready",(function(){!function(e,t){var n=e.template.$player;t.proxy(document,["click","contextmenu"],(function(t){t.composedPath().indexOf(n)>-1?(e.isFocus=!0,e.emit("focus")):(e.isFocus=!1,e.emit("blur"))}))}(t,n),function(e,t){var n=e.template.$player;t.hover(n,(function(){ve(n,"art-hover"),e.emit("hoverenter")}),(function(){me(n,"art-hover"),e.emit("hoverleave")}))}(t,n),function(e,t){var n=e.template,r=n.$player,o=n.$video,i=e.player,a=Ue((function(){ve(r,"art-hide-cursor"),me(r,"art-hover"),e.controls.show=!1}),3e3);e.on("hoverleave",(function(){i.playing&&a()})),t.proxy(r,"mousemove",(function(t){a.clearTimeout(),me(r,"art-hide-cursor"),e.controls.show=!0,!e.player.pip&&i.playing&&t.target===o&&a(),e.emit("mousemove")}))}(t,n),function(e,t){var n=e.option,r=e.player,o=e.template.$player,i=document.createElement("object");i.setAttribute("aria-hidden","true"),i.setAttribute("tabindex",-1),i.type="text/html",i.data="about:blank";var a=r.width,c=r.height,u=Be((function(){r.width===a&&r.height===c||(a=r.width,c=r.height,n.autoSize&&(e.player.fullscreen||e.player.fullscreenWeb||e.player.pip?e.player.autoSize=!1:e.player.autoSize=!0),e.player.aspectRatioReset=!0,e.emit("resize",{width:r.width,height:r.height}))}),500);t.proxy(i,"load",(function(){t.proxy(i.contentDocument.defaultView,"resize",u)})),o.appendChild(i)}(t,n)}))}return c(e,[{key:"proxy",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(Array.isArray(t))return t.map((function(t){return r.proxy(e,t,n,o)}));e.addEventListener(t,n,o);var i=function(){return e.removeEventListener(t,n,o)};return this.destroyEvents.push(i),i}},{key:"hover",value:function(e,t,n){t&&this.proxy(e,"mouseenter",t),n&&this.proxy(e,"mouseleave",n)}},{key:"loadImg",value:function(e){var t=this;return new Promise((function(n,r){var o;if(e instanceof HTMLImageElement)o=e;else{if("string"!=typeof e)return r(e);(o=new Image).src=e}return o.complete?n(o):(t.proxy(o,"load",(function(){return n(o)})),t.proxy(o,"error",(function(){return r(o)})),e)}))}},{key:"destroy",value:function(){this.destroyEvents.forEach((function(e){return e()}))}}]),e}(),Jt=function(){function e(t){var n=this;i(this,e),this.keys={};var r=t.option,o=t.player,a=t.events.proxy;r.hotkey&&t.on("ready",(function(){n.add(27,(function(){o.fullscreenWeb&&(o.fullscreenWeb=!1)})),n.add(32,(function(){o.toggle=!0})),n.add(37,(function(){o.seek=o.currentTime-5})),n.add(38,(function(){o.volume+=.1})),n.add(39,(function(){o.seek=o.currentTime+5})),n.add(40,(function(){o.volume-=.1})),a(window,"keydown",(function(e){if(t.isFocus){var r=document.activeElement.tagName.toUpperCase(),o=document.activeElement.getAttribute("contenteditable");if("INPUT"!==r&&"TEXTAREA"!==r&&""!==o&&"true"!==o){var i=n.keys[e.keyCode];i&&(e.preventDefault(),i.forEach((function(e){return e()})),t.emit("hotkey",e))}}}))}))}return c(e,[{key:"add",value:function(e,t){this.keys[e]?this.keys[e].push(t):this.keys[e]=[t]}}]),e}(),Gt=function(e){function t(e){var n;return i(this,t),(n=s(this,l(t).call(this,e))).$parent=e.template.$layer,e.on("ready",(function(){e.option.layers.forEach((function(e){n.add(e)}))})),n}return p(t,e),t}(st),Qt=function(e){function t(e){var n;return i(this,t),n=s(this,l(t).call(this,e)),be(e.template.$loading,e.icons.loading),n}return p(t,e),t}(st),Kt=function(){function e(t){i(this,e),this.art=t,this.time=1e3,this.timer=null}return c(e,[{key:"show",set:function(e){var t=this.art.template,n=t.$player;t.$noticeInner.innerText=e instanceof Error?e.message.trim():e,ve(n,"art-notice-show"),clearTimeout(this.timer),this.timer=setTimeout((function(){me(n,"art-notice-show")}),this.time)}}]),e}(),en=function(e){function t(e){var n;return i(this,t),n=s(this,l(t).call(this,e)),be(e.template.$state,e.icons.state),n}return p(t,e),t}(st),tn=function e(t){var n=this;i(this,e);var r=Object.assign({loading:'<svg xmlns="http://www.w3.org/2000/svg" width="50px" height="50px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-default"><rect x="0" y="0" width="100" height="100" fill="none" class="bk"/><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(0 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-1s" repeatCount="indefinite"/></rect><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(30 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"/></rect><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(60 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"/></rect><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(90 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.75s" repeatCount="indefinite"/></rect><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(120 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"/></rect><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(150 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"/></rect><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(180 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.5s" repeatCount="indefinite"/></rect><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(210 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"/></rect><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(240 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"/></rect><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(270 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.25s" repeatCount="indefinite"/></rect><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(300 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"/></rect><rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(330 50 50) translate(0 -30)"><animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"/></rect></svg>',state:'<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"><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"/></svg>',play:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22"><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></svg>',pause:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22"><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></svg>',volume:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22"><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><path d="M15 11a3.998 3.998 0 0 0-2-3.465v6.93A3.998 3.998 0 0 0 15 11z"></path></svg>',volumeClose:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22"><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><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></svg>',subtitle:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 48 48"><path d="M0 0h48v48H0z" fill="none"/><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"/></svg>',screenshot:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 50 50">\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 "/></svg>',setting:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22"><circle cx="11" cy="11" r="2"></circle><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></svg>',fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36">\t<path d="m 10,16 2,0 0,-4 4,0 0,-2 L 10,10 l 0,6 0,0 z"></path>\t<path d="m 20,10 0,2 4,0 0,4 2,0 L 26,10 l -6,0 0,0 z"></path>\t<path d="m 24,24 -4,0 0,2 L 26,26 l 0,-6 -2,0 0,4 0,0 z"></path>\t<path d="M 12,20 10,20 10,26 l 6,0 0,-2 -4,0 0,-4 0,0 z"></path></svg>',fullscreenWeb:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" height="36" width="36">\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></svg>',pip:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" height="32" width="32"><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></svg>',prev:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36"><path d="m 12,12 h 2 v 12 h -2 z m 3.5,6 8.5,6 V 12 z"></path></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36"><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></svg>'},t.option.icons);Object.keys(r).forEach((function(e){var t=document.createElement("i");t.classList.add("art-icon"),t.classList.add("art-icon-".concat(e)),be(t,r[e]),n[e]=t}))};function nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rn(e){return function(t){var r=t.i18n,o=t.player;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nn(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{html:'<div class="art-setting-header">'.concat(r.get("Flip"),'</div><div class="art-setting-radio"><div class="art-radio-item current"><button type="button" data-value="normal">').concat(r.get("Normal"),'</button></div><div class="art-radio-item"><button type="button" data-value="horizontal">').concat(r.get("Horizontal"),'</button></div><div class="art-radio-item"><button type="button" data-value="vertical">').concat(r.get("Vertical"),"</button></div></div>"),click:function(e,t){var n=t.target.dataset.value;n&&(o.flip=n)},mounted:function(e){t.on("flipChange",(function(t){var n=ye("button",e).find((function(e){return e.dataset.value===t}));n&&xe(n.parentElement,"current")}))}})}}function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function an(e){return function(t){var r=t.i18n,o=t.player;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?on(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):on(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{html:'<div class="art-setting-header">'.concat(r.get("Aspect ratio"),'</div><div class="art-setting-radio"><div class="art-radio-item current"><button type="button" data-value="default">').concat(r.get("Default"),'</button></div><div class="art-radio-item"><button type="button" data-value="4:3">4:3</button></div><div class="art-radio-item"><button type="button" data-value="16:9">16:9</button></div></div>'),click:function(e,t){var n=t.target.dataset.value;n&&(o.aspectRatio=n)},mounted:function(e){t.on("aspectRatioChange",(function(t){var n=ye("button",e).find((function(e){return e.dataset.value===t}));n&&xe(n.parentElement,"current")}))}})}}function cn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function un(e){return function(t){var r=t.i18n,o=t.player,i=t.events.proxy;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?cn(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{html:'<div class="art-setting-header">'.concat(r.get("Play speed"),': <span class="art-subtitle-value">1.0</span>x</div><div class="art-setting-range"><input class="art-subtitle-range" value="1" type="range" min="0.5" max="2" step="0.25"></div>'),mounted:function(e){var n=he(".art-setting-range input",e),r=he(".art-subtitle-value",e);i(n,"change",(function(){var e=n.value;r.innerText=e,o.playbackRate=Number(e)})),t.on("playbackRateChange",(function(e){n.value!==e&&(n.value=e,r.innerText=e)}))}})}}var sn=function(e){function t(e){var n;i(this,t),n=s(this,l(t).call(this,e));var r=e.option,o=e.template,a=o.$setting,c=o.$settingBody,u=e.events.proxy;return n.$parent=c,r.setting&&(e.on("ready",(function(){u(a,"click",(function(e){e.target===a&&(n.show=!1)})),n.add(rn({disable:!r.flip,name:"flip"})),n.add(an({disable:!r.aspectRatio,name:"aspectRatio"})),n.add(un({disable:!r.playbackRate,name:"playbackRate"}))})),e.on("blur",(function(){n.show=!1}))),n}return p(t,e),t}(st),ln=function(){function e(t){i(this,e),this.name="artplayer_settings";var n=this.get("volume");n&&(t.option.volume=n)}return c(e,[{key:"get",value:function(e){var t=JSON.parse(localStorage.getItem(this.name))||{};return e?t[e]:{}}},{key:"set",value:function(e,t){var r=Object.assign({},this.get(),n({},e,t));localStorage.setItem(this.name,JSON.stringify(r))}},{key:"del",value:function(e){var t=this.get();delete t[e],localStorage.setItem(this.name,JSON.stringify(t))}},{key:"clean",value:function(){localStorage.removeItem(this.name)}}]),e}();function fn(e){var t=e.i18n,n=e.subtitle,r=e.events.proxy;return{title:"Subtitle",name:"subtitleOffset",index:20,html:'<div class="art-setting-header">'.concat(t.get("Subtitle offset time"),': <span class="art-subtitle-value">0</span>s</div><div class="art-setting-range"><input class="art-subtitle-range" value="0" type="range" min="-5" max="5" step="0.5"></div>'),mounted:function(t){var o=he(".art-setting-range input",t),i=he(".art-subtitle-value",t);r(o,"change",(function(){var t=o.value;i.innerText=t,e.plugins.subtitleOffset.offset(Number(t))})),e.on("subtitle:switch",(function(){o.value=0,i.innerText=0})),e.on("subtitleOffset",(function(e){n.update(),o.value!==e&&(o.value=e,i.innerText=e)}))}}}function pn(e){var t=e.constructor.utils.clamp,n=e.setting,r=e.notice,o=e.template,i=e.i18n,a=e.player;n.add(fn);var c=[];return e.on("subtitle:switch",(function(){c=[]})),{name:"subtitleOffset",offset:function(n){if(o.$track&&o.$track.track){var u=Array.from(o.$track.track.cues),s=t(n,-5,5);u.forEach((function(e,n){c[n]||(c[n]={startTime:e.startTime,endTime:e.endTime}),e.startTime=t(c[n].startTime+s,0,a.duration),e.endTime=t(c[n].endTime+s,0,a.duration)})),r.show="".concat(i.get("Subtitle offset time"),": ").concat(n,"s"),e.emit("subtitleOffset",n)}else r.show="".concat(i.get("No subtitles found")),e.emit("subtitleOffset",0)}}}function dn(e){var t=e.events.proxy,n=e.template,r=e.player,o=e.option,i=e.setting,a=e.i18n;function c(t){if(t){var i=n.$video.canPlayType(t.type);if("maybe"===i||"probably"===i){var a=URL.createObjectURL(t);o.title=t.name,r.switchUrl(a,t.name),e.emit("localVideo",t)}else Ce(!1,"Playback of this file format is not supported")}}function u(e){var n=be(e,'<input type="file">');we(e,"position","relative"),Oe(n,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),t(n,"change",(function(){c(n.files[0])}))}return t(n.$player,"dragover",(function(e){e.preventDefault()})),t(n.$player,"drop",(function(e){e.preventDefault(),c(e.dataTransfer.files[0])})),e.on("ready",(function(){i.add({title:"Local Video",name:"localVideo",index:30,html:'<div class="art-setting-header">'.concat(a.get("Local Video"),'</div><div class="art-setting-upload"><div class="art-upload-btn">').concat(a.get("Open"),'</div><div class="art-upload-value"></div></div>'),mounted:function(t){var n=he(".art-upload-btn",t),r=he(".art-upload-value",t);e.on("localVideo",(function(e){r.textContent=e.name,r.title=e.name})),u(n)}})})),{name:"localVideo",attach:u}}function hn(e){var t=e.events.proxy,n=e.subtitle,r=e.setting,o=e.i18n;function i(r){var o=be(r,'<input type="file">');we(r,"position","relative"),Oe(o,{position:"absolute",width:"100%",height:"100%",left:"0",top:"0",opacity:"0"}),t(o,"change",(function(){!function(r){if(r){var o=_e(r.name);if(["ass","vtt","srt"].includes(o)){var i=new FileReader;t(i,"load",(function(t){var i=t.target.result;switch(o){case"srt":var a=De($e(i));n.switch(a,r.name);break;case"ass":var c=De(Te(i));n.switch(c,r.name);break;case"vtt":var u=De(i);n.switch(u,r.name)}e.emit("localSubtitle",r)})),i.readAsText(r)}else Ce(!1,"Only supports subtitle files in .ass, .vtt and .srt format")}}(o.files[0])}))}return e.on("ready",(function(){r.add({title:"Local Subtitle",name:"localSubtitle",index:40,html:'<div class="art-setting-header">'.concat(o.get("Local Subtitle"),'</div><div class="art-setting-upload"><div class="art-upload-btn">').concat(o.get("Open"),'</div><div class="art-upload-value"></div></div>'),mounted:function(t){var n=he(".art-upload-btn",t),r=he(".art-upload-value",t);e.on("localSubtitle",(function(e){r.textContent=e.name,r.title=e.name})),i(n)}})})),{name:"localSubtitle",attach:i}}function yn(e){var t=e.layers,n=e.player,r=e.option.theme;return t.add({name:"miniProgressBar",style:{display:"none",position:"absolute",left:0,right:0,bottom:0,height:"2px",background:r},mounted:function(t){e.on("control:toggle",(function(e){t.style.display=e?"none":"block"})),e.on("destroy",(function(){t.style.display="none"})),e.on("video:timeupdate",(function(){t.style.width="".concat(100*n.played,"%")}))}}),{name:"miniProgressBar"}}function vn(e){var t=1e4,n=0,r=0,o=0,i=null;function a(){n=0,r=0,o=0,cancelAnimationFrame(i),i=null}function c(){i||function a(){e.isDestroy||(i=requestAnimationFrame((function(){var i=Date.now();if(o){var c=i-o;r+=c,e.player.playing||(n+=c)}o=i,e.emit("networkMonitor",n/r),r>=t&&(n=0,r=0),a()})))}()}return e.on("play",c),e.on("pause",a),{name:"networkMonitor",reset:a,start:c,sample:function(e){t=e}}}function mn(e){var t=e.events,n=e.player,r=e.template,o=Ue((function(){var t=r.$player.getBoundingClientRect();t.top+t.height<=0&&!n.pip?(n.pip=!0,e.emit("autoPip",!0)):n.pip&&(n.pip=!1,e.emit("autoPip",!1))}),300);return t.proxy(window,"scroll",o),{name:"autoPip"}}var gn=function(){function e(t){var n=this;i(this,e),this.art=t,this.id=0;var r=t.option;r.subtitle.url&&r.subtitleOffset&&this.add(pn),!r.isLive&&r.miniProgressBar&&this.add(yn),r.localVideo&&this.add(dn),r.localSubtitle&&this.add(hn),r.networkMonitor&&this.add(vn),r.autoPip&&this.add(mn),t.option.plugins.forEach((function(e){n.add(e)}))}return c(e,[{key:"add",value:function(e){this.id+=1;var t=e.call(this,this.art),n="";return Ce(!Fe(this,n=t&&t.name?t.name:e.name?e.name:"plugin".concat(this.id)),"Cannot add a plugin that already has the same name: ".concat(n)),Object.defineProperty(this,n,{value:t}),this.art.emit("plugin:add",e),this}}]),e}(),bn=function e(t){i(this,e);var n=t.option,r=t.events.proxy,o=t.template.$video;Qe.video.events.forEach((function(e){r(o,e,(function(e){t.emit("video:".concat(e.type),e)}))})),Object.keys(n.moreVideoAttr).forEach((function(e){o[e]=n.moreVideoAttr[e]})),n.muted&&(o.muted=n.muted),n.volume&&(o.volume=Ye(n.volume,0,1)),n.poster&&(o.poster=n.poster),n.autoplay&&(o.autoplay=n.autoplay),o.controls=!0;var a=n.type||_e(n.url),c=n.customType[a];a&&c?(t.emit("beforeCustomType",a),c(o,n.url,t),t.emit("afterCustomType",a)):(t.emit("beforeAttachUrl",n.url),o.src=n.url,t.emit("afterAttachUrl",o.src))},wn=0,On=function(e){function t(e){var n;return i(this,t),(n=s(this,l(t).call(this))).option=pe(Ne(t.option,e),Ge),n.isFocus=!1,n.isDestroy=!1,n.whitelist=new Ke(u(n)),n.template=new et(u(n)),n.events=new Zt(u(n)),n.whitelist.state?(n.storage=new ln(u(n)),n.icons=new tn(u(n)),n.i18n=new rt(u(n)),n.notice=new Kt(u(n)),n.player=new at(u(n)),n.layers=new Gt(u(n)),n.controls=new Lt(u(n)),n.contextmenu=new Bt(u(n)),n.subtitle=new Xt(u(n)),n.info=new Yt(u(n)),n.loading=new Qt(u(n)),n.hotkey=new Jt(u(n)),n.mask=new en(u(n)),n.setting=new sn(u(n)),n.plugins=new gn(u(n))):n.mobile=new bn(u(n)),wn+=1,n.id=wn,t.instances.push(u(n)),n}return p(t,e),c(t,[{key:"destroy",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.events.destroy(),this.template.destroy(e),t.instances.splice(t.instances.indexOf(this),1),this.isDestroy=!0,this.emit("destroy")}}],[{key:"version",get:function(){return"3.2.4"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return Qe}},{key:"utils",get:function(){return Ze}},{key:"scheme",get:function(){return Ge}},{key:"Emitter",get:function(){return de}},{key:"validator",get:function(){return pe}},{key:"kindOf",get:function(){return pe.kindOf}},{key:"option",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",theme:"#f00",volume:.7,isLive:!1,muted:!1,autoplay:!1,autoSize:!1,loop:!1,flip:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,fullscreen:!1,fullscreenWeb:!1,subtitleOffset:!1,miniProgressBar:!1,localVideo:!1,localSubtitle:!1,autoPip:!1,networkMonitor:!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:"metadata"},icons:{},customType:{},lang:navigator.language.toLowerCase()}}}]),t}(de);function jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jn(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}return Object.defineProperty(On,"instances",{value:[]}),console.log("%c ArtPlayer %c 3.2.4 %c https://artplayer.org","color: #fff; background: #5f5f5f","color: #fff; background: #4bc729",""),function(e){function n(e){var t;return i(this,n),t=s(this,l(n).call(this,e)),On.utils.errorHandle(e.option&&"object"===o(e.option),"The prop 'option' object cannot be missing"),t.instance=null,t.artRef=fe.createRef(),t}return p(n,e),c(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.option,n=e.getInstance;this.instance=new On(kn({},t,{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 e=this.props,n=(e.option,e.getInstance,t(e,["option","getInstance"]));return fe.createElement("div",kn({ref:this.artRef},n))}}]),n}(fe.Component)}));
|