/*! For license information please see player-9.69ef1934.js.LICENSE.txt */ "use strict";!function(e,t){"object"==typeof module&&"object"==typeof module.exports?t():"function"==typeof define&&define.amd?define([],t):(e="undefined"!=typeof globalThis?globalThis:e||self)&&t()}(this,function(){"use strict";"object"==typeof window&&(window.openRedirect={version:"1.2.20",webpackPluginVersion:"3.4.22",reportOnly:!1})}),!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).xss={})}(this,function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var t,i=1,n=arguments.length;i/g,o=/&#([a-zA-Z0-9]*);?/gim,s=/"/g,u=/:?/gim,l=/&newline;?/gim,c=/((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,d=/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,f=/"/g,p=function(e){return e.replace(r,"<").replace(a,">")},v={indexOf:function(e,t){var i,n;for(i=0,n=e.length;i127&&n<2048?t+=String.fromCharCode(n>>6|192)+String.fromCharCode(63&n|128):t+=String.fromCharCode(n>>12|224)+String.fromCharCode(n>>6&63|128)+String.fromCharCode(63&n|128)}return t}(e);c>2,a=(3&t)<<4|(i=e.charCodeAt(c++))>>4,o=(15&i)<<2|(n=e.charCodeAt(c++))>>6,s=63&n,isNaN(i)?o=s=64:isNaN(n)&&(s=64),l=l+u.charAt(r)+u.charAt(a)+u.charAt(o)+u.charAt(s);return l}function y(e){var t,i,n,r,a,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",l=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");l>4,i=(15&r)<<4|(a=s.indexOf(e.charAt(l++)))>>2,n=(3&a)<<6|(o=s.indexOf(e.charAt(l++))),u+=String.fromCharCode(t),64!==a&&(u+=String.fromCharCode(i)),64!==o&&(u+=String.fromCharCode(n));return function(e){for(var t="",i=0,n=0,r=0,a=0;i191&&n<224?(t+=String.fromCharCode((31&n)<<6|63&(a=e.charCodeAt(i+1))),i+=2):(a=e.charCodeAt(i+1),t+=String.fromCharCode((15&n)<<12|(63&a)<<6|63&(r=e.charCodeAt(i+2))),i+=3);return t}(u)}function b(e,t,i){var n="",r=0,a=!1,o=!1,s=0,u=e.length,l="",c="";e:for(s=0;s"===d||s===u-1){n+=i(e.slice(r,a)),l=function(e){var t,i=v.spaceIndex(e);return t=-1===i?e.slice(1,-1):e.slice(1,i+1),"/"===(t=v.trim(t).toLowerCase()).slice(0,1)&&(t=t.slice(1)),"/"===t.slice(-1)&&(t=t.slice(0,-1)),t}(c=e.slice(a,s+1)),n+=t(a,n.length,l,c,"0;t--){var i=e[t];if(" "!==i)return"="===i?t:-1}return -1}(e,l-1))){u(o,m(v.trim(e.slice(i,l)))),o=!1,i=l+1;continue}}}else{if(-1===(d=e.indexOf(c,l+1)))break;u(o,v.trim(e.slice(r+1,d))),o=!1,i=(l=d)+1}}else o=e.slice(i,l),i=l+1,r='"'===e.charAt(i)||"'"===e.charAt(i)?i:function(e,t){for(;te.charCodeAt(i)?" ":e.charAt(i);return v.trim(t)}(e=(e=(e=e.replace(s,'"')).replace(o,function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))})).replace(u,":").replace(l," "))}(i),"href"===t||"src"===t){if("#"===(i=v.trim(i)))return"#";if("http://"!==i.substr(0,7)&&"https://"!==i.substr(0,8)&&"mailto:"!==i.substr(0,7)&&"tel:"!==i.substr(0,4)&&"data:image/"!==i.substr(0,11)&&"ftp://"!==i.substr(0,6)&&"./"!==i.substr(0,2)&&"../"!==i.substr(0,3)&&"#"!==i[0]&&"/"!==i[0])return""}else if("background"===t){if(c.lastIndex=0,c.test(i))return""}else if("style"===t&&(h.lastIndex=0,h.test(i)||(d.lastIndex=0,d.test(i)&&(c.lastIndex=0,c.test(i)))))return"";return i=function(e){return e=p(e=e.replace(f,"""))}(i)}var S=function(e){return"string"==typeof e?e.replace(/'/g,'"').replace('=""',"").replace(/\s+/g,"").toLowerCase():""},T=function(){function e(e){var t=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{});t.stripIgnoreTag&&(t.onIgnoreTag,t.onIgnoreTag=function(){return""}),t.whiteList={},t.onTag=function(){},t.onTagAttr=function(){},t.onIgnoreTag=function(){},t.onIgnoreTagAttr=function(){},t.safeAttrValue=w,t.escapeHtml=p,this.options=Object.assign(t,e)}return e.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t,i,n,r,a,o,s=this.options,u=s.whiteList,l=s.onTag,c=s.onIgnoreTag,d=s.onTagAttr,h=s.onIgnoreTagAttr,f=s.safeAttrValue,p=s.escapeHtml;s.stripBlankChar&&(e=(t=(t=e.split("")).filter(function(e){var t=e.charCodeAt(0);return!(127===t||t<=31&&10!==t&&13!==t)})).join("")),s.allowCommentTag||(e=function(e){for(var t="",i=0;i");var s=function(e){var t=v.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var i="/"===(e=v.trim(e.slice(t+1,-1)))[e.length-1];return i&&(e=v.trim(e.slice(0,-1))),{html:e,closing:i}}(n),g=u[i],m=k(s.html,function(e,t){var n=-1!==v.indexOf(g,e),r=d(i,e,t,n);return null==r?n?(t=f(i,e,t,null))?"".concat(e,'="').concat(t,'"'):e:null==(r=h(i,e,t,n))?void 0:r:r});return n="<".concat(i),m&&(n+=" ".concat(m)),s.closing&&(n+=" /"),n+=">"}return null==(o=c(i,n,a))?p(n):o},p);return g&&(m=g.remove(m)),m},e}(),x=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")(),C=new(function(){function e(){var e=this;this.batchData=[],this.uniqKeys=new Set,this.timeout=2e3,this.lock=!1,this.getSlardarBid=function(){var t,i,n="douyin_web";if(!v.includes(n,"bid"))return n;if(e.config&&e.config.bid)return e.config.bid;if(x&&x._xssBid)return x._xssBid;if(x&&x.slardar&&"function"==typeof x.slardar.config){var r=(x.slardar.config()||{}).bid;if(r)return r}if(x&&x.Slardar&&"function"==typeof x.Slardar.config){var a=(x.Slardar.config()||{}).bid;if(a)return a}return(null===(i=null===(t=null==x?void 0:x.Slardar)||void 0===t?void 0:t._baseParams)||void 0===i?void 0:i.bid)||"argus"},this.getConfigRegion=function(){var t;return v.includes("cn","region")?e.config&&e.config.region?e.config.region:((null===(t=null==x?void 0:x.gfdatav1)||void 0===t?void 0:t.region)||"cn").toLowerCase():"cn"},this.gerReportUrl=function(){var t={cn:y("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boe:y("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),ttp:y("aHR0cHM6Ly9tb24udXMudGlrdG9rdi5jb20vbW9uaXRvcl9icm93c2VyL2NvbGxlY3QvYmF0Y2gvc2VjdXJpdHkvP2JpZD0="),va:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),maliva:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),sg:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boei18n:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9")}[e.getConfigRegion()];if(t)return t+e.getSlardarBid()}}return e.prototype.setConfig=function(e){this.config=e},e.prototype.upload=function(){var e=this,t=this.gerReportUrl();!this.lock&&t&&0!==this.batchData.length&&(this.lock=!0,setTimeout(function(){var i=e.batchData.slice(0,100);e.batchData=e.batchData.slice(100),x.fetch(t,{method:"post",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}).catch(function(e){}),e.lock=!1,e.upload()},this.timeout))},e.prototype.generateKey=function(e){return e.collectKey?[e.collectMode,e.collectKey].join("___"):""},e.prototype.push=function(e){this.batchData.push(e),this.upload()},e.prototype.report=function(e){var t=this.generateKey(e);if(x.fetch&&e.collectKey){var i="object"==typeof window?window.location.href:"SSR";e.documentUrl=i;var n={age:Math.floor(Date.now()),type:"xss",url:i,body:e,"user-agent":""};"enforce"===e.disposition&&"SSR"!==i||(n.url=t),"SSR"===i&&(n.url="SSR___".concat(n.url),n.body.ssr=!0),this.push(n)}},e}()),P=function(e){for(var t=0,i=function(i){Array.isArray(e[i])?0===e[i].length?delete e[i]:(e[i]=v.from(v.uniq(e[i])),t+=e[i].length):0===v.keys(e[i]).length?delete e[i]:v.keys(e[i]).forEach(function(n){e[i][n]=v.from(v.uniq(e[i][n])),t+=e[i][n].length})},n=0,r=v.keys(e);n0)return t&&t("javascript:"),!1;if(/^javascript:/i.test(e)){var r=e.slice(11).replace(/\s/g,"").trim();return!!v.some(["void","void(0)","void0","false","undefined",";"],function(e){return e===r})||(t&&t("javascript:"),!1)}return!0}var A=function(e,t){var i,n,r="<%= isSaveValidUrl =>";if("string"!=typeof e||(n=Number("<%= urlLimit =>"),void 0!==i&&(n=i),"NaN"!==e.toString()&&-1!==n&&e.length>=n)||L(e,t))return e;try{if(!0===(r=JSON.parse(r))||"true"===r){var a=new URL(e);return a.origin+a.pathname}}catch(e){}return"#"};function O(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=[]),"string"!=typeof e)return!0;if(!L(e=I(e)))return!1;var r,a={url:(r=e.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]},o=a.scheme,s=a.host;return n?!!n(e):!(!o||!s)&&(!v.includes(["http","https","file"],o)||("object"==typeof window&&window&&(t=i(i([],t,!0),[location.host],!1)),v.some(t,function(e){return!!(e instanceof RegExp&&e.test(s))||e===s})))}var R={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:[]},N={collect:null,initCollect:function(){this.collect={whiteList:{},filterProtocol:[]}},removeCollect:function(){var e=P(this.collect),t=e.count,i=e.ret;return this.collect=null,{collectKey:0===t?null:JSON.stringify(i),collectMode:"white"}},onIgnoreTagAttr:function(e,t,n){return e&&v.indexOf(["href","src"],t)>-1?N.domainWhiteList&&Array.isArray(N.domainWhiteList)&&N.domainWhiteList.length>0&&!O(n,i([],N.domainWhiteList,!0))?"":"".concat(t,'="').concat(A(n,function(e){var t;null===(t=N.collect)||void 0===t||t.filterProtocol.push(e)}),'"'):e&&(v.indexOf(["style","class","id"],t)>-1||t.indexOf("data-")>-1)?"".concat(t,'="').concat(n,'"'):(N.collect.whiteList[e]=N.collect.whiteList[e]||[],void N.collect.whiteList[e].push(t))},onIgnoreTag:function(e,t){if("style"===e)return t;b(t,function(e,t,i,n){k(E(n).html.replace("/",""),function(e){N.collect.whiteList[i]=N.collect.whiteList[i]||[],N.collect.whiteList[i].push(e)})},p)},whiteList:R,mergeWhiteList:function(e){for(var t,i={},n=0,r=v.keys(R);n");var a=E(n),o=k(a.html,function(e,t){var n,r=0;if(U.blackList[i]&&v.includes(U.blackList[i],e)&&(q.collect.blackList[i]=q.collect.blackList[i]||[],q.collect.blackList[i].push(e),r++),U.blackAttrRegExps.length&&U.blackAttrRegExps.some(function(t){return t.test(e)})&&v.forEach(U.blackAttrRegExps,function(t){t.test(e)&&(q.collect.blackAttrRegExps.push("".concat(t.toString(),"->").concat(e)),r++)}),U.blackAttrs.length&&v.includes(U.blackAttrs,e)&&(U.blackAttrs.push(e),r++),!r){if(U.filterList&&U.filterList[i]&&v.includes(U.filterList[i],e)){var a=A(t,function(e){var t;null===(t=q.collect)||void 0===t||t.filterProtocol.push(e)});return a!==t&&(q.collect.filterList[i]=q.collect.filterList[i]||[],q.collect.filterList[i].push(e)),t?"".concat(e,"='").concat(a,"'"):e}return U.filterAttrs&&v.includes(U.filterAttrs,e)?((a=A(t,function(e){var t;null===(t=q.collect)||void 0===t||t.filterProtocol.push(e)}))!==t&&(null===(n=q.collect)||void 0===n||n.filterAttrs.push(e)),t?"".concat(e,"='").concat(a,"'"):e):t?"".concat(e,"='").concat(t,"'"):e}});return n="<".concat(i),o&&(n+=" ".concat(o)),a.closing&&(n+=" /"),n+=">"},p);null===(i=q.collect)||void 0===i||i.blackTags.push(e)}},V=function(e){var t=e.reportOnly,i=void 0===t||t,n=e.block;return i&&"all"===i?"report":("string"==typeof i&&("true"===i&&(i=!0),"false"===i&&(i=!1)),n?"enforce":i?"report":"enforce")},H=function(e){return function(i,n,r){if(!i||"string"!=typeof i)return i;var a=n;e===D&&(a=N).initCollect();var o=e(i,a);if(S(o)===S(i))return i;if(!r)return o;var s=r.logType,u=V(r),l=a.removeCollect();return C.report(t(t({type:s,disposition:u},l),{sourceText:_(i),filterText:_(o)})),"enforce"===u?o:i}},W=H(function(e,t){return void 0===t&&(t={}),t&&t.whiteList||(t.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 T(t).process(e)}),z=H(D),J=function(e,t,i){var n=[],r=A(e,function(e){n.push(e)});if(r===e)return e;n=v.from(v.uniq(n));var a=t||i||{};if(!a)return r;var o=a.logType,s=V(i);return C.report({type:o,disposition:s,collectKey:n.join("___"),collectData:JSON.stringify(n),collectMode:"black",sourceText:_(e),filterText:_(r)}),"enforce"===s?r:e},X=x._xssProject||{},K=x.xssNamespace||{},Y="3.0.26",G={FilterXSS:T,version:Y,webpackPluginVersion:"<%= webpackPluginVersion =>",reportOnly:"<%= reportOnly =>",filterXSS:W,_filterXSS:z,filterUrl:J,Config:N,BlackConfig:q,project:X,setProjectName:function(e){X[e]=this,x._xssProjectName=e}};K.douyin_web=G,x.xssNamespace=K,x.Math&&!x.Math.xssNamespace&&(x.Math.xssNamespace=K),X[Y]=G,x.globalThis=x,x.getFilterXss=function(){return void 0!==this._xssProjectName?this._xssProject[this._xssProjectName]:G},x.xss=G,x.isSafeUrl=O,x.isSafeDomain=O,x.isSafeProtocol=L,x._xssProject=X,x._xssProjectName&&(X[x._xssProjectName]=G);var Q=G.setProjectName.bind(G);e.BlackConfig=q,e.Config=N,e.FilterXSS=T,e._filterXSS=z,e.filterUrl=J,e.filterXSS=W,e.isSafeDomain=O,e.isSafeProtocol=L,e.isSafeUrl=O,e.project=X,e.setProjectName=Q,e.setXssNamespace=function(e){var t=e.appId,i=e.bid,n=e.region;K[t]=G;N.bid=i,N.region=n,N.enabled=!0},e.xssNamespace=K,Object.defineProperty(e,"__esModule",{value:!0})}),(self.webpackChunkdouyin_web=self.webpackChunkdouyin_web||[]).push([["60945"],{61072:function(e,t,i){function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(u&&l){if(this.prev=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),P(i),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;P(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:E(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function _(e,t){return(_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t,i,n){var r=d(h(1&n?e.prototype:e),t,i);return 2&n&&"function"==typeof r?function(e){return r.apply(i,e)}:r}function b(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=({}).toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e)||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 k(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}},107093:function(e,t,i){i.d(t,{Z:function(){return a}});var n=i(61072);i(346984),i(705574),i(124300),i(802824),i(162093),i(173757),i(232070),i(2885),i(248385),i(374285),i(759943),i(414931),i(240148),i(683656),i(832674),i(905442),i(446336),i(808483),i(840938),i(118438),i(325598),i(92999),i(611067),i(273723),i(724016),i(803903),i(214604),i(901250),i(755006),i(437048),i(488336),i(825666),i(177162),i(286633),i(943281),i(810658),i(82726),i(224727),i(663030);var r=i(861504);let a={findBox:function e(t,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(t.type!==i){if(t&&t.subBox){var a=t.subBox.filter(function(e){return e.type===i});a.length?a.forEach(function(e){return r.push(e)}):t.subBox.forEach(function(t){return e(t,i,r)})}}else r.push(t);return(r=(0,n.u)(r)).length>1?r:r[0]},padStart:o,toHex:function(){for(var e=[],t=arguments.length,i=Array(t),n=0;n=16)return e;for(var t=new Uint8Array(16),i=0;i1&&void 0!==arguments[1]?arguments[1]:[];if(!(e instanceof ArrayBuffer))return!1;try{var i=!0;if(2===t.length){var n=t[1]-t[0]+1;if(!(i=e.byteLength===n))return}}catch(e){return!1}return!0},typeOf:u,nowTime:function(){try{return parseInt("".concat(performance.now()),10)}catch(e){return new Date().getTime()}},extUrl:i(980275).v,deepMerge:function e(t,i){return Object.keys(i).forEach(function(r){var a,o=u(i[r]),s=u(t[r]);"Array"===o?("Array"!==s&&(t[r]=[]),(a=t[r]).push.apply(a,(0,n.u)(i[r]))):"Object"===o?("Object"!==s&&(t[r]={}),e(t[r],i[r])):t[r]=i[r]}),t},getFileSize:function(e,t){try{if(!e||!t)return 0;return parseInt("".concat(t*e/8),10)}catch(e){return 0}},hashVal:function(e){var t,i=0;if(0===e.length)return i;for(t=0;t3&&t[2]&&(i=t[2]),i},newUint8Array:function(e){for(var t,i=0;i0)break;i++}catch(e){i1&&void 0!==arguments[1]?arguments[1]:0;if(!e||"String"!==u(e))return 0;var i=0;try{var n=RegExp("(\\?|&)x-tos-expires=([^&]*)(&|$)"),r=e.match(n);if(null!==r)i=parseInt(r[2],10);else{var a=e.split("/");a.length>5&&8===a[4].length&&(i=parseInt(a[4],16))}if(i>0){var o=parseInt("".concat(t&&"number"==typeof t?new Date().getTime()/1e3+t:new Date().getTime()/1e3),10);return i2&&void 0!==arguments[2]?arguments[2]:5e5;if(t-e-it||t-r>0,a=Math.ceil(r/n.length),o=[],s=String(e);a--;)o.push(n);return o.join("").substring(0,r-s.length)+s}function s(e){for(var t="",i=0;i100?100:t,n.changeState("loadstart","beforeLoadStartCostTime ".concat(n._beforeLoadStartCostTime)),e.mseOpenTimeout>0&&(c.ZP.log("mOPenTime",e.mseOpenTimeout,performance.now()),n._mseOpenTimeoutId=setTimeout(function(){c.ZP.log("Timeout",performance.now()),n._errorHandler(new g.Z(u.wb.MEDIA,g.Z.MSE_OPEN_TIMEOUT,{message:"mse open timeout"})),n._clearMseOpenTimeout();var e,t,i=parseInt((0,m.uS)(h.Hy)||"0")+1;(0,m.iR)(h.Hy,i),null===(e=n.__dash__)||void 0===e||e.destroy(),null===(t=n.__dash__)||void 0===t||null===(t=t.dash)||void 0===t||t.destroy()},e.mseOpenTimeout))}),(0,a._x)(this,"_onLoadData",(0,a.x)((0,a.l5)().mark(function e(){var t,i,r;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n.changeState("loaddata"),null==(r=n.__dash__)||null===(t=r.dash)||void 0===t||t.checkPCDN(),null==r||null===(i=r.dash)||void 0===i||i.cachePreloadData(),c.ZP.log("未起播计时 clearCheckCanplayTimer"),r.clearCheckCanplayTimer(),!(null!=r&&r.abrInstance)){e.next=10;break}return e.next=9,r.abrInstance.init(r.dash.mpd.mediaList);case 9:r.abrInstance.execute();case 10:case"end":return e.stop()}},e)}))),(0,a._x)(this,"_errorHandler",function(e){if(n._checkHasDestroy("errorHandler"))return;var t,i,r,s=n._pluginInst,l=s.player,d=s.config;if(d.codecType===_.$V[_.d0.HEVC].logCodeType&&(null===(t=l.video.error)||void 0===t||null===(t=t.message)||void 0===t?void 0:t.indexOf("video decoder initialization failed"))>=0&&(c.ZP.log("ErrorHandler DECODER_FAILED"),l.emit("DECODER_FAILED",{codecType:d.codecType,vid:d.vid,message:e.message})),e instanceof g.Z)e=new o.Errors(l,e);else if(l.video.error)e=new o.Errors(l,{errorType:u.wb.MEDIA,errorCode:5100+l.video.error.code});else{var f=e;if("string"!=typeof e)try{f=JSON.stringify(e)}catch(e){f="other"}e=new o.Errors(l,{errorType:u.wb.OTHER,errorCode:0,errorMessage:f})}if(null===(i=n._pluginInst)||void 0===i||i.setStartTimelines(y.l1.PLAYER_ERROR,{message:"mse-".concat(e.message,"-").concat(e.errorCode)}),n._errors.push({time:new Date().getTime(),err:e}),l.emit("xglog_cache"),!!e&&l.dashState!==h.Ck&&l.dashState!==h.mD&&"mp4"!==d.defaultFormat){c.ZP.log(d.vid,e),l.dashState=h.Ck,e.vid=d.vid,e.url=l.src;var p=n.__dash__,v=p&&p.isCurrentAutoDefi;if(e.errd&&"object"===(0,a.Ac)(e.errd)&&p&&p.dash&&(e.errd.url=p.dash.url,e.url=p.dash.url),e.url&&e.url.indexOf("blob:")>-1&&d.dashOpts&&d.dashOpts.dynamic_video&&(e.url=d.dashOpts.dynamic_video.main_url),e&&(e.errorCode===n._getCode(u.wb.MEDIA,u.wb.SUB_TYPES.MSE_HIJACK)||e.errorCode===n._getCode(u.wb.MEDIA,u.wb.SUB_TYPES.EME_HIJACK))){l.emit("error",e);return}if(l.emit("DATA_REPORT",e),e&&e.errorCode===n._getCode(u.wb.DRM,u.wb.SUB_TYPES.LICENSE)){n._pluginInst.destroyKernal(),l.emit("error",e);return}if(e&&(e.errorCode===n._getCode(u.wb.MEDIA,u.wb.SUB_TYPES.MSE_ADD_SB)||e.errorCode===n._getCode(u.wb.DEMUX,u.wb.SUB_TYPES.SIDX))){n._handleDegradeToMp4(e);return}if(e.segmentExpired||e.msg===h.uD){p&&p.abrInstance&&"function"==typeof p.abrInstance._stop&&(p.abrInstance._stop(),c.ZP.abr("error stop","expired",e.segmentExpired,e.ex)),n._pluginInst.emitExpireEvent(e);return}if(!e.curReqVideoSegInfo&&p&&(e.curReqVideoSegInfo=JSON.parse(JSON.stringify(p.curReqVideoSegInfo||{}))),!e.headers&&(e.headers=e.curReqVideoSegInfo.headers||{}),d.useBackUrl&&!n._pluginInst._hasUsedBackUrl&&d.dashOpts&&d.dashOpts.dynamic_video&&p){c.ZP.log("backup replay");var m=p.changeMainBackUrl(b.ERR,n._pluginInst._hasUsedBackUrl);p.updateDashType(),v?m.autoBitrateOpts&&(m.autoBitrateOpts.isPlayAutoDefi=!0):(n.currentDefitionFromPlayer&&(m.defaultDefinition=n.currentDefitionFromPlayer.definition),m.autoBitrateOpts&&(m.autoBitrateOpts.isPlayAutoDefi=!1)),n._pluginInst._hasUsedBackUrl=!0,n._pluginInst.next(l.currentTime,"REPLAY",m,!0,"dash"),l.emit("playCatch","dash",e),c.ZP.log("playCatch dash",JSON.stringify(e)),n._emitDegradeEvent(e,"dash");return}p&&p.updateDashType(!0),e&&(null===(r=e)||void 0===r?void 0:r.errorCode)===g.Z.BACK_URL_FAIL&&(l.fallBackFail=!0),n._handleDegradeToMp4(e)}}),this._pluginInst=t,this._errors=[],this._initProfile(),this._proxyPlayer(),this._initialize(),this._bindEvents()},[{key:"changeState",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this._pTime&&(this._pTime=p.Z.nowTime());var n=p.Z.nowTime()-this._pTime,r=p.Z.nowTime()-this._sTime;c.ZP.log(null===(t=this._pluginInst)||void 0===t||null===(t=t.config)||void 0===t?void 0:t.vid,">>>changeState[".concat(e,"]"),n,r,JSON.stringify(i));var a={state:e,t1:n,t2:r,data:i};!this.states[e]&&(this.states[e]=a),this.allPhases.push(a),this._pTime=p.Z.nowTime()}},{key:"_initProfile",value:function(){this.states={},this.preloadMap={},this.allPhases=[]}},{key:"setNodeTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.changeState(e,t),i&&this.setPreloadData(e,t),"initmse_sbopendone"===e&&(c.ZP.log("clear Timeout sbopendone",performance.now()),this._clearMseOpenTimeout())}},{key:"setPreloadData",value:function(e,t){this.preloadMap[e]=t}},{key:"_proxyPlayer",value:function(){var e=this._pluginInst.player;this._originSwitchURL=e.switchURL,this._originErrorHandler=e.errorHandler,e.switchURL=this._switchURL.bind(this),e._startInit=this.start,e.dash=!0,e.errorHandler=this._errorHandler}},{key:"_info",value:function(e){this._pluginInst&&this._pluginInst.info(e)}},{key:"_onWasmReady",value:(n=(0,a.x)((0,a.l5)().mark(function e(t){var i,n,r,s,u,l,d,f,v,g,m,_,y=this;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._checkHasDestroy("_onWasmReady")){e.next=2;break}return e.abrupt("return");case 2:return i=t.url,r=(n=this._pluginInst).player,s=n.config,l=(u=this.__dash__).dash,r.dashState=h.WX,r.emit("dashStateChange",h.WX),c.ZP.log("监听到wasm_ready"),this._info({msg:"wasm_ready"}),p.Z.on(l,"error",this._errorHandler,"destroy"),u.bindComEvent(),e.prev=12,e.next=15,l.init(i);case 15:if(d=e.sent){e.next=19;break}return this._info({msg:"isDestroy ".concat(!r,", isMseNull ").concat(!d)}),e.abrupt("return");case 19:c.ZP.time("initReady cost",new Date().getTime()-u.startTimestamp),r.dashState=h._6,r.emit("dashStateChange",h._6),c.ZP.log("dash init完成"),l.mpd.mediaList.video.length>0&&(!s.defaultDefinition&&(s.defaultDefinition=s.dashOpts.dynamic_video.dynamic_video_list[0].definition,u.lastDefiIdx=0),!u.isOpenAutoDefi&&(u.isCurrentAutoDefi=!1,u.abrInstance.isCurrentInAbr=!1),f=s.defaultDefinition.toString(),this._initDefinitionList(f),(!(v=u.definitions.some(function(e){return e.selected}))||void 0===u.lastDefiIdx)&&(!v&&(u.definitions[0].selected=!0,g=u.definitions[0].definition,this._pluginInst.setCurrentDefitionInfos(g,u.definition2item[g])),r.emit("initialUrl",l.mpd.mediaList.video[0].baseURL),u.curBitrate=s.dashOpts.dynamic_video.dynamic_video_list[0].bitrate,u.lastDefiIdx=0),this._afterInitDefinitionList()),this._pluginInst.originStartInit.call(r,d.url),c.ZP.time("start call cost",new Date().getTime()-u.startTimestamp),r.dashState=h.vL,r.emit("dashStateChange",h.vL),u.startCheckCanplayTimer(),u.isDashCanUse=!0,u.mse=d,u.emitMenuResolutionChange(),"safari"===o.Sniffer.browser&&(o.Util.addClass(r.root,"canplay"),m=function(){o.Util.removeClass(r.root,"xgplayer-is-enter")},p.Z.once(r,"waiting",m)),_=function(){if(!y._checkHasDestroy("onStartPlay"))r.emit("dash_start_play"),y._info({msg:"dash_start_play"}),r.dashState=h.i4,y._info({msg:"START_PLAY ready"}),r.emit("dashStateChange",h.i4),r.emit("playInterfaceInfo",s.dashOpts||{}),!u.isCurrentAutoDefi&&c.ZP.time("onStartPlay cost not abr",new Date().getTime()-u.startTimestamp),u.startProgressTimer(),c.ZP.time("onStartPlay cost",new Date().getTime()-u.startTimestamp),u.setCurrentDefinition()},p.Z.once(l,"start_play",_),this._info({msg:"START_PLAY dashready"}),r.emit("dashready"),e.next=42;break;case 39:e.prev=39,e.t0=e.catch(12),r.errorHandler(e.t0);case 42:case"end":return e.stop()}},e,this,[[12,39]])})),function(e){return n.apply(this,arguments)})},{key:"_initDefinitionList",value:function(e){var t=this;e=e.toString();var i=this._pluginInst,n=i.player,r=i.config,o=this.__dash__,s=o.dash,u=r.dashOpts.dynamic_video.dynamic_video_list;o.definitions=[];for(var l=0;l0&&void 0!==arguments[0]&&arguments[0],t=this._pluginInst,i=t.player,n=t.config,r=i.config;if(n.playInfoType===m.zB.FEED&&r.definition){var a,o=n.dashOpts.Data,s=r.definition.list,u=r.definition.extraList||[];u.length>0&&u.forEach(function(e){e.isExtra=!0});var l=e?s:(null==o?void 0:o.vid)===n.vid&&(null==o?void 0:o.playInfoList)||s;l=l.filter(function(e){return!e.isExtra}),n.defaultDefinition=r.defaultDefinition||r.definition.defaultDefinition,r.definition.list=l.filter(function(e){return e.vtype.toUpperCase()===y.l0.DASH&&"video"===e.mediaType});var c=l.concat(u)||[];null!==(a=l[0])&&void 0!==a&&a.file_id&&(c=this._filterBy("file_id",l,u)),n.dashOpts.Data={vid:r.vid,duration:r.duration,playInfoList:JSON.parse(JSON.stringify(c))};var d=c.filter(function(e){return e.vtype.toUpperCase()===y.l0.MP4});if(d.length>0||r.downgradeUrl){var h=d.length>0?d:[{url:r.downgradeUrl,definition:"1",vtype:"MP4",size:0,codecType:"h264"}];n.mp4Opts={mp4List:h}}else n.mp4Opts=null}}},{key:"_processData",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._pluginInst,i=t.player,n=t.config,r=i.config;this._processFeedData(e),n.dashOpts.Data&&(n.playInfoType===m.zB.TOP||n.playInfoType===m.zB.FEED)&&this._playInfoInit(),n.dashOpts.dynamic_video&&(n.dashOpts.dynamic_video.dynamic_video_list=n.dashOpts.dynamic_video.dynamic_video_list||[],n.dashOpts.dynamic_video.dynamic_audio_list=n.dashOpts.dynamic_video.dynamic_audio_list||[],[n.dashOpts.dynamic_video.dynamic_video_list,n.dashOpts.dynamic_video.dynamic_audio_list].forEach(function(e){e.forEach(function(e){if(e.bitrate=parseInt(e.real_bitrate||e.bitrate),r&&"function"==typeof r.preProcessUrl){var t=r.preProcessUrlOptions||{};e.main_url=r.preProcessUrl(e.main_url,t).url,e.backup_url_1=r.preProcessUrl(e.backup_url_1,t).url;var i=Object.assign({},t,{isFallback:!0});e.fallback_url=r.preProcessUrl(e.fallback_url,i).url}})}))}},{key:"_initialize",value:function(){var e=this._pluginInst,t=e.player,i=e.config;if(c.ZP.log(null==i?void 0:i.vid,"执行dashKernal"),this._processData(),!i.dashOpts){this._info({msg:"dashOpts is null",startMs:Date.now(),name:"_initialize",add:!0});return}var n=h.iS,r=new v.Z({pluginInst:this._pluginInst});this.__dash__=r;var a=l.d1.isSupported('video/mp4; codecs="avc1.64001E, mp4a.40.5"');a?r.changeMainBackUrl(n.INIT,this._hasUsedBackUrl):(this._info({msg:"isCodecSupported ".concat(a),add:!0}),null==t||t.errorHandler(new g.Z(u.wb.MEDIA,u.wb.SUB_TYPES.MEDIA_ERR_CODEC_NOT_SUPPORTED,{message:"init"})))}},{key:"_bindEvents",value:function(){var e=this._pluginInst.player;e.on(o.Events.LOAD_START,this._onLoadStart),e.on(o.Events.LOADED_DATA,this._onLoadData)}},{key:"_clearMseOpenTimeout",value:function(){this._mseOpenTimeoutId&&(clearTimeout(this._mseOpenTimeoutId),this._mseOpenTimeoutId=null)}},{key:"beforeLoadStartCostTime",get:function(){return this._beforeLoadStartCostTime}},{key:"_switchURL",value:(r=(0,a.x)((0,a.l5)().mark(function e(t){var i,n,r=arguments;return(0,a.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=!(r.length>1)||void 0===r[1]||r[1],n=this.__dash__,e.next=4,n.switchURL(t,i);case 4:case"end":return e.stop()}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"onPreChangeDefinition",value:function(e){if(!Array.isArray(e)||!this.__dash__||!this.__dash__.dash||this.__dash__.dash._hasDestroyed)return[];var t=this._pluginInst,i=t.player,n=t.config,r=i.config,o=null===(s=this.__dash__)||void 0===s||null===(s=s.dash)||void 0===s?void 0:s.mpd;if(o){var s,u,l,c,d,h=(c=null===(d=this.__dash__)||void 0===d||null===(d=d.dash)||void 0===d||null===(d=d.mpd)||void 0===d?void 0:d.getCurrDefition()).videoFileId,f=n.dashOpts.dynamic_video;if(0===e.filter(function(e){return e.file_id===h}).length){var p=f.dynamic_video_list.filter(function(e){return e.file_id===h});p.length>0&&e.push.apply(e,(0,a.u)(p))}var v=c.audioFileId;if(0===e.filter(function(e){return e.file_id===v}).length){var g=f.dynamic_audio_list.filter(function(e){return e.file_id===v});g&&e.push.apply(e,(0,a.u)(g))}}if(r.definition.list=e,this._processData(!0),null===(u=this.__dash__)||void 0===u||null===(u=u.dash)||void 0===u||null===(u=u.mpd)||void 0===u||u.init(!1,c),o){var m=o.mediaList.video,_=m.selectedIdx;this.__dash__.curVideoInitSegmentIdx=_,this.__dash__.curVideoFileId=m[_].fileId}var y=n.defaultDefinition.toString();return this._initDefinitionList((null===(l=i.curDefinition)||void 0===l?void 0:l.definition)||y),this._afterInitDefinitionList(),this.__dash__.definitions}},{key:"_playInfoInit",value:function(){var e=this._pluginInst,t=e.config,i=e.playerConfig,n=t.dashOpts.Data;t.vid=n.VideoID||n.Vid||n.vid,i.vid=t.vid,t.playInfoType===m.zB.TOP?(0,m.NK)(t):t.playInfoType===m.zB.FEED&&(0,m.LY)(t)}},{key:"_getCode",value:function(e,t){return u.WE[e][t]}},{key:"_emitDegradeEvent",value:function(e,t){if(this._pluginInst){var i=this._pluginInst.player,n=e.errorCode,r=e.errorMessage,o=(0,a.Zj)((0,a.Zj)({},e),{},{vtype:t,errc:n,err_msg:r||(null==e?void 0:e.message)});i.pause(),i.emit("degrade",o),c.ZP.log("degrade event emit",JSON.stringify(o))}}},{key:"_handleDegradeToMp4",value:function(e){var t=this;if(!this._checkHasDestroy("_handleDegradeToMp4")){var i=this._pluginInst,n=i.player,r=i.config;if(r.mp4Opts&&!this._hasDegradeMp4){c.ZP.log(r.vid,"_handleDegradeToMp4"),this._hasDegradeMp4=!0,n.dashState=h.mD;var o=r.startTime||n.currentTime||0;setTimeout(function(){var i;if(!t._checkHasDestroy("degrademp4"))t._pluginInst._setStartTime("destroy",o,!0,!1),n.emit("playertypechange"),n.dashState=h.x3,n.emit("playCatch","dash_mp4_2",(0,a.Zj)((0,a.Zj)({},e),{},{url:(null==n||null===(i=n.config)||void 0===i?void 0:i.downgradeUrl)||""})),c.ZP.log(r.vid,"playCatch dash_mp4_2",JSON.stringify(e)),t._emitDegradeEvent(e,"dash_mp4_2"),r.defaultFormat="mp4",t._pluginInst.changeKernal(!0,!1,"dash_mp4_2"),n.once("canplay",function(){if(n.config.autoplay){var e=n.video.play();e&&e.catch(function(){})}})},0)}else!r.mp4Opts&&(n.dashState=h.wL,n.emit("dashDestroy"),n.emit("error",e),c.ZP.log("_handleDegradeToMp4 throw error"))}}},{key:"abrInstance",get:function(){return this.__dash__.abrInstance}},{key:"destroy",value:function(){var e=this._pluginInst.player;this.__dash__&&(this.__dash__.destroy(),this.__dash__=null),e.off(o.Events.LOAD_START,this._onLoadStart),e.off(o.Events.LOADED_DATA,this._onLoadData),e.errorHandler=this._originErrorHandler,e._startInit=this._pluginInst._originStartInit,e.switchURL=this._originSwitchURL,this._pluginInst=null,this._hasStart=!1,c.ZP.log("dashKernal destroy"),this._clearMseOpenTimeout()}},{key:"_checkHasDestroy",value:function(e){return!this._pluginInst&&(this._info({msg:"dashKernal destroy ".concat(e),add:!0}),c.ZP.log("checkHasDestroy",e),!0)}},{key:"executeReady",value:function(){if(!this._checkHasDestroy("executeReady")){var e=this._pluginInst.player;p.Z.once(e,"dash_start_play",function(){e.dashState=h.Y9,e.emit("nextEnded")})}}},{key:"getStat",value:function(){if(!this._checkHasDestroy("getStat")){var e={};e.dvps=!!this._pluginInst.pvStartup,e.daps=!!this._pluginInst.paStartup,e.preLoadData=this.getPreloadStat();var t={},i={};if(this.__dash__&&this.__dash__.dash&&this.__dash__.dash.mse){var n=this.__dash__.dash.mse;if(n._sourceBuffer){for(var r=Object.keys(n._sourceBuffer),a=0;a1&&void 0!==arguments[1]?arguments[1]:null;this.stop();var n=!0,r=null;return this.cancelPending_=function(){window.clearTimeout(r),n=!1},r=window.setTimeout(function(){n&&(t.onTick_(),i&&i())},1e3*e),this}},{key:"tickEvery",value:function(e){var t=this;this.tickAfter(e,function(){t.tickEvery(e)})}},{key:"stop",value:function(){this.cancelPending_&&(this.cancelPending_(),this.cancelPending_=null)}}]),s={stallSkip:.1,stallCount:3,stallTimer:1,failCount:2},u=function(){function e(t,i){var r=this,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(0,n.PA)(this,e),(0,n._x)(this,"_onTaskRequestError",function(e){r.requests=e}),this.player=t,this.mediaElem=t.video,this.config=Object.assign({},i,s),this.timer=new o(function(){r.onGapJump()}),this.inBufferTimer=new o(function(){r._onBufferStallCheck()}),this.prevReadyState=this.mediaElem.readyState,this.didFireLargeGap=!1,this.seekingEventReceived=!1,this.segmentAppended=!1,this.onWaitFunc=this._onWaiting.bind(this),this.onPlayFunc=this._onPlay.bind(this),this.onPlayingFunc=this._onPlaying.bind(this),this.onPausedFunc=this._onPaused.bind(this),this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.hasPlayed=!1,this.lastVideoTime=-1,this.hasPaused=!1,this.resumeFromPaused=!1,this.stallSkip=this.config.stallSkip,this.stallCount=this.config.stallCount,this.stallTimer=this.config.stallTimer,this.reset(),this.requests=u,this.player.on(a.X4,this._onTaskRequestError),!1!==this.config.useGapJump&&this._start()}return(0,n.qH)(e,[{key:"reset",value:function(){this.stallPoints={}}},{key:"_onWaiting",value:function(){this.onGapJump();var e=this.player.currentTime;this.onRequestFail(e)}},{key:"onRequestFail",value:function(e){if(!!this.requests){var t=this.requests.video,i=this.requests.audio,n=this._checkIfNextRequestFailed(e,t),r=this._checkIfNextRequestFailed(e,i);if(n.result||r.result){var a=n.result?n.end:r.end;a=a=this.config.failCount&&o)return{end:n.end,result:!0}}return{result:!1}}},{key:"_onPlay",value:function(){this.hasPlayed=!0}},{key:"_onPaused",value:function(){this.hasPaused=!0}},{key:"_onPlaying",value:function(){this.hasPaused&&(this.hasPaused=!1,this.resumeFromPaused=!0)}},{key:"_start",value:function(){this.mediaElem.addEventListener("waiting",this.onWaitFunc),this.mediaElem.addEventListener("play",this.onPlayFunc),this.mediaElem.addEventListener("playing",this.onPlayingFunc),this.mediaElem.addEventListener("pause",this.onPausedFunc),this.timer.tickEvery(.25),this.inBufferTimer.tickEvery(this.stallTimer)}},{key:"onSegmentAppend",value:function(){this.segmentAppended=!0,this.onGapJump()}},{key:"onSeeking",value:function(){this.seekingEventReceived=!0,this.segmentAppended=!1,this.didFireLargeGap=!1}},{key:"onGapJump",value:function(){if(this.mediaElem.readyState===HTMLMediaElement.HAVE_NOTHING)return;if(this.mediaElem.seeking){if(!this.seekingEventReceived)return}else this.seekingEventReceived=!1;if(this.mediaElem.paused&&0!==this.mediaElem.currentTime&&this.hasPlayed)return;this.mediaElem.readyState!==this.prevReadyState&&(this.didFireLargeGap=!1,this.prevReadyState=this.mediaElem.readyState);var t=this.mediaElem.buffered,i=this.config.smallGapLimit||1,n=this.config.gapDetectionThreshold||.5,a=this.mediaElem.currentTime,o=this._getIndex(t,a,n);if(null===o||0===o&&!this.segmentAppended)return;var s=t.start(o);if(s>this.mediaElem.duration)return;var u=s-a,l=u<=i;if(!(uo-.5))i=!0}var s=this.mediaElem.buffered,u=s.length;u>0&&this.mediaElem.duration===s.end(u-1)&&(i=!0);var l=this.mediaElem.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA;if(i&&l&&this.lastVideoTime===e&&!this.resumeFromPaused&&this.mediaElem.currentTimethis.stallCount&&(this.mediaElem.currentTimet&&(0===a||n[a-1].end-t<=i)){r=a;break}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],i=0;i0&&void 0!==arguments[0]?arguments[0]:"video",t=this._getPCDNService(e);return null==t?void 0:t.getPCDNInOUtBuffer()}},{key:"pcdnVVStat",get:function(){var e,t,i=this;if(!this._useSeparationMode)return this._pcdn.pcdnReqCnt;var n={};if(!this._mediaTypeToServiceType.video||!this._mediaTypeToServiceType.audio)return(null===(e=this._mediaTypeToServiceType.video)||void 0===e?void 0:e.pcdnReqCnt)||(null===(t=this._mediaTypeToServiceType.audio)||void 0===t?void 0:t.pcdnReqCnt)||{};var r=this._mediaTypeToServiceType.video.pcdnReqCnt,a=this._mediaTypeToServiceType.audio.pcdnReqCnt;return Object.keys(r).forEach(function(e){n[e]=i._getValue(e,r)+i._getValue(e,a)}),n}},{key:"pcdnReqCnt",get:function(){var e,t,i,n,r=this;if(!this._useSeparationMode)return this._pcdn.pcdnVVStat;if(!this._mediaTypeToServiceType.video||!this._mediaTypeToServiceType.audio)return(null===(e=this._mediaTypeToServiceType.video)||void 0===e?void 0:e.pcdnVVStat)||(null===(t=this._mediaTypeToServiceType.audio)||void 0===t?void 0:t.pcdnVVStat)||{};var a={},o=["is_try_open","trace_id"],s=null===(i=this._mediaTypeToServiceType.video)||void 0===i?void 0:i.pcdnVVStat,u=null===(n=this._mediaTypeToServiceType.audio)||void 0===n?void 0:n.pcdnVVStat;return Object.keys(s).forEach(function(e){o.includes(e)?a[e]=s[e]||u[e]:a[e]=r._getValue(e,s)+r._getValue(e,u)}),a}},{key:"_getValue",value:function(e,t){return t[e]||0}},{key:"updateConfig",value:function(e,t){this._getPCDNService(e).updateConfig(t)}}])},97447:function(e,t,i){i.d(t,{Z:function(){return g}});var n=i(648955);i(346984),i(68113),i(705574),i(124300),i(162093),i(9498),i(503e3),i(173757),i(932651),i(2885),i(248385),i(496423),i(679308),i(591111),i(663030),i(490629);var r=i(651108),a=i(857287),o=i(373974),s=i(298757),u=i(265614),l=i(608215),c=i(737178),d=i(405762),h=i(965883),f=i(521323),p=i(639803),v=i(857626),g=function(e){var t,i,a,h,g,m,_;function y(e,t){var i;return(0,n.PA)(this,y),(i=(0,n.$w)(this,y,[e,t])).options=t,i._pendingTask=null,i._newLoader(),i}return(0,n.XW)(y,e),(0,n.qH)(y,[{key:"_setItem",value:(t=(0,n.x)((0,n.l5)().mark(function e(t,i){var r,a;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.vtype=o.l0.DASH,e.next=3,this.preloadManager.getItem(t,!0);case 3:(r=e.sent)?(a=Object.assign({},r,i),a=d.Z.combinePreloadData(a),this.preloadManager.setItem(t,a,!0)):this.preloadManager.setItem(t,i,!0);case 5:case"end":return e.stop()}},e,this)})),function(e,i){return t.apply(this,arguments)})},{key:"_processItemUrl",value:function(e){this.preloadManager.preProcessUrl&&(e.main_url=this.preloadManager.preProcessUrl(e.main_url).url,e.backup_url_1=this.preloadManager.preProcessUrl(e.backup_url_1).url,e.fallback_url=this.preloadManager.preProcessUrl(e.fallback_url).url)}},{key:"_getDashContext",value:function(e){var t=this,i=e.payload;if("TOP"===e.playInfoType){var n={dashOpts:e.payload};(0,p.NK)(n),i=n.dashOpts.dynamic_video}if(Array.isArray(i)){var r={dashOpts:{Data:e,dynamic_video:e}};(0,p.LY)(r),i=r.dashOpts.dynamic_video}return i.dynamic_video_list&&i.dynamic_video_list.forEach(function(e){e.bitrate=e.real_bitrate||e.bitrate,t._processItemUrl(e)}),i.dynamic_audio_list&&i.dynamic_audio_list.forEach(function(e){e.bitrate=e.real_bitrate||e.bitrate,t._processItemUrl(e)}),{dynamic_video:i}}},{key:"_newLoader",value:function(){var e=this,t=this.options,i=t.dynamicTimeoutIns,n=t.dynamicTimeoutAudioIns,r=t.changeUrlRetry,a=t.retry,s=t.retryDelay,l=this.options.timeout||3e3;this._loader=new c.Z({loaderCount:1,loaderType:u.t.XHR,dynamicTimeoutIns:i,dynamicTimeoutAudioIns:n,retry:a,retryDelay:s,changeUrlRetry:r,timeout:l},this.preloadManager,"preloader",this.options.needPreloadCache),this._loader.on("networkError",function(t){var i;null===(i=e.preloadManager)||void 0===i||null===(i=i.player)||void 0===i||i.emit("networkError",t)}),this._loader.on(o.kW,function(t){if((null==t?void 0:t.len)>0){var i,n,r,a=(null==t||null===(i=t.priOptions)||void 0===i?void 0:i.type)||o._R.CDN,s=(null==t||null===(n=t.priOptions)||void 0===n?void 0:n.rtt)||0,u=Math.round(8e3*t.len/t.time/1024),l=null==t?void 0:t.priOptions.extData,c=l.cacheKey,d=null===(r=e._pendingItem)||void 0===r?void 0:r.duration,h={vid:l.vid,loadType:a,size:t.len,speed:u,cacheKey:c,vtype:o.l0.DASH,duration:d,bitrate:l.bitrate,range:t.range,mediaType:l.mediaType,format:o.l0.DASH,segmentDuration:null==l?void 0:l.segmentDuration,rtt:s};e.preloadManager.bwEventEmit(h)}})}},{key:"_getStartContext",value:function(){return{mediaInfos:{dynamic_video_list:[],dynamic_audio_list:[]},vtype:"",video:{segments:[]},audio:{segments:[]}}}},{key:"_cacheInitSegments",value:(i=(0,n.x)((0,n.l5)().mark(function e(t,i,r,a){var o,s,u,l,c,d,h;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.mediaList.video||[],s=t.mediaList.audio||[],u=[],s&&s.length>0&&(l=this.makeInitBaseSegemntRequest(t,i.duration,"audio",s.selectedIdx,void 0,i.vid),u.push(l)),o&&o.length>0&&(c=this._calVideoItemIdx(o,a.bandwidth)||0,d=o[c].definition,h=this.makeInitBaseSegemntRequest(t,i.duration,"video",c,d,i.vid),u.push(h)),e.next=7,Promise.all(u);case 7:e.sent.forEach(function(e){"video"===e.data.mediaType&&(e.data.orgDefinition=a.orgDefinition),r[e.key]=e.data});case 9:case"end":return e.stop()}},e,this)})),function(e,t,n,r){return i.apply(this,arguments)})},{key:"start",value:(a=(0,n.x)((0,n.l5)().mark(function e(t,i){var r,a,o,u,c,d,h,g,m,_,y,b,k,w,S,T,x,C,P,D,E,I,L,A,O,R,N,M,j,B,U,F,Z,q,V,H,W,z,J,X,K,Y,G,Q,$,ee,et,ei,en,er,ea=this;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=(r=Promise.withResolvers()).resolve,o=r.promise,u={},this._pendingTask={resolve:a,data:t,map:u},c=new s.XK,d=this._getDashContext(t),h=new l.Z("anytext",d,this),g=this._getStartContext(),m=function(){g.mediaInfos.dynamic_video_list=h.mediaList.video||[],g.mediaInfos.dynamic_audio_list=h.mediaList.audio||[],c.resolve(g)},h.once("ready",m),h.init(),e.next=12,c;case 12:if(this._pendingTask){e.next=16;break}return _=this.isStepWise(),a({remove:!_}),e.abrupt("return",o);case 16:if(y=new s.XK,b=g.mediaInfos,k=this._getIdx(b.dynamic_video_list,i||t.defaultDefinition),w=b.dynamic_video_list[k]||b.dynamic_video_list[0],b.dynamic_video_list[k]&&h.mediaList.audio&&b.dynamic_audio_list.length>0&&(h.mediaList.video.selectedIdx=k,-1===(S=(0,p.Ft)(h.mediaList.video,h.mediaList.audio))&&(S=0),f.ZP.log("audio definition preload",S),h.mediaList.audio.selectedIdx=S),t.dashType=h.dashType,!(null!==(en=this.options)&&void 0!==en&&null!==(en=en.pcdnConfig)&&void 0!==en&&en.openPreloadPCDN&&null!==(er=this.options)&&void 0!==er&&null!==(er=er.pcdnConfig)&&void 0!==er&&er.openDASHPreloadPCDN&&"segment_template"!==h.dashType)){e.next=38;break}if(T=this.options.pcdnConfig,!((x=d.dynamic_video.dynamic_video_list.filter(function(e){return e.definition===w.definition}))&&x.length>0)){e.next=38;break}if(P=(C=x[0]).duration,D=C.uri,this._pcdn?this._pcdn.updateConfig("video",{vid:D,duration:P}):(E={pcdnConfig:T},this._pcdn=new v.Z({config:E,isOpenPCDN:!0,videoDuration:P,uri:D},null)),!b.dynamic_video_list[k]){e.next=32;break}return!w.bitrate&&(w.bitrate=w.bandwidth),e.next=32,this._pcdn.openPCDNForce(w.bitrate||w.bandwidth,(0,n.Zj)({mediaType:"video"},w));case 32:if(!(h.mediaList.audio&&b.dynamic_audio_list.length>0)){e.next=38;break}return!(L=(I=h.mediaList.audio)[I.selectedIdx]).bitrate&&(L.bitrate=L.bandwidth),e.next=38,this._pcdn.openPCDNForce(L.bitrate||L.bandwidth,(0,n.Zj)({mediaType:"audio"},L));case 38:if(this._pendingItem=w,!this._pendingItem.duration&&(this._pendingItem.duration=t.duration),A={bandwidth:w.bitrate||w.bandwidth,time:t.startTime||0,orgDefinition:w.orgDefinition,hasSegmentRange:!1},O=[],R=this.isStepWise(),e.prev=43,B=void 0===t.video||(null===(N=t.video.segments)||void 0===N?void 0:N.length)===0,void 0===t.stepIdx&&(t.stepIdx=0),void 0===t.steps&&(t.steps=[0]),!R&&(t.steps=[0]),!(0===t.stepIdx||B)){e.next=71;break}if("segment_template"!==h.dashType){e.next=54;break}this._calRequests(h,A,y,t,!0),y.resolve(),e.next=69;break;case 54:if(0!==t.stepIdx){e.next=68;break}if(q=!1,(null==(V=h.mediaList)||null===(U=V.video)||void 0===U?void 0:U.length)>0&&(null==V||null===(F=V.audio)||void 0===F?void 0:F.length)>0&&(q=V.video[V.video.selectedIdx].firstMoofMdatRange&&V.audio[V.audio.selectedIdx].firstMoofMdatRange),!(!R&&q&&null!==(Z=this.options)&&void 0!==Z&&Z.useSegmentRange)){e.next=63;break}t.hasSegmentRange=!0,this._requestAcc(h,A,y,t),e.next=66;break;case 63:return e.next=65,this._cacheInitSegments(h,t,u,A);case 65:this._calRequests(h,A,y,t);case 66:e.next=69;break;case 68:y.resolve([]);case 69:e.next=72;break;case 71:y.resolve([]);case 72:return e.next=74,y;case 74:if(O=e.sent,0===(H=R?t.stepIdx:0)&&this._setItem(t,u),this._pendingTask){e.next=80;break}return a({remove:!R}),e.abrupt("return",o);case 80:R&&(J=t.steps.length,J<(X=Math.max(null===(W=t.video)||void 0===W?void 0:W.segments.length,null===(z=t.audio)||void 0===z?void 0:z.segments.length))&&(Y=Array(X-J).fill(1),(K=t.steps).push.apply(K,(0,n.u)(Y)))),G=[null===(M=t.video)||void 0===M?void 0:M.segments[H],null===(j=t.audio)||void 0===j?void 0:j.segments[H]],Q=(O||[]).concat(G).filter(function(e){return!!e}),$=[],ee=(0,n.sf)(Q),e.prev=85,ei=(0,n.l5)().mark(function e(){var i,r,a,o,s;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=(i=et.value).url,a=i.range,o=i.extData,s=ea._getData(r,a,o).then(function(e){"video"===e.mediaType&&(e.orgDefinition=A.orgDefinition),!e.fromCache&&(u[o.cacheKey]=e,f.ZP.log("prelaoder setItem",t,u),ea._setItem(t,u))}),$.push(s);case 4:case"end":return e.stop()}},e)}),ee.s();case 88:if((et=ee.n()).done){e.next=92;break}return e.delegateYield(ei(),"t0",90);case 90:e.next=88;break;case 92:e.next=97;break;case 94:e.prev=94,e.t1=e.catch(85),ee.e(e.t1);case 97:return e.prev=97,ee.f(),e.finish(97);case 100:return e.next=102,Promise.all($);case 102:e.next=107;break;case 104:e.prev=104,e.t2=e.catch(43);case 107:return e.prev=107,a({remove:!R}),e.finish(107);case 110:return this._pendingTask=null,e.abrupt("return",o);case 112:case"end":return e.stop()}},e,this,[[43,104,107,110],[85,94,97,100]])})),function(e,t){return a.apply(this,arguments)})},{key:"isStepWise",value:function(){var e=this.options.openStepwiseType;return this.stepwise&&(void 0===e||e.toUpperCase()===o.l0.DASH)}},{key:"_getIdx",value:function(e,t){var i=0;return e.forEach(function(e,n){e.definition===t&&(i=n)}),i}},{key:"_calRequests",value:function(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=[],o=t.bandwidth,s=e.mediaList.video||[],u=e.mediaList.audio||[],l=n.vid,c=e.getCodecType();if(u&&u.length>0){var d=u.selectedIdx;u[d].codec_type=c;var h=this._calUrls(u[d],"audio",l,null,r,n);a=a.concat(h)}if(s&&s.length>0){var f=this._calVideoItemIdx(s,o)||0,p=s[f];p.codec_type=c;var v=this._calUrls(p,"video",l,p.definition,r,n);a=a.concat(v)}a.length,i.resolve(a)}},{key:"_getSplitGopRange",value:function(e,t,i){var r=e.segment,a=r.range;if(!e.isStep){var o=r.range[1],s=r.range[0];return{allRangeItems:[{item:r,range:a,segmentDuration:r.endRaw-r.startRaw,rangeEnd:o,rangeStart:s}],newSteps:t}}var u=[],l=[],c,d=(0,n.sf)(t);try{for(d.s();!(c=d.n()).done;){var h=c.value;if(h>=r.endRaw){l.push(r.endRaw);break}l.push(h)}}catch(e){d.e(e)}finally{d.f()}var p=void 0===this.options.needfixSizeSegment||this.options.needfixSizeSegment;p&&l.length>0&&l[l.length-1]=r.endRaw,T=Math.floor(k*i/8)+a[0]+1,x=S?null===(b=r.range)||void 0===b?void 0:b[1]:T-1;v=x+1;var C=x>=_;if(a=[w,C?_:x],w>=x)break;u.push({item:r,range:a,segmentDuration:C?r.endRaw:k,rangeEnd:r.range[1],rangeStart:r.range[0]}),g++}return g=e.length)break}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"_getRange",value:function(e,t){var i=e.mediaSegments,r=t.steps.map(function(e){return e+0}),a=this._recalcSteps(r,i),o=[],s="segment_template"===t.dashType;if((null===(l=t.steps)||void 0===l?void 0:l.length)>0&&(null===(c=t.steps)||void 0===c?void 0:c[0])>0&&!s){if(a[0].isStep){var u=this._getSplitGopRange(a[0],t.steps,e.bandwidth).allRangeItems;o.push.apply(o,(0,n.u)(u))}else{var l,c,d,h=(0,n.sf)(a);try{for(h.s();!(d=h.n()).done;){var f=d.value,p=this._getSplitGopRange(f,t.steps,e.bandwidth).allRangeItems;o.push.apply(o,(0,n.u)(p))}}catch(e){h.e(e)}finally{h.f()}}}else{var v=a[0].segment,g=v.range,m=v.range[0],_=v.range[1];o.push({item:v,range:g,segmentDuration:v.endRaw-v.startRaw,rangeEnd:_,rangeStart:m})}return o}},{key:"_calUrls",value:function(e,t,i,r,a,o){var s=[];if(e){var u=e.avg_bitrate||e.bandwidth||e.bitrate,l=y.vtype;!o[t]&&(o[t]={initSegment:null,segments:[]});var c=o[t];if(a){var h,f,p=[null===(h=e.initSegmentRange)||void 0===h?void 0:h[0],null===(f=e.sidxRange)||void 0===f?void 0:f[1]],v={url:e.initSegment,range:p,extData:{cacheKey:d.Z.generateRequestUniqueKey({vid:i,mediaType:t,codecType:e.codec_type,vtype:l,bitrate:u,fileId:e.fileId,range:p,definition:r}),vid:i,vtype:l,isInitSegment:!0,mediaType:t,useUrlRange:d.Z.validateUrlRange(this.options.url_range_domains,e.initSegment),codecType:e.codec_type,range:p,bitrate:u,segmentDuration:0,checkPreload:!0,urlList:e.backupUrlList}};s.push(v),c.initSegment=v}var g=[];if(o.hasSegmentRange){var m=e.firstMoofMdatRange[0],_=e.firstMoofMdatRange[1];g=[{item:{start:0,end:7,url:e.initSegment},range:[m,_],segmentDuration:7,rangeEnd:_,rangeStart:m}]}else g=this._getRange(e,o);var b,k=(0,n.sf)(g);try{for(k.s();!(b=k.n()).done;){var w=b.value,S=w.item,T=w.range,x=w.segmentDuration,C=w.rangeEnd,P=w.rangeStart,D=d.Z.generateRequestUniqueKey({vid:i,mediaType:t,codecType:e.codec_type,vtype:l,start:S.start,end:S.end,definition:r,bitrate:u,fileId:e.fileId,range:T});c.segments.push({url:S.url,range:T,extData:{cacheKey:D,vid:i,vtype:l,isInitSegment:!1,mediaType:t,useUrlRange:d.Z.validateUrlRange(this.options.url_range_domains,S.url),codecType:e.codec_type,range:T,bitrate:u,segmentDuration:x,checkPreload:!0,rangeEnd:C,rangeStart:P,fileId:e.fileId,urlList:e.backupUrlList}})}}catch(e){k.e(e)}finally{k.f()}}return s}},{key:"_requestAcc",value:function(e,t,i,n){this._calRequests(e,t,i,n,!0)}},{key:"_calStartEnd",value:function(e,t){for(var i=-1,n=0;n=a&&a1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=new s.XK;if(e instanceof ArrayBuffer){var r=0===t.length?e:e.slice(t[0],t[1]+1),a=null===i?null:e.slice(i[0],i[1]+1);n.resolve({initSegmentRes:r,sidxSegmentRes:a})}return n}},{key:"cancel",value:(g=(0,n.x)((0,n.l5)().mark(function e(){var t,i,r,a;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._loader){e.next=3;break}return e.next=3,this._loader.cancel();case 3:this._pendingTask&&(i=(t=this._pendingTask).data,r=t.map,a=this.isStepWise(),this._pendingTask.resolve({remove:!a}),Object.values(r).length>0&&this._setItem(i,r),this._pendingTask=null);case 4:case"end":return e.stop()}},e,this)})),function(){return g.apply(this,arguments)})},{key:"getPreLoadDataSync",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=d.Z.generateRequestUniqueKey(e),r=this.preloadManager.getItemSync(e,t),a=this.preloadManager.getLoadInfoAndDelete(i);return(0,n.Zj)((0,n.Zj)({cacheKey:i},r),{},{loadInfo:a})}},{key:"getPreLoadData",value:(m=(0,n.x)((0,n.l5)().mark(function e(t){var i,r,a,o,s=arguments;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>1&&void 0!==s[1]&&s[1],r=d.Z.generateRequestUniqueKey(t),e.next=4,this.preloadManager.getItem(t,i);case 4:return a=e.sent,o=this.preloadManager.getLoadInfoAndDelete(r),e.abrupt("return",(0,n.Zj)((0,n.Zj)({cacheKey:r},a),{},{loadInfo:o}));case 7:case"end":return e.stop()}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"destroy",value:(_=(0,n.x)((0,n.l5)().mark(function e(){var t;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:null===(t=this._loader)||void 0===t||t.destroy(),this._loader=null,this._pcdn&&(this._pcdn=null);case 3:case"end":return e.stop()}},e,this)})),function(){return _.apply(this,arguments)})},{key:"parseKey",value:function(e){var t,i,a=(0,n.sf)(e);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=r.s.parseKey(o);"audio"===s.mediaType?s.hasAudio=!0:(s.hasVideo=!0,t=Object.assign({},t,s))}}catch(e){a.e(e)}finally{a.f()}return t}},{key:"taskInProgress",get:function(){return!!this._pendingTask.resolve&&!!this._pendingTask.data}}],[{key:"vtype",get:function(){return o.l0.DASH}},{key:"isUniqueCache",value:function(e){return!!e&&(4===Object.keys(e).length||!1)}},{key:"generateUniqueKey",value:function(e){return d.Z.generateRequestUniqueKey(e)}}])}(a.d);g.encryptUtils=h},829503:function(e,t,i){i.d(t,{Z:function(){return o}});var n=i(236699),r=i(983711),a=i(588987),o=function(){function e(t,i,o){var s=this;(0,n.PA)(this,e),(0,n._x)(this,"_missFrames",0),(0,n._x)(this,"_lastTotalFrames",0),(0,n._x)(this,"_lastTime",0),(0,n._x)(this,"_threshold",0),(0,n._x)(this,"_isVFC",!1),(0,n._x)(this,"_longFrames",0),(0,n._x)(this,"_isResize",!1),(0,n._x)(this,"_totalFrames",0),(0,n._x)(this,"_visibilityFrames",0),(0,n._x)(this,"_visibilityTotalFrames",0),(0,n._x)(this,"_mediaElement",null),(0,n._x)(this,"_onPause",function(){s._isPaused=!0}),(0,n._x)(this,"_onPlay",function(){s._isPaused&&(s._resumePlay=!0,s._isPaused=!1)}),(0,n._x)(this,"_onResize",function(){s._isResize=!1,s._resizeNextRender=!0}),(0,n._x)(this,"_onVisibilityChange",function(){if(s._mediaElement&&s._mediaElement.getVideoPlaybackQuality){var e=s._mediaElement.getVideoPlaybackQuality().totalVideoFrames;if(document.hidden)s._visibilityFrames=e;else{if(s._visibilityFrames>0){var t=e-s._visibilityFrames;s._missFrames+=t,s._visibilityTotalFrames+=t}s._isActiveHidden&&s._activeHiddenCallback(e),s._resumeVisibilityChange=!0}}});var u=t.threshold,l=t.minRenderCount,c=t.longTaskScale,d=t.isVFC;this._threshold=u,this._minRenderCount=l,this._longTaskScale=c,this._mediaElement=i,this._isVFC=d,this._activeHiddenCallback=o,this._isActiveHidden=!1,this._ewma=new a.Z(5),this._onResizeHandler=(0,r.P2)(this._onResize,200,function(){!document.hidden&&(s._isResize=!0,s._resizeNextRender=!1)}),window.addEventListener("resize",this._onResizeHandler),document.addEventListener("visibilitychange",this._onVisibilityChange),this._isVFC&&(i.addEventListener("pause",this._onPause),i.addEventListener("play",this._onPlay)),document.hidden&&(this._isActiveHidden=!0)}return(0,n.qH)(e,[{key:"record",value:function(e,t){this._totalFrames=t;var i=e-this._lastTime,n=t-this._lastTotalFrames-1;n<0&&(n=0),this._lastTotalFrames>0&&!this._resumeVisibilityChange&&((this._isResize||this._resizeNextRender)&&n>=this._threshold?(this._missFrames+=n,this._resizeNextRender=!1):((this._isPaused||this._resumePlay)&&(this._resumePlay=!1,i=this._ewma.getEstimate()||20),this._ewma.sample(1,i),1e3/this._ewma.getEstimate()>=this._minRenderCount?i>1e3/this._minRenderCount*2&&(this._missFrames+=n):this._longFrames+=n)),this._lastTime=e,this._lastTotalFrames=t,this._resumeVisibilityChange&&(this._resumeVisibilityChange=!1)}},{key:"missFrames",get:function(){return this._missFrames}},{key:"getStat",value:function(){return{missFrames:this._missFrames,longFrames:this._longFrames,renderDelta:this._ewma.getEstimate()||0,totalFrames:this._totalFrames,visibilityFrames:this._visibilityTotalFrames}}},{key:"destroy",value:function(){this._missFrames=0,this._lastTotalFrames=0,this._lastTime=0,this._longFrames=0,window.removeEventListener("resize",this._onResizeHandler),document.removeEventListener("visibilitychange",this._onVisibilityChange),this._isVFC&&(this._mediaElement.removeEventListener("pause",this._onPause),this._mediaElement.removeEventListener("play",this._onPlay))}}]),e}()},696001:function(e,t,i){i.d(t,{Z:function(){return o},h:function(){return r}});var n=i(236699);function r(){return"undefined"!=typeof localStorage&&localStorage&&!!localStorage.getItem("playerlog")}function a(){return new Date().toLocaleString()}var o=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,n.PA)(this,e),this._enable=i||r(),this._logs=[],this._prefix=t}return(0,n.qH)(e,[{key:"log",value:function(){for(var e,t=arguments.length,i=Array(t),n=0;n4&&void 0!==arguments[4]?arguments[4]:{logger:function(){},openLog:!1};(0,n.PA)(this,e),this._wasmPromise=new r.XK,this._hasDeviceInfoChanged=!0,this.uuid=new Date().getTime().toString(36).slice(4),this._defaultMaxBitrate=0,this._underflowBitrate=0,this._minBitrate=1/0,this._isCurrentHDR=!1,this.config=t,this.segment_duration=o||5e3,this.logger=function(){for(var e=arguments.length,t=Array(e),i=0;i1)||void 0===arguments[1]||arguments[1];if(this._heightToDefinitionConfig=new Map,this._bitrateToDefinitionConfig=new Map,this._definitionToDefitionConfig=new Map,!e){return}e.dynamic_video_list.forEach(function(e){null===(i=t._heightToDefinitionConfig)||void 0===i||i.set(e.height||e.vheight,e);var i,n,r,a=e.bandwidth||e.bitrate;a0&&(this.module?null===(t=(i=this.module).updateBitrate)||void 0===t||t.call(i,e):this.readyPromise().then(function(){var t,i;null===(t=n.module)||void 0===t||null===(i=t.updateBitrate)||void 0===i||i.call(t,e)}))}},{key:"getPreloadBitrate",value:function(){return null}},{key:"_updateDeviceInfo",value:function(e){try{if(this._hasDeviceInfoChanged){var t,i=window.devicePixelRatio||1;null===(t=this.module)||void 0===t||t._updateDeviceInfo(this._videoWidth||Number(this.config.width),this._videoHeight||Number(this.config.height),i,e||-1)}this._hasDeviceInfoChanged=!1}catch(e){}}},{key:"readyPromise",value:function(){return this._wasmPromise}}]);l.SPPED_CACHE=o},196999:function(e,t,i){i.d(t,{d:function(){return s}});var n=i(330124);i(248385),i(679308),i(88856);var r=i(942155),a=i.n(r),o=i(31201),s=function(e){var t,i,r,a;function s(e,t){var i;return(0,n.PA)(this,s),(i=(0,n.$w)(this,s))._data=null,i.preloadManager=e,i._config=t,i.promisePolyfill(),i}return(0,n.XW)(s,e),(0,n.qH)(s,[{key:"taskInProgress",get:function(){return!1}},{key:"stepwise",get:function(){return this.preloadManager.stepwise}},{key:"getRequestOption",value:function(e){var t=this._config,i=t.getRequestOptionsCallback,n=t.reqOptions,r={};return e?r=e.reqOptions?e.reqOptions:"function"==typeof i?i(e):n||{}:r}},{key:"getUserSelectDefinition",value:function(){return this.preloadManager.getUserSelectDefinition()}},{key:"selectBitrate",value:function(e,t,i){return this.preloadManager.selectBitrate(e,t,i)}},{key:"promisePolyfill",value:function(){!Promise.prototype.finally&&(Promise.prototype.finally=({finally:function(e){var t=function(t){return Promise.resolve(e()).then(t)};return this.then(function(e){return t(function(){return e})},function(e){return t(function(){return Promise.reject(e)})})}}).finally)}},{key:"getData",value:function(){return this._data}},{key:"setData",value:function(e){this._data=e}},{key:"start",value:(t=(0,n.x)((0,n.l5)().mark(function e(t,i){return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw Error("start need implement, return Promise");case 1:case"end":return e.stop()}},e)})),function(e,i){return t.apply(this,arguments)})},{key:"cancel",value:(i=(0,n.x)((0,n.l5)().mark(function e(){return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw Error("cancel need implement, cancel current preload request");case 1:case"end":return e.stop()}},e)})),function(){return i.apply(this,arguments)})},{key:"getPreLoadData",value:(r=(0,n.x)((0,n.l5)().mark(function e(t){return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:throw Error("getPreLoadData not implement");case 1:case"end":return e.stop()}},e)})),function(e){return r.apply(this,arguments)})},{key:"getPreLoadDataSync",value:function(e){return null}},{key:"hasItemSameVid",value:function(e){return!0}},{key:"destroy",value:(a=(0,n.x)((0,n.l5)().mark(function e(){return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve());case 1:case"end":return e.stop()}},e)})),function(){return a.apply(this,arguments)})},{key:"parseKey",value:function(e){return o.s.parseKey(e[0])}}],[{key:"generateUniqueKey",value:function(e){throw Error("generateUniqueCacheKey need implement, return string")}},{key:"vtype",get:function(){throw Error("need vtype")}},{key:"isUniqueCache",value:function(e){return!0}}])}(a())},50590:function(e,t,i){i.d(t,{F:function(){return a}});var n=i(730210);i(941533),i(451236),i(9498),i(248385),i(663030);var r=i(423013),a=function(e){function t(){var e;return(0,n.PA)(this,t),e=(0,n.$w)(this,t,arguments),e._oldContext=null,e._curContext=null,e}return(0,n.XW)(t,e),(0,n.qH)(t,[{key:"start",value:function(){var e=this,t=this.instManager;this.stop(),t.on(r.L.VIDEO_LIST_CONTEXT_CHANGED,function(){var i=t.getVideoListContext();if(!!i)e._curContext&&(e._oldContext=e._curContext),e._curContext=i,e._execTask()})}},{key:"stop",value:function(){this.instManager.off(r.L.VIDEO_LIST_CONTEXT_CHANGED)}},{key:"_execTask",value:function(){this._cancelPrevVideoTask(),this._tryResumeDownloadTask()}},{key:"_getDistanceToNearestLiveVideo",value:function(e){if(!e)return -1;var t=this.instManager.getVideoListContext();if(!t||!t.allVideos||0===t.allVideos.length)return -1;var i=t.allVideos.findIndex(function(t){return t.vid===e});if(-1===i)return -1;for(var n=-1,r=i+1,a=r;a-1&&"number"==typeof o&&o>0&&u+1<=o&&this._suspendDownload(s)}}}},{key:"_satisfyToCancel",value:function(e){return!!e&&(!!(e.getBufferedRange()[1]>=(this.config.cancelMinBuffer||0))||!1)}},{key:"_getWorkingPlugin",value:function(e){if(!!e)return e.plugins.mp4encryptplayer||e.plugins.dashplugin}},{key:"_suspendDownload",value:function(e){var t=this;if(!!e&&!!e.vid&&!e.isLive)this.instManager.findAll(function(t){var i;return(null===(i=t.config)||void 0===i?void 0:i.vid)===e.vid}).forEach(function(e){if(!!t._satisfyToCancel(e)){var i,n=t._getWorkingPlugin(e);n&&(null===(i=n.suspendLoading)||void 0===i||i.call(n))}})}},{key:"_tryResumeDownloadTask",value:function(){var e=this;if(!!this._curContext){var t=this._curContext.current,i=this.instManager.findAll(function(e){var i;return(null===(i=e.config)||void 0===i?void 0:i.vid)===t.vid||e.isUserActive});i.length>0&&i.forEach(function(t){var i,n=e._getWorkingPlugin(t);null!=n&&n.isSuspendLoading&&(null===(i=n.resumeLoading)||void 0===i||i.call(n))})}}}])}(i(613753).N);a.STRATEGY_NAME="vod-live-joint-optimize"},924718:function(e,t,i){i.d(t,{e:function(){return l}});var n=i(730210);i(346984),i(705574),i(124300),i(162093),i(171655),i(932651),i(2885),i(248385),i(591111),i(437545),i(630361),i(497736),i(954018),i(506442),i(795434),i(664089),i(863063),i(478782),i(866124),i(378508),i(70698),i(669689),i(490629);var r=i(524992),a=i(264583),o=i(65661),s=i(449782),u=new Map,l=function(){var e,t;function i(e,t,a,o){var u,l=this;(0,n.PA)(this,i),this.options=i.getDefaultConfig(),Object.keys(e).map(function(t){void 0!==e[t]&&null!==e[t]&&(l.options[t]=e[t])}),!this.options.productConfig||this.options.productConfig.app_id,this.loader=new r.mf(this.options),this.resetTrackeArgs(),this._lastFileInfo=null,this.lastfetchNodeTime=-1,this._lastRetFileKey=null,this._minUpdateNodeStep=this.options.ErrorTimeStep,null!==(u=this.options)&&void 0!==u&&null!==(u=u.adaptPCDNConfig)&&void 0!==u&&u.PCDNBufferControl&&(this.pcdnAdapt=new s.Z(t,a,o,this.options.adaptPCDNConfig))}return(0,n.qH)(i,[{key:"isOpenAdaptPCDN",get:function(){return!!this.pcdnAdapt}},{key:"curPCDNInBuffer",get:function(){return this.pcdnAdapt.curPCDNInBuffer}},{key:"getPCDNInBuffer",value:function(){var e;return null===(e=this.pcdnAdapt)||void 0===e?void 0:e.getPCDNInBuffer()}},{key:"curPCDNOutBuffer",get:function(){return this.pcdnAdapt.curPCDNOutBuffer}},{key:"getPCDNOutBuffer",value:function(){var e;return null===(e=this.pcdnAdapt)||void 0===e?void 0:e.getPCDNOutBuffer()}},{key:"curPCDNChangeCnt",get:function(){return this.pcdnAdapt.PCDNChangeCnt}},{key:"getPCDNChangeCnt",value:function(){var e;return null===(e=this.pcdnAdapt)||void 0===e?void 0:e.getPCDNChangeCnt()}},{key:"updatePCDNBitrate",value:function(e){var t;return null===(t=this.pcdnAdapt)||void 0===t?void 0:t.updateBitrate(e)}},{key:"resetTrackeArgs",value:function(e){this.trackeArgs={fid:null,trace_id:null,req_times:(null==e?void 0:e.req_times)||0,resp_times:(null==e?void 0:e.resp_times)||0,token:null,node_num:this.options.node_num,client_info:this.options.client_info}}},{key:"getPCDNNode",value:function(e,t,i){var n,r=d(t),o=u.get(c(e,r)),s=new a.Qo;return!(null!=o&&o.nodes)||(null==o||null===(n=o.nodes)||void 0===n?void 0:n.length)<1?this.fetchPCDNNode(null,null,i).then(function(e){s.resolve(e)}).catch(function(e){s.reject(e)}):(o.fromCache=!0,s.resolve(o)),s}},{key:"removePCDNNode",value:function(e,t,i){var n=d(t),r=u.get(c(e,n)),a=null==r?void 0:r.nodes;a&&(i?r.nodes=a.filter(function(e){return e&&0>i.indexOf(e.url)}):a.shift(),u.set(c(e,n),r)),(!a||!a.length)&&this.fetchPCDNNode().then().catch(function(){})}},{key:"fetchPCDNNode",value:(e=(0,n.x)((0,n.l5)().mark(function e(t,o,s){var l,h,f,p,v,g,m,_,y,b,k,w,S,T,x,C;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(l=new a.Qo,o){e.next=5;break}o=this._lastFileInfo,e.next=15;break;case 5:if(o.byterate=d(o.bitrate),this.options.trackerOptions&&Object.assign(o,this.options.trackerOptions),this._lastFileInfo=Object.assign({},o,{byterate:o.byterate}),!((null==(f=u.get(c(o.vid,o.byterate)))||null===(h=f.nodes)||void 0===h?void 0:h.length)>0)){e.next=13;break}return f.fromCache=!0,l.resolve(f),e.abrupt("return",l);case 13:delete o.bitrate,this._lastFileInfo=o;case 15:if(o){e.next=18;break}return l.resolve(null),e.abrupt("return",l);case 18:if(p=!1,v=c(o.vid,o.byterate),this._lastRetFileKey!==v&&(this.resetTrackeArgs(),p=!0),!(Date.now()-this.lastfetchNodeTime=this.options.maxCnt)){e.next=33;break}return l.resolve(null),e.abrupt("return",l);case 33:return!this.loader&&(this.loader=new r.mf(this.options)),this.trackeArgs.req_times+=1,e.prev=35,i.pcdn_tracker_request_cnt++,e.next=39,this.loader.load(t||this.options.trackerUrl,{body:g});case 39:m=e.sent,_=null,m&&(this.trackeArgs.resp_times+=1,b=8*o.byterate,m.done&&null!==(y=m.data)&&void 0!==y&&y.Result?((_=(k=m.data.Result).nodes)&&_.length>0?i.pcdn_tracker_success_cnt++:this._minUpdateNodeStep=this.options.NULLNodeTimeStep,_.map(function(e){e.vid=o.vid,e.bitrate=b}),w=k.fid,S=k.trace_id,T=k.req_id,x={nodes:_,fid:w,vid:o.vid,trace_id:S,req_id:T,bitrate:b},C=c(o.vid,o.byterate),u.set(C,x),this.trackeArgs.fid=k.fid,this.trackeArgs.trace_id=k.trace_id,this.trackeArgs.token=k.token,l.resolve(x)):(this._minUpdateNodeStep=this.options.ErrorTimeStep,l.reject(m))),e.next=49;break;case 44:e.prev=44,e.t0=e.catch(35),this._minUpdateNodeStep=this.options.ErrorTimeStep,l.reject(e.t0);case 49:return e.abrupt("return",l);case 50:case"end":return e.stop()}},e,this,[[35,44]])})),function(t,i,n){return e.apply(this,arguments)})}],[{key:"pluginName",get:function(){return"PCDN"}},{key:"pcdnReqCnt",get:function(){var e=i.pcdn_tracker_request_cnt,t=i.pcdn_tracker_success_cnt;return i.pcdn_tracker_request_cnt=0,i.pcdn_tracker_success_cnt=0,{pcdn_tracker_request_cnt:e,pcdn_tracker_failed_cnt:e-t}}},{key:"getDefaultConfig",value:function(){return{trackerUrl:"",loaderType:o.t.FETCH,responseType:o.U.JSON,mode:"cors",method:"POST",retry:0,retryDelay:3e3,timeout:5e3,node_num:5,client_info:null,maxCnt:30,withReferer:0,NULLNodeTimeStep:6e4,ErrorTimeStep:15e3}}},{key:"gainPCDNNode",value:(t=(0,n.x)((0,n.l5)().mark(function e(t,o,s,u){var l,c,h,f,p,v;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return l=i.getDefaultConfig(),Object.keys(o).map(function(e){void 0!==o[e]&&null!==o[e]&&(l[e]=o[e])}),!u||u.app_id,c=new a.Qo,s?(s.byterate=d(s.bitrate),this.options.trackerOptions&&Object.assign(s,this.options.trackerOptions),delete s.bitrate):c.reject("video fileInfo need set"),h=JSON.stringify(Object.assign(u,{file_info:s},{node_num:(null==o?void 0:o.node_num)||3})),f=new r.mf(l),e.prev=8,i.pcdn_tracker_request_cnt++,e.next=12,f.load(t,{body:h});case 12:(v=e.sent).done&&(null===(p=v.data)||void 0===p||null===(p=p.Result)||void 0===p||null===(p=p.nodes)||void 0===p?void 0:p.length)>0&&i.pcdn_tracker_success_cnt++,c.resolve(v),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(8),c.reject((null===e.t0||void 0===e.t0?void 0:e.t0.message)||"get pcdnNode error");case 20:return e.abrupt("return",c);case 21:case"end":return e.stop()}},e,this,[[8,17]])})),function(e,i,n,r){return t.apply(this,arguments)})}])}();function c(e,t){return"".concat(e,"-").concat(t)}function d(e){return Math.floor(e/8)}(0,n._x)(l,"pcdn_tracker_request_cnt",0),(0,n._x)(l,"pcdn_tracker_success_cnt",0)},713804:function(e,t,i){i.d(t,{XB:function(){return n},cF:function(){return r},eq:function(){return s},uZ:function(){return a}}),i(487689),i(2885);var n={beta:.49,eta:5200,gamma:1100};function r(e,t,i,n){for(var r=1-(1-a(t,0,1))*(1-o(n,e.beta,e.eta,e.gamma)),s=n,u=i;u-s>1;){var l=(s+u)/2;o(l,e.beta,e.eta,e.gamma)0&&i.eta>0&&i.gamma>0)&&(i=t)}catch(e){i=t}return i}},929415:function(e,t,i){i.d(t,{j:function(){return n}});var n="undefined"!=typeof window},403177:function(e,t,i){i.d(t,{wN:function(){return o}});var n=i(570783),r=["algorithm","type"];function a(e,t,i){return"number"!=typeof e||Number.isNaN(e)?t:Math.min(i,Math.max(t,e))}function o(e){if(!!e){if(e&&"object"===(0,n.Ac)(e)){e.algorithm;var t=e.type,i=(0,n.Kd)(e,r);return 1===t?new s(i):new u(i)}}}var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,n.PA)(this,e);var i=t.alpha,r=t.minTimeout,a=t.maxTimeout,o=t.initialTimeout;this._alpha=void 0===i?.8:i,this._min=void 0===r?0:r,this._max=void 0===a?1/0:a,this._initial=o,this._ewma=void 0}return(0,n.qH)(e,[{key:"getTimeout",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return a(Math.round(null!==(e=null!==(t=this._ewma)&&void 0!==t?t:this._initial)&&void 0!==e?e:i),this._min,this._max)}},{key:"update",value:function(e){if("number"!=typeof e||Number.isNaN(e)||e<0)return this.getTimeout();var t=this._ewma||3e3;return this._ewma=this._alpha*e+(1-this._alpha)*t,this.getTimeout()}},{key:"reset",value:function(){this._ewma=void 0}}]),e}(),u=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,n.PA)(this,e);var i=t.alpha,r=t.beta,a=t.k,o=t.minTimeout,s=t.maxTimeout,u=t.initialTimeout;this._alpha=void 0===i?.125:i,this._beta=void 0===r?.25:r,this._k=void 0===a?4:a,this._min=void 0===o?0:o,this._max=void 0===s?1/0:s,this._initial=u||1e3,this._srtt=void 0,this._rttvar=void 0}return(0,n.qH)(e,[{key:"getTimeout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return a(Math.round(void 0!==this._srtt&&void 0!==this._rttvar?this._srtt+this._k*this._rttvar:null!=e?e:this._initial),this._min,this._max)}},{key:"update",value:function(e){if("number"!=typeof e||Number.isNaN(e)||e<0)return this.getTimeout();if(void 0===this._srtt||void 0===this._rttvar)return this._srtt=e,this._rttvar=e/2,this.getTimeout();var t=this._srtt;return this._srtt=t+this._alpha*(e-t),this._rttvar=this._rttvar+this._beta*(Math.abs(e-t)-this._rttvar),this.getTimeout()}},{key:"reset",value:function(){this._srtt=void 0,this._rttvar=void 0}}]),e}()},264583:function(e,t,i){function n(){var e,t,i=new Promise(function(i,n){e=i,t=n});return i.used=!1,i.resolve=function(){return i.used=!0,e.apply(void 0,arguments)},i.reject=function(){return i.used=!0,t.apply(void 0,arguments)},i}function r(){try{return parseInt(performance.now(),10)}catch(e){return new Date().getTime()}}i.d(t,{Kp:function(){return a},Qo:function(){return n},je:function(){return r}});var a={stringify:function(e){try{return JSON.stringify(e)}catch(e){return""}},parse:function(e){try{return JSON.parse(e)}catch(e){return}}}},897311:function(e,t,i){i.d(t,{N:function(){return s}});var n=i(697946),r=i(834279),a=i(578548),o=i(107180),s=function(){function e(t,i,r){(0,n.PA)(this,e),this.videoTrack=t,this.audioTrack=i;var a=/Chrome\/([^.]+)/.exec(navigator.userAgent);this.forceFirstIDR=a&&50>Number(a[1]),this.log=new o.Y("FMP4Remuxer",!r||!r.openLog||!r.openLog)}return(0,n.qH)(e,[{key:"remux",value:function(){var e,t,i,n,a,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=this.videoTrack,l=this.audioTrack,c=u.exist(),d=l.exist(),h=[];return o&&(s&&s.initMerge?(c&&h.push(this.videoTrack),d&&h.push(this.audioTrack),i=r.b.initSegment(h)):(c&&(e=r.b.initSegment([this.videoTrack])),d&&(t=r.b.initSegment([this.audioTrack])))),c&&u.hasSample()&&(n=this._remuxVideo()),d&&l.hasSample()&&(a=this._remuxAudio()),u.samples=[],l.samples=[],{initSegment:i,videoInitSegment:e,audioInitSegment:t,videoSegment:n,audioSegment:a}}},{key:"_remuxVideo",value:function(){var e=this.videoTrack;this.forceFirstIDR&&(e.samples[0].flag={dependsOn:2,isNonSyncSample:0});var t=e.samples,i=/av01/.test(e.codec),n=0;i?t.forEach(function(e){n+=e.data.byteLength}):t.forEach(function(e){n+=e.units.reduce(function(e,t){return e+t.byteLength},0)+4*e.units.length});var o=new Uint8Array(n);if(i)for(var s,u=0,l=t.length,c=0;u