@ylink-sdk/meeting 0.1.13 → 0.2.0-beta.0
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 +1915 -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 t(t,r,i,s){return new(i||(i=Promise))((function(n,o){function a(t){try{u(s.next(t))}catch(e){o(e)}}function c(t){try{u(s.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,c)}u((s=s.apply(t,r||[])).next())}))}function e(t){return{all:t=t||new Map,on:function(e,r){var i=t.get(e);i?i.push(r):t.set(e,[r])},off:function(e,r){var i=t.get(e);i&&(r?i.splice(i.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var i=t.get(e);i&&i.slice().map((function(t){t(r)})),(i=t.get("*"))&&i.slice().map((function(t){t(e,r)}))}}}var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={exports:{}};!function(t,e){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]",h="[object Promise]",f="[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]",$="[object Int16Array]",E="[object Int32Array]",_="[object Uint8Array]",O="[object Uint8ClampedArray]",T="[object Uint16Array]",S="[object Uint32Array]",w=/\w*$/,A=/^\[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[$]=U[E]=U[d]=U[l]=U[p]=U[f]=U[m]=U[g]=U[v]=U[_]=U[O]=U[T]=U[S]=!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")(),N=e&&!e.nodeType&&e,k=N&&t&&!t.nodeType&&t,R=k&&k.exports===N;function L(t,e){return t.set(e[0],e[1]),t}function H(t,e){return t.add(e),t}function M(t,e,r,i){var s=-1,n=t?t.length:0;for(i&&n&&(r=t[++s]);++s<n;)r=e(r,t[s],s,t);return r}function V(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(e){}return r}function G(t){var e=-1,r=Array(t.size);return t.forEach((function(t,i){r[++e]=[i,t]})),r}function B(t,e){return function(r){return t(e(r))}}function Y(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var W,X=Array.prototype,F=Function.prototype,J=Object.prototype,K=C["__core-js_shared__"],z=(W=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",Q=F.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+Q.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=R?C.Buffer:void 0,it=C.Symbol,st=C.Uint8Array,nt=B(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=X.splice,ut=Object.getOwnPropertySymbols,dt=rt?rt.isBuffer:void 0,lt=B(Object.keys,Object),pt=Ct(C,"DataView"),ht=Ct(C,"Map"),ft=Ct(C,"Promise"),mt=Ct(C,"Set"),gt=Ct(C,"WeakMap"),vt=Ct(Object,"create"),yt=Ht(pt),bt=Ht(ht),xt=Ht(ft),It=Ht(mt),qt=Ht(gt),Dt=it?it.prototype:void 0,$t=Dt?Dt.valueOf:void 0;function Et(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function _t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Tt(t){this.__data__=new _t(t)}function St(t,e,r){var i=t[e];Z.call(t,e)&&Mt(i,r)&&(void 0!==r||e in t)||(t[e]=r)}function wt(t,e){for(var r=t.length;r--;)if(Mt(t[r][0],e))return r;return-1}function At(t,e,r,i,s,h,y){var A;if(i&&(A=h?i(t,s,h,y):i(t)),void 0!==A)return A;if(!Wt(t))return t;var j=Vt(t);if(j){if(A=function(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&Z.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!e)return function(t,e){var r=-1,i=t.length;for(e||(e=Array(i));++r<i;)e[r]=t[r];return e}(t,A)}else{var P=kt(t),C=P==c||P==u;if(Bt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(P==p||P==n||C&&!h){if(V(t))return h?t:{};if(A=function(t){return"function"!=typeof t.constructor||Lt(t)?{}:Wt(e=nt(t))?ot(e):{};var e}(C?{}:t),!e)return function(t,e){return Ut(t,Nt(t),e)}(t,function(t,e){return t&&Ut(e,Xt(e),t)}(A,t))}else{if(!U[P])return h?t:{};A=function(t,e,r,i){var s=t.constructor;switch(e){case b:return jt(t);case o:case a:return new s(+t);case x:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,i);case I:case q:case D:case $:case E:case _:case O:case T:case S:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,i);case d:return function(t,e,r){return M(e?r(G(t),!0):G(t),L,new t.constructor)}(t,i,r);case l:case g:return new s(t);case f:return function(t){var e=new t.constructor(t.source,w.exec(t));return e.lastIndex=t.lastIndex,e}(t);case m:return function(t,e,r){return M(e?r(Y(t),!0):Y(t),H,new t.constructor)}(t,i,r);case v:return $t?Object($t.call(t)):{}}}(t,P,At,e)}}y||(y=new Tt);var N=y.get(t);if(N)return N;if(y.set(t,A),!j)var k=r?function(t){return function(t,e,r){var i=e(t);return Vt(t)?i:function(t,e){for(var r=-1,i=e.length,s=t.length;++r<i;)t[s+r]=e[r];return t}(i,r(t))}(t,Xt,Nt)}(t):Xt(t);return function(t,e){for(var r=-1,i=t?t.length:0;++r<i&&!1!==e(t[r],r););}(k||t,(function(s,n){k&&(s=t[n=s]),St(A,n,At(s,e,r,i,n,t,y))})),A}function jt(t){var e=new t.constructor(t.byteLength);return new st(e).set(new st(t)),e}function Ut(t,e,r,i){r||(r={});for(var s=-1,n=e.length;++s<n;){var o=e[s],a=i?i(r[o],t[o],o,r,t):void 0;St(r,o,void 0===a?t[o]:a)}return r}function Pt(t,e){var r,i,s=t.__data__;return("string"==(i=typeof(r=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?s["string"==typeof e?"string":"hash"]:s.map}function Ct(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Wt(t)||(e=t,z&&z in e))&&(Yt(t)||V(t)?et:A).test(Ht(t));var e}(r)?r:void 0}Et.prototype.clear=function(){this.__data__=vt?vt(null):{}},Et.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Et.prototype.get=function(t){var e=this.__data__;if(vt){var r=e[t];return r===i?void 0:r}return Z.call(e,t)?e[t]:void 0},Et.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:Z.call(e,t)},Et.prototype.set=function(t,e){return this.__data__[t]=vt&&void 0===e?i:e,this},_t.prototype.clear=function(){this.__data__=[]},_t.prototype.delete=function(t){var e=this.__data__,r=wt(e,t);return!(r<0||(r==e.length-1?e.pop():ct.call(e,r,1),0))},_t.prototype.get=function(t){var e=this.__data__,r=wt(e,t);return r<0?void 0:e[r][1]},_t.prototype.has=function(t){return wt(this.__data__,t)>-1},_t.prototype.set=function(t,e){var r=this.__data__,i=wt(r,t);return i<0?r.push([t,e]):r[i][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new Et,map:new(ht||_t),string:new Et}},Ot.prototype.delete=function(t){return Pt(this,t).delete(t)},Ot.prototype.get=function(t){return Pt(this,t).get(t)},Ot.prototype.has=function(t){return Pt(this,t).has(t)},Ot.prototype.set=function(t,e){return Pt(this,t).set(t,e),this},Tt.prototype.clear=function(){this.__data__=new _t},Tt.prototype.delete=function(t){return this.__data__.delete(t)},Tt.prototype.get=function(t){return this.__data__.get(t)},Tt.prototype.has=function(t){return this.__data__.has(t)},Tt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof _t){var i=r.__data__;if(!ht||i.length<199)return i.push([t,e]),this;r=this.__data__=new Ot(i)}return r.set(t,e),this};var Nt=ut?B(ut,Object):function(){return[]},kt=function(t){return tt.call(t)};function Rt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||j.test(t))&&t>-1&&t%1==0&&t<e}function Lt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function Ht(t){if(null!=t){try{return Q.call(t)}catch(r){}try{return t+""}catch(r){}}return""}function Mt(t,e){return t===e||t!=t&&e!=e}(pt&&kt(new pt(new ArrayBuffer(1)))!=x||ht&&kt(new ht)!=d||ft&&kt(ft.resolve())!=h||mt&&kt(new mt)!=m||gt&&kt(new gt)!=y)&&(kt=function(t){var e=tt.call(t),r=e==p?t.constructor:void 0,i=r?Ht(r):void 0;if(i)switch(i){case yt:return x;case bt:return d;case xt:return h;case It:return m;case qt:return y}return e});var Vt=Array.isArray;function Gt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}(t.length)&&!Yt(t)}var Bt=dt||function(){return!1};function Yt(t){var e=Wt(t)?tt.call(t):"";return e==c||e==u}function Wt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Xt(t){return Gt(t)?function(t,e){var r=Vt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Gt(t)}(t)&&Z.call(t,"callee")&&(!at.call(t,"callee")||tt.call(t)==n)}(t)?function(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}(t.length,String):[],i=r.length,s=!!i;for(var o in t)!e&&!Z.call(t,o)||s&&("length"==o||Rt(o,i))||r.push(o);return r}(t):function(t){if(!Lt(t))return lt(t);var e=[];for(var r in Object(t))Z.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return At(t,!0,!0)}}(i,i.exports);var s=i.exports;const n=t=>({get(e,r,i){if("__isProxy"===r)return!0;const s=Reflect.get(e,r);return Array.isArray(s)?s:"object"==typeof s&&null!==s?s.__isProxy?s:new Proxy(s,n(t)):s},set(e,r,i,n){const o=e[r];i=h(i)&&i.__isProxy?s(i):i;const a=Reflect.set(e,r,i,n);return((t,e)=>t!==e&&(t==t||e==e))(i,o)&&t.emit(`${y(r)}Change`,i),a}}),o=t=>encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]");class a{constructor(t){Object.defineProperty(this,"baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_beforeRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_errorHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.baseURL=t.baseURL,this._beforeRequest=t.beforeRequest,this._errorHandler=t.error}_request(t){const{url:e="",timeout:r=6e4}=t;let{headers:i={}}=t;return t.url=this.baseURL.replace(/\/+$/,"")+"/"+((t,e)=>{if(!e)return t;const r=[];Object.keys(e).forEach((t=>{const i=e[t];if(null==i)return;let s;Array.isArray(i)?(s=i,t+="[]"):s=[i],s.forEach((e=>{null!==e&&"object"==typeof e&&(e=JSON.stringify(e)),r.push(`${o(t)}=${o(e)}`)}))}));const i=r.join("&");if(i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t})(e.replace(/^\/+/,""),t.params),i=Object.assign(i,this._defaultHeaders),Object.keys(i).forEach((t=>{"Content-Type"!==t&&t.toUpperCase()==="Content-Type".toUpperCase()&&(i["Content-Type"]=i[t],delete i[t])})),f(t.data)&&(i&&!i["Content-Type"]&&(i["Content-Type"]="application/json;charset=utf-8"),t.data=JSON.stringify(t.data)),t.headers=i,t.timeout=r,this._beforeRequest&&this._beforeRequest(t),"undefined"!=typeof wx?d(t):u(t)}setDefaultHeader(t,e){!(t in this._defaultHeaders)||""!==e&&null!==e?this._defaultHeaders[t]=e:delete this._defaultHeaders[t]}get(t,e){return this._errorHandler?this._request(Object.assign(e||{},{url:t,method:"GET"})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(e||{},{url:t,method:"GET"}))}post(t,e,r){return this._errorHandler?this._request(Object.assign(r||{},{url:t,method:"POST",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(r||{},{url:t,method:"POST",data:e}))}}class c{constructor(t){let e;Object.defineProperty(this,"promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.promise=new Promise((t=>{e=t})),t((t=>{this.reason||(this.reason=t,e(this.reason))}))}static source(){let t;const e=new c((e=>{t=e}));return{cancel:t,token:e}}}const u=t=>new Promise(((e,r)=>{const{data:i=null,url:s,method:n="GET",headers:o,cancelToken:a,withResDate:c}=t;let u=new XMLHttpRequest;u.open(n.toUpperCase(),s,!0),u.timeout=t.timeout;const d=()=>{if(u){if(u.status>=200&&u.status<300)try{const t=JSON.parse(u.responseText);c&&(t.responseDate=new Date(u.getResponseHeader("Date")).getTime()),e(t)}catch(t){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 "+t.timeout+"ms exceeded")),u=null},"setRequestHeader"in u&&Object.keys(o).forEach((t=>{null===i&&"content-type"===t.toLowerCase()?delete o[t]:u.setRequestHeader(t,o[t])})),a&&a.promise.then((t=>{u&&(u.abort(),r(t),u=null)})),u.send(i)})),d=t=>new Promise(((e,r)=>{const{data:i=null,url:s,method:n="GET",headers:o,cancelToken:a}=t,c=wx.request({url:s,data:i,method:n.toUpperCase(),timeout:t.timeout,header:o,success(t){t.statusCode>=200&&t.statusCode<300?e(t.data):r({url:s,statusCode:t.statusCode})},fail(t){r("request:fail abort"===t.errMsg&&a&&a.reason||t)}});a&&a.promise.then((()=>{c&&c.abort()}))})),l=Array.isArray,p=t=>null==t,h=t=>"object"==typeof t&&null!==t,f=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},m=()=>{const t=[],e="0123456789abcdef";for(let r=0;r<36;r++)t[r]=e.substr(Math.floor(16*Math.random()),1);return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("").split("-").join("")},g=(t,e)=>t?(Object.entries(t).forEach((t=>{const[r,i]=[t[0],t[1]];if(null!==i)return h(i)&&!l(i)?(e[r]||(e[r]={}),void(e[r]=g(i,e[r]))):void(e[r]=i)})),e):e,v=/-(\w)/g,y=t=>t.replace(v,((t,e)=>e?e.toUpperCase():""));var b,x,I,q,D,$;!function(t){t.REQUEST_ERROR="requestError",t.STATE="state"}(b||(b={})),function(t){t[t.CLOSE=0]="CLOSE",t[t.JOINED=1]="JOINED",t[t.READY=2]="READY"}(x||(x={})),function(t){t.WEBAPP="webApp",t.WEBCTRL="webCtrl",t.WECHATMP="weChatMP",t.SUPERVISION="supervision",t.BIGSCREEN="bigScreen",t.DESKTOP="desktop",t.MOBILE="mobile",t.VCS="vcs",t.SIP="sip",t.H323="h323",t.PSTN="pstn"}(I||(I={})),function(t){t.HOST="host",t.COHOST="coHost",t.ATTENDEE="attendee",t.AUDIENCE="audience"}(q||(q={})),function(t){t.STARTED="started",t.PAUSED="paused",t.STARTING="starting",t.STOPPED="stopped"}(D||(D={}));class E{constructor(t,r){Object.defineProperty(this,"moduleName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"emitter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.moduleName=r,this.ctx=t,this.emitter=e(),this.data=new Proxy({},n(this.emitter)),this._bindOn()}reactive(t){if(h(t)){const e=new Map,r=(t,i)=>{Object.keys(t).forEach((s=>{!1===i&&s in this.data&&(t[s]=this.data[s]);const n=e=>t[s]=e,o=`${y(s)}Change`;this.emitter.on(o,n),e.set(o,n),h(t[s])&&!l(t[s])&&r(t[s],!0)}))};r(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))}}else console.warn("Parameter is not an object!");return t}on(t,e){return this.emitter.on(t,e)}off(t,e){return this.emitter.off(t,e)}}class _ extends E{constructor(t){super(t,"info")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingInfo",(t=>{const{state:e,body:r}=t;("full"===e||"update"===e)&&g(r,this.data)})),this.ctx.emitter.on("participantCount",(t=>{const{body:e}=t;g({participantCount:e},this.data)}))}subject(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}/meetings/${r}/info/subject`,e)}))}practiceSession(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}/meetings/${e}/info/practiceSession`)}))}}function O(e){return t(this,void 0,void 0,(function*(){const r=T(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((t=>{o.push({name:t,seqId:n.data[t].maxSeqId,limit:200})})),o}))}(e.request,{topics:r,sessionID:i,meetingID:s});yield w(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 T(t){const e=[],{isInLobby:r}=t.modules.me.data;return r?(e.push("lobbyMember"),e):(Object.keys(t.modules).forEach((r=>{const i=t.modules[r]._topic();i&&(Array.isArray(i)?i.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(i)||e.push(i))})),e)}function S(t){t.status.polling.running=!1,t.status.keepalive.running=!1,t.status.polling.timer&&(clearTimeout(t.status.polling.timer),t.status.polling.timer=null),t.status.keepalive.timer&&(clearTimeout(t.status.keepalive.timer),t.status.keepalive.timer=null),t.config.request.cancelToken.cancel(),t.config.request.cancelToken=c.source()}function w(e,r){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:i}=r.config.request,s=yield r.request.post(`${t}/meetings/${i}/subscribe`,{topics:e}),n=s&&s.data&&s.data.eventMsgs;n&&n.forEach((t=>{console.log("[subscribe]",t),r.emitter.emit(t.event,t)})),r.state=x.READY,r.emitter.emit(b.STATE,{state:r.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((t=>{const e=s.find((e=>e.name===t));if(e){if(e.seqId=r[t].maxSeqId,!r[t].items)return;r[t].items.forEach((t=>{const e=JSON.parse(t.content);["liveStream","recording"].includes(e.event)&&(e.stime=t.stime),i(e)}))}}))})))(),c.running&&(c.timer=setTimeout((()=>{c.running&&A(e,r,i)}),200))}))}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))}))}!function(t){t.INIT="meInit",t.UPDATE="meUpdate",t.UPDATE_USER_STATE="updateUserState",t.ROLECHANGE="meRoleChange",t.AUDIOCHANGE="meAudioChange",t.HANDUPCHANGE="meHandupChange",t.SETAUDIO="setAudio",t.VIDEOCHANGE="meVideoChange",t.SETVIDEO="setVideo",t.SHARECHANGE="meShareChange",t.DISPLAYNAMECHANGE="meDisplayNameChange",t.SPOTLIGHTVIDEOCHANGE="meSpotlightVideoChange",t.LOBBYCHANGE="meLobbyChange",t.BARRAGECHANGE="meBarrageChange",t.LEAVE="leave"}($||($={}));class U extends E{constructor(t){super(t,"me")}_topic(){return""}_bindOn(){const e=e=>t(this,void 0,void 0,(function*(){"role"in e&&e.role!==this.data.role&&(e.role!==q.AUDIENCE&&this.data.role!==q.AUDIENCE||(yield P(this.ctx),this.data.isUpdatedUserState=!1,this.emitter.emit($.UPDATE_USER_STATE,this.data)),g({role:e.role},this.data),this.emitter.emit($.ROLECHANGE,e.role),this.ctx.emitter.emit($.ROLECHANGE,e.role))})),r=t=>{var e,r,i,s;if("audio"in t){const{deviceOn:n,sendOn:o,opBy:a}=t.audio;(!p(n)&&n!==(null===(e=this.data.audio)||void 0===e?void 0:e.deviceOn)||!p(o)&&o!==(null===(r=this.data.audio)||void 0===r?void 0:r.sendOn))&&(g({audio:t.audio},this.data),this.emitter.emit($.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=t=>{var e,r,i,s;if("video"in t){const{deviceOn:n,sendOn:o,opBy:a}=t.video;(!p(n)&&n!==(null===(e=this.data.video)||void 0===e?void 0:e.deviceOn)||!p(o)&&o!==(null===(r=this.data.video)||void 0===r?void 0:r.sendOn))&&(g({video:t.video},this.data),this.emitter.emit($.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=t=>{var e,r,i,s;if("share"in t){const{deviceOn:n,sendOn:o,opBy:a}=t.share;(!p(n)&&n!==(null===(e=this.data.share)||void 0===e?void 0:e.deviceOn)||!p(o)&&o!==(null===(r=this.data.share)||void 0===r?void 0:r.sendOn))&&(g({share:t.share},this.data),this.emitter.emit($.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=t=>{t.displayName&&t.displayName!==this.data.displayName&&(g({displayName:t.displayName},this.data),this.emitter.emit($.DISPLAYNAMECHANGE,t.displayName))},o=t=>{"isHandUp"in t&&t.isHandUp!==this.data.isHandUp&&(g({isHandUp:t.isHandUp},this.data),this.emitter.emit($.HANDUPCHANGE,t.isHandUp))},a=t=>{"isSpotlightVideo"in t&&(g({isSpotlightVideo:t.isSpotlightVideo},this.data),this.emitter.emit($.SPOTLIGHTVIDEOCHANGE,t.isSpotlightVideo))},c=e=>t(this,void 0,void 0,(function*(){"isInLobby"in e&&e.isInLobby!==this.data.isInLobby&&(g({isInLobby:e.isInLobby},this.data),yield P(this.ctx),!1===e.isInLobby&&(this.data.isUpdatedUserState=!1,this.emitter.emit($.UPDATE_USER_STATE,this.data)),this.emitter.emit($.LOBBYCHANGE,e.isInLobby))})),u=t=>{if(!t.barrage)return;let e=null;if(!t.barrage.wordsDisplayStatus)return e=null,delete t.barrage,this.data.barrage=e||void 0,void this.emitter.emit($.BARRAGECHANGE,e);e={content:t.barrage.content,contentType:t.barrage.contentType,type:t.barrage.type,duration:t.barrage.duration,position:t.barrage.position};const{role:r}=this.data;t.barrage.receiver&&(r===q.HOST||r===q.COHOST?e=t.barrage.receiver.host?e:null:r===q.ATTENDEE?e=t.barrage.receiver.attendee?e:null:r===q.AUDIENCE&&(e=t.barrage.receiver.audience?e:null),delete t.barrage,this.data.barrage=e||void 0,this.emitter.emit($.BARRAGECHANGE,e))},d=t=>{"leave"in t&&!0===t.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),console.warn("handleLeave"),S(this.ctx),Q(this.ctx),this.emitter.emit($.LEAVE,t.resultInfo),this.ctx.state=x.CLOSE,this.ctx.emitter.emit(b.STATE,{state:this.ctx.state,reason:t.resultInfo}))},l=t=>{e(t),r(t),i(t),s(t),n(t),o(t),c(t),a(t),u(t),d(t)};this.ctx.emitter.on($.INIT,(t=>{g(t,this.data),this.data.isUpdatedUserState=!1,this.emitter.emit($.UPDATE_USER_STATE,this.data)})),this.ctx.emitter.on($.UPDATE,(t=>{l(t),g(t,this.data)})),this.ctx.emitter.on("me",(e=>t(this,void 0,void 0,(function*(){const{state:t,body:r={users:[]}}=e;if("delete"===t){const t=r.users[0];t.leave=!0,d(t)}else{const t=r.users.find((t=>t.userID===this.data.userID));t&&(l(t),g(t,this.data))}})))),this.ctx.emitter.on("setUserVideo",(t=>{this.emitter.emit($.SETVIDEO,t.body)})),this.ctx.emitter.on("setUserAudio",(t=>{this.emitter.emit($.SETAUDIO,t.body)})),this.ctx.emitter.on("meetingState",(t=>{const{body:e={}}=t;if("ended"===e.state){d({leave:!0,resultInfo:e.resultInfo})}}))}updateUserState(t,e=!1){if(!e){const{role:e,initialMediaState:r}=this.data;t.audio.sendOn=t.audio.sendOn&&r.audio.sendOn,t.video.sendOn=t.video.sendOn&&r.video.sendOn,e===q.AUDIENCE&&(t.audio.sendOn=!1,t.video.sendOn=!1)}const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,g(t,this.data),this.ctx.request.post(`${r}/meetings/${i}/updateUserState`,t)}}function P(e){return t(this,void 0,void 0,(function*(){const t=T(e),{meetingID:r,sessionID:i}=e.config.request;"undefined"!=typeof Worker&&e.worker?e.worker.postMessage({topics:t,meetingID:r,sessionID:i,rePolling:!0}):(S(e),yield O(e))}))}class C extends E{constructor(t){super(t,"chat")}_topic(){return"chat"}_bindOn(){this.ctx.emitter.on("chatMsg",(t=>{const{body:e}=t;this.emitter.emit("chatMsg",e)}))}msg(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}/meetings/${r}/chat/msg`,e)}))}historyMsg(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${t}/meetings/${r}/chat/historyMsg`,e)}))}}class N extends E{constructor(t){super(t,"invite")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("callRecord",(t=>{const{body:e,state:r}=t;if(e&&e.users){if("full"===r)return this.data.callRecordUsers=e.users.map((t=>(t.displayNamePinyin=N.setDisplayNamePinyinProp?N.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t))),void this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers);e.users.forEach((t=>{const e=this.data.callRecordUsers.findIndex((e=>t.inviteTransID===e.inviteTransID));"update"===r&&-1!==e?g(t,this.data.callRecordUsers[e]):"update"===r&&-1===e&&(t.displayNamePinyin=N.setDisplayNamePinyinProp?N.setDisplayNamePinyinProp(t.displayName||""):t.displayName,this.data.callRecordUsers.push(t))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}invite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}/meetings/${r}/invite`,t)}}class k extends E{constructor(t){super(t,"liveStream")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStream",(t=>{var e;const{state:r,body:i,stime:s}=t;if(i){if(s&&(this.data.jetlag=s),"full"===r){const{liveStreams:t=[]}=i;if(!t.length)return;this.data.status=[],this.data.liveStreams=t.map((t=>(t.requesting="starting"===t.status,this.data.status.push({platform:t.platform||"",status:(t.requesting?"stopped":t.status)||""}),t)));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===(e=i.liveStreams)||void 0===e||e.forEach((t=>{this.data.resultInfo=t.resultInfo||{};let e=this.data.liveStreams.findIndex((e=>e.platform===t.platform));-1===e?(t.requesting="starting"===t.status,this.data.liveStreams.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreams[e]),t),this.data.liveStreams.splice(e,1,t)),e=this.data.status.findIndex((e=>e.platform===t.platform)),-1===e?this.data.status.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||""}):this.data.status.splice(e,1,{platform:this.data.status[e].platform||"",status:t.requesting?this.data.status[e].status||"stopped":t.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)}))}}class R extends E{constructor(t){super(t,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(t=>{const{state:e,body:r,stime:i}=t;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(e)?(r.recordUsers&&(this.data.recording.recordUsers=r.recordUsers),this.data):void 0}))}history(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/recording/history`)}))}status(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/recording/status`,e)}))}layout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/recording/status`,e)}))}designatedUsers(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/recording/designatedUsers`,e)}))}participantAdd(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/recording/participant/add`,e)}))}participantDelete(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/recording/participant/delete`,e)}))}getTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getTemplates`,{params:e})}))}getByIds(e){return t(this,void 0,void 0,(function*(){const{prefix:{user:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/subject/getByIds`,e)}))}recordLayout(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${r}/recording/layout`,e)}))}}class L extends E{constructor(t){super(t,"setting")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingSetting",(t=>{const{state:e,body:r}=t;["full","update"].includes(e)&&g(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:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}/meetings/${e}/muteAll`)}))}unmuteAll(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}/meetings/${e}/unmuteAll`)}))}}class H extends E{constructor(t){super(t,"spotlightVideo")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("spotlightVideo",(t=>{const{body:e}=t;if(!e||!e.userIDs)return;this.data.userIDs=e.userIDs;e.userIDs.findIndex((t=>t===this.ctx.modules.me.data.userID))>-1?this.ctx.emitter.emit($.UPDATE,{isSpotlightVideo:!0}):this.ctx.modules.me.data.isSpotlightVideo&&this.ctx.emitter.emit($.UPDATE,{isSpotlightVideo:!1})}))}spotlight(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}/meetings/${r}/view/spotlight`,t)}}class M extends E{constructor(t){super(t,"users")}_topic(){const{role:t,endpointType:e}=this.ctx.modules.me.data;return e===I.SUPERVISION?["interactive","broadcast"]:t===q.AUDIENCE?"interactive":["interactive","broadcast","lobby"]}_bindOn(){const t=(t,e)=>{if(t.userID===this.ctx.modules.me.data.userID){const r={};"delete"===e&&(r.leave=!0),this.ctx.emitter.emit($.UPDATE,Object.assign(Object.assign({},t),r))}},e=({updateUsers:e,state:r,sourceKey:i})=>{if("full"===r)return this.data[i]=e.map((e=>(e.displayNamePinyin=M.setDisplayNamePinyinProp?M.setDisplayNamePinyinProp(e.displayName):e.displayName,t(e,r),e))),this.emitter.emit(`${i}Change`,this.data[i]),this.emitter.emit(`${i}FullUpdate`,this.data[i]),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]),g(e,this.data[i][o]),this.emitter.emit(`${i}Update`,{user:s[i][o]})):"update"===r&&-1===o&&(e.displayNamePinyin=M.setDisplayNamePinyinProp?M.setDisplayNamePinyinProp(e.displayName):e.displayName,s[i].push(e),this.emitter.emit(`${i}Add`,{user:e,resultInfo:e.resultInfo}));t(e,r)})),this.emitter.emit(`${i}Change`,this.data[i]),this.data[i]};this.ctx.emitter.on("interactiveUsers",(t=>{const{state:r,body:i}=t;e({updateUsers:i.users,state:r,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(t=>{const{state:r,body:i}=t;e({updateUsers:i.users,state:r,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(t=>{const{state:r,body:i}=t;e({updateUsers:i.users,state:r,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(t=>{const{state:r,body:i}=t;e({updateUsers:i.users,state:r,sourceKey:"advCtrlUsers"})}))}updateUserProps(t,e){t.displayName&&t.displayName!==e.displayName&&(t.displayNamePinyin=M.setDisplayNamePinyinProp?M.setDisplayNamePinyinProp(t.displayName):t.displayName)}setAudio(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/audio`,e)}setVideo(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/video`,e)}setShare(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/share`,e)}setWhiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/whiteboard`,e)}handUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/handUp`,e)}setRole(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/role`,e)}rename(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/displayName`,e)}remove(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}/meetings/${r}/users/${t}/remove`)}replyHandUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/replyHandUp`,e)}fecc(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/fecc`,e)}lobbyState(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/lobbyState`,e)}allowLocalRecord(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/allowLocalRecord`,e)}whiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/whiteboard`,e)}callStats(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${e}/meetings/${r}/users/${t}/callStats`)}replyAllHandUp(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}/meetings/${e}/replyAllHandUp`)}admitAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}/meetings/${e}/lobby/admitAll`)}refuseAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}/meetings/${e}/lobby/refuseAll`)}}class V extends E{constructor(t){super(t,"view")}_topic(){return["hostAttendee","audience","advCtrl"]}_bindOn(){["hostLayout","attendeeLayout","audienceLayout","meetingView","personalView"].forEach((t=>{this.ctx.emitter.on(t,(e=>{"personalView"!==t?this.updateLayout(e,t):this.updatePersonalLayouts(e)}))}))}updateLayout(t,e){const{event:r,body:i}=t;i&&("meetingView"===r?Object.keys(i).forEach((t=>{this.data[t]=i[t]})):this.data[e]=i)}updatePersonalLayouts(t){const{state:e,body:r}=t;"full"!==e&&void 0!==this.data.personalLayouts||(this.data.personalLayouts={}),r.personalLayouts.forEach((t=>{const{subscriber:r={userID:-1}}=t,i=r.userID||r.subjectID||-1;"full"===e||"update"===e||t.templateStatus?this.data.personalLayouts[i]=t: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:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/view/virtualClass/close`)}))}getVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/layout/template/info`,{params:e})}))}addVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/layout/template/add`,e)}))}editVirtualClassTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/layout/template/edit`,e)}))}getTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getTemplates`,{params:e})}))}editTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/edit`,e)}))}addTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/add`,e)}))}deleteTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/delete`,e)}))}getDefaultTemplates(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.get(`${t}personal/vmr/layout/template/getDefaultTemplates`,{params:e})}))}changeDefaultTemplate(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/layout/template/changeDefaultTemplate`,e)}))}perspectiveBind(e){return t(this,void 0,void 0,(function*(){const{prefix:{conference:t}}=this.ctx.config.request;return yield this.ctx.request.post(`${t}personal/vmr/perspective/bind`,e)}))}}class G extends E{constructor(t){super(t,"vote")}_topic(){return"vote"}_bindOn(){this.ctx.emitter.on("vote",(t=>{const{body:e}=t,{voteID:r}=e;void 0===this.data.vote&&(this.data.vote={}),this.data.vote[r]=e,this.emitter.emit("voteChange",this.data.vote)}))}getVotes(t){const{prefix:{vote:e},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}/meetings/${r}/votes`,{params:t})}getVote(t){const{prefix:{vote:e},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}/meetings/${r}/vote`,{params:t})}getMeVote(t){const{prefix:{vote:e},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}/meetings/${r}/vote/me`,{params:t})}voteStatus(t,e){const{prefix:{vote:r},meetingID:i,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.post(`${r}/meetings/${i}/vote/status?tk=${t.tk}&voteID=${t.voteID}`,e)}voteSubmit(t,e){const{prefix:{vote:r},meetingID:i,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.post(`${r}/meetings/${i}/vote/submit?tk=${t.tk}&voteID=${t.voteID}`,e)}voteAdd(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}/personal/vote/add`,t)}voteEdit(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}/personal/vote/edit`,t)}voteDelete(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}/personal/vote/delete`,t)}}class B extends E{constructor(t){super(t,"words")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingBarrage",(t=>{this.data.timer&&clearTimeout(this.data.timer);const{state:e,body:r}=t;if(!r)return this.data.wordsDisplayStatus=!1,void this.ctx.emitter.emit($.UPDATE,{barrage:this.data});"full"===e&&(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($.UPDATE,{barrage:this.data})}),1e3*r.duration)),g(r,this.data),this.emitter.emit("barrageRecordChange",this.data.barrageRecord),this.ctx.emitter.emit($.UPDATE,{barrage:this.data}))})),this.ctx.emitter.on($.ROLECHANGE,(()=>this.ctx.emitter.emit($.UPDATE,{barrage:this.data})))}barrage(e){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:r}=this.ctx.config.request;return yield this.ctx.request.post(`${t}/meetings/${r}/barrage`,e)}))}deleteBarrage(){return t(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}/meetings/${e}/deleteBarrage`)}))}}class Y{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=F(t)}static getInstance(t){return this.instance?this.instance:this.instance=new Y(t)}}Object.defineProperty(Y,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null});const W=t=>{t.state!==x.CLOSE&&(t.state=x.CLOSE,t.emitter.emit(b.STATE,{state:t.state}))};function X(t){return t.singleton?Y.getInstance(t).meeting:F(t)}function F(t){const{baseURL:r,modules:i,worker:s,singleton:n}=t;i.findIndex((t=>t===U))<0&&i.push(U),i.findIndex((t=>t===_))<0&&i.push(_);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:0,voteTk:""}},worker:s,emitter:e(),request:new a({baseURL:r,beforeRequest:t=>{t.headers["X-Y-Request-Id"]=m()},error:t=>{o.emitter.emit(b.REQUEST_ERROR,t)}}),modules:{},state:x.CLOSE,status:{polling:{running:!1,timer:null},keepalive:{running:!1,timer:null,interval:20}}};return o.worker&&("undefined"!=typeof Worker?o.worker.postMessage({baseURL:r}):console.error("The current environment does not support worker")),function(t,e){if(!l(t))return void console.error("The modules parameter requires an array type");t.forEach((t=>{const r=new t(e);e.modules[r.moduleName]=r}))}(i,o),Object.assign({config:o.config,request:o.request,get state(){return o.state},on:o.emitter.on,off:o.emitter.off,join:J(o),leave:K(o),end:z(o)},o.modules)}function J(e){return function(r){var i;return t(this,void 0,void 0,(function*(){const t=`${null===(i=r.endpointType)||void 0===i?void 0:i.toLocaleUpperCase()}${m()}_${((t=new Date,e)=>{const r={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(const i in r)new RegExp("("+i+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?r[i]:("00"+r[i]).substr((""+r[i]).length)));return e})(new Date,"MMddHHmmss")}_${r.meetingNum}`;e.request.setDefaultHeader("X-Y-Session-Id",t);const{prefix:s}=e.config.request,n=yield e.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":t}}),{credential:o="",location:a=""}=n&&n.data||{};if(!o)return n;e.config.request.location=a,delete r.pwd,delete r.url;const c=yield e.request.post(`${s.ctrl}/join?meetingNum=${r.meetingNum}&credential=${o}`,r,{headers:{"X-Y-Endpoint-Type":r.endpointType,"X-Y-Endpoint-Id":t}});if(c&&c.data&&c.ret>-1){const{meetingID:r="",ctrlID:i="",user:s={},mediaContent:o={},initialMediaState:u={},tk:d=""}=c.data;if(e.config.request.sessionID=t,e.config.request.meetingID=r,e.config.request.ctrlID=i,e.config.request.userID=s.userID,e.config.request.voteTk=d,e.request.setDefaultHeader("X-Y-Location",a),e.request.setDefaultHeader("X-Y-Ctrl-Id",i),e.emitter.emit($.INIT,Object.assign(Object.assign({},s),{mediaContent:o,initialMediaState:u})),e.state=x.JOINED,e.emitter.emit(b.STATE,{state:e.state}),"undefined"!=typeof Worker&&e.worker){const i=T(e);yield w(i,e),e.status.keepalive.running=!0,j(e),e.worker.postMessage({topics:i,meetingID:r,sessionID:t,status:!0}),e.worker.onmessage=t=>{console.log("[Polling]",t.data),e.emitter.emit(t.data.event,t.data)}}else yield O(e);c.data=Object.assign(Object.assign({},c.data),n.data)}return c}))}}function K(e){return function(r){return t(this,void 0,void 0,(function*(){r||(r={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}),S(e),Q(e),W(e),s}))}}function z(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}),S(e),Q(e),W(e),i}))}}function Q(t){if(t.config.singleton){const{baseURL:e,modules:r,singleton:i}=t.config,s={baseURL:e,modules:r,worker:t.worker,singleton:i},n=Y.getInstance(s);n&&(n.meeting=F(s))}}export{C as Chat,I as ENDPOINT_TYPE,b as EVENT,_ as Info,N as Invite,k as LiveStream,U as Me,$ 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,X as createMeeting,Q as reset};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var YlinkSDKMeeting=function(t){"use strict";function e(t,e,i,s){return new(i||(i=Promise))((function(n,o){function a(t){try{u(s.next(t))}catch(r){o(r)}}function c(t){try{u(s.throw(t))}catch(r){o(r)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,c)}u((s=s.apply(t,e||[])).next())}))}function r(t){return{all:t=t||new Map,on:function(e,r){var i=t.get(e);i?i.push(r):t.set(e,[r])},off:function(e,r){var i=t.get(e);i&&(r?i.splice(i.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var i=t.get(e);i&&i.slice().map((function(t){t(r)})),(i=t.get("*"))&&i.slice().map((function(t){t(e,r)}))}}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={exports:{}};!function(t,e){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\]$/,j=/^(?:0|[1-9]\d*)$/,P={};P[n]=P["[object Array]"]=P[b]=P[x]=P[o]=P[a]=P[E]=P[I]=P[D]=P[q]=P[O]=P[d]=P[l]=P[p]=P[f]=P[m]=P[g]=P[v]=P[T]=P[_]=P[$]=P[S]=!0,P["[object Error]"]=P[c]=P[y]=!1;var U="object"==typeof self&&self&&self.Object===Object&&self,N="object"==typeof i&&i&&i.Object===Object&&i||U||Function("return this")(),R=e&&!e.nodeType&&e,C=R&&t&&!t.nodeType&&t,k=C&&C.exports===R;function L(t,e){return t.set(e[0],e[1]),t}function M(t,e){return t.add(e),t}function H(t,e,r,i){var s=-1,n=t?t.length:0;for(i&&n&&(r=t[++s]);++s<n;)r=e(r,t[s],s,t);return r}function V(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(e){}return r}function G(t){var e=-1,r=Array(t.size);return t.forEach((function(t,i){r[++e]=[i,t]})),r}function B(t,e){return function(r){return t(e(r))}}function Y(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var W,X=Array.prototype,F=Function.prototype,J=Object.prototype,K=N["__core-js_shared__"],z=(W=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",Q=F.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+Q.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=k?N.Buffer:void 0,it=N.Symbol,st=N.Uint8Array,nt=B(Object.getPrototypeOf,Object),ot=Object.create,at=J.propertyIsEnumerable,ct=X.splice,ut=Object.getOwnPropertySymbols,dt=rt?rt.isBuffer:void 0,lt=B(Object.keys,Object),pt=Nt(N,"DataView"),ht=Nt(N,"Map"),ft=Nt(N,"Promise"),mt=Nt(N,"Set"),gt=Nt(N,"WeakMap"),vt=Nt(Object,"create"),yt=Mt(pt),bt=Mt(ht),xt=Mt(ft),Et=Mt(mt),It=Mt(gt),Dt=it?it.prototype:void 0,qt=Dt?Dt.valueOf:void 0;function Ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function Tt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function _t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var i=t[e];this.set(i[0],i[1])}}function $t(t){this.__data__=new Tt(t)}function St(t,e,r){var i=t[e];Z.call(t,e)&&Ht(i,r)&&(void 0!==r||e in t)||(t[e]=r)}function At(t,e){for(var r=t.length;r--;)if(Ht(t[r][0],e))return r;return-1}function wt(t,e,r,i,s,h,y){var w;if(i&&(w=h?i(t,s,h,y):i(t)),void 0!==w)return w;if(!Wt(t))return t;var j=Vt(t);if(j){if(w=function(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&Z.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!e)return function(t,e){var r=-1,i=t.length;for(e||(e=Array(i));++r<i;)e[r]=t[r];return e}(t,w)}else{var U=Ct(t),N=U==c||U==u;if(Bt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(U==p||U==n||N&&!h){if(V(t))return h?t:{};if(w=function(t){return"function"!=typeof t.constructor||Lt(t)?{}:Wt(e=nt(t))?ot(e):{};var e}(N?{}:t),!e)return function(t,e){return Pt(t,Rt(t),e)}(t,function(t,e){return t&&Pt(e,Xt(e),t)}(w,t))}else{if(!P[U])return h?t:{};w=function(t,e,r,i){var s=t.constructor;switch(e){case b:return jt(t);case o:case a:return new s(+t);case x:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,i);case E:case I:case D:case q:case O:case T:case _:case $:case S:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,i);case d:return function(t,e,r){return H(e?r(G(t),!0):G(t),L,new t.constructor)}(t,i,r);case l:case g:return new s(t);case f:return function(t){var e=new t.constructor(t.source,A.exec(t));return e.lastIndex=t.lastIndex,e}(t);case m:return function(t,e,r){return H(e?r(Y(t),!0):Y(t),M,new t.constructor)}(t,i,r);case v:return qt?Object(qt.call(t)):{}}}(t,U,wt,e)}}y||(y=new $t);var R=y.get(t);if(R)return R;if(y.set(t,w),!j)var C=r?function(t){return function(t,e,r){var i=e(t);return Vt(t)?i:function(t,e){for(var r=-1,i=e.length,s=t.length;++r<i;)t[s+r]=e[r];return t}(i,r(t))}(t,Xt,Rt)}(t):Xt(t);return function(t,e){for(var r=-1,i=t?t.length:0;++r<i&&!1!==e(t[r],r););}(C||t,(function(s,n){C&&(s=t[n=s]),St(w,n,wt(s,e,r,i,n,t,y))})),w}function jt(t){var e=new t.constructor(t.byteLength);return new st(e).set(new st(t)),e}function Pt(t,e,r,i){r||(r={});for(var s=-1,n=e.length;++s<n;){var o=e[s],a=i?i(r[o],t[o],o,r,t):void 0;St(r,o,void 0===a?t[o]:a)}return r}function Ut(t,e){var r,i,s=t.__data__;return("string"==(i=typeof(r=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?s["string"==typeof e?"string":"hash"]:s.map}function Nt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Wt(t)||(e=t,z&&z in e))&&(Yt(t)||V(t)?et:w).test(Mt(t));var e}(r)?r:void 0}Ot.prototype.clear=function(){this.__data__=vt?vt(null):{}},Ot.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Ot.prototype.get=function(t){var e=this.__data__;if(vt){var i=e[t];return i===r?void 0:i}return Z.call(e,t)?e[t]:void 0},Ot.prototype.has=function(t){var e=this.__data__;return vt?void 0!==e[t]:Z.call(e,t)},Ot.prototype.set=function(t,e){return this.__data__[t]=vt&&void 0===e?r:e,this},Tt.prototype.clear=function(){this.__data__=[]},Tt.prototype.delete=function(t){var e=this.__data__,r=At(e,t);return!(r<0||(r==e.length-1?e.pop():ct.call(e,r,1),0))},Tt.prototype.get=function(t){var e=this.__data__,r=At(e,t);return r<0?void 0:e[r][1]},Tt.prototype.has=function(t){return At(this.__data__,t)>-1},Tt.prototype.set=function(t,e){var r=this.__data__,i=At(r,t);return i<0?r.push([t,e]):r[i][1]=e,this},_t.prototype.clear=function(){this.__data__={hash:new Ot,map:new(ht||Tt),string:new Ot}},_t.prototype.delete=function(t){return Ut(this,t).delete(t)},_t.prototype.get=function(t){return Ut(this,t).get(t)},_t.prototype.has=function(t){return Ut(this,t).has(t)},_t.prototype.set=function(t,e){return Ut(this,t).set(t,e),this},$t.prototype.clear=function(){this.__data__=new Tt},$t.prototype.delete=function(t){return this.__data__.delete(t)},$t.prototype.get=function(t){return this.__data__.get(t)},$t.prototype.has=function(t){return this.__data__.has(t)},$t.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Tt){var i=r.__data__;if(!ht||i.length<199)return i.push([t,e]),this;r=this.__data__=new _t(i)}return r.set(t,e),this};var Rt=ut?B(ut,Object):function(){return[]},Ct=function(t){return tt.call(t)};function kt(t,e){return!!(e=null==e?s:e)&&("number"==typeof t||j.test(t))&&t>-1&&t%1==0&&t<e}function Lt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||J)}function Mt(t){if(null!=t){try{return Q.call(t)}catch(i){}try{return t+""}catch(i){}}return""}function Ht(t,e){return t===e||t!=t&&e!=e}(pt&&Ct(new pt(new ArrayBuffer(1)))!=x||ht&&Ct(new ht)!=d||ft&&Ct(ft.resolve())!=h||mt&&Ct(new mt)!=m||gt&&Ct(new gt)!=y)&&(Ct=function(t){var e=tt.call(t),r=e==p?t.constructor:void 0,i=r?Mt(r):void 0;if(i)switch(i){case yt:return x;case bt:return d;case xt:return h;case Et:return m;case It:return y}return e});var Vt=Array.isArray;function Gt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=s}(t.length)&&!Yt(t)}var Bt=dt||function(){return!1};function Yt(t){var e=Wt(t)?tt.call(t):"";return e==c||e==u}function Wt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Xt(t){return Gt(t)?function(t,e){var r=Vt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Gt(t)}(t)&&Z.call(t,"callee")&&(!at.call(t,"callee")||tt.call(t)==n)}(t)?function(t,e){for(var r=-1,i=Array(t);++r<t;)i[r]=e(r);return i}(t.length,String):[],i=r.length,s=!!i;for(var o in t)!e&&!Z.call(t,o)||s&&("length"==o||kt(o,i))||r.push(o);return r}(t):function(t){if(!Lt(t))return lt(t);var e=[];for(var r in Object(t))Z.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return wt(t,!0,!0)}}(s,s.exports);var n=s.exports;const o=t=>({get(e,r,i){if("__isProxy"===r)return!0;const s=Reflect.get(e,r);return Array.isArray(s)?s:"object"==typeof s&&null!==s?s.__isProxy?s:new Proxy(s,o(t)):s},set(e,r,i,s){const o=e[r];i=f(i)&&i.__isProxy?n(i):i;const a=Reflect.set(e,r,i,s);return((t,e)=>t!==e&&(t==t||e==e))(i,o)&&t.emit(`${b(r)}Change`,i),a}}),a=t=>encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]");class c{constructor(t){Object.defineProperty(this,"baseURL",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultHeaders",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_beforeRequest",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_errorHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.baseURL=t.baseURL,this._beforeRequest=t.beforeRequest,this._errorHandler=t.error}_request(t){const{url:e="",timeout:r=6e4}=t;let{headers:i={}}=t;return t.url=this.baseURL.replace(/\/+$/,"")+"/"+((t,e)=>{if(!e)return t;const r=[];Object.keys(e).forEach((t=>{const i=e[t];if(null==i)return;let s;Array.isArray(i)?(s=i,t+="[]"):s=[i],s.forEach((e=>{null!==e&&"object"==typeof e&&(e=JSON.stringify(e)),r.push(`${a(t)}=${a(e)}`)}))}));const i=r.join("&");if(i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t})(e.replace(/^\/+/,""),t.params),i=Object.assign(i,this._defaultHeaders),Object.keys(i).forEach((t=>{"Content-Type"!==t&&t.toUpperCase()==="Content-Type".toUpperCase()&&(i["Content-Type"]=i[t],delete i[t])})),m(t.data)&&(i&&!i["Content-Type"]&&(i["Content-Type"]="application/json;charset=utf-8"),t.data=JSON.stringify(t.data)),t.headers=i,t.timeout=r,this._beforeRequest&&this._beforeRequest(t),"undefined"!=typeof wx?l(t):d(t)}setDefaultHeader(t,e){!(t in this._defaultHeaders)||""!==e&&null!==e?this._defaultHeaders[t]=e:delete this._defaultHeaders[t]}get(t,e){return this._errorHandler?this._request(Object.assign(e||{},{url:t,method:"GET"})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(e||{},{url:t,method:"GET"}))}post(t,e,r){return this._errorHandler?this._request(Object.assign(r||{},{url:t,method:"POST",data:e})).catch((t=>{throw this._errorHandler&&this._errorHandler(t),t})):this._request(Object.assign(r||{},{url:t,method:"POST",data:e}))}}class u{constructor(t){let e;Object.defineProperty(this,"promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.promise=new Promise((t=>{e=t})),t((t=>{this.reason||(this.reason=t,e(this.reason))}))}static source(){let t;const e=new u((e=>{t=e}));return{cancel:t,token:e}}}const d=t=>new Promise(((e,r)=>{const{data:i=null,url:s,method:n="GET",headers:o,cancelToken:a,withResDate:c}=t;let u=new XMLHttpRequest;u.open(n.toUpperCase(),s,!0),u.timeout=t.timeout;const d=()=>{if(u){if(u.status>=200&&u.status<300)try{const t=JSON.parse(u.responseText);c&&(t.responseDate=new Date(u.getResponseHeader("Date")).getTime()),e(t)}catch(t){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 "+t.timeout+"ms exceeded")),u=null},"setRequestHeader"in u&&Object.keys(o).forEach((t=>{null===i&&"content-type"===t.toLowerCase()?delete o[t]:u.setRequestHeader(t,o[t])})),a&&a.promise.then((t=>{u&&(u.abort(),r(t),u=null)})),u.send(i)})),l=t=>new Promise(((e,r)=>{const{data:i=null,url:s,method:n="GET",headers:o,cancelToken:a}=t,c=wx.request({url:s,data:i,method:n.toUpperCase(),timeout:t.timeout,header:o,success(t){t.statusCode>=200&&t.statusCode<300?e(t.data):r({url:s,statusCode:t.statusCode})},fail(t){r("request:fail abort"===t.errMsg&&a&&a.reason||t)}});a&&a.promise.then((()=>{c&&c.abort()}))})),p=Array.isArray,h=t=>null==t,f=t=>"object"==typeof t&&null!==t,m=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},g=()=>{const t=[],e="0123456789abcdef";for(let r=0;r<36;r++)t[r]=e.substr(Math.floor(16*Math.random()),1);return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("").split("-").join("")},v=(t,e)=>t?(Object.entries(t).forEach((t=>{const[r,i]=[t[0],t[1]];if(null!==i)return f(i)&&!p(i)?(e[r]||(e[r]={}),void(e[r]=v(i,e[r]))):void(e[r]=i)})),e):e,y=/-(\w)/g,b=t=>t.replace(y,((t,e)=>e?e.toUpperCase():""));var x,E,I,D,q,O;t.EVENT=void 0,(x=t.EVENT||(t.EVENT={})).REQUEST_ERROR="requestError",x.STATE="state",t.STATE=void 0,(E=t.STATE||(t.STATE={}))[E.CLOSE=0]="CLOSE",E[E.JOINED=1]="JOINED",E[E.READY=2]="READY",t.ENDPOINT_TYPE=void 0,(I=t.ENDPOINT_TYPE||(t.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",t.ROLE=void 0,(D=t.ROLE||(t.ROLE={})).HOST="host",D.COHOST="coHost",D.ATTENDEE="attendee",D.AUDIENCE="audience",t.RECORD_STATUS=void 0,(q=t.RECORD_STATUS||(t.RECORD_STATUS={})).STARTED="started",q.PAUSED="paused",q.STARTING="starting",q.STOPPED="stopped";class T{constructor(t,e){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}),this.moduleName=e,this.ctx=t,this.emitter=r(),this.data=new Proxy({},o(this.emitter)),this._bindOn()}reactive(t){if(f(t)){const e=new Map,r=(t,i)=>{Object.keys(t).forEach((s=>{!1===i&&s in this.data&&(t[s]=this.data[s]);const n=e=>t[s]=e,o=`${b(s)}Change`;this.emitter.on(o,n),e.set(o,n),f(t[s])&&!p(t[s])&&r(t[s],!0)}))};r(t,!1),t._destory=()=>{e.forEach(((t,e)=>{this.emitter.off(e,t)}))}}else console.warn("Parameter is not an object!");return t}on(t,e){return this.emitter.on(t,e)}off(t,e){return this.emitter.off(t,e)}}class _ extends T{constructor(t){super(t,"info")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingInfo",(t=>{const{state:e,body:r}=t;("full"===e||"update"===e)&&v(r,this.data)})),this.ctx.emitter.on("participantCount",(t=>{const{body:e}=t;v({participantCount:e},this.data)}))}subject(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:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}/meetings/${e}/info/practiceSession`)}))}}function $(t){return e(this,void 0,void 0,(function*(){const r=S(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((t=>{o.push({name:t,seqId:n.data[t].maxSeqId,limit:200})})),o}))}(t.request,{topics:r,sessionID:i,meetingID:s});yield w(r,t),t.status.polling.running=!0,t.status.keepalive.running=!0,j(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)})),P(t)}))}function S(t){const e=[],{isInLobby:r}=t.modules.me.data;return r?(e.push("lobbyMember"),e):(Object.keys(t.modules).forEach((r=>{const i=t.modules[r]._topic();i&&(Array.isArray(i)?i.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(i)||e.push(i))})),e)}function A(t){t.status.polling.running=!1,t.status.keepalive.running=!1,t.status.polling.timer&&(clearTimeout(t.status.polling.timer),t.status.polling.timer=null),t.status.keepalive.timer&&(clearTimeout(t.status.keepalive.timer),t.status.keepalive.timer=null),t.config.request.cancelToken.cancel(),t.config.request.cancelToken=u.source()}function w(r,i){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:e},meetingID:s}=i.config.request,n=yield i.request.post(`${e}/meetings/${s}/subscribe`,{topics:r}),o=n&&n.data&&n.data.eventMsgs;o&&o.forEach((t=>{console.log("[subscribe]",t),i.emitter.emit(t.event,t)})),i.state=t.STATE.READY,i.emitter.emit(t.EVENT.STATE,{state:i.state})}))}function j(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((t=>{const e=s.find((e=>e.name===t));if(e){if(e.seqId=r[t].maxSeqId,!r[t].items)return;r[t].items.forEach((t=>{const e=JSON.parse(t.content);["liveStream","recording"].includes(e.event)&&(e.stime=t.stime),i(e)}))}}))})))(),c.running&&(c.timer=setTimeout((()=>{c.running&&j(t,r,i)}),200))}))}function P(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&&P(t)}),1e3*t.status.keepalive.interval))}))}t.MeEvent=void 0,(O=t.MeEvent||(t.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 U extends T{constructor(t){super(t,"me")}_topic(){return""}_bindOn(){const r=r=>e(this,void 0,void 0,(function*(){"role"in r&&r.role!==this.data.role&&(r.role!==t.ROLE.AUDIENCE&&this.data.role!==t.ROLE.AUDIENCE||(yield N(this.ctx),this.data.isUpdatedUserState=!1,this.emitter.emit(t.MeEvent.UPDATE_USER_STATE,this.data)),v({role:r.role},this.data),this.emitter.emit(t.MeEvent.ROLECHANGE,r.role),this.ctx.emitter.emit(t.MeEvent.ROLECHANGE,r.role))})),i=e=>{var r,i,s,n;if("audio"in e){const{deviceOn:o,sendOn:a,opBy:c}=e.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:e.audio},this.data),this.emitter.emit(t.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=e=>{var r,i,s,n;if("video"in e){const{deviceOn:o,sendOn:a,opBy:c}=e.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:e.video},this.data),this.emitter.emit(t.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=e=>{var r,i,s,n;if("share"in e){const{deviceOn:o,sendOn:a,opBy:c}=e.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:e.share},this.data),this.emitter.emit(t.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=e=>{e.displayName&&e.displayName!==this.data.displayName&&(v({displayName:e.displayName},this.data),this.emitter.emit(t.MeEvent.DISPLAYNAMECHANGE,e.displayName))},a=e=>{"isHandUp"in e&&e.isHandUp!==this.data.isHandUp&&(v({isHandUp:e.isHandUp},this.data),this.emitter.emit(t.MeEvent.HANDUPCHANGE,e.isHandUp))},c=e=>{"isSpotlightVideo"in e&&(v({isSpotlightVideo:e.isSpotlightVideo},this.data),this.emitter.emit(t.MeEvent.SPOTLIGHTVIDEOCHANGE,e.isSpotlightVideo))},u=r=>e(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(t.MeEvent.UPDATE_USER_STATE,this.data)),this.emitter.emit(t.MeEvent.LOBBYCHANGE,r.isInLobby))})),d=e=>{if(!e.barrage)return;let r=null;if(!e.barrage.wordsDisplayStatus)return r=null,delete e.barrage,this.data.barrage=r||void 0,void this.emitter.emit(t.MeEvent.BARRAGECHANGE,r);r={content:e.barrage.content,contentType:e.barrage.contentType,type:e.barrage.type,duration:e.barrage.duration,position:e.barrage.position};const{role:i}=this.data;e.barrage.receiver&&(i===t.ROLE.HOST||i===t.ROLE.COHOST?r=e.barrage.receiver.host?r:null:i===t.ROLE.ATTENDEE?r=e.barrage.receiver.attendee?r:null:i===t.ROLE.AUDIENCE&&(r=e.barrage.receiver.audience?r:null),delete e.barrage,this.data.barrage=r||void 0,this.emitter.emit(t.MeEvent.BARRAGECHANGE,r))},l=e=>{"leave"in e&&!0===e.leave&&("undefined"!=typeof Worker&&this.ctx.worker&&this.ctx.worker.postMessage({status:!1}),console.warn("handleLeave"),A(this.ctx),B(this.ctx),this.emitter.emit(t.MeEvent.LEAVE,e.resultInfo),this.ctx.state=t.STATE.CLOSE,this.ctx.emitter.emit(t.EVENT.STATE,{state:this.ctx.state,reason:e.resultInfo}))},p=t=>{r(t),i(t),s(t),n(t),o(t),a(t),u(t),c(t),d(t),l(t)};this.ctx.emitter.on(t.MeEvent.INIT,(e=>{v(e,this.data),this.data.isUpdatedUserState=!1,this.emitter.emit(t.MeEvent.UPDATE_USER_STATE,this.data)})),this.ctx.emitter.on(t.MeEvent.UPDATE,(t=>{p(t),v(t,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 t=r.users[0];t.leave=!0,l(t)}else{const t=r.users.find((t=>t.userID===this.data.userID));t&&(p(t),v(t,this.data))}})))),this.ctx.emitter.on("setUserVideo",(e=>{this.emitter.emit(t.MeEvent.SETVIDEO,e.body)})),this.ctx.emitter.on("setUserAudio",(e=>{this.emitter.emit(t.MeEvent.SETAUDIO,e.body)})),this.ctx.emitter.on("meetingState",(t=>{const{body:e={}}=t;if("ended"===e.state){l({leave:!0,resultInfo:e.resultInfo})}}))}updateUserState(e,r=!1){if(!r){const{role:r,initialMediaState:i}=this.data;e.audio.sendOn=e.audio.sendOn&&i.audio.sendOn,e.video.sendOn=e.video.sendOn&&i.video.sendOn,r===t.ROLE.AUDIENCE&&(e.audio.sendOn=!1,e.video.sendOn=!1)}const{prefix:{ctrl:i},meetingID:s}=this.ctx.config.request;return this.data.isUpdatedUserState=!0,v(e,this.data),this.ctx.request.post(`${i}/meetings/${s}/updateUserState`,e)}}function N(t){return e(this,void 0,void 0,(function*(){const e=S(t),{meetingID:r,sessionID:i}=t.config.request;"undefined"!=typeof Worker&&t.worker?t.worker.postMessage({topics:e,meetingID:r,sessionID:i,rePolling:!0}):(A(t),yield $(t))}))}class R extends T{constructor(t){super(t,"invite")}_topic(){return"advCtrl"}_bindOn(){this.ctx.emitter.on("callRecord",(t=>{const{body:e,state:r}=t;if(e&&e.users){if("full"===r)return this.data.callRecordUsers=e.users.map((t=>(t.displayNamePinyin=R.setDisplayNamePinyinProp?R.setDisplayNamePinyinProp(t.displayName||""):t.displayName,t))),void this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers);e.users.forEach((t=>{const e=this.data.callRecordUsers.findIndex((e=>t.inviteTransID===e.inviteTransID));"update"===r&&-1!==e?v(t,this.data.callRecordUsers[e]):"update"===r&&-1===e&&(t.displayNamePinyin=R.setDisplayNamePinyinProp?R.setDisplayNamePinyinProp(t.displayName||""):t.displayName,this.data.callRecordUsers.push(t))})),this.emitter.emit("callRecordUsersChange",this.data.callRecordUsers)}}))}invite(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}/meetings/${r}/invite`,t)}}class C extends T{constructor(t){super(t,"users")}_topic(){const{role:e,endpointType:r}=this.ctx.modules.me.data;return r===t.ENDPOINT_TYPE.SUPERVISION?["interactive","broadcast"]:e===t.ROLE.AUDIENCE?"interactive":["interactive","broadcast","lobby"]}_bindOn(){const e=(e,r)=>{if(e.userID===this.ctx.modules.me.data.userID){const i={};"delete"===r&&(i.leave=!0),this.ctx.emitter.emit(t.MeEvent.UPDATE,Object.assign(Object.assign({},e),i))}},r=({updateUsers:t,state:r,sourceKey:i})=>{if("full"===r)return this.data[i]=t.map((t=>(t.displayNamePinyin=C.setDisplayNamePinyinProp?C.setDisplayNamePinyinProp(t.displayName):t.displayName,e(t,r),t))),this.emitter.emit(`${i}Change`,this.data[i]),this.emitter.emit(`${i}FullUpdate`,this.data[i]),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]),v(t,this.data[i][o]),this.emitter.emit(`${i}Update`,{user:s[i][o]})):"update"===r&&-1===o&&(t.displayNamePinyin=C.setDisplayNamePinyinProp?C.setDisplayNamePinyinProp(t.displayName):t.displayName,s[i].push(t),this.emitter.emit(`${i}Add`,{user:t,resultInfo:t.resultInfo}));e(t,r)})),this.emitter.emit(`${i}Change`,this.data[i]),this.data[i]};this.ctx.emitter.on("interactiveUsers",(t=>{const{state:e,body:i}=t;r({updateUsers:i.users,state:e,sourceKey:"interactiveUsers"})})),this.ctx.emitter.on("lobbyUsers",(t=>{const{state:e,body:i}=t;r({updateUsers:i.users,state:e,sourceKey:"lobbyUsers"})})),this.ctx.emitter.on("broadcastUsers",(t=>{const{state:e,body:i}=t;r({updateUsers:i.users,state:e,sourceKey:"broadcastUsers"})})),this.ctx.emitter.on("advCtrlUsers",(t=>{const{state:e,body:i}=t;r({updateUsers:i.users,state:e,sourceKey:"advCtrlUsers"})}))}updateUserProps(t,e){t.displayName&&t.displayName!==e.displayName&&(t.displayNamePinyin=C.setDisplayNamePinyinProp?C.setDisplayNamePinyinProp(t.displayName):t.displayName)}setAudio(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/audio`,e)}setVideo(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/video`,e)}setShare(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/share`,e)}setWhiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/whiteboard`,e)}handUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/handUp`,e)}setRole(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/role`,e)}rename(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/displayName`,e)}remove(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}/meetings/${r}/users/${t}/remove`)}replyHandUp(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/replyHandUp`,e)}fecc(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/fecc`,e)}lobbyState(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/lobbyState`,e)}allowLocalRecord(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/allowLocalRecord`,e)}whiteboard(t,e){if(!t||!e)return Promise.reject();const{prefix:{ctrl:r},meetingID:i}=this.ctx.config.request;return this.ctx.request.post(`${r}/meetings/${i}/users/${t}/whiteboard`,e)}callStats(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.get(`${e}/meetings/${r}/users/${t}/callStats`)}replyAllHandUp(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}/meetings/${e}/replyAllHandUp`)}admitAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}/meetings/${e}/lobby/admitAll`)}refuseAll(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return this.ctx.request.post(`${t}/meetings/${e}/lobby/refuseAll`)}}class k{constructor(t){Object.defineProperty(this,"meeting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.meeting=M(t)}static getInstance(t){return this.instance?this.instance:this.instance=new k(t)}}Object.defineProperty(k,"instance",{enumerable:!0,configurable:!0,writable:!0,value:null});const L=e=>{e.state!==t.STATE.CLOSE&&(e.state=t.STATE.CLOSE,e.emitter.emit(t.EVENT.STATE,{state:e.state}))};function M(e){const{baseURL:i,modules:s,worker:n,singleton:o}=e;s.findIndex((t=>t===U))<0&&s.push(U),s.findIndex((t=>t===_))<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:0,voteTk:""}},worker:n,emitter:r(),request:new c({baseURL:i,beforeRequest:t=>{t.headers["X-Y-Request-Id"]=g()},error:e=>{a.emitter.emit(t.EVENT.REQUEST_ERROR,e)}}),modules:{},state:t.STATE.CLOSE,status:{polling:{running:!1,timer:null},keepalive:{running:!1,timer:null,interval:20}}};return a.worker&&("undefined"!=typeof Worker?a.worker.postMessage({baseURL:i}):console.error("The current environment does not support worker")),function(t,e){if(!p(t))return void console.error("The modules parameter requires an array type");t.forEach((t=>{const r=new t(e);e.modules[r.moduleName]=r}))}(s,a),Object.assign({config:a.config,request:a.request,get state(){return a.state},on:a.emitter.on,off:a.emitter.off,join:H(a),leave:V(a),end:G(a)},a.modules)}function H(r){return function(i){var s;return e(this,void 0,void 0,(function*(){const e=`${null===(s=i.endpointType)||void 0===s?void 0:s.toLocaleUpperCase()}${g()}_${((t=new Date,e)=>{const r={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(const i in r)new RegExp("("+i+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?r[i]:("00"+r[i]).substr((""+r[i]).length)));return e})(new Date,"MMddHHmmss")}_${i.meetingNum}`;r.request.setDefaultHeader("X-Y-Session-Id",e);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":e}}),{credential:a="",location:c=""}=o&&o.data||{};if(!a)return 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":e}});if(u&&u.data&&u.ret>-1){const{meetingID:i="",ctrlID:s="",user:n={},mediaContent:a={},initialMediaState:d={},tk:l=""}=u.data;if(r.config.request.sessionID=e,r.config.request.meetingID=i,r.config.request.ctrlID=s,r.config.request.userID=n.userID,r.config.request.voteTk=l,r.request.setDefaultHeader("X-Y-Location",c),r.request.setDefaultHeader("X-Y-Ctrl-Id",s),r.emitter.emit(t.MeEvent.INIT,Object.assign(Object.assign({},n),{mediaContent:a,initialMediaState:d})),r.state=t.STATE.JOINED,r.emitter.emit(t.EVENT.STATE,{state:r.state}),"undefined"!=typeof Worker&&r.worker){const t=S(r);yield w(t,r),r.status.keepalive.running=!0,P(r),r.worker.postMessage({topics:t,meetingID:i,sessionID:e,status:!0}),r.worker.onmessage=t=>{console.log("[Polling]",t.data),r.emitter.emit(t.data.event,t.data)}}else yield $(r);u.data=Object.assign(Object.assign({},u.data),o.data)}return u}))}}function V(t){return function(r){return e(this,void 0,void 0,(function*(){r||(r={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}),A(t),B(t),L(t),s}))}}function G(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}),A(t),B(t),L(t),i}))}}function B(t){if(t.config.singleton){const{baseURL:e,modules:r,singleton:i}=t.config,s={baseURL:e,modules:r,worker:t.worker,singleton:i},n=k.getInstance(s);n&&(n.meeting=M(s))}}return t.Chat=class extends T{constructor(t){super(t,"chat")}_topic(){return"chat"}_bindOn(){this.ctx.emitter.on("chatMsg",(t=>{const{body:e}=t;this.emitter.emit("chatMsg",e)}))}msg(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)}))}},t.Info=_,t.Invite=R,t.LiveStream=class extends T{constructor(t){super(t,"liveStream")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("liveStream",(t=>{var e;const{state:r,body:i,stime:s}=t;if(i){if(s&&(this.data.jetlag=s),"full"===r){const{liveStreams:t=[]}=i;if(!t.length)return;this.data.status=[],this.data.liveStreams=t.map((t=>(t.requesting="starting"===t.status,this.data.status.push({platform:t.platform||"",status:(t.requesting?"stopped":t.status)||""}),t)));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===(e=i.liveStreams)||void 0===e||e.forEach((t=>{this.data.resultInfo=t.resultInfo||{};let e=this.data.liveStreams.findIndex((e=>e.platform===t.platform));-1===e?(t.requesting="starting"===t.status,this.data.liveStreams.push(t)):(t.requesting="starting"===t.status,t=Object.assign(Object.assign({},this.data.liveStreams[e]),t),this.data.liveStreams.splice(e,1,t)),e=this.data.status.findIndex((e=>e.platform===t.platform)),-1===e?this.data.status.push({platform:t.platform||"",status:t.requesting?"stopped":t.status||""}):this.data.status.splice(e,1,{platform:this.data.status[e].platform||"",status:t.requesting?this.data.status[e].status||"stopped":t.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)}))}},t.Me=U,t.Recording=class extends T{constructor(t){super(t,"recording")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("recording",(t=>{const{state:e,body:r,stime:i}=t;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(e)?(r.recordUsers&&(this.data.recording.recordUsers=r.recordUsers),this.data):void 0}))}history(){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.get(`${t}meetings/${e}/recording/history`)}))}status(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)}))}},t.Setting=class extends T{constructor(t){super(t,"setting")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingSetting",(t=>{const{state:e,body:r}=t;["full","update"].includes(e)&&v(r,this.data)}))}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:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}/meetings/${e}/muteAll`)}))}unmuteAll(){return e(this,void 0,void 0,(function*(){const{prefix:{ctrl:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}/meetings/${e}/unmuteAll`)}))}},t.SpotlightVideo=class extends T{constructor(t){super(t,"spotlightVideo")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("spotlightVideo",(e=>{const{body:r}=e;if(!r||!r.userIDs)return;this.data.userIDs=r.userIDs;r.userIDs.findIndex((t=>t===this.ctx.modules.me.data.userID))>-1?this.ctx.emitter.emit(t.MeEvent.UPDATE,{isSpotlightVideo:!0}):this.ctx.modules.me.data.isSpotlightVideo&&this.ctx.emitter.emit(t.MeEvent.UPDATE,{isSpotlightVideo:!1})}))}spotlight(t){if(!t)return Promise.reject();const{prefix:{ctrl:e},meetingID:r}=this.ctx.config.request;return this.ctx.request.post(`${e}/meetings/${r}/view/spotlight`,t)}},t.Users=C,t.View=class extends T{constructor(t){super(t,"view")}_topic(){return["hostAttendee","audience","advCtrl"]}_bindOn(){["hostLayout","attendeeLayout","audienceLayout","meetingView","personalView"].forEach((t=>{this.ctx.emitter.on(t,(e=>{"personalView"!==t?this.updateLayout(e,t):this.updatePersonalLayouts(e)}))}))}updateLayout(t,e){const{event:r,body:i}=t;i&&("meetingView"===r?Object.keys(i).forEach((t=>{this.data[t]=i[t]})):this.data[e]=i)}updatePersonalLayouts(t){const{state:e,body:r}=t;"full"!==e&&void 0!==this.data.personalLayouts||(this.data.personalLayouts={}),r.personalLayouts.forEach((t=>{const{subscriber:r={userID:-1}}=t,i=r.userID||r.subjectID||-1;"full"===e||"update"===e||t.templateStatus?this.data.personalLayouts[i]=t: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:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}meetings/${e}/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)}))}},t.Vote=class extends T{constructor(t){super(t,"vote")}_topic(){return"vote"}_bindOn(){this.ctx.emitter.on("vote",(t=>{const{body:e}=t,{voteID:r}=e;void 0===this.data.vote&&(this.data.vote={}),this.data.vote[r]=e,this.emitter.emit("voteChange",this.data.vote)}))}getVotes(t){const{prefix:{vote:e},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}/meetings/${r}/votes`,{params:t})}getVote(t){const{prefix:{vote:e},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}/meetings/${r}/vote`,{params:t})}getMeVote(t){const{prefix:{vote:e},meetingID:r,voteTk:i}=this.ctx.config.request;return t.tk=t.tk||i,this.ctx.request.get(`${e}/meetings/${r}/vote/me`,{params:t})}voteStatus(t,e){const{prefix:{vote:r},meetingID:i,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.post(`${r}/meetings/${i}/vote/status?tk=${t.tk}&voteID=${t.voteID}`,e)}voteSubmit(t,e){const{prefix:{vote:r},meetingID:i,voteTk:s}=this.ctx.config.request;return t.tk=t.tk||s,this.ctx.request.post(`${r}/meetings/${i}/vote/submit?tk=${t.tk}&voteID=${t.voteID}`,e)}voteAdd(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}/personal/vote/add`,t)}voteEdit(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}/personal/vote/edit`,t)}voteDelete(t){const{prefix:{conference:e}}=this.ctx.config.request;return this.ctx.request.post(`${e}/personal/vote/delete`,t)}},t.Words=class extends T{constructor(t){super(t,"words")}_topic(){return"meeting"}_bindOn(){this.ctx.emitter.on("meetingBarrage",(e=>{this.data.timer&&clearTimeout(this.data.timer);const{state:r,body:i}=e;if(!i)return this.data.wordsDisplayStatus=!1,void this.ctx.emitter.emit(t.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(t.MeEvent.UPDATE,{barrage:this.data})}),1e3*i.duration)),v(i,this.data),this.emitter.emit("barrageRecordChange",this.data.barrageRecord),this.ctx.emitter.emit(t.MeEvent.UPDATE,{barrage:this.data}))})),this.ctx.emitter.on(t.MeEvent.ROLECHANGE,(()=>this.ctx.emitter.emit(t.MeEvent.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:t},meetingID:e}=this.ctx.config.request;return yield this.ctx.request.post(`${t}/meetings/${e}/deleteBarrage`)}))}},t.createMeeting=function(t){return t.singleton?k.getInstance(t).meeting:M(t)},t.reset=B,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(t){a(t)}}function s(e){try{u(n.throw(e))}catch(t){a(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={exports:{}};!function(e,r){var n="__lodash_hash_undefined__",o=9007199254740991,a="[object Arguments]",i="[object Boolean]",s="[object Date]",u="[object Function]",c="[object GeneratorFunction]",l="[object Map]",f="[object Number]",d="[object Object]",p="[object Promise]",h="[object RegExp]",b="[object Set]",y="[object String]",_="[object Symbol]",v="[object WeakMap]",g="[object ArrayBuffer]",m="[object DataView]",j="[object Float32Array]",w="[object Float64Array]",O="[object Int8Array]",x="[object Int16Array]",I="[object Int32Array]",T="[object Uint8Array]",A="[object Uint8ClampedArray]",E="[object Uint16Array]",R="[object Uint32Array]",S=/\w*$/,D=/^\[object .+?Constructor\]$/,P=/^(?:0|[1-9]\d*)$/,q={};q[a]=q["[object Array]"]=q[g]=q[m]=q[i]=q[s]=q[j]=q[w]=q[O]=q[x]=q[I]=q[l]=q[f]=q[d]=q[h]=q[b]=q[y]=q[_]=q[T]=q[A]=q[E]=q[R]=!0,q["[object Error]"]=q[u]=q[v]=!1;var C="object"==typeof self&&self&&self.Object===Object&&self,U="object"==typeof t&&t&&t.Object===Object&&t||C||Function("return this")(),k=r&&!r.nodeType&&r,H=k&&e&&!e.nodeType&&e,L=H&&H.exports===k;function $(e,t){return e.set(t[0],t[1]),e}function M(e,t){return e.add(t),e}function N(e,t,r,n){var o=-1,a=e?e.length:0;for(n&&a&&(r=e[++o]);++o<a;)r=t(r,e[o],o,e);return r}function B(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}function F(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function G(e,t){return function(r){return e(t(r))}}function J(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var z,V=Array.prototype,W=Function.prototype,X=Object.prototype,K=U["__core-js_shared__"],Q=(z=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"",Y=W.toString,Z=X.hasOwnProperty,ee=X.toString,te=RegExp("^"+Y.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=L?U.Buffer:void 0,ne=U.Symbol,oe=U.Uint8Array,ae=G(Object.getPrototypeOf,Object),ie=Object.create,se=X.propertyIsEnumerable,ue=V.splice,ce=Object.getOwnPropertySymbols,le=re?re.isBuffer:void 0,fe=G(Object.keys,Object),de=Ue(U,"DataView"),pe=Ue(U,"Map"),he=Ue(U,"Promise"),be=Ue(U,"Set"),ye=Ue(U,"WeakMap"),_e=Ue(Object,"create"),ve=Me(de),ge=Me(pe),me=Me(he),je=Me(be),we=Me(ye),Oe=ne?ne.prototype:void 0,xe=Oe?Oe.valueOf:void 0;function Ie(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Te(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ae(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ee(e){this.__data__=new Te(e)}function Re(e,t,r){var n=e[t];Z.call(e,t)&&Ne(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function Se(e,t){for(var r=e.length;r--;)if(Ne(e[r][0],t))return r;return-1}function De(e,t,r,n,o,p,v){var D;if(n&&(D=p?n(e,o,p,v):n(e)),void 0!==D)return D;if(!ze(e))return e;var P=Be(e);if(P){if(D=function(e){var t=e.length,r=e.constructor(t);return t&&"string"==typeof e[0]&&Z.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!t)return function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}(e,D)}else{var C=He(e),U=C==u||C==c;if(Ge(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(C==d||C==a||U&&!p){if(B(e))return p?e:{};if(D=function(e){return"function"!=typeof e.constructor||$e(e)?{}:ze(t=ae(e))?ie(t):{};var t}(U?{}:e),!t)return function(e,t){return qe(e,ke(e),t)}(e,function(e,t){return e&&qe(t,Ve(t),e)}(D,e))}else{if(!q[C])return p?e:{};D=function(e,t,r,n){var o=e.constructor;switch(t){case g:return Pe(e);case i:case s:return new o(+e);case m:return function(e,t){var r=t?Pe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,n);case j:case w:case O:case x:case I:case T:case A:case E:case R:return function(e,t){var r=t?Pe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,n);case l:return function(e,t,r){return N(t?r(F(e),!0):F(e),$,new e.constructor)}(e,n,r);case f:case y:return new o(e);case h:return function(e){var t=new e.constructor(e.source,S.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return function(e,t,r){return N(t?r(J(e),!0):J(e),M,new e.constructor)}(e,n,r);case _:return xe?Object(xe.call(e)):{}}}(e,C,De,t)}}v||(v=new Ee);var k=v.get(e);if(k)return k;if(v.set(e,D),!P)var H=r?function(e){return function(e,t,r){var n=t(e);return Be(e)?n:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(n,r(e))}(e,Ve,ke)}(e):Ve(e);return function(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r););}(H||e,(function(o,a){H&&(o=e[a=o]),Re(D,a,De(o,t,r,n,a,e,v))})),D}function Pe(e){var t=new e.constructor(e.byteLength);return new oe(t).set(new oe(e)),t}function qe(e,t,r,n){r||(r={});for(var o=-1,a=t.length;++o<a;){var i=t[o],s=n?n(r[i],e[i],i,r,e):void 0;Re(r,i,void 0===s?e[i]:s)}return r}function Ce(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function Ue(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ze(e)||(t=e,Q&&Q in t))&&(Je(e)||B(e)?te:D).test(Me(e));var t}(r)?r:void 0}Ie.prototype.clear=function(){this.__data__=_e?_e(null):{}},Ie.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ie.prototype.get=function(e){var t=this.__data__;if(_e){var r=t[e];return r===n?void 0:r}return Z.call(t,e)?t[e]:void 0},Ie.prototype.has=function(e){var t=this.__data__;return _e?void 0!==t[e]:Z.call(t,e)},Ie.prototype.set=function(e,t){return this.__data__[e]=_e&&void 0===t?n:t,this},Te.prototype.clear=function(){this.__data__=[]},Te.prototype.delete=function(e){var t=this.__data__,r=Se(t,e);return!(r<0||(r==t.length-1?t.pop():ue.call(t,r,1),0))},Te.prototype.get=function(e){var t=this.__data__,r=Se(t,e);return r<0?void 0:t[r][1]},Te.prototype.has=function(e){return Se(this.__data__,e)>-1},Te.prototype.set=function(e,t){var r=this.__data__,n=Se(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new Ie,map:new(pe||Te),string:new Ie}},Ae.prototype.delete=function(e){return Ce(this,e).delete(e)},Ae.prototype.get=function(e){return Ce(this,e).get(e)},Ae.prototype.has=function(e){return Ce(this,e).has(e)},Ae.prototype.set=function(e,t){return Ce(this,e).set(e,t),this},Ee.prototype.clear=function(){this.__data__=new Te},Ee.prototype.delete=function(e){return this.__data__.delete(e)},Ee.prototype.get=function(e){return this.__data__.get(e)},Ee.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Te){var n=r.__data__;if(!pe||n.length<199)return n.push([e,t]),this;r=this.__data__=new Ae(n)}return r.set(e,t),this};var ke=ce?G(ce,Object):function(){return[]},He=function(e){return ee.call(e)};function Le(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||P.test(e))&&e>-1&&e%1==0&&e<t}function $e(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||X)}function Me(e){if(null!=e){try{return Y.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ne(e,t){return e===t||e!=e&&t!=t}(de&&He(new de(new ArrayBuffer(1)))!=m||pe&&He(new pe)!=l||he&&He(he.resolve())!=p||be&&He(new be)!=b||ye&&He(new ye)!=v)&&(He=function(e){var t=ee.call(e),r=t==d?e.constructor:void 0,n=r?Me(r):void 0;if(n)switch(n){case ve:return m;case ge:return l;case me:return p;case je:return b;case we:return v}return t});var Be=Array.isArray;function Fe(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Je(e)}var Ge=le||function(){return!1};function Je(e){var t=ze(e)?ee.call(e):"";return t==u||t==c}function ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ve(e){return Fe(e)?function(e,t){var r=Be(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Fe(e)}(e)&&Z.call(e,"callee")&&(!se.call(e,"callee")||ee.call(e)==a)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,o=!!n;for(var i in e)!t&&!Z.call(e,i)||o&&("length"==i||Le(i,n))||r.push(i);return r}(e):function(e){if(!$e(e))return fe(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 De(e,!0,!0)}}(r,r.exports);const n=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 o{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:o={}}=e;return e.url=this.baseURL.replace(/\/+$/,"")+"/"+((e,t)=>{if(!t)return e;const r=[];Object.keys(t).forEach((e=>{const o=t[e];if(null==o)return;let a;Array.isArray(o)?(a=o,e+="[]"):a=[o],a.forEach((t=>{null!==t&&"object"==typeof t&&(t=JSON.stringify(t)),r.push(`${n(e)}=${n(t)}`)}))}));const o=r.join("&");if(o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e})(t.replace(/^\/+/,""),e.params),o=Object.assign(o,this._defaultHeaders),Object.keys(o).forEach((e=>{"Content-Type"!==e&&e.toUpperCase()==="Content-Type".toUpperCase()&&(o["Content-Type"]=o[e],delete o[e])})),u(e.data)&&(o&&!o["Content-Type"]&&(o["Content-Type"]="application/json;charset=utf-8"),e.data=JSON.stringify(e.data)),e.headers=o,e.timeout=r,this._beforeRequest&&this._beforeRequest(e),"undefined"!=typeof wx?s(e):i(e)}setDefaultHeader(e,t){!(e in this._defaultHeaders)||""!==t&&null!==t?this._defaultHeaders[e]=t:delete this._defaultHeaders[e]}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 a{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 a((t=>{e=t}));return{cancel:e,token:t}}}const i=e=>new Promise(((t,r)=>{const{data:n=null,url:o,method:a="GET",headers:i,cancelToken:s,withResDate:u}=e;let c=new XMLHttpRequest;c.open(a.toUpperCase(),o,!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){r(new Error("E_JSON_PARSE"+c.responseText))}else r({url:o,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&&(r({url:o,statusCode:c.status,type:"request abort"}),c=null)},c.onerror=()=>{r(new Error("Network Error")),c=null},c.ontimeout=()=>{r(new Error("timeout of "+e.timeout+"ms exceeded")),c=null},"setRequestHeader"in c&&Object.keys(i).forEach((e=>{null===n&&"content-type"===e.toLowerCase()?delete i[e]:c.setRequestHeader(e,i[e])})),s&&s.promise.then((e=>{c&&(c.abort(),r(e),c=null)})),c.send(n)})),s=e=>new Promise(((t,r)=>{const{data:n=null,url:o,method:a="GET",headers:i,cancelToken:s}=e,u=wx.request({url:o,data:n,method:a.toUpperCase(),timeout:e.timeout,header:i,success(e){e.statusCode>=200&&e.statusCode<300?t(e.data):r({url:o,statusCode:e.statusCode})},fail(e){r("request:fail abort"===e.errMsg&&s&&s.reason||e)}});s&&s.promise.then((()=>{u&&u.abort()}))})),u=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype};function c(t,r,n){return e(this,void 0,void 0,(function*(){const{inboxes:o,sessionID:a,meetingID:i,cancelToken:s,status:u}=r;yield(()=>e(this,void 0,void 0,(function*(){const e=yield t.post("/ypush/api/v1/meeting-control/polling",{basic:{tenantId:100,clientId:a,meetingId:i},inboxes:o},{cancelToken:s,withResDate:!0});if(!e||!e.data)return;const{data:r={}}=e;Object.keys(r).forEach((e=>{const t=o.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),n(t)}))}}))})))(),u.running&&(u.timer=setTimeout((()=>{u.running&&c(t,r,n)}),200))}))}const l=self;let f,d=a.source(),p="",h=[],b="",y="";const _={running:!1,timer:null};function v(){return e(this,void 0,void 0,(function*(){f=new o({baseURL:p});const t=yield function(t,r){return e(this,void 0,void 0,(function*(){const{topics:e,sessionID:n,meetingID:o}=r,a=yield t.post("/ypush/api/v1/meeting-control/inbox",{basic:{tenantId:100,clientId:n,meetingId:o},inboxes:e}),i=[];return a.data&&Object.keys(a.data).forEach((e=>{i.push({name:e,seqId:a.data[e].maxSeqId,limit:200})})),i}))}(f,{topics:h,sessionID:b,meetingID:y});_.running=!0,c(f,{inboxes:t,sessionID:b,meetingID:y,cancelToken:d.token,status:_},(e=>{l.postMessage(e)}))}))}function g(){_.running=!1,_.timer&&(clearTimeout(_.timer),_.timer=null),d.cancel(),d=a.source()}l.addEventListener("message",(e=>{"baseURL"in e.data&&(p=e.data.baseURL),"topics"in e.data&&(h=e.data.topics),"sessionID"in e.data&&(b=e.data.sessionID),"meetingID"in e.data&&(y=e.data.meetingID),"rePolling"in e.data&&(g(),v()),"status"in e.data&&(e.data.status?v():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.0",
|
|
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
|
-
}
|