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

2 lines
115 KiB
Plaintext

/*! For license information please see player-4.2d93ebb7.js.LICENSE.txt */
"use strict";!function(e,t){"object"==typeof module&&"object"==typeof module.exports?t():"function"==typeof define&&define.amd?define([],t):(e="undefined"!=typeof globalThis?globalThis:e||self)&&t()}(this,function(){"use strict";"object"==typeof window&&(window.openRedirect={version:"1.2.20",webpackPluginVersion:"3.4.22",reportOnly:!1})}),!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).xss={})}(this,function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function i(e,t,i){if(i||2==arguments.length)for(var n,r=0,a=t.length;r<a;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}var n=/[^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 i,n;for(i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return -1},forEach:function(e,t,i){var n,r;for(n=0,r=e.length;n<r;n++)t.call(i,e[n],n,e)},some:function(e,t,i){var n,r;for(n=0,r=e.length;n<r;n++)if(t.call(i,e[n],n,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 i=0;i<e.length;i++)if(e[i]===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={},i=[],n=0;n<e.length;n++)t[e[n]]||(i.push(e[n]),t[e[n]]=!0);return i},from:function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},keys:function(e){var t=[];for(var i in e)t.push(i);return t}};function p(e){return null==e}function g(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 m(e){var t,i,n,r,a,o,s,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",l=0;for(e=function(e){e=e.replace(/rn/g,"n");for(var t="",i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t+=String.fromCharCode(n):n>127&&n<2048?t+=String.fromCharCode(n>>6|192)+String.fromCharCode(63&n|128):t+=String.fromCharCode(n>>12|224)+String.fromCharCode(n>>6&63|128)+String.fromCharCode(63&n|128)}return t}(e);l<e.length;)r=(t=e.charCodeAt(l++))>>2,a=(3&t)<<4|(i=e.charCodeAt(l++))>>4,o=(15&i)<<2|(n=e.charCodeAt(l++))>>6,s=63&n,isNaN(i)?o=s=64:isNaN(n)&&(s=64),c=c+u.charAt(r)+u.charAt(a)+u.charAt(o)+u.charAt(s);return c}function y(e){var t,i,n,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,i=(15&r)<<4|(a=s.indexOf(e.charAt(c++)))>>2,n=(3&a)<<6|(o=s.indexOf(e.charAt(c++))),u+=String.fromCharCode(t),64!==a&&(u+=String.fromCharCode(i)),64!==o&&(u+=String.fromCharCode(n));return function(e){for(var t="",i=0,n=0,r=0,a=0;i<e.length;)(n=e.charCodeAt(i))<128?(t+=String.fromCharCode(n),i++):n>191&&n<224?(t+=String.fromCharCode((31&n)<<6|63&(a=e.charCodeAt(i+1))),i+=2):(a=e.charCodeAt(i+1),t+=String.fromCharCode((15&n)<<12|(63&a)<<6|63&(r=e.charCodeAt(i+2))),i+=3);return t}(u)}function T(e,t,i){var n="",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){n+=i(e.slice(r,s)),a=s,r=s;continue}if(">"===d||s===u-1){n+=i(e.slice(r,a)),c=function(e){var t,i=_.spaceIndex(e);return t=-1===i?e.slice(1,-1):e.slice(1,i+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)),n+=t(a,n.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&&(n+=i(e.substr(r))),n}function b(e,t){var i=0,r=0,a=[],o=!1,s=e.length;function u(e,i){if(!((e=(e=_.trim(e)).replace(n,"").toLowerCase()).length<1)){var r=t(e,i||"");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 i=e[t];if(" "!==i)return"="===i?t:-1}return -1}(e,c))){u(_.trim(e.slice(i,c))),o=!1,i=c+1;continue}c=d-1;continue}if(-1===(d=function(e,t){for(;t>0;t--){var i=e[t];if(" "!==i)return"="===i?t:-1}return -1}(e,c-1))){u(o,g(_.trim(e.slice(i,c)))),o=!1,i=c+1;continue}}}else{if(-1===(d=e.indexOf(l,c+1)))break;u(o,_.trim(e.slice(r+1,d))),o=!1,i=(c=d)+1}}else o=e.slice(i,c),i=c+1,r='"'===e.charAt(i)||"'"===e.charAt(i)?i:function(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"'"===i||'"'===i?t:-1}return -1}(e,c+1)}return i<e.length&&(!1===o?u(e.slice(i)):u(o,g(_.trim(e.slice(i))))),_.trim(a.join(" "))}function E(e,t,i){if(i=function(e){return e=function(e){for(var t="",i=0,n=e.length;i<n;i++)t+=32>e.charCodeAt(i)?" ":e.charAt(i);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," "))}(i),"href"===t||"src"===t){if("#"===(i=_.trim(i)))return"#";if("http://"!==i.substr(0,7)&&"https://"!==i.substr(0,8)&&"mailto:"!==i.substr(0,7)&&"tel:"!==i.substr(0,4)&&"data:image/"!==i.substr(0,11)&&"ftp://"!==i.substr(0,6)&&"./"!==i.substr(0,2)&&"../"!==i.substr(0,3)&&"#"!==i[0]&&"/"!==i[0])return""}else if("background"===t){if(l.lastIndex=0,l.test(i))return""}else if("style"===t&&(h.lastIndex=0,h.test(i)||(d.lastIndex=0,d.test(i)&&(l.lastIndex=0,l.test(i)))))return"";return i=function(e){return e=v(e=e.replace(f,"&quot;"))}(i)}var x=function(e){return"string"==typeof e?e.replace(/'/g,'"').replace('=""',"").replace(/\s+/g,"").toLowerCase():""},R=function(){function e(e){var t=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{});t.stripIgnoreTag&&(t.onIgnoreTag,t.onIgnoreTag=function(){return""}),t.whiteList={},t.onTag=function(){},t.onTagAttr=function(){},t.onIgnoreTag=function(){},t.onIgnoreTagAttr=function(){},t.safeAttrValue=E,t.escapeHtml=v,this.options=Object.assign(t,e)}return e.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t,i,n,r,a,o,s=this.options,u=s.whiteList,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="",i=0;i<e.length;){var n=e.indexOf("\x3c!--",i);if(-1===n){t+=e.slice(i);break}t+=e.slice(i,n);var r=e.indexOf("--\x3e",n);if(-1===r)break;i=r+3}return t}(e));var p=!1;s.stripIgnoreTagBody&&(i=s.stripIgnoreTagBody,"function"!=typeof(n=l)&&(n=function(){}),r=!Array.isArray(i),a=[],o=!1,l=(p={onIgnoreTag:function(e,t,s){var u;if(u=e,r||-1!==_.indexOf(i,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 n(e,t,s)},remove:function(e){var t="",i=0;return _.forEach(a,function(n){t+=e.slice(i,n[0]),i=n[1]}),t+=e.slice(i)}}).onIgnoreTag);var g=T(e,function(e,t,i,n,r){var a={sourcePosition:e,position:t,isClosing:r,isWhite:Object.prototype.hasOwnProperty.call(u,i)},o=c(i,n,a);if(null!=o)return o;if(a.isWhite){if(a.isClosing)return"</".concat(i,">");var s=function(e){var t=_.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var i="/"===(e=_.trim(e.slice(t+1,-1)))[e.length-1];return i&&(e=_.trim(e.slice(0,-1))),{html:e,closing:i}}(n),p=u[i],g=b(s.html,function(e,t){var n=-1!==_.indexOf(p,e),r=d(i,e,t,n);return null==r?n?(t=f(i,e,t,null))?"".concat(e,'="').concat(t,'"'):e:null==(r=h(i,e,t,n))?void 0:r:r});return n="<".concat(i),g&&(n+=" ".concat(g)),s.closing&&(n+=" /"),n+=">"}return null==(o=l(i,n,a))?v(n):o},v);return p&&(g=p.remove(g)),g},e}(),A=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")(),k=new(function(){function e(){var e=this;this.batchData=[],this.uniqKeys=new Set,this.timeout=2e3,this.lock=!1,this.getSlardarBid=function(){var t,i,n="douyin_web";if(!_.includes(n,"bid"))return n;if(e.config&&e.config.bid)return e.config.bid;if(A&&A._xssBid)return A._xssBid;if(A&&A.slardar&&"function"==typeof A.slardar.config){var r=(A.slardar.config()||{}).bid;if(r)return r}if(A&&A.Slardar&&"function"==typeof A.Slardar.config){var a=(A.Slardar.config()||{}).bid;if(a)return a}return(null===(i=null===(t=null==A?void 0:A.Slardar)||void 0===t?void 0:t._baseParams)||void 0===i?void 0:i.bid)||"argus"},this.getConfigRegion=function(){var t;return _.includes("cn","region")?e.config&&e.config.region?e.config.region:((null===(t=null==A?void 0:A.gfdatav1)||void 0===t?void 0:t.region)||"cn").toLowerCase():"cn"},this.gerReportUrl=function(){var t={cn:y("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boe:y("aHR0cHM6Ly9tb24uemlqaWVhcGkuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),ttp:y("aHR0cHM6Ly9tb24udXMudGlrdG9rdi5jb20vbW9uaXRvcl9icm93c2VyL2NvbGxlY3QvYmF0Y2gvc2VjdXJpdHkvP2JpZD0="),va:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),maliva:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),sg:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9"),boei18n:y("aHR0cHM6Ly9tb24tdmEuYnl0ZW92ZXJzZWEuY29tL21vbml0b3JfYnJvd3Nlci9jb2xsZWN0L2JhdGNoL3NlY3VyaXR5Lz9iaWQ9")}[e.getConfigRegion()];if(t)return t+e.getSlardarBid()}}return e.prototype.setConfig=function(e){this.config=e},e.prototype.upload=function(){var e=this,t=this.gerReportUrl();!this.lock&&t&&0!==this.batchData.length&&(this.lock=!0,setTimeout(function(){var i=e.batchData.slice(0,100);e.batchData=e.batchData.slice(100),A.fetch(t,{method:"post",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}).catch(function(e){}),e.lock=!1,e.upload()},this.timeout))},e.prototype.generateKey=function(e){return e.collectKey?[e.collectMode,e.collectKey].join("___"):""},e.prototype.push=function(e){this.batchData.push(e),this.upload()},e.prototype.report=function(e){var t=this.generateKey(e);if(A.fetch&&e.collectKey){var i="object"==typeof window?window.location.href:"SSR";e.documentUrl=i;var n={age:Math.floor(Date.now()),type:"xss",url:i,body:e,"user-agent":""};"enforce"===e.disposition&&"SSR"!==i||(n.url=t),"SSR"===i&&(n.url="SSR___".concat(n.url),n.body.ssr=!0),this.push(n)}},e}()),S=function(e){for(var t=0,i=function(i){Array.isArray(e[i])?0===e[i].length?delete e[i]:(e[i]=_.from(_.uniq(e[i])),t+=e[i].length):0===_.keys(e[i]).length?delete e[i]:_.keys(e[i]).forEach(function(n){e[i][n]=_.from(_.uniq(e[i][n])),t+=e[i][n].length})},n=0,r=_.keys(e);n<r.length;n++)i(r[n]);return{count:t,ret:e}};function C(e,t){return k.setConfig(t),new R(t).process(e)}function I(e){var t,i=(t=/\s|\n|\t/.exec(e))?t.index:-1;if(-1===i)return{html:"",closing:"/"===e[e.length-2]};var n="/"===(e=e.slice(i+1,-1).trim())[e.length-1];return n&&(e=e.slice(0,-1).trim()),{html:e,closing:n}}var L=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,i,n){return String.fromCharCode(t?parseInt(i,16):parseInt(n))}).replace(/(\t|\n|\r)/g,"").toLowerCase()};function D(e,t){if(void 0===e&&(e=""),"string"!=typeof e)return!0;if(e=L(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 i=["expression(","behavior:","view-source:"];if(_.some(i,function(t){return -1!==e.indexOf(t)}))return _.forEach(i,function(i){-1!==e.indexOf(i)&&t&&t(i)}),!1;var n=["data:application","data:javascript","data:text/html","data:texthtml"];if(_.some(n,function(t){return -1!==e.indexOf(t)}))return _.forEach(n,function(i){-1!==e.indexOf(i)&&t&&t(i)}),!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 w=function(e,t){var i,n,r="<%= isSaveValidUrl =>";if("string"!=typeof e||(n=Number("<%= urlLimit =>"),void 0!==i&&(n=i),"NaN"!==e.toString()&&-1!==n&&e.length>=n)||D(e,t))return e;try{if(!0===(r=JSON.parse(r))||"true"===r){var a=new URL(e);return a.origin+a.pathname}}catch(e){}return"#"};function O(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=[]),"string"!=typeof e)return!0;if(!D(e=L(e)))return!1;var r,a={url:(r=e.match(/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/)||[])[0],scheme:r[1],slash:r[2],host:r[3],port:r[4],path:r[5],query:r[6],hash:r[7]},o=a.scheme,s=a.host;return n?!!n(e):!(!o||!s)&&(!_.includes(["http","https","file"],o)||("object"==typeof window&&window&&(t=i(i([],t,!0),[location.host],!1)),_.some(t,function(e){return!!(e instanceof RegExp&&e.test(s))||e===s})))}var B={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:[]},P={collect:null,initCollect:function(){this.collect={whiteList:{},filterProtocol:[]}},removeCollect:function(){var e=S(this.collect),t=e.count,i=e.ret;return this.collect=null,{collectKey:0===t?null:JSON.stringify(i),collectMode:"white"}},onIgnoreTagAttr:function(e,t,n){return e&&_.indexOf(["href","src"],t)>-1?P.domainWhiteList&&Array.isArray(P.domainWhiteList)&&P.domainWhiteList.length>0&&!O(n,i([],P.domainWhiteList,!0))?"":"".concat(t,'="').concat(w(n,function(e){var t;null===(t=P.collect)||void 0===t||t.filterProtocol.push(e)}),'"'):e&&(_.indexOf(["style","class","id"],t)>-1||t.indexOf("data-")>-1)?"".concat(t,'="').concat(n,'"'):(P.collect.whiteList[e]=P.collect.whiteList[e]||[],void P.collect.whiteList[e].push(t))},onIgnoreTag:function(e,t){if("style"===e)return t;T(t,function(e,t,i,n){b(I(n).html.replace("/",""),function(e){P.collect.whiteList[i]=P.collect.whiteList[i]||[],P.collect.whiteList[i].push(e)})},v)},whiteList:B,mergeWhiteList:function(e){for(var t,i={},n=0,r=_.keys(B);n<r.length;n++)i[t=r[n]]=_.from(B[t]);for(var a=0,o=_.keys(e);a<o.length;a++)i[t=o[a]]=t in B?B[t].concat(e[t]):_.from(e[t]);return i},setWhiteList:function(e){for(var t=0,i=_.keys(e);t<i.length;t++){var n=i[t];this.whiteList[n]=n in B?B[n].concat(e[n]):_.from(e[n])}}};try{var M={},N="merge";_.includes(N,"override")&&(P.whiteList=M.whiteList),_.includes(N,"merge")&&P.setWhiteList(M.whiteList)}catch(e){}var U=function(e,t){for(var i={},n=0,r=_.keys(e);n<r.length;n++){var a=r[n];Array.isArray(e[a])?i[a]=_.from(e[a]):i[a]=U({},e[a])}for(var o=0,s=_.keys(t);o<s.length;o++)(a=s[o])in e?Array.isArray(e[a])?i[a]=e[a].concat(t[a]):i[a]=U(e[a],t[a]):Array.isArray(t[a])?i[a]=_.from(t[a]):i[a]=U({},t[a]);return i},F={blackList:{a:["folder"],meta:["content"],iframe:["srcdoc"],input:["pattern"],vmlframe:["xmlns"]},blackTags:["script","xml","embed","isindex","object","base","set","handler","animate","payload","import"],blackAttrs:["charset","ns","namespace","formaction","xlink:href","xmlns:xlink","handler","repeat","repeat-start","repeat-end"],blackAttrRegExps:[/^on/],filterList:{param:["value"],video:["poster"],form:["action"]},filterAttrs:["href","src","background","style","dynsrc","lowsrc","content"]};try{var j={};j.blackAttrRegExps&&(j.blackAttrRegExps=j.blackAttrRegExps.map(function(e){return new RegExp(e.toString().slice(1,e.toString().length-1))}));var K="merge";_.includes(K,"override")&&(F=j),_.includes(K,"merge")&&(F=U(F,j))}catch(e){}var H={mode:"black",whiteList:{},blackConfig:F,collect:null,initCollect:function(){H.collect={blackList:{},blackTags:[],blackAttrs:[],blackAttrRegExps:[],filterAttrs:[],filterList:{},filterProtocol:[]}},removeCollect:function(){var e=S(H.collect),t=e.count,i=e.ret;return H.collect=null,{collectKey:0===t?null:JSON.stringify(i),collectMode:"black"}},onIgnoreTag:function(e,t){var i;if(!_.includes(F.blackTags,e))return T(t,function(e,t,i,n,r){if(-1!==i.indexOf("/"))return v(n);if(r)return"</".concat(i,">");var a=I(n),o=b(a.html,function(e,t){var n,r=0;if(F.blackList[i]&&_.includes(F.blackList[i],e)&&(H.collect.blackList[i]=H.collect.blackList[i]||[],H.collect.blackList[i].push(e),r++),F.blackAttrRegExps.length&&F.blackAttrRegExps.some(function(t){return t.test(e)})&&_.forEach(F.blackAttrRegExps,function(t){t.test(e)&&(H.collect.blackAttrRegExps.push("".concat(t.toString(),"->").concat(e)),r++)}),F.blackAttrs.length&&_.includes(F.blackAttrs,e)&&(F.blackAttrs.push(e),r++),!r){if(F.filterList&&F.filterList[i]&&_.includes(F.filterList[i],e)){var a=w(t,function(e){var t;null===(t=H.collect)||void 0===t||t.filterProtocol.push(e)});return a!==t&&(H.collect.filterList[i]=H.collect.filterList[i]||[],H.collect.filterList[i].push(e)),t?"".concat(e,"='").concat(a,"'"):e}return F.filterAttrs&&_.includes(F.filterAttrs,e)?((a=w(t,function(e){var t;null===(t=H.collect)||void 0===t||t.filterProtocol.push(e)}))!==t&&(null===(n=H.collect)||void 0===n||n.filterAttrs.push(e)),t?"".concat(e,"='").concat(a,"'"):e):t?"".concat(e,"='").concat(t,"'"):e}});return n="<".concat(i),o&&(n+=" ".concat(o)),a.closing&&(n+=" /"),n+=">"},v);null===(i=H.collect)||void 0===i||i.blackTags.push(e)}},V=function(e){var t=e.reportOnly,i=void 0===t||t,n=e.block;return i&&"all"===i?"report":("string"==typeof i&&("true"===i&&(i=!0),"false"===i&&(i=!1)),n?"enforce":i?"report":"enforce")},W=function(e){return function(i,n,r){if(!i||"string"!=typeof i)return i;var a=n;e===C&&(a=P).initCollect();var o=e(i,a);if(x(o)===x(i))return i;if(!r)return o;var s=r.logType,u=V(r),c=a.removeCollect();return k.report(t(t({type:s,disposition:u},c),{sourceText:m(i),filterText:m(o)})),"enforce"===u?o:i}},Z=W(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 R(t).process(e)}),Y=W(C),G=function(e,t,i){var n=[],r=w(e,function(e){n.push(e)});if(r===e)return e;n=_.from(_.uniq(n));var a=t||i||{};if(!a)return r;var o=a.logType,s=V(i);return k.report({type:o,disposition:s,collectKey:n.join("___"),collectData:JSON.stringify(n),collectMode:"black",sourceText:m(e),filterText:m(r)}),"enforce"===s?r:e},q=A._xssProject||{},z=A.xssNamespace||{},X="3.0.26",J={FilterXSS:R,version:X,webpackPluginVersion:"<%= webpackPluginVersion =>",reportOnly:"<%= reportOnly =>",filterXSS:Z,_filterXSS:Y,filterUrl:G,Config:P,BlackConfig:H,project:q,setProjectName:function(e){q[e]=this,A._xssProjectName=e}};z.douyin_web=J,A.xssNamespace=z,A.Math&&!A.Math.xssNamespace&&(A.Math.xssNamespace=z),q[X]=J,A.globalThis=A,A.getFilterXss=function(){return void 0!==this._xssProjectName?this._xssProject[this._xssProjectName]:J},A.xss=J,A.isSafeUrl=O,A.isSafeDomain=O,A.isSafeProtocol=D,A._xssProject=q,A._xssProjectName&&(q[A._xssProjectName]=J);var Q=J.setProjectName.bind(J);e.BlackConfig=H,e.Config=P,e.FilterXSS=R,e._filterXSS=Y,e.filterUrl=G,e.filterXSS=Z,e.isSafeDomain=O,e.isSafeProtocol=D,e.isSafeUrl=O,e.project=q,e.setProjectName=Q,e.setXssNamespace=function(e){var t=e.appId,i=e.bid,n=e.region;z[t]=J;P.bid=i,P.region=n,P.enabled=!0},e.xssNamespace=z,Object.defineProperty(e,"__esModule",{value:!0})}),(self.webpackChunkdouyin_web=self.webpackChunkdouyin_web||[]).push([["75431"],{144144:function(e,t,i){i.d(t,{i:function(){return n}});let n="3.0.42"},418804:function(e,t,i){i.d(t,{Z:function(){return s}});var n=i(648955);i(173757),i(2885),i(248385),i(679308);var r=i(635957),a=i(358506),o=i.n(a);let s=(0,n.qH)(function e(){(0,n.PA)(this,e),o()(this),this.bodyId=0,this.isSwitchHeader=!1,this.workers={audio:null,video:null},this.init(),this.headerId=0,this.crypto=window.crypto||window.msCrypto},[{key:"init",value:function(){for(var e=this,t=Object.keys(this.workers),i=0;i<t.length;i++){var n=t[i],a=new r.Z;a.onmessage=function(t){e.emit(t.data.method,t.data)},this.workers[n]=a}}},{key:"updateHeaderId",value:function(){var e=this.bodyId+1;this.headerId=e,this.bodyId=e}},{key:"destroy",value:function(){for(var e=Object.keys(this.workers),t=0;t<e.length;t++){var i=e[t];this.workers[i].postMessage({method:"destroy"}),this.workers[i].terminate()}this.workers={}}},{key:"getWorker",value:function(e){return this.workers[e?"video":"audio"]}},{key:"decryptHeader",value:function(e,t){var i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=this;return this.updateHeaderId(),new Promise(function(r){var a=Math.floor(1e3*Math.random()),o=n.getWorker(t);o&&o.postMessage({method:"decryptHeader",id:a,buf:e,isVideo:t,needRemux:i});var s=function(e){e.id===a&&(n.off("decryptHeader",s),r({data:e.args.data,vid:e.args.vid}))};n.on("decryptHeader",s)})}},{key:"updateValue",value:function(e){for(var t=Object.keys(this.workers),i=0;i<t.length;i++){var n=t[i];this.workers[n].postMessage({method:"updateValue",value:e})}}},{key:"decryptBody",value:function(e,t){var i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=e instanceof ArrayBuffer?e:e.buffer,r=this,a=r.bodyId+1;return r.bodyId=a,new Promise(function(e){var o=function(t){t.id===a&&(r.off("decryptBody",o),e({data:t.args.data,id:a,headerId:r.headerId}))};r.on("decryptBody",o);var s=r.getWorker(t);s&&s.postMessage({method:"decryptBody",id:a,args:{isVideo:t,id:r.workerIndex,aeskey:r.aeskey,buf:n,needRemux:i}},[n])})}}])},874768:function(e,t,i){i.d(t,{Z:function(){return o}});var n=i(648955),r=i(525231),a=(0,n.qH)(function e(t,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,n.PA)(this,e);a.playerVersion="3.5.41-rc.1",this.errorType=t,this.errorCode=("number"==typeof i?i:void 0)||r.WE[t][i]||r.WE[t],this.ext=a});a.DUR_PARSE_ERROR=9201,a.SEG_PARSE_ERROR=9202,a.INIT_SEGMENT_ERROR=9203,a.MPD_INIT_ERROR=9204,a.SEGMENT_CONTENT_ERROR=9205,a.BACK_URL_FAIL=9206,a.MSE_OPEN_TIMEOUT=9207;let o=a},737178:function(e,t,i){i.d(t,{Z:function(){return b},d:function(){return m}});var n=i(648955);i(346984),i(124300),i(162093),i(503e3),i(173757),i(932651),i(2885),i(248385),i(679308),i(591111),i(832674),i(905442),i(446336),i(808483),i(840938),i(118438),i(325598),i(92999),i(611067),i(273723),i(724016),i(803903),i(214604),i(901250),i(755006),i(437048),i(488336),i(825666),i(177162),i(286633),i(943281),i(810658),i(82726),i(224727),i(490629);var r=i(265614),a=i(338726),o=i(516968),s=i(982143),u=i(521323),c=i(298757),l=i(731751),d=i(358506),h=i.n(d),f=i(373974),v=i(405762),_=i(97447),p=["dynamicTimeoutAudioIns"];function g(e){if(window.Headers&&e instanceof Headers){var t,i={},r=(0,n.sf)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;i[a[0]]=a[1]}}catch(e){r.e(e)}finally{r.f()}return i}return e}var m={loaderCount:1,loaderType:r.t.FETCH,onProcessMinLen:5120,enableDynamicMinLen:!0};function y(e,t){if(e.length>0){for(var i=0,n=!0,r=0;r<e.length;r++){var a=e[r];if(a>t){n=!1;break}if((i+=a)/e.length>t&&(n=!1),!n)return!1}}return!0}var T=0,b=function(){var e,t,i,d,b,E;function x(e,t){var i=this,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",c=!(arguments.length>3)||void 0===arguments[3]||arguments[3];(0,n.PA)(this,x),h()(this),this._config=Object.assign({},m,(0,n.Zj)({responseType:"arraybuffer"},e)),this._needPreloadCache=c,this._loaderCount=1,this._config.loaderCount>1,this._loaderType=this._config.loaderType||r.t.FETCH,this._enableDynamicMinLen=this._config.enableDynamicMinLen,this._preloadManager=t,e.openLog&&a.Y.enable(),this._videoLoaders=[],this._audioLoaders=[],this._videoIdx=0,this._audioIdx=0;for(var l=this._config,d=l.dynamicTimeoutAudioIns,f=(0,n.Kd)(l,p),v=0;v<this._loaderCount;v++){var _=new a.Y("".concat(u,"VideoLoader_").concat(v,"_").concat(this._config.vid),this._config.vid),g=new a.Y("".concat(u,"AudioLoader_").concat(v,"_").concat(this._config.vid),this._config.vid),y=new o.mf((0,n.Zj)((0,n.Zj)({},f),{},{logger:_,loaderType:this._loaderType})),b=new o.mf((0,n.Zj)((0,n.Zj)({},f),{},{dynamicTimeoutIns:d||f.dynamicTimeoutIns,logger:g,loaderType:this._loaderType}));this._videoLoaders.push(y),this._audioLoaders.push(b),this._videoSpeeds=[],y.on(s.K.REAL_TIME_SPEED,function(e){T=e.speed,i._cacheSpeed(e)}),b.on(s.K.REAL_TIME_SPEED,function(e){T=e.speed,i._cacheSpeed(e)}),y.on("networkError",function(e){i.emit("networkError",e)}),b.on("networkError",function(e){i.emit("networkError",e)}),this._videoReqCosts=[]}this._moofVideoLoader=new o.mf((0,n.Zj)((0,n.Zj)({},this._config),{},{loaderType:this._loaderType})),this._moofAudioLoader=new o.mf((0,n.Zj)((0,n.Zj)({},this._config),{},{loaderType:this._loaderType})),this._isSupportUrlRange="fetch"===this._loaderType,this._preloadCacheDatas={},this._reqCost={cdn:{count:0,avg:0},pcdn:{count:0,avg:0}}}return(0,n.qH)(x,[{key:"_cacheProgress",value:function(e,t){var i=t[e];if(i&&i.range&&i.done){var r=v.Z.generateRequestUniqueKey((0,n.Zj)((0,n.Zj)({},i.extData),{},{range:i.range}));if(!r)return;this._preloadCacheDatas[r]={duration:i.extData.segmentDuration,vtype:f.l0.DASH,res:i.data.buffer,mediaType:e,memory:i.data.byteLength,range:i.range,fileId:i.extData.fileId,rangeEnd:i.extData.rangeEnd,rangeStart:i.extData.rangeStart},u.ZP.log("cacheProgress",r,JSON.stringify(this._preloadCacheDatas[r]))}}},{key:"cachePreloadData",value:(e=(0,n.x)((0,n.l5)().mark(function e(t,i){var r,a,o;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.vid){e.next=2;break}return e.abrupt("return");case 2:if(this._cacheProgress("video",i),this._cacheProgress("audio",i),t.vtype=_.Z.vtype,r=Object.keys(this._preloadCacheDatas).length,!(this._preloadManager&&r>0)){e.next=11;break}return e.next=9,this._preloadManager.getItem(t,!0);case 9:(a=e.sent)?(o=Object.assign({},a,this._preloadCacheDatas),o=v.Z.combinePreloadData(o),this._preloadManager.setItem(t,o,!0)):this._preloadManager.setItem(t,this._preloadCacheDatas,!0);case 11:this._preloadCacheDatas={};case 12:case"end":return e.stop()}},e,this)})),function(t,i){return e.apply(this,arguments)})},{key:"isSupportedProgress",value:function(){return 1===this._loaderCount&&"fetch"===this._loaderType}},{key:"_addCost",value:function(e){this._videoReqCosts.push(e),this._videoReqCosts.length>3&&this._videoReqCosts.shift()}},{key:"_addVideoSpeed",value:function(e){this._videoSpeeds.push(e),this._videoSpeeds.length>3&&this._videoSpeeds.shift()}},{key:"checkProgressSatisfied",value:function(e){var t=!1;if(navigator.connection&&navigator.connection.downlink)return t=!0,!(5*e/(1e6*navigator.connection.downlink)>4)&&!0;if(!y(this._videoReqCosts,4))return!1;var i=this._videoSpeeds.map(function(t){return 5e3*t/e});if(!y(i,4))return!1;if(!t&&0===i.length)try{try{var n=parseFloat(c.Xb.getItem(l.OU))||0;if(0===n||5e3*n/e>4)return!1}catch(e){}}catch(e){}return!0}},{key:"_cacheSpeed",value:function(e){var t,i=e.speed;x.historySpeed.length>=20&&x.historySpeed.shift(),x.historySpeed.push(i),this.emit(s.K.REAL_TIME_SPEED,(0,n.Zj)({speed:i,type:(null==e||null===(t=e.priOptions)||void 0===t?void 0:t.type)||l._R.CDN},e))}},{key:"_calCostTime",value:function(e,t){var i=this._reqCost[e?"pcdn":"cdn"];t<3*i.avg&&(i.count++,i.avg=(i.avg*(i.count-1)+t)/i.count)}},{key:"getReqCost",value:function(e){var t=this._reqCost[e];return(null==t?void 0:t.avg)||0}},{key:"load",value:(t=(0,n.x)((0,n.l5)().mark(function e(t,i,r,a){var o,s,c,d,h,p,m,y,T,b,E,x,R,A,k,S,C,I,L,D,w,O,B,P,M,N,U,F,j=arguments;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=j.length>4&&void 0!==j[4]&&j[4],s=j.length>5&&void 0!==j[5]?j[5]:null,c=j.length>6&&void 0!==j[6]?j[6]:null,d=j.length>7&&void 0!==j[7]?j[7]:null,h=j.length>8&&void 0!==j[8]?j[8]:null,a.vtype=f.l0.DASH,a.isPreload=o,a.range=r,p={start:a.start,end:a.end,bandwidth:a.bandwidth||a.bitrate,sequence:a.idx,fps:a.fps,mediaType:t,selectedIdx:a.selectedIdx,definition:a.definition,range:r.concat(),startRaw:a.startRaw,endRaw:a.endRaw},m=this._config.onProcessMinLen,this._enableDynamicMinLen&&p.bandwidth&&s&&(y=0===a.start?.5:1,m=Math.floor(p.bandwidth*y/8)),!(this._preloadManager&&a.checkPreload)){e.next=25;break}if(T=v.Z.nowTime(),b=null,!this._preloadManager.supportSync()){e.next=18;break}b=this._preloadManager.getPreLoadDataSync(a),e.next=21;break;case 18:return e.next=20,this._preloadManager.getPreLoadData(a);case 20:b=e.sent;case 21:if(!(b&&b.res instanceof ArrayBuffer)){e.next=25;break}return u.ZP.log("changeState preload hit cache",b.cacheKey,"cost",v.Z.nowTime()-T,"ms","isPreload",o),s&&s(b.res,!0,{range:r,fromCache:!0},null,a),e.abrupt("return",{res:b.res,headers:b.headers,status:b.status,fromCache:!0,selectedIdx:a.selectedIdx,extData:p,orgDefinition:b.orgDefinition,cacheKey:b.cacheKey,duration:b.duration});case 25:if(E=a.isPCDN,x=a.urlList,R=a.outChangeUrlRetry,A=(!s||this._isSupportUrlRange)&&(this._config.useUrlRange||a.useUrlRange||!1)&&!E,k=i,A&&r&&r.length>1&&(k="".concat(i+(i.split("?")[1]?"&":"?"),"range=").concat(r[0],"-").concat(r[1])),(!r||0===r.length||A)&&(r=void 0),S=performance.now(),u.ZP.log(this._config.vid,"load res start:",JSON.stringify(a),"startTime",S,"userUrlRange",A,"onProgress",!!s,"onProcessMinLen",m),e.prev=33,I=this._getLoader(t,a)){e.next=37;break}return e.abrupt("return");case 37:return L=this._config.headers||{},D=a.reqOptions||{},e.next=41,I.load(k,(0,n.Zj)({urlList:x,outChangeUrlRetry:R,range:r,onProgress:s,selectedIdx:a.selectedIdx,sequence:a.idx,initSegment:a.initSegment,onProcessMinLen:m,onCancel:c,timeout:d,onTimeout:h,headers:E?Object.assign({},L,{"X-Origin-Server-Host":a.cdnHost}):L,priOptions:{type:E?l._R.PCDN:l._R.CDN,extData:a}},D));case 41:if(w=e.sent){e.next=44;break}return e.abrupt("return",null);case 44:return"video"===t&&this._addCost((performance.now()-S)/1e3),O=w.data,B=w.response,P={res:O instanceof Uint8Array?O.buffer:O,headers:g(B.headers),status:B.status,duration:a.end-a.start||0,memory:O.byteLength,vtype:_.Z.vtype,mediaType:t,costTime:0,range:r,isInitSegment:a.initSegment,fileId:a.fileId},M=performance.now()-S,u.ZP.log("load res finish: ",JSON.stringify(a),"cost time",M,"ms","range",null===(C=P.headers)||void 0===C?void 0:C["content-range"]),this._calCostTime(E,M),a.checkPreload&&!O.done&&this._needPreloadCache&&(N=v.Z.generateRequestUniqueKey(a),this._preloadCacheDatas[N]=P),e.abrupt("return",(0,n.Zj)((0,n.Zj)({},P),{},{extData:p,selectedIdx:a.selectedIdx,isPCDN:E,costTime:M,url:i}));case 54:return e.prev=54,e.t0=e.catch(33),u.ZP.log("loader error",{msg:e.t0.message}),e.abrupt("return",{res:"error",status:null===(U=e.t0.response)||void 0===U?void 0:U.status,header:g(null===(F=e.t0.response)||void 0===F?void 0:F.headers),error:e.t0,isPCDN:E,url:k,bitrate:a.bandwidth||p.bandwidth,costTime:-1});case 58:case"end":return e.stop()}},e,this,[[33,54]])})),function(e,i,n,r){return t.apply(this,arguments)})},{key:"_getLoader",value:function(e,t){var i="video"===e;if(t.moof)return i?this._moofVideoLoader:this._moofAudioLoader;if(t.initSegment){var n=i?this._moofVideoLoader:this._moofAudioLoader;if(n&&null!==n._currentTask)return n}if(i){var r=this._videoLoaders[this._videoIdx];return this._videoIdx++,this._videoIdx>=this._videoLoaders.length&&(this._videoIdx=0),r}var a=this._audioLoaders[this._audioIdx];return this._audioIdx++,this._audioIdx>=this._audioLoaders.length&&(this._audioIdx=0),a}},{key:"cancel",value:(i=(0,n.x)((0,n.l5)().mark(function e(t){var i;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=6;break}return i="video"===t?this._videoLoaders:this._audioLoaders,e.next=4,this.cancelLoaders(i);case 4:e.next=10;break;case 6:return e.next=8,this.cancelLoaders(this._audioLoaders);case 8:return e.next=10,this.cancelLoaders(this._videoLoaders);case 10:if(!this._moofVideoLoader){e.next=13;break}return e.next=13,this._moofVideoLoader.cancel();case 13:if(!this._moofAudioLoader){e.next=16;break}return e.next=16,this._moofAudioLoader.cancel();case 16:case"end":return e.stop()}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"cancelLoaders",value:(d=(0,n.x)((0,n.l5)().mark(function e(t){var i,r,a;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=(0,n.sf)(t),e.prev=1,i.s();case 3:if((r=i.n()).done){e.next=9;break}return a=r.value,e.next=7,a.cancel();case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),i.e(e.t0);case 14:return e.prev=14,i.f(),e.finish(14);case 17:case"end":return e.stop()}},e,null,[[1,11,14,17]])})),function(e){return d.apply(this,arguments)})},{key:"getCurrentTask",value:function(e){var t="video"===e,i=t?this._moofVideoLoader:this._moofAudioLoader,n=t?this._videoLoaders[0]:this._audioLoaders[0];return(null==i?void 0:i._currentTask)||(null==n?void 0:n._currentTask)}},{key:"cancelTasks",value:(b=(0,n.x)((0,n.l5)().mark(function e(t){var i,r,a,o,s=arguments;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=s.length>1&&void 0!==s[1]&&s[1],a=(r="video"===t)?this._moofVideoLoader:this._moofAudioLoader,o=r?this._videoLoaders[0]:this._audioLoaders[0],!a){e.next=7;break}return e.next=7,this._filterTask(a,i);case 7:if(!o){e.next=10;break}return e.next=10,this._filterTask(o,i);case 10:case"end":return e.stop()}},e,this)})),function(e){return b.apply(this,arguments)})},{key:"_filterTask",value:(E=(0,n.x)((0,n.l5)().mark(function e(t,i){var r,a,o,s,u,c,l,d;return(0,n.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(r=[],a=t._queue,i&&t._currentTask&&r.push(t._currentTask.cancel()),o=a.length-1;o>-1;o--)l=null===(s=(c=a[o]).priOptions)||void 0===s||null===(s=s.extData)||void 0===s?void 0:s.isInitSegment,d=null===(u=c.priOptions)||void 0===u||null===(u=u.extData)||void 0===u?void 0:u.isSlice,!(l||d)&&(r.push(c.cancel()),a.splice(o,1));return e.next=6,Promise.all(r);case 6:case"end":return e.stop()}},e)})),function(e,t){return E.apply(this,arguments)})},{key:"destroy",value:function(){this.cancel();for(var e=0;e<this._videoLoaders.length;e++){var t=this._videoLoaders[e];t&&t.removeAllListeners();var i=this._audioLoaders[e];i&&i.removeAllListeners()}this._moofAudioLoader&&this._moofAudioLoader.removeAllListeners(),this._moofVideoLoader&&this._moofVideoLoader.removeAllListeners(),this._audioLoaders=[],this._videoLoaders=[]}}],[{key:"currentSpeed",get:function(){return T}},{key:"historyAvspeed",get:function(){var e=x.historySpeed.reduce(function(e,t){return e+t},0);return 0===x.historySpeed.length?0:e/x.historySpeed.length}}])}();b.historySpeed=[]},643752:function(e,t,i){i.d(t,{Z:function(){return g}});var n=i(261825);i(162093),i(117232),i(232070),i(932651),i(2885),i(248385),i(663030);var r=i(423013),a=i(734123),o=i(96703),s=i(773225),u=i(679145),c=i(538165),l=i(78346),d=i(109436),h=new u.Z({}),f=null,v=null,_={needCheckDuration:!0},p=function(e){function t(e){var i;return(0,n.PA)(this,t),i=(0,n.$w)(this,t,[e]),(0,n._x)(i,"_onXLog",function(e){"waitingEnd"===e.eventType&&0===e.type&&(h.blockDuration=e.costTime,i.player.isUserActive&&(h.currentBlockDur=e.costTime))}),t.defaultConfig=e.config,i}return(0,n.XW)(t,e),(0,n.qH)(t,[{key:"setConfig",value:function(e){this.config=Object.assign({},e),this.bitRateAdapter&&this.bitRateAdapter.updateConfig(this.config)}},{key:"updateSelectInfo",value:function(e,t){this.selectInfo[e]=t}},{key:"matchFactor",value:function(e,t,i){var n,r,a="Array"===(0,l.kM)(t)?t:[],o=!1;switch(e){case"core_cnt":i.core&&a.length>1&&i.core>=Number(a[0])&&i.core<=Number(a[1])&&(o=!0);break;case"memory":i.memory&&a.length>1&&i.memory>=Number(a[0])&&i.memory<=Number(a[1])&&(o=!0);break;case"video_screen_mode":;if(a.length>0&&"landscape"===a[0]&&(n=i.videoHeight,r=i.videoWidth,n&&r&&r>n))o=!0;break;case"encoder":a.length>0&&a[0]&&i.codecType&&a[0]===i.codecType&&(o=!0)}return o}},{key:"updateParamsByFactor",value:function(e){for(var t=this,i=this.playerConfig,n=i.codecType,r=i.videoHeight,a=i.videoWidth,o=0|window.navigator.deviceMemory,s=0|window.navigator.hardwareConcurrency,u=null,c={codecType:n,videoHeight:r,videoWidth:a,memory:o,core:s},l=0;l<e.length;l++){for(var d=e[l].factor||{},h=Object.keys(d),f=!0,v=0;v<h.length;v++)if(!this.matchFactor(h[v],d[h[v]],c)){f=!1;break}if(f){e[l].factor,u=e[l].config;break}}u&&Object.keys(u).forEach(function(e){t.config[e]=u[e]})}},{key:"afterCreate",value:function(){var e=this.config,t=e.factors;e.speedAlgoType,t&&t.length>0&&this.updateParamsByFactor(t),this._bindEvent(),this.bitRateAdapter=new s.ZP({config:this.config},this.player),!f&&(f=new s.ZP({config:this.config})),h.setConfig(this.config.detectConfig||{}),h.resetCurrent()}},{key:"beforePlayerInit",value:function(){this.curBitRate=this.getInitBitrate(),this.player.curDefinition=this.curBitRate}},{key:"_bindEvent",value:function(){this.on("xglog",this._onXLog)}},{key:"getInitBitrate",value:function(){if(!this.config.disabled){var e=this.player,t=this.config,i=this.playerConfig;v=i.userSelectDefinition;var n=this.getSuitableBitrate(e.definitionList,i.userSelectDefinition);return n?i.url=n.url:n={url:i.url,definition:i.defaultDefinition||t.definition,bitrate:i.defaultBitrate||i.bitrate,type:s.vK.DEFAULT},n.networkSpeed=n.speed||(0,s.zP)(this.config.speedAlgoType),n}}},{key:"getSuitableBitrate",value:function(e,i){var n=new o.Z;if(this.selectInfo={},e=(0,l.VX)(e,"video"),e=t._applySelectBitrateFactor(e),!!this.bitRateAdapter&&!!e&&!(e.length<1)){var r=this.config,a=this.config.bitrateKey;(0,l.QS)(e,a),this.bitRateAdapter.analysis=n;var u=(0,s.zP)(this.config.speedAlgoType);if(this.bitRateAdapter.speed=u,null!==(y=r.playlist_select_bitrate)&&void 0!==y&&y.enable_playlist_factor){var f=(0,d.B)(u,r,this.selectInfo).factor;this.bitRateAdapter.speed=u*f}this.updateSelectInfo("oriRateCnt",(null===(T=e)||void 0===T?void 0:T.length)||0),this.updateSelectInfo("vid",(null===(b=e[0])||void 0===b?void 0:b.vid)||""),this.updateSelectInfo("type","member"),this.updateSelectInfo("speed",this.bitRateAdapter.speed);var v=e.sort(function(e,t){return t._xgOrgBitrate-e._xgOrgBitrate}),_=this.getAdaptBitrate(v);this.updateSelectInfo("filterRateCnt",(null===(E=_)||void 0===E?void 0:E.filterRateCnt)||0),this.updateSelectInfo("isFilterMaxRateAdapt",(null===(x=_)||void 0===x?void 0:x.isFilterMaxRate)||0),this.updateSelectInfo("bitrateSetSelector",(null===(R=_)||void 0===R?void 0:R.bitrateSetSelector)||[]),this.updateSelectInfo("qualityBitrateSelector",(null===(A=_)||void 0===A?void 0:A.qualityBitrateSelector)||[]);var p=_?_.duration:0,g=(null===(k=_)||void 0===k?void 0:k._targetBitrate)||(null===(S=_)||void 0===S?void 0:S._xgOrgBitrate);this.updateSelectInfo("adaptTarRate",g);var m=this.config.mode;if(this.updateSelectInfo("mode",m),m&&m===s.vP.BANDWIDTH){var y,T,b,E,x,R,A,k,S,C,I,L=0;if(!(null!==(C=this.bitRateAdapter)&&void 0!==C&&C.speed)||this.bitRateAdapter.speed<0||1!==r.mixFactor){var D=Object.assign({},this.config);D.mode=s.vP.BUFFER_INFO;var w=new s.ZP({_config:D},this.player);w.speed=this.bitRateAdapter.speed;var O=null==w?void 0:w.select(e,D.mode,this.bitRateAdapter.speed);this.updateSelectInfo("isFilterMaxRateBuf",O.isFilterMaxRate),L=(null==O?void 0:O._targetBitrate)||(null==O?void 0:O._xgOrgBitrate),this.updateSelectInfo("buffTarRate",L)}I=!this.bitRateAdapter.speed||this.bitRateAdapter.speed<0?L:(null==r?void 0:r.mixFactor)>=0&&r.mixFactor<=1?g*r.mixFactor+L*(1-r.mixFactor):(null==r?void 0:r.mixFactor)>1?Math.max(g,L):Math.min(g,L),this.updateSelectInfo("finalTarRate",I),!(_=(0,l.v2)(e,I,this.config.selectAlgType))&&(_=e[e.length-1]),_._targetBitrate=I}var B=this.bitRateAdapter.getTargetBitrate(p,e,this.bitRateAdapter.speed);if(B&&(h.targetBitRate=B),i){this.updateSelectInfo("mode","userSelect");var P=t.getUserSelectBitrate(v,i);P&&(h.selectBitRate=P._xgOrgBitrate,h.updateBitRateInfo(P._xgOrgBitrate,B),_=P,n.type=o.A.USER_SELECT)}if(!i&&this.config.overscore&&this.config.overscore.isOpen){var M=(0,c.P)(_,v,this.config.overscore);n.type=o.A.SR,_=M}return _&&(_.speed=this.bitRateAdapter.speed,this.updateSelectInfo("isOriMaxRate",(0,s.gH)(v,_)),this.updateSelectInfo("selectRate",_._xgOrgBitrate||-1)),"function"==typeof this.config.selectInfoBack&&this.config.selectInfoBack(this.selectInfo),_&&(_.chosenType=n.type,_.chosenReason=n.reason),_}}},{key:"getAdaptBitrate",value:function(e){if(!this.config.disabled){this.player;var t=null,i=this.config.bitrateKey;return(e=(0,l.QS)(e,i))&&e.length&&this.bitRateAdapter&&(t=this.bitRateAdapter.select(e,null,this.bitRateAdapter.speed)),t&&(t.type=s.vK.BITRATE_ADAPTER),t}}},{key:"getDefinition",value:function(e,t,i){for(var n=-1,r=0;r<e.length;r++)e[r]._xgOrgBitrate===t&&(n=r);return -1===n?null:i&&e.length>n+1?e[n+1]:!i&&n-1>=0?e[n-1]:null}},{key:"needChangeDefinition",value:function(){var e=this.player,i=e.curDefinition,n=e.definitionList,r=this.playerConfig,a=r.userSelectDefinition,o=r.extDefinition,s=o&&o.length>0?o:n,u={type:0,message:"DO_NOT_UPDATE",targetDefinition:null};if(!a||s.length<2)return u;var c=i;a&&(c=t.getUserSelectBitrate(s,a));var l=h.checkDefinition();u.type=l;var d=this.getAdaptBitrate(s);if(!d||0===l||!d||!d._xgOrgBitrate||!c||!c._xgOrgBitrate)return u.message="DO_NOT_UPDATE",u;var f=d._xgOrgBitrate>=c._xgOrgBitrate,v=d._xgOrgBitrate<c._xgOrgBitrate,_=null;switch(1===l?_=f?this.getDefinition(s,c._xgOrgBitrate,!0):d:2===l&&(_=v?this.getDefinition(s,c._xgOrgBitrate,!1):d),u.targetDefinition=_,(!u.targetDefinition||u.targetDefinition.definition===a)&&(u.type=0),u.type){case 1:u.message="NEED_TO_REDUCE_BITRATE";break;case 2:u.message="CAN_UPGRADE_BITRATE";break;default:u.message="DO_NOT_UPDATE"}return u}},{key:"detectDefInfo",get:function(){return h}},{key:"destroy",value:function(){this.bitRateAdapter&&this.bitRateAdapter.destroy(),this.bitRateAdapter=null,this.off("xglog",this._onXLog),h&&h.resetCurrent()}}],[{key:"pluginName",get:function(){return"BitrateSelector"}},{key:"defaultConfig",get:function(){return(0,n.Zj)({needCheckDuration:!0},_)},set:function(e){Object.keys(e).forEach(function(t){_[t]=e[t]})}},{key:"getSuitableBitrate",value:function(e,i,n,r){var a=new o.Z;if(t.staticSelectInfo={},e=(0,l.VX)(e,"video"),e=t._applySelectBitrateFactor(e),t.updateStaticSelectInfo("oriRateCnt",(null===(T=e)||void 0===T?void 0:T.length)||0),!!e&&!(e.length<1)){t.updateStaticSelectInfo("vid",(null===(b=e[0])||void 0===b?void 0:b.vid)||""),!n&&(n=t.defaultConfig);var u=(0,s.zP)(n.speedAlgoType);if(t.updateStaticSelectInfo("type","static"),t.updateStaticSelectInfo("speed",u),null!==(E=(n=Object.assign(n,_)).playlist_select_bitrate)&&void 0!==E&&E.enable_playlist_factor){n.playlist_info=r;var p=(0,d.B)(u,n,t.staticSelectInfo).factor;u*=p}i?t.updateStaticSelectInfo("mode","userSelect"):(i=v,t.updateStaticSelectInfo("mode",null===(R=n)||void 0===R?void 0:R.mode));var g=n.bitrateKey,m=(e=(0,l.QS)(e,g)).sort(function(e,t){return t._xgOrgBitrate-e._xgOrgBitrate}),y=null;if(f?f.updateConfig(n):f=new s.ZP({config:n},this.player),f.analysis=a,f.speed=u,m&&m.length&&f&&(y=f.select(m,null,u),t.updateStaticSelectInfo("filterRateCnt",(null===(A=y)||void 0===A?void 0:A.filterRateCnt)||0),t.updateStaticSelectInfo("isFilterMaxRateAdapt",(null===(k=y)||void 0===k?void 0:k.isFilterMaxRate)||0),t.updateStaticSelectInfo("bitrateSetSelector",(null===(S=y)||void 0===S?void 0:S.bitrateSetSelector)||[]),t.updateStaticSelectInfo("qualityBitrateSelector",(null===(C=y)||void 0===C?void 0:C.qualityBitrateSelector)||[]),y&&(null===(I=n)||void 0===I?void 0:I.mode)===s.vP.BANDWIDTH)){var T,b,E,x,R,A,k,S,C,I,L,D,w,O,B=y._targetBitrate||y._xgOrgBitrate;t.updateStaticSelectInfo("adaptTarRate",B);var P=0;if(!u||u<0||1!==n.mixFactor){var M=Object.assign({},n);M.mode=s.vP.BUFFER_INFO;var N=new s.ZP({config:M},this.player);N.speed=u;var U=null==N?void 0:N.select(e,M.mode,u);t.updateStaticSelectInfo("isFilterMaxRateBuf",null==U?void 0:U.isFilterMaxRate),P=(null==U?void 0:U._targetBitrate)||(null==U?void 0:U._xgOrgBitrate),t.updateStaticSelectInfo("buffTarRate",P)}O=!u||u<0?P:(null===(L=n)||void 0===L?void 0:L.mixFactor)>=0&&(null===(D=n)||void 0===D?void 0:D.mixFactor)<=1?B*n.mixFactor+P*(1-n.mixFactor):(null===(w=n)||void 0===w?void 0:w.mixFactor)>1?Math.max(B,P):Math.min(B,P),!(y=(0,l.v2)(e,O,n.selectAlgType))&&(y=e[e.length-1]),y._targetBitrate=O,t.updateStaticSelectInfo("finalTarRate",O)}y&&(y.type="bitRateAdapter");var F=y?y.duration:0,j=f?f.getTargetBitrate(F,e):null;if(j&&(h.targetBitRate=j),i){var K=t.getUserSelectBitrate(m,i);K&&(h.selectBitRate=K._xgOrgBitrate,h.updateBitRateInfo(K._xgOrgBitrate,j),y=K,a.type=o.A.USER_SELECT)}if(!i&&n.overscore&&n.overscore.isOpen){var H=(0,c.P)(y,m,n.overscore);a.type=o.A.SR,y=H}return t.updateStaticSelectInfo("isOriMaxRate",(0,s.gH)(m,y)),t.updateStaticSelectInfo("selectRate",(null===(x=y)||void 0===x?void 0:x._xgOrgBitrate)||-1),"function"==typeof n.selectInfoBack&&n.selectInfoBack(t.staticSelectInfo),y&&(y.chosenType=a.type,y.chosenReason=a.reason),y}}},{key:"updateStaticSelectInfo",value:function(e,i){t.staticSelectInfo[e]=i}},{key:"_applySelectBitrateFactor",value:function(e){var t,i=null===(t=e[0])||void 0===t?void 0:t.vid;if(i){var a=r.w.getInstance().findStrategy("vod-live-joint-optimize");if(a){var o=a.getSelectBitrateFactor(i);o.value>0&&(e=e.map(function(e){return(0,n.Zj)((0,n.Zj)({},e),{},{degFactor:o})}))}}return e}},{key:"getUserSelectBitrate",value:function(e,t){if(t&&e&&e.length>0){for(var i=null,n=null,r=0;r<e.length;r++){if(t===e[r].definition){i=e[r];break}!n&&t<e[r].definition&&(n=e[r])}return!i&&(i=n||e[e.length-1]),i.type=s.vK.USER_SELECT,i}return null}}])}(a.BasePlugin);(0,n._x)(p,"staticSelectInfo",{});let g=p},150630:function(e,t,i){i.d(t,{m:function(){return r}});var n=i(261825),r=(0,n.qH)(function e(t){var i=this;(0,n.PA)(this,e),(0,n._x)(this,"_onPlay",function(){i._calcPausedTime()}),(0,n._x)(this,"_onPause",function(){i._prevPauseTime=Date.now()}),(0,n._x)(this,"_onEnded",function(){!i._info.downloadDuration&&i._info.canPlayTime&&(i._info.downloadDuration=(Date.now()-i._info.canPlayTime)/1e3),i.disable()}),(0,n._x)(this,"_canPlay",function(){i._info.canPlayTime=Date.now();var e=i.video.buffered;e.length&&(i._info.startBufferTime=e.end(e.length-1))}),(0,n._x)(this,"_onProgress",function(){var e=i.video.buffered;i._info.canPlayTime&&e.length&&e.end(e.length-1)+.8>i.video.duration&&(i._info.downloadDuration=(Date.now()-i._info.canPlayTime)/1e3)}),(0,n._x)(this,"_onTick",function(){var e=i.video;if(!!e){i._timer=setTimeout(i._onTick,500);var t=e.currentTime;if(e.paused&&!e.ended&&0!==e.playbackRate&&0!==e.readyState){i._prevCurrentTime=t;return}i._prevCurrentTime===t?!i._prevStallTime&&(i._prevStallTime=Date.now()):i._calcStallTime(),i._prevCurrentTime=t}}),this.video=t,this._timer=null,this._prevPauseTime=0,this._prevStallTime=0,this._prevCurrentTime=0,this.resetInfo(),this.enable()},[{key:"isStalling",get:function(){return!!this._prevStallTime}},{key:"enable",value:function(){this.disable();var e=this.video;if(!!e)e.addEventListener("play",this._onPlay),e.addEventListener("pause",this._onPause),e.addEventListener("canplay",this._canPlay),e.addEventListener("progress",this._onProgress),e.addEventListener("ended",this._onEnded),this._timer=setTimeout(this._onTick,500)}},{key:"disable",value:function(){clearTimeout(this._timer),this.resetInfo();var e=this.video;if(!!e)e.removeEventListener("play",this._onPlay),e.removeEventListener("pause",this._onPause),e.removeEventListener("canplay",this._canPlay),e.removeEventListener("progress",this._onProgress),e.removeEventListener("ended",this._onEnded)}},{key:"endPlay",value:function(){if(!!this.video){var e=this.video.buffered;if(e.length)try{this._info.endBufferTime=e.end(e.length-1)}catch(e){}this._info.leaveWithBlock=this.isStalling,this._calcPausedTime(),this._calcStallTime(),!this._info.downloadDuration&&this._info.canPlayTime&&(this._info.downloadDuration=(Date.now()-this._info.canPlayTime)/1e3)}}},{key:"getInfo",value:function(){return this._info}},{key:"resetInfo",value:function(){this._prevPauseTime=0,this._prevStallTime=0,this._prevCurrentTime=0,this._info={pausedTime:0,stalledTime:0,downloadDuration:0,startBufferTime:0,endBufferTime:0,canPlayTime:0,leaveWithBlock:!1}}},{key:"destroy",value:function(){this.disable(),this.video=null}},{key:"_calcStallTime",value:function(){this._prevStallTime&&(this._info.stalledTime+=(Date.now()-this._prevStallTime)/1e3,this._prevStallTime=0)}},{key:"_calcPausedTime",value:function(){this._prevPauseTime&&(this._info.pausedTime+=(Date.now()-this._prevPauseTime)/1e3,this._prevPauseTime=0)}}])},78346:function(e,t,i){function n(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}function r(e,t){var i=[];return e.forEach(function(e){(!e.mediaType||e.mediaType===t)&&i.push(e)}),i}i.d(t,{QS:function(){return o},VX:function(){return r},kM:function(){return n},v2:function(){return a}}),i(346984),i(248385),i(759943),i(414931),i(240148),i(663030);function a(e,t,i){return i?1===i?function(e,t){if(!e)return null;for(var i=-1,n=0;n<e.length;n++)if(e[n]&&e[n]._xgOrgBitrate&&t>=e[n]._xgOrgBitrate){i=n;break}return i<0?null:e[i]}(e,t):void 0:function(e,t){if(!e)return null;var i,n=1/0;return(e.forEach(function(e){var r=Math.abs(e._xgOrgBitrate-t);n>r&&(i=e,n=r)}),i)?i:null}(e,t)}function o(e,t){return e.forEach(function(e){e[t]?e._xgOrgBitrate=e[t]:e.bitrate&&(e._xgOrgBitrate=e.bitrate)}),e}},943643:function(e,t,i){i.d(t,{Z:function(){return d}});var n,r=i(330124);i(346984),i(303846),i(802824),i(9498),i(2885),i(248385),i(496423),i(679308),i(88856),i(759943),i(706056),i(228983),i(663030);var a=i(298757),o=i(44589),s=i(611344),u=i(770932),c={description:"",name:"__PRE_CACHE__",storeName:"keyvaluepairs",version:1},l="__PRE_CACHE__KEYS";let d=(0,r.qH)(function e(t,i){(0,r.PA)(this,e),this._allCachedKeyMap={},this._memory=0,this._cnt=0;var n=i===o.Rr.MEMORY?u.Z:s.Z;this._cacheType=i,this._driver=new n,this._driver._initStorage(c).catch(function(){}),this._hasIdbForbidden=!1,this._maxCache=!t||t<=0?200:t,this.setMaxCache(this._maxCache),this._allCachedKeys={},this._allCachedTimeKeys={},this.getCachedKeysFromLocal(),this._readyPromise=new a.XK,this.init()},[{key:"supportSync",value:function(){return this._cacheType===o.Rr.MEMORY}},{key:"getCachedKeysFromLocal",value:function(){var e=a.Xb.getItem(l);if(e){for(var t=e.split("|"),i=0;i<t.length;i++){var n=t[i],r=this._getCacheKeyInfos(n),o=r.time,s=r.cachedKey;this._allCachedKeys[s]=1,this._allCachedTimeKeys[s]=o}}}},{key:"_getCacheKeyInfos",value:function(e){var t,i=e.split("$");return 2===i.length&&(t=i[0],e=i[1]),{time:t,cachedKey:e}}},{key:"writeCachedKeysToLocal",value:function(e){var t=[];this._allCachedKeys={},this._allCachedTimeKeys={};for(var i=0;i<e.length;i++){var n=e[i].key,r=this._getCacheKeyInfos(n),o=r.time,s=r.cachedKey;this._allCachedKeys[s]=1,this._allCachedTimeKeys[s]=o,t.push(n)}var u=t.join("|");a.Xb.setItem(l,u)}},{key:"init",value:function(){var e=this;this._driver.setItem("test","test").then(function(){}).catch(function(){e._hasIdbForbidden=!0}).finally(function(){e._driver.removeItem("test").catch(function(){}),e._hasIdbForbidden&&(e._driver=new u.Z,e._driver._initStorage(c)),e._getAll(),e._readyPromise.resolve()})}},{key:"_getAll",value:function(){var e=this;this._memory=0,this._cnt=0,this._driver.all().then(function(t){e._cachedLength=t.length;var i=t.length-e._maxCache,n=t;if(i>0){var a=t.slice(0,i);n=t.slice(i);for(var o=0;o<a.length;o++)e.removeItem(a[o].key).then(function(){})}e._cnt=n.length;for(var s=0;s<n.length;s++){var u=n[s];if("object"===(0,r.Ac)(u.value)){Object.values(u.value).forEach(function(t){e._memory+=(null==t?void 0:t.memory)||0});var c=e._getCacheKeyInfos(u.key).cachedKey;e._allCachedKeyMap[c]=Object.keys(u.value)}}e.writeCachedKeysToLocal(n)}).catch(function(){})}},{key:"getAllCachedDataKeys",value:function(){var e=[];return Object.values(this._allCachedKeyMap).forEach(function(t){e.push.apply(e,(0,r.u)(t))}),e}},{key:"getItem",value:(n=(0,r.x)((0,r.l5)().mark(function e(t,i,n){var a,o,s,u;return(0,r.l5)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((a=this.hasItem(t))&&n&&(a=(null==(o=this._allCachedKeyMap[t])?void 0:o.includes(n))||!1),a){e.next=4;break}return e.abrupt("return",Promise.resolve(!1));case 4:return s=this._getTimeKey(t).timeKey,e.next=7,this._driver.getItem(s,i);case 7:if(u=e.sent,!n){e.next=10;break}return e.abrupt("return",u[n]);case 10:return e.abrupt("return",u);case 11:case"end":return e.stop()}},e,this)})),function(e,t,i){return n.apply(this,arguments)})},{key:"getItemSync",value:function(e,t,i){var n=this.hasItem(e);if(n&&i){var r=this._allCachedKeyMap[e];n=(null==r?void 0:r.includes(i))||!1}if(!n)return!1;var a=this._getTimeKey(e).timeKey,o=this._driver.getItemSync(a,t);return o&&i?o[i]:o}},{key:"setItem",value:function(e,t,i){var n=this;this._getTimeKey(e).timeKey&&this.removeItem(e);var r=new Date().getTime();this._allCachedKeys[e]=1,this._allCachedTimeKeys[e]=r;var a=this._genTimeKey(e,r);return i=i?function(){n._getAll(),i()}:function(){n._getAll()},this._driver.setItem(a,t,i)}},{key:"_getTimeKey",value:function(e){var t=this._allCachedTimeKeys[e],i=e;return t&&(i=this._genTimeKey(e,t)),{timeKey:i,time:t}}},{key:"_genTimeKey",value:function(e,t){return"".concat(t).concat("$").concat(e)}},{key:"removeItem",value:function(e,t){var i=this._getTimeKey(e).timeKey,n=this._driver.removeItem(i,t);return delete this._allCachedKeys[e],delete this._allCachedTimeKeys[e],delete this._allCachedKeyMap[e],n}},{key:"hasItem",value:function(e){return!!this._allCachedKeys[e]}},{key:"clear",value:function(e){return this._driver.clear(e)}},{key:"length",value:function(e){return this._driver.length(e)}},{key:"setMaxCache",value:function(e){"number"==typeof e&&e>0&&(this._maxCache=e)}},{key:"getMemoryInfo",value:function(){return{memory:this._memory,cnt:this._cnt}}}])},4610:function(e,t,i){i.d(t,{XB:function(){return n},cF:function(){return r},eq:function(){return s},uZ:function(){return a}}),i(487689),i(2885);var n={beta:.49,eta:5200,gamma:1100};function r(e,t,i,n){for(var r=1-(1-a(t,0,1))*(1-o(n,e.beta,e.eta,e.gamma)),s=n,u=i;u-s>1;){var c=(s+u)/2;o(c,e.beta,e.eta,e.gamma)<r?s=c:u=c}return s}function a(e,t,i){return Math.min(Math.max(e,t),i)}function o(e,t,i,n){return e<=n?0:-Math.expm1(-Math.pow((e-n)/i,t))}function s(e,t){var i;try{var n=JSON.parse(e);!((i=Array.isArray(n)?{gamma:n[0],beta:n[1],eta:n[2]}:t).beta>0&&i.eta>0&&i.gamma>0)&&(i=t)}catch(e){i=t}return i}},405935:function(e,t,i){function n(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(n.key),n)}}function a(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}i.d(t,{PA:function(){return n},qH:function(){return a}})},737742:function(e,t,i){i.d(t,{Z:function(){return a}});var n=i(405935),r=i(92956),a=function(){function e(){(0,n.PA)(this,e),this.fps=0,this.isStoped=!0,this.ticks=[],this.isSupport=!0,this.maxFps=0,this.step=this._step.bind(this),this.rafId=null}return(0,n.qH)(e,[{key:"_step",value:function(e){var t=this.ticks;if(t.unshift(e),t.length>10){var i=t.pop();i&&(this.fps=Math.floor(1e4/(e-i)),this.updateFpsInfo())}!this.isStoped&&(this.rafId=window.requestAnimationFrame(this.step))}},{key:"updateFpsInfo",value:function(){this.fps>this.maxFps&&(this.maxFps=this.fps)}},{key:"start",value:function(){if(void 0!==window.requestAnimationFrame)this.isStoped=!1,this.rafId=window.requestAnimationFrame(this.step)}},{key:"stop",value:function(){window.cancelAnimationFrame(this.rafId),this.isStoped=!0}}],[{key:"install",value:function(){r.Z.install()}}]),e}()},786933:function(e,t,i){i.d(t,{Z:function(){return r}});var n=i(405935);let r=function(){function e(){(0,n.PA)(this,e),this.timeID=null,this.func=null}return(0,n.qH)(e,[{key:"repeat",value:function(e,t){this.timeID=1,this.repeatInterval(e,t)}},{key:"repeatInterval",value:function(e,t){var i=this;if(!this.timeID)return;if(null===this.func&&(this.func=e),this.func===e)this.timeID&&clearTimeout(this.timeID),this.timeID=null,this.timeID=setTimeout(function(){e(),i.repeatInterval(e,t)},t)}},{key:"clear",value:function(){clearTimeout(this.timeID),this.timeID=null}}]),e}()},856894:function(e,t,i){i.d(t,{Z:function(){return d}});var n=i(315355),r=i(919209),a=i(272787);i(248385),i(679308),i(705574),i(451236),i(503e3),i(346984);var o=i(126980),s=i(30222),u=i(548872),c=i(874668),l=i(597931),d=new(function(){function e(){(0,n.Z)(this,e),(0,a.Z)(this,"_queue",[]),(0,a.Z)(this,"_pendingDecoder",null),(0,a.Z)(this,"TAG","DecoderCache")}return(0,r.Z)(e,[{key:"genDecoder",value:function(e){return this._initDecoder(e)}},{key:"_initDecoder",value:function(e){var t,i,n=this,r=(0,c.tT)(),a=r.preloadDecoder,d=r.maxDecodeOnceWasm;e=e||a;var h=(0,c.P_)(),f=h.H264_DECODER_URL,v=h.H265_SIMD_DECODER_URL,_=h.H265_DECODER_URL,p=h.H265_THREAD_DECODER_URL,g=1;if("h265"===e&&((0,c.yJ)()?(t=new o.Z,i=v,g=2):(0,c.Bo)()&&(0,c.tT)().canUseThreadMode?(t=new s.Z,i=p,g=1):(t=new o.Z,i=_,g=3)),"h264"===e&&(t=new u.Z,i=f,g=3),!t)return Promise.resolve();var m=(0,l.Je)();t.postMessage({msg:"preload",batchDecodeCount:d,url:i}),this._pendingDecoder=t,t.id=Date.now()+parseInt(1e3*Math.random()),t.isHevc="h265"===e,t.using=!1,t.ready=!1,l.kg.log(this.TAG,"start init decoder worker, id=",t.id,"hevc=",t.isHevc,"mode=",g);var y=function e(i){n._pendingDecoder=null;var r=i.data.msg;switch(("DECODER_READY"===r||"INIT_FAILED"===r)&&(t.removeEventListener("message",e),t.removeEventListener("error",T)),r){case"DECODER_READY":l.kg.log(n.TAG,"decoder worker inited!, id=",t.id,"cost:",i.data.cost),t.ready=!0,!t.using&&n._queue.push(t),m.resolve();break;case"INIT_FAILED":l.kg.log(n.TAG,"decoder worker init failed!",i.data.log),m.reject(i.data.log)}},T=function e(i){t.removeEventListener("message",y),t.removeEventListener("error",e),m.reject(null==i?void 0:i.message)};return t.addEventListener("message",y),t.addEventListener("error",T),m}},{key:"cacheDecoder",value:function(e){e.using=!1,e.ready=!0,!e.id&&(e.id=Date.now()+parseInt(1e3*Math.random())),this._queue.push(e),l.kg.log(this.TAG,"cache decoder, id=",e.id),"h265"===(0,c.tT)().preloadDecoder&&1===this._queue.filter(function(e){return!e.using&&e.isHevc}).length&&this.genDecoder("h265")}},{key:"getCachedDecoder",value:function(e){var t,i=this._queue.findIndex(function(t){return!t.using&&t.isHevc===e});if(-1!==i&&(t=this._queue.splice(i,1)[0]),!t&&this._pendingDecoder&&(t=this._pendingDecoder,this._pendingDecoder=null),t)return t.using=!0,l.kg.warn(this.TAG,"get cached decoder, id=".concat(t.id,", ready=").concat(t.ready)),t}}]),e}())},534611:function(e,t,i){i.d(t,{NW:function(){return n},R_:function(){return r},ZP:function(){return a}});var n={WAITING:0,CANPLAY:1,PLAY:2,PLAYING:3,PAUSE:4,SEEKING:5,SEEKED:6,LOADEDDATA:7,LOADEDMETADATA:8,TIMEUPDATE:9,DURATION_CHANGE:10,VOLUME_CHANGE:11,PROGRESS:12,ERROR:13,ENDED:14,RESIZE:15,LOADSTART:16,DECODE_FPS:17,LOW_DECODE:18,LARGE_AV_GAP:19,FIRST_FRAME:20,CANVAS_LAYOUT:21},r=["waiting","canplay","play","playing","pause","seeking","seeked","loadeddata","loadedmetadata","timeupdate","durationchange","volumechange","progress","error","ended","resize","loadstart","decodefps","lowdecode","largeavgap","firstframe","canvaslayout"],a={AUDIO:{AUDIO_READY:"audio_ready",AUDIO_NOT_ALLOWED_AUTOPLAY:"audio_not_allowed_autoplay",AUDIO_WAITING:"audio_waiting",AUDIO_SYNC_DTS:"audio_sync_dts"},VIDEO:{VIDEO_DECODER_INIT:"video_decode_init",VIDEO_READY:"video_ready",VIDEO_WAITING:"video_waiting",AUTO_RUN:"auto_run",DECODE_LOW_FPS:"decode_low_fps",UPDATE_VIDEO_FILLTYPE:"update_video_filltype",UPDATE_VIDEO_COVER_POSITION:"update_video_cover_position"},TIMELINE:{PLAY_EVENT:"play_event",SET_METADATA:"set_metadata",APPEND_CHUNKS:"append_chunks",START_RENDER:"start_render",DO_PLAY:"do_play",DO_PAUSE:"do_pause",DO_SEEK:"do_seek",SET_PLAYBACKRATE:"set_playbackrate",SYNC_DTS:"sync_dts",RESET_BASE_DTS:"reset_base_dts",UPDATE_VOLUME:"update_volume",SINGLE_TRACK:"single_track",DESTROY:"destroy",READY:"ready",UPDATE_GL_OPTIONS:"update_gl_options",SET_VIDEO_DURATION:"set_video_duration",SET_PLAY_MODE:"set_play_mode",UPDATE_CAPABILITY_LEVEL:"update_capability_level",INNER_DEGRADE:"inner_degrade",ADJUST_SEEK_TIME:"adjust_seek_time",CHASE_FRAME:"chase_frame",END_OF_STREAM:"end_of_stream",UPDATE_SEGMENT_END:"update_segment_end"},VIDEO_EVENTS:n,DECODE_EVENTS:{INIT:"init",READY:"decoderready",REMUX:"remux",INIT_FAILED:"initfailed",DATAREADY:"dataReady",PLAY_FAILED:"playfailed",FRAGMENT_END:"fragmentEnd",APPEND_VIDEO:"appendVideo",FIRST_FRAME:"firstFrame",DECODED:"decoded",RENDE_END:"rendeEnd",CHASE_VIDEO_FRAME:"chaseVideoFrame",CHASE_VIDEO_FRAME_END:"chaseVideoFrameEnd",CHASE_AUDIO_FRAME:"chaseAudioFrame",INIT_SEGMENT:"initSegment",MEDIA_SEGMENT:"mediaSegment",FRAME_MAX_COUNY:"frameMaxCount",FRAME_MIN_COUNY:"frameMinCount"}}},395239:function(e,t,i){i.d(t,{S:function(){return o}});var n=i(315355),r=i(919209);i(932651),i(802824),i(124300),i(248385),i(911254),i(905442),i(446336),i(808483),i(840938),i(118438),i(325598),i(92999),i(611067),i(273723),i(724016),i(803903),i(214604),i(901250),i(755006),i(437048),i(488336),i(825666),i(177162),i(286633),i(943281),i(810658),i(82726),i(224727),i(832674);var a=i(597931),o=function(){function e(t,i){(0,n.Z)(this,e),this.TAG="FrameRender",this.configs=Object.assign({},t),this.parent=i,this.canvas=this.configs.canvas,this.meta=Object.assign({},this.configs.meta),this._initMeta(),this._initContextGL(),this.contextGL&&(this._initProgram(),this._initBuffers(),this._initTextures())}return(0,r.Z)(e,[{key:"_initMeta",value:function(){this.chroma=this.meta.chromaFormat,this.height=this.meta.height,this.width=this.meta.width,(this.canvas.width!==this.meta.width||this.canvas.height!==this.meta.height)&&(this.canvas.width=this.meta.width,this.canvas.height=this.meta.height,this.parent.emitResizeEvent())}},{key:"_initContextGL",value:function(){if("2d"===this.configs.type){this.ctx=this.canvas.getContext("2d");return}for(var e=this.canvas,t=null,i=["webgl","experimental-webgl","moz-webgl","webkit-3d"],n=0;!t&&n<i.length;){var r=i[n];try{t=e.getContext(r,this.configs.glCtxOptions),a.kg.log("FrameRender","use=",r,this.configs.glCtxOptions);break}catch(e){t=null}(!t||"function"!=typeof t.getParameter)&&(t=null),++n}this.contextGL=t}},{key:"_initProgram",value:function(){var e,t,i=this.contextGL;e="attribute vec4 vertexPos;\nattribute vec4 texturePos;\nattribute vec4 uTexturePos;\nattribute vec4 vTexturePos;\nvarying vec2 textureCoord;\nvarying vec2 uTextureCoord;\nvarying vec2 vTextureCoord;\nvoid main()\n{\n gl_Position = vertexPos;\n textureCoord = texturePos.xy;\n uTextureCoord = uTexturePos.xy;\n vTextureCoord = vTexturePos.xy;\n}",t="precision highp float;\nvarying highp vec2 textureCoord;\nvarying highp vec2 uTextureCoord;\nvarying highp vec2 vTextureCoord;\nuniform sampler2D ySampler;\nuniform sampler2D uSampler;\nuniform sampler2D vSampler;\nuniform mat4 YUV2RGB;\nvoid main(void) {\n highp float y = texture2D(ySampler, textureCoord).r;\n highp float u = texture2D(uSampler, uTextureCoord).r;\n highp float v = texture2D(vSampler, vTextureCoord).r;\n gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;\n}";var n=i.createShader(i.VERTEX_SHADER);i.shaderSource(n,e),i.compileShader(n),i.getShaderParameter(n,i.COMPILE_STATUS);var r=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(r,t),i.compileShader(r),i.getShaderParameter(r,i.COMPILE_STATUS);var a=i.createProgram();i.attachShader(a,n),i.attachShader(a,r),i.linkProgram(a),i.getProgramParameter(a,i.LINK_STATUS),i.useProgram(a);var o=i.getUniformLocation(a,"YUV2RGB");i.uniformMatrix4fv(o,!1,[1.16438,0,1.59603,-.87079,1.16438,-.39176,-.81297,.52959,1.16438,2.01723,0,-1.08139,0,0,0,1]),this.shaderProgram=a}},{key:"_initBuffers",value:function(){var e=this.contextGL,t=this.shaderProgram,i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var n=e.getAttribLocation(t,"vertexPos");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);var r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var a=e.getAttribLocation(t,"texturePos");e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,!1,0,0),this.texturePosBuffer=r;var o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var s=e.getAttribLocation(t,"uTexturePos");e.enableVertexAttribArray(s),e.vertexAttribPointer(s,2,e.FLOAT,!1,0,0),this.uTexturePosBuffer=o;var u=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var c=e.getAttribLocation(t,"vTexturePos");e.enableVertexAttribArray(c),e.vertexAttribPointer(c,2,e.FLOAT,!1,0,0),this.vTexturePosBuffer=u}},{key:"_initTextures",value:function(){var e=this.contextGL,t=this.shaderProgram,i=this._initTexture(),n=e.getUniformLocation(t,"ySampler");e.uniform1i(n,0),this.yTextureRef=i;var r=this._initTexture(),a=e.getUniformLocation(t,"uSampler");e.uniform1i(a,1),this.uTextureRef=r;var o=this._initTexture(),s=e.getUniformLocation(t,"vSampler");e.uniform1i(s,2),this.vTextureRef=o,e.pixelStorei(e.UNPACK_ALIGNMENT,1)}},{key:"_initTexture",value:function(){var e=this.contextGL,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),t}},{key:"_drawPictureGL",value:function(e,t,i,n,r){var a=n*i,o=r*i/2;(444===this.chroma||422===this.chroma)&&(o*=2);var s={yData:(e=new Uint8Array(e)).subarray(0,a),uData:e.subarray(a,a+o),vData:e.subarray(a+o,a+o+o)};this._drawPictureGL420(s,t,i,n,r)}},{key:"_drawPictureGL420",value:function(e,t,i,n,r){var a=this.contextGL,o=this.texturePosBuffer,s=this.uTexturePosBuffer,u=this.vTexturePosBuffer,c=this.yTextureRef,l=this.uTextureRef,d=this.vTextureRef,h=e.yData,f=e.uData,v=e.vData,_=i/2;(422===this.chroma||444===this.chroma)&&(_=i);var p=_,g=this.canvas.width/this.width,m=this.canvas.height/this.height,y=0,T=0,b=this.canvas.width,E=this.canvas.height;g<m?(E=this.height*this.canvas.width/this.width,T=parseInt((this.canvas.height-this.height*this.canvas.width/this.width)/2)):(b=this.width*this.canvas.height/this.height,y=parseInt((this.canvas.width-this.width*this.canvas.height/this.height)/2)),a.viewport(y,T,b,E);var x=new Float32Array([1,0,0,0,1,1,0,1]);a.bindBuffer(a.ARRAY_BUFFER,o),a.bufferData(a.ARRAY_BUFFER,x,a.DYNAMIC_DRAW);var R=new Float32Array([1,0,0,0,1,1,0,1]);a.bindBuffer(a.ARRAY_BUFFER,s),a.bufferData(a.ARRAY_BUFFER,R,a.DYNAMIC_DRAW);var A=new Float32Array([1,0,0,0,1,1,0,1]);a.bindBuffer(a.ARRAY_BUFFER,u),a.bufferData(a.ARRAY_BUFFER,A,a.DYNAMIC_DRAW),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,c),a.texImage2D(a.TEXTURE_2D,0,a.LUMINANCE,n,i,0,a.LUMINANCE,a.UNSIGNED_BYTE,h),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,l),a.texImage2D(a.TEXTURE_2D,0,a.LUMINANCE,r,_,0,a.LUMINANCE,a.UNSIGNED_BYTE,f),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,d),a.texImage2D(a.TEXTURE_2D,0,a.LUMINANCE,r,p,0,a.LUMINANCE,a.UNSIGNED_BYTE,v),a.drawArrays(a.TRIANGLE_STRIP,0,4)}},{key:"_drawPicture2d",value:function(e){if(!!e){if(this.canvas){!this.ctx&&(this.ctx=this.canvas.getContext("2d"));var t=e.displayWidth||e.width,i=e.displayHeight||e.height;(this.canvas.height!==i||this.canvas.width!==t)&&(this.canvas.height=i,this.canvas.width=t);try{this.ctx.drawImage(e.dom||e,0,0,t,i)}catch(e){}}}}},{key:"_resize",value:function(e,t){(this.width!==e||this.height!==t)&&(this.width=e,this.height=t,this.canvas.width=e,this.canvas.height=t,this.parent.emitResizeEvent())}},{key:"render",value:function(e,t,i,n,r){this._resize(t,i),this.contextGL?this._drawPictureGL(e,t,i,n,r):this._drawPicture2d(e)}},{key:"resetMeta",value:function(e){this.meta=Object.assign({},e)}},{key:"updateBind",value:function(e,t){this.parent=e,this.resetMeta(t)}},{key:"destroy",value:function(){this.parent=null,this.canvas.style.display="none",this.canvas&&(this.canvas.glInstance=null,this.canvas=null)}}]),e}()},484775:function(e,t,i){i.d(t,{j:function(){return n}});var n="undefined"!=typeof window},479248:function(e,t,i){i.d(t,{Q:function(){return n}});function n(){var e,t,i=new Promise(function(i,n){e=i,t=n});return i.used=!1,i.resolve=function(){return i.used=!0,e.apply(void 0,arguments)},i.reject=function(){return i.used=!0,t.apply(void 0,arguments)},i}},525231:function(e,t,i){i.d(t,{Fc:function(){return s},WE:function(){return o},wb:function(){return a}});var n,r=i(70427),a={MANIFEST:"manifest",NETWORK:"network",NETWORK_TIMEOUT:"network_timeout",NETWORK_FORBIDDEN:"network_forbidden",NETWORK_NOTFOUND:"network_notfound",NETWROK_RANGE_NOT_SATISFIABLE:"network_range_not_satisfiable",DEMUX:"demux",REMUX:"remux",MEDIA:"media",DRM:"drm",OTHER:"other",RUNTIME:"runtime",SUB_TYPES:{FLV:"FLV",HLS:"HLS",MP4:"MP4",FMP4:"FMP4",MSE_ADD_SB:"MSE_ADD_SB",MSE_APPEND_BUFFER:"MSE_APPEND_BUFFER",MSE_OTHER:"MSE_OTHER",MSE_FULL:"MSE_FULL",MSE_CHANGE_TYPE:"MSE_CHANGE_TYPE",OPTION:"OPTION",DASH:"DASH",LICENSE:"LICENSE",CUSTOM_LICENSE:"CUSTOM_LICENSE",MSE_HIJACK:"MSE_HIJACK",EME_HIJACK:"EME_HIJACK",SIDX:"SIDX",NO_CANPLAY_ERROR:"NO_CANPLAY_ERROR",BUFFERBREAK_ERROR:"BUFFERBREAK_ERROR",WAITING_TIMEOUT_ERROR:"WAITING_TIMEOUT_ERROR",MEDIA_ERR_ABORTED:"MEDIA_ERR_ABORTED",MEDIA_ERR_NETWORK:"MEDIA_ERR_NETWORK",MEDIA_ERR_DECODE:"MEDIA_ERR_DECODE",MEDIA_ERR_SRC_NOT_SUPPORTED:"MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ERR_CODEC_NOT_SUPPORTED:"MEDIA_ERR_CODEC_NOT_SUPPORTED",MEDIA_ERR_URL_EMPTY:"MEDIA_ERR_URL_EMPTY"}},o=(n={},(0,r._x)(n,a.MANIFEST,{HLS:1100,DASH:1200}),(0,r._x)(n,a.NETWORK,2100),(0,r._x)(n,a.NETWORK_TIMEOUT,2101),(0,r._x)(n,a.NETWORK_FORBIDDEN,2103),(0,r._x)(n,a.NETWORK_NOTFOUND,2104),(0,r._x)(n,a.NETWROK_RANGE_NOT_SATISFIABLE,2116),(0,r._x)(n,a.DEMUX,{FLV:3100,HLS:3200,MP4:3300,FMP4:3400,SIDX:3410}),(0,r._x)(n,a.REMUX,{FMP4:4100,MP4:4200}),(0,r._x)(n,a.MEDIA,{MEDIA_ERR_ABORTED:5101,MEDIA_ERR_NETWORK:5102,MEDIA_ERR_DECODE:5103,MEDIA_ERR_SRC_NOT_SUPPORTED:5104,MEDIA_ERR_CODEC_NOT_SUPPORTED:5105,MEDIA_ERR_URL_EMPTY:5106,MSE_ADD_SB:5200,MSE_APPEND_BUFFER:5201,MSE_OTHER:5202,MSE_FULL:5203,MSE_HIJACK:5204,MSE_CHANGE_TYPE:5205,EME_HIJACK:5301}),(0,r._x)(n,a.DRM,{LICENSE:7100,CUSTOM_LICENSE:7200}),(0,r._x)(n,a.OTHER,8e3),(0,r._x)(n,a.RUNTIME,{NO_CANPLAY_ERROR:9001,BUFFERBREAK_ERROR:9002,WAITING_TIMEOUT_ERROR:9003}),n),s=function(e){(0,r.XW)(i,e);var t=(0,r.WY)(i);function i(e,n,s,u,c){var l;return(0,r.PA)(this,i),(l=t.call(this,c||(null==s?void 0:s.message))).errorType=e===a.NETWORK_TIMEOUT?a.NETWORK:e,l.originError=s,l.ext=u,l.errorCode=o[e][n]||o[e],l.errorMessage=l.message,!l.errorCode&&(l.errorType=a.OTHER,l.errorCode=o[l.errorType]),l}return(0,r.qH)(i,null,[{key:"create",value:function(e,t,n,r,o){return e instanceof i?e:(e instanceof Error&&(n=e,e=""),!e&&(e=a.OTHER),new i(e,t,n,r,o))}},{key:"network",value:function(e){var t;return new i(null!=e&&e.isTimeout?a.NETWORK_TIMEOUT:a.NETWORK,null,e instanceof Error?e:null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e?void 0:null===(t=e.response)||void 0===t?void 0:t.status})}}]),i}((0,r.wm)(Error))},265614:function(e,t,i){i.d(t,{U:function(){return r},t:function(){return n}});var n={FETCH:"fetch",XHR:"xhr"},r={ARRAY_BUFFER:"arraybuffer",TEXT:"text",JSON:"json"}},138:function(e,t,i){i.d(t,{c:function(){return c}});var n=i(70427),r=i(430517),a=i(408746),o=i(265614),s=i(982143),u=i(942155),c=function(e){(0,n.XW)(i,e);var t=(0,n.WY)(i);function i(){var e;return(0,n.PA)(this,i),e=t.call(this),(0,n._x)((0,n.Lc)(e),"_xhr",null),(0,n._x)((0,n.Lc)(e),"_aborted",!1),(0,n._x)((0,n.Lc)(e),"_timeoutTimer",null),(0,n._x)((0,n.Lc)(e),"_range",null),(0,n._x)((0,n.Lc)(e),"_receivedLength",0),(0,n._x)((0,n.Lc)(e),"_url",null),(0,n._x)((0,n.Lc)(e),"_onProgress",null),(0,n._x)((0,n.Lc)(e),"_index",-1),(0,n._x)((0,n.Lc)(e),"_headers",null),(0,n._x)((0,n.Lc)(e),"_currentChunkSizeKB",384),(0,n._x)((0,n.Lc)(e),"_timeout",null),(0,n._x)((0,n.Lc)(e),"_xhr",null),(0,n._x)((0,n.Lc)(e),"_withCredentials",null),(0,n._x)((0,n.Lc)(e),"_startTime",-1),(0,n._x)((0,n.Lc)(e),"_loadCompleteResolve",null),(0,n._x)((0,n.Lc)(e),"_loadCompleteReject",null),(0,n._x)((0,n.Lc)(e),"_runing",!1),(0,n._x)((0,n.Lc)(e),"_logger",!1),(0,n._x)((0,n.Lc)(e),"_vid",""),(0,n._x)((0,n.Lc)(e),"_responseType",void 0),(0,n._x)((0,n.Lc)(e),"_credentials",void 0),(0,n._x)((0,n.Lc)(e),"_method",void 0),(0,n._x)((0,n.Lc)(e),"_transformResponse",void 0),(0,n._x)((0,n.Lc)(e),"_firstRtt",void 0),(0,n._x)((0,n.Lc)(e),"_onCancel",null),(0,n._x)((0,n.Lc)(e),"_priOptions",null),(0,n._x)((0,n.Lc)(e),"_dynamicTimeoutIns",null),e}return(0,n.qH)(i,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer),this._logger=e.logger,this._range=e.range,this._onProgress=e.onProgress,this._index=e.index,this._headers=e.headers,this._withCredentials="include"===e.credentials||"same-origin"===e.credentials,this._body=e.body||null,e.method&&(this._method=e.method),this._timeout=e.timeout||null,this._runing=!0,this._vid=e.vid||e.url,this._responseType=e.responseType,this._dynamicTimeoutIns=e.dynamicTimeoutIns,this._firstRtt=-1,this._onTimeout=e.onTimeout,this._onCancel=e.onCancel,this._request=e.request,this._priOptions=e.priOptions||{},this._logger.debug("【xhrLoader task】, range",this._range),this._url=(0,a.G7)(e.url,e.params);var i=Date.now();return new Promise(function(e,i){t._loadCompleteResolve=e,t._loadCompleteReject=i,t._startLoad()}).catch(function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted||"timeout"===e.message)throw(e=e instanceof r.C?e:new r.C(t._url,t._request)).startTime=i,e.endTime=Date.now(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e})}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===o.U.ARRAY_BUFFER&&this._range&&this._range.length>1){if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,i=this._range[0]+this._receivedLength,n=this._range[1];t<this._range[1]-i&&(n=i+t),e=[i,n],this._logger.debug("[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this._logger.debug("[xhr_loader->],tast :",this._range,", allRange, ",e)}this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{this._startTime=Date.now();var i=this._xhr=new XMLHttpRequest;i.open(this._method||"GET",this._url,!0),i.responseType=this._responseType;var n=this._dynamicTimeoutIns&&"function"==typeof this._dynamicTimeoutIns.getTimeout?this._dynamicTimeoutIns.getTimeout(this._timeout):this._timeout;n&&(i.timeout=n),this._logger.debug("[dytimeout], xhr set timeout",n),i.withCredentials=this._withCredentials,i.onload=this._onLoad.bind(this),i.onreadystatechange=this._onReadyStatechange.bind(this),i.onerror=function(e){t._running=!1;var i,n,a,o=new r.C(t._url,t._request,null==e?void 0:null===(i=e.currentTarget)||void 0===i?void 0:i.response,"xhr.onerror.status:"+(null==e?void 0:null===(n=e.currentTarget)||void 0===n?void 0:n.status)+",statusText,"+(null==e?void 0:null===(a=e.currentTarget)||void 0===a?void 0:a.statusText));o.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(o)},i.ontimeout=function(e){t._dynamicTimeoutIns&&"function"==typeof t._dynamicTimeoutIns.update&&(t._logger.debug("[dytimeout], xhr timeout update rtt,",5*n),t._dynamicTimeoutIns.update(5*i.timeout)),t.cancel();var a=new r.C(t._url,t._request,{status:408},"timeout");t._onTimeout&&(a.isTimeout=!0,t._onTimeout(a,{index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions})),a.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(a)};var o=this._headers||{},s=(0,a.Gu)(e);s&&(o.Range=s),o&&Object.keys(o).forEach(function(e){i.setRequestHeader(e,o[e])}),this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e,",[dytimeout],",n),i.send(this._body)}catch(t){t.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(t)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&(this._firstRtt<0&&(this._firstRtt=Date.now(),this._priOptions.rtt=this._firstRtt-this._startTime),this._dynamicTimeoutIns&&"function"==typeof this._dynamicTimeoutIns.update&&(this._logger.debug("[dytimeout] xhr update rtt,",this._priOptions.rtt),this._dynamicTimeoutIns.update(this._priOptions.rtt)))}},{key:"_onLoad",value:function(e){var t=e.target.status;if(t<200||t>299){var i=new r.C(this._url,null,(0,n.Zj)((0,n.Zj)({},e.target.response),{},{status:t}),"bad response,status:"+t);return i.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(i)}var u=null,c=!1,l=(null===(d=this._range)||void 0===d?void 0:d.length)>0?this._range[0]:0;if(this._responseType===o.U.ARRAY_BUFFER){var d,h,f,v=new Uint8Array(e.target.response);if(h=l+this._receivedLength,v&&v.byteLength>0){this._receivedLength+=v.byteLength;var _=Date.now()-this._startTime,p=(0,a.pl)(this._receivedLength,_);this.emit(s.K.REAL_TIME_SPEED,{speed:p,len:this._receivedLength,time:_,vid:this._vid,index:this._index,range:[h,l+this._receivedLength],priOptions:this._priOptions})}u=v,c=(!((null===(f=this._range)||void 0===f?void 0:f.length)>1)||!this._range[1]||!(this._receivedLength<this._range[1]-this._range[0]))&&!0,this._logger.debug("[xhr load done->], tast :",this._range,", start",h,"end ",l+this._receivedLength,",dataLen,",v?v.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",c)}else c=!0,u=e.target.response;var g={ok:t>=200&&t<300,status:t,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(g=this._transformResponse(g,this._url)||g),this._onProgress&&this._onProgress(u,c,{index:this._index,vid:this._vid,range:[h,l+this._receivedLength],startTime:this._startTime,endTime:Date.now(),priOptions:this._priOptions},g),c?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve((0,a.rO)(this._onProgress?null:u,c,g,g.headers["content-length"],g.headers.age,this._startTime,this._firstRtt,this._index,this._range,this._vid,this._priOptions))):this._startLoad()}},{key:"cancel",value:function(){if(!this._aborted&&(this._aborted=!0,this._runing=!1,(0,n.U2)((0,n.IP)(i.prototype),"removeAllListeners",this).call(this),this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions}),this._xhr))return this._xhr.abort()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}},{key:"_getHeaders",value:function(e){var t=e.getAllResponseHeaders().trim().split("\r\n"),i={},r,a=(0,n.sf)(t);try{for(a.s();!(r=a.n()).done;){var o=r.value.split(": ");i[o[0].toLowerCase()]=o.slice(1).join(": ")}}catch(e){a.e(e)}finally{a.f()}return i}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),i}(i.n(u)())},372196:function(e,t,i){function n(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];if((t=t.filter(Boolean)).length<2)return t[0];var n=new Uint8Array(t.reduce(function(e,t){return e+t.byteLength},0)),r=0;return t.forEach(function(e){n.set(e,r),r+=e.byteLength}),n}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise(function(t){return setTimeout(t,e)})}i.d(t,{_v:function(){return r},gJ:function(){return n}})},491639:function(e,t,i){i.d(t,{c:function(){return c}});var n=i(570783),r=i(991372),a=i(602929),o=i(65661),s=i(637961),u=i(942155),c=function(e){(0,n.XW)(i,e);var t=(0,n.WY)(i);function i(){var e;return(0,n.PA)(this,i),e=t.call(this),(0,n._x)((0,n.Lc)(e),"_xhr",null),(0,n._x)((0,n.Lc)(e),"_aborted",!1),(0,n._x)((0,n.Lc)(e),"_timeoutTimer",null),(0,n._x)((0,n.Lc)(e),"_range",null),(0,n._x)((0,n.Lc)(e),"_receivedLength",0),(0,n._x)((0,n.Lc)(e),"_url",null),(0,n._x)((0,n.Lc)(e),"_onProgress",null),(0,n._x)((0,n.Lc)(e),"_index",-1),(0,n._x)((0,n.Lc)(e),"_headers",null),(0,n._x)((0,n.Lc)(e),"_currentChunkSizeKB",384),(0,n._x)((0,n.Lc)(e),"_timeout",null),(0,n._x)((0,n.Lc)(e),"_xhr",null),(0,n._x)((0,n.Lc)(e),"_withCredentials",null),(0,n._x)((0,n.Lc)(e),"_startTime",-1),(0,n._x)((0,n.Lc)(e),"_loadCompleteResolve",null),(0,n._x)((0,n.Lc)(e),"_loadCompleteReject",null),(0,n._x)((0,n.Lc)(e),"_runing",!1),(0,n._x)((0,n.Lc)(e),"_logger",!1),(0,n._x)((0,n.Lc)(e),"_vid",""),(0,n._x)((0,n.Lc)(e),"_responseType",void 0),(0,n._x)((0,n.Lc)(e),"_credentials",void 0),(0,n._x)((0,n.Lc)(e),"_method",void 0),(0,n._x)((0,n.Lc)(e),"_transformResponse",void 0),(0,n._x)((0,n.Lc)(e),"_firstRtt",void 0),(0,n._x)((0,n.Lc)(e),"_onCancel",null),(0,n._x)((0,n.Lc)(e),"_priOptions",null),(0,n._x)((0,n.Lc)(e),"_dynamicTimeoutIns",null),e}return(0,n.qH)(i,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer),this._logger=e.logger,this._range=e.range,this._onProgress=e.onProgress,this._index=e.index,this._headers=e.headers,this._withCredentials="include"===e.credentials||"same-origin"===e.credentials,this._body=e.body||null,e.method&&(this._method=e.method),this._timeout=e.timeout||null,this._dynamicTimeoutIns=e.dynamicTimeoutIns,this._runing=!0,this._vid=e.vid||e.url,this._responseType=e.responseType,this._dynamicTimeoutIns=e.dynamicTimeoutIns,this._firstRtt=-1,this._onTimeout=e.onTimeout,this._onCancel=e.onCancel,this._request=e.request,this._priOptions=e.priOptions||{},this._logger.debug("【xhrLoader task】, range",this._range),this._url=(0,a.G7)(e.url,e.params);var i=Date.now();return new Promise(function(e,i){t._loadCompleteResolve=e,t._loadCompleteReject=i,t._startLoad()}).catch(function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted||"timeout"===e.message)throw(e=e instanceof r.C?e:new r.C(t._url,t._request)).startTime=i,e.endTime=Date.now(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e})}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===o.U.ARRAY_BUFFER&&this._range&&this._range.length>1){if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,i=this._range[0]+this._receivedLength,n=this._range[1];t<this._range[1]-i&&(n=i+t),e=[i,n],this._logger.debug("[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this._logger.debug("[xhr_loader->],tast :",this._range,", allRange, ",e)}this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{this._startTime=Date.now();var i=this._xhr=new XMLHttpRequest;i.open(this._method||"GET",this._url,!0),i.responseType=this._responseType;var n=this._dynamicTimeoutIns&&"function"==typeof this._dynamicTimeoutIns.getTimeout?this._dynamicTimeoutIns.getTimeout(this._timeout):this._timeout;n&&(i.timeout=n,this.curTimeout=n),this._logger.debug("[dytimeout] xhr set timeout",n),i.withCredentials=this._withCredentials,i.onload=this._onLoad.bind(this),i.onreadystatechange=this._onReadyStatechange.bind(this),i.onerror=function(e){t._running=!1;var i,n,a,o=new r.C(t._url,t._request,null==e?void 0:null===(i=e.currentTarget)||void 0===i?void 0:i.response,"xhr.onerror.status:"+(null==e?void 0:null===(n=e.currentTarget)||void 0===n?void 0:n.status)+",statusText,"+(null==e?void 0:null===(a=e.currentTarget)||void 0===a?void 0:a.statusText));o.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(o)},i.ontimeout=function(e){t._dynamicTimeoutIns&&"function"==typeof t._dynamicTimeoutIns.update&&(t._logger.debug("[dytimeout] xhr timeout update rtt,",5*i.timeout),t._dynamicTimeoutIns.update(5*i.timeout)),t.cancel();var n=new r.C(t._url,t._request,{status:408},"timeout");n.isTimeout=!0,t._onTimeout&&t._onTimeout(n,{index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions}),n.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(n)};var o=this._headers||{},s=(0,a.Gu)(e);s&&(o.Range=s),o&&Object.keys(o).forEach(function(e){i.setRequestHeader(e,o[e])}),this._logger.debug("[xhr.send->] tast,",this._range,",load sub range, ",e,",[dytimeout],",n),i.send(this._body)}catch(t){t.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(t)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&(this._firstRtt<0&&(this._firstRtt=Date.now(),this._priOptions.rtt=this._firstRtt-this._startTime),this._dynamicTimeoutIns&&"function"==typeof this._dynamicTimeoutIns.update&&(this._logger.debug("[dytimeout] xhr update rtt,",this._priOptions.rtt),this._dynamicTimeoutIns.update(this._priOptions.rtt)))}},{key:"_onLoad",value:function(e){var t=e.target.status;if(t<200||t>299){var i=new r.C(this._url,null,(0,n.Zj)((0,n.Zj)({},e.target.response),{},{status:t}),"bad response,status:"+t);return i.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(i)}var u=null,c=!1,l=(null===(d=this._range)||void 0===d?void 0:d.length)>0?this._range[0]:0;if(this._responseType===o.U.ARRAY_BUFFER){var d,h,f,v=new Uint8Array(e.target.response);if(h=l+this._receivedLength,v&&v.byteLength>0){this._receivedLength+=v.byteLength;var _=Date.now()-this._startTime,p=(0,a.pl)(this._receivedLength,_);this.emit(s.K.REAL_TIME_SPEED,{speed:p,len:this._receivedLength,time:_,vid:this._vid,index:this._index,range:[h,l+this._receivedLength],priOptions:this._priOptions})}u=v,c=(!((null===(f=this._range)||void 0===f?void 0:f.length)>1)||!this._range[1]||!(this._receivedLength<this._range[1]-this._range[0]))&&!0,this._logger.debug("[xhr load done->], tast :",this._range,", start",h,"end ",l+this._receivedLength,",dataLen,",v?v.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",c)}else c=!0,u=e.target.response;var g={ok:t>=200&&t<300,status:t,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(g=this._transformResponse(g,this._url)||g),this._onProgress&&this._onProgress(u,c,{index:this._index,vid:this._vid,range:[h,l+this._receivedLength],startTime:this._startTime,endTime:Date.now(),priOptions:this._priOptions},g),c?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve((0,a.rO)(this._onProgress?null:u,c,g,g.headers["content-length"],g.headers.age,this._startTime,this._firstRtt,this._index,this._range,this._vid,this._priOptions))):this._startLoad()}},{key:"cancel",value:function(){if(!this._aborted&&(this._aborted=!0,this._runing=!1,(0,n.U2)((0,n.IP)(i.prototype),"removeAllListeners",this).call(this),this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions}),this._xhr))return this._xhr.abort()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}},{key:"_getHeaders",value:function(e){var t=e.getAllResponseHeaders().trim().split("\r\n"),i={},r,a=(0,n.sf)(t);try{for(a.s();!(r=a.n()).done;){var o=r.value.split(": ");i[o[0].toLowerCase()]=o.slice(1).join(": ")}}catch(e){a.e(e)}finally{a.f()}return i}}],[{key:"isSupported",value:function(){return"undefined"!=typeof XMLHttpRequest}}]),i}(i.n(u)())},745740:function(e,t,i){i.d(t,{Vc:function(){return n},_e:function(){return r},yQ:function(){return a}});var n={VIDEO:"video",AUDIO:"audio",METADATA:"metadata"},r={AV1:"av1",AVC:"avc",HEVC:"hevc",VVCC:"vvcC"},a={AAC:"aac",G711PCMA:"g7110a",G711PCMU:"g7110m",OPUS:"opus",MP3:"mp3"}},585104:function(e,t,i){i.d(t,{J:function(){return r}});var n=i(697946),r=function(){function e(t,i,r){(0,n.PA)(this,e),this.dv=new DataView(t),this.start=this.offset=i||this.dv.byteOffset,this.end=r?this.start+r:this.start+this.dv.byteLength}return(0,n.qH)(e,[{key:"buffer",get:function(){return this.dv.buffer}},{key:"unreadLength",get:function(){return Math.max(this.end-this.offset,0)}},{key:"size",get:function(){return this.end-this.start}},{key:"readFloat",value:function(e){var t=0;switch(e){case 4:t=this.dv.getFloat32(this.offset);break;case 8:t=this.dv.getFloat64(this.offset);break;default:throw Error("read ".concat(e,"-byte float is not supported"))}return this.offset+=e,t}},{key:"back",value:function(e){this.offset-=e}},{key:"skip",value:function(e){this.offset+=e}},{key:"readInt",value:function(e){var t=this.offset;switch(this.offset+=e,e){case 1:return this.dv.getInt8(t);case 2:return this.dv.getInt16(t);case 4:return this.dv.getInt32(t);default:throw Error("read ".concat(e,"-byte integers is not supported"))}}},{key:"read",value:function(e){var t=this.offset;switch(this.offset+=e,e){case 1:return this.dv.getUint8(t);case 2:return this.dv.getUint16(t);case 3:return(this.dv.getUint16(t)<<8)+this.dv.getUint8(t+2);case 4:return this.dv.getUint32(t);default:return this.back(e-4),this.read(e-4)+this.dv.getUint32(t)*Math.pow(256,e-4)}}},{key:"write",value:function(e,t){var i=this.offset;switch(this.offset+=e,e){case 1:return this.dv.setUint8(i,t);case 2:return this.dv.setUint16(i,t);case 3:return this.dv.setUint8(i,t>>>16),this.dv.setUint16(i+1,65535&t);case 4:return this.dv.setUint32(i,t);default:throw Error("write ".concat(e,"-byte integers is not supported"))}}},{key:"readToBuffer",value:function(e){var t;return t=this.offset||e?this.dv.buffer.slice(this.offset,e?this.offset+e:this.end):this.dv.buffer,this.offset+=t.byteLength,t}},{key:"readToUint8",value:function(e){var t=new Uint8Array(this.dv.buffer,this.offset,e||this.unreadLength);return this.offset+=t.byteLength,t}},{key:"readString",value:function(e){for(var t=0,i="";t<e;t++)i+=String.fromCharCode(this.dv.getUint8(this.offset)),this.offset++;return i}}],[{key:"fromUint8",value:function(t){return new e(t.buffer,t.byteOffset,t.byteLength)}},{key:"concatUint8s",value:function(e){var t=new Uint8Array(e.reduce(function(e,t){return e+t.byteLength},0)),i=0;return e.forEach(function(e){t.set(e,i),i+=e.byteLength}),t}},{key:"concatUint8",value:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.concatUint8s(t)}}]),e}()},597269:function(e,t,i){i.d(t,{Z:function(){return r}});var n=i(519357),r=function(){function e(t){if((0,n.PA)(this,e),(0,n._x)(this,"_bytesAvailable",void 0),(0,n._x)(this,"_bitsAvailable",0),(0,n._x)(this,"_word",0),!t)throw Error("ExpGolomb data params is required");this._data=t,this._bytesAvailable=t.byteLength,this._bytesAvailable&&this._loadWord()}return(0,n.qH)(e,[{key:"_loadWord",value:function(){var e=this._data.byteLength-this._bytesAvailable,t=Math.min(4,this._bytesAvailable);if(0===t)throw Error("No bytes available");var i=new Uint8Array(4);i.set(this._data.subarray(e,e+t)),this._word=new DataView(i.buffer).getUint32(0),this._bitsAvailable=8*t,this._bytesAvailable-=t}},{key:"bitsPos",value:function(){return 8*this._bytesAvailable-this._bitsAvailable}},{key:"bitsLeft",value:function(){return 8*this._data.length-this.bitsPos()}},{key:"byteAligned",value:function(){return 0===this.bitsPos()||this.bitsPos()%8==0}},{key:"skipBits",value:function(e){if(this._bitsAvailable>e)this._word<<=e,this._bitsAvailable-=e;else{var t=Math.floor((e-=this._bitsAvailable)/8);e-=8*t,this._bytesAvailable-=t,this._loadWord(),this._word<<=e,this._bitsAvailable-=e}}},{key:"readBits",value:function(e){if(e>32)throw Error("Cannot read more than 32 bits");var t=Math.min(this._bitsAvailable,e),i=this._word>>>32-t;return(this._bitsAvailable-=t,this._bitsAvailable>0?this._word<<=t:this._bytesAvailable>0&&this._loadWord(),(t=e-t)>0&&this._bitsAvailable)?i<<t|this.readBits(t):i}},{key:"skipLZ",value:function(){var e;for(e=0;e<this._bitsAvailable;++e)if((this._word&2147483648>>>e)!=0)return this._word<<=e,this._bitsAvailable-=e,e;return this._loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"skipScalingList",value:function(e){for(var t=8,i=8,n=0;n<e;n++)0!==i&&(i=(t+this.readEG()+256)%256),t=0===i?t:i}}]),e}()},829594:function(e,t,i){i.d(t,{I:function(){return u}});var n=i(519357),r=i(218147),a=i(365975),o=i(833022),s=i(258413),u=function(){function e(){(0,n.PA)(this,e)}return(0,n.qH)(e,null,[{key:"findBox",value:function(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=[];if(!t)return a;for(var o=0,s="",u=0;t.length>7;){if(o=(0,r.Bh)(t),s=String.fromCharCode.apply(null,t.subarray(4,8)),u=8,1===o?(o=(0,r.h9)(t,8),u+=8):!o&&(o=t.length),!i[0]||s===i[0]){var c=t.subarray(0,o);if(!(i.length<2))return e.findBox(c.subarray(u),i.slice(1),n+u);a.push({start:n,size:o,headerSize:u,type:s,data:c})}n+=o,t=t.subarray(o)}return a}},{key:"tfhd",value:function(e){return h(e,!0,function(e,t){e.trackId=(0,r.Bh)(t);var i=4,n=1&e.flags,a=2&e.flags,o=8&e.flags,s=16&e.flags,u=32&e.flags;n&&(i+=4,e.baseDataOffset=(0,r.Bh)(t,i),i+=4),a&&(e.sampleDescriptionIndex=(0,r.Bh)(t,i),i+=4),o&&(e.defaultSampleDuration=(0,r.Bh)(t,i),i+=4),s&&(e.defaultSampleSize=(0,r.Bh)(t,i),i+=4),u&&(e.defaultSampleFlags=(0,r.Bh)(t,i))})}},{key:"sidx",value:function(e){return h(e,!0,function(e,t){var i=0;e.reference_ID=(0,r.Bh)(t,i),i+=4,e.timescale=(0,r.Bh)(t,i),i+=4,0===e.version?(e.earliest_presentation_time=(0,r.Bh)(t,i),i+=4,e.first_offset=(0,r.Bh)(t,i),i+=4):(e.earliest_presentation_time=(0,r.h9)(t,i),i+=8,e.first_offset=(0,r.h9)(t,i),i+=8),i+=2,e.references=[];var n=(0,r.i4)(t,i);i+=2;for(var a=0;a<n;a++){var o={};e.references.push(o);var s=(0,r.Bh)(t,i);i+=4,o.reference_type=s>>31&1,o.referenced_size=2147483647&s,o.subsegment_duration=(0,r.Bh)(t,i),i+=4,s=(0,r.Bh)(t,i),i+=4,o.starts_with_SAP=s>>31&1,o.SAP_type=s>>28&7,o.SAP_delta_time=268435455&s}})}},{key:"moov",value:function(t){return h(t,!1,function(t,i,n){t.mvhd=e.mvhd(e.findBox(i,["mvhd"],n)[0]),t.trak=e.findBox(i,["trak"],n).map(function(t){return e.trak(t)}),t.pssh=e.pssh(e.findBox(i,["pssh"],n)[0])})}},{key:"mvhd",value:function(e){return h(e,!0,function(e,t){var i=0;1===e.version?(e.timescale=(0,r.Bh)(t,16),e.duration=(0,r.h9)(t,20),i+=28):(e.timescale=(0,r.Bh)(t,8),e.duration=(0,r.Bh)(t,12),i+=16),e.nextTrackId=(0,r.Bh)(t,i+76)})}},{key:"trak",value:function(t){return h(t,!1,function(t,i,n){t.tkhd=e.tkhd(e.findBox(i,["tkhd"],n)[0]),t.mdia=e.mdia(e.findBox(i,["mdia"],n)[0]),t.edts=e.edts(e.findBox(i,["edts"],n)[0])})}},{key:"tkhd",value:function(e){return h(e,!0,function(e,t){var i=0;1===e.version?(e.trackId=(0,r.Bh)(t,16),e.duration=(0,r.h9)(t,24),i+=32):(e.trackId=(0,r.Bh)(t,8),e.duration=(0,r.Bh)(t,16),i+=20),e.width=(0,r.Bh)(t,i+52),e.height=(0,r.Bh)(t,i+56)})}},{key:"mdia",value:function(t){return h(t,!1,function(t,i,n){t.mdhd=e.mdhd(e.findBox(i,["mdhd"],n)[0]),t.hdlr=e.hdlr(e.findBox(i,["hdlr"],n)[0]),t.minf=e.minf(e.findBox(i,["minf"],n)[0])})}},{key:"edts",value:function(t){return h(t,!1,function(t,i,n){t.elst=e.elst(e.findBox(i,["elst"],n)[0])})}},{key:"elst",value:function(e){return h(e,!0,function(e,t,i){e.entries=[],e.entriesData=t;var n=0,a=(0,r.Bh)(t,n);n+=4;for(var o=0;o<a;o++){var s={};e.entries.push(s),1===e.version?(s.segment_duration=(0,r.h9)(t,n),n+=8,s.media_time=(0,r._b)(t,n),n+=8):(s.segment_duration=(0,r.Bh)(t,n),n+=4,s.media_time=(0,r.e2)(t,n),n+=4),s.media_rate_integer=(0,r.i4)(t,n),n+=2,s.media_rate_fraction=(0,r.i4)(t,i),n+=2}})}},{key:"mdhd",value:function(e){return h(e,!0,function(e,t){var i=0;1===e.version?(e.timescale=(0,r.Bh)(t,16),e.duration=(0,r.h9)(t,20),i+=28):(e.timescale=(0,r.Bh)(t,8),e.duration=(0,r.Bh)(t,12),i+=16);var n=(0,r.i4)(t,i);e.language=String.fromCharCode((n>>10&31)+96,(n>>5&31)+96,(31&n)+96)})}},{key:"hdlr",value:function(e){return h(e,!0,function(e,t){0===e.version&&(e.handlerType=String.fromCharCode.apply(null,t.subarray(4,8)))})}},{key:"minf",value:function(t){return h(t,!1,function(t,i,n){t.vmhd=e.vmhd(e.findBox(i,["vmhd"],n)[0]),t.smhd=e.smhd(e.findBox(i,["smhd"],n)[0]),t.stbl=e.stbl(e.findBox(i,["stbl"],n)[0])})}},{key:"vmhd",value:function(e){return h(e,!0,function(e,t){e.graphicsmode=(0,r.i4)(t),e.opcolor=[(0,r.i4)(t,2),(0,r.i4)(t,4),(0,r.i4)(t,6)]})}},{key:"smhd",value:function(e){return h(e,!0,function(e,t){e.balance=(0,r.i4)(t)})}},{key:"stbl",value:function(t){return h(t,!1,function(t,i,n){t.stsd=e.stsd(e.findBox(i,["stsd"],n)[0]),t.stts=e.stts(e.findBox(i,["stts"],n)[0]),t.ctts=e.ctts(e.findBox(i,["ctts"],n)[0]),t.stsc=e.stsc(e.findBox(i,["stsc"],n)[0]),t.stsz=e.stsz(e.findBox(i,["stsz"],n)[0]),t.stco=e.stco(e.findBox(i,["stco"],n)[0]),!t.stco&&(t.co64=e.co64(e.findBox(i,["co64"],n)[0]),t.stco=t.co64);var r,a,o,s=null===(r=t.stsd.entries[0])||void 0===r?void 0:null===(a=r.sinf)||void 0===a?void 0:null===(o=a.schi)||void 0===o?void 0:o.tenc.default_IV_size;t.stss=e.stss(e.findBox(i,["stss"],n)[0]),t.senc=e.senc(e.findBox(i,["senc"],n)[0],s)})}},{key:"senc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return h(e,!0,function(e,i){var n=0,a=(0,r.Bh)(i,n);n+=4,e.samples=[];for(var o=0;o<a;o++){var s={};s.InitializationVector=[];for(var u=0;u<t;u++)s.InitializationVector[u]=i[n+u];if(n+=t,2&e.flags){s.subsamples=[];var c=(0,r.i4)(i,n);n+=2;for(var l=0;l<c;l++){var d={};d.BytesOfClearData=(0,r.i4)(i,n),n+=2,d.BytesOfProtectedData=(0,r.Bh)(i,n),n+=4,s.subsamples.push(d)}}e.samples.push(s)}})}},{key:"pssh",value:function(e){return h(e,!0,function(e,t){for(var i=[],n=[],a=0,o=0;o<16;o++)n.push(v(t[a+o]));if(a+=16,e.version>0){var s=(0,r.Bh)(t,a);a+=4;for(var u=0;u<(""+s).length;u++)for(var c=0;c<16;c++){var l=t[a];a+=1,i.push(v(l))}}var d=(0,r.Bh)(t,a);e.data_size=d,a+=4,e.kid=i,e.system_id=n,e.buffer=t})}},{key:"bvc2",value:function(t){return h(t,!1,function(t,i,n){var r=l(t,i),a=i.subarray(r);n+=r,t.vvcC=e.bv2C(e.findBox(a,["bv2C"],n)[0]),t.pasp=e.pasp(e.findBox(a,["pasp"],n)[0])})}},{key:"bv2C",value:function(e){return h(e,!1,function(e,t,i){var n=o.i.parseVVCDecoderConfigurationRecord(t);for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])})}},{key:"stsd",value:function(t){return h(t,!0,function(t,i,n){t.entryCount=(0,r.Bh)(i),t.entries=e.findBox(i.subarray(4),[],n+4).map(function(t){switch(t.type){case"avc1":case"avc2":case"avc3":case"avc4":return e.avc1(t);case"hvc1":case"hev1":return e.hvc1(t);case"bvc2":return e.bvc2(t);case"mp4a":return e.mp4a(t);case"alaw":case"ulaw":return e.alaw(t);case"enca":return h(t,!1,function(t,i,n){t.channelCount=(0,r.i4)(i,16),t.samplesize=(0,r.i4)(i,18),t.sampleRate=(0,r.Bh)(i,24)/65536,i=i.subarray(28),t.sinf=e.sinf(e.findBox(i,["sinf"],n)[0]),t.esds=e.esds(e.findBox(i,["esds"],n)[0])});case"encv":return h(t,!1,function(t,i,n){t.width=(0,r.i4)(i,24),t.height=(0,r.i4)(i,26),t.horizresolution=(0,r.Bh)(i,28),t.vertresolution=(0,r.Bh)(i,32),i=i.subarray(78),t.sinf=e.sinf(e.findBox(i,["sinf"],n)[0]),t.avcC=e.avcC(e.findBox(i,["avcC"],n)[0]),t.hvcC=e.hvcC(e.findBox(i,["hvcC"],n)[0]),t.pasp=e.pasp(e.findBox(i,["pasp"],n)[0])})}}).filter(Boolean)})}},{key:"tenc",value:function(e){return h(e,!1,function(e,t){var i=6;e.default_IsEncrypted=t[i],i+=1,e.default_IV_size=t[i],i+=1,e.default_KID=[];for(var n=0;n<16;n++)e.default_KID.push(v(t[i])),i+=1})}},{key:"schi",value:function(t){return h(t,!1,function(t,i,n){t.tenc=e.tenc(e.findBox(i,["tenc"],n)[0])})}},{key:"sinf",value:function(t){return h(t,!1,function(t,i,n){t.schi=e.schi(e.findBox(i,["schi"],n)[0]),t.frma=e.frma(e.findBox(i,["frma"],n)[0])})}},{key:"frma",value:function(e){return h(e,!1,function(e,t){e.data_format="";for(var i=0;i<4;i++)e.data_format+=String.fromCharCode(t[i])})}},{key:"avc1",value:function(t){return h(t,!1,function(t,i,n){var r=l(t,i),a=i.subarray(r);n+=r,t.avcC=e.avcC(e.findBox(a,["avcC"],n)[0]),t.pasp=e.pasp(e.findBox(a,["pasp"],n)[0])})}},{key:"avcC",value:function(e){return h(e,!1,function(e,t){e.configurationVersion=t[0],e.AVCProfileIndication=t[1],e.profileCompatibility=t[2],e.AVCLevelIndication=t[3],e.codec=(0,r.dB)([t[1],t[2],t[3]]),e.lengthSizeMinusOne=3&t[4],e.spsLength=31&t[5],e.sps=[];for(var i=6,n=0;n<e.spsLength;n++){var a=(0,r.i4)(t,i);i+=2,e.sps.push(t.subarray(i,i+a)),i+=a}e.ppsLength=t[i],i+=1,e.pps=[];for(var o=0;o<e.ppsLength;o++){var s=(0,r.i4)(t,i);i+=2,e.pps.push(t.subarray(i,i+=s)),i+=s}})}},{key:"hvc1",value:function(t){return h(t,!1,function(t,i,n){var r=l(t,i),a=i.subarray(r);n+=r,t.hvcC=e.hvcC(e.findBox(a,["hvcC"],n)[0]),t.pasp=e.pasp(e.findBox(a,["pasp"],n)[0])})}},{key:"hvcC",value:function(e){return h(e,!1,function(t,i){t.data=e.data,t.codec="hev1.1.6.L93.B0",t.configurationVersion=i[0];var n=i[1];t.generalProfileSpace=n>>6,t.generalTierFlag=(32&n)>>5,t.generalProfileIdc=31&n,t.generalProfileCompatibility=(0,r.Bh)(i,2),t.generalConstraintIndicatorFlags=i.subarray(6,12),t.generalLevelIdc=i[12],t.avgFrameRate=(0,r.i4)(i,19),t.numOfArrays=i[22],t.vps=[],t.sps=[],t.pps=[];for(var a=23,o=0,s=0,u=0,c=0;c<t.numOfArrays;c++){o=63&i[a],s=(0,r.i4)(i,a+1),a+=3;for(var l,d,h,f=[],v=0;v<s;v++)u=(0,r.i4)(i,a),a+=2,f.push(i.subarray(a,a+u)),a+=u;32===o?(l=t.vps).push.apply(l,f):33===o?(d=t.sps).push.apply(d,f):34===o&&(h=t.pps).push.apply(h,f)}})}},{key:"pasp",value:function(e){return h(e,!1,function(e,t){e.hSpacing=(0,r.Bh)(t),e.vSpacing=(0,r.Bh)(t,4)})}},{key:"mp4a",value:function(t){return h(t,!1,function(t,i,n){var r=d(t,i);t.esds=e.esds(e.findBox(i.subarray(r),["esds"],n+r)[0])})}},{key:"esds",value:function(e){return h(e,!0,function(e,t){e.codec="mp4a.";for(var i=0,n=0,r=0,a=0;t.length;){for(a=t[i=0],n=t[i+1],i+=2;128&n;)r=(127&n)<<7,n=t[i],i+=1;if(r+=127&n,3===a)t=t.subarray(i+3);else if(4===a)e.codec+=(t[i].toString(16)+".").padStart(3,"0"),t=t.subarray(i+13);else if(5===a){var o=e.config=t.subarray(i,i+r),s=(248&o[0])>>3;31===s&&o.length>=2&&(s=32+((7&o[0])<<3)+((224&o[1])>>5)),e.objectType=s,e.codec+=s.toString(16),"."===e.codec[e.codec.length-1]&&(e.codec=e.codec.substring(0,e.codec.length-1));return}else{"."===e.codec[e.codec.length-1]&&(e.codec=e.codec.substring(0,e.codec.length-1));return}}})}},{key:"alaw",value:function(e){return h(e,!1,function(e,t){d(e,t)})}},{key:"stts",value:function(e){return h(e,!0,function(e,t){for(var i=(0,r.Bh)(t),n=[],a=4,o=0;o<i;o++)n.push({count:(0,r.Bh)(t,a),delta:(0,r.Bh)(t,a+4)}),a+=8;e.entryCount=i,e.entries=n})}},{key:"ctts",value:function(e){return h(e,!0,function(e,t){var i=(0,r.Bh)(t),n=[],a=4;if(1===e.version)for(var o=0;o<i;o++)n.push({count:(0,r.Bh)(t,a),offset:(0,r.Bh)(t,a+4)}),a+=8;else for(var s=0;s<i;s++)n.push({count:(0,r.Bh)(t,a),offset:-(~(0,r.Bh)(t,a+4)+1)}),a+=8;e.entryCount=i,e.entries=n})}},{key:"stsc",value:function(e){return h(e,!0,function(e,t){for(var i=(0,r.Bh)(t),n=Array(i),a=4,o=0;o<i;o++)n[o]={firstChunk:(0,r.Bh)(t,a),samplesPerChunk:(0,r.Bh)(t,a+4),sampleDescriptionIndex:(0,r.Bh)(t,a+8)},a+=12;e.entryCount=i,e.entries=n})}},{key:"stsz",value:function(e){return h(e,!0,function(e,t){var i=(0,r.Bh)(t),n=(0,r.Bh)(t,4),a=Array(n);if(!i){for(var o=8,s=0;s<n;s++)a[s]=(0,r.Bh)(t,o),o+=4}e.sampleSize=i,e.sampleCount=n,e.entrySizes=a})}},{key:"stco",value:function(e){return h(e,!0,function(e,t){for(var i=(0,r.Bh)(t),n=Array(i),a=4,o=0;o<i;o++)n[o]=(0,r.Bh)(t,a),a+=4;e.entryCount=i,e.entries=n})}},{key:"co64",value:function(e){return h(e,!0,function(e,t){for(var i=(0,r.Bh)(t),n=Array(i),a=4,o=0;o<i;o++)n[o]=(0,r.h9)(t,a),a+=8;e.entryCount=i,e.entries=n})}},{key:"stss",value:function(e){return h(e,!0,function(e,t){for(var i=(0,r.Bh)(t),n=Array(i),a=4,o=0;o<i;o++)n[o]=(0,r.Bh)(t,a),a+=4;e.entryCount=i,e.entries=n})}},{key:"moof",value:function(t){return h(t,!1,function(t,i,n){t.mfhd=e.mfhd(e.findBox(i,["mfhd"],n)[0]),t.traf=e.findBox(i,["traf"],n).map(function(t){return e.traf(t)})})}},{key:"mfhd",value:function(e){return h(e,!0,function(e,t){e.sequenceNumber=(0,r.Bh)(t)})}},{key:"traf",value:function(t){return h(t,!1,function(t,i,n){t.tfhd=e.tfhd(e.findBox(i,["tfhd"],n)[0]),t.tfdt=e.tfdt(e.findBox(i,["tfdt"],n)[0]),t.trun=e.trun(e.findBox(i,["trun"],n)[0])})}},{key:"trun",value:function(e){return h(e,!0,function(e,t){var i=e.version,n=e.flags,a=t.length,o=e.sampleCount=(0,r.Bh)(t),s=4;if(a>4&&1&n&&(e.dataOffset=-(~(0,r.Bh)(t,s)+1),s+=4),a>s&&4&n&&(e.firstSampleFlags=(0,r.Bh)(t,s),s+=4),a>s){e.samples=Array(o);for(var u,c=0;c<o;c++)u={},256&n&&(u.duration=(0,r.Bh)(t,s),s+=4),512&n&&(u.size=(0,r.Bh)(t,s),s+=4),1024&n&&(u.flags=(0,r.Bh)(t,s),s+=4),2048&n&&(i?u.cts=-(~(0,r.Bh)(t,s+4)+1):u.cts=(0,r.Bh)(t,s),s+=4),e.samples[c]=u}})}},{key:"tfdt",value:function(e){return h(e,!0,function(e,t){1===e.version?e.baseMediaDecodeTime=(0,r.h9)(t):e.baseMediaDecodeTime=(0,r.Bh)(t)})}},{key:"probe",value:function(t){return!!e.findBox(t,["ftyp"])}},{key:"parseSampleFlags",value:function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}}},{key:"moovToTrack",value:function(e,t,i){var n=e.trak;if(n&&n.length){var r=n.find(function(e){var t,i;return(null===(t=e.mdia)||void 0===t?void 0:null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)==="vide"}),o=n.find(function(e){var t,i;return(null===(t=e.mdia)||void 0===t?void 0:null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)==="soun"});if(r&&t){var u,c,l,d,h,f,v,_,p,g,m,y,T,b,E,x,R,A,k=null===(l=r.tkhd)||void 0===l?void 0:l.trackId;null!=k&&(t.id=r.tkhd.trackId),t.tkhdDuration=r.tkhd.duration,t.mvhdDurtion=e.mvhd.duration,t.mvhdTimecale=e.mvhd.timescale,t.timescale=t.formatTimescale=r.mdia.mdhd.timescale,t.duration=r.mdia.mdhd.duration||t.mvhdDurtion/t.mvhdTimecale*t.timescale,null!==(d=r.edts)&&void 0!==d&&d.elst&&(t.editList=r.edts.elst,t.editListApplied=r.editListApplied);var S=r.mdia.minf.stbl.stsd.entries[0];if(t.width=S.width,t.height=S.height,S.pasp&&(t.sarRatio=[S.pasp.hSpacing,S.pasp.vSpacing]),S.hvcC)t.codecType=s._e.HEVC,t.codec=S.hvcC.codec,t.vps=S.hvcC.vps,t.sps=S.hvcC.sps,t.pps=S.hvcC.pps,t.hvcC=S.hvcC.data;else if(S.avcC)t.codec=S.avcC.codec,t.sps=S.avcC.sps,t.pps=S.avcC.pps;else if(S.vvcC)t.codecType=s._e.VVCC,t.codec=S.vvcC.codec,t.sps=S.vvcC.sps,t.pps=S.vvcC.pps,t.vps=S.vvcC.vps,t.vvcC=S.vvcC.data;else throw Error("unknown video stsd entry");t.present=!0,t.ext={},t.ext.stss=null===(h=r.mdia)||void 0===h?void 0:null===(f=h.minf)||void 0===f?void 0:null===(v=f.stbl)||void 0===v?void 0:v.stss,t.ext.ctts=null===(_=r.mdia)||void 0===_?void 0:null===(p=_.minf)||void 0===p?void 0:null===(g=p.stbl)||void 0===g?void 0:g.ctts,S&&"encv"===S.type&&(t.isVideoEncryption=!0,S.default_KID=null===(m=S.sinf)||void 0===m?void 0:null===(y=m.schi)||void 0===y?void 0:y.tenc.default_KID,S.default_IsEncrypted=null===(T=S.sinf)||void 0===T?void 0:null===(b=T.schi)||void 0===b?void 0:b.tenc.default_IsEncrypted,S.default_IV_size=null===(E=S.sinf)||void 0===E?void 0:null===(x=E.schi)||void 0===x?void 0:x.tenc.default_IV_size,t.videoSenc=r.mdia.minf.stbl.senc&&r.mdia.minf.stbl.senc.samples,S.data_format=null===(R=S.sinf)||void 0===R?void 0:null===(A=R.frma)||void 0===A?void 0:A.data_format,t.useEME=e.useEME,t.kidValue=e.kidValue,t.pssh=e.pssh,t.encv=S)}if(o&&i){var C,I,L,D,w,O,B,P,M,N,U,F,j,K,H,V,W,Z,Y=null===(C=o.tkhd)||void 0===C?void 0:C.trackId;null!=Y&&(i.id=o.tkhd.trackId),i.tkhdDuration=o.tkhd.duration,i.mvhdDurtion=e.mvhd.duration,i.mvhdTimecale=e.mvhd.timescale,i.timescale=i.formatTimescale=o.mdia.mdhd.timescale,i.duration=o.mdia.mdhd.duration||i.mvhdDurtion/i.mvhdTimecale*i.timescale,null!==(I=o.edts)&&void 0!==I&&I.elst&&(i.editList=o.edts.elst,i.editListApplied=o.editListApplied);var G=o.mdia.minf.stbl.stsd.entries[0];switch(i.sampleSize=G.sampleSize,i.sampleRate=G.sampleRate,i.channelCount=G.channelCount,i.present=!0,G.type){case"alaw":i.codecType=i.codec=s.yQ.G711PCMA,i.sampleRate=8e3;break;case"ulaw":i.codecType=i.codec=s.yQ.G711PCMU,i.sampleRate=8e3;break;default:i.sampleDuration=a.W.getFrameDuration(i.sampleRate,i.timescale),i.sampleRateIndex=a.W.getRateIndexByRate(i.sampleRate),i.objectType=(null===(u=G.esds)||void 0===u?void 0:u.objectType)||2,G.esds&&(i.config=Array.from(G.esds.config)),i.codec=(null===(c=G.esds)||void 0===c?void 0:c.codec)||"mp4a.40.2"}i.sampleDuration=a.W.getFrameDuration(i.sampleRate,i.timescale),i.objectType=(null===(L=G.esds)||void 0===L?void 0:L.objectType)||2,G.esds&&G.esds.config&&(i.config=Array.from(G.esds.config)),i.codec=(null===(D=G.esds)||void 0===D?void 0:D.codec)||"mp4a.40.2",i.sampleRateIndex=a.W.getRateIndexByRate(i.sampleRate),i.ext={},i.ext.stss=null===(w=o.mdia)||void 0===w?void 0:null===(O=w.minf)||void 0===O?void 0:null===(B=O.stbl)||void 0===B?void 0:B.stss,i.ext.ctts=null===(P=o.mdia)||void 0===P?void 0:null===(M=P.minf)||void 0===M?void 0:null===(N=M.stbl)||void 0===N?void 0:N.ctts,i.present=!0,G&&"enca"===G.type&&(i.isAudioEncryption=!0,G.data_format=null===(U=G.sinf)||void 0===U?void 0:null===(F=U.frma)||void 0===F?void 0:F.data_format,G.default_KID=null===(j=G.sinf)||void 0===j?void 0:null===(K=j.schi)||void 0===K?void 0:K.tenc.default_KID,G.default_IsEncrypted=null===(H=G.sinf)||void 0===H?void 0:null===(V=H.schi)||void 0===V?void 0:V.tenc.default_IsEncrypted,G.default_IV_size=null===(W=G.sinf)||void 0===W?void 0:null===(Z=W.schi)||void 0===Z?void 0:Z.tenc.default_IV_size,i.audioSenc=o.mdia.minf.stbl.senc&&o.mdia.minf.stbl.senc.samples,i.useEME=e.useEME,i.kidValue=e.kidValue,i.enca=G)}if(i&&(i.isVideoEncryption=!!t&&t.isVideoEncryption),t&&(t.isAudioEncryption=!!i&&i.isAudioEncryption),null!=t&&t.encv||null!=i&&i.enca){var q,z,X=null==t?void 0:null===(q=t.encv)||void 0===q?void 0:q.default_KID,J=null==i?void 0:null===(z=i.enca)||void 0===z?void 0:z.default_KID,Q=X||J?(X||J).join(""):null;t&&(t.kid=Q),i&&(i.kid=Q)}return t&&(t.flags=3841),i&&(i.flags=1793),{videoTrack:t,audioTrack:i}}}},{key:"evaluateDefaultDuration",value:function(e,t,i){var n,r=null==t?void 0:null===(n=t.samples)||void 0===n?void 0:n.length;return r?1024*r/t.timescale*e.timescale/i:1024}},{key:"moofToSamples",value:function(t,i,n){var r={};return t.mfhd&&(i&&(i.sequenceNumber=t.mfhd.sequenceNumber),n&&(n.sequenceNumber=t.mfhd.sequenceNumber)),t.traf.forEach(function(t){var a=t.tfhd,o=t.tfdt,s=t.trun;if(a&&s){o&&(i&&i.id===a.trackId&&(i.baseMediaDecodeTime=o.baseMediaDecodeTime),n&&n.id===a.trackId&&(n.baseMediaDecodeTime=o.baseMediaDecodeTime));var u=a.defaultSampleSize||0,c=a.defaultSampleDuration||e.evaluateDefaultDuration(i,n,s.samples.length||s.sampleCount),l=s.dataOffset||0,d=0,h=-1;if(!s.samples.length&&s.sampleCount){r[a.trackId]=Array(s.sampleCount);for(var f=0;f<s.sampleCount;f++)r[a.trackId][f]={offset:l,dts:d,duration:c,size:u},d+=c,l+=u}else r[a.trackId]=s.samples.map(function(e,t){return(e={offset:l,dts:d,pts:d+(e.cts||0),duration:e.duration||c,size:e.size||u,gopId:h,keyframe:0===t||null!==e.flags&&void 0!==e.flags&&(65536&e.flags)>>>0!=65536}).keyframe&&(h++,e.gopId=h),d+=e.duration,l+=e.size,e})}}),r}},{key:"moovToSamples",value:function(e){var t=e.trak;if(!!t&&!!t.length){var i=t.find(function(e){var t,i;return(null===(t=e.mdia)||void 0===t?void 0:null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)==="vide"}),n=t.find(function(e){var t,i;return(null===(t=e.mdia)||void 0===t?void 0:null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)==="soun"});if(i||n){if(i){var r,a,o,s,u=null===(o=i.mdia)||void 0===o?void 0:null===(s=o.minf)||void 0===s?void 0:s.stbl;if(!u)return;var l=u.stts,d=u.stsc,h=u.stsz,f=u.stco,v=u.stss,_=u.ctts;if(!l||!d||!h||!f||!v)return;r=c(l,d,h,f,_,v)}if(n){var p,g,m,y=null===(p=n.mdia)||void 0===p?void 0:null===(g=p.minf)||void 0===g?void 0:g.stbl;if(!y)return;var T=null===(m=n.mdia.mdhd)||void 0===m?void 0:m.timescale,b=y.stts,E=y.stsc,x=y.stsz,R=y.stco;if(!T||!b||!E||!x||!R)return;a=c(b,E,x,R)}return{videoSamples:r,audioSamples:a}}}}}]),e}();function c(e,t,i,n,r,a){var o,s,u,c=[],l=null==r?void 0:r.entries,d=t.entries,h=n.entries,f=i.entrySizes,v=null==a?void 0:a.entries;v&&(o={},v.forEach(function(e){o[e-1]=!0})),l&&(s=[],l.forEach(function(e){for(var t=e.count,i=e.offset,n=0;n<t;n++)s.push(i)}));var _=-1,p=0,g=0,m=0,y=0,T=0,b=d[0].samplesPerChunk,E=d[1]?d[1].firstChunk-1:1/0;return e.entries.forEach(function(e){for(var t=e.count,n=e.delta,r=0;r<t;r++)u={dts:p,duration:n,size:f[g]||i.sampleSize,offset:h[m]+T,index:g},v&&(u.keyframe=o[g],u.keyframe&&_++,u.gopId=_),s&&g<s.length&&(u.pts=u.dts+s[g]),c.push(u),p+=n,++g<b?T+=u.size:(m++,T=0,m>=E&&(E=d[++y+1]?d[y+1].firstChunk-1:1/0),b+=d[y].samplesPerChunk)}),c}function l(e,t){return e.dataReferenceIndex=(0,r.i4)(t,6),e.width=(0,r.i4)(t,24),e.height=(0,r.i4)(t,26),e.horizresolution=(0,r.Bh)(t,28),e.vertresolution=(0,r.Bh)(t,32),e.frameCount=(0,r.i4)(t,40),e.depth=(0,r.i4)(t,74),78}function d(e,t){return e.dataReferenceIndex=(0,r.i4)(t,6),e.channelCount=(0,r.i4)(t,16),e.sampleSize=(0,r.i4)(t,18),e.sampleRate=(0,r.Bh)(t,24)/65536,28}function h(e,t,i){if(e){if(e.size!==e.data.length)throw Error("box ".concat(e.type," size !== data.length"));var n={start:e.start,size:e.size,headerSize:e.headerSize,type:e.type};return t&&(n.version=e.data[e.headerSize],n.flags=(0,r.sV)(e.data,e.headerSize+1),n.headerSize+=4),i(n,e.data.subarray(n.headerSize),n.start+n.headerSize),n}}var f=function(e,t,i){for(var n=String(i),r=t>>0,a=Math.ceil(r/n.length),o=[],s=String(e);a--;)o.push(n);return o.join("").substring(0,r-s.length)+s},v=function(){for(var e=[],t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.forEach(function(t){e.push(f(Number(t).toString(16),2,0))}),e[0]}}}]);