@ylink-sdk/meeting 0.1.13 → 0.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/meeting.cjs.prod.js +1 -0
- package/dist/meeting.d.ts +2094 -0
- package/dist/meeting.esm.prod.js +1 -0
- package/dist/meeting.global.prod.js +1 -0
- package/dist/worker/polling.worker.prod.js +1 -0
- package/index.js +3 -0
- package/package.json +17 -46
- package/LICENSE +0 -21
- package/dist/index.d.ts +0 -161
- package/dist/types/ctrl.d.ts +0 -1026
- package/dist/types/data.d.ts +0 -737
- package/dist/types/enums.d.ts +0 -240
- package/dist/ylink-sdk-meeting.es.js +0 -1
- package/dist/ylink-sdk-meeting.umd.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,r,i){return new(r||(r=Promise))((function(s,n){function o(e){try{c(i.next(e))}catch(t){n(t)}}function a(e){try{c(i.throw(e))}catch(t){n(t)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))}function t(e){return{all:e=e||new Map,on:function(t,r){var i=e.get(t);i?i.push(r):e.set(t,[r])},off:function(t,r){var i=e.get(t);i&&(r?i.splice(i.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var i=e.get(t);i&&i.slice().map((function(e){e(r)})),(i=e.get("*"))&&i.slice().map((function(e){e(t,r)}))}}}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={exports:{}};!function(e,t){var i="__lodash_hash_undefined__",s=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]",f="[object Promise]",h="[object RegExp]",m="[object Set]",g="[object String]",v="[object Symbol]",y="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",I="[object Float32Array]",q="[object Float64Array]",D="[object Int8Array]",E="[object Int16Array]",$="[object Int32Array]",O="[object Uint8Array]",_="[object Uint8ClampedArray]",T="[object Uint16Array]",w="[object Uint32Array]",A=/\w*$/,S=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,U={};U[n]=U["[object Array]"]=U[b]=U[x]=U[o]=U[a]=U[I]=U[q]=U[D]=U[E]=U[$]=U[d]=U[l]=U[p]=U[h]=U[m]=U[g]=U[v]=U[O]=U[_]=U[T]=U[w]=!0,U["[object Error]"]=U[c]=U[y]=!1;var P="object"==typeof self&&self&&self.Object===Object&&self,C="object"==typeof r&&r&&r.Object===Object&&r||P||Function("return this")(),k=t&&!t.nodeType&&t,N=k&&e&&!e.nodeType&&e,R=N&&N.exports===k;function L(e,t){return e.set(t[0],t[1]),e}function H(e,t){return e.add(t),e}function M(e,t,r,i){var s=-1,n=e?e.length:0;for(i&&n&&(r=e[++s]);++s<n;)r=t(r,e[s],s,e);return r}function V(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}function G(e){var t=-1,r=Array(e.size);return e.forEach((function(e,i){r[++t]=[i,e]})),r}function B(e,t){return function(r){return e(t(r))}}function Y(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var F,W=Array.prototype,X=Function.prototype,z=Object.prototype,J=C["__core-js_shared__"],K=(F=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",Q=X.toString,Z=z.hasOwnProperty,ee=z.toString,te=RegExp("^"+Q.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=R?C.Buffer:void 0,ie=C.Symbol,se=C.Uint8Array,ne=B(Object.getPrototypeOf,Object),oe=Object.create,ae=z.propertyIsEnumerable,ce=W.splice,ue=Object.getOwnPropertySymbols,de=re?re.isBuffer:void 0,le=B(Object.keys,Object),pe=Ne(C,"DataView"),fe=Ne(C,"Map"),he=Ne(C,"Promise"),me=Ne(C,"Set"),ge=Ne(C,"WeakMap"),ve=Ne(Object,"create"),ye=Ve(pe),be=Ve(fe),xe=Ve(he),Ie=Ve(me),qe=Ve(ge),De=ie?ie.prototype:void 0,Ee=De?De.valueOf:void 0;function $e(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Oe(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function _e(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Te(e){this.__data__=new Oe(e)}function we(e,t){var r=Be(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ye(e)}(e)&&Z.call(e,"callee")&&(!ae.call(e,"callee")||ee.call(e)==n)}(e)?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],i=r.length,s=!!i;for(var o in e)!t&&!Z.call(e,o)||s&&("length"==o||He(o,i))||r.push(o);return r}function Ae(e,t,r){var i=e[t];Z.call(e,t)&&Ge(i,r)&&(void 0!==r||t in e)||(e[t]=r)}function Se(e,t){for(var r=e.length;r--;)if(Ge(e[r][0],t))return r;return-1}function je(e,t,r,i,s,f,y){var S;if(i&&(S=f?i(e,s,f,y):i(e)),void 0!==S)return S;if(!Xe(e))return e;var j=Be(e);if(j){if(S=function(e){var t=e.length,r=e.constructor(t);t&&"string"==typeof e[0]&&Z.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!t)return function(e,t){var r=-1,i=e.length;t||(t=Array(i));for(;++r<i;)t[r]=e[r];return t}(e,S)}else{var P=Le(e),C=P==c||P==u;if(Fe(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(P==p||P==n||C&&!f){if(V(e))return f?e:{};if(S=function(e){return"function"!=typeof e.constructor||Me(e)?{}:(t=ne(e),Xe(t)?oe(t):{});var t}(C?{}:e),!t)return function(e,t){return Ce(e,Re(e),t)}(e,function(e,t){return e&&Ce(t,ze(t),e)}(S,e))}else{if(!U[P])return f?e:{};S=function(e,t,r,i){var s=e.constructor;switch(t){case b:return Pe(e);case o:case a:return new s(+e);case x:return function(e,t){var r=t?Pe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,i);case I:case q:case D:case E:case $:case O:case _:case T:case w:return function(e,t){var r=t?Pe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,i);case d:return function(e,t,r){return M(t?r(G(e),!0):G(e),L,new e.constructor)}(e,i,r);case l:case g:return new s(e);case h:return function(e){var t=new e.constructor(e.source,A.exec(e));return t.lastIndex=e.lastIndex,t}(e);case m:return function(e,t,r){return M(t?r(Y(e),!0):Y(e),H,new e.constructor)}(e,i,r);case v:return n=e,Ee?Object(Ee.call(n)):{}}var n}(e,P,je,t)}}y||(y=new Te);var k=y.get(e);if(k)return k;if(y.set(e,S),!j)var N=r?function(e){return function(e,t,r){var i=t(e);return Be(e)?i:function(e,t){for(var r=-1,i=t.length,s=e.length;++r<i;)e[s+r]=t[r];return e}(i,r(e))}(e,ze,Re)}(e):ze(e);return function(e,t){for(var r=-1,i=e?e.length:0;++r<i&&!1!==t(e[r],r,e););}(N||e,(function(s,n){N&&(s=e[n=s]),Ae(S,n,je(s,t,r,i,n,e,y))})),S}function Ue(e){return!(!Xe(e)||(t=e,K&&K in t))&&(We(e)||V(e)?te:S).test(Ve(e));var t}function Pe(e){var t=new e.constructor(e.byteLength);return new se(t).set(new se(e)),t}function Ce(e,t,r,i){r||(r={});for(var s=-1,n=t.length;++s<n;){var o=t[s],a=i?i(r[o],e[o],o,r,e):void 0;Ae(r,o,void 0===a?e[o]:a)}return r}function ke(e,t){var r,i,s=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?s["string"==typeof t?"string":"hash"]:s.map}function Ne(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return Ue(r)?r:void 0}$e.prototype.clear=function(){this.__data__=ve?ve(null):{}},$e.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},$e.prototype.get=function(e){var t=this.__data__;if(ve){var r=t[e];return r===i?void 0:r}return Z.call(t,e)?t[e]:void 0},$e.prototype.has=function(e){var t=this.__data__;return ve?void 0!==t[e]:Z.call(t,e)},$e.prototype.set=function(e,t){return this.__data__[e]=ve&&void 0===t?i:t,this},Oe.prototype.clear=function(){this.__data__=[]},Oe.prototype.delete=function(e){var t=this.__data__,r=Se(t,e);return!(r<0)&&(r==t.length-1?t.pop():ce.call(t,r,1),!0)},Oe.prototype.get=function(e){var t=this.__data__,r=Se(t,e);return r<0?void 0:t[r][1]},Oe.prototype.has=function(e){return Se(this.__data__,e)>-1},Oe.prototype.set=function(e,t){var r=this.__data__,i=Se(r,e);return i<0?r.push([e,t]):r[i][1]=t,this},_e.prototype.clear=function(){this.__data__={hash:new $e,map:new(fe||Oe),string:new $e}},_e.prototype.delete=function(e){return ke(this,e).delete(e)},_e.prototype.get=function(e){return ke(this,e).get(e)},_e.prototype.has=function(e){return ke(this,e).has(e)},_e.prototype.set=function(e,t){return ke(this,e).set(e,t),this},Te.prototype.clear=function(){this.__data__=new Oe},Te.prototype.delete=function(e){return this.__data__.delete(e)},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Oe){var i=r.__data__;if(!fe||i.length<199)return i.push([e,t]),this;r=this.__data__=new _e(i)}return r.set(e,t),this};var Re=ue?B(ue,Object):function(){return[]},Le=function(e){return ee.call(e)};function He(e,t){return!!(t=null==t?s:t)&&("number"==typeof e||j.test(e))&&e>-1&&e%1==0&&e<t}function Me(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||z)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ge(e,t){return e===t||e!=e&&t!=t}(pe&&Le(new pe(new ArrayBuffer(1)))!=x||fe&&Le(new fe)!=d||he&&Le(he.resolve())!=f||me&&Le(new me)!=m||ge&&Le(new ge)!=y)&&(Le=function(e){var t=ee.call(e),r=t==p?e.constructor:void 0,i=r?Ve(r):void 0;if(i)switch(i){case ye:return x;case be:return d;case xe:return f;case Ie:return m;case qe:return y}return t});var Be=Array.isArray;function Ye(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}(e.length)&&!We(e)}var Fe=de||function(){return!1};function We(e){var t=Xe(e)?ee.call(e):"";return t==c||t==u}function Xe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ze(e){return Ye(e)?we(e):function(e){if(!Me(e))return le(e);var t=[];for(var r in Object(e))Z.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return je(e,!0,!0)}}(i,i.exports);var s=i.exports;const n=e=>({get(t,r,i){if("__isProxy"===r)return!0;const s=Reflect.get(t,r);return Array.isArray(s)?s:"object"==typeof s&&null!==s?s.__isProxy?s:new Proxy(s,n(e)):s},set(t,r,i,n){const o=t[r];i=f(i)&&i.__isProxy?s(i):i;const a=Reflect.set(t,r,i,n);return((e,t)=>e!==t&&(e==e||t==t))(i,o)&&e.emit(`${y(r)}Change`,i),a}}),o=e=>encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]");class a{constructor(e){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=e.baseURL,this._beforeRequest=e.beforeRequest,this._errorHandler=e.error}_request(e){const{url:t="",timeout:r=6e4}=e;let{headers:i={}}=e;return e.url=this.baseURL.replace(/\/+$/,"")+"/"+((e,t)=>{if(!t)return e;const r=[];Object.keys(t).forEach((e=>{const i=t[e];if(null==i)return;let s;Array.isArray(i)?(s=i,e+="[]"):s=[i],s.forEach((t=>{null!==t&&"object"==typeof t&&(t=JSON.stringify(t)),r.push(`${o(e)}=${o(t)}`)}))}));const i=r.join("&");if(i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e})(t.replace(/^\/+/,""),e.params),i=Object.assign(i,this._defaultHeaders),Object.keys(i).forEach((e=>{"Content-Type"!==e&&e.toUpperCase()==="Content-Type".toUpperCase()&&(i["Content-Type"]=i[e],delete i[e])})),h(e.data)&&(i&&!i["Content-Type"]&&(i["Content-Type"]="application/json;charset=utf-8"),e.data=JSON.stringify(e.data)),e.headers=i,e.timeout=r,this._beforeRequest&&this._beforeRequest(e),"undefined"!=typeof wx?d(e):u(e)}setDefaultHeader(e,t){e in this._defaultHeaders&&(""===t||null===t)?delete this._defaultHeaders[e]:this._defaultHeaders[e]=t}get(e,t){return this._errorHandler?this._request(Object.assign(t||{},{url:e,method:"GET"})).catch((e=>{throw this._errorHandler&&this._errorHandler(e),e})):this._request(Object.assign(t||{},{url:e,method:"GET"}))}post(e,t,r){return this._errorHandler?this._request(Object.assign(r||{},{url:e,method:"POST",data:t})).catch((e=>{throw this._errorHandler&&this._errorHandler(e),e})):this._request(Object.assign(r||{},{url:e,method:"POST",data:t}))}}class c{constructor(e){let t;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((e=>{t=e})),e((e=>{this.reason||(this.reason=e,t(this.reason))}))}static source(){let e;const t=new c((t=>{e=t}));return{cancel:e,token:t}}}const u=e=>new Promise(((t,r)=>{const{data:i=null,url:s,method:n="GET",headers:o,cancelToken:a,withResDate:c}=e;let u=new XMLHttpRequest;u.open(n.toUpperCase(),s,!0),u.timeout=e.timeout;const d=()=>{if(u){if(u.status>=200&&u.status<300)try{const e=JSON.parse(u.responseText);c&&(e.responseDate=new Date(u.getResponseHeader("Date")).getTime()),t(e)}catch(e){r(new Error("E_JSON_PARSE"+u.responseText))}else r({url:s,statusCode:u.status});u=null}};"onloadend"in u?u.onloadend=d:u.onreadystatechange=()=>{u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(d)},u.onabort=()=>{u&&(r({url:s,statusCode:u.status,type:"request abort"}),u=null)},u.onerror=()=>{r(new Error("Network Error")),u=null},u.ontimeout=()=>{r(new Error("timeout of "+e.timeout+"ms exceeded")),u=null},"setRequestHeader"in u&&Object.keys(o).forEach((e=>{null===i&&"content-type"===e.toLowerCase()?delete o[e]:u.setRequestHeader(e,o[e])})),a&&a.promise.then((e=>{u&&(u.abort(),r(e),u=null)})),u.send(i)})),d=e=>new Promise(((t,r)=>{const{data:i=null,url:s,method:n="GET",headers:o,cancelToken:a}=e,c=wx.request({url:s,data:i,method:n.toUpperCase(),timeout:e.timeout,header:o,success(e){e.statusCode>=200&&e.statusCode<300?t(e.data):r({url:s,statusCode:e.statusCode})},fail(e){r("request:fail abort"===e.errMsg&&a&&a.reason||e)}});a&&a.promise.then((()=>{c&&c.abort()}))})),l=Array.isArray,p=e=>null==e,f=e=>"object"==typeof e&&null!==e,h=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},m=()=>{const e=[],t="0123456789abcdef";for(let r=0;r<36;r++)e[r]=t.substr(Math.floor(16*Math.random()),1);e[14]="4",e[19]=t.substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23]="-";return e.join("").split("-").join("")},g=(e,t)=>e?(Object.entries(e).forEach((e=>{const[r,i]=[e[0],e[1]];if(null!==i)return f(i)&&!l(i)?(t[r]||(t[r]={}),void(t[r]=g(i,t[r]))):void(t[r]=i)})),t):t,v=/-(\w)/g,y=e=>e.replace(v,((e,t)=>t?t.toUpperCase():""));var b,x,I,q,D,E;!function(e){e.REQUEST_ERROR="requestError",e.STATE="state",e.FAILED="failed"}(b||(b={})),function(e){e[e.CLOSE=0]="CLOSE",e[e.JOINED=1]="JOINED",e[e.READY=2]="READY"}(x||(x={})),function(e){e.WEBAPP="webApp",e.WEBCTRL="webCtrl",e.WECHATMP="weChatMP",e.SUPERVISION="supervision",e.BIGSCREEN="bigScreen",e.DESKTOP="desktop",e.MOBILE="mobile",e.VCS="vcs",e.SIP="sip",e.H323="h323",e.PSTN="pstn"}(I||(I={})),function(e){e.HOST="host",e.COHOST="coHost",e.ATTENDEE="attendee",e.AUDIENCE="audience"}(q||(q={})),function(e){e.STARTED="started",e.PAUSED="paused",e.STARTING="starting",e.STOPPED="stopped"}(D||(D={}));class ${constructor(e,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=e,this.emitter=t(),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))}reactive(e){if(f(e)){const t=new Map,r=(e,i)=>{Object.keys(e).forEach((s=>{!1===i&&s in this.data&&(e[s]=this.data[s]);const n=t=>e[s]=t,o=`${y(s)}Change`;this.emitter.on(o,n),t.set(o,n),f(e[s])&&!l(e[s])&&r(e[s],!0)}))};r(e,!1),e._destory=()=>{t.forEach(((e,t)=>{this.emitter.off(t,e)}))}}else console.warn("Parameter is not an object!");return e}}class O extends ${constructor(e){super(e,"info")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingInfo",(e=>{const{state:t,body:r}=e;("full"===t||"update"===t)&&g(r,this.data)})),this.ctx.emitter.on("participantCount",(e=>{const{body:t}=e;g({participantCount:t},this.data)}))}subject(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/info/subject`,t)}))}practiceSession(){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${t}/info/practiceSession`)}))}shareInfo(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${t}meetings/${r}/shareInfo`,{params:e})}meetings(e){if(!e)return Promise.reject();const{prefix:{ctrl:t}}=this.ctx.config.request;return this.ctx.request.get(`${t}meetings`,{params:e})}}function _(e){const t=[],{isInLobby:r}=e.modules.me.data;return r?(t.push("lobbyMember"),t):(Object.keys(e.modules).forEach((r=>{const i=e.modules[r]._topic();i&&(Array.isArray(i)?i.forEach((e=>{t.includes(e)||t.push(e)})):t.includes(i)||t.push(i))})),t)}function T(t,r){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:i}=r.config.request,s=yield r.request.post(`${e}meetings/${i}/subscribe`,{topics:t}),n=s&&s.data&&s.data.eventMsgs;n&&n.forEach((e=>{console.log("[subscribe]",e),r.emitter.emit(e.event,e)})),r.state!==x.READY&&(r.state=x.READY,r.emitter.emit(b.STATE,{state:r.state}))}))}function w(t,r,i){return e(this,void 0,void 0,(function*(){const{inboxes:s,sessionID:n,meetingID:o,cancelToken:a,status:c}=r;yield(()=>e(this,void 0,void 0,(function*(){const e=yield t.post("/ypush/api/v1/meeting-control/polling",{basic:{tenantId:100,clientId:n,meetingId:o},inboxes:s},{cancelToken:a,withResDate:!0});if(!e||!e.data)return;const{data:r={}}=e;Object.keys(r).forEach((e=>{const t=s.find((t=>t.name===e));if(t){if(t.seqId=r[e].maxSeqId,!r[e].items)return;r[e].items.forEach((e=>{const t=JSON.parse(e.content);["liveStream","recording"].includes(t.event)&&(t.stime=e.stime),i(t)}))}}))})))(),c.running&&(c.timer=setTimeout((()=>{c.running&&w(t,r,i)}),200))}))}function A(t){return e(this,void 0,void 0,(function*(){const r=_(t),{sessionID:i,meetingID:s}=t.config.request,n=yield function(t,r){return e(this,void 0,void 0,(function*(){const{topics:e,sessionID:i,meetingID:s}=r,n=yield t.post("/ypush/api/v1/meeting-control/inbox",{basic:{tenantId:100,clientId:i,meetingId:s},inboxes:e}),o=[];return n.data&&Object.keys(n.data).forEach((e=>{o.push({name:e,seqId:n.data[e].maxSeqId,limit:200})})),o}))}(t.request,{topics:r,sessionID:i,meetingID:s});yield T(r,t),t.status.polling.running=!0,t.status.keepalive.running=!0,w(t.request,{inboxes:n,sessionID:i,meetingID:s,cancelToken:t.config.request.cancelToken.token,status:t.status.polling},(e=>{t.emitter.emit(e.event,e)})),j(t)}))}function S(e){e.status.polling.running=!1,e.status.keepalive.running=!1,e.status.polling.timer&&(clearTimeout(e.status.polling.timer),e.status.polling.timer=null),e.status.keepalive.timer&&(clearTimeout(e.status.keepalive.timer),e.status.keepalive.timer=null),e.config.request.cancelToken.cancel(),e.config.request.cancelToken=c.source()}function j(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:r},meetingID:i,userID:s}=t.config.request;t.status.keepalive.timer&&(clearTimeout(t.status.keepalive.timer),t.status.keepalive.timer=null),yield(()=>e(this,void 0,void 0,(function*(){const e=yield t.request.post(`${r}meetings/${i}/users/${s}/keepalive`,{},{cancelToken:t.config.request.cancelToken.token});if(!e||!e.data)return;const{data:n={}}=e,o=n.interval||"";o&&(t.status.keepalive.interval=o)})))(),t.status.keepalive.running&&(t.status.keepalive.timer=setTimeout((()=>{t.status.keepalive.running&&j(t)}),1e3*t.status.keepalive.interval))}))}!function(e){e.INIT="meInit",e.UPDATE="meUpdate",e.UPDATE_USER_STATE="updateUserState",e.ROLECHANGE="meRoleChange",e.AUDIOCHANGE="meAudioChange",e.HANDUPCHANGE="meHandupChange",e.SETAUDIO="setAudio",e.VIDEOCHANGE="meVideoChange",e.SETVIDEO="setVideo",e.SHARECHANGE="meShareChange",e.DISPLAYNAMECHANGE="meDisplayNameChange",e.SPOTLIGHTVIDEOCHANGE="meSpotlightVideoChange",e.LOBBYCHANGE="meLobbyChange",e.BARRAGECHANGE="meBarrageChange",e.LEAVE="leave"}(E||(E={}));class U extends ${constructor(e){super(e,"me")}_topic(){return""}_bindOn(){const t=t=>e(this,void 0,void 0,(function*(){"role"in t&&t.role!==this.data.role&&(t.role!==q.AUDIENCE&&this.data.role!==q.AUDIENCE||(yield P(this.ctx),this.data.isUpdatedUserState=!1,this.emitter.emit(E.UPDATE_USER_STATE,{data:this.data,event:"roleChange"})),g({role:t.role},this.data),this.emitter.emit(E.ROLECHANGE,t.role),this.ctx.emitter.emit(E.ROLECHANGE,t.role))})),r=e=>{var t,r,i,s;if("audio"in e){const{deviceOn:n,sendOn:o,opBy:a}=e.audio;(!p(n)&&n!==(null===(t=this.data.audio)||void 0===t?void 0:t.deviceOn)||!p(o)&&o!==(null===(r=this.data.audio)||void 0===r?void 0:r.sendOn))&&(g({audio:e.audio},this.data),this.emitter.emit(E.AUDIOCHANGE,{deviceOn:p(n)?null===(i=this.data.audio)||void 0===i?void 0:i.deviceOn:n,sendOn:p(o)?null===(s=this.data.audio)||void 0===s?void 0:s.sendOn:o,opBy:a}))}},i=e=>{var t,r,i,s;if("video"in e){const{deviceOn:n,sendOn:o,opBy:a}=e.video;(!p(n)&&n!==(null===(t=this.data.video)||void 0===t?void 0:t.deviceOn)||!p(o)&&o!==(null===(r=this.data.video)||void 0===r?void 0:r.sendOn))&&(g({video:e.video},this.data),this.emitter.emit(E.VIDEOCHANGE,{deviceOn:p(n)?null===(i=this.data.video)||void 0===i?void 0:i.deviceOn:n,sendOn:p(o)?null===(s=this.data.video)||void 0===s?void 0:s.sendOn:o,opBy:a}))}},s=e=>{var t,r,i,s;if("share"in e){const{deviceOn:n,sendOn:o,opBy:a}=e.share;(!p(n)&&n!==(null===(t=this.data.share)||void 0===t?void 0:t.deviceOn)||!p(o)&&o!==(null===(r=this.data.share)||void 0===r?void 0:r.sendOn))&&(g({share:e.share},this.data),this.emitter.emit(E.SHARECHANGE,{deviceOn:p(n)?null===(i=this.data.share)||void 0===i?void 0:i.deviceOn:n,sendOn:p(o)?null===(s=this.data.share)||void 0===s?void 0:s.sendOn:o,opBy:a}))}},n=e=>{e.displayName&&e.displayName!==this.data.displayName&&(g({displayName:e.displayName},this.data),this.emitter.emit(E.DISPLAYNAMECHANGE,e.displayName))},o=e=>{"isHandUp"in e&&e.isHandUp!==this.data.isHandUp&&(g({isHandUp:e.isHandUp},this.data),this.emitter.emit(E.HANDUPCHANGE,e.isHandUp))},a=e=>{"isSpotlightVideo"in e&&(g({isSpotlightVideo:e.isSpotlightVideo},this.data),this.emitter.emit(E.SPOTLIGHTVIDEOCHANGE,e.isSpotlightVideo))},c=t=>e(this,void 0,void 0,(function*(){"isInLobby"in t&&t.isInLobby!==this.data.isInLobby&&(g({isInLobby:t.isInLobby},this.data),yield P(this.ctx),!1===t.isInLobby&&(this.data.isUpdatedUserState=!1,this.emitter.emit(E.UPDATE_USER_STATE,{data:this.data,event:"inLobbyChange"})),this.emitter.emit(E.LOBBYCHANGE,t.isInLobby))})),u=e=>{if(!e.barrage)return;let t=null;if(!e.barrage.wordsDisplayStatus)return t=null,delete e.barrage,this.data.barrage=t||void 0,void this.emitter.emit(E.BARRAGECHANGE,t);t={content:e.barrage.content,contentType:e.barrage.contentType,type:e.barrage.type,duration:e.barrage.duration,position:e.barrage.position};const{role:r}=this.data;e.barrage.receiver&&(r===q.HOST||r===q.COHOST?t=e.barrage.receiver.host?t:null:r===q.ATTENDEE?t=e.barrage.receiver.attendee?t:null:r===q.AUDIENCE&&(t=e.barrage.receiver.audience?t:null),delete e.barrage,this.data.barrage=t||void 0,this.emitter.emit(E.BARRAGECHANGE,t))},d=e=>{"leave"in e&&!0===e.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),console.warn("handleLeave"),S(this.ctx),K(this.ctx),this.emitter.emit(E.LEAVE,e.resultInfo),this.ctx.cleanup(e.resultInfo))},l=e=>{t(e),r(e),i(e),s(e),n(e),o(e),c(e),a(e),u(e),d(e)};this.ctx.emitter.on(E.INIT,(e=>{g(e,this.data),this.data.isUpdatedUserState=!1,this.emitter.emit(E.UPDATE_USER_STATE,{data:this.data})})),this.ctx.emitter.on(E.UPDATE,(e=>{l(e),g(e,this.data)})),this.ctx.emitter.on("me",(t=>e(this,void 0,void 0,(function*(){const{state:e,body:r={users:[]}}=t;if("delete"===e){const e=r.users[0];return e.leave=!0,void d(e)}const i=r.users.find((e=>e.userID===this.data.userID));i&&(l(i),g(i,this.data))})))),this.ctx.emitter.on("setUserVideo",(e=>{this.emitter.emit(E.SETVIDEO,e.body)})),this.ctx.emitter.on("setUserAudio",(e=>{this.emitter.emit(E.SETAUDIO,e.body)})),this.ctx.emitter.on("meetingState",(e=>{const{body:t={}}=e;if("ended"===t.state){d({leave:!0,resultInfo:t.resultInfo})}}))}updateUserState(e,t=!1){if(!t){const{role:t,initialMediaState:r}=this.data;e.audio.sendOn=e.audio.sendOn&&r.audio.sendOn,e.video.sendOn=e.video.sendOn&&r.video.sendOn,t===q.AUDIENCE&&(e.audio.sendOn=!1,e.video.sendOn=!1)}const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,g(e,this.data),this.ctx.request.post(`${r}meetings/${i}/updateUserState`,e)}}function P(t){return e(this,void 0,void 0,(function*(){const e=_(t),{meetingID:r,sessionID:i}=t.config.request;"undefined"!=typeof Worker&&t.worker?(yield T(e,t),t.worker.postMessage({topics:e,meetingID:r,sessionID:i,rePolling:!0})):(S(t),yield A(t))}))}class C extends ${constructor(e){super(e,"chat")}_topic(){return"chat"}_bindOn(){this.ctx.emitter.on("chatMsg",(e=>{const{body:t}=e;this.emitter.emit("chatMsg",t)}))}msg(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/chat/msg`,t)}))}historyMsg(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${r}/chat/historyMsg`,t)}))}}class k extends ${constructor(e){super(e,"invite")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("callRecord",(e=>{const{body:t,state:r}=e;if(t&&t.users){if("full"===r)return this.data.callRecordUsers=t.users.map((e=>(e.displayNamePinyin=k.setDisplayNamePinyinProp?k.setDisplayNamePinyinProp(e.displayName||""):e.displayName,e))),void this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers);t.users.forEach((e=>{const t=this.data.callRecordUsers.findIndex((t=>e.inviteTransID===t.inviteTransID));"update"===r&&-1!==t?g(e,this.data.callRecordUsers[t]):"update"===r&&-1===t&&(e.displayNamePinyin=k.setDisplayNamePinyinProp?k.setDisplayNamePinyinProp(e.displayName||""):e.displayName,this.data.callRecordUsers.push(e))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}invite(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/invite`,e)}mailTemplate(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${t}mailTemplate`,{params:{meetingID:r},headers:{language:e.language}})}}class N extends ${constructor(e){super(e,"liveStream")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStream",(e=>{var t;const{state:r,body:i,stime:s}=e;if(i){if(s&&(this.data.jetlag=s),"full"===r){const{liveStreams:e=[]}=i;if(!e.length)return;this.data.status=[],this.data.liveStreams=e.map((e=>(e.requesting="starting"===e.status,this.data.status.push({platform:e.platform||"",status:(e.requesting?"stopped":e.status)||""}),e)));return g({status:this.data.status,resultInfo:{}},this.data),this.data}return void 0===this.data.liveStreams&&(this.data.liveStreams=[]),i.liveStreams||(this.data.resultInfo={}),null===(t=i.liveStreams)||void 0===t||t.forEach((e=>{this.data.resultInfo=e.resultInfo||{};let t=this.data.liveStreams.findIndex((t=>t.platform===e.platform));-1===t?(e.requesting="starting"===e.status,this.data.liveStreams.push(e)):(e.requesting="starting"===e.status,e=Object.assign(Object.assign({},this.data.liveStreams[t]),e),this.data.liveStreams.splice(t,1,e)),t=this.data.status.findIndex((t=>t.platform===e.platform)),-1===t?this.data.status.push({platform:e.platform||"",status:e.requesting?"stopped":e.status||""}):this.data.status.splice(t,1,{platform:this.data.status[t].platform||"",status:e.requesting?this.data.status[t].status||"stopped":e.status||""})})),this.data}}))}setStatus(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStream/status`,t)}))}liveStreamDescription(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStream/description`,t)}))}liveStreamSetting(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/liveStream/setting`,t)}))}}class R extends ${constructor(e){super(e,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(e=>{const{state:t,body:r,stime:i}=e;if(r)return i&&(this.data.jetlag=i),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),"starting"===r.status?this.data.recording.requesting=!0:(this.data.recording.requesting=!1,this.data.status=r.status||this.data.status),this.data.resultInfo=r.resultInfo||{},["full","update"].includes(t)?(r.recordUsers&&(this.data.recording.recordUsers=r.recordUsers),this.data):void 0}))}history(){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.get(`${e}meetings/${t}/recording/history`)}))}status(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/recording/status`,t)}))}layout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/recording/status`,t)}))}designatedUsers(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/recording/designatedUsers`,t)}))}participantAdd(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/recording/participant/add`,t)}))}participantDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/recording/participant/delete`,t)}))}getTemplates(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/vmr/layout/template/getTemplates`,{params:t})}))}getByIds(t){return e(this,void 0,void 0,(function*(){const{prefix:{user:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/subject/getByIds`,t)}))}recordLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/recording/layout`,t)}))}}class L extends ${constructor(e){super(e,"setting")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingSetting",(e=>{const{state:t,body:r}=e;["full","update"].includes(t)&&g(r,this.data)}))}setting(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/setting`,t)}))}muteAll(){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${t}/muteAll`)}))}unmuteAll(){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${t}/unmuteAll`)}))}}class H extends ${constructor(e){super(e,"spotlightVideo")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("spotlightVideo",(e=>{const{body:t}=e;if(!t||!t.userIDs)return;this.data.userIDs=t.userIDs;t.userIDs.findIndex((e=>e===this.ctx.modules.me.data.userID))>-1?this.ctx.emitter.emit(E.UPDATE,{isSpotlightVideo:!0}):this.ctx.modules.me.data.isSpotlightVideo&&this.ctx.emitter.emit(E.UPDATE,{isSpotlightVideo:!1})}))}spotlight(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/view/spotlight`,e)}}class M extends ${constructor(e){super(e,"users"),this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[]}}_topic(){const{role:e,endpointType:t}=this.ctx.modules.me.data;return t===I.SUPERVISION?["interactive","broadcast"]:e===q.AUDIENCE?"interactive":["interactive","broadcast","lobby"]}_bindOn(){const e=(e,{event:t,state:r})=>{if(e.userID!==this.ctx.modules.me.data.userID)return;const{resultInfo:i={}}=e;if("delete"!==r||"delete"===r&&[901357,901358,901352,901351,901350,901349].includes(i.bizCode||-1))return void this.ctx.emitter.emit(E.UPDATE,e);let s=!1;switch(t){case"interactiveUsers":e.isInLobby||(s=!0);break;case"broadcastUsers":e.isInLobby||e.role!==q.AUDIENCE||(s=!0);break;case"lobbyUsers":e.isInLobby&&(s=!0)}const n={};s&&(n.leave=!0),this.ctx.emitter.emit(E.UPDATE,Object.assign(Object.assign({},e),n))},t=({updateUsers:t,state:r,sourceKey:i})=>{if("full"===r)return this.data[i]=t.map((t=>(t.displayNamePinyin=M.setDisplayNamePinyinProp?M.setDisplayNamePinyinProp(t.displayName):t.displayName,e(t,{event:i,state:r}),t))),this.emitter.emit(`${i}Change`,{users:this.data[i],isFull:!0}),this.data[i];void 0===this.data[i]&&(this.data[i]=[]);const{data:s,emitter:n}=this;return t.forEach((t=>{const o=s[i].findIndex((e=>t.userID===e.userID));if("delete"===r&&-1!==o){const[e]=this.data[i].splice(o,1);n.emit(`${i}Delete`,{user:e,resultInfo:t.resultInfo})}else"update"===r&&-1!==o?(this.updateUserProps(t,this.data[i][o]),g(t,this.data[i][o]),this.emitter.emit(`${i}Update`,{user:s[i][o]})):"update"===r&&-1===o&&(t.displayNamePinyin=M.setDisplayNamePinyinProp?M.setDisplayNamePinyinProp(t.displayName):t.displayName,s[i].push(t),this.emitter.emit(`${i}Add`,{user:t,resultInfo:t.resultInfo}));e(t,{event:i,state:r})})),this.emitter.emit(`${i}Change`,{users:this.data[i],isFull:!1}),this.data[i]};this.ctx.emitter.on("interactiveUsers",(e=>{const{state:r,body:i}=e;t({updateUsers:i.users,state:r,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(e=>{const{state:r,body:i}=e;t({updateUsers:i.users,state:r,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(e=>{const{state:r,body:i}=e;t({updateUsers:i.users,state:r,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(e=>{const{state:r,body:i}=e;t({updateUsers:i.users,state:r,sourceKey:"advCtrlUsers"})}))}cleanup(){this.emitter.all=new Map,this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[]}}updateUserProps(e,t){e.displayName&&e.displayName!==t.displayName&&(e.displayNamePinyin=M.setDisplayNamePinyinProp?M.setDisplayNamePinyinProp(e.displayName):e.displayName)}setAudio(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/audio`,t)}setVideo(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/video`,t)}setShare(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/share`,t)}setWhiteboard(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}users/${e}/whiteboard`,t)}handUp(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/handUp`,t)}setRole(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/role`,t)}rename(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/displayName`,t)}remove(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/users/${e}/remove`)}replyHandUp(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}users/${e}/replyHandUp`,t)}fecc(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/fecc`,t)}lobbyState(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/lobbyState`,t)}allowLocalRecord(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/allowLocalRecord`,t)}whiteboard(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/whiteboard`,t)}callStats(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${t}meetings/${r}/users/${e}/callStats`)}replyAllHandUp(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${t}/replyAllHandUp`)}admitAll(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${t}/lobby/admitAll`)}refuseAll(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${t}/lobby/refuseAll`)}}class V extends ${constructor(e){super(e,"view")}_topic(){return["hostAttendee","audience","advCtrl"]}_bindOn(){["hostLayout","attendeeLayout","audienceLayout","meetingView","personalView"].forEach((e=>{this.ctx.emitter.on(e,(t=>{"personalView"!==e?this.updateLayout(t,e):this.updatePersonalLayouts(t)}))}))}updateLayout(e,t){const{event:r,body:i}=e;i&&("meetingView"===r?Object.keys(i).forEach((e=>{this.data[e]=i[e]})):this.data[t]=i)}updatePersonalLayouts(e){const{state:t,body:r}=e;"full"!==t&&void 0!==this.data.personalLayouts||(this.data.personalLayouts={}),r.personalLayouts.forEach((e=>{const{subscriber:r={userID:-1}}=e,i=r.userID||r.subjectID||-1;"full"===t||"update"===t||e.templateStatus?this.data.personalLayouts[i]=e:delete this.data.personalLayouts[i]})),this.emitter.emit("personalLayoutsChange",this.data.personalLayouts)}hostLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/hostLayout`,t)}))}attendeeLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/attendeeLayout`,t)}))}audienceLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/audienceLayout`,t)}))}personalLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/personalLayout`,t)}))}personalLayoutDelete(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/personalLayout/delete`,t)}))}virtualClassLayout(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/view/virtualClass/layout`,t)}))}closeVirtualClass(){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${t}/view/virtualClass/close`)}))}getVirtualClassTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/layout/template/info`,{params:t})}))}addVirtualClassTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/layout/template/add`,t)}))}editVirtualClassTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/layout/template/edit`,t)}))}getTemplates(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/vmr/layout/template/getTemplates`,{params:t})}))}editTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/edit`,t)}))}addTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/add`,t)}))}deleteTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/delete`,t)}))}getDefaultTemplates(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.get(`${e}personal/vmr/layout/template/getDefaultTemplates`,{params:t})}))}changeDefaultTemplate(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/layout/template/changeDefaultTemplate`,t)}))}perspectiveBind(t){return e(this,void 0,void 0,(function*(){const{prefix:{conference:e}}=this.ctx.config.request;return yield this.ctx.request.post(`${e}personal/vmr/perspective/bind`,t)}))}}class G extends ${constructor(e){super(e,"vote")}_topic(){return"vote"}_bindOn(){this.ctx.emitter.on("vote",(e=>{const{body:t}=e,{voteID:r}=t;void 0===this.data.vote&&(this.data.vote={}),this.data.vote[r]=t,this.emitter.emit("voteChange",this.data.vote)}))}getVotes(e){const{prefix:{vote:t},meetingID:r,voteTk:i}=this.ctx.config.request;return e.tk=e.tk||i,this.ctx.request.get(`${t}meetings/${r}/votes`,{params:e})}getVote(e){const{prefix:{vote:t},meetingID:r,voteTk:i}=this.ctx.config.request;return e.tk=e.tk||i,this.ctx.request.get(`${t}meetings/${r}/vote`,{params:e})}getMeVote(e){const{prefix:{vote:t},meetingID:r,voteTk:i}=this.ctx.config.request;return e.tk=e.tk||i,this.ctx.request.get(`${t}meetings/${r}/vote/me`,{params:e})}voteStatus(e,t){const{prefix:{vote:r},meetingID:i,voteTk:s}=this.ctx.config.request;return e.tk=e.tk||s,this.ctx.request.post(`${r}meetings/${i}/vote/status?tk=${e.tk}&voteID=${e.voteID}`,t)}voteSubmit(e,t){const{prefix:{vote:r},meetingID:i,voteTk:s}=this.ctx.config.request;return e.tk=e.tk||s,this.ctx.request.post(`${r}meetings/${i}/vote/submit?tk=${e.tk}&voteID=${e.voteID}`,t)}voteAdd(e){const{prefix:{conference:t}}=this.ctx.config.request;return this.ctx.request.post(`${t}personal/vote/add`,e)}voteEdit(e){const{prefix:{conference:t}}=this.ctx.config.request;return this.ctx.request.post(`${t}personal/vote/edit`,e)}voteDelete(e){const{prefix:{conference:t}}=this.ctx.config.request;return this.ctx.request.post(`${t}personal/vote/delete`,e)}voteInProgress(e){const{prefix:{vote:t},meetingID:r,voteTk:i}=this.ctx.config.request;return this.ctx.request.get(`${t}meetings/${r}/vote/inProgress`,{params:{tk:e&&e.tk||i}})}}class B extends ${constructor(e){super(e,"words")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingBarrage",(e=>{this.data.timer&&clearTimeout(this.data.timer);const{state:t,body:r}=e;if(!r)return this.data.wordsDisplayStatus=!1,void this.ctx.emitter.emit(E.UPDATE,{barrage:this.data});"full"===t&&(this.data.barrageRecord||(this.data.barrageRecord=[]),this.data.barrageRecord.length>=10&&this.data.barrageRecord.pop(),this.data.barrageRecord=[{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(E.UPDATE,{barrage:this.data})}),1e3*r.duration)),g(r,this.data),this.emitter.emit("barrageRecordChange",this.data.barrageRecord),this.ctx.emitter.emit(E.UPDATE,{barrage:this.data}))})),this.ctx.emitter.on(E.ROLECHANGE,(()=>this.ctx.emitter.emit(E.UPDATE,{barrage:this.data})))}barrage(t){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${r}/barrage`,t)}))}deleteBarrage(){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${t}/deleteBarrage`)}))}}function Y(e){const r=function(e){const{baseURL:r,modules:i,worker:s,singleton:n}=e;i.findIndex((e=>e===U))<0&&i.push(U),i.findIndex((e=>e===O))<0&&i.push(O);const o={config:{baseURL:r,modules:i,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"},location:"",meetingID:"",ctrlID:"",sessionID:"",userID:-1,voteTk:""}},worker:s,emitter:t(),request:new a({baseURL:r,beforeRequest:e=>{e.headers["X-Y-Request-Id"]=m()},error:e=>{o.emitter.emit(b.REQUEST_ERROR,e)}}),modules:{},state:x.CLOSE,status:{polling:{running:!1,timer:null},keepalive:{running:!1,timer:null,interval:20}},cleanup:e=>{o.state!==x.CLOSE&&(o.config.request.location="",o.config.request.meetingID="",o.config.request.ctrlID="",o.config.request.sessionID="",o.config.request.userID=-1,o.config.request.voteTk="",o.status={polling:{running:!1,timer:null},keepalive:{running:!1,timer:null,interval:20}},o.request.setDefaultHeader("X-Y-Location",""),o.request.setDefaultHeader("X-Y-Ctrl-Id",""),o.request.setDefaultHeader("X-Y-Session-Id",""),o.state=x.CLOSE,o.emitter.emit(b.STATE,{state:o.state,reason:e}))}};return o}(e);return r.worker&&("undefined"!=typeof Worker?r.worker.postMessage({baseURL:r.config.baseURL}):console.error("The current environment does not support worker")),function(e,t){if(!l(e))return void console.error("The modules parameter requires an array type");e.forEach((e=>{const r=new e(t);t.modules[r.moduleName]=r}))}(r.config.modules,r),r.emitter.on(b.STATE,(({state:e})=>{e===x.CLOSE&&Object.keys(r.modules).forEach((e=>{r.modules[e].cleanup()}))})),Object.assign({config:r.config,request:r.request,get state(){return r.state},on:r.emitter.on,off:r.emitter.off,join:F(r),leave:W(r),end:X(r)},r.modules)}function F(t){return function(r){var i;return e(this,void 0,void 0,(function*(){const e=`${null===(i=r.endpointType)||void 0===i?void 0:i.toLocaleUpperCase()}${m()}_${((e=new Date,t)=>{const r={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length)));for(const i in r)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?r[i]:("00"+r[i]).substr((""+r[i]).length)));return t})(new Date,"MMddHHmmss")}_${r.meetingNum}`;t.request.setDefaultHeader("X-Y-Session-Id",e);const{prefix:s}=t.config.request,n=yield t.request.get(`${s.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},headers:{"X-Y-Endpoint-Type":r.endpointType,"X-Y-Endpoint-Id":e}}),{credential:o="",location:a=""}=n&&n.data||{};if(!o)return t.emitter.emit(b.FAILED,{bizCode:n.bizCode,data:n.data}),n;t.config.request.location=a,delete r.pwd,delete r.url;const c=yield t.request.post(`${s.ctrl}join?meetingNum=${r.meetingNum}&credential=${o}`,r,{headers:{"X-Y-Endpoint-Type":r.endpointType,"X-Y-Endpoint-Id":e}});if(!c||c&&c.ret<=-1)return t.emitter.emit(b.FAILED,{bizCode:c.bizCode,data:c.data}),c;const{meetingID:u="",ctrlID:d="",user:l={},mediaContent:p={},initialMediaState:f={},tk:h=""}=c.data;if(t.config.request.sessionID=e,t.config.request.meetingID=u,t.config.request.ctrlID=d,t.config.request.userID=l.userID,t.config.request.voteTk=h,t.request.setDefaultHeader("X-Y-Location",a),t.request.setDefaultHeader("X-Y-Ctrl-Id",d),t.emitter.emit(E.INIT,Object.assign(Object.assign({},l),{mediaContent:p,initialMediaState:f})),t.state=x.JOINED,t.emitter.emit(b.STATE,{state:t.state}),"undefined"!=typeof Worker&&t.worker){const r=_(t);yield T(r,t),t.status.keepalive.running=!0,j(t),t.worker.postMessage({topics:r,meetingID:u,sessionID:e,status:!0}),t.worker.onmessage=e=>{console.log("[Polling]",e.data),t.emitter.emit(e.data.event,e.data)}}else yield A(t);return c.data=Object.assign(Object.assign({},c.data),n.data),c}))}}function W(t){return function(r){return e(this,void 0,void 0,(function*(){r||(r={resultInfo:{bizCode:901359}});const{prefix:e,meetingID:i}=t.config.request,s=yield t.request.post(`${e.ctrl}meetings/${i}/leave`,r);return"undefined"!=typeof Worker&&t.worker&&t.worker.postMessage({status:!1}),S(t),K(t),t.cleanup(),s}))}}function X(t){return function(){return e(this,void 0,void 0,(function*(){const{prefix:e,meetingID:r}=t.config.request,i=yield t.request.post(`${e.ctrl}meetings/${r}/end`);return"undefined"!=typeof Worker&&t.worker&&t.worker.postMessage({status:!1}),S(t),K(t),t.cleanup(),i}))}}class z{constructor(e){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=Y(e)}static getInstance(e){return this.instance?this.instance:this.instance=new z(e)}}function J(e){return e.singleton?z.getInstance(e).meeting:Y(e)}function K(e){if(e.config.singleton){const{baseURL:t,modules:r,singleton:i}=e.config,s={baseURL:t,modules:r,worker:e.worker,singleton:i},n=z.getInstance(s);n&&(n.meeting=Y(s))}}Object.defineProperty(z,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null});export{C as Chat,I as ENDPOINT_TYPE,b as EVENT,O as Info,k as Invite,N as LiveStream,U as Me,E as MeEvent,D as RECORD_STATUS,q as ROLE,R as Recording,x as STATE,L as Setting,H as SpotlightVideo,M as Users,V as View,G as Vote,B as Words,J as createMeeting,K as reset};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var YlinkSDKMeeting=function(e){"use strict";function t(e,t,r,i){return new(r||(r=Promise))((function(s,n){function o(e){try{c(i.next(e))}catch(t){n(t)}}function a(e){try{c(i.throw(e))}catch(t){n(t)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))}function r(e){return{all:e=e||new Map,on:function(t,r){var i=e.get(t);i?i.push(r):e.set(t,[r])},off:function(t,r){var i=e.get(t);i&&(r?i.splice(i.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var i=e.get(t);i&&i.slice().map((function(e){e(r)})),(i=e.get("*"))&&i.slice().map((function(e){e(t,r)}))}}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={exports:{}};!function(e,t){var r="__lodash_hash_undefined__",s=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]",y="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",E="[object Float32Array]",I="[object Float64Array]",D="[object Int8Array]",q="[object Int16Array]",O="[object Int32Array]",T="[object Uint8Array]",$="[object Uint8ClampedArray]",_="[object Uint16Array]",S="[object Uint32Array]",A=/\w*$/,w=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,j={};j[n]=j["[object Array]"]=j[b]=j[x]=j[o]=j[a]=j[E]=j[I]=j[D]=j[q]=j[O]=j[d]=j[l]=j[p]=j[f]=j[m]=j[g]=j[v]=j[T]=j[$]=j[_]=j[S]=!0,j["[object Error]"]=j[c]=j[y]=!1;var P="object"==typeof self&&self&&self.Object===Object&&self,N="object"==typeof i&&i&&i.Object===Object&&i||P||Function("return this")(),C=t&&!t.nodeType&&t,R=C&&e&&!e.nodeType&&e,k=R&&R.exports===C;function L(e,t){return e.set(t[0],t[1]),e}function M(e,t){return e.add(t),e}function H(e,t,r,i){var s=-1,n=e?e.length:0;for(i&&n&&(r=e[++s]);++s<n;)r=t(r,e[s],s,e);return r}function V(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}function G(e){var t=-1,r=Array(e.size);return e.forEach((function(e,i){r[++t]=[i,e]})),r}function B(e,t){return function(r){return e(t(r))}}function Y(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var W,F=Array.prototype,X=Function.prototype,z=Object.prototype,J=N["__core-js_shared__"],K=(W=/[^.]+$/.exec(J&&J.keys&&J.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",Q=X.toString,Z=z.hasOwnProperty,ee=z.toString,te=RegExp("^"+Q.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=k?N.Buffer:void 0,ie=N.Symbol,se=N.Uint8Array,ne=B(Object.getPrototypeOf,Object),oe=Object.create,ae=z.propertyIsEnumerable,ce=F.splice,ue=Object.getOwnPropertySymbols,de=re?re.isBuffer:void 0,le=B(Object.keys,Object),pe=Re(N,"DataView"),he=Re(N,"Map"),fe=Re(N,"Promise"),me=Re(N,"Set"),ge=Re(N,"WeakMap"),ve=Re(Object,"create"),ye=Ve(pe),be=Ve(he),xe=Ve(fe),Ee=Ve(me),Ie=Ve(ge),De=ie?ie.prototype:void 0,qe=De?De.valueOf:void 0;function Oe(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Te(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function $e(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function _e(e){this.__data__=new Te(e)}function Se(e,t){var r=Be(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ye(e)}(e)&&Z.call(e,"callee")&&(!ae.call(e,"callee")||ee.call(e)==n)}(e)?function(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}(e.length,String):[],i=r.length,s=!!i;for(var o in e)!t&&!Z.call(e,o)||s&&("length"==o||Me(o,i))||r.push(o);return r}function Ae(e,t,r){var i=e[t];Z.call(e,t)&&Ge(i,r)&&(void 0!==r||t in e)||(e[t]=r)}function we(e,t){for(var r=e.length;r--;)if(Ge(e[r][0],t))return r;return-1}function Ue(e,t,r,i,s,h,y){var w;if(i&&(w=h?i(e,s,h,y):i(e)),void 0!==w)return w;if(!Xe(e))return e;var U=Be(e);if(U){if(w=function(e){var t=e.length,r=e.constructor(t);t&&"string"==typeof e[0]&&Z.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!t)return function(e,t){var r=-1,i=e.length;t||(t=Array(i));for(;++r<i;)t[r]=e[r];return t}(e,w)}else{var P=Le(e),N=P==c||P==u;if(We(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(P==p||P==n||N&&!h){if(V(e))return h?e:{};if(w=function(e){return"function"!=typeof e.constructor||He(e)?{}:(t=ne(e),Xe(t)?oe(t):{});var t}(N?{}:e),!t)return function(e,t){return Ne(e,ke(e),t)}(e,function(e,t){return e&&Ne(t,ze(t),e)}(w,e))}else{if(!j[P])return h?e:{};w=function(e,t,r,i){var s=e.constructor;switch(t){case b:return Pe(e);case o:case a:return new s(+e);case x:return function(e,t){var r=t?Pe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,i);case E:case I:case D:case q:case O:case T:case $:case _:case S:return function(e,t){var r=t?Pe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,i);case d:return function(e,t,r){return H(t?r(G(e),!0):G(e),L,new e.constructor)}(e,i,r);case l:case g:return new s(e);case f:return function(e){var t=new e.constructor(e.source,A.exec(e));return t.lastIndex=e.lastIndex,t}(e);case m:return function(e,t,r){return H(t?r(Y(e),!0):Y(e),M,new e.constructor)}(e,i,r);case v:return n=e,qe?Object(qe.call(n)):{}}var n}(e,P,Ue,t)}}y||(y=new _e);var C=y.get(e);if(C)return C;if(y.set(e,w),!U)var R=r?function(e){return function(e,t,r){var i=t(e);return Be(e)?i:function(e,t){for(var r=-1,i=t.length,s=e.length;++r<i;)e[s+r]=t[r];return e}(i,r(e))}(e,ze,ke)}(e):ze(e);return function(e,t){for(var r=-1,i=e?e.length:0;++r<i&&!1!==t(e[r],r,e););}(R||e,(function(s,n){R&&(s=e[n=s]),Ae(w,n,Ue(s,t,r,i,n,e,y))})),w}function je(e){return!(!Xe(e)||(t=e,K&&K in t))&&(Fe(e)||V(e)?te:w).test(Ve(e));var t}function Pe(e){var t=new e.constructor(e.byteLength);return new se(t).set(new se(e)),t}function Ne(e,t,r,i){r||(r={});for(var s=-1,n=t.length;++s<n;){var o=t[s],a=i?i(r[o],e[o],o,r,e):void 0;Ae(r,o,void 0===a?e[o]:a)}return r}function Ce(e,t){var r,i,s=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?s["string"==typeof t?"string":"hash"]:s.map}function Re(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return je(r)?r:void 0}Oe.prototype.clear=function(){this.__data__=ve?ve(null):{}},Oe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Oe.prototype.get=function(e){var t=this.__data__;if(ve){var i=t[e];return i===r?void 0:i}return Z.call(t,e)?t[e]:void 0},Oe.prototype.has=function(e){var t=this.__data__;return ve?void 0!==t[e]:Z.call(t,e)},Oe.prototype.set=function(e,t){return this.__data__[e]=ve&&void 0===t?r:t,this},Te.prototype.clear=function(){this.__data__=[]},Te.prototype.delete=function(e){var t=this.__data__,r=we(t,e);return!(r<0)&&(r==t.length-1?t.pop():ce.call(t,r,1),!0)},Te.prototype.get=function(e){var t=this.__data__,r=we(t,e);return r<0?void 0:t[r][1]},Te.prototype.has=function(e){return we(this.__data__,e)>-1},Te.prototype.set=function(e,t){var r=this.__data__,i=we(r,e);return i<0?r.push([e,t]):r[i][1]=t,this},$e.prototype.clear=function(){this.__data__={hash:new Oe,map:new(he||Te),string:new Oe}},$e.prototype.delete=function(e){return Ce(this,e).delete(e)},$e.prototype.get=function(e){return Ce(this,e).get(e)},$e.prototype.has=function(e){return Ce(this,e).has(e)},$e.prototype.set=function(e,t){return Ce(this,e).set(e,t),this},_e.prototype.clear=function(){this.__data__=new Te},_e.prototype.delete=function(e){return this.__data__.delete(e)},_e.prototype.get=function(e){return this.__data__.get(e)},_e.prototype.has=function(e){return this.__data__.has(e)},_e.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Te){var i=r.__data__;if(!he||i.length<199)return i.push([e,t]),this;r=this.__data__=new $e(i)}return r.set(e,t),this};var ke=ue?B(ue,Object):function(){return[]},Le=function(e){return ee.call(e)};function Me(e,t){return!!(t=null==t?s:t)&&("number"==typeof e||U.test(e))&&e>-1&&e%1==0&&e<t}function He(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||z)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ge(e,t){return e===t||e!=e&&t!=t}(pe&&Le(new pe(new ArrayBuffer(1)))!=x||he&&Le(new he)!=d||fe&&Le(fe.resolve())!=h||me&&Le(new me)!=m||ge&&Le(new ge)!=y)&&(Le=function(e){var t=ee.call(e),r=t==p?e.constructor:void 0,i=r?Ve(r):void 0;if(i)switch(i){case ye:return x;case be:return d;case xe:return h;case Ee:return m;case Ie:return y}return t});var Be=Array.isArray;function Ye(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}(e.length)&&!Fe(e)}var We=de||function(){return!1};function Fe(e){var t=Xe(e)?ee.call(e):"";return t==c||t==u}function Xe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ze(e){return Ye(e)?Se(e):function(e){if(!He(e))return le(e);var t=[];for(var r in Object(e))Z.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return Ue(e,!0,!0)}}(s,s.exports);var n=s.exports;const o=e=>({get(t,r,i){if("__isProxy"===r)return!0;const s=Reflect.get(t,r);return Array.isArray(s)?s:"object"==typeof s&&null!==s?s.__isProxy?s:new Proxy(s,o(e)):s},set(t,r,i,s){const o=t[r];i=f(i)&&i.__isProxy?n(i):i;const a=Reflect.set(t,r,i,s);return((e,t)=>e!==t&&(e==e||t==t))(i,o)&&e.emit(`${b(r)}Change`,i),a}}),a=e=>encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]");class c{constructor(e){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=e.baseURL,this._beforeRequest=e.beforeRequest,this._errorHandler=e.error}_request(e){const{url:t="",timeout:r=6e4}=e;let{headers:i={}}=e;return e.url=this.baseURL.replace(/\/+$/,"")+"/"+((e,t)=>{if(!t)return e;const r=[];Object.keys(t).forEach((e=>{const i=t[e];if(null==i)return;let s;Array.isArray(i)?(s=i,e+="[]"):s=[i],s.forEach((t=>{null!==t&&"object"==typeof t&&(t=JSON.stringify(t)),r.push(`${a(e)}=${a(t)}`)}))}));const i=r.join("&");if(i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e})(t.replace(/^\/+/,""),e.params),i=Object.assign(i,this._defaultHeaders),Object.keys(i).forEach((e=>{"Content-Type"!==e&&e.toUpperCase()==="Content-Type".toUpperCase()&&(i["Content-Type"]=i[e],delete i[e])})),m(e.data)&&(i&&!i["Content-Type"]&&(i["Content-Type"]="application/json;charset=utf-8"),e.data=JSON.stringify(e.data)),e.headers=i,e.timeout=r,this._beforeRequest&&this._beforeRequest(e),"undefined"!=typeof wx?l(e):d(e)}setDefaultHeader(e,t){e in this._defaultHeaders&&(""===t||null===t)?delete this._defaultHeaders[e]:this._defaultHeaders[e]=t}get(e,t){return this._errorHandler?this._request(Object.assign(t||{},{url:e,method:"GET"})).catch((e=>{throw this._errorHandler&&this._errorHandler(e),e})):this._request(Object.assign(t||{},{url:e,method:"GET"}))}post(e,t,r){return this._errorHandler?this._request(Object.assign(r||{},{url:e,method:"POST",data:t})).catch((e=>{throw this._errorHandler&&this._errorHandler(e),e})):this._request(Object.assign(r||{},{url:e,method:"POST",data:t}))}}class u{constructor(e){let t;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((e=>{t=e})),e((e=>{this.reason||(this.reason=e,t(this.reason))}))}static source(){let e;const t=new u((t=>{e=t}));return{cancel:e,token:t}}}const d=e=>new Promise(((t,r)=>{const{data:i=null,url:s,method:n="GET",headers:o,cancelToken:a,withResDate:c}=e;let u=new XMLHttpRequest;u.open(n.toUpperCase(),s,!0),u.timeout=e.timeout;const d=()=>{if(u){if(u.status>=200&&u.status<300)try{const e=JSON.parse(u.responseText);c&&(e.responseDate=new Date(u.getResponseHeader("Date")).getTime()),t(e)}catch(e){r(new Error("E_JSON_PARSE"+u.responseText))}else r({url:s,statusCode:u.status});u=null}};"onloadend"in u?u.onloadend=d:u.onreadystatechange=()=>{u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(d)},u.onabort=()=>{u&&(r({url:s,statusCode:u.status,type:"request abort"}),u=null)},u.onerror=()=>{r(new Error("Network Error")),u=null},u.ontimeout=()=>{r(new Error("timeout of "+e.timeout+"ms exceeded")),u=null},"setRequestHeader"in u&&Object.keys(o).forEach((e=>{null===i&&"content-type"===e.toLowerCase()?delete o[e]:u.setRequestHeader(e,o[e])})),a&&a.promise.then((e=>{u&&(u.abort(),r(e),u=null)})),u.send(i)})),l=e=>new Promise(((t,r)=>{const{data:i=null,url:s,method:n="GET",headers:o,cancelToken:a}=e,c=wx.request({url:s,data:i,method:n.toUpperCase(),timeout:e.timeout,header:o,success(e){e.statusCode>=200&&e.statusCode<300?t(e.data):r({url:s,statusCode:e.statusCode})},fail(e){r("request:fail abort"===e.errMsg&&a&&a.reason||e)}});a&&a.promise.then((()=>{c&&c.abort()}))})),p=Array.isArray,h=e=>null==e,f=e=>"object"==typeof e&&null!==e,m=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},g=()=>{const e=[],t="0123456789abcdef";for(let r=0;r<36;r++)e[r]=t.substr(Math.floor(16*Math.random()),1);e[14]="4",e[19]=t.substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23]="-";return e.join("").split("-").join("")},v=(e,t)=>e?(Object.entries(e).forEach((e=>{const[r,i]=[e[0],e[1]];if(null!==i)return f(i)&&!p(i)?(t[r]||(t[r]={}),void(t[r]=v(i,t[r]))):void(t[r]=i)})),t):t,y=/-(\w)/g,b=e=>e.replace(y,((e,t)=>t?t.toUpperCase():""));var x,E,I,D,q,O;e.EVENT=void 0,(x=e.EVENT||(e.EVENT={})).REQUEST_ERROR="requestError",x.STATE="state",x.FAILED="failed",e.STATE=void 0,(E=e.STATE||(e.STATE={}))[E.CLOSE=0]="CLOSE",E[E.JOINED=1]="JOINED",E[E.READY=2]="READY",e.ENDPOINT_TYPE=void 0,(I=e.ENDPOINT_TYPE||(e.ENDPOINT_TYPE={})).WEBAPP="webApp",I.WEBCTRL="webCtrl",I.WECHATMP="weChatMP",I.SUPERVISION="supervision",I.BIGSCREEN="bigScreen",I.DESKTOP="desktop",I.MOBILE="mobile",I.VCS="vcs",I.SIP="sip",I.H323="h323",I.PSTN="pstn",e.ROLE=void 0,(D=e.ROLE||(e.ROLE={})).HOST="host",D.COHOST="coHost",D.ATTENDEE="attendee",D.AUDIENCE="audience",e.RECORD_STATUS=void 0,(q=e.RECORD_STATUS||(e.RECORD_STATUS={})).STARTED="started",q.PAUSED="paused",q.STARTING="starting",q.STOPPED="stopped";class T{constructor(e,t){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=t,this.ctx=e,this.emitter=r(),this.on=this.emitter.on,this.off=this.emitter.off,this.data=new Proxy({},o(this.emitter)),this._bindOn()}cleanup(){this.emitter.all=new Map,this.data=new Proxy({},o(this.emitter))}reactive(e){if(f(e)){const t=new Map,r=(e,i)=>{Object.keys(e).forEach((s=>{!1===i&&s in this.data&&(e[s]=this.data[s]);const n=t=>e[s]=t,o=`${b(s)}Change`;this.emitter.on(o,n),t.set(o,n),f(e[s])&&!p(e[s])&&r(e[s],!0)}))};r(e,!1),e._destory=()=>{t.forEach(((e,t)=>{this.emitter.off(t,e)}))}}else console.warn("Parameter is not an object!");return e}}class $ extends T{constructor(e){super(e,"info")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingInfo",(e=>{const{state:t,body:r}=e;("full"===t||"update"===t)&&v(r,this.data)})),this.ctx.emitter.on("participantCount",(e=>{const{body:t}=e;v({participantCount:t},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:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${t}/info/practiceSession`)}))}shareInfo(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${t}meetings/${r}/shareInfo`,{params:e})}meetings(e){if(!e)return Promise.reject();const{prefix:{ctrl:t}}=this.ctx.config.request;return this.ctx.request.get(`${t}meetings`,{params:e})}}function _(e){const t=[],{isInLobby:r}=e.modules.me.data;return r?(t.push("lobbyMember"),t):(Object.keys(e.modules).forEach((r=>{const i=e.modules[r]._topic();i&&(Array.isArray(i)?i.forEach((e=>{t.includes(e)||t.push(e)})):t.includes(i)||t.push(i))})),t)}function S(r,i){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:s}=i.config.request,n=yield i.request.post(`${t}meetings/${s}/subscribe`,{topics:r}),o=n&&n.data&&n.data.eventMsgs;o&&o.forEach((e=>{console.log("[subscribe]",e),i.emitter.emit(e.event,e)})),i.state!==e.STATE.READY&&(i.state=e.STATE.READY,i.emitter.emit(e.EVENT.STATE,{state:i.state}))}))}function A(e,r,i){return t(this,void 0,void 0,(function*(){const{inboxes:s,sessionID:n,meetingID:o,cancelToken:a,status:c}=r;yield(()=>t(this,void 0,void 0,(function*(){const t=yield e.post("/ypush/api/v1/meeting-control/polling",{basic:{tenantId:100,clientId:n,meetingId:o},inboxes:s},{cancelToken:a,withResDate:!0});if(!t||!t.data)return;const{data:r={}}=t;Object.keys(r).forEach((e=>{const t=s.find((t=>t.name===e));if(t){if(t.seqId=r[e].maxSeqId,!r[e].items)return;r[e].items.forEach((e=>{const t=JSON.parse(e.content);["liveStream","recording"].includes(t.event)&&(t.stime=e.stime),i(t)}))}}))})))(),c.running&&(c.timer=setTimeout((()=>{c.running&&A(e,r,i)}),200))}))}function w(e){return t(this,void 0,void 0,(function*(){const r=_(e),{sessionID:i,meetingID:s}=e.config.request,n=yield function(e,r){return t(this,void 0,void 0,(function*(){const{topics:t,sessionID:i,meetingID:s}=r,n=yield e.post("/ypush/api/v1/meeting-control/inbox",{basic:{tenantId:100,clientId:i,meetingId:s},inboxes:t}),o=[];return n.data&&Object.keys(n.data).forEach((e=>{o.push({name:e,seqId:n.data[e].maxSeqId,limit:200})})),o}))}(e.request,{topics:r,sessionID:i,meetingID:s});yield S(r,e),e.status.polling.running=!0,e.status.keepalive.running=!0,A(e.request,{inboxes:n,sessionID:i,meetingID:s,cancelToken:e.config.request.cancelToken.token,status:e.status.polling},(t=>{e.emitter.emit(t.event,t)})),j(e)}))}function U(e){e.status.polling.running=!1,e.status.keepalive.running=!1,e.status.polling.timer&&(clearTimeout(e.status.polling.timer),e.status.polling.timer=null),e.status.keepalive.timer&&(clearTimeout(e.status.keepalive.timer),e.status.keepalive.timer=null),e.config.request.cancelToken.cancel(),e.config.request.cancelToken=u.source()}function j(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:r},meetingID:i,userID:s}=e.config.request;e.status.keepalive.timer&&(clearTimeout(e.status.keepalive.timer),e.status.keepalive.timer=null),yield(()=>t(this,void 0,void 0,(function*(){const t=yield e.request.post(`${r}meetings/${i}/users/${s}/keepalive`,{},{cancelToken:e.config.request.cancelToken.token});if(!t||!t.data)return;const{data:n={}}=t,o=n.interval||"";o&&(e.status.keepalive.interval=o)})))(),e.status.keepalive.running&&(e.status.keepalive.timer=setTimeout((()=>{e.status.keepalive.running&&j(e)}),1e3*e.status.keepalive.interval))}))}e.MeEvent=void 0,(O=e.MeEvent||(e.MeEvent={})).INIT="meInit",O.UPDATE="meUpdate",O.UPDATE_USER_STATE="updateUserState",O.ROLECHANGE="meRoleChange",O.AUDIOCHANGE="meAudioChange",O.HANDUPCHANGE="meHandupChange",O.SETAUDIO="setAudio",O.VIDEOCHANGE="meVideoChange",O.SETVIDEO="setVideo",O.SHARECHANGE="meShareChange",O.DISPLAYNAMECHANGE="meDisplayNameChange",O.SPOTLIGHTVIDEOCHANGE="meSpotlightVideoChange",O.LOBBYCHANGE="meLobbyChange",O.BARRAGECHANGE="meBarrageChange",O.LEAVE="leave";class P extends T{constructor(e){super(e,"me")}_topic(){return""}_bindOn(){const r=r=>t(this,void 0,void 0,(function*(){"role"in r&&r.role!==this.data.role&&(r.role!==e.ROLE.AUDIENCE&&this.data.role!==e.ROLE.AUDIENCE||(yield N(this.ctx),this.data.isUpdatedUserState=!1,this.emitter.emit(e.MeEvent.UPDATE_USER_STATE,{data:this.data,event:"roleChange"})),v({role:r.role},this.data),this.emitter.emit(e.MeEvent.ROLECHANGE,r.role),this.ctx.emitter.emit(e.MeEvent.ROLECHANGE,r.role))})),i=t=>{var r,i,s,n;if("audio"in t){const{deviceOn:o,sendOn:a,opBy:c}=t.audio;(!h(o)&&o!==(null===(r=this.data.audio)||void 0===r?void 0:r.deviceOn)||!h(a)&&a!==(null===(i=this.data.audio)||void 0===i?void 0:i.sendOn))&&(v({audio:t.audio},this.data),this.emitter.emit(e.MeEvent.AUDIOCHANGE,{deviceOn:h(o)?null===(s=this.data.audio)||void 0===s?void 0:s.deviceOn:o,sendOn:h(a)?null===(n=this.data.audio)||void 0===n?void 0:n.sendOn:a,opBy:c}))}},s=t=>{var r,i,s,n;if("video"in t){const{deviceOn:o,sendOn:a,opBy:c}=t.video;(!h(o)&&o!==(null===(r=this.data.video)||void 0===r?void 0:r.deviceOn)||!h(a)&&a!==(null===(i=this.data.video)||void 0===i?void 0:i.sendOn))&&(v({video:t.video},this.data),this.emitter.emit(e.MeEvent.VIDEOCHANGE,{deviceOn:h(o)?null===(s=this.data.video)||void 0===s?void 0:s.deviceOn:o,sendOn:h(a)?null===(n=this.data.video)||void 0===n?void 0:n.sendOn:a,opBy:c}))}},n=t=>{var r,i,s,n;if("share"in t){const{deviceOn:o,sendOn:a,opBy:c}=t.share;(!h(o)&&o!==(null===(r=this.data.share)||void 0===r?void 0:r.deviceOn)||!h(a)&&a!==(null===(i=this.data.share)||void 0===i?void 0:i.sendOn))&&(v({share:t.share},this.data),this.emitter.emit(e.MeEvent.SHARECHANGE,{deviceOn:h(o)?null===(s=this.data.share)||void 0===s?void 0:s.deviceOn:o,sendOn:h(a)?null===(n=this.data.share)||void 0===n?void 0:n.sendOn:a,opBy:c}))}},o=t=>{t.displayName&&t.displayName!==this.data.displayName&&(v({displayName:t.displayName},this.data),this.emitter.emit(e.MeEvent.DISPLAYNAMECHANGE,t.displayName))},a=t=>{"isHandUp"in t&&t.isHandUp!==this.data.isHandUp&&(v({isHandUp:t.isHandUp},this.data),this.emitter.emit(e.MeEvent.HANDUPCHANGE,t.isHandUp))},c=t=>{"isSpotlightVideo"in t&&(v({isSpotlightVideo:t.isSpotlightVideo},this.data),this.emitter.emit(e.MeEvent.SPOTLIGHTVIDEOCHANGE,t.isSpotlightVideo))},u=r=>t(this,void 0,void 0,(function*(){"isInLobby"in r&&r.isInLobby!==this.data.isInLobby&&(v({isInLobby:r.isInLobby},this.data),yield N(this.ctx),!1===r.isInLobby&&(this.data.isUpdatedUserState=!1,this.emitter.emit(e.MeEvent.UPDATE_USER_STATE,{data:this.data,event:"inLobbyChange"})),this.emitter.emit(e.MeEvent.LOBBYCHANGE,r.isInLobby))})),d=t=>{if(!t.barrage)return;let r=null;if(!t.barrage.wordsDisplayStatus)return r=null,delete t.barrage,this.data.barrage=r||void 0,void this.emitter.emit(e.MeEvent.BARRAGECHANGE,r);r={content:t.barrage.content,contentType:t.barrage.contentType,type:t.barrage.type,duration:t.barrage.duration,position:t.barrage.position};const{role:i}=this.data;t.barrage.receiver&&(i===e.ROLE.HOST||i===e.ROLE.COHOST?r=t.barrage.receiver.host?r:null:i===e.ROLE.ATTENDEE?r=t.barrage.receiver.attendee?r:null:i===e.ROLE.AUDIENCE&&(r=t.barrage.receiver.audience?r:null),delete t.barrage,this.data.barrage=r||void 0,this.emitter.emit(e.MeEvent.BARRAGECHANGE,r))},l=t=>{"leave"in t&&!0===t.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),console.warn("handleLeave"),U(this.ctx),G(this.ctx),this.emitter.emit(e.MeEvent.LEAVE,t.resultInfo),this.ctx.cleanup(t.resultInfo))},p=e=>{r(e),i(e),s(e),n(e),o(e),a(e),u(e),c(e),d(e),l(e)};this.ctx.emitter.on(e.MeEvent.INIT,(t=>{v(t,this.data),this.data.isUpdatedUserState=!1,this.emitter.emit(e.MeEvent.UPDATE_USER_STATE,{data:this.data})})),this.ctx.emitter.on(e.MeEvent.UPDATE,(e=>{p(e),v(e,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 e=r.users[0];return e.leave=!0,void l(e)}const i=r.users.find((e=>e.userID===this.data.userID));i&&(p(i),v(i,this.data))})))),this.ctx.emitter.on("setUserVideo",(t=>{this.emitter.emit(e.MeEvent.SETVIDEO,t.body)})),this.ctx.emitter.on("setUserAudio",(t=>{this.emitter.emit(e.MeEvent.SETAUDIO,t.body)})),this.ctx.emitter.on("meetingState",(e=>{const{body:t={}}=e;if("ended"===t.state){l({leave:!0,resultInfo:t.resultInfo})}}))}updateUserState(t,r=!1){if(!r){const{role:r,initialMediaState:i}=this.data;t.audio.sendOn=t.audio.sendOn&&i.audio.sendOn,t.video.sendOn=t.video.sendOn&&i.video.sendOn,r===e.ROLE.AUDIENCE&&(t.audio.sendOn=!1,t.video.sendOn=!1)}const{prefix:{ctrl:i},meetingID:s}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,v(t,this.data),this.ctx.request.post(`${i}meetings/${s}/updateUserState`,t)}}function N(e){return t(this,void 0,void 0,(function*(){const t=_(e),{meetingID:r,sessionID:i}=e.config.request;"undefined"!=typeof Worker&&e.worker?(yield S(t,e),e.worker.postMessage({topics:t,meetingID:r,sessionID:i,rePolling:!0})):(U(e),yield w(e))}))}class C extends T{constructor(e){super(e,"invite")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("callRecord",(e=>{const{body:t,state:r}=e;if(t&&t.users){if("full"===r)return this.data.callRecordUsers=t.users.map((e=>(e.displayNamePinyin=C.setDisplayNamePinyinProp?C.setDisplayNamePinyinProp(e.displayName||""):e.displayName,e))),void this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers);t.users.forEach((e=>{const t=this.data.callRecordUsers.findIndex((t=>e.inviteTransID===t.inviteTransID));"update"===r&&-1!==t?v(e,this.data.callRecordUsers[t]):"update"===r&&-1===t&&(e.displayNamePinyin=C.setDisplayNamePinyinProp?C.setDisplayNamePinyinProp(e.displayName||""):e.displayName,this.data.callRecordUsers.push(e))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}invite(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/invite`,e)}mailTemplate(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${t}mailTemplate`,{params:{meetingID:r},headers:{language:e.language}})}}class R extends T{constructor(e){super(e,"users"),this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[]}}_topic(){const{role:t,endpointType:r}=this.ctx.modules.me.data;return r===e.ENDPOINT_TYPE.SUPERVISION?["interactive","broadcast"]:t===e.ROLE.AUDIENCE?"interactive":["interactive","broadcast","lobby"]}_bindOn(){const t=(t,{event:r,state:i})=>{if(t.userID!==this.ctx.modules.me.data.userID)return;const{resultInfo:s={}}=t;if("delete"!==i||"delete"===i&&[901357,901358,901352,901351,901350,901349].includes(s.bizCode||-1))return void this.ctx.emitter.emit(e.MeEvent.UPDATE,t);let n=!1;switch(r){case"interactiveUsers":t.isInLobby||(n=!0);break;case"broadcastUsers":t.isInLobby||t.role!==e.ROLE.AUDIENCE||(n=!0);break;case"lobbyUsers":t.isInLobby&&(n=!0)}const o={};n&&(o.leave=!0),this.ctx.emitter.emit(e.MeEvent.UPDATE,Object.assign(Object.assign({},t),o))},r=({updateUsers:e,state:r,sourceKey:i})=>{if("full"===r)return this.data[i]=e.map((e=>(e.displayNamePinyin=R.setDisplayNamePinyinProp?R.setDisplayNamePinyinProp(e.displayName):e.displayName,t(e,{event:i,state:r}),e))),this.emitter.emit(`${i}Change`,{users:this.data[i],isFull:!0}),this.data[i];void 0===this.data[i]&&(this.data[i]=[]);const{data:s,emitter:n}=this;return e.forEach((e=>{const o=s[i].findIndex((t=>e.userID===t.userID));if("delete"===r&&-1!==o){const[t]=this.data[i].splice(o,1);n.emit(`${i}Delete`,{user:t,resultInfo:e.resultInfo})}else"update"===r&&-1!==o?(this.updateUserProps(e,this.data[i][o]),v(e,this.data[i][o]),this.emitter.emit(`${i}Update`,{user:s[i][o]})):"update"===r&&-1===o&&(e.displayNamePinyin=R.setDisplayNamePinyinProp?R.setDisplayNamePinyinProp(e.displayName):e.displayName,s[i].push(e),this.emitter.emit(`${i}Add`,{user:e,resultInfo:e.resultInfo}));t(e,{event:i,state:r})})),this.emitter.emit(`${i}Change`,{users:this.data[i],isFull:!1}),this.data[i]};this.ctx.emitter.on("interactiveUsers",(e=>{const{state:t,body:i}=e;r({updateUsers:i.users,state:t,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(e=>{const{state:t,body:i}=e;r({updateUsers:i.users,state:t,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(e=>{const{state:t,body:i}=e;r({updateUsers:i.users,state:t,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(e=>{const{state:t,body:i}=e;r({updateUsers:i.users,state:t,sourceKey:"advCtrlUsers"})}))}cleanup(){this.emitter.all=new Map,this.data={interactiveUsers:[],broadcastUsers:[],lobbyUsers:[],advCtrlUsers:[]}}updateUserProps(e,t){e.displayName&&e.displayName!==t.displayName&&(e.displayNamePinyin=R.setDisplayNamePinyinProp?R.setDisplayNamePinyinProp(e.displayName):e.displayName)}setAudio(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/audio`,t)}setVideo(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/video`,t)}setShare(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/share`,t)}setWhiteboard(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}users/${e}/whiteboard`,t)}handUp(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/handUp`,t)}setRole(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/role`,t)}rename(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/displayName`,t)}remove(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/users/${e}/remove`)}replyHandUp(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}users/${e}/replyHandUp`,t)}fecc(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/fecc`,t)}lobbyState(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/lobbyState`,t)}allowLocalRecord(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/allowLocalRecord`,t)}whiteboard(e,t){if(!e||!t)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}meetings/${i}/users/${e}/whiteboard`,t)}callStats(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${t}meetings/${r}/users/${e}/callStats`)}replyAllHandUp(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${t}/replyAllHandUp`)}admitAll(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${t}/lobby/admitAll`)}refuseAll(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return this.ctx.request.post(`${e}meetings/${t}/lobby/refuseAll`)}}function k(t){const i=function(t){const{baseURL:i,modules:s,worker:n,singleton:o}=t;s.findIndex((e=>e===P))<0&&s.push(P),s.findIndex((e=>e===$))<0&&s.push($);const a={config:{baseURL:i,modules:s,singleton:o||!1,request:{cancelToken:u.source(),prefix:{ctrl:"/meeting-ctrl/api/v1/",conference:"/conference-manager/api/v1/",user:"/user-manager/api/v1/",vote:"/vote/api/v1"},location:"",meetingID:"",ctrlID:"",sessionID:"",userID:-1,voteTk:""}},worker:n,emitter:r(),request:new c({baseURL:i,beforeRequest:e=>{e.headers["X-Y-Request-Id"]=g()},error:t=>{a.emitter.emit(e.EVENT.REQUEST_ERROR,t)}}),modules:{},state:e.STATE.CLOSE,status:{polling:{running:!1,timer:null},keepalive:{running:!1,timer:null,interval:20}},cleanup:t=>{a.state!==e.STATE.CLOSE&&(a.config.request.location="",a.config.request.meetingID="",a.config.request.ctrlID="",a.config.request.sessionID="",a.config.request.userID=-1,a.config.request.voteTk="",a.status={polling:{running:!1,timer:null},keepalive:{running:!1,timer:null,interval:20}},a.request.setDefaultHeader("X-Y-Location",""),a.request.setDefaultHeader("X-Y-Ctrl-Id",""),a.request.setDefaultHeader("X-Y-Session-Id",""),a.state=e.STATE.CLOSE,a.emitter.emit(e.EVENT.STATE,{state:a.state,reason:t}))}};return a}(t);return i.worker&&("undefined"!=typeof Worker?i.worker.postMessage({baseURL:i.config.baseURL}):console.error("The current environment does not support worker")),function(e,t){if(!p(e))return void console.error("The modules parameter requires an array type");e.forEach((e=>{const r=new e(t);t.modules[r.moduleName]=r}))}(i.config.modules,i),i.emitter.on(e.EVENT.STATE,(({state:t})=>{t===e.STATE.CLOSE&&Object.keys(i.modules).forEach((e=>{i.modules[e].cleanup()}))})),Object.assign({config:i.config,request:i.request,get state(){return i.state},on:i.emitter.on,off:i.emitter.off,join:L(i),leave:M(i),end:H(i)},i.modules)}function L(r){return function(i){var s;return t(this,void 0,void 0,(function*(){const t=`${null===(s=i.endpointType)||void 0===s?void 0:s.toLocaleUpperCase()}${g()}_${((e=new Date,t)=>{const r={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length)));for(const i in r)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?r[i]:("00"+r[i]).substr((""+r[i]).length)));return t})(new Date,"MMddHHmmss")}_${i.meetingNum}`;r.request.setDefaultHeader("X-Y-Session-Id",t);const{prefix:n}=r.config.request,o=yield r.request.get(`${n.ctrl}credential`,{params:{meetingNum:i.meetingNum,pwd:i.pwd,url:i.url,mobileCode:i.mobileCode,mobile:i.mobile,regEmail:i.regEmail,accEmail:i.accEmail,tk:i.tk,displayName:i.displayName},headers:{"X-Y-Endpoint-Type":i.endpointType,"X-Y-Endpoint-Id":t}}),{credential:a="",location:c=""}=o&&o.data||{};if(!a)return r.emitter.emit(e.EVENT.FAILED,{bizCode:o.bizCode,data:o.data}),o;r.config.request.location=c,delete i.pwd,delete i.url;const u=yield r.request.post(`${n.ctrl}join?meetingNum=${i.meetingNum}&credential=${a}`,i,{headers:{"X-Y-Endpoint-Type":i.endpointType,"X-Y-Endpoint-Id":t}});if(!u||u&&u.ret<=-1)return r.emitter.emit(e.EVENT.FAILED,{bizCode:u.bizCode,data:u.data}),u;const{meetingID:d="",ctrlID:l="",user:p={},mediaContent:h={},initialMediaState:f={},tk:m=""}=u.data;if(r.config.request.sessionID=t,r.config.request.meetingID=d,r.config.request.ctrlID=l,r.config.request.userID=p.userID,r.config.request.voteTk=m,r.request.setDefaultHeader("X-Y-Location",c),r.request.setDefaultHeader("X-Y-Ctrl-Id",l),r.emitter.emit(e.MeEvent.INIT,Object.assign(Object.assign({},p),{mediaContent:h,initialMediaState:f})),r.state=e.STATE.JOINED,r.emitter.emit(e.EVENT.STATE,{state:r.state}),"undefined"!=typeof Worker&&r.worker){const e=_(r);yield S(e,r),r.status.keepalive.running=!0,j(r),r.worker.postMessage({topics:e,meetingID:d,sessionID:t,status:!0}),r.worker.onmessage=e=>{console.log("[Polling]",e.data),r.emitter.emit(e.data.event,e.data)}}else yield w(r);return u.data=Object.assign(Object.assign({},u.data),o.data),u}))}}function M(e){return function(r){return t(this,void 0,void 0,(function*(){r||(r={resultInfo:{bizCode:901359}});const{prefix:t,meetingID:i}=e.config.request,s=yield e.request.post(`${t.ctrl}meetings/${i}/leave`,r);return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1}),U(e),G(e),e.cleanup(),s}))}}function H(e){return function(){return t(this,void 0,void 0,(function*(){const{prefix:t,meetingID:r}=e.config.request,i=yield e.request.post(`${t.ctrl}meetings/${r}/end`);return"undefined"!=typeof Worker&&e.worker&&e.worker.postMessage({status:!1}),U(e),G(e),e.cleanup(),i}))}}class V{constructor(e){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=k(e)}static getInstance(e){return this.instance?this.instance:this.instance=new V(e)}}function G(e){if(e.config.singleton){const{baseURL:t,modules:r,singleton:i}=e.config,s={baseURL:t,modules:r,worker:e.worker,singleton:i},n=V.getInstance(s);n&&(n.meeting=k(s))}}return Object.defineProperty(V,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null}),e.Chat=class extends T{constructor(e){super(e,"chat")}_topic(){return"chat"}_bindOn(){this.ctx.emitter.on("chatMsg",(e=>{const{body:t}=e;this.emitter.emit("chatMsg",t)}))}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)}))}},e.Info=$,e.Invite=C,e.LiveStream=class extends T{constructor(e){super(e,"liveStream")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStream",(e=>{var t;const{state:r,body:i,stime:s}=e;if(i){if(s&&(this.data.jetlag=s),"full"===r){const{liveStreams:e=[]}=i;if(!e.length)return;this.data.status=[],this.data.liveStreams=e.map((e=>(e.requesting="starting"===e.status,this.data.status.push({platform:e.platform||"",status:(e.requesting?"stopped":e.status)||""}),e)));return v({status:this.data.status,resultInfo:{}},this.data),this.data}return void 0===this.data.liveStreams&&(this.data.liveStreams=[]),i.liveStreams||(this.data.resultInfo={}),null===(t=i.liveStreams)||void 0===t||t.forEach((e=>{this.data.resultInfo=e.resultInfo||{};let t=this.data.liveStreams.findIndex((t=>t.platform===e.platform));-1===t?(e.requesting="starting"===e.status,this.data.liveStreams.push(e)):(e.requesting="starting"===e.status,e=Object.assign(Object.assign({},this.data.liveStreams[t]),e),this.data.liveStreams.splice(t,1,e)),t=this.data.status.findIndex((t=>t.platform===e.platform)),-1===t?this.data.status.push({platform:e.platform||"",status:e.requesting?"stopped":e.status||""}):this.data.status.splice(t,1,{platform:this.data.status[t].platform||"",status:e.requesting?this.data.status[t].status||"stopped":e.status||""})})),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)}))}},e.Me=P,e.Recording=class extends T{constructor(e){super(e,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(e=>{const{state:t,body:r,stime:i}=e;if(r)return i&&(this.data.jetlag=i),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),"starting"===r.status?this.data.recording.requesting=!0:(this.data.recording.requesting=!1,this.data.status=r.status||this.data.status),this.data.resultInfo=r.resultInfo||{},["full","update"].includes(t)?(r.recordUsers&&(this.data.recording.recordUsers=r.recordUsers),this.data):void 0}))}history(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.get(`${e}meetings/${t}/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)}))}},e.Setting=class extends T{constructor(e){super(e,"setting")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingSetting",(e=>{const{state:t,body:r}=e;["full","update"].includes(t)&&v(r,this.data)}))}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:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${t}/muteAll`)}))}unmuteAll(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${t}/unmuteAll`)}))}},e.SpotlightVideo=class extends T{constructor(e){super(e,"spotlightVideo")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("spotlightVideo",(t=>{const{body:r}=t;if(!r||!r.userIDs)return;this.data.userIDs=r.userIDs;r.userIDs.findIndex((e=>e===this.ctx.modules.me.data.userID))>-1?this.ctx.emitter.emit(e.MeEvent.UPDATE,{isSpotlightVideo:!0}):this.ctx.modules.me.data.isSpotlightVideo&&this.ctx.emitter.emit(e.MeEvent.UPDATE,{isSpotlightVideo:!1})}))}spotlight(e){if(!e)return Promise.reject();const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}meetings/${r}/view/spotlight`,e)}},e.Users=R,e.View=class extends T{constructor(e){super(e,"view")}_topic(){return["hostAttendee","audience","advCtrl"]}_bindOn(){["hostLayout","attendeeLayout","audienceLayout","meetingView","personalView"].forEach((e=>{this.ctx.emitter.on(e,(t=>{"personalView"!==e?this.updateLayout(t,e):this.updatePersonalLayouts(t)}))}))}updateLayout(e,t){const{event:r,body:i}=e;i&&("meetingView"===r?Object.keys(i).forEach((e=>{this.data[e]=i[e]})):this.data[t]=i)}updatePersonalLayouts(e){const{state:t,body:r}=e;"full"!==t&&void 0!==this.data.personalLayouts||(this.data.personalLayouts={}),r.personalLayouts.forEach((e=>{const{subscriber:r={userID:-1}}=e,i=r.userID||r.subjectID||-1;"full"===t||"update"===t||e.templateStatus?this.data.personalLayouts[i]=e:delete this.data.personalLayouts[i]})),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:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${t}/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)}))}},e.Vote=class extends T{constructor(e){super(e,"vote")}_topic(){return"vote"}_bindOn(){this.ctx.emitter.on("vote",(e=>{const{body:t}=e,{voteID:r}=t;void 0===this.data.vote&&(this.data.vote={}),this.data.vote[r]=t,this.emitter.emit("voteChange",this.data.vote)}))}getVotes(e){const{prefix:{vote:t},meetingID:r,voteTk:i}=this.ctx.config.request;return e.tk=e.tk||i,this.ctx.request.get(`${t}meetings/${r}/votes`,{params:e})}getVote(e){const{prefix:{vote:t},meetingID:r,voteTk:i}=this.ctx.config.request;return e.tk=e.tk||i,this.ctx.request.get(`${t}meetings/${r}/vote`,{params:e})}getMeVote(e){const{prefix:{vote:t},meetingID:r,voteTk:i}=this.ctx.config.request;return e.tk=e.tk||i,this.ctx.request.get(`${t}meetings/${r}/vote/me`,{params:e})}voteStatus(e,t){const{prefix:{vote:r},meetingID:i,voteTk:s}=this.ctx.config.request;return e.tk=e.tk||s,this.ctx.request.post(`${r}meetings/${i}/vote/status?tk=${e.tk}&voteID=${e.voteID}`,t)}voteSubmit(e,t){const{prefix:{vote:r},meetingID:i,voteTk:s}=this.ctx.config.request;return e.tk=e.tk||s,this.ctx.request.post(`${r}meetings/${i}/vote/submit?tk=${e.tk}&voteID=${e.voteID}`,t)}voteAdd(e){const{prefix:{conference:t}}=this.ctx.config.request;return this.ctx.request.post(`${t}personal/vote/add`,e)}voteEdit(e){const{prefix:{conference:t}}=this.ctx.config.request;return this.ctx.request.post(`${t}personal/vote/edit`,e)}voteDelete(e){const{prefix:{conference:t}}=this.ctx.config.request;return this.ctx.request.post(`${t}personal/vote/delete`,e)}voteInProgress(e){const{prefix:{vote:t},meetingID:r,voteTk:i}=this.ctx.config.request;return this.ctx.request.get(`${t}meetings/${r}/vote/inProgress`,{params:{tk:e&&e.tk||i}})}},e.Words=class extends T{constructor(e){super(e,"words")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingBarrage",(t=>{this.data.timer&&clearTimeout(this.data.timer);const{state:r,body:i}=t;if(!i)return this.data.wordsDisplayStatus=!1,void this.ctx.emitter.emit(e.MeEvent.UPDATE,{barrage:this.data});"full"===r&&(this.data.barrageRecord||(this.data.barrageRecord=[]),this.data.barrageRecord.length>=10&&this.data.barrageRecord.pop(),this.data.barrageRecord=[{content:i.content,time:(new Date).getTime(),durationType:i.durationType,duration:1e3*i.duration},...this.data.barrageRecord],i.wordsDisplayStatus=!0,-1!==i.duration&&(this.data.timer=setTimeout((()=>{i.wordsDisplayStatus=!1,this.data.timer=null,this.data.wordsDisplayStatus=i.wordsDisplayStatus,this.ctx.emitter.emit(e.MeEvent.UPDATE,{barrage:this.data})}),1e3*i.duration)),v(i,this.data),this.emitter.emit("barrageRecordChange",this.data.barrageRecord),this.ctx.emitter.emit(e.MeEvent.UPDATE,{barrage:this.data}))})),this.ctx.emitter.on(e.MeEvent.ROLECHANGE,(()=>this.ctx.emitter.emit(e.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:e},meetingID:t}=this.ctx.config.request;return yield this.ctx.request.post(`${e}meetings/${t}/deleteBarrage`)}))}},e.createMeeting=function(e){return e.singleton?V.getInstance(e).meeting:k(e)},e.reset=G,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e,t,n,s){return new(n||(n=Promise))((function(r,o){function a(e){try{u(s.next(e))}catch(t){o(t)}}function i(e){try{u(s.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}u((s=s.apply(e,t||[])).next())}))}const t=e=>encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]");class n{constructor(e){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=e.baseURL,this._beforeRequest=e.beforeRequest,this._errorHandler=e.error}_request(e){const{url:n="",timeout:s=6e4}=e;let{headers:i={}}=e;return e.url=this.baseURL.replace(/\/+$/,"")+"/"+((e,n)=>{if(!n)return e;const s=[];Object.keys(n).forEach((e=>{const r=n[e];if(null==r)return;let o;Array.isArray(r)?(o=r,e+="[]"):o=[r],o.forEach((n=>{null!==n&&"object"==typeof n&&(n=JSON.stringify(n)),s.push(`${t(e)}=${t(n)}`)}))}));const r=s.join("&");if(r){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e})(n.replace(/^\/+/,""),e.params),i=Object.assign(i,this._defaultHeaders),Object.keys(i).forEach((e=>{"Content-Type"!==e&&e.toUpperCase()==="Content-Type".toUpperCase()&&(i["Content-Type"]=i[e],delete i[e])})),a(e.data)&&(i&&!i["Content-Type"]&&(i["Content-Type"]="application/json;charset=utf-8"),e.data=JSON.stringify(e.data)),e.headers=i,e.timeout=s,this._beforeRequest&&this._beforeRequest(e),"undefined"!=typeof wx?o(e):r(e)}setDefaultHeader(e,t){e in this._defaultHeaders&&(""===t||null===t)?delete this._defaultHeaders[e]:this._defaultHeaders[e]=t}get(e,t){return this._errorHandler?this._request(Object.assign(t||{},{url:e,method:"GET"})).catch((e=>{throw this._errorHandler&&this._errorHandler(e),e})):this._request(Object.assign(t||{},{url:e,method:"GET"}))}post(e,t,n){return this._errorHandler?this._request(Object.assign(n||{},{url:e,method:"POST",data:t})).catch((e=>{throw this._errorHandler&&this._errorHandler(e),e})):this._request(Object.assign(n||{},{url:e,method:"POST",data:t}))}}class s{constructor(e){let t;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((e=>{t=e})),e((e=>{this.reason||(this.reason=e,t(this.reason))}))}static source(){let e;const t=new s((t=>{e=t}));return{cancel:e,token:t}}}const r=e=>new Promise(((t,n)=>{const{data:s=null,url:r,method:o="GET",headers:a,cancelToken:i,withResDate:u}=e;let c=new XMLHttpRequest;c.open(o.toUpperCase(),r,!0),c.timeout=e.timeout;const l=()=>{if(c){if(c.status>=200&&c.status<300)try{const e=JSON.parse(c.responseText);u&&(e.responseDate=new Date(c.getResponseHeader("Date")).getTime()),t(e)}catch(e){n(new Error("E_JSON_PARSE"+c.responseText))}else n({url:r,statusCode:c.status});c=null}};"onloadend"in c?c.onloadend=l:c.onreadystatechange=()=>{c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=()=>{c&&(n({url:r,statusCode:c.status,type:"request abort"}),c=null)},c.onerror=()=>{n(new Error("Network Error")),c=null},c.ontimeout=()=>{n(new Error("timeout of "+e.timeout+"ms exceeded")),c=null},"setRequestHeader"in c&&Object.keys(a).forEach((e=>{null===s&&"content-type"===e.toLowerCase()?delete a[e]:c.setRequestHeader(e,a[e])})),i&&i.promise.then((e=>{c&&(c.abort(),n(e),c=null)})),c.send(s)})),o=e=>new Promise(((t,n)=>{const{data:s=null,url:r,method:o="GET",headers:a,cancelToken:i}=e,u=wx.request({url:r,data:s,method:o.toUpperCase(),timeout:e.timeout,header:a,success(e){e.statusCode>=200&&e.statusCode<300?t(e.data):n({url:r,statusCode:e.statusCode})},fail(e){n("request:fail abort"===e.errMsg&&i&&i.reason||e)}});i&&i.promise.then((()=>{u&&u.abort()}))})),a=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype};function i(t,n,s){return e(this,void 0,void 0,(function*(){const{inboxes:r,sessionID:o,meetingID:a,cancelToken:u,status:c}=n;yield(()=>e(this,void 0,void 0,(function*(){const e=yield t.post("/ypush/api/v1/meeting-control/polling",{basic:{tenantId:100,clientId:o,meetingId:a},inboxes:r},{cancelToken:u,withResDate:!0});if(!e||!e.data)return;const{data:n={}}=e;Object.keys(n).forEach((e=>{const t=r.find((t=>t.name===e));if(t){if(t.seqId=n[e].maxSeqId,!n[e].items)return;n[e].items.forEach((e=>{const t=JSON.parse(e.content);["liveStream","recording"].includes(t.event)&&(t.stime=e.stime),s(t)}))}}))})))(),c.running&&(c.timer=setTimeout((()=>{c.running&&i(t,n,s)}),200))}))}const u=self;let c,l=s.source(),d="",h=[],p="",f="";const b={running:!1,timer:null};function m(){return e(this,void 0,void 0,(function*(){c=new n({baseURL:d});const t=yield function(t,n){return e(this,void 0,void 0,(function*(){const{topics:e,sessionID:s,meetingID:r}=n,o=yield t.post("/ypush/api/v1/meeting-control/inbox",{basic:{tenantId:100,clientId:s,meetingId:r},inboxes:e}),a=[];return o.data&&Object.keys(o.data).forEach((e=>{a.push({name:e,seqId:o.data[e].maxSeqId,limit:200})})),a}))}(c,{topics:h,sessionID:p,meetingID:f});b.running=!0,i(c,{inboxes:t,sessionID:p,meetingID:f,cancelToken:l.token,status:b},(e=>{u.postMessage(e)}))}))}function g(){b.running=!1,b.timer&&(clearTimeout(b.timer),b.timer=null),l.cancel(),l=s.source()}u.addEventListener("message",(e=>{"baseURL"in e.data&&(d=e.data.baseURL),"topics"in e.data&&(h=e.data.topics),"sessionID"in e.data&&(p=e.data.sessionID),"meetingID"in e.data&&(f=e.data.meetingID),"rePolling"in e.data&&(g(),m()),"status"in e.data&&(e.data.status?m():g())}),!1);
|
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,59 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ylink-sdk/meeting",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
3
|
+
"version": "0.2.0-beta.2",
|
|
4
|
+
"description": "Meeting control of yealink",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"module": "dist/meeting.esm.prod.js",
|
|
7
|
+
"types": "dist/meeting.d.ts",
|
|
8
8
|
"author": "ylink",
|
|
9
9
|
"license": "MIT",
|
|
10
|
+
"sideEffects": false,
|
|
10
11
|
"files": [
|
|
12
|
+
"index.js",
|
|
11
13
|
"dist"
|
|
12
14
|
],
|
|
13
15
|
"publishConfig": {
|
|
14
16
|
"access": "public"
|
|
15
17
|
},
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"dev": "rollup -wc",
|
|
25
|
-
"build": "npm-run-all --silent clean -p bundle -p clean-dts",
|
|
26
|
-
"bundle": "rollup -c",
|
|
27
|
-
"clean": "rimraf dist",
|
|
28
|
-
"clean-dts": "rimraf dist/utils dist/core.d.ts dist/ctrl.d.ts",
|
|
29
|
-
"lint": "eslint src --fix --ext .ts",
|
|
30
|
-
"prepare": "husky install",
|
|
31
|
-
"doc": "gulp typedoc"
|
|
18
|
+
"buildOptions": {
|
|
19
|
+
"name": "YlinkSDKMeeting",
|
|
20
|
+
"formats": [
|
|
21
|
+
"esm",
|
|
22
|
+
"cjs",
|
|
23
|
+
"global"
|
|
24
|
+
],
|
|
25
|
+
"workers": ["polling.worker.ts"]
|
|
32
26
|
},
|
|
33
27
|
"devDependencies": {
|
|
34
|
-
"@
|
|
35
|
-
|
|
36
|
-
"@rollup/plugin-node-resolve": "^13.0.4",
|
|
37
|
-
"@rollup/plugin-typescript": "^8.2.5",
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "^4.28.5",
|
|
39
|
-
"@typescript-eslint/parser": "^4.28.5",
|
|
40
|
-
"eslint": "^7.31.0",
|
|
41
|
-
"eslint-config-prettier": "^8.3.0",
|
|
42
|
-
"eslint-plugin-import": "^2.23.4",
|
|
43
|
-
"eslint-plugin-prettier": "^3.4.0",
|
|
44
|
-
"gulp": "^4.0.2",
|
|
45
|
-
"gulp-typedoc": "^3.0.1",
|
|
46
|
-
"husky": "^7.0.0",
|
|
47
|
-
"lint-staged": "^12.1.5",
|
|
48
|
-
"npm-run-all": "^4.1.5",
|
|
49
|
-
"prettier": "^2.3.2",
|
|
50
|
-
"rimraf": "^3.0.2",
|
|
51
|
-
"rollup": "^2.54.0",
|
|
52
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
53
|
-
"tslib": "^2.3.0",
|
|
54
|
-
"typedoc": "^0.21.4",
|
|
55
|
-
"typedoc-plugin-merge-modules": "^3.0.0",
|
|
56
|
-
"typescript": "^4.3.5"
|
|
57
|
-
},
|
|
58
|
-
"dependencies": {}
|
|
28
|
+
"@ylink-sdk/shared": "workspace:*"
|
|
29
|
+
}
|
|
59
30
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 ylink
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/dist/index.d.ts
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { Ctrl } from './types/ctrl';
|
|
2
|
-
import { ENDPOINT_TYPE, EVENT, CONNECTION_STATE, ROLE, ME_CHANGE, MEETING_CHANGE } from './types/enums';
|
|
3
|
-
import { Data, ResultInfo, JobStatus, UserState } from './types/data';
|
|
4
|
-
export declare type Handler<T = Record<any, any>> = (event: T[keyof T]) => void;
|
|
5
|
-
export interface ParamsJoin {
|
|
6
|
-
meetingNum: string;
|
|
7
|
-
pwd?: string;
|
|
8
|
-
displayName: string;
|
|
9
|
-
endpointType: ENDPOINT_TYPE;
|
|
10
|
-
inviteTransID?: string;
|
|
11
|
-
groupIDs?: Array<string>;
|
|
12
|
-
account?: string;
|
|
13
|
-
userAgent?: string;
|
|
14
|
-
groupName?: string;
|
|
15
|
-
url?: string;
|
|
16
|
-
mobileCode?: string;
|
|
17
|
-
mobile?: string;
|
|
18
|
-
regEmail?: string;
|
|
19
|
-
accEmail?: string;
|
|
20
|
-
tk?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface MeetingConfig {
|
|
23
|
-
/**
|
|
24
|
-
* 服务器地址
|
|
25
|
-
* @example
|
|
26
|
-
* https://meetings.ylyun.com/control
|
|
27
|
-
*/
|
|
28
|
-
baseURL: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* 亿联会议会控
|
|
32
|
-
*/
|
|
33
|
-
export default class Meeting {
|
|
34
|
-
/**
|
|
35
|
-
* 终端类型
|
|
36
|
-
*/
|
|
37
|
-
static ENDPOINT_TYPE: typeof ENDPOINT_TYPE;
|
|
38
|
-
/**
|
|
39
|
-
* 通知事件
|
|
40
|
-
*/
|
|
41
|
-
static EVENT: typeof EVENT;
|
|
42
|
-
/**
|
|
43
|
-
* 会议连接状态
|
|
44
|
-
*/
|
|
45
|
-
static CONNECTION_STATE: typeof CONNECTION_STATE;
|
|
46
|
-
/**
|
|
47
|
-
* 角色
|
|
48
|
-
*/
|
|
49
|
-
static ROLE: typeof ROLE;
|
|
50
|
-
/**
|
|
51
|
-
* 自身信息变更
|
|
52
|
-
*/
|
|
53
|
-
static ME_CHANGE: typeof ME_CHANGE;
|
|
54
|
-
/**
|
|
55
|
-
* 会议信息变更
|
|
56
|
-
*/
|
|
57
|
-
static MEETING_CHANGE: typeof MEETING_CHANGE;
|
|
58
|
-
/**
|
|
59
|
-
* 初始化
|
|
60
|
-
* @example
|
|
61
|
-
* ```typescript
|
|
62
|
-
* const meeting = new Meeting(config);
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
constructor(config: MeetingConfig);
|
|
66
|
-
/**
|
|
67
|
-
* 获取会议会控交互功能
|
|
68
|
-
* @since 1.0.0
|
|
69
|
-
* @example
|
|
70
|
-
* ```typescript
|
|
71
|
-
* meeting.ctrl.audio({ sendOn: true, userID: 1 }); // 开启用户音频
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
get ctrl(): Ctrl;
|
|
75
|
-
/**
|
|
76
|
-
* 获取当前会议会控实时数据
|
|
77
|
-
* @since 1.0.0
|
|
78
|
-
* @returns 会议会控数据
|
|
79
|
-
* @example
|
|
80
|
-
* ```typescript
|
|
81
|
-
* meeting.data.me // 获取自身信息
|
|
82
|
-
* meeting.data.meetingInfo // 获取会议信息
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
get data(): Data;
|
|
86
|
-
/**
|
|
87
|
-
* 获取当前会议连接状态
|
|
88
|
-
* @since 1.0.0
|
|
89
|
-
*/
|
|
90
|
-
get connectionState(): CONNECTION_STATE;
|
|
91
|
-
/**
|
|
92
|
-
* 事件监听
|
|
93
|
-
* @since 1.0.0
|
|
94
|
-
* @param type 事件
|
|
95
|
-
* @param handler 事件消息处理
|
|
96
|
-
* @example
|
|
97
|
-
* ```typescript
|
|
98
|
-
* meeting.on('me-change', payload => {});
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
on(type: EVENT, handler: Handler): void;
|
|
102
|
-
/**
|
|
103
|
-
* 移除事件监听
|
|
104
|
-
* @param type 事件
|
|
105
|
-
* @param handler 事件消息处理
|
|
106
|
-
* @example
|
|
107
|
-
* ```typescript
|
|
108
|
-
* meeting.off('me-change'); // 将移除me-change所有的handler
|
|
109
|
-
* const handler = payload => {};
|
|
110
|
-
* meeting.off('me-change', handler); // 移除me-change对应的handler
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
off(type: EVENT, handler?: Handler): void;
|
|
114
|
-
/**
|
|
115
|
-
* 获取配置的服务器地址
|
|
116
|
-
* @since 1.0.0
|
|
117
|
-
*/
|
|
118
|
-
getBaseURL(): string;
|
|
119
|
-
/**
|
|
120
|
-
* 设置服务器地址
|
|
121
|
-
* @param url 服务器地址
|
|
122
|
-
* @since 1.0.0
|
|
123
|
-
*/
|
|
124
|
-
setBaseURL(url: string): void;
|
|
125
|
-
/**
|
|
126
|
-
* 获取轮询和保活状态
|
|
127
|
-
* @since 1.0.0
|
|
128
|
-
* @example
|
|
129
|
-
* ```typescript
|
|
130
|
-
* const jobStatus = meeting.getJobStatus();
|
|
131
|
-
* console.log(jobStatus.polling, jobStatus.keepalive);
|
|
132
|
-
* ```
|
|
133
|
-
*/
|
|
134
|
-
getJobStatus(): Record<string, JobStatus>;
|
|
135
|
-
/**
|
|
136
|
-
* 加入会议
|
|
137
|
-
* @since 1.0.0
|
|
138
|
-
*/
|
|
139
|
-
join(params: ParamsJoin): Promise<void>;
|
|
140
|
-
/**
|
|
141
|
-
* 上报用户媒体信息,正常用于EVENT: UPDATE_USER_STATE事件触发时进行上报,当params未传时,将采用下面默认参数,有传值时,将进行覆盖
|
|
142
|
-
*
|
|
143
|
-
* |类型|deviceOn|sendOn|recvOn|
|
|
144
|
-
* |-|-|-|-|
|
|
145
|
-
* |audio|true|true|false|
|
|
146
|
-
* |video|true|true|false|
|
|
147
|
-
* |share|true|false|false|
|
|
148
|
-
* @since 1.0.0
|
|
149
|
-
*/
|
|
150
|
-
updateUserState(params?: UserState): Promise<void>;
|
|
151
|
-
/**
|
|
152
|
-
* 离开会议,params传值为空时,默认传递ResultInfo:bizCode为901359
|
|
153
|
-
* @since 1.0.0
|
|
154
|
-
*/
|
|
155
|
-
leave(params?: ResultInfo): Promise<boolean>;
|
|
156
|
-
/**
|
|
157
|
-
* 结束会议(需主持人权限)
|
|
158
|
-
* @since 1.0.0
|
|
159
|
-
*/
|
|
160
|
-
end(): Promise<boolean>;
|
|
161
|
-
}
|