@ylink-sdk/meeting 0.8.0-beta.3 → 0.8.0-beta.5

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.
@@ -1 +1 @@
1
- "use strict";function t(t,e,r,s){return new(r||(r=Promise))((function(i,n){function o(t){try{c(s.next(t))}catch(e){n(e)}}function a(t){try{c(s.throw(t))}catch(e){n(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((s=s.apply(t,e||[])).next())}))}function e(t){return{all:t=t||new Map,on:function(e,r){var s=t.get(e);s?s.push(r):t.set(e,[r])},off:function(e,r){var s=t.get(e);s&&(r?s.splice(s.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var s=t.get(e);s&&s.slice().map((function(t){t(r)})),(s=t.get("*"))&&s.slice().map((function(t){t(e,r)}))}}}Object.defineProperty(exports,"__esModule",{value:!0});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={exports:{}};!function(t,e){var s="__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]",D="[object Int8Array]",E="[object Int16Array]",$="[object Int32Array]",_="[object Uint8Array]",O="[object Uint8ClampedArray]",S="[object Uint16Array]",w="[object Uint32Array]",T=/\w*$/,A=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,U={};U[n]=U["[object Array]"]=U[y]=U[b]=U[o]=U[a]=U[I]=U[q]=U[D]=U[E]=U[$]=U[d]=U[l]=U[p]=U[f]=U[m]=U[g]=U[v]=U[_]=U[O]=U[S]=U[w]=!0,U["[object Error]"]=U[c]=U[x]=!1;var R="object"==typeof self&&self&&self.Object===Object&&self,P="object"==typeof r&&r&&r.Object===Object&&r||R||Function("return this")(),C=e&&!e.nodeType&&e,N=C&&t&&!t.nodeType&&t,k=N&&N.exports===C;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,r,s){var i=-1,n=t?t.length:0;for(s&&n&&(r=t[++i]);++i<n;)r=e(r,t[i],i,t);return r}function B(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}function V(t){var e=-1,r=Array(t.size);return t.forEach((function(t,s){r[++e]=[s,t]})),r}function G(t,e){return function(r){return t(e(r))}}function Y(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var F,W=Array.prototype,Q=Function.prototype,J=Object.prototype,z=P["__core-js_shared__"],K=(F=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",X=Q.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=k?P.Buffer:void 0,st=P.Symbol,it=P.Uint8Array,nt=G(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=W.splice,ut=Object.getOwnPropertySymbols,dt=rt?rt.isBuffer:void 0,lt=G(Object.keys,Object),pt=Nt(P,"DataView"),ht=Nt(P,"Map"),ft=Nt(P,"Promise"),mt=Nt(P,"Set"),gt=Nt(P,"WeakMap"),vt=Nt(Object,"create"),xt=Bt(pt),yt=Bt(ht),bt=Bt(ft),It=Bt(mt),qt=Bt(gt),Dt=st?st.prototype:void 0,Et=Dt?Dt.valueOf:void 0;function $t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function _t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function Ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function St(t){this.__data__=new _t(t)}function wt(t,e){var r=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 r=-1,s=Array(t);++r<t;)s[r]=e(r);return s}(t.length,String):[],s=r.length,i=!!s;for(var o in t)!e&&!Z.call(t,o)||i&&("length"==o||Mt(o,s))||r.push(o);return r}function Tt(t,e,r){var s=t[e];Z.call(t,e)&&Vt(s,r)&&(void 0!==r||e in t)||(t[e]=r)}function At(t,e){for(var r=t.length;r--;)if(Vt(t[r][0],e))return r;return-1}function jt(t,e,r,s,i,h,x){var A;if(s&&(A=h?s(t,i,h,x):s(t)),void 0!==A)return A;if(!Qt(t))return t;var j=Gt(t);if(j){if(A=function(t){var e=t.length,r=t.constructor(e);e&&"string"==typeof t[0]&&Z.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!e)return function(t,e){var r=-1,s=t.length;e||(e=Array(s));for(;++r<s;)e[r]=t[r];return e}(t,A)}else{var R=Lt(t),P=R==c||R==u;if(Ft(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(R==p||R==n||P&&!h){if(B(t))return h?t:{};if(A=function(t){return"function"!=typeof t.constructor||Ht(t)?{}:(e=nt(t),Qt(e)?ot(e):{});var e}(P?{}:t),!e)return function(t,e){return Pt(t,kt(t),e)}(t,function(t,e){return t&&Pt(e,Jt(e),t)}(A,t))}else{if(!U[R])return h?t:{};A=function(t,e,r,s){var i=t.constructor;switch(e){case y:return Rt(t);case o:case a:return new i(+t);case b:return function(t,e){var r=e?Rt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,s);case I:case q:case D:case E:case $:case _:case O:case S:case w:return function(t,e){var r=e?Rt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,s);case d:return function(t,e,r){var s=e?r(V(t),!0):V(t);return H(s,L,new t.constructor)}(t,s,r);case l:case g:return new i(t);case f:return function(t){var e=new t.constructor(t.source,T.exec(t));return e.lastIndex=t.lastIndex,e}(t);case m:return function(t,e,r){var s=e?r(Y(t),!0):Y(t);return H(s,M,new t.constructor)}(t,s,r);case v:return n=t,Et?Object(Et.call(n)):{}}var n}(t,R,jt,e)}}x||(x=new St);var C=x.get(t);if(C)return C;if(x.set(t,A),!j)var N=r?function(t){return function(t,e,r){var s=e(t);return Gt(t)?s:function(t,e){for(var r=-1,s=e.length,i=t.length;++r<s;)t[i+r]=e[r];return t}(s,r(t))}(t,Jt,kt)}(t):Jt(t);return function(t,e){for(var r=-1,s=t?t.length:0;++r<s&&!1!==e(t[r],r,t););}(N||t,(function(i,n){N&&(i=t[n=i]),Tt(A,n,jt(i,e,r,s,n,t,x))})),A}function Ut(t){return!(!Qt(t)||(e=t,K&&K in e))&&(Wt(t)||B(t)?et:A).test(Bt(t));var e}function Rt(t){var e=new t.constructor(t.byteLength);return new it(e).set(new it(t)),e}function Pt(t,e,r,s){r||(r={});for(var i=-1,n=e.length;++i<n;){var o=e[i],a=s?s(r[o],t[o],o,r,t):void 0;Tt(r,o,void 0===a?t[o]:a)}return r}function Ct(t,e){var r,s,i=t.__data__;return("string"==(s=typeof(r=e))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Nt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Ut(r)?r: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 r=e[t];return r===s?void 0:r}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?s:e,this},_t.prototype.clear=function(){this.__data__=[]},_t.prototype.delete=function(t){var e=this.__data__,r=At(e,t);return!(r<0)&&(r==e.length-1?e.pop():ct.call(e,r,1),!0)},_t.prototype.get=function(t){var e=this.__data__,r=At(e,t);return r<0?void 0:e[r][1]},_t.prototype.has=function(t){return At(this.__data__,t)>-1},_t.prototype.set=function(t,e){var r=this.__data__,s=At(r,t);return s<0?r.push([t,e]):r[s][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new $t,map:new(ht||_t),string:new $t}},Ot.prototype.delete=function(t){return Ct(this,t).delete(t)},Ot.prototype.get=function(t){return Ct(this,t).get(t)},Ot.prototype.has=function(t){return Ct(this,t).has(t)},Ot.prototype.set=function(t,e){return Ct(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new _t},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 r=this.__data__;if(r instanceof _t){var s=r.__data__;if(!ht||s.length<199)return s.push([t,e]),this;r=this.__data__=new Ot(s)}return r.set(t,e),this};var kt=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||j.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 Bt(t){if(null!=t){try{return X.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Vt(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),r=e==p?t.constructor:void 0,s=r?Bt(r):void 0;if(s)switch(s){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)&&!Wt(t)}var Ft=dt||function(){return!1};function Wt(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)?wt(t):function(t){if(!Ht(t))return lt(t);var e=[];for(var r in Object(t))Z.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return jt(t,!0,!0)}}(s,s.exports);var i=s.exports;const n=t=>({get(e,r){if("__isProxy"===r)return!0;const s=Reflect.get(e,r);return Array.isArray(s)?s:"object"==typeof s&&null!==s?s.__isProxy?s:new Proxy(s,n(t)):s},set(e,r,s,n){const o=e[r];s=h(s)&&s.__isProxy?i(s):s;const a=Reflect.set(e,r,s,n);return((t,e)=>t!==e&&(t==t||e==e))(s,o)&&t.emit(`${y(r)}Change`,s),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 r=t.headers||{};return t.url=D(this.baseURL,t.url||""),t.url=((t,e)=>{if(!e)return t;const r=[];Object.keys(e).forEach((t=>{const s=e[t];if(null==s)return;let i;Array.isArray(s)?(i=s,t+="[]"):i=[s],i.forEach((e=>{null!==e&&"object"==typeof e&&(e=JSON.stringify(e)),r.push(`${o(t)}=${o(e)}`)}))}));const s=r.join("&");if(s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t})(t.url,t.params),r=Object.assign(r,this._defaultHeaders),Object.keys(r).forEach((t=>{"Content-Type"!==t&&t.toUpperCase()==="Content-Type".toUpperCase()&&(r["Content-Type"]=r[t],delete r[t])})),f(t.data)&&(t.data=t.data.buffer),(m(t.data)||l(t.data))&&(r&&!r["Content-Type"]&&(r["Content-Type"]="application/json;charset=utf-8"),t.data=JSON.stringify(t.data)),t.headers=r,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,r){return this._errorHandler?this._request(Object.assign(r||{},{url:t,method:"POST",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(r||{},{url:t,method:"POST",data:e}))}put(t,e,r){return this._errorHandler?this._request(Object.assign(r||{},{url:t,method:"PUT",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(r||{},{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,r)=>{const{data:s=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){r(new Error("E_JSON_PARSE"+c.responseText))}else r({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&&(r({url:i,statusCode:c.status,type:"request abort"}),c=null)},c.onerror=()=>{r(new Error("Network Error")),c=null},c.ontimeout=()=>{r(new Error("timeout of "+t.timeout+"ms exceeded")),c=null},"setRequestHeader"in c&&Object.keys(o).forEach((t=>{null===s&&"content-type"===t.toLowerCase()?delete o[t]:c.setRequestHeader(t,o[t])})),a&&a.promise.then((t=>{c&&(c.abort(),r(t),c=null)})),c.send(s)})),d=t=>new Promise(((e,r)=>{const{data:s=null,url:i,method:n="GET",headers:o,cancelToken:a}=t,c=wx.request({url:i,data:s,method:n.toUpperCase(),timeout:t.timeout,header:o,success(t){t.statusCode>=200&&t.statusCode<300?e(t.data):r({url:i,statusCode:t.statusCode})},fail(t){r("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 r=0;r<36;r++)t[r]=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[r,s]=[t[0],t[1]];if(null!==s)return h(s)&&!l(s)?(e[r]||(e[r]={}),void(e[r]=v(s,e[r]))):void(e[r]=s)})),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 r;r=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,r);for(const s in t)I(t,s)&&(r[s]=q(t[s],e));return r},D=(t,e)=>t&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)?((t,e)=>e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t)(t,e):e,E=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,S,w;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,(_=exports.STATE||(exports.STATE={}))[_.CLOSE=0]="CLOSE",_[_.JOINED=1]="JOINED",_[_.READY=2]="READY",exports.ENDPOINT_TYPE=void 0,(O=exports.ENDPOINT_TYPE||(exports.ENDPOINT_TYPE={})).WEBAPP="webApp",O.WEBCTRL="webCtrl",O.WECHATMP="weChatMP",O.SUPERVISION="supervision",O.BIGSCREEN="bigScreen",O.DESKTOP="desktop",O.MOBILE="mobile",O.VCS="vcs",O.SIP="sip",O.H323="h323",O.PSTN="pstn",O.MULTI_STREAM="multiStream",O.MEETING_TOUCH="meetingTouch",O.MEETING_ROOMS="meetingRooms",O.RTSP="rtsp",O.RTMP_PULLER="rtmpPuller",O.GB28181="gb28181",O.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,(w=exports.RECORD_STATUS||(exports.RECORD_STATUS={})).STARTED="started",w.PAUSED="paused",w.STARTING="starting",w.STOPPED="stopped";class T{constructor(t,r){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=r,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,r=(t,s,i)=>{Object.keys(t).forEach((i=>{!1===s&&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])&&r(t[i],!0)}))};return r(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}}class A extends T{constructor(t){super(t,"info")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingInfo",(t=>{const{state:e,body:r}=t;("full"===e||"update"===e)&&v(r,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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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:r}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/shareInfo`,{params:t})}meetings(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},credential:r}=this.ctx.config.request;return t.credential=t.credential||r,this.ctx.request.get(`${e}meetings`,{params:t})}mailTemplate(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${e}mailTemplate`,{params:{meetingID:r},headers:{language:t.language}})}operateRecord(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/operationRecord`,t)}getImConfig(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},credential:r}=this.ctx.config.request;return t.credential=t.credential||r,this.ctx.request.get(`${e}im/config`,{params:t})}sendMsg(e){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}/chat/send`,e)}))}getUserInfo(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}participantDetail?meetingID=${r}`,e)}))}sendInvitationMail(t){if(!t)return Promise.reject();const{prefix:{ctrl:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}/sendInvitationMail `,t)}getMailTemplate(t,e){if(!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${r}meetingNum/${t}/mailTemplate`,{params:Object.assign(Object.assign({},e),{meetingID:s})})}}function j(t){const e=[],{isInLobby:r}=t.modules.me.data;return r?(e.push("lobbyMember"),e):(Object.keys(t.modules).forEach((r=>{const s=t.modules[r]._topic();s&&(Array.isArray(s)?s.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(s)||e.push(s))})),e)}function U(e,r){return t(this,void 0,void 0,(function*(){const{meetingID:t,clientID:s}=r.config.request,i=yield r.request.post("/ypush/api/v1/meeting-control/inbox",{basic:{tenantId:100,clientId:s,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 R(e,r){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s,clientID:i}=r.config.request,n=yield r.request.post(`${t}meetings/${s}/subscribe`,{endpointID:i,topics:e}),o=n&&n.data&&n.data.eventMsgs;o&&o.forEach((t=>{r.emitter.emit(t.event,t)}))}))}function P(e,r,s){return t(this,void 0,void 0,(function*(){const{inboxes:i,clientID:n,meetingID:o,cancelToken:a,status:c}=r;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:r={},bizCode:u,error:d}=t;if(u&&900408!==u)return console.error("polling error: ",JSON.stringify(d)),void c.attempts++;c.attempts=0,r&&Object.keys(r).forEach((t=>{const e=i.find((e=>e.name===t));e&&(e.seqId=r[t].maxSeqId,r[t].items&&r[t].items.forEach((t=>{const e=JSON.parse(t.content);["liveStream","recording"].includes(e.event)&&(e.stime=t.stime),e.pollingSeqId=t.seqId,s(e)})))}))})))(),!c.running)return;if(c.attempts>6)return console.error("polling Max Attempts"),void(r.onError&&r.onError({message:"polling Max Attempts"}));const u=c.attempts?E(c.attempts):0;c.timer=setTimeout((()=>{c.running&&P(e,r,s)}),u)}))}const C=(e,r)=>t(void 0,void 0,void 0,(function*(){const{meetingID:t,clientID:s}=r.config.request;r.status.polling.running=!0,P(r.request,{inboxes:e,clientID:s,meetingID:t,cancelToken:r.config.request.cancelToken.token,status:r.status.polling,onError:t=>{r.emitter.emit(exports.EVENT.POLLING_ERROR,t)}},(t=>{r.emitter.emit(t.event,t)}))}));function N(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 k(e,r){return t(this,void 0,void 0,(function*(){const{meetingID:s,userID:i,status:n,cancelToken:o,onError:a}=r;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/${s}/users/${i}/keepalive`,{},{cancelToken:o.token})}catch(c){return n.attempts++,void console.error(c)}if(!t)return;const{data:r={},bizCode:a,error:c}=t;if(900200!==a&&900408!==a&&901323!==a)return n.attempts++,void console.error("keepalive ",a,c);const u=r.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?E(n.attempts):1e3*n.interval;n.timer=setTimeout((()=>{n.running&&k(e,r)}),c)}))}function L(e){return t(this,void 0,void 0,(function*(){const{meetingID:t,userID:r}=e.config.request;e.status.keepalive.running=!0,k(e.request,{meetingID:t,userID:r,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 B extends T{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)}})),r=t=>{var e,r,s,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===(r=this.data.audio)||void 0===r?void 0:r.sendOn)||!p(d)&&d!==(null===(s=this.data.audio)||void 0===s?void 0:s.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)}))}},s=t=>{var e,r,s,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===(r=this.data.video)||void 0===r?void 0:r.sendOn)||!p(d)&&d!==(null===(s=this.data.video)||void 0===s?void 0:s.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,r,s,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===(r=this.data.share)||void 0===r?void 0:r.sendOn))&&(v({share:t.share},this.data),this.emitter.emit(exports.MeEvent.SHARECHANGE,{deviceOn:p(n)?null===(s=this.data.share)||void 0===s?void 0:s.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:r,opBy:s}=t.whiteboard;(!p(e)&&e!==(null===(n=this.data.whiteboard)||void 0===n?void 0:n.deviceOn)||!p(r)&&r!==(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(r)?null===(c=this.data.whiteboard)||void 0===c?void 0:c.sendOn:r,opBy:s}))}},n=t=>{t.displayName&&t.displayName!==this.data.displayName&&(v({displayName:t.displayName},this.data),this.data.displayNamePinyin=B.setDisplayNamePinyinProp?B.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:r,body:s}=e;"personalLayout"===t&&("full"===r?v({personalLayout:s},this.data):"delete"===r&&(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 r={content:t.barrage.content,contentType:t.barrage.contentType,type:t.barrage.type,duration:t.barrage.duration,position:t.barrage.position};e=r;let{role:s}=this.data;if(this.data.endpointType===exports.ENDPOINT_TYPE.SUPERVISION){const{info:t}=this.ctx.modules;s="webinar"===t.meetingType?exports.ROLE.AUDIENCE:exports.ROLE.ATTENDEE}if(s===exports.ROLE.HOST||s===exports.ROLE.COHOST?e=t.barrage.receiver.host?r:null:s===exports.ROLE.ATTENDEE?e=t.barrage.receiver.attendee?r:null:s===exports.ROLE.AUDIENCE&&(e=t.barrage.receiver.audience?r:null),!e&&t.barrage.receiver.designated){const{userID:s,subjectID:i}=this.data,{designatedUsers:n}=t.barrage;e=-1!==n.findIndex((t=>t.userID===s||i&&t.subjectID===i))?r: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}),N(this.ctx),M(this.ctx),rt(this.ctx),this.emitter.emit(exports.MeEvent.LEAVE,t.resultInfo),this.ctx.cleanup(t.resultInfo))},f=t=>{e(t),r(t),s(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.data.isInLobby||this.data.role===exports.ROLE.AUDIENCE)&&this.data.whiteboard&&this.data.whiteboard.sendOn&&i({whiteboard:{sendOn:!1}})};this.ctx.emitter.on(exports.MeEvent.INIT,(t=>{v(t,this.data),this.data.displayNamePinyin=B.setDisplayNamePinyinProp?B.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:r={users:[]}}=e;if("delete"===t){const t=r.users[0];return t.leave=!0,void h(t)}let s=r.users.find((t=>t.userID===this.data.userID));s||r.users.length&&(s=r.users[0]),s?(f(s),v(s,this.data)):console.warn("me ",t,r)})))),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:r}=this.data;t.audio.sendOn=t.audio.sendOn&&r.audio.sendOn,t.video.sendOn=t.video.sendOn&&r.video.sendOn,e===exports.ROLE.AUDIENCE&&(t.audio.sendOn=!1,t.video.sendOn=!1)}const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,v(t,this.data),this.ctx.request.post(`${r}meetings/${s}/updateUserState`,t)}rePolling(e){return t(this,void 0,void 0,(function*(){const{ctx:t}=this;N(t);const r=j(t),s=yield U(r,t);if(e&&this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data,event:e}),yield R(r,t),"undefined"!=typeof Worker&&t.worker){const{meetingID:e,clientID:i,userID:n}=t.config.request;t.worker.postMessage({inboxes:s,topics:r,clientID:i,meetingID:e,userID:n,rePolling:!0})}else yield C(s,t)}))}}class V extends T{constructor(t){super(t,"invite")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("callRecord",(t=>{const{body:e,state:r}=t;if(e&&e.users){if("full"===r)return this.data.callRecordUsers=e.users.map((t=>(t.displayNamePinyin=V.setDisplayNamePinyinProp?V.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=V.setUserGroupIDs?V.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,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"===r&&-1!==e?v(t,this.data.callRecordUsers[e]):"update"===r&&-1===e&&(t.displayNamePinyin=V.setDisplayNamePinyinProp?V.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=V.setUserGroupIDs?V.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,this.data.callRecordUsers.push(t))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}setCallRecordUserResultInfo(t,e){const r=((t,e)=>{for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1})(this.data.callRecordUsers,(e=>{let r=!1;switch(e.type){case"account":case"sip":case"h323":case"rtsp":r=t.account===e.contact;break;case"subjectID":r=t.subjectID===e.contact}return r}));r>-1&&(this.data.callRecordUsers[r].resultInfo=e,this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers))}invite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/invite`,t)}cancelInvite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/cancelInvite`,t)}}var G="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Y={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",n="[object Boolean]",o="[object Date]",a="[object Function]",c="[object GeneratorFunction]",u="[object Map]",d="[object Number]",l="[object Object]",p="[object Promise]",h="[object RegExp]",f="[object Set]",m="[object String]",g="[object Symbol]",v="[object WeakMap]",x="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",I="[object Float64Array]",q="[object Int8Array]",D="[object Int16Array]",E="[object Int32Array]",$="[object Uint8Array]",_="[object Uint8ClampedArray]",O="[object Uint16Array]",S="[object Uint32Array]",w=/\w*$/,T=/^\[object .+?Constructor\]$/,A=/^(?:0|[1-9]\d*)$/,j={};j[i]=j["[object Array]"]=j[x]=j[y]=j[n]=j[o]=j[b]=j[I]=j[q]=j[D]=j[E]=j[u]=j[d]=j[l]=j[h]=j[f]=j[m]=j[g]=j[$]=j[_]=j[O]=j[S]=!0,j["[object Error]"]=j[a]=j[v]=!1;var U="object"==typeof self&&self&&self.Object===Object&&self,R="object"==typeof G&&G&&G.Object===Object&&G||U||Function("return this")(),P=e&&!e.nodeType&&e,C=P&&t&&!t.nodeType&&t,N=C&&C.exports===P;function k(t,e){return t.set(e[0],e[1]),t}function L(t,e){return t.add(e),t}function M(t,e,r,s){var i=-1,n=t?t.length:0;for(s&&n&&(r=t[++i]);++i<n;)r=e(r,t[i],i,t);return r}function H(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(e){}return r}function B(t){var e=-1,r=Array(t.size);return t.forEach((function(t,s){r[++e]=[s,t]})),r}function V(t,e){return function(r){return t(e(r))}}function Y(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var F,W=Array.prototype,Q=Function.prototype,J=Object.prototype,z=R["__core-js_shared__"],K=(F=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",X=Q.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=N?R.Buffer:void 0,st=R.Symbol,it=R.Uint8Array,nt=V(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=W.splice,ut=Object.getOwnPropertySymbols,dt=rt?rt.isBuffer:void 0,lt=V(Object.keys,Object),pt=Pt(R,"DataView"),ht=Pt(R,"Map"),ft=Pt(R,"Promise"),mt=Pt(R,"Set"),gt=Pt(R,"WeakMap"),vt=Pt(Object,"create"),xt=Mt(pt),yt=Mt(ht),bt=Mt(ft),It=Mt(mt),qt=Mt(gt),Dt=st?st.prototype:void 0,Et=Dt?Dt.valueOf:void 0;function $t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function _t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function Ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function St(t){this.__data__=new _t(t)}function wt(t,e,r){var s=t[e];Z.call(t,e)&&Ht(s,r)&&(void 0!==r||e in t)||(t[e]=r)}function Tt(t,e){for(var r=t.length;r--;)if(Ht(t[r][0],e))return r;return-1}function At(t,e,r,s,p,v,T){var A;if(s&&(A=v?s(t,p,v,T):s(t)),void 0!==A)return A;if(!Ft(t))return t;var U=Bt(t);if(U){if(A=function(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&Z.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!e)return function(t,e){var r=-1,s=t.length;for(e||(e=Array(s));++r<s;)e[r]=t[r];return e}(t,A)}else{var R=Nt(t),P=R==a||R==c;if(Gt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(R==l||R==i||P&&!v){if(H(t))return v?t:{};if(A=function(t){return"function"!=typeof t.constructor||Lt(t)?{}:Ft(e=nt(t))?ot(e):{};var e}(P?{}:t),!e)return function(t,e){return Ut(t,Ct(t),e)}(t,function(t,e){return t&&Ut(e,Wt(e),t)}(A,t))}else{if(!j[R])return v?t:{};A=function(t,e,r,s){var i=t.constructor;switch(e){case x:return jt(t);case n:case o:return new i(+t);case y:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,s);case b:case I:case q:case D:case E:case $:case _:case O:case S:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,s);case u:return function(t,e,r){return M(e?r(B(t),!0):B(t),k,new t.constructor)}(t,s,r);case d:case m:return new i(t);case h:return function(t){var e=new t.constructor(t.source,w.exec(t));return e.lastIndex=t.lastIndex,e}(t);case f:return function(t,e,r){return M(e?r(Y(t),!0):Y(t),L,new t.constructor)}(t,s,r);case g:return Et?Object(Et.call(t)):{}}}(t,R,At,e)}}T||(T=new St);var C=T.get(t);if(C)return C;if(T.set(t,A),!U)var N=r?function(t){return function(t,e,r){var s=e(t);return Bt(t)?s:function(t,e){for(var r=-1,s=e.length,i=t.length;++r<s;)t[i+r]=e[r];return t}(s,r(t))}(t,Wt,Ct)}(t):Wt(t);return function(t,e){for(var r=-1,s=t?t.length:0;++r<s&&!1!==e(t[r],r););}(N||t,(function(i,n){N&&(i=t[n=i]),wt(A,n,At(i,e,r,s,n,t,T))})),A}function jt(t){var e=new t.constructor(t.byteLength);return new it(e).set(new it(t)),e}function Ut(t,e,r,s){r||(r={});for(var i=-1,n=e.length;++i<n;){var o=e[i],a=s?s(r[o],t[o],o,r,t):void 0;wt(r,o,void 0===a?t[o]:a)}return r}function Rt(t,e){var r,s,i=t.__data__;return("string"==(s=typeof(r=e))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Pt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Ft(t)||(e=t,K&&K in e))&&(Yt(t)||H(t)?et:T).test(Mt(t));var e}(r)?r: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},_t.prototype.clear=function(){this.__data__=[]},_t.prototype.delete=function(t){var e=this.__data__,r=Tt(e,t);return!(r<0||(r==e.length-1?e.pop():ct.call(e,r,1),0))},_t.prototype.get=function(t){var e=this.__data__,r=Tt(e,t);return r<0?void 0:e[r][1]},_t.prototype.has=function(t){return Tt(this.__data__,t)>-1},_t.prototype.set=function(t,e){var r=this.__data__,s=Tt(r,t);return s<0?r.push([t,e]):r[s][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new $t,map:new(ht||_t),string:new $t}},Ot.prototype.delete=function(t){return Rt(this,t).delete(t)},Ot.prototype.get=function(t){return Rt(this,t).get(t)},Ot.prototype.has=function(t){return Rt(this,t).has(t)},Ot.prototype.set=function(t,e){return Rt(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new _t},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 r=this.__data__;if(r instanceof _t){var s=r.__data__;if(!ht||s.length<199)return s.push([t,e]),this;r=this.__data__=new Ot(s)}return r.set(t,e),this};var Ct=ut?V(ut,Object):function(){return[]},Nt=function(t){return tt.call(t)};function kt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||A.test(t))&&t>-1&&t%1==0&&t<e}function Lt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function Mt(t){if(null!=t){try{return X.call(t)}catch(G){}try{return t+""}catch(G){}}return""}function Ht(t,e){return t===e||t!=t&&e!=e}(pt&&Nt(new pt(new ArrayBuffer(1)))!=y||ht&&Nt(new ht)!=u||ft&&Nt(ft.resolve())!=p||mt&&Nt(new mt)!=f||gt&&Nt(new gt)!=v)&&(Nt=function(t){var e=tt.call(t),r=e==l?t.constructor:void 0,s=r?Mt(r):void 0;if(s)switch(s){case xt:return y;case yt:return u;case bt:return p;case It:return f;case qt:return v}return e});var Bt=Array.isArray;function Vt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}(t.length)&&!Yt(t)}var Gt=dt||function(){return!1};function Yt(t){var e=Ft(t)?tt.call(t):"";return e==a||e==c}function Ft(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Wt(t){return Vt(t)?function(t,e){var r=Bt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Vt(t)}(t)&&Z.call(t,"callee")&&(!at.call(t,"callee")||tt.call(t)==i)}(t)?function(t,e){for(var r=-1,s=Array(t);++r<t;)s[r]=e(r);return s}(t.length,String):[],s=r.length,n=!!s;for(var o in t)!e&&!Z.call(t,o)||n&&("length"==o||kt(o,s))||r.push(o);return r}(t):function(t){if(!Lt(t))return lt(t);var e=[];for(var r in Object(t))Z.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return At(t,!0,!0)}}(Y,Y.exports);const F=Array.isArray,W=(t,e)=>t?(Object.entries(t).forEach((t=>{const[r,s]=[t[0],t[1]];if(null!==s)return(t=>"object"==typeof t&&null!==t)(s)&&!F(s)?(e[r]||(e[r]={}),void(e[r]=W(s,e[r]))):void(e[r]=s)})),e):e;class Q extends T{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:r})=>{if(t.userID!==this.ctx.modules.me.data.userID)return;const{resultInfo:s={}}=t;if("delete"!==r||"delete"===r&&[901357,901358,901352,901351,901350,901349].includes(s.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:r,sourceKey:s})=>{if("full"===r)return this.data[s]=e.map((e=>(e.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=Q.setUserGroupIDs?Q.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,t(e,{event:s,state:r}),e))),this.emitter.emit(`${s}Change`,{users:this.data[s],isFull:!0}),this.data[s];void 0===this.data[s]&&(this.data[s]=[]);const{data:i,emitter:n}=this;return e.forEach((e=>{const o=i[s].findIndex((t=>e.userID===t.userID));if("delete"===r&&-1!==o){const[t]=this.data[s].splice(o,1);n.emit(`${s}Delete`,{user:t,resultInfo:e.resultInfo})}else if("update"===r&&-1!==o){const t=this.data[s][o];this.updateUserProps(e,t),v(e,t),this.data[s][o]=q(t),this.emitter.emit(`${s}Update`,{user:this.data[s][o]})}else"update"===r&&-1===o&&(e.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=Q.setUserGroupIDs?Q.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,i[s].push(e),this.emitter.emit(`${s}Add`,{user:e,resultInfo:e.resultInfo}));t(e,{event:s,state:r})})),this.emitter.emit(`${s}Change`,{users:this.data[s],isFull:!1}),this.data[s]};this.ctx.emitter.on("interactiveUsers",(t=>{const{state:r,body:s}=t;e({updateUsers:s.users,state:r,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(t=>{const{state:r,body:s}=t;e({updateUsers:s.users,state:r,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(t=>{const{state:r,body:s}=t;e({updateUsers:s.users,state:r,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(t=>{const{state:r,body:s}=t;e({updateUsers:s.users,state:r,sourceKey:"advCtrlUsers"})}))}reactiveData(t){if(!h(t))return console.warn("Parameter is not an object!"),t;const e=new Map,r=(t,s)=>{Object.keys(t).forEach((i=>{!1===s&&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])&&r(t[i],!0)}))};return r(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=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(t.displayName):t.displayName)}setAudio(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/audio`,e)}setVideo(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/video`,e)}setShare(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/share`,e)}setWhiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/whiteboard`,e)}handUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/handUp`,e)}setRole(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/role`,e)}rename(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/displayName`,e)}remove(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/remove`)}removeWithOption(t,e){if(!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/removeWithOption`,e)}replyHandUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/replyHandUp`,e)}fecc(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/fecc`,e)}lobbyState(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/lobbyState`,e)}allowLocalRecord(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/allowLocalRecord`,e)}allowUserChatOn(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/allowChat`,e)}whiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/whiteboard`,e)}annotate(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/annotate`,e)}callStats(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/users/${t}/callStats`)}callStatsReport(t){if(!t.userID)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/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:r}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/users/${t}/sendLayout`)}setSendLayout(t,e){const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/sendLayout`,e)}setSendLayoutEnabled(t,e){const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/sendLayoutEnabled`,e)}pauseAudio(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/pauseAudio`)}resumeAudio(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/resumeAudio`)}unblockVideo(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/unblockVideo`)}blockVideo(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/blockVideo`)}modifyRoleBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyRoleBatch `,t)}modifyVideoBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyVideoBatch `,t)}putInLobbyBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/putInLobbyBatch `,t)}removeBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/removeBatch `,t)}modifyAudioBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyAudioBatch`,t)}modifyUserAudioReceiveBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyUserAudioReceiveBatch`,t)}modifyUserVideoReceiveBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/unblockVideoBatch`,t)}modifyUserVideoPauseBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/blockVideoBatch`,t)}setIntercom(t,e){const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/intercom`,e)}claimHost(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/claimHost`,t)}}function J(t){const{baseURL:r,modules:s,worker:i,singleton:n}=t;s.findIndex((t=>t===B))<0&&s.push(B),s.findIndex((t=>t===A))<0&&s.push(A);const o=t.clientID||`${g()}_${((t=new Date,e)=>{const r={"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 s in r)new RegExp("("+s+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?r[s]:("00"+r[s]).substr((""+r[s]).length)));return e})(new Date,"MMddHHmmss")}`,u={config:{baseURL:r,modules:s,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:r,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 z(t){const e=J(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 r=new t(e);e.modules[r.moduleName]=r}))}(e.config.modules,e),e.emitter.on(exports.EVENT.POLLING_ERROR,(t=>{X(e)({resultInfo:t})})),e.emitter.on(exports.EVENT.KEEPALIVE_ERROR,(t=>{X(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:K(e),leave:X(e),end:Z(e),endMeeting:tt(e)},e.modules)}function K(e){return function(r){var s;return t(this,void 0,void 0,(function*(){const{clientID:t}=e.config.request,i=`${null===(s=r.endpointType)||void 0===s?void 0:s.toLocaleUpperCase()}${t}_${r.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:r.meetingNum,pwd:r.pwd,url:r.url,mobileCode:r.mobileCode,mobile:r.mobile,regEmail:r.regEmail,accEmail:r.accEmail,tk:r.tk,displayName:r.displayName,userAgent:r.userAgent,verifyID:r.verifyID},headers:{"X-Y-Endpoint-Type":r.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 r.pwd,delete r.url,e.config.request.credential=a;const u={displayName:r.displayName,userAgent:r.userAgent,clientID:t};r.groupIDs&&r.account&&(u.groupIDs=r.groupIDs,u.account=r.account,u.groupName=r.groupName),r.mediaContentReq&&(u.mediaContentReq=r.mediaContentReq);const d=r.hostKey?`&hostKey=${r.hostKey}`:"",l=yield e.request.post(`${n.ctrl}join?meetingNum=${r.meetingNum}&credential=${a}${d}`,u,{headers:{"X-Y-Endpoint-Type":r.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=j(e),b=yield U(y,e);return yield R(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):X(e)({resultInfo:{message:"keepalive Max Attempts"}}):X(e)({resultInfo:{message:"polling Max Attempts"}}):e.status.keepalive.running=!1:e.status.polling.running=!1):x()}):(C(b,e),x(),L(e)),l.data=Object.assign(Object.assign({},l.data),o.data),l}))}}function X(e){return function(r){return t(this,void 0,void 0,(function*(){const t=r&&r.resultInfo;r||(r={resultInfo:{bizCode:901359}});const{prefix:s,meetingID:i}=e.config.request;let n;try{n=yield e.request.post(`${s.ctrl}meetings/${i}/leave`,r)}catch(o){console.error(o)}return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1}),N(e),M(e),rt(e),e.cleanup(t),n}))}}function Z(e){return function(){return t(this,void 0,void 0,(function*(){const{prefix:t,meetingID:r}=e.config.request,s=yield e.request.post(`${t.ctrl}meetings/${r}/end`);return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1}),N(e),M(e),rt(e),e.cleanup(),s}))}}function tt(e){return function(r){return t(this,void 0,void 0,(function*(){const{prefix:t}=e.config.request;return yield e.request.post(`${t.ctrl}meetingNum/${r}/end`)}))}}class et{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=z(t)}static getInstance(t){return this.instance?this.instance:this.instance=new et(t)}}function rt(t){if(t.config.singleton){const{baseURL:e,modules:r,singleton:s}=t.config,i={baseURL:e,modules:r,worker:t.worker,singleton:s},n=et.getInstance(i);n&&(n.meeting=z(i))}}Object.defineProperty(et,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null}),exports.Asr=class extends T{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:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/transcript/status`,e)}))}},exports.AudioRecording=class extends T{constructor(t){super(t,"audioRecording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("audioRecording",(t=>{const{body:e,stime:r}=t;e&&(r&&(this.data.stime=r,this.data.timeOffset=r-(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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/audioRecording/status`,e)}))}},exports.Chat=class extends T{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:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/chat/msg`,e)}))}historyMsg(e){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}/chat/historyMsg`,e)}))}sendMsg(e){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}/chat/send`,e)}))}},exports.FocusUsers=class extends T{constructor(t){super(t,"focusUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("focusUsers",(t=>{const{state:e,body:r}=t;if(r)return this.data.focusUsers||(this.data.focusUsers=[]),"full"===e?this.data.focusUsers=r.focusUsers:"update"===e?this.data.focusUsers=this.data.focusUsers.concat(r.focusUsers):"delete"===e&&(r.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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/focusUser`,t)}},exports.Info=A,exports.Interpretation=class extends T{constructor(t){super(t,"interpretation"),this.data={status:"stopped",interpreters:[]}}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("interpretation",(t=>{const{body:e,state:r}=t;"full"===r?(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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/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=V,exports.LiveStream=class extends T{constructor(t){super(t,"liveStream")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStream",(t=>{const{state:e,body:r,stime:s}=t;if(!r)return;if(s&&(this.data.stime=s,this.data.timeOffset=s-(new Date).valueOf()),"full"===e){const{liveStreams:t=[],defaultLayout:e}=r;if(!t.length)return;const s=[];this.data.liveStreams=t.map((t=>(t.requesting="starting"===t.status,t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo}),s.push({platform:t.platform||"",status:(t.requesting?"stopped":t.status)||"",index:t.data&&t.data.index}),t))),this.data.defaultLayout=e;return W({status:s},this.data),this.data}if("delete"===e){const{liveStreams:t=[]}=r;return t.forEach((t=>{const e=this.data.liveStreams.findIndex((e=>e.data&&e.data.index===t.data.index));-1!==e&&this.data.liveStreams.splice(e,1)})),void this.emitter.emit("liveStreamingChange",this.data.liveStreams)}const i=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 r=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.platform===t.platform)),-1===e?r.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||""}):r.splice(e,1,{platform:r[e].platform||"",status:t.requesting?r[e].status||"stopped":t.status||""}),this.data.status=r};void 0===this.data.liveStreams&&(this.data.liveStreams=[]);const{liveStreams:n=[]}=r;return n.forEach((t=>{if("thirdParty"!==t.platform)return void i(t);t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo});let e=this.data.liveStreams.findIndex((e=>{var r,s;return(null===(r=e.data)||void 0===r?void 0:r.index)===(null===(s=t.data)||void 0===s?void 0:s.index)}));-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 r=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>{var r;return e.index===(null===(r=t.data)||void 0===r?void 0:r.index)})),-1===e?r.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||"",index:t.data&&t.data.index}):r.splice(e,1,{platform:r[e].platform||"",status:t.requesting?r[e].status||"stopped":t.status||"",index:t.data&&t.data.index}),this.data.status=r})),this.data}))}setStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStream/status`,e)}))}liveStreamDescription(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStream/description`,e)}))}liveStreamSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStream/setting`,e)}))}liveStreamDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStream/delete`,e)}))}liveStreamLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStream/pushSetting`,e)}))}},exports.LiveStreaming=class extends T{constructor(t){super(t,"liveStreaming")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStreaming",(t=>{const{state:e,body:r,stime:s}=t;if(!r)return;if(s&&(this.data.stime=s,this.data.timeOffset=s-(new Date).valueOf()),"full"===e){const{liveStreaming:t=[],defaultConfig:e}=r;if(!t.length)return;const s=[],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}),s.push({index:t.index,protocol:t.protocol,status:(t.requesting?"stopped":t.status)||""}),i.push(t))})),this.data.liveStreaming=i,v({status:s,defaultConfig:e},this.data),this.data}if("delete"===e){const{liveStreaming:t=[]}=r;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}=r;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 r=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.index===t.index)),-1===e?r.push({index:t.index,protocol:t.protocol,status:t.requesting?"stopped":t.status}):r.splice(e,1,{index:t.index,protocol:t.protocol,status:t.requesting?r[e].status||"stopped":t.status}),this.data.status=r})),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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStreaming/status`,e)}))}liveStreamingSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStreaming/setting`,e)}))}liveStreamingDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStreaming/delete`,e)}))}liveStreamingDetail(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStreaming/detail`,e)}))}},exports.Me=B,exports.Qa=class extends T{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 r=t.get(e.question.id);const{clientID:s}=this.ctx.config.request;switch(e.command){case"addQuestion":r=this.createQuestion(e.question),t.set(e.question.id,r),this.emitter.emit("questionAdd",{question:r,selfSent:r.sender.endpointID===s});break;case"dismissQuestion":if(!r)break;r.sender.endpointID!==s?r.status="close":r.isTop=!1,t.set(e.question.id,r),this.emitter.emit("questionUpdate",{question:r});break;case"reopenQuestion":r?(r.status="open",r.isTop=e.question.isTop,t.set(e.question.id,r)):(r=this.createQuestion(e.question),t.set(e.question.id,r)),this.emitter.emit("questionUpdate",{question:r});break;case"updateQuestion":r?(r=Object.assign(Object.assign(Object.assign({},r),e.question),{topSort:e.question.isTop?this.data.topSort++:0}),t.set(e.question.id,r)):(r=this.createQuestion(e.question),t.set(e.question.id,r)),this.emitter.emit("questionUpdate",{question:r});break;case"deleteQuestion":if(!r)break;r.sender.endpointID!==s?t.delete(e.question.id):(r.status="delete",r.isTop=!1,r.answers.clear(),t.set(e.question.id,r)),this.emitter.emit("questionDelete",{question:r});break;case"answerQuestion":r?r.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)):(r=this.createQuestion(e.question),r.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)),t.set(e.question.id,r)),this.emitter.emit("questionUpdate",{question:r});break;case"deleteAnswer":r&&(r.answers.delete(e.answer.id),this.emitter.emit("questionUpdate",{question:r}))}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:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/qa`,e)}))}},exports.Recording=class extends T{constructor(t){super(t,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(t=>{const{state:e,body:r,stime:s}=t;if(r)return s&&(this.data.stime=s,this.data.timeOffset=s-(new Date).valueOf()),this.data.isPracticeSession="started"===r.status&&this.data.status===r.status&&0===r.duration,this.data.recording=Object.assign(Object.assign({},this.data.recording||{}),r),r.status&&(this.data.recording.requesting="starting"===r.status,this.data.status="starting"!==r.status?r.status:"started"===this.data.status?"stopped":this.data.status),(r.status&&"started"===r.status||void 0!==r.isReconnecting&&!r.isReconnecting)&&this.setMainRecordPromptCount(0),r.backupRecord?(r.backupRecord.status&&(this.data.recording.backupRecordRequesting="starting"===r.backupRecord.status,this.data.backupRecordStatus="starting"!==r.backupRecord.status?r.backupRecord.status:this.data.backupRecordStatus),(r.backupRecord.status&&"started"===r.backupRecord.status||void 0!==r.backupRecord.isReconnecting&&!r.backupRecord.isReconnecting)&&setTimeout((()=>this.setBackupRecordPromptCount(0)),100)):this.data.backupRecordStatus=this.data.backupRecordStatus||"stopped",r.resultInfo&&this.emitter.emit("resultInfoChange",r.resultInfo),r.backupRecord&&r.backupRecord.resultInfo&&this.emitter.emit("backupRecordResultInfoChange",r.backupRecord.resultInfo),["full","update"].includes(e)?(r.recordUsers&&(this.data.recording.recordUsers=r.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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/recording/status`,e)}))}layout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/recording/status`,e)}))}designatedUsers(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/recording/layout`,e)}))}},exports.RemoteDesktop=class extends T{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,r){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}/users/${e}/remoteDesktop`,r)}))}},exports.RollCall=class extends T{constructor(t){super(t,"rollCall")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("rollcallVideo",(t=>{const{state:e,body:r}=t;r&&("full"===e||"update"===e?(this.data.index=r.index,this.data.userID=r.userID,this.data.type=r.type,this.data.nextUserID=r.nextUserID):"delete"===e&&(this.data.type=r.type,this.data.userID=0),this.emitter.emit("rollCallChange",this.data))})),this.ctx.emitter.on("rollcallSetting",(t=>{const{state:e,body:r}=t;r&&("full"===e?(this.data.rollcallList=r.rollcallList,this.data.rollcallUserLayout=r.rollcallUserLayout,this.data.hostLayout=r.hostLayout,this.data.commonUserLayout=r.commonUserLayout):"update"===e&&(r.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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/view/rollcall`,t)}settingRollCall(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/view/rollcall/setting`,t)}},exports.Setting=class extends T{constructor(t){super(t,"setting")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingSetting",(t=>{const{state:e,body:r}=t;["full","update"].includes(e)&&v(r,this.data)}))}reactiveData(t){if(!h(t))return console.warn("Parameter is not an object!"),t;const e=new Map,r=(t,s,i)=>{Object.keys(t).forEach((n=>{if(!1===s&&n in this.data&&(t[n]=this.data[n]),i<1){const r=e=>t[n]=e,s=`${y(n)}Change`;this.emitter.on(s,r),e.set(s,r)}if(h(t[n])&&!l(t[n])){r(t[n],!0,i+1)}}))};return r(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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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 T{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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/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 T{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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/view/spotlight`,t)}},exports.Transcript=class extends T{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:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/transcript/historyMsg`,e)}))}},exports.Users=Q,exports.View=class extends T{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:r,body:s}=t;s&&("meetingView"===r?Object.keys(s).forEach((t=>{this.data[t]=s[t]})):this.data[e]=s)}updatePersonalLayouts(t){const{state:e,body:r}=t;"full"!==e&&void 0!==this.data.personalLayouts||(this.data.personalLayouts={}),r.personalLayouts.forEach((t=>{const{subscriber:r={userID:-1}}=t,s=r.userID||r.subjectID||-1;"full"===e||"update"===e||t.templateStatus?this.data.personalLayouts[s]=t:delete this.data.personalLayouts[s]})),this.emitter.emit("personalLayoutsChange",this.data.personalLayouts)}hostLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/hostLayout`,e)}))}attendeeLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/attendeeLayout`,e)}))}audienceLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/audienceLayout`,e)}))}personalLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/personalLayout`,e)}))}personalLayoutDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/personalLayout/delete`,e)}))}virtualClassLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${r}/view/presetLayout`,{params:e})}))}setPresetLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/presetLayout`,e)}))}presetLayoutApply(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/presetLayout/apply`,e)}))}presetLayoutApplyUser(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/presetLayout/applyUser`,e)}))}},exports.Vote=class extends T{constructor(t){super(t,"vote")}_topic(){return"vote"}_bindOn(){this.ctx.emitter.on("vote",(t=>{const{body:e}=t,{voteID:r}=e;void 0===this.data.vote&&(this.data.vote={}),this.data.vote[r]=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:r,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.get(`${e}meetings/${r}/votes`,{params:t})}getVote(t){const{prefix:{vote:e},meetingID:r,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.get(`${e}meetings/${r}/vote`,{params:t})}getMeVote(t){const{prefix:{vote:e},meetingID:r,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.get(`${e}meetings/${r}/vote/me`,{params:t})}voteStatus(t,e){const{prefix:{vote:r},meetingID:s,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.post(`${r}meetings/${s}/vote/status?tk=${t.tk}&voteID=${t.voteID}`,e)}voteSubmit(t,e){const{prefix:{vote:r},meetingID:s,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.post(`${r}meetings/${s}/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:r,voteTk:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/vote/inProgress`,{params:{tk:t&&t.tk||s}})}},exports.Words=class extends T{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:r,pollingSeqId:s}=t;if(!r)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(),s&&(this.data.barrageRecord=[{id:s,content:r.content,time:(new Date).getTime(),durationType:r.durationType,duration:1e3*r.duration},...this.data.barrageRecord]),r.wordsDisplayStatus=!0,-1!==r.duration&&(this.data.timer=setTimeout((()=>{r.wordsDisplayStatus=!1,this.data.timer=null,this.data.wordsDisplayStatus=r.wordsDisplayStatus,this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})}),1e3*r.duration)),v(r,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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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?et.getInstance(t).meeting:z(t)},exports.reset=rt;
1
+ "use strict";function t(t,e,r,s){return new(r||(r=Promise))((function(i,n){function o(t){try{c(s.next(t))}catch(e){n(e)}}function a(t){try{c(s.throw(t))}catch(e){n(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}c((s=s.apply(t,e||[])).next())}))}function e(t){return{all:t=t||new Map,on:function(e,r){var s=t.get(e);s?s.push(r):t.set(e,[r])},off:function(e,r){var s=t.get(e);s&&(r?s.splice(s.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var s=t.get(e);s&&s.slice().map((function(t){t(r)})),(s=t.get("*"))&&s.slice().map((function(t){t(e,r)}))}}}Object.defineProperty(exports,"__esModule",{value:!0});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={exports:{}};!function(t,e){var s="__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]",D="[object Int8Array]",E="[object Int16Array]",$="[object Int32Array]",_="[object Uint8Array]",O="[object Uint8ClampedArray]",S="[object Uint16Array]",A="[object Uint32Array]",T=/\w*$/,w=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,U={};U[n]=U["[object Array]"]=U[y]=U[b]=U[o]=U[a]=U[I]=U[q]=U[D]=U[E]=U[$]=U[d]=U[l]=U[p]=U[f]=U[m]=U[g]=U[v]=U[_]=U[O]=U[S]=U[A]=!0,U["[object Error]"]=U[c]=U[x]=!1;var R="object"==typeof self&&self&&self.Object===Object&&self,P="object"==typeof r&&r&&r.Object===Object&&r||R||Function("return this")(),C=e&&!e.nodeType&&e,N=C&&t&&!t.nodeType&&t,L=N&&N.exports===C;function k(t,e){return t.set(e[0],e[1]),t}function M(t,e){return t.add(e),t}function H(t,e,r,s){var i=-1,n=t?t.length:0;for(s&&n&&(r=t[++i]);++i<n;)r=e(r,t[i],i,t);return r}function B(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(r){}return e}function V(t){var e=-1,r=Array(t.size);return t.forEach((function(t,s){r[++e]=[s,t]})),r}function G(t,e){return function(r){return t(e(r))}}function Y(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var F,W=Array.prototype,Q=Function.prototype,J=Object.prototype,z=P["__core-js_shared__"],K=(F=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",X=Q.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=L?P.Buffer:void 0,st=P.Symbol,it=P.Uint8Array,nt=G(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=W.splice,ut=Object.getOwnPropertySymbols,dt=rt?rt.isBuffer:void 0,lt=G(Object.keys,Object),pt=Nt(P,"DataView"),ht=Nt(P,"Map"),ft=Nt(P,"Promise"),mt=Nt(P,"Set"),gt=Nt(P,"WeakMap"),vt=Nt(Object,"create"),xt=Bt(pt),yt=Bt(ht),bt=Bt(ft),It=Bt(mt),qt=Bt(gt),Dt=st?st.prototype:void 0,Et=Dt?Dt.valueOf:void 0;function $t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function _t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function Ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function St(t){this.__data__=new _t(t)}function At(t,e){var r=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 r=-1,s=Array(t);++r<t;)s[r]=e(r);return s}(t.length,String):[],s=r.length,i=!!s;for(var o in t)!e&&!Z.call(t,o)||i&&("length"==o||Mt(o,s))||r.push(o);return r}function Tt(t,e,r){var s=t[e];Z.call(t,e)&&Vt(s,r)&&(void 0!==r||e in t)||(t[e]=r)}function wt(t,e){for(var r=t.length;r--;)if(Vt(t[r][0],e))return r;return-1}function jt(t,e,r,s,i,h,x){var w;if(s&&(w=h?s(t,i,h,x):s(t)),void 0!==w)return w;if(!Qt(t))return t;var j=Gt(t);if(j){if(w=function(t){var e=t.length,r=t.constructor(e);e&&"string"==typeof t[0]&&Z.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!e)return function(t,e){var r=-1,s=t.length;e||(e=Array(s));for(;++r<s;)e[r]=t[r];return e}(t,w)}else{var R=kt(t),P=R==c||R==u;if(Ft(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(R==p||R==n||P&&!h){if(B(t))return h?t:{};if(w=function(t){return"function"!=typeof t.constructor||Ht(t)?{}:(e=nt(t),Qt(e)?ot(e):{});var e}(P?{}:t),!e)return function(t,e){return Pt(t,Lt(t),e)}(t,function(t,e){return t&&Pt(e,Jt(e),t)}(w,t))}else{if(!U[R])return h?t:{};w=function(t,e,r,s){var i=t.constructor;switch(e){case y:return Rt(t);case o:case a:return new i(+t);case b:return function(t,e){var r=e?Rt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,s);case I:case q:case D:case E:case $:case _:case O:case S:case A:return function(t,e){var r=e?Rt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,s);case d:return function(t,e,r){var s=e?r(V(t),!0):V(t);return H(s,k,new t.constructor)}(t,s,r);case l:case g:return new i(t);case f:return function(t){var e=new t.constructor(t.source,T.exec(t));return e.lastIndex=t.lastIndex,e}(t);case m:return function(t,e,r){var s=e?r(Y(t),!0):Y(t);return H(s,M,new t.constructor)}(t,s,r);case v:return n=t,Et?Object(Et.call(n)):{}}var n}(t,R,jt,e)}}x||(x=new St);var C=x.get(t);if(C)return C;if(x.set(t,w),!j)var N=r?function(t){return function(t,e,r){var s=e(t);return Gt(t)?s:function(t,e){for(var r=-1,s=e.length,i=t.length;++r<s;)t[i+r]=e[r];return t}(s,r(t))}(t,Jt,Lt)}(t):Jt(t);return function(t,e){for(var r=-1,s=t?t.length:0;++r<s&&!1!==e(t[r],r,t););}(N||t,(function(i,n){N&&(i=t[n=i]),Tt(w,n,jt(i,e,r,s,n,t,x))})),w}function Ut(t){return!(!Qt(t)||(e=t,K&&K in e))&&(Wt(t)||B(t)?et:w).test(Bt(t));var e}function Rt(t){var e=new t.constructor(t.byteLength);return new it(e).set(new it(t)),e}function Pt(t,e,r,s){r||(r={});for(var i=-1,n=e.length;++i<n;){var o=e[i],a=s?s(r[o],t[o],o,r,t):void 0;Tt(r,o,void 0===a?t[o]:a)}return r}function Ct(t,e){var r,s,i=t.__data__;return("string"==(s=typeof(r=e))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Nt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Ut(r)?r: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 r=e[t];return r===s?void 0:r}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?s:e,this},_t.prototype.clear=function(){this.__data__=[]},_t.prototype.delete=function(t){var e=this.__data__,r=wt(e,t);return!(r<0)&&(r==e.length-1?e.pop():ct.call(e,r,1),!0)},_t.prototype.get=function(t){var e=this.__data__,r=wt(e,t);return r<0?void 0:e[r][1]},_t.prototype.has=function(t){return wt(this.__data__,t)>-1},_t.prototype.set=function(t,e){var r=this.__data__,s=wt(r,t);return s<0?r.push([t,e]):r[s][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new $t,map:new(ht||_t),string:new $t}},Ot.prototype.delete=function(t){return Ct(this,t).delete(t)},Ot.prototype.get=function(t){return Ct(this,t).get(t)},Ot.prototype.has=function(t){return Ct(this,t).has(t)},Ot.prototype.set=function(t,e){return Ct(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new _t},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 r=this.__data__;if(r instanceof _t){var s=r.__data__;if(!ht||s.length<199)return s.push([t,e]),this;r=this.__data__=new Ot(s)}return r.set(t,e),this};var Lt=ut?G(ut,Object):function(){return[]},kt=function(t){return tt.call(t)};function Mt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||j.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 Bt(t){if(null!=t){try{return X.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Vt(t,e){return t===e||t!=t&&e!=e}(pt&&kt(new pt(new ArrayBuffer(1)))!=b||ht&&kt(new ht)!=d||ft&&kt(ft.resolve())!=h||mt&&kt(new mt)!=m||gt&&kt(new gt)!=x)&&(kt=function(t){var e=tt.call(t),r=e==p?t.constructor:void 0,s=r?Bt(r):void 0;if(s)switch(s){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)&&!Wt(t)}var Ft=dt||function(){return!1};function Wt(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)?At(t):function(t){if(!Ht(t))return lt(t);var e=[];for(var r in Object(t))Z.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return jt(t,!0,!0)}}(s,s.exports);var i=s.exports;const n=t=>({get(e,r){if("__isProxy"===r)return!0;const s=Reflect.get(e,r);return Array.isArray(s)?s:"object"==typeof s&&null!==s?s.__isProxy?s:new Proxy(s,n(t)):s},set(e,r,s,n){const o=e[r];s=h(s)&&s.__isProxy?i(s):s;const a=Reflect.set(e,r,s,n);return((t,e)=>t!==e&&(t==t||e==e))(s,o)&&t.emit(`${y(r)}Change`,s),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 r=t.headers||{};return t.url=D(this.baseURL,t.url||""),t.url=((t,e)=>{if(!e)return t;const r=[];Object.keys(e).forEach((t=>{const s=e[t];if(null==s)return;let i;Array.isArray(s)?(i=s,t+="[]"):i=[s],i.forEach((e=>{null!==e&&"object"==typeof e&&(e=JSON.stringify(e)),r.push(`${o(t)}=${o(e)}`)}))}));const s=r.join("&");if(s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t})(t.url,t.params),r=Object.assign(r,this._defaultHeaders),Object.keys(r).forEach((t=>{"Content-Type"!==t&&t.toUpperCase()==="Content-Type".toUpperCase()&&(r["Content-Type"]=r[t],delete r[t])})),f(t.data)&&(t.data=t.data.buffer),(m(t.data)||l(t.data))&&(r&&!r["Content-Type"]&&(r["Content-Type"]="application/json;charset=utf-8"),t.data=JSON.stringify(t.data)),t.headers=r,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,r){return this._errorHandler?this._request(Object.assign(r||{},{url:t,method:"POST",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(r||{},{url:t,method:"POST",data:e}))}put(t,e,r){return this._errorHandler?this._request(Object.assign(r||{},{url:t,method:"PUT",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(r||{},{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,r)=>{const{data:s=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){r(new Error("E_JSON_PARSE"+c.responseText))}else r({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&&(r({url:i,statusCode:c.status,type:"request abort"}),c=null)},c.onerror=()=>{r(new Error("Network Error")),c=null},c.ontimeout=()=>{r(new Error("timeout of "+t.timeout+"ms exceeded")),c=null},"setRequestHeader"in c&&Object.keys(o).forEach((t=>{null===s&&"content-type"===t.toLowerCase()?delete o[t]:c.setRequestHeader(t,o[t])})),a&&a.promise.then((t=>{c&&(c.abort(),r(t),c=null)})),c.send(s)})),d=t=>new Promise(((e,r)=>{const{data:s=null,url:i,method:n="GET",headers:o,cancelToken:a}=t,c=wx.request({url:i,data:s,method:n.toUpperCase(),timeout:t.timeout,header:o,success(t){t.statusCode>=200&&t.statusCode<300?e(t.data):r({url:i,statusCode:t.statusCode})},fail(t){r("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 r=0;r<36;r++)t[r]=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[r,s]=[t[0],t[1]];if(null!==s)return h(s)&&!l(s)?(e[r]||(e[r]={}),void(e[r]=v(s,e[r]))):void(e[r]=s)})),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 r;r=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,r);for(const s in t)I(t,s)&&(r[s]=q(t[s],e));return r},D=(t,e)=>t&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)?((t,e)=>e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t)(t,e):e,E=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,S,A;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,(_=exports.STATE||(exports.STATE={}))[_.CLOSE=0]="CLOSE",_[_.JOINED=1]="JOINED",_[_.READY=2]="READY",exports.ENDPOINT_TYPE=void 0,(O=exports.ENDPOINT_TYPE||(exports.ENDPOINT_TYPE={})).WEBAPP="webApp",O.WEBCTRL="webCtrl",O.WECHATMP="weChatMP",O.SUPERVISION="supervision",O.BIGSCREEN="bigScreen",O.DESKTOP="desktop",O.MOBILE="mobile",O.VCS="vcs",O.SIP="sip",O.H323="h323",O.PSTN="pstn",O.MULTI_STREAM="multiStream",O.MEETING_TOUCH="meetingTouch",O.MEETING_ROOMS="meetingRooms",O.RTSP="rtsp",O.RTMP_PULLER="rtmpPuller",O.GB28181="gb28181",O.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,(A=exports.RECORD_STATUS||(exports.RECORD_STATUS={})).STARTED="started",A.PAUSED="paused",A.STARTING="starting",A.STOPPED="stopped";class T{constructor(t,r){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=r,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,r=(t,s,i)=>{Object.keys(t).forEach((i=>{!1===s&&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])&&r(t[i],!0)}))};return r(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))},t}}class w extends T{constructor(t){super(t,"info")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingInfo",(t=>{const{state:e,body:r}=t;("full"===e||"update"===e)&&v(r,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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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:r}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/shareInfo`,{params:t})}meetings(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},credential:r}=this.ctx.config.request;return t.credential=t.credential||r,this.ctx.request.get(`${e}meetings`,{params:t})}mailTemplate(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${e}mailTemplate`,{params:{meetingID:r},headers:{language:t.language}})}operateRecord(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/operationRecord`,t)}getImConfig(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},credential:r}=this.ctx.config.request;return t.credential=t.credential||r,this.ctx.request.get(`${e}im/config`,{params:t})}sendMsg(e){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}/chat/send`,e)}))}getUserInfo(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}participantDetail?meetingID=${r}`,e)}))}sendInvitationMail(t){if(!t)return Promise.reject();const{prefix:{ctrl:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}/sendInvitationMail `,t)}getMailTemplate(t,e){if(!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.get(`${r}meetingNum/${t}/mailTemplate`,{params:Object.assign(Object.assign({},e),{meetingID:s})})}}function j(t){const e=[],{isInLobby:r}=t.modules.me.data;return r?(e.push("lobbyMember"),e):(Object.keys(t.modules).forEach((r=>{const s=t.modules[r]._topic();s&&(Array.isArray(s)?s.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(s)||e.push(s))})),e)}function U(e,r){return t(this,void 0,void 0,(function*(){const{meetingID:t,clientID:s}=r.config.request,i=yield r.request.post("/ypush/api/v1/meeting-control/inbox",{basic:{tenantId:100,clientId:s,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 R(e,r){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s,clientID:i}=r.config.request,n=yield r.request.post(`${t}meetings/${s}/subscribe`,{endpointID:i,topics:e}),o=n&&n.data&&n.data.eventMsgs;o&&o.forEach((t=>{r.emitter.emit(t.event,t)}))}))}function P(e,r,s){return t(this,void 0,void 0,(function*(){const{inboxes:i,clientID:n,meetingID:o,cancelToken:a,status:c}=r;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:r={},bizCode:u,error:d}=t;if(u&&900408!==u)return console.error("polling error: ",JSON.stringify(d)),void c.attempts++;c.attempts=0,r&&Object.keys(r).forEach((t=>{const e=i.find((e=>e.name===t));e&&(e.seqId=r[t].maxSeqId,r[t].items&&r[t].items.forEach((t=>{const e=JSON.parse(t.content);["liveStream","recording"].includes(e.event)&&(e.stime=t.stime),e.pollingSeqId=t.seqId,s(e)})))}))})))(),!c.running)return;if(c.attempts>6)return console.error("polling Max Attempts"),void(r.onError&&r.onError({message:"polling Max Attempts"}));const u=c.attempts?E(c.attempts):0;c.timer=setTimeout((()=>{c.running&&P(e,r,s)}),u)}))}const C=(e,r)=>t(void 0,void 0,void 0,(function*(){const{meetingID:t,clientID:s}=r.config.request;r.status.polling.running=!0,P(r.request,{inboxes:e,clientID:s,meetingID:t,cancelToken:r.config.request.cancelToken.token,status:r.status.polling,onError:t=>{r.emitter.emit(exports.EVENT.POLLING_ERROR,t)}},(t=>{r.emitter.emit(t.event,t)}))}));function N(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,r){return t(this,void 0,void 0,(function*(){const{meetingID:s,userID:i,status:n,cancelToken:o,onError:a}=r;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/${s}/users/${i}/keepalive`,{},{cancelToken:o.token})}catch(c){return n.attempts++,void console.error(c)}if(!t)return;const{data:r={},bizCode:a,error:c}=t;if(900200!==a&&900408!==a&&901323!==a)return n.attempts++,void console.error("keepalive ",a,c);const u=r.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?E(n.attempts):1e3*n.interval;n.timer=setTimeout((()=>{n.running&&L(e,r)}),c)}))}function k(e){return t(this,void 0,void 0,(function*(){const{meetingID:t,userID:r}=e.config.request;e.status.keepalive.running=!0,L(e.request,{meetingID:t,userID:r,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 B extends T{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)}})),r=t=>{var e,r,s,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===(r=this.data.audio)||void 0===r?void 0:r.sendOn)||!p(d)&&d!==(null===(s=this.data.audio)||void 0===s?void 0:s.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)}))}},s=t=>{var e,r,s,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===(r=this.data.video)||void 0===r?void 0:r.sendOn)||!p(d)&&d!==(null===(s=this.data.video)||void 0===s?void 0:s.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,r,s,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===(r=this.data.share)||void 0===r?void 0:r.sendOn))&&(v({share:t.share},this.data),this.emitter.emit(exports.MeEvent.SHARECHANGE,{deviceOn:p(n)?null===(s=this.data.share)||void 0===s?void 0:s.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:r,opBy:s}=t.whiteboard;(!p(e)&&e!==(null===(n=this.data.whiteboard)||void 0===n?void 0:n.deviceOn)||!p(r)&&r!==(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(r)?null===(c=this.data.whiteboard)||void 0===c?void 0:c.sendOn:r,opBy:s}))}},n=t=>{t.displayName&&t.displayName!==this.data.displayName&&(v({displayName:t.displayName},this.data),this.data.displayNamePinyin=B.setDisplayNamePinyinProp?B.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:r,body:s}=e;"personalLayout"===t&&("full"===r?v({personalLayout:s},this.data):"delete"===r&&(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 r={content:t.barrage.content,contentType:t.barrage.contentType,type:t.barrage.type,duration:t.barrage.duration,position:t.barrage.position};e=r;let{role:s}=this.data;if(this.data.endpointType===exports.ENDPOINT_TYPE.SUPERVISION){const{info:t}=this.ctx.modules;s="webinar"===t.meetingType?exports.ROLE.AUDIENCE:exports.ROLE.ATTENDEE}if(s===exports.ROLE.HOST||s===exports.ROLE.COHOST?e=t.barrage.receiver.host?r:null:s===exports.ROLE.ATTENDEE?e=t.barrage.receiver.attendee?r:null:s===exports.ROLE.AUDIENCE&&(e=t.barrage.receiver.audience?r:null),!e&&t.barrage.receiver.designated){const{userID:s,subjectID:i}=this.data,{designatedUsers:n}=t.barrage;e=-1!==n.findIndex((t=>t.userID===s||i&&t.subjectID===i))?r: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}),N(this.ctx),M(this.ctx),rt(this.ctx),this.emitter.emit(exports.MeEvent.LEAVE,t.resultInfo),this.ctx.cleanup(t.resultInfo))},f=t=>{e(t),r(t),s(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.data.isInLobby||this.data.role===exports.ROLE.AUDIENCE)&&this.data.whiteboard&&this.data.whiteboard.sendOn&&i({whiteboard:{sendOn:!1}})};this.ctx.emitter.on(exports.MeEvent.INIT,(t=>{v(t,this.data),this.data.displayNamePinyin=B.setDisplayNamePinyinProp?B.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:r={users:[]}}=e;if("delete"===t){const t=r.users[0];return t.leave=!0,void h(t)}let s=r.users.find((t=>t.userID===this.data.userID));s||r.users.length&&(s=r.users[0]),s?(f(s),v(s,this.data)):console.warn("me ",t,r)})))),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:r}=this.data;t.audio.sendOn=t.audio.sendOn&&r.audio.sendOn,t.video.sendOn=t.video.sendOn&&r.video.sendOn,e===exports.ROLE.AUDIENCE&&(t.audio.sendOn=!1,t.video.sendOn=!1)}const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,v(t,this.data),this.ctx.request.post(`${r}meetings/${s}/updateUserState`,t)}rePolling(e){return t(this,void 0,void 0,(function*(){const{ctx:t}=this;N(t);const r=j(t),s=yield U(r,t);if(e&&this.emitter.emit(exports.MeEvent.UPDATE_USER_STATE,{data:this.data,event:e}),yield R(r,t),"undefined"!=typeof Worker&&t.worker){const{meetingID:e,clientID:i,userID:n}=t.config.request;t.worker.postMessage({inboxes:s,topics:r,clientID:i,meetingID:e,userID:n,rePolling:!0})}else yield C(s,t)}))}}class V extends T{constructor(t){super(t,"invite")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("callRecord",(t=>{const{body:e,state:r}=t;if(e&&e.users){if("full"===r)return this.data.callRecordUsers=e.users.map((t=>(t.displayNamePinyin=V.setDisplayNamePinyinProp?V.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=V.setUserGroupIDs?V.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,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"===r&&-1!==e?v(t,this.data.callRecordUsers[e]):"update"===r&&-1===e&&(t.displayNamePinyin=V.setDisplayNamePinyinProp?V.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t.groupIDs=V.setUserGroupIDs?V.setUserGroupIDs(t.groupIDs||[],""):t.groupIDs,this.data.callRecordUsers.push(t))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}setCallRecordUserResultInfo(t,e){const r=((t,e)=>{for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1})(this.data.callRecordUsers,(e=>{let r=!1;switch(e.type){case"account":case"sip":case"h323":case"rtsp":r=t.account===e.contact;break;case"subjectID":r=t.subjectID===e.contact}return r}));r>-1&&(this.data.callRecordUsers[r].resultInfo=e,this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers))}invite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/invite`,t)}cancelInvite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/cancelInvite`,t)}}var G="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Y={exports:{}};!function(t,e){var r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",n="[object Boolean]",o="[object Date]",a="[object Function]",c="[object GeneratorFunction]",u="[object Map]",d="[object Number]",l="[object Object]",p="[object Promise]",h="[object RegExp]",f="[object Set]",m="[object String]",g="[object Symbol]",v="[object WeakMap]",x="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",I="[object Float64Array]",q="[object Int8Array]",D="[object Int16Array]",E="[object Int32Array]",$="[object Uint8Array]",_="[object Uint8ClampedArray]",O="[object Uint16Array]",S="[object Uint32Array]",A=/\w*$/,T=/^\[object .+?Constructor\]$/,w=/^(?:0|[1-9]\d*)$/,j={};j[i]=j["[object Array]"]=j[x]=j[y]=j[n]=j[o]=j[b]=j[I]=j[q]=j[D]=j[E]=j[u]=j[d]=j[l]=j[h]=j[f]=j[m]=j[g]=j[$]=j[_]=j[O]=j[S]=!0,j["[object Error]"]=j[a]=j[v]=!1;var U="object"==typeof self&&self&&self.Object===Object&&self,R="object"==typeof G&&G&&G.Object===Object&&G||U||Function("return this")(),P=e&&!e.nodeType&&e,C=P&&t&&!t.nodeType&&t,N=C&&C.exports===P;function L(t,e){return t.set(e[0],e[1]),t}function k(t,e){return t.add(e),t}function M(t,e,r,s){var i=-1,n=t?t.length:0;for(s&&n&&(r=t[++i]);++i<n;)r=e(r,t[i],i,t);return r}function H(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(e){}return r}function B(t){var e=-1,r=Array(t.size);return t.forEach((function(t,s){r[++e]=[s,t]})),r}function V(t,e){return function(r){return t(e(r))}}function Y(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var F,W=Array.prototype,Q=Function.prototype,J=Object.prototype,z=R["__core-js_shared__"],K=(F=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",X=Q.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+X.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=N?R.Buffer:void 0,st=R.Symbol,it=R.Uint8Array,nt=V(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=W.splice,ut=Object.getOwnPropertySymbols,dt=rt?rt.isBuffer:void 0,lt=V(Object.keys,Object),pt=Pt(R,"DataView"),ht=Pt(R,"Map"),ft=Pt(R,"Promise"),mt=Pt(R,"Set"),gt=Pt(R,"WeakMap"),vt=Pt(Object,"create"),xt=Mt(pt),yt=Mt(ht),bt=Mt(ft),It=Mt(mt),qt=Mt(gt),Dt=st?st.prototype:void 0,Et=Dt?Dt.valueOf:void 0;function $t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function _t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function Ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var s=t[e];this.set(s[0],s[1])}}function St(t){this.__data__=new _t(t)}function At(t,e,r){var s=t[e];Z.call(t,e)&&Ht(s,r)&&(void 0!==r||e in t)||(t[e]=r)}function Tt(t,e){for(var r=t.length;r--;)if(Ht(t[r][0],e))return r;return-1}function wt(t,e,r,s,p,v,T){var w;if(s&&(w=v?s(t,p,v,T):s(t)),void 0!==w)return w;if(!Ft(t))return t;var U=Bt(t);if(U){if(w=function(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&Z.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!e)return function(t,e){var r=-1,s=t.length;for(e||(e=Array(s));++r<s;)e[r]=t[r];return e}(t,w)}else{var R=Nt(t),P=R==a||R==c;if(Gt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(R==l||R==i||P&&!v){if(H(t))return v?t:{};if(w=function(t){return"function"!=typeof t.constructor||kt(t)?{}:Ft(e=nt(t))?ot(e):{};var e}(P?{}:t),!e)return function(t,e){return Ut(t,Ct(t),e)}(t,function(t,e){return t&&Ut(e,Wt(e),t)}(w,t))}else{if(!j[R])return v?t:{};w=function(t,e,r,s){var i=t.constructor;switch(e){case x:return jt(t);case n:case o:return new i(+t);case y:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,s);case b:case I:case q:case D:case E:case $:case _:case O:case S:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,s);case u:return function(t,e,r){return M(e?r(B(t),!0):B(t),L,new t.constructor)}(t,s,r);case d:case m:return new i(t);case h:return function(t){var e=new t.constructor(t.source,A.exec(t));return e.lastIndex=t.lastIndex,e}(t);case f:return function(t,e,r){return M(e?r(Y(t),!0):Y(t),k,new t.constructor)}(t,s,r);case g:return Et?Object(Et.call(t)):{}}}(t,R,wt,e)}}T||(T=new St);var C=T.get(t);if(C)return C;if(T.set(t,w),!U)var N=r?function(t){return function(t,e,r){var s=e(t);return Bt(t)?s:function(t,e){for(var r=-1,s=e.length,i=t.length;++r<s;)t[i+r]=e[r];return t}(s,r(t))}(t,Wt,Ct)}(t):Wt(t);return function(t,e){for(var r=-1,s=t?t.length:0;++r<s&&!1!==e(t[r],r););}(N||t,(function(i,n){N&&(i=t[n=i]),At(w,n,wt(i,e,r,s,n,t,T))})),w}function jt(t){var e=new t.constructor(t.byteLength);return new it(e).set(new it(t)),e}function Ut(t,e,r,s){r||(r={});for(var i=-1,n=e.length;++i<n;){var o=e[i],a=s?s(r[o],t[o],o,r,t):void 0;At(r,o,void 0===a?t[o]:a)}return r}function Rt(t,e){var r,s,i=t.__data__;return("string"==(s=typeof(r=e))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Pt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Ft(t)||(e=t,K&&K in e))&&(Yt(t)||H(t)?et:T).test(Mt(t));var e}(r)?r: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},_t.prototype.clear=function(){this.__data__=[]},_t.prototype.delete=function(t){var e=this.__data__,r=Tt(e,t);return!(r<0||(r==e.length-1?e.pop():ct.call(e,r,1),0))},_t.prototype.get=function(t){var e=this.__data__,r=Tt(e,t);return r<0?void 0:e[r][1]},_t.prototype.has=function(t){return Tt(this.__data__,t)>-1},_t.prototype.set=function(t,e){var r=this.__data__,s=Tt(r,t);return s<0?r.push([t,e]):r[s][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new $t,map:new(ht||_t),string:new $t}},Ot.prototype.delete=function(t){return Rt(this,t).delete(t)},Ot.prototype.get=function(t){return Rt(this,t).get(t)},Ot.prototype.has=function(t){return Rt(this,t).has(t)},Ot.prototype.set=function(t,e){return Rt(this,t).set(t,e),this},St.prototype.clear=function(){this.__data__=new _t},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 r=this.__data__;if(r instanceof _t){var s=r.__data__;if(!ht||s.length<199)return s.push([t,e]),this;r=this.__data__=new Ot(s)}return r.set(t,e),this};var Ct=ut?V(ut,Object):function(){return[]},Nt=function(t){return tt.call(t)};function Lt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||w.test(t))&&t>-1&&t%1==0&&t<e}function kt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function Mt(t){if(null!=t){try{return X.call(t)}catch(G){}try{return t+""}catch(G){}}return""}function Ht(t,e){return t===e||t!=t&&e!=e}(pt&&Nt(new pt(new ArrayBuffer(1)))!=y||ht&&Nt(new ht)!=u||ft&&Nt(ft.resolve())!=p||mt&&Nt(new mt)!=f||gt&&Nt(new gt)!=v)&&(Nt=function(t){var e=tt.call(t),r=e==l?t.constructor:void 0,s=r?Mt(r):void 0;if(s)switch(s){case xt:return y;case yt:return u;case bt:return p;case It:return f;case qt:return v}return e});var Bt=Array.isArray;function Vt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}(t.length)&&!Yt(t)}var Gt=dt||function(){return!1};function Yt(t){var e=Ft(t)?tt.call(t):"";return e==a||e==c}function Ft(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Wt(t){return Vt(t)?function(t,e){var r=Bt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Vt(t)}(t)&&Z.call(t,"callee")&&(!at.call(t,"callee")||tt.call(t)==i)}(t)?function(t,e){for(var r=-1,s=Array(t);++r<t;)s[r]=e(r);return s}(t.length,String):[],s=r.length,n=!!s;for(var o in t)!e&&!Z.call(t,o)||n&&("length"==o||Lt(o,s))||r.push(o);return r}(t):function(t){if(!kt(t))return lt(t);var e=[];for(var r in Object(t))Z.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return wt(t,!0,!0)}}(Y,Y.exports);const F=Array.isArray,W=(t,e)=>t?(Object.entries(t).forEach((t=>{const[r,s]=[t[0],t[1]];if(null!==s)return(t=>"object"==typeof t&&null!==t)(s)&&!F(s)?(e[r]||(e[r]={}),void(e[r]=W(s,e[r]))):void(e[r]=s)})),e):e;class Q extends T{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:r})=>{if(t.userID!==this.ctx.modules.me.data.userID)return;const{resultInfo:s={}}=t;if("delete"!==r||"delete"===r&&[901357,901358,901352,901351,901350,901349].includes(s.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:r,sourceKey:s})=>{if("full"===r)return this.data[s]=e.map((e=>(e.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=Q.setUserGroupIDs?Q.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,t(e,{event:s,state:r}),e))),this.emitter.emit(`${s}Change`,{users:this.data[s],isFull:!0}),this.data[s];void 0===this.data[s]&&(this.data[s]=[]);const{data:i,emitter:n}=this;return e.forEach((e=>{const o=i[s].findIndex((t=>e.userID===t.userID));if("delete"===r&&-1!==o){const[t]=this.data[s].splice(o,1);n.emit(`${s}Delete`,{user:t,resultInfo:e.resultInfo})}else if("update"===r&&-1!==o){const t=this.data[s][o];this.updateUserProps(e,t),v(e,t),this.data[s][o]=q(t),this.emitter.emit(`${s}Update`,{user:this.data[s][o]})}else"update"===r&&-1===o&&(e.displayNamePinyin=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(e.displayName):e.displayName,e.groupIDs=Q.setUserGroupIDs?Q.setUserGroupIDs(e.groupIDs||[],e.endpointType):e.groupIDs,i[s].push(e),this.emitter.emit(`${s}Add`,{user:e,resultInfo:e.resultInfo}));t(e,{event:s,state:r})})),this.emitter.emit(`${s}Change`,{users:this.data[s],isFull:!1}),this.data[s]};this.ctx.emitter.on("interactiveUsers",(t=>{const{state:r,body:s}=t;e({updateUsers:s.users,state:r,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(t=>{const{state:r,body:s}=t;e({updateUsers:s.users,state:r,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(t=>{const{state:r,body:s}=t;e({updateUsers:s.users,state:r,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(t=>{const{state:r,body:s}=t;e({updateUsers:s.users,state:r,sourceKey:"advCtrlUsers"})}))}reactiveData(t){if(!h(t))return console.warn("Parameter is not an object!"),t;const e=new Map,r=(t,s)=>{Object.keys(t).forEach((i=>{!1===s&&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])&&r(t[i],!0)}))};return r(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=Q.setDisplayNamePinyinProp?Q.setDisplayNamePinyinProp(t.displayName):t.displayName)}setAudio(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/audio`,e)}setVideo(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/video`,e)}setShare(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/share`,e)}setWhiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/whiteboard`,e)}handUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/handUp`,e)}setRole(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/role`,e)}rename(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/displayName`,e)}remove(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/remove`)}removeWithOption(t,e){if(!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/removeWithOption`,e)}replyHandUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/replyHandUp`,e)}fecc(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/fecc`,e)}lobbyState(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/lobbyState`,e)}allowLocalRecord(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/allowLocalRecord`,e)}allowUserChatOn(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/allowChat`,e)}whiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/whiteboard`,e)}annotate(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/annotate`,e)}callStats(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/users/${t}/callStats`)}callStatsReport(t){if(!t.userID)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/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:r}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/users/${t}/sendLayout`)}setSendLayout(t,e){const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/sendLayout`,e)}setSendLayoutEnabled(t,e){const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/sendLayoutEnabled`,e)}pauseAudio(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/pauseAudio`)}resumeAudio(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/resumeAudio`)}unblockVideo(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/unblockVideo`)}blockVideo(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/users/${t}/blockVideo`)}modifyRoleBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyRoleBatch `,t)}modifyVideoBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyVideoBatch `,t)}putInLobbyBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/putInLobbyBatch `,t)}removeBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/removeBatch `,t)}modifyAudioBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyAudioBatch`,t)}modifyUserAudioReceiveBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/modifyUserAudioReceiveBatch`,t)}modifyUserVideoReceiveBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/unblockVideoBatch`,t)}modifyUserVideoPauseBatch(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/blockVideoBatch`,t)}setIntercom(t,e){const{prefix:{ctrl:r},meetingID:s}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${s}/users/${t}/intercom`,e)}claimHost(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/claimHost`,t)}}function J(t){const{baseURL:r,modules:s,worker:i,singleton:n}=t;s.findIndex((t=>t===B))<0&&s.push(B),s.findIndex((t=>t===w))<0&&s.push(w);const o=t.clientID||`${g()}_${((t=new Date,e)=>{const r={"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 s in r)new RegExp("("+s+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?r[s]:("00"+r[s]).substr((""+r[s]).length)));return e})(new Date,"MMddHHmmss")}`,u={config:{baseURL:r,modules:s,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:r,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 z(t){const e=J(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 r=new t(e);e.modules[r.moduleName]=r}))}(e.config.modules,e),e.emitter.on(exports.EVENT.POLLING_ERROR,(t=>{X(e)({resultInfo:t})})),e.emitter.on(exports.EVENT.KEEPALIVE_ERROR,(t=>{X(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:K(e),leave:X(e),end:Z(e),endMeeting:tt(e)},e.modules)}function K(e){return function(r){var s;return t(this,void 0,void 0,(function*(){const{clientID:t}=e.config.request,i=`${null===(s=r.endpointType)||void 0===s?void 0:s.toLocaleUpperCase()}${t}_${r.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:r.meetingNum,pwd:r.pwd,url:r.url,mobileCode:r.mobileCode,mobile:r.mobile,regEmail:r.regEmail,accEmail:r.accEmail,tk:r.tk,displayName:r.displayName,userAgent:r.userAgent,verifyID:r.verifyID},headers:{"X-Y-Endpoint-Type":r.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 r.pwd,delete r.url,e.config.request.credential=a;const u={displayName:r.displayName,userAgent:r.userAgent,clientID:t};r.groupIDs&&r.account&&(u.groupIDs=r.groupIDs,u.account=r.account,u.groupName=r.groupName),r.mediaContentReq&&(u.mediaContentReq=r.mediaContentReq);const d=r.hostKey?`&hostKey=${r.hostKey}`:"",l=yield e.request.post(`${n.ctrl}join?meetingNum=${r.meetingNum}&credential=${a}${d}`,u,{headers:{"X-Y-Endpoint-Type":r.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=j(e),b=yield U(y,e);return yield R(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):X(e)({resultInfo:{message:"keepalive Max Attempts"}}):X(e)({resultInfo:{message:"polling Max Attempts"}}):e.status.keepalive.running=!1:e.status.polling.running=!1):x()}):(C(b,e),x(),k(e)),l.data=Object.assign(Object.assign({},l.data),o.data),l}))}}function X(e){return function(r){return t(this,void 0,void 0,(function*(){const t=r&&r.resultInfo;r||(r={resultInfo:{bizCode:901359}});const{prefix:s,meetingID:i}=e.config.request;let n;try{n=yield e.request.post(`${s.ctrl}meetings/${i}/leave`,r)}catch(o){console.error(o)}return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1}),N(e),M(e),rt(e),e.cleanup(t),n}))}}function Z(e){return function(){return t(this,void 0,void 0,(function*(){const{prefix:t,meetingID:r}=e.config.request,s=yield e.request.post(`${t.ctrl}meetings/${r}/end`);return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1}),N(e),M(e),rt(e),e.cleanup(),s}))}}function tt(e){return function(r){return t(this,void 0,void 0,(function*(){const{prefix:t}=e.config.request;return yield e.request.post(`${t.ctrl}meetingNum/${r}/end`)}))}}class et{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=z(t)}static getInstance(t){return this.instance?this.instance:this.instance=new et(t)}}function rt(t){if(t.config.singleton){const{baseURL:e,modules:r,singleton:s}=t.config,i={baseURL:e,modules:r,worker:t.worker,singleton:s},n=et.getInstance(i);n&&(n.meeting=z(i))}}Object.defineProperty(et,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null}),exports.Asr=class extends T{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:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/transcript/status`,e)}))}},exports.AudioRecording=class extends T{constructor(t){super(t,"audioRecording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("audioRecording",(t=>{const{body:e,stime:r}=t;e&&(r&&(this.data.stime=r,this.data.timeOffset=r-(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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/audioRecording/status`,e)}))}},exports.Chat=class extends T{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:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/chat/msg`,e)}))}historyMsg(e){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}/chat/historyMsg`,e)}))}sendMsg(e){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}/chat/send`,e)}))}},exports.FocusUsers=class extends T{constructor(t){super(t,"focusUsers")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("focusUsers",(t=>{const{state:e,body:r}=t;if(r)return this.data.focusUsers||(this.data.focusUsers=[]),"full"===e?this.data.focusUsers=r.focusUsers:"update"===e?this.data.focusUsers=this.data.focusUsers.concat(r.focusUsers):"delete"===e&&(r.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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/focusUser`,t)}},exports.Info=w,exports.Interpretation=class extends T{constructor(t){super(t,"interpretation"),this.data={status:"stopped",interpreters:[]}}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("interpretation",(t=>{const{body:e,state:r}=t;"full"===r?(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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/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=V,exports.LiveStream=class extends T{constructor(t){super(t,"liveStream")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStream",(t=>{const{state:e,body:r,stime:s}=t;if(!r)return;if(s&&(this.data.stime=s,this.data.timeOffset=s-(new Date).valueOf()),"full"===e){const{liveStreams:t=[],defaultLayout:e}=r;if(!t.length)return;const s=[];this.data.liveStreams=t.map((t=>(t.requesting="starting"===t.status,t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo}),s.push({platform:t.platform||"",status:(t.requesting?"stopped":t.status)||"",index:t.data&&t.data.index}),t))),this.data.defaultLayout=e;return W({status:s},this.data),this.data}if("delete"===e){const{liveStreams:t=[]}=r;return t.forEach((t=>{const e=this.data.liveStreams.findIndex((e=>e.data&&e.data.index===t.data.index));-1!==e&&this.data.liveStreams.splice(e,1)})),void this.emitter.emit("liveStreamingChange",this.data.liveStreams)}const i=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 r=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.platform===t.platform)),-1===e?r.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||""}):r.splice(e,1,{platform:r[e].platform||"",status:t.requesting?r[e].status||"stopped":t.status||""}),this.data.status=r};void 0===this.data.liveStreams&&(this.data.liveStreams=[]);const{liveStreams:n=[]}=r;return n.forEach((t=>{if("thirdParty"!==t.platform)return void i(t);t.resultInfo&&this.emitter.emit("resultInfoChange",{platform:t.platform,resultInfo:t.resultInfo});let e=this.data.liveStreams.findIndex((e=>{var r,s;return(null===(r=e.data)||void 0===r?void 0:r.index)===(null===(s=t.data)||void 0===s?void 0:s.index)}));-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 r=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>{var r;return e.index===(null===(r=t.data)||void 0===r?void 0:r.index)})),-1===e?r.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||"",index:t.data&&t.data.index}):r.splice(e,1,{platform:r[e].platform||"",status:t.requesting?r[e].status||"stopped":t.status||"",index:t.data&&t.data.index}),this.data.status=r})),this.data}))}setStatus(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStream/status`,e)}))}liveStreamDescription(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStream/description`,e)}))}liveStreamSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStream/setting`,e)}))}liveStreamDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStream/delete`,e)}))}liveStreamLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStream/pushSetting`,e)}))}},exports.LiveStreaming=class extends T{constructor(t){super(t,"liveStreaming")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStreaming",(t=>{const{state:e,body:r,stime:s}=t;if(!r)return;if(s&&(this.data.stime=s,this.data.timeOffset=s-(new Date).valueOf()),"full"===e){const{liveStreaming:t=[],defaultConfig:e}=r;if(!t.length)return;const s=[],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}),s.push({index:t.index,protocol:t.protocol,status:(t.requesting?"stopped":t.status)||""}),i.push(t))})),this.data.liveStreaming=i,v({status:s,defaultConfig:e},this.data),this.data}if("delete"===e){const{liveStreaming:t=[]}=r;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}=r;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 r=this.data.status.map((t=>t));e=this.data.status.findIndex((e=>e.index===t.index)),-1===e?r.push({index:t.index,protocol:t.protocol,status:t.requesting?"stopped":t.status}):r.splice(e,1,{index:t.index,protocol:t.protocol,status:t.requesting?r[e].status||"stopped":t.status}),this.data.status=r})),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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStreaming/status`,e)}))}liveStreamingSetting(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStreaming/setting`,e)}))}liveStreamingDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStreaming/delete`,e)}))}liveStreamingDetail(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/liveStreaming/detail`,e)}))}},exports.Me=B,exports.Qa=class extends T{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 r=t.get(e.question.id);const{clientID:s}=this.ctx.config.request;switch(e.command){case"addQuestion":r=this.createQuestion(e.question),t.set(e.question.id,r),this.emitter.emit("questionAdd",{question:r,selfSent:r.sender.endpointID===s});break;case"dismissQuestion":if(!r)break;r.sender.endpointID!==s?r.status="close":r.isTop=!1,t.set(e.question.id,r),this.emitter.emit("questionUpdate",{question:r});break;case"reopenQuestion":r?(r.status="open",r.isTop=e.question.isTop,t.set(e.question.id,r)):(r=this.createQuestion(e.question),t.set(e.question.id,r)),this.emitter.emit("questionUpdate",{question:r});break;case"updateQuestion":r?(r=Object.assign(Object.assign(Object.assign({},r),e.question),{topSort:e.question.isTop?this.data.topSort++:0}),t.set(e.question.id,r)):(r=this.createQuestion(e.question),t.set(e.question.id,r)),this.emitter.emit("questionUpdate",{question:r});break;case"deleteQuestion":if(!r)break;r.sender.endpointID!==s?t.delete(e.question.id):(r.status="delete",r.isTop=!1,r.answers.clear(),t.set(e.question.id,r)),this.emitter.emit("questionDelete",{question:r});break;case"answerQuestion":r?r.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)):(r=this.createQuestion(e.question),r.answers.set(e.answer.id,this.createQuestionAnswer(e.answer)),t.set(e.question.id,r)),this.emitter.emit("questionUpdate",{question:r});break;case"deleteAnswer":r&&(r.answers.delete(e.answer.id),this.emitter.emit("questionUpdate",{question:r}))}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:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/qa`,e)}))}},exports.RTSP=class extends T{constructor(t){super(t,"rtsp")}_topic(){return["meeting"]}_bindOn(){this.ctx.emitter.on("rtspAccess",(t=>{const{body:e,state:r}=t;void 0===this.data.accessList&&(this.data.accessList=[]),"full"===r?this.data=e:"update"===r?v(e,this.data):"delete"===r&&(this.data.accessList=this.data.accessList.filter((t=>!e.accessList.find((e=>e.index===t.index))))),this.emitter.emit("rtspAccessChange",this.data)}))}cleanup(){this.emitter.all=new Map}createRTSPAccess(e){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}/rtspAccess/create`,e)}))}setRTSPAccess(e){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}/rtspAccess/setting`,e)}))}deleteRTSPAccess(e){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}/rtspAccess/delete`,e)}))}},exports.Recording=class extends T{constructor(t){super(t,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(t=>{const{state:e,body:r,stime:s}=t;if(r)return s&&(this.data.stime=s,this.data.timeOffset=s-(new Date).valueOf()),this.data.isPracticeSession="started"===r.status&&this.data.status===r.status&&0===r.duration,this.data.recording=Object.assign(Object.assign({},this.data.recording||{}),r),r.status&&(this.data.recording.requesting="starting"===r.status,this.data.status="starting"!==r.status?r.status:"started"===this.data.status?"stopped":this.data.status),(r.status&&"started"===r.status||void 0!==r.isReconnecting&&!r.isReconnecting)&&this.setMainRecordPromptCount(0),r.backupRecord?(r.backupRecord.status&&(this.data.recording.backupRecordRequesting="starting"===r.backupRecord.status,this.data.backupRecordStatus="starting"!==r.backupRecord.status?r.backupRecord.status:this.data.backupRecordStatus),(r.backupRecord.status&&"started"===r.backupRecord.status||void 0!==r.backupRecord.isReconnecting&&!r.backupRecord.isReconnecting)&&setTimeout((()=>this.setBackupRecordPromptCount(0)),100)):this.data.backupRecordStatus=this.data.backupRecordStatus||"stopped",r.resultInfo&&this.emitter.emit("resultInfoChange",r.resultInfo),r.backupRecord&&r.backupRecord.resultInfo&&this.emitter.emit("backupRecordResultInfoChange",r.backupRecord.resultInfo),["full","update"].includes(e)?(r.recordUsers&&(this.data.recording.recordUsers=r.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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/recording/status`,e)}))}layout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/recording/status`,e)}))}designatedUsers(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/recording/layout`,e)}))}},exports.RemoteDesktop=class extends T{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,r){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}/users/${e}/remoteDesktop`,r)}))}},exports.RollCall=class extends T{constructor(t){super(t,"rollCall")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("rollcallVideo",(t=>{const{state:e,body:r}=t;r&&("full"===e||"update"===e?(this.data.index=r.index,this.data.userID=r.userID,this.data.type=r.type,this.data.nextUserID=r.nextUserID):"delete"===e&&(this.data.type=r.type,this.data.userID=0),this.emitter.emit("rollCallChange",this.data))})),this.ctx.emitter.on("rollcallSetting",(t=>{const{state:e,body:r}=t;r&&("full"===e?(this.data.rollcallList=r.rollcallList,this.data.rollcallUserLayout=r.rollcallUserLayout,this.data.hostLayout=r.hostLayout,this.data.commonUserLayout=r.commonUserLayout):"update"===e&&(r.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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/view/rollcall`,t)}settingRollCall(t){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/view/rollcall/setting`,t)}},exports.Setting=class extends T{constructor(t){super(t,"setting")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingSetting",(t=>{const{state:e,body:r}=t;["full","update"].includes(e)&&v(r,this.data)}))}reactiveData(t){if(!h(t))return console.warn("Parameter is not an object!"),t;const e=new Map,r=(t,s,i)=>{Object.keys(t).forEach((n=>{if(!1===s&&n in this.data&&(t[n]=this.data[n]),i<1){const r=e=>t[n]=e,s=`${y(n)}Change`;this.emitter.on(s,r),e.set(s,r)}if(h(t[n])&&!l(t[n])){r(t[n],!0,i+1)}}))};return r(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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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 T{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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/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 T{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:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/view/spotlight`,t)}},exports.Transcript=class extends T{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:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/transcript/historyMsg`,e)}))}},exports.Users=Q,exports.View=class extends T{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:r,body:s}=t;s&&("meetingView"===r?Object.keys(s).forEach((t=>{this.data[t]=s[t]})):this.data[e]=s)}updatePersonalLayouts(t){const{state:e,body:r}=t;"full"!==e&&void 0!==this.data.personalLayouts||(this.data.personalLayouts={}),r.personalLayouts.forEach((t=>{const{subscriber:r={userID:-1}}=t,s=r.userID||r.subjectID||-1;"full"===e||"update"===e||t.templateStatus?this.data.personalLayouts[s]=t:delete this.data.personalLayouts[s]})),this.emitter.emit("personalLayoutsChange",this.data.personalLayouts)}hostLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/hostLayout`,e)}))}attendeeLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/attendeeLayout`,e)}))}audienceLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/audienceLayout`,e)}))}personalLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/personalLayout`,e)}))}personalLayoutDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/personalLayout/delete`,e)}))}virtualClassLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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:r}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${r}/view/presetLayout`,{params:e})}))}setPresetLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/presetLayout`,e)}))}presetLayoutApply(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/presetLayout/apply`,e)}))}presetLayoutApplyUser(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/view/presetLayout/applyUser`,e)}))}},exports.Vote=class extends T{constructor(t){super(t,"vote")}_topic(){return"vote"}_bindOn(){this.ctx.emitter.on("vote",(t=>{const{body:e}=t,{voteID:r}=e;void 0===this.data.vote&&(this.data.vote={}),this.data.vote[r]=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:r,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.get(`${e}meetings/${r}/votes`,{params:t})}getVote(t){const{prefix:{vote:e},meetingID:r,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.get(`${e}meetings/${r}/vote`,{params:t})}getMeVote(t){const{prefix:{vote:e},meetingID:r,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.get(`${e}meetings/${r}/vote/me`,{params:t})}voteStatus(t,e){const{prefix:{vote:r},meetingID:s,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.post(`${r}meetings/${s}/vote/status?tk=${t.tk}&voteID=${t.voteID}`,e)}voteSubmit(t,e){const{prefix:{vote:r},meetingID:s,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.post(`${r}meetings/${s}/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:r,voteTk:s}=this.ctx.config.request;return this.ctx.request.get(`${e}meetings/${r}/vote/inProgress`,{params:{tk:t&&t.tk||s}})}},exports.Words=class extends T{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:r,pollingSeqId:s}=t;if(!r)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(),s&&(this.data.barrageRecord=[{id:s,content:r.content,time:(new Date).getTime(),durationType:r.durationType,duration:1e3*r.duration},...this.data.barrageRecord]),r.wordsDisplayStatus=!0,-1!==r.duration&&(this.data.timer=setTimeout((()=>{r.wordsDisplayStatus=!1,this.data.timer=null,this.data.wordsDisplayStatus=r.wordsDisplayStatus,this.ctx.emitter.emit(exports.MeEvent.UPDATE,{barrage:this.data})}),1e3*r.duration)),v(r,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:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/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?et.getInstance(t).meeting:z(t)},exports.reset=rt;
package/dist/meeting.d.ts CHANGED
@@ -604,6 +604,7 @@ declare type Events = {
604
604
  presetLayout: any;
605
605
  liveStreaming: any;
606
606
  remoteDesktop: any;
607
+ rtspAccess: any;
607
608
  };
608
609
 
609
610
  declare type Events_10 = {
@@ -716,6 +717,18 @@ declare type Events_23 = {
716
717
  remoteDesktopChange: RemoteDesktopBody;
717
718
  };
718
719
 
720
+ declare type Events_24 = {
721
+ accessListChange: RTSPAccess[];
722
+ defaultResolutionChange: string;
723
+ defaultLayoutChange: {
724
+ mode?: string;
725
+ type?: string;
726
+ layout?: LayoutContent;
727
+ layoutType?: string;
728
+ };
729
+ rtspAccessChange: RTSPData;
730
+ };
731
+
719
732
  declare type Events_3 = Record<EventType, any>;
720
733
 
721
734
  declare type Events_4 = Record<EventType, any>;
@@ -1214,6 +1227,11 @@ export declare interface LayoutContent {
1214
1227
  hideNonVideo?: boolean;
1215
1228
  name?: string;
1216
1229
  pollCount?: number;
1230
+ pollDesignated?: {
1231
+ userID: number;
1232
+ subjectID: string;
1233
+ pollSeconds: number;
1234
+ }[];
1217
1235
  pollSeconds?: number;
1218
1236
  pictures?: Picture[];
1219
1237
  count?: number;
@@ -1246,6 +1264,7 @@ export declare interface Live {
1246
1264
  mode?: string;
1247
1265
  type?: string;
1248
1266
  layout?: LayoutContent;
1267
+ layoutType?: string;
1249
1268
  };
1250
1269
  liveCaptionEnabled?: boolean;
1251
1270
  platform?: string;
@@ -1259,7 +1278,7 @@ export declare interface Live {
1259
1278
  isChange?: boolean;
1260
1279
  isTemplateSubmit?: boolean;
1261
1280
  template?: LayoutContent;
1262
- data?: LiveData;
1281
+ data: LiveData;
1263
1282
  thirdPartyLiveData?: ThirdPartyLiveData[];
1264
1283
  }
1265
1284
 
@@ -1956,6 +1975,7 @@ export declare interface RecordingData {
1956
1975
 
1957
1976
  export declare interface RecordingMap {
1958
1977
  status?: RecordingStatus;
1978
+ followAttendee?: boolean;
1959
1979
  layout: {
1960
1980
  layout?: LayoutContent;
1961
1981
  mode?: string;
@@ -2185,6 +2205,69 @@ export declare interface RollcallVideo {
2185
2205
  index: number;
2186
2206
  }
2187
2207
 
2208
+ export declare class RTSP extends Module<RTSPData, Events_24> {
2209
+ constructor(ctx: Context);
2210
+ _topic(): string[];
2211
+ _bindOn(): void;
2212
+ cleanup(): void;
2213
+ /**
2214
+ * 创建RTSP接入
2215
+ * @returns
2216
+ */
2217
+ createRTSPAccess(params: {
2218
+ resolution: string;
2219
+ mode: string;
2220
+ layout: RTSPData['defaultLayout'];
2221
+ }): Promise<any>;
2222
+ /**
2223
+ * 修改RTSP接入
2224
+ * @returns
2225
+ */
2226
+ setRTSPAccess(params: {
2227
+ index: number;
2228
+ resolution: string;
2229
+ mode: string;
2230
+ layout: RTSPData['defaultLayout'];
2231
+ }): Promise<any>;
2232
+ /**
2233
+ * 删除RTSP接入
2234
+ * @returns
2235
+ */
2236
+ deleteRTSPAccess(params: {
2237
+ index: number;
2238
+ }): Promise<any>;
2239
+ }
2240
+
2241
+ declare interface RTSPAccess {
2242
+ index: number;
2243
+ urls: string[];
2244
+ resolution: string;
2245
+ layout: {
2246
+ mode?: string;
2247
+ type?: string;
2248
+ layout?: LayoutContent;
2249
+ layoutType?: string;
2250
+ };
2251
+ }
2252
+
2253
+ export declare type RTSPBody = RTSPData;
2254
+
2255
+ export declare type RTSPData = {
2256
+ accessList: RTSPAccess[];
2257
+ defaultResolution: string;
2258
+ defaultLayout: {
2259
+ mode?: string;
2260
+ type?: string;
2261
+ layout?: LayoutContent;
2262
+ layoutType?: string;
2263
+ };
2264
+ };
2265
+
2266
+ export declare interface RTSPPayload {
2267
+ body: RTSPBody;
2268
+ state: PollingPayloadState;
2269
+ }
2270
+
2188
2271
  export declare interface SetMedia {
2189
2272
  cred: string;
2190
2273
  sendOn: boolean;
@@ -3635,6 +3718,10 @@ export declare interface YlinkSDKMeeting {
3635
3718
  * 远程控制
3636
3719
  */
3637
3720
  remoteDesktop?: RemoteDesktop;
3721
+ /**
3722
+ * RTSP 接入
3723
+ */
3724
+ rtsp?: RTSP;
3638
3725
  [props: string]: any;
3639
3726
  }
3640
3727