vendor: 4,421 bytes, line 1
1(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{20:function(e,t,i){(function(e,i,n,r){i.exports=function(){"use strict";function o(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function a(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?o(Object(i),!0).forEach((function(t){p(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function s(){s=function(){return t};var e,t={},i=Object.prototype,n=i.hasOwnProperty,r=Object.defineProperty||function(e,t,i){e[t]=i.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,i){return e[t]=i}}function h(e,t,i,n){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),s=new O(n||[]);return r(a,"_invoke",{value:C(e,i,s)}),a}function d(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var f="suspendedStart",p="executing",g="completed",v={};function y(){}function m(){}function _(){}var b={};u(b,a,(function(){return this}));var k=Object.getPrototypeOf,w=k&&k(k(I([])));w&&w!==i&&n.call(w,a)&&(b=w);var S=_.prototype=y.prototype=Object.create(b);function T(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function i(r,o,a,s){var l=d(e[r],e,o);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function C(t,i,n){var r=f;return function(o,a){if(r===p)throw new Error("Generator is already running");if(r===g){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=x(s,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=d(t,i,n);if("normal"===c.type){if(r=n.done?g:"suspendedYield",c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=g,n.method="throw",n.arg=c.arg)}}}function x(t,i){var n=i.method,r=t.iterator[n];if(r===e)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=e,x(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=d(r,t.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,v;var a=o.arg;return a?a.done?(i[t.resultName]=a.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,v):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,v)}function D(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(D,this),this.reset(!0)}function I(t){if(t||""===t){var i=t[a];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function i(){for(;++r<t.length;)if(n.call(t,r))return i.value=t[r],i.done=!1,i;return i.value=e,i.done=!0,i};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return m.prototype=_,r(S,"constructor",{value:_,configurable:!0}),r(_,"constructor",{value:m,configurable:!0}),m.displayName=u(_,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,u
vendor: 4,250 bytes, line 1
1(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},T(E.prototype),u(E.prototype,l,(function(){return this})),t.AsyncIterator=E,t.async=function(e,i,n,r,o){void 0===o&&(o=Promise);var a=new E(h(e,i,n,r),o);return t.isGeneratorFunction(i)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},T(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=I,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function r(n,r){return s.type="throw",s.arg=t,i.next=n,r&&(i.method="next",i.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),P(i),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;P(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:I(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function l(e){return(l="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 c(e,t,i,n,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,r)}function u(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function a(e){c(o,n,r,a,s,"next",e)}function s(e){c(o,n,r,a,s,"throw",e)}a(void 0)}))}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,D(n.key),n)}}function f(e,t,i){return t&&d(e.prototype,t),i&&d(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function p(e,t,i){return(t=D(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function g(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}
1function y(e,t){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _(e)}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=v(e);if(t){var r=v(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return b(this,i)}}function w(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}function S(){return S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=w(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},S.apply(this,arguments)}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,a,s=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||C(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e){return function(e){if(Array.isArray(e))return x(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||C(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){if(e){if("string"==typeof e)return x(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?x(e,t):void 0}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function D(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function P(e,t){return e===t||e!=e&&t!=t}function O(e,t){for(var i=e.length;i--;)if(P(e[i][0],t))return i;return-1}var I=Array.prototype.splice;function L(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}L.prototype.clear=function(){this.__data__=[],this.size=0},L.prototype.delete=function(e){var t=this.__data__,i=O(t,e);return!(i<0||(i==t.length-1?t.pop():I.call(t,i,1),--this.size,0))},L.prototype.get=function(e){var t=this.__data__,i=O(t,e);return i<0?void 0:t[i][1]},L.prototype.has=function(e){return O(this.__data__,e)>-1},L.prototype.set=function(e,t){var i=this.__data__,n=O(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var A="object"==(void 0===e?"undefined":l(e))&&e&&e.Object===Object&&e,R="object"==("undefined"==typeof self?"undefined":l(self))&&self&&self.Object===Object&&self,M=A||R||Function("return this")(),N=M.Symbol,B=Object.prototype,U=B.hasOwnProperty,j=B.toString,H=N?N.toStringTag:void 0,F=Object.prototype.toString,V=N?N.toStringTag:void 0;
1function z(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":V&&V in Object(e)?function(e){var t=U.call(e,H),i=e[H];try{e[H]=void 0;var n=!0}catch(e){}var r=j.call(e);return n&&(t?e[H]=i:delete e[H]),r}(e):function(e){return F.call(e)}(e)}function G(e){var t=l(e);return null!=e&&("object"==t||"function"==t)}function W(e){if(!G(e))return!1;var t=z(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var K,Y=M["__core-js_shared__"],$=(K=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"",q=Function.prototype.toString;function X(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var J=/^\[object .+?Constructor\]$/,Z=Function.prototype,Q=Object.prototype,ee=Z.toString,te=Q.hasOwnProperty,ie=RegExp("^"+ee.call(te).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ne(e){return!(!G(e)||(t=e,$&&$ in t))&&(W(e)?ie:J).test(X(e));var t}function re(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return ne(i)?i:void 0}var oe=re(M,"Map"),ae=re(Object,"create"),se=Object.prototype.hasOwnProperty,le=Object.prototype.hasOwnProperty;function ce(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function ue(e,t){var i,n,r=e.__data__;return("string"==(n=l(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof t?"string":"hash"]:r.map}function he(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function de(e){var t=this.__data__=new L(e);this.size=t.size}ce.prototype.clear=function(){this.__data__=ae?ae(null):{},this.size=0},ce.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ce.prototype.get=function(e){var t=this.__data__;if(ae){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return se.call(t,e)?t[e]:void 0},ce.prototype.has=function(e){var t=this.__data__;return ae?void 0!==t[e]:le.call(t,e)},ce.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=ae&&void 0===t?"__lodash_hash_undefined__":t,this},he.prototype.clear=function(){this.size=0,this.__data__={hash:new ce,map:new(oe||L),string:new ce}},he.prototype.delete=function(e){var t=ue(this,e).delete(e);return this.size-=t?1:0,t},he.prototype.get=function(e){return ue(this,e).get(e)},he.prototype.has=function(e){return ue(this,e).has(e)},he.prototype.set=function(e,t){var i=ue(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this},de.prototype.clear=function(){this.__data__=new L,this.size=0},de.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},de.prototype.get=function(e){return this.__data__.get(e)},de.prototype.has=function(e){return this.__data__.has(e)},de.prototype.set=function(e,t){var i=this.__data__;if(i instanceof L){var n=i.__data__;if(!oe||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new he(n)}return i.set(e,t),this.size=i.size,this};var fe=function(){try{var e=re(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),pe=fe;function ge(e,t,i){"__proto__"==t&&pe?pe(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}var ve=Object.prototype.hasOwnProperty;function ye(e,t,i){var n=e[t];ve.call(e,t)&&P(n,i)&&(void 0!==i||t in e)||ge(e,t,i)}function me(e,t,i,n){var r=!i;i||(i={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=n?n(i[s],e[s],s,i,e):void 0;void 0===l&&(l=e[s]),r?ge(i,s,l):ye(i,s,l)}return i}function _e(e){return null!=e&&"object"==l(e)}function be(e){return _e(e)&&"[object Arguments]"==z(e)}var ke=Object.prototype,we=ke.hasOwnProperty,Se=ke.propertyIsEnumerable,Te=be(function(){return arguments}())?be:function(e){return _e(e)&&we.call(e,"callee")&&!Se.call(e,"callee")},Ee=Te,Ce=Array.isArray,xe="object"==l(t)&&t&&!t.nodeType&&t,De=xe&&"object"==l(i)&&i&&!i.nodeType&&i,Pe=De&&De.exports===xe?M.Buffer:void 0,Oe=(Pe?Pe.isBuffer:void 0)||function(){return!1},Ie=/^(?:0|[1-9]\d*)$/;function Le(e,t){var i=l(e);return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Ie.test(e))&&e>-1&&e%1==0&&e<t}function Ae(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var Re={};function Me(e){return function(t){return e(t)}}
1Re["[object Float32Array]"]=Re["[object Float64Array]"]=Re["[object Int8Array]"]=Re["[object Int16Array]"]=Re["[object Int32Array]"]=Re["[object Uint8Array]"]=Re["[object Uint8ClampedArray]"]=Re["[object Uint16Array]"]=Re["[object Uint32Array]"]=!0,Re["[object Arguments]"]=Re["[object Array]"]=Re["[object ArrayBuffer]"]=Re["[object Boolean]"]=Re["[object DataView]"]=Re["[object Date]"]=Re["[object Error]"]=Re["[object Function]"]=Re["[object Map]"]=Re["[object Number]"]=Re["[object Object]"]=Re["[object RegExp]"]=Re["[object Set]"]=Re["[object String]"]=Re["[object WeakMap]"]=!1;var Ne="object"==l(t)&&t&&!t.nodeType&&t,Be=Ne&&"object"==l(i)&&i&&!i.nodeType&&i,Ue=Be&&Be.exports===Ne&&A.process,je=function(){try{return Be&&Be.require&&Be.require("util").types||Ue&&Ue.binding&&Ue.binding("util")}catch(e){}}(),He=je&&je.isTypedArray,Fe=He?Me(He):function(e){return _e(e)&&Ae(e.length)&&!!Re[z(e)]},Ve=Object.prototype.hasOwnProperty;function ze(e,t){var i=Ce(e),n=!i&&Ee(e),r=!i&&!n&&Oe(e),o=!i&&!n&&!r&&Fe(e),a=i||n||r||o,s=a?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],l=s.length;for(var c in e)!t&&!Ve.call(e,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Le(c,l))||s.push(c);return s}var Ge=Object.prototype;function We(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ge)}function Ke(e,t){return function(i){return e(t(i))}}var Ye=Ke(Object.keys,Object),$e=Object.prototype.hasOwnProperty;function qe(e){return null!=e&&Ae(e.length)&&!W(e)}function Xe(e){return qe(e)?ze(e):function(e){if(!We(e))return Ye(e);var t=[];for(var i in Object(e))$e.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}var Je=Object.prototype.hasOwnProperty;function Ze(e){if(!G(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=We(e),i=[];for(var n in e)("constructor"!=n||!t&&Je.call(e,n))&&i.push(n);return i}function Qe(e){return qe(e)?ze(e,!0):Ze(e)}var et="object"==l(t)&&t&&!t.nodeType&&t,tt=et&&"object"==l(i)&&i&&!i.nodeType&&i,it=tt&&tt.exports===et?M.Buffer:void 0,nt=it?it.allocUnsafe:void 0;function rt(e,t){if(t)return e.slice();var i=e.length,n=nt?nt(i):new e.constructor(i);return e.copy(n),n}function ot(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}function at(){return[]}var st=Object.prototype.propertyIsEnumerable,lt=Object.getOwnPropertySymbols,ct=lt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var i=-1,n=null==e?0:e.length,r=0,o=[];++i<n;){var a=e[i];t(a,i,e)&&(o[r++]=a)}return o}(lt(e),(function(t){return st.call(e,t)})))}:at;function ut(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e}var ht=Ke(Object.getPrototypeOf,Object),dt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)ut(t,ct(e)),e=ht(e);return t}:at;function ft(e,t,i){var n=t(e);return Ce(e)?n:ut(n,i(e))}function pt(e){return ft(e,Xe,ct)}function gt(e){return ft(e,Qe,dt)}var vt=re(M,"DataView"),yt=re(M,"Promise"),mt=re(M,"Set"),_t=re(M,"WeakMap"),bt="[object Map]",kt="[object Promise]",wt="[object Set]",St="[object WeakMap]",Tt="[object DataView]",Et=X(vt),Ct=X(oe),xt=X(yt),Dt=X(mt),Pt=X(_t),Ot=z;(vt&&Ot(new vt(new ArrayBuffer(1)))!=Tt||oe&&Ot(new oe)!=bt||yt&&Ot(yt.resolve())!=kt||mt&&Ot(new mt)!=wt||_t&&Ot(new _t)!=St)&&(Ot=function(e){var t=z(e),i="[object Object]"==t?e.constructor:void 0,n=i?X(i):"";if(n)switch(n){case Et:return Tt;case Ct:return bt;case xt:return kt;case Dt:return wt;case Pt:return St}return t});var It=Ot,Lt=Object.prototype.hasOwnProperty,At=M.Uint8Array;function Rt(e){var t=new e.constructor(e.byteLength);return new At(t).set(new At(e)),t}var Mt=/\w*$/,Nt=N?N.prototype:void 0,Bt=Nt?Nt.valueOf:void 0;function Ut(e,t){var i=t?Rt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function jt(e,t,i){var n,r,o,a=e.constructor;switch(t){case"[object ArrayBuffer]":return Rt(e);case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return function(e,t){var i=t?Rt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);
1case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ut(e,i);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(e);case"[object RegExp]":return(o=new(r=e).constructor(r.source,Mt.exec(r))).lastIndex=r.lastIndex,o;case"[object Symbol]":return n=e,Bt?Object(Bt.call(n)):{}}}var Ht=Object.create,Ft=function(){function e(){}return function(t){if(!G(t))return{};if(Ht)return Ht(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function Vt(e){return"function"!=typeof e.constructor||We(e)?{}:Ft(ht(e))}var zt=je&&je.isMap,Gt=zt?Me(zt):function(e){return _e(e)&&"[object Map]"==It(e)},Wt=je&&je.isSet,Kt=Wt?Me(Wt):function(e){return _e(e)&&"[object Set]"==It(e)},Yt="[object Arguments]",$t="[object Function]",qt="[object Object]",Xt={};function Jt(e,t,i,n,r,o){var a,s=1&t,l=2&t,c=4&t;if(i&&(a=r?i(e,n,r,o):i(e)),void 0!==a)return a;if(!G(e))return e;var u=Ce(e);if(u){if(a=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&Lt.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!s)return ot(e,a)}else{var h=It(e),d=h==$t||"[object GeneratorFunction]"==h;if(Oe(e))return rt(e,s);if(h==qt||h==Yt||d&&!r){if(a=l||d?{}:Vt(e),!s)return l?function(e,t){return me(e,dt(e),t)}(e,function(e,t){return e&&me(t,Qe(t),e)}(a,e)):function(e,t){return me(e,ct(e),t)}(e,function(e,t){return e&&me(t,Xe(t),e)}(a,e))}else{if(!Xt[h])return r?e:{};a=jt(e,h,s)}}o||(o=new de);var f=o.get(e);if(f)return f;o.set(e,a),Kt(e)?e.forEach((function(n){a.add(Jt(n,t,i,n,e,o))})):Gt(e)&&e.forEach((function(n,r){a.set(r,Jt(n,t,i,r,e,o))}));var p=u?void 0:(c?l?gt:pt:l?Qe:Xe)(e);return function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););}(p||e,(function(n,r){p&&(n=e[r=n]),ye(a,r,Jt(n,t,i,r,e,o))})),a}function Zt(e){return Jt(e,5)}function Qt(e,t,i){(void 0!==i&&!P(e[t],i)||void 0===i&&!(t in e))&&ge(e,t,i)}Xt[Yt]=Xt["[object Array]"]=Xt["[object ArrayBuffer]"]=Xt["[object DataView]"]=Xt["[object Boolean]"]=Xt["[object Date]"]=Xt["[object Float32Array]"]=Xt["[object Float64Array]"]=Xt["[object Int8Array]"]=Xt["[object Int16Array]"]=Xt["[object Int32Array]"]=Xt["[object Map]"]=Xt["[object Number]"]=Xt[qt]=Xt["[object RegExp]"]=Xt["[object Set]"]=Xt["[object String]"]=Xt["[object Symbol]"]=Xt["[object Uint8Array]"]=Xt["[object Uint8ClampedArray]"]=Xt["[object Uint16Array]"]=Xt["[object Uint32Array]"]=!0,Xt["[object Error]"]=Xt[$t]=Xt["[object WeakMap]"]=!1;var ei,ti=function(e,t,i){for(var n=-1,r=Object(e),o=i(e),a=o.length;a--;){var s=o[ei?a:++n];if(!1===t(r[s],s,r))break}return e},ii=Function.prototype,ni=Object.prototype,ri=ii.toString,oi=ni.hasOwnProperty,ai=ri.call(Object);function si(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function li(e,t,i,n,r,o,a){var s=si(e,i),l=si(t,i),c=a.get(l);if(c)Qt(e,i,c);else{var u,h=o?o(s,l,i+"",e,t,a):void 0,d=void 0===h;if(d){var f=Ce(l),p=!f&&Oe(l),g=!f&&!p&&Fe(l);h=l,f||p||g?Ce(s)?h=s:_e(u=s)&&qe(u)?h=ot(s):p?(d=!1,h=rt(l,!0)):g?(d=!1,h=Ut(l,!0)):h=[]:function(e){if(!_e(e)||"[object Object]"!=z(e))return!1;var t=ht(e);if(null===t)return!0;var i=oi.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&ri.call(i)==ai}(l)||Ee(l)?(h=s,Ee(s)?h=function(e){return me(e,Qe(e))}(s):G(s)&&!W(s)||(h=Vt(l))):d=!1}d&&(a.set(l,h),r(h,l,n,o,a),a.delete(l)),Qt(e,i,h)}}function ci(e,t,i,n,r){e!==t&&ti(t,(function(o,a){if(r||(r=new de),G(o))li(e,t,a,i,ci,n,r);else{var s=n?n(si(e,a),o,a+"",e,t,r):void 0;void 0===s&&(s=o),Qt(e,a,s)}}),Qe)}function ui(e){return e}function hi(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}var di,fi,pi,gi=Math.max,vi=pe?function(e,t){return pe(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:ui,yi=vi,mi=Date.now,_i=(di=yi,fi=0,pi=0,function(){var e=mi(),t=16-(e-pi);if(pi=e,t>0){if(++fi>=800)return arguments[0]}else fi=0;return di.apply(void 0,arguments)}),bi=_i;function ki(e,t){return bi(function(e,t,i){return t=gi(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,o=gi(n.length-t,0),a=Array(o);++r<o;)a[r]=n[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=n[r];return s[t]=i(a),hi(e,this,s)}}(e,t,ui),e+"")}function wi(e){return ki((function(t,i){var n=-1,r=i.length,o=r>1?i[r-1]:void 0,a=r>2?i[2]:void 0;for(o=e.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,i){if(!G(i))return!1;var n=l(t);return!!("number"==n?qe(i)&&Le(t,i.length):"string"==n&&t in i)&&P(i[t],e)}(i[0],i[1],a)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=i[n];s&&e(t,s,n,o)}return t}))}var Si=wi((function(e,t,i,n){ci(e,t,i,n)}));function Ti(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new he;++t<i;)this.add(e[t])}function Ei(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function Ci(e,t){return e.has(t)}function xi(e,t,i,n,r,o){var a=1&i,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,f=2&i?new Ti:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var p=e[h],g=t[h];if(n)var v=a?n(g,p,h,t,e,o):n(p,g,h,e,t,o);if(void 0!==v){if(v)continue;d=!1;break}if(f){if(!Ei(t,(function(e,t){if(!Ci(f,t)&&(p===e||r(p,e,i,n,o)))return f.push(t)}))){d=!1;break}}else if(p!==g&&!r(p,g,i,n,o)){d=!1;break}}return o.delete(e),o.delete(t),d}function Di(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i}function Pi(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}Ti.prototype.add=Ti.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ti.prototype.has=function(e){return this.__data__.has(e)};
vendor: 1,197 bytes, line 1
1var Oi=N?N.prototype:void 0,Ii=Oi?Oi.valueOf:void 0,Li=Object.prototype.hasOwnProperty,Ai="[object Arguments]",Ri="[object Array]",Mi="[object Object]",Ni=Object.prototype.hasOwnProperty;function Bi(e,t,i,n,r,o){var a=Ce(e),s=Ce(t),l=a?Ri:It(e),c=s?Ri:It(t),u=(l=l==Ai?Mi:l)==Mi,h=(c=c==Ai?Mi:c)==Mi,d=l==c;if(d&&Oe(e)){if(!Oe(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new de),a||Fe(e)?xi(e,t,i,n,r,o):function(e,t,i,n,r,o,a){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new At(e),new At(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return P(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Di;case"[object Set]":var l=1&n;if(s||(s=Pi),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var u=xi(s(e),s(t),n,r,o,a);return a.delete(e),u;case"[object Symbol]":if(Ii)return Ii.call(e)==Ii.call(t)}return!1}(e,t,l,i,n,r,o);if(!(1&i)){var f=u&&Ni.call(e,"__wrapped__"),p=h&&Ni.call(t,"__wrapped__");
1if(f||p){var g=f?e.value():e,v=p?t.value():t;return o||(o=new de),r(g,v,i,n,o)}}return!!d&&(o||(o=new de),function(e,t,i,n,r,o){var a=1&i,s=pt(e),l=s.length;if(l!=pt(t).length&&!a)return!1;for(var c=l;c--;){var u=s[c];if(!(a?u in t:Li.call(t,u)))return!1}var h=o.get(e),d=o.get(t);if(h&&d)return h==t&&d==e;var f=!0;o.set(e,t),o.set(t,e);for(var p=a;++c<l;){var g=e[u=s[c]],v=t[u];if(n)var y=a?n(v,g,u,t,e,o):n(g,v,u,e,t,o);if(!(void 0===y?g===v||r(g,v,i,n,o):y)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var m=e.constructor,_=t.constructor;m==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(f=!1)}return o.delete(e),o.delete(t),f}(e,t,i,n,r,o))}function Ui(e,t,i,n,r){return e===t||(null==e||null==t||!_e(e)&&!_e(t)?e!=e&&t!=t:Bi(e,t,i,n,Ui,r))}function ji(e){return e==e&&!G(e)}function Hi(e,t){return function(i){return null!=i&&i[e]===t&&(void 0!==t||e in Object(i))}}function Fi(e){var t=function(e){for(var t=Xe(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,ji(r)]}return t}(e);return 1==t.length&&t[0][2]?Hi(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,n){var r=i.length,o=r,a=!n;if(null==e)return!o;for(e=Object(e);r--;){var s=i[r];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++r<o;){var l=(s=i[r])[0],c=e[l],u=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var h=new de;if(n)var d=n(c,u,l,e,t,h);if(!(void 0===d?Ui(u,c,3,n,h):d))return!1}}return!0}(i,e,t)}}function Vi(e){return"symbol"==l(e)||_e(e)&&"[object Symbol]"==z(e)}var zi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gi=/^\w*$/;function Wi(e,t){if(Ce(e))return!1;var i=l(e);return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!Vi(e))||Gi.test(e)||!zi.test(e)||null!=t&&e in Object(t)}function Ki(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function i(){var n=arguments,r=t?t.apply(this,n):n[0],o=i.cache;if(o.has(r))return o.get(r);var a=e.apply(this,n);return i.cache=o.set(r,a)||o,a};return i.cache=new(Ki.Cache||he),i}Ki.Cache=he;var Yi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$i=/\\(\\)?/g,qi=function(e){var t=Ki(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Yi,(function(e,i,n,r){t.push(n?r.replace($i,"$1"):i||e)})),t})),Xi=qi,Ji=N?N.prototype:void 0,Zi=Ji?Ji.toString:void 0;function Qi(e){if("string"==typeof e)return e;if(Ce(e))return function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r}(e,Qi)+"";if(Vi(e))return Zi?Zi.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function en(e,t){return Ce(e)?e:Wi(e,t)?[e]:Xi(function(e){return null==e?"":Qi(e)}(e))}function tn(e){if("string"==typeof e||Vi(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function nn(e,t){for(var i=0,n=(t=en(t,e)).length;null!=e&&i<n;)e=e[tn(t[i++])];return i&&i==n?e:void 0}function rn(e,t,i){var n=null==e?void 0:nn(e,t);return void 0===n?i:n}function on(e,t){return null!=e&&t in Object(e)}function an(e,t){return null!=e&&function(e,t,i){for(var n=-1,r=(t=en(t,e)).length,o=!1;++n<r;){var a=tn(t[n]);if(!(o=null!=e&&i(e,a)))break;e=e[a]}return o||++n!=r?o:!!(r=null==e?0:e.length)&&Ae(r)&&Le(a,r)&&(Ce(e)||Ee(e))}(e,t,on)}function sn(e){return Wi(e)?(t=tn(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return nn(t,e)}}(e);var t}function ln(e){return"function"==typeof e?e:null==e?ui:"object"==l(e)?Ce(e)?(t=e[0],i=e[1],Wi(t)&&ji(i)?Hi(tn(t),i):function(e){var n=rn(e,t);return void 0===n&&n===i?an(e,t):Ui(i,n,3)}):Fi(e):sn(e);var t,i}function cn(e){return e!=e}function un(e,t){return!(null==e||!e.length)&&function(e,t,i){return t==t?function(e,t,i){for(var n=i-1,r=e.length;++n<r;)if(e[n]===t)return n;return-1}(e,t,i):function(e,t,i,n){for(var r=e.length,o=i+(n?1:-1);n?o--:++o<r;)if(t(e[o],o,e))return o;return-1}(e,cn,i)}(e,t,0)>-1}function hn(e,t,i){for(var n=-1,r=null==e?0:e.length;++n<r;)if(i(t,e[n]))return!0;return!1}var dn=mt&&1/Pi(new mt([,-0]))[1]==1/0?function(e){return new mt(e)}:function(){};function fn(e,t){return e&&e.length?function(e,t,i){var n=-1,r=un,o=e.length,a=!0,s=[],l=s;if(i)a=!1,r=hn;else if(o>=200){var c=t?null:dn(e);if(c)return Pi(c);a=!1,r=Ci,l=new Ti}else l=t?[]:s;e:for(;++n<o;){var u=e[n],h=t?t(u):u;if(u=i||0!==u?u:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),s.push(u)}else r(l,h,i)||(l!==s&&l.push(h),s.push(u))}return s}(e,ln(t)):[]}
1var pn,gn=function(e){return e.DRM_ENCRYPT="drm_encrypt",e.PRIVATE_ENCRYPT="private_encrypt",e}(gn||{}),vn=function(e){return e.H264="h264",e.H265="h265",e.H266="h266",e.AAC="aac",e.MP3="mp3",e.OPUS="opus",e.UNKNOWN="unknown",e}(vn||{}),yn=(p(pn={},"h265",'video/mp4; codecs="hev1.1.6.L120.90"'),p(pn,"h264",'video/mp4; codecs="avc1.42c01e"'),pn),mn=function(e){return e.H264="h264",e}(mn||{}),_n=function(e){return e.MP4="mp4",e.DASH="dash",e.HLS="hls",e}(_n||{}),bn=function(e){return e.M4A="m4a",e.MP4="mp4",e.MP3="mp3",e.DASH="dash",e.HLS="hls",e.OGG="ogg",e}(bn||{}),kn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},wn=function(){var e,t=null;function i(e){return!!e&&("object"===l(e)||"function"==typeof e)}function n(e){if(null!==e&&!i(e))throw new TypeError("Object prototype may only be an Object or null: "+e)}var r=Object,o=Boolean(r.create)||!({__proto__:null}instanceof r),a=r.create||(o?function(e){return n(e),{__proto__:e}}:function(e){if(n(e),null===e)throw new SyntaxError("Native Object.create is required to create objects with null prototype");var t=function(){};return t.prototype=e,new t}),s=function(){return null},c=r.getPrototypeOf||([].__proto__===Array.prototype?function(e){var t=e.__proto__;return i(t)?t:null}:s);return e=function(l,u){if(void 0===(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!i(l)||!i(u))throw new TypeError("Cannot create proxy with a non-object as target or handler");var h=function(){};t=function(){l=null,h=function(e){throw new TypeError("Cannot perform '".concat(e,"' on a proxy that has been revoked"))}},setTimeout((function(){t=null}),0);var d=u;for(var f in u={get:null,set:null,apply:null,construct:null},d){if(!(f in u))throw new TypeError("Proxy polyfill does not support trap '".concat(f,"'"));u[f]=d[f]}"function"==typeof d&&(u.apply=d.apply.bind(d));var p,g=c(l),v=!1,y=!1;"function"==typeof l?(p=function(){var e=this&&this.constructor===p,t=Array.prototype.slice.call(arguments);return h(e?"construct":"apply"),e&&u.construct?u.construct.call(this,l,t):!e&&u.apply?u.apply(l,this,t):e?(t.unshift(l),new(l.bind.apply(l,t))):l.apply(this,t)},v=!0):l instanceof Array?(p=[],y=!0):p=o||null!==g?a(g):{};var m=u.get?function(e){return h("get"),u.get(this,e,p)}:function(e){return h("get"),this[e]},_=u.set?function(e,t){h("set"),u.set(this,e,t,p)}:function(e,t){h("set"),this[e]=t},b=r.getOwnPropertyNames(l),k={};b.forEach((function(e){if(!v&&!y||!(e in p)){var t=r.getOwnPropertyDescriptor(l,e),i={enumerable:Boolean(t.enumerable),get:m.bind(l,e),set:_.bind(l,e)};r.defineProperty(p,e,i),k[e]=!0}}));var w=!0;if(v||y){var S=r.setPrototypeOf||([].__proto__===Array.prototype?function(e,t){return n(t),e.__proto__=t,e}:s);g&&S(p,g)||(w=!1)}if(u.get||!w)for(var T in l)k[T]||r.defineProperty(p,T,{get:m.bind(l,T)});return r.seal(l),r.seal(p),p},e.revocable=function(i,n){return{proxy:new e(i,n),revoke:t}},e}(),Sn=new(function(){function e(){h(this,e),this.subscribeId=0,this.watcherMap=new Map}return f(e,[{key:"observe",value:function(e){var t=this,i=new wn(e,{set:function(e,n,r){var o=Reflect.get(e,n);Reflect.set(e,n,r);var a=t.watcherMap.get(i);return a&&(t.flushCallback(a),t.flushPropertyCallback(a,n,o,r)),!0}});return this.watcherMap.set(i,{pending:!1,queue:[],property:{}}),i}},{key:"subscribe",value:function(e,t){var i=this.watcherMap.get(e);if(i)return this.subscribeId++,i.queue.push({id:this.subscribeId,callback:t}),this.subscribeId}},{key:"unsubscribe",value:function(e,t){var i=this.watcherMap.get(e);if(i){var n=i.queue,r=n.findIndex((function(e){return e.id===t}));void 0!==r&&r>-1&&n.splice(r,1)}}},{key:"subscribeProperty",value:function(e,t,i){var n=this.watcherMap.get(e);if(n)return this.subscribeId++,n.property[t]||(n.property[t]={pending:!1,timer:0,pre:null,queue:[]}),n.property[t].queue.push({id:this.subscribeId,callback:i}),this.subscribeId}},{key:"unsubscribeProperty",value:function(e,t,i){var n=this.watcherMap.get(e);if(n){var r=n.property[t];if(r){var o=r.queue,a=o.findIndex((function(e){return e.id===i}));void 0!==a&&a>-1&&o.splice(a,1)}}}}
1,{key:"flushCallback",value:function(e){e.pending||(e.pending=!0,setTimeout((function(){e.queue.forEach((function(e){return e.callback()})),e.pending=!1}),0))}},{key:"flushPropertyCallback",value:function(e,t,i,n){var r=e.property[t];r&&(clearTimeout(r.timer),!1===r.pending&&(r.pending=!0,r.pre=i),r.timer=setTimeout((function(){r.queue.forEach((function(e){return e.callback(r.pre,n)})),r.pending=!1}),0))}}]),e}());function Tn(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function En(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Tn(Object(i),!0).forEach((function(t){On(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Tn(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Cn(e){return(Cn="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 xn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dn(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Fn(n.key),n)}}function Pn(e,t,i){return t&&Dn(e.prototype,t),i&&Dn(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function On(e,t,i){return(t=Fn(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function In(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&An(e,t)}function Ln(e){return(Ln=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function An(e,t){return(An=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Rn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mn(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Rn(e)}function Nn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=Ln(e);if(t){var r=Ln(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return Mn(this,i)}}function Bn(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ln(e)););return e}function Un(){return Un="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=Bn(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},Un.apply(this,arguments)}function jn(e){return function(e){if(Array.isArray(e))return Hn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Hn(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Hn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hn(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function Fn(e){var t=function(e,t){if("object"!==l(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===l(t)?t:String(t)}var Vn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(e,t,n,o,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,o||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},s.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,r,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,o),!0;case 6:return u.fn.call(u.context,t,n,r,o,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,i){return o(this,e,t,i,!1)},s.prototype.once=function(e,t,i){return o(this,e,t,i,!0)},s.prototype.removeListener=function(e,t,n,r){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||r&&!s.once||n&&s.context!==n||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||r&&!s[l].once||n&&s[l].context!==n)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,e.exports=s}(Vn);var zn=Vn.exports,Gn="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Wn={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Kn="%c[xgplayer]",Yn={config:{debug:Gn?3:0},logInfo:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>
vendor: 41,648 bytes, line 1
1=3&&(t=console).log.apply(t,[Kn,Wn.info,e].concat(n))},logWarn:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[Kn,Wn.warn,e].concat(n))},logError:function(e){var t;if(!(this.config.debug<1)){for(var i=this.config.debug>=2?"trace":"error",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console)[i].apply(t,[Kn,Wn.error,e].concat(r))}}},$n=function(){function e(t){xn(this,e),this.bufferedList=t}return Pn(e,[{key:"start",value:function(e){return this.bufferedList[e].start}},{key:"end",value:function(e){return this.bufferedList[e].end}},{key:"length",get:function(){return this.bufferedList.length}}]),e}(),qn={};function Xn(e,t){for(var i=0,n=t.length;i<n;i++)if(e.indexOf(t[i])>-1)return!0;return!1}function Jn(e){var t=Cn(e);return null!==e&&("object"===t||"function"===t)}function Zn(e,t,i){var n,r,o,a,s,l,c=0,u=!1,h=!1,d=!0,f=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var i=n,o=r;return n=r=void 0,c=t,a=e.apply(o,i)}function g(e,t){return f?(window.cancelAnimationFrame(s),window.requestAnimationFrame(e)):setTimeout(e,t)}function v(e){return c=e,s=g(m,t),u?p(e):a}function y(e){var i=e-l;return void 0===l||i>=t||i<0||h&&e-c>=o}function m(){var e=Date.now();if(y(e))return _(e);s=g(m,function(e){var i=e-c,n=t-(e-l);return h?Math.min(n,o-i):n}(e))}function _(e){return s=void 0,d&&n?p(e):(n=r=void 0,a)}function b(){for(var e=Date.now(),i=y(e),o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];if(n=c,r=this,l=e,i){if(void 0===s)return v(l);if(h)return s=g(m,t),p(l)}return void 0===s&&(s=g(m,t)),a}return t=+t||0,Jn(i)&&(u=!!i.leading,o=(h="maxWait"in i)?Math.max(+i.maxWait||0,t):o,d="trailing"in i?!!i.trailing:d),b.cancel=function(){void 0!==s&&function(e){if(f)return window.cancelAnimationFrame(e);clearTimeout(e)}(s),c=0,n=l=r=s=void 0},b.flush=function(){return void 0===s?a:_(Date.now())},b.pending=function(){return void 0!==s},b}qn.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=n,r.innerHTML=t,Object.keys(i).forEach((function(t){var n=t,o=i[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(n,o):r.setAttribute(n,o)})),r},qn.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var n=document.createElement("div");n.innerHTML=e;var r=n.children;return n=null,r.length>0?(r=r[0],i&&qn.addClass(r,i),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(e){return Yn.logError("util.createDomFromHtml",e),null}},qn.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(n){var i=e.className&&"object"===Cn(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},qn.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(i){qn.hasClass(e,t)||(e.className&&"object"===Cn(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},qn.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(i){qn.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Cn(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))}},qn.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){qn.hasClass(e,t)?qn.removeClass(e,t):qn.addClass(e,t)}))},qn.classNames=function(){for(var e=arguments,t=[],i=function(i){"String"===qn.typeOf(e[i])?t.push(e[i]):"Object"===qn.typeOf(e[i])&&Object.keys(e[i]).map((function(n){e[i][n]&&t.push(n)}))},n=0;n<arguments.length;n++)i(n);return t.join(" ")},qn.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,i=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(i)}catch(n){Yn.logError("util.findDom",n),0===i.indexOf("#")&&(e=t.getElementById(i.slice(1)))}return e},qn.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},qn.padStart=function(e,t,i){for(var n=String(i),r=t>>0,o=Math.ceil(r/n.length),a=[],s=String(e);o--;)a.push(n);return a.join("").substring(0,r-s.length)+s},qn.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=qn.padStart(Math.floor(e/3600),2,0),i=qn.padStart(Math.floor((e-3600*t)/60),2,0),n=qn.padStart(Math.floor(e-3600*t-60*i),2,0);return("00"===t?[i,n]:[t,i,n]).join(":")},qn.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},qn.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},qn.deepCopy=function(e,t){if("Object"===qn.typeOf(t)&&"Object"===qn.typeOf(e))return Object.keys(t).forEach((function(i){"Object"!==qn.typeOf(t[i])||t[i]instanceof Node?"Array"===qn.typeOf(t[i])?e[i]="Array"===qn.typeOf(e[i])?e[i].concat(t[i]):t[i]:e[i]=t[i]:void 0===e[i]||void 0===e[i]?e[i]=t[i]:qn.deepCopy(e[i],t[i])})),e},qn.deepMerge=function(e,t){return Object.keys(t).map((function(i){var n;"Array"===qn.typeOf(t[i])&&"Array"===qn.typeOf(e[i])?"Array"===qn.typeOf(e[i])&&(n=e[i]).push.apply(n,jn(t[i])):qn.typeOf(e[i])!==qn.typeOf(t[i])||null===e[i]||"Object"!==qn.typeOf(e[i])||t[i]instanceof window.Node?null!==t[i]&&(e[i]=t[i]):qn.deepMerge(e[i],t[i])})),e},qn.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var i=document.createElement("a");return i.href=t.replace(/url\("|"\)/g,""),i.href},qn.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},qn.setInterval=function(e,t,i,n){e._interval[t]||(e._interval[t]=window.setInterval(i.bind(e),n))},qn.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},qn.setTimeout=function(e,t,i){e._timers||(e._timers=[]);var n=setTimeout((function(){t(),qn.clearTimeout(e,n)}),i);return e._timers.push(n),n},qn.clearTimeout=function(e,t){var i=e._timers;if("Array"===qn.typeOf(i)){for(var n=0;n<i.length;n++)if(i[n]===t){i.splice(n,1),clearTimeout(t);break}}else clearTimeout(t)},qn.clearAllTimers=function(e){var t=e._timers;"Array"===qn.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},qn.createImgBtn=function(e,t,i,n){var r,o,a,s=qn.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));return s.style.backgroundImage='url("'.concat(t,'")'),i&&n&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(i.indexOf(e)>-1&&n.indexOf(e)>-1&&(r=parseFloat(i.slice(0,i.indexOf(e)).trim()),o=parseFloat(n.slice(0,n.indexOf(e)).trim()),a=e,1))})),s.style.width="".concat(r).concat(a),s.style.height="".concat(o).concat(a),s.style.backgroundSize="".concat(r).concat(a," ").concat(o).concat(a),s.style.margin="start"===e?"-".concat(o/2).concat(a," auto auto -").concat(r/2).concat(a):"auto 5px auto 5px"),s},qn.Hex2RGBA=function(e,t){var i=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var n="#";e.replace(/[0-9A-F]/gi,(function(e){n+=e+e})),e=n}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){i.push(parseInt(e,16))})),"rgba(".concat(i.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},qn.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},qn.checkIsFunction=function(e){return e&&"function"==typeof e},qn.checkIsObject=function(e){return null!==e&&"object"===Cn(e)},qn.hide=function(e){e.style.display="none"},qn.show=function(e,t){e.style.display=t||"block"},qn.isUndefined=function(e){if(null==e)return!0},qn.isNotNull=function(e){return!(null==e)},qn.setStyleFromCsstext=function(e,t){t&&("String"===qn.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var i=t.split(":");i.length>1&&(e.style[i[0]]=i[1])}})):Object.keys(t).map((function(i){e.style[i]=t[i]})))},qn.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],i=e.style.cssText;if(!i)return{};var n=i.replace(/\s+/g,"").split(";"),r={},o={};return n.map((function(e){if(e){var i=e.split(":");i.length>1&&(Xn(i[0],t)?r[i[0]]=i[1]:o[i[0]]=i[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},qn.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var i=t.replace(/\s+/g,"").split(";"),n={};return i.map((function(e){if(e){var t=e.split(":");t.length>1&&(n[t[0]]=t[1])}})),n},qn.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var n=new window.Image;n.onload=function(e){n=null,t&&t(e)},n.onerror=function(e){n=null,i&&i(e)},n.src=e}},qn.stopPropagation=function(e){e&&e.stopPropagation()},qn.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},qn.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},qn.checkTouchSupport=function(){return"ontouchstart"in window},qn.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=[],n=0;n<e.length;n++)i.push({start:e.start(n)<.5?0:e.start(n),end:e.end(n)});i.sort((function(e,t){return e.start-t.start||t.end-e.end}));var r=[];if(t)for(var o=0;o<i.length;o++){var a=r.length;if(a){var s=r[a-1].end;i[o].start-s<t?i[o].end>s&&(r[a-1].end=i[o].end):r.push(i[o])}else r.push(i[o])}else r=i;return new $n(r)},qn.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.touches&&e.touches.length>0&&(e=e.touches[0]),{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},qn.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},qn.getHostFromUrl=function(e){if("String"!==qn.typeOf(e))return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i},qn.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},qn.isMSE=function(e){return e.media&&(e=e.media),!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},qn.isBlob=function(e){return"string"==typeof e&&/^blob/.test(e)},qn.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(t){e=0}t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now()));var i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)}));return i},qn.createEvent=function(e){var t;return"function"==typeof window.Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},qn.adjustTimeByDuration=function(e,t,i){return t&&e&&(e>t||i&&e<t)?t:e},qn.createPositionBar=function(e,t){var i=qn.createDom("xg-bar","",{"data-index":-1},e);return t.appendChild(i),i},qn.getTransformStyle=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i={scale:"".concat(e.scale||1),translate:"".concat(e.x||0,"%, ").concat(e.y||0,"%"),rotate:"".concat(e.rotate||0,"deg")};return Object.keys(i).forEach((function(e){var n=new RegExp("".concat(e,"\\([^\\(]+\\)"),"g"),r="".concat(e,"(").concat(i[e],")");n.test(t)?(n.lastIndex=-1,t=t.replace(n,r)):t+="".concat(r," ")})),t},qn.convertDeg=function(e){return Math.abs(e)<=1?360*e:e%360},qn.getIndexByTime=function(e,t){var i=t.length,n=-1;if(i<1)return n;if(e<=t[0].end||i<2)n=0;else if(e>t[i-1].end)n=i-1;else for(var r=1;r<i;r++)if(e>t[r-1].end&&e<=t[r].end){n=r;break}return n},qn.getOffsetCurrentTime=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,n=-1;if((n=i>=0&&i<t.length?i:qn.getIndexByTime(e,t))<0)return-1;var r=t.length,o=t[n],a=o.start,s=o.end,l=o.cTime,c=o.offset;return e<a?l:e>=a&&e<=s?e-c:e>s&&n>=r-1?s:-1},qn.getCurrentTimeByOffset=function(e,t){var i=-1;if(!t||t.length<0)return e;for(var n=0;n<t.length;n++)if(e<=t[n].duration){i=n;break}if(-1!==i){var r=t[i].start;return i-1<0?r+e:r+(e-t[i-1].duration)}return e};var Qn=/(Android)\s([\d.]+)/,er=/(Version)\/([\d.]+)/,tr=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],ir={get device(){return ir.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(i){return t[i].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),i=/(?:SymbianOS)/.test(e)||t,n=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,a=o||n&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!a;return{isTablet:a,isPhone:s,isIpad:o,isIos:s||o,isAndroid:n,isPc:!(s||n||i||a),isSymbian:i,isWindowsPhone:t,isFireFox:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",i=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?er:Qn)?t.exec(e):[];if(i&&i.length>=3){var n=i[2].split(".");return n.length>0?parseInt(n[0]):0}return 0},get isWeixin(){return"undefined"!=typeof navigator&&!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&tr.map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),this.supportResult=e,t=null,e},isMSESupport:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if("undefined"==typeof MediaSource||!MediaSource)return!1;try{return MediaSource.isTypeSupported(e)}catch(t){return this._logger.error(e,t),!1}},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var i=e.video||{},n=e.audio||{};try{var r=MediaSource.isTypeSupported(i.contentType),o=MediaSource.isTypeSupported(n.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}}},nr="3.0.20-rc.7",rr={1:"media",2:"media",3:"media",4:"media",5:"media",6:"media"},or={1:5101,2:5102,3:5103,4:5104,5:5105,6:5106},ar=Pn((function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null};xn(this,e);var n=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.media){var r=i.mediaError?i.mediaError:t.media.error||{},o=t.duration,a=t.currentTime,s=t.ended,l=t.src,c=t.currentSrc,u=t.media,h=u.readyState,d=u.networkState,f=i.errorCode||r.code;or[f]&&(f=or[f]);var p={playerVersion:nr,currentTime:a,duration:o,ended:s,readyState:h,networkState:d,src:l||c,errorType:i.errorType,errorCode:f,message:i.errorMessage||r.message,mediaError:r,originError:i.originError?i.originError.stack:"",host:qn.getHostFromUrl(l||c)};return i.ext&&Object.keys(i.ext).map((function(e){p[e]=i.ext[e]})),p}if(arguments.length>1){for(var g={playerVersion:nr,domain:document.domain},v=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],y=0;y<arguments.length;y++)g[v[y]]=arguments[y];return g.ex=n?(n[arguments[0]]||{}).msg:"",g}})),sr="play",lr="playing",cr="ended",ur="pause",hr="error",dr="seeking",fr="seeked",pr="timeupdate",gr="waiting",vr="canplay",yr="durationchange",mr="volumechange",_r="loadeddata",br="ratechange",kr="progress",wr="loadstart",Sr="emptied",Tr="focus",Er="blur",Cr="ready",xr="urlNull",Dr="autoplay_started",Pr="autoplay_was_prevented",Or="complete",Ir="replay",Lr="destroy",Ar="urlchange",Rr="download_speed_change",Mr="leaveplayer",Nr="enterplayer",Br="loading",Ur="fullscreen_change",jr="cssFullscreen_change",Hr="mini_state_change",Fr="definition_change",Vr="after_definition_change",zr="SEI_PARSED",Gr="video_resize",Wr="pip_change",Kr="rotate",Yr="screenShot",$r="playnext",qr="shortcut",Xr="xglog",Jr="user_action",Zr="reset",Qr="source_error",eo="source_success",to=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],io={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},no="fps_stuck",ro=Object.freeze(Object.defineProperty({__proto__:null,ABORT:"abort",AFTER_DEFINITION_CHANGE:Vr,AUTOPLAY_PREVENTED:Pr,AUTOPLAY_STARTED:Dr,BEFORE_DEFINITION_CHANGE:"before_definition_change",BUFFER_CHANGE:"bufferedChange",CANPLAY:vr,CANPLAY_THROUGH:"canplaythrough",COMPLETE:Or,CSS_FULLSCREEN_CHANGE:jr,DEFINITION_CHANGE:Fr,DESTROY:Lr,DOWNLOAD_SPEED_CHANGE:Rr,DURATION_CHANGE:yr,EMPTIED:Sr,ENDED:cr,ENTER_PLAYER:Nr,ERROR:hr,FPS_STUCK:no,FULLSCREEN_CHANGE:Ur,LEAVE_PLAYER:Mr,LOADED_DATA:_r,LOADED_METADATA:"loadedmetadata",LOADING:Br,LOAD_START:wr,MINI_STATE_CHANGE:Hr,PAUSE:ur,PIP_CHANGE:Wr,PLAY:sr,PLAYER_BLUR:Er,PLAYER_FOCUS:Tr,PLAYING:lr,PLAYNEXT:$r,PROGRESS:kr,RATE_CHANGE:br,READY:Cr,REPLAY:Ir,RESET:Zr,RETRY:"retry",ROTATE:Kr,SCREEN_SHOT:Yr,SEEKED:fr,SEEKING:dr,SEI_PARSED:zr,SHORTCUT:qr,SOURCE_ERROR:Qr,SOURCE_SUCCESS:eo,STALLED:"stalled",STATS_EVENTS:io,SUSPEND:"suspend",SWITCH_SUBTITLE:"switch_subtitle",TIME_UPDATE:pr,URL_CHANGE:Ar,URL_NULL:xr,USER_ACTION:Jr,VIDEO_EVENTS:to,VIDEO_RESIZE:Gr,VOLUME_CHANGE:mr,WAITING:gr,XGLOG:Xr},Symbol.toStringTag,{value:"Module"}));function oo(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}function ao(e,t){return function(i,n){var r={player:t,eventName:e,originalEvent:i,detail:i.detail||{},timeStamp:i.timeStamp,currentTime:t.currentTime,duration:t.duration,paused:t.paused,ended:t.ended,isInternalOp:!!t._internalOp[i.type],muted:t.muted,volume:t.volume,host:qn.getHostFromUrl(t.currentSrc),vtype:t.vtype};if(t.removeInnerOP(i.type),"timeupdate"===e&&(t._currentTime=t.media&&t.media.currentTime),"ratechange"===e){var o=t.media?t.media.playbackRate:0;if(o&&t._rate===o)return;t._rate=t.media&&t.media.playbackRate}if("durationchange"===e&&(t._duration=t.media.duration),"volumechange"===e&&(r.isMutedChange=t._lastMuted!==t.muted,t._lastMuted=t.muted),"error"===e&&(r.error=n||t.video.error),t.mediaEventMiddleware[e]){var a=oo.bind(t,e,r);try{t.mediaEventMiddleware[e].call(t,r,a)}catch(i){throw oo.call(t,e,r),i}}else oo.call(t,e,r)}}var so=function(e){In(i,e);var t=Nn(i);function i(e){var n;xn(this,i),(n=t.call(this,e))._hasStart=!1,n._currentTime=0,n._duration=0,n._internalOp={},n._lastMuted=!1,n.vtype="MP4",n._rate=-1,n.mediaConfig=Object.assign({},{controls:!1,autoplay:e.autoplay,playsinline:e.playsinline,"x5-playsinline":e.playsinline,"webkit-playsinline":e.playsinline,"x5-video-player-fullscreen":e["x5-video-player-fullscreen"]||e.x5VideoPlayerFullscreen,"x5-video-orientation":e["x5-video-orientation"]||e.x5VideoOrientation,airplay:e.airplay,"webkit-airplay":e.airplay,tabindex:0|e.tabindex,mediaType:e.mediaType||"video","data-index":-1},e.videoConfig,e.videoAttributes);var r=e["x5-video-player-type"]||e.x5VideoPlayerType;return ir.isWeixin&&ir.os.isAndroid&&r&&(n.mediaConfig["x5-video-player-type"]=r,delete n.mediaConfig.playsinline,delete n.mediaConfig["webkit-playsinline"],delete n.mediaConfig["x5-playsinline"]),e.loop&&(n.mediaConfig.loop="loop"),e.autoplayMuted&&!Object.prototype.hasOwnProperty.call(n.mediaConfig,"muted")&&(n.mediaConfig.muted=!0),n.media=qn.createDom(n.mediaConfig.mediaType,"",n.mediaConfig,""),e.defaultPlaybackRate&&(n.media.defaultPlaybackRate=n.media.playbackRate=e.defaultPlaybackRate),"Number"===qn.typeOf(e.volume)&&(n.volume=e.volume),e.autoplayMuted&&(n.media.muted=!0,n._lastMuted=!0),e.autoplay&&(n.media.autoplay=!0),n._interval={},n.mediaEventMiddleware={},n.attachVideoEvents(),n}return Pn(i,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(i){t.mediaEventMiddleware[i]=e[i]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.mediaEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers||(this._evHandlers=to.map((function(t){var i="on".concat(t.charAt(0).toUpperCase()).concat(t.slice(1));return"function"==typeof e[i]&&e.on(t,e[i]),On({},t,ao(t,e))}))),this._evHandlers.forEach((function(e){var i=Object.keys(e)[0];t.addEventListener(i,e[i],!1)}))}},{key:"detachVideoEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.media;this._evHandlers.forEach((function(e){var i=Object.keys(e)[0];t.removeEventListener(i,e[i],!1)})),this._evHandlers.forEach((function(t){var i=Object.keys(t)[0],n="on".concat(i.charAt(0).toUpperCase()).concat(i.slice(1));"function"==typeof e[n]&&e.off(i,e[n])})),this._evHandlers=null}},{key:"_attachSourceEvents",value:function(e,t){var i=this;e.removeAttribute("src"),e.load(),t.forEach((function(e,t){i.media.appendChild(qn.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||""),"data-index":t+1}))}));var n=e.children;if(n){this._videoSourceCount=n.length,this._videoSourceIndex=n.length,this._vLoadeddata=function(e){i.emit(eo,{src:e.target.currentSrc,host:qn.getHostFromUrl(e.target.currentSrc)})};for(var r=null,o=0;o<this._evHandlers.length;o++)if("error"===Object.keys(this._evHandlers[o])[0]){r=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){var t=parseInt(e.target.getAttribute("data-index"),10);if(i._videoSourceIndex--,0===i._videoSourceIndex||t>=i._videoSourceCount){var n={code:4,message:"sources_load_error"};r?r.error(e,n):i.errorHandler("error",n)}var o=rr[4];i.emit(Qr,new ar(i,{errorType:o,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var a=0;a<n.length;a++)n[a].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var i=0;i<t.length;i++)t[i].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.media&&(this.media.error||t)){var i=this.media.error||t,n=i.code?rr[i.code]:"other";i.message,this.media.currentSrc||(i={code:6,message:"empty_src"}),this.emit(e,new ar(this,{errorType:n,errorCode:i.code,errorMessage:i.message||"",mediaError:i}))}}},{key:"destroy",value:function(){for(var e in this.media&&(this.media.pause&&(this.media.pause(),this.media.muted=!0),this.media.removeAttribute("src"),this.media.load()),this._currentTime=0,this._duration=0,this.mediaConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this.media=null,this.mediaEventMiddleware={},this.removeAllListeners()}},{key:"video",get:function(){return this.media},set:function(e){this.media=e}},{key:"play",value:function(){return this.media?this.media.play():null}},{key:"pause",value:function(){this.media&&this.media.pause()}},{key:"load",value:function(){this.media&&this.media.load()}},{key:"canPlayType",value:function(e){return!!this.media&&this.media.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.media)return t;e||(e=this.media.buffered);var i=this.media.currentTime;if(e)for(var n=0,r=e.length;n<r&&(t[0]=e.start(n),t[1]=e.end(n),!(t[0]<=i&&i<=t[1]));n++);return t[0]-i<=0&&i-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.media&&this.media.autoplay},set:function(e){this.media&&(this.media.autoplay=e)}},{key:"buffered",get:function(){return this.media?this.media.buffered:null}},{key:"buffered2",get:function(){return this.media&&this.media.buffered?qn.getBuffered2(this.media.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.media)return e;var t=this.media.buffered;if(!t||0===t.length)return e;for(var i=0;i<t.length;i++)if((t.start(i)<=this.currentTime||t.start(i)<.1)&&t.end(i)>=this.currentTime)return{start:t.start(i),end:t.end(i)};return e}},{key:"crossOrigin",get:function(){return this.media?this.media.crossOrigin:""},set:function(e){this.media&&(this.media.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.media?this.media.currentSrc:""},set:function(e){this.media&&(this.media.currentSrc=e)}},{key:"currentTime",get:function(){return this.media?void 0!==this.media.currentTime?this.media.currentTime:this._currentTime:0},set:function(e){this.media&&(this.media.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.media&&this.media.defaultMuted},set:function(e){this.media&&(this.media.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.media&&this.media.ended}},{key:"error",get:function(){return this.media.error}},{key:"errorNote",get:function(){return this.media.error?["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.media.error.code-1]:""}},{key:"loop",get:function(){return!!this.media&&this.media.loop},set:function(e){this.media&&(this.media.loop=e)}},{key:"muted",get:function(){return!!this.media&&this.media.muted},set:function(e){this.media&&this.media.muted!==e&&(this._lastMuted=this.media.muted,this.media.muted=e)}},{key:"networkState",get:function(){return this.media.networkState}},{key:"paused",get:function(){return!this.media||this.media.paused}},{key:"playbackRate",get:function(){return this.media?this.media.playbackRate:0},set:function(e){this.media&&e!==1/0&&(this.media.defaultPlaybackRate=e,this.media.playbackRate=e)}},{key:"played",get:function(){return this.media?this.media.played:null}},{key:"preload",get:function(){return!!this.media&&this.media.preload},set:function(e){this.media&&(this.media.preload=e)}},{key:"readyState",get:function(){return this.media.readyState}},{key:"seekable",get:function(){return!!this.media&&this.media.seekable}},{key:"seeking",get:function(){return!!this.media&&this.media.seeking}},{key:"src",get:function(){return this.media?this.media.src:""},set:function(e){this.media&&(this.emit(Ar,e),this.emit(gr),this._currentTime=0,this._duration=0,qn.isMSE(this.media)?this.onWaiting():(this._detachSourceEvents(this.media),"Array"===qn.typeOf(e)?this._attachSourceEvents(this.media,e):e?this.media.src=e:this.media.removeAttribute("src"),this.load()))}},{key:"volume",get:function(){return this.media?this.media.volume:0},set:function(e){e!==1/0&&this.media&&(this.media.volume=e)}},{key:"aspectRatio",get:function(){return this.media?this.media.videoWidth/this.media.videoHeight:0}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=Un(Ln(i.prototype),"emit",this)).call.apply(n,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=Un(Ln(i.prototype),"on",this)).call.apply(n,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=Un(Ln(i.prototype),"once",this)).call.apply(n,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=Un(Ln(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){Un(Ln(i.prototype),"removeAllListeners",this).call(this)}}]),i}(zn),lo=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};xn(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return Pn(e,[{key:"openDB",value:function(e){var t=this,i=this,n=this.myDB.version||1,r=i.indexedDB.open(i.myDB.name,n);r.onerror=function(e){},r.onsuccess=function(n){t.myDB.db=n.target.result,e.call(i)},r.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(i.myDB.ojstore.name)||t.createObjectStore(i.myDB.ojstore.name,{keyPath:i.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var i,n=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(i=n.add(t[r])).onerror=function(){},i.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var i,n=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(i=n.put(t[r])).onerror=function(){},i.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,i){var n=this,r=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);r.onerror=function(){i.call(n,null)},r.onsuccess=function(e){var t=e.target.result;i.call(n,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),e}(),co=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],uo=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],ho=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],fo="data-xgplayerid";function po(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];var a=t.call.apply(t,[e].concat(r));i&&"function"==typeof i&&(a&&a.then?a.then((function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.call.apply(i,[e].concat(n))})):i.call.apply(i,[e].concat(r)))}function go(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),function(){var n=arguments,r=this;if(i.pre)try{var o;(o=i.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(t.message),t}if(this.__hooks&&this.__hooks[e])try{var a=So(this,e,t);a?a.then?a.then((function(e){!1!==e&&po.apply(void 0,[r,t,i.next].concat(jn(n)))})).catch((function(e){throw e})):po.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&po.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(t.message),t}else po.apply(void 0,[this,t,i.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function vo(e,t){var i=this.__hooks;if(!i||!Array.isArray(i[e]))return-1;for(var n=i[e],r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function yo(e,t){var i=this.__hooks;if(i)return!!i.hasOwnProperty(e)&&(Array.isArray(i[e])||(i[e]=[]),-1===vo.call(this,e,t)&&i[e].push(t),!0)}function mo(e,t){var i=this.__hooks;if(i){if(Array.isArray(i[e])){var n=i[e],r=vo.call(this,e,t);-1!==r&&n.splice(r,1)}delete i[e]}}function _o(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return t.useHooks&&t.useHooks.apply(t,n)}}function bo(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,n)}}}function ko(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&t.map((function(t){e.__hooks[t]=null})),Object.defineProperty(e,"hooks",{get:function(){return e.__hooks&&Object.keys(e.__hooks).map((function(t){if(e.__hooks[t])return t}))}})}function wo(e){e.__hooks=null}function So(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];if(e.__hooks&&Array.isArray(e.__hooks[t])){var a=e.__hooks[t],s=-1,l=function e(t,i,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),l=3;l<r;l++)o[l-3]=arguments[l];if(s++,0===a.length||s===a.length)return n.call.apply(n,[t,t].concat(o));var c=a[s],u=c.call.apply(c,[t,t].concat(o));return u&&u.then?u.then((function(r){return!1===r?null:e.apply(void 0,[t,i,n].concat(o))})).catch((function(e){})):!1!==u?e.apply(void 0,[t,i,n].concat(o)):void 0};return l.apply(void 0,[e,t,i].concat(r))}return i.call.apply(i,[e,e].concat(r))}function To(e,t){Yn.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}var Eo=function(){function e(t){xn(this,e),qn.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),ko(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return Pn(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){e||(e=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=qn.checkTouchSupport()?"touch":"mouse";return!this.playerConfig||"touch"!==this.playerConfig.domEventType&&"mouse"!==this.playerConfig.domEventType||(e=this.playerConfig.domEventType),e}},{key:"on",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){i.__events[e]=t,i.player.on(e,t)})):To(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(n){i.__onceEvents[n]=t,i.player.once(e,t)})):To(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var i=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(n){delete i.__events[e],i.player.off(n,t)})):To(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(i){e[t][i]&&e.off(i,e[t][i]),i&&delete e[t][i]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(n))}}},{key:"emitUserAction",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var n=En(En({},i),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,n)}}},{key:"hook",value:function(e,t){return go.call.apply(go,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return yo.call.apply(yo,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return mo.call.apply(mo,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return i&&(t.pluginName=i),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,i=this.pluginName;this.offAll(),qn.clearAllTimers(this),qn.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(i),wo(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&Object.defineProperty(e,i,t[i])}},{key:"defineMethod",value:function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&"function"==typeof t[i]&&Object.defineProperty(e,i,{configurable:!0,value:t[i]})}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var Co=Element.prototype;Co.matches=Co.matchesSelector||Co.mozMatchesSelector||Co.msMatchesSelector||Co.oMatchesSelector||Co.webkitMatchesSelector}var xo=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function Do(e,t,i,n,r){var o=Po.apply(this,arguments);return e.addEventListener(i,o,r),{destroy:function(){e.removeEventListener(i,o,r)}}}function Po(e,t,i,n){return function(i){i.delegateTarget=xo(i.target,t),i.delegateTarget&&n.call(e,i)}}var Oo=function(e,t,i,n,r){return"function"==typeof e.addEventListener?Do.apply(null,arguments):"function"==typeof i?Do.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return Do(e,t,i,n,r)})))},Io={CONTROLS:"controls",ROOT:"root"},Lo={ROOT:"root",ROOT_LEFT:"rootLeft",ROOT_RIGHT:"rootRight",ROOT_TOP:"rootTop",CONTROLS_LEFT:"controlsLeft",CONTROLS_RIGTH:"controlsRight",CONTROLS_RIGHT:"controlsRight",CONTROLS_CENTER:"controlsCenter",CONTROLS:"controls"},Ao="xg-icon-disable";function Ro(e){return!!e&&e.indexOf&&/^(?:http|data:|\/)/.test(e)}function Mo(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=null;if(e instanceof window.Element)return qn.addClass(e,i),Object.keys(n).map((function(t){e.setAttribute(t,n[t])})),e;if(Ro(e)||Ro(e.url))return n.src=Ro(e)?e:e.url||"",o=qn.createDom(e.tag||"img","",n,"xg-img ".concat(i));if("function"==typeof e)try{return(o=e())instanceof window.Element?(qn.addClass(o,i),Object.keys(n).map((function(e){o.setAttribute(e,n[e])})),o):(Yn.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(e){return Yn.logError("Plugin named [".concat(r,"]:createIcon"),e),null}return"string"==typeof e?qn.createDomFromHtml(e,n,i):(Yn.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invali
1d")),null)}function No(e,t){var i=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(n){var r=e[n],o=r&&r.class?r.class:"",a=r&&r.attr?r.attr:{},s=null;i&&i[n]&&(o=function(e,t){return"object"===Cn(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(i[n],o),a=function(e,t){return"object"===Cn(e)&&e.attr&&"object"===Cn(e.attr)&&Object.keys(e.attr).map((function(i){t[i]=e.attr[i]})),t}(i[n],a),s=Mo(i[n],n,o,a,t.pluginName)),!s&&r&&(s=Mo(r.icon?r.icon:r,a,o,{},t.pluginName)),t.icons[n]=s}))}var Bo=function(e){In(i,e);var t=Nn(i);function i(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xn(this,i),(e=t.call(this,n)).__delegates=[],e}return Pn(i,[{key:"__init",value:function(e){if(Un(Ln(i.prototype),"__init",this).call(this,e),e.root){var t=e.root,n=null;this.icons={},this.root=null,this.parent=null,No(this.registerIcons()||{},this),this.langText={};var r,o,a=this.registerLanguageTexts()||{};r=a,o=this,Object.keys(r).map((function(e){Object.defineProperty(o.langText,e,{get:function(){var t=o.lang,i=o.i18n;return i[e]?i[e]:r[e]&&r[e][t]||""}})}));var s="";try{s=this.render()}catch(e){throw Yn.logError("Plugin:".concat(this.pluginName,":render"),e),new Error("Plugin:".concat(this.pluginName,":render:").concat(e.message))}if(s)(n=i.insert(s,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(n=qn.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(n)}this.root=n,this.parent=t;var l=this.config.attr||{},c=this.config.style||{};this.setAttr(l),this.setStyle(c),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===Cn(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(i){var n,r,o=i,a=t[o],s={root:e.root};"function"==typeof a?(n=e.config[o]||{},r=a):"object"===Cn(a)&&"function"==typeof a.plugin&&(n=a.options?qn.deepCopy(e.config[o]||{},a.options):e.config[o]||{},r=a.plugin),s.config=n,void 0!==n.index&&(s.index=n.index),n.root&&(s.root=n.root),e.registerPlugin(r,s,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,i=this.i18n,n=this.langText;t&&function e(t,i){for(var n=0;n<t.children.length;n++)t.children[n].children.length>0?e(t.children[n],i):i(t.children[n])}(t,(function(t){var r=t.getAttribute&&t.getAttribute("lang-key");if(r){var o=i[r.toUpperCase()]||n[r];o&&(t.innerHTML="function"==typeof o?o(e):o)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=this.i18n||{},n=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var r=i[t]||n[t]||"";r&&(e.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,qn.addClass(this.find(".xgplayer-icon"),Ao)}},{key:"enable",value:function(){this.config.disable=!1,qn.removeClass(this.find(".xgplayer-icon"),Ao)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var r=Un(Ln(i.prototype),"registerPlugin",this).call(this,e,t,n);return this._children.push(r),r}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,n){var r=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){r.bindEL(e,t)})):this.bindEL(e,t);else{var o=i.delegate.call(this,this.root,e,t,n);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var i=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){i.unbindEL(e,t)})):this.unbindEL(e,t);else for(var n="".concat(e,"_").concat(t),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===n){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}},{key:"setStyle",value:function(e,t){var i=this;if(this.root)return"String"===qn.typeOf(e)?this.root.style[e]=t:void("Object"===qn.typeOf(e)&&Object.keys(e).map((function(t){i.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var i=this;if(this.root)return"String"===qn.typeOf(e)?this.root.setAttribute(e,t):void("Object"===qn.typeOf(e)&&Object.keys(e).map((function(t){i.root.setAttribute(t,e[t])})))}},{key:"setHtml",value:function(e,t){this.root&&(this.root.innerHTML=e,"function"==typeof t&&t())}},{key:"bindEL",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,i)}},{key:"unbindEL",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,i)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(e){return Yn.logError("Plugin:appendChild",e),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,t=this.player;this.__delegates.map((function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.map((function(e){t.unRegisterPlugin(e.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),Un(Ln(i.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],[{key:"insert",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.children.length,r=Number(i),o=e instanceof window.Node;if(n){for(var a=0,s=null,l="";a<n;a++){s=t.children[a];var c=Number(s.getAttribute("data-index"));if(c>=r){l="beforebegin";break}c<r&&(l="afterend")}return o?"afterend"===l?t.appendChild(e):t.insertBefore(e,s):s.insertAdjacentHTML(l,e),"afterend"===l?t.children[t.children.length-1]:t.children[a]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof n)if(Array.isArray(i))i.forEach((function(i){var a=Oo(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}));else{var a=Oo(e,t,i,n,r);a.key="".concat(t,"_").concat(i),o.push(a)}return o}},{key:"ROOT_TYPES",get:function(){return Io}},{key:"POSITIONS",get:function(){return Lo}}]),i}(Eo),Uo=function(){function e(){var t=this;if(xn(this,e),On(this,"__trigger",(function(e){var i=(new Date).getTime();t.timeStamp=i;for(var n=0;n<e.length;n++)t.__runHandler(e[n].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Jn(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),Zn(e,t,{leading:n,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(e){}}return Pn(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer.observe(e);for(var i=e.getAttribute(fo),n=this.__handlers,r=-1,o=0;o<n.length;o++)n[o]&&e===n[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:i})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,n){e===i.target&&(t=n)}));try{var i;null===(i=this.observer)||void 0===i||i.unobserve(e)}catch(e){}t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,i=0;i<t.length;i++)if(t[i]&&e===t[i].target){try{t[i].handler(e)}catch(e){}return!0}return!1}}]),e}(),jo=null,Ho={pluginGroup:{},init:function(e){var t,i,n=e._pluginInfoId;n||(n=(new Date).getTime(),e._pluginInfoId=n),!e.config.closeResizeObserver&&(t=e.root,i=function(){e.resize()},jo||(jo=new Uo),jo.addObserver(t,i)),this.pluginGroup[n]={_originalOptions:e.config||{},_plugins:{}}},formatPluginInfo:function(e,t){var i=null,n=null;return e.plugin&&"function"==typeof e.plugin?(i=e.plugin,n=e.options):(i=e,n={}),t&&(n.config=t||{}),{PLUFGIN:i,options:n}},checkPluginIfExits:function(e,t){for(var i=0;i<t.length;i++)if(e.toLowerCase()===t[i].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var i=Object.keys(t),n=null,r=0;r<i.length;
1r++)if(e.toLowerCase()===i[r].toLowerCase()){n=t[i[r]];break}return"Object"===qn.typeOf(n)?{root:n.root,position:n.position}:{}},lazyRegister:function(e,t){var i=this,n=t.timeout||1500;return Promise.race([t.loader().then((function(t){var n;n=t&&t.__esModule?t.default:t,i.register(e,n,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),n)}))])},register:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var n=e._pluginInfoId;if(n&&this.pluginGroup[n]){this.pluginGroup[n]._plugins||(this.pluginGroup[n]._plugins={});var r=this.pluginGroup[n]._plugins,o=this.pluginGroup[n]._originalOptions;i.player=e;var a=i.pluginName||t.pluginName;if(!a)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported(e.config.mediaType,e.config.codecType)){i.config||(i.config={});for(var s=Object.keys(o),l=0;l<s.length;l++)if(a.toLowerCase()===s[l].toLowerCase()){var c=o[s[l]];"Object"===qn.typeOf(c)?i.config=Object.assign({},i.config,o[s[l]]):"Boolean"===qn.typeOf(c)&&(i.config.disable=!c);break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===i.config[e]&&(i.config[e]=t.defaultConfig[e])})),i.root?"string"==typeof i.root&&(i.root=e[i.root]):i.root=e.root,i.index=i.config.index||0;try{r[a.toLowerCase()]&&this.unRegister(n,a.toLowerCase());var u=new t(i);return r[a.toLowerCase()]=u,r[a.toLowerCase()].func=t,u&&"function"==typeof u.afterCreate&&u.afterCreate(),u}catch(e){throw e}}}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var i=this.pluginGroup[e]._plugins[t];i&&(i.pluginName&&i.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(e){}},deletePlugin:function(e,t){var i=e._pluginInfoId;i&&this.pluginGroup[i]&&this.pluginGroup[i]._plugins&&delete this.pluginGroup[i]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var i=e._pluginInfoId;if(!i||!this.pluginGroup[i])return null;var n=t.toLowerCase();return this.pluginGroup[i]._plugins[n]},beforeInit:function(e){var t=this;function i(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(n){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var r=e._pluginInfoId;if(t.pluginGroup[r]){var o=t.pluginGroup[r]._plugins,a=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();a.push(i(t))}catch(e){throw a.push(i(null)),e}})),Promise.all([].concat(a)).then((function(){n()})).catch((function(e){n()}))}else n()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins;
vendor: 4,289 bytes, line 1
1Object.keys(i).forEach((function(e){i[e]&&i[e].afterPlayerInit&&i[e].afterPlayerInit()}))}},setLang:function(e,t){var i=t._pluginInfoId;if(i&&this.pluginGroup[i]){var n=this.pluginGroup[i]._plugins;Object.keys(n).forEach((function(t){if(n[t].updateLang)n[t].updateLang(e);else try{n[t].lang=e}catch(e){}}))}},reRender:function(e){var t=this,i=e._pluginInfoId;if(i&&this.pluginGroup[i]){var n=[],r=this.pluginGroup[i]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(n.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(i,e))})),n.forEach((function(i){t.register(e,i.plugin,i.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var i=this.pluginGroup[t]._plugins||{};Object.keys(i).forEach((function(e){i[e].onPluginsReady&&"function"==typeof i[e].onPluginsReady&&i[e].onPluginsReady()}))}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var i,n,r;i=e.root,null===(r=jo)||void 0===r||r.unObserver(i,n);for(var o=this.pluginGroup[t]._plugins,a=0,s=Object.keys(o);a<s.length;a++){var l=s[a];this.unRegister(t,l)}delete this.pluginGroup[t],delete e._pluginInfoId}}},Fo={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-active",INACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",INNER_FULLSCREEN:"xgplayer-fullscreen-inner",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",CONTROLS_AUTOHIDE:"controls-autohide",TOP_BAR_AUTOHIDE:"top-bar-autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function Vo(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},preProcessUrl:null,ignores:[],whitelist:[],inactive:3e3,lang:(e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),"zh-cn"===e&&(e="zh"),e),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},isHideTips:!1,minWaitDelay:200,commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}};var e}var zo=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var i=Rn(e),n=i.player;i.playerConfig.closeControlsBlur&&n.focus({autoHide:!1})})),On(Rn(e),"onMouseLeave",(function(t){Rn(e).player.focus()})),e}return Pn(i,[{key:"beforeCreate",value:function(e){e.config.mode||"mobile"!==ir.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.disable,n=t.height,r=t.mode;if(!i){"flex"===r&&this.player.addClass(Fo.FLEX_CONTROLS);var o={height:"".concat(n,"px")};Object.keys(o).map((function(t){e.root.style[t]=o[t]})),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-control
1s"),this.on(Hr,(function(t){t?qn.addClass(e.root,"mini-controls"):qn.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==ir.device&&"mobile"!==a&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"focusAwhile",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&qn.addClass(this.root,Fo.CONTROLS_AUTOHIDE)}},{key:"pauseAutoHide",value:function(){qn.removeClass(this.root,Fo.CONTROLS_AUTOHIDE)}},{key:"show",value:function(e){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:r.position){case Lo.CONTROLS_LEFT:t.root=this.left;break;case Lo.CONTROLS_RIGHT:t.root=this.right;break;case Lo.CONTROLS_CENTER:t.root=this.center;break;case Lo.CONTROLS:t.root=this.root;break;default:t.root=this.left}return Un(Ln(i.prototype),"registerPlugin",this).call(this,e,t,n)}}}},{key:"destroy",value:function(){"mobile"!==ir.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,t=e.mode,i=e.autoHide,n=e.initShow;if(!e.disable){var r=qn.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},On({},Fo.CONTROLS_AUTOHIDE,i),{"xgplayer-controls-initshow":n||!i});return'<xg-controls class="'.concat(r,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),i}(Bo),Go={lang:{},langKeys:[],textKeys:[]};function Wo(e,t){return Object.keys(t).forEach((function(i){var n,r=qn.typeOf(t[i]),o=qn.typeOf(e[i]);"Array"===r?("Array"!==o&&(e[i]=[]),(n=e[i]).push.apply(n,jn(t[i]))):"Object"===r?("Object"!==o&&(e[i]={}),Wo(e[i],t[i])):e[i]=t[i]})),e}function Ko(){Object.keys(Go.lang.en).map((function(e){Go.textKeys[e]=e}))}function Yo(e,t){var i=e.LANG;if(t||(t=Go),t.lang){var n=e.TEXT||{};"zh"===i&&(i="zh-cn"),t.lang[i]?Wo(t.lang[i],n):(t.langKeys.push(i),t.lang[i]=n),Ko()}}Yo({LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",E
vendor: 4,982 bytes, line 1
1RROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}});var $o={get textKeys(){return Go.textKeys},get langKeys(){return Go.langKeys},get lang(){var e={};return Go.langKeys.map((function(t){e[t]=Go.lang[t]})),Go.lang["zh-cn"]&&(e.zh=Go.lang["zh-cn"]||{}),e},extend:function(e,t){var i=[];if(t||(t=Go),t.lang){i="Array"!==qn.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var n=t.lang;i.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),n[e.LANG]?Wo(n[e.LANG]||{},e.TEXT||{}):Yo(e,t)})),Ko()}},use:Yo,init:function(e){var t,i={lang:{},langKeys:[],textKeys:{},pId:e};return Wo(i.lang,Go.lang),(t=i.langKeys).push.apply(t,jn(Go.langKeys)),Wo(i.textKeys,Go.textKeys),i}},qo={INITIAL:1,READY:2,ATTACHING:3,ATTACHED:4,NOTALLOW:5,RUNNING:6,ENDED:7,DESTROYED:8},Xo=["ERROR","INITIAL","READY","ATTACHING","ATTACHED","NOTALLOW","RUNNING","ENDED","DESTROYED"],Jo={},Zo=null,Qo=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"add",value:function(e){e&&(Jo[e.playerId]=e,1===Object.keys(Jo).length&&this.setActive(e.playerId,!0))}},{key:"remove",value:function(e){e&&(e.isUserActive,delete Jo[e.playerId])}},{key:"_iterate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var i in Jo)if(Object.prototype.hasOwnProperty.call(Jo,i)){var n=Jo[i];if(t){if(e(n))break}else e(n)}}},{key:"forEach",value:function(e){this._iterate(e)}},{key:"find",value:function(e){var t=null;return this._iterate((function(i){var n=e(i);return n&&(t=i),n}),!0),t}},{key:"findAll",value:function(e){var t=[];return this._iterate((function(i){e(i)&&t.push(i)})),t}},{key:"setActive",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Jo[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!0,t.isInstNext=!1):t.isUserActive=!1})):Jo[e].isUserActive=t,e}},{key:"getActiveId",value:function(){for(var e=Object.keys(Jo),t=0;t<e.length;t++){var i=Jo[e[t]];if(i&&i.isUserActive)return e[t]}return null}},{key:"setNext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Jo[e])return t?this.forEach((function(t){e===t.playerId?(t.isUserActive=!1,t.isInstNext=!0):t.isInstNext=!1})):Jo[e].isInstNext=t,e}}],[{key:"getInstance",value:function(){return Zo||(Zo=new i),Zo}}]),i}(Vn.exports.EventEmitter),ea=["play","pause","replay","retry"],ta=0,ia=0,na=null,ra=function(e){In(i,e);var t=Nn(i);function i(e){var n;xn(this,i);var r,o=qn.deepMerge(Vo(),e);On(Rn(n=t.call(this,o)),"canPlayFunc",(function(){if(n.config){var e=n.config,t=e.autoplay,i=e.defaultPlaybackRate;Yn.logInfo("player","canPlayFunc, startTime",n.__startTime),n._seekToStartTime(),n.playbackRate=i,(t||n._useAutoplay)&&n.mediaPlay(),n.off(vr,n.canPlayFunc),n.removeClass(Fo.ENTER)}})),On(Rn(n),"onFullscreenChange",(function(e,t){var i=function(){qn.setTimeout(Rn(n),(function(){n.resize()}),100)},r=qn.getFullScreenEl();n._fullActionFrom?n._fullActionFrom="":n.emit(Jr,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:n.currentTime,duration:n.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,i){if(e){var n=e.getAttribute(i);return!(!n||n!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,n.playerId,fo);if(t||r&&(r===n._fullscreenEl||o))i(),!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!0,n.changeFullStyle(n.root,r,Fo.FULLSCREEN),n.emit(Ur,!0,n._fullScreenOffset),n.cssfullscreen&&n.exitCssFullscreen();else if(n.fullscreen){i();var a=Rn(n),s=a._fullScreenOffset;if(a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),qn.setTimeout(Rn(n),(function(){n.fullscreen=!1,n._fullScreenOffset=null}),100)):(!n.config.closeFocusVideoFocus&&n.media.focus(),n.fullscreen=!1,n._fullScreenOffset=null),n.cssfullscreen)n.removeClass(Fo.FULLSCREEN);else{var l=n._fullscreenEl;l||!n.root.contains(e.target)&&e.target!==n.root||(l=e.target),n.recoverFullStyle(n.root,l,Fo.FULLSCREEN)}n._fullscreenEl=null,n.emit(Ur,!1)}})),On(Rn(n),"_onWebkitbeginfullscreen",(function(e){n._fullscreenEl=n.media,n.onFullscreenChange(e,!0)})),On(Rn(n),"_onWebkitendfullscreen",(function(e){n.onFullscreenChange(e,!1)})),ko(Rn(n),ea),n.config=o,n._pluginInfoId=qn.generateSessionId(),(r=Rn(n)).logInfo=Yn.logInfo.bind(r),r.logWarn=Yn.logWarn.bind(r),r.logError=Yn.logError.bind(r);var a=n.constructor.defaultPreset;if(n.config.presets.length){var s=n.config.presets.indexOf("default");s>=0&&a&&(n.config.presets[s]=a)}
1else a&&n.config.presets.push(a);if(n.userTimer=null,n.waitTimer=null,n.handleSource=!0,n._state=qo.INITIAL,n.isAd=!1,n.isError=!1,n._hasStart=!1,n.isSeeking=!1,n.isCanplay=!1,n._useAutoplay=!1,n.__startTime=-1,n.rotateDeg=0,n.isActive=!1,n.fullscreen=!1,n.cssfullscreen=!1,n.isRotateFullscreen=!1,n._fullscreenEl=null,n.timeSegments=[],n._cssfullscreenEl=null,n.curDefinition=null,n._orgCss="",n._fullScreenOffset=null,n._videoHeight=0,n._videoWidth=0,n.videoPos={pi:1,scale:0,rotate:-1,x:0,y:0,h:-1,w:-1,vy:0,vx:0},n.sizeInfo={width:0,height:0,left:0,top:0},n._accPlayed={t:0,acc:0,loopAcc:0},n._offsetInfo={currentTime:-1,duration:0},n.innerContainer=null,n.controls=null,n.topBar=null,n.root=null,n.__i18n=$o.init(n._pluginInfoId),ir.os.isAndroid&&ir.osVersion>0&&ir.osVersion<6&&(n.config.autoplay=!1),n.database=new lo,n.isUserActive=!1,n._onceSeekCanplay=null,n._isPauseBeforeSeek=0,n.innerStates={isActiveLocked:!1},n.instManager=na,!n._initDOM())return Mn(n);var l=n.config,c=l.definition,u=void 0===c?{}:c;if(!l.url&&u.list&&u.list.length>0){var h=u.list.find((function(e){return e.definition&&e.definition===u.defaultDefinition}));h||(u.defaultDefinition=u.list[0].definition,h=u.list[0]),n.config.url=h.url,n.curDefinition=h}return n._bindEvents(),n._registerPresets(),n._registerPlugins(),Ho.onPluginsReady(Rn(n)),n.getInitDefinition(),n.setState(qo.READY),qn.setTimeout(Rn(n),(function(){n.emit(Cr)}),0),n.onReady&&n.onReady(),(n.config.videoInit||n.config.autoplay)&&(!n.hasStart||n.state<qo.ATTACHED)&&n.start(),n}return Pn(i,[{key:"_initDOM",value:function(){var e,t=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var i=this.config.el;if(!i||1!==i.nodeType)return this.emit(hr,new ar("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),!1;this.root=i}var n=function(e){for(var t=Object.keys(Jo),i=0;i<t.length;i++){var n=Jo[t[i]];if(n.root===e)return n}return null}(this.root);n&&(Yn.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(fo,this.playerId),null===(e=na)||void 0===e||e.add(this),Ho.init(this),this._initBaseDoms();var r=this.constructor.XgVideoProxy;if(r&&this.mediaConfig.mediaType===r.mediaType){var o=this.innerContainer||this.root;this.detachVideoEvents(this.media);var a=new r(o,this.config,this.mediaConfig);this.attachVideoEvents(a),this.media=a}if(this.media.setAttribute(fo,this.playerId),this.config.controls){var s=this.config.controls.root||null,l=Ho.register(this,zo,{root:s});this.controls=l}var c="mobile"===this.config.isMobileSimulateMode?"mobile":ir.device;if(this.addClass("".concat(Fo.DEFAULT," ").concat(Fo.INACTIVE," xgplayer-").concat(c," ").concat(this.config.controls?"":Fo.NO_CONTROLS)),this.config.autoplay?this.addClass(Fo.ENTER):this.addClass(Fo.NO_START),this.config.fluid){var u=this.config,h=u.width,d=u.height;"number"==typeof h&&"number"==typeof d||(h=600,d=337.5);var f={width:"100%",height:"0","max-width":"100%","padding-top":"".concat(100*d/h,"%")};Object.keys(f).forEach((function(e){t.root.style[e]=f[e]}))}else["width","height"].forEach((function(e){t.config[e]&&("number"!=typeof t.config[e]?t.root.style[e]=t.config[e]:t.root.style[e]="".concat(t.config[e],"px"))}));var p=this.root.getBoundingClientRect(),g=p.width,v=p.height,y=p.left,m=p.top;return this.sizeInfo.width=g,this.sizeInfo.height=v,this.sizeInfo.left=y,this.sizeInfo.top=m,!0}},{key:"_initBaseDoms",value:function(){this.topBar=null,this.leftBar=null,this.rightBar=null,this.config.marginControls&&(this.innerContainer=qn.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer))}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),co.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),ir.os.isIos&&(this.media.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once(_r,this.resize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.media.focus()},this.once(sr,this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),co.forEac
vendor: 83,436 bytes, line 1
1h((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off(sr,this.playFunc),this.off(vr,this.canPlayFunc),this.media.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.media.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_clearUserTimer",value:function(){this.userTimer&&(qn.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"_startInit",value:function(e){var t=this;if(this.media&&(e&&""!==e&&("Array"!==qn.typeOf(e)||0!==e.length)||(e="",this.emit(xr),Yn.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this.handleSource&&(this._detachSourceEvents(this.media),"Array"===qn.typeOf(e)&&e.length>0?this._attachSourceEvents(this.media,e):this.media.src&&this.media.src===e?e||this.media.removeAttribute("src"):this.media.src=e),"Number"===qn.typeOf(this.config.volume)&&(this.volume=this.config.volume);var i=this.innerContainer?this.innerContainer:this.root;this.media instanceof window.Element&&!i.contains(this.media)&&i.insertBefore(this.media,i.firstChild);var n=this.media.readyState;Yn.logInfo("_startInit readyState",n),this.config.autoplay&&(!qn.isMSE(this.media)&&this.load(),(ir.os.isIpad||ir.os.isPhone)&&this.mediaPlay());var r=this.config.startTime;this.__startTime=r>0?r:-1,this.config.startTime=0,n>=2&&this.duration>0?this.canPlayFunc():this.on(vr,this.canPlayFunc),(!this.hasStart||this.state<qo.ATTACHED)&&Ho.afterInit(this),this.hasStart=!0,this.setState(qo.ATTACHED),qn.setTimeout(this,(function(){t.emit(Or)}),0)}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var i=this.config.ignores||[],n=this.config.plugins||[],r=this.config.i18n||[];t&&$o.extend(r,this.__i18n);var o=i.join("||").toLowerCase().split("||"),a=this.plugins;n.forEach((function(i){try{var n=i.plugin?i.plugin.pluginName:i.pluginName;if(n&&o.indexOf(n.toLowerCase())>-1)return null;if(!t&&a[n.toLowerCase()])return;if(i.lazy&&i.loader){var r=Ho.lazyRegister(e,i);return void(i.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){Yn.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(i)}catch(e){Yn.logError("_registerPlugins:",e)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var i,n,r=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=r.plugins,a=void 0===o?[]:o,s=r.ignores,l=void 0===s?[]:s,c=r.icons,u=void 0===c?{}:c,h=r.i18n,d=void 0===h?[]:h;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(i=e.config.plugins).push.apply(i,jn(a)),(n=e.config.ignores).push.apply(n,jn(l)),Object.keys(u).map((function(t){e.config.icons[t]||(e.config.icons[t]=u[t])}));var f=e.config.i18n||[];d.push.apply(d,jn(f)),e.config.i18n=d}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case Lo.ROOT_RIGHT:this.rightBar||(this.rightBar=qn.createPositionBar("xg-right-bar",this.root)),t=this.rightBar;break;case Lo.ROOT_LEFT:this.leftBar||(this.leftBar=qn.createPositionBar("xg-left-bar",this.root)),t=this.leftBar;break;case Lo.ROOT_TOP:this.topBar||(this.topBar=qn.createPositionBar("xg-top-bar",this.root),this.config.topBarAutoHide&&qn.addClass(this.topBar,Fo.TOP_BAR_AUTOHIDE)),t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var i=Ho.formatPluginInfo(e,t),n=i.PLUFGIN,r=i.options,o=this.config.plugins;!Ho.checkPluginIfExits(n.pluginName,o)&&o.push(n);var a=Ho.getRootByConfig(n.pluginName,this.config);a.root&&(r.root=a.root),a.position&&(r.position=a.position);var s,l=r.position?r.position:r.config&&r.config.position||n.defaultConfig&&n.defaultConfig.position;return!r.root&&"string"==typeof l&&l.indexOf("controls")>-1?null===(s=this.controls)||void 0===s?void 0:s.registerPlugin(n,r,n.pluginName):(r.root||(r.root=this._getRootByPosition(l)),Ho.register(this,n,r))}},{key:"deregister",value:function(e){"string"==typeof e?Ho.unRegister(this,e):e instanceof Eo&&Ho.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.deregister(e),t&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof Eo&&(t=e.pluginName),t)for(var i=this.config.plugins.length-1;i>-1;i--)if(this.config.plugins[i].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(i,1);break}}},{key:"plugins",get:function(){return Ho.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=Ho.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(qn.hasClass(this.root,e)||qn.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&qn.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return qn.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!(this.state>qo.ATTACHING))return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this.setState(qo.ATTACHING),this._registerPlugins(!1),Ho.beforeInit(this).then((function(){if(t.config){e||(e=t.url||t.config.url);var i=t._preProcessUrl(e);return t._startInit(i.url)}})).catch((function(e){throw e.fileName="player",e.lineNumber="236",Yn.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e,t){var i=this,n=e;"Object"===qn.typeOf(e)&&(n=e.url),n=this._preProcessUrl(n).url;var r=this.currentTime;this.__startTime=r;var o=this.paused&&!this.isError;return this.src=n,new Promise((function(e,t){var r=function(e){i.off("timeupdate",a),i.off("canplay",a),t(e)},a=function(){i._seekToStartTime(),o&&i.pause(),i.off("error",r),e(!0)};i.once("error",r),n?(ir.os.isAndroid?i.once("timeupdate",a):i.once("canplay",a),i.play()):i.errorHandler("error",{code:6,message:"empty_src"})}))}},{key:"videoPlay",value:function(){this.mediaPlay()}},{key:"mediaPlay",value:function(){var e=this;if(!this.hasStart&&this.state<qo.ATTACHED)return this.removeClass(Fo.NO_START),this.addClass(Fo.ENTER),this.start(),void(this._useAutoplay=!0);this.state<qo.RUNNING&&(this.removeClass(Fo.NO_START),!this.isCanplay&&this.addClass(Fo.ENTER));var t=Un(Ln(i.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(Fo.NOT_ALLOW_AUTOPLAY),e.addClass(Fo.PLAYING),e.state<qo.RUNNING&&(Yn.logInfo(">>>>playPromise.then"),e.setState(qo.RUNNING),e.emit(Dr))})).catch((function(t){if(Yn.logWarn(">>>>playPromise.catch",t.name),e.media&&e.media.error)return e.onError(),void e.removeClass(Fo.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=qn.setTimeout(e,(function(){e._errorTimer=null,e.emit(Pr),e.addClass(Fo.NOT_ALLOW_AUTOPLAY),e.removeClass(Fo.ENTER),e.pause(),e.setState(qo.NOTALLOW)}),0))})):(Yn.logWarn("video.play not return promise"),this.state<qo.RUNNING&&(this.setState(qo.RUNNING),this.removeClass(Fo.NOT_ALLOW_AUTOPLAY),this.removeClass(Fo.NO_START),this.removeClass(Fo.ENTER),this.addClass(Fo.PLAYING),this.emit(Dr))),t}},{key:"mediaPause",value:function(){Un(Ln(i.prototype),"pause",this).call(this)}},{key:"videoPause",value:function(){Un(Ln(i.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;return this.removeClass(Fo.PAUSED),So(this,"play",(function(){return e.mediaPlay()}))}},{key:"pause",value:function(){var e=this;So(this,"pause",(function(){Un(Ln(i.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var i=this;if(this.media&&!Number.isNaN(Number(e))&&this.hasStart){var n=this.config,r=n.isSeekedPlay,o=n.seekedStatus,a=t||(r?"play":o);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,!this._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(fr,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(i.removeClass(Fo.ENTER),i.isSeeking=!1,a){case"play":i.play();break;case"pause":i.pause();break;default:i._isPauseBeforeSeek>1||i.paused?i.pause():i.play()}i._isPauseBeforeSeek=0,i._onceSeekCanplay=null},this.once(fr,this._onceSeekCanplay),this.state<qo.RUNNING?(this.removeClass(Fo.NO_START),this.currentTime=e,this.play()):this.currentTime=e}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,i=t.definition;!t.url&&i&&i.list&&i.list.length>0&&i.defaultDefinition&&i.list.map((function(t){t.definition===i.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t)}))}},{key:"changeDefinition",value:function(e,t){var i=this,n=this.config.definition;if(Array.isArray(null==n?void 0:n.list)&&n.list.forEach((function(t){(null==e?void 0:e.definition)===t.definition&&(i.curDefinition=t)})),null!=e&&e.bitrate&&"number"!=typeof e.bitrate&&(e.bitrate=parseInt(e.bitrate,10)||0),this.emit(Fr,{from:t,to:e}),this.hasStart){var r=this.switchURL(e.url,En({seamless:!1!==n.seamless&&"undefined"!=typeof MediaSource&&"function"==typeof MediaSource.isTypeSupported},e));r&&r.then?r.then((function(){i.emit(Vr,{from:t,to:e})})):this.emit(Vr,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once(_r,this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[Fo.NOT_ALLOW_AUTOPLAY,Fo.PLAYING,Fo.NO_START,Fo.PAUSED,Fo.REPLAY,Fo.ENTER,Fo.ENDED,Fo.ERROR,Fo.LOADING];this.hasStart=!1,this.isError=!1,this._useAutoplay=!1,this.mediaPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(Fo.NO_START),this.emit(Zr)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),i)){var n=Vo();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=n[t])}))}}},{key:"destroy",value:function(){var e,t=this,n=this.innerContainer,r=this.root,o=this.media;if(r&&o){if(this.hasStart=!1,this._useAutoplay=!1,r.removeAttribute(fo),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.media),qn.clearAllTimers(this),this.emit(Lr),null===(e=na)||void 0===e||e.remove(this),Ho.destroy(this),wo(this),Un(Ln(i.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root&&this.exitFullscreen(),n)for(var a=n.children,s=0;s<a.length;s++)n.removeChild(a[s]);!n&&o instanceof window.Node&&r.contains(o)&&r.removeChild(o),["topBar","leftBar","rightBar","innerContainer"].map((function(e){t[e]&&r.removeChild(t[e]),t[e]=null}));var l=r.className.split(" ");l.length>0?r.className=l.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):r.className="",this.removeAttribute("data-xgfill"),["isSeeking","isCanplay","isActive","cssfullscreen","fullscreen"].forEach((function(e){t[e]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(Fo.ENDED),this.currentTime=0,this.isSeeking=!1,So(this,"replay",(function(){e.once(fr,(function(){var t=e.mediaPlay();t&&t.catch&&t.catch((function(e){}))})),e.emit(Ir),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(Fo.ERROR),this.addClass(Fo.LOADING),So(this,"retry",(function(){var t=e.currentTime,i=e.config.url,n=qn.isMSE(e.media)?{url:i}:e._preProcessUrl(i);e.src=n.url,!e.config.isLive&&(e.currentTime=t),e.once(vr,(function(){e.mediaPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,i,n){e&&(n||(n=Fo.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=qn.filterStyleFromText(e)),qn.addClass(e,i),t&&t!==e&&!this._orgPCss&&(this._orgPCss=qn.filterStyleFromText(t),qn.addClass(t,n),t.setAttribute(fo,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,i,n){n||(n=Fo.PARENT_FULLSCREEN),this._orgCss&&(qn.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),qn.removeClass(e,i),t&&t!==e&&this._orgPCss&&(qn.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",qn.removeClass(t,n),t.removeAttribute(fo))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,i=this.media;if("video"!==e&&"media"!==e||(e=this[e]),e||(e=t),this._fullScreenOffset={top:qn.scrollTop(),left:qn.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",qn.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var n=0;n<uo.length;n++){var r=uo[n];if(e[r]){var o="webkitRequestFullscreen"===r?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[r]();return o&&o.then?o:Promise.resolve()}}return i.fullscreenEnabled||i.webkitSupportsFullscreen?(i.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(e){return Promise.reject(new Error("call getFullscreen fail"))}}},{key:"exitFullscreen",value:function(e){if(this.isRotateFullscreen&&this.exitRotateFullscreen(),this._fullscreenEl||qn.getFullScreenEl()){this.root;var t=this.media;this._fullActionFrom="exit";try{for(var i=0;i<ho.length;i++){var n=ho[i];if(document[n]){var r=document[n]();return r&&r.then?r:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}catch(e){return Promise.reject(new Error("call exitFullscreen fail"))}}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.isRotateFullscreen?this.exitRotateFullscreen():this.fullscreen&&this.exitFullscreen();var t=e?"".concat(Fo.INNER_FULLSCREEN," ").concat(Fo.CSS_FULLSCREEN):Fo.CSS_FULLSCREEN;this.changeFullStyle(this.root,e,t);var i=this.config.fullscreen,n=void 0===i?{}:i;(!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(this.fullscreen=!0,this.emit(Ur,!0)),this._cssfullscreenEl=e,this.cssfullscreen=!0,this.emit(jr,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?"".concat(Fo.INNER_FULLSCREEN," ").concat(Fo.CSS_FULLSCREEN):Fo.CSS_FULLSCREEN;if(this.fullscreen){var t=this.config.fullscreen,i=void 0===t?{}:t;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen()?(this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this.fullscreen=!1,this.emit(Ur,!1)):this.removeClass(e)}else this.recoverFullStyle(this.root,this._cssfullscreenEl,e);this._cssfullscreenEl=null,this.cssfullscreen=!1,this.emit(jr,!1)}},{key:"getRotateFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.cssfullscreen&&this.exitCssFullscreen(e);var t=e?"".concat(Fo.INNER_FULLSCREEN," ").concat(Fo.ROTATE_FULLSCREEN):Fo.ROTATE_FULLSCREEN;this._fullscreenEl=e||this.root,this.changeFullStyle(this.root,e,t,Fo.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!0,this.fullscreen=!0,this.setRotateDeg(90),this._rootStyle=this.root.getAttribute("style"),this.root.style.width="".concat(window.innerHeight,"px"),this.emit(Ur,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this._fullscreenEl!==this.root?"".concat(Fo.INNER_FULLSCREEN," ").concat(Fo.ROTATE_FULLSCREEN):Fo.ROTATE_FULLSCREEN;this.recoverFullStyle(this.root,this._fullscreenEl,t,Fo.PARENT_ROTATE_FULLSCREEN),this.isRotateFullscreen=!1,this.fullscreen=!1,this.setRotateDeg(0),this.emit(Ur,!1),this._rootStyle&&(this.root.style.style=this._rootStyle,this._rootStyle=!1)}},{key:"setRotateDeg",value:function(e){90===window.orientation||-90===window.orientation?this.rotateDeg=0:this.rotateDeg=e}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(Tr,En({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?(this._clearUserTimer(),this.emit(Er,En({paused:this.paused,ended:this.ended},e))):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3},i=this.innerStates;if(this.isActive=!0,this.removeClass(Fo.INACTIVE),this._clearUserTimer(),void 0!==t.isLock&&(i.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||i.isActiveLocked)this._clearUserTimer();else{var n=t&&t.delay?t.delay:this.config.inactive;this.userTimer=qn.setTimeout(this,(function(){e.userTimer=null,e.blur()}),n)}}},{key:"onBlur",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).ignorePaused,t=void 0!==e&&e;if(!this.innerStates.isActiveLocked){var i=this.config.closePauseVideoFocus;this.isActive=!1,(t||i||!this.paused&&!this.ended)&&this.addClass(Fo.INACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.removeClass(Fo.ENTER),this.removeClass(Fo.ERROR),this.removeClass(Fo.LOADING),this.isCanplay=!0,this.waitTimer&&qn.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){var e=this;this.isError=!1,this.isSeeking=!1,this.__startTime>0&&(this.duration>0?this._seekToStartTime():this.once(yr,(function(){e._seekToStartTime()})))}},{key:"onLoadstart",value:function(){this.removeClass(Fo.ERROR),this.isCanplay=!1}},{key:"onPlay",value:function(){this.state===qo.ENDED&&this.setState(qo.RUNNING),this.removeClass(Fo.PAUSED),this.ended&&this.removeClass(Fo.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(Fo.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this._clearUserTimer(),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(Fo.ENDED),this.setState(qo.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(Fo.NOT_ALLOW_AUTOPLAY),this.removeClass(Fo.NO_START),this.removeClass(Fo.ENTER),this.removeClass(Fo.LOADING),this.addClass(Fo.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(Fo.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&qn.clearTimeout(this,this.waitTimer),this.removeClass(Fo.LOADING),this.removeClass(Fo.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&qn.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=qn.setTimeout(this,(function(){e.addClass(Fo.LOADING),e.emit(Br),qn.clearTimeout(e,e.waitTimer),e.waitTimer=null}),this.config.minWaitDelay)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[Fo.NO_START,Fo.PAUSED,Fo.ENDED,Fo.ERROR,Fo.REPLAY,Fo.LOADING].forEach((function(t){e.removeClass(t)})),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.media.videoHeight&&this.resize(),(this.waitTimer||this.hasClass(Fo.LOADING))&&this.media.readyState>2&&(this.removeClass(Fo.LOADING),qn.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&this.state===qo.NOTALLOW&&this.duration&&(this.setState(qo.RUNNING),this.emit(Dr)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===qn.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t,i){if(this.media&&t&&e){var n="String"===qn.typeOf(e)?e:e.type||"";i.props&&"Array"!==qn.typeOf(i.props)&&(i.props=[i.props]),this.emit(Jr,En({eventType:n,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},i))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime()-this._accPlayed.t;this._accPlayed.acc+=t,this._accPlayed.t=0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{startDiff:0,endDiff:0})||{},i=t.startDiff,n=void 0===i?0:i,r=t.endDiff,o=void 0===r?0:r,a=this.media.buffered;if(!a||0===a.length||!this.duration)return!0;for(var s=e||this.media.currentTime||.2,l=a.length,c=0;c<l;c++)if(a.start(c)+n<=s&&a.end(c)-o>s)return!0;return!1}},{key:"resizePosition",value:function(){var e=this.videoPos,t=e.vy,i=e.vx,n=e.h,r=e.w,o=this.videoPos.rotate;if(!(o<0&&n<0&&r<0)){var a=this.videoPos._pi;if(!a&&this.media.videoHeight&&(a=this.media.videoWidth/this.media.videoHeight*100),a){this.videoPos.pi=a;var s={rotate:o=o<0?0:o},l=0,c=0,u=1,h=Math.abs(o/90),d=this.root,f=this.innerContainer,p=d.offsetWidth,g=f?f.offsetHeight:d.offsetHeight,v=g,y=p;if(h%2==0)u=n>0?100/n:r>0?100/r:1,s.scale=u,l=t>0?(100-n)/2-t:0,s.y=2===h?0-l:l,c=i>0?(100-r)/2-i:0,s.x=2===h?0-c:c,this.media.style.width="".concat(y,"px"),this.media.style.height="".concat(v,"px");else if(h%2==1){v=p;var m=g-p;c=-m/2/(y=g)*100,s.x=3===h?c+t/2:c-t/2,l=m/2/v*100,s.y=3===h?l+i/2:l-i/2,s.scale=u,this.media.style.width="".concat(y,"px"),this.media.style.height="".concat(v,"px")}var _=qn.getTransformStyle(s,this.media.style.transform||this.media.style.webkitTransform);this.media.style.transform=_,this.media.style.webkitTransform=_}}}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.media&&e&&e.h){var t=this.videoPos;t.h=100*e.h||0,t.w=100*e.w||0,t.vx=100*e.x||0,t.vy=100*e.y||0,this.resizePosition()}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(i){if("plugins"!==i){t.config[i]=e[i];var n=t.plugins[i.toLowerCase()];n&&"Function"===qn.typeOf(n.setConfig)&&n.setConfig(e[i])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this.setConfig(e),this._currentTime=0,this._duration=0,So(this,"playnext",(function(){t.start(),t.emit($r,e)}))}},{key:"resize",value:function(){var e=this;if(this.media){var t=this.root.getBoundingClientRect();this.sizeInfo.width=t.width,this.sizeInfo.height=t.height,this.sizeInfo.left=t.left,this.sizeInfo.top=t.top;var i=this.media,n=i.videoWidth,r=i.videoHeight,o=this.config,a=o.fitVideoSize,s=o.videoFillMode;if("fill"!==s&&"cover"!==s&&"contain"!==s||this.setAttribute("data-xgfill",s),r&&n){this._videoHeight=r,this._videoWidth=n;var l=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,c=t.width,u=t.height-l,h=parseInt(n/r*1e3,10),d=parseInt(c/u*1e3,10),f=c,p=u,g={};"auto"===a&&d>h||"fixWidth"===a?(p=c/h*1e3,this.config.fluid?g.paddingTop="".concat(100*p/f,"%"):g.height="".concat(p+l,"px")):("auto"===a&&d<h||"fixHeight"===a)&&(f=h*u/1e3,g.width="".concat(f,"px")),this.fullscreen||this.cssfullscreen||Object.keys(g).forEach((function(t){e.root.style[t]=g[t]})),("fillHeight"===s&&d<h||"fillWidth"===s&&d>h)&&this.setAttribute("data-xgfill","cover");var v={videoScale:h,vWidth:f,vHeight:p,cWidth:f,cHeight:p+l};this.resizePosition(),this.emit(Gr,v)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.media.updateObjectPosition?this.media.updateObjectPosition(e,t):this.media.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"setState",value:function(e){Yn.logInfo("setState","state from:".concat(Xo[this.state]," to:").concat(Xo[e])),this._state=e}},{key:"_preProcessUrl",value:function(e,t){var i=this.config,n=i.preProcessUrl,r=i.preProcessUrlOptions,o=Object.assign({},r,t);return qn.isBlob(e)||"function"!=typeof n?{url:e}:n(e,o)}},{key:"_seekToStartTime",value:function(){this.__startTime>0&&this.duration>0&&(this.currentTime=this.__startTime>this.duration?this.duration:this.__startTime,this.__startTime=-1)}},{key:"state",get:function(){return this._state}},{key:"isFullscreen",get:function(){return this.fullscreen}},{key:"isCssfullScreen",get:function(){return this.cssfullscreen}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,!1===e&&this.setState(qo.READY),this.emit("hasstart"))}},{key:"isPlaying",get:function(){return this._state===qo.RUNNING||this._state===qo.ENDED},set:function(e){e?this.setState(qo.RUNNING):this._state>=qo.RUNNING&&this.setState(qo.ATTACHED)}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,i=this.config.definition,n=null,r=null;i.list=e,this.emit("resourceReady",e),e.forEach((function(e){var o;(null===(o=t.curDefinition)||void 0===o?void 0:o.definition)===e.definition&&(n=e),i.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),n?this.changeDefinition(n):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.media||!this.media.getVideoPlaybackQuality)return e;var t=this.media.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){(0!==$o.langKeys.filter((function(t){return t===e})).length||"zh"===e)&&(this.config.lang=e,Ho.setLang(e,this))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return nr}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){return Un(Ln(i.prototype),"readyState",this)}},{key:"error",get:function(){var e=Un(Ln(i.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){return Un(Ln(i.prototype),"networkState",this)}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed,t=e.acc,i=e.t;return i?(new Date).getTime()-i+t:t}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(e){(e=qn.convertDeg(e))%90==0&&e!==this.videoPos.rotate&&(this.videoPos.rotate=e,this.resizePosition())}},{key:"avgSpeed",get:function(){return ia},set:function(e){ia=e}},{key:"realTimeSpeed",get:function(){return ta},set:function(e){ta=e}},{key:"offsetCurrentTime",get:function(){return this._offsetInfo.currentTime||0},set:function(e){this._offsetInfo.currentTime=e}},{key:"offsetDuration",get:function(){return this._offsetInfo.duration||0},set:function(e){this._offsetInfo.duration=e||0}},{key:"hook",value:function(e,t){return go.call.apply(go,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return yo.call.apply(yo,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return mo.call.apply(mo,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];return _o.call.apply(_o,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,i){for(var n=arguments.length,r=new Array(n>3?n-3:0),o=3;o<n;o++)r[o-3]=arguments[o];return bo.call.apply(bo,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){var i;"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),qn.typeOf(t)===Boolean&&(this.muted=t)),null===(i=na)||void 0===i||i.setActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Yn.config.debug},set:function(e){Yn.config.debug=e}},{key:"instManager",get:function(){return na},set:function(e){na=e}},{key:"getCurrentUserActivePlayerId",value:function(){var e;return null===(e=na)||void 0===e?void 0:e.getActiveId()}},{key:"setCurrentUserActive",value:function(e,t){var i;null===(i=na)||void 0===i||i.setActive(e,t)}},{key:"isHevcSupported",value:function(){return ir.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return ir.probeConfigSupported(e)}},{key:"install",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]||(i.plugins[e]=t)}},{key:"use",value:function(e,t){i.plugins||(i.plugins={}),i.plugins[e]=t}}]),i}(so);function oa(){return(new Date).getTime()}On(ra,"defaultPreset",null),On(ra,"XgVideoProxy",null),ra.instManager=Qo.getInstance();var aa="loadstart",sa="loadeddata",la="firstFrame",ca="waitingStart",ua="waitingEnd",ha="seekStart",da="seekEnd",fa=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(Yn.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),On(Rn(e),"_onAutoplayStart",(function(){Yn.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),On(Rn(e),"_onReset",(function(){e._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=oa(),e.loadedCostTime=0,e.startCostTime=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&qn.clearTimeout(Rn(e),e._waitTimer),e._waittTimer&&qn.clearTimeout(Rn(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),On(Rn(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=oa(),e.emitLog(ha,{start:oa()}))})),On(Rn(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),On(Rn(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=oa(),e.fixedWaitingStart=oa(),e._waitType=1,e.emitLog(ca,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),On(Rn(e),"_onWaiting",(function(){!e._isWaiting&&e.vt&&(e._isWaiting=!0,e.vt?e.seekingStart?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=oa(),e._waitTimer=qn.setTimeout(Rn(e),(function(){e._isWaiting&&(e.waitingStart=oa(),qn.clearTimeout(Rn(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(ca,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),On(Rn(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),On(Rn(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return Pn(i,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=oa(),this.loadedCostTime=0,this.startCostTime=0,this.on(wr,(function(){var t=e._state,i=t.autoplayStart,n=t.isFFSend;e.startCostTime=oa()-e.newPointTime,Yn.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(i," isFFSend:").concat(n," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),n||(!t.isLs&&e.emitLog(aa,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=oa(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(_r,(function(){e.vt=oa(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var t=e._state,i=t.isTimeUpdate,n=t.isFFSend,r=t.autoplayStart;Yn.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(i||r)&&e._sendFF("loadedData"),n||e.emitLog(sa,{}),e.suspendWaitingStatus("loadeddata")})),this.on(dr,this._onSeeking),this.on(fr,this._onSeeked),this.on(Lr,(function(){e.endState("destroy")})),this.on(Ar,(function(){e.endState("urlChange"),Yn.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([lr,vr],this._onPlaying),this.on(gr,this._onWaiting),this.on(hr,this._onError),this.on(Zr,(function(){Yn.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(Dr,this._onAutoplayStart),this.off(pr,this._onTimeupdate),this.once(Dr,this._onAutoplayStart),this.once(pr,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=oa();var t=this._state,i=t.isFFLoading,n=t.isFFSend;Yn.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(i," !isFFSend:").concat(!n)),this.vt>0&&i&&!n&&(Yn.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(la,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&qn.clearTimeout(this,this._waittTimer),this._waittTimer=qn.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),qn.clearTimeout(e,e._waittTimer),e._waittTimer=null}),this.config.waitTimeout)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var t=oa(),i=t-this.seekingStart;this.seekingStart=0,this.emitLog(da,{end:t,costTime:i,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(qn.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(qn.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=oa(),i=t-this.waitingStart,n=t-this.fixedWaitingStart,r=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(ua,{fixedCostTime:n>r?r:n,costTime:i>r?r:i,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var i=this.player;this.emit(Xr,En({t:oa(),host:qn.getHostFromUrl(i.currentSrc),vtype:i.vtype,eventType:e,currentTime:this.player.currentTime,readyState:i.video.readyState,networkState:i.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),i}(Bo);function pa(){return(new DOMParser).parseFromString('<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">\n <path fill="#fff" transform="translate(20, 20)" d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var ga=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"registerIcons",value:function(){return{replay:pa}}},{key:"afterCreate",value:function(){var e=this;Bo.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayClick",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(cr,(function(){if(e.playerConfig.loop||qn.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var i=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof i&&i.indexOf("none")>-1)return null;t.setAttribute("transform",i)}}})),this.on(sr,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),qn.removeClass(this.player.root,"replay")}},{key:"show",value:function(e){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),i}(Bo),va=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){qn.addClass(this.root,"hide")}},{key:"show",value:function(e){qn.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on(cr,(function(){e.isEndedShow&&qn.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(pr,(function(){e.onTimeUpdate()})),this.on(Ar,(function(){qn.removeClass(e.root,"hide"),qn.addClass(e.root,"xg-showplay"),e.once(pr,(function(){e.onTimeUpdate()}))}))):this.on(sr,(function(){qn.addClass(e.root,"hide")}))}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.config[i]=e[i]}));var i=this.config.poster;this.update(i)}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?qn.removeClass(this.root,"xg-showplay"):this.once(pr,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"getBgSize",value:function(e){var t="";switch(e){case"cover":t="cover";break;case"contain":t="contain";break;case"fixHeight":t="auto 100%";break;default:t=""}return t?"background-size: ".concat(t,";"):""}},{key:"render",value:function(){var e=this.config,t=e.poster,i=e.hideCanplay,n=e.fillMode,r=e.notHidden,o=this.getBgSize(n),a=t?"background-image:url(".concat(t,");").concat(o):o;return'<xg-poster class="xgplayer-poster '.concat(r?"xg-not-hidden":i?"xg-showplay":"",'" style="').concat(a,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}}]),i}(Bo);function ya(){return(new DOMParser).parseFromString('<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n',"image/svg+xml").firstChild}function ma(){return(new DOMParser).parseFromString('<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n',"image/svg+xml").firstChild}var _a={};function ba(e){e?window.clearTimeout(e):Object.keys(_a).map((function(e){window.clearTimeout(_a[e].id),delete _a[e]}))}var ka=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),On(Rn(n=t.call(this,e)),"onPlayerReset",(function(){n.autoPlayStart=!1;var e="auto"===n.config.mode?"auto-hide":"hide";n.setAttr("data-state","play"),qn.removeClass(n.root,e),n.show()})),On(Rn(n),"onAutoplayStart",(function(){if(!n.autoPlayStart){var e="auto"===n.config.mode?"auto-hide":"hide";qn.addClass(n.root,e),n.autoPlayStart=!0,n.toggleTo("play")}})),n.autoPlayStart=!1,n}return Pn(i,[{key:"afterCreate",value:function(){var e=this.playerConfig;this.initIcons(),this.listenEvents(),this.bindClickEvents(),e.autoplay||this.show()}},{key:"listenEvents",value:function(){var e=this,t=this.player,i=this.playerConfig;this.once(Cr,(function(){i&&(i.lang&&"en"===i.lang?qn.addClass(t.root,"lang-is-en"):"jp"===i.lang&&qn.addClass(t.root,"lang-is-jp"))})),this.on(Dr,this.onAutoplayStart),this.on(Pr,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),qn.removeClass(e.root,t),e.show()})),this.on(sr,(function(){e.toggleTo("play")})),this.on(ur,(function(){e.toggleTo("pause")})),this.on(Zr,(function(){e.onPlayerReset()}))}},{key:"bindClickEvents",value:function(){var e=this;this.clickHandler=this.hook("startClick",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation();var i=e.player.paused;e.emitUserAction(t,"switch_play_pause",{props:"paused",from:i,to:!i})}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:ya,class:"xg-icon-play"},startPause:{icon:ma,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){qn.addClass(this.root,"hide")}},{key:"show",value:function(e){qn.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){qn.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){qn.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;this._animateId=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};return _a[e]&&window.clearTimeout(_a[e].id),_a[e]={},i.start&&i.start(),_a[e].id=window.setTimeout((function(){i.end&&i.end(),window.clearTimeout(_a[e].id),delete _a[e]}),t),_a[e].id}("pauseplay",400,{start:function(){qn.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){qn.removeClass(t.root,"interact"),!e&&t.hide(),t._animateId=null}})}},{key:"endAnimate",value:function(){qn.removeClass(this.root,"interact"),ba(this._animateId),this._animateId=null}},{key:"switchPausePlay",value:function(e){var t=this.player;e.cancelable&&e.preventDefault(),e.stopPropagation(),t.state<qo.READY||(this.player.paused||t.state!==qo.RUNNING?t.play():t.pause())}},{key:"onPlayPause",value:function(e){this.toggleTo(e)}},{key:"toggleTo",value:function(e){var t=this.config,i=this.player;if(i&&!(i.state<qo.RUNNING)&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&i.paused&&!i.ended||t.isShowEnd&&i.ended)return this.switchStatus(),this.show(),void this.endAnimate();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||i.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),ba(this._animateId)}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),i}(Bo),wa=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"render",value:function(){var e=this.config.innerHtml,t=qn.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)t.appendChild(e);else if(e&&"string"==typeof e)t.innerHTML=e;else{for(var i="",n=1;n<=12;n++)i+='<div class="xgplayer-enter-bar'.concat(n,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(i,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),i}(Bo);function Sa(e,t,i){try{return' <div class="xg-tips '.concat(i?"hide":" ",'" lang-key="').concat(e.i18nKeys[t],'">\n ').concat(e.i18n[t],"\n </div>")}catch(e){return'<div class="xg-tips hide"></div>'}}var Ta=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_RIGHT,index:10}}}]),i}(Bo);function Ea(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var Ca=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],xa=Ca.length;function Da(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===Cn(e)&&e.nodeType){var t=function(e){return window.getComputedStyle(e)}(e);if("none"===t.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<xa;t++)e[Ca[t]]=0;return e}();var i={};i.width=e.offsetWidth,i.height=e.offsetHeight;for(var n=i.isBorderBox="border-box"===t.boxSizing,r=0;r<xa;r++){var o=Ca[r],a=t[o],s=parseFloat(a);i[o]=Number.isNaN(s)?0:s}var l=i.paddingLeft+i.paddingRight,c=i.paddingTop+i.paddingBottom,u=i.marginLeft+i.marginRight,h=i.marginTop+i.marginBottom,d=i.borderLeftWidth+i.borderRightWidth,f=i.borderTopWidth+i.borderBottomWidth,p=n,g=Ea(t.width);!1!==g&&(i.width=g+(p?0:l+d));var v=Ea(t.height);return!1!==v&&(i.height=v+(p?0:c+f)),i.innerWidth=i.width-(l+d),i.innerHeight=i.height-(c+f),i.outerWidth=i.width+u,i.outerHeight=i.height+h,i}}function Pa(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n.identifier===t)return n}}var Oa="dragStart",Ia="dragMove",La="dragEnded",Aa={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},Ra=function(e){In(i,e);var t=Nn(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xn(this,i),(n=t.call(this)).isEnabled=!0,n.isDragging=!1,n.isDown=!1,n.position={},n.downPoint={},n.dragPoint={x:0,y:0},n.startPos={x:0,y:0},n._root=e instanceof Element?e:document.querySelector(e),n._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),n._root&&n._handlerDom?(n._bindStartEvent(),n):Mn(n)}return Pn(i,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),Aa[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var i=Aa[this._startKey];i.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=i}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=Pa(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=Pa(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=Pa(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var i=Da(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-i.height,this.startPos.maxX=window.innerWidth-i.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(Oa,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(La)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var i={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(i)&&this.dragRealStart(e,t),i}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var i=this.startPos,n=i.x,r=i.y,o=this._dragPointerMove(e,t),a=o.x,s=o.y;a=this.checkContain("x",a,n),s=this.checkContain("y",s,r),this.position.x=n+a,this.position.y=r+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(Ia,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,i){return t+i<0?0-i:"x"===e&&t+i>this.startPos.maxX?this.startPos.maxX-i:"y"===e&&t+i>this.startPos.maxY?this.startPos.maxY-i:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),i=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(i)?0:i,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var i=t.split(","),n=0===t.indexOf("matrix3d")?12:4,r=parseInt(i[n],10),o=parseInt(i[n+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var i=Da(this._root.parentNode);return i?parseFloat(e)/100*i[t]:0}return parseInt(e,10)}}]),i}(zn),Ma=function(e){In(i,e);var t=Nn(i);function i(e){var n;xn(this,i),On(Rn(n=t.call(this,e)),"onCancelClick",(function(e){n.exitMini(),n.isClose=!0})),On(Rn(n),"onCenterClick",(function(e){var t=Rn(n).player;t.paused?t.play():t.pause()})),On(Rn(n),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-n.pos.scrollY)<50)){var t=parseInt(qn.getCss(n.player.root,"height"));t+=n.config.scrollTop,n.pos.scrollY=window.scrollY,window.scrollY>t+5?!n.isMini&&!n.isClose&&n.getMini():window.scrollY<=t&&(n.isMini&&n.exitMini(),n.isClose=!1)}})),n.isMini=!1,n.isClose=!1;var r=Rn(n).config;return n.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:n.config.height,width:n.config.width,scrollY:window.scrollY||0},n.lastStyle=null,n}return Pn(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(ur,(function(){e.setAttr("data-state","pause")})),this.on(sr,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var i={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(Ta,i,Ta.pluginName)}var n=qn.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",n,this.onCancelClick),this.bind(".play-icon",n,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new Ra(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:ya,class:"xg-icon-play"},pause:{icon:ma,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,i=this.playerConfig,n=this.config.target||this.player.root;this.lastStyle={},qn.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=n.style[t],n.style[t]="".concat(e.pos[t],"px")})),i.fluid&&(n.style["padding-top"]=""),this.emit(Hr,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,i=this.playerConfig,n=this.config.target||this.player.root;qn.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){n.style[t]=e.lastStyle[t]})),this.lastStyle=null,i.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*i.height/i.width,"%")),this.emit(Hr,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=qn.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n '.concat(Sa(this,"MINI_DRAG",this.playerConfig.isHideTips),'\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),i}(Bo),Na={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},Ba=["videoClick","videoDbClick"],Ua=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var i=Rn(e),n=i.player,r=i.playerConfig;n.isActive||(n.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&n.media.focus())})),On(Rn(e),"onMouseEnter",(function(t){var i=Rn(e),n=i.playerConfig,r=i.player;!n.closeFocusVideoFocus&&r.media.focus(),n.closeDelayBlur?r.focus({autoHide:!1}):r.focus(),e.emit(Nr)})),On(Rn(e),"onMouseLeave",(function(t){var i=e.playerConfig,n=i.closePlayerBlur,r=i.leavePlayerTime,o=i.closeDelayBlur;n||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur({ignorePaused:!0})),e.emit(Mr)})),On(Rn(e),"onVideoClick",(function(t){var i=Rn(e),n=i.player,r=i.playerConfig;t.target&&r.closeVideoClick||t.target!==n.root&&t.target!==n.media&&t.target!==n.innerContainer&&t.target!==n.media.__canvas||(t.preventDefault(),r.closeVideoStopPropagation||t.stopPropagation(),e._clickCount++,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),e.clickTimer=setTimeout((function(){e._clickCount&&(e._clickCount--,So(Rn(e),Ba[0],(function(t,i){e.switchPlayPause(i.e)}),{e:t,paused:n.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),On(Rn(e),"onVideoDblClick",(function(t){var i=Rn(e),n=i.player,r=i.playerConfig;r.closeVideoDblclick||!t.target||t.target!==n.media&&t.target!==n.media.__canvas||(!r.closeVideoClick&&e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),So(Rn(e),Ba[1],(function(t,i){e.emitUserAction(i.e,"switch_fullscreen",{props:"fullscreen",from:n.fullscreen,to:!n.fullscreen}),n.fullscreen?n.exitFullscreen():n.getFullscreen()}),{e:t,fullscreen:n.fullscreen})))})),e}return Pn(i,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,Ba.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===ir.device&&!ir.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,i=t.media,n=t.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(Na).map((function(t){n.addEventListener(t,e[Na[t]],!1)})),!r&&i&&i.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause",{props:"paused",from:t.paused,to:!t.paused}),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,i=t.video,n=t.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),i.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(Na).map((function(t){n.removeEventListener(t,e[Na[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),i}(Eo),ja="press",Ha="pressend",Fa="doubleclick",Va="click",za="touchmove",Ga="touchstart",Wa="touchend",Ka={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},Ya={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function $a(e){return e&&e.length>0?e[e.length-1]:null}var qa=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};xn(this,e),On(this,"onTouchStart",(function(e){var t=i._pos,n=i.root,r=$a(e.touches);t.x=r?parseInt(r.pageX,10):e.pageX,t.y=r?parseInt(r.pageX,10):e.pageX,t.start=!0,i.__setPress(e),n.addEventListener(i.events.end,i.onTouchEnd),n.addEventListener(i.events.cancel,i.onTouchCancel),n.addEventListener(i.events.move,i.onTouchMove),i.trigger(Ga,e)})),On(this,"onTouchCancel",(function(e){i.onTouchEnd(e)})),On(this,"onTouchEnd",(function(e){var t=i._pos,n=i.root;i.__clearPress(),n.removeEventListener(i.events.cancel,i.onTouchCancel),n.removeEventListener(i.events.end,i.onTouchEnd),n.removeEventListener(i.events.move,i.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&i.trigger(Ha,e),i.trigger(Wa,e),!t.press&&!t.moving&&i.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),On(this,"onTouchMove",(function(e){var t=i._pos,n=i.config,r=$a(e.touches),o=r?parseInt(r.pageX,10):e.pageX,a=r?parseInt(r.pageY,10):e.pageX,s=o-t.x,l=a-t.y;Math.abs(l)<n.miniStep&&Math.abs(s)<n.miniStep||(i.__clearPress(),t.press&&i.trigger(Ha,e),t.press=!1,t.moving=!0,i.trigger(za,e))})),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0},Object.keys(n).map((function(e){i.config[e]=n[e]})),this.root=t,this.events="mouse"===n.eventType?Ya:Ka,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return Pn(e,[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,i=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(ja,e),t._pos.press=!0,t.__clearPress()}),i.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,i=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(Fa,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(Va,e)}),i.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var i=this.__handlers[e],n=-1,r=0;r<i.length;r++)if(i[r]===t){n=r;break}n>=0&&this.__handlers[e].splice(n,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(e){try{e(t)}catch(e){}}))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(i){e.root.removeEventListener(i,e[t[i]])}))}}]),e}();function Xa(){return(new DOMParser).parseFromString('<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <path opacity="0.54"\n d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"\n fill="white" />\n <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}var Ja="auto",Za="seeking",Qa="playbackrate",es=["videoClick","videoDbClick"],ts=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),On(Rn(n=t.call(this,e)),"onTouchStart",(function(e){var t=Rn(n),i=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=n.getTouche(e);if(s&&!r.disableGesture&&n.duration>0&&!i.ended){o.isStart=!0,n.timer&&clearTimeout(n.timer),qn.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),n.find(".xg-dur").innerHTML=qn.format(n.duration);var l=n.root.getBoundingClientRect();90===i.rotateDeg?(o.top=l.left,o.left=l.top,o.width=l.height,o.height=l.width):(o.top=l.top,o.left=l.left,o.width=l.width,o.height=l.height);var c=parseInt(s.pageX-o.left,10),u=parseInt(s.pageY-o.top,10);o.x=90===i.rotateDeg?u:c,o.y=90===i.rotateDeg?c:u,o.scopeL=r.scopeL*o.width,o.scopeR=(1-r.scopeR)*o.width,o.scopeM1=o.width*(1-r.scopeM)/2,o.scopeM2=o.width-o.scopeM1}})),On(Rn(n),"onTouchMove",(function(e){var t=n.getTouche(e),i=Rn(n),r=i.pos,o=i.config,a=i.player;if(t&&!o.disableGesture&&n.duration&&r.isStart){var s=o.miniMoveStep,l=o.hideControlsActive,c=parseInt(t.pageX-r.left,10),u=parseInt(t.pageY-r.top,10),h=90===a.rotateDeg?u:c,d=90===a.rotateDeg?c:u;if(Math.abs(h-r.x)>s||Math.abs(d-r.y)>s){var f=h-r.x,p=d-r.y,g=r.scope;if(-1===g&&(0===(g=n.checkScope(h,d,f,p,r))&&(l?a.blur():a.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*a.currentTime,10)+1e3*n.timeOffset)),r.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;n.executeMove(f,p,g,r.width,r.height),r.x=h,r.y=d}}})),On(Rn(n),"onTouchEnd",(function(e){var t=Rn(n),i=t.player,r=t.pos,o=t.playerConfig;if(setTimeout((function(){i.getPlugin("progress")&&i.getPlugin("progress").resetSeekState()}),10),r.isStart){r.scope>-1&&e.cancelable&&e.preventDefault();var a=n.config,s=a.disableGesture,l=a.gestureX;!s&&l?n.endLastMove(r.scope):r.time=0,r.scope=-1,n.resetPos(),qn.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),n.changeAction(Ja)}})),On(Rn(n),"onRootTouchMove",(function(e){!n.config.disableGesture&&n.config.gestureX&&n.checkIsRootTarget(e)&&(e.stopPropagation(),n.pos.isStart?n.onTouchMove(e):n.onTouchStart(e))})),On(Rn(n),"onRootTouchEnd",(function(e){n.pos.scope>-1&&n.onTouchEnd(e)})),n.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},n.timer=null,n}return Pn(i,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:Xa,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;es.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,i=this.config,n=this.player;!0===t.closeVideoDblclick&&(i.closedbClick=!0),this.resetPos(),qn.isUndefined(t.disableGesture)||(i.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=qn.createDom("xg-mask","",{},"xgmask"),n.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new qa(this.root,{eventType:r,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),n.root.addEventListener("touchmove",this.onRootTouchMove,!0),n.root.addEventListener("touchend",this.onRootTouchEnd,!0),n.root.addEventListener("touchcancel",this.onRootTouchEnd,!0);var o=this.player.controls;o&&o.center&&(o.center.addEventListener("touchmove",this.onRootTouchMove,!0),o.center.addEventListener("touchend",this.onRootTouchEnd,!0),o.center.addEventListener("touchcancel",this.onRootTouchEnd,!0)),this.on(yr,(function(){var t=e.player,i=e.config;t.duration>0&&1e3*t.duration<i.moveDuration&&(i.moveDuration=1e3*t.duration)})),this.on([vr,cr],(function(){var t=e.pos,i=t.time;!t.isStart&&i>0&&(e.pos.time=0)}));var a={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(a).map((function(t){e.touch.on(t,(function(i){e[a[t]](i)}))})),!i.disableActive){var s=n.plugins.progress;s&&(s.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),["dragend","click"].forEach((function(t){s.addCallBack(t,(function(){e.changeAction(Ja)}))})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,i=e.progressColor,n=e.timePreviewStyle,r=e.curTimeColor,o=e.durationColor;if(t&&(this.find(".xg-curbar").style.backgroundColor=t),i&&(this.find(".xg-bar").style.backgroundColor=i),n){var a=this.find(".time-preview");Object.keys(n).forEach((function(e){a.style[e]=n[e]}))}var s=r||t,l=o;s&&(this.find(".xg-cur").style.color=s),l&&(this.find(".xg-dur").style.color=l),this.config.disableTimeProgress&&qn.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var i=t.plugins.start;i&&i.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,i,n,r){var o=r.width,a=-1;if(e<0||e>o)return a;var s=0===n?Math.abs(i):Math.abs(i/n);return Math.abs(i)>0&&s>=1.73&&e>r.scopeM1&&e<r.scopeM2?a=0:(0===Math.abs(i)||s<=.57)&&(a=e<r.scopeL?1:e>r.scopeR?2:3),a}},{key:"executeMove",value:function(e,t,i,n,r){switch(i){case 0:this.updateTime(e/n*this.config.scopeM);break;case 1:this.updateBrightness(t/r);break;case 2:ir.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,i=this.pos,n=this.player,r=this.config,o=(i.time-this.timeOffset)/1e3;0===e&&(n.seek(Number(o).toFixed(1)),r.hideControlsEnd?n.blur():n.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500)),this.changeAction(Ja)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"sendUseAction",value:function(e){var t=this.player.paused;this.emitUserAction(e,"switch_play_pause",{prop:"paused",from:t,to:!t})}},{key:"clickHandler",value:function(e){var t=this.player,i=this.config,n=this.playerConfig;t.state<qo.RUNNING?n.closeVideoClick||(this.sendUseAction(qn.createEvent("click")),t.play()):!i.closedbClick||n.closeVideoClick?t.isActive?t.blur():t.focus():n.closeVideoClick||((t.isActive||i.focusVideoClick)&&(this.sendUseAction(qn.createEvent("click")),this.switchPlayPause()),t.focus())}},{key:"dbClickHandler",value:function(e){var t=this.config,i=this.player;!t.closedbClick&&i.state>=qo.RUNNING&&(this.sendUseAction(qn.createEvent("dblclick")),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,i=this.player;So(this,es[0],(function(e,i){t.clickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onDbClick",value:function(e){var t=this,i=this.player;So(this,es[1],(function(e,i){t.dbClickHandler(i.e)}),{e:e,paused:i.paused})}},{key:"onPress",value:function(e){var t=this.pos,i=this.config,n=this.player;i.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{prop:"playbackRate",from:n.playbackRate,to:i.pressRate}),n.playbackRate=i.pressRate,this.changeAction(Qa))}},{key:"onPressEnd",value:function(e){var t=this.pos,i=this.config,n=this.player;i.disablePress||(this.emitUserAction("pressend","change_rate",{prop:"playbackRate",from:n.playbackRate,to:t.rate}),n.playbackRate=t.rate,t.rate=1,this.changeAction(Ja))}},{key:"updateTime",value:function(e){var t=this.player,i=this.config,n=this.player.duration;e=Number(e.toFixed(4));var r=parseInt(e*i.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*n?1e3*n-200:r,t.getPlugin("time")&&t.getPlugin("time").updateTime(r/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(r/1e3/this.duration,!0),this.activeSeekNote(r/1e3,e>0),i.isTouchingSeek&&t.seek(Number((r-this.timeOffset)/1e3).toFixed(1)),this.pos.time=r}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,i=this.pos;if(e=parseInt(100*e,10),i.volume+=e,!(Math.abs(i.volume)<10)){var n=parseInt(10*t.volume,10)-parseInt(i.volume/10,10);n=n>10?10:n<1?0:n,t.volume=n/10,i.volume=0}}},{key:"updateBrightness",value:function(e){var t=this.pos,i=this.config,n=this.xgMask;if(i.darkness){this.player.rotateDeg&&(e=-e);var r=t.light+.8*e;r=r>i.maxDarkness?i.maxDarkness:r<0?0:r,n&&(n.style.backgroundColor="rgba(0,0,0,".concat(r,")")),t.light=r}}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.player,n=this.config,r=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!r&&!n.disableActive){e<0?e=0:e>i.duration&&(e=i.duration-.2),this.changeAction(Za);var o=i.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=qn.format(this.duration),this.find(".xg-cur").innerHTML=qn.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?qn.removeClass(this.find(".xg-seek-show"),"xg-back"):qn.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(e.state<qo.ATTACHED)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!0}},{key:"enableGesture",value:function(){this.config.disableGesture=!1}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0),e.root.removeEventListener("touchcancel",this.onRootTouchEnd,!0);var t=this.player.controls;t&&t.center&&(t.center.removeEventListener("touchmove",this.onRootTouchMove,!0),t.center.removeEventListener("touchend",this.onRootTouchEnd,!0),t.center.removeEventListener("touchcancel",this.onRootTouchEnd,!0))}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span class="xg-separator">/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{index:0,disableGesture:!1,gestureX:!0,gestureY:!0,gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),i}(Bo);function is(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var ns=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var i=t||window.event,n=i.keyCode,r=Rn(e),o=r._keyState,a=r.player,s=e.config,l=s.disable,c=s.disableBodyTrigger,u=s.isIgnoreUserActive;l||c||!a.isUserActive&&!u||is(i.target)||!e.checkIsVisible()||i.metaKey||i.altKey||i.ctrlKey?o.isBodyKeyDown=!1:(t.repeat||o.isKeyDown||((i.target===document.body||e.config.isGlobalTrigger&&!is(i.target))&&e.checkCode(n,!0)&&(o.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)),o.isBodyKeyDown&&e.handleKeyDown(i))}})),On(Rn(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),On(Rn(e),"onKeydown",(function(t){if(e.player){var i=t||window.event,n=Rn(e)._keyState;if(!i.repeat){if(e.config.disable||e.config.disableRootTrigger||i.metaKey||i.altKey||i.ctrlKey)return;!i||37!==i.keyCode&&!e.checkCode(i.keyCode)||i.target!==e.player.root&&i.target!==e.player.video&&i.target!==e.player.controls.el||(n.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}n.isKeyDown&&e.handleKeyDown(i)}})),On(Rn(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return Pn(i,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(i){e.keyCodeMap[i]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map((function(n){t[i][n]&&(e.keyCodeMap[i][n]=t[i][n])})):e.keyCodeMap[i]=t[i]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.config[i]=e[i]}))}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,i=e.top,n=e.bottom,r=window.innerHeight;return!(i<0&&i<0-.9*t||n>0&&n-r>.9*t)}},{key:"checkCode",value:function(e,t){var i=this,n=!1;return Object.keys(this.keyCodeMap).map((function(r){i.keyCodeMap[r]&&e===i.keyCodeMap[r].keyCode&&!i.keyCodeMap[r].disable&&(n=!t||t&&!i.keyCodeMap[r].noBodyTarget)})),n}},{key:"downVolume",value:function(e){var t=this.player;if(!(t.volume<=0)){var i=parseFloat((t.volume-.1).toFixed(1)),n={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:n}),t.volume=i>=0?i:0}}},{key:"upVolume",value:function(e){var t=this.player;if(!(t.volume>=1)){var i=parseFloat((t.volume+.1).toFixed(1)),n={volume:{from:t.volume,to:i}};this.emitUserAction(e,"change_volume",{props:n}),t.volume=i<=1?i:1}}},{key:"seek",value:function(e){var t=this.player,i=t.currentTime,n=t.offsetCurrentTime,r=t.duration,o=t.offsetDuration,a=t.timeSegments,s=n>-1?n:i,l=o||r,c=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;s+c<=l?s+=c:s=l;var u=qn.getCurrentTimeByOffset(s,a),h={currentTime:{from:i,to:u}};this.emitUserAction(e,"seek",{props:h}),this.player.currentTime=u}},{key:"seekBack",value:function(e){var t=this.player,i=t.currentTime,n=t.offsetCurrentTime,r=t.timeSegments,o=(n>-1?n:i)-(e.repeat?parseInt(this.seekStep/2,10):this.seekStep);o<0&&(o=0);var a={currentTime:{from:i,to:o=qn.getCurrentTimeByOffset(o,r)}};this.emitUserAction(e,"seek",{props:a}),this.player.currentTime=o}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,i=this.config,n=this.player;0===t.playbackRate&&(t.playbackRate=n.playbackRate,n.playbackRate=i.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,i=t.fullscreen,n=t.cssfullscreen;i&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:i,to:!i}),t.exitFullscreen()),n&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:n,to:!n}),t.exitCssFullscreen())}},{key:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var i=Date.now();if(i-t.tt<200)return;t.tt=i}this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,i){for(var n,r=Object.keys(this.keyCodeMap),o=0;o<r.length;o++){var a=this.keyCodeMap[r[o]],s=a.action,l=a.keyCode,c=a.disable,u=a.pressAction,h=a.disablePress;if(l===e){if(!(c||i&&h)){var d=i&&u||s;"function"==typeof d?s(t,this.player,i):"string"==typeof d&&"function"==typeof this[d]&&this[d](t,this.player,i),this.emit(qr,En({key:r[o],target:t.target,isPress:i},this.keyCodeMap[r[o]]))}(n=t).preventDefault(),n.returnValue=!1,t.stopPropagation();break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!0,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!0}}}]),i}(Eo);function rs(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewB
1ox="-5 -5 110 110">\n <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>\n</svg>\n',"image/svg+xml").firstChild}var os=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"registerIcons",value:function(){return{loadingIcon:rs}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return'\n <xg-loading class="xgplayer-loading">\n <xg-loading-inner></xg-loading-inner>\n </xg-loading>'}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:Lo.ROOT}}}]),i}(Bo),as=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],ss=function(){function e(t){xn(this,e),this.fragments=t.fragments||[],0===this.fragments.length&&this.fragments.push({percent:1}),this._callBack=t.actionCallback,this.fragConfig={fragFocusClass:t.fragFocusClass||"inner-focus-point",fragAutoFocus:!!t.fragAutoFocus,fragClass:t.fragClass||""},this.style=t.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return Pn(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var i=0,n=this.fragments;this.fragments=n.map((function(e){return e.start=parseInt(i,10),e.end=parseInt(i+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),i+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},i=this.progressList,n=this.fragments;if(!(i.length<1)){var r=t.newIndex,o=t.curIndex,a=t.millisecond;r!==o&&i.map((function(t,i){i<r?t[e].style.width="100%":i>r&&(t[e].style.width=0)}));var s=n[r],l=0===a?0:(a-s.start)/s.duration;i[r][e].style.width=l<0?0:"".concat(100*l,"%")}}},{key:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var i={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(i)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var n={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(n),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var i=this.playedIndex,n=this.cachedIndex;if("Undefined"!==qn.typeOf(e.played)){var r=this.findIndex(1e3*e.played,i);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:i,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==qn.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,n);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:n,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var i=this.fragments;if(!i||0===i.length)return-1;if(1===i.length)return 0;if(t>-1&&t<i.length&&e>i[t].start&&e<i[t].end)return t;if(e>i[i.length-1].start)return i.length-1;for(var n=0;n<i.length;n++)if(e>i[n].start&&e<=i[n].end){t=n;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(qn.hasClass(e[t],this.fragConfig.fragFocusClass))return{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"findFragment",value:function(e){var t=this.root.children;return e<0||e>=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)qn.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return qn.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(i){void 0!==e[i]&&(t.fragConfig[i]=e[i])})),e.fragments){if(this.fragments=0===e.fragments.length?[{percent:1}]:e.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var i=this.root.children;i.length>0;)this.root.removeChild(i[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=qn.createDom("xg-inners","",{},"progress-list")),this.fragments){var i=this.fragConfig,n=i.fragClass,r=i.fragFocusClass;this.progressList=this.fragments.map((function(i){var o=qn.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(i.percent):"flex: ".concat(i.percent)}
vendor: 15,956 bytes, line 1
1,"".concat(i.isFocus?r:""," xgplayer-progress-inner ").concat(n));return e.root.appendChild(o),as.forEach((function(t){o.appendChild(qn.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:o.children[0],played:o.children[1]}}))}return this.root}}]),e}(),ls={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},cs=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),On(Rn(n=t.call(this,e)),"onMoveOnly",(function(e,t){var i=Rn(n),r=i.pos,o=i.config,a=i.player,s=t;if(e){qn.event(e);var l=qn.getEventPos(e,a.zoom),c=90===a.rotateDeg?l.clientY:l.clientX;if(r.moving&&Math.abs(r.x-c)<o.miniMoveStep)return;r.moving=!0,r.x=c,s=n.computeTime(e,c)}n.triggerCallbacks("dragmove",s,e),n._updateInnerFocus(s)})),On(Rn(n),"onBodyClick",(function(e){n.pos.isLocked&&(n.pos.isLocked=!1,e.preventDefault(),e.stopPropagation())})),On(Rn(n),"_mouseDownHandler",(function(e,t){n._state.time=t.currentTime,n.updateWidth(t.currentTime,t.seekTime,t.percent,0),n._updateInnerFocus(t)})),On(Rn(n),"_mouseUpHandler",(function(e,t){Rn(n).pos.moving&&n.updateWidth(t.currentTime,t.seekTime,t.percent,2)})),On(Rn(n),"_mouseMoveHandler",(function(e,t){var i=Rn(n),r=i._state,o=i.pos,a=i.config,s=i.player;r.time<t.currentTime?t.forward=!0:t.forward=!1,r.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,a.isPauseMoving&&s.pause(),n.triggerCallbacks("dragstart",t,e),n.emitUserAction("drag","dragstart",t)),n.updateWidth(t.currentTime,t.seekTime,t.percent,1),n.triggerCallbacks("dragmove",t,e),n._updateInnerFocus(t)})),On(Rn(n),"onMouseDown",(function(e){var t=Rn(n),i=t._state,r=t.player,o=t.pos,a=t.config,s=t.playerConfig,l=qn.getEventPos(e,r.zoom),c=90===r.rotateDeg?l.clientY:l.clientX;if(!(r.isMini||a.closeMoveSeek||!s.allowSeekAfterEnded&&r.ended)){if(r.duration||r.isPlaying){e.stopPropagation(),n.focus(),qn.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),qn.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),qn.event(e),o.x=c,o.isDown=!0,o.moving=!1,i.prePlayTime=r.currentTime,r.focus({autoHide:!1}),n.isProgressMoving=!0,qn.addClass(n.progressBtn,"active");var u=n.computeTime(e,c);return u.prePlayTime=i.prePlayTime,n._mouseDownHandlerHook(e,u),"touchstart"===e.type?(n.root.addEventListener("touchmove",n.onMouseMove),n.root.addEventListener("touchend",n.onMouseUp),n.root.addEventListener("touchcancel",n.onMouseUp)):(n.unbind("mousemove",n.onMoveOnly),document.addEventListener("mousemove",n.onMouseMove,!1),document.addEventListener("mouseup",n.onMouseUp,!1)),!0}r.play()}})),On(Rn(n),"onMouseUp",(function(e){var t=Rn(n),i=t.player,r=t.config,o=t.pos,a=t.playerConfig,s=t._state;e.stopPropagation(),e.preventDefault(),qn.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),qn.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),qn.event(e),qn.removeClass(n.progressBtn,"active");var l=n.computeTime(e,o.x);l.prePlayTime=s.prePlayTime,o.moving?(n.triggerCallbacks("dragend",l,e),n.emitUserAction("drag","dragend",l)):(n.triggerCallbacks("click",l,e),n.emitUserAction("click","click",l)),n._mouseUpHandlerHook(e,l),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,o.isLocked=!0,s.prePlayTime=0,s.time=0;var c=e.type;"touchend"===c||"touchcancel"===c?(n.root.removeEventListener("touchmove",n.onMouseMove),n.root.removeEventListener("touchend",n.onMouseUp),n.root.removeEventListener("touchcancel",n.onMouseUp),n.blur()):(document.removeEventListener("mousemove",n.onMouseMove,!1),document.removeEventListener("mouseup",n.onMouseUp,!1),o.isEnter?"mobile"!==a.isMobileSimulateMode&&n.bind("mousemove",n.onMoveOnly):n.onMouseLeave(e)),qn.setTimeout(Rn(n),(function(){n.resetSeekState()}),1),i.focus()})),On(Rn(n),"onMouseMove",(function(e){var t=Rn(n),i=t._state,r=t.pos,o=t.player,a=t.config;qn.checkTouchSupport()&&e.preventDefault(),qn.event(e);var s=qn.getEventPos(e,o.zoom),l=90===o.rotateDeg?s.clientY:s.clientX,c=Math.abs(r.x-l);if(!(r.moving&&c<a.miniMoveStep||!r.moving&&c<a.miniStartStep)){r.x=l;var u=n.computeTime(e,l);u.prePlayTime=i.prePlayTime,n._mouseMoveHandlerHook(e,u)}})),On(Rn(n),"onMouseOut",(function(e){n.triggerCallbacks("mouseout",null,e)})),On(Rn(n),"onMouseOver",(function(e){n.triggerCallbacks("mouseover",null,e)})),On(Rn(n),"onMouseEnter",(function(e){var t=Rn(n),i=t.player,r=t.pos;if(!(r.isDown||r.isEnter||i.isMini||!i.config.allowSeekAfterEnded&&i.ended)){r.isEnter=!0,n.bind("mousemove",n.onMoveOnly),n.bind("mouseleave",n.onMouseLeave),qn.event(e);var o=qn.getEventPos(e,i.zoom),a=90===i.rotateDeg?o.clientY:o.clientX,s=n.computeTime(e,a);n.triggerCallbacks("mouseenter",s,e),n.focus()}})),On(Rn(n),"onMouseLeave",(function(e){n.triggerCallbacks("mouseleave",null,e),n.unlock(),n._updateInnerFocus(null)})),On(Rn(n),"onVideoResize",(function(){var e=n.pos,t=e.x,i=e.isDown;if(e.isEnter&&!i){var r=n.computeTime(null,t);n.onMoveOnly(null,r)}})),n.useable=!1,n.isProgressMoving=!1,n.__dragCallBacks=[],n._state={now:-1,direc:0,time:0,prePlayTime:-1},n._disableBlur=!1,"boolean"==typeof n.config.isDragingSeek&&(n.config.isDraggingSeek=n.config.isDragingSeek),n}return Pn(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i+this.timeOffset}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"show",value:function(e){this.root&&(this.root.style.display="flex")}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var n=En(En({fragments:t},i),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(n):(this.innerList=new ss(n),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1,isLocked:!1},this.outer=this.find("xg-outer");var e=this.config,t=e.fragFocusClass,i=e.fragAutoFocus,n=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:t,fragAutoFocus:i,fragClass:n,style:this.playerConfig.commonStyle||{}}),"mobile"===ir.device&&(this.config.isDraggingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.listenEvents(),this.bindDomEvents(),this.initCustomStyle()}}},{key:"listenEvents",value:function(){var e=this;this.on(yr,(function(){e.onMouseLeave()})),this.on(pr,(function(){e.onTimeupdate()})),this.on(fr,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(kr,(function(){e.onCacheUpdate()})),this.on(cr,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(Sr,(function(){e.onReset()})),this.on(Gr,(function(){e.onVideoResize()}))}},{key:"setConfig",value:function(e){var t=this,i=null;Object.keys(e).forEach((function(n){t.config[n]=e[n],"fragments"===n&&(i=e[n])})),i&&this._initInner(i,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===Cn(e)&&Object.keys(e).map((function(i){t.style[i]=e[i]})))}},{key:"triggerCallbacks",value:function(e,t,i){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(n){if(n&&n.handler&&n.type===e)try{n.handler(t,i)}catch(e){}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var i=this.__dragCallBacks,n=-1;i.map((function(i,r){i&&i.type===e&&i.handler===t&&(n=r)})),n>-1&&i.splice(n,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,t.isLocked=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||this.root.addEventListener("touchstart",this.onMouseDown),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==e.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut),this.player.root.addEventListener("click",this.onBodyClick,!0))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),qn.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),qn.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,i,n){var r=this.config,o=this.player;if(!r.isCloseClickSeek||0!==n){var a=t=t>=o.duration?o.duration-r.endedDiff:Number(t).toFixed(1);this.updatePercent(i),this.updateTime(e),(1!==n||r.isDraggingSeek&&"audio"!==o.config.mediaType)&&(this._state.now=a,this._state.direc=a>o.currentTime?0:1,o.seek(a))}}},{key:"computeTime",value:function(e,t){var i,n,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=t;90===r.rotateDeg?(i=s,n=l):(i=a,n=c);var h=u-n,d=(h=h>i?i:h<0?0:h)/i;d=d<0?0:d>1?1:d;var f=parseInt(d*this.offsetDuration*1e3,10)/1e3;return{percent:d,currentTime:f,seekTime:qn.getCurrentTimeByOffset(f,r.timeSegments),offset:h,width:i,left:n,e:e}}},{key:"updateTime",value:function(e){var t=this.player,i=this.duration;e>i?e=i:e<0&&(e=0);var n=t.plugins.time;n&&n.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.offsetDuration},this.offsetDuration);var i=this.player.plugins.miniprogress;i&&i.update({played:e*this.offsetDuration},this.offsetDuration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,i=this._state,n=this.offsetDuration;if(!(t.isSeeking&&t.media.seeking||this.isProgressMoving)&&t.hasStart){if(i.now>-1){var r=parseInt(1e3*i.now,10)-parseInt(1e3*t.currentTime,10);if(0===i.direc&&r>300||1===i.direc&&r>-300)return void(i.now=-1);i.now=-1}var o=this.currentTime;o=qn.adjustTimeByDuration(o,n,e),this.innerList.update({played:o},n),this.progressBtn.style.left="".concat(o/n*100,"%")}}},{key:"onCacheUpdate",value:function(e){var t=this.player,i=this.duration;if(t){var n=t.bufferedPoint.end;n=qn.adjustTimeByDuration(n,i,e),this.innerList.update({cached:n},i)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0),this.progressBtn.style.left="0%"}},{key:"destroy",value:function(){var e=this.player;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var t=this.domEventType;"touch"!==t&&"compatible"!==t||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),this.root.removeEventListener("touchcancel",this.onMouseUp)),"mouse"!==t&&"compatible"!==t||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!0))}},{key:"render",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){var e=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===e?"xgplayer-progress-bottom":"",'">\n <xg-outer class="xgplayer-progress-outer">\n <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n </xg-outer>\n </xg-progress>\n ')}}}],[{key:"pluginName",get:function(){return"progress"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_CENTER,index:0,disable:!1,isDraggingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:ls.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return ls}}]),i}(Bo),us=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),On(Rn(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return Pn(i,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),i}(Bo),hs=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){t.preventDefault(),t.stopPropagation();var i=Rn(e).player;return e.emitUserAction(t,"switch_play_pause",{prop:"paused",from:i.paused,to:!i.paused}),i.ended?i.replay():i.paused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return Pn(i,[{key:"afterCreate",value:function(){Un(Ln(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.listenEvents(),this.animate(!0))}},{key:"listenEvents",value:function(){var e=this,t=this.player;this.on([sr,ur,hr,Sr],(function(){e.animate(t.paused)}))}},{key:"registerIcons",value:function(){return{play:{icon:ya,class:"xg-icon-play"},pause:{icon:ma,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){if(this.player){var t=this.i18nKeys,i=this.find(".xg-tips");e?(this.setAttr("data-state","pause"),i&&this.changeLangTextKey(i,t.PLAY_TIPS)):(this.setAttr("data-state","play"),i&&this.changeLangTextKey(i,t.PAUSE_TIPS))}}},{key:"destroy",value:function(){Un(Ln(i.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n '.concat(Sa(this,"PLAY_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_LEFT,index:0,disable:!1}}}]),i}(us);function ds(){return(new DOMParser).parseFromString('<svg width="32px" height="40px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
1\n <path d="M11.2374369,14 L17.6187184,7.61871843 C17.9604272,7.27700968 17.9604272,6.72299032 17.6187184,6.38128157 C17.2770097,6.03957281 16.7229903,6.03957281 16.3812816,6.38128157 L9.38128157,13.3812816 C9.03957281,13.7229903 9.03957281,14.2770097 9.38128157,14.6187184 L16.3812816,21.6187184 C16.7229903,21.9604272 17.2770097,21.9604272 17.6187184,21.6187184 C17.9604272,21.2770097 17.9604272,20.7229903 17.6187184,20.3812816 L11.2374369,14 L11.2374369,14 Z" fill="#FFFFFF"></path>\n </g>\n</svg>',"image/svg+xml").firstChild}var fs=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:ds,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){qn.addClass(this.root,"show")}},{key:"hide",value:function(){qn.removeClass(this.root,"show")}},{key:"render",value:function(){return'<xg-icon class="xgplayer-back">\n </xg-icon>'}}],[{key:"pluginName",get:function(){return"topbackicon"}},{key:"defaultConfig",get:function(){return{position:Lo.ROOT_TOP,index:0}}}]),i}(Bo);function ps(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598 214h212v212h-84v-128h-128v-84zM726 726v-128h84v212h-212v-84h128zM214 426v-212h212v84h-128v128h-84zM298 598v128h128v84h-212v-212h84z"></path>\n</svg>\n',"image/svg+xml").firstChild}function gs(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z"></path>\n</svg>\n',"image/svg+xml").firstChild}var vs=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.player.setRotateDeg(0):e.player.setRotateDeg(90))})),e}return Pn(i,[{key:"afterCreate",value:function(){var e=this;Un(Ln(i.prototype),"afterCreate",this).call(this);var t=this.config,n=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=qn.getFullScreenEl();n.fullscreenTarget===r&&this.player.getFullscreen().catch((function(e){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreenChange",this.toggleFullScreen,{pre:function(t){var i=e.player.fullscreen;e.emitUserAction(t,"switch_fullscreen",{prop:"fullscreen",from:i,to:!i})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(Ur,(function(t){var i=e.find(".xg-tips");i&&e.changeLangTextKey(i,t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t)})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:fs,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===ir.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:ps,class:"xg-get-fullscreen"},exitFullscreen:{icon:gs,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){Un(Ln(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===ir.device?"touchend":"click",this.handleFullscreen),"mobile"===ir.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"toggleFullScreen",value:function(e){e&&(e.preventDefault(),e.stopPropagation());var t=this.player,i=this.config;!0===i.useCssFullscreen||"function"==typeof i.useCssFullscreen&&i.useCssFullscreen()?(t.fullscreen?t.exitCssFullscreen():t.getCssFullscreen(),this.animate(t.fullscreen)):i.rotateFullscreen?(t.fullscreen?t.exitRotateFullscreen():t.getRotateFullscreen(),this.animate(t.fullscreen)):i.switchCallback&&"function"==typeof i.switchCallback?i.switchCallback(t.fullscreen):t.fullscreen?(t.exitFullscreen(),i.useScreenOrientation&&this.unlockScreen()):(t.getFullscreen().catch((function(e){})),i.useScreenOrientation&&t.aspectRatio>1&&this.lockScreen(i.lockOrientationType))}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(Sa(this,"FULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}},{key:"lockScreen",value:function(e){try{screen.orientation.lock(e).catch((function(e){}))}catch(e){}}}
vendor: 12,912 bytes, line 1
1,{key:"unlockScreen",value:function(){try{screen.orientation.unlock().catch((function(e){}))}catch(e){}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,useScreenOrientation:!1,lockOrientationType:"landscape",switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),i}(us),ys=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),(n=t.call(this,e)).isActiving=!1,n}return Pn(i,[{key:"duration",get:function(){var e=this.player,t=e.offsetDuration,i=e.duration;return this.playerConfig.customDuration||t||i}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this.player.controls.config.mode;this.mode="flex"===e?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.root.style.display="none"),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.listenEvents())}},{key:"listenEvents",value:function(){var e=this;this.on([yr,fr,pr],(function(t){"durationchange"===t.eventName&&(e.isActiving=!1),e.onTimeUpdate()})),this.on(cr,(function(){e.onTimeUpdate(!0)})),this.on(Sr,(function(){e.onReset()}))}},{key:"show",value:function(e){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="block"),void(this.centerDurDom&&(this.centerDurDom.style.display="block"));this.root.style.display="block"}},{key:"hide",value:function(){if("flex"===this.mode)return this.centerCurDom&&(this.centerCurDom.style.display="none"),void(this.centerDurDom&&(this.centerDurDom.style.display="none"));this.root.style.display="none"}},{key:"onTimeUpdate",value:function(e){var t=this.player,i=this.config,n=this.duration;if(!i.disable&&!this.isActiving&&t.hasStart){var r=this.currentTime+this.timeOffset;r=qn.adjustTimeByDuration(r,n,e),"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(qn.format(r)),n!==1/0&&n>0&&(this.centerDurDom.innerHTML=qn.format(n))):(this.timeDom.innerHTML=this.minWidthTime(qn.format(r)),n!==1/0&&n>0&&(this.durationDom.innerHTML=qn.format(n)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=this.minWidthTime(qn.format(0)),this.centerDurDom.innerHTML=qn.format(0)):(this.timeDom.innerHTML=this.minWidthTime(qn.format(0)),this.durationDom.innerHTML=qn.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=qn.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-left"),this.centerDurDom=qn.createDom("xg-icon","00:00",{},"xgplayer-time xg-time-right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom)}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(qn.hide(this.durationDom),qn.hide(this.timeDom),qn.hide(this.find(".time-separator")),qn.show(this.find(".time-live-tag"))):qn.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(qn.hide(this.durationDom),qn.hide(this.timeDom),qn.hide(this.find(".time-separator")),qn.show(this.find(".time-live-tag"))):(qn.hide(this.find(".time-live-tag")),qn.show(this.find(".time-separator")),qn.show(this.durationDom),qn.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=this.minWidthTime(qn.format(e)):this.centerCurDom.innerHTML=this.minWidthTime(qn.format(e)))}},{key:"minWidthTime",value:function(e){return e.split(":").map((function(e){return'<span class="time-min-width">'.concat(e,"</span>")})).join(":")}},{key:"resetActive",value:function(){var e=this,t=this.player,i=function(){e.isActiving=!1};this.off(fr,i),t.isSeeking&&t.media.seeking?this.once(fr,i):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-time">\n <span class="time-current">00:00</span>\n <span class="time-separator">/</span>\n <span class="time-duration">00:00</span>\n <span class="time-live-tag">'.concat(this.i18n.LIVE_TIP,"</span>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_LEFT,index:2,disable:!1}}}]),i}(Bo),ms=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"_onDurationChange",(function(){e.updateSegments();var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n)){var r=qn.getIndexByTime(i,n),o=qn.getOffsetCurrentTime(i,n,r);e.player.offsetCurrentTime=o,e.changeIndex(r,n)}})),On(Rn(e),"_onLoadedData",(function(){var t=e.player.timeSegments;if(e._checkIfEnabled(t)){var i=qn.getOffsetCurrentTime(0,t);e.player.offsetCurrentTime=i,e.changeIndex(0,t),e.curPos.start>0&&(e.player.currentTime=e.curPos.start)}})),On(Rn(e),"_onTimeupdate",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n)){var r=n.length;e.lastCurrentTime=i;var o=qn.getIndexByTime(i,n);o!==e.curIndex&&e.changeIndex(o,n);var a=qn.getOffsetCurrentTime(i,n,o);if(e.player.offsetCurrentTime=a,e.curPos){var s=e.curPos,l=s.start,c=s.end;i<l?e.player.currentTime=l:i>c&&o>=r-1&&e.player.pause()}}})),On(Rn(e),"_onSeeking",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;if(e._checkIfEnabled(n))if(i<n[0].start)e.player.currentTime=n[0].start;else if(i>n[n.length-1].end)e.player.currentTime=n[n.length-1].end;else{var r=qn.getIndexByTime(i,n);if(r>=0){var o=e.getSeekTime(i,e.lastCurrentTime,r,n);o>=0&&(e.player.currentTime=o)}}})),On(Rn(e),"_onPlay",(function(){var t=e.player,i=t.currentTime,n=t.timeSegments;e._checkIfEnabled(n)&&i>=n[n.length-1].end&&(e.player.currentTime=n[0].start)})),e}return Pn(i,[{key:"afterCreate",value:function(){this.curIndex=-1,this.curPos=null,this.lastCurrentTime=0,this.updateSegments(),this.on(yr,this._onDurationChange),this.on(_r,this._onLoadedData),this.on(pr,this._onTimeupdate),this.on(dr,this._onSeeking),this.on(sr,this._onPlay)}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.updateSegments())}}},{key:"updateSegments",value:function(){var e=this.config,t=e.disable,i=e.segments,n=this.player;if(t||!i||0===i.length)n.timeSegments=[],n.offsetDuration=0,n.offsetCurrentTime=-1;else{var r=this.formatTimeSegments(i,n.duration);n.timeSegments=r,n.offsetDuration=r.length>0?r[r.length-1].duration:0}}},{key:"formatTimeSegments",value:function(e,t){var i=[];return e?(e.sort((function(e,t){return e.start-t.start})),e.forEach((function(e,n){var r={};if(r.start=e.start<0?0:e.start,r.end=t>0&&e.end>t?t:e.end,!(t>0&&r.start>t)){i.push(r);var o=r.end-r.start;if(0===n)r.offset=e.start,r.cTime=0,r.segDuration=o,r.duration=o;else{var a=i[n-1];r.offset=a.offset+(r.start-a.end),r.cTime=a.duration+a.cTime,r.segDuration=o,r.duration=a.duration+o}}})),i):[]}},{key:"getSeekTime",value:function(e,t,i,n){var r=-1,o=n[i],a=o.start,s=o.end;if(e>=a&&e<=s)return r;var l=e-t;if(l<0&&e<a){var c=t>a?t-a:0;return i-1>=0?n[i-1].end+l+c:0}return-1}},{key:"_checkIfEnabled",value:function(e){return!(!e||e.length<1)}},{key:"changeIndex",value:function(e,t){this.curIndex=e,e>=0&&t.length>0?this.curPos=t[e]:this.curPos=null}}],[{key:"pluginName",get:function(){return"TimeSegmentsControls"}},{key:"defaultConfig",get:function(){return{disable:!0,segments:[]}}}]),i}(Eo);function _s(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M940.632 837.632l-72.192-72.192c65.114-64.745 105.412-154.386 105.412-253.44s-40.299-188.695-105.396-253.424l-0.016-0.016 72.192-72.192c83.639 83.197 135.401 198.37 135.401 325.632s-51.762 242.434-135.381 325.612l-0.020 0.020zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function bs(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function ks(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>\n</svg>\n',"image/svg+xml").firstChild}var ws=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var i=Rn(e).player,n=e.find(".xgplayer-bar");qn.event(t);var r=n.getBoundingClientRect(),o=qn.getEventPos(t,i.zoom),a=r.height-(o.clientY-r.top);if(o.h=a,o.barH=r.height,e.pos=o,!(a<-2))return e.updateVolumePos(a,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),On(Rn(e),"onBarMouseMove",(function(t){var i=Rn(e)._d;if(i.isStart){var n=Rn(e),r=n.pos,o=n.player;t.preventDefault(),t.stopPropagation(),qn.event(t);var a=qn.getEventPos(t,o.zoom);i.isMoving=!0;var s=r.h-a.clientY+r.clientY;s>r.barH||e.updateVolumePos(s,t)}})),On(Rn(e),"onBarMouseUp",(function(t){qn.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var i=Rn(e)._d;i.isStart=!1,i.isMoving=!1})),On(Rn(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),On(Rn(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),On(Rn(e),"onVolumeChange",(function(t){if(e.player){var i=e.player,n=i.muted,r=i.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=n||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(n,r)}})),e}return Pn(i,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:bs,class:"xg-volume-small"},volumeLarge:{icon:_s,class:"xg-volume"},volumeMuted:{icon:ks,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,i=t.commonStyle,n=t.volume;i.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=i.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==ir.device&&"mobile"!==this.playerConfig.isMobileSimulateMode&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(mr,this.onVolumeChange),this.once(_r,this.onVolumeChange),"
1Number"!==qn.typeOf(n)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var i=this.player,n=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(r&&n){var o=parseInt(e/r.getBoundingClientRect().height*1e3,10);n.style.height="".concat(e,"px");var a=Math.max(Math.min(o/1e3,1),0),s={volume:{from:i.volume,to:a}};i.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:i.muted,volume:i.volume,props:s}),i.volume=Math.max(Math.min(o/1e3,1),0),i.muted&&(i.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,i=e.muted,n=this.find(".xgplayer-value-label"),r=Math.max(Math.min(t,1),0);n.innerText=i?0:Math.round(100*r)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(qn.clearTimeout(this,this._timerId),this._timerId=null),qn.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(qn.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=qn.setTimeout(this,(function(){r.isActive||(i?o.blur():o.focus(),qn.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(n)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(qn.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===ir.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var e=this.config.default||this.player.volume,t=this.config.showValueLabel;return'\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(t?'<div class="xgplayer-value-label">'.concat(100*e,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ').concat(100*e,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),i}(Bo);function Ss(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">\n <g>\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213
10.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n </g>\n <defs>\n <clipPath>\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}var Ts=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),(n=t.call(this,e)).rotateDeg=n.config.rotateDeg||0,n}return Pn(i,[{key:"afterCreate",value:function(){var e=this;if(!this.config.disable){Un(Ln(i.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(Gr,(function(){e.rotateDeg&&e.config.innerRotate&&qn.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)}));var t=this.player.root;this.rootWidth=t.style.width||t.offsetWidth||t.clientWidth,this.rootHeight=t.style.height||t.offsetHeight||t.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){Un(Ln(i.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"onBtnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"rotate"),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:"updateRotateDeg",value:function(e,t){if(e||(e=0),t)this.player.videoRotateDeg=e;else{var i=this.player,n=this.rootWidth,r=this.rootHeight,o=i.root,a=i.innerContainer,s=i.media,l=o.offsetWidth,c=a&&t?a.offsetHeight:o.offsetHeight,u=n,h=r,d=0,f=0;.75!==e&&.25!==e||(u="".concat(c,"px"),h="".concat(l,"px"),d=-(c-l)/2,f=-(l-c)/2);var p="translate(".concat(d,"px,").concat(f,"px) rotate(").concat(e,"turn)"),g={transformOrigin:"center center",transform:p,webKitTransform:p,height:h,width:u},v=t?s:o,y=t?i.getPlugin("poster"):null;Object.keys(g).map((function(e){v.style[e]=g[e],y&&y.root&&(y.root.style[e]=g[e])}))}}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*i)%1,this.updateRotateDeg(this.rotateDeg,t),n.emit(Kr,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:Ss}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(Sa(this,"ROTATE_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),i}(us);function Es(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}function Cs(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}var xs="picture-in-picture",Ds="inline",Ps="fullscreen",Os=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable())return!1;t.stopPropagation&&t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!0,to:!1}),e.setAttr("data-state","normal")):4===e.player.media.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{props:"pip",from:!1,to:!0}),e.setAttr("data-state","pip"))})),e}return Pn(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.pip&&
vendor: 7,102 bytes, line 1
1(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){var e=this;this.isPIPAvailable()&&(Un(Ln(i.prototype),"afterCreate",this).call(this),this.pMode=Ds,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(Or,(function(){e.config.showIcon&&(qn.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:Es,class:"xg-get-pip"},pipIconExit:{icon:Cs,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,t=this.player;this.leavePIPCallback=function(){var i=t.paused;qn.setTimeout(e,(function(){!i&&t.mediaPlay()}),0),!i&&t.mediaPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(Wr,!1)},this.enterPIPCallback=function(i){t.emit(Wr,!0),null!=i&&i.pictureInPictureWindow&&(e.pipWindow=i.pictureInPictureWindow),e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(i){var n=t.media.webkitPresentationMode;e.pMode===Ps&&n!==Ps&&t.onFullscreenChange(null,!1),e.pMode=n,n===xs?e.enterPIPCallback(i):n===Ds&&e.leavePIPCallback(i)},t.media&&(t.media.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.media.addEventListener("leavepictureinpicture",this.leavePIPCallback),i.checkWebkitSetPresentationMode(t.media)&&t.media.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"copyStyleIntoPiPWindow",value:function(e){var t=jn(document.styleSheets).map((function(t){try{return jn(t.cssRules).map((function(e){return e.cssText})).join("")}catch(n){var i=document.createElement("link");i.rel="stylesheet",i.type=t.type,i.media=t.media,i.href=t.href,e.document.head.appendChild(i)}return""})).filter(Boolean).join("\n"),i=document.createElement("style");i.textContent=t,e.document.head.appendChild(i)}},{key:"requestPIP",value:function(){var e=this,t=this.player,n=this.playerConfig,r=this.config;if(this.isPIPAvailable()&&!this.isPip)try{var o=n.poster;if(o&&(t.media.poster="String"===qn.typeOf(o)?o:o.poster),r.preferDocument&&this.isDocPIPAvailable()){var a={};if(r.width&&r.height)a.width=r.width,a.height=r.height;else{var s=t.root.getBoundingClientRect();a.width=s.width,a.height=s.height}documentPictureInPicture.requestWindow(a).then((function(i){var n=r.docPiPNode,o=r.docPiPStyle;e.enterPIPCallback();var a=n||t.root,s=a.parentElement,l=a.previousSibling,c=a.nextSibling;e.copyStyleIntoPiPWindow(i);var u=document.createElement("style");if(u.append("body{padding:0; margin:0;}"),o){var h="";"string"==typeof o?h=o:"function"==typeof o&&(h=o.call(r)),h&&u.append(h)}else a===t.root&&u.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");i.document.head.append(u),i.document.body.append(a),i.addEventListener("pagehide",(function(t){s&&(c?s.insertBefore(a,c):l?s.insertBefore(a,l.nextSibling):s.appendChild(a)),e.leavePIPCallback()}),{once:!0})}))}else i.checkWebkitSetPresentationMode(t.media)?t.media.webkitSetPresentationMode("picture-in-picture"):t.media.requestPictureInPicture();return!0}catch(e){return!1}}},{key:"exitPIP",value:function(){var e=this.player;try{var t;return this.isPIPAvailable()&&this.isPip&&(this.isDocPIPAvailable()&&null!==(t=documentPictureInPicture)&&void 0!==t&&t.window?documentPictureInPicture.window.close():i.checkWebkitSetPresentationMode(e.media)?e.media.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(e){return!1}}},{key:"isPip",get:function(){var e,t=this.player;return!(!this.isDocPIPAvailable()||null===(e=documentPictureInPicture)||void 0===e||!e.window)||document.pictureInPictureElement&&document.pictureInPictureElement===t.media||t.media.webkitPresentationMode===xs}},{key:"isPIPAvailable",value:function(){var e=this.player.media;return"Boolean"===qn.typeOf(document.pictureInPictureEnabled)&&document.pictureInPictureEnabled&&("Boolean"===qn.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===qn.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)}},{key:"destroy",value:function(){Un(Ln(i.prototype),"destroy",this).call(this);var e=this.player;e.media.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.media.removeEventListener("leavepictureinpicture",this.leavePIPCallback),i.checkWebkitSetPresentationMode(e.media)&&e.media.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(this.config.showIcon&&this.isPIPAvailable())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n '.concat(Sa(this,"PIP",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_RIGHT,index:6,showIcon:!1,preferDocument:!1,width:void 0,height:void 0,docPiPNode:void 0,docPiPStyle:void 0}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),i}(us);function Is(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="40" viewBox="10 0 24 40">\n <path transform="scale(0.038 0.028)" d="M800 380v768h-128v-352l-320 320v-704l320 320v-352z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Ls=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),On(Rn(n=t.call(this,e)),"playNext",(function(e){var t=Rn(n).player;e.preventDefault(),e.stopPropagation(),n.idx+1<n.config.urlList.length?(n.idx++,n.nextHandler(n.config.urlList[n.idx],n.idx),t.emit($r,n.idx+1)):(n.nextHandler(),t.emit($r))})),n.idx=-1,n}return Pn(i,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:Is}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("nextClick",this.changeSrc);var e="mobile"===ir.device?"touchend":"click";this.bind(e,this.playNext),this.show()}},{key:"changeSrc",value:function(e){var t=this.player;e&&(t.pause(),t.currentTime=0,t.switchURL?t.switchURL(e):t.src=e,t.config.url=e,t.play())}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(this.config.urlList&&0!==this.config.urlList.length)return'\n <xg-icon class="xgplayer-playnext">\n <div class="xgplayer-icon">\n </div>\n '.concat(Sa(this,"PLAYNEXT_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),i}
1(Bo),As={exports:function e(t,i,n){var r,o,a=window,s="application/octet-stream",l=n||s,c=t,u=!i&&!n&&c,h=document.createElement("a"),d=function(e){return String(e)},f=a.Blob||a.MozBlob||a.WebKitBlob||d,p=i||"download";if(f=f.call?f.bind(a):Blob,"true"===String(this)&&(l=(c=[c,l])[0],c=c[1]),u&&u.length<2048&&(p=u.split("/").pop().split("?")[0],h.href=u,-1!==h.href.indexOf(u))){var g=new XMLHttpRequest;return g.open("GET",u,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,p,s)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(c.length>2096103.424&&f!==d))return navigator.msSaveBlob?navigator.msSaveBlob(_(c),p):b(c);l=(c=_(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var v=0,y=new Uint8Array(c.length),m=y.length;v<m;++v)y[v]=c.charCodeAt(v);c=new f([y],{type:l})}function _(e){for(var t=e.split(/[:;,]/),i=t[1],n=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=n.length,o=0,a=new Uint8Array(r);o<r;++o)a[o]=n.charCodeAt(o);return new f([a],{type:i})}function b(e,t){if("download"in h)return h.href=e,h.setAttribute("download",p),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout((function(){h.click(),document.body.removeChild(h),!0===t&&setTimeout((function(){a.URL.revokeObjectURL(h.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var i=document.createElement("iframe");document.body.appendChild(i),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),i.src=e,setTimeout((function(){document.body.removeChild(i)}),333)}if(r=c instanceof f?c:new f([c],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(a.URL)b(a.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===d)try{return b("data:"+l+";base64,"+a.btoa(r))}catch(e){return b("data:"+l+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(r)}return!0}},Rs=As.exports;function Ms(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">\n <g id="Group-2">\n <g id="volme_big-copy" transform="translate(488.000000, 340.000000)">\n <rect id="Rectangle-18" x="11" y="4" width="2" height="12" rx="1"></rect>\n <rect id="Rectangle-2" x="3" y="18" width="18" height="2" rx="1"></rect>\n <rect id="Rectangle-2" transform="translate(4.000000, 17.500000) rotate(90.000000) translate(-4.000000, -17.500000) " x="1.5" y="16.5" width="5" height="2" rx="1"></rect><rect id="Rectangle-2-Copy-3" transform="translate(20.000000, 17.500000) rotate(90.000000) translate(-20.000000, -17.500000) " x="17.5" y="16.5" width="5" height="2" rx="1"></rect>\n <path d="M9.48791171,8.26502656 L9.48791171,14.2650266 C9.48791171,14.8173113 9.04019646,15.2650266 8.48791171,15.2650266 C7.93562696,15.2650266 7.48791171,14.8173113 7.48791171,14.2650266 L7.48791171,7.26502656 C7.48791171,6.71274181 7.93562696,6.26502656 8.48791171,6.26502656 L15.4879117,6.26502656 C16.0401965,6.26502656 16.4879117,6.71274181 16.4879117,7.26502656 C16.4879117,7.81731131 16.0401965,8.26502656 15.4879117,8.26502656 L9.48791171,8.26502656 Z" id="Combined-Shape" transform="translate(11.987912, 10.765027) scale(1, -1) rotate(45.000000) translate(-11.987912, -10.765027) "></path>\n </g>\n </g>\n </g>\n </g>\n</svg>\n',"image/svg+xml").firstChild}var Ns=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),On(Rn(n=t.call(this,e)),"download",(function(e){if(!n.isLock){n.emitUserAction(e,"download");var t=n.playerConfig.url,i="";"String"===qn.typeOf(t)?i=t:"Array"===qn.typeOf(t)&&t.length>0&&(i=t[0].src);var r=n.getAbsoluteURL(i);Rs(r),n.isLock=!0,n.timer=window.setTimeout((function(){n.isLock=!1,window.clearTimeout(n.timer),n.timer=null}),300)}})),n.timer=null,n.isLock=!1,n}return Pn(i,[{key:"afterCreate",value:function(){Un(Ln(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this._handler=this.hook("click",this.download,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this._handler))}},{key:"registerIcons",value:function(){return{download:Ms}}},{key:"getAbsoluteURL",value:function(e){if(!e.match(/^https?:\/\//)){var t=document.createElement("div");t.innerHTML='<a href="'.concat(e,'">x</a>'),e=t.firstChild.href}return e}},{key:"destroy",value:function(){Un(Ln(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n '.concat(Sa(this,"DOWNLOAD_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_RIGHT,index:3,disable:!0}}}]),i}(us),Bs=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){Un(Ln(i.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(Gr,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,t){var i,n=document.createElement("a");n.href=e,n.download=t;try{"undefined"!=typeof MouseEvent?i=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}):(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,
vendor: 29,573 bytes, line 1
1!1,!1,0,null)}catch(e){}i&&n.dispatchEvent(i)}},{key:"createCanvas",value:function(e,t){var i=document.createElement("canvas"),n=i.getContext("2d");this.canvasCtx=n,this.canvas=i,i.width=e||this.config.width,i.height=t||this.config.height,n.imageSmoothingEnabled=!0,n.imageSmoothingEnabled&&(n.imageSmoothingQuality="high")}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot");var i=this.config;this.shot(i.width,i.height).then((function(e){t.emit(Yr,e),i.saveImg&&t.saveScreenShot(e,i.name+i.format)}))}},{key:"shot",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,a=n.quality||r.quality,s=n.type||r.type;return new Promise((function(n,l){var c,u=null;if(o.media.canvas)u=o.media.canvas;else{i.canvas?(i.canvas.width=e||r.width,i.canvas.height=t||r.height):i.createCanvas(e,t),u=i.canvas,c=i.canvasCtx;var h,d,f,p,g=o.media.videoWidth/o.media.videoHeight,v=u.width/u.height,y=o.media.videoWidth,m=o.media.videoHeight;g>v?(f=u.width,p=u.width/g,h=0,d=Math.round((u.height-p)/2)):g===v?(f=u.width,p=u.height,h=0,d=0):g<v&&(f=u.height*g,p=u.height,h=Math.round((u.width-f)/2),d=0),c.drawImage(o.media,0,0,y,m,h,d,f,p)}var _=u.toDataURL(s,a).replace(s,"image/octet-stream");n(_=_.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){Un(Ln(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(Gr,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",t="SCREENSHOT";return'\n <xg-icon class="xgplayer-shot">\n <div class="'.concat(e,'">\n ').concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</span>"),"\n </div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,saveImg:!0,fitVideo:!0,disable:!1,name:"screenshot"}}}]),i}(us),Us=function(){function e(t){xn(this,e),this.config=t.config,this.parent=t.root,this.root=qn.createDom("ul","",{},"xg-options-list xg-list-slide-scroll ".concat(this.config.className)),t.root.appendChild(this.root);var i=this.config.maxHeight;i&&this.setStyle({maxHeight:i}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var n="touch"===this.config.domEventType?"touchend":"click";this._delegates=Bo.delegate.call(this,this.root,"li",n,this.onItemClick)}return Pn(e,[{key:"renderItemList",value:function(e){var t=this,i=this.config,n=this.root;e?i.data=e:e=i.data,i.style&&Object.keys(i.style).map((function(e){n.style[e]=i[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,i){var n=e.selected?"option-item selected":"option-item";e["data-index"]=i,t.root.appendChild(qn.createDom("li","<span>".concat(e.showText,"</span>"),e,n))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&qn.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");qn.addClass(t,"selected"),n&&qn.removeClass(n,"selected"),i(e,{from:n?this.getAttrObj(n,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var i={};t.map((function(t){i[t]=e.getAttribute(t)}));var n=e.getAttribute("data-index");return n&&(i.index=Number(n)),i}},{key:"show",value:function(){qn.removeClass(this.root,"hide"),qn.addClass(this.root,"active")}},{key:"hide",value:function(){qn.removeClass(this.root,"active"),qn.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.root.style[i]=e[i]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}(),js="side",Hs="middle",Fs="default",Vs="click",zs="hover",Gs="mobile"===ir.device,Ws=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),On(Rn(n=t.call(this,e)),"onEnter",(function(e){e.stopPropagation(),n.emit("icon_mouseenter",{pluginName:n.pluginName}),n.switchActiveState(e)})),On(Rn(n),"switchActiveState",(function(e){e.stopPropagation(),n.config.toggleMode===Vs?n.toggle(!n.isActive):n.toggle(!0)})),On(Rn(n),"onLeave",(function(e){e.stopPropagation(),n.emit("icon_mouseleave",{pluginName:n.pluginName}),n.config.listType!==js&&n.isActive&&n.toggle(!1)})),On(Rn(n),"onListEnter",(function(e){n.enterType=2})),On(Rn(n),"onListLeave",(function(e){n.enterType=0,n.isActive&&n.toggle(!1)})),n.isIcons=!1,n.isActive=!1,n.curValue=null,n.curIndex=0,n}return Pn(i,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),(Gs=Gs||"touch"===this.domEventType)&&"mobile"===ir.device&&t.listType===Fs&&(t.listType=js),t.hidePortrait&&qn.addClass(this.root,"portrait"),this.on([Gr,Ur],(function(){e._resizeList()})),this.once(vr,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),Gs&&this.on(Tr,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),Gs?(t.toggleMode=Vs,this.activeEvent="touchend"):this.activeEvent=t.toggleMode===Vs?"click":"mouseenter",t.toggleMode===Vs?this.bind(this.activeEvent,this.switchActiveState):(this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave)),this.isIcons&&this.bind("click",this.onIconClick)}},{key:"initIcons",value:function(){var e=this,t=this.icons,i=Object.keys(t),n=!1;i.length>0&&(i.forEach((function(i){e.appendChild(".xgplayer-icon",t[i]),!n&&(n=t[i])})),this.isIcons=n),n||(this.appendChild(".xgplayer-icon",qn.createDom("span","",{},"icon-text")),qn.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||qn.addClass(this.root,"show")}},{key:"hide",value:function(){qn.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,i){if(void 0===e)return"";var n=this.config.list;!i&&(i=this.player.lang),t=!t||qn.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]);try{return"object"===Cn(e[t])?e[t][i]||e[t].en:e[t]}catch(e){return""}}},{key:"toggle",value:function(e){if(e!==this.isActive&&!this.config.disable){var t=this.player.controls,i=this.config.listType;e?(i===js?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):(i===js?t.focus():t.focusAwhile(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.stopPropagation();var i=this.config,n=i.listType,r=i.list;this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),(this.config.isItemClickHide||Gs||n===js)&&this.toggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var i=this,n=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=n.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var a,s,l={config:{data:e||[],className:(a=n.listType,s=n.position,a===js?s===Lo.CONTROLS_LEFT?"xg-side-list xg-left-side":"xg-side-list xg-right-side":""),onItemClick:function(e,t){i.onItemClick(e,t)},domEventType:Gs?"touch":"mouse"},root:n.listType===js?o.innerContainer||o.root:this.root};if(this.config.isShowIcon){var c=this.player.root.getBoundingClientRect().height,u=n.listType===Hs?c-50:c;u&&n.heightLimit&&(l.config.maxHeight="".concat(u,"px")),this.optionsList=new Us(l),this.changeCurrentText(),this.show()}this._resizeList()}},{key:"_resizeList",value:function(){if(this.config.heightLimit){var e=this.player.root.getBoundingClientRect().height,t=this.config.listType===Hs?e-50:e;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(t,"px")})}}},{key:"destroy",value:function(){this.config.toggleMode===Vs?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.isIcons&&this.unbind("click",this.onIconClick),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_RIGHT,index:100,list:[],listType:"default",listStyle:{},hidePortrait:!0,isShowIcon:!1,isItemClickHide:!0,toggleMode:zs,heightLimit:!0}}}]),i}(Bo),Ks=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),(n=t.call(this,e)).curTime=0,n.isPaused=!0,n}return Pn(i,[{key:"beforeCreate",value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;Un(Ln(i.prototype),"afterCreate",this).call(this),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(Fr,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"show",value:function(e){!this.config.list||this.config.list.length<2||qn.addClass(this.root,"show")}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,i=e.defaultDefinition;if(t.length>0){var n=null;t.map((function(e){e.definition===i&&(n=e)})),n||(n=t[0]),this.changeDefinition(n)}}},{key:"renderItemList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.list||[],n=arguments.length>1?arguments[1]:void 0,r=n&&n.definition?n.definition:this.config.defaultDefinition;n&&t.forEach((function(e){e.selected=!1}));var o=0,a=t.map((function(t,i){var n=En(En({},t),{},{showText:e.getTextByLang(t)||t.definition,selected:!1});return(t.selected||t.definition&&t.definition==r)&&(n.selected=!0,o=i),n}));Un(Ln(i.prototype),"renderItemList",this).call(this,a,o)}},{key:"changeDefinitionList",value:function(e){Array.isArray(e)&&(this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})),this.renderItemList(),this.config.list.length<2?this.hide():this.show())}},{key:"changeDefinition",value:function(e,t){this.player.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var n=this.player.definitionList;Un(Ln(i.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<n.length;r++)t.to&&n[r].definition===t.to.definition&&(t.to.url=n[r].url),t.from&&n[r].definition===t.from.definition&&(t.from.url=n[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return En(En({},Ws.defaultConfig),{},{position:Lo.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0})}}]),i}(Ws),Ys=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),(n=t.call(this,e)).curRate=1,n}return Pn(i,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,i=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(i)&&(e.config.list=i.map((function(e){return"number"==typeof e?e={rate:e,text:"".concat(e,"x")}:!e.text&&e.rate&&(e.text="".concat(e.rate,"x")),e})))}},{key:"afterCreate",value:function(){var e=this;Un(Ln(i.prototype),"afterCreate",this).call(this),this.on(br,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(e){this.config.list&&0!==this.config.list.length&&Un(Ln(i.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){Un(Ln(i.prototype),"onItemClick",this).call(this,e,t);var n=e.delegateTarget,r=Number(n.getAttribute("rate"));if(!r||r===this.curValue)return!1;var o={playbackRate:{from:this.player.playbackRate,to:r}};this.emitUserAction(e,"change_rate",{props:o}),this.curValue=r,this.player.playbackRate=r}},{key:"renderItemList",value:function(){var e=this,t=this.player.playbackRate||1;this.curValue=t;var n=-1,r=this.config.list.map((function(i,r){var o={rate:i.rate};return o.rate===t&&(o.selected=!0,n=r),o.showText=e.getTextByLang(i),o}));Un(Ln(i.prototype),"renderItemList",this).call(this,r,n)}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0],i="";i=!t||this.curIndex<0?"".concat(this.player.playbackRate,"x"):this.getTextByLang(t,"iconText"),this.find(".icon-text").innerHTML=i}}},{key:"destroy",value:function(){Un(Ln(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return En(En({},Ws.defaultConfig),{},{position:Lo.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1})}}]),i}(Ws);function $s(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" class=\'path_full\' d="M9,10v1a.9.9,0,0,1-1,1,.9.9,0,0,1-1-1V9A.9.9,0,0,1,8,8h2a.9.9,0,0,1,1,1,.9.9,0,0,1-1,1Zm6,4V13a1,1,0,0,1,2,0v2a.9.9,0,0,1-1,1H14a1,1,0,0,1,0-2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}function qs(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" d="M9,10V9a.9.9,0,0,1,1-1,.9.9,0,0,1,1,1v2a.9.9,0,0,1-1,1H8a.9.9,0,0,1-1-1,.9.9,0,0,1,1-1Zm6,4v1a1,1,0,0,1-2,0V13a.9.9,0,0,1,1-1h2a1,1,0,0,1,0,2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}var Xs=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.cssFullscreen&&(e.config.disable=!e.player.config.cssFullscreen)}},{key:"afterCreate",value:function(){var e=this;Un(Ln(i.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(jr,(function(t){e.animate(t)})),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen))}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e.cssFullscreen),t.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player.isCssfullScreen;this.emitUserAction(e,"switch_cssfullscreen",{cssfullscreen:t}),t?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){var t=this.i18nKeys,i=this.find(".xg-tips");i&&this.changeLangTextKey(i,e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:$s,class:"xg-get-cssfull"},exitCssFullscreen:{icon:qs,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){Un(Ln(i.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return"<xg-icon class='xgplayer-cssfullscreen'>\n <div class=\"xgplayer-icon\">\n </div>\n ".concat(Sa(this,"CSSFULLSCREEN_TIPS",this.playerConfig.isHideTips),"\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:Lo.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),i}(us),Js=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.onError=this.hook("showError",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(hr,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,i=e.errorType,n=t.errorNote?this.i18n[t.errorNote]:"";if(!n)switch(i){case"decoder":n=this.i18n.MEDIA_ERR_DECODE;break;case"network":n=this.i18n.MEDIA_ERR_NETWORK;break;default:n=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=n,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n <div class="xgplayer-errornote">\n <span class="xgplayer-error-text"></span>\n <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n </div>\n </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),i}(Bo),Zs=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))})),this.player.showPrompt=function(){e.showPrompt.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(i){t.root.style[i]=e[i]}))}},{key:"showPrompt",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=n;var r=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),qn.addClass(this.root,"show"),"arrow"===i.mode&&qn.addClass(this.root,"arrow"),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),i.style&&this.setStyle(i.style),"boolean"==typeof i.autoHide?i.autoHide:this.config.autoHide){var o=i.interval||r;this.intervalId=setTimeout((function(){t.hide()}),o)}}}},{key:"hide",value:function(){qn.removeClass(this.root,"show"),qn.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(Fo.CONTROLS_FOLLOW,'">\n <span class="xgplayer-prompt-detail"></span>\n </xg-prompt>')}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}]),i}(Bo),Qs={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function el(e){Object.keys(Qs).map((function(t){void 0===e[t]&&(e[t]=Qs[t])}))}var tl={_updateDotDom:function(e,t){if(t){var i=this.calcuPosition(e.time,e.duration),n=e.style||{};n.left="".concat(i.left,"%"),n.width="".concat(i.width,"%"),t.setAttribute("data-text",e.text),t.setAttribute("data-time",e.time),i.isMini?qn.addClass(t,"mini"):qn.removeClass(t,"mini"),Object.keys(n).map((function(e){t.style[e]=n[e]}))}},initDots:function(){var e=this;this._ispots.map((function(t){e.createDot(t,!1)})),this.ispotsInit=!0},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.player.plugins.progress;if(i&&(t&&(el(e),this._ispots.push(e)),this.ispotsInit||!t)){var n=this.calcuPosition(e.time,e.duration),r=e.style||{};r.left="".concat(n.left,"%"),r.width="".concat(n.width,"%");var o="xgspot_".concat(e.id," xgplayer-spot");n.isMini&&(o+=" mini");var a=e.template?'<div class="xgplayer-spot-pop">'.concat(e.template,"</div>"):"",s=qn.createDom("xg-spot",a,{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);Object.keys(r).map((function(e){s.style[e]=r[e]})),i.outer&&i.outer.appendChild(s),this.positionDot(s,e.id)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,i){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.player.plugins.progress;if(i){var n=this.findDot(e.id);if(n&&Object.keys(e).map((function(t){n[t]=e[t]})),this.ispotsInit){var r=i.find('xg-spot[data-id="'.concat(e.id,'"]'));r&&(this._updateDotDom(e,r),t&&this.showDot(e.id))}}},deleteDot:function(e){var t=this._ispots,i=this.player.plugins.progress;if(i){for(var n=[],r=0;r<t.length;r++)t[r].id===e&&n.push(r);for(var o=n.length-1;o>=0;o--)if(t.splice(n[o],1),this.ispotsInit){var a=i.find('xg-spot[data-id="'.concat(e,'"]'));a&&a.parentElement.removeChild(a)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this.ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),i=t.length-1;i>=0;i--)e.outer.removeChild(t[i]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.player.plugins.progress;if(i)if(this.ispotsInit){this._ispots=[];var n=i.root.getElementsByTagName("xg-spot"),r=n.length;if(r>t.length)for(var o=r-1;o>t.length-1;o--)i.outer.removeChild(n[o]);t.forEach((function(t,i){i<r?(n[i].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},positionDots:function(){var e=this,t=this._ispots,i=this.playerSize,n=this.player.sizeInfo,r=this.player.plugins.progress;r&&n.width!==i.width&&(i.width=n.width,i.left=n.left,t.forEach((function(t){var i=r.find('xg-spot[data-id="'.concat(t.id,'"]'));i&&e.positionDot(i,t.id)})))},positionDot:function(e,t){var i=qn.findDom(e,".xgplayer-spot-pop");if(i){var n=this.playerSize,r=e.getBoundingClientRect(),o=i.getBoundingClientRect(),a=r.left-n.left,s=n.width-a-r.width/2;if(a<o.width/2||n.width<o.width){var l=o.width/2-a;i.style.left="".concat(l,"px")}else if(s<o.width/2){var c=s-o.width/2+r.width/2;i.style.left="".concat(c,"px")}else i.style.left="50%"}},updateDuration:function(){var e=this,t=this.player.plugins.progress;t&&this._ispots.forEach((function(i){var n=t.find('xg-spot[data-id="'.concat(i.id,'"]'));e._updateDotDom(i,n)}))},getAllDotsDom:function(){var e=this.player.plugins.progress;return e?e.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(e){var t=this.player.plugins.progress;if(t)return t.find('xg-spot[data-id="'.concat(e,'"]'))}},il={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseOver"},nl=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),On(Rn(n=t.call(this,e)),"onMousemove",(function(e){n.config.disable||(qn.hasClass(e.target,"xg-spot-content")&&n.config.isHideThumbnailHover?n.player.plugins.progress.onMouseLeave(e):(n._state.f||qn.hasClass(e.target,"xg-spot-content"))&&(qn.event(e),e.stopPropagation()))})),On(Rn(n),"onMousedown",(function(e){n.config.disable||(n._state.f||qn.hasClass(e.target,"xg-spot-content"))&&(qn.event(e),e.stopPropagation())})),On(Rn(n),"onMouseup",(function(e){if(n.isDrag){var t=n.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),On(Rn(n),"onDotMouseLeave",(function(e){if(!n.config.disable){n._curDot.removeEventListener("mouseleave",n.onDotMouseLeave),n.blurDot(e.target),n._curDot=null;var t=n.player.plugins.progress;t&&t.enableBlur(),n.show()}})),On(Rn(n),"onProgressMouseOver",(function(e,t){if(!n.config.disable&&qn.hasClass(t.target,"xgplayer-spot")&&!n._curDot){n._curDot=t.target,n.focusDot(t.target),n._curDot.children.length>0&&n.hide();var i=n.player.plugins.progress;i&&i.disableBlur(),n._curDot.addEventListener("mouseleave",n.onDotMouseLeave)}})),n._ispots=[],n.videoPreview=null,n.videothumbnail=null,n.thumbnail=null,n.timeStr="",n._state={now:0,f:!1},n}return Pn(i,[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,i){i.seekTime&&e.player.seek(i.seekTime)})),this.transformTimeHook=this.hook("transformTime",(function(t){e.setTimeContent(qn.format(t))})),function(e){var t=e.config,i=e.player;Object.keys(tl).map((function(t){e[t]=tl[t].bind(e)}));var n=i.config.progressDot||t.ispots||[];e._ispots=n.map((function(e){return el(e),e})),e.ispotsInit=!1,e.playerSize={left:i.sizeInfo.left,width:i.sizeInfo.width},e.on(yr,(function(){e.ispotsInit?e.updateDuration():e.initDots()})),e.on(Gr,(function(){e.positionDots()}))}(this),this.on(yr,(function(){e.show()})),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(i){t.config[i]=e[i]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(il).map((function(i){e[il[i]]=e[il[i]].bind(e),t.addCallBack(i,e[il[i]])})),"mobile"!==ir.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var i=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),i(parseInt(1e3*e._state.now,10)/1e3,t)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&qn.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&qn.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){this.config.disable||qn.hasClass(t.target,"xgplayer-spot")&&(t.stopPropagation(),t.preventDefault(),["time","id","text"].map((function(i){e[i]=t.target.getAttribute("data-".concat(i))})),e.time&&(e.time=Number(e.time)),this.handlerSpotClick(t,e))}},{key:"updateLinePos",value:function(e,t){var i=this.root,n=this.previewLine,r=this.player,o=this.config,a="flex"===r.controls.mode,s=i.getBoundingClientRect().width;if(s||!this._hasThumnail){var l,c=e-(s=this._hasThumnail&&s<o.width?o.width:s)/2;c<0&&!a?(c=0,l=e-s/2):c>t-s&&!a?(l=c-(t-s),c=t-s):l=0,void 0!==l&&(n.style.transform="translateX(".concat(l.toFixed(2),"px)")),i.style.transform="translateX(".concat(c.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,i=this.timePoint;t.innerHTML=e,!this.thumbnail&&(i.innerHTML=e)}},{key:"updatePosition",value:function(e,t,i,n){var r=this.root,o=this.config,a=this._state;if(r){a.now=i,this.transformTimeHook(i);var s=this.timeStr;n&&n.target&&qn.hasClass(n.target,"xgplayer-spot")?(this.showTips(n.target.getAttribute("data-text"),!1,s),this.focusDot(n.target),a.f=!0,o.isFocusDots&&a.f&&(a.now=parseInt(n.target.getAttribute("data-time"),10))):o.defaultText?(a.f=!1,this.showTips(o.defaultText,!0,s)):(a.f=!1,this.hideTips("")),this.updateTimeText(s),this.updateThumbnails(a.now),this.updateLinePos(e,t)}}},{key:"setTimeContent",value:function(e){this.timeStr=e}},{key:"updateThumbnails",value:function(e){var t=this.player,i=this.videoPreview,n=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,n.width,n.height);var o=i&&i.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==ir.device){var t=this.player,i=this.config,n=t.getPlugin("thumbnail");if(n&&n.setConfig(e),n&&n.usable&&i.isShowThumbnail){qn.removeClass(this.root,"short-line no-thumbn
1ail"),"short"===i.mode&&qn.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=n.createThumbnail(r,"progress-thumbnail"),i.isShowCoverPreview&&(this.videoPreview=qn.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=n.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else qn.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var i=this.player.plugins.progress,n=this.player,r=i.root.getBoundingClientRect().width,o=n.duration/r*6;return e+t>n.duration&&(t=n.duration-e),n.duration,n.duration,{left:e/n.duration*100,width:t/n.duration*100,isMini:t<o}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var i=this.root.getBoundingClientRect().width,n=t.time/this.player.duration*i;this.updatePosition(n,i,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),qn.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(qn.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";qn.addClass(this.root,"no-timepoint"),e&&(qn.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(qn.addClass(this.root,"product"),this.tipText.textContent=e):(qn.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(i," ").concat(e)))}},{key:"hideTips",value:function(){qn.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",qn.removeClass(this.find(".xg-spot-content"),"show-text"),qn.removeClass(this.root,"product")}},{key:"hide",value:function(){qn.addClass(this.root,"hide")}},{key:"show",value:function(e){qn.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(il).map((function(i){t.removeCallBack(i,e[il[i]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===ir.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info hide '.concat("short"===this.config.mode?"short-line":"",'">\n <div class="xg-spot-content">\n <div class="xg-spot-thumbnail">\n <span class="xg-spot-time"></span>\n </div>\n <div class="xg-spot-text"><span class="spot-inner-text"></span></div>\n </div>\n <div class="xgplayer-progress-point">00:00</div>\n <div class="xg-spot-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),i}(Bo),rl=function(e){In(i,e);var t=Nn(i);function i(e){var n;return xn(this,i),(n=t.call(this,e)).ratio=1,n.interval=null,n._preloadMark={},n}return Pn(i,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([yr],(function(){var t=e.config,i=t.pic_num,n=t.interval;e.usable&&(e.interval=n>0?n:Math.round(1e3*e.player.duration/i)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var i=Object.keys(e);i.length<1||(i.forEach((function(i){t.config[i]=e[i]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,i=e.pic_num;return t&&t.length>0&&i>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,i=e.he
vendor: 7,166 bytes, line 1
1ight,n=e.pic_num,r=e.interval;this.ratio=t/i*100,this.interval=r||Math.round(this.player.duration/n),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var i=this.config.urls,n=i.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<n-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<n&&(t._preloadMark[e]=1,qn.preloadImg(i[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.config,r=n.pic_num,o=n.row,a=n.col,s=n.width,l=n.height;this.interval=Math.round(this.player.duration/r);var c=Math.ceil(e/this.interval),u=(c=c>r?r:c)<o*a?0:Math.ceil(c/(o*a))-1,h=c-u*(a*o),d=h>0?Math.ceil(h/a)-1:0,f=h>0?h-d*a-1:0,p=0,g=0;t&&i?t/i<s/l?p=(g=i)*(s/l):g=(p=t)/(s/l):i?t||(p=(g=i||l)*(s/l)):g=(p=t||s)/(s/l);var v=this.getUrlByIndex(u);return{urlIndex:u,rowIndex:d,colIndex:f,url:v,height:g,width:p,style:{backgroundImage:"url(".concat(v,")"),backgroundSize:"".concat(p*a,"px auto"),backgroundPosition:"-".concat(f*p,"px -").concat(d*g,"px"),width:"".concat(p,"px"),height:"".concat(g,"px")}}}},{key:"update",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,a=o.pic_num,s=o.urls;if(!(a<=0)&&s&&0!==s.length){var l=this.getPosition(t,i,n);this.preload(l.urlIndex),Object.keys(l.style).map((function(t){e.style[t]=l.style[t]})),Object.keys(r).map((function(t){e.style[t]=r[t]}))}}},{key:"changeConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var i=qn.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(i),i}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),i}(Bo);function ol(e){return e?"background:".concat(e,";"):""}var al=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"onTimeupdate",(function(){var t=e.player.ended,i=Rn(e).offsetDuration,n=e.currentTime;n=qn.adjustTimeByDuration(n,i,t),e.update({played:n},i)})),e}return Pn(i,[{key:"offsetDuration",get:function(){return this.playerConfig.customDuration||this.player.offsetDuration||this.player.duration}},{key:"currentTime",get:function(){var e=this.player,t=e.offsetCurrentTime,i=e.currentTime;return t>=0?t:i}},{key:"afterCreate",value:function(){var e=this;this.root&&(this.on(pr,this.onTimeupdate),this.on(Sr,(function(){e.reset()})))}},{key:"reset",value:function(){this.update({played:0,cached:0},0)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){var e=this.playerConfig,t=e.commonStyle;if(e.miniprogress){var i=this.config,n=i.mode,r=i.height,o={cached:ol(t.cachedColor),played:ol(t.playedColor),progress:ol(t.progressColor),height:r>0&&2!==r?"height: ".concat(r,"px;"):""};return'<xg-mini-progress class="xg-mini-progress '.concat("show"===n?"xg-mini-progress-show":"",'" style="').concat(o.progress," ").concat(o.height,'">\n <xg-mini-progress-cache class="xg-mini-progress-cache" style="').concat(o.cached,'"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played" style="').concat(o.played,'"></xg-mini-progress-played>\n </xg-mini-progress>')}}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{mode:"auto",height:2}}}]),i}(Bo),sl="realtime",ll="firstframe",cl="poster";function ul(){try{return parseInt(window.performance.now(),10)}catch(e){return(new Date).getTime()}}var hl=null,dl=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.stop(),e.renderOnTimeupdate(t),e.off(pr,e.renderOnTimeupdate),e.on(pr,e.renderOnTimeupdate))})),On(Rn(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),On(Rn(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(pr,e.renderOnTimeupdate);var i=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(0,i)}})),On(Rn(e),"start",(function(t,i){var n=e.player.video,r=ul(),o=e.checkVideoIsSupport(n);o&&e.canvasCtx&&(i||(i=e.interval),e.stop(),n.videoWidth&&n.videoHeight&&(e.videoPI=n.videoHeight>0?parseInt(n.videoWidth/n.videoHeight*100,10):0,(e.config.mode===sl||r-e.preTime>=i)&&(n&&n.videoWidth&&e.update(o,e.videoPI),e.preTime=r)),e.frameId="timer"===e._loopType?qn.setTimeout(Rn(e),e.start,i):qn.requestAnimationFrame(e.start))})),On(Rn(e),"stop",(function(){e.frameId&&("timer"===e._loopType?qn.clearTimeout(Rn(e),e.frameId):qn.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return Pn(i,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),i.isSupport||(this.config.disable=!0);var t=this.config,n=t.disable,r=t.mode,o=t.frameRate;n||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/o,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==sl&&this.interval>=1e3?"timer":"animation",this.once(Or,(function(){e.player&&(e.init(),e.renderByPoster(),e.player.paused||e.start())})),r!==cl&&(r!==ll&&(this.on(Sr,(function(){e.stop()})),this.on(sr,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(0,t)})),this.on(ur,(function(){e.stop()}))),this.on(_r,this.onLoadedData),this.on(wr,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange)))}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){"root"===i&&e[i]!==t.config[i]?t.reRender(e[i]):"frameRate"===i?t.interval=parseInt(1e3/e[i],10):"disable"===i&&e[i]&&t.stop(),t.config[i]=e[i]}))}},{key:"init",value:function(e){var t=this.player,n=this.config;this.canvasFilter=i.supportCanvasFilter();try{var r=e||n.root;r||(r=n.isInnerRender&&t.innerContainer||t.root),r.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(n.index,'"><canvas>\n </canvas><xgmask>
1</xgmask></div>')),this.root=r.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=n.filter,this.canvas.style.webkitFilter=n.filter),this.mask=this.find("xgmask"),n.addMask&&(this.mask.style.background=n.maskBg),this.canvasCtx=this.canvas.getContext("2d")}catch(e){Yn.logError("plugin:DynamicBg",e)}}},{key:"reRender",value:function(e){if(this.config.disable||this.root){this.stop();var t=this.root?this.root.parentElement:null;if(t!==e&&t.removeChild(this.root),e){this.init(e),this.renderOnce();var i=this.config.startInterval;this._checkIfCanStart()&&this.start(0,i)}else this.root=null}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==ir.browser||!qn.isMSE(t)))return t;var i=t?t.tagName.toLowerCase():"";return"canvas"===i||"img"===i?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===qn.typeOf(e)?e:"String"===qn.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==ll&&e!==cl}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var i=this.canvas.getBoundingClientRect(),n=i.width,r=i.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=n;var e=parseInt(n/r*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var i=this._pos,n=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,a=r.height;if(o!==i.width||a!==i.height||i.pi!==t){var s=parseInt(o/a*100,10);i.pi=t,i.width!==o&&(i.width=this.canvas.width=o),i.height!==a&&(i.height=this.canvas.height=a);var l=a,c=o;s<t?c=parseInt(a*t/100,10):s>t&&(l=parseInt(100*o/t,10)),i.rwidth=c*n.multiple,i.rheight=l*n.multiple,i.x=(o-i.rwidth)/2,i.y=(a-i.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=n.filter),this.canvasCtx.drawImage(e,i.x,i.y,i.rwidth,i.rheight)}catch(e){Yn.logError("plugin:DynamicBg",e)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:2,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof hl?hl:hl=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===ir.browser||"firefox"===ir.browser)}}]),i}(Bo),fl={LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"è§é¢ä¸è½½é误"},mse:{code:2,msg:"æµè¿½å é误"},parse:{code:3,msg:"è§£æé误"},format:{code:4,msg:"æ ¼å¼é误"},decoder:{code:5,msg:"è§£ç é误"},runtime:{code:6,msg:"è¯æ³é误"},timeout:{code:7,msg:"ææ¾è¶
æ¶"},other:{code:8,msg:"å
¶ä»é误"}},HAVE_NOTHING:"没æå
³äºé³é¢/è§é¢æ¯å¦å°±ç»ªçä¿¡æ¯",HAVE_METADATA:"é³é¢/è§é¢çå
æ°æ®å·²å°±ç»ª",HAVE_CURRENT_DATA:"å
³äºå½åææ¾ä½ç½®çæ°æ®æ¯å¯ç¨çï¼ä½æ²¡æè¶³å¤çæ°æ®æ¥ææ¾ä¸ä¸å¸§/毫ç§",HAVE_FUTURE_DATA:"å½ååè³å°ä¸ä¸å¸§çæ°æ®æ¯å¯ç¨ç",HAVE_ENOUGH_DATA:"å¯ç¨æ°æ®è¶³ä»¥å¼å§ææ¾",NETWORK_EMPTY:"é³é¢/è§é¢å°æªåå§å",NETWORK_IDLE:"é³é¢/è§é¢æ¯æ´»å¨çä¸å·²éåèµæºï¼ä½å¹¶æªä½¿ç¨ç½ç»",NETWORK_LOADING:"æµè§å¨æ£å¨ä¸è½½æ°æ®",NETWORK_NO_SOURCE:"æªæ¾å°é³é¢/è§é¢æ¥æº",MEDIA_ERR_ABORTED:"ååè¿ç¨è¢«ç¨æ·ä¸æ¢",MEDIA_ERR_NETWORK:"ç½ç»é误",MEDIA_ERR_DECODE:"è§£ç é误",MEDIA_ERR_SRC_NOT_SUPPORTED:"䏿¯æçé³é¢/è§é¢æ ¼å¼",REPLAY:"éæ",ERROR:"ç½ç»è¿æ¥ä¼¼ä¹åºç°äºé®é¢",PLAY_TIPS:"ææ¾",PAUSE_TIPS:"æå",PLAYNEXT_TIPS:"ä¸ä¸é",DOWNLOAD_TIPS:"ä¸è½½",ROTATE_TIPS:"æè½¬",RELOAD_TIPS:"éæ°è½½å
¥",FULLSCREEN_TIPS:"è¿å
¥å
¨å±",EXITFULLSCREEN_TIPS:"éåºå
¨å±",CSSFULLSCREEN_TIPS:"è¿å
¥æ ·å¼å
¨å±",EXITCSSFULLSCREEN_TIPS:"éåºæ ·å¼å
¨å±",TEXTTRACK:"åå¹",PIP:"ç»ä¸ç»",SCREENSHOT:"æªå¾",LIVE:"æ£å¨ç´æ",OFF:"å
³é",OPEN:"å¼å¯",MINI_DRAG:"ç¹å»æä½å¯æå¨è§é¢",MINISCREEN:"å°å±å¹",REFRESH_TIPS:"请è¯è¯",REFRESH:"å·æ°",FORWARD:"å¿«è¿ä¸",LIVE_TIP:"ç´æ"}},pl="info",gl=io,vl=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"_recordUserActions",(function(t){var i=e._getTime(),n=Object.assign({},t,{msg:t.msg||t.action});e._stats.info.push(En(En({type:"userAction"},i),{},{payload:n}))})),On(Rn(e),"_onReset",(function(){e.reset()})),On(Rn(e),"_recordInfo",(function(t){e.info(t)})),On(Rn(e),"_downloadStats",(function(){var t=e.getStats(),i=new Blob([JSON.stringify(t)],{type:"application/json"}),n=window.URL.createObjectURL(i),r=document.createElement("a");r.style.display="none",r.href=n,r.download="player.txt",r.disabled=!1,r.click()})),e}return Pn(i,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Jr,this._recordUserActions),this.on(gl.STATS_INFO,this._recordInfo),this.on(gl.STATS_DOWNLOAD,this._downloadStats),this.on(gl.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var t=this._getTime();this._stats.info.push(En(En({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=En({cat:"function",dur:Date.now()-e.startMs,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(t)}}},{key:"reset",value:function(){var e;this._stats=(On(e={},pl,[]),On(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.media,t=[],i=0;i<e.buffered.length;i++)t.push({start:e.buffered.start(i),end:e.buffered.end(i)});var n={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=n,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){return this._stats.info.map((function(e){var t=e.payload.data,i="";try{t instanceof Error?i=t.msg:void 0!==t&&(i=JSON.stringify(t))}catch(e){}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(i," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats.info.forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),i}(Eo),yl=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Rn(e),n=t.player,r=t.config;
vendor: 12,088 bytes, line 1
1if(n.media.readyState!==HTMLMediaElement.HAVE_NOTHING){if(n.media.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!n.media.paused||0===n.media.currentTime||!e.hasPlayed){var o=n.media.buffered,a=r.smallGapLimit||.5,s=r.gapDetectionThreshold||.3,l=n.media.currentTime,c=e._getIndex(o,l,s);if(null!==c&&0!==c){var u=o.start(c)+.1;if(!(u>n.media.duration)){var h=u-l,d=h<=a;h<i.BROWSER_GAP_TOLERANCE||d&&(!1!==r.useGapJump&&(n.media.currentTime=e.isSafari?u+.1:u),e.player&&e.player.emit("detectGap"),.08!==u&&n&&n.emit("log",{type:"oneevent",end_type:"gap",vid:n.config.vid,ext:{video_postion:Math.floor(1e3*u)}}))}}}}})),e}return Pn(i,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(gr,this.onGapJump),this.on(sr,(function(){e.hasPlayed=!0})),this.on(dr,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,i){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var n=this._getBuffered(e),r=null,o=0;o<n.length;o++)if(n[o].start>t&&(0===o||n[o-1].end-t<=i)){r=o;break}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),i}(Bo);yl.BROWSER_GAP_TOLERANCE=.001;var ml=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Rn(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),On(Rn(e),"onJump",(function(){var t=Rn(e),i=t.player,n=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>n.jumpCntMax||!1===n.useWaitingTimeoutJump||i.media.paused&&0!==i.media.currentTime&&e.hasPlayed)){e.jumpSize=n.jumpSize*(e.jumpCnt+1),e.jumpCnt===n.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=i.currentTime+e.jumpSize;r>i.media.duration||(e.jumpCnt++,i.currentTime=r)}})),e}return Pn(i,[{key:"afterCreate",value:function(){var e=this,t=this.config,i=t.useWaitingTimeoutJump,n=t.jumpSize;!1!==i&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=n,this.on(gr,this.onWaiting),this.on([lr,vr],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(sr,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),i}(Bo),_l="cdn",bl=["cdn"],kl=function(e){In(i,e);var t=Nn(i);function i(){var e;xn(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return On(Rn(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_l;if(!e.speedListCache||!e.speedListCache[t])return 0;if(e.speedListCache[t].length<=0)return 0;var i=0;return e.speedListCache[t].map((function(e){i+=e})),Math.floor(i/e.speedListCache[t].length)})),On(Rn(e),"startTimer",(function(){qn.isMSE(e.player.video)||(e.initSpeedList(),e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),On(Rn(e),"initSpeedList",(function(){e.speedListCache={},bl.forEach((function(t){e.speedListCache[t]=[]}))})),On(Rn(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||_l)})),On(Rn(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,i=t.url,n=t.loadSize,r=t.testCnt,o=t.testTimeStep,a=i+(i.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var s=(new Date).getTime(),l=null,c=new XMLHttpRequest;e.xhr=c,c.open("GET",a);var u={},h=Math.floor(10*Math.random());u.Range="bytes="+h+"-"+(n+h),u&&Object.keys(u).forEach((function(e){c.setRequestHeader(e,u[e])})),c.onreadystatechange=function(){if(4===c.readyState){e.xhr=null,l=(new Date).getTime();var t=c.getResponseHeader("Content-Length")/1024*8,i=Math.round(1e3*t/(l-s));e.appendList(i),e.timer=setTimeout(e.testSpeed,o)}},c.send()}catch(e){}}}})),On(Rn(e),"appendList",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_l;if(e.speedListCache&&e.speedListCache[i]){var n=e.config.saveSpeedMax;e.speedListCache[i].length>=n&&e.speedListCache[i].shift(),e.speedListCache[i].push(t);var r=Rn(e).player;r&&(i===_l?r.realTimeSpeed=t:r[e.getSpeedName("realTime",i)]=t),e.updateSpeed(i)}})),On(Rn(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_l,i=e.getSpeed(t),n=Rn(e).player;if(n)if(t===_l)n.avgSpeed&&i===n.avgSpeed||(n.avgSpeed=i,n.emit(Rr,{speed:i,realTimeSpeed:n.realTimeSpeed}));else{var r=e.getSpeedName("avg",t);n[r]&&i===n[r]||(n[r]=i,n.emit(Rr,{speed:i,realTimeSpeed:n.realTimeSpeed}))}})),e}return Pn(i,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,i=e.addSpeedTypeList;(null==i?void 0:i.length)>0&&bl.push.apply(bl,jn(i)),this.initSpeedList(),this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,t&&this.on([_r,Ir],this.startTimer)}},{key:"getSpeedName",value:function(e,t){return e+"Speed"+t.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([_r,Ir],this.startTimer),bl.forEach((function(t){e.speedListCache&&e.speedListCache[t]&&(e.speedListCache[t]=[])})),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),i}(Bo),wl=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i,[{key:"afterCreate",value:function(){var e=this,t=this.player,i=this.config,n=t.media||t.video;this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],i.disabled||n.getVideoPlaybackQuality&&(this.on(sr,(function(){e._startTick()})),this.on(ur,(function(){e._stopTick()})),this.on(cr,(function(){e._stopTick()})),this.on(Sr,(function(){e._stopTick()})))}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout((function(){e._checkDecodeFPS(),e._startTick()}),this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(e,t){for(var i=!1,n=[],r=0;r<t.length;r++){var o=t.start(r),a=t.end(r);if(n.push({start:o,end:a}),o<=e&&e<=a-1){i=!0;break}}return{enoughBuffer:i,buffers:n}}},{key:"_checkStuck",value:function(e,t,i,n){var r=this.player.media||this.player.video,o=document.hidden,a=r.paused,s=r.readyState,l=r.currentTime,c=r.buffered;if(!(o||a||s<4)){var u=this._checkBuffer(l,c),h=u.enoughBuffer,d=u.buffers;h&&(e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:l,buffers:d,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:i,checkInterval:n}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(no,this._payload),this._reset())):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){var e=this.player.media||this.player.video;if(e){var t=e.getVideoPlaybackQuality(),i=t.totalVideoFrames,n=t.droppedVideoFrames,r=performance.now();if(i&&this._lastCheckPoint){var o=i-this._lastDecodedFrames,a=r-this._lastCheckPoint;this._checkStuck(o,i,n,a)}this._lastDecodedFrames=i,this._lastCheckPoint=r}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),i}(Bo);$o.use(fl);var Sl=Pn((function e(t,i){var n,r,o;xn(this,e);var a=i&&"mobile"===i.isMobileSimulateMode,s=i.isLive,l=[].concat(s?[]:[ms,cs,al,nl,ys],[hs,vs,Ts,Ls,Ks,Ys,Ns,Bs,ws,Os]),c=[ga,va,ka,os,wa,Js,Zs,rl,Ma];this.plugins=[vl,fa].concat(jn(l),c,[yl,ml]);var u=a?"mobile":ir.device;switch(u){case"pc":(n=this.plugins).push.apply(n,[ns,Ua,Xs,kl,wl]);break;case"mobile":(r=this.plugins).push.apply(r,[ts]);break;default:(o=this.plugins).push.apply(o,[ns,Ua,Xs])}(ir.os.isIpad||"pc"===u)&&this.plugins.push(dl),ir.os.isIpad&&this.plugins.push(Ua),this.ignores=[],this.i18n=[]})),Tl=function(e){In(i,e);var t=Nn(i);function i(){return xn(this,i),t.apply(this,arguments)}return Pn(i)}(ra);On(Tl,"defaultPreset",Sl),On(Tl,"Util",qn),On(Tl,"Sniffer",ir),On(Tl,"Errors",ar),On(Tl,"Events",ro),On(Tl,"Plugin",Bo),On(Tl,"BasePlugin",Eo),On(Tl,"I18N",$o),On(Tl,"STATE_CLASS",Fo),On(Tl,"InstManager",Qo);var El={LANG:"zh-hk",TEXT:{ERROR_TYPES:{network:{code:1,msg:"è¦é »ä¸è¼é¯èª¤"},mse:{code:2,msg:"å追å é¯èª¤"},parse:{code:3,msg:"è§£æé¯èª¤"},format:{code:4,msg:"æ ¼å¼é¯èª¤"},decoder:{code:5,msg:"解碼é¯èª¤"},runtime:{code:6,msg:"èªæ³é¯èª¤"},timeout:{code:7,msg:"ææ¾è¶
æ"},other:{code:8,msg:"å
¶ä»é¯èª¤"}},HAVE_NOTHING:"æ²æéæ¼é³é »/è¦é »æ¯å¦å°±ç·çä¿¡æ¯",HAVE_METADATA:"é³é »/è¦é »çå
æ¸æå·²å°±ç·",HAVE_CURRENT_DATA:"éæ¼ç¶åææ¾ä½ç½®çæ¸ææ¯å¯ç¨çï¼ä½æ²æè¶³å¤ çæ¸æä¾ææ¾ä¸å£¹å¹/毫ç§",HAVE_FUTURE_DATA:"ç¶ååè³å°ä¸å£¹å¹çæ¸ææ¯å¯ç¨ç",HAVE_ENOUGH_DATA:"å¯ç¨æ¸æè¶³ä»¥éå§ææ¾",NETWORK_EMPTY:"é³é »/è¦é »å°æªåå§å",NETWORK_IDLE:"é³é »/è¦é »æ¯æ´»åçä¸å·²é¸åè³æºï¼ä½ä¸¦æªä½¿ç¨ç¶²çµ¡",NETWORK_LOADING:"çè¦½å¨æ£å¨ä¸è¼æ¸æ",NETWORK_NO_SOURCE:"æªæ¾å°é³é »/è¦é »ä¾æº",MEDIA_ERR_ABORTED:"ååéç¨è¢«ç¨æ¶ä¸æ¢",MEDIA_ERR_NETWORK:"ä¸è¼é¯èª¤",MEDIA_ERR_DECODE:"解碼é¯èª¤",MEDIA_ERR_SRC_NOT_SUPPORTED:"䏿¯æçé³é »/è¦é »æ ¼å¼",REPLAY:"éæ",ERROR:"ç¶²çµ¡é£æ¥ä¼¼ä¹åºç¾äºåé¡",PLAY_TIPS:"ææ¾",PAUSE_TIPS:"æ«å",PLAYNEXT_TIPS:"ä¸å£¹é",DOWNLOAD_TIPS:"ä¸è¼",ROTATE_TIPS:"æè½",RELOAD_TIPS:"éæ°è¼å
¥",FULLSCREEN_TIPS:"é²å
¥å
¨å±",EXITFULLSCREEN_TIPS:"éåºå
¨å±",CSSFULLSCREEN_TIPS:"é²å
¥æ¨£å¼å
¨å±",EXITCSSFULLSCREEN_TIPS:"éåºæ¨£å¼å
¨å±",TEXTTRACK:"åå¹",PIP:"ç«ä¸ç«",SCREENSHOT:"æªå",LIVE:"æ£å¨ç´æ",OFF:"éé",OPEN:"éå",MINI_DRAG:"黿æä½å¯æåè¦é »",MINISCREEN:"å°å±å¹",REFRESH_TIPS:"è«è©¦è©¦",REFRESH:"å·æ°",FORWARD:"å¿«è¿ä¸",LIVE_TIP:"ç´æ"}},Cl={LANG:"jp",TEXT:{ERROR_TYPES:{network:{code:1,msg:"ãããªãã¦ã³ãã¼ãã¨ã©ã¼"},mse:{code:2,msg:"ã¹ããªã¼ã 追å ã¨ã©ã¼"},parse:{code:3,msg:"è§£æã¨ã©ã¼"},format:{code:4,msg:"ééã£ããã©ã¼ããã"},decoder:{code:5,msg:"ãã³ã¼ãã¨ã©ã¼"},runtime:{code:6,msg:"ææ³ã¨ã©ã¼"},timeout:{code:7,msg:"åçã¿ã¤ã ã¢ã¦ã"},other:{code:8,msg:"ãã®ä»ã®ã¨ã©ã¼"}},HAVE_NOTHING:"ãªã¼ãã£ãª/ãããªãæºåã§ãã¦ãããæ
å ±ãããã¾ãã",HAVE_METADATA:"ãªã¼ãã£ãª/ãããªã®ã¡ã¿ãã¼ã¿ã¯æºåã§ãã¦ãã¾ã",HAVE_CURRENT_DATA:"ç¾å¨ã®åçä½ç½®ã«é¢ãããã¼ã¿ã¯å©ç¨å¯è½ã§ãããæ¬¡ã®ãã¬ã¼ã /ããªç§ãåçããã®ã«ååãªãã¼ã¿ãããã¾ãã",HAVE_FUTURE_DATA:"ç¾å¨ãå°ãªãã¨ã次ã®ãã¬ã¼ã ã®ãã¼ã¿ãå©ç¨å¯è½ã§ã",HAVE_ENOUGH_DATA:"å©ç¨å¯è½ãªãã¼ã¿ã¯åçãéå§ããã®ã«ååã§ã",NETWORK_EMPTY:"ãªã¼ãã£ãª/ãããªãåæåãã
1ã¦ãã¾ãã",NETWORK_IDLE:"ãªã¼ãã£ãª/ãããªã¯ã¢ã¯ãã£ãã§ãªã½ã¼ã¹ã鏿ããã¦ãã¾ããããããã¯ã¼ã¯ã使ç¨ããã¦ãã¾ãã",NETWORK_LOADING:"ãã©ã¦ã¶ã¼ã¯ãã¼ã¿ããã¦ã³ãã¼ããã¦ãã¾ã",NETWORK_NO_SOURCE:"ãªã¼ãã£ãª/ãã㪠ã®ã½ã¼ã¹ãè¦ã¤ããã¾ãã",MEDIA_ERR_ABORTED:"ã¦ã¼ã¶ã¼ã«ãã£ã¦ãã§ããããã»ã¹ã䏿¢ããã¾ãã",MEDIA_ERR_NETWORK:"ãã¦ã³ãã¼ãä¸ã«ã¨ã©ã¼ãçºçãã¾ãã",MEDIA_ERR_DECODE:"ãã³ã¼ãä¸ã«ã¨ã©ã¼ãçºçãã¾ãã",MEDIA_ERR_SRC_NOT_SUPPORTED:"ãªã¼ãã£ãª/ãã㪠ã®å½¢å¼ããµãã¼ãããã¦ãã¾ãã",REPLAY:"ãªãã¬ã¤",ERROR:"ãããã¯ã¼ã¯ã®æ¥ç¶ã«åé¡ãçºçãã¾ãã",PLAY_TIPS:"ãã¬ã¤",PAUSE_TIPS:"䏿忢",PLAYNEXT_TIPS:"次ããã¬ã¤",DOWNLOAD_TIPS:"ãã¦ã³ãã¼ã",ROTATE_TIPS:"å転",RELOAD_TIPS:"åèªã¿è¾¼ã¿",FULLSCREEN_TIPS:"ãã«ã¹ã¯ãªã¼ã³",EXITFULLSCREEN_TIPS:"ãã«ã¹ã¯ãªã¼ã³ãçµäº",CSSFULLSCREEN_TIPS:"ã·ã¢ã¿ã¼ã¢ã¼ã",EXITCSSFULLSCREEN_TIPS:"ã·ã¢ã¿ã¼ã¢ã¼ããçµäº",TEXTTRACK:"åå¹",PIP:"ãããã¬ã¼ã¤ã¼",SCREENSHOT:"ã¹ã¯ãªã¼ã³ã·ã§ãã",LIVE:"çæ¾é",OFF:"ãªã",OPEN:"éãã",MINI_DRAG:"ãã¿ã³ãæ¼ãã¦åç»ããã©ãã°ãã",MINISCREEN:"å°ããªç»é¢",REFRESH:"ãªãã¬ãã·ã¥",REFRESH_TIPS:"ãã¦ã¿ã¦ãã ãã",FORWARD:"æ©éã",LIVE_TIP:"çæ¾é"}},xl={origin:{index:1,next:"uhd",prev:null},uhd:{index:2,next:"hd",prev:"origin"},hd:{index:3,next:"sd",prev:"uhd"},sd:{index:4,next:"ld",prev:"hd"},ld:{index:5,next:"ao",prev:"sd"},ao:{index:6,next:null,prev:"ld"}},Dl=["zh","en","jp","zh-hk"],Pl={NORMAL:0,INNER:1,FULLSCREEN:2},Ol=function(e){return e[e.VALID=10]="VALID",e[e.TRANSCODING=30]="TRANSCODING",e[e.NO_SET_AUDIT=1e3]="NO_SET_AUDIT",e[e.OFFLINE=1002]="OFFLINE",e[e.NO_AUTH=2001]="NO_AUTH",e[e.UN_AUTH=2002]="UN_AUTH",e}(Ol||{}),Il=5e9,Ll={jp:"ãã£ã³ã»ã«",en:"Cancel",zh:"åæ¶","zh-hk":"åæ¶"},Al=function(e){return e.WIDEVINE="widevine",e.FAIRPLAY="fairplay",e.PLAYREADY="playready",e}(Al||{}),Rl="undefined"!=typeof window&&window.location&&window.location.href.indexOf("veplayerdebugger=1")>-1,Ml={info:"color: #fff; background-color: #5f5f5f;",error:"color: #fff; background-color: #f53f3f;",warn:"color: #fff; background-color: #ff7d00;"},Nl="color: #fff; background: #4281ff",Bl="%c VePlayer %c ".concat("1.9.6"," "),Ul={config:{debug:Rl?3:1},log:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[Bl,Ml.info,Nl,e].concat(n))},warn:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[Bl,Ml.warn,Nl,e].concat(n))},error:function(e){var t;if(!(this.config.debug<1)){for(var i=this.config.debug>=2?"trace":"error",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(t=console)[i].apply(t,[Bl,Ml.error,Nl,e].concat(r))}}};localStorage.getItem("velog")&&(Ul.config.debug=3);var jl={exports:{}};!function(e,t){e.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",o="minute",a="hour",s="day",c="week",u="month",h="quarter",d="year",f="date",p="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},m=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},_={s:m,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+m(n,2,"0")+":"+m(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,u),o=i-r<0,a=t.clone().add(n+(o?-1:1),u);return+(-(n+(i-r)/(o?r-a:a-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:d,w:c,d:s,D:f,h:a,m:o,s:r,ms:n,Q:h}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",k={};k[b]=y;var w=function(e){return e instanceof C},S=function e(t,i,n){var r;if(!t)return b;if("string"==typeof t){var o=t.toLowerCase();k[o]&&(r=o),i&&(k[o]=i,r=o);var a=t.split("-");if(!r&&a.length>1)return e(a[0])}else{var s=t.name;k[s]=t,r=s}return!n&&r&&(b=r),r||!n&&b},T=function(e,t){if(w(e))return e.clone();var i="object"==l(t)?t:{};return i.date=e,i.args=arguments,new C(i)},E=_;E.l=S,E.i=w,E.w=function(e,t){return T(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function l(e){this.$L=S(e.locale,null,!0),this.parse(e)}var y=l.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(g);if(n){var r=n[2]-1||0,o=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return E},y.isValid=function(){return!(this.$d.toString()===p)},y.isSame=function(e,t){var i=T(e);return this.startOf(t)<=i&&i<=this.endOf(t)},y.isAfter=function(e,t){return T(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<T(e)},y.$g=function(e,t,i){return E.u(e)?this[t]:this.set(i,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var i=this,n=!!E.u(t)||t,l=E.p(e),h=function(e,t){var r=E.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(s)},p=function(e,t){return E.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},g=this.$W,v=this.$M,y=this.$D,m="set"+(this.$u?"UTC":"");switch(l){case d:return n?h(1,0):h(31,11);case u:return n?h(1,v):h(0,v+1);case c:var _=this.$locale().weekStart||0,b=(g<_?g+7:g)-_;return h(n?y-b:y+(6-b),v);case s:case f:return p(m+"Hours",0);case a:return p(m+"Minutes",1);case o:return p(m+"Seconds",2);case r:return p(m+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var i,l=E.p(e),c="set"+(this.$u?"UTC":""),h=(i={},i[s]=c+"Date",i[f]=c+"Date",i[u]=c+"Month",i[d]=c+"FullYear",i[a]=c+"Hours",i[o]=c+"Minutes",i[r]=c+"Seconds",i[n]=c+"Milliseconds",i)[l],p=l===s?this.$D+(t-this.$W):t;if(l===u||l===d){var g=this.clone().set(f,1);g.$d[h](p),g.init(),this.$d=g.set(f,Math.min(this.$D,g.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[E.p(e)]()},y.add=function(n,l){var h,f=this;n=Number(n);var p=E.p(l),g=function(e){var t=T(f);return E.w(t.date(t.date()+Math.round(e*n)),f)};if(p===u)return this.set(u,this.$M+n);if(p===d)return this.set(d,this.$y+n);if(p===s)return g(1);if(p===c)return g(7);var v=(h={},h[o]=t,h[a]=i,h[r]=e,h)[p]||1,y=this.$d.getTime()+n*v;return E.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||p;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=E.z(this),o=this.$H,a=this.$m,s=this.$M,l=i.weekdays,c=i.months,u=function(e,i,r,o){return e&&(e[i]||e(t,n))||r[i].slice(0,o)},h=function(e){return E.s(o%12||12,e,"0")},d=i.meridiem||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n},f={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:E.s(s+1,2,"0"),MMM:u(i.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:E.s(this.$D,2,"0"),d:String(this.$W),dd:u(i.weekdaysMin,this.$W,l,2),ddd:u(i.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:E.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,a,!0),A:d(o,a,!1),m:String(a),mm:E.s(a,2,"0"),s:String(this.$s),ss:E.s(this.$s,2,"0"),SSS:E.s(this.$ms,3,"0"),Z:r};return n.replace(v,(function(e,t){return t||f[e]||r.replace(":","")}))}
vendor: 3,105 bytes, line 1
1,y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,l,f){var p,g=E.p(l),v=T(n),y=(v.utcOffset()-this.utcOffset())*t,m=this-v,_=E.m(this,v);return _=(p={},p[d]=_/12,p[u]=_,p[h]=_/3,p[c]=(m-y)/6048e5,p[s]=(m-y)/864e5,p[a]=m/i,p[o]=m/t,p[r]=m/e,p)[g]||m,f?_:E.a(_)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return k[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=S(e,t,!0);return n&&(i.$L=n),i},y.clone=function(){return E.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},l}(),x=C.prototype;return T.prototype=x,[["$ms",n],["$s",r],["$m",o],["$H",a],["$W",s],["$M",u],["$y",d],["$D",f]].forEach((function(e){x[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),T.extend=function(e,t){return e.$i||(e(t,C,T),e.$i=!0),T},T.locale=S,T.isDayjs=w,T.unix=function(e){return T(1e3*e)},T.en=k[b],T.Ls=k,T.p={},T}()}(jl);var Hl=jl.exports,Fl={exports:{}};!function(e,t){var i,n,r;e.exports=(i="minute",n=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g,function(e,t,o){var a=t.prototype;o.utc=function(e){return new t({date:e,utc:!0,args:arguments})},a.utc=function(e){var t=o(this.toDate(),{locale:this.$L,utc:!0});return e?t.add(this.utcOffset(),i):t},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var c=a.utcOffset;a.utcOffset=function(e,t){var o=this.$utils().u;if(o(e))return this.$u?0:o(this.$offset)?c.call(this):this.$offset;if("string"==typeof e&&null===(e=function(e){void 0===e&&(e="");var t=e.match(n);if(!t)return null;var i=(""+t[0]).match(r)||["-",0,0],o=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===o?a:-a}(e)))return this;var a=Math.abs(e)<=16?60*e:e,s=this;if(t)return s.$offset=a,s.$u=0===e,s;if(0!==e){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,i)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var u=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var d=a.diff;a.diff=function(e,t,i){if(e&&this.$u===e.$u)return d.call(this,e,t,i);
vendor: 10,956 bytes, line 1
1var n=this.local(),r=o(e).local();return d.call(n,r,t,i)}})}(Fl);var Vl=Fl.exports,zl=function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==l(e)&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=22)}([function(e,t,i){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,i){var n=i(12)("wks"),r=i(13),o=i(0).Symbol,a="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=a&&o[e]||(a?o:r)("Symbol."+e))}).store=n},function(e,t,i){var n=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},function(e,t,i){var n=i(4);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,i){var n="function"==typeof Symbol&&"symbol"==l(Symbol.iterator)?function(e){return l(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":l(e)};e.exports=function(e){return"object"===(void 0===e?"undefined":n(e))?null!==e:"function"==typeof e}},function(e,t,i){var n=i(6);e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,r){return e.call(t,i,n,r)}}return function(){return e.apply(t,arguments)}}},function(e,t,i){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,i){e.exports=!i(15)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,i){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,i){var n=i(3),r=i(26),o=i(27),a=Object.defineProperty;t.f=i(7)?Object.defineProperty:function(e,t,i){if(n(e),t=o(t,!0),n(i),r)try{return a(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},function(e,t,i){e.exports=!1},function(e,t,i){var n=i(8),r=i(1)("toStringTag"),o="Arguments"==n(function(){return arguments}());e.exports=function(e){var t,i,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),r))?i:o?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,i){var n=i(2),r=i(0),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:i(10)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,i){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,i){var n=i(9),r=i(28);e.exports=i(7)?function(e,t,i){return n.f(e,t,r(1,i))}:function(e,t,i){return e[t]=i,e}},function(e,t,i){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,i){var n=i(4),r=i(0).document,o=n(r)&&n(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},function(e,t,i){var n=i(0),r=i(14),o=i(18),a=i(13)("src"),s=i(29),l=(""+s).split("toString");i(2).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,i,s){var c="function"==typeof i;c&&(o(i,"name")||r(i,"name",t)),e[t]!==i&&(c&&(o(i,a)||r(i,a,e[t]?""+e[t]:l.join(String(t)))),e===n?e[t]=i:s?e[t]?e[t]=i:r(e,t,i):(delete e[t],r(e,t,i)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,i){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,i){e.exports={}},function(e,t,i){var n,r,o,a=i(5),s=i(38),l=i(39),c=i(16),u=i(0),h=u.process,d=u.setImmediate,f=u.clearImmediate,p=u.MessageChannel,g=u.Dispatch,v=0,y={},m=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},_=function(e){m.call(e.data)};d&&f||(d=function(e){for(var t=[],i=1;arguments.length>i;)t.push(arguments[i++]);return y[++v]=function(){s("function"==typeof e?e:Function(e),t)},n(v),v},f=function(e){delete y[e]},"process"==i(8)(h)?n=function(e){h.nextTick(a(m,e,1))}:g&&g.now?n=function(e){g.now(a(m,e,1))}:p?(o=(r=new p).port2,r.port1.onmessage=_,n=a(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(n=function(e){u.postMessage(e+"","*")},u.addEventListener("message",_,!1)):n="onreadystatechange"in c("script")?function(e){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),m.call(e)}}:function(e){setTimeout(a(m,e,1),0)}),e.exports={set:d,clear:f}},function(e,t,i){var n=i(6);function r(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=n})),this.resolve=n(t),this.reject=n(i)}e.exports.f=function(e){return new r(e)}},function(e,t,i){e.exports=i(23)},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),i(24);var n,r=(n=i(48))&&n.__esModule?n:{default:n};t.default={url:r.default},e.exports=t.default},function(e,t,i){var n,r,o,a,s=i(10),l=i(0),c=i(5),u=i(11),h=i(25),d=i(4),f=i(6),p=i(30),g=i(31),v=i(37),y=i(20).set,m=i(40)(),_=i(21),b=i(41),k=i(42),w=i(43),S=l.TypeError,T=l.process,E=T&&T.versions,C=E&&E.v8||"",x=l.Promise,D="process"==u(T),P=function(){},O=r=_.f,I=!!function(){try{var e=x.resolve(1),t=(e.constructor={})[i(1)("species")]=function(e){e(P,P)};return(D||"function"==typeof PromiseRejectionEvent)&&e.then(P)instanceof t&&0!==C.indexOf("6.6")&&-1===k.indexOf("Chrome/66")}catch(e){}}(),L=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},A=function(e,t){if(!e._n){e._n=!0;var i=e._c;m((function(){for(var n=e._v,r=1==e._s,o=0,a=function(t){var i,o,a,s=r?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(r||(2==e._h&&N(e),e._h=1),!0===s?i=n:(u&&u.enter(),i=s(n),u&&(u.exit(),a=!0)),i===t.promise?c(S("Promise-chain cycle")):(o=L(i))?o.call(i,l,c):l(i)):c(n)}catch(e){u&&!a&&u.exit(),c(e)}};i.length>o;)a(i[o++]);e._c=[],e._n=!1,t&&!e._h&&R(e)}))}},R=function(e){y.call(l,(function(){var t,i,n,r=e._v,o=M(e);if(o&&(t=b((function(){D?T.emit("unhandledRejection",r,e):(i=l.onunhandledrejection)?i({promise:e,reason:r}):(n=l.console)&&n.error&&n.error("Unhandled promise rejection",r)})),e._h=D||M(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},M=function(e){return 1!==e._h&&0===(e._a||e._c).length},N=function(e){y.call(l,(function(){var t;D?T.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},B=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),A(t,!0))},U=function e(t){var i,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw S("Promise can't be resolved itself");(i=L(t))?m((function(){var r={_w:n,_d:!1};try{i.call(t,c(e,r,1),c(B,r,1))}catch(e){B.call(r,e)}})):(n._v=t,n._s=1,A(n,!1))}catch(e){B.call({_w:n,_d:!1},e)}}};I||(x=function(e){p(this,x,"Promise","_h"),f(e),n.call(this);try{e(c(U,this,1),c(B,this,1))}catch(e){B.call(this,e)}},(n=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=i(44)(x.prototype,{then:function(e,t){var i=O(v(this,x));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=D?T.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&A(this,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n;this.promise=e,this.resolve=c(U,e,1),this.reject=c(B,e,1)},_.f=O=function(e){return e===x||e===a?new o(e):r(e)}),h(h.G+h.W+h.F*!I,{Promise:x}),i(45)(x,"Promise"),i(46)("Promise"),a=i(2).Promise,h(h.S+h.F*!I,"Promise",{reject:function(e){var t=O(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(s||!I),"Promise",{resolve:function(e){return w(s&&this===a?x:this,e)}}),h(h.S+h.F*!(I&&i(47)((function(e){x.all(e).catch(P)}))),"Promise",{all:function(e){var t=this,i=O(t),n=i.resolve,r=i.reject,o=b((function(){var i=[],o=0,a=1;g(e,!1,(function(e){var s=o++,l=!1;i.push(void 0),a++,t.resolve(e).then((function(e){l||(l=!0,i[s]=e,--a||n(i))}),r)})),--a||n(i)}));return o.e&&r(o.v),i.promise},race:function(e){var t=this,i=O(t),n=i.reject,r=b((function(){g(e,!1,(function(e){t.resolve(e).then(i.resolve,n)}))}));return r.e&&n(r.v),i.promise}})},function(e,t,i){var n=i(0),r=i(2),o=i(14),a=i(17),s=i(5),l=function e(t,i,l){var c,u,h,d,f=t&e.F,p=t&e.G,g=t&e.P,v=t&e.B,y=p?n:t&e.S?n[i]||(n[i]={}):(n[i]||{}).prototype,m=p?r:r[i]||(r[i]={}),_=m.prototype||(m.prototype={});for(c in p&&(l=i),l)h=((u=!f&&y&&void 0!==y[c])?y:l)[c],d=v&&u?s(h,n):g&&"function"==typeof h?s(Function.call,h):h,y&&a(y,c,h,t&e.U),m[c]!=h&&o(m,c,d),g&&_[c]!=h&&(_[c]=h)};n.core=r,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,i){e.exports=!i(7)&&!i(15)((function(){return 7!=Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,i){var n=i(4);e.exports=function(e,t){if(!n(e))return e;var i,r;if(t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;if("function"==typeof(i=e.valueOf)&&!n(r=i.call(e)))return r;if(!t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t,i){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,i){e.exports=i(12)("native-function-to-string",Function.toString)},function(e,t,i){e.exports=function(e,t,i,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(i+": incorrect invocation!");return e}},function(e,t,i){var n=i(5),r=i(32),o=i(33),a=i(3),s=i(34),l=i(36),c={},u={},h=e.exports=function(e,t,i,h,d){var f,p,g,v,y=d?function(){return e}:l(e),m=n(i,h,t?2:1),_=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(o(y)){for(f=s(e.length);f>_;_++)if((v=t?m(a(p=e[_])[0],p[1]):m(e[_]))===c||v===u)return v}else for(g=y.call(e);!(p=g.next()).done;)if((v=r(g,m,p.value,t))===c||v===u)return v};h.BREAK=c,h.RETURN=u},function(e,t,i){var n=i(3);e.exports=function(e,t,i,r){try{return r?t(n(i)[0],i[1]):t(i)}catch(t){var o=e.return;throw void 0!==o&&n(o.call(e)),t}}},function(e,t,i){var n=i(19),r=i(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||o[r]===e)}}
1,function(e,t,i){var n=i(35),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},function(e,t,i){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,i){var n=i(11),r=i(1)("iterator"),o=i(19);e.exports=i(2).getIteratorMethod=function(e){if(null!=e)return e[r]||e["@@iterator"]||o[n(e)]}},function(e,t,i){var n=i(3),r=i(6),o=i(1)("species");e.exports=function(e,t){var i,a=n(e).constructor;return void 0===a||null==(i=n(a)[o])?t:r(i)}},function(e,t,i){e.exports=function(e,t,i){var n=void 0===i;switch(t.length){case 0:return n?e():e.call(i);case 1:return n?e(t[0]):e.call(i,t[0]);case 2:return n?e(t[0],t[1]):e.call(i,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(i,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(i,t[0],t[1],t[2],t[3])}return e.apply(i,t)}},function(e,t,i){var n=i(0).document;e.exports=n&&n.documentElement},function(e,t,i){var n=i(0),r=i(20).set,o=n.MutationObserver||n.WebKitMutationObserver,a=n.process,s=n.Promise,l="process"==i(8)(a);e.exports=function(){var e,t,i,c=function(){var n,r;for(l&&(n=a.domain)&&n.exit();e;){r=e.fn,e=e.next;try{r()}catch(n){throw e?i():t=void 0,n}}t=void 0,n&&n.enter()};if(l)i=function(){a.nextTick(c)};else if(!o||n.navigator&&n.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);i=function(){u.then(c)}}else i=function(){r.call(n,c)};else{var h=!0,d=document.createTextNode("");new o(c).observe(d,{characterData:!0}),i=function(){d.data=h=!h}}return function(n){var r={fn:n,next:void 0};t&&(t.next=r),e||(e=r,i()),t=r}}},function(e,t,i){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,i){var n=i(0).navigator;e.exports=n&&n.userAgent||""},function(e,t,i){var n=i(3),r=i(4),o=i(21);e.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var i=o.f(e);return(0,i.resolve)(t),i.promise}},function(e,t,i){var n=i(17);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},function(e,t,i){var n=i(9).f,r=i(18),o=i(1)("toStringTag");e.exports=function(e,t,i){e&&!r(e=i?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},function(e,t,i){var n=i(0),r=i(9),o=i(7),a=i(1)("species");e.exports=function(e){var t=n[e];o&&t&&!t[a]&&r.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,i){var n=i(1)("iterator"),r=!1;try{var o=[7][n]();o.return=function(){r=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var o=[7],a=o[n]();a.next=function(){return{done:i=!0}},o[n]=function(){return a},e(o)}catch(e){}return i}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==l(Symbol.iterator)?function(e){return l(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":l(e)};t.default=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e||!t)return Promise.reject("vid, host and token can't be empty");var s=void 0;try{s=(0,o.getUri)(e,t,i,r)}catch(e){return Promise.reject(e.message)}var l=new a.default({type:"json",method:"GET",url:s}).then((function(e){var t=void 0;if(e&&e.response)switch(n(e.response)){case"string":t=JSON.parse(e.response).Result;break;case"object":t=e.response.Result;break;default:t=e.response}else t=e;return t}));return l};var r,o=i(49),a=(r=i(51))&&r.__esModule?r:{default:r};e.exports=t.default},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.getUri=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments[3];try{e=JSON.parse((0,n.decode)(e))}catch(e){throw new Error("base64 decode error: "+e.message)}return!1===a.jointSsl||r(i,"ssl")||r(i,"Ssl")||(i.Ssl=1),(/^http/.test(t)?t:"//"+t)+"?"+e.GetPlayInfoToken+o(i)};var n=i(50),r=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function o(e){var t=[];for(var i in e)r(e,i)&&t.push(i+"="+e[i]);return t.length>0?"&"+t.join("&"):""}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){var t=void 0,i=void 0,n=void 0,r=void 0,o=void 0,a=void 0,s=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],l=e.length;for(o=0,a="";o<l;){do{t=s[255&e.charCodeAt(o++)]}while(o<l&&-1===t);if(-1===t)break;
1do{i=s[255&e.charCodeAt(o++)]}while(o<l&&-1===i);if(-1===i)break;a+=String.fromCharCode(t<<2|(48&i)>>4);do{if(61==(n=255&e.charCodeAt(o++)))return a;n=s[n]}while(o<l&&-1===n);if(-1===n)break;a+=String.fromCharCode((15&i)<<4|(60&n)>>2);do{if(61==(r=255&e.charCodeAt(o++)))return a;r=s[r]}while(o<l&&-1===r);if(-1===r)break;a+=String.fromCharCode((3&n)<<6|r)}return a}},function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e);var i=t.url,r=t.method,o=void 0===r?"GET":r,a=t.data,s=void 0===a?{}:a,l=t.headers,c=void 0===l?{}:l;return new Promise((function(e,t){var n=new window.XMLHttpRequest,r=o.toUpperCase(),a=[];if("GET"!==r)throw new Error("xhr "+r+" is not supported");for(var l in s)a.push(l+"="+s[l]);for(var u in n.open(r,""+i,!0),n.responseType="",c)Object.prototype.hasOwnProperty.call(c,u)&&n.setRequestHeader(u,""+c[u]);n.onload=function(){200===n.status||206===n.status?e(n):t(n)},n.onerror=n.ontimeout=function(){return t(n)},n.send()}))},e.exports=t.default}]);Hl.extend(Vl);var Gl=function(e){return e.VIDEO="video",e.EVIDEO="evideo",e.DRM_EVIDEO="drm_evideo",e}(Gl||{});function Wl(e){try{return JSON.parse(e)}catch(t){return Ul.warn("[utils/json] decode fail: ".concat(e),t),null}}function Kl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GetPlayInfoToken";if(e){var i={},n=Wl(window.atob(e));return n&&"string"==typeof n[t]&&n[t].split("&").map((function(e){var t=e.split("=");t[0]&&t[1]&&(i[t[0]]=t[1])})),i}}function Yl(e){var t={};return decodeURIComponent(e).split("&").map((function(e){var i=e.split("=");i[0]&&i[1]&&(t[decodeURIComponent(i[0])]=decodeURIComponent(i[1]))})),t}var $l=function(e){var t,i;if(null==e||!e.playAuthToken)return!1;var n=Kl(null==e?void 0:e.playAuthToken),r=null!==(t=null==n||null===(i=n.FileType)||void 0===i?void 0:i.toLowerCase())&&void 0!==t?t:"video";return!!n&&("evideo"===r||"eaudio"===r)},ql=function(e){var t,i,n;if(null!=e&&e.playAuthToken){var r=Kl(null==e?void 0:e.playAuthToken),o=null!==(t=null==r||null===(i=r.FileType)||void 0===i?void 0:i.toLowerCase())&&void 0!==t?t:"video";return(null==r||null===(n=r.Format)||void 0===n?void 0:n.toLowerCase())||(Object.values(Gl).includes(o)?_n.MP4:bn.M4A)}},Xl=function(e){if(!e["X-Expires"]||!e["X-Date"])return!1;var t=parseInt(e["X-Expires"]);if(isNaN(t))return!1;var i=e["X-Date"].replace(/T/g," ").replace(/Z/g,""),n=Hl.utc(i,"YYYYMMDD hhmmss");return!!n.isValid()&&n.add(t,"seconds").isBefore(Hl())};function Jl(e,t){var i=["240p","360p","480p","540p","720p","1080p","2k","4k","od","oe"],n=e.Definition,r=t.Definition;if(i.includes(n)&&i.includes(r)){var o=i.findIndex((function(e){return e.toLocaleLowerCase()===n.toLocaleLowerCase()}));return i.findIndex((function(e){return e.toLocaleLowerCase()===r.toLocaleLowerCase()}))-o}return t.Bitrate&&e.Bitrate?t.Bitrate-e.Bitrate:-1}function Zl(e){var t=e.playAuthToken,i=e.playDomain,n=e.reqParams,r=void 0===n?{}:n,o=e.definitionMap,s=e.needThumbs,l=void 0!==s&&s,c=e.needBarrageMask,u=void 0!==c&&c,h=e.autoDemoteDefinition,d=e.autoDemoteDefinitionTextKey;if(t){var f=a(a({},r),{},{NeedThumbs:l?1:0,NeedBarrageMask:u?1:0});return new Promise((function(e,n){zl.url(t,i,f).then((function(t){var i=t.Data||t,n=i.Status,r=i.PlayInfoList,s=void 0===r?[]:r,l=i.PosterUrl,c=i.Vid,u=i.Duration,f=i.BarrageMaskUrl,p=i.ThumbInfoList,g=void 0===p?[]:p,v=i.EnableAdaptive,y=i.AdaptiveBitrateStreamingInfo;if(n===Ol.VALID&&s.length){var m,_=s.map((function(e){var t;return a(a({vid:c,url:e.MainPlayUrl,streamType:e.Format,backupUrl:e.BackupPlayUrl,backUrlList:[e.BackupPlayUrl],fileType:e.FileType,format:e.Format,bitrate:e.Bitrate,size:e.Size,kid:e.PlayAuthId,vwidth:e.Width,vheight:e.Height,vtype:null===(t=e.Format)||void 0===t?void 0:t.toLocaleUpperCase(),codec:e.Codec,urlExpireTimestamp:Tc(e.MainUrlExpire,10,Il),drmType:e.DrmType},e),ac(e,{definitionMap:o,autoDemoteDefinition:h,autoDemoteDefinitionTextKey:d}))})).sort(Jl);e({playList:_,type:null===(m=_[0])||void 0===m?void 0:m.Format,poster:l,vid:c,duration:u,dashOpts:t.Data?t:{Data:a(a({},t),{},{VideoID:c})},thumbs:g,barrageMaskUrl:f,enableAdaptive:v,adaptiveBitrateStreamingInfo:y})}else e({playList:[],poster:l,vid:c,duration:u,dashOpts:t.Data?t:{Data:t},thumbs:g,barrageMaskUrl:f,enableAdaptive:v,adaptiveBitrateStreamingInfo:y}),Ul.error("HAS NO VIDEO INFORMATION CORRECTLY, PLEASE CHECK THE TOKEN.")}
1)).catch((function(e){Ul.log("err",e),n(e)}))}))}return Promise.resolve(void 0)}function Ql(e,t,i,n){return ec.apply(this,arguments)}function ec(){return(ec=u(s().mark((function e(t,i,n,r){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:case 15:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),!--i||!n(e.t0)){e.next=12;break}return e.abrupt("return",Ql(t,i,n,r));case 12:if(!r||"function"!=typeof r){e.next=16;break}return e.next=15,r(e.t0);case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function tc(e,t,i,n){var r;return i+"/?"+n+"&"+(r={ThirdPartyDrmType:e,Kid:t},Object.entries(r).map((function(e){var t=T(e,2),i=t[0],n=t[1];return Array.isArray(n)?n.map((function(e){return"".concat(encodeURIComponent(i),"=").concat(encodeURIComponent(e))})).join("&"):"".concat(encodeURIComponent(i),"=").concat(encodeURIComponent(n))})).join("&"))}var ic="__veplayer_";function nc(){try{return Math.round(window.performance.now())}catch(e){return(new Date).getTime()}}function rc(e,t){return new Promise((function(i,n){try{e||n(new Error("url is undefined"));var r=nc(),o=r,a=new window.XMLHttpRequest,s={status:0,statusText:"",connectTime:0,raw:a};a.open("get",e),a.onreadystatechange=function(){2===a.readyState&&(s.headers=function(e){var t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var i=e.split(": "),n=i.shift();t[n]=i.join(": ")}))}catch(e){return t}return t}(a),s.connectTime=nc()-o,s.status=a.status,s.statusText=a.statusText,r=nc())},a.onload=function(){s.response=a.response,i(s)},a.onprogress=function(e){var t,i=nc()-r;t=parseInt(""+e.loaded/1e3/(i/1e3),10),s.speed=0|t,s.costTime=i},a.onerror=function(){s.status||(s.status=-1,s.costTime=nc()-r),n(s)},a.ontimeout=function(){s.status||(s.status=-2,s.costTime=nc()-r),i(s)},a.onabort=function(){i(s)},null!=t&&t.type&&(a.responseType=t.type),a.timeout=(null==t?void 0:t.timeout)||1e4,a.setRequestHeader("Range","bytes=".concat((null==t?void 0:t.range)||"0-1048576")),a.send()}catch(e){n(e)}}))}var oc=function(e){return(null==e?void 0:e.length)&&e.reduce((function(t,i,n){return t[i]={next:n+1>=e.length?null:e[n+1],pre:0===n?null:e[n-1]},t}),{})},ac=function(e,t){var i=t||{},n=i.definitionMap,r=i.autoDemoteDefinition,o=i.autoDemoteDefinitionTextKey;if(!e||!e.Definition&&!e.Quality)return{definition:"240P"};var s=e.Definition||e.Quality;if(n){var l,c={definition:s},u=n[s];return c=u?"string"==typeof u?{definition:u}:a({definition:s},u||{}):{definition:s},r&&r.toLocaleLowerCase()===(null===(l=c)||void 0===l||null===(l=l.definition)||void 0===l?void 0:l.toLocaleLowerCase())&&(c={definition:"auto",definitionTextKey:o,mapDefinition:c.definition}),c}return{definition:s}},sc=function(){function e(){h(this,e),this.timeID=null,this.func=null}return f(e,[{key:"repeat",value:function(e,t){this.timeID=1,this.repeatInterval(e,t)}},{key:"repeatInterval",value:function(e,t){var i=this;this.timeID&&(null===this.func&&(this.func=e),this.func===e&&(this.timeID&&clearTimeout(this.timeID),this.timeID=null,this.timeID=setTimeout((function(){e(),i.repeatInterval(e,t)}),t)))}},{key:"clear",value:function(){clearTimeout(this.timeID),this.timeID=null}}]),e}(),lc=["Strategy","disabled","config"],cc={mp4:["video/mp4","audio/mp4"],hls:["application/vnd.apple.mpegurl","application/x-mpegurl","audio/mpegurl"],webm:["audio/webm","video/webm"],mov:["video/quicktime"]},uc=function(e){return e&&0<e.toLowerCase().indexOf(".sdp")};function hc(e){var t;if(Array.isArray(e)&&e.length){var i;if(e[0].type){for(var n="",r=0,o=Object.entries(cc);r<o.length;r++){var a=T(o[r],2),s=a[0];if(a[1].includes(s)){n=s;break}}if(n)return n}t=null===(i=e[0])||void 0===i?void 0:i.src}else t="string"==typeof e?e:"";return function(e){return e&&0<e.toLowerCase().indexOf(".m3u8")}(t)?"hls":function(e){return e&&0<e.toLowerCase().indexOf(".flv")}(t)?"flv":uc(t)?"rtm":function(e){return e&&0<e.toLowerCase().indexOf(".mp4")}(t)?"mp4":function(e){return e&&0<e.toLowerCase().indexOf(".mpd")}(t)?"dash":"mp4"}function dc(e){return e&&e.then?e:Promise.resolve(e)}var fc=function(e,t){var i;if(t&&e)return Object.keys(e).map((function(n){n.toLowerCase()===t.toLowerCase()&&(i=e[n])})),i};function pc(){var e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase();return"zh-cn"!==e&&"cn"!==e||(e="zh"),e}function gc(e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=setTimeout((function(){t&&Ul.warn(t),i=null}),arguments.length>1&&void 0!==arguments[1]?arguments[1]:200);return e.then?e.then((function(){return clearTimeout(i)})):(clearTimeout(i),i=null),e}function vc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return new Promise((function(n,r){e().then(n).catch((function(o){setTimeout((function(){1!==t?vc(e,t-1,i).then(n,r):r(o)}),i)}))}))}function yc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';if(!window.MediaSource)return!1;
1try{return window.MediaSource.isTypeSupported(e)}catch(e){return Ul.error("mse error",e),!1}}var mc="undefined"!=typeof window,_c=mc&&navigator.userAgent.toLocaleLowerCase(),bc=mc&&/^((?!chrome|android).)*safari/.test(_c);function kc(e){var t={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com",__LOG_TEA_ID__:4951,__LOG_CHANNEL__:"cn",__UMD_PRE_PATH__:"https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/@volcengine/veplayer/1.9.6/plugin"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://vodbackup.ap-southeast-1.volcengineapi.com",__LOG_TEA_ID__:323254,__LOG_CHANNEL__:"sg",__LOG_CUSTOM_REGION__:"volc-overseas",__UMD_PRE_PATH__:"https://sf-unpkg.bytepluscdn.com/obj/byteplusfe-sg/sdk/@byteplus/veplayer/1.9.6/plugin"}};return e&&t[e]||t.cn}function wc(e){var t=[];return e.forEach((function(e){t.find((function(t){var i,n;return(null==t||null===(i=t.pluginName)||void 0===i?void 0:i.toLowerCase())===(null==e||null===(n=e.pluginName)||void 0===n?void 0:n.toLowerCase())}))||t.push(e)})),t}function Sc(e){var t;return"string"==typeof e?e:null==e||null===(t=e[0])||void 0===t?void 0:t.src}function Tc(e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=parseInt(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:10);return Number.isNaN(i)?t:i}function Ec(e){if(!e||"boolean"==typeof e)return{config:{}};e.Strategy,e.disabled;var t=e.config,i=m(e,lc);return a(a({},e),{},{config:a(a({},i),null!=t?t:{})})}var Cc=/["'&<>]/,xc=function(){return(xc=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function Dc(e){var t="function"==typeof Symbol&&e[Symbol.iterator],i=0;return t?t.call(e):{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function Pc(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}function Oc(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Pc(arguments[t]));return e}var Ic,Lc=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var i=this;e&&t&&"function"==typeof t&&this.on(e,(function n(r){t(r),i.off(e,n)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var i=this._hooks[e].indexOf(t);-1!==i&&this._hooks[e].splice(i,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,i){if(i){if(!e)return;-1!==this._cache.indexOf(i)?this._emit(e,t):(this._hooksCache.hasOwnProperty(i)||(this._hooksCache[i]={}),this._hooksCache[i].hasOwnProperty(e)||(this._hooksCache[i][e]=[]),this._hooksCache[i][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&Oc(this._hooks[e]).forEach((function(e){try{e(t)}catch(e){}}))},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),Ac=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},Rc=function(e){return Array.isArray(e)},Mc=(Ic=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return Ic+=1}),Nc=function(e){return function(e,t,i){if("string"==typeof e&&"number"==typeof i){var n,r=[];i=i<=25?i:i%25;var o=String.fromCharCode(i+97);n=e.split(o);for(var a=0;a<n.length;a++){var s=parseInt(n[a],i);s=1*s^64;var l=String.fromCharCode(s);r.push(l)}return r.join("")}}(e,0,25)},Bc=function(e){navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1)},Uc=function(e,t,i){var n=document.createElement("script");n.src=e,n.onerror=function(){i(e)},n.onload=function(){t()},document.getElementsByTagName("head")[0].appendChild(n)},jc=function(){var e=0;return["hidden","msHidden","webkitHidden"].forEach((function(t){void 0!==document[t]&&(e=1)})),e},Hc=function(e){var t=document.createElement("a");return t.href=e,t},Fc=function(e){var t={};try{var i=Hc(e).search;if(!i)return t;(i=i.slice(1)).split("&").forEach((function(e){var i,n,r=e.split("=");r.length&&(i=r[0],n=r[1]);try{t[i]=decodeURIComponent(void 0===n?"":n)}
1catch(e){t[i]=n}}))}catch(e){}return t},Vc=function(e){for(var t=0,i=0,n=(e+="").length,r=0;r<n;r++)((t=31*t+e.charCodeAt(i++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t};function zc(e,t){return e(t={exports:{}},t.exports),t.exports}var Gc,Wc,Kc,Yc=zc((function(e,t){var i;i=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var i=arguments[e];for(var n in i)t[n]=i[n]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function i(n){function r(){}function o(t,i,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},r.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var a=JSON.stringify(i);/^[\{\[]/.test(a)&&(i=a)}catch(e){}i=n.write?n.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var l in o)o[l]&&(s+="; "+l,!0!==o[l]&&(s+="="+o[l].split(";")[0]));return document.cookie=t+"="+i+s}}function a(e,i){if("undefined"!=typeof document){for(var r={},o=document.cookie?document.cookie.split("; "):[],a=0;a<o.length;a++){var s=o[a].split("="),l=s.slice(1).join("=");i||'"'!==l.charAt(0)||(l=l.slice(1,-1));try{var c=t(s[0]);if(l=(n.read||n)(l,c)||t(l),i)try{l=JSON.parse(l)}catch(e){}if(r[c]=l,e===c)break}catch(e){}}return e?r[e]:r}}return r.set=o,r.get=function(e){return a(e,!1)},r.getJSON=function(e){return a(e,!0)},r.remove=function(t,i){o(t,"",e(i,{expires:-1}))},r.defaults={},r.withConverter=i,r}((function(){}))},e.exports=i()})),$c=function(e,t){try{return e?Yc.get(e,{domain:t||document.domain}):Yc.get()}catch(e){return""}},qc=function(e,t,i,n){try{var r=n||document.domain,o=+new Date+(i||6048e5);Yc.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(e){}},Xc=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e,t){return $c(e,t)},e.prototype.setCookie=function(e,t,i,n){qc(e,t,i,n)},e}(),Jc={getItem:function(e){try{var t=localStorage.getItem(e),i=t;try{t&&"string"==typeof t&&(i=JSON.parse(t))}catch(e){}return i||{}}catch(e){}return{}},setItem:function(e,t){try{var i="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,i)}catch(e){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(e){}},getCookie:function(e,t){return $c(e,t)},setCookie:function(e,t,i,n){qc(e,t,i,n)},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},Zc={getItem:function(e){try{var t=sessionStorage.getItem(e),i=t;try{t&&"string"==typeof t&&(i=JSON.parse(t))}catch(e){}return i||{}}catch(e){}return{}},setItem:function(e,t){try{var i="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,i)}catch(e){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(e){}},getCookie:function(e,t){return $c(e,t)},setCookie:function(e,t,i,n){qc(e,t,i,n)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},Qc=function(){function e(e,t){this._storage=t&&"session"===t?Zc:!e&&Jc.isSupportLS?Jc:new Xc}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,i,n){this._storage.setCookie(e,t,i,n)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),eu=function(){function e(e,t,i){this.appid=e,this.domain=t,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=i}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,i=document.referrer,n=i?Hc(i).hostname:"",r=Fc(window.location.href),o=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web";this.utm=function(e,t,i,n){var r=new Qc(!1),o=new Qc(!1,"session"),a=e?"_tea_utm_cache_"+e:"_tea_utm_cache",s=e?"_$utm_from_url_"+e:"_$utm_from_url",l={},c=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],u={ad_id:Number(t.ad_id)||void 0,campaign_id:Number(t.campaign_id)||void 0,creative_id:Number(t.creative_id)||void 0,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,utm_term:t.utm_term,utm_content:t.utm_content,tr_shareuser:t.tr_shareuser,tr_admaster:t.tr_admaster,tr_param1:t.tr_param1,tr_param2:t.tr_param2,tr_param3:t.tr_param3,tr_param4:t.tr_param4};try{var h=!1;
1for(var d in u)u[d]&&(-1!==c.indexOf(d)?(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data[d]=u[d]):l[d]=u[d],h=!0);if(h)o.setItem(s,"1"),r.setCookie(a,JSON.stringify(l),n,i);else{var f=r.getCookie(a,i);f&&(l=JSON.parse(f))}o.getItem(s)&&(l.hasOwnProperty("tracer_data")||(l.tracer_data={}),l.tracer_data.$utm_from_url=1)}catch(e){return u}return l}(this.appid,r,this.domain,this.cookie_expire);var a=this.browser(),s=this.os();return{browser:a.browser,browser_version:a.browser_version,platform:o,os_name:s.os_name,os_version:s.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(s.os_name),language:t,referrer:i,referrer_host:n,utm:this.utm,latest_data:this.last(i,n)}},e.prototype.last=function(e,t){var i="",n="",r="",o=location.hostname,a=!1;if(e&&t&&o!==t){i=e,n=t,a=!0;var s=Fc(e);s.keyword&&(r=s.keyword)}return{$latest_referrer:i,$latest_referrer_host:n,$latest_search_keyword:r,isLast:a}},e.prototype.browser=function(){var e,t,i="",n=""+parseFloat(this.appVersion),r=this.userAgent;return-1!==r.indexOf("Edge")||-1!==r.indexOf("Edg")?(i="Microsoft Edge",-1!==r.indexOf("Edge")?(e=r.indexOf("Edge"),n=r.substring(e+5)):(e=r.indexOf("Edg"),n=r.substring(e+4))):-1!==(e=r.indexOf("MSIE"))?(i="Microsoft Internet Explorer",n=r.substring(e+5)):-1!==(e=r.indexOf("Lark"))?(i="Lark",n=r.substring(e+5,e+11)):-1!==(e=r.indexOf("MetaSr"))?(i="sougoubrowser",n=r.substring(e+7,e+10)):-1!==r.indexOf("MQQBrowser")||-1!==r.indexOf("QQBrowser")?(i="qqbrowser",-1!==r.indexOf("MQQBrowser")?(e=r.indexOf("MQQBrowser"),n=r.substring(e+11,e+15)):-1!==r.indexOf("QQBrowser")&&(e=r.indexOf("QQBrowser"),n=r.substring(e+10,e+17))):-1!==r.indexOf("Chrome")?-1!==(e=r.indexOf("MicroMessenger"))?(i="weixin",n=r.substring(e+15,e+20)):-1!==(e=r.indexOf("360"))?(i="360browser",n=r.substring(r.indexOf("Chrome")+7)):-1!==r.indexOf("baidubrowser")||-1!==r.indexOf("BIDUBrowser")?(-1!==r.indexOf("baidubrowser")?(e=r.indexOf("baidubrowser"),n=r.substring(e+13,e+16)):-1!==r.indexOf("BIDUBrowser")&&(e=r.indexOf("BIDUBrowser"),n=r.substring(e+12,e+15)),i="baidubrowser"):-1!==(e=r.indexOf("xiaomi"))?-1!==r.indexOf("openlanguagexiaomi")?(i="openlanguage xiaomi",n=r.substring(e+7,e+13)):(i="xiaomi",n=r.substring(e-7,e-1)):-1!==(e=r.indexOf("TTWebView"))?(i="TTWebView",n=r.substring(e+10,e+23)):(-1!==(e=r.indexOf("Chrome"))||-1!==(e=r.indexOf("Chrome")))&&(i="Chrome",n=r.substring(e+7)):-1!==r.indexOf("Safari")?-1!==(e=r.indexOf("QQ"))?(i="qqbrowser",n=r.substring(e+10,e+16)):-1!==(e=r.indexOf("Safari"))&&(i="Safari",n=r.substring(e+7),-1!==(e=r.indexOf("Version"))&&(n=r.substring(e+8))):-1!==(e=r.indexOf("Firefox"))?(i="Firefox",n=r.substring(e+8)):-1!==(e=r.indexOf("MicroMessenger"))?(i="weixin",n=r.substring(e+15,e+20)):-1!==(e=r.indexOf("QQ"))&&(i="qqbrowser",n=r.substring(e+3,e+8)),-1!==(t=n.indexOf(";"))&&(n=n.substring(0,t)),-1!==(t=n.indexOf(" "))&&(n=n.substring(0,t)),-1!==(t=n.indexOf(")"))&&(n=n.substring(0,t)),{browser:i,browser_version:n}},e.prototype.os=function(){for(var e="",t="",i=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],n=0;n<i.length;n++){var r=i[n];if(r.r.test(this.userAgent)){"Mac OS X"===(e=r.s)&&this.isNewIpad()&&(e="iOS");break}}var o,a,s=function(e,t){var i=e.exec(t);return i&&i[1]?i[1]:""},l=function(e,t){var i=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return i?i.slice(1)[0]:""};switch(/Windows/.test(e)&&(t=s(/Windows (.*)/,e),e="windows"),e){case"Mac OS X":t=l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":(a=s(/Android ([\.\_\d]+)/,o=this.userAgent))||(a=s(/Android\/([\.\_\d]+)/,o)),t=a,e="android";break;case"iOS":t=this.isNewIpad()?l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios"}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";
1try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var i=navigator.userAgent.replace("Mozilla/5.0 (",""),n=i.indexOf(";");t=i.slice(0,n)}}catch(e){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),tu={cn:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},iu={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az28z1gz1hz1gz1cz18z1nz1gz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k"},nu="5.1.3",ru=function(){function e(e,t){this.collector=e,this.config=t,this.eventNameWhiteList=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure"],this.paramsNameWhiteList=["$inactive","$inline","$target_uuid_list","$source_uuid","$is_spider","$source_id","$is_first_time","_staging_flag"],this.regStr=new RegExp("^[a-zA-Z0-9][a-z0-9A-Z_.-]{1,255}$")}return e.prototype.checkVerify=function(e){var t=this;if(!e||!e.length)return!1;var i=e[0];if(!i)return!1;var n=i.events,r=i.header;if(!n||!n.length)return!1;var o=!0;return n.forEach((function(e){if(!e)return o=!1,void(e.checkEvent="äºä»¶å¼å¸¸");t.checkEventName(e.event)||(o=!1,e.checkEvent="äºä»¶åä¸è½ä»¥ $ or __å¼å¤´"),t.checkEventParams(e.params)||(o=!1,e.checkParams="屿§åä¸è½ä»¥ $ or __å¼å¤´")})),this.checkEventParams(r)||(o=!1),o},e.prototype.checkEventName=function(e){return!!e&&this.calculate(e,"event")},e.prototype.checkEventParams=function(e){var t=e;if("string"==typeof e&&(t=JSON.parse(t)),!Object.keys(t).length)return!0;for(var i in t)return!(!this.calculate(i,"params")||"string"==typeof t[i]&&t[i].length>1024);return!0},e.prototype.calculate=function(e,t){return-1!==("event"===t?this.eventNameWhiteList:this.paramsNameWhiteList).indexOf(e)||!new RegExp("^\\$").test(e)&&!new RegExp("^__").test(e)||!1},e}();(Kc=Gc||(Gc={})).Init="init",Kc.Config="config",Kc.Start="start",Kc.Ready="ready",Kc.UnReady="un-ready",Kc.TokenComplete="token-complete",Kc.TokenStorage="token-storage",Kc.TokenFetch="token-fetch",Kc.TokenError="token-error",Kc.ConfigUuid="config-uuid",Kc.ConfigWebId="config-webid",Kc.ConfigDomain="config-domain",Kc.CustomWebId="custom-webid",Kc.TokenChange="token-change",Kc.TokenReset="token-reset",Kc.ConfigTransform="config-transform",Kc.EnvTransform="env-transform",Kc.SessionReset="session-reset",Kc.SessionResetTime="session-reset-time",Kc.SetSessionId="set-session-id",Kc.Event="event",Kc.Events="events",Kc.EventNow="event-now",Kc.CleanEvents="clean-events",Kc.BeconEvent="becon-event",Kc.SubmitBefore="submit-before",Kc.SubmitScuess="submit-scuess",Kc.SubmitAfter="submit-after",Kc.SubmitError="submit-error",Kc.SubmitVerify="submit-verify",Kc.Stay="stay",Kc.ResetStay="reset-stay",Kc.StayReady="stay-ready",Kc.SetStay="set-stay",Kc.RouteChange="route-change",Kc.RouteReady="route-ready",Kc.Ab="ab",Kc.AbVar="ab-var",Kc.AbAllVars="ab-all-vars",Kc.AbConfig="ab-config",Kc.AbExternalVersion="ab-external-version",Kc.AbVersionChangeO
1n="ab-version-change-on",Kc.AbVersionChangeOff="ab-version-change-off",Kc.AbOpenLayer="ab-open-layer",Kc.AbCloseLayer="ab-close-layer",Kc.AbReady="ab-ready",Kc.AbComplete="ab-complete",Kc.AbTimeout="ab-timeout",Kc.Profile="profile",Kc.ProfileSet="profile-set",Kc.ProfileSetOnce="profile-set-once",Kc.ProfileUnset="profile-unset",Kc.ProfileIncrement="profile-increment",Kc.ProfileAppend="profile-append",Kc.ProfileClear="profile-clear",Kc.Autotrack="autotrack",Kc.AutotrackReady="autotrack-ready",Kc.CepReady="cep-ready",Kc.TracerReady="tracer-ready",Kc.sessionRecord="session-record",Kc.SessionRecordStart="session-record-start",Kc.SessionRecordPause="session-record-pause",Kc.SessionRecordEnd="session-record-end",Kc.SessionRecordReport="session-record-report",Kc.DestoryInstance="destory-instance",Kc.VisualCollectReady="visual-collect-ready",Kc.VisualApiReady="visual-api-ready",Kc.VisualApiUpdate="visual-api-update",function(e){e.DEBUGGER_MESSAGE="debugger-message",e.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",e.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",e.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",e.DEBUGGER_MESSAGE_EVENT="debugger-message-event",e.DEVTOOL_WEB_READY="devtool-web-ready"}(Wc||(Wc={}));var ou=Gc,au=void 0,su=(new Date).getTimezoneOffset(),lu=parseInt(""+-su/60,10),cu=60*su,uu=function(){function e(e,t){this.is_first_time=!0,this.configPersist=!1,this.initConfig=t,this.collect=e;var i=new eu(t.app_id,t.cookie_domain||"",t.cookie_expire||7776e6).init();this.eventCheck=new ru(e,t);var n="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new Qc(!1,"session"),this.localStorage=new Qc(!1,"local"),t.configPersist&&(this.configPersist=!0,this.storage=1===t.configPersist?this.sessionStorage:this.localStorage);var r=this.localStorage.getItem(n);r&&1==r?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(n,"1")),this.envInfo={user:{user_unique_id:au,user_type:au,user_id:au,user_is_auth:au,user_is_login:au,device_id:au,web_id:au,ip_addr_id:au,user_unique_id_type:au},header:{app_id:au,app_name:au,app_install_id:au,install_id:au,app_package:au,app_channel:au,app_version:au,ab_version:au,os_name:i.os_name,os_version:i.os_version,device_model:i.device_model,ab_client:au,traffic_type:au,client_ip:au,device_brand:au,os_api:au,access:au,language:i.language,region:au,app_language:au,app_region:au,creative_id:i.utm.creative_id,ad_id:i.utm.ad_id,campaign_id:i.utm.campaign_id,log_type:au,rnd:au,platform:i.platform,sdk_version:nu,sdk_lib:"js",province:au,city:au,timezone:lu,tz_offset:cu,tz_name:au,sim_region:au,carrier:au,resolution:i.screen_width+"x"+i.screen_height,browser:i.browser,browser_version:i.browser_version,referrer:i.referrer,referrer_host:i.referrer_host,width:i.screen_width,height:i.screen_height,screen_width:i.screen_width,screen_height:i.screen_height,utm_term:i.utm.utm_term,utm_content:i.utm.utm_content,utm_source:i.utm.utm_source,utm_medium:i.utm.utm_medium,utm_campaign:i.utm.utm_campaign,tracer_data:JSON.stringify(i.utm.tracer_data),custom:{},wechat_unionid:au,wechat_openid:au}},this.ab_version="",this.evtParams={},this.reportErrorCallback=function(){},this.isLast=!1,this.setCustom(i),this.initDomain(),this.initABData()}return e.prototype.initDomain=function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=Nc(iu[t])}},e.prototype.setDomain=function(e){this.domain=e},e.prototype.getDomain=function(){return this.domain},e.prototype.initABData=function(){var e="__tea_sdk_ab_version_"+this.initConfig.app_id,t=null;if(this.initConfig.ab_cross){var i=this.localStorage.getCookie(e,this.initConfig.ab_cookie_domain);t=i?JSON.parse(i):null}else t=this.localStorage.getItem(e);this.setAbCache(t)},e.prototype.setAbCache=function(e){this.ab_cache=e},e.prototype.getAbCache=function(){return this.ab_cache},e.prototype.setAbVersion=function(e){this.ab_version=e},e.prototype.getAbVersion=function(){return this.ab_version},e.prototype.clearAbCache=function(){this.ab_version="",this.ab_cache={}},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t="/list";break;case"webid":t="/webid";break;case"tobid":t="/tobid"}var i="";return this.initConfig.caller&&(i="?sdk_version=5.1.3&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),""+this.getDomain()+t+i},e.prototype.setCustom=function(e){if(e&&e.latest_data&&e.latest_data.isLast)for(var t in delete e.latest_data.isLast,this.isLast=!0,e.latest_data)this.envInfo.header.custom[t]=e.latest_data[t]},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(i){void 0!==e[i]&&null!==e[i]||t.delete(i);try{t.eventCheck.calculate(i,"config")}catch(e){}if("traffic_type"===i&&t.isLast&&(t.envInfo.header.custom.$latest_traffic_source_type=e[i]),"evtParams"===i)t.evtParams=xc({},t.evtParams||{},e.evtParams||{});else if("_staging_flag"===i)t.evtParams=xc({},t.evtParams||{},{_staging_flag:e._staging_flag});else if("reportErrorCallback"===i&&"function"==typeof e[i])t.reportErrorCallback=e[i];else{var n="",r="";if(i.indexOf(".")>-1){var o=i.split(".");n=o[0],r=o[1]}n?"user"===n||"header"===n?t.envInfo[n][r]=e[i]:t.envInfo.header.custom[r]=e[i]:Object.hasOwnProperty.call(t.envInfo.user,i)?["user_type","ip_addr_id"].indexOf(i)>-1?t.envInfo.user[i]=e[i]?Number(e[i]):e[i]:["user_id","web_id","user_unique_id","user_unique_id_type"].indexOf(i)>-1?t.envInfo.user[i]=e[i]?String(e[i]):e[i]:["user_is_auth","user_is_login"].indexOf(i)>-1?t.envInfo.user[i]=Boolean(e[i]):"device_id"===i&&(t.envInfo.user[i]=e[i]):Object.hasOwnProperty.call(t.envInfo.header,i)?t.envInfo.header[i]=e[i]:t.envInfo.header.custom[i]=e[i]}}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(e){this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.setStore=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&Object.keys(e).length){var i=Object.assign(e,t);this.storage.setItem(this.configKey,i)}}catch(e){this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.getStore=function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey)||{};return e&&Object.keys(e).length?e:null}catch(e){return this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message}),null}},e.prototype.delete=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};t&&Object.hasOwnProperty.call(t,e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(e){this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e}(),hu=function(){function e(e,t){this.isLog=t||!1,this.name=e||""}return e.prototype.info=function(e){this.isLog},e.prototype.warn=function(e){this.isLog},e.prototype.error=function(e){this.isLog},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),du=function(){function e(){this.spiderBot=["Baiduspider","googlebot","360Spider","haosouspider","YoudaoBot","Sogou News Spider","Yisouspider","Googlebot","Headless","Applebot","Bingbot","PetalBot"]}return e.prototype.checkSpider=function(e){if(!e.enable_spider)return!1;var t=window.navigator.userAgent;if(!t)return!0;var i=!1;return this.spiderBot.forEach((function(e){-1!==t.indexOf(e)&&(i=!0)})),i},e}(),fu=function(){function e(e,t){this.collect=e,this.native=t}var t=e.prototype;return t.bridgeInject=function(){try{return!!this.native&&!!AppLogBridge}catch(e){return!1}},t.bridgeReady=function(){var e=this;return new Promise((function(t,i){try{e.bridgeInject()?AppLogBridge.hasStarted((function(e){e?t(!0):i(!1)})):i(!1)}catch(e){i(!1)}}))},t.setNativeAppId=function(e){try{AppLogBridge.setNativeAppId(JSON.stringify(e))}catch(e){}},t.setConfig=function(e){var t=this;try{Object.keys(e).forEach((function(i){"user_unique_id"===i?t.setUserUniqueId(e[i]):e[i]?t.addHeaderInfo(i,e[i]):t.removeHeaderInfo(i)}))}catch(e){}},t.setUserUniqueId=function(e){try{AppLogBridge.setUserUniqueId(e)}catch(e){}},t.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(e){}},t.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(JSON.stringify(e))}catch(e){}},t.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(e){}},t.reportPv=function(e){this.onEventV3("predefine_pageview",e)},t.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t),this.collect.emit(DebuggerMesssge.DEBUGGER_MESSAGE,{type:DebuggerMesssge.DEBUGGER_MESSAGE_EVENT,info:"bridgeåç¹ä¸æ¥",time:Date.now(),data:[{events:[{event:e,params:t}]}],code:200,status:"success"})}catch(e){}}
1,t.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(e){}},t.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(e){}},t.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(e){}},t.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(e){}},t.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(e){}},e}(),pu=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},gu=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.storage=new Qc(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSessionTimeCheck=t.disable_session_check,this.disableSession||(this.setSessionId(),this.collect.on(ou.SessionReset,(function(e){i.resetSessionId(e)})),this.collect.on(ou.SessionResetTime,(function(){i.updateSessionIdTime()})))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:pu(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:pu(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.disableSessionTimeCheck||(this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(e){var t={sessionId:e||pu(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,t)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:pu(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),vu=function(){function e(){this.eventLimit=50,this.enable_ttwebid=!1,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.eventCheck=new ru(e,t),this.cacheStorgae=new Qc(!0),this.localStorage=new Qc(!1),this.maxReport=t.max_report||10,this.reportTime=t.reportTime||t.report_time||30,this.timeout=t.timeout||1e5,this.enable_ttwebid=t.enable_ttwebid,this.reportUrl=t.report_url||this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.abKey="__tea_sdk_ab_version_"+this.configManager.get("app_id"),this.refer_key="__tea_cache_refer_"+this.configManager.get("app_id"),this.pageId=pu(),this.collect.on(ou.Ready,(function(){i.reportAll(!1)})),this.collect.on(ou.ConfigDomain,(function(){i.reportUrl=i.configManager.getUrl("event")})),this.collect.on(ou.Event,(function(e){i.event(e)})),this.collect.on(ou.BeconEvent,(function(e){i.beconEvent(e)})),this.collect.on(ou.CleanEvents,(function(){i.reportAll(!1)})),this.linster()},e.prototype.linster=function(){var e=this;window.addEventListener("unload",(function(){e.reportAll(!0)}),!1),Bc((function(){e.reportAll(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;try{var i=Oc(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,i),this.reportTimeout&&clearTimeout(this.reportTimeout),i.length>=this.maxReport)this.report(!1);else{var n=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),n)}}catch(e){this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.beconEvent=function(e){var t=Oc(e,this.cacheStorgae.getItem(this.be
1conKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.destroy||this.collect.sdkStop||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))},e.prototype.reportBecon=function(){if(!this.collect.destroy&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))}},e.prototype.report=function(e){if(!this.collect.destroy&&!this.collect.sdkStop&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var i=0;i<e.length;i+=this.eventLimit){var n;n=e.slice(i,i+this.eventLimit);var r=this.split(this.merge(n));this.send(r,t)}else r=this.split(this.merge(e)),this.send(r,t)},e.prototype.handleRefer=function(){var e="";try{if(this.config.spa||this.config.autotrack){var t=this.localStorage.getItem(this.refer_key)||{};e=t.routeChange?t.refer_key:this.configManager.get("referrer")}else e=this.configManager.get("referrer")}catch(t){e=document.referrer}return e},e.prototype.merge=function(e,t){var i=this,n=this.configManager.get(),r=n.header,o=n.user;this.config.enable_pageid&&(r.custom.page_id=this.pageId),r.referrer=this.handleRefer(),r.custom=JSON.stringify(r.custom);var a=this.configManager.get("evtParams"),s=this.configManager.get("user_unique_id_type"),l=e.map((function(e){try{Object.keys(a).length&&!t&&(e.params=xc({},a,e.params)),s&&(e.params.$user_unique_id_type=s);var n=i.configManager.getAbCache();return n&&n.uuid&&n.uuid===o.user_unique_id&&i.configManager.getAbVersion()&&(e.ab_sdk_version=i.configManager.getAbVersion()),e.session_id=i.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(t){return i.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:t.message}),e}})),c=JSON.parse(JSON.stringify({events:l,user:o,header:r}));c.local_time=Math.floor(Date.now()/1e3),c.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0,c.verbose=1;var u=[];return u.push(c),u},e.prototype.split=function(e){return e.map((function(e){var t=[];return t.push(e),t}))},e.prototype.send=function(e,t){var i=this;e.length&&(this.config.disable_track_event||e.forEach((function(e){try{var n=JSON.parse(JSON.stringify(e));i.config.filter&&(n=i.config.filter(n)),i.collect.eventFilter&&n&&(n=i.collect.eventFilter(n));var r=n||e,o=JSON.parse(JSON.stringify(r));if(i.eventCheck.checkVerify(o),!r.length)return;i.collect.emit(ou.SubmitBefore,r),i.collect.requestManager.useRequest({url:i.reportUrl,data:r,success:function(e,t){e&&0!==e.e?(i.collect.emit(ou.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e}),i.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_EVENT,info:"åç¹ä¸æ¥å¤±è´¥",time:Date.now(),data:o,code:e.e,failType:"æ°æ®å¼å¸¸å¤±è´¥",status:"fail"})):(i.collect.emit(ou.SubmitScuess,{eventData:t,res:e}),i.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_EVENT,info:"åç¹ä¸æ¥æå",time:Date.now(),data:o,code:200,status:"success"}))},fail:function(e,t){i.configManager.get("reportErrorCallback")(e,t),i.collect.emit(ou.SubmitError,{type:"f_net",eventData:e,errorCode:t}),i.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_EVENT,info:"åç¹ä¸æ¥ç½ç»å¼å¸¸",time:Date.now(),data:o,code:t,failType:"ç½ç»å¼å¸¸å¤±è´¥",status:"fail"})},timeout:i.timeout,useBeacon:t,withCredentials:i.enable_ttwebid}),i.collect.emit(ou.SubmitAfter,r)}catch(e){i.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}})))},e}(),yu=function(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}().replace(/-/g,"").slice(0,19)},mu=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enable_ttwebid=!1,this.enableCustomWebid=!1}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new Qc(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.enable_ttwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on(ou.ConfigUuid,(function(e){i.setUuid(e)})),this.collect.on(ou.ConfigWebId,(function(e){i.setWebId(e)})),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()},e.prototype.checkStorage=function(){var e=this;if(this.enableCookie){var t=this.storage.getCookie(this.tokenKey,this.cookieDomain);this.cacheToken=t&&"string"==typeof t?JSON.parse(t):{}}else this.cacheToken=this.storage.getItem(this.tokenKey)||{};this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid?this.enableCustomWebid?this.collect.on(ou.CustomWebId,(function(){e.tokenReady=!0,e.collect.emit(ou.TokenComplete)})):this.checkEnv()||(this.enable_ttwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:yu(),user_unique_id:this.configManager.get("user_unique_id")||yu()}):this.remoteWebid()},e.prototype.checkEnv=function(){var e=window.navigator.userAgent;if(-1!==e.indexOf("miniProgram")||-1!==e.indexOf("MiniProgram")){var t=Fc(window.location.href);return!(!t||!t.Web_ID||(this.complete({web_id:""+t.Web_ID,user_unique_id:this.configManager.get("user_unique_id")||""+t.Web_ID}),0))}return!1},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),i={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""};this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK åèµ·WEBID请æ±",logType:"fetch",level:"info",time:Date.now(),data:i});var n=yu();
1this.collect.requestManager.useRequest({url:t,data:i,success:function(t){var i;t&&0===t.e?(i=t.web_id,e.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"WEBIDè¯·æ±æå",logType:"fetch",level:"info",time:Date.now(),data:t})):(i=n,e.collect.configManager.set({localWebId:n}),e.collect.emit(ou.TokenError),e.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"WEBID请æ±è¿åå¼å¼å¸¸",logType:"fetch",level:"warn",time:Date.now(),data:t}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||i,user_unique_id:e.configManager.get("user_unique_id")||i})},fail:function(){e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n}),e.collect.configManager.set({localWebId:n}),e.collect.emit(ou.TokenError),e.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"WEBID请æ±ç½ç»å¼å¸¸",logType:"fetch",level:"error",time:Date.now(),data:null}),e.collect.logger.warn("appid: "+e.config.app_id+", get webid error, use local webid~")},timeout:3e5})},e.prototype.complete=function(e){var t=e.web_id,i=e.user_unique_id;e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:i}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(ou.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",i=this.configManager.get("user_unique_id");(i||t)&&this.configManager.set({user_unique_id:i||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(ou.TokenComplete)},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),i=this.configManager.get("user_unique_id"),n=this.cacheToken&&this.cacheToken.user_unique_id;if(t===i&&t===n)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(ou.TokenChange,"uuid"),this.collect.emit(ou.SessionReset)}else this.clearUuid()},e.prototype.clearUuid=function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&this.configManager.get("user_unique_id")!==this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit(ou.TokenReset,"uuid"))},e.prototype.setWebId=function(e){if(e&&!this.config.enable_ttwebid){this.cacheToken&&this.cacheToken.web_id?this.cacheToken.web_id!==e&&(this.cacheToken.user_unique_id=this.cacheToken.web_id===this.cacheToken.user_unique_id?e:this.cacheToken.user_unique_id,this.cacheToken.web_id=e):(this.cacheToken={},this.cacheToken.web_id=e,this.cacheToken.user_unique_id=e),this.cacheToken.timestamp=Date.now();var t=this.configManager.get("web_id"),i=this.configManager.get("user_unique_id");i&&i!==t||(this.configManager.set({user_unique_id:e}),this.collect.emit(ou.TokenChange,"uuid")),t!==e&&(this.configManager.set({web_id:e}),this.collect.emit(ou.TokenChange,"webid")),this.setStorage(this.cacheToken)}},e.prototype.setStorage=function(e){e._type_=this.enableCustomWebid?"custom":"default",delete e["diss".split("").reverse().join("")],this.enableCookie||this.enable_ttwebid?(this.storage.setCookie(this.tokenKey,e,this.expiresTime,this.cookieDomain),this.enable_ttwebid&&(delete e.web_id,this.storage.setItem(this.tokenKey,e))):this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e.prototype.getTobId=function(){var e=this;return new Promise((function(t){e.collect.requestManager.useRequest({url:e.configManager.getUrl("tobid"),data:{app_id:e.config.app_id,user_unique_id:e.configManager.get("user_unique_id"),web_id:e.configManager.get("web_id"),user_unique_id_type:e.configManager.get("user_unique_id_type")},success:function(e){e&&0===e.e?t(e.tobid):t("")},fail:function(){t("")},time:3e4,withCredentials:e.enable_ttwebid})}))},e}(),_u=function(){function e(e,t){this.collector=e,this.config=t,this.requestType=t.request_type||"xhr",this.supportBeacon=!(!window.navigator||!window.navigator.sendBeacon),this.errorCode={NO_URL:4001,IMG_ON:4e3,IMG_CATCH:4002,BEACON_FALSE:4003,XHR_ON:500,RESPONSE:5001,TIMEOUT:5005}}return e.prototype.useFetch=function(e){var t=e.url,i=e.data,n=e.method,r=e.success,o=e.fail;window.fetch?fetch(t,{method:n||"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(i)}).then((function(e){return e.json()})).then((function(e){r&&r(e)})).catch((function(e){o&&o(i,e)}
1)):(this.requestType="xhr",this.useRequest({url:t,data:i,method:n,success:r,fail:o}))},e.prototype.useBeacon=function(e){var t=e.url,i=e.data,n=e.success,r=e.fail;window.navigator.sendBeacon(t,JSON.stringify(i))?n&&n():r&&r(i,this.errorCode.BEACON_FALSE)},e.prototype.useRequest=function(e){var t=this,i=e.url,n=e.data,r=e.method,o=e.success,a=e.fail,s=e.timeout,l=e.useBeacon,c=e.withCredentials,u=e.app_key,h=e.forceXhr;if(l&&this.supportBeacon)this.useBeacon({url:i,data:n,method:r,success:o,fail:a});else if("fetch"!==this.requestType||h)try{var d=new XMLHttpRequest,f=r||"POST";d.open(f,""+i,!0),d.setRequestHeader("Content-Type","application/json; charset=utf-8"),u&&d.setRequestHeader("X-MCS-AppKey",""+u),c&&(d.withCredentials=!0),s&&(d.timeout=s,d.ontimeout=function(){a&&a(n,t.errorCode.TIMEOUT)}),d.onload=function(){if(o){var e=null;if(d.responseText){try{e=JSON.parse(d.responseText)}catch(t){e={}}o(e,n)}}},d.onerror=function(){d.abort(),a&&a(n,t.errorCode.XHR_ON)},d.send(JSON.stringify(n))}catch(e){}else this.useFetch({url:i,data:n,method:r,success:o,fail:a})},e}(),bu=function(){function e(e,t){if(this.devToolReady=!1,this.devToolOrigin="*",this.sendAlready=!1,this.eventVerifyReady=!1,t.enable_debug){var i=e.adapters.storage;this.collect=e,this.config=t,this.app_id=t.app_id,this.cacheStorgae=new i(!1,"session"),this.eventVerifyInfo=[],this.sdk_type=nu.includes("tob")?"tob":"inner",this.filterEvent=["__bav_page","__bav_beat","__bav_page_statistics","__bav_click","__bav_page_exposure","bav2b_page","bav2b_beat","bav2b_page_statistics","bav2b_click","bav2b_page_exposure","_be_active","predefine_pageview","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append","predefine_page_alive","predefine_page_close","abtest_exposure"],this.load()}}return e.prototype.loadScript=function(e){try{var t=document.createElement("script");t.src=e,t.onerror=function(){},t.onload=function(){},document.getElementsByTagName("body")[0].appendChild(t)}catch(e){}},e.prototype.parseUrl=function(){var e={};try{var t=window.location.href.split("?")[1].split("&");t.length&&t.forEach((function(t){var i=t.split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}))}catch(e){}return e},e.prototype.load=function(){return e=this,i=function(){var e,t;return function(e,t){var i,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),(e=this.parseUrl()).open_devtool_web&&e.app_id){if(parseInt(e.app_id)!==this.app_id)return[2]}else if(!this.getStorage())return[2];return this.loadBaseInfo(),this.loadHook(),this.setStorage(),this.addLintener(),this.loadDebuggerModule(),this.loadDevTool(),[4,this.fetchEventInfo()];case 1:return t=i.sent(),this.sendData("devtool:web:verify",t.verifyStatus),this.eventVerifyInfo=t.data,[3,3];case 2:return i.sent(),[3,3];case 3:return[2]}}
1))},new((t=void 0)||(t=Promise))((function(n,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){e.done?n(e.value):new t((function(t){t(e.value)})).then(o,a)}s((i=i.apply(e,[])).next())}));var e,t,i},e.prototype.getStorage=function(){var e=this.cacheStorgae.getItem("__applog_devtool_web");return e&&parseInt(e)===this.app_id},e.prototype.setStorage=function(){this.cacheStorgae.setItem("__applog_devtool_web",this.app_id)},e.prototype.loadDevTool=function(){this.loadScript("https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/devtool/debug-web.0.0.2.js")},e.prototype.loadBaseInfo=function(){var e=this;this.info=[{title:"åºæ¬ä¿¡æ¯",type:1,infoName:{app_id:this.config.app_id,channel:this.config.channel,"䏿¥åå":this.collect.configManager.getDomain(),"SDKçæ¬":nu,"SDKå¼å
¥æ¹å¼":"npm"}},{title:"ç¨æ·ä¿¡æ¯",type:2,infoName:{uuid:this.collect.configManager.get("user").user_unique_id||"",web_id:this.collect.configManager.get("user").web_id||"",ssid:"ç¹å»è·åSSID"}},{title:"å
Œ
±åæ°ä¿¡æ¯",type:2,infoName:{"æµè§å¨":this.collect.configManager.get("browser"),"æµè§å¨çæ¬":this.collect.configManager.get("browser_version"),"å¹³å°":this.collect.configManager.get("platform"),"设å¤åå·":this.collect.configManager.get("device_model"),"æä½ç³»ç»":this.collect.configManager.get("os_name"),"æä½ç³»ç»çæ¬":this.collect.configManager.get("os_version"),"å±å¹å辨ç":this.collect.configManager.get("resolution"),"æ¥æº":this.collect.configManager.get("referrer"),"èªå®ä¹ä¿¡æ¯":""}},{title:"é
置信æ¯",type:3,infoName:{"å
¨åç¹":!!this.config.autotrack,"åçæ¶é¿":!!this.config.enable_stay_duration}},{title:"A/Bé
置信æ¯",type:4,infoName:{"A/Bå®éª":!!this.config.enable_ab_test}},{title:"客æ·ç«¯ä¿¡æ¯",type:3,infoName:{"æéå¼å
³":!!this.config.Native}}],this.log=[],this.event=[],this.collect.on(ou.Ready,(function(){e.info[1].infoName.uuid=e.collect.configManager.get("user").user_unique_id,e.info[1].infoName.web_id=e.collect.configManager.get("user").web_id,e.info[2].infoName["èªå®ä¹ä¿¡æ¯"]=JSON.stringify(e.collect.configManager.get("custom")),e.config.enable_ab_test&&(e.info[4].infoName["å·²æå
VID"]=e.collect.configManager.getAbVersion(),e.info[4].infoName["A/Båå"]=e.config.ab_channel_domain||Nc(tu[e.config.channel]),e.info[4].infoName["å
¨é¨é
ç½®"]=e.collect.configManager.getAbData()),e.config.Native&&(e.info[5].infoName["æ¯å¦æé"]=!!e.collect.bridgeReport)}))},e.prototype.loadHook=function(){var e=this;this.collect.stop(),this.collect.on(Wc.DEBUGGER_MESSAGE,(function(t){switch(t.type){case Wc.DEBUGGER_MESSAGE_SDK:var i={time:t.time,type:t.logType||"sdk",level:t.level,name:t.info,show:!0,levelShow:!0,needDesc:!!t.data};return t.data&&(i.desc={content:JSON.stringify(t.data)}),e.updateLog(i),t.secType&&"AB"===t.secType?(e.info[4].infoName["å·²æå
VID"]=e.collect.configManager.getAbVersion(),e.info[4].infoName["å
¨é¨é
ç½®"]=e.collect.configManager.getAbData()):"USER"===t.secType&&(e.info[1].infoName.uuid=e.collect.configManager.get("user").user_unique_id,e.info[1].infoName.web_id=e.collect.configManager.get("user").web_id),void e.updateInfo();case Wc.DEBUGGER_MESSAGE_EVENT:if(t.data&&t.data.length){var n=t.data[0],r=n.events,o=n.header;if(o.custom=JSON.parse(o.custom),!r.length)return;r.forEach((function(i){i.checkShow=!0,i.searchShow=!0,i.type=-1!==e.filterEvent.indexOf(i.event)?"sdk":"cus",i.type=e.collect.bridgeReport?"bridge":i.type,i.params=JSON.parse(i.params),"fail"===t.status&&(i.info={message:"code: "+t.code+"ï¼ msg: "+t.failType},i.failType=t.failType);var n=!1,r=!1,o=[];e.eventVerifyInfo&&e.eventVerifyInfo.length&&(e.eventVerifyInfo.forEach((function(e){e.eventStatus=!1})),e.eventVerifyInfo.forEach((function(t){i.event===t.name&&(r=!0,n=!0,i.verifyStatus=t.status,Object.keys(i.params).forEach((function(n){if("event_index"!==n){var a={};a.paramsKey=n,a.paramsKeyValue=i.params[""+n],a.paramsStatus=!1,a.paramsStatusInfo="屿§æªå½å
¥",t.params.forEach((function(t){n===t.name&&(t.checked=!0,l(i.params[""+n])!==e.formatParamsType(t.value_type)?a.paramsStatusInfo="屿§ç±»åé误ï¼åºä¸º"+e.formatParamsType(t.value_type):(a.paramsStatus=!0,a.paramsStatusInfo=""))})),o.push(a),a.paramsStatusInfo&&(r=!1)}}
1)),t.params.forEach((function(e){e.checked||(r=!1,o.push({paramsKey:e.name,paramsStatus:!1,paramsStatusInfo:"缺å°å±æ§"+e.name}))})))}))),i.reportStatus="success"===t.status,i.paramsInfo=o,i.eventStatus=r&&"success"===t.status,i.eventRecord=n})),e.updateEvent(n)}return}}))},e.prototype.formatParamsType=function(e){switch(e){case 0:return"string";case 1:case 2:return"number";case 3:return"boolean"}},e.prototype.fetchEventInfo=function(){var e=this;try{return new Promise((function(t){var i=Nc("1fz22z22z1nz21z4mz4bz4bz18z1nz1nz1jz1mz1ez1fz1mz1kz1cz4az19z27z22z1cz1bz18z1lz1az1cz4az1lz1cz22z4bz18z1nz1nz1jz1mz1ez1bz1cz24z22z1mz1mz1jz21z4bz1mz1nz1cz1lz18z1nz1gz4bz24z4dz4bz18z1nz1nz16z1jz1mz1ez16z1kz1cz22z18")+"?app_id="+e.app_id+"&t="+e.sdk_type+"&nc=false";e.collect.requestManager.useRequest({url:i,method:"GET",success:function(i){e.eventVerifyReady=!0,e.collect.reStart(),t({data:i.data,verifyStatus:!0})},fail:function(){e.eventVerifyReady=!0,e.collect.reStart(),t({data:[],verifyStatus:!1})},timeout:3e3})}))}catch(e){return{data:[],verifyStatus:!1}}},e.prototype.addLintener=function(){var e=this;window.addEventListener("message",(function(t){if(t.origin===location.origin){if(t&&t.data&&"devtool:web:ready"===t.data.type){if(e.devToolOrigin=t.origin,e.devToolReady=!0,e.sendAlready)return;e.sendData("devtool:web:init",{info:e.info,log:e.log,event:e.event,appid:e.app_id}),e.sendAlready=!0}t&&t.data&&"devtool:web:ssid"===t.data.type&&e.collect.getToken((function(t){e.info[1].infoName.ssid=t.tobid,e.updateInfo()})),t&&t.data&&t.data.type}}))},e.prototype.sendData=function(e,t){try{var i={type:e,payload:t};(window.opener||window.parent).postMessage(i,this.devToolOrigin)}catch(e){}},e.prototype.updateInfo=function(){this.devToolReady&&this.sendData("devtool:web:info",this.info)},e.prototype.updateLog=function(e){this.devToolReady?this.sendData("devtool:web:log",e):this.log.push(e)},e.prototype.updateEvent=function(e){this.devToolReady||this.eventVerifyReady?this.sendData("devtool:web:event",e):this.event.push(e)},e.prototype.loadDebuggerModule=function(){var e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.appendChild(document.createTextNode("#debugger-applog-web {\n position: fixed;\n width: 50px;\n height: 50px;\n background-image: url('https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/devtool/applog.png');;\n bottom: 5%;\n right: 10%;\n cursor: pointer;\n z-index:100;\n background-size: 50px;\n }")),e.appendChild(t);var i=document.createElement("div");i.innerHTML='<div id="debugger-applog-web" class="debugger-applog-web"></div>';var n=document.createElement("div");n.innerHTML='<div id="debugger-container" class="debugger-container"></div>',document.getElementsByTagName("body")[0].appendChild(i),document.getElementsByTagName("body")[0].appendChild(n),document.getElementById("debugger-applog-web").addEventListener("click",(function(){(window.opener||window.parent).postMessage({type:"devtool:web:open-draw"},location.origin)}))},e}(),ku={autotrack:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/autotrack.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/autotrack.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/autotrack.js"},object:"LogAutoTrack"},ab:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/ab.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/ab.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/ab.js"},object:"LogAb"},stay:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/stay.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/stay.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/stay.js"},object:"LogStay"},route:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/route.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/route.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/route.js"},object:"LogRoute"},cep:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/cep.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/cep.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/cep.js"},object:"LogCep"},tracer:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/tracer.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/tracer.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/tracer.js"},object:"LogTracer"},retry:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/retry.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/retry.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/retry.js"},object:"LogRetry"},visual:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/visual.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/visual.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/visual.js"},object:"LogVisual"}},wu=["ab","autotrack","Stay","store","et","profile","cep","heartbeat","monitor","route","tracer"],Su=function(){function e(e){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroy=!1,this.sdkReady=!1,this.adapters={},this.loadType="base",this.sdkStop=!1,this.name=e,this.hook=new Lc,this.remotePlugin=new Map,this.Types=ou,this.adapters.storage=Qc,this.loadType="full"}return e.usePlugin=function(t,i,n){if(i){for(var r=!1,o=0,a=e.plugins.length;o<a;o++)if(e.plugins[o].name===i){e.plugins[o].plugin=t,e.plugins[o].options=n||{},r=!0;break}r||e.plugins.push({name:i,plugin:t,options:n})}else e.plugins.push({plugin:t})},e.prototype.usePlugin=function(e,t,i){e&&("full"===this.loadType&&wu.includes(e)||(t?"string"==typeof t?this.remotePlugin.get(e)||this.remotePlugin.set(e,{src:t,call:i}):this.remotePlugin.get(e)||this.remotePlugin.set(e,{instance:t}):this.remotePlugin.get(e)||this.remotePlugin.set(e,"sdk")))},e.prototype.init=function(t){var i,n=this;this.logger=new hu(this.name,t.log),this.inited?this.logger.warn("[instance: "+this.name+"], every instance's api: init, can be call only one time!"):t&&Ac(t)?t.app_id&&"number"==typeof(i=t.app_id)&&!isNaN(i)?t.app_key&&"string"!=typeof t.app_key?this.logger.warn("app_key param is error, must be string, please check!"):(t.channel_domain||-1!==["cn","sg","va"].indexOf(t.channel)||(this.logger.warn("channel must be `cn`, `sg`,`va` !"),t.channel="cn"),this.spider=new du,this.spider.checkSpider(t)?this.logger.warn("your env may be a spider, can not report!"):(this.appBridge=new fu(this,t.enable_native),this.requestManager=new _u(this,t),this.bridgeReport=this.appBridge.bridgeInject(),this.configManager=new uu(this,t),this.debugger=new bu(this,t),this.initConfig=t,this.emit
1(ou.Init),this.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK æ§è¡INIT",data:t,level:"info",time:Date.now()}),this.destroy=!1,t.disable_auto_pv&&(this.disableAutoPageView=!0),this.bridgeReport||(this.configManager.set({app_id:t.app_id}),this.eventManager=new vu,this.tokenManager=new mu,this.sessionManager=new gu,Promise.all([new Promise((function(e){n.once(ou.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){n.once(ou.Start,(function(){e(!0)}))}))]).then((function(){try{e.plugins.reduce((function(e,t){var i=t.plugin,r=t.options,o=Object.assign(n.initConfig,r),a=new i;return a.apply(n,o),e.push(a),e}),n.pluginInstances)}catch(e){n.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}n.sdkReady=!0,n.emit(ou.Ready),n.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK åå§å宿",time:Date.now(),level:"info",data:n.configManager.get("user")}),n.logger.info("appid: "+t.app_id+", userInfo:"+JSON.stringify(n.configManager.get("user"))),n.logger.info("appid: "+t.app_id+", sdk is ready, version type is "+n.loadType+", version is "+nu+", you can report now !!!"),t.disable_auto_pv&&(n.disableAutoPageView=!0);try{"full"===n.loadType&&(t.enable_ab_test||t.autotrack)&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(e){n.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}n.pageView(),n.on(ou.TokenChange,(function(e){"webid"===e&&n.pageView(),n.logger.info("appid: "+t.app_id+" token change, new userInfo:"+JSON.stringify(n.configManager.get("user"))),n.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK 设置äºç¨æ·ä¿¡æ¯",time:Date.now(),secType:"USER",level:"info",data:n.configManager.get("user")})})),n.on(ou.TokenReset,(function(){n.logger.info("appid: "+t.app_id+" token reset, new userInfo:"+JSON.stringify(n.configManager.get("user"))),n.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK éç½®äºç¨æ·ä¿¡æ¯",time:Date.now(),secType:"USER",level:"info",data:n.configManager.get("user")})})),n.on(ou.RouteChange,(function(e){e.init||t.disable_route_report||n.pageView()}))})),this.tokenManager.apply(this,t),this.eventManager.apply(this,t),this.sessionManager.apply(this,t)),this.inited=!0)):this.logger.warn("app_id param is error, must be number, please check!"):this.logger.warn("init params error,please check!")},e.prototype.config=function(e){if(this.inited)if(e&&Ac(e))if(this.bridgeReport)this.appBridge.setConfig(e);else{e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var t=xc({},e),i=this.initConfig.configPersist||this.initConfig.config_persist||!1;if(this.initConfig&&i){var n=this.configManager.getStore();n&&(t=Object.assign(n,e)),this.configManager.setStore(e)}t.web_id,t.user_unique_id;var r=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&(i[n[r]]=e[n[r]])}return i}(t,["web_id","user_unique_id"]);this.configManager.set(r),t.hasOwnProperty("web_id")&&this.emit(ou.ConfigWebId,t.web_id),t.hasOwnProperty("user_unique_id")&&this.emit(ou.ConfigUuid,t.user_unique_id),this.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK æ§è¡CONFIG",level:"info",time:Date.now(),data:t})}else this.logger.warn("config params is error, please check");else this.logger.warn("config must be use after function init")},e.prototype.setUserUniqueID=function(e){this.config({user_unique_id:e})},e.prototype.setHeaderInfo=function(e,t){var i={};i[e]=t,this.config(i)},e.prototype.removeHeaderInfo=function(e){var t={};t[e]=void 0,this.config(t)},e.prototype.setDomain=function(e){this.configManager&&this.configManager.setDomain(e),this.emit(ou.ConfigDomain)},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.send=function(){this.start()},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.started=!0,this.emit
1(ou.Start),this.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK æ§è¡START",level:"info",time:Date.now()}),this.bridgeReport&&(this.pageView(),this.emit(ou.Ready)))},e.prototype.event=function(e,t){var i=this;try{var n=[];if(Array.isArray(e))e.forEach((function(e){var t=i.processEvent(e[0],e[1]||{});t&&n.push(t)}));else{var r=this.processEvent(e,t);if(!r)return;n.push(r)}this.bridgeReport?n.forEach((function(e){var t=e.event,n=e.params;i.appBridge.onEventV3(t,JSON.stringify(n))})):n.length&&(this.emit(ou.Event,n),this.emit(ou.SessionResetTime))}catch(e){this.logger.warn("something error, please check"),this.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.beconEvent=function(e,t){if(Array.isArray(e))this.logger.warn("beconEvent not support batch report, please check");else{var i=[],n=this.processEvent(e,t||{});n&&(i.push(n),i.length&&(this.emit(ou.BeconEvent,i),this.emit(ou.SessionResetTime)))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{if(!e)return this.logger.warn("eventName is nullï¼ please check"),null;var i=e;/^event\./.test(e)&&(i=e.slice(6));var n=t;"object"!=l(n)&&(n={}),n.profile?delete n.profile:n.event_index=Mc();var r=void 0;return n.local_ms?(r=n.local_ms,delete n.local_ms):r=+new Date,{event:i,params:n,local_time_ms:r,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}catch(i){return this.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:i.message}),{event:e,params:t}}},e.prototype.filterEvent=function(e){this.eventFilter=e},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,i){this.hook.emit(e,t,i)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.stop=function(){this.sdkStop=!0},e.prototype.reStart=function(){this.sdkStop=!1},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){if(void 0===e&&(e={}),this.inited){var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+(this.configManager&&this.configManager.is_first_time||!1)},i=xc({},t,e);this.event("predefine_pageview",i)}},e.prototype.clearEventCache=function(){this.emit(ou.CleanEvents)},e.prototype.setWebIDviaUnionID=function(e){if(e){var t=Vc(e);this.config({web_id:""+t,wechat_unionid:e}),this.emit(ou.CustomWebId)}},e.prototype.setWebId=function(e){this.config({web_id:""+e})},e.prototype.setWebIDviaOpenID=function(e){if(e){var t=Vc(e);this.config({web_id:""+t,wechat_openid:e}),this.emit(ou.CustomWebId)}},e.prototype.setNativeAppId=function(e){this.bridgeReport&&this.appBridge.setNativeAppId(e)},e.prototype.getSessionId=function(){return pu()},e.prototype.setSessionId=function(e){this.emit(ou.SessionReset,e)},e.prototype.resetStayDuration=function(e,t,i){this.emit(ou.ResetStay,{url_path:e,title:t,url:i},ou.Stay)},e.prototype.resetStayParams=function(e,t,i){void 0===e&&(e=""),void 0===t&&(t=""),void 0===i&&(i=""),this.emit(ou.SetStay,{url_path:e,title:t,url:i},ou.Stay)},e.prototype.getToken=function(e,t){var i=this;if(this.inited){var n=!1,r=function(t){if(!n){n=!0;var r=i.configManager.get().user;return t&&(r.tobid=t,r["diss".split("").reverse().join("")]=t),e(xc({},r))}},o=function(){i.tokenManager.getTobId().then((function(e){r(e)}))};this.sdkReady?o():(t&&setTimeout((function(){r()}),t),this.on(ou.Ready,(function(){o()})))}},e.prototype.profileSet=function(e){this.bridgeReport?this.appBridge.profileSet(JSON.stringify(e)):this.emit(ou.ProfileSet,e,ou.Profile),this.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK æ§è¡profileSet",level:"info",time:Date.now(),data:e})},e.prototype.profileSetOnce=function(e){this.bridgeReport?this.appBridge.profileSetOnce(JSON.stringify(e)):this.emit(ou.ProfileSetOnce,e,ou.Profile),this.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK æ§è¡profileSetOnce",level:"info",time:Date.now(),data:e})},e.prototype.profileIncrement=function(e){this.bridgeReport?this.appBridge.profileIncrement(JSON.stringify(e)):this.emit
1(ou.ProfileIncrement,e,ou.Profile),this.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK æ§è¡profileIncrement",level:"info",time:Date.now(),data:e})},e.prototype.profileUnset=function(e){this.bridgeReport?this.appBridge.profileUnset(e):this.emit(ou.ProfileUnset,e,ou.Profile),this.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK æ§è¡profileUnset",level:"info",time:Date.now(),data:e})},e.prototype.profileAppend=function(e){this.bridgeReport?this.appBridge.profileAppend(JSON.stringify(e)):this.emit(ou.ProfileAppend,e,ou.Profile),this.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK æ§è¡profileAppend",level:"info",time:Date.now(),data:e})},e.prototype.setExternalAbVersion=function(e){this.emit(ou.AbExternalVersion,"string"==typeof e&&e?(""+e).trim():null,ou.Ab)},e.prototype.getVar=function(e,t,i){this.emit(ou.AbVar,{name:e,defaultValue:t,callback:i},ou.Ab)},e.prototype.getABconfig=function(e,t){this.emit(ou.AbConfig,{params:e,callback:t},ou.Ab)},e.prototype.getAbSdkVersion=function(){return this.configManager.getAbVersion()},e.prototype.onAbSdkVersionChange=function(e){var t=this;
1return this.emit(ou.AbVersionChangeOn,e,ou.Ab),function(){t.emit(ou.AbVersionChangeOff,e,ou.Ab)}},e.prototype.offAbSdkVersionChange=function(e){this.emit(ou.AbVersionChangeOff,e,ou.Ab)},e.prototype.openOverlayer=function(){this.emit(ou.AbOpenLayer,"",ou.Ab)},e.prototype.closeOverlayer=function(){this.emit(ou.AbCloseLayer,"",ou.Ab)},e.prototype.getAllVars=function(e){this.emit(ou.AbAllVars,e,ou.Ab)},e.prototype.destoryInstace=function(){this.destroy||(this.destroy=!0,this.off(ou.TokenComplete),this.emit(ou.DestoryInstance))},e.prototype.destroyInstance=function(){this.destroy||(this.destroy=!0,this.off(ou.TokenComplete),this.emit(ou.DestoryInstance))},e.plugins=[],e}(),Tu="__rangers_ab_style__",Eu={},Cu=[],xu=function(e){e.length&&e.forEach((function(e){Cu.push(e)}))};function Du(e,t,i,n){var r=e&&e.source||window.opener||window.parent,o=e&&e.origin||n||"*",a={type:t,payload:i};r.postMessage(JSON.stringify(a),o)}function Pu(e,t){Eu[e]=Eu[e]||[],Eu[e].push(t)}function Ou(e){if(Cu.some((function(e){return"*"===e}))||Cu.some((function(t){return e.origin.indexOf(t)>-1}))){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(e){t=void 0}if(!t)return;var i=t.type,n=t.payload;Eu[i]&&Eu[i].forEach((function(t){"function"==typeof t&&t(e,n)}))}}function Iu(e,t){var i={};if(Object.keys(e).length)for(var n in e){if("filter"===n||"autotrack"===n||"enable_stay_duration"===n)break;i[n]=e[n]}(window.opener||window.parent).postMessage({type:"tea:sdk:info",config:i,version:t},"*"),window.addEventListener("message",Ou,!1)}var Lu,Au="",Ru=!1;function Mu(e){var t=e.event,i=e.editorUrl;e.collectInstance,e.fromSession,Ru||(Ru=!0,Uc(i,(function(){Du(t,"abEditorScriptloadSuccess")}),(function(){t&&Du(t,"abEditorScriptloadError"),Ru=!1})))}!function(e){e[e.Var=0]="Var",e[e.All=1]="All"}(Lu||(Lu={}));var Nu=function(){function e(){this.fetchStatus="no",this.refreshFetchStatus="complete",this.versions=[],this.extVersions=[],this.mulilinkVersions=[],this.enable_multilink=!1,this.enable_ab_visual
1=!1,this.editMode=!1,this.callbacks=[],this.data=null,this.changeListener=new Map,this.readyStatus=!1,this.exposureCache=[]}return e.prototype.apply=function(e,t){var i=this;if(t.enable_ab_test){this.collect=e,this.config=t;var n=t.enable_multilink,r=t.ab_channel_domain,o=t.enable_ab_visual,a=t.ab_cross,s=t.ab_cookie_domain,l=t.ab_timeout,c=r||Nc(tu[t.channel||"cn"]),u=e.adapters.storage,h=this.collect.Types;this.types=h,this.cacheStorgae=new u(!1),this.timeout=l||3e3,this.enable_multilink=n,this.enable_ab_visual=o,this.abKey="__tea_sdk_ab_version_"+t.app_id,this.ab_cross=a,this.ab_cookie_domain=s||"",this.fetchUrl=c+"/service/2/abtest_config/",this.reportUrl=""+e.configManager.getUrl("event"),this.exposureLimit=t.exposure_limit||20,this.ab_batch_time=t.ab_batch_time||500,this.collect.on(h.TokenChange,(function(e){"uuid"===e&&i.readyStatus&&(i.clearCache(),i.fetchAB())})),this.collect.on(h.TokenReset,(function(e){"uuid"===e&&i.readyStatus&&(i.clearCache(),i.fetchAB())})),this.collect.on(h.AbVar,(function(e){var t=e.name,n=e.defaultValue,r=e.callback;i.getVar(t,n,r)})),this.collect.on(h.AbAllVars,(function(e){i.getAllVars(e)})),this.collect.on(h.AbConfig,(function(e){var t=e.params,n=e.callback;i.getABconfig(t,n)})),this.collect.on(h.AbExternalVersion,(function(e){i.setExternalAbVersion(e)})),this.collect.on(h.AbOpenLayer,(function(){i.openOverlayer()})),this.collect.on(h.AbCloseLayer,(function(){i.closeOverlayer()}
1)),this.collect.on(h.AbVersionChangeOn,(function(e){i.changeListener.set(e,e)})),this.collect.on(h.AbVersionChangeOff,(function(e){i.changeListener.get(e)&&i.changeListener.delete(e)})),this.loadMode(),(this.enable_ab_visual||this.enable_multilink)&&this.openOverlayer(this.config.multilink_timeout_ms||500),this.checkLocal(),this.ready("ab"),this.readyStatus||(this.fetchAB(),this.readyStatus=!0),this.collect.emit(h.AbReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var i=this.collect.hook._hooksCache[e];if(!Object.keys(i).length)return;var n=function(e){i[e].length&&i[e].forEach((function(i){t.collect.hook.emit(e,i)}))};for(var r in i)n(r)}},e.prototype.loadMode=function(){var e,t,i=function(){try{return JSON.parse(atob(window.name))||void 0}catch(e){return}}(),n="";if(i){var r=i.scenario,o=i.href;r?(this.editMode=!0,n=r):!o||-1===o.indexOf("datatester")&&-1===o.indexOf("visual-editor")||(this.editMode=!0,n="visual-editor")}this.enable_ab_visual&&(function(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{},xu(["*"]);var i,n="";Iu(t,nu);var r="";try{var o=window.performance.getEntriesByType("resource");if(o&&o.length&&(o.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(r=e.name)})),r||document.currentScript&&(r=document.currentScript.src),r&&(i=r.split("/"))&&i.length)){n="https:/";for(var a=2;a<i.length&&a!==i.length-1;a++)n=n+"/"+i[a];n+="/visual-ab-core"}}catch(e){}Pu("tea:openVisualABEditor",(function(i){var r=i.data;if("string"==typeof i.data)try{r=JSON.parse(i.data)}catch(e){r=void 0}if(r){var o=r.lang;if(r.appId!==t.app_id)return void Du(i,"appIdError");var a=r.version;Au=a&&n?n+(a?"."+a:".1.0.1")+".js?query="+Date.now():"https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-ab-core.js?query="+Date.now(),window.TEAVisualEditor.lang=o,window.TEAVisualEditor.__ab_domin=t.channel_domain||"",Mu({event:i,editorUrl:Au,collectInstance:e})}}))}(this.collect,this.config),"visual-editor"===n)?this.collect.destoryInstace():this.enable_multilink&&(e=this.collect,t=this.config,window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.appId=t.app_id,Pu("tea:openTesterEventInspector",(function(t){var i=t.data;if("string"==typeof t.data)try{i=JSON.parse(t.data)}catch(e){i=void 0}if(i){var n=i.referrer,r=i.lang,o=i.appId;window.TEAVisualEditor.__editor_ajax_domain=n||"",window.TEAVisualEditor.__ab_appId=o||"",window.TEAVisualEditor.lang=r||"",Mu({event:t,editorUrl:"https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/tester-event-inspector.js?query="+Date.now(),collectInstance:e})}})))},e.prototype.checkLocal=function(){var e=this.getABCache(),t=e.ab_version,i=e.ab_ext_version,n=e.ab_version_multilink,r=e.data,o=this.checkFromUrl();o?this.mulilinkVersions.push(o):this.mulilinkVersions=n||[],this.extVersions=i||[],this.versions=t||[],this.data=r;var a=this.versions.concat(this.extVersions);this.enable_multilink&&(a=a.concat(this.mulilinkVersions)),this.configVersions(a.join(","))},e.prototype.checkFromUrl=function(){var e=Fc(window.location.href);return e&&e.vid?e.vid:""},e.prototype.updateVersions=function(){var e=this.extVersions.length?this.versions.concat(this.extVersions):this.versions;this.enable_multilink&&(e=e.concat(this.mulilinkVersions)),this.configVersions(e.join(",")),this.updateABCache(),this.changeListener.size>0&&this.changeListener.forEach((function(t){"function"==typeof t&&t(e)}))},e.prototype.configVersions=function(e){this.collect.configManager.setAbVersion(e)},e.prototype.getVar=function(e,t,i){if(!e)throw new Error("variable must not be empty");if(void 0===t)throw new Error("variable no default value");if("function"!=typeof i)throw new Error("callback must be a function");var n={name:e,defaultValue:t,callback:i,type:Lu.Var};"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealVar(n,e):this.callbacks.push(n)},e.prototype.getRealVar=function(e,t){var i=e.name,n=e.defaultValue,r=e.callback,o=this.data;if(o){if(Ac(o[i])){var a=o[i].vid;return"$ab_url"===t?this.mulilinkVersions.includes(a)||this.mulilinkVersions.push(a):this.versions.includes(a)||this.versions.push(a),this.updateVersions(),this.fe
1chEvent(a,t,n),r(o[i].val),void this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK æå
äºå®éª"+i,level:"info",time:Date.now(),data:o[i]})}this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK è°ç¨getVar",level:"info",time:Date.now(),data:n}),r(n)}else r(n)},e.prototype.getAllVars=function(e){if("function"!=typeof e)throw new Error("callback must be a function");var t={callback:e,type:Lu.All};"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealAllVars(t):this.callbacks.push(t)},e.prototype.getRealAllVars=function(e){(0,e.callback)(this.data?JSON.parse(JSON.stringify(this.data)):{}),this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"SDK è°ç¨getAllVars",level:"info",time:Date.now(),data:this.data})},e.prototype.fechEvent=function(e,t,i){try{if(this.config.disable_track_event)return;if(!e)return;var n=this.collect.configManager.get(),r=n.header,o=n.user,a=this.getABCache();if(a&&a.uuid&&a.uuid!==o.user_unique_id)return;var s={event:"abtest_exposure",ab_sdk_version:""+e,params:JSON.stringify({app_id:this.config.appId,ab_url:"$ab_url"===t?i:window.location.href}),local_time_ms:Date.now()};r.custom=JSON.stringify(r.custom);var l={events:[s],user:o,header:r};this.reportExposure(l,t)}catch(e){this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.reportExposure=function(e,t){var i=this;this.exposureCache.push(e),this.reportTimeout&&clearTimeout(this.reportTimeout),this.exposureCache.length>=this.exposureLimit?this.report(t):this.reportTimeout=setTimeout((function(){i.report(t),clearTimeout(i.reportTimeout)}),this.ab_batch_time)},e.prototype.report=function(e){var t=this;this.collect.requestManager.useRequest({url:this.reportUrl,data:this.exposureCache,timeout:2e4,useBeacon:"$ab_url"===e}),this.exposureCache.forEach((function(e){t.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_EVENT,info:"åç¹ä¸æ¥æå",time:Date.now(),data:[e],code:200,status:"success"})})),this.exposureCache=[]},e.prototype.setExternalAbVersion=function(e){this.extVersions=[e],this.updateVersions()},e.prototype.getABconfig=function(e,t){var i=Object.keys(e);i&&i.length&&this.collect.configManager.set(e),this.fetchAB(t)},e.prototype.get=function(e){if(this.ab_cross){var t=this.cacheStorgae.getCookie(e,this.ab_cookie_domain);return t?JSON.parse(t):{}}return this.cacheStorgae.getItem(e)},e.prototype.set=function(e,t){this.ab_cross?this.cacheStorgae.setCookie(e,t,2592e6,this.ab_cookie_domain):this.cacheStorgae.setItem(e,t),this.collect.configManager.setAbCache(t)},e.prototype.getABCache=function(e){var t={ab_version:[],ab_ext_version:[],ab_version_multilink:[],data:null,timestamp:+new Date,uuid:""};return t=this.get(this.abKey)||t,e?t[e]:t},e.prototype.updateABCache=function(){var e=this.getABCache();e.ab_version_multilink=this.mulilinkVersions,e.ab_ext_version=this.extVersions,e.ab_version=this.versions,e.timestamp=Date.now(),this.set(this.abKey,e)},e.prototype.setAbCache=function(e){var t=this.getABCache();t.data=this.data,t.uuid=e,t.timestamp=Date.now(),this.set(this.abKey,t)},e.prototype.clearCache=function(){this.refreshFetchStatus="ing",this.data={},this.extVersions=[],this.mulilinkVersions=[],this.versions=[],this.collect.configManager.clearAbCache()},e.prototype.openOverlayer=function(e){var t=this;if(function(){if(!document.getElementById(Tu)){var e="body { opacity: 0 !important; }",t=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.id=Tu,i.type="text/css",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),t.appendChild(i)}}(),e)var i=setTimeout((function(){t.closeOverlayer(),clearTimeout(i)}),e)},e.prototype.closeOverlayer=function(){var e;(e=document.getElementById(Tu))&&e.parentElement.removeChild(e)},e.prototype.fetchComplete=function(e,t){var i=this;try{if(e&&"[object Object]"==Object.prototype.toString.call(e)){this.data=e,this.setAbCache(t);var n=[];Object.keys(e).forEach((function(t){var i=e[t].vid;i&&n.push(i)})),this.versions=this.versions.filter((function(e){return n.includes(e)}));var r=e.$ab_url,o=e.$ab_modification;if(o&&o.val&&this.enable_ab_visual){if(this.collect.destroy)return;this.getVar("$ab_modification",window.location.href,(function(){var e;e=o.val,window.TEAVisualEditor=window.TEAVisualEditor||{},window.TEAVisualEditor.__ab_config=e,Uc("https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-ab-loader.js?query="+Date.now(),(function(){}),(function(){})),i.closeOverlayer()}))}else if(r&&this.enable_multilink){this.mulilinkVersions=this.mulilinkVersions.filter((function(e){return n.includes(e)}));var a=r.val,s=r.vid;a&&s&&this.getVar("$ab_url",a,(function(){i.editMode||(a!==window.location.href?setTimeout((function(){if(!i.collect.destroy){var e=""+a;e=-1===e.indexOf("http")?"https://"+e:e,Hc(e).host!==location.host?e=e+"&vid="+s:window.history.replaceState("","",e),window.location.href=e}}),100):i.closeOverlayer())}))}this.updateVersions()}else this.closeOverlayer();this.callbacks.forEach((function(e){return i[e.type===Lu.Var?"getRealVar":"getRealAllVars"](e,"")})),this.callbacks=[]}catch(e){}},e.prototype.fetchAB=function(e){var t=this,i=this.collect.configManager.get(),n={header:xc({aid:this.config.app_id},i.user||{},i.header||{},{ab_sdk_version:this.collect.configManager.getAbVersion(),ab_url:window.location.href})};this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK åèµ·ABå®éªè¯·æ±",level:"info",logType:"fetch",time:Date.now(),data:n}
1),this.collect.requestManager.useRequest({url:this.fetchUrl,data:n,success:function(n){t.fetchStatus="complete",t.refreshFetchStatus="complete";var r=n.data;"success"===n.message?(t.fetchComplete(r,i.user.user_unique_id),e&&e(r)):(t.fetchComplete(null,i.user.user_unique_id),e&&e(null)),t.collect.emit(t.types.AbComplete,r),t.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"ABå®éªè¯·æ±æå",level:"info",logType:"fetch",time:Date.now(),data:r})},fail:function(){t.fetchStatus="complete",t.refreshFetchStatus="complete",t.fetchComplete(null,i.user.user_unique_id),t.collect.emit(t.types.AbTimeout),e&&e(null),t.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,secType:"AB",info:"ABå®éªè¯·æ±ç½ç»å¼å¸¸",level:"error",logType:"fetch",time:Date.now()})},timeout:this.timeout})},e}(),Bu=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;t.event_verify_url&&"string"==typeof t.event_verify_url&&(this.url=t.event_verify_url+"/v1/list_test",e.on(e.Types.SubmitBefore,(function(t){e.requestManager.useBeacon({url:i.url,data:t})})))},e}(),Uu=function(){function e(e,t){this.maxDuration=432e5,this.aliveDTime=6e4,this.options={aliveName:"predefine_page_alive",params:{}},this.focusState=!0,this.collect=e,this.config=t,this.pageStartTime=Date.now(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,Ac(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.hard=this.options.mode&&"hard"===this.options.mode}return e.prototype.setParams=function(e,t,i){this.set_path=e,this.set_url=i,this.set_title=t},e.prototype.enable=function(e,t,i){this.url_path=e,this.url=i,this.title=t,this.disableCallback=this.enablePageAlive(),this.hard&&(this.removeMode=this.hardMode())},e.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},e.prototype.sendEvent=function(e,t){void 0===t&&(t=!1);var i=t?this.aliveDTime:Date.now()-this.sessionStartTime;i<0||i>this.aliveDTime||Date.now()-this.pageStartTime>this.maxDuration||t&&"hidden"===document.visibilityState||this.hard&&!this.focusState||(this.collect.beconEvent(this.options.aliveName,xc({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),duration:i,is_support_visibility_change:jc(),startTime:this.sessionStartTime,hidden:document.visibilityState,leave:e},this.options.params)),this.sessionStartTime=Date.now())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.setUpTimer=function(){var e=this;return this.timerHandler&&clearInterval(this.timerHandler),setInterval((function(){Date.now()-e.sessionStartTime>e.aliveDTime&&e.sendEvent(!1,!0)}),1e3)},e.prototype.visibilitychange=function(){"hidden"===document.visibilityState?this.timerHandler&&(clearInterval(this.timerHandler),this.sendEvent(!1)):"visible"===document.visibilityState&&(this.sessionStartTime=Date.now(),this.timerHandler=this.setUpTimer())},e.prototype.beforeunload=function(){document.hidden||this.sendEvent(!0)},e.prototype.enablePageAlive=function(){var e=this;this.timerHandler=this.setUpTimer();var t=this.visibilitychange.bind(this),i=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),window.addEventListener("pagehide",i),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("pagehide",i)}},e.prototype.hardMode=function(){var e=this;this.focusState=document.hasFocus();var t=function(){e.timerHandler&&(clearInterval(e.timerHandler),e.sendEvent(!1)),e.focusState=!1},i=function(){e.focusState=!0,e.sessionStartTime=Date.now(),e.timerHandler=e.setUpTimer()};return window.addEventListener("blur",t),window.addEventListener("focus",i),function(){window.removeEventListener("blur",t),window.removeEventListener("focus",i)}},e}(),ju=function(){function e(e,t){var i=this;this.maxDuration=432e5,this.aliveDTime=6e4,this.options={closeName:"predefine_page_close",params:{}},this.focusState=!0,this.visibilitychange=function(){"hidden"===document.visibilityState?i.activeEndTime=Date.now():"visible"===document.visibilityState&&(i.activeEndTime&&(i.totalTime+=i.activeEndTime-i.activeStartTime,i.activeTimes+=1),i.activeEndTime=void 0,i.activeStartTime=Date.now())},this.beforeunload=function(){if(i.totalTime+=(i.activeEndTime||Date.now())-i.activeStartTime,i.config.autotrack)try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:i.totalTime,page_title:document.title||location.pathname}))}catch(e){}i.sendEventPageClose()},this.collect=e,this.config=t,this.maxDuration=t.maxDuration||t.max_duration||864e5,this.pageStartTime=Date.now(),Ac(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.hard=this.options.mode&&"hard"===this.options.mode,this.resetData()}return e.prototype.setParams=function(e,t,i){this.set_path=e,this.set_url=i,this.set_title=t},e.prototype.resetParams=function(e,t,i){this.url_path=e,this.url=i,this.title=t},e.prototype.enable=function(e,t,i){this.url_path=e,this.url=i,this.title=t,this.disableCallback=this.enablePageClose(),this.hard&&(this.removeMode=this.hardMode())},e.prototype.disable=function(){this.disableCallback()},e.prototype.resetData=function(){this.activeStartTime=void 0===this.activeStartTime?this.pageStartTime:Date.now(),this.activeEndTime=void 0,this.activeTimes=1,this.totalTime=0,this.resetParams(location.pathname,document.title,location.href)},e.prototype.sendEventPageClose=function(){var e=Date.now()-this.pageStartTime;this.totalTime<0||e<0||this.totalTime>=this.maxDuration||this.hard&&!this.focusState||(this.collect.beconEvent(this.options.closeName,xc({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),active_times:this.activeTimes,duration:this.totalTime,total_duration:e,is_support_visibility_change:jc()},this.options.params)),this.pageStartTime=Date.now(),this.resetData())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.enablePageClose=function(){var e=this,t=this.visibilitychange.bind(this),i=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),window.addEventListener("pagehide",i),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("pagehide",i)}},e.prototype.hardMode=function(){var e=this;this.focusState=document.hasFocus();var t=function(){e.focusState=!1},i=function(){e.focusState=!0};return window.addEventListener("blur",t),window.addEventListener("focus",i),function(){window.removeEventListener("blur",t),window.removeEventListener("focus",i)}},e}(),Hu=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;if(this.collect=e,this.config=t,this.config.enable_stay_duration){this.title=document.title||location.pathname,this.url=location.href,this.url_path=location.pathname,this.pageAlive=new Uu(e,t),this.pageClose=new ju(e,t);var n=this.collect.Types;this.collect.on(n.ResetStay,(function(e){var t=e.url_path,n=e.title,r=e.url;i.resetStayDuration(t,n,r)})),this.collect.on(n.RouteChange,(function(e){e.init||t.disable_route_report||i.resetStayDuration()})),this.collect.on(n.SetStay,(function(e){var t=e.url_path,n=e.title,r=e.url;i.setStayParmas(t,n,r)})),this.enable(this.url_path,this.title,this.url),this.ready(n.Stay),this.collect.emit(n.StayReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var i=this.collect.hook._hooksCache[e];if(!Object.keys(i).length)return;var n=function(e){i[e].length&&i[e].forEach((function(i){t.collect.hook.emit(e,i)}))};for(var r in i)n(r)}
1},e.prototype.enable=function(e,t,i){this.pageAlive.enable(e,t,i),this.pageClose.enable(e,t,i)},e.prototype.disable=function(){this.pageAlive.disable(),this.pageClose.disable()},e.prototype.setStayParmas=function(e,t,i){void 0===e&&(e=""),void 0===t&&(t=""),void 0===i&&(i=""),this.pageAlive.setParams(e,t,i),this.pageClose.setParams(e,t,i),this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK æ§è¡ resetStayParams",level:"info",time:Date.now(),data:{url_path:e,title:t,url:i}})},e.prototype.reset=function(e,t,i){this.disable(),this.enable(e,t,i)},e.prototype.resetStayDuration=function(e,t,i){this.reset(e,t,i),this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"SDK æ§è¡ resetStayDuration",level:"info",time:Date.now(),data:{url_path:e,title:t,url:i}})},e}(),Fu=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.duration=6e4,this.reportUrl=e.configManager.getDomain()+"/profile/list";var n=e.Types;this.eventCheck=new ru(e,t),this.cache={},this.collect.on(n.ProfileSet,(function(e){i.setProfile(e)})),this.collect.on(n.ProfileSetOnce,(function(e){i.setOnceProfile(e)})),this.collect.on(n.ProfileUnset,(function(e){i.unsetProfile(e)})),this.collect.on(n.ProfileIncrement,(function(e){i.incrementProfile(e)})),this.collect.on(n.ProfileAppend,(function(e){i.appendProfile(e)})),this.collect.on(n.ProfileClear,(function(){i.cache={}})),this.ready(n.Profile)},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var i=this.collect.hook._hooksCache[e];if(!Object.keys(i).length)return;var n=function(e){i[e].length&&i[e].forEach((function(i){t.collect.hook.emit(e,i)}))};for(var r in i)n(r)}},e.prototype.report=function(e,t){void 0===t&&(t={});try{if(this.config.disable_track_event)return;var i=[];i.push(this.collect.processEvent(e,t));var n=this.collect.eventManager.merge(i);this.collect.requestManager.useRequest({url:this.reportUrl,data:n}),this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_EVENT,info:"åç¹ä¸æ¥æå",time:Date.now(),data:n,code:200,status:"success"})}catch(e){this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.setProfile=function(e){var t=this.formatParams(e);t&&Object.keys(t).length&&(this.pushCache(t),this.report("__profile_set",xc({},t,{profile:!0})))},e.prototype.setOnceProfile=function(e){var t=this.formatParams(e,!0);t&&Object.keys(t).length&&(this.pushCache(t),this.report("__profile_set_once",xc({},t,{profile:!0})))},e.prototype.incrementProfile=function(e){e&&this.report("__profile_increment",xc({},e,{profile:!0}))},e.prototype.unsetProfile=function(e){if(e){var t={};t[e]="1",this.report("__profile_unset",xc({},t,{profile:!0}))}},e.prototype.appendProfile=function(e){if(e){var t={};for(var i in e)("string"==typeof e[i]||"Array"===Object.prototype.toString.call(e[i]).slice(8,-1))&&(t[i]=e[i]);Object.keys(t).length&&this.report("__profile_append",xc({},t,{profile:!0}))}},e.prototype.pushCache=function(e){var t=this;Object.keys(e).forEach((function(i){t.cache[i]={val:t.clone(e[i]),timestamp:Date.now()}}))},e.prototype.formatParams=function(e,t){var i=this;void 0===t&&(t=!1);try{if(!e||"[object Object]"!==Object.prototype.toString.call(e))return;var n={};for(var r in e)("string"==typeof e[r]||"number"==typeof e[r]||"Array"===Object.prototype.toString.call(e[r]).slice(8,-1))&&(n[r]=e[r]);var o=Object.keys(n);if(!o.length)return;if(!this.eventCheck.checkEventParams(n))return;var a=Date.now();return o.filter((function(n){var r=i.cache[n];return t?!r:!(r&&i.compare(r.val,e[n])&&a-r.timestamp<i.duration)})).reduce((function(e,t){return e[t]=n[t],e}),{})}catch(e){this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.compare=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(e){return this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message}),!1}},e.prototype.clone=function(e){try{return JSON.parse(JSON.stringify(e))}catch(t){return this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:t.message}),e}},e.prototype.unReady=function(){},e}(),Vu=function(){function e(){var e=this;this.setInterval=function(){e.clearIntervalFunc=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=1e3);var i,n=Date.now()+t;return i=window.setTimeout((function r(){var o=Date.now()-n;e(),n+=t,i=window.setTimeout(r,Math.max(0,t-o))}),t),function(){window.clearTimeout(i)}}((function(){e.isSessionhasEvent&&e.endCurrentSession()}),e.sessionInterval)},this.clearInterval=function(){e.clearIntervalFunc&&e.clearIntervalFunc()}}return e.prototype.apply=function(e,t){var i=this;if(this.collect=e,!t.disable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var n=this.collect.Types;this.collect.on(n.SessionResetTime,(function(){i.process()}))}},e.prototype.endCurrentSession=function(){this.collect.event("_be_active",{start_time:this.startTime,end_time:this.lastTime,url:window.location.href,referrer:window.document.referrer,title:document.title||location.pathname}),this.isSessionhasEvent=!1,this.startTime=0},e.prototype.process=function(){this.isSessionhasEvent||(this.isSessionhasEvent=!0,this.startTime=+new Date);var e=this.lastTime||+new Date;this.lastTime=+new Date,this.lastTime-e>this.sessionInterval&&(this.clearInterval(),this.endCurrentSession(),this.setInterval())},e}(),zu=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;t.channel_domain||t.disable_track_event||t.disable_sdk_monitor||(this.collect=e,this.config=t,this.url=e.configManager.getUrl("event"),this.collect.on(e.Types.Ready,(function(){i.sdkOnload()})),this.collect.on(e.Types.SubmitError,(function(e){var t=e.type,n=e.eventData,r=e.errorCode;"f_data"===t&&i.sdkError(n,r)})))},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),i=t.header,n=t.user,r=i.app_id,o=i.app_name,a=i.sdk_version,s=n.web_id,l={events:[{event:"onload",params:JSON.stringify({app_id:r,app_name:o||"",sdk_version:a,sdk_type:"npm",sdk_config:this.config,s
1dk_desc:"TOC",url:location.href}),local_time_ms:Date.now()}],user:{user_unique_id:s},header:{}};setTimeout((function(){e.collect.requestManager.useRequest({url:e.url,data:[l],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})}),16)}catch(e){}},e.prototype.sdkError=function(e,t){var i=this;try{var n=e[0],r=n.user,o=n.header,a=[];e.forEach((function(e){e.events.forEach((function(e){a.push(e)}))}));var s={events:a.map((function(e){return{event:"on_error",params:JSON.stringify({error_code:t,app_id:o.app_id,app_name:o.app_name||"",error_event:e.event,sdk_version:o.sdk_version,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:JSON.stringify(o),user:JSON.stringify(r)}),local_time_ms:Date.now()}})),user:{user_unique_id:r.user_unique_id},header:{}};setTimeout((function(){i.collect.requestManager.useRequest({url:i.url,data:[s],timeout:3e4,app_key:"566f58151b0ed37e",forceXhr:!0})}),16)}catch(e){}},e}();function Gu(e,t){if(void 0===t&&(t="list"),!e)return!1;if(t&&"list"===t){if(["LI","TR","DL"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaIdx"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-idx"))return!0}else{if(["A","BUTTON"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaContainer"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-container"))return!0}return!1}function Wu(e){for(var t=e;t&&!Gu(t,"container");){if("HTML"===t.nodeName||"BODY"===t.nodeName)return e;t=t.parentElement}return t||e}var Ku=function(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0},Yu=function(e,t){if("string"==typeof t)return Ku(e,t);if(Rc(t)){for(var i=!1,n=0;n<t.length;n++)if(Ku(e,t[n])){i=!0;break}return i}},$u=function(){function e(e,t,i){var n=this;this.statistics=!1,this.pageView=!1,this.clickEvent=function(e){(function(e,t){if(1!==e.nodeType)return!1;if(!t.svg&&function(e){if("svg"===e.tagName.toLowerCase())return!0;for(var t=e.parentElement,i=!1;t;)"svg"===t.tagName.toLowerCase()?(t=null,i=!0):t=t.parentElement;return i}(e))return!1;if(["HTML","BODY"].includes(e.tagName.toUpperCase()))return!1;var i=e;return!("none"===i.style.display||!Gu(i,"container")&&!function(e){if(e.children.length){var t=e.children;return![].slice.call(t).some((function(e){return e.children.length>0}))}return!0}(i)&&!t.svg)})(e.target,n.options)&&n.eventHandel({eventType:"dom",eventName:"click"},e)},this.changeEvent=function(e){n.eventHandel({eventType:"dom",eventName:"change"},e)},this.submitEvent=function(e){n.eventHandel({eventType:"dom",eventName:"submit"},e)},this.getPageViewEvent=function(e,t){t&&"pushState"===t&&n.eventHandel({eventType:"dom",eventName:"beat"},xc({beat_type:0},e)),n.eventHandel({eventType:"dom",eventName:"page_view"},e)},this.getPageLoadEvent=function(e){n.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:e})},this.config=i.getConfig().eventConfig,this.collect=t,this.options=e,this.beatTime=e.beat,this.domContainer=e.container||document}return e.prototype.init=function(e){this.eventHandel=e;var t=this.config.mode;this.addListener(t)},e.prototype.addListener=function(e){var t=this;if("proxy-capturing"===e){if(this.config.click&&(Rc(this.domContainer)?this.domContainer.forEach((function(e){e.addEventListener("click",t.clickEvent,!0)})):this.domContainer.addEventListener("click",this.clickEvent,!0)),this.config.pv){this.collect.on("route-change",(function(e){var i=e.config,n=e.name;t.getPageViewEvent(i,n),t.pageView=!0}));var i=setTimeout((function(){t.pageView||(t.getPageViewEvent(t.getDefaultConfig()),t.pageView=!0,clearTimeout(i))}),2e3)}if(this.config.beat){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",(function(){t.beatEvent(t.beatTime)}));var n=0,r=null;window.addEventListener("scroll",(function(){clearTimeout(r),r=setTimeout(o,500),n=document.documentElement.scrollTop||document.body.scrollTop}));var o=function(){(document.documentElement.scrollTop||document.body.scrollTop)==n&&t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(e){}try{var a=window.performance&&window.performance.getEntriesByType("paint");if(a&&a.length){new PerformanceObserver((function(e){var i=e.getEntries(),n=i[i.length-1],r=n.renderTime||n.loadTime;t.statistics||(t.getPageLoadEvent(r),t.statistics=!0)})).observe({entryTypes:["largest-contentful-paint"]});var s=setTimeout((function(){t.statistics||(t.getPageLoadEvent(a[0].startTime||0),t.statistics=!0,clearTimeout(s))}),2e3)}else this.getPageLoadEvent(0)}catch(e){this.getPageLoadEvent(0)}}}},e.prototype.removeListener=function(){var e=this;Rc(this.domContainer)?this.domContainer.forEach((function(t){t.removeEventListener("click",e.clickEvent,!0)})):this.domContainer.removeEventListener("click",this.clickEvent,!0)},e.prototype.beatEvent=function(e){var t=this;try{var i;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(i=setInterval((function(){t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})}),e)),Bc((function(){t.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),t.beatTime&&clearInterval(i)}))}catch(e){}},e.prototype.getDefaultConfig=function(){return{is_html:1,url:location.href,referrer:document.referrer,page_key:location.href,refer_page_key:document.referrer,page_title:document.title||location.pathname,page_manual_key:"",refer_page_manual_key:"",refer_page_title:"",page_path:location.pathname,page_host:location.host}},e}(),qu={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},Xu=function(){function e(e,t){this.config=e,this.config.eventConfig=Object.assign(this.config.eventConfig,t)}return e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(e){return this.config=e},e}();function Ju(e,t,i,n){var r,o,a={},s=function(e){if(e){var t=e.getBoundingClientRect(),i=t.width,n=t.height;return{left:t.left,top:t.top,element_width:i,element_height:n}}}(t),l=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var i=e.clientX,n=e.clientY,r=t.left,o=t.top,a=i-r>=0?i-r:0,s=n-o>=0?n-o:0;return{touch_x:Math.floor(a),touch_y:Math.floor(s)}}(e,s),c=s.element_width,u=s.element_height,h=l.touch_x,d=l.touch_y,f=function(e){var t=[];if(!e)return{element_path:"",positions:[]};for(;null!==e.parentElement;)t.push(e),e=e.parentElement;var i=[],n=[];return t.forEach((function(e){var t=function(e){if(null===e)return{str:"",index:0};var t=0,i=e.parentElement;if(i)for(var n=i.children,r=0;r<n.length&&n[r]!==e;r++)n[r].nodeName===e.nodeName&&t++;return{str:[e.nodeName.toLowerCase(),Gu(e,"list")?"[]":""].join(""),index:t}}(e),r=t.str,o=t.index;i.unshift(r),n.unshift(o)})),{element_path:"/"+i.join("/"),positions:n}}(t),p=f.element_path,g=f.positions,v=(r=Wu(t),o=[],function e(t){var i,n,r=(n="",3===(i=t).nodeType?n=i.textContent.trim():i.dataset&&i.dataset.hasOwnProperty("teaTitle")||i.hasAttribute("ata-tea-title")?n=i.getAttribute("data-tea-title"):i.hasAttribute("title")?n=i.getAttribute("title"):"INPUT"===i.nodeName&&["button","submit"].includes(i.getAttribute("type"))?n=i.getAttribute("value"):"IMG"===i.nodeName&&i.getAttribute("alt")&&(n=i.getAttribute("alt")),n.slice(0,200));if(r&&-1===o.indexOf(r)&&o.push(r),t.childNodes.length>0)for(var a=t.childNodes,s=0;s<a.length;s++)8!==a[s].nodeType&&e(a[s])}(r),o),y=window.performance.timing.navigationStart,m=Date.now()-y,_=g.map((function(e){return""+e})),b=null;if(window.TEAVisualEditor&&window.TEAVisualEditor.getOriginXpath&&(b=window.TEAVisualEditor.getOriginXpath({xpath:p,positions:_}
1)),a.element_path=b&&b.xpath||p,a.positions=b&&b.positions||_,n&&!n.text&&(a.texts=v,a.element_title=function(e){if(!e)return"";var t="";return e.textContent?t=e.textContent.trim():e.innerText&&(t=e.innerText.trim()),"input"!==e.tagName&&"INPUT"!==e.tagName||(t=e.value||""),t}(t)),a.element_id=t.getAttribute("id")||"",a.element_class_name=t.getAttribute("class")||"",a.element_type=t.nodeType,a.element_width=Math.floor(c),a.element_height=Math.floor(u),a.touch_x=h,a.touch_y=d,a.page_manual_key="",a.elememt_manual_key="",a.since_page_start_ms=m,a.page_start_ms=y,a.page_path=location.pathname,a.page_host=location.host,i.track_attr&&function(e,t){return!!Yu(e,t)}(t,i.track_attr)){var k=function(e,t){var i={};if("string"==typeof t)Ku(e,t)&&(i.attrs=e.getAttribute(t));else if(Rc(t))for(var n=0;n<t.length;n++)Ku(e,t[n])&&(i[t[n]]=e.getAttribute(t[n]));return i}(t,i.track_attr);for(var w in k)a[w]=k[w]}var S=Wu(t);return"A"===S.tagName&&(a.href=S.getAttribute("href")),"IMG"===t.tagName&&(a.src=t.getAttribute("src")),a}var Zu=function(e,t,i,n,r){return xc({event:e},Ju(t,i,n,r),{is_html:1,page_key:window.location.href,page_title:document.title})},Qu=function(){function e(e,t){this.ignore={text:!1},this.initConfig=e,this.options=t,this.eventName=t&&"tea"===t.custom?{click:"__bav_click",page:"__bav_page",beat:"__bav_beat",static:"__bav_page_statistics",exposure:"__bav_page_exposure"}:{click:"bav2b_click",page:"bav2b_page",beat:"bav2b_beat",static:"bav2b_page_statistics",exposure:"bav2b_exposure"},t&&!1===t.text&&(this.ignore.text=!0),t&&t.exposure&&t.exposure.eventName&&(this.eventName.exposure=t.exposure.eventName)}return e.prototype.handleEvent=function(e,t){try{if(function(e){for(var t=e;t&&t.parentNode;){if(t.hasAttribute("data-tea-ignore"))return!0;if("HTML"===t.nodeName||"body"===t.nodeName)return!1;t=t.parentNode}return!1}(e.target))return null;var i="bav2b_click";switch(t){case"click":return i=this.eventName.click,Zu(i,e,e.target,this.options,this.ignore);case"exposure":return i=this.eventName.exposure,Zu(i,e,e.target,this.options,this.ignore);case"change":return xc({},Zu(i="bav2b_change",e,e.target,this.options),function(e,t){try{if("bav2b_change"===e)return t.hasAttribute("data-tea-track")?{value:t.value}:{}}catch(e){return{}}}(i,e.target));case"submit":return Zu(i="bav2b_submit",e,e.target,this.options)}}catch(e){return null}},e.prototype.handleViewEvent=function(e){e.event=this.eventName.page,e.page_title=document.title,e.page_total_width=window.innerWidth,e.page_total_height=window.innerHeight;try{var t=window.sessionStorage.getItem("_tea_cache_duration");if(t){var i=JSON.parse(t);e.refer_page_duration_ms=i?i.duration:""}e.scroll_width=document.documentElement.scrollLeft?document.documentElement.scrollLeft+window.innerWidth:window.innerWidth,e.scroll_height=document.documentElement.scrollTop?document.documentElement.scrollTop+window.innerHeight:window.innerHeight,e.page_start_ms=window.performance.timing.navigationStart}catch(e){}return e},e.prototype.handleStatisticsEvent=function(e){var t={};t.event=this.eventName.static,t.is_html=1,t.page_key=location.href,t.refer_page_key=document.referrer||"",t.page_title=document.title,t.page_manual_key=this.initConfig.autotrack.page_manual_key||"",t.refer_page_manual_key="";try{var i=e.lcp,n=window.performance.timing,r=n.loadEventEnd-n.navigationStart;t.page_init_cost_ms=parseInt(i||(r>0?r:0)),t.page_start_ms=n.navigationStart}catch(e){}return t},e.prototype.handleBeadtEvent=function(e){e.event=this.eventName.beat,e.page_key=window.location.href,e.is_html=1,e.page_title=document.title,e.page_manual_key=this.initConfig.autotrack.page_manual_key||"";try{e.page_viewport_width=window.innerWidth,e.page_viewport_height=window.innerHeight,e.page_total_width=document.documentElement.scrollWidth,e.page_total_height=document.documentElement.scrollHeight,e.scroll_width=document.documentElement.scrollLeft+window.innerWidth,e.scroll_height=document.documentElement.scrollTop+window.innerHeight,e.since_page_start_ms=Date.now()-window.performance.timing.navigationStart,e.page_start_ms=window.performance.timing.navigationStart}catch(e){}return e},e}(),eh=function(){function e(e){this.collect=e,this.eventNameList=["report_click_event","report_change_event","report_submit_event","report_exposure_event","report_page_view_event","report_page_statistics_event","report_beat_event"]}return e.prototype.send=function(e,t){var i=e.eventSend,n=t.event;delete t.event,i&&"becon"===i?this.collect.beconEvent(n,t):this.collect.event(n,t)},e.prototype.get=function(e,t){var i=Object.assign({headers:{"content-type":"application/json"},method:"GET"},t);fetch(e,i)},e.prototype.post=function(e,t){var i=Object.assign({headers:{"content-type":"application/json"},method:"POST"},t);fetch(e,i)},e}(),th="_TEA_VE_OPEN",ih="_TEA_VE_APIHOST",nh="lang",rh="_VISUAL_EDITOR_V",oh="_VISUAL_EDITOR_U";function ah(){try{var e=window.TEAVisualEditor.lang=window.TEAVisualEditor.lang||Yc.get(nh),t=window.TEAVisualEditor.__editor_ajax_domain=window.TEAVisualEditor.__editor_ajax_domain||Yc.get(ih),i=window.TEAVisualEditor.__editor_verison=window.TEAVisualEditor.__editor_verison||Yc.get(rh),n=window.TEAVisualEditor.__editor_url=window.TEAVisualEditor.__editor_url||Yc.get(oh),r=+new Date,o=new Date(r+18e5);Yc.set(th,"1",{expires:o}),Yc.set(ih,t,{expires:o}),Yc.set(oh,n,{expires:o}),Yc.set(nh,e,{expires:o}),Yc.set(rh,i||"",{expires:o})}catch(e){}}var sh=!1;function lh(e){var t=e.event,i=e.editorUrl,n=e.autoTrackInstance;sh||(sh=!0,Uc(i,(function(){Du(t,"editorScriptloadSuccess"),n.destroy()}),(function(){t&&Du(t,"editorScriptloadError"),sh=!1})))}var ch,uh=function(){function e(e){this._instance=null,this._intersection=e,this.init()}return e.prototype.init=function(){var e=this;this._instance=new MutationObserver((function(t){t.forEach((function(t){"attributes"===t.type&&e.attributeChangeObserve(t),"childList"===t.type&&e.modifyNodeObserve(t)}))}
1)),this._instance.observe(document.body,{childList:!0,attributes:!0,subtree:!0,attributeOldValue:!1})},e.prototype.attributeChangeObserve=function(e){e.target.hasAttribute("data-exposure")?this.exposureAdd(e,"mutation"):this.exposureRemove(e)},e.prototype.modifyNodeObserve=function(e){var t=this;Array.prototype.forEach.call(e.addedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureAdd(e,"intersect"),t.mapChild(e,t.exposureAdd)})),Array.prototype.forEach.call(e.removedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureRemove(e),t.mapChild(e,t.exposureRemove)}))},e.prototype.mapChild=function(e,t){var i=this;1===e.nodeType&&e.children.length&&Array.prototype.forEach.call(e.children,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t(e),i.mapChild(e,t)}))},e.prototype.exposureAdd=function(e,t){this._intersection.exposureAdd(e,t)},e.prototype.exposureRemove=function(e){this._intersection.exposureRemove(e)},e._exposure_observer=null,e}(),hh=function(){function e(t,i){this.count=1,this.instance=this.buildObserver(),this.observeMap=e._observer_map,t.autotrack.exposure.ratio?this.Ratio=t.autotrack.exposure.ratio:0===t.autotrack.exposure.ratio?this.Ratio=0:this.Ratio=.5,this.EventHandle=i}return e.prototype.buildObserver=function(){var t=this;if(!e._observer_instance)return IntersectionObserver&&(e._observer_instance=new IntersectionObserver((function(e){e.forEach((function(e){t.observeMap.get(e.target._observeId)&&t.exposureEvent(e)}))}),{threshold:[.01,.25,.5,.75,1]})),e._observer_instance},e.prototype.exposureAdd=function(e,t){var i=e;"mutation"===t&&(i=e.target);var n=i._observeId;if(n||this.observeMap.has(n)){if(!1===i.visible){var r=i.getBoundingClientRect(),o=r.top,a=r.left,s=r.right,l=r.bottom;o>=0&&l<=window.innerHeight&&a>=0&&s<=window.innerWidth&&(i.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e))}}else i._observeId=this.count,i.visible=!1,this.observeMap.set(this.count,i),this.observe(i),this.count++},e.prototype.exposureRemove=function(e){this.observeMap.has(e._observeId)&&(this.observeMap.delete(e._observeId),this.unobserve(e))},e.prototype.exposureEvent=function(e){if(e.intersectionRatio>=this.Ratio&&e.isIntersecting){if("0"===e.target.style.opacity||"hidden"===e.target.style.visibility)return;if(!0===e.target.visible)return;e.target.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e)}else e.target.visible=!1},e.prototype.observe=function(e){this.instance.observe(e)},e.prototype.unobserve=function(e){this.instance.unobserve(e)},e._observer_instance=null,e._observer_map=new Map,e}(),dh=function(){function e(e,t){e.autotrack&&e.autotrack.exposure&&(this._intersection=new hh(e,t),this._observer=new uh(this._intersection),this.initObserver())}return e.prototype.initObserver=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),(function(t){e._intersection.exposureAdd(t,"intersect")}))},e}(),fh={hashTag:!1,impr:!1},ph=function(){function e(){}return e.prototype.apply=function(e,t){if(this.autoTrackStart=!1,this.collect=e,this.config=t,t.autotrack){var i=e.Types;t.autotrack&&t.autotrack.collect_url&&!t.autotrack.collect_url()||(this.ready(i.Autotrack),this.collect.emit(i.AutotrackReady))}},e.prototype.ready=function(e){this.collect.set(e);var t=this.config.autotrack;t="object"==l(t)?t:{},t=Object.assign(fh,t),this.destroyed=!1,this.options=t,this.Config=new Xu(qu,this.options),this.Exposure=new dh(this.config,this.handle.bind(this)),this.Listener=new $u(t,this.collect,this.Config),this.EventHandle=new Qu(this.config,t),this.Request=new eh(this.collect),this.autoTrackStart=!0,this.init(),function(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{};var i="",n="https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-editor-rangers.js?query="+Date.now();window.TEAVisualEditor.appId=t.app_id;var r=t.channel_domain,o="";if(xu(["*"]),r){var a,s="";try{var l=window.performance.getEntriesByType("resource");if(l&&l.length&&(l.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(s=e.name)})),s&&(a=s.split("/"))&&a.length)){o="https:/";for(var c=2;c<a.length&&c!==a.length-1;c++)o=o+"/"+a[c];if(o&&o.indexOf("/5.0")){var u=o.split("/5.0");o=u[0]||o}}}catch(e){}}if(Iu(t,nu),"1"===Yc.get(th)){var h=function(){var e=Yc.get(ih);try{e=JSON.parse(e)}catch(e){}return e}(),d="";h&&(window.TEAVisualEditor.__editor_ajax_domain=h,d=Yc.get(oh)),lh({event:null,editorUrl:d||n,autoTrackInstance:e}),ah()}else try{Pu("tea:openVisualEditor",(function(t){var a=t.data;if("string"==typeof t.data)try{a=JSON.parse(t.data)}catch(e){a=void 0}if(a){var s=a.referrer,l=a.lang;if(s&&(window.TEAVisualEditor.__editor_ajax_domain=s),i=n,r){var c=a.version;i=o?o+(c?"/visual-editor-rangers-v"+c:"/visual-editor-rangers-v1.0.0")+".js":n,window.TEAVisualEditor.__editor_verison=c}window.TEAVisualEditor.__editor_url=i,window.TEAVisualEditor.lang=l,lh({event:t,editorUrl:i,autoTrackInstance:e}),ah()}})),window.TEAVisualEditor.openAutotrackEditor=function(){lh({event:null,editorUrl:window.TEAVisualEditor.__editor_url,autoTrackInstance:e})}}catch(e){}try{Pu("tea:openHeatMapCore",(function(i){var n=i.data.app_id;n&&n!==t.app_id||lh({event:i,editorUrl:"https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/heatmap-core.js?query="+Date.now(),autoTrackInstance:e})}))}catch(e){}}(this,this.config)},e.prototype.init=function(){this.Listener.init(this.handle.bind(this));try{"base"===this.collect.loadType&&(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(e){}},e.prototype.handle=function(e,t){"dom"===e.eventType&&this.handleDom(e,t)},e.prototype.handleDom=function(e,t){try{var i=e.eventName;if("click"===i||"exposure"===i||"change"===i||"submit"===i){var n=this.EventHandle.handleEvent(t,i);null!==n&&this.Request.send({eventType:"custom",eventName:"report_"+i+"_event",extra:{methods:"GET"}},n)}else if("page_view"===i||"page_statistics"===i){var r;r="page_view"===i?this.EventHandle.handleViewEvent(t):this.EventHandle.handleStatisticsEvent(t),this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"}},r)}else if("beat"===i){var o=this.EventHandle.handleBeadtEvent(t),a=e.eventSend;this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"},eventSend:a},o)}}catch(e){}},e.prototype.destroy=function(){this.autoTrackStart&&(this.autoTrackStart=!1,this.Listener.removeListener())},e}();!function(e){e.Net="net",e.FailNet="f_net",e.FailData="f_data"}(ch||(ch={}));var gh={pv:["predefine_pageview"],sdk:["_be_active","predefine_page_alive","predefine_page_close","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append"],autotrack:["bav2b_click","bav2b_page","bav2b_beat","bav2b_page_statistics","__bav_click","__bav_page","__bav_beat","__bav_page_statistics"]},vh=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;if(t.app_id&&t.enable_tracer&&!t.disable_track_event){this.limit={pv:1,sdk:3,autotrack:3,log:3},this.errorCode={f_net:0,f_data:0},this.tracerCache=new Map,this.collect=e,this.appid=t.app_id,this.reportUrl=e.configManager.getUrl("event");var n=this.collect.Types;this.collect.on(n.Event,(function(){i.addCount("log")})),this.collect.on(n.SubmitError,(function(e){var t=e.type,n=e.eventDate,r=e.errorCode,o=e.response;i.addErrorCount(n,t,r,o)})),this.listener(),this.collect.emit(n.TracerReady)}},e.prototype.addCount=function(e,t,i){void 0===t&&(t="net"),void 0===i&&(i=1);try{this.tracerCache||(this.tracerCache=new Map);var n=void 0;if(this.tracerCache.has(e))(r=this.tracerCache.get(e)).has(t)?(n=r.get(t).params.count,n++,r.set(t,this.processTracer(n,e,t))):(n=i,r.set(t,this.processTracer(i,e,t)));else{var r=new Map;n=i,r.set(t,this.processTracer(i,e,t)),this.tracerCache.set(e,r)}"net"===t&&n>=this.limit[e]&&this.report(!1)}catch(e){}},e.prototype.addErrorCount=function(e,t,i,n){var r=this;try{if(e&&e.length){var o=e[0].events;o&&o.length&&("f_data"===t?(n&&n.hasOwnProperty("sc")?this.addCount("log",t,o.length-n.sc):this.addCount("log",t,o.length),this.errorCode[t]=i):o.forEac
1h((function(e){var n="log";for(var o in gh)if(-1!==gh[o].indexOf(e.event)){n=o;break}r.addCount(n,t,1),r.errorCode[t]=i})))}}catch(e){}},e.prototype.report=function(e){if(this.tracerCache){var t=[];this.tracerCache.forEach((function(e){e.forEach((function(e){t.push(e)}))})),t&&t.length&&this.sendTracer(t,e)}},e.prototype.sendTracer=function(e,t){try{var i=this.collect.eventManager.merge(e);this.collect.requestManager.useRequest({url:this.reportUrl,data:i,useBeacon:t}),this.tracerCache=null}catch(e){}},e.prototype.processTracer=function(e,t,i){var n={count:e,state:i,key:t,params_for_special:"applog_trace",aid:this.appid,platform:"web",_staging_flag:1,sdk_version:nu};"f_net"!==i&&"f_data"!==i||(n.errorCode=this.errorCode[i]);var r=this.collect.processEvent("applog_trace",n);if(r&&r.event)return delete r.is_bav,r},e.prototype.listener=function(){var e=this;document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.leavePage()})),Bc((function(){e.leavePage()}))},e.prototype.leavePage=function(){this.report(!0)},e}(),yh=function(){function e(){this.retryWaitTime=3e3,this.retryStatus=!1,this.retryCacheStatus=!1}return e.prototype.apply=function(e,t){var i=this;if(t.enable_storage&&!t.disable_storage&&(this.collect=e,this.config=t,!this.collect.destroy)){var n=e.Types,r=e.adapters.storage;this.storage=new r(!1),this.eventUrl=this.collect.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+t.app_id,this.storageNum=t.storage_num||50,this.retryNum=t.retry_num||3,this.retryInterval=1e3,e.on(n.SubmitError,(function(e){"f_data"!==e.type&&i.storeData(e)})),e.on(n.Ready,(function(){i.checkStorage()}))}},e.prototype.retryRightNow=function(e){var t=this;if(this.retryStatus)this.errorCache.push(e);else{var i=0;this.retryStatus=!0;var n=setInterval((function(){if(3===i)return t.storeData(t.errorCache),t.retryStatus=!1,void clearInterval(n);var r=e.eventData;t.fetchData(r,(function(){t.retryStatus=!1,clearInterval(n),t.retryCacheStatus&&t.errorCache.splice(0,1),t.errorCache.length&&(t.retryCacheStatus=!0,t.retryRightNow(t.errorCache[0]))}),(function(){i++}))}),this.retryInterval)}},e.prototype.storeData=function(e){var t=this.storage.getItem(this.eventKey),i=e.eventData;Object.keys(t).length!==this.storageNum&&(t[Date.now()]=i,this.storage.setItem(this.eventKey,t))},e.prototype.checkStorage=function(){var e=this;try{if(!window.navigator.onLine)return;var t=this.storage.getItem(this.eventKey);if(!t||!Object.keys(t).length)return;var i={events:[{event:"ontest",params:{app_id:this.config.app_id},local_time_ms:Date.now()}],user:{user_unique_id:this.collect.configManager.get("web_id")},header:{}};this.fetchData([i],(function(){var i=JSON.parse(JSON.stringify(t)),n=function(n){e.fetchData(t[n],(function(){delete i[n],e.storage.setItem(e.eventKe
vendor: 5,443 bytes, line 1
1y,i)}),(function(){}),!1)};for(var r in t)n(r)}),(function(){}),!0)}catch(e){}},e.prototype.fetchData=function(e,t,i,n){this.collect.requestManager.useRequest({url:this.eventUrl,data:e,timeout:3e4,success:t,fail:i,app_key:n?"566f58151b0ed37e":""})},e}(),mh=zc((function(e,t){e.exports=function(){var e="millisecond",t="second",i="minute",n="hour",r="day",o="week",a="month",s="quarter",c="year",u="date",h="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},g=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},v={s:g,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+g(n,2,"0")+":"+g(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,a),o=i-r<0,s=t.clone().add(n+(o?-1:1),a);return+(-(n+(i-r)/(o?r-s:s-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(l){return{M:a,y:c,w:o,d:r,D:u,h:n,m:i,s:t,ms:e,Q:s}[l]||String(l||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",m={};m[y]=p;var _=function(e){return e instanceof S},b=function(e,t,i){var n;if(!e)return y;if("string"==typeof e)m[e]&&(n=e),t&&(m[e]=t,n=e);else{var r=e.name;m[r]=e,n=r}return!i&&n&&(y=n),n||!i&&y},k=function(e,t){if(_(e))return e.clone();var i="object"==l(t)?t:{};return i.date=e,i.args=arguments,new S(i)},w=v;w.l=b,w.i=_,w.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function l(e){this.$L=b(e.locale,null,!0),this.parse(e)}var p=l.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(w.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(d);if(n){var r=n[2]-1||0,o=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return w},p.isValid=function(){return!(this.$d.toString()===h)},p.isSame=function(e,t){var i=k(e);return this.startOf(t)<=i&&i<=this.endOf(t)},p.isAfter=function(e,t){return k(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<k(e)},p.$g=function(e,t,i){return w.u(e)?this[t]:this.set(i,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,s){var l=this,h=!!w.u(s)||s,d=w.p(e),f=function(e,t){var i=w.w(l.$u?Date.UTC(l.$y,t,e):new Date(l.$y,t,e),l);return h?i:i.endOf(r)},p=function(e,t){return w.w(l.toDate()[e].apply(l.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(t)),l)},g=this.$W,v=this.$M,y=this.$D,m="set"+(this.$u?"UTC":"");switch(d){case c:return h?f(1,0):f(31,11);case a:return h?f(1,v):f(0,v+1);case o:var _=this.$locale().weekStart||0,b=(g<_?g+7:g)-_;return f(h?y-b:y+(6-b),v);case r:case u:return p(m+"Hours",0);case n:return p(m+"Minutes",1);case i:return p(m+"Seconds",2);case t:return p(m+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(o,s){var l,h=w.p(o),d="set"+(this.$u?"UTC":""),f=(l={},l[r]=d+"Date",l[u]=d+"Date",l[a]=d+"Month",l[c]=d+"FullYear",l[n]=d+"Hours",l[i]=d+"Minutes",l[t]=d+"Seconds",l[e]=d+"Milliseconds",l)[h],p=h===r?this.$D+(s-this.$W):s;if(h===a||h===c){var g=this.clone().set(u,1);g.$d[f](p),g.init(),this.$d=g.set(u,Math.min(this.$D,g.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[w.p(e)]()},p.add=function(e,s){var l,u=this;e=Number(e);var h=w.p(s),d=function(t){var i=k(u);return w.w(i.date(i.date()+Math.round(t*e)),u)};if(h===a)return this.set(a,this.$M+e);if(h===c)return this.set(c,this.$y+e);if(h===r)return d(1);if(h===o)return d(7);var f=(l={},l[i]=6e4,l[n]=36e5,l[t]=1e3,l)[h]||1,p=this.$d.getTime()+e*f;return w.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||h;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=w.z(this),o=this.$H,a=this.$m,s=this.$M,l=i.weekdays,c=i.months,u=function(e,i,r,o){return e&&(e[i]||e(t,n))||r[i].substr(0,o)},d=function(e){return w.s(o%12||12,e,"0")},p=i.meridiem||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n},g={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:w.s(s+1,2,"0"),MMM:u(i.monthsShort,s,c,3),MMMM:u(c,s),D:this.$D,DD:w.s(this.$D,2,"0"),d:String(this.$W),dd:u(i.weekdaysMin,this.$W,l,2),ddd:u(i.weekdaysShort,this.$W,l,3),dddd:l[this.$W],H:String(o),HH:w.s(o,2,"0"),h:d(1),hh:d(2),a:p(o,a,!0),A:p(o,a,!1),m:String(a),mm:w.s(a,2,"0"),s:String(this.$s),ss:w.s(this.$s,2,"0"),SSS:w.s(this.$ms,3,"0"),Z:r};return n.replace(f,(function(e,t){return t||g[e]||r.replace(":","")}))}
1,p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(e,l,u){var h,d=w.p(l),f=k(e),p=6e4*(f.utcOffset()-this.utcOffset()),g=this-f,v=w.m(this,f);return v=(h={},h[c]=v/12,h[a]=v,h[s]=v/3,h[o]=(g-p)/6048e5,h[r]=(g-p)/864e5,h[n]=g/36e5,h[i]=g/6e4,h[t]=g/1e3,h)[d]||g,u?v:w.a(v)},p.daysInMonth=function(){return this.endOf(a).$D},p.$locale=function(){return m[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=b(e,t,!0);return n&&(i.$L=n),i},p.clone=function(){return w.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},l}(),T=S.prototype;return k.prototype=T,[["$ms",e],["$s",t],["$m",i],["$H",n],["$W",r],["$M",a],["$y",c],["$D",u]].forEach((function(e){T[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),k.extend=function(e,t){return e.$i||(e(t,S,k),e.$i=!0),k},k.locale=b,k.isDayjs=_,k.unix=function(e){return k(1e3*e)},k.en=m[y],k.Ls=m,k.p={},k}()})),_h=zc((function(e,t){var i,n,r,o,a,s,c,u,h,d,f,p,g,v,y,m,_;e.exports=(a=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:s=31536e6,months:c=2592e6,days:o=864e5,hours:r=36e5,minutes:6e4,seconds:1e3,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof _},f=function(e,t,i){return new _(e,i,t.$l)},p=function(e){return n.p(e)+"s"},g=function(e){return e<0},v=function(e){return g(e)?Math.ceil(e):Math.floor(e)},y=function(e){return Math.abs(e)},m=function(e,t){return e?g(e)?{negative:!0,format:""+y(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},_=function(){function e(e,t,i){var n=this;if(this.$d={},this.$l=i,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*h[p(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==l(e))return Object.keys(e).forEach((function(t){n.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var r=e.match(u);if(r){var o=r.slice(2).map((function(e){return Number(e)}));return this.$d.years=o[0],this.$d.months=o[1],this.$d.weeks=o[2],this.$d.days=o[3],this.$d.hours=o[4],this.$d.minutes=o[5],this.$d.seconds=o[6],this.calMilliseconds(),this}}return this}var t=e.prototype;return t.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,i){return t+(e.$d[i]||0)*h[i]}),0)},t.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=v(e/s),e%=s,this.$d.months=v(e/c),e%=c,this.$d.days=v(e/o),e%=o,this.$d.hours=v(e/r),e%=r,this.$d.minutes=v(e/6e4),e%=6e4,this.$d.seconds=v(e/1e3),e%=1e3,this.$d.milliseconds=e},t.toISOString=function(){var e=m(this.$d.years,"Y"),t=m(this.$d.months,"M"),i=+this.$d.days||0;this.$d.weeks&&(i+=7*this.$d.weeks);var n=m(i,"D"),r=m(this.$d.hours,"H"),o=m(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3);var s=m(a,"S"),l=e.negative||t.negative||n.negative||r.negative||o.negative||s.negative,c=r.format||o.format||s.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+n.format+c+r.format+o.format+s.format;return"P"===u||"-P"===u?"P0D":u},t.toJSON=function(){return this.toISOString()},t.format=function(e){var t=e||"YYYY-MM-DDTHH:mm:ss",i={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return t.replace(a,(function(e,t){return t||String(i[e])}))},t.as=function(e){return this.$ms/h[p(e)]},t.get=function(e){var t=this.$ms,i=p(e);return"milliseconds"===i?t%=1e3:t="weeks"===i?v(t/h[i]):this.$d[i],0===t?0:t},t.add=function(e,t,i){var n;return n=t?e*h[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+n*(i?-1:1),this)},t.subtract=function(e,t){return this.add(e,t,!0)},t.locale=function(e){var t=this.clone();return t.$l=e,t},t.clone=function(){return f(this.$ms,this)},t.humanize=function(e){return i().add(this.$ms,"ms").locale(this.$l).fromNow(!e)},t.milliseconds=function(){return this.get("milliseconds")},t.asMilliseconds=function(){return this.as("milliseconds")},t.seconds=function(){return this.get("seconds")},t.asSeconds=function(){return this.as("seconds")},t.minutes=function(){return this.get("minutes")},t.asMinutes=function(){return this.as("minutes")},t.hours=function(){return this.get("hours")},t.asHours=function(){return this.as("hours")},t.days=function(){return this.get("days")},t.asDays=function(){return this.as("days")},t.weeks=function(){return this.get("weeks")},t.asWeeks=function(){return this.as("weeks")},t.months=function(){return this.get("months")},t.asMonths=function(){return this.as("months")},t.years=function(){return this.get("years")},t.asYears=function(){return this.as("years")},e}(),function(e,t,r){i=r,n=r().$utils(),r.duration=function(e,t){var i=r.locale();return f(e,{$l:i},t)},r.isDuration=d;var o=t.prototype.add,a=t.prototype.subtract;t.prototype.add=function(e,t){return d(e)&&(e=e.asMilliseconds()),o.bind(this)(e,t)},t.prototype.subtract=function(e,t){return d(e)&&(e=e.asMilliseconds()),a.bind(this)(e,t)}})}));mh.extend(_h);var bh=["__cep_sdk_onboard","__cep_trigger_sdk","_be_active"],kh=["and","or","not"],wh=function(){function e(){this.support=!0,this.currentPlan=1,this.shouldSe
1ndEvent=!1,this.staing=!1,this.test=!1,this.cepReady=!1,this.eventCache=[]}return e.prototype.apply=function(e,t){var i=this;if(t.cep){this.collect=e,this.config=t;var n=e.adapters.storage,r=e.Types;this.types=r,this.storage=new n(!1),this.configManager=e.configManager,this.url=t.cep_url?""+t.cep_url:e.configManager.getDomain()+"/service/2/cep_settings/",this.reportUrl=e.configManager.getUrl("event"),this.key="__tea_cep_plan_"+t.app_id,this.quotasKey="__tea_cep_plan_quotas_"+t.app_id,this.isWait=!1,this.eventCache=[],this.test=e.configManager.staging,this.collect.on(r.SubmitAfter,(function(e){i.matchEvent(e)})),this.init()}},e.prototype.init=function(){var e=this,t=!0,i=0,n=0,r=0,o=!1,a=this.storage.getItem(this.key)||{};if(a&&Object.keys(a).length&&(o=!0,i=a.last_update_time,n=a.fetch_interval,r=a.config_version||0,t=Date.now()-i>1e3*n),t){var s=this.configManager.get(),l=s.header,c=s.user;this.collect.requestManager.useRequest({url:this.url,data:{header:l,user:c,local_time:Date.now(),config_version:r},success:function(t){t&&0===t.code?(a.fetch_interval=t.fetch_interval,a.data=t.data,a.last_update_time=Date.now(),a.config_version=t.config_version,e.clearQuotas(),e.initState(t.data),e.storage.setItem(e.key,a),t.data.forEach((function(t){e.event("__cep_sdk_onboard",t.plan_id)}))):304!==t.code&&400!==t.code||!o||(a.last_update_time=Date.now(),e.storage.setItem(e.key,a),e.initState(a.data))},fail:function(){o?(e.planData=a.data,e.initState(a.data)):e.support=!1},timeout:5e3})}else a.last_update_time=Date.now(),this.storage.setItem(this.key,a),this.initState(a.data)},e.prototype.initState=function(e){var t=this;e&&e.length&&(this.stateArray=new Map,this.waitArray=new Map,this.planData=e,e.forEach((function(e){var i=new Map;if(e.pattern&&e.pattern.events){var n=1===e.pattern.events.length;e.pattern.events.forEach((function(e){i.set(e.id,{id:e.id,isMatch:!1,event:null,after:e.after||null,connection:e.connection||null,window:e.window||null,matchTime:0,initTime:Date.now(),singleRule:n})})),t.stateArray.set(e.plan_id,{patternState:i,singleRule:n,pattern:{aid:e.aid,biz_id:e.biz_id,end_time:e.end_time,start_time:e.start_time,web_sdk_version:e.web_sdk_version,stage:e.stage},quotas:e.quotas})}})),this.cepReady=!0,this.dealCache(),this.collect.emit(this.types.CepReady))},e.prototype.check=function(e){var t=Date.now();return!(Date.now()>1e3*e.end_time||t<1e3*e.start_time||t>1e3*e.end_time||(this.staing="testing"===e.staing,nu<e.web_sdk_version&&(this.support=!1,1)))},e.prototype.dealCache=function(){var e=this;if(this.eventCache.length){var t=1;this.eventCache.forEach((function(i){e.matchEvent(i),t++})),t===this.eventCache.length&&(this.eventCache=[])}},e.prototype.matchEvent=function(e){if(this.support&&(!this.staing||this.test)&&e&&e.length)try{if(!this.cepReady)return void this.eventCache.push(e);var t=e[0],i=t.header,n=t.user,r=t.events;r.length&&r.reverse();for(var o=0;o<r.length;o++){var a=r[o].event;if(-1!==bh.indexOf(a))return!1;this.matchRule(i,n,r[o])}}catch(e){return void this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.matchRule=function(e,t,i){try{for(var n=0;n<this.planData.length;n++){var r=this.planData[n],o=r.plan_id;if(this.check(r)&&this.checkQuotas(o)&&r.pattern&&r.pattern.events)for(var a=r.pattern.events,s=0;s<a.length;s++)if(this.rule(e,t,i,a[s].condition)){var l=this.stateArray.get(o).patternState,c=l.get(a[s].id);if(this.stateArray.get(o).singleRule){this.changeStatus(o,a[s].id,i),this.publish([i],o,a[s].id);break}if(!c.isMatch){c.after&&l.get(c.after).isMatch?this.changeStatus(o,a[s].id,i):c.after||this.changeStatus(o,a[s].id,i);break}}}this.statusCheck()}catch(e){return void this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.changeStatus=function(e,t,i){var n=this.stateArray.get(e),r=n.patternState.get(t);r.isMatch=!0,r.event=i,r.matchTime=i.local_time_ms||Date.now(),n.patternState.set(t,r),this.stateArray.set(e,n)},e.prototype.statusCheck=function(){var e,t,i,n;try{for(var r=Dc(this.stateArray),o=r.next();!o.done;o=r.next()){var a=Pc(o.value,2),s=a[0],l=a[1],c=l.patternState;if(l.isSingle)break;try{for(var u=Dc(c),h=u.next();!h.done;h=u.next()){var d=Pc(h.value,2),f=d[0],p=d[1];if(p.after&&(!p.after||c.get(p.after).isMatch)){if("NOT_FOLLOWED_BY"===p.connection){p.isMatch?this.reset(s,f):Date.now()-c.get(p.after).matchTime>p.window?this.publish([c.get(p.after).event,p.event],s,f):this.startWait(s,f,p);break}p.isMatch?p.matchTime-c.get(p.after).matchTime<=p.window?this.publish([c.get(p.after).event,p.event],s,f):this.reset(s,f):Date.now()-c.get(p.after).matchTime>p.window?this.reset(s,f):this.startWait(s,f,p);break}}}catch(e){i={error:e}}finally{try{h&&!h.done&&(n=u.return)&&n.call(u)}finally{if(i)throw i.error}}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.startWait=function(e,t,i){var n=this;try{this.waitArray.get(e)||this.waitArray.set(e,new Map);var r=this.waitArray.get(e);if(!r.get(t)){var o=setTimeout((function(){var r=n.stateArray.get(e).patternState,o=r.get(t);if("NOT_FOLLOWED_BY"===o.connection)!o.isMatch&&r.get(o.after).isMatch||o.matchTime-r.get(o.after).matchTime>i.window?((a=n.waitArray.get(e).get(t)).triggerWait=!0,n.waitArray.set(e,n.waitArray.get(e).set(t,a)),n.publish([r.get(o.after).event],e,t)):n.reset(e,t);else if("FOLLOWED_BY"===o.connection){var a;o.isMatch&&r.get(o.after).isMatch?((a=n.waitArray.get(e).get(t)).triggerWait=!0,n.waitArray.set(e,n.waitArray.get(e).set(t,a)),n.publish([r.get(o.after).event],e,t)):n.reset(e,t)}}),i.window);r.set(t,{waitFn:o,triggerWait:!1}),this.waitArray.set(e,r)}}catch(e){this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.rule=function(e,t,i,n){var r=this;try{var o=i.event,a=i.params;if(a=JSON.parse(a),-1!==kh.indexOf(n.op)){if(n.conditions&&n.conditions.length){var s=n.conditions,l=0,c=new Map;c.set(l,{op:n.op,result:void 0,resultList:[],resultKey:[],resultLength:s.length}),function i(n,s){for(var u=0;u<n.length;u++)if(l++,-1!==kh.indexOf(n[u].op)&&n[u].hasOwnProperty("conditions"))c.set(l,{op:n[u].op,result:void 0,fatherKey:s,resultList:[],resultKey:[],resultLength:n[u].conditions.length}),i(n[u].conditions,l);else{var h=r.scope(n[u].key),d=h.scope,f=h.key,p=h.key2,g=d?"header"===d?p?JSON.parse(e[p])[f]:e[f]:"user"===d?t[f]:a[f]:o,v=r.calculate(n[u].op,g,n[u].value);
1c.set(l,{op:n[u].op,result:v,fatherKey:s})}}(s,l);for(var u=c.get(0);void 0===u.result||u.resultList.length<u.resultLength;)c.forEach((function(e,t){if(void 0!==e.result&&void 0!==e.fatherKey){var i=c.get(e.fatherKey);i.resultList.length<i.resultLength&&-1===i.resultKey.indexOf(t)&&(i.resultKey.push(t),i.resultList.push(e.result),c.set(e.fatherKey,i))}})),c.forEach((function(e){e.resultList&&e.resultList.length===e.resultLength&&("and"===e.op&&(e.result=-1===e.resultList.indexOf(!1)),"or"===e.op&&(e.result=-1!==e.resultList.indexOf(!0)))}));return c.get(0).result}return!1}var h=this.scope(n.key),d=h.scope,f=h.key,p=h.key2,g=d?"header"===d?p?JSON.parse(e[p])[f]:e[f]:"user"===d?t[f]:a[f]:o;return this.calculate(n.op,g,n.value)}catch(e){return this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message}),!1}},e.prototype.publish=function(e,t,i){try{var n=this.configManager.get().user,r={biz_id:this.stateArray.get(t).pattern.biz_id,plan_id:t,uid:n.user_id||"",did:n.device_id||"",uuid:n.user_unique_id,events:e,extra:{url:window.location.href}};this.collect.emit("__cep_match",r),(window.opener||window.parent).postMessage({type:"__cep_match",data:r},"*"),this.event("__cep_trigger_sdk",t),this.addQuotas(t),this.reset(t,i)}catch(e){return void this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.addQuotas=function(e){var t=this.stateArray.get(e).quotas;if(t&&t.length){var i=this.storage.getItem(this.quotasKey)||{};i[e]||(i[e]={value:0,lastTime:Date.now()});var n=i[e].value;0===n&&(i[e].lastTime=Date.now()),i[e].value=n+1,this.storage.setItem(this.quotasKey,i)}},e.prototype.checkQuotas=function(e){var t=this.stateArray.get(e).quotas,i=this.storage.getItem(this.quotasKey)||{};if(i[e]||(i[e]={value:0,lastTime:Date.now()}),t&&t.length){var n=t[0].granularity,r=t[0].value;if("per_keyid"!==t[0].type)return!0;var o=this.release(n);return"all"===o?!(i[e].value>=r):Date.now()-i[e].lastTime>=o?(i[e].value=0,i[e].lastTime=Date.now(),this.storage.setItem(this.quotasKey,i),!0):!(i[e].value>=r)}return!0},e.prototype.clearQuotas=function(){this.storage.setItem(this.quotasKey,null)},e.prototype.release=function(e){if("all"===e)return e;var t=mh.duration(e);return t?t.asMilliseconds():"all"},e.prototype.reset=function(e,t){var i=this.stateArray.get(e);if(i.singleRule){var n=i.patternState.get(t);n.isMatch=!1,n.event=null,n.matchTime=0,n.initTime=Date.now(),i.patternState.set(t,n)}else i.patternState.forEach((function(e){e.isMatch=!1,e.event=null,e.matchTime=0,e.initTime=Date.now()}));this.stateArray.set(e,i);var r=this.waitArray.get(e);r&&r.get(t)&&(clearTimeout(r.get(t).waitFn),r.delete(t))},e.prototype.event=function(e,t){try{var i={event:e,params:JSON.stringify({plan_id:t||"",biz_id:this.stateArray.get(t).pattern.biz_id}),local_time_ms:Date.now()},n=this.configManager.get(),r=n.header,o=n.user;r.custom=JSON.stringify(r.custom);var a={events:[i],user:o,header:r};this.collect.requestManager.useRequest({url:this.reportUrl,data:[a]})}catch(e){return void this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.scope=function(e){var t="",i="";if(e.indexOf(".")>-1){var n=e.split(".");t=n[0],e=n[1],"header"===t&&"custom"===e&&(e=n[2],i=n[1])}return{scope:t,key:e,key2:i}},e.prototype.calculate=function(e,t,i){try{if("="===e)return t===i;if(-1!==["=","<",">",">=","<=","!="].indexOf(e))switch(e){case"=":return t===i;case"<":return t<i;case">":return t>i;case">=":return t>=i;case"<=":return t<=i;case"!=":return t!==i}else{if(-1!==["in","contains"].indexOf(e))return-1!==i.indexOf(t);if(-1!==["is not null","is null"].indexOf(e))return"is null"===e?null==t:null!=t;if(-1!==["startswith","endswith"].indexOf(e)){if("startswith"===e)return 0===t.indexOf(i);var n=t.length-i.length;return t.substr(n,i.length)===i}}}catch(e){return this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message}),!1}},e}(),Sh="undefined"!=typeof window?(window.LogPluginObject||(window.LogPluginObject={}),window.LogPluginObject):null,Th=function(){function e(){}return e.prototype.apply=function(e,t){this._plugin={},this.config=t,this.collect=e,this.channel=t.channel||"cn",this.loadExtend()},e.prototype.loadExtend=function(){var e=this;try{this.collect.remotePlugin.forEach((function(t,i){if("sdk"===t){if(ku.hasOwnProperty(i)){var n=ku[i].object,r=ku[i].src[e.channel]+"?query="+Date.now();e.exist(i,n,r)}}else"object"==l(t)&&(t.src?e.exist(i,t.call,t.src):e.process(i,t.instance,"INSTANCE"))}))}catch(e){this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.exist=function(e,t,i){var n=this;Sh[t]?this.process(e,Sh[t]):this.loadPlugin(e,i,(function(){n.process(e,Sh[t])}),(function(){}))},e.prototype.process=function(e,t,i){try{if(i){var n=new t;n.apply&&n.apply(this.collect,this.config)}else t&&t(this.collect,this.config)}catch(e){this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e.prototype.loadPlugin=function(e,t,i,n){var r=this;try{var o=document.createElement("script");o.src=t,this._plugin[e]||(this._plugin[e]=[]),this._plugin[e].push(i),o.onerror=function(){n(t)},o.onload=function(){r._plugin[e].forEach((function(e){e()}
1))},document.getElementsByTagName("head")[0].appendChild(o)}catch(e){this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message})}},e}(),Eh=function(){function e(){this.autotrack=!1,this.spa=!1,this.cache={},this.allowHash=!1}return e.prototype.apply=function(e,t){if(t.spa||t.autotrack){var i=e.Types;this.collect=e,this.config=t,this.appid=t.app_id,this.allowHash=t.allow_hash,this.fncArray=new Map,this.setKey(),this.setLocation(),this.hack(),this.init(),this.listener(),e.emit(i.RouteReady)}},e.prototype.setKey=function(){var e=this.collect.adapters.storage;this.storage=new e(!1),this.cache_key="__tea_cache_refer_"+this.appid,this.cache={refer_key:"",refer_title:document.title||location.pathname,refer_manual_key:"",routeChange:!1},this.config.autotrack&&"object"==l(this.config.autotrack)&&this.config.autotrack.page_manual_key&&(this.cache.refer_manual_key=this.config.autotrack.page_manual_key),this.storage.setItem(this.cache_key,this.cache)},e.prototype.hack=function(){var e=this,t=window.history.pushState;history.pushState=function(i){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(!e.collect.sdkStop&&!e.collect.destroy){"function"==typeof history.onpushstate&&history.onpushstate({state:i});var o=t.call.apply(t,Oc([history,i],n));if(e.lastLocation!==location.href){var a=e.getPopStateChangeEventData();return e.setReferCache(e.lastLocation),e.lastLocation=location.href,e.sendPv(a,"pushState"),o}}};var i=history.replaceState;history.replaceState=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(!e.collect.sdkStop&&!e.collect.destroy){"function"==typeof history.onreplacestate&&history.onreplacestate({state:t});var o=i.call.apply(i,Oc([history,t],n));if(e.lastLocation!==location.href){var a=e.getPopStateChangeEventData();return e.setReferCache(e.lastLocation),e.lastLocation=location.href,e.sendPv(a),o}}}},e.prototype.setLocation=function(){"undefined"!=typeof window&&(this.lastLocation=window.location.href)},e.prototype.getLocation=function(){return this.lastLocation},e.prototype.init=function(){var e=this.getPopStateChangeEventData();this.collect.emit("route-change",{config:e,init:!0})},e.prototype.listener=function(){var e=this,t=null;window.addEventListener("hashchange",(function(i){if(!e.collect.sdkStop&&!e.collect.destroy&&e.lastLocation!==window.location.href&&(clearTimeout(t),e.allowHash)){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var n=e.getPopStateChangeEventData();e.sendPv(n)}})),window.addEventListener("popstate",(function(i){e.collect.sdkStop||e.collect.destroy||e.lastLocation!==window.location.href&&(t=setTimeout((function(){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var t=e.getPopStateChangeEventData();e.sendPv(t)}),10))}))},e.prototype.getPopStateChangeEventData=function(){var e=this.pageConfig();return e.is_back=0,e},e.prototype.pageConfig=function(){try{var e,t=this.storage.getItem(this.cache_key)||{},i=this.storage.getItem("__tea_cache_first_"+this.appid);return e=!i||1!=i,{is_html:1,url:location.href,referrer:this.handleRefer(),page_key:location.href,refer_page_key:this.handleRefer(),page_title:document.title||location.pathname,page_manual_key:this.config.autotrack&&this.config.autotrack.page_manual_key||"",refer_page_manual_key:t&&t.refer_manual_key||"",refer_page_title:t&&t.refer_title||"",page_path:location.pathname,page_host:location.host,is_first_time:""+e}}catch(e){return this.collect.emit(Wc.DEBUGGER_MESSAGE,{type:Wc.DEBUGGER_MESSAGE_SDK,info:"åçäºå¼å¸¸",level:"error",time:Date.now(),data:e.message}),{}}},e.prototype.sendPv=function(e,t){this.collect.emit("route-change",{config:e,init:!1})},e.prototype.handleRefer=function(){var e="";try{var t=this.storage.getItem()||{};e=t.routeChange?t.refer_key:this.collect.configManager.get("referrer")}catch(t){e=document.referrer}return e},e.prototype.setReferCache=function(e){var t=this.storage.getItem(this.cache_key)||{};t.refer_key=e,t.routeChange=!0,this.storage.setItem(this.cache_key,t)},e}();Su.usePlugin(Th,"extend"),Su.usePlugin(Nu,"ab"),Su.usePlugin(Hu,"stay"),Su.usePlugin(ph,"autotrack"),Su.usePlugin(Bu,"et"),Su.usePlugin(Fu,"profile"),Su.usePlugin(yh,"retry"),Su.usePlugin(wh,"cep"),Su.usePlugin(Vu,"heartbeat"),Su.usePlugin(zu,"monitor"),Su.usePlugin(Eh,"route"),Su.usePlugin(vh,"tracer"),new Su("default");var Ch=Su;function xh(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Dh(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};
vendor: 9,835 bytes, line 1
1t%2?xh(Object(i),!0).forEach((function(t){Ah(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):xh(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Ph(e){return(Ph="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 Oh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ih(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Mh(n.key),n)}}function Lh(e,t,i){return t&&Ih(e.prototype,t),i&&Ih(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ah(e,t,i){return(t=Mh(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Rh(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function Mh(e){var t=function(e,t){if("object"!==l(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===l(t)?t:String(t)}var Nh=function(e){return e&&e.Math==Math&&e},Bh=Nh("object"==("undefined"==typeof globalThis?"undefined":l(globalThis))&&globalThis)||Nh("object"==("undefined"==typeof window?"undefined":l(window))&&window)||Nh("object"==("undefined"==typeof self?"undefined":l(self))&&self)||Nh("object"==l(kn)&&kn)||function(){return this}()||kn||Function("return this")(),Uh={},jh=function(e){try{return!!e()}catch(e){return!0}},Hh=!jh((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),Fh=!jh((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),Vh=Fh,zh=Function.prototype.call,Gh=Vh?zh.bind(zh):function(){return zh.apply(zh,arguments)},Wh={},Kh={}.propertyIsEnumerable,Yh=Object.getOwnPropertyDescriptor,$h=Yh&&!Kh.call({1:2},1);Wh.f=$h?function(e){var t=Yh(this,e);return!!t&&t.enumerable}:Kh;var qh,Xh,Jh=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Zh=Fh,Qh=Function.prototype,ed=Qh.call,td=Zh&&Qh.bind.bind(ed,ed),id=Zh?td:function(e){return function(){return ed.apply(e,arguments)}},nd=id,rd=nd({}.toString),od=nd("".slice),ad=function(e){return od(rd(e),8,-1)},sd=jh,ld=ad,cd=Object,ud=id("".split),hd=sd((function(){return!cd("z").propertyIsEnumerable(0)}))?function(e){return"String"==ld(e)?ud(e,""):cd(e)}:cd,dd=function(e){return null==e},fd=dd,pd=TypeError,gd=function(e){if(fd(e))throw pd("Can't call method on "+e);return e},vd=hd,yd=gd,md=function(e){return vd(yd(e))},_d="object"==("undefined"==typeof document?"undefined":l(document))&&document.all,bd={all:_d,IS_HTMLDDA:void 0===_d&&void 0!==_d},kd=bd.all,wd=bd.IS_HTMLDDA?function(e){return"function"==typeof e||e===kd}:function(e){return"function"==typeof e},Sd=wd,Td=bd.all,Ed=bd.IS_HTMLDDA?function(e){return"object"==l(e)?null!==e:Sd(e)||e===Td}:function(e){return"object"==l(e)?null!==e:Sd(e)},Cd=Bh,xd=wd,Dd=function(e){return xd(e)?e:void 0},Pd=function(e,t){return arguments.length<2?Dd(Cd[e]):Cd[e]&&Cd[e][t]},Od=id({}.isPrototypeOf),Id="undefined"!=typeof navigator&&String(navigator.userAgent)||"",Ld=Bh,Ad=Id,Rd=Ld.process,Md=Ld.Deno,Nd=Rd&&Rd.versions||Md&&Md.version,Bd=Nd&&Nd.v8;Bd&&(Xh=(qh=Bd.split("."))[0]>0&&qh[0]<4?1:+(qh[0]+qh[1])),!Xh&&Ad&&(!(qh=Ad.match(/Edge\/(\d+)/))||qh[1]>=74)&&(qh=Ad.match(/Chrome\/(\d+)/))&&(Xh=+qh[1]);var Ud=Xh,jd=Ud,Hd=jh,Fd=Bh.String,Vd=!!Object.getOwnPropertySymbols&&!Hd((function(){var e=Symbol();return!Fd(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&jd&&jd<41})),zd=Vd&&!Symbol.sham&&"symbol"==l(Symbol.iterator),Gd=Pd,Wd=wd,Kd=Od,Yd=Object,$d=zd?function(e){return"symbol"==l(e)}:function(e){var t=Gd("Symbol");return Wd(t)&&Kd(t.prototype,Yd(e))},qd=String,Xd=function(e){try{return qd(e)}catch(e){return"Object"}},Jd=wd,Zd=Xd,Qd=TypeError,ef=function(e){if(Jd(e))return e;throw Qd(Zd(e)+" is not a function")},tf=ef,nf=dd,rf=function(e,t){var i=e[t];return nf(i)?void 0:tf(i)},of=Gh,af=wd,sf=Ed,lf=TypeError,cf={exports:{}},uf=Bh,hf=Object.defineProperty,df=function(e,t){try{hf(uf,e,{value:t,configurable:!0,writable:!0})}catch(i){uf[e]=t}return t},ff=df,pf="__core-js_shared__",gf=Bh[pf]||ff(pf,{}),vf=gf;(cf.exports=function(e,t){return vf[e]||(vf[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.32.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.0/LICENSE",source:"https://github.com/zloirock/core-js"});var yf=gd,mf=Object,_f=function(e){return mf(yf(e))},bf=_f,kf=id({}.hasOwnProperty),wf=Object.hasOwn||function(e,t){return kf(bf(e),t)},Sf=id,Tf=0,Ef=Math.random(),Cf=Sf(1..toString),xf=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Cf(++Tf+Ef,36)},Df=Bh,Pf=cf.exports,Of=wf,If=xf,Lf=Vd,Af=zd,Rf=Df.Symbol,Mf=Pf("wks"),Nf=Af?Rf.for||Rf:Rf&&Rf.withoutSetter||If,Bf=function(e){return Of(Mf,e)||(Mf[e]=Lf&&Of(Rf,e)?Rf[e]:Nf("Symbol."+e)),Mf[e]},Uf=Gh,jf=Ed,Hf=$d,Ff=rf,Vf=function(e,t){var i,n;if("string"===t&&af(i=e.toString)&&!sf(n=of(i,e)))return n;if(af(i=e.valueOf)&&!sf(n=of(i,e)))return n;if("string"!==t&&af(i=e.toString)&&!sf(n=of(i,e)))return n;throw lf("Can't convert object to primitive value")},zf=TypeError,Gf=Bf("toPrimitive"),Wf=function(e,t){if(!jf(e)||Hf(e))return e;var i,n=Ff(e,Gf);if(n){if(void 0===t&&(t="default"),i=Uf(n,e,t),!jf(i)||Hf(i))return i;throw zf("Can't convert object to primitive value")}return void 0===t&&(t="number"),Vf(e,t)},Kf=Wf,Yf=$d,$f=function(e){var t=Kf(e,"string");return Yf(t)?t:t+""},qf=Ed,Xf=Bh.document,Jf=qf(Xf)&&qf(Xf.createElement),Zf=function(e){return Jf?Xf.createElement(e):{}},Qf=Zf,ep=!Hh&&!jh((function(){return 7!=Object.defineProperty(Qf("div"),"a",{get:function(){return 7}}).a})),tp=Hh,ip=Gh,np=Wh,rp=Jh,op=md,ap=$f,sp=wf,lp=ep,cp=Object.getOwnPropertyDescriptor;Uh.f=tp?cp:function(e,t){if(e=op(e),t=ap(t),lp)try{return cp(e,t)}catch(e){}if(sp(e,t))return rp(!ip(np.f,e,t),e[t])};var up={},hp=Hh&&jh((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),dp=Ed,fp=String,pp=TypeError,gp=function(e){if(dp(e))return e;throw pp(fp(e)+" is not an object")},vp=Hh,yp=ep,mp=hp,_p=gp,bp=$f,kp=TypeError,wp=Object.defineProperty,Sp=Object.getOwnPropertyDescriptor,Tp="enumerable",Ep="configurable",Cp="writable";up.f=vp?mp?function(e,t,i){if(_p(e),t=bp(t),_p(i),"function"==typeof e&&"prototype"===t&&"value"in i&&Cp in i&&!i.writable){var n=Sp(e,t);n&&n.writable&&(e[t]=i.value,i={configurable:Ep in i?i.configurable:n.configurable,enumerable:Tp in i?i.enumerable:n.enumerable,writable:!1})}return wp(e,t,i)}:wp:function(e,t,i){if(_p(e),t=bp(t),_p(i),yp)try{return wp(e,t,i)}catch(e){}if("get"in i||"set"in i)throw kp("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var xp=up,Dp=Jh,Pp=Hh?function(e,t,i){return xp.f(e,t,Dp(1,i))}:function(e,t,i){return e[t]=i,e},Op={exports:{}},Ip=Hh,Lp=wf,Ap=Function.prototype,Rp=Ip&&Object.getOwnPropertyDescriptor,Mp=Lp(Ap,"name"),Np={EXISTS:Mp,PROPER:Mp&&"something"===function(){}.name,CONFIGURABLE:Mp&&(!Ip||Ip&&Rp(Ap,"name").configurable)},Bp=wd,Up=gf,jp=id(Function.toString);Bp(Up.inspectSource)||(Up.inspectSource=function(e){return jp(e)});var Hp,Fp,Vp,zp=Up.inspectSource,Gp=wd,Wp=Bh.WeakMap,Kp=Gp(Wp)&&/native code/.test(String(Wp)),Yp=cf.exports,$p=xf,qp=Yp("keys"),Xp=function(e){return qp[e]||(qp[e]=$p(e))},Jp={},Zp=Kp,Qp=Bh,eg=Ed,tg=Pp,ig=wf,ng=gf,rg=Xp,og=Jp,ag="Object already initialized",sg=Qp.TypeError,lg=Qp.WeakMap;if(Zp||ng.state){var cg=ng.state||(ng.state=new lg);cg.get=cg.get,cg.has=cg.has,cg.set=cg.set,Hp=function(e,t){if(cg.has(e))throw sg(ag);return t.facade=e,cg.set(e,t),t},Fp=function(e){return cg.get(e)||{}},Vp=function(e){return cg.has(e)}}else{var ug=rg("state");og[ug]=!0,Hp=function(e,t){if(ig(e,ug))throw sg(ag);return t.facade=e,tg(e,ug,t),t},Fp=function(e){return ig(e,ug)?e[ug]:{}},Vp=function(e){return ig(e,ug)}}var hg={set:Hp,get:Fp,has:Vp,enforce:function(e){return Vp(e)?Fp(e):Hp(e,{})},getterFor:function(e){return function(t){var i;if(!eg(t)||(i=Fp(t)).type!==e)throw sg("Incompatible receiver, "+e+" required");return i}}},dg=id,fg=jh,pg=wd,gg=wf,vg=Hh,yg=Np.CONFIGURABLE,mg=zp,_g=hg.enforce,bg=hg.get,kg=String,wg=Object.defineProperty,Sg=dg("".slice),Tg=dg("".replace),Eg=dg([].join),Cg=vg&&!fg((function(){return 8!==wg((function(){}),"length",{value:8}).length})),xg=String(String).split("String"),Dg=Op.exports=function(e,t,i){"Symbol("===Sg(kg(t),0,7)&&(t="["+Tg(kg(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!gg(e,"name")||yg&&e.name!==t)&&(vg?wg(e,"name",{value:t,configurable:!0}):e.name=t),Cg&&i&&gg(i,"arity")&&e.length!==i.arity&&wg(e,"length",{value:i.arity});try{i&&gg(i,"constructor")&&i.constructor?vg&&wg(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=_g(e);return gg(n,"source")||(n.source=Eg(xg,"string"==typeof t?t:"")),e};Function.prototype.toString=Dg((function(){return pg(this)&&bg(this).source||mg(this)}),"toString");var Pg=wd,Og=up,Ig=Op.exports,Lg=df,Ag=function(e,t,i,n){n||(n={});var r=n.enumerable,o=void 0!==n.name?n.name:t;if(Pg(i)&&Ig(i,o,n),n.global)r?e[t]=i:Lg(t,i);
vendor: 5,080 bytes, line 1
1else{try{n.unsafe?e[t]&&(r=!0):delete e[t]}catch(e){}r?e[t]=i:Og.f(e,t,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Rg={},Mg=Math.ceil,Ng=Math.floor,Bg=Math.trunc||function(e){var t=+e;return(t>0?Ng:Mg)(t)},Ug=function(e){var t=+e;return t!=t||0===t?0:Bg(t)},jg=Ug,Hg=Math.max,Fg=Math.min,Vg=function(e,t){var i=jg(e);return i<0?Hg(i+t,0):Fg(i,t)},zg=Ug,Gg=Math.min,Wg=function(e){return e>0?Gg(zg(e),9007199254740991):0},Kg=Wg,Yg=function(e){return Kg(e.length)},$g=md,qg=Vg,Xg=Yg,Jg=function(e){return function(t,i,n){var r,o=$g(t),a=Xg(o),s=qg(n,a);if(e&&i!=i){for(;a>s;)if((r=o[s++])!=r)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===i)return e||s||0;return!e&&-1}},Zg={includes:Jg(!0),indexOf:Jg(!1)},Qg=wf,ev=md,tv=Zg.indexOf,iv=Jp,nv=id([].push),rv=function(e,t){var i,n=ev(e),r=0,o=[];for(i in n)!Qg(iv,i)&&Qg(n,i)&&nv(o,i);for(;t.length>r;)Qg(n,i=t[r++])&&(~tv(o,i)||nv(o,i));return o},ov=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],av=rv,sv=ov.concat("length","prototype");Rg.f=Object.getOwnPropertyNames||function(e){return av(e,sv)};var lv={};lv.f=Object.getOwnPropertySymbols;var cv=Pd,uv=Rg,hv=lv,dv=gp,fv=id([].concat),pv=cv("Reflect","ownKeys")||function(e){var t=uv.f(dv(e)),i=hv.f;return i?fv(t,i(e)):t},gv=wf,vv=pv,yv=Uh,mv=up,_v=function(e,t,i){for(var n=vv(t),r=mv.f,o=yv.f,a=0;a<n.length;a++){var s=n[a];gv(e,s)||i&&gv(i,s)||r(e,s,o(t,s))}},bv=jh,kv=wd,wv=/#|\.prototype\./,Sv=function(e,t){var i=Ev[Tv(e)];return i==xv||i!=Cv&&(kv(t)?bv(t):!!t)},Tv=Sv.normalize=function(e){return String(e).replace(wv,".").toLowerCase()},Ev=Sv.data={},Cv=Sv.NATIVE="N",xv=Sv.POLYFILL="P",Dv=Sv,Pv=Bh,Ov=Uh.f,Iv=Pp,Lv=Ag,Av=df,Rv=_v,Mv=Dv,Nv=function(e,t){var i,n,r,o,a,s=e.target,c=e.global,u=e.stat;if(i=c?Pv:u?Pv[s]||Av(s,{}):(Pv[s]||{}).prototype)for(n in t){if(o=t[n],r=e.dontCallGetSet?(a=Ov(i,n))&&a.value:i[n],!Mv(c?n:s+(u?".":"#")+n,e.forced)&&void 0!==r){if(l(o)==l(r))continue;Rv(o,r)}(e.sham||r&&r.sham)&&Iv(o,"sham",!0),Lv(i,n,o,e)}},Bv=ad,Uv=Array.isArray||function(e){return"Array"==Bv(e)},jv=TypeError,Hv=function(e){if(e>9007199254740991)throw jv("Maximum allowed index exceeded");return e},Fv=$f,Vv=up,zv=Jh,Gv=function(e,t,i){var n=Fv(t);n in e?Vv.f(e,n,zv(0,i)):e[n]=i},Wv={};Wv[Bf("toStringTag")]="z";var Kv="[object z]"===String(Wv),Yv=Kv,$v=wd,qv=ad,Xv=Bf("toStringTag"),Jv=Object,Zv="Arguments"==qv(function(){return arguments}()),Qv=Yv?qv:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=Jv(e),Xv))?i:Zv?qv(t):"Object"==(n=qv(t))&&$v(t.callee)?"Arguments":n},ey=id,ty=jh,iy=wd,ny=Qv,ry=zp,oy=function(){},ay=[],sy=Pd("Reflect","construct"),ly=/^\s*(?:class|function)\b/,cy=ey(ly.exec),uy=!ly.exec(oy),hy=function(e){if(!iy(e))return!1;try{return sy(oy,ay,e),!0}catch(e){return!1}},dy=function(e){if(!iy(e))return!1;switch(ny(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return uy||!!cy(ly,ry(e))}catch(e){return!0}};dy.sham=!0;var fy=!sy||ty((function(){var e;return hy(hy.call)||!hy(Object)||!hy((function(){e=!0}))||e}))?dy:hy,py=Uv,gy=fy,vy=Ed,yy=Bf("species"),my=Array,_y=function(e){var t;return py(e)&&(t=e.constructor,(gy(t)&&(t===my||py(t.prototype))||vy(t)&&null===(t=t[yy]))&&(t=void 0)),void 0===t?my:t},by=function(e,t){return new(_y(e))(0===t?0:t)},ky=jh,wy=Ud,Sy=Bf("species"),Ty=function(e){return wy>=51||!ky((function(){var t=[];return(t.constructor={})[Sy]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Ey=Nv,Cy=jh,xy=Uv,Dy=Ed,Py=_f,Oy=Yg,Iy=Hv,Ly=Gv,Ay=by,Ry=Ty,My=Ud,Ny=Bf("isConcatSpreadable"),By=My>=51||!Cy((function(){var e=[];return e[Ny]=!1,e.concat()[0]!==e})),Uy=function(e){if(!Dy(e))return!1;var t=e[Ny];return void 0!==t?!!t:xy(e)};Ey({target:"Array",proto:!0,arity:1,forced:!By||!Ry("concat")},{concat:function(e){var t,i,n,r,o,a=Py(this),s=Ay(a,0),l=0;for(t=-1,n=arguments.length;t<n;t++)if(Uy(o=-1===t?a:arguments[t]))for(r=Oy(o),Iy(l+r),i=0;i<r;i++,l++)i in o&&Ly(s,l,o[i]);else Iy(l+1),Ly(s,l++,o);return s.length=l,s}});var jy=ad,Hy=id,Fy=function(e){if("Function"===jy(e))return Hy(e)},Vy=ef,zy=Fh,Gy=Fy(Fy.bind),Wy=function(e,t){return Vy(e),void 0===t?e:zy?Gy(e,t):function(){return e.apply(t,arguments)}},Ky=Wy,Yy=hd,$y=_f,qy=Yg,Xy=by,Jy=id([].push),Zy=function(e){var t=1==e,i=2==e,n=3==e,r=4==e,o=6==e,a=7==e,s=5==e||o;return function(l,c,u,h){for(var d,f,p=$y(l),g=Yy(p),v=Ky(c,u),y=qy(g),m=0,_=h||Xy,b=t?_(l,y):i||a?_(l,0):void 0;y>m;m++)if((s||m in g)&&(f=v(d=g[m],m,p),e))if(t)b[m]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:Jy(b,d)}else switch(e){case 4:return!1;case 7:Jy(b,d)}return o?-1:n||r?r:b}},Qy={forEach:Zy(0),map:Zy(1),filter:Zy(2),some:Zy(3),every:Zy(4),find:Zy(5),findIndex:Zy(6),filterReject:Zy(7)},em=Qy.map;Nv({target:"Array",proto:!0,forced:!Ty("map")},{map:function(e){return em(this,e,arguments.length>1?arguments[1]:void 0)}});var tm=rv,im=ov,nm=Object.keys||function(e){return tm(e,im)},rm=_f,om=nm;
vendor: 8,954 bytes, line 1
1Nv({target:"Object",stat:!0,forced:jh((function(){om(1)}))},{keys:function(e){return om(rm(e))}});var am=Qv,sm=String,lm=function(e){if("Symbol"===am(e))throw TypeError("Cannot convert a Symbol value to a string");return sm(e)},cm=id,um=Ug,hm=lm,dm=gd,fm=cm("".charAt),pm=cm("".charCodeAt),gm=cm("".slice),vm=function(e){return function(t,i){var n,r,o=hm(dm(t)),a=um(i),s=o.length;return a<0||a>=s?e?"":void 0:(n=pm(o,a))<55296||n>56319||a+1===s||(r=pm(o,a+1))<56320||r>57343?e?fm(o,a):n:e?gm(o,a,a+2):r-56320+(n-55296<<10)+65536}},ym={codeAt:vm(!1),charAt:vm(!0)},mm=ym.charAt,_m=gd,bm=Ug,km=lm;Nv({target:"String",proto:!0,forced:!0},{at:function(e){var t=km(_m(this)),i=t.length,n=bm(e),r=n>=0?n:i+n;return r<0||r>=i?void 0:mm(t,r)}});var wm=Qv,Sm=Kv?{}.toString:function(){return"[object "+wm(this)+"]"};Kv||Ag(Object.prototype,"toString",Sm,{unsafe:!0});var Tm=gp,Em=function(){var e=Tm(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},Cm=Gh,xm=wf,Dm=Od,Pm=Em,Om=RegExp.prototype,Im=function(e){var t=e.flags;return void 0!==t||"flags"in Om||xm(e,"flags")||!Dm(Om,e)?t:Cm(Pm,e)},Lm=Np.PROPER,Am=Ag,Rm=gp,Mm=lm,Nm=jh,Bm=Im,Um="toString",jm=RegExp.prototype.toString,Hm=Nm((function(){return"/a/b"!=jm.call({source:"a",flags:"b"})})),Fm=Lm&&jm.name!=Um;(Hm||Fm)&&Am(RegExp.prototype,Um,(function(){var e=Rm(this);return"/"+Mm(e.source)+"/"+Mm(Bm(e))}),{unsafe:!0});var Vm=Zf("span").classList,zm=Vm&&Vm.constructor&&Vm.constructor.prototype,Gm=zm===Object.prototype?void 0:zm,Wm=jh,Km=function(e,t){var i=[][e];return!!i&&Wm((function(){i.call(null,t||function(){return 1},1)}))},Ym=Qy.forEach,$m=Km("forEach")?[].forEach:function(e){return Ym(this,e,arguments.length>1?arguments[1]:void 0)},qm=Bh,Xm={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Jm=Gm,Zm=$m,Qm=Pp,e_=function(e){if(e&&e.forEach!==Zm)try{Qm(e,"forEach",Zm)}catch(t){e.forEach=Zm}};for(var t_ in Xm)Xm[t_]&&e_(qm[t_]&&qm[t_].prototype);e_(Jm);var i_=Bh,n_=id,r_=ef,o_=wd,a_=String,s_=TypeError,l_=function(e,t,i){try{return n_(r_(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}},c_=gp,u_=function(e){if("object"==l(e)||o_(e))return e;throw s_("Can't set "+a_(e)+" as a prototype")},h_=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=l_(Object.prototype,"__proto__","set"))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return c_(i),u_(n),t?e(i,n):i.__proto__=n,i}}():void 0),d_=wd,f_=Ed,p_=h_,g_=function(e,t,i){var n,r;return p_&&d_(n=t.constructor)&&n!==i&&f_(r=n.prototype)&&r!==i.prototype&&p_(e,r),e},v_=id(1..valueOf),y_="\t\n\v\f\r  áââââââ
ââââââ¯âã\u2028\u2029\ufeff",m_=gd,__=lm,b_=y_,k_=id("".replace),w_=RegExp("^["+b_+"]+"),S_=RegExp("(^|[^"+b_+"])["+b_+"]+$"),T_=function(e){return function(t){var i=__(m_(t));return 1&e&&(i=k_(i,w_,"")),2&e&&(i=k_(i,S_,"$1")),i}},E_={start:T_(1),end:T_(2),trim:T_(3)},C_=Nv,x_=Hh,D_=Bh,P_=i_,O_=id,I_=Dv,L_=wf,A_=g_,R_=Od,M_=$d,N_=Wf,B_=jh,U_=Rg.f,j_=Uh.f,H_=up.f,F_=v_,V_=E_.trim,z_="Number",G_=D_.Number;P_.Number;var W_=G_.prototype,K_=D_.TypeError,Y_=O_("".slice),$_=O_("".charCodeAt),q_=function(e){var t=N_(e,"number");return"bigint"==typeof t?t:X_(t)},X_=function(e){var t,i,n,r,o,a,s,l,c=N_(e,"number");if(M_(c))throw K_("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=V_(c),43===(t=$_(c,0))||45===t){if(88===(i=$_(c,2))||120===i)return NaN}else if(48===t){switch($_(c,1)){case 66:case 98:n=2,r=49;break;case 79:case 111:n=8,r=55;break;default:return+c}for(a=(o=Y_(c,2)).length,s=0;s<a;s++)if((l=$_(o,s))<48||l>r)return NaN;return parseInt(o,n)}return+c},J_=I_(z_,!G_(" 0o1")||!G_("0b1")||G_("+0x1")),Z_=function(e){return R_(W_,e)&&B_((function(){F_(e)}))},Q_=function(e){var t=arguments.length<1?0:G_(q_(e));return Z_(this)?A_(Object(t),this,Q_):t};Q_.prototype=W_,J_&&(W_.constructor=Q_),C_({global:!0,constructor:!0,wrap:!0,forced:J_},{Number:Q_}),J_&&function(e,t){for(var i,n=x_?U_(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),r=0;n.length>r;r++)L_(t,i=n[r])&&!L_(e,i)&&H_(e,i,j_(t,i))}(P_.Number,G_);var eb=Op.exports,tb=up,ib=function(e,t,i){return i.get&&eb(i.get,t,{getter:!0}),i.set&&eb(i.set,t,{setter:!0}),tb.f(e,t,i)},nb=Hh,rb=Np.EXISTS,ob=id,ab=ib,sb=Function.prototype,lb=ob(sb.toString),cb=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,ub=ob(cb.exec);nb&&!rb&&ab(sb,"name",{configurable:!0,get:function(){try{return ub(cb,lb(this))[1]}catch(e){return""}}});var hb=Nv,db=hd,fb=md,pb=Km,gb=id([].join);hb({target:"Array",proto:!0,forced:db!=Object||!pb("join",",")},{join:function(e){return gb(fb(this),void 0===e?",":e)}});var vb,yb,mb,_b,bb=void 0!==n&&"process"==ad(n),kb=up.f,wb=wf,Sb=Bf("toStringTag"),Tb=function(e,t,i){e&&!i&&(e=e.prototype),e&&!wb(e,Sb)&&kb(e,Sb,{configurable:!0,value:t})},Eb=Pd,Cb=ib,xb=Hh,Db=Bf("species"),Pb=function(e){var t=Eb(e);xb&&t&&!t[Db]&&Cb(t,Db,{configurable:!0,get:function(){return this}})},Ob=Od,Ib=TypeError,Lb=fy,Ab=Xd,Rb=TypeError,Mb=gp,Nb=function(e){if(Lb(e))return e;throw Rb(Ab(e)+" is not a constructor")},Bb=dd,Ub=Bf("species"),jb=function(e,t){var i,n=Mb(e).constructor;return void 0===n||Bb(i=Mb(n)[Ub])?t:Nb(i)},Hb=Fh,Fb=Function.prototype,Vb=Fb.apply,zb=Fb.call,Gb="object"==("undefined"==typeof Reflect?"undefined":l(Reflect))&&Reflect.apply||(Hb?zb.bind(Vb):function(){return zb.apply(Vb,arguments)}),Wb=Pd("document","documentElement"),Kb=id([].slice),Yb=TypeError,$b=function(e,t){if(e<t)throw Yb("Not enough arguments");return e},qb=/(?:ipad|iphone|ipod).*applewebkit/i.test(Id),Xb=Bh,Jb=Gb,Zb=Wy,Qb=wd,ek=wf,tk=jh,ik=Wb,nk=Kb,rk=Zf,ok=$b,ak=qb,sk=bb,lk=Xb.setImmediate,ck=Xb.clearImmediate,uk=Xb.process,hk=Xb.Dispatch,dk=Xb.Function,fk=Xb.MessageChannel,pk=Xb.String,gk=0,vk={},yk="onreadystatechange";tk((function(){vb=Xb.location}));var mk=function(e){if(ek(vk,e)){var t=vk[e];delete vk[e],t()}},_k=function(e){return function(){mk(e)}},bk=function(e){mk(e.data)},kk=function(e){Xb.postMessage(pk(e),vb.protocol+"//"+vb.host)};lk&&ck||(lk=function(e){ok(arguments.length,1);var t=Qb(e)?e:dk(e),i=nk(arguments,1);return vk[++gk]=function(){Jb(t,void 0,i)},yb(gk),gk},ck=function(e){delete vk[e]},sk?yb=function(e){uk.nextTick(_k(e))}:hk&&hk.now?yb=function(e){hk.now(_k(e))}:fk&&!ak?(_b=(mb=new fk).port2,mb.port1.onmessage=bk,yb=Zb(_b.postMessage,_b)):Xb.addEventListener&&Qb(Xb.postMessage)&&!Xb.importScripts&&vb&&"file:"!==vb.protocol&&!tk(kk)?(yb=kk,Xb.addEventListener("message",bk,!1)):yb=yk in rk("script")?function(e){ik.appendChild(rk("script")).onreadystatechange=function(){ik.removeChild(this),mk(e)}}:function(e){setTimeout(_k(e),0)});var wk={set:lk,clear:ck},Sk=function(){this.head=null,this.tail=null};Sk.prototype={add:function(e){var t={item:e,next:null},i=this.tail;i?i.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var Tk,Ek,Ck,xk,Dk,Pk=Sk,Ok=/ipad|iphone|ipod/i.test(Id)&&"undefined"!=typeof Pebble,Ik=/web0s(?!.*chrome)/i.test(Id),Lk=Bh,Ak=Wy,Rk=Uh.f,Mk=wk.set,Nk=Pk,Bk=qb,Uk=Ok,jk=Ik,Hk=bb,Fk=Lk.MutationObserver||Lk.WebKitMutationObserver,Vk=Lk.document,zk=Lk.process,Gk=Lk.Promise,Wk=Rk(Lk,"queueMicrotask"),Kk=Wk&&Wk.value;if(!Kk){var Yk=new Nk,$k=function(){var e,t;for(Hk&&(e=zk.domain)&&e.exit();t=Yk.get();)try{t()}catch(e){throw Yk.head&&Tk(),e}e&&e.enter()};Bk||Hk||jk||!Fk||!Vk?!Uk&&Gk&&Gk.resolve?((xk=Gk.resolve(void 0)).constructor=Gk,Dk=Ak(xk.then,xk),Tk=function(){Dk($k)}):Hk?Tk=function(){zk.nextTick($k)}:(Mk=Ak(Mk,Lk),Tk=function(){Mk($k)}):(Ek=!0,Ck=Vk.createTextNode(""),new Fk($k).observe(Ck,{characterData:!0}),Tk=function(){Ck.data=Ek=!Ek}),Kk=function(e){Yk.head||Tk(),Yk.add(e)}}var qk=Kk,Xk=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Jk=Bh.Promise,Zk="object"==("undefined"==typeof Deno?"undefined":l(Deno))&&Deno&&"object"==l(Deno.version),Qk=!Zk&&!bb&&"object"==("undefined"==typeof window?"undefined":l(window))&&"object"==("undefined"==typeof document?"undefined":l(document)),ew=Bh,tw=Jk,iw=wd,nw=Dv,rw=zp,ow=Bf,aw=Qk,sw=Zk,lw=Ud;tw&&tw.prototype;var cw=ow("species"),uw=!1,hw=iw(ew.PromiseRejectionEvent),dw={CONSTRUCTOR:nw("Promise",(function(){var e=rw(tw),t=e!==String(tw);if(!t&&66===lw)return!0;
vendor: 4,203 bytes, line 1
1if(!lw||lw<51||!/native code/.test(e)){var i=new tw((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((i.constructor={})[cw]=n,!(uw=i.then((function(){}))instanceof n))return!0}return!t&&(aw||sw)&&!hw})),REJECTION_EVENT:hw,SUBCLASSING:uw},fw={},pw=ef,gw=TypeError,vw=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw gw("Bad Promise constructor");t=e,i=n})),this.resolve=pw(t),this.reject=pw(i)};fw.f=function(e){return new vw(e)};var yw,mw,_w,bw=Nv,kw=bb,ww=Bh,Sw=Gh,Tw=Ag,Ew=h_,Cw=Tb,xw=Pb,Dw=ef,Pw=wd,Ow=Ed,Iw=function(e,t){if(Ob(t,e))return e;throw Ib("Incorrect invocation")},Lw=jb,Aw=wk.set,Rw=qk,Mw=function(e,t){},Nw=Xk,Bw=Pk,Uw=hg,jw=Jk,Hw=fw,Fw="Promise",Vw=dw.CONSTRUCTOR,zw=dw.REJECTION_EVENT,Gw=dw.SUBCLASSING,Ww=Uw.getterFor(Fw),Kw=Uw.set,Yw=jw&&jw.prototype,$w=jw,qw=Yw,Xw=ww.TypeError,Jw=ww.document,Zw=ww.process,Qw=Hw.f,eS=Qw,tS=!!(Jw&&Jw.createEvent&&ww.dispatchEvent),iS="unhandledrejection",nS=function(e){var t;return!(!Ow(e)||!Pw(t=e.then))&&t},rS=function(e,t){var i,n,r,o=t.value,a=1==t.state,s=a?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{s?(a||(2===t.rejection&&cS(t),t.rejection=1),!0===s?i=o:(u&&u.enter(),i=s(o),u&&(u.exit(),r=!0)),i===e.promise?c(Xw("Promise-chain cycle")):(n=nS(i))?Sw(n,i,l,c):l(i)):c(o)}catch(e){u&&!r&&u.exit(),c(e)}},oS=function(e,t){e.notified||(e.notified=!0,Rw((function(){for(var i,n=e.reactions;i=n.get();)rS(i,e);e.notified=!1,t&&!e.rejection&&sS(e)})))},aS=function(e,t,i){var n,r;tS?((n=Jw.createEvent("Event")).promise=t,n.reason=i,n.initEvent(e,!1,!0),ww.dispatchEvent(n)):n={promise:t,reason:i},!zw&&(r=ww["on"+e])?r(n):e===iS&&Mw("Unhandled promise rejection",i)},sS=function(e){Sw(Aw,ww,(function(){var t,i=e.facade,n=e.value;if(lS(e)&&(t=Nw((function(){kw?Zw.emit("unhandledRejection",n,i):aS(iS,i,n)})),e.rejection=kw||lS(e)?2:1,t.error))throw t.value}))},lS=function(e){return 1!==e.rejection&&!e.parent},cS=function(e){Sw(Aw,ww,(function(){var t=e.facade;kw?Zw.emit("rejectionHandled",t):aS("rejectionhandled",t,e.value)}))},uS=function(e,t,i){return function(n){e(t,n,i)}},hS=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=2,oS(e,!0))},dS=function e(t,i,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===i)throw Xw("Promise can't be resolved itself");var r=nS(i);r?Rw((function(){var n={done:!1};try{Sw(r,i,uS(e,n,t),uS(hS,n,t))}catch(e){hS(n,e,t)}})):(t.value=i,t.state=1,oS(t,!1))}catch(e){hS({done:!1},e,t)}}};if(Vw&&(qw=($w=function(e){Iw(this,qw),Dw(e),Sw(yw,this);var t=Ww(this);try{e(uS(dS,t),uS(hS,t))}catch(e){hS(t,e)}}).prototype,(yw=function(e){Kw(this,{type:Fw,done:!1,notified:!1,parent:!1,reactions:new Bw,rejection:!1,state:0,value:void 0})}).prototype=Tw(qw,"then",(function(e,t){var i=Ww(this),n=Qw(Lw(this,$w));return i.parent=!0,n.ok=!Pw(e)||e,n.fail=Pw(t)&&t,n.domain=kw?Zw.domain:void 0,0==i.state?i.reactions.add(n):Rw((function(){rS(n,i)})),n.promise})),mw=function(){var e=new yw,t=Ww(e);this.promise=e,this.resolve=uS(dS,t),this.reject=uS(hS,t)},Hw.f=Qw=function(e){return e===$w||void 0===e?new mw(e):eS(e)},Pw(jw)&&Yw!==Object.prototype)){_w=Yw.then,Gw||Tw(Yw,"then",(function(e,t){var i=this;return new $w((function(e,t){Sw(_w,i,e,t)})).then(e,t)}),{unsafe:!0});try{delete Yw.constructor}catch(e){}Ew&&Ew(Yw,qw)}bw({global:!0,constructor:!0,wrap:!0,forced:Vw},{Promise:$w}),Cw($w,Fw,!1),xw(Fw);var fS={},pS=fS,gS=Bf("iterator"),vS=Array.prototype,yS=Qv,mS=rf,_S=dd,bS=fS,kS=Bf("iterator"),wS=function(e){if(!_S(e))return mS(e,kS)||mS(e,"@@iterator")||bS[yS(e)]},SS=Gh,TS=ef,ES=gp,CS=Xd,xS=wS,DS=TypeError,PS=Gh,OS=gp,IS=rf,LS=Wy,AS=Gh,RS=gp,MS=Xd,NS=function(e){return void 0!==e&&(pS.Array===e||vS[gS]===e)},BS=Yg,US=Od,jS=function(e,t){var i=arguments.length<2?xS(e):t;if(TS(i))return ES(SS(i,e));throw DS(CS(e)+" is not iterable")},HS=wS,FS=function(e,t,i){var n,r;OS(e);try{if(!(n=IS(e,"return"))){if("throw"===t)throw i;return i}n=PS(n,e)}catch(e){r=!0,n=e}if("throw"===t)throw i;if(r)throw n;return OS(n),i},VS=TypeError,zS=function(e,t){this.stopped=e,this.result=t},GS=zS.prototype,WS=function(e,t,i){var n,r,o,a,s,c,u,h=i&&i.that,d=!(!i||!i.AS_ENTRIES),f=!(!i||!i.IS_RECORD),p=!(!i||!i.IS_ITERATOR),g=!(!i||!i.INT
vendor: 4,719 bytes, line 1
1ERRUPTED),v=LS(t,h),y=function(e){return n&&FS(n,"normal",e),new zS(!0,e)},m=function(e){return d?(RS(e),g?v(e[0],e[1],y):v(e[0],e[1])):g?v(e,y):v(e)};if(f)n=e.iterator;else if(p)n=e;else{if(!(r=HS(e)))throw VS(MS(e)+" is not iterable");if(NS(r)){for(o=0,a=BS(e);a>o;o++)if((s=m(e[o]))&&US(GS,s))return s;return new zS(!1)}n=jS(e,r)}for(c=f?e.next:n.next;!(u=AS(c,n)).done;){try{s=m(u.value)}catch(e){FS(n,"throw",e)}if("object"==l(s)&&s&&US(GS,s))return s}return new zS(!1)},KS=Bf("iterator"),YS=!1;try{var $S=0,qS={next:function(){return{done:!!$S++}},return:function(){YS=!0}};qS[KS]=function(){return this},Array.from(qS,(function(){throw 2}))}catch(e){}var XS=Jk,JS=dw.CONSTRUCTOR||!function(e,t){if(!YS)return!1;var i=!1;try{var n={};n[KS]=function(){return{next:function(){return{done:i=!0}}}},e(n)}catch(e){}return i}((function(e){XS.all(e).then(void 0,(function(){}))})),ZS=Gh,QS=ef,eT=fw,tT=Xk,iT=WS;Nv({target:"Promise",stat:!0,forced:JS},{all:function(e){var t=this,i=eT.f(t),n=i.resolve,r=i.reject,o=tT((function(){var i=QS(t.resolve),o=[],a=0,s=1;iT(e,(function(e){var l=a++,c=!1;s++,ZS(i,t,e).then((function(e){c||(c=!0,o[l]=e,--s||n(o))}),r)})),--s||n(o)}));return o.error&&r(o.value),i.promise}});var nT=Nv,rT=dw.CONSTRUCTOR,oT=Jk,aT=Pd,sT=wd,lT=Ag,cT=oT&&oT.prototype;if(nT({target:"Promise",proto:!0,forced:rT,real:!0},{catch:function(e){return this.then(void 0,e)}}),sT(oT)){var uT=aT("Promise").prototype.catch;cT.catch!==uT&&lT(cT,"catch",uT,{unsafe:!0})}var hT=Gh,dT=ef,fT=fw,pT=Xk,gT=WS;Nv({target:"Promise",stat:!0,forced:JS},{race:function(e){var t=this,i=fT.f(t),n=i.reject,r=pT((function(){var r=dT(t.resolve);gT(e,(function(e){hT(r,t,e).then(i.resolve,n)}))}));return r.error&&n(r.value),i.promise}});var vT=Gh,yT=fw;Nv({target:"Promise",stat:!0,forced:dw.CONSTRUCTOR},{reject:function(e){var t=yT.f(this);return vT(t.reject,void 0,e),t.promise}});var mT=gp,_T=Ed,bT=fw,kT=function(e,t){if(mT(e),_T(t)&&t.constructor===e)return t;var i=bT.f(e);return(0,i.resolve)(t),i.promise},wT=Nv,ST=dw.CONSTRUCTOR,TT=kT;Pd("Promise"),wT({target:"Promise",stat:!0,forced:ST},{resolve:function(e){return TT(this,e)}});var ET=Nv,CT=Jk,xT=jh,DT=Pd,PT=wd,OT=jb,IT=kT,LT=Ag,AT=CT&&CT.prototype;if(ET({target:"Promise",proto:!0,real:!0,forced:!!CT&&xT((function(){AT.finally.call({then:function(){}},(function(){}))}))},{finally:function(e){var t=OT(this,DT("Promise")),i=PT(e);return this.then(i?function(i){return IT(t,e()).then((function(){return i}))}:e,i?function(i){return IT(t,e()).then((function(){throw i}))}:e)}}),PT(CT)){var RT=DT("Promise").prototype.finally;AT.finally!==RT&<(AT,"finally",RT,{unsafe:!0})}var MT=Hh,NT=Uv,BT=TypeError,UT=Object.getOwnPropertyDescriptor,jT=MT&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),HT=Xd,FT=TypeError,VT=Nv,zT=_f,GT=Vg,WT=Ug,KT=Yg,YT=jT?function(e,t){if(NT(e)&&!UT(e,"length").writable)throw BT("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},$T=Hv,qT=by,XT=Gv,JT=function(e,t){if(!delete e[t])throw FT("Cannot delete property "+HT(t)+" of "+HT(e))},ZT=Ty("splice"),QT=Math.max,eE=Math.min;VT({target:"Array",proto:!0,forced:!ZT},{splice:function(e,t){var i,n,r,o,a,s,l=zT(this),c=KT(l),u=GT(e,c),h=arguments.length;for(0===h?i=n=0:1===h?(i=0,n=c-u):(i=h-2,n=eE(QT(WT(t),0),c-u)),$T(c+i-n),r=qT(l,n),o=0;o<n;o++)(a=u+o)in l&&XT(r,o,l[a]);if(r.length=n,i<n){for(o=u;o<c-n;o++)s=o+i,(a=o+n)in l?l[s]=l[a]:JT(l,s);for(o=c;o>c-n+i;o--)JT(l,o-1)}else if(i>n)for(o=c-n;o>u;o--)s=o+i-1,(a=o+n-1)in l?l[s]=l[a]:JT(l,s);for(o=0;o<i;o++)l[o+u]=arguments[o+2];return YT(l,c-n+i),r}});var tE=Ug,iE=lm,nE=gd,rE=RangeError,oE=Nv,aE=id,sE=Ug,lE=v_,cE=function(e){var t=iE(nE(this)),i="",n=tE(e);if(n<0||n==1/0)throw rE("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(i+=t);return i},uE=jh,hE=RangeError,dE=String,fE=Math.floor,pE=aE(cE),gE=aE("".slice),vE=aE(1..toFixed),yE=function e(t,i,n){return 0===i?n:i%2==1?e(t,i-1,n*t):e(t*t,i/2,n)},mE=function(e,t,i){for(var n=-1,r=i;++n<6;)r+=t*e[n],e[n]=r%1e7,r=fE(r/1e7)},_E=function(e,t){for(var i=6,n=0;--i>=0;)n+=e[i],e[i]=fE(n/t),n=n%t*1e7},bE=function(e){for(var t=6,i="";--t>=0;)if(""!==i||0===t||0!==e[t]){var n=dE(e[t]);i=""===i?n:i+pE("0",7-n.length)+n}return i};oE({target:"Number",proto:!0,forced:uE((function(){return"0.000"!==vE(8e-5,3)||"1"!==vE(.9,0)||"1.25"!==vE(1.255,2)||"1000000000000000128"!==vE(0xde0b6b3a7640080,0)}))||!uE((function(){vE({})}))},{toFixed:function(e){var t,i,n,r,o=lE(this),a=sE(e),s=[0,0,0,0,0,0],l="",c="0";if(a<0||a>20)throw hE("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return dE(o);if(o<0&&(l="-",o=-o),o>
vendor: 5,114 bytes, line 1
11e-21)if(i=(t=function(e){for(var t=0,i=e;i>=4096;)t+=12,i/=4096;for(;i>=2;)t+=1,i/=2;return t}(o*yE(2,69,1))-69)<0?o*yE(2,-t,1):o/yE(2,t,1),i*=4503599627370496,(t=52-t)>0){for(mE(s,0,i),n=a;n>=7;)mE(s,1e7,0),n-=7;for(mE(s,yE(10,n,1),0),n=t-1;n>=23;)_E(s,1<<23),n-=23;_E(s,1<<n),mE(s,1,1),_E(s,2),c=bE(s)}else mE(s,0,i),mE(s,1<<-t,0),c=bE(s)+pE("0",a);return a>0?l+((r=c.length)<=a?"0."+pE("0",a-r)+c:gE(c,0,r-a)+"."+gE(c,r-a)):l+c}}),Nv({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var kE=jh,wE=Bh.RegExp,SE=kE((function(){var e=wE("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),TE=SE||kE((function(){return!wE("a","y").sticky})),EE={BROKEN_CARET:SE||kE((function(){var e=wE("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:TE,UNSUPPORTED_Y:SE},CE={},xE=Hh,DE=hp,PE=up,OE=gp,IE=md,LE=nm;CE.f=xE&&!DE?Object.defineProperties:function(e,t){OE(e);for(var i,n=IE(t),r=LE(t),o=r.length,a=0;o>a;)PE.f(e,i=r[a++],n[i]);return e};var AE,RE=gp,ME=CE,NE=ov,BE=Jp,UE=Wb,jE=Zf,HE=Xp("IE_PROTO"),FE=function(){},VE=function(e){return"<script>"+e+"<\/script>"},zE=function(e){e.write(VE("")),e.close();var t=e.parentWindow.Object;return e=null,t},GE=function(){try{AE=new ActiveXObject("htmlfile")}catch(e){}var e,t;GE="undefined"!=typeof document?document.domain&&AE?zE(AE):((t=jE("iframe")).style.display="none",UE.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(VE("document.F=Object")),e.close(),e.F):zE(AE);for(var i=NE.length;i--;)delete GE.prototype[NE[i]];return GE()};BE[HE]=!0;var WE,KE,YE=Object.create||function(e,t){var i;return null!==e?(FE.prototype=RE(e),i=new FE,FE.prototype=null,i[HE]=e):i=GE(),void 0===t?i:ME.f(i,t)},$E=jh,qE=Bh.RegExp,XE=$E((function(){var e=qE(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),JE=jh,ZE=Bh.RegExp,QE=JE((function(){var e=ZE("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),eC=Gh,tC=id,iC=lm,nC=Em,rC=EE,oC=cf.exports,aC=YE,sC=hg.get,lC=XE,cC=QE,uC=oC("native-string-replace",String.prototype.replace),hC=RegExp.prototype.exec,dC=hC,fC=tC("".charAt),pC=tC("".indexOf),gC=tC("".replace),vC=tC("".slice),yC=(KE=/b*/g,eC(hC,WE=/a/,"a"),eC(hC,KE,"a"),0!==WE.lastIndex||0!==KE.lastIndex),mC=rC.BROKEN_CARET,_C=void 0!==/()??/.exec("")[1];(yC||_C||mC||lC||cC)&&(dC=function(e){var t,i,n,r,o,a,s,l=this,c=sC(l),u=iC(e),h=c.raw;if(h)return h.lastIndex=l.lastIndex,t=eC(dC,h,u),l.lastIndex=h.lastIndex,t;var d=c.groups,f=mC&&l.sticky,p=eC(nC,l),g=l.source,v=0,y=u;if(f&&(p=gC(p,"y",""),-1===pC(p,"g")&&(p+="g"),y=vC(u,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==fC(u,l.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,v++),i=new RegExp("^(?:"+g+")",p)),_C&&(i=new RegExp("^"+g+"$(?!\\s)",p)),yC&&(n=l.lastIndex),r=eC(hC,f?i:l,y),f?r?(r.input=vC(r.input,v),r[0]=vC(r[0],v),r.index=l.lastIndex,l.lastIndex+=r[0].length):l.lastIndex=0:yC&&r&&(l.lastIndex=l.global?r.index+r[0].length:n),_C&&r&&r.length>1&&eC(uC,r[0],i,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&d)for(r.groups=a=aC(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=r[s[1]];return r});var bC=dC;Nv({target:"RegExp",proto:!0,forced:/./.exec!==bC},{exec:bC});var kC=Fy,wC=Ag,SC=bC,TC=jh,EC=Bf,CC=Pp,xC=EC("species"),DC=RegExp.prototype,PC=function(e,t,i,n){var r=EC(e),o=!TC((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),a=o&&!TC((function(){var t=!1,i=/a/;return"split"===e&&((i={}).constructor={},i.constructor[xC]=function(){return i},i.flags="",i[r]=/./[r]),i.exec=function(){return t=!0,null},i[r](""),!t}));if(!o||!a||i){var s=kC(/./[r]),l=t(r,""[e],(function(e,t,i,n,r){var a=kC(e),l=t.exec;return l===SC||l===DC.exec?o&&!r?{done:!0,value:s(t,i,n)}:{done:!0,value:a(i,t,n)}:{done:!1}}));wC(String.prototype,e,l[0]),wC(DC,r,l[1])}n&&CC(DC[r],"sham",!0)},OC=ym.charAt,IC=function(e,t,i){return t+(i?OC(e,t).length:1)},LC=id,AC=_f,RC=Math.floor,MC=LC("".charAt),NC=LC("".replace),BC=LC("".slice),UC=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,jC=/\$([$&'`]|\d{1,2})/g,HC=Gh,FC=gp,VC=wd,zC=ad,GC=bC,WC=TypeError,KC=function(e,t){var i=e.exec;if(VC(i)){var n=HC(i,e,t);return null!==n&&FC(n),n}if("RegExp"===zC(e))return HC(GC,e,t);throw WC("RegExp#exec called on incompatible receiver")},YC=Gb,$C=Gh,qC=id,XC=PC,JC=jh,ZC=gp,QC=wd,ex=dd,tx=Ug,ix=Wg,nx=lm,rx=gd,ox=IC,ax=rf,sx=function(e,t,i,n,r,o){var a=i+e.length,s=n.length,l=jC;return void 0!==r&&(r=AC(r),l=UC),NC(o,l,(function(o,l){var c;switch(MC(l,0)){case"$":return"$";case"&":return e;case"`":return BC(t,0,i);case"'":return BC(t,a);case"<":c=r[BC(l,1,-1)];break;default:var u=+l;if(0===u)return o;if(u>s){var h=RC(u/10);return 0===h?o:h<=s?void 0===n[h-1]?MC(l,1):n[h-1]+MC(l,1):o}c=n[u-1]}return void 0===c?"":c}))},lx=KC,cx=Bf("replace"),ux=Math.max,hx=Math.min,dx=qC([].concat),fx=qC([].push),px=qC("".indexOf),gx=qC("".slice),vx="$0"==="a".replace(/./,"$0"),yx=!!/./[cx]&&""===/./[cx]("a","$0");XC("replace",(function(e,t,i){var n=yx?"$":"$0";return[function(e,i){var n=rx(this),r=ex(e)?void 0:ax(e,cx);return r?$C(r,e,n,i):$C(t,nx(n),e,i)},function(e,r){var o=ZC(this),a=nx(e);
vendor: 4,807 bytes, line 1
1if("string"==typeof r&&-1===px(r,n)&&-1===px(r,"$<")){var s=i(t,o,a,r);if(s.done)return s.value}var l=QC(r);l||(r=nx(r));var c=o.global;if(c){var u=o.unicode;o.lastIndex=0}for(var h=[];;){var d=lx(o,a);if(null===d)break;if(fx(h,d),!c)break;""===nx(d[0])&&(o.lastIndex=ox(a,ix(o.lastIndex),u))}for(var f,p="",g=0,v=0;v<h.length;v++){for(var y=nx((d=h[v])[0]),m=ux(hx(tx(d.index),a.length),0),_=[],b=1;b<d.length;b++)fx(_,void 0===(f=d[b])?f:String(f));var k=d.groups;if(l){var w=dx([y],_,m,a);void 0!==k&&fx(w,k);var S=nx(YC(r,void 0,w))}else S=sx(y,a,m,_,k,r);m>=g&&(p+=gx(a,g,m)+S,g=m+y.length)}return p+gx(a,g)}]}),!!JC((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!vx||yx);var mx=Ed,_x=ad,bx=Bf("match"),kx=function(e){var t;return mx(e)&&(void 0!==(t=e[bx])?!!t:"RegExp"==_x(e))},wx=Vg,Sx=Yg,Tx=Gv,Ex=Array,Cx=Math.max,xx=function(e,t,i){for(var n=Sx(e),r=wx(t,n),o=wx(void 0===i?n:i,n),a=Ex(Cx(o-r,0)),s=0;r<o;r++,s++)Tx(a,s,e[r]);return a.length=s,a},Dx=Gb,Px=Gh,Ox=id,Ix=PC,Lx=gp,Ax=dd,Rx=kx,Mx=gd,Nx=jb,Bx=IC,Ux=Wg,jx=lm,Hx=rf,Fx=xx,Vx=KC,zx=bC,Gx=jh,Wx=EE.UNSUPPORTED_Y,Kx=4294967295,Yx=Math.min,$x=[].push,qx=Ox(/./.exec),Xx=Ox($x),Jx=Ox("".slice),Zx=!Gx((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2!==i.length||"a"!==i[0]||"b"!==i[1]}));Ix("split",(function(e,t,i){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,i){var n=jx(Mx(this)),r=void 0===i?Kx:i>>>0;if(0===r)return[];if(void 0===e)return[n];if(!Rx(e))return Px(t,n,e,r);for(var o,a,s,l=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,h=new RegExp(e.source,c+"g");(o=Px(zx,h,n))&&!((a=h.lastIndex)>u&&(Xx(l,Jx(n,u,o.index)),o.length>1&&o.index<n.length&&Dx($x,l,Fx(o,1)),s=o[0].length,u=a,l.length>=r));)h.lastIndex===o.index&&h.lastIndex++;return u===n.length?!s&&qx(h,"")||Xx(l,""):Xx(l,Jx(n,u)),l.length>r?Fx(l,0,r):l}:"0".split(void 0,0).length?function(e,i){return void 0===e&&0===i?[]:Px(t,this,e,i)}:t,[function(t,i){var r=Mx(this),o=Ax(t)?void 0:Hx(t,e);return o?Px(o,t,r,i):Px(n,jx(r),t,i)},function(e,r){var o=Lx(this),a=jx(e),s=i(n,o,a,r,n!==t);if(s.done)return s.value;var l=Nx(o,RegExp),c=o.unicode,u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Wx?"g":"y"),h=new l(Wx?"^(?:"+o.source+")":o,u),d=void 0===r?Kx:r>>>0;if(0===d)return[];if(0===a.length)return null===Vx(h,a)?[a]:[];for(var f=0,p=0,g=[];p<a.length;){h.lastIndex=Wx?0:p;var v,y=Vx(h,Wx?Jx(a,p):a);if(null===y||(v=Yx(Ux(h.lastIndex+(Wx?p:0)),a.length))===f)p=Bx(a,p,c);else{if(Xx(g,Jx(a,f,p)),g.length===d)return g;for(var m=1;m<=y.length-1;m++)if(Xx(g,y[m]),g.length===d)return g;p=f=v}}return Xx(g,Jx(a,f)),g}]}),!Zx,Wx);var Qx=Np.PROPER,eD=jh,tD=y_,iD=E_.trim;Nv({target:"String",proto:!0,forced:function(e){return eD((function(){return!!tD[e]()||"âÂ
á "!=="âÂ
á "[e]()||Qx&&tD[e].name!==e}))}("trim")},{trim:function(){return iD(this)}});var nD=Qy.filter;Nv({target:"Array",proto:!0,forced:!Ty("filter")},{filter:function(e){return nD(this,e,arguments.length>1?arguments[1]:void 0)}});var rD=Gh,oD=gp,aD=dd,sD=Wg,lD=lm,cD=gd,uD=rf,hD=IC,dD=KC;PC("match",(function(e,t,i){return[function(t){var i=cD(this),n=aD(t)?void 0:uD(t,e);return n?rD(n,t,i):new RegExp(t)[e](lD(i))},function(e){var n=oD(this),r=lD(e),o=i(t,n,r);if(o.done)return o.value;if(!n.global)return dD(n,r);var a=n.unicode;n.lastIndex=0;for(var s,l=[],c=0;null!==(s=dD(n,r));){var u=lD(s[0]);l[c]=u,""===u&&(n.lastIndex=hD(r,sD(n.lastIndex),a)),c++}return 0===c?null:l}]}));var fD=up.f,pD=Hh,gD=Bh,vD=id,yD=Dv,mD=g_,_D=Pp,bD=Rg.f,kD=Od,wD=kx,SD=lm,TD=Im,ED=EE,CD=function(e,t,i){i in e||fD(e,i,{configurable:!0,get:function(){return t[i]},set:function(e){t[i]=e}})},xD=Ag,DD=jh,PD=wf,OD=hg.enforce,ID=Pb,LD=XE,AD=QE,RD=Bf("match"),MD=gD.RegExp,ND=MD.prototype,BD=gD.SyntaxError,UD=vD(ND.exec),jD=vD("".charAt),HD=vD("".replace),FD=vD("".indexOf),VD=vD("".slice),zD=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,GD=/a/g,WD=/a/g,KD=new MD(GD)!==GD,YD=ED.MISSED_STICKY,$D=ED.UNSUPPORTED_Y,qD=pD&&(!KD||YD||LD||AD||DD((function(){return WD[RD]=!1,MD(GD)!=GD||MD(WD)==WD||"/a/i"!=MD(GD,"i")})));if(yD("RegExp",qD)){for(var XD=function(e,t){var i,n,r,o,a,s,l=kD(ND,this),c=wD(e),u=void 0===t,h=[],d=e;if(!l&&c&&u&&e.constructor===XD)return e;if((c||kD(ND,e))&&(e=e.source,u&&(t=TD(d))),e=void 0===e?"":SD(e),t=void 0===t?"":SD(t),d=e,LD&&"dotAll"in GD&&(n=!!t&&FD(t,"s")>-1)&&(t=HD(t,/s/g,"")),i=t,YD&&"sticky"in GD&&(r=!!t&&FD(t,"y")>-1)&&$D&&(t=HD(t,/y/g,"")),AD&&(o=function(e){for(var t,i=e.length,n=0,r="",o=[],a={},s=!1,l=!1,c=0,u="";n<=i;
1n++){if("\\"===(t=jD(e,n)))t+=jD(e,++n);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:UD(zD,VD(e,n+1))&&(n+=2,l=!0),r+=t,c++;continue;case">"===t&&l:if(""===u||PD(a,u))throw new BD("Invalid capture group name");a[u]=!0,o[o.length]=[u,c],l=!1,u="";continue}l?u+=t:r+=t}return[r,o]}(e),e=o[0],h=o[1]),a=mD(MD(e,t),l?this:ND,XD),(n||r||h.length)&&(s=OD(a),n&&(s.dotAll=!0,s.raw=XD(function(e){for(var t,i=e.length,n=0,r="",o=!1;n<=i;n++)"\\"!==(t=jD(e,n))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+jD(e,++n);return r}(e),i)),r&&(s.sticky=!0),h.length&&(s.groups=h)),e!==d)try{_D(a,"source",""===d?"(?:)":d)}catch(e){}return a},JD=bD(MD),ZD=0;JD.length>ZD;)CD(XD,MD,JD[ZD++]);ND.constructor=XD,XD.prototype=ND,xD(gD,"RegExp",XD,{constructor:!0})}ID("RegExp");var QD="undefined"!=typeof window&&window.location.href.indexOf("loggerdebug")>-1;function eP(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=0,i=0;i<e.length;i++){var n=e[i].end,r=e[i].begin;Number.isNaN(Number(n))||Number.isNaN(Number(r))||r<0||n<0||n<r||(t+=e[i].end-e[i].begin)}return parseInt(1e3*t,10)}function tP(e){if(null==e||""===e||"string"!=typeof e)return"";var t=e.split("/"),i="";return t.length>3&&t[2]&&(i=t[2]),i}function iP(e){var t={};if(e instanceof window.XMLHttpRequest)try{e.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var i=e.split(": "),n=i.shift(),r=i.join(": ");t[n]=r}))}catch(e){return t}return t}function nP(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];QD&&(t=console).log.apply(t,["[logger]",e].concat(n))}function rP(){try{return Math.round(window.performance.now())}catch(e){return(new Date).getTime()}}function oP(){return(new Date).getTime()}function aP(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(i,n){try{e||n(new Error("url is undefined"));var r=rP(),o=r,a={},s=new window.XMLHttpRequest;s.open("get",e),s.onreadystatechange=function(){2===s.readyState&&(a.headers=iP(s),a.connectTime=rP()-o,a.status=s.status,a.statusText=s.statusText,r=rP())},s.onload=function(){i(a)},s.onprogress=function(e){var t,i=rP()-r;t=parseInt(e.loaded/1e3/(i/1e3),10),a.speed=0|t,a.costTime=i},s.onerror=function(){a.status||(a.status=-1,a.costTime=rP()-r),n(a)},s.ontimeout=function(){a.status||(a.status=-2,a.costTime=rP()-r),i(a)},s.onabort=function(){i(a)},s.responseType="arraybuffer",s.timeout=t.timeout||1e4,s.setRequestHeader("Range","bytes=".concat(t.range||"0-1048576")),s.send()}catch(e){n(e)}}))}function sP(e){return!e||window.location.href.indexOf(e)>-1}function lP(e){return!!e&&/^blob:/.test(e)}var cP={x_response_sinfo:"x-response-sinfo",x_response_cache:"x-response-cache",x_response_cinfo:"x-response-cinfo"};function uP(e){if(!e)return{};var t={};return Object.keys(cP).map((function(i){if(e[i]||"string"!=typeof cP[i]){if(!e[i]&&cP[i]instanceof Array){var n=cP[i].filter((function(t){return void 0!==e[t]}));n.length>0?t[i]=e[n[0]]:t[i]=""}}else t[i]=e[cP[i]]||""})),t}function hP(e,t){return!e||"string"!=typeof t&&"number"!=typeof t?t:"".concat(e," ").concat(t)}function dP(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function fP(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(n){var i=e.className&&"object"===Ph(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)".concat(t,"(\\s|$)")))}}function pP(e){return"String"===dP(e)?e.replace("P","p"):e?"Number"===dP(e)?"".concat(e):void 0:""}function gP(e){try{return JSON.stringify(e)}catch(e){return""}}var vP=0,yP=1,mP=2;function _P(e){if(!e||"String"!==dP(e))return 0;var t=0;try{var i=new RegExp("(\\?|&)x-tos-expires=([^&]*)(&|$)"),n=e.match(i);if(null!==n)t=parseInt(n[2],10);else{var r=e.split("/");r.length>5&&8===r[4].length&&(t=parseInt(r[4],16))}return t>0?t<parseInt((new Date).getTime()/1e3,10)?yP:mP:vP}catch(e){return vP}}var bP=[];function kP(e){var t={};try{e=e.replace(/^http:|^https:/,"");for(var i=bP||[],n=function(n){if(i[n].name.replace(/^http:|^https:/,"")===e)return["domainLookupEnd","domainLookupStart","startTime","requestStart","responseEnd","responseStart","connectStart","connectEnd","fetchStart"].map((function(e){t[e]=Math.round(i[n][e])})),t.url=i[n].name,t.duration=Math.round(i[n].duration),t.domainDuration=t.domainLookupEnd-t.domainLookupStart,t.connectDuration=t.connectEnd-t.connectStart,"break"},r=i.length-1;r>=0&&"break"!==n(r);r--);return t}catch(e){return t}}"undefined"!=typeof window&&function(){try{new window.PerformanceObserver((function(e){var t=e.getEntriesByType("resource");bP.length>30&&bP.splice(0,bP.length-30);for(var i=0;i<t.length;i++)bP.push(t[i])})).observe({entryTypes:["resource"]})}catch(e){}}();var wP="videoplayer_oneplay",SP="videoplayer_oneopera",TP="videoplayer_oneerror",EP="videoplayer_oneevent",CP="videoplayer_onetemp",xP={data:1e3,runtime:1002,parse:1004,network:1003,no_error_handler:9997,custom_error:9998,other:9999,notSupport:1005},DP={1:-499991,2:-499992,3:-499993,4:-499994,5:-499995},PP=0,OP=1,IP=2,LP=3,AP=4,RP=0,MP=1,NP=2,BP=3,UP=1,jP=2,HP=3,FP=4,VP=5,zP=6,GP=7,WP="error_retry",KP="oneerror",YP="oneevent",$P="onetemp",qP=0,XP=1,JP=432e5,ZP=36e5,QP=["tag","subtag","device_type"],eO={NO_FULLSCREEN:0,FULLSCREEN:1,CSS:2},tO=function(){try{return"undefined"!=typeof localStorage&&"setItem"in window.localStorage&&!!window.localStorage.setItem}catch(e){return!1}}()&&!function(){var e="_localstorage_support_test";try{return window.localStorage.setItem(e,!0),window.localStorage.removeItem(e),!1}catch(e){return!0}}()?window.localStorage:{},iO="__xgplayerlogkey",nO={set:function(e){try{var t=this.get();t.push(e),tO.setItem(iO,JSON.stringify(t))}catch(e){}},get:function(){try{var e=tO.getItem(iO);return e?JSON.parse(e):[]}catch(e){return[]}},remove:function(){try{tO.removeItem(iO)}catch(e){}},clear:function(){try{tO.clear()}catch(e){}}},rO={},oO=ad,aO=md,sO=Rg.f,lO=xx,cO="object"==("undefined"==typeof window?"undefined":l(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];rO.f=function(e){return cO&&"Window"==oO(e)?function(e){try{return sO(e)}catch(e){return lO(cO)}}(e):sO(aO(e))};var uO={},hO=Bf;uO.f=hO;var dO=i_,fO=wf,pO=uO,gO=up.f,vO=Gh,yO=Pd,mO=Bf,_O=Ag,bO=Nv,kO=Bh,wO=Gh,SO=id,TO=Hh,EO=Vd,CO=jh,xO=wf,DO=Od,PO=gp,OO=md,IO=$f,LO=lm,AO=Jh,RO=YE,MO=nm,NO=Rg,BO=rO,UO=lv,jO=Uh,HO=up,FO=CE,VO=Wh,zO=Ag,GO=ib,WO=cf.exports,KO=Jp,YO=xf,$O=Bf,qO=uO,XO=function(e){var t=dO.Symbol||(dO.Symbol={});fO(t,e)||gO(t,e,{value:pO.f(e)})},JO=function(){var e=yO("Symbol"),t=e&&e.prototype,i=t&&t.valueOf,n=mO("toPrimitive");t&&!t[n]&&_O(t,n,(function(e){return vO(i,this)}),{arity:1}
vendor: 4,304 bytes, line 1
1)},ZO=Tb,QO=hg,eI=Qy.forEach,tI=Xp("hidden"),iI="Symbol",nI=QO.set,rI=QO.getterFor(iI),oI=Object.prototype,aI=kO.Symbol,sI=aI&&aI.prototype,lI=kO.TypeError,cI=kO.QObject,uI=jO.f,hI=HO.f,dI=BO.f,fI=VO.f,pI=SO([].push),gI=WO("symbols"),vI=WO("op-symbols"),yI=WO("wks"),mI=!cI||!cI.prototype||!cI.prototype.findChild,_I=TO&&CO((function(){return 7!=RO(hI({},"a",{get:function(){return hI(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=uI(oI,t);n&&delete oI[t],hI(e,t,i),n&&e!==oI&&hI(oI,t,n)}:hI,bI=function(e,t){var i=gI[e]=RO(sI);return nI(i,{type:iI,tag:e,description:t}),TO||(i.description=t),i},kI=function(e,t,i){e===oI&&kI(vI,t,i),PO(e);var n=IO(t);return PO(i),xO(gI,n)?(i.enumerable?(xO(e,tI)&&e[tI][n]&&(e[tI][n]=!1),i=RO(i,{enumerable:AO(0,!1)})):(xO(e,tI)||hI(e,tI,AO(1,{})),e[tI][n]=!0),_I(e,n,i)):hI(e,n,i)},wI=function(e,t){PO(e);var i=OO(t),n=MO(i).concat(CI(i));return eI(n,(function(t){TO&&!wO(SI,i,t)||kI(e,t,i[t])})),e},SI=function(e){var t=IO(e),i=wO(fI,this,t);return!(this===oI&&xO(gI,t)&&!xO(vI,t))&&(!(i||!xO(this,t)||!xO(gI,t)||xO(this,tI)&&this[tI][t])||i)},TI=function(e,t){var i=OO(e),n=IO(t);if(i!==oI||!xO(gI,n)||xO(vI,n)){var r=uI(i,n);return!r||!xO(gI,n)||xO(i,tI)&&i[tI][n]||(r.enumerable=!0),r}},EI=function(e){var t=dI(OO(e)),i=[];return eI(t,(function(e){xO(gI,e)||xO(KO,e)||pI(i,e)})),i},CI=function(e){var t=e===oI,i=dI(t?vI:OO(e)),n=[];return eI(i,(function(e){!xO(gI,e)||t&&!xO(oI,e)||pI(n,gI[e])})),n};EO||(aI=function(){if(DO(sI,this))throw lI("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?LO(arguments[0]):void 0,t=YO(e),i=function e(i){this===oI&&wO(e,vI,i),xO(this,tI)&&xO(this[tI],t)&&(this[tI][t]=!1),_I(this,t,AO(1,i))};return TO&&mI&&_I(oI,t,{configurable:!0,set:i}),bI(t,e)},zO(sI=aI.prototype,"toString",(function(){return rI(this).tag})),zO(aI,"withoutSetter",(function(e){return bI(YO(e),e)})),VO.f=SI,HO.f=kI,FO.f=wI,jO.f=TI,NO.f=BO.f=EI,UO.f=CI,qO.f=function(e){return bI($O(e),e)},TO&&(GO(sI,"description",{configurable:!0,get:function(){return rI(this).description}}),zO(oI,"propertyIsEnumerable",SI,{unsafe:!0}))),bO({global:!0,constructor:!0,wrap:!0,forced:!EO,sham:!EO},{Symbol:aI}),eI(MO(yI),(function(e){XO(e)})),bO({target:iI,stat:!0,forced:!EO},{useSetter:function(){mI=!0},useSimple:function(){mI=!1}}),bO({target:"Object",stat:!0,forced:!EO,sham:!TO},{create:function(e,t){return void 0===t?RO(e):wI(RO(e),t)},defineProperty:kI,defineProperties:wI,getOwnPropertyDescriptor:TI}),bO({target:"Object",stat:!0,forced:!EO},{getOwnPropertyNames:EI}),JO(),ZO(aI,iI),KO[tI]=!0;var xI=Vd&&!!Symbol.for&&!!Symbol.keyFor,DI=Nv,PI=Pd,OI=wf,II=lm,LI=cf.exports,AI=xI,RI=LI("string-to-symbol-registry"),MI=LI("symbol-to-string-registry");DI({target:"Symbol",stat:!0,forced:!AI},{for:function(e){var t=II(e);if(OI(RI,t))return RI[t];var i=PI("Symbol")(t);return RI[t]=i,MI[i]=t,i}});var NI=Nv,BI=wf,UI=$d,jI=Xd,HI=xI,FI=(0,cf.exports)("symbol-to-string-registry");NI({target:"Symbol",stat:!0,forced:!HI},{keyFor:function(e){if(!UI(e))throw TypeError(jI(e)+" is not a symbol");if(BI(FI,e))return FI[e]}});var VI=Uv,zI=wd,GI=ad,WI=lm,KI=id([].push),YI=Nv,$I=Pd,qI=Gb,XI=Gh,JI=id,ZI=jh,QI=wd,eL=$d,tL=Kb,iL=function(e){if(zI(e))return e;if(VI(e)){for(var t=e.length,i=[],n=0;n<t;n++){var r=e[n];"string"==typeof r?KI(i,r):"number"!=typeof r&&"Number"!=GI(r)&&"String"!=GI(r)||KI(i,WI(r))}var o=i.length,a=!0;return function(e,t){if(a)return a=!1,t;if(VI(this))return t;for(var n=0;n<o;n++)if(i[n]===e)return t}}},nL=Vd,rL=String,oL=$I("JSON","stringify"),aL=JI(/./.exec),sL=JI("".charAt),lL=JI("".charCodeAt),cL=JI("".replace),uL=JI(1..toString),hL=/[\uD800-\uDFFF]/g,dL=/^[\uD800-\uDBFF]$/,fL=/^[\uDC00-\uDFFF]$/,pL=!nL||ZI((function(){var e=$I("Symbol")();return"[null]"!=oL([e])||"{}"!=oL({a:e})||"{}"!=oL(Object(e))})),gL=ZI((function(){return'"\\udf06\\ud834"'!==oL("\udf06\ud834")||'"\\udead"'!==oL("\udead")})),vL=function(e,t){var i=tL(arguments),n=iL(t);if(QI(n)||void 0!==e&&!eL(e))return i[1]=function(e,t){if(QI(n)&&(t=XI(n,this,rL(e),t)),!eL(t))return t},qI(oL,null,i)},yL=function(e,t,i){var n=sL(i,t-1),r=sL(i,t+1);return aL(dL,e)&&!aL(fL,r)||aL(fL,e)&&!aL(dL,n)?"\\u"+uL(lL(e,0),16):e};oL&&YI({target:"JSON",stat:!0,arity:3,forced:pL||gL},{stringify:function(e,t,i){var n=tL(arguments),r=qI(pL?vL:oL,null,
1n);return gL&&"string"==typeof r?cL(r,hL,yL):r}});var mL=lv,_L=_f;Nv({target:"Object",stat:!0,forced:!Vd||jh((function(){mL.f(1)}))},{getOwnPropertySymbols:function(e){var t=mL.f;return t?t(_L(e)):[]}});var bL=Nv,kL=Hh,wL=id,SL=wf,TL=wd,EL=Od,CL=lm,xL=ib,DL=_v,PL=Bh.Symbol,OL=PL&&PL.prototype;if(kL&&TL(PL)&&(!("description"in OL)||void 0!==PL().description)){var IL={},LL=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:CL(arguments[0]),t=EL(OL,this)?new PL(e):void 0===e?PL():PL(e);return""===e&&(IL[t]=!0),t};DL(LL,PL),LL.prototype=OL,OL.constructor=LL;var AL="Symbol(test)"==String(PL("test")),RL=wL(OL.valueOf),ML=wL(OL.toString),NL=/^Symbol\((.*)\)[^)]+$/,BL=wL("".replace),UL=wL("".slice);xL(OL,"description",{configurable:!0,get:function(){var e=RL(this);if(SL(IL,e))return"";var t=ML(e),i=AL?UL(t,7,-1):BL(t,NL,"$1");return""===i?void 0:i}}),bL({global:!0,constructor:!0,forced:!0},{Symbol:LL})}var jL=[{key:"QQBrowser",reg:/(qqbrowser)\/([\d.]+)/},{key:"QIHU360EE",reg:/qihu 360ee/},{key:"QIHU360SE",reg:/qihu 360se/},{key:"2345Explorer",reg:/(2345explorer)\/([\d.]+)/},{key:"Sogou",reg:/(metasr)/},{key:"Wexin",reg:/(micromessenger)\/([\d.]+)/},{key:"Openlanguage",reg:/(openlanguage)\/([\d.]+)/},{key:"NewsArticle",reg:/(newsarticle)\/([\d.]+)/},{key:"VideoArticle",reg:/(videoarticle)\/([\d.]+)/},{key:"Hotsoon",reg:/(live_stream)_([\d.]+)/},{key:"Aweme",reg:/(aweme)_([\d.]+)/},{key:"Lark",reg:/(lark)\/([\d.]+)/},{key:"PlayStation",reg:/(playstation)/},{key:"BingPreview",reg:/(bingpreview)\/([\d.]+)/},{key:"Baiduspider",reg:/(baiduspider-render)\/([\d.]+)/},{key:"YandexBot",reg:/(yandexbot)\/([\d.]+)/},{key:"Chrome",reg:/(chrome)\/([\d.]+)/},{key:"Safari",reg:/(version)\/([\d.]+)\s*(safari)/}],HL=[{key:"Trident",reg:/(rv:)([\d.]+)/},{key:"Trident",reg:/(msie)\s*([\d.]+)/}];function FL(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;var t=document.createElement("video");return"function"==typeof t.canPlayType?(["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"].map((function(i){"probably"===t.canPlayType('video/mp4; codecs="'.concat(i,'"'))&&(e.isSupport=!0,e.mime+="||".concat(i))})),e):(t=null,e)}var VL=["Baiduspider","YandexBot"];function zL(e,t){var i=!1;return VL.map((function(t){t===e&&(i=!0)})),/spider/.test(t)&&(i=!0),i}function GL(){var e=navigator.mimeTypes;if(e){for(var t=0;t<e.length;t++){if(e[t].type&&e[t].type.indexOf("360")>-1)return!0;if(e[t].type&&e[t].type.indexOf("application/vnd.chromium.remoting-viewer")>-1)return!0;if(e[t].description&&e[t].description.indexOf("360")>-1)return!0}return!1}}var WL="undefined"!=typeof navigator&&function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";e=e.toLocaleLowerCase();var t=/(iphone)/.test(e)||/(ipad)/.test(e),i=/(android)/.test(e),n=/(windows phone)/.test(e),r=t||i||n,o={isIOS:t,isAndroid:i,isMobile:r,isPC:!r,isPad:/(ipad)/.test(e)},a=FL();o.isSupportMP4=a.isSupport,o.mime=a.mime;var s="",l=0,c=[],u=jL;/trident/.test(e)&&(u=HL);for(var h=0;h<u.length;h++)if(c=u[h].reg.exec(e)){s=u[h].key,l=c.length>2?c[2]:"";break}return s?(o["is".concat(s)]=!0,o.name=s,o.appVersion=l):GL()&&(o.name="360EE"),o.name&&"Trident"!==o.name&&/(trident)/.exec(e)&&(o.name=o.name?"".concat(o.name,"_Trident"):"Trident"),o.isSpider=zL(o.name,e),o}(navigator.userAgent),KL=[1,1,1,1,1];function YL(){return parseInt(KL.join(""),10)}KL[0]=WL.isSupportMP4?KL[1]+1:KL[1],KL[1]="undefined"!=typeof MediaSource&&MediaSource.isTypeSupported&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))?KL[1]+1:KL[1],function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var i=e.video||{},n=e.audio||{};
1try{var r=MediaSource.isTypeSupported(i.contentType),o=MediaSource.isTypeSupported(n.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}}({type:"file",video:{contentType:'video/mp4;codecs="hev1.1.6.L120.90"',width:1920,height:1080,bitrate:1e4,framerate:30}}).then((function(e){e&&e.supported?KL[2]=KL[2]+1:KL[2]=1})).catch((function(){KL[2]=KL[2]-1}));var $L={range:"0-1048576",timer:6e4,timeout:15e3},qL=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Oh(this,e),Object.keys($L).map((function(e){void 0!==t[e]&&null!==t[e]||(t[e]=$L[e])})),this.options=t,this._headers={},this.intervalId=null,this.ishangUp=!1,this._data={contentLength:0,statusText:"",status:-1,speed:0,costTime:0,connectTime:0,contentType:""},this.url=[]}return Lh(e,[{key:"setData",value:function(e){var t=this;if(Object.keys(e).map((function(i){"headers"!==i&&(t._data[i]=e[i])})),e.headers&&Object.keys(e.headers).length>0){this._headers=uP(e.headers),e.headers["content-type"]&&(this._data.contentType=e.headers["content-type"]);var i=(e.headers["content-range"]||"").split("/");i&&i.length>1&&(this._data.contentLength=parseInt(i[1]))}}},{key:"contentLength",get:function(){return this._data.length||0}},{key:"trigger",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start",n=this.options;this.url=e,!this.url||"start"!==i&&(this.ishangUp||this.intervalId)?nP("task>>cant`t trigger url",this.ishangUp,this.intervalId):(nP("task>>trigger url ",e),this.ishangUp=!0,this.intervalId&&this.clear(),this.intervalId=setTimeout((function(){t.clear()}),"start"===i?500:n.timer),aP(this.url,{range:"start"===i?"0-1024":n.range,timeout:n.timeout}).then((function(e){nP("getXhr>>check result ",e),t.setData(e||{}),t.ishangUp=!1})).catch((function(e){nP("getXhr>>error ",e),t.ishangUp=!1,t._data.status=-1})))}},{key:"url",get:function(){return this.options.url},set:function(e){e&&(this.options.url=e)}},{key:"serverIp",get:function(){return this._headers.x_response_sinfo||""}},{key:"headers",get:function(){return this._headers||{}}},{key:"status",get:function(){return this._data.status||-1}},{key:"speed",get:function(){return this._data.speed}},{key:"clear",value:function(){clearTimeout(this.intervalId),this.intervalId=null}}]),e}(),XL="ProgressInfo",JL=function(){function e(){Oh(this,e),this._init()}return Lh(e,[{key:"_init",value:function(){this.played=[],this.playedSize=0,this.cachedSize=0,this.pcdnCached=0,this.cachedVideoSize=0,this.pcdnVideoCached=0,this.file={audio:0,video:0},this.lastBitrate=null,this.curBitrate={vBitrate:0,aBitrate:0,cdnSize:0,pcdnSize:0,definition:"",fileid:""},this.nextBitrate={start:-1},this.currentTime=0,this.buffered=[],this.cachedTime=0,this.duration=0}},{key:"reset",value:function(){this._init()}},{key:"getFileSize",value:function(e){var t=this.curBitrate,i=t.vBitrate,n=t.aBitrate;return{audio:Math.round(e*n/8),video:Math.round(e*i/8),total:Math.round(e*(i+n)/8)}}},{key:"updatePlayed",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=this.played,n=i.length;if(0===t||n<1){var r=n>0?i[n-1]:null,o=this.curBitrate,a=o.vBitrate,s=o.aBitrate;r&&(r.end<0||r.end-r.start<1)?(r.end<0?r.start=e:r.end=e,r.vBitrate=a,r.aBitrate=s):i.push({start:e,end:-1,vBitrate:a,aBitrate:s})}else i[n-1].end=e}},{key:"calculatePlaySize",value:function(){var e=this.played,t=this.curBitrate,i=function(e){for(var t=0,i=0;i<e.length;i++){var n=e[i];n.end<0||(t+=n.end-n.start)}return t}(e),n=Math.round((t.aBitrate+t.vBitrate)*i/8);return this.playedSize+=n,nP(XL,"calculatePlaySize","duration: ".concat(i," playedSize:").concat(this.playedSize),this.played),this.played=[],this.playedSize}},{key:"copyBitrateInfo",value:function(e,t){return["aBitrate","vBitrate","definition","fileid","cdnSize","pcdnSize"].forEach((function(i){e[i]&&(t[i]=e[i])})),t.cdnSize=e.cdnSize,t.pcdnSize=e.pcdnSize,t}},{key:"checkNextBitrate",value:function(e){var t=this.nextBitrate;if(t.start>-1&&e>=t.start){var i=this.curBitrate;this.calculatePlaySize(),nP(XL,"checkNextBitrate",e,t.start,this.cachedSize),this.copyBitrateInfo(t,i),this.updatePlayed(e,0),t.start=-1,t.fileid="",["vBitrate","aBitrate","cdnSize","pcdnSize"].forEach((function(e){t[e]=0}))}}},{key:"updateLastDefInfo",value:function(){var e=this.curBitrate;if(e.vBitrate>0){var t={};this.copyBitrateInfo(e,t),this.lastBitrate=t}}},{key:"updateDefInfo",value:function(e,t){nP(XL,"updateDefInfo",t,this.curBitrate.vBitrate,e);var i=e.mediaType,n=e.start,r=e.bitrate,o=e.definition,a=e.fileid,s={cdnSize:0,pcdnSize:0};"audio"===i?s.aBitrate=r:(s.vBitrate=r,s.definition=o,s.fileid=a,this.updateLastDefInfo()),s.start=n,this.nextBitrate=s,this.checkNextBitrate(t)}
1},{key:"upDateDownload",value:function(e){var t=e.cdn_size,i=e.pcdn_size,n=e.mediaType,r=this.curBitrate,o=this.nextBitrate,a=0,s=0;i?(a=1,s=i):t&&(s=t),this.cachedSize+=s,"video"===n&&(this.cachedVideoSize+=s,a>0&&(this.pcdnVideoCached+=s)),a>0&&(this.pcdnCached+=s);var l=o.start>=0?o:r;l.cdnSize+=s,a>0&&(l.pcdnSize+=s)}},{key:"updateBuffered",value:function(e){var t=function(e){var t=[];if(!e||e.length<1)return t;for(var i=0;i<e.length;i++){var n=parseInt(1e3*e.start(i),10)/1e3,r=parseInt(1e3*e.end(i),10)/1e3;t.push({start:n,end:r})}return t}(e),i=0;t.forEach((function(e){var t,n;i+=(t=e.end,n=e.start,parseInt(1e3*t-1e3*n,10)/1e3)})),this.buffered=t,this.cachedTime=i}},{key:"isDefInfoFirstChange",value:function(){return!(this.curBitrate&&this.curBitrate.vBitrate>0)}}]),e}(),ZL="0.12.1",QL=["try_req_num","req_node_succ","conn_req_num","has_ret_node","conn_fail_num","conn_jump_num"];nP("xgVodLogger version is ".concat(ZL));var eA,tA,iA=(eA="Object",function(e){return Object.prototype.toString.call(e)==="[object ".concat(eA,"]")}),nA=1300,rA="__tea_cache_tokens_".concat(nA),oA=-1,aA="",sA=null,lA=function(){function e(t,i){var n=this;if(Oh(this,e),Ah(this,"initializeUrlLog",(function(e){var t=e&&e.url?e.url:"String"===dP(e)?e:"";"String"!==dP(t)&&(t=""),n.urlLog={initial_url:t,initial_host:tP(t),initial_ip:""}})),Ah(this,"onXgLogCache",(function(){var e,t=n._getLogCache();t&&(n._templog={vtype:null===(e=n.player)||void 0===e?void 0:e.vtype,log:t},n.onOneTemp())})),Ah(this,"onPrfDataSize",(function(e){n._progressInfo.upDateDownload(e)})),Ah(this,"onDegrade",(function(e){e&&(e.local_time=(new Date).getTime(),n.onOneEvent({end_type:"degrade"},e))})),Ah(this,"onMediaFormatError",(function(e){n.onOneEvent({end_type:"".concat(e.error_type||"","Error")})})),Ah(this,"onDrmTypeChange",(function(e){n.addIfExist("drm_type",{drm_type:e},n._options)})),Ah(this,"onReplayBtnClick",(function(){n.resetLoggerParams()})),Ah(this,"onBeforeDefinitionChange",(function(){n.resLogs.ldst=rP(),n._endType="switch"})),Ah(this,"onDefinitionChangeDetail",(function(e){var t=n._progressInfo;t.updateDefInfo(e,n.player.currentTime),t.lastBitrate&&"video"===e.mediaType&&n.sendSwitchOpera("changedetail")})),Ah(this,"onDefinitionChange",(function(e){var t=e.from,i=e.to;n.changeResolution({from:t,to:i,startTime:n.resLogs.ldst,operaType:"switch"}),nP("onDefinitionChange from:".concat(t,", to:").concat(i))})),Ah(this,"onDefiChangeSuccess",(function(){nP("onDefinitionChangeSuccess"),n.updateVideoSize(),n.triggerTask("start")})),Ah(this,"onAbrChange",(function(e){var t=e.prev,i=e.cur,r=e.abrInfo;if(n.player.abrInstance){var o=n.player.abrInstance.eventInfo;nP("abrChange",o),o.last_definition=t,o.now_definition=i,n.abrInfo.abr_event_info.video_switch.push(o),n.changeResolution({from:t,to:i,startTime:rP(),operaType:"abr_switch",abrInfo:r})}})),Ah(this,"onAbrPrestallEnd",(function(e){n.abrInfo.abr_user_info.cancel_abr=e?1:0})),Ah(this,"onTimeUpdate",(function(){var e=n.playlogs,t=n.resLogs,i=n.player;if(n.errorLog.try_err_c=0,e.vt||1!==n.startStep||(e.vt=oP(),nP("onTimeUpdate: first frame inited","currentTime11:".concat(i.currentTime," vt-pt:").concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt," vt-rt:").concat(e.vt-e.rt)),n.startStep=2),!t.initial_resolution){var r=i.currentDefitionFromPlayer&&i.currentDefitionFromPlayer.definition?i.currentDefitionFromPlayer.definition:i.config.defaultDefinition||"".concat(i.video.videoHeight,"p")||"";r=pP(r),t.initial_resolution=r}t.final_resolution||(t.final_resolution=t.initial_resolution);var o=e.played.length;o<1?e.played.push({begin:i.currentTime,end:-1}):e.played[o-1].end=i.currentTime,n._progressInfo.updatePlayed(i.currentTime),n._progressInfo.checkNextBitrate(i.currentTime);var a=t.played.length;a<1?t.played.push({begin:i.currentTime,end:-1}):t.played[a-1].end=i.currentTime,n.lastVideoTime=i.currentTime||0})),Ah(this,"onVideoProgress",(function(){n.updateBuffers(),n._progressInfo.updateBuffered(n.player.buffered)})),Ah(this,"onCanplay",(function(){nP("onCanplay","this.startStep:".concat(n.startStep," ").concat(oP())),n.setVt()})),Ah(this,"onLoadeddata",(function(){nP("onLoadeddata","this.startStep:".concat(n.startStep," ").concat(oP())),n.setVt(),n.updateVideoSize()})),Ah(this,"onLoadStart",(function(){n.commonParams.web_url=location.href;var e=sP(n.player.currentSrc);n.triggerTask("start"),nP("onLoadStart","this.startStep:".concat(n.startStep," ").concat(oP()," isSrcEmpty:").concat(e," player.src:").concat(n.player.src)),0!==n.startStep||e||"visible"!==document.visibilityState||n.setPt()})),Ah(this,"onBufferedChange",(function(){var e=n.player.video&&n.player.video.buffered;if(e){var t=e.length;t>0&&e.end(t-1)+1>n.player.duration&&(n.bft=oP())}})),Ah(this,"onPlayerInited",(function(){nP("player init"),n._playerCreatedTime=oP(),n.playlogs.rt=oP()}
1)),Ah(this,"onNotAutoPlay",(function(){nP("onNotAutoPlay","autoplay:".concat(n.isAutoplay)),0===n.isAutoplay?n.isAutoplay=2:1===n.isAutoplay&&(n.isAutoplay=3)})),Ah(this,"onDashError",(function(e){e=e||{};var t=n.errorLog;t.last_errors.push(e.errorCode),t.accu_errc++,n.onOneError({errorType:e.errorTypeCode,code:e.errorCode,url:e.url||"",headers:e.headers||{}},0)})),Ah(this,"onPlayerError",(function(e){e=e||{};var t=n.errorLog,i=n.player;if(nP("onPlayerError","this.player.type:".concat(n.player.type," this.player.replayRunning:").concat(n.player.replayRunning," isSupportMP4:").concat(WL.isSupportMP4," isPC:").concat(WL.isPC)),nP("onPlayerError",e),n.load_state=BP,n._endType="error",n.suspendWaitingStatus("onPlayerError"),n._progressInfo.calculatePlaySize(),"dash"!==i.type||!i.replayRunning){if(e.url||(e.url=n.player.currentSrc),WL.isPC&&!WL.isSupportMP4||WL.isSpider)return t.errc=DP[5],t.errt=xP.notSupport,n.onOneError({errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0),void(n._isOnePlayReport=!0);t.errt=e.errorTypeCode||(e.errorType&&xP[e.errorType]?xP[e.errorType]:9999),t.message=e.message||"",e.errorCode?t.errc=e.errorCode>0&&DP[e.errorCode]?DP[e.errorCode]:e.errorCode:e.code&&(t.errc=e.code>0&&DP[e.code]?DP[e.code]:e.code),t.last_errors.push(t.errc),0===t.fir_errc&&(t.fir_errc=t.errc),n.sendSwitchOpera(UP),n.onOnePlay(UP),n.onOneTemp(UP),n.sendDegradeLog("playCatch_end",n.playlogs.degrade);var r=!1,o=e.mediaError;o&&n._options.needXhrCheck&&(4===o.code||2===o)&&(r=!0),n.onOneError({endState:GP,errorType:t.errt,code:t.errc,url:e.url,headers:e.headers||{},message:e.message||""},0,r),n.sendEventsQueue()}})),Ah(this,"onPlayInterfaceInfo",(function(e){nP("onPlayInterfaceInfo",e);var t=n.errorLog,i=n.apiLog,r=n.playlogs;if(e&&Object.keys(e).map((function(t){"code"===t?i.vsc=e[t]:"message"===t?i.vsc_message=e.message||"successï¼è§é¢å¯æ£å¸¸ææ¾":i[t]=e[t]})),r.at=e.timestamep||(new Date).getTime(),(!e.error||-9988!==e.error.errc)&&(i.vsc=e.code||10,i.vsc_message=e.message||"successï¼è§é¢å¯æ£å¸¸ææ¾",e.error)){var o=e.error;t.errt=1e3,t.errc=o.errc||-9998,t.last_errors.push(o.errc||-9998),0===t.fir_errc&&(t.fir_errc=o.errc||-9998),t.accu_errc++,1===t.accu_errc&&(t.fir_errt=rP()),n.onOneError({errorType:1e3,code:o.errc||-9998,url:"",headers:{}})}})),Ah(this,"onProgressEvent",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.netLog;if(e.speed){var i=e.speed>1e6?Math.floor(e.speed/1e3):e.speed;t.downloadSpeed=i,t.totalSpeed+=i,t.rqCount++}"oversize"!==e.type&&t.requestCount++,e.connectTime&&(t.connectCost=e.connectTime);var r=t.rqCount<7?100:e.costTime>=5e3?20:10;if(!("success"===e.type&&parseInt(100*Math.random(),10)<=r)){var o=kP(e.cdnUrl),a=e.xhr||{},s=e.type?"progress_".concat(e.type):"progress",l=e.headers;l||(l=iP(a));var c=Dh(Dh({},l=uP(l)),{},{download_speed:t.downloadSpeed,connect_cost:t.connectCost,c_dur:o.connectDuration||0,d_dur:o.domainDuration||0,r_dur:o.duration||0,rqtt:(new Date).getTime(),x_cache:l.x_response_cache||"",server_ip:l.x_response_sinfo});e.status?t.status=e.status:a&&a instanceof window.XMLHttpRequest&&(t.status=a.status||0),c.status=t.status;var u=e.cdnUrl||e.url;"error"===e.type&&n.merror.cdn.push(Dh(Dh({costTime:e.costTime,cur_play_pos:e.pos,cdn_url:u,cdn_host:tP(u)},c),l)),n.onOneEvent({costTime:e.costTime,vid:e.vid,end_type:s,cur_play_pos:e.pos,cdn_url:u,cdn_host:tP(u)},c,"error"===e.type?0:2)}})),Ah(this,"onNext",(function(){if(nP("onNext:startStep:",n.startStep),n.startStep>0){if(n._reportInvalidVV(jP))return;n.sendSwitchOpera(jP),n.onOnePlay(jP),n.onOneTemp(jP),n.sendEventsQueue()}n.vtype=null,n.playlogs.lc=0,n.resetLoggerParams()})),Ah(this,"onNextEnded",(function(){var e=n.player,t=n.resLogs,i=pP(e.config.defaultDefinition||"");t.initial_resolution=i,t.final_resolution=i})),Ah(this,"onXgLogWaiting",(function(e){var t=n.playlogs,i=n.resLogs,r=n.stall;if(n._options.checkByInnerLog&&0===e.type){nP("onXgLogWaiting",e);var o=e.endType,a=e.costTime,s=e.start,l={download_speed:n.realSpeed,avg_speed:n.avgSpeed,mse_op:n.mp4MseOpLength,mp4_load_range:n.mp4LoadSegmentTimeRange,bitrate:n.curBitrate};if("waitingStart"===e.eventType)return n.onOneEvent({costTime:a,end_type:"waitstart"},l,2),void n.appendStallInfo("start",s);if("waitingEnd"===e.eventType){var c=rP();nP("onXgLogWaiting>>".concat(o,"|costTime:").concat(a," vt:").concat(t.vt)),n.appendStallInfo("end",c,o),t.bc++,n.checkInBuffer(n.player.currentTime)?(t.de_bu_acu_t+=a,t.dbc++):(t.nbc++,t.n_bu_acu_t+=a),i.bc++,t.bu_acu_t+=a,i.bu_acu_t+=a,r.end=n.cur_play_pos,r.cost=a,r.acc+=r.cost,1===r.sc&&(r.endf=n.cur_play_pos),n.onOneEvent({costTime:a,end_type:"waitend"},l,2)}}})),Ah(this,"onSeeking",(function(){if(!sP(n.player.src)){var e=n.resLogs,t=n.playlogs,i=n.player,r=n.seekLog;nP("onSeeking","currentTime:".concat(i.currentTime)),0===n.startStep&&n.setPt(),n.suspendWaitingStatus("seek"),n.isSeeking&&n.suspendSeekStatus("seek",!1),n.isSeeking=!0,t.played.push({begin:i.currentTime,end:-1}),e.played.push({begin:i.currentTime,end:-1}
1),n._progressInfo.updatePlayed(i.currentTime,0),r.lastSeekStartTime=rP(),r.seekBefore=n.lastVideoTime.toString(),r.buf_include=n.checkInBuffer(n.player.currentTime)?1:0,r.intervalId=setTimeout((function(){n.isSeeking&&n.suspendSeekStatus("seekTimeout",!0)}),6e4)}})),Ah(this,"onSeeked",(function(){sP(n.player.src)||n.isSeeking&&n.suspendSeekStatus("seeked",!0)})),Ah(this,"onPlaying",(function(){n.suspendWaitingStatus("play"),n.load_state=MP;var e=rP();n.pauseLog.isPausing&&(n.pauseLog.isPausing=!1,n.pauseLog.pause_acu_t+=e-n.pauseLog.pause_start)})),Ah(this,"onPlayCatch",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0};if(nP("onPlayCatch",e,t),e){switch(e){case"mp42dash":n.vtype="DASH_2";break;case"dash2mp4":n.vtype="MP4_2";break;case"dash1mp4":n.vtype="MP4_1";break;default:n.vtype=e}var i=n.errorLog,r=n.playlogs;n.merror.playCatch.push(Dh({errc:t.errorCode,errt:t.errorType},t.headers)),n.setBr("playcatch"),i.accu_errc++,i.try_err_c++,i.fir_errc=t.errorCode,t.errorCode&&i.last_errors.push(t.errorCode),n.suspendWaitingStatus("playcatch"),n.suspendSeekStatus("playcatch"),n.sendDegradeLog("playCatch",r.degrade,{cdn_url:t.url}),r.degrade=e,n.onOneError({errorType:t.errorTypeCode,code:t.errorCode,url:t.url||"",status:t.httpCode||t.status,headers:t.headers||{},vid:t.vid||n.vid,preload_hit:t.preloadHit||0,preload_cached:t.preloadCached||0,endState:zP,costTime:t.costTime,message:t.errorMessage||t.message,interval_time:t.timerStep||0},0)}})),Ah(this,"onMediaExpied",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:"",errorTypeCode:0,errorCode:0,url:"",headers:{},status:0},t=n.errorLog,i=n.playlogs;nP("onMediaExpied",e),n.suspendWaitingStatus("expied"),n.setBr("expied"),t.accu_errc++,t.try_err_c++,t.last_errors.push(e.errorCode),i.at=(new Date).getTime(),n.merror.expied.push(Dh({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status},uP(e.headers||{}))),n.onOneError({errorType:e.errorTypeCode||e.errorType,code:e.errorCode,url:e.url||"",status:e.status,headers:e.headers||{}},0)})),Ah(this,"onLog",(function(e){nP("onLog",e);var t=e.type;if(delete e.type,t)switch(t){case WP:break;case $P:n._templog||(n._templog={}),n._templog=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object.keys(t).map((function(n){e[n]="append"===i?hP(e[n],t[n]):t[n]})),e}(n._templog,e.data,e.action),n._templog.preload_hit&&(n._cacheFile=XP);break;case KP:var i=n.errorLog;i.accu_errc++,i.try_err_c++,n.setBr("mp4error"),i.last_errors.push(e.code),n.onOneError(e,0);break;case YP:var r=function(e,t){var i={ext:e.ext||{},data:{}};return Object.keys(e).map((function(n){t[n]?i.data[t[n]]=e[n]:"ext"!==n&&(i.ext[n]=e[n])})),i}(e,{costTime:"costTime",vid:"vid",end_type:"end_type",pos:"cur_play_pos",cdnUrl:"cdn_url"});r.ext&&["start","end"].map((function(e){r.ext[e]&&(r.ext["ext_".concat(e)]=r.ext[e],delete r.ext[e])})),n.onOneEvent(r.data,r.ext,2)}})),Ah(this,"onPlay",(function(){nP("onPlay","this.startStep :".concat(n.startStep," this.isEnded:").concat(n.isEnded)),n.isEnded&&(n.resetLoggerParams(),n.setPt())})),Ah(this,"onPause",(function(){nP("onPause");var e=n.pauseLog;e.isPausing=!0,e.pause_start=rP()})),Ah(this,"onWaiting",(function(){var e=n._options;n.updateCurBuffer("onWaiting"),e.checkByInnerLog||(nP("onWaiting>","isSeeking:".concat(n.isSeeking," startStep:").concat(n.startStep," intervalId:").concat(n.stallIntervalId)),n.wait_buf_include=n.checkInBuffer(n.player.currentTime,-1e3)?1:0,n.isSeeking||0===n.playlogs.vt||n.inWaitingStart>0||(n.stallIntervalId&&(window.clearTimeout(n.stallIntervalId),n.stallIntervalId=null),n.inWaitingStart=rP(),n.waitStartTime=n.cur_play_pos,n.stallIntervalId=window.setTimeout((function(){var e=n.stall;nP("this.stallIntervalId>>".concat(n.stallIntervalId," cost: ").concat(rP()-n.inWaitingStart)),n._endType="wait",n.load_state=NP,n.vtype.indexOf("MP4")>-1&&n.player.currentTime>10&&n.task&&(n.triggerTask("waiting",n.initial_url),n.requestCount++),e.start=n.waitStartTime,e.bc++,1===e.bc&&(e.startf=n.waitStartTime),window.clearTimeout(n.stallIntervalId),n.stallIntervalId=null,n.startWaitingStatus(n.inWaitingStart,rP()-n.inWaitingStart),n.stallIntervalId=setTimeout((function(){n.inWaitingStart>0&&n.suspendWaitingStatus("timeout")}),6e4)}),200)))})),Ah(this,"onEnded",(function(){if(n.initial_url){nP("onEnded","watchDur:".concat(n.watchDur," vt:").concat(n.vt," pt:").concat(n.pt)),n.isEnded=!0;var e=n.resLogs.df,t=n._progressInfo;t.calculatePlaySize(),t.cachedSize<1?n.changeResolution({from:e,to:e,startTime:rP(),operaType:"leave_switch",endType:"ended"}):n.sendSwitchOpera(HP),n.onOnePlay(HP),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n.onOneTemp(HP),n.sendEventsQueue(),n.playlogs.lc++}})),Ah(this,"onUnload",(function(){0!==n.startStep&&n.initial_url&&(n.onOneTemp(FP),n.sendDegradeLog("playCatch_end",n.playlogs.degrade),n._reportInvalidVV(FP)||(n.sendSwitchOpera(FP),n.onOnePlay(FP,!0)))})),Ah(this,"onVisibilitychange",(function(){var e=n.playlogs.vt;"visible"===document.visibilityState&&(e||n.setPt())})),Ah(this,"onDestroy",(function(){nP("onDestroy:this.startStep:".concat(n.startStep," initial_url:").concat(n.initial_url," ").concat(!!n.initial_url)),n.onOnePlay(VP),n.startStep>0&&n.initial_url&&(n.onOneTemp(VP),n.sendDegradeLog("playCatch_end",n.playlogs.degrade));var e=n.resLogs.df;n._progressInfo.cachedSize<1?n.changeResolution({from:e,to:e,startTime:rP(),operaType:"leave_switch",endType:"destroy"}):n.sendSwitchOpera(HP),n.sendEventsQueue(),WL.isPC?window.removeEventListener("beforeunload",n.onUnload):(WL.isMobile||WL.isPad)&&window.removeEventListener("pagehide",n.onUnload),document.removeEventListener("visibilitychange",n.onVisibilitychange),n.listeners.forEac
1h((function(e){n.player.off(e.evt,e.handler)})),n.clearTimers(),n.player.off("destroy",n.onDestroy),n.task&&n.task.clear()})),Ah(this,"onOnePlay",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(nP("onOnePlay _isOnePlayReport:".concat(n._isOnePlayReport," isLeave: ").concat(t," endState:").concat(e)),!n._isOnePlayReport){var i=n.errorLog,r=n.playlogs,o=n.abrInfo,a=n.resLogs,s=n.player,l=n.apiLog,c=n.pauseLog,u=n.stall,h=n.netLog,d=n.watchDur;n._isOnePlayReport=!0;var f=oP();n.getBufferTime(s);var p=n.getFrameInfo(),g=n.getPerformance(),v=i.errc,y=n._progressInfo,m=y.playedSize,_=y.cachedSize,b=y.pcdnCached,k=y.cachedVideoSize,w=y.pcdnVideoCached,S=n._progressInfo.getFileSize(s.duration);n.setExt();var T=Dh(Dh(Dh(Dh({local_time:(new Date).getTime(),log_type:"video_playq",plugin_exception:0,player_create_exception:"",v:n.vid,initial_url:n.initial_url,initial_host:n.initial_host,initial_ip:n.curHeaders.x_response_sinfo||0,initial_type:n.initial_type},n.curHeaders),{},{initial_resolution:a.initial_resolution,final_resolution:a.final_resolution,pt:n.pt,prepare_start_time:r.nt,prepare_end_time:r.rt||oP(),vt:n.vt,lt:n.lt,lpt:n.lpt,fvt:n.fvt,nvt:n.nvt,bft:n.bft,sc:n.seekLog.sc,sat:n.seekLog.sat,bc:n.bc,dbc:r.dbc||0,nbc:r.nbc||0,video_net_s:n.videoNetworkState,status:n.curStatus,first_buf_startt:u.startf,first_buf_endt:u.endf,lc:r.lc,bu_acu_t:n.bu_acu_t>JP?0:n.bu_acu_t,de_bu_acu_t:r.de_bu_acu_t||0,n_bu_acu_t:r.n_bu_acu_t||0,pause_acu_t:c.pause_acu_t,cur_play_pos:n.cur_play_pos,load_state:n.load_state,play_speed:n.playbackRate,playback_state:n.playback_state,end_state:e,watch_dur:d>JP?0:d,switch_resolution_c:n.switchResolutionCount,is_start_play_automatically:n.isAutoplay,start_time:n.start_time,finish:n.finish,errt:i.errt,errc:v,vsc:l.vsc,vsc_message:i.message||l.vsc_message,api_str:l.api_str,auth:l.auth||l.logid,width:n.videoWidth,height:n.videoHeight,vd:n.vd,video_length:S.video,audio_length:S.audio,df:n.resolution,lf:a.lf,play_c:0,player_created_t:n.player_created_t,fir_errt:i.fir_errt,fir_errc:i.fir_errc,lv_method:0,ldst:a.ldst,ldet:a.ldet,is_disable_short_seek:0,mute:n.mute,volume:n.volume,download_speed:n.realSpeed?n.realSpeed:n.task&&n.task.speed?n.task.speed:h.downloadSpeed,avg_speed:n.avgSpeed?n.avgSpeed:h.rqCount>0?parseInt(h.totalSpeed/h.rqCount,10):0,bitrate:n.curBitrate,preload_state:n.preloadState,preload_hit:n.preLoadData.hit||0,preload_cached:n.preLoadData.duration||n.preLoadData.byteLength||0,mdl_req_num:h.requestCount,watingcost:n.watingCost,br:r.br,fbrt:r.fbrt,try_err_c:i.try_err_c,accu_errc:i.accu_errc,merror:gP(n.merror),ex:gP(n.exInfo),perf:gP(g),bufs:gP(n.buffers.allBuffer),vds:_,pvds:b,vps:m,vvds:k,pvvds:w,pcdn:gP(n.getPCDNStat())},n.buffers.curBuffer),{},{degrade:r.degrade,cache_file:n._cacheFile},p),{},{fullScreen:n._getFullScreenType(),encryptedInfo:gP(n.encryptedInfo)});0!==n.vt&&(T.et=f);var E=n._logstrcache||n._getLogCache();if(0===T.fvt&&E&&(T.log=E,n._logstrcache=null),null!=s&&s.softDecoder&&(T.soft_decoder=s.softDecoder),s&&s.dashState&&(T.dash_state=s.dashState),null!=s&&s.softDecoder&&(T.soft_decoder=s.softDecoder),o.abr_init_opts=s.config.autoBitrateOpts||{},T.abr_info=gP(n.abrInfo),t){var C=!n._options.disableLocalCache;n.reportLog(wP,T,C?1:0)}else n.reportLog(wP,T)}})),Ah(this,"onOneEvent",(function(e){var t=e.costTime,i=e.vid,r=e.end_type,o=e.cur_play_pos,a=e.cdn_url,s=e.cdn_host,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;nP("onOneEvent",r);var u=n.buffers,h=u.curBuffer,d=u.allBuffer,f=n.getFrameInfo(),p=Dh(Dh({local_time:(new Date).getTime(),v:i||n.vid,cost_time:t,end_type:r||n.end_type,cdn_url:a||n.url,cdn_host:s||"",initial_type:n.initial_type,resolution:n.resolution,play_speed:n.playbackRate,first_frame_interval:rP()-n.pt,last_switch_interval:n.getLastInterval("lastSwitchStartTime",n.resLogs,!1),last_seek_interval:n.updateSeekPt(!1),last_event_interval:n.getLastInterval("lastEventTime"),cur_play_pos:o||n.cur_play_pos,video_ready_s:n.videoReadyState,video_seeking:n.videoSeeking,video_paused:n.videoPaused,bufs:gP(d),retry_count:n._retryCount,at:n.playlogs.at,bc:n.stall.bc,stay_seconds:parseInt(((new Date).getTime()-n.playlogs.at)/1e3,10),preload_state:n.preloadState,preload_hit:n.preLoadData.hit,preload_cached:n.preLoadData.duration||n.preLo
1adData.byteLength},h),f);r.indexOf("waitend")>=0&&t>3e3&&(p.log=n._getLogCache());var g=n.player,v=g.currentTime,y=g.duration-v;if(r.indexOf("waitstart")>=0&&y<=1){var m=p.local_time,_=p.v,b=p.cost_time,k=p.cdn_url,w=p.first_frame_interval,S=p.cur_play_pos,T=p.video_ready_s,E=p.video_seeking,C=p.video_paused,x=p.bufs,D=p.bc,P=p.preload_hit;n.reportLog(EP,Dh({end_type:"longwait",local_time:m,v:_,cost_time:b,cdn_url:k,first_frame_interval:w,cur_play_pos:S,video_ready_s:T,video_seeking:E,video_paused:C,bufs:x,bc:D,preload_hit:P},h),c)}if("waitstart"===r&&"function"==typeof n._options.getPageFPS){var O=n._options.getPageFPS();p.cur_fps=O.curFPS||0,p.avg_fps=O.avgFPS||0}r.indexOf("wait")>-1&&(p.buf_include=n.wait_buf_include),r.indexOf("timeout")>-1&&p.cost_time>ZP&&(p.cost_time=ZP);var I=n.player;I&&I.dashState&&(p.dash_state=n.player.dashState),Object.keys(l).forEach((function(e){p[e]=l[e]})),p.ex=gP(n.getPlayerExt()),n.addIfExist("drm_type",n._options,p),n.reportLog(EP,p,c)})),Ah(this,"onOneTemp",(function(){if(nP("onOneTemp>>",!n._templog),n._templog){var e=n.player,t=n.playlogs,i=n.pauseLog,r=n.errorLog,o=n.resLogs,a=n.watchDur,s=Dh(Dh(Dh({local_time:(new Date).getTime()},n._templog),{},{v:n.vid,initial_type:n.initial_type,pt:n.pt,vt:n.vt,lt:n.lt,fvt:n.fvt,bc:n.bc,bu_acu_t:n.bu_acu_t>JP?0:n.bu_acu_t,pause_acu_t:i.pause_acu_t,cur_play_pos:n.cur_play_pos,watch_dur:a>JP?0:a,finish:n.finish,errt:r.errt,errc:r.errc,vd:n.vd,df:n.resolution,lf:o.lf,br:t.br,fbrt:t.fbrt,try_err_c:r.try_err_c,accu_errc:r.accu_errc,dash_break:2===e.dashBufferBreak?1:0,bufs:gP(n.buffers.allBuffer),vs:o.vs,vds:o.vds,vps:o.vps},n.buffers.curBuffer),{},{degrade:t.degrade});0!==n.vt&&(s.et=oP()),["drm_type","dynamic_type"].forEach((function(e){n.addIfExist(e,n._options,s)})),n.reportLog(CP,s,0),n._templog=null}})),this.player=t,void 0===this.player||null===this.player)throw new Error("player is ".concat(this.player));if(i&&i.line_app_id){i.isTask&&(this.task=new qL),this.eventQueue=[],this._instanceCreateTime=(new Date).getTime(),i.codec_type=i.codec_type||"h264",this._envInfo=i.envInfo||{},this._options=i,!this._options.maxQueueCount&&(this._options.maxQueueCount=5),this.line_app_id=parseInt(i.line_app_id,10)||0,this.line_user_id=(i.line_user_id||"").toString(),this.playerCoreVersion=t.version,this.playerVersion=i.playerVersion,this.closeSeekLog=i.closeSeekLog||!1,this.start_time=1e3*(i.start_time||0),this._initial_resolution="",this.__vtype=null,this.__dt="",this._progressInfo=new JL,this.resetLoggerParams();try{this.initializeTracker(),this.sendLocalLog(),this.bindEvt(),nP("logger constructor:".concat(this.player.video))}catch(e){}}}return Lh(e,[{key:"resetLoggerParams",value:function(){nP("resetLoggerParams");var e=this.playlogs?this.playlogs.lc:0;this.playlogs={nt:oP(),vt:0,rt:this.isEnded?oP():0,at:0,pt:0,bu_acu_t:0,bc:0,br:0,fbrt:"",dbc:0,de_bu_acu_t:0,nbc:0,n_bu_acu_t:0,played:[{begin:0,end:-1}],degrade:"none",lc:e},this.degradeLog={bu_acu_t:0,bc:0,watch_dur:0,hasSendEnd:!1},this.buffers={allBuffer:[],curBuffer:{buf_diff:0,buf_s_pos:0,buf_e_pos:0,buf_include:0}},this.netLog={downloadSpeed:0,requestCount:0,connectCost:0,totalSpeed:0,rqCount:0,status:0},this.merror={cdn:[],player:[],playCatch:[],expied:[]},this.exInfo={stall:[]},this._templog=null,this._isOnePlayReport=!1,this.startStep=0,this.bft=0,this._progressInfo.reset(),this.initializeLogDatas(),this.initializeUrlLog()}},{key:"initializeLogDatas",value:function(){this.startStep=0,this.inWaitingStart=0,this.waitStartTime=0,this.lastVideoTime=0,this._endType="",this._retryCount=0,this.lastOperaTime=oA,this.lastEventTime=oA,this.stallIntervalId=null,this.seekLog={intervalId:0,lastSeekStartTime:rP(),seekBefore:0,sat:0,sc:0,buf_include:0},this.resLogs={lastSwitchStartTime:oA,switch_count:0,abr_switch_count:0,initial_resolution:"",final_resolution:"",ldst:0,ldet:0,df:"",lf:"",played:[],bc:0,bu_acu_t:0,sc:0,sat:0,buf:0,lbuf:0,lplayed:0,vs:0,vds:0,vps:0,vis:0,bitrate:0},this.apiLog={code:0,message:"",logid:"",api:"",auth:"",error:{}},this.errorLog={accu_errc:0,try_err_c:0,errt:0,errc:0,fir_errt:0,fir_errc:WL.isSupportMP4?0:1005,last_errors:[],message:""},this.pauseLog={pause_acu_t:0,isPausing:!1,pause_start:0},this.stall={sc:0,startf:0,endf:0,start:0,end:0,cost:0,acc:0},this._playerCreatedTime=0,this.load_state=RP,this.lv_method=6,this.isSeeking=!1,this.isEnded=!1,this.startStep=0,this.isAutoplay=this.player.config&&this.player.config.auto
1play?1:0,this.abrInfo={abr_general_info:{},abr_event_info:{video_switch:[],video_stall:[],video_exit:{}},abr_play_info:{start_play_time_ms:0,is_hint:0,playback_info:{internet_speed_record:[],play_bitrate_record:[],buffer_length_record:[],play_speed_record:[]}},abr_user_info:{cancel_abr:0},abr_init_opts:this.player.config.autoBitrateOpts||{}},this._cacheFile=qP}},{key:"initSessionId",value:function(){var e="0";try{e=window.localStorage.getItem(rA).web_id||"0"}catch(t){e="0"}this._sessionId=function(e){var t=(new Date).getTime();try{e=parseInt(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)}))}(e),nP("sessionId ".concat(this._sessionId))}},{key:"initializeTracker",value:function(){var e=this,t=this._options;if(window.__xgplayer_vod_log__)this.tracker=window.__xgplayer_vod_log__;else{this.tracker=window.__xgplayer_vod_log__=new sA("tracker");var i=t.channel||"cn",n={app_id:"cn"===(i="va"===i||"sg"===i?i:"cn")?nA:1300===nA?323254:nA,channel:i,log:!1,disable_sdk_monitor:!0};t.channelDomain&&(n.channel_domain=t.channelDomain),n.enable_ab_test=!!t.enableAbTest,this.tracker.init(n)}this.initSessionId();var r=navigator?navigator.hardwareConcurrency:0,o=navigator?navigator.deviceMemory:0;this.commonParams={play_type:0,source_type:"vid",sdk_version:ZL,pc:this.playerCoreVersion,pv:this.playerVersion,line_app_id:this.line_app_id,line_user_id:this.line_user_id,app_version:t.appVersion||"",platform:WL.isPad?"pad":WL.isMobile?"mobile":"pc",cpu_core:Number(r)||0,memory_size:Number(o)||0,support:YL(),webdriver:navigator&&navigator.webdriver?1:0,player_sessionid:this.sessionId,web_url:window.location.href,user_agent:navigator.userAgent};var a=t.trackerConfig||{};nP("commonParams ",this.commonParams,a);var s=Dh({evtParams:this.commonParams,disable_auto_pv:!0},a);!WL.name||WL.isChrome||WL.isSafari||(s.browser=WL.name,WL.appVersion&&(s.browser_version=WL.appVersion)),this.line_user_id&&(s.user_unique_id=this.line_user_id,!t.enableTeaWebId&&(s.web_id=this.line_user_id)),t.referrer&&(s.referrer=t.referrer,s.referrer_host=tP(t.referrer)),t.ext&&Object.keys(t.ext).map((function(i){e.exInfo[i]=t.ext[i]})),nP("trackConfig",s),this.tracker.config(s),this.tracker.start()}},{key:"resetDefiInfo",value:function(){var e=this.resLogs;e.played=[],e.bc=0,e.bu_acu_t=0,e.sc=0,e.sat=0}},{key:"sendLocalLog",value:function(){var e=this,t=nO.get();nO.remove(),t.map((function(t){Object.keys(t).map((function(i){if(nP("sendLocalLog",i,t[i]),e.player){e.player.emit("abLog",i,t[i]);var n=e._options.sendLocalCallback;n&&"function"==typeof n&&n(i,t[i])}e._track(i,t[i])}))}))}},{key:"_track",value:function(e,t){"function"==typeof this.tracker?this.tracker(e,t):this.tracker.event(e,t)}},{key:"bindEvt",value:function(){var e=this;this.listeners=[{evt:"play",handler:this.onPlay},{evt:"playing",handler:this.onPlaying},{evt:"pause",handler:this.onPause},{evt:"waiting",handler:this.onWaiting},{evt:"playInterfaceInfo",handler:this.onPlayInterfaceInfo},{evt:"DRM_ERROR",handler:this.onDashError},{evt:"ended",handler:this.onEnded},{evt:"loadeddata",handler:this.onLoadeddata},{evt:"loadstart",handler:this.onLoadStart},{evt:"canplay",handler:this.onCanplay},{evt:"progress",handler:this.onVideoProgress},{evt:"autoplay_was_prevented",handler:this.onNotAutoPlay},{evt:"seeking",handler:this.onSeeking},{evt:"seeked",handler:this.onSeeked},{evt:"complete",handler:this.onPlayerInited},{evt:"timeupdate",handler:this.onTimeUpdate},{evt:"bufferedChange",handler:this.onBufferedChange},{evt:"beforeDefinitionChange",handler:this.onBeforeDefinitionChange},{evt:"definitionChange",handler:this.onDefinitionChange},{evt:"definitionChangeSuccess",handler:this.onDefiChangeSuccess},{evt:"drmTypeChange",handler:this.onDrmTypeChange},{evt:"replayBtnClick",handler:this.onReplayBtnClick},{evt:"initialUrl",handler:this.initializeUrlLog},{evt:"ABR_CHANGE",handler:this.onAbrChange},{evt:"playCatch",handler:this.onPlayCatch},{evt:"log",handler:this.onLog},{evt:"ABR_PRESTALL_END",handler:this.onAbrPrestallEnd},{evt:"progress_event",handler:this.onProgressEvent},{evt:"logger_next",handler:this.onNext},{evt:"playnext",handler:this.onNext},{evt:"nextEnded",handler:this.onNextEnded},{evt:"media_format_error",handler:this.onMediaFormatError},{evt:"xglog",handler:this.onXgLogWaiting},{evt:"xglog_cache",handler:this.onXgLogCache},{evt:"degrade",handler:this.onDegrade},{evt:"definitionChangeDetail",handler:this.onDefinitionChangeDetail},{evt:"prf_data_size",handler:this.onPrfDataSize}
1];var t=this.player.config.errorKey;nP(">>>errorKey",t);var i={evt:"error",handler:this.onPlayerError};t&&(i.evt=t),this.listeners.push(i),this.listeners.forEach((function(t){e.player.on(t.evt,t.handler)})),this.bindUnload()}},{key:"_getLogCache",value:function(){var e,t,i=(null===(e=this.player)||void 0===e?void 0:e.logCache)||(null===(t=this.player)||void 0===t?void 0:t.getLogCache);return this._logstrcache=i,i}},{key:"addIfExist",value:function(e,t,i){if(iA(t)){var n=t[e];null!=n&&(i[e]=n)}}},{key:"sendSwitchOpera",value:function(e){var t=this._progressInfo,i=t.lastBitrate,n=t.curBitrate,r=t.nextBitrate,o={costTime:0,operaType:"detail_switch",stateBefore:"",stateAfter:"",endType:e},a=null;if("changedetail"===e){if(!i)return;a=i,o.stateBefore=i.definition,o.stateAfter=r.definition}else a=n,o.stateBefore=n.definition,o.stateAfter="";var s={vds:a.cdnSize,pvds:a.pcdnSize,fileid:a.fileid};this.onOneOperator(o,s)}},{key:"changeResolution",value:function(e){var t=e.from,i=e.to,n=e.startTime,r=e.operaType,o=e.abrInfo,a=e.endType,s=void 0===a?"":a,l=this.resLogs;t=pP(t),i=pP(i),l.ldet=rP(),l.df=i,l.lf=t,l.final_resolution=i,l.switch_count++;var c=l.ldet-n,u={bc:l.bc,bu_acu_t:l.bu_acu_t,sc:l.sc,sat:l.sat,watch_dur:eP(l.played)};o&&(u.abrInfo=o),this.updateVds(),this.resetDefiInfo(),this._options.closeResolutionLog||this.onOneOperator({costTime:c,operaType:r,endType:s,stateBefore:t,stateAfter:i},u,0)}},{key:"getLastInterval",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t[e],r=rP(),o=n===oA?oA:r-n;return i&&(t[e]=r),o}},{key:"updateSeekPt",value:function(e){return this.getLastInterval("lastSeekStartTime",this.seekLog,e)}},{key:"_reportInvalidVV",value:function(e){return!!this._isInvaidVV()&&(this.onOneError({endState:e,errorType:9998,code:-1,url:this.player.currentSrc,headers:{}},0),this._isOnePlayReport=!0,!0)}},{key:"_isInvaidVV",value:function(){return 0===this.vt&&-1===this.curStatus}},{key:"bindUnload",value:function(){WL.isPC?window.addEventListener("beforeunload",this.onUnload):(WL.isMobile||WL.isPad)&&window.addEventListener("pagehide",this.onUnload),document.addEventListener("visibilitychange",this.onVisibilitychange),this.player.once("destroy",this.onDestroy)}},{key:"clearTimers",value:function(){var e=this.seekLog;e.intervalId&&window.clearTimeout(e.intervalId),this.stallIntervalId&&window.clearTimeout(this.stallIntervalId)}},{key:"sendDegradeLog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"playCatch",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};nP("sendDegradeLog",e,t,i);var n=this.degradeLog;if(!(n.hasSendEnd||"playCatch_end"===e&&"none"===t)){"playCatch_end"===e&&(n.hasSendEnd=!0);var r=this.bu_acu_t-n.bu_acu_t;this.onOneEvent({costTime:this.vd,vid:this.vid,end_type:e,cur_play_pos:this.player.currentTime,cdn_url:i.url},Dh({degrade:t,vt:this.vt,pt:this.pt,fvt:this.fvt,bc:this.bc-n.bc,bu_acu_t:r>JP?0:r,watch_dur:this.watchDur-n.watch_dur},i),0)}}},{key:"_getFullScreenType",value:function(){return this.player.isFullscreen?eO.FULLSCREEN_TYPE:this.player.isCssfullScreen?eO.CSS:eO.NO_FULLSCREEN}},{key:"getBufferTime",value:function(e){var t=0,i=0,n=e.video&&e.video.buffered;if(n){for(var r=n.length,o=0,a=0;a<r;a++)o+=n.end(a)-n.start(a);t=i=1e3*o}return{video:t,audio:i}}},{key:"updateAbrInfo",value:function(e,t,i){e.abr_general_info=t.generalInfo,e.abr_event_info.video_exit={local_time_ms:(new Date).getTime(),buffer_length:t.bufferLength,internet_speed:t.downloadSpeed,now_bitrate:t.nowBitrate,play_speed:i},t.getAbrPlayInfo&&(e.abr_play_info=t.getAbrPlayInfo())}},{key:"getPerformance",value:function(){return this.player.performance||{}}},{key:"setExt",value:function(){var e=this,t=this.player.ext||{};t.performance&&delete t.performance,Object.keys(t).map((function(i){"performance"!==i&&(e.exInfo[i]=t[i])}))}},{key:"onOneOperator",value:function(e){var t=e.costTime,i=e.operaType,n=e.stateBefore,r=e.stateAfter,o=e.endT
1ype,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,l=this.getLastInterval("lastOperaTime"),c={local_time:(new Date).getTime(),v:this.vid,opera_type:i,state_before:n,state_after:r,cost_time:t,end_type:o||this.end_type,cdn_url:this.url,resolution:this.resolution,last_interval:l,bufs:gP(this.buffers.allBuffer),cur_play_pos:this.cur_play_pos,retry_count:this._retryCount};"seek"===i&&(c.buf_include=this.seekLog.buf_include,this.seekLog.buf_include=0);var u=this.player;u&&u.dashState&&(c.dash_state=this.player.dashState),Object.keys(a).forEach((function(e){c[e]=a[e]})),this.addIfExist("drm_type",this._options,c),this.reportLog(SP,c,s)}},{key:"onOneError",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{errorType:0,code:0,url:"",headers:{},costTime:0,vid:"",message:"",preload_hit:0,preload_cached:0,interval_time:0},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];nP("onOneError",t);var r=this.errorLog,o=this.apiLog,a=this.resLogs,s=this.player,l=this.playlogs,c=uP(t.headers||{}),u=this.getPerformance(),h=t.code>0?0-t.code:t.code;this.setExt();var d=Dh(Dh(Dh({v:t.vid||this.vid,video_pos:this.cur_play_pos,local_time:(new Date).getTime(),cost_time:t&&t.costTime?t.costTime:0,errt:t.errorType,errc:h,es:this.es,cdn_url:t.url||this.url,bufs:gP(this.buffers.allBuffer),resolution:a.final_resolution,last_errors:r.last_errors.join(";"),vsc:o.vsc,vsc_message:t.message||o.vsc_message,server_ip:c.x_response_sinfo||0,initial_url:this.initial_url,initial_host:this.initial_host},c),{},{cur_play_pos:this.cur_play_pos},this.buffers.curBuffer),{},{degrade:l.degrade,end_state:t.endState||UP,preload_hit:t.preload_hit||0,preload_cached:t.preload_cached||0,ex:gP(this.exInfo),pref:gP(u),video_ready_s:this.videoReadyState,interval_time:t.interval_time||0});s&&s.dashState&&(d.dash_state=s.dashState);var f=this.player.currentSrc,p=lP(f)?lP(t.url)?this.initial_url:t.url:f,g={connectTime:0,status:0,statusText:"",isexpired:0,isBlob:lP(f)?1:0};if(n&&"String"===dP(p)){var v={};aP(p,{range:"0-8",timeout:2e3}).then((function(e){nP("getXhr>>check result ",e);var t=uP(e.headers||{});d.server_ip=t.x_response_sinfo,v=Dh(Dh({},g),{},{statusText:e.statusText||"",status:e.status||0,connectTime:0|e.connectTime,sinfo:t.x_response_sinfo||"",cinfo:t.x_response_cinfo||""})})).catch((function(e){v=Dh(Dh({},g),{},{statusText:-2===e.status?"timeout":"error",status:e.status})})).finally((function(){var t=_P(p);v.isexpired=t,d.net=gP(v),e.reportLog(TP,d,i)}))}else d.net=gP(g),this.reportLog(TP,d,i)}},{key:"reportLog",value:function(t,i,n){var r=this,o=this._options,a=this.player.ABTestTag,s=this.commonParams;i.dynamic_type=this.dynamicType;var l="Array"===dP(o.absdkVersion)?o.absdkVersion.join(","):o.absdkVersion;i.absdkVersion=l||e.AB_SDK_VERSION,null!=a&&(i.abtest_tag=a);var c=this._options;if(i.codec_type=this.codecType,iA(c)&&(QP.forEach((function(e){r.addIfExist(e,c,i)})),Object.keys(s).forEach((function(e){r.addIfExist(e,s,i)})),i.vtype=this.vtype),i.env_info=gP(this._envInfo||{}),i.support=YL(),i.visible="undefined"==typeof document?0:"visible"===document.visibilityState?1:0,1===n){var u={};return u[t]=i,void nO.set(u)}2!==n?(this.player&&this.player.emit("abLog",t,i),this._track(t,i)):this.addEventsQueue(t,i)}},{key:"addEventsQueue",value:function(e,t){this.eventQueue.push({event:e,params:t}),this.eventQueue.length>=this._options.maxQueueCount&&this.sendEventsQueue()}},{key:"sendEventsQueue",value:function(){for(;this.eventQueue.length>0;){var e=this.eventQueue.pop();this._track(e.event,e.params)}}},{key:"startWaitingStatus",value:function(e,t){this.appendStallInfo("start",e),this.updateCurBuffer("startWaitingStatus"),this.onOneEvent({costTime:t,end_type:"waitstart"},{},2)}},{key:"triggerTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0;nP("triggerTask>>",e),!sP(t=t||this.player.src)&&this.vtype.indexOf("MP4")>-1&&this.task&&this.task.trigger(t,e)}},{key:"appendStallInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start",t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;this.exInfo.stall||(this.exInfo.stall=[]);var n=this.exInfo.stall;if("start"===e){n.length>6&&n.splice(0,n.length-6);var r=this.buffers.curBuffer;n.push({start:t,end:-1,endType:"waitstart",cost:0,cur:this.cur_play_pos,buf_s:r.buf_s_pos,buf_e:r.buf_e_pos,buf_i:r.buf_include})}else if("end"===e){var o=n.length-1;if(o<0)return;n[o].end<0&&(n[o].end=t,n[o].endType=i,n[o].cost=t-n[o].start)}nP("appendStallInfo",n)}},{key:"suspendWaitingStatus",value:function(e){var t=rP(),i=this.playlogs,n=this.resLogs,r=this.stall,o=this.inWaitingStart;
1if(!(o<=0||this.isSeeking||i.vt<=0)){if(nP("suspendWaitingStatus>>".concat(e,"|costTime:").concat(t-o," isSeeking:").concat(this.isSeeking)),this.appendStallInfo("end",t,e),t-o>200){var a=t-this.inWaitingStart;if(i.bc++,this.checkInBuffer(this.player.currentTime)?(i.de_bu_acu_t+=a,i.dbc++):(i.nbc++,i.n_bu_acu_t+=a),n.bc++,i.bu_acu_t+=a,n.bu_acu_t+=a,r.end=this.cur_play_pos,r.cost=a,r.acc+=r.cost,1===r.sc&&(r.endf=this.cur_play_pos),this.player.abrInstance&&!this.isSeeking&&this.playlogs.vt){var s=this.player.abrInstance;this.abrInfo.abr_event_info.video_stall.push({local_time_ms:(new Date).getTime(),stall_duration:parseFloat((a/1e3).toFixed(2)),buffer_length:s.bufferLength,internet_speed:s.downloadSpeed,now_bitrate:s.nowBitrate,play_speed:this.player.playbackRate,is_abr:s.isCurrentInAbr?1:0})}this.onOneEvent({costTime:a,end_type:"waitend_".concat(e)||!1},{},2)}this._endType="",this.load_state=MP,this.inWaitingStart=0,this.waitStartTime=0,window.clearTimeout(this.stallIntervalId),this.stallIntervalId=null}}},{key:"suspendSeekStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isSeeking){var i=this.seekLog,n=this.resLogs,r=this.player,o=rP()-i.lastSeekStartTime;nP("suspendSeekStatus>>","".concat(e," currentTime:").concat(r.currentTime," costTime:").concat(o," sat:").concat(i.sat," resLogs.sat:").concat(n.sat)),i.intervalId&&window.clearTimeout(i.intervalId),i.intervalId=null,this.isSeeking=!1;var a=this._endType="seek",s=i.seekBefore,l=(r.currentTime||0).toString();i.sc++,i.sat+=o>ZP?0:o,n.sc++,n.sat+=o>ZP?0:o,o>ZP&&(o=ZP),this.updateSeekPt(!0),!this.closeSeekLog&&t&&this.onOneOperator({costTime:o,operaType:a,stateBefore:s,stateAfter:l,endType:e})}}},{key:"setPt",value:function(){var e=this.playlogs;this.startStep=1,!e.pt&&this.player.currentTime&&(this.isSeeking=!0),e.pt||(e.pt=oP(),nP("setPt","init pt :".concat(e.pt,", document.visibilityState:").concat(document.visibilityState)))}},{key:"setVt",value:function(){var e=this.playlogs;1===this.startStep&&(e.vt||(e.vt=oP(),nP("setVt: first frame inited","vt-pt:".concat(e.vt-e.pt," vt-nt:").concat(e.vt-e.nt))),this.startStep=2)}},{key:"setBr",value:function(e){var t=this.playlogs;t.vt>0&&(0===t.br&&(t.fbrt=e||""),t.br++)}},{key:"codecType",get:function(){var e=this.player;return e&&e.config&&e.config.codecType?e.config.codecType:this._options.codec_type||"h264"}},{key:"url",get:function(){var e=this.player;return e&&e.config?e.config.url:""}},{key:"vid",get:function(){var e=this.player;return e&&e.config?e.config.vid:""}},{key:"bc",get:function(){return this.playlogs.bc}},{key:"bu_acu_t",get:function(){return this.playlogs.bu_acu_t}},{key:"pt",get:function(){return this.playlogs.pt||oP()}},{key:"vt",get:function(){var e=this.playlogs,t=e.vt;return e.pt>0?t:0}},{key:"fvt",get:function(){var e=this.playlogs,t=e.vt,i=e.pt,n=0;return t>0&&i>0&&(n=parseInt(t-i,10)),n>6e4?6e4:n}},{key:"nvt",get:function(){var e=this.playlogs,t=e.vt,i=e.nt;return t>0&&i>0?parseInt(t-i,10):0}},{key:"getFrameInfo",value:function(){if(this.player&&this.player.videoFrameInfo){var e=this.player.videoFrameInfo,t=e.dropped,i=e.corrupted,n=e.droppedRate;return{f_total:e.total,drop_count:t,drop_rate:parseInt(100*n,10),corrupted:i}}return{f_total:0,drop_count:0,drop_rate:0,corrupted:0}}},{key:"vd",get:function(){var e=this.player;return e.duration&&"number"==typeof e.duration&&e.duration>0?parseInt(1e3*e.duration,10):e.config.duration&&"number"==typeof e.config.duration?parseInt(1e3*e.config.duration,10):0}},{key:"cur_play_pos",get:function(){return parseInt(1e3*this.player.currentTime,10)}},{key:"volume",get:function(){return this.player.volume}},{key:"buffer_time",get:function(){var e=0;try{var t=this.player.getBufferedRange();e=t[1]-t[0]}catch(t){e=0}return e}},{key:"player_created_t",get:function(){return this._playerCreatedTime}},{key:"playbackRate",get:function(){return this.player.playbackRate}},{key:"mute",get:function(){return this.player.muted?0:1}},{key:"videoWidth",get:function(){var e=this.player;return e&&e.video?e.video.videoWidth:0}},{key:"videoHeight",get:function(){var e=this.player;return e&&e.video?e.video.videoHeight:0}},{key:"preload",get:function(){var e=this.player;return!(!e||!e.video)&&e.video.preload}},{key:"initial_url",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_url?this.urlLog.initial_url:sP(e)?"":e}},{key:"initial_host",get:function(){var e=this.player.currentSrc;return e.indexOf("blob:")>-1&&this.urlLog.initial_host?this.urlLog.initial_host:tP(sP(e)?"":e)}},{key:"curHeaders",get:function(){var e=this.player,t=this.task;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?uP(e.__dash__.curReqVideoSegInfo.headers||{}):t?t.headers:{}}},{key:"curStatus",get:function(){var e=this.task,t=this.vtype,i=this.netLog;return t.indexOf("MP4")>-1?e?e.status:0:i.status}},{key:"play_type",get:function(){return 0}},{key:"resolution",get:function(){var e=this.player.curDefinition;return e?"".concat(e.definition):this.resLogs.df}},{key:"sessionId",get:function(){return this._sessionId}},{key:"finish",get:function(){return this.isEnded?1:0}},{key:"end_type",get:function(){return this._endType}},{key:"avgSpeed",get:function(){return this.player&&this.player.avgSpeed?this.player.avgSpeed:0}},{key:"realSpeed",get:function(){return this.player&&this.player.realTimeSpeed?this.player.realTimeSpeed:0}},{key:"mp4MseOpLength",get:function(){if(!this.player||!this.player.plugins)return-1;var e=this.player.plugins.mp4encryptplayer;return e?e.opQueueLen||0:-1}},{key:"mp4LoadSegmentTimeRange",get:function(){if(!this.player||!this.player.plugins)return"";var e=this.player.plugins.mp4encryptplayer;return e?e.loadSegmentTimeRange.join(","):""}}
1,{key:"preLoadData",get:function(){if(!this.player||!this.player.plugins)return[];var e=this.player.plugins.mp4encryptplayer;if(e&&e.preLoadData)return{hit:1,duration:e.preLoadData.duration,length:e.preLoadData.byteLength};var t=this.player.stat||{};if(t.preLoadData){var i=t.preLoadData.length;return{hit:i>0,length:i}}return{hit:0,duration:0,length:0}}},{key:"preloadState",get:function(){if(!this.player||!this.player.plugins)return 0;if(void 0!==this.player.preloadState)return this.player.preloadState||0;var e=this.player.plugins.mp4encryptplayer;return e&&e.preloadState?e.preloadState:0}},{key:"curBitrate",get:function(){var e=this.player,t=e.config,i=e.curDefinition;return i&&i.bitrate?i.bitrate:t.defaultBitrate?t.defaultBitrate:0}},{key:"videoReadyState",get:function(){var e=this.player;return e&&e.video?e.video.readyState:-1}},{key:"videoSeeking",get:function(){var e=this.player;return e&&e.video&&e.video.seeking?1:0}},{key:"videoPaused",get:function(){var e=this.player;return e&&e.video&&e.video.paused?1:0}},{key:"switchResolutionCount",get:function(){return this.resLogs.switch_count}},{key:"isError",get:function(){return this.player._isError||this.player.video.error}},{key:"isPlaying",get:function(){return fP(this.player.root,"xgplayer-playing")}},{key:"isStop",get:function(){return fP(this.player.root,"xgplayer-ended")||fP(this.player.root,"xgplayer-nostart")}},{key:"isPause",get:function(){return fP(this.player.root,"xgplayer-pause")}},{key:"isLoading",get:function(){return fP(this.player.root,"xgplayer-isloading")}},{key:"es",get:function(){return this.isPlaying?"playing":"beforePlay"}},{key:"lt",get:function(){var e=0;return 0===this.vt&&(nP("lt init",this.playlogs.lt),e=oP()),e}},{key:"lpt",get:function(){return this.lt?this.lt-this.pt:0}},{key:"playback_state",get:function(){return this.isError?LP:this.isStop?PP:this.isPause?IP:this.isLoading?AP:OP}},{key:"is_start_play_automatically",get:function(){return"".concat(this.isAutoplay)}},{key:"watchDur",get:function(){var e=this.player,t=this.playlogs,i=e.cumulateTime?e.cumulateTime:eP(t.played);return i>=0?i:0}},{key:"vtype",get:function(){return this.__vtype?this.__vtype:(this.player?this.player.vtype||this.player.config.vtype:"")||(this.player.dash?"DASH":this._options.vtype||"MP4")},set:function(e){this.__vtype=e}},{key:"envInfo",get:function(){return this._envInfo},set:function(e){e&&(this._envInfo=e)}},{key:"getPlayerExt",value:function(){var e=this.player.ext;if(e)return e}},{key:"watingCost",get:function(){if(this.inWaitingStart>0){var e=rP()-this.inWaitingStart;return e>ZP?0:e}return 0}},{key:"videoNetworkState",get:function(){var e=this.player;return e&&e.video?e.video.networkState:-1}},{key:"eagleid",get:function(){var e=this.player;return e&&e.__dash__&&e.__dash__.curReqVideoSegInfo?(e.__dash__.curReqVideoSegInfo.headers||{}).eagleid:""}},{key:"initial_type",get:function(){var e=this.player.config||{};return e&&e.vodLogOpts&&void 0!==e.vodLogOpts.currentDashType?parseInt(e.vodLogOpts.currentDashType,10):-1}},{key:"dynamicType",get:function(){var e=this.player;return this.__dt?this.__dt:e&&e.__dash__&&e.__dash__.dash&&e.__dash__.dash.mpd?(this.__dt=e.__dash__.dash.mpd.dashType,this.__dt):""}},{key:"updateBuffers",value:function(){var e=this.player.buffered,t=[];if(!e||e.length<1)this.buffers.allBuffer=[];else{for(var i=0;i<e.length;i++){var n=parseInt(1e3*e.start(i),10),r=parseInt(1e3*e.end(i),10);t.push({s:n,e:r})}this.buffers.allBuffer=t}}},{key:"updateCurBuffer",value:function(e){var t=this.player,i=t.buffered,n=t.currentTime,r={buf_s_pos:0,buf_e_pos:0,buf_include:0,buf_diff:0};if(!i||i.length<1)return r;for(var o=-1,a=-1,s=parseInt(1e3*n,10),l=i.length-1;l>-1;l--){var c=parseInt(1e3*i.start(l),10),u=parseInt(1e3*i.end(l),10);if(s>=c&&s<=u){r.buf_include=1,r.buf_s_pos=c,r.buf_e_pos=u,r.buf_diff=u-s;break}s<c&&(o<0||c-s<o)?(o=c-s,a=l):s>u&&(o<0||s-u<o)&&(o=s-u,a=l)}1!==r.buf_include&&(a<0&&(a=i.length-1),r.buf_s_pos=parseInt(1e3*i.start(a),10),r.buf_e_pos=parseInt(1e3*i.end(a),10)),this.buffers.curBuffer=r}},{key:"checkInBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.player.buffered;if(!i)return!1;e=parseInt(1e3*e,10);for(var n=0;n<i.length;n++){var r=parseInt(1e3*i.start(n),10),o=parseInt(1e3*i.end(n),10)+t;if(e>r&&e<o)return!0}return!1}},{key:"getPCDNStat",value:function(){if(this.player&&this.player.pcdnVVStat){var e=this.player.pcdnVVStat,t=e.try_req_num,
1i=e.req_node_succ,n=e.conn_req_num;return Dh({try_req:t,req_succ:i,has_ret:e.has_ret_node,conn_req:n,conn_fail:e.conn_fail_num,conn_jump:e.conn_jump_num},Rh(e,QL))}return{}}},{key:"updateVideoSize",value:function(){var e=this._options,t=this.player,i=this.resLogs,n=0,r=0;if(t.__dash__&&t.__dash__.dash&&t.__dash__.dash.mpd.mediaList){var o=t.__dash__.dash.mpd.mediaList.video,a=o[o.selectedIdx];nP("updateVideoSizeããvideoItem",a),r=a?a.bitrate||a.bandwidth:0,n=a?a.size:0}else{var s=this.player.curDefinition;s?(r=s.bitrate||t.config.bitrate||0,n=parseInt(s.bitrate*t.duration/8,10)):(n=e.videoSize||t.config.videoSize||0,r=e.bitrate||t.config.bitrate||0)}nP("updateVideoSize","bitrate:".concat(r,", vs:").concat(n)),n&&(i.vs=n,i.vis=parseInt(n/t.duration,10),i.bitrate=r||i.vis)}},{key:"updateVds",value:function(){var e=this.resLogs,t=this.playlogs,i=this.player;if(0!==e.vis){for(var n=parseInt(eP(t.played)/1e3,10),r=i.buffered,o=0,a=0;a<r.length;a++)o+=parseInt(r.end(a)-r.start(a),10);nP("updateVds","pdur:".concat(n," bdur:").concat(o," \n lbuf:").concat(e.lbuf," lplayed:").concat(e.lplayed," bitrate: ").concat(e.bitrate," vis:").concat(e.vis," vs:").concat(e.vs)),e.lplayed=n,e.lbuf=o}else nP("updateVds","vis:".concat(e.vis))}},{key:"encryptedInfo",get:function(){return this.player.encryptedInfo||{encryptedType:0}}}],[{key:"TEA_ID",get:function(){return nA},set:function(e){rA="__tea_cache_tokens_".concat(nA=e)}},{key:"AB_SDK_VERSION",get:function(){return aA},set:function(e){aA="Array"===dP(e)?e.join(","):e}},{key:"Collector",set:function(e){sA=e}},{key:"defaultConfig",value:function(){return{line_app_id:"",line_user_id:"",isTask:!1,codec_type:"",playerCoreVersion:"",playerVersion:"",start_time:0,maxQueueCount:5,channel:"cn",channelDomain:"",absdkVersion:"",checkByInnerLog:!0,drm_type:0,vtype:"MP4",tag:"æ®éè§é¢",subtag:"",dynamic_type:"",sendLocalCallback:function(){},disableLocalCache:!1,closeResolutionLog:!1,closeSeekLog:!1,needXhrCheck:!1,trackerConfig:{},envInfo:{},enableTeaWebId:!1}}}]),e}(),cA=null===(tA=kc())||void 0===tA?void 0:tA.__LOG_TEA_ID__;lA.TEA_ID=cA,lA.Collector=Ch;var uA=function(e){if(e&&e.player){var t=e.player.config.vodLogOpts||{};e.player.vodLogger=new lA(e.player,t),e.player.plugins.xgVodLogger=e.player.vodLogger}else this.vodLogger=new lA(this,this.config.vodLogOpts||{})};uA.pluginName="__xgVodLogger",uA.playerConfig={},uA.Collector=Ch,uA.setABSdkVersion=function(e){lA.AB_SDK_VERSION=e};var hA,dA,fA=wi((function(e,t,i){ci(e,t,i)})),pA=f((function e(t){h(this,e),this.isLive=t.configs.isLive,this.playerData=t.playerData,this.streamType=t.streamType})),gA={name:"@byted/veplayer",version:"1.9.6",main:"index.min.js",module:"index.min.js",types:"index.d.ts",sideEffects:["*.css","*.less"],unpkg:!0,unpkgFiles:["*"],scripts:{"test:e2e":"echo 'test'",lint:"npx lint-staged",dev:"NODE_ENV=development libd dev fixtures","dev:vod":"NODE_ENV=development libd dev demo/vod","dev:vod-row":"LUX_REGION=ROW libd dev demo/vod","dev:vod-b":"LUX_REGION=BYTEPLUS NODE_ENV=development libd dev demo/vod","dev:hth":"NODE_ENV=development libd dev fixtures/hth",build:"libd build",postbuild:"lux release commit","build-b":"LUX_REGION=BYTEPLUS libd build",release:"libd release","release-b":"LUX_REGION=BYTEPLUS libd release",doc:"docg","doc-b":"LUX_REGION=BYTEPLUS docg",changelog:"libd changelog -s","version:rc":"lux version --preid rc"},author:"",license:"BSD-3-Clause",devDependencies:{"@babel/runtime-corejs3":"7.20.13","@byted/docg":"0.5.10-alpha.37","@byted/docg-plugin-sdkhub":"0.3.1","@byted/libd":"1.1.21","@byted/lux-cli":"1.2.3","@byted/lux-core":"1.2.0","@changesets/cli":"2.26.2","@commitlint/cli":"16.2.1","@commitlint/config-conventional":"16.2.1","@types/lodash":"4.14.178","@types/lodash-es":"4.17.7","@typescript-eslint/eslint-plugin":"5.12.0","@typescript-eslint/parser":"5.12.0","cross-env":"7.0.3","dts-bundle-generator":"^8.0.1",eslint:"8.9.0","eslint-config-prettier":"6.7.0","eslint-plugin-jest":"23.20.0","eslint-plugin-prettier":"3.1.0","fs-extra":"11.1.1","git-cz":"4.7.6",husky:"8.0.1",less:"4.1.2","lint-staged":"11.1.2","node-fetch":"2.6.7","postcss-less":"6.0.0",prettier:"2.2.1","rollup-plugin-visualizer":"5.9.0",shelljs:"0.8.5",stylelint:"14.5.2","stylelint-config-standard":"24.0.0","stylelint-prettier":"2.0.0",typescript:"4.5.5","vite-plugin-mkcert":"^1.17.4"},dependencies:{"@byted/danmu-mask":"0.3.6","@byted/drm":"0.0.0-alpha.12","@byted/streamprobe":"1.0.2","@byted/xgplayer-app-logger":"0.12.1","@byted/xgplayer-encrypt":"3.5.27-alpha.30","@byted/xgplayer-encrypt-hls":"4.1.12-rc.0","@byted/xgplayer-encrypt-mp4":"3.0.16-rc-volc.1","@byted/xgplayer-live-logger":"1.1.0-alpha.8","@byted/xgplayer-rts":"0.2.0-alpha.6","@byted/xgplayer-vod-abralgo":"1.0.5","@byted/xgplayer-vod-menu":"3.0.9","@byted/xgplayer-xgvideo":"0.1.16","@datarangers/sdk-javascript":"0.0.3-lite","@dp/byted-tea-sdk-oversea":"^5.1.5","@byted/volcengine-vestrategy":"1.1.0-rc.0","@byted/volcengine-vestrategy-h265":"1.1.0-rc.0","@byted/volcengine-vestrategy-preload":"1.1.0-rc.0","@byted/volcengine-vestrategy-adapt-range":"1.1.0-rc.0","@byted/xgplayer-vod-preload":"1.0.4","byted-tea-sdk":"^5.1.3","danmu.js":"1.1.13",dayjs:"^1.11.6","dom-helpers":"^5.2.1",eventemitter3:"^4.0.7","globalthis-polyfill":"^1.0.0","js-base64":"^3.7.2","js-cookie":"^3.0.1","lodash-es":"^4.17.21","proxy-polyfill":"^0.3.2",xgplayer:"3.0.20-rc.7","xgplayer-flv":"3.0.10-alpha.4","xgplayer-hls":"3.0.20-alpha.1","xgplayer-service":"^0.5.0","xgplayer-subtitles":"3.0.10-alpha.4","xss-filters":"^1.2.7"},"lint-staged":{"*.{less}":'stylelint --fix "src/**/*.less" --custom-syntax postcss-less',"*.{js,jsx,ts,tsx}":["eslint --fix"]},publishConfig:{directory:"dist"},browserslist:["iOS >= 10","android >= 5","Chrome > 40","ChromeAndroid >= 39","IE 11"]},vA=function(e){return e.HLS="hls",e.FLV="flv",e.XGVideo="XGVideo",e.HLSEncrypt="hlsEncrypt",e.DASH="dash",e.MP4Encrypt="mp4Encrypt",e.DanmuJS="danmujs",e.DanmuMask="danmuMask",e.StreamProbe="streamprobe",e.VeStrategy="vestrategy",e.VeStrategyH265="vestrategy_h265",e.VeStrategyPreload="vestrategy_preload",e.VeStrategyAdaptRange="vestrategy_adapt_range",e.DashAbralgo="DashAbralgo",e.Preloader="preloader",e}(vA||{}),yA=gA.dependencies||{},mA=(p(hA={},"hls",{name:"HlsPlayer",pluginName:"hls",packageName:"xgplayer-hls",devPath:"xgplayer-hls@".concat(yA["xgplayer-hls"],"/dist/index.min.js")}),p(hA,"flv",{name:"FlvPlayer",pluginName:"flv",packageName:"xgplayer-flv",devPath:"xgplayer-flv@".concat(yA["xgplayer-flv"],"/dist/index.min.js")}),p(hA,"XGVideo",{name:"XGVideo",packageName:"@byted/xgplayer-xgvideo",devPath:"@byted/xgplayer-xgvideo@".concat(yA["@byted/xgplayer-xgvideo"],"/dist/index.min.js")}),p(hA,"hlsEncrypt",{name:"EncryptHlsPlugin",pluginName:"EncryptHlsPlugin",packageName:"@byted/xgplayer-encrypt-hls",devPath:"@byted/xgplayer-encrypt-hls@".concat(yA["@byted/xgplayer-encrypt-hls"],"/dist/index.min.js")}),p(hA,"dash",{name:"DashPlugin",pluginName:"DASHPlugin",packageName:"@byted/xgplayer-encrypt",devPath:"@byted/xgplayer-encrypt@".concat(yA["@byted/xgplayer-encrypt"],"/dist/index.min.js")}),p(hA,"mp4Encrypt",{name:"Mp4EncryptPlayer",pluginName:"Mp4EncryptPlayer",packageName:"@byted/xgplayer-encrypt-mp4",devPath:"@byted/xgplayer-encrypt-mp4@".concat(yA["@byted/xgplayer-encrypt-mp4"],"/dist/index.min.js")}),p(hA,"danmujs",{name:"danmu.js",packageName:"danmu.js",devPath:"danmu.js@".concat(yA["danmu.js"],"/dist/index.js")}),p(hA,"danmuMask",{name:"DanmuMask",packageName:"@byted/danmu-mask",devPath:"@byted/danmu-mask@".concat(yA["@byted/danmu-mask"],"/browser/index.js")}),p(hA,"streamprobe",{name:"StreamProbe",pluginName:"streamprobe",packageName:"@byted/streamprobe",devPath:"@byted/streamprobe@".concat(yA["@byted/streamprobe"],"/dist/index.min.js")}),p(hA,"DashAbralgo",{name:"DashAbralgo",packageName:"@byted/xgplayer-vod-abralgo",devPath:"@byted/xgplayer-vod-abralgo@".concat(yA["@byted/xgplayer-vod-abralgo"],"/dist/index.min.js")}),p(hA,"vestrategy",{name:"VeStrategy",packageName:"@byted/volcengine-vestrategy",devPath:"@byted/volcengine-vestrategy@".concat(yA["@byted/volcengine-vestrategy"],"/umd/vestrategy.production.js")}),p(hA,"vestrategy_h265",{name:"__VESTRATEGY_STRATEGY_H265__",packageName:"@byted/volcengine-vestrategy-h265",devPath:"@byted/volcengine-vestrategy-h265@".concat(yA["@byted/volcengine-vestrategy-h265"],"/umd/vestrategy.strategy.h265.production.js")}),p(hA,"vestrategy_preload",{name:"__VESTRATEGY_STRATEGY_PRELOAD__",packageName:"@byted/volcengine-vestrategy-preload",devPath:"@byted/volcengine-vestrategy-preload@".concat(yA["@byted/volcengine-vestrategy-preload"],"/umd/vestrategy.strategy.preload.production.js")}),p(hA,"vestrategy_adapt_range",{name:"__VESTRATEGY_STRATEGY_ADAPT_RANGE__",packageName:"@byted/volcengine-vestrategy-adapt-range",devPath:"@byted/volcengine-vestrategy-adapt-range@".concat(yA["@byted/volcengine-vestrategy-adapt-range"],"/umd/vestrategy.strategy.adapt-range.production.js")}),p(hA,"preloader",{name:"XGPlayerPreload",packageName:"@byted/xgplayer-vod-preload",devPath:"@byted/xgplayer-vod-preload@".concat(yA["@byted/xgplayer-vod-preload"],"/dist/index.min.js")}),hA),_A=!1,bA=function(e){g(n,e);var t,i=k(n);function n(e){return h(this,n),i.call(this,e)}return f(n,[{key:"applyAbrPluginConfig",value:function(e,t){e.Mp4EncryptPlayer=a(a({},e.Mp4EncryptPlayer),{},{autoBitrateOpts:t})}},{key:"prepareAbrModule",value:(t=u(s().mark((function e(t,i){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null===(n=t.configs)||void 0===n?void 0:n.autoBitrateOpts,!t.isOpenABR()||null!=r&&r.module){e.next=13;break}return e.t0=t,e.t1=a,e.t2=a({},r),e.t3={},e.next=8,i.loadPlugins(vA.DashAbralgo);case 8:e.t4=e.sent,e.t5={module:e.t4},e.t6=(0,e.t1)(e.t2,e.t3,e.t5),e.t7={autoBitrateOpts:e.t6},e.t0.updateConfigs.call(e.t0,e.t7);case 13:case"end":return e.stop()}}),e)}))),function(e,i){return t.apply(this,arguments)})},{key:"needAbrAutoDefinition",value:function(){return!1}},{key:"setAbrDefaultDefiWithAuto",value:function(){return!1}},{key:"generatePlaylistFromServer",value:function(e){_A=!0;var t=(e||{}).playList;return E((void 0===t?[]:t)||[])}},{key:"canOpenAbr",value:function(e){var t;if(this.playerData.isVidPlay()&&e){var i=e.playList;if(!((void 0===i?[]:i).length>1))return _A&&Ul.warn("The obtained video information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether there are more than 1 video."),_A=!1,!1}return!(null!==(t=ir.os)&&void 0!==t&&t.isIos)}},{key:"canAdaptRangeEnable",value:function(){var e;return!(null!==(e=ir.os)&&void 0!==e&&e.isIos)}},{key:"adaptRangeDefaultOptions",value:function(){return{maxTargetCacheDur:30,minTargetCacheDur:12,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}},{key:"applyAdaptRangePluginConfig",value:function(e,t){e.Mp4EncryptPlayer=a(a({},e.Mp4EncryptPlayer),{},{adaptRange:t})}},{key:"applyAdaptRangeStrategy",value:function(e,t){var i,n;e.Mp4EncryptPlayer=a(a({},e.Mp4EncryptPlayer),{},{adaptRange:a(a(a({},this.adaptRangeDefaultOptions()),null!==(i=null===(n=e.Mp4EncryptPlayer)||void 0===n?void 0:n.adaptRange)&&void 0!==i?i:{}),t)})}}]),n}(pA),kA=!1,wA=function(e){g(n,e);var t,i=k(n);function n(){return h(this,n),i.apply(this,arguments)}return f(n,[{key:"applyAbrPluginConfig",value:function(e,t){e.DASHPlugin=a(a({},e.DASHPlugin),{},{autoBitrateOpts:t})}},{key:"prepareAbrModule",value:(t=u(s().mark((function e(t,i){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null===(n=t.configs)||void 0===n?void 0:n.autoBitrateOpts,!t.isOpenABR()||null!=r&&r.module){e.next=13;break}return e.t0=t,e.t1=a,e.t2=a({},r),e.t3={},e.next=8,i.loadPlugins(vA.DashAbralgo);case 8:e.t4=e.sent,e.t5={module:e.t4},e.t6=(0,e.t1)(e.t2,e.t3,e.t5),e.t7={autoBitrateOpts:e.t6},e.t0.updateConfigs.call(e.t0,e.t7);case 13:case"end":return e.stop()}}),e)}))),function(e,i){return t.apply(this,arguments)})},{key:"needAbrAutoDefinition",value:function(){return!1}},{key:"setAbrDefaultDefiWithAuto",value:function(){return!1}},{key:"canOpenAbr",value:function(e){if(this.playerData.isVidPlay()&&e){var t=e.enableAdaptive,i=e.adaptiveBitrateStreamingInfo,n=e.playList;if(!((void 0===n?[]:n).length>2&&t&&i))return kA&&Ul.warn("The obtained video information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),kA=!1,!1}return!0}},{key:"canAdaptRangeEnable",value:function(){var e;return!(null!==(e=ir.os)&&void 0!==e&&e.isIos)}},{key:"generatePlaylistFromServer",value:function(e){kA=!0;var t=(e||{}).playList;return(void 0===t?[]:t).filter((function(e){return e.FileType===Gl.VIDEO}))}},{key:"adaptRangeDefaultOptions",value:function(){return{maxTargetCacheDur:60,minTargetCacheDur:50,rangeMaxDuration:15,rangeMinDuration:5,cacheSafeFactor:2,estPTcontrol:!0,estPlayTime:12,minBandwidth:1e6,minDangerThreshold:3,rangeControl:!0,rangeMinSize:409600,safeFactor:.1,targetCacheControl:!0}}},{key:"applyAdaptRangePluginConfig",value:function(e,t){var i;e.DASHPlugin=a(a({},null!==(i=e.DASHPlugin)&&void 0!==i?i:{}),{},{adaptRange:t})}},{key:"applyAdaptRangeStrategy",value:function(e,t){var i,n;e.DASHPlugin=a(a({},e.DASHPlugin),{},{adaptRange:a(a(a({},this.adaptRangeDefaultOptions()),null!==(i=null===(n=e.DASHPlugin)||void 0===n?void 0:n.adaptRange)&&void 0!==i?i:{}),t)})}}]),n}(pA),SA=!1,TA=function(e){g(n,e);var t,i=k(n);function n(e){return h(this,n),i.call(this,e)}return f(n,[{key:"applyAbrPluginConfig",value:function(e,t){var i;e.EncryptHlsPlugin=a(a({},e.EncryptHlsPlugin),{},{autoBitrateOpts:t,maxBufferLength:(null===(i=e.EncryptHlsPlugin)||void 0===i?void 0:i.maxBufferLength)||40})}},{key:"prepareAbrModule",value:(t=u(s().mark((function e(t,i){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null===(n=t.configs)||void 0===n?void 0:n.autoBitrateOpts,!t.isOpenABR()||null!=r&&r.module||ir.os.isIos){e.next=13;break}return e.t0=t,e.t1=a,e.t2=a({},r),e.t3={},e.next=8,i.loadPlugins(vA.DashAbralgo);case 8:e.t4=e.sent,e.t5={module:e.t4},e.t6=(0,e.t1)(e.t2,e.t3,e.t5),e.t7={autoBitrateOpts:e.t6},e.t0.updateConfigs.call(e.t0,e.t7);case 13:case"end":return e.stop()}}),e)}))),function(e,i){return t.apply(this,arguments)})},{key:"needAbrAutoDefinition",value:function(){return!0}},{key:"setAbrDefaultDefiWithAuto",value:function(){return ir.os.isIos}},{key:"generatePlaylistFromServer",value:function(e){var t;SA=!0;var i=e||{}
1,n=i.vid,r=i.playList,o=void 0===r?[]:r,a=i.enableAdaptive,s=i.adaptiveBitrateStreamingInfo,l=E(o||[]);if(ir.os.isIos&&null!==(t=this.playerData)&&void 0!==t&&null!==(t=t.configs)&&void 0!==t&&null!==(t=t.autoBitrateOpts)&&void 0!==t&&t.enable&&a&&s&&l.length){var c={url:s.MainPlayUrl,definition:"auto",streamType:"hls",format:"hls",backupUrl:s.BackupPlayUrl,backUrlList:[s.BackupPlayUrl],vid:n};l.push(c)}return l}},{key:"canOpenAbr",value:function(e){if(this.playerData.isVidPlay()&&e){var t=e.enableAdaptive,i=e.adaptiveBitrateStreamingInfo,n=e.playList;if(!((void 0===n?[]:n).length>1&&t&&i))return SA&&Ul.warn("The obtained video information does not meet the ABR requirements. Please check whether the parameters for generating playAuthToken are correct and whether the video contains ABR transcoding products."),SA=!1,!1}return!0}},{key:"canAdaptRangeEnable",value:function(){return!1}},{key:"adaptRangeDefaultOptions",value:function(){}},{key:"applyAdaptRangePluginConfig",value:function(e,t){}},{key:"applyAdaptRangeStrategy",value:function(e,t){}}]),n}(pA),EA=function(e){g(i,e);var t=k(i);function i(){return h(this,i),t.apply(this,arguments)}return f(i,[{key:"applyAbrPluginConfig",value:function(e,t){}},{key:"needAbrAutoDefinition",value:function(){return!1}},{key:"prepareAbrModule",value:function(e,t){}},{key:"setAbrDefaultDefiWithAuto",value:function(){return!1}},{key:"generatePlaylistFromServer",value:function(e){var t=(e||{}).playList;return E((void 0===t?[]:t)||[])}},{key:"canOpenAbr",value:function(){return!1}},{key:"canAdaptRangeEnable",value:function(){return!1}},{key:"adaptRangeDefaultOptions",value:function(){}},{key:"applyAdaptRangePluginConfig",value:function(e,t){}},{key:"applyAdaptRangeStrategy",value:function(e,t){}}]),i}(pA),CA=["options","type","isLive","id","root","plugins","defaultConfig","languages","codec","isMobile","useSoftDecoding","enableH265Degrade","onMediaExpired","onTokenExpired","unionId","isMusic","sdkPlugins","useHlsPluginForSafari","enableMenu","region","debug"],xA=function(){function e(t,i){var n;h(this,e),this.id="",this.type="",this.isLive=!1,this.options=null,this.isMobile=!1,this.playList=[],this.plugins=[],this.openSoftDecoding=!1,this.current={lineId:0,language:"",definition:"",streamType:"",codec:vn.UNKNOWN,kid:"",drmType:void 0},this.strategiesPlugins=[],this.strategiesPluginConfigs={},this.urlCheckData={enableUrlExpireCheck:!1,urlExpireTimestamp:Il,urlExpireDiff:60,urlCheckExpireInterval:400},this.isAutoBitrateEnable=!1,this.isBusinessDrm=!1,this.isEncrypt=!1;var r,o,a=t.options,s=t.type,l=t.isLive,c=t.id,u=t.root,d=t.plugins,f=void 0===d?[]:d,p=t.defaultConfig,g=t.languages,v=t.codec,y=t.isMobile,_=void 0!==y&&y,b=t.useSoftDecoding,k=void 0!==b&&b,w=t.enableH265Degrade,S=void 0!==w&&w,C=t.onMediaExpired,x=t.onTokenExpired,D=t.unionId,P=t.isMusic,O=void 0!==P&&P,I=t.sdkPlugins,L=void 0===I?[]:I,A=t.useHlsPluginForSafari,R=void 0===A||A,M=t.enableMenu,N=void 0!==M&&M,B=t.region,U=void 0===B?"cn":B,j=t.debug,H=void 0!==j&&j,F=m(t,CA);this.configs=t,this.sdk=i,H&&(Ul.config.debug=3),this.options=Object.assign({},a,F),this.options.poster="string"==typeof this.options.poster?function(e){var t,i=""+e,n=Cc.exec(i);if(!n)return i;var r,o="",a=0;for(r=n.index;r<i.length;r++){switch(i.charCodeAt(r)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==r&&(o+=i.substring(a,r)),a=r+1,o+=t}return a!==r?o+i.substring(a,r):o}(this.options.poster):this.options.poster,this.options.icons=(r=this.options.icons,o={},r&&Object.entries(r).forEach((function(e){var t=T(e,2),i=t[0],n=t[1];n&&"string"!=typeof n&&(o[i]=n)})),o),this.id=c,this.root=u,this.type=s,this.isLive=!!(null!=l?l:"live"===s),this.defaultConfig=p,this.languageData=this.initI18nData(g),this.isMobile=_||"mobile"===ir.device,this.openSoftDecoding=k,this.enableH265Degrade=S,this.codec=v||vn.UNKNOWN,this.onMediaExpired=C,this.onTokenExpired=x,null===(n=this.setVodPlayListConfig)||void 0===n||n.call(this,t),this.current=Sn.observe(this.current),this.plugins=E(f),this.isMusic=O,this.unionId=D,this.sdkPlugins=L,this.useHlsPluginForSafari=R,this.enableMenu=N,N&&(this.options.enableContextmenu=!0,this.options.closeVideoStopPropagation=!0),this.region=U,this.setVodTeaId(),this.playDomainDegrade=!1,this.dashOpts=null,t.getVideoByToken||this.codec!==v
1n.UNKNOWN||Ul.warn("The codec of media is not provided"),this.initPlayData(t),Sn.subscribeProperty(this.current,"definition",this.updateCheckExpireData.bind(this))}return f(e,[{key:"initPlayData",value:function(e){var t=this.initPlaylistAndGetCurrent(e);this.initCurrent(t)}},{key:"initPlaylistAndGetCurrent",value:function(e){var t,i=e.url,n=e.playList,r=void 0===n?[]:n,o=e.streamType,s=void 0===o?"":o,l=e.definitionText,c=e.definitionTextKey,u=e.urlExpireTimestamp,h=e.defaultDefinition||this.configs.defaultDefinition,d=e.codec||vn.UNKNOWN;null!=e&&e.autoBitrateOpts&&this.updateConfigs({autoBitrateOpts:a(a({},null!==(t=this.configs.autoBitrateOpts)&&void 0!==t?t:{}),e.autoBitrateOpts)});var f=null,p=Zt(E(r).filter((function(e){return e.url})));if(i)if(0===p.length){var g=a(a({},this.current),{},{url:i,streamType:s,definitionTextKey:c,codec:d,urlExpireTimestamp:u},c||l?{definition:l}:{definition:"HD"});this.playList=[g],this.defaultDefinition=g.definition}else{this.playList=p;var v=this.getUrlList({url:i});v.length>0?f=v[0]:Ul.warn("default url is not match Playlist")}else this.playList=p;var y,m,_=this.getCurrentByDefaultConfig();_?this.defaultDefinition=_.definition:(_=f||h&&(null===(y=this.getUrlList({definition:h}))||void 0===y?void 0:y[0])||this.playList[0],this.defaultDefinition=null===(m=_)||void 0===m?void 0:m.definition);var b=this.getTargetStreamType(_);if(this.adapter=function(e,t){var i=a(a({},t),{},{streamType:e});switch(null==e?void 0:e.toLowerCase()){case"mp4":return new bA(i);case"dash":return new wA(i);case"hls":return new TA(i);default:return Ul.warn("".concat(e," match failed, use OthersAdapter by default")),new EA(i)}}(b,{configs:this.configs,playerData:this}),this.isAutoBitrateEnable=this.checkAutoBitratePlayList(),this.isOpenABR()){var k=this.getABRStreamInfo(b,_);_=k.defaultStream,this.playList=k.playList,this.defaultDefinition=k.defaultDefinition}return this.playList.forEach((function(e){(null==e?void 0:e.streamType)&&(e.vtype=e.streamType.toUpperCase()),(null==e?void 0:e.codec)&&(e.codecType=e.codec)})),_}},{key:"checkAutoBitratePlayList",value:function(){var e,t=this;return!(ir.os.isIos&&this.adapter.needAbrAutoDefinition()&&(null===(e=this.playList)||void 0===e||null===(e=e.find((function(e){return t.isAutoDefinition(null==e?void 0:e.definition)})))||void 0===e||!e.url))}},{key:"getABRStreamInfo",value:function(e,t){var i,n,r,o,a,s,l=this,c=this.defaultDefinition,u=(null===(i=this.playList)||void 0===i||null===(n=i.concat)||void 0===n?void 0:n.call(i))||[],h=t,d=u.findIndex((function(e){return l.isAutoDefinition(null==e?void 0:e.definition)})),f=-1!==d?u.splice(d,1)[0]:void 0,p={definition:null!==(r=null==f?void 0:f.definition)&&void 0!==r?r:"auto",bitrate:void 0,definitionTextKey:(null==f?void 0:f.definitionTextKey)||(null===(o=this.configs)||void 0===o||null===(o=o.autoBitrateOpts)||void 0===o?void 0:o.definitionTextKey)||"DEFINITION_AUTO",url:(null==f?void 0:f.url)||"__auto__",name:"auto",streamType:e||this.configs.streamType};return this.isAutoDefinition(this.configs.defaultDefinition)||(p.bitrate=null===(a=h)||void 0===a?void 0:a.bitrate,c=null===(s=h)||void 0===s?void 0:s.definition),this.isPlayAutoDefinition()&&(h=p,this.adapter.setAbrDefaultDefiWithAuto()&&(c=p.definition)),u.push(p),{defaultDefinition:c,defaultStream:h,playList:u}}},{key:"isCurrentH265",value:function(){return!!this.codec&&this.codec.replace(".","").toLowerCase()===vn.H265}},{key:"getCurrentByDefaultConfig",value:function(){if(this.defaultConfig){var e=this.defaultConfig,t=e.type,i=e.isLive,n=e.lineId,r=void 0===n?"":n,o=e.definition,a=void 0===o?"":o;if((null!=i?i:"live"===t)===this.isLive){if(!r&&!a)return Ul.warn("é»è®¤é
ç½®æªè®¾ç½®é»è®¤çº¿è·¯æé»è®¤æ¸
æ°åº¦"),void(this.isHitDefault=!1);var s=this.getUrlList({lineId:r,definition:a});return s.length>0?(this.isHitDefault=!0,s[0]):(Ul.warn("playlist䏿²¡ææ»¡è¶³é»è®¤é
ç½®çæµ"),void(this.isHitDefault=!1))}}}},{key:"initCurrent",value:function(e){var t,i,n=this;Object.keys(this.current).forEach((function(t){n.current[t]=null==e?void 0:e[t]}));var r=null==e?void 0:e.codec;
1this.codec=r&&Object.values(vn).includes(r)?r:vn.UNKNOWN,this.isBusinessDrm=(null===(t=this.current)||void 0===t?void 0:t.drmType)===gn.DRM_ENCRYPT,this.isEncrypt=!(null===(i=this.current)||void 0===i||!i.kid),this.initCheckExpireData()}},{key:"initCheckExpireData",value:function(){var e=this.configs,t=e.enableUrlExpireCheck,i=e.urlExpireDiff,n=e.urlCheckExpireInterval;fA(this.urlCheckData,{enableUrlExpireCheck:t,urlExpireDiff:i,urlCheckExpireInterval:n}),this.updateCheckExpireData()}},{key:"updateCheckExpireData",value:function(){var e,t=null===(e=this.getCurrentStreams())||void 0===e?void 0:e[0];if(t){var i=t.url,n=t.urlExpireTimestamp;if(!i)return;var r=Tc(""+(n||this.configs.urlExpireTimestamp));r?this.urlCheckData.urlExpireTimestamp=r:this.urlCheckData.enableUrlExpireCheck&&(this.urlCheckData.urlExpireTimestamp=Il,Ul.warn("not provide urlExpireTimestamp, url expire check will not work")),Ul.log("update urlCheckData to:",this.urlCheckData)}}},{key:"initI18nData",value:function(e){var t=[Cl,El],i=e&&Object.entries(e).reduce((function(e,i){var n=T(i,2),r=n[0],o=n[1];return Dl.includes(r)?e.push({LANG:"zh"===r?"zh-cn":r,TEXT:o}):t.push({LANG:r,TEXT:o}),e}),[]);return{extraLangList:t,extendLangList:i}}},{key:"getCurrentUrl",value:function(){var e;return null===(e=this.getCurrentStreams()[0])||void 0===e?void 0:e.url}},{key:"getTargetStreamType",value:function(e){var t;return e?e.streamType||this.configs.streamType||hc(e.url):this.configs.streamType||ql(null===(t=this.configs)||void 0===t?void 0:t.getVideoByToken)}},{key:"getCurrentStreamType",value:function(){var e=this.getCurrentStreams();if(e.length){var t=e[0],i=t.url;return t.streamType||this.configs.streamType||hc(i)}return this.configs.streamType}},{key:"getStreamType",value:function(){var e;return this.getCurrentStreamType()||ql(null===(e=this.configs)||void 0===e?void 0:e.getVideoByToken)}},{key:"isOpenABR",value:function(){var e;if(!this.isAutoBitrateEnable||null===(e=this.configs)||void 0===e||null===(e=e.autoBitrateOpts)||void 0===e||!e.enable)return!1;var t=this.sdk.getSdkPlugin("AuthToken");return this.adapter.canOpenAbr(null==t?void 0:t.playInfo)}},{key:"showRealDefinition",value:function(){var e;return!(null===(e=this.configs)||void 0===e||null===(e=e.autoBitrateOpts)||void 0===e||!e.showRealDefinition)}},{key:"isAutoDefinition",value:function(e){return["auto","èªå¨"].includes(e)}},{key:"isPlayAutoDefinition",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.isAutoDefinition(t||this.defaultDefinition)||(null===(e=this.configs.autoBitrateOpts)||void 0===e?void 0:e.startWithAuto)}},{key:"isDefinitionMatch",value:function(e,t){return!(!this.isAutoDefinition(e)||!this.isAutoDefinition(t))||e===t}},{key:"getCurrentStreams",value:function(){var e=this.current;return this.getUrlList(e)}},{key:"getLineList",value:function(){return Zt(fn(this.playList,"lineId"))}},{key:"getLineListByLineId",value:function(e){return this.playList.filter((function(t){var i;return(null==e?void 0:e.toString())===(null===(i=t.lineId)||void 0===i?void 0:i.toString())}))}},{key:"getDefinitionListByLineId",value:function(e){return Zt(fn(this.getLineListByLineId(e),"definition"))}},{key:"getUrlList",value:function(e){return this.playList.filter((function(t){return Object.keys(e).every((function(i){if("url"===i){var n=null==e?void 0:e.url,r=null==t?void 0:t.url;return"string"==typeof n?n===(null==r?void 0:r.toString()):!(!Array.isArray(n)||!Array.isArray(r))&&n.map((function(e){return e.src})).join("")===r.map((function(e){return e.src})).join("")}var o,a,s=(null===(o=e[i])||void 0===o?void 0:o.toString())===(null===(a=t[i])||void 0===a?void 0:a.toString()),l=!e[i];return s||l}))}))}},{key:"getNextDefinition",value:function(){var e,t,i=arguments.length>1?arguments[1]:void 0,n=arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?"prev":"next",r=this.current,o=r.definition,a=r.lineId;if(o){var s=null===(e=this.getCurrentStreams())||void 0===e?void 0:e[0],l="auto"===o?s.mapDefinition:o,c=oc(i)||xl;if(Object.keys(c).includes(l)){for(var u=null===(t=c[l])||void 0===t?void 0:t[n],h=this.getDefinitionListByLineId(a);0===h.filter((function(e){return e.definition===u})).length&&u;){var d;u=null===(d=c[u])||void 0===d?void 0:d[n]}if(u)return"auto"===o&&u&&(s.mapDefinition=u),this.getUrlList({lineId:a,definition:u});Ul.log("å·²ç»éè³æä½çº§")}}}},{key:"apiMap",get:function(){var e={cn:{__PLAY_DOMAIN__:"https://vod.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://open.volcengineapi.com",__LOG_TEA_ID__:4951,__LOG_CHANNEL__:"cn",__UMD_PRE_PATH__:"https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/@volcengine/veplayer/1.9.6/plugin"},mya:{__PLAY_DOMAIN__:"https://vod.ap-southeast-1.volcengineapi.com",__BACKUP_PLAY_DOMAIN__:"https://vodbackup.ap-southeast-1.volcengineapi.com",__LOG_TEA_ID__:323254,__LOG_CHANNEL__:"sg",__LOG_CUSTOM_REGION__:"volc-overseas",__UMD_PRE_PATH__:"https://sf-unpkg.bytepluscdn.com/obj/byteplusfe-sg/sdk/@byteplus/veplayer/1.9.6/plugin"}},t=e[this.region]||e.cn;return{playDomain:t.__PLAY_DOMAIN__,backupPlayDomain:t.__BACKUP_PLAY_DOMAIN__}}},{key:"playDomain",get:function(){var e;return this.playDomainDegrade&&null!==(e=this.apiMap.backupPlayDomain)&&void 0!==e?e:this.apiMap.playDomain}},{key:"setVodTeaId",value:function(){!function(e){lA.TEA_ID=e}(kc(this.region).__LOG_TEA_ID__||4951)}}
vendor: 4,251 bytes, line 1
1,{key:"updateConfigs",value:function(e){Si(this.configs,Zt(e),(function(e,t){if(Ce(e))return t}))}},{key:"updatePlayList",value:function(){var e=this.configs,t=e.url,i=e.playList,n=void 0===i?[]:i,r=e.urlExpireTimestamp,o=E(n).filter((function(e){return e.url}));if(t&&!o.length){var s=a(a({},this.current),{},{url:t,urlExpireTimestamp:r});this.playList=[s]}else this.playList=o}},{key:"isVidPlay",value:function(){var e;return!(null===(e=this.configs)||void 0===e||null===(e=e.getVideoByToken)||void 0===e||!e.playAuthToken)}}]),e}();function DA(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function PA(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?DA(Object(i),!0).forEach((function(t){NA(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):DA(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function OA(){OA=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,n=Object.defineProperty||function(e,t,i){e[t]=i.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function c(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,i){return e[t]=i}}function u(e,t,i,r){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new C(r||[]);return n(a,"_invoke",{value:w(e,i,s)}),a}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function f(){}function p(){}function g(){}var v={};c(v,o,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(x([])));m&&m!==t&&i.call(m,o)&&(v=m);var _=g.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(n,o,a,s){var c=h(e[n],e,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==l(d)&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var o;n(this,"_invoke",{value:function(e,i){function n(){return new t((function(t,n){r(e,i,t,n)}))}return o=o?o.then(n,n):n()}})}function w(e,t,i){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return{value:void 0,done:!0}}for(i.method=r,i.arg=o;;){var a=i.delegate;if(a){var s=S(a,i);if(s){if(s===d)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=h(e,t,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}function S(e,t){var i=t.method,n=e.iterator[i];if(void 0===n)return t.delegate=null,"throw"===i&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==i&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+i+"' method")),d;var r=h(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function x(e){if(e){var t=e[o];if(t)return t.call(e);
vendor: 6,199 bytes, line 1
1if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:D}}function D(){return{value:void 0,done:!0}}return p.prototype=g,n(_,"constructor",{value:g,configurable:!0}),n(g,"constructor",{value:p,configurable:!0}),p.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},b(k.prototype),c(k.prototype,a,(function(){return this})),e.AsyncIterator=k,e.async=function(t,i,n,r,o){void 0===o&&(o=Promise);var a=new k(u(t,i,n,r),o);return e.isGeneratorFunction(i)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(_),c(_,s,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=x,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(i,n){return a.type="throw",a.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),E(i),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;E(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:x(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),d}},e}function IA(e,t,i,n,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,r)}function LA(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function a(e){IA(o,n,r,a,s,"next",e)}function s(e){IA(o,n,r,a,s,"throw",e)}a(void 0)}))}}function AA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RA(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zA(n.key),n)}}function MA(e,t,i){return t&&RA(e.prototype,t),i&&RA(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function NA(e,t,i){return(t=zA(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function BA(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jA(e,t)}function UA(e){return(UA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function jA(e,t){return(jA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function HA(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FA(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return HA(e)}function VA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=UA(e);if(t){var r=UA(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return FA(this,i)}}function zA(e){var t=function(e,t){if("object"!==l(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===l(t)?t:String(t)}function GA(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function WA(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};
vendor: 4,894 bytes, line 1
1t%2?GA(Object(i),!0).forEach((function(t){QA(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):GA(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function KA(){KA=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,n=Object.defineProperty||function(e,t,i){e[t]=i.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function c(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,i){return e[t]=i}}function u(e,t,i,r){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new C(r||[]);return n(a,"_invoke",{value:w(e,i,s)}),a}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function f(){}function p(){}function g(){}var v={};c(v,o,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(x([])));m&&m!==t&&i.call(m,o)&&(v=m);var _=g.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(n,o,a,s){var c=h(e[n],e,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==l(d)&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var o;n(this,"_invoke",{value:function(e,i){function n(){return new t((function(t,n){r(e,i,t,n)}))}return o=o?o.then(n,n):n()}})}function w(e,t,i){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return{value:void 0,done:!0}}for(i.method=r,i.arg=o;;){var a=i.delegate;if(a){var s=S(a,i);if(s){if(s===d)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=h(e,t,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}function S(e,t){var i=t.method,n=e.iterator[i];if(void 0===n)return t.delegate=null,"throw"===i&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==i&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+i+"' method")),d;var r=h(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function x(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:D}}function D(){return{value:void 0,done:!0}}return p.prototype=g,n(_,"constructor",{value:g,configurable:!0}),n(g,"constructor",{value:p,configurable:!0}),p.displayName=c(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},b(k.prototype),c(k.prototype,a,(function(){return this})),e.AsyncIterator=k,e.async=function(t,i,n,r,o){void 0===o&&(o=Promise);var a=new k(u(t,i,n,r),o);return e.isGeneratorFunction(i)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(_),c(_,s,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=x,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEac
vendor: 3,566 bytes, line 1
1h(E),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(i,n){return a.type="throw",a.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),E(i),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;E(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:x(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),d}},e}function YA(e){return(YA="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 $A(e,t,i,n,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void i(e)}s.done?t(l):Promise.resolve(l).then(n,r)}function qA(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function a(e){$A(o,n,r,a,s,"next",e)}function s(e){$A(o,n,r,a,s,"throw",e)}a(void 0)}))}}function XA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JA(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pR(n.key),n)}}function ZA(e,t,i){return t&&JA(e.prototype,t),i&&JA(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function QA(e,t,i){return(t=pR(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function eR(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iR(e,t)}function tR(e){return(tR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function iR(e,t){return(iR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}
1function nR(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function rR(e,t,i){return(rR=nR()?Reflect.construct.bind():function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&iR(r,i.prototype),r}).apply(null,arguments)}function oR(e){var t="function"==typeof Map?new Map:void 0;return oR=function(e){if(null===e||(i=e,-1===Function.toString.call(i).indexOf("[native code]")))return e;var i;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return rR(e,arguments,tR(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),iR(n,e)},oR(e)}function aR(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}function sR(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lR(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sR(e)}function cR(e){var t=nR();return function(){var i,n=tR(e);if(t){var r=tR(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return lR(this,i)}}function uR(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=tR(e)););return e}function hR(){return hR="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=uR(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},hR.apply(this,arguments)}function dR(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function fR(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return dR(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?dR(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function pR(e){var t=function(e,t){if("object"!==l(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===l(t)?t:String(t)}var gR="network",vR="network_timeout",yR="network_forbidden",mR="network_notfound",_R="network_range_not_satisfiable",bR="demux",kR="remux",wR="media",SR="drm",TR="other",ER="runtime",CR=(QA(dA={},"manifest",{HLS:1100,DASH:1200}),QA(dA,gR,2100),QA(dA,vR,2101),QA(dA,yR,2103),QA(dA,mR,2104),QA(dA,_R,2116),QA(dA,bR,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400,SIDX:3410}),QA(dA,kR,{FMP4:4100,MP4:4200}),QA(dA,wR,{MEDIA_ERR_ABORTED:5101,MEDIA_ERR_NETWORK:5102,MEDIA_ERR_DECODE:5103,MEDIA_ERR_SRC_NOT_SUPPORTED:5104,MEDIA_ERR_CODEC_NOT_SUPPORTED:5105,MEDIA_ERR_URL_EMPTY:5106,MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202,MSE_FULL:5203,MSE_HIJACK:5204,EME_HIJACK:5301}
vendor: 4,710 bytes, line 1
1),QA(dA,SR,{LICENSE:7100,CUSTOM_LICENSE:7200}),QA(dA,TR,8e3),QA(dA,ER,{NO_CANPLAY_ERROR:9001,BUFFERBREAK_ERROR:9002,WAITING_TIMEOUT_ERROR:9003}),dA),xR=function(e){eR(i,e);var t=cR(i);function i(e,n,r,o,a){var s;return XA(this,i),(s=t.call(this,a||(null==r?void 0:r.message))).errorType=e===vR?gR:e,s.originError=r,s.ext=o,s.errorCode=CR[e][n]||CR[e],s.errorMessage=s.message,s.errorCode||(s.errorType=TR,s.errorCode=CR[s.errorType]),s}return ZA(i,null,[{key:"create",value:function(e,t,n,r,o){return e instanceof i?e:(e instanceof Error&&(n=e,e=""),e||(e=TR),new i(e,t,n,r,o))}},{key:"network",value:function(e){var t;return new i(null!=e&&e.isTimeout?vR:gR,null,e instanceof Error?e:null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(t=e.response)||void 0===t?void 0:t.status})}}]),i}(oR(Error)),DR={DEBUG:1,LOG:2,WARN:3,ERROR:4},PR=["Boolean","Number","String","Undefined","Null","Date","Object"],OR=function(){function e(t,i){XA(this,e),this.name=t||"",this._prefix="[".concat(this.name,"]"),e.disabled=(null==i?void 0:i.disabled)||!0,this.logCacheLevel=(null==i?void 0:i.logCacheLevel)||3,this.logMaxSize=(null==i?void 0:i.logMaxSize)||204800,this.logSize=0,this.logTextArray=[]}return ZA(e,[{key:"debug",value:function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];this.logCache.apply(this,[DR.DEBUG].concat(n)),e.disabled||(t=console).debug.apply(t,[this._prefix,IR()].concat(n))}},{key:"log",value:function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];this.logCache.apply(this,[DR.LOG].concat(n)),e.disabled||(t=console).log.apply(t,[this._prefix,IR()].concat(n))}},{key:"warn",value:function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];this.logCache.apply(this,[DR.WARN].concat(n)),e.disabled||(t=console).warn.apply(t,[this._prefix,IR()].concat(n))}},{key:"error",value:function(){for(var t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];this.logCache.apply(this,[DR.ERROR].concat(n)),e.disabled||(t=console).error.apply(t,[this._prefix,IR()].concat(n))}},{key:"logCache",value:function(e){if(!(e<this.logCacheLevel)){var t="";try{for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];var o=n.map((function(e){return AR(e)}));t=this._prefix+IR()+JSON.stringify(o)}catch(e){return}if(e>=this.logCacheLevel&&(this.logSize+=t.length,this.logTextArray.push(t)),this.logSize>this.logMaxSize){var a=this.logTextArray.shift();this.logSize-=a.length}}}},{key:"getLogCache",value:function(){var e=this.logTextArray.join("\n");return this.reset(),e}},{key:"reset",value:function(){this.logTextArray=[],this.logSize=0}},{key:"table",value:function(){var t;e.disabled||(t=console).table.apply(t,arguments)}},{key:"setLogLevel",value:function(e){this.logCacheLevel=e}}],[{key:"enable",value:function(){e.disabled=!1}},{key:"disable",value:function(){e.disabled=!0}}]),e}();function IR(){return(new Date).toLocaleString()}function LR(e){if("object"!==YA(e))return e;var t=Object.prototype.toString.call(e).slice(8,-1);switch(t){case"Array":case"Uint8Array":case"ArrayBuffer":return t+"["+e.length+"]";case"Object":return"{}";default:return t}}function AR(e,t,i){i||(i=1),t||(t=2);var n={};if(!e||"object"!==YA(e))return e;var r=Object.prototype.toString.call(e).slice(8,-1);if(!PR.includes(r))return r;if(!(i>t)){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i===t?n[o]=LR(e[o]):"object"===YA(e[o])?n[o]=AR(e[o],t,i+1):n[o]=e[o]);return n}}QA(OR,"disabled",!0);var RR="fetch",MR="xhr",NR="arraybuffer",BR="text",UR="json",jR=function(e){eR(i,e);var t=cR(i);function i(e,n,r,o){var a;return XA(this,i),QA(sR(a=t.call(this,o)),"retryCount",0),QA(sR(a),"isTimeout",!1),QA(sR(a),"loaderType",RR),QA(sR(a),"startTime",0),QA(sR(a),"endTime",0),QA(sR(a),"options",{}),a.url=e,a.request=n,a.response=r,a}return ZA(i)}(oR(Error)),HR=Object.prototype.toString;function FR(e){if("[object Object]"!==HR.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function VR(e){if(e&&null!==e[0]&&void 0!==e[0]&&(0!==e[0]||null!==e[1]&&void 0!==e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function zR(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function GR(e,t){if(e){if(!t)return e;var i,n=Object.keys(t).map((function(e){if(null!=(i=t[e]))return Array.isArray(i)?e+="[]":i=[i],i.map((function(t){var i;return i=t,"[object Date]"===HR.call(i)?t=t.toISOString():function(e){return null!==e&&"object"===YA(e)}(t)&&(t=JSON.stringify(t)),"".concat(zR(e),"=").concat(zR(t))})).join("&")}
vendor: 6,627 bytes, line 1
1)).filter(Boolean).join("&");if(n){var r=e.indexOf("#");-1!==r&&(e=e.slice(0,r)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}}function WR(e,t,i,n,r,o,a,s,l,c,u){return r=null!=r?parseFloat(r):null,n=parseInt(n||"0",10),Number.isNaN(n)&&(n=0),{data:e,done:t,options:{range:l,vid:c,index:s,contentLength:n,age:r,startTime:o,firstByteTime:a,endTime:Date.now(),priOptions:u},response:i}}function KR(e,t){return Math.round(8*e*1e3/t/1024)}var YR="error",$R="core.ttfb",qR="core.loadstart",XR="core.loadresponseheaders",JR="core.loadcomplete",ZR="core.loadretry",QR="core.metadataparsed",eM="real_time_speed",tM=2097152,iM=function(e){eR(n,e);var t,i=cR(n);function n(){var e;return XA(this,n),QA(sR(e=i.call(this)),"_abortController",null),QA(sR(e),"_timeoutTimer",null),QA(sR(e),"_reader",null),QA(sR(e),"_response",null),QA(sR(e),"_aborted",!1),QA(sR(e),"_index",-1),QA(sR(e),"_range",null),QA(sR(e),"_receivedLength",0),QA(sR(e),"_running",!1),QA(sR(e),"_logger",null),QA(sR(e),"_vid",""),QA(sR(e),"_onProcessMinLen",0),QA(sR(e),"_onCancel",null),QA(sR(e),"_priOptions",null),e}return ZA(n,[{key:"load",value:function(e){var t,i=this,n=e.url,r=e.vid,o=e.timeout,a=e.responseType,s=e.onProgress,l=e.index,c=e.onTimeout,u=e.onCancel,h=e.range,d=e.transformResponse,f=e.request,p=e.params,g=e.logger,v=e.method,y=e.headers,m=e.body,_=e.mode,b=e.credentials,k=e.cache,w=e.redirect,S=e.referrer,T=e.referrerPolicy,E=e.onProcessMinLen,C=e.priOptions;this._logger=g,this._aborted=!1,this._onProcessMinLen=E,this._onCancel=u,this._abortController="undefined"!=typeof AbortController&&new AbortController,this._running=!0,this._index=l,this._range=h||[0,0],this._vid=r||n,this._priOptions=C||{};var x={method:v,headers:y,body:m,mode:_,credentials:b,cache:k,redirect:w,referrer:S,referrerPolicy:T,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},D=!1;clearTimeout(this._timeoutTimer),n=GR(n,p);var P=VR(h);P&&(y=f?f.headers:x.headers=x.headers||(Headers?new Headers:{}),Headers&&y instanceof Headers?y.append("Range",P):y.Range=P),o&&(this._timeoutTimer=setTimeout((function(){if(D=!0,i.cancel(),c){var e=new jR(n,x,null,"timeout");e.isTimeout=!0,c(e,{index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions})}}),o));var O=Date.now();return this._logger.debug("[fetch load start], index,",l,",range,",h),new Promise((function(e,t){fetch(f||n,f?void 0:x).then(function(){var r=qA(KA().mark((function r(o){var c,u,f,p;return KA().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(clearTimeout(i._timeoutTimer),i._response=o,!i._aborted&&i._running){r.next=4;break}return r.abrupt("return");case 4:if(d&&(o=d(o,n)||o),o.ok){r.next=7;break}throw new jR(n,x,o,"bad network response");case 7:if(c=Date.now(),a!==BR){r.next=15;break}return r.next=11,o.text();case 11:u=r.sent,i._running=!1,r.next=37;break;case 15:if(a!==UR){r.next=22;break}return r.next=18,o.json();case 18:u=r.sent,i._running=!1,r.next=37;break;case 22:if(!s){r.next=29;break}return i.resolve=e,i.reject=t,i._loadChunk(o,s,O,c),r.abrupt("return");case 29:return r.next=31,o.arrayBuffer();case 31:u=r.sent,u=new Uint8Array(u),i._running=!1,f=Date.now()-O,p=KR(u.byteLength,f),i.emit(eM,{speed:p,len:u.byteLength,time:f,vid:i._vid,index:i._index,range:i._range,priOptions:i._priOptions});case 37:i._logger.debug("[fetch load end], index,",l,",range,",h),e(WR(u,!0,o,o.headers.get("Content-Length"),o.headers.get("age"),O,c,l,h,i._vid,i._priOptions));case 39:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()).catch((function(e){var r;clearTimeout(i._timeoutTimer),i._running=!1,i._aborted&&!D||((e=e instanceof jR?e:new jR(n,x,null,null===(r=e)||void 0===r?void 0:r.message)).startTime=O,e.endTime=Date.now(),e.isTimeout=D,e.options={index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions},t(e))}))}))}},{key:"cancel",value:(t=qA(KA().mark((function e(){return KA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._aborted){e.next=2;break}return e.abrupt("return");case 2:if(this._aborted=!0,this._running=!1,!this._response){e.next=14;break}if(e.prev=5,!this._reader){e.next=9;break}return e.next=9,this._reader.cancel();case 9:e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:this._response=this._reader=null;case 14:if(this._abortController){try{this._abortController.abort()}catch(e){}this._abortController=null}this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions});case 16:case"end":return e.stop()}}),e,this,[[5,11]])}))),function(){return t.apply(this,arguments)})},{key:"_loadChunk",value:function(e,t,i,n){var r=this;if(!e.body||!e.body.getReader){this._running=!1;var o=new jR(e.url,"",e,"onProgress of bad response.body.getReader");return o.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(o)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(tM),this._writeIdx=0);var a,s,l,c=this._reader=e.body.getReader(),u=function(){var o=qA(KA().mark((function o(){var h,d,f,p,g,v,y,m;return KA().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=Date.now(),o.prev=1,o.next=4,c.read();case 4:a=o.sent,l=Date.now(),o.next=13;break;case 8:return o.prev=8,o.t0=o.catch(1),l=Date.now(),r._aborted||(r._running=!1,o.t0.options={index:r._index,range:r._range,vid:r._vid,priOptions:r._priOptions},r.reject(o.t0)),o.abrupt("return");case 13:if(d=(null===(h=r._range)||void 0===h?void 0:h.length)>0?r._range[0]:0,f=d+r._receivedLength,!r._aborted){o.next=19;break}return r._running=!1,t(void 0,!1,{range:[f,f],vid:r._vid,index:r._index,startTime:s,endTime:l,st:i,firstByteTime:n,priOptions:r._priOptions},e),o.abrupt("return");case 19:p=a.value?a.value.byteLength:0,r._receivedLength+=p,r._logger.debug("ãfetchLoader,onProgress callã,task,",r._range,", start,",f,", end,",d+r._receivedLength,", done,",a.done),r._onProcessMinLen>0?r._writeIdx+p>=r._onProcessMinLen||a.done?((g=new Uint8Array(r._writeIdx+p)).set(r._cache.slice(0,r._writeIdx),0),p>0&&g.set(a.value,r._writeIdx),r._writeIdx=0,r._logger.debug("ãfetchLoader,onProgress enoughã,done,",a.done,",len,",g.byteLength,", writeIdx,",r._writeIdx)):p>0&&r._writeIdx+p<tM?(r._cache.set(a.value,r._writeIdx),r._writeIdx+=p,r._logger.debug("ãfetchLoader,onProgress cacheã,len,",p,", writeIdx,",r._writeIdx)):p>0&&(v=new Uint8Array(r._writeIdx+p+2048),r._logger.debug("ãfetchLoader,onProgress extra startã,size,",r._writeIdx+p+2048,", datalen,",p,", writeIdx,",r._writeIdx),v.set(r._cache.slice(0,r._writeIdx),0),p>0&&v.set(a.value,r._writeIdx),r._writeIdx+=p,delete r._cache,r._
vendor: 4,234 bytes, line 1
1cache=v,r._logger.debug("ãfetchLoader,onProgress extra endã,len,",p,", writeIdx,",r._writeIdx)):g=a.value,(g&&g.byteLength>0||a.done)&&t(g,a.done,{range:[r._range[0]+r._receivedLength-(g?g.byteLength:0),r._range[0]+r._receivedLength],vid:r._vid,index:r._index,startTime:s,endTime:l,st:i,firstByteTime:n,priOptions:r._priOptions},e),a.done?(y=Date.now()-i,m=KR(r._receivedLength,y),r.emit(eM,{speed:m,len:r._receivedLength,time:y,vid:r._vid,index:r._index,range:r._range,priOptions:r._priOptions}),r._running=!1,r._logger.debug("[fetchLoader onProgress end],task,",r._range,",done,",a.done),r.resolve(WR(a,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),i,n,r._index,r._range,r._vid,r._priOptions))):u();case 25:case"end":return o.stop()}}),o,null,[[1,8]])})));return function(){return o.apply(this,arguments)}}();u()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}}],[{key:"isSupported",value:function(){return!("undefined"==typeof fetch)}}]),n}(zn),nM=function(e){eR(i,e);var t=cR(i);function i(){var e;return XA(this,i),QA(sR(e=t.call(this)),"_xhr",null),QA(sR(e),"_aborted",!1),QA(sR(e),"_timeoutTimer",null),QA(sR(e),"_range",null),QA(sR(e),"_receivedLength",0),QA(sR(e),"_url",null),QA(sR(e),"_onProgress",null),QA(sR(e),"_index",-1),QA(sR(e),"_headers",null),QA(sR(e),"_currentChunkSizeKB",384),QA(sR(e),"_timeout",null),QA(sR(e),"_xhr",null),QA(sR(e),"_withCredentials",null),QA(sR(e),"_startTime",-1),QA(sR(e),"_loadCompleteResolve",null),QA(sR(e),"_loadCompleteReject",null),QA(sR(e),"_runing",!1),QA(sR(e),"_logger",!1),QA(sR(e),"_vid",""),QA(sR(e),"_responseType",void 0),QA(sR(e),"_credentials",void 0),QA(sR(e),"_method",void 0),QA(sR(e),"_transformResponse",void 0),QA(sR(e),"_firstRtt",void 0),QA(sR(e),"_onCancel",null),QA(sR(e),"_priOptions",null),e}return ZA(i,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer),this._logger=e.logger,this._range=e.range,this._onProgress=e.onProgress,this._index=e.index,this._headers=e.headers,this._withCredentials="include"===e.credentials||"same-origin"===e.credentials,this._body=e.body||null,e.method&&(this._method=e.method),this._timeout=e.timeout||null,this._runing=!0,this._vid=e.vid||e.url,this._responseType=e.responseType,this._firstRtt=-1,this._onTimeout=e.onTimeout,this._onCancel=e.onCancel,this._request=e.request,this._priOptions=e.priOptions||{},this._logger.debug("ãxhrLoader taskã, range",this._range),this._url=GR(e.url,e.params);var i=Date.now();return new Promise((function(e,i){t._loadCompleteResolve=e,t._loadCompleteReject=i,t._startLoad()})).catch((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof jR?e:new jR(t._url,t._request)).startTime=i,e.endTime=Date.now(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e}))}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===NR&&this._range&&this._range.length>1)if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,i=this._range[0]+this._receivedLength,n=this._range[1];t<this._range[1]-i&&(n=i+t),e=[i,n],this._logger.debug("[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this._logger.debug("[xhr_loader->],tast :",this._range,", allRange, ",e);this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{this._startTime=Date.now();var i=this._xhr=new XMLHttpRequest;i.open(this._method||"GET",this._url,!0),i.responseType=this._responseType,this._timeout&&(i.timeout=this._timeout),i.withCredentials=this._withCredentials,i.onload=this._onLoad.bind(this),i.onreadystatechange=this._onReadyStatechange.bind(this),i.onerror=function(e){var i,n,r;t._running=!1;var o=new jR(t._url,t._request,null==e||null===(i=e.currentTarget)||void 0===i?void 0:i.response,"xhr.onerror.status:"+(null==e||null===(n=e.currentTarget)||void 0===n?void 0:n.status)+",statusText,"+(null==e||null===(r=e.currentTarget)||void 0===r?void 0:r.statusText));o.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(o)},i.ontimeout=function(e){t.cancel();var i=new jR(t._url,t._request,{status:408},"timeout");
1t._onTimeout&&(i.isTimeout=!0,t._onTimeout(i,{index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions})),i.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(i)};var n=this._headers||{},r=VR(e);r&&(n.Range=r),n&&Object.keys(n).forEach((function(e){i.setRequestHeader(e,n[e])})),this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e),i.send(this._body)}catch(t){t.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(t)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&this._firstRtt<0&&(this._firstRtt=Date.now())}},{key:"_onLoad",value:function(e){var t,i=e.target.status;if(i<200||i>299){var n=new jR(this._url,null,WA(WA({},e.target.response),{},{status:i}),"bad response,status:"+i);return n.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(n)}var r,o=null,a=!1,s=(null===(t=this._range)||void 0===t?void 0:t.length)>0?this._range[0]:0;if(this._responseType===NR){var l,c=new Uint8Array(e.target.response);if(r=s+this._receivedLength,c&&c.byteLength>0){this._receivedLength+=c.byteLength;var u=Date.now()-this._startTime,h=KR(this._receivedLength,u);this.emit(eM,{speed:h,len:this._receivedLength,time:u,vid:this._vid,index:this._index,range:[r,s+this._receivedLength],priOptions:this._priOptions})}o=c,a=!((null===(l=this._range)||void 0===l?void 0:l.length)>1&&this._range[1]&&this._receivedLength<this._range[1]-this._range[0]),this._logger.debug("[xhr load done->], tast :",this._range,", start",r,"end ",s+this._receivedLength,",dataLen,",c?c.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",a)}else a=!0,o=e.target.response;var d={ok:i>=200&&i<300,status:i,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(d=this._transformResponse(d,this._url)||d),this._onProgress&&this._onProgress(o,a,{index:this._index,vid:this._vid,range:[r,s+this._receivedLength],startTime:this._startTime,endTime:Date.now(),priOptions:this._priOptions},d),a?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve(WR(this._onProgress?null:o,a,d,d.headers["content-length"],d.headers.age,this._startTime,this._firstRtt,this._index,this._range,this._vid,this._priOptions))):this._startLoad()}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._runing=!1,hR(tR(i.prototype),"removeAllListeners",this).call(this),this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions}),this._xhr?this._xhr.abort():void 0}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}},{key:"_getHeaders",value:function(e){var t,i={},n=fR(e.getAllResponseHeaders().trim().split("\r\n"));try{for(n.s();!(t=n.n()).done;){var r=t.value.split(": ");i[r[0].toLowerCase()]=r.slice(1).join(": ")}}catch(e){n.e(e)}finally{n.f()}return i}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),i}(zn),rM=["retry","retryDelay","onRetryError","transformError"],oM=function(){function e(t,i){var n,r,o;XA(this,e),this.promise=((o=new Promise((function(e,t){n=e,r=t}))).used=!1,o.resolve=function(){return o.used=!0,n.apply(void 0,arguments)},o.reject=function(){return o.used=!0,r.apply(void 0,arguments)},o),this.alive=!!i.onProgress,!i.logger&&(i.logger=new OR("Loader")),this._loaderType=t,this._loader=t===RR&&window.fetch?new iM:new nM,this._config=i,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=i.retryCheckFunc,this._logger=i.logger}var t;return ZA(e,[{key:"exec",value:function(){var e=this,t=this._config,i=t.retry,n=t.retryDelay,r=t.onRetryError,o=t.transformError,a=aR(t,rM),s=function(){var t=qA(KA().mark((function t(){var l,c,u;return KA().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(a);case 3:l=t.sent,e.promise.resolve(l),t.next=27;break;case 7:if(t.prev=7,t.t0=t.catch(0),e._loader.running=!1,e._logger.debug("[task request catch err]",t.t0),!e._canceled){t.next=13;break}return t.abrupt("return");case 13:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,c=t.t0,o&&(c=o(c)||c),r&&e._retryCount>0&&r(c,e._retryCount,{index:a.index,vid:a.vid,range:a.range,priOptions:a.priOptions}),e._retryCount++,u=!0,e._retryCheckFunc&&(u=e._retryCheckFunc(t.t0)),!(u&&e._retryCount<=i)){t.next=26;break}return clearTimeout(e._retryTimer),e._logger.debug("[task request setTimeout],retry",e._retryCount,",retry range,",a.range),e._retryTimer=setTimeout(s,n),t.abrupt("return");case 26:e.promise.reject(c);case 27:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return s(),this.promise}},{key:"cancel",value:(t=qA(KA().mark((function e(){return KA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(this._retryTimer),this._canceled=!0,this._loader.running=!1,e.abrupt("return",this._loader.cancel());case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}]),e}();function aM(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}
vendor: 2,515 bytes, line 1
1var sM=function(e){eR(n,e);var t,i=cR(n);function n(e){var t;return XA(this,n),QA(sR(t=i.call(this,e)),"type",RR),QA(sR(t),"_queue",[]),QA(sR(t),"_alive",[]),QA(sR(t),"_currentTask",null),QA(sR(t),"_config",void 0),t._config=function(e){return WA({loaderType:RR,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:BR,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0,onProcessMinLen:0},e)}(e),t._config.loaderType!==MR&&iM.isSupported()||(t.type=MR),t.log=e.logger,t}return ZA(n,[{key:"isFetch",value:function(){return this.type===RR}},{key:"load",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?i=e:i.url=e||i.url||this._config.url,(i=Object.assign({},this._config,i)).params&&(i.params=Object.assign({},i.params)),i.headers&&FR(i.headers)&&(i.headers=Object.assign({},i.headers)),i.body&&FR(i.body)&&(i.body=Object.assign({},i.body)),i.transformRequest&&(i=i.transformRequest(i)||i),i.logger=this.log;var n=new oM(this.type,i);return n.loader.on(eM,(function(e){t.emit(eM,e)})),this._queue.push(n),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),n.promise}},{key:"cancel",value:(t=qA(KA().mark((function e(){var t;return KA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._queue.map((function(e){return e.cancel()})).concat(this._alive.map((function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Promise.all(t);case 6:return e.next=8,aM();case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"_processTask",value:function(){var e=this;if(this._currentTask=this._queue.shift(),this._currentTask){this._currentTask.alive&&this._alive.push(this._currentTask);var t=this._currentTask.exec().catch((function(e){}));t&&"function"==typeof t.finally&&t.finally((function(){var t,i;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(i=e._alive)||void 0===i?void 0:i.length)>0&&(e._alive=e._alive.filter((function(t){return t&&t!==e._currentTask}))),e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return iM.isSupported()}}]),n}(zn),lM="core.rtcstatechange",cM={},uM={},hM={exports:{}},dM=hM
vendor: 6,781 bytes, line 1
1.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),(t+=null!=e["network-id"]?" network-id %d":"%v")+(null!=e["network-cost"]?" network-cost %d":"%v")}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",(t+=null!=e.rateNumerator?" rate=%s":"")+(null!=e.rateDenominator?"/%s":"")}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};
vendor: 2,558 bytes, line 1
1Object.keys(dM).forEach((function(e){dM[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))})),function(e){var t=function(e){return String(Number(e))===e?Number(e):e},i=function(e,i,n){var r=e.name&&e.names;e.push&&!i[e.push]?i[e.push]=[]:r&&!i[e.name]&&(i[e.name]={});var o=e.push?{}:r?i[e.name]:i;!function(e,i,n,r){if(r&&!n)i[r]=t(e[1]);else for(var o=0;o<n.length;o+=1)null!=e[o+1]&&(i[n[o]]=t(e[o+1]))}(n.match(e.reg),o,e.names,e.name),e.push&&i[e.push].push(o)},n=hM.exports,r=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},o=[],a=t;return e.split(/(\r\n|\r|\n)/).filter(r).forEach((function(e){var t=e[0],r=e.slice(2);"m"===t&&(o.push({rtp:[],fmtp:[]}),a=o[o.length-1]);for(var s=0;s<(n[t]||[]).length;s+=1){var l=n[t][s];if(l.reg.test(r))return i(l,a,r)}})),t.media=o,t};var o=function(e,i){var n=i.split(/=(.+)/,2);return 2===n.length?e[n[0]]=t(n[1]):1===n.length&&i.length>1&&(e[n[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(" ").map(Number)},e.parseRemoteCandidates=function(e){for(var i=[],n=e.split(" ").map(t),r=0;r<n.length;r+=3)i.push({component:n[r],ip:n[r+1],port:n[r+2]});return i},e.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(o,{})}))},e.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var i,n=!1;return"~"!==e[0]?i=t(e):(i=t(e.substring(1,e.length)),n=!0),{scid:i,paused:n}}))}))}}(uM);var fM=hM.exports,pM=/%[sdv%]/g,gM=function(e){var t=1,i=arguments,n=i.length;return e.replace(pM,(function(e){if(t>=n)return e;var r=i[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(r);case"%d":return Number(r);case"%v":return""}}))},vM=function(e,t,i){var n=[e+"="+(t.format instanceof Function?t.format(t.push?i:i[t.name]):t.format)];if(t.names)for(var r=0;r<t.names.length;r+=1){var o=t.names[r];t.name?n.push(i[t.name][o]):n.push(i[t.names[r]])}else n.push(i[t.name]);return gM.apply(null,n)},yM=["v","o","s","i","u","e","p","c","b","t","r","z","a"],mM=["i","c","b","a"],_M=uM,bM=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var i=t.outerOrder||yM,n=t.innerOrder||mM,r=[];return i.forEach((function(t){fM[t].forEach((function(i){i.name in e&&null!=e[i.name]?r.push(vM(t,i,e)):i.push in e&&null!=e[i.push]&&e[i.push].forEac
1h((function(e){r.push(vM(t,i,e))}))}))})),e.media.forEach((function(e){r.push(vM("m",fM.m[0],e)),n.forEach((function(t){fM[t].forEach((function(i){i.name in e&&null!=e[i.name]?r.push(vM(t,i,e)):i.push in e&&null!=e[i.push]&&e[i.push].forEach((function(e){r.push(vM(t,i,e))}))}))}))})),r.join("\r\n")+"\r\n"};cM.write=bM,cM.parse=_M.parse,cM.parseParams=_M.parseParams,cM.parseFmtpConfig=_M.parseFmtpConfig,cM.parsePayloads=_M.parsePayloads,cM.parseRemoteCandidates=_M.parseRemoteCandidates,cM.parseImageAttributes=_M.parseImageAttributes,cM.parseSimulcastStreamList=_M.parseSimulcastStreamList;var kM=new OR("rts"),wM=function(e){BA(r,e);var t,i,n=VA(r);function r(e){var t;return AA(this,r),NA(HA(t=n.call(this)),"_url",""),NA(HA(t),"_pc",null),NA(HA(t),"_audioTransceicer",null),NA(HA(t),"_videoTransceicer",null),NA(HA(t),"_mediaStream",null),NA(HA(t),"_media",null),NA(HA(t),"_opts",null),NA(HA(t),"_loader",null),NA(HA(t),"_retry",0),NA(HA(t),"_waitingTimer",0),NA(HA(t),"_rctConnectStartTs",0),NA(HA(t),"_onTrack",(function(e){if(kM.log("addTrack: ",e.track,e.streams),t["_".concat(e.track.kind)]=e.track,!t._mediaStream){t._mediaStream=new MediaStream,t._media.srcObject=t._mediaStream;var i=t._media.play();i&&i.catch&&i.catch((function(e){}))}t._mediaStream.addTrack(e.track)})),NA(HA(t),"_mockWaitingByTimeupdate",(function(){var e,i;"connected"!==(null===(e=t._pc)||void 0===e?void 0:e.connectionState)&&"connected"!==(null===(i=t._pc)||void 0===i?void 0:i.iceConnectionState)||(clearTimeout(t._waitingTimer),t._waitingTimer=setTimeout((function(){var e;null!==(e=t._media)&&void 0!==e&&e.paused||t.emit("waiting")}),t._opts.stallInterval))})),NA(HA(t),"_onLoadedData",(function(){kM.log("loadeddata emit"),t.getStatsSnapshoot().then((function(e){t.emit(QR,{type:"video",elapsed:Date.now()-t._rctConnectStartTs,meta:e.video}),t.emit(QR,{type:"audio",elapsed:Date.now()-t._rctConnectStartTs,meta:e.audio})}))})),NA(HA(t),"_onLoaderRetry",(function(e,i){t.emit(ZR,{error:xR.network(e),retryTime:i})})),t._opts=function(e){return PA({retryCount:0,retryDelay:1e3,loadTimeout:5e3,stallInterval:400,delayHint:0},e)}(e),t._media=t._opts.media,t._loader=new sM(PA(PA({},e.fetchOptions),{},{responseType:"json",method:"POST",retry:t._opts.retryCount,retryDelay:t._opts.retryDelay,timeout:t._opts.loadTimeout,onRetryError:t._onLoaderRetry,logger:kM})),t._retry=t._opts.retryCount,t._bindMediaEvent(),t}return MA(r,[{key:"pc",get:function(){return this._pc}},{key:"audioTrack",get:function(){return this._audio}},{key:"videoTack",get:function(){return this._video}},{key:"loader",get:function(){return this._loader}},{key:"getStats",value:function(){return e=this._pc,new Promise((function(t){var i;null===(i=e.getStats(null))||void 0===i||i.then((function(e){var i,n;t((n=[],(i=e).forEach((function(e){"inbound-rtp"===e.type&&n.push(e)})),n.map((function(e){var t=i.get(e.codecId),n=i.get(e.trackId);return{type:e.mediaType,inboundRtp:e,codec:t,track:n}}))))}))})).catch((function(){}));var e}},{key:"getStatsSnapshoot",value:function(){return this.getStats().then((function(e){return function(e){var t,i,n,r,o,a,s,l,c,u,h,d,f,p,g,v,y,m,_,b,k,w,S,T,E,C,x,D,P,O=null==e?void 0:e.filter((function(e){return"video"===e.type}))[0],I=null==e?void 0:e.filter((function(e){return"audio"===e.type}))[0];return{video:O?{codec:null===(t=O.codec)||void 0===t?void 0:t.mimeType,payloadType:null===(i=O.codec)||void 0===i?void 0:i.payloadType,sdpFmtpLine:null===(n=O.codec)||void 0===n?void 0:n.sdpFmtpLine,bytesReceived:null===(r=O.inboundRtp)||void 0===r?void 0:r.bytesReceived,firCount:null===(o=O.inboundRtp)||void 0===o?void 0:o.firCount,pliCount:null===(a=O.inboundRtp)||void 0===a?void 0:a.pliCount,frameHeight:null===(s=O.inboundRtp)||void 0===s?void 0:s.frameHeight,frameWidth:null===(l=O.inboundRtp)||void 0===l?void 0:l.frameWidth,framesDecoded:null===(c=O.inboundRtp)||void 0===c?void 0:c.framesDecoded,framesDropped:null===(u=O.inboundRtp)||void 0===u?void 0:u.framesDropped,framesPerSecond:null===(h=O.inboundRtp)||void 0===h?void 0:h.framesPerSecond,framesReceived:null===(d=O.inbou
1ndRtp)||void 0===d?void 0:d.framesReceived,jitter:null===(f=O.inboundRtp)||void 0===f?void 0:f.jitter,jitterBufferDelay:null===(p=O.inboundRtp)||void 0===p?void 0:p.jitterBufferDelay,keyFramesDecoded:null===(g=O.inboundRtp)||void 0===g?void 0:g.keyFramesDecoded,nackCount:null===(v=O.inboundRtp)||void 0===v?void 0:v.nackCount,packetsLost:null===(y=O.inboundRtp)||void 0===y?void 0:y.packetsLost,packetsReceived:null===(m=O.inboundRtp)||void 0===m?void 0:m.packetsReceived}:void 0,audio:I?{codec:null===(_=I.codec)||void 0===_?void 0:_.mimeType,payloadType:null===(b=I.codec)||void 0===b?void 0:b.payloadType,sdpFmtpLine:null===(k=I.codec)||void 0===k?void 0:k.sdpFmtpLine,bytesReceived:null===(w=I.inboundRtp)||void 0===w?void 0:w.bytesReceived,audioLevel:null===(S=I.inboundRtp)||void 0===S?void 0:S.audioLevel,jitter:null===(T=I.inboundRtp)||void 0===T?void 0:T.jitter,jitterBufferDelay:null===(E=I.inboundRtp)||void 0===E?void 0:E.jitterBufferDelay,packetsLost:null===(C=I.inboundRtp)||void 0===C?void 0:C.packetsLost,packetsReceived:null===(x=I.inboundRtp)||void 0===x?void 0:x.packetsReceived,totalSamplesDuration:null===(D=I.inboundRtp)||void 0===D?void 0:D.totalSamplesDuration,totalSamplesReceived:null===(P=I.inboundRtp)||void 0===P?void 0:P.totalSamplesReceived}:void 0}}(e)}))}},{key:"load",value:(i=LA(OA().mark((function e(t){var i,n=this;return OA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._disconnect(),this._url=t,this._retry=this._opts.retryCount,(i=this._pc)&&i.close(),e.prev=5,this._pc=new RTCPeerConnection,this._bindRTCEvents(),e.next=10,this._connect(t);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(5),setTimeout((function(){return n._emitError(xR.create(TR,null,e.t0))}));case 15:case"end":return e.stop()}}),e,this,[[5,12]])}))),function(e){return i.apply(this,arguments)})},{key:"switchURL",value:function(e){this.load(e||this._url)}},{key:"_bindRTCEvents",value:function(){var e=this,t=this._pc;t.addEventListener("track",this._onTrack),t.addEventListener("connectionstatechange",(function(){if(kM.warn("onconnectionstatechange:",t.connectionState),e.emit(lM,{state:t.connectionState,url:e._url}),"disconnected"!==t.connectionState&&"failed"!==t.connectionState||e.emit("waiting"),"failed"===t.connectionState){if(0===e._retry)return void e._emitError(xR.network(new Error("rtc connect failed")));e._retry--,e.load(e._url)}"connected"===t.connectionState&&e.emit($R,{url:e._url,responseUrl:e._url,elapsed:Date.now()-e._rctConnectStartTs})}))}},{key:"_bindMediaEvent",value:function(){this._media.addEventListener("timeupdate",this._mockWaitingByTimeupdate),this._media.addEventListener("loadeddata",this._onLoadedData)}},{key:"_connect",value:(t=LA(OA().mark((function e(){var t,i,n,r,o,a,s,l,c,u,h,d,f,p;return OA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this._pc).addTransceiver){e.next=11;break}return this._audioTransceicer=t.addTransceiver("audio",{direction:"recvonly"}),this._videoTransceicer=t.addTransceiver("video",{direction:"recvonly"}),(n=this._opts.delayHint)&&(this._audioTransceicer.receiver.playoutDelayHint=n,this._audioTransceicer.receiver.jitterBufferDelayHint=n,this._videoTransceicer.receiver.playoutDelayHint=n,this._videoTransceicer.receiver.jitterBufferDelayHint=n),e.next=8,t.createOffer();case 8:i=e.sent,e.next=14;break;case 11:return e.next=13,t.createOffer({iceRestart:!0,offerToReceiveAudio:!0,offerToReceiveVideo:!0});case 13:i=e.sent;case 14:return kM.log("local offer"),kM.log(i.sdp),(r=cM.parse(i.sdp)).media.filter((function(e){return"audio"===e.type})).forEach((function(e){var t,i,n=null===(t=e.rtp.filter((function(e){return"opus"===e.codec}))[0])||void 0===t?void 0:t.payload;n&&(e.fmtp.forEach((function(e){e.payload===n&&(e.config="minptime=10;stereo=1;useinbandfec=1")})),null===(i=e.rtcpFb)||void 0===i||i.push({payload:n,type:"nack"}))})),i.sdp=cM.write(r),kM.log("local offer modified:\n",i.sdp),e.next=22,t.setLocalDescription(i);case 22:return o=this._url,e.prev=23,this._opts.preProcessUrl&&(o=this._opts.preProcessUrl(o).url),this._loader.finnalUrl=o,l=/_?session_id=([^&$]+)/.exec(o),c=l?l[1]:Date.now()+"666",this.emit
1(qR,{url:o,offersdp:i.sdp,sessionId:c}),u=Date.now(),e.next=32,this._loader.load(o,{body:JSON.stringify({sessionId:c,version:"1.0-html",localSdp:i})});case 32:if(h=e.sent,this.emit(XR,{headers:h.response.headers}),404!==(null==(d=null==h?void 0:h.data)?void 0:d.code)&&403!==(null==d?void 0:d.code)){e.next=40;break}return(f=xR.create(404===d.code?mR:yR,null,d)).errorType=gR,this._emitError(f),e.abrupt("return");case 40:if(200===(null==d?void 0:d.code)){e.next=42;break}throw new Error("code: ".concat(null==d?void 0:d.code,", message:").concat(null==d?void 0:d.message));case 42:return kM.log("answer:"),kM.log(null===(a=d.remoteSdp)||void 0===a?void 0:a.sdp),this.emit(JR,{url:o,elapsed:Date.now()-u,answersdp:null===(s=d.remoteSdp)||void 0===s?void 0:s.sdp}),(p=cM.parse(d.remoteSdp.sdp)).media.forEach((function(e){e.fingerprint.hash=e.fingerprint.hash.toUpperCase()})),d.remoteSdp.sdp=cM.write(p),kM.log("answer modified:\n",d.remoteSdp.sdp),this._rctConnectStartTs=Date.now(),e.next=52,this._pc.setRemoteDescription(d.remoteSdp);case 52:e.next=57;break;case 54:e.prev=54,e.t0=e.catch(23),this._emitError(xR.network(e.t0));case 57:case"end":return e.stop()}}),e,this,[[23,54]])}))),function(){return t.apply(this,arguments)})},{key:"_disconnect",value:function(){var e;null===(e=this._loader)||void 0===e||e.cancel(),this._audioTransceicer=null,this._videoTransceicer=null,this._mediaStream=null}},{key:"_emitError",value:function(e){this.emit(YR,e)}},{key:"destroy",value:function(){var e;this._disconnect(),null===(e=this._media)||void 0===e||e.removeEventListener("timeupdate",this._mockWaitingByTimeupdate),this._media&&(this._media.srcObject=null),this._pc&&this._pc.close(),this._loader=null,this._media=null,this._pc=null}}],[{key:"enableLogger",value:function(){OR.enable()}},{key:"disableLogger",value:function(){OR.disable()}}]),r}(zn);try{localStorage.getItem("xgd")?wM.enableLogger():wM.disableLogger()}catch(e){}function SM(){return!(!window.RTCPeerConnection||!window.RTCPeerConnection.prototype.addTransceiver)}var TM=function(e){BA(n,e);var t,i=VA(n);function n(){var e;AA(this,n);for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return NA(HA(e=i.call.apply(i,[this].concat(r))),"_rts",null),NA(HA(e),"_rtsOpts",null),NA(HA(e),"_init",(function(){var t;null===(t=e._rts)||void 0===t||t.destroy();var i=e.player.config,n=i.rts||{};e._rtsOpts=n,e._rts=new wM(PA({media:e.player.video,preProcessUrl:function(t,i){var n,r;return(null===(n=(r=e.player).preProcessUrl)||void 0===n?void 0:n.call(r,t,i))||{url:t,ext:i}}},n)),e._rts.load(i.url)})),NA(HA(e),"_onSwitchURL",(function(t){e._rts&&(e.player.config.url=t,e._rts.switchURL(t))})),e}return MA(n,[{key:"pc",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.pc}},{key:"videoTrack",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.videoTack}},{key:"audioTrack",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.audioTrack}},{key:"core",get:function(){return this._rts}},{key:"loader",get:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.loader}},{key:"version",get:function(){return"0.2.0-alpha.6"}},{key:"beforePlayerInit",value:function(){var e,t=this;this._init(),this.player.switchURL=this._onSwitchURL,null===(e=this.player)||void 0===e||e.useHooks("replay",(function(){var e;return null===(e=t._rts)||void 0===e?void 0:e.switchURL()})),this.on(Ar,this._onSwitchURL),this.on(Lr,this.destroy),this._transErrorEvent(),this._transCoreEvent(qR),this._transCoreEvent(JR),this._transCoreEvent($R),this._transCoreEvent(XR),this._transCoreEvent(ZR),this._transCoreEvent(QR),this._transCoreEvent(lM);try{Eo.defineGetterOrSetter(this.player,{__url:{get:function(){try{return URL.createObjectURL(new MediaSource)}catch(n){var e,i;null!==(e=t.player)&&void 0!==e&&null!==(i=e.video)&&void 0!==i&&i.srcObject||(t.player.video.srcObject=new MediaStream)}}}})}catch(e){}}},{key:"getStats",value:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.getStats()}},{key:"getStatsSnapshoot",value:function(){var e;return null===(e=this._rts)||void 0===e?void 0:e.getStatsSnapshoot()}},{key:"_transErrorEvent",value:function(){var e=this;this._rts.on(YR,(function(t){if(e.player){var i=new ar(e.player,t),n=e._rtsOpts,r=n.backupConstruct,o=n.backupURL;if(o){var a,s=e.player;s.emit("core_event",PA(PA({},{url:s.config.url,code:i.errorCode,message:i.message,httpCode:i.httpCode}),{},{eventName:"core.degrade"})),s.emit("degrade",{url:s.config.url,code:i.errorCode,message:i.message,httpCode:i.httpCode}
1),s.unRegisterPlugin("rts"),e._rts=null,s.rts=null,null!==(a=s.video)&&void 0!==a&&a.srcObject&&(s.video.srcObject=null),s.config.url=o,r?s.registerPlugin(r).beforePlayerInit():s.video.src=o}else e.player.emit(hr,i)}})),this._rts.on("waiting",(function(){var t;null===(t=e.player)||void 0===t||t.emit("waiting")}))}},{key:"_transCoreEvent",value:function(e){var t=this;this._rts.on(e,(function(i){t.player&&t.player.emit("core_event",PA(PA({},i),{},{eventName:e}))}))}},{key:"destroy",value:function(){var e;null===(e=this._rts)||void 0===e||e.destroy()}}],[{key:"pluginName",get:function(){return"rts"}},{key:"isSupported",value:function(){return SM()}},{key:"getCapacity",value:function(){return function(){if(!SM())return Promise.reject("RTCPeerConnection no support");var e;try{(e=new RTCPeerConnection).addTransceiver("video",{direction:"recvonly"}),e.addTransceiver("audio",{direction:"recvonly"})}catch(e){return Promise.reject(null==e?void 0:e.message)}return e.createOffer().then((function(t){var i,n,r,o;kM.log(t.sdp);var a=cM.parse(t.sdp),s=null===(i=a.media)||void 0===i?void 0:i.filter((function(e){return"video"===e.type}))[0],l=null===(n=a.media)||void 0===n?void 0:n.filter((function(e){return"audio"===e.type}))[0],c=null==s||null===(r=s.rtp)||void 0===r?void 0:r.filter((function(e){return"VP8"===e.codec||"VP9"===e.codec||"H264"===e.codec})),u=null==l||null===(o=l.rtp)||void 0===o?void 0:o.filter((function(e){return"opus"===e.codec})),h=null==s?void 0:s.fmtp,d=null==l?void 0:l.fmtp;return h&&c.map((function(e){var t;e.config=null===(t=h.filter((function(t){return t.payload===e.payload}))[0])||void 0===t?void 0:t.config})),d&&u.map((function(e){var t;e.config=null===(t=d.filter((function(t){return t.payload===e.payload}))[0])||void 0===t?void 0:t.config})),e.close(),{video:c,audio:u}}))}()}},{key:"isSupportedH264",value:(t=LA(OA().mark((function e(t){var i,r,o,a,s;return OA().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.getCapacity();case 3:if(r=e.sent,o=null===(i=r.video)||void 0===i?void 0:i.filter((function(e){return"H264"===e.codec&&(!t||-1!==e.config.indexOf(t))})).length){e.next=10;break}return e.next=8,n.getCapacity();case 8:s=e.sent,o=null===(a=s.video)||void 0===a?void 0:a.filter((function(e){return"H264"===e.codec&&(!t||-1!==e.config.indexOf(t))})).length;case 10:return e.abrupt("return",!!o);case 13:return e.prev=13,e.t0=e.catch(0),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,null,[[0,13]])}))),function(e){return t.apply(this,arguments)})}]),n}(Eo),EM=Object.prototype.hasOwnProperty,CM=wi((function(e,t){if(We(t)||qe(t))me(t,Xe(t),e);else for(var i in t)EM.call(t,i)&&ye(e,i,t[i])})),xM=function(e){g(i,e);var t=k(i);function i(){return h(this,i),t.apply(this,arguments)}return f(i,[{key:"beforeCreate",value:function(e){var t,i,n=(e.player.config.rtm||{}).backupStreamType,r={flv:window.FlvPlayer,hls:window.HlsPlayer};"hls"===n&&(i=e.player.config,"mobile"!==ir.device||(null==i?void 0:i.enableHlsMSE)&&yc())&&(t=r.hls),"flv"===n&&(t=r.flv),e.player.config.rts=CM({},e.player.config.rtm,{backupConstruct:t})}},{key:"afterCreate",value:function(){var e=this.player;e.on("degrade",(function(){e.unRegisterPlugin("rtm")}))}}],[{key:"pluginName",get:function(){return"rtm"}}]),i}(TM),DM={READY:"ready",COMPLETE:"complete",URL_CHANGE:"urlchange",PLAYER_FOCUS:"focus",PLAYER_BLUR:"blur",FULLSCREEN_CHANGE:"fullscreen_change",CSS_FULLSCREEN_CHANGE:"cssFullscreen_change",MINI_STATE_CHANGE:"mini_state_change",DESTROY:"destroy",REPLAY:"replay",RETRY:"retry",DEFINITION_CHANGE:"definition_change",Before_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:"after_definition_change",VIDEO_RESIZE:"video_resize",PIP_CHANGE:"pip_change",ROTATE:"rotate",SHORTCUT:"shortcut",SEI_PARSED:"SEI_PARSED",USER_ACTION:"user_action",AUTOPLAY_STARTED:"autoplay_started",AUTOPLAY_PREVENTED:"autoplay_was_prevented",PLAYER_CREATED_FINISH:"player_create_finish",PLAYER_REBUILD:"player_rebuild",NOT_SUPPORT_HARDWARE_DECODER:"not_support_hardware_decoder",NOT_SUPPORT_SOFT_DECODER:"not_support_soft_decoder",TOKEN_EXPIRED:"playAuthToken_expired",UMD_LOAD_FAIL:"umd_load_fail",PLAYNEXT:"playnext",URL_NULL:"urlNull",LEAVE_PLAYER:"leaveplayer",ENTER_PLAYER:"enterplayer",RESET:"reset",SOURCE_ERROR:"source_error",SOURCE_SUCCESS:"source_success"}
1,PM={DANMU_CHANGE:"danmu_change",TIME_SHIFT_CHANGE:"time_shift_change",AI_SUBTITLE_LANG_CHANGE:"ai_subtitle_lang_change",AI_SUBTITLE_MATCH:"ai_subtitle_match",CANCEL_UNMUTE:"cancel_unmute",REFRESH_CLICK:"refresh_click",PLAY_BACKUP_CHANGE:"play_backup_change",PLAY_BACKUP_CHANGE_FINISH:"play_backup_change_finish",PLAY_ERROR_BUTTON_CLICK:"play_error_button_click",PlAY_URL_CHANGE:"play_url_change",SHOW_PLAY_ERROR:"show_play_error",PLAYER_EXTEND_BUTTON:"player_extend_button",LONG_WAITING:"long_waiting",OFTEN_WAITING:"often_waiting",DEFINITION_DEMOTE:"definition_demote",LARKWINDOW_CHANGE:"larkWindow_change",PANEL_MODE_CHANGE:"panel_mode_change",INNER_DEFINITION_CHANGE:"inner_definition_change",LINE_CHANGE:"line_change",GET_PLAY_URL_ERR:"get_play_url_err",MEDIA_EXPIRED:"MEDIA_EXPIRED",MIRROR_CHANGE:"mirror_change",TIME_SCALE_CHANGE:"time_scale_change",MUSIC_MODE_CHANGE:"music_mode_change",MUSIC_CHANGE:"music_change",MUSIC_LIST_CHANGE:"music_list_change",AUTOPLAY_SUCCESS:"autoplay_success",AUTOPLAY_FAILED:"autoplay_failed",MENU_LOG:"MENU_LOG",MENU_REPORT:"MENU_REPORT",PLAY_LIST_CHANGE:"play_list_change",PLAY_LIST_ITEM_CHANGE:"play_list_item_change",PLAY_NEXT_START:"play_next_start",PLAY_NEXT_END:"play_next_end",ABR_AUTO_DESC_CHANGE:"ABR_AUTO_DESC_CHANGE"},OM=a(a(a({},{ABORT:"abort",CANPLAY:"canplay",CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:"durationchange",EMPITED:"empited",EMPTIED:"emptied",ENDED:"ended",ERROR:"error",LOADED_DATA:"loadeddata",LOADED_META_DATA:"loadedmetadata",LOAD_START:"loadstart",PAUSE:"pause",PLAY:"play",PLAYING:"playing",PROGRESS:"progress",RATE_CHANGE:"ratechange",SEEKED:"seeked",SEEKING:"seeking",STALLED:"stalled",SUSPEND:"suspend",TIME_UPDATE:"timeupdate",VOLUME_CHANGE:"volumechange",WAITING:"waiting"}),DM),PM),IM={SDKEvents:DM,PluginEvents:PM},LM=30,AM=30,RM=40,MM=50,NM=60,BM=20,UM=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).playerData=n.playerConfig.playerData,n}return f(i,[{key:"beforeCreate",value:function(e){var t=e.player.config.playerData,i=t.getLineList(),n=t.current.lineId;Array.isArray(i)&&i.length>0&&(e.config.list=i.map((function(t){return t.text=e.player.i18n[t.lineTextKey]||t.lineTextKey,t}))),e.config.defaultLine=n}},{key:"afterCreate",value:function(){S(v(i.prototype),"afterCreate",this).call(this),this.config.list.length<2?this.hide():this.renderItemList()}},{key:"afterPlayerInit",value:function(){}},{key:"renderItemList",value:function(){var e=this,t=this.config,n=t.list,r=t.defaultLine,o=0,a=n.map((function(t,i){var n,a={lineId:t.lineId||"",showText:e.i18n[t.lineTextKey]||t.lineTextKey,isCurrent:!1,selected:!1};return qn.isUndefined(t.lineId)||(null===(n=t.lineId)||void 0===n?void 0:n.toString())!==(null==r?void 0:r.toString())||(a.isCurrent=!0,a.selected=!0,o=i),a}));S(v(i.prototype),"renderItemList",this).call(this,a,o)}},{key:"onItemClick",value:function(e,t){this.player.emit(PM.LINE_CHANGE,{from:this.playerData.current.lineId,to:t.to.lineId}),this.playerData.current.lineId=t.to.lineId,this.player.emit(DM.PLAYER_REBUILD)}}],[{key:"pluginName",get:function(){return"sdkMultilinePlugin"}},{key:"defaultConfig",get:function(){return{position:Bo.POSITIONS.CONTROLS_RIGHT,index:RM,list:[],defaultLine:0,className:"xgplayer-multiline",hidePortrait:!1,isShowIcon:!0}}}]),i}(Ws),jM=function(){return M.Date.now()},HM=/\s/,FM=/^\s+/;function VM(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&HM.test(e.charAt(t)););return t}(e)+1).replace(FM,""):e}var zM=/^[-+]0x[0-9a-f]+$/i,GM=/^0b[01]+$/i,WM=/^0o[0-7]+$/i,KM=parseInt;function YM(e){if("number"==typeof e)return e;if(Vi(e))return NaN;if(G(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=G(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=VM(e);var i=GM.test(e);return i||WM.test(e)?KM(e.slice(2),i?2:8):zM.test(e)?NaN:+e}var $M=Math.max,qM=Math.min;function XM(e,t,i){var n,r,o,a,s,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var i=n,o=r;return n=r=void 0,c=t,a=e.apply(o,i)}function p(e){return c=e,s=setTimeout(v,t),u?f(e):a}function g(e){var i=e-l;return void 0===l||i>=t||i<0||h&&e-c>=o}function v(){var e=jM();if(g(e))return y(e);s=setTimeout(v,function(e){var i=t-(e-l);return h?qM(i,o-(e-c)):i}(e))}function y(e){return s=void 0,d&&n?f(e):(n=r=void 0,a)}function m(){var e=jM(),i=g(e);
1if(n=arguments,r=this,l=e,i){if(void 0===s)return p(l);if(h)return clearTimeout(s),s=setTimeout(v,t),f(l)}return void 0===s&&(s=setTimeout(v,t)),a}return t=YM(t)||0,G(i)&&(u=!!i.leading,o=(h="maxWait"in i)?$M(YM(i.maxWait)||0,t):o,d="trailing"in i?!!i.trailing:d),m.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=l=r=s=void 0},m.flush=function(){return void 0===s?a:y(jM())},m}function JM(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return G(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),XM(e,t,{leading:n,maxWait:t,trailing:r})}var ZM=function(e){return function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e))._playTimer=null,n.handleABRDescChange=function(){n._autoRealDefinition=(arguments.length<=1?void 0:arguments[1])||void 0,n.refreshDefinitionList()},n.handleResourceReady=function(){var e,t,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=n.getCurrentDefinitionInfo(n.player).list.filter((function(e){var t,i=e&&r.find((function(t){return n.playerData.isDefinitionMatch(t.definition,e.definition)}));return i&&"dash"===(null===(t=n.playerData.getStreamType())||void 0===t?void 0:t.toLowerCase())&&(e.url=i.url),i})),a=r.find((function(e){return null==e?void 0:e.selected}))||n.playerData.current,s=o.find((function(e){return n.playerData.isDefinitionMatch(e.definition,null==a?void 0:a.definition)}));n.playerData.playList=o,null!=s&&s.definition&&(null===(e=n.playerData.current)||void 0===e?void 0:e.definition)!==s.definition&&(n.playerData.current.definition=null==s?void 0:s.definition),null===(t=(i=n).refreshDefinitionList)||void 0===t||t.call(i)},n.clientType=e.clientType,n.playerData=e.player.config.playerData,n.toastInfo={},n.dataMonitoring(),n}return f(i,[{key:"afterCreate",value:function(){var e,t,n=this;S(v(i.prototype),"afterCreate",this).call(this),this._autoRealDefinition=void 0,null===(e=this.refreshDefinitionList)||void 0===e||e.call(this),(this.playerData.isOpenABR()||"dash"===(null===(t=this.playerData.getStreamType())||void 0===t?void 0:t.toLowerCase()))&&this.on("resourceReady",this.handleResourceReady),this.playerData.isOpenABR()&&(this.on("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange),(ir.os.isIos||this.player.plugins.dashplugin||this.player.plugins.mp4encryptplayer)&&(this.autoDefDetectTimer=new sc,this.autoDefDetectTimer.repeat(this.getAutoDefRealLevel.bind(this),1e3))),this.on(PM.PLAY_NEXT_START,(function(){n.definitionSubscribeId&&Sn.unsubscribeProperty(n.playerData.current,"definition",n.definitionSubscribeId),n.playListSubscribeId&&Sn.unsubscribeProperty(n.playerData,"playList",n.playListSubscribeId)})),this.on(PM.PLAY_NEXT_END,(function(){var e,t;null===(e=n.dataMonitoring)||void 0===e||e.call(n),null===(t=n.refreshDefinitionList)||void 0===t||t.call(n)}))}},{key:"getShowText",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(i)return this.playerData.isOpenABR()&&this.playerData.isAutoDefinition(i.definition)?(null===(e=this.playerData.configs)||void 0===e||null===(e=e.autoBitrateOpts)||void 0===e?void 0:e.autoDefinitionText)||t[i.definitionTextKey]||i.definition:t[i.definitionTextKey]||i.definition||i.definitionTextKey||n||"HD"}},{key:"getCurrentDefinitionInfo",value:function(e){var t=this,i={list:[],defaultDefinition:""},n=e.config.playerData,r=n.current,o=r.lineId,a=r.definition,s=n.getDefinitionListByLineId(o);return Array.isArray(s)&&s.length>0&&(i.list=s.map((function(i){return i.text||(i.text=t.getShowText(e.i18n,i,i.definition)),i}))),i.defaultDefinition=a,i}},{key:"showToast",value:function(e,t){var i,n=this,r=null===(i=this.player)||void 0===i?void 0:i.getPlugin("sdkToastPlugin");if(r){var o,a=this.getShowText(this.i18n,e,t);this.toastInfo&&(clearTimeout(this.toastInfo.timer),null==r||null===(o=r.remove)||void 0===o||o.call(r,this.toastInfo.id),this.player.off(Vr,this.toastInfo.remove),this.player.off(hr,this.toastInfo.remove)),this.toastInfo={id:r.add("".concat(this.langText.switching," ").concat(a,"..."),0,!0),showTime:Date.now(),delayClose:!1},this.toastInfo.timer=setTimeout((function(){r.remove(n.toastInfo.id),clearTimeout(n.toastInfo.timer)}),2e3),this.toastInfo.remove=function(){n.toastInfo.id&&(Date.now()-n.toastInfo.showTime>2e3?r.remove(n.toastInfo.id):n.toastInfo.delayClose=!0)},this.player.once(Vr,this.toastInfo.remove),this.player.once(hr,this.toastInfo.remove)}}},{key:"selectDefinition",value:function(e){var t,i,n=this,r=null===(t=this.renderList)||void 0===t||null===(i=t.find)||void 0===i||null===(i=i.call(t,(function(t){return n.playerData.isDefinitionMatch(t.definition,e.definition)})))||void 0===i?void 0:i.definitionTextKey;this.config.showToastOnManualClick&&this.showToast(a(a({},e),{},{definitionTextKey:r}),e.definition),this.playerData.current.definition=e.definition,this.playerData.isAutoDefinition(e.definition)||(this._autoRealDefinition=void 0)}},{key:"showRealDefinition",value:function(e){return e.selected&&this.playerData.isAutoDefinition(e.definition)&&this.playerData.showRealDefinition()&&this._autoRealDefinition&&!this.playerData.isAutoDefinition(this._autoRealDefinition)}},{key:"dataMonitoring",value:function(){var e=this;this.playerData&&(this.definitionSubscribeId=Sn.subscribeProperty(this.playerData.current,"definition",(function(t,i){if(t&&i&&t!==i&&e.player){var n=e.getCurrentDefinitionInfo(e.player).list.find((function(e){return e.definition===i}));n&&n.url&&(e.player.changeDefinition(a(a({},n),{},{definition:i,url:n.url})),"MOBILE"===e.clientType&&e.updatePanel(),e.player.emit(PM.INNER_DEFINITION_CHANGE,{from:t,to:i,url:n.url}),e.player.emit(PM.PlAY_URL_CHANGE,{url:n.url,from:PM.INNER_DEFINITION_CHANGE}),"PC"===e.clientType&&e.renderItemList(i),e.player.config.isLive&&(e._playTimer=setTimeout((function(){e.player.ended?e.player.replay():e.player.paused&&e.player.play()}),1e3)))}})),this.playListSubscribeId=Sn.subscribeProperty(this.playerData,"playList",(function(){e.refreshDefinitionList()})))}},{key:"getAutoDefRealLevel",value:function(){var e;if(this.playerData.isAutoDefinition(null===(e=this.playerData.current)||void 0===e?void 0:e.definition)){var t=this.player.media,i=t.videoWidth,n=t.videoHeight;if(i&&n){var r=this.getCurrentDefinitionInfo(this.player).list,o=(void 0===r?[]:r).find((function(e){var t=e.vwidth||e.width,r=e.vheight||e.height;return t&&r&&t===i&&r===n}));null!=o&&o.definition&&this._autoRealDefinition!==o.definition&&(this._autoRealDefinition=o.definition,this.refreshDefinitionList(),"mobile"===ir.device&&(null==this||this.updatePanel()))}}}},{key:"onItemClick",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=S(v(i.prototype),"onItemClick",this)).call.apply(e,[this].concat(n))}},{key:"destroy",value:function(){clearTimeout(this.toastInfo.timer),clearTimeout(this._playTimer),this.autoDefDetectTimer&&(this.autoDefDetectTimer.clear(),this.autoDefDetectTimer=null,this.getAutoDefRealLevel=null),this.off("resourceReady",this.handleResourceReady),this.off("ABR_AUTO_DESC_CHANGE",this.handleABRDescChange)}}]),i}(e)},QM=function(e){g(i,e);var t=k(i);function i(e){var n;h(this,i);var r=e.config.className;return(n=t.call(this,a(a({},e),{},{config:a(a({},e.config),r?{className:"".concat(r," xgplayer-definition-plugin-pc")}:{}),clientType:"PC"}))).onItemClick=JM(n.onItemClick.bind(_(n)),1e3,{trailing:!0}),n}return f(i,[{key:"registerLanguageTexts",value:function(){return{switching:{jp:"ã«åãæ¿ãã",en:"Switching to",zh:"æ£å¨åæ¢è³","zh-
1hk":"æ£å¨åæè³"}}}},{key:"afterCreate",value:function(){S(v(i.prototype),"afterCreate",this).call(this)}},{key:"refreshDefinitionList",value:function(){var e;null!==(e=this.player.config)&&void 0!==e&&e.alwaysShowDefinition&&(this.config.alwaysShowDefinition=!0);var t=this.getCurrentDefinitionInfo(this.player),i=t.defaultDefinition,n=t.list;this.config.defaultDefinition=i,this.config.list=n.map((function(e,t){return a(a({},e),{},{itemIndex:t})})),this.config.list&&this.config.list.length>0&&(this.config.list.length<2?this.config.alwaysShowDefinition?(this.renderItemList(),this.show()):this.hide():(this.renderItemList(),this.show()))}},{key:"show",value:function(){var e;!this.config.list||(null===(e=this.config.list)||void 0===e?void 0:e.length)<2&&!this.config.alwaysShowDefinition||qn.addClass(this.root,"show")}},{key:"afterPlayerInit",value:function(){}},{key:"renderItemList",value:function(e){var t=this;if(!Array.isArray(e)){var n=this.config,r=n.list,o=n.defaultDefinition,a=0,s=r.map((function(i,n){var r={url:i.url,definition:i.definition||"",definitionTextKey:i.definitionTextKey,showText:t.getShowText(t.i18n,i,i.definition),isCurrent:!1,selected:!1,isDefinitionAuto:!1},s="string"==typeof e?i.definition===e:void 0===e&&i.definition===o;if(!qn.isUndefined(i.definition)&&s&&(r.isCurrent=!0,r.selected=!0,a=n),t.showRealDefinition(r)){var l,c=null===(l=t.renderList)||void 0===l?void 0:l.find((function(e){return t.playerData.isDefinitionMatch(null==e?void 0:e.definition,t._autoRealDefinition)})),u=t.getShowText(t.i18n,c,null==c?void 0:c.definition);r.showText=u?"".concat(r.showText,"(").concat(u,")"):r.showText}return r.isDefinitionAuto=t.playerData.isAutoDefinition(i.definition),r}));this.renderList=s,S(v(i.prototype),"renderItemList",this).call(this,s,a)}}},{key:"onItemClick",value:function(e,t){if(t.to.definition!==this.playerData.current.definition){var i,n=null===(i=this.playerData.getCurrentStreams())||void 0===i?void 0:i[0];this.emitUserAction(e,"change_definition",{from:n,to:t.to}),this.selectDef(t.to)}}},{key:"selectDef",value:function(e){this.selectDefinition(e),"ontouchstart"in window&&this.optionsList.hide()}},{key:"changeDefinition",value:function(e){var t=this,i=this.renderList.find((function(i){return t.playerData.isDefinitionMatch(i.definition,e)}));i&&this.selectDef(i)}},{key:"destroy",value:function(){S(v(i.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"sdkDefinitionPlugin"}},{key:"defaultConfig",get:function(){return{position:Bo.POSITIONS.CONTROLS_RIGHT,index:LM,list:[],defaultDefinition:"",hidePortrait:!1,disable:!1,showToastOnManualClick:!0,className:"xgplayer-definition xgplayer-definition-plugin-pc",isShowIcon:!0,isNeedAuto:!0,allowedSize:null,alwaysShowDefinition:!1}}}]),i}(ZM(Ws));function eN(){return(new DOMParser).parseFromString('<svg width="19" height="16" viewBox="0 0 19 15" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_18_7532)" filter="url(#filter0_d_18_7532)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M9.33333 3.19115C9.33333 2.79702 8.91856 2.54067 8.56604 2.71694L4.66668 4.66662C4.66667 4.66662 4.66667 4.66663 4.66667 4.66663C4.66667 4.66664 4.66666 4.66665 4.66665 4.66665H3.19685C2.90404 4.66665 2.66666 4.90402 2.66666 5.19684V9.4698C2.66666 9.76261 2.90404 9.99998 3.19685 9.99998H4.55791C4.62971 9.99998 4.70076 10.0146 4.76676 10.0429L8.5943 11.6832C8.94415 11.8332 9.33333 11.5765 9.33333 11.1959V3.19115Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M13 6.87773L14.8934 4.7138C14.9485 4.6509 15.0377 4.6509 15.0927 4.7138L15.2921 4.94158C15.3471 5.00448 15.3471 5.10646 15.2921 5.16936L13.3986 7.33329L15.2921 9.49722C15.3471 9.56012 15.3471 9.6621 15.2921 9.725L15.0927 9.95278C15.0377 10.0157 14.9485 10.0157 14.8934 9.95278L13 7.78886L11.1066 9.95278C11.0515 10.0157 10.9623 10.0157 10.9073 9.95278L10.7079 9.725C10.6529 9.6621 10.6529 9.56012 10.7079 9.49722L12.6014 7.33329L10.7079 5.16936C10.6529 5.10646 10.6529 5.00448 10.7079 4.94158L10.9073 4.7138C10.9623 4.6509 11.0515 4.6509 11.1066 4.7138L13 6.87773Z" fill="white" stroke="white" stroke-width="0.530187"/>\n </g>\n <defs>\n <filter id="filter0_d_18_7532" x="-0.666667" y="0" width="19.3333" height="19.3333" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
1\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n <feOffset dy="2.66667"/>\n <feGaussianBlur stdDeviation="1.33333"/>\n <feComposite in2="hardAlpha" operator="out"/>\n <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>\n <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_18_7532"/>\n <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_18_7532" result="shape"/>\n </filter>\n <clipPath id="clip0_18_7532">\n <rect width="14" height="14" fill="white" transform="translate(2)"/>\n </clipPath>\n </defs>\n</svg>\n\n',"image/svg+xml").firstChild}var tN=ir.isWeixin,iN=ir.os,nN=ir.device,rN=iN.isAndroid,oN=iN.isIos,aN="mobile"===nN,sN=0,lN=!1,cN=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).state={mode:0,showUnmuteBt:!1},n.userClickPlay=function(){if(!lN){var e=n.player.play();e&&e.then?e.then((function(){Ul.log("user action autoplay success"),lN=!0})).catch((function(e){Ul.warn("user action autoplay fail:",e)})):(Ul.warn("no play promise"),lN=!0)}},n}return f(i,[{key:"afterCreate",value:function(){this.initState(),this.initEvents(),this.setWXAutoPlay()}},{key:"registerLanguageTexts",value:function(){return{unmute:{jp:"ãã¥ã¼ããè§£é¤ãã",en:"Click to unmute",zh:"ç¹å»åæ¶éé³","zh-hk":"黿忶éé³"},muted:{jp:"ãã¥ã¼ã",en:"muted",zh:"å·²éé³","zh-hk":"å·²éé³"}}}},{key:"registerIcons",value:function(){return{muted:{icon:eN,class:"xgplayer-muted-svg"}}}},{key:"updateLang",value:function(){this.renderUnmuteBt()}},{key:"initState",value:function(){var e=this.player.config,t=e.enableDegradeMuteAutoplay,i=e.enableWxJsBridgeAutoplay,n=e.enableUserActionAutoplay;t&&(this.config.enableDegradeMuteAutoplay=!0),i&&(this.config.enableWxJsBridgeAutoplay=!0),n&&(this.config.enableUserActionAutoplay=!0),this.state.mode=this.player.muted?1:0}},{key:"initEvents",value:function(){this.player.on(Pr,this.handleAutoplayPrevented.bind(this)),this.player.on(Dr,this.handleAutoplayStart.bind(this)),this.player.on(mr,this.handleVolumechange.bind(this)),this.setUserActionAutoPlay()}},{key:"setWXAutoPlay",value:function(){tN&&this.player.config.autoplay&&this.config.enableWxJsBridgeAutoplay&&(window.WeixinJSBridge?this.wxPlay():document.addEventListener("WeixinJSBridgeReady",this.wxPlay.bind(this),!1))}},{key:"wxCanPlayFn",value:function(){var e=this;window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getNetworkType",{},(function(){e.wxTimer=setTimeout((function(){e.wxTimer&&clearTimeout(e.wxTimer);var t=e.player.play();t&&t.then?t.then((function(){Ul.log("wechat autoplay success")})).catch((function(t){Ul.warn("wechat autoplay fail:",t),e.state.showUnmuteBt=!1,e.renderUnmuteBt()})):Ul.warn("wechat browser no play promise")}))}))}},{key:"wxPlay",value:function(){this.player.readyState>=2?this.wxCanPlayFn():rN?this.player.once(vr,this.wxCanPlayFn.bind(this)):oN&&this.player.once(Or,this.wxCanPlayFn.bind(this))}},{key:"setUserActionAutoPlay",value:function(){var e,t=this;null!==(e=this.config)&&void 0!==e&&e.enableUserActionAutoplay&&this.player.once(PM.AUTOPLAY_FAILED,(function(){t.hasSetUserAutoplay=!0,(t.config.userActionDom instanceof window.Node?t.config.userActionDom:window.document.body).addEventListener("click",t.userClickPlay,!1)}))}},{key:"handleAutoplayPrevented",value:function(){return 0===this.state.mode?(Ul.warn("unmute autoplay fail"),this.player.emit(PM.AUTOPLAY_FAILED,{mode:"unmute"}),rN&&tN?void(this.state.mode=2):void(this.config.enableDegradeMuteAutoplay&&this.changeMuteMode())):1===this.state.mode?(Ul.warn("mute autoplay fail"),this.player.emit(PM.AUTOPLAY_FAILED,{mode:"mute"}),void(this.state.mode=2)):2===this.state.mode?(this.player.emit(PM.AUTOPLAY_FAILED,{mode:"noSupport"}),void Ul.warn("not support autoplay")):void 0}},{key:"changeMuteMode",value:function(){var e=this;this.player.muted=!0,this.state.showUnmuteBt=!0,this.state.mode=1,this.renderUnmuteBt(),this.timer=setTimeout((function(){e.timer&&clearTimeout(e.timer);var t=e.player.play();t&&t.then?t.then((function(){Ul.log("degrade mute autoplay success")})).catch((function(t){Ul.warn("degrade mute autoplay fail:",t),e.player.muted=!1,e.state.showUnmuteBt=!1,e.renderUnmuteBt()})):Ul.warn("no play promise")}))}},{key:"handleAutoplayStart",value:function(){if(0!==this.state.mode)return 1===this.state.mode?(this.player.emit(PM.AUTOPLAY_SUCCESS,{mode:"mute"}),this.state.showUnmuteBt=!0,void this.renderUnmuteBt()):2===this.state.mode?(this.player.emit(PM.AUTOPLAY_SUCCESS,{mode:"click"}),this.player.muted=!1,this.state.showUnmuteBt=!1,void this.renderUnmuteBt()):void 0;this.player.emit(PM.AUTOPLAY_SUCCESS,{mode:"unmute"})}},{key:"handleVolumechange",value:function(e){this.state.showUnmuteBt&&(this.state.showUnmuteBt=!1,this.renderUnmuteBt(),this.player.paused&&this.player.readyState>=1&&this.player.play())}},{key:"renderUnmuteBt",value:function(){var e=this.root;if(e&&(e.innerHTML="",this.state.showUnmuteBt&&this.config.showUnmuteBtn)){var t=this.langText.unmute,i=qn.createDom("div",t,void 0,"xgplayer-unmute-bt");e.appendChild(i),this.bind(".xgplayer-unmute-bt","click",this.cancelUnmute.bind(this)),this.bind(".xgplayer-unmute-bt","touchend",this.cancelUnmute.bind(this))}}},{key:"cancelUnmute",value:function(e){var t,i,n=Date.now();n-sN>200&&(sN=n,this.player.muted=!1,this.state.showUnmuteBt=!1,this.renderUnmuteBt(),"mobile"===ir.device&&"string"==typeof(null===(t=this.player)||void 0===t||null===(t=t.config)||void 0===t?void 0:t.url)&&uc(null===(i=this.player)||void 0===i||null===(i=i.config)||void 0===i?void 0:i.url)&&(this.player.volume>.5?this.player.volume=this.player.volume-.1:this.player.volume=this.player.volume+.1),this.emitUserAction(e,"cancel_mute"))}},{key:"destroy",value:function(){if(this.player.off(Pr,this.handleAutoplayPrevented.bind(this)),this.player.off(Dr,this.handleAutoplayStart.bind(this)),this.player.off(mr,this.handleVolumechange.bind(this)),this.timer&&window.clearTimeout(this.timer),this.wxTimer&&window.clearTimeout(this.wxTimer),document.removeEventListener("WeixinJSBridgeReady",this.wxPlay.bind(this),!1),this.hasSetUserAutoplay){var e=aN?"touch":"click";(this.config.userActionDom instanceof window.Node?this.config.userActionDom:window.document.body).removeEventListener(e,this.userClickPlay,!1)}}},{key:"render",value:function(){return'<div class="xgplayer-unmute"></div>'}}],[{key:"pluginName",get:function(){return"AutoplayPlugin"}},{key:"defaultConfig",get:function(){return{position:Bo.POSITIONS.ROOT,enableDegradeMuteAutoplay:!1,enableWxJsBridgeAutoplay:!1,userActionDom:window.document.body,enableUserActionAutoplay:!1,showUnmuteBtn:!0}}}]),i}(Bo);function uN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 2.488a7.48 7.48 0 00-4.154 1.253.908.908 0 101.005 1.512 5.695 5.695 0 018.844 4.746h-.908a.33.33 0 00-.264.528l1.816 2.422a.33.33 0 00.529 0l1.815-2.422A.33.33 0 0018.42 10h-.908A7.511 7.511 0 0010 2.49zM2.489 10a7.511 7.511 0 0011.665 6.26.908.908 0 00-1.005-1.513A5.695 5.695 0 014.305 10h.908a.33.33 0 00.264-.528L3.66 7.05a.33.33 0 00-.528 0L1.317 9.47a.33.33 0 00.264.53h.908z" fill="#fff"/></svg>',"image/svg+xml").firstChild}var hN=Bo.POSITIONS,dN=function(e){g(i,e);var t=k(i);function i(){return h(this,i),t.apply(this,arguments)}return f(i,[{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.refresh),this.initEvents()}},{key:"registerIcons",value:function(){return{refresh:{icon:uN,class:"xgplayer-refresh-svg"}}}},{key:"registerLanguageTexts",value:function(){return{refresh:{jp:"ãªãã¬ãã·ã¥",en:"Refresh",zh:"å·æ°","zh-hk":"å·æ°"}}}},{key:"initEvents",value:function(){this.handleRefresh=XM(this.handleRefresh.bind(this),200);var e="mobile"===ir.device?"touchend":"click";this.bind(e,this.handleRefresh),this.show()}},{key:"handleRefresh",value:function(e){var t=this.player;t&&(e.preventDefault(),e.stopPropagation(),t.addClass("xgplayer-is-enter"),t.pause(),t.emit(PM.REFRESH_CLICK),setTimeout((function(){t&&t.retry(),t.once("canplay",(function(){t.removeClass("xgplayer-is-enter")}))})))}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.handleRefresh)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-refresh">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="refresh">'.concat(this.langText.refresh,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"refresh"}},{key:"defaultConfig",get:function(){return{position:hN.CONTROLS_LEFT,index:1}}}]),i}(Bo);function fN(){return(new DOMParser).parseFromString('<svg width="18" height="18" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M5.75 11C5.75 11.9665 4.9665 12.75 4 12.75C3.0335 12.75 2.25 11.9665 2.25 11C2.25 10.0335 3.0335 9.25 4 9.25C4.9665 9.25 5.75 10.0335 5.75 11ZM13.25 11C13.25 11.9665 12.4665 12.75 11.5 12.75C10.5335 12.75 9.75 11.9665 9.75 11C9.75 10.0335 10.5335 9.25 11.5 9.25C12.4665 9.25 13.25 10.0335 13.25 11ZM19 12.75C19.9665 12.75 20.75 11.9665 20.75 11C20.75 10.0335 19.9665 9.25 19 9.25C18.0335 9.25 17.25 10.0335 17.25 11C17.25 11.9665 18.0335 12.75 19 12.75Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var pN,gN,vN,yN,mN=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).panel=null,n.panelContainer=null,n}return f(i,[{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"afterCreate",value:function(){this.renderMoreIcon()}},{key:"updateLang",value:function(e){if(this.panelContainer){var t=this.panelContainer.querySelectorAll(".panel-icon-bt-text"),i=this.getAndSplitList().extraList;t.forEach((function(t){var n,r=Number(t.getAttribute("plugin-index"));null!==(n=i[r])&&void 0!==n&&null!==(n=n.textTips)&&void 0!==n&&n[e]&&(t.innerHTML=i[r].textTips[e])}))}}},{key:"registerIcons",value:function(){return{more:{icon:fN,class:"xgplayer-more-svg"}}}},{key:"getAndSplitList",value:function(){var e,t,i,n,r,o=(null!==(e=this.player.config.ignores)&&void 0!==e?e:[]).map((function(e){return e.toLowerCase()})),a=this.config.iconPlugins.filter((function(e){return!o.includes(e.pluginName.toLowerCase())}));return a.length>this.config.maxShowNum+1?(n=a.slice(0,this.config.maxShowNum),r=a.slice(-(a.length-this.config.maxShowNum))):n=E(a),{list:null!==(t=n)&&void 0!==t?t:[],extraList:null!==(i=r)&&void 0!==i?i:[]}}},{key:"children",value:function(){var e=this,t=this.getAndSplitList().list,i={};return t.forEach((function(t){i[t.pluginName]={plugin:t,options:{root:e.root}}})),i}},{key:"renderMoreIcon",value:function(){var e=this,t=this.getAndSplitList().extraList;if(0!==t.length){var i=this.root,n=qn.createDom("div","",{},"xgplayer-icon");n.appendChild(this.icons.more),n.addEventListener("click",(function(){e.renderPanel(t)}));var r=qn.createDom("xg-icon","",{"data-index":0},"xgplayer-more");r.appendChild(n),i.appendChild(r)}}},{key:"renderPanel",value:function(e){var t=this;this.panelContainer||(this.panelContainer=qn.createDom("div","",{},"panel-content"),e.forEach((function(e,i){var n,r,o=qn.createDom("div","",{},"panel-icon-bt"),a=qn.createDom("div","",{},"panel-icon-svg");o.appendChild(a),t.registerExtraPlugin(e,a);var s="zh-cn"===t.player.lang?"zh":t.player.lang,l=null!==(n=null===(r=e.textTips)||void 0===r?void 0:r[s])&&void 0!==n?n:e.pluginName;o.appendChild(qn.createDom("span",l,{"plugin-index":i},"panel-icon-bt-text")),t.panelContainer.appendChild(o)}))),this.player.panel.showPanel(this.panelContainer)}},{key:"registerExtraPlugin",value:function(e,t){this.player.registerPlugin({plugin:e,options:{root:t}})}},{key:"destroy",value:function(){}},{key:"render",value:function(){return'<div class="xgplayer-rightTop-iconList"></div>'}}],[{key:"pluginName",get:function(){return"MoreButtonPlugin"}},{key:"defaultConfig",get:function(){return{position:Bo.POSITIONS.ROOT_TOP,iconPlugins:[],maxShowNum:2}}}]),i}(Bo);function _N(){return(new DOMParser).parseFromString('<svg width="150" height="162" viewBox="0 0 150 162" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M127.718 112.831H6.13675C4.19663 112.831 2.25651 108.974 2.90322 104.475C3.54993 99.9761 8.07687 99.9761 13.8972 99.9761C11.9571 97.4052 9.37028 88.4069 15.8373 81.3369C22.3044 74.2668 25.5379 74.2668 34.5918 75.5526C33.9451 63.9837 47.526 34.4178 77.2744 35.0605C107.023 35.7032 116.077 54.3421 119.957 63.3404C129.011 62.6976 147.765 66.554 149.706 87.1214C151.258 103.575 135.694 111.117 127.718 112.831Z" fill="#F1F4F8"/>
1\n<path d="M44.9346 91.6022L43.6782 99.8032" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M47.3545 125.695L48.6109 117.494" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M31.5347 97.7378L38.7295 101.869" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M60.7544 119.559L53.5595 115.428" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n<path d="M69.6755 44.5318L138.35 26.0209C139.115 25.8148 139.804 26.5367 139.563 27.2909L121.081 85.1146C120.982 85.4243 120.739 85.6665 120.429 85.7641L52.0645 107.28C51.2996 107.521 50.5766 106.809 50.8062 106.04L68.9776 45.2111C69.0768 44.879 69.3409 44.622 69.6755 44.5318Z" fill="#D0D6E0" stroke="#D0D6E0" stroke-width="4" stroke-linecap="round"/>\n<path d="M83.1285 52.7415C91.6454 54.3438 107.322 62.0019 101.894 79.8155" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<path d="M84.138 62.3385C88.3894 63.1384 96.2148 66.9611 93.5053 75.8531" stroke="white" stroke-width="3" stroke-linecap="round"/>\n<ellipse cx="83.6417" cy="71.98" rx="3.08443" ry="3.07025" transform="rotate(12.6375 83.6417 71.98)" fill="white"/>\n<path d="M43.4699 110.358C39.5425 109.114 30.6316 108.203 26.4077 114.511C21.1278 122.397 36.5031 152.755 2.11053 160.141" stroke="#D0D6E0" stroke-width="2" stroke-linecap="round"/>\n</svg>\n',"image/svg+xml").firstChild}var bN=[{LANG:"en",TEXT:(pN={},p(pN,"MEDIA_ERR_SRC_NOT_SUPPORTED","Audio/video is not supported or no playable source found"),p(pN,"GET_URL_ERR_BY_TOKEN to get video url","Failed to get video url"),p(pN,"PLAY_AUTH_TOKEN_EXPIRED has expired","Token has expired"),p(pN,"HLS_KEY_TOKEN_EXPIRED","Play certificate has expired"),p(pN,"MEDIA_SOURCE_CANNOT_PLAY_TYPE","Video type cannot play"),p(pN,"NETWORK_ERROR","Network error"),p(pN,"NETWORK_TIMEOUT","Network timeout"),p(pN,"VOD_LOG_NOT_CONFIGURED","Log options not configured correctly"),p(pN,"DEFINITION_AUTO","Auto"),p(pN,"BUSINESS_DRM_NOT_SUPPORT","DRM encrypted playback is not supported"),p(pN,"BUSINESS_DRM_NOT_SUPPORT_UN_RECORD","Anti-screen recording is not supported"),p(pN,"BUSINESS_DRM_LACK_MEDIA_KEY","The video data lacks the corresponding MediaKey"),p(pN,"BUSINESS_DRM_LACK_KEY_SESSION","The browser does not support the corresponding DRM KeySession"),p(pN,"BUSINESS_DRM_GENERATE_REQUEST_FAIL","Decryption playback error"),p(pN,"BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH","Missing DRM certificate request link"),p(pN,"BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH","Missing DRM License request link"),p(pN,"BUSINESS_DRM_LICENSE_FAIL","Failed to request or update a license"),p(pN,"BUSINESS_DRM_KEY_ERROR","Decryption Error"),p(pN,"BUSINESS_DRM_CERT_FAIL","Failed to request DRM certificate"),pN)},{LANG:"zh",TEXT:(gN={},p(gN,"MEDIA_ERR_SRC_NOT_SUPPORTED","é³/è§é¢æ ¼å¼ä¸æ¯æï¼ææªæ¾å°å¯ç¨èµæº"),p(gN,"GET_URL_ERR_BY_TOKEN to get video url","è·åè§é¢å°å失败"),p(gN,"PLAY_AUTH_TOKEN_EXPIRED has expired","tokenå·²è¿æ"),p(gN,"HLS_KEY_TOKEN_EXPIRED","ææ¾åè¯å·²è¿æ"),p(gN,"MEDIA_SOURCE_CANNOT_PLAY_TYPE","䏿¯æçè§é¢æ ¼å¼"),p(gN,"NETWORK_ERROR","ç½ç»é误"),p(gN,"NETWORK_TIMEOUT","ç½ç»è¶
æ¶"),p(gN,"VOD_LOG_NOT_CONFIGURED","æªæ£ç¡®é
ç½®è´¨éæ¥å¿åæ°"),p(gN,"DEFINITION_AUTO","èªå¨"),p(gN,"BUSINESS_DRM_NOT_SUPPORT","DRMå 坿æ¾ä¸æ¯æ"),p(gN,"BUSINESS_DRM_NOT_SUPPORT_UN_RECORD","䏿¯æé²å½å±"),p(gN,"BUSINESS_DRM_LACK_MEDIA_KEY","è§é¢æ°æ®ç¼ºå°ç¸åºMediaKey"),p(gN,"BUSINESS_DRM_LACK_KEY_SESSION","æµè§å¨ä¸æ¯æç¸åºDRM KeySession"),p(gN,"BUSINESS_DRM_GENERATE_REQUEST_FAIL","è§£å¯ææ¾é误"),p(gN,"BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH","缺å°DRMè¯ä¹¦è¯·æ±é¾æ¥"),p(gN,"BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH","缺å°DRM License请æ±é¾æ¥"),p(gN,"BUSINESS_DRM_LICENSE_FAIL","è¯·æ±ææ´æ°License失败"),p(gN,"BUSINESS_DRM_KEY_ERROR","è§£å¯é误"),p(gN,"BUSINESS_DRM_CERT_FAIL","请æ±DRMè¯ä¹¦å¤±è´¥"),gN)},{LANG:"zh-hk",TEXT:(vN={},p(vN,"MEDIA_ERR_SRC_NOT_SUPPORTED","é³/è¦é »æ ¼å¼ä¸æ¯æï¼ææªæ¾å°å¯ç¨è³æº"),p(vN,"GET_URL_ERR_BY_TOKEN to get video url","ç²åè¦é »å°å失æ"),p(vN,"PLAY_AUTH_TOKEN_EXPIRED has expired","Tokenå·²éæ"),p(vN,"HLS_KEY_TOKEN_EXPIRED","ææ¾æèå·²éæ"),p(vN,"MEDIA_SOURCE_CANNOT_PLAY_TYPE","䏿¯æçè¦é »æ ¼å¼"),p(vN,"NETWORK_E
1RROR","網絡é¯èª¤"),p(vN,"NETWORK_TIMEOUT","網絡è¶
æ"),p(vN,"VOD_LOG_NOT_CONFIGURED","æªæ£ç¢ºé
ç½®è³ªéæ¥èªåæ¸"),p(vN,"DEFINITION_AUTO","èªå"),p(vN,"BUSINESS_DRM_NOT_SUPPORT","DRMå 坿æ¾ä¸æ¯æ´"),p(vN,"BUSINESS_DRM_NOT_SUPPORT_UN_RECORD","䏿¯æ´é²éå±"),p(vN,"BUSINESS_DRM_LACK_MEDIA_KEY","è¦è¨è³æç¼ºå°å°æMediaKey"),p(vN,"BUSINESS_DRM_LACK_KEY_SESSION","ç覽å¨ä¸æ¯æ´å°æDRM KeySession"),p(vN,"BUSINESS_DRM_GENERATE_REQUEST_FAIL","è§£å¯ææ¾é¯èª¤"),p(vN,"BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH","缺å°DRMèæ¸è«æ±éæ¥"),p(vN,"BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH","缺å°DRM Licenseè«æ±éæ¥"),p(vN,"BUSINESS_DRM_LICENSE_FAIL","è«æ±ææ´æ°License失æ"),p(vN,"BUSINESS_DRM_KEY_ERROR","è§£å¯é¯èª¤"),p(vN,"BUSINESS_DRM_CERT_FAIL","è«æ±DRMèæ¸å¤±æ"),vN)},{LANG:"jp",TEXT:(yN={},p(yN,"MEDIA_ERR_SRC_NOT_SUPPORTED","ãªã¼ãã£ãª/ãããªå½¢å¼ããµãã¼ãããã¦ããªãããå©ç¨å¯è½ãªãªã½ã¼ã¹ãè¦ã¤ããã¾ããã§ãã"),p(yN,"GET_URL_ERR_BY_TOKEN to get video url","åç»ã® URL ãåå¾ã§ãã¾ããã§ãã"),p(yN,"PLAY_AUTH_TOKEN_EXPIRED has expired","playAuthTokenã¯æéåãã§ã"),p(yN,"HLS_KEY_TOKEN_EXPIRED","ãã¬ã¤è¨¼ææ¸ã®æå¹æéãåãã¦ãã¾ã"),p(yN,"MEDIA_SOURCE_CANNOT_PLAY_TYPE","ãµãã¼ãããã¦ããªããããªå½¢å¼"),p(yN,"NETWORK_ERROR","ãããã¯ã¼ã¯ã¨ã©ã¼"),p(yN,"NETWORK_TIMEOUT","ãããã¯ã¼ã¯ã¿ã¤ã ã¢ã¦ã"),p(yN,"VOD_LOG_NOT_CONFIGURED","å質ãã°ãã©ã¡ã¼ã¿ãæ£ããæ§æããã¦ãã¾ãã"),p(yN,"DEFINITION_AUTO","èªå"),p(yN,"BUSINESS_DRM_NOT_SUPPORT","DRMæå·ååçã«ã¯å¯¾å¿ãã¦ããã¾ãã"),p(yN,"BUSINESS_DRM_NOT_SUPPORT_UN_RECORD","ç»é¢é²ç»ä¿è·ã¯ãµãã¼ããã¦ãã¾ãã"),p(yN,"BUSINESS_DRM_LACK_MEDIA_KEY","ãã㪠ãã¼ã¿ã«å¯¾å¿ãã MediaKey ãããã¾ãã"),p(yN,"BUSINESS_DRM_LACK_KEY_SESSION","ãã©ã¦ã¶ã¯å¯¾å¿ãã DRM KeySession ããµãã¼ããã¦ãã¾ãã"),p(yN,"BUSINESS_DRM_GENERATE_REQUEST_FAIL","復å·ååçã¨ã©ã¼"),p(yN,"BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH","DRM è¨¼ææ¸ãªã¯ã¨ã¹ãã®ãªã³ã¯ãããã¾ãã"),p(yN,"BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH","DRM ã©ã¤ã»ã³ã¹è¦æ±ãªã³ã¯ãããã¾ãã"),p(yN,"BUSINESS_DRM_LICENSE_FAIL","ã©ã¤ã»ã³ã¹ã®è¦æ±ã¾ãã¯æ´æ°ã«å¤±æãã¾ãã"),p(yN,"BUSINESS_DRM_KEY_ERROR","復å·åã¨ã©ã¼"),p(yN,"BUSINESS_DRM_CERT_FAIL","DRM è¨¼ææ¸ã®è¦æ±ã«å¤±æãã¾ãã"),yN)}],kN={4:"MEDIA_ERR_SRC_NOT_SUPPORTED",2100:"NETWORK_ERROR",2101:"NETWORK_TIMEOUT",9100:"GET_URL_ERR_BY_TOKEN to get video url",9101:"PLAY_AUTH_TOKEN_EXPIRED has expired",9102:"HLS_KEY_TOKEN_EXPIRED",9103:"PLAY_AUTH_TOKEN_EXPIRED has expired",5200:"MEDIA_SOURCE_CANNOT_PLAY_TYPE",9999:"VOD_LOG_NOT_CONFIGURED",7101:"BUSINESS_DRM_NOT_SUPPORT",7102:"BUSINESS_DRM_NOT_SUPPORT_UN_RECORD",7103:"BUSINESS_DRM_LACK_MEDIA_KEY",7104:"BUSINESS_DRM_LACK_KEY_SESSION",7105:"BUSINESS_DRM_GENERATE_REQUEST_FAIL",7106:"BUSINESS_DRM_LACK_SERVER_CERTIFICATE_PATH",7107:"BUSINESS_DRM_LACK_SERVER_PROCESSSPC_PATH",7108:"BUSINESS_DRM_LICENSE_FAIL",7109:"BUSINESS_DRM_KEY_ERROR",7110:"BUSINESS_DRM_CERT_FAIL"},wN=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).state={showError:!1,retryTimes:0,idx:0},n._errDetailList=[],n.playerData=e.player.config.playerData,n}return f(i,[{key:"afterCreate",value:function(){var e,t,i=this;this.initEvents();var n=Object.entries(kN).reduce((function(e,t){var n=T(t,2),r=n[0],o=n[1];return e[r]=i.i18n[o],e}),{});this.errNoteMap=a({other:null!==(e=null===(t=this.i18n.ERROR_TYPES)||void 0===t||null===(t=t.other)||void 0===t?void 0:t.msg)&&void 0!==e?e:"error",1:this.i18n.MEDIA_ERR_ABORTED,5101:this.i18n.MEDIA_ERR_ABORTED,2:this.i18n.MEDIA_ERR_NETWORK,5102:this.i18n.MEDIA_ERR_NETWORK,3:this.i18n.MEDIA_ERR_DECODE,5103:this.i18n.MEDIA_ERR_DECODE},n)}},{key:"registerLanguageTexts",value:function(){return{clickButton:{jp:"ãªãã¬ãã·ã¥",en:"Refresh",zh:"å·æ°","zh-hk":"å·æ°"},errorTips:{jp:"åçä¸ã«ã¨ã©ã¼ãçºçãã¾ããã[æ´æ°]ãã¯ãªãã¯ãã¦è©¦ãã¦ãã ãã",en:"An error occurred while playing, click refresh to try",zh:"ææ¾åçé误ï¼ç¹å»å·æ°è¯è¯å§","zh-hk":"ææ¾ç¼çé¯èª¤ï¼é»æå·æ°è©¦è©¦å§"}}}},{key:"registerIcons",value:function(){return{errorImg:{icon:_N,class:"xgplayer-error-svg"}}}},{key:"updateLang",value:function(){if(this.$errorDom){var e=this.$errorDom.querySelector(".xgplayer-error-tips");if(e){var t,i,n=null!==(t=null===(i=this.config.errorTipsText)||void 0===i?void 0:i[this.lang])&&void 0!==t?t:this.langText.errorTips;e.innerHTML=n}var r=this.$errorDom.querySelector(".xgplayer-error-button");r&&(r.innerHTML=this.langText.clickButton)}}},{key:"initEvents",value:function(){this.player.on(hr,this.handleError.bind(this)),this.playerData.isLive&&(this.player.on(cr,this.handleEnd.bind(this)),this.player.on(PM.REFRESH_CLICK,this.closeError.bind(this))),this.on(vr,this.closeError.bind(this)),this.on(pr,this.closeError.bind(this))}},{key:"handleError",value:function(e){this.isVodLogConError=9999===(null==e?void 0:e.errorCode),this.player&&this.player.pause(),this.config.isNeedDemoteBack?(this.state.showError=!1,this.changeMainOrBackup()):this.state.showError=!0,this.renderError(e)}},{key:"handleEnd",value:function(){this.player&&this.player.pause(),this.config.isNeedDemoteBack&&this.changeMainOrBackup()}},{key:"getRetryList",value:function(){var e,t=this.playerData.getCurrentStreams()[0];return[null==t?void 0:t.url].concat(E(null!==(e=null==t?void 0:t.backUrlList)&&void 0!==e?e:[]))}},{key:"changeMainOrBackup",value:function(){var e=this;this.player.addClass(Fo.ENTER);var t=this.getRetryList(),i=this.config.retryLoopNum*t.length,n=(t.indexOf(this.player.config.url)+1)%t.length;this.state.idx=n;var r=t[n];if(!r||this.state.retryTimes===i)return this.player.removeClass(Fo.ENTER),this.state.retryTimes===i&&this.player.emit(PM.PLAY_BACKUP_CHANGE_FINISH),this.state.showError=!0,this.renderError(),void this.resetTimes();this.player.once("canplay",(function(){e.state.retryTimes=0})),Ul.log("éè¯ç¬¬".concat(this.state.retryTimes,"次"),r),this.player.emit(PM.PLAY_BACKUP_CHANGE,{currentUrl:this.player.config.url,nextUrl:r,retryTimes:this.state.retryTimes}),this.changeUrl(r),this.state.retryTimes=this.state.retryTimes+1}},{key:"changeUrl",value:function(e){this.player.config.url=e,this.player.switchURL(e,!1),this.player.emit(PM.PlAY_URL_CHANGE,{url:e,from:PM.PLAY_BACKUP_CHANGE})}},{key:"resetTimes",value:function(){this.state.retryTimes=0,this.state.idx=0}},{key:"renderError",value:function(e){var t=this.root;t&&(t.innerHTML="",t.style.display="none",(this.state.showError||this.isVodLogConError)&&(this.player.emit(PM.SHOW_PLAY_ERROR),t.style.display="block",t.appendChild(this.getErrorDom(e))),this.isVodLogConError&&(this.player.blur(),this.player.pause()))}},{key:"addErrDetail",value:function(e){Array.isArray(e)?this._errDetailList=[].concat(E(this._errDetailList),E(e)):this._errDetailList.push(e)}},{key:"getErrorDom",value:function(e){var t=this;if(!this.$errorDom){var i,n;if(this.$errorDom=qn.createDom("div","",void 0,"xgplayer-error-cover"),this.config.errorImg){var r=qn.createDom("div","",void 0,"xgplayer-error-img");r.appendChild(this.icons.errorImg),this.$errorDom.appendChild(r)}if(this.config.errorTips){var o,a,s="";if(null!==(o=this.config)&&void 0!==o&&null!==(o=o.errorTipsText)&&void 0!==o&&o[this.lang])s=null===(a=this.config.errorTipsText)||void 0===a?void 0:a[this.lang];else if(e){var l=e.errorCode,c=e.message||e.msg;s=this.errNoteMap[l]||this.player.errorNote&&this.i18n[this.player.errorNote]||c||this.errNoteMap.other||"error"}else s=this.langText.errorTips;var u=qn.createDom("div",s,void 0,"xgplayer-error-tips");this.$errorDom.appendChild(u)}if(this.config.isNeedRefreshButton){var h=qn.createDom("div",this.langText.clickButton,void 0,"xgplayer-error-button");this.bind(".xgplayer-error-button","click",this.handleButtonClick.bind(this)),this.$errorDom.appendChild(h)}null!==(i=this._errDetailList)&&void 0!==i&&i.length&&(null===(n=this._errDetailList)||void 0===n||n.forEac
1h((function(e){var i="function"==typeof e?e():e;if(i){var n=qn.createDom("div","".concat(i.label,": ").concat(i.value),void 0,"xgplayer-error-detail-info");t.$errorDom.appendChild(n)}}))),this.emit("sdkerrorplugin_render",this.$errorDom)}return this.$errorDom}},{key:"handleButtonClick",value:function(){var e,t;null===(e=this.player)||void 0===e||e.emit(PM.PLAY_ERROR_BUTTON_CLICK),null===(t=this.player)||void 0===t||t.retry(),this.closeError()}},{key:"closeError",value:function(){this.state.showError&&(this.state.showError=!1,this.renderError())}},{key:"destroy",value:function(){this.player.off(hr,this.handleError.bind(this)),this.playerData.isLive&&this.player.off(cr,this.handleEnd.bind(this))}},{key:"render",value:function(){return'<xgplayer-error class="xgplayer-error"></xgplayer-error>'}}],[{key:"pluginName",get:function(){return"sdkErrorPlugin"}},{key:"defaultConfig",get:function(){return{errorImg:!0,errorTips:!0,isNeedRefreshButton:!0,isNeedDemoteBack:!1,retryLoopNum:1,errorTipsText:null,position:Bo.POSITIONS.ROOT}}}]),i}(Bo);function SN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 4.106h-13a.3.3 0 00-.3.3v11.186a.3.3 0 00.3.3h7.111v1.7H3.5a2 2 0 01-2-2V4.406a2 2 0 012-2h13a2 2 0 012 2V10h-1.7V4.406a.3.3 0 00-.3-.3zM6 7.722c0-.42.34-.76.76-.76h6.58a.76.76 0 110 1.52H6.76a.76.76 0 01-.76-.76zm0 3.037c0-.42.34-.759.76-.759h3.543a.76.76 0 110 1.519H6.76a.76.76 0 01-.76-.76z" fill="#fff"/><circle cx="15.1" cy="14.201" r="3.4" fill="#3370FF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.185 13.756a.5.5 0 01.707 0l.866.866 1.78-1.78a.5.5 0 11.707.707l-2.133 2.134a.5.5 0 01-.707 0l-1.22-1.22a.5.5 0 010-.707z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function TN(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 4.106h-13a.3.3 0 00-.3.3v11.186a.3.3 0 00.3.3h7.111v1.7H3.5a2 2 0 01-2-2V4.406a2 2 0 012-2h13a2 2 0 012 2V10h-1.7V4.406a.3.3 0 00-.3-.3zM6 7.722c0-.42.34-.76.76-.76h6.58a.76.76 0 110 1.52H6.76a.76.76 0 01-.76-.76zm0 3.037c0-.42.34-.759.76-.759h3.543a.76.76 0 110 1.519H6.759a.76.76 0 01-.759-.76zm7.202 2.303a2.2 2.2 0 003.011 3.011l-3.011-3.01zm3.915 1.992a2.2 2.2 0 00-2.896-2.896l2.896 2.896zm1.383-.879a3.4 3.4 0 11-6.8 0 3.4 3.4 0 016.8 0z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function EN(){return(new DOMParser).parseFromString('<svg fill="none" stroke="currentColor" stroke-width="4" viewBox="0 0 48 48" width="1em" height="1em"\n class="arco-icon arco-icon-refresh">\n <path\n d="M38.837 18C36.463 12.136 30.715 8 24 8 15.163 8 8 15.163 8 24s7.163 16 16 16c7.455 0 13.72-5.1 15.496-12M40 8v10H30">\n </path>\n</svg>',"image/svg+xml").firstChild}function CN(e){return e&&e.ownerDocument||document}function xN(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function DN(e,t){e.classList?e.classList.add(t):xN(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}var PN=!("undefined"==typeof window||!window.document||!window.document.createElement),ON=!1,IN=!1;try{var LN={get passive(){return ON=!0},get once(){return IN=ON=!0}};PN&&(window.addEventListener("test",LN,LN),window.removeEventListener("test",LN,!0))}catch(Kc){}function AN(e,t,i,n){if(n&&"boolean"!=typeof n&&!IN){var r=n.once,o=n.capture,a=i;!IN&&r&&(a=i.__once||function e(n){this.removeEventListener(t,e,o),i.call(this,n)},i.__once=a),e.addEventListener(t,a,ON?n:o)}e.addEventListener(t,i,n)}function RN(e){var t=CN(e);return t&&t.defaultView||window}function MN(e,t){return RN(e).getComputedStyle(e,t)}var NN=/([A-Z])/g;function BN(e){return e.replace(NN,"-$1").toLowerCase()}var UN=/^ms-/;function jN(e){return BN(e).replace(UN,"-ms-")}var HN=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function FN(e){return!(!e||!HN.test(e))}function VN(e,t){var i="",n="";if("string"==typeof t)return e.style.getPropertyValue(jN(t))||MN(e).getPropertyValue(jN(t));Object.keys(t).forEach((function(r){var o=t[r];
1o||0===o?FN(r)?n+=r+"("+o+") ":i+=jN(r)+": "+o+";":e.style.removeProperty(jN(r))})),n&&(i+="transform: "+n+";"),e.style.cssText+=";"+i}function zN(e,t,i,n){var r=n&&"boolean"!=typeof n?n.capture:n;e.removeEventListener(t,i,r),i.__once&&e.removeEventListener(t,i.__once,r)}function GN(e,t,i,n){return AN(e,t,i,n),function(){zN(e,t,i,n)}}function WN(e,t,i,n){if(void 0===i&&(i=!1),void 0===n&&(n=!0),e){var r=document.createEvent("HTMLEvents");r.initEvent(t,i,n),e.dispatchEvent(r)}}function KN(e,t,i,n){var r,o;null==i&&(o=-1===(r=VN(e,"transitionDuration")||"").indexOf("ms")?1e3:1,i=parseFloat(r)*o||0);var a=function(e,t,i){void 0===i&&(i=5);var n=!1,r=setTimeout((function(){n||WN(e,"transitionend",!0)}),t+i),o=GN(e,"transitionend",(function(){n=!0}),{once:!0});return function(){clearTimeout(r),o()}}(e,i,n),s=GN(e,"transitionend",t);return function(){a(),s()}}var YN={transition:"","transition-duration":"","transition-delay":"","transition-timing-function":""};function $N(e){var t=e.node,i=e.properties,n=e.duration,r=void 0===n?200:n,o=e.easing,a=e.callback,s=[],l={},c="";
1Object.keys(i).forEach((function(e){var t=i[e];FN(e)?c+=e+"("+t+") ":(l[e]=t,s.push(BN(e)))})),c&&(l.transform=c,s.push("transform")),r>0&&(l.transition=s.join(", "),l["transition-duration"]=r/1e3+"s",l["transition-delay"]="0s",l["transition-timing-function"]=o||"linear");var u=KN(t,(function(e){e.target===e.currentTarget&&(VN(t,YN),a&&a.call(this,e))}),r);return t.clientLeft,VN(t,l),{cancel:function(){u(),VN(t,YN)}}}var qN=(new Date).getTime(),XN="clearTimeout",JN=function(e){var t=(new Date).getTime(),i=Math.max(0,16-(t-qN)),n=setTimeout(e,i);return qN=t,n},ZN=function(e,t){return e+(e?t[0].toUpperCase()+t.substr(1):t)+"AnimationFrame"};PN&&["","webkit","moz","o","ms"].some((function(e){var t=ZN(e,"request");return t in window&&(XN=ZN(e,"cancel"),JN=function(e){return window[t](e)}),!!JN}));var QN,eB=function(e){"function"==typeof window[XN]&&window[XN](e)},tB=JN;function iB(e,t){if(!QN){var i=document.body,n=i.matches||i.matchesSelector||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector;QN=function(e,t){return n.call(e,t)}}return QN(e,t)}function nB(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}var rB=Function.prototype.bind.call(Function.prototype.call,[].slice),oB=Function.prototype.bind.call(Function.prototype.call,[].slice);function aB(e,t){return oB(e.querySelectorAll(t))}function sB(e){return"nodeType"in e&&e.nodeType===document.DOCUMENT_NODE}function lB(e){return"window"in e&&e.window===e?e:sB(e)&&e.defaultView||!1}function cB(e){var t="pageXOffset"===e?"scrollLeft":"scrollTop";return function(i,n){var r=lB(i);if(void 0===n)return r?r[e]:i[t];r?r.scrollTo(r[e],n):i[t]=n}}var uB=cB("pageXOffset"),hB=cB("pageYOffset");function dB(e){var t=CN(e),i={top:0,left:0,height:0,width:0},n=t&&t.documentElement;return n&&nB(n,e)?(void 0!==e.getBoundingClientRect&&(i=e.getBoundingClientRect()),i={top:i.top+hB(n)-(n.clientTop||0),left:i.left+uB(n)-(n.clientLeft||0),width:i.width,height:i.height}):i}function fB(e,t){var i=lB(e);return i?i.innerHeight:t?e.clientHeight:dB(e).height}var pB=/^(?:input|select|textarea|button)$/i;function gB(e,t,i){void 0===t&&(t=null),void 0===i&&(i=null);for(var n=[];e;e=e.nextElementSibling)if(e!==t){if(i&&iB(e,i))break;n.push(e)}return n}var vB,yB=function(e){return!!e&&"offsetParent"in e};function mB(e){for(var t=CN(e),i=e&&e.offsetParent;yB(i)&&"HTML"!==i.nodeName&&"static"===VN(i,"position");)i=i.offsetParent;return i||t.documentElement}function _B(){return _B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},_B.apply(this,arguments)}
1function bB(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function kB(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=bB(e.className,t):e.setAttribute("class",bB(e.className&&e.className.baseVal||"",t))}function wB(e,t){var i=VN(e,"position"),n="absolute"===i,r=e.ownerDocument;if("fixed"===i)return r||document;for(;(e=e.parentNode)&&!sB(e);){var o=n&&"static"===VN(e,"position"),a=(VN(e,"overflow")||"")+(VN(e,"overflow-y")||"")+VN(e,"overflow-x");if(!o&&/(auto|scroll)/.test(a)&&(t||fB(e)<e.scrollHeight))return e}return r||document}var SB=/ /gi,TB=/\xA0/g,EB=/\s+([^\s])/gm,CB={addEventListener:AN,removeEventListener:zN,triggerEvent:WN,animate:function(e,t,i,n,r){if(!("nodeType"in e))return $N(e);if(!t)throw new Error("must include properties to animate");return"function"==typeof n&&(r=n,n=""),$N({node:e,properties:t,duration:i,easing:n,callback:r})},filter:function(e,t){return function(i){var n=i.currentTarget,r=i.target;aB(n,e).some((function(e){return nB(e,r)}))&&t.call(this,i)}},listen:GN,style:VN,getComputedStyle:MN,attribute:function(e,t,i){if(e){if(void 0===i)return e.getAttribute(t);i||""===i?e.setAttribute(t,String(i)):e.removeAttribute(t)}},activeElement:function(e){void 0===e&&(e=CN());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(t){return e.body}},ownerDocument:CN,ownerWindow:RN,requestAnimationFrame:tB,cancelAnimationFrame:eB,matches:iB,height:fB,width:function(e,t){var i=lB(e);return i?i.innerWidth:t?e.clientWidth:dB(e).width},offset:dB,offsetParent:mB,position:function(e,t){var i,n={top:0,left:0};if("fixed"===VN(e,"position"))i=e.getBoundingClientRect();else{var r=t||mB(e);i=dB(e),"html"!==function(e){return e.nodeName&&e.nodeName.toLowerCase()}(r)&&(n=dB(r));var o=String(VN(r,"borderTopWidth")||0);n.top+=parseInt(o,10)-hB(r)||0;var a=String(VN(r,"borderLeftWidth")||0);n.left+=parseInt(a,10)-uB(r)||0}var s=String(VN(e,"marginTop")||0),l=String(VN(e,"marginLeft")||0);return _B({},i,{top:i.top-n.top-(parseInt(s,10)||0),left:i.left-n.left-(parseInt(l,10)||0)})},contains:nB,scrollbarSize:function(e){if((!vB&&0!==vB||e)&&PN){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),vB=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return vB},scrollLeft:uB,scrollParent:wB,scrollTo:function(e,t){var i=dB(e),n={top:0,left:0};if(e){var r=t||wB(e),o=lB(r),a=hB(r),s=fB(r,!0);o||(n=dB(r));var l=(i={top:i.top-n.top,left:i.left-n.left,height:i.height,width:i.width}).height,c=i.top+(o?0:a),u=c+l;a=a>c?c:u>a+s?u-s:a;var h=tB((function(){return hB(r,a)}));return function(){return eB(h)}}},scrollTop:hB,querySelectorAll:aB,closest:function(e,t,i){e.closest&&!i&&e.closest(t);var n=e;do{if(iB(n,t))return n;n=n.parentElement}while(n&&n!==i&&n.nodeType===document.ELEMENT_NODE);return null},addClass:DN,removeClass:kB,hasClass:xN,toggleClass:function(e,t){e.classList?e.classList.toggle(t):xN(e,t)?kB(e,t):DN(e,t)},transitionEnd:KN,childNodes:function(e){return e?rB(e.childNodes):[]},childElements:function(e){return e?Array.from(e.children):[]},nextUntil:function(e,t){return gB(e,e,t)},parents:function(e){return function(e,t){var i=null,n=[];for(i=e?e[t]:null;i&&9!==i.nodeType;)n.push(i),i=i[t]||null;return n}(e,"parentElement")},siblings:function(e){return gB(e&&e.parentElement?e.parentElement.firstElementChild:null,e)},clear:function(e){if(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}return null},insertAfter:function(e,t){return e&&t&&t.parentNode?(t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e):null},isInput:function(e){return!!e&&pB.test(e.nodeName)},isVisible:function(e){return!!e&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},prepend:function(e,t){return e&&t?(t.firstElementChild?t.insertBefore(e,t.firstElementChild):t.appendChild(e),e):null},remove:function(e){return e&&e.parentNode?(e.parentNode.removeChild(e),e):null},text:function(e,t,i){void 0===t&&(t=!0),void 0===i&&(i=!0);var n="";return e&&(n=(e.textContent||"").replace(SB," ").replace(TB," "),t&&(n=n.trim()),i&&(n=n.replace(EB," $1"))),n}},xB=function(){function e(t,i){h(this,e),this.ticks=[],this.range=[0,100],this.currentValue=0,this.currentTick={name:"",val:0,renderVal:0}
1,this.buttonStatus=1,this.startClientX=0,this.wrapperWidth=1,this.wrapperLeft=0,this.handleChange=function(){},this.parent=t,this.ticks=i.ticks,this.itemProps=i,this.sliderTitle=document.createElement("div"),this.sliderTitle.innerHTML=i.name,this.sliderContent=document.createElement("div"),this.sliderValue=document.createElement("div"),this.wrapper=document.createElement("div"),this.inner=document.createElement("div"),this.button=document.createElement("div"),CB.addClass(this.wrapper,"wrapper"),CB.addClass(this.parent,"xg-player-slider"),CB.addClass(this.sliderContent,"line-slider"),CB.addClass(this.sliderTitle,"line-title"),CB.addClass(this.sliderValue,"line-value"),this.renderTicks(),this.rendInner(),this.parent.appendChild(this.sliderTitle),this.parent.appendChild(this.sliderContent),this.parent.appendChild(this.sliderValue),this.sliderContent.appendChild(this.wrapper),this.bindEvents(),this.setValue(i.defaultValue)}return f(e,[{key:"renderTicks",value:function(){var e=this.wrapper,t=document.createElement("div");CB.addClass(t,"ticks");for(var i=1;i<this.ticks.length-1;i++){var n=this.ticks[i],r=document.createElement("div");CB.addClass(r,"tick"),CB.style(r,{left:n.val+"%"}),t.appendChild(r)}e.appendChild(t)}},{key:"rendInner",value:function(){var e=this.wrapper,t=this.inner;CB.addClass(t,"inner");var i=this.button;CB.addClass(i,"button"),e.appendChild(t),e.appendChild(i)}},{key:"bindEvents",value:function(){CB.addEventListener(this.wrapper,"click",this.onClick.bind(this)),CB.addEventListener(this.button,"touchstart",this.onTouchStart.bind(this)),CB.addEventListener(this.button,"touchmove",JM(this.onTouchmove.bind(this),30)),CB.addEventListener(this.button,"touchend",this.onTouchend.bind(this)),CB.addEventListener(this.button,"touchcancel",this.onTouchend.bind(this))}},{key:"setValue",value:function(e){var t=this;if(e>this.range[1]||e<this.range[0])return!1;this.currentTick=this.getCurrentTick(e),this.currentValue=this.currentTick.val;var i=this.currentValue+"%";return setTimeout((function(){CB.style(t.inner,{width:i}),CB.style(t.button,{left:i})})),this.sliderValue.innerHTML=this.currentTick.name,this.handleChange(this.currentValue),!0}},{key:"renderText",value:function(e){var t=this;this.ticks=e.ticks,this.itemProps=e,this.sliderTitle.innerHTML=e.name,this.currentTick=this.ticks.filter((function(e){return e.val===t.currentValue}))[0],this.sliderValue.innerHTML=this.currentTick.name}},{key:"onChange",value:function(e){this.handleChange=e}},{key:"getCurrentTick",value:function(e){for(var t=0;t<this.ticks.length-1;t++)if(this.ticks[t].val<=e&&this.ticks[t+1].val>=e)return e-this.ticks[t].val>this.ticks[t+1].val-e?this.ticks[t+1]:this.ticks[t];return this.ticks[0]}},{key:"onMousedown",value:function(e){this.startClientX=e.clientX,this.onStart()}},{key:"onTouchStart",value:function(e){e.stopPropagation(),this.startClientX=e.touches[0].clientX,this.onStart()}},{key:"onStart",value:function(){this.buttonStatus=2;var e=CB.offset(this.wrapper);this.wrapperWidth=e.width,this.wrapperLeft=e.left}},{key:"onMousemove",value:function(e){if(2===this.buttonStatus){var t=e.clientX-this.startClientX;this.onMove(t)}}},{key:"onTouchmove",value:function(e){e.stopPropagation();var t=e.touches[0].clientX-this.startClientX;this.onMove(t)}},{key:"onMove",value:function(e){var t=this.startClientX+e;if(!(t-this.wrapperLeft<0||t-this.wrapperLeft>this.wrapperWidth)){this.startClientX=this.startClientX+e;var i=(this.startClientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;CB.style(this.inner,{width:i+"%"}),CB.style(this.button,{left:i+"%"})}}},{key:"onMouseup",value:function(e){this.onEnd()}},{key:"onTouchend",value:function(){this.onEnd()}},{key:"onEnd",value:function(){this.buttonStatus=3;var e=(this.startClientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;this.setValue(e)}},{key:"onClick",value:function(e){e.stopPropagation();var t=CB.offset(this.wrapper);this.wrapperWidth=t.width,this.wrapperLeft=t.left;var i=(e.clientX-this.wrapperLeft)*(this.range[1]-this.range[0])/this.wrapperWidth;this.setValue(i)}}]),e}(),DB={danmuSwitch:"å¼¹å¹å¼å
³",danmuSetting:"å¼¹å¹è®¾ç½®",openDanmu:"æå¼å¼¹å¹",reset:"éç½®",opacity:"ä¸éæåº¦",area:"æ¾ç¤ºåºå",speed:"å¼¹å¹é度",fontSize:"åä½å¤§å°",danmuMask:"æºè½æ¡æ¿",screen0:"1/4å±",screen1:"åå±",screen2:"3/4å±",screen3:"å
¨å±",opacity0:"0",o
1pacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"æ£å¸¸",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"æå°",fontSize1:"éä¸",fontSize2:"æå¤§"},PB={danmuSwitch:"Barrage switch",danmuSetting:"Barrage settings",openDanmu:"Open Barrage",reset:"Reset",opacity:"Opacity",area:"Display area",speed:"Barrage speed",fontSize:"Font size",danmuMask:"Intelligent blocking",screen0:"1/4 screen",screen1:"Half screen",screen2:"3/4 screen",screen3:"Full screen",opacity0:"0",opacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"Normal",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"Minimal",fontSize1:"Moderate",fontSize2:"Great"},OB={zh:DB,"zh-cn":DB,en:PB,jp:PB,"zh-hk":{danmuSwitch:"å½å¹éé",danmuSetting:"å½å¹è¨ç½®",openDanmu:"æéå½å¹",reset:"éç½®",opacity:"ä¸éæåº¦",area:"顯示åå",speed:"å½å¹é度",fontSize:"åé«å¤§å°",danmuMask:"æºè½ææ¿",screen0:"1/4å±",screen1:"åå±",screen2:"3/4å±",screen3:"å
¨å±",opacity0:"0",opacity1:"1/3",opacity2:"2/3",opacity3:"1",speed0:"0.25",speed1:"0.5",speed2:"æ£å¸¸",speed3:"1.25",speed4:"1.5",speed5:"2",fontSize0:"極å°",fontSize1:"é©ä¸",fontSize2:"極大"}},IB=function(){function e(t){h(this,e),this.curLang="en",this._defaultConfig={opacity:99,area:99,fontSize:50,speed:40,active:!1,usePanel:!0,danmuItems:[],maskConfig:{maskUrl:"",maskOffset:0,interval:200},maskActive:!1,external:[]},Object.assign(this._defaultConfig,t)}return f(e,[{key:"updateLang",value:function(e){this.curLang=e,this.curLangMap=OB[e]||OB.en;var t=this.curLangMap;this.sliderItemsProps=[{key:"opacity",name:t.opacity,defaultValue:99,ticks:[{name:t.opacity0,val:0,renderVal:0},{name:t.opacity1,val:33,renderVal:.33},{name:t.opacity2,val:66,renderVal:.66},{name:t.opacity3,val:99,renderVal:1}]},{key:"area",name:t.area,defaultValue:99,ticks:[{name:t.screen0,val:0,renderVal:1/4},{name:t.screen1,val:33,renderVal:.5},{name:t.screen2,val:66,renderVal:3/4},{name:t.screen3,val:99,renderVal:1}]},{key:"speed",name:t.speed,defaultValue:40,ticks:[{name:t.speed0,val:0,renderVal:1/4},{name:t.speed1,val:20,renderVal:.5},{name:t.speed2,val:40,renderVal:1},{name:t.speed3,val:60,renderVal:5/4},{name:t.speed4,val:80,renderVal:1.5},{name:t.speed5,val:100,renderVal:2}]},{key:"fontSize",name:t.fontSize,defaultValue:50,ticks:[{name:t.fontSize0,val:0,renderVal:14},{name:t.fontSize1,val:50,renderVal:16},{name:t.fontSize2,val:100,renderVal:20}]}],this._defaultConfig.external.forEach((function(t){t.name=t.lang[e]||t.lang.en}))}},{key:"getConfig",value:function(){return this._defaultConfig}},{key:"updateConfig",value:function(e){Object.assign(this._defaultConfig,e)}},{key:"updateComments",value:function(e){this._defaultConfig.danmuItems=e}},{key:"getRenderVal",value:function(e,t){var i=this.sliderItemsProps.find((function(t){return t.key===e}))||this.sliderItemsProps[0];return(i.ticks.find((function(e){return e.val===t}))||i.ticks[0]).renderVal}}]),e}(),LB=function(){function e(t,i){h(this,e),this.state=t,this.player=i,this.root=qn.createDom("xg-danmu"),CB.addClass(this.root,"xgplayer-danmu-container")}var t;return f(e,[{key:"initDanmuContainer",value:function(){var e=this.state.getConfig(),t=e.opacity,i=void 0===t?1:t,n=e.fontSize,r=void 0===n?16:n,o=e.area,a=void 0===o?1:o,s=e.danmuItems,l=void 0===s?[]:s,c=e.active,u=e.speed,h=void 0===u?40:u,d=(c?l:[]).map((function(e){return!e.style&&(e.style={}),e})),f={container:this.root,containerStyle:{zIndex:1},player:this.player.media,comments:d,live:!1,area:{start:0,end:this.state.getRenderVal("area",a)},needResizeObserver:!0};this.danmuJs=new window["danmu.js"](f),this.setOpacity(this.state.getRenderVal("opacity",i)),this.setFontSize(this.state.getRenderVal("fontSize",r)),this.setSpeed(this.state.getRenderVal("speed",h))}},{key:"start",value:function(){this.root&&(this.root.style.display="block"),this.danmuJs.start()}},{key:"pause",value:function(){this.danmuJs.pause()}},{key:"play",value:function(){this.danmuJs.play()}},{key:"stop",value:function(){this.danmuJs.stop()}},{key:"resize",value:function(){this.danmuJs.resize()}},{key:"sendDanmu",value:function(e){this.state.getConfig().active&&this.danmuJs.sendComment(e)}},{key:"clear",value:function(){this.danmuJs.clear()}},{key:"setProperty",value:function(e,t){return"opacity"===e?this.setOpacity(this.state.getRenderVal(e,t)):"area"===e?this.setArea(this.state.getRenderVal(e,t)):"speed"===e?this.setSpeed(this.state.getRenderVal(e,t)):"fontSize"===e?this.setFontSize(this.state.getRenderVal(e,t)):void 0}},{key:"setOpacity",value:function(e){this.danmuJs.setOpacity(e)}},{key:"setFontSize",value:function(e){this.danmuJs.setFontSize(e)}},{key:"setArea",value:function(e){this.danmuJs.setArea({start:0,end:this.state.getRenderVal("area",e)})}},{key:"setSpeed",value:function(e){this.danmuJs.setAllDuration("scroll",1e4/e)}},{key:"destroy",value:(t=u(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.danmuJs){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.danmuJs.stop();case 4:return e.next=6,this.danmuJs.destroy();case 6:this.danmuJs=null,this.root.parentNode.removeChild(this.root),this.root=null;case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),AB=function(){function e(t){h(this,e),this.state=t,this.root=document.createElement("div"),CB.addClass(this.root,"panel-box"),CB.addEventListener(this.root,"click",(function(e){e.stopPropagation()}))}return f(e,[{key:"destroy",value:function(){this.root.parentNode&&this.root.parentNode.removeChild(this.root),this.root=null}}]),e}(),RB=function(){function e(t){h(this,e),this.callback=function(){},this.key=t.key,this.name=t.name,this.value=t.value,this.root=document.createElement("div"),CB.addClass(this.root,"xg-player
1-switch-wrapper"),this.render()}return f(e,[{key:"render",value:function(){var e=this;if(!this.root.childNodes.length){var t=document.createElement("div");this.$left=t,CB.addClass(t,"left"),t.innerHTML=this.name;var i=document.createElement("div");this.$right=i,CB.addClass(i,"right"),i.innerHTML='<label class="switch">\n <input type="checkbox">\n <span class="slider round"></span>\n </label>',this.root.appendChild(t),this.root.appendChild(i);var n=this.$right.querySelector("input");CB.addEventListener(this.$right,"click",XM((function(t){t.stopPropagation(),e.value=!e.value,e.value?null==n||n.setAttribute("checked","checked"):null==n||n.removeAttribute("checked"),e.callback(e.value)}),50))}var r=this.$right.querySelector("input");this.value?null==r||r.setAttribute("checked","checked"):r.removeAttribute("checked"),r.checked=this.value}},{key:"renderName",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.$left.innerHTML=e}},{key:"onChange",value:function(e){this.callback=e}}]),e}(),MB="pc"===ir.device,NB=Bo.POSITIONS,BB=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).seekCost=window.performance.now(),n.eventBus=new zn,window["danmu.js"]?(n.state=new IB(e.config),n.state.updateLang(n.player.lang),n.iconWrap=document.createElement("div"),CB.addClass(n.iconWrap,"icon-warp"),n.tipsWrap=document.createElement("div"),CB.addClass(n.tipsWrap,"tips-wrap"),n.container=new LB(n.state,n.player),n.panel=new AB(n.state),n):b(n)}return f(i,[{key:"afterCreate",value:function(){var e;null===(e=this.player.root)||void 0===e||e.appendChild(this.container.root),this.renderIcon(),this.renderBox(),this.root.appendChild(this.iconWrap),MB&&(this.state.getConfig().usePanel&&this.root.appendChild(this.panel.root),this.renderTips(),CB.addClass(this.panel.root,"pc-
1panel"),this.root.appendChild(this.tipsWrap)),this.initEvents(),this.container.initDanmuContainer()}},{key:"afterPlayerInit",value:function(){this.initDanmuMask()}},{key:"updateLang",value:function(e){this.state.updateLang(this.player.lang),this.eventBus.emit("updateLang")}},{key:"registerIcons",value:function(){return{open:{icon:SN,class:"xgplayer-danmu-open-svg"},close:{icon:TN,class:"xgplayer-danmu-close-svg"},reset:{icon:EN,class:"xgplayer-danmu-reset-svg"}}}},{key:"initEvents",value:function(){MB?this.bindPCEvent():this.bindMobileEvent(),this.bindPlayerEvent()}},{key:"start",value:function(){this.container&&(this.container.start(),this.player.paused&&this.container.pause())}},{key:"bindPlayerEvent",value:function(){var e=this;this.once(pr,(function(){e.start()})),this.on(ur,(function(){e.container.pause()})),this.on(sr,(function(){e.container.play()})),this.on(dr,(function(){e.seekCost=window.performance.now(),e.container.stop()})),this.on(fr,XM((function(){e.container.start()}),300)),this.on([Ur,jr,Hr],(function(){e.container.resize(),e.handleResize()})),this.on(Wr,this.handlePIP.bind(this))}},{key:"bindPCEvent",value:function(){var e=this;CB.addEventListener(this.root,"click",this.onClick.bind(this)),CB.addEventListener(this.root,"mouseenter",(function(){var t=e.state.getConfig().active,i=e.player.controls;"rightSide"===e.config.listType?i.blur():i.focus(),t?(CB.style(e.panel.root,{display:"block"}),CB.style(e.tipsWrap,{display:"none"})):(CB.style(e.panel.root,{display:"none"}),CB.style(e.tipsWrap,{display:"block"}))})),CB.addEventListener(this.root,"mouseleave",(function(){var t=e.player.controls;"rightSide"===e.config.listType?t.focus():t.focusAwhile(),CB.style(e.panel.root,{display:"none"}),CB.style(e.tipsWrap,{display:"none"})}))}},{key:"bindMobileEvent",value:function(){var e=this;CB.addEventListener(this.root,"click",(function(){e.state.getConfig().usePanel?e.player.panel.showPanel(e.panel.root):e.onClick()}))}},{key:"onClick",value:function(){this.toggleDanmu(),this.renderIcon()}},{key:"toggleDanmu",value:function(){var e=this.state.getConfig(),t=e.active,i=e.maskActive,n=!t;n?(this.state.updateConfig({active:n}),i&&this.initMask(),null==this||this.container.start()):(null==this||this.container.stop(),this.destroyMask(),this.state.updateConfig({active:n})),this.player.emit(PM.DANMU_CHANGE,{active:n}),this.danmuSwitchInSettingPanel&&(this.danmuSwitchInSettingPanel.value=n,this.danmuSwitchInSettingPanel.render())}},{key:"renderIcon",value:function(){this.iconWrap.innerHTML="",this.state.getConfig().active?this.iconWrap.appendChild(this.icons.open):this.iconWrap.appendChild(this.icons.close)}},{key:"renderTips",value:function(){this.tipsWrap.innerHTML=this.state.curLangMap.openDanmu}},{key:"renderBox",value:function(){var e=this;this.panel.root.innerHTML="";var t=document.createElement("div");CB.addClass(t,"box-header"),t.innerHTML='<div class="header-setting">'+this.state.curLangMap.danmuSetting+'</div> <div class="header-reset"></div>';var i=t.querySelector(".header-reset");i.appendChild(this.icons.reset),CB.addEventListener(i,"click",(function(t){t.stopPropagation(),e.eventBus.emit("reset")}),{capture:!0});var n=document.createElement("span");n.innerHTML=this.state.curLangMap.reset,i.appendChild(n),this.eventBus.on("updateLang",(function(){n.innerHTML=e.state.curLangMap.reset,t.querySelector(".header-setting").innerHTML=e.state.curLangMap.danmuSetting})),this.panel.root.appendChild(t),MB||this.renderTurnOff(),this.renderSliders(),this.renderSwitches()}},{key:"renderTurnOff",value:function(){var e=this,t={name:this.state.curLangMap.danmuSwitch,key:"active",value:this.state.getConfig().active||!1},i=new RB(t);this.danmuSwitchInSettingPanel=i,this.panel.root.appendChild(i.root),i.onChange((function(t){e.toggleDanmu(),e.renderIcon()})),this.eventBus.on("updateLang",(function(){i.renderName(e.state.curLangMap.danmuSwitch)}))}},{key:"renderSwitches",value:function(){var e,t=this;null===(e=this.state.getConfig().external)||void 0===e||e.forEach((function(e){var i=new RB(e);t.panel.root.appendChild(i.root),t.eventBus.on("updateLang",(function(){i.renderName(e.name)}
1)),i.onChange((function(i){var n=t.state.getConfig().external||[];n.forEach((function(t){t.key===e.key&&(t.value=i)})),t.state.updateConfig({external:n}),t.player.emit(PM.DANMU_CHANGE,{external:n})}))}))}},{key:"renderSliders",value:function(){var e=this;this.state.sliderItemsProps.forEach((function(t,i){var n,r,o=document.createElement("div"),a=new xB(o,t);null!=(null===(n=e.state.getConfig())||void 0===n?void 0:n[t.key])&&a.setValue(null===(r=e.state.getConfig())||void 0===r?void 0:r[t.key]),a.onChange((function(i){e.state.updateConfig(p({},t.key,i)),e.player.emit(PM.DANMU_CHANGE,p({},t.key,i)),e.container.setProperty(t.key,i)})),e.eventBus.on("reset",(function(){a.setValue(t.defaultValue)})),e.eventBus.on("updateLang",(function(){a.renderText(e.state.sliderItemsProps[i])})),e.panel.root.appendChild(o)}))}},{key:"sendDanmu",value:function(e){return this.container.sendDanmu(e)}},{key:"updateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.state.updateConfig(e)}},{key:"getConfig",value:function(){return this.state.getConfig()}},{key:"initDanmuMask",value:function(){if(this.player){var e=this.state.getConfig(),t=e.maskConfig,i=e.active,n=e.maskActive;t.maskUrl&&(this.renderDanmuMaskTurnOff(),i&&n&&this.initMask())}}},{key:"renderDanmuMaskTurnOff",value:function(){var e=this,t={name:this.state.curLangMap.danmuMask,key:"maskActive",value:this.state.getConfig().maskActive||!1},i=new RB(t);this.panel.root.appendChild(i.root),i.onChange((function(t){e.state.updateConfig({maskActive:t}),t?e.initMask():e.destroyMask(),e.renderIcon()})),this.eventBus.on("updateLang",(function(){i.renderName(e.state.curLangMap.danmuMask)}))}},{key:"initMask",value:function(){this.destroyMask();var e=this.state.getConfig(),t=e.maskConfig,i=e.maskActive,n=e.active;t.maskUrl&&i&&n&&(window.DanmuMask&&"function"==typeof window.DanmuMask&&(this.mask=new window.DanmuMask({player:this.player,url:t.maskUrl,originStart:t.maskOffset,interval:t.interval})),this.mask.init())}},{key:"destroyMask",value:function(){this.mask&&(this.mask.destroy(),this.mask=null)}},{key:"handleResize",value:function(){var e,t,i,n;if(this.mask){var r=this.player;this.mask.setContainerSize(null!==(e=null==r||null===(t=r.root)||void 0===t?void 0:t.offsetWidth)&&void 0!==e?e:0,null!==(i=null==r||null===(n=r.root)||void 0===n?void 0:n.offsetHeight)&&void 0!==i?i:0)}}},{key:"handlePIP",value:function(e){e?this.destroyMask():this.initMask()}},{key:"destroy",value:function(){this.destroyMask(),this.container.destroy(),this.panel.destroy()}},{key:"render",value:function(){return'<div class="xgplayer-danmu"></div>'}}],[{key:"pluginName",get:function(){return"DanmuPlugin"}},{key:"defaultConfig",get:function(){return{position:NB.CONTROLS_RIGHT,index:AM}}}]),i}(Bo);function UB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jB(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KB(n.key),n)}}function HB(e,t,i){return t&&jB(e.prototype,t),i&&jB(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function FB(e,t,i){return(t=KB(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function VB(e){return(VB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zB(e,t){return(zB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function GB(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function WB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=VB(e);if(t){var r=VB(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return GB(this,i)}}function KB(e){var t=function(e,t){if("object"!==l(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===l(t)?t:String(t)}var YB=Hh,$B=id,qB=Gh,XB=jh,JB=nm,ZB=lv,QB=Wh,eU=_f,tU=hd,iU=Object.assign,nU=Object.defineProperty,rU=$B([].concat),oU=!iU||XB((function(){if(YB&&1!==iU({b:1},iU(nU({},"a",{enumerable:!0,get:function(){nU(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach((function(e){t[e]=e})),7!=iU({},e)[i]||JB(iU({},t)).join("")!=n}))?function(e,t){for(var i=eU(e),n=arguments.length,r=1,o=ZB.f,a=QB.f;n>r;)for(var s,l=tU(arguments[r++]),c=o?rU(JB(l),o(l)):JB(l),u=c.length,h=0;u>h;)s=c[h++],YB&&!qB(a,l,s)||(i[s]=l[s]);return i}:iU,aU=oU;Nv({target:"Object",stat:!0,arity:2,forced:Object.assign!==aU},{assign:aU});var sU=!jh((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),lU=wf,cU=wd,uU=_f,hU=sU,dU=Xp("IE_PROTO"),fU=Object,pU=fU.prototype,gU=hU?fU.getPrototypeOf:function(e){var t=uU(e);if(lU(t,dU))return t[dU];var i=t.constructor;return cU(i)&&t instanceof i?i.prototype:t instanceof fU?pU:null},vU=Hh,yU=jh,mU=id,_U=gU,bU=nm,kU=md,wU=mU(Wh.f),SU=mU([].push),TU=vU&&yU((function(){var e=Object.create(null);return e[2]=2,!wU(e,2)})),EU=function(e){return function(t){for(var i,n=kU(t),r=bU(n),o=TU&&null===_U(n),a=r.length,s=0,l=[];a>s;)i=r[s++],vU&&!(o?i in n:wU(n,i))||SU(l,e?[i,n[i]]:n[i]);return l}},CU=(EU(!0),EU(!1));Nv({target:"Object",stat:!0},{values:function(e){return CU(e)}});var xU,DU="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,PU=Bh,OU=Gb,IU=wd,LU=DU,AU=Id,RU=Kb,MU=$b,NU=PU.Function,BU=/MSIE .\./.test(AU)||LU&&((xU=PU.Bun.version.split(".")).length<3||0==xU[0]&&(xU[1]<3||3==xU[1]&&0==xU[2])),UU=function(e,t){var i=t?2:1;return BU?function(n,r){var o=MU(arguments.length,1)>i,a=IU(n)?n:NU(n),s=o?RU(arguments,i):[],l=o?function(){OU(a,this,s)}:a;return t?e(l,r):e(l)}:e},jU=Nv,HU=Bh,FU=UU(HU.setInterval,!0);jU({global:!0,bind:!0,forced:HU.setInterval!==FU},{setInterval:FU});var VU=Nv,zU=Bh,GU=UU(zU.setTimeout,!0);VU({global:!0,bind:!0,forced:zU.setTimeout!==GU},{setTimeout:GU});var WU,KU,YU={MENU_REPORT:"MENU_REPORT",MENU_LOG:"MENU_LOG"},$U={VID:5,TYPE:10,CODECS:20,SPEED:30,BUFFER:40,PLAY_QUALITY:50,SCHEME:60,RESOLUTION:70,VIEWPORT:80,VOLUME:90,CDN:100,P2P:110,PLAYER_VERSION:120},qU={MENU:0,INTERACT:1,CONTEXTMENU:2},XU={STATS:0,REPORT:1},JU={CLOSE:0,COPY:1},ZU={SHOW:0,HIDE:1},QU={STATS:"STATS",REPORT:"REPORT",CLOSE:"CLOSE",COPY:"COPY",CONTEXTMENU_SHOW:"CONTEXTMENU_SHOW",CONTEXTMENU_HIDE:"CONTEXTMENU_HIDE"},ej=Object.freeze(Object.defineProperty({__proto__:null,CONTEXTMENU_TYPES:ZU,EVENTS:YU,INFO_TYPES:$U,INTERACT_TYPES:JU,LOG_EVENTS:QU,LOG_TYPES:qU,MENU_TYPES:XU},Symbol.toStringTag,{value:"Module"})),tj={cn:(WU={},FB(WU,$U.VID,"VID"),FB(WU,$U.TYPE,"ç±»å"),FB(WU,$U.CODECS,"ç¼ç "),FB(WU,$U.SPEED,"å è½½é度"),FB(WU,$U.BUFFER,"ç¼å²æ¶é¿"),FB(WU,$U.PLAY_QUALITY,"丢帧ç"),FB(WU,$U.SCHEME,"è§é¢åè®®"),FB(WU,$U.RESOLUTION,"å辨ç"),FB(WU,$U.VIEWPORT,"è§å¾å°ºå¯¸"),FB(WU,$U.VOLUME,"é³é大å°"),FB(WU,$U.CDN,"CDN"),FB(WU,$U.P2P,"P2P"),FB(WU,$U.PLAYER_VERSION,"ææ¾å¨çæ¬"),WU),en:(KU={},FB(KU,$U.VID,"Video ID"),FB(KU,$U.TYPE,"Video Type"),FB(KU,$U.CODECS,"Codecs"),FB(KU,$U.SPEED,"Connection Speed"),FB(KU,$U.BUFFER,"Buffer Health"),FB(KU,$U.PLAY_QUALITY,"Dropped Frames"),FB(KU,$U.SCHEME,"Protocol"),FB(KU,$U.RESOLUTION,"Res"),FB(KU,$U.VIEWPORT,"Viewport"),FB(KU,$U.VOLUME,"Volume"),FB(KU,$U.CDN,"CDN"),FB(KU,$U.P2P,"P2P"),FB(KU,$U.PLAYER_VERSION,"Player Version"),KU)},ij=function(e){!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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zB(e,t)}(i,e);var t=WB(i);function i(){return UB(this,i),t.apply(this,arguments)}return HB(i,[{key:"afterCreate",value:function(){}},{key:"onPluginsReady",value:function(){var e=this.player.plugins.stats;this.menuInst=new nj(this.player,this.config||{},e)}}],[{key:"pluginName",get:function(){return"MenuPlugin"}},{key:"defaultConfig",get:function(){return{enableDebug:!0}}}]),i}(Eo),nj=function(){function e(t,i,n){var r=this;UB(this,e),FB(this,"_cdnUpdate",(function(e){var t=r.infoItems[$U.CDN],i=e||r.player.domain;i&&(t.value=i),r._cacheUpdate($U.CDN,i)||i&&r.updateInfoItem(t)})),this.player=t,this.options=i||{},this.statsPlugin=n;var o={report:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.71429 5C5.3198 5 5 5.3198 5 5.71429V14.2857C5 14.6802 5.3198 15 5.71429 15H14.2857C14.6802 15 15 14.6802 15 14.2857V10C15 9.44772 15.4477 9 16 9C16.5523 9 17 9.44772 17 10V14.2857C17 15.7848 15.7848 17 14.2857 17H5.71429C4.21523 17 3 15.7848 3 14.2857V5.71429C3 4.21523 4.21523 3 5.71429 3H10C10.5523 3 11 3.44772 11 4C11 4.55228 10.5523 5 10 5H5.71429Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.7071 3.29289C1
17.0976 3.68342 17.0976 4.31658 16.7071 4.70711L10.7071 10.7071C10.3166 11.0976 9.68342 11.0976 9.29289 10.7071C8.90237 10.3166 8.90237 9.68342 9.29289 9.29289L15.2929 3.29289C15.6834 2.90237 16.3166 2.90237 16.7071 3.29289Z" fill="currentColor"/></svg>',stats:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 10C9 9.44771 9.44771 9 10 9C10.5523 9 11 9.44772 11 10V13C11 13.5523 10.5523 14 10 14C9.44771 14 9 13.5523 9 13V10Z" fill="currentColor"/><path d="M10 6C9.44771 6 9 6.44772 9 7C9 7.55228 9.44771 8 10 8C10.5523 8 11 7.55228 11 7C11 6.44772 10.5523 6 10 6Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10ZM10 16C13.3137 16 16 13.3137 16 10C16 6.68629 13.3137 4 10 4C6.68629 4 4 6.68629 4 10C4 13.3137 6.68629 16 10 16Z" fill="currentColor"/></svg>',close:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.1231 4.08053C16.5136 4.47105 16.5136 5.10422 16.1231 5.49474L11.453 10.1648L16.1231 14.8349C16.5136 15.2254 16.5136 15.8586 16.1231 16.2491C15.7326 16.6397 15.0994 16.6397 14.7089 16.2491L10.0388 11.579L5.36873 16.2491C4.9782 16.6397 4.34504 16.6397 3.95451 16.2491C3.56399 15.8586 3.56399 15.2254 3.95451 14.8349L8.6246 10.1648L3.95451 5.49474C3.56399 5.10422 3.56399 4.47105 3.95451 4.08053C4.34504 3.69001 4.9782 3.69001 5.36873 4.08053L10.0388 8.75061L14.7089 4.08053C15.0994 3.69 15.7326 3.69 16.1231 4.08053Z" fill="currentColor"/></svg>',copy:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 3C5.44772 3 5 3.44772 5 4C5 4.55228 5.44772 5 6 5H13.5C14.3284 5 15 5.67157 15 6.5V14C15 14.5523 15.4477 15 16 15C16.5523 15 17 14.5523 17 14V6.5C17 4.567 15.433 3 13.5 3H6ZM4 8H12V16H4L4 8ZM2 8C2 6.89543 2.89543 6 4 6H12C13.1046 6 14 6.89543 14 8V16C14 17.1046 13.1046 18 12 18H4C2.89543 18 2 17.1046 2 16V8ZM5.75 9.5C5.33579 9.5 5 9.83579 5 10.25C5 10.6642 5.33579 11 5.75 11H10.25C10.6642 11 11 10.6642 11 10.25C11 9.83579 10.6642 9.5 10.25 9.5H5.75ZM5 13.75C5 13.3358 5.33579 13 5.75 13H10.25C10.6642 13 11 13.3358 11 13.75C11 14.1642 10.6642 14.5 10.25 14.5H5.75C5.33579 14.5 5 14.1642 5 13.75Z" fill="currentColor"/></g></svg>'},a=Object.assign({},o,this.options.icons);this.options.icons=a,this.playerInstance="dash_".concat((new Date).getTime()),window[this.playerInstance]=this.player,this.menuItems=[{name:"è§é¢ç»è®¡ä¿¡æ¯",handler:this.showPanelInfo.bind(this),type:XU.STATS,icon:a.stats,eventName:QU.STATS},{name:"ææ¾é®é¢åé¦",handler:this._handleReport.bind(this),type:XU.REPORT,icon:a.report,eventName:QU.REPORT}],this.playerHandler=[{evt:"RESOLUTION_UPDATE",handler:this._resolutionUpdate.bind(this)},{evt:"menusegment",handler:this._recordLastSegment.bind(this)},{evt:"resourceReady",handler:this._startup.bind(this)},{evt:"canplay",handler:this._startup.bind(this)},{evt:"ended",handler:this.destroyDOM.bind(this)},{evt:"destroy",handler:this.destroy.bind(this)},{evt:"playertypechange",handler:this.destroyDOM.bind(this)},{evt:"codecsupdate",handler:this._codecsUpdate.bind(this)},{evt:"playing",handler:this._startup.bind(this)},{evt:"changeHost",handler:this._cdnUpdate}];for(var s=0;s<this.playerHandler.length;s++){var l=this.playerHandler[s],c=l.evt,u=l.handler;this.player.on(c,u)}this.debugInfo={ua:navigator.userAgent,version:this.player.playerVersion},this._pollTimer=null,this.hasInitDOM=!1,this._cacheMap={},this.menuHandler=this._menuHandler.bind(this),this.munuHideHandler=this._munuHideHandler.bind(this),this.rootClickHandler=this._rootClickHandler.bind(this),this._initDatas()}return HB(e,[{key:"_reset",value:function(){this.hasInitDOM=!1,this._cacheMap={},this._lastSegment=null}},{key:"_noop",value:function(){}},{key:"_recordLastSegment",value:function(e){this._lastSegment=e}},{key:"_resolutionUpdate",value:function(e){var t=this.infoItems[$U.RESOLUTION];t.value=e,this._cacheUpdate($U.RESOLUTION,e)||(e?(t.value=e,this.updateInfoItem(t)):(t.hide=!0,this.createPanelInfo()))}},{key:"_codecsUpdate",value:function(e){var t=this.infoItems[$U.CODECS];t.value=e,this._cacheUpdate($U.CODECS,e)||this.updateInfoItem(t)}},{key:"_cacheUpdate",value:function(e,t){return!this.hasInitDOM&&(this._cacheMap[e]=t,!0)}},{key:"_handleReport",value:function(){for(var e=this.player.video.readyState,t=this.player.video.buffered,i=[],n=0;n<t.length;n++){var r=t.start(n),o=t.end(n);i.push({start:r,end:o})}var a={readyState:e,curTime:this.player.video.currentTime,err:this.player.video.error||-1,buffer:i}
1,s=Object.assign({debug_date:new Date,type:this.type},this.debugInfo,{videoInfo:a});this._lastSegment&&(s.segment=this._lastSegment),this.options.enableDebug&&this.statsPlugin&&(s.stats=this.statsPlugin.getStats()),this.player.ext&&(s.ext=this.player.ext),this.player.emit(YU.MENU_REPORT,s)}},{key:"_startup",value:function(){if(!this.hasInitDOM){this.type=this.player.currentFormat,this._initDatas(),this._initDOM();for(var e=Object.keys(this._cacheMap),t=0;t<e.length;t++){var i=e[t],n=this.infoItems[i];n.value=this._cacheMap[i],this.updateInfoItem(n,!0)}}}},{key:"_initDatas",value:function(){var e;this.parentNode=this.player.root,this._isPlayQualitySupported=this.player.video&&"function"==typeof this.player.video.getVideoPlaybackQuality;var t=this.player.playerType,i=tj.cn,n=this.options.lang||"cn";this.langConfig=this.options.langConfig||tj[n]||i,this.infoItems=(FB(e={},$U.VID,{name:"VID",value:this.player.config.vid,render:rj,hide:!this.player.config.vid,key:"vid"}),FB(e,$U.TYPE,{name:"ç±»å",value:t,render:rj,key:"player_type"}),FB(e,$U.CODECS,{name:"ç¼ç ",value:this.player.menuCodeType,render:rj,key:"menuCodeType",hide:!this.player.menuCodeType}),FB(e,$U.SPEED,{name:"å è½½é度",value:0,render:rj,posfix:" KB/s",hide:!this._isMenusHide("speed"),key:"speed"}),FB(e,$U.BUFFER,{name:"ç¼å²æ¶é¿",value:0,render:rj,posfix:"s",key:"buffer"}),FB(e,$U.PLAY_QUALITY,{name:"丢帧ç",value:{droppedVideoFrames:0,totalVideoFrames:0},render:oj,hide:null===this.player.video.getVideoPlaybackQuality,key:"frames_info"}),FB(e,$U.SCHEME,{name:"è§é¢åè®®",value:"HTTPS",render:rj,key:"scheme"}),FB(e,$U.CDN,{name:"CDN",value:this.player.domain?this.player.domain:"false",render:rj,hide:!this._isMenusHide("cdn"),key:"CDN"}),FB(e,$U.P2P,{name:"P2P",value:"false",render:rj,hide:!0,key:"p2p"}),FB(e,$U.RESOLUTION,{name:"å辨ç",value:{width:0,height:0,fps:void 0},render:aj,hide:!this._isMenusHide("resolution"),key:"resolution"}),FB(e,$U.VIEWPORT,{name:"è§å¾å°ºå¯¸",value:{width:0,height:0},render:aj,key:"viewport"}),FB(e,$U.VOLUME,{name:"é³é大å°",value:"".concat((100*this.player.volume).toFixed(0),"%"),render:rj,key:"volume"}),FB(e,$U.PLAYER_VERSION,{name:"ææ¾å¨çæ¬",value:this.player.playerVersion,render:rj,key:"player_version"}),e);for(var r=Object.keys(this.infoItems),o=0;o<r.length;o++){var a=r[o];this.infoItems[a].type=a}for(var s=this.options.infoItems||[],l=0;l<s.length;l++){var c=s[l];c.name&&c.type&&c.key?(c.render&&cj(c.render)||(c.render=rj),this.infoItems[c.type]=c):lj("".concat(c.name))}}},{key:"_isMenusHide",value:function(e){return!0===(this.player.supportMenus||{})[e]}},{key:"renderItemByType",value:function(e,t){var i=this.infoItems[e];i?(i.value=t,this._cacheUpdate(e,t)||this.updateInfoItem(i)):lj("".concat(e," item null"))}},{key:"_initDOM",value:function(){if(this.parentNode&&qn){this.hasInitDOM=!0;var e=document.createDocumentFragment(),t=document.createElement("xg-menu");qn.addClass(t,"xg-menu"),this.rightMenu=t;for(var i=this.menuItems.filter((function(e){return!e.hide})),n=0;n<i.length;n++)e.appendChild(this.createMenuItem(i[n]));t.appendChild(e),this.toggle(this.rightMenu,!1),this.parentNode.appendChild(t),this.parentNode.addEventListener("contextmenu",this.menuHandler,!1),document.addEventListener("click",this.munuHideHandler,!1),this.parentNode.addEventListener("click",this.rootClickHandler,!0),this.createPanelInfo(),this.bindEvents(),this.tick()}}},{key:"_menuHandler",value:function(e){if(e.preventDefault(),e.stopPropagation(),this.isPIPMode())return!1;var t=this.getOffset(),i=e.clientX-t.x+document.body.scrollLeft+document.documentElement.scrollLeft,n=e.clientY-t.y+document.body.scrollTop+document.documentElement.scrollTop,r=this.parentNode.clientWidth,o=this.parentNode.clientHeight;this.toggle(this.rightMenu,!0);var a=this.rightMenu.offsetWidth,s=this.rightMenu.offsetHeight,l=i+a>r?r-a:i,c=n+s>o?o-s:n;this.rightMenu.style.left="".concat(l,"px"),this.rightMenu.style.top="".concat(c,"px"),this.emitLog(qU.CONTEXTMENU,ZU.SHOW,QU.CONTEXTMENU_SHOW)}},{key:"getOffset",value:function(){for(var e=this.parentNode,t=0,i=0;e&&!Number.isNaN(e.offsetLeft)&&!Number.isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,i+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:i}}},{key:"_munuHideHandler",value:function(){this.rightMenu&&"block"===this.rightMenu.style.display&&this.emitLog(qU.CONTEXTMENU,ZU.HIDE,QU.CONTEXTMENU_HIDE),this.toggle(this.rightMenu,!1)}},{key:"_rootClickHandler",value:function(e){"block"===this.rightMenu.style.display&&e.target===this.player.video&&(e.stopPropagation(),e.preventDefault(),this._munuHideHandler())}},{key:"tick",value:function(){var e=this;this._pollTimer=setTimeout((function(){clearTimeout(e._pollTimer),e._poll(),e.tick(),e.isPIPMode()&&(e.toggle(e.rightMenu,!1),e.toggle(e.panelInfo,!1))}),500)}},{key:"_poll",value:function(){var e=this.bufferLength,t=this.infoItems[$U.BUFFER];if(t.value=e,this.updateInfoItem(t),this.player.video.getVideoPlaybackQuality){var i=this.player.video.getVideoPlaybackQuality(),n=this.infoItems[$U.PLAY_QUALITY];n.value={totalVideoFrames:i.totalVideoFrames,droppedVideoFrames:i.droppedVideoFrames},this.updateInfoItem(n)}
1var r=this.infoItems[$U.SPEED];if(!r.hide){var o=Math.floor(this.player.downloadSpeed);r.value=o,this.updateInfoItem(r)}}},{key:"bindEvents",value:function(){var e=this,t=this.player.video;this.handleVolumeChange=this._handleVolumeChange.bind(this),t.addEventListener("volumechange",this.handleVolumeChange),t.addEventListener("DOMNodeInserted",(function i(){t.removeEventListener("DOMNodeInserted",i),e._onWinElemSizeChange()})),this.onWinSizeChange=function(e,t,i){var n;return function(){var r=this,o=arguments,a=function(){n=null,i||e.apply(r,o)},s=i&&!n;clearTimeout(n),n=setTimeout(a,t),s&&e.apply(r,o)}}(this._onWinElemSizeChange.bind(this),1e3,!1),window.addEventListener("resize",this.onWinSizeChange),e._onWinElemSizeChange()}},{key:"_onWinElemSizeChange",value:function(){if(this.player&&this.player.video){var e=this.player.video.getBoundingClientRect(),t=this.infoItems[$U.VIEWPORT],i={width:Math.floor(e.width),height:Math.floor(e.height)};if(t.value=i,this._cacheUpdate($U.VIEWPORT,i))return;this.updateInfoItem(t)}}},{key:"_handleVolumeChange",value:function(){var e=this.infoItems[$U.VOLUME];e.value="".concat((100*this.player.video.volume).toFixed(0),"%"),this._cacheUpdate($U.VOLUME)||this.updateInfoItem(e)}},{key:"createMenuItem",value:function(e){var t=this,i=document.createElement("div");if(i.classList.add("v-menu-item"),e.clsName&&i.classList.add(e.clsName),e.icon){var n=document.createElement("div");qn.addClass(n,"menu-item-icon"),n.innerHTML=e.icon,i.appendChild(n)}var r=document.createElement("div");return qn.addClass(r,"menu-item-content"),r.textContent=e.name,i.appendChild(r),!1!==i.clickable&&i.addEventListener("click",(function(i){i.stopPropagation(),i.preventDefault(),t.toggle(t.rightMenu,!1),e.handler(),t.emitLog(qU.MENU,e.type,e.eventName)})),i}},{key:"createIconBtn",value:function(e,t,i,n){var r=document.createElement("div");return qn.addClass(r,e),r.innerHTML="".concat(t,"<div class='svg-hover'>").concat(i,"</div>"),n.appendChild(r),r}},{key:"createPanelInfo",value:function(){var e=this,t=document.createElement("xg-panel-info");qn.addClass(t,"xg-panel-info"),this.createIconBtn("xg-info-close xg-interact-icon",this.options.icons.close,"å
³é",t).addEventListener("click",(function(){e.toggle(t,!1),e.panelVisible=!1,e.emitLog(qU.INTERACT,JU.CLOSE,QU.CLOSE)})),this.createIconBtn("xg-info-copy xg-interact-icon",this.options.icons.copy,"å¤å¶",t).addEventListener("click",(function(){for(var t=Object.values(e.infoItems).filter((function(e){return!e.hide})),i={},n=0;n<t.length;n++){var r=t[n],o=r.key,a=void 0;a=e.options.connectPrefix&&r.posfix?"".concat(r.value).concat(r.posfix):r.value,i[o]=a}e.options.enableDebug&&e.statsPlugin&&Object.assign(i,{stats:e.statsPlugin.getStats()}),e.copyToClipboard(JSON.stringify(i)),e.emitLog(qU.INTERACT,JU.COPY,QU.COPY)}));var i=document.createElement("ul");qn.addClass(i,"xg-panel-detail");for(var n=Object.values(this.infoItems).filter((function(e){return!e.hide})),r=document.createDocumentFragment(),o=0;o<n.length;o++){var a=this.createInfoItem(n[o]);r.appendChild(a)}i.appendChild(r),t.appendChild(i),this.panelInfo=t,this.player.root.appendChild(t)}},{key:"createInfoItem",value:function(e){var t=document.createElement("li");return e.elem=t,this.updateInfoItem(e),t}},{key:"showPanelInfo",value:function(){this.toggle(this.panelInfo,!0),this.panelVisible=!0;for(var e=Object.values(this.infoItems).filter((function(e){return!e.hide})),t=0;t<e.length;t++)this.updateInfoItem(e[t])}},{key:"copyToClipboard",value:function(e){var t=document.createElement("textarea");t.style.height="0px",t.style.width="1px",document.body.appendChild(t),t.value=e,t.select(),document.execCommand("copy"),document.body.removeChild(t)}},{key:"updateInfoItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.panelVisible||t){var i=e.elem;if(i){sj(i);var n=document.createElement("label"),r=this.langConfig[e.type]||e.name;n.textContent="".concat(r),qn.addClass(n,"xg-item-label"),i.appendChild(n);var o=document.createElement("span"),a=e.ctx||null,s=e.render.call(a,e.value);s instanceof Element?o.appendChild(s):o.textContent="".concat(s).concat(e.posfix?e.posfix:""),i.appendChild(o)}}}},{key:"toggle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(e.style.display=t?"block":"none")}},{key:"bufferLength",get:function(){var e=this.player.getBufferedRange(),t=this.player.video.currentTime,i=e[1]-Math.max(e[0],t);return i=Math.max(0,i).toFixed(2),parseFloat(i)}},{key:"destroyDOM",value:function(){this.parentNode.removeEventListener("contextmenu",this.menuHandler),document.removeEventListener("click",this.munuHideHandler,!1),this.parentNode.removeEventListener("click",this.rootClickHandler,!0),this._reset(),this.removeElement(this.rightMenu),this.removeElement(this.panelInfo),this.rightMenu=null,this.panelInfo=null,this._pollTimer&&clearTimeout(this._pollTimer)}},{key:"destroy",value:function(){this.destroyDOM(),this.destroyEvents()}},{key:"destroyEvents",value:function(){for(var e=0;e<this.playerHandler.length;e++){var t=this.playerHandler[e],i=t.evt,n=t.handler;this.player.off(i,n)}window.removeEventListener("resize",this.onWinSizeChange)}},{key:"removeElement",value:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}},{key:"isPIPMode",value:function(){return qn.hasClass(this.parentNode,"xgplayer-pip-active")}},{key:"emitLog",value:function(e,t,i){this.player.emit(YU.MENU_LOG,{logType:e,code:t,event:i})}}]),e}();function rj(e){return e}function oj(e){var t=e.droppedVideoFrames,i=e.totalVideoFrames,n=0;n=0===i?0:t/i*100;var r=document.createElement("span"),o=document.createElement("span");o.textContent=t,r.appendChild(o);var a=document.createElement("span");return a.textContent="/".concat(i,", ").concat(n.toFixed(2),"%"),r.appendChild(a),r}
1function aj(e){var t=e.width,i=e.height,n=e.fps;return"".concat(t," * ").concat(i).concat(void 0!==n?" / ".concat(n,"fps"):"")}function sj(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function lj(e){console&&console.warn}function cj(e){return"[object Function]"===Object.prototype.toString.call(e)}function uj(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function hj(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?uj(Object(i),!0).forEach((function(t){vj(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):uj(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function dj(e){return(dj="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 fj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pj(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tj(n.key),n)}}function gj(e,t,i){return t&&pj(e.prototype,t),i&&pj(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function vj(e,t,i){return(t=Tj(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function yj(e){return(yj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mj(e,t){return(mj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bj(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _j(e)}function kj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=yj(e);if(t){var r=yj(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return bj(this,i)}}function wj(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=yj(e)););return e}function Sj(){return Sj="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,i){var n=wj(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},Sj.apply(this,arguments)}function Tj(e){var t=function(e,t){if("object"!==l(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===l(t)?t:String(t)}ij.MenuEvents=ej,ij.Menu=nj;var Ej=/^WEBVTT/,Cj=/^STYLE+$/,xj=/^\:\:cue/,Dj=/^}+$/,Pj=/^\[Script Info\].*/,Oj=[/[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,3}:[0-9]{2}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,2}:[0-9]{2}\.[0-9]{1,3}-->[0-9]{1,2}:[0-9]{2}\.[0-9]{1,3}/,/[0-9]{1,2}\.[0-9]{1,3}-->[0-9]{1,2}\.[0-9]{1,3}/],Ij=/^Format:\s/,Lj=/^Style:\s/,Aj=/^Dialogue:\s/;function Rj(e){var t=e.length;return 3===t?(60*(60*Number(e[0])+Number(e[1]))*1e3+1e3*Number(e[2]))/1e3:2===t?(60*Number(e[0])*1e3+1e3*Number(e[1]))/1e3:Number(e[0])}function Mj(e){return/^(\-|\+)?\d+(\.\d+)?$/.test(e)}function Nj(e,t){return e>=0&&e<t.length?t[e]:""}var Bj=function(){function e(){fj(this,e)}return gj(e,null,[{key:"parseJson",value:function(e){for(var t=[],i=0,n=0;n<e.length;n++){if(i>=50&&(i=0),0===i){var r={start:e[n].start,list:[e[n]],end:e[n].end};t.push(r)}else t[t.length-1].list.push(e[n]),t[t.length-1].end=e[n].end;i++}return t}},{key:"parse",value:function(t,i){var n=e.checkFormat(t);n||i({format:n});try{var r=[];"ass"===n?r=e.parseASS(t):"vtt"===n&&(r=e.parseVTT(t)),i({format:n,list:r.list,styles:r.styles})}catch(e){i({format:n},e)}}},{key:"parseASSItem",value:function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(","),i={},n="";try{var r=t.length-e.length;return n=(n=r>0?t.splice(e.length-1,r+1).join(",")+"":t[t.length-1]+"").replace(/\\n+/g,""),t[e.length-1]=n,e.map((function(e,n){"end"===e||"start"===e?i[e]=Rj(t[n].split(":")):"text"===e?i[e]=[t[n]]:"layer"===e?(i[e]=[t[n]],i.textTag=[t[n]]):i[e]="style"===e?[t[n]]:Number(t[n])?Number(t[n]):t[n]})),i}catch(e){return{}}}},{key:"parseASS",value:function(t){for(var i=t.split("\n"),n=[],r=0,o=0,a=[],s=[],l=null;r<i.length;){if(Ij.test(i[r]))s=(s=i[r].replace(Ij,"").replace(/\s+/g,"").split(",")).map((function(e){return e.toLocaleLowerCase()}));else if(Lj.test(i[r]))a.push(i[r].replace(Lj,"").replace(/\s+/g,""));else if(Aj.test(i[r])){var c=e.parseASSItem(i[r].replace(Aj,""),s);if(l&&c.start===l.start&&c.end===l.end)try{var u=l,h=u.text,d=u.textTag,f=u.style;h.push(c.text[0]),d.push(c.textTag[0]),f.push(c.style[0])}catch(e){}else{l=c;var p=null;o%50==0?((p={start:l.start,end:l.end,list:[]}).list.push(l),n.push(p)):((p=n[n.length-1]).end=l.end,p.list.push(l)),o++}}r++}return{list:n,style:{}}}},{key:"parseVTTStyle",value:function(e,t){var i=e.split(":");if(i.length>1){var n=i[0].trim().split("-"),r="";n.length>1?n.map((function(e,t){r+=0===t?e:e.charAt(0).toUpperCase()+e.slice(1)})):r=n[0],t[r]=i[1].trim().replace(/;$/,"")}return t}},{key:"parseVTT",value:function(e){for(var t=(e=e.replace(Ej,"")).split("\n"),i=[],n=0,r=0,o=null,a=!1,s=!1,l=null,c=null,u=[];n<t.length;){var h=Nj(n,t).trim();if(!h||a&&Mj(h))a=!h;else if(xj.test(h)&&Cj.test(Nj(n-1,t).trim())){s=!0;var d=/\((.+?)\)/g.exec(h);c=d?d[1]:"",l=""}else if(s)Dj.test(h)?(u.push({key:c,style:l}),l=null,c=null,s=!1):l+=h;else if(h){a=!1;var f=this.checkIsTime(t[n]);if(f){var p=this.parseVttTime(f);if(!o||p.start!==o.start||p.end!==o.end){(o=p).text=[],o.textTag=[];var g=null;r%50==0?((g={start:o.start,end:o.end,list:[]}).list.push(o),i.push(g)):((g=i[i.length-1]).end=o.end,g.list.push(o)),r++}}else if(o){var v=o,y=v.text,m=v.textTag,_=this.parseVttText(t[n]);y.push(_.text),m.push(_.tag)}a=!1}n++}return{list:i,styles:u}}},{key:"checkIsTime",value:function(e){e=e.replace(/\s+/g,"");for(var t=0,i=null;t<Oj.length&&!(i=Oj[t].exec(e));)t++;return i?i[0]:null}},{key:"parseVttText",value:function(e){var t=/^(<?.+?>)/g.exec(e),i="",n="default";if(t){n=t[0].replace(/\<|\>|\&/g,"");var r=RegExp("^<".concat(n,">(([\\s\\S])*?)</").concat(n,">$")).exec(e);r?i=r[1]:(i=e,n="")}else i=e;for(var o=/<(\w+).(\w+)>/g,a=o.exec(i);a&&a.length>2;)i=i.replace(a[0],"<".concat(a[1],' class="').concat(a[2],'">')),a=o.exec(i);return{tag:n,text:i.replace(/\\n+/g,"<br/>")}}},{key:"parseVttTime",value:function(e){var t,i=e.split("--\x3e"),n=0;if(2===i.length){var r=i[0].split(":"),o=i[1].split(":");t=Rj(r),n=Rj(o)}return{start:t,end:n,time:e}}},{key:"isVTT",value:function(e){return Ej.test(e)}},{key:"isASS",value:function(e){return Pj.test(e)}},{key:"checkFormat",value:function(e){return e?Ej.test(e)?"vtt":Pj.test(e)?"ass":null:null}}]),e}(),Uj=[{code:0,msg:"SUCCESS"},{code:1,msg:"LOAD_ERROR"},{code:2,msg:"PARSER_ERROR"},{code:3,msg:"FORMAT_NOT_SUPPORTED"},{code:4,msg:"ID_OR_LANGUAGE_NOT_EXIST"},{code:5,msg:"PARAMETERS_ERROR"},{code:6,msg:"ABORT"},{code:7,msg:"UNKNOWN"},{code:8,msg:"DATA_ERROR:subtitle.url is null"},{code:9,msg:"DATA_ERROR:subtitle.url length is 0"}];function jj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
1,i={code:Uj[e].code,msg:Uj[e].msg};return Object.keys(t).map((function(e){i[e]=t[e]})),i}var Hj=gj((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.url,n=t.method,r=void 0===n?"GET":n,o=t.type,a=void 0===o?"arraybuffer":o,s=t.timeout,l=void 0===s?1e4:s,c=t.data,u=void 0===c?{}:c,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fj(this,e),new Promise((function(e,t){var n=new window.XMLHttpRequest,o=r.toUpperCase(),s=[];if(a&&(n.responseType=a),l&&(n.timeout=l),Object.keys(u).forEach((function(e){s.push("k=".concat(u[e]))})),n.onload=function(){200===n.status||206===n.status?e({context:h,res:n}):t(new Error({context:h,res:n,type:"error"}))},n.onerror=function(e){t(new Error({context:h,res:n,type:"error"}))},n.ontimeout=function(e){t(new Error({context:h,res:n,type:"error"}))},n.onabort=function(){t(new Error({context:h,res:n,type:"error"}))},"GET"===o)n.open(o,"".concat(i)),n.send();else{if("post"!==o)throw new Error("xhr ".concat(o," is not supported"));n.open(o,i),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.send(s.join("&"))}}))})),Fj=function(){function e(){var t,i;fj(this,e);var n=new Promise((function(e,n){t=e,i=n}));return n.resolve=function(e){t(e),n.state="fulfilled"},n.reject=function(e){i(e),n.state="rejected",n.isBreak="DESTROYED"===e},n.state="pending",n}return gj(e,[{key:"resolve",value:function(e){}},{key:"reject",value:function(e){}}]),e}();function Vj(e,t){if(!e)return!1;if(e.classList)return Array.prototype.some.call(e.classList,(function(e){return e===t}));var i=e.className&&"object"===dj(e.className)?e.getAttribute("class"):e.className;return i&&!!i.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function zj(e,t){e&&(e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):Vj(e,t)||(e.className&&"object"===dj(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t))}function Gj(e,t,i){var n=t.length;if(n<1)return-1;if(t[i=i<0?0:i>=n?n-1:i].start<=e&&e<t[i].end)return i;for(var r=t[i].end<=e?i+1:0;r<n;r++){if(t[r].start<=e&&e<t[r].end)return r;if(e>t[r].end&&r+1<n&&e<t[r+1].start)return-1;if(e>t[r].end&&r+1>=n)return-1}return-1}function Wj(e,t,i){var n=t.length;if(n<1)return[];var r=[];if((i=i<0?0:i>=n?n-1:i)<n)for(var o=t[i].end<=e?i:0;o<n&&(t[o].start<=e&&e<t[o].end&&r.push(o),!(e<t[o].start));o++);return r}function Kj(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function Yj(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);
1return r.className=n,r.innerHTML=t,Object.keys(i).forEach((function(t){var n=t,o=i[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(n,o):r.setAttribute(n,o)})),r}function $j(e,t,i){if(i||(i=new Fj),"json"===t){var n=Bj.parseJson(e);i.resolve({list:n,format:"json"})}else"string"===t&&Bj.parse(e,(function(e,t){if(t){var n=jj(2,t);i.reject(n,{format:e.format})}else if(e.format)i.resolve({styles:e.styles,list:e.list,format:e.format});else{var r=jj(3);i.reject(r)}}));return i}function qj(e,t){return t||(t=new Fj),new Hj({url:e.url,type:"text"}).then((function(i){$j(i.res.response,"string").then((function(i){t.resolve(hj(hj({},i),e))})).catch((function(e){t.reject(e)}))})).catch((function(i){var n=jj(1,hj({statusText:i.statusText,status:i.status,type:i.type,message:"http load error",url:e.src},e));t.reject(n)})),t}function Xj(e,t){return!!(e.id&&t.id&&e.id===t.id||e.language&&t.language&&e.language===t.language)}function Jj(e){return null!==e&&""!==e.trim()&&/^[a-zA-Z]+$/.test(e)}function Zj(e){return!!/[\x21-\x2f\x3a-\x40\x5b-\x60\x7B-\x7F]/.test(e)}var Qj=function(){function e(){var t=this;fj(this,e),this.__handlers=[],window.ResizeObserver&&(this.observer=new window.ResizeObserver((function(e){t.__trigger(e)})))}return gj(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var i=this.__handlers,n=-1,r=0;r<i.length;r++)i[r]&&e===i[r].target&&(n=r);n>-1?this.__handlers[n].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(i,n){e===i.target&&(t=n)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e,t){for(var i=this.__handlers,n=0;n<i.length;n++)if(i[n]&&e===i[n].target){i[n].handler&&i[n].handler.forEach((function(i){try{i(e,t)}catch(e){}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){var i=e.contentRect;
1t.__runHandler(e.target,i)}))}}]),e}(),eH=null,tH="resize",iH="change",nH="off";function rH(e){var t=[];return e&&"String"===Kj(e)?t.push({url:e,index:0,start:-1,end:-1}):"Array"===Kj(e)&&e.forEach((function(e,i){t.push({url:e.url||e.src,index:i,start:e.start||-1,end:e.end||-1})})),t}var oH=!1,aH=function(e){!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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mj(e,t)}(i,e);var t=kj(i);function i(e){var n,r,o,a,s,l,c;return fj(this,i),vj(_j(n=t.call(this)),"_onPause",(function(){n.stopRender()})),vj(_j(n),"_onPlay",(function(){n._curRenderTask.length>0&&n.startRender(-1)})),vj(_j(n),"_onTimeupdate",(function(){if(n._isOpen){var e=n.player.video,t=e.videoWidth,i=e.videoHeight;!n._videoMeta.scale&&t&&i&&n._onResize(n.player.root);var r=n._getPlayerCurrentTime();Math.round(Math.abs(1e3*r-n._ctime))<200||(n._ctime=1e3*r,n.currentText&&n.currentText.list&&("live"===n.config.updateMode?n._liveUpdate(r):n._update(r)))}})),vj(_j(n),"_onResize",(function(e){var t=_j(n),i=t._videoMeta;if(t.config.domRender){if(e&&e instanceof window.Element||(e=n.player.root),n._iId&&(clearTimeout(n._iId),n._iId=null),!i.scale){if(!n.player.video)return;var r=n.player.video,o=r.videoWidth,a=r.videoHeight;if(!o||!a)return;i.videoWidth=o,i.videoHeight=a,i.scale=parseInt(a/o*100,10)}n.__startResize(e)}})),vj(_j(n),"_onCoreEvents",(function(e){try{switch(e.eventName){case"core.subtitlesegments":n._onSubtitleSegment(e.list||[]);break;case"core.subtitleplaylist":n._onSubtitlePlaylist(e.list||[]);break;case"core.seipayloadtime":n._onCoreSeiintime(e)}}catch(e){}})),vj(_j(n),"startRender",(function(e){if(e>0&&n._renderIntervalId&&(window.cancelAnimationFrame(n._renderIntervalId),n._renderIntervalId=-1),n.textTrack){var t=_j(n)._curRenderTask;n._lastTimeStamp=(new Date).getTime();var i=[];t.forEach((function(t,r){var o=t.lastTime,a=t.wordList,s=t.interval,l=t.dom,c=t.ids;if(e<0||n._lastTimeStamp<0||n._lastTimeStamp-o>=s){var u=a.shift();u&&l.appendData(u),t.lastTime=n._lastTimeStamp}a.length<1&&i.push({index:r,ids:c})})),n._log(">>>>_renderByWords emptyArr",i.length,t.length),i.forEach((function(e){t.splice(e.index,1),n._log(">>>_renderByWords remove emptyArr",e.index,t.length)})),t.length>0&&(n._renderIntervalId=window.requestAnimationFrame(n.startRender))}})),vj(_j(n),"destroy",(function(){n.detachPlayer(),n.removeAllListeners(),n.player=null,n.textTrack=null,n._curRenderTask=[],n.stopRender()})),r=navigator.userAgent,o=/(?:Windows Phone)/.test(r),a=/(?:SymbianOS)/.test(r)||o,s=/(?:Android)/.test(r),l=/(?:Firefox)/.test(r),c=/(?:iPad|PlayBook)/.test(r)||s&&!/(?:Mobile)/.test(r)||l&&/(?:Tablet)/.test(r),oH=/(?:iPhone)/.test(r)&&!c||s||a||c,n.currentText=null,n.currentExtText=null,n.textTrack=[],n._cid=-1,n._gid=-1,n._cids=[],n._iId=null,n._iC=0,n.player=null,n.root=null,n.config={line:"double",bottom:0,mode:"stroke",defaultOpen:!1,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,fitVideo:!0,offsetBottom:2,fontColor:"#fff",domRender:!0,updateMode:"vod",renderMode:"",debugger:!1},n._ctime=0,n._loadingTrack={},Object.keys(n.config).map((function(t){void 0!==e[t]&&null!==e[t]&&(n.config[t]=e[t])})),n._isOpen=n.config.defaultOpen||!1,n._videoMeta={scale:0,videoHeight:0,videoWidth:0,lwidth:0,lheight:0,vWidth:0,vHeight:0,vBottom:0,vLeft:0,marginBottom:0},e.subTitles&&"Array"===Kj(e.subTitles)?(e.player&&n.attachPlayer(e.player),n.seiTime=0,n.lastSeiTime=0,n._curTexts=[],n._curRenderTask=[],n._renderIntervalId=-1,n._lastTimeStamp=-1,n.setSubTitles(e.subTitles,n.config.defaultOpen),n):bj(n)}return gj(i,[{key:"version",get:function(){return"3.0.10-alpha.4"}},{key:"setSubTitles",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this._isOpen||i;n&&this.innerRoot&&this.switchOff(),this.currentText=null,this.textTrack=[],t.forEach((function(t){var i={};Object.keys(t).map((function(e){i[e]=t[e]})),i.url=rH(i.url),i.isDefault&&(e.currentText=i),e.textTrack.push(i)})),this._log("setSubTitles",r),r&&this.switch().catch((function(t){e._log("[switch]",t)})),this.currentText&&this._loadTrack(this.currentText).then((function(t){e.addStyles(t)}
1)),this.emit("reset",{list:this.textTrack,isOpen:r})}},{key:"updateSubTitle",value:function(e){for(var t=this,i=-1,n=0;n<this.textTrack.length;n++)if(Xj(e,this.textTrack[n])){i=n;break}if(this._log("updateSubTitle",i,e),i>-1){var r=Xj(this.currentText,this.textTrack[i]);if(this._log("updateSubTitle","_isCurrent",r,"this.isOpen",this.isOpen,this.currentText),!r)return;var o=rH(e.url);this.isOpen?(o.forEach((function(e){t.textTrack[i].url.push(e)})),this._log("updateSubTitle _loadTrackUrls",this.textTrack[i]),this._loadTrackUrls(this.currentText,2)):this.textTrack[i].url=o}}},{key:"addStyles",value:function(e){var t=e.styles,i=e.format;t&&"vtt"===i&&(t.map((function(e){e.key||(e.key="xg-text-track-span")})),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i="";e.map((function(e){i+=" ".concat(t," ").concat(e.key," {").concat(e.style,"}")}));var n=document.createElement("style"),r=document.head||document.getElementsByTagName("head")[0];if(n.type="text/css",n.id="ssss",n.styleSheet){var o=function(){try{n.styleSheet.cssText=i}catch(e){}};n.styleSheet.disabled?setTimeout(o,10):o()}else{var a=document.createTextNode(i);n.appendChild(a)}r.appendChild(n)}(t,"xg-text-track"))}},{key:"attachPlayer",value:function(e){var t=this;if(this._log("attachPlayer"),e){this.player&&this.detachPlayer();var i,n,r=this.config,o=r.fontColor,a=r.mode,s=r.fitVideo,l=r.domRender;this.player=e,l&&(this.root=document.createElement("xg-text-track"),this.root.className="xg-text-track",!this._isOpen&&zj(this.root,"text-track-hide"),!s&&zj(this.root,"text-track-no-fitvideo"),a&&zj(this.root,"text-track-".concat(a)),this.innerRoot=document.createElement("xg-text-track-inner"),this.root.appendChild(this.innerRoot),o&&(this.root.style.color=o),this.currentText&&["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.player.root.appendChild(this.root),i=e.root,n=this._onResize,eH||(eH=new Qj),eH.addObserver(i,n)),this.player.on("destroy",this.destroy),this.player.on("timeupdate",this._onTimeupdate),this.player.on("pause",this._onPause),this.player.on("play",this._onPlay),this.player.on("core_event",this._onCoreEvents),this._isOpen&&this.switch().catch((function(e){t._log("[switch]",e)}))}}},{key:"detachPlayer",value:function(){var e,t,i=this.player,n=this.config;i&&(i.off("destroy",this.destroy),i.off("timeupdate",this._onTimeupdate),i.off("pause",this._onPause),i.off("play",this._onPlay),i.off("core_event",this._onCoreEvents),n.domRender&&(i.root&&(e=i.root,t=this._onResize,eH&&eH.unObserver(e,t),i.root.removeChild(this.root)),this.innerRoot=null,this.root=null),this.player=null)}},{key:"switch",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return this._log("switch",t),this._loadingTrack=t,new Promise((function(i,n){if(t.id||t.language)if(e.currentText&&Xj(t,e.currentText))e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn(),i(jj(0));else{var r=null;e.__removeByTime(e._curTexts,0);for(var o=0;o<e.textTrack.length;o++)if(Xj(t,e.textTrack[o])){r=e.textTrack[o];break}if(e._log("nextSubtitle",r),r)e._emitPlayerSwitch(e.currentText,r),r.list?(e._loadingTrack={},e._updateCurrent(r),e.switchOn(),i(jj(0))):(e._log("this._loadTrack",r),e._updateCurrent(r),e._loadTrack(r).then((function(t){if(e.addStyles(t),e._loadingTrack.id===r.id||e._loadingTrack.language===t.language)e._loadingTrack={},e._updateCurrent(t),e.switchOn(),i(jj(0));else{var o=jj(6,{message:"check _loadingTrack fail id: ".concat(e._loadingTrack.id," nextSubtitle:").concat(t.id)});n(o)}})).catch((function(e){n(e)})));else{var a=jj(4,new Error("The is no subtitle with id:[{".concat(t.id,"}] or language:[").concat(t.language,"]")));n(a)}}else{if(e.currentText){e._loadingTrack={},e._updateCurrent(e.currentText),e.switchOn();var s=jj(0,{message:"switch default subtitle success"});return void i(s)}var l=jj(5,{message:"no default subtitle"});n(l)}}))}},{key:"switchExt",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""};return new Promise((function(i,n){if(t.id||t.language){for(var r=null,o=0;o<e.textTrack.length;o++)if(Xj(t,e.textTrack[o])){r=e.textTrack[o];break}r&&!Xj(r,e.currentText)&&e._loadTrack(r).then((function(t){e.currentExtText=t,i(jj(0))}))}else e.currentExtText=null,i(jj(0))}))}},{key:"switchOn",value:function(){this._log("switchOn"),this._isOpen=!0,this.show(),this.emit
1(iH,this.currentText)}},{key:"switchOff",value:function(){this._isOpen=!1,this.hide(),this.emit(nH)}},{key:"isOpen",get:function(){return this._isOpen}},{key:"_log",value:function(){if(this.config.debugger){for(var e,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];(e=console).log.apply(e,["[xgSubtitle]"].concat(i))}}},{key:"_loadTrack",value:function(e){var t=this;this._log("_loadTrack",e.language,e);var i=new Fj,n="",r="";if(e.json?(n="json",r=e.json):e.stringContent&&!e.url&&(n="string",r=e.stringContent),r)return $j(r,n).then((function(t){e.format=t.format,e.styles=t.styles,e.list=t.list,i.resolve(e)})).catch((function(e){i.reject(e)})),i;var o=e.url;return 0===o.length?(i.resolve(e),i):(qj(o.splice(0,1)[0]).then((function(n){e.format=n.format,e.styles=n.styles,e.list||(e.list=[]),t._pushList(e.list,n.list),o.length>1&&t._loadTrackUrls(e,2),i.resolve(e)})).catch((function(e){i.reject(e)})),i)}},{key:"_emitPlayerSwitch",value:function(e,t){e&&"live"===this.config.updateMode&&(e.list=[],e.url=[]);var i=hj({lang:t.language},t);this._log("emit subtile_switch ",t,i),this.player&&this.player.emit("switch_subtitle",i)}},{key:"_loadTrackUrls",value:function(e,t,i){var n=this,r=e.url.length,o=r>t?e.url.splice(0,t):e.url.splice(0,r),a=o.length;this._log("_loadTrackUrls",e.language,r,o.length,a),o.forEach((function(t,r){qj(hj(hj({},t),{},{index:r})).then((function(t){e.format=t.format,e.styles=t.format,e.list||(e.list=[]),n._pushList(e.list,t.list),a--})).catch((function(e){a--})).finally((function(t){0===a&&(i&&i.resolve(e),n._loadTrackUrls(e,2))}))}))}},{key:"_freshUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{url:""},i=-1;e.url.forEach((function(e,n){e.url===t.url&&(i=n)})),i>-1&&e.url.splice(i,1)}},{key:"_pushList",value:function(e,t){var i=t[0].start,n=t[t.length-1].end;if(0===e.length||i>=e[e.length-1].end)t.forEach((function(t){e.push(t)}));else{for(var r=-1,o=0;o<e.length;o++)if(e[o].start>n){r=o;break}r>-1&&t.forEach((function(t,i){e.splice(r+i,0,t)}))}return e}},{key:"_updateCurrent",value:function(e){var t=this;this.currentText=e,this.config.domRender&&this.root&&(["language","id","label"].map((function(e){t.root.setAttribute("data-".concat(e),t.currentText[e]||"")})),this.__remove(this._cids)),this._cids=[],this._gid=-1,this._cid=-1,this._curTexts=[];var i=this._getPlayerCurrentTime();i&&("live"===this.config.updateMode?this._liveUpdate(i):this._update(i))}},{key:"__loadAll",value:function(){var e=this;this.textTrack.forEach((function(t){e._loadTrack(t)}))}},{key:"getDelCid",value:function(e,t){for(var i=[],n=0;n<e.length;n++)t.includes(e[n])||i.push(e[n]);return i}},{key:"getNewCid",value:function(e,t){for(var i=[],n=0;n<t.length;n++)e.includes(t[n])||i.push(t[n]);return i}},{key:"_liveUpdate",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=[],n=Gj(e,this.currentText.list,this._gid);if(n>-1&&(i=Wj(e,this.currentText.list[n].list,this._cid)),this.__removeByTime(this._curTexts,e),this._log("_liveUpdate",e,n,i,this.currentText.list[0].list[0].start,this.currentText.list[0].list[0].end),i.length>0){var r=function(e,t,i){if(0===e.length||t<0||t>e.length-1)return[];var n=e[t].list;if(0===i.length)return[];var r=n.splice(i[0],i.length);return t>0&&e.splice(0,t),0===n.length&&e.splice(0,1),r}(this.currentText.list,n,i),o=this._curTexts.length,a=o>0?this._curTexts[o-1].index:0;r.forEach((function(e,i){e.index=i+a,t._curTexts.push(e)})),this.__render(r)}this.emit("update",this._curTexts)}}},{key:"_update",value:function(e){var t=this;if(this.currentText&&this.currentText.list&&this.currentText.list.length){var i=Gj(e,this.currentText.list,this._gid),n=[];if(i>-1&&(n=Wj(e,this.currentText.list[i].list,this._cid)),n.length<1)return this._cids.length>0&&this.config.domRender&&this.__remove(this._cids),void(this._cids=[]);if(this._cids!==n||i!==this._gid){this._gid=i,this._cid=n[0];var r=this.getDelCid(this._cids,n),o=this.getNewCid(this._cids,n);this._cids=n,this.config.domRender&&this.__remove(r);var a=[];o.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,a.push(n)})),this.currentExtText&&o.map((function(e){var n=t.currentText.list[i].list[e];n.index=e,a.push(n)}
1)),this._log("update",a,e),this.emit("update",a),this.__render(a,e)}}}},{key:"_getPlayerCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.currentTime;return parseInt(1e3*e+1e3*this.seiTime-1e3*this.lastSeiTime,10)/1e3}},{key:"_onSubtitlePlaylist",value:function(e){this._log("_onSubtitlePlaylist",e);var t=e.map((function(e){return{label:e.name,language:e.lang,id:e.id,isDefault:e.default,url:[],mUrl:e.url}}));this.setSubTitles(t)}},{key:"_onSubtitleSegment",value:function(e){if(this._log("_onSubtitleSegment",e.length,e[0].lang,e[0].sn,e[e.length-1].sn,e[0].start,e[e.length-1].end),e&&0!==e.length){var t={language:e[0].lang,url:e.map((function(e){return{id:e.sn,url:e.url,duration:e.duration,start:e.start,end:e.end}}))};Xj(t,this.currentText)&&this.updateSubTitle(t)}}},{key:"_onCoreSeiintime",value:function(e){try{var t=e.time/1e3;this._log("_onCoreSeiintime sei",t,this.seiTime,this.lastSeiTime),this.seiTime=t,this.lastSeiTime=this.player?this.player.currentTime:0}catch(e){}}},{key:"resize",value:function(e,t){var i,n=this,r=this.config,o=r.baseSizeX,a=r.baseSizeY,s=r.minMobileSize,l=r.minSize,c=r.fitVideo,u=r.offsetBottom,h=this._videoMeta.scale;this._videoMeta.lwidth=e,this._videoMeta.lheight=t;var d=0;t/e*100>=h?(d=parseInt(h*e,10)/100,i=e):(d=t,i=parseInt(t/h*100,10)),this._videoMeta.vWidth=i,this._videoMeta.vHeight=d;var f=0,p=0;h>120?(f=a,p=parseInt(f*d/1080,10)):(f=o,p=parseInt(f*i/1920,10));var g=oH?s:l,v={fontSize:p=p<g?g:p>f?f:p},y=parseInt((t-d)/2,10),m=parseInt((e-i)/2,10),_=parseInt(d*u,10)/100;this._videoMeta.vBottom=y,this._videoMeta.vLeft=m,this._videoMeta.marginBottom=_,c&&(v.bottom=y+_,v.left=v.right=m),Object.keys(v).map((function(e){n.root.style[e]="".concat(v[e],"px")})),this.emit(tH,{vLeft:m,vBottom:y,marginBottom:_,vWidth:i,vHeight:d,fontSize:p,scale:h})}},{key:"__startResize",value:function(e){var t=this,i=e.getBoundingClientRect(),n=this._videoMeta,r=i.width,o=i.height;if(this._iId&&(clearTimeout(this._iId),this._iId=null),r>0&&o>0&&(r!==n.lwidth||o!==n.lheight))this._iC=0,this.resize(r,o);else{if(this._iC>=5)return void(this._iC=0);this._iC++,this._iId=setTimeout((function(){t.__startResize(e)}),50)}}},{key:"__removeByTime",value:function(e,t){for(var i=[],n=0;n<e.length;n++)(!t||e[n].end<t)&&i.push(n);0!==i.length&&(e.splice(i[0],i.length),this.config.domRender&&this.__remove(i))}},{key:"__remove",value:function(e){var t=this;if(e&&!(e.length<1)){this._log(">>>>_renderByWords__remove",e);for(var i=this.innerRoot.children,n=[],r=0;r<i.length;r++){var o=Number(i[r].getAttribute("data-index"));e.includes(o)&&n.push(i[r])}n.map((function(e){t.innerRoot.removeChild(e)}))}}},{key:"__render",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._log("__render",t.length,this.config.domRender);var i=this.config,n=i.renderMode,r=i.domRender;t.length>0&&r&&t.forEach((function(t){var i="text-track-".concat(e.config.line);t.text.forEach((function(r,o){o>0&&(i+=" text-track-deputy");var a={"data-start":t.start,"data-end":t.end,"data-index":t.index},s=Yj("xg-text-track-span","",a,i);if(e.innerRoot.appendChild(s),"step"===n){var l=Yj("xg-text-track-span","",a,"".concat(i," text-track-space"));e.innerRoot.appendChild(l),l.innerHTML=r,e._renderByWords(s,o,t.start,t.end,r)}else s.innerHTML=r}))}))}},{key:"_renderByWords",value:function(e,t,i,n,r){var o=document.createTextNode("");e.appendChild(o);var a=function(e){for(var t=e.split(""),i=[],n=!1,r=0;r<t.length;r++){var o=t[r];if(Jj(o))if(n){var a=i.length-1;i[a]="".concat(i[a]).concat(o)}else i.push(o),n=!0;else if(o.match(/^[ ]*$/)||Zj(o)||/[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/.test(o)){n=!1;var s=i.length-1;i[s]="".concat(i[s]).concat(o)}else n=!1,i.push(o)}return i}(r),s=parseInt(1e3*(n-i),10);s>300&&(s-=100);var l={dom:o,ids:t,wordList:a,interval:s/a.length,start:i,end:n,duration:s,lastTime:0};this._log(">>>>_renderByWords",s,l);for(var c=this._curRenderTask,u=-1,h=0;h<c.length;h++)if(c[h].ids===t){u=h;break}u>
1-1&&c.slice(u,1),c.push(l),this.startRender(-1)}},{key:"stopRender",value:function(){this._renderIntervalId&&window.cancelAnimationFrame(this._renderIntervalId)}},{key:"show",value:function(){var e,t;this.config.domRender&&(t="text-track-hide",(e=this.root)&&(e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):Vj(e,t)&&t.split(/\s+/g).forEach((function(t){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===dj(e.className)?e.setAttribute("class",e.getAttribute("class").replace(i," ")):e.className=e.className.replace(i," ")}))))}},{key:"hide",value:function(){this.config.domRender&&(zj(this.root,"text-track-hide"),this.innerRoot.innerHTML="")}},{key:"emit",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=Sj(yj(i.prototype),"emit",this)).call.apply(n,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=Sj(yj(i.prototype),"on",this)).call.apply(n,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=Sj(yj(i.prototype),"once",this)).call.apply(n,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var n,r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];(n=Sj(yj(i.prototype),"off",this)).call.apply(n,[this,e,t].concat(o))}},{key:"offAll",value:function(){Sj(yj(i.prototype),"removeAllListeners",this).call(this)}},{key:"marginBottom",get:function(){var e=this._videoMeta,t=e.bottom,i=e.marginBottom;return this.config.fitVideo?t+i:i}}]),i}(zn),sH=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this))._onChange=function(e){var t=n._media.textTracks;if(t&&0!==t.length){for(var i=[],r=[],o=-1,a=0;a<t.length;a++){var s=t[a];"subtitles"===s.kind&&(i.push({id:s.id||s.language,language:s.language,text:s.label,isDefault:"showing"===s.mode}),-1===o&&"showing"===s.mode&&(o=a),r.push(s.language))}r.join("|")!==n._languages?(n._languages=r.join("|"),n.emit("reset",{list:i,isOpen:o>-1})):-1===o?n.emit("off"):n.curIndex!==o&&n.emit("change",i[o]),n.curIndex=o}},n._media=e,n._list=[],n._languages="",n.curIndex=-1,n._init(),n}return f(i,[{key:"_init",value:function(){var e=this._media.textTracks;e?(e.addEventListener("change",this._onChange),e.addEventListener("addtrack",this._onChange)):Ul.warn("current browser not support native subtitle")}},{key:"switch",value:function(e){var t=this;return new Promise((function(i,n){if(!e)return n({code:1,message:"no subtitle data"});for(var r=t._media.textTracks,o=0;o<r.length;o++){var a=r[o];a.language===e.language?a.mode="showing":"showing"===a.mode&&(a.mode="disabled")}return i({code:0})}))}},{key:"switchOff",value:function(){for(var e=this._media.textTracks,t=0;t<e.length;t++)e[t].mode="disabled";this.curIndex=-1}},{key:"destroy",value:function(){this._media.textTracks.removeEventListener("change",this._onChange),this._media=null,this._list=[],this._languages="",this.curIndex=-1}}]),i}(zn);function lH(){return(new DOMParser).parseFromString('<svg width="18" height="16" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2 0.5C0.895431 0.5 0 1.39543 0 2.5V13.5C0 14.6046 0.89543 15.5 2 15.5H16C17.1046 15.5 18 14.6046 18 13.5V2.5C18 1.39543 17.1046 0.5 16 0.5H2ZM7.49634 11.0454C8.00741 10.606 8.29061 10.0037 8.34595 9.23877H6.8811C6.84855 9.67171 6.71997 9.99235 6.49536 10.2007C6.27401 10.4058 5.93709 10.5083 5.48462 10.5083C4.98332 10.5083 4.61548 10.3309 4.3811 9.97607C4.14998 9.62126 4.03442 9.05973 4.03442 8.2915V7.75439C4.04093 7.01872 4.16463 6.47673 4.40552 6.12842C4.64966 5.77686 5.01587 5.60107 5.50415 5.60107C5.95337 5.60107 6.28703 5.70524 6.50513 5.91357C6.72648 6.11865 6.85506 6.45068 6.89087 6.90967H8.35571C8.27759 6.1154 7.98787 5.49854 7.48657 5.05908C6.98527 4.61963 6.32446 4.3999 5.50415 4.3999C4.9117 4.3999 4.39087 4.53988 3.94165 4.81982C3.49569 5.09652 3.15226 5.49528 2.91138 6.01611C2.67049 6.53695 2.55005 7.13916 2.55005 7.82275V8.25732C2.55005 9.32829 2.81047 10.1714 3.3313 10.7866C3.85539 11.3986 4.57316 11.7046 5.48462 11.7046C6.31795 11.7046 6.98853 11.4849 7.49634 11.0454ZM14.5393 11.0454C15.0504 10.606 15.3336 10.0037 15.3889 9.23877H13.9241C13.8915 9.67171 13.7629 9.99235 13.5383 10.2007C13.317 10.4058 12.9801 10.5083 12.5276 10.5083C12.0263 10.5083 11.6584 10.3309 11.4241 9.97607C11.193 9.62126 11.0774 9.05973 11.0774 8.2915V7.75439C11.0839 7.01872 11.2076 6.47673 11.4485 6.12842C11.6926 5.77686 12.0588 5.60107 12.5471 5.60107C12.9963 5.60107 13.33 5.70524 13.5481 5.91357C13.7695 6.11865 13.898 6.45068 13.9338 6.90967H15.3987C15.3206 6.1154 15.0308 5.49854 14.5295 5.05908C14.0282 4.61963 13.3674 4.3999 12.5471 4.3999C11.9547 4.3999 11.4338 4.53988 10.9846 4.81982C10.5387 5.09652 10.1952 5.49528 9.95435 6.01611C9.71346 6.53695 9.59302 7.13916 9.59302 7.82275V8.25732C9.59302 9.32829 9.85343 10.1714 10.3743 10.7866C10.8984 11.3986 11.6161 11.7046 12.5276 11.7046C13.3609 11.7046 14.0315 11.4849 14.5393 11.0454Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}function cH(){return(new DOMParser).parseFromString('<svg width="18" height="16" viewB
1ox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.49609 11.0454C8.00716 10.606 8.29037 10.0037 8.3457 9.23877H6.88086C6.84831 9.67171 6.71973 9.99235 6.49512 10.2007C6.27376 10.4058 5.93685 10.5083 5.48438 10.5083C4.98307 10.5083 4.61523 10.3309 4.38086 9.97607C4.14974 9.62126 4.03418 9.05973 4.03418 8.2915V7.75439C4.04069 7.01872 4.16439 6.47673 4.40527 6.12842C4.64941 5.77686 5.01562 5.60107 5.50391 5.60107C5.95312 5.60107 6.28678 5.70524 6.50488 5.91357C6.72624 6.11865 6.85482 6.45068 6.89062 6.90967H8.35547C8.27734 6.1154 7.98763 5.49854 7.48633 5.05908C6.98503 4.61963 6.32422 4.3999 5.50391 4.3999C4.91146 4.3999 4.39062 4.53988 3.94141 4.81982C3.49544 5.09652 3.15202 5.49528 2.91113 6.01611C2.67025 6.53695 2.5498 7.13916 2.5498 7.82275V8.25732C2.5498 9.32829 2.81022 10.1714 3.33105 10.7866C3.85514 11.3986 4.57292 11.7046 5.48438 11.7046C6.31771 11.7046 6.98828 11.4849 7.49609 11.0454Z" fill="white"/>\n<path d="M14.5391 11.0454C15.0501 10.606 15.3333 10.0037 15.3887 9.23877H13.9238C13.8913 9.67171 13.7627 9.99235 13.5381 10.2007C13.3167 10.4058 12.9798 10.5083 12.5273 10.5083C12.026 10.5083 11.6582 10.3309 11.4238 9.97607C11.1927 9.62126 11.0771 9.05973 11.0771 8.2915V7.75439C11.0837 7.01872 11.2074 6.47673 11.4482 6.12842C11.6924 5.77686 12.0586 5.60107 12.5469 5.60107C12.9961 5.60107 13.3298 5.70524 13.5479 5.91357C13.7692 6.11865 13.8978 6.45068 13.9336 6.90967H15.3984C15.3203 6.1154 15.0306 5.49854 14.5293 5.05908C14.028 4.61963 13.3672 4.3999 12.5469 4.3999C11.9544 4.3999 11.4336 4.53988 10.9844 4.81982C10.5384 5.09652 10.195 5.49528 9.9541 6.01611C9.71322 6.53695 9.59277 7.13916 9.59277 7.82275V8.25732C9.59277 9.32829 9.85319 10.1714 10.374 10.7866C10.8981 11.3986 11.6159 11.7046 12.5273 11.7046C13.3607 11.7046 14.0312 11.4849 14.5391 11.0454Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M0 2.5C0 1.39543 0.895431 0.5 2 0.5H16C17.1046 0.5 18 1.39543 18 2.5V13.5C18 14.6046 17.1046 15.5 16 15.5H2C0.89543 15.5 0 14.6046 0 13.5V2.5ZM2 2.3H16C16.1105 2.3 16.2 2.38954 16.2 2.5V13.5C16.2 13.6105 16.1105 13.7 16 13.7H2C1.88954 13.7 1.8 13.6105 1.8 13.5V2.5C1.8 2.38954 1.88954 2.3 2 2.3Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var uH=Bo.POSITIONS,hH="mobile"===ir.device,dH="text-close";function fH(){var e=-1;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t,i){t.id||t.language||(t.id=""+i),!t.url&&(t.url=t.src),!t.text&&(t.text=t.label),!t.language&&(t.language=t.srclang),void 0===t.isDefault&&(t.isDefault=t.default),(t.isDefault||t.default)&&(e<0?e=i:t.isDefault=t.default=!1)})),e}var pH=function(e){g(i,e);var t=k(i);function i(e){var n;h(this,i),(n=t.call(this,e)).isOpenState=!0,n.optionList=null,n.currentLang="",n.handlerClickSwitch=function(e,t){e.stopPropagation(),e.preventDefault(),n.subTitles&&(t.type===dH?n.switchOffSubtitle():n.switchSubTitle({language:t.language,id:t.id}))},n.onPlayerFocus=function(e){n.subTitles&&n.config.style.follow&&n.rePosition()},n.onPlayerBlur=function(e){n.subTitles&&n.config.style.follow&&!n.playerConfig.marginControls&&n.subTitles.root&&(n.subTitles.root.style.transform="translate(0, 0)")};var r=e.player;return e.config,r.config.isLive&&(e.config.updateMode="live",ir.os.isIos&&(e.config.mode="native")),n}return f(i,[{key:"afterCreate",value:function(){var e=this.config.list,t=void 0===e?[]:e;this.curIndex=-1,this.curItem=null;var n=fH(t);S(v(i.prototype),"afterCreate",this).call(this),"native"===this.config.mode?this._initNativeSubtitle(n):this._initExtSubTitle(n)}},{key:"_initNativeSubtitle",value:function(e){var t=this.player;t._subTitles||(t._subTitles=new sH(t.video)),this.subTitles=t._subTitles,this.subTitles.on("off",this._onOff.bind(this)),this.subTitles.on("change",this._onChange.bind(this)),this.subTitles.on("reset",this._onListReset.bind(this)),this._renderList(e)}},{key:"_initExtSubTitle",value:function(e){var t=this.config,i=t.list,n=void 0===i?[]:i,r=t.style,o=t.isDefaultOpen,a=t.updateMode,s={subTitles:n,defaultOpen:o,debugger:!1,renderMode:t.renderMode,updateMode:a};this.isOpenState=o,Object.keys(r).map((function(e){s[e]=r[e]})),!this.playerConfig.marginControls&&this.player.controls.root&&(this.on(Tr,this.onPlayerFocus),this.on(Er,this.onPlayerBlur));var l=this.player;l._subTitles?l._subTitles._isOpen&&(e=this.getSubTitleIndex(this.config.list,l._subTitles.currentText)):(l._subTitles=new aH(s),l._subTitles.attachPlayer(this.player),this.changeTipText()),this.subTitles=l._subTitles,this.subTitles.on("off",this._onOff.bind(this)),this.subTitles.on("change",this._onChange.bind(this)),this.subTitles.on("reset",this._onListReset.bind(this)),r.follow&&this.subTitles.root&&qn.addClass(this.subTitles.root,"follow-control"),this._renderList(e)}},{key:"_renderList",value:function(e){var t=this.config,i=t.list,n=void 0===i?[]:i,r=t.isDefaultOpen;n.length&&(r&&e<0?(n[0].isDefault=!0,this.curIndex=0,this.curItem=n[0]):(this.curIndex=e,this.curItem=n[e])),this.appendChild(".xgplayer-icon",this.icons.vttSubOpen),this.appendChild(".xgplayer-icon",this.icons.vttSubClose),this.creatOptionList(),this.initEvents(),this.isOpenState?qn.addClass(this.root,"isOpen"):qn.addClass(this.root,"isClose")}},{key:"_onOff",value:function(){this.noShowSubtitle()}},{key:"_onChange",value:function(e){var t=this.getSubTitleIndex(this.config.list,e);t<0||this.updateCurItem(t,e)}},{key:"_onListReset",value:function(e){this.updateList(e)}},{key:"updateCurItem",value:function(e,t){this.curIndex=e,this.curItem=this.config.list[e-1],this.renderItemList(),this.emit
1("subtitle_change",a({off:!1,isListUpdate:!1,list:[]},t))}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this)),this.bind(["mouseenter"],this.showList.bind(this)),this.bind(["mouseleave"],this.hideList.bind(this)),this._delegates=[]}},{key:"handleButtonChange",value:function(e){e.preventDefault(),e.stopPropagation(),e.delegateTarget||(hH?this.showMobilePanel():this.isOpenState?this.switchOffSubtitle():this.openSubtitle())}},{key:"showList",value:function(){var e;!hH&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.show())}},{key:"hideList",value:function(){var e;!hH&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.hide())}},{key:"openSubtitle",value:function(){this.curIndex>-1&&this.curItem&&this.switchSubTitle(this.curItem)}},{key:"getSubTitleIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"",language:""},i=-1;return t&&(t.id||t.language)?(e.forEach((function(e,n){e.id!==t.id&&e.language!==t.language||(i=n)})),i):i}},{key:"registerIcons",value:function(){return{vttSubOpen:{icon:lH,class:"xgplayer-vttsub-open-svg"},vttSubClose:{icon:cH,class:"xgplayer-vttsub-close-svg"}}}},{key:"registerLanguageTexts",value:function(){return{sub:{jp:"åå¹",en:"Subtitles",zh:"åå¹","zh-hk":"åå¹"},subOpen:{jp:"åå¹ããªã³ã«ãã",en:"Show subtitles",zh:"å¼å¯åå¹","zh-hk":"éååå¹"}
1,subClose:{jp:"ã¯ãã¼ãºããã£ãã·ã§ã³",en:"Hide subtitles",zh:"å
³éåå¹","zh-hk":"ééåå¹"}}}},{key:"creatOptionList",value:function(){var e=this;if(!hH){var t={config:{data:this.getList(),className:"",onItemClick:function(t,i){e.handlerClickSwitch(t,null==i?void 0:i.to)}},root:this.root};this.optionList=new Us(t)}}},{key:"getList",value:function(){var e=this;return this.config.list.map((function(t,i){return i===e.curIndex&&e.isOpenState?(t.isCurrent=!0,t.selected=!0):(t.isCurrent=!1,t.selected=!1),t.showText=e.getTextByLang(t),t}))}},{key:"renderOptionList",value:function(){this.optionList.renderItemList(this.getList())}},{key:"switchSubTitle",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"",language:""},i=-1;if(t&&(t.id||t.language)&&(this.config.list.map((function(e,n){e.id+""==t.id+""&&e.language+""==t.language+""&&(i=n)})),!(i<0||this.isOpenState&&i===this.curIndex)))return this.subTitles.switch(t).then((function(n){0===n.code&&(t.off=!1,t.isListUpdate=!1,t.list=[],e.curIndex=i,e.curItem=e.config.list[i],e.isOpenState=!0,qn.removeClass(e.root,"isClose"),qn.addClass(e.root,"isOpen"),e.renderItemList(),e.changeTipText(),e.emit("subtitle_change",t))})).catch((function(e){return Ul.error("switch subtitle err: ",e)}))}},{key:"switchOffSubtitle",value:function(){this.subTitles.switchOff(),this.noShowSubtitle()}},{key:"noShowSubtitle",value:function(){var e;this.emit("subtitle_change",{off:!0,isListUpdate:!1,list:[]}),this.isOpenState=!1,qn.addClass(this.root,"isClose"),qn.removeClass(this.root,"isOpen"),this.renderItemList(),this.changeTipText(),null===(e=this.optionList)||void 0===e||e.hide()}},{key:"renderItemList",value:function(){hH?this.updatePanel():this.renderOptionList()}},{key:"updateSubtitles",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(this.updateList({list:e}),this.subTitles&&this.subTitles.setSubTitles(this.config.list,this.curIndex>-1,t))}},{key:"updateList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.list){var t=[];e.list.map((function(e){t.push(e)}));var i,n,r,o,a=fH(t);e.isOpen?(this.isOpenState=!0,this.curIndex=a,this.curItem=a>-1?t[a]:null,qn.removeClass(this.root,"isClose"),qn.addClass(this.root,"isOpen")):(this.isOpenState=!1,this.curIndex=-1,this.curItem=null,qn.removeClass(this.root,"isOpen"),qn.addClass(this.root,"isClose"),this.changeTipText(),null===(i=this.optionList)||void 0===i||i.hide()),this.config.list=t,t.length>0?hH||null===(n=this.optionList)||void 0===n||n.hide():(this.switchOffSubtitle(),hH?this.showMobilePanel():null===(r=this.optionList)||void 0===r||r.show(),hH||null===(o=this.optionList)||void 0===o||o.hide(),this.hide()),this.renderItemList()}}},{key:"changeTipText",value:function(){this.isOpenState?this.find(".xg-tips").innerHTML=this.langText.subClose:this.find(".xg-tips").innerHTML=this.langText.subOpen}},{key:"showMobilePanel",value:function(){var e,t=this.renderPanel();null===(e=this.player.panel)||void 0===e||e.showPanel(t,this.langText.sub,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderPanel();null===(e=this.player.panel)||void 0===e||e.updatePanel(t)}},{key:"renderPanel",value:function(){var e=this,t=E(this.config.list),i=qn.createDom("div","",{},"ai-panel-content");t.map((function(t,n){var r=a({language:t.language||t.srclang,"data-id":t.id,selected:e.isOpenState&&e.curIndex===n,showText:e.getTextByLang(t)},t),o=e.renderPanelItem(r);i.appendChild(o)}));var n={showText:this.langText.subClose,"data-type":dH,selected:!this.isOpenState};return i.appendChild(this.renderPanelItem(n)),i}},{key:"renderPanelItem",value:function(e){var t=this,i=e.showText,n=e.selected,r=qn.createDom("div","",{language:e.language,"data-id":e["data-id"],"data-type":e["data-type"]},"panel-Item ".concat(n?"select-in":""));r.innerHTML=i;var o=hH?"touchend":"click",a=Bo.delegate(r,".panel-Item",o,(function(i){e["data-type"]===dH?(i.stopPropagation(),i.preventDefault(),t.switchOffSubtitle()):t.handlerClickSwitch(i,e)}));return this._delegates.push(a),r}},{key:"getTextByLang",value:function(e,t,i){if(void 0===e)return"";var n=this.config.list;return!i&&(i=this.player.lang),t=!t||qn.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=n[e]),"object"===l(e[t])?e[t][i]||e[t].zh:e[t]||""}},{key:"rePosition",value:function(){var e=this.config.style.fitVideo,t=0-this.player.controls.root.getBoundingClientRect().height;if(e){var i=this.player,n=i.video,r=i.root.getBoundingClientRect(),o=r.height,a=r.width,s=n.videoHeight,l=n.videoWidth,c=parseInt(s/l*100,10)*a/100;c>o&&(c=o);var u=(o-c)/2-t;u<0&&(this.subTitles.root.style.transform="translate(0, ".concat(u,"px)"))}else this.subTitles.root.style.transform="translate(0, ".concat(t,"px)")}},{key:"destroy",value:function(){var e;this.subTitles&&(this.subTitles.destroy(),this.subTitles=null),this.unbind(["click"],this.handleButtonChange.bind(this)),this.unbind(["mouseenter"],this.showList.bind(this)),this.unbind(["mouseleave"],this.hideList.bind(this)),null===(e=this.optionList)||void 0===e||e.destroy(),this._delegates&&this._delegates.length>0&&(this._delegates.map((function(e){Array.isArray(e)&&e.map((function(e){e.destroy&&e.destroy()})),e.destroy&&e.destroy()})),this._delegates=null),S(v(i.prototype),"destroy",this).call(this)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-vttsub">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="vttSubOpen">'.concat(this.langText.subOpen,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"Subtitle"}},{key:"defaultConfig",get:function(){return{position:uH.CONTROLS_RIGHT,index:NM,list:[],isDefaultOpen:!0,style:{follow:!0,mode:"stroke",followBottom:50,fitVideo:!0,offsetBottom:4,baseSizeX:49,baseSizeY:28,minSize:16,minMobileSize:13,line:"double",fontColor:"#fff"}
1,isShowIcon:!0,mode:"external",updateMode:"vod"}}}]),i}(Bo),gH=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).toastNumber=0,n.toastMaps={},n}return f(i,[{key:"beforePlayerInit",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"afterCreate",value:function(){}},{key:"destroy",value:function(){}},{key:"add",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.toastNumber+1;this.toastNumber=r;var o=this.renderToast(e,n,r);return this.root.appendChild(o),this.toastMaps[r]=o,i&&setTimeout((function(){t.remove(r)}),i),r}},{key:"remove",value:function(e){var t=this.toastMaps[e];t&&(this.root.contains(t)&&this.root.removeChild(t),delete this.toastMaps[e])}},{key:"renderToast",value:function(e,t,i){var n=this,r=qn.createDom("div","",void 0,"toast-container"),o=qn.checkIsObject(e)?e:qn.createDom("div",e,void 0,"toast-txt");if(r.appendChild(o),t){var a=qn.createDom("span","Ã",void 0,"toast-close-bt");a.addEventListener("click",(function(){n.remove(i)})),r.appendChild(a)}return r}},{key:"render",value:function(){return'<xg-sdk-toast class="xgplayer-sdk-toast"></xg-sdk-toast>'}}],[{key:"pluginName",get:function(){return"sdkToastPlugin"}},{key:"defaultConfig",get:function(){return{index:5}}}]),i}(Bo);function vH(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function yH(e,t,i){return t&&vH(e.prototype,t),i&&vH(e,i),e}function mH(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _H(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function bH(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?_H(Object(i),!0).forEach((function(t){mH(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):_H(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var kH="xgplayer_device_id",wH="xgplayer_user_id",SH=function(e){if(!document.cookie)return null;for(var t=document.cookie.split(";"),i=0,n=t.length;i<n;i++){var r=t[i];if(t[i].indexOf(e)>=0)return r.split("=")[1]||null}},TH=function(e){return String(Math.floor(Math.random()*Math.pow(10,e)))},EH=function(){var e=SH(kH);if(e)return e;var t=TH(11);return document.cookie=kH+"="+t+";max-age=31536000;path=/",t},CH=function(){var e=SH(wH);if(e)return e;var t=TH(12);return document.cookie=wH+"="+t+";max-age=31536000;path=/",t},xH={get device(){return xH.os.isPc?"pc":"mobile"},get browser(){var e=function(){var e=navigator.userAgent.toLowerCase(),t={},i={IE:window.ActiveXObject||"ActiveXObject"in window,Chrome:e.indexOf("chrome")>-1&&e.indexOf("safari")>-1,Firefox:e.indexOf("firefox")>-1,Opera:e.indexOf("opera")>-1,Safari:e.indexOf("safari")>-1&&-1==e.indexOf("chrome"),Edge:e.indexOf("edge")>-1,QQBrowser:/qqbrowser/.test(e),WeixinBrowser:/MicroMessenger/i.test(e)};for(var n in i)if(i[n]){var r="";if("IE"===n)r=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2];else if("Chrome"===n){for(var o in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[o].type&&(n="360");var a=e.match(/chrome\/([\d.]+)/);r=a?a[1]:"-1"}else if("Firefox"===n){var s=e.match(/firefox\/([\d.]+)/);r=s?s[1]:"-1"}else if("Opera"===n){var l=e.match(/opera\/([\d.]+)/);r=l?l[1]:"-1"}else if("Safari"===n){var c=e.match(/version\/([\d.]+)/);r=c?c[1]:"-1"}else if("Edge"===n){var u=e.match(/edge\/([\d.]+)/);r=u?u[1]:"-1"}else if("QQBrowser"===n){var h=e.match(/qqbrowser\/([\d.]+)/);r=h?h[1]:"-1"}t.type=n,t.versions=parseInt(r)}return t}();return e.type+"_"+e.versions},get os(){var e=navigator.userAgent;navigator.platform.toLowerCase();var t=/(?:Windows Phone)/.test(e),i=/(?:SymbianOS)/.test(e)||t,n=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||n&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),a=/(?:iPhone)/.test(e)&&!o;return{isTablet:o,isPhone:a,isAndroid:n,isPc:!(a||n||i||o),isSymbian:i,isWindowsPhone:t,isFireFox:r}},get operation_os(){for(var e=navigator.userAgent,t=[{s:"windows",r:/(Windows 10.0|W
1indows NT 10.0|Windows NT 10.1|Windows 8.1|Windows NT 6.3|Windows 8|Windows NT 6.2|Windows 7|Windows NT 6.1)/},{s:"android",r:/Android/},{s:"linux",r:/(Linux|X11)/},{s:"ios",r:/(iPhone|iPad|iPod)/},{s:"mac",r:/Mac OS X/},{s:"mac",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],i=0;i<t.length;i++){var n=t[i];if(n.r.test(e))return n.s}return"unknown"}};function DH(){return Date.now()}function PH(e){var t="unknown";return"string"!=typeof e?t:e.indexOf(".flv")>-1?"flv":e.indexOf(".m3u8")>-1?"m3u8":e.indexOf(".mp4")>-1?"mp4":e.indexOf(".sdp")>-1?"rts":t}function OH(e){if(e.plugins){if(e.plugins.flv)return e.plugins.flv;if(e.plugins.hls)return e.plugins.hls;if(e.plugins.rts)return e.plugins.rts;if(e.plugins.rtm)return e.plugins.rtm}return null}var IH={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"},LH=function(){function e(e){var t=e.Tea;if(!t)throw new Error("lack Tea option");t.event?this.Tea=t.event.bind(t):this.Tea=t,this.logOptions=e,this._player=e.player}yH(e,[{key:"videoSize",get:function(){return this._player&&this._player.video?{width:this._player.video.videoWidth,height:this._player.video.videoHeight}:{width:0,height:0}}}]);var t=e.prototype;return t.push=function(e){var t=this._player.config.url;this._player.video&&(e.play_current_time=this._player.currentTime),this.core&&this.core.loader&&this.core.loader.finnalUrl?e.cdn_play_url=this.core.loader.finnalUrl:e.cdn_play_url=t&&t.startsWith("//")?window.location.protocol+t:t,e.live_stream_session_id=function(e,t,i){var n=new URLSearchParams(e.split("?")[1]);return n.get(t)||n.get(i)}(e.cdn_play_url,"_session_id","session_id"),e.play_format=PH(e.cdn_play_url),e.timestamp=DH();var i=function(){var e={cpu_core_number:-1,memory_usage:-1,network_downlink:-1};try{e.cpu_core_number=navigator.hardwareConcurrency||-1,e.memory_usage=navigator.deviceMemory||-1,e.network_downlink=navigator.connection&&navigator.connection.downlink,null==e.network_downlink&&(e.network_downlink=-1)}catch(e){}return e}(),n=i.cpu_core_number,r=i.memory_usage,o=i.network_downlink;e.cpu_core_number=n,e.memory_usage=r,e.network_downlink=o,Object.assign(e,bH({},this.videoSize)),this.send(e)},t.send=function(e){e.event_key&&(this.logOptions.onReport&&this.logOptions.onReport(e.event_key,e),this.Tea(e.event_key,bH({},e)))},e}(),AH=function(){return void 0!==navigator.onLine?navigator.onLine?(e=navigator.connection)&&(e.effectiveType||e.type)||xH.device:"none":"unknown";var e},RH=["play","playing","pause","ended","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","ratechange","volumechange","loadeddata"],MH=function(){function e(e){this.options=e,this.logger=new NH(e),this.restart=this.restart.bind(this),this.bindUrlChange(),xH.browser.includes("Chrome")}var t=e.prototype;return t.restart=function(e){this.destroy("string"!=typeof e&&Boolean(e)),this.logger=new NH(this.options),this.bindUrlChange(),this.logger.reportStartPlay(),this.logger.handlePlayerComlete()},t.bindUrlChange=function(){this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.on("urlchange",this.restart)},t.setNTP=function(e){this.logger.setNTP(e)},t.updateExt=function(e){this.options.ext=Object.assign(this.options.ext||{},e),this.logger&&this.logger.updateExt(e)},t.destroy=function(e){this.logger.destroy(e),this.logger=null,this.options&&this.options.player&&!this.options.manual_restart&&this.options.player.off("urlchange",this.restart)},e}(),NH=function(){function e(e){if(!e.player)throw new Error("option player is necessary");this.options=Object.assign({},e,function(e){return{device_id:e.device_id||EH(),user_id:e.user_id||CH(),error_report_stop:!!e.error_report_stop,project_key:e.project_key||"live",product_line:e.product_line||"live",onReport:e.onReport||function(){}}}(e)),this._player=this.options.player,this._url=this._player.config.url,this.project_key=e.project_key||"live",this.product_line=e.product_line||"live",this.ntpDelta=this.options.ntp?Date.now()-this.options.ntp:0,this.inWaitingStart=0,this.errorNumber=0,this.tempDroppedFrameCount=0,this.tempTotalFrameCount=0,this._logmanager=new LH(this.options),this.init(),this.started=!1,this.destroyed=!1,this.completed=!1,this.firstFrameViewed=!1,this.cacheRtcStats={}}yH(e,[{key:"videoSize",get:function(){return this.player?{width:this.player.video.videoWidth,height:this.player.video.videoHeight}:{width:0,height:0}}},{key:"player",get:function(){return this._player}},{key:"logmanager",get:function(){return this._logmanager}},{key:"ntpTime",get:function(){return Date.now()-this.ntpDelta}}]);var t=e.prototype;return t.setNTP=function(e){this.options&&(this.options.ntp=e,this.ntpDelta=Date.now()-this.options.ntp)},t.init=function(){this.bindCtx(),this.initLog(),this.initEvt()},t.bindCtx=function(){this.handlePlayerComlete=this.handlePlayerComlete.bind(this),this.handlePlayerPlaying=this.handlePlayerPlaying.bind(this),this.destroyFunc=this.destroyFunc.bind(this),this.handleUserLeave=this.handleUserLeave.bind(this),this.handlePlayerError=this.handlePlayerError.bind(this),this.handlePlayerReady=this.handlePlayerReady.bind(this),this.handlePlayerWaiting=this.handlePlayerWaiting.bind(this),this.handleAVUnsync=this.handleAVUnsync.bind(this),this.handlePlayerPause=this.handlePlayerPause.bind(this),this.handleTTFB=this.handleTTFB.bind(this),this.handleUrlChange=this.handleUrlChange.bind(this),this.handleKeyframe=this.handleKeyframe.bind(this),this.handleSourceOpen=this.handleSourceOpen.bind(this),this.handleBufferAppend=this.handleBufferAppend.bind(this),this.handleCoreEvent=this.handleCoreEvent.bind(this),this.handleDegrade=this.handleDegrade.bind(this)},t.initLog=function(){var e=this,t=this.options,i=t.player,n=void 0!==i.hlsOps;this.commonParams=bH({os:xH.operation_os},function(e){var t=e.player,i=t.config.mediaType;return bH({project_key:e.project_key,live_sdk_version:OH(t)||t.hlsOps?"2":"-1",player_sdk_version:t.version,logger_version:"1.1.0-alpha.8",report_version:"5",product_line:e.product_line,user_id:e.user_id,device_id:e.device_id,logger_id:TH(12),app_name:e.app_name,cdn_ip:e.cdn_ip,is_wasm:+(!!i&&"video"!==i),review_is_live:t.config.isLive?2:1,aid:e.aid,live_id:e.live_id||e.aid+"-"+e.user_id+"-"+Date.now(),is_preview:e.is_preview?1:0,codec_type:e.codec_type||"h264",width:Math.floor(t.config.width),height:Math.floor(t.config.height),browser:xH.browser,ua:navigator.userAgent,href:window.location.href,timestamp:0,fps:-1,logger_init_time:Date.now(),play_current_time:0,cdn_play_url:t.config.url&&t.config.url.
1startsWith("//")?window.location.protocol+t.config.url:t.config.url,play_format:PH(t.config.url),codec_support:-1},e.ext)}(t)),this.log=Object.assign({},{start_play:{start_play_time:0,event_key:"start_play"},first_frame:{start:0,first_frame_view:0,event_key:"first_frame",first_sei_delay:0,ntp_sync:0,ntp_delta:0,ttfb:-1,ttdb:-1,ttfb_end:0},first_frame_failed:{code:void 0,msg:"",event_key:"first_frame_failed"},stall_start:{ready_state:-1,stall_start_time:0,event_key:"stall_start"},stalling:{event_key:"stalling"},stall:{reason:0,stall_start:0,stall_end:0,ready_state:0,event_key:"stall"},play_stop:{code:0,stop_time:0,drop_percent:0,is_stream_received:0,stall_count:0,stall_time:0,retry_count:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0,event_key:"play_stop",dns_parse_time:-1,redirect:-1,ttfb:-1,buffered:[],is_firstframe_received:0,meta:null},playing:{index:0,stall_count:0,stall_time:0,play_time:1e4,retry_count:0,is_last:0,video_buffer_time:0,audio_buffer_time:0,speed_switch_count:0,speed_switch_info:"none",download_speed:0,decode_fps:0,render_fps:0,drop_count:0,drop_percent:0,sei_source:"",sei_delay:0,ntp_sync:0,ntp_delta:0,event_key:"playing",stop_time:0,duration:0,stall_count_per_100sec:0,stall_time_per_100sec:0},play_error:{code:void 0,info:"",event_key:"play_error"},play_low_decode:{fps:-1,decode_fps:-1,bitrate:-1,url:-1,msg:"",event_key:"play_low_decode"},play_av_unsync:{aDts:-1,vDts:-1,frameLength:-1,currentTime:-1,duration:0,event_key:"play_av_unsync"},play_loadstream:{loadstream_url:"",event_key:"play_loadstream"},play_stream_loaded:{event_key:"play_stream_loaded"},play_metadata_loaded:{metadata_type:"",event_key:"play_metadata_loaded"},stream_exception:{event_key:"stream_exception"},pause:{event_key:"pause"},play_url_change:{event_key:"play_url_change"},source_opened:{event_key:"source_opened"},source_updateend:{event_key:"source_updateend"},play_result:{event_key:"play_result",result:0,threshold:15e3,is_threshold:0},degrade:{event_key:"degrade",payload:{}},rtcstatechange:{event_key:"rtcstatechange"}});var r=this;for(var o in this.log){var a=function(t){Object.defineProperty(e.log[o],t,{get:function(){return null==this["_"+t]?r.commonParams[t]:this["_"+t]},set:function(e){this["_"+t]=e},enumerable:!0})};for(var s in this.commonParams)a(s);n&&Object.defineProperty(this.log[o],"m3u8",{get:function(){if(i.__core__){var e=i.__core__.m3u8Text;return e?e.slice(0,25e4):""}return""},enumerable:!0}),Object.defineProperty(this.log[o],"volume",{get:function(){if(i&&i.video)return i.volume||0},enumerable:!0}),Object.defineProperty(this.log[o],"access",{get:function(){return AH()},enumerable:!0})}},t.updateExt=function(e){for(var t in this.log)for(var i in e)this.log[t][i]=e[i]},t.reportStartPlay=function(){this.started||(this.core=OH(this.player),this.core&&(this.commonParams.live_sdk_version="2",this.logmanager.core=this.core),this.started=!0,this.log.start_play.start_play_time=this.log.start_play.timestamp=DH(),this.logmanager.push(this.log.start_play,!0))},t.initWindowListener=function(){"pc"===xH.device?window.addEventListener("beforeunload",this.handleUserLeave):"mobile"===xH.device&&(window.addEventListener("beforeunload",this.handleUserLeave),window.addEventListener("pagehide",this.handleUserLeave))},t.removeWindowListener=function(){"pc"===xH.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===xH.device&&(window.removeEventListener("beforeunload",this.handleUserLeave),window.removeEventListener("pagehide",this.handleUserLeave))},t.initEvt=function(){var e=this,t=this.player;RH.forEach((function(t){e["handleVideo"+t+"Evt"]=function(){e["handleVideo"+t]&&e["handleVideo"+t]()},e.initWindowListener(),e.bindVideoEvt(t,e["handleVideo"+t+"Evt"])})),t.once("error",this.handlePlayerError),t.once("complete",this.handlePlayerComlete),t.once("playing",this.handlePlayerPlaying),t.once("timeupdate",this.handlePlayerPlaying),t.once("destroy",this.destroyFunc),t.on("ready",this.handlePlayerReady),t.on("waiting",this.handlePlayerWaiting),t.on("pause",this.handlePlayerPause),t.on("urlchange",this.handleUrlChange),t.once("sourceopen",this.handleSourceOpen),t.once("bufferappend",this.handleBufferAppend),t.on("core_event",this.handleCoreEvent),t.on("degrade",this.handleDegrade),this.hiJackPlayerStart()},t.handleCoreEvent=function(e){var t=e.eventName,i=e.headers,n=e.pts,r=e.type,o=e.meta,a=e.sei,s=e.decodeFps,l=e.url,c=e.state;switch(t){case"core.ttfb":this.handleTTFB(e);break;case"core.loadresponseheaders":var u=i.get("X-Server-Ip");void 0!==this.player.hlsOps&&(this.log.play_stop.review_ts_count+=1),u&&(this.commonParams.cdn_ip=u);break;case"core.loadretry":this.log.play_stop.retry_count++;break;case"core.keyframe":this.handleKeyframe(n);break;case"core.metadataparsed":this.handleMetaDataLoaded(r,o);break;case"core.sei":this.handleSEIParsed(a);break;case"core.lowdecode":this.commonParams.is_wasm&&(Object.assign(this.log.play_low_decode,e||{}),this.log.play_low_decode.decode_fps=s,this.log.play_low_decode.timestamp=DH(),this.logmanager.push(this.log.play_low_decode,!0),this.commonParams.is_wasm=0);break;case"core.largeavgap":this.handleAVUnsync(e);break;case"core.loadstart":this.handlePlayerLoadStream(e),this.reportStartPlay();break;case"core.loadcomplete":this.handlePlayerLoadedStream(e);break;case"core.streamexception":this.handleStreamException(e);break;case"core.rtcstatechange":this.logmanager.push(Object.assign({url:l,state:c},this.log.rtcstatechange))}},t.handleDegrade=function(e){this.log.degrade.payload=e,this.logmanager.push(this.log.degrade,!0)},t.hiJackPlayerStart=function(){var e=arguments,t=this;this.player._start=this.player.start;var i=this.player;i.start=function(){try{if(i._start)return i._start.apply(i,Array.prototype.slice.call(e,0))}catch(e){}t.destroyed||t.handlePlayerComlete()}},t.handleTTFB=function(e){var t=e||{},i=t.end,n=t.elapsed;this.log.first_frame.ttfb=n||-1,this.log.first_frame.ttfb_end=i||0},t.handleUrlChange=function(e){this.logmanager.push(Object.assign(this.log.play_url_change,{url:e,timestamp:DH()}))},t.handleKeyframe=function(e){this.log.play_stop.is_firstframe_received=1,this.log.play_stop.firstframe_pts=e},t.handleSourceOpen=function(){this.log.source_opened.timestamp=DH(),this.logmanager.push(this.log.source_opened)},t.handleBufferAppend=function(){this.log.source_updateend.timestamp=DH(),this.logmanager.push(this.log.source_updateend)},t.handlePlayerPause=function(){this.log.pause.timestamp=DH(),this.logmanager.push(this.log.pause,!0),this.stallEnd()},t.handlePlayerError=function(e){this.errorNumber=1;var t=e.errorType,i=e.errorCode;Object.assign(this.log.play_error,bH({timestamp:DH(),code:e.httpCode||i||("parse"===t?31:21
1),info:e.message,detail:JSON.stringify(e)},this.videoSize)),this.logmanager.push(this.log.play_error,!0),this.destroyed||(0===this.log.first_frame.first_frame_view&&(Object.assign(this.log.first_frame_failed,{code:i||("parse"===t?31:21),msg:e.message}),void 0!==this.log.first_frame_failed.timestamp&&(this.log.first_frame_failed.timestamp=DH()),this.logmanager.push(this.log.first_frame_failed,!0),this.log.play_result.is_threshold||(this.clearPlayResultTimer(),this.log.play_result.reason=e.message||"first frame failed",this.log.play_result.code=this.log.play_error.code,this.logmanager.push(this.log.play_result,!0))),this.options.error_report_stop?this.handleUserLeave():this.updatePlayStopParams())},t.handlePlayerLoadStream=function(e){var t=e.url,i=e.offersdp,n=e.sessionId;if("string"==typeof t){var r=this.log.play_loadstream;r.timestamp=DH(),r.loadstream_url=t,r.offersdp=i,r.sessionId=n,this.logmanager.push(r)}},t.handlePlayerLoadedStream=function(e){var t=this.log.play_stream_loaded;t.timestamp=DH(),Object.assign(t,e),this.logmanager.push(t)},t.handleSEIParsed=function(e){var t=this.log,i=t.playing,n=t.first_frame;if(100===e.code){var r=function(e){var t,i,n,r,o,a;for(t="",n=e.length,i=0;i<n;)switch((r=e[i++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(r);break;case 12:case 13:o=e[i++],t+=String.fromCharCode((31&r)<<6|63&o);break;case 14:o=e[i++],a=e[i++],t+=String.fromCharCode((15&r)<<12|(63&o)<<6|(63&a)<<0)}return t}(e.content);r=r.slice(r.indexOf("{"),r.lastIndexOf("}")+1);try{var o=JSON.parse(r),a=this.getPlayerBuffer()+this.ntpTime-o.ts;i.sei_delay=a,i.sei_source=o.source,i.ntp_sync=this.options.ntp?1:0,i.ntp_delta=this.ntp_delta,n.first_sei_delay=a,n.ntp_sync=this.options.ntp?1:0,n.ntp_delta=this.ntp_delta}catch(e){}}},t.handleMetaDataLoaded=function(e,t){var i;this.log.play_stop.meta=this.log.play_stop.meta||{},e&&(this.log.play_stop.meta[e]=t),this.log.play_metadata_loaded.timestamp=DH(),this.log.play_metadata_loaded.metadata_type=e,t&&(this.log.play_metadata_loaded.meta=t,this.log.play_metadata_loaded.codec=t.codec,"video"===e&&(this.commonParams.codec_type=t.codec,this.commonParams.codec_support=(i=t.codec,"undefined"!=typeof MediaSource?+MediaSource.isTypeSupported("video/mp4; codecs="+i):0))),t||(this.log.play_metadata_loaded.meta=void 0,this.log.play_metadata_loaded.codec=void 0,"video"===e&&(this.commonParams.codec_type="unknown")),this.logmanager.push(this.log.play_metadata_loaded)},t.handleAVUnsync=function(e){Object.assign(this.log.play_av_unsync,e||{}),this.log.play_av_unsync.timestamp=DH(),this.logmanager.push(this.log.play_av_unsync,!1)},t.handleStreamException=function(e){this.logmanager.push(Object.assign({},this.log.stream_exception,e))},t.handlePlayerComlete=function(){this.completed||(this.completed=!0,this.core=OH(this.player),this.core&&(this.commonParams.live_sdk_version="2",this.logmanager.core=this.core),(this.player.config.autoplay||this.player.config.videoInit)&&this.reportStartPlay())},t.getPlayerBuffer=function(){var e=this.player.video.buffered;if(e){var t=Math.max(0,e.length-1);try{var i=Number.parseInt(1e3*(e.end(t)-this.player.video.currentTime));return this.log.playing.audio_buffer_time=this.log.playing.video_buffer_time=i,i}catch(e){return 0}}},t.getPlayerDownloadSpeed=function(){if(this.core&&this.core.core&&"function"==typeof this.core.core.speedInfo)return this.core.core.speedInfo().speed},t.getPlayerQuality=function(){var e=this.player.video;if(e.getVideoPlaybackQuality){var t=e.getVideoPlaybackQuality();this.log.playing.drop_count=t.droppedVideoFrames-this.tempDroppedFrameCount,this.log.playing.drop_percent=Number.parseFloat(this.tempTotalFrameCount/t.totalVideoFrames).toFixed(1),this.log.play_stop.drop_percent=Number.parseFloat(t.droppedVideoFrames/t.totalVideoFrames).toFixed(1),this.tempDroppedFrameCount=t.droppedVideoFrames,this.tempTotalFrameCount=t.totalVideoFrames}},t.getRtcStats=function(e,t){try{var i=this,n=i.player.plugins.rts||i.player.plugins.rtm,r=n&&n.pc,o={};return r?Promise.resolve(r.getStats()).then((function(t){return t.forEach((function(t){var n=t.type,r=t.mediaType,a=t.bytesReceived,s=t.packetsReceived,l=t.audioLevel,c=t.concealmentEvents,u=t.remoteTimestamp,h=t.timestamp,d=t.framesDropped,f=t.keyFramesDecoded,p=t.totalDecodeTime,g=t.framesDecoded,v=t.frameHeight,y=t.frameWidth,m=t.framesReceived,_=t.jitterBufferDelay,b=t.jitterBufferEmittedCount,k=t.jitter,w=t.nackCount,S=t.packetsLost,T=t.pliCount,E=t.totalSamplesReceived,C=t.concealedSamples,x=t.currentRoundTripTime,D=t.decoderImplementation,P=t.mimeType,O=t.freezeCount,I=t.totalFreezesDuration,L=t.totalPausesDuration;
1switch(n){case"inbound-rtp":"audio"===r?(o.audio_bytes_received=a-(i.cacheRtcStats.audioBytesReceived||0),i.cacheRtcStats.audioBytesReceived=a,o.audio_packets_lost=S-(i.cacheRtcStats.audioPacketsLost||0),o.audio_packets_received=s-(i.cacheRtcStats.audioPacketsReceived||0),i.cacheRtcStats.audioPacketsLost=S,i.cacheRtcStats.audioPacketsReceived=s,o.audio_level=l,o.concealment_event=c,o.audio_fraction_lost=o.audio_packets_lost/o.audio_packets_received,void 0!==i.cacheRtcStats.totalSamplesReceived&&(o.audio_rec_sample_rate=(E-i.cacheRtcStats.totalSamplesReceived)/e),i.cacheRtcStats.totalSamplesReceived=E,o.concealed_samples=C,o.total_samples_received=E):(o.frames_dropped=d,o.iframes_decoded=f,o.video_bytes_received=a-(i.cacheRtcStats.videoBytesReceived||0),i.cacheRtcStats.videoBytesReceived=a,o.video_dec_time=p,o.video_decoded_delay_ms=o.video_dec_elapse/g,o.video_frame_height=v,o.video_frame_width=y,void 0!==i.cacheRtcStats.framesDecoded&&(o.video_decode_framerate=(g-i.cacheRtcStats.framesDecoded)/e),i.cacheRtcStats.framesDecoded=g,void 0!==i.cacheRtcStats.framesReceived&&(o.video_recv_framerate=(m-i.cacheRtcStats.framesReceived)/e),void 0!==i.cacheRtcStats.freezeCount&&(o.freeze_count=O-i.cacheRtcStats.freezeCount,o.freeze_duration=I-i.cacheRtcStats.totalFreezesDuration),i.cacheRtcStats.freezeCount=O,i.cacheRtcStats.totalFreezesDuration=I,i.cacheRtcStats.framesReceived=m,o.total_pauses_duration=L,o.video_jb_delay=_/b*1e3,o.video_jitter=1e3*k,o.video_nack_count=w,o.video_packets_lost=S-(i.cacheRtcStats.videoPacketsLost||0),o.video_packets_received=s-(i.cacheRtcStats.videoPacketsReceived||0),o.video_fraction_lost=o.video_packets_lost/o.video_packets_received,i.cacheRtcStats.videoPacketsLost=S,i.cacheRtcStats.videoPacketsReceived=s,o.video_pli_count=T,o.decoder_name=D);break;case"remote-outbound-rtp":o.e2e_delay_ms=h-u;break;case"track":void 0!==y&&(o.video_frame_width=y,o.video_frame_height=v);break;case"candidate-pair":o.rtt=1e3*x;break;case"codec":P.includes("video")?o.video_codec=P:o.audio_codec=r}o.total_delay=o.e2e_delay_ms+(o.video_decoded_delay_ms||0)+(o.video_jb_delay||0)})),Object.assign(i.log.playing,{video_download_size:o.video_bytes_received,decode_fps:o.video_decode_framerate,sei_delay:o.total_delay,sei_network_delay:o.e2e_delay_ms,width:o.video_frame_width,height:o.video_frame_height,current_speed:(o.audio_bytes_received+o.video_bytes_received)/e}),o})):Promise.resolve(o)}catch(e){return Promise.reject(e)}},t.reportPlaying=function(e){try{var t=this;t.commonParams.is_wasm&&(t.commonParams.fps=t.player.video.fps,t.log.playing.render_fps=t.player.video.fps,t.log.playing.decode_fps=t.player.video.decodeFps),t.log.playing.index++;var i,n=t.log.playing.timestamp;t.inWaitingStart&&t.inWaitingStart<DH()&&(i=Math.min(t.options.playingInterval||t.log.playing.play_time,DH()-Math.max(t.inWaitingStart,n))),t.getPlayerQuality(),t.getPlayerBuffer(),t.options.downloadSpeedInterval||(t.log.playing.current_speed=t.getPlayerDownloadSpeed());var r=DH(),o=r-n,a=(i>200?i:0)+t.log.playing.stall_time,s=(i>200?1:0)+t.log.playing.stall_count;return t.options.aggregationDowngradeStallTime&&(t.log.playing.aggregation_downgrade_stall=(i>t.options.aggregationDowngradeStallTime?i:0)+(t.log.playing.aggregation_downgrade_stall||0)),Object.assign(t.log.playing,bH({timestamp:r,stop_time:r,duration:e?0:o/1e3,stall_time_per_100sec:a/o*100,stall_count_per_100sec:1e3*s/o*100,stall_count:s,stall_time:a,play_current_time:t.player.currentTime},t.videoSize)),Promise.resolve(t.getRtcStats(o,e)).then((function(i){t.logmanager.push(Object.assign({},t.log.playing,bH({play_time:e?0:o},i)),!0),t.log.playing.download_speed_array=[],t.log.playing.stall_time=0,t.log.playing.stall_count=0,t.options.aggregationDowngradeStallTime&&(t.log.playing.aggregation_downgrade_stall=0)}))}catch(e){return Promise.reject(e)}},t.handlePlayerPlaying=function(){try{var e=this;if(e.player&&e.player.video.readyState<3)return Promise.resolve();if(e.player.off("playing",e.handlePlayerPlaying),e.player.off("timeupdate",e.handlePlayerPlaying),e.core){var t=(e.core.getStats()||{}).fps;e.commonParams.fps=t}return Promise.resolve(e.reportPlaying(!0)).then((function(){e.clearPlayingInterval();var t=e.options.playingInterval||e.log.playing.play_time;e.intervalId=setInterval((function(){try{var i=function(){if(Math.abs(Date.now()-e.log.playing.timestamp-t)<100||Date.now()-e.log.playing.timestamp>=t){var i=function(){if(e.player&&e.player.video){var t=function(){if(!e.player.paused)return Promise.resolve(e.reportPlaying()).then((function(){}));e.handleVideopause()}();if(t&&t.then)return t.then((function(){}))}else e.destroyFunc()}();if(i&&i.then)return i.then((function(){}))}}();return Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(e){return Promise.reject(e)}}),1e3),e.clearStallTimer(),e.handleVideoplaying(),e.started||e.reportStartPlay(),e.saveBuffered()}))}catch(e){return Promise.reject(e)}},t.handlePlayerReady=function(){var e=this;this.log.start_play.start_play_time=DH(),this.player.config.auto
1play&&this.reportStartPlay(),this.options.playResultThreshold&&(this.log.play_result.threshold=this.options.playResultThreshold),this.clearPlayResultTimer(),this.log.play_result.start=DH(),this.playResultTimer=setTimeout((function(){e.log.play_result.timestamp>=e.log.play_result.start||(e.log.play_result.is_threshold=1,e.logmanager.push(e.log.play_result,!0))}),this.log.play_result.threshold)},t.handlePlayerWaiting=function(){var e=this;!this.inWaitingStart&&this.log.first_frame.timestamp&&(this.log.stall.timestamp=this.inWaitingStart=this.log.stall.stall_start=DH(),this.log.stall_start.ready_state=this.log.stall.ready_state=this.player.video.readyState,this.log.stall_start.timestamp=DH(),this.log.stall_start.stall_start_time=DH(),this.log.stall_start.video_buffer_time=this.player.video.readyState,this.log.stall_start.play_current_time=this.player.currentTime,this.log.stall.play_current_time=this.player.currentTime,this.log.stall_start.buffered=this.getBuffered(),this.log.stall.buffered=this.log.stall_start.buffered,this.log.stall.current_speed=this.getPlayerDownloadSpeed(),Object.assign(this.log.stall_start,this.videoSize),this.clearStallTimer(),this.stallStartTimer=setTimeout((function(){e.logmanager.push(e.log.stall_start,!0)}),205))},t.handleVideoseeking=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.clearStallTimer())},t.handleVideoseeked=function(){this.player&&this.player.video&&this.inWaitingStart&&this.player.video.duration<1/0&&(this.inWaitingStart=0,this.log.play_stop.stall_count>0&&this.log.play_stop.stall_count--)},t.handleVideoplay=function(){this.reportStartPlay(),this.removeVideoEvt("play",this.handleVideoplay)},t.handleVideotimeupdate=function(){Math.abs(this.player.currentTime-this.log.stall_start.play_current_time)>.2&&this.stallEnd(),this.saveBuffered()},t.handleVideocanplay=function(){this.stallEnd(),this.reportFirstframe()},t.handleVideoplaying=function(){this.stallEnd(),this.log.play_stop.is_stream_received=1;var e=DH();this.reportStartPlay(),this.log.first_frame.start=e},t.stallEnd=function(){this.clearStallTimer();var e=DH();if(this.inWaitingStart){var t=e-this.inWaitingStart;t>200&&(this.log.play_stop.stall_count++,this.log.play_stop.stall_time+=e-this.inWaitingStart,this.log.playing.stall_time+=e-Math.max(this.inWaitingStart,this.log.playing.timestamp),this.log.stall.stall_end=e,this.log.stall.timestamp=DH(),this.log.playing.stall_count++,Object.assign(this.log.stall,bH({},this.videoSize)),this.logmanager.push(this.log.stall,!0)),this.options.aggregationDowngradeStallTime&&t>this.options.aggregationDowngradeStallTime&&(this.log.playing.aggregation_downgrade_stall=(this.log.playing.aggregation_downgrade_stall||0)+(e-Math.max(this.inWaitingStart,this.log.playing.timestamp)))}this.inWaitingStart=0},t.handleVideoloadeddata=function(){this.reportFirstframe()},t.handleVideoratechange=function(){this.log.playing.speed_switch_count++,this.log.playing.speed_switch_info=this.player.video.playbackRate},t.handleVideoended=function(){this.clearPlayingInterval(),this.clearStallTimer(),Object.assign(this.log.playing,bH({timestamp:DH(),is_last:1},this.videoSize)),this.logmanager.push(this.log.playing)},t.handleVideoerror=function(){var e=this;this.errorNumber=1;var t=this.player.video.error;Object.assign(this.log.play_error,bH(bH({timestamp:DH()},this.videoSize),t&&{code:t.code,info:t.message})),this.logmanager.push(this.log.play_error,!0),0!==e.log.first_frame.first_frame_view||e.log.first_frame_failed.code||t&&(e.log.first_frame_failed.code=t.code,e.log.first_frame_failed.msg=IH[t.code],void 0!==e.log.first_frame_failed.timestamp&&(e.log.first_frame_failed.timestamp=DH()),e.logmanager.push(e.log.first_frame_failed,!0),e.log.play_result.is_threshold||(e.log.play_result.reason=IH[t.code]||"first frame failed",e.log.play_result.code=t.code,e.clearPlayResultTimer(),e.logmanager.push(e.log.play_result,!0))),e.options.error_report_stop?e.handleUserLeave():e.updatePlayStopParams()},t.handleVideopause=function(){this.stallEnd(),this.clearPlayingInterval(),this.clearStallTimer(),clearTimeout(this.collectDownloadSpeedTimer),this.player.once("playing",this.handlePlayerPlaying),this.player.once("timeupdate",this.handlePlayerPlaying)},t.destroyFunc=function(e){var t=this;this.destroyed||(e||this.handleUserLeave(),this.destroyed=!0,"pc"===xH.device?window.removeEventListener("beforeunload",this.handleUserLeave):"mobile"===xH.device&&window.removeEventListener("pagehide",this.handleUserLeave),RH.forEac
1h((function(e){t.removeVideoEvt(e,t["handleVideo"+e+"Evt"])})),this.player&&(this.player._start&&(this.player.start=this.player._start,delete this.player._start),this.player.off("destroy",this.destroyFunc),this.player.off("complete",this.handlePlayerComlete),this.player.off("playing",this.handlePlayerPlaying),this.player.off("timeupdate",this.handlePlayerPlaying),this.player.off("ready",this.handlePlayerReady),this.player.off("waiting",this.handlePlayerWaiting),this.player.off("largeavgap",this.handleAVUnsync),this.player.off("error",this.handlePlayerError),this.player.off("SEI_PARSED",this.handleSEIParsed),this.player.off("pause",this.handlePlayerPause),this.player.off("ttfb",this.handleTTFB),this.player.off("urlchange",this.handleUrlChange),this.player.off("isKeyframe",this.handleKeyframe),this.player.off("sourceopen",this.handleSourceOpen),this.player.off("bufferappend",this.handleBufferAppend),this.player.off("core_event",this.handleCoreEvent),this.player.off("degrade",this.handleDegrade),this._player=null),this.clearPlayingInterval(),this.clearStallTimer(),this.clearPlayResultTimer(),clearTimeout(this.collectDownloadSpeedTimer))},t.handleUserLeave=function(){!this.destroyed&&this.started&&(this.destroyed=!0,this.updatePlayStopParams(),this.reportPlayStop(),this.clearPlayingInterval(),this.clearStallTimer(),clearTimeout(this.collectDownloadSpeedTimer),this.removeWindowListener())},t.saveBuffered=function(){try{var e=this.getBuffered();e&&e.length&&(this.log.play_stop.buffered=e)}catch(e){}},t.getBuffered=function(){try{for(var e=[],t=this.player.video,i=0;i<t.buffered.length;i++)e.push([t.buffered.start(i),t.buffered.end(i)]);return e}catch(e){}},t.reportPlayStop=function(){this.player&&(this.log.play_stop.play_current_time=this.player.currentTime||this.log.playing.play_current_time,this.saveBuffered()),this.logmanager.push(this.log.play_stop,!0)},t.reportFirstframe=function(){if(!this.firstFrameViewed){if(this.core){var e=(this.core.getStats()||{}).fps;this.commonParams.fps=e}this.firstFrameViewed=!0;var t=DH();Object.assign(this.log.first_frame,bH({first_frame_view:t-this.log.start_play.start_play_time||t,timestamp:t},this.videoSize)),this.log.first_frame.ttfb_end&&(this.log.first_frame.ttdb=t-this.log.first_frame.ttfb_end),this.logmanager.push(this.log.first_frame,!0),this.clearPlayResultTimer(),this.log.play_result.result=1,this.logmanager.push(this.log.play_result,!0),this.log.play_stop.is_stream_received=1}},t.updatePlayStopParams=function(){var e=function(e){var t=performance.getEntriesByType("resource").filter((function(t){return t.name===e}));if(t.length){var i=t[0],n=t[t.length-1];return{dns_parse_time:Number.parseInt(i.domainLookupEnd-i.domainLookupStart),redirect:Number.parseInt(i.redirectEnd-i.redirectStart),ttfb:Number.parseInt(n.responseStart-n.requestStart)}}return{dns_parse_time:-1,redirect:-1,ttfb:-1}}(this._url),t=DH();this.playedTime=t-this.log.start_play.start_play_time;var i=this.log.play_stop;Object.assign(i,bH({},0===i.stall_count&&{stall_time:0})),this.inWaitingStart&&t-this.inWaitingStart>200&&(i.stall_time+=t-this.inWaitingStart),this.inWaitingStart=0,Object.assign(i,bH({stall_time_per_100sec:i.stall_time/this.playedTime*100,stall_count_per_100sec:1e3*i.stall_count/this.playedTime*100},e)),0===this.log.play_stop.stall_count_per_100sec&&(this.log.play_stop.stall_time_per_100sec=0),this.log.play_stop.stall_time_per_100sec>100||this.log.play_stop.stall_time_per_100sec<0||(this.log.playing.index?(Object.assign(this.log.playing,bH({timestamp:DH(),is_last:1},this.videoSize)),this.logmanager.push(this.log.playing,!0)):(this.log.play_stop.error_code=this.log.play_error.code,this.log.play_stop.error_info=this.log.play_error.info),t=DH(),Object.assign(i,bH({timestamp:t,stop_time:t,duration:this.playedTime/1e3,play_time:this.playedTime/1e3},this.videoSize)),0===this.errorNumber&&(i.play_time_on_no_frame=i.stop_time-this.log.start_play.start_play_time))},t.clearPlayingInterval=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},t.clearStallTimer=function(){clearTimeout(this.stallStartTimer)},t.clearPlayResultTimer=function(){clearTimeout(this.playResultTimer)},t.destroy=function(e){this.destroyFunc(!e)},t.bindVideoEvt=function(e,t){this.player&&this.player.video.addEventListener(e,t,!1)},t.removeVideoEvt=function(e,t){this.player&&this.player.video&&this.player.video.removeEventListener(e,t,!1)},t.send=function(e,t){this.logmanager.send(e,t)},e}(),BH=function(){return BH=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},BH.apply(this,arguments)};function UH(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,o=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}function jH(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(UH(arguments[t]));return e}var HH,FH,VH,zH,GH=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var i=this;e&&t&&"function"==typeof t&&this.on(e,(function n(r){t(r),i.off(e,n)}))},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var i=this._hooks[e].indexOf(t);-1!==i&&this._hooks[e].splice(i,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,i){if(i){if(!e)return;-1!==this._cache.indexOf(i)?this._emit(e,t):(this._hooksCache.hasOwnProperty(i)||(this._hooksCache[i]={}),this._hooksCache[i].hasOwnProperty(e)||(this._hooksCache[i][e]=[]),this._hooksCache[i][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&jH(this._hooks[e]).forEac
1h((function(e){try{e(t)}catch(e){}}))},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),WH=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},KH=(HH=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return HH+=1}),YH=function(e){var t=document.createElement("a");return t.href=e,t},$H=function(){function e(e){this.appid=e,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,i=document.referrer,n=i?YH(i).hostname:"";!function(e){var t={};try{var i=YH(e).search;(i=i.slice(1)).split("&").forEach((function(e){var i,n,r=e.split("=");r.length&&(i=r[0],n=r[1]);try{t[i]=decodeURIComponent(void 0===n?"":n)}catch(e){t[i]=n}}))}catch(e){}}(window.location.href);var r=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web",o=this.browser(),a=this.os();return{browser:o.browser,browser_version:o.browser_version,platform:r,os_name:a.os_name,os_version:a.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(a.os_name),language:t,referrer:i,referrer_host:n}},e.prototype.browser=function(){var e,t,i="",n=""+parseFloat(this.appVersion),r=this.userAgent;return-1!==r.indexOf("Edge")||-1!==r.indexOf("Edg")?(i="Microsoft Edge",-1!==r.indexOf("Edge")?(e=r.indexOf("Edge"),n=r.substring(e+5)):(e=r.indexOf("Edg"),n=r.substring(e+4))):-1!==(e=r.indexOf("MSIE"))?(i="Microsoft Internet Explorer",n=r.substring(e+5)):-1!==(e=r.indexOf("Lark"))?(i="Lark",n=r.substring(e+5,e+11)):-1!==(e=r.indexOf("MetaSr"))?(i="sougoubrowser",n=r.substring(e+7,e+10)):-1!==r.indexOf("MQQBrowser")||-1!==r.indexOf("QQBrowser")?(i="qqbrowser",-1!==r.indexOf("MQQBrowser")?(e=r.indexOf("MQQBrowser"),n=r.substring(e+11,e+15)):-1!==r.indexOf("QQBrowser")&&(e=r.indexOf("QQBrowser"),n=r.substring(e+10,e+17))):-1!==r.indexOf("Chrome")?-1!==(e=r.indexOf("MicroMessenger"))?(i="weixin",n=r.substring(e+15,e+20)):-1!==(e=r.indexOf("360"))?(i="360browser",n=r.substring(r.indexOf("Chrome")+7)):-1!==r.indexOf("baidubrowser")||-1!==r.indexOf("BIDUBrowser")?(-1!==r.indexOf("baidubrowser")?(e=r.indexOf("baidubrowser"),n=r.substring(e+13,e+16)):-1!==r.indexOf("BIDUBrowser")&&(e=r.indexOf("BIDUBrowser"),n=r.substring(e+12,e+15)),i="baidubrowser"):-1!==(e=r.indexOf("xiaomi"))?-1!==r.indexOf("openlanguagexiaomi")?(i="openlanguage xiaomi",n=r.substring(e+7,e+13)):(i="xiaomi",n=r.substring(e-7,e-1)):-1!==(e=r.indexOf("TTWebView"))?(i="TTWebView",n=r.substring(e+10,e+23)):(-1!==(e=r.indexOf("Chrome"))||-1!==(e=r.indexOf("Chrome")))&&(i="Chrome",n=r.substring(e+7)):-1!==r.indexOf("Safari")?-1!==(e=r.indexOf("QQ"))?(i="qqbrowser",n=r.substring(e+10,e+16)):-1!==(e=r.indexOf("Safari"))&&(i="Safari",n=r.substring(e+7),-1!==(e=r.indexOf("Version"))&&(n=r.substring(e+8))):-1!==(e=r.indexOf("Firefox"))?(i="Firefox",n=r.substring(e+8)):-1!==(e=r.indexOf("MicroMessenger"))?(i="weixin",n=r.substring(e+15,e+20)):-1!==(e=r.indexOf("QQ"))?(i="qqbrowser",n=r.substring(e+3,e+8)):-1!==(e=r.indexOf("Opera"))&&(i="Opera",n=r.substring(e+6),-1!==(e=r.indexOf("Version"))&&(n=r.substring(e+8))),-1!==(t=n.indexOf(";"))&&(n=n.substring(0,t)),-1!==(t=n.indexOf(" "))&&(n=n.substring(0,t)),-1!==(t=n.indexOf(")"))&&(n=n.substring(0,t)),{browser:i,browser_version:n}},e.prototype.os=function(){for(var e="",t="",i=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],n=0;n<i.length;n++){var r=i[n];if(r.r.test(this.userAgent)){"Mac OS X"===(e=r.s)&&this.isNewIpad()&&(e="iOS");break}}var o,a,s=function(e,t){var i=e.exec(t);return i&&i[1]?i[1]:""},l=function(e,t){var i=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return i?i.slice(1)[0]:""};switch(/Windows/.test(e)&&(t=s(/Windows (.*)/,e),e="windows"),e){case"Mac OS X":t=l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":(a=s(/Android ([\.\_\d]+)/,o=this.userAgent))||(a=s(/Android\/([\.\_\d]+)/,o)),t=a,e="android";break;case"iOS":t=this.isNewIpad()?l("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios"}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";
1try{if("android"===e)navigator.userAgent.split(";").forEach((function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))}));else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var i=navigator.userAgent.replace("Mozilla/5.0 (",""),n=i.indexOf(";");t=i.slice(0,n)}}catch(e){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),qH=(FH=function(e,t){e.exports=function(){function e(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)e[n]=i[n]}return e}return function t(i,n){function r(t,r,o){if("undefined"!=typeof document){"number"==typeof(o=e({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var s in o)o[s]&&(a+="; "+s,!0!==o[s]&&(a+="="+o[s].split(";")[0]));return document.cookie=t+"="+i.write(r,t)+a}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],n={},r=0;r<t.length;r++){var o=t[r].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(n[s]=i.read(a,s),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(t,i){r(t,"",e({},i,{expires:-1}))},withAttributes:function(i){return t(this.converter,e({},this.attributes,i))},withConverter:function(i){return t(e({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(i)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()},FH(VH={exports:{}}),VH.exports),XH=qH,JH=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e){this.getItem(e)},e.prototype.setCookie=function(e,t){this.setItem(e,t)},e}(),ZH={getItem:function(e){try{var t=localStorage.getItem(e),i=t;try{t&&"string"==typeof t&&(i=JSON.parse(t))}catch(e){}return i||{}}catch(e){}return{}},setItem:function(e,t){try{var i="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,i)}catch(e){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(e){}},getCookie:function(e,t){try{return XH.get(e,{domain:t||document.domain})}catch(e){return""}},setCookie:function(e,t,i,n){try{var r=n||document.domain,o=+new Date+i;XH.set(e,t,{expires:new Date(o),path:"/",domain:r})}catch(e){}},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},QH={getItem:function(e){try{var t=sessionStorage.getItem(e),i=t;try{t&&"string"==typeof t&&(i=JSON.parse(t))}catch(e){}return i||{}}catch(e){}return{}},setItem:function(e,t){try{var i="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,i)}catch(e){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(e){}},getCookie:function(e){this.getItem(e)},setCookie:function(e,t){this.setItem(e,t)},isSupportSession:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},eF=function(){function e(e,t){this._storage=t&&"session"===t?QH:!e&&ZH.isSupportLS?ZH:new JH}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,i,n){this._storage.setCookie(e,t,i,n)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),tF={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az24z1mz1jz1az1cz18z1nz1nz1jz1mz1ez4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1
1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},iF=void 0,nF=(new Date).getTimezoneOffset(),rF=parseInt(""+-nF/60,10),oF=60*nF,aF=function(){function e(e,t){this.is_first_time=!0,this.initConfig=t,this.collect=e;var i=new $H(t.app_id).init(),n="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new eF(!1,"session"),this.localStorage=new eF(!1,"local");var r=this.localStorage.getItem(n);r&&1==r?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(n,"1")),this.envInfo={user:{user_unique_id:iF,user_type:iF,user_id:iF,user_is_auth:iF,user_is_login:iF,device_id:iF,web_id:iF,user_unique_id_type:iF},header:{app_id:iF,app_name:iF,app_install_id:iF,install_id:iF,app_package:iF,app_channel:iF,app_version:iF,ab_version:iF,os_name:i.os_name,os_version:i.os_version,device_model:i.device_model,ab_client:iF,traffic_type:iF,client_ip:iF,device_brand:iF,os_api:iF,access:iF,language:i.language,region:iF,app_language:iF,app_region:iF,creative_id:iF,ad_id:iF,campaign_id:iF,log_type:iF,rnd:iF,platform:i.platform,sdk_version:"0.0.3-lite",sdk_lib:"js",province:iF,city:iF,timezone:rF,tz_offset:oF,tz_name:iF,sim_region:iF,carrier:iF,resolution:i.screen_width+"x"+i.screen_height,browser:i.browser,browser_version:i.browser_version,referrer:i.referrer,referrer_host:i.referrer_host,width:i.screen_width,height:i.screen_height,screen_width:i.screen_width,screen_height:i.screen_height,utm_term:iF,utm_content:iF,utm_source:iF,utm_medium:iF,utm_campaign:iF,custom:{},wechat_unionid:iF,wechat_openid:iF}},this.evtParams={},this.reportErrorCallback=function(){},this.initDomain()}return e.prototype.initDomain=function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=function(e){return function(e,t,i){if("string"==typeof e&&"number"==typeof i){var n,r=[];i=i<=25?i:i%25;var o=String.fromCharCode(i+97);n=e.split(o);for(var a=0;a<n.length;a++){var s=parseInt(n[a],i);s=1*s^64;var l=String.fromCharCode(s);r.push(l)}return r.join("")}}(e,0,25)}(tF[t])}},e.prototype.setDomain=function(e){this.domain=e},e.prototype.getDomain=function(){return this.domain},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t=this.initConfig.report_url||"/list";break;case"webid":t="/webid"}return""+this.getDomain()+t},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(i){"evtParams"===i?t.evtParams=BH({},t.evtParams||{},e.evtParams||{}):"_staging_flag"===i?t.evtParams=BH({},t.evtParams||{},{_staging_flag:e._staging_flag}):"reportErrorCallback"===i&&"function"==typeof e[i]?t.reportErrorCallback=e[i]:Object.hasOwnProperty.call(t.envInfo.user,i)?["user_id","web_id","user_unique_id"].indexOf(i)>-1&&(t.envInfo.user[i]=e[i]?String(e[i]):e[i]):Object.hasOwnProperty.call(t.envInfo.header,i)?t.envInfo.header[i]=e[i]:t.envInfo.header.custom[i]=e[i]}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(e){}},e}();!function(e){e.Init="init",e.Config="config",e.Start="start",e.Ready="ready",e.TokenComplete="token-complete",e.TokenStorage="token-storage",e.TokenFetch="token-fetch",e.TokenError="token-error",e.ConfigUuid="config-uuid",e.TokenChange="token-change",e.TokenReset="token-reset",e.SessionReset="session-reset",e.SessionResetTime="session-reset-time",e.Event="event",e.Events="events",e.EventNow="event-now",e.CleanEvents="clean-events",e.BeconEvent="becon-event"}(zH||(zH={}));var sF=zH;function lF(e,t,i,n,r,o,a,s,l){try{var c=new XMLHttpRequest,u=s||"POST";c.open(u,""+e,!0),c.setRequestHeader("Content-Type","application/json; charset=utf-8"),i&&(c.timeout=i,c.ontimeout=function(){o&&o(t,5005)}),c.onload=function(){if(r){var e=null;if(c.responseText){try{e=JSON.parse(c.responseText)}catch(t){e={}}r(e,t)}}},c.onerror=function(){c.abort(),o&&o(t,500)},l?c.send(t):c.send(JSON.stringify(t))}catch(e){}}var cF=function(){function e(){this.eventLimit=50,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new eF(!0),this.localStorage=new eF(!1),this.maxReport=t.max_report||20,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.reportUrl=this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.collect.on(sF.Ready,(function(){i.reportAll(!1)})),this.collect.on(sF.Event,(function(e){i.event(e)})),this.collect.on(sF.BeconEvent,(function(e){i.beconEvent(e)})),this.linster()},e.prototype.linster=function(){var e,t=this;window.addEventListener("unload",(function(){t.reportAll(!0)}),!1),e=function(){t.reportAll(!0)},navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;try{var i=jH(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,i),this.reportTimeout&&clearTimeout(this.reportTimeout),i.length>=this.maxReport)this.report(!1);else{var n=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),n)}}catch(e){}},e.prototype.beconEvent=function(e){var t=jH(e,this.cacheStorgae.getItem(this.be
1conKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.destroyInstance||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))},e.prototype.reportBecon=function(){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))},e.prototype.report=function(e){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var i=0;i<e.length;i+=this.eventLimit){var n;n=e.slice(i,i+this.eventLimit);var r=this.split(this.merge(n));this.send(r,t)}else r=this.split(this.merge(e)),this.send(r,t)},e.prototype.merge=function(e){var t=this,i=this.configManager.get(),n=i.header,r=i.user;n.custom=JSON.stringify(n.custom);var o=this.configManager.get("evtParams"),a=e.map((function(e){try{return Object.keys(o).length&&(e.params=BH({},o,e.params)),e.session_id=t.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(t){return e}})),s=[];if(!Object.keys(r).length)return s;var l=JSON.parse(JSON.stringify({events:a,user:r,header:n}));return l.local_time=Math.floor(Date.now()/1e3),l.verbose=1,s.push(l),s},e.prototype.split=function(e){return e.map((function(e){var t=[];return t.push(e),t}))},e.prototype.send=function(e,t){var i=this;e.length&&e.forEach((function(e){try{if(!e.length)return;n=i.reportUrl,r=e,o=i.timeout,a=function(e,t){},s=function(e,t){i.configManager.get("reportErrorCallback")(e,t)},t&&window.navigator&&window.navigator.sendBeacon?window.navigator.sendBeacon(n,JSON.stringify(r))||s(n,r):lF(n,r,o,0,a,s,0,"",!1)}catch(e){}var n,r,o,a,s}))},e}(),uF=function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},hF=function(){return uF().replace(/-/g,"").slice(0,19)},dF=function(){function e(){this.cacheToken={}}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new eF(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.collect.on(sF.ConfigUuid,(function(e){i.setUuid(e)})),this.checkStorage()},e.prototype.checkStorage=function(){this.cacheToken=this.storage.getItem(this.tokenKey)||{},this.check()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.remoteWebid()},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),i={app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""},n=hF();lF(t,i,3e5,0,(function(t){var i;t&&0===t.e?i=t.web_id:(i=n,e.collect.configManager.set({localWebId:n}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||i,user_unique_id:e.configManager.get("user_unique_id")||i})}),(function(){e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n}),e.collect.configManager.set({localWebId:n}),e.collect.logger.warn("appid: "+e.config.app_id+", get webid error, use local webid~")}))},e.prototype.complete=function(e){var t=e.web_id,i=e.user_unique_id;(t||i)&&(e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:i}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(sF.TokenComplete))},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),i=this.configManager.get("user_unique_id"),n=this.cacheToken&&this.cacheToken.user_unique_id;if(t===i&&t===n)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)}else this.clearUuid()},e.prototype.clearUuid=function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit(sF.TokenReset))},e.prototype.setStorage=function(e){e._type_="default",this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e}(),fF=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},pF=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.storage=new eF(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||(this.setSessionId(),this.collect.on(sF.SessionReset,(function(){i.resetSessionId()})),this.collect.on(sF.SessionResetTime,(function(){i.updateSessionIdTime()}
1)))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:fF(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:fF(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime)},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval((function(){e.checkEXp()}),this.expireTime))},e.prototype.resetSessionId=function(){var e={sessionId:fF(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:fF(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),gF=function(){function e(e){this.disableAutoPageView=!1,this.staging=!1,this.sended=!1,this.started=!1,this.adapters={},this.sdkReady=!1,this.name=e,this.hook=new GH,this.Types=sF,this.adapters.fetch=lF,this.adapters.storage=eF}return e.prototype.init=function(e){var t,i=this;this.inited||e&&WH(e)&&e.app_id&&"number"==typeof(t=e.app_id)&&!isNaN(t)&&(e.app_key&&"string"!=typeof e.app_key||(e.channel_domain||-1!==["cn","sg","va"].indexOf(e.channel)||(e.channel="cn"),this.inited=!0,this.configManager=new aF(this,e),this.initConfig=e,e.disable_auto_pv&&(this.disableAutoPageView=!0),this.configManager.set({app_id:e.app_id}),this.eventManager=new cF,this.tokenManager=new dF,this.sessionManager=new pF,Promise.all([new Promise((function(e){i.once(sF.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){i.once(sF.Start,(function(){e(!0)}))}))]).then((function(){i.sdkReady=!0,i.emit(sF.Ready),i.pageView()})),this.tokenManager.apply(this,e),this.eventManager.apply(this,e),this.sessionManager.apply(this,e),this.emit(sF.Init)))},e.prototype.config=function(e){if(this.inited&&e&&WH(e)){e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var t=BH({},e);t.user_unique_id;var i=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i}(t,["user_unique_id"]);t.hasOwnProperty("user_unique_id")&&this.emit(sF.ConfigUuid,t.user_unique_id),this.configManager.set(i)}},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit(sF.Start))},e.prototype.event=function(e,t){var i=this;try{var n=[];Array.isArray(e)?e.forEach((function(e){n.push(i.processEvent(e[0],e[1]||{}))})):n.push(this.processEvent(e,t)),n.length&&(this.emit(sF.Event,n),this.emit(sF.SessionResetTime))}catch(e){}},e.prototype.beconEvent=function(e,t){if(Array.isArray(e));else{var i=[];i.push(this.processEvent(e,t||{})),i.length&&(this.emit(sF.BeconEvent,i),this.emit(sF.SessionResetTime))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{var i=e;/^event\./.test(e)&&(i=e.slice(6));var n=t;"object"!=l(n)&&(n={}),n.event_index=KH();var r=void 0;return n.local_ms?(r=n.local_ms,delete n.local_ms):r=+new Date,{event:i,params:n,local_time_ms:r}}catch(i){return{event:e,params:t}}},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,i){this.hook.emit(e,t,i)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){void 0===e&&(e={});var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+(this.configManager&&this.configManager.is_first_time)},i=BH({},t,e);this.event("predefine_pageview",i)},e}(),vF=new gF("default"),yF=gA.dependencies||{},mF="veplayer_live_device_id",_F="veplayer_live_user_id",bF=function(e){return Math.floor((9*Math.random()+1)*Math.pow(10,e-1)).toString()},kF=function(e){g(i,e);var t=k(i);function i(){return h(this,i),t.apply(this,arguments)}return f(i,[{key:"afterCreate",value:function(){var e,t,i,n,r,o=this;this.config.enable&&(this.config.appId?(this._userId=(null===(e=this.config)||void 0===e?void 0:e.userId)||(n=localStorage.getItem(_F))||
1(n=bF(12),localStorage.setItem(_F,n),n),this._deviceId=(null===(t=this.config)||void 0===t?void 0:t.deviceId)||(r=localStorage.getItem(mF))||(r=bF(11),localStorage.setItem(mF,r),r),this.openLog(this.config),null===(i=this.player.plugins)||void 0===i||null===(i=i.sdkerrorplugin)||void 0===i||i.addErrDetail((function(){var e;if(o._liveLogger)return{label:"userId",value:null===(e=o._liveLogger)||void 0===e||null===(e=e.logger)||void 0===e||null===(e=e.options)||void 0===e?void 0:e.user_id}}))):Ul.warn("not found appid, logger is closed"))}},{key:"_createTea",value:function(e){vF.init({app_id:468759,channel:"cn"}),vF.start(),vF.config({user_unique_id:this._userId,device_id:this._deviceId})}},{key:"startLog",value:function(e){this._createTea(e),this._liveLogger=new MH({Tea:vF,player:this.player,aid:e.appId,project_key:e.appId,app_name:e.appId,user_id:this._userId,device_id:this._deviceId,ext:{veplayer_version:"1.9.6",flv_version:yF["xgplayer-flv"],hls_version:yF["xgplayer-hls"],rts_version:yF["@byted/xgplayer-rts"]}})}},{key:"closeLog",value:function(){this._liveLogger.destroy(),this._liveLogger=null}},{key:"openLog",value:function(e){!this._liveLogger&&this.startLog(a(a({},this.config),e))}}],[{key:"pluginName",get:function(){return"liveLogger"}},{key:"defaultConfig",get:function(){return{appId:"",enable:!0}}}]),i}(Bo),wF=function(e){return e.widevine="com.widevine.alpha",e.fairplay="com.apple.fps.1_0",e.playready="com.microsoft.playready",e}(wF||{}),SF=function(e){return e[e.UNSUPPORTED=7101]="UNSUPPORTED",e[e.RECORD=7102]="RECORD",e[e.NOMEDIAKEY=7103]="NOMEDIAKEY",e[e.NOKEYSESSION=7104]="NOKEYSESSION",e[e.GENERATEREQUESTFAIL=7105]="GENERATEREQUESTFAIL",e[e.LACKSERVERCERTIFICATEPATH=7106]="LACKSERVERCERTIFICATEPATH",e[e.LACKSERVERPROCESSSPCPATH=7107]="LACKSERVERPROCESSSPCPATH",e[e.LICENSEFAIL=7108]="LICENSEFAIL",e[e.KEYERROR=7109]="KEYERROR",e[e.CERTFAIL=7110]="CERTFAIL",e}(SF||{});function TF(e){var t=[{initDataTypes:["keyids","webm"],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.2"'}],videoCapabilities:e?[{contentType:e}]:[{contentType:'video/mp4; codecs="avc1.42c01e"'},{contentType:'video/mp4; codecs="hev1.1.6.L120.90"'},{contentType:'video/webm; codecs="vp8"'}]}];return new Promise((function(e,i){navigator.requestMediaKeySystemAccess(wF.fairplay,t).then((function(t){e({access:t,system:wF.fairplay,systemName:"fairplay"})})).catch((function(){globalThis.WebKitMediaKeys&&globalThis.WebKitMediaKeys.isTypeSupported(wF.fairplay,"video/mp4")?e({access:null,system:wF.fairplay,systemName:"fairplay"}):navigator.requestMediaKeySystemAccess(wF.widevine,t).then((function(t){e({access:t,system:wF.widevine,systemName:"widevine"})})).catch((function(){navigator.requestMediaKeySystemAccess(wF.playready,t).then((function(t){e({access:t,system:wF.playready,systemName:"playready"})})).catch((function(t){globalThis.MSMediaKeys&&globalThis.MSMediaKeys.isTypeSupported(wF.playready,"video/mp4")?e({access:null,system:wF.playready,systemName:"playready"}):i(t)}))}))}))}))}var EF=function(e){g(r,e);var t,i,n=k(r);function r(e){var t;h(this,r),(t=n.call(this,e)).unsupported=!1,t.unRecord=!0,t.needKeyed=!1,t.onNeedKey=function(e){if(!t.needKeyed&&!t.unsupported){t.needKeyed=!0,e.target;var i,n=e.initData,r=e.initDataType;if(t.keySystem===wF.fairplay&&(i=t.extractContentId(n),!t.certificate))return t.suspend=function(){t.afterInitDate(n,i,r)};t.afterInitDate(n,i,r)}},t.licenseRequestReady=function(e){if(t.serverProcessSPCPath){var i=e.message,n=new XMLHttpRequest;n.responseType="arraybuffer",n.addEventListener("load",t.licenseRequestLoaded,!1),n.addEventListener("error",t.licenseRequestFailed(e),!1);var r=new Uint8Array(i);n.open("POST",t.serverProcessSPCPath,!0),t.config.ignoreLicenseHeader||(t.keySystem===wF.playready?n.setRequestHeader("Content-type","text/xml; charset=utf-8"):n.setRequestHeader("Content-type","application/octet-stream")),n.send(r)}else t.emitError(SF.LACKSERVERPROCESSSPCPATH,"lack serverProcessSPCPath")},t.licenseRequestLoaded=function(e){var i,n=e.target.response;(i=new Uint8Array(n))?t.keySession.update(i):t.emitError(SF.LICENSEFAIL,"The license response no array buffer, license: ".concat(i))},t.licenseRequestFailed=function(e){return function(i){if(t.licenseRetryTime>0)t.licenseRequestReady(e),t.licenseRetryTime--;else{var n=i.target;t.emitError(SF.LICENSEFAIL,"The license request fail, status: ".concat(n.status,", statusText: ").concat(n.statusText))}}},t.onKeyError=function(){t.emitError(SF.KEYERROR,"A decryption key error was encountered")},t.loadCertificate=function(){if(t.serverCertificatePath){var e=new XMLHttpRequest;e.responseType="arraybuffer",e.addEventListener("load",t.onCertificateLoaded,!1),e.addEventListener("error",t.onCertificateError,!1),e.open("GET",t.serverCertificatePath,!0),e.send()}else t.emitError(SF.LACKSERVERCERTIFICATEPATH,"lack serverCertificatePath")},t.emitError=function(e,i){t.emit("error",{errorCode:e,message:i,drm_sdk_version:"0.0.0-alpha.12"})},t.onCertificateLoaded=function(e){var i=e.target;t.certificate=new Uint8Array(i.response),t.suspend&&t.suspend()},t.onCertificateError=function(e){if(t.certRetryTime>0)t.loadCertificate(),t.certRetryTime--;else{var i=e.target;t.emitError(SF.CERTFAIL,"get cert fail, status: ".concat(i.status,", statusText: ").concat(i.statusText))}},t.restart=function(){t.reset()},t.reset();var i=e.config||{};return t.config=i,t.contentType=t.config.contentType,"boolean"==typeof i.unRecord&&(t.unRecord=i.unRecord),t.checkUnrecord(),t}return f(r,[{key:"serverCertificatePath",get:function(){return this._serverCertificatePath},set:function(e){e&&this._serverCertificatePath!==e&&(this._serverCertificatePath=e,this.keySystem===wF.fairplay&&(this.certificate=void 0,this.suspend=function(){},this.loadCertificate()))}},{key:"afterCreate",value:function(){this.media=this.player.video,this.media.addEventListener("webkitneedkey",this.onNeedKey,!1),this.media.addEventListener("msneedkey",this.onNeedKey,!1),this.media.addEventListener("needkey",this.onNeedKey,!1),this.media.addEventListener("encrypted",this.onNeedKey),this.player.on("urlchange",this.restart),this.player.on("reset",this.restart)}},{key:"checkUnrecord",value:(i=u(s().mark((function e(){var t,i,n=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.unRecord){e.next=13;break}return e.prev=1,e.next=4,navigator.mediaCapabilities.decodingInfo({type:"file",video:{contentType:'video/mp4; codecs="avc1.42c01e"',width:426,height:238,bitrate:1e3,framerate:30}});case 4:t=e.sent,i=t.powerEfficient,this.unsupported=!i,e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),this.emitError(SF.RECORD,"check powerEfficient failed, ".concat(e.t0.message)),this.unsupported=!0;case 13:if(!this.unsupported){e.next=15;break}return e.abrupt("return");case 15:TF(this.contentType).then((function(e){var t=e.access,i=e.system,r=e.systemName;n.keySystem=i,n.systemName=r,n.setRequestUrl(r),i===wF.fairplay&&n.loadCertificate(),t&&(n.keySystemAccess=t)})).catch((function(e){n.emitError(SF.UNSUPPORTED,e.message),n.unsupported=!0}
1));case 16:case"end":return e.stop()}}),e,this,[[1,9]])}))),function(){return i.apply(this,arguments)})},{key:"setRequestUrl",value:function(e){var t=this.config[e]||this.config;this.serverCertificatePath=t.serverCertificatePath,this.serverProcessSPCPath=t.serverProcessSPCPath}},{key:"updateConfig",value:(t=u(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Object.assign(this.config,t),!this.config.unRecord||this.contentType===this.config.contentType){e.next=5;break}return this.contentType=this.config.contentType,e.next=5,this.checkUnrecord();case 5:this.setRequestUrl(this.systemName);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"afterInitDate",value:function(e,t,i){var n=this;if(this.keySystemAccess)this.keySystemAccess.createMediaKeys().then((function(t){if(n.media.setMediaKeys(t),n.media.mediaKeys)n.emitError(SF.NOMEDIAKEY,"Could not create MediaKeys");else{var r=t.createSession();n.keySession=r,r?(r.addEventListener("message",n.licenseRequestReady),r.generateRequest(i||n.config.initDataType,e).catch((function(e){n.emitError(SF.GENERATEREQUESTFAIL,"generateRequest failed, code: ".concat(e.errorCode,", message: ").concat(e.message))}))):n.emitError(SF.NOKEYSESSION,"Could not create key session")}})).catch((function(){throw"Could not create MediaKeys"}));else if(this.keySystem===wF.fairplay){var r=new globalThis.WebKitMediaKeys(this.keySystem);if(this.media.webkitSetMediaKeys(r),!this.media.webkitKeys)return void this.emitError(SF.NOMEDIAKEY,"Could not create MediaKeys");var o=r.createSession("video/mp4",this.concatInitDataIdAndCertificate(e,t));if(this.keySession=o,!o)return void this.emitError(SF.NOKEYSESSION,"Could not create key session");o.addEventListener("webkitkeymessage",this.licenseRequestReady),o.addEventListener("webkitkeyerror",this.onKeyError)}else if(this.keySystem===wF.playready){var a=new globalThis.MSMediaKeys(this.keySystem);this.media.msSetMediaKeys(a);var s=a.createSession("video/mp4",new Uint8Array(e),null);if(this.keySession=s,!s)return void this.emitError(SF.NOKEYSESSION,"Could not create key session");s.addEventListener("mskeymessage",this.licenseRequestReady),s.addEventListener("mskeyerror",this.onKeyError)}}},{key:"parseServerResponse",value:function(e){var t="http://schemas.xmlsoap.org/soap/envelope/";if(DOMParser){var i=this.uintToString(e),n=(new DOMParser).parseFromString(i,"text/xml"),r=n?n.getElementsByTagNameNS(t,"Envelope")[0]:null,o=r?r.getElementsByTagNameNS(t,"Body")[0]:null;if(o&&o.getElementsByTagNameNS(t,"Fault")[0])return null}return e}},{key:"uintToString",value:function(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}},{key:"extractContentId",value:function(e){var t,i=(t=new Uint16Array(e.buffer),String.fromCharCode.apply(null,t)),n=document.createElement("a");return n.href=i,n.hostname}},{key:"concatInitDataIdAndCertificate",value:function(e,t){"string"==typeof t&&(t=function(e){for(var t=new ArrayBuffer(2*e.length),i=new Uint16Array(t),n=0,r=e.length;n<r;n++)i[n]=e.charCodeAt(n);return i}(t));var i,n=0,r=this.certificate;i=r?new ArrayBuffer(e.byteLength+4+t.byteLength+4+r.byteLength):new ArrayBuffer(e.byteLength+4+t.byteLength);var o=new DataView(i);new Uint8Array(i,n,e.byteLength).set(e),n+=e.byteLength,o.setUint32(n,t.byteLength,!0),n+=4;var a=new Uint16Array(i,n,t.length);return a.set(t),n+=a.byteLength,r&&(o.setUint32(n,r.byteLength,!0),n+=4,new Uint8Array(i,n,r.byteLength).set(r)),new Uint8Array(i,0,i.byteLength)}},{key:"reset",value:function(){if(this.certRetryTime=2,this.licenseRetryTime=2,this.suspend=void 0,this.keySession=void 0,this.needKeyed=!1,this.media)try{this.media.src="",this.keySystem===wF.fairplay?this.media.webkitSetMediaKeys(null):this.keySystem===wF.playready?this.media.msSetMediaKeys(null):this.media.setMediaKeys(null)}catch(e){}}},{key:"destroy",value:function(){this.player.off("urlchange",this.restart),this.player.off("reset",this.restart),this.media.removeEventListener("webkitneedkey",this.onNeedKey,!1),this.media.removeEventListener("msneedkey",this.onNeedKey,!1),this.media.removeEventListener("needkey",this.onNeedKey,!1),this.media.removeEventListener("encrypted",this.onNeedKey)}}],[{key:"pluginName",get:function(){return"drm"}}]),r}(Eo),CF=function(e){g(i,e);var t=k(i);function i(){return h(this,i),t.apply(this,arguments)}return f(i,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){qn.addClass(this.root,"hide")}},{key:"show",value:function(){return qn.removeClass(this.root,"hide"),""}},{key:"beforeCreate",value:function(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on(cr,(function(){e.isEndedShow&&qn.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(pr,(function(){e.onTimeUpdate()})),this.on(Ar,(function(){qn.removeClass(e.root,"hide"),qn.addClass(e.root,"xg-showplay"),e.once(pr,(function(){e.onTimeUpdate()}))}))):this.on(sr,(function(){qn.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?qn.removeClass(this.root,"xg-showplay"):this.once(pr,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"setConfig",value:function(e){var t=this;"string"==typeof e?this.config.poster=e:"object"===l(e)&&Object.keys(this.config).forEach((function(i){Object.keys(e).includes(i)&&(t.config[i]=e[i])})),this.update(this.config.poster)}},{key:"getBgSize",value:function(e){var t="";switch(e){case"cover":t="cover";break;case"contain":t="contain";break;case"fixHeight":t="auto 100%";break;case"fixWidth":t="100% auto";break;default:t=""}return t?"background-size: ".concat(t,";"):""}},{key:"render",value:function(){var e=this.config,t=e.poster,i=e.hideCanplay,n=e.fillMode,r=e.notHidden,o=this.getBgSize(n),a=t?"background-image:url(".concat(t,");").concat(o):o;return'<xg-poster class="xgplayer-poster '.concat(r?"xg-not-hidden":i?"xg-showplay":""," ").concat(t?"active":"",'" style="').concat(a,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,notHidden:!1,poster:"",fillMode:"fixWidth"}}}]),i}(Bo);$o.use(fl);var xF=f((function e(t,i){var n,r,o;h(this,e);var a=i&&"mobile"===i.isMobileSimulateMode,s=i.isLive,l=[].concat(s?[]:[ms,cs,al,nl,ys],[hs,vs,Ts,Ls,Ks,Ys,Ns,Bs,ws,Os]),c=[ga,CF,ka,os,wa,Js,Zs,rl,Ma];this.plugins=[vl,fa].concat(E(l),c,[yl,ml]);var u=a?"mobile":ir.device;switch(u){case"pc":(n=this.plugins).push.apply(n,[ns,Ua,Xs,kl,wl]);break;case"mobile":(r=this.plugins).push.apply(r,[ts]);break;default:(o=this.plugins).push.apply(o,[ns,Ua,Xs])}(ir.os.isIpad||"pc"===u)&&this.plugins.push(dl),this.ignores=[],this.i18n=[]}));function DF(e,t){return PF.apply(this,arguments)}function PF(){return(PF=u(s().mark((function e(t,i){var n,r,o,a,l,c,h,d,f,p,g,v,y,m,_,b;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.isLive,r=void 0!==n&&n,o=t.streamType,a=t.isMobile,l=void 0!==a&&a,c=t.getSoftOptionTask,h=t.playerData,d=[xF,OF(r)],f=h.openSoftDecoding,p=h.isMusic,g=[],v=[],l?d.push(IF({isLive:r,playerData:i.playerData})):d.push(LF({isLive:r,playerData:i.playerData})),e.t0=o,e.next="flv"===e.t0?9:"rtm"===e.t0?11:13;break;case 9:return v.push(u(s().mark((function e(){var t,n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!l){e.next=8;break}if(!yc()&&!f){e.next=6;break}return e.next=4,i.sdkUmdLoader.loadPlugins(vA.FLV);case 4:t=e.sent,g.push(t);case 6:e.next=12;break;case 8:return e.next=10,i.sdkUmdLoader.loadPlugins(vA.FLV);case 10:n=e.sent,g.push(n);case 12:case"end":return e.stop()}}),e)})))()),e.abrupt("break",14);case 11:return v.push(u(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([i.sdkUmdLoader.loadPlugins(vA.HLS),i.sdkUmdLoader.loadPlugins(vA.FLV)]);case 2:g.push(xM);case 3:case"end":return e.stop()}}),e)})))()),e.abrupt("break",14);case 13:return e.abrupt("break",14);case 14:return!p&&fc(i.playerData.options,"DanmuPlugin")&&v.push(u(s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([i.sdkUmdLoader.loadPlugins(vA.DanmuJS),i.sdkUmdLoader.loadPlugins(vA.DanmuMask)]);case 2:(t=e.sent)[0]&&t[1]&&g.push(BB);case 4:case"end":return e.stop()}}),e)})))()),fc(i.playerData.options,"Subtitle")&&i.playerData.plugins.every((function(e){return"subtitle"!==e.pluginName.toLowerCase()}))&&g.push(pH),e.next=18,Promise.all([c(),AF({isMobile:l,isLive:r,openSoftDecoding:f,streamType:o,playerData:i.playerData,plugins:g},i)].concat(v));case 18:return y=e.sent,m=T(y,2),_=m[0],b=m[1],e.abrupt("return",{presets:d,softDecodingOption:_,plugins:[].concat(g,E(b)).filter(
1Boolean)});case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function OF(e){var t=[wN,gH,cN];return e&&t.push(dN,kF),f((function e(){h(this,e),this.plugins=t,this.ignores=["error"]}))}function IF(e){var t=e.isLive,i=e.playerData,n=["error","playbackRate"],r=i.configs,o=fc(r,"EncryptHlsPlugin");null!=o&&o.playAuthToken||n.push("definition");var a=["time","playnext","progress","progresspreview","replay","playbackRate","discontinue","PlaybackRateMobilePlugin"],s=[mN];return f((function e(){h(this,e),this.plugins=s,this.ignores=t?[].concat(a,n):[].concat(n)}))}function LF(e){var t=e.isLive,i=e.playerData,n=["cssfullscreen"],r=["time","playnext","progress","progresspreview","replay","playbackRate","discontinue"],o=t?[UM]:[],a=i.configs,s=fc(a,"EncryptHlsPlugin");return null!=s&&s.playAuthToken||(n.push("definition"),o.push(QM)),f((function e(){h(this,e),this.plugins=o,this.ignores=t?[].concat(r,n):[].concat(n)}))}function AF(e,t){return RF.apply(this,arguments)}function RF(){return(RF=u(s().mark((function e(t,i){var n,r,o,a,l,c,u,h,d,f,p,g,v,y,m,_,b,k,w,S,T,E,C,x,D,P,O,I,L;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.isMobile,o=t.isLive,a=t.openSoftDecoding,l=t.streamType,c=t.playerData,u=t.plugins,h=[],d=c.configs,f=c.options,p=c.useHlsPluginForSafari,g=c.isBusinessDrm,v=c.isEncrypt,"hls"!==l){e.next=28;break}if(y=fc(c.configs,"EncryptHlsPlugin"),m="hls"===l&&!(null==y||!y.keyToken),_="hls"===l&&v&&!g,!(m||_||c.isOpenABR()&&!ir.os.isIos)){e.next=15;break}return e.next=11,i.sdkUmdLoader.loadPlugins(vA.HLSEncrypt);case 11:b=e.sent,h.push(b),e.next=28;break;case 15:if(k=fc(f,"Subtitle"),w=o&&k,S=(yc()||window.WebAssembly)&&a,T=d.enableHlsMSE,E=g&&ir.os.isAndroid,C=g&&bc,x=!(r||bc&&!p||C),!(r&&(S||w||T||E)||x)){e.next=28;break}return e.next=26,i.sdkUmdLoader.loadPlugins(vA.HLS);case 26:D=e.sent,h.push(D);case 28:if(("dash"!==l||d.url)&&!fc(f,"DASHPlugin")){e.next=33;break}return e.next=31,i.sdkUmdLoader.loadPlugins(vA.DASH);case 31:null!=(I=e.sent)&&null!==(P=I.encryptUtils)&&void 0!==P&&null!==(O=P.isSupported)&&void 0!==O&&O.call(P)&&u.push(I);case 33:if(fc(f,"vodLogOpts")&&h.push(uA),c.enableMenu&&h.push(ij),!(d.enableMp4MSE||fc(f,"Mp4EncryptPlayer")||["mp4","m4a"].includes(l)&&(v||null!=d&&null!==(n=d.autoBitrateOpts)&&void 0!==n&&n.enable||c.openSoftDecoding))){e.next=40;break}return e.next=38,i.sdkUmdLoader.loadPlugins(vA.MP4Encrypt);case 38:L=e.sent,h.push(L);case 40:return g&&h.push(EF),e.abrupt("return",h.filter((function(e){var t,i,n,r,o;return"encrypthlsplugin"===(null==e||null===(t=e.pluginName)||void 0===t?void 0:t.toLowerCase())?!(null==e||null===(n=e.isSupported)||void 0===n||!n.call(e))||(Ul.warn("å½åæµè§å¨ç¯å¢ä¸æ¯æHLSæ ¼å¼è§é¢çå 坿æ¾"),!1):"dashplugin"!==(null==e||null===(i=e.pluginName)||void 0===i?void 0:i.toLowerCase())||!(null==e||null===(r=e.encryptUtils)||void 0===r||null===(o=r.isSupported)||void 0===o||!o.call(r))||(Ul.warn("å½åæµè§å¨ç¯å¢ä¸æ¯æDASHæ ¼å¼è§é¢ææ¾"),!1)})));case 42:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function MF(){return(new DOMParser).parseFromString('<svg width="72" height="72" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg"><g fill="#FFF" fill-rule="evenodd"><circle fill-opacity=".3" cx="36" cy="36" r="36"/><path d="M40.167 32.667a.833.833 0 01-.834-.834v-1.666c0-.46.373-.834.834-.834h5.409a11.653 11.653 0 00-9.576-5c-6.443 0-11.667 5.224-11.667 11.667S29.557 47.667 36 47.667c5.285 0 9.749-3.514 11.183-8.333h3.445C49.112 46.014 43.138 51 36 51c-8.284 0-15-6.716-15-15 0-8.284 6.716-15 15-15 4.713 0 8.918 2.173 11.668 5.572l-.001-4.739c0-.46.373-.833.833-.833h1.667c.46 0 .833.373.833.833V31c0 .879-.68 1.598-1.542 1.662l-.125.005h-9.166z"/></g></svg>',"image/svg+xml").firstChild}function NF(){return(new DOMParser).parseFromString('<svg width="60" height="60" viewB
1ox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="60" height="60" rx="30" fill="#000" fill-opacity=".4"/><path d="M40.243 28.3a2 2 0 010 3.401L24.06 41.712c-1.332.825-3.052-.134-3.052-1.7V19.988c0-1.566 1.72-2.525 3.052-1.7l16.184 10.01z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function BF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zm6.767 2.278A7.474 7.474 0 0118.75 10a7.477 7.477 0 01-2.128 5.234.4.4 0 01-.57-.004l-.587-.586a.442.442 0 01.005-.617A5.812 5.812 0 0017.083 10c0-1.557-.61-2.97-1.603-4.017a.442.442 0 01-.003-.615l.586-.586a.4.4 0 01.57-.004zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function UF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.045 2.5h.55c.44 0 .8.34.831.771l.003.062v13.334c0 .44-.34.799-.771.83l-.063.003h-.55a.833.833 0 01-.443-.128l-.065-.045-4.866-3.744a.831.831 0 01-.323-.59l-.003-.07V7.077c0-.235.1-.458.272-.615l.054-.045 4.866-3.744a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.68 6.667c.23 0 .416.186.416.416v5.834c0 .23-.186.416-.416.416h-.834a.417.417 0 01-.416-.416V7.083c0-.23.186-.416.416-.416h.834zm10.467.294a.417.417 0 01.59 0l1.767 1.768L17.27 6.96a.417.417 0 01.589 0l.59.59a.417.417 0 010 .589L16.68 9.908l1.768 1.767c.15.15.162.387.035.55l-.035.04-.589.589a.417.417 0 01-.59 0l-1.767-1.768-1.768 1.768a.417.417 0 01-.59 0l-.588-.59a.417.417 0 010-.589l1.767-1.768-1.767-1.767a.417.417 0 01-.035-.55l.035-.04.589-.589z" fill="#fff"/></svg>',"image/svg+xml").firstChild}function jF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.867 2.5h.55c.44 0 .799.34.83.771l.003.062v13.334c0 .44-.34.799-.771.83l-.062.003h-.55a.833.833 0 01-.444-.128l-.064-.045-4.867-3.744a.831.831 0 01-.322-.59l-.003-.07V7.077c0-.235.099-.458.271-.615l.054-.045L9.36 2.673a.832.832 0 01.43-.17l.078-.003h.55-.55zM2.5 6.667c.23 0 .417.186.417.416v5.834c0 .23-.187.416-.417.416h-.833a.417.417 0 01-.417-.416V7.083c0-.23.187-.416.417-.416H2.5zm11.768.46A4.153 4.153 0 0115.417 10c0 1.12-.442 2.137-1.162 2.886a.388.388 0 01-.555-.007l-.577-.578c-.176-.176-.156-.467.009-.655A2.49 2.49 0 0013.75 10a2.49 2.49 0 00-.61-1.636c-.163-.188-.182-.477-.006-.653l.578-.578a.388.388 0 01.556-.006z" fill="#fff"/></svg>',"image/svg+xml").firstChild}var HF={startPlay:NF,play:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.121 8.299a2 2 0 010 3.402l-7.94 4.91c-1.332.825-3.051-.133-3.051-1.7V5.09c0-1.567 1.72-2.525 3.052-1.701l7.939 4.911z" fill="#fff"/></svg>',"image/svg+xml").firstChild},pause:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="5.313" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/><rect x="11.563" y="3.75" width="3.125" height="12.5" rx=".625" fill="#fff"/></svg>',"image/svg+xml").firstChild},fullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.778 2h4.444v1.7
178H3.778v4.444H2V3.778C2 2.796 2.796 2 3.778 2zM2 11.778v4.444C2 17.204 2.796 18 3.778 18h4.444v-1.778H4.823l2.313-2.313a.9.9 0 00-1.272-1.273l-2.086 2.086v-2.944H2zm14.222 0v4.444h-4.444V18h4.444c.982 0 1.778-.796 1.778-1.778v-4.444h-1.778zM18 8.222V3.778C18 2.796 17.204 2 16.222 2h-4.444v1.778h2.945l-2.587 2.586a.9.9 0 101.273 1.273l2.813-2.813v3.398H18z" fill="#fff"/></svg>',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="21" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.892 2h4.445v1.778H3.892v4.444H2.114V3.778C2.114 2.796 2.91 2 3.892 2zm4.445 16v-4.444c0-.982-.796-1.778-1.778-1.778H2.114v1.778h2.944L2.264 16.35a.9.9 0 001.272 1.273l2.988-2.987a.918.918 0 00.035-.037V18h1.778zm8-6.222v4.444h-4.445V18h4.445c.981 0 1.777-.796 1.777-1.778v-4.444h-1.777zM11.892 2v4.445c0 .981.796 1.777 1.778 1.777h4.444V6.445H15.17l2.568-2.568a.9.9 0 10-1.273-1.273L13.67 5.4V2h-1.778z" fill="#fff"/></svg>',"image/svg+xml").firstChild},playNext:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.03 8.312a2 2 0 010 3.376l-7.642 4.858c-1.332.847-3.073-.11-3.073-1.687V5.14c0-1.577 1.741-2.534 3.073-1.687l7.642 4.858z" fill="#fff"/><path d="M13 3.5a.5.5 0 01.5-.5h1a.5.5 0 01.5.5v13a.5.5 0 01-.5.5h-1a.5.5 0 01-.5-.5v-13z" fill="#fff"/></svg>',"image/svg+xml").firstChild},replay:MF,refresh:uN,danmuSetting:function(){return(new DOMParser).parseFromString('<svg width="22" height="19" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" opacity=".6"><path d="M-4-4h28v28H-4z"/><path d="M1 19a1 1 0 01-1-1V1a1 1 0 011-1h17.2a1 1 0 011 1v3.75h-.001l.001 1.475a.9.9 0 11-1.8 0V1.8H1.8v15.4h8.442l-.029.019h.296a.89.89 0 01.017 1.78h7.691L18.2 19H1z" fill="#FFF" fill-rule="nonzero"/><path d="M5.507 7.698L5.33 9.279h2.511c0 2.015-.075 3.362-.2 4.042-.151.68-.792 1.054-1.934 1.124-.327 0-.653-.023-1.005-.047l-.339-1.136c.327.035.678.059 1.03.059.628 0 .98-.188 1.067-.563.088-.374.138-1.183.138-2.424H4l.352-3.679h2.122V5.132H4.113V4.09h3.654v3.608h-2.26zm3.089-2.214h1.507A8.91 8.91 0 009.16 4.03l1.193-.375c.351.469.665.96.93 1.5l-.792.328h1.733a14.68 14.68 0 00.93-1.921l1.242.41a8.956 8.956 0 01-.854 1.51H15v4.933h-2.587v.902h2.446l-1.014 1.148h-1.432v2.097h-1.28v-2.097h-2.99v-1.148h2.99v-.902H8.595V5.484zm5.249 3.912v-.913h-1.432v.913h1.432zm-2.713 0v-.913H9.764v.913h1.368zm-1.368-1.92h1.368v-.961H9.764v.96zm2.65-.961v.96h1.43v-.96h-1.43z" fill="#FFF" fill-rule="nonzero"/><path d="M17.595 9.84l2.957 1.69a1.2 1.2 0 01.605 1.041v3.358c0 .43-.23.828-.605 1.041l-2.957 1.69a1.2 1.2 0 01-1.19 0l-2.957-1.69a1.2 1.2 0 01-.605-1.041V12.57c0-.43.23-.828.605-1.041l2.957-1.69a1.2 1.2 0 011.19 0zM17 12.47c-.994 0-1.8.797-1.8 1.781a1.79 1.79 0 001.8 1.781c.994 0 1.8-.797 1.8-1.781a1.79 1.79 0 00-1.8-1.781z" fill="#FFF"/></g></svg>',"image/svg+xml").firstChild},openDanmu:TN,closeDanmu:SN,volumeLarge:BF,volumeMuted:UF,volumeSmall:jF},FF={whitelist:[""],widescreen:!0,width:"100%",height:"100%",lang:pc(),fitVideoSize:!1,inactive:2e3,playsinline:!0,keyShortcut:"off",closeVideoClick:!0,closeVideoDblclick:!0,closePlayerBlur:!1,closeControlsBlur:!1,closePlayVideoFocus:!0,leavePlayerTime:0,mini:!1,pip:{position:"controlsRight",index:2.5,showIcon:!0},volume:{index:2.6},miniscreen:{left:window.innerWidth-360,top:window.innerHeight-450},time:{index:3},icons:a({},HF),flv:{retryCount:0},hls:{retryCount:3},gapJump:{smallGapLimit:1}},VF={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,preloadTime:8,start:{isShowPause:!1,isShowEnd:!1,mode:"hide",disableAnimate:!0},retry:{count:0}},zF={isLive:!1,closeVideoClick:!1,defaultPlaybackRate:1,closeVideoStopPropagation:!0,autoplay:!1,autoplayMuted:!1,playbackRate:[2,1.5,1.25,{rate:1,iconText:{zh:"åé",en:"Speed",jp:"Speed"}},.75,.5],start:{isShowPause:!0,isShowEnd:!1,mode:"hide",disableAnimate:!0},progresspreview:{isShowCoverPreview:!0},progress:{isPauseMoving:!0}};function GF(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=a({},FF),i=a({},e?VF:zF);return a(a({},t),i)}var WF={startPlay:NF,play:function(){return(new DOMParser).parseFromString('<svg style="\n height: 18px;\n width: 18px;\n" width="28" height="28" fill="none" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg"><path d="M19.77 11.619c1.768 1.094 1.768 3.668 0 4.762L8.653 23.257c-1.865 1.154-4.273-.188-4.273-2.381V7.125c0-2.194 2.408-3.536 4.273-2.382L19.77 11.62z" fill="#fff"/></svg>',"image/svg+xml").firstChild},pause:function(){return(new DOMParser).parseFromString('<svg style="\n height: 18px;\n width: 18px;\n" width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="7.438" y="5.25" width="4.375" height="17.5" rx=".875" fill="#fff"/><rect x="16.188" y="5.25" width="4.375" height="17.5" rx=".875" fill="#fff"/></svg>',"image/svg+xml").firstChild},fullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.125 3a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375H15.5v3.375c0 .207.168.375.375.375h.75A.375.375 0 0017 7.875v-4.5A.375.375 0 0016.625 3h-4.5zm0 12.5a.375.375 0 00-.375.375v.75c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-4.5a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375V15.5h-3.375zM3 3.375C3 3.168 3.168 3 3.375 3h4.5c.207 0 .375.168.375.375v.75a.375.375 0 01-.375.375H4.5v3.375a.375.375 0 01-.375.375h-.75A.375.375 0 013 7.875v-4.5zM7.875 15.5H4.5v-3.375a.375.375 0 00-.375-.375h-.75a.375.375 0 00-.375.375v4.5c0 .207.168.375.375.375h4.5a.375.375 0 00.375-.375v-.75a.375.375 0 00-.375-.375z" fill="#fff"/></svg>',"image/svg+xml").firstChild},exitFullscreen:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.5 8.333h-4.167c-.92 0-1.666-.746-1.666-1.666V2.5h1.666v4.167H17.5v1.666zM2.5 6.667v1.666h4.167c.92 0 1.666-.746 1.666-1.666V2.5H6.667v4.167H2.5zM2.5 13.333h4.167V17.5h1.666v-4.167c0-.92-.746-1.666-1.666-1.666H2.5v1.666zM13.333 17.5v-4.167H17.5v-1.666h-4.167c-.92 0-1.666.746-1.666 1.666V17.5h1.666z" fill="#fff"/></svg>',"image/svg+xml").firstChild},playNext:function(){return(new DOMParser).parseFromString('<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M4.77 4.124l8.358 5.07c.38.23.486.704.238 1.056a.807.807 0 01-.238.22L4.77 15.543c-.38.231-.889.132-1.137-.221a.723.723 0 01-.134-.417V4.762c0-.421.368-.762.822-.762.159 0 .316.042.449.124z" stroke="#fff" stroke-width="1.5"/><path d="M15.5 4.5A.5.5 0 0116 4h.5a.5.5 0 01.5.5v11a.5.5 0 01-.5.5H16a.5.5 0 01-.5-.5v-11z" fill="#fff"/></svg>',"image/svg+xml").firstChild},replay:MF,refresh:function(){return(new DOMParser).parseFromString('<svg width="18" height="18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M0 0h18v18H0z"/><path d="M10.875 7.5a.375.375 0 01-.375-.375v-.75c0-.207.168-.375.375-.375h2.434a5.25 5.25 0 10.723 4.5h1.55a6.75 6.75 0 11-1.332-5.743V2.626c0-.207.168-.375.375-.375h.75c.207 0 .375.168.375.375V6.75a.75.75 0 01-.694.748L15 7.5h-4.125z" fill="#FFF"/></g></svg>',"image/svg+xml").firstChild},danmuSetting:function(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.387 10.134a1 1 0 00-1 0l-1.887 1.09a1 1 0 00-.5.865v2.179a1 1 0 00.5.866l1.887 1.09a1 1 0 001 0l1.886-1.09a1 1 0 00.5-.866v-2.179a1 1 0 00-.5-.866l-1.886-1.089zm-.5 4.711a1.667 1.667 0 100-3.333 1.667 1.667 0 000 3.333z" fill="#fff"/></svg>',"image/svg+xml").firstChild},openDanmu:function(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><circle cx="13.833" cy="13" r="3.333" fill="#3370FF"/><path d="M15.591 12.011l-2.133 2.134-1.22-1.22" stroke="#fff" stroke-linecap="round" stroke-linejoin="round"/></svg>',"image/svg+xml").firstChild},closeDanmu:function(){return(new DOMParser).parseFromString('<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.746 12.444a1 1 0 00-.62.216L1.75 13.75V2.166c0-.23.187-.417.417-.417h11.666c.23 0 .417.187.417.417v6.687c.44.044.86.156 1.25.326V2.167c0-.92-.746-1.667-1.667-1.667H2.167C1.247.5.5 1.246.5 2.167V14.61a.833.833 0 001.35.653l1.71-1.354a1 1 0 01.621-.216h5.543a4.195 4.195 0 01-.02-1.25H3.745z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 4a.5.5 0 00-.5.5V5a.5.5 0 00.5.5h5A.5.5 0 0010 5v-.5a.5.5 0 00-.5-.5h-5zm2.333 4.167a.5.5 0 00-.5.5v.666a.5.5 0 00.5.5h4.292c.311-.266.662-.487 1.042-.653v-.513a.5.5 0 00-.5-.5H6.834zm-3 .5a.5.5 0 01.5-.5H5a.5.5 0 01.5.5v.666a.5.5 0 01-.5.5h-.667a.5.5 0 01-.5-.5v-.666z" fill="#fff"/><path d="M11 4.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5V5a.5.5 0 01-.5.5h-.5A.5.5 0 0111 5v-.5z" fill="#fff"/><circle cx="13.833" cy="13" r="2.733" stroke="#fff" stroke-width="1.2"/><path fill="#fff" d="M12.833 10.77l3.473 3.472-1.063 1.064-3.474-3.473z"/></svg>',"image/svg+xml").firstChild},volumeLarge:BF,volumeMuted:UF,volumeSmall:jF},KF={width:"100%",height:"100%",lang:pc(),playsinline:!0,closeVideoClick:!0,closeVideoTouch:!0,whitelist:[""],"x5-video-player-type":"h5-page","x5-video-player-fullscreen":!1,"x5-video-orientation":"landscape|portrait",enterTips:{background:"linear-gradient(90deg,#000,#49e6d3,#49e6d3,#138afc,#000)"},retainPlay:!0,start:{isShowPause:!0,isShowEnd:!0,disableAnimate:!1},fullscreen:{useCssFullscreen:!1},plugins:[],time:{mode:"pc",index:2.5},controls:{mode:"flex"},danmusettings:{index:"2"},danmuicon:{index:"3"},cusPlaybackRatePlugin:{needCheck:!0,needPanel:!1},icons:a({}
1,WF),flv:{innerDegrade:1,retryCount:0},hls:{innerDegrade:1,retryCount:3},gapJump:{smallGapLimit:1}},YF={isLive:!0,closeVideoClick:!0,autoplay:!0,autoplayMuted:!0,start:{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"},retry:{count:0},longwaiting:{duration:3e4},mobile:{gestureY:!1,gestureX:!1,disableActive:!0}},$F={isLive:!1,closeVideoClick:!1,autoplay:!1,autoplayMuted:!1,playbackRate:[2,1.5,1.25,{rate:1,iconText:"åé",en:"speed",jp:"speed"},.75,.5],defaultPlaybackRate:1,closeVideoStopPropagation:!0,mobile:{gestureY:!1},start:{isShowPause:!0,isShowEnd:!1,disableAnimate:!1,mode:"hide"}};function qF(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=a({},KF),i=a({},e?YF:$F);return a(a({},t),i)}var XF=Bo.POSITIONS,JF=function(){function e(t){var i,n,r;h(this,e);var o=t.config,a=t.root,s=t.player;this.config=o,this.parent=a,this.player=s;var l=null!==(i=null==o?void 0:o.mode)&&void 0!==i?i:Pl.INNER;Object.values(Pl).includes(l)||(l=Pl.INNER),this.mode=l,this.isAutoChange=null!==(n=null==o?void 0:o.isAutoChange)&&void 0!==n&&n,this.isShow=!1,this.showCancelBtn=null!==(r=null==o?void 0:o.showCancelBtn)&&void 0!==r&&r,this.initEvents(),this.renderPanel()}var t;return f(e,[{key:"initEvents",value:function(){var e;this.isAutoChange&&(window.addEventListener("orientationchange",this.handleOrientationChange.bind(this)),null===(e=this.player)||void 0===e||e.on(Ur,this.handleOrientationChange.bind(this)))}},{key:"handleOrientationChange",value:function(){var e,t,i,n=[90,-90,"90","-90"].includes(window.orientation);null!==(e=this.player)&&void 0!==e&&e.fullscreen&&n?this.changeMode(Pl.FULLSCREEN):this.changeMode(null!==(t=null===(i=this.config)||void 0===i?void 0:i.mode)&&void 0!==t?t:Pl.INNER)}},{key:"changeConfig",value:function(e){this.config=e}},{key:"changeMode",value:function(e){this.mode=e,this.player.emit(PM.PANEL_MODE_CHANGE,{mode:e}),this.destroy(),this.renderPanel()}},{key:"renderPanel",value:function(){var e="xg-mobile-panel panel-".concat(["normal","inner","fullscreen"][this.mode]);switch(this.root=qn.createDom("div","",{},e),this.parent&&(this.parent.appendChild(this.root),this.hide()),this.bind("click",this.handleHide.bind(this)),this.mode){case Pl.NORMAL:var t=qn.createDom("div","",{},"xg-mobile-panel-content ".concat(this.showCancelBtn?"xg-mobile-panel-cancel-mode":""));if(this.root.appendChild(t),this.showCancelBtn){var i="zh-cn"===this.player.lang?"zh":this.player.lang,n=qn.createDom("div",Ll[i],{},"xg-mobile-panel-cancel");this.root.appendChild(n)}this.container=t,t.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()}));break;case Pl.INNER:this.container=this.root;break;case Pl.FULLSCREEN:var r=qn.createDom("div","",{},"xg-mobile-panel-content");this.root.appendChild(r),this.container=r,r.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault()}))}}},{key:"showPanel",value:(t=u(s().mark((function e(t){var i,n=this,r=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r.length>1&&void 0!==r[1]?r[1]:"",r.length>2&&void 0!==r[2]&&r[2]&&qn.addClass(t,"item-list-panel-content"),this.setTitle(i),!this.children){e.next=9;break}return e.next=7,this.hide();case 7:return setTimeout((function(){n.children=t,n.container&&(n.title&&n.container.appendChild(n.title),n.c
1ontainer.appendChild(t)),n.show()})),e.abrupt("return");case 9:this.children=t,this.container&&(this.title&&this.container.appendChild(this.title),this.container.appendChild(t)),this.show();case 12:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"updatePanel",value:function(e){this.children&&qn.hasClass(this.children,"item-list-panel-content")&&qn.addClass(e,"item-list-panel-content"),this.children=e,this.container&&(this.container.innerHTML="",this.title&&this.container.appendChild(this.title),this.container.appendChild(e))}},{key:"setTitle",value:function(e){e&&this.mode!==Pl.INNER?this.title?this.title.innerHTML=e:this.title=this.renderTitle(e):this.title=void 0}},{key:"renderTitle",value:function(e){return qn.createDom("div",e,{},"xg-mobile-panel-title")}},{key:"show",value:function(){this.isShow=!0,qn.removeClass(this.root,"hide"),qn.addClass(this.root,"active")}},{key:"hide",value:function(){this.isShow=!1,qn.removeClass(this.root,"active"),qn.addClass(this.root,"hide"),this.container&&(this.container.innerHTML="")}},{key:"handleHide",value:function(e){e.stopPropagation(),e.preventDefault(),this.hide()}},{key:"bind",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,i)}},{key:"destroy",value:function(){var e;this.parent&&this.root&&this.parent.contains(this.root)&&(this.parent.removeChild(this.root),this.root=null),window.removeEventListener("orientationchange",this.handleOrientationChange.bind(this)),null===(e=this.player)||void 0===e||e.off(Ur,this.handleOrientationChange.bind(this))}}]),e}();function ZF(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16 3.8001H4C3.55817 3.8001 3.2 4.15827 3.2 4.6001V12.6001C3.2 13.0419 3.55817 13.4001 4 13.4001H16C16.4418 13.4001 16.8 13.0419 16.8 12.6001V4.6001C16.8 4.15827 16.4418 3.8001 16 3.8001ZM4 2.6001C2.89543 2.6001 2 3.49553 2 4.6001V12.6001C2 13.7047 2.89543 14.6001 4 14.6001H16C17.1046 14.6001 18 13.7047 18 12.6001V4.6001C18 3.49553 17.1046 2.6001 16 2.6001H4ZM5.0249 6.24509V11.6001H5.9024V9.23009H8.6174V11.6001H9.4949V6.24509H8.6174V8.48009H5.9024V6.24509H5.0249ZM10.5474 6.24509V11.6001H12.5049C13.3749 11.6001 14.0274 11.3601 14.4774 10.8801C14.9049 10.4226 15.1224 9.77009 15.1224 8.92259C15.1224 8.06759 14.9049 7.41509 14.4774 6.96509C14.0274 6.48509 13.3749 6.24509 12.5049 6.24509H10.5474ZM11.4249 6.99509H12.3399C13.0074 6.99509 13.4949 7.14509 13.8024 7.45259C14.1024 7.75259 14.2524 8.24759 14.2524 8.92259C14.2524 9.58259 14.1024 10.0701 13.8024 10.3851C13.4949 10.6926 13.0074 10.8501 12.3399 10.8501H11.4249V6.99509ZM4.15 16.1001C3.79101 16.1001 3.5 16.3911 3.5 16.7501C3.5 17.1091 3.79101 17.4001 4.15 17.4001H15.85C16.209 17.4001 16.5 17.1091 16.5 16.7501C16.5 16.3911 16.209 16.1001 15.85 16.1001H4.15Z" fill="#ffffff"/>\n</svg>',"image/svg+xml").firstChild}var QF=Bo.POSITIONS,eV=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,a(a({},e),{},{clientType:"MOBILE"}))).handleButtonChange=n.handleButtonChange.bind(_(n)),n}return f(i,[{key:"afterCreate",value:function(){S(v(i.prototype),"afterCreate",this).call(this)}},{key:"refreshDefinitionList",value:function(){var e,t=this.playerData.current.lineId,i=this.playerData.getDefinitionListByLineId(t);null!==(e=this.player.config)&&void 0!==e&&e.alwaysShowDefinition&&(this.config.alwaysShowDefinition=!0),(i.length>1||this.config.alwaysShowDefinition)&&(this.appendChild(".xgplayer-icon",this.icons.definition),this.initEvents()),this.renderItemList()}},{key:"registerIcons",value:function(){return{definition:{icon:ZF,class:"xgplayer-definition-svg"}}}},{key:"registerLanguageTexts",value:function(){return{definition:{jp:"æå¿«ã",en:"Definition",zh:"æ¸
æ°åº¦","zh-hk":"æ¸
æ°åº¦"},definitionSelect:{jp:"ã¯ã©ãªãã£ã»ã¬ã¯ã·ã§ã³",en:"Definition Choose",zh:"æ¸
æ°åº¦éæ©","zh-hk":"æ¸
æ°åº¦é¸æ"},switching:{jp:"ã«åãæ¿ãã",en:"Switching to",zh:"æ£å¨åæ¢è³","zh-
1hk":"æ£å¨åæè³"}}}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){this.unbind(["click"],this.handleButtonChange),this.bind(["click"],this.handleButtonChange)}},{key:"handleButtonChange",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=this.getCurrentDefinitionInfo(this.player),i=t.defaultDefinition,n=t.list,r=qn.createDom("div","",{},"definition-panel-content");return n.forEach((function(t){t.selected=i===t.definition,t.isDefinitionAuto=e.playerData.isAutoDefinition(t.definition);var n=e.renderItem(t);r.appendChild(n)})),this.renderList=n,r}},{key:"renderItem",value:function(e){var t=this,i=this.playerData.current.definition,n=qn.createDom("div","",{},"panel-Item ".concat(i===e.definition?"select-in":"")),r=this.getShowText(this.i18n,e,i);if(this.showRealDefinition(e)){var o,a=null===(o=this.renderList)||void 0===o?void 0:o.find((function(e){return t.playerData.isDefinitionMatch(null==e?void 0:e.definition,t._autoRealDefinition)})),s=this.getShowText(this.i18n,a,null==a?void 0:a.definition);r=s?"".concat(r,"(").concat(s,")"):r}return n.innerHTML=r,n.addEventListener("click",(function(n){if(n.stopPropagation(),n.preventDefault(),e.definition!==t.playerData.current.definition){var r,o=null===(r=t.playerData.getCurrentStreams())||void 0===r?void 0:r[0];t.emitUserAction(n,"change_definition",{from:o,to:e}),t.config.showToastOnManualClick&&t.showToast(e,i),t.playerData.current.definition=e.definition}})),n}},{key:"selectDef",value:function(e){this.selectDefinition(e)}},{key:"changeDefinition",value:function(e){var t=this,i=this.renderList.find((function(i){return t.playerData.isDefinitionMatch(i.definition,e)}));i&&this.selectDef(i)}},{key:"renderPanel",value:function(e){var t;null===(t=this.player)||void 0===t||null===(t=t.panel)||void 0===t||t.showPanel(e,this.langText.definitionSelect,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player)||void 0===e||null===(e=e.panel)||void 0===e||e.updatePanel(t)}},{key:"destroy",value:function(){S(v(i.prototype),"destroy",this).call(this),this.unbind(["click"],this.handleButtonChange.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-definition">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"DefinitionMobilePlugin"}},{key:"textTips",get:function(){return{jp:"æå¿«ã",en:"Definition",zh:"æ¸
æ°åº¦","zh-hk":"æ¸
æ°åº¦"}}},{key:"defaultConfig",get:function(){return{position:QF.CONTROLS_RIGHT,index:2.7,showToastOnManualClick:!0,alwaysShowDefinition:!1}}}]),i}(ZM(Bo));function tV(){return(new DOMParser).parseFromString('<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M12.7123 1C11.85 1 11.1173 1.55472 10.8516 2.32675L4.94973 2.32675C3.16413 2.32675 1.71662 3.77427 1.71662 5.55987C1.71662 7.34547 3.16413 8.79298 4.94973 8.79298L11.0483 8.79298L11.1134 8.79418C11.9936 8.82748 12.697 9.55166 12.697 10.44C12.697 11.3497 11.9596 12.0871 11.05 12.0871H5.01323C4.67882 11.4781 4.03143 11.0654 3.28763 11.0654C2.20111 11.0654 1.32031 11.9462 1.32031 13.0327C1.32031 14.1192 2.20111 15 3.28763 15C4.14992 15 4.88264 14.4452 5.14834 13.6732H11.05C12.8356 13.6732 14.2831 12.2256 14.2831 10.44C14.2831 8.65444 12.8356 7.20693 11.05 7.20693L4.94973 7.20693C4.04009 7.20693 3.30267 6.46951 3.30267 5.55987C3.30267 4.65022 4.04009 3.91281 4.94973 3.91281L10.9866 3.91281C11.321 4.52183 11.9685 4.93464 12.7123 4.93464C13.7988 4.93464 14.6796 4.05384 14.6796 2.96732C14.6796 1.8808 13.7988 1 12.7123 1ZM12.7123 2.18954C12.2827 2.18954 11.9345 2.53777 11.9345 2.96732C11.9345 3.39688 12.2827 3.7451 12.7123 3.7451C13.1418 3.7451 13.4901 3.39688 13.4901 2.96732C13.4901 2.53777 13.1418 2.18954 12.7123 2.18954ZM2.50986 13.0327C2.50986 12.6031 2.85808 12.2549 3.28763 12.2549C3.71719 12.2549 4.06541 12.6031 4.06541 13.0327C4.06541 13.4622 3.71719 13.8105 3.28763 13.8105C2.85808
113.8105 2.50986 13.4622 2.50986 13.0327Z" fill="#FFFFFF"/>\n</svg>',"image/svg+xml").firstChild}var iV=Bo.POSITIONS,nV=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).playerData=e.player.config.playerData,n.dataMonitoring(),n}return f(i,[{key:"dataMonitoring",value:function(){var e=this;this.playerData&&Sn.subscribeProperty(this.playerData.current,"definition",(function(t,i){if(t!==i&&e.player){var n=e.playerData.getCurrentUrl();e.player.changeDefinition({definition:i,url:n}),e.updatePanel(),setTimeout((function(){e.player.paused&&e.player.play()}),1e3)}}))}},{key:"registerIcons",value:function(){return{line:{icon:tV,class:"xgplayer-line-svg"}}}},{key:"registerLanguageTexts",value:function(){return{line:{jp:"ã©ã¤ã³",en:"Line",zh:"线路","zh-hk":"ç·è·¯"},lineSelect:{jp:"ã©ã¤ã³é¸ã¶",en:"Line Choose",zh:"çº¿è·¯éæ©","zh-hk":"ç·è·¯é¸æ"}}}},{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.line),this.initEvents()}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this))}},{key:"handleButtonChange",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=this.playerData.getLineList(),i=qn.createDom("div","",{},"line-panel-content");return t.forEach((function(t){var n=e.renderItem(t);i.appendChild(n)})),i}},{key:"renderItem",value:function(e){var t=this,i=this.playerData.current.lineId,n=qn.createDom("div","",{},"panel-Item ".concat(i===e.lineId?"select-in":""));return n.innerHTML=this.i18n[e.lineTextKey]||e.lineTextKey,n.addEventListener("click",(function(i){i.stopPropagation(),i.preventDefault(),t.player.emit(PM.LINE_CHANGE,{from:t.playerData.current.lineId,to:e.lineId}),t.playerData.current.lineId=e.lineId,t.player.emit(DM.PLAYER_REBUILD)})),n}},{key:"renderPanel",value:function(e){var t;null===(t=this.player)||void 0===t||null===(t=t.panel)||void 0===t||t.showPanel(e,this.langText.lineSelect,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player)||void 0===e||e.panel.updatePanel(t)}},{key:"destroy",value:function(){this.unbind(["click"],this.handleButtonChange.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-line">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"LineMobilePlugin"}},{key:"textTips",get:function(){return{jp:"ã©ã¤ã³",en:"Line",zh:"线路","zh-hk":"ç·è·¯"}}},{key:"defaultConfig",get:function(){return{position:iV.CONTROLS_RIGHT,index:2.8}}}]),i}(Bo);function rV(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M14.6879 3.64579C14.7387 3.60575 14.7387 3.52868 14.6879 3.48864L13.3089 2.40296C13.2433 2.35132 13.147 2.39805 13.147 2.48153V4.6529C13.147 4.73639 13.2433 4.78312 13.3089 4.73147L14.6879 3.64579ZM4 2.61914H11.3001V3.91914H4C3.6134 3.91914 3.3 4.23254 3.3 4.61914V15.6191C3.3 16.0057 3.6134 16.3191 4 16.3191H16C16.3866 16.3191 16.7 16.0057 16.7 15.6191V6.75253H18V15.6191C18 16.7237 17.1046 17.6191 16 17.6191H4C2.89543 17.6191 2 16.7237 2 15.6191V4.61914C2 3.51457 2.89543 2.61914 4 2.61914ZM17.7879 3.48864C17.8388 3.52868 17.8388 3.60575 17.7879 3.64579L16.4089 4.73147C16.3433 4.78312 16.2471 4.73639 16.2471 4.6529V2.48153C16.2471 2.39805 16.3433 2.35132 16.4089 2.40296L17.7879 3.48864Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var oV,aV=Bo.POSITIONS,sV=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).state={currentRate:1,isSupport:!0},n.playerData=e.player.config.playerData,n}return f(i,[{key:"registerIcons",value:function(){return{playbackRate:{icon:rV,class:"xgplayer-rate-svg"}}}},{key:"registerLanguageTexts",value:function(){return{rate:{jp:"åé",en:"PlaybackRate",zh:"åé","zh-hk":"åé"},rateSelect:{jp:"åéé¸ã¶",en:"PlaybackRate",zh:"åééæ©","zh-hk":"åé鏿"}}}},{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.playbackRate),this.initEvents(),this.state.currentRate=this.player.playbackRate||1,this.changeIconText()}},{key:"afterPlayerInit",value:function(){}},{key:"initEvents",value:function(){var e=this;this.bind(["click"],this.renderList.bind(this)),this.on(br,(function(){var t;e.state.currentRate!==e.player.playbackRate&&(e.state.currentRate=e.player.playbackRate,null!==(t=e.player)&&void 0!==t&&null!==(t=t.panel)&&void 0!==t&&t.isShow&&e.updatePanel(),e.changeIconText())}))}},{key:"renderList",value:function(){var e=this.renderItemList();this.renderPanel(e)}},{key:"renderItemList",value:function(){var e=this,t=qn.createDom("div","",{},"playbackRate-panel-content");return this.config.list.forEach((function(i){var n=e.renderItem(i);t.appendChild(n)})),t}},{key:"renderItem",value:function(e){var t=this,i=G(e)?e:{textKey:e+"X",value:e},n=qn.createDom("div","",{},"panel-Item ".concat(this.state.currentRate===i.value?"select-in":""));return n.innerHTML=this.i18n[i.textKey]||i.textKey,n.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault();var n={playbackRate:{from:t.player.playbackRate,to:i.value}};t.emitUserAction(e,"change_rate",{props:n}),t.state.currentRate=i.value,t.player.playbackRate=i.value,t.updatePanel(),t.changeIconText()})),n}},{key:"renderPanel",value:function(e){var t;null===(t=this.player)||void 0===t||null===(t=t.panel)||void 0===t||t.showPanel(e,this.langText.rateSelect,!0)}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player)||void 0===e||e.panel.updatePanel(t)}},{key:"changeIconText",value:function(){var e,t=this.state.currentRate,i=t%1==0?t.toFixed(1):t
1+"";switch(i.length){case 1:case 2:case 3:default:e=.7;break;case 4:e=.5}var n=this.find(".icon-text");n.style.transform="scale(".concat(e,")"),n.innerHTML=i}},{key:"destroy",value:function(){this.unbind(["click"],this.renderList.bind(this))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-mobile-playBackRate">\n <div class="xgplayer-icon">\n <div class="icon-text"></div>\n </div>\n </xg-icon>\n '}}],[{key:"pluginName",get:function(){return"PlaybackRateMobilePlugin"}},{key:"textTips",get:function(){return{jp:"åé",en:"PlaybackRate",zh:"åé","zh-hk":"åé"}}},{key:"defaultConfig",get:function(){return{position:aV.CONTROLS_RIGHT,index:2.9,list:[2,1.5,1.25,1,.75,.5],default:1}}}]),i}(Bo),lV=function(){function e(t){h(this,e),this.__args=null,this.sdk=null,this.playerData=null,this.player=null,this._emitter=null,this.beforeCreate&&"function"==typeof this.beforeCreate&&this.beforeCreate(),this.__args=t,this.pluginName="",this.__init(t)}return f(e,[{key:"beforeCreate",value:function(){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerCreate",value:function(){}},{key:"afterPlayerCreate",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(t){var i=this;e.defineGetterOrSetter(this,{sdk:{get:function(){return t.sdk},configurable:!0},player:{get:function(){return t.sdk.getPlayerInstance()},configurable:!0},playerData:{get:function(){return t.sdk.playerData},configurable:!0},pluginName:{get:function(){return t.pluginName?t.pluginName.toLowerCase():i.constructor.pluginName.toLowerCase()},configurable:!0},_emitter:{get:function(){return t.sdk._emitter},configurable:!0}})}},{key:"__destroy",value:function(){var e=this,t=this.sdk,i=this.pluginName;this.destroy&&"function"==typeof this.destroy&&this.destroy(),["sdk","player","playerData","pluginName","_emitter"].map((function(t){Object.defineProperty(e,t,{writable:!0})})),Object.keys(this).map((function(t){e[t]=null,delete e[t]})),Object.setPrototypeOf&&Object.setPrototypeOf(this,null),delete t._sdkPlugins[i]}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var i in t)Object.defineProperty(e,i,t[i])}},{key:"pluginName",get:function(){return"pluginName"}}]),e}(),cV={playAuthToken:"",needDefinitionList:!0},uV=function(e){g(d,e);var t,i,n,r,o,c=k(d);function d(e){var t;return h(this,d),(t=c.call(this,e)).isPlayByToken=!1,t.isEncrypt=!1,t.config=null,t.useUnionInfoDRM=!0,t.retryCount=1,t.init(),t}return f(d,[{key:"beforePlayerCreate",value:(o=u(s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isPlayByToken){e.next=5;break}return e.next=3,this.getVideoInfo();case 3:(t=e.sent)&&this.playerData.initPlayData(t);case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getVideoInfo",value:(r=u(s().mark((function e(){var t,i,n,r,o,c,u,h,d,f,p,g,v,y,m,_,b,k,w,S,T,C;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.checkPlayAuthTokenValid()){e.next=3;break}return e.abrupt("return");case 3:if(!this.keyTokenInfo||!this.checkKeyTokenValid()){e.next=5;break}return e.abrupt("return");case 5:if(!this.thirdPartyDrmAuthTokenInfo||!this.checkDrmAuthTokenValid()){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,this.getVideos();case 9:if(e.t0=e.sent,e.t0){e.next=12;break}e.t0={};case 12:return t=e.t0,this.playInfo=t,n=(i=t||{}).type,r=i.poster,o=i.vid,c=i.dashOpts,u=i.thumbs,h=i.barrageMaskUrl,d=t.playList||[],f=n||ql(this.config),e.next=19,this.getPrivateDrmInfo(d,o,f);case 19:if(this.playerData.options.vid=o,this.config.needPoster&&r&&("string"==typeof this.playerData.options.poster?this.playerData.options.poster=r:"object"===l(this.playerData.options.poster)?this.playerData.options.poster.poster=r:this.playerData.options.poster=r),this.config.needThumbs&&u.length>0&&this.getThumbnailConfig(u),this.config.needBarrageMask&&h&&this.getBarrageMaskUrl(h),!(d.length>0)){e.next=39;break}return v=(null===(p=this.playerData)||void 0===p||null===(p=p.adapter)||void 0===p?void 0:p.generatePlaylistFromServer(t))||E(d),y=this.config.defaultDefinition||this.playerData.configs.defaultDefinition,m=v[0],y&&(_=v.find((function(e){return(e.mapDefinition||e.definition||e.Definition).toLocaleLowerCase()===y.toLocaleLowerCase()}
1)))&&(m=_),b=this.config.needDefinitionList?v:[m],this.isEncrypt=!(null==b||!b[0].kid),k={vid:o,playList:b},"hls"===f&&this.isEncrypt&&!this.playerData.isBusinessDrm&&this.getEncryptHlsConfig(k),("dash"===f||this.playerData.configs.DASHPlugin)&&this.getDashPluginConfig(a(a({},k),{},{dashOpts:c}),y),w=this.playerData.configs,S=w.autoBitrateOpts,T=w.Mp4EncryptPlayer,C=w.enableMp4MSE,(["mp4","m4a"].includes(f)&&this.isEncrypt||"mp4"===f&&null!=S&&S.enable||T||C)&&this.getMp4EncryptConfig(k),this.getDrmConfig(k),e.abrupt("return",{playList:b,codec:(null===(g=this.tokenInfo)||void 0===g||null===(g=g.Codec)||void 0===g?void 0:g.toLowerCase())||vn.H264,defaultDefinition:m.definition});case 39:Ul.error("get no video by playAuthToken");case 40:e.next=45;break;case 42:e.prev=42,e.t1=e.catch(0),Ul.error(e.t1);case 45:case"end":return e.stop()}}),e,this,[[0,42]])}))),function(){return r.apply(this,arguments)})},{key:"getVideos",value:(n=u(s().mark((function e(){var t,i,n=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=function(e){var t,i;try{100006===rn(JSON.parse(e.response),"ResponseMetadata.Error.CodeN")&&(Ul.error("playAuthToken is invalid or expired, please check or update your playAuthToken"),n.sdk.emit(DM.TOKEN_EXPIRED,e))}catch(e){Ul.log(e)}null===(t=n._emitter)||void 0===t||t.emit(PM.GET_PLAY_URL_ERR,e);var r={errorType:"token",errorCode:9100,errorMessage:"get play url error by playAuthToken, please check the playAuthToken",ext:{},originError:e};null===(i=n.sdk)||void 0===i||i.delayError.push(r)},i=function(){var e=u(s().mark((function e(i){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.config.playDomain||502!==(null==i?void 0:i.status)||!n.playerData.apiMap.backupPlayDomain){e.next=7;break}return n.playerData.playDomainDegrade=!0,e.next=4,Ql((function(){return Zl(a({playDomain:n.playerData.playDomain},n.config))}),n.retryCount,(function(e){return 502===e.status}),t);case 4:return e.abrupt("return",e.sent);case 7:t(i);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.next=4,Ql((function(){return Zl(a({playDomain:n.config.playDomain||n.playerData.playDomain},n.config))}),this.retryCount,(function(e){return 502===e.status}),i);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getPrivateDrmInfo",value:(i=u(s().mark((function e(t,i,n){var r,o,a,l,c,u,h,d=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.config.getDrmAuthToken||"function"!=typeof this.config.getDrmAuthToken||!this.playerData.unionId){e.next=34;break}if(this.sessionId=(new Date).getTime().toString(),"hls"!==n){e.next=9;break}return e.next=5,this.sdk.sdkUmdLoader.loadPlugins(vA.HLSEncrypt);case 5:o=e.sent,r=o.updateUnionInfo(this.playerData.unionId,this.sessionId),e.next=21;break;case 9:if("dash"!==n){e.next=16;break}return e.next=12,this.sdk.sdkUmdLoader.loadPlugins(vA.DASH);case 12:a=e.sent,r=a.updateUnionInfo(this.playerData.unionId,this.sessionId),e.next=21;break;case 16:if(!["mp4","m4a"].includes(n)){e.next=21;break}return e.next=19,this.sdk.sdkUmdLoader.loadPlugins(vA.MP4Encrypt);case 19:l=e.sent,r=l.updateUnionInfo(this.playerData.unionId,this.sessionId);case 21:if(r){e.next=23;break}return e.abrupt("return");case 23:return c=E(new Set(t.map((function(e){return e.kid})))).join(","),e.prev=24,e.next=27,gc(dc(this.config.getDrmAuthToken(c,i,r)),200,"The execution time of obtaining privateDrmAuthToken by getDrmAuthToken function of options has exceeded more than 200ms");case 27:(u=e.sent)&&"string"==typeof u&&(this.privateDrmAuthToken=u,null!=(h=Yl(u))&&h.DrmType&&(this.useUnionInfoDRM="webdevice"===(null==h?void 0:h.DrmType)),t.forEach((function(e){e.drmKeyToken=d.privateDrmAuthToken}))),e.next=34;break;case 31:e.prev=31,e.t0=e.catch(24),Ul.error("get privaterDrmToken fail");case 34:case"end":return e.stop()}}),e,this,[[24,31]])}))),function(e,t,n){return i.apply(this,arguments)})},{key:"getEncryptHlsConfig",value:function(e){var t,i,n=e||{},r=n.playList,o=n.vid,s=this.config,c=s.playDomain,u=s.keyToken,h=s.getKeyType,d=null===(t=this.playerData.configs)||void 0===t?void 0:t.EncryptHlsPlugin,f="object"===l(d)?d:{},p=null==r||null===(i=r[0])||void 0===i?void 0:i.kid;if(u)this.playerData.options.EncryptHlsPlugin=a({keyToken:u,playDomain:c||this.playerData.playDomain,getKeyType:h||"TOP",preferMMS:!0,preferMMSStreaming:!0},f);else if(this.privateDrmAuthToken&&this.sessionId){var g=Yl(this.privateDrmAuthToken),v=parseInt(""+g["X-Expires"]),y=isNaN(v)?30:v;this.playerData.options.EncryptHlsPlugin=a({vid:o,kid:p,keyTokenExpiredDuration:y,drmKeyToken:this.privateDrmAuthToken,useUnionInfoDRM:this.useUnionInfoDRM,sessionId:this.sessionId,playDomain:c||this.playerData.playDomain,preferMMS:!0,preferMMSStreaming:!0},f)}}},{key:"getThumbnailConfig",value:function(e){var t=e[0],i=a({},this.playerData.configs.thumbnail||{});this.playerData.options.thumbnail=a({pic_num:t.CaptureNum,urls:t.StoreUrls,width:t.CellWidth,height:t.CellHeight,col:t.ImgXLen,row:t.ImgYLen},i)}},{key:"getBarrageMaskUrl",value:function(e){var t,i=null===(t=this.playerData.configs)||void 0===t?void 0:t.DanmuPlugin,n="object"===l(i)?i:{},r=a({},(null==n?void 0:n.maskConfig)||{});this.playerData.configs.DanmuPlugin?(this.playerData.options.DanmuPlugin.active=!0,this.playerData.options.DanmuPlugin.maskActive=!0,this.playerData.options.DanmuPlugin.maskConfig=a({maskUrl:e},r)):this.playerData.options.DanmuPlugin={active:!0,maskActive:!0,maskConfig:a({maskUrl:e},r)}}},{key:"getDashPluginConfig",value:function(e,t){var i,n,r=e||{},o=r.vid,s=r.playList,l=void 0===s?[]:s,c=r.dashOpts,u=this.config.playDomain,h=a({},(null===(i=this.playerData.configs)||void 0===i?void 0:i.DASHPlugin)||{}),d=null==l||null===(n=l[0])||void 0===n?void 0:n.kid,f=c.Data.PlayInfoList.reduce((function(e,t){var i=t.Definition||t.Quality,n="",r=l.find((function(e){return e.Definition===i||e.Quality===i}));return r&&(n=r.definition),e[i]=n,e}),{});if(this.playerData.dashOpts=c,this.privateDrmAuthToken&&this.sessionId&&!this.playerData.isBusinessDrm){var p=Yl(this.privateDrmAuthToken),g=parseInt(""+p["X-Expires"]),v=isNaN(g)?30:g;this.playerData.options.DASHPlugin=a({playInfoType:"TOP",vid:o,dashOpts:c,defaultFormat:"dash",definitionText:f,defaultDefinition:t,useUnionInfoDRM:this.useUnionInfoDRM,kid:d,keyTokenExpiredDuration:v,sessionId:this.sessionId,drmKeyToken:this.privateDrmAuthToken,playDomain:u||this.playerData.playDomain,replayReset:!1},h)}else this.playerData.options.DASHPlugin=a({vid:o,dashOpts:c,playInfoType:"TOP",defaultFormat:"dash",definitionText:f,defaultDefinition:t,replayReset:!1},h)}},{key:"getMp4EncryptConfig",value:function(e){var t,i,n=e.playList,r=e.vid,o=this.config.playDomain,s=null==n||null===(t=n[0])||void 0===t?void 0:t.kid,c=null===(i=this.playerData.configs)||void 0===i?void 0:i.Mp4EncryptPlayer,u="object"===l(c)?c:{};if(this.isEncrypt){if(this.privateDrmAuthToken&&this.sessionId){var h=Yl(this.privateDrmAuthToken),d=parseInt(""+h["X-Expires"]),f=isNaN(d)?30:d;this.playerData.options.Mp4EncryptPlayer=a({vid:r,isEncrypt:!0,rangeMaxDuration:10,kid:s,drmKeyToken:this.privateDrmAuthToken,useUnionInfoDRM:this.useUnionInfoDRM,keyTokenExpiredDuration:f,sessionId:this.sessionId,playDomain:o||this.playerData.playDomain},u)}}else this.playerData.options.Mp4EncryptPlayer=a({vid:r},u)}},{key:"getDrmConfig",value:function(e){var t=this.config,i=t.thirdPartyDrmAuthToken,n=t.serverCertificatePath;if(i)try{var r,o,s,c,u=e.vid,h=e.playList,d=null==h?void 0:h[0],f=d.kid,g=d.codec;if(!f||!u)return void Ul.warn("get kid or vid fail");var v,y=null===(r=this.playerData.configs)||void 0===r?void 0:r.drm,m="object"===l(y)?y:{},_=this.config.playDomain||this.playerData.playDomain,b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GetPlayInfoToken",i=Wl(window.atob(e));return i?i[t]:""}(this.config.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken"),k=a((p(s={ignoreLicenseHeader:!1,unRecord:null===(o=this.config.unRecord)||void 0===o||o,contentType:yn[g],initDataType:"cenc"},Al.FAIRPLAY,{serverProcessSPCPath:tc(Al.FAIRPLAY,f,_,b),serverCertificatePath:n}),p(s,Al.WIDEVINE,{serverProcessSPCPath:tc(Al.WIDEVINE,f,_,b)}),p(s,Al.PLAYREADY,{serverProcessSPCPath:tc(Al.PLAYREADY,f,_,b)}),s),m);null!==(c=this.sdk)&&void 0!==c&&null!==(c=c.player)&&void 0!==c&&null!==(c=c.plugins)&&void 0!==c&&c.drm&&(null===(v=this.sdk)||void 0===v||null===(v=v.player)||void 0===v||null===(v=v.plugins)||void 0===v||v.drm.updateConfig(k)),this.playerData.options.drm=k}catch(e){Ul.error("generate drm config error:",e)}else this.playerData.options.drm={initDataType:"cenc"}}},{key:"init",value:function(){var e=this.playerData.configs.getVideoByToken,t=void 0===e?{}:e;this.initConfig(t)}},{key:"initConfig",value:function(e){if(this.isPlayByToken=!!e.playAuthToken,this.isPlayByToken){if(this.config=Object.assign({},cV,e),this.tokenInfo=Kl(e.playAuthToken),e.keyToken){var t=(i=e.ke
1yToken,/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(i)?window.atob(e.keyToken):e.keyToken);this.keyTokenInfo=Yl(t)}e.thirdPartyDrmAuthToken&&(this.thirdPartyDrmAuthTokenInfo=Kl(e.thirdPartyDrmAuthToken,"GetThirdPartyDrmAuthToken")),e.retryCount&&(this.retryCount=e.retryCount)}var i}},{key:"updateAuthToken",value:(t=u(s().mark((function e(t,i){var n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object.assign({},this.config,t),this.initConfig(n),e.next=4,this.getVideoInfo();case 4:(r=e.sent)&&(i?this.playerData.initPlayData(r):(this.playerData.updateConfigs(a(a({},r),{},{defaultDefinition:this.playerData.current.definition})),this.playerData.updatePlayList(),this.playerData.updateCheckExpireData()));case 6:case"end":return e.stop()}}),e,this)}))),function(e,i){return t.apply(this,arguments)})},{key:"checkPlayAuthTokenValid",value:function(){if(Xl(this.tokenInfo)){var e,t;Ul.error("playAuthToken is expired, please check or update your playAuthToken"),null===(e=this.sdk)||void 0===e||e.delayEvents.push({name:DM.TOKEN_EXPIRED,payload:{type:"playAuthToken",token:this.tokenInfo}});var i={errorType:"token",errorCode:9101,errorMessage:"playAuthToken has expired",ext:{token:this.tokenInfo,
1config:this.config},originError:void 0};return null===(t=this.sdk)||void 0===t||t.delayError.push(i),!0}return!1}},{key:"checkKeyTokenValid",value:function(){if(Xl(this.keyTokenInfo)){var e,t;Ul.error("keyToken is expired, please check or update your keyToken"),null===(e=this.sdk)||void 0===e||e.delayEvents.push({name:DM.TOKEN_EXPIRED,payload:{type:"keyToken",token:this.keyTokenInfo}});var i={errorType:"token",errorCode:9102,errorMessage:"keyToken for hls encrypt play has expired",ext:{token:this.keyTokenInfo,config:this.config},originError:void 0};return null===(t=this.sdk)||void 0===t||t.delayError.push(i),!0}return!1}},{key:"checkDrmAuthTokenValid",value:function(){if(Xl(this.thirdPartyDrmAuthTokenInfo)){var e,t;Ul.error("thirdPartyDrmAuthToken is expired, please check or update your thirdPartyDrmAuthToken"),null===(e=this.sdk)||void 0===e||e.delayEvents.push({name:DM.TOKEN_EXPIRED,payload:{type:"thirdPartyDrmAuthToken",token:this.thirdPartyDrmAuthTokenInfo}});var i={errorType:"token",errorCode:9103,errorMessage:"thirdPartyDrmAuthToken for DRM has expired",ext:{token:this.thirdPartyDrmAuthTokenInfo,config:this.config},originError:void 0};return null===(t=this.sdk)||void 0===t||t.delayError.push(i),!0}return!1}}],[{key:"pluginName",get:function(){return"AuthToken"}}]),d}(lV),hV=function(e){g(r,e);var t,i,n=k(r);function r(e){return h(this,r),n.call(this,e)}return f(r,[{key:"beforePlayerCreate",value:(i=u(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.prepareAbrModule();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"prepareAbrModule",value:(t=u(s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null===(t=this.sdk.playerData)||void 0===t||null===(t=t.adapter)||void 0===t?void 0:t.prepareAbrModule(this.playerData,this.sdk.sdkUmdLoader));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"adaptAbrOptions",value:function(){var e,t=null===(e=this.playerData.configs)||void 0===e?void 0:e.autoBitrateOpts;if(t){var i=this.playerData.defaultDefinition;return a(a(a({},r.defaultConfig),t),{},{autoDefiText:t.autoDefinitionText||"",isOpenAutoDefi:this.playerData.isOpenABR(),isPlayAutoDefi:this.playerData.isPlayAutoDefinition(i)})}}},{key:"applyAbrConfig",value:function(e){var t,i=this.adaptAbrOptions();i&&(null===(t=this.sdk.playerData)||void 0===t||null===(t=t.adapter)||void 0===t||t.applyAbrPluginConfig(e,i))}}],[{key:"pluginName",get:function(){return"Abr"}},{key:"defaultConfig",get:function(){return{autoDefiText:"",isOpenAutoDefi:!1,interval:1e3,hurryThreshold:.25,lowThreshold:.4,highThreshold:.7,noStallCheckTime:5,isOpenHint:!1,method:31}}}]),r}(lV),dV=function(e){g(i,e);var t=k(i);function i(e){return h(this,i),t.call(this,e)}return f(i,[{key:"adaptRangeOptions",value:function(){var e,t,i,n,r,o,s,l,c=null!==(e=null===(t=this.playerData.configs)||void 0===t?void 0:t.adaptRange)&&void 0!==e?e:void 0;if(null!=c&&c.enable&&null!==(i=this.playerData.adapter)&&void 0!==i&&null!==(n=i.canAdaptRangeEnable)&&void 0!==n&&n.call(i)){var u=this.playerData.adapter.adaptRangeDefaultOptions();return a(a(a({},null!=u?u:{}),c),{},{minTargetCacheDur:null!==(r=c.minCacheDuration)&&void 0!==r?r:null==u?void 0:u.minTargetCacheDur,maxTargetCacheDur:null!==(o=c.maxCacheDuration)&&void 0!==o?o:null==u?void 0:u.maxTargetCacheDur,rangeMinDuration:null!==(s=c.minRangeDuration)&&void 0!==s?s:null==u?void 0:u.rangeMinDuration,rangeMaxDuration:null!==(l=c.maxRangeDuration)&&void 0!==l?l:null==u?void 0:u.rangeMaxDuration})}}},{key:"applyRangeConfig",value:function(e){var t=this.adaptRangeOptions();t&&e&&this.playerData.adapter.applyAdaptRangePluginConfig(e,t)}}],[{key:"pluginName",get:function(){return"AdaptRange"}}]),i}(lV),fV=function(){function e(){h(this,e),this.umdMap=mA,this.backupUmdUrlMap={},this.region="cn",this.customPluginPublicPath=""}return f(e,[{key:"pluginPublicPath",get:function(){var e;return this.customPluginPublicPath||(null===(e=kc(this.region))||void 0===e?void 0:e.__UMD_PRE_PATH__)}},{key:"updateBackupMap",value:function(e){this.backupUmdUrlMap=e}},{key:"loadExtraCdn",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(i,n){var r=t?document.createElement("script"):document.createElement("link");t?r.src=e:(r.rel="stylesheet",r.type="text/css",r.href=e),document.body.appendChild(r),r.onerror=function(){n("url: ".concat(e))},r.onload=r.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(r.onload=r.onreadystatechange=null,i())}}))}},{key:"loadPlugins",value:function(t,i){var n=this;return new Promise((function(r){var o="".concat(n.pluginPublicPath,"_").concat(t,"_load");if(Reflect.get(e.jsLoadMap,o))r(e.jsLoadMap[o]);else{var a,s=n.umdMap[t];if((null===(a=n.importedPlugins)||void 0===a?void 0:a.length)>0&&s.pluginName){var l=n.importedPlugins.find((function(e){return e.pluginName===s.pluginName}));if(l)return r(l)}var c=function(e){n.failCallback&&"function"==typeof n.failCallback&&n.failCallback&&n.failCallback(t,e),r(null)};if(!s)return Ul.error("".concat(t," umd info not exit")),c(void 0);var u=s.name;if(s.devPath,u&&window[u])return e.jsLoadMap[o]=window[u],i&&i(),r(e.jsLoadMap[o]);var h=n.pluginPublicPath+"/"+t+".js",d=e.jsLoadPromiseMap[o];Ul.log("umdLoader cache hit ".concat(o,"=").concat(!!d)),d||(d=vc((function(){return n.loadExtraCdn(h,!0)}),2),e.jsLoadPromiseMap[o]=d),d.then((function(){u?(e.jsLoadMap[o]=window[u],i&&i(),r(window[u])):(e.jsLoadMap[o]=!0,i&&i(),r(null))})).catch((function(a){var s,l=n.backupUmdUrlMap[t];return l?(s=l)&&s.indexOf&&/^(?:http|data:|\/)/.test(s)?void n.loadExtraCdn(n.backupUmdUrlMap[t]).then((function(){e.jsLoadMap[o]=window[u],i&&i(),r(e.jsLoadMap[o])})).catch((function(e){Ul.error("load ".concat(t," error, ").concat(e)),c(void 0)})):(Ul.error("umdMap.".concat(t," isn't a valid url")),c(void 0)):(Ul.error("load ".concat(t," error, ").concat(a)),c(a))}))}}))}}]),e}(),pV=fV;pV.jsLoadMap={},pV.jsLoadPromiseMap={};var gV=function(e){return e.H265="h265",e.PRELOAD="preload",e.ADAPT_RANGE="adaptRange",e}(gV||{}),vV=function(){function e(){h(this,e),this.preloaderStatus=1,this.status=0,this.preloadCacheConfig={},this.preloadCacheList=[],this.initUmdLoader()}var t,i,n,r,o,l,c,d;return f(e,[{key:"initUmdLoader",value:function(){this.sdkUmdLoader=new pV}},{key:"fetchWebId",value:(d=u(s().mark((function e(){var t,i,n=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=this.config)||void 0===t||!t.deviceId){e.next=2;break}return e.abrupt("return",Promise.resolve(null===(i=this.config)||void 0===i?void 0:i.deviceId));case 2:return e.abrupt("return",new Promise((function(e){var t;return null!==(t=n.tea)&&void 0!==t&&t.getToken?n.tea.getToken((function(t){return e(null==t?void 0:t.web_id)})):e("default_web_id")})).then((function(e){return n.config=a(a({},n.config),{},{deviceId:e}),n.webId})));case 3:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"initTea",value:function(){this.tea=new Ch("".concat(e.TEA_ID,"_vestrategy_tracker")),this.tea.init({app_id:e.TEA_ID,channel:"cn"}),this.tea.start()}},{key:"fetchVeStrategy",value:(c=u(s().mark((function e(){var t=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.config.Module){e.next=2;break}return e.abrupt("return");case 2:return e.abrupt("return",this.sdkUmdLoader.loadPlugins(vA.VeStrategy).then((function(e){e&&(t.config=a(a({},t.config),{},{Module:e}))})));case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"fetchStrategies",value:(l=u(s().mark((function t(){var i,n=this;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={},t.next=3,Promise.all(Object.keys(this.config.strategies).map(function(){var t=u(s().mark((function t(r){var o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.config.strategies[r]){t.next=2;break}return t.abrupt("return");case 2:if(!0===n.config.strategies[r]&&(n.config.strategies[r]={}),!n.config.strategies[r].Strategy){t.next=8;break}i[r]=n.config.strategies[r],t.next=12;break;case 8:return t.next=10,n.sdkUmdLoader.loadPlugins(e.mapStrategyNameToUmdKey(r));case 10:(o=t.sent)&&(i[r]=a(a({},n.config.strategies[r]),{},{Strategy:o}));case 12:i[r]=Ec(i[r]);case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:return this.config.strategies=i,t.abrupt("return",i);case 5:case"end":return t.stop()}}),t,this)}))),function(){return l.apply(this,arguments)})},{key:"initOnce",value:(o=u(s().mark((function e(t){var i,n,r,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.appId){e.next=2;break}return e.abrupt("return");case 2:return this.initTea(),this.status=1,this.config=t,e.prev=5,e.next=8,Promise.all([this.fetchWebId(),this.fetchVeStrategy()]);case 8:return e.next=10,this.fetchStrategies();case 10:e.next=14;break;case 12:e.prev=12,e.t0=e.catch(5);case 14:if(i=this.config,n=i.appId,r=i.deviceId,o=i.Module,!(n&&r&&o)){e.next=21;break}return e.next=18,o.bootstrap(a(a({},this.config),{},{strategies:this.config.strategies,tracker:{Collector:Ch,enableABVersion:!1},log:{logger:Ul}}));
1case 18:this.status=2,e.next=22;break;case 21:this.status=3;case 22:return e.abrupt("return",this.isReady());case 23:case"end":return e.stop()}}),e,this,[[5,12]])}))),function(e){return o.apply(this,arguments)})},{key:"init",value:(r=u(s().mark((function e(t){var i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.initPromise||(null!=t&&null!==(i=t.plugins)&&void 0!==i&&i.length&&(this.sdkUmdLoader.importedPlugins=null==t?void 0:t.plugins),this.initPromise=this.initOnce(t)),e.abrupt("return",this.initPromise);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"initPreloadService",value:(n=u(s().mark((function e(t){var i,n,r,o,l,c,h,d,f,p,g,v,y=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h=null==t||null===(i=t.strategies)||void 0===i?void 0:i.preload,d="boolean"==typeof h,h&&(d||null==h||!h.disabled)){e.next=5;break}return this.preloaderStatus=0,e.abrupt("return",!1);case 5:if(f=null===(n=Ec(h))||void 0===n?void 0:n.config,null!=(p=null===(r=this.config)||void 0===r||null===(r=r.strategies)||void 0===r||null===(r=r.preload)||void 0===r||null===(r=r.Strategy)||void 0===r?void 0:r.preloader)&&p.register){e.next=10;break}return this.preloaderStatus=3,e.abrupt("return",!1);case 10:return e.next=12,this.getStrategyRecommendationsAsync();case 12:if(null!=(g=e.sent)&&null!==(o=g.result)&&void 0!==o&&null!==(o=o.preload)&&void 0!==o&&o.enable){e.next=16;break}return this.preloaderStatus=0,e.abrupt("return");case 16:return p.init(u(s().mark((function e(){var t,i,n,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ul.log("preloader init"),e.next=3,Promise.all([y.sdkUmdLoader.loadPlugins(vA.Preloader),y.sdkUmdLoader.loadPlugins(vA.MP4Encrypt)]);case 3:if(t=e.sent,i=T(t,2),n=i[0],r=i[1],null!=n&&n.PreloaderManager&&r){e.next=11;break}return y.preloaderStatus=3,Ul.error("preloader init error"),e.abrupt("return");case 11:return e.abrupt("return",a(a({},f),{},{PreloaderModule:n.PreloaderManager,loaders:[null==r?void 0:r.Mp4Preloader].filter((function(e){return!!e})),playPlugins:[r]}));case 12:case"end":return e.stop()}}),e)})))),e.next=19,p.prepare();case 19:if(v=e.sent){e.next=24;break}return this.preloaderStatus=3,Ul.log("preloader prepare fail",v),e.abrupt("return");case 24:this.preloaderStatus=2,null===(l=p.inst)||void 0===l||null===(l=l.call(p))||void 0===l||null===(c=l.on)||void 0===c||c.call(l,"prf_data_size",(function(e){var t,i;null===(t=y.tea)||void 0===t||null===(i=t.event)||void 0===i||i.call(t,"veplayer_preload_prf_data_size",a({},e))})),this.preloader=p,this.initPreloaderConfig();case 28:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"addPreloadList",value:function(e){if(1===this.preloaderStatus)return this.preloadCacheList=this.preloadCacheList.concat(null!=e?e:[]),void Ul.log("preloader add preload cache list",e);2!==this.preloaderStatus?this.preloadCacheList=[]:this.preloader.addPreloadList(e)}},{key:"setPreloadList",value:(i=u(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1!==this.preloaderStatus){e.next=4;break}return this.preloadCacheList=null!=t?t:[],Ul.log("preloader set preload cache list",t),e.abrupt("return");case 4:if(2!==this.preloaderStatus){e.next=7;break}return this.preloader.setPreloadList(null!=t?t:[]),e.abrupt("return");case 7:this.preloadCacheList=[];case 8:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"setPreloadScene",value:function(e,t){if([1,0].includes(e))return 1===this.preloaderStatus?(this.preloadCacheScene!==e&&(this.preloadCacheList=[],Ul.log("preloader reset preload cache list")),this.preloadCacheScene=e,this.preloadCacheConfig=a(a({},this.preloadCacheConfig),null!=t?t:{}),void Ul.log("preloader set preload cache config",this.preloadCacheScene,this.preloadCacheConfig)):void(2!==this.preloaderStatus||this.preloader.setPreloadScene(e,t))}},{key:"prepare",value:function(){return this.initPromise||Promise.resolve(this.isReady())}},{key:"getDeviceId",value:function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId}},{key:"isReady",value:function(){return 2===this.status}},{key:"getStrategyRecommendations",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!this.isReady())return{plugins:[],pluginConfiguration:{}};var i=this.config.Module.rec(e,t)||{};return Ul.log("strategy recommendations:",i),i}},{key:"getStrategyRecommendationsAsync",value:(t=u(s().mark((function e(){var t,i,n,r=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]?r[0]:void 0,i=r.length>
11&&void 0!==r[1]?r[1]:void 0,this.isReady()){e.next=4;break}return e.abrupt("return",{plugins:[],pluginConfiguration:{}});case 4:return e.next=6,this.config.Module.recAsync(t,i);case 6:return n=e.sent,Ul.log("strategy recommendations:",n),e.abrupt("return",n);case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"isHevcRecommended",value:function(){var e;return!(null===(e=this.getStrategyRecommendations().result)||void 0===e||null===(e=e.h265)||void 0===e||!e.enableH265Hardware)}},{key:"initPreloaderConfig",value:function(){var e,t,i,n;"undefined"!==this.preloadCacheScene&&this.preloader.setPreloadScene(this.preloadCacheScene,null!==(t=this.preloadCacheConfig)&&void 0!==t?t:{}),null!==(e=this.preloadCacheList)&&void 0!==e&&e.length&&(this.preloader.setPreloadList(this.preloadCacheList),null===(i=(n=this.preloader).checkPreloadData)||void 0===i||i.call(n),this.preloadCacheList=[])}}],[{key:"mapStrategyNameToUmdKey",value:function(e){switch(e){case"h265":return vA.VeStrategyH265;case"preload":return vA.VeStrategyPreload;case"adaptRange":return vA.VeStrategyAdaptRange;default:return null}}}]),e}(),yV=vV;yV.TEA_ID=null===(oV=kc())||void 0===oV?void 0:oV.__LOG_TEA_ID__;var mV=new yV,_V=function(e){g(i,e);var t=k(i);function i(){return h(this,i),t.apply(this,arguments)}return f(i,[{key:"applyFinalStrategy",value:function(e){if(mV.isReady()){var t,i,n=this.playerData.configs.duration||(null===(t=this.playerData.playList)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.duration)||-1,r=n>0&&n<=180?"svideo":n>180&&n<=1800?"mvideo":"lvideo",o={vtype:null===(i=this.playerData.adapter)||void 0===i?void 0:i.streamType,duration:n,videoLabel:r},a=mV.getStrategyRecommendations(void 0,o).result;Ul.log("VodLogCommon Final StrategyConfig:",a);var s,l=null==a?void 0:a[gV.ADAPT_RANGE];null!=l&&l.enable&&null!=l&&l.options&&(null===(s=this.playerData.adapter)||void 0===s||s.applyAdaptRangeStrategy(e,l.options))}}}],[{key:"pluginName",get:function(){return"Strategy"}}]),i}(lV),bV={init:function(e){var t;if(e){var i=e.playerData.sdkPlugins;null!==(t=e.playerData)&&void 0!==t&&t.isLive?e.sdkPlugins=E(i):e.sdkPlugins=[uV,hV,dV,_V].concat(E(i)),e._sdkPlugins={}}},registerPlugin:function(e,t){if(e&&t){var i=null,n=null;e.plugin&&"function"==typeof e.plugin?(i=e.plugin,n=e.options):(i=e,n={}),n.sdk=t;var r=n.pluginName||i.pluginName;if(!r)throw new Error("The property pluginName is necessary");var o=t._sdkPlugins;try{o[r.toLowerCase()]&&this.unRegister(r);var a=new i(n);return o[r.toLowerCase()]=a,o[r.toLowerCase()].func=i,a&&"function"==typeof a.afterCreate&&a.afterCreate(),a}catch(e){Ul.error(e)}}},unRegister:function(e,t){if(e&&t){e=e.toLowerCase();try{var i=t._sdkPlugins[e];i&&(i.pluginName&&i.__destroy(),delete t._sdkPlugins[e])}catch(e){Ul.error(e)}}},beforePlayerCreate:function(e){if(e){e._sdkPlugins||this.init(e);for(var t=e._sdkPlugins,i=[],n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];if(t[o]&&t[o].beforePlayerCreate)try{var a=t[o].beforePlayerCreate();i.push(dc(a))}catch(e){throw i.push(dc(null)),e}}return new Promise((function(e){Promise.all([].concat(i)).then((function(){e(null)})).catch((function(t){Ul.error(t),e(null)}))}))}},afterPlayerCreate:function(e){if(e)for(var t=e._sdkPlugins,i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];if(t[r]&&t[r].beforePlayerCreate)try{t[r].afterPlayerCreate()}catch(e){throw e}}},destroy:function(e){if(e){for(var t=e._sdkPlugins,i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];this.unRegister(r,e)}delete e._sdkPlugins}}},kV=function(){function e(t,i){h(this,e),this.url=t;var n=new window.XMLHttpRequest;n.target=this,n.responseType="arraybuffer",n.open("get",t),n.onload=function(){200!==n.status&&206!==n.status||i&&i instanceof Function&&i(n.response)},n.onerror=function(e){},this.xhr=n,this.run()}return f(e,[{key:"cancel",value:function(){this.xhr.abort()}},{key:"run",value:function(){1===this.xhr.readyState&&this.xhr.send()}}]),e}(),wV={ORDER:"order",SLOOP:"sloop",LOOP:"loop",RANDOM:"random"},SV="xgplayer-music";function TV(e,t,i){var n=Math.floor(Math.random()*(t-e)+e);return n===i?(n>t/2?t/=2:e=t/2,t-e>2?TV(e,t,i):n):n}var EV=function(e){g(i,e);var t=k(i);function i(){var e;return h(this,i),(e=t.apply(this,arguments))._onEnded=function(){if("order"===e.mode&&e.index+1>=e.list.length)return e.player.pause(),void(e.player.currentTime=0);e.mode===wV.SLOOP?e.change():e.next()},e._onDurationChange=function(){var t=e.config.abCycle;e._initABCycle(t,e.player)},e._onTimeUpdate=function(){var t=_(e),i=t.config,n=t.player;if(!e.halfPass&&n.currentTime>n.duration/2&&e.confirmOrder(),i.abCycle){var r=i.abCycle,o=r.end>n.duration?n.duration:r.end;n.currentTime>=o?(r.loop||(n.pause(),e.emit("abCycle_ended")),n.currentTime=r.start||0
1):n.currentTime<r.start&&(n.currentTime=r.start||0)}},e}return f(i,[{key:"afterCreate",value:function(){var e,t,i,n,r,o,a=this.player,s=this.playerConfig;qn.addClass(a.root,SV),this.halfPass=!1,this.list=this.config.list||[],this.emit(PM.MUSIC_LIST_CHANGE,this.list),this.nextIndex=-1,this.prevIndex=-1,this.history=[],this.disable=!(this.list.length>0),!s.url&&this.list.length>0&&(s.url=null===(e=this.list)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.src),s.poster||(s.poster=null===(t=this.list)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.poster),s.title||(s.title=null!==(i=null===(n=this.list)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.title)&&void 0!==i?i:""),s.vid||(s.vid=null!==(r=null===(o=this.list)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.vid)&&void 0!==r?r:""),this._curInfo={src:s.url,poster:s.poster,title:s.title,vid:s.vid},this.index=0,this.on(pr,this._onTimeUpdate),this.on(cr,this._onEnded),this.on(yr,this._onDurationChange),this.config.offline&&this.checkOffline(this._curInfo.src,this._curInfo.vid).then((function(e){0===e.code&&(s.url=e.url,a.state>=4&&(a.src=e.url))})).catch((function(e){Ul.error(e)}))}},{key:"destroy",value:function(){qn.removeClass(this.player.root,SV)}},{key:"_nextCompute",value:function(){if(!this.disable)switch(this.mode){case wV.SLOOP:this.nextIndex=this.index;break;case wV.ORDER:case wV.LOOP:this.index+1<this.list.length?this.nextIndex=this.index+1:this.nextIndex=0;break;default:this.nextIndex=TV(0,this.list.length,this.index)}}},{key:"_prevCompute",value:function(){if(!this.disable)switch(this.mode){case wV.SLOOP:this.nextIndex=this.index;break;case wV.ORDER:case wV.LOOP:this.index-1>=0?this.prevIndex=this.index-1:this.prevIndex=this.list.length-1;break;default:this.prevIndex=TV(0,this.list.length,this.index)}}},{key:"_emitChange",value:function(){this.emit(PM.MUSIC_CHANGE,this._curInfo)}},{key:"_initABCycle",value:function(e,t){var i=t.plugins.progresspreview;if(e&&t){var n=e.end>this.player.duration?this.player.duration:e.end,r=e.start>this.player.duration?0:e.start,o={id:t.playerId,time:e.start,duration:n-r,text:e.text,color:e.color};i.findDot(o.id)?i.updateDot(o):i.createDot(o)}else i.findDot(t.playerId)&&i.deleteDot(t.playerId)}},{key:"random",value:function(){if(this.list.length<0)return null;var e=TV(0,this.list.length,this.index);return this.list[e]}},{key:"next",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._nextCompute()),this.index=this.nextIndex,this.change())}},{key:"prev",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._prevCompute()),this.index=this.prevIndex,this.change())}},{key:"forward",value:function(){var e=this.player,t=this.config.timeScale;e.currentTime=e.currentTime+t<e.duration?e.currentTime+t:e.duration-.1}},{key:"backward",value:function(){var e=this.player,t=this.config.timeScale;e.currentTime=e.currentTime-t>0?e.currentTime-t:0}},{key:"add",value:function(e){this.list.push({src:e.src,title:e.title,vid:e.vid,poster:e.poster}),this.disable=!(this.list.length>0),this.emit(PM.MUSIC_LIST_CHANGE,this.list)}},{key:"remove",value:function(e){var t=-1;this.list.every((function(i,n){return i.vid!==e||(t=n,!1)})),t>-1&&(this.list.splice(t,1),this.emit(PM.MUSIC_LIST_CHANGE,this.list)),this.disable=!(this.list.length>0)}},{key:"setAbCycle",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e&&"Object"===qn.typeOf(e)?this.config.abCycle=a({},e):this.config.abCycle=a({start:e||0,end:t||this.player.duration,loop:i},n),this._initABCycle(this.config.abCycle,this.player)}},{key:"removeAbCycle",value:function(){this.config.abCycle=null,this._initABCycle(null,this.player)}},{key:"updateList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.removeAbCycle(),this.player.pause(),this.player.currentTime=0,this.list=e,this.nextIndex=0,this.index=0,this.change(),this.disable=!(this.list.length>0),this.emit(PM.MUSIC_LIST_CHANGE,this.list)}},{key:"setIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;e<0||e>=this.list.length||(this.nextIndex=e,this.index=e,this.change())}},{key:"change",value:function(){var e=this;if(!this.disable){var t=this.player,i=this.list,n=this.index,r=i[n].vid;this.halfPass=!1,this.checkOffline(i[n].src,r).then((function(i){e._curInfo={title:e.list[e.index].title||"",vid:e.list[e.index].vid,poster:e.list[e.index].poster||"",src:i.url},t.playNext({url:i.url,vid:e.list[e.index].vid||0,poster:e.list[e.index].poster||"",autoplay:!0}),t.off("timeupdate",e._emitChange.bind(e)),t.once("timeupdate",e._emitChange.bind(e)),t.play()}))}}},{key:"checkOffline",value:function(e,t){var i=this;return new Promise((function(n,r){if(!i.config.offline||i.disable)return n({url:e,code:-1,vid:t});var o=i.player.database;o.openDB((function(){o.getDataByKey(o.myDB.ojstore.name,t,(function(i){setTimeout((function(){o.closeDB()}),5e3),n(i?{url:URL.createObjectURL(i.blob),code:0,vid:i.vid}:{url:e,code:-2,vid:t})}))}))}))}},{key:"confirmOrder",value:function(){this.halfPass=!0,this._nextCompute(),this._prevCompute(),this.config.preloadNext&&this.preload(this.nextIndex)}},{key:"preload",value:function(e){if(!(e<0||e>=this.list.length)){var t=this.list[e],i=this.player;this.checkOffline(t.src,t.vid).then((function(e){if(-2===e.code){var n=t.vid;new kV(t.src,(function(e){i.database.openDB((function(){i.database.addData(i.database.myDB.ojstore.name,[{vid:n,blob:new Blob([e],{type:'audio/mp4; codecs="mp4a.40.5"'})}]),setTimeout((function(){i.database.closeDB()}),5e3)}))}
1))}}))}}},{key:"timeScale",get:function(){return this.config.timeScale||15},set:function(e){this.config.timeScale=e,this.emit(PM.TIME_SCALE_CHANGE,e)}},{key:"mode",get:function(){return this.config.mode||wV.RANDOM},set:function(e){Object.values(wV).includes(e)&&(this.config.mode=e,this.emit(PM.MUSIC_MODE_CHANGE,e))}}],[{key:"pluginName",get:function(){return"music"}},{key:"defaultConfig",get:function(){return{offline:!1,preloadNext:!0,abCycle:null,timeScale:15,mode:wV.ORDER,list:[]}}},{key:"ModeType",get:function(){return Object.keys(wV).map((function(e){return wV[e]}))}}]),i}(Eo),CV=function(e){g(i,e);var t=k(i);function i(){return h(this,i),t.apply(this,arguments)}return f(i,[{key:"afterCreate",value:function(){var e=this;this.on(PM.MUSIC_CHANGE,(function(t){if(t&&t.poster){var i=e.find("img");i?i.src=t.poster:e.root.innerHTML="<img src=".concat(t.poster,' alt=""/>'),e.show()}else e.hide()}))}},{key:"render",value:function(){var e,t,i=this.playerConfig;return i.poster||null!=i&&null!==(e=i.url)&&void 0!==e&&e[0].poster?'<xg-icon class="xgplayer-cover">\n <img src="'.concat(i.poster||(null==i||null===(t=i.url)||void 0===t?void 0:t[0].poster),'" alt="">\n </xg-icon>'):'<xg-icon class="xgplayer-cover"></xg-icon>'}}],[{key:"pluginName",get:function(){return"musiccover"}},{key:"defaultConfig",get:function(){return{index:0,position:Bo.POSITIONS.CONTROLS_LEFT}}}]),i}(Bo);function xV(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.2478 0C6.32662 0 2.94593 2.3143 1.39715 5.65152L0.558008 5.42701C0.321533 5.36365 0.0784664 5.50398 0.0151043 5.74046C-0.00971985 5.8331 -0.00382614 5.9313 0.0319023 6.02031L1.13271 8.76283C1.22391 8.99003 1.48202 9.10028 1.70921 9.00908C1.74819 8.99344 1.78475 8.97233 1.81779 8.94639L4.14238 7.12171C4.33496 6.97055 4.36853 6.69189 4.21737 6.49932C4.15815 6.42387 4.07605 6.36967 3.98341 6.34485L3.14176 6.1196C4.46348 3.53919 7.14942 1.77312 10.2478 1.77312C14.6545 1.77312 18.2269 5.34545 18.2269 9.75215C18.2269 14.1589 14.6545 17.7312 10.2478 17.7312C6.45067 17.7312 3.273 15.0787 2.4666 11.5256L0.656528 11.5254C1.49041 16.0647 5.46745 19.5043 10.2478 19.5043C15.6338 19.5043 20 15.1381 20 9.75215C20 4.36619 15.6338 0 10.2478 0Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var DV=function(e){g(i,e);var t=k(i);function i(){var e;return h(this,i),(e=t.apply(this,arguments)).onClick=function(t){var i=_(e).player;t.preventDefault(),t.stopPropagation(),i.plugins.music.backward()},e}return f(i,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.timeScaleDom=this.find(".xgplayer-timescale"),this.on(PM.TIME_SCALE_CHANGE,(function(t){e.timeScaleDom.innerHTML=t}))}},{key:"registerIcons",value:function(){return{musicBackward:{icon:xV,class:"xg-icon-mbackward"}}}},{key:"registerLanguageTexts",value:function(){return{backward:{jp:"ãã¨ããããã",en:"MusicBackward",zh:"åé","zh-hk":"å¾é"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicBackward)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){var e=this.player.plugins.music.config.timeScale||15;return'<xg-icon class="xgplayer-backward">\n <div class="xgplayer-icon">\n <span class="xgplayer-timescale">'.concat(e,'</span>\n </div>\n <div class="xg-tips" lang-key="backward">').concat(this.langText.backward,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicbackword"}},{key:"defaultConfig",get:function(){return{index:1,position:Bo.POSITIONS.CONTROLS_LEFT}}}]),i}(Bo),PV=function(e){g(i,e);var t=k(i);function i(){var e;return h(this,i),(e=t.apply(this,arguments)).onClick=function(t){var i=_(e).player;t.preventDefault(),t.stopPropagation(),i.plugins.music.prev()},e}return f(i,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.updateVisible(),this.on(PM.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}},{key:"updateVisible",value:function(){var e;(null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(e=e.list)||void 0===e?void 0:e.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{musicPrev:{icon:' <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_20323_25783)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 1.20196V22.798C21.2 23.7867 20.0711 24.3511 19.28 23.7579L4.88002 12.9598C4.24002 12.4799 4.24002 11.5201 4.88002 11.0402L19.28 0.242135C20.0711 -0.35107 21.2 0.213286 21.2 1.20196Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.8 0.00219727C4.13137 0.00219727 4.4 0.270826 4.4 0.602197V23.3978C4.4 23.7292 4.13137 23.9978 3.8 23.9978H2.6C2.26863 23.9978 2 23.7292 2 23.3978V0.602197C2 0.270826 2.26863 0.00219727 2.6 0.00219727H3.8Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_20323_25783">\n <rect width="24" height="24" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n ',class:"xg-icon-mprev"}}}},{key:"registerLanguageTexts",value:function(){return{musicPrev:{jp:"åã®æ²",en:"MusicPrev",zh:"ä¸ä¸é¦","zh-hk":"ä¸ä¸é¦"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicPrev)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){return'<xg-icon class="xgplayer-next">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="musicPrev">'.concat(this.langText.musicPrev,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicprev"}},{key:"defaultConfig",get:function(){return{index:2,position:Bo.POSITIONS.CONTROLS_LEFT}}}]),i}(Bo);function OV(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.75215 0C13.6734 0 17.0541 2.3143 18.6029 5.65152L19.442 5.42701C19.6785 5.36365 19.9215 5.50398 19.9849 5.74046C20.0097 5.8331 20.0038 5.9313 19.9681 6.02031L18.8673 8.76283C18.7761 8.99003 18.518 9.10028 18.2908 9.00908C18.2518 8.99344 18.2152 8.97233 18.1822 8.94639L15.8576 7.12171C15.665 6.97055 15.6315 6.69189 15.7826 6.49932C15.8419 6.42387 15.9239 6.36967 16.0166 6.34485L16.8582 6.1196C15.5365 3.53919 12.8506 1.77312 9.75215 1.77312C5.34545 1.77312 1.77312 5.34545 1.77312 9.75215C1.77312 14.1589 5.34545 17.7312 9.75215 17.7312C13.5493 17.7312 16.727 15.0787 17.5334 11.5256L19.3435 11.5254C18.5096 16.0647 14.5325 19.5043 9.75215 19.5043C4.36619 19.5043 0 15.1381 0 9.75215C0 4.36619 4.36619
10 9.75215 0Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var IV=function(e){g(i,e);var t=k(i);function i(){var e;return h(this,i),(e=t.apply(this,arguments)).onClick=function(t){var i=_(e).player;t.preventDefault(),t.stopPropagation(),i.plugins.music.forward()},e}return f(i,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.timeScaleDom=this.find(".xgplayer-timescale"),this.on(PM.TIME_SCALE_CHANGE,(function(t){e.timeScaleDom.innerHTML=t}))}},{key:"registerIcons",value:function(){return{musicForward:{icon:OV,class:"xg-icon-mforward"}}}},{key:"registerLanguageTexts",value:function(){return{forward:{jp:"æ©éã",en:"MusicForward",zh:"å¿«è¿","zh-hk":"å¿«é²"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicForward)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){var e=this.player.plugins.music.config.timeScale||15;return'<xg-icon class="xgplayer-forward">\n <div class="xgplayer-icon">\n <span class="xgplayer-timescale">'.concat(e,'</span>\n </div>\n <div class="xg-tips" lang-key="forward">').concat(this.langText.forward,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicforward"}},{key:"defaultConfig",get:function(){return{index:5,position:Bo.POSITIONS.CONTROLS_LEFT}}}]),i}(Bo),LV=function(e){g(i,e);var t=k(i);function i(){var e;return h(this,i),(e=t.apply(this,arguments)).onClick=function(t){var i=_(e).player;t.preventDefault(),t.stopPropagation(),i.plugins.music.next()},e}return f(i,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),["click","touchstart"].forEach((function(t){e.bind(t,e.onClick)})),this.updateVisible(),this.on(PM.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}},{key:"updateVisible",value:function(){var e;(null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(e=e.list)||void 0===e?void 0:e.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{musicNext:{icon:' <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_20323_25776)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.92 0.242135L18.32 11.0402C18.96 11.5201 18.96 12.4799 18.32 12.9598L3.92 23.7579C3.12892 24.3511 2 23.7867 2 22.798V1.20196C2 0.213286 3.12892 -0.35107 3.92 0.242135Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M20.6 0.00219727C20.9314 0.00219727 21.2 0.270826 21.2 0.602197V23.3978C21.2 23.7292 20.9314 23.9978 20.6 23.9978H19.4C19.0687 23.9978 18.8 23.7292 18.8 23.3978V0.602197C18.8 0.270826 19.0687 0.00219727 19.4 0.00219727H20.6Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_20323_25776">\n <rect width="24" height="24" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n ',class:"xg-icon-mnext"}}}},{key:"registerLanguageTexts",value:function(){return{musicNext:{jp:"æ¬¡ã®æ²",en:"MusicNext",zh:"ä¸ä¸é¦","zh-hk":"ä¸ä¸é¦"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.musicNext)}},{key:"destroy",value:function(){var e=this;["click","touchstart"].forEach((function(t){e.unbind(t,e.onClick)}))}},{key:"render",value:function(){return'<xg-icon class="xgplayer-next">\n <div class="xgplayer-icon"></div>\n <div class="xg-tips" lang-key="musicNext">'.concat(this.langText.musicNext,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"musicnext"}},{key:"defaultConfig",get:function(){return{index:4,position:Bo.POSITIONS.CONTROLS_LEFT}}}]),i}(Bo),AV=function(e){g(i,e);var t=k(i);function i(){return h(this,i),t.apply(this,arguments)}return f(i,[{key:"afterCreate",value:function(){var e=this;this.on(PM.MUSIC_CHANGE,(function(t){t&&t.title?e.root.innerHTML="".concat(t.title):e.root.innerHTML=""}))}},{key:"render",value:function(){var e=this.playerConfig;return'<xg-title class="xgplayer-name">\n '.concat(e.title||"","\n </xg-title>")}}],[{key:"pluginName",get:function(){return"musicmeta"}},{key:"defaultConfig",get:function(){return{index:0,position:Bo.POSITIONS.CONTROLS_LEFT}}}]),i}(Bo);function RV(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20779_14791)">
1\n<path fill-rule="evenodd" clip-rule="evenodd" d="M39 8C39.5523 8 40 8.44772 40 9V11C40 11.5523 39.5523 12 39 12H7C6.44772 12 6 11.5523 6 11V9C6 8.44772 6.44772 8 7 8H39ZM30 23C30 22.4477 29.5523 22 29 22H7C6.44772 22 6 22.4477 6 23V25C6 25.5523 6.44772 26 7 26H29C29.5523 26 30 25.5523 30 25V23ZM46.0725 31C46.0725 31.2113 46.0056 31.4173 45.8812 31.5882L39.845 39.888C39.5202 40.3346 38.8948 40.4334 38.4481 40.1086C38.3635 40.047 38.2891 39.9726 38.2275 39.888L32.1913 31.5882C31.8665 31.1415 31.9652 30.5161 32.4119 30.1913C32.5828 30.067 32.7887 30 33 30H37V19.5C37 19.2239 37.2239 19 37.5 19H40.5C40.7761 19 41 19.2239 41 19.5V30H45.0725C45.6248 30 46.0725 30.4477 46.0725 31ZM29 36C29.5523 36 30 36.4477 30 37V39C30 39.5523 29.5523 40 29 40H7C6.44772 40 6 39.5523 6 39V37C6 36.4477 6.44772 36 7 36H29Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20779_14791">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function MV(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14771)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M42.0018 23V29.024C42.0018 34.569 37.5247 39.064 32.0018 39.064H17.9999V42.6585C17.9999 43.2108 17.5522 43.6585 16.9999 43.6585C16.7991 43.6585 16.603 43.598 16.437 43.485L8.20729 37.8803C7.75081 37.5694 7.63278 36.9473 7.94366 36.4908C8.01331 36.3886 8.10134 36.3001 8.20327 36.23L16.433 30.5662C16.888 30.2531 17.5106 30.3681 17.8237 30.8231C17.9385 30.9899 17.9999 31.1875 17.9999 31.39V35.048H32.0018C35.3155 35.048 38.0018 32.351 38.0018 29.024V23H42.0018ZM31.0019 5.89087C31.2027 5.89087 31.3988 5.95132 31.5648 6.06434L39.7945 11.6691C40.251 11.98 40.369 12.602 40.0582 13.0585C39.9885 13.1608 39.9005 13.2492 39.7986 13.3194L31.5688 18.9831C31.1139 19.2962 30.4912 19.1812 30.1781 18.7263C30.0633 18.5595 30.0019 18.3618 30.0019 18.1593V14.5013H16C12.6863 14.5013 10 17.1984 10 20.5254V26.5494H6V20.5254C6 14.9804 10.4772 10.4853 16 10.4853H30.0019V6.89087C30.0019 6.33858 30.4496 5.89087 31.0019 5.89087Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14771">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function NV(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14777)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M35.0194 27.9598C35.2314 27.9598 35.4379 28.0272 35.6091 28.1522L41.8863 32.736C42.3323 33.0617 42.4298 33.6873 42.1041 34.1333C42.0419 34.2186 41.9665 34.2934 41.8809 34.3551L35.6037 38.875C35.1556 39.1977 34.5306 39.096 34.2079 38.6478C34.0853 38.4776 34.0194 38.2732 34.0194 38.0635V35.5556C30.1354 35.5195 27.7656 34.3892 25.642 31.7548C26.4304 30.621 27.1705 29.3627 27.8834 27.9788C29.5719 30.6143 31.112 31.5275 34.0194 31.5546V28.9598C34.0194 28.4075 34.4671 27.9598 35.0194 27.9598ZM35.0112 7.94434C35.2205 7.94434 35.4246 8.01001 35.5946 8.13211L41.8792 12.6458C42.3278 12.968 42.4303 13.5928 42.1081 14.0414C42.0464 14.1273 41.9715 14.2028 41.8861 14.2652L35.6015 18.8607C35.1557 19.1867 34.53 19.0895 34.204 18.6437C34.0787 18.4724 34.0112 18.2657 34.0112 18.0535V15.4606C29.9521 15.4984 28.443 17.234 25.7897 23.0253C25.4916 23.6778 25.333 24.0244 25.1845 24.3452C21.6243 32.0396 17.983 35.4364 10.
10186 35.5591H6V31.5394L9.98762 31.5397C16.0421 31.4462 18.5555 29.1016 21.5376 22.6568C21.6818 22.3451 21.8361 22.0079 22.1364 21.3507C25.3774 14.2767 27.8951 11.4978 34.0112 11.4409V8.94434C34.0112 8.39205 34.4589 7.94434 35.0112 7.94434ZM10.0186 11.4409C14.8213 11.5149 18.0519 12.7794 20.6407 15.459C19.9655 16.6111 19.3108 17.8933 18.6522 19.3098C16.5567 16.6161 14.0817 15.5236 9.98762 15.4604L6 15.4606V11.4409H10.0186Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14777">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function BV(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20731_14784)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M42.0018 22.1091V28.1331C42.0018 33.6781 37.5247 38.1732 32.0018 38.1732H17.9999V41.7676C17.9999 42.3199 17.5522 42.7676 16.9999 42.7676C16.7991 42.7676 16.603 42.7072 16.437 42.5941L8.20729 36.9894C7.75081 36.6785 7.63278 36.0564 7.94366 35.6C8.01331 35.4977 8.10134 35.4092 8.20327 35.3391L16.433 29.6754C16.888 29.3623 17.5106 29.4773 17.8237 29.9322C17.9385 30.099 17.9999 30.2967 17.9999 30.4991V34.1572H32.0018C35.3155 34.1572 38.0018 31.4601 38.0018 28.1331V22.1091H42.0018ZM26.05 18V29.664H23.19V21.08L21 22.852V19.772L23.19 18H26.05ZM31.0019 5C31.2027 5 31.3988 5.06045 31.5648 5.17347L39.7945 10.7782C40.251 11.0891 40.369 11.7112 40.0582 12.1677C39.9885 12.2699 39.9005 12.3584 39.7986 12.4285L31.5688 18.0922C31.1139 18.4054 30.4912 18.2904 30.1781 17.8354C30.0633 17.6686 30.0019 17.4709 30.0019 17.2685V13.6105H16C12.6863 13.6105 10 16.3075 10 19.6345V25.6585H6V19.6345C6 14.0895 10.4772 9.59443 16 9.59443H30.0019V6C30.0019 5.44772 30.4496 5 31.0019 5Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_20731_14784">\n<rect width="48" height="48" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}var UV=function(e){g(i,e);var t=k(i);function i(){return h(this,i),t.apply(this,arguments)}return f(i,[{key:"afterCreate",value:function(){var e,t=this;if(S(v(i.prototype),"afterCreate",this).call(this),this.player.plugins.music&&!this.config.disable){this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on(PM.MUSIC_MODE_CHANGE,(function(e){t.animate(e)}));var n=null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(e=e.config)||void 0===e?void 0:e.mode;this.animate(n),this.updateVisible(),this.on(PM.MUSIC_LIST_CHANGE,this.updateVisible.bind(this))}}},{key:"updateVisible",value:function(){var e;(null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(e=e.list)||void 0===e?void 0:e.length)>1?this.show():this.hide()}},{key:"registerIcons",value:function(){return{order:{icon:RV,class:"xg-icon-order"},loop:{icon:MV,class:"xg-icon-loop"},sloop:{icon:BV,class:"xg-icon-sloop"},random:{icon:NV,class:"xg-icon-random"}}}},{key:"registerLanguageTexts",value:function(){return{order:{jp:"é çªã«éã¶",en:"Play in order",zh:"é¡ºåºææ¾","zh-hk":"é åºææ¾"},loop:{jp:"ãªã¹ãã«ã¼ã",en:"List loop",zh:"å表循ç¯","zh-hk":"å表循ç°"},sloop:{jp:"ã·ã³ã°ã«ãµã¤ã¯ã«",en:"Single loop",zh:"åæ²å¾ªç¯","zh-hk":"宿²å¾ªç°"},random:{jp:"ã·ã£ããã«åç",en:"Play in shuffle",zh:"éæºææ¾","zh-hk":"鍿©ææ¾"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.order),this.appendChild(".xgplayer-icon",e.sloop),this.appendChild(".xgplayer-icon",e.loop),this.appendChild(".xgplayer-icon",e.random)}},{key:"btnClick",value:function(e){var t;e.preventDefault(),e.stopPropagation();var i=null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||null===(t=t.config)||void 0===t?void 0:t.mode,n=EV.ModeType.findIndex((function(e){return e===i})),r=0;n+1<EV.ModeType.length&&(r=n+1),this.player.plugins.music.mode=EV.ModeType[r]}},{key:"animate",value:function(e){switch(e){case wV.ORDER:this.setAttr("data-state","order"),this.changeLangTextKey(this.find(".xg-tips"),"order");break;case wV.LOOP:this.setAttr("data-state","loop"),this.changeLangTextKey(this.find(".xg-tips"),"loop");break;case wV.SLOOP:this.setAttr("data-state","sloop"),this.changeLangTextKey(this.find(".xg-tips"),"sloop");break;case wV.RANDOM:this.setAttr("data-state","random"),this.changeLangTextKey(this.find(".xg-tips"),"random");break;default:this.setAttr("data-state","order"),this.changeLangTextKey(this.find(".xg-tips"),"order")}}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-music-mode">\n <div class="xgplayer-icon"></div>\n <div class="xg-tips" lang-key="musicMode">'.concat(this.langText.order,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"MusicMode"}},{key:"defaultConfig",get:function(){return{position:Bo.POSITIONS.CONTROLS_RIGHT,index:9,disable:!1}}}]),i}(Bo);function jV(){return(new DOMParser).parseFromString('<svg width="30" height="30" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20323_25753)">
1\n<g filter="url(#filter0_d_20323_25753)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M25 0C38.8071 0 50 11.1929 50 25C50 38.8071 38.8071 50 25 50C11.1929 50 0 38.8071 0 25C0 11.1929 11.1929 0 25 0Z" fill="#1664FF"/>\n</g>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M19.3863 11.7091L37.5681 23.0728C38.9924 23.9629 38.9924 26.0372 37.5681 26.9273L19.3863 38.2909C17.8726 39.237 15.9091 38.1488 15.9091 36.3637V13.6364C15.9091 11.8513 17.8726 10.763 19.3863 11.7091Z" fill="white"/>\n</g>\n<defs>\n<filter id="filter0_d_20323_25753" x="-8" y="-6" width="66" height="66" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="2"/>\n<feGaussianBlur stdDeviation="4"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_20323_25753"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_20323_25753" result="shape"/>\n</filter>\n<clipPath id="clip0_20323_25753">\n<rect width="50" height="50" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}function HV(){return(new DOMParser).parseFromString('<svg width="30" height="30" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_20330_26170)">\n<g filter="url(#filter0_d_20330_26170)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M25 0C38.8071 0 50 11.1929 50 25C50 38.8071 38.8071 50 25 50C11.1929 50 0 38.8071 0 25C0 11.1929 11.1929 0 25 0Z" fill="#1664FF"/>\n</g>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20.75 11C21.4404 11 22 11.6044 22 12.35V36.65C22 37.3956 21.4404 38 20.75 38H18.25C17.5596 38 17 37.3956 17 36.65V12.35C17 11.6044 17.5596 11 18.25 11H20.75Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M31.75 11C32.4404 11 33 11.6044 33 12.35V36.65C33 37.3956 32.4404 38 31.75 38H29.25C28.5596 38 28 37.3956 28 36.65V12.35C28 11.6044 28.5596 11 29.25 11H31.75Z" fill="white"/>\n</g>\n<defs>\n<filter id="filter0_d_20330_26170" x="-8" y="-6" width="66" height="66" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="2"/>\n<feGaussianBlur stdDeviation="4"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_20330_26170"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_20330_26170" result="shape"/>\n</filter>\n<clipPath id="clip0_20330_26170">\n<rect width="50" height="50" fill="white"/>\n</clipPath>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}var FV=f((function e(t,i){h(this,e),function(e){if("Object"!==qn.typeOf(e.controls))e.controls={mode:"flex",initShow:!0};else{var t=e.controls;e.controls=a({mode:"flex",initShow:!0},t)}var i=e.play||{};e.play=a({index:3},i),e.marginControls=!0,e.icons=a({play:jV,pause:HV},e.icons||{})}(i);var n="mobile"===ir.device;this.plugins=[EV,AV,CV].concat(E(n?[]:[DV,PV,IV,LV,UV])),this.ignores=["start","cssFullScreen","fullscreen","pip","enter","replay","pc","loading","poster","error","playbackrate","mobile"]})),VV=["plugins"];window&&!window.Player&&(window.Player=Tl);var zV=function(){function e(t){h(this,e),this.player=null,this.mountingDom=null,this.playerContainer=null,this.mobilePanel=null,this._isFirstCreated=!0,this.sdkPlugins=[],this._sdkPlugins={},this.delayError=[],this.vodLogCommon={},this.delayEvents=[],this._init(t)}var t,i,n,r,o,c,d,v;return f(e,[{key:"_init",value:function(e){this.playerData=Sn.observe(new xA(e,this)),this.adapter=this.playerData.adapter,this.initUmdLoader(e),this._emitter=new zn,this.on(DM.TOKEN_EXPIRED,this.onTokenExpiredAction.bind(this)),this.checkVodLogOptions(),this._initSdkPlugins(),this.renderDom(),this.createPlayer(),this._initI18N(this.playerData.languageData)}},{key:"_initSdkPlugins",value:function(){var e=this;bV.init(this),E(this.sdkPlugins).map((function(t){return bV.registerPlugin(t,e)}))}}
1,{key:"_initCheckExpire",value:function(){this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null);var e=this.playerData.urlCheckData,t=e.enableUrlExpireCheck,i=e.urlCheckExpireInterval;t&&(this.checkExpireTimer=new sc,this.checkExpireTimer.repeat(this._onRepeat.bind(this),i)),this.on(PM.MEDIA_EXPIRED,this._onMediaExpiredAction.bind(this))}},{key:"initUmdLoader",value:function(e){var t=this;this.sdkUmdLoader=new pV,this.sdkUmdLoader.failCallback=function(e,i){return t.umdLoadErr(e,i)},e.umdUrlMap&&"object"===l(e.umdUrlMap)&&this.sdkUmdLoader.updateBackupMap(e.umdUrlMap),this.sdkUmdLoader.region=this.playerData.region,e.pluginPublicPath&&"string"==typeof e.pluginPublicPath&&(this.sdkUmdLoader.customPluginPublicPath=e.pluginPublicPath),this.sdkUmdLoader.importedPlugins=e.plugins}},{key:"checkVodLogOptions",value:function(){var e=this.playerData,t=e.isLive,i=e.configs,n=fc(i,"vodLogOpts");t||i.disableVodLogOptsCheck||null!=n&&n.line_app_id||this.delayError.push({errorType:"log",errorCode:9999,errorMessage:"vod log options not configured or configured correctly",ext:{},originError:void 0})}},{key:"umdLoadErr",value:function(e,t){this.emit(DM.UMD_LOAD_FAIL,{name:e,error:t})}},{key:"_onRepeat",value:function(){var e=this.playerData.urlCheckData,t=e.urlExpireTimestamp,i=e.urlExpireDiff,n=void 0===i?60:i;Math.round((new Date).getTime()/1e3)>=t-n&&(this.playerData.urlCheckData.urlExpireTimestamp=Il,this._emitExpireEvent("time"))}},{key:"_emitExpireEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"error",t=arguments.length>1?arguments[1]:void 0,i=Math.round((new Date).getTime()/1e3),n={errorCode:-499897,errorType:"network",errorMessage:"url expire",url:this.playerData.getCurrentUrl(),httpCode:403,version:"1.9.6",ext:this,detectType:e,urlCheckData:this.playerData.urlCheckData,originError:t,from:"veplayer"};this.emitExpireTimestamp?i-this.emitExpireTimestamp>300&&(this.emitExpireTimestamp=i,Ul.warn("media is expired, ",n),this.emit(OM.MEDIA_EXPIRED,n)):(this.emitExpireTimestamp=i,Ul.warn("media is expired, ",n),this.emit(OM.MEDIA_EXPIRED,n))}},{key:"on",value:function(e,t){this._emitter.on(e,t)}},{key:"emit",value:function(e,t){this._emitter.emit(e,t)}},{key:"once",value:function(e,t){this._emitter.once(e,t)}},{key:"off",value:function(e,t){this._emitter.off(e,t)}},{key:"renderDom",value:function(){var e=this.playerData,t=e.id,i=e.root,n=document.createElement("div");this.playerContainer=n;var r=i||document.querySelector("#".concat(t));r&&(r.appendChild(n),this.mountingDom=r)}},{key:"renderPoster",value:function(){if(this.playerContainer){var e=this.playerData.options,t=e.poster,i=void 0===t?"":t,n=e.width,r=e.height;("string"==typeof i?i:null==i?void 0:i.poster)&&(this.playerContainer.style.cssText='background: url("'.concat(i,'");\n background-size: cover;\n width:').concat(n?n+"px":"100%",";\n height:").concat(r?r+"px":"100%",";\n "))}}},{key:"getDefinitionConfig",value:function(){var e,t=this,i=this.playerData.current.lineId,n=this.playerData.getDefinitionListByLineId(i),r=this.playerData.current.definition;return this.playerData.isOpenABR()&&(r=this.playerData.defaultDefinition,n=null!==(e=n)&&void 0!==e&&e.length&&!this.adapter.needAbrAutoDefinition()?n.filter((function(e){return!t.playerData.isAutoDefinition(e.definition)})):n),{defaultDefinition:r,list:n}}},{key:"createPlayer",value:(v=u(s().mark((function e(){var t,i,n,r,o,l,c,h,d,f,p,g,v,y,_,b,k,w,S,T,C,x,D,P,O,I,L,A,R,M,N,B,U,j,H,F,V,z=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._destroyPlayer();case 2:return e.next=4,this.beforePlayerCreate();case 4:return l=this.playerData,c=l.isLive,h=l.options,d=l.plugins,f=l.isMobile,p=l.openSoftDecoding,g=l.configs,v=l.isMusic,y=l.strategiesPlugins,_=l.strategiesPluginConfigs,b=this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),k=this.playerData.getCurrentStreamType()||ql(null==g?void 0:g.getVideoByToken),fc(g,"EncryptHlsPlugin")||b&&k||v||this.playerData.isOpenABR()||(Ul.warn("url is empty or streamType is empty (url:".concat(b,", streamType: ").concat(k,")")),this.renderPoster()),w=function(){var e=u(s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Sc(b),e.next=3,z.getSoftDecodingOption(p,t,k);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e.next=12,DF({isLive:c,isMobile:f,streamType:k,playerData:this.playerData,getSoftOptionTask:w},this);case 12:return S=e.sent,T=S.presets,C=S.softDecodingOption,x=S.plugins,D=f?qF(c):GF(c),P=this._analyzeExtendPlugins(),O=P.basicPlugins,I=void 0===O?[]:O,L=P.iconPlugins,A=void 0===L?[]:L,M=(R=C||{}).plugins,N=void 0===M?[]:M,B=m(R,VV),U=this.getDefinitionConfig(),j=a(a(a(a(a({},D),h),B||{}),{},{definition:U,icons:a(a(a({},D.icons),v?{play:jV,pause:HV}:{}),null!==(t=null==h?void 0:h.icons)&&void 0!==t?t:{}),MoreButtonPlugin:{iconPlugins:[].concat(E(null!==(i=null===(n=h.MoreButtonPlugin)||void 0===n?void 0:n.iconPlugins)&&void 0!==i?i:[]),E(A),[sV,eV])}},_),{},{playerData:this.playerData}),this.playerData.getLineList().length>1&&j.MoreButtonPlugin.iconPlugins.push(nV),this.setDefaultConfigOptions(j),H=wc([].concat(E(I),E(d),E(x),E(N),E(y))),F=(null!==(r=null==j?void 0:j.ignores)&&void 0!==r?r:[]).some((function(e){return"sdkunmuteplugin"===(e+"").toLowerCase()})),j.ignores=[].concat(E(null!==(o=null==j?void 0:j.ignores)&&void 0!==o?o:[]),E(F?["AutoplayPlugin"]:[]),E(v?["sdkErrorPlugin","sdkToastPlugin","MoreButtonPlugin","DanmuPlugin","AutoplayPlugin"]:[])),this._isFirstCreated?this._isFirstCreated=!1:(j.autoplayMuted=!1,j.ignores=[].concat(E(null!==(V=null==j?void 0:j.ignores)&&void 0!==V?V:[]),["sdkUnmutePlugin"])),this.setPluginConfig(j),this.player=new Tl(a(a(v?{el:this.playerContainer,controls:{mode:"flex",initShow:!0},marginControls:!0,presets:[].concat(E(T),[FV]),mediaType:["mp4","m4a","hls"].includes(k)?"video":"audio",url:b}:{el:this.playerContainer,presets:T,url:b,isLive:c},j),{},{plugins:E(H)})),this.player.playerData=this.playerData,this.player.sdk=this,this._emitter.emit(DM.PLAYER_CREATED_FINISH),this.afterPlayerCreate(),e.abrupt("return",this.player);case 35:case"end":return e.stop()}}),e,this)}))),function(){return v.apply(this,arguments)})},{key:"setPluginConfig",value:function(e){var t,i,n,r,o=this.playerData,s=o.apiMap,l=o.configs,c=o.unionInfo,u=o.playList,h=o.useHlsPluginForSafari,d=o.isMobile,f=this.playerData.getCurrentStreamType()||ql(null==l?void 0:l.getVideoByToken),p=fc(l,"EncryptHlsPlugin"),g=fc(l,"Mp4EncryptPlayer"),v=fc(l,"DASHPlugin"),y=fc(l,"vodLogOpts"),m=!(null==u||null===(t=u[0])||void 0===t||!t.kid)||!!p;if(p&&(e.EncryptHlsPlugin=a(a({playDomain:s.playDomain,getKeyType:"TOP",preferMMS:!0,preferMMSStreaming:!0},d||!bc||h?{}:{useHls:!1}),p)),g&&(e.Mp4EncryptPlayer=a({playDomain:s.playDomain,getKeyType:"TOP"},g)),v&&(e.DASHPlugin=a({playDomain:s.playDomain,getKeyType:"TOP"},v)),l.privateDrmAuthToken&&l.kid&&c&&("hls"===f?e.EncryptHlsPlugin=a({kid:l.kid,drmKeyToken:l.privateDrmAuthToken,playDomain:s.playDomain,preferMMS:!0,preferMMSStreaming:!0},p||{}):"dash"===f?e.DASHPlugin=a({kid:l.kid,drmKeyToken:l.privateDrmAuthToken,playDomain:s.playDomain},v||{}):"mp4"===f&&(e.Mp4EncryptPlayer=a({kid:l.kid,drmKeyToken:l.privateDrmAuthToken,playDomain:s.playDomain},g||{}))),y){Ul.log("codec",this.playerData.codec);var _=kc(this.region),b=null==_?void 0:_.__LOG_CUSTOM_REGION__;e.vodLogOpts=a(a({vtype:(f||"mp4").toUpperCase(),codec_type:this.playerData.codec,drm_type:m?1:0,playerVersion:"1.9.6",channel:null==_?void 0:_.__LOG_CHANNEL__,needXhrCheck:!0,enableTeaWebId:!0},b?{trackerConfig:{log_from_region:null==_?void 0:_.__LOG_CUSTOM_REGION__}}:{}),{},{ext:this.vodLogCommon},y)}null===(i=this.getSdkPlugin("Abr"))||void 0===i||i.applyAbrConfig(e),null===(n=this.getSdkPlugin("AdaptRange"))||void 0===n||n.applyRangeConfig(e),null===(r=this.getSdkPlugin("Strategy"))||void 0===r||r.applyFinal
1Strategy(e)}},{key:"detectCodec",value:(d=u(s().mark((function e(t){var i,n,r,o,a;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.sdkUmdLoader.loadPlugins(vA.StreamProbe);case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:if(i=e.t0,!(n=i.LoadProbe)){e.next=14;break}return e.next=11,null===(r=new n)||void 0===r?void 0:r.parseUrl(t);case 11:o=e.sent,"bytevc1"===(a=(o||{}).codec)?this.playerData.codec=vn.H265:"avc"===a&&(this.playerData.codec=vn.H264);case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(0),Ul.warn("detect codec error: ",e.t1);case 19:case"end":return e.stop()}}),e,this,[[0,16]])}))),function(e){return d.apply(this,arguments)})},{key:"setDefaultConfigOptions",value:function(e){if(this._isFirstCreated){var t=this.playerData,i=t.defaultConfig,n=t.isHitDefault;if(i){var r,o,s=null!=i?i:{},l=s.volume,c=s.startTime,u=s.DanmuPlugin,h=s.LiveSubtitlesIconPlugin;l&&(e.volume=e.volume?a(a({},e.volume),{},{default:l}):l),n&&(c&&(e.startTime=c),u&&(e.DanmuPlugin=a(a({},null!==(r=e.DanmuPlugin)&&void 0!==r?r:{}),u)),h&&(e.LiveSubtitlesIconPlugin=a(a({},null!==(o=e.LiveSubtitlesIconPlugin)&&void 0!==o?o:{}),h)))}}}},{key:"getCurrentPlayerConfig",value:function(){var e,t,i=this.playerData,n=i.isLive,r=i.current,o=r.lineId,s={type:n?"live":"vod",isLive:n,definition:r.definition,lineId:o,volume:null!==(e=this.player.volume)&&void 0!==e?e:.6};return n||(s.startTime=null!==(t=this.player.currentTime)&&void 0!==t?t:0),a({},s)}},{key:"getStreamType",value:function(){var e;return this.playerData.getCurrentStreamType()||ql(null===(e=this.playerData)||void 0===e||null===(e=e.configs)||void 0===e?void 0:e.getVideoByToken)}},{key:"_analyzeExtendPlugins",value:function(){var e,t=this.playerData.options,i=t.extendPlugin||[],n=null!==(e=null==t?void 0:t.ignore)&&void 0!==e?e:[],r=[],o=[];return i.forEach((function(e){var t=function(e){var t="mobile"===ir.device,i=e.pluginName,n=void 0===i?"ExtendPlugin".concat(Math.random().toString().slice(-5)):i,r=e.type,o=void 0===r?t?"inner":"normal":r,a=e.position,s=void 0===a?XF.CONTROLS_LEFT:a,l=e.icon,c=void 0===l?TN:l,u=e.index,d=void 0===u?1:u,v=e.hideAtFullScreen,y=void 0===v||v,m=e.tips,_=void 0===m?{jp:"custom",en:"custom",zh:"èªå®ä¹","zh-hk":"èªå®ä¹"}:m;return function(e){g(i,e);var t=k(i);function i(){return h(this,i),t.apply(this,arguments)}return f(i,[{key:"afterCreate",value:function(){var e;this.appendChild(".xgplayer-icon",this.icons[n]),this.initEvents(),y&&null!==(e=this.player)&&void 0!==e&&e.fullscreen&&this.handleFullScreenChange()}},{key:"registerIcons",value:function(){return p({},n,{icon:c,class:"xgplayer-extendicon-svg"})}},{key:"updateIcons",value:function(e){var t=this.find(".xgplayer-icon");t&&(t.innerHTML=e)}},{key:"registerLanguageTexts",value:function(){return p({},n,_)}},{key:"initEvents",value:function(){this.handleCallback=XM(this.handleCallback.bind(this),200);var e,t="mobile"===ir.device?"touchend":"click";this.bind(t,this.handleCallback),this.show(),y&&(null===(e=this.player)||void 0===e||e.on(Ur,this.handleFullScreenChange.bind(this)))}},{key:"handleFullScreenChange",value:function(){var e,t=this.player;null===(e=this.player)||void 0===e||e.changePluginsIcon(n,!(null!=t&&t.fullscreen))}},{key:"handleCallback",value:function(e){var t=this.player;t&&(e.preventDefault(),e.stopPropagation(),t.emit(PM.PLAYER_EXTEND_BUTTON,n))}},{key:"destroy",value:function(){var e;this.unbind(["touchend","click"],this.handleCallback),y&&(null===(e=this.player)||void 0===e||e.off(Ur,this.handleFullScreenChange.bind(this)))}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-extend-icon">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(n,'">').concat(this.langText[n],"</div>\n </xg-icon>\n ")}}],[{key:"isExtendPlugin",get:function(){return!0}},{key:"type",get:function(){return o}},{key:"textTips",get:function(){return _}},{key:"pluginName",get:function(){return n}},{key:"defaultConfig",get:function(){return{position:s,index:d}}}]),i}(Bo)}(e);"inner"!==t.type||n[e.pluginName]?r.push(t):o.push(t)})),{basicPlugins:r,iconPlugins:o}}},{key:"beforePlayerCreate",value:(c=u(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([bV.beforePlayerCreate(this),this.prepareStrategies()]);case 2:this.updateConfigByStrategy();case 3:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"prepareStrategies",value:(o=u(s().mark((function e(){var t,i,n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mV.prepare();case 2:e.sent?(t=mV.getStrategyRecommendations(),i=t.plugins,n=t.pluginConfiguration,this.playerData.strategiesPlugins=i,this.playerData.strategiesPluginConfigs=n):(this.playerData.strategiesPlugins=[],this.playerData.strategiesPluginConfigs={});case 4:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"updateConfigByStrategy",value:function(){if(mV.isReady()){var e=mV.getStrategyRecommendations().result;if(Ul.log("vodLogCommon strategyConfig:",e),this.vodLogCommon={strategyResult:e},null!=e&&e[gV.H265]){var t=this.playerData.configs;if(!t)return;var i=t.url,n=t.codec,r=t.playList,o=void 0===r?[]:r,s=o.filter((function(e){return!e.codec||e.codec===vn.UNKNOWN})),l=o.filter((function(e){return e.codec===vn.H264})),c=o.filter((function(e){return e.codec===vn.H265})),u=e[gV.H265].enableH265Hardware,h=fn(u?c.concat(l).concat(s):l.concat(s).concat(c),"definition"),d=!u&&!!i&&n===vn.H265&&h.length>0;this.playerData.initPlayData(a(a({},this.playerData.configs),{},{url:d?null:i,codec:d?vn.UNKNOWN:n,playList:h})),Ul.log("hit h265strategy, current playList: ",this.playerData.playList)}}}},{key:"afterPlayerCreate",value:function(){var e=this.playerData.isMobile;this._mountingPlayerPanel(e),this._mountingExtendMethods(),this._bindSdkEvents(),this._bindPlayerEvents(),this._setPlayerInfo(),this._initCheckExpire(),bV.afterPlayerCreate(this)}},{key:"_emitDelayError",value:function(){var e=this;this.player&&this.delayError.forEach((function(t){var i=new ar(e.player,t);e.player.emit("error",i)})),this.delayError=[]}},{key:"_emitDelayEvent",value:function(){var e=this;
1this.player&&this.delayEvents.forEach((function(t){var i=t||{},n=i.name,r=i.payload;n&&e.emit(n,r)})),this.delayEvents=[]}},{key:"_setPlayerInfo",value:function(){var e;if(this.player){this.player.playerVersion="1.9.6";var t,i=this.playerData.getCurrentStreamType()||ql(null===(e=this.playerData)||void 0===e||null===(e=e.configs)||void 0===e?void 0:e.getVideoByToken);this.player.playerType||(this.player.playerType=i,"hls"===(null==i?void 0:i.toLowerCase())&&null!==(t=this.player)&&void 0!==t&&t.vodLogger&&(this.player.vodLogger.vtype="HLS"))}}},{key:"_mountingPlayerPanel",value:function(e){var t,i=this.playerData,n=i.options,r=i.isLive;this.player&&e&&(this.mobilePanel=new JF({config:null!==(t=n.panel)&&void 0!==t?t:{mode:r?Pl.INNER:Pl.NORMAL,isAutoChange:!0},root:this.player.root,player:this.player}),this.player.panel=this.mobilePanel)}},{key:"_bindPlayerEvents",value:function(){this.player&&(this.player.on(DM.PLAYER_REBUILD,this.createPlayer.bind(this)),this.player.once(OM.READY,this._emitDelayError.bind(this)),this.player.once(OM.READY,this._emitDelayEvent.bind(this)),this.player.on(OM.ERROR,this._onError.bind(this)))}},{key:"_onError",value:function(e){var t,i=this;Ul.error("error: ",e);var n=e.errorCode,r=e.httpCode,o=e.mediaError;if(qn.isMSE(null===(t=this.player)||void 0===t?void 0:t.media))r+""!="403"&&n+""!="9203"||this._emitExpireEvent("error",e);else if(4===(null==o?void 0:o.code)||2===(null==o?void 0:o.code)){var a=Sc(this.playerData.getCurrentUrl());a&&rc(a,{range:"0-8",timeout:2e3}).then((function(t){Ul.log("xhr result",t);var n=t.status,r=t.response;403===n&&"string"==typeof r&&r.includes("expire")&&i._emitExpireEvent("error",e)}))}}},{key:"_onMediaExpiredAction",value:function(){var e,t,i=this;if(this.emitExpireTimestamp=Math.round((new Date).getTime()/1e3),null!==(e=this.playerData)&&void 0!==e&&e.onMediaExpired&&"function"==typeof(null===(t=this.playerData)||void 0===t?void 0:t.onMediaExpired)){var n=dc(this.playerData.onMediaExpired());null!=n&&n.then&&n.then((function(e){return i.updateMediaSource(e)}))}}},{key:"updateMediaSource",value:function(e){var t=this,i=e||{},n=i.url,r=i.playList,o=i.getVideoByToken;return n||null!=r&&r.length?new Promise((function(i,n){t.playerData.updateConfigs(e),t.playerData.updatePlayList(),t.playerData.updateCheckExpireData();var o=t.playerData.getCurrentUrl();if(t.player.isError||t.player.state<6&&ir.isWeixin&&ir.os.isIos){if(null==r||!r.length)return t.playNext(a({},e),!1);var s=t.playerData.current.definition,l=r.find((function(e){return e.definition===s}));if(l&&l.url)return t.playNext(a(a({},e),{},{url:l.url}),!1)}else{t.player.setConfig(a(a({},e),{},{url:o,definition:t.getDefinitionConfig()}));var c=t.player.switchURL(o,{seamless:!0});c&&c.then?(c.then((function(){return i(void 0)})),c.catch((function(){return n()}))):i(void 0)}})):null!=o&&o.playAuthToken?this.updateAuthToken(o):void 0}},{key:"onTokenExpiredAction",value:function(){var e,t,i=this;if(null!==(e=this.playerData)&&void 0!==e&&e.onTokenExpired&&"function"==typeof(null===(t=this.playerData)||void 0===t?void 0:t.onTokenExpired)){var n=dc(this.playerData.onTokenExpired());null!=n&&n.then&&n.then((function(e){return i.updateAuthToken(e)}))}}},{key:"_bindSdkEvents",value:function(){var e=this,t=[].concat(E(Object.values(PM)),E(Object.values(DM)),E(Object.values(ro)));E(new Set(t.filter((function(e){return"string"==typeof e})))).forEach((function(t){"string"==typeof t&&e.player.on(t,(function(){for(var i,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];(i=e._emitter).emit.apply(i,[t].concat(r))}))}))}},{key:"_mountingExtendMethods",value:function(){this.player&&(this.player.changePluginsIcon=this.changePluginsIcon.bind(this))}},{key:"_offPlayerEvents",value:function(){this.player&&this.player.off(DM.PLAYER_REBUILD,this.createPlayer.bind(this))}},{key:"changePluginsIcon",value:function(e,t){var i;if(this.player){var n=this.player.getPlugin(e);if(n&&null!=n&&n.root){var r=qn.hasClass(null==n?void 0:n.parent,"panel-icon-svg")?null==n||null===(i=n.parent)||void 0===i?void 0:i.parentNode:null==n?void 0:n.root;r&&(t?qn.show(r,"block"):qn.hide(r))}}}},{key:"getSdkPlugin",value:function(e){var t=this._sdkPlugins[e.toLowerCase()];return t&&t.pluginName?t:null}},{key:"switchAuthToken",value:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=i?0:this.player.currentTime,r=this.getSdkPlugin("AuthToken");return new Promise((function(o,a){r&&t.player?r.updateAuthToken(e,i).then((function(){t._playerPlayNext(n).then((function(){return o()}))})):(Ul.error("current is not playAuthToken play or player not created"),a())}))}},{key:"updateAuthToken",value:function(e){var t=this,i=this.getSdkPlugin("AuthToken");return new Promise((function(n,r){i&&t.player?i.updateAuthToken(e,!1).then((function(){if(t.player.isError)t._playerPlayNext(t.player.currentTime).then((function(){return n()})).catch((function(){return r()}));else{var e=t.playerData.getCurrentUrl();t.player.setConfig({url:e,definition:t.getDefinitionConfig()});var i=t.player.switchURL(e,{seamless:!0});i&&i.then?(i.then((function(){return n()})),i.catch((function(){return r()}))):n()}})).catch((function(){return r()})):(Ul.error("current is not playAuthToken play or player not created"),r())}))}},{key:"_playerPlayNext",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(i,n){var r=e.player.paused&&!e.player.isError;e.player.addClass(Fo.ENTER);var o=e.playerData.isOpenABR()?void 0:e.playerData.getCurrentUrl(),s=a(a({},e.playerData.options),{},{definition:e.getDefinitionConfig(),startTime:t,autoplay:!0,url:o});if(s.poster&&e.player.plugins.poster&&e.player.plugins.poster.update(s.poster),e.setPluginConfig(s),e.player.plugins.dashplugin){var l,c,u=a(a({},fc(e.player.config,"DASHPlugin")),e.playerData.options.DASHPlugin||{});u.dashOpts=e.playerData.dashOpts,u.vid=null===(l=e.playerData.dashOpts)||void 0===l||null===(l=l.Data)||void 0===l?void 0:l.Vid,e.player.plugins.drm&&(null===(c=e.player.plugins.drm)||void 0===c||c.restart()),e.player.setConfig(s),e.player.plugins.dashplugin.next(e.player.currentTime,"NEXT",u)}else e.player.playNext(s);var h=function(t){e.player.off(OM.TIME_UPDATE,d),e.player.off(OM.CANPLAY,d),n(t)},d=function(){r&&e.player.pause(),e.player.off(OM.ERROR,h),i(!0)};e.player.once(OM.ERROR,h),e.player.once(OM.CANPLAY,d)}))}},{key:"src",get:function(){var e,t;return(null===(e=this.player)||void 0===e?void 0:e.currentSrc)||(null===(t=this.player)||void 0===t?void 0:t.src)},set:function(e){this.player&&(this.player.src=e)}},{key:"switchURL",value:function(e){var t=this,i=this.player.switchURL(e,!1),n=this.player.currentTime;return i&&i.then?i:new Promise((function(e){var i=t.player.paused&&!t.player.isError,r=function(){t.player.currentTime=n,i&&t.player.once(OM.CANPLAY,(function(){t.player.pause()})),e()};ir.os.isAndroid?t.once(OM.TIME_UPDATE,(function(){r()})):t.once(OM.CANPLAY,(function(){r()})),t.player.play()}))}},{key:"next",value:function(e){var t,i=this,n=arguments.length>
11&&void 0!==arguments[1]&&!arguments[1]?this.player.currentTime:0,r=a(a({},this.playerData.configs),{},{startTime:n,autoplay:!0},e);return null!=e&&null!==(t=e.getVideoByToken)&&void 0!==t&&t.playAuthToken&&(r.streamType=ql(null==e?void 0:e.getVideoByToken)||_n.MP4),this.destroy().then((function(){return i._init(r)})).catch((function(e){Ul.error("next_error",e)}))}},{key:"playNext",value:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.player.emit(PM.PLAY_NEXT_START);var n=this._playNext(e,i);return n.finally((function(){t.player.emit(PM.PLAY_NEXT_END)})),n}},{key:"_playNext",value:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return Promise.reject();var n,r=e.url,o=e.playList,s=e.getVideoByToken,l=this.player.paused&&!this.player.isError,c=i?0:this.player.currentTime;if(r||null!=o&&o.length){this.playerData.updateConfigs(e),this.playerData.initPlayData(e);var u=this.adapter.canOpenAbr()&&this.playerData.isOpenABR()?void 0:this.playerData.getCurrentUrl(),h=this.player.state,d=this.getDefinitionConfig(),f=a(a({startTime:c},e),{},{url:u,definition:d});return this.setPluginConfig(f),this.player.playNext(f),new Promise((function(e,i){if(t.player.once(OM.ERROR,(function(e){i(e)})),6===h)t.player.once(OM.EMPTIED,(function(){t.player.once(OM.CANPLAY,(function(){l&&t.player.pause(),e(void 0)}))}));else{var n=t.player.config.autoplay;t.player.once(OM.EMPTIED,(function(){t.player.once(OM.CANPLAY,(function(){n&&t.player.play(),e(void 0)}))}))}}))}return null!=s&&s.playAuthToken?(this.playerData.getCurrentStreamType()||ql(null===(n=this.playerData.configs)||void 0===n?void 0:n.getVideoByToken))!==(e.streamType||ql(null==e?void 0:e.getVideoByToken)||"mp4")?this.next(e,i):this.switchAuthToken(s,i):this.next(e,i)}},{key:"_destroyPlayer",value:(r=u(s().mark((function e(){var t,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._offPlayerEvents(),e.next=3,null===(t=this.mobilePanel)||void 0===t?void 0:t.destroy();case 3:return e.next=5,null===(i=this.player)||void 0===i?void 0:i.destroy();case 5:this.player=null;case 6:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getPlayerInstance",value:function(){return this.player}},{key:"getSoftDecodingOption",value:(n=u(s().mark((function e(t,i,n){var r,o,a,l,c,u,h,d,f,p,g,v,y,m;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.playerData,a=o.enableH265Degrade,l=o.codec,c=o.configs,u=$l(null==c?void 0:c.getVideoByToken),h=!!(c.enableMp4MSE||fc(this.playerData.options,"Mp4EncryptPlayer")||"mp4"===n&&(l===vn.H265||u||null!=c&&null!==(r=c.autoBitrateOpts)&&void 0!==r&&r.enable)),!t){e.next=27;break}return e.next=6,this.sdkUmdLoader.loadPlugins(vA.XGVideo);case 6:if(!(null==(d=e.sent)?void 0:d.isSupported())){e.next=21;break}if(l&&d.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),!h){e.next=18;break}return e.next=14,this.sdkUmdLoader.loadPlugins(vA.MP4Encrypt);case 14:return f=e.sent,e.abrupt("return",{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=l?l:vn.H264,plugins:[f]});case 18:return e.abrupt("return",{mediaType:"xg-video",innerDegrade:1,codecType:null!=l?l:vn.H264});case 19:e.next=25;break;case 21:this.emit(DM.NOT_SUPPORT_SOFT_DECODER),p={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0},this.delayError.push(p),Ul.error("soft decode is not support by current browser");case 25:e.next=60;break;case 27:if(!a||l||!i){e.next=30;break}return e.next=30,this.detectCodec(i);case 30:if(!this.playerData.isCurrentH265()||(s=void 0,_=void 0,b=void 0,s=window.navigator.userAgent.toLocaleLowerCase(),_=/(iphone)/.test(s)||/(ipad)/.test(s),b=/(quark)/.test(s),_&&!b||window.MediaSource&&window.MediaSource.isTypeSupported&&(window.MediaSource.isTypeSupported('video/mp4;
1codecs="hev1.1.6.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||window.MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"')))){e.next=60;break}if(!a){e.next=56;break}return e.next=34,this.sdkUmdLoader.loadPlugins(vA.XGVideo);case 34:if(!(null==(g=e.sent)?void 0:g.isSupported())){e.next=50;break}if(null==g||g.setDecodeCapacity({preloadDecoder:this.playerData.codec,wasmFallbackToAsm:!1,reuseWasmDecoder:!1,disabledWhenErrorOccur:!1}),this.setH265SoftPlayList(),this.playerData.openSoftDecoding=!0,!h){e.next=47;break}return e.next=43,this.sdkUmdLoader.loadPlugins(vA.MP4Encrypt);case 43:return v=e.sent,e.abrupt("return",{mediaType:this.playerData.isCurrentH265()?"xg-video":"video",innerDegrade:1,codecType:null!=l?l:vn.H264,plugins:[v]});case 47:return e.abrupt("return",{mediaType:"xg-video",innerDegrade:1,codecType:null!=l?l:vn.H264});case 48:e.next=54;break;case 50:this.emit(DM.NOT_SUPPORT_SOFT_DECODER),y={errorType:"decoder",errorCode:3,errorMessage:"soft decode is not support by current browser",ext:{},originError:void 0},this.delayError.push(y),Ul.error("soft decode is not support by current browser");case 54:e.next=60;break;case 56:this.emit(DM.NOT_SUPPORT_HARDWARE_DECODER),m={ext:{},originError:void 0,errorType:"decoder",errorCode:3,errorMessage:"h265 hardware decode is not supported by this browser"},this.delayError.push(m),Ul.error("h265 hardware decode is not supported by this browser");case 60:return e.abrupt("return",{});case 61:case"end":return e.stop()}var s,_,b}),e,this)}))),function(e,t,i){return n.apply(this,arguments)})},{key:"setH265SoftPlayList",value:function(){if(this.playerData.isCurrentH265()){var e=this.playerData.playList;e.length>1&&(this.playerData.playList=e.filter((function(e){var t;return(null==e||null===(t=e.codec)||void 0===t?void 0:t.toLowerCase())===vn.H265}))),this.playerData.initCurrent(this.playerData.playList[0])}}},{key:"changeDefinition",value:function(e){var t,i;if(!((null===(t=this.getDefinitionList())||void 0===t?void 0:t.length)<=1)){var n=(null===(i=this.player)||void 0===i?void 0:i.plugins)||{},r=n.sdkdefinitionplugin,o=n.definitionmobileplugin;if(r||o)e!==this.playerData.current.definition&&(r?null==r||r.changeDefinition(e):o&&(null==o||o.changeDefinition(e)));else{var a,s,l=this.playerData.current.lineId;(a=this.playerData.getDefinitionListByLineId(l).find((function(t){return t.definition===e})))||(a=null===(s=this.player)||void 0===s||null===(s=s.config)||void 0===s||null===(s=s.definition)||void 0===s||null===(s=s.list)||void 0===s?void 0:s.find((function(t){return(null==t?void 0:t.definition)===e}))),a&&(this.player.changeDefinition(a),a.definition!==this.playerData.current.definition&&(this.playerData.current.definition=a.definition))}}}},{key:"getDefinitionList",value:function(){var e,t=this,i=(null===(e=this.player)||void 0===e?void 0:e.plugins)||{},n=i.sdkdefinitionplugin,r=i.definitionmobileplugin;return n||r?(null==n?void 0:n.renderList)||(null==r?void 0:r.renderList):this.player.definitionList.map((function(e){var i,n=t.playerData.isDefinitionMatch(e.definition,null===(i=t.player.curDefinition)||void 0===i?void 0:i.definition),r=e.url===t.player.url,o=e.url===t.player.src;return a(a({},e),{},{isDefinitionAuto:t.playerData.isAutoDefinition(e.definition),selected:n||(t.playerData.isOpenABR()&&ir.os.isIos?o:r)})}))}},{key:"_initI18N",value:function(e){var t=e.extraLangList,i=e.extendLangList;null==t||t.forEach((function(e){$o.use(e)})),$o.extend(bN),i&&$o.extend(i)}},{key:"musicMode",get:function(){var e;return null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e?void 0:e.mode},set:function(e){var t;null!==(t=this.player.plugins)&&void 0!==t&&t.music&&(this.player.plugins.music.mode=e)}},{key:"musicTimeScale",get:function(){var e;return null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e?void 0:e.timeScale},set:function(e){var t;null!==(t=this.player.plugins)&&void 0!==t&&t.music&&(this.player.plugins.music.timeScale=e)}},{key:"musicList",get:function(){var e;return null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e?void 0:e.list},set:function(e){var t;null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||t.updateList(e)}},{key:"musicAdd",value:function(e){var t,i;null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||null===(i=t.add)||void 0===i||i.call(t,e)}},{key:"musicRandom",value:function(){var e,t;return null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.random)||void 0===t?void 0:t.call(e)}},{key:"musicNext",value:function(){var e,t;null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.next)||void 0===t||t.call(e)}},{key:"musicPrev",value:function(){var e,t;null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.prev)||void 0===t||t.call(e)}},{key:"musicSetIndex",value:function(e){var t,i;null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||null===(i=t.setIndex)||void 0===i||i.call(t,e)}},{key:"musicForward",value:function(){var e,t;null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.forward)||void 0===t||t.call(e)}},{key:"musicBackward",value:function(){var e,t;null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.backward)||void 0===t||t.call(e)}},{key:"musicRemove",value:function(e){var t,i;null===(t=this.player.plugins)||void 0===t||null===(t=t.music)||void 0===t||null===(i=t.remove)||void 0===i||i.call(t,e)}},{key:"musicSetAbCycle",value:function(e,t,i,n){var r,o;null===(r=this.player.plugins)||void 0===r||null===(r=r.music)||void 0===r||null===(o=r.setAbCycle)||void 0===o||o.call(r,e,t,i,n)}},{key:"musicRemoveAbCycle",value:function(){var e,t;null===(e=this.player.plugins)||void 0===e||null===(e=e.music)||void 0===e||null===(t=e.removeAbCycle)||void 0===t||t.call(e)}},{key:"getLogUserId",value:function(){var e,t=null===(e=this.player)||void 0===e?void 0:e.vodLogger;if(t){var i,n,r=(null==t||null===(i=t.tracker)||void 0===i?void 0:i.getConfig())||{};return null==r||null===(n=r.user)||void 0===n?void 0:n.user_unique_id}}},{key:"region",get:function(){return this.playerData.region}},{key:"getPlugin",value:function(e){var t;return null===(t=this.player)||void 0===t?void 0:t.getPlugin(e)}},{key:"destroy",value:(i=u(s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._destroyPlayer();case 2:this.checkExpireTimer&&(this.checkExpireTimer.clear(),this.checkExpireTimer=null,this._onRepeat=null),this.mountingDom&&this.mountingDom.contains(this.playerContainer)&&this.mountingDom.removeChild(this.playerContainer),null===(t=this._emitter)||void 0===t||t.removeAllListeners(),this._emitter=null,bV.destroy(this);case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})}],[{key:"prepare",value:(t=u(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mV.init(t);case 2:return e.next=4,mV.initPreloadService(t);case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}
1,{key:"setPreloadScene",value:function(e,t){return mV.setPreloadScene(e,t)}},{key:"preloader",get:function(){return mV.preloader}},{key:"preloaderStatus",get:function(){return mV.preloaderStatus}},{key:"addPreloadList",value:function(e){return mV.addPreloadList(e)}},{key:"setPreloadList",value:function(e){return mV.setPreloadList(e)}}]),e}();zV.isMSESupported=yc,zV.isRTMSupported=xM.isSupported,zV.veStrategy=mV,zV.sdkVersion="1.9.6",zV.isRTMSupportCodec=function(e,t){if(e===mn.H264)return xM.isSupportedH264(null==t?void 0:t.targetProfileLevel)};var GV,WV=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).state={showLang:"",subTitleList:[],rtmpDtsGap:0,dtsBase:0,showingSubtitle:"",currentSub:null},n.clearLineTimer=null,n.showTimer=null,n.state.showLang=e.showLang,n}return f(i,[{key:"beforePlayerInit",value:function(){var e=this;this.on(pr,this.handleVideoTimeupdate.bind(this)),this.on(ur,this.onPause.bind(this)),this.on(sr,this.onPlay.bind(this)),this.on(Lr,this.destroy.bind(this)),this.on(Ar,this.clearRtmpDtsGap.bind(this)),this.on(zr,this.handleSEIParsed.bind(this)),this.on("core_event",(function(t){"core.sei"===t.eventName&&e.handleSEIParsed(t.sei,t.originPts)}))}},{key:"onPause",value:function(){this.clearSubTitle(!1)}},{key:"onPlay",value:function(){this.clearSubTitle(!0)}},{key:"destroy",value:function(){this.clearSubTitle(!0),this.off(pr,this.handleVideoTimeupdate.bind(this)),this.off(zr,this.handleSEIParsed.bind(this)),this.off(ur,this.onPause.bind(this)),this.off(sr,this.onPlay.bind(this)),this.off(Lr,this.destroy.bind(this)),this.off(Ar,this.clearRtmpDtsGap.bind(this))}},{key:"clearRtmpDtsGap",value:function(){this.state.rtmpDtsGap=0,this.state.dtsBase=0,this.clearSubTitle(!0)}},{key:"clearSubTitle",value:function(e){if(this.state.subTitleList=[],this.state.showingSubtitle="",this.state.currentSub=null,clearTimeout(this.showTimer),clearTimeout(this.clearLineTimer),e){var t=this.find(".xgplayer-subtitles-inner");t&&this.resetDom(t)}}},{key:"getIsSoft",value:function(){var e;return"LIVE-VIDEO"===(null!==(e=this.player.video)&&void 0!==e?e:{}).tagName}},{key:"handleVideoTimeupdate",value:function(e){var t,i,n=this.player.video.currentTime,r=this.getIsSoft(),o=(null==e||null===(t=e.detail)||void 0===t?void 0:t.pts)/1e3,a=r?o:n;if(this.state.showLang&&a&&this.player.isPlaying){var s=this.findSubTitleByTime(a);s&&s.text!==this.state.showingSubtitle&&null!==(i=s.wordpiece)&&void 0!==i&&i.length&&(this.renderSubtitle(s),this.player.emit(PM.AI_SUBTITLE_MATCH,{subTitle:s,lang:this.state.showLang}),this.state.subTitleList.length>1e3&&(this.state.subTitleList=this.state.subTitleList.filter((function(e){return e.timestamp+e.duration/1e3>=a}))))}}},{key:"renderSubtitle",value:function(e){var t=this,i=this.root,n=this.find(".xgplayer-subtitles-inner"),r=this.find(".xgplayer-subtitles-helper");if(n){this.clearLineTimer&&clearTimeout(this.clearLineTimer),this.showTimer&&(clearTimeout(this.showTimer),this.showSurplus());var o=this.createNewDom(n);this.state.showingSubtitle=e.text,this.state.currentSub={subObj:e,dom:o,index:0};var a=Date.now(),s="",l=0;!function c(){var u,h=e.wordpiece,d=void 0===h?[]:h,f=e.delimiter;if(l===d.length)return s="",t.showTimer=null,void(t.clearLineTimer=setTimeout((function(){t.resetDom(n),t.clearLineTimer=null}),1e3));var p=d[l].duration-(Date.now()-a-d[l].OffsetMs);if(p<0)for(;p<0&&l<d.length-1;)s=s+f+d[l+=1].text,p=d[l].duration-(Date.now()-a-d[l].OffsetMs);else s=s+f+d[l].text;r.textContent=s;var g=null!==(u=null==i?void 0:i.offsetWidth)&&void 0!==u?u:300;r.offsetWidth>g&&(o=t.createNewDom(n),t.state.currentSub.dom=o,s=d[l].text),o.textContent=s,t.showTimer=setTimeout(c,p),l+=1,t.state.currentSub.index=l}()}}},{key:"handleSEIParsed",value:function(e,t){var i,n,r=e.dts;if(5===e.code)try{var o="string"==typeof e.content?e.content:(i=e.content,(n=String.fromCharCode.apply(null,i)).slice(n.indexOf("{"),n.lastIndexOf("}")+1)),a=JSON.parse(o).rtmp_dts;if(a&&r){var s=t||r;this.state.rtmpDtsGap=a-s}}catch(e){}}},{key:"insertSubTitle",value:function(){for(var e,t=this,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];
1n.forEach((function(e){e.timestamp=t.adjustSubTitleTime(e.timestamp)})),(e=this.state.subTitleList).push.apply(e,n)}},{key:"setCurrentLang",value:function(e){this.state.showLang=e,this.player.emit(PM.AI_SUBTITLE_LANG_CHANGE,e)}},{key:"adjustSubTitleTime",value:function(e){var t,i,n,r;if(this.getIsSoft())return(e-this.state.rtmpDtsGap)/1e3;var o=(null===(t=this.player)||void 0===t||null===(t=t.plugins)||void 0===t?void 0:t.flvlive)||(null===(i=this.player)||void 0===i||null===(i=i.plugins)||void 0===i?void 0:i.hlslive);if(o){var a,s,l,c,u,h,d=null!==(a=null==o||null===(s=o._context)||void 0===s||null===(s=s.getInstance("COMPATIBILITY"))||void 0===s?void 0:s._videoLargeGap)&&void 0!==a?a:0,f=null==o||null===(l=o._context)||void 0===l?void 0:l.getInstance("MP4_REMUXER"),p=null!==(c=null!==(u=null===(h=f.remuxer)||void 0===h?void 0:h.videoDtsBase)&&void 0!==u?u:null==f?void 0:f.videoDtsBase)&&void 0!==c?c:0;return this.state.dtsBase=p-d,(e+d-p-this.state.rtmpDtsGap)/1e3}var g=(null===(n=this.player)||void 0===n||null===(n=n.plugins)||void 0===n?void 0:n.flv)||(null===(r=this.player)||void 0===r||null===(r=r.plugins)||void 0===r?void 0:r.hls);if(g){var v,y=null===(v=g.core._bufferService)||void 0===v||null===(v=v._demuxer)||void 0===v||null===(v=v._fixer)||void 0===v?void 0:v._baseDts;return this.state.dtsBase=y,(e-y-this.state.rtmpDtsGap)/1e3}return(e-this.state.rtmpDtsGap)/1e3}},{key:"findSubTitleByTime",value:function(e){var t=this,i=this.state.subTitleList,n=i.findIndex((function(i){var n=t.player,r=i.lang===t.state.showLang,o=((null==n?void 0:n.__curUrl)||n.config.url)===i.url,a=i.timestamp;return a+i.duration/1e3>=e&&a<=e&&o&&r}));if(!(n<0)){var r=i.splice(0,n+1),o=r[r.length-1];return this.splitSubTitle(o)}}},{key:"splitSubTitle",value:function(e){var t="en"===e.lang?" ":"",i=e.text.split(t);if(!e.wordpiece){var n=e.duration/i.length,r=i.map((function(e,t){return{text:e,OffsetMs:n*t,duration:n}}));return a(a({},e),{},{delimiter:t,textArr:i,wordpiece:r})}return a(a({},e),{},{delimiter:t,textArr:i})}},{key:"showSurplus",value:function(){var e,t=this;if(this.state.currentSub){var i=this.state.currentSub,n=i.index,r=i.subObj,o=i.dom,a=null!=r?r:{},s=a.wordpiece,l=a.delimiter;if(!(n>=s.length)){var c=this.find(".xgplayer-subtitles-helper"),u=this.find(".xgplayer-subtitles-inner"),h=this.root,d=null!==(e=null==h?void 0:h.offsetWidth)&&void 0!==e?e:300,f=s.length,p=o.textContent;s.slice(n,f).forEach((function(e){p=p+l+e.text,c.textContent=p,c.offsetWidth>d&&(t.state.currentSub.dom=t.createNewDom(u),p=e.text),t.state.currentSub.dom.textContent=p}))}}}},{key:"createNewDom",value:function(e){if(e){e.children.length>2&&e.firstElementChild&&e.removeChild(e.firstElementChild);var t=document.createElement("span");if(e.appendChild(t),e.children.length>2){var i=e.classList.contains("scroll-1"),n=e.classList.contains("scroll-2");i&&e.classList.replace("scroll-1","scroll-2"),n&&e.classList.replace("scroll-2","scroll-1"),i||n||e.classList.add("scroll-1")}return t}}},{key:"test",value:function(){var e=this,t=this.splitSubTitle({duration:1e4,lang:"zh",text:"ä½ å¼å¸ å·²æ¹å åæ»äºææ®µæµå¹´ 离å«çä½ æ ææç½æ¥éææé,éå»çäººä¸æ¾èµ°è¿ å çªå¦å
¶æ¥æ¸©ææçæ´å¤© å å¾çå¤§é¨æèº²é¿ç屿ª",timestamp:0,url:"xxx"});this.renderSubtitle(t),setTimeout((function(){e.test()}),1e4)}},{key:"getPlayTime",value:function(){var e=this,t=this.getIsSoft();this.on(pr,(function(i){if(t){var n,r={pts:null==i||null===(n=i.detail)||void 0===n?void 0:n.pts,rtmpDtsGap:e.state.rtmpDtsGap};r.timestamp=r.pts+r.rtmpDtsGap,Ul.log("ç´æå½åæ¶é´æ³ï¼",r.timestamp,r)}else{var o={currentTime:1e3*e.player.video.currentTime,dtsBase:e.state.dtsBase,rtmpDtsGap:e.state.rtmpDtsGap};o.timestamp=o.currentTime+o.dtsBase+o.rtmpDtsGap,Ul.log("ç´æå½åæ¶é´æ³ï¼",o.timestamp,o)}}))}},{key:"resetDom",value:function(e){e&&(this.state.currentSub=null,e&&(e.innerHTML="",e.classList.remove("scroll-1","scroll-2")))}},{key:"render",value:function(){return'<xg-subtitles class="xgplayer-subtitles"><xg-subtitles-inner class="xgplayer-subtitles-inner"></xg-subtitles-inner><xg-subtitles-helper class="xgplayer-subtitles-helper"></xg-helper></xg-subtitles>'}}],[{key:"pluginName",get:function(){return"LiveSubtitlesPlugin"}},{key:"defaultConfig",get:function(){return{position:Bo.POSITIONS.ROOT,showLang:""}}}]),i}(Bo),KV=Bo.POSITIONS,YV=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).isMobile="mobile"===ir.device,n.isOpenState=!0,n.optionList=null,n.currentLang="",n}return f(i,[{key:"afterCreate",value:function(){this.appendChild(".xgplayer-icon",this.icons.aiSubOpen),this.appendChild(".xgplayer-icon",this.icons.aiSubClose),this.renderOptionList(),this.initEvents(),this.currentLang=this.config.default,this.config.defaultOpen?this.open(!0):this.close()}},{key:"afterPlayerInit",value:function(){this.config.defaultOpen&&this.changeSubTitleLang(this.config.default,!0)}},{key:"registerIcons",value:function(){return{aiSubOpen:{icon:lH,class:"xgplayer-aisub-open-svg"},aiSubClose:{icon:cH,class:"xgplayer-aisub-close-svg"}}}},{key:"registerLanguageTexts",value:function(){return{sub:{jp:"AI åå¹",en:"AI Subt
1itles",zh:"AI åå¹","zh-hk":"AI åå¹"},subOpen:{jp:"åå¹ããªã³ã«ãã",en:"Show subtitles",zh:"å¼å¯åå¹","zh-hk":"éååå¹"},subClose:{jp:"ã¯ãã¼ãºããã£ãã·ã§ã³",en:"Hide subtitles",zh:"å
³éåå¹","zh-hk":"ééåå¹"}}}},{key:"children",value:function(){return{LiveSubTitlesPlugin:{plugin:WV,options:{root:this.player.root,showLang:this.currentLang}}}}},{key:"initEvents",value:function(){this.bind(["click"],this.handleButtonChange.bind(this)),this.bind(["mouseenter"],this.showPanel.bind(this)),this.bind(["mouseleave"],this.hidePanel.bind(this))}},{key:"handleButtonChange",value:function(){this.close=this.close.bind(this),this.open=this.open.bind(this),this.isMobile?this.showMobilePanel():(this.isOpenState?this.close:this.open)()}},{key:"showMobilePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player.panel)||void 0===e||e.showPanel(t,this.langText.sub,!0)}},{key:"renderItemList",value:function(){var e=this,t=E(this.config.list),i=qn.createDom("div","",{},"ai-panel-content");return t.push({key:"",showText:this.langText.subClose}),t.forEach((function(t){var n=e.renderItem(t);i.appendChild(n)})),i}},{key:"renderItem",value:function(e){var t=this,i=""===e.key&&!this.isOpenState||this.currentLang===e.key&&this.isOpenState,n=qn.createDom("div","",{},"panel-Item ".concat(i?"select-in":""));return n.innerHTML=e.showText,n.addEventListener("click",(function(i){i.stopPropagation(),i.preventDefault(),t.changeSubTitleLang(e.key),t.updatePanel()})),n}},{key:"updatePanel",value:function(){var e,t=this.renderItemList();null===(e=this.player.panel)||void 0===e||e.updatePanel(t)}},{key:"showPanel",value:function(){var e;!this.isMobile&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.show())}},{key:"hidePanel",value:function(){var e;!this.isMobile&&this.isOpenState&&(null===(e=this.optionList)||void 0===e||e.hide())}},{key:"open",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isOpenState=!0,qn.removeClass(this.root,"isClose"),qn.addClass(this.root,"isOpen"),!e&&this.showPanel(),this.toggleSubTitle()}},{key:"close",value:function(){var e;this.isOpenState=!1,qn.removeClass(this.root,"isOpen"),qn.addClass(this.root,"isClose"),null===(e=this.optionList)||void 0===e||e.hide(),this.toggleSubTitle()}},{key:"renderOptionList",value:function(){var e,t=this;if(!((null===(e=this.config.list)||void 0===e?void 0:e.length)<2||this.isMobile)){var i={config:{data:this.config.list.map((function(e){return e.key===t.config.default&&(e.isCurrent=!0,e.selected=!0),e})),className:"",onItemClick:function(e,i){var n;e.stopPropagation(),e.preventDefault(),t.changeSubTitleLang(null===(n=i.to)||void 0===n?void 0:n.key)}},root:this.root};this.optionList=new Us(i)}}},{key:"changeSubTitleLang",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.currentLang=e,e?this.open(t):this.close()}},{key:"toggleSubTitle",value:function(){var e;null===(e=this.player.getPlugin("LiveSubtitlesPlugin"))||void 0===e||e.setCurrentLang(this.isOpenState?this.currentLang:"")}},{key:"destroy",value:function(){var e;this.unbind(["click"],this.handleButtonChange.bind(this)),this.unbind(["mouseenter"],this.showPanel.bind(this)),this.unbind(["mouseleave"],this.hidePanel.bind(this)),null===(e=this.optionList)||void 0===e||e.destroy()}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-aisub">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="subOpen">'.concat(this.langText.subOpen,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"LiveSubtitlesIconPlugin"}},{key:"defaultConfig",get:function(){return{position:KV.CONTROLS_RIGHT,index:2.7,defaultOpen:!0,default:"en",list:[{key:"zh",showText:"䏿"},{key:"en",showText:"En"}]}}}]),i}(Bo),$V="function"==typeof r,qV=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),XV=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),JV=(GV={},XV.forEach((function(e,t){return GV[e]=t})),String.fromCharCode.bind(String)),ZV=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),function(e){return e.replace(/=/g,"").replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"}))}),QV=function(e){for(var t,i,n,r,o="",a=e.length%3,s=0;s<e.length;){if((i=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");o+=XV[(t=i<<16|n<<8|r)>>18&63]+XV[t>>12&63]+XV[t>>6&63]+XV[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},ez="function"==typeof btoa?function(e){return btoa(e)}:$V?function(e){return r.from(e,"binary").toString("base64")}:QV,tz=$V?function(e){return r.from(e).toString("base64")}:function(e){for(var t=[],i=0,n=e.length;i<n;i+=4096)t.push(JV.apply(null,e.subarray(i,i+4096)));return ez(t.join(""))},iz=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?JV(192|t>>>6)+JV(128|63&t):JV(224|t>>>12&15)+JV(128|t>>>6&63)+JV(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return JV(240|t>>>18&7)+JV(128|t>>>12&63)+JV(128|t>>>6&63)+JV(128|63&t)},nz=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,rz=function(e){return e.replace(nz,iz)},oz=$V?function(e){return r.from(e,"utf8").toString("base64")}:qV?function(e){return tz(qV.encode(e))}:function(e){return ez(rz(e))},az=function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?ZV(oz(e)):oz(e)},sz=az,lz={};!function(e){e._getPrivFilters=function(){var e,t=/</g,i=/"/g,n=/'/g,r=/&/g,o=/\x00/g,a=/(?:^$|[\x00\x09-\x0D "'`=<>])/g,s=/[&<>"'`]/g,l=/(?:\x00|^-*!?>|--!?>|--?!?$|\]>|\]$)/g,c=/&(?:#([xX][0-9A-Fa-f]+|\d+);?|(Tab|NewLine|colon|semi|lpar|rpar|apos|sol|comma|excl|ast|midast|ensp|emsp|thinsp);|(nbsp|amp|AMP|lt|LT|gt|GT|quot|QUOT);?)/g,u={Tab:"\t",NewLine:"\n",colon:":",semi:";",lpar:"(",rpar:")",apos:"'",sol:"/",comma:",",excl:"!",ast:"*",midast:"*",ensp:"â",emsp:"â",thinsp:"â",nbsp:" ",amp:"&",lt:"<",gt:">",quot:'"',QUOT:'"'},h=/^(?:(?!-*expression)#?[-\w]+|[+-]?(?:\d+|\d*\.\d+)(?:r?em|ex|ch|cm|mm|in|px|pt|pc|%|vh|vw|vmin|vmax)?|!important|)$/i,d=/[\x00-\x1F\x7F\[\]{}\\"]/g,f=/[\x00-\x1F\x7F\[\]{}\\']/g,p=/url[\(\u207D\u208D]+/g,g=/['\(\)]/g,v=/\/\/%5[Bb]([A-Fa-f0-9:]+)%5[Dd]/,y={javascript:1,data:1,vbscript:1,mhtml:1,"x-schema":1},m=/(?::|&#[xX]0*3[aA];?|�*58;?|:)/,_=/(?:^[\x00-\x20]+|[\t\n\r\x00]+)/g,b={Tab:"\t",NewLine:"\n"},k=function(e,t,i){return void 0===e?"undefined":null===e?"null":e.toString().replace(t,i)},w=String.fromCodePoint||function(e){return 0===arguments.length?"":e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),e%1024+56320))};function S(e){var t=e.split(m,2);return!t[0]||2!==t.length&&e.length===t[0].length?null:t[0]}function T(t,i,n,r){return i=i||u,n=n||c,void 0===t?"undefined":null===t?"null":t.toString().replace(o,"�").replace(n,(function(t,n,o,a){return n?(n=Number(n[0]<="9"?n:"0"+n),r?w(n):128===n?"â¬":130===n?"â":131===n?"Æ":132===n?"â":133===n?"â¦":134===n?"â ":135===n?"â¡":136===n?"Ë":137===n?"â°":138===n?"Å ":139===n?"â¹":140===n?"Å":142===n?"Ž":145===n?"â":146===n?"â":147===n?"â":148===n?"â":149===n?"â¢":150===n?"â":151===n?"â":152===n?"Ë":153===n?"â¢":154===n?"Å¡":155===n?"âº":156===n?"Å":158===n?"ž":159===n?"Ÿ":n>=55296&&n<=57343||13===n?"�":e.frCoPt(n)):i[o||a]||t}))}function E(e){return"\\"+e.charCodeAt(0).toString(16).toLowerCase()+" "}function C(e){return e.replace(p,(function(e){return"-x-"+e}))}function x(t){var i=S(t=e.yufull(T(t)));return i&&y[i.toLowerCase()]?"##"+t:t}return e={frCoPt:function(e){return null==e?"":!isFinite(e=Number(e))||e<=0||e>1114111||e>=1&&e<=8||e>=14&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||11===e||65535==(65535&e)||65534==(65535&e)?"�":w(e)},d:T,yup:function(e){return(e=S(e.replace(o,"")))?T(e,b,null,!0).replace(_,"").toLowerCase():null},y:function(e){return k(e,s,(function(e){return"&"===e?"&":"<"===e?"<":">"===e?">
1":'"'===e?""":"'"===e?"'":"`"}))},ya:function(e){return k(e,r,"&")},yd:function(e){return k(e,t,"<")},yc:function(e){return k(e,l,(function(e){return"\0"===e?"�":"--!"===e||"--"===e||"-"===e||"]"===e?e+" ":e.slice(0,-1)+" >"}))},yavd:function(e){return k(e,i,""")},yavs:function(e){return k(e,n,"'")},yavu:function(e){return k(e,a,(function(e){return"\t"===e?"	":"\n"===e?" ":"\v"===e?"":"\f"===e?"":"\r"===e?" ":" "===e?" ":"="===e?"=":"<"===e?"<":">"===e?">":'"'===e?""":"'"===e?"'":"`"===e?"`":"�"}))},yu:encodeURI,yuc:encodeURIComponent,yubl:function(t){return y[e.yup(t)]?"x-"+t:t},yufull:function(t){return e.yu(t).replace(v,(function(e,t){return"//["+t+"]"}))},yublf:function(t){return e.yubl(e.yufull(t))},yceu:function(e){return e=T(e),h.test(e)?e:";-x:'"+C(e.replace(f,E))+"';-v:"},yced:function(e){return C(T(e).replace(d,E))},yces:function(e){return C(T(e).replace(f,E))},yceuu:function(e){return x(e).replace(g,(function(e){return"'"===e?"\\27 ":"("===e?"%28":"%29"}))},yceud:function(e){return x(e)},yceus:function(e){return x(e).replace(n,"\\27 ")}}};var t=e._privFilters=e._getPrivFilters();function i(e,i,n){return t.yubl(i((n||t.yufull)(e)))}e.inHTMLData=t.yd,e.inHTMLComment=t.yc,e.inSingleQuotedAttr=t.yavs,e.inDoubleQuotedAttr=t.yavd,e.inUnQuotedAttr=t.yavu,e.uriInSingleQuotedAttr=function(e){return i(e,t.yavs)},e.uriInDoubleQuotedAttr=function(e){return i(e,t.yavd)},e.uriInUnQuotedAttr=function(e){return i(e,t.yavu)},e.uriInHTMLData=t.yufull,e.uriInHTMLComment=function(e){return t.yc(t.yufull(e))},e.uriPathInSingleQuotedAttr=function(e){return i(e,t.yavs,t.yu)},e.uriPathInDoubleQuotedAttr=function(e){return i(e,t.yavd,t.yu)},e.uriPathInUnQuotedAttr=function(e){return i(e,t.yavu,t.yu)},e.uriPathInHTMLData=t.yu,e.uriPathInHTMLComment=function(e){return t.yc(t.yu(e))},e.uriQueryInSingleQuotedAttr=e.uriPathInSingleQuotedAttr,e.uriQueryInDoubleQuotedAttr=e.uriPathInDoubleQuotedAttr,e.uriQueryInUnQuotedAttr=e.uriPathInUnQuotedAttr,e.uriQueryInHTMLData=e.uriPathInHTMLData,e.uriQueryInHTMLComment=e.uriPathInHTMLComment,e.uriComponentInSingleQuotedAttr=function(e){return t.yavs(t.yuc(e))},e.uriComponentInDoubleQuotedAttr=function(e){return t.yavd(t.yuc(e))},e.uriComponentInUnQuotedAttr=function(e){return t.yavu(t.yuc(e))},e.uriComponentInHTMLData=t.yuc,e.uriComponentInHTMLComment=function(e){return t.yc(t.yuc(e))},e.uriFragmentInSingleQuotedAttr=function(e){return t.yubl(t.yavs(t.yuc(e)))},e.uriFragmentInDoubleQuotedAttr=function(e){return t.yubl(t.yavd(t.yuc(e)))},e.uriFragmentInUnQuotedAttr=function(e){return t.yubl(t.yavu(t.yuc(e)))},e.uriFragmentInHTMLData=e.uriComponentInHTMLData,e.uriFragmentInHTMLComment=e.uriComponentInHTMLComment}(lz);var cz="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; pointer-events: none; z-index: 9999; font-size: 14px; display: block;",uz={SLOW:.5,MODERATE:1,FAST:2},hz={SLOW:5,MODERATE:3.5,FAST:2},dz={style:{node:cz,wrap:"",img:""},class:{node:"",wrap:"xg-dynamic-watermark",img:""}};function fz(e,t){var i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach((function(e){i.setAttribute(e,t[e])})),i}var pz=function(){function e(t){h(this,e),this.root=t.root,this.config=t,this.wrap=document.createElement("div"),this.img=document.createElement("img"),this.imgSrc="",this.root&&this.root.appendChild(this.wrap),this.moveTimer=null,this.blinkTimer=null,this.pauseAnimation=!1,this.observer=[]}return f(e,[{key:"_getWatermarkDom",value:function(){var e=this.config,t=e.content,i=void 0===t?"":t,n=e.fontFamily,r=i,o="string"==typeof this.config.fontSize?"".concat(this.config.fontSize):"".concat(this.config.fontSize,"px"),s=document.createElement("text");s.style.fontSize=o,s.style.whiteSpace="nowrap",n&&(s.style.fontFamily=n),s.innerHTML=lz.inHTMLData(r),document.body.appendChild(s);var l=fz("svg",{xmlns:"http://www.w3.org/2000/svg",width:s.offsetWidth+2,height:s.offsetHeight}),c=fz("text",a({x:s.offsetWidth/2,y:s.offsetHeight/2,style:"\n fill:".concat(this.config.fontColor,";\n text-anchor: middle;\n alignment-baseline:middle;\n opacity: ").concat(this.config.opacity,";\n font-size: ").concat(o,";\n ")},n?{"font-family":n}:{}));return c.innerHTML=lz.inHTMLData(r),document.body.removeChild(s),l.appendChild(c),"data:image/svg+xml;base64, "+sz((new XMLSerializer).serializeToString(l))}},{key:"_startRender",value:function(){switch(this.pauseAnimation=!1,this.config.displayType){case 0:this._fixedRender();break;case 1:this._startMove();break;case 2:this._startBlink()}this.observer[0]=this._attrObserver(this.img,["src","class"],"img"),this.observer[1]=this._attrObserver(this.wrap,["class","style","id"],"node"),this.observer[2]=this._attrObserver(this.root,["class","style"],"wrap"),this.observer[3]=this._domObserver(this.wrap),this.observer[4]=this._domObserver(this.root),this.observer[5]=this._domObserver(this.root.parentElement,!0)}},{key:"_startMove",value:function(){var e,t=this;if(this.img&&null!==(e=this.wrap)&&void 0!==e&&e.clientWidth){var i=this._getOffset(),n=i.offsetX,r=i.offsetY,o=uz[this.config.tickerSpeed]||uz.MODERATE,a=n,s=o,l=r,c=o;clearInterval(this.moveTimer),this.moveTimer=setInterval((function(){if(!t.pauseAnimation){var e=t._getOffsetThreshold();a+=s,l+=c,t.wrap.offsetWidth>t.img.offsetWidth&&a>t.wrap.offsetWidth&&(a=t.wrap.offsetWidth-t.img.offsetWidth),t.wrap.offsetHeight>t.img.offsetHeight&&l>t.wrap.offsetHeight&&(l=t.wrap.offsetHeight-t.img.offsetHeight),t.img.setAttribute("style","position: relative;
1left:".concat(a,"px; top:").concat(l,"px")),a>=e.hRight&&(s=-o),a<=e.hLeft&&(s=o),l>=e.vBottom&&(c=-o),l<=e.vTop&&(c=o)}}),30)}}},{key:"_startBlink",value:function(){var e=this,t=hz[this.config.tickerSpeed]||hz.MODERATE;clearInterval(this.blinkTimer),this._blinkRender(t,!0),this.blinkTimer=setInterval((function(){e.pauseAnimation||e._blinkRender(t)}),1e3*t)}},{key:"_randomBetween",value:function(e,t){var i=t-e+1;return Math.floor(Math.random()*i)+e}},{key:"_fixedRender",value:function(){var e;if(this.img&&null!==(e=this.wrap)&&void 0!==e&&e.clientWidth){this.img.setAttribute("style","");var t=this._getOffset(),i=t.offsetX,n=t.offsetY,r=hz[this.config.tickerSpeed];return r?this.img.setAttribute("style","opacity: 0.1;transform: translate(".concat(i,"px, ").concat(n,"px);animation: _xg_animation_blink ").concat(r,"s linear infinite;")):this.img.setAttribute("style","opacity: 1;transform: translate(".concat(i,"px, ").concat(n,"px);"))}}},{key:"_getOffset",value:function(){var e=this.config,t=e.left,i=e.top,n=e.right,r=e.bottom,o=this.wrap,a=o.clientWidth,s=o.clientHeight,l=this.img,c=l.clientWidth,u=l.clientHeight,h=0,d=0;return void 0!==n&&a&&(h=a-c-n),void 0!==t&&a&&(h=t),void 0!==r&&s&&(d=s-u-r),void 0!==i&&s&&(d=i),{offsetX:h,offsetY:d}}},{key:"_getOffsetThreshold",value:function(){var e=this.wrap,t=e.clientWidth,i=e.clientHeight,n=this.img,r=n.clientWidth,o=n.clientHeight;return{hLeft:t-r>=0?0:t-r,hRight:t-r>=0?t-r:0,vTop:i-o>=0?0:i-o,vBottom:i-o>=0?i-o:0}}},{key:"_blinkRender",value:function(e,t){var i,n=this;if(this.img&&null!==(i=this.wrap)&&void 0!==i&&i.clientWidth){if(this.img.setAttribute("style","opacity: 0.1;"),t){var r=this._getOffset(),o=r.offsetX,a=r.offsetY;return this.img.setAttribute("style","opacity: 0.1;transform: translate(".concat(o,"px, ").concat(a,"px);animation: _xg_animation_blink ").concat(e,"s linear 1;"))}var s=this._getOffsetThreshold(),l=this.wrap,c=l.clientWidth,u=l.clientHeight,h=c?this._randomBetween(s.hLeft,s.hRight):0,d=u?this._randomBetween(s.vTop,s.vBottom):0;setTimeout((function(){n.img.setAttribute("style","opacity: 0.1;transform: translate(".concat(h,"px, ").concat(d,"px);animation: _xg_animation_blink ").concat(e,"s linear 1;"))}),10)}}},{key:"_attrObserver",value:function(e,t,i){var n=this;if(e&&this.wrap&&window.MutationObserver){var r=new window.MutationObserver((function(t){e&&n.wrap&&t.forEach((function(t){if("class"===t.attributeName&&e.getAttribute("class")!=dz.class[i]&&e.setAttribute("class",dz.class[i]),"style"===t.attributeName&&e.getAttribute("style")!=dz.style[i]&&e.setAttribute("style",dz.style[i]),"img"===i&&"src"===t.attributeName&&((null==e?void 0:e.getAttribute("src"))||"")!==n.imgSrc){var r=n._getWatermarkDom();n.wrap&&r&&(n.imgSrc=r,e.setAttribute("src",r))}}))}));return r.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:t}),r}}},{key:"_domObserver",value:function(e,t){var i=this;if(e&&this.wrap){var n=new window.MutationObserver((function(n){e&&i.wrap&&n.forEach((function(n){n.removedNodes.forEach((function(n){if(!t)return e.appendChild(n);!e.getElementsByClassName(i.config.rootClassName).length&&e.appendChild(n)}))}))}));return n.observe(e,{childList:!0}),n}}},{key:"update",value:function(){var e=this._getWatermarkDom();this.wrap&&this.img&&e&&(this.imgSrc=e,this.img.setAttribute("src",e))}},{key:"start",value:function(){var e=this;if(this.root&&this.wrap&&this.img){clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((function(e){var t;null==e||null===(t=e.disconnect)||void 0===t||t.call(e)})),this.wrap.innerHTML="",this.wrap.setAttribute("style",cz);var t=this._getWatermarkDom();t&&(this.img.src=t,this.img.style.opacity="0",this.img.alt="",this.imgSrc=t,this.wrap.appendChild(this.img),setTimeout((function(){return e._startRender()})))}}},{key:"pause",value:function(){this.pauseAnimation=!0}},{key:"resume",value:function(){this.pauseAnimation=!1}},{key:"resize",value:function(){}},{key:"destroy",value:function(){clearInterval(this.moveTimer),clearInterval(this.blinkTimer),this.observer.forEach((function(e){var t;null==e||null===(t=e.disconnect)||void 0===t||t.call(e)})),this.img=null,this.wrap.innerHTML="",this.wrap=null}}]),e}(),gz="xg-dynamic-watermark",vz=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).wm=null,n}return f(i,[{key:"afterCreate",value:function(){var e=this;this.config.enable&&(this._initWatermark(),this.once(pr,(function(){e.start()})),this.on(Gr,(function(){e.resize()})))}},{key:"start",value:function(){var e,t;null===(e=this.wm)||void 0===e||null===(t=e.start)||void 0===t||t.call(e)}},{key:"pause",value:function(){var e,t;null===(e=this.wm)||void 0===e||null===(t=e.pause)||void 0===t||t.call(e)}},{key:"resume",value:function(){var e,t;null===(e=this.wm)||void 0===e||null===(t=e.resume)||void 0===t||t.call(e)}},{key:"resize",value:function(){var e,t;null===(e=this.wm)||void 0===e||null===(t=e.resize)||void 0===t||t.call(e)}},{key:"_initWatermark",value:function(){this.wm=new pz(a(a({},this.config),{},{root:this.root,rootClassName:gz}))}},{key:"destroy",value:function(){var e,t;null===(e=this.wm)||void 0===e||null===(t=e.destroy)||void 0===t||t.call(e),this.offAll()}},{key:"render",value:function(){return"\n <xg-dynamic-watermark class=".concat(gz," />\n ")}}],[{key:"pluginName",get:function(){return"DynamicWatermark"}},{key:"defaultConfig",get:function(){return{position:Bo.POSITIONS.ROOT,displayType:1,tickerSpeed:void 0,fontSize:12,fontColor:"#ffffff",opacity:.3,enable:!1,top:void 0,left:void 0,right:void 0,bottom:void 0,content:""}}}]),i}(Bo),yz=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).waitings=[],n.longWaitingEmitTime=0,n.waitingStartTime=0,n.playerData=null,n.playerData=n.playerConfig.playerData,n}return f(i,[{key:"registerLanguageTexts",value:function(){return{definition_demote_txt:{jp:"ç¾å¨ã®ãããã¯ã¼ã¯ã¯ä¸å®å®ã§ããã«åãæ¿ãããã¨ããå§ããã¾ã",en:"The current network is unstable, it is recommended to switch to ",zh:"å½åç½ç»ä¸ç¨³å®ï¼å»ºè®®åæ¢å°","zh-hk":"ç¶å網絡ä¸ç©©å®ï¼å»ºè°åæå°"}}}},{key:"afterCreate",value:function(){this.bindCtx(),this.bindEvents()}},{key:"bindCtx",value:function(){this._count=this._count.bind(this),this._time=this._time.bind(this),this._waiting=this._waiting.bind(this),this._clearTime=this._clearTime.bind(this),this.demote=this.demote.bind(this)}},{key:"bindEvents",value:function(){this.on(gr,this._waiting),this.on(ur,this._clearTime),this.on(sr,this._clearTime),this.on(Fr,this._clearTime),this.on(PM.PlAY_URL_CHANGE,this._clearTime),this.config.isNeedAutoDemote&&this.player.on(PM.LONG_WAITING,this.demote)}},{key:"_waiting",value:function(){this._count(),this._time()}},{key:"_count",value:function(){var e=Date.now();this.waitings.push(e);var t=this.config,i=t.oftenWaitingCount,n=t.oftenWaitingTime;if(this.waitings.length>=i){var r=this.waitings.shift();r&&e-r<=n&&(Ul.warn("stuttering occurred at least ".concat(i," times within ").concat(n,"ms")),this.player.emit(PM.OFTEN_WAITING)),this.clearState()}}},{key:"_time",value:function(){var e=this;if(this.timer)Ul.log("The stuttering was triggered continuously, and the interval since the last stuttering was ","".concat(Date.now()-this.waitingStartTime,"ms"));else{this.waitingStartTime=Date.now();var t=this.player.currentTime;this.timer=setTimeout((function(){e.player&&e.player.currentTime<=t+.1&&(Ul.warn("stuttering last more than ".concat(e.config.longWaitingTime,"ms")),e.player.emit(PM.LONG_WAITING),e.timer&&(clearTimeout(e.timer),e.timer=null),e.waitingStartTime&&(e.waitingStartTime=0))}),this.config.longWaitingTime)}}},{key:"_clearTime",value:function(){this.waitingStartTime&&Ul.log("stuttering last for ","".concat(Date.now()-this.waitingStartTime,"ms")),this.clearState()}},{key:"clearState",value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.waitings.length>0&&(this.waitings=[]),this.waitingStartTime&&(this.waitingStartTime=0)}},{key:"demote",value:function(){if(!this.player.checkBuffer(this.player.currentTime,{endDiff:.5,startDiff:.5})&&!this.player.isSeeking&&this.player.state===qo.RUNNING&&this.player.currentTime>1){if(!this.playerData)return;var e=this.playerData.getNextDefinition(!0,this.config.demotePriority),t=null==e?void 0:e[0];if(!t||!t.url)return;var i=t.definition;if(!i)return;var n=this.playerData.current.definition;if(this.player.emit(PM.DEFINITION_DEMOTE,{currentDef:n,willChangeDef:i,next:t}),"auto"===n){var r=t.url;Ul.log("auto demote definition to ".concat(t.definition)),this.changeUrl(r)}else i!==n&&this.showToast(t)}else Ul.log("stuttering but not need demote definition")}},{key:"changeUrl",value:function(e){this.player&&e&&(this.player.config.url=e,this.player.switchURL(e,{seamless:!this.player.config.isLive}).then((function(){Ul.log("auto demote definition switch url(".concat(e,") success"))})),this.player.emit(PM.PlAY_URL_CHANGE,{url:e,from:"definition_demote"}))}},{key:"showToast",value:function(e){var t,i=this,n=null===(t=this.player)||void 0===t?void 0:t.getPlugin("sdkToastPlugin");if(n&&(this.toastId&&(n.remove(this.toastId),this.toastId=null),this.config.isNeedShowTips)){var r=this.i18n[e.definitionTextKey]||e.definitionTextKey||e.definition,o=qn.createDom("div",this.langText.definition_demote_txt,void 0,"toast-txt"),a=qn.createDom("span",r,void 0,"toast-txt-bt");o.appendChild(a),this.toastId=n.add(o,this.config.toastShowTime,!0),a.addEventListener("click",(function(){i.playerData&&(i.playerData.current.definition=e.definition,n.remove(i.toastId),i.toastId=null,Ul.log("user handle demote definition to ".concat(e.definition)))}))}}},{key:"destroy",value:function(){this.clearState()}}],[{key:"pluginName",get:function(){return"DefinitionDemotePlugin"}},{key:"defaultConfig",get:function(){return{isNeedAutoDemote:!0,toastShowTime:3e3,demotePriority:[],isNeedShowTips:!0,oftenWaitingCount:3,oftenWaitingTime:5e3,longWaitingTime:5e3}}}]),i}(Bo),mz=Bo.POSITIONS,_z=604800,bz=function(e){g(i,e);var t=k(i);function i(){var e;return h(this,i),(e=t.apply(this,arguments)).isMobile="mobile"===ir.device,e.playedBar=null,e.cachedBar=null,e.innerBar=null,e.progressBtn=null,e.progressPoint=null,e.backLiveBt=null,e.cardDomList=[],e.initTime=0,e.liveGap=0,e.shiftTimeGap=0,e.isProgressMoving=!1,e.isPlayTimeShift=!1,e.liveUrl="",e.onBodyClick=function(e){e.preventDefault(),e.stopPropagation(),qn.event(e)},e}return f(i,[{key:"duration",get:function(){var e,t=this.liveGap+Math.floor(Date.now()/1e3-this.initTime),i=(null!==(e=this.config)&&void 0!==e?e:{}).maxMoveTime;return i&&t>i?i:t>_z?_z:t}},{key:"registerLanguageTexts",value:function(){return{BACKLIVE:{jp:"ã©ã¤ãã«æ»ã",en:"Back to live",zh:"è¿åç´æ","zh-hk":"è¿åç´æ"}}}},{key:"updateLang",value:function(){this.backLiveBt&&(this.backLiveBt.innerHTML=this.langText.BACKLIVE)}},{key:"afterCreate",value:function(){this.liveUrl=this.player.config.url,this.playedBar=this.find(".xgplayer-progress-played"),this.cachedBar=this.find(".xgplayer-progress-cache"),this.progressBtn=this.find(".xgplayer-progress-btn"),this.progressPoint=this.find(".xgplayer-shift-progress-point"),this.innerBar=this.find(".xgplayer-progress-inner"),this.createBackLiveBtDom(),this.clacTime(),this.initEvents(),this.bindDomEvents(),this.isMobile||this.createTimeShiftCard()}},{key:"clacTime",value:function(){var e,t=null!==(e=this.config)&&void 0!==e?e:{},i=t.livingStartTime,n=t.currentTime;this.initTime=Math.floor(Date.now()/1e3),this.liveGap=Math.floor(n-i)}},{key:"initEvents",value:function(){this.on(pr,this.handleTimeUpdate.bind(this))}},{key:"bindDomEvents",value:function(){if(this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.tipsUpdate=this.tipsUpdate.bind(this),this.isMobile){this.bind("touchstart",this.handleMouseDown);var e=this.player.controls;e&&(e.root&&e.root.addEventListener("touchmove",qn.stopPropagation),e.center&&e.center.addEventListener("touchend",qn.stopPropagation))}else this.bind("mousedown",this.handleMouseDown),this.bind("mouseenter",this.handleMouseEnter)}},{key:"handleTimeUpdate",value:function(){this.isProgressMoving||this.progressUpdate()}},{key:"handleMouseDown",value:function(e){if(e.target!==this.backLiveBt){this.onBodyClick(e),this.focus(),qn.addClass(this.progressBtn,"active");var t=this.computeTime(e);this.updateShiftTime(t.percent),this.isProgressMoving=!0,this.isMobile?(this.bind("touchmove",this.handleMouseMove),this.bind("touchend",this.handleMouseUp)):(document.addEventListener("mousemove",this.handleMouseMove,!1),document.addEventListener("mouseup",this.handleMouseUp,!1))}}},{key:"handleMouseMove",value:function(e){this.onBodyClick(e);var t=this.computeTime(e);this.updateShiftTime(t.percent)}
1},{key:"handleMouseUp",value:function(e){this.onBodyClick(e),this.isProgressMoving=!1,qn.removeClass(this.progressBtn,"active"),this.changeTimeUrl(),this.isMobile?(this.unbind("touchmove",this.handleMouseMove),this.unbind("touchend",this.handleMouseUp)):(document.removeEventListener("mousemove",this.handleMouseMove,!1),document.removeEventListener("mouseup",this.handleMouseUp,!1))}},{key:"handleMouseEnter",value:function(e){this.bind("mouseleave",this.handleMouseLeave),this.bind("mousemove",this.tipsUpdate),this.tipsUpdate(e),this.focus()}},{key:"handleMouseLeave",value:function(){this.unbind("mouseleave",this.handleMouseLeave),this.unbind("mousemove",this.tipsUpdate),this.blur()}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),qn.addClass(this.root,"active")}},{key:"blur",value:function(){this.player.controls.recoverAutoHide(),qn.removeClass(this.root,"active")}},{key:"computeTime",value:function(e){var t,i,n,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,l=o.top,c=o.left,u=qn.getEventPos(e,r.zoom);90===r.rotateDeg?(t=s,i=l,n=u.clientY):(t=a,i=c,n=u.clientX);var h=n-i,d=(h=h>t?t:h<0?0:h)/t;return{percent:d=d<0?0:d>1?1:d,offset:h,width:t,left:i,e:e}}},{key:"tipsUpdate",value:function(e){var t,i,n,r,o,a=this.computeTime(e),s=Math.floor(this.duration*(1-a.percent));this.progressPoint.style.left="".concat(100*a.percent,"%"),this.progressPoint.innerHTML="-".concat((t=s,i=Math.floor(t/3600),n=t%3600,r=Math.floor(n/60),o=Math.round(n%60),i>0?(r<10&&(r="0"+r),o<10&&(o="0"+o),"".concat(i,":").concat(r,":").concat(o)):(o<10&&(o="0"+o),"".concat(r,":").concat(o))))}},{key:"updateShiftTime",value:function(e){this.shiftTimeGap=Math.floor(this.duration*(1-e)),this.progressUpdate()}},{key:"getCurrentProgress",value:function(){return Math.floor(this.duration-this.shiftTimeGap)}},{key:"progressUpdate",value:function(){var e=this.getCurrentProgress()/this.duration;this.progressBtn.style.left="".concat(100*e,"%"),this.playedBar.style.width="".concat(100*e,"%"),this.cardProcessUpdate()}},{key:"changeTimeShift",value:function(e){var t=this.calcCardProcess(e);t<0||(this.updateShiftTime(t),this.changeTimeUrl())}},{key:"changeTimeUrl",value:function(){var e=this.config.timeShiftUrl,t="";this.isPlayTimeShift=!0,this.toggleBackButton();var i=this.shiftTimeGap<6?6:this.shiftTimeGap;t=e?e.replace("{}",i):function(e,t){if(!t)return e;var i=Object.entries(t).map((function(e){var t=T(e,2),i=t[0],n=t[1];return"".concat(i,"=").concat(null!=n?n:"")})).join("&");return e+(-1===e.indexOf("?")?"?":"&")+i}(this.liveUrl,{timeshift:i}),this.player.src=t,this.player.config.url=t,this.player.emit(PM.TIME_SHIFT_CHANGE,!0),this.player.emit(PM.PlAY_URL_CHANGE,{shiftUrl:t,from:PM.TIME_SHIFT_CHANGE})}},{key:"createBackLiveBtDom",value:function(){var e,t=this;if(this.backLiveBt)return this.backLiveBt;this.backLiveBt=qn.createDom("xg-back-live-bt",this.langText.BACKLIVE,void 0,"xgplayer-back-live-bt"),this.backLiveBt.addEventListener("click",(function(e){t.onBodyClick(e),t.backLive()})),null===(e=this.player.root)||void 0===e||e.appendChild(this.backLiveBt)}},{key:"backLive",value:function(){this.liveUrl&&(this.player.src=this.liveUrl,this.player.config.url=this.liveUrl,this.shiftTimeGap=0,this.isPlayTimeShift=!1,this.toggleBackButton(),this.player.emit(PM.TIME_SHIFT_CHANGE,!1),this.player.emit(PM.PlAY_URL_CHANGE,{url:this.liveUrl,from:PM.TIME_SHIFT_CHANGE}))}},{key:"toggleBackButton",value:function(){this.backLiveBt&&(this.backLiveBt.style.display=this.isPlayTimeShift?"flex":"none")}},{key:"updateCardList",value:function(e){this.config.cardList=E(e),this.clearCardDom(),this.createTimeShiftCard()}},{key:"clearCardDom",value:function(){var e=this;this.cardDomList.forEach((function(t){t.dom&&e.innerBar.contains(t.dom)&&e.innerBar.removeChild(t.dom)})),this.cardDomList=[]}},{key:"createTimeShiftCard",value:function(){var e,t=this;(null===(e=this.config.cardList)||void 0===e?void 0:e.length)<=0||this.config.cardList.forEach((function(e){t.renderCard(e)}))}},{key:"renderCard",value:function(e){if(e.img){var t=qn.createDom("xg-card","",void 0,"xgplayer-shift-progress-card"),i=qn.createDom("img","",{src:e.img},"xgplayer-shift-progress-card-img"),n=qn.createDom("div","",void 0,"xgplayer-shift-progress-card-point");t.appendChild(i),t.appendChild(n),this.cardDomList.push(a(a({},e),{},{dom:t}))}}},{key:"cardProcessUpdate",value:function(){var e=this;0!==this.cardDomList.length&&this.cardDomList.forEach((function(t){if(t.dom){var i=e.calcCardProcess(t.timestamp);if(!(i>1)){var n=e.innerBar.contains(t.dom);i<0?n&&e.innerBar.removeChild(t.dom):(n||e.innerBar.appendChild(t.dom),t.dom.style.left="".concat(100*i,"%"))}}}))}},{key:"calcCardProcess",value:function(e){var t,i=null!==(t=this.config)&&void 0!==t?t:{},n=i.maxMoveTime,r=i.livingStartTime,o=this.liveGap+Math.floor(Date.now()/1e3-this.initTime);return n&&o>n&&(r=o-n),e<r?-1:(e-r)/this.duration}},{key:"destroy",value:function(){if(this.off(pr,this.handleTimeUpdate.bind(this)),this.isMobile){this.unbind("touchstart",this.handleMouseDown);var e=this.player.controls;e&&(e.root&&e.root.removerEventListener("touchmove",qn.stopPropagation),e.center&&e.center.removerEventListener("touchend",qn.stopPropagation))}else this.unbind("mousedown",this.handleMouseDown),this.unbind("mouseenter",this.handleMouseEnter);var t;this.backLiveBt&&(null===(t=this.player.root)||void 0===t||t.removeChild(this.backLiveBt),this.backLiveBt=null)}},{key:"render",value:function(){if(this.config.disable)return"";var e=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===e?"xgplayer-progress-bottom":"",' xgplayer-shift">\n <xg-outer class="xgplayer-progress-outer">\n <xg-inners class="progress-list">\n <xg-inner class="xgplayer-progress-inner" style="flex: 1">\n <xg-cache class="xgplayer-progress-cache" style="width: 100%;"></xg-cache>\n <xg-played class="xgplayer-progress-played" style="width: 100%;"></xg-played>\n </xg-inner>\n </xg-inners>\n <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n <xg-point class="xgplayer-shift-progress-point">00:00</xg-point>\n </xg-outer>\n </xg-progress>\n ')}}],[{key:"pluginName",get:function(){return"TimeShiftPlugin"}},{key:"defaultConfig",get:function(){return{position:mz.CONTROLS_CENTER,livingStartTime:Date.now()/1e3,maxMoveTime:0,currentTime:Date.now()/1e3,timeShiftUrl:"",cardList:[]}}}]),i}(Bo);function kz(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.5 0.199997C8.5 0.0895386 8.5896 0 8.69995 0H9.30005C9.4104 0 9.5 0.0895386 9.5 0.199997V1.8C9.5 1.91046 9.4104 2 9.30005 2H8.69995C8.5896 2 8.5 1.91046 8.5 1.8V0.199997Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0 1.95424C0 1.85173 0.0773926 1.76
1582 0.179443 1.75529L7.27954 1.02277C7.34546 1.01596 7.40649 1.04182 7.44751 1.08664C7.47998 1.12207 7.5 1.16936 7.5 1.22171V14.7783C7.5 14.8969 7.39746 14.9894 7.27954 14.9773L0.179443 14.2447C0.0773926 14.2342 0 14.1483 0 14.0458V1.95424ZM1.5 12.873V3.12701L6 2.66273V13.3373L1.5 12.873Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M18 1.95424C18 1.85173 17.9226 1.76582 17.8206 1.75529L10.7205 1.02277C10.6025 1.01059 10.5 1.10313 10.5 1.22171V14.7783C10.5 14.8969 10.6025 14.9894 10.7205 14.9773L17.8206 14.2447C17.9226 14.2342 18 14.1483 18 14.0458V1.95424ZM16.5 3.12701L12 2.66273V13.3373L16.5 12.873V3.12701Z" fill="white"/>\n <path d="M8.69995 3C8.5896 3 8.5 3.08954 8.5 3.2V4.8C8.5 4.91046 8.5896 5 8.69995 5H9.30005C9.32642 5 9.35156 4.9949 9.37451 4.98564C9.39111 4.97896 9.40674 4.97011 9.4209 4.95944C9.46899 4.92293 9.5 4.8651 9.5 4.8V3.2C9.5 3.14664 9.47925 3.09818 9.44507 3.06232C9.40869 3.02393 9.35718 3 9.30005 3H8.69995Z" fill="white"/>\n <path d="M8.5 6.2C8.5 6.08954 8.5896 6 8.69995 6H9.30005C9.34277 6 9.38232 6.01344 9.41479 6.03635C9.46631 6.07254 9.5 6.13234 9.5 6.2V7.8C9.5 7.85072 9.48096 7.89703 9.44995 7.9323C9.41821 7.96826 9.37354 7.99272 9.32373 7.99861C9.31592 7.99953 9.30811 8 9.30005 8H8.69995C8.5896 8 8.5 7.91046 8.5 7.8V6.2Z" fill="white"/>\n <path d="M8.53711 9.08395C8.51367 9.11667 8.5 9.15674 8.5 9.20001V10.8C8.5 10.9105 8.5896 11 8.69995 11H9.30005C9.4104 11 9.5 10.9105 9.5 10.8V9.20001C9.5 9.08954 9.4104 9 9.30005 9H8.69995C8.68384 9 8.66821 9.00189 8.65332 9.00546C8.60571 9.01688 8.5647 9.04529 8.53711 9.08395Z" fill="white"/>\n <path d="M8.5 12.2C8.5 12.1371 8.52905 12.081 8.57446 12.0443C8.60864 12.0166 8.65234 12 8.69995 12H9.30005C9.4104 12 9.5 12.0895 9.5 12.2V13.8C9.5 13.8664 9.46753 13.9253 9.41772 13.9616C9.38477 13.9857 9.34399 14 9.30005 14H8.69995C8.5896 14 8.5 13.9105 8.5 13.8V12.2Z" fill="white"/>\n <path d="M8.69995 15C8.5896 15 8.5 15.0895 8.5 15.2V15.8C8.5 15.9105 8.5896 16 8.69995 16H9.30005C9.4104 16 9.5 15.9105 9.5 15.8V15.2C9.5 15.0895 9.4104 15 9.30005 15H8.69995Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}function wz(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.5 0.2C8.5 0.0895431 8.58954 0 8.7 0H9.3C9.41046 0 9.5 0.0895431 9.5 0.2V1.8C9.5 1.91046 9.41046 2 9.3 2H8.7C8.58954 2 8.5 1.91046 8.5 1.8V0.2Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0 1.95424C0 1.85173 0.0775055 1.76582 0.179474 1.7553L7.27947 1.02276C7.39742 1.01059 7.5 1.10313 7.5 1.2217V14.7783C7.5 14.8969 7.39742 14.9894 7.27947 14.9773L0.179474 14.2447C0.0775053 14.2342 0 14.1483 0 14.0458V1.95424ZM1.5 12.873V3.12702L6 2.66273V13.3373L1.5 12.873Z" fill="white"/>\n <path d="M17.8205 1.7553C17.9225 1.76582 18 1.85173 18 1.95424V14.0458C18 14.1483 17.9225 14.2342 17.8205 14.2447L10.7205 14.9773C10.6026 14.9894 10.5 14.8969 10.5 14.7783V1.2217C10.5 1.10313 10.6026 1.01059 10.7205 1.02276L17.8205 1.7553Z" fill="white"/>\n <path d="M8.7 3C8.58954 3 8.5 3.08954 8.5 3.2V4.8C8.5 4.91046 8.58954 5 8.7 5H9.3C9.41046 5 9.5 4.91046 9.5 4.8V3.2C9.5 3.08954 9.41046 3 9.3 3H8.7Z" fill="white"/>\n <path d="M8.5 6.2C8.5 6.08954 8.58954 6 8.7 6H9.3C9.41046 6 9.5 6.08954 9.5 6.2V7.8C9.5 7.91046 9.41046 8 9.3 8H8.7C8.58954 8 8.5 7.91046 8.5 7.8V6.2Z" fill="white"/>\n <path d="M8.7 9C8.58954 9 8.5 9.08954 8.5 9.2V10.8C8.5 10.9105 8.58954 11 8.7 11H9.3C9.41046 11 9.5 10.9105 9.5 10.8V9.2C9.5 9.08954 9.41046 9 9.3 9H8.7Z" fill="white"/>\n <path d="M8.5 12.2C8.5 12.0895 8.58954 12 8.7 12H9.3C9.41046 12 9.5 12.0895 9.5 12.2V13.8C9.5 13.9105 9.41046 14 9.3 14H8.7C8.58954 14 8.5 13.9105 8.5 13.8V12.2Z" fill="white"/>\n <path d="M8.7 15C8.58954 15 8.5 15.0895 8.5 15.2V15.8C8.5 15.9105 8.58954 16 8.7 16H9.3C9.41046 16 9.5 15.9105 9.5 15.8V15.2C9.5 15.0895 9.41046 15 9.3 15H8.7Z" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}var Sz=Bo.POSITIONS,Tz="getMirror",Ez="exitMirror",Cz=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).isEnableMirror=!0,n.isEnableMirror=n.config.defaultEnable,n}return f(i,[{key:"afterCreate",value:function(){this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.updateMirrorState(this.isEnableMirror))}},{key:"registerIcons",value:function(){var e;return p(e={},Tz,{icon:kz,class:"xg-get-mirror"}),p(e,Ez,{icon:wz,class:"xg-exit-mirror"}),e}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e[Tz]),t.appendChild(e[Ez])}},{key:"registerLanguageTexts",value:function(){return{getMirror:{jp:"ãã©ã¼ãéã",en:"Turn on mirroring",zh:"å¼å¯éå","zh-
1hk":"éåé¡å"},exitMirror:{jp:"ãã©ã¼ãéãã",en:"Turn off mirroring",zh:"å
³ééå","zh-hk":"ééé¡å"}}}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.isEnableMirror?this.action(!1):this.action(!0)}},{key:"action",value:function(e){this.isEnableMirror=e,this.updateMirrorState(this.isEnableMirror),this.player.emit(PM.MIRROR_CHANGE,this.isEnableMirror)}},{key:"updateMirrorState",value:function(e){var t=this.player;e?t.addClass("xgplayer-mirror"):t.removeClass("xgplayer-mirror"),this.animate(e)}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","enable"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){this.changeLangTextKey(this.find(".xg-tips"),e?Ez:Tz)}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class=\'xgplayer-mirror-icon\'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="mirror">'.concat(this.langText[Tz],"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"mirrorPlugin"}},{key:"defaultConfig",get:function(){return{position:Sz.CONTROLS_RIGHT,index:MM,disable:!1,defaultEnable:!1}}}]),i}(Bo),xz=function(e){g(i,e);var t=k(i);function i(e){var n;return h(this,i),(n=t.call(this,e)).memoryId="",n.shouldShowToast=!1,n.saveTimeFun=qn.checkIsFunction(n.config.saveTime)?n.config.saveTime:n.saveTimeByStorage,n.getTimeFun=qn.checkIsFunction(n.config.getTime)?n.config.getTime:n.getTimeByStorage,n.startTime=0,n.memoryId=n.config.memoryId,n.showToast=n.showToast.bind(_(n)),n.saveTime=n.saveTime.bind(_(n)),n.visibilitychangeCallback=n.visibilitychangeCallback.bind(_(n)),n}return f(i,[{key:"registerLanguageTexts",value:function(){return{preText:{jp:"ã«ä½ç½®ä»ãããã¾ãã",en:"Has located for you to ",zh:"已为æ¨å®ä½è³","zh-hk":"å·²çºæ¨å®ä½è³"}}}},{key:"children",value:function(){return{toast:gH}}},{key:"afterCreate",value:function(){var e=this;this.once(fr,this.showToast),this.on(pr,(function(){e.curTime=e.player.currentTime}))}},{key:"beforePlayerInit",value:function(){return this.memoryId||(this.playerConfig.vid?this.memoryId=this.playerConfig.vid:this.player.url&&(this.memoryId=this.player.url.replace(/\?.*$/,""))),this.setSave(),this.getTime()}},{key:"getTime",value:function(){var e=this;return new Promise((function(t){var i;((i=e.getTimeFun(e.memoryId))&&i.then?i:new Promise((function(e){e(i)}))).then((function(i){var n,r,o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=parseFloat(e);return Number.isNaN(i)?t:i}(i);!isNaN(o)&&o>0?(e.startTime=o,e.shouldShowToast=!0,e.playerConfig.startTime=e.startTime,null!==(n=e.player.plugins)&&void 0!==n&&null!==(n=n.hls)&&void 0!==n&&null!==(n=n.hls)&&void 0!==n&&n.config&&(e.player.plugins.hls.hls.config.startTime=e.startTime),null!==(r=e.player.plugins)&&void 0!==r&&null!==(r=r.encrypthlsplugin)&&void 0!==r&&null!==(r=r.hls)&&void 0!==r&&r.config&&(e.player.plugins.encrypthlsplugin.hls.config.startTime=e.startTime)):Ul.warn("the time got is invalid",i),t()})).catch((function(e){Ul.error("getTime function occur error",e),t()}))}))}},{key:"saveTime",value:function(){var e;if(this.player){var t=this.config,i=t.minStartTime,n=void 0===i?1:i,r=t.minEndTime,o=void 0===r?1:r,a=this.player,s=a.currentTime,l=a.duration,c=null!==(e=null!=s?s:this.curTime)&&void 0!==e?e:0;l&&(c<n||Math.abs(l-c)<o?this.saveTimeFun(this.memoryId,0):this.saveTimeFun(this.memoryId,c))}}},{key:"visibilitychangeCallback",value:function(){"hidden"===document.visibilityState&&this.saveTime()}},{key:"setSave",value:function(){this.on(cr,this.saveTime.bind(this)),this.on(hr,this.saveTime.bind(this)),document.addEventListener("visibilitychange",this.visibilitychangeCallback.bind(this)),document.addEventListener("pagehide",this.saveTime.bind(this)),window.addEventListener("beforeunload",this.saveTime.bind(this))}},{key:"showToast",value:function(){if(this.shouldShowToast){var e;this.shouldShowToast=!1;var t=null===(e=this.player)||void 0===e?void 0:e.getPlugin("sdkToastPlugin");if(!t)return;if(this.startTime>0){var i=qn.format(this.startTime);t.add("".concat(this.langText.preText).concat(i),4e3,!0)}}}},{key:"saveTimeByStorage",value:function(e,t){!function(e){var t=arguments.length>2?arguments[2]:void 0;if(e){var i=ic+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"")+"_"+e;localStorage.setItem(i,t+"")}}(e,i.pluginName,t+"")}},{key:"getTimeByStorage",value:function(e){return function(e){if(e){var t=ic+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"")+"_"+e;return localStorage.getItem(t)}}(e,i.pluginName)||0}},{key:"destroy",value:function(){this.saveTime(),document.removeEventListener("visibilitychange",this.visibilitychangeCallback),document.removeEventListener("pagehide",this.saveTime),window.removeEventListener("beforeunload",this.saveTime)}}],[{key:"pluginName",get:function(){return"memoryPlay"}},{key:"defaultConfig",get:function(){return{getTime:null,saveTime:null,memoryId:"",minStartTime:1,minEndTime:1}}}]),i}(Bo),Dz=function(){function e(t){h(this,e),this.config=t.config,this.parent=t.root,this.root=qn.createDom("ul","",{},"xg-play-list xg-list-slide-scroll ".concat(this.config.className));var i="mobile"===ir.device?"touchend":"click";this.modal=qn.createDom("div","",{},"xg-play-list-modal"),this.modal.appendChild(this.root),t.root.appendChild(this.modal),this._delegates=Bo.delegate.call(this,this.modal,".xg-play-list-modal",i,this.modalClick.bind(this));var n=this.config.maxHeight;n&&this.setStyle({maxHeight:n}),this.onItemClick=this.onItemClick.bind(this),this.renderItemList(),this._delegates.concat(Bo.delegate.call(this,this.root,"li",i,this.onItemClick))}return f(e,[{key:"renderItemList",value:function(e){var t=this,i=this.config,n=this.root;e?i.data=e:e=i.data,i.style&&Object.keys(i.style).map((function(e){n.style[e]=i[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,i){var n=e.selected?"xg-play-list-item selected":"xg-play-list-item";e["data-index"]=i;var r=e.duration?qn.format(e.duration):"",o=e.poster?"background-image: url('".concat(e.poster,"')"):"",a=(new DOMParser).parseFromString('<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
1\n<g filter="url(#filter0_dii_340_912)">\n<path d="M4.00011 7.66678C4.00005 5.82578 5.49245 4.33333 7.33344 4.33333H23.3742H32.6657C34.5066 4.33333 35.999 5.82572 35.999 7.66667V13.5764L35.9998 32.3332C35.9999 34.1742 34.5075 35.6667 32.6665 35.6667H7.33423C5.49332 35.6667 4.00096 34.1743 4.0009 32.3334L4.00011 7.66678Z" fill="url(#paint0_linear_340_912)"/>\n<path d="M4.10011 7.66677C4.10005 5.88101 5.54768 4.43333 7.33344 4.43333H23.3742H32.6657C34.4514 4.43333 35.899 5.88095 35.899 7.66667V13.5764L35.8998 32.3332C35.8999 34.119 34.4523 35.5667 32.6665 35.5667H7.33423C5.54855 35.5667 4.10095 34.1191 4.1009 32.3334L4.10011 7.66677Z" stroke="url(#paint1_linear_340_912)" stroke-width="0.2"/>\n</g>\n<path d="M6.76669 9.66667C6.76669 8.24914 7.91582 7.1 9.33335 7.1H30.6667C32.0842 7.1 33.2334 8.24914 33.2334 9.66667V30.3333C33.2334 31.7509 32.0842 32.9 30.6667 32.9H9.33335C7.91582 32.9 6.76669 31.7509 6.76669 30.3333V9.66667Z" fill="url(#paint2_linear_340_912)" stroke="url(#paint3_linear_340_912)" stroke-width="0.2"/>\n<g filter="url(#filter1_dii_340_912)">\n<path d="M15.4689 18.4428L10.9398 27.4593C10.6614 28.0134 11.0643 28.6667 11.6845 28.6667H27.8647C28.5118 28.6667 28.912 27.9614 28.5801 27.4059L25.3326 21.9703C25.0217 21.4499 24.2769 21.425 23.932 21.9235L21.1839 25.8946C21.1128 25.9973 20.9581 25.9882 20.8996 25.8778L16.9499 18.4266C16.6329 17.8285 15.7728 17.8379 15.4689 18.4428Z" fill="url(#paint4_linear_340_912)"/>\n<path d="M15.4689 18.4428L10.9398 27.4593C10.6614 28.0134 11.0643 28.6667 11.6845 28.6667H27.8647C28.5118 28.6667 28.912 27.9614 28.5801 27.4059L25.3326 21.9703C25.0217 21.4499 24.2769 21.425 23.932 21.9235L21.1839 25.8946C21.1128 25.9973 20.9581 25.9882 20.8996 25.8778L16.9499 18.4266C16.6329 17.8285 15.7728 17.8379 15.4689 18.4428Z" stroke="url(#paint5_linear_340_912)" stroke-width="0.166667"/>\n</g>\n<g filter="url(#filter2_dii_340_912)">\n<circle cx="23.6667" cy="14.6667" r="2" fill="url(#paint6_linear_340_912)"/>\n<circle cx="23.6667" cy="14.6667" r="2" stroke="url(#paint7_linear_340_912)" stroke-width="0.166667"/>\n</g>\n<defs>\n<filter id="filter0_dii_340_912" x="3.8431" y="4.17631" width="32.6278" height="32.1184" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.157018" dy="0.314036"/>\n<feGaussianBlur stdDeviation="0.157018"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0684375 0 0 0 0 0.0704062 0 0 0 0 0.075 0 0 0 0.5 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.471054" dy="0.471054"/>\n<feGaussianBlur stdDeviation="0.157018"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.355764 0 0 0 0 0.368819 0 0 0 0 0.391667 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="-0.471054" dy="-0.471054"/>\n<feGaussianBlur stdDeviation="0.0785089"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.191389 0 0 0 0 0.197708 0 0 0 0 0.216667 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<filter id="filter1_dii_340_912" x="10.4333" y="17.5669" width="18.6828" height="11.6831" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0823529 0 0 0 0 0.0901961 0 0 0 0 0.105882 0 0 0 1 0"/>
1\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.930313 0 0 0 0 0.935083 0 0 0 0 0.954167 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="-0.166667" dy="-0.333333"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.409097 0 0 0 0 0.443509 0 0 0 0 0.570833 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<filter id="filter2_dii_340_912" x="21.25" y="12.25" width="4.83329" height="5.00001" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.0823529 0 0 0 0 0.0901961 0 0 0 0 0.105882 0 0 0 1 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_340_912"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_340_912" result="shape"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="0.166667"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.930313 0 0 0 0 0.935083 0 0 0 0 0.954167 0 0 0 1 0"/>\n<feBlend mode="normal" in2="shape" result="effect2_innerShadow_340_912"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dx="-0.166667" dy="-0.333333"/>\n<feGaussianBlur stdDeviation="0.166667"/>\n<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0.364583 0 0 0 0 0.397828 0 0 0 0 0.520833 0 0 0 1 0"/>\n<feBlend mode="normal" in2="effect2_innerShadow_340_912" result="effect3_innerShadow_340_912"/>\n</filter>\n<linearGradient id="paint0_linear_340_912" x1="30.2254" y1="8.17498" x2="11.4982" y2="41.5657" gradientUnits="userSpaceOnUse">\n<stop stop-color="#434548"/>\n<stop offset="0.855332" stop-color="#3E3F42"/>\n</linearGradient>\n<linearGradient id="paint1_linear_340_912" x1="7.52649" y1="1.8673" x2="25.0283" y2="33.3887" gradientUnits="userSpaceOnUse">\n<stop stop-color="#383838"/>\n<stop offset="0.192009" stop-color="#45484D"/>\n<stop offset="0.703503" stop-color="#37393D"/>\n<stop offset="0.962692" stop-color="#1B1C1E"/>\n</linearGradient>\n<linearGradient id="paint2_linear_340_912" x1="28.5212" y1="10.1877" x2="13.0162" y2="37.9513" gradientUnits="userSpaceOnUse">\n<stop stop-color="#2E2F32"/>\n<stop offset="0.855332" stop-color="#242528"/>\n</linearGradient>\n<linearGradient id="paint3_linear_340_912" x1="9.60543" y1="4.95372" x2="24.0954" y2="31.1622" gradientUnits="userSpaceOnUse">\n<stop stop-color="#1F2124"/>\n<stop offset="0.192009" stop-color="#282B30"/>\n<stop offset="0.703503" stop-color="#27292F"/>\n<stop offset="0.962692" stop-color="#1D1F23"/>\n</linearGradient>\n<linearGradient id="paint4_linear_340_912" x1="16.969" y1="16.5412" x2="22.5457" y2="28.6249" gradientUnits="userSpaceOnUse">\n<stop stop-color="#C7CCE2"/>\n<stop offset="1" stop-color="#8B95BC"/>\n</linearGradient>\n<linearGradient id="paint5_linear_340_912" x1="17.5125" y1="20.3581" x2="20.121" y2="28.4669" gradientUnits="userSpaceOnUse">\n<stop offset="0.181113" stop-color="#B1B7D3"/>\n<stop offset="1" stop-color="#535C80"/>\n</linearGradient>\n<linearGradient id="paint6_linear_340_912" x1="23.0637" y1="12.5093" x2="25.4773" y2="15.7207" gradientUnits="userSpaceOnUse">\n<stop stop-color="#B8BED6"/>\n<stop offset="1" stop-color="#7E88AD"/>\n</linearGradient>\n<linearGradient id="paint7_linear_340_912" x1="23.1781" y1="13.818" x2="24.4392" y2="16.2252" gradientUnits="userSpaceOnUse">\n<stop offset="0.181113" stop-color="#B1B7D3"/>\n<stop offset="1" stop-color="#495274"/>\n</linearGradient>\n</defs>\n</svg>\n',"image/svg+xml").firstChild,s='\n <div style="'.concat(o,'" class="xg-play-list-poster ').concat(e.selected?"is-active":""," ").concat(e.poster?"":"no-poster",'" >\n <div class="bg"></div>\n <div class="icon"></div>\n <div class="duration">').concat(r,'</div>\n <duv class="playing">\n <div class="icon-wrap">\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n <div class="icon-line"></div>\n </div>\n </duv>\n </div>\n <div class="xg-play-list-title">\n <div class="xg-play-list-title-text">').concat(e.title,"</div>\n </div>\n "),l=qn.createDom("li",s,e,n),c=qn.findDom(l,".bg");!e.poster&&c.appendChild(a),t.root.appendChild(l)}));var r=e.findIndex((function(e){return e.selected}));if(r>=0){var o=qn.findDom(this.root,".xg-play-list-item.selected");if(!o)return;var a=o.getBoundingClientRect().height,s=this.root.getBoundingClientRect().height,l=(e.length-r)*a,c=a*e.length;this.root.scrollTop=l<s?c-s:r*a}}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&qn.hasClass(t,"selected"))return!1;var i="function"==typeof this.config.onItemClick?this.config.onItemClick:null,n=this.root.querySelector(".selected");qn.addClass(t,"selected"),n&&qn.removeClass(n,"selected"),i&&i(e,{from:n?this.getAttrObj(n,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var i={};t.map((function(t){i[t]=e.getAttribute(t)}));var n=e.getAttribute("data-index");return n&&(i.index=Number(n)),i}},{key:"show",value:function(){qn.removeClass(this.modal,"hide"),qn.addClass(this.modal,"active"),qn.removeClass(this.root,"hide"),qn.addClass(this.root,"active")}},{key:"hide",value:function(){qn.removeClass(this.modal,"active"),qn.addClass(this.modal,"hide"),qn.removeClass(this.root,"active"),qn.addClass(this.root,"hide")}},{key:"modalClick",value:function(e){e.stopPropagation(),this.hide();var t="function"==typeof this.config.onModalClick?this.config.onModalClick:null;t&&t(e)}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(i){t.root.style[i]=e[i]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.parentNode.removeChild(this.root),this.root.innerHTML=null,this.root=null}}]),e}();function Pz(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12.8499 8.49494C13.7054 8.98885 14.1331 9.23581 14.2767 9.5
15822C14.4019 9.83944 14.4019 10.1606 14.2767 10.4418C14.1331 10.7642 13.7054 11.0112 12.8499 11.5051L6.65863 15.0796C5.80315 15.5735 5.37542 15.8205 5.02442 15.7836C4.71827 15.7514 4.44016 15.5909 4.25921 15.3418C4.05177 15.0563 4.05177 14.5624 4.05177 13.5746V6.42547C4.05177 5.43765 4.05177 4.94374 4.25921 4.65822C4.44016 4.40917 4.71827 4.2486 5.02442 4.21642C5.37542 4.17953 5.80315 4.42649 6.65863 4.92039L12.8499 8.49494Z" fill="white"/>\n<rect x="13.8274" y="4.02594" width="2.17238" height="11.9481" rx="0.814644" fill="white"/>\n</svg>\n',"image/svg+xml").firstChild}function Oz(){return(new DOMParser).parseFromString('<svg width="21" height="22" viewBox="0 0 21 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_d_126_721)">\n<path d="M8.18979 6.3414C8.60304 6.57999 8.80967 6.69928 8.87901 6.85503C8.93949 6.99088 8.93949 7.14601 8.87901 7.28186C8.80967 7.4376 8.60304 7.5569 8.18979 7.79549L5.59253 9.29502C5.17928 9.53361 4.97266 9.6529 4.80311 9.63508C4.65522 9.61954 4.52087 9.54197 4.43346 9.42167C4.33325 9.28374 4.33325 9.04515 4.33325 8.56797V5.56891C4.33325 5.09173 4.33325 4.85314 4.43346 4.71522C4.52087 4.59491 4.65522 4.51735 4.80311 4.5018C4.97266 4.48398 5.17928 4.60328 5.59253 4.84187L8.18979 6.3414Z" fill="white"/>\n</g>\n<path d="M11.5264 7.19745H18" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<path d="M5.05273 12.5922L18.0001 12.5922" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<path d="M5.05273 17.9869L18.0001 17.9869" stroke="white" stroke-width="1.61843" stroke-linecap="round"/>\n<defs>\n<filter id="filter0_d_126_721" x="0.736733" y="0.903543" width="11.7841" height="12.3298" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset/>\n<feGaussianBlur stdDeviation="1.79826"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_126_721"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_126_721" result="shape"/>\n</filter>\n</defs>\n</svg>\n',"image/svg+xml").firstChild}var Iz="playListNext",Lz="playListToggle",Az="mobile"===ir.device;function Rz(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.filter((function(e){return e.url||e.playAuthToken})).map((function(e,t){var i=a({},e||{});return i.vid||(i.vid=""+t),i})):[]}function Mz(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=Number(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),i=Number.isNaN(t)?0:t,n=0;return(n=i<=0?0:i<e.length?i:0)<0?0:n}xA.prototype.setVodPlayListConfig=function(e){if((e.plugins||[]).find((function(e){return e.pluginName===Nz.pluginName}))){var t=fc(e,"playListPlugin");if(t&&function(e){var t=l(e);return null!==e&&("object"===t||"function"===t)}(t)){var i=t.list,n=void 0===i?[]:i,r=t.defaultIndex,o=void 0===r?0:r,s=Rz(n),c=Mz(s,o),u=null==s?void 0:s[c];if(u){var h=u.url,d=u.poster,f=u.playAuthToken;f?e.getVideoByToken=a(a({},e.getVideoByToken||{}),{},{playAuthToken:f}):h&&(e.url=h),d&&(e.poster=d)}}}};var Nz=function(e){g(i,e);var t=k(i);function i(){var e;return h(this,i),(e=t.apply(this,arguments)).onEnter=function(t){t.stopPropagation(),e.emit("icon_mouseenter",{pluginName:e.pluginName}),e.switchActiveState(t)},e.switchActiveState=function(t){t.stopPropagation(),"click"===e.config.toggleMode?e.toggle(!e.isActive):e.toggle(!0)},e.handleNext=function(t){t.stopPropagation(),e.next()},e._onTimeUpdate=function(){var t=_(e).player;!e.halfPass&&t.currentTime>t.duration/2&&e.confirmOrder()},e._onEnded=function(){if("order"===e.mode&&e.curIndex+1>=e.list.length)return e.player.pause(),void(e.player.currentTime=0);e.next()},e.onLeave=function(t){t.stopPropagation(),e.emit("icon_mouseleave",{pluginName:e.pluginName}),e.isActive&&e.toggle(!1)},e}return f(i,[{key:"beforeCreate",value:function(e){Object.values(Bo.POSITIONS).includes(e.position)||(e.root=e.player.controls.left,e.config.position=Bo.POSITIONS.CONTROLS_LEFT,e.position=Bo.POSITIONS.CONTROLS_LEFT)}},{key:"afterCreate",value:function(){var e=this,t=this.config,i=t||{},n=i.list,r=void 0===n?[]:n,o=i.mode,a=i.defaultIndex;this.initIcons(),this.halfPass=!1,this.list=Rz(r),this.timer=setTimeout((function(){e.emit(PM.PLAY_LIST_CHANGE,e.list)})),this.disable=!(r.length>0),this.mode=o,this.curIndex=Mz(this.list,a),this.curIndex>0?(this.nextIndex=this.curIndex+1<this.list.length?this.curIndex+1:0,this.prevIndex=this.curIndex-1):(this.nextIndex=1,this.prevIndex=this.list.length-1),this.on(pr,this._onTimeUpdate),this.on(cr,this._onEnded),this.on([Gr,Ur],(function(){e._resizeList(
1)})),this.once(vr,(function(){e.list&&e.list.length>0&&(e.renderItemList(),e.show())})),Az&&this.on(Tr,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),Az?(t.toggleMode="click",this.activeEvent="touchend"):this.activeEvent="click"===t.toggleMode?"click":"mouseenter",this.bind(".xg-play-next-btn","click",this.handleNext),"click"===t.toggleMode?this.bind(".xg-play-list-btn",this.activeEvent,this.switchActiveState):(this.bind(".xg-play-list-btn",this.activeEvent,this.onEnter),this.bind(".xg-play-list-btn","mouseleave",this.onLeave))}},{key:"registerLanguageTexts",value:function(){return{playNext:{jp:"次ã«éã¶",en:"play next",zh:"ææ¾ä¸ä¸ä¸ª","zh-hk":"ææ¾ä¸ä¸å"},playList:{jp:"ãã¬ã¤ãªã¹ã",en:"playList",zh:"ææ¾å表","zh-hk":"ææ¾æ¸
å®"}}}},{key:"registerIcons",value:function(){var e;return p(e={},Iz,{icon:Pz,class:"xg-play-next-btn"}),p(e,Lz,{icon:Oz,class:"xg-play-list-btn"}),e}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xg-play-next-btn",e[Iz]),this.appendChild(".xg-play-list-btn",e[Lz])}},{key:"show",value:function(){!this.list||this.list.length<1||qn.addClass(this.root,"show")}},{key:"hide",value:function(){qn.removeClass(this.root,"show")}},{key:"prev",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._prevCompute()),this.curIndex=this.prevIndex,this.change())}},{key:"next",value:function(){this.disable||(this.halfPass||(this.halfPass=!0,this._nextCompute()),this.curIndex=this.nextIndex,this.change())}},{key:"changeList",value:function(e){this.player.currentTime=0,this.list=Rz(e),this.nextIndex=0,this.curIndex=0,this.change(),this.disable=!(this.list.length>0),this.emit(PM.PLAY_LIST_CHANGE,this.list)}},{key:"setIndex",value:function(e){e<0||e>=this.list.length||(this.nextIndex=e+1<this.list.length?e+1:0,this.prevIndex=e-1<0?this.list.length-1:e-1,this.curIndex=e,this.change())}},{key:"change",value:function(){if(!this.disable){var e=this.player,t=this.list,i=this.curIndex;this.halfPass=!1;var n=t[i],r=n.url,o=n.playAuthToken,a=n.title,s=void 0===a?"":a,l=n.vid,c=void 0===l?"":l,u=n.poster,h=void 0===u?"":u;this.curInfo={url:r,playAuthToken:o,title:s,vid:c,poster:h};var d=e.sdk||e;o?d.playNext({vid:c,poster:h,autoplay:!0,getVideoByToken:{playAuthToken:o}}):d.playNext({vid:c,poster:h,autoplay:!0,url:r}),this.renderItemList(),e.off("timeupdate",this._emitChange.bind(this)),e.once("timeupdate",this._emitChange.bind(this))}}},{key:"confirmOrder",value:function(){this.halfPass=!0,this._nextCompute(),this._prevCompute()}},{key:"_nextCompute",value:function(){this.disable||(this.curIndex+1<this.list.length?this.nextIndex=this.curIndex+1:this.nextIndex=0)}},{key:"_prevCompute",value:function(){this.disable||(this.curIndex-1>=0?this.prevIndex=this.curIndex-1:this.prevIndex=this.list.length-1)}},{key:"_emitChange",value:function(){this.emit(PM.PLAY_LIST_ITEM_CHANGE,this.curInfo)}},{key:"toggle",value:function(e){if(e!==this.isActive){var t=this.player.controls;e?(t.blur(),this.optionsList&&this.optionsList.show()):(t.focus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.stopPropagation(),this.curIndex=t.to.index,this.change(),this.toggle(!1)}},{key:"renderItemList",value:function(e){var t=this,i=this.list,n=this.config,r=this.optionsList,o=this.player;"number"==typeof e&&(this.curIndex=e,this.curInfo=i[e]);var s=i.map((function(i,n){var r=a(a({},i),{},{selected:!1});return n===t.curIndex&&(r.selected=!0,e=n),r}));if(r)r.renderItemList(s);else{var l={config:{data:s,className:"xg-side-play-list",onItemClick:function(e,i){t.onItemClick(e,i)},onModalClick:function(){t.toggle(!1)}},root:o.innerContainer||o.root},c=this.player.root.getBoundingClientRect().height;c&&n.heightLimit&&(l.config.maxHeight="".concat(c,"px")),this.optionsList=new Dz(l),this.show(),this._resizeList()}}},{key:"_resizeList",value:function(){if(this.config.heightLimit){var e=this.player.root.getBoundingClientRect().height;this.optionsList&&this.optionsList.setStyle({maxHeight:"".concat(e,"px")})}}},{key:"destroy",value:function(){"click"===this.config.toggleMode?this.unbind(this.activeEvent,this.switchActiveState):(this.unbind(this.activeEvent,this.onEnter),this.unbind("mouseleave",this.onLeave)),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null),this.timer&&(clearTimeout(this.timer),this.timer=null)}},{key:"disable",get:function(){return this._disable},set:function(e){this._disable=e,e?(this.hide(),this.optionsList&&this.optionsList.hide()):this.show()}},{key:"render",value:function(){if(!this.disable)return'<xg-icon class="xg-options-icon xg-play-list-btn-container '.concat(this.config.className||"",'">\n <div class="xgplayer-icon xg-play-next-btn">\n <div class="xg-tips" lang-key="playNext">').concat(this.langText.playNext,'</div>\n </div>\n <div class="xgplayer-icon xg-play-list-btn">\n <div class="xg-tips" lang-key="playList">').concat(this.langText.playList,"</div>\n </div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"playListPlugin"}},{key:"defaultConfig",get:function(){return{position:Bo.POSITIONS.CONTROLS_LEFT,index:BM,list:[],mode:"order",defaultIndex:0,isItemClickHide:!0,toggleMode:"click"}}}]),i}(Bo),Bz=function(e){g(i,e);var t=k(i);function i(){var e;return h(this,i),(e=t.apply(this,arguments))._infoItems=[],e}return f(i,[{key:"streamType",get:function(){return this.playerConfig.playerData.getCurrentStreamType()}},{key:"afterCreate",value:function(){var e=this;["flv","hls"].includes(this.streamType)?(this.player.on("error",(function(){return e._handleError()})),this.player.on("loadeddata",(function(){return e._handleLoadedData()}))):this.close()}},{key:"registerLanguageTexts",value:function(){return{DECODEFPS:{en:"decodeFps",zh:"è§£ç
1æç"},DECODECOST:{en:"decodeCost",zh:"è§£ç æ¶è"},FORMAT:{en:"format",zh:"æ ¼å¼"},FPS:{en:"fps",zh:"帧ç"},BITRATE:{en:"birate",zh:"ç ç"},GOP:{en:"GOP",zh:"GOP"},RESOLUTION:{en:"resolution",zh:"å辨ç"},ENCODETYPE:{en:"encodeType",zh:"ç¼ç æ¹å¼"},BUFFEREND:{en:"bufferEnd",zh:"bufferæ°´ä½"},CURRENTTIME:{en:"currentTime",zh:"ææ¾è¿åº¦"}}}},{key:"_getDefaultInfo",value:function(e){var t={h265Title:{key:"h265Title",label:"H265è§£ç ",type:"title"},decodeEfficiency:{key:"decodeEfficiency",label:"è§£ç æç",labelTextKey:"DECODEFPS",value:e.decodeFps,render:function(e){return e+"frames/s"}},decodeCost:{key:"decodeCost",label:"è§£ç æ¶è",labelTextKey:"DECODECOST",value:e.decodeFps,render:function(e){return e?(1e3/e).toFixed()+"ms":""}}};return a({format:{key:"format",label:"æ ¼å¼",labelTextKey:"FORMAT",value:e.format},framerate:{key:"framerate",label:"帧ç",labelTextKey:"FPS",value:e.fps,render:function(e){return"".concat(e," fps")}},bitrate:{key:"bitrate",label:"ç ç",labelTextKey:"BITRATE",value:e.bitrate,render:function(e){return"".concat(e/1e3," kbps")}},gop:{key:"gop",label:"GOP",labelTextKey:"GOP",value:e.gop,render:function(e){return"".concat(e," frames")}},resolution:{key:"resolution",label:"è§é¢å辨ç",labelTextKey:"RESOLUTION",value:{width:e.width,height:e.height},render:function(e){return"".concat(e.width," * ").concat(e.height)}},encodeType:{key:"encodeType",label:"ç¼ç æ¹å¼",labelTextKey:"ENCODETYPE",value:e.encodeType},bufferEnd:{key:"bufferEnd",label:"bufferæ°´ä½",labelTextKey:"BUFFEREND",value:e.bufferEnd},currentTime:{key:"currentTime",label:"ææ¾è¿åº¦",labelTextKey:"CURRENTTIME",value:e.currentTime,render:function(e){return e?e.toFixed(6)+"s":""}}},e.isOpenSoftDecoding&&this.config.showH265Info?t:{})}},{key:"_init",value:function(){var e=this,t=this._initDom(this._getInfoListData());this._infoItems=new Proxy(t,{set:function(t,i,n){return e._updateDom(t[i].dom,n),Reflect.set(t,i,n)}}),this._tick()}},{key:"_getStats",value:function(){var e,t;return"flv"===this.streamType?null===(e=this.player.plugins.flv)||void 0===e?void 0:e.getStats():"hls"===this.streamType?null===(t=this.player.plugins.hls)||void 0===t?void 0:t.getStats():{}}},{key:"_getInfoListData",value:function(){var e=this._getStats()||{};return this._getDefaultInfo(Object.assign(e,{format:"".concat(this.streamType,"_live"),isOpenSoftDecoding:"live-video"==this.playerConfig.mediaType}))}},{key:"_initDom",value:function(e){var t=this,i=this.find(".veplayer-livepanel-container");return i.innerHTML="",Object.values(e).forEach((function(e){var n=qn.createDom("veplayer-livepanel-div","",void 0,"veplayer-livepanel-container-row");"title"===e.type?t._updateTitle(n,e):t._updateDom(n,e),i.appendChild(n),e.dom=n})),e}},{key:"_updateTitle",value:function(e,t){e.innerHTML="";var i=qn.createDom("veplayer-livepanel-span",t.label,void 0,"veplayer-livepanel-container-row-title");e.appendChild(i)}},{key:"_updateDom",value:function(e,t){e.innerHTML="";var i=qn.createDom("veplayer-livepanel-span",this._renderLabel(t),void 0,"veplayer-livepanel-container-row-label");if(e.appendChild(i),"title"!==t.type){var n=qn.createDom("veplayer-livepanel-span",this._renderValue(t));e.appendChild(n)}}},{key:"_renderLabel",value:function(e){return e.labelTextKey&&this.langText[e.labelTextKey]}},{key:"_renderValue",value:function(e){return e.render?e.render(e.value):e.value}},{key:"_handleDataChange",value:function(){var e=this,t=this._getInfoListData();Object.values(this._infoItems).forEach((function(i){"title"!==i.type&&e._renderValue(i)!==e._renderValue(t[i.key])&&(e._infoItems[i.key]=a(a({},i),t[i.key]))}))}},{key:"_tick",value:function(){var e=this;this._pollTimer=setTimeout((function(){clearTimeout(e._pollTimer),e._poll(),e._tick()}),500)}},{key:"_poll",value:function(){this._handleDataChange()}},{key:"destroy",value:function(){clearTimeout(this._pollTimer)}},{key:"_handleError",value:function(){this._close()}},{key:"_handleLoadedData",value:function(){this.config.visible&&this._open()}},{key:"_open",value:function(){var e=this.find(".veplayer-livepanel-container");qn.removeClass(e,"veplayer-livepanel-hidden"),this._init()}},{key:"_close",value:function(){var e=this.find(".veplayer-livepanel-container");qn.addClass(e,"veplayer-livepanel-hidden"),clearTimeout(this._pollTimer)}},{key:"open",value:function(){this._open(),this.config.visible=!0}},{key:"close",value:function(){this._close(),this.config.visible=!1}},{key:"render",value:function(){return'\n <xg-livepanel class="xgplayer-livepanel">\n <xg-livepanel-container class="veplayer-livepanel-container '.concat(!this.config.visible&&"veplayer-livepanel-hidden",'">\n </xg-livepanel-container></xg-livepanel>\n ')}}],[{key:"pluginName",get:function(){return"LiveInfoPanel"}},{key:"defaultConfig",get:function(){return{visible:!0,showH265Info:!1}}}]),i}(Bo),Uz=function(e){g(i,e);var t=k(i);function i(){return h(this,i),t.apply(this,arguments)}return f(i)}(zV);return Uz.Music=FV,Uz.LiveSubtitlesIconPlugin=YV,Uz.LiveSubtitlesPlugin=WV,Uz.DefinitionDemotePlugin=yz,Uz.TimeShiftPlugin=bz,Uz.MirrorPlugin=Cz,Uz.MemoryPlay=xz,Uz.Subtitle=pH,Uz.DynamicWatermarkPlugin=vz,Uz.PlayListPlugin=Nz,Uz.Service=zl,Uz.LiveInfoPanel=Bz,Uz.Events=OM,Uz.Event=IM,Uz.getI18N=function(){return $o},Uz.BasePlugin=Eo,Uz.Plugin=Bo,Uz.Sniffer=ir,Uz.Util=qn,Uz.STATE_CLASS=Fo,Uz.I18N=$o,Uz.STATES=qo,Uz.SdkPlugin=lV,Uz}()}).call(this,i(61),i(340)(e),i(119),i(320).Buffer)}}]); 2//# sourceMappingURL=appv-8d6a2a9945322c8.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.