douxiaoyun.js/profiles/douyin-profile/Default/Cache/Cache_Data/f_000353
2026-07-17 22:23:39 +08:00

1 line
419 KiB
Plaintext

!function(t,e){"object"==typeof module&&"object"==typeof module.exports?e():"function"==typeof define&&define.amd?define([],e):(t="undefined"!=typeof globalThis?globalThis:t||self)&&e()}(this,function(){"use strict";"object"==typeof window&&(window.openRedirect={version:"1.2.20",webpackPluginVersion:"3.4.22",reportOnly:!1})}),!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).xss={})}(this,function(t){"use strict";var e=function(){return(e=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function n(t,e,n){if(n||2==arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var i=/[^a-zA-Z0-9\\_:.-]/gim,r=/</g,o=/>/g,a=/&#([a-zA-Z0-9]*);?/gim,s=/&quot;/g,u=/&colon;?/gim,c=/&newline;?/gim,l=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,f=/u\s*r\s*l\s*\(.*/gi,h=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,p=/"/g,d=function(t){return t.replace(r,"&lt;").replace(o,"&gt;")},y={indexOf:function(t,e){var n,i;for(n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return -1},forEach:function(t,e,n){var i,r;for(i=0,r=t.length;i<r;i++)e.call(n,t[i],i,t)},some:function(t,e,n){var i,r;for(i=0,r=t.length;i<r;i++)if(e.call(n,t[i],i,t))return!0;return!1},trim:function(t){return t.replace(/(^\s*)|(\s*$)/g,"")},includes:function(t,e){if("string"==typeof t)return -1!==t.indexOf(e);for(var n=0;n<t.length;n++)if(t[n]===e)return!0;return!1},spaceIndex:function(t){var e=/\s|\n|\t/.exec(t);return e?e.index:-1},uniq:function(t){for(var e={},n=[],i=0;i<t.length;i++)e[t[i]]||(n.push(t[i]),e[t[i]]=!0);return n},from:function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e},keys:function(t){var e=[];for(var n in t)e.push(n);return e}};function v(t){return null==t}function g(t){var e;return'"'===(e=t)[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]?t.substr(1,t.length-2):t}function m(t){var e,n,i,r,o,a,s,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",l=0;for(t=function(t){t=t.replace(/rn/g,"n");for(var e="",n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?e+=String.fromCharCode(i):i>127&&i<2048?e+=String.fromCharCode(i>>6|192)+String.fromCharCode(63&i|128):e+=String.fromCharCode(i>>12|224)+String.fromCharCode(i>>6&63|128)+String.fromCharCode(63&i|128)}return e}(t);l<t.length;)r=(e=t.charCodeAt(l++))>>2,o=(3&e)<<4|(n=t.charCodeAt(l++))>>4,a=(15&n)<<2|(i=t.charCodeAt(l++))>>6,s=63&i,isNaN(n)?a=s=64:isNaN(i)&&(s=64),c=c+u.charAt(r)+u.charAt(o)+u.charAt(a)+u.charAt(s);return c}function b(t){var e,n,i,r,o,a,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",c=0;for(t=t.replace(/[^A-Za-z0-9+/=]/g,"");c<t.length;)e=s.indexOf(t.charAt(c++))<<2|(r=s.indexOf(t.charAt(c++)))>>4,n=(15&r)<<4|(o=s.indexOf(t.charAt(c++)))>>2,i=(3&o)<<6|(a=s.indexOf(t.charAt(c++))),u+=String.fromCharCode(e),64!==o&&(u+=String.fromCharCode(n)),64!==a&&(u+=String.fromCharCode(i));return function(t){for(var e="",n=0,i=0,r=0,o=0;n<t.length;)(i=t.charCodeAt(n))<128?(e+=String.fromCharCode(i),n++):i>191&&i<224?(e+=String.fromCharCode((31&i)<<6|63&(o=t.charCodeAt(n+1))),n+=2):(o=t.charCodeAt(n+1),e+=String.fromCharCode((15&i)<<12|(63&o)<<6|63&(r=t.charCodeAt(n+2))),n+=3);return e}(u)}function w(t,e,n){var i="",r=0,o=!1,a=!1,s=0,u=t.length,c="",l="";t:for(s=0;s<u;s++){var f=t.charAt(s);if(!1===o){if("<"===f){o=s;continue}}else if(!1===a){if("<"===f){i+=n(t.slice(r,s)),o=s,r=s;continue}if(">"===f||s===u-1){i+=n(t.slice(r,o)),c=function(t){var e,n=y.spaceIndex(t);return e=-1===n?t.slice(1,-1):t.slice(1,n+1),"/"===(e=y.trim(e).toLowerCase()).slice(0,1)&&(e=e.slice(1)),"/"===e.slice(-1)&&(e=e.slice(0,-1)),e}(l=t.slice(o,s+1)),i+=e(o,i.length,c,l,"</"===l.slice(0,2)),r=s+1,o=!1;continue}if('"'===f||"'"===f)for(var h=1,p=t.charAt(s-h);""===p.trim()||"="===p;){if("="===p){a=f;continue t}p=t.charAt(s-++h)}}else if(f===a){a=!1;continue}}return r<u&&(i+=n(t.substr(r))),i}function k(t,e){var n=0,r=0,o=[],a=!1,s=t.length;function u(t,n){if(!((t=(t=y.trim(t)).replace(i,"").toLowerCase()).length<1)){var r=e(t,n||"");r&&o.push(r)}}for(var c=0;c<s;c++){var l=t.charAt(c),f=void 0;if(!1!==a||"="!==l){if(!1===a||c!==r){if(/\s|\n|\t/.test(l)){if(t=t.replace(/\s|\n|\t/g," "),!1===a){if(-1===(f=function(t,e){for(;e<t.length;e++){var n=t[e];if(" "!==n)return"="===n?e:-1}return -1}(t,c))){u(y.trim(t.slice(n,c))),a=!1,n=c+1;continue}c=f-1;continue}if(-1===(f=function(t,e){for(;e>0;e--){var n=t[e];if(" "!==n)return"="===n?e:-1}return -1}(t,c-1))){u(a,g(y.trim(t.slice(n,c)))),a=!1,n=c+1;continue}}}else{if(-1===(f=t.indexOf(l,c+1)))break;u(a,y.trim(t.slice(r+1,f))),a=!1,n=(c=f)+1}}else a=t.slice(n,c),n=c+1,r='"'===t.charAt(n)||"'"===t.charAt(n)?n:function(t,e){for(;e<t.length;e++){var n=t[e];if(" "!==n)return"'"===n||'"'===n?e:-1}return -1}(t,c+1)}return n<t.length&&(!1===a?u(t.slice(n)):u(a,g(y.trim(t.slice(n))))),y.trim(o.join(" "))}function _(t,e,n){if(n=function(t){return t=function(t){for(var e="",n=0,i=t.length;n<i;n++)e+=32>t.charCodeAt(n)?" ":t.charAt(n);return y.trim(e)}(t=(t=(t=t.replace(s,'"')).replace(a,function(t,e){return"x"===e[0]||"X"===e[0]?String.fromCharCode(parseInt(e.substr(1),16)):String.fromCharCode(parseInt(e,10))})).replace(u,":").replace(c," "))}(n),"href"===e||"src"===e){if("#"===(n=y.trim(n)))return"#";if("http://"!==n.substr(0,7)&&"https://"!==n.substr(0,8)&&"mailto:"!==n.substr(0,7)&&"tel:"!==n.substr(0,4)&&"data:image/"!==n.substr(0,11)&&"ftp://"!==n.substr(0,6)&&"./"!==n.substr(0,2)&&"../"!==n.substr(0,3)&&"#"!==n[0]&&"/"!==n[0])return""}else if("background"===e){if(l.lastIndex=0,l.test(n))return""}else if("style"===e&&(h.lastIndex=0,h.test(n)||(f.lastIndex=0,f.test(n)&&(l.lastIndex=0,l.test(n)))))return"";return n=function(t){return t=d(t=t.replace(p,"&quot;"))}(n)}var S=function(t){return"string"==typeof t?t.replace(/'/g,'"').replace('=""',"").replace(/\s+/g,"").toLowerCase():""},P=function(){function t(t){var e=function(t){var e={};for(var n in t)e[n]=t[n];return e}(t||{});e.stripIgnoreTag&&(e.onIgnoreTag,e.onIgnoreTag=function(){return""}),e.whiteList={},e.onTag=function(){},e.onTagAttr=function(){},e.onIgnoreTag=function(){},e.onIgnoreTagAttr=function(){},e.safeAttrValue=_,e.escapeHtml=d,this.options=Object.assign(e,t)}return t.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e,n,i,r,o,a,s=this.options,u=s.whiteList,c=s.onTag,l=s.onIgnoreTag,f=s.onTagAttr,h=s.onIgnoreTagAttr,p=s.safeAttrValue,d=s.escapeHtml;s.stripBlankChar&&(t=(e=(e=t.split("")).filter(function(t){var e=t.charCodeAt(0);return!(127===e||e<=31&&10!==e&&13!==e)})).join("")),s.allowCommentTag||(t=function(t){for(var e="",n=0;n<t.length;){var i=t.indexOf("\x3c!--",n);if(-1===i){e+=t.slice(n);break}e+=t.slice(n,i);var r=t.indexOf("--\x3e",i);if(-1===r)break;n=r+3}return e}(t));var v=!1;s.stripIgnoreTagBody&&(n=s.stripIgnoreTagBody,"function"!=typeof(i=l)&&(i=function(){}),r=!Array.isArray(n),o=[],a=!1,l=(v={onIgnoreTag:function(t,e,s){var u;if(u=t,r||-1!==y.indexOf(n,u)){if(s.isClosing){var c="[/removed]",l=s.position+c.length;return o.push([!1!==a?a:s.position,l]),a=!1,c}return a||(a=s.position),"[removed]"}return i(t,e,s)},remove:function(t){var e="",n=0;return y.forEach(o,function(i){e+=t.slice(n,i[0]),n=i[1]}),e+=t.slice(n)}}).onIgnoreTag);var g=w(t,function(t,e,n,i,r){var o={sourcePosition:t,position:e,isClosing:r,isWhite:Object.prototype.hasOwnProperty.call(u,n)},a=c(n,i,o);if(null!=a)return a;if(o.isWhite){if(o.isClosing)return"</".concat(n,">");var s=function(t){var e=y.spaceIndex(t);if(-1===e)return{html:"",closing:"/"===t[t.length-2]};var n="/"===(t=y.trim(t.slice(e+1,-1)))[t.length-1];return n&&(t=y.trim(t.slice(0,-1))),{html:t,closing:n}}(i),v=u[n],g=k(s.html,function(t,e){var i=-1!==y.indexOf(v,t),r=f(n,t,e,i);return null==r?i?(e=p(n,t,e,null))?"".concat(t,'="').concat(e,'"'):t:null==(r=h(n,t,e,i))?void 0:r:r});return i="<".concat(n),g&&(i+=" ".concat(g)),s.closing&&(i+=" /"),i+=">"}return null==(a=l(n,i,o))?d(i):a},d);return v&&(g=v.remove(g)),g},t}(),O=Function("\nvar _checkXSS = function (it) {\n return it && it.Math == Math && it;\n};\nreturn _checkXSS(typeof globalThis === 'object' && globalThis) ||\n_checkXSS(typeof window === 'object' && window) ||\n_checkXSS(typeof self === 'object' && self) ||\n_checkXSS(typeof global === 'object' && global) ||\nFunction('return this')();\n")(),T=new(function(){function t(){var t=this;this.batchData=[],this.uniqKeys=new Set,this.timeout=2e3,this.lock=!1,this.getSlardarBid=function(){var e,n,i="douyin_web";if(!y.includes(i,"bid"))return i;if(t.config&&t.config.bid)return t.config.bid;if(O&&O._xssBid)return O._xssBid;if(O&&O.slardar&&"function"==typeof O.slardar.config){var r=(O.slardar.config()||{}).bid;if(r)return r}if(O&&O.Slardar&&"function"==typeof O.Slardar.config){var o=(O.Slardar.config()||{}).bid;if(o)return o}return(null===(n=null===(e=null==O?void 0:O.Slardar)||void 0===e?void 0:e._baseParams)||void 0===n?void 0:n.bid)||"argus"},this.getConfigRegion=function(){var e;return y.includes("cn","region")?t.config&&t.config.region?t.config.region:((null===(e=null==O?void 0:O.gfdatav1)||void 0===e?void 0:e.region)||"cn").toLowerCase():"cn"},this.gerReportUrl=function(){var e={cn:b("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boe:b("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),ttp:b("aHR0cHM6Ly9tb24udXMudGlrdG9rdi5jb20vbW9uaXRvcl9icm93c2VyL2NvbGxlY3QvYmF0Y2gvc2VjdXJpdHkvP2JpZD0="),va:b("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),maliva:b("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),sg:b("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boei18n:b("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9")}[t.getConfigRegion()];if(e)return e+t.getSlardarBid()}}return t.prototype.setConfig=function(t){this.config=t},t.prototype.upload=function(){var t=this,e=this.gerReportUrl();!this.lock&&e&&0!==this.batchData.length&&(this.lock=!0,setTimeout(function(){var n=t.batchData.slice(0,100);t.batchData=t.batchData.slice(100),O.fetch(e,{method:"post",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}).catch(function(t){}),t.lock=!1,t.upload()},this.timeout))},t.prototype.generateKey=function(t){return t.collectKey?[t.collectMode,t.collectKey].join("___"):""},t.prototype.push=function(t){this.batchData.push(t),this.upload()},t.prototype.report=function(t){var e=this.generateKey(t);if(O.fetch&&t.collectKey){var n="object"==typeof window?window.location.href:"SSR";t.documentUrl=n;var i={age:Math.floor(Date.now()),type:"xss",url:n,body:t,"user-agent":""};"enforce"===t.disposition&&"SSR"!==n||(i.url=e),"SSR"===n&&(i.url="SSR___".concat(i.url),i.body.ssr=!0),this.push(i)}},t}()),E=function(t){for(var e=0,n=function(n){Array.isArray(t[n])?0===t[n].length?delete t[n]:(t[n]=y.from(y.uniq(t[n])),e+=t[n].length):0===y.keys(t[n]).length?delete t[n]:y.keys(t[n]).forEach(function(i){t[n][i]=y.from(y.uniq(t[n][i])),e+=t[n][i].length})},i=0,r=y.keys(t);i<r.length;i++)n(r[i]);return{count:e,ret:t}};function C(t,e){return T.setConfig(e),new P(e).process(t)}function x(t){var e,n=(e=/\s|\n|\t/.exec(t))?e.index:-1;if(-1===n)return{html:"",closing:"/"===t[t.length-2]};var i="/"===(t=t.slice(n+1,-1).trim())[t.length-1];return i&&(t=t.slice(0,-1).trim()),{html:t,closing:i}}var j=function(t){return -1===(t=(t=(t=(t=t.replace(/&colon;/gi,":")).replace(/&tab;/gi,"")).replace(/&newline;/gi,"")).replace(/(\t|\n|\r)/g,"")).indexOf("&#")?t.trim().toLowerCase():t.trim().replace(/&#(?:(x)([0-9a-f]+)|([0-9]+));?/gi,function(t,e,n,i){return String.fromCharCode(e?parseInt(n,16):parseInt(i))}).replace(/(\t|\n|\r)/g,"").toLowerCase()};function R(t,e){if(void 0===t&&(t=""),"string"!=typeof t)return!0;if(t=j(t),y.includes(t,"base64")&&!function(t){if(""===t||""===t.trim())return!0;try{return!y.includes(t,"data:text/html;base64")}catch(t){return!0}}(t))return e&&e("data:text/html;base64"),!1;var n=["expression(","behavior:","view-source:"];if(y.some(n,function(e){return -1!==t.indexOf(e)}))return y.forEach(n,function(n){-1!==t.indexOf(n)&&e&&e(n)}),!1;var i=["data:application","data:javascript","data:text/html","data:texthtml"];if(y.some(i,function(e){return -1!==t.indexOf(e)}))return y.forEach(i,function(n){-1!==t.indexOf(n)&&e&&e(n)}),!1;if(t.indexOf("javascript:")>0)return e&&e("javascript:"),!1;if(/^javascript:/i.test(t)){var r=t.slice(11).replace(/\s/g,"").trim();return!!y.some(["void","void(0)","void0","false","undefined",";"],function(t){return t===r})||(e&&e("javascript:"),!1)}return!0}var A=function(t,e){var n,i,r="<%= isSaveValidUrl =>";if("string"!=typeof t||(i=Number("<%= urlLimit =>"),void 0!==n&&(i=n),"NaN"!==t.toString()&&-1!==i&&t.length>=i)||R(t,e))return t;try{if(!0===(r=JSON.parse(r))||"true"===r){var o=new URL(t);return o.origin+o.pathname}}catch(t){}return"#"};function L(t,e,i){if(void 0===t&&(t=""),void 0===e&&(e=[]),"string"!=typeof t)return!0;if(!R(t=j(t)))return!1;var r,o={url:(r=t.match(/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/)||[])[0],scheme:r[1],slash:r[2],host:r[3],port:r[4],path:r[5],query:r[6],hash:r[7]},a=o.scheme,s=o.host;return i?!!i(t):!(!a||!s)&&(!y.includes(["http","https","file"],a)||("object"==typeof window&&window&&(e=n(n([],e,!0),[location.host],!1)),y.some(e,function(t){return!!(t instanceof RegExp&&t.test(s))||t===s})))}var I={a:["target","title","spellcheck","rel"],canvas:[],abbr:["title"],address:[],area:["shape","coords","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:["dir"],dl:[],dt:[],em:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["alt","title","width","height","decoding"],ins:["datetime"],li:[],mark:[],nav:[],ol:["start"],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],sup:[],delete:[],form:[],strong:[],mask:["maskunits","x","y","width","height","fill"],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],wbr:[],video:["autoplay","controls","loop","preload","height","width"],svg:["viewBox","version","xmlns","fill","width","height","stroke","stroke-width","style"],path:["d","fill","opacity","stroke","p-id","fill-rule","clip-rule","stroke-width","stroke-linecap","stroke-linejoin","fill-opacity","mask"],rect:["x","y","width","height","fill","stroke","rx"],g:[]},D={collect:null,initCollect:function(){this.collect={whiteList:{},filterProtocol:[]}},removeCollect:function(){var t=E(this.collect),e=t.count,n=t.ret;return this.collect=null,{collectKey:0===e?null:JSON.stringify(n),collectMode:"white"}},onIgnoreTagAttr:function(t,e,i){return t&&y.indexOf(["href","src"],e)>-1?D.domainWhiteList&&Array.isArray(D.domainWhiteList)&&D.domainWhiteList.length>0&&!L(i,n([],D.domainWhiteList,!0))?"":"".concat(e,'="').concat(A(i,function(t){var e;null===(e=D.collect)||void 0===e||e.filterProtocol.push(t)}),'"'):t&&(y.indexOf(["style","class","id"],e)>-1||e.indexOf("data-")>-1)?"".concat(e,'="').concat(i,'"'):(D.collect.whiteList[t]=D.collect.whiteList[t]||[],void D.collect.whiteList[t].push(e))},onIgnoreTag:function(t,e){if("style"===t)return e;w(e,function(t,e,n,i){k(x(i).html.replace("/",""),function(t){D.collect.whiteList[n]=D.collect.whiteList[n]||[],D.collect.whiteList[n].push(t)})},d)},whiteList:I,mergeWhiteList:function(t){for(var e,n={},i=0,r=y.keys(I);i<r.length;i++)n[e=r[i]]=y.from(I[e]);for(var o=0,a=y.keys(t);o<a.length;o++)n[e=a[o]]=e in I?I[e].concat(t[e]):y.from(t[e]);return n},setWhiteList:function(t){for(var e=0,n=y.keys(t);e<n.length;e++){var i=n[e];this.whiteList[i]=i in I?I[i].concat(t[i]):y.from(t[i])}}};try{var N={},M="merge";y.includes(M,"override")&&(D.whiteList=N.whiteList),y.includes(M,"merge")&&D.setWhiteList(N.whiteList)}catch(t){}var B=function(t,e){for(var n={},i=0,r=y.keys(t);i<r.length;i++){var o=r[i];Array.isArray(t[o])?n[o]=y.from(t[o]):n[o]=B({},t[o])}for(var a=0,s=y.keys(e);a<s.length;a++)(o=s[a])in t?Array.isArray(t[o])?n[o]=t[o].concat(e[o]):n[o]=B(t[o],e[o]):Array.isArray(e[o])?n[o]=y.from(e[o]):n[o]=B({},e[o]);return n},F={blackList:{a:["folder"],meta:["content"],iframe:["srcdoc"],input:["pattern"],vmlframe:["xmlns"]},blackTags:["script","xml","embed","isindex","object","base","set","handler","animate","payload","import"],blackAttrs:["charset","ns","namespace","formaction","xlink:href","xmlns:xlink","handler","repeat","repeat-start","repeat-end"],blackAttrRegExps:[/^on/],filterList:{param:["value"],video:["poster"],form:["action"]},filterAttrs:["href","src","background","style","dynsrc","lowsrc","content"]};try{var H={};H.blackAttrRegExps&&(H.blackAttrRegExps=H.blackAttrRegExps.map(function(t){return new RegExp(t.toString().slice(1,t.toString().length-1))}));var U="merge";y.includes(U,"override")&&(F=H),y.includes(U,"merge")&&(F=B(F,H))}catch(t){}var W={mode:"black",whiteList:{},blackConfig:F,collect:null,initCollect:function(){W.collect={blackList:{},blackTags:[],blackAttrs:[],blackAttrRegExps:[],filterAttrs:[],filterList:{},filterProtocol:[]}},removeCollect:function(){var t=E(W.collect),e=t.count,n=t.ret;return W.collect=null,{collectKey:0===e?null:JSON.stringify(n),collectMode:"black"}},onIgnoreTag:function(t,e){var n;if(!y.includes(F.blackTags,t))return w(e,function(t,e,n,i,r){if(-1!==n.indexOf("/"))return d(i);if(r)return"</".concat(n,">");var o=x(i),a=k(o.html,function(t,e){var i,r=0;if(F.blackList[n]&&y.includes(F.blackList[n],t)&&(W.collect.blackList[n]=W.collect.blackList[n]||[],W.collect.blackList[n].push(t),r++),F.blackAttrRegExps.length&&F.blackAttrRegExps.some(function(e){return e.test(t)})&&y.forEach(F.blackAttrRegExps,function(e){e.test(t)&&(W.collect.blackAttrRegExps.push("".concat(e.toString(),"->").concat(t)),r++)}),F.blackAttrs.length&&y.includes(F.blackAttrs,t)&&(F.blackAttrs.push(t),r++),!r){if(F.filterList&&F.filterList[n]&&y.includes(F.filterList[n],t)){var o=A(e,function(t){var e;null===(e=W.collect)||void 0===e||e.filterProtocol.push(t)});return o!==e&&(W.collect.filterList[n]=W.collect.filterList[n]||[],W.collect.filterList[n].push(t)),e?"".concat(t,"='").concat(o,"'"):t}return F.filterAttrs&&y.includes(F.filterAttrs,t)?((o=A(e,function(t){var e;null===(e=W.collect)||void 0===e||e.filterProtocol.push(t)}))!==e&&(null===(i=W.collect)||void 0===i||i.filterAttrs.push(t)),e?"".concat(t,"='").concat(o,"'"):t):e?"".concat(t,"='").concat(e,"'"):t}});return i="<".concat(n),a&&(i+=" ".concat(a)),o.closing&&(i+=" /"),i+=">"},d);null===(n=W.collect)||void 0===n||n.blackTags.push(t)}},V=function(t){var e=t.reportOnly,n=void 0===e||e,i=t.block;return n&&"all"===n?"report":("string"==typeof n&&("true"===n&&(n=!0),"false"===n&&(n=!1)),i?"enforce":n?"report":"enforce")},G=function(t){return function(n,i,r){if(!n||"string"!=typeof n)return n;var o=i;t===C&&(o=D).initCollect();var a=t(n,o);if(S(a)===S(n))return n;if(!r)return a;var s=r.logType,u=V(r),c=o.removeCollect();return T.report(e(e({type:s,disposition:u},c),{sourceText:m(n),filterText:m(a)})),"enforce"===u?a:n}},z=G(function(t,e){return void 0===e&&(e={}),e&&e.whiteList||(e.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}),new P(e).process(t)}),K=G(C),Y=function(t,e,n){var i=[],r=A(t,function(t){i.push(t)});if(r===t)return t;i=y.from(y.uniq(i));var o=e||n||{};if(!o)return r;var a=o.logType,s=V(n);return T.report({type:a,disposition:s,collectKey:i.join("___"),collectData:JSON.stringify(i),collectMode:"black",sourceText:m(t),filterText:m(r)}),"enforce"===s?r:t},X=O._xssProject||{},q=O.xssNamespace||{},J="3.0.26",Z={FilterXSS:P,version:J,webpackPluginVersion:"<%= webpackPluginVersion =>",reportOnly:"<%= reportOnly =>",filterXSS:z,_filterXSS:K,filterUrl:Y,Config:D,BlackConfig:W,project:X,setProjectName:function(t){X[t]=this,O._xssProjectName=t}};q.douyin_web=Z,O.xssNamespace=q,O.Math&&!O.Math.xssNamespace&&(O.Math.xssNamespace=q),X[J]=Z,O.globalThis=O,O.getFilterXss=function(){return void 0!==this._xssProjectName?this._xssProject[this._xssProjectName]:Z},O.xss=Z,O.isSafeUrl=L,O.isSafeDomain=L,O.isSafeProtocol=R,O._xssProject=X,O._xssProjectName&&(X[O._xssProjectName]=Z);var $=Z.setProjectName.bind(Z);t.BlackConfig=W,t.Config=D,t.FilterXSS=P,t._filterXSS=K,t.filterUrl=Y,t.filterXSS=z,t.isSafeDomain=L,t.isSafeProtocol=R,t.isSafeUrl=L,t.project=X,t.setProjectName=$,t.setXssNamespace=function(t){var e=t.appId,n=t.bid,i=t.region;q[e]=Z;D.bid=n,D.region=i,D.enabled=!0},t.xssNamespace=q,Object.defineProperty(t,"__esModule",{value:!0})}),!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.pace=e():t.pace=e()}(self,function(){return function(){var t={27377:function(t){if("undefined"!=typeof Element&&!Element.prototype.matches){var e=Element.prototype;e.matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},59798:function(t,e,n){var i=n(27377);function r(t,e,n,i,r){var a=o.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function o(t,e,n,r){return function(n){n.delegateTarget=i(n.target,e),n.delegateTarget&&r.call(t,n)}}t.exports=function(t,e,n,i,o){return"function"==typeof t.addEventListener?r.apply(null,arguments):"function"==typeof n?r.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return r(t,e,n,i,o)}))}},78108:function(t){var e,n;e=0,n=function(){return function t(e,n,i){var r,o,a=window,s="application/octet-stream",u=i||s,c=e,l=!n&&!i&&c,f=document.createElement("a"),h=function(t){return String(t)},p=a.Blob||a.MozBlob||a.WebKitBlob||h,d=n||"download";if(p=p.call?p.bind(a):Blob,"true"===String(this)&&(u=(c=[c,u])[0],c=c[1]),l&&l.length<2048&&(d=l.split("/").pop().split("?")[0],f.href=l,-1!==f.href.indexOf(l))){var y=new XMLHttpRequest;return y.open("GET",l,!0),y.responseType="blob",y.onload=function(e){t(e.target.response,d,s)},setTimeout(function(){y.send()},0),y}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(c.length>2096103.424)||p===h)return navigator.msSaveBlob?navigator.msSaveBlob(b(c),d):w(c);u=(c=b(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var v=0,g=new Uint8Array(c.length),m=g.length;v<m;++v)g[v]=c.charCodeAt(v);c=new p([g],{type:u})}function b(t){for(var e=t.split(/[:;,]/),n=e[1],i=("base64"==e[2]?atob:decodeURIComponent)(e.pop()),r=i.length,o=0,a=new Uint8Array(r);o<r;++o)a[o]=i.charCodeAt(o);return new p([a],{type:n})}function w(t,e){if("download"in f)return f.href=t,f.setAttribute("download",d),f.className="download-js-link",f.innerHTML="downloading...",f.style.display="none",document.body.appendChild(f),setTimeout(function(){f.click(),document.body.removeChild(f),!0===e&&setTimeout(function(){a.URL.revokeObjectURL(f.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(t)&&(t="data:"+t.replace(/^data:([\w\/\-\+]+)/,s)),!window.open(t)&&confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=t),!0;var n=document.createElement("iframe");document.body.appendChild(n),!e&&/^data:/.test(t)&&(t="data:"+t.replace(/^data:([\w\/\-\+]+)/,s)),n.src=t,setTimeout(function(){document.body.removeChild(n)},333)}if(r=c instanceof p?c:new p([c],{type:u}),navigator.msSaveBlob)return navigator.msSaveBlob(r,d);if(a.URL)w(a.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===h)try{return w("data:"+u+";base64,"+a.btoa(r))}catch(t){return w("data:"+u+","+encodeURIComponent(r))}(o=new FileReader).onload=function(t){w(this.result)},o.readAsDataURL(r)}return!0}},"function"==typeof define&&define.amd?define([],n):t.exports=n()},58059:function(t){"use strict";var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,i,o,a){if("function"!=typeof i)throw TypeError("The listener must be a function");var s=new r(i,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),!new i().__proto__&&(n=!1)),s.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,a=Array(o);r<o;r++)a[r]=i[r].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},s.prototype.emit=function(t,e,i,r,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,r),!0;case 5:return l.fn.call(l.context,e,i,r,o),!0;case 6:return l.fn.call(l.context,e,i,r,o,a),!0}for(c=1,u=Array(f-1);c<f;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var h,p=l.length;for(c=0;c<p;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),f){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,i);break;case 4:l[c].fn.call(l[c].context,e,i,r);break;default:if(!u)for(h=1,u=Array(f-1);h<f;h++)u[h-1]=arguments[h];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,i,r){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn===e&&(!r||s.once)&&(!i||s.context===i)&&a(this,o);else{for(var u=0,c=[],l=s.length;u<l;u++)(s[u].fn!==e||r&&!s[u].once||i&&s[u].context!==i)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s;t.exports=s}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}return n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.rv=function(){return"1.0.0-canary-8758c59-20240816041638"},n.ruid="bundler=rspack@1.0.0-canary-8758c59-20240816041638",!function(){"use strict";var t,e,i,r,o,a,s,u={};n.r(u),n.d(u,{ABORT:function(){return q},AFTER_DEFINITION_CHANGE:function(){return tv},AUTOPLAY_PREVENTED:function(){return tn},AUTOPLAY_STARTED:function(){return te},BEFORE_DEFINITION_CHANGE:function(){return ty},BUFFER_CHANGE:function(){return J},BUFFER_CONTROLS:function(){return tu},CANPLAY:function(){return M},CANPLAY_THROUGH:function(){return B},COMPLETE:function(){return ti},CSS_FULLSCREEN_CHANGE:function(){return th},DEFINITION_CHANGE:function(){return td},DEGRADE:function(){return tI},DESTROY:function(){return to},DOWNLOAD_SPEED_CHANGE:function(){return ts},DURATION_CHANGE:function(){return F},EMPTIED:function(){return K},ENDED:function(){return j},ERROR:function(){return A},FPS_STUCK:function(){return tL},FULLSCREEN_CHANGE:function(){return tf},FULLSCREEN_REQUEST:function(){return tl},LOADED_DATA:function(){return U},LOADED_METADATA:function(){return W},LOAD_START:function(){return z},MINI_STATE_CHANGE:function(){return tp},PAUSE:function(){return R},PIP_CHANGE:function(){return tw},PLAY:function(){return C},PLAYER_BLUR:function(){return $},PLAYER_FOCUS:function(){return Z},PLAYING:function(){return x},PLAYNEXT:function(){return tS},PLAY_ABORTED:function(){return tc},PROGRESS:function(){return G},RATE_CHANGE:function(){return V},READY:function(){return Q},REPLAY:function(){return tr},RESET:function(){return tE},RETRY:function(){return tm},ROTATE:function(){return tk},SCREEN_SHOT:function(){return t_},SEEKED:function(){return I},SEEKING:function(){return L},SEI_PARSED:function(){return tg},SHORTCUT:function(){return tP},SOURCE_ERROR:function(){return tC},SOURCE_SUCCESS:function(){return tx},STALLED:function(){return Y},STATS_EVENTS:function(){return tA},SUSPEND:function(){return X},SWITCH_SUBTITLE:function(){return tj},TIME_UPDATE:function(){return D},URL_CHANGE:function(){return ta},URL_NULL:function(){return tt},USER_ACTION:function(){return tT},VIDEO_EVENTS:function(){return tR},VIDEO_RESIZE:function(){return tb},VOLUME_CHANGE:function(){return H},WAITING:function(){return N},XGLOG:function(){return tO}});var c={};n.r(c),n.d(c,{BUFFER_CONTROL_TYPES:function(){return eo},BasePlugin:function(){return eS},Errors:function(){return E},Events:function(){return u},I18N:function(){return e7},InstManager:function(){return ns},PAUSE_TYPES:function(){return er},Plugin:function(){return eN},STATE_CLASS:function(){return eV},SimplePlayer:function(){return nS},Sniffer:function(){return t$},TestSpeed:function(){return sE},Util:function(){return _},default:function(){return sG}});var l=n("58059"),f=n.n(l),h=JSON.parse('"3.0.0-alpha.174-1"'),p="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,d={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},y="%c[xgplayer]",v={config:{debug:p?3:1},logInfo:function(t){for(var e,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=3&&(e=console).log.apply(e,[y,d.info,t].concat(i))},logWarn:function(t){for(var e,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=1&&(e=console).warn.apply(e,[y,d.warn,t].concat(i))},logError:function(t){if(!(this.config.debug<1)){for(var e,n=this.config.debug>=2?"trace":"error",i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];(e=console)[n].apply(e,[y,d.error,t].concat(r))}}};function g(t){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==g(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==g(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===g(e)?e:String(e)}(i.key),i)}}var b=function(){var t,e,n;function i(t){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),this.bufferedList=t}return t=i,e=[{key:"start",value:function(t){return this.bufferedList[t].start}},{key:"end",value:function(t){return this.bufferedList[t].end}},{key:"length",get:function(){return this.bufferedList.length}}],m(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),i}();function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function k(t){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var _={};_.createDom=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(t);return r.className=i,r.innerHTML=e,Object.keys(n).forEach(function(e){var i=n[e];"video"===t||"audio"===t||"live-video"===t?i&&r.setAttribute(e,i):r.setAttribute(e,i)}),r},_.createDomFromHtml=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var i=document.createElement("div");i.innerHTML=t;var r=i.children;if(i=null,r.length>0)return r=r[0],n&&_.addClass(r,n),e&&Object.keys(e).forEach(function(t){r.setAttribute(t,e[t])}),r;return null}catch(t){return v.logError("util.createDomFromHtml",t),null}},_.hasClass=function(t,e){if(!t||!e)return!1;try{return Array.prototype.some.call(t.classList,function(t){return t===e})}catch(i){var n=t.className&&"object"===k(t.className)?t.getAttribute("class"):t.className;return n&&!!n.match(RegExp("(\\s|^)"+e+"(\\s|$)"))}},_.addClass=function(t,e){if(!!t&&!!e)try{e.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(e){e&&t.classList.add(e)})}catch(n){!_.hasClass(t,e)&&(t.className&&"object"===k(t.className)?t.setAttribute("class",t.getAttribute("class")+" "+e):t.className+=" "+e)}},_.removeClass=function(t,e){if(!!t&&!!e)try{e.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach(function(e){e&&t.classList.remove(e)})}catch(n){_.hasClass(t,e)&&e.split(/\s+/g).forEach(function(e){var n=RegExp("(\\s|^)"+e+"(\\s|$)");t.className&&"object"===k(t.className)?t.setAttribute("class",t.getAttribute("class").replace(n," ")):t.className=t.className.replace(n," ")})}},_.toggleClass=function(t,e){if(!!t)e.split(/\s+/g).forEach(function(e){_.hasClass(t,e)?_.removeClass(t,e):_.addClass(t,e)})},_.classNames=function(){for(var t=arguments,e=[],n=function(n){"String"===_.typeOf(t[n])?e.push(t[n]):"Object"===_.typeOf(t[n])&&Object.keys(t[n]).map(function(i){t[n][i]&&e.push(i)})},i=0;i<arguments.length;i++)n(i);return e.join(" ")},_.findDom=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1?arguments[1]:void 0;try{t=e.querySelector(n)}catch(i){v.logError("util.findDom",i),0===n.indexOf("#")&&(t=e.getElementById(n.slice(1)))}return t},_.getCss=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,!1)[e]},_.padStart=function(t,e,n){for(var i=String(n),r=e>>0,o=Math.ceil(r/i.length),a=[],s=String(t);o--;)a.push(i);return a.join("").substring(0,r-s.length)+s},_.format=function(t){if(window.isNaN(t))return"";t=Math.round(t);var e=_.padStart(Math.floor(t/3600),2,0),n=_.padStart(Math.floor((t-3600*e)/60),2,0),i=_.padStart(Math.floor(t-3600*e-60*n),2,0);return("00"===e?[n,i]:[e,n,i]).join(":")},_.event=function(t){if(t.touches){var e=t.touches[0]||t.changedTouches[0];t.clientX=e.clientX||0,t.clientY=e.clientY||0,t.offsetX=e.pageX-e.target.offsetLeft,t.offsetY=e.pageY-e.target.offsetTop}t._target=t.target||t.srcElement},_.typeOf=function(t){return Object.prototype.toString.call(t).match(/([^\s.*]+)(?=]$)/g)[0]},_.deepCopy=function(t,e){if("Object"===_.typeOf(e)&&"Object"===_.typeOf(t))return Object.keys(e).forEach(function(n){"Object"!==_.typeOf(e[n])||e[n]instanceof Node?"Array"===_.typeOf(e[n])?t[n]="Array"===_.typeOf(t[n])?t[n].concat(e[n]):e[n]:t[n]=e[n]:void 0===t[n]||void 0===t[n]?t[n]=e[n]:_.deepCopy(t[n],e[n])}),t},_.deepMerge=function(t,e){return Object.keys(e).map(function(n){if("Array"===_.typeOf(e[n])&&"Array"===_.typeOf(t[n])){if("Array"===_.typeOf(t[n])){var i,r;(i=t[n]).push.apply(i,function(t){if(Array.isArray(t))return w(t)}(r=e[n])||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(t,e)}}(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}}else _.typeOf(t[n])!==_.typeOf(e[n])||null===t[n]||"Object"!==_.typeOf(t[n])||e[n]instanceof window.Node?null!==e[n]&&(t[n]=e[n]):_.deepMerge(t[n],e[n])}),t},_.getBgImage=function(t){var e=(t.currentStyle||window.getComputedStyle(t,null)).backgroundImage;if(!e||"none"===e)return"";var n=document.createElement("a");return n.href=e.replace(/url\("|"\)/g,""),n.href},_.copyDom=function(t){if(!t||1!==t.nodeType)return"";var e=document.createElement(t.tagName);return Array.prototype.forEach.call(t.attributes,function(t){e.setAttribute(t.name,t.value)}),t.innerHTML&&(e.innerHTML=t.innerHTML),e},_.setInterval=function(t,e,n,i){!t._interval[e]&&(t._interval[e]=window.setInterval(n.bind(t),i))},_.clearInterval=function(t,e){clearInterval(t._interval[e]),t._interval[e]=null},_.setTimeout=function(t,e,n){!t._timers&&(t._timers=[]);var i=setTimeout(function(){e(),_.clearTimeout(t,i)},n);return t._timers.push(i),i},_.clearTimeout=function(t,e){var n=t._timers;if("Array"===_.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===e){n.splice(i,1),clearTimeout(e);break}}else clearTimeout(e)},_.clearAllTimers=function(t){var e=t._timers;"Array"===_.typeOf(e)&&(e.map(function(t){clearTimeout(t)}),t._timerIds=[])},_.createImgBtn=function(t,e,n,i){var r,o,a,s=_.createDom("xg-".concat(t),"",{},"xgplayer-".concat(t,"-img"));return s.style.backgroundImage='url("'.concat(e,'")'),n&&i&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every(function(t){return!(n.indexOf(t)>-1&&i.indexOf(t)>-1)||(r=parseFloat(n.slice(0,n.indexOf(t)).trim()),o=parseFloat(i.slice(0,i.indexOf(t)).trim()),a=t,!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),"start"===t?s.style.margin="-".concat(o/2).concat(a," auto auto -").concat(r/2).concat(a):s.style.margin="auto 5px auto 5px"),s},_.Hex2RGBA=function(t,e){var n=[];if(/^\#[0-9A-F]{3}$/i.test(t)){var i="#";t.replace(/[0-9A-F]/ig,function(t){i+=t+t}),t=i}return/^#[0-9A-F]{6}$/i.test(t)?(t.replace(/[0-9A-F]{2}/ig,function(t){n.push(parseInt(t,16))}),"rgba(".concat(n.join(","),", ").concat(e,")")):"rgba(255, 255, 255, 0.1)"},_.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},_.checkIsFunction=function(t){return t&&"function"==typeof t},_.checkIsObject=function(t){return null!==t&&"object"===k(t)},_.hide=function(t){t.style.display="none"},_.show=function(t,e){t.style.display=e||"block"},_.isUndefined=function(t){if(null==t)return!0},_.setStyleFromCsstext=function(t,e){if(!!e)"String"===_.typeOf(e)?e.replace(/\s+/g,"").split(";").map(function(e){if(e){var n=e.split(":");n.length>1&&(t.style[n[0]]=n[1])}}):Object.keys(e).map(function(n){t.style[n]=e[n]})};function S(t){var e=k(t);return null!==t&&("object"===e||"function"===e)}_.filterStyleFromText=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=t.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),r={},o={};return i.map(function(t){if(t){var n=t.split(":");n.length>1&&(function(t,e){for(var n=0,i=e.length;n<i;n++)if(t.indexOf(e[n])>-1)return!0;return!1}(n[0],e)?r[n[0]]=n[1]:o[n[0]]=n[1])}}),t.setAttribute("style",""),Object.keys(o).map(function(e){t.style[e]=o[e]}),r},_.getStyleFromCsstext=function(t){var e=t.style.cssText;if(!e)return{};var n=e.replace(/\s+/g,"").split(";"),i={};return n.map(function(t){if(t){var e=t.split(":");e.length>1&&(i[e[0]]=e[1])}}),i},_.preloadImg=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(!!t){var i=new window.Image;i.onload=function(t){i=null,e&&e(t)},i.onerror=function(t){i=null,n&&n(t)},i.src=t}},_.stopPropagation=function(t){t&&(t.stopPropagation(),t.cancelable&&t.preventDefault())},_.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},_.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},_.checkTouchSupport=function(){return"ontouchstart"in window},_.getBuffered2=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],i=0;i<t.length;i++)n.push({start:.5>t.start(i)?0:t.start(i),end:t.end(i)});n.sort(function(t,e){var n=t.start-e.start;return n?n:e.end-t.end});var r=[];if(e)for(var o=0;o<n.length;o++){var a=r.length;if(a){var s=r[a-1].end;n[o].start-s<e?n[o].end>s&&(r[a-1].end=n[o].end):r.push(n[o])}else r.push(n[o])}else r=n;return new b(r)},_.getBufferByCurrentTime=function(t,e){var n={start:0,end:0,include:0,diff:0,cur:e};if(!t||t.length<1)return n;for(var i=-1,r=-1,o=parseInt(1e3*e,10),a=t.length-1;a>-1;a--){var s=parseInt(1e3*t.start(a),10),u=parseInt(1e3*t.end(a),10);if(o>=s&&o<=u){n.include=1,n.start=s/1e3,n.end=u/1e3,n.diff=(u-o)/1e3;break}o<s&&(i<0||s-o<i)?(i=(s-o)/1e3,r=a):o>u&&(i<0||o-u<i)&&(i=(o-u)/1e3,r=a)}return 1!==n.include&&(r<0&&(r=t.length-1),n.start=parseInt(1e3*t.start(r),10)/1e3,n.end=parseInt(1e3*t.end(r),10)/1e3,n.diff=(parseInt(1e3*n.end,10)-o)/1e3),n},_.getEventPos=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t.touches&&t.touches.length>0&&(t=t.touches[0]),{x:t.x/e,y:t.y/e,clientX:t.clientX/e,clientY:t.clientY/e,offsetX:t.offsetX/e,offsetY:t.offsetY/e,pageX:t.pageX/e,pageY:t.pageY/e}},_.requestAnimationFrame=function(t){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(e)return e(t)},_.getHostFromUrl=function(t){if("String"!==_.typeOf(t))return"";var e=t.split("/"),n="";return e.length>3&&e[2]&&(n=e[2]),n},_.cancelAnimationFrame=function(t){var e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;e&&e(t)},_.isMSE=function(t){return t.media&&(t=t.media),!!(t&&t instanceof HTMLMediaElement)&&(/^blob/.test(t.currentSrc)||/^blob/.test(t.src))},_.isBlob=function(t){return"string"==typeof t&&/^blob/.test(t)},_.generateSessionId=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=new Date().getTime();try{t=parseInt(t)}catch(e){t=0}return e+=t,window.performance&&"function"==typeof window.performance.now&&(e+=parseInt(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)})},_.adjustTimeByDuration=function(t,e,n){return e&&t?t>e||n&&t<e?e:t:t},_.getTransformStyle=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,scale:1,rotate:0},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={scale:"".concat(t.scale||1),translate:"".concat(t.x||0,"%, ").concat(t.y||0,"%"),rotate:"".concat(t.rotate||0,"deg")};return Object.keys(n).forEach(function(t){var i=RegExp("".concat(t,"\\([^\\(]+\\)"),"g"),r="".concat(t,"(").concat(n[t],")");i.test(e)?(i.lastIndex=-1,e=e.replace(i,r)):e+="".concat(r," ")}),e},_.convertDeg=function(t){return 1>=Math.abs(t)?360*t:t%360};function P(t){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function O(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==P(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==P(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===P(e)?e:String(e)}(i.key),i)}}var T={1:"network",2:"network",3:"decoder",4:"format"};var E=(t=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null,src:null};!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,t);var i=e&&e.i18n?e.i18n.ERROR_TYPES:null;if(null!=e&&e.video){var r=n.mediaError?n.mediaError:e.video.error||{},o=e.duration,a=e.currentTime,s=e.ended,u=e.src,c=e.currentSrc,l=e.video,f=l.readyState,p=l.networkState,d={playerVersion:h,domain:document.domain,currentTime:a,duration:o,ended:s,readyState:f,networkState:p,src:n.src||u||c,errorType:n.errorType,errorCode:n.errorCode||r.code,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:"",host:_.getHostFromUrl(u||c)};return n.ext&&Object.keys(n.ext).map(function(t){d[t]=n.ext[t]}),d}if(arguments.length>1){for(var y={playerVersion:h,domain:document.domain},v=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],g=0;g<arguments.length;g++)y[v[g]]=arguments[g];return y.ex=i?(i[arguments[0]]||{}).msg:"",y}},Object.defineProperty(t,"prototype",{writable:!1}),t),C="play",x="playing",j="ended",R="pause",A="error",L="seeking",I="seeked",D="timeupdate",N="waiting",M="canplay",B="canplaythrough",F="durationchange",H="volumechange",U="loadeddata",W="loadedmetadata",V="ratechange",G="progress",z="loadstart",K="emptied",Y="stalled",X="suspend",q="abort",J="bufferedChange",Z="focus",$="blur",Q="ready",tt="urlNull",te="autoplay_started",tn="autoplay_was_prevented",ti="complete",tr="replay",to="destroy",ta="urlchange",ts="download_speed_change",tu="buffer_control",tc="AbortError",tl="fullscreen_request",tf="fullscreen_change",th="cssFullscreen_change",tp="mini_state_change",td="definition_change",ty="before_definition_change",tv="after_definition_change",tg="SEI_PARSED",tm="retry",tb="video_resize",tw="pip_change",tk="rotate",t_="screenShot",tS="playnext",tP="shortcut",tO="xglog",tT="user_action",tE="reset",tC="source_error",tx="source_success",tj="switch_subtitle",tR=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode","mseAttaching","mseAttached","mseDetaching","mseDetached"],tA={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},tL="fps_stuck",tI="degrade",tD={android:/(Android)\s([\d.]+)/,ios:/(Version)\/([\d.]+)/},tN=["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"],tM={get device(){return tM.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var tB=navigator.userAgent.toLowerCase(),tF={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(tF).filter(function(t){return tF[t].test(tB)}))[0]},get os(){if("undefined"==typeof navigator)return{};var tH=navigator.userAgent,tU=/(?:Windows Phone)/.test(tH),tW=/(?:SymbianOS)/.test(tH)||tU,tV=/(?:Android)/.test(tH),tG=/(?:Firefox)/.test(tH),tz=/(?:iPad|PlayBook)/.test(tH)||tV&&!/(?:Mobile)/.test(tH)||tG&&/(?:Tablet)/.test(tH),tK=/(?:iPhone)/.test(tH)&&!tz,tY=/(?:iPad|PlayBook)/.test(tH);return{isTablet:tz,isPhone:tK,isIpad:tY,isIos:tK||tY,isAndroid:tV,isPc:!tK&&!tV&&!tW&&!tz,isSymbian:tW,isWindowsPhone:tU,isFireFox:tG}},get osVersion(){if("undefined"==typeof navigator)return 0;var tX=navigator.userAgent,tq="",tJ=(tq=/(?:iPhone)|(?:iPad|PlayBook)/.test(tX)?tD.ios:tD.android)?tq.exec(tX):[];if(tJ&&tJ.length>=3){var tZ=tJ[2].split(".");return tZ.length>0?parseInt(tZ[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;if(/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase()))return!0;return!1},isSupportMP4:function(){var t={isSupport:!1,mime:""};if("undefined"==typeof document)return t;if(this.supportResult)return this.supportResult;var e=document.createElement("video");return"function"==typeof e.canPlayType&&tN.map(function(n){"probably"===e.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(t.isSupport=!0,t.mime+="||".concat(n))}),this.supportResult=t,e=null,t},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(t){var e={supported:!1,smooth:!1,powerEfficient:!1};if(!t||"undefined"==typeof navigator)return Promise.resolve(e);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(t);var n=t.video||{},i=t.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(t){return Promise.resolve(e)}},isHdrSupported:function(){if("function"==typeof matchMedia){var t=matchMedia("(dynamic-range: high)"),e=matchMedia("not supported query");return t.media!==e.media&&!0===t.matches}return!1},isDolbyHdrSupported:function(){if("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)return!1;var t=function(){if("undefined"!=typeof navigator){var t=null;if(void 0===s){var e=navigator.userAgent.toLowerCase();s=/chrome\/([\d.]+)/.exec(e)}if((t=s)&&t[1]&&parseInt(t[1].split(".")[0])>=122)return!0}return!1};return tM.isHdrSupported()&&(MediaSource.isTypeSupported('video/mp4;codecs="dvh1.08.07"')||MediaSource.isTypeSupported('video/mp4;codecs="hvc1.2.4.L150.90"')&&t())}},t$=tM;function tQ(t){return(tQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function t0(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,t1(i.key),i)}}function t1(t){var e=function(t,e){if("object"!==tQ(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==tQ(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===tQ(e)?e:String(e)}function t2(){return(t2="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=t4(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function t3(t,e){return(t3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function t4(t){return(t4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function t5(t,e){if(!!this&&!!this.emit)"error"===t?this.errorHandler(t,e.error):this.emit(t,e)}var t6=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&t3(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=t4(e);return t=n?Reflect.construct(i,arguments,t4(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===tQ(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this,t))._hasStart=!1,e._currentTime=0,e._duration=0,e._internalOp={},e._lastMuted=!1,e.vtype=t.vtype||"MP4",e.bizType="number"==typeof t.bizType&&t.bizType>=0?t.bizType:0,e._rate=-1,e.videoConfig=Object.assign({},{controls:!1,autoplay:t.autoplay,playsinline:t.playsinline,"x5-playsinline":t.playsinline,"webkit-playsinline":t.playsinline,"x5-video-player-fullscreen":t["x5-video-player-fullscreen"]||t.x5VideoPlayerFullscreen,"x5-video-orientation":t["x5-video-orientation"]||t.x5VideoOrientation,airplay:t.airplay,"webkit-airplay":t.airplay,tabindex:0|t.tabindex,mediaType:t.mediaType||"video","data-index":-1},t.videoConfig,t.videoAttributes);var e,n=t["x5-video-player-type"]||t.x5VideoPlayerType;return t$.isWeixin&&t$.os.isAndroid&&n&&(e.videoConfig["x5-video-player-type"]=n,delete e.videoConfig.playsinline,delete e.videoConfig["webkit-playsinline"],delete e.videoConfig["x5-playsinline"]),t.loop&&(e.videoConfig.loop="loop"),e.video=_.createDom(e.videoConfig.mediaType,"",e.videoConfig,""),t.defaultPlaybackRate&&(e.video.defaultPlaybackRate=e.video.playbackRate=t.defaultPlaybackRate),"Number"===_.typeOf(t.volume)&&(e.volume=t.volume),t.autoplayMuted&&(e.video.muted=!0,e._lastMuted=!0),t.autoplay&&(e.video.autoplay=!0),e._interval={},e.videoEventMiddleware={},e.attachVideoEvents(),e}return i=s,r=[{key:"setEventsMiddleware",value:function(t){var e=this;Object.keys(t).map(function(n){e.videoEventMiddleware[n]=t[n]})}},{key:"removeEventsMiddleware",value:function(t){var e=this;Object.keys(t).map(function(t){delete e.videoEventMiddleware[t]})}},{key:"attachVideoEvents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];!this.evHandlers&&(this._evHandlers=tR.map(function(t){var n,i,r,o,a,s;return o={},a=t,s=(n=t,(i=e)[r="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1))]&&"function"==typeof i[r]&&i.on(n,i[r]),function(t,e){var r={player:i,eventName:n,originalEvent:t,detail:t.detail||{},timeStamp:t.timeStamp,currentTime:i.currentTime,duration:i.duration,paused:i.paused,ended:i.ended,isInternalOp:!!i._internalOp[t.type],muted:i.muted,volume:i.volume,host:_.getHostFromUrl(i.currentSrc),vtype:i.vtype};if(i.removeInnerOP(t.type),"timeupdate"===n&&(i._currentTime=i.video&&i.video.currentTime),"ratechange"===n){var o=i.video?i.video.playbackRate:0;if(o&&i._rate===o)return;i._rate=i.video&&i.video.playbackRate}if("durationchange"===n&&(i._duration=i.video.duration),"volumechange"===n&&(r.isMutedChange=i._lastMuted!==i.muted,i._lastMuted=i.muted),"error"===n&&(r.error=e||i.video.error),i.videoEventMiddleware[n]){var a=t5.bind(i,n,r);try{i.videoEventMiddleware[n].call(i,r,a)}catch(t){throw t5.call(i,n,r),t}}else t5.call(i,n,r)}),(a=t1(a))in o?Object.defineProperty(o,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[a]=s,o})),!t&&(t=this.video),this._evHandlers.forEach(function(e){var i=Object.keys(e)[0];(0===n.length||n.indexOf(i)>-1)&&t.addEventListener(i,e[i],!1)})}},{key:"detachVideoEvents",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];!t&&(t=this.video),this._evHandlers.forEach(function(n){var i=Object.keys(n)[0];(0===e.length||e.indexOf(i)>-1)&&t.removeEventListener(i,n[i],!1)})}},{key:"_attachSourceEvents",value:function(t,e){var n=this;t.removeAttribute("src"),t.load(),t.removeEventListener("loadeddata",this._vLoadeddata),e.forEach(function(t){n.video.appendChild(_.createDom("source","",{src:"".concat(t.src),type:"".concat(t.type||"")}))});var i=t.children;if(!!i){this._videoSourceCount=i.length,this._vLoadeddata=function(t){n.emit(tx,{src:t.target.currentSrc,host:_.getHostFromUrl(t.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(t){if(n._videoSourceCount--,0===n._videoSourceCount){var e={code:4,message:"sources_load_error"};r?r.error(t,e):n.errorHandler("error",e)}var i=T["4"];n.emit(tC,new E(n,{errorType:i,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:t.target.src}))});for(var a=0;a<i.length;a++)i[a].addEventListener("error",this._sourceError);t.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(t){var e=t.children;if(!!e&&0!==e.length&&!!this._sourceError){for(var n=0;n<e.length;n++)e[n].removeEventListener("error",this._sourceError);for(;e.length>0;)t.removeChild(e[0]);this._vLoadeddata&&t.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.video&&(this.video.error||e)){var n=this.video.error||e,i=n.code?T[n.code]:"other",r=n.message||"";!this.video.currentSrc&&(n={code:6,message:r="empty_src_".concat(n.message)}),this.emit(t,new E(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"hasStart",get:function(){return this._hasStart},set:function(t){"boolean"==typeof t&&(this._hasStart=t,this.emit("hasstart"))}},{key:"destroy",value:function(){var t=this;for(var e in this.video&&(this.video.pause&&(this.video.pause(),this.video.muted=!0),this.video.removeAttribute("src"),this.video.load()),this._currentTime=0,this._duration=0,this._hasStart=!1,this.videoConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,e)&&(clearInterval(this._interval[e]),this._interval[e]=null);this.detachVideoEvents(),this._evHandlers.map(function(e){var n=Object.keys(e)[0],i="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));"function"==typeof t[i]&&t.off(n,t[i])}),this._evHandlers=null,this.video=null,this.videoEventMiddleware={},this.removeAllListeners()}},{key:"play",value:function(){return this.video?this.video.play():null}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"load",value:function(){this.video&&this.video.load()}},{key:"canPlayType",value:function(t){return!!this.video&&this.video.canPlayType(t)}},{key:"getBufferedRange",value:function(t){var e=[0,0];if(!this.video)return e;!t&&(t=this.video.buffered);var n=this.video.currentTime;if(t)for(var i=0,r=t.length;i<r&&(e[0]=t.start(i),e[1]=t.end(i),!(e[0]<=n)||!(n<=e[1]));i++);return e[0]-n<=0&&n-e[1]<=0?e:[0,0]}},{key:"autoplay",get:function(){return!!this.video&&this.video.autoplay},set:function(t){this.video&&(this.video.autoplay=t)}},{key:"buffered",get:function(){return this.video?this.video.buffered:null}},{key:"buffered2",get:function(){return this.video?_.getBuffered2(this.video.buffered):null}},{key:"bufferedPoint",get:function(){var t={start:0,end:0};if(!this.video)return t;var e=this.video.buffered;if(!e||0===e.length)return t;for(var n=0;n<e.length;n++)if((e.start(n)<=this.currentTime||.1>e.start(n))&&e.end(n)>=this.currentTime)return{start:e.start(n),end:e.end(n)};return t}},{key:"crossOrigin",get:function(){return this.video?this.video.crossOrigin:""},set:function(t){this.video&&(this.video.crossOrigin=t)}},{key:"currentSrc",get:function(){return this.video?this.video.currentSrc:""},set:function(t){this.video&&(this.video.currentSrc=t)}},{key:"currentTime",get:function(){return this.video?void 0!==this.video.currentTime?this.video.currentTime:this._currentTime:0},set:function(t){this.video&&(this.video.currentTime=t)}},{key:"defaultMuted",get:function(){return!!this.video&&this.video.defaultMuted},set:function(t){this.video&&(this.video.defaultMuted=t)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.video&&this.video.ended}},{key:"error",get:function(){return this.video&&this.video.error?["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.video.error.code-1]:null}},{key:"loop",get:function(){return!!this.video&&this.video.loop},set:function(t){this.video&&(this.video.loop=t)}},{key:"muted",get:function(){return!!this.video&&this.video.muted},set:function(t){if(!!this.video&&this.video.muted!==t)this._lastMuted=this.video.muted,this.video.muted=t}},{key:"networkState",get:function(){return this.video?this.video.networkState:0}},{key:"paused",get:function(){return!this.video||this.video.paused}},{key:"playbackRate",get:function(){return this.video?this.video.playbackRate:0},set:function(t){if(!!this.video&&t!==1/0)this.video.defaultPlaybackRate=t,this.video.playbackRate=t}},{key:"played",get:function(){return this.video?this.video.played:null}},{key:"preload",get:function(){return!!this.video&&this.video.preload},set:function(t){this.video&&(this.video.preload=t)}},{key:"readyState",get:function(){return this.video?this.video.readyState:0}},{key:"seekable",get:function(){return!!this.video&&this.video.seekable}},{key:"seeking",get:function(){return!!this.video&&this.video.seeking}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(t){this.video.src=t}},{key:"volume",get:function(){return this.video?this.video.volume:0},set:function(t){if("number"==typeof t&&!(t<0)&&!(t>1)&&!!this.video)this.video.volume=t}},{key:"addInnerOP",value:function(t){this._internalOp[t]=!0}},{key:"removeInnerOP",value:function(t){delete this._internalOp[t]}},{key:"emit",value:function(t,e){for(var n,i=arguments.length,r=Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];(n=t2(t4(s.prototype),"emit",this)).call.apply(n,[this,t,e].concat(r))}},{key:"on",value:function(t,e){for(var n,i=arguments.length,r=Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];(n=t2(t4(s.prototype),"on",this)).call.apply(n,[this,t,e].concat(r))}},{key:"once",value:function(t,e){for(var n,i=arguments.length,r=Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];(n=t2(t4(s.prototype),"once",this)).call.apply(n,[this,t,e].concat(r))}},{key:"off",value:function(t,e){for(var n,i=arguments.length,r=Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];(n=t2(t4(s.prototype),"off",this)).call.apply(n,[this,t,e].concat(r))}},{key:"offAll",value:function(){t2(t4(s.prototype),"removeAllListeners",this).call(this)}}],t0(i.prototype,r),Object.defineProperty(i,"prototype",{writable:!1}),s}(f());function t9(t){return(t9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function t8(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==t9(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==t9(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===t9(e)?e:String(e)}(i.key),i)}}var t7=function(){var t,e,n;function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return t=i,e=[{key:"openDB",value:function(t){var e=this,n=this,i=this.myDB.version||1,r=n.indexedDB.open(n.myDB.name,i);r.onerror=function(t){},r.onsuccess=function(i){e.myDB.db=i.target.result,t.call(n)},r.onupgradeneeded=function(t){var e,i=t.target.result;t.target.transaction,!i.objectStoreNames.contains(n.myDB.ojstore.name)&&i.createObjectStore(n.myDB.ojstore.name,{keyPath:n.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(t,e){for(var n,i=this.myDB.db.transaction(t,"readwrite").objectStore(t),r=0;r<e.length;r++)(n=i.add(e[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(t,e){for(var n,i=this.myDB.db.transaction(t,"readwrite").objectStore(t),r=0;r<e.length;r++)(n=i.put(e[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(t,e,n){var i=this,r=this.myDB.db.transaction(t,"readwrite").objectStore(t).get(e);r.onerror=function(){n.call(i,null)},r.onsuccess=function(t){var e=t.target.result;n.call(i,e)}}},{key:"deleteData",value:function(t,e){this.myDB.db.transaction(t,"readwrite").objectStore(t).delete(e)}},{key:"clearData",value:function(t){this.myDB.db.transaction(t,"readwrite").objectStore(t).clear()}}],t8(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),i}(),et=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],ee=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],en=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],ei="data-xgplayerid",er={BUFFER_CONTROLS:"buffer_control"},eo={PLAYING:"playing",WAITING:"waiting"};function ea(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function es(t,e,n){for(var i=arguments.length,r=Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];var a=e.call.apply(e,[t].concat(r));if(!!n&&"function"==typeof n)a&&a.then?a.then(function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];n.call.apply(n,[t].concat(i))}):n.call.apply(n,[t].concat(r))}function eu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return!this.__hooks&&(this.__hooks={}),this.__hooks[t]||(this.__hooks[t]=null),(function(){var i=arguments,r=this;if(n.pre)try{(o=n.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(e){throw e.message="[pluginName: ".concat(this.pluginName,":").concat(t,":pre error] >> ").concat(e.message),e}if(this.__hooks&&this.__hooks[t])try{var o,a,s=(a=this.__hooks[t]).call.apply(a,[this,this].concat(Array.prototype.slice.call(arguments)));s?s.then?s.then(function(t){if(!1!==t){var o;es.apply(void 0,[r,e,n.next].concat((o=i,function(t){if(Array.isArray(t))return ea(t)}(o)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(o)||function(t,e){if(t){if("string"==typeof t)return ea(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ea(t,e)}}(o)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())))}}).catch(function(t){throw t}):es.apply(void 0,[this,e,n.next].concat(Array.prototype.slice.call(arguments))):void 0===s&&es.apply(void 0,[this,e,n.next].concat(Array.prototype.slice.call(arguments)))}catch(e){throw e.message="[pluginName: ".concat(this.pluginName,":").concat(t,"] >> ").concat(e.message),e}else es.apply(void 0,[this,e,n.next].concat(Array.prototype.slice.call(arguments)))}).bind(this)}function ec(t,e){var n=this.__hooks;return n?!!n.hasOwnProperty(t)&&(n&&(n[t]=e),!0):void 0}function el(t,e){var n=this.__hooks;if(!n||!Array.isArray(n[t]))return -1;for(var i=n[t],r=0;r<i.length;r++)if(i[r]===e)return r;return -1}function ef(t,e){var n=this.__hooks;if(!!n)if(Array.isArray(n[t])){var i=n[t],r=el.call(this,t,e);-1!==r&&i.splice(r,1)}else n[t]&&(n[t]=null)}function eh(t){if(!!this.plugins&&!!this.plugins[t.toLowerCase()]){for(var e=this.plugins[t.toLowerCase()],n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return e.useHooks&&e.useHooks.apply(e,i)}}function ep(t){if(!!this.plugins&&!!this.plugins[t.toLowerCase()]){var e=this.plugins[t.toLowerCase()];if(e){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return e.removeHooks&&e.removeHooks.apply(e,i)}}}function ed(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.__hooks={},e&&e.map(function(e){t.__hooks[e]=null}),Object.defineProperty(t,"hooks",{get:function(){return t.__hooks&&Object.keys(t.__hooks).map(function(e){if(t.__hooks[e])return e})}})}function ey(t){t.__hooks=null}function ev(t,e,n){for(var i=arguments.length,r=Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];if(!t.__hooks||!t.__hooks[e])return n.call.apply(n,[t,t].concat(r));var a,s=(a=t.__hooks[e]).call.apply(a,[t,t].concat(r));if(s&&s.then)s.then(function(e){return!1===e?null:n.call.apply(n,[t,t].concat(r))}).catch(function(t){});else if(!1!==s)return n.call.apply(n,[t,t].concat(r))}function eg(t){return(eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function em(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function eb(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?em(Object(n),!0).forEach(function(e){(function(t,e,n){(e=ek(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n})(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):em(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function ew(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,ek(i.key),i)}}function ek(t){var e=function(t,e){if("object"!==eg(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==eg(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===eg(e)?e:String(e)}function e_(t,e){v.logError("[".concat(t,"] event or callback cant be undefined or null when call ").concat(e))}var eS=function(){var t,e,n;function i(t){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),_.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),ed(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return t=i,e=[{key:"beforeCreate",value:function(t){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(t){this.player=t.player,this.playerConfig=t.player&&t.player.config,this.pluginName=t.pluginName?t.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=t.player&&t.player.logger}},{key:"reInitialize",value:function(){this.__init(this.__args)}},{key:"updateLang",value:function(t){!t&&(t=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 t,e=_.checkTouchSupport()?"touch":"mouse";return["compatible","touch","mouse"].indexOf(null===(t=this.playerConfig)||void 0===t?void 0:t.domEventType)>-1&&(e=this.playerConfig.domEventType),e}},{key:"on",value:function(t,e){var n=this;if(!t||!e||!this.player){e_(this.pluginName,"plugin.on(event, callback)");return}"string"==typeof t?(this.__events[t]=e,this.player.on(t,e)):Array.isArray(t)&&t.forEach(function(t){n.__events[t]=e,n.player.on(t,e)})}},{key:"once",value:function(t,e){var n=this;if(!t||!e||!this.player){e_(this.pluginName,"plugin.once(event, callback)");return}"string"==typeof t?(this.__onceEvents[t]=e,this.player.once(t,e)):Array.isArray(t)&&t.forEach(function(i){n.__onceEvents[i]=e,n.player.once(t,e)})}},{key:"off",value:function(t,e){var n=this;if(!t||!e||!this.player){e_(this.pluginName,"plugin.off(event, callback)");return}"string"==typeof t?(delete this.__events[t],this.player.off(t,e)):Array.isArray(t)&&t.forEach(function(i){delete n.__events[t],n.player.off(i,e)})}},{key:"offAll",value:function(){var t=this;["__events","__onceEvents"].forEach(function(e){Object.keys(t[e]).forEach(function(n){t[e][n]&&t.off(n,t[e][n]),n&&delete t[e][n]})}),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(t){var e;if(!!this.player){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(e=this.player).emit.apply(e,[t].concat(i))}}},{key:"emitUserAction",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!!this.player){var i=eb(eb({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(t,e,i)}}},{key:"hook",value:function(t,e){return arguments.length>2&&void 0!==arguments[2]&&arguments[2],eu.call.apply(eu,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(t,e){for(var n=arguments.length,i=Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return ec.call.apply(ec,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(t,e){for(var n=arguments.length,i=Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return ef.call.apply(ef,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(!!this.player)return n&&(e.pluginName=n),this.player.registerPlugin({plugin:t,options:e})}},{key:"getPlugin",value:function(t){return this.player?this.player.getPlugin(t):null}},{key:"__destroy",value:function(){var t=this,e=this.player,n=this.pluginName;this.offAll(),_.clearAllTimers(this),_.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map(function(e){t[e]=null}),e.unRegisterPlugin(n),ey(this)}}],n=[{key:"defineGetterOrSetter",value:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&Object.defineProperty(t,n,e[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}],e&&ew(t.prototype,e),n&&ew(t,n),Object.defineProperty(t,"prototype",{writable:!1}),i}(),eP=n("59798"),eO=n.n(eP);function eT(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==ej(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ej(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ej(e)?e:String(e)}(i.key),i)}}function eE(){return(eE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ex(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function eC(t,e){return(eC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ex(t){return(ex=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ej(t){return(ej="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var eR={CONTROLS:"controls",ROOT:"root"},eA={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"},eL="xg-icon-disable";function eI(t){return!!t&&t.indexOf&&/^(?:http|data:|\/)/.test(t)}function eD(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=null;if(t instanceof window.Element)return _.addClass(t,n),Object.keys(i).map(function(e){t.setAttribute(e,i[e])}),t;if(eI(t)||eI(t.url))return i.src=eI(t)?t:t.url||"",o=_.createDom(t.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof t)try{if((o=t())instanceof window.Element)return _.addClass(o,n),Object.keys(i).map(function(t){o.setAttribute(t,i[t])}),o;v.logWarn("warn>>icons.".concat(e," in config of plugin named [").concat(r,"] is a function mast return an Element Object"));return null}catch(t){return v.logError("Plugin named [".concat(r,"]:createIcon"),t),null}return"string"==typeof t?_.createDomFromHtml(t,i,n):(v.logWarn("warn>>icons.".concat(e," in config of plugin named [").concat(r,"] is invalid")),null)}var eN=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&eC(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=ex(e);return t=n?Reflect.construct(i,arguments,ex(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===ej(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),(t=a.call(this,e)).__delegates=[],t}return i=s,r=[{key:"__init",value:function(t){if(eE(ex(s.prototype),"__init",this).call(this,t),!!t.root){var e=t.root,n=null;this.icons={},this.root=null,this.parent=null,!function(t,e){var n=e.config.icons||e.playerConfig.icons;Object.keys(t).map(function(i){var r,o,a,s,u=t[i],c=u&&u.class?u.class:"",l=u&&u.attr?u.attr:{},f=null;if(n&&n[i]){;r=n[i],o=c,c="object"===ej(r)&&r.class&&"string"==typeof r.class?"".concat(o," ").concat(r.class):o,a=n[i],s=l,"object"===ej(a)&&a.attr&&"object"===ej(a.attr)&&Object.keys(a.attr).map(function(t){s[t]=a.attr[t]}),l=s,f=eD(n[i],i,c,l,e.pluginName)}!f&&u&&(f=eD(u.icon?u.icon:u,l,c,{},e.pluginName)),e.icons[i]=f})}(this.registerIcons()||{},this),this.langText={},!function(t,e){Object.keys(t).map(function(n){Object.defineProperty(e.langText,n,{get:function(){var i=e.lang,r=e.i18n;return r[n]?r[n]:t[n]&&t[n][i]||""}})})}(this.registerLanguageTexts()||{},this);var i="";try{i=this.render()}catch(t){throw v.logError("Plugin:".concat(this.pluginName,":render"),t),Error("Plugin:".concat(this.pluginName,":render:").concat(t.message))}if(i)(n=s.insert(i,e,t.index)).setAttribute("data-index",t.index);else{if(!t.tag)return;(n=_.createDom(t.tag,"",t.attr,t.name)).setAttribute("data-index",t.index),e.appendChild(n)}this.root=n,this.parent=e;var r=this.config.attr||{},o=this.config.style||{};this.setAttr(r),this.setStyle(o),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var t=this;if(!!this.root){this._children=[];var e=this.children();e&&"object"===ej(e)&&Object.keys(e).length>0&&Object.keys(e).map(function(n){var i,r,o=e[n],a={root:t.root};"function"==typeof o?(i=t.config[n]||{},r=o):"object"===ej(o)&&"function"==typeof o.plugin&&(i=o.options?_.deepCopy(t.config[n]||{},o.options):t.config[n]||{},r=o.plugin),a.config=i,void 0!==i.index&&(a.index=i.index),i.root&&(a.root=i.root),t.registerPlugin(r,a,n)})}}},{key:"updateLang",value:function(t){!t&&(t=this.lang);var e=this.root,n=this.i18n,i=this.langText;e&&!function t(e,n){for(var i=0;i<e.children.length;i++)e.children[i].children.length>0?t(e.children[i],n):n(e.children[i])}(e,function(e){var r=e.getAttribute&&e.getAttribute("lang-key");if(!!r){var o=n[r.toUpperCase()]||i[r];o&&(e.innerHTML="function"==typeof o?o(t):o)}})}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.i18n||{},i=this.langText;t.setAttribute&&t.setAttribute("lang-key",e);var r=n[e]||i[e]||"";r&&(t.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"disable",value:function(){this.config.disable=!0,_.addClass(this.find(".xgplayer-icon"),eL)}},{key:"enable",value:function(){this.config.disable=!1,_.removeClass(this.find(".xgplayer-icon"),eL)}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.root=e.root||this.root;var i=eE(ex(s.prototype),"registerPlugin",this).call(this,t,e,n);return this._children.push(i),i}},{key:"unregisterPlugin",value:function(t){if(this._children instanceof Array){var e=function(t,e){if(t instanceof Array){for(var n=0;n<t.length;n++)if(e.call(null,t[n],n,t))return n}return -1}(this._children,function(e){return e===t||e.pluginName&&e.pluginName===t.pluginName});e>-1&&this._children.splice(e,1)}}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(t){if(!!this.root)return this.root.querySelector(t)}},{key:"bind",value:function(t,e,n){var i=this;if(arguments.length<3&&"function"==typeof e)Array.isArray(t)?t.forEach(function(t){i.bindEL(t,e)}):this.bindEL(t,e);else{var r=s.delegate.call(this,this.root,t,e,n);this.__delegates=this.__delegates.concat(r)}}},{key:"unbind",value:function(t,e){var n=this;if(arguments.length<3&&"function"==typeof e)Array.isArray(t)?t.forEach(function(t){n.unbindEL(t,e)}):this.unbindEL(t,e);else{for(var i="".concat(t,"_").concat(e),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===i){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}}},{key:"setStyle",value:function(t,e){var n=this;if(!!this.root){if("String"===_.typeOf(t))return this.root.style[t]=e;"Object"===_.typeOf(t)&&Object.keys(t).map(function(e){n.root.style[e]=t[e]})}}},{key:"setAttr",value:function(t,e){var n=this;if(!!this.root){if("String"===_.typeOf(t))return this.root.setAttribute(t,e);"Object"===_.typeOf(t)&&Object.keys(t).map(function(e){n.root.setAttribute(e,t[e])})}}},{key:"setHtml",value:function(t,e){if(!!this.root)this.root.innerHTML=t,"function"==typeof e&&e()}},{key:"bindEL",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!!this.root)"on".concat(t) in this.root&&"function"==typeof e&&this.root.addEventListener(t,e,n)}},{key:"unbindEL",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!!this.root)"on".concat(t) in this.root&&"function"==typeof e&&this.root.removeEventListener(t,e,n)}},{key:"show",value:function(t){var e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!!this.root){if(this.root.style.display=void 0!==t?t:"block",e&&"none"===window.getComputedStyle(this.root,null).getPropertyValue("display"))return this.root.style.display="block"}}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(t,e){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!e||!(e instanceof window.Element))return null;try{if("string"==typeof t)return this.find(t).appendChild(e);return t.appendChild(e)}catch(t){return v.logError("Plugin:appendChild",t),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var t=this,e=this.player;this.__delegates.map(function(t){t.destroy()}),this.__delegates=[],this._children instanceof Array&&(this._children.forEach(function(t){e.unRegisterPlugin(t.pluginName)}),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),eE(ex(s.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map(function(e){t[e]=null})}}],o=[{key:"insert",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e.children.length,r=Number(n),o=t instanceof window.Node;if(!i)return o?e.appendChild(t):e.insertAdjacentHTML("beforeend",t),e.children[e.children.length-1];for(var a=0,s=null,u="";a<i;a++){var c=Number((s=e.children[a]).getAttribute("data-index"));if(c>=r){u="beforebegin";break}c<r&&(u="afterend")}return o?"afterend"===u?e.appendChild(t):e.insertBefore(t,s):s.insertAdjacentHTML(u,t),"afterend"===u?e.children[e.children.length-1]:e.children[a]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(t instanceof window.Node&&"function"==typeof i){if(Array.isArray(n))n.forEach(function(n){var a=eO()(t,e,n,i,r);a.key="".concat(e,"_").concat(n),o.push(a)});else{var a=eO()(t,e,n,i,r);a.key="".concat(e,"_").concat(n),o.push(a)}}return o}},{key:"ROOT_TYPES",get:function(){return eR}},{key:"POSITIONS",get:function(){return eA}}],r&&eT(i.prototype,r),o&&eT(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eS);function eM(t){return(eM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eB(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,eF(i.key),i)}}function eF(t){var e=function(t,e){if("object"!==eM(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==eM(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===eM(e)?e:String(e)}var eH=function(){var t,e,n;function i(){var t,e,n,r=this;if(!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),t=this,e="__trigger",n=function(t){var e=new Date().getTime();r.timeStamp=e;for(var n=0;n<t.length;n++)r.__runHandler(t[n].target)},(e=eF(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,this.__handlers=[],this.timeStamp=0,this.observer=null,!!window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw TypeError("Expected a function");return S(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),function(t,e,n){var i,r,o,a,s,u,c=0,l=!1,f=!1,h=!0,p=!e&&0!==e&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof t)throw TypeError("Expected a function");function d(e){var n=i,o=r;return i=r=void 0,c=e,a=t.apply(o,n)}function y(t,e){return p?(window.cancelAnimationFrame(s),window.requestAnimationFrame(t)):setTimeout(t,e)}e=+e||0,S(n)&&(l=!!n.leading,o=(f="maxWait"in n)?Math.max(+n.maxWait||0,e):o,h="trailing"in n?!!n.trailing:h);function v(t){var n=t-u,i=t-c;return void 0===u||n>=e||n<0||f&&i>=o}function g(){var t,n,i,r,a=Date.now();if(v(a))return m(a);s=y(g,(n=(t=a)-u,i=t-c,r=e-n,f?Math.min(r,o-i):r))}function m(t){return(s=void 0,h&&i)?d(t):(i=r=void 0,a)}function b(){for(var t,n=Date.now(),o=v(n),h=arguments.length,p=Array(h),m=0;m<h;m++)p[m]=arguments[m];if(i=p,r=this,u=n,o){if(void 0===s){;return c=t=u,s=y(g,e),l?d(t):a}if(f)return s=y(g,e),d(u)}return void 0===s&&(s=y(g,e)),a}return b.cancel=function(){void 0!==s&&!function(t){if(p)return window.cancelAnimationFrame(t);clearTimeout(t)}(s),c=0,i=u=r=s=void 0},b.flush=function(){return void 0===s?a:m(Date.now())},b.pending=function(){return void 0!==s},b}(t,100,{leading:i,trailing:r,maxWait:e})}(this.__trigger,100,{trailing:!0})),this.timeStamp=new Date().getTime()}catch(t){}}return t=i,e=[{key:"addObserver",value:function(t,e){if(!!this.observer){this.observer&&this.observer.observe(t);for(var n=t.getAttribute(ei),i=this.__handlers,r=-1,o=0;o<i.length;o++)i[o]&&t===i[o].target&&(r=o);r>-1?this.__handlers[r].handler=e:this.__handlers.push({target:t,handler:e,playerId:n})}}},{key:"unObserver",value:function(t){var e=-1;this.__handlers.map(function(n,i){t===n.target&&(e=i)});try{this.observer&&this.observer.unobserve(t)}catch(t){}this.observer&&this.observer.unobserve(t),e>-1&&this.__handlers.splice(e,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(t){for(var e=this.__handlers,n=0;n<e.length;n++)if(e[n]&&t===e[n].target){try{e[n].handler(t)}catch(t){}return!0}return!1}}],eB(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),i}(),eU=null,eW={pluginGroup:{},init:function(t){var e,n,i=t._pluginInfoId;!i&&(i=new Date().getTime(),t._pluginInfoId=i),t.config.closeResizeObserver||(e=t.root,n=function(){t.getVideoSize()},eU||(eU=new eH),eU.addObserver(e,n)),this.pluginGroup[i]={_originalOptions:t.config||{},_plugins:{}}},formatPluginInfo:function(t,e){var n=null,i=null;return t.plugin&&"function"==typeof t.plugin?(n=t.plugin,i=t.options):(n=t,i={}),e&&(i.config=e||{}),{PLUFGIN:n,options:i}},checkPluginIfExits:function(t,e){for(var n=0;n<e.length;n++)if(t.toLowerCase()===e[n].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(t,e){for(var n=Object.keys(e),i=null,r=0;r<n.length;r++)if(t.toLowerCase()===n[r].toLowerCase()){i=e[n[r]];break}return"Object"===_.typeOf(i)?{root:i.root,position:i.position}:{}},lazyRegister:function(t,e){var n=this,i=e.timeout||1500;return Promise.race([e.loader().then(function(e){var i;i=e&&e.__esModule?e.default:e,n.register(t,i,e.options)}),new Promise(function(t,e){setTimeout(function(){e(Error("timeout"))},i)})])},register:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||!e||"function"!=typeof e||void 0===e.prototype)return;var i=t._pluginInfoId;if(!i||!this.pluginGroup[i])return;!this.pluginGroup[i]._plugins&&(this.pluginGroup[i]._plugins={});var r=this.pluginGroup[i]._plugins,o=this.pluginGroup[i]._originalOptions;n.player=t;var a=n.pluginName||e.pluginName;if(!a)throw Error("The property pluginName is necessary");if(!e.isSupported||!!e.isSupported()){!n.config&&(n.config={});for(var s=Object.keys(o),u=0;u<s.length;u++)if(a.toLowerCase()===s[u].toLowerCase()){var c=o[s[u]];"Object"===_.typeOf(c)&&(n.config=Object.assign({},n.config,o[s[u]]));break}e.defaultConfig&&Object.keys(e.defaultConfig).forEach(function(t){void 0===n.config[t]&&(n.config[t]=e.defaultConfig[t])}),n.root?"string"==typeof n.root&&(n.root=t[n.root]):n.root=t.root,n.index=n.config.index||0;try{r[a.toLowerCase()]&&this.unRegister(i,a.toLowerCase());var l=new e(n);return r[a.toLowerCase()]=l,r[a.toLowerCase()].func=e,l&&"function"==typeof l.afterCreate&&l.afterCreate(),l}catch(t){throw t}}},unRegister:function(t,e){t._pluginInfoId&&(t=t._pluginInfoId),e=e.toLowerCase();var n=null;try{(n=this.pluginGroup[t]._plugins[e])&&(n.pluginName&&n.__destroy(),delete this.pluginGroup[t]._plugins[e])}catch(t){}return n},deletePlugin:function(t,e){var n=t._pluginInfoId;n&&this.pluginGroup[n]&&this.pluginGroup[n]._plugins&&delete this.pluginGroup[n]._plugins[e]},getPlugins:function(t){var e=t._pluginInfoId;return e&&this.pluginGroup[e]?this.pluginGroup[e]._plugins:{}},findPlugin:function(t,e){var n=t._pluginInfoId;if(!n||!this.pluginGroup[n])return null;var i=e.toLowerCase();return this.pluginGroup[n]._plugins[i]},beforeInit:function(t){var e=this;function n(t){return t&&t.then?t:new Promise(function(t){t()})}return new Promise(function(i){var r;if(!!e.pluginGroup)return(r=t._loadingPlugins&&t._loadingPlugins.length?Promise.all(t._loadingPlugins):Promise.resolve()).then(function(){var r=t._pluginInfoId;if(!e.pluginGroup[r]){i();return}var o=e.pluginGroup[r]._plugins,a=[];Object.keys(o).forEach(function(t){if(o[t]&&o[t].beforePlayerInit)try{var e=o[t].beforePlayerInit();a.push(n(e))}catch(t){throw a.push(n(null)),t}}),Promise.all([].concat(a)).then(function(){i()}).catch(function(t){i()})})})},afterInit:function(t){var e=t._pluginInfoId;if(!!e&&!!this.pluginGroup[e]){var n=this.pluginGroup[e]._plugins;Object.keys(n).forEach(function(t){n[t]&&n[t].afterPlayerInit&&n[t].afterPlayerInit()})}},setLang:function(t,e){var n=e._pluginInfoId;if(!!n&&!!this.pluginGroup[n]){var i=this.pluginGroup[n]._plugins;Object.keys(i).forEach(function(e){if(i[e].updateLang)i[e].updateLang(t);else try{i[e].lang=t}catch(t){}})}},reRender:function(t){var e=this,n=t._pluginInfoId;if(!!n&&!!this.pluginGroup[n]){var i=[],r=this.pluginGroup[n]._plugins;Object.keys(r).forEach(function(t){"controls"!==t&&r[t]&&(i.push({plugin:r[t].func,options:r[t].__args}),e.unRegister(n,t))}),i.forEach(function(n){e.register(t,n.plugin,n.options)})}},onPluginsReady:function(t){var e=t._pluginInfoId;if(!!e&&!!this.pluginGroup[e]){var n=this.pluginGroup[e]._plugins||{};Object.keys(n).forEach(function(t){n[t].onPluginsReady&&"function"==typeof n[t].onPluginsReady&&n[t].onPluginsReady()})}},destroy:function(t){var e,n,i=t._pluginInfoId;if(!!this.pluginGroup[i]){e=t.root,eU.unObserver(e,void 0);for(var r=this.pluginGroup[i]._plugins,o=0,a=Object.keys(r);o<a.length;o++){var s=a[o];this.unRegister(i,s)}delete this.pluginGroup[i],delete t._pluginInfoId}}},eV={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-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",INNER_FULLSCREEN:"xgplayer-inner-fullscreen",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",AUTOHIDE:"xgplayer_autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function eG(){var t;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:("zh-cn"===(t=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase())&&(t="zh"),t),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:""},enableMemLeakFix:!1}}function ez(t){return function(t){if(Array.isArray(t))return eK(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return eK(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eK(t,e)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eK(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var eY=function(t,e){var n,i,r,o=r=e.preset&&e.options?new e.preset(e.options,t.config):new e({},t.config),a=o.plugins,s=o.ignores,u=o.icons,c=void 0===u?{}:u,l=o.i18n,f=void 0===l?[]:l;!t.config.plugins&&(t.config.plugins=[]),!t.config.ignores&&(t.config.ignores=[]),(n=t.config.plugins).push.apply(n,ez(void 0===a?[]:a)),(i=t.config.ignores).push.apply(i,ez(void 0===s?[]:s)),Object.keys(c).map(function(e){!t.config.icons[e]&&(t.config.icons[e]=c[e])});var h=t.config.i18n||[];f.push.apply(f,ez(h)),t.config.i18n=f};function eX(t){return(eX="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eq(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,e1(i.key),i)}}function eJ(){return(eJ="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=eQ(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function eZ(t,e){return(eZ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function e$(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function eQ(t){return(eQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function e0(t,e,n){return(e=e1(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e1(t){var e=function(t,e){if("object"!==eX(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==eX(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===eX(e)?e:String(e)}var e2=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&eZ(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=eQ(e);return t=n?Reflect.construct(i,arguments,eQ(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===eX(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return e$(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return e0(e$(t=a.call.apply(a,[this].concat(n))),"onMouseEnter",function(e){var n=e$(t),i=n.player;n.playerConfig.closeControlsBlur&&i.focus({autoHide:!1})}),e0(e$(t),"onMouseLeave",function(){e$(t).player.focus()}),t}return i=s,o=[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}],r=[{key:"beforeCreate",value:function(t){"boolean"==typeof t.player.config.controls&&(t.config.disable=!t.player.config.controls),!t.config.mode&&"mobile"===t$.device&&(t.config.mode="flex"),t.player.config.marginControls&&(t.config.autoHide=!1)}},{key:"afterCreate",value:function(){var t=this,e=this.config,n=e.disable,i=e.height,r=e.mode,o=e.autoHide;if(!n){"flex"===r&&this.player.addClass(eV.FLEX_CONTROLS),o&&this.player.addClass(eV.AUTOHIDE);var a={height:"".concat(i,"px")};Object.keys(a).map(function(e){t.root.style[e]=a[e]}),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-controls"),this.on(tp,function(e){e?_.addClass(t.root,"mini-controls"):_.removeClass(t.root,"mini-controls")});var s=this.playerConfig.isMobileSimulateMode;"mobile"!==t$.device&&"mobile"!==s&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"unFocus",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&_.addClass(this.root,"control_autohide")}},{key:"pauseAutoHide",value:function(){_.removeClass(this.root,"control_autohide")}},{key:"show",value:function(){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(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(!!this.root){var i=t.defaultConfig||{};if(!e.root){switch(e.position?e.position:e.config&&e.config.position?e.config.position:i.position){case eA.CONTROLS_LEFT:e.root=this.left;break;case eA.CONTROLS_RIGHT:e.root=this.right;break;case eA.CONTROLS_CENTER:e.root=this.center;break;case eA.CONTROLS:e.root=this.root;break;default:e.root=this.left}return eJ(eQ(s.prototype),"registerPlugin",this).call(this,t,e,n)}}}},{key:"destroy",value:function(){"mobile"!==t$.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave)),this.player&&this.player.config&&this.player.config.enableMemLeakFix&&(this.left=null,this.center=null,this.right=null,this.innerRoot=null)}},{key:"render",value:function(){var t=this.config,e=t.mode,n=t.autoHide,i=t.initShow;if(!t.disable){var r=_.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===e},{"bottom-controls":"bottom"===e},{control_autohide:n},{controls_permanent:!n},{"xgplayer-controls-initshow":i||!n});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>')}}}],eq(i.prototype,r),o&&eq(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function e3(t){return function(t){if(Array.isArray(t))return e4(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return e4(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e4(t,e)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e4(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var e5={lang:{},langKeys:[],textKeys:[]};function e6(t,e){return Object.keys(e).forEach(function(n){var i,r=_.typeOf(e[n]),o=_.typeOf(t[n]);"Array"===r?("Array"!==o&&(t[n]=[]),(i=t[n]).push.apply(i,e3(e[n]))):"Object"===r?("Object"!==o&&(t[n]={}),e6(t[n],e[n])):t[n]=e[n]}),t}function e9(){Object.keys(e5.lang.en).map(function(t){e5.textKeys[t]=t})}function e8(t,e){var n=t.LANG;if(!e&&(e=e5),!!e.lang){var i=t.TEXT||{};"zh"===n&&(n="zh-cn"),e.lang[n]?e6(e.lang[n],i):(e.langKeys.push(n),e.lang[n]=i),e9()}}e8({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",ERROR:"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 e7={get textKeys(){return e5.textKeys},get langKeys(){return e5.langKeys},get lang(){var nt={};return e5.langKeys.map(function(t){nt[t]=e5.lang[t]}),e5.lang["zh-cn"]&&(nt.zh=e5.lang["zh-cn"]||{}),nt},extend:function(t,e){var n=[];if(!e&&(e=e5),!!e.lang){n="Array"!==_.typeOf(t)?Object.keys(t).map(function(e){return{LANG:"zh"===e?"zh-cn":e,TEXT:t[e]}}):t;var i=e.lang;n.map(function(t){"zh"===t.LANG&&(t.LANG="zh-cn"),i[t.LANG]?e6(i[t.LANG]||{},t.TEXT||{}):e8(t,e)}),e9()}},use:e8,init:function(t){var e,n={lang:{},langKeys:[],textKeys:{},pId:t};return e6(n.lang,e5.lang),(e=n.langKeys).push.apply(e,e3(e5.langKeys)),e6(n.textKeys,e5.textKeys),n}};function ne(t){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==ne(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ne(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ne(e)?e:String(e)}(i.key),i)}}function ni(t,e){return(ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function nr(t){return(nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var no={},na=null,ns=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ni(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=nr(e);return t=n?Reflect.construct(i,arguments,nr(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===ne(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,r=[{key:"add",value:function(t){if(!!t)no[t.playerId]=t,1===Object.keys(no).length&&this.setActive(t.playerId,!0)}},{key:"remove",value:function(t){if(!!t){var e=t.isUserActive;delete no[t.playerId]}}},{key:"_iterate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in no)if(Object.prototype.hasOwnProperty.call(no,n)){var i=no[n];if(e){if(t(i))break}else t(i)}}},{key:"forEach",value:function(t){this._iterate(t)}},{key:"find",value:function(t){var e=null;return this._iterate(function(n){var i=t(n);return i&&(e=n),i},!0),e}},{key:"findAll",value:function(t){var e=[];return this._iterate(function(n){t(n)&&e.push(n)}),e}},{key:"setActive",value:function(t){var e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!!no[t]){if(e){var n=!1;this.forEach(function(e){t===e.playerId?(!e.isUserActive&&(n=!0),e.isUserActive=!0,e.isInstNext=!1):e.isUserActive=!1}),n&&this.emit("activeChanged")}else no[t].isUserActive=e;return t}}},{key:"getActiveId",value:function(){for(var t=Object.keys(no),e=0;e<t.length;e++){var n=no[t[e]];if(n&&n.isUserActive)return t[e]}return null}},{key:"setNext",value:function(t){var e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!!no[t])return e?this.forEach(function(e){t===e.playerId?(e.isUserActive=!1,e.isInstNext=!0):e.isInstNext=!1}):no[t].isInstNext=e,t}}],o=[{key:"getInstance",value:function(){return na||(na=new s),na}}],r&&nn(i.prototype,r),o&&nn(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(l.EventEmitter);function nu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function nc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nu(Object(n),!0).forEach(function(e){ng(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nu(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function nl(t){return(nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nf(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,nm(i.key),i)}}function nh(){return(nh="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=nv(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function np(t,e){return(np=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function nd(t,e){if(e&&("object"===nl(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return ny(t)}function ny(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nv(t){return(nv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ng(t,e,n){return(e=nm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nm(t){var e=function(t,e){if("object"!==nl(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==nl(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===nl(e)?e:String(e)}var nb=["play","pause","replay","retry","playnext"],nw=0,nk=0,n_=null,nS=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&np(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=nv(e);return t=n?Reflect.construct(i,arguments,nv(this).constructor):i.apply(this,arguments),nd(this,t)});function s(t){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);var e,n,i=_.deepMerge(eG(),t);ng(ny(n=a.call(this,i)),"canPlayFunc",function(){if(!!n.config){var t=n.config,e=t.autoplay,i=t.startTime,r=t.defaultPlaybackRate;v.logInfo("player","canPlayFunc, startTime",i),i&&(n.currentTime=i>n.duration?n.duration:i,n.config.startTime=0),n.playbackRate=r,e&&n.videoPlay(),n.off(M,n.canPlayFunc),n.removeClass(eV.ENTER)}}),ng(ny(n),"onFullscreenChange",function(t,e){var i=function(){_.setTimeout(ny(n),function(){n.getVideoSize()},100)},r=_.getFullScreenEl();n._fullActionFrom?n._fullActionFrom="":n.emit(tT,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:n.currentTime,duration:n.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(t,e,n){if(!!t){var i=t.getAttribute(n);return!!i&&i===e&&("VIDEO"===t.tagName||"AUDIO"===t.tagName)||!1}}(r,n.playerId,ei);if(e||r&&(r===n._fullscreenEl||o))i(),n.config.closeFocusVideoFocus||n.video.focus(),n.fullscreen=!0,n.emit(tf,!0,n._fullScreenOffset),n.cssfullscreen&&n.exitCssFullscreen();else if(n.fullscreen){i();var a=ny(n),s=a._fullScreenOffset;a.config.needFullscreenScroll?(window.scrollTo(s.left,s.top),_.setTimeout(ny(n),function(){n.fullscreen=!1,n._fullScreenOffset=null},100)):(n.config.closeFocusVideoFocus||n.video.focus(),n.fullscreen=!1,n._fullScreenOffset=null),n.cssfullscreen?n.removeClass(eV.FULLSCREEN):n.recoverFullStyle(n.root,n._fullscreenEl,eV.FULLSCREEN),n._fullscreenEl=null,n.emit(tf,!1)}}),ng(ny(n),"_onWebkitbeginfullscreen",function(t){n._fullscreenEl=n.video,n.onFullscreenChange(t,!0)}),ng(ny(n),"_onWebkitendfullscreen",function(t){n.onFullscreenChange(t,!1)}),ed(ny(n),nb),n.config=i,n._pluginInfoId=_.generateSessionId(),(e=ny(n)).logInfo=v.logInfo.bind(e),e.logWarn=v.logWarn.bind(e),e.logError=v.logError.bind(e);var r=n.constructor.defaultPreset;if(n.config.presets.length){var o=n.config.presets.indexOf("default");o>=0&&r&&(n.config.presets[o]=r)}else r&&n.config.presets.push(r);return(n.userTimer=null,n.waitTimer=null,n.isReady=!1,n.isPlaying=!1,n.isError=!1,n.isSeeking=!1,n.isCanplay=!1,n._runPending=!1,n.rotateDeg=0,n.isActive=!1,n.isBufferControlPaused=!1,n.isCssfullScreen=!1,n.fullscreen=!1,n._fullscreenEl=null,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.innerContainer=null,n.controls=null,n.topBar=null,n.topBar=null,n.root=null,n.__i18n=e7.init(),t$.os.isAndroid&&t$.osVersion>0&&t$.osVersion<6&&(n.config.autoplay=!1),n.database=new t7,n.isUserActive=!1,n._onceSeekCanplay=null,n._isPauseBeforeSeek=0,n.innerStates={isActiveLocked:!1},n.instManager=n_,n._initDOM())?(n._bindEvents(),n._registerPresets(),n._registerPlugins(),eW.onPluginsReady(ny(n)),_.setTimeout(ny(n),function(){n.emit(Q),n.onReady&&n.onReady(),n.isReady=!0},0),n.getInitDefinition(),n.syncFullstate(),(n.config.videoInit||n.config.autoplay)&&!n.hasStart&&n.start(),n):nd(n)}return i=s,r=[{key:"_initDOM",value:function(){var t,e=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var n=this.config.el;if(!n||1!==n.nodeType)return this.emit(A,new E("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),!1;this.root=n}var i=function(t){for(var e=Object.keys(no),n=0;n<e.length;n++){var i=no[e[n]];if(i.root===t)return i}return null}(this.root);i&&(v.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),i.destroy()),this.root.setAttribute(ei,this.playerId),null===(t=n_)||void 0===t||t.add(this),eW.init(this),this._initBaseDoms();var r=this.constructor.XgVideoProxy;if(r&&this.videoConfig.mediaType===r.mediaType){var o=this.innerContainer||this.root;this.detachVideoEvents(this.video);var a=new r(o,this.config,this.videoConfig);this.attachVideoEvents(a),this.video=a}if(this.video.setAttribute(ei,this.playerId),this.config.controls){var s=eW.register(this,e2);this.controls=s}var u="mobile"===this.config.isMobileSimulateMode?"mobile":t$.device;if(this.addClass("".concat(eV.DEFAULT," ").concat(eV.ACTIVE," xgplayer-").concat(u," ").concat(this.config.controls?"":eV.NO_CONTROLS)),this.config.autoplay?this.addClass(eV.ENTER):this.addClass(eV.NO_START),this.config.fluid){var c={"max-width":"100%",width:"100%",height:"0","padding-top":"".concat(100*this.config.height/this.config.width,"%"),position:"position",top:"0",left:"0"};Object.keys(c).map(function(t){e.root.style[t]=c[t]})}else["width","height"].map(function(t){e.config[t]&&("number"!=typeof e.config[t]?e.root.style[t]=e.config[t]:e.root.style[t]="".concat(e.config[t],"px"))});var l=this.root.getBoundingClientRect(),f=l.width,h=l.height,p=l.left,d=l.top;return this.sizeInfo.width=f,this.sizeInfo.height=h,this.sizeInfo.left=p,this.sizeInfo.top=d,!0}},{key:"_initBaseDoms",value:function(){this.topBar=_.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=_.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=_.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=_.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer)),this.root.appendChild(this.topBar),this.root.appendChild(this.leftBar),this.root.appendChild(this.rightBar)}},{key:"_bindEvents",value:function(){var t=this;["focus","blur"].forEach(function(e){t.on(e,t["on"+e.charAt(0).toUpperCase()+e.slice(1)])}),et.forEach(function(e){document&&document.addEventListener(e,t.onFullscreenChange)}),t$.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once("loadeddata",this.getVideoSize),this.playFunc=function(){!t.config.closeFocusVideoFocus&&t.video.focus()},this.once("play",this.playFunc),this.on(tu,this.onBufferControl)}},{key:"_unbindEvents",value:function(){var t=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),et.forEach(function(e){document.removeEventListener(e,t.onFullscreenChange)}),this.playFunc&&this.off("play",this.playFunc),this.off("canplay",this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(t){var e=this;if(!!this.video&&(!!t&&""!==t&&("Array"!==_.typeOf(t)||0!==t.length)||(t="",this.emit(tt),v.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.video),"Array"===_.typeOf(t)&&t.length>0?this._attachSourceEvents(this.video,t):this.video.src&&this.video.src===t?!t&&this.video.removeAttribute("src"):this.video.src=t,"Number"===_.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.video instanceof window.Element&&!n.contains(this.video)&&n.insertBefore(this.video,n.firstChild);var i=this.video.readyState;v.logInfo("_startInit readyState",i),this.config.autoplay&&(_.isMSE(this.video)||this.load(),(t$.os.isIpad||t$.os.isPhone)&&this.videoPlay()),i>=2?this.canPlayFunc():this.once(M,this.canPlayFunc),_.setTimeout(this,function(){e.isComplete=!0,e.emit(ti)},1),!this.hasStart&&eW.afterInit(this),this.hasStart=!0}}},{key:"_registerPlugins",value:function(){var t=this,e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this._loadingPlugins=[];var n=this.config.ignores||[],i=this.config.plugins||[],r=this.config.i18n||[];e&&e7.extend(r,this.__i18n);var o=n.join("||").toLowerCase().split("||"),a=this.plugins;i.forEach(function(n){try{var i=n.plugin?n.plugin.pluginName:n.pluginName;if(!i)return;var r=i.toLowerCase(),s=t.config[r]||t.config[i];if("Boolean"===_.typeOf(s)&&!s||o.indexOf(r)>-1||!e&&a[r])return;if(n.lazy&&n.loader){var u=eW.lazyRegister(t,n);n.forceBeforeInit&&(u.then(function(){t._loadingPlugins.splice(t._loadingPlugins.indexOf(u),1)}).catch(function(e){v.logError("_registerPlugins:loadingPlugin",e),t._loadingPlugins.splice(t._loadingPlugins.indexOf(u),1)}),t._loadingPlugins.push(u));return}return t.registerPlugin(n)}catch(t){v.logError("_registerPlugins:",t)}})}},{key:"_registerPresets",value:function(){var t=this;this.config.presets.forEach(function(e){eY(t,e)})}},{key:"_getRootByPosition",value:function(t){var e=null;switch(t){case eA.ROOT_RIGHT:e=this.rightBar;break;case eA.ROOT_LEFT:e=this.leftBar;break;case eA.ROOT_TOP:e=this.topBar;break;default:e=this.innerContainer||this.root}return e}},{key:"registerPlugin",value:function(t,e){var n=eW.formatPluginInfo(t,e),i=n.PLUFGIN,r=n.options,o=this.config.plugins;eW.checkPluginIfExits(i.pluginName,o)||o.push(i);var a=eW.getRootByConfig(i.pluginName,this.config);a.root&&(r.root=a.root),a.position&&(r.position=a.position);var s=r.position?r.position:r.config&&r.config.position||i.defaultConfig&&i.defaultConfig.position;return!r.root&&"string"==typeof s&&s.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,r,i.pluginName):(!r.root&&(r.root=this._getRootByPosition(s)),eW.register(this,i,r))}},{key:"deregister",value:function(t){var e,n,i=eW.unRegister(this,"string"==typeof t?t:t.pluginName);i&&null!==(e=this.config)&&void 0!==e&&e.unregisterPluginFromControls&&(null===(n=this.controls)||void 0===n||n.unregisterPlugin(i))}},{key:"unRegisterPlugin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!!t)this.deregister(t),e&&this.removePluginFromConfig(t)}},{key:"removePluginFromConfig",value:function(t){var e;if("string"==typeof t?e=t:t instanceof eS&&(e=t.pluginName),!!e){for(var n=this.config.plugins.length-1;n>-1;n--)if(this.config.plugins[n].pluginName.toLowerCase()===e.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return eW.getPlugins(this)}},{key:"getPlugin",value:function(t){var e=eW.findPlugin(this,t);return e&&e.pluginName?e:null}},{key:"addClass",value:function(t){if(!!this.root)!_.hasClass(this.root,t)&&_.addClass(this.root,t)}},{key:"removeClass",value:function(t){if(!!this.root)_.removeClass(this.root,t)}},{key:"hasClass",value:function(t){if(!!this.root)return _.hasClass(this.root,t)}},{key:"setAttribute",value:function(t,e){if(!!this.root)this.root.setAttribute(t,e)}},{key:"removeAttribute",value:function(t,e){if(!!this.root)this.root.removeAttribute(t,e)}},{key:"start",value:function(t){var e=this;if(!this.hasStart)return!t&&!this.config.url&&this.getInitDefinition(),this.hasStart=!0,this._registerPlugins(!1),eW.beforeInit(this).then(function(){if(!!e.config){!t&&(t=e.url||e.config.url);var n=e.preProcessUrl(t);return e._startInit(n.url)}}).catch(function(t){throw t.fileName="player",t.lineNumber="236",v.logError("start:beforeInit:",t),t})}},{key:"switchURL",value:function(t){var e=this;arguments.length>1&&void 0!==arguments[1]&&arguments[1];var n=t;"Object"===_.typeOf(t)&&(n=t.url);var i=this.currentTime,r=this.paused&&!this.isError;return this.src=n,new Promise(function(t){var n=function(){e.currentTime=i,r&&e.once("canplay",function(){e.pause()}),t()};t$.os.isAndroid?e.once("timeupdate",function(){n()}):e.once("canplay",function(){n()}),e.play()})}},{key:"videoPlay",value:function(){var t=this;if(!this.hasStart){this.removeClass(eV.NO_START),this.addClass(eV.ENTER);var e=this.start();e&&e.then(function(e){t.config.autoplay||t.videoPlay()});return}!this.isPlaying&&(this.removeClass(eV.NO_START),this.isCanplay||this.addClass(eV.ENTER));var n=nh(nv(s.prototype),"play",this).call(this);return void 0!==n&&n&&n.then?n.then(function(){t.removeClass(eV.NOT_ALLOW_AUTOPLAY),t.addClass(eV.PLAYING),!t.isPlaying&&(v.logInfo(">>>>playPromise.then"),t.isPlaying=!0,t.emit(te))}).catch(function(e){if(v.logWarn(">>>>playPromise.catch",e.name),t.video&&t.video.error){t.onError(),t.removeClass(eV.ENTER);return}"NotAllowedError"===e.name&&(t._errorTimer=_.setTimeout(t,function(){t._errorTimer=null,t.emit(tn),t.addClass(eV.NOT_ALLOW_AUTOPLAY),t.removeClass(eV.ENTER),t.pause()},0)),"AbortError"===e.name&&(t._errorTimer=_.setTimeout(t,function(){t._errorTimer=null,t.emit(tc)},0))}):(v.logWarn("video.play not return promise"),!this.isPlaying&&(this.isPlaying=!0,this.removeClass(eV.NOT_ALLOW_AUTOPLAY),this.removeClass(eV.NO_START),this.removeClass(eV.ENTER),this.addClass(eV.PLAYING),this.emit(te))),n}},{key:"videoPause",value:function(){nh(nv(s.prototype),"pause",this).call(this)}},{key:"play",value:function(){var t=this;this.removeClass(eV.PAUSED),ev(this,"play",function(){t.videoPlay()})}},{key:"pause",value:function(t){var e=this;ev(this,"pause",function(){t===er.BUFFER_CONTROLS?!e.isBufferControlPaused&&(e.isBufferControlPaused=!0,e.emit(tu,{type:eo.WAITING})):e.isBufferControlPaused&&(e.isBufferControlPaused=!1,e.emit(tu,{type:eo.PLAYING})),nh(nv(s.prototype),"pause",e).call(e)},t)}},{key:"seek",value:function(t,e){var n=this;if(!(!this.video||Number.isNaN(Number(t)))&&!!this.hasStart){var i=this.config,r=i.isSeekedPlay,o=i.seekedStatus,a=e||(r?"play":o);t=t<0?0:t>this.duration?parseInt(this.duration,10):t,this._isPauseBeforeSeek||(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(I,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(eV.ENTER),n.isSeeking=!1,a){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(I,this._onceSeekCanplay),this.isPlaying?this.currentTime=t:(this.removeClass(eV.NO_START),this.currentTime=t,this.play())}}},{key:"getInitDefinition",value:function(){var t=this,e=this.config,n=e.definition;!e.url&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map(function(e){e.definition===n.defaultDefinition&&(t.config.url=e.url,t.curDefinition=e.definition)})}},{key:"changeDefinition",value:function(t,e){var n=this,i=this.config.definition;if(Array.isArray(null==i?void 0:i.list)&&i.list.forEach(function(e){(null==t?void 0:t.definition)===e.definition&&(n.curDefinition=e)}),null!=t&&t.bitrate&&"number"!=typeof t.bitrate&&(t.bitrate=parseInt(t.bitrate,10)||0),this.emit(td,{from:e,to:t}),!this.hasStart){this.config.url=t.url;return}var r=this.switchURL(t.url);r&&r.then?r.then(function(){n.emit(tv,{from:e,to:t})}):this.emit(tv,{from:e,to:t})}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once("loadeddata",this.reloadFunc)}},{key:"resetState",value:function(){var t=this,e=eV.NOT_ALLOW_AUTOPLAY,n=eV.PLAYING,i=eV.NO_START,r=eV.PAUSED,o=eV.REPLAY,a=eV.ENTER,s=eV.ENDED,u=eV.ERROR,c=eV.LOADING;this.hasStart=!1,this.isError=!1,this.isPlaying=!1,this.videoPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,[e,n,i,r,o,a,s,u,c].forEach(function(e){t.removeClass(e)}),this.addClass(eV.ENTER),this.emit(tE)}},{key:"reset",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(this.resetState(),!!this.plugins){if(e.map(function(e){t.deregister(e)}),n){var i=eG();Object.keys(this.config).keys(function(e){"undefined"!==t.config[e]&&("plugins"===e||"presets"===e||"el"===e||"id"===e)&&(t.config[e]=i[e])})}}}},{key:"destroy",value:function(){var t,e,n=this,i=this.innerContainer,r=this.root,o=this.video;if(this.config&&this.config.enableMemLeakFix){if(this._destroyed)return;this._destroyed=!0;try{this._unbindEvents&&this._unbindEvents()}catch(t){}try{o&&this._detachSourceEvents(this.video)}catch(t){}try{_.clearAllTimers(this)}catch(t){}this.emit(to);try{null===(t=n_)||void 0===t||t.remove(this)}catch(t){}try{eW.destroy(this)}catch(t){}try{ey(this)}catch(t){}try{nh(nv(s.prototype),"destroy",this).call(this)}catch(t){}if(!r||!o)return;r.removeAttribute(ei),this.updateAcc("destroy")}else{if(!r||!o)return;r.removeAttribute(ei),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.video),_.clearAllTimers(this),this.emit(to),null===(e=n_)||void 0===e||e.remove(this),eW.destroy(this),ey(this),nh(nv(s.prototype),"destroy",this).call(this)}if(this.fullscreen&&this._fullscreenEl===this.root)try{this.exitFullscreen()}catch(t){}if(i){for(var a=i.children,u=0;u<a.length;u++)i.removeChild(a[u])}!i&&o instanceof window.Node&&r.contains(o)&&o.parentNode.removeChild(o),["topBar","leftBar","rightBar","innerContainer"].map(function(t){n[t]&&r.removeChild(n[t]),n[t]=null});var c=r.className.split(" ");c.length>0?r.className=c.filter(function(t){return 0>t.indexOf("xgplayer")}).join(" "):r.className="",this.removeAttribute("data-xgfill"),["isReady","isPlaying","isSeeking","isCanplay","isActive","isCssfullScreen","fullscreen"].map(function(t){n[t]=!1})}},{key:"replay",value:function(){var t=this;this.removeClass(eV.ENDED),this.currentTime=0,this.isSeeking=!1,ev(this,"replay",function(){t.once(I,function(){var e=t.videoPlay();e&&e.catch&&e.catch(function(t){})}),t.play(),t.emit(tr),t.onPlay()})}},{key:"retry",value:function(){var t=this;this.removeClass(eV.ERROR),this.addClass(eV.LOADING),ev(this,"retry",function(){var e=t.currentTime;t.src=t.config.url,t.config.isLive||(t.currentTime=e),t.once(M,function(){t.videoPlay()})})}},{key:"syncFullstate",value:function(){var t=_.getFullScreenEl();t&&t===this.config.fullscreenTarget&&(this.fullscreen=!0,this._fullscreenEl=t,!this._orgPCss&&(this._orgPCss=_.filterStyleFromText(t)))}},{key:"changeFullStyle",value:function(t,e,n,i){if(!!t)!i&&(i=eV.PARENT_FULLSCREEN),!this._orgCss&&(this._orgCss=_.filterStyleFromText(t)),_.addClass(t,n),e&&e!==t&&!this._orgPCss&&(this._orgPCss=_.filterStyleFromText(e),_.addClass(e,i),e.setAttribute(ei,this.playerId))}},{key:"recoverFullStyle",value:function(t,e,n,i){!i&&(i=eV.PARENT_FULLSCREEN),this._orgCss&&(_.setStyleFromCsstext(t,this._orgCss),this._orgCss=""),_.removeClass(t,n),e&&e!==t&&this._orgPCss&&(_.setStyleFromCsstext(e,this._orgPCss),this._orgPCss="",_.removeClass(e,i),e.removeAttribute(ei))}},{key:"getFullscreen",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,n=this.root,i=this.video;if(!e&&(e=n),this._fullScreenOffset={top:_.scrollTop(),left:_.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",this.emit(tl),_.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{for(var r=0;r<ee.length;r++){var o=function(){var n=ee[r];if(e[n]){var i="webkitRequestFullscreen"===n?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[n]();return i&&i.then?(i.then(function(){"get"===t._fullActionFrom&&t.changeFullStyle(t.root,e,eV.FULLSCREEN)}).catch(function(t){v.logWarn("".concat(n,": ").concat((null==t?void 0:t.message)||"getFullscreen fail"))}),{v:i}):(t.changeFullStyle(t.root,e,eV.FULLSCREEN),{v:Promise.resolve()})}}();if("object"===nl(o))return o.v}if(i.fullscreenEnabled||i.webkitSupportsFullscreen)return i.webkitEnterFullscreen(),Promise.resolve();return Promise.reject(Error("call getFullscreen fail"))}catch(t){return Promise.reject(t)}}},{key:"exitFullscreen",value:function(t){if(!!this._fullscreenEl||!!_.getFullScreenEl()){var e=this.root,n=this.video;t&&(t=e),this._fullActionFrom="exit";for(var i=0;i<en.length;i++){var r=en[i];if(document[r]){var o=document[r]();if(o&&o.then)return o;return Promise.resolve()}}return n&&n.webkitSupportsFullscreen?(n.webkitExitFullScreen(),Promise.resolve()):Promise.reject(Error("call exitFullscreen fail"))}}},{key:"getCssFullscreen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.fullscreen&&this.exitFullscreen(),this._cssfullscreenEl=t,this.changeFullStyle(this.root,t,t?eV.INNER_FULLSCREEN:eV.CSS_FULLSCREEN),this.isCssfullScreen=!0,this.emit(th,!0)}},{key:"exitCssFullscreen",value:function(){var t=this._cssfullscreenEl?eV.INNER_FULLSCREEN:eV.CSS_FULLSCREEN;this.fullscreen?this.removeClass(t):this.recoverFullStyle(this.root,this._cssfullscreenEl,t),this._cssfullscreenEl=null,this.isCssfullScreen=!1,this.emit(th,!1)}},{key:"focus",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};if(this.isActive){this.onFocus(t);return}this.emit(Z,nc({paused:this.paused,ended:this.ended},t))}},{key:"blur",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};if(!this.isActive){this.onBlur(t);return}this.emit($,nc({paused:this.paused,ended:this.ended},t))}},{key:"onFocus",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3},n=this.innerStates;if(this.isActive=!0,this.removeClass(eV.ACTIVE),this.userTimer&&(_.clearTimeout(this,this.userTimer),this.userTimer=null),void 0!==e.isLock&&(n.isActiveLocked=e.isLock),!1===e.autoHide||!0===e.isLock||n.isActiveLocked){this.userTimer&&(_.clearTimeout(this,this.userTimer),this.userTimer=null);return}var i=e&&e.delay?e.delay:this.config.inactive;this.userTimer=_.setTimeout(this,function(){t.userTimer=null,t.blur()},i)}},{key:"onBlur",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};if(!!this.isActive&&!this.innerStates.isActiveLocked){var e=this.config.closePauseVideoFocus;this.isActive=!1,(t.ignorePaused||e||!this.paused&&!this.ended)&&this.addClass(eV.ACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.hasStart&&this.removeClass(eV.ENTER),this.isBufferControlPaused||this.removeClass(eV.LOADING),this.isCanplay=!0,this.waitTimer&&_.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1}},{key:"onPlay",value:function(){this.removeClass(eV.PAUSED),this.ended&&this.removeClass(eV.ENDED),this.config.closePlayVideoFocus||this.focus()}},{key:"onPause",value:function(){this.isBufferControlPaused||this.addClass(eV.PAUSED),this.updateAcc("pause"),!this.config.closePauseVideoFocus&&(this.userTimer&&(_.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.isBufferControlPaused=!1,this.updateAcc("ended"),this.addClass(eV.ENDED)}},{key:"onError",value:function(){this.isBufferControlPaused=!1,this.isError=!0,this.updateAcc("error"),this.removeClass(eV.NOT_ALLOW_AUTOPLAY),this.removeClass(eV.NO_START),this.removeClass(eV.ENTER),this.removeClass(eV.LOADING),this.addClass(eV.ERROR)}},{key:"onSeeking",value:function(){!this.isSeeking&&this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(eV.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&_.clearTimeout(this,this.waitTimer),this.removeClass(eV.LOADING),this.removeClass(eV.SEEKING)}},{key:"onWaiting",value:function(){var t=this;this.waitTimer&&_.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=_.setTimeout(this,function(){t.addClass(eV.LOADING),_.clearTimeout(t,t.waitTimer),t.waitTimer=null},200)}},{key:"onPlaying",value:function(){var t=this;this.isError=!1;var e=eV.NO_START,n=eV.PAUSED,i=eV.ENDED,r=eV.ERROR,o=eV.REPLAY,a=eV.LOADING;[e,n,i,r,o,a].forEach(function(e){t.removeClass(e)})}},{key:"onTimeupdate",value:function(){this._videoHeight||this.getVideoSize(),(this.waitTimer||this.hasClass(eV.LOADING))&&this.video.readyState>2&&(this.isBufferControlPaused||this.removeClass(eV.LOADING),_.clearTimeout(this,this.waitTimer),this.waitTimer=null),!this.paused&&!this.isPlaying&&this.duration&&(this.isPlaying=!0,this.emit(te)),!this._accPlayed.t&&!this.paused&&!this.ended&&(this._accPlayed.t=new Date().getTime())}},{key:"onVolumechange",value:function(){"Number"===_.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"onBufferControl",value:function(t){if(!!this.isPlaying)"waiting"===t.type?(this.isBufferControlPaused=!0,this.addClass(eV.LOADING),this.removeClass(eV.PAUSED)):"playing"===t.type&&(this.isBufferControlPaused=!1,this.removeClass(eV.LOADING),this.paused&&this.addClass(eV.PAUSED))}},{key:"emitUserAction",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!!this.video&&!!e&&!!t){var i="String"===_.typeOf(t)?t:t.type||"";"switch_play_pause"===e&&("Undefined"===_.typeOf(n.paused)&&(n.paused=this.paused),n.isFirstStart=!this.playing),this.emit(tT,nc({eventType:i,action:e,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:t},n))}}},{key:"updateAcc",value:function(t){if(this._accPlayed.t){var e=new Date().getTime(),n=e-this._accPlayed.t;if(!(n<0))this._accPlayed.acc+=n,this._accPlayed.t="get"===t?e:0,("ended"===t||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(t){var e=this.video.buffered;if(!e||0===e.length||!this.duration)return!0;for(var n=parseInt(1e3*(t||this.video.currentTime||0),10),i=e.length,r=0;r<i;r++)if(parseInt(1e3*e.start(r),10)+200<=n&&parseInt(1e3*e.end(r),10)-200>n)return!0;return!1}},{key:"resizePosition",value:function(){var t=this.videoPos,e=t.rotate,n=t.vy,i=t.vx,r=t.h,o=t.w;if(e<0&&r<0&&o<0)return;var a=this.videoPos._pi;if(!a&&this.video.videoHeight&&(a=this.video.videoWidth/this.video.videoHeight*100),!!a){this.videoPos.pi=a;var s={},u=0,c=0,l=1,f=e<0?0:Math.abs(e/90),h=this.root,p=this.innerContainer,d=h.offsetWidth,y=p?p.offsetHeight:h.offsetHeight,v=y,g=d,m={width:d,height:y};if(f%2==0)l=r>0?100/r:o>0?100/o:1,s.scale=l,u=n>0?(100-r)/2-n:0,s.y=2===f?0-u:u,c=i>0?(100-o)/2-i:0,s.x=2===f?0-c:c,m.width=g,m.height=v;else if(f%2==1){g=y,v=d;var b=y-d;c=-b/2/g*100,s.x=3===f?c+n/2:c-n/2,u=b/2/v*100,s.y=3===f?u+i/2:u-i/2,s.scale=l,m.width=g,m.height=v}var w=this.video;e>=0&&["width","height"].forEach(function(t){w.style[t]="".concat(m[t],"px")}),s.rotate=e<0?0:e;var k=_.getTransformStyle(s,this.video.style.transform||this.video.style.webkitTransform);w.style.transform=k,w.style.webkitTransform=k}}},{key:"position",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(!!this.video&&!!t&&!!t.h){var e=this.videoPos;e.h=100*t.h||0,e.w=100*t.w||0,e.vx=100*t.x||0,e.vy=100*t.y||0,this.resizePosition()}}},{key:"setConfig",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{deepMerge:!1};if(!!t)Object.keys(t).map(function(i){if("plugins"!==i){n.deepMerge&&"Object"===_.typeOf(e.config[i])?_.deepMerge(e.config[i],t[i]):e.config[i]=t[i];var r=e.plugins[i.toLowerCase()];r&&"Function"===_.typeOf(r.setConfig)&&r.setConfig(t[i],n)}})}},{key:"playNext",value:function(t){var e=this;this.resetState(),this._currentTime=0,this._duration=0,this.isPlaying=!1,this.setConfig(t),this.vtype="MP4",ev(this,"playnext",function(){e.start(),e.emit(tS,t)})}},{key:"getVideoSize",value:function(){var t=this;if(!this.video)return;var e=this.root.getBoundingClientRect();this.sizeInfo.width=e.width,this.sizeInfo.height=e.height,this.sizeInfo.left=e.left,this.sizeInfo.top=e.top;var n=this.video,i=n.videoWidth,r=n.videoHeight,o=this.config,a=o.fitVideoSize,s=o.videoFillMode;if(("fill"===s||"cover"===s||"contain"===s)&&this.setAttribute("data-xgfill",s),!!r&&!!i){this._videoHeight=r,this._videoWidth=i;var u=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,c=e.width,l=e.height-u,f=parseInt(i/r*1e3,10),h=parseInt(c/l*1e3,10),p=c,d=l,y={};"auto"===a&&h>f||"fixWidth"===a?(d=c/f*1e3,this.config.fluid?y.paddingTop="".concat(100*d/p,"%"):y.height="".concat(d+u,"px")):("auto"===a&&h<f||"fixHeight"===a)&&(p=f*l/1e3,y.width="".concat(p,"px")),!this.fullscreen&&!this.cssfullscreen&&Object.keys(y).forEach(function(e){t.root.style[e]=y[e]}),("fillHeight"===s&&h<f||"fillWidth"===s&&h>f)&&this.setAttribute("data-xgfill","cover");var v={videoScale:f,vWidth:p,vHeight:d,cWidth:p,cHeight:d+u};this.resizePosition(),this.emit(tb,v)}}},{key:"updateObjectPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this.video.updateObjectPosition){this.video.updateObjectPosition(t,e);return}this.video.style.objectPosition="".concat(100*t,"% ").concat(100*e,"%")}},{key:"preProcessUrl",value:function(t,e){var n=this.config,i=n.preProcessUrl,r=Object.assign({},n.preProcessUrlOptions,e);return _.isBlob(t)||"function"!=typeof i?{url:t}:i(t,r)}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(t){if(!!this.video){if(this.emit(ta,t),this.emit(N),this._currentTime=0,this._duration=0,_.isMSE(this.video)){this.onWaiting();return}t=this.preProcessUrl(t).url,this._detachSourceEvents(this.video),"Array"===_.typeOf(t)?this._attachSourceEvents(this.video,t):t?this.video.src=t:this.video.removeAttribute("src"),this.load()}}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(t){var e=this,n=this.config.definition;n.list=t,this.emit("resourceReady",t);var i=null,r=null;t.map(function(t){e.curDefinition===t.definition&&(i=t),n.defaultDefinition===t.definition&&(r=t)}),!r&&t.length>0&&(r=t[0]),i?this.changeDefinition(i):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var t={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.video||!this.video.getVideoPlaybackQuality)return t;var e=this.video.getVideoPlaybackQuality();return t.dropped=e.droppedVideoFrames||0,t.total=e.totalVideoFrames||0,t.corrupted=e.corruptedVideoFrames||0,t.total>0&&(t.droppedRate=t.dropped/t.total*100,t.droppedDuration=parseInt(this.cumulateTime/t.total*t.dropped,0)),t}},{key:"lang",get:function(){return this.config.lang},set:function(t){if(0!==e7.langKeys.filter(function(e){return e===t}).length||"zh"===t)this.config.lang=t,eW.setLang(t,this)}},{key:"i18n",get:function(){var t=this.config.lang;return"zh"===t&&(t="zh-cn"),this.__i18n.lang[t]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return h}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(t){this.__url=t}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(t){this.plugins.poster&&this.plugins.poster.update(t)}},{key:"readyState",get:function(){var t=nh(nv(s.prototype),"readyState",this);return this.i18n[t]||t}},{key:"error",get:function(){var t=nh(nv(s.prototype),"error",this);return this.i18n[t]||t}},{key:"networkState",get:function(){var t=nh(nv(s.prototype),"networkState",this);return this.i18n[t]||t}},{key:"fullscreenChanging",get:function(){return null!==this._fullScreenOffset}},{key:"cumulateTime",get:function(){var t=this._accPlayed;return this.updateAcc("get"),t.acc}},{key:"zoom",get:function(){return this.config.zoom},set:function(t){this.config.zoom=t}},{key:"videoRotateDeg",get:function(){return this.videoPos.rotate},set:function(t){if((t=_.convertDeg(t))%90==0&&t!==this.videoPos.rotate)this.videoPos.rotate=t,this.resizePosition()}},{key:"avgSpeed",get:function(){return nk},set:function(t){nk=t}},{key:"realTimeSpeed",get:function(){return nw},set:function(t){nw=t}},{key:"hook",value:function(t,e){return arguments.length>2&&void 0!==arguments[2]&&arguments[2],eu.call.apply(eu,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(t,e){return ec.call.apply(ec,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(t,e){return ef.call.apply(ef,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(t,e,n){for(var i=arguments.length,r=Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return eh.call.apply(eh,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(t,e,n){for(var i=arguments.length,r=Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return ep.call.apply(ep,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(t,e){var n;"boolean"==typeof e&&e!==this.muted&&(this.addInnerOP("volumechange"),this.muted=e),null===(n=n_)||void 0===n||n.setActive(this.playerId,t)}}],o=[{key:"debugger",get:function(){return v.config.debug},set:function(t){v.config.debug=t}},{key:"instManager",get:function(){return n_},set:function(t){n_=t}},{key:"pluginsManager",get:function(){return eW}},{key:"getCurrentUserActivePlayerId",value:function(){var t;return null===(t=n_)||void 0===t?void 0:t.getActiveId()}},{key:"setCurrentUserActive",value:function(t,e){var n;null===(n=n_)||void 0===n||n.setActive(t,e)}},{key:"isHevcSupported",value:function(){return t$.isHevcSupported()}},{key:"probeConfigSupported",value:function(t){return t$.probeConfigSupported(t)}},{key:"install",value:function(t,e){!s.plugins&&(s.plugins={}),!s.plugins[t]&&(s.plugins[t]=e)}},{key:"use",value:function(t,e){!s.plugins&&(s.plugins={}),s.plugins[t]=e}}],r&&nf(i.prototype,r),o&&nf(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(t6);function nP(t){return(nP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function nT(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nO(Object(n),!0).forEach(function(e){nR(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nO(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}ng(nS,"defaultPreset",null),ng(nS,"XgVideoProxy",null),nS.instManager=ns.getInstance();function nE(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,nA(i.key),i)}}function nC(t,e){return(nC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function nx(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nj(t){return(nj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function nR(t,e,n){return(e=nA(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nA(t){var e=function(t,e){if("object"!==nP(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==nP(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===nP(e)?e:String(e)}function nL(){return new Date().getTime()}var nI={LOAD_START:"loadstart",LOADED_DATA:"loadeddata",FIRST_FRAME:"firstFrame",WAIT_START:"waitingStart",WAIT_END:"waitingEnd",SEEK_START:"seekStart",SEEK_END:"seekEnd",WAIT_END_EXT:"waitingEndExt",SEEK_END_EXT:"seekEndEndExt"},nD="[xgLogger]",nN=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nC(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=nj(e);return t=n?Reflect.construct(i,arguments,nj(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===nP(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return nx(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return nR(nx(t=a.call.apply(a,[this].concat(n))),"_onLoadedMetaData",function(){var e=t._state,n=e.isLs,i=e.autoplayStart,r=e.isFFSend,o=e.isLoadStartDelay;v.logInfo(nD,"LOAD_START Delay","autoplayStart:".concat(i," isFFSend:").concat(r," startCostTime:").concat(t.startCostTime," newPointTime:").concat(t.newPointTime,", vtype:").concat(t.player.vtype)),t.playerConfig.loadStartDelay&&n&&!o&&"MP4_MSE"===t.player.vtype&&(t._state.isLoadStartDelay=!0,t.emitLog(nI.LOAD_START,{}))}),nR(nx(t),"_onLoadStart",function(){var e=nx(t)._state,n=e.autoplayStart,i=e.isFFSend;if(t.startCostTime=nL()-t.newPointTime,v.logInfo(nD,"LOAD_START","autoplayStart:".concat(n," isFFSend:").concat(i," startCostTime:").concat(t.startCostTime," newPointTime:").concat(t.newPointTime,", vtype:").concat(t.player.vtype)),!i)!e.isLs&&(!t.playerConfig.loadStartDelay||"MP4_MSE"!==t.player.vtype)&&(e.isLoadStartDelay=!0,t.emitLog(nI.LOAD_START,{})),e.isLs=!0,e.isTimeUpdate=!1,e.isFFLoading=!0,t.pt=nL(),t.vt=0,t.fvt=0,t._initOnceEvents()}),nR(nx(t),"_onLoadedData",function(){t.vt=nL(),t.fvt=t.vt-t.pt,t.loadedCostTime=t.vt-t.newPointTime,t._updateBuffer();var e=t._state,n=e.isTimeUpdate,i=e.isFFSend,r=e.autoplayStart;v.logInfo(nD,"LOADED_DATA","fvt:".concat(t.fvt," isTimeUpdate:").concat(t._state.isTimeUpdate," loadedCostTime:").concat(t.loadedCostTime)),(n||r)&&t._sendFF("loadedData"),!i&&t.emitLog(nI.LOADED_DATA,{})}),nR(nx(t),"_onTimeupdate",function(){var e=nx(t)._state;e.isTimeUpdate=!0,e.time=t.player.currentTime,t._state.autoplayStart&&!e.isFFSend&&t._sendFF("onTimeupdate")}),nR(nx(t),"_onPlay",function(){var e=t.player.buffered,n=nx(t).levelInfo;v.logInfo(nD,"_onPlay playPos:".concat(n.startBuffer)),n.startBuffer<0&&(n.startBuffer=e.length>0?parseInt(1e3*e.end(0),10):0,n.startType="onplay")}),nR(nx(t),"_onAutoplayStart",function(){v.logInfo(nD,"_onAutoplayStart"),t._state.autoplayStart=!0,t.vt&&t._sendFF("onAutoplayStart")}),nR(nx(t),"_onReset",function(){t._state={time:0,autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1,isLoadStartDelay:!1},t.vt=0,t.pt=0,t.fvt=0,t.newPointTime=nL(),t.loadedCostTime=0,t.startCostTime=0,t.seekingStart=0,t.seekData={startTime:0,lastTime:0,timeBefore:0,timeAfter:0,inBuffer:0,diffStart:0,interval:-1},t.waitData={startTime:0,lastTime:0,interval:-1,diffStart:0},t.waitingStart=0,t.fixedWaitingStart=0,t.ffsendTime=0,t.levelInfo={diff:0,buffer:-1,startBuffer:-1,startType:""},t._isWaiting=!1,t._waitTimer&&_.clearTimeout(nx(t),t._waitTimer),t._waittTimer&&_.clearTimeout(nx(t),t._waittTimer),t._waitTimer=null,t._waittTimer=null,t._waitType=0}),nR(nx(t),"_onSeeking",function(){var e=nx(t),n=e.seekData,i=e._state;if(!n.startTime){var r=t.player,o=r.buffered,a=r.currentTime;n.startTime=nL(),n.timeBefore=i.time,n.timeAfter=a;var s=_.getBufferByCurrentTime(o,a);v.logInfo(nD,"onSeeking",a,s),n.inBuffer=s.include,n.diffStart=1e3*s.diff,n.lastTime>0?n.interval=n.startTime-n.lastTime:n.interval=-1,v.logInfo(nD,"onSeeking",n),t.suspendWaitingStatus("seek");var u=t._getSeekInfo();t.emitLog(nI.SEEK_START,nT({start:nL()},u))}}),nR(nx(t),"_onSeeked",function(){v.logInfo(nD,"onSeeked"),t.suspendSeekingStatus("seeked")}),nR(nx(t),"_onWaiting",function(){if(!t._isWaiting&&!!t.vt){t._isWaiting=!0;var e=nx(t),n=e.waitData,i=e.seekData;e._state.isTimeUpdate||0!==i.startTime?i.startTime?t._waitType=2:t._waitType=0:t._waitType=1,t.fixedWaitingStart=nL(),v.logInfo(nD,"_onWaiting"),n.lastTime>0?n.interval=t.fixedWaitingStart-n.lastTime:n.interval=-1;var r=t.player,o=r.buffered,a=r.currentTime,s=_.getBufferByCurrentTime(o,a);n.diffStart=1e3*s.diff,t._waitTimer=_.setTimeout(nx(t),function(){v.logInfo(nD,"_onWaiting real");var e=nx(t).waitData;t._isWaiting?(t.waitingStart=nL(),_.clearTimeout(nx(t),t._waitTimer),e.lastTime=t.fixedWaitingStart,t._waitTimer=null,t._startWaitTimeout(),t.emitLog(nI.WAIT_START,{fixedStart:t.fixedWaitingStart,start:t.waitingStart,type:t._waitType,endType:2===t._waitType?"seek":"playing",diffStart:e.diffStart,interval:e.interval})):(e.interval=-1,e.diffStart=0)},200)}}),nR(nx(t),"_onError",function(){t.suspendSeekingStatus("error"),t.suspendWaitingStatus("error")}),nR(nx(t),"_onWaitingTimeout",function(e){t.suspendWaitingStatus(e||"timeout"),_.clearTimeout(nx(t),t._waittTimer),t._waittTimer=null}),nR(nx(t),"_onProgress",function(){v.logInfo(nD,"_onProgress")}),nR(nx(t),"_onPlaying",function(){v.logInfo(nD,"_onPlaying"),t._isWaiting&&t.suspendWaitingStatus("playing")}),t}return i=s,o=[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}],r=[{key:"afterCreate",value:function(){var t=this;this._onReset(),this._waitType=-1,this._initOnceEvents(),this.newPointTime=nL(),this.loadedCostTime=0,this.startCostTime=0,this.ffsendTime=0,this.on(W,this._onLoadedMetaData),this.on(z,this._onLoadStart),this.on(U,this._onLoadedData),this.on(L,this._onSeeking),this.on(I,this._onSeeked),this.on(to,function(){t.endState("destroy")}),this.on(j,function(){t.endState("ended")}),this.on(R,function(){t.endState("pause")}),this.on(C,this._onPlay),this.on(ta,function(){t.endState("urlChange"),v.logInfo(nD,"URL_CHANGE"),t._state.isFFSend&&t._onReset()}),this.on([x,M],this._onPlaying),this.on(N,this._onWaiting),this.on(A,this._onError),this.on(tE,function(){v.logInfo(nD,"RESET"),t.endState("reset"),t._initOnceEvents(),t._onReset();var e=t.levelInfo;t.playerConfig.autoplay&&(e.startType="onreset",e.startBuffer=0)})}},{key:"_initOnceEvents",value:function(){this.off(te,this._onAutoplayStart),this.off(D,this._onTimeupdate),this.once(te,this._onAutoplayStart),this.on(D,this._onTimeupdate)}},{key:"_sendFF",value:function(t){var e=this._state,n=e.isFFLoading,i=e.isFFSend;if(v.logInfo(nD,"_sendFF","".concat(t," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!i)),this.vt>0&&n&&!i){this.ffsendTime=nL();var r,o=this.levelInfo,a=o.buffer,s=o.startBuffer,u=o.startType;v.logInfo(nD,"emitLog_firstFrame",t,"startBuffer:".concat(s," startType:").concat(u," buffer:").concat(a," ")),this._state.isFFLoading=!1,this._state.isFFSend=!0;var c=this.fvt+((null===(r=this.player)||void 0===r?void 0:r.beforeLoadStartCostTime)||0);this.emitLog(nI.FIRST_FRAME,{fvt:this.fvt,costTime:c,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime,buffer:a,startBuffer:s,endType:t})}}},{key:"_updateBuffer",value:function(){var t=this.player,e=t.buffered,n=t.currentTime,i=_.getBufferByCurrentTime(e,n);v.logInfo(nD,"_updateBuffer",i);var r=this.levelInfo;r.buffer=1e3*i.end,r.diff=1e3*i.diff}},{key:"_getSeekInfo",value:function(){var t=this.seekData;return{interval:t.interval,timeBefore:t.timeBefore,timeAfter:t.timeAfter,inBuffer:t.inBuffer,diffStart:t.diffStart}}},{key:"_startWaitTimeout",value:function(){this._waittTimer&&_.clearTimeout(this,this._waittTimer),this._waittTimer=_.setTimeout(this,this._onWaitingTimeout,this.config.waitTimeout)}},{key:"endState",value:function(t){var e=this.player,n=e.currentTime,i=e.duration,r=i-n,o=!(i>0&&n>0&&r<1);v.logInfo(nD,"endState:".concat(t," duration - currentTime:").concat(r," _emit:").concat(o)),this.suspendWaitingStatus(t,o),this.suspendSeekingStatus(t,o)}},{key:"suspendSeekingStatus",value:function(t){var e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this.seekData;if(!!n.startTime){var i=nL(),r=i-n.startTime,o=this.player,a=o.buffered,s=o.currentTime,u=_.getBufferByCurrentTime(a,s);v.logInfo(nD,"suspendSeekingStatus",s,r),n.lastTime=n.startTime,n.startTime=0;var c=e?nI.SEEK_END:nI.SEEK_END_EXT,l=this._getSeekInfo();this.emitLog(c,nT(nT({end:i,costTime:r,endType:t},l),{},{diffEnd:1e3*u.diff}))}}},{key:"suspendWaitingStatus",value:function(t){var e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(this._waitTimer&&(_.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(_.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,!!this.waitingStart){var n=this.waitData,i=nL(),r=i-this.waitingStart,o=i-this.fixedWaitingStart,a=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0;var s=this.player,u=s.buffered,c=s.currentTime,l=_.getBufferByCurrentTime(u,c),f=e?nI.WAIT_END:nI.WAIT_END_EXT;this.emitLog(f,{fixedCostTime:o>a?a:o,costTime:r>a?a:r,type:"loadeddata"===t?1:this._waitType,endType:2===this._waitType?"seek":t,diffStart:n.diffStart,diffEnd:1e3*l.diff,interval:n.interval})}}},{key:"emitLog",value:function(t,e){var n=this.player,i=n.video,r=i.readyState,o=i.networkState;this.emit(tO,nT({t:nL(),host:_.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:t,currentTime:n.currentTime,readyState:r,networkState:o},e))}}],nE(i.prototype,r),o&&nE(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function nM(t){return(nM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nB(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==nM(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==nM(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===nM(e)?e:String(e)}(i.key),i)}}function nF(t,e){return(nF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function nH(t){return(nH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var nU=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nF(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=nH(e);return t=n?Reflect.construct(i,arguments,nH(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===nM(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,o=[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}],r=[{key:"registerIcons",value:function(){return{replay:'<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78"><path fill="#fff" d="M28.227 33.876l3.04-1.229a1 1 0 011.303.553l.374.927a1 1 0 01-.552 1.302l-5.564 2.247-.927.375a1 1 0 01-1.302-.553l-2.622-6.49a1 1 0 01.553-1.302l.927-.374a1 1 0 011.302.552l.92 2.278A15.005 15.005 0 0139.5 23c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15a14.955 14.955 0 01-10.63-4.417 1.5 1.5 0 112.126-2.116A11.956 11.956 0 0039.5 50c6.627 0 12-5.373 12-12s-5.373-12-12-12a12.005 12.005 0 00-11.273 7.876z"/></svg>'}}},{key:"afterCreate",value:function(){var t=this;eN.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayHandler",function(){t.player.replay()},{pre:function(t){t.preventDefault(),t.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(j,function(){if(!t.playerConfig.loop&&_.addClass(t.player.root,"replay"),!t.config.disable){t.show();var e=t.root.querySelector("path");if(e){var n=window.getComputedStyle(e).getPropertyValue("transform");if("string"==typeof n&&n.indexOf("none")>-1)return null;e.setAttribute("transform",n)}}}),this.on(C,function(){t.hide()})}},{key:"handleReplay",value:function(t){t.preventDefault(),t.stopPropagation(),this.player.replay(),_.removeClass(this.player.root,"replay")}},{key:"show",value:function(){if(!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>")}}],nB(i.prototype,r),o&&nB(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function nW(t){return(nW="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nV(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==nW(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==nW(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===nW(e)?e:String(e)}(i.key),i)}}function nG(t,e){return(nG=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function nz(t){return(nz=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var nK=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nG(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=nz(e);return t=n?Reflect.construct(i,arguments,nz(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===nW(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,o=[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,poster:""}}}],r=[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(t){this.config.isEndedShow=t}},{key:"hide",value:function(){_.addClass(this.root,"hide")}},{key:"show",value:function(){_.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(t){"string"==typeof t.player.config.poster&&(t.config.poster=t.player.config.poster)}},{key:"afterCreate",value:function(){var t=this;this.on(j,function(){t.isEndedShow&&_.removeClass(t.root,"hide")}),this.config.hideCanplay?(this.once(D,function(){t.onTimeUpdate()}),this.on(ta,function(){_.removeClass(t.root,"hide"),_.addClass(t.root,"xg-showplay"),t.once(D,function(){t.onTimeUpdate()})})):this.on(C,function(){_.addClass(t.root,"hide")})}},{key:"onTimeUpdate",value:function(){var t=this;this.player.currentTime?_.removeClass(this.root,"xg-showplay"):this.once(D,function(){t.onTimeUpdate()})}},{key:"update",value:function(t){if(!!t)this.config.poster=t,this.root.style.backgroundImage="url(".concat(t,")")}},{key:"render",value:function(){var t=this.config,e=t.poster,n=t.hideCanplay;return'<xg-poster class="xgplayer-poster '.concat(n?"xg-showplay":"",'" style="').concat(e?"background-image:url(".concat(e,");"):"",'">\n </xg-poster>')}}],nV(i.prototype,r),o&&nV(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function nY(t){return(nY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nX(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,nQ(i.key),i)}}function nq(t,e){return(nq=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function nJ(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nZ(t){return(nZ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function n$(t,e,n){return(e=nQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nQ(t){var e=function(t,e){if("object"!==nY(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==nY(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===nY(e)?e:String(e)}var n0={},n1=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nq(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=nZ(e);return t=n?Reflect.construct(i,arguments,nZ(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===nY(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return nJ(t)}(this,t)});function s(t){var e;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),n$(nJ(e=a.call(this,t)),"onPlayerReset",function(){e.autoPlayStart=!1;var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),_.removeClass(e.root,t),e.show()}),n$(nJ(e),"onAutoplayStart",function(){if(!e.autoPlayStart){var t="auto"===e.config.mode?"auto-hide":"hide";_.addClass(e.root,t),e.autoPlayStart=!0,e.onPlayPause("play")}}),e.autoPlayStart=!1,e._lastState="",e}return i=s,o=[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}],r=[{key:"afterCreate",value:function(){var t=this,e=this.player,n=this.playerConfig;this.initIcons(),this.once(Q,function(){n&&(n.lang&&"en"===n.lang?_.addClass(e.root,"lang-is-en"):"jp"===n.lang&&_.addClass(e.root,"lang-is-jp"))}),this.on(te,this.onAutoplayStart),!n.autoplay&&this.show(),this.on(tn,function(){var e="auto"===t.config.mode?"auto-hide":"hide";t.setAttr("data-state","play"),_.removeClass(t.root,e),t.show()}),this.on(C,function(){t.onPlayPause("play")}),this.on(R,function(){t.onPlayPause("pause")}),this.on(tu,function(){t.onPlayPause(e.paused?"pause":"play")}),this.on(tE,function(){t.onPlayerReset()}),this.clickHandler=this.hook("click",this.switchPausePlay,{pre:function(e){e.cancelable&&e.preventDefault(),e.stopPropagation(),t.emitUserAction(e,"switch_play_pause")}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:'<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40"><path fill="#fff" d="M18.468 11.639l7.503 4.777-7.503 4.777zM10.965 6.86l7.503 4.778v9.554l-7.503 4.778z"/></svg>',class:"xg-icon-play"},startPause:{icon:'<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40"><path fill="#fff" d="M19.173 6.861h5.451v19.11h-5.45V6.86zM8.208 25.971V6.86h5.45v19.11h-5.45z"/></svg>',class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild("xg-start-inner",t.startPlay),this.appendChild("xg-start-inner",t.startPause)}},{key:"hide",value:function(){_.addClass(this.root,"hide")}},{key:"show",value:function(){_.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){_.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){_.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(t){t?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(t){var e=this;!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};n0[t]&&window.clearTimeout(n0[t].id),n0[t]={},n.start&&n.start(),n0[t].id=window.setTimeout(function(){n.end&&n.end(),window.clearTimeout(n0[t].id),delete n0[t]},e)}("pauseplay",400,{start:function(){_.addClass(e.root,"interact"),e.show(),e.switchStatus(!0)},end:function(){_.removeClass(e.root,"interact"),t||e.hide()}})}},{key:"switchPausePlay",value:function(t){var e=this.player;if(t.cancelable&&t.preventDefault(),t.stopPropagation(),!!e.isReady)!this.player.paused&&e.isPlaying?e.pause():e.play()}},{key:"onPlayPause",value:function(t){var e=this.config,n=this.player;if(!!n.isPlaying&&!!this.autoPlayStart&&("pause"!==t||this._lastState!==t&&!n.isBufferControlPaused)){if(this._lastState=t,"show"===e.mode){this.switchStatus(),this.show();return}if("auto"===e.mode){this.switchStatus();return}if(e.isShowPause&&n.paused&&!n.ended||e.isShowEnd&&n.ended){this.switchStatus(),this.show();return}if(e.disableAnimate){this.switchStatus(),this.hide();return}if("play"===t)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Object.keys(n0).map(function(t){window.clearTimeout(n0[t].id),delete n0[t]})}},{key:"render",value:function(){var t=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(t,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],nX(i.prototype,r),o&&nX(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function n2(t){return(n2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n3(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==n2(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==n2(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===n2(e)?e:String(e)}(i.key),i)}}function n4(t,e){return(n4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function n5(t){return(n5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var n6=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n4(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=n5(e);return t=n?Reflect.construct(i,arguments,n5(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===n2(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,o=[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}],r=[{key:"render",value:function(){var t=this.config.innerHtml,e=_.createDom("xg-enter","",{},"xgplayer-enter");if(t&&t instanceof window.HTMLElement)e.appendChild(t);else if(t&&"string"==typeof t)e.innerHTML=t;else{for(var n="",i=1;i<=12;i++)n+='<div class="xgplayer-enter-bar'.concat(i,'"></div>');e.innerHTML='<div class="xgplayer-enter-spinner">'.concat(n,"</div>")}return e}}],n3(i.prototype,r),o&&n3(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function n9(t){return(n9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n8(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==n9(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==n9(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===n9(e)?e:String(e)}(i.key),i)}}function n7(t,e){return(n7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function it(t){return(it=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ie=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n7(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=it(e);return t=n?Reflect.construct(i,arguments,it(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===n9(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,r=[{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 t="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</span></div>\n </xg-icon>")}}],o=[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_RIGHT,index:10}}}],r&&n8(i.prototype,r),o&&n8(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function ii(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==is(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==is(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===is(e)?e:String(e)}(i.key),i)}}function ir(t,e){return(ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function io(t,e){if(e&&("object"===is(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ia(t){return(ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function is(t){return(is="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function iu(t){var e=parseFloat(t);return -1===t.indexOf("%")&&!Number.isNaN(e)&&e}var ic=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],il=ic.length;function ih(t){if("string"==typeof t&&(t=document.querySelector(t)),!!t&&"object"===is(t)&&!!t.nodeType){var e,n=(e=t,window.getComputedStyle(e));if("none"===n.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<il;e++)t[ic[e]]=0;return t}();var i={};i.width=t.offsetWidth,i.height=t.offsetHeight;for(var r=i.isBorderBox="border-box"===n.boxSizing,o=0;o<il;o++){var a=ic[o],s=parseFloat(n[a]);i[a]=Number.isNaN(s)?0:s}var u=i.paddingLeft+i.paddingRight,c=i.paddingTop+i.paddingBottom,l=i.marginLeft+i.marginRight,f=i.marginTop+i.marginBottom,h=i.borderLeftWidth+i.borderRightWidth,p=i.borderTopWidth+i.borderBottomWidth,d=iu(n.width);!1!==d&&(i.width=d+(r?0:u+h));var y=iu(n.height);return!1!==y&&(i.height=y+(r?0:c+p)),i.innerWidth=i.width-(u+h),i.innerHeight=i.height-(c+p),i.outerWidth=i.width+l,i.outerHeight=i.height+f,i}}function ip(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(i.identifier===e)return i}}var id={START:"dragStart",MOVE:"dragMove",ENDED:"dragEnded"},iy={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},iv=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ir(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=ia(e);return t=n?Reflect.construct(i,arguments,ia(this).constructor):i.apply(this,arguments),io(this,t)});function s(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this)).isEnabled=!0,e.isDragging=!1,e.isDown=!1,e.position={},e.downPoint={},e.dragPoint={x:0,y:0},e.startPos={x:0,y:0},e._root=t instanceof Element?t:document.querySelector(t),e._handlerDom=n.handle instanceof Element?n.handle:document.querySelector(n.handle),e._root&&e._handlerDom)?(e._bindStartEvent(),e):io(e)}return i=s,r=[{key:"_bindStartEvent",value:function(){var t=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)]),iy[this._startKey].map(function(e){t["on".concat(e)]=t["on".concat(e)].bind(t)})}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(t){var e=this;if(!!t){var n=iy[this._startKey];n.map(function(t){window.addEventListener(t,e["on".concat(t)])}),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var t=this;if(!!this._boundPointerEvents)this._boundPointerEvents.map(function(e){window.removeEventListener(e,t["on".concat(e)])}),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(t){this.onUp()}},{key:"animate",value:function(){var t=this;if(!!this.isDragging)this.positionDrag(),window.requestAnimationFrame(function(){t.animate()})}},{key:"positionDrag",value:function(){var t="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=t,this._root.style.webKitTransform=t}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(t){this.dragStart(t,t)}},{key:"onmousemove",value:function(t){this.dragMove(t,t)}},{key:"onmouseup",value:function(t){this.dragEnd(t,t)}},{key:"ontouchstart",value:function(t){var e=t.changedTouches[0];this.dragStart(t,e),this.touchIdentifier=void 0!==e.pointerId?e.pointerId:e.identifier,t.preventDefault()}},{key:"ontouchmove",value:function(t){var e=ip(t.changedTouches,this.touchIdentifier);e&&this.dragMove(t,e)}},{key:"ontouchend",value:function(t){var e=ip(t.changedTouches,this.touchIdentifier);e&&this.dragEnd(t,e),t.preventDefault()}},{key:"ontouchcancel",value:function(t){var e=ip(t.changedTouches,this.touchIdentifier);e&&this.dragCancel(t,e)}},{key:"dragStart",value:function(t,e){if(!!this._root&&!this.isDown&&!!this.isEnabled){this.downPoint=e,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var n=ih(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-n.height,this.startPos.maxX=window.innerWidth-n.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(t)}}},{key:"dragRealStart",value:function(t,e){this.isDragging=!0,this.animate(),this.emit(id.START,this.startPos)}},{key:"dragEnd",value:function(t,e){if(!!this._root)this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(id.ENDED)),this.presetInfo()}},{key:"_dragPointerMove",value:function(t,e){var n={x:e.pageX-this.downPoint.pageX,y:e.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(t,e),n}},{key:"dragMove",value:function(t,e){if(t=t||window.event,!!this.isDown){var n=this.startPos,i=n.x,r=n.y,o=this._dragPointerMove(t,e),a=o.x,s=o.y;a=this.checkContain("x",a,i),s=this.checkContain("y",s,r),this.position.x=i+a,this.position.y=r+s,this.dragPoint.x=a,this.dragPoint.y=s,this.emit(id.MOVE,this.position)}}},{key:"dragCancel",value:function(t,e){this.dragEnd(t,e)}},{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(t){return Math.abs(t.x)>3||Math.abs(t.y)>3}},{key:"checkContain",value:function(t,e,n){return e+n<0?0-n:"x"===t&&e+n>this.startPos.maxX?this.startPos.maxX-n:"y"===t&&e+n>this.startPos.maxY?this.startPos.maxY-n:e}},{key:"_getPosition",value:function(){var t=window.getComputedStyle(this._root),e=this._getPositionCoord(t.left,"width"),n=this._getPositionCoord(t.top,"height");this.position.x=Number.isNaN(e)?0:e,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(t)}},{key:"_addTransformPosition",value:function(t){var e=t.transform;if(0===e.indexOf("matrix")){var n=e.split(","),i=0===e.indexOf("matrix3d")?12:4,r=parseInt(n[i],10),o=parseInt(n[i+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(t,e){if(-1!==t.indexOf("%")){var n=ih(this._root.parentNode);return n?parseFloat(t)/100*n[e]:0}return parseInt(t,10)}}],ii(i.prototype,r),Object.defineProperty(i,"prototype",{writable:!1}),s}(f());function ig(t){return(ig="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function im(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,iS(i.key),i)}}function ib(t,e){return(ib=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function iw(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ik(t){return(ik=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i_(t,e,n){return(e=iS(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iS(t){var e=function(t,e){if("object"!==ig(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ig(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ig(e)?e:String(e)}var iP=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ib(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=ik(e);return t=n?Reflect.construct(i,arguments,ik(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===ig(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return iw(t)}(this,t)});function s(t){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),i_(iw(e=a.call(this,t)),"onCancelClick",function(t){e.exitMini(),e.isClose=!0}),i_(iw(e),"onCenterClick",function(t){var n=iw(e).player;n.paused?n.play():n.pause()}),i_(iw(e),"onScroll",function(t){if(!(!window.scrollY&&0!==window.scrollY||50>Math.abs(window.scrollY-e.pos.scrollY))){var n=parseInt(_.getCss(e.player.root,"height"));n+=e.config.scrollTop,e.pos.scrollY=window.scrollY,window.scrollY>n+5?e.isMini||e.isClose||e.getMini():window.scrollY<=n&&(e.isMini&&e.exitMini(),e.isClose=!1)}}),e.isMini=!1,e.isClose=!1;var e,n=iw(e).config;return e.pos={left:n.left<0?window.innerWidth-n.width-20:n.left,top:n.top<0?window.innerHeight-n.height-20:n.top,height:e.config.height,width:e.config.width,scrollY:window.scrollY||0},e.lastStyle=null,e}return i=s,o=[{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}}}],r=[{key:"beforeCreate",value:function(t){"boolean"==typeof t.player.config.mini&&(t.config.isShowIcon=t.player.config.mini)}},{key:"afterCreate",value:function(){var t=this;this.initIcons(),this.on(R,function(){t.setAttr("data-state","pause")}),this.on(C,function(){t.setAttr("data-state","play")})}},{key:"onPluginsReady",value:function(){var t=this,e=this.player;if(!this.config.disable){this.config.isShowIcon&&e.controls.registerPlugin(ie,{config:{onClick:function(){t.getMini()}}},ie.pluginName);var n=_.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",n,this.onCancelClick),this.bind(".play-icon",n,this.onCenterClick),!this.config.disableDrag&&(this._draggabilly=new iv(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:'<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40"><path fill="#fff" d="M18.468 11.639l7.503 4.777-7.503 4.777zM10.965 6.86l7.503 4.778v9.554l-7.503 4.778z"/></svg>',class:"xg-icon-play"},pause:{icon:'<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40"><path fill="#fff" d="M19.173 6.861h5.451v19.11h-5.45V6.86zM8.208 25.971V6.86h5.45v19.11h-5.45z"/></svg>',class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild(".play-icon",t.play),this.appendChild(".play-icon",t.pause)}},{key:"getMini",value:function(){var t=this;if(!this.isMini){var e=this.player,n=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},_.addClass(e.root,"xgplayer-mini"),["width","height","top","left"].map(function(e){t.lastStyle[e]=i.style[e],i.style[e]="".concat(t.pos[e],"px")}),n.fluid&&(i.style["padding-top"]=""),this.emit(tp,!0),e.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var t=this;if(!this.isMini)return!1;var e=this.player,n=this.playerConfig,i=this.config.target||this.player.root;_.removeClass(e.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map(function(e){i.style[e]=t.lastStyle[e]}),this.lastStyle=null,n.fluid&&(e.root.style.width="100%",e.root.style.height="0",e.root.style["padding-top"]="".concat(100*n.height/n.width,"%")),this.emit(tp,!1),this.isMini=e.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var t=_.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",t,this.onCancelClick),this.unbind(".play-icon",t,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 <div lang-key="'.concat(this.i18nKeys.MINI_DRAG,'">').concat(this.i18n.MINI_DRAG,'</div>\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>')}}],im(i.prototype,r),o&&im(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function iO(t){return(iO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function iT(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,iR(i.key),i)}}function iE(t,e){return(iE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function iC(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ix(t){return(ix=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ij(t,e,n){return(e=iR(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iR(t){var e=function(t,e){if("object"!==iO(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==iO(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===iO(e)?e:String(e)}var iA={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},iL=["videoClick","videoDbClick"],iI=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&iE(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=ix(e);return t=n?Reflect.construct(i,arguments,ix(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===iO(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return iC(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return ij(iC(t=a.call.apply(a,[this].concat(n))),"onMouseMove",function(e){var n=iC(t),i=n.player,r=n.playerConfig;!i.isActive&&(i.focus({autoHide:!r.closeDelayBlur}),r.closeFocusVideoFocus||i.video.focus())}),ij(iC(t),"onMouseEnter",function(e){var n=iC(t),i=n.playerConfig,r=n.player;i.closeFocusVideoFocus||r.video.focus(),i.closeDelayBlur?r.focus({autoHide:!1}):r.focus()}),ij(iC(t),"onMouseLeave",function(e){var n=t.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime,o=n.closeDelayBlur;!i&&!o&&(r?t.player.focus({autoHide:!0,delay:r}):t.player.blur())}),ij(iC(t),"onVideoClick",function(e){var n=iC(t),i=n.player,r=n.playerConfig;if(!e.target||!r.closeVideoClick)(e.target===i.video||e.target===i.innerContainer||e.target===i.video.__canvas)&&(e.preventDefault(),!r.closeVideoStopPropagation&&e.stopPropagation(),t._clickCount++,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),t.clickTimer=setTimeout(function(){if(!!t._clickCount)t._clickCount--,ev(iC(t),iL[0],function(e,n){t.switchPlayPause(n.e)},{e:e,paused:i.paused}),clearTimeout(t.clickTimer),t.clickTimer=null},300))}),ij(iC(t),"onVideoDblClick",function(e){var n=iC(t),i=n.player;if(!n.playerConfig.closeVideoDblclick&&!!e.target&&(e.target===i.video||e.target===i.video.__canvas)){if(t._clickCount<2){t._clickCount=0;return}t._clickCount=0,t.clickTimer&&(clearTimeout(t.clickTimer),t.clickTimer=null),e.preventDefault(),e.stopPropagation(),ev(iC(t),iL[1],function(e,n){t.emitUserAction(n.e,"switch_fullscreen",{fullscreen:i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()},{e:e,fullscreen:i.fullscreen})}}),t}return i=s,o=[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}],r=[{key:"afterCreate",value:function(){var t=this;if(this._clickCount=0,iL.map(function(e){t.__hooks[e]=null}),"mobile"!==this.playerConfig.isMobileSimulateMode&&("mobile"!==t$.device||!!t$.os.isIpad))this.initEvents()}},{key:"initEvents",value:function(){var t=this,e=this.player,n=e.video,i=e.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(iA).map(function(e){i.addEventListener(e,t[iA[e]],!1)}),r&&n&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(t){var e=this.player;this.emitUserAction(t,"switch_play_pause"),e.ended?e.duration!==1/0&&e.duration>0&&e.replay():e.paused?e.play():e.pause()}},{key:"onContextmenu",value:function(t){(t=t||window.event).preventDefault&&t.preventDefault(),t.stopPropagation?t.stopPropagation():(t.returnValue=!1,t.cancelBubble=!0)}},{key:"destroy",value:function(){var t=this,e=this.player,n=e.video,i=e.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(iA).map(function(e){i.removeEventListener(e,t[iA[e]],!1)})}}],iT(i.prototype,r),o&&iT(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eS);function iD(t){return(iD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function iN(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,iB(i.key),i)}}function iM(t,e,n){return(e=iB(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iB(t){var e=function(t,e){if("object"!==iD(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==iD(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===iD(e)?e:String(e)}var iF={PRESS:"press",PRESS_END:"pressend",DOUBlE_CLICK:"doubleclick",CLICK:"click",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend"},iH={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},iU={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function iW(t){return t&&t.length>0?t[t.length-1]:null}function iV(t){var e=navigator.userAgent;/(?:iPhone|iPad)/.test(e)&&t.cancelable&&t.preventDefault()}var iG=function(){var t,e,n;function i(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),iM(this,"onTouchStart",function(t){var n=e._pos,i=e.root;e.config.needPreventDefault&&iV(t);var r=iW(t.touches);n.x=r?parseInt(r.pageX,10):t.pageX,n.y=r?parseInt(r.pageX,10):t.pageX,n.start=!0,e.__setPress(t),i.addEventListener(e.events.end,e.onTouchEnd),i.addEventListener(e.events.cancel,e.onTouchCancel),i.addEventListener(e.events.move,e.onTouchMove),e.trigger(iF.TOUCH_START,t)}),iM(this,"onTouchCancel",function(t){e.onTouchEnd(t)}),iM(this,"onTouchEnd",function(t){var n=e._pos,i=e.root;e.config.needPreventDefault&&iV(t),e.__clearPress(),i.removeEventListener(e.events.cancel,e.onTouchCancel),i.removeEventListener(e.events.end,e.onTouchEnd),i.removeEventListener(e.events.move,e.onTouchMove),t.moving=n.moving,t.press=n.press,n.press&&e.trigger(iF.PRESS_END,t),e.trigger(iF.TOUCH_END,t),n.press||n.moving||e.__setDb(t),n.press=!1,n.start=!1,n.moving=!1}),iM(this,"onTouchMove",function(t){var n=e._pos,i=e.config,r=iW(t.touches),o=r?parseInt(r.pageX,10):t.pageX,a=r?parseInt(r.pageY,10):t.pageX,s=o-n.x;if(!(Math.abs(a-n.y)<i.miniStep&&Math.abs(s)<i.miniStep))e.__clearPress(),n.press&&e.trigger(iF.PRESS_END,t),n.press=!1,n.moving=!0,e.trigger(iF.TOUCH_MOVE,t)}),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(t){e.config[t]=n[t]}),this.root=t,this.events="mouse"===n.eventType?iU:iH,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return t=i,e=[{key:"_initEvent",value:function(){this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(t){var e=this,n=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout(function(){e.trigger(iF.PRESS,t),e._pos.press=!0,e.__clearPress()},n.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(t){var e=this,n=this.config;if(this.dbIntrvalId){this.__clearDb(),this.trigger(iF.DOUBlE_CLICK,t);return}this.dbIntrvalId=setTimeout(function(){e.__clearDb(),!e._pos.start&&!e._pos.press&&!e._pos.moving&&e.trigger(iF.CLICK,t)},n.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(t,e){!this.__handlers[t]&&(this.__handlers[t]=[]),this.__handlers[t].push(e)}},{key:"off",value:function(t,e){if(!!this.__handlers[t]){for(var n=this.__handlers[t],i=-1,r=0;r<n.length;r++)if(n[r]===e){i=r;break}i>=0&&this.__handlers[t].splice(i,1)}}},{key:"trigger",value:function(t,e){if(!!this.__handlers[t])this.__handlers[t].map(function(t){try{t(e)}catch(t){}})}},{key:"destroy",value:function(){var t=this,e={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(e).forEach(function(n){t.root.removeEventListener(n,t[e[n]])})}}],iN(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),i}();function iz(t){return(iz="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function iK(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,iZ(i.key),i)}}function iY(t,e){return(iY=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function iX(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function iq(t){return(iq=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function iJ(t,e,n){return(e=iZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iZ(t){var e=function(t,e){if("object"!==iz(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==iz(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===iz(e)?e:String(e)}var i$={AUTO:"auto",SEEKING:"seeking",PLAYBACK:"playbackrate"},iQ=["videoClick","videoDbClick"],i0=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&iY(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=iq(e);return t=n?Reflect.construct(i,arguments,iq(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===iz(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return iX(t)}(this,t)});function s(t){var e;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),iJ(iX(e=a.call(this,t)),"onTouchStart",function(t){var n=iX(e),i=n.player,r=n.config,o=n.pos,a=n.playerConfig,s=e.getTouche(t);if(s&&!r.disableGesture&&e.duration>0&&!i.ended){o.isStart=!0,_.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),e.find(".xg-dur").innerHTML=_.format(e.duration);var u=e.root.getBoundingClientRect();90===i.rotateDeg?(o.top=u.left,o.left=u.top,o.width=u.height,o.height=u.width):(o.top=u.top,o.left=u.left,o.width=u.width,o.height=u.height);var c=parseInt(s.pageX-o.left,10),l=parseInt(s.pageY-o.top,10);o.x=90===i.rotateDeg?l:c,o.y=90===i.rotateDeg?c:l,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}}),iJ(iX(e),"onTouchMove",function(t){var n=e.getTouche(t),i=iX(e),r=i.pos,o=i.config,a=i.player;if(!!n&&!o.disableGesture&&!!e.duration&&!!r.isStart){var s=o.miniMoveStep,u=o.hideControlsActive,c=parseInt(n.pageX-r.left,10),l=parseInt(n.pageY-r.top,10),f=90===a.rotateDeg?l:c,h=90===a.rotateDeg?c:l;if(Math.abs(f-r.x)>s||Math.abs(h-r.y)>s){var p=f-r.x,d=h-r.y,y=r.scope;if(-1===y&&(0===(y=e.checkScope(f,h,p,d,r))&&(u?a.blur():a.focus({autoHide:!1}),r.time||(r.time=parseInt(1e3*a.currentTime,10)+1e3*e.timeOffset)),r.scope=y),-1===y||y>0&&!o.gestureY||0===y&&!o.gestureX)return;t.cancelable&&t.preventDefault(),e.executeMove(p,d,y,r.width,r.height),r.x=f,r.y=h}}}),iJ(iX(e),"onTouchEnd",function(t){var n=iX(e),i=n.player,r=n.pos,o=n.playerConfig;if(!!r.isStart)r.scope>-1&&t.cancelable&&t.preventDefault(),e.endLastMove(r.scope),setTimeout(function(){i.getPlugin("progress")&&i.getPlugin("progress").resetSeekState()},10),r.scope=-1,e.resetPos(),_.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),e.changeAction(i$.AUTO)}),iJ(iX(e),"onRootTouchMove",function(t){if(!e.config.disableGesture&&!!e.config.gestureX)e.checkIsRootTarget(t)&&(t.stopPropagation(),e.pos.isStart?e.onTouchMove(t):e.onTouchStart(t))}),iJ(iX(e),"onRootTouchEnd",function(t){if(e.pos.isStart&&e.checkIsRootTarget(t)){t.stopPropagation(),e.onTouchEnd(t);var n=e.player.controls;n&&n.recoverAutoHide()}}),e.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},e.timer=null,e}return i=s,o=[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{stopPropagation:!0,index:0,disableGesture:!1,gestureX:!0,gestureY:!0,updateGesture:function(){},onTouchStart:function(){},onTouchEnd:function(){},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}}}],r=[{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:'<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"><path opacity=".54" d="M7.5 3.634a1 1 0 010 1.732l-6 3.464A1 1 0 010 7.964V1.036A1 1 0 011.5.17l6 3.464z" fill="#fff"/><path d="M12.5 3.634a1 1 0 010 1.732l-6 3.464A1 1 0 015 7.964V1.036A1 1 0 016.5.17l6 3.464z" fill="#fff"/></svg>',class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var t=this;iQ.map(function(e){t.__hooks[e]=null});var e=this.playerConfig,n=this.config,i=this.player;!0===e.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),!_.isUndefined(e.disableGesture)&&(n.disableGesture=!!e.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=_.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new iG(this.root,{eventType:r,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",function(t){t.preventDefault()}),i.root.addEventListener("touchmove",this.onRootTouchMove,!0),i.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(F,function(){var e=t.player,n=t.config;1e3*e.duration<n.moveDuration&&(n.moveDuration=1e3*e.duration)}),this.on([M,j],function(){var e=t.pos,n=e.time;!e.isStart&&n>0&&(t.pos.time=0)});var o={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(o).forEach(function(e){t.touch.on(e,function(n){t[o[e]](n)})}),!n.disableActive){var a=i.plugins.progress;a&&(a.addCallBack("dragmove",function(e){t.activeSeekNote(e.currentTime,e.forward)}),a.addCallBack("dragend",function(){t.changeAction(i$.AUTO)}),a.addCallBack("click",function(){t.changeAction(i$.AUTO)}))}}},{key:"registerThumbnail",value:function(){var t=this.player.plugins.thumbnail;if(t&&t.usable){this.thumbnail=t.createThumbnail(null,"mobile-thumbnail");var e=this.find(".time-preview");e.insertBefore(this.thumbnail,e.children[0])}}},{key:"initCustomStyle",value:function(){var t=(this.playerConfig||{}).commonStyle,e=t.playedColor,n=t.progressColor;e&&(this.find(".xg-curbar").style.backgroundColor=e,this.find(".xg-cur").style.color=e),n&&(this.find(".xg-bar").style.backgroundColor=n,this.find(".time-preview").style.color=n),this.config.disableTimeProgress&&_.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var t=this;arguments.length>0&&void 0!==arguments[0]&&arguments[0],this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map(function(e){t.pos[e]=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(t){var e=this.player;this.root.setAttribute("data-xg-action",t);var n=e.plugins.start;n&&n.recover()}},{key:"getTouche",value:function(t){var e=this.player.rotateDeg,n=t.touches&&t.touches.length>0?t.touches[t.touches.length-1]:t;return{pageX:n.pageX,pageY:n.pageY}}},{key:"checkScope",value:function(t,e,n,i,r){var o=r.width,a=-1;if(t<0||t>o)return a;var s=0===i?Math.abs(n):Math.abs(n/i);return Math.abs(n)>0&&s>=1.73&&t>r.scopeM1&&t<r.scopeM2?a=0:(0===Math.abs(n)||s<=.57)&&(a=t<r.scopeL?1:t>r.scopeR?2:3),a}},{key:"executeMove",value:function(t,e,n,i,r){switch(n){case 0:this.updateTime(t/i*this.config.scopeM);break;case 1:this.updateBrightness(e/r);break;case 2:!t$.os.isIos&&this.updateVolume(e/r)}}},{key:"endLastMove",value:function(t){var e=this,n=this.pos,i=this.player,r=this.config,o=(n.time-this.timeOffset)/1e3;if(0===t)i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout(function(){e.pos.time=0},500);this.changeAction(i$.AUTO)}},{key:"checkIsRootTarget",value:function(t){var e=this.player.plugins||{};return!(e.progress&&e.progress.root.contains(t.target))&&(e.start&&e.start.root.contains(t.target)||e.controls&&e.controls.root.contains(t.target))}},{key:"clickHandler",value:function(t){var e=this.player,n=this.config,i=this.playerConfig;if(!e.isPlaying){!i.closeVideoClick&&(this.emitUserAction("click","switch_play_pause"),e.play());return}!n.closedbClick||i.closeVideoClick?e.isActive?e.blur():e.focus():!i.closeVideoClick&&((e.isActive||n.focusVideoClick)&&(this.emitUserAction("click","switch_play_pause"),this.switchPlayPause()),e.focus())}},{key:"dbClickHandler",value:function(t){var e=this.config,n=this.player;!e.closedbClick&&n.isPlaying&&(this.emitUserAction("dblclick","switch_play_pause"),this.switchPlayPause())}},{key:"onClick",value:function(t){var e=this,n=this.player;ev(this,iQ[0],function(t,n){e.clickHandler(n.e)},{e:t,paused:n.paused})}},{key:"onDbClick",value:function(t){var e=this,n=this.player;ev(this,iQ[1],function(t,n){e.dbClickHandler(n.e)},{e:t,paused:n.paused})}},{key:"onPress",value:function(t){var e=this.pos,n=this.config,i=this.player;if(!n.disablePress)e.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction(i$.PLAYBACK)}},{key:"onPressEnd",value:function(t){var e=this.pos,n=this.config,i=this.player;if(!n.disablePress)this.emitUserAction("pressend","change_rate",{from:i.playbackRate,to:e.rate}),i.playbackRate=e.rate,e.rate=1,this.changeAction(i$.AUTO)}},{key:"updateTime",value:function(t){var e=this.player,n=this.config,i=this.player.duration,r=parseInt((t=Number(t.toFixed(4)))*n.moveDuration,10)+this.timeOffset;r+=this.pos.time,r=r<0?0:r>1e3*i?1e3*i-200:r,e.getPlugin("time")&&e.getPlugin("time").updateTime(r/1e3),e.getPlugin("progress")&&e.getPlugin("progress").updatePercent(r/1e3/this.duration,!0),this.activeSeekNote(r/1e3,t>0),n.isTouchingSeek&&e.seek(Number((r-this.timeOffset)/1e3).toFixed(1)),this.pos.time=r}},{key:"updateVolume",value:function(t){this.player.rotateDeg&&(t=-t);var e=this.player,n=this.pos;if(t=parseInt(100*t,10),n.volume+=t,!(10>Math.abs(n.volume))){var i=parseInt(10*e.volume,10)-parseInt(n.volume/10,10);i=i>10?10:i<1?0:i,e.volume=i/10,n.volume=0}}},{key:"updateBrightness",value:function(t){this.player.rotateDeg&&(t=-t);var e=this.pos,n=this.config,i=this.xgMask,r=e.light+.8*t;r=r>n.maxDarkness?n.maxDarkness:r<0?0:r,i&&(i.style.backgroundColor="rgba(0,0,0,".concat(r,")")),e.light=r}},{key:"activeSeekNote",value:function(t){var e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this.player,i=this.config,r=!(this.duration!==1/0&&this.duration>0);if(!!t&&"number"==typeof t&&!r&&!i.disableActive){t<0?t=0:t>n.duration&&(t=n.duration-.2),this.changeAction(i$.SEEKING);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=_.format(this.duration),this.find(".xg-cur").innerHTML=_.format(t),this.find(".xg-curbar").style.width="".concat(t/this.duration*100,"%"),e?_.removeClass(this.find(".xg-seek-show"),"xg-back"):_.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(t)}}},{key:"updateThumbnails",value:function(t){var e=this.player.plugins.thumbnail;e&&e.usable&&this.thumbnail&&e.update(this.thumbnail,t,160,90)}},{key:"switchPlayPause",value:function(){var t=this.player;if(!t.hasStart)return!1;!t.ended&&(t.paused?t.play():t.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var t=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,t.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,t.root.removeEventListener("touchmove",this.onRootTouchMove,!0),t.root.removeEventListener("touchend",this.onRootTouchEnd,!0)}},{key:"render",value:function(){var t="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(t,'"></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>/</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 ")}}],iK(i.prototype,r),o&&iK(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function i1(t){return(i1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function i3(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i8(i.key),i)}}function i4(t,e){return(i4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function i5(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i6(t){return(i6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i9(t,e,n){return(e=i8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i8(t){var e=function(t,e){if("object"!==i1(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==i1(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===i1(e)?e:String(e)}function i7(t){var e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||!!t.isContentEditable||!1}var rt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i4(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=i6(e);return t=n?Reflect.construct(i,arguments,i6(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===i1(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return i5(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return i9(i5(t=a.call.apply(a,[this].concat(n))),"onBodyKeyDown",function(e){if(!!t.player){var n=e||window.event,i=n.target,r=n.keyCode,o=i5(t),a=o._keyState,s=o.player,u=t.config,c=u.disable,l=u.disableBodyTrigger,f=u.isIgnoreUserActive,h=i.ownerDocument;if(!h||c||l||!s.isUserActive&&!f||i7(i)||!t.checkIsVisible()||n.metaKey||n.altKey||n.ctrlKey){a.isBodyKeyDown=!1;return}!e.repeat&&!a.isKeyDown&&((i===h.body||t.config.isGlobalTrigger&&!i7(i))&&t.checkCode(r,!0)&&(a.isBodyKeyDown=!0),h.addEventListener("keyup",t.onBodyKeyUp)),a.isBodyKeyDown&&t.handleKeyDown(n)}}),i9(i5(t),"onBodyKeyUp",function(e){if(!t.player)return;var n=(e||window.event).target.ownerDocument;if(!!n)n.removeEventListener("keyup",t.onBodyKeyUp),t.handleKeyUp(e)}),i9(i5(t),"onKeydown",function(e){if(!t.player)return;var n=e||window.event,i=i5(t)._keyState;if(!n.repeat){if(t.config.disable||t.config.disableRootTrigger||n.metaKey||n.altKey||n.ctrlKey||!t.player.isUserActive&&!t.config.isIgnoreUserActive)return;n&&(37===n.keyCode||t.checkCode(n.keyCode))&&(n.target===t.player.root||n.target===t.player.video||n.target===t.player.controls.el)&&(i.isKeyDown=!0),t.player.root.addEventListener("keyup",t.onKeyup)}if(!!i.isKeyDown)t.handleKeyDown(n)}),i9(i5(t),"onKeyup",function(e){if(!!t.player)t.player.root.removeEventListener("keyup",t.onKeyup),t.handleKeyUp(e)}),t}return i=s,o=[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!1,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!1}}}],r=[{key:"setConfig",value:function(t,e){var n=this;if(!t)return;var i=Object.keys(t);if(!(i.length<1))i.forEach(function(i){e.deepMerge&&"Object"===_.typeOf(n.config[i])?_.deepMerge(n.config[i],t[i]):n.config[i]=t[i]}),this.mergekeyCodeMap()}},{key:"mergekeyCodeMap",value:function(){var t=this,e=this.config.keyCodeMap;e&&Object.keys(e).map(function(n){t.keyCodeMap[n]?["keyCode","action","disable","pressAction","disablePress","isBodyTarget"].map(function(i){e[n][i]&&(t.keyCodeMap[n][i]=e[n][i])}):t.keyCodeMap[n]=e[n]})}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var t="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;!(!t||"number"!=typeof t)&&(this.seekStep=t),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:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var t=this.player.root.getBoundingClientRect(),e=t.height,n=t.top,i=t.bottom,r=window.innerHeight;return(!(n<0)||!(n<0-.9*e))&&(!(i>0)||!(i-r>.9*e))&&!0}},{key:"checkCode",value:function(t,e){var n=this,i=!1;return Object.keys(this.keyCodeMap).map(function(r){n.keyCodeMap[r]&&t===n.keyCodeMap[r].keyCode&&!n.keyCodeMap[r].disable&&(i=!e||e&&!n.keyCodeMap[r].noBodyTarget)}),i}},{key:"downVolume",value:function(t){var e=this.player;if(!(e.volume<=0)){var n=parseFloat((e.volume-.1).toFixed(1)),i={volume:{from:e.volume,to:n}};this.emitUserAction(t,"change_volume",{props:i}),n>=0?e.volume=n:e.volume=0}}},{key:"upVolume",value:function(t){var e=this.player;if(!(e.volume>=1)){var n=parseFloat((e.volume+.1).toFixed(1)),i={volume:{from:e.volume,to:n}};this.emitUserAction(t,"change_volume",{props:i}),n<=1?e.volume=n:e.volume=1}}},{key:"seek",value:function(t){var e=this.player,n=e.currentTime,i=e.duration,r=n,o=t.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep;r=n+o<=i?n+o:i;var a={currentTime:{from:n,to:r}};this.emitUserAction(t,"seek",{props:a}),this.player.currentTime=r}},{key:"seekBack",value:function(t){var e=this.player.currentTime,n=t.repeat?parseInt(this.seekStep/2,10):this.seekStep,i=0;e-n>=0&&(i=e-n);var r={currentTime:{from:e,to:i}};this.emitUserAction(t,"seek",{props:r}),this.player.currentTime=i}},{key:"changePlaybackRate",value:function(t){var e=this._keyState,n=this.config,i=this.player;0===e.playbackRate&&(e.playbackRate=i.playbackRate,i.playbackRate=n.playbackRate)}},{key:"playPause",value:function(t){var e=this.player;if(!!e)this.emitUserAction(t,"switch_play_pause"),e.paused?e.play():e.pause()}},{key:"exitFullscreen",value:function(t){var e=this.player,n=e.fullscreen,i=e.cssfullscreen;n&&(this.emitUserAction("keyup","switch_fullscreen",{prop:"fullscreen",from:n,to:!n}),e.exitFullscreen()),i&&(this.emitUserAction("keyup","switch_css_fullscreen",{prop:"cssfullscreen",from:i,to:!i}),e.exitCssFullscreen())}},{key:"handleKeyDown",value:function(t){var e,n=this._keyState;if(t.repeat){n.isPress=!0;var i=Date.now();if(i-n.tt<200)return;n.tt=i}(e=t).preventDefault(),e.returnValue=!1,this.handleKeyCode(t.keyCode,t,n.isPress)}},{key:"handleKeyUp",value:function(t){var e=this._keyState;e.playbackRate>0&&(this.player.playbackRate=e.playbackRate,e.playbackRate=0),e.isKeyDown=!1,e.isPress=!1,e.tt=0}},{key:"handleKeyCode",value:function(t,e,n){for(var i=Object.keys(this.keyCodeMap),r=0;r<i.length;r++){var o=this.keyCodeMap[i[r]];if(!!o){var a=o.action,s=o.keyCode,u=o.disable,c=o.pressAction,l=o.disablePress;if(s===t){if(!u&&!(n&&l)){var f=n&&c||a;"function"==typeof f?a(e,this.player,n):"string"==typeof f&&"function"==typeof this[f]&&this[f](e,this.player,n),this.emit(tP,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i2(Object(n),!0).forEach(function(e){i9(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i2(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({key:i[r],target:e.target,isPress:n},this.keyCodeMap[i[r]]))}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}}],i3(i.prototype,r),o&&i3(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eS);function re(t){return(re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rn(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==re(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==re(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===re(e)?e:String(e)}(i.key),i)}}function ri(t,e){return(ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function rr(t){return(rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ro=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ri(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=rr(e);return t=n?Reflect.construct(i,arguments,rr(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===re(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,r=[{key:"registerIcons",value:function(){return{loadingIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110"><path d="M100 50A50 50 0 1150 0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"/></svg>'}}},{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>'}}],o=[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:eA.ROOT}}}],r&&rn(i.prototype,r),o&&rn(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function ra(t){return(ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rs(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==ra(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ra(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ra(e)?e:String(e)}(i.key),i)}}var ru=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],rc=function(){var t,e,n;function i(t){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),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 t=i,e=[{key:"updateDuration",value:function(t){var e=this;this.duration=t;var n=0,i=this.fragments;this.fragments=i.map(function(t){return t.start=parseInt(n,10),t.end=parseInt(n+t.percent*e.duration,10),t.duration=parseInt(t.percent*e.duration,10),n+=t.percent*e.duration,t})}},{key:"updateProgress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},n=this.progressList,i=this.fragments;if(!(n.length<1)){var r=e.newIndex,o=e.curIndex,a=e.millisecond;r!==o&&n.map(function(e,n){n<r?e[t].style.width="100%":n>r&&(e[t].style.width=0)});var s=i[r],u=0===a?0:(a-s.start)/s.duration;n[r][t].style.width=u<0?0:"".concat(100*u,"%")}}},{key:"updateFocus",value:function(t){if(!!this.fragConfig.fragAutoFocus&&!(this.fragments.length<2)){if(!t){if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var e={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(e),this.focusIndex=-1}return}var n=this.findIndex(1e3*t.currentTime,this.focusIndex);if(n>=0&&n!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(n);var i={index:n,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=n,this._callBack&&this._callBack(i)}}}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},e=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*e,10)!==this.duration){if(!e&&0!==e)return;this.updateDuration(parseInt(1e3*e,10))}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==_.typeOf(t.played)){var r=this.findIndex(1e3*t.played,n);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*t.played,10)}),this.playedIndex=r}if("Undefined"!==_.typeOf(t.cached)){var o=this.findIndex(1e3*t.cached,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*t.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(t,e){var n=this.fragments;if(!n||0===n.length)return -1;if(1===n.length)return 0;if(e>-1&&e<n.length&&t>n[e].start&&t<n[e].end)return e;if(t>n[n.length-1].start)return n.length-1;for(var i=0;i<n.length;i++)if(t>n[i].start&&t<=n[i].end){e=i;break}return e}},{key:"findHightLight",value:function(){for(var t=this.root.children,e=0;e<t.length;e++)if(_.hasClass(t[e],this.fragConfig.fragFocusClass))return{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"findFragment",value:function(t){var e=this.root.children;return t<0||t>=e.length?null:{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var t=this.root.children,e=0;e<t.length;e++)_.removeClass(t[e],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(t){var e=this.root.children;if(t<e.length)return _.addClass(e[t],this.fragConfig.fragFocusClass),{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(t){var e=this;if(Object.keys(this.fragConfig).forEach(function(n){void 0!==t[n]&&(e.fragConfig[n]=t[n])}),t.fragments){if(this.fragments=0===t.fragments.length?[{percent:1}]:t.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root){for(var n=this.root.children;n.length>0;)this.root.removeChild(n[0])}this.render()}}},{key:"render",value:function(){var t=this,e=this.style.progressColor;if(!this.root&&(this.root=_.createDom("xg-inners","",{},"progress-list")),this.fragments){var n=this.fragConfig,i=n.fragClass,r=n.fragFocusClass;this.progressList=this.fragments.map(function(n){var o=_.createDom("xg-inner","",{style:e?"background:".concat(e,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?r:""," xgplayer-progress-inner ").concat(i));return t.root.appendChild(o),ru.forEach(function(e){o.appendChild(_.createDom(e.tag,"",{style:e.styleKey?"background: ".concat(t.style[e.styleKey],"; width:0;"):"width:0;"},e.className))}),{cached:o.children[0],played:o.children[1]}})}return this.root}}],rs(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),i}();function rl(t){return(rl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function rh(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?rf(Object(n),!0).forEach(function(e){rg(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rf(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function rp(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,rm(i.key),i)}}function rd(t,e){return(rd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ry(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rv(t){return(rv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rg(t,e,n){return(e=rm(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rm(t){var e=function(t,e){if("object"!==rl(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==rl(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===rl(e)?e:String(e)}var rb={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},rw=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rd(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=rv(e);return t=n?Reflect.construct(i,arguments,rv(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===rl(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return ry(t)}(this,t)});function s(t){var e;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),rg(ry(e=a.call(this,t)),"onMoveOnly",function(t,n){var i=ry(e),r=i.pos,o=i.config,a=i.player,s=n;if(t){_.event(t);var u=_.getEventPos(t,a.zoom),c=90===a.rotateDeg?u.clientY:u.clientX;if(r.moving&&Math.abs(r.x-c)<o.miniMoveStep)return;r.moving=!0,r.x=c,s=e.computeTime(t,c)}e.triggerCallbacks("dragmove",s,t),e._updateInnerFocus(s)}),rg(ry(e),"onBodyClick",function(t){t.preventDefault(),t.stopPropagation()}),rg(ry(e),"_mouseDownHandler",function(t,n){e._state.time=n.currentTime,e.updateWidth(n.currentTime,n.percent,0),e._updateInnerFocus(n)}),rg(ry(e),"_mouseUpHandler",function(t,n){ry(e).pos.moving&&e.updateWidth(n.currentTime,n.percent,2)}),rg(ry(e),"_mouseMoveHandler",function(t,n){var i=ry(e),r=i._state,o=i.pos,a=i.config,s=i.player;r.time<n.currentTime?n.forward=!0:n.forward=!1,r.time=n.currentTime,o.isDown&&!o.moving&&(o.moving=!0,a.isPauseMoving&&s.pause(),e.triggerCallbacks("dragstart",n,t),e.emitUserAction("drag","dragstart",n)),e.updateWidth(n.currentTime,n.percent,1),e.triggerCallbacks("dragmove",n,t),e._updateInnerFocus(n)}),rg(ry(e),"onMouseDown",function(t){var n=ry(e),i=n._state,r=n.player,o=n.pos,a=n.config,s=n.playerConfig,u=n.root,c=_.getEventPos(t,r.zoom),l=90===r.rotateDeg?c.clientY:c.clientX;if(!r.isMini&&!a.closeMoveSeek&&(!!s.allowSeekAfterEnded||!r.ended)){t.stopPropagation(),e.focus(),_.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),_.checkIsFunction(a.onMoveStart)&&a.onMoveStart(),_.event(t),o.x=l,o.isDown=!0,o.moving=!1,i.prePlayTime=r.currentTime,r.focus({autoHide:!1}),e.isProgressMoving=!0,_.addClass(e.progressBtn,"active");var f=e.computeTime(t,l);return f.prePlayTime=i.prePlayTime,e._mouseDownHandlerHook(t,f),"touchstart"===t.type?(u.addEventListener("touchmove",e.onMouseMove),u.addEventListener("touchend",e.onMouseUp),u.addEventListener("touchcancel",e.onMouseUp)):(e.unbind("mousemove",e.onMoveOnly),u.ownerDocument.addEventListener("mousemove",e.onMouseMove,!1),u.ownerDocument.addEventListener("mouseup",e.onMouseUp,!1),r.root.addEventListener("click",e.onBodyClick,!1)),!0}}),rg(ry(e),"onMouseUp",function(t){var n=ry(e),i=n.player,r=n.config,o=n.pos,a=n.playerConfig,s=n._state,u=n.root;t.stopPropagation(),t.preventDefault(),_.checkIsFunction(a.enableSwipeHandler)&&a.enableSwipeHandler(),_.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),_.event(t),_.removeClass(e.progressBtn,"active");var c=e.computeTime(t,o.x);c.prePlayTime=s.prePlayTime,o.moving?(e.triggerCallbacks("dragend",c,t),e.emitUserAction("drag","dragend",c)):(e.triggerCallbacks("click",c,t),e.emitUserAction("click","click",c)),e._mouseUpHandlerHook(t,c),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,s.prePlayTime=0,s.time=0;var l=t.type;"touchend"===l||"touchcancel"===l?(u.removeEventListener("touchmove",e.onMouseMove),u.removeEventListener("touchend",e.onMouseUp),u.removeEventListener("touchcancel",e.onMouseUp),e.blur()):(u.ownerDocument.removeEventListener("mousemove",e.onMouseMove,!1),u.ownerDocument.removeEventListener("mouseup",e.onMouseUp,!1),i.root.removeEventListener("click",e.onBodyClick,!1),o.isEnter?"mobile"!==a.isMobileSimulateMode&&e.bind("mousemove",e.onMoveOnly):e.onMouseLeave(t)),_.setTimeout(ry(e),function(){e.resetSeekState()},10),i.focus()}),rg(ry(e),"onMouseMove",function(t){var n=ry(e),i=n._state,r=n.pos,o=n.player,a=n.config;_.checkTouchSupport()&&t.preventDefault(),_.event(t);var s=_.getEventPos(t,o.zoom),u=90===o.rotateDeg?s.clientY:s.clientX,c=Math.abs(r.x-u);if((!r.moving||!(c<a.miniMoveStep))&&(!!r.moving||!(c<a.miniStartStep))){r.x=u;var l=e.computeTime(t,u);l.prePlayTime=i.prePlayTime,e._mouseMoveHandlerHook(t,l)}}),rg(ry(e),"onMouseOut",function(t){e.triggerCallbacks("mouseout",null,t)}),rg(ry(e),"onMouseOver",function(t){e.triggerCallbacks("mouseover",null,t)}),rg(ry(e),"onMouseEnter",function(t){var n=ry(e),i=n.player,r=n.pos;if(!r.isDown&&!r.isEnter&&!i.isMini&&(!!i.config.allowSeekAfterEnded||!i.ended)){r.isEnter=!0,e.bind("mousemove",e.onMoveOnly),e.bind("mouseleave",e.onMouseLeave),_.event(t);var o=_.getEventPos(t,i.zoom),a=90===i.rotateDeg?o.clientY:o.clientX,s=e.computeTime(t,a);e.triggerCallbacks("mouseenter",s,t),e.focus()}}),rg(ry(e),"onMouseLeave",function(t){e.triggerCallbacks("mouseleave",null,t),e.unlock(),e._updateInnerFocus(null),e.triggerCallbacks("mouseleaveFinished",null,t)}),rg(ry(e),"onVideoResize",function(){var t=e.pos,n=t.x,i=t.isDown;if(t.isEnter&&!i){var r=e.computeTime(null,n);e.onMoveOnly(null,r)}}),e.useable=!1,e.isProgressMoving=!1,e.__dragCallBacks=[],e._state={now:-1,direc:0,time:0,prePlayTime:-1},e._disableBlur=!1,e}return i=s,r=[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"statistic",get:function(){return rh({hasActive:_.hasClass(this.root,"active"),disableBlur:this._disableBlur},this.pos||{})}},{key:"changeState",value:function(){var t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.useable=t}},{key:"beforeCreate",value:function(t){"boolean"==typeof t.player.config.progress&&(t.config.disable=!t.player.config.progress)}},{key:"_initInner",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(!e||0===e.length)&&(e=[{percent:1}]);var i=rh(rh({fragments:e},n),{},{actionCallback:function(e){t.emitUserAction("fragment_focus","fragment_focus",e)}});this.innerList?this.innerList.reset(i):(this.innerList=new rc(i),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map(function(e){t[e]=t.innerList[e].bind(t.innerList)}))}},{key:"_updateInnerFocus",value:function(t){this.innerList&&this.innerList.updateFocus(t)}},{key:"afterCreate",value:function(){var t=this;if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer");var e=this.config,n=e.fragFocusClass,i=e.fragAutoFocus,r=e.fragClass;this._initInner(this.config.fragments,{fragFocusClass:n,fragAutoFocus:i,fragClass:r,style:this.playerConfig.commonStyle||{}}),"mobile"===t$.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(F,function(){t.onMouseLeave()}),this.on(D,function(){t.onTimeupdate()}),this.on(I,function(){t.onTimeupdate(),t.onCacheUpdate()}),this.on(G,function(){t.onCacheUpdate()}),this.on(j,function(){t.onCacheUpdate(!0),t.onTimeupdate(!0),t._state.now=0}),this.on(K,function(){t.onReset()}),this.on(tb,function(){t.onVideoResize()}),this.on(tE,function(){t.config.resetBlur&&t._disableBlur&&(t.enableBlur(),t.blur())}),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(t){var e=this,n=null;Object.keys(t).forEach(function(i){e.config[i]=t[i],"fragments"===i&&(n=t[i])}),n&&this._initInner(n,t)}},{key:"initCustomStyle",value:function(){var t=(this.playerConfig||{}).commonStyle.sliderBtnStyle,e=this.progressBtn;t&&("string"==typeof t?e.style.boxShadow=t:"object"===rl(t)&&Object.keys(t).map(function(n){e.style[n]=t[n]}))}},{key:"triggerCallbacks",value:function(t,e,n){this.__dragCallBacks.length>0&&this.__dragCallBacks.map(function(i){if(i&&i.handler&&i.type===t)try{i.handler(e,n)}catch(t){}})}},{key:"addCallBack",value:function(t,e){e&&"function"==typeof e&&this.__dragCallBacks.push({type:t,handler:e})}},{key:"removeCallBack",value:function(t,e){var n=this.__dragCallBacks,i=-1;n.map(function(n,r){n&&n.type===t&&n.handler===e&&(i=r)}),i>-1&&n.splice(i,1)}},{key:"unlock",value:function(){var t=this.player,e=this.pos;if(e.isEnter=!1,!t.isMini){if(this.unbind("mousemove",this.onMoveOnly),e.isDown){this.unbind("mouseleave",this.onMouseLeave);return}this.blur()}}},{key:"bindDomEvents",value:function(){var t=this.player,e=t.controls,n=t.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),e&&(e.root&&e.root.addEventListener("touchmove",_.stopPropagation),e.center&&e.center.addEventListener("touchend",_.stopPropagation))),("mouse"===this.domEventType||"compatible"===this.domEventType)&&(this.bind("mousedown",this.onMouseDown),"mobile"!==n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),_.addClass(this.root,"active")}},{key:"blur",value:function(){if(!this._disableBlur)this.player.controls.recoverAutoHide(),_.removeClass(this.root,"active")}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(t,e,n){var i=this.config,r=this.player;if(i.isCloseClickSeek&&0===n)return;var o=t>=r.duration?r.duration-i.endedDiff:Number(t).toFixed(1);if(this.updatePercent(e),this.updateTime(t),1!==n||!!i.isDragingSeek&&"audio"!==r.videoConfig.mediaType)this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o)}},{key:"computeTime",value:function(t,e){var n,i,r=this.player,o=this.root.getBoundingClientRect(),a=o.width,s=o.height,u=o.top,c=o.left;90===r.rotateDeg?(n=s,i=u):(n=a,i=c);var l=e-i,f=(l=l>n?n:l<0?0:l)/n,h=parseInt((f=f<0?0:f>1?1:f)*this.duration*1e3,10)/1e3;return{percent:f,currentTime:h,offset:l,width:n,left:i,e:t}}},{key:"updateTime",value:function(t){var e=this.player,n=this.duration;t>n?t=n:t<0&&(t=0);var i=e.plugins.time;i&&i.updateTime(t)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var t=this.player.plugins.time;t&&t.resetActive()}},{key:"updatePercent",value:function(t,e){if(this.isProgressMoving=!0,!this.config.disable){t=t>1?1:t<0?0:t,this.progressBtn.style.left="".concat(100*t,"%"),this.innerList.update({played:t*this.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:t*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(t){var e=this.player,n=this._state,i=this.duration;if((!e.isSeeking||!e.video.seeking)&&!this.isProgressMoving&&!!e.hasStart){if(n.now>-1){var r=parseInt(1e3*n.now,10)-parseInt(1e3*e.currentTime,10);if(0===n.direc&&r>300||1===n.direc&&r>-300){n.now=-1;return}n.now=-1}var o=this.timeOffset+e.currentTime;o=_.adjustTimeByDuration(o,i,t),this.innerList.update({played:o},i),this.progressBtn.style.left="".concat(o/i*100,"%");var a=this.player.plugins.miniprogress;a&&a.update({played:o},i)}}},{key:"onCacheUpdate",value:function(t){var e=this.player,n=this.duration;if(!!e){var i=e.bufferedPoint.end;i=_.adjustTimeByDuration(i,n,t),this.innerList.update({cached:i},n);var r=this.player.plugins.miniprogress;r&&r.update({cached:i},n)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var t=this.player.plugins.miniprogress;t&&t.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var t=this.player,e=t.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var n=this.domEventType;("touch"===n||"compatible"===n)&&(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),e&&(e.root&&e.root.removeEventListener("touchmove",_.stopPropagation),e.center&&e.center.removeEventListener("touchend",_.stopPropagation))),("mouse"===n||"compatible"===n)&&(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),t.root.removeEventListener("click",this.onBodyClick,!1))}},{key:"render",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){var t=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===t?"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 ')}}}],o=[{key:"pluginName",get:function(){return"progress"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:rb.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2,resetBlur:!1}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return rb}}],r&&rp(i.prototype,r),o&&rp(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function rk(t){return(rk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r_(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,rE(i.key),i)}}function rS(t,e){return(rS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function rP(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rO(t){return(rO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rT(t,e,n){return(e=rE(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rE(t){var e=function(t,e){if("object"!==rk(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==rk(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===rk(e)?e:String(e)}var rC=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rS(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=rO(e);return t=n?Reflect.construct(i,arguments,rO(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===rk(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return rP(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return rT(rP(t=a.call.apply(a,[this].concat(n))),"_onMouseenter",function(e){t.emit("icon_mouseenter",{pluginName:t.pluginName})}),rT(rP(t),"_onMouseLeave",function(e){t.emit("icon_mouseleave",{pluginName:t.pluginName})}),t}return i=s,r=[{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)}}],r_(i.prototype,r),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function rx(t){return(rx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rj(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,rD(i.key),i)}}function rR(){return(rR="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=rI(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function rA(t,e){return(rA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function rL(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rI(t){return(rI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rD(t){var e=function(t,e){if("object"!==rx(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==rx(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===rx(e)?e:String(e)}var rN=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rA(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=rI(e);return t=n?Reflect.construct(i,arguments,rI(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===rx(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return rL(t)}(this,t)});function s(){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var t,e,n,i,r=arguments.length,o=Array(r),u=0;u<r;u++)o[u]=arguments[u];return e=rL(t=a.call.apply(a,[this].concat(o))),n="btnClick",i=function(e){var n=rL(t),i=n.player;if(!n.config.disable)return e.preventDefault(),e.stopPropagation(),t.emitUserAction(e,"switch_play_pause"),i.ended?i.replay():i.paused&&!i.isBufferControlPaused?(i.play(),t.animate(!1)):(i.pause(),t.animate(!0)),!1},(n=rD(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,t}return i=s,r=[{key:"afterCreate",value:function(){var t=this;rR(rI(s.prototype),"afterCreate",this).call(this);var e=this.player;this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.on([R,K,C],function(){t.animate(e.paused)}),this.on(tu,function(){t.animate(e.paused)}),this.animate(this.player.paused)}},{key:"registerIcons",value:function(){return{play:{icon:'<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40"><path fill="#fff" d="M18.468 11.639l7.503 4.777-7.503 4.777zM10.965 6.86l7.503 4.778v9.554l-7.503 4.778z"/></svg>',class:"xg-icon-play"},pause:{icon:'<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40"><path fill="#fff" d="M19.173 6.861h5.451v19.11h-5.45V6.86zM8.208 25.971V6.86h5.45v19.11h-5.45z"/></svg>',class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild(".xgplayer-icon",t.play),this.appendChild(".xgplayer-icon",t.pause)}},{key:"animate",value:function(t){var e=this.i18nKeys,n=this.player;if(!t||!n.isBufferControlPaused)t?(this.setAttr("data-state","pause"),this.changeLangTextKey(this.find(".xg-tips"),e.PLAY_TIPS)):(this.setAttr("data-state","play"),this.changeLangTextKey(this.find(".xg-tips"),e.PAUSE_TIPS))}},{key:"destroy",value:function(){rR(rI(s.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PLAY_TIPS,'">').concat(this.i18n.PLAY_TIPS,"</div>\n </xg-icon>")}}],o=[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_LEFT,index:0,disable:!1}}}],r&&rj(i.prototype,r),o&&rj(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(rC);function rM(t){return(rM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rB(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==rM(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==rM(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===rM(e)?e:String(e)}(i.key),i)}}function rF(t,e){return(rF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function rH(t){return(rH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var rU=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rF(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=rH(e);return t=n?Reflect.construct(i,arguments,rH(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===rM(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,r=[{key:"afterCreate",value:function(){var t=this;this.initIcons(),this.onClick=function(e){e.preventDefault(),e.stopPropagation(),t.config.onClick(e)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:'<svg width="32" height="40" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M11.237 14l6.382-6.381A.875.875 0 1016.38 6.38l-7 7a.875.875 0 000 1.238l7 7a.875.875 0 101.238-1.238L11.237 14z" fill="#FFF" fill-rule="evenodd"/></svg>',class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild(this.root,t.screenBack)}},{key:"show",value:function(){_.addClass(this.root,"show")}},{key:"hide",value:function(){_.removeClass(this.root,"show")}},{key:"render",value:function(){return'<xg-icon class="xgplayer-back">\n </xg-icon>'}}],o=[{key:"pluginName",get:function(){return"topbackicon"}},{key:"defaultConfig",get:function(){return{position:eA.ROOT_TOP,index:0}}}],r&&rB(i.prototype,r),o&&rB(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function rW(t){return(rW="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rV(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,rX(i.key),i)}}function rG(){return(rG="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=rY(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function rz(t,e){return(rz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function rK(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rY(t){return(rY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function rX(t){var e=function(t,e){if("object"!==rW(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==rW(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===rW(e)?e:String(e)}var rq=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rz(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=rY(e);return t=n?Reflect.construct(i,arguments,rY(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===rW(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return rK(t)}(this,t)});function s(){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var t,e,n,i,r=arguments.length,o=Array(r),u=0;u<r;u++)o[u]=arguments[u];return e=rK(t=a.call.apply(a,[this].concat(o))),n="_onOrientationChange",i=function(e){t.player.fullscreen&&t.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?t.setRotateDeg(0):t.setRotateDeg(90))},(n=rX(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,t}return i=s,r=[{key:"afterCreate",value:function(){var t=this;rG(rY(s.prototype),"afterCreate",this).call(this);var e=this.config,n=this.playerConfig;e.target&&(this.playerConfig.fullscreenTarget=this.config.target);var i=_.getFullScreenEl();n.fullscreenTarget===i&&this.player.getFullscreen().catch(function(){}),this.initIcons(),this.handleFullscreen=this.hook("fullscreen_change",this.changeFullScreen,{pre:function(e){if(!t.config.disable)t.emitUserAction(e,"switch_fullscreen",{fullscreen:t.player.fullscreen})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(tf,function(e){t.changeLangTextKey(t.find(".xg-tips"),e?t.i18nKeys.EXITFULLSCREEN_TIPS:t.i18nKeys.FULLSCREEN_TIPS),t.animate(e),t.config.needBackIcon&&t.show()}),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:rU,options:{config:{onClick:function(e){t.handleFullscreen(e)}}}})),"mobile"===t$.device&&window.addEventListener("orientationchange",this._onOrientationChange)}},{key:"registerIcons",value:function(){return{fullscreen:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40"><path fill="#fff" d="M19.173 6.861h6.798v6.798h-2.694V9.555h-4.104V6.86zm4.104 16.416v-4.104h2.694v6.798h-6.798v-2.694h4.104zM6.861 13.66V6.86h6.798v2.694H9.555v4.104H6.86zm2.694 5.514v4.104h4.104v2.694H6.86v-6.798h2.694z"/></svg>',class:"xg-get-fullscreen"},exitFullscreen:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40"><path fill="#fff" d="M21.867 10.965h4.104v2.694h-6.798V6.86h2.694v4.104zm-2.694 15.006v-6.798h6.798v2.694h-4.104v4.104h-2.694zm-8.208-15.006V6.861h2.694v6.798H6.86v-2.694h4.104zM6.861 21.867v-2.694h6.798v6.798h-2.694v-4.104H6.861z"/></svg>',class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){rG(rY(s.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===t$.device?"touchend":"click",this.handleFullscreen),"mobile"===t$.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild(".xgplayer-icon",t.fullscreen),this.appendChild(".xgplayer-icon",t.exitFullscreen)}},{key:"setRotateDeg",value:function(t){var e=this.player;90===window.orientation||-90===window.orientation?e.rotateDeg=0:e.rotateDeg=t}},{key:"getRotateFullscreen",value:function(t){var e=this.player;e.isCssfullScreen&&e.exitCssFullscreen(t);var n=t?eV.INNER_FULLSCREEN:eV.ROTATE_FULLSCREEN;e._fullscreenEl=t||e.root,e.changeFullStyle(e.root,t,n,eV.PARENT_ROTATE_FULLSCREEN),e.fullscreen=!0,this.setRotateDeg(90),this.emit(tf,!0)}},{key:"exitRotateFullscreen",value:function(t){var e=this.player;e.fullscreen=!1;var n=e._fullscreenEl!==e.root?eV.INNER_FULLSCREEN:eV.ROTATE_FULLSCREEN;e.recoverFullStyle(e.root,e._fullscreenEl,n,eV.PARENT_ROTATE_FULLSCREEN),this.setRotateDeg(0),this.emit(tf,!1)}},{key:"changeFullScreen",value:function(t){var e=this.player,n=this.config;if(!n.disable){t&&(t.preventDefault(),t.stopPropagation());var i=!1;if((!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(i=!0),i)e.fullscreen?(e.fullscreen=!1,e.exitCssFullscreen(),this.emit(tf,!1)):(e.fullscreen=!0,e.getCssFullscreen(),this.emit(tf,!0)),this.animate(e.fullscreen);else if(n.rotateFullscreen)e.fullscreen?this.exitRotateFullscreen():this.getRotateFullscreen(),this.animate(e.fullscreen);else{if(n.switchCallback&&"function"==typeof n.switchCallback){n.switchCallback(e.fullscreen);return}e.fullscreen?e.exitFullscreen():e.getFullscreen().catch(function(){})}}}},{key:"animate",value:function(t){t?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(t?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"show",value:function(){rG(rY(s.prototype),"show",this).call(this)}},{key:"hide",value:function(){rG(rY(s.prototype),"hide",this).call(this)}},{key:"render",value:function(){var t="FULLSCREEN_TIPS";return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</div>\n </xg-icon>")}}],o=[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}],r&&rV(i.prototype,r),o&&rV(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(rC);function rJ(t){return(rJ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rZ(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==rJ(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==rJ(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===rJ(e)?e:String(e)}(i.key),i)}}function r$(){return(r$="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r0(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function rQ(t,e){return(rQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function r0(t){return(r0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var r1=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rQ(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=r0(e);return t=n?Reflect.construct(i,arguments,r0(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===rJ(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t){var e;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this,t)).isActiving=!1,e.state={currentTime:0,duration:0},e}return i=s,r=[{key:"duration",get:function(){var t,e;return(null===(t=this.playerConfig)||void 0===t?void 0:t.customDuration)||(null===(e=this.player)||void 0===e?void 0:e.duration)||0}},{key:"timeOffset",get:function(){var t;return(null===(t=this.playerConfig)||void 0===t?void 0:t.timeOffset)||0}},{key:"afterCreate",value:function(){var t=this,e=this.player.controls.config.mode;if(this.mode="flex"===e?"flex":"normal",!this.config.disable)"flex"===this.mode&&(this.createCenterTime(),this.hide()),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.on([F,I,D],function(e){"durationchange"===e.eventName&&(t.isActiving=!1),t.onTimeUpdate()}),this.on(j,function(){t.onTimeUpdate(!0)}),this.on(K,function(){t.onReset()})}},{key:"afterPlayerInit",value:function(){var t,e=this.config;if(this.state={currentTime:0,duration:0},this.duration===1/0||null!==(t=this.playerConfig)&&void 0!==t&&t.isLive?(_.hide(this.durationDom),_.hide(this.timeDom),_.hide(this.find(".time-separator")),_.show(this.find(".time-live-tag"))):_.hide(this.find(".time-live-tag")),e.hide){this.hide();return}this.show()}},{key:"show",value:function(){if("flex"!==this.mode)r$(r0(s.prototype),"show",this).call(this)}},{key:"onTimeUpdate",value:function(t){var e=this.player,n=this.config,i=this.duration;if(!!e&&!!e.hasStart&&!n.disable&&!this.isActiving){var r="flex"===this.mode?this.centerCurDom:this.timeDom,o="flex"===this.mode?this.centerDurDom:this.durationDom,a=!1,s=!1,u=e.currentTime+this.timeOffset;u=_.adjustTimeByDuration(u,i,t);var c=_.format(u);this.state.currentTime!==c&&(this.state.currentTime=c,a=!0),this.state.duration!==i&&(this.state.duration=i,s=!0),n.smartRender?(a&&(r.textContent=c),s&&i!==1/0&&i>0&&(o.textContent=_.format(i))):(r.innerHTML=c,i!==1/0&&i>0&&(o.innerHTML=_.format(i)))}}},{key:"onReset",value:function(){var t="flex"===this.mode?this.centerCurDom:this.timeDom,e="flex"===this.mode?this.centerDurDom:this.durationDom;this.config.smartRender?(this.state.currentTime=0,this.state.duration=0,t.textContent=_.format(0),e.textContent=_.format(0)):(t.innerHTML=_.format(0),e.innerHTML=_.format(0))}},{key:"createCenterTime",value:function(){var t=this.player;if(!!t.controls&&!!t.controls.center){var e=t.controls.center;this.centerCurDom=_.createDom("xg-icon","00:00",{},"xgplayer-time left"),this.centerDurDom=_.createDom("xg-icon","00:00",{},"xgplayer-time right"),e.children.length>0?e.insertBefore(this.centerCurDom,e.children[0]):e.appendChild(this.centerCurDom),e.appendChild(this.centerDurDom)}}},{key:"changeLiveState",value:function(t){t?(_.hide(this.durationDom),_.hide(this.timeDom),_.hide(this.find(".time-separator")),_.show(this.find(".time-live-tag"))):(_.hide(this.find(".time-live-tag")),_.show(this.find(".time-separator")),_.show(this.durationDom),_.show(this.timeDom))}},{key:"updateTime",value:function(t){if(this.isActiving=!0,(!!t||0===t)&&!(t>this.duration)){var e="flex"===this.mode?this.centerCurDom:this.timeDom;this.config.smartRender?(this.state.currentTime=t,e.textContent=_.format(t)):e.innerHTML=_.format(t)}}},{key:"resetActive",value:function(){var t=this,e=this.player,n=function(){t.isActiving=!1};this.off(I,n),e.isSeeking&&e.video.seeking?this.once(I,n):this.isActiving=!1}},{key:"destroy",value:function(){var t=this.player.controls.center;this.centerCurDom&&t.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&t.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>")}}],o=[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_LEFT,index:2,disable:!1,smartRender:!1}}}],r&&rZ(i.prototype,r),o&&rZ(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function r2(t){return(r2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r3(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,r8(i.key),i)}}function r4(t,e){return(r4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function r5(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function r6(t){return(r6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function r9(t,e,n){return(e=r8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r8(t){var e=function(t,e){if("object"!==r2(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==r2(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===r2(e)?e:String(e)}var r7=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r4(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=r6(e);return t=n?Reflect.construct(i,arguments,r6(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===r2(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return r5(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return r9(r5(t=a.call.apply(a,[this].concat(n))),"onBarMousedown",function(e){var n=r5(t).player,i=t.find(".xgplayer-bar");_.event(e);var r=i.getBoundingClientRect(),o=_.getEventPos(e,n.zoom),a=r.height-(o.clientY-r.top);if(o.h=a,o.barH=r.height,t.pos=o,!(a<-2))return t.updateVolumePos(a,e),document.addEventListener("mouseup",t.onBarMouseUp),t._d.isStart=!0,!1}),r9(r5(t),"onBarMouseMove",function(e){var n=r5(t)._d;if(!n.isStart)return;var i=r5(t),r=i.pos,o=i.player;e.preventDefault(),e.stopPropagation(),_.event(e);var a=_.getEventPos(e,o.zoom);n.isMoving=!0;var s=r.h-a.clientY+r.clientY;if(!(s>r.barH))t.updateVolumePos(s,e)}),r9(r5(t),"onBarMouseUp",function(e){_.event(e),document.removeEventListener("mouseup",t.onBarMouseUp);var n=r5(t)._d;n.isStart=!1,n.isMoving=!1}),r9(r5(t),"onMouseenter",function(e){t._d.isActive=!0,t.focus(),t.emit("icon_mouseenter",{pluginName:t.pluginName})}),r9(r5(t),"onMouseleave",function(e){t._d.isActive=!1,t.unFocus(100,!1,e),t.emit("icon_mouseleave",{pluginName:t.pluginName})}),r9(r5(t),"onVolumeChange",function(e){if(!!t.player){var n=t.player,i=n.muted,r=n.volume;!t._d.isMoving&&(t.find(".xgplayer-drag").style.height=i||0===r?"4px":"".concat(100*r,"%"),t.config.showValueLabel&&t.updateVolumeValue()),t.animate(i,r)}}),r9(r5(t),"onIconHandle",function(e){t.changeMutedHandler(e)}),t}return i=s,r=[{key:"registerIcons",value:function(){return{volumeSmall:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40"><path fill="#fff" d="M7.907 7.907H3.39v6.778h4.518l5.648 5.648V2.259L7.907 7.907zM17.554 15.295L15.95 13.69c.612-.613.991-1.46.991-2.395s-.379-1.782-.991-2.395l1.604-1.604c1.03 1.02 1.669 2.435 1.669 3.999s-.638 2.979-1.669 3.998zm0 0L15.95 13.69c.612-.613.991-1.46.991-2.395s-.379-1.782-.991-2.395l1.604-1.604c1.03 1.02 1.669 2.435 1.669 3.999s-.638 2.979-1.669 3.998z"/></svg>',class:"xg-volume-small"},volumeLarge:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40"><path fill="#fff" d="M7.907 7.907H3.39v6.778h4.518l5.648 5.648V2.259L7.907 7.907zM20.753 18.48l-1.593-1.592c1.437-1.429 2.326-3.407 2.326-5.592s-.89-4.163-2.326-5.591l1.593-1.593c1.845 1.835 2.987 4.376 2.987 7.184s-1.142 5.349-2.987 7.184zm-3.199-3.185L15.95 13.69c.612-.613.991-1.46.991-2.395s-.379-1.782-.991-2.395l1.604-1.604c1.03 1.02 1.669 2.435 1.669 3.999s-.638 2.979-1.669 3.998z"/></svg>',class:"xg-volume"},volumeMuted:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40"><path fill="#fff" d="M7.907 7.907H3.39v6.778h4.518l5.648 5.648V2.259L7.907 7.907zM20.306 9.703l-2.394-2.406-1.604 1.604 2.417 2.395-2.406 2.395 1.604 1.604 2.383-2.418 2.395 2.406 1.604-1.604-2.417-2.383 2.406-2.395-1.604-1.604-2.384 2.418z"/></svg>',class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var t=this;this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},this.initIcons();var e=this.playerConfig,n=e.commonStyle,i=e.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("mutedChange",function(e){t.changeMuted(e)},{pre:function(t){t.preventDefault(),t.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),("mobile"!==t$.device&&"mobile"!==this.playerConfig.isMobileSimulateMode||"compatible"===this.domEventType)&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider",["mousedown","touchstart"],this.onBarMousedown),this.bind(".xgplayer-slider",["mousemove","touchmove"],this.onBarMouseMove),this.bind(".xgplayer-slider",["mouseup","touchend"],this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.onIconHandle),this.on(H,this.onVolumeChange),this.once(U,this.onVolumeChange),("Number"!==_.typeOf(i)||i<0||i>1)&&(this.player.volume=this.config.default),this.onVolumeChange(),this.config.disable&&this.disable()}},{key:"updateVolumePos",value:function(t,e){var n=this.player,i=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(!!r&&!!i){var o=Math.max(Math.min(t/r.getBoundingClientRect().height,1),0),a=parseInt(1e3*o,10),s={volume:{from:n.volume,to:a/1e3}};i.style.height="".concat(100*o,"%"),n.muted&&(s.muted={from:!0,to:!1}),this.emitUserAction(e,"change_volume",{muted:n.muted,volume:n.volume,props:s}),n.volume=Math.max(Math.min(a/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var t=this.player,e=t.volume,n=t.muted,i=this.find(".xgplayer-value-label"),r=Math.max(Math.min(e,1),0);i.innerText=n?0:Math.round(100*r)}},{key:"focus",value:function(){var t=this.player;if(!this.config.disable)t.focus({autoHide:!1}),this._timerId&&(_.clearTimeout(this,this._timerId),this._timerId=null),_.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;if(!r.isActive)this._timerId&&(_.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=_.setTimeout(this,function(){!r.isActive&&(n?o.blur():o.focus(),_.removeClass(t.root,"slide-show"),r.isStart&&t.onBarMouseUp(i)),t._timerId=null},e)}},{key:"changeMuted",value:function(t){if(!this.config.disable){t&&t.stopPropagation();var e=this.player;this._d.isStart&&this.onBarMouseUp(t),this.emitUserAction(t,"change_muted",{muted:e.muted,volume:e.volume,props:{muted:{from:e.muted,to:!e.muted}}}),e.volume>0&&(e.muted=!e.muted),e.volume<.01&&(e.volume=this.config.miniVolume)}}},{key:"animate",value:function(t,e){t||0===e?this.setAttr("data-state","mute"):e<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var t=this.icons;this.appendChild(".xgplayer-icon",t.volumeSmall),this.appendChild(".xgplayer-icon",t.volumeLarge),this.appendChild(".xgplayer-icon",t.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(_.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider",["mousedown","touchstart"],this.onBarMousedown),this.unbind(".xgplayer-slider",["mousemove","touchmove"],this.onBarMouseMove),this.unbind(".xgplayer-slider",["mouseup","touchend"],this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===t$.device?"touchend":"click",this.onIconHandle)}},{key:"render",value:function(){var t=this.config.default||this.player.volume,e=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(e?'<div class="xgplayer-value-label">'.concat(100*t,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ').concat(100*t,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}],o=[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}],r&&r3(i.prototype,r),o&&r3(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function ot(t){return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oe(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,oa(i.key),i)}}function on(){return(on="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=oo(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function oi(t,e){return(oi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function or(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function oo(t){return(oo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function oa(t){var e=function(t,e){if("object"!==ot(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ot(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ot(e)?e:String(e)}var os=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oi(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=oo(e);return t=n?Reflect.construct(i,arguments,oo(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===ot(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return or(t)}(this,t)});function s(t){var e,n,i,r;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),n=or(e=a.call(this,t)),i="onBtnClick",r=function(t){if(!e.config.disable)t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"rotate"),e.rotate(e.config.clockwise,e.config.innerRotate,1)},(i=oa(i))in n?Object.defineProperty(n,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[i]=r,e.rotateDeg=e.config.rotateDeg||0,e}return i=s,r=[{key:"afterCreate",value:function(){var t=this;if(!this.config.disable){on(oo(s.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(tb,function(){t.rotateDeg&&t.config.innerRotate&&_.setTimeout(t,function(){t.updateRotateDeg(t.rotateDeg,t.config.innerRotate)},100)});var e=this.player.root;this.rootWidth=e.style.width||e.offsetWidth||e.clientWidth,this.rootHeight=e.style.height||e.offsetHeight||e.clientHeight,this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}}},{key:"destroy",value:function(){on(oo(s.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"updateRotateDeg",value:function(t,e){!t&&(t=0);var n=this.player,i=this.rootWidth,r=this.rootHeight;if(e){n.videoRotateDeg=t;return}var o=this.player,a=o.root,s=o.innerContainer,u=o.video,c=a.offsetWidth,l=s&&e?s.offsetHeight:a.offsetHeight,f=i,h=r,p=0,d=0;(.75===t||.25===t)&&(f="".concat(l,"px"),h="".concat(c,"px"),p=-(l-c)/2,d=-(c-l)/2);var y="translate(".concat(p,"px,").concat(d,"px) rotate(").concat(t,"turn)"),v={transformOrigin:"center center",transform:y,webKitTransform:y,height:h,width:f},g=e?u:a,m=e?n.getPlugin("poster"):null;Object.keys(v).map(function(t){g.style[t]=v[t],m&&m.root&&(m.root.style[t]=v[t])})}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;!this.rotateDeg&&(this.rotateDeg=0);this.rotateDeg=(this.rotateDeg+1+.25*(t?1:-1)*n)%1,this.updateRotateDeg(this.rotateDeg,e),i.emit(tk,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none"><g clip-path="url(#clip0)" fill="#fff"><path d="M17.5 13.75H6.25A3.75 3.75 0 002.5 17.5v6.25a3.75 3.75 0 003.75 3.75H17.5a3.75 3.75 0 003.75-3.75V17.5a3.75 3.75 0 00-3.75-3.75z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M5.822 6.094a1.247 1.247 0 00.156 1.79l4.509 4.204a1.25 1.25 0 101.705-1.828L9.93 8.152l4.799-.018.039-.001a10 10 0 019.521 13.983 1.25 1.25 0 002.292.998 12.5 12.5 0 00-11.88-17.48l-5.05.019 2.293-2.46a1.25 1.25 0 10-1.829-1.705L5.854 6.06l-.032.036z"/></g><defs><clipPath id="RotateSvg-clip0"><path fill="#fff" d="M0 0h40v40H0z"/></clipPath></defs></svg>'}}},{key:"render",value:function(){return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.ROTATE_TIPS,'">\n ').concat(this.i18n.ROTATE_TIPS,"\n </div>\n </xg-icon>")}}],o=[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}],r&&oe(i.prototype,r),o&&oe(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(rC);function ou(t){return(ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oc(){oc=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype);return i(o,"_invoke",{value:function(t,e,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return O()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=function t(e,n){var i=n.method,r=e.iterator[i];if(void 0===r)return n.delegate=null,"throw"===i&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=TypeError("The iterator does not provide a '"+i+"' method")),f;var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,f;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,f):a:(n.method="throw",n.arg=TypeError("iterator result is not an object"),n.delegate=null,f)}(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var u=l(t,e,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}(t,n,new S(r||[]))}),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function p(){}function d(){}var y={};u(y,o,function(){return this});var v=Object.getPrototypeOf,g=v&&v(v(P([])));g&&g!==e&&n.call(g,o)&&(y=g);var m=d.prototype=h.prototype=Object.create(y);function b(t){["next","throw","return"].forEach(function(e){u(t,e,function(t){return this._invoke(e,t)})})}function w(t,e){var r;i(this,"_invoke",{value:function(i,o){function a(){return new e(function(r,a){!function i(r,o,a,s){var u=l(t[r],t,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==ou(f)&&n.call(f,"__await")?e.resolve(f.__await).then(function(t){i("next",t,a,s)},function(t){i("throw",t,a,s)}):e.resolve(f).then(function(t){c.value=t,a(c)},function(t){return i("throw",t,a,s)})}s(u.arg)}(i,o,r,a)})}return r=r?r.then(a,a):a()}})}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,r=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=d,i(m,"constructor",{value:d,configurable:!0}),i(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,function(){return this}),t.AsyncIterator=w,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new w(c(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then(function(t){return t.done?t.value:a.next()})},b(m),u(m,s,"Generator"),u(m,o,function(){return this}),u(m,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},t.values=P,S.prototype={constructor:S,reset:function(t){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(_),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(n,i){return a.type="throw",a.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){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"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;_(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function ol(t,e,n,i,r,o,a){try{var s=t[o](a),u=s.value}catch(t){n(t);return}s.done?e(u):Promise.resolve(u).then(i,r)}function of(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,op(i.key),i)}}function oh(t,e,n){return(e=op(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function op(t){var e=function(t,e){if("object"!==ou(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ou(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ou(e)?e:String(e)}function od(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}var oy=new(function(){var t,e,n;function i(){var t=this;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),oh(this,"_onLeave",function(){var e,n;t.detachEl(),t.detachPlayer(),null===(e=t.currentOptions_)||void 0===e||null===(n=e.onLeave)||void 0===n||n.call(e),t.currentOptions_=null,t.window=null,t._isStandaloneWindow=!1}),oh(this,"_onBodyKeyDown",function(e){var n,i,r,o,a=null===(n=t.currentOptions_)||void 0===n?void 0:n.player;null==a||null===(i=a.plugins)||void 0===i||null===(r=i.keyboard)||void 0===r||null===(o=r.onBodyKeyDown)||void 0===o||o.call(r,e)}),this.currentOptions_=null,this.currentElement_=null,this._window=null,this._isStandaloneWindow=!1}return t=i,e=[{key:"window",get:function(){return this._window},set:function(t){var e=this._window;if(!e||e!==t)e&&(e.removeEventListener("pagehide",this._onLeave),e.document.removeEventListener("keydown",this._onBodyKeyDown)),t&&(t.addEventListener("pagehide",this._onLeave),t.document.addEventListener("keydown",this._onBodyKeyDown)),this._window=t||null}},{key:"isStandaloneWindow",get:function(){return this._isStandaloneWindow}},{key:"isSupported",value:function(){var t=/(metasr)/i.test(navigator.userAgent);return"documentPictureInPicture"in window&&/^(https|file)/.test(location.protocol)&&!t}},{key:"contains",value:function(t){var e;return!!(null!==(e=this.window)&&void 0!==e&&e.document.body.contains(t))}},{key:"requestWindow",value:function(t){var e,n,i=this,r=t.config,o=t.window,a=t.onEnter,s=t.onLeave,u=t.player;this.currentOptions_=t,this._isStandaloneWindow=!!r.alwaysKeepDocumentWindow;var c=new Promise(function(t){if(o)t(o);else{var e={};if(r.width&&r.height)e.width=r.width,e.height=r.height;else if(u){var n=u.root.getBoundingClientRect();e.width=n.width,e.height=n.height}"boolean"==typeof r.disallowReturnToOpener&&(e.disallowReturnToOpener=r.disallowReturnToOpener),"boolean"==typeof r.preferInitialWindowPlacement&&(e.preferInitialWindowPlacement=r.preferInitialWindowPlacement),r.docPiPTargetWindow?t(r.docPiPTargetWindow):documentPictureInPicture.requestWindow(e).then(function(e){t(e)})}});return c.then((n=(e=oc().mark(function t(e){var n,o,c,l,f,h;return oc().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.docPiPNode,o=r.docPiPStyle,c=n||(null==u?void 0:u.root)){t.next=4;break}return t.abrupt("return");case 4:return i.window=e,t.next=7,function(t){return new Promise(function(e){var n=document.createDocumentFragment(),i=[],r=[],o=0,a,s=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return od(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return od(t,e)}}(t))){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw 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(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{!a&&null!=n.return&&n.return()}finally{if(s)throw o}}}}(document.styleSheets);try{for(s.s();!(a=s.n()).done;)!function(){var t=a.value;try{var n=Array.from(t.cssRules);n.length>0&&i.push(n.map(function(t){return t.cssText}).join(""))}catch(n){if(t.href){var s=document.createElement("link");s.rel="stylesheet",s.type=t.type||"text/css",s.media=t.media.mediaText||"all",s.href=t.href,s.onload=function(){o--,0===o&&e()},s.onerror=function(){o--,0===o&&e()},r.push(s),o++}}}()}catch(t){s.e(t)}finally{s.f()}if(r.forEach(function(t){return n.appendChild(t)}),i.length>0){var u=document.createElement("style");u.textContent=i.join("\n"),n.appendChild(u)}t.document.head.appendChild(n),0===o&&e()})}(e);case 7:l=document.createElement("style"),f=["body{padding:0; margin:0;}"],o?(h="","string"==typeof o?h=o:"function"==typeof o&&(h=o.call(r)),h&&f.push(h)):c===(null==u?void 0:u.root)&&f.push(".xgplayer{width: 100%!important; height: 100%!important;}"),l.textContent=f.join("\n"),e.document.head.append(l),i.attachPlayer(u,{element:c,window:e,onEnter:a,onLeave:s}),null==a||a({documentPictureInPictureWindow:e});case 14:case"end":return t.stop()}},t)}),function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function a(t){ol(o,i,r,a,s,"next",t)}function s(t){ol(o,i,r,a,s,"throw",t)}a(void 0)})}),function(t){return n.apply(this,arguments)})),c}},{key:"exit",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=this.window)||void 0===t||t.close(),e&&this._onLeave()}},{key:"attachEl",value:function(t){if(!!t&&!!this.window){var e=t.parentElement,n=t.nextSibling;this.window.document.body.append(t),this.currentElement_={element:t,parentNode:e,nextSibling:n}}}},{key:"detachEl",value:function(t){var e,n=this;if(!!this.currentElement_&&(!t||t===(null===(e=this.currentElement_)||void 0===e?void 0:e.element))){var i=this.currentElement_,r=i.element,o=i.parentNode,a=i.nextSibling;return o&&(o.isConnected?o.insertBefore(r,a):r.remove?r.remove():r.parentNode.removeChild(r)),Object.keys(this.currentElement_).forEach(function(t){n.currentElement_[t]=null}),this.currentElement_=null,r}}},{key:"attachPlayer",value:function(t,e){var n,i=e.element,r=e.window,o=e.onEnter,a=e.onLeave;if(!this.window||r===this.window)r&&(this.window=r),this.currentOptions_&&(o&&(this.currentOptions_.onEnter=o),a&&(this.currentOptions_.onLeave=a),t&&(this.currentOptions_.player=t)),i&&i!==(null===(n=this.currentElement_)||void 0===n?void 0:n.element)&&(this.detachEl(),this.attachEl(i))}},{key:"detachPlayer",value:function(t){if(!!t){(null===(e=this.currentOptions_)||void 0===e?void 0:e.player)===t&&(this.currentOptions_.player=null);var e,n,i=null===(n=this.currentElement_)||void 0===n?void 0:n.element;i&&(i===t.root||i.contains(t.root))&&this.detachEl()}}}],of(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),i}());function ov(t){return(ov="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function og(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,o_(i.key),i)}}function om(){return(om="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ok(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function ob(t,e){return(ob=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ow(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ok(t){return(ok=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o_(t){var e=function(t,e){if("object"!==ov(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ov(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ov(e)?e:String(e)}var oS={PIP:"picture-in-picture",INLINE:"inline",FULLSCREEN:"fullscreen"},oP=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ob(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=ok(e);return t=n?Reflect.construct(i,arguments,ok(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===ov(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return ow(t)}(this,t)});function s(){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var t,e,n,i,r=arguments.length,o=Array(r),u=0;u<r;u++)o[u]=arguments[u];return e=ow(t=a.call.apply(a,[this].concat(o))),n="switchPIP",i=function(e){if(!t.isPIPAvailable()||t.config.disable)return!1;e&&e instanceof Event&&e.stopPropagation(),t.isPip?(t.exitPIP(),t.emitUserAction(e,"change_pip",{from:"pip",to:"normal"}),t.setAttr("data-state","normal")):4===t.player.video.readyState&&(t.requestPIP(),t.emitUserAction(e,"change_pip",{from:"normal",to:"pip"}),t.setAttr("data-state","pip"))},(n=o_(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,t}return i=s,r=[{key:"setConfig",value:function(t){var e=this;if(!!t)Object.keys(t).map(function(n){e.config[n]=t[n]}),this.canShow()&&!this.root&&this.reInitialize(),this._initState()}},{key:"beforeCreate",value:function(t){"boolean"==typeof t.player.config.pip&&(t.config.showIcon=t.player.config.pip)}},{key:"afterCreate",value:function(){if(!!this.isPIPAvailable())om(ok(s.prototype),"afterCreate",this).call(this),this.pMode=oS.INLINE,this.pipWindow=null,this._initPipEvents(),this._initState({checkStyle:!0})}},{key:"canShow",value:function(){return this.config.showIcon&&this.isPIPAvailable()}},{key:"_initState",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.config.showIcon)this.initIcons(),n.checkStyle&&this.show("",!1);else{n.checkStyle&&this.hide();return}null!==(t=this.player)&&void 0!==t&&t.isComplete?this._checkIcon():this.once(ti,function(){return e._checkIcon()}),this.config.docPiPTargetWindow&&this.isDocPIPAvailable()&&this.requestPIP(),this.isPip&&this.setAttr("data-state","pip")}},{key:"_checkIcon",value:function(){this.config.showIcon&&(_.removeClass(this.find(".xgplayer-icon"),"xg-icon-disable"),this.bind("click",this.switchPIP))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:'<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.3h-13a.2.2 0 00-.2.2v11c0 .11.09.2.2.2h5v1.8h-5a2 2 0 01-2-2v-11a2 2 0 012-2h13a2 2 0 012 2v4h-1.8v-4a.2.2 0 00-.2-.2zM12 11.5a1 1 0 00-1 1v4a1 1 0 001 1h5.5a1 1 0 001-1v-4a1 1 0 00-1-1H12z" fill="#fff"/></svg>',class:"xg-get-pip"},pipIconExit:{icon:'<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.3h-13a.2.2 0 00-.2.2v11c0 .11.09.2.2.2h5v1.8h-5a2 2 0 01-2-2v-11a2 2 0 012-2h13a2 2 0 012 2v4h-1.8v-4a.2.2 0 00-.2-.2zM12 11.5a1 1 0 00-1 1v4a1 1 0 001 1h5.5a1 1 0 001-1v-4a1 1 0 00-1-1H12z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M9.5 7.7a.5.5 0 00.5-.5v-.7a.5.5 0 00-.5-.5h-4a.5.5 0 00-.5.5v3.96a.5.5 0 00.5.5h.7a.5.5 0 00.5-.5V8.83l2.07 2.109a.5.5 0 00.707.006l.5-.49a.5.5 0 00.006-.707L7.973 7.7H9.5z" fill="#fff"/></svg>',class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var t=this.icons;if(!this._isInitIcons)this.appendChild(".xgplayer-icon",t.pipIcon),this.appendChild(".xgplayer-icon",t.pipIconExit),this._isInitIcons=!0}},{key:"_initPipEvents",value:function(){var t=this,e=this.player;this.onBeforeFullscreenRequest=function(n){oy.contains(e.root)&&oy.detachEl(),t.exitPIP()},this.leavePIPCallback=function(){var n=e.paused;_.setTimeout(t,function(){n||e.videoPlay()},0),n||e.videoPlay(),t.setAttr("data-state","normal"),t.pipWindow=null,e.emit(tw,!1)},this.enterPIPCallback=function(n){t.setAttr("data-state","pip"),null!=n&&n.pictureInPictureWindow&&(t.pipWindow=n.pictureInPictureWindow),e.emit(tw,!0)},this.onWebkitpresentationmodechanged=function(n){var i=e.video.webkitPresentationMode;t.pMode===oS.FULLSCREEN&&i!==oS.FULLSCREEN&&e.onFullscreenChange(null,!1),t.pMode=i,i===oS.PIP?t.enterPIPCallback(n):i===oS.INLINE&&t.leavePIPCallback(n)},e.on(tl,this.onBeforeFullscreenRequest),e.video&&(e.video.addEventListener("enterpictureinpicture",this.enterPIPCallback),e.video.addEventListener("leavepictureinpicture",this.leavePIPCallback),s.checkWebkitSetPresentationMode(e.video)&&e.video.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"requestPIP",value:function(t){var e=this.player,n=this.playerConfig,i=this.config;if(!!this.isPIPAvailable()&&!this.isPip)try{var r=n.poster;return r&&(e.video.poster="String"===_.typeOf(r)?r:r.poster),i.preferDocument&&this.isDocPIPAvailable()?oy.requestWindow({config:i,window:t,player:e,onEnter:this.enterPIPCallback,onLeave:this.leavePIPCallback}):s.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("picture-in-picture"):e.video.requestPictureInPicture(),!0}catch(t){return!1}}},{key:"exitPIP",value:function(){var t=this.player;try{return this.isPIPAvailable()&&this.isPip&&(this.isDocPIPAvailable()&&this.getDocumentWindow()?oy.exit():s.checkWebkitSetPresentationMode(t.video)?t.video.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(t){return!1}}},{key:"isPip",get:function(){var t=this.player;return!!(this.isDocPIPAvailable()&&this.getDocumentWindow())||document.pictureInPictureElement&&document.pictureInPictureElement===t.video||t.video.webkitPresentationMode===oS.PIP}},{key:"isPIPAvailable",value:function(){var t=this.player.video;return("Boolean"!==_.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===_.typeOf(t.disablePictureInPicture)&&!t.disablePictureInPicture||t.webkitSupportsPresentationMode&&"Function"===_.typeOf(t.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return oy.isSupported()}},{key:"getWindow",value:function(){return this.pipWindow}},{key:"getDocumentWindow",value:function(){return oy.window}},{key:"attachDocumentWindow",value:function(t){var e,n=this.config.docPiPNode||(null===(e=this.player)||void 0===e?void 0:e.root);oy.attachPlayer(this.player,{element:n,window:t,onEnter:this.enterPIPCallback,onLeave:this.leavePIPCallback})}},{key:"destroy",value:function(){om(ok(s.prototype),"destroy",this).call(this);var t=this.player,e=!(this.isPip&&this.getDocumentWindow()&&oy.isStandaloneWindow);this.unbind("click",this.btnClick),t.off(tl,this.onBeforeFullscreenRequest),t.video.removeEventListener("enterpictureinpicture",this.enterPIPCallback),t.video.removeEventListener("leavepictureinpicture",this.leavePIPCallback),s.checkWebkitSetPresentationMode(t.video)&&t.video.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.isPip&&this.getDocumentWindow()&&oy.detachPlayer(t),e&&this.exitPIP(),this.pipWindow=null,!oy.isStandaloneWindow&&(oy.window=null)}},{key:"render",value:function(){if(!!this.canShow())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PIP,'">').concat(this.i18n.PIP,"</div>\n </xg-icon>")}}],o=[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_RIGHT,index:6,showIcon:!1,preferDocument:!1,width:void 0,height:void 0,docPiPTargetWindow:void 0,docPiPNode:void 0,docPiPStyle:void 0,alwaysKeepDocumentWindow:!1}}},{key:"checkWebkitSetPresentationMode",value:function(t){return"function"==typeof t.webkitSetPresentationMode}}],r&&og(i.prototype,r),o&&og(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(rC);function oO(t){return(oO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oT(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,oj(i.key),i)}}function oE(t,e){return(oE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function oC(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ox(t){return(ox=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function oj(t){var e=function(t,e){if("object"!==oO(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==oO(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===oO(e)?e:String(e)}var oR=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oE(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=ox(e);return t=n?Reflect.construct(i,arguments,ox(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===oO(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return oC(t)}(this,t)});function s(t){var e,n,i,r;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),n=oC(e=a.call(this,t)),i="playNext",r=function(t){var n=oC(e).player;t.preventDefault(),t.stopPropagation(),e.idx+1<e.config.urlList.length?(e.idx++,n.emit(tS,e.idx+1),e.nextHandler(e.config.urlList[e.idx],e.idx)):(e.nextHandler(),n.emit(tS))},(i=oj(i))in n?Object.defineProperty(n,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[i]=r,e.idx=-1,e}return i=s,r=[{key:"afterCreate",value:function(){if(!!this.config.urlList&&0!==this.config.urlList.length)this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents()}},{key:"registerIcons",value:function(){return{playNext:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="40" viewBox="10 0 24 40"><path d="M30.4 10.64v21.504h-4.864v-9.856l-12.16 8.96V11.536l12.16 8.96V10.64z"/></svg>'}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("playNext",this.changeSrc);var t="mobile"===t$.device?"touchend":"click";this.bind(t,this.playNext),this.show()}},{key:"changeSrc",value:function(t){var e=this.player;if(!!t)e.pause(),e.currentTime=0,e.autoplay=!0,e.src=t}},{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 <div class="xg-tips" lang-key="PLAYNEXT_TIPS">'.concat(this.i18n.PLAYNEXT_TIPS,"</div>\n </xg-icon>\n ")}}],o=[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}],r&&oT(i.prototype,r),o&&oT(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN),oA=n("78108"),oL=n.n(oA);function oI(t){return(oI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oD(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,oH(i.key),i)}}function oN(){return(oN="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=oF(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function oM(t,e){return(oM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function oB(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function oF(t){return(oF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function oH(t){var e=function(t,e){if("object"!==oI(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==oI(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===oI(e)?e:String(e)}var oU=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oM(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=oF(e);return t=n?Reflect.construct(i,arguments,oF(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===oI(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return oB(t)}(this,t)});function s(t){var e,n,i,r;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),n=oB(e=a.call(this,t)),i="download",r=function(t){if(!e.isLock&&!e.config.disable){e.emitUserAction(t,"download");var n=e.getAbsoluteURL(e.player.src);oL()(n),e.isLock=!0,e.timer=window.setTimeout(function(){e.isLock=!1,window.clearTimeout(e.timer),e.timer=null},300)}},(i=oH(i))in n?Object.defineProperty(n,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[i]=r,e.timer=null,e.isLock=!1,e}return i=s,r=[{key:"afterCreate",value:function(){if(oN(oF(s.prototype),"afterCreate",this).call(this),!this.config.disable)this.appendChild(".xgplayer-icon",this.icons.download),this.bind(["click","touchend"],this.download)}},{key:"registerIcons",value:function(){return{download:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="#FFF" fill-rule="evenodd"><rect x="11" y="4" width="2" height="12" rx="1"/><rect x="3" y="18" width="18" height="2" rx="1"/><rect transform="rotate(90 4 17.5)" x="1.5" y="16.5" width="5" height="2" rx="1"/><rect transform="rotate(90 20 17.5)" x="17.5" y="16.5" width="5" height="2" rx="1"/><path d="M11.988 14.3l-4.243-4.242a1 1 0 00-1.414 1.414l4.95 4.95a1 1 0 001.414 0l4.95-4.95a1 1 0 10-1.414-1.414L11.988 14.3z"/></g></svg>'}}},{key:"getAbsoluteURL",value:function(t){if(!t.match(/^https?:\/\//)){var e=document.createElement("div");e.innerHTML='<a href="'.concat(t,'">x</a>'),t=e.firstChild.href}return t}},{key:"destroy",value:function(){oN(oF(s.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.DOWNLOAD_TIPS,'">').concat(this.i18n.DOWNLOAD_TIPS,"</div>\n </xg-icon>")}}],o=[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_RIGHT,index:3,disable:!0}}}],r&&oD(i.prototype,r),o&&oD(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(rC);function oW(t){return(oW="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oV(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==oW(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==oW(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===oW(e)?e:String(e)}(i.key),i)}}function oG(){return(oG="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=oK(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function oz(t,e){return(oz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function oK(t){return(oK=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var oY=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oz(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=oK(e);return t=n?Reflect.construct(i,arguments,oK(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===oW(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,r=[{key:"beforeCreate",value:function(t){"boolean"==typeof t.player.config.screenShot&&(t.config.disable=!t.player.config.screenShot)}},{key:"afterCreate",value:function(){oG(oK(s.prototype),"afterCreate",this).call(this),this.createCanvas(),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var t=this.config;this.initSize=function(e){t.fitVideo&&(t.width=e.vWidth,t.height=e.vHeight)},this.once(tb,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(t,e){var n=document.createElement("a");n.href=t,n.download=e;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}},{key:"createCanvas",value:function(t,e){var n=document.createElement("canvas");this.canvasCtx=n.getContext("2d"),this.canvas=n,n.width=t||this.config.width,n.height=e||this.config.height,this.config.canvasAdded&&this.player.root.appendChild(n)}},{key:"onClickBtn",value:function(t){var e=this;t.preventDefault(),t.stopPropagation(),this.emitUserAction(t,"shot"),this.shot().then(function(t){e.emit(t_,t),e.saveScreenShot(t,e.config.name+e.config.format)})}},{key:"shotArea",value:function(t,e,n,i){var r=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{quality:.92,type:"image/png"},a=this.config,s=this.player,u=o.quality||a.quality,c=o.type||a.type,l=s.video||s.media,f=this.canvas;return new Promise(function(o){var a,s=r.canvasCtx;f.width=n,f.height=i;var h={isContain:"contain"===(a=getComputedStyle(l)["object-fit"]),isCover:"cover"===a},p=h.isContain,d=h.isCover;if(p){var y=l.videoHeight/l.videoWidth,v=l.clientHeight/l.clientWidth,g=y;g=v>y?l.videoWidth/l.clientWidth:l.videoHeight/l.clientHeight,f.width=n,f.height=i,s.drawImage(l,t*g,e*g,n*g,i*g,0,0,n,i),o(f.toDataURL(c,u))}else if(d){var m=function(t,e,n,i){var r,o,a,s,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.5,l=t/e;return n/i>l?(a=i*l,s=i,r=(n-a)*u,o=0):(a=n,r=0,o=(i-(s=n/l))*c),{source:{x:r,y:o,width:a,height:s},destination:{x:0,y:0,width:t,height:e}}}(l.clientWidth,l.clientHeight,l.videoWidth,l.videoHeight),b=m.source,w=m.destination;f.width=w.width,f.height=w.height,s.drawImage(l,b.x,b.y,b.width,b.height,w.x,w.y,w.width,w.height);var k=f.toDataURL("image/png"),_=new Image(w.width,w.height);_.src=k,_.onload=function(){s.clearRect(0,0,f.width,f.height),f.width=n,f.height=i,s.drawImage(_,t,e,n,i,0,0,n,i),_.onload=null},s.drawImage(l,t,e,n,i,0,0,n,i),o(f.toDataURL(c,u))}})}},{key:"shot",value:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,a=i.quality||r.quality,s=i.type||r.type;return new Promise(function(i,u){n.canvas?(n.canvas.width=t||r.width,n.canvas.height=e||r.height):n.createCanvas(t,e),n.canvasCtx.drawImage(o.video,0,0,t||r.width,e||r.height);var c=n.canvas.toDataURL(s,a).replace(s,"image/octet-stream");i(c=c.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))})}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){oG(oK(s.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(tb,this.initSize)}},{key:"render",value:function(){if(!this.config.disable&&!!this.config.showIcon){var t=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",e="SCREENSHOT";return'\n <xg-icon class="xgplayer-shot">\n <div class="'.concat(t,'">\n ').concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span>")," \n </div>\n </xg-icon>")}}}],o=[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot",showIcon:!0,canvasCreated:!1,canvasAdded:!1}}}],r&&oV(i.prototype,r),o&&oV(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(rC);function oX(t){return(oX="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oq(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==oX(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==oX(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===oX(e)?e:String(e)}(i.key),i)}}var oJ=function(){var t,e,n;function i(t){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,i),this.config=t.config,this.parent=t.root,this.root=_.createDom("ul","",{},"xg-options-list ".concat(this.config.className)),t.root.appendChild(this.root),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var e="touche"===this.config.domEventType?"touchend":"click";this._delegates=eN.delegate.call(this,this.root,"li",e,this.onItemClick)}return t=i,e=[{key:"renderItemList",value:function(t){var e=this,n=this.config,i=this.root;t?n.data=t:t=n.data,n.style&&Object.keys(n.style).map(function(t){i.style[t]=n[t]}),t.length>0&&(this.attrKeys=Object.keys(t[0])),this.root.innerHTML="",t.map(function(t,n){var i=t.selected?"option-item selected":"option-item";t["data-index"]=n,e.root.appendChild(_.createDom("li","<span>".concat(t.showText,"</span>"),t,i))})}},{key:"onItemClick",value:function(t){!t.delegateTarget&&(t.delegateTarget=t.target);var e=t.delegateTarget;if(e&&_.hasClass(e,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");_.addClass(e,"selected"),i&&_.removeClass(i,"selected"),n(t,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(e,this.attrKeys)})}},{key:"getAttrObj",value:function(t,e){if(!t||!e)return{};var n={};e.map(function(e){n[e]=t.getAttribute(e)});var i=t.getAttribute("data-index");return i&&(n.index=Number(i)),n}},{key:"show",value:function(){_.removeClass(this.root,"hide"),_.addClass(this.root,"active")}},{key:"hide",value:function(){_.removeClass(this.root,"active"),_.addClass(this.root,"hide")}},{key:"setStyle",value:function(t){var e=this;Object.keys(t).forEach(function(n){e.root.style[n]=t[n]})}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map(function(t){t.destroy&&t.destroy()}),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}],oq(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),i}();function oZ(t){return(oZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o$(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,o3(i.key),i)}}function oQ(t,e){return(oQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function o0(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o1(t){return(o1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o2(t,e,n){return(e=o3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o3(t){var e=function(t,e){if("object"!==oZ(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==oZ(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===oZ(e)?e:String(e)}var o4="mobile"===t$.device,o5=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oQ(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=o1(e);return t=n?Reflect.construct(i,arguments,o1(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===oZ(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return o0(t)}(this,t)});function s(t){var e;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),o2(o0(e=a.call(this,t)),"onEnter",function(t){t.preventDefault(),t.stopPropagation(),e.emit("icon_mouseenter",{pluginName:e.pluginName}),e.onToggle(!0)}),o2(o0(e),"onLeave",function(t){t.preventDefault(),t.stopPropagation(),e.emit("icon_mouseleave",{pluginName:e.pluginName}),e.isActive&&e.onToggle(!1)}),e.isIcons=!1,e.isActive=!1,e.curValue=null,e.curIndex=0,e}return i=s,r=[{key:"updateLang",value:function(t){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var t=this,e=this.config;this.initIcons(),o4=o4||"touch"===this.domEventType,"mobile"===t$.device&&"middle"!==e.listType&&(e.listType="rightSide"),e.hidePortrait&&_.addClass(this.root,"portrait"),this.once(M,function(){e.list&&e.list.length>0&&(t.renderItemList(e.list),t.show())}),o4&&this.on(Z,function(){if(!!t.isActive)t.optionsList&&t.optionsList.hide(),t.isActive=!1}),this.activeEvent=o4?"touchend":"mouseenter",this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave),this.isIcons&&this.bind("click",this.onIconClick),this.config.disable&&this.disable()}},{key:"initIcons",value:function(){var t=this,e=this.icons,n=Object.keys(e),i=!1;if(n.length>0&&(n.forEach(function(n){t.appendChild(".xgplayer-icon",e[n]),i||(i=e[n])}),this.isIcons=i),!i)this.appendChild(".xgplayer-icon",_.createDom("span","",{},"icon-text")),_.addClass(this.find(".xgplayer-icon"),"btn-text")}},{key:"show",value:function(){if(!!this.config.list&&!(this.config.list.length<1))_.addClass(this.root,"show")}},{key:"hide",value:function(){_.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(t,e,n){if(void 0===t)return"";var i=this.config.list;n||(n=this.player.lang),e=!e||_.isUndefined(t[e])?"text":e,"number"==typeof t&&(t=i[t]);try{if("object"===oZ(t[e]))return t[e][n]||t[e].zh;return t[e]}catch(t){return""}}},{key:"onToggle",value:function(t){if(t!==this.isActive&&!this.config.disable){var e=this.player.controls,n=this.config.listType;t?("rightSide"===n?e.blur():e.focus(),this.optionsList&&this.optionsList.show()):("rightSide"===n?e.focus():e.unFocus(),this.optionsList&&this.optionsList.hide()),this.isActive=t}}},{key:"onItemClick",value:function(t,e){t.preventDefault(),t.stopPropagation();var n=this.config,i=n.listType,r=n.list;(o4||"rightSide"===i)&&this.onToggle(!1),this.curIndex=e.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),this.onToggle(!1)}},{key:"onIconClick",value:function(t){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var t=this.config.list,e=this.curIndex<t.length?this.curIndex:0,n=t[e];n&&(this.find(".icon-text").innerHTML=this.getTextByLang(n,"iconText"))}}},{key:"renderItemList",value:function(t,e){var n=this,i=this.config,r=this.optionsList,o=this.player;if("number"==typeof e&&(this.curIndex=e,this.curItem=i.list[e]),r){r.renderItemList(t),this.changeCurrentText();return}var a={config:{data:t||[],className:"rightSide"===i.listType?"right-side":"",onItemClick:function(t,e){n.onItemClick(t,e)},domEventType:o4?"touche":"mouse"},root:"rightSide"===i.listType?o.root:this.root};this.config.isShowIcon&&(this.optionsList=new oJ(a),this.changeCurrentText(),this.show())}},{key:"destroy",value:function(){this.unbind(this.activeEvent,this.onToggle),this.unbind("mouseleave",this.onToggle),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>')}}],o=[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1}}}],r&&o$(i.prototype,r),o&&o$(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function o6(t){return(o6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o9(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==o6(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==o6(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===o6(e)?e:String(e)}(i.key),i)}}function o8(){return(o8="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=at(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function o7(t,e){return(o7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function at(t){return(at=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ae=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o7(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=at(e);return t=n?Reflect.construct(i,arguments,at(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===o6(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t){var e;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this,t)).curTime=0,e.isPaused=!0,e}return i=s,r=[{key:"beforeCreate",value:function(t){var e=t.config.list;Array.isArray(e)&&e.length>0&&(t.config.list=e.map(function(t){return!t.text&&t.name&&(t.text=t.name),!t.text&&(t.text=t.definition),t}))}},{key:"afterCreate",value:function(){var t=this;o8(at(s.prototype),"afterCreate",this).call(this);var e=this.config,n=e.list,i=e.defaultDefinition,r=this.playerConfig.defaultConfig;n.forEach(function(t){(t.definition===i||t.definition===r)&&(t.selected=!0)}),this.on("resourceReady",function(e){t.changeDefinitionList(e)}),this.on(td,function(e){t.renderItemList(t.config.list,e.to)}),this.player.definitionList.length<2&&this.hide()}},{key:"initDefinition",value:function(){var t=this.config,e=t.list,n=t.defaultDefinition,i=this.playerConfig.defaultConfig;if(e.length>0){var r=null;e.map(function(t){(t.definition===n||t.definition===i)&&(r=t,t.selected=!0)}),!r&&(r=e[0]),this.changeDefinition(r)}}},{key:"renderItemList",value:function(t,e){var n=this,i=e&&e.definition?e.definition:"";e&&!Array.isArray(e)&&t.forEach(function(t){t.selected=!1});var r=0,o=t.map(function(t,e){var o={url:t.url,definition:t.definition||"",showText:n.getTextByLang(t)||t.definition,selected:!1};return(t.selected||!_.isUndefined(t.definition)&&t.definition===i)&&(o.selected=!0,r=e),o});o8(at(s.prototype),"renderItemList",this).call(this,o,r)}},{key:"changeDefinitionList",value:function(t){if(!!Array.isArray(t)){var e=this.playerConfig,n=e.definition,i=e.defaultDefinition,r=n||this.config.defaultDefinition||"";this.config.list=t.map(function(t){return!t.text&&t.name&&(t.text=t.name),!t.text&&(t.text=t.definition),(t.definition===r||t.definition===i)&&(t.selected=!0),t}),n.list=t,this.renderItemList(t),this.config.list.length<2?this.hide():this.show()}}},{key:"changeDefinition",value:function(t,e){var n=this.player;n.switchURL?n.switchUrl(t.url):n.changeDefinition(t,e)}},{key:"onItemClick",value:function(t,e){var n=this.player.definitionList;o8(at(s.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(t,"change_definition",{from:e.from,to:e.to});for(var i=0;i<n.length;i++)e.to&&n[i].definition===e.to.definition&&(e.to.url=n[i].url),e.from&&n[i].definition===e.from.definition&&(e.from.url=n[i].url);this.player.changeDefinition(e.to,e.from)}}],o=[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0}}}],r&&o9(i.prototype,r),o&&o9(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(o5);function an(t){return(an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ai(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==an(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==an(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===an(e)?e:String(e)}(i.key),i)}}function ar(){return(ar="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=aa(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function ao(t,e){return(ao=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function aa(t){return(aa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var as=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ao(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=aa(e);return t=n?Reflect.construct(i,arguments,aa(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===an(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t){var e;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this,t)).curRate=1,e}return i=s,r=[{key:"beforeCreate",value:function(t){var e=t.player.config.playbackRate,n=e?Array.isArray(e)?e:t.config.list:[];Array.isArray(n)&&(t.config.list=n.map(function(t){return"number"==typeof t?t={rate:t,text:"".concat(t,"x")}:!t.text&&t.rate&&(t.text="".concat(t.rate,"x")),t}))}},{key:"afterCreate",value:function(){var t=this;ar(aa(s.prototype),"afterCreate",this).call(this),this.on(V,function(){if(t.curValue!==t.player.playbackRate)t.renderItemList()}),this.renderItemList()}},{key:"show",value:function(){if(!!this.config.list&&0!==this.config.list.length)ar(aa(s.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(t,e){ar(aa(s.prototype),"onItemClick",this).apply(this,arguments);var n=Number(t.delegateTarget.getAttribute("rate"));if(!n||n===this.curValue)return!1;var i={playbackRate:{from:this.player.playbackRate,to:n}};this.emitUserAction(t,"change_rate",{props:i}),this.curValue=n,this.player.playbackRate=n}},{key:"renderItemList",value:function(){var t=this,e=this.player.playbackRate||1;this.curValue=e;var n=0,i=this.config.list.map(function(i,r){var o={rate:i.rate};return o.rate===e&&(o.selected=!0,n=r),o.showText=t.getTextByLang(i),o});ar(aa(s.prototype),"renderItemList",this).call(this,i,n)}},{key:"destroy",value:function(){ar(aa(s.prototype),"destroy",this).call(this)}}],o=[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1}}}],r&&ai(i.prototype,r),o&&ai(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(o5);function au(t){return(au="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ac(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==au(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==au(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===au(e)?e:String(e)}(i.key),i)}}function al(){return(al="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ah(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}}).apply(this,arguments)}function af(t,e){return(af=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ah(t){return(ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ap=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&af(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=ah(e);return t=n?Reflect.construct(i,arguments,ah(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===au(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,r=[{key:"afterCreate",value:function(){var t=this;al(ah(s.prototype),"afterCreate",this).call(this),this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(th,function(e){t.animate(e)}),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(t){t.preventDefault(),t.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen)}},{key:"initIcons",value:function(){var t=this.icons,e=this.find(".xgplayer-icon");e.appendChild(t.cssFullscreen),e.appendChild(t.exitCssFullscreen)}},{key:"btnClick",value:function(t){if(!this.config.disable){t.preventDefault(),t.stopPropagation();var e=this.player.isCssfullScreen;this.emitUserAction(t,"switch_cssfullscreen",{cssfullscreen:e}),e?this.player.exitCssFullscreen():this.player.getCssFullscreen()}}},{key:"animate",value:function(t){if(!!this.root)t?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(t)}},{key:"switchTips",value:function(t){var e=this.i18nKeys;this.changeLangTextKey(this.find(".xg-tips"),t?e.EXITCSSFULLSCREEN_TIPS:e.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40"><path fill="#fff" class="path_full" d="M11.7 13v1.3a1.17 1.17 0 01-1.3 1.3 1.17 1.17 0 01-1.3-1.3v-2.6a1.17 1.17 0 011.3-1.3H13a1.17 1.17 0 011.3 1.3A1.17 1.17 0 0113 13zm7.8 5.2v-1.3a1.3 1.3 0 012.6 0v2.6a1.17 1.17 0 01-1.3 1.3h-2.6a1.3 1.3 0 010-2.6zm3.9-9.1H7.8v13h15.6zm2.6 0v13a2.6 2.6 0 01-2.6 2.6H7.8a2.6 2.6 0 01-2.6-2.6v-13a2.6 2.6 0 012.6-2.6h15.6A2.6 2.6 0 0126 9.1z"/></svg>',class:"xg-get-cssfull"},exitCssFullscreen:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40"><path fill="#fff" d="M11.7 13v-1.3a1.17 1.17 0 011.3-1.3 1.17 1.17 0 011.3 1.3v2.6a1.17 1.17 0 01-1.3 1.3h-2.6a1.17 1.17 0 01-1.3-1.3 1.17 1.17 0 011.3-1.3zm7.8 5.2v1.3a1.3 1.3 0 01-2.6 0v-2.6a1.17 1.17 0 011.3-1.3h2.6a1.3 1.3 0 010 2.6zm3.9-9.1H7.8v13h15.6zm2.6 0v13a2.6 2.6 0 01-2.6 2.6H7.8a2.6 2.6 0 01-2.6-2.6v-13a2.6 2.6 0 012.6-2.6h15.6A2.6 2.6 0 0126 9.1z"/></svg>',class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){al(ah(s.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class=\'xgplayer-cssfullscreen\'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.CSSFULLSCREEN_TIPS,'">').concat(this.i18n.CSSFULLSCREEN_TIPS,"</div>\n </xg-icon>")}}],o=[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:eA.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}],r&&ac(i.prototype,r),o&&ac(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(rC);function ad(t){return(ad="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ay(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==ad(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ad(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ad(e)?e:String(e)}(i.key),i)}}function av(t,e){return(av=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ag(t){return(ag=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var am=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&av(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=ag(e);return t=n?Reflect.construct(i,arguments,ag(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===ad(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,o=[{key:"pluginName",get:function(){return"error"}}],r=[{key:"afterCreate",value:function(){var t=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(t){t.preventDefault(),t.stopPropagation()}}),this.onError=this.hook("errorHandler",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(M,function(){t.handleCanPlay()}),this.on(A,function(e){t.onError(e)})}},{key:"errorRetry",value:function(t){this.emitUserAction(t,"error_retry",{}),this.player.retry()}},{key:"handleCanPlay",value:function(){_.removeClass(this.player.root,"xgplayer-is-error")}},{key:"handleError",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.player,n=t.errorType,i=e.error;if(!i)switch(n){case"decoder":i=this.i18n.MEDIA_ERR_DECODE;break;case"network":i=this.i18n.MEDIA_ERR_NETWORK;break;default:i=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=i,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>'}}],ay(i.prototype,r),o&&ay(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function ab(t){return(ab="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aw(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==ab(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==ab(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ab(e)?e:String(e)}(i.key),i)}}function ak(t,e){return(ak=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function a_(t){return(a_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var aS=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ak(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=a_(e);return t=n?Reflect.construct(i,arguments,a_(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===ab(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,o=[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,preventScreenOverflow:!1,detail:{text:"",highlight:""},onClick:function(){}}}}],r=[{key:"afterCreate",value:function(){var t=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],function(e){(t.config.onClick||t.customOnClick)&&(e.preventDefault(),e.stopPropagation(),t.customOnClick?t.customOnClick(e):t.config.onClick(e))}),this.player.showPrompt=function(){t.show.apply(t,arguments)},this.player.hidePrompt=function(){t.hide()}}},{key:"setStyle",value:function(t){var e=this;Object.keys(t).map(function(n){e.root.style[n]=t[n]})}},{key:"show",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(!!t){this.customOnClick=i;var r=this.config.interval;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),n.style&&this.setStyle(n.style),"string"==typeof t?this.find(".xgplayer-prompt-detail").innerHTML=t:this.find(".xgplayer-prompt-detail").innerHTML="".concat(t.text||"")+"".concat(t.highlight?'<i class="highlight">'.concat(t.highlight,"</i>"):""),"arrow"===n.mode&&_.addClass(this.root,"arrow"),n.preventScreenOverflow){var o=this.root.getBoundingClientRect(),a=o.left,s=o.right,u=document.documentElement.clientWidth||document.body.clientWidth;if(a<0){var c=Number((Math.abs(a)/u*100).toFixed(2));if(n.style.left){var l=parseInt(n.style.left);this.setStyle({left:"".concat(l+c+.5,"%")})}}if(s>=u){var f=Number(((Math.abs(s)-u)/u*100).toFixed(2));if(n.style.left){var h=parseInt(n.style.left);this.setStyle({left:"".concat(h-f-.5,"%")})}}}if(_.addClass(this.root,"show"),"boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide){var p=n.interval||r;this.intervalId=setTimeout(function(){e.hide()},p)}}}},{key:"hide",value:function(){this.root&&(_.removeClass(this.root,"show"),_.removeClass(this.root,"arrow"),this.root.removeAttribute("style")),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(eV.CONTROLS_FOLLOW,'">\n <span class="xgplayer-prompt-detail"></span>\n </xg-prompt>')}}],aw(i.prototype,r),o&&aw(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN),aP={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function aO(t){Object.keys(aP).map(function(e){void 0===t[e]&&(t[e]=aP[e])})}var aT={initDots:function(){this.createDots(this._ispots,!1),this._ispotsInit=!0},createDots:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!!Array.isArray(e)&&!!e.length){var i=this.player.plugins.progress;if(i&&i.outer){var r=document.createDocumentFragment();e.forEach(function(e){var i=t._createDotElement(e,n);i&&r.appendChild(i)}),i.outer.appendChild(r)}}},createDot:function(t){var e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this._createDotElement(t,e);if(n){var i=this.player.plugins.progress;i.outer&&i.outer.appendChild(n)}},_createDotElement:function(t){var e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!this.player.plugins.progress)return null;if(e&&(aO(t),this._ispots.push(t)),!this._ispotsInit&&e)return null;var n=this.calcuPosition(t.time,t.duration),i=t.style||{},r=t.stylePreferred;i.left=r&&void 0!==i.left?i.left:"".concat(n.left,"%"),i.width=r&&void 0!==i.width?i.width:"".concat(n.width,"%");var o="xgspot_".concat(t.id," xgplayer-spot");n.isMini&&(o+=" mini");var a=_.createDom("xg-spot",t.template||"",{"data-text":t.text,"data-time":t.time,"data-id":t.id},o);return Object.keys(i).forEach(function(t){a.style[t]=i[t]}),a},findDot:function(t){if(!!this.player.plugins.progress){var e=this._ispots.filter(function(e,n){return e.id===t});return e.length>0?e[0]:null}},updateDot:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.plugins.progress;if(!n)return;var i=this.findDot(t.id);if(i&&Object.keys(t).map(function(e){i[e]=t[e]}),!this._ispotsInit)return;var r=n.find('xg-spot[data-id="'.concat(t.id,'"]'));if(!!r){var o=this.calcuPosition(t.time,t.duration),a=t.style||{};a.left="".concat(o.left,"%"),a.width="".concat(o.width,"%"),r.setAttribute("data-text",t.text),r.setAttribute("data-time",t.time),o.isMini?_.addClass(r,"mini"):_.removeClass(r,"mini"),Object.keys(a).map(function(t){r.style[t]=a[t]}),e&&this.showDot(t.id)}},deleteDot:function(t){var e=this._ispots,n=this.player.plugins.progress;if(!!n){for(var i=[],r=0;r<e.length;r++)e[r].id===t&&i.push(r);for(var o=i.length,a=o-1;a>=0;a--)if(e.splice(i[a],1),this._ispotsInit){var s=n.find('xg-spot[data-id="'.concat(t,'"]'));s&&s.parentElement.removeChild(s)}}},deleteAllDots:function(){var t=this.player.plugins.progress;if(!!t){if(!this._ispotsInit){this._ispots=[];return}for(var e=t.root.getElementsByTagName("xg-spot"),n=e.length-1;n>=0;n--)t.outer.removeChild(e[n]);this._ispots=[]}},updateAllDots:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.player.plugins.progress;if(!!n){if(!this._ispotsInit){this._ispots=e;return}this._ispots=[];var i=n.root.getElementsByTagName("xg-spot"),r=i.length;if(r>e.length)for(var o=r-1;o>e.length-1;o--)n.outer.removeChild(i[o]);e.map(function(e,n){n<r?(i[n].setAttribute("data-id","".concat(e.id)),t._ispots.push(e),t.updateDot(e)):t.createDot(e)})}},updateAllDotsStyles:function(){var t=this,e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],n=this.player.plugins.progress;if(!!(null!=n&&n.root))for(var i=n.root.getElementsByTagName("xg-spot"),r=function(n){var r=(n=i[a]).getAttribute("data-id"),s=t.findDot(r);if(s&&s.activeStyle&&s.style&&s.stylePreferred){var u=e?null==s?void 0:s.activeStyle:null==s?void 0:s.style;u&&Object.keys(u).map(function(t){n.style[t]=u[t]})}o=n},o,a=0;a<i.length;a++)r(o)},getAllDotsDom:function(){var t=this.player.plugins.progress;return t?t.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(t){var e=this.player.plugins.progress;if(!!e)return e.find('xg-spot[data-id="'.concat(t,'"]'))}};function aE(t){return(aE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aC(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,aL(i.key),i)}}function ax(t,e){return(ax=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function aj(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aR(t){return(aR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function aA(t,e,n){return(e=aL(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aL(t){var e=function(t,e){if("object"!==aE(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==aE(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===aE(e)?e:String(e)}var aI={dragmove:"onProgressDragMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMouseEnter",mouseleave:"onProgressMouseLeave"},aD=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ax(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=aR(e);return t=n?Reflect.construct(i,arguments,aR(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===aE(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return aj(t)}(this,t)});function s(t){var e;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),aA(aj(e=a.call(this,t)),"onMousemove",function(t){if(!e.config.disable){if(_.hasClass(t.target,"xg-spot-content")&&e.config.isHideThumbnailHover){e.player.plugins.progress.onMouseLeave(t);return}(e._state.f||_.hasClass(t.target,"xg-spot-content"))&&(_.event(t),t.stopPropagation())}}),aA(aj(e),"onMousedown",function(t){if(!e.config.disable)(e._state.f||_.hasClass(t.target,"xg-spot-content"))&&(_.event(t),t.stopPropagation())}),aA(aj(e),"onMouseup",function(t){if(!!e.isDrag){var n=e.player.plugins.progress;n&&n.pos&&(n.onMouseUp(t),n.pos.isEnter||n.onMouseLeave(t))}}),aA(aj(e),"onDotMouseLeave",function(t){if(!e.config.disable){e._curDot.removeEventListener("mouseleave",e.onDotMouseLeave),e.blurDot(t.target),e._curDot=null;var n=e.player.plugins.progress;n&&n.enableBlur(),e.show()}}),aA(aj(e),"onProgressMouseLeave",function(t,n){e.updateAllDotsStyles(!1)}),aA(aj(e),"onProgressMouseOver",function(t,n){if(!e.config.disable&&!!e.player){var i,r=n.target,o=e.player.plugins.progress,a=!!(null!=o&&null!==(i=o.config)&&void 0!==i&&i.resetBlur);if(_.hasClass(r,"xgplayer-spot")&&(!e._curDot||a&&!e._curDot.contains(r)&&e._curDot!==r)){var s=e._curDot;e._curDot=r,null==s||s.removeEventListener("mouseleave",e.onDotMouseLeave),e._curDot.addEventListener("mouseleave",e.onDotMouseLeave),e.focusDot(r),e._curDot.children.length>0&&e.hide(),null==o||o.disableBlur()}else a&&(null==o||o.enableBlur())}}),e._ispots=[],e.videoPreview=null,e.videothumbnail=null,e.thumbnail=null,e._state={now:0,f:!1},e}return i=s,o=[{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,isDotAdaptWidth:!0}}}],r=[{key:"beforeCreate",value:function(t){var e=t.player.plugins.progress;e&&(t.root=e.root)}},{key:"afterCreate",value:function(){var t,e,n,i,r=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",function(t,e){e.time&&r.player.seek(e.time)}),t=this,e=t.config,n=t.player,Object.keys(aT).map(function(e){t[e]=aT[e].bind(t)}),i=n.config.progressDot||e.ispots||[],t._ispots=i.map(function(t){return aO(t),t}),t._ispotsInit=!1,n.once(F,function(){t.initDots()}),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(t){var e=this;if(!!t)Object.keys(t).map(function(n){e.config[n]=t[n]})}},{key:"onPluginsReady",value:function(){if(!!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 t=this,e=this.player.plugins.progress;if(!!e){if(Object.keys(aI).map(function(n){t[aI[n]]=t[aI[n]].bind(t),e.addCallBack(n,t[aI[n]])}),"mobile"!==t$.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 n=this.hook("previewClick",function(){});this.handlerPreviewClick=function(e){e.stopPropagation(),n(parseInt(1e3*t._state.now,10)/1e3,e)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}}},{key:"onProgressMouseEnter",value:function(t,e){this.onProgressMove(t,e),this.updateAllDotsStyles(!0)}},{key:"onProgressMove",value:function(t,e){if(!this.config.disable&&!!this.player.duration)this.updatePosition(t.offset,t.width,t.currentTime,t.e)}},{key:"onProgressDragMove",value:function(t,e){if(!this.config.disable&&!!this.player.duration)this.onProgressMove(t,e)}},{key:"onProgressDragStart",value:function(t){if(!this.config.disable&&!!this.player.duration)this.isDrag=!0,this.videoPreview&&_.addClass(this.videoPreview,"show")}},{key:"onProgressDragEnd",value:function(t){if(!this.config.disable&&!!this.player.duration)this.isDrag=!1,this.videoPreview&&_.removeClass(this.videoPreview,"show")}},{key:"onProgressClick",value:function(t,e){if(!this.config.disable){if(_.hasClass(e.target,"xgplayer-spot")){e.stopPropagation(),e.preventDefault();var n={};["time","id","text"].map(function(t){n[t]=e.target.getAttribute("data-".concat(t))}),n.time&&(n.time=Number(n.time)),this.handlerSpotClick(e,n)}}}},{key:"updateLinePos",value:function(t,e){var n,i,r=this.root,o=this.previewLine,a=this.timePoint,s=this.player,u=this.config,c="flex"===s.controls.mode,l=r.getBoundingClientRect().width;if(!!l||!this._hasThumnail){var f=a.getBoundingClientRect().width,h=t-(l=this._hasThumnail&&l<u.width?u.width:l)/2;h<0&&!c?(h=0,n=t-l/2,this.thumbnail||(i=t-l/2-f/2)):h>e-l&&!c?(n=h-(e-l),this.thumbnail||(i=h-(e-l)-f/2),h=e-l):(n=0,this.thumbnail||(i=-f/2)),void 0!==n&&(o.style.transform="translateX(".concat(n.toFixed(2),"px)")),void 0!==i&&(a.style.transform="translateX(".concat(i.toFixed(2),"px)")),r.style.transform="translateX(".concat(h.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(t){var e=this.timeText,n=this.timePoint;e.textContent=t,this.thumbnail||(n.textContent=t)}},{key:"updatePosition",value:function(t,e,n,i){var r=this.root,o=this.config,a=this._state;if(!!r){this.updateLinePos(t,e),a.now=n;var s=_.format(n);i&&i.target&&_.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,s),this.focusDot(i.target),a.f=!0,o.isFocusDots&&a.f&&(a.now=parseInt(i.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)}}},{key:"updateThumbnails",value:function(t){var e=this.player,n=this.videoPreview,i=this.config,r=e.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,t,i.width,i.height);var o=n&&n.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,t,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==t$.device){var e=this.player,n=this.config,i=e.getPlugin("thumbnail");if(i&&i.setConfig(t),i&&i.usable&&n.isShowThumbnail)_.removeClass(this.root,"short-line no-thumbnail");else{_.addClass(this.root,"short-line no-thumbnail");return}"short"===n.mode&&_.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=_.createDom("xg-video-preview","",{},"xgvideo-preview"),e.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}}},{key:"calcuPosition",value:function(t,e){var n=this.player.plugins.progress,i=this.player;t+e>i.duration&&(e=i.duration-t);var r={left:t/i.duration*100,width:e/i.duration*100,isMini:!1};if(this.config.isDotAdaptWidth){var o=0;if(i.duration>0){var a=n.root.getBoundingClientRect().width;o=i.duration/a*6}r.isMini=o>e}else r.isMini=!0;return r}},{key:"showDot",value:function(t){var e=this.findDot(t);if(e){var n=this.root.getBoundingClientRect().width,i=e.time/this.player.duration*n;this.updatePosition(i,n,e.time)}}},{key:"focusDot",value:function(t,e){if(!!t)!e&&(e=t.getAttribute("data-id")),_.addClass(t,"active"),this._activeDotId=e}},{key:"blurDot",value:function(t){if(!t){var e=this._activeDotId;t=this.getDotDom(e)}if(!!t)_.removeClass(t,"active"),this._activeDotId=null}},{key:"showTips",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(_.addClass(this.root,"no-timepoint"),!!t)_.addClass(this.find(".xg-spot-content"),"show-text"),e&&"production"===this.config.mode?(_.addClass(this.root,"product"),this.tipText.textContent=t):(_.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?t:"".concat(n," ").concat(t))}},{key:"hideTips",value:function(){_.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",_.removeClass(this.find(".xg-spot-content"),"show-text"),_.removeClass(this.root,"product")}},{key:"hide",value:function(){_.addClass(this.root,"hide")}},{key:"show",value:function(){_.removeClass(this.root,"hide")}},{key:"enable",value:function(){var t=this.config,e=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&t.isShowThumbnail&&this.registerThumbnail(e.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var t=this,e=this.player.plugins.progress;e&&Object.keys(aI).map(function(n){e.removeCallBack(n,t[aI[n]])}),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"===t$.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info '.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>')}}],aC(i.prototype,r),o&&aC(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function aN(t){return(aN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aM(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==aN(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==aN(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===aN(e)?e:String(e)}(i.key),i)}}function aB(t,e){return(aB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function aF(t){return(aF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var aH=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&aB(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=aF(e);return t=n?Reflect.construct(i,arguments,aF(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===aN(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t){var e;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this,t)).ratio=1,e.interval=null,e._preloadMark={},e}return i=s,o=[{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}}}],r=[{key:"afterCreate",value:function(){var t=this;this.usable&&this.initThumbnail(),this.on([F],function(){var e=t.config,n=e.pic_num,i=e.interval;t.usable&&(t.interval=i>0?i:Math.round(1e3*t.player.duration/n)/1e3)})}},{key:"setConfig",value:function(t){var e=this;if(!t)return;var n=Object.keys(t);if(!(n.length<1))n.forEach(function(n){e.config[n]=t[n]}),this.usable&&this.initThumbnail()}},{key:"usable",get:function(){var t=this.config,e=t.urls,n=t.pic_num;return e&&e.length>0&&n>0}},{key:"initThumbnail",value:function(){var t=this.config,e=t.width,n=t.height,i=t.pic_num,r=t.interval;this.ratio=e/n*100,this.interval=r||Math.round(this.player.duration/i),this._preloadMark={}}},{key:"getUrlByIndex",value:function(t){return t>=0&&t<this.config.urls.length?this.config.urls[t]:""}},{key:"preload",value:function(t){var e=this;if(!this._preloadMark[t]){var n=this.config.urls,i=n.length,r=[];t>0&&r.push(t-1),r.push(t),t>0&&t<i-1&&r.push(t+1),r.map(function(t){!e._preloadMark[t]&&t>=0&&t<i&&(e._preloadMark[t]=1,_.preloadImg(n[t],function(){e._preloadMark[t]=2}))})}}},{key:"getPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,r=i.pic_num,o=i.row,a=i.col,s=i.width,u=i.height;this.interval=Math.round(this.player.duration/r);var c=Math.ceil(t/this.interval),l=(c=c>r?r:c)<o*a?0:Math.ceil(c/(o*a))-1,f=c-a*o*l,h=f>0?Math.ceil(f/a)-1:0,p=f>0?f-h*a-1:0,d=0,y=0;e&&n?e/n<s/u?d=s/u*(y=n):y=(d=e)/(s/u):n?!e&&(y=n||u,d=s/u*y):y=(d=e||s)/(s/u);var v=this.getUrlByIndex(l);return{urlIndex:l,rowIndex:h,colIndex:p,url:v,height:y,width:d,style:{backgroundImage:"url(".concat(v,")"),backgroundSize:"".concat(d*a,"px auto"),backgroundPosition:"-".concat(p*d,"px -").concat(h*y,"px"),width:"".concat(d,"px"),height:"".concat(y,"px")}}}},{key:"update",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=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 u=this.getPosition(e,n,i);this.preload(u.urlIndex),Object.keys(u.style).map(function(e){t.style[e]=u.style[e]}),Object.keys(r).map(function(e){t.style[e]=r[e]})}}},{key:"changeConfig",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(t)}},{key:"createThumbnail",value:function(t,e){var n=_.createDom("xg-thumbnail","",{},"thumbnail ".concat(e));return t&&t.appendChild(n),n}}],aM(i.prototype,r),o&&aM(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function aU(t){return(aU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aW(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==aU(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==aU(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===aU(e)?e:String(e)}(i.key),i)}}function aV(t,e){return(aV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function aG(t){return(aG=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var az=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&aV(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=aG(e);return t=n?Reflect.construct(i,arguments,aG(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===aU(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,o=[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{}}}],r=[{key:"afterCreate",value:function(){}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},e=arguments.length>1?arguments[1]:void 0;if(!!e&&!!this.root)t.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(t.cached/e*100,"%")),t.played&&(this.find("xg-mini-progress-played").style.width="".concat(t.played/e*100,"%"))}},{key:"render",value:function(){if(!!this.playerConfig.progress&&!!this.playerConfig.miniprogress)return'<xg-mini-progress class="xg-mini-progress">\n <xg-mini-progress-cache class="xg-mini-progress-cache"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played"></xg-mini-progress-played>\n </xg-mini-progress>'}}],aW(i.prototype,r),o&&aW(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function aK(t){return(aK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aY(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,a$(i.key),i)}}function aX(t,e){return(aX=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function aq(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aJ(t){return(aJ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function aZ(t,e,n){return(e=a$(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a$(t){var e=function(t,e){if("object"!==aK(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==aK(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===aK(e)?e:String(e)}var aQ={REAL_TIME:"realtime",FIRST_FRAME:"firstframe",POSTER:"poster"},a0=null,a1=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&aX(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=aJ(e);return t=n?Reflect.construct(i,arguments,aJ(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===aK(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return aq(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return aZ(aq(t=a.call.apply(a,[this].concat(n))),"onLoadedData",function(e){if(!!t.player)t._frameCount=t.config.startFrameCount,t.stop(),t.renderOnTimeupdate(e),t.off(D,t.renderOnTimeupdate),t.on(D,t.renderOnTimeupdate)}),aZ(aq(t),"onVisibilitychange",function(e){"visible"===document.visibilityState?t._checkIfCanStart()&&t.start():"hidden"===document.visibilityState&&t.stop()}),aZ(aq(t),"renderOnTimeupdate",function(e){if(t._frameCount>0)t.renderOnce(),t._frameCount--;else{t._isLoaded=!0,t.off(D,t.renderOnTimeupdate);var n=t.config.startInterval;!t.player.paused&&t._checkIfCanStart()&&t.start(0,n)}}),aZ(aq(t),"start",function(e,n){var i=t.player.video,r=function(){try{return parseInt(window.performance.now(),10)}catch(t){return new Date().getTime()}}(),o=t.checkVideoIsSupport(i);if(!!o&&!!t.canvasCtx)!n&&(n=t.interval),t.stop(),i.videoWidth&&i.videoHeight&&(t.videoPI=i.videoHeight>0?parseInt(i.videoWidth/i.videoHeight*100,10):0,t.config.mode===aQ.REAL_TIME?(i&&i.videoWidth&&t.update(o,t.videoPI),t.preTime=r):r-t.preTime>=n&&(i&&i.videoWidth&&t.update(o,t.videoPI),t.preTime=r)),t.frameId="timer"===t._loopType?_.setTimeout(aq(t),t.start,n):_.requestAnimationFrame(t.start)}),aZ(aq(t),"stop",function(){t.frameId&&("timer"===t._loopType?_.clearTimeout(aq(t),t.frameId):_.cancelAnimationFrame(t.frameId),t.frameId=null)}),t}return i=s,r=[{key:"afterCreate",value:function(){var t=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),!s.isSupport&&(this.config.disable=!0);var e=this.config,n=e.disable,i=e.mode,r=e.frameRate;if(n)return;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/r,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==aQ.REAL_TIME&&this.interval>=1e3?"timer":"animation";var o=function(){if(!!t.player)t.init(),t.renderByPoster(),!t.player.paused&&t.start()};if(this.player.hasStart?o():this.once(ti,o),i!==aQ.POSTER)i!==aQ.FIRST_FRAME&&(this.on(K,function(){t.stop()}),this.on(C,function(){var e=t.config.startInterval;t._checkIfCanStart()&&t.start(0,e)}),this.on(R,function(){t.stop()})),this.on(U,this.onLoadedData),this.on(z,function(){t._isLoaded=!1,t.stop()}),document.addEventListener("visibilitychange",this.onVisibilitychange)}},{key:"setConfig",value:function(t){var e=this;Object.keys(t).forEach(function(n){"root"===n&&t[n]!==e.config[n]?e.reRender(t[n]):"frameRate"===n?e.interval=parseInt(1e3/t[n],10):"disable"===n&&t[n]&&e.stop(),e.config[n]=t[n]})}},{key:"init",value:function(t){var e=this.player,n=this.config;this.canvasFilter=s.supportCanvasFilter();try{var i=t||n.root;!i&&(i=n.isInnerRender&&e.innerContainer||e.root),i.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg" data-index="'.concat(n.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=i.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(t){v.logError("plugin:DynamicBg",t)}}},{key:"reRender",value:function(t){if(!!this.config.disable||!!this.root){this.stop();var e=this.root?this.root.parentElement:null;if(e!==t&&e.removeChild(this.root),!t){this.root=null;return}this.init(t),this.renderOnce();var n=this.config.startInterval;this._checkIfCanStart()&&this.start(0,n)}}},{key:"checkVideoIsSupport",value:function(t){if(!t)return null;var e=t&&t instanceof window.HTMLVideoElement?t:t.canvas?t.canvas:t.flyVideo?t.flyVideo:null;if(e&&!("safari"===t$.browser&&_.isMSE(e)))return e;var n=e?e.tagName.toLowerCase():"";return"canvas"===n||"img"===n?e:null}},{key:"renderByPoster",value:function(){var t=this.playerConfig.poster;if(t){var e="String"===_.typeOf(t)?t:"String"===_.typeOf(t.poster)?t.poster:null;this.updateImg(e)}}},{key:"_checkIfCanStart",value:function(){var t=this.config.mode;return this._isLoaded&&!this.player.paused&&t!==aQ.FIRST_FRAME&&t!==aQ.POSTER}},{key:"renderOnce",value:function(){var t=this.player.video;if(!!t.videoWidth&&!!t.videoHeight){this.videoPI=parseInt(t.videoWidth/t.videoHeight*100,10);var e=this.checkVideoIsSupport(t);e&&this.update(e,this.videoPI)}}},{key:"updateImg",value:function(t){var e=this;if(!!t){var n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,o=new window.Image;o.onload=function(){if(!!e.canvas&&!e.frameId&&!e.isStart){e.canvas.height=r,e.canvas.width=i;var t=parseInt(i/r*100,10);e.update(o,t),o=null}},o.src=t}}},{key:"update",value:function(t,e){if(!!this.canvas&&!!this.canvasCtx&&!!e)try{var n=this._pos,i=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,a=r.height;if(o!==n.width||a!==n.height||n.pi!==e){var s=parseInt(o/a*100,10);n.pi=e,n.width!==o&&(n.width=this.canvas.width=o),n.height!==a&&(n.height=this.canvas.height=a);var u=a,c=o;s<e?c=parseInt(a*e/100,10):s>e&&(u=parseInt(100*o/e,10)),n.rwidth=c*i.multiple,n.rheight=u*i.multiple,n.x=(o-n.rwidth)/2,n.y=(a-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(t,n.x,n.y,n.rwidth,n.rheight)}catch(t){v.logError("plugin:DynamicBg",t)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],o=[{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 a0?a0:a0=function(){try{if(document.createElement("canvas").getContext)return!0;return!1}catch(t){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===t$.browser||"firefox"===t$.browser)}}],r&&aY(i.prototype,r),o&&aY(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function a2(t){return(a2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function a4(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a3(Object(n),!0).forEach(function(e){a7(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a3(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function a5(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,st(i.key),i)}}function a6(t,e){return(a6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function a9(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a8(t){return(a8=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a7(t,e,n){return(e=st(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function st(t){var e=function(t,e){if("object"!==a2(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==a2(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===a2(e)?e:String(e)}var se="info",sn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a6(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=a8(e);return t=n?Reflect.construct(i,arguments,a8(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===a2(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return a9(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return a7(a9(t=a.call.apply(a,[this].concat(n))),"_recordUserActions",function(e){var n=t._getTime(),i=Object.assign({},e,{msg:e.msg||e.action});t._stats[se].push(a4(a4({type:"userAction"},n),{},{payload:i}))}),a7(a9(t),"_onReset",function(){t.reset()}),a7(a9(t),"_recordInfo",function(e){t.info(e)}),a7(a9(t),"_downloadStats",function(){var e=new Blob([JSON.stringify(t.getStats())],{type:"application/json"}),n=window.URL.createObjectURL(e),i=document.createElement("a");i.style.display="none",i.href=n,i.download="player.txt",i.disabled=!1,i.click()}),t}return i=s,o=[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}],r=[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:new Date().toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(tT,this._recordUserActions),this.on(tA.STATS_INFO,this._recordInfo),this.on(tA.STATS_DOWNLOAD,this._downloadStats),this.on(tA.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(t){t.profile?this._infoProfile(t):this._info(t)}},{key:"_info",value:function(t){var e=this._getTime();this._stats[se].push(a4(a4({},e),{},{payload:t}))}},{key:"_infoProfile",value:function(t){if(t&&t.startMs){var e=a4({cat:"function",dur:Date.now()-t.startMs,name:t.name||t.msg,ph:"X",pid:0,tid:0,ts:t.startMs,profile:!0},t);this._info(e)}}},{key:"reset",value:function(){var t;this._stats=(a7(t={},se,[]),a7(t,"media",{}),t)}},{key:"getStats",value:function(){for(var t=this.player.video,e=[],n=0;n<t.buffered.length;n++)e.push({start:t.buffered.start(n),end:t.buffered.end(n)});var i={currentTime:t.currentTime,readyState:t.readyState,buffered:e,paused:t.paused,ended:t.ended};return this._stats.media=i,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){return this._stats[se].map(function(t){var e=t.payload.data,n="";try{e instanceof Error?n=e.msg:void 0!==e&&(n=JSON.stringify(e))}catch(t){}return"[".concat(t.timeFormat,"] : ").concat(t.payload.msg," ").concat(n," ")})}},{key:"_getProfile",value:function(){var t={traceEvents:[]};return this._stats[se].forEach(function(e){e.payload.profile&&t.traceEvents.push(e.payload)}),t}}],a5(i.prototype,r),o&&a5(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eS);function si(t){return(si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sr(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,su(i.key),i)}}function so(t,e){return(so=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function sa(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ss(t){return(ss=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function su(t){var e=function(t,e){if("object"!==si(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==si(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===si(e)?e:String(e)}var sc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&so(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=ss(e);return t=n?Reflect.construct(i,arguments,ss(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===si(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return sa(t)}(this,t)});function s(){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var t,e,n,i,r=arguments.length,o=Array(r),u=0;u<r;u++)o[u]=arguments[u];return e=sa(t=a.call.apply(a,[this].concat(o))),n="onGapJump",i=function(){var e=sa(t),n=e.player,i=e.config;if(n.video.readyState===HTMLMediaElement.HAVE_NOTHING)return;if(n.video.seeking){if(!t.seekingEventReceived)return}else t.seekingEventReceived=!1;if(n.video.paused&&0!==n.video.currentTime&&t.hasPlayed)return;var r=n.video.buffered,o=i.smallGapLimit||.5,a=i.gapDetectionThreshold||.3,u=n.video.currentTime,c=t._getIndex(r,u,a);if(null===c||0===c)return;var l=r.start(c)+.1;if(l>n.video.duration)return;var f=l-u;if(!(f<s.BROWSER_GAP_TOLERANCE))f<=o&&(!1!==i.useGapJump&&(n.video.currentTime=t.isSafari?l+.1:l),t.player&&t.player.emit("detectGap"),.08!==l&&n&&n.emit("log",{type:"oneevent",end_type:"gap",vid:n.config.vid,ext:{video_postion:Math.floor(1e3*l)}}))},(n=su(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,t}return i=s,o=[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}],r=[{key:"afterCreate",value:function(){var t=this;if(!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(N,this.onGapJump),this.on(C,function(){t.hasPlayed=!0}),this.on(L,function(){t.seekingEventReceived=!0})}},{key:"_getIndex",value:function(t,e,n){if(!t||!t.length||1===t.length&&t.end(0)-t.start(0)<1e-6)return null;for(var i=this._getBuffered(t),r=null,o=0;o<i.length;o++)if(i[o].start>e&&(0===o||i[o-1].end-e<=n)){r=o;break}return r}},{key:"_getBuffered",value:function(t){if(!t)return[];for(var e=[],n=0;n<t.length;n++)e.push({start:t.start(n),end:t.end(n)});return e}}],sr(i.prototype,r),o&&sr(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function sl(t){return(sl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}sc.BROWSER_GAP_TOLERANCE=.001;function sf(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,sv(i.key),i)}}function sh(t,e){return(sh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function sp(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sd(t){return(sd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function sy(t,e,n){return(e=sv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sv(t){var e=function(t,e){if("object"!==sl(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==sl(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===sl(e)?e:String(e)}var sg=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sh(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=sd(e);return t=n?Reflect.construct(i,arguments,sd(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===sl(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return sp(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return sy(sp(t=a.call.apply(a,[this].concat(n))),"onWaiting",function(){var e=sp(t).config;if(!(t.jumpCnt>e.jumpCntMax)&&!t.timer&&!1!==e.useWaitingTimeoutJump)t.timer=setTimeout(t.onJump,1e3*e.waitingTime)}),sy(sp(t),"onJump",function(){var e=sp(t),n=e.player,i=e.config;if(clearTimeout(t.timer),t.timer=null,t.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||n.video.paused&&0!==n.video.currentTime&&t.hasPlayed)return;t.jumpSize=i.jumpSize*(t.jumpCnt+1),t.jumpCnt===i.jumpSize&&t.jumpSize<6&&(t.jumpSize=6);var r=n.currentTime+t.jumpSize;if(!(r>n.video.duration))t.jumpCnt++,n.currentTime=r}),t}return i=s,o=[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}],r=[{key:"afterCreate",value:function(){var t=this,e=this.config,n=e.useWaitingTimeoutJump,i=e.jumpSize;if(!1!==n)this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on(N,this.onWaiting),this.on([x,M],function(){clearTimeout(t.timer),t.timer=null,t.jumpSize=t.config.jumpSize}),this.on(C,function(){t.hasPlayed=!0})}}],sf(i.prototype,r),o&&sf(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function sm(t){return(sm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sb(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function sw(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,sO(i.key),i)}}function sk(t,e){return(sk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function s_(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sS(t){return(sS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function sP(t,e,n){return(e=sO(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sO(t){var e=function(t,e){if("object"!==sm(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==sm(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===sm(e)?e:String(e)}var sT=["cdn"],sE=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sk(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=sS(e);return t=n?Reflect.construct(i,arguments,sS(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===sm(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return s_(t)}(this,t)});function s(){var t;!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s);for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return sP(s_(t=a.call.apply(a,[this].concat(n))),"startTimer",function(){if(!_.isMSE(t.player.video))t.cnt=0,t.timer=setTimeout(t.testSpeed,t.config.testTimeStep)}),sP(s_(t),"initSpeedList",function(){sT.forEach(function(t){s.speedListCache[t]||(s.speedListCache[t]=[])})}),sP(s_(t),"_onRealSpeedChange",function(e){e.speed&&t.appendList(e.speed,e.len,e.time,e.type||"cdn")}),sP(s_(t),"testSpeed",function(){if(clearTimeout(t.timer),t.timer=null,t.player&&t.config.openSpeed){var e=t.config,n=e.url,i=e.loadSize,r=e.testCnt,o=e.testTimeStep,a=n+(0>n.indexOf("?")?"?testst=":"&testst=")+Date.now();if(!(t.cnt>=r)){t.cnt++;try{var s=new Date().getTime(),u=null,c=new XMLHttpRequest;t.xhr=c,c.open("GET",a);var l={},f=Math.floor(10*Math.random());l.Range="bytes="+f+"-"+(i+f),l&&Object.keys(l).forEach(function(t){c.setRequestHeader(t,l[t])}),c.onreadystatechange=function(){if(4===c.readyState){t.xhr=null,u=new Date().getTime();var e=c.getResponseHeader("Content-Length")/1024*8,n=u-s,i=Math.round(1e3*e/n);t.appendList(i,e,n),t.timer=setTimeout(t.testSpeed,o)}},c.send()}catch(t){}}}}),sP(s_(t),"appendList",function(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"cdn";if(s.speedListCache&&s.speedListCache[r]){var o=t.config.saveSpeedMax;s.speedListCache[r].length>=o&&s.speedListCache[r].shift(),s.speedListCache[r].push({speed:e,bytes:n,time:i});var a=s_(t).player;a&&("cdn"===r?a.realTimeSpeed=e:a[t.getSpeedName("realTime",r)]=e),t.updateSpeed(r)}}),sP(s_(t),"updateSpeed",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cdn",n=s.getAvgSpeedKbs(e),i=s_(t).player;if(i){if("cdn"===e)(!i.avgSpeed||n!==i.avgSpeed)&&(i.avgSpeed=n,i.emit(ts,{speed:n,realTimeSpeed:i.realTimeSpeed}));else{var r=t.getSpeedName("avg",e);(!i[r]||n!==i[r])&&(i[r]=n,i.emit(ts,{speed:n,realTimeSpeed:i.realTimeSpeed}))}}}),t}return i=s,r=[{key:"afterCreate",value:function(){var t,e=this.config,n=e.openSpeed,i=e.addSpeedTypeList,r=e.testCnt;if((null==i?void 0:i.length)>0){;sT.push.apply(sT,function(t){if(Array.isArray(t))return sb(t)}(t=i)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return sb(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sb(t,e)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}if(this.initSpeedList(),!!n)this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,r>0&&this.on([U,tr],this.startTimer)}},{key:"getSpeedName",value:function(t,e){return t+"Speed"+e.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(t){if(this.config.openSpeed=t,!t&&this.timer){clearTimeout(this.timer),this.timer=null;return}if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){this.off("real_time_speed",this._onRealSpeedChange),this.off([U,tr],this.startTimer),clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],o=[{key:"pluginName",get:function(){return"testspeed"}},{key:"speedSampleList",get:function(){return s.speedListCache}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:20,addSpeedTypeList:[]}}},{key:"getAvgSpeedKbs",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cdn";if(!s.speedListCache||!s.speedListCache[t]||s.speedListCache[t].length<=0)return -1;var e=0;return s.speedListCache[t].map(function(t){e+=t.speed}),Math.floor(e/s.speedListCache[t].length)}},{key:"getWeightedSpeedKbs",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cdn",e=-1;if(!s.speedListCache||!s.speedListCache[t]||s.speedListCache[t].length<=0)return e;var n=[];s.speedListCache[t].forEach(function(t){n.push(t)}),n.sort(function(t,e){return t.speed-e.speed});for(var i=n.length,r=0,o=0;o<i;o++)r+=n[o].bytes;r/=2;for(var a=0;a<i;a++)(r-=n[a].bytes)<=0&&(e=n[a].speed);return e<0?-1:e}}],r&&sw(i.prototype,r),o&&sw(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function sC(t){return(sC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}sP(sE,"speedListCache",{});function sx(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==sC(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==sC(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===sC(e)?e:String(e)}(i.key),i)}}function sj(t,e){return(sj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function sR(t){return(sR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var sA=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sj(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=sR(e);return t=n?Reflect.construct(i,arguments,sR(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===sC(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,o=[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}],r=[{key:"afterCreate",value:function(){var t=this,e=this.player,n=this.config,i=e.media||e.video;!n.disabled&&i.getVideoPlaybackQuality&&(this.timer=null,this._resetData(),this.on(z,function(){t._resetData(),t._stopTick()}),this.on(C,function(){t._startTick()}),this.on(R,function(){t._stopTick()}),this.on(j,function(){t._stopTick()}),this.on(K,function(){t._stopTick()}))}},{key:"_startTick",value:function(){var t=this;this._stopTick(),this._timer=setTimeout(function(){t._checkDecodeFPS(),t._startTick()},this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkBuffer",value:function(t,e){for(var n=!1,i=[],r=0;r<e.length;r++){var o=e.start(r),a=e.end(r);if(i.push({start:o,end:a}),o<=t&&t<=a-1){n=!0;break}}return{enoughBuffer:n,buffers:i}}},{key:"_checkStuck",value:function(t,e,n,i){var r=this.player.media||this.player.video,o=document.hidden,a=r.paused,s=r.readyState,u=r.currentTime,c=r.buffered;if(o||a||s<4)return;var l=this._checkBuffer(u,c),f=l.enoughBuffer,h=l.buffers;if(!!f)t<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({currentTime:u,buffers:h,curDecodedFrames:t,totalVideoFrames:e,droppedVideoFrames:n,checkInterval:i}),this._currentStuckCount>=this.config.stuckCount&&(this.emit(tL,this._payload),this._resetCheck())):this._resetCheck()}},{key:"_resetCheck",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_resetData",value:function(){this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[]}},{key:"_checkDecodeFPS",value:function(){var t,e,n=(null===(t=this.player)||void 0===t?void 0:t.media)||(null===(e=this.player)||void 0===e?void 0:e.video);if(!n){this._stopTick();return}var i=n.getVideoPlaybackQuality(),r=i.totalVideoFrames,o=i.droppedVideoFrames,a=performance.now();if(r&&this._lastCheckPoint){var s=r-this._lastDecodedFrames,u=a-this._lastCheckPoint;this._checkStuck(s,r,o,u)}this._lastDecodedFrames=r,this._lastCheckPoint=a}},{key:"destroy",value:function(){this._stopTick(),this._resetData()}}],sx(i.prototype,r),o&&sx(i,o),Object.defineProperty(i,"prototype",{writable:!1}),s}(eN);function sL(t){return(sL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sI(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function sD(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==sL(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==sL(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===sL(e)?e:String(e)}(i.key),i)}}e7.use({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:"直播"}});var sN=(r=function t(e,n){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,t);var i,r,o,a,s=n&&"mobile"===n.isMobileSimulateMode,u=n.isLive,c=[].concat(u?[]:[rw,az,aD,r1],[rN,rq,os,oR,ae,as,oU,oY,r7,oP]),l=[nU,nK,n1,ro,n6,am,aS,aH,iP];this.plugins=[nN,sn,sg,sc].concat(function(t){if(Array.isArray(t))return sI(t)}(i=c)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||function(t,e){if(t){if("string"==typeof t)return sI(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sI(t,e)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l);var f=s?"mobile":t$.device;switch(f){case"pc":(r=this.plugins).push.apply(r,[rt,iI,ap,sE,sA]);break;case"mobile":(o=this.plugins).push.apply(o,[i0]);break;default:(a=this.plugins).push.apply(a,[rt,iI,ap])}(t$.os.isIpad||"pc"===f)&&this.plugins.push(a1),t$.os.isIpad&&this.plugins.push(iI),this.ignores=[],this.i18n=[]},Object.defineProperty(r,"prototype",{writable:!1}),r);function sM(t){return(sM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sB(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,sW(i.key),i)}}function sF(t,e){return(sF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function sH(t){return(sH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function sU(t,e,n){return(e=sW(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sW(t){var e=function(t,e){if("object"!==sM(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==sM(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===sM(e)?e:String(e)}var sV=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sF(t,e)}(s,t);var e,n,i,r,o,a=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=sH(e);return t=n?Reflect.construct(i,arguments,sH(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===sM(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,s),a.apply(this,arguments)}return i=s,Object.defineProperty(i,"prototype",{writable:!1}),i}(nS);sU(sV,"defaultPreset",sN),sU(sV,"Util",_),sU(sV,"Sniffer",t$),sU(sV,"Errors",E),sU(sV,"Events",u),sU(sV,"Plugin",eN),sU(sV,"BasePlugin",eS),sU(sV,"I18N",e7),sU(sV,"STATE_CLASS",eV),sU(sV,"PAUSE_TYPES",er),sU(sV,"BUFFER_CONTROL_TYPES",eo),sU(sV,"InstManager",ns),sU(sV,"TestSpeed",sE);var sG=sV;try{window.pre_build_xgplayer=c}catch(t){}}(),{}}()});