@ylink-sdk/meeting 0.7.0-beta.2 → 0.7.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/meeting.cjs.prod.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t,e,s,r){return new(s||(s=Promise))((function(i,n){function o(t){try{c(r.next(t))}catch(e){n(e)}}function a(t){try{c(r.throw(t))}catch(e){n(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}))}function e(t){return{all:t=t||new Map,on:function(e,s){var r=t.get(e);r?r.push(s):t.set(e,[s])},off:function(e,s){var r=t.get(e);r&&(s?r.splice(r.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var r=t.get(e);r&&r.slice().map((function(t){t(s)})),(r=t.get("*"))&&r.slice().map((function(t){t(e,s)}))}}}Object.defineProperty(exports,"__esModule",{value:!0});var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",i=9007199254740991,n="[object Arguments]",o="[object Boolean]",a="[object Date]",c="[object Function]",u="[object GeneratorFunction]",d="[object Map]",l="[object Number]",p="[object Object]",h="[object Promise]",f="[object RegExp]",m="[object Set]",g="[object String]",v="[object Symbol]",x="[object WeakMap]",y="[object ArrayBuffer]",b="[object DataView]",I="[object Float32Array]",q="[object Float64Array]",E="[object Int8Array]",D="[object Int16Array]",$="[object Int32Array]",O="[object Uint8Array]",T="[object Uint8ClampedArray]",S="[object Uint16Array]",_="[object Uint32Array]",A=/\w*$/,U=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,w={};w[n]=w["[object Array]"]=w[y]=w[b]=w[o]=w[a]=w[I]=w[q]=w[E]=w[D]=w[$]=w[d]=w[l]=w[p]=w[f]=w[m]=w[g]=w[v]=w[O]=w[T]=w[S]=w[_]=!0,w["[object Error]"]=w[c]=w[x]=!1;var P="object"==typeof self&&self&&self.Object===Object&&self,C="object"==typeof s&&s&&s.Object===Object&&s||P||Function("return this")(),N=e&&!e.nodeType&&e,k=N&&t&&!t.nodeType&&t,L=k&&k.exports===N;function j(t,e){return t.set(e[0],e[1]),t}function M(t,e){return t.add(e),t}function H(t,e,s,r){var i=-1,n=t?t.length:0;for(r&&n&&(s=t[++i]);++i<n;)s=e(s,t[i],i,t);return s}function V(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(s){}return e}function B(t){var e=-1,s=Array(t.size);return t.forEach((function(t,r){s[++e]=[r,t]})),s}function G(t,e){return function(s){return t(e(s))}}function Y(t){var e=-1,s=Array(t.size);return t.forEach((function(t){s[++e]=t})),s}var W,F=Array.prototype,Q=Function.prototype,J=Object.prototype,z=C["__core-js_shared__"],K=(W=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",X=Q.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),st=L?C.Buffer:void 0,rt=C.Symbol,it=C.Uint8Array,nt=G(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=F.splice,ut=Object.getOwnPropertySymbols,dt=st?st.isBuffer:void 0,lt=G(Object.keys,Object),pt=kt(C,"DataView"),ht=kt(C,"Map"),ft=kt(C,"Promise"),mt=kt(C,"Set"),gt=kt(C,"WeakMap"),vt=kt(Object,"create"),xt=Vt(pt),yt=Vt(ht),bt=Vt(ft),It=Vt(mt),qt=Vt(gt),Et=rt?rt.prototype:void 0,Dt=Et?Et.valueOf:void 0;function $t(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var r=t[e];this.set(r[0],r[1])}}function Ot(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var r=t[e];this.set(r[0],r[1])}}function Tt(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var r=t[e];this.set(r[0],r[1])}}function St(t){this.__data__=new Ot(t)}function _t(t,e){var s=Gt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Yt(t)}(t)&&Z.call(t,"callee")&&(!at.call(t,"callee")||tt.call(t)==n)}(t)?function(t,e){for(var s=-1,r=Array(t);++s<t;)r[s]=e(s);return r}(t.length,String):[],r=s.length,i=!!r;for(var o in t)!e&&!Z.call(t,o)||i&&("length"==o||Mt(o,r))||s.push(o);return s}function At(t,e,s){var r=t[e];Z.call(t,e)&&Bt(r,s)&&(void 0!==s||e in t)||(t[e]=s)}function Ut(t,e){for(var s=t.length;s--;)if(Bt(t[s][0],e))return s;return-1}function Rt(t,e,s,r,i,h,x){var U;if(r&&(U=h?r(t,i,h,x):r(t)),void 0!==U)return U;if(!Qt(t))return t;var R=Gt(t);if(R){if(U=function(t){var e=t.length,s=t.constructor(e);e&&"string"==typeof t[0]&&Z.call(t,"index")&&(s.index=t.index,s.input=t.input);return s}(t),!e)return function(t,e){var s=-1,r=t.length;e||(e=Array(r));for(;++s<r;)e[s]=t[s];return e}(t,U)}else{var P=jt(t),C=P==c||P==u;if(Wt(t))return function(t,e){if(e)return t.slice();var s=new t.constructor(t.length);return t.copy(s),s}(t,e);if(P==p||P==n||C&&!h){if(V(t))return h?t:{};if(U=function(t){return"function"!=typeof t.constructor||Ht(t)?{}:(e=nt(t),Qt(e)?ot(e):{});var e}(C?{}:t),!e)return function(t,e){return Ct(t,Lt(t),e)}(t,function(t,e){return t&&Ct(e,Jt(e),t)}(U,t))}else{if(!w[P])return h?t:{};U=function(t,e,s,r){var i=t.constructor;switch(e){case y:return Pt(t);case o:case a:return new i(+t);case b:return function(t,e){var s=e?Pt(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.byteLength)}(t,r);case I:case q:case E:case D:case $:case O:case T:case S:case _:return function(t,e){var s=e?Pt(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.length)}(t,r);case d:return function(t,e,s){var r=e?s(B(t),!0):B(t);return H(r,j,new t.constructor)}(t,r,s);case l:case g:return new i(t);case f:return function(t){var e=new t.constructor(t.source,A.exec(t));return e.lastIndex=t.lastIndex,e}(t);case m:return function(t,e,s){var r=e?s(Y(t),!0):Y(t);return H(r,M,new t.constructor)}(t,r,s);case v:return n=t,Dt?Object(Dt.call(n)):{}}var n}(t,P,Rt,e)}}x||(x=new St);var N=x.get(t);if(N)return N;if(x.set(t,U),!R)var k=s?function(t){return function(t,e,s){var r=e(t);return Gt(t)?r:function(t,e){for(var s=-1,r=e.length,i=t.length;++s<r;)t[i+s]=e[s];return t}(r,s(t))}(t,Jt,Lt)}(t):Jt(t);return function(t,e){for(var s=-1,r=t?t.length:0;++s<r&&!1!==e(t[s],s,t););}(k||t,(function(i,n){k&&(i=t[n=i]),At(U,n,Rt(i,e,s,r,n,t,x))})),U}function wt(t){return!(!Qt(t)||(e=t,K&&K in e))&&(Ft(t)||V(t)?et:U).test(Vt(t));var e}function Pt(t){var e=new t.constructor(t.byteLength);return new it(e).set(new it(t)),e}function Ct(t,e,s,r){s||(s={});for(var i=-1,n=e.length;++i<n;){var o=e[i],a=r?r(s[o],t[o],o,s,t):void 0;At(s,o,void 0===a?t[o]:a)}return s}function Nt(t,e){var s,r,i=t.__data__;return("string"==(r=typeof(s=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==s:null===s)?i["string"==typeof e?"string":"hash"]:i.map}function kt(t,e){var s=function(t,e){return null==t?void 0:t[e]}(t,e);return wt(s)?s:void 0}$t.prototype.clear=function(){this.__data__=vt?vt(null):{}},$t.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},$t.prototype.get=function(t){var e=this.__data__;if(vt){var s=e[t];return s===r?void 0:s}return Z.call(e,t)?e[t]:void 0},$t.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:Z.call(e,t)},$t.prototype.set=function(t,e){return this.__data__[t]=vt&&void 0===e?r:e,this},Ot.prototype.clear=function(){this.__data__=[]},Ot.prototype.delete=function(t){var e=this.__data__,s=Ut(e,t);return!(s<0)&&(s==e.length-1?e.pop():ct.call(e,s,1),!0)},Ot.prototype.get=function(t){var e=this.__data__,s=Ut(e,t);return s<0?void 0:e[s][1]},Ot.prototype.has=function(t){return Ut(this.__data__,t)>-1},Ot.prototype.set=function(t,e){var s=this.__data__,r=Ut(s,t);return r<0?s.push([t,e]):s[r][1]=e,this},Tt.prototype.clear=function(){this.__data__={hash:new $t,map:new(ht||Ot),string:new $t}},Tt.prototype.delete=function(t){return Nt(this,t).delete(t)},Tt.prototype.get=function(t){return Nt(this,t).get(t)},Tt.prototype.has=function(t){return Nt(this,t).has(t)},Tt.prototype.set=function(t,e){return Nt(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new Ot},St.prototype.delete=function(t){return this.__data__.delete(t)},St.prototype.get=function(t){return this.__data__.get(t)},St.prototype.has=function(t){return this.__data__.has(t)},St.prototype.set=function(t,e){var s=this.__data__;if(s instanceof Ot){var r=s.__data__;if(!ht||r.length<199)return r.push([t,e]),this;s=this.__data__=new Tt(r)}return s.set(t,e),this};var Lt=ut?G(ut,Object):function(){return[]},jt=function(t){return tt.call(t)};function Mt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||R.test(t))&&t>-1&&t%1==0&&t<e}function Ht(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function Vt(t){if(null!=t){try{return X.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Bt(t,e){return t===e||t!=t&&e!=e}(pt&&jt(new pt(new ArrayBuffer(1)))!=b||ht&&jt(new ht)!=d||ft&&jt(ft.resolve())!=h||mt&&jt(new mt)!=m||gt&&jt(new gt)!=x)&&(jt=function(t){var e=tt.call(t),s=e==p?t.constructor:void 0,r=s?Vt(s):void 0;if(r)switch(r){case xt:return b;case yt:return d;case bt:return h;case It:return m;case qt:return x}return e});var Gt=Array.isArray;function Yt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}(t.length)&&!Ft(t)}var Wt=dt||function(){return!1};function Ft(t){var e=Qt(t)?tt.call(t):"";return e==c||e==u}function Qt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(t){return Yt(t)?_t(t):function(t){if(!Ht(t))return lt(t);var e=[];for(var s in Object(t))Z.call(t,s)&&"constructor"!=s&&e.push(s);return e}(t)}t.exports=function(t){return Rt(t,!0,!0)}}(r,r.exports);var i=r.exports;const n=t=>({get(e,s){if("__isProxy"===s)return!0;const r=Reflect.get(e,s);return Array.isArray(r)?r:"object"==typeof r&&null!==r?r.__isProxy?r:new Proxy(r,n(t)):r},set(e,s,r,n){const o=e[s];r=h(r)&&r.__isProxy?i(r):r;const a=Reflect.set(e,s,r,n);return((t,e)=>t!==e&&(t==t||e==e))(r,o)&&t.emit(`${y(s)}Change`,r),a}}),o=t=>encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]");class a{constructor(t){Object.defineProperty(this,"baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_beforeRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_errorHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.baseURL=t.baseURL,this._beforeRequest=t.beforeRequest,this._errorHandler=t.error}_request(t){const e=t.timeout||18e5;let s=t.headers||{};return t.url=E(this.baseURL,t.url||""),t.url=((t,e)=>{if(!e)return t;const s=[];Object.keys(e).forEach((t=>{const r=e[t];if(null==r)return;let i;Array.isArray(r)?(i=r,t+="[]"):i=[r],i.forEach((e=>{null!==e&&"object"==typeof e&&(e=JSON.stringify(e)),s.push(`${o(t)}=${o(e)}`)}))}));const r=s.join("&");if(r){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t})(t.url,t.params),s=Object.assign(s,this._defaultHeaders),Object.keys(s).forEach((t=>{"Content-Type"!==t&&t.toUpperCase()==="Content-Type".toUpperCase()&&(s["Content-Type"]=s[t],delete s[t])})),f(t.data)&&(t.data=t.data.buffer),m(t.data)&&(s&&!s["Content-Type"]&&(s["Content-Type"]="application/json;charset=utf-8"),t.data=JSON.stringify(t.data)),t.headers=s,t.timeout=e,this._beforeRequest&&this._beforeRequest(t),"undefined"!=typeof wx&&void 0!==wx.request?d(t):u(t)}setDefaultHeader(t,e){t in this._defaultHeaders&&(""===e||null===e)?delete this._defaultHeaders[t]:this._defaultHeaders[t]=e}get(t,e){return this._errorHandler?this._request(Object.assign(e||{},{url:t,method:"GET"})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(e||{},{url:t,method:"GET"}))}post(t,e,s){return this._errorHandler?this._request(Object.assign(s||{},{url:t,method:"POST",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(s||{},{url:t,method:"POST",data:e}))}put(t,e,s){return this._errorHandler?this._request(Object.assign(s||{},{url:t,method:"PUT",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(s||{},{url:t,method:"PUT",data:e}))}}class c{constructor(t){let e;Object.defineProperty(this,"promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.promise=new Promise((t=>{e=t})),t((t=>{this.reason||(this.reason=t,e(this.reason))}))}static source(){let t;const e=new c((e=>{t=e}));return{cancel:t,token:e}}}const u=t=>new Promise(((e,s)=>{const{data:r=null,url:i,method:n="GET",headers:o,cancelToken:a}=t;let c=new XMLHttpRequest;c.open(n.toUpperCase(),i,!0),c.timeout=t.timeout;const u=()=>{if(c){if(c.status>=200&&c.status<300)try{const t=JSON.parse(c.responseText);e(t)}catch(t){s(new Error("E_JSON_PARSE"+c.responseText))}else s({url:i,statusCode:c.status});c=null}};"onloadend"in c?c.onloadend=u:c.onreadystatechange=()=>{c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=()=>{c&&(s({url:i,statusCode:c.status,type:"request abort"}),c=null)},c.onerror=()=>{s(new Error("Network Error")),c=null},c.ontimeout=()=>{s(new Error("timeout of "+t.timeout+"ms exceeded")),c=null},"setRequestHeader"in c&&Object.keys(o).forEach((t=>{null===r&&"content-type"===t.toLowerCase()?delete o[t]:c.setRequestHeader(t,o[t])})),a&&a.promise.then((t=>{c&&(c.abort(),s(t),c=null)})),c.send(r)})),d=t=>new Promise(((e,s)=>{const{data:r=null,url:i,method:n="GET",headers:o,cancelToken:a}=t,c=wx.request({url:i,data:r,method:n.toUpperCase(),timeout:t.timeout,header:o,success(t){t.statusCode>=200&&t.statusCode<300?e(t.data):s({url:i,statusCode:t.statusCode})},fail(t){s("request:fail abort"===t.errMsg&&a&&a.reason||t)}});a&&a.promise.then((()=>{c&&c.abort()}))})),l=Array.isArray,p=t=>null==t,h=t=>"object"==typeof t&&null!==t,f=t=>{let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer,e},m=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},g=()=>{const t=[],e="0123456789abcdef";for(let s=0;s<36;s++)t[s]=e.substr(Math.floor(16*Math.random()),1);t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-";return t.join("").split("-").join("")},v=(t,e)=>t?(Object.entries(t).forEach((t=>{const[s,r]=[t[0],t[1]];if(null!==r)return h(r)&&!l(r)?(e[s]||(e[s]={}),void(e[s]=v(r,e[s]))):void(e[s]=r)})),e):e,x=/-(\w)/g,y=t=>t.replace(x,((t,e)=>e?e.toUpperCase():"")),{hasOwnProperty:b}=Object.prototype,I=(t,e)=>b.call(t,e),q=(t,e=new Map)=>{if(e.get(t))return e.get(t);if(!(t instanceof Object))return t;let s;s=t instanceof Array?[]:t instanceof Function?()=>t():t instanceof RegExp?new RegExp(t.source,t.flags):t instanceof Date?new Date(t):{},e.set(t,s);for(const r in t)I(t,r)&&(s[r]=q(t[r],e));return s},E=(t,e)=>t&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)?((t,e)=>e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t)(t,e):e,D=t=>{console.log(`computeNextTimeout attempts: ${t}`);let e=Math.floor(Math.random()*Math.pow(2,t)+1);return e<2&&(e=2),e>30&&(e=30),1e3*e};var $,O,T,S,_;exports.EVENT=void 0,($=exports.EVENT||(exports.EVENT={})).STATE="state",$.FAILED="failed",$.REQUEST_ERROR="requestError",$.POLLING_ERROR="pollingError",$.KEEPALIVE_ERROR="keepaliveError",exports.STATE=void 0,(O=exports.STATE||(exports.STATE={}))[O.CLOSE=0]="CLOSE",O[O.JOINED=1]="JOINED",O[O.READY=2]="READY",exports.ENDPOINT_TYPE=void 0,(T=exports.ENDPOINT_TYPE||(exports.ENDPOINT_TYPE={})).WEBAPP="webApp",T.WEBCTRL="webCtrl",T.WECHATMP="weChatMP",T.SUPERVISION="supervision",T.BIGSCREEN="bigScreen",T.DESKTOP="desktop",T.MOBILE="mobile",T.VCS="vcs",T.SIP="sip",T.H323="h323",T.PSTN="pstn",T.MULTI_STREAM="multiStream",T.MEETING_TOUCH="meetingTouch",T.MEETING_ROOMS="meetingRooms",T.RTSP="rtsp",T.RTMP_PULLER="rtmpPuller",T.GB28181="gb28181",T.TELE_PRESENCE="telePresence",exports.ROLE=void 0,(S=exports.ROLE||(exports.ROLE={})).HOST="host",S.COHOST="coHost",S.ATTENDEE="attendee",S.AUDIENCE="audience",exports.RECORD_STATUS=void 0,(_=exports.RECORD_STATUS||(exports.RECORD_STATUS={})).STARTED="started",_.PAUSED="paused",_.STARTING="starting",_.STOPPED="stopped";class A{constructor(t,s){Object.defineProperty(this,"moduleName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"emitter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"on",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"off",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.moduleName=s,this.ctx=t,this.emitter=e(),this.on=this.emitter.on,this.off=this.emitter.off,this.data=new Proxy({},n(this.emitter)),this._bindOn()}cleanup(){this.emitter.all=new Map,this.data=new Proxy({},n(this.emitter))}reactiveData(t){if(!h(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,r,i)=>{Object.keys(t).forEach((i=>{!1===r&&i in this.data&&(t[i]=this.data[i]);const n=e=>t[i]=e,o=`${y(i)}Change`;this.emitter.on(o,n),e.set(o,n),h(t[i])&&!l(t[i])&&s(t[i],!0)}))};return s(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}}class U extends A{constructor(t){super(t,"info")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingInfo",(t=>{const{state:e,body:s}=t;("full"===e||"update"===e)&&v(s,this.data)})),this.ctx.emitter.on("participantCount",(t=>{const{body:e}=t;v({participantCount:e},this.data)}))}subject(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/info/subject`,e)}))}practiceSession(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/info/practiceSession`)}))}shareInfo(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/shareInfo`,{params:t})}meetings(t){if(!t)return Promise.reject();const{prefix:{ctrl:e}}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings`,{params:t})}mailTemplate(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}mailTemplate`,{params:{meetingID:s},headers:{language:t.language}})}operateRecord(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/operationRecord`,t)}}function R(t){const e=[],{isInLobby:s}=t.modules.me.data;return s?(e.push("lobbyMember"),e):(Object.keys(t.modules).forEach((s=>{const r=t.modules[s]._topic();r&&(Array.isArray(r)?r.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(r)||e.push(r))})),e)}function w(e,s){return t(this,void 0,void 0,(function*(){const{meetingID:t,clientID:r}=s.config.request,i=yield s.request.post("/ypush/api/v1/meeting-control/inbox",{basic:{tenantId:100,clientId:r,meetingId:t},inboxes:e}),n=[];return i.data&&Object.keys(i.data).forEach((t=>{n.push({name:t,seqId:i.data[t].maxSeqId,limit:200})})),n}))}function P(e,s){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r,clientID:i}=s.config.request,n=yield s.request.post(`${t}meetings/${r}/subscribe`,{endpointID:i,topics:e}),o=n&&n.data&&n.data.eventMsgs;o&&o.forEach((t=>{s.emitter.emit(t.event,t)}))}))}function C(e,s,r){return t(this,void 0,void 0,(function*(){const{inboxes:i,clientID:n,meetingID:o,cancelToken:a,status:c}=s;if(yield(()=>t(this,void 0,void 0,(function*(){let t;try{t=yield e.post("/ypush/api/v1/meeting-control/polling",{basic:{tenantId:100,clientId:n,meetingId:o},inboxes:i},{cancelToken:a})}catch(d){return c.attempts++,void(d&&"request abort"!==d.type&&console.error(d))}if(!t)return console.error("polling error: ","response is null"),void c.attempts++;const{data:s={},bizCode:u,error:d}=t;if(u&&900408!==u)return console.error("polling error: ",JSON.stringify(d)),void c.attempts++;c.attempts=0,s&&Object.keys(s).forEach((t=>{const e=i.find((e=>e.name===t));e&&(e.seqId=s[t].maxSeqId,s[t].items&&s[t].items.forEach((t=>{const e=JSON.parse(t.content);["liveStream","recording"].includes(e.event)&&(e.stime=t.stime),e.pollingSeqId=t.seqId,r(e)})))}))})))(),!c.running)return;if(c.attempts>6)return console.error("polling Max Attempts"),void(s.onError&&s.onError({message:"polling Max Attempts"}));const u=c.attempts?D(c.attempts):0;c.timer=setTimeout((()=>{c.running&&C(e,s,r)}),u)}))}const N=(e,s)=>t(void 0,void 0,void 0,(function*(){const{meetingID:t,clientID:r}=s.config.request;s.status.polling.running=!0,C(s.request,{inboxes:e,clientID:r,meetingID:t,cancelToken:s.config.request.cancelToken.token,status:s.status.polling,onError:t=>{s.emitter.emit(exports.EVENT.POLLING_ERROR,t)}},(t=>{s.emitter.emit(t.event,t)}))}));function k(t){t.status.polling.running=!1,t.status.polling.attempts=0,t.status.polling.timer&&(clearTimeout(t.status.polling.timer),t.status.polling.timer=null),t.config.request.cancelToken.cancel(),t.config.request.cancelToken=c.source()}function L(e,s){return t(this,void 0,void 0,(function*(){const{meetingID:r,userID:i,status:n,cancelToken:o,onError:a}=s;if(n.timer&&(clearTimeout(n.timer),n.timer=null),yield(()=>t(this,void 0,void 0,(function*(){let t;try{t=yield e.post(`/meeting-ctrl/api/v1/meetings/${r}/users/${i}/keepalive`,{},{cancelToken:o.token})}catch(c){return n.attempts++,void console.error(c)}if(!t)return;const{data:s={},bizCode:a,error:c}=t;if(900200!==a&&900408!==a&&901323!==a)return n.attempts++,void console.error("keepalive ",a,c);const u=s.interval||"";if(!u)return n.attempts++,void console.error("keepalive ",a,c);n.interval=u,n.attempts=0})))(),!n.running)return;if(n.attempts>10)return console.error("keepalive Max Attempts"),void(a&&a({message:"keepalive Max Attempts"}));const c=n.attempts?D(n.attempts):1e3*n.interval;n.timer=setTimeout((()=>{n.running&&L(e,s)}),c)}))}function j(e){return t(this,void 0,void 0,(function*(){const{meetingID:t,userID:s}=e.config.request;e.status.keepalive.running=!0,L(e.request,{meetingID:t,userID:s,cancelToken:e.config.request.cancelToken.token,status:e.status.keepalive,onError:t=>{e.emitter.emit(exports.EVENT.KEEPALIVE_ERROR,t)}})}))}const M=t=>{t.status.keepalive.running=!1,t.status.keepalive.attempts=0,t.status.keepalive.timer&&(clearTimeout(t.status.keepalive.timer),t.status.keepalive.timer=null)};var H;exports.MeEvent=void 0,(H=exports.MeEvent||(exports.MeEvent={})).INIT="meInit",H.UPDATE="meUpdate",H.UPDATE_USER_STATE="updateUserState",H.ROLECHANGE="meRoleChange",H.AUDIOCHANGE="meAudioChange",H.HANDUPCHANGE="meHandupChange",H.SETAUDIO="setAudio",H.VIDEOCHANGE="meVideoChange",H.SETVIDEO="setVideo",H.SHARECHANGE="meShareChange",H.WHITEBOARDCHANGE="meWhiteBoardChange",H.DISPLAYNAMECHANGE="meDisplayNameChange",H.SPOTLIGHTVIDEOCHANGE="meSpotlightVideoChange",H.LOBBYCHANGE="meLobbyChange",H.BARRAGECHANGE="meBarrageChange",H.PERSONALLAYOUTCHANGE="personalLayoutChange",H.LEAVE="leave";class V extends A{constructor(t){super(t,"me")}_topic(){return""}_bindOn(){const e=e=>t(this,void 0,void 0,(function*(){if("role"in e&&e.role!==this.data.role){const t=this.data.role;v({role:e.role},this.data),e.role!==exports.ROLE.AUDIENCE&&t!==exports.ROLE.AUDIENCE||(yield this.rePolling("roleChange")),this.emitter.emit(exports.MeEvent.ROLECHANGE,e.role),this.ctx.emitter.emit(exports.MeEvent.ROLECHANGE,e.role)}})),s=t=>{var e,s,r,i,n,o;if("audio"in t){const{deviceOn:a,sendOn:c,recvOn:u,opBy:d}=t.audio;(!p(a)&&a!==(null===(e=this.data.audio)||void 0===e?void 0:e.deviceOn)||!p(c)&&c!==(null===(s=this.data.audio)||void 0===s?void 0:s.sendOn)||!p(u)&&c!==(null===(r=this.data.audio)||void 0===r?void 0:r.recvOn)||!p(d))&&(v({audio:t.audio},this.data),this.emitter.emit(exports.MeEvent.AUDIOCHANGE,{deviceOn:p(a)?null===(i=this.data.audio)||void 0===i?void 0:i.deviceOn:a,sendOn:p(c)?null===(n=this.data.audio)||void 0===n?void 0:n.sendOn:c,recvOn:p(c)?null===(o=this.data.audio)||void 0===o?void 0:o.recvOn:u,opBy:d,changeData:Object.assign({},t.audio)}))}},r=t=>{var e,s,r,i,n,o;if("video"in t){const{deviceOn:a,sendOn:c,opBy:u,blocked:d}=t.video;(!p(a)&&a!==(null===(e=this.data.video)||void 0===e?void 0:e.deviceOn)||!p(c)&&c!==(null===(s=this.data.video)||void 0===s?void 0:s.sendOn)||!p(d)&&d!==(null===(r=this.data.video)||void 0===r?void 0:r.blocked))&&(v({video:t.video},this.data),this.emitter.emit(exports.MeEvent.VIDEOCHANGE,{deviceOn:p(a)?null===(i=this.data.video)||void 0===i?void 0:i.deviceOn:a,sendOn:p(c)?null===(n=this.data.video)||void 0===n?void 0:n.sendOn:c,blocked:p(c)?null===(o=this.data.video)||void 0===o?void 0:o.blocked:d,opBy:u,changeData:Object.assign({},t.video)}))}},i=t=>{var e,s,r,i,n,o,a,c;if("share"in t){const{deviceOn:n,sendOn:o,opBy:a}=t.share;(!p(n)&&n!==(null===(e=this.data.share)||void 0===e?void 0:e.deviceOn)||!p(o)&&o!==(null===(s=this.data.share)||void 0===s?void 0:s.sendOn))&&(v({share:t.share},this.data),this.emitter.emit(exports.MeEvent.SHARECHANGE,{deviceOn:p(n)?null===(r=this.data.share)||void 0===r?void 0:r.deviceOn:n,sendOn:p(o)?null===(i=this.data.share)||void 0===i?void 0:i.sendOn:o,opBy:a}))}if("whiteboard"in t){const{deviceOn:e,sendOn:s,opBy:r}=t.whiteboard;(!p(e)&&e!==(null===(n=this.data.whiteboard)||void 0===n?void 0:n.deviceOn)||!p(s)&&s!==(null===(o=this.data.whiteboard)||void 0===o?void 0:o.sendOn))&&(v({whiteboard:t.whiteboard},this.data),this.emitter.emit(exports.MeEvent.WHITEBOARDCHANGE,{deviceOn:p(e)?null===(a=this.data.whiteboard)||void 0===a?void 0:a.deviceOn:e,sendOn:p(s)?null===(c=this.data.whiteboard)||void 0===c?void 0:c.sendOn:s,opBy:r}))}},n=t=>{t.displayName&&t.displayName!==this.data.displayName&&(v({displayName:t.displayName},this.data),this.data.displayNamePinyin=V.setDisplayNamePinyinProp?V.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.emitter.emit(exports.MeEvent.DISPLAYNAMECHANGE,t.displayName))},o=t=>{"isHandUp"in t&&t.isHandUp!==this.data.isHandUp&&(v({isHandUp:t.isHandUp},this.data),this.emitter.emit(exports.MeEvent.HANDUPCHANGE,t.isHandUp))},a=t=>{"isSpotlightVideo"in t&&(v({isSpotlightVideo:t.isSpotlightVideo},this.data),this.emitter.emit(exports.MeEvent.SPOTLIGHTVIDEOCHANGE,t.isSpotlightVideo))},c=e=>t(this,void 0,void 0,(function*(){if("isInLobby"in e&&e.isInLobby!==this.data.isInLobby){v({isInLobby:e.isInLobby},this.data);const t=!1===e.isInLobby?"inLobbyChange":void 0;yield this.rePolling(t),this.emitter.emit(exports.MeEvent.LOBBYCHANGE,e.isInLobby),this.ctx.emitter.emit(exports.MeEvent.LOBBYCHANGE,e.isInLobby)}})),u=e=>t(this,void 0,void 0,(function*(){const{event:t,state:s,body:r}=e;"personalLayout"===t&&("full"===s?v({personalLayout:r},this.data):"delete"===s&&(this.data.personalLayout=void 0),this.emitter.emit(exports.MeEvent.PERSONALLAYOUTCHANGE,this.data.personalLayout))})),d=t=>{if(!t.barrage)return;let e=null;if(!t.barrage.wordsDisplayStatus)return e=null,delete t.barrage,this.data.barrage=e||void 0,void this.emitter.emit(exports.MeEvent.BARRAGECHANGE,e);if(!t.barrage.receiver)return;const s={content:t.barrage.content,contentType:t.barrage.contentType,type:t.barrage.type,duration:t.barrage.duration,position:t.barrage.position};e=s;let{role:r}=this.data;if(this.data.endpointType===exports.ENDPOINT_TYPE.SUPERVISION){const{info:t}=this.ctx.modules;r="webinar"===t.meetingType?exports.ROLE.AUDIENCE:exports.ROLE.ATTENDEE}if(r===exports.ROLE.HOST||r===exports.ROLE.COHOST?e=t.barrage.receiver.host?s:null:r===exports.ROLE.ATTENDEE?e=t.barrage.receiver.attendee?s:null:r===exports.ROLE.AUDIENCE&&(e=t.barrage.receiver.audience?s:null),!e&&t.barrage.receiver.designated){const{userID:r,subjectID:i}=this.data,{designatedUsers:n}=t.barrage;e=-1!==n.findIndex((t=>t.userID===r||i&&t.subjectID===i))?s:null}delete t.barrage,this.data.barrage=e||void 0,this.emitter.emit(exports.MeEvent.BARRAGECHANGE,e)},l=t=>{"leave"in t&&!0===t.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),k(this.ctx),M(this.ctx),X(this.ctx),this.emitter.emit(exports.MeEvent.LEAVE,t.resultInfo),this.ctx.cleanup(t.resultInfo))},h=t=>{e(t),s(t),r(t),i(t),n(t),o(t),c(t),a(t),d(t),l(t),(this.data.isInLobby||this.data.role===exports.ROLE.AUDIENCE)&&this.data.share&&this.data.share.sendOn&&i({share:{deviceOn:!0,sendOn:!1,recvOn:!1}})};this.ctx.emitter.on(exports.MeEvent.INIT,(t=>{v(t,this.data),this.data.displayNamePinyin=V.setDisplayNamePinyinProp?V.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.data.isUpdatedUserState=!1})),this.ctx.emitter.on(exports.MeEvent.UPDATE,(t=>{h(t),v(t,this.data)})),this.ctx.emitter.on(exports.EVENT.STATE,(({state:t})=>{t===exports.STATE.READY&&this.data.endpointType!==exports.ENDPOINT_TYPE.SUPERVISION&&this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data})})),this.ctx.emitter.on("me",(e=>t(this,void 0,void 0,(function*(){const{state:t,body:s={users:[]}}=e;if("delete"===t){const t=s.users[0];return t.leave=!0,void l(t)}let r=s.users.find((t=>t.userID===this.data.userID));r||s.users.length&&(r=s.users[0]),r?(h(r),v(r,this.data)):console.warn("me ",t,s)})))),this.ctx.emitter.on("setUserVideo",(t=>{this.emitter.emit(exports.MeEvent.SETVIDEO,t.body)})),this.ctx.emitter.on("setUserAudio",(t=>{this.emitter.emit(exports.MeEvent.SETAUDIO,t.body)})),this.ctx.emitter.on("meetingState",(t=>{const{body:e={}}=t;if("ended"===e.state){l({leave:!0,resultInfo:e.resultInfo})}})),this.ctx.emitter.on("personalLayout",(t=>{u(t)}))}updateUserState(t,e=!1){if(!e){const{role:e,initialMediaState:s}=this.data;t.audio.sendOn=t.audio.sendOn&&s.audio.sendOn,t.video.sendOn=t.video.sendOn&&s.video.sendOn,e===exports.ROLE.AUDIENCE&&(t.audio.sendOn=!1,t.video.sendOn=!1)}const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,v(t,this.data),this.ctx.request.post(`${s}meetings/${r}/updateUserState`,t)}rePolling(e){return t(this,void 0,void 0,(function*(){const{ctx:t}=this;k(t);const s=R(t),r=yield w(s,t);if(e&&this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data,event:e}),yield P(s,t),"undefined"!=typeof Worker&&t.worker){const{meetingID:e,clientID:i,userID:n}=t.config.request;t.worker.postMessage({inboxes:r,topics:s,clientID:i,meetingID:e,userID:n,rePolling:!0})}else yield N(r,t)}))}}class B extends A{constructor(t){super(t,"invite")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("callRecord",(t=>{const{body:e,state:s}=t;if(e&&e.users){if("full"===s)return this.data.callRecordUsers=e.users.map((t=>(t.displayNamePinyin=B.setDisplayNamePinyinProp?B.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t))),void this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers);this.data.callRecordUsers||(this.data.callRecordUsers=[]),e.users.forEach((t=>{const e=this.data.callRecordUsers.findIndex((e=>t.inviteTransID===e.inviteTransID));"update"===s&&-1!==e?v(t,this.data.callRecordUsers[e]):"update"===s&&-1===e&&(t.displayNamePinyin=B.setDisplayNamePinyinProp?B.setDisplayNamePinyinProp(t.displayName||""):t.displayName,this.data.callRecordUsers.push(t))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}invite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/invite`,t)}cancelInvite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/cancelInvite`,t)}}class G extends A{constructor(t){super(t,"users"),this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[]}}_topic(){const{role:t,endpointType:e}=this.ctx.modules.me.data;return e===exports.ENDPOINT_TYPE.SUPERVISION?["interactive","broadcast"]:t===exports.ROLE.AUDIENCE?"interactive":["interactive","broadcast","lobby"]}_bindOn(){const t=(t,{event:e,state:s})=>{if(t.userID!==this.ctx.modules.me.data.userID)return;const{resultInfo:r={}}=t;if("delete"!==s||"delete"===s&&[901357,901358,901352,901351,901350,901349].includes(r.bizCode||-1))return void this.ctx.emitter.emit(exports.MeEvent.UPDATE,t);let i=!1;switch(e){case"interactiveUsers":t.isInLobby||(i=!0);break;case"broadcastUsers":t.isInLobby||t.role!==exports.ROLE.AUDIENCE||(i=!0);break;case"lobbyUsers":t.isInLobby&&(i=!0)}const n={};i&&(n.leave=!0),this.ctx.emitter.emit(exports.MeEvent.UPDATE,Object.assign(Object.assign({},t),n))},e=({updateUsers:e,state:s,sourceKey:r})=>{if("full"===s)return this.data[r]=e.map((e=>(e.displayNamePinyin=G.setDisplayNamePinyinProp?G.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=G.setUserGroupIDs?G.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,t(e,{event:r,state:s}),e))),this.emitter.emit(`${r}Change`,{users:this.data[r],isFull:!0}),this.data[r];void 0===this.data[r]&&(this.data[r]=[]);const{data:i,emitter:n}=this;return e.forEach((e=>{const o=i[r].findIndex((t=>e.userID===t.userID));if("delete"===s&&-1!==o){const[t]=this.data[r].splice(o,1);n.emit(`${r}Delete`,{user:t,resultInfo:e.resultInfo})}else if("update"===s&&-1!==o){const t=this.data[r][o];this.updateUserProps(e,t),v(e,t),this.data[r][o]=q(t),this.emitter.emit(`${r}Update`,{user:this.data[r][o]})}else"update"===s&&-1===o&&(e.displayNamePinyin=G.setDisplayNamePinyinProp?G.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=G.setUserGroupIDs?G.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,i[r].push(e),this.emitter.emit(`${r}Add`,{user:e,resultInfo:e.resultInfo}));t(e,{event:r,state:s})})),this.emitter.emit(`${r}Change`,{users:this.data[r],isFull:!1}),this.data[r]};this.ctx.emitter.on("interactiveUsers",(t=>{const{state:s,body:r}=t;e({updateUsers:r.users,state:s,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(t=>{const{state:s,body:r}=t;e({updateUsers:r.users,state:s,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(t=>{const{state:s,body:r}=t;e({updateUsers:r.users,state:s,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(t=>{const{state:s,body:r}=t;e({updateUsers:r.users,state:s,sourceKey:"advCtrlUsers"})}))}reactiveData(t){if(!h(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,r)=>{Object.keys(t).forEach((i=>{!1===r&&i in this.data&&(t[i]=this.data[i]);const n=e=>t[i]=e.users.map((t=>t)),o=`${y(i)}Change`;this.emitter.on(o,n),e.set(o,n),h(t[i])&&!l(t[i])&&s(t[i],!0)}))};return s(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}cleanup(){this.emitter.all=new Map,this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[]}}getUserByUserID(t){if(t)return this.data.interactiveUsers.concat(this.data.lobbyUsers).concat(this.data.broadcastUsers).concat(this.data.advCtrlUsers).find((t=>{}))}updateUserProps(t,e){!e&&t.userID&&(e=this.getUserByUserID(t.userID)),e&&t.groupName&&(e.groupName=t.groupName),e&&t.displayName&&t.displayName!==e.displayName&&(t.displayNamePinyin=G.setDisplayNamePinyinProp?G.setDisplayNamePinyinProp(t.displayName):t.displayName)}setAudio(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/audio`,e)}setVideo(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/video`,e)}setShare(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/share`,e)}setWhiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/whiteboard`,e)}handUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/handUp`,e)}setRole(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/role`,e)}rename(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/displayName`,e)}remove(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/remove`)}removeWithOption(t,e){if(!t)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/removeWithOption`,e)}replyHandUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/replyHandUp`,e)}fecc(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/fecc`,e)}lobbyState(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/lobbyState`,e)}allowLocalRecord(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/allowLocalRecord`,e)}allowUserChatOn(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/allowChat`,e)}whiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/whiteboard`,e)}callStats(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/users/${t}/callStats`)}callStatsReport(t){if(!t.userID)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t.userID}/callStats/report`,t)}replyAllHandUp(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/replyAllHandUp`)}admitAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/lobby/admitAll`)}refuseAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/lobby/refuseAll`)}getSendLayout(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/users/${t}/sendLayout`)}setSendLayout(t,e){const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/sendLayout`,e)}setSendLayoutEnabled(t,e){const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/sendLayoutEnabled`,e)}pauseAudio(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/pauseAudio`)}resumeAudio(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/resumeAudio`)}unblockVideo(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/unblockVideo`)}blockVideo(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/blockVideo`)}modifyRoleBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyRoleBatch `,t)}modifyVideoBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyVideoBatch `,t)}putInLobbyBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/putInLobbyBatch `,t)}removeBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/removeBatch `,t)}modifyAudioBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyAudioBatch`,t)}modifyUserAudioReceiveBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyUserAudioReceiveBatch`,t)}modifyUserVideoReceiveBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/unblockVideoBatch`,t)}modifyUserVideoPauseBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/blockVideoBatch`,t)}setIntercom(t,e){const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/intercom`,e)}claimHost(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/claimHost`,t)}}function Y(t){const{baseURL:s,modules:r,worker:i,singleton:n}=t;r.findIndex((t=>t===V))<0&&r.push(V),r.findIndex((t=>t===U))<0&&r.push(U);const o=t.clientID||`${g()}_${((t=new Date,e)=>{const s={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(const r in s)new RegExp("("+r+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?s[r]:("00"+s[r]).substr((""+s[r]).length)));return e})(new Date,"MMddHHmmss")}`,u={config:{baseURL:s,modules:r,singleton:n||!1,request:{cancelToken:c.source(),prefix:{ctrl:"/meeting-ctrl/api/v1/",conference:"/conference-manager/api/v1/",user:"/user-manager/api/v1/",vote:"/vote/api/v1/"},clientID:o,location:"",meetingID:"",ctrlID:"",sessionID:"",userID:-1,voteTk:""}},worker:i,emitter:e(),request:new a({baseURL:s,beforeRequest:t=>{t.headers["X-Y-Request-Id"]=g(),t.timeout=18e5},error:t=>{u.emitter.emit(exports.EVENT.REQUEST_ERROR,t)}}),modules:{},state:exports.STATE.CLOSE,status:{polling:{running:!1,attempts:0,timer:null},keepalive:{running:!1,attempts:0,timer:null,interval:20}},cleanup:t=>{u.state!==exports.STATE.CLOSE&&(u.worker&&u.worker.terminate(),u.config.request.location="",u.config.request.meetingID="",u.config.request.ctrlID="",u.config.request.sessionID="",u.config.request.userID=-1,u.config.request.voteTk="",u.status.polling={running:!1,attempts:0,timer:null},u.status.keepalive={running:!1,attempts:0,timer:null,interval:20},u.request.setDefaultHeader("X-Y-Location",""),u.request.setDefaultHeader("X-Y-Ctrl-Id",""),u.request.setDefaultHeader("X-Y-Session-Id",""),Object.keys(u.modules).forEach((t=>{u.modules[t].cleanup()})),u.state=exports.STATE.CLOSE,u.emitter.emit(exports.EVENT.STATE,{state:u.state,reason:t}))}};return u}function W(t){const e=Y(t);return e.worker&&("undefined"!=typeof Worker?e.worker.postMessage({baseURL:e.config.baseURL}):console.error("The current environment does not support worker")),function(t,e){if(!l(t))return void console.error("The modules parameter requires an array type");t.forEach((t=>{const s=new t(e);e.modules[s.moduleName]=s}))}(e.config.modules,e),e.emitter.on(exports.EVENT.POLLING_ERROR,(t=>{Q(e)({resultInfo:t})})),e.emitter.on(exports.EVENT.KEEPALIVE_ERROR,(t=>{Q(e)({resultInfo:t})})),Object.assign({config:e.config,request:e.request,get state(){return e.state},on:e.emitter.on,off:e.emitter.off,join:F(e),leave:Q(e),end:J(e),endMeeting:z(e)},e.modules)}function F(e){return function(s){var r;return t(this,void 0,void 0,(function*(){const{clientID:t}=e.config.request,i=`${null===(r=s.endpointType)||void 0===r?void 0:r.toLocaleUpperCase()}${t}_${s.meetingNum}`;e.config.request.sessionID=i,e.request.setDefaultHeader("X-Y-Session-Id",i),e.request.setDefaultHeader("X-Y-Location","");const{prefix:n}=e.config.request,o=yield e.request.get(`${n.ctrl}credential`,{params:{meetingNum:s.meetingNum,pwd:s.pwd,url:s.url,mobileCode:s.mobileCode,mobile:s.mobile,regEmail:s.regEmail,accEmail:s.accEmail,tk:s.tk,displayName:s.displayName,userAgent:s.userAgent,verifyID:s.verifyID},headers:{"X-Y-Endpoint-Type":s.endpointType}}),{credential:a="",location:c=""}=o&&o.data||{};if(e.config.request.location=c,e.request.setDefaultHeader("X-Y-Location",c),!a)return e.emitter.emit(exports.EVENT.FAILED,{bizCode:o.bizCode,data:o.data}),o;delete s.pwd,delete s.url;const u={displayName:s.displayName,userAgent:s.userAgent,clientID:t};s.groupIDs&&s.account&&(u.groupIDs=s.groupIDs,u.account=s.account,u.groupName=s.groupName),s.mediaContentReq&&(u.mediaContentReq=s.mediaContentReq);const d=s.hostKey?`&hostKey=${s.hostKey}`:"",l=yield e.request.post(`${n.ctrl}join?meetingNum=${s.meetingNum}&credential=${a}${d}`,u,{headers:{"X-Y-Endpoint-Type":s.endpointType,"X-Y-Endpoint-Id":t}});if(!l||l&&l.ret<=-1)return e.emitter.emit(exports.EVENT.FAILED,{bizCode:l.bizCode,data:l.data}),l;const{meetingID:p="",ctrlID:h="",user:f={},mediaContent:m={},initialMediaState:g={},tk:v=""}=l.data;e.config.request.meetingID=p,e.config.request.ctrlID=h,e.config.request.userID=f.userID,e.config.request.voteTk=v,e.request.setDefaultHeader("X-Y-Ctrl-Id",h),e.emitter.emit(exports.MeEvent.INIT,Object.assign(Object.assign({},f),{mediaContent:m,initialMediaState:g})),e.state=exports.STATE.JOINED,e.emitter.emit(exports.EVENT.STATE,{state:e.state});const x=()=>{e.state!==exports.STATE.READY&&(e.state=exports.STATE.READY,e.emitter.emit(exports.EVENT.STATE,{state:e.state}))},y=R(e),b=yield w(y,e);return yield P(y,e),"undefined"!=typeof Worker&&e.worker?(e.status.polling.running=!0,e.status.keepalive.running=!0,e.worker.postMessage({ctrlID:h,location:c,sessionID:i,inboxes:b,topics:y,clientID:t,meetingID:p,userID:f.userID,status:!0}),e.worker.onmessage=t=>{"pollingStarted"!==t.data?"keepaliveStarted"!==t.data&&("pollingStopped"!==t.data?"keepaliveStopped"!==t.data?"pollingError"!==t.data?"keepaliveError"!==t.data?e.emitter.emit(t.data.event,t.data):Q(e)({resultInfo:{message:"keepalive Max Attempts"}}):Q(e)({resultInfo:{message:"polling Max Attempts"}}):e.status.keepalive.running=!1:e.status.polling.running=!1):x()}):(N(b,e),x(),j(e)),l.data=Object.assign(Object.assign({},l.data),o.data),l}))}}function Q(e){return function(s){return t(this,void 0,void 0,(function*(){const t=s&&s.resultInfo;s||(s={resultInfo:{bizCode:901359}});const{prefix:r,meetingID:i}=e.config.request;let n;try{n=yield e.request.post(`${r.ctrl}meetings/${i}/leave`,s)}catch(o){console.error(o)}return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1}),k(e),M(e),X(e),e.cleanup(t),n}))}}function J(e){return function(){return t(this,void 0,void 0,(function*(){const{prefix:t,meetingID:s}=e.config.request,r=yield e.request.post(`${t.ctrl}meetings/${s}/end`);return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1}),k(e),M(e),X(e),e.cleanup(),r}))}}function z(e){return function(s){return t(this,void 0,void 0,(function*(){const{prefix:t}=e.config.request;return yield e.request.post(`${t.ctrl}meetingNum/${s}/end`)}))}}class K{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=W(t)}static getInstance(t){return this.instance?this.instance:this.instance=new K(t)}}function X(t){if(t.config.singleton){const{baseURL:e,modules:s,singleton:r}=t.config,i={baseURL:e,modules:s,worker:t.worker,singleton:r},n=K.getInstance(i);n&&(n.meeting=W(i))}}Object.defineProperty(K,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null}),exports.Asr=class extends A{constructor(t){super(t,"asr")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("asr",(t=>{const{body:e}=t;void 0===this.data.asr&&(this.data.asr={status:"stopped"}),e.resultInfo&&(this.emitter.emit("resultInfoChange",e.resultInfo),delete e.resultInfo),v(e,this.data.asr),e.resultInfo&&this.emitter.emit("resultInfoChange",e.resultInfo),this.emitter.emit("asrChange",{asr:this.data.asr,changeData:e})}))}cleanup(){this.emitter.all=new Map}transcriptStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/transcript/status`,e)}))}},exports.AudioRecording=class extends A{constructor(t){super(t,"audioRecording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("audioRecording",(t=>{const{body:e,stime:s}=t;e&&(s&&(this.data.stime=s,this.data.timeOffset=s-(new Date).valueOf()),this.data.audioRecording=Object.assign(Object.assign({},this.data.audioRecording||{}),e),e.status&&(this.data.audioRecording.requesting="starting"===e.status,this.data.status="starting"!==e.status?e.status:this.data.status),e.resultInfo&&this.emitter.emit("resultInfoChange",e.resultInfo))}))}history(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/audioRecording/history`)}))}status(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/audioRecording/status`,e)}))}},exports.Chat=class extends A{constructor(t){super(t,"chat")}_topic(){return"chat"}_bindOn(){this.ctx.emitter.on("chatMsg",(t=>{const{body:e}=t;this.emitter.emit("chatMsg",e)}))}msg(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/chat/msg`,e)}))}historyMsg(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/chat/historyMsg`,e)}))}},exports.FocusUsers=class extends A{constructor(t){super(t,"focusUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("focusUsers",(t=>{const{state:e,body:s}=t;if(s)return this.data.focusUsers||(this.data.focusUsers=[]),"full"===e?this.data.focusUsers=s.focusUsers:"update"===e?this.data.focusUsers=this.data.focusUsers.concat(s.focusUsers):"delete"===e&&(s.focusUsers.forEach((t=>{let e=-1;t.subjectID?e=this.data.focusUsers.findIndex((e=>e.subjectID===t.subjectID)):t.userID&&(e=this.data.focusUsers.findIndex((e=>e.userID===t.userID))),-1!==e&&this.data.focusUsers.splice(e,1)})),this.data.focusUsers=this.data.focusUsers.map((t=>t))),this.emitter.emit("focusUsersChange",this.data.focusUsers),this.data}))}setFocusUsers(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/focusUser`,t)}},exports.Info=U,exports.Interpretation=class extends A{constructor(t){super(t,"interpretation"),this.data={status:"stopped",interpreters:[]}}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("interpretation",(t=>{const{body:e,state:s}=t;"full"===s?(this.data.interpreters=e.interpreters,this.data.status=e.status):this.data.status=e.status,this.emitter.emit("interpretationChange",this.data)}))}interpretationStart(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/interpretation/start`,t)}interpretationEnd(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/interpretation/stop`)}},exports.Invite=B,exports.LiveStream=class extends A{constructor(t){super(t,"liveStream")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStream",(t=>{const{state:e,body:s,stime:r}=t;if(!s)return;if(r&&(this.data.stime=r,this.data.timeOffset=r-(new Date).valueOf()),"full"===e){const{liveStreams:t=[]}=s;if(!t.length)return;const e=[];this.data.liveStreams=t.map((t=>(t.requesting="starting"===t.status,t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo}),e.push({platform:t.platform||"",status:(t.requesting?"stopped":t.status)||""}),t)));return v({status:e},this.data),this.data}void 0===this.data.liveStreams&&(this.data.liveStreams=[]);const{liveStreams:i=[]}=s;return i.forEach((t=>{t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo});let e=this.data.liveStreams.findIndex((e=>e.platform===t.platform));-1===e?(t.requesting="starting"===t.status,this.data.liveStreams.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreams[e]),t),this.data.liveStreams.splice(e,1,t));const s=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.platform===t.platform)),-1===e?s.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||""}):s.splice(e,1,{platform:s[e].platform||"",status:t.requesting?s[e].status||"stopped":t.status||""}),this.data.status=s})),this.data}))}setStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/status`,e)}))}liveStreamDescription(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/description`,e)}))}liveStreamSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/setting`,e)}))}liveStreamLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/layout`,e)}))}liveStreamAllow(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/liveStream/allow`)}))}pushSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/pushSetting`,e)}))}},exports.LiveStreaming=class extends A{constructor(t){super(t,"liveStreaming")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStreaming",(t=>{const{state:e,body:s,stime:r}=t;if(!s)return;if(r&&(this.data.stime=r,this.data.timeOffset=r-(new Date).valueOf()),"full"===e){const{liveStreaming:t=[],defaultConfig:e}=s;if(!t.length)return;const r=[],i=[];return t.forEach((t=>{t.audioDesignate||(t.requesting="starting"===t.status,t.resultInfo&&this.emitter.emit("resultInfoChange",{index:t.index,protocol:t.protocol,resultInfo:t.resultInfo}),r.push({index:t.index,protocol:t.protocol,status:(t.requesting?"stopped":t.status)||""}),i.push(t))})),this.data.liveStreaming=i,v({status:r,defaultConfig:e},this.data),this.data}if("delete"===e){const{liveStreaming:t=[]}=s;return t.forEach((t=>{const e=this.data.liveStreaming.findIndex((e=>e.protocol===t.protocol&&e.index===t.index));-1!==e&&this.data.liveStreaming.splice(e,1)})),void this.emitter.emit("liveStreamingChange",this.data.liveStreaming)}void 0===this.data.liveStreaming&&(this.data.liveStreaming=[]);const{liveStreaming:i=[],defaultConfig:n}=s;return i.forEach((t=>{if(t.audioDesignate)return;t.resultInfo&&this.emitter.emit("resultInfoChange",{index:t.index,protocol:t.protocol,resultInfo:t.resultInfo});let e=this.data.liveStreaming.findIndex((e=>e.index===t.index));-1===e?(t.requesting="starting"===t.status,this.data.liveStreaming.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreaming[e]),t),this.data.liveStreaming.splice(e,1,t));const s=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.index===t.index)),-1===e?s.push({index:t.index,protocol:t.protocol,status:t.requesting?"stopped":t.status}):s.splice(e,1,{index:t.index,protocol:t.protocol,status:t.requesting?s[e].status||"stopped":t.status}),this.data.status=s})),n&&v({defaultConfig:n},this.data),this.emitter.emit("liveStreamingChange",this.data.liveStreaming),this.data}))}setStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/status`,e)}))}liveStreamingSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/setting`,e)}))}liveStreamingDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/delete`,e)}))}liveStreamingDetail(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/detail`,e)}))}},exports.Me=V,exports.Qa=class extends A{constructor(t){super(t,"qa"),this.data={questions:new Map,topSort:0}}_topic(){return"qa"}_bindOn(){this.ctx.emitter.on("qa",(t=>{const{body:e}=t;h(e)&&!l(e)?this.qaUpdate(this.data.questions,e):e.forEach((t=>this.qaUpdate(this.data.questions,t)))}))}cleanup(){this.data={questions:new Map,topSort:0}}qaUpdate(t,e){let s=t.get(e.question.id);const{clientID:r}=this.ctx.config.request;switch(e.command){case"addQuestion":s=this.createQuestion(e.question),t.set(e.question.id,s),this.emitter.emit("questionAdd",{question:s,selfSent:s.sender.endpointID===r});break;case"dismissQuestion":if(!s)break;s.sender.endpointID!==r?s.status="close":s.isTop=!1,t.set(e.question.id,s),this.emitter.emit("questionUpdate",{question:s});break;case"reopenQuestion":s?(s.status="open",s.isTop=e.question.isTop,t.set(e.question.id,s)):(s=this.createQuestion(e.question),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"updateQuestion":s?(s=Object.assign(Object.assign(Object.assign({},s),e.question),{topSort:e.question.isTop?this.data.topSort++:0}),t.set(e.question.id,s)):(s=this.createQuestion(e.question),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"deleteQuestion":if(!s)break;s.sender.endpointID!==r?t.delete(e.question.id):(s.status="delete",s.isTop=!1,s.answers.clear(),t.set(e.question.id,s)),this.emitter.emit("questionDelete",{question:s});break;case"answerQuestion":s?s.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)):(s=this.createQuestion(e.question),s.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"deleteAnswer":s&&(s.answers.delete(e.answer.id),this.emitter.emit("questionUpdate",{question:s}))}this.emitter.emit("questionChange",{questions:this.data.questions})}createQuestion(t){return{isAnonymous:t.isAnonymous,isTop:t.isTop,id:t.id,content:t.content,sender:t.sender,timestamp:t.timestamp||-1,status:t.status||"open",answers:new Map,topSort:0}}createQuestionAnswer(t){return{isPrivate:t.isPrivate,content:t.content,id:t.id,sender:t.sender,timestamp:t.timestamp||-1}}qa(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/qa`,e)}))}},exports.Recording=class extends A{constructor(t){super(t,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(t=>{const{state:e,body:s,stime:r}=t;if(s)return r&&(this.data.stime=r,this.data.timeOffset=r-(new Date).valueOf()),this.data.isPracticeSession="started"===s.status&&this.data.status===s.status&&0===s.duration,this.data.recording=Object.assign(Object.assign({},this.data.recording||{}),s),s.status&&(this.data.recording.requesting="starting"===s.status,this.data.status="starting"!==s.status?s.status:this.data.status),(s.status&&"started"===s.status||void 0!==s.isReconnecting&&!s.isReconnecting)&&this.setMainRecordPromptCount(0),s.backupRecord?(s.backupRecord.status&&(this.data.recording.backupRecordRequesting="starting"===s.backupRecord.status,this.data.backupRecordStatus="starting"!==s.backupRecord.status?s.backupRecord.status:this.data.backupRecordStatus),(s.backupRecord.status&&"started"===s.backupRecord.status||void 0!==s.backupRecord.isReconnecting&&!s.backupRecord.isReconnecting)&&setTimeout((()=>this.setBackupRecordPromptCount(0)),100)):this.data.backupRecordStatus=this.data.backupRecordStatus||"stopped",s.resultInfo&&this.emitter.emit("resultInfoChange",s.resultInfo),s.backupRecord&&s.backupRecord.resultInfo&&this.emitter.emit("backupRecordResultInfoChange",s.backupRecord.resultInfo),["full","update"].includes(e)?(s.recordUsers&&(this.data.recording.recordUsers=s.recordUsers),this.data):void 0}))}setMainRecordPromptCount(t){this.data.mainRecordPromptCount=t}setBackupRecordPromptCount(t){this.data.backupRecordPromptCount=t}history(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/recording/history`)}))}status(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/status`,e)}))}layout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/status`,e)}))}designatedUsers(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/designatedUsers`,e)}))}participantAdd(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/recording/participant/add`,e)}))}participantDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/recording/participant/delete`,e)}))}getTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getTemplates`,{params:e})}))}getByIds(e){return t(this,void 0,void 0,(function*(){const{prefix:{user:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/subject/getByIds`,e)}))}recordLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/layout`,e)}))}},exports.RemoteDesktop=class extends A{constructor(t){super(t,"remoteDesktop")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("remoteDesktop",(t=>{const{body:e}=t;this.data=e,this.emitter.emit("remoteDesktopChange",e)}))}setRemoteDesktop(e,s){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/users/${e}/remoteDesktop`,s)}))}},exports.RollCall=class extends A{constructor(t){super(t,"rollCall")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("rollcallVideo",(t=>{const{state:e,body:s}=t;s&&("full"===e||"update"===e?(this.data.index=s.index,this.data.userID=s.userID,this.data.type=s.type,this.data.nextUserID=s.nextUserID):"delete"===e&&(this.data.type=s.type,this.data.userID=0),this.emitter.emit("rollCallChange",this.data))})),this.ctx.emitter.on("rollcallSetting",(t=>{const{state:e,body:s}=t;s&&("full"===e?(this.data.rollcallList=s.rollcallList,this.data.rollcallUserLayout=s.rollcallUserLayout,this.data.hostLayout=s.hostLayout,this.data.commonUserLayout=s.commonUserLayout):"update"===e&&(s.rollcallList||[]).forEach((t=>{this.data.rollcallList.forEach((e=>{e.index===t.index&&(e.state=t.state)}))})),this.emitter.emit("rollCallChange",this.data))}))}setRollCall(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/rollcall`,t)}settingRollCall(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/rollcall/setting`,t)}},exports.Setting=class extends A{constructor(t){super(t,"setting")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingSetting",(t=>{const{state:e,body:s}=t;["full","update"].includes(e)&&v(s,this.data)}))}reactiveData(t){if(!h(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,r,i)=>{Object.keys(t).forEach((n=>{if(!1===r&&n in this.data&&(t[n]=this.data[n]),i<1){const s=e=>t[n]=e,r=`${y(n)}Change`;this.emitter.on(r,s),e.set(r,s)}if(h(t[n])&&!l(t[n])){s(t[n],!0,i+1)}}))};return s(t,!1,0),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}setting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/setting`,e)}))}muteAll(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/muteAll`)}))}unmuteAll(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/unmuteAll`)}))}},exports.ShouldJoinUsers=class extends A{constructor(t){super(t,"shouldJoinUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("shouldJoinUsers",(t=>{const{state:e}=t;"update"===e&&this.emitter.emit("shouldJoinUsersChange")}))}modifyUser(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/attendance/shouldJoin`,t)}getUser(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/attendance/getShouldJoin`)}},exports.SpotlightVideo=class extends A{constructor(t){super(t,"spotlightVideo")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("spotlightVideo",(t=>{const{body:e}=t;if(!e||!e.userIDs)return;this.data.userIDs=e.userIDs;e.userIDs.findIndex((t=>t===this.ctx.modules.me.data.userID))>-1?this.ctx.emitter.emit(exports.MeEvent.UPDATE,{isSpotlightVideo:!0}):this.ctx.modules.me.data.isSpotlightVideo&&this.ctx.emitter.emit(exports.MeEvent.UPDATE,{isSpotlightVideo:!1})}))}spotlight(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/spotlight`,t)}},exports.Transcript=class extends A{constructor(t){super(t,"transcript"),this.data={asr:{status:"stopped"}}}_topic(){return["transcript"]}_bindOn(){this.ctx.emitter.on("transcriptMsg",(t=>{const{body:e}=t;this.emitter.emit("transcriptMsg",e)}))}cleanup(){this.emitter.all=new Map}historyMsg(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/transcript/historyMsg`,e)}))}},exports.Users=G,exports.View=class extends A{constructor(t){super(t,"view")}_topic(){const{endpointType:t,role:e}=this.ctx.modules.me.data;return t===exports.ENDPOINT_TYPE.WEBCTRL?["hostAttendee","audience","advCtrl"]:e===exports.ROLE.AUDIENCE?["audience"]:["hostAttendee","audience"]}_bindOn(){["hostLayout","attendeeLayout","audienceLayout","meetingView","personalView"].forEach((t=>{this.ctx.emitter.on(t,(e=>{"personalView"!==t?this.updateLayout(e,t):this.updatePersonalLayouts(e)}))})),this.ctx.emitter.on("videoSourcesUpdated",(()=>{this.emitter.emit("videoSourcesUpdated")})),this.ctx.emitter.on("presetLayout",(t=>{const{body:e}=t;this.emitter.emit("presetLayoutUpdated",e)}))}updateLayout(t,e){const{event:s,body:r}=t;r&&("meetingView"===s?Object.keys(r).forEach((t=>{this.data[t]=r[t]})):this.data[e]=r)}updatePersonalLayouts(t){const{state:e,body:s}=t;"full"!==e&&void 0!==this.data.personalLayouts||(this.data.personalLayouts={}),s.personalLayouts.forEach((t=>{const{subscriber:s={userID:-1}}=t,r=s.userID||s.subjectID||-1;"full"===e||"update"===e||t.templateStatus?this.data.personalLayouts[r]=t:delete this.data.personalLayouts[r]})),this.emitter.emit("personalLayoutsChange",this.data.personalLayouts)}hostLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/hostLayout`,e)}))}attendeeLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/attendeeLayout`,e)}))}audienceLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/audienceLayout`,e)}))}personalLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/personalLayout`,e)}))}personalLayoutDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/personalLayout/delete`,e)}))}virtualClassLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/virtualClass/layout`,e)}))}closeVirtualClass(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/view/virtualClass/close`)}))}getVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/layout/template/info`,{params:e})}))}addVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/layout/template/add`,e)}))}editVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/layout/template/edit`,e)}))}getTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getTemplates`,{params:e})}))}editTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/edit`,e)}))}addTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/add`,e)}))}deleteTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/delete`,e)}))}getDefaultTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getDefaultTemplates`,{params:e})}))}changeDefaultTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/changeDefaultTemplate`,e)}))}perspectiveBind(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/perspective/bind`,e)}))}setSavedBackground(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/recentBackgroundFile`,e)}))}getSavedBackground(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/view/recentBackgroundFile`)}))}getPresetLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${s}/view/presetLayout`,{params:e})}))}setPresetLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout`,e)}))}presetLayoutApply(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout/apply`,e)}))}presetLayoutApplyUser(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout/applyUser`,e)}))}},exports.Vote=class extends A{constructor(t){super(t,"vote")}_topic(){return"vote"}_bindOn(){this.ctx.emitter.on("vote",(t=>{const{body:e}=t,{voteID:s}=e;void 0===this.data.vote&&(this.data.vote={}),this.data.vote[s]=e,this.emitter.emit("voteChange",{vote:this.data.vote,changeData:e})})),this.ctx.emitter.on(exports.MeEvent.LOBBYCHANGE,(t=>{t&&(this.data.vote={})}))}getVotes(t){const{prefix:{vote:e},meetingID:s,voteTk:r}=this.ctx.config.request;return t.tk=t.tk||r,this.ctx.request.get(`${e}meetings/${s}/votes`,{params:t})}getVote(t){const{prefix:{vote:e},meetingID:s,voteTk:r}=this.ctx.config.request;return t.tk=t.tk||r,this.ctx.request.get(`${e}meetings/${s}/vote`,{params:t})}getMeVote(t){const{prefix:{vote:e},meetingID:s,voteTk:r}=this.ctx.config.request;return t.tk=t.tk||r,this.ctx.request.get(`${e}meetings/${s}/vote/me`,{params:t})}voteStatus(t,e){const{prefix:{vote:s},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.post(`${s}meetings/${r}/vote/status?tk=${t.tk}&voteID=${t.voteID}`,e)}voteSubmit(t,e){const{prefix:{vote:s},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.post(`${s}meetings/${r}/vote/submit?tk=${t.tk}&voteID=${t.voteID}`,e)}voteAdd(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/add`,t)}voteEdit(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/edit`,t)}voteDelete(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/delete`,t)}voteInProgress(t){const{prefix:{vote:e},meetingID:s,voteTk:r}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/vote/inProgress`,{params:{tk:t&&t.tk||r}})}},exports.Words=class extends A{constructor(t){super(t,"words")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingBarrage",(t=>{this.data.timer&&clearTimeout(this.data.timer);const{state:e,body:s,pollingSeqId:r}=t;if(!s)return this.data.wordsDisplayStatus=!1,void this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data});"full"===e&&(this.data.barrageRecord||(this.data.barrageRecord=[]),this.data.barrageRecord.length>=10&&this.data.barrageRecord.pop(),r&&(this.data.barrageRecord=[{id:r,content:s.content,time:(new Date).getTime(),durationType:s.durationType,duration:1e3*s.duration},...this.data.barrageRecord]),s.wordsDisplayStatus=!0,-1!==s.duration&&(this.data.timer=setTimeout((()=>{s.wordsDisplayStatus=!1,this.data.timer=null,this.data.wordsDisplayStatus=s.wordsDisplayStatus,this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})}),1e3*s.duration)),v(s,this.data),this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data}))})),this.ctx.emitter.on(exports.MeEvent.ROLECHANGE,(()=>this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})))}barrage(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/barrage`,e)}))}deleteBarrage(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/deleteBarrage`)}))}},exports.createMeeting=function(t){return t.singleton?K.getInstance(t).meeting:W(t)},exports.reset=X;
|
|
1
|
+
"use strict";function t(t,e,s,r){return new(s||(s=Promise))((function(i,n){function o(t){try{c(r.next(t))}catch(e){n(e)}}function a(t){try{c(r.throw(t))}catch(e){n(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}c((r=r.apply(t,e||[])).next())}))}function e(t){return{all:t=t||new Map,on:function(e,s){var r=t.get(e);r?r.push(s):t.set(e,[s])},off:function(e,s){var r=t.get(e);r&&(s?r.splice(r.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var r=t.get(e);r&&r.slice().map((function(t){t(s)})),(r=t.get("*"))&&r.slice().map((function(t){t(e,s)}))}}}Object.defineProperty(exports,"__esModule",{value:!0});var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",i=9007199254740991,n="[object Arguments]",o="[object Boolean]",a="[object Date]",c="[object Function]",u="[object GeneratorFunction]",d="[object Map]",l="[object Number]",p="[object Object]",h="[object Promise]",f="[object RegExp]",m="[object Set]",g="[object String]",v="[object Symbol]",x="[object WeakMap]",y="[object ArrayBuffer]",b="[object DataView]",I="[object Float32Array]",q="[object Float64Array]",E="[object Int8Array]",D="[object Int16Array]",$="[object Int32Array]",O="[object Uint8Array]",T="[object Uint8ClampedArray]",S="[object Uint16Array]",_="[object Uint32Array]",R=/\w*$/,U=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,w={};w[n]=w["[object Array]"]=w[y]=w[b]=w[o]=w[a]=w[I]=w[q]=w[E]=w[D]=w[$]=w[d]=w[l]=w[p]=w[f]=w[m]=w[g]=w[v]=w[O]=w[T]=w[S]=w[_]=!0,w["[object Error]"]=w[c]=w[x]=!1;var P="object"==typeof self&&self&&self.Object===Object&&self,C="object"==typeof s&&s&&s.Object===Object&&s||P||Function("return this")(),N=e&&!e.nodeType&&e,k=N&&t&&!t.nodeType&&t,j=k&&k.exports===N;function L(t,e){return t.set(e[0],e[1]),t}function M(t,e){return t.add(e),t}function H(t,e,s,r){var i=-1,n=t?t.length:0;for(r&&n&&(s=t[++i]);++i<n;)s=e(s,t[i],i,t);return s}function V(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(s){}return e}function B(t){var e=-1,s=Array(t.size);return t.forEach((function(t,r){s[++e]=[r,t]})),s}function G(t,e){return function(s){return t(e(s))}}function Y(t){var e=-1,s=Array(t.size);return t.forEach((function(t){s[++e]=t})),s}var W,F=Array.prototype,Q=Function.prototype,J=Object.prototype,z=C["__core-js_shared__"],K=(W=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",X=Q.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),st=j?C.Buffer:void 0,rt=C.Symbol,it=C.Uint8Array,nt=G(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=F.splice,ut=Object.getOwnPropertySymbols,dt=st?st.isBuffer:void 0,lt=G(Object.keys,Object),pt=kt(C,"DataView"),ht=kt(C,"Map"),ft=kt(C,"Promise"),mt=kt(C,"Set"),gt=kt(C,"WeakMap"),vt=kt(Object,"create"),xt=Vt(pt),yt=Vt(ht),bt=Vt(ft),It=Vt(mt),qt=Vt(gt),Et=rt?rt.prototype:void 0,Dt=Et?Et.valueOf:void 0;function $t(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var r=t[e];this.set(r[0],r[1])}}function Ot(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var r=t[e];this.set(r[0],r[1])}}function Tt(t){var e=-1,s=t?t.length:0;for(this.clear();++e<s;){var r=t[e];this.set(r[0],r[1])}}function St(t){this.__data__=new Ot(t)}function _t(t,e){var s=Gt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Yt(t)}(t)&&Z.call(t,"callee")&&(!at.call(t,"callee")||tt.call(t)==n)}(t)?function(t,e){for(var s=-1,r=Array(t);++s<t;)r[s]=e(s);return r}(t.length,String):[],r=s.length,i=!!r;for(var o in t)!e&&!Z.call(t,o)||i&&("length"==o||Mt(o,r))||s.push(o);return s}function Rt(t,e,s){var r=t[e];Z.call(t,e)&&Bt(r,s)&&(void 0!==s||e in t)||(t[e]=s)}function Ut(t,e){for(var s=t.length;s--;)if(Bt(t[s][0],e))return s;return-1}function At(t,e,s,r,i,h,x){var U;if(r&&(U=h?r(t,i,h,x):r(t)),void 0!==U)return U;if(!Qt(t))return t;var A=Gt(t);if(A){if(U=function(t){var e=t.length,s=t.constructor(e);e&&"string"==typeof t[0]&&Z.call(t,"index")&&(s.index=t.index,s.input=t.input);return s}(t),!e)return function(t,e){var s=-1,r=t.length;e||(e=Array(r));for(;++s<r;)e[s]=t[s];return e}(t,U)}else{var P=Lt(t),C=P==c||P==u;if(Wt(t))return function(t,e){if(e)return t.slice();var s=new t.constructor(t.length);return t.copy(s),s}(t,e);if(P==p||P==n||C&&!h){if(V(t))return h?t:{};if(U=function(t){return"function"!=typeof t.constructor||Ht(t)?{}:(e=nt(t),Qt(e)?ot(e):{});var e}(C?{}:t),!e)return function(t,e){return Ct(t,jt(t),e)}(t,function(t,e){return t&&Ct(e,Jt(e),t)}(U,t))}else{if(!w[P])return h?t:{};U=function(t,e,s,r){var i=t.constructor;switch(e){case y:return Pt(t);case o:case a:return new i(+t);case b:return function(t,e){var s=e?Pt(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.byteLength)}(t,r);case I:case q:case E:case D:case $:case O:case T:case S:case _:return function(t,e){var s=e?Pt(t.buffer):t.buffer;return new t.constructor(s,t.byteOffset,t.length)}(t,r);case d:return function(t,e,s){var r=e?s(B(t),!0):B(t);return H(r,L,new t.constructor)}(t,r,s);case l:case g:return new i(t);case f:return function(t){var e=new t.constructor(t.source,R.exec(t));return e.lastIndex=t.lastIndex,e}(t);case m:return function(t,e,s){var r=e?s(Y(t),!0):Y(t);return H(r,M,new t.constructor)}(t,r,s);case v:return n=t,Dt?Object(Dt.call(n)):{}}var n}(t,P,At,e)}}x||(x=new St);var N=x.get(t);if(N)return N;if(x.set(t,U),!A)var k=s?function(t){return function(t,e,s){var r=e(t);return Gt(t)?r:function(t,e){for(var s=-1,r=e.length,i=t.length;++s<r;)t[i+s]=e[s];return t}(r,s(t))}(t,Jt,jt)}(t):Jt(t);return function(t,e){for(var s=-1,r=t?t.length:0;++s<r&&!1!==e(t[s],s,t););}(k||t,(function(i,n){k&&(i=t[n=i]),Rt(U,n,At(i,e,s,r,n,t,x))})),U}function wt(t){return!(!Qt(t)||(e=t,K&&K in e))&&(Ft(t)||V(t)?et:U).test(Vt(t));var e}function Pt(t){var e=new t.constructor(t.byteLength);return new it(e).set(new it(t)),e}function Ct(t,e,s,r){s||(s={});for(var i=-1,n=e.length;++i<n;){var o=e[i],a=r?r(s[o],t[o],o,s,t):void 0;Rt(s,o,void 0===a?t[o]:a)}return s}function Nt(t,e){var s,r,i=t.__data__;return("string"==(r=typeof(s=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==s:null===s)?i["string"==typeof e?"string":"hash"]:i.map}function kt(t,e){var s=function(t,e){return null==t?void 0:t[e]}(t,e);return wt(s)?s:void 0}$t.prototype.clear=function(){this.__data__=vt?vt(null):{}},$t.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},$t.prototype.get=function(t){var e=this.__data__;if(vt){var s=e[t];return s===r?void 0:s}return Z.call(e,t)?e[t]:void 0},$t.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:Z.call(e,t)},$t.prototype.set=function(t,e){return this.__data__[t]=vt&&void 0===e?r:e,this},Ot.prototype.clear=function(){this.__data__=[]},Ot.prototype.delete=function(t){var e=this.__data__,s=Ut(e,t);return!(s<0)&&(s==e.length-1?e.pop():ct.call(e,s,1),!0)},Ot.prototype.get=function(t){var e=this.__data__,s=Ut(e,t);return s<0?void 0:e[s][1]},Ot.prototype.has=function(t){return Ut(this.__data__,t)>-1},Ot.prototype.set=function(t,e){var s=this.__data__,r=Ut(s,t);return r<0?s.push([t,e]):s[r][1]=e,this},Tt.prototype.clear=function(){this.__data__={hash:new $t,map:new(ht||Ot),string:new $t}},Tt.prototype.delete=function(t){return Nt(this,t).delete(t)},Tt.prototype.get=function(t){return Nt(this,t).get(t)},Tt.prototype.has=function(t){return Nt(this,t).has(t)},Tt.prototype.set=function(t,e){return Nt(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new Ot},St.prototype.delete=function(t){return this.__data__.delete(t)},St.prototype.get=function(t){return this.__data__.get(t)},St.prototype.has=function(t){return this.__data__.has(t)},St.prototype.set=function(t,e){var s=this.__data__;if(s instanceof Ot){var r=s.__data__;if(!ht||r.length<199)return r.push([t,e]),this;s=this.__data__=new Tt(r)}return s.set(t,e),this};var jt=ut?G(ut,Object):function(){return[]},Lt=function(t){return tt.call(t)};function Mt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||A.test(t))&&t>-1&&t%1==0&&t<e}function Ht(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function Vt(t){if(null!=t){try{return X.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Bt(t,e){return t===e||t!=t&&e!=e}(pt&&Lt(new pt(new ArrayBuffer(1)))!=b||ht&&Lt(new ht)!=d||ft&&Lt(ft.resolve())!=h||mt&&Lt(new mt)!=m||gt&&Lt(new gt)!=x)&&(Lt=function(t){var e=tt.call(t),s=e==p?t.constructor:void 0,r=s?Vt(s):void 0;if(r)switch(r){case xt:return b;case yt:return d;case bt:return h;case It:return m;case qt:return x}return e});var Gt=Array.isArray;function Yt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}(t.length)&&!Ft(t)}var Wt=dt||function(){return!1};function Ft(t){var e=Qt(t)?tt.call(t):"";return e==c||e==u}function Qt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(t){return Yt(t)?_t(t):function(t){if(!Ht(t))return lt(t);var e=[];for(var s in Object(t))Z.call(t,s)&&"constructor"!=s&&e.push(s);return e}(t)}t.exports=function(t){return At(t,!0,!0)}}(r,r.exports);var i=r.exports;const n=t=>({get(e,s){if("__isProxy"===s)return!0;const r=Reflect.get(e,s);return Array.isArray(r)?r:"object"==typeof r&&null!==r?r.__isProxy?r:new Proxy(r,n(t)):r},set(e,s,r,n){const o=e[s];r=h(r)&&r.__isProxy?i(r):r;const a=Reflect.set(e,s,r,n);return((t,e)=>t!==e&&(t==t||e==e))(r,o)&&t.emit(`${y(s)}Change`,r),a}}),o=t=>encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]");class a{constructor(t){Object.defineProperty(this,"baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_beforeRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_errorHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.baseURL=t.baseURL,this._beforeRequest=t.beforeRequest,this._errorHandler=t.error}_request(t){const e=t.timeout||18e5;let s=t.headers||{};return t.url=E(this.baseURL,t.url||""),t.url=((t,e)=>{if(!e)return t;const s=[];Object.keys(e).forEach((t=>{const r=e[t];if(null==r)return;let i;Array.isArray(r)?(i=r,t+="[]"):i=[r],i.forEach((e=>{null!==e&&"object"==typeof e&&(e=JSON.stringify(e)),s.push(`${o(t)}=${o(e)}`)}))}));const r=s.join("&");if(r){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t})(t.url,t.params),s=Object.assign(s,this._defaultHeaders),Object.keys(s).forEach((t=>{"Content-Type"!==t&&t.toUpperCase()==="Content-Type".toUpperCase()&&(s["Content-Type"]=s[t],delete s[t])})),f(t.data)&&(t.data=t.data.buffer),(m(t.data)||l(t.data))&&(s&&!s["Content-Type"]&&(s["Content-Type"]="application/json;charset=utf-8"),t.data=JSON.stringify(t.data)),t.headers=s,t.timeout=e,this._beforeRequest&&this._beforeRequest(t),"undefined"!=typeof wx&&void 0!==wx.request?d(t):u(t)}setDefaultHeader(t,e){t in this._defaultHeaders&&(""===e||null===e)?delete this._defaultHeaders[t]:this._defaultHeaders[t]=e}get(t,e){return this._errorHandler?this._request(Object.assign(e||{},{url:t,method:"GET"})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(e||{},{url:t,method:"GET"}))}post(t,e,s){return this._errorHandler?this._request(Object.assign(s||{},{url:t,method:"POST",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(s||{},{url:t,method:"POST",data:e}))}put(t,e,s){return this._errorHandler?this._request(Object.assign(s||{},{url:t,method:"PUT",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(s||{},{url:t,method:"PUT",data:e}))}}class c{constructor(t){let e;Object.defineProperty(this,"promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.promise=new Promise((t=>{e=t})),t((t=>{this.reason||(this.reason=t,e(this.reason))}))}static source(){let t;const e=new c((e=>{t=e}));return{cancel:t,token:e}}}const u=t=>new Promise(((e,s)=>{const{data:r=null,url:i,method:n="GET",headers:o,cancelToken:a}=t;let c=new XMLHttpRequest;c.open(n.toUpperCase(),i,!0),c.timeout=t.timeout;const u=()=>{if(c){if(c.status>=200&&c.status<300)try{const t=JSON.parse(c.responseText);e(t)}catch(t){s(new Error("E_JSON_PARSE"+c.responseText))}else s({url:i,statusCode:c.status});c=null}};"onloadend"in c?c.onloadend=u:c.onreadystatechange=()=>{c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=()=>{c&&(s({url:i,statusCode:c.status,type:"request abort"}),c=null)},c.onerror=()=>{s(new Error("Network Error")),c=null},c.ontimeout=()=>{s(new Error("timeout of "+t.timeout+"ms exceeded")),c=null},"setRequestHeader"in c&&Object.keys(o).forEach((t=>{null===r&&"content-type"===t.toLowerCase()?delete o[t]:c.setRequestHeader(t,o[t])})),a&&a.promise.then((t=>{c&&(c.abort(),s(t),c=null)})),c.send(r)})),d=t=>new Promise(((e,s)=>{const{data:r=null,url:i,method:n="GET",headers:o,cancelToken:a}=t,c=wx.request({url:i,data:r,method:n.toUpperCase(),timeout:t.timeout,header:o,success(t){t.statusCode>=200&&t.statusCode<300?e(t.data):s({url:i,statusCode:t.statusCode})},fail(t){s("request:fail abort"===t.errMsg&&a&&a.reason||t)}});a&&a.promise.then((()=>{c&&c.abort()}))})),l=Array.isArray,p=t=>null==t,h=t=>"object"==typeof t&&null!==t,f=t=>{let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer,e},m=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},g=()=>{const t=[],e="0123456789abcdef";for(let s=0;s<36;s++)t[s]=e.substr(Math.floor(16*Math.random()),1);t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-";return t.join("").split("-").join("")},v=(t,e)=>t?(Object.entries(t).forEach((t=>{const[s,r]=[t[0],t[1]];if(null!==r)return h(r)&&!l(r)?(e[s]||(e[s]={}),void(e[s]=v(r,e[s]))):void(e[s]=r)})),e):e,x=/-(\w)/g,y=t=>t.replace(x,((t,e)=>e?e.toUpperCase():"")),{hasOwnProperty:b}=Object.prototype,I=(t,e)=>b.call(t,e),q=(t,e=new Map)=>{if(e.get(t))return e.get(t);if(!(t instanceof Object))return t;let s;s=t instanceof Array?[]:t instanceof Function?()=>t():t instanceof RegExp?new RegExp(t.source,t.flags):t instanceof Date?new Date(t):{},e.set(t,s);for(const r in t)I(t,r)&&(s[r]=q(t[r],e));return s},E=(t,e)=>t&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)?((t,e)=>e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t)(t,e):e,D=t=>{console.log(`computeNextTimeout attempts: ${t}`);let e=Math.floor(Math.random()*Math.pow(2,t)+1);return e<2&&(e=2),e>30&&(e=30),1e3*e};var $,O,T,S,_;exports.EVENT=void 0,($=exports.EVENT||(exports.EVENT={})).STATE="state",$.FAILED="failed",$.REQUEST_ERROR="requestError",$.POLLING_ERROR="pollingError",$.KEEPALIVE_ERROR="keepaliveError",exports.STATE=void 0,(O=exports.STATE||(exports.STATE={}))[O.CLOSE=0]="CLOSE",O[O.JOINED=1]="JOINED",O[O.READY=2]="READY",exports.ENDPOINT_TYPE=void 0,(T=exports.ENDPOINT_TYPE||(exports.ENDPOINT_TYPE={})).WEBAPP="webApp",T.WEBCTRL="webCtrl",T.WECHATMP="weChatMP",T.SUPERVISION="supervision",T.BIGSCREEN="bigScreen",T.DESKTOP="desktop",T.MOBILE="mobile",T.VCS="vcs",T.SIP="sip",T.H323="h323",T.PSTN="pstn",T.MULTI_STREAM="multiStream",T.MEETING_TOUCH="meetingTouch",T.MEETING_ROOMS="meetingRooms",T.RTSP="rtsp",T.RTMP_PULLER="rtmpPuller",T.GB28181="gb28181",T.TELE_PRESENCE="telePresence",exports.ROLE=void 0,(S=exports.ROLE||(exports.ROLE={})).HOST="host",S.COHOST="coHost",S.ATTENDEE="attendee",S.AUDIENCE="audience",exports.RECORD_STATUS=void 0,(_=exports.RECORD_STATUS||(exports.RECORD_STATUS={})).STARTED="started",_.PAUSED="paused",_.STARTING="starting",_.STOPPED="stopped";class R{constructor(t,s){Object.defineProperty(this,"moduleName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"emitter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"on",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"off",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.moduleName=s,this.ctx=t,this.emitter=e(),this.on=this.emitter.on,this.off=this.emitter.off,this.data=new Proxy({},n(this.emitter)),this._bindOn()}cleanup(){this.emitter.all=new Map,this.data=new Proxy({},n(this.emitter))}reactiveData(t){if(!h(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,r,i)=>{Object.keys(t).forEach((i=>{!1===r&&i in this.data&&(t[i]=this.data[i]);const n=e=>t[i]=e,o=`${y(i)}Change`;this.emitter.on(o,n),e.set(o,n),h(t[i])&&!l(t[i])&&s(t[i],!0)}))};return s(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}}class U extends R{constructor(t){super(t,"info")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingInfo",(t=>{const{state:e,body:s}=t;("full"===e||"update"===e)&&v(s,this.data)})),this.ctx.emitter.on("participantCount",(t=>{const{body:e}=t;v({participantCount:e},this.data)}))}subject(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/info/subject`,e)}))}practiceSession(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/info/practiceSession`)}))}shareInfo(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/shareInfo`,{params:t})}meetings(t){if(!t)return Promise.reject();const{prefix:{ctrl:e}}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings`,{params:t})}mailTemplate(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}mailTemplate`,{params:{meetingID:s},headers:{language:t.language}})}operateRecord(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/operationRecord`,t)}getImConfig(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},credential:s}=this.ctx.config.request;return t.credential=t.credential||s,this.ctx.request.get(`${e}im/config`,{params:t})}sendMsg(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/chat/send`,e)}))}}function A(t){const e=[],{isInLobby:s}=t.modules.me.data;return s?(e.push("lobbyMember"),e):(Object.keys(t.modules).forEach((s=>{const r=t.modules[s]._topic();r&&(Array.isArray(r)?r.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(r)||e.push(r))})),e)}function w(e,s){return t(this,void 0,void 0,(function*(){const{meetingID:t,clientID:r}=s.config.request,i=yield s.request.post("/ypush/api/v1/meeting-control/inbox",{basic:{tenantId:100,clientId:r,meetingId:t},inboxes:e}),n=[];return i.data&&Object.keys(i.data).forEach((t=>{n.push({name:t,seqId:i.data[t].maxSeqId,limit:200})})),n}))}function P(e,s){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r,clientID:i}=s.config.request,n=yield s.request.post(`${t}meetings/${r}/subscribe`,{endpointID:i,topics:e}),o=n&&n.data&&n.data.eventMsgs;o&&o.forEach((t=>{s.emitter.emit(t.event,t)}))}))}function C(e,s,r){return t(this,void 0,void 0,(function*(){const{inboxes:i,clientID:n,meetingID:o,cancelToken:a,status:c}=s;if(yield(()=>t(this,void 0,void 0,(function*(){let t;try{t=yield e.post("/ypush/api/v1/meeting-control/polling",{basic:{tenantId:100,clientId:n,meetingId:o},inboxes:i},{cancelToken:a})}catch(d){return c.attempts++,void(d&&"request abort"!==d.type&&console.error(d))}if(!t)return console.error("polling error: ","response is null"),void c.attempts++;const{data:s={},bizCode:u,error:d}=t;if(u&&900408!==u)return console.error("polling error: ",JSON.stringify(d)),void c.attempts++;c.attempts=0,s&&Object.keys(s).forEach((t=>{const e=i.find((e=>e.name===t));e&&(e.seqId=s[t].maxSeqId,s[t].items&&s[t].items.forEach((t=>{const e=JSON.parse(t.content);["liveStream","recording"].includes(e.event)&&(e.stime=t.stime),e.pollingSeqId=t.seqId,r(e)})))}))})))(),!c.running)return;if(c.attempts>6)return console.error("polling Max Attempts"),void(s.onError&&s.onError({message:"polling Max Attempts"}));const u=c.attempts?D(c.attempts):0;c.timer=setTimeout((()=>{c.running&&C(e,s,r)}),u)}))}const N=(e,s)=>t(void 0,void 0,void 0,(function*(){const{meetingID:t,clientID:r}=s.config.request;s.status.polling.running=!0,C(s.request,{inboxes:e,clientID:r,meetingID:t,cancelToken:s.config.request.cancelToken.token,status:s.status.polling,onError:t=>{s.emitter.emit(exports.EVENT.POLLING_ERROR,t)}},(t=>{s.emitter.emit(t.event,t)}))}));function k(t){t.status.polling.running=!1,t.status.polling.attempts=0,t.status.polling.timer&&(clearTimeout(t.status.polling.timer),t.status.polling.timer=null),t.config.request.cancelToken.cancel(),t.config.request.cancelToken=c.source()}function j(e,s){return t(this,void 0,void 0,(function*(){const{meetingID:r,userID:i,status:n,cancelToken:o,onError:a}=s;if(n.timer&&(clearTimeout(n.timer),n.timer=null),yield(()=>t(this,void 0,void 0,(function*(){let t;try{t=yield e.post(`/meeting-ctrl/api/v1/meetings/${r}/users/${i}/keepalive`,{},{cancelToken:o.token})}catch(c){return n.attempts++,void console.error(c)}if(!t)return;const{data:s={},bizCode:a,error:c}=t;if(900200!==a&&900408!==a&&901323!==a)return n.attempts++,void console.error("keepalive ",a,c);const u=s.interval||"";if(!u)return n.attempts++,void console.error("keepalive ",a,c);n.interval=u,n.attempts=0})))(),!n.running)return;if(n.attempts>10)return console.error("keepalive Max Attempts"),void(a&&a({message:"keepalive Max Attempts"}));const c=n.attempts?D(n.attempts):1e3*n.interval;n.timer=setTimeout((()=>{n.running&&j(e,s)}),c)}))}function L(e){return t(this,void 0,void 0,(function*(){const{meetingID:t,userID:s}=e.config.request;e.status.keepalive.running=!0,j(e.request,{meetingID:t,userID:s,cancelToken:e.config.request.cancelToken.token,status:e.status.keepalive,onError:t=>{e.emitter.emit(exports.EVENT.KEEPALIVE_ERROR,t)}})}))}const M=t=>{t.status.keepalive.running=!1,t.status.keepalive.attempts=0,t.status.keepalive.timer&&(clearTimeout(t.status.keepalive.timer),t.status.keepalive.timer=null)};var H;exports.MeEvent=void 0,(H=exports.MeEvent||(exports.MeEvent={})).INIT="meInit",H.UPDATE="meUpdate",H.UPDATE_USER_STATE="updateUserState",H.ROLECHANGE="meRoleChange",H.AUDIOCHANGE="meAudioChange",H.HANDUPCHANGE="meHandupChange",H.SETAUDIO="setAudio",H.VIDEOCHANGE="meVideoChange",H.SETVIDEO="setVideo",H.SHARECHANGE="meShareChange",H.WHITEBOARDCHANGE="meWhiteBoardChange",H.DISPLAYNAMECHANGE="meDisplayNameChange",H.SPOTLIGHTVIDEOCHANGE="meSpotlightVideoChange",H.LOBBYCHANGE="meLobbyChange",H.BARRAGECHANGE="meBarrageChange",H.PERSONALLAYOUTCHANGE="personalLayoutChange",H.PERMCHANGE="permChange",H.LEAVE="leave";class V extends R{constructor(t){super(t,"me")}_topic(){return""}_bindOn(){const e=e=>t(this,void 0,void 0,(function*(){if("role"in e&&e.role!==this.data.role){const t=this.data.role;v({role:e.role},this.data),e.role!==exports.ROLE.AUDIENCE&&t!==exports.ROLE.AUDIENCE||(yield this.rePolling("roleChange")),this.emitter.emit(exports.MeEvent.ROLECHANGE,e.role),this.ctx.emitter.emit(exports.MeEvent.ROLECHANGE,e.role)}})),s=t=>{var e,s,r,i,n,o,a;if("audio"in t){const{deviceOn:c,sendOn:u,recvOn:d,opBy:l}=t.audio;(!p(c)&&c!==(null===(e=this.data.audio)||void 0===e?void 0:e.deviceOn)||!p(u)&&u!==(null===(s=this.data.audio)||void 0===s?void 0:s.sendOn)||!p(d)&&d!==(null===(r=this.data.audio)||void 0===r?void 0:r.recvOn)||!p(l)&&l!==(null===(i=this.data.audio)||void 0===i?void 0:i.opBy))&&(v({audio:t.audio},this.data),this.emitter.emit(exports.MeEvent.AUDIOCHANGE,{deviceOn:p(c)?null===(n=this.data.audio)||void 0===n?void 0:n.deviceOn:c,sendOn:p(u)?null===(o=this.data.audio)||void 0===o?void 0:o.sendOn:u,recvOn:p(u)?null===(a=this.data.audio)||void 0===a?void 0:a.recvOn:d,opBy:l,changeData:Object.assign({},t.audio)}))}},r=t=>{var e,s,r,i,n,o;if("video"in t){const{deviceOn:a,sendOn:c,opBy:u,blocked:d}=t.video;(!p(a)&&a!==(null===(e=this.data.video)||void 0===e?void 0:e.deviceOn)||!p(c)&&c!==(null===(s=this.data.video)||void 0===s?void 0:s.sendOn)||!p(d)&&d!==(null===(r=this.data.video)||void 0===r?void 0:r.blocked))&&(v({video:t.video},this.data),this.emitter.emit(exports.MeEvent.VIDEOCHANGE,{deviceOn:p(a)?null===(i=this.data.video)||void 0===i?void 0:i.deviceOn:a,sendOn:p(c)?null===(n=this.data.video)||void 0===n?void 0:n.sendOn:c,blocked:p(c)?null===(o=this.data.video)||void 0===o?void 0:o.blocked:d,opBy:u,changeData:Object.assign({},t.video)}))}},i=t=>{var e,s,r,i,n,o,a,c;if("share"in t){const{deviceOn:n,sendOn:o,opBy:a}=t.share;(!p(n)&&n!==(null===(e=this.data.share)||void 0===e?void 0:e.deviceOn)||!p(o)&&o!==(null===(s=this.data.share)||void 0===s?void 0:s.sendOn))&&(v({share:t.share},this.data),this.emitter.emit(exports.MeEvent.SHARECHANGE,{deviceOn:p(n)?null===(r=this.data.share)||void 0===r?void 0:r.deviceOn:n,sendOn:p(o)?null===(i=this.data.share)||void 0===i?void 0:i.sendOn:o,opBy:a}))}if("whiteboard"in t){const{deviceOn:e,sendOn:s,opBy:r}=t.whiteboard;(!p(e)&&e!==(null===(n=this.data.whiteboard)||void 0===n?void 0:n.deviceOn)||!p(s)&&s!==(null===(o=this.data.whiteboard)||void 0===o?void 0:o.sendOn))&&(v({whiteboard:t.whiteboard},this.data),this.emitter.emit(exports.MeEvent.WHITEBOARDCHANGE,{deviceOn:p(e)?null===(a=this.data.whiteboard)||void 0===a?void 0:a.deviceOn:e,sendOn:p(s)?null===(c=this.data.whiteboard)||void 0===c?void 0:c.sendOn:s,opBy:r}))}},n=t=>{t.displayName&&t.displayName!==this.data.displayName&&(v({displayName:t.displayName},this.data),this.data.displayNamePinyin=V.setDisplayNamePinyinProp?V.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.emitter.emit(exports.MeEvent.DISPLAYNAMECHANGE,t.displayName))},o=t=>{"isHandUp"in t&&t.isHandUp!==this.data.isHandUp&&(v({isHandUp:t.isHandUp},this.data),this.emitter.emit(exports.MeEvent.HANDUPCHANGE,t.isHandUp))},a=t=>{"isSpotlightVideo"in t&&(v({isSpotlightVideo:t.isSpotlightVideo},this.data),this.emitter.emit(exports.MeEvent.SPOTLIGHTVIDEOCHANGE,t.isSpotlightVideo))},c=e=>t(this,void 0,void 0,(function*(){if("isInLobby"in e&&e.isInLobby!==this.data.isInLobby){v({isInLobby:e.isInLobby},this.data);const t=!1===e.isInLobby?"inLobbyChange":void 0;yield this.rePolling(t),this.emitter.emit(exports.MeEvent.LOBBYCHANGE,e.isInLobby),this.ctx.emitter.emit(exports.MeEvent.LOBBYCHANGE,e.isInLobby)}})),u=e=>t(this,void 0,void 0,(function*(){const{event:t,state:s,body:r}=e;"personalLayout"===t&&("full"===s?v({personalLayout:r},this.data):"delete"===s&&(this.data.personalLayout=void 0),this.emitter.emit(exports.MeEvent.PERSONALLAYOUTCHANGE,this.data.personalLayout))})),d=t=>{if(!t.barrage)return;let e=null;if(!t.barrage.wordsDisplayStatus)return e=null,delete t.barrage,this.data.barrage=e||void 0,void this.emitter.emit(exports.MeEvent.BARRAGECHANGE,e);if(!t.barrage.receiver)return;const s={content:t.barrage.content,contentType:t.barrage.contentType,type:t.barrage.type,duration:t.barrage.duration,position:t.barrage.position};e=s;let{role:r}=this.data;if(this.data.endpointType===exports.ENDPOINT_TYPE.SUPERVISION){const{info:t}=this.ctx.modules;r="webinar"===t.meetingType?exports.ROLE.AUDIENCE:exports.ROLE.ATTENDEE}if(r===exports.ROLE.HOST||r===exports.ROLE.COHOST?e=t.barrage.receiver.host?s:null:r===exports.ROLE.ATTENDEE?e=t.barrage.receiver.attendee?s:null:r===exports.ROLE.AUDIENCE&&(e=t.barrage.receiver.audience?s:null),!e&&t.barrage.receiver.designated){const{userID:r,subjectID:i}=this.data,{designatedUsers:n}=t.barrage;e=-1!==n.findIndex((t=>t.userID===r||i&&t.subjectID===i))?s:null}delete t.barrage,this.data.barrage=e||void 0,this.emitter.emit(exports.MeEvent.BARRAGECHANGE,e)},l=t=>{"perm"in t&&(v({perm:t.perm},this.data),this.emitter.emit(exports.MeEvent.PERMCHANGE,t.perm))},h=t=>{"leave"in t&&!0===t.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),k(this.ctx),M(this.ctx),X(this.ctx),this.emitter.emit(exports.MeEvent.LEAVE,t.resultInfo),this.ctx.cleanup(t.resultInfo))},f=t=>{e(t),s(t),r(t),i(t),n(t),o(t),c(t),a(t),d(t),l(t),h(t),(this.data.isInLobby||this.data.role===exports.ROLE.AUDIENCE)&&this.data.share&&this.data.share.sendOn&&i({share:{deviceOn:!0,sendOn:!1,recvOn:!1}})};this.ctx.emitter.on(exports.MeEvent.INIT,(t=>{v(t,this.data),this.data.displayNamePinyin=V.setDisplayNamePinyinProp?V.setDisplayNamePinyinProp(this.data.displayName):this.data.displayName,this.data.isUpdatedUserState=!1})),this.ctx.emitter.on(exports.MeEvent.UPDATE,(t=>{f(t),v(t,this.data)})),this.ctx.emitter.on(exports.EVENT.STATE,(({state:t})=>{t===exports.STATE.READY&&this.data.endpointType!==exports.ENDPOINT_TYPE.SUPERVISION&&this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data})})),this.ctx.emitter.on("me",(e=>t(this,void 0,void 0,(function*(){const{state:t,body:s={users:[]}}=e;if("delete"===t){const t=s.users[0];return t.leave=!0,void h(t)}let r=s.users.find((t=>t.userID===this.data.userID));r||s.users.length&&(r=s.users[0]),r?(f(r),v(r,this.data)):console.warn("me ",t,s)})))),this.ctx.emitter.on("setUserVideo",(t=>{this.emitter.emit(exports.MeEvent.SETVIDEO,t.body)})),this.ctx.emitter.on("setUserAudio",(t=>{this.emitter.emit(exports.MeEvent.SETAUDIO,t.body)})),this.ctx.emitter.on("meetingState",(t=>{const{body:e={}}=t;if("ended"===e.state){h({leave:!0,resultInfo:e.resultInfo})}})),this.ctx.emitter.on("personalLayout",(t=>{u(t)}))}updateUserState(t,e=!1){if(!e){const{role:e,initialMediaState:s}=this.data;t.audio.sendOn=t.audio.sendOn&&s.audio.sendOn,t.video.sendOn=t.video.sendOn&&s.video.sendOn,e===exports.ROLE.AUDIENCE&&(t.audio.sendOn=!1,t.video.sendOn=!1)}const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,v(t,this.data),this.ctx.request.post(`${s}meetings/${r}/updateUserState`,t)}rePolling(e){return t(this,void 0,void 0,(function*(){const{ctx:t}=this;k(t);const s=A(t),r=yield w(s,t);if(e&&this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data,event:e}),yield P(s,t),"undefined"!=typeof Worker&&t.worker){const{meetingID:e,clientID:i,userID:n}=t.config.request;t.worker.postMessage({inboxes:r,topics:s,clientID:i,meetingID:e,userID:n,rePolling:!0})}else yield N(r,t)}))}}class B extends R{constructor(t){super(t,"invite")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("callRecord",(t=>{const{body:e,state:s}=t;if(e&&e.users){if("full"===s)return this.data.callRecordUsers=e.users.map((t=>(t.displayNamePinyin=B.setDisplayNamePinyinProp?B.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t))),void this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers);this.data.callRecordUsers||(this.data.callRecordUsers=[]),e.users.forEach((t=>{const e=this.data.callRecordUsers.findIndex((e=>t.inviteTransID===e.inviteTransID));"update"===s&&-1!==e?v(t,this.data.callRecordUsers[e]):"update"===s&&-1===e&&(t.displayNamePinyin=B.setDisplayNamePinyinProp?B.setDisplayNamePinyinProp(t.displayName||""):t.displayName,this.data.callRecordUsers.push(t))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}setCallRecordUserResultInfo(t,e){const s=((t,e)=>{for(let s=t.length-1;s>=0;s--)if(e(t[s]))return s;return-1})(this.data.callRecordUsers,(e=>{let s=!1;switch(e.type){case"account":case"sip":case"h323":case"rtsp":s=t.account===e.contact;break;case"subjectID":s=t.subjectID===e.contact}return s}));s>-1&&(this.data.callRecordUsers[s].resultInfo=e,this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers))}invite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/invite`,t)}cancelInvite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/cancelInvite`,t)}}class G extends R{constructor(t){super(t,"users"),this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[]}}_topic(){const{role:t,endpointType:e}=this.ctx.modules.me.data;return e===exports.ENDPOINT_TYPE.SUPERVISION?["interactive","broadcast"]:t===exports.ROLE.AUDIENCE?"interactive":["interactive","broadcast","lobby"]}_bindOn(){const t=(t,{event:e,state:s})=>{if(t.userID!==this.ctx.modules.me.data.userID)return;const{resultInfo:r={}}=t;if("delete"!==s||"delete"===s&&[901357,901358,901352,901351,901350,901349].includes(r.bizCode||-1))return void this.ctx.emitter.emit(exports.MeEvent.UPDATE,t);let i=!1;switch(e){case"interactiveUsers":t.isInLobby||(i=!0);break;case"broadcastUsers":t.isInLobby||t.role!==exports.ROLE.AUDIENCE||(i=!0);break;case"lobbyUsers":t.isInLobby&&(i=!0)}const n={};i&&(n.leave=!0),this.ctx.emitter.emit(exports.MeEvent.UPDATE,Object.assign(Object.assign({},t),n))},e=({updateUsers:e,state:s,sourceKey:r})=>{if("full"===s)return this.data[r]=e.map((e=>(e.displayNamePinyin=G.setDisplayNamePinyinProp?G.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=G.setUserGroupIDs?G.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,t(e,{event:r,state:s}),e))),this.emitter.emit(`${r}Change`,{users:this.data[r],isFull:!0}),this.data[r];void 0===this.data[r]&&(this.data[r]=[]);const{data:i,emitter:n}=this;return e.forEach((e=>{const o=i[r].findIndex((t=>e.userID===t.userID));if("delete"===s&&-1!==o){const[t]=this.data[r].splice(o,1);n.emit(`${r}Delete`,{user:t,resultInfo:e.resultInfo})}else if("update"===s&&-1!==o){const t=this.data[r][o];this.updateUserProps(e,t),v(e,t),this.data[r][o]=q(t),this.emitter.emit(`${r}Update`,{user:this.data[r][o]})}else"update"===s&&-1===o&&(e.displayNamePinyin=G.setDisplayNamePinyinProp?G.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=G.setUserGroupIDs?G.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,i[r].push(e),this.emitter.emit(`${r}Add`,{user:e,resultInfo:e.resultInfo}));t(e,{event:r,state:s})})),this.emitter.emit(`${r}Change`,{users:this.data[r],isFull:!1}),this.data[r]};this.ctx.emitter.on("interactiveUsers",(t=>{const{state:s,body:r}=t;e({updateUsers:r.users,state:s,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(t=>{const{state:s,body:r}=t;e({updateUsers:r.users,state:s,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(t=>{const{state:s,body:r}=t;e({updateUsers:r.users,state:s,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(t=>{const{state:s,body:r}=t;e({updateUsers:r.users,state:s,sourceKey:"advCtrlUsers"})}))}reactiveData(t){if(!h(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,r)=>{Object.keys(t).forEach((i=>{!1===r&&i in this.data&&(t[i]=this.data[i]);const n=e=>t[i]=e.users.map((t=>t)),o=`${y(i)}Change`;this.emitter.on(o,n),e.set(o,n),h(t[i])&&!l(t[i])&&s(t[i],!0)}))};return s(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}cleanup(){this.emitter.all=new Map,this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[]}}getUserByUserID(t){if(t)return this.data.interactiveUsers.concat(this.data.lobbyUsers).concat(this.data.broadcastUsers).concat(this.data.advCtrlUsers).find((t=>{}))}updateUserProps(t,e){!e&&t.userID&&(e=this.getUserByUserID(t.userID)),e&&t.groupName&&(e.groupName=t.groupName),e&&t.displayName&&t.displayName!==e.displayName&&(t.displayNamePinyin=G.setDisplayNamePinyinProp?G.setDisplayNamePinyinProp(t.displayName):t.displayName)}setAudio(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/audio`,e)}setVideo(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/video`,e)}setShare(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/share`,e)}setWhiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/whiteboard`,e)}handUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/handUp`,e)}setRole(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/role`,e)}rename(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/displayName`,e)}remove(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/remove`)}removeWithOption(t,e){if(!t)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/removeWithOption`,e)}replyHandUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/replyHandUp`,e)}fecc(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/fecc`,e)}lobbyState(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/lobbyState`,e)}allowLocalRecord(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/allowLocalRecord`,e)}allowUserChatOn(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/allowChat`,e)}whiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/whiteboard`,e)}callStats(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/users/${t}/callStats`)}callStatsReport(t){if(!t.userID)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t.userID}/callStats/report`,t)}replyAllHandUp(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/replyAllHandUp`)}admitAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/lobby/admitAll`)}refuseAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/lobby/refuseAll`)}getSendLayout(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/users/${t}/sendLayout`)}setSendLayout(t,e){const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/sendLayout`,e)}setSendLayoutEnabled(t,e){const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/sendLayoutEnabled`,e)}pauseAudio(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/pauseAudio`)}resumeAudio(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/resumeAudio`)}unblockVideo(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/unblockVideo`)}blockVideo(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/users/${t}/blockVideo`)}modifyRoleBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyRoleBatch `,t)}modifyVideoBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyVideoBatch `,t)}putInLobbyBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/putInLobbyBatch `,t)}removeBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/removeBatch `,t)}modifyAudioBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyAudioBatch`,t)}modifyUserAudioReceiveBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/modifyUserAudioReceiveBatch`,t)}modifyUserVideoReceiveBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/unblockVideoBatch`,t)}modifyUserVideoPauseBatch(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/blockVideoBatch`,t)}setIntercom(t,e){const{prefix:{ctrl:s},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${s}meetings/${r}/users/${t}/intercom`,e)}claimHost(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/claimHost`,t)}}function Y(t){const{baseURL:s,modules:r,worker:i,singleton:n}=t;r.findIndex((t=>t===V))<0&&r.push(V),r.findIndex((t=>t===U))<0&&r.push(U);const o=t.clientID||`${g()}_${((t=new Date,e)=>{const s={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(const r in s)new RegExp("("+r+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?s[r]:("00"+s[r]).substr((""+s[r]).length)));return e})(new Date,"MMddHHmmss")}`,u={config:{baseURL:s,modules:r,singleton:n||!1,request:{cancelToken:c.source(),prefix:{ctrl:"/meeting-ctrl/api/v1/",conference:"/conference-manager/api/v1/",user:"/user-manager/api/v1/",vote:"/vote/api/v1/"},clientID:o,location:"",meetingID:"",ctrlID:"",sessionID:"",userID:-1,voteTk:"",credential:""}},worker:i,emitter:e(),request:new a({baseURL:s,beforeRequest:t=>{t.headers["X-Y-Request-Id"]=g(),t.timeout=18e5},error:t=>{u.emitter.emit(exports.EVENT.REQUEST_ERROR,t)}}),modules:{},state:exports.STATE.CLOSE,status:{polling:{running:!1,attempts:0,timer:null},keepalive:{running:!1,attempts:0,timer:null,interval:20}},cleanup:t=>{u.state!==exports.STATE.CLOSE&&(u.worker&&u.worker.terminate(),u.config.request.location="",u.config.request.meetingID="",u.config.request.ctrlID="",u.config.request.sessionID="",u.config.request.userID=-1,u.config.request.voteTk="",u.config.request.credential="",u.status.polling={running:!1,attempts:0,timer:null},u.status.keepalive={running:!1,attempts:0,timer:null,interval:20},u.request.setDefaultHeader("X-Y-Location",""),u.request.setDefaultHeader("X-Y-Ctrl-Id",""),u.request.setDefaultHeader("X-Y-Session-Id",""),Object.keys(u.modules).forEach((t=>{u.modules[t].cleanup()})),u.state=exports.STATE.CLOSE,u.emitter.emit(exports.EVENT.STATE,{state:u.state,reason:t}))}};return u}function W(t){const e=Y(t);return e.worker&&("undefined"!=typeof Worker?e.worker.postMessage({baseURL:e.config.baseURL}):console.error("The current environment does not support worker")),function(t,e){if(!l(t))return void console.error("The modules parameter requires an array type");t.forEach((t=>{const s=new t(e);e.modules[s.moduleName]=s}))}(e.config.modules,e),e.emitter.on(exports.EVENT.POLLING_ERROR,(t=>{Q(e)({resultInfo:t})})),e.emitter.on(exports.EVENT.KEEPALIVE_ERROR,(t=>{Q(e)({resultInfo:t})})),Object.assign({config:e.config,request:e.request,get state(){return e.state},on:e.emitter.on,off:e.emitter.off,join:F(e),leave:Q(e),end:J(e),endMeeting:z(e)},e.modules)}function F(e){return function(s){var r;return t(this,void 0,void 0,(function*(){const{clientID:t}=e.config.request,i=`${null===(r=s.endpointType)||void 0===r?void 0:r.toLocaleUpperCase()}${t}_${s.meetingNum}`;e.config.request.sessionID=i,e.request.setDefaultHeader("X-Y-Session-Id",i),e.request.setDefaultHeader("X-Y-Location","");const{prefix:n}=e.config.request,o=yield e.request.get(`${n.ctrl}credential`,{params:{meetingNum:s.meetingNum,pwd:s.pwd,url:s.url,mobileCode:s.mobileCode,mobile:s.mobile,regEmail:s.regEmail,accEmail:s.accEmail,tk:s.tk,displayName:s.displayName,userAgent:s.userAgent,verifyID:s.verifyID},headers:{"X-Y-Endpoint-Type":s.endpointType}}),{credential:a="",location:c=""}=o&&o.data||{};if(e.config.request.location=c,e.request.setDefaultHeader("X-Y-Location",c),!a)return e.emitter.emit(exports.EVENT.FAILED,{bizCode:o.bizCode,data:o.data}),o;delete s.pwd,delete s.url;const u={displayName:s.displayName,userAgent:s.userAgent,clientID:t};s.groupIDs&&s.account&&(u.groupIDs=s.groupIDs,u.account=s.account,u.groupName=s.groupName),s.mediaContentReq&&(u.mediaContentReq=s.mediaContentReq);const d=s.hostKey?`&hostKey=${s.hostKey}`:"",l=yield e.request.post(`${n.ctrl}join?meetingNum=${s.meetingNum}&credential=${a}${d}`,u,{headers:{"X-Y-Endpoint-Type":s.endpointType,"X-Y-Endpoint-Id":t}});if(!l||l&&l.ret<=-1)return e.emitter.emit(exports.EVENT.FAILED,{bizCode:l.bizCode,data:l.data}),l;const{meetingID:p="",ctrlID:h="",user:f={},mediaContent:m={},initialMediaState:g={},tk:v=""}=l.data;e.config.request.meetingID=p,e.config.request.ctrlID=h,e.config.request.userID=f.userID,e.config.request.voteTk=v,e.config.request.credential=a,e.request.setDefaultHeader("X-Y-Ctrl-Id",h),e.emitter.emit(exports.MeEvent.INIT,Object.assign(Object.assign({},f),{mediaContent:m,initialMediaState:g})),e.state=exports.STATE.JOINED,e.emitter.emit(exports.EVENT.STATE,{state:e.state});const x=()=>{e.state!==exports.STATE.READY&&(e.state=exports.STATE.READY,e.emitter.emit(exports.EVENT.STATE,{state:e.state}))},y=A(e),b=yield w(y,e);return yield P(y,e),"undefined"!=typeof Worker&&e.worker?(e.status.polling.running=!0,e.status.keepalive.running=!0,e.worker.postMessage({ctrlID:h,location:c,sessionID:i,inboxes:b,topics:y,clientID:t,meetingID:p,userID:f.userID,status:!0}),e.worker.onmessage=t=>{"pollingStarted"!==t.data?"keepaliveStarted"!==t.data&&("pollingStopped"!==t.data?"keepaliveStopped"!==t.data?"pollingError"!==t.data?"keepaliveError"!==t.data?e.emitter.emit(t.data.event,t.data):Q(e)({resultInfo:{message:"keepalive Max Attempts"}}):Q(e)({resultInfo:{message:"polling Max Attempts"}}):e.status.keepalive.running=!1:e.status.polling.running=!1):x()}):(N(b,e),x(),L(e)),l.data=Object.assign(Object.assign({},l.data),o.data),l}))}}function Q(e){return function(s){return t(this,void 0,void 0,(function*(){const t=s&&s.resultInfo;s||(s={resultInfo:{bizCode:901359}});const{prefix:r,meetingID:i}=e.config.request;let n;try{n=yield e.request.post(`${r.ctrl}meetings/${i}/leave`,s)}catch(o){console.error(o)}return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1}),k(e),M(e),X(e),e.cleanup(t),n}))}}function J(e){return function(){return t(this,void 0,void 0,(function*(){const{prefix:t,meetingID:s}=e.config.request,r=yield e.request.post(`${t.ctrl}meetings/${s}/end`);return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1}),k(e),M(e),X(e),e.cleanup(),r}))}}function z(e){return function(s){return t(this,void 0,void 0,(function*(){const{prefix:t}=e.config.request;return yield e.request.post(`${t.ctrl}meetingNum/${s}/end`)}))}}class K{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=W(t)}static getInstance(t){return this.instance?this.instance:this.instance=new K(t)}}function X(t){if(t.config.singleton){const{baseURL:e,modules:s,singleton:r}=t.config,i={baseURL:e,modules:s,worker:t.worker,singleton:r},n=K.getInstance(i);n&&(n.meeting=W(i))}}Object.defineProperty(K,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null}),exports.Asr=class extends R{constructor(t){super(t,"asr")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("asr",(t=>{const{body:e}=t;void 0===this.data.asr&&(this.data.asr={status:"stopped"}),e.resultInfo&&(this.emitter.emit("resultInfoChange",e.resultInfo),delete e.resultInfo),v(e,this.data.asr),e.resultInfo&&this.emitter.emit("resultInfoChange",e.resultInfo),this.emitter.emit("asrChange",{asr:this.data.asr,changeData:e})}))}cleanup(){this.emitter.all=new Map}transcriptStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/transcript/status`,e)}))}},exports.AudioRecording=class extends R{constructor(t){super(t,"audioRecording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("audioRecording",(t=>{const{body:e,stime:s}=t;e&&(s&&(this.data.stime=s,this.data.timeOffset=s-(new Date).valueOf()),this.data.audioRecording=Object.assign(Object.assign({},this.data.audioRecording||{}),e),e.status&&(this.data.audioRecording.requesting="starting"===e.status,this.data.status="starting"!==e.status?e.status:this.data.status),e.resultInfo&&this.emitter.emit("resultInfoChange",e.resultInfo))}))}history(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/audioRecording/history`)}))}status(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/audioRecording/status`,e)}))}},exports.Chat=class extends R{constructor(t){super(t,"chat")}_topic(){return"chat"}_bindOn(){this.ctx.emitter.on("chatMsg",(t=>{const{body:e}=t;this.emitter.emit("chatMsg",e)}))}msg(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/chat/msg`,e)}))}historyMsg(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/chat/historyMsg`,e)}))}sendMsg(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/chat/send`,e)}))}},exports.FocusUsers=class extends R{constructor(t){super(t,"focusUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("focusUsers",(t=>{const{state:e,body:s}=t;if(s)return this.data.focusUsers||(this.data.focusUsers=[]),"full"===e?this.data.focusUsers=s.focusUsers:"update"===e?this.data.focusUsers=this.data.focusUsers.concat(s.focusUsers):"delete"===e&&(s.focusUsers.forEach((t=>{let e=-1;t.subjectID?e=this.data.focusUsers.findIndex((e=>e.subjectID===t.subjectID)):t.userID&&(e=this.data.focusUsers.findIndex((e=>e.userID===t.userID))),-1!==e&&this.data.focusUsers.splice(e,1)})),this.data.focusUsers=this.data.focusUsers.map((t=>t))),this.emitter.emit("focusUsersChange",this.data.focusUsers),this.data}))}setFocusUsers(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/focusUser`,t)}},exports.Info=U,exports.Interpretation=class extends R{constructor(t){super(t,"interpretation"),this.data={status:"stopped",interpreters:[]}}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("interpretation",(t=>{const{body:e,state:s}=t;"full"===s?(this.data.interpreters=e.interpreters,this.data.status=e.status):this.data.status=e.status,this.emitter.emit("interpretationChange",this.data)}))}interpretationStart(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/interpretation/start`,t)}interpretationEnd(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/interpretation/stop`)}},exports.Invite=B,exports.LiveStream=class extends R{constructor(t){super(t,"liveStream")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStream",(t=>{const{state:e,body:s,stime:r}=t;if(!s)return;if(r&&(this.data.stime=r,this.data.timeOffset=r-(new Date).valueOf()),"full"===e){const{liveStreams:t=[]}=s;if(!t.length)return;const e=[];this.data.liveStreams=t.map((t=>(t.requesting="starting"===t.status,t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo}),e.push({platform:t.platform||"",status:(t.requesting?"stopped":t.status)||""}),t)));return v({status:e},this.data),this.data}void 0===this.data.liveStreams&&(this.data.liveStreams=[]);const{liveStreams:i=[]}=s;return i.forEach((t=>{t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo});let e=this.data.liveStreams.findIndex((e=>e.platform===t.platform));-1===e?(t.requesting="starting"===t.status,this.data.liveStreams.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreams[e]),t),this.data.liveStreams.splice(e,1,t));const s=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.platform===t.platform)),-1===e?s.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||""}):s.splice(e,1,{platform:s[e].platform||"",status:t.requesting?s[e].status||"stopped":t.status||""}),this.data.status=s})),this.data}))}setStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/status`,e)}))}liveStreamDescription(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/description`,e)}))}liveStreamSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/setting`,e)}))}liveStreamLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/layout`,e)}))}liveStreamAllow(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/liveStream/allow`)}))}pushSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStream/pushSetting`,e)}))}},exports.LiveStreaming=class extends R{constructor(t){super(t,"liveStreaming")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStreaming",(t=>{const{state:e,body:s,stime:r}=t;if(!s)return;if(r&&(this.data.stime=r,this.data.timeOffset=r-(new Date).valueOf()),"full"===e){const{liveStreaming:t=[],defaultConfig:e}=s;if(!t.length)return;const r=[],i=[];return t.forEach((t=>{t.audioDesignate||(t.requesting="starting"===t.status,t.resultInfo&&this.emitter.emit("resultInfoChange",{index:t.index,protocol:t.protocol,resultInfo:t.resultInfo}),r.push({index:t.index,protocol:t.protocol,status:(t.requesting?"stopped":t.status)||""}),i.push(t))})),this.data.liveStreaming=i,v({status:r,defaultConfig:e},this.data),this.data}if("delete"===e){const{liveStreaming:t=[]}=s;return t.forEach((t=>{const e=this.data.liveStreaming.findIndex((e=>e.protocol===t.protocol&&e.index===t.index));-1!==e&&this.data.liveStreaming.splice(e,1)})),void this.emitter.emit("liveStreamingChange",this.data.liveStreaming)}void 0===this.data.liveStreaming&&(this.data.liveStreaming=[]);const{liveStreaming:i=[],defaultConfig:n}=s;return i.forEach((t=>{if(t.audioDesignate)return;t.resultInfo&&this.emitter.emit("resultInfoChange",{index:t.index,protocol:t.protocol,resultInfo:t.resultInfo});let e=this.data.liveStreaming.findIndex((e=>e.index===t.index));-1===e?(t.requesting="starting"===t.status,this.data.liveStreaming.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreaming[e]),t),this.data.liveStreaming.splice(e,1,t));const s=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.index===t.index)),-1===e?s.push({index:t.index,protocol:t.protocol,status:t.requesting?"stopped":t.status}):s.splice(e,1,{index:t.index,protocol:t.protocol,status:t.requesting?s[e].status||"stopped":t.status}),this.data.status=s})),n&&v({defaultConfig:n},this.data),this.emitter.emit("liveStreamingChange",this.data.liveStreaming),this.data}))}setStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/status`,e)}))}liveStreamingSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/setting`,e)}))}liveStreamingDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/delete`,e)}))}liveStreamingDetail(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/liveStreaming/detail`,e)}))}},exports.Me=V,exports.Qa=class extends R{constructor(t){super(t,"qa"),this.data={questions:new Map,topSort:0}}_topic(){return"qa"}_bindOn(){this.ctx.emitter.on("qa",(t=>{const{body:e}=t;h(e)&&!l(e)?this.qaUpdate(this.data.questions,e):e.forEach((t=>this.qaUpdate(this.data.questions,t)))}))}cleanup(){this.data={questions:new Map,topSort:0}}qaUpdate(t,e){let s=t.get(e.question.id);const{clientID:r}=this.ctx.config.request;switch(e.command){case"addQuestion":s=this.createQuestion(e.question),t.set(e.question.id,s),this.emitter.emit("questionAdd",{question:s,selfSent:s.sender.endpointID===r});break;case"dismissQuestion":if(!s)break;s.sender.endpointID!==r?s.status="close":s.isTop=!1,t.set(e.question.id,s),this.emitter.emit("questionUpdate",{question:s});break;case"reopenQuestion":s?(s.status="open",s.isTop=e.question.isTop,t.set(e.question.id,s)):(s=this.createQuestion(e.question),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"updateQuestion":s?(s=Object.assign(Object.assign(Object.assign({},s),e.question),{topSort:e.question.isTop?this.data.topSort++:0}),t.set(e.question.id,s)):(s=this.createQuestion(e.question),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"deleteQuestion":if(!s)break;s.sender.endpointID!==r?t.delete(e.question.id):(s.status="delete",s.isTop=!1,s.answers.clear(),t.set(e.question.id,s)),this.emitter.emit("questionDelete",{question:s});break;case"answerQuestion":s?s.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)):(s=this.createQuestion(e.question),s.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)),t.set(e.question.id,s)),this.emitter.emit("questionUpdate",{question:s});break;case"deleteAnswer":s&&(s.answers.delete(e.answer.id),this.emitter.emit("questionUpdate",{question:s}))}this.emitter.emit("questionChange",{questions:this.data.questions})}createQuestion(t){return{isAnonymous:t.isAnonymous,isTop:t.isTop,id:t.id,content:t.content,sender:t.sender,timestamp:t.timestamp||-1,status:t.status||"open",answers:new Map,topSort:0}}createQuestionAnswer(t){return{isPrivate:t.isPrivate,content:t.content,id:t.id,sender:t.sender,timestamp:t.timestamp||-1}}qa(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/qa`,e)}))}},exports.Recording=class extends R{constructor(t){super(t,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(t=>{const{state:e,body:s,stime:r}=t;if(s)return r&&(this.data.stime=r,this.data.timeOffset=r-(new Date).valueOf()),this.data.isPracticeSession="started"===s.status&&this.data.status===s.status&&0===s.duration,this.data.recording=Object.assign(Object.assign({},this.data.recording||{}),s),s.status&&(this.data.recording.requesting="starting"===s.status,this.data.status="starting"!==s.status?s.status:this.data.status),(s.status&&"started"===s.status||void 0!==s.isReconnecting&&!s.isReconnecting)&&this.setMainRecordPromptCount(0),s.backupRecord?(s.backupRecord.status&&(this.data.recording.backupRecordRequesting="starting"===s.backupRecord.status,this.data.backupRecordStatus="starting"!==s.backupRecord.status?s.backupRecord.status:this.data.backupRecordStatus),(s.backupRecord.status&&"started"===s.backupRecord.status||void 0!==s.backupRecord.isReconnecting&&!s.backupRecord.isReconnecting)&&setTimeout((()=>this.setBackupRecordPromptCount(0)),100)):this.data.backupRecordStatus=this.data.backupRecordStatus||"stopped",s.resultInfo&&this.emitter.emit("resultInfoChange",s.resultInfo),s.backupRecord&&s.backupRecord.resultInfo&&this.emitter.emit("backupRecordResultInfoChange",s.backupRecord.resultInfo),["full","update"].includes(e)?(s.recordUsers&&(this.data.recording.recordUsers=s.recordUsers),this.data):void 0}))}setMainRecordPromptCount(t){this.data.mainRecordPromptCount=t}setBackupRecordPromptCount(t){this.data.backupRecordPromptCount=t}history(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/recording/history`)}))}status(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/status`,e)}))}layout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/status`,e)}))}designatedUsers(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/designatedUsers`,e)}))}participantAdd(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/recording/participant/add`,e)}))}participantDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/recording/participant/delete`,e)}))}getTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getTemplates`,{params:e})}))}getByIds(e){return t(this,void 0,void 0,(function*(){const{prefix:{user:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/subject/getByIds`,e)}))}recordLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/recording/layout`,e)}))}},exports.RemoteDesktop=class extends R{constructor(t){super(t,"remoteDesktop")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("remoteDesktop",(t=>{const{body:e}=t;this.data=e,this.emitter.emit("remoteDesktopChange",e)}))}setRemoteDesktop(e,s){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/users/${e}/remoteDesktop`,s)}))}},exports.RollCall=class extends R{constructor(t){super(t,"rollCall")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("rollcallVideo",(t=>{const{state:e,body:s}=t;s&&("full"===e||"update"===e?(this.data.index=s.index,this.data.userID=s.userID,this.data.type=s.type,this.data.nextUserID=s.nextUserID):"delete"===e&&(this.data.type=s.type,this.data.userID=0),this.emitter.emit("rollCallChange",this.data))})),this.ctx.emitter.on("rollcallSetting",(t=>{const{state:e,body:s}=t;s&&("full"===e?(this.data.rollcallList=s.rollcallList,this.data.rollcallUserLayout=s.rollcallUserLayout,this.data.hostLayout=s.hostLayout,this.data.commonUserLayout=s.commonUserLayout):"update"===e&&(s.rollcallList||[]).forEach((t=>{this.data.rollcallList.forEach((e=>{e.index===t.index&&(e.state=t.state)}))})),this.emitter.emit("rollCallChange",this.data))}))}setRollCall(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/rollcall`,t)}settingRollCall(t){const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/rollcall/setting`,t)}},exports.Setting=class extends R{constructor(t){super(t,"setting")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingSetting",(t=>{const{state:e,body:s}=t;["full","update"].includes(e)&&v(s,this.data)}))}reactiveData(t){if(!h(t))return console.warn("Parameter is not an object!"),t;const e=new Map,s=(t,r,i)=>{Object.keys(t).forEach((n=>{if(!1===r&&n in this.data&&(t[n]=this.data[n]),i<1){const s=e=>t[n]=e,r=`${y(n)}Change`;this.emitter.on(r,s),e.set(r,s)}if(h(t[n])&&!l(t[n])){s(t[n],!0,i+1)}}))};return s(t,!1,0),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}setting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/setting`,e)}))}muteAll(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/muteAll`)}))}unmuteAll(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/unmuteAll`)}))}},exports.ShouldJoinUsers=class extends R{constructor(t){super(t,"shouldJoinUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("shouldJoinUsers",(t=>{const{state:e}=t;"update"===e&&this.emitter.emit("shouldJoinUsersChange")}))}modifyUser(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/attendance/shouldJoin`,t)}getUser(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${e}/attendance/getShouldJoin`)}},exports.SpotlightVideo=class extends R{constructor(t){super(t,"spotlightVideo")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("spotlightVideo",(t=>{const{body:e}=t;if(!e||!e.userIDs)return;this.data.userIDs=e.userIDs;e.userIDs.findIndex((t=>t===this.ctx.modules.me.data.userID))>-1?this.ctx.emitter.emit(exports.MeEvent.UPDATE,{isSpotlightVideo:!0}):this.ctx.modules.me.data.isSpotlightVideo&&this.ctx.emitter.emit(exports.MeEvent.UPDATE,{isSpotlightVideo:!1})}))}spotlight(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${s}/view/spotlight`,t)}},exports.Transcript=class extends R{constructor(t){super(t,"transcript"),this.data={asr:{status:"stopped"}}}_topic(){return["transcript"]}_bindOn(){this.ctx.emitter.on("transcriptMsg",(t=>{const{body:e}=t;this.emitter.emit("transcriptMsg",e)}))}cleanup(){this.emitter.all=new Map}historyMsg(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${s}/transcript/historyMsg`,e)}))}},exports.Users=G,exports.View=class extends R{constructor(t){super(t,"view")}_topic(){const{endpointType:t,role:e}=this.ctx.modules.me.data;return t===exports.ENDPOINT_TYPE.WEBCTRL?["hostAttendee","audience","advCtrl"]:e===exports.ROLE.AUDIENCE?["audience"]:["hostAttendee","audience"]}_bindOn(){["hostLayout","attendeeLayout","audienceLayout","meetingView","personalView"].forEach((t=>{this.ctx.emitter.on(t,(e=>{"personalView"!==t?this.updateLayout(e,t):this.updatePersonalLayouts(e)}))})),this.ctx.emitter.on("videoSourcesUpdated",(()=>{this.emitter.emit("videoSourcesUpdated")})),this.ctx.emitter.on("presetLayout",(t=>{const{body:e}=t;this.emitter.emit("presetLayoutUpdated",e)}))}updateLayout(t,e){const{event:s,body:r}=t;r&&("meetingView"===s?Object.keys(r).forEach((t=>{this.data[t]=r[t]})):this.data[e]=r)}updatePersonalLayouts(t){const{state:e,body:s}=t;"full"!==e&&void 0!==this.data.personalLayouts||(this.data.personalLayouts={}),s.personalLayouts.forEach((t=>{const{subscriber:s={userID:-1}}=t,r=s.userID||s.subjectID||-1;"full"===e||"update"===e||t.templateStatus?this.data.personalLayouts[r]=t:delete this.data.personalLayouts[r]})),this.emitter.emit("personalLayoutsChange",this.data.personalLayouts)}hostLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/hostLayout`,e)}))}attendeeLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/attendeeLayout`,e)}))}audienceLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/audienceLayout`,e)}))}personalLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/personalLayout`,e)}))}personalLayoutDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/personalLayout/delete`,e)}))}virtualClassLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/virtualClass/layout`,e)}))}closeVirtualClass(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/view/virtualClass/close`)}))}getVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/layout/template/info`,{params:e})}))}addVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/layout/template/add`,e)}))}editVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/layout/template/edit`,e)}))}getTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getTemplates`,{params:e})}))}editTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/edit`,e)}))}addTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/add`,e)}))}deleteTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/delete`,e)}))}getDefaultTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getDefaultTemplates`,{params:e})}))}changeDefaultTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/changeDefaultTemplate`,e)}))}perspectiveBind(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/perspective/bind`,e)}))}setSavedBackground(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/recentBackgroundFile`,e)}))}getSavedBackground(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/view/recentBackgroundFile`)}))}getPresetLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${s}/view/presetLayout`,{params:e})}))}setPresetLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout`,e)}))}presetLayoutApply(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout/apply`,e)}))}presetLayoutApplyUser(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/view/presetLayout/applyUser`,e)}))}},exports.Vote=class extends R{constructor(t){super(t,"vote")}_topic(){return"vote"}_bindOn(){this.ctx.emitter.on("vote",(t=>{const{body:e}=t,{voteID:s}=e;void 0===this.data.vote&&(this.data.vote={}),this.data.vote[s]=e,this.emitter.emit("voteChange",{vote:this.data.vote,changeData:e})})),this.ctx.emitter.on(exports.MeEvent.LOBBYCHANGE,(t=>{t&&(this.data.vote={})}))}getVotes(t){const{prefix:{vote:e},meetingID:s,voteTk:r}=this.ctx.config.request;return t.tk=t.tk||r,this.ctx.request.get(`${e}meetings/${s}/votes`,{params:t})}getVote(t){const{prefix:{vote:e},meetingID:s,voteTk:r}=this.ctx.config.request;return t.tk=t.tk||r,this.ctx.request.get(`${e}meetings/${s}/vote`,{params:t})}getMeVote(t){const{prefix:{vote:e},meetingID:s,voteTk:r}=this.ctx.config.request;return t.tk=t.tk||r,this.ctx.request.get(`${e}meetings/${s}/vote/me`,{params:t})}voteStatus(t,e){const{prefix:{vote:s},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.post(`${s}meetings/${r}/vote/status?tk=${t.tk}&voteID=${t.voteID}`,e)}voteSubmit(t,e){const{prefix:{vote:s},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.post(`${s}meetings/${r}/vote/submit?tk=${t.tk}&voteID=${t.voteID}`,e)}voteAdd(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/add`,t)}voteEdit(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/edit`,t)}voteDelete(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}personal/vote/delete`,t)}voteInProgress(t){const{prefix:{vote:e},meetingID:s,voteTk:r}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${s}/vote/inProgress`,{params:{tk:t&&t.tk||r}})}},exports.Words=class extends R{constructor(t){super(t,"words")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingBarrage",(t=>{this.data.timer&&clearTimeout(this.data.timer);const{state:e,body:s,pollingSeqId:r}=t;if(!s)return this.data.wordsDisplayStatus=!1,void this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data});"full"===e&&(this.data.barrageRecord||(this.data.barrageRecord=[]),this.data.barrageRecord.length>=10&&this.data.barrageRecord.pop(),r&&(this.data.barrageRecord=[{id:r,content:s.content,time:(new Date).getTime(),durationType:s.durationType,duration:1e3*s.duration},...this.data.barrageRecord]),s.wordsDisplayStatus=!0,-1!==s.duration&&(this.data.timer=setTimeout((()=>{s.wordsDisplayStatus=!1,this.data.timer=null,this.data.wordsDisplayStatus=s.wordsDisplayStatus,this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})}),1e3*s.duration)),v(s,this.data),this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data}))})),this.ctx.emitter.on(exports.MeEvent.ROLECHANGE,(()=>this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})))}barrage(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${s}/barrage`,e)}))}deleteBarrage(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/deleteBarrage`)}))}},exports.createMeeting=function(t){return t.singleton?K.getInstance(t).meeting:W(t)},exports.reset=X;
|
package/dist/meeting.d.ts
CHANGED
|
@@ -176,6 +176,25 @@ export declare class Chat extends Module<ChatData, Events_16> {
|
|
|
176
176
|
historyMsg(params: {
|
|
177
177
|
limit: number;
|
|
178
178
|
}): Promise<any>;
|
|
179
|
+
/**
|
|
180
|
+
* 发送聊天信息
|
|
181
|
+
* @params
|
|
182
|
+
* @returns
|
|
183
|
+
*/
|
|
184
|
+
sendMsg(params: {
|
|
185
|
+
msgID: string;
|
|
186
|
+
contentType: string;
|
|
187
|
+
content: string;
|
|
188
|
+
msgType?: number;
|
|
189
|
+
receiver?: {
|
|
190
|
+
userID: number;
|
|
191
|
+
};
|
|
192
|
+
timestamp?: number;
|
|
193
|
+
sender?: {
|
|
194
|
+
userID?: number;
|
|
195
|
+
displayName?: string;
|
|
196
|
+
};
|
|
197
|
+
}): Promise<any>;
|
|
179
198
|
}
|
|
180
199
|
|
|
181
200
|
export declare type ChatData = object;
|
|
@@ -318,6 +337,10 @@ export declare interface Context {
|
|
|
318
337
|
* 投票服务唯一标识
|
|
319
338
|
*/
|
|
320
339
|
voteTk: string;
|
|
340
|
+
/**
|
|
341
|
+
* 鉴权
|
|
342
|
+
*/
|
|
343
|
+
credential: string;
|
|
321
344
|
};
|
|
322
345
|
};
|
|
323
346
|
/**
|
|
@@ -663,6 +686,7 @@ declare type Events_2 = {
|
|
|
663
686
|
[MeEvent.LOBBYCHANGE]: boolean;
|
|
664
687
|
[MeEvent.BARRAGECHANGE]: MeData['barrage'] | null;
|
|
665
688
|
[MeEvent.PERSONALLAYOUTCHANGE]: MeData['personalLayout'];
|
|
689
|
+
[MeEvent.PERMCHANGE]: number;
|
|
666
690
|
[MeEvent.LEAVE]: any;
|
|
667
691
|
};
|
|
668
692
|
|
|
@@ -881,6 +905,40 @@ export declare class Info extends Module<InfoData, Events_3> {
|
|
|
881
905
|
opModule?: string;
|
|
882
906
|
opResult?: boolean;
|
|
883
907
|
}): Promise<any>;
|
|
908
|
+
/**
|
|
909
|
+
* 获取会议聊天配置
|
|
910
|
+
* @param params
|
|
911
|
+
* @returns
|
|
912
|
+
*/
|
|
913
|
+
getImConfig(params: {
|
|
914
|
+
/**
|
|
915
|
+
* 会议号
|
|
916
|
+
*/
|
|
917
|
+
meetingNum: string;
|
|
918
|
+
/**
|
|
919
|
+
* 调取credential接口获取的临时秘钥
|
|
920
|
+
*/
|
|
921
|
+
credential?: string;
|
|
922
|
+
}): Promise<any>;
|
|
923
|
+
/**
|
|
924
|
+
* 发送聊天信息
|
|
925
|
+
* @params
|
|
926
|
+
* @returns
|
|
927
|
+
*/
|
|
928
|
+
sendMsg(params: {
|
|
929
|
+
msgID: string;
|
|
930
|
+
contentType: string;
|
|
931
|
+
content: string;
|
|
932
|
+
msgType?: number;
|
|
933
|
+
receiver?: {
|
|
934
|
+
userID: number;
|
|
935
|
+
};
|
|
936
|
+
timestamp?: number;
|
|
937
|
+
sender?: {
|
|
938
|
+
userID?: number;
|
|
939
|
+
displayName?: string;
|
|
940
|
+
};
|
|
941
|
+
}): Promise<any>;
|
|
884
942
|
}
|
|
885
943
|
|
|
886
944
|
export declare interface InfoData {
|
|
@@ -935,6 +993,8 @@ export declare interface InfoData {
|
|
|
935
993
|
hostKeyEnabled?: boolean;
|
|
936
994
|
premiseMonitorEnabled?: boolean;
|
|
937
995
|
interactCooperationEnabled?: boolean;
|
|
996
|
+
sessionID?: number;
|
|
997
|
+
premiseBackupRecordEnabled?: boolean;
|
|
938
998
|
}
|
|
939
999
|
|
|
940
1000
|
export declare class Interpretation extends Module<InterpretationData, Events_20> {
|
|
@@ -977,6 +1037,7 @@ export declare class Invite extends Module<InviteData, Events_10> {
|
|
|
977
1037
|
constructor(ctx: Context);
|
|
978
1038
|
_topic(): string;
|
|
979
1039
|
_bindOn(): void;
|
|
1040
|
+
setCallRecordUserResultInfo(user: User, resultInfo: ResultInfo): void;
|
|
980
1041
|
/**
|
|
981
1042
|
* 邀请
|
|
982
1043
|
* @param params
|
|
@@ -1135,6 +1196,7 @@ export declare interface LayoutContent {
|
|
|
1135
1196
|
}[];
|
|
1136
1197
|
hideNoPictureEnabled?: boolean;
|
|
1137
1198
|
pollShowSelf?: boolean;
|
|
1199
|
+
isRollCallLayout?: boolean;
|
|
1138
1200
|
}
|
|
1139
1201
|
|
|
1140
1202
|
export declare type LayoutMode = 'custom' | 'basic';
|
|
@@ -1362,6 +1424,7 @@ export declare interface MeData {
|
|
|
1362
1424
|
displayNamePinyin: string;
|
|
1363
1425
|
subjectID: string;
|
|
1364
1426
|
caps: number;
|
|
1427
|
+
perm: number;
|
|
1365
1428
|
initialMediaState: {
|
|
1366
1429
|
audio: MediaState;
|
|
1367
1430
|
video: MediaState;
|
|
@@ -1497,6 +1560,10 @@ export declare enum MeEvent {
|
|
|
1497
1560
|
* 个人布局变更
|
|
1498
1561
|
*/
|
|
1499
1562
|
PERSONALLAYOUTCHANGE = "personalLayoutChange",
|
|
1563
|
+
/**
|
|
1564
|
+
* 临时分配的权限变更
|
|
1565
|
+
*/
|
|
1566
|
+
PERMCHANGE = "permChange",
|
|
1500
1567
|
/**
|
|
1501
1568
|
* 离开会议
|
|
1502
1569
|
*/
|
|
@@ -2097,6 +2164,7 @@ export declare interface SettingData {
|
|
|
2097
2164
|
allowRenameSelf: boolean;
|
|
2098
2165
|
showAvatar: boolean;
|
|
2099
2166
|
onlyAuthUserCanJoin: boolean;
|
|
2167
|
+
allowRenameSelfLock: boolean;
|
|
2100
2168
|
chatSetting: {
|
|
2101
2169
|
attendeePermission: 'all' | 'public' | 'host' | 'disabled';
|
|
2102
2170
|
audiencePermission: 'all' | 'public' | 'host' | 'disabled';
|
|
@@ -2110,6 +2178,7 @@ export declare interface SettingData {
|
|
|
2110
2178
|
mediaSetting: {
|
|
2111
2179
|
audio: {
|
|
2112
2180
|
muteOnJoin: boolean;
|
|
2181
|
+
muteOnJoinLock: boolean;
|
|
2113
2182
|
speakingMode: 'free' | 'handUp';
|
|
2114
2183
|
allowUnmuteSelf: boolean;
|
|
2115
2184
|
muteMode: number;
|
|
@@ -2131,6 +2200,8 @@ export declare interface SettingData {
|
|
|
2131
2200
|
lobbySetting: {
|
|
2132
2201
|
autoAdmitted: number;
|
|
2133
2202
|
enabled: boolean;
|
|
2203
|
+
enabledLock: boolean;
|
|
2204
|
+
ipWhitelist: string[];
|
|
2134
2205
|
};
|
|
2135
2206
|
ivrSetting: {
|
|
2136
2207
|
chime: 'off' | 'self' | 'all' | 'selfAndHost';
|
|
@@ -2367,6 +2438,7 @@ export declare interface User {
|
|
|
2367
2438
|
share?: UserMedia & {
|
|
2368
2439
|
shareCoopType?: string;
|
|
2369
2440
|
mode?: number;
|
|
2441
|
+
annotation?: string;
|
|
2370
2442
|
};
|
|
2371
2443
|
/**
|
|
2372
2444
|
* 协作能力 观众无此能力
|