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

2 lines
116 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see player-10.4c794722.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,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function n(e,t,n){if(n||2==arguments.length)for(var i,r=0,a=t.length;r<a;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var i=/[^a-zA-Z0-9\\_:.-]/gim,r=/</g,a=/>/g,o=/&#([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,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,v=function(e){return e.replace(r,"&lt;").replace(a,"&gt;")},_={indexOf:function(e,t){var n,i;for(n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return -1},forEach:function(e,t,n){var i,r;for(i=0,r=e.length;i<r;i++)t.call(n,e[i],i,e)},some:function(e,t,n){var i,r;for(i=0,r=e.length;i<r;i++)if(t.call(n,e[i],i,e))return!0;return!1},trim:function(e){return e.replace(/(^\s*)|(\s*$)/g,"")},includes:function(e,t){if("string"==typeof e)return -1!==e.indexOf(t);for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1},uniq:function(e){for(var t={},n=[],i=0;i<e.length;i++)t[e[i]]||(n.push(e[i]),t[e[i]]=!0);return n},from:function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},keys:function(e){var t=[];for(var n in e)t.push(n);return t}};function p(e){return null==e}function m(e){var t;return'"'===(t=e)[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]?e.substr(1,e.length-2):e}function g(e){var t,n,i,r,a,o,s,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",l=0;for(e=function(e){e=e.replace(/rn/g,"n");for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):i>127&&i<2048?t+=String.fromCharCode(i>>6|192)+String.fromCharCode(63&i|128):t+=String.fromCharCode(i>>12|224)+String.fromCharCode(i>>6&63|128)+String.fromCharCode(63&i|128)}return t}(e);l<e.length;)r=(t=e.charCodeAt(l++))>>2,a=(3&t)<<4|(n=e.charCodeAt(l++))>>4,o=(15&n)<<2|(i=e.charCodeAt(l++))>>6,s=63&i,isNaN(n)?o=s=64:isNaN(i)&&(s=64),c=c+u.charAt(r)+u.charAt(a)+u.charAt(o)+u.charAt(s);return c}function y(e){var t,n,i,r,a,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",c=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");c<e.length;)t=s.indexOf(e.charAt(c++))<<2|(r=s.indexOf(e.charAt(c++)))>>4,n=(15&r)<<4|(a=s.indexOf(e.charAt(c++)))>>2,i=(3&a)<<6|(o=s.indexOf(e.charAt(c++))),u+=String.fromCharCode(t),64!==a&&(u+=String.fromCharCode(n)),64!==o&&(u+=String.fromCharCode(i));return function(e){for(var t="",n=0,i=0,r=0,a=0;n<e.length;)(i=e.charCodeAt(n))<128?(t+=String.fromCharCode(i),n++):i>191&&i<224?(t+=String.fromCharCode((31&i)<<6|63&(a=e.charCodeAt(n+1))),n+=2):(a=e.charCodeAt(n+1),t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&(r=e.charCodeAt(n+2))),n+=3);return t}(u)}function k(e,t,n){var i="",r=0,a=!1,o=!1,s=0,u=e.length,c="",l="";e:for(s=0;s<u;s++){var d=e.charAt(s);if(!1===a){if("<"===d){a=s;continue}}else if(!1===o){if("<"===d){i+=n(e.slice(r,s)),a=s,r=s;continue}if(">"===d||s===u-1){i+=n(e.slice(r,a)),c=function(e){var t,n=_.spaceIndex(e);return t=-1===n?e.slice(1,-1):e.slice(1,n+1),"/"===(t=_.trim(t).toLowerCase()).slice(0,1)&&(t=t.slice(1)),"/"===t.slice(-1)&&(t=t.slice(0,-1)),t}(l=e.slice(a,s+1)),i+=t(a,i.length,c,l,"</"===l.slice(0,2)),r=s+1,a=!1;continue}if('"'===d||"'"===d)for(var h=1,f=e.charAt(s-h);""===f.trim()||"="===f;){if("="===f){o=d;continue e}f=e.charAt(s-++h)}}else if(d===o){o=!1;continue}}return r<u&&(i+=n(e.substr(r))),i}function b(e,t){var n=0,r=0,a=[],o=!1,s=e.length;function u(e,n){if(!((e=(e=_.trim(e)).replace(i,"").toLowerCase()).length<1)){var r=t(e,n||"");r&&a.push(r)}}for(var c=0;c<s;c++){var l=e.charAt(c),d=void 0;if(!1!==o||"="!==l){if(!1===o||c!==r){if(/\s|\n|\t/.test(l)){if(e=e.replace(/\s|\n|\t/g," "),!1===o){if(-1===(d=function(e,t){for(;t<e.length;t++){var n=e[t];if(" "!==n)return"="===n?t:-1}return -1}(e,c))){u(_.trim(e.slice(n,c))),o=!1,n=c+1;continue}c=d-1;continue}if(-1===(d=function(e,t){for(;t>0;t--){var n=e[t];if(" "!==n)return"="===n?t:-1}return -1}(e,c-1))){u(o,m(_.trim(e.slice(n,c)))),o=!1,n=c+1;continue}}}else{if(-1===(d=e.indexOf(l,c+1)))break;u(o,_.trim(e.slice(r+1,d))),o=!1,n=(c=d)+1}}else o=e.slice(n,c),n=c+1,r='"'===e.charAt(n)||"'"===e.charAt(n)?n:function(e,t){for(;t<e.length;t++){var n=e[t];if(" "!==n)return"'"===n||'"'===n?t:-1}return -1}(e,c+1)}return n<e.length&&(!1===o?u(e.slice(n)):u(o,m(_.trim(e.slice(n))))),_.trim(a.join(" "))}function C(e,t,n){if(n=function(e){return e=function(e){for(var t="",n=0,i=e.length;n<i;n++)t+=32>e.charCodeAt(n)?" ":e.charAt(n);return _.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(c," "))}(n),"href"===t||"src"===t){if("#"===(n=_.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"===t){if(l.lastIndex=0,l.test(n))return""}else if("style"===t&&(h.lastIndex=0,h.test(n)||(d.lastIndex=0,d.test(n)&&(l.lastIndex=0,l.test(n)))))return"";return n=function(e){return e=v(e=e.replace(f,"&quot;"))}(n)}var E=function(e){return"string"==typeof e?e.replace(/'/g,'"').replace('=""',"").replace(/\s+/g,"").toLowerCase():""},A=function(){function e(e){var t=function(e){var t={};for(var n in e)t[n]=e[n];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=C,t.escapeHtml=v,this.options=Object.assign(t,e)}return e.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t,n,i,r,a,o,s=this.options,u=s.whiteList,c=s.onTag,l=s.onIgnoreTag,d=s.onTagAttr,h=s.onIgnoreTagAttr,f=s.safeAttrValue,v=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="",n=0;n<e.length;){var i=e.indexOf("\x3c!--",n);if(-1===i){t+=e.slice(n);break}t+=e.slice(n,i);var r=e.indexOf("--\x3e",i);if(-1===r)break;n=r+3}return t}(e));var p=!1;s.stripIgnoreTagBody&&(n=s.stripIgnoreTagBody,"function"!=typeof(i=l)&&(i=function(){}),r=!Array.isArray(n),a=[],o=!1,l=(p={onIgnoreTag:function(e,t,s){var u;if(u=e,r||-1!==_.indexOf(n,u)){if(s.isClosing){var c="[/removed]",l=s.position+c.length;return a.push([!1!==o?o:s.position,l]),o=!1,c}return o||(o=s.position),"[removed]"}return i(e,t,s)},remove:function(e){var t="",n=0;return _.forEach(a,function(i){t+=e.slice(n,i[0]),n=i[1]}),t+=e.slice(n)}}).onIgnoreTag);var m=k(e,function(e,t,n,i,r){var a={sourcePosition:e,position:t,isClosing:r,isWhite:Object.prototype.hasOwnProperty.call(u,n)},o=c(n,i,a);if(null!=o)return o;if(a.isWhite){if(a.isClosing)return"</".concat(n,">");var s=function(e){var t=_.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var n="/"===(e=_.trim(e.slice(t+1,-1)))[e.length-1];return n&&(e=_.trim(e.slice(0,-1))),{html:e,closing:n}}(i),p=u[n],m=b(s.html,function(e,t){var i=-1!==_.indexOf(p,e),r=d(n,e,t,i);return null==r?i?(t=f(n,e,t,null))?"".concat(e,'="').concat(t,'"'):e:null==(r=h(n,e,t,i))?void 0:r:r});return i="<".concat(n),m&&(i+=" ".concat(m)),s.closing&&(i+=" /"),i+=">"}return null==(o=l(n,i,a))?v(i):o},v);return p&&(m=p.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")(),T=new(function(){function e(){var e=this;this.batchData=[],this.uniqKeys=new Set,this.timeout=2e3,this.lock=!1,this.getSlardarBid=function(){var t,n,i="douyin_web";if(!_.includes(i,"bid"))return i;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===(n=null===(t=null==x?void 0:x.Slardar)||void 0===t?void 0:t._baseParams)||void 0===n?void 0:n.bid)||"argus"},this.getConfigRegion=function(){var t;return _.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 n=e.batchData.slice(0,100);e.batchData=e.batchData.slice(100),x.fetch(t,{method:"post",body:JSON.stringify(n),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 n="object"==typeof window?window.location.href:"SSR";e.documentUrl=n;var i={age:Math.floor(Date.now()),type:"xss",url:n,body:e,"user-agent":""};"enforce"===e.disposition&&"SSR"!==n||(i.url=t),"SSR"===n&&(i.url="SSR___".concat(i.url),i.body.ssr=!0),this.push(i)}},e}()),L=function(e){for(var t=0,n=function(n){Array.isArray(e[n])?0===e[n].length?delete e[n]:(e[n]=_.from(_.uniq(e[n])),t+=e[n].length):0===_.keys(e[n]).length?delete e[n]:_.keys(e[n]).forEach(function(i){e[n][i]=_.from(_.uniq(e[n][i])),t+=e[n][i].length})},i=0,r=_.keys(e);i<r.length;i++)n(r[i]);return{count:t,ret:e}};function S(e,t){return T.setConfig(t),new A(t).process(e)}function D(e){var t,n=(t=/\s|\n|\t/.exec(e))?t.index:-1;if(-1===n)return{html:"",closing:"/"===e[e.length-2]};var i="/"===(e=e.slice(n+1,-1).trim())[e.length-1];return i&&(e=e.slice(0,-1).trim()),{html:e,closing:i}}var P=function(e){return -1===(e=(e=(e=(e=e.replace(/&colon;/gi,":")).replace(/&tab;/gi,"")).replace(/&newline;/gi,"")).replace(/(\t|\n|\r)/g,"")).indexOf("&#")?e.trim().toLowerCase():e.trim().replace(/&#(?:(x)([0-9a-f]+)|([0-9]+));?/gi,function(e,t,n,i){return String.fromCharCode(t?parseInt(n,16):parseInt(i))}).replace(/(\t|\n|\r)/g,"").toLowerCase()};function I(e,t){if(void 0===e&&(e=""),"string"!=typeof e)return!0;if(e=P(e),_.includes(e,"base64")&&!function(e){if(""===e||""===e.trim())return!0;try{return!_.includes(e,"data:text/html;base64")}catch(e){return!0}}(e))return t&&t("data:text/html;base64"),!1;var n=["expression(","behavior:","view-source:"];if(_.some(n,function(t){return -1!==e.indexOf(t)}))return _.forEach(n,function(n){-1!==e.indexOf(n)&&t&&t(n)}),!1;var i=["data:application","data:javascript","data:text/html","data:texthtml"];if(_.some(i,function(t){return -1!==e.indexOf(t)}))return _.forEach(i,function(n){-1!==e.indexOf(n)&&t&&t(n)}),!1;if(e.indexOf("javascript:")>0)return t&&t("javascript:"),!1;if(/^javascript:/i.test(e)){var r=e.slice(11).replace(/\s/g,"").trim();return!!_.some(["void","void(0)","void0","false","undefined",";"],function(e){return e===r})||(t&&t("javascript:"),!1)}return!0}var N=function(e,t){var n,i,r="<%= isSaveValidUrl =>";if("string"!=typeof e||(i=Number("<%= urlLimit =>"),void 0!==n&&(i=n),"NaN"!==e.toString()&&-1!==i&&e.length>=i)||I(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 w(e,t,i){if(void 0===e&&(e=""),void 0===t&&(t=[]),"string"!=typeof e)return!0;if(!I(e=P(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 i?!!i(e):!(!o||!s)&&(!_.includes(["http","https","file"],o)||("object"==typeof window&&window&&(t=n(n([],t,!0),[location.host],!1)),_.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:[]},M={collect:null,initCollect:function(){this.collect={whiteList:{},filterProtocol:[]}},removeCollect:function(){var e=L(this.collect),t=e.count,n=e.ret;return this.collect=null,{collectKey:0===t?null:JSON.stringify(n),collectMode:"white"}},onIgnoreTagAttr:function(e,t,i){return e&&_.indexOf(["href","src"],t)>-1?M.domainWhiteList&&Array.isArray(M.domainWhiteList)&&M.domainWhiteList.length>0&&!w(i,n([],M.domainWhiteList,!0))?"":"".concat(t,'="').concat(N(i,function(e){var t;null===(t=M.collect)||void 0===t||t.filterProtocol.push(e)}),'"'):e&&(_.indexOf(["style","class","id"],t)>-1||t.indexOf("data-")>-1)?"".concat(t,'="').concat(i,'"'):(M.collect.whiteList[e]=M.collect.whiteList[e]||[],void M.collect.whiteList[e].push(t))},onIgnoreTag:function(e,t){if("style"===e)return t;k(t,function(e,t,n,i){b(D(i).html.replace("/",""),function(e){M.collect.whiteList[n]=M.collect.whiteList[n]||[],M.collect.whiteList[n].push(e)})},v)},whiteList:R,mergeWhiteList:function(e){for(var t,n={},i=0,r=_.keys(R);i<r.length;i++)n[t=r[i]]=_.from(R[t]);for(var a=0,o=_.keys(e);a<o.length;a++)n[t=o[a]]=t in R?R[t].concat(e[t]):_.from(e[t]);return n},setWhiteList:function(e){for(var t=0,n=_.keys(e);t<n.length;t++){var i=n[t];this.whiteList[i]=i in R?R[i].concat(e[i]):_.from(e[i])}}};try{var O={},Z="merge";_.includes(Z,"override")&&(M.whiteList=O.whiteList),_.includes(Z,"merge")&&M.setWhiteList(O.whiteList)}catch(e){}var V=function(e,t){for(var n={},i=0,r=_.keys(e);i<r.length;i++){var a=r[i];Array.isArray(e[a])?n[a]=_.from(e[a]):n[a]=V({},e[a])}for(var o=0,s=_.keys(t);o<s.length;o++)(a=s[o])in e?Array.isArray(e[a])?n[a]=e[a].concat(t[a]):n[a]=V(e[a],t[a]):Array.isArray(t[a])?n[a]=_.from(t[a]):n[a]=V({},t[a]);return n},U={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 W={};W.blackAttrRegExps&&(W.blackAttrRegExps=W.blackAttrRegExps.map(function(e){return new RegExp(e.toString().slice(1,e.toString().length-1))}));var B="merge";_.includes(B,"override")&&(U=W),_.includes(B,"merge")&&(U=V(U,W))}catch(e){}var F={mode:"black",whiteList:{},blackConfig:U,collect:null,initCollect:function(){F.collect={blackList:{},blackTags:[],blackAttrs:[],blackAttrRegExps:[],filterAttrs:[],filterList:{},filterProtocol:[]}},removeCollect:function(){var e=L(F.collect),t=e.count,n=e.ret;return F.collect=null,{collectKey:0===t?null:JSON.stringify(n),collectMode:"black"}},onIgnoreTag:function(e,t){var n;if(!_.includes(U.blackTags,e))return k(t,function(e,t,n,i,r){if(-1!==n.indexOf("/"))return v(i);if(r)return"</".concat(n,">");var a=D(i),o=b(a.html,function(e,t){var i,r=0;if(U.blackList[n]&&_.includes(U.blackList[n],e)&&(F.collect.blackList[n]=F.collect.blackList[n]||[],F.collect.blackList[n].push(e),r++),U.blackAttrRegExps.length&&U.blackAttrRegExps.some(function(t){return t.test(e)})&&_.forEach(U.blackAttrRegExps,function(t){t.test(e)&&(F.collect.blackAttrRegExps.push("".concat(t.toString(),"->").concat(e)),r++)}),U.blackAttrs.length&&_.includes(U.blackAttrs,e)&&(U.blackAttrs.push(e),r++),!r){if(U.filterList&&U.filterList[n]&&_.includes(U.filterList[n],e)){var a=N(t,function(e){var t;null===(t=F.collect)||void 0===t||t.filterProtocol.push(e)});return a!==t&&(F.collect.filterList[n]=F.collect.filterList[n]||[],F.collect.filterList[n].push(e)),t?"".concat(e,"='").concat(a,"'"):e}return U.filterAttrs&&_.includes(U.filterAttrs,e)?((a=N(t,function(e){var t;null===(t=F.collect)||void 0===t||t.filterProtocol.push(e)}))!==t&&(null===(i=F.collect)||void 0===i||i.filterAttrs.push(e)),t?"".concat(e,"='").concat(a,"'"):e):t?"".concat(e,"='").concat(t,"'"):e}});return i="<".concat(n),o&&(i+=" ".concat(o)),a.closing&&(i+=" /"),i+=">"},v);null===(n=F.collect)||void 0===n||n.blackTags.push(e)}},H=function(e){var t=e.reportOnly,n=void 0===t||t,i=e.block;return n&&"all"===n?"report":("string"==typeof n&&("true"===n&&(n=!0),"false"===n&&(n=!1)),i?"enforce":n?"report":"enforce")},G=function(e){return function(n,i,r){if(!n||"string"!=typeof n)return n;var a=i;e===S&&(a=M).initCollect();var o=e(n,a);if(E(o)===E(n))return n;if(!r)return o;var s=r.logType,u=H(r),c=a.removeCollect();return T.report(t(t({type:s,disposition:u},c),{sourceText:g(n),filterText:g(o)})),"enforce"===u?o:n}},j=G(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 A(t).process(e)}),q=G(S),z=function(e,t,n){var i=[],r=N(e,function(e){i.push(e)});if(r===e)return e;i=_.from(_.uniq(i));var a=t||n||{};if(!a)return r;var o=a.logType,s=H(n);return T.report({type:o,disposition:s,collectKey:i.join("___"),collectData:JSON.stringify(i),collectMode:"black",sourceText:g(e),filterText:g(r)}),"enforce"===s?r:e},Y=x._xssProject||{},X=x.xssNamespace||{},J="3.0.26",Q={FilterXSS:A,version:J,webpackPluginVersion:"<%= webpackPluginVersion =>",reportOnly:"<%= reportOnly =>",filterXSS:j,_filterXSS:q,filterUrl:z,Config:M,BlackConfig:F,project:Y,setProjectName:function(e){Y[e]=this,x._xssProjectName=e}};X.douyin_web=Q,x.xssNamespace=X,x.Math&&!x.Math.xssNamespace&&(x.Math.xssNamespace=X),Y[J]=Q,x.globalThis=x,x.getFilterXss=function(){return void 0!==this._xssProjectName?this._xssProject[this._xssProjectName]:Q},x.xss=Q,x.isSafeUrl=w,x.isSafeDomain=w,x.isSafeProtocol=I,x._xssProject=Y,x._xssProjectName&&(Y[x._xssProjectName]=Q);var K=Q.setProjectName.bind(Q);e.BlackConfig=F,e.Config=M,e.FilterXSS=A,e._filterXSS=q,e.filterUrl=z,e.filterXSS=j,e.isSafeDomain=w,e.isSafeProtocol=I,e.isSafeUrl=w,e.project=Y,e.setProjectName=K,e.setXssNamespace=function(e){var t=e.appId,n=e.bid,i=e.region;X[t]=Q;M.bid=n,M.region=i,M.enabled=!0},e.xssNamespace=X,Object.defineProperty(e,"__esModule",{value:!0})}),(self.webpackChunkdouyin_web=self.webpackChunkdouyin_web||[]).push([["67333"],{576005:function(e,t,n){n.d(t,{Z:function(){return u}});var i,r=n(61072);n(346984),n(248385),n(663030);var a=n(333777),o=n(718828),s={FIXED:"FIXED",AUTO:"AUTO"};var u=(0,r.qH)(function e(t,n){var i=this;(0,r.PA)(this,e),this.bitrateMap={},this.defIdMap={},this._startPlay=!1,this.canplayHandler=function(){i._startPlay=!0},this.onAbrChange=function(e){var t=e.prevBitrate,n=e.curBitrate,r=i.pluginInst.player,a=i.bitrateMap[t],o=i.bitrateMap[n],s=a?a.definition:"",u=null!=o&&o.definition?o.definition:s;if(s!==u&&!!i._startPlay)i._abrSwitchHandler(o),r.emit("ABR_CHANGE",{prev:s,cur:u,prevName:null==a?void 0:a.definitionName,curName:null==o?void 0:o.definitionName})},this.onAutoDescChange=function(e){var t=e.definition,n=e.reset,r=e.fps,a=e.item;i.updateAutoDefiDesc(t,n,r,a)};var a=t.player;this.pluginInst=t;var o=this.pluginInst.config.autoBitrateOpts||{};this.isPlayAutoDefi=!!o.isPlayAutoDefi,this.isOpenAutoDefi=!!o.isOpenAutoDefi,this.isCurrentAutoDefi=this.isOpenAutoDefi&&this.isPlayAutoDefi,this._abrSwitchHandler=n,a.once("playing",this.canplayHandler)},[{key:"init",value:(i=(0,r.x)((0,r.l5)().mark(function e(t){var n,i,u,c;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isOpenAutoDefi){e.next=2;break}return e.abrupt("return",{type:s.FIXED});case 2:return i=(n=this.pluginInst).player,u=n.playerConfig,c=n.config,i.on(a._c.UPDATE_AUTO_DESC,this.onAutoDescChange),this.bitrateMap={},this.defIdMap={},this.abrInstance=new a.ZP(i,c,0,{dynamic_video_list:u.definition.list.concat()},5e3,{logger:o.cM,openLog:o.i5}),e.next=9,this.abrInstance.init(t);case 9:i.on(a._c.ABR_CHANGE,this.onAbrChange),this.abrInstance&&(this.abrInstance.isCurrentInAbr=this.isCurrentAutoDefi);case 11:case"end":return e.stop()}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"execute",value:function(){var e,t=null===(e=this.abrInstance)||void 0===e?void 0:e.execute();return{bitrate:t,type:-1===t?s.FIXED:s.AUTO}}},{key:"updateBitrate",value:function(e){var t;null===(t=this.abrInstance)||void 0===t||t.updateBitrate(e)}},{key:"updateCurrentHDRStatus",value:function(e){this.abrInstance&&(this.abrInstance.isCurrentHDR=!!e)}},{key:"enable",value:function(){this.isCurrentAutoDefi=!0,this.abrInstance&&(this.abrInstance.start(),this.abrInstance.isCurrentInAbr=!0,this.abrInstance.execTimeUpdate(!0))}},{key:"disable",value:function(){if(!!this.abrInstance)this.updateAutoDefiDesc("",!0),this.isCurrentAutoDefi=!1,this.abrInstance.isCurrentInAbr=!1,this.abrInstance.stop(!0)}},{key:"isCurrentInAbr",value:function(){return!!this.abrInstance&&this.abrInstance.isCurrentInAbr}},{key:"updateAutoDefiDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=this.pluginInst,a=r.player,o=(r.config.autoBitrateOpts||{}).autoDefiText||"auto";a.emit("ABR_AUTO_DESC_CHANGE",o,t?void 0:e,n,i),!t&&(a._currentDefinitionFromPlayer={definition:"自动 ".concat(e),item:i})}},{key:"updateAbrCacheData",value:function(){var e=this,t=this.pluginInst,n=t.player,i=t.config,r=t.playerConfig,a=i.autoBitrateOpts||{},o=r.definition.list,s=!1;if(o.forEach(function(t){e.bitrateMap[t.bitrate]={url:t.url,definition:t.definition,definitionName:t.text},e.defIdMap[t.definition]={bitrate:t.bitrate,definition:t.definition},("auto"===t.definition||"自动"===t.definition)&&(s=!0)}),this.isOpenAutoDefi&&!s){var u=a.autoDefiText||"auto",c={definition:"自动",bitrate:n.curDefinition.bitrate,text:u,url:"__auto__",selected:this.isPlayAutoDefi,name:"自动",vwidth:n.curDefinition.vwidth,vheight:n.curDefinition.vheight};r.definition.list.push(c)}}},{key:"destroy",value:function(){var e=this.pluginInst.player;if(!!e)e.off(a._c.ABR_CHANGE,this.onAbrChange),e.off("playing",this.canplayHandler),this.abrInstance&&(e.off(a._c.UPDATE_AUTO_DESC,this.onAutoDescChange),this.abrInstance.destroy(),this.abrInstance=void 0)}}])},667943:function(e,t,n){n.d(t,{B:function(){return r}});var i=n(61072),r=(0,i.qH)(function e(t){var n=this;(0,i.PA)(this,e),this.alive=!0,this.timeoutId=null,this.onTick=function(e){var t,i;null===(t=n.cancelPending)||void 0===t||t.call(n),n.alive&&(null===(i=n.onTick_)||void 0===i||i.call(n),null==e||e())},this.onTick_=t},[{key:"tickAfter",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cancelPending?this.cancelPending():this.cancelPending=function(){t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)},this.alive=!0,this.timeoutId=setTimeout(this.onTick,1e3*e,n),this}},{key:"tickEvery",value:function(e){var t=this;this.tickAfter(e,function(){t.tickEvery(e)})}},{key:"stop",value:function(){this.alive=!1,this.cancelPending&&(this.cancelPending(),this.cancelPending=void 0)}}])},391834:function(e,t,n){n.d(t,{Lj:function(){return _},ZP:function(){return g}});var i,r,a,o,s,u,c=n(648955);n(705574),n(303846),n(9498),n(932651),n(248385),n(759943),n(706056);var l=n(804870),d=n(405762),h=n(521323),f=["app_id","trackerUrl","sid","task_type"],v={CLOSE:"close",OPEN:"open",FORBIDDEN:"forbidden"},_={PCDN:1,CDN:0},p={PLAY:1},m={enterMinBuffer:10,minDuration:25,openPreloadPCDN:!1,outMaxBuffer:5,openPCDN:!1,trackerUrl:"https://vc-gate.ndcpp.com/sdk/get_peer",withReferer:1};var g=(0,c.qH)(function e(t,n,i,r,a,o){(0,c.PA)(this,e),this._pcdnNodes=null,this._cachedPcdn={},this._PCDNState=v.CLOSE,this._retryInfo={},this._bitrate2file={},this._isOpenPCDN=!1,this._duration=0,this._vid="",this._tag="",this._isUseCDN=!1,this._lastPCDNUrl="",this.pcdn_download_request_cnt=0,this.pcdn_download_failed_cnt=0,this._PCDNSwitchCnt=0,this.pcdn_tracker_failed_cnt=0,this.pcdn_tracker_request_cnt=0,this._pcdnVVStat={try_req_node:0,req_node_succ:0,has_ret_node:0,conn_req_num:0,conn_fail_num:0,conn_jump_num:0,pSCCancelCnt:0},this._lastBitrateMap={},this._pcdnConfig=Object.assign({},m,t),this._isOpenPCDN=n,this.updateConfig({vid:r,duration:i}),this._player=a,this._tag=o},[{key:"getPCDNReqId",value:function(e){var t=e.uri||this._vid;return this._getPCDNReqIdBitrate(t,e.bitrate)}},{key:"_getPCDNReqIdBitrate",value:function(e,t){return e.slice(-20)+t}},{key:"_createFileInfo",value:function(e){var t,n=e.file_id||e.fileId,i=e.main_url||e.baseURL;if(t=i,!/^http(s)?:\/\/.+/.test(t))i=document.location.protocol+i;return{vid:this._vid,cdn_url:i,file_type:"dash",sfid:n,bitrate:e.bitrate,duration:Math.floor(this._duration||0),size:e.size}}},{key:"checkPCDN",value:(i=(0,c.x)((0,c.l5)().mark(function e(t){var n,i,r,a,o,s,u,d,v,_,m,g,y;return(0,c.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._vid){e.next=3;break}return e.abrupt("return");case 3:if(!((null===(n=this._pcdnConfig)||void 0===n?void 0:n.openPCDN)&&this._isOpenPCDN&&this._duration>=this._pcdnConfig.minDuration&&t)){e.next=24;break}if(i=t.bitrate,!(r=this._cachedPcdn[i])){e.next=12;break}if(a=r.pcdnNodeList,o=r.pcdnTraceInfo,!(a&&a.length>0&&o)){e.next=12;break}return this._pcdnTraceInfo=o,e.abrupt("return");case 12:return u=(s=this._pcdnConfig).app_id,d=s.trackerUrl,v=s.sid,_=s.task_type,m=(0,c.Kd)(s,f),g=t.file_id||t.fileId,y=this._createFileInfo(t),this._bitrate2file[t.bitrate]=g,this._pcdn?(h.ZP.log(this._tag,"resetTrackeArgs"),this._pcdn.resetTrackeArgs()):this._pcdn=new l.e((0,c.Zj)({productConfig:{app_id:u,sid:v,task_type:_||p.PLAY},trackerUrl:d},m),this._player,y.bitrate,y.duration),e.prev=17,e.next=20,this.getPCDNNode(t.bitrate,t);case 20:e.next=24;break;case 22:e.prev=22,e.t0=e.catch(17);case 24:case"end":return e.stop()}},e,this,[[17,22]])})),function(e){return i.apply(this,arguments)})},{key:"setSetRetryInfo",value:function(e){var t=d.Z.getHostFromUrl(e);this._retryInfo[t]=!0}},{key:"_updateNodeList",value:function(e,t){var n=this;if(e&&e.nodes){var i,r={pcdnNodeList:e.nodes.filter(function(e){if(!Object.prototype.hasOwnProperty.call(n._retryInfo,d.Z.getHostFromUrl(null==e?void 0:e.url)))return e}),pcdnTraceInfo:{uri:e.vid,fid:e.fid,trace_id:e.trace_id}},a=this._bitrate2file[t];null!==(i=e.fid)&&void 0!==i&&i.includes(a)?(this._cachedPcdn[t]=r,this._pcdnTraceInfo=r.pcdnTraceInfo,h.ZP.log(this._tag,"_updateNodeList",JSON.stringify(this._cachedPcdn))):8*function(e){return Math.floor(e/8)}(t)===e.bitrate&&(this._cachedPcdn[t]=r,h.ZP.log(this._tag,"_updateNodeList not file not match cachedFileid",a,"pcdnRet"))}}},{key:"isUpdateNode",value:function(e){var t=this._getNodeListByBitrate(e);return!t||!t.length}},{key:"selectedPCDN",value:function(e,t){var n,i;if(!!(null===(n=this._pcdnConfig)||void 0===n?void 0:n.openPCDN)){if(this._PCDNState===v.FORBIDDEN||e){this._isUseCDN=!0;return}if(this.isUsePCDN(t)){this._isUseCDN=!1;var r=this._getNodeListByBitrate(t);r&&(i=r[0].url,this._lastPCDNUrl!==i&&(this._lastPCDNUrl=i,this._pcdnVVStat.conn_req_num+=1),this.pcdn_download_request_cnt++)}else!this._isUseCDN&&(this._PCDNSwitchCnt++,this._pcdnVVStat.conn_jump_num+=1,this._PCDNSwitchCnt>=this._pcdnConfig.switchPCDNMaxCnt&&this.updatePCDNState(v.FORBIDDEN,function(){})),this._isUseCDN=!0;return i}}},{key:"isUsePCDN",value:function(e){var t=this._getNodeListByBitrate(e);return this._PCDNState===v.OPEN&&t&&t.length>0}},{key:"_getNodeListByBitrate",value:function(e){var t=this._cachedPcdn[e];return t?t.pcdnNodeList:null}},{key:"getPCDNInOUtBuffer",value:function(){var e,t,n,i=null===(e=this._pcdnConfig)||void 0===e?void 0:e.openPCDN,r=this._pcdnConfig,a=null===(t=this._pcdn)||void 0===t?void 0:t.getPCDNInBuffer(),o=null===(n=this._pcdn)||void 0===n?void 0:n.getPCDNOutBuffer(),s=a||(null==r?void 0:r.enterMinBuffer)||(null==r?void 0:r.minBuffer)||-1,u=o||(null==r?void 0:r.outMaxBuffer)||-1;return{PCDNInBuffer:i?s:-1,PCDNOutBuffer:i?u:-1}}},{key:"isOpenPCDN",value:function(e,t,n,i){if(!!(null===(r=this._pcdnConfig)||void 0===r?void 0:r.openPCDN)){var r,a=this.getPCDNInOUtBuffer(),o=a.PCDNInBuffer,s=a.PCDNOutBuffer;e>=o?this._doOpenPCDN(t,i):e<s&&this.updatePCDNState(v.CLOSE,n)}}},{key:"_emptyCancel",value:function(){}},{key:"_doOpenPCDN",value:(r=(0,c.x)((0,c.l5)().mark(function e(t,n){var i;return(0,c.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.updatePCDNState(v.OPEN,this._emptyCancel),null===(i=this._pcdn)||void 0===i||i.updatePCDNBitrate(t),!this.isUpdateNode(t)){e.next=5;break}return e.next=5,this.getPCDNNode(t,n);case 5:case"end":return e.stop()}},e,this)})),function(e,t){return r.apply(this,arguments)})},{key:"openPCDNForce",value:(a=(0,c.x)((0,c.l5)().mark(function e(t,n){var i;return(0,c.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(i=this._pcdnConfig)||void 0===i?void 0:i.openPCDN){e.next=3;break}return e.abrupt("return");case 3:return this._PCDNState=v.OPEN,e.next=6,this.checkPCDN(n);case 6:case"end":return e.stop()}},e,this)})),function(e,t){return a.apply(this,arguments)})},{key:"updatePCDNState",value:(o=(0,c.x)((0,c.l5)().mark(function e(t,n){return(0,c.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==v.FORBIDDEN){e.next=5;break}this._PCDNState=t,h.ZP.log(this._tag,"updatePCDNState",v.FORBIDDEN),e.next=16;break;case 5:if(!(this._PCDNState!==v.FORBIDDEN&&this._PCDNState!==t)){e.next=16;break}if(!(!this._isUseCDN&&t===v.CLOSE&&this._PCDNState!==v.CLOSE)){e.next=14;break}return this._PCDNState=t,h.ZP.log(this._tag,"updatePCDNState",v.CLOSE),e.next=11,n();case 11:this._pcdnVVStat.pSCCancelCnt++,e.next=16;break;case 14:this._PCDNState=t,h.ZP.log(this._tag,"updatePCDNState",t);case 16:case"end":return e.stop()}},e,this)})),function(e,t){return o.apply(this,arguments)})},{key:"getPCDNNode",value:(s=(0,c.x)((0,c.l5)().mark(function e(t,n){var i,r,a,o,s,u,l,d,f;return(0,c.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._pcdn){e.next=2;break}return e.abrupt("return",null);case 2:if(e.prev=2,r=n.mediaType,a=this._lastfetchNodeTime[r]||0,o=this._lastBitrateMap[r],!((s=Date.now())-a<this._pcdn.options.NULLNodeTimeStep&&o===t)){e.next=9;break}return e.abrupt("return");case 9:return this._lastfetchNodeTime[r]=s,this._lastBitrateMap[r]=t,u=this._getPCDNReqIdBitrate(this._vid,t),l=this._createFileInfo(n),e.next=15,this._pcdn.fetchPCDNNode(null,l,u);case 15:if(d=e.sent,f=this._getPCDNReqIdBitrate(this._vid,t),!(null!=d&&d.req_id&&f!==d.req_id)){e.next=20;break}return h.ZP.log("getPCDNNode is not match curDefinition reqId",u,", pcdnRet.req_id",d.req_id),e.abrupt("return");case 20:d&&this._updateNodeList(d,t),this._pcdnVVStat.try_req_node+=1,this._pcdnVVStat.req_node_succ+=1,this._pcdnVVStat.has_ret_node+=(null==d||null===(i=d.nodes)||void 0===i?void 0:i.length)>0?1:0,e.next=30;break;case 26:e.prev=26,e.t0=e.catch(2),this._pcdnVVStat.try_req_node+=1;case 30:case"end":return e.stop()}},e,this,[[2,26]])})),function(e,t){return s.apply(this,arguments)})},{key:"removePCDNNode",value:(u=(0,c.x)((0,c.l5)().mark(function e(t,n){return(0,c.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._pcdn){e.next=2;break}return e.abrupt("return",null);case 2:return h.ZP.log(this._tag,"removePCDNNode",t,n),this.pcdn_download_failed_cnt++,this._pcdnVVStat.conn_fail_num++,this._cachedPcdn[t]=null,e.next=8,this._pcdn.removePCDNNode(this._vid,t,n);case 8:case"end":return e.stop()}},e,this)})),function(e,t){return u.apply(this,arguments)})},{key:"pcdnReqCnt",get:function(){var e=l.e.pcdnReqCnt;return{pcdn_download_request_cnt:this.pcdn_download_request_cnt,pcdn_download_failed_cnt:this.pcdn_download_failed_cnt,pcdn_tracker_request_cnt:e.pcdn_tracker_request_cnt,pcdn_tracker_failed_cnt:e.pcdn_tracker_failed_cnt}}},{key:"pcdnVVStat",get:function(){var e;return Object.assign({},this._pcdnVVStat,{is_try_open:1,trace_id:null===(e=this._pcdnTraceInfo)||void 0===e?void 0:e.trace_id})}},{key:"updateConfig",value:function(e){var t=e.vid,n=e.duration;this._vid=t,this._duration=n,this._lastfetchNodeTime={audio:0,video:0},this._lastBitrateMap={audio:0,video:0}}}])},778406:function(e,t,n){n.d(t,{Xv:function(){return v},aK:function(){return f},tr:function(){return _}});var i=n(236699),r=n(942155),a=n.n(r),o=n(123563),s=n(648711),u=n(879434),c=n(983711),l=n(696001),d=n(827147),h=n(588987),f="sr_canvas",v="xgplayer-sr",_=function(e){(0,i.XW)(n,e);var t=(0,i.WY)(n);function n(e){(0,i.PA)(this,n),r=t.call(this),(0,i._x)((0,i.Lc)(r),"_superWasmModule",null),(0,i._x)((0,i.Lc)(r),"_readyPromise",(0,c.Qo)()),(0,i._x)((0,i.Lc)(r),"_wasmReady",!1),(0,i._x)((0,i.Lc)(r),"_isCanvasAdded",!1),(0,i._x)((0,i.Lc)(r),"_canvas",null),(0,i._x)((0,i.Lc)(r),"_convasContainer",null),(0,i._x)((0,i.Lc)(r),"_opts",null),(0,i._x)((0,i.Lc)(r),"_running",!1),(0,i._x)((0,i.Lc)(r),"_forceRunning",!0),(0,i._x)((0,i.Lc)(r),"_code",u.te.SUCCESS),(0,i._x)((0,i.Lc)(r),"_codeMsg",""),(0,i._x)((0,i.Lc)(r),"_renderId",-1),(0,i._x)((0,i.Lc)(r),"_root",null),(0,i._x)((0,i.Lc)(r),"_video",null),(0,i._x)((0,i.Lc)(r),"_onRenderCallback",null),(0,i._x)((0,i.Lc)(r),"_onRenderLostCallback",null),(0,i._x)((0,i.Lc)(r),"_onSRCodeChanged",null),(0,i._x)((0,i.Lc)(r),"_stats",new d.Z),(0,i._x)((0,i.Lc)(r),"_hasGLLoged",!1),(0,i._x)((0,i.Lc)(r),"_isSoftVideo",!1),(0,i._x)((0,i.Lc)(r),"_dropRateEwma",new h.Z(10)),(0,i._x)((0,i.Lc)(r),"_moduleContext",{}),(0,i._x)((0,i.Lc)(r),"_glContext",null),(0,i._x)((0,i.Lc)(r),"_isRebuildingContext",!1),(0,i._x)((0,i.Lc)(r),"_contextLostRetryCount",0),(0,i._x)((0,i.Lc)(r),"_maxContextLostRetryCount",1),(0,i._x)((0,i.Lc)(r),"_rebuildPromise",null),(0,i._x)((0,i.Lc)(r),"_onWebGlContextLost",function(e){e.preventDefault(),r._handleContextLost("event")}),(0,i._x)((0,i.Lc)(r),"_doAppendCanvas",function(){}),(0,i._x)((0,i.Lc)(r),"_adjustCanvasPosition",function(){}),r._logger=new l.Z("SrCore",e.enableLog),r._opts=(0,u.Rl)(e),r._useVideoTexture=r._opts.useVideoTexture,r._logger.log("Constructor opts",JSON.stringify(r._opts));var r,a,o=!1;!r._opts.wasmUrl&&(r.code=u.te.WASM_URL_MISS,r._codeMsg="WASM_URL_MISS",r._logger.log("ERROR, WASM_URL_MISS"),o=!0);var s=(0,l.h)();try{var f=[];"undefined"!=typeof HTMLCanvasElement&&f.push(HTMLCanvasElement.prototype.getContext),"undefined"!=typeof WebGL2RenderingContext&&f.push(WebGL2RenderingContext.prototype.linkProgram,WebGL2RenderingContext.prototype.createShader),!(0,c.QC)(f)&&!s&&(r.code=u.te.HIJACK,r._codeMsg="API HIJACK",r._logger.log("API HIJACK"),o=!0)}catch(e){}return!o&&(!s&&r._hijack(),r._useVFC=r._opts.useVFC,r._isCrossOrigin=(null===(a=r._opts.videoConfig)||void 0===a?void 0:a.crossOrigin)==="anonymous",r._createCanvas(),r._handleCanvasEvent(),r._initSuperModule()),r}return(0,i.qH)(n,[{key:"_hijack",value:function(){try{WebGL2RenderingContext&&WebGL2RenderingContext.prototype&&(WebGL2RenderingContext.prototype.getShaderSource=function(){},WebGL2RenderingContext.prototype.getAttachedShaders=function(){return[]})}catch(e){}}},{key:"_createCanvas",value:function(){}},{key:"_handleCanvasEvent",value:function(){if(!!this._canvas)this._opts.enableContextmenu&&this._canvas.addEventListener("contextmenu",this.onContextmenu,!1),this._canvas.addEventListener("webglcontextlost",this._onWebGlContextLost,!1),this._glContext=this._canvas.getContext("webgl2")}},{key:"_removeCanvasEvent",value:function(){if(!!this._canvas)this._opts.enableContextmenu&&this._canvas.removeEventListener("contextmenu",this.onContextmenu),this._canvas.removeEventListener("webglcontextlost",this._onWebGlContextLost),this._glContext=null}},{key:"_recreateCanvas",value:function(){if(this._isWebCodecCore||"undefined"==typeof document||!this._convasContainer||!this._canvas)return!1;try{this._removeCanvasEvent()}catch(e){}try{this._convasContainer.removeChild(this._canvas)}catch(e){}var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");e.id=this._getCanvasId();try{e.classList.add("object-fit-content")}catch(e){}return this._convasContainer.appendChild(e),this._canvas=e,this._handleCanvasEvent(),!0}},{key:"isContextLost",value:function(){if(this.code===u.te.WEBGL_CONTEXT_LOST)return!0;var e=!this._glContext||this._glContext.isContextLost();return e&&this._handleContextLost("check"),e}},{key:"_handleContextLost",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"unknown";if(!this._isRebuildingContext&&this.code!==u.te.WEBGL_CONTEXT_LOST)this._codeMsg="WEBGL Context LOST",this.code=u.te.WEBGL_CONTEXT_LOST,this.emit("error",{code:this.code,msg:this._codeMsg,from:e})}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"_getCanvasId",value:function(){return this._opts.canvasId||f}},{key:"_initSuperModule",value:function(){var e=this,t=this;this._stats.mark(d.E.LOAD_WASM),this._superWasmModule=(0,i.Zj)((0,i.Zj)({},this._moduleContext),{},{wasmBinaryFile:t._opts.wasmUrl,onRuntimeInitialized:function(){t._readyPromise.resolve(),t._stats.endMark(d.E.LOAD_WASM)},print:function(e){t._logger.logMessage("print:",e)},printErr:function(e){t._logger.log("printError:",e)},onAbort:function(e){t._logger.log("onAbort",e),t._readyPromise.reject(Error("LoadFail")),t._wasmReady=!1,t.code=u.te.WASM_LOADED_FAILED,t._codeMsg="WASM_LOADED_FAILED"}}),this._logger.log("Module init"),(0,o.Z)(this._superWasmModule),t._readyPromise.then(function(){var n,i=t._superWasmModule;e.onModuleReadyHook();var r="#".concat(e._getCanvasId(),"\0"),a=new TextEncoder().encode(r),o=i._malloc(a.byteLength+1);i.HEAPU8.set(a,o);var s=t._opts,c=s.algType,l=s.backend,h=s.scaleType,f=s.maxWidth,v=s.maxHeight,_=s.poolSize;t._stats.mark(d.E.WASM_INIT),t._logger.log("algType:".concat(c,", backend:").concat(l,", \n scaleType:").concat(h,", maxWidht:").concat(f,", maxHeight:").concat(v,", poolSize:").concat(_));var p=i._createContext(o,c,l,h,_,f,v,1);t._stats.endMark(d.E.WASM_INIT),t._logger.log("CreateContext result:".concat(p));var m=t.getError(!0);i._free(o),0===p&&0===m?(t._logger.log("CreateContext SUCCESS"),t._wasmReady=!0):(t.code=u.te.WASM_INIT_FAIL,t._codeMsg="CreateContextFail code:".concat(p,", codeMsg:").concat(null===(n=u.eO[p])||void 0===n?void 0:n.msg,", errRet:").concat(m),t._wasmReady=!1,t._logger.log("CreateContext Fail, Fail code",p))}).catch(function(n){t.code=u.te.WASM_INIT_FAIL;var i=JSON.stringify({errMsg:n.message,columnNumber:n.columnNumber,fileName:n.fileName});t._codeMsg="CreateContextCatch ".concat(i),t._wasmReady=!1,t._logger.log("Module init catch",i),n.message.indexOf("Cannot read properties of undefined (reading 'createShader')")>-1&&!e._isWebCodecCore&&(0,s.HR)(!0)})}},{key:"onModuleReadyHook",value:function(){}},{key:"readyPromise",get:function(){return this._readyPromise}},{key:"isContextReady",get:function(){return this._wasmReady}},{key:"video",get:function(){return this._video}},{key:"bindMediaElement",value:function(e,t){var n=t.onRenderCallback,i=t.onRenderLostCallback,r=t.onSRCodeChanged;if(!!this._preBindMediaEle(e))this._onRenderCallback=n,this._onRenderLostCallback=i,this._onSRCodeChanged=r,this._video=e,this._superWasmModule.video=this._getRenderTex(),this._hasDelayedAddCanvas=!1,this._renderCount=0,this._isSizeChange=!1}},{key:"updateTexture",value:function(e){this._video=e,this._superWasmModule.video=this._getRenderTex()}},{key:"_preBindMediaEle",value:function(){return!1}},{key:"_getRenderTex",value:function(){return null}},{key:"_tryRender",value:function(){var e=this;this._readyPromise.then(function(){e._superWasmModule.video=e._getRenderTex(),e._startRenderTick()})}},{key:"_startRenderTick",value:function(){}},{key:"_stopRenderTick",value:function(){}},{key:"_getPrerenderInfo",value:function(){return null}},{key:"_onRender",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!!t||!document.hidden&&"hidden"!==document.visibilityState){var n=this._opts.useScale?u.s8[this._opts.scaleType]:1;try{this._stats.mark(d.E.RENDER);var i=(0,l.h)();!this._hasGLLoged&&this._stats.mark(d.E.GETERRORRENDER);var r=this._getPrerenderInfo(),a=r.isStateValid,o=r.textureWidth,s=r.textureHeight;if(this._superWasmModule.video&&a){var c,h,f=this._useVideoTexture?1:0,v=o>=this._opts.maxWidth,_=s>=this._opts.maxHeight;if(v||_){null===(h=this._onRenderCallback)||void 0===h||h.call(this,{code:u.te.LIMIT_WIDTH_HEIGHT,msg:"Invalid width or height"});return}-1===this._preTextureHeight&&(this._preTextureHeight=o,this._preTextureWidth=s,this._setCanvasWidthHeight(!0,o,s)),(this._preTextureHeight!==s||this._preTextureWidth!==o)&&(this._setCanvasWidthHeight(!0,o,s),this._logger.log("canvas size change"),this._preTextureHeight=s,this._preTextureWidth=o,this._isSizeChange=!0);var p=this._superWasmModule._drawFrame(o,s,n,i||!this._hasGLLoged?1:0,f,this.video.currentTime);if(!this._hasGLLoged&&this._stats.endMark(d.E.GETERRORRENDER),this.isContextLost()&&(p=u.te.WEBGL_CONTEXT_LOST),this._hasGLLoged=!0,this._stats.endMark(d.E.RENDER),e&&p!==u.te.SUCCESS)return;null===(c=this._onRenderCallback)||void 0===c||c.call(this,{code:p}),this._hasDelayedAddCanvas&&!this._isCanvasAdded&&this._doAppendCanvas(),this.onPostRender(),this._hasDelayedAddCanvas=!0}else this._logger.log("render video not exist, destroyed")}catch(e){var m,g,y="",k=null==e?void 0:null===(m=e.stack)||void 0===m?void 0:m.includes("contains cross-origin data"),b=this._superWasmModule&&this._superWasmModule.video&&"undefined"!=typeof HTMLVideoElement&&this._superWasmModule.video instanceof HTMLVideoElement;k&&b&&(y="crossorigin:".concat(this._superWasmModule.video.getAttribute("crossorigin"),",set:").concat(this._isCrossOrigin));var C=JSON.stringify({errMsg:e.message,columnNumber:e.columnNumber,fileName:e.fileName,stack:null==e?void 0:e.stack});this._onRenderCallback&&(null===(g=this._onRenderCallback)||void 0===g||g.call(this,{code:-1,error:C,errMsg:e.message+y}))}}}},{key:"onPostRender",value:function(){}},{key:"doRender",value:function(){}},{key:"run",value:function(){this._running=!0,this._tryRender()}},{key:"stop",value:function(){this._running=!1,this._doAppendCanvas()}},{key:"unBindMediaElement",value:function(){this._hideCanvas&&this._hideCanvas(),this._isCanvasAdded=!1,this._onRenderLostCallback&&this._onRenderLostCallback(),this._superWasmModule&&(this._superWasmModule.video=null),this.video&&"undefined"!=typeof HTMLVideoElement&&this.video instanceof HTMLVideoElement&&(this.video.__canvas=null),this._video=null,this._root=null,this._onRenderCallback=null,this._onRenderLostCallback=null}},{key:"destroy",value:function(){var e;this.unBindMediaElement();try{this._superWasmModule._destroy(),this._superWasmModule.video=null,this._superWasmModule=null}catch(e){this.code,u.te.WASM_LOADED_FAILED}this._opts.enableContextmenu&&this._canvas&&this._canvas.removeEventListener("contextmenu",this.onContextmenu),!this._isWebCodecCore&&(this._convasContainer.removeChild(this._canvas),null===(e=this._convasContainer.parentElement)||void 0===e||e.removeChild(this._convasContainer)),this._canvas.removeEventListener("webglcontextlost",this._onWebGlContextLost),this._glContext=null}},{key:"setRunning",value:function(e){this._running=e,e&&this._code===u.te.SUCCESS?(this.code=u.te.SUCCESS,this._codeMsg="SUCCESS",this.run()):this._hideCanvas&&this._hideCanvas()}},{key:"code",get:function(){return this._code},set:function(e){this._code=e,this._onSRCodeChanged&&this._onSRCodeChanged(e)}},{key:"codeMsg",get:function(){return this._codeMsg}},{key:"getStat",value:function(){var e=this._stats.getStat();return e.dropRate=this.getDropRate(),e}},{key:"getLog",value:function(){return this._logger.getLogs()}},{key:"getError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||this._wasmReady){var t=this._superWasmModule._getError();return this._logger.log("getError ".concat(t)),t}return 0}},{key:"getRuntimeInfo",value:function(){var e=this._superWasmModule._getRunInfo(),t=this._superWasmModule.UTF8ToString(e);return this._logger.log("getRuntimeInfo ".concat(t)),t}},{key:"resetLogState",value:function(){this._hasGLLoged=!1}},{key:"statMark",value:function(e){return this._stats.mark(e)}},{key:"statEndMark",value:function(e){return this._stats.endMark(e)}},{key:"hasReport",get:function(){return this._hasReport},set:function(e){this._hasReport=e}},{key:"recordDropRate",value:function(e){this._dropRateEwma.sample(1,e)}},{key:"getDropRate",value:function(){return this._dropRateEwma.getEstimate()||0}}]),n}(a())},112751:function(e,t,n){n.d(t,{LQ:function(){return f},s8:function(){return h}});var i=n(236699),r=n(778406),a=n(648711),o=n(983711),s=n(879434),u=n(827147),c=null,l=0,d=function(e){(0,i.XW)(n,e);var t=(0,i.WY)(n);function n(e){var s;return(0,i.PA)(this,n),s=t.call(this,e),(0,i._x)((0,i.Lc)(s),"_isVideoFrameCallbackSupported",(0,a.lE)()),(0,i._x)((0,i.Lc)(s),"_isCanvasAdded",!1),(0,i._x)((0,i.Lc)(s),"_useVideoTexture",!1),(0,i._x)((0,i.Lc)(s),"_preVideoWidth",-1),(0,i._x)((0,i.Lc)(s),"_preVideoHeight",-1),(0,i._x)((0,i.Lc)(s),"_sizeChangeDelayRender",!1),(0,i._x)((0,i.Lc)(s),"_sizeChangeDelayRenderCount",0),(0,i._x)((0,i.Lc)(s),"_renderCount",0),(0,i._x)((0,i.Lc)(s),"_isSizeChange",!1),(0,i._x)((0,i.Lc)(s),"_doAppendCanvas",function(){if(!!s._running){if(s._isCanvasAdded)!(0,o.pv)(s._root,r.Xv)&&s._showCanvas();else{if(!s.video)return;s._root=s.video.parentElement,s._root.insertBefore(s._convasContainer,s.video),s._showCanvas(),s.video instanceof HTMLVideoElement&&(s.video.__canvas=s._canvas),s._isCanvasAdded=!0}s._adjustCanvasPosition()}}),(0,i._x)((0,i.Lc)(s),"_onFrameCallback",function(){if(!!s._running&&!!s.video)s.video.cancelVideoFrameCallback(s._renderId),s._renderId=s.video.requestVideoFrameCallback(s._onFrameCallback),s._onRender()}),(0,i._x)((0,i.Lc)(s),"_onRequestAnimationFrame",function(){if(!!s._running&&!!s.video)cancelAnimationFrame(s._renderId),s._renderId=requestAnimationFrame(s._onRequestAnimationFrame),s._onRender()}),(0,i._x)((0,i.Lc)(s),"_adjustCanvasPosition",function(){if(!!s.video){var e=s._convasContainer,t=s._canvas,n=s.video,i=n.videoWidth,r=n.videoHeight,a=i/r,o=e.clientWidth/e.clientHeight;t.style.width=i,t.style.height=r,a>=o?(t.style.width="100%",t.style.height="auto"):a<o&&(t.style.width="auto",t.style.height="100%")}}),s._sizeChangeDelayRender=s._opts.sizeChangeDelayRender||!1,s._sizeChangeDelayRenderCount=s._opts.sizeChangeDelayRenderCount||3,s._useVideoTexture=s._opts.useVideoTexture,s}return(0,i.qH)(n,[{key:"_bindObserver",value:function(){var e=this;if("function"==typeof ResizeObserver){var t=new ResizeObserver(function(){if(!!e._isCanvasAdded)window.requestAnimationFrame(function(){e._adjustCanvasPosition()})});t.observe(this._convasContainer),this._resizeObserver=t}else this._onDebounceResize=(0,o.Ds)(this._adjustCanvasPosition,200),window.addEventListener("resize",this._onDebounceResize,!0),"function"==typeof MutationObserver&&(this._mutationsObserver=new MutationObserver(this._onDebounceResize),this._mutationsObserver.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))}},{key:"_preBindMediaEle",value:function(e){return this._video!==e&&(this._video&&this.unBindMediaElement(),!0)}},{key:"_getRenderTex",value:function(){return this.video?this.video instanceof HTMLVideoElement?this.video:this.video.canvas:null}},{key:"_startRenderTick",value:function(){this.isUseVideoFrame?this._onFrameCallback():this._onRequestAnimationFrame()}},{key:"_stopRenderTick",value:function(){this.isUseVideoFrame&&this.video&&this.video.cancelVideoFrameCallback?this.video.cancelVideoFrameCallback(this._renderId):cancelAnimationFrame(this._renderId),this._renderId=-1}},{key:"isUseVideoFrame",get:function(){return this._useVFC&&this._isVideoFrameCallbackSupported&&this.video&&!!this.video.requestVideoFrameCallback}},{key:"_getPrerenderInfo",value:function(){var e=!0;return this._superWasmModule&&this._superWasmModule.video&&this._superWasmModule.video instanceof HTMLVideoElement&&0===this._superWasmModule.video.readyState&&(e=!1),{isStateValid:e,textureWidth:this._superWasmModule.video.videoWidth,textureHeight:this._superWasmModule.video.videoHeight}}},{key:"doRender",value:function(){this.video.paused?this._isCanvasAdded&&(!this._root&&(this._root=this.video.parentElement),!(0,o.pv)(this._root,r.Xv)&&this._showCanvas(),this._onRender()):(!(0,o.pv)(this._root,r.Xv)&&this._showCanvas(),this.run())}},{key:"onPostRender",value:function(){this._renderCount++,this._sizeChangeDelayRender&&this._isSizeChange&&(this._renderCount<=this._sizeChangeDelayRenderCount?(0,o.pv)(this._root,r.Xv)&&this._hideCanvas():!(0,o.pv)(this._root,r.Xv)&&(this._showCanvas(),this._adjustCanvasPosition()))}},{key:"_createCanvas",value:function(){this._canvas=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),this._canvas.id=this._getCanvasId(),(0,o.cn)(this._canvas,"object-fit-content"),this._convasContainer=document.createElementNS("http://www.w3.org/1999/xhtml","div"),this._convasContainer.appendChild(this._canvas),(0,o.cn)(this._convasContainer,"object-fit-container"),this._bindObserver(),document.body.appendChild(this._convasContainer)}},{key:"_showCanvas",value:function(){this._root&&(this._setCanvasWidthHeight(),(0,o.cn)(this._root,r.Xv))}},{key:"_setCanvasWidthHeight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._canvas,n=this._getWidthHeight(),i=n.width,r=n.height;if(t.width!==i||t.height!==r){!e&&(t.style.width="".concat(i,"px"),t.style.height="".concat(r,"px"));var a=this._opts.useScale?s.s8[this._opts.scaleType]:1;this.statMark(u.E.SETWIDTHHEIGHT),t.width=Math.floor(i*a),t.height=Math.floor(r*a),this.statEndMark(u.E.SETWIDTHHEIGHT)}}},{key:"_getWidthHeight",value:function(){var e=this.video,t=e.videoWidth||e.width;return{width:t,height:e.videoHeight||e.height}}},{key:"_hideCanvas",value:function(){this._root&&(0,o.IV)(this._root,r.Xv)}},{key:"hideCanvas",value:function(){this._hideCanvas()}},{key:"showCanvas",value:function(){this._showCanvas()}},{key:"run",value:function(){this._running=!0,this._tryRender()}},{key:"stop",value:function(){this._running=!1,this._doAppendCanvas()}},{key:"unBindMediaElement",value:function(){this._hideCanvas(),this._isCanvasAdded=!1,this._onRenderLostCallback&&this._onRenderLostCallback(),this._superWasmModule&&(this._superWasmModule.video=null),this.video&&this.video instanceof HTMLVideoElement&&(this.video.__canvas=null),this._video=null,this._root=null,this._onRenderCallback=null,this._onRenderLostCallback=null}},{key:"destroy",value:function(){if(this._useVFC&&this._isVideoFrameCallbackSupported){var e;null===(e=this._superWasmModule.video)||void 0===e||e.cancelVideoFrameCallback(this._renderId)}else cancelAnimationFrame(this._renderId);this._resizeObserver?this._resizeObserver.disconnect():(window.removeEventListener("resize",this._onDebounceResize),this._mutationsObserver&&this._mutationsObserver.disconnect()),(0,i.U2)((0,i.IP)(n.prototype),"destroy",this).call(this)}}]),n}(r.tr);function h(e,t){return e?(!c&&(c=new d((0,i.Zj)((0,i.Zj)({},t),{},{canvasId:"".concat(r.aK).concat(++l)}))),c):new d((0,i.Zj)((0,i.Zj)({},t),{},{canvasId:"".concat(r.aK).concat(++l)}))}function f(){c&&(c.destroy(),c=null)}},679145:function(e,t,n){n.d(t,{Z:function(){return r}});var i=n(261825);n(162093),n(2885),n(248385);let r=(0,i.qH)(function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.PA)(this,e),this.config={size:30,severeBlockDuration:1500,slightBlockDuration:100,highBitrateRatio:1.5,lowBitrateRatio:.8,highLadderSelectedCnt:1,lowLadderSelectedCnt:1,blockSumMaxTime:6e5},Object.keys(n).map(function(e){t.config[e]=n[e]}),this.timerId=null,this.setTimer()},[{key:"setConfig",value:function(e){var t=this;Object.keys(e).map(function(n){t.config[n]=e[n]})}},{key:"resetCurrent",value:function(){this._info.currentBlockDur=0}},{key:"setTimer",value:function(){var e=this;this._blockQueue=[],this._tBQueue=[],this._sBQueue=[],this._hCount=0,this._lCount=0,this._info={blockDurationSum:0,currentBlockDur:0,targetBitrateAvg:0,selectedBitrateAvg:0,higherSelectedCnt:0,lowerSelectedCnt:0},this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.timerId=setTimeout(function(){e.setTimer()},this.config.blockSumMaxTime)}},{key:"targetBitRate",set:function(e){if(!!e&&"number"==typeof e){this._tBQueue.push(parseInt(e,10)),this._tBQueue.length>this.config.size&&this._tBQueue.shift(0,1);var t=0;this._tBQueue.map(function(e){t+=e}),this._info.targetBitrateAvg=t/this._tBQueue.length}}},{key:"selectBitRate",set:function(e){if(!!e&&"number"==typeof e){this._sBQueue.push(e),this._sBQueue.length>this.config.size&&this._sBQueue.shift(0,1);var t=0;this._sBQueue.map(function(e){t+=e}),this._info.selectedBitrateAvg=t/this._sBQueue.length}}},{key:"blockDuration",set:function(e){this._blockQueue.push(e),this._blockQueue.length>this.config.size&&this._blockQueue.shift(0,1);var t=0;this._blockQueue.map(function(e){t+=e}),this._info.blockDurationSum=t}},{key:"currentBlockDur",set:function(e){this._info.currentBlockDur+=e}},{key:"updateBitRateInfo",value:function(e,t){if(!!e&&!!t)e>t?this._info.higherSelectedCnt++:e<t&&this._info.lowerSelectedCnt++}},{key:"checkDefinition",value:function(){var e=this.config,t=this._info;return t.blockDurationSum>e.severeBlockDuration&&(t.selectedBitrateAvg>t.targetBitrateAvg*e.highBitrateRatio&&t.higherSelectedCnt>=e.highLadderSelectedCnt||t.currentBlockDur>e.severeBlockDuration)?1:t.blockDurationSum<e.slightBlockDuration&&t.selectedBitrateAvg<t.targetBitrateAvg*e.lowBitrateRatio&&t.lowerSelectedCnt>=e.lowLadderSelectedCnt?2:0}}])},832641:function(e,t,n){n.d(t,{KR:function(){return o},Rr:function(){return a}});var i,r,a=((i=a||{})[i.INDEXDB=0]="INDEXDB",i[i.MEMORY=1]="MEMORY",i);var o=((r=o||{}).PRELOAD_NEXT="PRELOAD_NEXT",r.PRELOAD_START="PRELOAD_START",r.PRELOAD_CANCEL="PRELOAD_CANCEL",r.PRELOAD_STOP="PRELOAD_STOP",r)},857287:function(e,t,n){n.d(t,{d:function(){return s}});var i=n(6055);n(248385),n(679308),n(88856);var r=n(942155),a=n.n(r),o=n(651108),s=function(e){var t,n,r,a;function s(e,t){var n;return(0,i.PA)(this,s),(n=(0,i.$w)(this,s))._data=null,n.preloadManager=e,n._config=t,n.promisePolyfill(),n}return(0,i.XW)(s,e),(0,i.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,n=t.getRequestOptionsCallback,i=t.reqOptions,r={};return e?r=e.reqOptions?e.reqOptions:"function"==typeof n?n(e):i||{}:r}},{key:"getUserSelectDefinition",value:function(){return this.preloadManager.getUserSelectDefinition()}},{key:"selectBitrate",value:function(e,t,n){return this.preloadManager.selectBitrate(e,t,n)}},{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,i.x)((0,i.l5)().mark(function e(t,n){return(0,i.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,n){return t.apply(this,arguments)})},{key:"cancel",value:(n=(0,i.x)((0,i.l5)().mark(function e(){return(0,i.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 n.apply(this,arguments)})},{key:"getPreLoadData",value:(r=(0,i.x)((0,i.l5)().mark(function e(t){return(0,i.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,i.x)((0,i.l5)().mark(function e(){return(0,i.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())},755290:function(e,t,n){n.d(t,{q:function(){return u}});var i,r=n(730210),a=n(734123),o=n(423013),s=n(75740),u=function(e){function t(e){(0,r.PA)(this,t);var n,a=(n=(0,r.$w)(this,t,[e])).player,o=n.playerConfig;return n.playerId=a.playerId,n.codecType=o.codecType?o.codecType.toLowerCase():s.u7.H264,n.bizType=a.bizType="number"==typeof o.bizType?o.bizType:s.Ye.Normal,o.vtype&&(n.vtype=o.vtype.toUpperCase()),i&&(a.preloader=i),n}return(0,r.XW)(t,e),(0,r.qH)(t,[{key:"softDecode",get:function(){var e;return(null===(e=this.playerConfig)||void 0===e?void 0:e.mediaType)==="xg-video"}}],[{key:"registerPreloader",value:function(e){if(!!e)i=e,o.w.getInstance().findAll(function(e){return!e.config.isLive&&(e.preloader=i),!1})}}])}(a.BasePlugin)},223985:function(e,t,n){n.d(t,{l:function(){return s}});var i=n(730210),r=n(423013),a=n(613753),o=n(317153),s=function(e){function t(){return(0,i.PA)(this,t),(0,i.$w)(this,t,arguments)}return(0,i.XW)(t,e),(0,i.qH)(t,[{key:"start",value:function(){var e=this,t=this.instManager;this.stop(),t.on(r.L.UPDATE_INST_ORDER,function(){var n=t.findAll(function(e){return e.isUserActive}),i=t.findAll(function(e){return e.isInstNext});1===n.length&&1===i.length&&(e._activePlayer=n[0],e._nextPlayer=i[0],e.execTask())})}},{key:"stop",value:function(){this._clearTimer(),this.instManager.off(r.L.UPDATE_INST_ORDER)}},{key:"_clearTimer",value:function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=void 0)}},{key:"_startTimer",value:function(){var e=this;this._clearTimer(),this._timerId=setTimeout(function(){e.execTask()},1e3)}},{key:"isValidConfig",value:function(){var e=this.config,t=e.nextBufferMin,n=e.scale,r=e.nextStartPos,a=e.nextStartBuffer,o=function(e){return"number"==typeof e&&e>=0};return!!(o(t)&&o(r)&&o(a))&&"object"===(0,i.Ac)(n)&&!!(n.S>=0)&&!!(n.M>=0)&&!!(n.L>=0)&&!!(n.XL>=0)||!1}},{key:"execTask",value:function(){if(!!this._activePlayer&&!!this._nextPlayer)if(this.isValidConfig()){var e=this.config,t=e.nextBufferMin,n=e.scale,i=e.nextStartPos,r=e.nextStartBuffer,a=this._nextPlayer.duration,s=this._activePlayer.currentTime,u=this._activePlayer.getBufferedRange(),c=t;s>i&&u[1]>r?(a<=60?c=t+10*n.S:a>60&&a<=180?c=t+10*n.M:a>180&&a<=600?c=t+10*n.L:a>600&&(c=t+10*n.XL),this._nextPlayer.emit(o.J.CHANGE_FLYING_PLUGIN_CONFIG,{nextBufferLength:c}),this._clearTimer(),this._activePlayer=void 0,this._nextPlayer=void 0):this._startTimer()}else this._startTimer()}}])}(a.N);s.STRATEGY_NAME="next-buffer-control"},894382:function(e,t,n){n.d(t,{Z:function(){return C}}),n(149336);var i=n(264911),r=n(315355),a=n(919209),o=n(732905),s=n(64505),u=n(625813),c=n(278997),l=n(508881),d=n(272787);n(663030),n(853510),n(759943),n(683656),n(705574),n(248385),n(679308),n(346984),n(88856),n(232070),n(381896),n(918016),n(162093),n(68113);var h=n(484777),f=n(58172),v=n(597931),_=n(874668),p=n(155363),m=n(39455),g=n(534611),y=n(773975),k=n(856894),b={LOW_LATENCY:1,NO_AUDIO:2,NO_VIDEO:3},C=function(e){(0,u.Z)(C,e);var t,n,d=(t=C,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(e){return!1}}(),function(){var e,i=(0,l.Z)(t);return e=n?Reflect.construct(i,arguments,(0,l.Z)(this).constructor):i.apply(this,arguments),(0,c.Z)(this,e)});function C(){var e;return(0,r.Z)(this,C),(e=d.call(this)).TAG="XGVideo",e._proxyProps(),e._isLive=!0,e._vMeta=null,e._aMeta=null,e._resizeObserver=null,e._eventsBackup=[],e._domConnected=!1,e._hevc="h265"===(0,_.tT)().preloadDecoder,!e._hevc&&(e._degradeVideo=document.createElement("video")),e._onTouchEnd=e._onTouchEnd.bind((0,o.Z)(e)),e.analyse=new y.Z,e}return(0,a.Z)(C,[{key:"_proxyProps",value:function(){var e=this;Object.getOwnPropertyNames(C.prototype).forEach(function(t){/^__/.test(t)&&Object.defineProperty(e,t.replace("__",""),{get:function(){try{return this[t]}catch(e){}return 0},set:function(e){try{this[t]=e}catch(e){}}})})}},{key:"addEventListener",value:function(e,t,n){(0,s.Z)((0,l.Z)(C.prototype),"addEventListener",this).call(this,e,t,n),this._degradeVideo&&this._eventsBackup.push([e,t,n])}},{key:"removeEventListener",value:function(e,t,n){(0,s.Z)((0,l.Z)(C.prototype),"removeEventListener",this).call(this,e,t,n),this._degradeVideo&&(this._eventsBackup=this._eventsBackup.filter(function(i){return!(i.eventName===e&&i.handler===t&&i.capture===n)}))}},{key:"setAttribute",value:function(e,t){var n;(0,s.Z)((0,l.Z)(C.prototype),"setAttribute",this).call(this,e,t),"src"!==e&&(null===(n=this._degradeVideo)||void 0===n||n.setAttribute(e,t))}},{key:"_init",value:function(){this.analyse.reset(),this.timeline=new m.Z({volume:this.volume,canvas:this.querySelector("canvas"),videoContext:this.videoContext,videoDecode:this.videoDecode,maxVideoHeight:this.getAttribute("maxVideoHeight"),endLevel:parseInt(this.getAttribute("endLevel"))},this),v.kg.log(this.TAG,"timeline init"),this._noSleep=new h.Z,this._logFirstFrame=!1,this._playRequest=null,this._degradeVideoUserGestured=!1,this._bindEvents(),this._vMeta&&!this.videoDecode&&this.setVideoMeta(this._vMeta),this._glCtxOptions&&(this.glCtxOptions=this._glCtxOptions),this.timeline&&(this.innerDegrade&&this.timeline.emit(g.ZP.TIMELINE.INNER_DEGRADE),this.timeline.emit(g.ZP.TIMELINE.SET_PLAY_MODE,this._isLive?"LIVE":"VOD"),this.timeline.emit(g.ZP.TIMELINE.SET_PLAYBACKRATE,this.playbackRate),this.muted=this.muted)}},{key:"_bindEvents",value:function(){var e=this;this.timeline.on(g.ZP.TIMELINE.PLAY_EVENT,function(t,n){var i,r;if(t===g.NW.LOADEDDATA&&(!e.querySelector("canvas")&&(v.kg.log(e.TAG,"_bindEvents, appendChild canvas"),e.appendChild(e.canvas)),e.canvas.style.display="block",null===(r=e.timeline)||void 0===r||r.emit(g.ZP.TIMELINE.SET_PLAYBACKRATE,e.playbackRate)),(t===g.NW.RESIZE&&null!==(i=e.timeline)&&void 0!==i&&i.ready||t===g.NW.CANVAS_LAYOUT)&&Promise.resolve().then(function(){e.updateVideoPostion()}),t===g.NW.ERROR){if(v.kg.warn(e.TAG,"detect error:",null==n?void 0:n.message),e.pause(),e._disabled(!0),e.innerDegrade||5===e.decoderMode){e.degradeInfo={decodeFps:e.decodeFps,bitrate:e.bitrate,wasmInitCost:e.wasmInitCost,fps:e.fps,url:e.src,msg:null==n?void 0:n.message,decoderMode:e.decoderMode},e._innerDispatchEvent("lowdecode");return}e._err=n}if(t===g.NW.LOW_DECODE){e._disabled(),e.degradeInfo={decodeFps:e.decodeFps,bitrate:e.bitrate,wasmInitCost:e.wasmInitCost,fps:e.fps,url:e.src,decoderMode:e.decoderMode},e._innerDispatchEvent(g.R_[t],e.degradeInfo);return}if(t===g.NW.LARGE_AV_GAP&&(e.unsyncInfo=n),t===g.NW.ENDED){if(e.paused)return;e.pause()}t===g.NW.PROGRESS&&e._noSleep.toPlay(),t===g.NW.WAITING&&e.analyse.addWaiting(),t===g.NW.SEEKING&&e.analyse.addSeeking(),t===g.NW.SEEKED&&e.analyse.addSeeked(),e._innerDispatchEvent(g.R_[t],n)})}},{key:"_disabled",value:function(e){if(!!this.innerDegrade||!!e){if(e){if((0,_.tT)().evaluateVVCount){(0,p.Dd)();return}(0,p.DO)(1);return}if(!(0,_.tT)().evaluateVVCount){if(this.decodeFps/this.fps<=.6&&this.bitrate<2e6){(0,p.DO)(1);return}(0,p.DO)(2)}}}},{key:"degrade",value:function(e){var t=this;this.querySelector("canvas")?this.replaceChild(this._degradeVideo,this.canvas):this.appendChild(this._degradeVideo),this.destroy(),this._eventsBackup.forEach(function(e){var n,r=(0,i.Z)(e,3),a=r[0],o=r[1],u=r[2];(0,s.Z)((0,l.Z)(C.prototype),"removeEventListener",t).call(t,a,o,u),null===(n=t._degradeVideo)||void 0===n||n.addEventListener(a,o,u)}),this._eventsBackup=[],e&&(this._degradeVideo.muted=!1,this._degradeVideo.src=e,this._degradeVideo.load())}},{key:"disconnectedCallback",value:function(){if(this._domConnected=!1,v.kg.log(this.TAG,"video disconnected"),document.removeEventListener("touchend",this._onTouchEnd,!0),this.querySelector("canvas"))try{this.removeChild(this.querySelector("canvas")),v.kg.log(this.TAG,"remove canvas child")}catch(e){}this.destroy(!0),this._resizeObserver&&this._resizeObserver.disconnect(this)}},{key:"connectedCallback",value:function(){var e,t,n,i=this;if((null===(e=this.childNodes[0])||void 0===e?void 0:null===(t=e.tagName)||void 0===t?void 0:null===(n=t.toLocaleLowerCase)||void 0===n?void 0:n.call(t))==="source"){(0,p.Dd)();var r=Error("not supported source type");r.code=3,this._err=r,this._innerDispatchEvent("error",r);return}v.kg.log(this.TAG,"video connected to document",performance.now()),!this.timeline&&this._init(),this.style.width="100%",this.style.height="100%",this.style.position="absolute",this.style.left="0px",this.style.top="0px",document.addEventListener("touchend",this._onTouchEnd,!0),ResizeObserver&&(this._resizeObserver=new ResizeObserver(function(e){var t;null!==(t=i.timeline)&&void 0!==t&&t.ready&&i.updateVideoPostion()}),this._resizeObserver.observe(this)),this._domConnected=!0}},{key:"_onTouchEnd",value:function(){(0,f.fC)(),this._degradeVideoInteract(),this._noSleep&&this._noSleep.enable()}},{key:"_degradeVideoInteract",value:function(){var e=this;if(this._degradeVideo&&(1===this.innerDegrade||3===this.innerDegrade)){if(this._degradeVideoUserGestured)return;var t=this._degradeVideo.play();t&&t.then(function(){e._degradeVideo.pause(),e._degradeVideoUserGestured=!0}).catch(function(e){})}}},{key:"play",value:function(e){var t=this;if(!this.timeline)return new Promise(function(e){setTimeout(function(){e()},800)});v.kg.log(this.TAG,"play() called, ready:".concat(this.timeline.ready,", paused:").concat(this.timeline.paused,", force:").concat(e)),this._degradeVideoInteract();var n=0;if(this.timeline.ready&&this.timeline.paused||e){if(e=e||this._isLive,this._playRequest=null,!e)return this.timeline.emit(g.ZP.TIMELINE.DO_PLAY),this._innerDispatchEvent("play"),Promise.resolve();this.destroy(),this._init(),n=setTimeout(function(){try{t._innerDispatchEvent("waiting")}catch(e){}},300)}return this._playRequest||!this.timeline.ready||this.timeline.paused?(v.kg.log(this.TAG,"request play!"),this._playRequest=this._playRequest||new Promise(function(e,i){t.timeline._paused=!1,t._innerDispatchEvent("play"),t._noSleep.enable(),t.timeline.once("ready",function(){v.kg.log(t.TAG,"timeline emit ready"),clearTimeout(n),t.timeline.play().then(e).catch(i).finally(function(){t._playRequest=null})})}),this._playRequest):Promise.resolve()}},{key:"pause",value:function(){this._playRequest=null,this.timeline&&this.timeline.pause();try{this._noSleep.disable(),(0,f.BR)()}catch(e){}}},{key:"load",value:function(){}},{key:"appendBuffer",value:function(e,t){if(this.timeline&&!this._err){if(!this._logFirstFrame){var n=e&&e.samples[0],i=t&&t.samples[0];if(!n&&!i)return;if(n||i){var r=(null==e?void 0:e.duration)/((null==e?void 0:e.formatTimescale)||1/0),a=(null==t?void 0:t.duration)/((null==t?void 0:t.formatTimescale)||1/0);v.kg.warn(this.TAG,"video firstDts:".concat(n&&n.dts," , audio firstDts:").concat(i&&i.dts," videoTrack.duration=").concat(r,", audioTrack.duration=").concat(a)),this._logFirstFrame=!0,(r||a)&&(this.setPlayMode("VOD"),this.timeline.emit(g.ZP.TIMELINE.SET_PLAY_MODE,this._isLive?"LIVE":"VOD"),this.duration=Math.min(r||a,a||r)),this.analyse.addFirstData()}this.lowlatency&&(v.kg.warn(this.TAG,"single track! type=",b.LOW_LATENCY),this.timeline.emit(g.ZP.TIMELINE.SINGLE_TRACK,b.LOW_LATENCY)),!t.exist()&&(v.kg.warn(this.TAG,"single track! type=",b.NO_AUDIO),this.timeline.emit(g.ZP.TIMELINE.SINGLE_TRACK,b.NO_AUDIO)),!e.exist()&&(v.kg.warn(this.TAG,"single track! type=",b.NO_VIDEO),this.timeline.emit(g.ZP.TIMELINE.SINGLE_TRACK,b.NO_VIDEO))}e.formatTimescale&&e.samples.forEach(function(t){t.dts=Math.floor(t.dts/e.formatTimescale*1e3),t.pts=Math.floor(t.pts/e.formatTimescale*1e3)}),t.formatTimescale&&t.samples.forEach(function(e){e.dts=Math.floor(e.dts/t.formatTimescale*1e3),e.pts=Math.floor(e.pts/t.formatTimescale*1e3)}),this.timeline.appendBuffer(e,t)}}},{key:"setAudioMeta",value:function(e){this._aMeta=e,this.timeline.emit(g.ZP.TIMELINE.SET_METADATA,"audio",e)}},{key:"setVideoMeta",value:function(e){(this._isLive||!this._vMeta)&&(this.timeline.emit(g.ZP.TIMELINE.SET_METADATA,"video",e),this._vMeta=e)}},{key:"setDecodeMode",value:function(e){this.setAttribute("decodeMode",e)}},{key:"setPlayMode",value:function(e){this._isLive="LIVE"===e}},{key:"endOfStream",value:function(){var e;this.currentTime&&(null===(e=this.timeline)||void 0===e||e.emit(g.ZP.TIMELINE.END_OF_STREAM))}},{key:"updateVideoPostion",value:function(){var e;null===(e=this.timeline)||void 0===e||e.emit(g.ZP.VIDEO.UPDATE_VIDEO_FILLTYPE,this.xgfillType,this.containerLayout)}},{key:"_innerDispatchEvent",value:function(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t}))}},{key:"destroy",value:function(e){this.timeline&&(this._noSleep.destroy(),v.kg.log(this.TAG,"call destroy"),this.timeline.emit(g.ZP.TIMELINE.DESTROY,e),this.querySelector("video")&&this.removeChild(this.querySelector("video")),this.timeline=null,this._err=null,this._noSleep=null,this._eventsBackup=[])}},{key:"updateObjectPosition",value:function(e,t){this.timeline.emit(g.ZP.VIDEO.UPDATE_VIDEO_COVER_POSITION,this.containerLayout,e,t),this._degradeVideo&&(this._degradeVideo.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%"))}},{key:"setVideoDecode",value:function(){v.kg.log(this.TAG,"set videoDecode",this.videoDecode),this.videoDecode&&this.timeline&&this.timeline.videoRender&&(this.timeline.videoRender.videoDecode=this.videoDecode)}},{key:"live",get:function(){return this._isLive}},{key:"lowlatency",get:function(){return"true"===this.getAttribute("lowlatency")},set:function(e){this.setAttribute("lowlatency",e)}},{key:"autoplay",get:function(){return"true"===this.getAttribute("autoplay")},set:function(e){this.setAttribute("autoplay",e)}},{key:"__canvas",get:function(){return this.timeline.canvas}},{key:"__ended",get:function(){return .5>Math.abs(this.currentTime-this.duration)}},{key:"__width",get:function(){return this.getAttribute("width")||this.videoWidth},set:function(e){this.setAttribute("width","number"==typeof e?"".concat(e,"px"):e),this.canvas.width=e}},{key:"__height",get:function(){return this.getAttribute("height")},set:function(e){this.setAttribute("height","number"==typeof e?"".concat(e,"px"):e),this.canvas.height=e}},{key:"__videoWidth",get:function(){return this.canvas.width}},{key:"__videoHeight",get:function(){return this.canvas.height}},{key:"__volume",get:function(){return Number(this.getAttribute("volume"))},set:function(e){e<=0&&(e=0),e>=1&&(e=1),this.setAttribute("volume",e),!this.muted&&this.timeline.emit(g.ZP.TIMELINE.UPDATE_VOLUME,e)}},{key:"__muted",get:function(){return"true"===this.getAttribute("muted")},set:function(e){this.setAttribute("muted",e),this._degradeVideoInteract(),this._noSleep.enable(),this.timeline.emit(g.ZP.TIMELINE.UPDATE_VOLUME,e?0:this.volume)}},{key:"__currentTime",get:function(){return this.timeline?Math.min(this.timeline.currentTime,this.timeline.duration):0},set:function(e){this._seek(e)}},{key:"_seek",value:function(e){this.timeline&&(!this.buffered.length&&this.play(),this.paused&&!this._isLive&&e<1&&this.play(),this.timeline.seek(Number(e)))}},{key:"__duration",get:function(){return this._isLive?1/0:this.timeline.duration},set:function(e){this.timeline.emit(g.ZP.TIMELINE.SET_VIDEO_DURATION,e),this._innerDispatchEvent("durationchange")}},{key:"__seeking",get:function(){return this.timeline.seeking}},{key:"__paused",get:function(){return this.timeline.paused}},{key:"__fps",get:function(){return this.timeline.fps}},{key:"__decodeFps",get:function(){return this.timeline.decodeFps}},{key:"__decodeCost",get:function(){return parseInt(this.timeline.decodeCost)}},{key:"__renderCost",get:function(){return this.timeline.renderCost}},{key:"__wasmInitCost",get:function(){return this.timeline.wasmInitCost}},{key:"__totalSize",get:function(){return this.timeline.totalSize}},{key:"__bitrate",get:function(){return this.timeline.bitrate}},{key:"__gopLength",get:function(){return this.timeline.gopLength}},{key:"__readyState",get:function(){return this.timeline.readyState}},{key:"__buffered",get:function(){return this.timeline.buffered}},{key:"__decoderMode",get:function(){return this.timeline.decoderMode}},{key:"src",get:function(){var e;return this.getAttribute("src")||(null===(e=this.childNodes[0])||void 0===e?void 0:e.src)||""},set:function(e){v.kg.log(this.TAG,"set src ",e),this.setAttribute("src",e),this._vMeta=null,(!this._domConnected||this.buffered.length)&&(this.play(!0),!this.timeline&&this._init()),this._innerDispatchEvent("loadstart"),(0,p.X2)()}},{key:"currentSrc",get:function(){var e;return this.getAttribute("src")||(null===(e=this.childNodes[0])||void 0===e?void 0:e.src)||""}},{key:"playbackRate",get:function(){return parseFloat(this.getAttribute("playbackrate")||1)},set:function(e){var t;this.setAttribute("playbackrate",e),null===(t=this.timeline)||void 0===t||t.emit(g.ZP.TIMELINE.SET_PLAYBACKRATE,e)}},{key:"networkState",get:function(){return 1}},{key:"preloadTime",get:function(){var e=this.getAttribute("preloadtime");if(e){var t=Number.parseFloat(e);if(t>0&&!Number.isNaN(t))return t}return 1/0},set:function(e){e&&Number(e)>0&&this.setAttribute("preloadtime",e)}},{key:"innerDegrade",get:function(){return parseInt(this.getAttribute("innerdegrade"))}},{key:"__glCtxOptions",set:function(e){this._glCtxOptions=e,this.timeline.emit(g.ZP.TIMELINE.UPDATE_GL_OPTIONS,e)}},{key:"__error",get:function(){return this._err},set:function(e){this.timeline.emit(g.ZP.TIMELINE.PLAY_EVENT,g.NW.ERROR,e)}},{key:"degradeVideo",get:function(){return this._degradeVideo}},{key:"degradeInfo",get:function(){return this._deradeInfo},set:function(e){this._deradeInfo=e}},{key:"unsyncInfo",get:function(){return this._unsyncInfo},set:function(e){this._unsyncInfo=e}},{key:"xgfillType",get:function(){return this.parentNode.getAttribute("data-xgfill")}},{key:"containerLayout",get:function(){var e=this.parentNode;return{width:e.clientWidth,height:e.clientHeight}}},{key:"videoDecode",get:function(){return"7"===this.getAttribute("decodeMode")}},{key:"audioMedia",get:function(){var e,t;return null===(e=this.timeline)||void 0===e?void 0:null===(t=e.audioRender)||void 0===t?void 0:t.media}},{key:"audioMediaCache",get:function(){var e,t;return(null===(e=this.timeline)||void 0===e?void 0:null===(t=e.audioRender)||void 0===t?void 0:t._mediaCache)||[]}},{key:"getStats",value:function(){return this.analyse.getStats(this)}},{key:"getSeekElapses",value:function(){return this.analyse.seekElapses()}},{key:"disabledDegrade",value:function(){C.forceCanUse=!0,C.cleanDisabled()}},{key:"cleanDisabledCache",value:function(){(0,p.J2)()}},{key:"dump",value:function(){var e=this.buffered;return Array(e.length).fill(0).map(function(t,n){return[e.start(n),e.end(n)]})}}],[{key:"version",get:function(){return"0.1.6-next.27"}},{key:"init",value:function(e){var t=e.h264Url,n=e.h264AsmUrl,i=e.h265AsmUrl,r=e.h265Url,a=e.h265ThreadUrl,o=e.h265SimdUrl;C.h264Url=t||C.h264Url,C.h265Url=r||C.h265Url,C.h265AsmUrl=i||C.h265AsmUrl,C.h264AsmUrl=n||C.h264AsmUrl,C.h265ThreadUrl=a||C.h265ThreadUrl,C.h265SimdUrl=o||C.h265SimdUrl}},{key:"getDecodeCapacity",value:function(){return(0,_.tT)()}},{key:"getDeviceCapacity",value:function(){return(0,_.MP)()}},{key:"setDecodeCapacity",value:function(e){(0,_.rM)(e),e.preloadDecoder&&k.Z.genDecoder().catch(function(){})}},{key:"genDecoder",value:function(e){return k.Z.genDecoder(e)}},{key:"cleanDisabled",value:function(){(0,p.J2)()}},{key:"isSupported",value:function(){return!!(0,_.lF)()&&(!!C.forceCanUse||!1===(0,p.mt)())}}]),C}("undefined"!=typeof HTMLElement?HTMLElement:function(){});(0,d.Z)(C,"decoderCache",k.Z)},367625:function(e,t,n){n.d(t,{Z:function(){return P}}),n("149336"),n("936553"),n("27485"),n("760269");var i=n("616376"),r=n("732905"),a=n("64505"),o=n("625813"),s=n("278997"),u=n("508881"),c=n("315355"),l=n("919209"),d=n("272787"),h=n("787070"),f=n.n(h);n("451236"),n("503000"),n("705574"),n("663030"),n("346984"),n("2885"),n("124300"),n("248385"),n("679308"),n("591111"),n("490629"),n("9498"),n("88856"),n("759943"),n("232070"),n("832674"),n("905442"),n("446336"),n("808483"),n("840938"),n("118438"),n("325598"),n("92999"),n("611067"),n("273723"),n("724016"),n("803903"),n("214604"),n("901250"),n("755006"),n("437048"),n("488336"),n("825666"),n("177162"),n("286633"),n("943281"),n("810658"),n("82726"),n("224727");var v=n("264911"),_=n("298322");n("941533"),n("162093"),n("173757");var p=n("924515"),m=n("584832"),g=4294967295,y=function(){function e(){(0,c.Z)(this,e)}return(0,l.Z)(e,null,[{key:"box",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=8+(n=n.filter(Boolean)).reduce(function(e,t){return e+t.byteLength},0),a=new Uint8Array(r);a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=255&r,a.set(e,4);var o=8;return n.forEach(function(e){a.set(e,o),o+=e.byteLength}),a}},{key:"ftyp",value:function(t){return t.find(function(e){return e.type===m.Vc.VIDEO&&e.codecType===m._e.HEVC})?e.FTYPHEV1:e.FTYPAVC1}},{key:"initSegment",value:function(t){return(0,p.gJ)(e.ftyp(t),e.moov(t))}},{key:"moov",value:function(t){return e.box.apply(e,[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)].concat((0,_.Z)(t.map(function(t){return e.trak(t)})),[e.mvex(t)]))}},{key:"mvhd",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,n>>24&255,n>>16&255,n>>8&255,255&n,t>>24&255,t>>16&255,t>>8&255,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.duration,t.width,t.height),e.mdia(t))}},{key:"tkhd",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,n>>24&255,n>>16&255,n>>8&255,255&n,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,r>>8&255,255&r,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minf(t))}},{key:"mdhd",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,n>>24&255,n>>16&255,n>>8&255,255&n,t>>24&255,t>>16&255,t>>8&255,255&t,85,196,0,0]))}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"minf",value:function(t){return e.box(e.types.minf,t.type===m.Vc.VIDEO?e.VMHD:e.SMHD,e.DINF,e.stbl(t))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.STTS,e.STSC,e.STSZ,e.STCO)}},{key:"stsd",value:function(t){return e.box(e.types.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),t.type===m.Vc.VIDEO?e.avc1hev1(t):e.mp4a(t))}},{key:"avc1hev1",value:function(t){var n=t.codecType===m._e.HEVC,i=n?e.types.hvc1:e.types.avc1,r=n?e.hvcC(t):e.avcC(t),a=[new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,t.width>>8&255,255&t.width,t.height>>8&255,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r];return t.sarRatio&&t.sarRatio.length>1&&a.push(e.pasp(t.sarRatio)),e.box.apply(e,[i].concat(a))}},{key:"avcC",value:function(t){var n,i=[],r=[];return t.sps.forEach(function(e){n=e.byteLength,i.push(n>>>8&255),i.push(255&n),i.push.apply(i,(0,_.Z)(e))}),t.pps.forEach(function(e){n=e.byteLength,r.push(n>>>8&255),r.push(255&n),r.push.apply(r,(0,_.Z)(e))}),e.box(e.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|t.sps.length].concat(i).concat([t.pps.length]).concat(r)))}},{key:"hvcC",value:function(t){var n,i=t.hvcC;if(i instanceof ArrayBuffer)return i;var r=t.vps,a=t.sps,o=t.pps;if(i){var s=i.generalProfileCompatibilityFlags,u=i.generalConstraintIndicatorFlags,c=(r.length&&1)+(a.length&&1)+(o.length&&1);n=[1,i.generalProfileSpace<<6|i.generalTierFlag<<5|i.generalProfileIdc,s>>>24,s>>>16,s>>>8,s,u[0],u[1],u[2],u[3],u[4],u[5],i.generalLevelIdc,240,0,252,252|i.chromaFormatIdc,248|i.bitDepthLumaMinus8,248|i.bitDepthChromaMinus8,0,0,i.numTemporalLayers<<3|i.temporalIdNested<<2|3,c];var l=function(e){var t;n.push(e.length>>8,e.length),(t=n).push.apply(t,(0,_.Z)(e))};r.length&&(n.push(160,0,r.length),r.forEach(l)),a.length&&(n.push(161,0,a.length),a.forEach(l)),o.length&&(n.push(162,0,o.length),o.forEach(l))}else n=[1,1,96,0,0,0,144,0,0,0,0,0,93,240,0,252,253,248,248,0,0,15,3,160,0,1,0,24,64,1,12,1,255,255,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,153,152,9,161,0,1,0,45,66,1,1,1,96,0,0,3,0,144,0,0,3,0,0,3,0,93,160,2,128,128,45,22,89,153,164,147,43,154,128,128,128,130,0,0,3,0,2,0,0,3,0,50,16,162,0,1,0,7,68,1,193,114,180,98,64];return e.box(e.types.hvcC,new Uint8Array(n))}},{key:"pasp",value:function(t){var n=(0,v.Z)(t,2),i=n[0],r=n[1];return e.box(e.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,255&i,r>>24,r>>16&255,r>>8&255,255&r]))}},{key:"mp4a",value:function(t){return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,t.sampleRate>>8&255,255&t.sampleRate,0,0]),t.config.length?e.esds(t.config):void 0)}},{key:"esds",value:function(t){var n=t.length;return e.box(e.types.esds,new Uint8Array([0,0,0,0,3,23+n,0,0,0,4,15+n,64,21,0,6,0,0,0,218,192,0,0,218,192,5].concat([n]).concat(t).concat([6,1,2])))}},{key:"mvex",value:function(t){return e.box.apply(e,[e.types.mvex].concat((0,_.Z)(t.map(function(t){return e.trex(t.id)}))))}},{key:"trex",value:function(t){return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"moof",value:function(t,n){return e.box.apply(e,[e.types.moof,e.mfhd(t)].concat((0,_.Z)(n.map(function(t){return e.traf(t)}))))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"traf",value:function(t){return e.box(e.types.traf,e.tfhd(t.id),e.tfdt(t.baseMediaDecodeTime),e.trun(t.samples,76))}},{key:"tfhd",value:function(t){return e.box(e.types.tfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"tfdt",value:function(t){var n=Math.floor(t/(g+1)),i=Math.floor(t%(g+1));return e.box(e.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i]))}},{key:"trun",value:function(t,n){var i=t.length,r=12+16*i;n+=8+r;var a=new Uint8Array(r);a.set([0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0);for(var o=0;o<i;o++){var s=t[o],u=s.duration,c=s.size,l=s.flag,d=void 0===l?{}:l,h=s.cts,f=void 0===h?0:h;a.set([u>>>24&255,u>>>16&255,u>>>8&255,255&u,c>>>24&255,c>>>16&255,c>>>8&255,255&c,d.isLeading<<2|(null==d.dependsOn?1:d.dependsOn),d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|(null==d.isNonSyncSample?1:d.isNonSyncSample),61440&d.degradationPriority,15&d.degradationPriority,f>>>24&255,f>>>16&255,f>>>8&255,255&f],12+16*o)}return e.box(e.types.trun,a)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}},{key:"moovMP4",value:function(t){return e.box.apply(e,[e.types.moov,e.mvhd(t[0].duration,t[0].timescale)].concat((0,_.Z)(t.map(function(t){return e.trackMP4(t)}))))}},{key:"trackMP4",value:function(t){return e.box(e.types.trak,e.tkhd(t.id,t.duration,t.width,t.height),e.mdiaMP4(t))}},{key:"mdiaMP4",value:function(t){return e.box(e.types.mdia,e.mdhd(t.duration,t.timescale),e.hdlr(t.type),e.minfMP4(t))}},{key:"minfMP4",value:function(t){return e.box(e.types.minf,t.type===m.Vc.VIDEO?e.VMHD:e.SMHD,e.DINF,e.stblMP4(t))}},{key:"stblMP4",value:function(t){var n=t.ext,i=[e.stsd(t),e.stts(n.stts),e.stsc(n.stsc),e.stsz(n.stsz),e.stco(n.stco)];return n.stss.length&&i.push(e.stss(n.stss)),n.ctts.length&&i.push(e.ctts(n.ctts)),e.box.apply(e,[e.types.stbl].concat(i))}},{key:"stts",value:function(t){var n=t.length,i=new Uint8Array(8*n),r=0;return t.forEach(function(e){var t=e.value,n=e.count;i.set([n>>24,n>>16&255,n>>8&255,255&n,t>>24,t>>16&255,t>>8&255,255&t],r),r+=8}),e.box(e.types.stts,(0,p.gJ)(new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n]),i))}},{key:"stsc",value:function(t){var n=t.length,i=new Uint8Array(12*n),r=0;return t.forEach(function(e){var t=e.firstChunk,n=e.samplesPerChunk,a=e.sampleDescIndex;i.set([t>>24,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,a>>24,a>>16&255,a>>8&255,255&a],r),r+=12}),e.box(e.types.stsc,(0,p.gJ)(new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n]),i))}},{key:"stsz",value:function(t){var n=t.length,i=new Uint8Array(4*n),r=0;return t.forEach(function(e){i.set([e>>24,e>>16&255,e>>8&255,255&e],r),r+=4}),e.box(e.types.stsz,(0,p.gJ)(new Uint8Array([0,0,0,0,0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n]),i))}},{key:"stco",value:function(t){var n=t.length,i=new Uint8Array(4*n),r=0;return t.forEach(function(e){i.set([e>>24,e>>16&255,e>>8&255,255&e],r),r+=4}),e.box(e.types.stco,(0,p.gJ)(new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n]),i))}},{key:"stss",value:function(t){var n=t.length,i=new Uint8Array(4*n),r=0;return t.forEach(function(e){i.set([e>>24,e>>16&255,e>>8&255,255&e],r),r+=4}),e.box(e.types.stss,(0,p.gJ)(new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n]),i))}},{key:"ctts",value:function(t){var n=t.length,i=new Uint8Array(8*n),r=0;return t.forEach(function(e){var t=e.value,n=e.count;i.set([n>>24,n>>16&255,n>>8&255,255&n,t>>24,t>>16&255,t>>8&255,255&t],r),r+=8}),e.box(e.types.ctts,(0,p.gJ)(new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n]),i))}}]),e}();(0,d.Z)(y,"types",["avc1","avcC","hvc1","hvcC","dinf","dref","esds","ftyp","hdlr","mdat","mdhd","mdia","mfhd","minf","moof","moov","mp4a","mvex","mvhd","pasp","stbl","stco","stsc","stsd","stsz","stts","tfdt","tfhd","traf","trak","trun","trex","tkhd","vmhd","smhd","ctts","stss"].reduce(function(e,t){return e[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)],e},Object.create(null))),(0,d.Z)(y,"HDLR_TYPES",{video:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),audio:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0])}),(0,d.Z)(y,"FTYPAVC1",y.box(y.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))),(0,d.Z)(y,"FTYPHEV1",y.box(y.types.ftyp,new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,104,101,118,49]))),(0,d.Z)(y,"DINF",y.box(y.types.dinf,y.box(y.types.dref,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1])))),(0,d.Z)(y,"VMHD",y.box(y.types.vmhd,new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]))),(0,d.Z)(y,"SMHD",y.box(y.types.smhd,new Uint8Array([0,0,0,0,0,0,0,0]))),(0,d.Z)(y,"StblTable",new Uint8Array([0,0,0,0,0,0,0,0])),(0,d.Z)(y,"STTS",y.box(y.types.stts,y.StblTable)),(0,d.Z)(y,"STSC",y.box(y.types.stsc,y.StblTable)),(0,d.Z)(y,"STSZ",y.box(y.types.stsz,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]))),(0,d.Z)(y,"STCO",y.box(y.types.stco,y.StblTable));var k=function(){function e(t,n){(0,c.Z)(this,e),this.videoTrack=t,this.audioTrack=n;var i=/Chrome\/([^.]+)/.exec(navigator.userAgent);this.forceFirstIDR=i&&50>Number(i[1])}return(0,l.Z)(e,[{key:"remux",value:function(){var e,t,n,i,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=this.videoTrack,o=this.audioTrack,s=a.exist(),u=o.exist();return r&&(s&&(e=y.initSegment([this.videoTrack])),u&&(t=y.initSegment([this.audioTrack]))),s&&a.hasSample()&&(n=this._remuxVideo()),u&&o.hasSample()&&(i=this._remuxAudio()),a.samples=[],o.samples=[],{videoInitSegment:e,audioInitSegment:t,videoSegment:n,audioSegment:i}}},{key:"_remuxVideo",value:function(){var e=this.videoTrack,t=e.samples;this.forceFirstIDR&&(t[0].flag={dependsOn:2,isNonSyncSample:0});var n=0;t.forEach(function(e){n+=e.units.reduce(function(e,t){return e+t.byteLength},0)+4*e.units.length});for(var i=new Uint8Array(n),r=new DataView(i.buffer),a=function(e,n,a,s){s=t[e];var u=0;s.units.forEach(function(e){r.setUint32(a,e.byteLength),a+=4,i.set(e,a),a+=e.byteLength,u+=4+e.byteLength}),s.size=u,c=a,o=s},o,s=0,u=t.length,c=0;s<u;s++)a(s,u,c,o);var l=y.moof(this.videoTrack.sequenceNumber++,[e]),d=y.mdat(i);return(0,p.gJ)(l,d)}},{key:"_remuxAudio",value:function(){var e=this.audioTrack,t=y.moof(this.audioTrack.sequenceNumber++,[e]),n=new Uint8Array(e.samples.reduce(function(e,t){return e+t.size},0));e.samples.reduce(function(e,t){return n.set(t.data,e),e+t.size},0);var i=y.mdat(n);return(0,p.gJ)(t,i)}}]),e}(),b=n("726085"),C=n("597931"),E=n("534611"),A=n("383943"),x=n("874668");function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach(function(t){(0,d.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var S={"mp4a.40.5":1,"mp4a.40.2":2},D=new(function(){function e(){(0,c.Z)(this,e),(0,d.Z)(this,"_queue",[]),"undefined"!=typeof document&&(this._tempMedia=document.createElement("video"))}return(0,l.Z)(e,[{key:"tempMedia",get:function(){return this._tempMedia}},{key:"hasCached",get:function(){return -1!==this._queue.findIndex(function(e){return 1===e.codec})&&-1!==this._queue.findIndex(function(e){return 2===e.codec})}},{key:"getCachedMedia",value:function(e){var t=this._queue.findIndex(function(t){return t.codec===e});return -1!==t?this._queue.splice(t,1)[0]:null}},{key:"cacheMedia",value:function(e){var t=e.codec,n=e.media,i=e.mse,r=S[t];if(this._queue=this._queue.filter(function(e){e.mse&&!e.mse.isOpened&&e.mse.unbindMedia();var t,n=null===(t=e.mse)||void 0===t?void 0:t.isOpened;return!n&&e.media&&(e.media.canuse=0),n}),n.canuse=0,!t||this._queue.filter(function(e){return e.codec===r}).length>2){null==i||i.endOfStream(),null==i||i.unbindMedia();return}n.canuse=1,this._queue.push({codec:r,media:n,mse:i})}}]),e}()),P=function(e){(0,o.Z)(m,e);var t,n,h,v,_,p=(t=m,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(e){return!1}}(),function(){var e,i=(0,u.Z)(t);return e=n?Reflect.construct(i,arguments,(0,u.Z)(this).constructor):i.apply(this,arguments),(0,s.Z)(this,e)});function m(e,t){var n,a;return(0,c.Z)(this,m),n=p.call(this,e,t),(0,d.Z)((0,r.Z)(n),"_media",void 0),(0,d.Z)((0,r.Z)(n),"_isTempMedia",!1),(0,d.Z)((0,r.Z)(n),"_mse",void 0),(0,d.Z)((0,r.Z)(n),"_remuxer",null),(0,d.Z)((0,r.Z)(n),"_codec",""),(0,d.Z)((0,r.Z)(n),"_sourceCreated",!1),(0,d.Z)((0,r.Z)(n),"_needInitSegment",!0),(0,d.Z)((0,r.Z)(n),"_seekNoSideEffect",!1),(0,d.Z)((0,r.Z)(n),"_startRendered",!1),(0,d.Z)((0,r.Z)(n),"_firstTimeAppendedBuffer",!1),(0,d.Z)((0,r.Z)(n),"_sampleQueue",[]),(0,d.Z)((0,r.Z)(n),"_inProcessing",!1),(0,d.Z)((0,r.Z)(n),"_duration",0),(0,d.Z)((0,r.Z)(n),"_mediaCache",D),(0,d.Z)((0,r.Z)(n),"_resetDts",function(){}),(0,d.Z)((0,r.Z)(n),"_onCanplay",function(){!n._ready&&(n._ready=!0,n.emit(E.ZP.AUDIO.AUDIO_READY))}),(0,d.Z)((0,r.Z)(n),"_onPlaying",function(){n._parent.ready&&(n._audioCanAutoplay=!0,n._emitTimelineEvents(E.ZP.TIMELINE.PLAY_EVENT,E.ZP.VIDEO_EVENTS.PLAYING))}),(0,d.Z)((0,r.Z)(n),"_onWaiting",function(){if(!n._seekNoSideEffect){try{for(var e,t=n._media.buffered,i=n._media.currentTime,a=0,o=0,s=t.length;o<s;o++)t.start(o)<i&&t.end(o)>i&&(a=t.end(o)-i);if(Math.abs(a)>.5)return;if(Math.abs(n._media.duration-n._media.currentTime)<(n.duration>60?.5:.3)){!n._reuseMse&&n._mse.endOfStream(),null===(e=(0,r.Z)(n))||void 0===e||e._emitTimelineEvents(E.ZP.TIMELINE.PLAY_EVENT,E.ZP.VIDEO_EVENTS.ENDED);return}}catch(e){}n._ready=!1,n.emit(E.ZP.AUDIO.AUDIO_WAITING)}}),(0,d.Z)((0,r.Z)(n),"_onSeeked",function(){if(n._seekNoSideEffect||n._isLive){n._seekNoSideEffect=!1;return}C.kg.log(n.TAG,"seeked","_readyStatus:",n._ready),!n._ready&&(n._media.pause(),n._ready=!0,n.emit(E.ZP.AUDIO.AUDIO_READY,!0))}),(0,d.Z)((0,r.Z)(n),"_onProgress",function(){if(n._media.readyState<=1){var e=n._getBufferGap();e>0&&e<1&&(n._media.currentTime+=e+.05,C.kg.warn(n.TAG,"progress, gap=",e))}n._emitTimelineEvents(E.ZP.TIMELINE.PLAY_EVENT,E.ZP.VIDEO_EVENTS.PROGRESS),n._emitTimelineEvents(E.ZP.TIMELINE.PLAY_EVENT,E.ZP.VIDEO_EVENTS.DURATION_CHANGE)}),(0,d.Z)((0,r.Z)(n),"_onEnded",function(){var e;C.kg.log(n.TAG,"ended!"),null===(e=(0,r.Z)(n))||void 0===e||e._emitTimelineEvents(E.ZP.TIMELINE.PLAY_EVENT,E.ZP.VIDEO_EVENTS.ENDED)}),(0,d.Z)((0,r.Z)(n),"_onOnceProgress",function(){if(n._media.buffered.length){var e=n._media.buffered.start(0);e&&(n._media.currentTime=e+.05,C.kg.log(n.TAG,"start gap:",e)),n._media.removeEventListener("progress",n._onOnceProgress)}}),(0,d.Z)((0,r.Z)(n),"_onError",function(){var e;n._emitTimelineEvents(E.ZP.TIMELINE.PLAY_EVENT,E.ZP.VIDEO_EVENTS.ERROR,n._assembleErr("audio error: ".concat(null===(e=n._media.error)||void 0===e?void 0:e.message),3))}),(0,d.Z)((0,r.Z)(n),"_appendChunk",function(e,t){if(!n.noAudio){if(t.samples.length){if(!n._codec&&(2!==t.objectType&&5!==t.objectType?n._codec="mp4a.40.5":n._codec=t.codec,n._isTempMedia&&n._switchMedia(n._codec)),t.samples.forEach(function(e){e.baseMediaDecodeTime=t.baseMediaDecodeTime,n._sampleQueue.push(e)}),t.samples=[],!n._meta){n._meta=L(L({},t),{},{exist:function(){return!0},hasSample:function(){return!0},samples:[]}),C.kg.warn(n.TAG,"audio set metadata",n._meta),n._doAppendWrapper();return}n._meta.sampleRate!==t.sampleRate&&(C.kg.warn(n.TAG,"discontinue: ".concat(n._meta.sampleRate," -> ").concat(t.sampleRate)),n._needInitSegment=!0,Object.keys(t).forEach(function(e){n._meta[e]=t[e]})),!n._inProcessing&&n._sampleQueue.length&&n._doAppendWrapper()}}}),(0,d.Z)((0,r.Z)(n),"_doAppend",(a=(0,i.Z)(f().mark(function e(t){var i,r,a;return f().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n._remuxer&&(n._remuxer=new k({samples:[],exist:function(){return!1}},t)),i=t.samples,n._sourceCreated){e.next=12;break}return n.analyse.addAudioMseOpenStart(),e.next=6,n._mse.open();case 6:n._sourceCreated=!0,C.kg.log(n.TAG,"video/mp4;codecs=".concat(n._codec)),n._mse.createSource(t.type,"video/mp4;codecs=".concat(n._codec)),n.analyse.addAudioMseOpend(),C.kg.log(n.TAG,"sb created!"),n._checkAutoPlay();case 12:if(r=n._remuxer.remux(n._needInitSegment),!(n._needInitSegment&&!r.audioInitSegment)){e.next=15;break}return e.abrupt("return");case 15:return n._needInitSegment=!1,a=[],r.audioInitSegment&&a.push(n._mse.append(t.type,r.audioInitSegment)),r.audioSegment&&a.push(n._mse.append(t.type,r.audioSegment)),e.abrupt("return",Promise.all(a).then(function(){return i[i.length-1].dts/1e3}).then(function(){!n._firstTimeAppendedBuffer&&(n._firstTimeAppendedBuffer=!0,n.analyse.addAudioFirstTimeAppended())}));case 20:case"end":return e.stop()}},e)})),function(e){return a.apply(this,arguments)})),(0,d.Z)((0,r.Z)(n),"_doPlay",function(){n._media.play().catch(function(){})}),(0,d.Z)((0,r.Z)(n),"_doPause",function(){n._media.pause()}),(0,d.Z)((0,r.Z)(n),"_doSeek",function(e){C.kg.log(n.TAG,"doSeek, t=",e),n._ready=!1,n._media.currentTime=e}),(0,d.Z)((0,r.Z)(n),"_doChaseFrame",function(e){var t=e.position;n._seekNoSideEffect=!0,n._media.currentTime=t}),(0,d.Z)((0,r.Z)(n),"_startRender",function(){C.kg.log(n.TAG,"start render"),n._startRendered=!0,n._media.play().catch(function(){})}),n.TAG="AudioMseRender",n._reuseMse=(0,x.tT)().reuseMseForAudio,n._initMedia(),n}return(0,l.Z)(m,[{key:"isMse",get:function(){return!0}},{key:"media",get:function(){return this._media}},{key:"currentTime",get:function(){return this._media.currentTime}},{key:"buffered",get:function(){return this._media.buffered}},{key:"duration",get:function(){return isNaN(this._media.duration)?1/0:this._media.duration},set:function(e){this._duration=e,this._updateDuration(e)}},{key:"audioCanAutoplay",get:function(){return this._audioCanAutoplay||this.noAudio}},{key:"readyState",get:function(){var e;return(null===(e=this._media)||void 0===e?void 0:e.readyState)||0}},{key:"_initMedia",value:function(){if(!this._reuseMse||!D.hasCached){C.kg.log(this.TAG,"init media and mse directly"),this._media=document.createElement("video"),this._media.autoplay=!0,this._media.canuse=1,this._mse=new b.d1,this._bindEvents(),this._bindMediaEvents(),this._mse.bindMedia(this._media);return}C.kg.log(this.TAG,"bind media temporary"),this._media=D.tempMedia,this._bindEvents(),this._isTempMedia=!0}},{key:"_switchMedia",value:function(e){var t=this._media,n=D.getCachedMedia(S[e]);n?(C.kg.warn(this.TAG,"switch to cached media for audio play! codec=".concat(e)),this._media=n.media,this._mse=n.mse,this._bindMediaEvents(),this._updateDuration(this._duration),this._media.currentTime=.05,this._sourceCreated=!0,this._audioCanAutoplay=!0,this.analyse.addAudioMseOpend()):this._initMedia(),this._media.volume=t.volume,this._media.playbackRate=t.playbackRate,this._isTempMedia=!1}},{key:"_getBufferGap",value:function(){for(var e=this.buffered,t=0,n=e.length;t<n;t++)if(!(e.end(t)<this.currentTime))return e.start(t)-this.currentTime;return 0}},{key:"canSeek",value:function(){return!0}},{key:"resume",value:function(){return this._media.play()}},{key:"pause",value:function(){return this._media.pause()}},{key:"seekNoSideEffect",value:function(e){this._doChaseFrame(e)}},{key:"dump",value:function(){}},{key:"_emitTimelineEvents",value:function(e,t,n){var i,r;null===(i=this._parent)||void 0===i||null===(r=i.emit)||void 0===r||r.call(i,e,t,n)}},{key:"_assembleErr",value:function(e,t){var n=Error(e);return n.code=3,n.subCode=t,n}},{key:"_bindEvents",value:function(){var e=this;(0,a.Z)((0,u.Z)(m.prototype),"_bindEvents",this).call(this),this._parent.on(E.ZP.DECODE_EVENTS.CHASE_AUDIO_FRAME,this._doChaseFrame),this._parent.on(E.ZP.TIMELINE.UPDATE_VOLUME,function(t){e._media.volume=t,e._emitTimelineEvents(E.ZP.TIMELINE.PLAY_EVENT,E.ZP.VIDEO_EVENTS.VOLUME_CHANGE)}),this._parent.on(E.ZP.TIMELINE.END_OF_STREAM,function(){if(!e.reuseMseForAudio){var t;null===(t=e._mse)||void 0===t||t.endOfStream()}}),this._parent.on(E.ZP.TIMELINE.SET_PLAYBACKRATE,function(t){C.kg.log(e.TAG,"change playbackrate, ",t),e._media.playbackRate=t})}},{key:"_bindMediaEvents",value:function(){this._media.addEventListener("canplay",this._onCanplay),this._media.addEventListener("playing",this._onPlaying),this._media.addEventListener("waiting",this._onWaiting),this._media.addEventListener("seeked",this._onSeeked),this._media.addEventListener("progress",this._onProgress),this._media.addEventListener("ended",this._onEnded),this._media.addEventListener("progress",this._onOnceProgress),this._media.addEventListener("error",this._onError)}},{key:"_updateDuration",value:(h=(0,i.Z)(f().mark(function e(t){return f().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._mse){e.next=9;break}if(this._mse.isOpened){e.next=4;break}return e.next=4,this._mse.open();case 4:if(this._mse){e.next=6;break}return e.abrupt("return");case 6:return e.next=8,this._mse.updateDuration(t);case 8:C.kg.log(this.TAG,"update duration",t);case 9:case"end":return e.stop()}},e,this)})),function(e){return h.apply(this,arguments)})},{key:"_doAppendWrapper",value:(v=(0,i.Z)(f().mark(function e(){var t;return f().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this._meta){e.next=2;break}return e.abrupt("return");case 2:return this._meta.samples=this._sampleQueue.slice(),this._meta.baseMediaDecodeTime=this._meta.samples[0].baseMediaDecodeTime,this._sampleQueue=[],e.prev=5,this._inProcessing=!0,e.next=9,this._doAppend(this._meta);case 9:if(t=e.sent,this.isLive&&this._emitTimelineEvents(E.ZP.TIMELINE.UPDATE_SEGMENT_END,t),this._inProcessing=!1,!this._sampleQueue.length){e.next=15;break}return e.next=15,this._doAppendWrapper();case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(5),this._emitTimelineEvents(E.ZP.TIMELINE.PLAY_EVENT,E.ZP.VIDEO_EVENTS.ERROR,this._assembleErr("audio error: ".concat(null===e.t0||void 0===e.t0?void 0:e.t0.message),3));case 20:case"end":return e.stop()}},e,this,[[5,17]])})),function(){return v.apply(this,arguments)})},{key:"_checkAutoPlay",value:function(){var e=this;this._media.addEventListener("canplay",function t(){if(e._media){var n=e._media.volume;e._media.volume=Math.min(n,.1);var i=e._media.play();(i=i.then?i:Promise.reject()).then(function(){C.kg.log(e.TAG,"auto play by checkAutoPlay!"),e._audioCanAutoplay=!0}).catch(function(){C.kg.warn(e.TAG,"cant auto play!"),e._audioCanAutoplay=!1,e.emit(E.ZP.AUDIO.AUDIO_NOT_ALLOWED_AUTOPLAY)}).finally(function(){e._media&&(e._media.volume=n,!e._startRendered&&(e._media.pause(),C.kg.log(e.TAG,"auto paused by checkAutoPlay!")),e._media.removeEventListener("canplay",t))})}})}},{key:"_destroy",value:(_=(0,i.Z)(f().mark(function e(){var t,n,i,r;return f().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(C.kg.log(this.TAG,"destroy audio render"),this._remuxer=null,this.removeAllListeners(),this._media.removeEventListener("canplay",this._onCanplay),this._media.removeEventListener("playing",this._onPlaying),this._media.removeEventListener("waiting",this._onWaiting),this._media.removeEventListener("seeked",this._onSeeked),this._media.removeEventListener("progress",this._onProgress),this._media.removeEventListener("ended",this._onEnded),this._media.removeEventListener("progress",this._onOnceProgress),this._media.removeEventListener("error",this._onError),this._reuseMse){e.next=18;break}return null===(t=this._mse)||void 0===t||t.endOfStream(),e.next=15,null===(n=this._mse)||void 0===n?void 0:n.unbindMedia();case 15:this._media&&(this._media.canuse=0),e.next=21;break;case 18:null!==(i=this._media.buffered)&&void 0!==i&&i.length&&(null===(r=this._mse)||void 0===r||r.clearAllBuffer()),D.cacheMedia({codec:this._codec,media:this._media,mse:this._mse}),C.kg.log(this.TAG,"cache media for audio play, codec=",this._codec);case 21:this._mse=null,this._meta=null,this._media=null,this._mediaCache=null;case 25:case"end":return e.stop()}},e,this)})),function(){return _.apply(this,arguments)})}],[{key:"isSupported",value:function(){return(0,x.tT)().audioWithMse&&!!window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="mp4a.40.5"')}}]),m}(A.Z)},597931:function(e,t,n){n.d(t,{Je:function(){return u},Mv:function(){return s},kg:function(){return o}});var i=n(298322),r=n(315355),a=n(919209);n(759943),n(705574),n(346984),n(124300),n(248385),n(832674),n(905442),n(446336),n(808483),n(840938),n(118438),n(325598),n(92999),n(611067),n(273723),n(724016),n(803903),n(214604),n(901250),n(755006),n(437048),n(488336),n(825666),n(177162),n(286633),n(943281),n(810658),n(82726),n(224727),n(679308);var o=new(function(){function e(){var t=this;(0,r.Z)(this,e);try{var n=/xgd=(\d)/.exec(document.cookie);this._status=!!n,this._level=n&&n[1]}catch(e){this._status=!1}["group","groupEnd","log","warn","error"].forEach(function(e){t[e]=function(n,r,a,o,s,u,c,l,d,h){if(t._status){var f,v=[r,a,o,s,u,c,l,d,h].filter(function(e){return void 0!==e});(f=console)[e].apply(f,["["+n+"]:"].concat((0,i.Z)(v)))}}})}return(0,a.Z)(e,[{key:"enable",get:function(){return this._status}},{key:"long",get:function(){return"2"===this._level}}]),e}());function s(e,t){if(e&&t){var n=new Uint8Array(e.byteLength+t.byteLength+11);n[0]=1,n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=255,n[5]=225;var i=6;return n.set(new Uint8Array([e.byteLength>>>8&255,255&e.byteLength]),i),i+=2,n.set(e,i),n[i+=e.byteLength]=1,i++,n.set(new Uint8Array([t.byteLength>>>8&255,255&t.byteLength]),i),i+=2,n.set(t,i),n}}function u(){var e,t,n=new Promise(function(n,i){e=n,t=i});return n.resolve=e,n.reject=t,n}},43832:function(e,t,n){n.d(t,{$Z:function(){return u},_H:function(){return o},d0:function(){return l},hj:function(){return c},mt:function(){return a}});var i=n(548814),r=n(279981);function a(e,t){var n=e.trak;if(!!n&&!!n.length){var i=n.find(function(e){var t,n;return(null===(t=e.mdia)||void 0===t?void 0:null===(n=t.hdlr)||void 0===n?void 0:n.handlerType)==="vide"}),r=n.find(function(e){var t,n;return(null===(t=e.mdia)||void 0===t?void 0:null===(n=t.hdlr)||void 0===n?void 0:n.handlerType)==="soun"});if(i||r){var a=[],o=[];if(t){var s=[],u=0,c=t.start+t.size;t.references.forEach(function(e,n){s.push({index:n,startTime:u,endTime:u+e.subsegment_duration/t.timescale,duration:e.subsegment_duration/t.timescale,range:[c,c+e.referenced_size],frames:[]}),u+=e.subsegment_duration/t.timescale,c+=e.referenced_size}),a=s,o=s}else{var l,d,h=function(t){return t?[{index:0,startTime:0,endTime:t.duration/t.timescale,duration:t.duration/t.timescale,range:[e.start+e.size,""],frames:[]}]:[]};o=h(e.mvhd.duration?e.mvhd:null===(l=i.mdia)||void 0===l?void 0:l.mdhd),a=h(e.mvhd.duration?e.mvhd:null===(d=r.mdia)||void 0===d?void 0:d.mdhd)}return{videoSegments:o,audioSegments:a}}}}function o(e,t){var n,i=t.segmentDuration,r=e.trak;if(!!r&&!!r.length){var a=r.find(function(e){var t,n;return(null===(t=e.mdia)||void 0===t?void 0:null===(n=t.hdlr)||void 0===n?void 0:n.handlerType)==="vide"}),o=r.find(function(e){var t,n;return(null===(t=e.mdia)||void 0===t?void 0:null===(n=t.hdlr)||void 0===n?void 0:n.handlerType)==="soun"});if(a||o){var u=[],c=[];return a&&(n=(u=s("video",a,i,t)).map(function(e){return e.duration})),o&&(c=s("audio",o,i,t,n,u)),{videoSegments:u,audioSegments:c}}}}function s(e,t,n,a){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5?arguments[5]:void 0,u=a.fixEditListOffset,c=a.fixEditListOffsetThreshold,l=a.audioGroupingStrategy,d=a.memoryOpt,h=null===(ee=t.mdia)||void 0===ee?void 0:null===(et=ee.minf)||void 0===et?void 0:et.stbl;if(!h)return[];var f=null===(en=t.mdia.mdhd)||void 0===en?void 0:en.timescale,v=h.stts,_=h.stsc,p=h.stsz,m=h.stco,g=h.stss,y=h.ctts;if(!f||!v||!_||!p||!m||"video"===e&&!g)return[];var k=0,b=null===(ei=t.edts)||void 0===ei?void 0:null===(er=ei.elst)||void 0===er?void 0:er.entries;if(u&&function(){var e=!0,t=navigator.userAgent||"";if(/Firefox\//i.test(t))return!1;if(/Chrome/gi.test(t)&&!/Edge\//gi.test(t)){var n=t.match(/Chrome\/(\d+)/i),i=n?parseInt(n[1],10):0;e=!!i&&i>=75}return e}()&&Array.isArray(b)&&b.length>0){var C=b[0].media_time;C>0&&C<(c?c*f:5*f)&&(k=C)}var E=[],A=[],x=[],T=[],L=[],S=_.entries,D=m.entries,P=p.entrySizes,I=null==g?void 0:g.entries,N=null==y?void 0:y.entries,w=[],R={};!d&&(N&&N.forEach(function(e){for(var t=e.count,n=e.offset,i=0;i<t;i++)w.push(n)}),I&&I.forEach(function(e){R[e-1]=!0}));var M=0,O=0,Z=0,V=0,U=S.length>0?S[0].samplesPerChunk:0,W=S.length>1&&S[1]?S[1].firstChunk-1:1/0,B=0,F=-1,H=!1,G={};(null==N?void 0:N.length)>0&&k>0&&(B-=k,H=!0),t.editListApplied=H,d&&(eo=null==I?void 0:I.shift()),v.entries.forEach(function(e){for(var t=e.count,n=e.delta,i=0;i<t;i++){if(ea={dts:B,duration:n,size:P[M]||p.sampleSize,offset:D[O]+V,index:M},N&&(d?(function(e,t,n){n.offset=0;var i=(null==n?void 0:n.beforeFrameNum)||0,r=(null==n?void 0:n.usedCttsIdx)||0;if(!e||(null==e?void 0:e.length)<=0||(null==n?void 0:n.usedCttsIdx)>=e.length)n.offset=0,n.usedCttsIdx=r,n.beforeFrameNum=i;else{var a=e[r];if(t<i+((null==a?void 0:a.count)||1))n.offset=(null==a?void 0:a.offset)||0;else{var o=e[++r];o?(n.offset=o.offset||0,n.beforeFrameNum=i+a.count):(n.offset=0,n.beforeFrameNum=i+1),n.usedCttsIdx=r}}}(N,M,G),ea.pts=B+((null==G?void 0:G.offset)||0)):w&&M<w.length&&(ea.pts=B+w[M])),0===k&&0===M&&(ea.pts=0),void 0===ea.pts&&(ea.pts=ea.dts),I){if(d?M+1===eo&&(ea.keyframe=!0,eo=I.shift()):ea.keyframe=R[M],ea.keyframe){if(F++,d){var a=new r.Z;a.appendFrame(ea),A.push(a)}else A.push([ea]),x.push(ea.duration)}else d?A[A.length-1].appendFrame(ea):(A[A.length-1].push(ea),x[A.length-1]+=ea.duration);ea.gopId=F,d&&A[A.length-1].calMinMaxPts(ea)}if(!d){if(ea.keyframe?T[T.length]=ea.pts:ea.pts<T[A.length-1]&&(T[A.length-1]=ea.pts),ea.keyframe)L[L.length]=ea.index;else if(A.length>0&&void 0!==L[A.length-1]){var o,s=null===(o=E[L[A.length-1]])||void 0===o?void 0:o.pts;void 0!==s&&ea.pts>s&&(L[A.length-1]=ea.index)}}E[E.length]=ea,B+=n,++M<U?V+=ea.size:(O++,V=0,O>=W&&(W=S[++Z+1]?S[Z+1].firstChunk-1:1/0),U+=S[Z].samplesPerChunk)}});var j=E.length;if(!j||g&&!E[0].keyframe)return[];var q=[],z=[],Y=0,X=0,J=0,Q=0,K=function(e,t,n){es=z[z.length-1],d?(J=(null==A?void 0:A.length)>0?A[t].minPts:z[0].pts,Q=(null==A?void 0:A.length)>0?A[n].maxPts:es.pts+es.duration):(J=T[t],Q=(eu=E[L[n]]).pts+eu.duration),0===q.length&&(e=(Q-J)/f),q.push({index:q.length,startTime:J/f,endTime:Q/f,duration:e,range:[z[0].offset,es.offset+es.size-1],frames:z}),1!==l&&(Y=0),z=[]},$=0;if(g){for(var ee,et,en,ei,er,ea,eo,es,eu,ec,el,ed=n*f,eh=0,ef=A.length;eh<ef;eh++)d?(Y+=A[eh].dur,(ec=z).push.apply(ec,(0,i.u)(A[eh].frames))):(Y+=x[eh],(el=z).push.apply(el,(0,i.u)(A[eh]))),eh+1<ef?(0===eh||Y>ed)&&(K(Y/f,$,eh),Y=0,$=eh+1):(K(Y/f,$,eh),Y=0,$=eh+1)}else{!d&&(T=[],L=[]);var ev=o[0]||n;if(1===l)for(var e_,ep=0;ep<j;ep++){var em=E[ep],eg=E[ep+1],ey=ep===j-1;z.push(em),Y+=em.duration;var ek=e_||Y/f;e_=(eg?Y+eg.duration:0)/f,(ey||(s[q.length]?e_>s[q.length].endTime:e_-z[0].pts/f>=ev))&&(!d&&(T.push(z[0].pts),L.push(z[z.length-1].index)),K(ek,q.length,q.length),ev=o[q.length]||n)}else for(var eb,eC=0;eC<j;eC++){var eE=E[eC],eA=E[eC+1],ex=eC===j-1;z.push(eE),Y+=eE.duration;var eT=eb||Y/f;eb=(eA?Y+eA.duration:0)/f,(ex||eb+X>=ev)&&(2===l?X+=Y/f-ev:X+=eb-ev,!d&&(T.push(z[0].pts),L.push(z[z.length-1].index)),K(eT,q.length,q.length),ev=o[q.length]||n)}}return q}function u(e,t){var n="",i="",r=0,a=0,o=0,s=0,u=0,c=0,l=0;e.mvhd&&(u=e.mvhd.duration/e.mvhd.timescale);var d=e.trak;if(d){var h,f,v,_,p,m,g,y,k,b,C,E,A,x,T,L,S,D,P,I=d.find(function(e){var t,n;return(null===(t=e.mdia)||void 0===t?void 0:null===(n=t.hdlr)||void 0===n?void 0:n.handlerType)==="vide"}),N=d.find(function(e){var t,n;return(null===(t=e.mdia)||void 0===t?void 0:null===(n=t.hdlr)||void 0===n?void 0:n.handlerType)==="soun"}),w=null;if(I&&(w=null===(_=I.mdia)||void 0===_?void 0:null===(p=_.minf)||void 0===p?void 0:null===(m=p.stbl)||void 0===m?void 0:m.stsd.entries[0])&&(r=w.width,a=w.height,c=null===(g=I.mdia)||void 0===g?void 0:null===(y=g.mdhd)||void 0===y?void 0:y.timescale,n=null===(k=w.avcC||w.hvcC||w.av1C||w.vvcC)||void 0===k?void 0:k.codec,"encv"===w.type&&(v=null===(b=w.sinf)||void 0===b?void 0:null===(C=b.schi)||void 0===C?void 0:C.tenc.default_KID)),N&&(w=null===(E=N.mdia)||void 0===E?void 0:null===(A=E.minf)||void 0===A?void 0:null===(x=A.stbl)||void 0===x?void 0:x.stsd.entries[0])){;o=w.channelCount,f=0,s=(f="mp4a"===(h=w).type?h.sampleRate>0?h.sampleRate:h.esds.sampleRate:h.sampleRate)||0,i=null===(T=w.esds)||void 0===T?void 0:T.codec,l=null===(L=N.mdia)||void 0===L?void 0:null===(S=L.mdhd)||void 0===S?void 0:S.timescale,"enca"===w.type&&(v=v||(null===(D=w.sinf)||void 0===D?void 0:null===(P=D.schi)||void 0===P?void 0:P.tenc.default_KID))}return{kid:v?v.join(""):null,videoCodec:n,audioCodec:i,width:r,height:a,videoTimescale:c,audioChannelCount:o,audioSampleRate:s,duration:u,audioTimescale:l,moov:e,isFragmentMP4:t}}}function c(e){return"number"==typeof e&&!Number.isNaN(e)}function l(e){if(!e)return!1;var t=e.audioSegments,n=e.videoSegments,i=!n||0===n.length,r=!t||0===t.length;return(!i||!r)&&!0}},858417:function(e,t,n){function i(){var e,t,n=new Promise(function(n,i){e=n,t=i});return n.used=!1,n.resolve=function(){return n.used=!0,e.apply(void 0,arguments)},n.reject=function(){return n.used=!0,t.apply(void 0,arguments)},n}n.d(t,{Q:function(){return i}}),n(248385),n(679308)},587220:function(e,t,n){n.d(t,{G7:function(){return o},Gu:function(){return r},pl:function(){return u},rO:function(){return s}});var i=n(815839);function r(e){if(!!e&&null!==e[0]&&void 0!==e[0]&&(0!==e[0]||null!==e[1]&&void 0!==e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function a(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function o(e,t){if(e){if(!t)return e;var n,r=Object.keys(t).map(function(e){if(null!=(n=t[e]))return Array.isArray(n)?e+="[]":n=[n],n.map(function(t){return(0,i.J_)(t)?t=t.toISOString():(0,i.Kn)(t)&&(t=JSON.stringify(t)),"".concat(a(e),"=").concat(a(t))}).join("&")}).filter(Boolean).join("&");if(r){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}}function s(e,t,n,i,r,a,o,s,u,c,l){return r=null!=r?parseFloat(r):null,Number.isNaN(i=parseInt(i||"0",10))&&(i=0),{data:e,done:t,options:{range:u,vid:c,index:s,contentLength:i,age:r,startTime:a,firstByteTime:o,endTime:Date.now(),priOptions:l},response:n}}function u(e,t){return Math.round(8e3*e/t/1024)}},65661:function(e,t,n){n.d(t,{U:function(){return r},t:function(){return i}});var i={FETCH:"fetch",XHR:"xhr"},r={ARRAY_BUFFER:"arraybuffer",TEXT:"text",JSON:"json"}},416556:function(e,t,n){n.d(t,{_v:function(){return a},gJ:function(){return i},xf:function(){return r}});function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if((t=t.filter(Boolean)).length<2)return t[0];var i=r(t.reduce(function(e,t){return e+t.byteLength},0)),a=0;return t.forEach(function(e){i.set(e,a),a+=e.byteLength}),i}function r(e){for(var t,n=0;n<10;)try{if(t=new Uint8Array(e),t.byteLength>0)break;n++}catch(e){if(n<10)n++;else throw Error("new array failed final,".concat(null==e?void 0:e.message))}return t}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise(function(t){return setTimeout(t,e)})}}}]);