|
|
|
var e=Object.defineProperty,t=(t,r,n)=>(((t,r,n)=>{r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n})(t,"symbol"!=typeof r?r+"":r,n),n);let r={ALL:4,DEBUG:3,INFO:2,ERROR:1,NONE:0,level:0,isCache:!0,maxCacheNums:5e3,cacheNums:1e3,logs:[],getLogs:function(){let e="";for(let t=0;t<this.logs.length;t++)e+=this.logs[t]+"\r\n";return e},init:function(e){this.level=e.level,this.isCache=e.isCache,this.maxCacheNums=e.maxCacheNums,this.cacheNums=option.cacheNums},d:function(e){let t="";t=arguments.length>1?this.currentData()+"=>debug["+e+"]":this.currentData()+"=>debug ";let r=[].slice.call(arguments,arguments.length>1?1:0,arguments.length);this.level>=this.INFO&&console.log.apply(console,[t,...r]),this.cache(t,r)},i:function(e){let t="";t=arguments.length>1?this.currentData()+"=>info["+e+"]":this.currentData()+"=>info ";let r=[].slice.call(arguments,arguments.length>1?1:0,arguments.length);this.level>=this.INFO&&console.info.apply(console,[t,...r]),this.cache(t,r)},e:function(e){let t="";t=arguments.length>1?this.currentData()+"=>error["+e+"]":this.currentData()+"=>error ";let r=[].slice.call(arguments,arguments.length>1?1:0,arguments.length);this.level>=this.INFO&&console.error.apply(console,[t,...r]),this.cache(t,r)},cache:function(e,t){if(!this.isCache)return;let r=e;for(let n=0;n<t.length;n++)r+=t[n];this.logs.push(r),this.checkLogNum()},checkLogNum:function(){this.logs.length>this.maxCacheNums&&this.logs.splice(0,this.cacheNums)},currentData:function(){let e=new Date;return this.dateFormat("YYYY-mm-dd HH:MM:SS",e)},dateFormat:function(e,t){let r;const n={"Y+":t.getFullYear().toString(),"m+":(t.getMonth()+1).toString(),"d+":t.getDate().toString(),"H+":t.getHours().toString(),"M+":t.getMinutes().toString(),"S+":t.getSeconds().toString()};for(let s in n)r=new RegExp("("+s+")").exec(e),r&&(e=e.replace(r[1],1==r[1].length?n[s]:n[s].padStart(r[1].length,"0")));return e},showLog:function(e){document&&document.getElementById("console_id")&&(document.getElementById("console_id").innerHTML+=`<div>${e}</div>`)}};var n="https://websdkconfig.qianxuecloud.com/config_zhongzhi/APITestConfig.json",s="https://websdkconfig.qianxuecloud.com/config_zhongzhi/APIOnlineConfig.json",i="http://127.0.0.1:80/static/config/APILocalConfig.json",o="https://loggingsaas.qianxuecloud.com",a="https://mediadurationsaas.qianxuecloud.com",l="product",c="test",u="local",h={env:l,playReplaceSet:{enable:!1,newurl:"",oldurl:""},getConfigUrl:e=>e===l?s:e===c?n:e===u?i:s,setPlayreplaceSet:function(e){this.playReplaceSet=e},getPlayReplaceSet:function(){return this.playReplaceSet}},f={isUserPause:!1,isWx:!1};function d(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}var p={exports:{}},g=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},m=g,y=Object.prototype.toString;function b(e){return"[object Array]"===y.call(e)}function w(e){return void 0===e}function _(e){return null!==e&&"object"==typeof e}function C(e){if("[object Object]"!==y.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function S(e){return"[object Function]"===y.call(e)}function v(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),b(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.call(null,e[s],s,e)}var T={isArray:b,isArrayBuffer:function(e){return"[object ArrayBuffer]"===y.call(e)},isBuffer:function(e){return null!==e&&!w(e)&&null!==e.constructor&&!w(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:_,isPlainObject:C,isUndefined:w,isDate:function(e){return"[object Date]"===y.call(e)},isFile:function(e){return"[object File]"===y.call(e)},isBlob:function(e){return"[object Blob]"===y.call(e)},isFunction:S,isStream:function(e){return _(e)&&S(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:v,merge:function e(){var t={};function r(r,n){C(t[n])&&C(r)?t[n]=e(t[n],r):C(r)?t[n]=e({},r):b(r)?t[n]=r.slice():t[n]=r}for(var n=0,s=arguments.length;n<s;n++)v(arguments[n],r);return t},extend:function(e,t,r){return v(t,(function(t,n){e[n]=r&&"function"==typeof t?m(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},U=T;function N(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var k=function(e,t,r){if(!t)return e;var n;if(r)n=r(t);else if(U.isURLSearchParams(t))n=t.toString();else{var s=[];U.forEach(t,(function(e,t){null!=e&&(U.isArray(e)?t+="[]":e=[e],U.forEach(e,(function(e){U.isDate(e)?e=e.toISOString():U.isObject(e)&&(e=JSON.stringify(e)),s.push(N(t)+"="+N(e))})))})),n=s.join("&")}if(n){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e},I=T;function O(){this.handlers=[]}O.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},O.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},O.prototype.forEach=function(e){I.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var R=O,D=T,x=function(e){return!(!e||!e.__CANCEL__)},L=T,A=function(e,t,r,n,s){return e.config=t,r&&(e.code=r),e.request=n,e.response=s,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e},M=function(e,t,r,n,s){var i=new Error(e);return A(i,t,r,n,s)},B=M,P=T,E=P.isStandardBrowserEnv()?{write:function(e,t,r,n,s,i){var o=[];o.push(e+"="+encodeURIComponent(t)),P.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),P.isString(n)&&o.push("path="+n),P.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},q=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)},F=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},j=T,J=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],W=T,K=W.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=W.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},H=T,G=function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(B("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)},z=E,V=k,$=function(e,t){return e&&!q(t)?F(e,t):t},X=function(e){var t,r,n,s={};return e?(j.forEach(e.split("\n"),(function(e){if(n=e.indexOf(":"),t=j.trim(e.substr(0,n)).toLowerCase(),r=j.trim(e.substr(n+1)),t){if(s[t]&&J.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s},Q=K,Y=M,Z=function(e){return new Promise((function(t,r){var n=e.data,s=e.headers;H.isFormData(n)&&delete s["Content-Type"];var i=new XMLHttpRequest;if(e.auth){var o=e.auth.username||"",a=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.Authorization="Basic "+btoa(o+":"+a)}var l=$(e.baseURL,e.url);if(i.open(e.method.toUpperCase(),V(l,e.params,e.paramsSerializer),!0),i.timeout=e.timeout,i.onreadystatechange=function(){if(i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in i?X(i.getAllResponseHeaders()):null,s={data:e.responseType&&"text"!==e.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:n,config:e,request:i};G(t,r,s),i=null}},i.onabort=function(){i&&(r(Y("Request aborted",e,"ECONNABORTED",i)),i=null)},i.onerror=function(){r(Y("Network Error",e,null,i)),i=null},i.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(Y(t,e,"ECONNABORTED",i)),i=null},H.isStandardBrowserEnv()){var c=(e.withCredentials||Q(l))&&e.xsrfCookieName?z.read(e.xsrfCookieName):void 0;c&&(s[e.xsrfHeaderName]=c)}if("setRequestHeader"in i&&H.forEach(s,(function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete s[t]:i.setRequestHeader(t,e)})),H.isUndefined(e.withCredentials)||(i.withCredentials=!!e.withCredentials),e.responseType)try{i.responseType=e.responseType}catch(u){if("json"!==e.responseType)throw u}"function"==typeof e.onDownloadProgress&&i.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){i&&(i.abort(),r(e),i=null)})),n||(n=null),i.send(n)}))},ee=T,te=function(e,t){L.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))},re={"Content-Type":"application/x-www-form-urlencoded"};function ne(e,t){!ee.isUndefined(e)&&ee.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var se,ie={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(se=Z),se),transformRequest:[function(e,t){return te(t,"Accept"),te(t,"Content-Type"),ee.isFormData(e)||ee.isArrayBuffer(e)||ee.isBuffer(e)||ee.isStream(e)||ee.isFile(e)||ee.isBlob(e)?e:ee.isArrayBufferView(e)?e.buffer:ee.isURLSearchParams(e)?(ne(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):ee.isObject(e)?(ne(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};ie.headers={common:{Accept:"application/json, text/plain, */*"}},ee.forEach(["delete","get","head"],(function(e){ie.headers[e]={}})),ee.forEach(["post","put","patch"],(function(e){ie.headers[e]=ee.merge(re)}));var oe=ie,ae=T,le=function(e,t,r){return D.forEach(r,(function(r){e=r(e,t)})),e},ce=x,ue=oe;function he(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var fe=T,de=function(e,t){t=t||{};var r={},n=["url","method","data"],s=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function a(e,t){return fe.isPlainObject(e)&&fe.isPlainObject(t)?fe.merge(e,t):fe.isPlainObject(t)?fe.merge({},t):fe.isArray(t)?t.slice():t}function l(n){fe.isUndefined(t[n])?fe.isUndefined(e[n])||(r[n]=a(void 0,e[n])):r[n]=a(e[n],t[n])}fe.forEach(n,(function(e){fe.isUndefined(t[e])||(r[e]=a(void 0,t[e]))})),fe.forEach(s,l),fe.forEach(i,(function(n){fe.isUndefined(t[n])?fe.isUndefined(e[n])||(r[n]=a(void 0,e[n])):r[n]=a(void 0,t[n])})),fe.forEach(o,(function(n){n in t?r[n]=a(e[n],t[n]):n in e&&(r[n]=a(void 0,e[n]))}));var c=n.concat(s).concat(i).concat(o),u=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===c.indexOf(e)}));return fe.forEach(u,l),r},pe=T,ge=k,me=R,ye=function(e){return he(e),e.headers=e.headers||{},e.data=le(e.data,e.headers,e.transformRequest),e.headers=ae.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),ae.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||ue.adapter)(e).then((function(t){return he(e),t.data=le(t.data,t.headers,e.transformResponse),t}),(function(t){return ce(t)||(he(e),t&&t.response&&(t.response.data=le(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},be=de;function we(e){this.defaults=e,this.interceptors={request:new me,response:new me}}we.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=be(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[ye,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},we.prototype.getUri=function(e){return e=be(this.defaults,e),ge(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},pe.forEach(["delete","get","head","options"],(function(e){we.prototype[e]=function(t,r){return this.request(be(r||{},{method:e,url:t,data:(r||{}).data}))}})),pe.forEach(["post","put","patch"],(function(e){we.prototype[e]=function(t,r,n){return this.request(be(n||{},{method:e,url:t,data:r}))}}));var _e=we;function Ce(e){this.message=e}Ce.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Ce.prototype.__CANCEL__=!0;var Se=Ce,ve=Se;function Te(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new ve(e),t(r.reason))}))}Te.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Te.source=function(){var e;return{token:new Te((function(t){e=t})),cancel:e}};var Ue=Te,Ne=T,ke=g,Ie=_e,Oe=de;function Re(e){var t=new Ie(e),r=ke(Ie.prototype.request,t);return Ne.extend(r,Ie.prototype,t),Ne.extend(r,t),r}var De=Re(oe);De.Axios=Ie,De.create=function(e){return Re(Oe(De.defaults,e))},De.Cancel=Se,De.CancelToken=Ue,De.isCancel=x,De.all=function(e){return Promise.all(e)},De.spread=function(e){return function(t){return e.apply(null,t)}},De.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError},p.exports=De,p.exports.default=De;var xe=p.exports;function Le(e){return new Promise(((t,r)=>{const n=xe.create();xe.interceptors.request.use=n.interceptors.request.use,n.interceptors.request.use((e=>e),(e=>{if("ECONNABORTED"===e.code&&-1!==e.message.indexOf("timeout"))return void console.log("request timeout !");const t=e.response;return t&&(e=t.data),Promise.reject(e)})),n.interceptors.response.use((e=>{var t;return void 0===e.data?t=JSON.parse(e.request.responseText):(t=e.data).code,t}),(e=>{if(e&&e.response){var t={code:e.response.status,msg:""};switch(e.response.status){case 400:t.msg="请求错误";break;case 401:t.msg="未授权,请登录",router.replace("/login");break;case 403:t.msg="拒绝访问";break;case 404:t.msg=`请求地址出错: ${e.response.config.url}`;break;case 408:t.msg="请求超时";break;case 500:t.msg="服务器内部错误";break;case 501:t.msg="服务未实现";break;case 502:t.msg="网关错误";break;case 503:t.msg="服务不可用";break;case 504:t.msg="网关超时";break;case 505:t.msg="HTTP版本不受支持";break;default:t.msg="未知错误"}}return Promise.reject(t)})),n(e).then((e=>{t(e)})).catch((e=>{r(e)}))}))}var Ae={reqConfig:function(){let e=h.getConfigUrl(h.env)+"?t="+(new Date).getTime();return r.d("reqConfig",e),this.get(e,{})},get:function(e,t){return f.isWx?new Promise(((r,n)=>{wx.request({url:e,data:t,success:e=>{r(e.data)}})})):Le({url:e,method:"get",params:t})},post:function(e,t){return Le({url:e,method:"post",data:t})}},Me=function(e,t){return f.isWx?new Promise(((r,n)=>{wx.request({url:e,data:t,method:"POST",success:e=>{r(e.data)}})})):Le({url:e,method:"post",data:t})},Be=function(e,t){return f.isWx?new Promise(((r,n)=>{wx.request({url:e,data:t,success:e=>{r(e.data)}})})):Le({url:e,method:"get",params:t})},Pe={enableSeek:!0,getChatId(e,t){let r=window.localStorage.getItem(e+"_"+t+"_historychatid");if(r)return JSON.parse(r)},addChatId(e,t,r){let n=this.getChatId(e,t);if(null==n&&(n={}),r in n)return;n[r]=r;let s=JSON.stringify(n);window.localStorage.setItem(e+"_"+t+"_historychatid",s)},setPlayLine(e){window&&window.localStorage.setItem("qxc_playback_line",e)},getPlayLine(){if(window){let e=window.localStorage.getItem("qxc_playback_line");return e||null}return null},savePlayerTime(e,t){f.isWx?(wx.setStorage({key:e+"_vodtime",data:t+""}),wx.setStorage({key:e+"_vodtime_ts",data:(new Date).getTime()+""})):window.localStorage.setItem(e+"_vodtime",t+"")},getPlayerTimeTs(e){if(f.isWx){let t=wx.getStorageSync(e+"_vodtime_ts");if(t)return parseInt(t)}else{let t=window.localStorage.getItem(e+"_vodtime_ts");if(t)return parseInt(t)}},getPlayerTime(e){if(f.isWx){let t=wx.getStorageSync(e+"_vodtime");if(t)return parseInt(t)}else{let t=window.localStorage.getItem(e+"_vodtime");if(t)return parseInt(t)}},getProTime(e){let t=this.getPlayerTime(e),r=this.getPlayerTimeTs(e);return void 0===t||void 0===r?null:(new Date).getTime()-r<=12e4?t:null},getProTime2(e){return this.getPlayerTime(e)}};function Ee(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";this.encode=function(r){var n,s,i,o,a,l,c,u="",h=0;for(r=t(r);h<r.length;)o=(n=r.charCodeAt(h++))>>2,a=(3&n)<<4|(s=r.charCodeAt(h++))>>4,l=(15&s)<<2|(i=r.charCodeAt(h++))>>6,c=63&i,isNaN(s)?l=c=64:isNaN(i)&&(c=64),u=u+e.charAt(o)+e.charAt(a)+e.charAt(l)+e.charAt(c);return u},this.decode=t=>{var r,n,s,i,o,a,l="",c=0;if(null!=t&&null!=t){for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<t.length;)r=e.indexOf(t.charAt(c++))<<2|(i=e.indexOf(t.charAt(c++)))>>4,n=(15&i)<<4|(o=e.indexOf(t.charAt(c++)))>>2,s=(3&o)<<6|(a=e.indexOf(t.charAt(c++))),l+=String.fromCharCode(r),64!=o&&(l+=String.fromCharCode(n)),64!=a&&(l+=String.fromCharCode(s));return l}};let t=e=>{e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}}var qe={decryptByEncryKeyForVod:function(e){return this.decryptByEncryKeyByKeyForVod(e,81)},decryptByEncryKeyByKeyForVod:function(e,t){e=e.trim();let r=(new Ee).decode(e),n=this.stringToBytes(r),s=[];for(var i=0;i<n.length;i++)s.push(n[i]-t);return this.utf8ByteToUnicodeStr(s)},utf8ByteToUnicodeStr:function(e){for(var t="",r=0;r<e.length;){var n=e[r],s=0;n>>>7==0?(t+=String.fromCharCode(e[r]),r+=1):252==(252&n)?(s=(3&e[r])<<30,s|=(63&e[r+1])<<24,s|=(63&e[r+2])<<18,s|=(63&e[r+3])<<12,s|=(63&e[r+4])<<6,s|=63&e[r+5],t+=String.fromCharCode(s),r+=6):248==(248&n)?(s=(7&e[r])<<24,s|=(63&e[r+1])<<18,s|=(63&e[r+2])<<12,s|=(63&e[r+3])<<6,s|=63&e[r+4],t+=String.fromCharCode(s),r+=5):240==(240&n)?(s=(15&e[r])<<18,s|=(63&e[r+1])<<12,s|=(63&e[r+2])<<6,s|=63&e[r+3],t+=String.fromCharCode(s),r+=4):224==(224&n)?(s=(31&e[r])<<12,s|=(63&e[r+1])<<6,s|=63&e[r+2],t+=String.fromCharCode(s),r+=3):192==(192&n)?(s=(63&e[r])<<6,s|=63&e[r+1],t+=String.fromCharCode(s),r+=2):(t+=String.fromCharCode(e[r]),r+=1)}return t},decryptByEncryKey:function(e){e=e.trim();let t=(new Ee).decode(e),r=this.stringToBytes(t),n=[];for(var s=0;s<r.length;s++)n.push(r[s]-81);return this.byteToString(n)},stringToBytes:function(e){for(var t,r,n=[],s=0;s<e.length;s++){t=e.charCodeAt(s),r=[];do{r.push(255&t),t>>=8}while(t);n=n.concat(r.reverse())}return n},byteToString:function(e){if("string"==typeof e)return e;for(var t="",r=e,n=0;n<r.length;n++){var s=r[n].toString(2),i=s.match(/^1+?(?=0)/);if(i&&8==s.length){for(var o=i[0].length,a=r[n].toString(2).slice(7-o),l=1;l<o;l++)a+=r[l+n].toString(2).slice(2);t+=String.fromCharCode(parseInt(a,2)),n+=o-1}else t+=String.fromCharCode(r[n])}return t},randomNum:function(e,t){switch(arguments.length){case 1:return parseInt(Math.random()*e+1,10);case 2:return parseInt(Math.random()*(t-e+1)+e,10);default:return 0}},isEmptyString:function(e){return"[object String]"===Object.prototype.toString.call(e)&&!!e},isTypeString:function(e){return"[object String]"===Object.prototype.toString.call(e)},isFunction:function(e){if(!e)return!1;return"[object Function]"===Object.prototype.toString.call(e)},isSafari:function(){return/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)},isMp4:function(e){return e.indexOf(".mp4")>0},isM3u8:function(e){return e.indexOf(".m3u8")>0},randomString:function(e){let t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";var r=t.length,n="";for(let s=0;s<e;s++)n+=t.charAt(Math.floor(Math.random()*r));return n},Base64:{encode:e=>btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode("0x"+t)}))),decode:e=>decodeURIComponent(atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))},encodeReportData:function(e){let t=this.randomString(3),r=this.randomString(6);e=e.trim();let n=this.Base64.encode(e);return n=t+n+r,n},getExploreName(){var e=navigator.userAgent;let t="Unkonwn";return t=e.indexOf("Opera")>-1||e.indexOf("OPR")>-1?"Opera":e.indexOf("compatible")>-1&&e.indexOf("MSIE")>-1?"IE":e.indexOf("Edge")>-1?"Edge":e.indexOf("Firefox")>-1?"Firefox":e.indexOf("Safari")>-1&&-1==e.indexOf("Chrome")?"Safari":e.indexOf("Chrome")>-1&&e.indexOf("Safari")>-1?"Chrome":window.ActiveXObject||"ActiveXObject"in window?"IE>=11":"Unkonwn",t+"("+e+")"},isH5:()=>!!/Android|webOS|iPhone|iPod|BlackBerry|iPad/i.test(navigator.userAgent),isIOS:()=>!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),isAndroid(){let e=navigator.userAgent;return e.indexOf("Android")>-1||e.indexOf("Linux")>-1},getPlatformName:()=>/Android|webOS|iPhone|iPod|BlackBerry|iPad/i.test(navigator.userAgent)?"H5":"Web",topTip2Html(e){let t=JSON.parse(e).msg,r="";for(let n=0;n<t.length;n++){let e=t[n],s="",i=e.content.replace(/\n/g,"<br/>");1===e.type?s='<span style="color: #2A4350;"> '+i+" </span>":2===e.type&&(s='<a style="color: #FF6800;" href="'+e.url+'" target="_blank" >'+i+"</a>"),r+=s}return r},xmlToJson:function(e){let t=this.getArrData(e);if(!t||0===t.length)return null;let r=[];for(let n=0;n<t.length;n++){let e=t[n],s={index:n+1,content:"",type:1};if(e.startsWith("<a")){s.type=2;let t=this.getXmlDocumentByXmlString(e),r=t.childNodes[0].attributes[0].nodeValue;s.content=t.childNodes[0].innerHTML,s.url=r}else s.type=1,s.content=e;r.push(s)}return{msg:r}},fullscreen:function(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitEnterFullscreen&&e.webkitEnterFullscreen()},exitFullscreen:function(e=document){try{e.exitFullscreen?e.exitFullscreen().catch((e=>{})):e.mozCancelFullScreen?e.mozCancelFullScreen().catch((e=>{})):e.webkitCancelFullScreen?e.webkitCancelFullScreen().catch((e=>{})):e.msExitFullscreen?e.msExitFullscreen().catch((e=>{})):e.webkitExitFullscreen&&e.webkitExitFullscreen().catch((e=>{}))}catch(t){r.e("exit full screen")}},IsOrNoFullScreen:function(e){return window.navigator.userAgent.toLowerCase().indexOf("chrome")>0?e.scrollHeight===window.screen.height&&e.scrollWidth===window.screen.width:window.outerHeight===window.screen.height&&window.outerWidth===window.screen.width},getMS(e){let t=parseInt(e/60),r=parseInt(e%60),n=r+"";return r<=9&&(n="0"+r),`${t}:${n}`},initVideoAttr:function(e){e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("preload","auto"),e.setAttribute("autoplay","autoplay"),e.setAttribute("playsinline","true"),e.setAttribute("x5-video-player-type","h5"),e.setAttribute("x5-video-player-fullscreen","true"),e.setAttribute("x5-video-orientation","portraint")},getQueryVariable:function(e){for(var t=window.location.search.substring(1).split("&"),r=0;r<t.length;r++){var n=t[r].split("=");if(n[0]==e)return n[1]}return!1}},Fe={encodeWebsocketData:function(e){let t=this.randomString(5),r=this.randomString(8);e=e.trim();let n=this.Base64.encode(e);return n=t+n+r,n},decodeWebsocketData:function(e){return e=(e=(e=e.trim()).substring(5)).substr(0,e.length-8),this.Base64.decode(e)},randomString:function(e){let t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";var r=t.length,n="";for(let s=0;s<e;s++)n+=t.charAt(Math.floor(Math.random()*r));return n},Base64:{encode:e=>(new Ee).encode(e),decode:e=>(new Ee).decode(e)}};class je{constructor(e,n){t(this,"onOpen",(e=>{this.onopen(e),this.startHeartTime()})),t(this,"onMessage",(e=>{let t=e.data;this.encry&&(t=Fe.decodeWebsocketData(e.data));let n={data:t};r.d("basews",this.wssUrl+" 收到消息 解码后:"+JSON.stringify(t)),this.onmessage(n)})),t(this,"onError",(e=>{this.onerror(e),this.cancelHeartTime()})),t(this,"onClose",(e=>{this.cancelHeartTime(),this.isRelease||this.onclose(e)})),this.wssUrl=e,this.ws=void 0,this.onopen=this.onmessage=this.onerror=this.onclose=this.onheart=null,this.interval=null,this.encry=!n||n.encry,this.heartTime=n&&n.heartTime?n.heartTime:1e4}connect(){this.ws=new WebSocket(this.wssUrl),this.ws.onopen=this.onOpen,this.ws.onmessage=this.onMessage,this.ws.onerror=this.onError,this.ws.onclose=this.onClose,this.isRelease=!1}release(){this.isRelease=!0,this.close()}close(){this.ws&&(this.ws.close(),this.cancelHeartTime())}sendMsg(e){let t=JSON.stringify(e);r.d("basews",this.wssUrl+" 发送消息 编码前:"+t),this.encry&&(t=Fe.encodeWebsocketData(t)),null!==this.ws&&void 0!==this.ws&&this.ws.send(t)}startHeartTime(){this.cancelHeartTime(),this.interval=setInterval((()=>{this.onheart()}),this.heartTime)}cancelHeartTime(){clearInterval(this.interval)}}class Je{constructor(e,n){t(this,"onOpen",(e=>{this.onopen(e),this.startHeartTime()})),t(this,"onMessage",(e=>{let t=e.data;this.encry&&(t=Fe.decodeWebsocketData(e.data));let n={data:t};r.d("basews",this.wssUrl+" 收到消息 解码后:"+JSON.stringify(t)),this.onmessage(n)})),t(this,"onError",(e=>{r.d("onError",e),this.onerror(e),this.cancelHeartTime()})),t(this,"onClose",(e=>{r.d("onClose",e),this.cancelHeartTime(),this.isRelease||this.onclose(e)})),this.wssUrl=e,this.ws=void 0,this.onopen=this.onmessage=this.onerror=this.onclose=this.onheart=null,this.interval=null,this.encry=!n||n.encry,this.heartTime=n&&n.heartTime?n.heartTime:1e4}connect(){this.ws=wx.connectSocket({url:this.wssUrl}),this.ws.onOpen(this.onOpen),this.ws.onMessage(this.onMessage),this.ws.onError(this.onError),this.ws.onClose(this.onClose),this.isRelease=!1}release(){this.isRelease=!0,this.close()}close(){this.ws&&(r.d("invoke close"),this.ws.close(),this.cancelHeartTime())}sendMsg(e){let t=JSON.stringify(e);r.d("basews",this.wssUrl+" 发送消息 编码前:"+t),this.encry&&(t=Fe.encodeWebsocketData(t)),r.d("basews",this.wssUrl+" 发送消息 编码后:"+t),null!==this.ws&&void 0!==this.ws&&this.ws.send({data:t})}startHeartTime(){this.cancelHeartTime(),this.interval=setInterval((()=>{this.onheart()}),this.heartTime)}cancelHeartTime(){clearInterval(this.interval)}}class We{constructor(e){this.onUserChatMgr=null,this.onKickoutUserRq=null,this.onChatAllMgr=null,this.onTeacherUpMediaBC=null,this.onTeacherDownMediaBC=null,this.onUserListRs=null,this.onUserNumberBC=null,this.onDuplicateLoginKickOut=null,this.onRoomUserInNotify=null,this.onRoomUserOutNotify=null,this.onLiveClassUserOutNotify=null,this.onLiveClassUserInNotify=null,this.onRoomTransMessageRs=null,this.onRoomTransMessageRq=null,this.onMediaPlayStart=null,this.onMediaPlayPause=null,this.onMediaPlayStop=null,this.onMasterTokenRs=null,this.onMasterTeacherInOut=null,this.onClassTypeAndUpMediaNotify=null,this.onQuestionNotify=null,this.onQuestionResultSync=null,this.onTeacherQuestionStop=null,this.onGraffitiBC=null,this.onGraffitiStop=null,this.onTopTipMsgBC=null,this.onTopTipMsgDel=null,this.onTopTipMsgRemove=null,this.onProductList=null,this.onProductUpBC=null,this.onProductDownBC=null,this.onUpProductListBC=null,this.onLotteryMessageNotify=null,this.onLotteryNotify=null,this.onLotteryResultRs=null,this.onLotteryStop=null,this.onCountDown=null,this.onAssistantRecordRs=null,this.onTeacherRecordStatusBC=null,this.onTeacherMediaStatusBC=null,this.onRoomSystemMsgNotify=null,this.onBigClassHandUpOp=null,this.onBigClassUserHandUpBC=null,this.onBigClassMediaInteractRq=null,this.onBigClassNotifyUserOpenMedia=null,this.onMediaSubUserNotify=null,this.onBigClassDebugDeviceStopMedia=null,this.onAdList=null,this.onAdUpBC=null,this.onAdDownBC=null,this.onUpAdListBC=null}formatData(e,t){let r=parseInt(e),n={},s=null;if(27===r)n={teacherUserId:t.teacherUserId,studentUserId:t.studentUserId,chatStatus:t.chatStatus},s=this.onUserChatMgr;else if(28===r)n={mgrUserId:t.mgrUserId,studentUserId:t.studentUserId},s=this.onKickoutUserRq;else if(36===r)n={enable:t.enable},s=this.onChatAllMgr;else if(52===r)n={mediaType:t.mediaType,stream:t.stream,width:t.width,height:t.height,teacehrName:t.teacherName},s=this.onTeacherUpMediaBC;else if(53===r)n={stream:t.stream},s=this.onTeacherDownMediaBC;else if(50===r){let e=t.userList;if(!e)return;for(let t=0;t<e.length;t++){let r=e[t].userId,n=this.getUserId(r);e[t].userId=n}n={lastTs:t.lastTs,userList:t.userList},s=this.onUserListRs}else if(51===r)n={studentNumber:t.studentNumber,totalNumber:t.totalNumber,pureNumber:t.pureNumber},s=this.onUserNumberBC;else if(54===r){n={userId:this.getUserId(t.userId)},s=this.onLiveClassUserOutNotify}else if(55===r){n={userId:this.getUserId(t.userId),userName:t.userName,enableChat:t.enableChat,userType:t.userType},s=this.onLiveClassUserInNotify}else if(56==r)n={type:t.type,userName:t.userName},s=this.onMasterTeacherInOut;else if(57==r)n={type:t.type,up:t.up},s=this.onClassTypeAndUpMediaNotify;else if(59==r)n={master:t.master,roomId:t.roomId,token:t.token},s=this.onMasterTokenRs;else if(60==r)n={srcUserId:this.getUserId(t.srcUserId),dstUserId:this.getUserId(t.dstUserId),messageType:t.messageType,messageRq:t.messageRq},s=this.onRoomTransMessageRq;else if(61==r)n={srcUserId:this.getUserId(t.srcUserId),dstUserId:this.getUserId(t.dstUserId),messageType:t.MessageType||t.messageType,messageRs:t.messageRs},s=this.onRoomTransMessageRs;else if(62==r)n={type:t.type,url:t.url,playTs:t.playTs,totalTs:t.totalTs,name:t.name},s=this.onMediaPlayStart;else if(63==r)n={type:t.type,url:t.url,playTs:t.playTs,totalTs:t.totalTs,name:t.name},s=this.onMediaPlayPause;else if(64==r)n={type:t.type,url:t.url,playTs:t.playTs},s=this.onMediaPlayStop;else if(72==r)n={mgrUserId:t.mgrUserId,studentUserId:t.studentUserId},s=this.onDuplicateLoginKickOut;else if(8===r)n={userid:this.getUserId(t.userid),usertype:t.usertype,username:t.username},s=this.onRoomUserInNotify;else if(9===r)n={userid:this.getUserId(t.userid),username:t.username},s=this.onRoomUserOutNotify;else if(82===r)n={msgType:t.msgType,msg:t.msg},s=this.onRoomAppMsg;else if(83===r)n=t,s=this.onCountDown;else if(85===r)n={questionId:t.questionId,msgType:t.msgType,itemNum:t.itemNum,multiple:t.multiple,showUserNum:t.showUserNum},s=this.onQuestionNotify;else if(87===r)n={questionId:t.questionId,msgType:t.msgType,answerCount:t.answerCount,rightPercent:t.rightPercent,totalResult:t.totalResult,tsTotal:t.tsTotal,showUserNum:t.showUserNum},s=this.onQuestionResultSync;else if(88===r)n={status:t.status},s=this.onTeacherQuestionStop;else if(90===r){n=t,n.users||(n.users=[]);for(let e=0;e<n.users.length;e++){let t=n.users[e];t.userId=t.userIdEx}s=this.onLotteryMessageNotify}else if(91===r)n=t,s=this.onLotteryNotify;else if(93===r)n=t,s=this.onLotteryResultRs;else if(107===r)n=t,s=this.onLotteryStop;else if(95===r)n={exVal:t.exVal},s=this.onGraffitiBC;else if(96===r)n={exVal:t.exVal},s=this.onGraffitiStop;else if(98===r)n={msgId:t.msgId,msgContent:t.msgContent},s=this.onTopTipMsgBC;else if(99===r)n={msgId:t.msgId},s=this.onTopTipMsgDel;else if(100===r)n=t,s=this.onProductList;else if(102===r)n=t,s=this.onProductUpBC;else if(104===r)n=t,s=this.onProductDownBC;else if(105===r)n={prouctList:t.prouctList},s=this.onUpProductListBC;else if(109===r)n=t,s=this.onAssistantRecordRs;else if(110===r)n=t,s=this.onTeacherRecordStatusBC;else if(111===r)n=t,s=this.onTeacherMediaStatusBC;else if(140===r)n=t,s=this.onAdList;else if(142===r)n=t,s=this.onAdUpBC;else if(144===r)n=t,s=this.onAdDownBC;else if(145===r)n={prouctList:t.prouctList},s=this.onUpAdListBC;else if(122===r)n=t,s=this.onBigClassHandUpOp;else if(124===r)n=t,s=this.onBigClassUserHandUpBC;else if(125===r)n=t,n.srcUserId=this.getUserId(n.srcUserId)+"",n.dstUserId=this.getUserId(n.dstUserId)+"",s=this.onBigClassMediaInteractRq;else if(127===r)n=t,s=this.onBigClassNotifyUserOpenMedia;else if(14===r)if(s=this.onMediaSubUserNotify,void 0===t.mediauserlist)n={userlist:[]};else{let e=t.mediauserlist;for(let t=0;t<e.length;t++){let r=e[t].userid,n=this.getUserId(r);e[t].userid=n}n={userlist:e}}else 129===r?(n=t,n.userId=this.getUserId(n.userId)+"",s=this.onBigClassDebugDeviceStopMedia):150===r&&(n=t,s=this.onRoomSystemMsgNotify);return{data:n,callback:s}}isInteger(e){return"number"==typeof e&&e%1==0}getUserId(e){return this.isInteger(e)?e+"":e.toString()}}var Ke={exports:{}},He={exports:{}},Ge=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ze=Math.ceil,Ve=Math.floor,$e="[BigNumber Error] ",Xe=$e+"Number primitive has more than 15 significant digits: ",Qe=1e14,Ye=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ze=1e9;function et(e){var t=0|e;return e>0||e===t?t:t-1}function tt(e){for(var t,r,n=1,s=e.length,i=e[0]+"";n<s;){for(r=14-(t=e[n++]+"").length;r--;t="0"+t);i+=t}for(s=i.length;48===i.charCodeAt(--s););return i.slice(0,s+1||1)}function rt(e,t){var r,n,s=e.c,i=t.c,o=e.s,a=t.s,l=e.e,c=t.e;if(!o||!a)return null;if(r=s&&!s[0],n=i&&!i[0],r||n)return r?n?0:-a:o;if(o!=a)return o;if(r=o<0,n=l==c,!s||!i)return n?0:!s^r?1:-1;if(!n)return l>c^r?1:-1;for(a=(l=s.length)<(c=i.length)?l:c,o=0;o<a;o++)if(s[o]!=i[o])return s[o]>i[o]^r?1:-1;return l==c?0:l>c^r?1:-1}function nt(e,t,r,n){if(e<t||e>r||e!==Ve(e))throw Error($e+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function st(e){var t=e.c.length-1;return et(e.e/14)==t&&e.c[t]%2!=0}function it(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ot(e,t,r){var n,s;if(t<0){for(s=r+".";++t;s+=r);e=s+e}else if(++t>(n=e.length)){for(s=r,t-=n;--t;s+=r);e+=s}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var at,lt,ct=function e(t){var r,n,s,i,o,a,l,c,u,h,f=U.prototype={constructor:U,toString:null,valueOf:null},d=new U(1),p=20,g=4,m=-7,y=21,b=-1e7,w=1e7,_=!1,C=1,S=0,v={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz";function U(e,t){var r,i,o,a,l,c,u,h,f=this;if(!(f instanceof U))return new U(e,t);if(null==t){if(e&&!0===e._isBigNumber)return f.s=e.s,void(!e.c||e.e>w?f.c=f.e=null:e.e<b?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice()));if((c="number"==typeof e)&&0*e==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(a=0,l=e;l>=10;l/=10,a++);return void(a>w?f.c=f.e=null:(f.e=a,f.c=[e]))}h=String(e)}else{if(!Ge.test(h=String(e)))return s(f,h,c);f.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}(a=h.indexOf("."))>-1&&(h=h.replace(".","")),(l=h.search(/e/i))>0?(a<0&&(a=l),a+=+h.slice(l+1),h=h.substring(0,l)):a<0&&(a=h.length)}else{if(nt(t,2,T.length,"Base"),10==t)return O(f=new U(e),p+f.e+1,g);if(h=String(e),c="number"==typeof e){if(0*e!=0)return s(f,h,c,t);if(f.s=1/e<0?(h=h.slice(1),-1):1,U.DEBUG&&h.replace(/^0\.0*|\./,"").length>15)throw Error(Xe+e)}else f.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(r=T.slice(0,t),a=l=0,u=h.length;l<u;l++)if(r.indexOf(i=h.charAt(l))<0){if("."==i){if(l>a){a=u;continue}}else if(!o&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){o=!0,l=-1,a=0;continue}return s(f,String(e),c,t)}c=!1,(a=(h=n(h,t,10,f.s)).indexOf("."))>-1?h=h.replace(".",""):a=h.length}for(l=0;48===h.charCodeAt(l);l++);for(u=h.length;48===h.charCodeAt(--u););if(h=h.slice(l,++u)){if(u-=l,c&&U.DEBUG&&u>15&&(e>9007199254740991||e!==Ve(e)))throw Error(Xe+f.s*e);if((a=a-l-1)>w)f.c=f.e=null;else if(a<b)f.c=[f.e=0];else{if(f.e=a,f.c=[],l=(a+1)%14,a<0&&(l+=14),l<u){for(l&&f.c.push(+h.slice(0,l)),u-=14;l<u;)f.c.push(+h.slice(l,l+=14));l=14-(h=h.slice(l)).length}else l-=u;for(;l--;h+="0");f.c.push(+h)}}else f.c=[f.e=0]}function N(e,t,r,n){var s,i,o,a,l;if(null==r?r=g:nt(r,0,8),!e.c)return e.toString();if(s=e.c[0],o=e.e,null==t)l=tt(e.c),l=1==n||2==n&&(o<=m||o>=y)?it(l,o):ot(l,o,"0");else if(i=(e=O(new U(e),t,r)).e,a=(l=tt(e.c)).length,1==n||2==n&&(t<=i||i<=m)){for(;a<t;l+="0",a++);l=it(l,i)}else if(t-=o,l=ot(l,i,"0"),i+1>a){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=i-a)>0)for(i+1==a&&(l+=".");t--;l+="0");return e.s<0&&s?"-"+l:l}function k(e,t){for(var r,n=1,s=new U(e[0]);n<e.length;n++){if(!(r=new U(e[n])).s){s=r;break}t.call(s,r)&&(s=r)}return s}function I(e,t,r){for(var n=1,s=t.length;!t[--s];t.pop());for(s=t[0];s>=10;s/=10,n++);return(r=n+14*r-1)>w?e.c=e.e=null:r<b?e.c=[e.e=0]:(e.e=r,e.c=t),e}function O(e,t,r,n){var s,i,o,a,l,c,u,h=e.c,f=Ye;if(h){e:{for(s=1,a=h[0];a>=10;a/=10,s++);if((i=t-s)<0)i+=14,o=t,u=(l=h[c=0])/f[s-o-1]%10|0;else if((c=ze((i+1)/14))>=h.length){if(!n)break e;for(;h.length<=c;h.push(0));l=u=0,s=1,o=(i%=14)-14+1}else{for(l=a=h[c],s=1;a>=10;a/=10,s++);u=(o=(i%=14)-14+s)<0?0:l/f[s-o-1]%10|0}if(n=n||t<0||null!=h[c+1]||(o<0?l:l%f[s-o-1]),n=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(i>0?o>0?l/f[s-o]:0:h[c-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,n?(t-=e.e+1,h[0]=f[(14-t%14)%14],e.e=-t||0):h[0]=e.e=0,e;if(0==i?(h.length=c,a=1,c--):(h.length=c+1,a=f[14-i],h[c]=o>0?Ve(l/f[s-o]%f[o])*a:0),n)for(;;){if(0==c){for(i=1,o=h[0];o>=10;o/=10,i++);for(o=h[0]+=a,a=1;o>=10;o/=10,a++);i!=a&&(e.e++,h[0]==Qe&&(h[0]=1));break}if(h[c]+=a,h[c]!=Qe)break;h[c--]=0,a=1}for(i=h.length;0===h[--i];h.pop());}e.e>w?e.c=e.e=null:e.e<b&&(e.c=[e.e=0])}return e}function R(e){var t,r=e.e;return null===r?e.toString():(t=tt(e.c),t=r<=m||r>=y?it(t,r):ot(t,r,"0"),e.s<0?"-"+t:t)}return U.clone=e,U.ROUND_UP=0,U.ROUND_DOWN=1,U.ROUND_CEIL=2,U.ROUND_FLOOR=3,U.ROUND_HALF_UP=4,U.ROUND_HALF_DOWN=5,U.ROUND_HALF_EVEN=6,U.ROUND_HALF_CEIL=7,U.ROUND_HALF_FLOOR=8,U.EUCLID=9,U.config=U.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error($e+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(nt(r=e[t],0,Ze,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(nt(r=e[t],0,8,t),g=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(nt(r[0],-Ze,0,t),nt(r[1],0,Ze,t),m=r[0],y=r[1]):(nt(r,-Ze,Ze,t),m=-(y=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)nt(r[0],-Ze,-1,t),nt(r[1],1,Ze,t),b=r[0],w=r[1];else{if(nt(r,-Ze,Ze,t),!r)throw Error($e+t+" cannot be zero: "+r);b=-(w=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error($e+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw _=!r,Error($e+"crypto unavailable");_=r}else _=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(nt(r=e[t],0,9,t),C=r),e.hasOwnProperty(t="POW_PRECISION")&&(nt(r=e[t],0,Ze,t),S=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error($e+t+" not an object: "+r);v=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error($e+t+" invalid: "+r);T=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:g,EXPONENTIAL_AT:[m,y],RANGE:[b,w],CRYPTO:_,MODULO_MODE:C,POW_PRECISION:S,FORMAT:v,ALPHABET:T}},U.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!U.DEBUG)return!0;var t,r,n=e.c,s=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&s>=-Ze&&s<=Ze&&s===Ve(s)){if(0===n[0]){if(0===s&&1===n.length)return!0;break e}if((t=(s+1)%14)<1&&(t+=14),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=Qe||r!==Ve(r))break e;if(0!==r)return!0}}}else if(null===n&&null===s&&(null===i||1===i||-1===i))return!0;throw Error($e+"Invalid BigNumber: "+e)},U.maximum=U.max=function(){return k(arguments,f.lt)},U.minimum=U.min=function(){return k(arguments,f.gt)},U.random=(i=9007199254740992,o=Math.random()*i&2097151?function(){return Ve(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,s,i,a=0,l=[],c=new U(d);if(null==e?e=p:nt(e,0,Ze),s=ze(e/14),_)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(s*=2));a<s;)(i=131072*t[a]+(t[a+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[a]=r[0],t[a+1]=r[1]):(l.push(i%1e14),a+=2);a=s/2}else{if(!crypto.randomBytes)throw _=!1,Error($e+"crypto unavailable");for(t=crypto.randomBytes(s*=7);a<s;)(i=281474976710656*(31&t[a])+1099511627776*t[a+1]+4294967296*t[a+2]+16777216*t[a+3]+(t[a+4]<<16)+(t[a+5]<<8)+t[a+6])>=9e15?crypto.randomBytes(7).copy(t,a):(l.push(i%1e14),a+=7);a=s/7}if(!_)for(;a<s;)(i=o())<9e15&&(l[a++]=i%1e14);for(e%=14,(s=l[--a])&&e&&(i=Ye[14-e],l[a]=Ve(s/i)*i);0===l[a];l.pop(),a--);if(a<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=14);for(a=1,i=l[0];i>=10;i/=10,a++);a<14&&(n-=14-a)}return c.e=n,c.c=l,c}),U.sum=function(){for(var e=1,t=arguments,r=new U(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var s,i,o=[0],a=0,l=e.length;a<l;){for(i=o.length;i--;o[i]*=t);for(o[0]+=n.indexOf(e.charAt(a++)),s=0;s<o.length;s++)o[s]>r-1&&(null==o[s+1]&&(o[s+1]=0),o[s+1]+=o[s]/r|0,o[s]%=r)}return o.reverse()}return function(n,s,i,o,a){var l,c,u,h,f,d,m,y,b=n.indexOf("."),w=p,_=g;for(b>=0&&(h=S,S=0,n=n.replace(".",""),d=(y=new U(s)).pow(n.length-b),S=h,y.c=t(ot(tt(d.c),d.e,"0"),10,i,e),y.e=y.c.length),u=h=(m=t(n,s,i,a?(l=T,e):(l=e,T))).length;0==m[--h];m.pop());if(!m[0])return l.charAt(0);if(b<0?--u:(d.c=m,d.e=u,d.s=o,m=(d=r(d,y,w,_,i)).c,f=d.r,u=d.e),b=m[c=u+w+1],h=i/2,f=f||c<0||null!=m[c+1],f=_<4?(null!=b||f)&&(0==_||_==(d.s<0?3:2)):b>h||b==h&&(4==_||f||6==_&&1&m[c-1]||_==(d.s<0?8:7)),c<1||!m[0])n=f?ot(l.charAt(1),-w,l.charAt(0)):l.charAt(0);else{if(m.length=c,f)for(--i;++m[--c]>i;)m[c]=0,c||(++u,m=[1].concat(m));for(h=m.length;!m[--h];);for(b=0,n="";b<=h;n+=l.charAt(m[b++]));n=ot(n,u,l.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,s,i,o,a=0,l=e.length,c=t%1e7,u=t/1e7|0;for(e=e.slice();l--;)a=((s=c*(i=e[l]%1e7)+(n=u*i+(o=e[l]/1e7|0)*c)%1e7*1e7+a)/r|0)+(n/1e7|0)+u*o,e[l]=s%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var s,i;if(r!=n)i=r>n?1:-1;else for(s=i=0;s<r;s++)if(e[s]!=t[s]){i=e[s]>t[s]?1:-1;break}return i}function r(e,t,r,n){for(var s=0;r--;)e[r]-=s,s=e[r]<t[r]?1:0,e[r]=s*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,s,i,o,a){var l,c,u,h,f,d,p,g,m,y,b,w,_,C,S,v,T,N=n.s==s.s?1:-1,k=n.c,I=s.c;if(!(k&&k[0]&&I&&I[0]))return new U(n.s&&s.s&&(k?!I||k[0]!=I[0]:I)?k&&0==k[0]||!I?0*N:N/0:NaN);for(m=(g=new U(N)).c=[],N=i+(c=n.e-s.e)+1,a||(a=Qe,c=et(n.e/14)-et(s.e/14),N=N/14|0),u=0;I[u]==(k[u]||0);u++);if(I[u]>(k[u]||0)&&c--,N<0)m.push(1),h=!0;else{for(C=k.length,v=I.length,u=0,N+=2,(f=Ve(a/(I[0]+1)))>1&&(I=e(I,f,a),k=e(k,f,a),v=I.length,C=k.length),_=v,b=(y=k.slice(0,v)).length;b<v;y[b++]=0);T=I.slice(),T=[0].concat(T),S=I[0],I[1]>=a/2&&S++;do{if(f=0,(l=t(I,y,v,b))<0){if(w=y[0],v!=b&&(w=w*a+(y[1]||0)),(f=Ve(w/S))>1)for(f>=a&&(f=a-1),p=(d=e(I,f,a)).length,b=y.length;1==t(d,y,p,b);)f--,r(d,v<p?T:I,p,a),p=d.length,l=1;else 0==f&&(l=f=1),p=(d=I.slice()).length;if(p<b&&(d=[0].concat(d)),r(y,d,b,a),b=y.length,-1==l)for(;t(I,y,v,b)<1;)f++,r(y,v<b?T:I,b,a),b=y.length}else 0===l&&(f++,y=[0]);m[u++]=f,y[0]?y[b++]=k[_]||0:(y=[k[_]],b=1)}while((_++<C||null!=y[0])&&N--);h=null!=y[0],m[0]||m.splice(0,1)}if(a==Qe){for(u=1,N=m[0];N>=10;N/=10,u++);O(g,i+(g.e=u+14*c-1)+1,o,h)}else g.e=c,g.r=+h;return g}}(),a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,c=/^\.([^.]+)$/,u=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g,s=function(e,t,r,n){var s,i=r?t:t.replace(h,"");if(u.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(a,(function(e,t,r){return s="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=s?e:t})),n&&(s=n,i=i.replace(l,"$1").replace(c,"0.$1")),t!=i))return new U(i,s);if(U.DEBUG)throw Error($e+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new U(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return rt(this,new U(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,n,s,i=this;if(null!=e)return nt(e,0,Ze),null==t?t=g:nt(t,0,8),O(new U(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=14*((s=r.length-1)-et(this.e/14)),s=r[s])for(;s%10==0;s/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,t){return r(this,new U(e,t),p,g)},f.dividedToIntegerBy=f.idiv=function(e,t){return r(this,new U(e,t),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,s,i,o,a,l,c,u=this;if((e=new U(e)).c&&!e.isInteger())throw Error($e+"Exponent not an integer: "+R(e));if(null!=t&&(t=new U(t)),o=e.e>14,!u.c||!u.c[0]||1==u.c[0]&&!u.e&&1==u.c.length||!e.c||!e.c[0])return c=new U(Math.pow(+R(u),o?2-st(e):+R(e))),t?c.mod(t):c;if(a=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new U(NaN);(n=!a&&u.isInteger()&&t.isInteger())&&(u=u.mod(t))}else{if(e.e>9&&(u.e>0||u.e<-1||(0==u.e?u.c[0]>1||o&&u.c[1]>=24e7:u.c[0]<8e13||o&&u.c[0]<=9999975e7)))return i=u.s<0&&st(e)?-0:0,u.e>-1&&(i=1/i),new U(a?1/i:i);S&&(i=ze(S/14+2))}for(o?(r=new U(.5),a&&(e.s=1),l=st(e)):l=(s=Math.abs(+R(e)))%2,c=new U(d);;){if(l){if(!(c=c.times(u)).c)break;i?c.c.length>i&&(c.c.length=i):n&&(c=c.mod(t))}if(s){if(0===(s=Ve(s/2)))break;l=s%2}else if(O(e=e.times(r),e.e+1,1),e.e>14)l=st(e);else{if(0===(s=+R(e)))break;l=s%2}u=u.times(u),i?u.c&&u.c.length>i&&(u.c.length=i):n&&(u=u.mod(t))}return n?c:(a&&(c=d.div(c)),t?c.mod(t):i?O(c,S,g,undefined):c)},f.integerValue=function(e){var t=new U(this);return null==e?e=g:nt(e,0,8),O(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===rt(this,new U(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return rt(this,new U(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=rt(this,new U(e,t)))||0===t},f.isInteger=function(){return!!this.c&&et(this.e/14)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return rt(this,new U(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=rt(this,new U(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var r,n,s,i,o=this,a=o.s;if(t=(e=new U(e,t)).s,!a||!t)return new U(NaN);if(a!=t)return e.s=-t,o.plus(e);var l=o.e/14,c=e.e/14,u=o.c,h=e.c;if(!l||!c){if(!u||!h)return u?(e.s=-t,e):new U(h?o:NaN);if(!u[0]||!h[0])return h[0]?(e.s=-t,e):new U(u[0]?o:3==g?-0:0)}if(l=et(l),c=et(c),u=u.slice(),a=l-c){for((i=a<0)?(a=-a,s=u):(c=l,s=h),s.reverse(),t=a;t--;s.push(0));s.reverse()}else for(n=(i=(a=u.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(u[t]!=h[t]){i=u[t]<h[t];break}if(i&&(s=u,u=h,h=s,e.s=-e.s),(t=(n=h.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=Qe-1;n>a;){if(u[--n]<h[n]){for(r=n;r&&!u[--r];u[r]=t);--u[r],u[n]+=Qe}u[n]-=h[n]}for(;0==u[0];u.splice(0,1),--c);return u[0]?I(e,u,c):(e.s=3==g?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,t){var n,s,i=this;return e=new U(e,t),!i.c||!e.s||e.c&&!e.c[0]?new U(NaN):!e.c||i.c&&!i.c[0]?new U(i):(9==C?(s=e.s,e.s=1,n=r(i,e,0,3),e.s=s,n.s*=s):n=r(i,e,0,C),(e=i.minus(n.times(e))).c[0]||1!=C||(e.s=i.s),e)},f.multipliedBy=f.times=function(e,t){var r,n,s,i,o,a,l,c,u,h,f,d,p,g,m,y=this,b=y.c,w=(e=new U(e,t)).c;if(!(b&&w&&b[0]&&w[0]))return!y.s||!e.s||b&&!b[0]&&!w||w&&!w[0]&&!b?e.c=e.e=e.s=null:(e.s*=y.s,b&&w?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=et(y.e/14)+et(e.e/14),e.s*=y.s,(l=b.length)<(h=w.length)&&(p=b,b=w,w=p,s=l,l=h,h=s),s=l+h,p=[];s--;p.push(0));for(g=Qe,m=1e7,s=h;--s>=0;){for(r=0,f=w[s]%m,d=w[s]/m|0,i=s+(o=l);i>s;)r=((c=f*(c=b[--o]%m)+(a=d*c+(u=b[o]/m|0)*f)%m*m+p[i]+r)/g|0)+(a/m|0)+d*u,p[i--]=c%g;p[i]=r}return r?++n:p.splice(0,1),I(e,p,n)},f.negated=function(){var e=new U(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,s=n.s;if(t=(e=new U(e,t)).s,!s||!t)return new U(NaN);if(s!=t)return e.s=-t,n.minus(e);var i=n.e/14,o=e.e/14,a=n.c,l=e.c;if(!i||!o){if(!a||!l)return new U(s/0);if(!a[0]||!l[0])return l[0]?e:new U(a[0]?n:0*s)}if(i=et(i),o=et(o),a=a.slice(),s=i-o){for(s>0?(o=i,r=l):(s=-s,r=a),r.reverse();s--;r.push(0));r.reverse()}for((s=a.length)-(t=l.length)<0&&(r=l,l=a,a=r,t=s),s=0;t;)s=(a[--t]=a[t]+l[t]+s)/Qe|0,a[t]=Qe===a[t]?0:a[t]%Qe;return s&&(a=[s].concat(a),++o),I(e,a,o)},f.precision=f.sd=function(e,t){var r,n,s,i=this;if(null!=e&&e!==!!e)return nt(e,1,Ze),null==t?t=g:nt(t,0,8),O(new U(i),e,t);if(!(r=i.c))return null;if(n=14*(s=r.length-1)+1,s=r[s]){for(;s%10==0;s/=10,n--);for(s=r[0];s>=10;s/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},f.shiftedBy=function(e){return nt(e,-9007199254740991,9007199254740991),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,t,n,s,i,o=this,a=o.c,l=o.s,c=o.e,u=p+4,h=new U("0.5");if(1!==l||!a||!a[0])return new U(!l||l<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(l=Math.sqrt(+R(o)))||l==1/0?(((t=tt(a)).length+c)%2==0&&(t+="0"),l=Math.sqrt(+t),c=et((c+1)/2)-(c<0||c%2),n=new U(t=l==1/0?"5e"+c:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new U(l+""),n.c[0])for((l=(c=n.e)+u)<3&&(l=0);;)if(i=n,n=h.times(i.plus(r(o,i,u,1))),tt(i.c).slice(0,l)===(t=tt(n.c)).slice(0,l)){if(n.e<c&&--l,"9999"!=(t=t.slice(l-3,l+1))&&(s||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(O(n,n.e+p+2,1),e=!n.times(n).eq(o));break}if(!s&&(O(i,i.e+p+2,0),i.times(i).eq(o))){n=i;break}u+=4,l+=4,s=1}return O(n,n.e+p+1,g,e)},f.toExponential=function(e,t){return null!=e&&(nt(e,0,Ze),e++),N(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(nt(e,0,Ze),e=e+this.e+1),N(this,e,t)},f.toFormat=function(e,t,r){var n,s=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=v;else if("object"!=typeof r)throw Error($e+"Argument not an object: "+r);if(n=s.toFixed(e,t),s.c){var i,o=n.split("."),a=+r.groupSize,l=+r.secondaryGroupSize,c=r.groupSeparator||"",u=o[0],h=o[1],f=s.s<0,d=f?u.slice(1):u,p=d.length;if(l&&(i=a,a=l,l=i,p-=i),a>0&&p>0){for(i=p%a||a,u=d.substr(0,i);i<p;i+=a)u+=c+d.substr(i,a);l>0&&(u+=c+d.slice(i)),f&&(u="-"+u)}n=h?u+(r.decimalSeparator||"")+((l=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):u}return(r.prefix||"")+n+(r.suffix||"")},f.toFraction=function(e){var t,n,s,i,o,a,l,c,u,h,f,p,m=this,y=m.c;if(null!=e&&(!(l=new U(e)).isInteger()&&(l.c||1!==l.s)||l.lt(d)))throw Error($e+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+R(l));if(!y)return new U(m);for(t=new U(d),u=n=new U(d),s=c=new U(d),p=tt(y),o=t.e=p.length-m.e-1,t.c[0]=Ye[(a=o%14)<0?14+a:a],e=!e||l.comparedTo(t)>0?o>0?t:u:l,a=w,w=1/0,l=new U(p),c.c[0]=0;h=r(l,t,0,1),1!=(i=n.plus(h.times(s))).comparedTo(e);)n=s,s=i,u=c.plus(h.times(i=u)),c=i,t=l.minus(h.times(i=t)),l=i;return i=r(e.minus(n),s,0,1),c=c.plus(i.times(u)),n=n.plus(i.times(s)),c.s=u.s=m.s,f=r(u,s,o*=2,g).minus(m).abs().comparedTo(r(c,n,o,g).minus(m).abs())<1?[u,s]:[c,n],w=a,f},f.toNumber=function(){return+R(this)},f.toPrecision=function(e,t){return null!=e&&nt(e,1,Ze),N(this,e,t,2)},f.toString=function(e){var t,r=this,s=r.s,i=r.e;return null===i?s?(t="Infinity",s<0&&(t="-"+t)):t="NaN":(null==e?t=i<=m||i>=y?it(tt(r.c),i):ot(tt(r.c),i,"0"):10===e?t=ot(tt((r=O(new U(r),p+i+1,g)).c),r.e,"0"):(nt(e,2,T.length,"Base"),t=n(ot(tt(r.c),i,"0"),10,e,s,!0)),s<0&&r.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return R(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=t&&U.set(t),U}(),ut=d(Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",BigNumber:ct,default:ct}));at=ut,lt=He.exports,function(){var e,t,r,n=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function i(e){return n.lastIndex=0,n.test(e)?'"'+e.replace(n,(function(e){var t=s[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function o(n,s){var a,l,c,u,h,f=e,d=s[n],p=null!=d&&(d instanceof at||at.isBigNumber(d));switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(n)),"function"==typeof r&&(d=r.call(s,n,d)),typeof d){case"string":return p?d:i(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":case"bigint":return String(d);case"object":if(!d)return"null";if(e+=t,h=[],"[object Array]"===Object.prototype.toString.apply(d)){for(u=d.length,a=0;a<u;a+=1)h[a]=o(a,d)||"null";return c=0===h.length?"[]":e?"[\n"+e+h.join(",\n"+e)+"\n"+f+"]":"["+h.join(",")+"]",e=f,c}if(r&&"object"==typeof r)for(u=r.length,a=0;a<u;a+=1)"string"==typeof r[a]&&(c=o(l=r[a],d))&&h.push(i(l)+(e?": ":":")+c);else Object.keys(d).forEach((function(t){var r=o(t,d);r&&h.push(i(t)+(e?": ":":")+r)}));return c=0===h.length?"{}":e?"{\n"+e+h.join(",\n"+e)+"\n"+f+"}":"{"+h.join(",")+"}",e=f,c}}"function"!=typeof lt.stringify&&(lt.stringify=function(n,s,i){var a;if(e="",t="","number"==typeof i)for(a=0;a<i;a+=1)t+=" ";else"string"==typeof i&&(t=i);if(r=s,s&&"function"!=typeof s&&("object"!=typeof s||"number"!=typeof s.length))throw new Error("JSON.stringify");return o("",{"":n})})}();var ht=ut;const ft=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,dt=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;var pt=function(e){var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);t.constructorAction=e.constructorAction}if(void 0!==e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);t.protoAction=e.protoAction}}var r,n,s,i,o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},a=function(e){throw{name:"SyntaxError",message:e,at:r,text:s}},l=function(e){return e&&e!==n&&a("Expected '"+e+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},c=function(){var e,r="";for("-"===n&&(r="-",l("-"));n>="0"&&n<="9";)r+=n,l();if("."===n)for(r+=".";l()&&n>="0"&&n<="9";)r+=n;if("e"===n||"E"===n)for(r+=n,l(),"-"!==n&&"+"!==n||(r+=n,l());n>="0"&&n<="9";)r+=n,l();if(e=+r,isFinite(e))return null==ht&&(ht=ut),r.length>15?t.storeAsString?r:t.useNativeBigInt?BigInt(r):r:t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new ht(e):e;a("Bad number")},u=function(){var e,t,i,c="";if('"'===n)for(var u=r;l();){if('"'===n)return r-1>u&&(c+=s.substring(u,r-1)),l(),c;if("\\"===n){if(r-1>u&&(c+=s.substring(u,r-1)),l(),"u"===n){for(i=0,t=0;t<4&&(e=parseInt(l(),16),isFinite(e));t+=1)i=16*i+e;c+=String.fromCharCode(i)}else{if("string"!=typeof o[n])break;c+=o[n]}u=r}}a("Bad string")},h=function(){for(;n&&n<=" ";)l()};return i=function(){switch(h(),n){case"{":return function(){var e,r=Object.create(null);if("{"===n){if(l("{"),h(),"}"===n)return l("}"),r;for(;n;){if(e=u(),h(),l(":"),!0===t.strict&&Object.hasOwnProperty.call(r,e)&&a('Duplicate key "'+e+'"'),!0===ft.test(e)?"error"===t.protoAction?a("Object contains forbidden prototype property"):"ignore"===t.protoAction?i():r[e]=i():!0===dt.test(e)?"error"===t.constructorAction?a("Object contains forbidden constructor property"):"ignore"===t.constructorAction?i():r[e]=i():r[e]=i(),h(),"}"===n)return l("}"),r;l(","),h()}}a("Bad object")}();case"[":return function(){var e=[];if("["===n){if(l("["),h(),"]"===n)return l("]"),e;for(;n;){if(e.push(i()),h(),"]"===n)return l("]"),e;l(","),h()}}a("Bad array")}();case'"':return u();case"-":return c();default:return n>="0"&&n<="9"?c():function(){switch(n){case"t":return l("t"),l("r"),l("u"),l("e"),!0;case"f":return l("f"),l("a"),l("l"),l("s"),l("e"),!1;case"n":return l("n"),l("u"),l("l"),l("l"),null}a("Unexpected '"+n+"'")}()}},function(e,t){var o;return s=e+"",r=0,n=" ",o=i(),h(),n&&a("Syntax error"),"function"==typeof t?function e(r,n){var s,i=r[n];return i&&"object"==typeof i&&Object.keys(i).forEach((function(t){void 0!==(s=e(i,t))?i[t]=s:delete i[t]})),t.call(r,n,i)}({"":o},""):o}},gt=He.exports.stringify,mt=pt;Ke.exports=function(e){return{parse:mt(e),stringify:gt}},Ke.exports.parse=mt(),Ke.exports.stringify=gt;var yt=Ke.exports;class bt{constructor(e,n){t(this,"onHeart",(e=>{let t=this.createCommendJson("HB","");this.basews.sendMsg(t)})),t(this,"onOpen",(e=>{let t=this.param;(this.isRc||this.isReconnect)&&(t+="|qx1");let r={name:this.name,param:t,dev:this.dev},n=JSON.stringify(r),s=this.createCommendJson("UserInfo",n);this.basews.sendMsg(s)})),t(this,"onMessage",(e=>{let t=yt.parse(e.data),r=t.command,n=t.message;if("LoginRs"===r){let e=JSON.parse(n),t=e.code,r=e.desc,s=e.userid;this.onLoginRs(t,r,s),this.isReconnect=!0}else{let e=this.dataFormat.formatData(r,n);if(!e)return;"function"==typeof e.callback&&e.callback(e.data)}})),t(this,"onError",(e=>{console.log(e),r.d("RoomWS","room connect error"),r.showLog("reportDataWs roomconnect onError ")})),t(this,"onClose",(e=>{console.log(e),r.d("RoomWS","room connect close"),r.showLog("reportDataWs roomconnect onClose "),setTimeout((()=>{let e=this.getNextUrl();e&&(this.basews.wssUrl=e),this.basews.connect()}),1e3)})),this.name=n.name,this.param=n.param,this.dev=n.dev,this.basews=new je(e),f.isWx?this.basews=new Je(e):this.basews=new je(e),this.isRc=n.isRc||!1,this.onChatMsg=null,this.onLoginRs=null,this.dataFormat=new We,this.isReconnect=!1,this.getNextUrl=null}callbackobj(){return this.dataFormat}connect(){this.basews.onopen=this.onOpen,this.basews.onmessage=this.onMessage,this.basews.onerror=this.onError,this.basews.onclose=this.onClose,this.basews.onheart=this.onHeart,this.basews.connect()}release(){this.basews.release()}close(){this.basews.close()}createCommendJson(e,t){return{command:e,message:t}}pageShapesRq(e,t){let r={docId:e,pageId:t},n=JSON.stringify(r),s=this.createCommendJson("1004",n);this.basews.sendMsg(s)}userListRq(e){let t={lastTs:e},r=JSON.stringify(t),n=this.createCommendJson("49",r);this.basews.sendMsg(n)}userChatMgr(e,t,r){let n='{"teacherUserId":0,"studentUserId":'+t+',"chatStatus":'+r+"}",s=this.createCommendJson("27",n);this.basews.sendMsg(s)}kickoutUserRq(e,t){let r='{"mgrUserId":0,"studentUserId":'+t+"}",n=this.createCommendJson("28",r);this.basews.sendMsg(n)}getMasterToken(e){let t='{"userId":'+e+"}",r=this.createCommendJson("58",t);this.basews.sendMsg(r)}roomTransMessageRq(e,t,r,n){let s='{"srcUserId":'+e+',"dstUserId":'+t+',"messageType":'+r+',"messageRq":"'+(n=n.replace(/"/g,'\\"'))+'"}',i=this.createCommendJson("60",s);this.basews.sendMsg(i)}roomTransMessageRs(e,t,r,n){let s='{"srcUserId":'+e+',"dstUserId":'+t+',"messageType":'+r+',"messageRs":"'+(n=n.replace(/"/g,'\\"'))+'"}',i=this.createCommendJson("61",s);this.basews.sendMsg(i)}questionResult(e,t,r){let n={questionId:e,msgType:t,answerMultiple:r},s=JSON.stringify(n),i=this.createCommendJson("86",s);this.basews.sendMsg(i)}topTipMsgRq(e,t){let r={msgId:e,msgContent:JSON.stringify(t)},n=JSON.stringify(r),s=this.createCommendJson("97",n);this.basews.sendMsg(s)}topTipMsgDel(e){let t={msgId:e},r=JSON.stringify(t),n=this.createCommendJson("99",r);this.basews.sendMsg(n)}productListRq(e){let t={ts:e},r=JSON.stringify(t),n=this.createCommendJson("106",r);this.basews.sendMsg(n)}productUpRq(e){let t={productId:e.productId,productName:e.productName,productDesc:e.productDesc,productImgUrl:e.productImgUrl,productPrice:e.productPrice,productCount:e.productCount,productDetailUrl:e.productDetailUrl},r=JSON.stringify(t),n=this.createCommendJson("101",r);this.basews.sendMsg(n)}productDownBC(e){let t={productId:e},r=JSON.stringify(t),n=this.createCommendJson("103",r);this.basews.sendMsg(n)}lotteryMessageRq(e,t){let r={LotteryId:e,userCount:parseInt(t)},n=JSON.stringify(r),s=this.createCommendJson("89",n);this.basews.sendMsg(s)}lotteryResultRq(e){let t={LotteryId:e,exVal:0},r=JSON.stringify(t),n=this.createCommendJson("92",r);this.basews.sendMsg(n)}lotteryStop(e){let t={LotteryId:e,exVal:0},r=JSON.stringify(t),n=this.createCommendJson("107",r);this.basews.sendMsg(n)}assistantRecordRq(e,t){let r='{"teacherId":'+e+',"opType":'+t+"}",n=this.createCommendJson("108",r);this.basews.sendMsg(n)}chatAllMgr(e){let t={enable:!!e},r=JSON.stringify(t),n=this.createCommendJson("36",r);this.basews.sendMsg(n)}mediaPlayStart(e,t,r,n,s){let i={type:e,url:t,playTs:r,totalTs:n,name:s},o=JSON.stringify(i),a=this.createCommendJson("62",o);this.basews.sendMsg(a)}mediaPlayPause(e,t,r,n,s){let i={type:e,url:t,playTs:r,totalTs:n,name:s},o=JSON.stringify(i),a=this.createCommendJson("63",o);this.basews.sendMsg(a)}mediaPlayStop(e,t){let r={url:e,playTs:t},n=JSON.stringify(r),s=this.createCommendJson("64",n);this.basews.sendMsg(s)}adListRq(e){let t={ts:e},r=JSON.stringify(t),n=this.createCommendJson("146",r);this.basews.sendMsg(n)}adUpRq(e){let t={productId:e.productId,productName:e.productName,productDesc:e.productDesc,productImgUrl:e.productImgUrl,productPrice:e.productPrice,productCount:e.productCount,productDetailUrl:e.productDetailUrl},r=JSON.stringify(t),n=this.createCommendJson("141",r);this.basews.sendMsg(n)}adDownBC(e){let t={productId:e},r=JSON.stringify(t),n=this.createCommendJson("143",r);this.basews.sendMsg(n)}bigClassMediaInteractUserRs(e,t,r){let n='{"srcUserId":'+e+', "dstUserId":'+t+',"accept":'+r+"}",s=this.createCommendJson("126",n);this.basews.sendMsg(s)}bigClassUserHandUpRq(e){let t={handup:e},r=JSON.stringify(t),n=this.createCommendJson("123",r);this.basews.sendMsg(n)}bigClassUserMediaStatusSet(e,t,r){let n='{"userid":'+e+', "audio":'+t+',"video":'+r+"}",s=this.createCommendJson("128",n);this.basews.sendMsg(s)}roomSystemMsgNotify(e,t,r,n,s){let i={userid:e,name:t,type:r,msg:s},o={msgType:n,msgContent:JSON.stringify(i)},a=JSON.stringify(o),l=this.createCommendJson("150",a);this.basews.sendMsg(l)}}var wt={sessionid:0,token:"",init:function(e){this.token=e},error:function(e){this.report("logging.error",e)},trace:function(e){this.report("logging.trace",e)},info:function(e){this.report("logging.info",e)},warning:function(e){this.report("logging.warning",e)},report:function(e,t){if(this.token){"string"==typeof t&&(t={message:t});let n=o+"/replay/logging?token="+this.token+"&session_id="+this.sessionid;Me(n,{command:e,message:t}).then((e=>{0===e.code&&0===this.sessionid&&(this.sessionid=e.content.session_id)})),r.d("reportlog",this.sessionid,e,t)}},reqOriginDuration:function(e,t){let r=a+"/media/origin_duration?token="+this.token+"&url="+e;this.info("reqOriginDuration requestion url="+r),Be(r).then((e=>{this.info("reqOriginDuration response "+JSON.stringify(e)),0===e.code&&t&&t(e.content.origin_duration,e)})).catch((e=>{this.info("reqOriginDuration response error ")}))}};class _t extends class{constructor(e){this._CONNECT_TAG="Connect",this._urlIndex=0,this._wsName="",this._isRc=!1,this._token=e.token,this._name=e.name,this._wsurl=e.wsurl,this._wsName=e.wsname,this._isRc=e.isRc}connect(){this._queryProxy().then((()=>{r.d(this._CONNECT_TAG,"connect 获取prox 完成"),this._connectWs()}))}_getLine(){this._checkUrlIndex();let e="wss://"+this._lines[this._urlIndex].addr+"/"+this._getWsName();return this._urlIndex++,e}_checkUrlIndex(){(this._urlIndex>=this._lines.length||this._urlIndex<0)&&(this._urlIndex=0)}_queryProxy(){let e=this._token;return Ae.get(this._wsurl,{token:e}).then((e=>{let t=qe.decryptByEncryKey(e),n=JSON.parse(t);this._lines=n.serverlist,this._urlIndex=qe.randomNum(0,this._lines.length-1),r.d(this._CONNECT_TAG,"_queryProxy",this._lines,this._urlIndex)})).catch((t=>{r.e(this._CONNECT_TAG,"_queryProxy",t),wt.error("queryProxy error url="+this._wsurl+" token="+e)}))}_getWsName(){return this._wsName}getCurLine(){return this._checkUrlIndex(),"wss://"+this._lines[this._urlIndex].addr+"/"+this._getWsName()}}{constructor(e){super(e),this._TAG="RoomConnect",this._streamName=null,this._mediaType=0}setCallback(e){this._callback=e}_connectWs(){let e=this._getLine();r.d(this._TAG,e),r.d(this._TAG,"开始链接房间ws"),this.roomWs=new bt(e,{dev:"web",param:this._token,name:this._name,isRc:this._isRc}),this.roomWs.onLoginRs=this.onLoginRs.bind(this),this.roomWs.callbackobj().onUserChatMgr=this.onUserChatMgr.bind(this),this.roomWs.callbackobj().onKickoutUserRq=this.onKickoutUserRq.bind(this),this.roomWs.callbackobj().onDuplicateLoginKickOut=this.onDuplicateLoginKickOut.bind(this),this.roomWs.callbackobj().onChatAllMgr=this.onChatAllMgr.bind(this),this.roomWs.callbackobj().onTeacherUpMediaBC=this.onTeacherUpMediaBC.bind(this),this.roomWs.callbackobj().onTeacherDownMediaBC=this.onTeacherDownMediaBC.bind(this),this.roomWs.callbackobj().onUserNumberBC=this.onUserNumberBC.bind(this),this.roomWs.callbackobj().onRoomTransMessageRq=this.onRoomTransMessageRq.bind(this),this.roomWs.callbackobj().onTopTipMsgBC=this.onTopTipMsgBC.bind(this),this.roomWs.callbackobj().onTopTipMsgDel=this.onTopTipMsgDel.bind(this),this.roomWs.callbackobj().onLotteryNotify=this.onLotteryNotify.bind(this),this.roomWs.callbackobj().onLotteryResultRs=this.onLotteryResultRs.bind(this),this.roomWs.callbackobj().onLotteryStop=this.onLotteryStop.bind(this),this.roomWs.callbackobj().onCountDown=this.onCountDown.bind(this),this.roomWs.getNextUrl=this._getLine.bind(this),this.roomWs.callbackobj().onAdUpBC=this.onAdUpBC.bind(this),this.roomWs.callbackobj().onAdDownBC=this.onAdDownBC.bind(this),this.roomWs.connect()}onLoginRs(e,t,r){let n=0,s="";if("200"===e)n=0,s="登录成功",qe.isFunction(this._callback.onLocalUserInfo)&&this._callback.onLocalUserInfo(r);else if("701"===e)n=1,s="您被管理员限制登录";else if("900"===e)n=2,s="登录限制,超过课程预订最大人数限制";else{if("403"===e||"500"===e)return console.log("loginRs error",e),void this._forceReConnect();"406"===e&&(n=4,s="观看回放链接已超时")}qe.isFunction(this._callback.onConnectResult)&&this._callback.onConnectResult(n,s)}onUserChatMgr(e){qe.isFunction(this._callback.onUserChatMgr)&&this._callback.onUserChatMgr(1===e.chatStatus)}onKickoutUserRq(e){qe.isFunction(this._callback.onKickoutUserRq)&&this._callback.onKickoutUserRq()}onDuplicateLoginKickOut(e){qe.isFunction(this._callback.onDuplicateLoginKickOut)&&this._callback.onDuplicateLoginKickOut()}onChatAllMgr(e){qe.isFunction(this._callback.onChatAllMgr)&&this._callback.onChatAllMgr(e.enable)}onUserNumberBC(e){qe.isFunction(this._callback.onUserNumberBC)&&this._callback.onUserNumberBC(e.totalNumber)}onTeacherUpMediaBC(e){this._streamName=e.stream,this._mediaType=e.mediaType,qe.isFunction(this._callback.onTeaMediaUp)&&this._callback.onTeaMediaUp(e.stream,e.mediaType)}onTeacherDownMediaBC(e){this._streamName=null,qe.isFunction(this._callback.onTeaMediaDown)&&this._callback.onTeaMediaDown()}onRoomTransMessageRq(e){if(1e3===e.messageType)qe.isFunction(this._callback.onRoomTransMessageRq)&&this._callback.onRoomTransMessageRq(e.dstUserId,e.srcUserId);else if(1002===e.messageType)qe.isFunction(this._callback.getlinesRq)&&this._callback.getlinesRq(e.dstUserId,e.srcUserId);else if(1003===e.messageType){let t=JSON.parse(e.messageRq).lineId;qe.isFunction(this._callback.switchlinesRq)&&this._callback.switchlinesRq(e.dstUserId,e.srcUserId,t)}}onAdUpBC(e){qe.isFunction(this._callback.onAdUpBc)&&this._callback.onAdUpBc(e.productId,e.productName,e.productDesc,e.productImgUrl,e.productPrice,e.productCount,e.productDetailUrl)}onAdDownBC(e){qe.isFunction(this._callback.onAdDownBc)&&this._callback.onAdDownBc(e.productId)}_forceReConnect(){this.roomWs.close()}getStreamName(){return this._streamName}getMediaType(){return this._mediaType}transMessageRs(e,t,r,n){this.roomWs.roomTransMessageRs(e,t,r,n)}lotteryResultRq(e){this.roomWs.lotteryResultRq(e)}onTopTipMsgBC(e){qe.isFunction(this._callback.onTopTipMsgBC)&&this._callback.onTopTipMsgBC(e.msgId,e.msgContent)}onTopTipMsgDel(e){qe.isFunction(this._callback.onTopTipMsgDel)&&this._callback.onTopTipMsgDel(e.msgId)}onLotteryNotify(e){qe.isFunction(this._callback.onLotteryNotify)&&this._callback.onLotteryNotify(e.LotteryId)}onLotteryResultRs(e){qe.isFunction(this._callback.onLotteryResultRs)&&this._callback.onLotteryResultRs(e.result)}onLotteryStop(e){qe.isFunction(this._callback.onLotteryStop)&&this._callback.onLotteryStop(e.LotteryId)}onCountDown(e){qe.isFunction(this._callback.onCountDown)&&this._callback.onCountDown(e.totalTs,e.Status)}release(){this.roomWs.release()}}class Ct{constructor(e){this.replaysvr=e.replaysvr,this.replaypro=e.reportVodUrl,this.roomUrl=e.roomUrl,this.recordnotify=e.recordnotify,this.svrquery=e.svrquery,this.vodquery=e.vodquery,this.statusQuery=e.statusQuery,this.playreplaceset=e.playreplaceset?e.playreplaceset:{enable:!1,oldurl:"",newurl:""},this.playreplaceset.enable=!1,h.setPlayreplaceSet(this.playreplaceset),this.playerUrlList=e.playmediaLine.chromeLine}}class St{constructor(){this._duration=0,this._curIndex=0}get duration(){return this._duration}setPlayData(e){this._init(),this._playData=e,this._computeData()}getDataByNext(){if(this._curIndex<this._playData.length-1){if(this._curIndex++,this._curIndex>=this._playData.length)return null;let e=this._playData[this._curIndex],t=this._formatPlayUrl(e.cdn_url);return{seek:e.begin_time,url:t}}return null}getDataBySeek(e){let t=this._getPlayDataBySeek(e);if(!t)return null;let{realSeekTo:r,data:n,index:s}=t;return this._curIndex=s,{seek:r,url:this._formatPlayUrl(n.cdn_url)}}_getPlayDataBySeek(e){let t=0;for(let r=0;r<this._playData.length;r++){let n=this._playData[r];if(t+n.duration>=e)return{realSeekTo:e-t+n.begin_time,data:n,index:r};t+=n.duration}return null}getGlobalSeek(e){let t=0,r=this._playData[this._curIndex].begin_time;for(let s=0;s<this._curIndex;s++){t+=this._playData[s].duration}let n=e+t-r;return n<0&&(n=0),n}_init(){this._duration=0}_computeData(){for(let e=0;e<this._playData.length;e++){let t=this._playData[e];this._duration+=t.duration}}_formatPlayUrl(e){if(e.indexOf("_.m3u8")>-1){return e.replace("_.m3u8",".m3u8")}return e}}class vt{constructor(e){this.playerUrlList=e,this._initDefaultLine(),this._initCacheLine()}_initDefaultLine(){for(let e in this.playerUrlList)this.playerUrlList[e].selected=this.playerUrlList[e].default}_initCacheLine(){let e=Pe.getPlayLine();e&&this.setLineSelectedByKey(e)}setLineSelectedByKey(e){for(let t in this.playerUrlList){let r=this.playerUrlList[t];r.selected=r.key===e}}isExitKeyInLines(e){for(let t in this.playerUrlList)if(this.playerUrlList[t].key===e)return!0;return!1}_isSafeLine(e){return!!e&&!!e.safeline}skipToSafeLine(){for(let e in this.playerUrlList){let t=this.playerUrlList[e];t.safeline?t.selected=!0:t.selected=!1}}getSelectedLine(){for(let e in this.playerUrlList){let t=this.playerUrlList[e];if(t.selected)return t}return null}setSelectedFirstLine(){let e=!1;for(let t in this.playerUrlList){this.playerUrlList[t].selected=!e,e=!0}}getLineList(){let e=[];for(let t=0;t<this.playerUrlList.length;t++){let r=this.playerUrlList[t],n={id:r.key,name:r.title,selected:r.selected};e.push(n)}return e}}class Tt{constructor(e,t){this._timeFlag=null,this._TAG="MyTimer tag",this._interval=e,this._onTimer=t.onTimer}start(){this._timeFlag||(this.stop(),r.d(this._TAG,"start"),this._timeFlag=setInterval((()=>{this._onTimer&&this._onTimer()}),this._interval))}stop(){this._timeFlag&&(r.d(this._TAG,"stop"),clearInterval(this._timeFlag)),this._timeFlag=null}}var Ut={formatPlayData:function(e){let t=e.data,r=e.clip;if(t=this.fullPlayData(t),r){let e=[],{minTime:n,maxTime:s}=this.getPlayDataMinMaxTime(t),i=null,o=0;for(let a=n;a<=s;a++){let n=this.getPlayDataItemByTime(t,a);null!==n&&(null!=this.getClipByTime(r,a)?i=null:(null!==i&&i.stream===n.stream||(i={stream:n.stream,start_time:n.start_time,stop_time:n.stop_time,duration:0,cdn_url:n.cdn_url+"?v="+o,size:n.size,cutbegin_time:a,cutend_time:a,begin_time:a-n.start_time,end_time:0},e.push(i),o++),i.stream===n.stream&&(i.cutend_time=a,i.duration=i.cutend_time-i.cutbegin_time,i.end_time=i.begin_time+i.duration)))}return e}return t},isEqualPlayData:function(e,t){return e.stream===t.stream},getClipByTime:function(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(n.starttime<=t&&n.stoptime>=t)return n}return null},getPlayDataItemByTime:function(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(n.start_time<=t&&n.stop_time>=t)return n}return null},getPlayDataMinMaxTime:function(e){let t=9999999999,r=1e9;for(let n=0;n<e.length;n++){let s=e[n];s.start_time<t&&(t=s.start_time),s.stop_time>r&&(r=s.stop_time)}return{minTime:t,maxTime:r}},fullPlayData:function(e){for(let t=0;t<e.length;t++){let r=e[t];r.begin_time=0,r.end_time=r.stop_time-r.start_time,r.cutbegin_time=r.start_time,r.cutend_time=r.stop_time}return e}};class Nt{constructor(e,t,r){this.url=e,this.token=t,this.callback=r,this.resultData=null,this.lines=null,this.queryLine()}queryLine(){r.d("queryLine start"),Be(this.url+"/playbackqueryh5",{token:this.token}).then((e=>{if(e.code)return void this.callback(e.code,e.msg);let t=qe.decryptByEncryKeyForVod(e);r.d("queryLine",t),t=JSON.parse(t),t.hasOwnProperty("code")?this.callback(t.code,t.msg):(this.resultData=t.lines,r.d(this.resultData),this.formatLine(),this.callback(200,""))})).catch((e=>{wt.error("lineinfo playbackqueryh5 error url = "+this.url+"/playbackqueryh5?token="+this.token)}))}formatLine(){this.lines=[];for(let e=0;e<this.resultData.length;e++){let t={key:this.resultData[e].line,default:0===e,title:this.getLineIndexName(e),safeline:!0};this.lines.push(t)}this.hasDefaultTrue()||this.setFirstDefaultTrue()}setFirstDefaultTrue(){for(let e=0;e<this.lines.length;e++){return void(this.lines[e].default=!0)}}hasDefaultTrue(){let e=!1;for(let t=0;t<this.lines.length;t++){if(this.lines[t].default){e=!0;break}}return e}getLineIndexName(e){return 0===e?"线路一":1===e?"线路二":2===e?"线路三":3===e?"线路四":4===e?"线路五":5===e?"线路六":6===e?"线路七":7===e?"线路八":8===e?"线路九":9===e?"线路十":void 0}getLineData(e){for(let t=0;t<this.resultData.length;t++){let r=this.resultData[t];if(r.line===e)return r}return null}}var kt=function(e){return e.split("|")[5]};export default class{constructor(e){this._TAG="QXCPlayerSDK",this._proStr="",this._reportTime=6e4,this._curTime=0,console.log("QXCPlaySDK V1.0.0"),this._token=e.data.token,this._name=e.data.name,this._env=e.data.env,this._isRc=true,h.env=this._env,this._playerSDKCallback=e.playerCallback,f.isWx=e.data.isWx,this._classId=kt(this._token),this._reportTimer=new Tt(this._reportTime,{onTimer:this._onReportTime.bind(this)}),void 0===e.data.logLeve?r.level=r.NONE:r.level=e.data.logLeve,this._initData(),this._initListener()}_initData(){this._playerData=new St,this._curTime=0}setCurTime(e){this._curTime!==e&&(this._curTime=e,Pe.savePlayerTime(this._classId,this._curTime))}_initListener(){this._roomCallback={onLocalUserInfo:e=>{this._playerSDKCallback&&qe.isFunction(this._playerSDKCallback.onLocalUserInfo)&&this._playerSDKCallback.onLocalUserInfo(e)},onConnectResult:(e,t)=>{var r;this._playerSDKCallback&&(null==(r=this._playerSDKCallback)||r.onConnectResult(e,t)),(h.env===u||0===e)&&(this._reportTimer.start(),this._startMedia())},onDuplicateLoginKickOut:()=>{this._playerSDKCallback&&qe.isFunction(this._playerSDKCallback.onDuplicateLoginKickOut)&&this._playerSDKCallback.onDuplicateLoginKickOut()}}}connect(){r.d("正在获取配置..."),this._requeryConfig().then((()=>{this._connectRoom()}))}_queryPlayLines(){return new Promise(((e,t)=>{this._lineInfo=new Nt(this._config.vodquery,this._token,((r,n)=>{200===r?(this._config.playerUrlList=this._lineInfo.lines,e({})):(console.error(n),this._playerSDKCallback&&this._playerSDKCallback.onMediaError(r,n),t())}))}))}_requeryConfig(){return this._config?this._queryPlayLines().then((()=>{this._mediaUrlManager=new vt(this._config.playerUrlList),this._switchLineCallback()})):Ae.reqConfig().then((e=>(qe.isTypeString(e)&&(e=JSON.parse(e)),r.d("reqConfig resp",e),this._config=new Ct(e),this._queryPlayLines().then((()=>{this._mediaUrlManager=new vt(this._config.playerUrlList),this._switchLineCallback()}))))).catch((e=>{r.e(this._TAG,e)}))}_connectRoom(){r.d(this._TAG,"开始初始化房间"),this._roomConnect=new _t({token:this._token,name:this._name,wsurl:this._config.replaysvr,wsname:"replayproxy",isRc:this._isRc}),this._roomConnect.setCallback(this._roomCallback),this._roomConnect.connect()}_startMedia(){let e=this._mediaUrlManager.getSelectedLine();if(!e&&(this._mediaUrlManager.setSelectedFirstLine(),e=this._mediaUrlManager.getSelectedLine(),this._switchLineCallback(),!e))return;Pe.setPlayLine(e.key),this._queryPlayerData(e.key);let t=this._getPlayUrl();this._reqPlayPro().then((e=>{t?this._playerSDKCallback&&this._playerSDKCallback.onPlayUrl(t,e):this._playerSDKCallback&&this._playerSDKCallback.onPlayUrl("",e)}))}_queryPlayerData(e){let t=this._lineInfo.getLineData(e),r=Ut.formatPlayData(t);this._playerData.setPlayData(r),this._playerSDKCallback&&qe.isFunction(this._playerSDKCallback.onPlayerInfo)&&this._playerSDKCallback.onPlayerInfo(this._title,this._playerData.duration)}_startPlay(e=!0){r.d("testplaysdk _startPlay curTime = "+this._curTime);this._playerData.getDataBySeek(this._curTime)}_switchLineCallback(){this._playerSDKCallback&&qe.isFunction(this._playerSDKCallback.onLineList)&&this._playerSDKCallback.onLineList(this._mediaUrlManager.getLineList())}_playNext(){this._playerData.getDataByNext()}_reportPro(){if(0===this._curTime||!this._playerData||0===this._playerData.duration)return;let e=1*this._curTime/this._playerData.duration,t=e.toFixed(4);if(e>1&&(t="1.0000"),this._proStr===t)return;this._proStr=t;let n={token:this._token,progress:t,ts:this._curTime};r.d(this._TAG,"reportdata",n),Me(this._config.replaypro+"/replaypro",n)}_onReportTime(){this._reportPro()}_release(){this._roomConnect&&this._roomConnect.release(),this._reportTimer&&this._reportTimer.stop()}_getPlayUrl(){let e=this._playerData.getDataBySeek(0);if(e){let{url:t}=e;return t}return null}_reqPlayPro(){return new Promise(((e,t)=>{Be(this._config.statusQuery+"/statusquery",{token:this._token}).then((t=>{let r=t.ts,n=Pe.getProTime2(this._classId);e(n||r)}))}))}release(){this._release()}} |