From 27c37ff7e93fcf0f5dd19cb623f3060cb4b57c8f Mon Sep 17 00:00:00 2001 From: mayk-zoom <78444092+mayk-zoom@users.noreply.github.com> Date: Thu, 30 May 2024 11:59:00 -0700 Subject: [PATCH] 1.11.6 update (#51) --- dist/index.esm.js | 2 +- dist/index.js | 2 +- dist/index.umd.js | 2 +- dist/lib/audio_simd.min.js | 4 ++-- dist/lib/js_audio_process.min.js | 4 ++-- dist/lib/js_media.min.js | 4 ++-- dist/lib/sharing_m.min.js | 4 ++-- dist/lib/sharing_mtsimd.min.js | 4 ++-- dist/lib/sharing_s.min.js | 4 ++-- dist/lib/sharing_simd.min.js | 4 ++-- dist/lib/vb.min.js | 4 ++-- dist/lib/video_m.min.js | 4 ++-- dist/lib/video_mtsimd.min.js | 4 ++-- dist/lib/video_s.min.js | 4 ++-- dist/lib/video_share_mtsimd.min.js | 6 +++--- dist/lib/video_simd.min.js | 4 ++-- dist/types/event-callback.d.ts | 6 +++--- dist/types/media.d.ts | 3 +++ package.json | 2 +- 19 files changed, 37 insertions(+), 34 deletions(-) diff --git a/dist/index.esm.js b/dist/index.esm.js index ea5cb8e..40077f5 100644 --- a/dist/index.esm.js +++ b/dist/index.esm.js @@ -1 +1 @@ -function e(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function t(t){for(var o=1;o=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function u(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var d=function(e,t){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},d(e,t)};function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var c=function(){return c=Object.assign||function(e){for(var t,o=1,n=arguments.length;o0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var n,r,i=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s}function v(e,t,o){if(o||2===arguments.length)for(var n,r=0,i=t.length;r0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,o=this,n=o.hasError,r=o.isStopped,i=o.observers;return n||r?A:(this.currentObservers=null,i.push(e),new I((function(){t.currentObservers=null,E(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,o=t.hasError,n=t.thrownError,r=t.isStopped;o?e.error(n):r&&e.complete()},t.prototype.asObservable=function(){var e=new $;return e.source=this,e},t.create=function(e,t){return new Z(e,t)},t}($),Z=function(e){function t(t,o){var n=e.call(this)||this;return n.destination=t,n.source=o,n}return l(t,e),t.prototype.next=function(e){var t,o;null===(o=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===o||o.call(t,e)},t.prototype.error=function(e){var t,o;null===(o=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===o||o.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,o;return null!==(o=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==o?o:A},t}(Q),Y=function(e){function t(t){var o=e.call(this)||this;return o._value=t,o}return l(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var o=e.prototype._subscribe.call(this,t);return!o.closed&&t.next(this._value),o},t.prototype.getValue=function(){var e=this,t=e.hasError,o=e.thrownError,n=e._value;if(t)throw o;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Q),X={now:function(){return(X.delegate||Date).now()},delegate:void 0},ee=function(e){function t(t,o,n){void 0===t&&(t=1/0),void 0===o&&(o=1/0),void 0===n&&(n=X);var r=e.call(this)||this;return r._bufferSize=t,r._windowTime=o,r._timestampProvider=n,r._buffer=[],r._infiniteTimeWindow=!0,r._infiniteTimeWindow=o===1/0,r._bufferSize=Math.max(1,t),r._windowTime=Math.max(1,o),r}return l(t,e),t.prototype.next=function(t){var o=this,n=o.isStopped,r=o._buffer,i=o._infiniteTimeWindow,s=o._timestampProvider,a=o._windowTime;n||(r.push(t),!i&&r.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),o=this._infiniteTimeWindow,n=this._buffer.slice(),r=0;r0?e.prototype.requestAsyncId.call(this,t,o,n):(t.actions.push(this),t._scheduled||(t._scheduled=ue.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,o,n){var r;if(void 0===n&&(n=0),null!=n?n>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,t,o,n);var i=t.actions;null!=o&&(null===(r=i[i.length-1])||void 0===r?void 0:r.id)!==o&&(ue.clearImmediate(o),t._scheduled===o&&(t._scheduled=void 0))},t}(ne),le=function(){function e(t,o){void 0===o&&(o=e.now),this.schedulerActionCtor=t,this.now=o}return e.prototype.schedule=function(e,t,o){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(o,t)},e.now=X.now,e}(),ce=function(e){function t(t,o){void 0===o&&(o=le.now);var n=e.call(this,t,o)||this;return n.actions=[],n._active=!1,n}return l(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var o;this._active=!0;do{if(o=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,o){for(;e=t.shift();)e.unsubscribe();throw o}}},t}(le),pe=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var o,n=this.actions;e=e||n.shift();do{if(o=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,o){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw o}},t}(ce))(de),he=new ce(ne),me=he,ve=function(e){function t(t,o){var n=e.call(this,t,o)||this;return n.scheduler=t,n.work=o,n}return l(t,e),t.prototype.schedule=function(t,o){return void 0===o&&(o=0),o>0?e.prototype.schedule.call(this,t,o):(this.delay=o,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,o){return o>0||this.closed?e.prototype.execute.call(this,t,o):this._execute(t,o)},t.prototype.requestAsyncId=function(t,o,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,o,n):(t.flush(this),0)},t}(ne),ge=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t}(ce))(ve),fe=new $((function(e){return e.complete()}));function ye(e){return e&&y(e.schedule)}function Se(e){return e[e.length-1]}function be(e){return y(Se(e))?e.pop():void 0}function Ee(e){return ye(Se(e))?e.pop():void 0}var Ie=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function Ae(e){return y(null==e?void 0:e.then)}function Ce(e){return y(e[B])}function _e(e){return Symbol.asyncIterator&&y(null==e?void 0:e[Symbol.asyncIterator])}function we(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Re="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Oe(e){return y(null==e?void 0:e[Re])}function Te(e){return function(e,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,r=o.apply(e,t||[]),i=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){r[e]&&(n[e]=function(t){return new Promise((function(o,n){i.push([e,t,o,n])>1||a(e,t)}))})}function a(e,t){try{!function(e){e.value instanceof g?Promise.resolve(e.value.v).then(u,d):l(i[0][2],e)}(r[e](t))}catch(e){l(i[0][3],e)}}function u(e){a("next",e)}function d(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}(this,arguments,(function(){var t,o,n;return p(this,(function(r){switch(r.label){case 0:t=e.getReader(),r.label=1;case 1:r.trys.push([1,,9,10]),r.label=2;case 2:return[4,g(t.read())];case 3:return o=r.sent(),n=o.value,o.done?[4,g(void 0)]:[3,5];case 4:return[2,r.sent()];case 5:return[4,g(n)];case 6:return[4,r.sent()];case 7:return r.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function De(e){return y(null==e?void 0:e.getReader)}function Pe(e){if(e instanceof $)return e;if(null!=e){if(Ce(e))return r=e,new $((function(e){var t=r[B]();if(y(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ie(e))return n=e,new $((function(e){for(var t=0;t0&&c(r)}),void 0,void 0,(function(){(null==i?void 0:i.closed)||null==i||i.unsubscribe(),a=null}))),!d&&c(null!=n?"number"==typeof n?n:+n-u.now():r)}))}function Ge(e){throw new $e(e)}function ze(e,t){return G((function(o,n){var r=0;o.subscribe(z(n,(function(o){n.next(e.call(t,o,r++))})))}))}var Ke=Array.isArray;function qe(e){return ze((function(t){return function(e,t){return Ke(t)?e.apply(void 0,v([],m(t))):e(t)}(e,t)}))}var Je=Array.isArray,Qe=Object.getPrototypeOf,Ze=Object.prototype,Ye=Object.keys;function Xe(e,t,o){return void 0===o&&(o=1/0),y(t)?Xe((function(o,n){return ze((function(e,r){return t(o,e,n,r)}))(Pe(e(o,n)))}),o):("number"==typeof t&&(o=t),G((function(t,n){return function(e,t,o,n,r,i,s,a){var u=[],d=0,l=0,c=!1,p=function(){!c||u.length||d||t.complete()},h=function(e){return d=2))}function At(e){return G((function(t,o){var n=!1,r=0;t.subscribe(z(o,(function(t){return(n||(n=!e(t,r++)))&&o.next(t)})))}))}function Ct(){for(var e=[],t=0;t1?o-1:0),r=1;r1?t-1:0),n=1;n2?o-2:0),s=2;s2?o-2:0),r=2;r{const t=e(...o);if(!t)throw new TypeError(`combineEpics: one of the provided Epics "${e.name||""}" does not return a stream. Double check you're not missing a return statement!`);return t.pipe(gt(((e,t)=>(setTimeout((()=>{throw e}),0),t))))})))};try{Object.defineProperty(n,"name",{value:`combineEpics(${t.map((e=>e.name||"")).join(", ")})`})}catch(e){}return n}function fn(){for(var e=arguments.length,t=new Array(e),o=0;oObject.values(e))))}function yn(e,t){return e.pipe($t(`${Uo}`),mt((e=>e.payload.evt===t)))}function Sn(e,t){return e.pipe($t(`${Ho}`),mt((e=>e.payload.evt===t)))}function bn(e,t){return e.pipe($t(`${Bo}`),mt((e=>e.payload.evt===t)))}function En(e,t){return e.pipe($t(`${Uo}`,`${Ho}`),mt((e=>e.payload.evt===t)))}function In(e,t){return e.pipe($t(`${Qo}`),mt((e=>Array.isArray(t)?t.indexOf(e.payload.type)>-1:e.payload.type===t)))}function An(e,t){return e.pipe($t(`${Jo}`),mt((()=>{const{media:{assetsPath:e,mediaConstraints:o}}=t.value;return void 0!==e&&void 0!==o})),_t((()=>{const{media:{isMediaAgentInitialized:o}}=t.value;return o?Ue([0]):e.pipe($t(`${pn}`),mt((e=>!!e.payload)),ft(1))})))}const Cn="3.7.5",_n=Cn,wn="function"==typeof atob,Rn="function"==typeof btoa,On="function"==typeof Buffer,Tn="function"==typeof TextDecoder?new TextDecoder:void 0,Dn="function"==typeof TextEncoder?new TextEncoder:void 0,Pn=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),kn=(e=>{let t={};return Pn.forEach(((e,o)=>t[e]=o)),t})(),Mn=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Ln=String.fromCharCode.bind(String),Nn="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Vn=e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")),Un=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),jn=e=>{let t,o,n,r,i="";const s=e.length%3;for(let s=0;s255||(n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=o<<16|n<<8|r,i+=Pn[t>>18&63]+Pn[t>>12&63]+Pn[t>>6&63]+Pn[63&t]}return s?i.slice(0,s-3)+"===".substring(s):i},Bn=Rn?e=>btoa(e):On?e=>Buffer.from(e,"binary").toString("base64"):jn,xn=On?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let o=0,n=e.length;ot?Vn(xn(e)):xn(e),Hn=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Ln(192|t>>>6)+Ln(128|63&t):Ln(224|t>>>12&15)+Ln(128|t>>>6&63)+Ln(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Ln(240|t>>>18&7)+Ln(128|t>>>12&63)+Ln(128|t>>>6&63)+Ln(128|63&t)},$n=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Wn=e=>e.replace($n,Hn),Gn=On?e=>Buffer.from(e,"utf8").toString("base64"):Dn?e=>xn(Dn.encode(e)):e=>Bn(Wn(e)),zn=(e,t=!1)=>t?Vn(Gn(e)):Gn(e),Kn=e=>zn(e,!0),qn=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Jn=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Ln(55296+(t>>>10))+Ln(56320+(1023&t));case 3:return Ln((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Ln((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Qn=e=>e.replace(qn,Jn),Zn=e=>{if(e=e.replace(/\s+/g,""),!Mn.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,o,n,r="";for(let i=0;i>16&255):64===n?Ln(t>>16&255,t>>8&255):Ln(t>>16&255,t>>8&255,255&t);return r},Yn=wn?e=>atob(Un(e)):On?e=>Buffer.from(e,"base64").toString("binary"):Zn,Xn=On?e=>Nn(Buffer.from(e,"base64")):e=>Nn(Yn(e).split("").map((e=>e.charCodeAt(0)))),er=e=>Xn(or(e)),tr=On?e=>Buffer.from(e,"base64").toString("utf8"):Tn?e=>Tn.decode(Xn(e)):e=>Qn(Yn(e)),or=e=>Un(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),nr=e=>tr(or(e)),rr=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),ir=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,rr(t));e("fromBase64",(function(){return nr(this)})),e("toBase64",(function(e){return zn(this,e)})),e("toBase64URI",(function(){return zn(this,!0)})),e("toBase64URL",(function(){return zn(this,!0)})),e("toUint8Array",(function(){return er(this)}))},sr=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,rr(t));e("toBase64",(function(e){return Fn(this,e)})),e("toBase64URI",(function(){return Fn(this,!0)})),e("toBase64URL",(function(){return Fn(this,!0)}))},ar={version:Cn,VERSION:_n,atob:Yn,atobPolyfill:Zn,btoa:Bn,btoaPolyfill:jn,fromBase64:nr,toBase64:zn,encode:zn,encodeURI:Kn,encodeURL:Kn,utob:Wn,btou:Qn,decode:nr,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:Fn,toUint8Array:er,extendString:ir,extendUint8Array:sr,extendBuiltins:()=>{ir(),sr()}};function ur(e){return ar.encode(e,!0)}function dr(e){return ar.decode(e)}function lr(e){return ar.encode(e,!1)}const cr={"-":"+",_:"/",".":"="};function pr(e){const t=e.replace(/[-_.]/g,(e=>cr[e]));return Uint8Array.from(window.atob(t),(e=>e.charCodeAt(0)))}const hr=e=>{const t=e.charCodeAt(0);return t<=parseInt("0x7F",16)?1:t<=parseInt("0x7FF",16)?2:t<=parseInt("0xFFFF",16)?3:t<=parseInt("0x1FFFFF",16)?4:t<=parseInt("0x3FFFFFF",16)?5:6},mr=(e,t)=>{const o=e.split(".").map((e=>Number(e))).slice(0,3),n=t.split(".").map((e=>Number(e))).slice(0,3);let r=0;for(let e=0;e<3;e++){const t=ei){r=1;break}}return r},vr=e=>{var t;let o=(new Date).getTime(),n=1e3*(null===(t=performance)||void 0===t?void 0:t.now())||0;const r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{let t=16*Math.random();return o>0?(t=(o+t)%16|0,o=Math.floor(o/16)):(t=(n+t)%16|0,n=Math.floor(n/16)),("x"===e?t:3&t|8).toString(16)}));return"string"==typeof e||"number"==typeof e?r+":"+e:r+""};function gr(e,t){if(e===t)return!0;if(!e||!t)return!1;const o=Object.keys(e),n=Object.keys(t),r=o.length;if(n.length!==r)return!1;for(let n=0;ne>>10==t>>10,yr=(e,t)=>new Promise((o=>{setTimeout((()=>{o(e())}),t)})),Sr=e=>{const t=`${Math.floor(1e4*Math.random())}`;return e.indexOf("@")>-1?e.replace("@",t):`${e}${t}`},br=e=>{try{const t=new URL(e);return!("data:"===t.protocol&&"null"===t.origin)&&t.origin!==location.origin}catch(e){return!0}},Er=e=>{const t=e.split(".")[1];if("string"==typeof t){let o=t.replace(/-/g,"+").replace(/_/g,"/");switch(o.length%4){case 0:break;case 2:o+="==";break;case 3:o+="=";break;default:throw new Error("base64 string is not of the correct length")}try{const e=decodeURIComponent(window.atob(o).replace(/(.)/g,(function(e,t){let o=t.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o})));return JSON.parse(e)}catch(e){console.error("Invalid token specified: invalid base64")}}};function Ir(e){return e&&e.endsWith("/")?e.slice(0,e.length-1):e}function Ar(e){return[...new Uint8Array(e)].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Cr(e){return`${e.tagName}${e.id?`#${e.id}`:""}${e.className?`${e.className.split(" ").map((e=>`.${e}`)).join("")}`:""}`}function _r(e){const t=function(e){const t=e&&e.getRootNode();if(t&&"#document"!==t.nodeName&&t.host)return Cr(t.host)}(e);return`${t?`${t}>`:""}${Cr(e)}`}function wr(e){return"object"==typeof e&&null!==e?e instanceof HTMLElement?_r(e):ArrayBuffer.isView(e)?Ar(e.buffer):Array.isArray(e)?e.map((e=>wr(e))):Object.keys(e).reduce(((t,o)=>({...t,[`${o}`]:wr(e[o])})),{}):e}let Rr=function(e){return e[e.Success=0]="Success",e[e.MeetingIsOver=6]="MeetingIsOver",e[e.UserFull=9]="UserFull",e[e.MeetingLocked=9]="MeetingLocked",e[e.WebinarBlockedEmail=3033]="WebinarBlockedEmail",e[e.MeetingNotStarted=3008]="MeetingNotStarted",e[e.MeetingHasClosed=103003]="MeetingHasClosed",e[e.UserHasBeenRemoved=103039]="UserHasBeenRemoved",e[e.MMRIBReject=103043]="MMRIBReject",e[e.MMRConfParticipantExists=103044]="MMRConfParticipantExists",e}({}),Or=function(e){return e[e.Unknown=0]="Unknown",e[e.Normal=1]="Normal",e[e.Userrequest=2]="Userrequest",e[e.SdkConnection=3]="SdkConnection",e[e.Reconnect=5]="Reconnect",e[e.PtRequest=6]="PtRequest",e[e.KickedByHost=7]="KickedByHost",e[e.EndByHost=8]="EndByHost",e[e.EndByHostStartAnotherMeeting=9]="EndByHostStartAnotherMeeting",e[e.FreeMeetingTimeout=10]="FreeMeetingTimeout",e[e.JBHTimeout=11]="JBHTimeout",e[e.EndBySingleStatus=12]="EndBySingleStatus",e[e.WebinarNeedRegister=13]="WebinarNeedRegister",e[e.ArchiveFail=14]="ArchiveFail",e[e.EndByNone=15]="EndByNone",e[e.EndByAdmin=16]="EndByAdmin",e[e.DuplicateSession=17]="DuplicateSession",e[e.MeetingTransfer=18]="MeetingTransfer",e}({}),Tr=function(e){return e[e.WaitingRoomFailover=1]="WaitingRoomFailover",e[e.WebEndAndRejoin=2]="WebEndAndRejoin",e}({}),Dr=function(e){return e[e.Success=0]="Success",e[e.CommonError=200]="CommonError",e[e.WrongPasscode=3004]="WrongPasscode",e[e.RoleTypeMissing=3010]="RoleTypeMissing",e[e.InvalidParameter=4003]="InvalidParameter",e}({}),Pr=function(e){return e[e.Success=0]="Success",e[e.AnotherMeetingInProgress=3e3]="AnotherMeetingInProgress",e[e.MeetingNotExist=3001]="MeetingNotExist",e[e.NotHost=3003]="NotHost",e[e.WrongPasscode=3004]="WrongPasscode",e[e.MissingEmail=3005]="MissingEmail",e[e.MeetingNotStarted=3008]="MeetingNotStarted",e[e.UserHasBeenRemoved=3009]="UserHasBeenRemoved",e[e.RoleTypeMissing=3010]="RoleTypeMissing",e[e.WebinarEnforceLogin=3034]="WebinarEnforceLogin",e[e.RealNameMissing=3082]="RealNameMissing",e[e.RegisterRequired=3099]="RegisterRequired",e[e.SsoLoginWindow=6024]="SsoLoginWindow",e[e.ZoomLoginWindow=3051]="ZoomLoginWindow",e[e.ZoomSpecificLoginWindow=3052]="ZoomSpecificLoginWindow",e[e.LoginRequired=3100]="LoginRequired",e[e.Reconnecting=4e3]="Reconnecting",e[e.Disconnect=4001]="Disconnect",e[e.InvalidParameter=4003]="InvalidParameter",e[e.DeniedRegisterWithPanelist=3032]="DeniedRegisterWithPanelist",e[e.ServiceOffline=403]="ServiceOffline",e[e.RwcEmpty=3621]="RwcEmpty",e[e.RwcError=3622]="RwcError",e[e.FrequentCall=3633]="FrequentCall",e[e.FrequentJoin=3634]="FrequentJoin",e[e.WasmFail=3635]="WasmFail",e[e.CommonError=200]="CommonError",e[e.Upgrade=1e4]="Upgrade",e}({});Pr.Success,Pr.RegisterRequired,Pr.LoginRequired,Pr.SsoLoginWindow,Pr.ZoomLoginWindow,Pr.ZoomSpecificLoginWindow,Pr.MissingEmail,Pr.MeetingNotExist,Pr.NotHost,Pr.WrongPasscode,Pr.RoleTypeMissing,Pr.AnotherMeetingInProgress,Pr.MeetingNotStarted,Pr.InvalidParameter,Pr.Reconnecting,Pr.UserHasBeenRemoved,Pr.WebinarEnforceLogin,Pr.Disconnect,Pr.DeniedRegisterWithPanelist,Pr.RwcEmpty,Pr.RwcError,Pr.FrequentCall,Pr.FrequentJoin,Pr.WasmFail,Pr.Upgrade;const kr={3004:{"apac.errorcodes_pac_mn_wrong":3714},3005:{"apac.errorcodes_web_has_in_progress":3e3},3008:{"apac.errorcodes_not_start":3008},3027:{"apac.errorcodes_host_email_as_attendee":3627},3033:{"apac.errorcodes_denied_email":3620},1005:{"apac.errorcodes_no_response_from_web":3621},131005:{"apac.errorcodes_no_response_from_web":3621},1001:{"apac.errorcodes_host_inactive":3625},131001:{"apac.errorcodes_host_inactive":3625},131013:{"meeting ended":4004},103039:{"apac.errorcodes_be_removed":3009},6:{"meeting ended":4004},9:{"meeting is at capacity":4005},12:{"meeting locked":4006},103043:{"reject for information barriers":4007},103044:{"participant exist":4008}};function Mr(e,t){let o={code:200,i18nKey:"apac.errorcodes_fail"};if(void 0!==kr[e]){const t=kr[e],n=Object.keys(t)[0];return o={code:t[n],i18nKey:n},{reason:n.startsWith("apac")?"":n,errorCode:o.code}}return{code:200,reason:"connection error"}}const Lr=["bLock","bHoldUponEntry","viewOnly","listenOnlyPhone","bAllowRaiseHand","bAllowAttendeeRename","bBroadcast","bAllowPlayChimeForEnterOrExit","bIbDisableShare","bIbDisableChat","encryptKey","bNoHostTimeOut","bAllowShowCount","bHasAST","bHasRMC","gatewayKey","encryptKey"],Nr={bChime:"bAllowPlayChimeForEnterOrExit",bHasAST:"hasAst",bHasRMC:"hasRmc",topic:e=>({meetingTopic:dr(e)}),gatewayKey:e=>{const[,t,o]=e.split(".");return t&&o?{gatewayUser:{userId:Number(t),sn:o}}:{}},encryptKey:e=>({gcmSessinKey:pr(e)})},Vr=so("GET_MEETING_INFO"),Ur=so("GET_INSTANT_MEETING_INFO");so("LOGON_ZOOM_DOMAIN"),so("VERIFY_ZOOM_RECAPTCHA"),so("LOGON_THIRD_PARTY_DOMAIN");const jr=so("PING_RWC_SERVER"),Br=so("MEETING_FAILOVER"),xr=so("LEAVE_MEETING"),Fr=so("LEAVE_WAITING_ROOM"),Hr=so("END_MEETING");so("REGISTER_WEBINAR");const $r=so("TRIGGER_IDLE_CHECK"),{setMeetingInfo:Wr,setMeetingJoinInfo:Gr,setWindownOpen:zr,setAppidSignature:Kr,setZtk:qr,setZsk:Jr,setTkMtkguid:Qr,setPingRwcTimestamp:Zr,setInMeetingInfo:Yr,setMeetingAttribute:Xr,resetMeeting:ei,setIsHost:ti,setIsCohost:oi,setMeetingIsOnHold:ni,setIsMeetingReset:ri,setAudioVideoBeforeOnHold:ii,setCurrentUserAudioBeforeReset:si,setIsCurrentUserMutedBeforeReset:ai,setMeetingStatus:ui,setMeetingRegion:di,setIsCurrentUserStartVideoBeforeReset:li,setJoinMeetingTimeStamp:ci,setActiveAppInfo:pi,setMeetingIdleStartTime:hi,setSessionIdleTimeoutMinutes:mi,setIsAudioBridgeEnabled:vi,addDiscardedRwcHost:gi,setSharePronounType:fi,setIsStayAwakeDuringTheSession:yi,setMeetingJoinSuccessTimestamp:Si,resetFailoverRecord:bi,setFailoverReason:Ei,setIsQuicklyLeaveMeetingAfterRefresh:Ii,setMeetingInfoTimestamp:Ai,setIsEnableZmkFromRwg:Ci}=Ro({SET_MEETING_INFO:e=>e,SET_MEETING_JOIN_INFO:e=>e,SET_WINDOWN_OPEN:e=>e,SET_APPID_SIGNATURE:e=>e,SET_ZTK:e=>e,SET_ZSK:e=>e,SET_TK_MTKGUID:e=>e,SET_PING_RWC_TIMESTAMP:e=>e,SET_IN_MEETING_INFO:e=>e,SET_MEETING_ATTRIBUTE:e=>{if(Lr.some((t=>e&&void 0!==e[t]))){let t=e;return Object.keys(Nr).some((t=>void 0!==e[t]))&&(t=Object.keys(e).reduce(((t,o)=>{const n=Nr[o];return"function"==typeof n?Object.assign(t,n(e[o])):"string"==typeof n?t[n]=e[o]:(t[o],e[o]),t}),{})),t}return{}},SET_IS_HOST:e=>e&&e.bHost,SET_IS_COHOST:e=>e&&e.bCoHost,RESET_MEETING:e=>e,SET_MEETING_IS_ON_HOLD:e=>e,SET_IS_MEETING_RESET:e=>e,SET_AUDIO_VIDEO_BEFORE_ON_HOLD:e=>e,SET_CURRENT_USER_AUDIO_BEFORE_RESET:e=>e,SET_IS_CURRENT_USER_MUTED_BEFORE_RESET:e=>e,SET_MEETING_STATUS:e=>e,SET_MEETING_REGION:e=>e,SET_IS_CURRENT_USER_START_VIDEO_BEFORE_RESET:e=>e,SET_JOIN_MEETING_TIME_STAMP:e=>e,SET_ACTIVE_APP_INFO:e=>e,SET_MEETING_IDLE_START_TIME:e=>e,SET_SESSION_IDLE_TIMEOUT_MINUTES:e=>e,SET_IS_AUDIO_BRIDGE_ENABLED:e=>e,ADD_DISCARDED_RWC_HOST:e=>e,SET_SHARE_PRONOUN_TYPE:e=>e,SET_IS_STAY_AWAKE_DURING_THE_SESSION:e=>e,SET_MEETING_JOIN_SUCCESS_TIMESTAMP:e=>e,RESET_FAILOVER_RECORD:e=>e,SET_FAILOVER_REASON:e=>e,SET_IS_QUICKLY_LEAVE_MEETING_AFTER_REFRESH:e=>e,SET_MEETING_INFO_TIMESTAMP:e=>e,SET_IS_ENABLE_ZMK_FROM_RWG:e=>e});let _i=function(e){return e.Failover="failover",e.OnHold="on hold",e.Promote="promote",e.Depromote="depromote",e.JoinBreakoutRoom="join breakout room",e.MoveToBreakoutRoom="move to breakout room",e.BackToMainSession="back to main session",e}({});const wi="js_media.min.js";let Ri=function(e){return e.CDN="CDN",e.Global="Global",e.CN="CN",e}({}),Oi=function(e){return e.Connected="Connected",e.Reconnecting="Reconnecting",e.Closed="Closed",e.Fail="Fail",e}({}),Ti=function(e){return e.Initial="initial",e.Joined="joined",e.Closed="closed",e}({}),Di=function(e){return e.AudioBridgeEnable="M:1,2;V:1,2",e.AudioDecodeInWorklet="M:6;V:3",e.VideoFullHD="M:8;V:4",e.VideoShareFullHD="M:9;V:5",e.WebGL2Render="M:20;V:8",e.WebGPURender="M:21;V:9",e.ZMKFromRWG="M:19;V:10",e}({}),Pi=function(e){return e[e.NormalCase=-1]="NormalCase",e[e.NoHeartbeat=0]="NoHeartbeat",e[e.NoHeartbeatMChannel=1]="NoHeartbeatMChannel",e[e.NetworkChange=2]="NetworkChange",e[e.NotifyUiFailover=3]="NotifyUiFailover",e[e.InvalidParameters=4]="InvalidParameters",e[e.OnError=5]="OnError",e[e.OnErrorMChannel=6]="OnErrorMChannel",e[e.Disconnect=7]="Disconnect",e[e.DisconnectMChannel=8]="DisconnectMChannel",e[e.DisconnectXmpp=9]="DisconnectXmpp",e[e.RefreshPage=10]="RefreshPage",e}({});const ki=["8-29","9-21"];let Mi=function(e){return e.LocalStorage="LocalStorage",e.SessionStorage="SessionStorage",e.Memory="Memory",e}({});const Li=ur("{}");class Ni{constructor(e){this.sessionStorageKey=void 0,this.localStorageKey=void 0,this.sessionCache=void 0,this.localCache=void 0,this.memoryCache=void 0,this.sessionStorageKey=ur(`zoom-storage-${e}`),this.localStorageKey=ur("zoom-local-storage"),this.memoryCache={};try{this.sessionCache=JSON.parse(dr(sessionStorage.getItem(this.sessionStorageKey)||Li)),this.localCache=JSON.parse(dr(localStorage.getItem(this.localStorageKey)||Li))}catch(e){console.error(e),this.sessionCache={},this.localCache={}}}static init(e){this.instance=new Ni(e)}static get(e){if(void 0===this.instance)throw new Error("read before initial");return this.instance.getValue(e).value}static set(e,t,o){if(void 0===this.instance)throw new Error("set before initial");return this.instance.setValue(e,t,o)}static remove(e){if(void 0===this.instance)throw new Error("remove before initial");return this.instance.removeValue(e)}static clearSession(){if(void 0===this.instance)throw new Error("clear before initial");return this.instance.memoryCache={},this.instance.sessionCache={},this.instance.localCache={},sessionStorage.removeItem(this.instance.sessionStorageKey)}getValue(e){return this.sessionCache.hasOwnProperty(e)?{value:this.sessionCache[e],type:Mi.SessionStorage}:this.localCache.hasOwnProperty(e)?{value:this.localCache[e],type:Mi.LocalStorage}:{value:this.memoryCache[e],type:Mi.Memory}}setValue(e,t,o){if(!e)throw new Error("key is null");switch(o){case Mi.SessionStorage:{const o=this.sessionCache[e];let n=t;return"function"==typeof t&&(n=t(o)),o!==n&&(this.sessionCache[e]=n,this.flushValue(Mi.SessionStorage)),n}case Mi.LocalStorage:{const o=this.localCache[e];let n=t;return"function"==typeof t&&(n=t(o)),o!==n&&(this.localCache[e]=n,this.flushValue(Mi.LocalStorage)),n}case Mi.Memory:{const o=this.memoryCache[e];let n=t;return"function"==typeof t&&(n=t(o)),this.memoryCache[e]=n,n}default:return null}}removeValue(e){const{type:t}=this.getValue(e);switch(t){case Mi.SessionStorage:delete this.sessionCache[e],this.flushValue(Mi.SessionStorage);break;case Mi.LocalStorage:delete this.localCache[e],this.flushValue(Mi.LocalStorage);break;case Mi.Memory:delete this.memoryCache[e]}}flushValue(e){e===Mi.SessionStorage?sessionStorage.setItem(this.sessionStorageKey,ur(JSON.stringify(this.sessionCache))):e===Mi.LocalStorage&&localStorage.setItem(this.localStorageKey,ur(JSON.stringify(this.localCache)))}}Ni.instance=void 0;let Vi=function(e){return e.WebclientOpt="WEB_CLIENT_OPT",e.WebclientWebinarToken="WEB_CLIENT_WEBINAR_TOKEN",e.WebclientMeetingToken="WEB_CLIENT_MEETING_TOKEN",e.WebclientZtk="WEB_CLIENT_ZTK",e.WebclientZsk="WEB_CLIENT_ZSK",e.WebclientTk="WEB_CLIENT_TK",e.WebclientIVState="WEB_CLIENT_IV_STATE",e.WebclientIsOnHold="WEB_CLIENT_IS_ON_HOLD",e.WebclientParticipantId="WEB_CLIENT_PARTICIPANT_ID",e.WebclientZoomId="WEB_CLIENT_ZOOM_ID",e.WebclientUserName="WEB_CLIENT_USER_NAME",e.WebclientUserEmail="WEB_CLIENT_USER_EMAIL",e.WebclientBreakoutRoomAttendeeStatus="WEB_CLIENT_BO_ATTENDEE_STATUS",e.WebclientBreakoutRoomCommand="WEB_CLIENT_BO_COMMAND",e.WebclientAudioEncryptKey="WEB_CLIENT_AUDIO_ENCRYPT_KEY",e.WebclientVideoEncryptKey="WEB_CLIENT_VIDEO_ENCRYPT_KEY",e.WebclientSharingEncryptKey="WEB_CLIENT_SHARING_ENCRYPT_KEY",e.WebclientFailoverCount="WEB_CLIENT_FAILOVER_COUNT",e.WebclientRecordingToken="WEB_CLIENT_RECORDING_TOKEN",e}({}),Ui=function(e){return e.WebclientDeviceId="WEBCLIENT_DEVICE_ID",e.VSDKLogTrackingId="ZM_VSDK_LOG_TRACKING_IDS",e}({}),ji=function(e){return e.EnforceWebRTCAudio="ENFORCE_WEB_RTC_AUDIO",e.DisableAutoReportLogs="DISABLE_AUTO_REPORT_LOGS",e}({});function Bi(e,t){const o=t.match(e);return o&&o.length>0&&o[1]||""}function xi(e,t){const o=t.match(e);return o&&o.length>1&&o[2]||""}const Fi=/version\/(\d+(\.?_?\d+)+)/i,Hi=[{test:[/opera/i],describe:e=>["Opera(Legacy)",Bi(Fi,e)||Bi(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/opr\/|opios/i],describe:e=>["Opera",Bi(/(?:opr|opios)[\s/](\S+)/i,e)||Bi(Fi,e)]},{test:[/SamsungBrowser/i],describe:e=>["Samsung Internet for Android",Bi(Fi,e)||Bi(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/micromessenger/i],describe:e=>["WeChat",Bi(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||Bi(Fi,e)]},{test:[/qqbrowser/i],describe:e=>[/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser",Bi(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||Bi(Fi,e)]},{test:[/msie|trident/i],describe:e=>["Internet Explorer",Bi(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e)]},{test:[/\sedg\//i],describe:e=>["Microsoft Edge",Bi(/\sedg\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/edg([ea]|ios)/i],describe:e=>["Microsoft Edge(Legacy)",xi(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/firefox|iceweasel|fxios/i],describe:e=>["Firefox",Bi(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/electron/i],describe:e=>["Electron",Bi(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/chromium/i],describe:e=>["Chromium",Bi(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||Bi(Fi,e)]},{test:[/chrome|crios|crmo/i],describe:e=>["Chrome",Bi(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e)]},{test:e=>!/like android/i.test(e)&&/android/i.test(e),describe:e=>["Android Browser",Bi(Fi,e)]},{test:[/safari|applewebkit/i],describe:e=>["Safari",Bi(Fi,e)]}],$i=[{test:[/windows /i],describe:e=>["Windows",Bi(/Windows ((NT|XP)( \d\d?.\d)?)/i,e)]},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:e=>["iOS",xi(/(Version\/)(\d[\d.]+)/,e)]},{test:[/macintosh/i],describe:e=>["macOS",Bi(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,".")]},{test:[/(ipod|iphone|ipad)/i],describe:e=>["iOS",Bi(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".")]},{test:e=>!/like android/i.test(e)&&/android/i.test(e),describe:e=>["Android",Bi(/android[\s/-](\d+(\.\d+)*)/i,e)]},{test:[/linux/i],describe:()=>["Linux"]},{test:[/CrOS/],describe:()=>["Chrome OS"]}];class Wi{constructor(){this.value=void 0,this.gpu=void 0}get isSupported(){if(void 0===this.value)if("function"==typeof window.OffscreenCanvas){const e=new OffscreenCanvas(1,1);e.addEventListener("webglcontextlost",(e=>{e.preventDefault()}));const t=e.getContext("webgl");if(this.value=!!t,t){const e=t.getExtension("WEBGL_debug_renderer_info");e&&(this.gpu=t.getParameter(e.UNMASKED_RENDERER_WEBGL))}}else this.value=!1;return this.value}}const Gi=new class{constructor(){this._browser=void 0,this._os=void 0,this._browserVersion=void 0,this._osVersion=void 0,this._offscreenCanvasCapality=void 0,this._clientHintsData=void 0,this._offscreenCanvasCapality=new Wi,"userAgentData"in navigator&&navigator.userAgentData.getHighEntropyValues(["architecture","bitness","formFactor","model","platformVersion","wow64"]).then((e=>{this._clientHintsData=e,this._os&&this._osVersion&&this._clientHintsData.platform&&this._clientHintsData.platformVersion&&(this._os=this._clientHintsData.platform,this._osVersion=this._clientHintsData.platformVersion)})).catch((e=>{console.warn(e)}))}_getBrowserVersion(){var e,t;if(null!==(e=this._clientHintsData)&&void 0!==e&&null!==(t=e.brands)&&void 0!==t&&t.length){const e=this._clientHintsData.brands.filter((e=>!/(Chromium|Not.*Brand)/i.test(e.brand)))[0];e&&(this._browser=e.brand);const t=this._clientHintsData.brands.find((e=>{var t;return"chromium"===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())}));t?(this._browserVersion=t.version,this._browser||(this._browser=t.brand)):this._browserVersion=e.version}else{const e=navigator.userAgent,t=Hi.find((t=>"function"==typeof t.test?t.test(e):t.test.some((t=>t.test(e)))));if(t){const o=t.describe(e);this._browser=o[0],this._browserVersion=o[1],this.isIOSMobile&&(this._browser="ios-safari")}else this._browser="unknown",this._browserVersion="0"}}_getOSVersion(){var e,t;if(null!==(e=this._clientHintsData)&&void 0!==e&&e.platform&&null!==(t=this._clientHintsData)&&void 0!==t&&t.platformVersion)this._os=this._clientHintsData.platform,this._osVersion=this._clientHintsData.platformVersion;else{const e=navigator.userAgent,t=$i.find((t=>"function"==typeof t.test?t.test(e):t.test.some((t=>t.test(e)))));if(t){const o=t.describe(e);this._os=o[0],this._osVersion=o[1]}else this._os="unknown",this._osVersion="0"}}get browser(){return this._browser||this._getBrowserVersion(),this._browser}get browserVersion(){return this._browserVersion||this._getBrowserVersion(),this._browserVersion}get os(){return this._os||this._getOSVersion(),this._os}get osVersion(){return this._osVersion||this._getOSVersion(),this._osVersion}get isIE(){return"Internet Explorer"===this.browser}get isLegacyEdge(){return"Microsoft Edge(Legacy)"===this.browser}get isLegacyOpera(){return"Opera(Legacy)"===this.browser}get isFirefox(){return"Firefox"===this.browser}get isSafari(){return"Safari"===this.browser}get isChrome(){var e,t,o;if(null!==(e=this._clientHintsData)&&void 0!==e&&null!==(t=e.brands)&&void 0!==t&&t.length)return null===(o=this._clientHintsData)||void 0===o?void 0:o.brands.some((e=>{var t;return"chromium"===(null===(t=e.brand)||void 0===t?void 0:t.toLocaleLowerCase())}));const{userAgent:n}=navigator;return!this.isLegacyOpera&&!this.isLegacyEdge&&/chrome/i.test(n)&&/webkit/i.test(n)}get isLegacyChrome(){var e;return this.isChrome&&"function"!=typeof(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getDisplayMedia)}get isMacOS(){return"macOS"===this.os}get isIPad(){var e;return/iPad/i.test(navigator.userAgent)||this.isMacOS&&(null===(e=navigator)||void 0===e?void 0:e.maxTouchPoints)>2}get isIOSMobile(){return"iOS"===this.os||this.isIPad}get architecture(){var e,t;return null!==(e=null===(t=this._clientHintsData)||void 0===t?void 0:t.architecture)&&void 0!==e?e:""}get isArm(){return this.architecture?"arm"===this.architecture:/arm/i.test(navigator.userAgent)}get isChromeOS(){return"Chrome OS"===this.os}get isAndroidBrowser(){var e;return"android"===(null===(e=this.os)||void 0===e?void 0:e.toLowerCase())}get isArmChromeOS(){return this.isArm&&this.isChromeOS}get isAndroidOrIOSBrowser(){return this.isAndroidBrowser||this.isIOSMobile}get isSupportEssentialAudioAndVideoAbility(){return"object"==typeof WebAssembly&&"function"==typeof Worker}get isSupportAudioWorklet(){return"function"==typeof AudioWorklet}get isSupportImageCapture(){return"ImageCapture"in window}get isSupportMediaStreamTrackProcessor(){return"MediaStreamTrackProcessor"in window}get isSupportOffscreenCanvas(){return this._offscreenCanvasCapality.isSupported}get gpu(){return this._offscreenCanvasCapality.isSupported?this._offscreenCanvasCapality.gpu:""}get bitness(){var e,t;return null!==(e=null===(t=this._clientHintsData)||void 0===t?void 0:t.bitness)&&void 0!==e?e:""}get model(){var e,t;return null!==(e=null===(t=this._clientHintsData)||void 0===t?void 0:t.model)&&void 0!==e?e:""}get wow64(){var e;if("windows"===this.os.toLowerCase())return null===(e=this._clientHintsData)||void 0===e?void 0:e.wow64}get isSupportSendScreenSharing(){return"getDisplayMedia"in navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia}};function zi(){return Gi.isAndroidOrIOSBrowser||!!Ni.get(ji.EnforceWebRTCAudio)}const Ki=()=>Gi.isIE,qi=()=>{var e;return Gi.isSupportOffscreenCanvas&&(null===(e=navigator)||void 0===e?void 0:e.hardwareConcurrency)>=4&&"function"==typeof requestAnimationFrame&&"function"==typeof SharedArrayBuffer},Ji=(e,t)=>{var o;const{isSafari:n,isIOSMobile:r,isSupportMediaStreamTrackProcessor:i,isAndroidOrIOSBrowser:s,isArmChromeOS:a,isChromeOS:u,isArm:d,isSupportOffscreenCanvas:l,isIPad:c}=Gi;if(!qi()){const o=n||r,s="function"!=typeof window.SharedArrayBuffer&&(!!o||i&&l);return e&&s?t?25:4:1}return s?t?25:c?9:4:a||u&&!d?navigator.hardwareConcurrency>=4?9:4:(null===(o=navigator)||void 0===o?void 0:o.hardwareConcurrency)<4?9:25};function Qi(){var e;return"webkit"in window&&!("chrome"in window)&&!(null===(e=window.webkit.messageHandlers)||void 0===e||!e.jsOCHelper)}function Zi(){var e;const{isAndroidBrowser:t,isIOSMobile:o,osVersion:n,browserVersion:r,isChrome:i,isFirefox:s,isSafari:a}=Gi;var u,d;if(o)return Number(null===(u=n.match(/^\d+/))||void 0===u?void 0:u[0])>=15;if(t)return Number(null===(d=n.match(/^\d+/))||void 0===d?void 0:d[0])>=10;const l=Number(null===(e=r.match(/^\d+/))||void 0===e?void 0:e[0]);return!!(i&&l>=69)||!!(a&&l>14)||!!(s&&l>=76)}let Yi=function(e){return e.VIDEO_ENCODE="0",e.VIDEO_DECODE="1",e.AUDIO_ENCODE="2",e.AUDIO_DECODE="3",e.SHARING_ENCODE="4",e.SHARING_DECODE="5",e}({}),Xi=function(e){return e[e.NONE=0]="NONE",e[e.AES_256=1]="AES_256",e[e.AES_GCM=2]="AES_GCM",e}({});const es=Object.freeze({RWG_CHAT:{gcmType:1,sessionType:"RWG_CHAT"},XMPP_CHAT:{gcmType:1,sessionType:"XMPP_CHAT"},CC_MESSAGE:{gcmType:3,sessionType:"CC_MESSAGE"},BO_BROADCAST:{gcmType:1,sessionType:"BO_BROADCAST"},CHAT_FILE:{gcmType:2,sessionType:"CHAT_FILE"},CHAT_FILE_INFO:{gcmType:1,sessionType:"CHAT_FILE_INFO"}}),ts=(window.crypto||window.msCrypto).subtle,os=Vi.WebclientIVState,ns=Object.keys(es).map((e=>es[e].sessionType));class rs{constructor(e,t,o){this.isGCMEnabled=void 0,this.gcmSessionKey=void 0,this.gcmMainSessionKey=void 0,this.zoomId=void 0,this.resetParameters(e,t,o),Ni.set(os,{},Mi.SessionStorage)}static init(e,t,o){this.instance?this.instance.resetParameters(e,t,o):this.instance=new rs(e,t,o)}static destroy(){this.instance&&(this.instance=void 0)}resetParameters(e,t,o){this.isGCMEnabled=!(Gi.isIE||!Gi.isSupportEssentialAudioAndVideoAbility)&&o===Xi.AES_GCM,this.gcmSessionKey=pr(t),this.gcmMainSessionKey||(this.gcmMainSessionKey=this.gcmSessionKey),this.zoomId=String(e)}beginCrypto(e,t,o){const n=new Uint32Array(1);n[0]=9,n[0]+=Number(o);const r=new Uint8Array(n.buffer);let i=new Uint8Array(132);const s=pr(t);return i.set(s,0),i.set(r,s.length),i=i.subarray(0,s.length+4),ts.importKey("raw",e,{name:"HMAC",hash:"SHA-256"},!0,["sign"]).then((e=>ts.sign({name:"HMAC"},e,i))).then((e=>ts.importKey("raw",e,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"])))}getNextIV(e){const t=Ni.get(os);return void 0===t[e]?(t[e]=0,Ni.set(os,t,Mi.SessionStorage)):Ni.set(os,(t=>({...t,[e]:t[e]+1})),Mi.SessionStorage)}resetIVState(){const e=Ni.get(os);if(void 0===e);else{const t=Object.keys(e).filter((e=>ns.indexOf(e)>-1));t.length>0&&(t.forEach((t=>{e[t]+=1e6})),Ni.set(os,e,Mi.SessionStorage))}}static resetIV(){if(void 0===this.instance)throw new Error("reset before intialize");this.instance.resetIVState()}static beginEncrypt(e){let{text:t,type:o}=e;const n=new Uint8Array(0);if(this.instance&&this.instance.isGCMEnabled){const e=16,r=12,i=this.instance.getNextIV(o.sessionType),s=new ArrayBuffer(r),a=new Uint8Array(s);new DataView(s).setUint32(0,i,!0);let u=null;return u="BO_BROADCAST"===o.sessionType||"XMPP_CHAT"===o.sessionType?this.instance.gcmMainSessionKey:this.instance.gcmSessionKey,this.instance.beginCrypto(u,this.instance.zoomId,o.gcmType).then((o=>{const r=ArrayBuffer.isView(t)?t:(new TextEncoder).encode(t);return ts.encrypt({name:"AES-GCM",iv:a,additionalData:n,tagLength:8*e},o,r)})).then((t=>{const r=1+a.byteLength+2+n.byteLength+4+t.byteLength,i=new ArrayBuffer(r);if(new Uint8Array(i)[0]=a.length,new Uint8Array(i,1,a.byteLength).set(a),new DataView(i).setUint16(1+a.byteLength,n.length,!0),new Uint8Array(i,3+a.byteLength).set(n),new DataView(i).setUint32(1+a.byteLength+2+n.byteLength,t.byteLength-e,!0),new Uint8Array(i,1+a.byteLength+2+n.byteLength+4).set(new Uint8Array(t)),o.sessionType===es.CHAT_FILE.sessionType)return i;const s=new Uint8Array(i).reduce(((e,t)=>e+String.fromCharCode(t)),"");return window.btoa(s).replace(/_/g,"/").replace(/-/g,"+").replace(/\=/g,"")}))}return Promise.resolve(ArrayBuffer.isView(t)?t:ur(t))}static beginDecrypt(e){let{decryptedText:t,type:o,zoomId:n}=e;if(this.instance&&this.instance.isGCMEnabled){const e=ArrayBuffer.isView(t)||t instanceof ArrayBuffer?new Uint8Array(t):function(e){let t;const o=e.length,n=new Array(o);for(t=0;t{const t=function(e,t){e=new Uint8Array(e),t=new Uint8Array(t);const o=new Uint8Array(e.length+t.length);return o.set(e),o.set(t,e.length),o}(c,p);return ts.decrypt({name:"AES-GCM",iv:i,additionalData:u,tagLength:8*p.length},e,t.buffer)})).then((e=>({message:o.sessionType===es.CHAT_FILE.sessionType?e:(new TextDecoder).decode(e),iv:i,aad:u}))).catch((e=>({message:"[This is an encrypted message]",iv:i,aad:u})))}{const e=new TextDecoder("utf-8");return Promise.resolve({message:ArrayBuffer.isView(t)||t instanceof ArrayBuffer?t:e.decode(pr(t))})}}}rs.instance=void 0;const is=20225,ss=20234,as=7937,us=7938,ds=12039,ls=16138,cs=4098,ps=4305,hs=4343,ms=16428;let vs=function(e){return e[e.NoAttendee=0]="NoAttendee",e[e.All=1]="All",e[e.AllPanelist=2]="AllPanelist",e[e.Host=3]="Host",e[e.NoOne=4]="NoOne",e[e.EveryonePublicly=5]="EveryonePublicly",e}({}),gs=function(e){return e[e.AllPanelist=1]="AllPanelist",e[e.Everyone=2]="Everyone",e[e.Invalid=0]="Invalid",e}({}),fs=function(e){return e[e.All=0]="All",e[e.Panelist=1]="Panelist",e[e.IndividualCcPanelist=2]="IndividualCcPanelist",e[e.Individual=3]="Individual",e[e.SilentModeUsers=4]="SilentModeUsers",e}({}),ys=function(e){return e[e.None=0]="None",e[e.Delete=1]="Delete",e[e.Modify=2]="Modify",e}({}),Ss=function(e){return e[e.Success=0]="Success",e[e.Delete=1]="Delete",e[e.Block=3]="Block",e}({});const bs=[vs.All,vs.Host,vs.NoOne,vs.EveryonePublicly],Es=[vs.NoOne,vs.All,vs.AllPanelist],Is={AllPanelist:11,Everyone:12},As={[Is.AllPanelist]:gs.AllPanelist,[Is.Everyone]:gs.Everyone},Cs={userId:fs.All,displayName:"Everyone",isHost:!1,isCoHost:!1},_s={userId:fs.Panelist,displayName:"All panelists"},ws={userId:fs.SilentModeUsers,displayName:"Everyone (in Waiting Room)",isHost:!1,isCoHost:!1};let Rs=function(e){return e[e.Local=0]="Local",e[e.ThirdParty=1]="ThirdParty",e}({}),Os=function(e){return e[e.ChunkSize=20971520]="ChunkSize",e[e.EncodeBlockSize=32768]="EncodeBlockSize",e[e.DecodeBlockSize=32803]="DecodeBlockSize",e[e.MaxSize=2147483648]="MaxSize",e[e.ReaderChunkSize=1073741824]="ReaderChunkSize",e}({}),Ts=function(e){return e[e.Init=0]="Init",e[e.InProgress=1]="InProgress",e[e.Success=2]="Success",e[e.Fail=3]="Fail",e[e.Cancel=4]="Cancel",e[e.Complete=5]="Complete",e}({}),Ds=function(e){return e[e.InProgress=1]="InProgress",e[e.Success=2]="Success",e[e.Fail=3]="Fail",e[e.Cancel=4]="Cancel",e}({});const Ps={"7z":"application/x-7z-compressed",avi:"video/x-msvideo",bin:"application/octet-stream",bmp:"image/bmp",css:"text/css",csv:"text/csv",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",gif:"image/gif",gz:"application/gzip",html:"text/html",ics:"text/calendar",jar:"application/java-archive",jpeg:"image/jpeg",jpg:"image/jpeg",js:"text/javascript",json:"application/json",mid:"audio/midi",mov:"video/*",mp3:"audio/mpeg",mp4:"video/mp4",mpeg:"video/*",mpg:"video/*",pdf:"application/pdf",png:"image/png",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",rar:"application/vnd.rar",rtf:"application/rtf",tar:"application/x-tar",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/wav",webp:"image/webp",wma:"audio/*",wmv:"video/*",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xml:"application/xml",zip:"application/zip"};let ks=function(e){return e.Open="open",e.Message="message",e.Error="error",e.Close="close",e.Inactive="inactive",e}({});class Ms{constructor(){this.eventHandlers=void 0,this.websocket=void 0,this.seq=void 0,this.intervalsToBeCleardWhenSocketClose=[],this.isAlive=!1,this.eventHandlers=new Map,this.websocket=null,this.seq=1}on(e,t){let o=this.eventHandlers.get(e);o||(o=[]),o.push(t),this.eventHandlers.set(e,o)}off(e,t){const o=this.eventHandlers.get(e);if(o){const n=o.filter((e=>e!==t));this.eventHandlers.set(e,n)}}emit(e,t){const o=this.eventHandlers.get(e);o&&o instanceof Array&&o.slice(0).forEach((e=>{try{e(t)}catch(e){console.error(e)}}))}sendMessageToRwg(e){this.seq+=1;const t=this.seq;return this.websocket&&this.websocket.readyState===WebSocket.OPEN&&this.websocket.send(JSON.stringify(Object.assign(e,{seq:t}))),t}connect(e){this.websocket=new WebSocket(e),this.websocket.binaryType="arraybuffer",this.addWebSocketEventListeners()}close(){var e;null===(e=this.websocket)||void 0===e||e.close()}addHeartBeat(){const e=Gi.isAndroidOrIOSBrowser?15e3:2e4,t=setInterval((()=>{this.isAlive||this.emit(ks.Inactive,{}),this.sendMessageToRwg({evt:0}),this.isAlive=!1}),e);this.intervalsToBeCleardWhenSocketClose.push(t)}clearIntervals(){this.intervalsToBeCleardWhenSocketClose.forEach((e=>clearInterval(e))),this.isAlive=!1}addWebSocketEventListeners(){this.websocket&&(this.websocket.addEventListener("open",(e=>{this.addHeartBeat(),this.emit(ks.Open,e)})),this.websocket.addEventListener("message",(e=>{this.isAlive=!0,this.emit(ks.Message,e)})),this.websocket.addEventListener("close",(e=>{this.clearIntervals(),this.emit(ks.Close,e)})),this.websocket.addEventListener("error",(e=>{this.clearIntervals(),this.emit(ks.Error,e)})))}sendLaunchParams(e){return{seq:this.sendMessageToRwg({evt:4301,body:e})}}joinMeeting(e){return{seq:this.sendMessageToRwg({evt:4097,body:{meetingtoken:e}})}}lockMeeting(e){return{seq:this.sendMessageToRwg({evt:4099,body:{bLock:e}})}}endMeeting(){return{seq:this.sendMessageToRwg({evt:4101,body:{}})}}leaveMeeting(){const e=arguments.length>0&&void 0!==arguments[0]&&arguments[0]?4364:4103;return{seq:this.sendMessageToRwg({evt:e,body:{}})}}recordMeeting(e,t){return{seq:this.sendMessageToRwg({evt:4105,body:{bRecord:e,bPause:t}})}}localRecordingGrantPermission(e,t,o){return{seq:this.sendMessageToRwg({evt:hs,body:{cmdType:"permission_request_answer",userId:e,agreed:t,saveAgreed:o}})}}hostGrantPermission(e,t){return{seq:this.sendMessageToRwg({evt:hs,body:{cmdType:"grant_permission",userId:e,grant:t}})}}localRecordingRequestPermission(){return{seq:this.sendMessageToRwg({evt:hs,body:{cmdType:"request_permission"}})}}localRecordingMeeting(e){return{seq:this.sendMessageToRwg({evt:hs,body:{cmdType:"change_recording_status",status:e}})}}summaryMeeting(e){return{seq:this.sendMessageToRwg({evt:8009,body:{type:e?"start":"stop"}})}}startMeetingQuery(e){return{seq:this.sendMessageToRwg({evt:8017,body:{type:e?"start":"stop"}})}}allowSelfRecord(e){return{seq:this.sendMessageToRwg({evt:4325,body:{bAllowISORecord:e}})}}enableZoomIQRecord(e){return{seq:this.sendMessageToRwg({evt:4318,body:{check:e}})}}expel(e){return{seq:this.sendMessageToRwg({evt:4107,body:{id:e}})}}expelAttendee(e){return{seq:this.sendMessageToRwg({evt:4205,body:{jid:e}})}}rename(e,t,o){return{seq:this.sendMessageToRwg({evt:4109,body:{id:e,dn2:t,olddn2:o}})}}assignHost(e,t){return{seq:this.sendMessageToRwg({evt:4111,body:{id:e,bCoHost:t}})}}reclaimHost(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{seq:this.sendMessageToRwg({evt:4133,body:{id:e,bCoHost:t}})}}revokeCoHost(e){return{seq:this.sendMessageToRwg({evt:4195,body:{id:e}})}}putOnHold(e,t){return{seq:this.sendMessageToRwg({evt:4113,body:{id:e,bHold:t}})}}setMuteOnEntry(e){return{seq:this.sendMessageToRwg({evt:4115,body:{bOn:e}})}}setHoldOnEntry(e){return{seq:this.sendMessageToRwg({evt:4117,body:{bOn:e}})}}inviteCRCDevice(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return{seq:this.sendMessageToRwg({evt:4119,body:{ip:e,type:t,encrypt:o}})}}cancelInviteCRCDevice(e){return{seq:this.sendMessageToRwg({evt:4121,body:{transID:e}})}}sendCloseCaption(e){return{seq:this.sendMessageToRwg({evt:4125,body:{...e}})}}allowViewParticipantNumber(e){return{seq:this.sendMessageToRwg({evt:4127,body:{bOn:e}})}}lowerAllHands(){return{seq:this.sendMessageToRwg({evt:4129,body:{}})}}raiseLowerHand(e,t){return{seq:this.sendMessageToRwg({evt:4131,body:{id:e,bOn:t}})}}chat(e,t,o,n){const r={text:e,destNodeID:t};return o&&Object.assign(r,{sn:o}),n&&Object.assign(r,{attendeeNodeID:n}),{seq:this.sendMessageToRwg({evt:4135,body:r})}}assignCC(e,t){return{seq:this.sendMessageToRwg({evt:4137,body:{id:e,bCCEditor:t}})}}enableLT(e){return{seq:this.sendMessageToRwg({evt:4227,body:{op:e?2:4}})}}enableNewLLT(){return{seq:this.sendMessageToRwg({evt:4285})}}disableCaptions(e){return{seq:this.sendMessageToRwg({evt:ps,body:{type:4,disableNewLtt:e}})}}enableManualCaption(e){return{seq:this.sendMessageToRwg({evt:4291,body:{op:e?1:0}})}}setTranslationLanguage(e){return void 0!==e?{seq:this.sendMessageToRwg({evt:ps,body:{type:1,lang:e}})}:{seq:this.sendMessageToRwg({evt:ps,body:{type:3}})}}setSpokenLanguage(e){return{seq:this.sendMessageToRwg({evt:4287,body:{lang:e}})}}allowAskLT(e){return{seq:this.sendMessageToRwg({evt:4263,body:{bAnonymous:e}})}}approveLT(){return{seq:this.sendMessageToRwg({evt:4262,body:{bApproved:!0}})}}askLT(e){return{seq:this.sendMessageToRwg({evt:4261,body:{bAnonymous:e}})}}setChatPriviledge(e){return{seq:this.sendMessageToRwg({evt:4141,body:{chatPriviledge:e}})}}setPanelistChatPrivilege(e){if(!Object.values(Is).includes(e))throw Error("Invalid panelist chat privilege req value");return{seq:this.sendMessageToRwg({evt:4141,body:{chatPriviledge:e}})}}sendFeedback(e){return{seq:this.sendMessageToRwg({evt:4143,body:{feedback:e}})}}clearFeedback(){return{seq:this.sendMessageToRwg({evt:4145,body:{}})}}allowUnmuteVideo(e){return{seq:this.sendMessageToRwg({evt:4147,body:{bOn:e}})}}allowUnmuteAudio(e){return{seq:this.sendMessageToRwg({evt:4149,body:{bOn:e}})}}allowRaiseHand(e){return{seq:this.sendMessageToRwg({evt:4151,body:{bOn:e}})}}boToken(e){return{seq:this.sendMessageToRwg({evt:4173,body:{topic:e}})}}startBO(e){return{seq:this.sendMessageToRwg({evt:4175,body:{proto:e}})}}stopBO(e){return{seq:this.sendMessageToRwg({evt:4177,body:{status:e}})}}assignToBO(e,t){return{seq:this.sendMessageToRwg({evt:4179,body:{targetID:e,targetBID:t}})}}switchBO(e,t){return{seq:this.sendMessageToRwg({evt:4181,body:{targetID:e,targetBID:t}})}}wantJoinBO(e,t){return{seq:this.sendMessageToRwg({evt:4183,body:{targetID:e,targetBID:t}})}}joinBO(e){return{seq:this.sendMessageToRwg({evt:4193,body:{targetBID:e}})}}leaveBO(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return{seq:this.sendMessageToRwg({evt:4185,body:{reason:e}})}}broadcastBO(e){return{seq:this.sendMessageToRwg({evt:4187,body:{textContent:e}})}}askForHelpBO(e){return{seq:this.sendMessageToRwg({evt:4189,body:{targetID:e}})}}askForHelpResultBO(e,t){return{seq:this.sendMessageToRwg({evt:4191,body:{targetID:e,helpResult:t}})}}coHostStartBO(e,t){return{seq:this.sendMessageToRwg({evt:4241,body:{proto:e,targetID:t}})}}coHostStopBO(e,t){return{seq:this.sendMessageToRwg({evt:4243,body:{status:e,targetID:t}})}}coHostAssignToBO(e,t,o){return{seq:this.sendMessageToRwg({evt:4245,body:{userGUID:e,targetID:o,targetBID:t}})}}moveToMainSession(e){return{seq:this.sendMessageToRwg({evt:4247,body:{userGUID:e}})}}coHostMoveToMainSession(e,t){return{seq:this.sendMessageToRwg({evt:4249,body:{userGUID:e,targetID:t}})}}allowParticipantRename(e){return{seq:this.sendMessageToRwg({evt:4163,body:{bOn:e}})}}allowMessageFeedbackNotify(e,t){return{seq:this.sendMessageToRwg({evt:4171,body:{bOn:e,id:t}})}}setPlayChime(e,t){return{seq:this.sendMessageToRwg({evt:4197,body:{bOn:e,id:t}})}}admitAllSilentUsers(){return{seq:this.sendMessageToRwg({evt:4199,body:{}})}}bindTeleUser(e,t,o){return{seq:this.sendMessageToRwg({evt:4201,body:{teleUserID:e,targetUserID:t,bBind:o}})}}practiceSession(){return{seq:this.sendMessageToRwg({evt:4207,body:null})}}roleChangeWebinar(e,t,o,n){return{seq:this.sendMessageToRwg({evt:4209,body:{jid:t,userID:o,clientCap:n,bPromote:e}})}}sendPromoteConsent(e,t){return{seq:this.sendMessageToRwg({evt:4254,body:{agreed:e,req_id:t}})}}batchCreateBOToken(e){const t=e.map(((e,t)=>({topic:e,index:t})));return{seq:this.sendMessageToRwg({evt:4211,body:t})}}mute(e,t){return{seq:this.sendMessageToRwg({evt:8193,body:{bMute:t,id:e}})}}audioDrop(e){return{seq:this.sendMessageToRwg({evt:8195,body:{id:e}})}}audioDialout(e,t,o,n,r){return{seq:this.sendMessageToRwg({evt:8197,body:{pn:e,dn2:ur(t),bCallme:o,bPressOne:n,bGreeting:r}})}}audioCancelDialout(e,t){return{seq:this.sendMessageToRwg({evt:8199,body:{pn:e,bCallme:t}})}}audioMuteAll(e){return{seq:this.sendMessageToRwg({evt:8201,body:{bMute:e}})}}allowToTalk(e,t){return{seq:this.sendMessageToRwg({evt:8204,body:{id:e,bAllowTalk:t}})}}subscribeVideo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;return{seq:this.sendMessageToRwg({evt:12289,body:{id:e,size:t,bOn:o}})}}unsubscribeVideo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return{seq:this.sendMessageToRwg({evt:12291,body:{id:e}})}}muteAttendeeVideo(e,t){return{seq:this.sendMessageToRwg({evt:12297,body:{id:e,bOn:t}})}}notifyRwgIsMuteVideo(e,t){return this.muteAttendeeVideo(e,t)}pauseSharing(){return{seq:this.sendMessageToRwg({evt:16385,body:{}})}}resumeSharing(){return{seq:this.sendMessageToRwg({evt:16387,body:{}})}}allowAnonymousQuestion(e,t){return{seq:this.sendMessageToRwg({evt:4155,body:{userId:e,bOn:t}})}}allowViewAll(e,t){return{seq:this.sendMessageToRwg({evt:4157,body:{userId:e,bOn:t}})}}allowVote(e,t){return{seq:this.sendMessageToRwg({evt:4159,body:{userId:e,bOn:t}})}}allowComment(e,t){return{seq:this.sendMessageToRwg({evt:4161,body:{userId:e,bOn:t}})}}sharingRequestRemoteControl(e,t){return{seq:this.sendMessageToRwg({evt:16389,body:{id:e,bOn:t}})}}subscribeGrabRemoteControl(e,t){return{seq:this.sendMessageToRwg({evt:16393,body:{id:e,bOn:t}})}}subscribeSharing(e,t,o,n){const r={id:e,size:t};return o&&Object.assign(r,{bShareToBO:!0}),void 0!==n&&Object.assign(r,{bVideoShare:n}),{seq:this.sendMessageToRwg({evt:16415,body:r})}}unsubscribeSharing(e,t){const o={id:e};return t&&Object.assign(o,{bShareToBO:!0}),{seq:this.sendMessageToRwg({evt:16417,body:o})}}sendRWGConnectionPerformance(e){return{seq:this.sendMessageToRwg({evt:4167,body:{data:e}})}}sendSdkKeyToMonitor(e,t,o){return{seq:this.sendMessageToRwg({evt:4167,body:{data:`ZoomConferenceClient,videoapp_HTML5_sdk_web_join,${o},2,${t},${e}`}})}}sendDatachannelOffer(e){return{seq:this.sendMessageToRwg({evt:24321,offer:e})}}joinOrLeaveVoip(e){return{seq:this.sendMessageToRwg({evt:8203,body:{bOn:e}})}}startSharing(e,t){return{seq:this.sendMessageToRwg({evt:16409,body:{id:e,boOn:!1,...null!=t?t:{}}})}}stopSharing(e){return{seq:this.sendMessageToRwg({evt:16409,body:{id:e,bOn:!0}})}}lockSharing(e){return{seq:this.sendMessageToRwg({evt:4169,body:{lockShare:e}})}}startShareToBreakoutRoom(e){return{seq:this.sendMessageToRwg({evt:16425,body:{id:e,bShareToBO:!0}})}}stopShareToBreakoutRoom(e){return{seq:this.sendMessageToRwg({evt:16425,body:{id:e,bShareToBO:!1}})}}preAssignBreakoutRoom(){return{seq:this.sendMessageToRwg({evt:4213,body:{}})}}claimHost(e){return{seq:this.sendMessageToRwg({evt:4215,body:{hostKey:e}})}}allowMultiplePin(e,t){return{seq:this.sendMessageToRwg({evt:4217,body:{userID:e,bOn:t}})}}spotlightVideo(e,t){return{seq:this.sendMessageToRwg({evt:4219,body:{id:e,...t}})}}connectCamera(e,t){const o={evt:12307,body:{id:e,bOn:t}};return{seq:this.sendMessageToRwg(o)}}followHostLayout(e){return{seq:this.sendMessageToRwg({evt:4223,body:{bFollowHostVideo:e}})}}setVideoDragLayout(e){return{seq:this.sendMessageToRwg({evt:4218,body:{drag_list:e}})}}chatCmdReq(e,t){return{seq:this.sendMessageToRwg({evt:4237,body:{msgID:e,cmd:t}})}}activeAppLinkReq(e){return{seq:this.sendMessageToRwg({evt:4257,body:{appId:e}})}}activeAppInfoReq(){return{seq:this.sendMessageToRwg({evt:4255,body:{}})}}muteShareAudio(e,t){const o={bOn:!0,bShareAudio:!e};return t&&Object.assign(o,{bShareAudioOnly:!0}),{seq:this.sendMessageToRwg({evt:16423,body:o})}}localMuteAudio(e,t){return{seq:this.sendMessageToRwg({evt:8209,body:{id:e,bMute:t}})}}changeSharePronoun(e,t){return{seq:this.sendMessageToRwg({evt:4264,body:{bPronoun:e,strPronoun:t}})}}sendReceivingSharingReady(e){return{seq:this.sendMessageToRwg({evt:16421,body:{ssrc:e}})}}sendManualCaption(e){return{seq:this.sendMessageToRwg({evt:4289,body:{...e}})}}sendPollingAction(e,t,o){return{seq:this.sendMessageToRwg({evt:4224,body:{action:e,PollingId:t,...o}})}}broadcastUserNetworkQuality(e){const t={type:e.isUplink,level:e.level,bwLevel:e.bwLevel};return{seq:this.sendMessageToRwg({evt:4331,body:t})}}sendFarEndCameraControl(e,t,o){return{seq:this.sendMessageToRwg({evt:4329,body:{cmd:e,userID:t,buttonID:o}})}}sendCameraAblity(e){return{seq:this.sendMessageToRwg({evt:4330,body:{...e,focus:!1}})}}sendReaction(e){return{seq:this.sendMessageToRwg({evt:4259,body:{...e}})}}remoteControlConsent(e,t,o,n){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const{deviceId:i,...s}=n;return{seq:this.sendMessageToRwg({evt:16427,body:{DeviceID:i,op:e,SendUserID:o,AssignUserID:t,...s,bAutoDelete:r}})}}takeBackRemoteControlPermission(e,t){return{seq:this.sendMessageToRwg({evt:16431,body:{SendUserID:e,ReceiverUserID:t}})}}syncSharedContentMetaWithRcApp(e){const{deviceId:t,...o}=e;return{seq:this.sendMessageToRwg({evt:16429,body:{DeviceID:t,...o}})}}startLiveStream(e,t,o){return{seq:this.sendMessageToRwg({evt:7977,body:{action:1,streamingURL:e,streamingKey:t,broadcastURL:o}})}}stopLiveStream(){return{seq:this.sendMessageToRwg({evt:7977,body:{action:0}})}}sendRemoteControlAuth(e){return{seq:this.sendMessageToRwg({evt:16433,body:{auth:e}})}}chatFileTransfer(e){return{seq:this.sendMessageToRwg({evt:4307,body:{...e,fileType:0,receiverType:0}})}}broadcastVoiceReq(e){return{seq:this.sendMessageToRwg({evt:4314,body:{broadcastVoice:e}})}}}class Ls extends Ms{static createAgent(){return this.rwgInstance||(this.rwgInstance=new Ls),this.rwgInstance}}Ls.rwgInstance=null;class Ns extends Ms{static getInstance(){return this.instance||(this.instance=new Ns),this.instance}}Ns.instance=null;const Vs=[{name:"audio_simd.min.js",category:"audio",type:"worker",tag:"simd",alias:"audioSIMDWorkletPath"},{name:"audio.simd.wasm",category:"audio",type:"wasm",tag:"simd",alias:"audioSIMDWasm"},{name:"js_audio_process.min.js",category:"audio",type:"worker",tag:"",alias:"audioWorkerPath"},{name:"audio.encode.wasm",category:"audio",type:"wasm",tag:"",alias:"audioWasm"},{name:"js_audio_worklet.min.js",category:"audio",type:"worklet",tag:"",alias:"audioWorkletPath"},{name:"js_audio_worklet_simd.min.js",category:"audio",type:"worklet",tag:"simd",alias:"audioWorkletSIMDPath"},{name:"js_audio_worklet_process.min.js",category:"audio",type:"worklet",tag:"",alias:"audioWorkletProcessPath"},{name:"js_sharing_audio_worklet.min.js",category:"audio",type:"worklet",tag:"",alias:"sharingAudioWorkletPath"},{name:"js_audio_level_worklet_process.min.js",category:"audio",type:"worklet",tag:"",alias:"audioLevelWorkletPath"},{name:"video_mtsimd.min.js",category:"video",type:"worker",tag:"simd,thread",alias:"videoMSIMDWorkerPath"},{name:"video.mtsimd.wasm",category:"video",type:"wasm",tag:"simd,thread,videoShare",alias:"videoMSIMDWasm"},{name:"video_m.min.js",category:"video",type:"worker",tag:"thread",alias:"videoMtWorkerPath"},{name:"video.mt.wasm",category:"video",type:"wasm",tag:"thread",alias:"videoMtWasm"},{name:"video_simd.min.js",category:"video",type:"worker",tag:"simd",alias:"videoSIMDWorkerPath"},{name:"video.simd.wasm",category:"video",type:"wasm",tag:"simd",alias:"videoSIMDWasm"},{name:"video_s.min.js",category:"video",type:"worker",tag:"",alias:"videoWorkerPath"},{name:"video.decode.wasm",category:"video",type:"wasm",tag:"",alias:"videoWasm"},{name:"video_share_mtsimd.min.js",category:"video",type:"worker",tag:"videoShare",alias:"vsmiworkerpath"},{name:"sharing_mtsimd.min.js",category:"sharing",type:"worker",tag:"simd,thread",alias:"sharingMSIMDWorkerPath"},{name:"sharing_m.min.js",category:"sharing",type:"worker",tag:"thread",alias:"sharingMtWorkerPath"},{name:"sharing_simd.min.js",category:"sharing",type:"worker",tag:"simd",alias:"sharingSIMDWorkerPath"},{name:"sharing_s.min.js",category:"sharing",type:"worker",tag:"",alias:"sharingWorkerPath"}],Us="1506",js=(e,t)=>Vs.reduce(((o,n)=>{const{name:r,alias:i}=n;return Object.assign(o,{[`${i}`]:`${e}/${t&&Us?`${Us}_`:""}${r}`}),o}),{});let Bs=function(e){return e.VideoEncode="0",e.VideoDecode="1",e.AudioEncode="2",e.AudioDecode="3",e.SharingEncode="4",e.SharingDecode="5",e}({});const xs=Vi.WebclientIVState;class Fs{static getInstance(){return void 0===this.agentInstance&&(this.agentInstance=new Fs),this.agentInstance}constructor(){this.assetsPath=void 0,this.instance=void 0,this.callbackList=void 0,this.mediaWorkersPath=void 0,this.constraints=void 0,this.svcUrl=void 0,this.meetingNumber=void 0,this.confId=void 0,this.mediaSocketAddress=void 0,this.currentUserId=void 0,this.receivedSharingCanvas=void 0,this.sharingCanvas=void 0,this.mediaOptions=void 0,this.inProgress=void 0,this.callbackList=[]}init(e){if(!this.instance&&window.JsMediaSDK_Instance){const t={ivObj:{[Yi.AUDIO_ENCODE]:Ni.get(xs)&&Ni.get(xs)[Yi.AUDIO_ENCODE],[Yi.VIDEO_ENCODE]:Ni.get(xs)&&Ni.get(xs)[Yi.VIDEO_ENCODE],[Yi.SHARING_ENCODE]:Ni.get(xs)&&Ni.get(xs)[Yi.SHARING_ENCODE]},globalTracingLogger:e};this.instance=new window.JsMediaSDK_Instance(t),this.instance.setRWGAgent(Ls.createAgent())}}setAssetsAndConstraint(e,t,o,n){var r;this.assetsPath=e,this.constraints=t,this.mediaWorkersPath=js(this.assetsPath,!!o),this.onMediaSDKCallback=this.onMediaSDKCallback.bind(this),this.mediaOptions=n,null===(r=this.instance)||void 0===r||r.JsMediaSDK_PreLoad(this.mediaWorkersPath,this.onMediaSDKCallback,n)}onMediaSDKCallback(e,t){this.callbackList.length>0&&this.callbackList.forEach((o=>o(e,t)))}registerCallback(e){this.callbackList.push(e)}unregisterCallback(e){this.callbackList=this.callbackList.filter((t=>t!==e))}static isSupportVideoEncodeHardwareAcceleration(){return window.JsMediaSDK_Instance.util.IsSupportVideoEncodeHardwareAcceleration()}static isSupportVideoDecodeHardwareAcceleration(){return window.JsMediaSDK_Instance.util.IsSupportVideoDecodeHardwareAcceleration()}static isCompatibleHardwareForEncode(){var e;return Gi.isSupportOffscreenCanvas&&0==(null===(e=window.JsMediaSDK_Instance)||void 0===e?void 0:e.util.AdapterWhiteListCheckForEncoder())}static getPTZCapability(){var e,t,o,n,r,i,s,a,u;return{pan:!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util)||void 0===t||null===(o=t.isSupportCameraPan)||void 0===o||!o.call(t)),tilt:!(null===(n=window.JsMediaSDK_Instance)||void 0===n||null===(r=n.util)||void 0===r||null===(i=r.isSupportCameraTilt)||void 0===i||!i.call(r)),zoom:!(null===(s=window.JsMediaSDK_Instance)||void 0===s||null===(a=s.util)||void 0===a||null===(u=a.isSupportCameraZoom)||void 0===u||!u.call(a))}}static isSupportVideoShare(){var e,t,o;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util)||void 0===t||null===(o=t.isSupportVideoShareReceive)||void 0===o||!o.call(t))}static isSupportVideoShareSend(){var e,t,o;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util)||void 0===t||null===(o=t.isSupportVideoShareSend)||void 0===o||!o.call(t))}static isSupportSending720P(){var e,t;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util)||void 0===t||!t.get720pcapacity())}static isSupportSubscribing1080P(){var e,t;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util)||void 0===t||!t.getsub1080pcapacity())}static isSupportOpenMicWhenShareAudio(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isSupportOpenMicWhenShareAudio())}static isSupportMediaPlaybackAsVideoInput(){var e,t;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util.videoToMediaStreamManager)||void 0===t||!t.isSupported())}static isSupportMediaPlaybackAsAudioInput(){var e,t;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(t=e.util.audioToMediaStreamMananger)||void 0===t||!t.isSupported())}static isSupportAudioDenoise(e){var t;return!(null===(t=window.JsMediaSDK_Instance)||void 0===t||!t.util.isSupportAudioDenoise(e))}static isSupportAudioBridgeAVSync(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isSupportAudioBridgeAvsync())}static getAudioFeatureFlag(){var e;return null===(e=window.JsMediaSDK_Instance)||void 0===e?void 0:e.util.getAudioFeatureFlags()}static isSupportShareMultiStream(){var e;return null===(e=window.JsMediaSDK_Instance)||void 0===e?void 0:e.util.isSupportShareMultiStream()}static isSupportVideoLTR(){var e;return null===(e=window.JsMediaSDK_Instance)||void 0===e?void 0:e.util.isSupportVideoLTR()}static isSupportStereoAudio(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isBrowserSupportStereo())}static isSupportFullHDVideo(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isSupportSendVideoFullHD())}static isSupportFullHDVideoShare(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isSupportSendVideoShareFullHD())}static isSupportShare2ndAudioDevice(e){var t;return!(null===(t=window.JsMediaSDK_Instance)||void 0===t||!t.util.isSupportShare2ndAudioDevice(e))}connect(e){var t,o,n,r,i,s;let{svcUrl:a,meetingNumber:u,conId:d,e2eEncrypt:l,isViewOnly:c,currentUserId:p,isWebinar:h,enableAudioQos:m,enableVideoQos:v=!1,enableWebtransport:g=!1,webtransportPort:f,rendererType:y,adaptedABOptionForMediaSDK:S}=e;const{isSupportEssentialAudioAndVideoAbility:b,isSupportAudioWorklet:E,isSupportSendScreenSharing:I}=Gi;this.svcUrl=a,this.meetingNumber=u,this.confId=d;const A=((e,t,o)=>({videoSocketAddress:`wss://${e}/wc/media/${t}?type=v&cid=${o}`,audioSocketAddress:`wss://${e}/wc/media/${t}?type=a&cid=${o}`,sharingSocketAddress:`wss://${e}/wc/media/${t}?type=${Ki()?"j":"s"}&cid=${o}`}))(a,u,d);this.mediaSocketAddress=A,this.currentUserId=p;const C=Ji(null===(t=this.mediaOptions)||void 0===t?void 0:t.enableMultiDecodeVideoWithoutSAB);var _,w,R,O,T,D,P,k,M,L;(null===(o=this.instance)||void 0===o||o.setPropsBeforeInit({callback:this.onMediaSDKCallback,audioWorkerPath:b?null===(n=this.mediaWorkersPath)||void 0===n?void 0:n.audioWorkletPath:void 0,e2eEncrypt:l,isEnableListenInitEvent:!0,enableWebtransport:g,webtransportPort:f,featureOptions:S,rendererType:y}),!0===(null===(r=this.constraints)||void 0===r?void 0:r.audio)&&b&&!zi())&&((h||E)&&(null===(_=this.instance)||void 0===_||_.initAudioDecode(this.mediaWorkersPath,A.audioSocketAddress,p,Kt,d,u,C,m)),!E||h&&c||null===(w=this.instance)||void 0===w||w.initAudioEncode(this.mediaWorkersPath,A.audioSocketAddress,p,Kt,d,u,C,m));!0===(null===(i=this.constraints)||void 0===i?void 0:i.video)&&b&&(null===(R=this.instance)||void 0===R||R.initVideoDecode(this.mediaWorkersPath,A.videoSocketAddress,p,Kt,d,u,C,null===(O=null===(T=window.JsMediaSDK_Instance)||void 0===T||null===(D=T.util)||void 0===D?void 0:D.isGraphicShouldUseHardwareAccelerationDecode())||void 0===O||O,v),h&&c||null===(P=this.instance)||void 0===P||P.initVideoEncode(this.mediaWorkersPath,A.videoSocketAddress,p,Kt,d,u,C,!1,v,!0,!0)),!0===(null===(s=this.constraints)||void 0===s?void 0:s.screen)&&(b?(null===(k=this.instance)||void 0===k||k.initSharingDecode(this.mediaWorkersPath,A.sharingSocketAddress,p,Kt,d,u,C),!I||h&&c||null===(M=this.instance)||void 0===M||M.initSharingEncode(this.mediaWorkersPath,A.sharingSocketAddress,p,Kt,d,u,C)):null===(L=this.instance)||void 0===L||L.initSharingDecode(A.sharingSocketAddress)),this.inProgress=!0}async destroy(){var e;this.callbackList=[],[Bs.AudioDecode,Bs.AudioEncode,Bs.VideoDecode,Bs.VideoEncode].forEach((e=>{var t;null===(t=this.instance)||void 0===t||t.updateQosSubscription(!1,e)}));const t=null===(e=this.instance)||void 0===e?void 0:e.destroy.bind(this.instance);this.instance=null,this.inProgress=!1,await(null==t?void 0:t())}disconnect(){var e,t;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(17,{}),null===(t=this.instance)||void 0===t||t.JsMediaSDK_UnInit()}muteAudio(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(8,{ssrc:0})}unmuteAudio(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(7,{ssrc:0,AudioSelectValue:0})}joinComputerAudio(e,t,o,n,r,i,s){var a;const u=s?{...s,enableHID:!0}:{enableHID:!1};return null===(a=this.instance)||void 0===a?void 0:a.Notify_MeidaSDK(22,{CaptureAudio:n,CaptureAudioInfo:{ssrc:e,AudioSelectValue:"default"===t?null:t,...u,audioProfile:r},speakerInfo:{defaultDeviceId:o},...i?{useAudioBridge:!0,audioBridge:i}:{}})}leaveComputerAudio(){var e;return null===(e=this.instance)||void 0===e?void 0:e.Notify_MeidaSDK(21,null)}joinSharingAudio(e){var t;let{ssrc:o,microphoneDeviceId:n,speakerDeviceId:r,isCaptureAudio:i,audioBridge:s}=e;return null===(t=this.instance)||void 0===t?void 0:t.Notify_MeidaSDK(72,{CaptureAudio:i,CaptureAudioInfo:{ssrc:o,AudioSelectValue:"default"===n?null:n},speakerInfo:{defaultDeviceId:r},checkAutoplay:!1,...s?{useAudioBridge:!0,audioBridge:s}:{}})}leaveSharingAudio(e){var t;return null===(t=this.instance)||void 0===t?void 0:t.Notify_MeidaSDK(73,{isPause:e?1:0})}changeSpeaker(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(11,{ssrc:0,AudioSelectValue:e})}changeMicrophone(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(18,{ssrc:0,AudioSelectValue:"default"===e?null:e,microphoneLabel:null!=t?t:"default",defaultMuted:o})}restoreWebRTC(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(19,{ssrc:0,AudioSelectValue:"default"===e?null:e})}renderVideo(e,t,o,n,r,i,s,a,u,d,l){var c;const p={userId:t,width:n,height:r,x:i,y:s,quality:a,isMyself:u,canvas:e,enableWaterMark:l,waterMarkText:d,zone:o};e instanceof HTMLVideoElement&&Object.assign(p,{videodom:e}),null===(c=this.instance)||void 0===c||c.Notify_MeidaSDK(1,p)}stopRenderVideo(e,t,o,n){var r;let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];null===(r=this.instance)||void 0===r||r.Notify_MeidaSDK(2,{canvas:e,userId:t,RGBA:n,doNotClean:i,zone:o})}startCaptureVideo(e,t,o,n,r,i){var s;let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6],u=arguments.length>8?arguments[8]:void 0;const d=(arguments.length>7?arguments[7]:void 0)?Fs.getPTZCapability():void 0;null===(s=this.instance)||void 0===s||s.Notify_MeidaSDK(3,{ssid:e,width:o,height:n,fps:u,video:r,usingFacingMode:i,VideoSelectValue:"default"===t?null:t,disableOriginalRatio:a,...d})}stopCaptureVideo(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(4,{ssrc:0})}changeCamera(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(12,{VideoSelectValue:"default"===e?null:e,...t||{}})}switchCanvasForVideoCapture(e){var t;let o=e;"string"==typeof e&&(o=[e]),null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(25,o)}renderSharing(e,t){var o;let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.receivedSharingCanvas=t,null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(23,{width:0,height:0,ssrc:e,canvas:t,enableWaterMark:n,waterMarkText:r,isFromMainSession:i})}stopRenderSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(24,{})}switchSharingSource(e){var t;let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(36,{ssrc:e,isFromMainSession:Number(o)})}ajustmentReceivedSharingCanvas(e,t){if(this.receivedSharingCanvas)try{this.receivedSharingCanvas.width=e,this.receivedSharingCanvas.height=t}catch(e){}}startRemoteControl(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(26,{socketURL:`wss://${this.svcUrl}`,meetingID:this.meetingNumber,condID:this.confId,os:t,dom:e,...o})}stopRemoteControl(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(28)}resendRemoteControlPositionPDU(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(41)}updateRemoteControlProperties(e){var t;const{dimension:o,...n}=e;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(27,{...o,...n})}startDesktopSharing(e,t,o,n){var r;let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0;this.sharingCanvas=document.querySelector(`#${t}`);const d={};n&&Object.assign(d,{share2ndCamera:!0,share2ndCameraParams:{VideoSelectValue:"default"===n.cameraId?null:n.cameraId,width:n.width,height:n.height}}),void 0!==s&&Object.assign(d,{videoParams:{displaySurface:s}}),void 0!==u&&Object.assign(d,{otherParams:{...u}}),null===(r=this.instance)||void 0===r||r.Notify_MeidaSDK(30,{ssid:e,canvas:t,video:o,...d,showShareAudioOption:i,sourceId:a})}stopDesktopSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(31,{})}pauseDesktopSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(32,{})}resumeDesktopSharing(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(33,{})}selectLanguageChannelForNewLTT(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(57,{lang:e})}changeSharingSecondCamera(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(49,{VideoSelectValue:e})}ajustmentSharingCanvas(e,t){if(this.sharingCanvas)try{this.sharingCanvas.width=e,this.sharingCanvas.height=t}catch(e){}}checkChromeSharingExtension(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(34,{})}enableAudioEncode(){var e,t;null===(e=this.instance)||void 0===e||e.initAudioEncode(this.mediaWorkersPath,this.mediaSocketAddress.audioSocketAddress,this.currentUserId,Kt,this.confId,this.meetingNumber,Ji(null===(t=this.mediaOptions)||void 0===t?void 0:t.enableMultiDecodeVideoWithoutSAB))}sendUserNodeList(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(43,{userList:e,encryptKey:t})}updateRenderedSharingDimension(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(44,{width:e,height:t})}pauseOrResumeAudio(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(45,{bPause:e})}updateRenderedVideoCanvasDimension(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(46,{canvas:e,width:t,height:o})}clearVideoCanvas(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(47,{id:e,RGBA:t})}adjustRenderedVideoPosition(e,t,o,n,r,i,s,a){var u;null===(u=this.instance)||void 0===u||u.Notify_MeidaSDK(48,{userId:t,x:n,y:r,width:i,height:s,canvas:e,zone:o,RGBA:a})}mirrorVideo(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(75,{isMirrorMyVideo:e})}updateUserMediaSN(e){var t,o,n;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(80,{isFromMainSession:Number(e.isFromMainSession),mediaActionType:e.iVType,body:{add:null!==(o=e.added)&&void 0!==o?o:[],remove:null!==(n=e.removed)&&void 0!==n?n:[]}})}updateMediaParams(e){var t;const{iVType:o,isFromMainSession:n,updateParams:r}=e;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(81,{mediaActionType:o,isFromMainSession:Number(n),updateParams:r})}createMainSessionChannel(e,t){var o,n;"sharing"===e?null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(84,t):null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(85,t)}addReceivedSharingChannelType(e){var t;const{isFromMainSession:o,...n}=e;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(82,{isFromMainSession:Number(o),...n})}removeReceivedSharingChannelType(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(83,{isFromMainSession:Number(e.isFromMainSession),ssrc:e.ssrc})}enableHardwareAccelerationForVideoDecode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(70,{enable:e})}enableHardwareAccelerationForVideoEncode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(71,{enable:e})}setSharingAudioVolume(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(74,{userid:e>>10,shareVolume:t?0:100,isFromMainSession:o})}subscribeToQos(e,t){e.forEach((e=>{var o;null===(o=this.instance)||void 0===o||o.updateQosSubscription(!0,e,t)}))}unsubscribeFromQos(e){e.forEach((e=>{var t;null===(t=this.instance)||void 0===t||t.updateQosSubscription(!1,e)}))}passThroughRWGMessage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(40,e)}startVirtualBackgroundSetting(e,t,o,n,r,i){var s;let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];null===(s=this.instance)||void 0===s||s.Notify_MeidaSDK(91,{canvas:e,bgdom:t,width:r,height:i,ssid:o,VideoSelectValue:"default"===n?null:n,disableOriginalRatio:a})}updateVirtualBackgroundImage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(92,{bgdom:e})}stopVirtualBackgroundSetting(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(93,{isSwitch:t})}startMaskSetting(e,t,o,n,r,i,s,a,u){var d;null===(d=this.instance)||void 0===d||d.Notify_MeidaSDK(62,{canvas:e,maskdom:o,bgdom:t,dx:0,dy:0,dWidth:i,dHeight:s,width:a,height:u,ssid:n,VideoSelectValue:"default"===r?null:r})}updateMaskBackgroundImage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(63,{bgdom:e})}updateMaskClip(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(64,{maskdom:e,dx:0,dy:0,dWidth:t,dHeight:o})}stopMaskSetting(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(65,{isSwitch:t})}enableVideoObserver(e){var t;let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(99,{enable:e,fpsdisbale:o})}enableShareAudioToBreakoutRoom(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(86,{enable:e})}sendUserAudioStatus(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(51,e)}muteOrUnmuteOtherAudio(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(50,{userId:e,volume:t?0:100})}adjustOtherAudioVolume(e,t){var o;null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(50,{userId:e,volume:t})}notifySDKMeetingReady(){var e;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(113)}movePTZCamera(e){var t,o;return null===(t=window.JsMediaSDK_Instance)||void 0===t||null===(o=t.util)||void 0===o?void 0:o.queryPTZPermisson().then((t=>{var o;return t?(null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(53,e),Promise.resolve("")):Promise.reject("Cannot move camera without permission granted")}))}switchSharingMode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(101,{mode:e})}updateVideoHDValue(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK("update_videohd_value",{videohd:e})}updateVideoFullhdValue(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK("update_videofullhd_value",{videofullhd:e})}changeAudioProfile(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(126,e)}enableSyncButtonsOnHeadset(e,t,o){var n;null===(n=this.instance)||void 0===n||n.Notify_MeidaSDK(100,{enable:e,microphoneLabel:t,defaultMuted:o})}stopAllIncomingAudio(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(123,e)}isSharingEntireScreen(){var e,t;const o=null===(e=this.instance)||void 0===e||null===(t=e.getShareStreamInfo)||void 0===t?void 0:t.call(e);if(o){const{displaySurface:e}=o;return!e||"monitor"===e}return!1}getShareStreamInfo(){var e,t;const o=null===(e=this.instance)||void 0===e||null===(t=e.getShareStreamInfo)||void 0===t?void 0:t.call(e);if(o){const{deviceId:e,width:t,height:n}=o;return{deviceId:e,width:t,height:n}}return{}}preInitAudioBridge(e){var t;null===(t=this.instance)||void 0===t||t.previewInit({audioBridge:{...e}})}prefetchVideoSsrc(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(110,{ssrc:e})}cancelPrefetchVideoSsrc(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(112,{ssrc:e,haddata:!1})}setMobileRotateMode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(124,{isLandScape:e})}changeActiveVideoSsrc(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(13,{ssrc:e})}setAudioCodecMode(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(122,{mode:e})}startRemoteControlQRCheck(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(54,{enable:e})}broadcastVoiceToBreakoutRoom(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(87,{enable:e})}share2ndAudio(e,t){var o;const n={audioOnly:!0,deviceId:"default"===e?null:e};t&&Object.assign(n,t),null===(o=this.instance)||void 0===o||o.Notify_MeidaSDK(129,n)}}Fs.agentInstance=void 0;const Hs="ADD_CURRENT_USER_PARTICIPANT_ATTRIBUTE",$s="UPDATE_CURRENT_USER_PARTICIPANT_ATTRIBUTE",Ws="ADD_USER_PARTICIPANT_ATTRIBUTE",Gs="UPDATE_USER_PARTICIPANT_ATTRIBUTE",zs="REMOVE_USER_PARTICIPANT_ATTRIBUTE",Ks="UPDATE_WEBINAR_PARTICIPANT_ATTRIBUTE",qs="REMOVE_WEBINAR_ATTENDEE_ATTRIBUTE",Js="JOIN_MEETING_SUCCESS",Qs="JOIN_MEETING_FAILED",Zs="RECONNECTING_MEETING",Ys="LEAVING_MEETING",Xs="MEETING_IN_WAITING_ROOM",ea="UPDATE_MEETING_ATTRIBUTE",ta="SHARE_PRONOUN_TYPE_UPDATE";var oa=function(e){return e.ConnectionChange="connection-change",e.OnHoldChange="on-hold-change",e.UserAdd="user-added",e.UserUpdate="user-updated",e.UserRemove="user-removed",e.AttendeeUpdate="attendee-updated",e.MeetingAttributeUpdate="meeting-attribute-updated",e.PromoteAttendeeConsent="promote-attendee-consent",e.ActiveAppsUpdate="active-apps-updated",e.SharePronounTypeUpdate="share-pronoun-type-update",e}(oa||{});const na={JoinMeeting:{success:Hs,fail:[Qs]}},ra={[oa.ConnectionChange]:[{event:Js,payload:()=>({state:Oi.Connected})},{event:Qs,payload:e=>({state:Oi.Fail,...e})},{event:Zs,payload:e=>({state:Oi.Reconnecting,...e})},{event:Ys,payload:e=>({state:Oi.Closed,...e})}],[oa.OnHoldChange]:[{event:Xs,payload:e=>({isOnHold:e})}],[oa.UserAdd]:[{event:Hs,payload:e=>[e]},{event:Ws,payload:e=>e}],[oa.UserUpdate]:[{event:$s,payload:e=>[e]},{event:Gs,payload:e=>e}],[oa.UserRemove]:[{event:zs,payload:e=>e}],[oa.AttendeeUpdate]:[{event:Ks,payload:e=>e},{event:qs,payload:e=>e}],[oa.MeetingAttributeUpdate]:[{event:ea,payload:e=>"bNoHostTimeOut"in e?{isHostLost:e.bNoHostTimeOut}:null}],[oa.PromoteAttendeeConsent]:[{event:"MEETING_WEBINAR_PROMOTE_CONSENT_REQ",payload:e=>{let{req_id:t,sender_id:o}=e;return{reqId:t,senderId:o}}}],[oa.ActiveAppsUpdate]:[{event:"ACTIVE_APPS_UPDATE",payload:()=>{}}],[oa.SharePronounTypeUpdate]:[{event:ta,payload:e=>e}]},ia="LIVE_TRANSCRIPTION_RECEIVE_MESSAGE",sa="LIVE_TRANSCRIPTION_CAPTION_STATUS_CHANGE_RESPONSE",aa="LIVE_TRANSCRIPTION_STATUS_CHANGE",ua="LIVE_TRANSCRIPTION_HOST_DISABLE_CHANGE",da={"caption-message":[{event:ia,payload:e=>e}],"caption-status":[{event:sa,payload:e=>e}],"caption-enable":[{event:aa,payload:e=>e}],"caption-host-disable":[{event:ua,payload:e=>e}]},la="CHAT_RECEIVE_MESSAGE_EVENTS",ca="CHAT_PRIVILEGE_CHANGE",pa="CHAT_MESSAGE_RESPONSE",ha="CHAT_DELETE_MESSAGE_REPONSE",ma="CHAT_FILE_CHAT_UPLOAD_PROGRESS",va="CHAT_FILE_CHAT_DOWNLOAD_PROGRESS";let ga=function(e){return e.ChatOnMessage="chat-on-message",e.ChatPrivilegeChange="chat-privilege-change",e.ChatDeleteMessage="chat-delete-message",e.ChatFileUploadProgress="chat-file-upload-progress",e.ChatFileDownloadProgress="chat-file-download-progress",e}({});const fa={[ga.ChatOnMessage]:[{event:la,payload:e=>e}],[ga.ChatPrivilegeChange]:[{event:ca,payload:e=>e}],[ga.ChatDeleteMessage]:[{event:ha,payload:e=>e}],[ga.ChatFileUploadProgress]:[{event:ma,payload:e=>e}],[ga.ChatFileDownloadProgress]:[{event:va,payload:e=>e}]},ya="COMMAND_RECEIVE_MESSAGE_EVENTS",Sa="COMMAND_STATUS_EVENTS";let ba=function(e){return e.CommandChannelStatus="command-channel-status",e.CommandChannelMessage="command-channel-message",e}({});const Ea={[ba.CommandChannelStatus]:[{event:Sa,payload:e=>e}],[ba.CommandChannelMessage]:[{event:ya,payload:e=>e}]};let Ia=function(e){return e.Recording="Recording",e.Paused="Paused",e.Stopped="Stopped",e.Ask="Ask",e.Accept="Accept",e.Decline="Decline",e}({}),Aa=function(e){return e[e.None=0]="None",e[e.Init=1]="Init",e[e.Start=2]="Start",e[e.Pause=3]="Pause",e[e.Stop=4]="Stop",e}({}),Ca=function(e){return e[e.Stop=0]="Stop",e[e.Start=1]="Start",e[e.Pause=2]="Pause",e}({}),_a=function(e){return e[e.None=0]="None",e[e.Deny=1]="Deny",e[e.Allow=2]="Allow",e}({}),wa=function(e){return e[e.None=0]="None",e[e.DenyAllRequest=1]="DenyAllRequest",e[e.AllowAllRequest=2]="AllowAllRequest",e}({});const Ra="CLOUD_RECORDING_STATUS_CHANGE",Oa="CLOUD_RECORDING_ISO_STATUS_CHANGE",Ta="LOCAL_RECORDING_CHANGE",Da="LOCAL_RECORDING_PERMISSION_CHANGE",Pa="RECORDING_FOR_IQ_STATUS_CHANGE",ka="RECORDING_FOR_IQ_OPERATION_CHANGE";let Ma=function(e){return e.RecordingChange="recording-change",e.IndividualRecordingChange="individual-recording-change",e.LocalRecordingChange="local-recording-change",e.LocalRecordingPermissionChange="local-recording-permission-change",e.MediaCaptureStatusChange="media-capture-status-change",e.MediaCapturePermissionChange="media-capture-permission-change",e.RecordingIqChange="recording-iq-change",e}({});const La={[Ma.RecordingChange]:[{event:Ra,payload:e=>{const{cmrServerStatus:t}=e;return t===Aa.Start?Ia.Recording:t===Aa.Pause?Ia.Paused:Ia.Stopped}}],[Ma.IndividualRecordingChange]:[{event:Oa,payload:e=>e}],[Ma.LocalRecordingChange]:[{event:Ta,payload:e=>e}],[Ma.LocalRecordingPermissionChange]:[{event:Da,payload:e=>e}],[Ma.MediaCaptureStatusChange]:[{event:Ta,payload:e=>e}],[Ma.MediaCapturePermissionChange]:[{event:Da,payload:e=>e}],[Ma.RecordingIqChange]:[{event:Pa,payload:e=>e}]};let Na=function(e){return e[e.InitSuccess=1]="InitSuccess",e[e.InitSuccessVideo=1.1]="InitSuccessVideo",e[e.InitSuccessAudio=1.2]="InitSuccessAudio",e[e.InitSuccessSharing=1.3]="InitSuccessSharing",e[e.UserGrantCaptureAudio=2]="UserGrantCaptureAudio",e[e.CurrentVideoResolution=3]="CurrentVideoResolution",e[e.JpegDecThreadOk=4]="JpegDecThreadOk",e[e.JpegData=5]="JpegData",e[e.SharingPara=6]="SharingPara",e[e.VideoDecodeMaxSize=7]="VideoDecodeMaxSize",e[e.CurrentCaptureVideoWidthHeight=8]="CurrentCaptureVideoWidthHeight",e[e.StartVideoCaptureSuccess=9]="StartVideoCaptureSuccess",e[e.StopVideoCaptureSuccess=10]="StopVideoCaptureSuccess",e[e.StartRemoteControlSuccess=11]="StartRemoteControlSuccess",e[e.CancelRemoteControlSuccess=12]="CancelRemoteControlSuccess",e[e.RemoteControlCopiedTextNotify=13]="RemoteControlCopiedTextNotify",e[e.MonitorLog=14]="MonitorLog",e[e.CurrentDesktopSharingWidthHeight=15]="CurrentDesktopSharingWidthHeight",e[e.DesktopSharingCaptureSuccess=16]="DesktopSharingCaptureSuccess",e[e.CheckChromeSharingExtensionResponse=17]="CheckChromeSharingExtensionResponse",e[e.SharingDecodeMaxSize=18]="SharingDecodeMaxSize",e[e.DataChannelOffer=19]="DataChannelOffer",e[e.AesGcmIvResponse=21]="AesGcmIvResponse",e[e.SharingDesktopStreamHaveAudio=23]="SharingDesktopStreamHaveAudio",e[e.JoinComputerAudioComplete=24]="JoinComputerAudioComplete",e[e.JoinSharingAudioComplete=25]="JoinSharingAudioComplete",e[e.LeaveComputerAudioComplete=26]="LeaveComputerAudioComplete",e[e.LeaveSharingAudioComplete=27]="LeaveSharingAudioComplete",e[e.HidStatusMute=28]="HidStatusMute",e[e.AudioStreamFailed=31]="AudioStreamFailed",e[e.VideoStreamFailed=32]="VideoStreamFailed",e[e.AudioSpeakerSetSuccess=33]="AudioSpeakerSetSuccess",e[e.AudiobridgeSetCcLangSuccess=36]="AudiobridgeSetCcLangSuccess",e[e.AudioLevelIndicator=38]="AudioLevelIndicator",e[e.SyncRendererTypeResponse=39]="SyncRendererTypeResponse",e[e.SendRemoteControlQrCode=55]="SendRemoteControlQrCode",e[e.StartVideoStreamInMaskSettingSuccess=66]="StartVideoStreamInMaskSettingSuccess",e[e.CurrentDecodeVideoQuality=66.5]="CurrentDecodeVideoQuality",e[e.CurrentDecodeVideoFps=66.6]="CurrentDecodeVideoFps",e[e.SharingFirstDecodeFrameReceivedSsrc=70]="SharingFirstDecodeFrameReceivedSsrc",e[e.StartVideoStreamInVbSettingSuccess=94]="StartVideoStreamInVbSettingSuccess",e[e.VbModelPreloading_3S=96]="VbModelPreloading_3S",e[e.VbModelPreloading_10S=97]="VbModelPreloading_10S",e[e.VbModelPreloadingOk=98]="VbModelPreloadingOk",e[e.NewActiveSpeakerFirstFrameCallback=111]="NewActiveSpeakerFirstFrameCallback",e[e.AudioBridgeFirstRecvData=114]="AudioBridgeFirstRecvData",e[e.AudioBridgeCanSendData=115]="AudioBridgeCanSendData",e[e.InitFailed=-1]="InitFailed",e[e.InitFailedVideo=-1.1]="InitFailedVideo",e[e.InitFailedAudio=-1.2]="InitFailedAudio",e[e.InitFailedSharing=-1.3]="InitFailedSharing",e[e.UserForbiddedCaptureAudio=-2]="UserForbiddedCaptureAudio",e[e.AudioWebsocketBroken=-3]="AudioWebsocketBroken",e[e.VideoWebsocketBroken=-4]="VideoWebsocketBroken",e[e.SharingDecThreadFailed=-5]="SharingDecThreadFailed",e[e.AudioZeroData=-6]="AudioZeroData",e[e.AudioCtxSamplerate=-7]="AudioCtxSamplerate",e[e.UserForbiddedCaptureVideo=-8]="UserForbiddedCaptureVideo",e[e.UserCameraIsTakenByOtherPrograms=-9]="UserCameraIsTakenByOtherPrograms",e[e.StopVideoCaptureFailed=-10]="StopVideoCaptureFailed",e[e.StartRemoteControlFailed=-11]="StartRemoteControlFailed",e[e.CancelRemoteControlFailed=-12]="CancelRemoteControlFailed",e[e.RemoteControlPasteTextLengthOverflow=-14]="RemoteControlPasteTextLengthOverflow",e[e.UserStopDesktopSharing=-15]="UserStopDesktopSharing",e[e.UserCancelPermissionRequest=-16]="UserCancelPermissionRequest",e[e.DesktopSharingChromeExtensionUninstalled=-17]="DesktopSharingChromeExtensionUninstalled",e[e.DesktopSharingPermissionDenied=-18]="DesktopSharingPermissionDenied",e[e.DesktopSharingTimeOut=-19]="DesktopSharingTimeOut",e[e.DesktopSharingError=-20]="DesktopSharingError",e[e.AudioSpeakerSetError=-21]="AudioSpeakerSetError",e[e.DesktopSharingSystemError=-22]="DesktopSharingSystemError",e[e.SharingDesktopStreamHaveNoAudio=-27]="SharingDesktopStreamHaveNoAudio",e.AudioQosData="AUDIO_QOS_DATA",e.VideoQosData="VIDEO_QOS_DATA",e.ShareQosData="VIDEOSHARE_QOS_DATA",e.NetworkQualityChange="NETWORK_QUALITY_CHANGE",e[e.AudioBridgeReconnectStart=-29]="AudioBridgeReconnectStart",e[e.AudioBridgeReconnectEnd=-31]="AudioBridgeReconnectEnd",e[e.WebglLostInMultiView=-32]="WebglLostInMultiView",e[e.MaskSettingParaError=-33]="MaskSettingParaError",e[e.VbSettingParaError=-34]="VbSettingParaError",e[e.NotifyUIFailover=-35]="NotifyUIFailover",e[e.RecoverWebrtcAudio=-36]="RecoverWebrtcAudio",e[e.AudiobridgeSetCcLangFailure=-39]="AudiobridgeSetCcLangFailure",e}({}),Va=function(e){return e[e.EncodeSuccess=1]="EncodeSuccess",e[e.DecodeSuccess=2]="DecodeSuccess",e[e.EncodeFailed=-1]="EncodeFailed",e[e.DecodeFailed=-2]="DecodeFailed",e}({}),Ua=function(e){return e.Spotlight="Spotlight",e.Unmute="Unmute",e.AllowToTalk="Allow to talk",e}({}),ja=function(e){return e.Inherited="inherited",e.Active="active",e.PassiveByMuteOne="passive(mute one)",e.PassiveByMuteAll="passive(mute all)",e.SharingAudio="sharing audio",e}({}),Ba=function(e){return e.Inherited="inherited",e.Active="active",e.Passive="passive",e.SharingAudio="sharing audio",e}({}),xa=function(e){return e.Active="active",e.Failover="failover",e.EndedBySystem="audio stream is ended by system",e.Pstn="pstn",e.MicrophoneError="microphone error",e}({}),Fa=function(e){return e.Join="join",e.Leave="leave",e.Muted="muted",e.Unmuted="unmuted",e}({}),Ha=function(e){return e[e.Calling=1]="Calling",e[e.Ringing=2]="Ringing",e[e.Accepted=3]="Accepted",e[e.Busy=4]="Busy",e[e.NotAvailable=5]="NotAvailable",e[e.HangUp=6]="HangUp",e[e.Fail=7]="Fail",e[e.Success=8]="Success",e[e.Timeout=9]="Timeout",e[e.Canceling=10]="Canceling",e[e.Canceled=11]="Canceled",e[e.CancelFailed=12]="CancelFailed",e}({});const $a=(()=>{const e=new ArrayBuffer(684),t=new Uint32Array(e);return t.set([1179011410,676,1163280727,544501094,16,65539,16e3,64e3,2097156,1635017060,640],0),new Blob([t],{type:"audio/wav"})})(),Wa=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]),Ga=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);let za=function(e){return e[e.HostGrab=0]="HostGrab",e[e.OnlyHost=1]="OnlyHost",e[e.AnyoneGrab=2]="AnyoneGrab",e[e.MultipleShare=3]="MultipleShare",e}({}),Ka=function(e){return e.Sharing="sharing",e.Paused="paused",e.End="ended",e}({}),qa=function(e){return e[e.Video_90P=0]="Video_90P",e[e.Video_180P=1]="Video_180P",e[e.Video_360P=2]="Video_360P",e[e.Video_720P=3]="Video_720P",e[e.Video_1080P=4]="Video_1080P",e}({}),Ja=function(e){return e.Active="Active",e.Inactive="Inactive",e}({}),Qa=function(e){return e.Muted="Muted",e.Unmuted="Unmuted",e}({}),Za=function(e){return e.Started="Started",e.Stopped="Stopped",e.Failed="Failed",e}({}),Ya=function(e){return e.Approved="Approved",e.Rejected="Rejected",e}({}),Xa=function(e){return e.PrivilegeChange="PrivilegeChange",e.StopScreenCapture="StopScreenCapture",e.ShareFromMainSession="ShareFromMainSession",e}({}),eu=function(e){return e[e.ImageNotMatch=2]="ImageNotMatch",e[e.CanvasNotMatch=3]="CanvasNotMatch",e[e.VBModelNotMatch=4]="VBModelNotMatch",e}({});const tu="blur";let ou=function(e){return e.User="user",e.Environment="environment",e.Left="left",e.Right="right",e}({});const nu=Object.values(ou),ru=1e3,iu="__ZOOM_SDK_SHARING_VIDEO__",su="__ZOOM_SDK_VIDEO_ZONE__",au="__ZOOM_SDK_VIRTUAL_BACKGROUND_CANVAS_@__",uu="__ZOOM_SDK_VIRTUAL_BACKGROUND_IMAGE_@__",du="__ZOOM_SDK_MASK_CLIP_@__",lu="__ZOOM_SDK_MEDIA_PLAYBACK_SOURCE_VIDEO__",cu="__ZOOM_SDK_DYMMY_VIDEO_PLAYER_CANVAS_ID__",pu="__ZOOM_SDK_DUMMY_HIDDEN_SELF_VIEW_VIDEO_ID__",hu={data:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,rate:0,bandwidth:0}},mu={data:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0,rate:0,bandwidth:0}};let vu=function(e){return e[e.Request=11]="Request",e[e.Decline=12]="Decline",e[e.Approve=13]="Approve",e[e.GiveUp=14]="GiveUp",e[e.StartControl=15]="StartControl",e[e.ContinueControl=16]="ContinueControl",e[e.StopControl=17]="StopControl",e[e.SwitchCamera=20]="SwitchCamera",e}({}),gu=function(e){return e[e.Bk=0]="Bk",e[e.Center=1]="Center",e[e.ZoomIn=2]="ZoomIn",e[e.ZoomOut=3]="ZoomOut",e[e.Left=4]="Left",e[e.Right=5]="Right",e[e.Up=6]="Up",e[e.Down=7]="Down",e[e.SwitchCamera=8]="SwitchCamera",e}({}),fu=function(e){return e[e.Pan=192]="Pan",e[e.Tilt=48]="Tilt",e[e.Zoom=12]="Zoom",e[e.Focus=3]="Focus",e}({}),yu=function(e){return e[e.ZoomIn=2]="ZoomIn",e[e.ZoomOut=3]="ZoomOut",e[e.Left=4]="Left",e[e.Right=5]="Right",e[e.Up=6]="Up",e[e.Down=7]="Down",e[e.SwitchCamera=8]="SwitchCamera",e}({}),Su=function(e){return e[e.None=0]="None",e[e.ApproveAnother=3]="ApproveAnother",e[e.Stop=5]="Stop",e}({}),bu=function(e){return e[e.Null=0]="Null",e[e.Normal=1]="Normal",e[e.VideoMode=2]="VideoMode",e}({}),Eu=function(e){return e[e.Null=0]="Null",e[e.VirtualBackground=1]="VirtualBackground",e[e.Mask=2]="Mask",e}({}),Iu=function(e){return e.Computer="computer",e.Phone="phone",e}({}),Au=function(e){return e[e.Decline=0]="Decline",e[e.Approve=1]="Approve",e[e.CacheClean=2]="CacheClean",e}({}),Cu=function(e){return e.Unknown="unknown",e.Uninstalled="uninstalled",e.Installed="installed",e}({}),_u=function(e){return e.Unlaunched="unlaunched",e.Launched="launched",e}({}),wu=function(e){return e.Started="started",e.Ended="ended",e}({}),Ru=function(e){return e[e.Max=30]="Max",e[e.Min=10]="Min",e[e.Default=24]="Default",e}({}),Ou=function(e){return e[e.Loading=1]="Loading",e[e.Done=2]="Done",e}({}),Tu=function(e){return e.Browser="Browser",e.Zoom="Zoom",e}({}),Du=function(e){return e.Denoise="backgroundNoiseSuppression",e.OriginalSound="originalSound",e}({}),Pu=function(e){return e[e.Undefined=0]="Undefined",e[e.WebGL=1]="WebGL",e[e.WebGPU=2]="WebGPU",e[e.WebGL2=3]="WebGL2",e}({}),ku=function(e){return e[e.H323=1]="H323",e[e.SIP=2]="SIP",e}({}),Mu=function(e){return e[e.Success=0]="Success",e[e.Ringing=1]="Ringing",e[e.Timeout=2]="Timeout",e[e.Busy=101]="Busy",e[e.Fail=104]="Fail",e}({});const Lu="RECEIVE_VIDEO_ACTIVE_INDICATION",Nu="RECEIVE_VIDEO_MUTE_INDICATION",Vu="ASK_FOR_START_VIDEO_CONSENT",Uu="RECEIVE_VIDEO_DIMENSION_CHANGE",ju="CAPTURED_VIDEO_DIMENSION_CHANGE",Bu="CAN_NOT_DETECT_CAMERA",xu="CAN_NOT_FIND_CAMERA",Fu="VIDEO_USER_FORBIDDEN_CAPTURE",Hu="VIDEO_CAMERA_IS_TAKEN",$u="VIDEO_BACKGROUND_FAILED",Wu="VIDEO_ESTABLISH_STREAM_ERROR",Gu="VIDEO_CAPTURE_START_SUCCESS",zu="VIDEO_CAPTURE_STOP_RESULT",Ku="VIDEO_SPOTLIGHT_CHANGE",qu="VIDEO_FOLLOW_HOST_ORDER_CHANGE",Ju="VIDEO_HOST_DRAG_LAYOUT_CHANGE",Qu="VIDEO_NEW_USER_START",Zu="VIDEO_OLD_USER_STOP",Yu="VIDEO_VIRTUAL_BACKGROUND_PRELOAD_READY",Xu="VIDEO_VIRTUAL_BACKGROUND_SETTING_SUCCESS",ed="VIDEO_STATISTIC_DATA",td="VIDEO_CELL_DETAILED_DATA",od="VIDEO_NETWORK_QUALITY_CHANGE",nd="VIDEO_FAR_END_CAMERA_CONTROL_REQUEST",rd="VIDEO_FAR_END_CAMERA_CONTROL_RESPONSE",id="VIDEO_FAR_END_CAMERA_IN_CONTROL_CHANGE",sd="VIDEO_FAR_END_CAMERA_CAPABILITY_CHANGE",ad="VIDEO_MASK_SETTING_SUCCESS",ud="VIDEO_CAPTURE_SDK_SUCCESS",dd="VIDEO_PREFETCH_VIDEO_FRAME_CALLBACK",ld="VIDEO_CURRENT_USER_SSRC",cd="VIDEO_RENDER_ASPECT_RATIO_CHANGE",pd={startCaptureVideo:{success:Gu,fail:[Bu,xu,Fu,Wu,Hu,$u]},switchCameraVideo:{success:ud,fail:[Bu,xu,Fu,Hu]},stopCaptureVideo:{success:zu}};let hd=function(e){return e.VideoActiveChange="video-active-change",e.PeerVideoStateChange="peer-video-state-change",e.VideoSpotlightChange="video-spotlight-change",e.VideoMutedChange="video-muted-change",e.VideoCapturingChange="video-capturing-change",e.AskForStartVideoConsent="ask-for-start-video-consent",e.VideoDimensionChange="video-dimension-change",e.VideoFollowHostOrder="video-follow-host-order-change",e.VideoHostLayoutChange="video-host-layout-change",e.VideoVBPreloadChange="video-virtual-background-preload-change",e.VideoStatisticDataChange="video-statistic-data-change",e.VideoDetailedDataChange="video-detailed-data-change",e.VideoAspectRatioChange="video-aspect-ratio-change",e.NetworkQualityChange="network-quality-change",e.FarEndCameraRequestControl="far-end-camera-request-control",e.FarEndCameraResponseControl="far-end-camera-response-control",e.FarEndCameraInControlChange="far-end-camera-in-control-change",e.FarEndCameraCapabilityChange="far-end-camera-capability-change",e}({});const md={[hd.VideoActiveChange]:[{event:Lu,payload:e=>({state:e.bVideoOn?Ja.Active:Ja.Inactive,userId:e.userId})}],[hd.VideoCapturingChange]:[{event:Gu,payload:()=>({state:Za.Started})},{event:zu,payload:e=>({state:null!=e&&e.failed?Za.Failed:Za.Stopped})}],[hd.VideoMutedChange]:[{event:Nu,payload:e=>({state:e.isVideoMuted?Qa.Muted:Qa.Unmuted,userId:e.id})}],[hd.AskForStartVideoConsent]:[{event:Vu,payload:e=>({state:e.isVideoMuted?Qa.Muted:Qa.Unmuted,userId:e.id})}],[hd.VideoSpotlightChange]:[{event:Ku,payload:e=>({spotlightList:e.spotlightList&&e.spotlightList.map((e=>({userId:e})))})}],[hd.VideoDimensionChange]:[{event:Uu,payload:e=>({type:"received",width:e.width,height:e.height})},{event:ju,payload:e=>({type:"captured",width:e.width,height:e.height})}],[hd.VideoFollowHostOrder]:[{event:qu,payload:e=>({isFollowHostOrder:e.bOn})}],[hd.VideoHostLayoutChange]:[{event:Ju,payload:e=>Array.isArray(e.layout)?e.layout.map((e=>({userId:e}))):[]}],[hd.PeerVideoStateChange]:[{event:Qu,payload:e=>({action:"Start",...e})},{event:Zu,payload:e=>({action:"Stop",...e})}],[hd.VideoVBPreloadChange]:[{event:Yu,payload:e=>({isReady:e})}],[hd.VideoStatisticDataChange]:[{event:ed,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[hd.VideoDetailedDataChange]:[{event:td,payload:e=>e}],[hd.VideoAspectRatioChange]:[{event:cd,payload:e=>e}],[hd.NetworkQualityChange]:[{event:od,payload:e=>e}],[hd.FarEndCameraRequestControl]:[{event:nd,payload:e=>e}],[hd.FarEndCameraResponseControl]:[{event:rd,payload:e=>e}],[hd.FarEndCameraInControlChange]:[{event:id,payload:e=>e}],[hd.FarEndCameraCapabilityChange]:[{event:sd,payload:e=>e}]},vd="AUDIO_ACTIVE_SPEAKER",gd="AUDIO_UNMUTE_CONSENT",fd="AUDIO_CURRENT_USER_JOIN_BY_VOIP",yd="AUDIO_CURRENT_USER_JOIN_BY_PHONE",Sd="AUDIO_CURRENT_USER_LEAVE_AUDIO",bd="AUDIO_CURRENT_USER_MUTED",Ed="AUDIO_CURRENT_USER_UNMUTED",Id="AUDIO_PARTICIPANT_AUDIO_UPDATE",Ad="AUDIO_DIALOUT_RESULT_CODE",Cd="AUDIO_DIALOUT_RESULT_SUCCESS",_d="AUDIO_DIALOUT_RESULT_FAIL",wd="AUDIO_DIALOUT_CANCEL_SUCCESS",Rd="DIALOUT_CANCEL_FAIL",Od="AUDIO_MERGE_AUDIO_INDICATION",Td="USER_FORBIDDEN_MICROPHONE",Dd="ESTABLISH_AUDIO_STREAM_ERROR",Pd="AUDIO_AUTO_PLAY_FAILED",kd="INVALID_DEVICE_ID",Md="AUDIO_ALLOW_TALK_CHANGE",Ld="SHARE_AUDIO_STATE_CHANGE",Nd="AUDIO_STATISTIC_DATA",Vd="AUDIO_CURRENT_USER_SSRC",Ud="AUDIO_SET_SPEAKER_RESULT",jd="AUDIO_SHARE_SECONDARY_AUDIO_SUCCESS",Bd="AUDIO_CRC_CALL_OUT_RESULT_CODE",xd="AUDIO_CRC_CALL_OUT_RESULT_SUCCESS",Fd="AUDIO_CRC_CALL_OUT_RESULT_FAIL",Hd="AUDIO_CURRENT_AUDIO_LEVEL_CHANGE";let $d=function(e){return e.ActiveSpeaker="active-speaker",e.UnmuteAudioConsent="unmute-audio-consent",e.CurrentAudioChange="current-audio-change",e.CurrentAudioLevelChange="current-audio-level-change",e.DialoutStateChange="dialout-state-change",e.MergeAudio="merged-audio",e.AutoPlayFailed="auto-play-audio-failed",e.AllowTalkChange="allow-talk-change",e.ShareAudioChange="share-audio-change",e.AudioStatisticDataChange="audio-statistic-data-change",e.CrcCallOutStateChange="crc-call-out-state-change",e}({});const Wd={JoinComputerAudio:{success:fd,fail:[Td,Dd]},LeaveComputerAudio:{success:Sd},JoinAudioByCallMe:{success:Cd,fail:[_d]},cancelDialOut:{success:wd,fail:[Rd]},hangup:{success:Sd},crcCallOut:{success:xd,fail:[Fd]}},Gd={[$d.ActiveSpeaker]:[{event:vd,payload:e=>e}],[$d.UnmuteAudioConsent]:[{event:gd,payload:e=>({reason:e})}],[$d.CurrentAudioChange]:[{event:yd,payload:()=>({action:Fa.Join,type:Iu.Phone})},{event:fd,payload:()=>({action:Fa.Join,type:Iu.Computer})},{event:Sd,payload:e=>{let{source:t}=e;return{action:Fa.Leave,source:t}}},{event:bd,payload:e=>{let{source:t}=e;return{action:Fa.Muted,source:t}}},{event:Ed,payload:e=>{let{source:t}=e;return{action:Fa.Unmuted,source:t}}}],[$d.DialoutStateChange]:[{event:Ad,payload:e=>e}],[$d.MergeAudio]:[{event:Od,payload:e=>e}],[$d.AutoPlayFailed]:[{event:Pd,payload:()=>{}}],[$d.AllowTalkChange]:[{event:Md,payload:e=>({enabled:e})}],[$d.ShareAudioChange]:[{event:Ld,payload:e=>e}],[$d.AudioStatisticDataChange]:[{event:Nd,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[$d.CrcCallOutStateChange]:[{event:Bd,payload:e=>e}],[$d.CurrentAudioLevelChange]:[{event:Hd,payload:e=>e}]},zd="SHARE_ACTIVE_INDICATION",Kd="SHARE_CHECK_CHROME_SHARING_EXTENSION",qd="SHARE_START_DESKTOP_SHARE_FAILED",Jd="SHARE_DIMENSION_CHANGE",Qd="SHARE_RECEIVED_DIMENSION_CHANGE",Zd="SHARE_VIDEO_STREAMS_END",Yd="SHARE_PASSIVE_STOP_SHARE",Xd="SHARE_PASSIVE_BO_STOP",el="SHARE_NEW_USER_ADD",tl="SHARE_USER_REMOVE",ol="SHARE_USER_PAUSED",nl="SHARE_USER_RESUMED",rl="SHARE_AUTO_CHANGE_SOURCE",il="SHARE_REMOTE_CONTROL_APPROVE",sl="SHARE_GRAB_REMOTE_CONTROL_CHANGE",al="SHARE_REMOTE_CONTROL_CLIPBOARD_CHANGE",ul="SHARE_REMOTE_CONTROL_SUCCESS",dl="SHARE_REMOTE_CONTROL_FAILED",ll="SHARE_PRIVILEGE_CHANGE",cl="SHARE_READ_RECEIPT",pl="SHARE_STATISTIC_DATA",hl="SHARE_REMOTE_CONTROL_REQUEST",ml="SHARE_REMOTE_CONTROL_APP_STATUS",vl="SHARE_REMOTE_CONTROL_SESSION_STATUS",gl="SHARE_REMOTE_CONTROL_APP_SCHEME";let fl=function(e){return e.ShareActiveChange="active-share-change",e.ShareDimensionChange="share-content-dimension-change",e.SharePassiveStop="passively-stop-share",e.SharePeerStateChange="peer-share-state-change",e.ShareContentChange="share-content-change",e.SharePrivilegeChange="share-privilege-change",e.ShareReadReceipt="share-can-see-screen",e.ShareStatisticDataChange="share-statistic-data-change",e.RemoteControlApprovedChange="remote-control-approved-change",e.RemoteControlInControlChange="remote-control-in-control-change",e.RemoteControlClipboardChange="remote-control-clipboard-change",e.RemoteControlRequestChange="remote-control-request-change",e.RemoteControlAppStatusChange="remote-control-app-status-change",e.RemoteControlControlledStatusChange="remote-control-controlled-status-change",e}({});const yl={[fl.ShareActiveChange]:[{event:zd,payload:e=>{const{isActive:t,activeUserId:o,...n}=e;return{state:t?"Active":"Inactive",userId:o,...n}}}],[fl.ShareDimensionChange]:[{event:Jd,payload:e=>({type:"sended",width:e.width,height:e.height})},{event:Qd,payload:e=>({type:"received",width:e.width,height:e.height})}],[fl.SharePassiveStop]:[{event:Zd,payload:()=>({reason:Xa.StopScreenCapture})},{event:Yd,payload:()=>({reason:Xa.PrivilegeChange})},{event:Xd,payload:()=>({reason:Xa.ShareFromMainSession})}],[fl.SharePeerStateChange]:[{event:el,payload:e=>({userId:e.id,action:"Start"})},{event:tl,payload:e=>({userId:e.id,action:"Stop"})},{event:ol,payload:e=>({userId:e.id,action:"Pause"})},{event:nl,payload:e=>({userId:e.id,action:"Resume"})}],[fl.ShareContentChange]:[{event:rl,payload:e=>e}],[fl.SharePrivilegeChange]:[{event:ll,payload:e=>({privilege:e})}],[fl.ShareReadReceipt]:[{event:cl,payload:()=>{}}],[fl.ShareStatisticDataChange]:[{event:pl,payload:e=>{const{data:{rate:t,...o},...n}=null!=e?e:{data:{}};return{data:{bitrate:t,...o},...n}}}],[fl.RemoteControlApprovedChange]:[{event:il,payload:e=>({state:e?Ya.Approved:Ya.Rejected})}],[fl.RemoteControlInControlChange]:[{event:sl,payload:e=>({isControlling:e})}],[fl.RemoteControlClipboardChange]:[{event:al,payload:e=>e}],[fl.RemoteControlRequestChange]:[{event:hl,payload:e=>e}],[fl.RemoteControlAppStatusChange]:[{event:ml,payload:e=>e}],[fl.RemoteControlControlledStatusChange]:[{event:vl,payload:e=>e}]};let Sl=function(e){return e.Question="question",e.UpdateQuestion="updateQuestion",e.Answer="answer",e.DeleteComment="deleteComment",e.DeleteQuestion="deleteQuestion",e.Dismiss="dismiss",e.Reopen="reopen",e.Upvote="upvote",e.AnswerLive="answerLive",e}({}),bl=function(e){return e.QaSettingChange="qa-setting-change",e.QaActionChange="qa-action-change",e}({});const El={[bl.QaSettingChange]:[{event:"QA_SETTING_OPTION_CHANGE",payload:e=>e}],[bl.QaActionChange]:[{event:"QA_NEW_ASK_QUESTION",payload:e=>({action:Sl.Question,data:e})},{event:"QA_UPDATE_ANONYMOUS_QUESTION",payload:e=>({action:Sl.UpdateQuestion,data:e})},{event:"QA_ANSWER_QUESTION",payload:e=>({action:Sl.Answer,data:e})},{event:"QA_ANSWER_REMOVE_COMMENT",payload:e=>({action:Sl.DeleteComment,data:e})},{event:"QA_ANSWER_REMOVE_QUESTION",payload:e=>({action:Sl.DeleteQuestion,data:e})},{event:"QA_ANSWER_DISMISS_QUESTION",payload:e=>({action:Sl.Dismiss,data:e})},{event:"QA_ANSWER_REOPEN_QUESTION",payload:e=>({action:Sl.Reopen,data:e})},{event:"QA_ANSWER_VOTE_QUESTION",payload:e=>({action:Sl.Upvote,data:e})},{event:"QA_ANSWER_QUESTION_LIVE",payload:e=>({action:Sl.AnswerLive,data:e})}]},Il="INVALID_OPERATION",Al="INTERNAL_ERROR",Cl="OPERATION_TIMEOUT",_l="INSUFFICIENT_PRIVILEGES",wl="IMPROPER_MEETING_STATE",Rl="INVALID_PARAMETERS",Ol="AUDIO_ENCODE_SUCCESS",Tl="AUDIO_DECODE_SUCCESS",Dl="VIDEO_ENCODE_SUCCESS",Pl="VIDEO_DECODE_SUCCESS",kl="SHARING_ENCODE_SUCCESS",Ml="SHARING_DECODE_SUCCESS",Ll="AUDIO_ENCODE_FAIL",Nl="AUDIO_DECODE_FAIL",Vl="VIDEO_ENCODE_FAIL",Ul="VIDEO_DECODE_FAIL",jl="SHARING_ENCODE_FAIL",Bl="SHARING_DECODE_FAIL",xl="MEDIA_DEVICE_CHANGE",Fl="MEDIS_SDK_PATHCH_LOADED",Hl="AUDIO_BRIDGE_PEER_CONNECTION_RECEIVE_READY",$l="AUDIO_BRIDGE_PEER_CONNECTION_SEND_READY",Wl="DEVICE_PERMISSION_CHANGE";let Gl=function(e){return e.DeviceChange="device-change",e.MediaSDKChange="media-sdk-change",e.DevicePermissionChange="device-permission-change",e}({});const zl={[Gl.DeviceChange]:[{event:xl,payload:()=>({})}],[Gl.MediaSDKChange]:[{event:Ol,payload:()=>({type:"audio",action:"encode",result:"success"})},{event:Ll,payload:()=>({type:"audio",action:"encode",result:"fail"})},{event:Tl,payload:()=>({type:"audio",action:"decode",result:"success"})},{event:Nl,payload:()=>({type:"audio",action:"decode",result:"fail"})},{event:Dl,payload:()=>({type:"video",action:"encode",result:"success"})},{event:Vl,payload:()=>({type:"video",action:"encode",result:"fail"})},{event:Pl,payload:()=>({type:"video",action:"decode",result:"success"})},{event:Ul,payload:()=>({type:"video",action:"decode",result:"fail"})},{event:kl,payload:()=>({type:"share",action:"encode",result:"success"})},{event:jl,payload:()=>({type:"share",action:"encode",result:"fail"})},{event:Ml,payload:()=>({type:"share",action:"decode",result:"success"})},{event:Bl,payload:()=>({type:"share",action:"decode",result:"fail"})}],[Gl.DevicePermissionChange]:[{event:Wl,payload:e=>e}]},Kl="BREAKOUT_ROOM_ADD_TOKEN",ql="BREAKOUT_ROOM_INVITE_TO_JOIN_NOTIFICATION",Jl="BREAKOUT_ROOM_ROOM_CLOSING_COUNTDOWN",Ql="BREAKOUT_ROOM_ROOM_COUTDOWN",Zl="BREAKOUT_ROOM_BROADCAST_MESSAGE",Yl="BREAKOUT_ROOM_ASK_HELP_REQUEST",Xl="BREAKOUT_ROOM_ASK_HELP_RESPONSE",ec="BREAKOUT_ROOM_ATTRIBUTE_INDICATION",tc="BREAKOUT_ROOM_JOIN_BO_RESPONSE",oc="BREAKOUT_ROOM_ROOM_COUNTDOWN_TIME_UP",nc="BREAKOUT_ROOM_CURRENT_USER_PARTICIPANT_ROLE",rc="BREAKOUT_ROOM_LOAD_PRE_ASSIGNED_ROOMS",ic="BREAKOUT_ROOM_MAIN_SESSION_USER_UPDATE",sc="BREAKOUT_ROOM_INVITE_TO_BACK_NOTIFICATION",ac="BREAKOUT_ROOM_IN_ROOM_USER_STATUS_UPDATE",uc="BREAKOUT_ROOM_BROADCAST_VOICE";let dc=function(e){return e.InviteToJoin="invite-to-join",e.RoomCountdown="room-countdown",e.RoomTimeUp="room-time-up",e.ClosingRoomCountdown="closing-room-countdown",e.BroadcastMessage="broadcast-message",e.AskForHelp="ask-for-help",e.AskForHelpResponse="ask-for-help-response",e.RoomStateChange="room-state-change",e.MainSessionUserUpdate="main-session-user-updated",e.InviteToBack="invite-back-to-main-session",e.RoomUserUpdate="room-user-update",e.BroadcastVoice="broadcast-voice",e}({});const lc={[dc.InviteToJoin]:[{event:ql,payload:e=>e}],[dc.RoomCountdown]:[{event:Ql,payload:e=>e}],[dc.RoomTimeUp]:[{event:oc,payload:e=>e}],[dc.ClosingRoomCountdown]:[{event:Jl,payload:e=>e}],[dc.BroadcastMessage]:[{event:Zl,payload:e=>e}],[dc.AskForHelp]:[{event:Yl,payload:e=>e}],[dc.AskForHelpResponse]:[{event:Xl,payload:e=>e}],[dc.RoomStateChange]:[{event:ec,payload:e=>({status:e.controlStatus})}],[dc.MainSessionUserUpdate]:[{event:ic,payload:()=>({})}],[dc.InviteToBack]:[{event:sc,payload:e=>e}],[dc.RoomUserUpdate]:[{event:ac,payload:e=>e}],[dc.BroadcastVoice]:[{event:uc,payload:e=>e}]};var cc=function(e){return e.StatusUpdate="archiving-status-update",e.OptionsUpdate="archiving-options-update",e}(cc||{});const pc={[cc.StatusUpdate]:[{event:"ARCHIVING_STATUS_UPDATE",payload:e=>e}],[cc.OptionsUpdate]:[{event:"ARCHIVING_OPTIONS_UPDATE",payload:e=>e}]};let hc=function(e){return e.PollDataChange="poll-data-change",e.PollSizeUpdate="poll-size-update",e.PollStatusUpdate="poll-status-update",e}({});const mc={[hc.PollDataChange]:[{event:"POLL_DATA_CHANGE",payload:e=>e}],[hc.PollSizeUpdate]:[{event:"POLL_SIZE_UPDATE",payload:e=>e}],[hc.PollStatusUpdate]:[{event:"POLL_STATUS_UPDATE",payload:e=>e}]};let vc=function(e){return e.ReactionReceived="reaction-received",e.ReactionRemoved="reaction-removed",e}({});const gc={[vc.ReactionReceived]:[{event:"REACTION_RECEIVED",payload:e=>e}],[vc.ReactionRemoved]:[{event:"REACTION_REMOVED",payload:e=>e}]},fc="SMART_SUMMARY_STATUS_CHANGE",yc="MEETING_QUERY_STATUS_CHANGE";let Sc=function(e){return e.SummaryChange="summary-status-change",e.MeetingQueryChang="meeting-query-status-change",e}({});const bc={[Sc.SummaryChange]:[{event:fc,payload:e=>e}],[Sc.MeetingQueryChang]:[{event:yc,payload:e=>e}]},Ec="LIVE_STREAM_STATUS_CHANGE",Ic={"live-stream-status":[{event:Ec,payload:e=>e}]},Ac={...ra,...da,...fa,...Ea,...La,...Gd,...md,...El,...yl,...zl,...lc,...pc,"closed-caption-message":[{event:"CC_RECEIVE_MESSAGE",payload:e=>e}],"closed-caption-lt-status":[{event:"LT_STATUS_CHANGE",payload:e=>e}],"closed-caption-lt-message":[{event:"LT_RECEIVE_MESSAGE",payload:e=>e}],"closed-caption-status":[{event:"CC_ASSIGN_CC_EDITOR_SUCCESS",payload:e=>e},{event:"CC_STATUS_CHANGE",payload:e=>e}],...mc,...gc,...bc,...Ic},Cc=function(e){return{all:e=e||new Map,on:function(t,o){var n=e.get(t);n?n.push(o):e.set(t,[o])},off:function(t,o){var n=e.get(t);n&&(o?n.splice(n.indexOf(o)>>>0,1):e.set(t,[]))},emit:function(t,o){var n=e.get(t);n&&n.slice().map((function(e){e(o)})),(n=e.get("*"))&&n.slice().map((function(e){e(t,o)}))}}}(),_c=new Map,wc=new Array,Rc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;Cc.emit(e,t)},Oc=e=>new Promise(((t,o)=>{e.fail&&e.fail.length>0?vt(st(Cc,e.success).pipe(ft(1)),ct(...e.fail.map((e=>st(Cc,e).pipe(ft(1),Xe((t=>Be({type:e,payload:t})))))))).subscribe((e=>t(e)),(e=>{"object"==typeof e.payload?o({type:e.type,...e.payload}):void 0===e.payload?o({type:e.type}):o(e)})):st(Cc,e.success).pipe(ft(1)).subscribe((e=>t(e)))})),Tc=function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;return new Promise(((n,r)=>{let i=fe;"string"==typeof e?i=st(Cc,e).pipe(ft(1)):(i=st(Cc,e.event),e.operations&&(i=e.operations.reduce(((e,t)=>e.pipe(t)),i))),vt(i,dt(o).pipe(Et(Be("timeout")))).subscribe((e=>{if(t){const o=t(e);"boolean"==typeof o?o?n(""):r({type:Al}):0===o.ret?n(o.body):r({type:Al,reason:o.body})}else n(e)}),(()=>{r({type:Cl})}))}))},Dc=(e,t)=>void 0!==t?st(Cc,e).pipe(ft(t)):st(Cc,e),Pc=()=>{wc.forEach((e=>{e.unsubscribe()})),wc.length=0,_c.clear()},{setAttendeesList:kc,setAssistantList:Mc,setIsAdmitAllSilentUsers:Lc,resetParticipants:Nc,addFailoverAttendees:Vc,removeFailoverAttendees:Uc,setClearRaiseHand:jc,setClearAttendeeFeedback:Bc,updateAttendeeDisplayName:xc,removeXmppAttendeeUser:Fc,updateXmppAttendeeList:Hc,setAttendeeExtraKey:$c}=Ro({SET_ATTENDEES_LIST:e=>e,SET_ASSISTANT_LIST:e=>e,UPDATE_XMPP_ATTENDEE_LIST:e=>e,RESET_PARTICIPANTS:()=>({}),SET_IS_ADMIT_ALL_SILENT_USERS:e=>e,REMOVE_FAILOVER_ATTENDEES:e=>e,ADD_FAILOVER_ATTENDEES:e=>e,SET_CLEAR_RAISE_HAND:()=>({}),SET_CLEAR_ATTENDEE_FEEDBACK:()=>({}),UPDATE_ATTENDEE_DISPLAY_NAME:e=>e,REMOVE_XMPP_ATTENDEE_USER:e=>e,SET_ATTENDEE_EXTRA_KEY:e=>e});var Wc="NOT_FOUND",Gc=function(e,t){return e===t};function zc(e,t){var o,n,r="object"==typeof t?t:{equalityCheck:t},i=r.equalityCheck,s=void 0===i?Gc:i,a=r.maxSize,u=void 0===a?1:a,d=r.resultEqualityCheck,l=function(e){return function(t,o){if(null===t||null===o||t.length!==o.length)return!1;for(var n=t.length,r=0;r-1){var r=o[n];return n>0&&(o.splice(n,1),o.unshift(r)),r.value}return Wc}return{get:n,put:function(t,r){n(t)===Wc&&(o.unshift({key:t,value:r}),o.length>e&&o.pop())},getEntries:function(){return o},clear:function(){o=[]}}}(u,l);function p(){var t=c.get(arguments);if(t===Wc){if(t=e.apply(null,arguments),d){var o=c.getEntries().find((function(e){return d(e.value,t)}));o&&(t=o.value)}c.put(arguments,t)}return t}return p.clearCache=function(){return c.clear()},p}function Kc(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n{let{participants:{attendeesList:t}}=e;return t},Qc=e=>{let{meeting:{userId:t}}=e;return t},Zc=e=>{let{participants:{xmppAttendeeList:t}}=e;return t};let Yc=function(e){return e[e.Attendee=0]="Attendee",e[e.Host=1]="Host",e[e.Owner=4]="Owner",e[e.ViewOnly=8]="ViewOnly",e[e.HostOwner=5]="HostOwner",e[e.ViewOnlyCanTalk=24]="ViewOnlyCanTalk",e}({}),Xc=function(e){return e[e.Host=10]="Host",e[e.Panelist=20]="Panelist",e[e.Attendee=30]="Attendee",e}({}),ep=function(e){return e[e.Client=9]="Client",e[e.Phone=5]="Phone",e[e.H323=15]="H323",e[e.Assitant=51]="Assitant",e}({});const tp=e=>(e&Yc.Host)===Yc.Host,op=e=>(e&ep.Phone)===ep.Phone,np=e=>e===Yc.ViewOnlyCanTalk,rp=e=>(e&Yc.ViewOnly)===Yc.ViewOnly;let ip=function(e){return e[e.Automatically=1]="Automatically",e[e.Manually=2]="Manually",e[e.SelfSelect=3]="SelfSelect",e}({}),sp=function(e){return e[e.NotStarted=1]="NotStarted",e[e.InProgress=2]="InProgress",e[e.Closing=3]="Closing",e[e.Closed=4]="Closed",e}({}),ap=function(e){return e[e.NoToken=1]="NoToken",e[e.GotToken=2]="GotToken",e[e.Started=3]="Started",e[e.Closing=4]="Closing",e[e.Closed=5]="Closed",e}({}),up=function(e){return e.Initial="initial",e.Invited="invited",e.Joining="joining",e.InRoom="in room",e.Leaving="leaving",e.TimeUp="time up",e.MainSession="main session",e}({}),dp=function(e){return e.Join="joinRequest",e.Switch="switchRequest",e.Leave="leaveRequest",e.Broadcast="messageText",e.HelpReq="helpRequest",e.HelpRes="helpResponse",e.CoHostWantJoinThisBo="wantJoinThisBO",e.BOActivity="BOActivity",e}({}),lp=function(e){return e[e.Received=0]="Received",e[e.Busy=1]="Busy",e[e.Ignore=2]="Ignore",e[e.AlreadyInRoom=3]="AlreadyInRoom",e}({}),cp=function(e){return e[e.AskToLeave=0]="AskToLeave",e[e.ClosingRoom=1]="ClosingRoom",e}({}),pp=function(e){return e[e.Active=0]="Active",e[e.Ask=1]="Ask",e}({}),hp=function(e){return e[e.Connect=1]="Connect",e[e.Muted=2]="Muted",e[e.Voip=4]="Voip",e}({}),mp=function(e){return e[e.Connect=8]="Connect",e[e.On=16]="On",e}({}),vp=function(e){return e[e.Share=32]="Share",e[e.ShareAudio=64]="ShareAudio",e}({});const gp=e=>{let{breakoutRoom:t}=e;return t&&t.controlStatus},fp=e=>{let{breakoutRoom:t}=e;return t&&t.currentRoom.status},yp=qc([Qc,Jc],((e,t)=>t.find((t=>t.userId===e)))),Sp=qc([yp],(e=>(null==e?void 0:e.isHost)||(null==e?void 0:e.bCoHost))),bp=qc([yp],(e=>null==e?void 0:e.isHost)),Ep=qc([Zc],(e=>e.filter((e=>e.userRole===Xc.Attendee)))),Ip=qc([Jc],(e=>e.filter((e=>e.bHold&&!e.bid)))),Ap=qc([Jc,gp,fp],((e,t,o)=>t!==sp.InProgress&&t!==sp.Closing||o!==up.InRoom?e.filter((e=>!e.bHold&&!e.bid)):e.filter((e=>!e.bHold)))),Cp=qc([e=>{let{participants:{assistantList:t}}=e;return t}],(e=>e)),_p=qc([Ap],(e=>e.find((e=>e.isHost)))),wp=qc([Ap],(e=>e.filter((e=>e.bCoHost)))),Rp=qc([yp,Ap],((e,t)=>t.filter((t=>t.userId!==(null==e?void 0:e.userId)))));qc([Zc],(e=>e.reduce(((e,t)=>{const{jid:o}=t;return Object.assign(e,{[o]:t}),e}),{}))),qc([Zc,e=>{let{meeting:{jid:t}}=e;return t}],((e,t)=>{var o;return null===(o=e.find((e=>e.jid===t)))||void 0===o?void 0:o.userId}));const Op=qc([Jc],(function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).some((e=>(null==e?void 0:e.bLocalRecord)===Ca.Start))})),Tp=qc([gp,e=>{let{meeting:t}=e;return t&&t.meetingOptions},Jc,bp],((e,t,o,n)=>{const r=o.filter((e=>e.bCoHost)),{moveToWRIfHostLeave:i}=t,s=e===sp.InProgress;return n&&!!i&&r.length<=0&&!s&&o.length>1}));qc([Jc,fp,e=>{let{breakoutRoom:t}=e;return t&&t.mainSessionAttendeeList}],((e,t,o)=>(t===up.InRoom?o:e).filter((e=>{return!(e.bHold||e.isHost||e.audio===Iu.Phone||op(null==e?void 0:e.userType)||(t=null==e?void 0:e.caps,o=null==e?void 0:e.bMultiStreamVideoUser,((e,t)=>(e=>!!(128&e))(e)&&void 0!==t)(t,o)&&o));var t,o}))));let Dp=function(e){return e.Closed="closed",e.Connecting="connecting",e.Connected="connected",e}({});function Pp(e){return 1<e,SET_ARCHIVING_SESSION_READY:e=>e,SET_ARCHIVING_OPTIONS:e=>e,RESET_ARCHIVING:()=>{}}),{setIsLiveTranscriptionEnabled:Hg,setLiveTranscriptionMeetingOptions:$g,setIsLiveTranscriptionManualCaptionerEnabled:Wg,setLiveTranscriptionGatewayId:Gg,setLiveTranscriptionSupportedLanguage:zg,setIsLiveTranscriptionSubscribed:Kg,setCurrentTranscriptionLang:qg,setCurrentTranslationLang:Jg,addLiveTranscriptionMessage:Qg,updateLiveTranscriptionMessage:Zg,reduceLiveTranscriptionMessages:Yg,setLiveTranscriptionEngineType:Xg,removeLiveTranscriptionFailoverState:ef,setLiveTranscriptionLastCaptionMessage:tf,resetLiveTranscription:of,setIsHostDisableCaptions:nf}=Ro("SET_IS_LIVE_TRANSCRIPTION_ENABLED","SET_LIVE_TRANSCRIPTION_MEETING_OPTIONS","SET_IS_LIVE_TRANSCRIPTION_MANUAL_CAPTIONER_ENABLED","SET_LIVE_TRANSCRIPTION_GATEWAY_ID","SET_LIVE_TRANSCRIPTION_SUPPORTED_LANGUAGE","SET_IS_LIVE_TRANSCRIPTION_SUBSCRIBED","SET_CURRENT_TRANSCRIPTION_LANG","SET_CURRENT_TRANSLATION_LANG","ADD_LIVE_TRANSCRIPTION_MESSAGE","UPDATE_LIVE_TRANSCRIPTION_MESSAGE","REDUCE_LIVE_TRANSCRIPTION_MESSAGES","SET_LIVE_TRANSCRIPTION_ENGINE_TYPE","REMOVE_LIVE_TRANSCRIPTION_FAILOVER_STATE","SET_LIVE_TRANSCRIPTION_LAST_CAPTION_MESSAGE","RESET_LIVE_TRANSCRIPTION"," SET_IS_HOST_DISABLE_CAPTIONS"),{setPollData:rf,setPollingId:sf,setPollingWebLinks:af,setPollingDocMaxSize:uf,setPollingDocSize:df,setPollingDocLibraryMaxSize:lf,setPollingDocLibrarySize:cf,resetPoll:pf}=Ro("SET_POLL_DATA","SET_POLLING_ID","SET_POLLING_WEB_LINKS","SET_POLLING_DOC_MAX_SIZE","SET_POLLING_DOC_SIZE","SET_POLLING_DOC_LIBRARY_MAX_SIZE","SET_POLLING_DOC_LIBRARY_SIZE","RESET_POLL"),{setLoggerInitOptions:hf,setIsLaplaceInitialized:mf,resetLogger:vf}=Ro("SET_LOGGER_INIT_OPTIONS","SET_IS_LAPLACE_INITIALIZED","RESET_LOGGER"),{setIsLiveStreamEnable:gf,setLiveStreamStatus:ff,resetLiveStream:yf}=Ro("SET_IS_LIVE_STREAM_ENABLE","SET_LIVE_STREAM_STATUS","RESET_LIVE_STREAM");var Sf={exports:{}},bf={};!function(e,t){var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},o(e,t)};function n(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,o=1,n=arguments.length;o90||o||(e(t+=(100-t)/50),requestAnimationFrame(n))};return n(),{finish:function(){100===t||o||(t=100,e(100))},abort:function(){100===t||o||(o=!0)},get curProgress(){return t}}}function R(){}function O(){O.init.call(this)}function T(e){return void 0===e._maxListeners?O.defaultMaxListeners:e._maxListeners}function D(e,t,o,n){var r,i,s;if("function"!=typeof o)throw new TypeError('"listener" argument must be a function');if((i=e._events)?(i.newListener&&(e.emit("newListener",t,o.listener?o.listener:o),i=e._events),s=i[t]):(i=e._events=new R,e._eventsCount=0),s){if("function"==typeof s?s=i[t]=n?[o,s]:[s,o]:n?s.unshift(o):s.push(o),!s.warned&&(r=T(e))&&r>0&&s.length>r){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(a)}}else s=i[t]=o,++e._eventsCount;return e}function P(e,t,o){var n=!1;function r(){e.removeListener(t,r),n||(n=!0,o.apply(e,arguments))}return r.listener=o,r}function k(e){var t=this._events;if(t){var o=t[e];if("function"==typeof o)return 1;if(o)return o.length}return 0}function M(e,t){for(var o=new Array(t);t--;)o[t]=e[t];return o}R.prototype=Object.create(null),O.EventEmitter=O,O.usingDomains=!1,O.prototype.domain=void 0,O.prototype._events=void 0,O.prototype._maxListeners=void 0,O.defaultMaxListeners=10,O.init=function(){this.domain=null,O.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new R,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},O.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},O.prototype.getMaxListeners=function(){return T(this)},O.prototype.emit=function(e){var t,o,n,r,i,s,a,u="error"===e;if(s=this._events)u=u&&null==s.error;else if(!u)return!1;if(a=this.domain,u){if(t=arguments[1],!a){if(t instanceof Error)throw t;var d=new Error('Uncaught, unspecified "error" event. ('+t+")");throw d.context=t,d}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(o=s[e]))return!1;var l="function"==typeof o;switch(n=arguments.length){case 1:!function(e,t,o){if(t)e.call(o);else for(var n=e.length,r=M(e,n),i=0;i0;)if(o[i]===t||o[i].listener&&o[i].listener===t){s=o[i].listener,r=i;break}if(r<0)return this;if(1===o.length){if(o[0]=void 0,0==--this._eventsCount)return this._events=new R,this;delete n[e]}else!function(e,t){for(var o=t,n=o+1,r=e.length;n0?Reflect.ownKeys(this._events):[]};var L=function(e){function t(t){var o=e.call(this)||this;return o.timeout=(null==t?void 0:t.timeout)||3e4,o}return n(t,e),t.prototype.clearTimeoutCheck=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)},t.prototype.startTimeoutCheck=function(){var e=this;!this.timeoutTimer&&!this.finished&&this.timeout>0&&(this.timeoutTimer=setTimeout((function(){e.finished||(e.finished=!0,e.data=null,e.emit("timeout")),e.clearTimeoutCheck()}),this.timeout))},t}(O),N=function(e){function t(t){var o=e.call(this,t)||this;return o.uuid=l(),o.domParams=t||{},o}return n(t,e),t.prototype.jsonp=function(){var e=this;if(!this.finished){var t=this.domParams,o=t.url,n=t.jsonpCallbackName,r=void 0===n?"callback":n,i=t.body,s=t.integrity;this.script=document.createElement("script"),s&&(this.script.integrity=s,this.script.crossOrigin="anonymous");var a="";i&&Object.entries(i).forEach((function(e){var t=e[0],o=e[1];a+=(a?"&":"")+t+"="+o})),a+=(a?"&":"")+r+"="+this.uuid,this.script.src=o+(o.includes("?")?"":"?")+a,this.jsonpCallback(),this.progressMonitory=w((function(t){e.finished||e.emit("progressUpdated",t)})),document.body.appendChild(this.script)}},t.prototype.clearSideEffect=function(e){if(void 0===e&&(e=!1),document.body.removeChild(this.script),e){var t=this.uuid;window[this.uuid]=function(){window[t]&&delete window[t]}}else delete window[this.uuid];this.script=null,this.uuid=null,this.finished=!0,this.data=null,this.clearTimeoutCheck()},t.prototype.jsonpCallback=function(){var e=this;this.script.onerror=function(t){var o;e.finished||(e.clearSideEffect(),null===(o=e.progressMonitory)||void 0===o||o.abort(),e.emit("error",new Error("string"==typeof t?t:"load jsonp script failed")))},window[this.uuid]=function(t){var o;if(!e.finished){var n=e.domParams,r=n.encoding,i=n.blobType,s=n.unZipOptions,a=n.beforeTransformData,u=n.afterTransformData;null===(o=e.progressMonitory)||void 0===o||o.finish(),e.clearSideEffect(),(a?a(t||""):Promise.resolve(t||"")).then((function(t){return _(t,{encoding:r,blobType:i,unZipOptions:s}).then((function(t){return(u?u(t):Promise.resolve(t)).then((function(t){return e.emit("finished",t)}))}))})).catch((function(t){return e.emit("error",t)}))}}},t.prototype.abort=function(){this.clearSideEffect(!0)},t}(L),V=function(e){function t(t){var o=e.call(this,t)||this;return o.socketParams=t||{},o}return n(t,e),t.prototype.write=function(e,t){e&&!this.finished&&(e instanceof Error?this.handleError(e):(this.data?this.appendData(e):this.data=e,this.handlePerCentUpdate(t)))},t.prototype.handlePerCentUpdate=function(e){void 0===e||this.finished||this.emit("progressUpdated",e)},t.prototype.handleError=function(e){this.data=null,this.finished=!0,this.clearTimeoutCheck(),this.emit("error",e)},t.prototype.appendData=function(e){u(e)===u(this.data)?"string"==typeof e?this.data+=e:Blob&&e instanceof Blob?this.data=new Blob([this.data,e],{type:e.type}):ArrayBuffer&&e instanceof ArrayBuffer&&(this.data=s(this.data,e)):this.handleError(new Error("every piece of the data format must be the same"))},t.prototype.end=function(e){var t=this;if(!this.finished){this.handlePerCentUpdate(100),e&&this.write(e);var o=this.socketParams,n=o.encoding,r=o.blobType,i=o.unZipOptions,s=o.beforeTransformData,a=o.afterTransformData;(s?s(this.data):Promise.resolve(this.data)).then((function(e){return _(e,{encoding:n,blobType:r,unZipOptions:i}).then((function(e){return(a?a(e):Promise.resolve(e)).then((function(e){return t.emit("finished",e)}))}))})).catch((function(e){return t.emit("error",e)})),this.data=null,this.finished=!0,this.clearTimeoutCheck()}},t.prototype.abort=function(){this.data=null,this.finished=!0,this.clearTimeoutCheck()},t}(L),U=function(t){function o(e){var o=t.call(this,e)||this;return o.xhrParams=e||{},o.xhrParams.headers=r({},o.xhrParams.headers||{}),o}return n(o,t),o.prototype.supportFetch=function(){return!!window.fetch&&window.AbortController&&window.Request},o.prototype.ajax=function(){var t=this;if(!this.finished)if(this.xhrParams.url){var o=this.xhrParams,n=o.headers,i=void 0===n?{}:n,s=o.url,a=o.body,u=void 0===a?{}:a,d=o.method,l=void 0===d?"POST":d,c=o.encoding,p=o.integrity;this.controller=this.supportFetch()?new AbortController:new XMLHttpRequest;var h=this.supportFetch()?w((function(e){t.finished||t.emit("progressUpdated",e)})):null;(this.supportFetch()?fetch(new Request(s,r({method:l,headers:i,body:"GET"===l?void 0:JSON.stringify(u),signal:this.controller.signal},p?{integrity:p,mode:"cors"}:{}))).then((function(t){return t.ok?c===e.TransformDataFormat.STRING?t.text():c===e.TransformDataFormat.ARRAY_BUFFER?t.arrayBuffer():t.blob():Promise.reject(new Error("xhr download "+s+" failed!"))})):new Promise((function(o,n){var r=new XMLHttpRequest;t.controller=r,r.open(l,s),r.responseType=c===e.TransformDataFormat.STRING?"text":c===e.TransformDataFormat.ARRAY_BUFFER?"arraybuffer":"blob",Object.entries(i).forEach((function(e){var t=e[0],o=e[1];r.setRequestHeader(t,o)})),r.onload=function(){var e=r.status,t=r.response,i=r.statusText;e>=200&&e<300||304===e?o(t):n(new Error(e+": "+i))},r.onprogress=function(e){var o=e||{},n=o.total,r=o.loaded;void 0===r||t.finished||(n?t.emit("progressUpdated",r/n*100):r&&!h&&(h=w((function(e){t.finished||t.emit("progressUpdated",e)}))))},r.onerror=function(){n(new Error("xhr download "+s+" failed!"))},r.send(JSON.stringify(u))}))).then((function(e){if(!t.finished){var o=t.xhrParams,n=o.encoding,r=o.blobType,i=o.unZipOptions,s=o.beforeTransformData,a=o.afterTransformData;null==h||h.finish(),t.finished=!0,t.clearTimeoutCheck(),(s?s(e):Promise.resolve(e)).then((function(e){return _(e,{encoding:n,blobType:r,unZipOptions:i}).then((function(e){return(a?a(e):Promise.resolve(e)).then((function(e){return t.emit("finished",e)}))}))})).catch((function(e){return t.emit("error",e)}))}})).catch((function(e){t.finished||(t.finished=!0,t.clearTimeoutCheck(),null==h||h.abort(),t.emit("error",e))}))}else this.emit("error",new Error("xhrDownloader url params invalid!"))},o.prototype.abort=function(){this.data=null,this.finished=!0,this.clearTimeoutCheck(),this.controller.abort()},o}(L),j=0;O.defaultMaxListeners=500;var B,x=new O,F="ThreadPoolReady",H=function(){j-=1,x.emit(F)};(B=e.DownloaderType||(e.DownloaderType={})).XHR="xhr",B.DOM="dom",B.SOCKET="socket";var $=function(t){function o(o){var n=t.call(this)||this;return n.aborted=!1,n.downloadParmas=r({type:e.DownloaderType.XHR},o),n.id=l(),n}return n(o,t),o.prototype.start=function(){var t=this;j+=1,this.progress=0,this.emit("downloadStart"),this.onDownloadStartCallback&&this.onDownloadStartCallback();var o=this.downloadParmas,n=o.type,r=o.xhrParams,i=o.domParams,s=o.socketParams;switch(n){case e.DownloaderType.DOM:this.downloader=new N(i),this.downloader.jsonp();break;case e.DownloaderType.SOCKET:this.downloader=new V(s);break;default:this.downloader=new U(r),this.downloader.ajax()}return this.downloader.startTimeoutCheck(),this.downloader.on("error",(function(e){t.emit("error",e),t.onErrorCallback&&t.onErrorCallback(e),H()})).on("finished",(function(e){t.emit("complete",e),t.onCompleteCallback&&t.onCompleteCallback(e),H()})).on("progressUpdated",(function(e){t.progress=e,t.emit("progressUpdated",e),t.onProgressUpdatedCallback&&t.onProgressUpdatedCallback(e)})).on("timeout",(function(){t.emit("timeout"),t.onTimeoutCallback&&t.onTimeoutCallback(),H()})),this},o.prototype.abort=function(){if(this.aborted)return this;this.aborted=!0,this.downloader&&!this.downloader.finished&&this.downloader.abort();var e=new Error("file download has been aborted");return this.emit("abort",e),this.onAbortCallback&&this.onAbortCallback(e),H(),this},o.prototype.onDownloadStart=function(e){return this.onDownloadStartCallback=e,this},o.prototype.onProgressUpdated=function(e){return this.onProgressUpdatedCallback=e,this},o.prototype.onError=function(e){return this.onErrorCallback=e,this},o.prototype.onComplete=function(e){return this.onCompleteCallback=e,this},o.prototype.onAbort=function(e){return this.onAbortCallback=e,this},o.prototype.onTimeout=function(e){return this.onTimeoutCallback=e,this},o.prototype.isInProgress=function(){return void 0!==this.progress},o.prototype.isFinished=function(){return 100===this.progress},o}(O),W=function(){function e(e){this.taskList=[],this.options=e||{};var t=this.options.threadLimit;if((void 0===t?6:t)>6)throw new Error("threadLimit must be lower than 6");x.on(F,this.startNextTask.bind(this))}return e.prototype.download=function(e){var t=new $(e),o=this.removeTask.bind(this,t);return t.on("abort",o),this.taskList.push(t),this.checkTaskReady(t),t},e.prototype.startNextTask=function(){var e=this.taskList.find((function(e){return!e.isInProgress()}));e&&this.checkTaskReady(e)},e.prototype.checkTaskReady=function(e){var t=this.options.threadLimit,o=void 0===t?6:t;if(!(this.taskList.findIndex((function(e){return!e.isInProgress()}))>=o||j+1>6)){var n=this.removeTask.bind(this,e);e.on("complete",n),e.on("error",n),e.on("timeout",n),setTimeout((function(){return e.start()}),0)}},e.prototype.removeTask=function(e){var t=this;this.taskList.some((function(o,n){return o===e&&(setTimeout((function(){return e.removeAllListeners()}),0),t.taskList.splice(n,1),!0)}))},e}();e.DownloadTask=$,e.IDownloadManager=W,e.appendBuffer=s,e.arrayBufferToBlob=h,e.arrayBufferToString=m,e.blobToArrayBuffer=c,e.blobToText=p,e.genUuid=l,e.getDataFormat=u,e.getExtName=f,e.getFileName=S,e.getFullPathName=y,e.isImgFile=b,e.isJsonFile=E,e.isVersionFile=I,e.monitorProgress=w,e.sep=a,e.stringToArrayBuffer=g,e.stringToBlob=v,e.transformData=_,Object.defineProperty(e,"__esModule",{value:!0})}(bf,Qt(Object.freeze({__proto__:null,default:{}}))),Jt(bf),function(e,t){var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])},o(e,t)};function n(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,o=1,n=arguments.length;o0&&u.length>r){u.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=u.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(d)}}else u=s[t]=o,++e._eventsCount;return e}function d(e,t,o){var n=!1;function r(){e.removeListener(t,r),n||(n=!0,o.apply(e,arguments))}return r.listener=o,r}function l(e){var t=this._events;if(t){var o=t[e];if("function"==typeof o)return 1;if(o)return o.length}return 0}function c(e,t){for(var o=new Array(t);t--;)o[t]=e[t];return o}i.prototype=Object.create(null),s.EventEmitter=s,s.usingDomains=!1,s.prototype.domain=void 0,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.init=function(){this.domain=null,s.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new i,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return a(this)},s.prototype.emit=function(e){var t,o,n,r,i,s,a,u="error"===e;if(s=this._events)u=u&&null==s.error;else if(!u)return!1;if(a=this.domain,u){if(t=arguments[1],!a){if(t instanceof Error)throw t;var d=new Error('Uncaught, unspecified "error" event. ('+t+")");throw d.context=t,d}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(o=s[e]))return!1;var l="function"==typeof o;switch(n=arguments.length){case 1:!function(e,t,o){if(t)e.call(o);else for(var n=e.length,r=c(e,n),i=0;i0;)if(o[s]===t||o[s].listener&&o[s].listener===t){a=o[s].listener,r=s;break}if(r<0)return this;if(1===o.length){if(o[0]=void 0,0==--this._eventsCount)return this._events=new i,this;delete n[e]}else!function(e,t){for(var o=t,n=o+1,r=e.length;n0?Reflect.ownKeys(this._events):[]};var p="ZipInfo:";function h(e){var t;return null===(t=null==e?void 0:e.path)||void 0===t?void 0:t.startsWith(p)}function m(e){return"string"==typeof e&&e.startsWith(p)}function v(e,t){return(Array.isArray(e)?e:[e]).some((function(e){if("number"!=typeof e.version)throw new Error("file version must be an int number");return e.version=0;r--){var i=o.memoryFiles[r];("string"==typeof e&&(i.path===e||i.path.startsWith(""+e+t.sep))||e.path===i.path)&&o.memoryFiles.splice(r,1)}n(!0)}))},o.prototype.clear=function(){var e=this;return new Promise((function(t){e.memoryFiles=[],t(!0)}))},o.prototype.findFileByPath=function(e){var t=this;return new Promise((function(o){o(t.memoryFiles.filter((function(t){return t.path===e}))[0])}))},o.prototype.findFileBySourceURL=function(e){var t=this;return new Promise((function(o){o(t.memoryFiles.filter((function(t){return t.sourceURL===e})))}))},o.prototype.isDirectory=function(e){var o=this;return new Promise((function(n){m(e)?n(!1):n(o.memoryFiles.some((function(o){return o.path.startsWith(""+e+t.sep)})))}))},o.prototype.ls=function(e){var o=this;return new Promise((function(n){var r=[];o.memoryFiles.forEach((function(o){if(!h(o))if(e){if(o.path.startsWith(""+e+t.sep)){var n=o.path.split(""+e+t.sep)[1]||"";if(n.includes(t.sep)){var i=""+e+t.sep+n.split(t.sep)[0];return void(i&&!r.includes(i)&&r.push(i))}r.push(o)}}else if(o.path.includes(t.sep)){var s=o.path.split(t.sep)[0]||"";s&&!r.includes(s)&&r.push(s)}else r.push(o)})),n(r)}))},o}(y),I=function(e){function o(t){var o=e.call(this)||this;if(o.isLocalAvaliable=void 0,o.isEnable()){var n=(t||{}).nameSpaceId;o.storageName=function(e){return"resource-manager"+(e?"-"+e:"")}(n)}return o}return n(o,e),o.prototype.isEnable=function(){if(void 0!==this.isLocalAvaliable)return this.isLocalAvaliable;try{this.isLocalAvaliable=!0,localStorage.setItem("privateTest","")}catch(e){this.isLocalAvaliable=!1}return this.isLocalAvaliable},o.prototype.saveFile=function(e){var t=this;return this.isEnable()?new Promise((function(o){var n=t.getLocalFile();n.some((function(t,o){return t.path===e.path&&(n.splice(o,1,e),!0)}))||n.push(e),localStorage.setItem(t.storageName,JSON.stringify(n)),o(!0)})):Promise.resolve(!1)},o.prototype.getLocalFile=function(){var e=localStorage.getItem(this.storageName),t=[];if(e)try{t=JSON.parse(e)||"[]"}catch(e){console.log(e)}return t},o.prototype.removeFile=function(e){var o=this;return this.isEnable()?new Promise((function(n){for(var r=o.getLocalFile(),i=r.length-1;i>=0;i--){var s=r[i];("string"==typeof e&&(s.path===e||s.path.startsWith(""+e+t.sep))||e.path===s.path)&&r.splice(i,1)}localStorage.setItem(o.storageName,JSON.stringify(r)),n(!0)})):Promise.resolve(!1)},o.prototype.clear=function(){var e=this;return this.isEnable()?new Promise((function(t){localStorage.removeItem(e.storageName),t(!0)})):Promise.resolve(!1)},o.prototype.findFileByPath=function(e){var t=this;return this.isEnable()?new Promise((function(o){o(t.getLocalFile().filter((function(t){return t.path===e}))[0])})):Promise.resolve(void 0)},o.prototype.findFileBySourceURL=function(e){var t=this;return this.isEnable()?new Promise((function(o){o(t.getLocalFile().filter((function(t){return t.sourceURL===e})))})):Promise.resolve([])},o.prototype.isDirectory=function(e){var o=this;return this.isEnable()?new Promise((function(n){m(e)?n(!1):n(o.getLocalFile().some((function(o){return o.path.startsWith(""+e+t.sep)})))})):Promise.resolve(!1)},o.prototype.ls=function(e){var o=this;return this.isEnable()?new Promise((function(n){var r=[];o.getLocalFile().forEach((function(o){if(!h(o))if(e){if(o.path.startsWith(""+e+t.sep)){var n=o.path.split(""+e+t.sep)[1]||"";if(n.includes(t.sep)){var i=""+e+t.sep+n.split(t.sep)[0];return void(i&&!r.includes(i)&&r.push(i))}r.push(o)}}else if(o.path.includes(t.sep)){var s=o.path.split(t.sep)[0]||"";s&&!r.includes(s)&&r.push(s)}else r.push(o)})),n(r)})):Promise.resolve([])},o}(y);(f=e.FileStoreEnum||(e.FileStoreEnum={})).MEMORY="memoryStore",f.INDEX_DB="indexedDBStore",f.STORAGE="storageStore";var A=function(o){function i(e){var t=o.call(this)||this;return t.indexedDBStore=new b(e),t.memoryStore=new E,t.storageStore=new I(e),t}return n(i,o),i.prototype.saveFile=function(t,o,n){var i=this;void 0===o&&(o=!0);var s=(n||{}).forceSpecifyStore;return(o?this.findFileByPath(t.path,n):Promise.resolve(void 0)).then((function(o){if((null==o?void 0:o.version)&&v(t,o.version))throw new Error("there is an higher version file existed already");var n=r(r({},t),{createTime:o&&o.createTime||Date.now(),updateTime:Date.now()});return s&&i[s]&&i[s].isEnable()&&(s!==e.FileStoreEnum.STORAGE||i.isLocalStorageAvaliable(n))?i[s].saveFile(n):i[i.saveToTargetStoreRule(n)].saveFile(n)}))},i.prototype.isLocalStorageAvaliable=function(e){var o=e.data;return"string"===t.getDataFormat(o)&&o.length<=102400&&this.storageStore.isEnable()},i.prototype.saveToTargetStoreRule=function(t){return this.indexedDBStore.isEnable()?e.FileStoreEnum.INDEX_DB:this.isLocalStorageAvaliable(t)?e.FileStoreEnum.STORAGE:e.FileStoreEnum.MEMORY},i.prototype.removeFile=function(e,t){var o=(t||{}).forceSpecifyStore;return o&&this[o]?this[o].removeFile(e):Promise.all([this.indexedDBStore.removeFile(e),this.storageStore.removeFile(e),this.memoryStore.removeFile(e)]).then((function(){return!0}))},i.prototype.clear=function(e){var t=(e||{}).forceSpecifyStore;return t&&this[t]?this[t].clear():Promise.all([this.indexedDBStore.clear(),this.storageStore.clear(),this.memoryStore.clear()]).then((function(){return!0}))},i.prototype.findFileByPath=function(e,t){var o=this,n=(t||{}).forceSpecifyStore;return n&&this[n]?this[n].findFileByPath(e):g(this.searchInTargetStoreRule(),(function(t,n){return t?Promise.resolve(t):o[n].findFileByPath(e)}))},i.prototype.findFileBySourceURL=function(e,t){var o=this,n=(t||{}).forceSpecifyStore;return n&&this[n]?this[n].findFileBySourceURL(e):g(this.searchInTargetStoreRule(),(function(t,n){return o[n].findFileBySourceURL(e).then((function(e){return t?t.filter((function(t){return!e.some((function(e){return e.path===t.path}))})).concat(e||[]):e||[]}))}))},i.prototype.searchInTargetStoreRule=function(){return[e.FileStoreEnum.INDEX_DB,e.FileStoreEnum.STORAGE,e.FileStoreEnum.MEMORY]},i.prototype.isDirectory=function(e){var t=this;return e?g(this.searchInTargetStoreRule(),(function(o,n){return o?Promise.resolve(!0):t[n].isDirectory(e)})):Promise.resolve(!0)},i.prototype.ls=function(e){var t=this;return this.isDirectory(e).then((function(o){if(!o)throw new Error("path: "+e+" is an invalid directory path");return g(t.searchInTargetStoreRule(),(function(o,n){return t[n].ls(e).then((function(e){return o?(e||[]).concat(o.filter((function(t){return!e.some((function(e){return"string"==typeof t?e===t:"string"!=typeof e&&e.path===t.path}))}))):e}))}))}))},i}(s),C=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(s),_=function(e){function o(o){var n=e.call(this)||this,r=o||{},i=r.storeOptions,s=r.downloadManagerOptions;return n.downloadManager=new t.IDownloadManager(s),n.store=new A(i),n.store.indexedDBStore.on("ready",(function(){return n.emit("ready")})),n}return n(o,e),o.prototype.getFile=function(e,t,o){var n=this,r=new C,i=Promise.resolve(void 0),s=t||{},a=s.downloadOptions,u=s.forceDownload,d=s.saveRootPath;u?i=Promise.resolve(void 0):"string"==typeof e?i=this.store.findFileByPath(e,o):(null==e?void 0:e.sourceURL)?i=this.store.findFileBySourceURL(e.sourceURL):a&&(a.domParams||a.socketParams||a.xhrParams)&&(i=this.store.findFileBySourceURL(this.genSourceURL(a)));var l=null,c=new Promise((function(e){l=e}));return r.getDownloadTask=function(){return c},i=i.then((function(e){if(e&&(!Array.isArray(e)||e.length)){var t=e;if(Array.isArray(t)){var n=t.find((function(e){return h(e)}));if(!n)return;t=t.filter((function(e){return!h(e)}));var i=n.data;if("string"!=typeof i)return;if(!JSON.parse(i||"[]").every((function(e){return t.some((function(t){return t.path===e}))})))return}if(!(null==o?void 0:o.targetVersion)||!v(t,o.targetVersion))return r.emit("checkExpire",!1),t;r.emit("checkExpire",!0)}})).then((function(t){if(!t&&a){var i=n.downloadManager.download(a);return l(i),new Promise((function(t,s){i.on("complete",(function(i){setTimeout((function(){var s=Array.isArray(i)?i.map((function(e){var t=e.data,r=e.path,i=e.extName;return{path:n.genFilePath(d,r),sourceURL:n.genSourceURL(a),data:t,fileFormat:i||n.getFileFormat(a),version:(null==o?void 0:o.targetVersion)||1}})):{path:n.genFilePath(d,void 0),sourceURL:n.genSourceURL(a),data:i,fileFormat:n.getFileFormat(a),version:(null==o?void 0:o.targetVersion)||1};if(Array.isArray(s)&&"string"==typeof e&&e){var u=s.find((function(t){return t.path===e}));t(u||s)}else t(s);r.emit("beforeSet",s),n.beforeWrite(s,o).then((function(){r.emit("afterSet")})).catch((function(e){return r.emit("afterSet",e)}))}),0)})),i.on("abort",s),i.on("error",s),i.on("timeout",(function(){return s(new Error("download timeout"))}))}))}return l(void 0),t})).catch((function(e){return l(void 0),Promise.reject(e)})),r.getResult=function(){return i},r},o.prototype.genSourceURL=function(e){var o=e.domParams,n=e.type,r=e.xhrParams;if(n===t.DownloaderType.SOCKET)return null;var i=(n===t.DownloaderType.DOM?o:r)||{},s=i.url,a=void 0===s?"":s,u=i.body;return u&&Object.keys(u).length?a+(a.includes("?")?"&":"?")+"downloadBodyParams="+JSON.stringify(u):a},o.prototype.updateFile=function(e,t){return this.saveStore(e,!0,t)},o.prototype.beforeWrite=function(e,t){var o=this;return Array.isArray(e)?Promise.all(e.concat(function(e){var t=e[0].sourceURL||"";return{path:""+p+t,sourceURL:t,data:JSON.stringify(e.map((function(e){return e.path})))}}(e)).map((function(e){return o.saveStore(e,!1,t)}))).then((function(e){return e.filter((function(e){return!h(e)}))})):this.saveStore(e,!0,t)},o.prototype.getFileFormat=function(e){var o=e||{},n=o.xhrParams,r=o.domParams,i=o.socketParams,s=o.type;return s===t.DownloaderType.DOM&&(null==r?void 0:r.fileFormat)?r.fileFormat:s===t.DownloaderType.SOCKET&&(null==i?void 0:i.fileFormat)?i.fileFormat:(null==n?void 0:n.fileFormat)?n.fileFormat:"unknow"},o.prototype.genFilePath=function(e,o){return o?""+(e||"")+(e?t.sep:"")+o:e||""},o.prototype.saveStore=function(e,t,o){return void 0===t&&(t=!0),this.store.saveFile(e,t,o).then((function(t){if(t)return e;throw new Error("fail to save file in local store")}))},o.prototype.remove=function(e,t){return this.store.removeFile(e,t)},o.prototype.clear=function(e){return this.store.clear(e)},o.prototype.list=function(e){return this.store.ls(e)},o.prototype.updateVersion=function(e,t){var o=this;return this.store.findFileByPath(e).then((function(n){if(n)return o.saveStore(r(r({},n),{version:t})).then((function(){}));throw new Error("the target path: "+e+" isn't existed")}))},o.prototype.updateSourceURL=function(e,t){var o=this;return this.store.findFileByPath(e).then((function(n){if(n)return o.saveStore(r(r({},n),{sourceURL:t})).then((function(){}));throw new Error("the target path: "+e+" isn't existed")}))},o}(s);e.IResourceManager=_,Object.defineProperty(e,"__esModule",{value:!0})}(Sf.exports,bf),Jt(Sf.exports);class Ef{constructor(e){this._cancelError=new Error("request for lock canceled"),this._locked=void 0,this._queue=[],this._waiters=[],this._currentReleaser=void 0,e&&(this._cancelError=e),this._locked=!1}acquire(){const e=this.isLocked(),t=new Promise(((e,t)=>this._queue.push({resolve:e,reject:t})));return e||this._dispatch(),t}async runExclusive(e){const t=await this.acquire();try{return await e()}finally{t()}}async waitForUnlock(){return this.isLocked()?new Promise((e=>this._waiters.push({resolve:e}))):Promise.resolve()}isLocked(){return this._locked}release(){if(this._currentReleaser){const e=this._currentReleaser;this._currentReleaser=void 0,e()}}cancel(){this._queue.forEach((e=>e.reject(this._cancelError))),this._queue=[]}_dispatch(){const e=this._queue.shift();if(!e)return;let t=!1;this._currentReleaser=()=>{t||(t=!0,this._locked=!1,this._resolveWaiters(),this._dispatch())},this._locked=!0,e.resolve(this._currentReleaser)}_resolveWaiters(){this._waiters.forEach((e=>e.resolve())),this._waiters=[]}}function If(e,t,o){const n=document.createElement("script");n.type="text/javascript",n.readyState?n.onreadystatechange=()=>{"loaded"!==n.readyState&&"complete"!==n.readyState||(n.onreadystatechange=null,t())}:(n.onload=()=>{t()},n.onerror=()=>{o()}),n.src=e,window.crossOriginIsolated&&(n.crossOrigin="anonymous"),"function"==typeof document.body.append?document.getElementsByTagName("head")[0].append(n):document.getElementsByTagName("head")[0].appendChild(n)}function Af(e,t){let o=e;/^https?:\/\//.test(o)||(o=`https://${e}`);try{const e=new URL(o);if(!t)return e.href;if(t.hostname)return e.hostname;if(t.path)return e.pathname}catch(e){return""}return""}function Cf(e){if(e){var t;const o=document.getElementById(e);null==o||null===(t=o.parentNode)||void 0===t||t.removeChild(o)}}let _f="zoom.us";const wf="3.7.0",Rf=`https://dmogdx0jrul3u.cloudfront.net/${wf}/lib/av`,Of=`https://source.zoom.us/${wf}/lib/av`,Tf=`https://jssdk.zoomus.cn/${wf}/lib/av`,Df=()=>_f,Pf=(e,t,o)=>ot([t,o].map(((t,o)=>{if("initial"!==t)return Ue(["success"===t]);{const t=0===o?"ENCODE":"DECODE";return vt(Dc(`${e.toUpperCase()}_${t}_SUCCESS`,1).pipe(ze((()=>!0))),Dc(`${e.toUpperCase()}_${t}_FAIL`,1).pipe(ze((()=>!1))))}}))),kf=e=>{const t=yp(e.value);return t?je(t):Dc(Hs,1).pipe(Le(pe),Tt(e),ze((e=>{let[,t]=e;return yp(t)})))};function Mf(e,t){var o,n;const r="audio"===e?null===(o=t.audio)||void 0===o?void 0:o.audioSsrc:null===(n=t.video)||void 0===n?void 0:n.videoSsrc,i="audio"===e?Vd:ld;return"audio"===e&&zi()||r?Promise.resolve():Tc(i)}const Lf=()=>Ue(navigator.mediaDevices.enumerateDevices()).pipe(ze((e=>{const t=[],o=[],n=[];return e.forEach((e=>{const{kind:r,deviceId:i,label:s}=e,a=s.replace(/\([\w,\d]+:[\w,\d]+\)/i,"").trim();switch(r){case"audioinput":"communications"===i||/ZoomAudioDevice/i.test(a)||/Zoom-\S*/.test(a)||/CubebAggregateDevice\S*/.test(a)||/Microsoft Teams Audio/i.test(a)||t.push({deviceId:i,label:a});break;case"audiooutput":"communications"===i||/ZoomAudioDevice/i.test(a)||/Microsoft Teams Audio/i.test(a)||o.push({deviceId:i,label:a});break;case"videoinput":n.push({deviceId:i,label:a})}})),{microphones:t,speakers:o,cameras:n}})));function Nf(e){const{x:t,y:o,width:n,height:r}=e.getBoundingClientRect();return{scaleWidth:n,scaleHeight:r,srcOffsetX:t,srcOffsetY:o}}function Vf(e){if(e){let o=e;try{const t=e.width;e.width=t}catch(n){var t;o=e.cloneNode(!0),null===(t=e.parentNode)||void 0===t||t.replaceChild(o,e)}return o}return e}function Uf(){try{return"undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(Wa)}catch(e){return!1}}function jf(){var e;return null===(e=WebAssembly)||void 0===e?void 0:e.validate(Ga)}const Bf=(()=>{const e=new Ef;return{withAudioAction:t=>function(){for(var o=arguments.length,n=new Array(o),r=0;r{let i=!1;const s=setTimeout((()=>{i=!0,e.release()}),3e4);try{await e.acquire(),i||clearTimeout(s),o(t(...n))}catch(e){i||(clearTimeout(s),r(e))}}))},processAudioAction:t=>e.acquire().then((()=>t())),completeAudioAction:()=>{e.release()},cancelAllAudioAction:()=>{e.cancel()}}})();function xf(e){const t=["joinComputerAudio","joinSharingAudio","leaveComputerAudio","leaveSharingAudio"];return new Proxy(e,{get:(e,o)=>"string"==typeof o&&t.includes(o)?function(){return Bf.withAudioAction(e[o].bind(e))(...arguments)}:Reflect.get(e,o)})}function Ff(e){var t;const{browserVersion:o,isChrome:n,isFirefox:r,isSafari:i,isAndroidOrIOSBrowser:s,isSupportMediaStreamTrackProcessor:a,isSupportOffscreenCanvas:u}=Gi,d=Number(null==o||null===(t=o.match(/^\d+/))||void 0===t?void 0:t[0]),l=n&&d>=91,c=r&&d>=89,p=i&&mr(o,"17.4")>=0,h=navigator.hardwareConcurrency>2;let m=qi();return e&&!m&&(m=u&&a),!s&&m&&(l||c||p)&&h}const Hf=(e,t)=>{const o=document.createElement("link");return o.rel="preload",o.href=e,o.as=t,o.crossOrigin="anonymous",o},$f=(e,t,o)=>{const n=[],r=[],i=Array.isArray(e)?e:[e];return Vs.filter((e=>{var o;return i.includes(e.category)&&(e.tag===t||(null===(o=e.tag)||void 0===o?void 0:o.split(",").includes(t)))})).forEach((e=>{"worker"===e.type?n.push(`${o}${e.name}`):"wasm"===e.type&&r.push(`${o}${e.name}`)})),{workers:n,wasms:r}};function Wf(e,t,o){const n={};if("function"!=typeof window.SharedArrayBuffer){const{isIOSMobile:e,isSafari:r,isSupportOffscreenCanvas:i,isSupportMediaStreamTrackProcessor:s}=Gi,a=e||r||i&&s;Object.assign(n,{enableMultiDecodeVideoWithoutSAB:!!t&&a}),i&&s&&Object.assign(n,{enableVirtualBackgroundWithoutSAB:!!o})}return Ff(o)&&Object.assign(n,{resourceManager:Sf.exports.IResourceManager,file:[{path:`${e}/vb-resource/dualModel.bin`,type:"bin"},{path:`${e}/vb-resource/tf.min.js`,type:"js"}]}),n}function Gf(e,t){const{media:{isAudioBridgeReceiveReady:o,isAudioBridgeSendReady:n},audio:{customizeAudioOption:r}}=e,i=void 0!==t?t:!(null==r||!r.speakerOnly);return ot([o?Ue([!0]):Dc(Hl,1).pipe(yt(!0)),n||i?Ue([!0]):Dc($l,1).pipe(yt(!0))])}function zf(e,t,o){if(e.deviceId===t)return!0;if("default"===t){const n=o.find((e=>e.deviceId===t));if(n)return n.label.indexOf(e.label)>-1}return!1}function Kf(e){return e.find((e=>"default"===e.deviceId))}const qf=(()=>{let e,t=!1;return{watch:function(o){t=!0,e=Promise.race([o,yr((()=>!0),1e4)]).then((()=>{e=void 0,t=!1})).finally((()=>{e=void 0,t=!1}))},acquire:function(){return t&&e?e:Promise.resolve()}}})(),Jf=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{socket:{zoomSocketStatus:o,xmppSocketStatus:n,mainSessionSocketStatus:r},meeting:{meetingStatus:i}}=e,s=[];if(i===Ti.Joined){var a;const t=Fs.getInstance(),o=Ls.createAgent();if((null===(a=yp(e))||void 0===a?void 0:a.audio)===Iu.Computer&&t.leaveComputerAudio(),t.disconnect(),qf.watch(t.destroy()),e.video&&(e.video.subscribedVideoList.length>0&&e.video.subscribedVideoList.forEach((e=>{o.unsubscribeVideo(e)})),e.video.isCurrentUserStartedVideo&&Rc(zu)),e.share&&e.share.isReceiveSharing){const t=e.share.activeNodeId;e.share.remoteControlledUserList.length>0&&e.share.remoteControlledUserList.forEach((e=>{o.sharingRequestRemoteControl(e,!1)})),o.unsubscribeSharing(t)}}if(t||(Ni.clearSession(),[Vi.WebclientTk,Vi.WebclientZsk,Vi.WebclientZtk,Vi.WebclientRecordingToken].forEach((e=>{sessionStorage.removeItem(e)})),rs.destroy()),o!==Dp.Closed&&s.push(No()),n!==Dp.Closed&&s.push(Vo()),r!==Dp.Closed&&s.push(Fo()),t){const o=yp(e);s.push(ei({audio:null==o?void 0:o.audio,muted:null==o?void 0:o.muted,video:null==o?void 0:o.bVideoOn,isFailover:t}))}else s.push(ei({audio:!1,muted:void 0,video:!1,isFailover:t}));return s.push(qo(),mn(),Nc(),qp(t),am(),Sm(t),Ev(),_v(),Mg(),Zv(),lg(),Ug(),Fg(),of(t),pf(),vf(t),yf(t),ui(Ti.Closed)),s},Qf=function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;nt.find((t=>t.userId===e)))),mt((e=>!!e)),ft(1)]},...o)},Zf={[`${Di.AudioBridgeEnable}`]:{mask:240,action:vi},[`${Di.AudioDecodeInWorklet}`]:{mask:15,action:sn},[`${Di.VideoFullHD}`]:{mask:15,action:tv},[`${Di.VideoShareFullHD}`]:{mask:15,action:sm},[`${Di.WebGL2Render}`]:{mask:15,action:rv},[`${Di.WebGPURender}`]:{mask:15,action:iv},[`${Di.ZMKFromRWG}`]:{mask:15,action:Ci}};function Yf(e){if(!e)return"";const t=e.match(/rid=(.*)/);return t?t[1]:""}function Xf(e){return F(ze(((t,o)=>e(t,o))),mt((e=>null!=e)))}function ey(e){return F(Xe(((t,o)=>e(t,o)||fe)))}function ty(e){return F(Xe(((t,o)=>e(t,o))),Xe((e=>Array.isArray(e)?Ue(e):je(e))))}const oy={period:500,rules:[{peak:50,throttle:300},{peak:60,throttle:400}]},ny={[`${as}`]:()=>({payloads:{add:[],update:[],remove:[]},onThrottle(e){e.add&&this.payloads.add.push(...e.add),e.update&&this.payloads.update.push(...e.update),e.remove&&this.payloads.remove.push(...e.remove)}})};function ry(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oy;return t=>new $((o=>{const n=new Map;let r=0,i=null;const{period:s,rules:a}=e;let u=null;i||(i=((e,t)=>{const o=performance.now();let n=0,r=!1;return setTimeout((function i(){n+=t,e();const s=performance.now()-o-n,a=setTimeout(i,Math.max(t-s,0));r&&clearTimeout(a)}),t),()=>{r=!0}})((()=>{r=0}),s));const d=Object.keys(ny),l=t.subscribe({next(e){if(e&&e.evt&&null!==i){r+=1;const{evt:t,body:i}=e,s=String(t);if(d.indexOf(s)>=0)if(u){const e=n.get(s);if(e)e.onThrottle(i);else{const e=ny[s]();e.onThrottle(i),n.set(s,e)}}else{let t=0;if(a.forEach((e=>{r>e.peak&&(t=e.throttle)})),t>0){const e=ny[s]();e.onThrottle(i),n.set(s,e),u=setTimeout((()=>{n.forEach(((e,t)=>{const n={evt:Number(t),body:e.payloads};o.next(n)})),n.clear(),u=null}),t)}else o.next(e)}else o.next(e)}else o.next(e)},error(e){o.error(e)},complete(){o.complete()}});return()=>{l.unsubscribe(),i&&(i(),i=null),r=0}}))}let iy=function(e){return e[e.Unknown=0]="Unknown",e[e.Windows=1]="Windows",e[e.Mac=2]="Mac",e[e.Pad=3]="Pad",e[e.Mobile=4]="Mobile",e[e.CallIn=5]="CallIn",e[e.Linux=6]="Linux",e[e.WebClient=7]="WebClient",e[e.ChromeOs=8]="ChromeOs",e}({});const sy=262144,ay=1048576,uy=e=>(e&ay)===ay,dy=e=>{let{share:{isReceiveSharing:t}}=e;return t},ly=e=>{let{share:{activeNodeId:t}}=e;return t},cy=qc([Ap,dy,ly],(function(){let e=arguments.length>2?arguments[2]:void 0;if(arguments.length>1?arguments[1]:void 0){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).find((t=>t.userId===e&&!0===t.sharerOn));if(t){let{os:e}=t;const{pwaOS:o}=t;return"mac"===o?e=iy.Mac:"win"===o&&(e=iy.Windows),{...t,os:e}}}return null})),py=qc([Ap],(e=>e.filter((e=>e.sharerOn)))),hy=qc([py],(e=>e.some((e=>!!e.bVideoShare)))),my=qc([e=>{let{share:{remoteControlledUserList:t}}=e;return t},dy,ly],((e,t,o)=>!!t&&e.some((e=>fr(e,o)))));var vy,gy=new Uint8Array(16);function fy(){if(!vy&&!(vy="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vy(gy)}for(var yy,Sy,by,Ey,Iy=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Ay=[],Cy=0;Cy<256;++Cy)Ay.push((Cy+256).toString(16).substr(1));function _y(e,t,o){var n=(e=e||{}).random||(e.rng||fy)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){o=o||0;for(var r=0;r<16;++r)t[o+r]=n[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(Ay[e[t+0]]+Ay[e[t+1]]+Ay[e[t+2]]+Ay[e[t+3]]+"-"+Ay[e[t+4]]+Ay[e[t+5]]+"-"+Ay[e[t+6]]+Ay[e[t+7]]+"-"+Ay[e[t+8]]+Ay[e[t+9]]+"-"+Ay[e[t+10]]+Ay[e[t+11]]+Ay[e[t+12]]+Ay[e[t+13]]+Ay[e[t+14]]+Ay[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Iy.test(e)}(o))throw TypeError("Stringified UUID is invalid");return o}(n)}!function(e){e[e.PLAIN=0]="PLAIN",e[e.RSA=1]="RSA",e[e.AESGCM256=2]="AESGCM256"}(yy||(yy={})),function(e){e[e.info=0]="info",e[e.debug=1]="debug",e[e.log=2]="log",e[e.warn=3]="warn",e[e.error=4]="error"}(Sy||(Sy={})),function(e){e[e.PROTECT_LOCAL_KEY=0]="PROTECT_LOCAL_KEY"}(by||(by={})),function(e){e.beforeInit="beforeInit",e.afterInit="afterInit",e.beforeLog="beforeLog",e.hitSizeLimit="hitSizeLimit",e.afterLog="afterLog",e.beforeReport="beforeReport",e.afterReport="afterReport"}(Ey||(Ey={}));class wy{constructor(){}}var Ry,Oy={exports:{}},Ty={exports:{}},Dy=Qt(Object.freeze({__proto__:null,default:{}}));Ty.exports=(Ry=Ry||function(e,t){var o;if("undefined"!=typeof window&&window.crypto&&(o=window.crypto),"undefined"!=typeof self&&self.crypto&&(o=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(o=globalThis.crypto),!o&&"undefined"!=typeof window&&window.msCrypto&&(o=window.msCrypto),!o&&void 0!==qt&&qt.crypto&&(o=qt.crypto),!o)try{o=Dy}catch(e){}var n=function(){if(o){if("function"==typeof o.getRandomValues)try{return o.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof o.randomBytes)try{return o.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var o;return e.prototype=t,o=new e,e.prototype=null,o}}(),i={},s=i.lib={},a=s.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=s.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,o=e.words,n=this.sigBytes,r=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i>>2]>>>24-i%4*8&255;t[n+i>>>2]|=s<<24-(n+i)%4*8}else for(var a=0;a>>2]=o[a>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,o=this.sigBytes;t[o>>>2]&=4294967295<<32-o%4*8,t.length=e.ceil(o/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],o=0;o>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,o=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(o,t/2)}},c=d.Latin1={stringify:function(e){for(var t=e.words,o=e.sigBytes,n=[],r=0;r>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,o=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(o,t)}},p=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},h=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var o,n=this._data,r=n.words,i=n.sigBytes,s=this.blockSize,a=i/(4*s),d=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,l=e.min(4*d,i);if(d){for(var c=0;c>>6-s%4*2;r[i>>>2]|=a<<24-i%4*8,i++}return o.create(r,i)}t.enc.Base64={stringify:function(e){var t=e.words,o=e.sigBytes,n=this._map;e.clamp();for(var r=[],i=0;i>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a>>6*(3-a)&63));var u=n.charAt(64);if(u)for(;r.length%4;)r.push(u);return r.join("")},parse:function(e){var t=e.length,o=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i{try{const t=Py.exports.parse(e);return Oy.exports.stringify(t)}catch(t){return e}},Ly=e=>{for(var t=e.length,o=e.length-1;o>=0;o--){var n=e.charCodeAt(o);n>127&&n<=2047?t++:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&o--}return t},Ny=()=>ky(void 0,void 0,void 0,(function*(){return yield self.crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"])})),Vy=(e,t,o)=>ky(void 0,void 0,void 0,(function*(){try{return yield self.crypto.subtle.encrypt({name:"AES-GCM",iv:o},t,e)}catch(e){throw e}})),Uy=(e,t)=>{const o="string"==typeof e?function(e){const t=new ArrayBuffer(e.length),o=new Uint8Array(t);for(let t=0,n=e.length;t{jy[t]=e},xy=jy,Fy=e=>{try{return JSON.stringify(e)}catch(e){return"json stringify failed"}},Hy=e=>{try{return JSON.parse(e)}catch(t){return e}};const $y=e=>{let t=0;return t+=Ly(e.message),e.tags.forEach((e=>{t+=Ly(e)})),t};class Wy{constructor(e){this.uuid="randomUUID"in self.crypto?self.crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)));const{databaseName:t,maxSize:o,publicKey:n,reportUrl:r,plugins:i,idbManager:s,logManager:a,currentSize:u,externalKeys:d,codecWorkerFilePath:l}=e;this.databaseName=t,this.maxSize=o,this.publicKey=null!=n?n:"",this.reportUrl=null!=r?r:"",this.plugins=null!=i?i:[],this.idbManager=s,this.logManager=a,this.currentSize=null!=u?u:0,this.externalKeys=d,this.commonMethods=Object.assign({},xy)}getLocalAESGCM256Key(){var e;return function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){if(this.localAESGCM256Key)return this.localAESGCM256Key;this.localAESGCM256Key=yield Ny();const t=this.externalKeys?null===(e=this.externalKeys.filter((e=>e.usage===by.PROTECT_LOCAL_KEY))[0])||void 0===e?void 0:e.key:void 0;return yield this.idbManager.saveAESGCM256Key(this.uuid,this.localAESGCM256Key,t),this.localAESGCM256Key}))}updateCurrentSize(e){var t;let o=null!==(t=this.currentSize)&&void 0!==t?t:0;if(e instanceof Map)for(const[t,n]of e)o+=$y(n);else o+=$y(e);return this.currentSize=o,o>=this.maxSize}}const Gy=(...e)=>{const t={},o=[];for(const n of e)n.forEach((e=>{t[e.id]||(t[e.id]=!0,o.push(e))}));const n=new Map;return o.sort(((e,t)=>(null==e?void 0:e.id)-(null==t?void 0:t.id))).forEach((e=>{n.set(e.id,e)})),n},zy=(e,t)=>{const o=new Map;return t.forEach((t=>{e(t)&&o.set(t.id,t)})),o};class Ky{constructor(){this.getStore=()=>({byTag:Object.assign({},this.store.byTag),byTime:new Map(this.store.byTime)}),this.pushByTime=e=>{for(const t of e)this.store.byTime.set(t.id,t)},this.pushByTag=e=>{e.forEach((e=>{const t=e.tags;Array.isArray(t)&&t.forEach((t=>{this.store.byTag[t]||(this.store.byTag[t]=new Map),this.store.byTag[t].set(e.id,e)}))}))},this.addLog=e=>{let t=e;Array.isArray(e)||(t=[e]),this.pushByTime(t),this.pushByTag(t)},this.syncFromIDB=e=>function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const t=yield e.getAllLogs();this.addLog(t)})),this.reset=()=>{this.store={byTag:{},byTime:new Map}},this.deleteLogs=e=>{for(const t of e){const e=this.store.byTime.get(t);if(!e)continue;const{tags:o}=e;for(const e of o)this.store.byTag[e].delete(t);this.store.byTime.delete(t)}},this.filterStore=e=>{const t=((e,t)=>{if(!t)return e.byTime;if("string"==typeof t)return e.byTag[t]||new Map;if(Array.isArray(t)){if(t.every((e=>"string"==typeof e)))return Gy(...t.map((t=>e.byTag[t])).filter((e=>Boolean(e))))}else{if("function"==typeof t)return zy(t,e.byTime);if("object"==typeof t)if(t.tags&&t.filter){if("string"==typeof t.tags)return zy(t.filter,e.byTag[t.tags]);if(Array.isArray(t.tags)&&t.tags.every((e=>"string"==typeof e)))return Gy(...t.tags.map((o=>{const n=e.byTag[o];return n?zy(t.filter,n):new Map})))}else{if(t.filter)return zy(t.filter,e.byTime);if(t.tags){if("string"==typeof t)return e.byTag[t]||new Map;if(Array.isArray(t)&&t.every((e=>"string"==typeof e)))return Gy(...t.map((t=>e.byTag[t])))}}else console.error("Wrong filter type")}return new Map})(this.store,e),o=new Map;for(const[e,n]of t){const t=Object.assign(Object.assign({},n),{message:Hy(My(n.message))});o.set(e,t)}return o},this.store={byTag:{},byTime:new Map}}}function qy(e,t,o){const n=e.plugins;if(!Array.isArray(n))return o;let r=o;return n.forEach((o=>{const n=o[t];if("function"==typeof n){const t=n(e,r);t&&(r=t)}})),r}const Jy=(e,t,o,n,r,i={})=>function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){const{noCache:s,extraProperties:a={}}=i,u=((e,t,o,n,r,i)=>{const s=Array.isArray(t)?t:[t],a=Date.now();return Object.assign({message:e,logLevel:o,tags:s,encryptMode:n,timestamp:a,laplaceSessionId:r},i)})(`${t}`,o,n,r,e.uuid,a),d=qy(e,Ey.beforeLog,u);if(s)qy(e,Ey.afterLog,u);else{const{idbManager:t,logManager:o}=e,n=yield t.makeNextId();d.message=(e=>{try{const t=Oy.exports.parse(e);return Py.exports.stringify(t)}catch(t){return e}})(d.message);const r=Object.assign(Object.assign({},d),{id:n});e.updateCurrentSize(r)&&qy(e,Ey.hitSizeLimit,r),o.addLog(r),yield t.addLog(r),qy(e,Ey.afterLog,r)}}));By(Jy,"commonLog");const Qy=e=>new Promise((t=>{const o=new XMLHttpRequest;o.open(e.type||"GET",e.url,!0),o.withCredentials=e.withCredentials,o.onerror=o=>{t({error:o,report:e.reportItem})},o.onreadystatechange=function(){if(4===o.readyState){const n=o.status;t(n>=200&&n<300?{report:e.reportItem}:{error:`Request failed, status: ${n}, responseText: ${o.responseText}`,report:e.reportItem})}},Object.entries(e.headers).forEach((([e,t])=>{t&&e&&o.setRequestHeader(e,t)})),o.send(e.data)}));const Zy=(e,t=2)=>{let o=`${e}`;for(;o.length{const t=new Date(e);return`${t.getUTCFullYear()}-${Zy(t.getUTCMonth()+1)}-${Zy(t.getUTCDate())} ${Zy(t.getUTCHours())}:${Zy(t.getUTCMinutes())}:${Zy(t.getUTCSeconds())}.${Zy(t.getUTCMilliseconds(),3)}`},Xy={version:"000001",flag:"0"},eS=(e,t)=>Array.from(e.values()).reduce(((e,o)=>{const n=((e,t)=>{const{message:o,logLevel:n,tags:r,timestamp:i,encryptMode:s,id:a}=e,u=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r30720?e.push({messages:[n],ids:[o.id],currentSize:r}):(i.messages.push(n),i.ids.push(o.id),i.currentSize+=r),e}),[{messages:[],ids:[],currentSize:0}]).filter((e=>e.currentSize>0)).map((e=>({messages:e.messages.join("\n"),ids:e.ids,meta:Xy}))),tS=(e,t,o)=>((e,t,o)=>Promise.all(e.map((e=>Object.assign({url:t||"",type:"POST",withCredentials:!1,headers:{},data:Fy({messages:e.messages,meta:e.meta}),reportItem:e},o))).map(Qy)))(e,t.reportUrl,o).then((e=>{e.forEach((e=>{var o;qy(t,Ey.afterReport,{report:e.report,error:null!==(o=e.error)&&void 0!==o?o:null})}))})),oS=(e,t,o)=>function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){const n=e.logManager.filterStore(t);if(!n||0===(null==n?void 0:n.size)||!o)return;const{xhrOptions:r={},additionalContext:i}=o,s=qy(e,Ey.beforeReport,n),a=eS(s,i);tS(a,e,r)}));By(oS,"commonReport");var nS=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const rS=(e,t,o)=>nS(void 0,void 0,void 0,(function*(){const{idbManager:n,logManager:r}=e;if(Array.isArray(o)&&(yield n.deleteLogs(o),r.deleteLogs(o),!t))return;const i=e.logManager.filterStore(t),s=[];for(const[e,t]of i)s.push(t.id);let a=s;Array.isArray(s)||(a=[s]),yield n.deleteLogs(a),r.deleteLogs(a)})),iS=e=>nS(void 0,void 0,void 0,(function*(){const{idbManager:t,logManager:o}=e;yield t.reset(),o.reset()}));function sS(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o1&&void 0!==arguments[1]?arguments[1]:lS())("readwrite",(function(t){return e.forEach((function(e){return t.delete(e)})),aS(t.transaction)}))}function pS(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lS();return e("readonly",(function(t){if(t.getAll&&t.getAllKeys)return Promise.all([aS(t.getAllKeys()),aS(t.getAll())]).then((function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,r,i=[],s=!0,a=!1;try{for(o=o.call(e);!(s=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);s=!0);}catch(e){a=!0,r=e}finally{try{s||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return sS(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?sS(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),o=t[0],n=t[1];return o.map((function(e,t){return[e,n[t]]}))}));var o=[];return e("readonly",(function(e){return function(e,t){return e.openCursor().onsuccess=function(){this.result&&(function(e){o.push([e.key,e.value])}(this.result),this.result.continue())},aS(e.transaction)}(e).then((function(){return o}))}))}))}By(rS,"commonDelete"),By(iS,"commonReset");var hS=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const mS={default:{queue:[],isRunning:!1,listeners:[]}},vS=e=>{let t=mS[e];return t||(t={queue:[],isRunning:!1,listeners:[]},mS[e]=t),t};function gS(e){return hS(this,void 0,void 0,(function*(){const t=vS(e),{queue:o,listeners:n}=t;for(;o.length>0&&!t.isRunning;){const n=o.shift();t.isRunning=!0;try{const e=yield n.task();n.resolution(e)}catch(e){n.rejection(e)}t.isRunning=!1,gS(e)}n.length&&n.forEach((e=>{e()}))}))}function fS(e,t){const o=vS(t);try{return new Promise(((n,r)=>{o.queue.push({task:e,resolution:n,rejection:r}),gS(t)}))}catch(e){return Promise.reject(e)}}const yS=(e,t)=>{vS(e).listeners.push(t)};var SS=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const bS="change_meta",ES="change_log",IS=()=>Promise.resolve();class AS{constructor(e){this.waitingForReset=!1,this.resetting=!1,this.isChangingMeta=!1,this.isChangingLog=!1,this.dbFailCount={read:0,write:0},this.get=e=>function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:lS())("readonly",(function(t){return aS(t.get(e))}))}(e,this.store),this.set=(e,t)=>SS(this,void 0,void 0,(function*(){try{return!(this.dbFailCount.write>3)&&(yield function(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:lS())("readwrite",(function(o){return o.put(t,e),aS(o.transaction)}))}(e,t,this.store))}catch(o){o instanceof DOMException&&(o&&"QuotaExceededError"===o.name?(yield this.deleteOldLogsForSetNewOne(),yield this.set(e,t)):this.dbFailCount.write+=1),console.error(o)}})),this.deleteOldLogsForSetNewOne=()=>SS(this,void 0,void 0,(function*(){var e;const t=yield this.getAllLogs(),o=[];for(let n=0;n<13;n++){const r=null===(e=t[n])||void 0===e?void 0:e.id;(r||0===r)&&o.push(`${r}`)}return cS(o,this.store)})),this.adjustMaxId=()=>SS(this,void 0,void 0,(function*(){return this.resetting?IS():(this.isChangingMeta=!0,yield fS((()=>SS(this,void 0,void 0,(function*(){var e;const t=yield this.getAllLogs(),o=t[t.length-1],n=null!==(e=null==o?void 0:o.id)&&void 0!==e?e:0;return yield this.set("maxId",n),n}))),bS))})),this.makeNextId=()=>SS(this,void 0,void 0,(function*(){return this.resetting?IS():(this.isChangingMeta=!0,yield fS((()=>SS(this,void 0,void 0,(function*(){const e=yield this.get("maxId");if(!e&&0!==e)return yield this.set("maxId",0),0;const t=e+1;return yield this.set("maxId",t),t}))),bS))})),this.addLog=e=>SS(this,void 0,void 0,(function*(){if(this.resetting)return IS();this.isChangingLog=!0,yield fS((()=>SS(this,void 0,void 0,(function*(){const{id:t}=e;return this.set(`${t}`,e)}))),ES)})),this.getAllLogs=()=>SS(this,void 0,void 0,(function*(){return(yield pS(this.store)).filter((([e])=>"maxId"!==e)).sort(((e,t)=>{var o,n;return(null===(o=e[1])||void 0===o?void 0:o.id)-(null===(n=t[1])||void 0===n?void 0:n.id)})).map((([,e])=>e))})),this.deleteLogs=e=>SS(this,void 0,void 0,(function*(){if(this.resetting)return IS();this.isChangingLog=!0,yield fS((()=>SS(this,void 0,void 0,(function*(){return cS(e.map((e=>`${e}`)),this.store)}))),ES),yield this.adjustMaxId()})),this.saveAESGCM256Key=(e,t,o)=>SS(this,void 0,void 0,(function*(){if(o){const n=yield self.crypto.subtle.exportKey("raw",t),r=yield((e,t,o)=>ky(void 0,void 0,void 0,(function*(){return new Promise(((n,r)=>{requestAnimationFrame((()=>ky(void 0,void 0,void 0,(function*(){var r;const i=null===(r=null==t?void 0:t.algorithm)||void 0===r?void 0:r.name;let s;if("RSA-OAEP"===i?s=Uy:"AES-GCM"===i&&(s=Vy),!s)throw new Error("Unsupported encrypt key type");if("string"==typeof e){const r=new TextEncoder,i=yield s(r.encode(e),t,o);n(i)}else{const r=yield s(e,t,o);n(r)}}))))}))})))(n,o,new Uint8Array(16));yield this.set(`aes-gcm-256-${e}`,r)}else yield this.set(`aes-gcm-256-${e}`,t)})),this.reset=()=>SS(this,void 0,void 0,(function*(){return this.resetting?IS():(this.waitingForReset=!0,this.isChangingLog||this.isChangingMeta?IS():(this.resetting=!0,yield function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:lS())("readwrite",(function(e){return e.clear(),aS(e.transaction)}))}(this.store),this.resetting=!1,void(this.waitingForReset=!1)))})),this.store=uS(e,e+"-store"),yS(bS,(()=>{if(this.isChangingMeta=!1,this.waitingForReset)return this.reset()})),yS(ES,(()=>{if(this.isChangingLog=!1,this.waitingForReset)return this.reset()}))}}var CS=function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const _S={databaseName:"laplace-default-db",maxSize:49283072};class wS{constructor(e){this.commonLogWithContext=(e,t,o,n,r)=>CS(this,void 0,void 0,(function*(){yield Jy(this.runtimeMetaManager,e,t,o,n,r)})),this.commonReportWithContext=(e,t)=>CS(this,void 0,void 0,(function*(){yield oS(this.runtimeMetaManager,e,t)})),this.commonDeleteWithContext=e=>CS(this,void 0,void 0,(function*(){yield rS(this.runtimeMetaManager,e)})),this.resetWithContext=()=>CS(this,void 0,void 0,(function*(){yield iS(this.runtimeMetaManager)})),this.initLocalAESGCM256Key=()=>CS(this,void 0,void 0,(function*(){return yield Ny()})),this.doNotUseDirtyGetStore=()=>this.runtimeMetaManager.logManager.getStore(),this.log=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.log,yy.PLAIN,{extraProperties:o})})),this.info=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.info,yy.PLAIN,{extraProperties:o})})),this.warn=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.warn,yy.PLAIN,{extraProperties:o})})),this.debug=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.debug,yy.PLAIN,{extraProperties:o})})),this.error=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.error,yy.PLAIN,{extraProperties:o})})),this.logWithEncryption=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.log,yy.AESGCM256,{extraProperties:o})})),this.infoWithEncryption=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.info,yy.AESGCM256,{extraProperties:o})})),this.debugWithEncryption=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.debug,yy.AESGCM256,{extraProperties:o})})),this.warnWithEncryption=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.warn,yy.AESGCM256,{extraProperties:o})})),this.errorWithEncryption=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.error,yy.AESGCM256,{extraProperties:o})})),this.logWithoutCache=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.log,yy.PLAIN,{extraProperties:o,noCache:!0})})),this.infoWithoutCache=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.info,yy.PLAIN,{extraProperties:o,noCache:!0})})),this.warnWithoutCache=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.warn,yy.PLAIN,{extraProperties:o,noCache:!0})})),this.debugWithoutCache=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.debug,yy.PLAIN,{extraProperties:o,noCache:!0})})),this.errorWithoutCache=(e,t,o)=>CS(this,void 0,void 0,(function*(){yield this.commonLogWithContext(e,t,Sy.error,yy.PLAIN,{extraProperties:o,noCache:!0})})),this.getLogs=e=>{const t=this.runtimeMetaManager.logManager;return t?t.filterStore(e):new Map},this.report=(...e)=>((e,t,o={})=>function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){var n,r;const i=null!==(n=o.sampleRate)&&void 0!==n?n:1;if(Math.random()>i)return;if(Ly(t)>30720)throw new Error("ERROR: Laplace .report(strMsg) size bigger than 30KB is NOT allowed.");const s=Object.assign({message:Object.assign({strMsg:t},o.extraMsg),time:Yy(Date.now())},o.extraData);return(null===(r=null==o?void 0:o.tags)||void 0===r?void 0:r.length)&&(s.tags=null==o?void 0:o.tags),tS([{messages:JSON.stringify(s),meta:Xy}],e,o.xhrOptions)})))(this.runtimeMetaManager,...e),this.reportByHttps=(e,t)=>CS(this,void 0,void 0,(function*(){yield this.commonReportWithContext(e,t)})),this.deleteLog=e=>CS(this,void 0,void 0,(function*(){yield this.commonDeleteWithContext(e)})),this.deleteAll=()=>CS(this,void 0,void 0,(function*(){yield this.resetWithContext()}));const{runtimeMetaManager:t}=e;this.runtimeMetaManager=t}}wS.init=e=>CS(void 0,void 0,void 0,(function*(){const{databaseName:t="laplace-default-db"}=e,o=new AS(t),n=new Ky,r=new Wy(Object.assign(Object.assign(Object.assign({},_S),e),{idbManager:o,logManager:n}));qy(r,Ey.beforeInit),yield n.syncFromIDB(r.idbManager);const i=new wS({runtimeMetaManager:r});return qy(r,Ey.afterInit),i}));class RS extends wy{constructor(e){super(),this.config={verbose:!1},this.beforeLog=(e,t)=>{const{verbose:o}=this.config;switch(o&&console.log("beforeLog, ","state: ",t,"meta: ",e),t.logLevel){case Sy.error:console.error(t.message);break;case Sy.warn:console.warn(t.message);break;case Sy.log:console.log(t.message);break;case Sy.debug:console.debug(t.message);break;case Sy.info:console.info(t.message)}},this.afterLog=(e,t)=>{const{verbose:o}=this.config;o&&console.log("afterLog, ","state: ",t,"meta: ",e)},this.beforeReport=(e,t)=>{const{verbose:o}=this.config;o&&console.log("beforeReport, ","pluginParams: ",t,"meta: ",e)},this.afterReport=(e,t)=>{const{verbose:o}=this.config;o&&console.log("afterReport, ","pluginParams: ",t,"runtimeMetaManager: ",e)},e&&(this.config=e)}}const OS=e=>{const t=[];for(const[o,n]of e)t.push(n);return t};class TS extends wy{constructor(e){super(),this.config={debug:!1},this.debugLog=e=>{const{debug:t}=this.config;t&&console.log(`[AutoCleanLogPlugin]: ${e}`)},this.afterInit=e=>{const{expireBefore:t}=this.config;if(!t)return void this.debugLog("early return on beforeInit because expireBefore is falsy");const{logManager:o,commonMethods:{commonDelete:n}}=e,r=o.getStore().byTime,i=("function"==typeof t?OS(r).filter(t):OS(r).filter((e=>e.timestampe.id));n(e,void 0,i),this.debugLog(`afterInit, clean log id: ${i}`)},this.afterReport=(e,{report:t,error:o})=>{if(o)return this.debugLog("error"),void console.error(o);const{cleanAfterReport:n}=this.config;if(!n)return void this.debugLog("early return on afterReport because cleanAfterReport is falsy");const{commonMethods:{commonDelete:r}}=e;r(e,void 0,t.ids),this.debugLog(`afterReport, clean log id: ${t.ids}`)},e&&(this.config=e)}}var DS="Expected a function",PS=NaN,kS="[object Symbol]",MS=/^\s+|\s+$/g,LS=/^[-+]0x[0-9a-f]+$/i,NS=/^0b[01]+$/i,VS=/^0o[0-7]+$/i,US=parseInt,jS="object"==typeof qt&&qt&&qt.Object===Object&&qt,BS="object"==typeof self&&self&&self.Object===Object&&self,xS=jS||BS||Function("return this")(),FS=Object.prototype.toString,HS=Math.max,$S=Math.min,WS=function(){return xS.Date.now()};function GS(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function zS(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&FS.call(e)==kS}(e))return PS;if(GS(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=GS(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(MS,"");var o=NS.test(e);return o||VS.test(e)?US(e.slice(2),o?2:8):LS.test(e)?PS:+e}var KS=function(e,t,o){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError(DS);return GS(o)&&(n="leading"in o?!!o.leading:n,r="trailing"in o?!!o.trailing:r),function(e,t,o){var n,r,i,s,a,u,d=0,l=!1,c=!1,p=!0;if("function"!=typeof e)throw new TypeError(DS);function h(t){var o=n,i=r;return n=r=void 0,d=t,s=e.apply(i,o)}function m(e){var o=e-u;return void 0===u||o>=t||o<0||c&&e-d>=i}function v(){var e=WS();if(m(e))return g(e);a=setTimeout(v,function(e){var o=t-(e-u);return c?$S(o,i-(e-d)):o}(e))}function g(e){return a=void 0,p&&n?h(e):(n=r=void 0,s)}function f(){var e=WS(),o=m(e);if(n=arguments,r=this,u=e,o){if(void 0===a)return function(e){return d=e,a=setTimeout(v,t),l?h(e):s}(u);if(c)return a=setTimeout(v,t),h(u)}return void 0===a&&(a=setTimeout(v,t)),s}return t=zS(t)||0,GS(o)&&(l=!!o.leading,i=(c="maxWait"in o)?HS(zS(o.maxWait)||0,t):i,p="trailing"in o?!!o.trailing:p),f.cancel=function(){void 0!==a&&clearTimeout(a),d=0,n=u=r=a=void 0},f.flush=function(){return void 0===a?s:g(WS())},f}(e,t,{leading:n,maxWait:t,trailing:r})};const qS=["RESOURCE_ERROR","JS_ERROR","UNHANDLED_PROMISE_REJECTION"];class JS extends wy{constructor(e){super(),this.config={debug:!1,publicTags:[]},this.errorCount=0,this.hashErrors={},this.runtimeMetaManager=null,this.addPublicTags=e=>{var t;return null===(t=this.config.publicTags)||void 0===t?void 0:t.concat(e).filter((e=>e))},this.debugLog=e=>{const{debug:t}=this.config;t&&console.log("[AutoLogErrorPlugin]:",e)},this.ignore=e=>{var t,o,n,r,i;return void 0!==(null===(t=this.config)||void 0===t?void 0:t.maxErrorCount)&&this.errorCount>=(null===(o=this.config)||void 0===o?void 0:o.maxErrorCount)||!!(null===(n=this.config)||void 0===n?void 0:n.ignoredErrorMsgKeywords)&&e&&(null===(i=null===(r=this.config)||void 0===r?void 0:r.ignoredErrorMsgKeywords)||void 0===i?void 0:i.some((t=>null==e?void 0:e.includes(t))))},this.report=KS((()=>{if(null===this.runtimeMetaManager)return;const{autoReport:e}=this.config,{commonMethods:{commonReport:t}}=this.runtimeMetaManager;return t(this.runtimeMetaManager,qS,e)}),600,{trailing:!0,leading:!1}),this.afterInit=e=>{if(this.runtimeMetaManager=e,!self.addEventListener)return;const{commonMethods:{commonLog:t}}=e,o=(o,n,r)=>{this.debugLog(r),this.errorCount+=1;try{return function(e){const t=(new TextEncoder).encode(e);return crypto.subtle.digest("SHA-1",t).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}(o).then((r=>this.hashErrors[r]?"dismissed":(this.hashErrors[r]=!0,t(e,o,this.addPublicTags([].concat(n)),Sy.error,yy.PLAIN,{extraProperties:{messageHash:r}}).then(this.report)))).catch(console.error)}catch(e){return console.error(e),Promise.resolve(e)}};try{self.addEventListener("error",(e=>{var t,n,r,i,s,a,u;if(!this.ignore(null==e?void 0:e.message)){if((null==e?void 0:e.target)&&((null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.src)||(null===(n=null==e?void 0:e.target)||void 0===n?void 0:n.href))){const t=`Load Resource Error in ${null===(r=null==e?void 0:e.target)||void 0===r?void 0:r.tagName} element: ${(null===(i=null==e?void 0:e.target)||void 0===i?void 0:i.src)||(null===(s=null==e?void 0:e.target)||void 0===s?void 0:s.href)}`;return o(t,"RESOURCE_ERROR",e)}{const t=`Javascript Runtime Error in ${null==e?void 0:e.filename} (${null==e?void 0:e.lineno}:${null==e?void 0:e.colno}): ${null==e?void 0:e.message}\nStack: ${null!==(u=null===(a=null==e?void 0:e.error)||void 0===a?void 0:a.stack)&&void 0!==u?u:null==e?void 0:e.stack}`;return o(t,"JS_ERROR",e)}}})),self.addEventListener("unhandledrejection",(e=>{var t;if(this.ignore(null===(t=null==e?void 0:e.reason)||void 0===t?void 0:t.message))return;let n;const r=null==e?void 0:e.reason;return n="string"==typeof r?`Promise Error: ${r}`:r instanceof Error?`Promise Error: ${r.message} ${r.name} ${r.stack}`:"object"==typeof r?`Promise Error with reason: ${Fy(r)}`:`Promise Error with unrecognized reason: ${r}`,o(n,"UNHANDLED_PROMISE_REJECTION",e)}))}catch(e){console.error(e)}this.debugLog("afterInit, add listener")},e&&(this.config=e),this.config.publicTags=[].concat(null==e?void 0:e.publicTags)}}let QS=function(e){return e.DeviceAudioStreamCaptured="device audio stream captured",e.AudioJoinComplete="audio join complete",e.AudioLeaveComplete="audio leave complete",e.SharingAudioStartComplete="sharing audio start complete",e.SharingAudioStopComplete="sharing audio stop complete",e.AudioBridgeReconnectStart="audio bridge reconnect start",e.AudioBridgeReconnectEnd="audio bridge reconnect end",e}({}),ZS=function(e){return e.VBSettingSuccess="video VB setting success",e.VBSettingFailed="init video VB failed",e.VBPreloadSuccess="preload video VB success",e.VBPreloading3S="preload video VB 3s",e.VBPreloading10S="preload video VB 10s",e.StartCaptureVideoSuccess="start capture video success",e.StopCaptureVideoSuccess="stop capture video success",e}({});function YS(e){return`{E}${e}{/E}`}const XS={enable:!1,enableReport:!1,gatewayEndPoint:"",newGatewayEndPoint:"",logLevel:{debug:!1,log:!1,info:!1,print:!1,warn:!1,error:!1},performanceReportRatio:.25,trackingCount:7},eb=["debug","log","info","print","warn","error"],tb=(e,t)=>[...e,...t].filter((e=>!!e));class ob{static getInstance(){return this.agentInstance||(this.agentInstance=new ob),this.agentInstance}constructor(){var e=this;this.laplace=void 0,this.trackingId=void 0,this.logConfig=void 0,this.reportUrl=void 0,this.publicTags=void 0,this.accountId=void 0,this.disableAutoReport=void 0,this.initConfig=async e=>{let t,o=XS;try{e.logConfig&&(o=JSON.parse(e.logConfig),o.gatewayEndPoint&&(this.reportUrl=o.gatewayEndPoint),o.newGatewayEndPoint&&(this.reportUrl=o.newGatewayEndPoint));const{enable:n,enableReport:r,reportUrl:i,logLevel:s,encryptKeys:a,trackingId:u,accountId:d}=e;if(void 0!==n&&(o={...o,enable:!!n}),void 0!==r&&(o={...o,enableReport:!!r}),i&&(this.reportUrl=i),"string"==typeof s){const e=eb.indexOf(s),t=eb.reduce(((t,o,n)=>nfunction(e){return window.crypto.subtle.importKey("raw",(new TextEncoder).encode(e.slice(0,32)),"AES-GCM",!1,["encrypt","decrypt"])}(e).then((e=>({usage:by.PROTECT_LOCAL_KEY,key:e}))))))}void 0!==d&&(this.accountId=d)}catch(e){console.error("parse log config error",e)}const n=(new Date).getTime()-6048e5,r=o.enableReport&&this.reportUrl?{gzip:!1,encrypt:!1,additionalContext:{trackingId:this.trackingId}}:void 0;this.publicTags=["VideoSDK",this.trackingId];const i=[e.debugMode&&new RS({verbose:!1}),new TS({debug:!1,cleanAfterReport:!0,expireBefore:n}),new JS({debug:!1,autoReport:r,ignoredErrorMsgKeywords:["table index is out of bounds"],maxErrorCount:223,publicTags:this.accountId?[...this.publicTags,YS(this.accountId)]:this.publicTags})].filter(Boolean);return{laplaceConfig:{databaseName:"ZM-VSDK-LOG-DATABASE",maxSize:49283072,publicKey:e.logEncryptionPubKey,reportUrl:this.reportUrl,externalKeys:t,plugins:i},logConfig:o}},this.handleInitLaplaceSuccess=(e,t)=>{var o;this.laplace=e;const n=Ni.get(Ui.VSDKLogTrackingId);let r=[];try{r=JSON.parse(n?window.atob(n):"[]")}catch(e){}(null===(o=r.length>=(null==t?void 0:t.trackingCount))||void 0===o||o)&&r.shift();const i=r.reduce(((e,t)=>({...e,[`${t}`]:!0})),{});e.deleteLog((e=>{var t;return!(null!==(t=e.tags)&&void 0!==t&&t.some((e=>i[e])))})),r.push(this.trackingId),Ni.set(Ui.VSDKLogTrackingId,window.btoa(JSON.stringify(r)),Mi.LocalStorage)},this.init=async e=>{const{laplaceConfig:t,logConfig:o}=await this.initConfig(e);return o.enable?(this.logConfig=o,wS.init(t).then((e=>{this.handleInitLaplaceSuccess(e,o)})).catch((e=>{throw{type:Al,reason:"Logger init failed.",error:e}}))):Promise.reject({type:Il,reason:"Logger feature is not enabled."})},this.check=e=>{var t,o;return!(!this.checkLaplace()||(null===(t=this.logConfig)||void 0===t||null===(o=t.logLevel)||void 0===o||!o[e])&&(console.warn(`Logger ${e} is not enabled.`),1))},this.log=(e,t,o)=>{if(this.check("log"))try{var n;return null===(n=this.laplace.logWithEncryption(e,tb(t,o)))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.logWithExtraProperties=(e,t,o)=>{if(this.check("log"))try{var n;return null===(n=this.laplace.log(e,t,o))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.warn=(e,t,o)=>{if(this.check("warn"))try{var n;return null===(n=this.laplace.warnWithEncryption(e,tb(t,o)))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.info=(e,t,o)=>{if(this.check("info"))try{var n;return null===(n=this.laplace.infoWithEncryption(e,tb(t,o)))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.debug=(e,t,o)=>{if(this.check("debug"))try{var n;return null===(n=this.laplace.debugWithEncryption(e,tb(t,o)))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.error=(e,t,o)=>{if(this.check("error"))try{var n;return null===(n=this.laplace.errorWithEncryption(e,tb(t,o)))||void 0===n?void 0:n.catch((()=>{}))}catch(e){return}},this.checkLaplace=()=>{var e;return!(null===(e=this.laplace)||void 0===e||!e.log)},this.makeLogger=e=>{var t;const o=tb(null!==(t=this.publicTags)&&void 0!==t?t:[],e);return{log:(e,t)=>this.log(e,o,null!=t?t:[]),logWithExtraProperties:(e,t)=>this.logWithExtraProperties(e,o,t),warn:(e,t)=>this.warn(e,o,null!=t?t:[]),info:(e,t)=>this.info(e,o,null!=t?t:[]),debug:(e,t)=>this.debug(e,o,null!=t?t:[]),error:(e,t)=>this.error(e,o,null!=t?t:[])}},this.reportToGlobalTracing=function(t){var o;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.checkLaplace()?null!==(o=e.logConfig)&&void 0!==o&&o.enableReport&&e.reportUrl?function(){try{return!!Ni.get(ji.DisableAutoReportLogs)}catch(e){return!1}}()&&!n?Promise.resolve():e.laplace.reportByHttps(t,{gzip:!1,encrypt:!1,xhrOptions:{url:e.reportUrl},additionalContext:{trackingId:e.trackingId}}):Promise.reject({type:Il,reason:"Please use getLogs to obtain log data and report by yourself."}):Promise.reject({type:Il,reason:"Logger has not been enabled or initialized."})},this.report=function(t,o){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"warn";if(e.checkLaplace()&&e.logConfig.enableReport&&e.reportUrl){var r,i;const s=Array.isArray(o)?o:[o],a=e.accountId?[...s,YS(e.accountId)]:s;null===(r=(i=e.makeLogger(a))[`${n}`])||void 0===r||r.call(i,t).then((()=>{e.reportToGlobalTracing(s)}))}},this.getLogs=(e,t)=>{if(!this.checkLaplace())return console.warn("Logger has not been enabled or initialized."),[];const o=e.getState(),{meeting:{meetingNumber:n,userId:r,userEmail:i,userName:s}}=o,a={meetingNumber:n,userId:r,userEmail:i,userName:s},u=this.laplace.getLogs(t),d=[];for(const[,e]of u)d.push({...e,...a});return d},this.doNotUseDirtyGetStore=()=>this.checkLaplace()?this.laplace.doNotUseDirtyGetStore():(console.warn("Logger has not been enabled or initialized."),{byTag:{},byTime:new Map}),this.trackingId=_y()}}ob.agentInstance=void 0;const nb=ob.getInstance(),rb=[{type:"MediaMeta",methods:["sendUserNodeList","updateUserMediaSN","updateMediaParams","subscribeToQos","unsubscribeFromQos","sendUserAudioStatus","destroy","createMainSessionChannel","notifySDKMeetingReady"]},{type:"Audio",methods:["joinComputerAudio","leaveComputerAudio","joinSharingAudio","leaveSharingAudio","changeSpeaker","changeMicrophone","enableAudioEncode","pauseOrResumeAudio","setSharingAudioVolume","enableShareAudioToBreakoutRoom","enableAudioDenoise","enableSyncButtonsOnHeadset","stopAllIncomingAudio","preInitAudioBridge","setAudioCodecMode","muteOrUnmuteOtherAudio","adjustOtherAudioVolume","changeAudioProfile","unmuteAudio","muteAudio"]},{type:"Video",methods:["startCaptureVideo","stopCaptureVideo","renderVideo","stopRenderVideo","changeCamera","updateRenderedVideoCanvasDimension","adjustRenderedVideoPosition","mirrorVideo","enableHardwareAccelerationForVideoDecode","enableHardwareAccelerationForVideoEncode","startVirtualBackgroundSetting","updateVirtualBackgroundImage","stopVirtualBackgroundSetting","startMaskSetting","updateMaskBackgroundImage","updateMaskClip","stopMaskSetting","enableVideoObserver","prefetchVideoSsrc","cancelPrefetchVideoSsrc","setMobileRotateMode","changeActiveVideoSsrc","updateVideoHDValue","updateVideoFullhdValue","clearVideoCanvas"]},{type:"Sharing",methods:["stopDesktopSharing","startDesktopSharing","pauseDesktopSharing","resumeDesktopSharing","renderSharing","stopRenderSharing","switchSharingSource","ajustmentReceivedSharingCanvas","changeSharingSecondCamera","updateRenderedSharingDimension","addReceivedSharingChannelType","removeReceivedSharingChannelType","switchSharingMode","ajustmentSharingCanvas"]},{type:"RemoteControl",methods:["startRemoteControl","stopRemoteControl","resendRemoteControlPositionPDU","updateRemoteControlProperties","ajustmentReceivedSharingCanvas","startRemoteControlQRCheck"]},{type:"LiveTranscription",methods:["selectLanguageChannelForNewLTT"]},{type:"RemoteCamera",methods:["movePTZCamera"]}].reduce(((e,t)=>{const{type:o,methods:n}=t;return[...e,...n.map((e=>({name:e,type:o})))]}),[]),ib=rb.map((e=>e.name)),sb=function(e){const t=rb.find((t=>t.name===e));if(t){const{type:i}=t;for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;rwr(e)));nb.makeLogger([i,`${i} Media SDK`]).info(`${e},params:${JSON.stringify(s)}`)}};function ab(e){return new Proxy(e,{get:(e,t)=>"string"==typeof t&&ib.includes(t)?function(){for(var o=arguments.length,n=new Array(o),r=0;r!!e)))));const a=cy(o);a&&(i?(r.resendRemoteControlPositionPDU(),r.updateRemoteControlProperties({os:a.os,isControllerNow:!0,dimension:t&&Nf(t)})):t&&r.startRemoteControl(t,a.os,Nf(t)))}function yb(){ub.log("qr scanning stop"),db.startRemoteControlQRCheck(!1)}const Sb=Ls.createAgent(),bb=ab(Fs.getInstance()),Eb=Ls.createAgent(),Ib=ab(Fs.getInstance());function Ab(e){for(var t=arguments.length,o=Array(t>1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:Db(e)?2:Pb(e)?3:0}function Ob(e,t){return 2===Rb(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Tb(e,t,o){var n=Rb(e);2===n?e.set(t,o):3===n?(e.delete(t),e.add(o)):e[t]=o}function Db(e){return nE&&e instanceof Map}function Pb(e){return rE&&e instanceof Set}function kb(e){return e.o||e.t}function Mb(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=cE(e);delete t[uE];for(var o=lE(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=Nb),Object.freeze(e),t&&wb(e,(function(e,t){return Lb(t,!0)}),!0)),e}function Nb(){Ab(2)}function Vb(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Ub(e){var t=pE[e];return t||Ab(18,e),t}function jb(){return tE}function Bb(e,t){t&&(Ub("Patches"),e.u=[],e.s=[],e.v=t)}function xb(e){Fb(e),e.p.forEach($b),e.p=null}function Fb(e){e===tE&&(tE=e.l)}function Hb(e){return tE={p:[],l:tE,h:e,m:!0,_:0}}function $b(e){var t=e[uE];0===t.i||1===t.i?t.j():t.O=!0}function Wb(e,t){t._=t.p.length;var o=t.p[0],n=void 0!==e&&e!==o;return t.h.g||Ub("ES5").S(t,e,n),n?(o[uE].P&&(xb(t),Ab(4)),_b(e)&&(e=Gb(t,e),t.l||Kb(t,e)),t.u&&Ub("Patches").M(o[uE].t,e,t.u,t.s)):e=Gb(t,o,[]),xb(t),t.u&&t.v(t.u,t.s),e!==sE?e:void 0}function Gb(e,t,o){if(Vb(t))return t;var n=t[uE];if(!n)return wb(t,(function(r,i){return zb(e,n,t,r,i,o)}),!0),t;if(n.A!==e)return t;if(!n.P)return Kb(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var r=4===n.i||5===n.i?n.o=Mb(n.k):n.o;wb(3===n.i?new Set(r):r,(function(t,i){return zb(e,n,r,t,i,o)})),Kb(e,r,!1),o&&e.u&&Ub("Patches").R(n,o,e.u,e.s)}return n.o}function zb(e,t,o,n,r,i){if(Cb(r)){var s=Gb(e,r,i&&t&&3!==t.i&&!Ob(t.D,n)?i.concat(n):void 0);if(Tb(o,n,s),!Cb(s))return;e.m=!1}if(_b(r)&&!Vb(r)){if(!e.h.F&&e._<1)return;Gb(e,r),t&&t.A.l||Kb(e,r)}}function Kb(e,t,o){void 0===o&&(o=!1),e.h.F&&e.m&&Lb(t,o)}function qb(e,t){var o=e[uE];return(o?kb(o):e)[t]}function Jb(e,t){if(t in e)for(var o=Object.getPrototypeOf(e);o;){var n=Object.getOwnPropertyDescriptor(o,t);if(n)return n;o=Object.getPrototypeOf(o)}}function Qb(e){e.P||(e.P=!0,e.l&&Qb(e.l))}function Zb(e){e.o||(e.o=Mb(e.t))}function Yb(e,t,o){var n=Db(t)?Ub("MapSet").N(t,o):Pb(t)?Ub("MapSet").T(t,o):e.g?function(e,t){var o=Array.isArray(e),n={i:o?1:0,A:t?t.A:jb(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},r=n,i=hE;o&&(r=[n],i=mE);var s=Proxy.revocable(r,i),a=s.revoke,u=s.proxy;return n.k=u,n.j=a,u}(t,o):Ub("ES5").J(t,o);return(o?o.A:jb()).p.push(n),n}function Xb(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Mb(e)}var eE,tE,oE="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),nE="undefined"!=typeof Map,rE="undefined"!=typeof Set,iE="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,sE=oE?Symbol.for("immer-nothing"):((eE={})["immer-nothing"]=!0,eE),aE=oE?Symbol.for("immer-draftable"):"__$immer_draftable",uE=oE?Symbol.for("immer-state"):"__$immer_state",dE=""+Object.prototype.constructor,lE="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,cE=Object.getOwnPropertyDescriptors||function(e){var t={};return lE(e).forEach((function(o){t[o]=Object.getOwnPropertyDescriptor(e,o)})),t},pE={},hE={get:function(e,t){if(t===uE)return e;var o=kb(e);if(!Ob(o,t))return function(e,t,o){var n,r=Jb(t,o);return r?"value"in r?r.value:null===(n=r.get)||void 0===n?void 0:n.call(e.k):void 0}(e,o,t);var n=o[t];return e.I||!_b(n)?n:n===qb(e.t,t)?(Zb(e),e.o[t]=Yb(e.A.h,n,e)):n},has:function(e,t){return t in kb(e)},ownKeys:function(e){return Reflect.ownKeys(kb(e))},set:function(e,t,o){var n=Jb(kb(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,o),!0;if(!e.P){var r=qb(kb(e),t),i=null==r?void 0:r[uE];if(i&&i.t===o)return e.o[t]=o,e.D[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(o,r)&&(void 0!==o||Ob(e.t,t)))return!0;Zb(e),Qb(e)}return e.o[t]===o&&"number"!=typeof o&&(void 0!==o||t in e.o)||(e.o[t]=o,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==qb(e.t,t)||t in e.t?(e.D[t]=!1,Zb(e),Qb(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var o=kb(e),n=Reflect.getOwnPropertyDescriptor(o,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:o[t]}:n},defineProperty:function(){Ab(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Ab(12)}},mE={};wb(hE,(function(e,t){mE[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),mE.deleteProperty=function(e,t){return mE.set.call(this,e,t,void 0)},mE.set=function(e,t,o){return hE.set.call(this,e[0],t,o,e[0])};var vE=function(){function e(e){var t=this;this.g=iE,this.F=!0,this.produce=function(e,o,n){if("function"==typeof e&&"function"!=typeof o){var r=o;o=e;var i=t;return function(e){var t=this;void 0===e&&(e=r);for(var n=arguments.length,s=Array(n>1?n-1:0),a=1;a1?n-1:0),i=1;i=0;o--){var n=t[o];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}o>-1&&(t=t.slice(o+1));var r=Ub("Patches").$;return Cb(e)?r(e,t):this.produce(e,(function(e){return r(e,t)}))},e}(),gE=new vE,fE=gE.produce;gE.produceWithPatches.bind(gE),gE.setAutoFreeze.bind(gE),gE.setUseProxies.bind(gE),gE.applyPatches.bind(gE),gE.createDraft.bind(gE),gE.finishDraft.bind(gE);const yE={ssrc:0,status:Ka.End,shareDimension:{width:0,height:0},receivedShareDimension:{width:1920,height:1080,logicWidth:1920,logicHeight:1080},sharePrivilege:za.OnlyHost,activeNodeId:0,activeSsrc:0,shareQuality:1,isRemoteSharingActive:!1,isReceiveSharing:!1,isGrabRemoteControl:!1,isSDKGrabControl:!1,isChromeExtensionInstalled:!1,isScreenShareForbidden:!1,isReceiveSharingFromMainSession:!1,isSharingToBreakoutRoom:!1,isSharingWithSecondCamera:!1,secondCameraId:"default",isRequireReadReceipt:!1,capturedEnsuredCanvas:[],renderedEnsuredCanvas:[],remoteControllingSsrc:0,remoteControlApprovedSsrc:0,remoteControlAppDownloadUrl:"",remoteControlAppInstallStatus:Cu.Unknown,isEnableAutoDeleteRcApp:!1,remoteControlledUserList:[],isRemoteControlEnabled:!1,isFullHDVideoShareEnabled:!1,userSsrcMapping:{},statistic:{encode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0,bandwidth:0,bitrate:0},decode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0,bandwidth:0,bitrate:0}}},SE=ko({[`${Ch}`]:fE(((e,t)=>{let{payload:o}=t;e.sharePrivilege=o})),[`${_h}`]:fE(((e,t)=>{let{payload:o}=t;e.isRemoteSharingActive=1===o.bStatus,e.activeNodeId=o.activeNodeID,e.activeSsrc=o.ssrc})),[`${wh}`]:fE(((e,t)=>{let{payload:o}=t;e.isReceiveSharing=o})),[`${Rh}`]:fE(((e,t)=>{let{payload:o}=t;e.isChromeExtensionInstalled=o})),[`${Th}`]:fE(((e,t)=>{let{payload:o}=t;e.shareDimension={...o}})),[`${Dh}`]:fE(((e,t)=>{let{payload:o}=t;e.status=o})),[`${Ph}`]:fE(((e,t)=>{let{payload:o}=t;e.ssrc=o})),[`${kh}`]:fE(((e,t)=>{let{payload:o}=t;e.shareQuality=o})),[`${Mh}`]:fE(((e,t)=>{let{payload:o}=t;e.receivedShareDimension={...o}})),[`${om}`]:fE(((e,t)=>{let{payload:o}=t;e.remoteControlledUserList.includes(o)||e.remoteControlledUserList.push(o)})),[`${nm}`]:fE(((e,t)=>{let{payload:o}=t;const n=e.remoteControlledUserList.indexOf(o);n>=0&&e.remoteControlledUserList.splice(n,1)})),[`${Lh}`]:fE(((e,t)=>{let{payload:o}=t;e.isGrabRemoteControl=o,!1===o&&(e.remoteControlViewportDomSelector=void 0)})),[`${Nh}`]:fE(((e,t)=>{let{payload:o}=t;e.isSDKGrabControl=o})),[`${Vh}`]:fE(((e,t)=>{let{payload:o}=t;e.isReceiveSharingFromMainSession=o})),[`${Uh}`]:fE(((e,t)=>{let{payload:o}=t;e.isSharingToBreakoutRoom=o})),[`${jh}`]:fE(((e,t)=>{let{payload:o}=t;e.isSharingWithSecondCamera=o})),[`${Bh}`]:fE(((e,t)=>{let{payload:o}=t;e.secondCameraId=o})),[`${xh}`]:fE(((e,t)=>{let{payload:o}=t;e.isRequireReadReceipt=o})),[`${Fh}`]:fE(((e,t)=>{let{payload:o}=t;e.isOptimizedForSharedVideo=o})),[`${Hh}`]:fE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${$h}`]:fE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${Wh}`]:fE(((e,t)=>{let{payload:o}=t;e.capturedEnsuredCanvas.includes(o)||e.capturedEnsuredCanvas.push(o)})),[`${Gh}`]:fE(((e,t)=>{let{payload:o}=t;e.renderedEnsuredCanvas.includes(o)||e.renderedEnsuredCanvas.push(o)})),[`${Kh}`]:fE(((e,t)=>{let{payload:o}=t;e.remoteControllingSsrc=o})),[`${qh}`]:fE(((e,t)=>{let{payload:o}=t;e.remoteControlApprovedSsrc=o})),[`${Jh}`]:fE(((e,t)=>{let{payload:o}=t;e.remoteControlAppDownloadUrl=o})),[`${Qh}`]:fE(((e,t)=>{let{payload:o}=t;(e.remoteControlAppInstallStatus!==Cu.Installed||Cu.Unknown)&&(e.remoteControlAppInstallStatus=o)})),[`${em}`]:fE(((e,t)=>{let{payload:o}=t;e.remoteControlAppLaunchSheme=o})),[`${tm}`]:fE(((e,t)=>{let{payload:o}=t;const{userId:n,ssrc:r}=o;Object.assign(e.userSsrcMapping,{[`${n}`]:r})})),[`${rm}`]:fE(((e,t)=>{let{payload:o}=t;Object.assign(e,o)})),[`${im}`]:fE(((e,t)=>{let{payload:o}=t;e.remoteControlViewportDomSelector=o})),[`${sm}`]:fE(((e,t)=>{let{payload:o}=t;e.isFullHDVideoShareEnabled=o})),[`${am}`]:()=>({...yE})},yE),bE={remoteControlEpics0:e=>e.pipe($t(`${Wr}`),ze((e=>{const{payload:{meetingOptions:t,rcAutoDelete:o,jwtRc:n,opRc:r}}=e,i=(null==t?void 0:t.isRemoteControlEnbaled)&&r&&1===n;return rm({isRemoteControlEnabled:i,isEnableAutoDeleteRcApp:1===o})}))),remoteControlEpics1:(e,t)=>yn(e,16391).pipe(Xe((e=>{const{payload:{body:{bOn:o,sendID:n,receiveID:r}}}=e,{meeting:{userId:i},share:{status:s,activeNodeId:a,isGrabRemoteControl:u}}=t.value,d=[];if(s===Ka.End&&d.push(Kh(0)),s!==Ka.End)if(fr(i,n))if(o){mb(),vb(),s===Ka.Paused&&(Eb.resumeSharing(),Ib.resumeDesktopSharing(),d.push(Dh(Ka.Sharing))),d.push(Kh(r));const e=Ap(t.value).find((e=>fr(e.userId,r)));e&&d.push(tm({userId:e.userId,ssrc:r}))}else d.push(Kh(0));else{var l;const e=null===(l=Ap(t.value))||void 0===l?void 0:l.find((e=>fr(e.userId,n)));e&&(d.push(tm({userId:e.userId,ssrc:n})),Rc(hl,{userId:e.userId,displayName:e.displayName,isSharingEntireScreen:Ib.isSharingEntireScreen()}))}else if(!r||fr(r,i)){const e=yp(t.value);if(!rp(e.userRole)&&!Gi.isAndroidOrIOSBrowser){const e=n&&fr(a,n);o?(d.push(om(a)),e&&(u||Eb.subscribeGrabRemoteControl(a,!0))):(d.push(nm(a)),e&&(u&&(Eb.subscribeGrabRemoteControl(a,!1),d.push(Lh(!1)),Rc(sl,!1)),Ib.updateRemoteControlProperties({isControllerNow:!1}))),Rc(il,o)}}return Ue(d)}))),remoteControlEpics2:(e,t)=>yn(e,16395).pipe(Tt(t),mt((e=>{let[t,o]=e;return t.payload.body.id===o.meeting.userId})),ze((e=>{let[t]=e;const{payload:{body:{bOn:o}}}=t;return Ib.updateRemoteControlProperties({isControllerNow:o}),Rc(sl,o),Lh(o)}))),remoteControlEpics3:e=>In(e,[Na.StartRemoteControlSuccess,Na.StartRemoteControlFailed,Na.CancelRemoteControlSuccess]).pipe(Xf((e=>e.payload.type===Na.StartRemoteControlSuccess?(Rc(ul),Nh(!0)):e.payload.type===Na.CancelRemoteControlSuccess?Nh(!1):void(e.payload.type===Na.StartRemoteControlFailed&&Rc(dl))))),remoteControlEpics4:e=>In(e,[Na.RemoteControlCopiedTextNotify,Na.RemoteControlPasteTextLengthOverflow]).pipe(Ot((e=>{if(e.payload.type===Na.RemoteControlCopiedTextNotify){const{payload:{data:t}}=e;Rc(al,{content:t.data,x:t.x,y:t.y})}else Rc(al,{error:"length of pasted text is too long"})})),Et(fe)),remoteControlEpics5:(e,t)=>yn(e,4342).pipe(mt((e=>0===e.payload.body.result)),Xe((e=>{const{payload:{body:{downloadUrl:o,ssrc:n,urlScheme:r}}}=e,{share:{remoteControlApprovedSsrc:i,status:s}}=t.value,a=[],{isMacOS:u}=Gi;if(s!==Ka.End){if(!i||i===n){mb();try{const e=JSON.parse(o||"{}"),t=u?e.macDownloadUrl:e.winDownloadUrl;a.push(Jh(t))}catch(e){console.warn("unsupported JSON string",e)}}const s={};u||Object.assign(s,{runAsAdmin:1});const d=Ap(t.value).find((e=>fr(e.userId,n)));d&&Object.assign(s,{controllerName:ur(d.displayName)}),Object.assign(s,{ssrc:n});const{deviceId:l}=Ib.getShareStreamInfo();l&&Object.assign(s,{DeviceID:l});const c=`${r}&${new URLSearchParams(s).toString()}`;a.push(em(c),Qh(Cu.Unknown)),Rc(gl,c)}return Ue(a)}))),remoteControlEpics6:e=>e.pipe($t(`${Zh}`),Xe((()=>pb.startCheck(1e4).pipe(ze((()=>(Rc(ml,Cu.Unknown),Qh(Cu.Unknown)))))))),remoteControlEpics7:(e,t)=>e.pipe($t(`${Yh}`),mt((()=>{const{share:{remoteControlAppInstallStatus:e}}=t.value;return e===Cu.Installed})),Xe((()=>hb.startCheck(6e4).pipe(Xe((()=>{Rc(ml,_u.Unlaunched);const{share:{remoteControlApprovedSsrc:e,isEnableAutoDeleteRcApp:o},meeting:{userId:n}}=t.value,r=[],{isMacOS:i}=Gi;return e&&(Eb.remoteControlConsent(Au.CacheClean,e,n,{...Ib.getShareStreamInfo(),platform:i?"mac":"win"},o),r.push(em(""),qh(0))),Ue(r)})))))),remoteControlEpics8:(e,t)=>e.pipe($t(`${em}`),mt((e=>!!e.payload)),Xe((e=>{const{payload:o}=e,n=[];let r;if(o){!function(e){if(!e.startsWith("zoomprc://"))return;const t=Sr("__ZOOM_SDK_RC_APP_SCHEME_@__");let o=document.getElementById(t);o||(o=document.createElement("iframe"),o.id=t,o.style.display="none",document.body.appendChild(o)),o.contentWindow.location.href=e}(o),n.push(Yh());const e=performance.now();document.hasFocus()?r=lt(25).pipe(Rt((()=>{const o=performance.now()-e<500;return o||Rc(ml,Cu.Uninstalled),o&&t.value.share.remoteControlAppInstallStatus===Cu.Unknown})),_t((()=>{const t=performance.now()-e,o=[];return document.hasFocus()||(t>75?o.push(Zh()):mb(),Rc(ml,Cu.Installed),o.push(Qh(Cu.Installed),Yh())),Ue(o)})),function(){for(var e=[],t=0;tyn(e,ms).pipe(Xe((()=>(Rc(vl,wu.Ended),gb(t.value,Eb),Ue([em(""),qh(0)]))))),remoteControlEpics10:(e,t)=>e.pipe($t(`${Dh}`),mt((e=>{const{share:{remoteControllingSsrc:o,remoteControlApprovedSsrc:n}}=t.value;return!(e.payload!==Ka.End||!o&&!n)})),Ot((()=>{const{share:{remoteControllingSsrc:e,remoteControlApprovedSsrc:o,isEnableAutoDeleteRcApp:n},meeting:{userId:r}}=t.value,{isMacOS:i}=Gi;e&&gb(t.value,Eb),o!==e&&Eb.remoteControlConsent(Au.Decline,o,r,{...Ib.getShareStreamInfo(),platform:i?"mac":"win"},n)})),Et(fe)),remoteControlEpics11:(e,t)=>yn(e,16430).pipe(Xe((()=>(mb(),vb(),Rc(ml,_u.Launched),t.value.share.status!==Ka.End&&function(e,t){(async function(e){const{media:{assetsPath:t}}=e,o=`${t}/qrscanner.min.js`;return"WebQrscanner"in window?Promise.resolve(""):new Promise(((e,t)=>{ub.log(`load qr scanner script start. url:${o}`),If(o,(()=>{ub.log("load qr scanner script done."),e("")}),t)}))})(e).then((()=>{ub.log("qr scanning start"),t.startRemoteControlQRCheck(!0)}))}(t.value,Ib),Ue([em(""),qh(0)]))))),remoteControlEpics12:e=>In(e,Na.CurrentDesktopSharingWidthHeight).pipe(Ot((()=>{Eb.syncSharedContentMetaWithRcApp(Ib.getShareStreamInfo())})),Et(fe)),remoteControlEpics13:(e,t)=>In(e,Na.SendRemoteControlQrCode).pipe(Ot((e=>{const{payload:{data:o}}=e,{share:{status:n}}=t.value;n!==Ka.End&&Array.isArray(o)&&o.length>0&&o.forEach((e=>{null!=e&&e.startsWith("zrc_")&&Eb.sendRemoteControlAuth(e)}))})),Et(fe)),remoteControlEpics14:e=>yn(e,16434).pipe(Ot((e=>{const{payload:{body:{result:t}}}=e;0===t&&(yb(),Rc(vl,wu.Started))})),Et(fe)),remoteControlEpics15:(e,t)=>yn(e,as).pipe(mt((e=>{var o,n;const{meeting:{userId:r},share:{remoteControlledUserList:i}}=t.value,{payload:{body:s}}=e;return i.length>0&&((null===(o=s.update)||void 0===o?void 0:o.some((e=>e.id!==r&&!1===e.bShareOn)))||(null===(n=s.remove)||void 0===n?void 0:n.some((e=>e.id!==r))))})),Xe((e=>{var o,n,r,i;const{payload:{body:s}}=e,{share:{remoteControlledUserList:a,activeNodeId:u,isGrabRemoteControl:d},meeting:{userId:l}}=t.value,c=(null!==(o=null===(n=s.update)||void 0===n?void 0:n.filter((e=>e.id!==l&&!1===e.bShareOn)))&&void 0!==o?o:[]).concat(null!==(r=null===(i=s.remove)||void 0===i?void 0:i.filter((e=>e.id!==l)))&&void 0!==r?r:[]),p=[];return a.forEach((e=>{c.find((t=>t.id===e))&&(p.push(nm(e)),e===u&&d&&(p.push(Lh(!1)),Rc(sl,!1)))})),Ue(p)}))),remoteControlEpics16:(e,t)=>e.pipe($t(`${Br}`),Ot((()=>{const{share:{remoteControllingSsrc:e,status:o}}=t.value;o===Ka.Sharing&&e&&Rc(vl,wu.Ended)})),Et(fe))},EE={epics0:(e,t)=>yn(e,us).pipe(mt((e=>{var t;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.lockShare)})),Tt(t),Ot((e=>{let[t,o]=e;const{share:{sharePrivilege:n}}=o,{payload:{body:{lockShare:r}}}=t;n!==r&&Rc(ll,r)})),ze((e=>{let[t]=e;return Ch(t.payload.body.lockShare)}))),epics1:e=>yn(e,20227).pipe(ze((e=>Ph(e.payload.body.ssrc)))),epics2:(e,t)=>yn(e,is).pipe(Tt(t),mt((e=>{let[t,o]=e;const{payload:{body:n}}=t,{share:{isReceiveSharingFromMainSession:r}}=o;return!r||r&&n.fromMainSession})),ze((e=>{let[t,o]=e;const{share:{isReceiveSharing:n,activeNodeId:r,isReceiveSharingFromMainSession:i},breakoutRoom:s}=o,{payload:{body:a}}=t;if(n&&1===a.bStatus){let e=!1;(null==s?void 0:s.currentRoom.status)===up.InRoom&&s.mainSessionAttendeeList.length>0&&(e=s.mainSessionAttendeeList.findIndex((e=>e.userId===r))>-1),Sb.unsubscribeSharing(r,e),lb(Sb,o,a.activeNodeID),bb.switchSharingSource(a.ssrc,i),Rc(rl,{userId:a.activeNodeID})}else if(1===a.bStatus){const e={activeUserId:a.activeNodeID,isActive:!0};i&&Object.assign(e,{isFromMainSession:!0}),Rc(zd,e)}else if(n){const e={activeUserId:a.activeNodeID,isActive:!1};i&&Object.assign(e,{isFromMainSession:!0}),Rc(zd,e)}return _h(a)}))),epics3:e=>In(e,Na.CheckChromeSharingExtensionResponse).pipe(ze((e=>(Rc(Kd,e.payload.data),Rh(e.payload.data))))),epics4:(e,t)=>In(e,[Na.SharingDesktopStreamHaveAudio,Na.SharingDesktopStreamHaveNoAudio]).pipe(mt((e=>e.payload.type!==Na.SharingDesktopStreamHaveAudio||!t.value.audio.secondaryAudioMicrophoneId)),Tt(t),ze((e=>{let[t,o]=e;const{meeting:{userId:n},share:{isSharingToBreakoutRoom:r,isOptimizedForSharedVideo:i}}=o,{payload:{type:s}}=t,a=s===Na.SharingDesktopStreamHaveAudio;return Sb.startSharing(n,{bShareToBO:r,bShareAudio:a,bShareVideo:!!i}),bb.switchSharingMode(i?bu.VideoMode:bu.Normal),Oh(!1)}))),epics5:e=>In(e,[Na.DesktopSharingError,Na.DesktopSharingChromeExtensionUninstalled,Na.DesktopSharingPermissionDenied,Na.DesktopSharingSystemError]).pipe(Xe((e=>{const t=[];let o="";return[Na.DesktopSharingPermissionDenied,Na.DesktopSharingSystemError].includes(e.payload.type)&&(t.push(Oh(!0)),e.payload.type===Na.DesktopSharingSystemError?Gi.isMacOS&&(o="To use screen share on Chrome, please allow screen recording access in system setting."):o="To use screen share, please allow the permission request."),Rc(qd,{reason:o}),Ue(t)}))),epics6:e=>In(e,Na.CurrentDesktopSharingWidthHeight).pipe(mt((e=>!!e.payload.data)),ze((e=>{Rc(Jd,e.payload.data);const{payload:{data:{width:t,height:o}}}=e;return bb.ajustmentSharingCanvas(t,o),Th(e.payload.data)}))),epics7:(e,t)=>In(e,Na.SharingDecodeMaxSize).pipe(mt((e=>!!e.payload.data)),Tt(t),Xf((e=>{let[t,o]=e;const{share:{shareQuality:n,activeNodeId:r}}=o,{payload:{data:{fps:i}}}=t,s=Number(i);if(n!==s)return lb(Sb,o,r,s),kh(s)}))),epics8:e=>yn(e,20226).pipe(Ot((e=>{var t,o;if(Rc(Qd,null===(t=e.payload)||void 0===t?void 0:t.body),null!==(o=e.payload)&&void 0!==o&&o.body){const{payload:{body:{width:t,height:o}}}=e;bb.ajustmentReceivedSharingCanvas(t,o)}})),ze((e=>Mh(e.payload.body)))),epics9:e=>In(e,Na.SharingPara).pipe(Ot((e=>{var t,o;if(Rc(Qd,null===(t=e.payload.data)||void 0===t?void 0:t.body),null!==(o=e.payload.data)&&void 0!==o&&o.body){const{payload:{data:{body:{width:t,height:o}}}}=e;bb.ajustmentReceivedSharingCanvas(t,o)}})),ze((e=>{var t;return Mh(null===(t=e.payload.data)||void 0===t?void 0:t.body)}))),epics10:(e,t)=>In(e,Na.UserStopDesktopSharing).pipe(Tt(t),ze((e=>{let[,t]=e;const{meeting:{userId:o},share:{status:n}}=t;return n!==Ka.End&&(Sb.stopSharing(o),bb.stopDesktopSharing(),Rc(Zd)),Dh(Ka.End)}))),epics11:(e,t)=>yn(e,as).pipe(Tt(t),mt((e=>{let[t,o]=e;const{meeting:{userId:n}}=o,r=t.payload.body.update;return r&&r.length>0&&r.findIndex((e=>e.id===n&&void 0!==e.bShareOn))>-1})),Xe((e=>{let[t,o]=e;const{meeting:{userId:n},share:{status:r,isReceiveSharing:i,activeNodeId:s}}=o,{payload:{body:{update:a}}}=t,u=a.find((e=>e.id===n&&!1===e.bShareOn)),d=a.find((e=>e.id===n&&!0===e.bShareOn)),l=[];return u&&r!==Ka.End&&(Sb.stopSharing(n),bb.stopDesktopSharing(),l.push(Dh(Ka.End)),Rc(Yd)),d&&r===Ka.End&&(i&&(bb.stopRenderSharing(),Sb.unsubscribeSharing(s),l.push(wh(!1))),l.push(Dh(Ka.Sharing))),Ue(l)}))),epics12:(e,t)=>yn(e,as).pipe(Tt(t),mt((e=>{let[t,o]=e;const{meeting:{userId:n}}=o,r=t.payload.body.update;return r&&r.length>0&&r.findIndex((e=>e.id!==n&&void 0!==e.bShareOn))>-1})),Xe((o=>{let[n,r]=o;const{payload:{body:{update:i}}}=n,{share:{activeNodeId:s,isReceiveSharing:a}}=r,u=py(r),d=i.filter((e=>!0===e.bShareOn&&!1===e.bSharePause)),l=i.filter((e=>!0===e.bShareOn&&!0===e.bSharePause)),c=i.filter((e=>!1===e.bShareOn));return d.length>0&&d.forEach((e=>{-1===u.findIndex((t=>t.userId===e.id))?Rc(el,e):Rc(nl,e)})),l.length>0&&l.forEach((e=>{Rc(ol,e)})),c.length>0&&(c.forEach((e=>{Rc(tl,e)})),a&&c.some((e=>e.id===s)))?vt(yn(e,is).pipe(ft(1),Et(fe)),dt(50).pipe(Et(Be("timeout")))).pipe(gt((()=>{const{share:{activeNodeId:e,isReceiveSharingFromMainSession:o},audio:n}=t.value,r=u.filter((t=>t.userId!==e));if(r.length>0){const i=r[0],{userId:s}=i;return Sb.unsubscribeSharing(e,o),lb(Sb,t.value,s),bb.switchSharingSource(s,o),null==n||n.localShareAudioUserMutedList.forEach((e=>{bb.setSharingAudioVolume(s,e.userId!==s||e.muted,e.isFromMainSession)})),Rc(rl,{userId:s}),je(_h({activeNodeID:s,bStatus:1,ssrc:s}))}return fe}))):fe}))),epics13:(e,t)=>yn(e,ss).pipe(Tt(t),_t((e=>{let[o,n]=e;const{payload:{body:{encryptKey:r,additionalType:i}}}=o,{media:{sharingDecodeStatus:s,sharingEncodeStatus:a},meeting:{confId:u,userId:d,zoomId:l,meetingId:c,meetingNumber:p,isWebinar:h}}=n;return kf(t).pipe(_t((e=>{let o=a;return(!Gi.isSupportSendScreenSharing||h&&e&&rp(e.userRole))&&(o="failed"),Pf("sharing",o,s).pipe(Ot((e=>{let[o,n]=e;const s={userId:d,sn:pr(l),confId:u,encryptKey:pr(r),encryptType:i,meetingId:c,meetingNumber:p};if(o&&(null==bb||bb.updateMediaParams({iVType:Yi.SHARING_ENCODE,isFromMainSession:!1,updateParams:s})),n){bb.updateMediaParams({iVType:Yi.SHARING_DECODE,isFromMainSession:!1,updateParams:s});const{participants:{attendeesList:e}}=t.value;if(e.length>0){const t=e.map((e=>({userid:e.userId,sn:e.zoomID&&pr(e.zoomID)})));bb.updateUserMediaSN({added:t,isFromMainSession:!1,iVType:Yi.SHARING_DECODE})}}})),Et(fe))})))}))),epics14:(e,t)=>En(e,20235).pipe(Tt(t),Ot((e=>{let[t,o]=e;const{media:{sharingDecodeStatus:n}}=o,{type:r,payload:{body:i}}=t,s=r===`${Ho}`;Pf("sharing","success",n).subscribe((e=>{let[,t]=e;t&&bb.addReceivedSharingChannelType({isFromMainSession:s,...i})}))})),Et(fe)),epics15:(e,t)=>En(e,20236).pipe(Tt(t),Ot((e=>{let[t,o]=e;const{media:{sharingDecodeStatus:n}}=o,{type:r,payload:{body:{ssrc:i}}}=t,s=r===`${Ho}`;Pf("sharing","success",n).subscribe((e=>{let[,t]=e;t&&bb.removeReceivedSharingChannelType({isFromMainSession:s,ssrc:i})}))})),Et(fe)),epics16:e=>In(e,Na.SharingFirstDecodeFrameReceivedSsrc).pipe(mt((e=>!!e.payload.data)),Ot((e=>{const{payload:{data:{ssrc:t}}}=e;Sb.sendReceivingSharingReady(t)})),Et(fe)),epics17:(e,t)=>yn(e,20233).pipe(mt((()=>!!t.value.share.isRequireReadReceipt)),Ot((e=>{const{payload:{body:{bReceiveOk:t}}}=e;t&&Rc(cl)})),Et(fe)),epics18:(e,t)=>yn(e,us).pipe(mt((e=>{var t;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.lockShare)})),Xe((e=>{const{payload:{body:{lockShare:o}}}=e,{share:{isOptimizedForSharedVideo:n,isSharingToBreakoutRoom:r},audio:{isSharingAudio:i},meeting:{userId:s}}=t.value,a=[];return o===za.MultipleShare&&n&&(Sb.startSharing(s,{bShareAudio:i,bShareToBO:r,bShareVideo:!1}),bb.switchSharingMode(bu.Normal),a.push(Fh(!1))),Ue(a)}))),epics19:(e,t)=>In(e,Na.ShareQosData).pipe(Tt(t),ze((e=>{var t;let[o,n]=e;const{meeting:{isWebinar:r},media:{sharingEncodeStatus:i,sharingDecodeStatus:s},share:{status:a,isReceiveSharing:u},participants:{xmppAttendeeList:d}}=n;let l=Rp(n).length>0;r&&(l=l||Boolean(d.length));const c=a!==Ka.End&&"success"===i&&l,p=u&&"success"===s;return null!==(t=o.payload.data)&&void 0!==t&&t.encoding?c?(Rc(pl,o.payload),Hh(o.payload)):Hh(mu):p?(Rc(pl,o.payload),$h(o.payload)):$h(mu)})))},IE=fn(EE,bE),AE=Ls.createAgent();let CE,_E,wE=function(e){return e.Add="add",e.List="list",e.Remove="memberremove",e.rename="rename",e.update="UPDATE",e}({}),RE=function(e){return e.Open="open",e.Message="message",e.Error="error",e.Close="close",e}({});class OE{constructor(){this.eventHandlers=void 0,this.websocket=void 0,this.seq=void 0,this.eventHandlers=new Map,this.websocket=null,this.seq=1}static getInstance(){return this.xmppInstance||(this.xmppInstance=new OE),this.xmppInstance}on(e,t){let o=this.eventHandlers.get(e);o||(o=[]),o.push(t),this.eventHandlers.set(e,o)}off(e,t){const o=this.eventHandlers.get(e);if(o){const n=o.filter((e=>e!==t));this.eventHandlers.set(e,n)}}emit(e,t){const o=this.eventHandlers.get(e);o&&o instanceof Array&&o.slice(0).forEach((e=>{try{e(t)}catch(e){console.error(e)}}))}sendMessageToRwg(e){this.seq+=1;const t=this.seq;return this.websocket&&this.websocket.readyState===WebSocket.OPEN&&this.websocket.send(JSON.stringify(Object.assign(e,{seq:t}))),t}connect(e){this.websocket=new WebSocket(e),this.websocket.binaryType="arraybuffer",this.addWebSocketEventListeners()}close(){var e;null===(e=this.websocket)||void 0===e||e.close()}addWebSocketEventListeners(){this.websocket&&(this.websocket.addEventListener("open",(e=>{this.emit(RE.Open,e)})),this.websocket.addEventListener("message",(e=>{const{data:t}=e;var o;if(t instanceof ArrayBuffer)0===new Uint8Array(t)[0]&&(null===(o=this.websocket)||void 0===o||o.send(t));else try{this.emit(RE.Message,JSON.parse(t))}catch(e){console.warn("Unsupported format",t)}})),this.websocket.addEventListener("close",(e=>{this.emit(RE.Close,e)})),this.websocket.addEventListener("error",(e=>{this.emit(RE.Error,e)})))}join(e){return{seq:this.sendMessageToRwg({evt:24576,body:{clientCap:e}})}}raiseHand(){return{seq:this.sendMessageToRwg({evt:24580,body:null})}}lowerHand(e){return{seq:this.sendMessageToRwg({evt:24578,jids:e||[]})}}sendWebinarMseeage(e,t,o){const n={msg:e,jid:t?[t]:[],type:o,bcm:arguments.length>3&&void 0!==arguments[3]&&arguments[3]};return{seq:this.sendMessageToRwg({evt:24582,body:n})}}sendAnswer(e,t,o){return{seq:this.sendMessageToRwg({evt:24584,body:{question_attendeejid:t.jid,question_attendeename:t.displayName,question_text:t.questionText,question_id:t.questionId,question_anonymous:t.isAnonymous,question_time:t.questionTime,text:e,isPrivate:o}})}}answerOnline(e,t){return{seq:this.sendMessageToRwg({evt:24586,body:{question_attendeejid:e.jid,question_attendeename:e.displayName,question_text:e.questionText,question_id:e.questionId,question_anonymous:e.isAnonymous,question_time:e.questionTime,isLiveStart:t}})}}dismissQuestion(e){return{seq:this.sendMessageToRwg({evt:24590,body:{question_attendeejid:e.jid,question_attendeename:e.displayName,question_text:e.questionText,question_id:e.questionId,question_anonymous:e.isAnonymous,question_time:e.questionTime,bOpen:!1}})}}deleteQuestion(e){return{seq:this.sendMessageToRwg({evt:24614,body:{question_id:e,bDelete:!0}})}}deleteComment(e){return{seq:this.sendMessageToRwg({body:{comment_id:e,bDelete:!0},evt:24616})}}reopenQuestion(e){return{seq:this.sendMessageToRwg({body:{question_attendeejid:e.jid,question_attendeename:e.displayName,question_text:e.questionText,question_id:e.questionId,question_anonymous:e.isAnonymous,question_time:e.questionTime,bOpen:!0},evt:24590})}}askQuestion(e,t){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0;const r=vr();return{seq:this.sendMessageToRwg({body:{id:r,text:e,isAnonymous:o,bAllowAttendeeViewAllQuestion:n,name:t},evt:24592}),questionId:r}}upOrDownVote(e,t){return{seq:this.sendMessageToRwg({body:{question_attendeejid:e.jid,question_attendeename:e.displayName,question_text:e.questionText,question_id:e.questionId,question_anonymous:e.isAnonymous,question_time:e.questionTime,bUpVote:t},evt:24598})}}rename(e,t){return{seq:this.sendMessageToRwg({body:{jid:e,displayName:t},evt:24600})}}setSkinTome(e){return{seq:this.sendMessageToRwg({body:{skinTone:e},evt:24618})}}}OE.xmppInstance=null;const TE=Ls.createAgent();let DE=null;function PE(e){switch(e.responseType){case"json":if("response"in e)return e.response;var t=e;return JSON.parse(t.responseText);case"document":return e.responseXML;default:return"response"in e?e.response:(t=e).responseText}}var kE=function(e,t,o,n){void 0===n&&(n="download_load"),this.originalEvent=e,this.xhr=t,this.request=o,this.type=n;var r=t.status,i=t.responseType;this.status=null!=r?r:0,this.responseType=null!=i?i:"";var s=t.getAllResponseHeaders();this.responseHeaders=s?s.split("\n").reduce((function(e,t){var o=t.indexOf(": ");return e[t.slice(0,o)]=t.slice(o+2),e}),{}):{},this.response=PE(t);var a=e.loaded,u=e.total;this.loaded=a,this.total=u},ME=S((function(e){return function(e,t,o){var n;this.message=e,this.name="AjaxError",this.xhr=t,this.request=o,this.status=t.status,this.responseType=t.responseType;try{n=PE(t)}catch(e){n=t.responseText}this.response=n}})),LE=function(){function e(e,t){return ME.call(this,"ajax timeout",e,t),this.name="AjaxTimeoutError",this}return e.prototype=Object.create(ME.prototype),e}();var NE=ze((function(e){return e.response}));var VE,UE=(VE=function(e){var t;return t="string"==typeof e?{url:e}:e,new $((function(e){var o,n,r,i=c({async:!0,crossDomain:!1,withCredentials:!1,method:"GET",timeout:0,responseType:"json"},t),s=i.queryParams,a=i.body,u=i.headers,d=i.url;if(!d)throw new TypeError("url is required");if(s)if(d.includes("?")){var l=d.split("?");if(2{const{meeting:{encryptedRWC:t,encryptedGEORWC:o,discardedRwcList:n,meetingOptions:r}}=e;let i=[];return(null==r?void 0:r.isEnableGeoFenceRWC)&&o&&(null==o?void 0:o.length)>0?i=o.filter((e=>!n.includes(e.rwc))).reduce(((e,t)=>{const{dl:o,rwc:n,rwcToken:r}=t,i=e.find((e=>e.dl===o));if(i)i.items.push({rwc:n,rwcToken:r});else{const t={dl:o,items:[]};t.items.push({rwc:n,rwcToken:r}),e.push(t)}return e}),[]):t&&(i=[{dl:0,items:Object.keys(t).map((e=>({rwc:e,rwcToken:t[e]})))}]),i},KE=e=>ct(...e.map((e=>0===e.dl?Ue(e.items):dt(e.dl).pipe(Xe((()=>Ue(e.items))))))),qE=(e,t)=>e.pipe($t(`${jr}`),Tt(t),mt((e=>{let[,t]=e;return void 0!==t.meeting.encryptedRWC||void 0!==t.meeting.encryptedGEORWC&&t.meeting.encryptedGEORWC.length>0})),_t((e=>{let[,o]=e;const{meeting:{ts:n,auth:r,meetingNumber:i,meetingOptions:s,meetingId:a,userName:u},breakoutRoom:d}=o,l=null==s?void 0:s.isEnableGeoFenceRWC,c=zE(o);if(c.length>0){const e={serversLength:c.reduce(((e,t)=>e+t.items.length),0),pingFailedServerList:[],pingRwcServerCounts:0,retryCounts:0};let o;return l&&(o=new ee,KE(c).subscribe((e=>{var t;return null===(t=o)||void 0===t?void 0:t.next(e)}))),(l?o:KE(c)).pipe(Rt((()=>{const{meeting:{meetingStatus:n,meetingId:r}}=t.value,i=n===Ti.Initial&&!!r&&e.pingFailedServerList.length0;return!i&&o&&o.complete(),i})),Ot((()=>{if(e.pingRwcServerCounts=e.pingRwcServerCounts+1,l&&e.pingRwcServerCounts===e.serversLength){const n=1e3*Math.floor(5*Math.pow(2,e.retryCounts));e.retryCounts=e.retryCounts+1,GE.makeLogger(["Join Meeting Flow"]).info(`ping rwc retry,current rwc list:${JSON.stringify(zE(t.value))},retry counts:${e.retryCounts}, ${JSON.stringify({meetingId:a,meetingNumber:YS(i),userName:YS(u)})}`,["Ping RWC Retry"]),dt(n).pipe(ze((()=>{const o=zE(t.value);return Object.assign(e,{serversLength:o.reduce(((e,t)=>e+t.items.length),0),pingFailedServerList:[],pingRwcServerCounts:0}),o}))).subscribe((e=>{KE(e).subscribe((e=>{o.next(e)}))}))}})),Xe((t=>{const{rwc:s,rwcToken:c}=t,p=((e,t,o,n,r,i)=>{const s={ts:n,auth:r,rwcToken:o,dmz:1};return i&&Object.assign(s,{confID:i}),`https://${e}/wc/ping/${t}?${new URLSearchParams(s).toString()}`})(s,i,c,n,r,null==d?void 0:d.currentRoom.boConfId);return UE({url:p,crossDomain:br(p)}).pipe(Xe((e=>{let t={};return t=e.response?{...e.response,rwc:s,fromNginx:!1}:{rwc:s,rwg:s,rwcToken:c,fromNginx:!0},Ue([Wo(t),Mo()])})),gt((()=>{const{pingFailedServerList:t,serversLength:n}=e;return t.push(p),t.length===n&&(l&&o&&o.complete(),GE.report(`ping rwc error, ${JSON.stringify({meetingId:a,meetingNumber:YS(i),userName:YS(u)})}`,["Join Meeting Flow","Ping RWC Error"],"error"),Rc(Qs,{reason:"connection error",errorCode:Dr.CommonError})),fe})))})),Ct(Zr(performance.now())))}return fe})));let JE=0;const QE=ob.getInstance(),ZE={meetingStatus:Ti.Initial,isWindowOpen:!1,apiKey:"",signature:"",signatureType:"",lang:"en-US",tk:"",customerKey:"",mtkGuid:"",pingRWCTimestamp:0,meetingInfoTimestamp:0,passWord:"",meetingNumber:0,userName:"",userEmail:"",sdkUrl:"",sdkOrigin:"",proxy:1,cv:"",meetingId:"",tid:"",ts:"",auth:"",sign:"",isSupportCallOut:!1,tollNumbers:void 0,recordingEnable:!1,callOutCountry:void 0,inviteEmail:"",xmppConfig:null,isSupportH323:!1,h323GatewayInfo:"",h323Password:"",trackAuth:"",isOriginHost:!1,isWebinar:!1,encryptedRWC:void 0,meetingOptions:{},meetingTopic:"",bLock:!1,bHoldUponEntry:!1,viewOnly:0,listenOnlyPhone:0,bAllowRaiseHand:!1,bAllowAttendeeRename:!1,bBroadcast:void 0,bAllowPlayChimeForEnterOrExit:!1,bIbDisableShare:!1,bIbDisableChat:!1,bAllowShowCount:!1,encryptKey:"",bNoHostTimeOut:!1,confId:"",conId:"",e2eEncrypt:!1,zoomId:"",jid:"",xtoken:"",groups:void 0,svcUrl:"",encType:NaN,userGUID:"",userId:NaN,isHost:!1,isCoHost:!1,participantID:0,isOnHold:!1,isMeetingReset:!1,bRecord:!1,audioVideoBeforeOnHold:void 0,region:void 0,network:void 0,joinMeetingTimeStamp:0,activeAppInfo:void 0,recordingDisclaimerForRecorder:{},recordingDisclaimer:{},ccUrl:"",sessionIdleTimeoutMins:40,reportDomain:"",isAudioBridgeEnabled:!0,discardedRwcList:[],sharePronounType:void 0,stayAwake:!1,wrInfo:{},meetingInfo:{},isNewJoinFlow:!1,gatewayUserList:[],logConfig:"",logEncryptionPubKey:"",failover:{count:0,isCurrentFailoverRecorded:!1,reason:-1,interval:0,joinMeetingSuccessTimestamp:0,sequence:""},enableLongPollingCheckStart:!1,rsPwd:""},YE=ko({[`${Wr}`]:fE(((e,t)=>{let{payload:o}=t;o.customerKey=e.customerKey||o.customerKey||"",Object.assign(e,o),e.meetingStatus=Ti.Initial})),[`${Gr}`]:fE(((e,t)=>{let{payload:o}=t;o.customerKey=e.customerKey||o.customerKey||"",Object.assign(e,o)})),[`${zr}`]:fE(((e,t)=>{let{payload:o}=t;e.isWindowOpen=o})),[`${Kr}`]:fE(((e,t)=>{let{payload:o}=t;o.useSDK?e.signatureType="sdk":e.signatureType="api",e.apiKey=o.apiKey,e.signature=o.signature,e.lang=o.language})),[`${qr}`]:fE(((e,t)=>{let{payload:o}=t;e.ztk=o})),[`${Jr}`]:fE(((e,t)=>{let{payload:o}=t;e.zsk=o})),[`${Qr}`]:fE(((e,t)=>{let{payload:o}=t;e.tk=o.tk,e.mtkGuid=o.mtkGuid})),[`${Zr}`]:fE(((e,t)=>{let{payload:o}=t;e.pingRWCTimestamp=o})),[`${Ai}`]:fE(((e,t)=>{let{payload:o}=t;e.meetingInfoTimestamp=o})),[`${Yr}`]:fE(((e,t)=>{let{payload:o}=t;e.confId=o.confID,e.conId=o.conID,e.e2eEncrypt=o.e2eEncrypt,e.meetingNumber=parseInt(o.mn,10),e.zoomId=o.zoomID,e.meetingStatus=Ti.Joined,e.jid=o.jid,e.xtoken=o.xtoken,e.groups=o.groups,e.svcUrl=o.svcUrl,e.encType=o.encType,e.userGUID=o.userGUID,e.userId=o.userID,e.role=o.role,e.participantID=o.participantID,e.reportDomain=o.reportDomain,e.abToken=o.ABtoken,e.supportLocalAB=!!o.supportLocalAB,o.enableWebTransport&&(e.enableWebtransport=o.enableWebTransport,e.webtransportPort=o.WebTransportPort)})),[`${Xr}`]:fE(((e,t)=>{let{payload:o}=t;if(o.gatewayUser){var n;const{userId:t,sn:i}=o.gatewayUser,s=null===(n=e.gatewayUserList)||void 0===n?void 0:n.find((e=>e.userId===t));var r;s?s.sn=i:null===(r=e.gatewayUserList)||void 0===r||r.push(o.gatewayUser)}else Object.assign(e,o)})),[`${ti}`]:fE(((e,t)=>{let{payload:o}=t;e.isHost=o})),[`${oi}`]:fE(((e,t)=>{let{payload:o}=t;e.isCoHost=o})),[`${ni}`]:fE(((e,t)=>{let{payload:o}=t;e.isOnHold=o})),[`${ri}`]:fE(((e,t)=>{let{payload:o}=t;e.isMeetingReset=o})),[`${ii}`]:fE(((e,t)=>{let{payload:o}=t;e.audioVideoBeforeOnHold=o})),[`${si}`]:fE(((e,t)=>{let{payload:o}=t;e.currentUserAudioBeforeReset=o})),[`${ai}`]:fE(((e,t)=>{let{payload:o}=t;e.isCurrentUserMutedBeforeReset=o})),[`${ui}`]:fE(((e,t)=>{let{payload:o}=t;e.meetingStatus=o})),[`${di}`]:fE(((e,t)=>{let{payload:o}=t;e.region=o.region,e.network=o.network})),[`${li}`]:fE(((e,t)=>{let{payload:o}=t;e.isCurrentUserStartVideoBeforeReset=o})),[`${ci}`]:fE(((e,t)=>{let{payload:o}=t;e.joinMeetingTimeStamp=o})),[`${pi}`]:fE(((e,t)=>{let{payload:o}=t;e.activeAppInfo=o})),[`${hi}`]:fE(((e,t)=>{let{payload:o}=t;e.idleStartTime=o})),[`${mi}`]:fE(((e,t)=>{let{payload:o}=t;e.sessionIdleTimeoutMins=o})),[`${vi}`]:fE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeEnabled=o})),[`${gi}`]:fE(((e,t)=>{var o,n;let{payload:r}=t;const i=null===(o=e.encryptedGEORWC)||void 0===o||null===(n=o.find((e=>e.rwc===r)))||void 0===n?void 0:n.dc;if(i){var s;const t=null===(s=e.encryptedGEORWC)||void 0===s?void 0:s.filter((e=>e.dc===i));t&&e.discardedRwcList.some((e=>(null==t?void 0:t.findIndex((t=>t.rwc===e)))>=0))&&e.discardedRwcList.push(...t.map((e=>e.rwc))),e.discardedRwcList.push(r)}})),[`${fi}`]:fE(((e,t)=>{let{payload:o}=t;e.sharePronounType=o})),[`${yi}`]:fE(((e,t)=>{let{payload:o}=t;e.stayAwake=o})),[`${Si}`]:fE(((e,t)=>{let{payload:o}=t;e.failover.joinMeetingSuccessTimestamp=o})),[`${bi}`]:fE((e=>{Object.assign(e.failover,{...ZE.failover,count:e.failover.count,joinMeetingSuccessTimestamp:e.failover.joinMeetingSuccessTimestamp})})),[`${Ei}`]:fE(((e,t)=>{let{payload:o}=t;const{count:n,reason:r,interval:i,sequence:s}=o;e.failover.count=n,e.failover.reason=r,e.failover.interval=i,e.failover.isCurrentFailoverRecorded=!0,e.failover.sequence=s})),[`${Ii}`]:fE(((e,t)=>{let{payload:o}=t;e.quicklyLeave=o})),[`${Ci}`]:fE(((e,t)=>{let{payload:o}=t;e.isEnableZmkFromRWG=o})),[`${ei}`]:(e,t)=>{let{payload:o}=t;const{isFailover:n}=o,r={isMeetingReset:!0,apiKey:e.apiKey,signatureType:e.signatureType,signature:e.signature,lang:e.lang,proxy:1,stayAwake:e.stayAwake};return n&&Object.assign(r,{currentUserAudioBeforeReset:e.audioVideoBeforeOnHold?e.audioVideoBeforeOnHold.audio:o.audio,isCurrentUserMutedBeforeReset:e.audioVideoBeforeOnHold?e.audioVideoBeforeOnHold.muted:o.muted,isCurrentUserStartVideoBeforeReset:e.audioVideoBeforeOnHold?e.audioVideoBeforeOnHold.video:o.video,meetingNumber:e.meetingNumber,userName:e.userName,passWord:e.passWord,userEmail:e.userEmail,sdkUrl:e.sdkUrl,sdkOrigin:e.sdkOrigin,cv:e.cv,zsk:e.zsk,ztk:e.ztk,idleStartTime:e.idleStartTime,sessionIdleTimeoutMins:e.sessionIdleTimeoutMins,customerKey:e.customerKey,failover:e.failover,stayAwake:e.stayAwake,quicklyLeave:e.quicklyLeave}),{...ZE,...r}}},ZE),XE={meetingFailoverReportEpic0:(e,t)=>e.pipe($t(`${Wr}`),_t((()=>{const o=0===t.value.meeting.failover.joinMeetingSuccessTimestamp&&!!Ni.get(Vi.WebclientZoomId);return e.pipe($t(`${Yr}`),ft(1),Xe((()=>{const e=[],{count:n,sequence:r}=Ni.get(Vi.WebclientFailoverCount)||{};let{meeting:{failover:{count:i,reason:s,interval:a}}}=t.value;const{meeting:{pingRWCTimestamp:u}}=t.value;if(o){i=n+1,s=Pi.RefreshPage,a=0;const t=r?`${r}-${s}`:`${s}`;Ni.set(Vi.WebclientFailoverCount,{count:i,sequence:t},Mi.SessionStorage),e.push(Ei({count:i,reason:s,interval:a,sequence:t}))}const d=performance.now();let l=`WCL_M, JMCT(${d-u})`;return i>0&&s!==Pi.NormalCase&&(l=`${l},FAILOVER(${i},${s},${(a/1e3).toFixed(1)})`),TE.sendRWGConnectionPerformance(l),e.push(bi(),Si(d)),Ue(e)})))}))),meetingFailoverReportEpic1:(e,t)=>e.pipe($t(`${Br}`),Xe((e=>{const{payload:o}=e,{meeting:{failover:{joinMeetingSuccessTimestamp:n,isCurrentFailoverRecorded:r},userGUID:i,userId:s}}=t.value,a=[];if(!r){let{count:e,sequence:t}=Ni.get(Vi.WebclientFailoverCount)||{};t=t?`${t}-${o}`:`${o}`,o!==Pi.NormalCase&&(e+=1,Ni.set(Vi.WebclientFailoverCount,{count:e,sequence:t},Mi.SessionStorage));const r=performance.now()-n;a.push(Ei({reason:o,count:e,interval:r,sequence:t,userGUID:i,userId:s}))}return Ue(a)})))},eI={sessionIdleEpic0:(e,t)=>e.pipe($t(`${Yr}`),Tt(t),mt((e=>{let[,t]=e;return void 0!==t.meeting.zlkJwtToken})),_t((()=>(CE&&CE.complete(),CE=new Q,_E=lt(6e4).pipe(ze((()=>performance.now()))).subscribe(CE),CE.pipe(ze((e=>$r(e)))))))),sessionIdleEpic1:e=>e.pipe($t(`${No}`)).pipe(Ot((()=>{CE&&(CE.complete(),_E.unsubscribe())})),Et(fe)),sessionIdleEpic2:(e,t)=>e.pipe($t(`${$r}`),Tt(t),Xe((e=>{var t;let[o,n]=e;const{meeting:{idleStartTime:r,sessionIdleTimeoutMins:i,isOriginHost:s},participants:{attendeesList:a,xmppAttendeeList:u},recording:d,breakoutRoom:l}=n,c=o.payload,p=[];if(1===a.length&&0===u.length&&(null==l||null===(t=l.currentRoom)||void 0===t?void 0:t.status)!==up.InRoom&&(null==d?void 0:d.cmrStatus)!==Aa.Start)if(r){const e=s&&tp(a[0].userRole)?i:40;c-r>60*e*1e3&&(console.warn(`No active for ${e} minutes, will end the session.`),p.push(Hr()),dt(500).subscribe((()=>{Pc()})))}else p.push(hi(c));else p.push(hi(void 0));return Ue(p)}))),sessionIdleEpic3:(e,t)=>e.pipe($t(`${Uo}`),mt((e=>[as,us].includes(e.payload.evt)&&void 0!==t.value.meeting.idleStartTime)),Le(he),Xe((()=>{var e;const{participants:{attendeesList:o,xmppAttendeeList:n},recording:r,breakoutRoom:i}=t.value,s=[];return(o.length>1||n.length>0||(null==r?void 0:r.cmrStatus)===Aa.Start||(null==i||null===(e=i.currentRoom)||void 0===e?void 0:e.status)===up.InRoom)&&s.push(hi(void 0)),Ue(s)}))),sessionIdleEpic4:e=>e.pipe($t(`${xr}`,`${Hr}`),yt(hi(void 0)))},tI={meetingMainEpics0:(e,t)=>yn(e,0).pipe(Ot((e=>{var o;if("READY"===(null===(o=e.payload.body)||void 0===o?void 0:o.status)){const{meeting:{zlkJwtToken:e,signatureType:o,sign:n,passWord:r,isHost:i,isOriginHost:s,ztk:a,zsk:u,tk:d,userEmail:l},breakoutRoom:c}=t.value,p=e?{zlkJwtToken:e}:{signType:o,sign:n};if(r&&""!==r&&(e?Object.assign(p,{mpwd:ur(r)}):i&&s||Object.assign(p,{mpwd:r})),(null==c?void 0:c.currentRoom.status)===up.Joining){const{currentRoom:{boId:e,boConfId:t,boToken:o}}=c;e&&t&&o&&Object.assign(p,{botk:o})}if(!e){a&&Object.assign(p,{zak:a}),(sessionStorage.getItem(Vi.WebclientZsk)||u)&&Object.assign(p,{zak:u}),d&&Object.assign(p,{tk:d});const e=Ni.get(Vi.WebclientWebinarToken);void 0!==e&&Object.assign(p,{tk:e});const t=sessionStorage.getItem(Vi.WebclientRecordingToken);t&&Object.assign(p,{localRecordToken:t}),l&&Object.assign(p,{email:l})}AE.sendLaunchParams(p);const h=Ni.get(Vi.WebclientMeetingToken);h&&AE.joinMeeting(h)}})),Et(fe)),meetingMainEpics1:(e,t)=>{return yn(e,cs).pipe(Tt(t),(o=e=>{let[t,o]=e;const{payload:{body:{res:n,userID:r,zoomID:i,mn:s,participantID:a,meetingtoken:u,role:d}}}=t,{meeting:{userEmail:l,userName:c,isMeetingReset:p,apiKey:h,zsk:m,signatureType:v}}=o;if(Rr.Success===n){const{WebclientParticipantId:e,WebclientZoomId:o,WebclientUserEmail:n,WebclientUserName:g,WebclientMeetingToken:f}=Vi;Ni.set(o,i,Mi.SessionStorage),Ni.set(e,a,Mi.SessionStorage),l&&Ni.set(n,l,Mi.SessionStorage),Ni.set(g,c,Mi.SessionStorage),u&&Ni.set(f,u,Mi.SessionStorage),m&&AE.sendSdkKeyToMonitor(v,h,r);const y=[Yr(t.payload.body),ci(performance.now())];return p&&y.push(ri(!1)),(d&Yc.Owner)===Yc.Owner&&(Rc(Qs,{reason:"dont support assisnt join through widget",errorCode:-1}),AE.leaveMeeting()),Rc(Js,{meetingNumber:s}),Ue(y)}if(Rr.MeetingLocked===n)Rc(Qs,Mr(n));else if(Rr.UserFull===n)Rc(Qs,Object.assign({},Mr(n),{lmUrl:t.payload.body.lmURL}));else if(Rr.MeetingIsOver===n)Rc(Qs,Mr(n));else if(Rr.MMRIBReject===n)Rc(Qs,Mr(n));else if(Rr.MMRConfParticipantExists===n)Rc(Qs,Mr(n));else if([Rr.UserHasBeenRemoved,Rr.WebinarBlockedEmail].includes(n))Rc(Qs,Mr(n));else if(Rr.MeetingNotStarted===n){var g;const e=Mr(n),{meeting:{meetingNumber:t,passWord:r,userName:i,userEmail:s,inviteEmail:a,meetingTopic:u,region:d,network:l,userId:c,lang:p,meetingId:h,participantID:m,wrInfo:v,meetingInfo:f,isNewJoinFlow:y,enableLongPollingCheckStart:S,tid:b,signature:E,rsPwd:I}}=o;Object.assign(e,{meetingInfo:{meetingNumber:t,password:r,userName:i,userEmail:s,inviteEmail:a,meetingTopic:u,region:d,network:l,userId:c,lang:p,webEndpoint:Df(),meetingId:h,participantId:m,wrInfo:Object.assign({},v,{isNew:y}),scheduleInfo:f,enableLongPollingCheckStart:S,rid:Yf(b),role:Number(null===(g=Er(E))||void 0===g?void 0:g.role),rsPwd:I}}),Rc(Qs,e)}else Rc(Qs,Mr(n));return Ue(Jf(o,!1))},F(_t(((e,t)=>o(e)||fe)))));var o},meetingMainEpics2:(e,t)=>yn(e,us).pipe(Tt(t),ze((e=>{let[t,o]=e;const{payload:{body:n}}=t,{meeting:{zoomId:r,encType:i,gcmSessinKey:s}}=o;if(void 0!==(null==n?void 0:n.encryptKey)&&rs.init(r,n.encryptKey,i),void 0!==(null==n?void 0:n.gatewayKey)){const e=Fs.getInstance(),[,t,o]=n.gatewayKey.split(".");e.sendUserNodeList([{userid:Number(t),sn:o&&pr(o)}],s)}return Rc(ea,n),Xr(n)}))),meetingMainEpics3:(e,t)=>yn(e,7939).pipe(Tt(t),Xe((e=>{let[t,o]=e;const{payload:{body:n}}=t;if(void 0!==n.reason){if(Or.Reconnect===n.reason)return Tr.WaitingRoomFailover===n.subReason?Rc(Zs,{reason:_i.OnHold}):Rc(Zs,{reason:_i.Failover}),je(Br(Pi.NormalCase));Or.KickedByHost===n.reason?Rc(Ys,{reason:"kicked by host"}):[Or.EndByHost,Or.EndByNone,Or.EndByAdmin,Or.EndByHostStartAnotherMeeting].includes(n.reason)?Rc(Ys,{reason:"ended by host"}):Or.FreeMeetingTimeout===n.reason?Rc(Ys,{reason:"free meeting ended"}):[Or.DuplicateSession,Or.MeetingTransfer].includes(n.reason)&&Rc(Ys,{reason:"duplicated session"})}return o.meeting.isMeetingReset?fe:Ue(Jf(o,!1))}))),meetingMainEpics4:(e,t)=>e.pipe($t(`${Br}`),Tt(t),Xe((e=>{let[,t]=e;const o=Jf(t,!0);let n;if(t.meeting.zlkJwtToken){const e=function(e){if(e){const{meeting:{topic:t,passWord:o,userName:n,zlkJwtToken:r,lang:i,cv:s,customerKey:a}}=e;return{topic:t,passWord:o,userName:n,zlkJwtToken:r,lang:i,cv:s,customerKey:a}}return null}(t),o={topic:null==e?void 0:e.topic,password:null!=e&&e.passWord?encodeURIComponent(null==e?void 0:e.passWord):"",userName:null==e?void 0:e.userName,zlk:null==e?void 0:e.zlkJwtToken,lang:null==e?void 0:e.lang,cv:null==e?void 0:e.cv,customerKey:null==e?void 0:e.customerKey};n=je(Ur(o)).pipe(bt(1e3))}else{const e=function(e){var t;const{meeting:{apiKey:o,signature:n,signatureType:r,meetingNumber:i,userName:s,lang:a,passWord:u,userEmail:d,sdkUrl:l,sdkOrigin:c,proxy:p,cv:h,ztk:m,zsk:v,tk:g}}=e;let f=m||sessionStorage.getItem(Vi.WebclientZtk),y=v||sessionStorage.getItem(Vi.WebclientZsk);const S=1===Number(null===(t=Er(n))||void 0===t?void 0:t.role);return S||(f=y,y=""),{apiKey:o,signature:n,signatureType:r,meetingNumber:i,userName:s,lang:a,passWord:u?encodeURIComponent(u):"",userEmail:d,sdkUrl:l,sdkOrigin:c,proxy:p,cv:h,ztk:f,zsk:y,tk:g||sessionStorage.getItem(Vi.WebclientTk),ulsm:S&&y?1:0}}(t);n=je(Vr(e)).pipe(bt(1e3))}return tt(Ue(o),n)}))),meetingMainEpics5:e=>En(e,7940).pipe(Ot((e=>{Rc("MEETING_HOST_CHANGE_INDICATION",e.payload.body.bHost)})),ze((e=>ti(e.payload.body)))),meetingMainEpics6:e=>En(e,7941).pipe(Ot((e=>{Rc("MEETING_COHOST_CHANGE_INDICATION",e.payload.body.bCoHost)})),ze((e=>oi(e.payload.body)))),meetingMainEpics7:e=>En(e,7945).pipe(Ot((e=>{const{payload:{body:{opt:t}}}=e;Ni.set(Vi.WebclientOpt,t,Mi.SessionStorage)})),Et(fe)),meetingMainEpics8:(e,t)=>yn(e,7942).pipe(Ot((e=>{const{payload:{body:{bHold:t}}}=e;Ni.set(Vi.WebclientIsOnHold,t?1:0,Mi.SessionStorage),Rc(Xs,t)})),Tt(t),Xe((e=>{let[t,o]=e;const n=[ni(t.payload.body.bHold)];if(t.payload.body.bHold){const e=yp(o);if(e){n.push(ii({audio:e.audio,video:e.bVideoOn,muted:e.muted}));const t=ab(Fs.getInstance());if("computer"===e.audio&&(t.leaveComputerAudio(),AE.joinOrLeaveVoip(!1)),e.bVideoOn&&t.stopCaptureVideo(),e.sharerOn&&(AE.stopSharing(e.userId),t.stopDesktopSharing(),n.push(Dh(Ka.End))),o.video&&o.video.subscribedVideoList.length>0&&o.video.subscribedVideoList.forEach((e=>{AE.unsubscribeVideo(e)})),o.share&&o.share.isReceiveSharing){const e=o.share.activeNodeId;o.share.remoteControlledUserList.length>0&&(o.share.remoteControlledUserList.forEach((e=>{AE.sharingRequestRemoteControl(e,!1)})),my(o)&&t.stopRemoteControl()),AE.unsubscribeSharing(e),t.stopRenderSharing()}}}return Ue(n)}))),meetingMainEpics9:e=>yn(e,7954).pipe(ze((e=>di(e.payload.body)))),meetingMainEpics10:e=>yn(e,4216).pipe(Ot((e=>{Rc("MEETING_CLAIM_HOST_KEY_RESPONSE",e.payload.body.bresult)})),Et(fe)),meetingMainEpics11:(e,t)=>e.pipe($t(`${xr}`,`${Hr}`),Tt(t),Xe((e=>{let[t,o]=e;const n=Tp(o);return t.type===`${xr}`?(AE.leaveMeeting(n),Rc(Ys,{})):t.type===`${Hr}`&&(AE.endMeeting(),Rc(Ys,{})),Ue(Jf(o,!1))}))),meetingMainEpics12:(e,t)=>e.pipe($t(`${Fr}`),Tt(t),Xe((e=>{let[t,o]=e;if(t.type===`${Fr}`&&o.meeting.meetingNumber&&!o.meeting.zlkJwtToken){const e={mn:o.meeting.meetingNumber.toString(),name:o.meeting.userName,customerKey:o.meeting.customerKey?ur(o.meeting.customerKey):""},{jbhLeave:t}={jbhLeave:`https://${_f}/wc/jbhLeave`},n=`${t}/?${new URLSearchParams(e).toString()}`;fetch(n,{method:"POST",headers:{"Content-type":"application/json; charset=UTF-8"}})}return fe}))),meetingMainEpics13:e=>yn(e,2).pipe(Ot((()=>{console.warn("Upgrade to latest version to optimize meeting experience")})),Et(fe)),meetingMainEpics14:e=>yn(e,1).pipe(Ot((e=>{const{payload:{body:{upgradeVersion:t}}}=e,o=Mr(1e4);if(o&&o.reason){const e=o.reason.replace(/{(\d+)}/g,(()=>t));o.reason=e}Rc(Qs,o)})),Et(fe)),meetingMainEpics15:e=>yn(e,4265).pipe(ze((e=>{const{payload:{body:t}}=e,{nShareType:o}=t;return Rc(ta,{userSharePronounType:o}),fi(o)}))),meetingMainEpics16:e=>yn(e,4128).pipe(Ot((e=>{const{payload:{body:{meetingtoken:t}}}=e,{WebclientMeetingToken:o}=Vi;t&&Ni.set(o,t,Mi.SessionStorage)})),Et(fe)),meetingMainEpics17:(e,t)=>e.pipe($t(`${Yr}`),mt((()=>!!t.value.meeting.quicklyLeave)),_t((()=>st(window,"beforeunload").pipe(Ot((()=>{AE.leaveMeeting()})),Et(fe))))),meetingMainEpics18:(e,t)=>yn(e,8025).pipe(mt((e=>!!e.payload.body.Zmk&&!!t.value.meeting.isEnableZmkFromRWG)),ze((e=>{const{payload:{body:{Zmk:t}}}=e;return Xr({zmk:t})})))},oI=fn(tI,{wakeLockEpic0:(e,t)=>e.pipe($t(`${Yr}`),Tt(t),mt((e=>{let[,t]=e;return!!t.meeting.stayAwake})),Ot((async()=>{try{const{isSafari:e,isIOSMobile:t}=Gi;DE&&DE.release().then((()=>{DE=null})),"wakeLock"in navigator&&((e||t)&&await Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))),DE=await navigator.wakeLock.request("screen"),DE.addEventListener("release",(()=>{})))}catch(e){}})),_t((()=>st(document,"visibilitychange").pipe(Xe((async()=>{if("visible"===document.visibilityState){const{isSafari:e,isIOSMobile:t}=Gi;DE&&DE.release().then((()=>{DE=null})),"wakeLock"in navigator&&((e||t)&&await Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))),DE=await navigator.wakeLock.request("screen"))}else DE&&DE.release().then((()=>{DE=null}))})),Et(fe))))),wakeLockEpic1:e=>e.pipe($t(`${No}`)).pipe(Ot((()=>{DE&&DE.release().then((()=>{DE=null}))})),Et(fe))},XE,eI,{meetingInfoEpic:(e,t)=>e.pipe($t(`${Ur}`),_t((e=>{const o=Object.assign({},e.payload,{password:ur(e.payload.password),topic:ur(e.payload.topic)}),{videoSDKUrl:n}={meetingSDKUrl:`https://${_f}/api/v1/wc/info`,videoSDKUrl:`https://${_f}/wc/lsdk`};return function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"zoomsdkjsonpcallback";return new $((n=>{JE++;const r=`${o}${JE}`,i=document.createElement("script");Object.keys(t).forEach((e=>(void 0===t[e]||null===t[e])&&delete t[e])),i.src=`${e}?${new URLSearchParams(Object.assign(t,{callback:r})).toString()}`,i.async=!0,i.onerror=e=>n.error(e),document.getElementsByTagName("head")[0].appendChild(i),window[r]=e=>{i.parentNode&&i.parentNode.removeChild(i),delete window[r],n.next(e),n.complete()}}))}(n,o).pipe(gt((e=>je({status:!1,result:e.toString(),errorCode:-3e3}))),Xe((o=>{const[n,r]=(i=je(o),[mt(s=e=>!0===e.status&&void 0!==e.result,a)(Pe(i)),mt(ht(s,a))(Pe(i))]);var i,s,a;return r.subscribe((e=>{QE.report(`get meeting info error, ${JSON.stringify(e)}`,["Join Meeting Flow","Get Meeting Info Error"],"error"),e.state||(3e3===e.errorCode&&"Meeting password is incorrect"===e.errorMessage?Rc(Qs,{errorCode:Dr.WrongPasscode,reason:"Incorrect passcode."}):3e3===e.errorCode&&"The role type error"===e.errorMessage?Rc(Qs,{errorCode:Dr.RoleTypeMissing,reason:"Role type error"}):-3e3===e.errorCode?Rc(Qs,{errorCode:Dr.CommonError,reason:"connection error"}):3e3===e.errorCode?Rc(Qs,{reason:e.errorMessage,errorCode:Dr.CommonError}):300===e.errorCode?Rc(Qs,{reason:"This account does not exist or does not belong to you",errorCode:Dr.CommonError}):124===e.errorCode&&"Parse lite sdk topic and pwd fail"===e.errorMessage?Rc(Qs,{reason:"Topic is invalid",errorCode:Dr.CommonError}):124===e.errorCode&&"The java web token is expired or more than 2 days or ineffective."===e.errorMessage?Rc(Qs,{reason:"The token has expired, is over 2 days old, or is ineffective.",errorCode:Dr.CommonError}):124===e.errorCode&&Rc(Qs,{reason:"Verify JWT failed",errorCode:Dr.CommonError}))})),n.pipe(ey((o=>{if(!0===o.status){const{result:{mid:r,websdkClientFeatureOptions:i,showRecommendVersion:s}}=o;Ni.init(r);const a=((e,t)=>{if(e.result){const{result:{mn:o,ts:n,auth:r,track_auth:i,mid:s,tid:a,encryptedRWC:u,encryptedGEORWC:d,user_identity:l,meetingOptions:c,can_recording:p,wcXMPPConfig:h,call_out_country_json:m,isOriginalHost:v,support_call_out:g,liveTranscription:f,logConfig:y,logEncryptionPubKey:S,toll_numbers_json:b,h323Password:E,liveStreamInfo:I,rc_auto_delete:A,jwt_rc:C,op_rc:_,mediaSDKVersion:w,mediaSDKPathPrefix:R,zmk:O,fileTransfer:T,fileServerDomain:D,accountId:P}}=e,{lang:k,password:M,topic:L,zlk:N,cv:V,userName:U}=t;return{meetingNumber:o,meetingId:s,tid:a,ts:n,auth:r,passWord:M,trackAuth:i,customerKey:l,encryptedRWC:JSON.parse(u||"{}"),encryptedGEORWC:JSON.parse(d||"{}"),meetingOptions:JSON.parse(c||"{}"),recordingEnable:"1"===p,topic:L,userName:Ni.get(Vi.WebclientUserName)||U,cv:V,zlkJwtToken:N,xmppConfig:JSON.parse(h||"{}"),callOutCountry:JSON.parse(m||"{}"),lang:k,isOriginHost:v,isSupportCallOut:"1"===g,liveTranscription:JSON.parse(f||"{}"),logConfig:y,logEncryptionPubKey:S,tollNumbers:void 0===b?void 0:JSON.parse(b),h323Password:E,liveStreamInfo:JSON.parse(I||"{}"),rcAutoDelete:A,jwtRc:C,opRc:_,mediaSDKPath:w&&R?`${Ir(R)}/${w}`:void 0,zmk:O,fileTransfer:JSON.parse(T||"{}"),fileServerDomain:D,accountId:P}}return e})(o,e.payload);var n;s&&(null==e||null===(n=e.payload)||void 0===n||n.lang,console.log("Update VideoSDK-Web to the latest version to optimize meeting experience","https://developers.zoom.us/docs/video-sdk/web/"));const u=[je(Wr(a)),vn(qE,t,jr())],d=((e,t)=>{const o=[];if(e){const t=e.split("").reverse();Object.keys(Di).filter((e=>/M:\d+(,\d+)*;V:\d+(,\d+)*/.test(Di[e]))).forEach((e=>{const n=Di[e];let[r,i]=n.split(";");r.startsWith("V:")&&([r,i]=[i,r]);const s=i.slice(2).split(",").map((e=>t[Number(e)-1])).reverse().join(""),a=parseInt(s,16),u=Zf[n];u&&(Array.isArray(u)?u:[u]).forEach((e=>{const t=e.mask?(a&e.mask)>0:a;o.push(je(e.action(t)))}))}))}return o})(i);d.length>0&&u.unshift(...d);const l=((e,t)=>{const o=[];if(e){const t=e.split("").reverse(),r=[];ki.forEach((e=>{var o;const[n,i]=e.split("-"),s=Number(i)-1;r.length0&&u.unshift(...l),tt(...u)}})))})),Ct(Ai(performance.now())))}))),pingRWCEpic:qE});var nI={exports:{}};nI.exports=function(){function e(e){for(var t=1;tt){var I;const A=o[t],C={dn2:ur(n),auth:r,browser:`${Gi.browser}${Gi.browserVersion} ${null!==(I=window)&&void 0!==I&&I.crossOriginIsolated?"SAB":""}`,trackAuth:i,mid:s,tid:u,lang:d,ts:l,"ZM-CID":E,_ZM_MTG_TRACK_ID:b||"",customer_key:ur(a),cfs:0,islch:1};if(m)try{const{vendor:e}=Er(m);e&&Object.assign(C,{vendor:e})}catch(e){console.log(e)}A.rwcAuth?Object.assign(C,{rwcAuth:A.rwcAuth}):A.rwcToken&&Object.assign(C,{rwcToken:A.rwcToken});const _=Ki()?1:Gi.isIE||Gi.isSupportEssentialAudioAndVideoAbility?2:0;Object.assign(C,{as_type:_}),[{key:sI,queryKey:"opt"},{key:aI,queryKey:"participantID"},{key:uI,queryKey:"zoomid"}].forEach((e=>{const t=Ni.get(e.key);void 0!==t&&(C[e.queryKey]=t)}));const w=c&&p&&h;w&&Object.assign(C,{bid:ur(c),confID:h}),Ni.get(dI)&&Object.assign(C,{isdj:1}),zi()&&(Object.assign(C,{from:Gi.isAndroidBrowser?"android":"ios"}),v&&Object.assign(C,{useABAudio:1})),Object.assign(C,{clientCaps:pI({isAudioBridgeEnabled:v&&zi(),isBO:w,isFullHDVideoEnabled:y,isFullHDVideoShareEnabled:S})});const R=g?f.length>0?1:0:1;return Object.assign(C,{isCamera:R}),Object.assign(C,{clientOS:Gi.isAndroidOrIOSBrowser?Gi.isIOSMobile?"ios":"android":Gi.isMacOS?"mac":"win"}),Object.assign(C,{audioFeature:Fs.getAudioFeatureFlag()}),{queryObject:{...C},rwgServer:A}}return null}function pI(e){const{isAudioBridgeEnabled:t,isBO:o,isFullHDVideoEnabled:n,isFullHDVideoShareEnabled:r}=e;let i=kp.WebCameraIndication|kp.SendMeetingTokenSeparately|kp.SmartSummary|kp.LocalRecording|kp.LocalRecordingGrantPermission|kp.UnifyErrorType;const s=Fs.getPTZCapability();return(s.pan||s.tilt||s.zoom)&&(i|=kp.SupportFarEndCameraControl),Fs.isSupportVideoShare()&&(i|=kp.SupportVideoShare),t&&Fs.isSupportAudioBridgeAVSync()&&(i|=kp.WebrtcAudioRtcpTime),Fs.isSupportShareMultiStream()&&(i|=kp.ShareMultiStream),Fs.isSupportVideoLTR()&&(i|=kp.VideoLTR),o||(i|=kp.RequestRemoteControl),n&&Fs.isSupportFullHDVideo()&&(i|=kp.SupportSend1080PVideo),r&&Fs.isSupportFullHDVideoShare()&&(i|=kp.SupportSend1080PVideoShare),i}function hI(e,t){return t?F(bt(t),mt((()=>{const{socket:{zoomSocketStatus:t},meeting:{meetingStatus:o,isMeetingReset:n}}=e.value;return t!==Dp.Closed&&o===Ti.Joined&&!n}))):F(mt((()=>{const{socket:{zoomSocketStatus:t},meeting:{meetingStatus:o,isMeetingReset:n}}=e.value;return t!==Dp.Closed&&o===Ti.Joined&&!n})))}const mI=Ls.createAgent();let vI;const gI=OE.getInstance();let fI;const yI=Ns.getInstance();let SI;const bI={zoomSocketStatus:Dp.Closed,xmppSocketStatus:Dp.Closed,mainSessionSocketStatus:Dp.Closed,retryCount:0,rwgServerList:[]},EI=ko({[`${$o}`]:fE(((e,t)=>{let{payload:o}=t;e.zoomSocketStatus=o.status})),[`${Wo}`]:fE(((e,t)=>{let{payload:o}=t;const{rwgServerList:n}=e;n.find((e=>e.rwg===o.rwg))||n.push(o)})),[`${Go}`]:fE(((e,t)=>{let{payload:o}=t;e.retryCount=o})),[`${zo}`]:fE(((e,t)=>{let{payload:o}=t;e.xmppSocketStatus=o})),[`${Ko}`]:fE(((e,t)=>{let{payload:o}=t;e.mainSessionSocketStatus=o})),[`${qo}`]:()=>bI},bI),II={epics0:(e,t)=>e.pipe($t(`${Mo}`),Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===Dp.Closed&&!!t.meeting.meetingId})),_t((e=>{let[,o]=e;const{media:{patchedMediaSDKStatus:n}}=o;return(n===Ou.Loading?Dc(Fl,1):Ue([0])).pipe(_t((()=>{const{socket:{retryCount:e,rwgServerList:o},meeting:n,breakoutRoom:r,video:i,share:s}=t.value;let a;const u={...n,retryCount:e,rwgServerList:o};if(i){const{cameraDevicesList:e,isFullHDVideoEnabled:t}=i;Object.assign(u,{cameraDevicesList:e,isFullHDVideoEnabled:t})}if(s){const{isFullHDVideoShareEnabled:e}=s;Object.assign(u,{isFullHDVideoShareEnabled:e})}if(r&&r.currentRoom.status===up.Joining){const{currentRoom:{boId:e,boConfId:t,boToken:o}}=r;Object.assign(u,{bid:e,botk:o,confID:t})}if(a=n.zlkJwtToken?function(e){const t=cI(e);if(t){const{queryObject:o,rwgServer:n}=t,{topic:r,cv:i,meetingNumber:s}=e;return Object.assign(o,{topic:ur(r),iccv:i}),`wss://${n.rwg}/instantsdk/${s}?${new URLSearchParams(o).toString()}`}return null}(u):function(e){const t=cI(e);if(t){const{queryObject:o,rwgServer:n}=t,{cv:r,meetingNumber:i}=e;return Object.assign(o,{jscv:r,browser:o.browser+" ComponentView"}),[{key:iI,queryKey:"cfs"}].forEach((e=>{const t=Ni.get(e.key);void 0!==t&&(o[e.queryKey]=t)})),`wss://${n.rwg}/wc/api/${i}?${new URLSearchParams(o).toString()}`}return null}(u),a){const e=(d=a,mI.connect(d),vI=new Q,ut((e=>mI.on(ks.Message,e)),(e=>mI.off(ks.Message,e)),(e=>e.data)).subscribe(vI),vI);return ct(e.pipe(mt((e=>"string"==typeof e)),ze((e=>{try{return JSON.parse(e)}catch(e){return console.error(e),{evt:0}}})),ry(),Xf((e=>{if(0!==e.evt||!e.body||"invalid parameters!"!==e.body.test)return Uo(e);Rc(Qs,{errorCode:Dr.InvalidParameter,reason:"Invalid parameter"})})),Ct($o({status:Dp.Connecting,rwgUrl:a}))),e.pipe(mt((e=>e instanceof ArrayBuffer)),ze((e=>jo(e)))))}var d;return fe})))}))),epics1:(e,t)=>e.pipe($t(`${Mo}`),Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===Dp.Closed&&!!t.meeting.meetingId})),_t((()=>{const[e,o,n,r]=[ks.Open,ks.Close,ks.Error,ks.Inactive].map((e=>ut((t=>mI.on(e,t)),(t=>mI.on(e,t)))));return ct(e.pipe(Xe((()=>ct(je($o({status:Dp.Connected})),dt(6e4).pipe(Tt(t),mt((e=>{let[,t]=e;return t.meeting.meetingStatus===Ti.Initial&&!t.meeting.isMeetingReset})),ze((()=>(Rc(Zs,{reason:_i.Failover}),Br(Pi.NoHeartbeat))))))))),o.pipe(hI(t),ze((()=>(Rc(Zs,{reason:_i.Failover}),Br(Pi.Disconnect))))),r.pipe(hI(t),ze((()=>(Rc(Zs,{reason:_i.Failover}),Br(Pi.NoHeartbeat))))),n.pipe(Tt(t),Xe((e=>{let[,o]=e;const{meeting:{meetingStatus:n,isMeetingReset:r},socket:{rwgServerList:i,retryCount:s}}=o,a=[];if(n===Ti.Initial&&null!=i&&i.length){const e=i[s];return dt(5e3).pipe(mt((()=>t.value.meeting.meetingStatus===Ti.Initial)),Xe((()=>{const{socket:{rwgServerList:e,retryCount:o}}=t.value,n=[];return e.length>o+1?n.push(Go(o+1),No({retry:!0})):(Rc(Qs,{reason:"connection error",errorCode:Dr.CommonError}),n.push(...Jf(t.value))),Ue(n)})),Ct(gi(null==e?void 0:e.rwc)))}return r||n!==Ti.Joined||(Rc(Zs,{reason:_i.Failover}),a.push(Br(Pi.OnError))),Ue(a)}))))}))),epics2:(e,t)=>e.pipe($t(`${No}`),_t((e=>e.payload&&e.payload.retry?je(Mo()).pipe(bt(1e3),Ct($o({status:Dp.Closed}))):je($o({status:Dp.Closed})))),bt(100),Ot((()=>{var e;t.value.socket.zoomSocketStatus===Dp.Closed&&(mI.close(),null===(e=vI)||void 0===e||e.complete())})))},AI=fn(II,{xmppEpics0:(e,t)=>e.pipe($t(`${Yr}`),Xe((()=>{const{meeting:{meetingOptions:e,zlkJwtToken:o,isWebinar:n}}=t.value,r=[];return(e.isPollingEnabled||o||n)&&r.push(Lo()),Ue(r)}))),xmppEpics1:(e,t)=>e.pipe($t(`${Lo}`),Tt(t),mt((e=>{let[,t]=e;return"closed"===t.socket.xmppSocketStatus})),_t((e=>{let[,t]=e;const{meeting:{svcUrl:o,meetingNumber:n,conId:r}}=t,i=function(e,t,o){return`wss://${e}/wc/media/${t}?type=x&cid=${o}`}(o,n,r);return(e=>(gI.connect(e),fI=new Q,ut((e=>gI.on(RE.Message,e)),(e=>gI.off(RE.Message,e))).subscribe(fI),fI))(i).pipe(mt((e=>void 0!==(null==e?void 0:e.evt))),ze((e=>Bo(e))),Ct(zo(Dp.Connecting)))}))),xmppEpics2:(e,t)=>e.pipe($t(`${Lo}`),_t((()=>{const[e,o,n]=[RE.Open,RE.Close,RE.Error].map((e=>ut((t=>gI.on(e,t)),(t=>gI.on(e,t)))));return ct(e.pipe(Ot((()=>{const e=function(){const{isSupportEssentialAudioAndVideoAbility:e,isSupportAudioWorklet:t}=Gi;return e&&t?11:10}();gI.join(e)})),yt(zo(Dp.Connected))),o.pipe(hI(t,500),ze((()=>(Rc(Zs,{reason:_i.Failover}),Br(Pi.DisconnectXmpp))))),n.pipe(hI(t,500),ze((()=>(Rc(Zs,{reason:_i.Failover}),Br(Pi.OnError))))))}))),xmppEpics3:e=>e.pipe($t(`${Vo}`),yt(zo(Dp.Closed)),bt(100),Ot((()=>{var e;gI.close(),null===(e=fI)||void 0===e||e.complete()})))},{mainSessionEpics0:(e,t)=>e.pipe($t(`${xo}`),Tt(t),mt((e=>{let[,t]=e;return"closed"===t.socket.mainSessionSocketStatus})),_t((e=>{let[,t]=e;const{meeting:{svcUrl:o,meetingNumber:n,conId:r}}=t,i=function(e,t,o){return`wss://${e}/wc/media/${t}?type=m&cid=${o}&mode=2`}(o,n,r);return(e=>(yI.connect(e),SI=new Q,ut((e=>yI.on(ks.Message,e)),(e=>yI.off(ks.Message,e))).pipe(ze((e=>e.data))).subscribe(SI),SI))(i).pipe(ze((e=>{try{return JSON.parse(e)}catch(e){return console.error(e),{evt:0}}})),mt((e=>0!==e.evt)),ry(),ze((e=>Ho(e))),Ct(Ko(Dp.Connecting)))}))),mainSessionEpics1:(e,t)=>e.pipe($t(`${xo}`),_t((()=>{const[e,o,n]=[ks.Open,ks.Close,ks.Error].map((e=>ut((t=>yI.on(e,t)),(t=>yI.on(e,t)))));return ct(e.pipe(yt(Ko(Dp.Connected))),o.pipe(hI(t,500),ze((()=>(Rc(Zs,{reason:_i.Failover}),Br(Pi.DisconnectMChannel))))),n.pipe(hI(t,500),ze((()=>(Rc(Zs,{reason:_i.Failover}),Br(Pi.OnErrorMChannel))))))}))),mainSessionEpics2:e=>e.pipe($t(`${Fo}`),yt(Ko(Dp.Closed)),Ot((()=>{var e;yI.close(),null===(e=SI)||void 0===e||e.complete()})))}),CI={id:"userId",type:e=>op(e)?{userType:e,avatarBackgroundType:Math.floor(8*Math.random())+1}:{userType:e},role:e=>({userRole:e,isHost:tp(e)}),dn2:e=>({displayName:dr(e)}),bShareOn:"sharerOn",bSharePause:"sharerPause",bLocalRecordStatus:e=>({bLocalRecord:e}),bGuest:"isGuest",bCapsRequestLT:"isRequestLT",customerKey:"userIdentity"},_I=e=>{const t={};return["add","remove","update"].forEach((o=>{const n=o,r=e[n];null!=r&&(t[n]=r.reduce(((e,t)=>{const o=Object.keys(t).reduce(((e,o)=>{const n=CI[o];return"function"==typeof n?Object.assign(e,n(t[o])):"string"==typeof n?Object.assign(e,{[`${n}`]:t[o]}):Object.assign(e,{[`${o}`]:t[o]}),e}),{}),n=e.find((e=>e.userId===o.userId));return void 0!==n?Object.assign(n,o):e.push(o),e}),[]))})),t},wI={name:"displayName",node:e=>({userId:Number(e)}),role:e=>({userRole:Number(e)})},RI=e=>Object.keys(e).reduce(((t,o)=>{const n=wI[o];return"function"==typeof n?Object.assign(t,n(e[o])):"string"==typeof n?Object.assign(t,{[`${n}`]:e[o]}):Object.assign(t,{[`${o}`]:e[o]}),t}),{}),OI={attendeesList:[],assistantList:[],xmppAttendeeList:[],allowTalkAttendeesList:[],failoverAttendeesList:[],isAdmitAllSilentUsers:!1},TI=ko({[`${kc}`]:fE(((e,t)=>{let{payload:o}=t;void 0!==o.add&&o.add.length>0&&o.add.forEach((t=>{if(t.userType===ep.Assitant){const o=e.assistantList.find((e=>e.userId===t.userId));void 0!==o?Object.assign(o,t):e.assistantList.push(t)}else if(np(t.userRole)){const o=e.allowTalkAttendeesList.find((e=>e.userId===t.userId));void 0!==o?Object.assign(o,t):e.allowTalkAttendeesList.push(t)}else{const o=e.attendeesList.find((e=>e.userId===t.userId));void 0!==o?Object.assign(o,t):e.attendeesList.push(t)}})),void 0!==o.update&&o.update.length>0&&o.update.forEach((t=>{const o=e.attendeesList.find((e=>e.userId===t.userId));if(void 0!==o)Object.assign(o,t);else{const o=e.allowTalkAttendeesList.find((e=>e.userId===t.userId));if(void 0!==o)Object.assign(o,t);else{const o=e.assistantList.find((e=>e.userId===t.userId));void 0!==o&&Object.assign(o,t)}}})),void 0!==o.remove&&o.remove.length>0&&o.remove.forEach((t=>{const o=e.attendeesList.findIndex((e=>e.userId===t.userId));if(-1!==o)e.attendeesList.splice(o,1);else{const o=e.allowTalkAttendeesList.findIndex((e=>e.userId===t.userId));if(-1!==o)e.allowTalkAttendeesList.splice(o,1);else{const o=e.assistantList.findIndex((e=>e.userId===t.userId));-1!==o&&e.assistantList.splice(o,1)}}}))})),[`${Hc}`]:fE(((e,t)=>{let{payload:o}=t;const{xmppAttendeeList:n}=e,r=n.map((e=>e.jid));o.forEach((e=>{const{jid:t}=e,o=r.indexOf(t);-1!==o?Object.assign(n[o],e):n.push(e)}))})),[`${Lc}`]:fE(((e,t)=>{let{payload:o}=t;e.isAdmitAllSilentUsers=o})),[`${jc}`]:fE((e=>{e.attendeesList.forEach((e=>{e.bRaiseHand&&(e.bRaiseHand=!1)}))})),[`${Bc}`]:fE((e=>{e.attendeesList.forEach((e=>{e.feedback>0&&(e.feedback=0)}))})),[`${Vc}`]:fE(((e,t)=>{let{payload:o}=t;e.failoverAttendeesList.push(o)})),[`${Uc}`]:fE(((e,t)=>{let{payload:o}=t;o.forEach((t=>{const o=e.failoverAttendeesList.findIndex((e=>e.zoomID===t.zoomID));-1!==o&&e.failoverAttendeesList.splice(o,1)}))})),[`${xc}`]:fE(((e,t)=>{let{payload:o}=t;const{jid:n,name:r}=o,i=e.xmppAttendeeList.find((e=>e.jid===n));i&&(i.displayName=r)})),[`${Fc}`]:fE(((e,t)=>{let{payload:o}=t;const{jid:n}=o,r=e.xmppAttendeeList.findIndex((e=>e.jid===n));-1!==n&&e.xmppAttendeeList.splice(r,1)})),[`${$c}`]:fE(((e,t)=>{let{payload:o}=t;const{userId:n,key:r,value:i}=o,s=e.attendeesList.find((e=>e.userId===n));s&&(s[`${r}`]=i)})),[`${Nc}`]:()=>OI},OI),DI={epics0:(e,t)=>yn(e,as).pipe(ze((e=>_I(e.payload.body))),Tt(t),Xe((e=>{let[t,o]=e,n=[kc(t)];const{meeting:{userId:r,isWebinar:i,isOnHold:s},participants:{attendeesList:a,failoverAttendeesList:u,allowTalkAttendeesList:d}}=o,l=d.map((e=>e.userId));if(t.add){const e=t.add.filter((e=>e.userId===r));e.length>0&&e.forEach((e=>{void 0!==e.bHold&&n.push(ni(e.bHold)),Rc(Hs,e)}));const s=t.add.filter((e=>e.userId!==r));if(s.length>0){const e=s.filter((e=>!np(e.userRole))).map((e=>{const t={...e};if(op(e.userType)){var n;const r=null===(n=o.audio)||void 0===n?void 0:n.dialout.find((t=>t.phoneNodeId===e.userId));r&&Object.assign(t,{phoneNumber:r.phoneNumber})}const r=u.find((t=>t.zoomID===e.zoomID));return r&&Object.assign(t,{source:r.isOnHold?"on hold":"failover"}),t})),t=e.filter((e=>!!e.source)).map((e=>({zoomID:e.zoomID})));if(n.push(Uc(t)),Rc(Ws,e),i){const e=s.filter((e=>np(e.userRole)));e.length>0&&Rc(Ks,e.map((e=>({userId:e.userId,isAllowToTalk:!0}))))}}}if(t.update){const e=t.update.filter((e=>e.userId===r));e.length>0&&e.forEach((e=>{Rc($s,e),void 0!==e.bHold&&n.push(ni(e.bHold))}));const o=t.update.filter((e=>!(e.userId===r||l.includes(e.userId))));if(o.length>0&&Rc(Gs,o),i){const e=t.update.filter((e=>e.userId!==r&&l.includes(e.userId)));e.length>0&&Rc(Ks,e)}}if(t.remove){const e=t.remove.map((e=>{const t=a.find((t=>t.userId===e.userId));return t?2===e.action&&1===e.nUserStatus?t.bHold?(n.push(Vc({zoomID:t.zoomID,isOnHold:!0})),{...e,...t,reason:"on hold"}):(n.push(Vc({zoomID:t.zoomID,isOnHold:!1})),{...e,...t,reason:"failover"}):{...e,...t}:null})).filter((e=>!!e));if(Rc(zs,e),i){const e=t.remove.filter((e=>l.includes(e.userId)));e.length>0&&Rc(Ks,e.map((e=>({userId:e.userId,isAllowToTalk:!1}))))}}const c=n.filter((e=>e.type===`${ni}`));if(c.length>0){const e=c[c.length-1];n=n.filter((e=>e.type!==`${ni}`)),e.payload!==s&&(n.push(e),Rc(Xs,!s))}return Ue(n)}))),epics1:(e,t)=>bn(e,24595).pipe(Xe((e=>{const{payload:{body:{action:o,data:n}}}=e,{meeting:{jid:r},participants:{xmppAttendeeList:i}}=t.value,s=[];if(o===wE.rename){n.forEach((e=>{s.push(xc(e))}));const e=n.map((e=>RI(e)));Rc(Ks,e)}if(o===wE.Remove){n.forEach((e=>{s.push(Fc(e))}));const e=n.map((e=>({...RI(e),removed:!0})));Rc(qs,e)}if([wE.Add,wE.List,wE.update].includes(o)){const e=n.map((e=>{const t=RI(e);return Object.keys(t).reduce(((e,o)=>(""!==t[o]&&Object.assign(e,{[o]:t[o]}),e)),{})}));if(Rc(Ks,e),s.push(Hc(e)),o===wE.update){const e=n.find((e=>e.jid===r));if(e&&void 0!==e.bRaiseHand){const t=i.find((e=>e.jid===r));(null==t?void 0:t.bRaiseHand)!==e.bRaiseHand&&Rc("MEETING_WEBINAR_ATTENDEE_RAISE_HAND",{bRaiseHand:e.bRaiseHand})}}}return Ue(s)}))),epics2:e=>yn(e,7951).pipe(Ot((e=>{!1===e.payload.body.bStarted&&Rc("ADMIT_ALL_SILENT_USERS_END",e.payload.body.bStarted)})),ze((e=>Lc(e.payload.body.bStarted)))),epics3:e=>yn(e,7946).pipe(mt((e=>{var t;return["bRaiseHand","feedback"].includes(null===(t=e.payload.body)||void 0===t?void 0:t.key)&&0===e.payload.body.value})),ze((e=>(Rc(Gs,{}),"bRaiseHand"===e.payload.body.key?jc():Bc()))))},PI=fn(DI),kI={audioEncodeStatus:"initial",audioDecodeStatus:"initial",videoEncodeStatus:"initial",videoDecodeStatus:"initial",sharingEncodeStatus:"initial",sharingDecodeStatus:"initial",assetsPath:"",mediaConstraints:void 0,fileWithVersion:!1,enforceMultipleVideos:!1,enforceVirtualBackground:!1,enableAudioQos:!0,enableVideoQos:!0,isAudioBridgeReceiveReady:!1,isAudioBridgeSendReady:!1,isMediaAgentInitialized:!1,disableRenderLimits:!1,adaptedABOptionForMediaSDK:""},MI=ko({[`${Yo}`]:fE(((e,t)=>{let{payload:o}=t;e.audioDecodeStatus=o})),[`${Zo}`]:fE(((e,t)=>{let{payload:o}=t;e.audioEncodeStatus=o})),[`${on}`]:fE(((e,t)=>{let{payload:o}=t;e.sharingDecodeStatus=o})),[`${tn}`]:fE(((e,t)=>{let{payload:o}=t;e.sharingEncodeStatus=o})),[`${en}`]:fE(((e,t)=>{let{payload:o}=t;e.videoDecodeStatus=o})),[`${Xo}`]:fE(((e,t)=>{let{payload:o}=t;e.videoEncodeStatus=o})),[`${nn}`]:fE(((e,t)=>{let{payload:o}=t;e.mediaConstraints=o.mediaConstraints,e.assetsPath=o.assetsPath,e.fileWithVersion=o.fileWithVersion,e.enforceMultipleVideos=!!o.enforceMultipleVideos,e.enforceVirtualBackground=o.enforceVirtualBackground,e.skipJsMedia=o.skipJsMedia,e.patchJsMedia=o.patchJsMedia,e.alternativeNameForVideoPlayer=o.alternativeNameForVideoPlayer,o.enforceMultipleVideos&&"object"==typeof o.enforceMultipleVideos&&(e.disableRenderLimits=!!o.enforceMultipleVideos.disableRenderLimits)})),[`${rn}`]:fE(((e,t)=>{let{payload:o}=t;const{type:n,encrypeKey:r,additionalType:i}=o,s={encrypeKey:r,additionalType:i};"audio"===n?e.audioEncrypt=s:"video"===n?e.videoEncrypt=s:"sharing"===n&&(e.sharingEncrypt=s)})),[`${sn}`]:fE(((e,t)=>{let{payload:o}=t;e.isEnableDecoderInWorklet=o})),[`${an}`]:fE(((e,t)=>{let{payload:o}=t;e.patchedMediaSDKStatus=o})),[`${un}`]:fE(((e,t)=>{let{payload:o}=t;e.assetsPath=o})),[`${dn}`]:fE(((e,t)=>{let{payload:o}=t;e.enableAudioQos=o.audioQos,e.enableVideoQos=o.videoQos})),[`${ln}`]:fE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeReceiveReady=o})),[`${cn}`]:fE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeSendReady=o})),[`${pn}`]:fE(((e,t)=>{let{payload:o}=t;e.isMediaAgentInitialized=o})),[`${hn}`]:fE(((e,t)=>{let{payload:o}=t;e.adaptedABOptionForMediaSDK=o})),[`${mn}`]:e=>({...kI,mediaConstraints:e.mediaConstraints,assetsPath:e.assetsPath,fileWithVersion:e.fileWithVersion,enforceMultipleVideos:e.enforceMultipleVideos,disableRenderLimits:e.disableRenderLimits,enforceVirtualBackground:e.enforceVirtualBackground,alternativeNameForVideoPlayer:e.alternativeNameForVideoPlayer})},kI),LI=new class{constructor(){this.state={mediaSDK:void 0,mediaSDKInstanceMap:new Map,tagName:"video-player"},this.onceMap=new WeakMap,this.subscribers=[]}get(e){return this.state[e]}dispatch(e,t,o){t&&Object.assign(this.state,t),e&&this.notifySubscribers(e,o)}subscribe(e){return this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);-1!==t&&this.subscribers.splice(t,1)}}once(e,t){this.onceMap.set(t,{event:e,unSubscribe:this.subscribe(t)})}notifySubscribers(e,t){const o=[];this.subscribers.forEach((n=>{n(e,this.state,t);const r=this.onceMap.get(n);if(r){const{event:t,unSubscribe:i}=r;t===e&&(o.push(i),this.onceMap.delete(n))}})),o.forEach((e=>e()))}};var NI,VI;!function(e){e[e.ADD_RENDER_VIDEO=1]="ADD_RENDER_VIDEO",e[e.STOP_RENDER_VIDEO=2]="STOP_RENDER_VIDEO",e[e.START_SHARING=23]="START_SHARING",e[e.STOP_SHARING=24]="STOP_SHARING",e[e.SWITCH_CANVAS_FOR_VIDEO_CAPTURE=25]="SWITCH_CANVAS_FOR_VIDEO_CAPTURE",e[e.UPDATE_SHARING_DECODE_PARAM=44]="UPDATE_SHARING_DECODE_PARAM",e[e.UPDATE_CANVAS_SIZE=46]="UPDATE_CANVAS_SIZE",e[e.ZOOM_RENDER=48]="ZOOM_RENDER",e[e.REMOVE_EXPIRED_CANVAS=76]="REMOVE_EXPIRED_CANVAS",e[e.WEBGL_LOST_REPLACE_CANVAS=77]="WEBGL_LOST_REPLACE_CANVAS",e[e.UPDATE_VIDEO_QUALITY=78]="UPDATE_VIDEO_QUALITY",e[e.SEND_RENDER_LOG=79]="SEND_RENDER_LOG"}(NI||(NI={})),function(e){e[e.WEBGL_LOST_IN_MULTI_VIEW=-32]="WEBGL_LOST_IN_MULTI_VIEW"}(VI||(VI={}));const UI="default-sesssion-key";var jI,BI,xI;function FI(e,t,o,n,r){const i=document.createElement("canvas");i.id=n;const s=XI(i,e,t);return r(`VPISC:${window.devicePixelRatio},${s}`),i.style.pointerEvents="none",i.style.position="absolute",i.style.left="0px",i.style.top="0px",i.style.width=e+"px",i.width=e*eA(i),i.style.height=t+"px",i.height=t*eA(i),i.ariaHidden="true",i.style.zIndex=o,i}function HI(e,t,o=!1){const n=()=>{if(e){XI(e,t.clientWidth,t.clientHeight),[NI.UPDATE_CANVAS_SIZE,NI.UPDATE_SHARING_DECODE_PARAM].forEach((o=>{var n;null===(n=zI(t.getSessionId()))||void 0===n||n.Notify_MeidaSDK(o,{width:t.clientWidth*eA(e),height:t.clientHeight*eA(e),canvas:e})})),e.style.width=t.clientWidth+"px",e.style.height=t.clientHeight+"px";try{e.width=t.clientWidth*eA(e),e.height=t.clientHeight*eA(e)}catch(e){}LI.dispatch("resize",void 0,e.id)}};o&&setTimeout((()=>{n(),e.style.visibility=""}),300);const r=qI(n,300),i=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),s=new ResizeObserver(r);return i.addEventListener("change",r),s.observe(t),()=>{!function(e){YI.delete(e)}(e),null==s||s.disconnect(),i.removeEventListener("change",r)}}function $I(e,t){Object.defineProperties(e,t.reduce(((t,o)=>(t[o]={get:()=>e.getAttribute(o),set:t=>{t?e.setAttribute(o,t):e.removeAttribute(o)}},t)),{}))}function WI(e,t){Object.entries(t).forEach((([t,o])=>{e.getAttribute(t)||e.setAttribute(t,o)}))}function GI(e,t){const o=e.getAttribute(t);return!(!o||"true"!==o)}function zI(e=UI){var t;return null===(t=LI.get("mediaSDKInstanceMap").get(e))||void 0===t?void 0:t()}function KI(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();let e=(new Date).getTime(),t=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(o=>{let n=16*Math.random();return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),("x"===o?n:3&n|8).toString(16)}))}function qI(e,t){let o;return function(...n){clearTimeout(o),o=setTimeout((()=>{e(...n)}),t)}}function JI(e,t){const o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;for(const n of o){const o=e[n],r=t[n];if("object"==typeof o&&"object"==typeof r){if(!JI(o,r))return!1}else if(o!==r)return!1}return!0}function QI(e){return!e||"0"===e}function ZI(e,t){null==e||e.Notify_MeidaSDK(NI.SEND_RENDER_LOG,{message:t})}!function(e){e.Video="video",e.Share="share"}(jI||(jI={})),function(e){e.DEFAULT="",e.MAIN="main"}(BI||(BI={})),function(e){e.Video_90P="0",e.Video_180P="1",e.Video_360P="2",e.Video_720P="3",e.Video_1080P="4"}(xI||(xI={}));const YI=new Map;function XI(e,t,o){const n=t>=2*window.screen.width||o>=2*window.screen.height?1:window.devicePixelRatio,r=YI.get(e);return YI.set(e,n),r&&r!==n&&LI.dispatch("scale",void 0,e.id),n}function eA(e){return YI.get(e)||window.devicePixelRatio}function tA(e,t){const{left:o,top:n,bottom:r,right:i,width:s,height:a}=e.getBoundingClientRect(),u=t.getBoundingClientRect();return{left:o-u.left,top:n-u.top,bottom:u.bottom-r,right:u.right-i,width:s,height:a}}const oA=[];for(let e=0;e<=1;e+=.01)oA.push(e);class nA{constructor(e,t){if(this.getRenderParams=t,this.el=document.createElement("div"),this.position=null,this.id="",this.removePositionObserve=null,this.viewId=`${LI.get("tagName")}-${KI()}`,this.getSDK=()=>zI(this.container.getSessionId()),!e)throw new Error(`The ${LI.get("tagName")} must have a ${LI.get("tagName")}-container as its ancestor element.`);this.container=e,this.el.style.width="100%",this.el.style.height="100%"}getElement(){return this.el}init(){this.removeSubscribe=LI.subscribe(((e,t,o)=>{o===this.getCanvas().id&&("resize"===e?(this.updateVideoPosition(),setTimeout((()=>{this.updateVideoPosition()}),300)):"scale"===e&&ZI(this.getSDK(),`VPSC:${eA(this.getCanvas())}`))}))}getCanvas(){return this.container.getCanvas()}initObservePosition(){this.stopObservePosition(),this.removePositionObserve=function(e,t,o){const{wrapper:n=document.documentElement}=o,r=qI(t,300);let i,s;const a=(o=1,s=!1)=>{i&&(i.disconnect(),i=null);const{top:u,left:d,width:l,height:c,right:p,bottom:h}=tA(e,n);if(!l||!c)return void t({hide:!0,cross:!1,width:0,height:0,top:0,left:0,bottom:0,right:0});const m=((e,t,o,n)=>e<0||t<0||o<0||n<0)(u,h,d,p),v=((e,t,o,n,r,i)=>e<=0&&e+i<=0||t<=0&&t+i<=0||o<=0&&o+r<=0||n<=0&&n+r<=0)(u,h,d,p,l,c),g={root:n,threshold:m?oA:o};m||(g.rootMargin=`${-u}px ${-p}px ${-h}px ${-d}px`);let f=!0,y=!0;s&&(y=!1),t({hide:v,cross:m,top:u,left:d,width:l,height:c,bottom:h,right:p}),r({hide:v,cross:m,top:u,left:d,width:l,height:c,bottom:h,right:p},!0),i=new IntersectionObserver((([e])=>{if(0===e.intersectionRatio)return y?a(1,!0):void 0;if(o!==e.intersectionRatio){if(!f)return a();a(0===e.intersectionRatio?1e-7:e.intersectionRatio)}1===e.intersectionRatio&&m&&a(),f=!1}),g),i.observe(e)};return a(),s=new ResizeObserver((()=>a())),s.observe(e),()=>{null==i||i.disconnect(),i=null,null==s||s.disconnect(),s=null}}(this.el,((e,t)=>{t?setTimeout((()=>{this.updateVideoPosition()}),300):this.updateVideoPosition(e)}),{wrapper:this.container})}stopObservePosition(){this.removePositionObserve&&(this.removePositionObserve(),this.removePositionObserve=null)}getCurrentPosition(e){return this.transformRectToPosition(tA(e,this.container))}transformRectToPosition(e){const{left:t,width:o,height:n,bottom:r,top:i}=e,s=eA(this.getCanvas());return{x:t*s,y:r*s,width:o*s,height:n*s,left:t*s,bottom:r*s,top:i*s}}playVideo(e){this.initObservePosition(),this.id=e;const t=this.getCurrentPosition(this.el);this.addRender(Object.assign(Object.assign(Object.assign({},t),{canvas:this.getCanvas(),zone:this.viewId,userId:Number(e),ssrc:Number(e)}),this.getRenderParams())),this.position=t}updateVideoPosition(e){if(!this.id)return;const t=this.transformRectToPosition(e||tA(this.el,this.container));this.position&&JI(t,this.position)||(this.zoomRender(Object.assign(Object.assign(Object.assign({},t),{userId:Number(this.id),canvas:this.getCanvas(),RGBA:this.container.getRGBA(),zone:this.viewId}),this.getRenderParams())),this.position=t)}stopVideo(){this.stopObservePosition(),this.id&&this.position&&(this.id&&this.stopRender(Object.assign(Object.assign(Object.assign({},this.position),{userId:Number(this.id),canvas:this.getCanvas(),RGBA:this.container.getRGBA(),zone:this.viewId}),this.getRenderParams())),this.position=null,this.id="")}updateVideoQuality(e){this.getSDK().Notify_MeidaSDK(NI.UPDATE_VIDEO_QUALITY,{userId:this.id,videoQuality:e})}destroy(){var e;this.stopVideo(),null===(e=this.removeSubscribe)||void 0===e||e.call(this)}}class rA{constructor(e){this.container=e,this.id="",this.getSDK=()=>{var e;return zI(null===(e=this.container)||void 0===e?void 0:e.getSessionId())},this.el=document.createElement("video"),this.el.style.width="100%",this.el.style.height="100%",this.el.setAttribute("autoplay","true"),this.el.setAttribute("muted","true"),this.el.setAttribute("playsinline","true")}getElement(){return this.el}init(){}playVideo(e){this.id=e,this.addRender({userId:Number(e),videodom:this.el})}stopVideo(){this.id&&(this.stopRender({userId:Number(this.id),videodom:this.el}),this.id="")}updateVideoQuality(e){}destroy(){this.stopVideo()}}class iA extends nA{addRender({width:e,height:t,x:o,y:n,canvas:r,zone:i,userId:s,left:a,bottom:u,top:d,fillMode:l,videoQuality:c}){var p;null===(p=this.getSDK())||void 0===p||p.Notify_MeidaSDK(NI.ADD_RENDER_VIDEO,{width:e,height:t,x:o,y:n,canvas:r,zone:i,userId:s,left:a,bottom:u,top:d,fillMode:l,videoQuality:c})}zoomRender({width:e,height:t,x:o,y:n,userId:r,canvas:i,RGBA:s,zone:a,left:u,bottom:d,top:l}){var c;null===(c=this.getSDK())||void 0===c||c.Notify_MeidaSDK(NI.ZOOM_RENDER,{width:e,height:t,x:o,y:n,userId:r,canvas:i,RGBA:s,zone:a,left:u,bottom:d,top:l})}stopRender({width:e,height:t,x:o,y:n,userId:r,canvas:i,doNotClean:s,RGBA:a,zone:u,left:d,bottom:l,top:c,videoQuality:p}){var h;null===(h=this.getSDK())||void 0===h||h.Notify_MeidaSDK(NI.STOP_RENDER_VIDEO,{width:e,height:t,x:o,y:n,userId:r,canvas:i,doNotClean:s,RGBA:a,zone:u,left:d,bottom:l,top:c,videoQuality:p})}}class sA extends rA{addRender({userId:e,videodom:t}){var o;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(NI.ADD_RENDER_VIDEO,{userId:e,videodom:t})}stopRender({userId:e,videodom:t}){var o;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(NI.STOP_RENDER_VIDEO,{userId:e,videodom:t})}}class aA extends nA{addRender({width:e,height:t,userId:o,canvas:n,isFromMainSession:r}){var i;null===(i=this.getSDK())||void 0===i||i.Notify_MeidaSDK(NI.START_SHARING,{width:e,height:t,canvas:n,ssrc:o,isFromMainSession:r})}zoomRender(){}stopRender({canvas:e}){var t;null===(t=this.getSDK())||void 0===t||t.Notify_MeidaSDK(NI.STOP_SHARING,{canvas:e})}}class uA extends rA{addRender({userId:e,videodom:t}){var o,n;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(NI.SWITCH_CANVAS_FOR_VIDEO_CAPTURE,[t]),null===(n=this.getSDK())||void 0===n||n.Notify_MeidaSDK(NI.ADD_RENDER_VIDEO,{userId:e,videodom:t})}stopRender({userId:e,videodom:t}){var o;null===(o=this.getSDK())||void 0===o||o.Notify_MeidaSDK(NI.STOP_RENDER_VIDEO,{userId:e,videodom:t})}}const dA="node-id",lA="media-type",cA="video-quality",pA="share-source",hA="fill-mode",mA="stop-no-clean";class vA extends HTMLElement{static get observedAttributes(){return[dA,lA,cA]}constructor(){super(),this.container=null,$I(this,vA.customAttributes),this.getRenderParams=this.getParsedParams.bind(this),this.attachShadow({mode:"open"})}initRender(){var e,t,o;this.render&&this.render.destroy();const n=this.getAttribute(dA),r=n&&(null===(e=this.getCurrentMediaSDK())||void 0===e?void 0:e.isPreviewVideotag(n)),i=this.getAttribute(lA);let s=0;r?(this.render=new uA(this.getContainer()),s=1):i===jI.Share?(this.render=new aA(this.getContainer(),this.getRenderParams),s=2):(null===(t=this.getCurrentMediaSDK())||void 0===t?void 0:t.getWebRTCFlag())?(this.render=new sA(this.getContainer()),s=4):(this.render=new iA(this.getContainer(),this.getRenderParams),s=3),this.getCurrentMediaSDK()&&ZI(this.getCurrentMediaSDK(),`VPREN:${s}`),this.shadowRoot&&(this.shadowRoot.innerHTML="",this.shadowRoot.appendChild(this.render.getElement())),this.render.init();const a=this.getAttribute(dA);QI(a)||null===(o=this.render)||void 0===o||o.playVideo(a)}getContainer(){return this.container||(this.container=this.closest(`${LI.get("tagName")}-container`)),this.container}getCurrentMediaSDK(){var e;return zI(null===(e=this.getContainer())||void 0===e?void 0:e.getSessionId())}getParsedParams(){return{fillMode:GI(this,hA),doNotClean:GI(this,mA),isFromMainSession:"main"===this.getAttribute(pA),videoQuality:this.getAttribute(cA)}}connectedCallback(){this.style.display="block",WI(this,vA.defaultValues),this.initRender(),this.removeSubscribe=LI.subscribe(((e,t,o)=>{var n,r;"failover"===e&&o===((null===(n=this.getContainer())||void 0===n?void 0:n.getSessionId())||UI)&&(this.initRender(),QI(this.getAttribute(dA))||null===(r=this.render)||void 0===r||r.playVideo(this.getAttribute(dA)))}))}disconnectedCallback(){var e,t;null===(e=this.removeSubscribe)||void 0===e||e.call(this),null===(t=this.render)||void 0===t||t.destroy()}attributeChangedCallback(e,t,o){var n,r;if(this.render)switch(e){case dA:Boolean(null===(n=this.getCurrentMediaSDK())||void 0===n?void 0:n.isPreviewVideotag(o))!==this.render instanceof uA&&this.initRender(),QI(t)&&!QI(o)?this.render.playVideo(o):QI(t)||QI(o)?QI(t)||this.render.stopVideo():(this.render.stopVideo(),this.render.playVideo(o));break;case lA:this.initRender();break;case cA:null===(r=this.render)||void 0===r||r.updateVideoQuality(o)}}}vA.customAttributes=[dA,lA,cA,pA,hA,mA],vA.defaultValues={[dA]:"",[lA]:jI.Video};const gA="session-id",fA="z-index";class yA extends HTMLElement{static get observedAttributes(){return[gA,fA]}constructor(){super(),this.canvasId="video-player-canvas-"+KI(),this.needInitCanvas=!1,this.callback=null,$I(this,yA.customAttributes);const e=this.attachShadow({mode:"open"}),t=document.createElement("slot");this.appendCanvas=o=>{e.insertBefore(o,t)},e.appendChild(t)}connectedCallback(){this.style.display="block",this.style.position||(this.style.position="relative"),WI(this,yA.defaultValues),this.needInitCanvas&&this.initCanvasEvents(),this.removeSubscribe=LI.subscribe(((e,t,o)=>{"failover"===e&&o===(this.getSessionId()||UI)&&(this.replaceCanvas(),this.initCanvasEvents())}))}disconnectedCallback(){var e,t,o,n;null===(e=this.removeListener)||void 0===e||e.call(this),null===(t=this.removeSubscribe)||void 0===t||t.call(this),this.canvas&&(null===(o=zI(this.getSessionId()))||void 0===o||o.Notify_MeidaSDK(NI.REMOVE_EXPIRED_CANVAS,{canvasId:this.canvasId})),this.callback&&(null===(n=zI(this.getSessionId()))||void 0===n||n.removeCallback(this.callback))}attributeChangedCallback(e,t,o){e===fA&&this.canvas&&o&&(this.canvas.style.zIndex=o)}adoptedCallback(){var e;this.canvas&&(null===(e=this.removeListener)||void 0===e||e.call(this),this.canvas.style.visibility="hidden",HI(this.canvas,this,!0))}createCanvas(){this.getCurrentMediaSDK()&&ZI(this.getCurrentMediaSDK(),"VPCC"),this.canvas=FI(this.clientWidth,this.clientHeight,this.getAttribute(fA)||"",this.canvasId,(e=>ZI(this.getCurrentMediaSDK(),e))),this.appendCanvas(this.canvas),this.isConnected?this.initCanvasEvents():this.needInitCanvas=!0}initCanvasEvents(){var e;this.removeListener=HI(this.canvas,this),this.callback=(e,t)=>{var o,n;e===VI.WEBGL_LOST_IN_MULTI_VIEW&&t.replaceCanvas&&t.canvasId===(null===(o=this.canvas)||void 0===o?void 0:o.id)&&(this.replaceCanvas(),null===(n=zI(this.getSessionId()))||void 0===n||n.Notify_MeidaSDK(NI.WEBGL_LOST_REPLACE_CANVAS,{canvasId:this.canvasId,canvas:this.canvas}))},null===(e=this.getCurrentMediaSDK())||void 0===e||e.addCallback(this.callback)}replaceCanvas(){var e;if(this.getCurrentMediaSDK()&&ZI(this.getCurrentMediaSDK(),"VPRC"),this.canvas){null===(e=this.removeListener)||void 0===e||e.call(this);const t=FI(this.clientWidth,this.clientHeight,this.getAttribute(fA)||"",this.canvasId,(e=>ZI(this.getCurrentMediaSDK(),e)));this.removeListener=HI(t,this),this.shadowRoot&&this.shadowRoot.replaceChild(t,this.canvas),this.canvas=t}}getCanvas(){return this.canvas||this.createCanvas(),this.canvas}getSessionId(){return this.getAttribute(gA)||void 0}getCurrentMediaSDK(){return zI(this.getSessionId())}getRGBA(){return function(e){let t=0,o=0,n=0,r=0;if("r"===e[0])if("a"===e[3]){const i=e.slice(5,-1).split(",").map((e=>parseInt(e.trim(),10)));t=i[0],o=i[1],n=i[2],r=i[3]}else{const r=e.slice(4,-1).split(",").map((e=>parseInt(e.trim(),10)));t=r[0],o=r[1],n=r[2]}else if("#"===e[0]){let r=e.slice(1);3===r.length&&(r=r.split("").map((e=>e.repeat(2))).join(""));const i=parseInt(r,16);t=i>>16&255,o=i>>8&255,n=255&i}return{R:t/255,G:o/255,B:n/255,A:r}}(getComputedStyle(this).getPropertyValue("background-color"))}}yA.customAttributes=[],yA.defaultValues={};class SA{constructor(){this.audioPlaybackUrl=void 0,this.videoPlaybackUrl=void 0,this._audioElement=void 0,this._videoElement=void 0,this.videoSrc=void 0,this.isUsingSameFile=void 0}static getInstance(){return void 0===this.instance&&(this.instance=new SA),this.instance}setAudioElement(e){return void 0===this._audioElement&&(this._audioElement=new Audio),new Promise(((t,o)=>{if(this.videoSrc===e.url)this._audioElement.pause(),this.isUsingSameFile=!0,this._videoElement.muted=!1,(r=this._videoElement).currentTime>0&&!r.paused&&!r.ended&&r.readyState>2?t(""):this._videoElement.play().then((()=>{t("")})).catch((()=>{o()}));else{var n;this.isUsingSameFile=!1;const r=Gi.isFirefox?"canplay":"canplaythrough",i=()=>{this._audioElement.play().then((()=>{this._audioElement.removeEventListener(r,i),t("")}))},s=()=>{this._audioElement.removeEventListener(r,i),this._audioElement.removeEventListener("error",s),o()};this._audioElement.addEventListener(r,i),this._audioElement.addEventListener("error",s),this._audioElement.src=e.url,this._audioElement.loop=!!e.loop,br(e.url)&&this._audioElement.setAttribute("crossorigin",""),this._audioElement.currentTime=Math.max(null!==(n=e.currentTime)&&void 0!==n?n:0,1e-4)}var r}))}setVideoElement(e){return void 0===this._videoElement&&(this._videoElement=document.createElement("video")),new Promise(((t,o)=>{var n;this.videoSrc=e.url;const r=Gi.isFirefox?"canplay":"canplaythrough",i=()=>{this._videoElement.play().then((()=>{this._videoElement.removeEventListener(r,i),t("")}))},s=()=>{this._videoElement.removeEventListener(r,i),this._videoElement.removeEventListener("error",s),o()};this._videoElement.addEventListener(r,i),this._videoElement.addEventListener("error",s),this._videoElement.src=e.url,this.isUsingSameFile||(this._videoElement.muted=!0),this._videoElement.loop=!!e.loop,this._videoElement.currentTime=null!==(n=e.currentTime)&&void 0!==n?n:0,br(e.url)&&this._videoElement.setAttribute("crossorigin",""),Gi.isSafari&&!document.getElementById(lu)&&(this._videoElement.id=lu,this._videoElement.setAttribute("style","position:fixed;top:-10000px;left:-10000px"),document.body.appendChild(this._videoElement))}))}get audioElement(){return this.isUsingSameFile?this._videoElement:this._audioElement}get videoElement(){return this._videoElement}stopAudioElement(){this.isUsingSameFile||this._audioElement&&(this._audioElement.currentTime=0,this._audioElement.pause())}stopVideoElement(){this._videoElement&&this._videoElement.pause(),this.videoSrc=void 0}}function bA(e){const{audio:{isBackgroundNoiseSuppression:t,originalSound:o,highBitrate:n}}=e,r={currentSelect:Du.Denoise},i={highfidelity:!1,stereo:!1};if(o){Object.assign(r,{currentSelect:Du.OriginalSound});const e={};"boolean"==typeof o?Object.assign(e,i):Object.assign(e,{highfidelity:!!o.hifi,stereo:!!o.stereo}),Object.assign(r,{originalSound:e})}return Object.assign(r,{backgroundNoiseSuppression:t?Tu.Zoom:Tu.Browser,highBitrate:n}),r}function EA(e,t,o,n){const{meeting:{userId:r},audio:{localShareAudioUserMutedList:i},share:{isReceiveSharingFromMainSession:s}}=n;return i.filter((e=>e.userId!==t)).forEach((t=>{e.setSharingAudioVolume(t.userId,!0,t.isFromMainSession)})),e.setSharingAudioVolume(t,o,!!s),t===r?oh(o):Xp({userId:t,muted:o})}async function IA(e,t,o){var n,r;const{audio:{audioSsrc:i,activeMicrophone:s,activeSpeaker:a,isAllowToTalk:u,customizeAudioOption:{speakerOnly:d,mute:l,microphoneId:c,speakerId:p},isUsingMediaPlayback:h,mediaPlaybackFile:m,isHIDEnabled:v,microphoneDevicesList:g,isVerifiedAudioPermissionOnIOSMobile:f,speakerDevicesList:y},meeting:{svcUrl:S,conId:b,reportDomain:E,isAudioBridgeEnabled:I,userId:A,supportLocalAB:C,abToken:_}}=t,w=yp(t),R=!!d||rp(w.userRole)&&!u,O=null!=o?o:!R;zi()&&(I||console.warn("Cannot start audio due to the service is not ready."),await Fe(Gf(t,!O)).then((e=>{let[t,o]=e;return t&&o?Promise.resolve():Promise.reject()})));let T=s,D=a;if(void 0!==c||void 0!==p){let e=g,t=y;if(0===g.length){const{microphones:o,speakers:n}=await Fe(Lf());e=o,t=n}c&&e.findIndex((e=>e.deviceId===c))>-1&&(T=c),p&&t.findIndex((e=>e.deviceId===p))>-1&&(D=p)}if(h&&null!=m&&m.url){const e=SA.getInstance();await e.setAudioElement(m),T=e.audioElement}else SA.getInstance().stopAudioElement();return R&&!f&&Gi.isIOSMobile&&await async function(){await navigator.mediaDevices.getUserMedia({audio:!0})}(),null===(n=e.joinComputerAudio(i,T,D,O,bA(t),zi()?{rwgHost:S,cid:b,nginxHost:E,abToken:_,supportLocalAB:C,useWebRTCOnDesktop:!Gi.isAndroidOrIOSBrowser}:void 0,v?{microphoneLabel:null===(r=g.find((e=>e.deviceId===s)))||void 0===r?void 0:r.label,defaultMuted:!(null==w||!w.muted)}:void 0))||void 0===n?void 0:n.then((()=>{l&&(Ls.createAgent().mute(A,!0),e.muteAudio()),null!=w&&w.muted?e.muteAudio():e.unmuteAudio()}))}async function AA(e,t,o){const n=[],{audio:{isJoinComputerAudioBeforeSharingAudio:r,mutedBeforeSharingAudio:i}}=o,s=yp(o);return!0===r&&(await IA(e,o),n.push(eh(void 0)),!1===i&&(n.push(yh(Ba.SharingAudio)),t.mute(s.userId,!1)),n.push(Zp(void 0))),n}async function CA(e,t,o){const{audio:{isSharingAudio:n},meeting:{userId:r}}=o,i=[];if(i.push(EA(e,r,!0,o)),n){await e.leaveSharingAudio(!1),i.push(nh(!1));const n=await AA(e,t,o);i.push(...n),setTimeout((()=>{Rc(Ld,{state:"off"})}),0)}return i.push(th(!1)),i}async function _A(e,t,o){const{audio:{audioSsrc:n,activeMicrophone:r,activeSpeaker:i},meeting:{svcUrl:s,conId:a,reportDomain:u,supportLocalAB:d,abToken:l}}=o,c=yp(o),p=[];if(!OA()){const t=await async function(e,t){const o=[],n=yp(t),{audio:{isMicrophoneForbidden:r}}=t;return(null==n?void 0:n.audio)===Iu.Computer&&(o.push(eh(!0)),o.push(Zp(n.muted)),n.muted||e.muteAudio(),await e.leaveComputerAudio(),o.push(Hp(0)),r&&o.push(Fp(!1))),o}(e,o);p.push(...t)}return await e.leaveSharingAudio(!0),await e.joinSharingAudio({ssrc:n,microphoneDeviceId:r,speakerDeviceId:i,isCaptureAudio:rp(c.userRole),audioBridge:zi()?{rwgHost:s,cid:a,nginxHost:u,abToken:l,supportLocalAB:d,useWebRTCOnDesktop:!Gi.isAndroidOrIOSBrowser}:void 0}),p.push(th(!0)),p.push(nh(!0)),p.push(EA(e,c.userId,!1,o)),p.findIndex((e=>e.type===`${eh}`&&!0===e.payload))>-1&&(p.push(fh(ja.SharingAudio)),t.mute(o.meeting.userId,!0)),setTimeout((()=>{Rc(Ld,{state:"on"})}),0),p}SA.instance=void 0;const wA=()=>{if(Qi())return!0;{var e;let{browser:o}=Gi;if(o=null===(e=o)||void 0===e?void 0:e.toLocaleLowerCase(),o.indexOf("safari")>-1&&-1===o.indexOf("ios-safari")){var t;const e=null===(t=navigator.userAgent.match(/version\/(\d+\.?\d+)/i))||void 0===t?void 0:t[1];return mr(e||"","15.2")>=0&&mr(e||"","17.1")<0}return!1}};function RA(e,t,o){for(let n=0;ne.userId===r));o&&(o.displayName=i,t.splice(t.indexOf(r),1))}}}function OA(){return Fs.isSupportOpenMicWhenShareAudio()}function TA(e){return Fs.isSupportAudioDenoise(e)}function DA(){return Fs.isSupportStereoAudio()}function PA(){var e;return"function"==typeof(null===(e=window.navigator.hid)||void 0===e?void 0:e.requestDevice)}function kA(e,t,o){const{audio:{isAllowToTalk:n,customizeAudioOption:r},media:{audioDecodeStatus:i,audioEncodeStatus:s}}=e;return{encodeInitStatus:rp(t.userRole)&&!n||o||null!=r&&r.speakerOnly||zi()?"success":s,decodeInitStatus:zi()?"success":i}}function MA(e,t,o){zi()?Gf(t,o).subscribe((t=>{let[o,n]=t;o&&n&&e.joinOrLeaveVoip(!0)})):e.joinOrLeaveVoip(!0)}const LA=Ls.createAgent(),NA=xf(ab(Fs.getInstance())),VA=e=>!e.muted,UA=Ls.createAgent(),jA=xf(ab(Fs.getInstance())),BA=Ls.createAgent(),xA=xf(ab(Fs.getInstance())),FA={asnIds:{asn1:{userId:0,displayName:null},asn2:{userId:0,displayName:null},asn3:{userId:0,displayName:null}},microphoneDevicesList:[],speakerDevicesList:[],activeMicrophone:"default",activeSpeaker:"default",isMicrophoneForbidden:!1,audioSsrc:0,bCanUnmute:!1,bMutedUponEntry:!1,isAllowToTalk:void 0,dialout:[],crcDevice:[],canPlayAudio:!1,mutedSource:void 0,unmutedSource:void 0,isUserGrantCaptureAudio:!1,webrtcRestartCount:0,isComputerAudioLoading:!1,isUsingMediaPlayback:!1,customizeAudioOption:{},localShareAudioUserMutedList:[],locallyMutedAudioList:[],localUserAudioVolumeList:[],isStopAllImcomingAudio:!1,statistic:{encode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,bandwidth:0,bitrate:0},decode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,bandwidth:0,bitrate:0}}},HA=ko({[`${Mp}`]:fE(((e,t)=>{let{payload:o}=t;e.asnIds={...o}})),[`${Lp}`]:fE(((e,t)=>{let{payload:o}=t;e.bCanUnmute=o})),[`${Np}`]:fE(((e,t)=>{let{payload:o}=t;const{sequence:n,phoneNumber:r}=o;-1===e.dialout.findIndex((e=>e.sequence===n))&&e.dialout.push({sequence:n,phoneNumber:r,returnCode:-1,uuid:_y()})})),[`${Vp}`]:fE(((e,t)=>{let{payload:o}=t;const{sequence:n,code:r,nodeId:i}=o,s=e.dialout.find((e=>e.sequence===n));s&&(s.returnCode=r,i&&(s.phoneNodeId=i))})),[`${Up}`]:fE(((e,t)=>{let{payload:o}=t;e.isAllowToTalk=o,e.isAllowToTalkAttendeeConnected=!1})),[`${fh}`]:fE(((e,t)=>{let{payload:o}=t;e.mutedSource=o})),[`${yh}`]:fE(((e,t)=>{let{payload:o}=t;e.unmutedSource=o})),[`${jp}`]:fE(((e,t)=>{let{payload:o}=t;e.audioSsrc=o})),[`${Bp}`]:fE(((e,t)=>{let{payload:o}=t;e.bMutedUponEntry=o})),[`${xp}`]:fE(((e,t)=>{let{payload:o}=t;e.isUserGrantCaptureAudio=o})),[`${Fp}`]:fE(((e,t)=>{let{payload:o}=t;e.isMicrophoneForbidden=o})),[`${Hp}`]:fE(((e,t)=>{let{payload:o}=t;e.webrtcRestartCount=o})),[`${$p}`]:fE(((e,t)=>{let{payload:o}=t;e.microphoneDevicesList=o})),[`${Wp}`]:fE(((e,t)=>{let{payload:o}=t;e.speakerDevicesList=o})),[`${Gp}`]:fE(((e,t)=>{let{payload:o}=t;e.activeMicrophone=o})),[`${zp}`]:fE(((e,t)=>{let{payload:o}=t;e.activeSpeaker=o})),[`${Kp}`]:fE(((e,t)=>{let{payload:o}=t;e.canPlayAudio=o})),[`${Jp}`]:fE(((e,t)=>{let{payload:o}=t;e.isComputerAudioLoading=o})),[`${lh}`]:fE(((e,t)=>{let{payload:o}=t;if(o){const{speakerOnly:t,mute:n,backgroundNoiseSuppression:r,originalSound:i,syncButtonsOnHeadset:s,mediaFile:a,microphoneId:u,speakerId:d,highBitrate:l}=o;e.customizeAudioOption.speakerOnly=t,e.customizeAudioOption.mute=n,e.customizeAudioOption.microphoneId=u,e.customizeAudioOption.speakerId=d,e.isBackgroundNoiseSuppression=!!r,e.isHIDEnabled=!!s,e.originalSound=i,e.highBitrate=!!l,gr(e.mediaPlaybackFile,a)||(e.mediaPlaybackFile=a,e.isUsingMediaPlayback=!(null==a||!a.url)),n&&(e.mutedSource=ja.Inherited)}})),[`${Qp}`]:fE(((e,t)=>{let{payload:o}=t;e.isAllowToTalkAttendeeConnected=o})),[`${Zp}`]:fE(((e,t)=>{let{payload:o}=t;e.mutedBeforeSharingAudio=o})),[`${nh}`]:fE(((e,t)=>{let{payload:o}=t;e.isSharingAudio=o})),[`${oh}`]:fE(((e,t)=>{let{payload:o}=t;e.isShareAudioMuted=o})),[`${Yp}`]:fE(((e,t)=>{let{payload:o}=t;const{userId:n,isFromMainSession:r}=o;-1===e.localShareAudioUserMutedList.findIndex((e=>e.userId===n))&&e.localShareAudioUserMutedList.push({userId:n,isFromMainSession:r,muted:!1})})),[`${Xp}`]:fE(((e,t)=>{let{payload:o}=t;const n=e.localShareAudioUserMutedList.find((e=>e.userId===o.userId));n&&(n.muted=o.muted)})),[`${eh}`]:fE(((e,t)=>{let{payload:o}=t;e.isJoinComputerAudioBeforeSharingAudio=o})),[`${th}`]:fE(((e,t)=>{let{payload:o}=t;e.isShareAudioEnabled=o})),[`${rh}`]:fE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${ih}`]:fE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${sh}`]:fE(((e,t)=>{let{payload:o}=t;-1===e.locallyMutedAudioList.findIndex((e=>e===o))&&e.locallyMutedAudioList.push(o)})),[`${ah}`]:fE(((e,t)=>{let{payload:o}=t;const n=e.locallyMutedAudioList.findIndex((e=>e===o));-1!==n&&e.locallyMutedAudioList.splice(n,1)})),[`${uh}`]:fE(((e,t)=>{let{payload:o}=t;const n=e.localUserAudioVolumeList.find((e=>e.userId===o.userId));n?n.volume=o.volume:e.localUserAudioVolumeList.push(o)})),[`${dh}`]:fE(((e,t)=>{let{payload:o}=t;const n=e.localUserAudioVolumeList.findIndex((e=>e.userId===o.userId));-1!==n&&e.localUserAudioVolumeList.splice(n,1)})),[`${ch}`]:fE(((e,t)=>{let{payload:o}=t;e.isBackgroundNoiseSuppression=o})),[`${ph}`]:fE(((e,t)=>{let{payload:o}=t;e.isHIDEnabled=o})),[`${hh}`]:fE(((e,t)=>{let{payload:o}=t;e.mediaPlaybackFile=o,e.isUsingMediaPlayback=!(null==o||!o.url)})),[`${mh}`]:fE(((e,t)=>{let{payload:o}=t;e.isStopAllImcomingAudio=o})),[`${vh}`]:fE(((e,t)=>{let{payload:o}=t;e.isVerifiedAudioPermissionOnIOSMobile=o})),[`${gh}`]:fE(((e,t)=>{let{payload:o}=t;e.isAudioBridgeSignalReconnecting=o})),[`${Sh}`]:fE(((e,t)=>{let{payload:o}=t;e.originalSound=o})),[`${bh}`]:fE(((e,t)=>{let{payload:o}=t;e.leaveAudioSource=o})),[`${Eh}`]:fE(((e,t)=>{let{payload:o}=t;e.secondaryAudioMicrophoneId=o})),[`${Ih}`]:fE(((e,t)=>{let{payload:o}=t;const{sequence:n,ip:r,protocol:i}=o;-1===e.crcDevice.findIndex((e=>e.sequence===n))&&e.crcDevice.push({sequence:n,ip:r,protocol:i,transId:0,uuid:_y()})})),[`${Ah}`]:fE(((e,t)=>{let{payload:o}=t;const{sequence:n,transID:r,result:i}=o,s=e.crcDevice.find((e=>e.sequence===n));s&&Object.assign(s,{transId:r,returnCode:i})})),[`${qp}`]:(e,t)=>{let{dialout:o,crcDevice:n,locallyMutedAudioList:r,localUserAudioVolumeList:i,customizeAudioOption:s,originalSound:a,highBitrate:u,isHIDEnabled:d,isBackgroundNoiseSuppression:l,isStopAllImcomingAudio:c,mediaPlaybackFile:p,isUsingMediaPlayback:h,isVerifiedAudioPermissionOnIOSMobile:m,activeSpeaker:v,activeMicrophone:g}=e,{payload:f}=t;return f?{...FA,dialout:o,crcDevice:n,locallyMutedAudioList:r,localUserAudioVolumeList:i,customizeAudioOption:{...FA.customizeAudioOption,speakerOnly:s.speakerOnly},originalSound:a,highBitrate:u,isHIDEnabled:d,isBackgroundNoiseSuppression:l,isStopAllImcomingAudio:c,mediaPlaybackFile:p,isUsingMediaPlayback:h,isVerifiedAudioPermissionOnIOSMobile:m,activeSpeaker:v,activeMicrophone:g}:{...FA}}},FA),$A={dialEpics0:(e,t)=>yn(e,8198).pipe(Tt(t),mt((e=>{let[t,o]=e;return o.audio.dialout.map((e=>e.sequence)).includes(t.payload.seq)})),Xe((e=>{let[t,o]=e;const{payload:{seq:n,body:{phoneNodeID:r,result:i}}}=t,s=[Vp({code:i,sequence:n,nodeId:r})],{audio:{dialout:a}}=o,u=a.find((e=>e.sequence===n)),d={code:i};if(u&&(Object.assign(d,{phoneNumber:u.phoneNumber,uuid:u.uuid}),r&&Object.assign(d,{userId:r})),Rc(Ad,d),i===Ha.Success){if(Rc(Cd),r&&Ap(o).findIndex((e=>e.userId===r))>-1){var l;const e=null===(l=o.audio.dialout.find((e=>e.sequence===n)))||void 0===l?void 0:l.phoneNumber;e&&(s.push($c({userId:r,key:"phoneNumber",value:e})),Rc(Gs,[{userId:r,phoneNumber:e}]))}}else[Ha.Canceling,Ha.Canceled,Ha.CancelFailed].includes(i)?i===Ha.Canceled?Rc(wd):i===Ha.CancelFailed&&Rc(Rd):-1===[Ha.Calling,Ha.Ringing,Ha.Accepted,Ha.Success].indexOf(i)&&Rc(_d);return Ue(s)}))),dialEpics1:(e,t)=>yn(e,4120).pipe(Tt(t),mt((e=>{let[t,o]=e;return o.audio.crcDevice.map((e=>e.sequence)).includes(t.payload.seq)})),Xe((e=>{let[t,o]=e;const{payload:{seq:n,body:{result:r,transID:i}}}=t,{audio:{crcDevice:s}}=o,a=[],u=s.find((e=>e.sequence===n));return u&&(Rc(Bd,{code:r,ip:u.ip,protocol:u.protocol,uuid:u.uuid}),a.push(Ah({sequence:n,transID:i,result:r}))),r===Mu.Success?Rc(xd):[Mu.Success,Mu.Ringing].includes(r)||Rc(Fd),Ue(a)})))},WA={epics0:(e,t)=>yn(e,12033).pipe(Tt(t),ze((e=>{let[t,o]=e;const{participants:{allowTalkAttendeesList:n}}=o,r=t.payload.body;let i={};if(r){const e=Ap(o),t=Object.keys(r).map((e=>({key:e,userId:r[e]}))),s=t.map((e=>e.userId));RA(t,s,e),n.length>0&&s.length>0&&RA(t,s,n),i=t.reduce(((e,t)=>({...e,[`${t.key}`]:{userId:t.userId,displayName:t.displayName}})),{}),Rc(vd,Object.values(i))}return Mp(i)}))),epics1:(e,t)=>yn(e,16135).pipe(Tt(t),Ot((e=>{let[t,o]=e;const{payload:{body:{id:n,bLeadershipOn:r}}}=t,{audio:{bCanUnmute:i}}=o,s=yp(o);if(s){const{isHost:e,bCoHost:t,userId:o,audio:a,muted:u}=s,d=e||t;r&&fr(o,n)&&(null!==a&&""!==a&&!0!==u||!d&&!i||Rc(gd,Ua.Spotlight))}})),Et(fe)),epics2:(e,t)=>yn(e,12037).pipe(Tt(t),Ot((e=>{let[,t]=e;const o=yp(t);null!==(null==o?void 0:o.audio)&&""!==(null==o?void 0:o.audio)&&1==(null==o?void 0:o.muted)&&Rc(gd,Ua.Unmute)})),Et(fe)),epics3:(e,t)=>yn(e,us).pipe(mt((e=>e.payload.body&&["bCanUnmute","bMutedAll","bMutedUponEntry"].some((t=>void 0!==e.payload.body[t])))),Xe((e=>{const{payload:{body:{bCanUnmute:o,bMutedAll:n,bMutedUponEntry:r}}}=e,i=[];if(void 0!==o&&i.push(Lp(e.payload.body.bCanUnmute)),void 0!==n){const o=yp(t.value);(null==o?void 0:o.audio)!==Iu.Computer&&(null==o?void 0:o.audio)!==Iu.Phone||0!=o.muted||e.payload.body.bMutedAll&&i.push(fh(ja.PassiveByMuteAll))}return void 0!==r&&i.push(Bp(e.payload.body.bMutedUponEntry)),Ue(i)}))),epics4:(e,t)=>yn(e,as).pipe(Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===Dp.Connected})),Xe((e=>{let[o,n]=e;const{payload:{body:{update:r}}}=o;if(null!=r&&r.some((e=>void 0!==e.audio||void 0!==e.muted))){const{meeting:{userId:e}}=n,o=r.filter((t=>t.id!==e)),i=r.filter((t=>t.id===e));if(o&&o.forEach((e=>{Rc(Id,e)})),i.length>0)return kf(t).pipe(Xe((e=>{const{audio:{mutedSource:o,unmutedSource:n,isAllowToTalk:r,isShareAudioEnabled:s,isSharingAudio:a,isAudioBridgeSignalReconnecting:u,leaveAudioSource:d,customizeAudioOption:{speakerOnly:l}}}=t.value,c=e;return Ue(i).pipe(ty((async e=>{const t=[];if(e.audio!==c.audio)if(""===e.audio)Rc(Sd,{source:d}),t.push(bh(void 0));else if(e.audio===Iu.Computer){const e=rp(c.userRole)&&!r||!!l;a&&Rc(fd),e&&(Rc(fd),Gi.isIOSMobile&&t.push(vh(!0))),u&&(Rc(fd),t.push(gh(!1)))}else e.audio===Iu.Phone&&(c.audio===Iu.Computer&&(await NA.leaveComputerAudio(),t.push(bh(xa.Pstn)),LA.joinOrLeaveVoip(!1)),Rc(yd));if(""!==c.audio&&e.muted!==c.muted){if(e.muted!==c.muted)if(!0===e.muted){if(o!==ja.Inherited){const e=null!=o?o:ja.PassiveByMuteOne;Rc(bd,{source:e})}c.audio!==Iu.Computer||s&&!OA()||NA.muteAudio()}else if(!1===e.muted){if(n!==Ba.Inherited){const e=null!=n?n:Ba.Passive;Rc(Ed,{source:e})}c.audio===Iu.Computer&&NA.unmuteAudio()}void 0!==e.muted&&t.push(fh(void 0),yh(void 0))}return t})))})))}return fe}))),epics5:(e,t)=>yn(e,12036).pipe(Tt(t),Xe((e=>{let[t,o]=e;const n=yp(o),{media:{audioEncodeStatus:r}}=o,{promoterID:i,bAllowTalk:s}=t.payload.body;if((null==n?void 0:n.userId)===i){if(Rc(Md,s),s)return"success"!==r&&NA.enableAudioEncode(),Pf("audio",r,"success").pipe(Xe((e=>(e&&Rc(gd,Ua.AllowToTalk),fe))),Ct(Up(!0)));if(LA.mute(i,!0),(null==n?void 0:n.audio)===Iu.Computer)return NA.leaveComputerAudio(),dt(300).pipe(Ot((async()=>{(wA()?Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))):Promise.resolve(!0)).then((()=>{IA(NA,o,!1)}))})),Et(fe),Ct(Up(!1),fh(ja.Inherited)))}return fe}))),epics6:e=>yn(e,8205).pipe(Ot((e=>{Rc("AUDIO_ALLOW_TO_TALK_RESPONSE",e.payload.body)})),Et(fe)),epics7:(e,t)=>bn(e,24597).pipe(Tt(t),Ot((e=>{let[t,o]=e;const n=yp(o);(null==n?void 0:n.audio)===Iu.Phone?LA.audioDrop(n.userId):(null==n?void 0:n.audio)===Iu.Computer&&t.payload.body.bPromote})),Et(fe)),epics8:(e,t)=>yn(e,12035).pipe(Tt(t),_t((e=>{let[o,n]=e;const{meeting:{currentUserAudioBeforeReset:r}}=n,{payload:{body:{ssrc:i}}}=o,s=kf(t).pipe(Xe((e=>{if(r===Iu.Computer&&(null==e||!e.audio)){const{encodeInitStatus:o,decodeInitStatus:n}=kA(t.value,e);return Pf("audio",o,n).pipe(mt((e=>{let[t,o]=e;return t&&o})),Ot((()=>{(wA()?Fe(vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1)))):Promise.resolve(!0)).then((()=>{MA(LA,t.value),IA(NA,t.value)}));const{audio:{locallyMutedAudioList:e,localUserAudioVolumeList:o,isStopAllImcomingAudio:n}}=t.value;e.length>0&&e.forEach((e=>{NA.muteOrUnmuteOtherAudio(e,!0)})),o.length>0&&o.forEach((e=>{NA.adjustOtherAudioVolume(e.userId,e.volume)})),n&&NA.stopAllIncomingAudio(!0)})),yt(si(void 0)))}return fe})));return Rc(Vd,i),ct(je(jp(i)),s)}))),epics9:(e,t)=>yn(e,7952).pipe(_t((e=>Dc(yd,1).pipe(Tt(t),Ot((t=>{let[,o]=t;const{BindStatus:n,nOperatorUserId:r}=e.payload.body,i=o.participants.attendeesList.find((e=>e.userId===r));!0===n&&Rc(Od,{operatorName:null==i?void 0:i.displayName,operatorUserId:r,operatorRole:null==i?void 0:i.userRole})})),Et(fe))))),epics10:(e,t)=>In(e,Na.UserGrantCaptureAudio).pipe(Tt(t),Xe((e=>{let[t,o]=e;const n=yp(o);var r;(r=n,(null==r?void 0:r.audio)===Iu.Computer?Promise.resolve():Tc({event:$s,operations:[mt((e=>void 0!==e.audio&&""!==e.audio)),ft(1)]},(e=>{let{audio:t}=e;return t===Iu.Phone||t===Iu.Computer}))).then((()=>{Rc(fd)}));const{meeting:{isCurrentUserMutedBeforeReset:i},audio:{bMutedUponEntry:s,isUserGrantCaptureAudio:a,isAllowToTalk:u,activeMicrophone:d}}=o,{payload:{data:l}}=t,c=[xp(!0)];if(n){!0===n.muted&&!1===u&&(c.push(fh(ja.Inherited)),LA.mute(n.userId,!0));const e=a||n.isHost||u;(!0===i||!e&&s)&&(c.push(fh(ja.Inherited)),LA.mute(n.userId,!0),i&&c.push(ai(void 0))),l&&d!==l&&c.push(Gp(l))}return Ue(c)}))),epics11:e=>In(e,Na.UserForbiddedCaptureAudio).pipe(Ot((()=>{Rc(Td)})),yt(Fp(!0))),epics12:e=>In(e,Na.AudioWebsocketBroken).pipe(Ot((()=>{Rc(Dd)})),Et(fe)),epics13:(e,t)=>In(e,Na.AudioZeroData).pipe(Tt(t),Xf((e=>{let[,t]=e;const{audio:{webrtcRestartCount:o,activeMicrophone:n}}=t;if(o<3)return NA.restoreWebRTC(n),Hp(o+1)}))),epics14:(e,t)=>e.pipe($t(`${Kp}`),mt((e=>!1===e.payload)),Xe((()=>(Rc(Pd),vt(st(document,"click").pipe(ft(1)),st(document,"touchend").pipe(ft(1))).pipe(Ot((()=>{MA(LA,t.value),IA(NA,t.value)})),yt(Kp(!0))))))),epics15:e=>In(e,[Na.JoinComputerAudioComplete,Na.JoinSharingAudioComplete,Na.LeaveComputerAudioComplete,Na.LeaveSharingAudioComplete]).pipe(Ot((()=>{Bf.completeAudioAction()})),Et(fe)),epics16:(e,t)=>In(e,Na.AudioQosData).pipe(Tt(t),ze((e=>{var t;let[o,n]=e;const{meeting:{isWebinar:r},media:{audioEncodeStatus:i,audioDecodeStatus:s},participants:{xmppAttendeeList:a,allowTalkAttendeesList:u}}=n,d=yp(n),l=Rp(n);let c=l.length>0,p=l.some(VA);const h=zi();r&&(c=c||Boolean(a.length),p=p||u.some(VA));const m=((null==d?void 0:d.audio)===Iu.Computer||(null==d?void 0:d.audio)===Iu.Phone)&&("success"===i||h)&&!(null!=d&&d.muted)&&c,v=((null==d?void 0:d.audio)===Iu.Computer||(null==d?void 0:d.audio)===Iu.Phone)&&("success"===s||h)&&c&&p;return null!==(t=o.payload.data)&&void 0!==t&&t.encoding?m?(Rc(Nd,o.payload),rh(o.payload)):rh(hu):v?(Rc(Nd,o.payload),ih(o.payload)):ih(hu)}))),epics17:(e,t)=>yn(e,as).pipe(Tt(t),mt((e=>{let[t,o]=e;const{payload:{body:n}}=t,{audio:{locallyMutedAudioList:r,localUserAudioVolumeList:i}}=o;return(r.length>0||i.length>0)&&(null==n?void 0:n.remove)&&n.remove.length>0})),Xe((e=>{let[t,o]=e;const{payload:{body:{remove:n}}}=t,{audio:{locallyMutedAudioList:r,localUserAudioVolumeList:i}}=o,s=r.concat(i.map((e=>e.userId))).filter((e=>-1!==n.indexOf((t=>t.id===e))));return s.length>0?(s.forEach((e=>{NA.muteOrUnmuteOtherAudio(e,!1)})),Ue(s.map((e=>[ah(e),dh({userId:e})])).flat())):fe}))),epics18:(e,t)=>In(e,Na.HidStatusMute).pipe(Xe((e=>{const{payload:{data:o}}=e,n=t.value,{meeting:{userId:r},audio:{isShareAudioEnabled:i,bCanUnmute:s}}=n,a=[];if(o)i&&!OA()&&a.push(Zp(!0)),a.push(fh(ja.Active)),LA.mute(r,!0);else if(!i||OA()){i&&a.push(Zp(!1));const e=yp(n);(s||null!=e&&e.isHost||null!=e&&e.bCoHost)&&(a.push(yh(Ba.Active)),LA.mute(r,!1))}return Ue(a)}))),epics19:e=>yn(e,12040).pipe(Ot((e=>{const{payload:{body:{mode:t}}}=e;NA.setAudioCodecMode(t)})),Et(fe)),epics20:(e,t)=>In(e,[Na.AudioSpeakerSetSuccess,Na.JoinComputerAudioComplete,Na.AudioSpeakerSetError]).pipe(Xe((e=>{const{payload:{data:o,type:n}}=e,{audio:{activeSpeaker:r,activeMicrophone:i}}=t.value,s=[];return n===Na.AudioSpeakerSetSuccess&&r!==o?s.push(zp(o)):n===Na.JoinComputerAudioComplete&&null!==o&&i!==o&&s.push(Gp(o)),n===Na.AudioSpeakerSetSuccess?Rc(Ud,!0):n===Na.AudioSpeakerSetError&&Rc(Ud,!1),Ue(s)}))),epics21:(e,t)=>In(e,Na.AudioLevelIndicator).pipe(mt((()=>{const e=yp(t.value);return!!e&&e.audio===Iu.Computer&&!e.muted})),Ot((e=>{const{payload:{data:t}}=e;Rc(Hd,{level:t.value})})),Xe((()=>fe)))},GA=fn(WA,{shareAudioEpics0:(e,t)=>En(e,as).pipe(mt((e=>{const t=e.payload.body.update;return t&&t.length>0&&t.findIndex((e=>void 0!==e.bShareOn))>-1})),Tt(t),Xe((e=>{let[t,o]=e;const{payload:{body:{update:n}}}=t,{audio:{localShareAudioUserMutedList:r}}=o,i=n.filter((e=>!0===e.bShareOn&&!0===e.bShareAudioOn)),s=[];return i.length>0&&i.forEach((e=>{-1===r.findIndex((t=>t.userId===e.id))&&s.push(Yp({userId:e.id,isFromMainSession:!!e.bShareToBORooms}))})),Ue(s)}))),shareAudioEpics1:(e,t)=>In(e,Na.SharingDesktopStreamHaveAudio).pipe(mt((()=>!t.value.audio.secondaryAudioMicrophoneId)),_t((()=>yn(e,as).pipe(mt((e=>{var o;const{payload:{body:n}}=e,{meeting:{userId:r}}=t.value;return(null==n||null===(o=n.update)||void 0===o?void 0:o.findIndex((e=>e.id===r&&!0===e.bShareOn)))>-1})),ft(1),ty((async()=>{const e=t.value;return await _A(jA,UA,e)})),Ct(th(!0)))))),shareAudioEpics2:(e,t)=>In(e,Na.SharingDesktopStreamHaveNoAudio).pipe(Tt(t),mt((e=>{var t;let[,o]=e;return!0===(null===(t=o.audio)||void 0===t?void 0:t.isShareAudioEnabled)})),ty((async e=>{let[,t]=e;return await CA(jA,UA,t)}))),shareAudioEpics3:(e,t)=>yn(e,as).pipe(Tt(t),mt((e=>{let[,t]=e;return t.socket.zoomSocketStatus===Dp.Connected&&!0===t.audio.isSharingAudio})),Xe((e=>{var o;let[n,r]=e;if(null!==(o=n.payload.body.update)&&void 0!==o&&o.some((e=>void 0!==e.audio||void 0!==e.muted))){const{meeting:{userId:e}}=r,o=n.payload.body.update.filter((t=>t.id===e));return kf(t).pipe(Xe((e=>{const t=[];return o.findIndex((e=>e.audio===Iu.Computer))>-1&&(null==e?void 0:e.audio)!==Iu.Computer&&!OA()&&(t.push(eh(!0)),t.push(Zp(!0))),Ue(t)})))}return fe}))),shareAudioEpics4:(e,t)=>e.pipe($t(`${Dh}`),Le(he),Tt(t),mt((e=>{var t;let[,o]=e;return!0===(null===(t=o.audio)||void 0===t?void 0:t.isShareAudioEnabled)})),ty((async e=>{let[t,o]=e;const{payload:n}=t,{audio:{isShareAudioMuted:r,isSharingAudio:i}}=o,s=[];if(n===Ka.End){const e=await CA(jA,UA,o);s.push(...e)}else if(n===Ka.Paused){if(!1===r&&!0===i){await jA.leaveSharingAudio(!0),s.push(nh(!1));const e=await AA(jA,UA,o);s.push(...e),setTimeout((()=>{Rc(Ld,{state:"off"})}),0)}}else if(n===Ka.Sharing&&!1===r&&!1===i){const e=await _A(jA,UA,o);s.push(...e)}return s}))),shareAudioEpics5:(e,t)=>In(e,Na.SharingDesktopStreamHaveAudio).pipe(mt((()=>!!t.value.audio.secondaryAudioMicrophoneId)),Ot((()=>{const{audio:{audioSsrc:e,secondaryAudioMicrophoneId:o},meeting:{svcUrl:n,conId:r,reportDomain:i,supportLocalAB:s,abToken:a}}=t.value;jA.joinSharingAudio({ssrc:e,microphoneDeviceId:o,speakerDeviceId:null,isCaptureAudio:!0,audioBridge:zi()?{rwgHost:n,cid:r,nginxHost:i,abToken:a,supportLocalAB:s,useWebRTCOnDesktop:!Gi.isAndroidOrIOSBrowser}:void 0}),Rc(jd)})),Xe((()=>fe)))},{audioBridgEpics0:e=>yn(e,4299).pipe(Ot((e=>{const{payload:t}=e;xA.passThroughRWGMessage(t)})),Et(fe)),audioBridgEpics1:e=>In(e,Na.AudioBridgeReconnectStart).pipe(Xe((()=>(BA.joinOrLeaveVoip(!1),Ue([gh(!0),bh(xa.Failover)]))))),audioBridgEpics2:(e,t)=>In(e,Na.AudioBridgeReconnectEnd).pipe(Ot((()=>{MA(BA,t.value)})),Et(fe)),audioBridgEpics3:e=>yn(e,as).pipe(mt((e=>{var t,o;return zi()&&((null===(t=e.payload.body.update)||void 0===t?void 0:t.some((e=>void 0!==e.muted)))||(null===(o=e.payload.body.remove)||void 0===o?void 0:o.length)>0)})),Ot((e=>{const{payload:{body:{update:t,remove:o}}}=e;xA.sendUserAudioStatus({update:(t||[]).filter((e=>void 0!==e.muted)).map((e=>({userId:e.id,muted:e.muted}))),remove:(o||[]).map((e=>({userId:e.id})))})})),Et(fe)),audioBridgEpics4:(e,t)=>In(e,Na.NotifyUIFailover).pipe(mt((()=>!t.value.meeting.isMeetingReset&&t.value.meeting.meetingStatus===Ti.Joined)),ze((()=>(Rc(Zs,{reason:_i.Failover}),Br(Pi.NotifyUiFailover))))),audioBridgEpics5:(e,t)=>An(e,t).pipe(mt((()=>{const{meeting:{isAudioBridgeEnabled:e,abToken:o}}=t.value;return e&&zi()&&!!o})),Ot((()=>{const{meeting:{abToken:e,svcUrl:o,reportDomain:n,conId:r,supportLocalAB:i}}=t.value;xA.preInitAudioBridge({abToken:e,rwgHost:o,cid:r,nginxHost:n,supportLocalAB:i,useWebRTCOnDesktop:!Gi.isAndroidOrIOSBrowser})})),Et(fe)),audioBridgEpics6:(e,t)=>yn(e,16129).pipe(mt((e=>{const{payload:{body:{bVideoOn:o}}}=e,{meeting:{isAudioBridgeEnabled:n}}=t.value;return n&&zi()&&!!o})),Ot((e=>{const{payload:{body:{id:t}}}=e;xA.changeActiveVideoSsrc(t)})),Et(fe)),audioBridgEpics7:(e,t)=>In(e,[Na.RecoverWebrtcAudio,Na.AudioStreamFailed]).pipe(Xe((()=>{const e=yp(t.value),o=[];return(null==e?void 0:e.audio)===Iu.Computer&&(xA.leaveComputerAudio(),wA()?(BA.joinOrLeaveVoip(!1),o.push(bh(xa.EndedBySystem)),o.push(Hp(0))):IA(xA,t.value)),Ue(o)}))),audioBridgEpics8:e=>In(e,[Na.AudioBridgeFirstRecvData,Na.AudioBridgeCanSendData]).pipe(ze((e=>{const{payload:{type:t}}=e;return t===Na.AudioBridgeFirstRecvData?(Rc(Hl),ln(!0)):(Rc($l),cn(!0))}))),audioBridgEpics9:(e,t)=>e.pipe($t(`${Wr}`),mt((()=>!!t.value.meeting.zlkJwtToken)),Ot((()=>{const{meeting:{zlkJwtToken:e}}=t.value;if(e){const{enforce_web_rtc_audio:t,audio_compatible_mode:o}=Er(e);void 0===t&&void 0===o||Ni.set(ji.EnforceWebRTCAudio,1===Number(t)||1===Number(o),Mi.Memory)}})),Et(fe))},$A);var zA="object"==typeof global&&global&&global.Object===Object&&global,KA="object"==typeof self&&self&&self.Object===Object&&self,qA=zA||KA||Function("return this")(),JA=qA.Symbol,QA=Object.prototype,ZA=QA.hasOwnProperty,YA=QA.toString,XA=JA?JA.toStringTag:void 0,eC=Object.prototype.toString,tC="[object Null]",oC="[object Undefined]",nC=JA?JA.toStringTag:void 0;function rC(e){return null==e?void 0===e?oC:tC:nC&&nC in Object(e)?function(e){var t=ZA.call(e,XA),o=e[XA];try{e[XA]=void 0;var n=!0}catch(e){}var r=YA.call(e);return n&&(t?e[XA]=o:delete e[XA]),r}(e):function(e){return eC.call(e)}(e)}function iC(e){return null!=e&&"object"==typeof e}var sC=Array.isArray;function aC(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var uC="[object AsyncFunction]",dC="[object Function]",lC="[object GeneratorFunction]",cC="[object Proxy]";function pC(e){if(!aC(e))return!1;var t=rC(e);return t==dC||t==lC||t==uC||t==cC}var hC,mC=qA["__core-js_shared__"],vC=(hC=/[^.]+$/.exec(mC&&mC.keys&&mC.keys.IE_PROTO||""))?"Symbol(src)_1."+hC:"",gC=Function.prototype.toString;function fC(e){if(null!=e){try{return gC.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var yC=/^\[object .+?Constructor\]$/,SC=Function.prototype,bC=Object.prototype,EC=SC.toString,IC=bC.hasOwnProperty,AC=RegExp("^"+EC.call(IC).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function CC(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!aC(e)||(t=e,vC&&vC in t))&&(pC(e)?AC:yC).test(fC(e));var t}(o)?o:void 0}var _C=CC(qA,"WeakMap"),wC=9007199254740991,RC=/^(?:0|[1-9]\d*)$/;function OC(e,t){var o=typeof e;return!!(t=null==t?wC:t)&&("number"==o||"symbol"!=o&&RC.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=DC}function kC(e){return null!=e&&PC(e.length)&&!pC(e)}var MC=Object.prototype;function LC(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||MC)}function NC(e){return iC(e)&&"[object Arguments]"==rC(e)}var VC=Object.prototype,UC=VC.hasOwnProperty,jC=VC.propertyIsEnumerable,BC=NC(function(){return arguments}())?NC:function(e){return iC(e)&&UC.call(e,"callee")&&!jC.call(e,"callee")},xC="object"==typeof exports&&exports&&!exports.nodeType&&exports,FC=xC&&"object"==typeof module&&module&&!module.nodeType&&module,HC=FC&&FC.exports===xC?qA.Buffer:void 0,$C=(HC?HC.isBuffer:void 0)||function(){return!1},WC={};WC["[object Float32Array]"]=WC["[object Float64Array]"]=WC["[object Int8Array]"]=WC["[object Int16Array]"]=WC["[object Int32Array]"]=WC["[object Uint8Array]"]=WC["[object Uint8ClampedArray]"]=WC["[object Uint16Array]"]=WC["[object Uint32Array]"]=!0,WC["[object Arguments]"]=WC["[object Array]"]=WC["[object ArrayBuffer]"]=WC["[object Boolean]"]=WC["[object DataView]"]=WC["[object Date]"]=WC["[object Error]"]=WC["[object Function]"]=WC["[object Map]"]=WC["[object Number]"]=WC["[object Object]"]=WC["[object RegExp]"]=WC["[object Set]"]=WC["[object String]"]=WC["[object WeakMap]"]=!1;var GC,zC="object"==typeof exports&&exports&&!exports.nodeType&&exports,KC=zC&&"object"==typeof module&&module&&!module.nodeType&&module,qC=KC&&KC.exports===zC&&zA.process,JC=function(){try{return KC&&KC.require&&KC.require("util").types||qC&&qC.binding&&qC.binding("util")}catch(e){}}(),QC=JC&&JC.isTypedArray,ZC=QC?(GC=QC,function(e){return GC(e)}):function(e){return iC(e)&&PC(e.length)&&!!WC[rC(e)]},YC=Object.prototype.hasOwnProperty;var XC=function(e,t){return function(o){return e(t(o))}}(Object.keys,Object),e_=Object.prototype.hasOwnProperty;function t_(e){if(!LC(e))return XC(e);var t=[];for(var o in Object(e))e_.call(e,o)&&"constructor"!=o&&t.push(o);return t}function o_(e){return kC(e)?function(e,t){var o=sC(e),n=!o&&BC(e),r=!o&&!n&&$C(e),i=!o&&!n&&!r&&ZC(e),s=o||n||r||i,a=s?function(e,t){for(var o=-1,n=Array(e);++o-1},d_.prototype.set=function(e,t){var o=this.__data__,n=a_(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this};var l_=CC(qA,"Map");function c_(e,t){var o,n,r=e.__data__;return("string"==(n=typeof(o=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==o:null===o)?r["string"==typeof t?"string":"hash"]:r.map}function p_(e){var t=-1,o=null==e?0:e.length;for(this.clear();++ta))return!1;var d=i.get(e),l=i.get(t);if(d&&l)return d==t&&l==e;var c=-1,p=!0,h=o&U_?new L_:void 0;for(i.set(e,t),i.set(t,e);++c4294966272&e,pw=e=>{let t={R:0,G:0,B:0,A:0};if("string"==typeof e&&e.startsWith("#")){const a=e.slice(1);try{if(3===a.length){const e=Array.from(a).map((e=>e.repeat(2))).map((e=>parseInt(e,16)));t={R:e[0]/255,G:e[1]/255,B:e[2]/255,A:1}}else if(6===a.length||8===a.length){var o,n,r,i,s;const e=null===(o=a.match(/\S{2}/g))||void 0===o?void 0:o.map((e=>parseInt(e,16)));t={R:(null!==(n=null==e?void 0:e[0])&&void 0!==n?n:0)/255,G:(null!==(r=null==e?void 0:e[1])&&void 0!==r?r:0)/255,B:(null!==(i=null==e?void 0:e[2])&&void 0!==i?i:0)/255,A:null!=e&&e[3]?(null!==(s=null==e?void 0:e[3])&&void 0!==s?s:0)/255:1}}}catch(t){console.warn("error color representation:",e)}}else"object"==typeof e&&(t={R:e.R/255,G:e.G/255,B:e.B/255,A:e.A||1});return t};function hw(e){let{captureWidth:t=0,captureHeight:o=0}=e||{};const{hd:n}=e||{};var r,i;return 0!==t&&0!==o||(n&&Fs.isSupportSending720P()?(t=1280,o=720):(t=640,o=360)),{captureWidth:t,captureHeight:o,isCustomizedResolution:!(null==e||!e.captureWidth||!e.captureHeight||(r=t,i=o,Math.abs(Math.floor(r/i*10)-Math.floor(16/9*10))<=1))}}function mw(e,t){return"default"===e||t.some((t=>t.deviceId===e))||[ou.Environment,ou.User,ou.Left,ou.Right].includes(e)}function vw(e,t){if("function"==typeof DOMMatrixReadOnly){const o=new DOMMatrixReadOnly(getComputedStyle(e).transform).scale(-1,1).toString();e.style.transform=o,e.dataset.mirrored=t?"1":"0"}}function gw(e,t,o){const n=[],{video:{videoSsrc:r,activeCamera:i}}=t,{cameraId:s=i,videoElement:a,originalRatio:u,ptz:d,hd:l,fullHd:c,mediaFile:p,fps:h,mirrored:m}=o||{};let v;if(void 0!==a){let e=a instanceof HTMLVideoElement?a:null;if("string"==typeof a){let[t,o]=[document.body,a];if(a.indexOf(">")>-1){const[e,n]=a.split(">");t=document.querySelector(e),o=n}t&&(e=t.querySelector(o))}if(!e)return[];e.id?v=e.id:(v=Sr("__ZOOM_SDK_SELF_VIDEO_@__"),e.id=v),m&&"1"!==e.dataset.mirrored&&vw(e,m)}let g=null!=h?h:Ru.Default;g=Math.max(Ru.Min,g),g=Math.min(Ru.Max,g);const{captureWidth:f,captureHeight:y,isCustomizedResolution:S}=hw(o);if(S)e.updateVideoHDValue(!1);else{e.updateVideoHDValue(!!l||!!c);const t=!!c&&Fs.isSupportFullHDVideo();e.updateVideoFullhdValue(t)}let b=Promise.resolve(s);if(p&&p.url){const e=SA.getInstance();b=e.setVideoElement(p).then((()=>e.videoElement))}else SA.getInstance().stopVideoElement();return b.then((t=>{e.startCaptureVideo(r,t,f,y,v,Gi.isAndroidOrIOSBrowser&&nu.includes(t),!u&&function(){var e,t;const{isAndroidOrIOSBrowser:o,isFirefox:n,isSafari:r}=Gi;return o||!(null!==(e=navigator.mediaDevices)&&void 0!==e&&null!==(t=e.getSupportedConstraints)&&void 0!==t&&t.call(e).aspectRatio)||n||r||Qi()}(),d,g)})),n.push(Vm({cameraId:s,captureWidth:f,captureHeight:y,videoElement:"string"==typeof a?a:a instanceof HTMLVideoElement?_r(a):void 0,originalRatio:u,ptz:d,hd:l,fullHd:c,mediaFile:p,fps:g,mirrored:m})),n}function fw(e,t,o){const{max:n,min:r,step:i}=e;let s=o/100*(n-r);i&&(s=Math.min(Math.floor(s/i)*i,Math.floor(s)));let a=t+s;return a=Math.min(n,a),a=Math.max(r,a),a}function yw(e,t){let o="",n=t;switch(e){case gu.Down:n=-t,o="tilt";break;case gu.Up:o="tilt";break;case gu.Left:n=-t,o="pan";break;case gu.Right:o="pan";break;case gu.ZoomIn:o="zoom";break;case gu.ZoomOut:n=-t,o="zoom"}return{key:o,range:n}}function Sw(e){const t=["pan","tilt","zoom"].reduce(((t,o)=>e[o]&&0!==e[o].value?{...t,[o]:e[o].value}:t),{});return function(e){if(null==e)return!0;if(kC(e)&&(sC(e)||"string"==typeof e||"function"==typeof e.splice||$C(e)||ZC(e)||BC(e)))return!e.length;var t=k_(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(LC(e))return!t_(e).length;for(var o in e)if(lw.call(e,o))return!1;return!0}(t)?null:t}function bw(e){return{pan:(e&fu.Pan)===fu.Pan,tilt:(e&fu.Tilt)===fu.Tilt,zoom:(e&fu.Zoom)===fu.Zoom}}function Ew(e){const{isAndroidBrowser:t,isIOSMobile:o,isFirefox:n,isSupportImageCapture:r,isSupportMediaStreamTrackProcessor:i,isSupportOffscreenCanvas:s}=Gi,a=t&&!n,u="function"!=typeof window.SharedArrayBuffer&&a;return o&&"function"==typeof VideoFrame||u||!qi()&&!e&&!Uf()&&(r||i)&&s}function Iw(){var e,t;return"orientation"in window.screen?null===(e=screen.orientation.type)||void 0===e?void 0:e.startsWith("landscape"):"orientation"in window?90===Math.abs(window.orientation):"matchMedia"in window?!(null===(t=window.matchMedia("(orientation: landscape)"))||void 0===t||!t.matches):screen.availWidth>screen.availHeight}function Aw(e,t,o){const{meeting:{userId:n},video:{isSupportHDVideo:r,renderedVideoList:i,maximumNumbeOfHDSubscriptions:s,receivedVideoMaxQuality:a}}=o,u=e===n;let d=t;if(t>=qa.Video_720P)if(r){const t=i.filter((e=>e.videoQuality===qa.Video_720P)).map((e=>e.userId)),o=null!=s?s:1;t.length>=o&&(t.includes(e)||u||(console.warn(`Warning: Web Video SDK currently only supports subscribing to ${o} 720p video stream, so quality has been downgraded to 360p`),d=qa.Video_360P))}else console.warn("Can not subscribe 720P video stream,will downgrade to 360P stream"),d=qa.Video_360P;const l=Math.max(a,qa.Video_360P);return[d,Math.min(d,l)]}const Cw=Ls.createAgent(),_w=ab(Fs.getInstance());let ww,Rw;async function Ow(e,t,o){const n=Sr(e),r=document.createElement("img");return r.src=t,r.id=n,r.style.display="none",br(t)&&r.setAttribute("crossorigin",""),await new Promise(((e,n)=>{r.onload=()=>{o&&URL.revokeObjectURL(t),e("")},r.onerror=()=>{o&&URL.revokeObjectURL(t),n("Cannot load image.")}})),{imageId:n,imgElement:r}}async function Tw(e,t,o){if(e===tu)return tu;{let n=e;if(t){const t=await function(e){return new Promise(((t,o)=>{try{ww&&Rw||(ww=document.createElement("canvas"),Rw=ww.getContext("2d"));const n=ww,r=Rw;if(r){r.clearRect(0,0,ww.width,ww.height);const i=new Image;i.src=e,br(e)&&(i.crossOrigin="");const s=16/9,a=1280,u=Math.floor(a/s);n.width=a,n.height=u,i.onload=()=>{const{width:e,height:d}=i,l=d*s;if(l>e){const t=e,o=Math.floor(e/s),n=0,l=(d-o)/2;null==r||r.drawImage(i,n,l,t,o,0,0,a,u)}else{const t=l,o=d,n=(e-t)/2,s=0;r.drawImage(i,n,s,t,o,0,0,a,u)}try{n.toBlob((e=>{t(e)}))}catch(e){e instanceof DOMException&&e.code===DOMException.SECURITY_ERR&&console.error("Image is not from the same origin, add CORS header to solve this issue"),o(e)}},i.onerror=e=>{o("Cannot load image.")}}}catch(e){o(e)}}))}(e);n=URL.createObjectURL(t)}if(n){const{imageId:e,imgElement:r}=await Ow(uu,n,!!t);return(null!=o?o:document.body).appendChild(r),e}}return null}async function Dw(e,t,o){var n;const r=null!==(n=o&&o.parentNode)&&void 0!==n?n:document.body,{imageUrl:i,cropped:s,rootWidth:a,rootHeight:u}=e;let d=e;!t.video.customizedVideoOption||e.captureWidth&&e.captureHeight||(d=t.video.customizedVideoOption);const{captureWidth:l,captureHeight:c}=hw(d),p=document.createElement("div");let h;p.style.display="none",h=i?await Tw(i,s,p):null;let m=Sr(au);if(o){const t=Vf(o);t.id?m=t.id:t.id=m;try{a&&o.width!==a&&(o.width=a),u&&o.height!==u&&(o.height=u)}catch(e){console.warn("Cannot set the canvas width/height, and pay attention the canvas dimension is different from the setting")}}else{const e=document.createElement("canvas");e.width=null!=a?a:380,e.height=null!=u?u:214,e.id=m,p.appendChild(e)}return null==r||r.appendChild(p),{captureWidth:l,captureHeight:c,imageId:h,canvasId:m,divElement:p}}async function Pw(e,t,o,n){const r=Array.isArray(e)?e:e&&[e];if((null==r?void 0:r.length)>0){ww&&Rw||(ww=document.createElement("canvas"),Rw=ww.getContext("2d"));const i=ww,s=Rw;if(i.width=t,i.height=o,s)try{s.fillStyle="#fff",s.clearRect(0,0,t,o);for(let e=0;e{a.onload=()=>{e("")},a.onerror=()=>{t()}}));const{width:u,height:d}=a;s.drawImage(a,0,0,u,d,n,i,o,r)}}const e=await new Promise((e=>{null==i||i.toBlob((t=>{e(t)}))}));if(e){const t=URL.createObjectURL(e),{imageId:o,imgElement:r}=await Ow(du,t,!0);return(null!=n?n:document.body).appendChild(r),o}}catch(e){e instanceof DOMException&&e.code===DOMException.SECURITY_ERR&&console.error("Image is not from the same origin, add CORS header to solve this issue")}}return null}function kw(e,t){if(e===t)return!0;if(null==e&&null==t)return!0;const o=Array.isArray(e)?[...e]:[e],n=Array.isArray(t)?[...t]:[t];if(o.length!==n.length)return!1;const r=(e,t)=>e.typee)))}(i)).then((i=>i?n||!s&&e.imageUrl!==tu&&e.imageUrl?async function(e,t,o,n){const{canvasId:r,imageId:i,captureHeight:s,captureWidth:a,divElement:u}=await Dw(e,o,n),{cameraId:d}=e,{video:{videoSsrc:l,activeCamera:c}}=o;return t.startVirtualBackgroundSetting(r,i,l,null!=d?d:c,a,s),u}(e,t,o,n).then((e=>r?Pm(!0):Fe(Dc(Xu,1)).then((o=>{var r;return n||t.stopVirtualBackgroundSetting(),o?(null==e||null===(r=e.parentNode)||void 0===r||r.removeChild(e),!0):Promise.reject("Cannot access the virtual background image.")})))):a===e.imageUrl&&u===Eu.VirtualBackground&&!d||async function(e,t,o){const{imageUrl:n,cropped:r}=e;if(n){const e=await Tw(n,r);e&&(o.video.backgroundMode===Eu.Mask&&(t.stopMaskSetting(!0),await yr((()=>{t.stopVirtualBackgroundSetting()}),0)),t.updateVirtualBackgroundImage(e),e!==tu&&setTimeout((()=>{Cf(e)}),0))}else t.updateVirtualBackgroundImage(null)}(e,t,o):Promise.reject("Cannot load virtual background model.")))}function Lw(e,t,o,n){const{video:{mask:{isMaskConfigured:r,imageSrc:i,clip:s},backgroundMode:a,isCurrentUserStartedVideo:u},meeting:{isCurrentUserStartVideoBeforeReset:d}}=o;return n||!r&&e.imageUrl?async function(e,t,o,n){const{canvasId:r,imageId:i,captureHeight:s,captureWidth:a,divElement:u}=await Dw(e,o,n),{cameraId:d,clip:l,rootWidth:c=1280,rootHeight:p=720}=e,h=l?await Pw(l,c,p,u):null,{video:{videoSsrc:m,activeCamera:v}}=o;return h?(t.startMaskSetting(r,i,h,m,null!=d?d:v,c,p,a,s),u):Promise.reject("Clip is empty")}(e,t,o,n).then((e=>u?Km(!0):Fe(Dc(ad,1)).then((o=>{var r;return n||t.stopMaskSetting(),o?(null==e||null===(r=e.parentNode)||void 0===r||r.removeChild(e),!0):Promise.reject("Cannot set video mask")})))):a===Eu.Mask&&e.imageUrl===i&&kw(e.clip,s)&&!d?Promise.resolve(!0):async function(e,t,o){const{imageUrl:n,cropped:r,clip:i,rootWidth:s,rootHeight:a}=e,{video:{mask:{imageSrc:u,cropped:d,clip:l},backgroundMode:c}}=o;if(n){if(c===Eu.VirtualBackground&&(t.stopVirtualBackgroundSetting(!0),await yr((()=>{t.stopMaskSetting()}),0)),n!==u||r!==d){const e=await Tw(n,r);e&&(t.updateMaskBackgroundImage(e),setTimeout((()=>{Cf(e)}),0))}if((!kw(i,l)||!u)&&i&&s&&a){const e=await Pw(i,s,a);e&&(t.updateMaskClip(e,s,a),setTimeout((()=>{Cf(e)}),0))}}else t.updateMaskBackgroundImage(null),t.updateMaskClip(null,s,a)}(e,t,o)}const Nw=Ls.createAgent(),Vw=ab(Fs.getInstance()),Uw=Ls.createAgent(),jw=ab(Fs.getInstance()),Bw={videoSsrc:0,cameraDevicesList:[],activeCamera:Gi.isAndroidOrIOSBrowser?ou.User:"default",activeVideoId:0,isCurrentUserStartedVideo:!1,spotlightUserList:[],isCaptureForbidden:!1,isMirrored:!1,receivedVideoMaxQuality:navigator.hardwareConcurrency>=8?qa.Video_1080P:qa.Video_360P,subscribedVideoList:[],renderedVideoList:[],ensuredCanvas:[],isVideoMuted:!1,isCaptureCameraLoading:!1,isCameraTaken:!1,isUsingMediaPlayback:!1,receivedVideoDimension:{width:0,height:0},capturedVideoDimension:{width:0,height:0},isFollowHostVideoLayout:!1,hostDragLayout:[],isSupportHDVideo:!1,isFullHDVideoEnabled:!1,bCanUnmuteVideo:!1,virtualBackground:{isVBConfigured:!1,isVBPreloadReady:void 0,imageSrc:void 0,cropped:void 0},mask:{imageSrc:void 0,cropped:void 0,clip:void 0},backgroundMode:Eu.Null,statistic:{encode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0,bandwidth:0,bitrate:0},decode:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,width:0,height:0,fps:0,bandwidth:0,bitrate:0}},hardwareAcceleration:{encode:!1,decode:!1},networkQuality:{},ptz:{},currentCameraControlStatus:{isRequested:!1,isInControl:!1,isCameraMoving:!1},farEndCameraControlStatus:{controlledUserList:[],isControlling:!1},subscriptionStatus:{encode:!1,decode:!1,detailed:!1},videoAttachments:{},rendererType:Pu.WebGL,selfPreviewVideoList:[]},xw=ko({[`${um}`]:fE(((e,t)=>{let{payload:o}=t;e.videoSsrc=o})),[`${lm}`]:fE(((e,t)=>{let{payload:o}=t;e.cameraDevicesList=o})),[`${cm}`]:fE(((e,t)=>{let{payload:o}=t;const n=e.activeCamera;if(n in e.ptz){const t=e.ptz[n];["pan","tilt","zoom"].forEach((e=>{t[e]&&(t[e].value=0)}))}e.activeCamera=o})),[`${dm}`]:fE(((e,t)=>{let{payload:o}=t;e.activeVideoId=o.userId})),[`${pm}`]:fE(((e,t)=>{let{payload:o}=t;e.isCurrentUserStartedVideo=o})),[`${hm}`]:fE(((e,t)=>{let{payload:o}=t;e.spotlightUserList=o})),[`${mm}`]:fE(((e,t)=>{let{payload:o}=t;e.isCaptureForbidden=o})),[`${vm}`]:fE(((e,t)=>{let{payload:o}=t;e.receivedVideoMaxQuality=o})),[`${gm}`]:fE(((e,t)=>{let{payload:o}=t;e.isVideoMuted=o})),[`${fm}`]:fE(((e,t)=>{let{payload:o}=t;e.isCaptureCameraLoading=o})),[`${ym}`]:fE(((e,t)=>{let{payload:o}=t;e.isCameraTaken=o})),[`${bm}`]:fE(((e,t)=>{let{payload:o}=t;e.receivedVideoDimension=o})),[`${Em}`]:fE(((e,t)=>{let{payload:o}=t;e.subscribedVideoList.includes(o)||e.subscribedVideoList.push(o)})),[`${Im}`]:fE(((e,t)=>{let{payload:o}=t;const n=e.subscribedVideoList.indexOf(o);n>=0&&e.subscribedVideoList.splice(n,1)})),[`${_m}`]:fE(((e,t)=>{let{payload:o}=t;const n=e.renderedVideoList.find((e=>e.userId===o.userId&&e.key===o.key&&e.canvasId===o.canvasId));n?(void 0!==o.videoQuality&&(n.videoQuality=o.videoQuality),void 0!==o.aspectRatio&&(n.aspectRatio=o.aspectRatio)):e.renderedVideoList.push({...o})})),[`${wm}`]:fE(((e,t)=>{let{payload:o}=t;const n=e.renderedVideoList.findIndex((e=>e.userId===o.userId&&e.key===o.key&&e.canvasId===o.canvasId));n>=0&&e.renderedVideoList.splice(n,1)})),[`${Am}`]:fE(((e,t)=>{let{payload:o}=t;e.isFollowHostVideoLayout=o})),[`${Cm}`]:fE(((e,t)=>{let{payload:o}=t;e.hostDragLayout=o})),[`${Rm}`]:fE(((e,t)=>{let{payload:o}=t;e.isSupportHDVideo=o})),[`${Om}`]:fE(((e,t)=>{let{payload:o}=t;e.maximumNumbeOfHDSubscriptions=o})),[`${Tm}`]:fE(((e,t)=>{let{payload:o}=t;e.bCanUnmuteVideo=o})),[`${Dm}`]:fE(((e,t)=>{let{payload:o}=t;e.virtualBackground.isVBPreloadReady=o})),[`${Pm}`]:fE(((e,t)=>{let{payload:o}=t;e.virtualBackground.isVBConfigured=o})),[`${km}`]:fE(((e,t)=>{let{payload:o}=t;e.virtualBackground.imageSrc=o.imageUrl,e.virtualBackground.cropped=o.cropped,e.backgroundMode=Eu.VirtualBackground})),[`${Nm}`]:fE(((e,t)=>{let{payload:o}=t;const{encode:n,decode:r}=o;void 0!==n&&(e.hardwareAcceleration.encode=n),void 0!==r&&(e.hardwareAcceleration.decode=r)})),[`${Mm}`]:fE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.encode={bitrate:r,...i}})),[`${Lm}`]:fE(((e,t)=>{let{payload:o}=t;const{data:{encoding:n,rate:r,...i}}=o;e.statistic.decode={bitrate:r,...i}})),[`${Vm}`]:fE(((e,t)=>{let{payload:o}=t;const{cameraId:n,captureWidth:r,captureHeight:i,videoElement:s,originalRatio:a,ptz:u,hd:d,fullHd:l,mediaFile:c,fps:p,mirrored:h}=o;e.activeCamera=n,e.customizedVideoOption={captureWidth:r,captureHeight:i,videoElement:s,originalRatio:a,ptz:u,hd:d,fullHd:l,fps:p},gr(e.mediaPlaybackFile,c)||(e.mediaPlaybackFile=c,e.isUsingMediaPlayback=!(null==c||!c.url)),void 0!==h&&(e.isMirrored=!!h)})),[`${Um}`]:fE(((e,t)=>{let{payload:o}=t;const{userId:n,level:r,bwLevel:i,type:s}=o;if(Object.prototype.hasOwnProperty.call(e.networkQuality,`${n}`))e.networkQuality[`${n}`][`${s}`]={level:r,bwLevel:i};else{const t={[s]:{level:r,bwLevel:i}};Object.assign(e.networkQuality,{[`${n}`]:t})}})),[`${jm}`]:fE(((e,t)=>{let{payload:o}=t;const{deviceId:n,ptzRange:r}=o;if(Object.prototype.hasOwnProperty.call(e.ptz,n)){const t=e.ptz[n];t&&["pan","tilt","zoom"].forEach((e=>{const o=r[e];if(o){var n;const r=null===(n=t[e])||void 0===n?void 0:n.capability;r?Object.assign(r,{...o}):t[e]={capability:{...o},value:0}}}))}else Object.assign(e.ptz,{[n]:{pan:r.pan?{capability:{...r.pan},value:0}:null,tilt:r.tilt?{capability:{...r.tilt},value:0}:null,zoom:r.zoom?{capability:{...r.zoom},value:0}:null}})})),[`${Bm}`]:fE(((e,t)=>{let{payload:o}=t;e.currentCameraControlStatus.isRequested=o})),[`${xm}`]:fE(((e,t)=>{let{payload:o}=t;const{isInControl:n,userId:r}=o;e.currentCameraControlStatus.isInControl=n,e.currentCameraControlStatus.controllingUserId=r})),[`${Fm}`]:fE(((e,t)=>{let{payload:o}=t;e.farEndCameraControlStatus.controlledUserList.includes(o)||e.farEndCameraControlStatus.controlledUserList.push(o)})),[`${Hm}`]:fE(((e,t)=>{let{payload:o}=t;const n=e.farEndCameraControlStatus.controlledUserList.indexOf(o);-1!==n&&e.farEndCameraControlStatus.controlledUserList.splice(n,1)})),[`${$m}`]:fE(((e,t)=>{let{payload:o}=t;e.currentCameraControlStatus.isCameraMoving="start"===o.cmd})),[`${Wm}`]:fE(((e,t)=>{let{payload:o}=t;const{constraints:n,deviceId:r}=o,i=e.ptz[r];["pan","tilt","zoom"].forEach((e=>{void 0!==n[e]&&(i[e].value=n[e])}))})),[`${Gm}`]:fE(((e,t)=>{let{payload:o}=t;e.farEndCameraControlStatus.isControlling=o})),[`${zm}`]:fE(((e,t)=>{let{payload:o}=t;e.networkQualityBroadcastTime=o})),[`${Km}`]:fE(((e,t)=>{let{payload:o}=t;e.mask.isMaskConfigured=o})),[`${Jm}`]:fE(((e,t)=>{let{payload:o}=t;const{imageUrl:n,cropped:r,rootHeight:i,rootWidth:s,clip:a}=o;e.mask.imageSrc=n,e.mask.cropped=r,e.mask.clip=a,e.mask.rootWidth=s,e.mask.rootHeight=i,e.backgroundMode=Eu.Mask})),[`${qm}`]:fE(((e,t)=>{let{payload:o}=t;e.backgroundMode=o})),[`${Qm}`]:fE(((e,t)=>{let{payload:o}=t;e.capturedVideoDimension=o})),[`${Zm}`]:fE(((e,t)=>{let{payload:o}=t;e.ensuredCanvas.includes(o)||e.ensuredCanvas.push(o)})),[`${Ym}`]:fE(((e,t)=>{let{payload:o}=t;e.mediaPlaybackFile=o,e.isUsingMediaPlayback=!(null==o||!o.url)})),[`${Xm}`]:fE(((e,t)=>{let{payload:o}=t;if(o){const{lastCopy:t,...n}=o;e.prefetchedVideo=n}else e.prefetchedVideo=o})),[`${ev}`]:fE(((e,t)=>{let{payload:o}=t;Object.assign(e.subscriptionStatus,o)})),[`${tv}`]:fE(((e,t)=>{let{payload:o}=t;e.isFullHDVideoEnabled=o})),[`${ov}`]:fE(((e,t)=>{let{payload:o}=t;const{userId:n,element:r}=o,i=e.videoAttachments[`${n}`];if(i)-1===i.indexOf(r)&&i.push(r);else{const t=[];t.push(r),Object.assign(e.videoAttachments,{[`${n}`]:t})}})),[`${nv}`]:fE(((e,t)=>{let{payload:o}=t;const{userId:n,element:r}=o,i=e.videoAttachments[`${n}`];let s=r;Array.isArray(r)||(s=[r]),s.forEach((e=>{if(i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}))})),[`${rv}`]:fE(((e,t)=>{let{payload:o}=t;o&&(e.rendererType=Pu.WebGL2)})),[`${iv}`]:fE(((e,t)=>{let{payload:o}=t;o&&(e.rendererType=Pu.WebGPU)})),[`${sv}`]:fE(((e,t)=>{let{payload:o}=t;e.rendererType=o})),[`${av}`]:fE(((e,t)=>{let{payload:o}=t;e.isMirrored=o})),[`${uv}`]:fE(((e,t)=>{let{payload:o}=t;e.selfPreviewVideoList.includes(o)||e.selfPreviewVideoList.push(o)})),[`${dv}`]:fE(((e,t)=>{let{payload:o}=t;if(o){const t=e.selfPreviewVideoList.indexOf(o);t>=0&&e.selfPreviewVideoList.splice(t,1)}else e.selfPreviewVideoList=[]})),[`${Sm}`]:(e,t)=>{let{payload:o}=t;const n={cameraDevicesList:e.cameraDevicesList};return o&&Object.assign(n,{activeCamera:e.activeCamera,customizedVideoOption:e.customizedVideoOption,virtualBackground:{imageSrc:e.virtualBackground.imageSrc,cropped:e.virtualBackground.cropped},mask:{imageSrc:e.mask.imageSrc,cropped:e.mask.cropped,rootWidth:e.mask.rootWidth,rootHeight:e.mask.rootHeight,clip:e.mask.clip},backgroundMode:e.backgroundMode,ptz:e.ptz,subscriptionStatus:e.subscriptionStatus}),{...Bw,...n}}},Bw),Fw={cameraPtzEpics0:(e,t)=>yn(e,8004).pipe(Xe((e=>{const{payload:{body:{nCmd:o,nUserID:n,nReason:r,nButtonID:i}}}=e,s=t.value,a=Ap(s),{video:{currentCameraControlStatus:{isInControl:u,controllingUserId:d},cameraDevicesList:l,activeCamera:c}}=s,p=a.find((e=>fr(e.userId,n))),h=[];if(h.push(Bm(!0)),o===vu.Request){const e={userId:null==p?void 0:p.userId,displayName:null==p?void 0:p.displayName};if(u){const t=a.find((e=>e.userId===d));Object.assign(e,{currentControllingUserId:null==t?void 0:t.userId,currentControllingDisplayName:null==t?void 0:t.displayName})}Rc(nd,e)}else if(o===vu.Approve)h.push(Fm(null==p?void 0:p.userId)),Rc(rd,{isApproved:!0,userId:null==p?void 0:p.userId,displayName:null==p?void 0:p.displayName});else if(o===vu.Decline)h.push(Hm(null==p?void 0:p.userId)),Rc(rd,{isApproved:!1,userId:null==p?void 0:p.userId,displayName:null==p?void 0:p.displayName,reason:r});else if(o===vu.GiveUp)h.push(xm({isInControl:!1,userId:0})),Rc(id,{isControlled:!1});else if(o===vu.StartControl||o===vu.StopControl)h.push($m({cmd:o===vu.StartControl?"start":"stop",type:i}));else if(o===vu.SwitchCamera){const e=l.findIndex((e=>e.deviceId===c)),t=e+1===l.length?0:e+1;if(t!==e){const e=l[t].deviceId;jw.changeCamera(e)}}return Ue(h)}))),cameraPtzEpics1:(e,t)=>yn(e,as).pipe(mt((e=>{var t;const{payload:{body:o}}=e;return null==o||null===(t=o.update)||void 0===t?void 0:t.some((e=>void 0!==e.nFECC||void 0!==e.nFECCExecutive))})),Ot((e=>{const{payload:{body:{update:o}}}=e,n=o.find((e=>void 0!==e.nFECC||void 0!==e.nFECCExecutive));if(n){const{meeting:{userId:e}}=t.value;fr(n.nFECCExecutive,e)&&Rc(sd,{userId:n.id,ptz:bw(n.nFECC)})}})),Et(fe)),cameraPtzEpics2:(e,t)=>yn(e,as).pipe(mt((e=>{var o;const{payload:{body:n}}=e,{video:{farEndCameraControlStatus:{controlledUserList:r}}}=t.value;return null==n||null===(o=n.remove)||void 0===o?void 0:o.some((e=>r.includes(e.id)))})),Xe((e=>{var o;const{payload:{body:n}}=e,r=[],{video:{farEndCameraControlStatus:{controlledUserList:i}}}=t.value,s=null==n||null===(o=n.remove)||void 0===o?void 0:o.find((e=>i.includes(e.id)));return s&&r.push(Hm(s.id)),Ue(r)}))),cameraPtzEpics3:(e,t)=>e.pipe($t(`${$m}`),_t((e=>{const{payload:{cmd:o,type:n}}=e;return"start"===o?dt(0,200).pipe(Rt((()=>!!t.value.video.currentCameraControlStatus.isCameraMoving)),Xe((()=>{const{video:{ptz:e,activeCamera:o}}=t.value,r=e[o],i=Sw(r)||{},{key:s,range:a}=yw(n,2);return r[s]?(Object.assign(i,{[s]:fw(r[s].capability,r[s].value,a)}),jw.movePTZCamera(i).then((()=>Wm({deviceId:o,constraints:i})))):Promise.resolve(void 0)})),Xe((e=>"object"==typeof e&&void 0!==e.type?je(e):fe))):fe}))),cameraPtzEpics4:(e,t)=>e.pipe($t(`${cm}`),Xe((e=>{const{payload:o}=e,{video:{customizedVideoOption:n,ptz:r}}=t.value;if(null!=n&&n.ptz){const e=null==r?void 0:r[o];void 0!==e&&Uw.sendCameraAblity({pan:!!e.pan,tilt:!!e.tilt,zoom:!!e.zoom})}return fe})))},Hw={videoCaptureEpics0:(e,t)=>In(e,Na.StartVideoCaptureSuccess).pipe(Xe((e=>{const{video:{cameraDevicesList:o,activeCamera:n,ptz:r,isCurrentUserStartedVideo:i,isUsingMediaPlayback:s},meeting:{userId:a}}=t.value,{payload:{data:{currentDeviceID:u,PTZRange:d}}}=e,l=[];if(o.length<1&&!s&&(Rc(Bu,{reason:"Cannot detect camera devices"}),Vw.stopCaptureVideo()),mw(n,o)||s){if(i||Nw.muteAttendeeVideo(a,!1),Rc(ud),s)l.push(cm("default"));else if(u&&d&&l.push(jm({deviceId:u,ptzRange:d})),n!==u&&l.push(cm(u)),Object.prototype.hasOwnProperty.call(r,u)){const e=r[u];if(e){const t=Sw(e);t&&Vw.movePTZCamera(t)}}}else Rc(xu,{reason:"cannot find target camera"}),Vw.stopCaptureVideo();return Ue(l)}))),videoCaptureEpics1:(e,t)=>yn(e,as).pipe(mt((e=>{const{payload:{body:{update:o}}}=e,{meeting:{userId:n}}=t.value;return null==o?void 0:o.some((e=>e.id===n&&void 0!==e.bVideoOn))})),ze((e=>{const{payload:{body:{update:o}}}=e,{meeting:{userId:n}}=t.value,r=o.find((e=>e.id===n));return!0===r.bVideoOn?Rc(Gu):Rc(zu),pm(!!r.bVideoOn)}))),videoCaptureEpics2:e=>In(e,[Na.UserForbiddedCaptureVideo,Na.UserCameraIsTakenByOtherPrograms,Na.VideoWebsocketBroken,Na.StopVideoCaptureFailed]).pipe(Xe((e=>{const{payload:{type:t}}=e,o=[];switch(t){case Na.UserForbiddedCaptureVideo:Rc(Fu),o.push(mm(!0));break;case Na.UserCameraIsTakenByOtherPrograms:Rc(Hu,{reason:"User camera is taken by other programs."}),o.push(ym(!0));break;case Na.VideoWebsocketBroken:Rc(Wu,{reason:"Video websocket broken."});break;case Na.StopVideoCaptureFailed:Rc(zu,{failed:!0,reason:"Unknown."})}return Ue(o)}))),videoCaptureEpics3:(e,t)=>In(e,Na.StopVideoCaptureSuccess).pipe(Tt(t),Xf((e=>{let[,t]=e;const{meeting:{userId:o},video:{isCurrentUserStartedVideo:n}}=t;n||Rc(zu),Nw.muteAttendeeVideo(o,!0)}))),videoCaptureEpics4:(e,t)=>yn(e,16133).pipe(Tt(t),mt((e=>{var t,o;let[n,r]=e;return(null==n||null===(t=n.payload)||void 0===t||null===(o=t.body)||void 0===o?void 0:o.id)===r.meeting.userId})),Xf((e=>{let[t]=e;const{id:o,bVideoMute:n}=t.payload.body;return Rc(Nu,{id:o,isVideoMuted:n}),!0===n&&Vw.stopCaptureVideo(),!1===n&&Rc(Vu,{id:o,isVideoMuted:n}),gm(n)}))),videoCaptureEpics5:(e,t)=>yn(e,16131).pipe(mt((e=>void 0!==e.payload.body.ssrc)),_t((e=>{const{payload:{body:{ssrc:o}}}=e;return Rc(ld,o),ct(je(um(o)),kf(t).pipe(Xe((e=>{const{meeting:{isCurrentUserStartVideoBeforeReset:o},media:{videoEncodeStatus:n}}=t.value;return!0!==(null==e?void 0:e.bVideoOn)&&!0===o?Pf("video",n,"success").pipe(mt((e=>{let[t,o]=e;return t&&o})),ze((()=>{const e=t.value,{video:{backgroundMode:o,mask:n,virtualBackground:r,activeCamera:i,customizedVideoOption:s}}=e;let a=Promise.resolve(!0);return o===Eu.VirtualBackground&&r.imageSrc?a=Mw({imageUrl:r.imageSrc,cropped:r.cropped},Vw,e):o===Eu.Mask&&n.imageSrc&&n.clip&&(a=Lw({imageUrl:n.imageSrc,cropped:n.cropped,clip:n.clip,rootHeight:n.rootHeight,rootWidth:n.rootWidth},Vw,e)),a.then((()=>{gw(Vw,e,{cameraId:i,...s})})),li(void 0)}))):fe}))))}))),videoCaptureEpics6:(e,t)=>e.pipe($t(`${lm}`),Ot((e=>{const{payload:o}=e,n=t.value,{meeting:{userId:r}}=n,i=yp(n);0===o.length?i&&!i.bVideoConnect||Nw.connectCamera(r,!1):null!=i&&i.bVideoConnect||Nw.connectCamera(r,!0)})),Et(fe)),videoCaptureEpics7:e=>In(e,Na.InitSuccessVideo).pipe(mt((e=>!Gi.isIPad&&Gi.isAndroidOrIOSBrowser&&e.payload.data===Va.EncodeSuccess)),_t((()=>"orientation"in window.screen?st(screen.orientation,"change").pipe(Xe((()=>(Vw.setMobileRotateMode(Iw()),fe)))):st(window,"orientationchange").pipe(Xe((e=>{var t,o,n;const r=null===(t=e.target)||void 0===t||null===(o=t.screen)||void 0===o||null===(n=o.orientation)||void 0===n?void 0:n.angle,i=90===Math.abs(r);return Vw.setMobileRotateMode(i),fe})))))),videoCaptureEpics8:e=>In(e,Na.StartVideoCaptureSuccess).pipe(mt((()=>!Gi.isIPad&&Gi.isAndroidOrIOSBrowser)),Ot((()=>{Vw.setMobileRotateMode(Iw())})),Et(fe)),videoCaptureEpics9:(e,t)=>In(e,Na.VideoStreamFailed).pipe(mt((()=>!!t.value.video.isCurrentUserStartedVideo&&Gi.isIOSMobile)),Ot((()=>{Vw.stopCaptureVideo()})),Et(fe))},$w={videoRenderEpics0:e=>yn(e,16129).pipe(ze((e=>{const{payload:{body:{id:t,bVideoOn:o}}}=e,n=cw(t);return Rc(Lu,{bVideoOn:o,userId:n}),dm({bVideoOn:o,userId:n})}))),videoRenderEpics1:(e,t)=>In(e,Na.VideoDecodeMaxSize).pipe(mt((e=>{var t;return null==e||null===(t=e.payload)||void 0===t?void 0:t.data})),ze((e=>{const{size:o}=e.payload.data,{video:{renderedVideoList:n,receivedVideoMaxQuality:r}}=t.value,i=n.filter((e=>e.videoQuality>=qa.Video_720P));return r!==o&&i.length>0&&(o>=qa.Video_720P||r>=qa.Video_720P)&&i.forEach((e=>{Cw.subscribeVideo(e.userId,e.videoQuality,!1)})),vm(o)}))),videoRenderEpics2:e=>yn(e,16135).pipe(ze((e=>{const{payload:{body:{bLeadershipOn:t,id:o}}}=e,n=[];return t&&n.push(cw(o)),Rc(Ku,{spotlightList:n}),hm(n)}))),videoRenderEpics3:(e,t)=>yn(e,7958).pipe(Tt(t),ze((e=>{let[t,o]=e;const{payload:{body:n}}=t;let r=[];n&&n.group_list&&n.group_list[0]&&(r=n.group_list[0].map((e=>e.id)));const i=Ap(o);return r=r.filter((e=>i.findIndex((t=>t.userId===e))>=0)),Rc(Ku,{spotlightList:r}),hm(r)}))),videoRenderEpics4:e=>In(e,Na.CurrentVideoResolution).pipe(Xf((e=>(Rc(Uu,e.payload.data),bm(e.payload.data))))),videoRenderEpics5:e=>In(e,[Na.CurrentVideoResolution,Na.CurrentCaptureVideoWidthHeight]).pipe(mt((e=>!!e.payload.data)),ze((e=>{const{payload:{data:t,type:o}}=e;return o===Na.CurrentVideoResolution?(Rc(Uu,t),bm(t)):(Rc(ju,t),Qm(t))}))),videoRenderEpics6:e=>yn(e,us).pipe(mt((e=>{const{payload:{body:t}}=e;return["bFollowHostVideo","VideoHd","bCanUnmuteVideo"].some((e=>void 0!==t[e]))})),ze((e=>{const{payload:{body:{bFollowHostVideo:t,VideoHd:o,bCanUnmuteVideo:n}}}=e;if(void 0!==t)return Rc(qu,{bOn:t}),Am(t);if(void 0!==n)return Tm(n);{const e=1===o;return _w.updateVideoHDValue(e),_w.enableHardwareAccelerationForVideoEncode(!1),Rm(e)}}))),videoRenderEpics7:(e,t)=>yn(e,7957).pipe(Tt(t),ze((e=>{let[t,o]=e;const{video:{isFollowHostVideoLayout:n}}=o,{payload:{body:r}}=t,i=r&&r.drag_list&&r.drag_list.map((e=>e.id));return n&&Rc(Ju,{layout:i}),Cm(i)}))),videoRenderEpics8:(e,t)=>yn(e,as).pipe(Tt(t),mt((e=>{let[t,o]=e;const{meeting:{userId:n},video:{subscribedVideoList:r}}=o,i=t.payload.body.update,s=t.payload.body.remove;return i&&i.length>0&&i.findIndex((e=>e.id!==n&&(void 0!==e.bVideoOn||e.bHold)))>-1||s&&s.some((e=>r.includes(e.id)))})),Ot((e=>{let[t,o]=e;const{payload:{body:{remove:n,update:r}}}=t,{video:{subscribedVideoList:i}}=o,s=Ip(o);if(n&&n.length>0&&n.filter((e=>i.includes(e.id))).forEach((e=>{Rc(Zu,{userId:e.id})})),r&&r.length>0){const e=r.filter((e=>void 0!==e.bVideoOn)).filter((e=>-1===s.findIndex((t=>t.userId===e.id)))),t=r.filter((e=>!0===e.bHold));t.length>0&&t.filter((e=>i.includes(e.id))).forEach((e=>{Rc(Zu,{userId:e.id})})),e.forEach((e=>{e.bVideoOn?Rc(Qu,{userId:e.id}):i.includes(e.id)&&Rc(Zu,{userId:e.id})}))}})),Et(fe)),videoRenderEpics9:(e,t)=>In(e,Na.VideoQosData).pipe(Tt(t),ze((e=>{var t;let[o,n]=e;const{video:{isCaptureForbidden:r,isCameraTaken:i},media:{videoEncodeStatus:s,videoDecodeStatus:a}}=n,u=yp(n),d=Rp(n),l=d.length>0,c=(null==u?void 0:u.bVideoOn)&&!r&&!i,p=d.some((e=>e.bVideoOn)),h="success"===s&&c&&l,m="success"===a&&l&&p;return null!==(t=o.payload.data)&&void 0!==t&&t.encoding?h?(Rc(ed,o.payload),Mm(o.payload)):Mm(mu):m?(Rc(ed,o.payload),Lm(o.payload)):Lm(mu)}))),videoRenderEpics10:(e,t)=>In(e,[Na.CurrentDecodeVideoQuality,Na.CurrentDecodeVideoFps]).pipe(Ot((e=>{const{payload:{type:o,data:n}}=e,{video:{subscriptionStatus:r}}=t.value;if(r.detailed)if(o===Na.CurrentDecodeVideoQuality){const{ssrc:e,width:t,height:o,quality:r}=n;Rc(td,{userId:e,width:t,height:o,quality:r})}else if(o===Na.CurrentDecodeVideoFps){const{ssrc:e,fps:t}=n;Rc(td,{userId:e,fps:t})}})),Et(fe)),videoRenderEpics11:(e,t)=>An(e,t).pipe(Xe((async()=>Gi.isAndroidOrIOSBrowser?1:await Fs.isSupportVideoDecodeHardwareAcceleration()?4:1)),ze((e=>Om(e)))),videoRenderEpics12:(e,t)=>In(e,Na.NetworkQualityChange).pipe(mt((e=>!!e.payload.data)),Xe((e=>{var o;const{payload:{data:{bwLevel:n,isUplink:r,networkLevel:i}}}=e,s=[],{meeting:{userId:a},video:{networkQuality:u,subscribedVideoList:d,networkQualityBroadcastTime:l}}=t.value,c=r?"uplink":"downlink";s.push(Um({userId:a,level:i,bwLevel:n,type:c}));const p=gr(null===(o=u[`${a}`])||void 0===o?void 0:o[c],{level:i,bwLevel:n});if(!p&&-1!==i){(!r&&d.filter((e=>e!==a)).length>0||r)&&Rc(od,{userId:a,type:c,level:i})}if(r){const e=performance.now();(!p||e-(null!=l?l:0)>3e4)&&(Cw.broadcastUserNetworkQuality({isUplink:r,level:i,bwLevel:n}),s.push(zm(e)))}return Ue(s)}))),videoRenderEpics13:(e,t)=>En(e,8005).pipe(mt((e=>{var t;return!(null===(t=e.payload.body)||void 0===t||!t.nUserID)})),Xe((e=>{const{payload:{body:{nLevel:o,nUserID:n}}}=e,{video:{networkQuality:r}}=t.value,i=r[`${n}`],s=[];return i&&i.uplink.level===o||(Rc(od,{userId:n,level:o,type:"uplink"}),s.push(Um({userId:n,level:o,type:"uplink"}))),Ue(s)}))),videoRenderEpics14:(e,t)=>yn(e,as).pipe(mt((e=>{const{payload:{body:o}}=e,{video:{prefetchedVideo:n}}=t.value;return(null==n?void 0:n.userId)&&(o.update||o.remove)})),Xe((e=>{const{payload:{body:o}}=e,n=[],{video:{prefetchedVideo:r}}=t.value;let i=!1;return o.remove&&(i=-1!==o.remove.findIndex((e=>e.id===(null==r?void 0:r.userId)))),o.update&&(i=-1!==o.update.findIndex((e=>e.id===(null==r?void 0:r.userId)&&!1===e.bVideoOn))),i&&r&&(r.loaded||_w.cancelPrefetchVideoSsrc(r.userId),Cw.unsubscribeVideo(r.userId),n.push(Xm(void 0))),Ue(n)}))),videoRenderEpics15:(e,t)=>e.pipe($t(`${Xm}`),mt((e=>!!e.payload)),Ot((e=>{const{payload:{lastCopy:o}}=e,{video:{prefetchedVideo:n}}=t.value;!n||o&&o.userId===n.userId||(null!=o&&o.userId&&(o.loaded&&_w.cancelPrefetchVideoSsrc(o.userId),Cw.unsubscribeVideo(o.userId)),Cw.subscribeVideo(n.userId,qa.Video_360P,!1),_w.prefetchVideoSsrc(n.userId))})),Et(fe)),videoRenderEpics16:(e,t)=>In(e,Na.NewActiveSpeakerFirstFrameCallback).pipe(mt((()=>!!t.value.video.prefetchedVideo)),Xe((e=>{const{payload:{data:{ssrc:o}}}=e,{video:{prefetchedVideo:n}}=t.value,r=[];return n&&(fr(n.userId,o)?(r.push(Xm({userId:n.userId,loaded:!0,lastCopy:n})),Rc(dd,{userId:n.userId})):Cw.unsubscribeVideo(n.userId)),Ue(r)}))),videoRenderEpics17:(e,t)=>yn(e,16131).pipe(mt((e=>void 0!==e.payload.body.ssrc)),Ot((()=>{const{media:{videoDecodeStatus:e,videoEncodeStatus:o}}=t.value;Pf("video",o,e).subscribe((e=>{let[o,n]=e;const{video:{subscriptionStatus:r}}=t.value;o&&r.encode&&_w.subscribeToQos([Bs.VideoEncode],ru),n&&(r.decode&&_w.subscribeToQos([Bs.VideoDecode],ru),r.detailed&&_w.enableVideoObserver(!0))}))})),Et(fe)),videoRenderEpics18:(e,t)=>e.pipe($t(`${_m}`,`${wm}`),mt((()=>{const e=t.value.video.renderedVideoList.length;return[0,1].includes(e)})),Ot((()=>{const e=t.value.video.renderedVideoList.length;1===e?_w.enableVideoObserver(!0,!0):0===e&&_w.enableVideoObserver(!1)})),Et(fe)),videoRenderEpics19:(e,t)=>In(e,Na.CurrentDecodeVideoQuality).pipe(Xe((e=>{const{payload:{data:o}}=e,{video:{renderedVideoList:n,videoAttachments:r}}=t.value,i=[],{ssrc:s,width:a,height:u}=o,d=u?a/u:0,l=n.filter((e=>fr(e.userId,s)));if(l.some((e=>e.aspectRatio&&Math.abs(e.aspectRatio-d)>.2))){const e=l.filter((e=>e.canvasId===cu));if(e.length>0){const e=r[`${s}`];e&&e.every((e=>{if(e){const{clientWidth:t,clientHeight:o}=e,n=o?t/o:0;return Math.abs(n-d)<=.2}return!0}))&&i.push(_m({userId:s,key:su,canvasId:cu,aspectRatio:d}))}e.length===l.length&&0!==i.length||Rc(cd,{userId:s,aspectRatio:d})}return Ue(i)}))),videoRenderEpics20:(e,t)=>In(e,Na.SyncRendererTypeResponse).pipe(Xe((e=>{const{payload:{data:{rendererType:o}}}=e,{video:{rendererType:n}}=t.value,r=[];return n!==o&&r.push(sv(o)),Ue(r)})))},Ww=fn($w,Hw,{vbEpics0:e=>In(e,[Na.VbModelPreloadingOk,Na.VbModelPreloading_3S,Na.VbModelPreloading_10S,Na.VbSettingParaError]).pipe(Xe((e=>{const{payload:{type:t,data:o}}=e,n=[];return[Na.VbModelPreloadingOk,Na.VbModelPreloading_3S,Na.VbModelPreloading_10S].includes(t)?(n.push(Dm(!0)),Rc(Yu,!0),t===Na.VbModelPreloading_10S&&console.warn("Virtual Background is taking longer than expected to load.")):t===Na.VbSettingParaError&&(o===eu.VBModelNotMatch?(Rc(Yu,!1),n.push(Dm(!1))):(Rc(Xu,!1),n.push(Pm(!1)))),Ue(n)}))),vbEpics1:e=>In(e,Na.StartVideoStreamInVbSettingSuccess).pipe(ze((()=>(Rc(Xu,!0),Pm(!0))))),vbEpics2:e=>In(e,Na.StartVideoStreamInMaskSettingSuccess).pipe(ze((()=>(Rc(ad,!0),Km(!0))))),vbEpics3:e=>In(e,Na.MaskSettingParaError).pipe(ze((()=>(Rc(ad,!1),Km(!1)))))},Fw);class Gw{constructor(){this.assetsPath=void 0,this.instance=void 0,this.callbackList=void 0,this.mediaWorkersPath=void 0,this.mediaOptions=void 0,this.inProgress=void 0,this.callbackList=[]}static getInstance(){return void 0===this.agentInstance&&(this.agentInstance=new Gw),this.agentInstance}init(e,t){var o,n,r,i,s;if(!this.instance&&window.JsMediaSDK_Instance){const e={ivObj:{[Yi.AUDIO_ENCODE]:void 0,[Yi.VIDEO_ENCODE]:void 0,[Yi.SHARING_ENCODE]:void 0}};this.instance=new window.JsMediaSDK_Instance(e)}this.mediaWorkersPath=js(e,!1),this.onMediaSDKCallback=this.onMediaSDKCallback.bind(this),this.mediaOptions=t,null===(o=this.instance)||void 0===o||o.JsMediaSDK_PreLoad(this.mediaWorkersPath,this.onMediaSDKCallback,t);const a=Ji(null===(n=this.mediaOptions)||void 0===n?void 0:n.enableMultiDecodeVideoWithoutSAB);null===(r=this.instance)||void 0===r||r.setPropsBeforeInit({callback:this.onMediaSDKCallback,audioWorkerPath:null===(i=this.mediaWorkersPath)||void 0===i?void 0:i.audioWorkletPath,isEnableListenInitEvent:!0}),null===(s=this.instance)||void 0===s||s.initVideoEncode(this.mediaWorkersPath,"",0,!1,"",0,a,!1,!1,!0,!0,!1,!0),this.inProgress=!0}onMediaSDKCallback(e,t){this.callbackList.length>0&&this.callbackList.forEach((o=>o(e,t)))}registerCallback(e){this.callbackList.push(e)}unregisterCallback(e){this.callbackList=this.callbackList.filter((t=>t!==e))}async destroy(){var e;this.callbackList=[],await(null===(e=this.instance)||void 0===e?void 0:e.destroy()),this.instance=null,this.inProgress=!1}disconnect(){var e,t;null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(17,{}),null===(t=this.instance)||void 0===t||t.JsMediaSDK_UnInit()}startVirtualBackgroundSetting(e,t,o,n,r,i){var s;let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];null===(s=this.instance)||void 0===s||s.Notify_MeidaSDK(91,{canvas:e,bgdom:t,width:r,height:i,ssid:0,VideoSelectValue:"default"===n?null:n,disableOriginalRatio:a,usingFacingMode:["user","environment"].includes(n)})}updateVirtualBackgroundImage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(92,{bgdom:e})}stopVirtualBackgroundSetting(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(93,{isSwitch:t})}startMaskSetting(e,t,o,n,r,i,s,a,u){var d;null===(d=this.instance)||void 0===d||d.Notify_MeidaSDK(62,{canvas:e,maskdom:null,bgdom:null,dx:0,dy:0,dWidth:170,dHeight:170,width:1280,height:720,ssid:0,originWidth:379,originHeight:213,VideoSelectValue:"default"===r?null:r,usingFacingMode:["user","environment"].includes(r)})}stopMaskSetting(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=this.instance)||void 0===e||e.Notify_MeidaSDK(65,{isSwitch:t})}}Gw.agentInstance=void 0;const zw="PREVIEW_VIDEO_ENCODE_SUCCESS",Kw="PREVIEW_VIDEO_VB_MODEL_READY";async function qw(e,t,o){const{imageUrl:n,cropped:r,deviceId:i}=o;let s=Sr("__ZOOM_SDK_PREVIEW_VIRTUAL_BACKGROUND_CANVAS_@__");t.id?s=t.id:t.id=s;let[a,u]=[640,360];if(Fs.isSupportSending720P()&&(a=1280,u=720),n&&Ff(!1)){const t=await Tw(n,r);return e.startVirtualBackgroundSetting(s,t,0,null!=i?i:"default",a,u),t&&t!==tu&&setTimeout((()=>{Cf(t)}),0),"vb"}return e.startMaskSetting(s,null,null,0,null!=i?i:"default",0,0,0,0),"mask"}class Jw{constructor(){this.previewMediaAgent=Gw.getInstance(),this.isInit=void 0,this.isVideoEncoded=void 0,this.isVBModelReady=void 0,this.state=void 0,this.eventHandler=(e,t)=>{switch(e){case Na.InitSuccessVideo:t===Va.EncodeSuccess&&(this.isVideoEncoded=!0,Rc(zw));break;case Na.VbModelPreloadingOk:case Na.VbModelPreloading_3S:case Na.VbModelPreloading_10S:this.isVBModelReady=!0,Rc(Kw,!0);break;case Na.VbSettingParaError:t===eu.VBModelNotMatch&&(this.isVBModelReady=!1,Rc(Kw,!1))}}}static setMediaOption(e){Jw.mediaOption=e}setup(){if(Jw.mediaOption){if(Fs.getInstance().inProgress)return Promise.resolve("");if(!Gw.getInstance().inProgress){this.isVideoEncoded=void 0,this.isVBModelReady=void 0,this.previewMediaAgent.unregisterCallback(this.eventHandler);const{assetsPath:e,enforceMultipleVideos:t,enforceVirtualBackground:o}=Jw.mediaOption,n={...Wf(e,t,o)};this.previewMediaAgent.init(e,n),this.previewMediaAgent.registerCallback(this.eventHandler)}return Promise.resolve("")}return Promise.reject({type:Il,reason:"Cannot preview video with virtual background before `client.init` method."})}async startPreview(e,t){Fs.getInstance().inProgress?qw(Fs.getInstance(),e,t):(void 0!==this.isVBModelReady?Ue([this.isVBModelReady]):Dc(Kw,1)).subscribe((o=>{o&&(this.isVideoEncoded?Ue([!0]):Dc(zw,1)).subscribe((()=>{qw(Gw.getInstance(),e,t).then((o=>{this.state={mode:o,canvas:e,vb:t}}))}))}))}async stopPreview(){var e;Fs.getInstance().inProgress?Fs.getInstance().stopVirtualBackgroundSetting():"vb"===(null===(e=this.state)||void 0===e?void 0:e.mode)?Gw.getInstance().stopVirtualBackgroundSetting():Gw.getInstance().stopMaskSetting()}async updatePreview(e,t){const o=Fs.getInstance().inProgress?Fs.getInstance():Gw.getInstance();var n;if(e)if("mask"===(null===(n=this.state)||void 0===n?void 0:n.mode)){var r;Gi.isChrome?(await this.stopPreview(),await this.startPreview(this.state.canvas,{imageUrl:e,cropped:t,deviceId:null===(r=this.state.vb)||void 0===r?void 0:r.deviceId})):console.warn('use the `start` method with the virtual background image parameter instead of using `updateVirtualBackground` to preview the video." ')}else{const n=await Tw(e,t);n&&(o.updateVirtualBackgroundImage(n),n!==tu&&setTimeout((()=>{Cf(n)}),0))}else o.updateVirtualBackgroundImage(null)}}Jw.mediaOption=void 0;const{InitSuccessVideo:Qw,InitSuccessAudio:Zw,InitSuccessSharing:Yw,InitFailedVideo:Xw,InitFailedAudio:eR,InitFailedSharing:tR}=Na,oR=ab(Fs.getInstance()),nR=ob.getInstance().makeLogger(["Media Agent"]),rR=[Rf,Tf,Of].map((e=>Af(e,{hostname:!0}))),iR=[],sR={epics0:(e,t)=>e.pipe($t(`${Wr}`),_t((()=>{const{meeting:{isMeetingReset:o}}=t.value;return e.pipe($t(`${Yr}`),ft(1),ty((e=>{var n;const{logger:r,media:{mediaConstraints:i,assetsPath:s},meeting:{zlkJwtToken:a,cv:u}}=t.value,{payload:{disableAqos:d,disableVqos:l}}=e,c=null!=r&&null!==(n=r.options)&&void 0!==n&&n.enable?ob.getInstance().makeLogger(["MEDIA SDK"]):void 0;return function(e){const{media:{patchedMediaSDKStatus:t}}=e;return t===Ou.Loading?Fe(Dc(Fl,1)):Promise.resolve()}(t.value).then((()=>{const e=[];let t=!l;const n=!d;return a&&mr(u,"1.3.0")<0&&(t=!1),e.push(dn({audioQos:n,videoQos:t})),oR.init(function(e){return e?new Proxy(e,{get:(e,t)=>"string"==typeof t&&"error"===t?function(){try{var e;nb.report(arguments.length<=0?void 0:arguments[0],["MEDIA SDK",...null!==(e=arguments.length<=1?void 0:arguments[1])&&void 0!==e?e:[]],"error")}catch(e){}}:Reflect.get(e,t)}):e}(c)),e.push(pn(!0)),o&&void 0!==i&&void 0!==s&&e.push(Jo()),e}))})))}))),epics1:(e,t)=>e.pipe($t(`${Wr}`),mt((e=>{const{payload:{mediaSDKPath:o}}=e,{media:{skipJsMedia:n,patchJsMedia:r,assetsPath:i},meeting:{isMeetingReset:s}}=t.value;return!n&&rR.some((e=>new RegExp(`^https://${e}`).test(null!=i?i:"")))&&!!r&&!!o&&!s})),_t((e=>{const{payload:{mediaSDKPath:t}}=e,o=Ir(t);return Ue(new Promise(((e,t)=>{const n=`${o}/${wi}`;"JsMediaSDK_Instance"in window&&(window.JsMediaSDK_Instance_backup=window.JsMediaSDK_Instance,delete window.JsMediaSDK_Instance),If(n,(()=>{"JsMediaSDK_Instance_backup"in window&&delete window.JsMediaSDK_Instance_backup,nR.info(`patched media sdk url:${n}`),e("")}),(()=>{"JsMediaSDK_Instance_backup"in window&&(window.JsMediaSDK_Instance=window.JsMediaSDK_Instance_backup,delete window.JsMediaSDK_Instance_backup),nR.error(`cannot load patched media sdk :${n}`),t()}))}))).pipe(Xe((()=>(Rc(Fl),Ue([an(Ou.Done),un(o)])))),gt((()=>(Rc(Fl),Ue([an(Ou.Done)])))),Ct(an(Ou.Loading)))}))),epics2:(e,t)=>An(e,t).pipe(Ot((()=>{const{media:{assetsPath:e,mediaConstraints:o,fileWithVersion:n,enforceMultipleVideos:r,enforceVirtualBackground:i,isEnableDecoderInWorklet:s},meeting:{isAudioBridgeEnabled:a}}=t.value;if(oR.notifySDKMeetingReady(),e&&o){const t={enableDecoderInWorklet:s,enableAudioBridge:a&&zi()};Object.assign(t,Wf(e,r,i)),oR.setAssetsAndConstraint(e,o,n,t)}kf(t).pipe(_t((e=>Ue(qf.acquire().then((()=>e)))))).subscribe((e=>{const{meeting:{svcUrl:o,meetingNumber:n,conId:r,e2eEncrypt:i,userId:s,isWebinar:a,enableWebtransport:u,webtransportPort:d},media:{enableAudioQos:l,enableVideoQos:c,alternativeNameForVideoPlayer:p,adaptedABOptionForMediaSDK:h},video:{rendererType:m}}=t.value;e&&(oR.connect({svcUrl:o,meetingNumber:n,conId:r,e2eEncrypt:i,isViewOnly:rp(e.userRole),currentUserId:s,isWebinar:a,enableAudioQos:l,enableVideoQos:c,enableWebtransport:u,webtransportPort:d,rendererType:m,adaptedABOptionForMediaSDK:h}),function(e){var t;let o="video-player";e.tagName&&(o=e.tagName,LI.dispatch("",{tagName:e.tagName}),ZI(null===(t=e.mediaSDK)||void 0===t?void 0:t.call(e),`VPTN:${o}`));const n=`${o}-container`,r=e.sessionId||KI();LI.get("mediaSDKInstanceMap").set(UI,e.mediaSDK),LI.get("mediaSDKInstanceMap").set(r,e.mediaSDK),e.failover&&LI.dispatch("failover",void 0,e.sessionId||UI),customElements.get(n)||customElements.define(n,yA),customElements.get(o)||customElements.define(o,vA)}({mediaSDK:()=>oR.instance,tagName:p,failover:"1"}))}))})),_t((()=>ut((e=>oR.registerCallback(e)),(e=>oR.unregisterCallback(e)),((e,t)=>({type:e,data:t}))).pipe(ze((e=>Qo(e))))))),epics3:e=>In(e,[Qw,Zw,Yw,Xw,eR,tR]).pipe(ey((e=>{const{payload:{type:t,data:o}}=e;if(t===Zw||t===eR){if(o===Va.EncodeSuccess)return Rc(Ol),je(Zo("success"));if(o===Va.DecodeSuccess)return Rc(Tl),je(Yo("success"));if(o===Va.EncodeFailed)return Rc(Ll),je(Zo("failed"));if(o===Va.DecodeFailed)return Rc(Nl),je(Yo("failed"))}else if(t===Qw||t===Xw){if(o===Va.EncodeSuccess)return Rc(Dl),je(Xo("success"));if(o===Va.DecodeSuccess)return Rc(Pl),je(en("success"));if(o===Va.EncodeFailed)return Rc(Vl),je(Xo("failed"));if(o===Va.DecodeFailed)return Rc(Ul),je(en("failed"))}else if(t===Yw||t===tR){if(o===Va.EncodeSuccess)return Rc(kl),je(tn("success"));if(o===Va.DecodeSuccess)return Rc(Ml),je(on("success"));if(o===Va.EncodeFailed)return Rc(jl),je(tn("failed"));if(o===Va.DecodeFailed)return Rc(Bl),je(on("failed"));if(t===Yw&&void 0===o)return Rc(Ml),je(on("success"))}}))),epics4:(e,t)=>In(e,[Qw,Zw]).pipe(_t((()=>"object"==typeof navigator.mediaDevices?ct(Lf(),ct(In(e,Na.StartVideoCaptureSuccess),st(navigator.mediaDevices,"devicechange"),In(e,Na.UserGrantCaptureAudio).pipe(mt((()=>!t.value.audio.isUserGrantCaptureAudio)))).pipe(Xe((()=>Lf().pipe(Ot((()=>{setTimeout((()=>{Rc(xl)}),50)}))))))).pipe(Tt(t),Xe((e=>{let[t,o]=e;const n=[$p(t.microphones),Wp(t.speakers),lm(t.cameras)];if(o.audio){const{audio:{activeMicrophone:e,activeSpeaker:s,microphoneDevicesList:a,speakerDevicesList:u}}=o,d=yp(o),{microphones:l,speakers:c}=t,p=a.filter((e=>-1===l.findIndex((t=>t.deviceId===e.deviceId)))),h=u.filter((e=>-1===c.findIndex((t=>t.deviceId===e.deviceId))));if(p.length>0){if(zf(p[0],e,a)){const e=Kf(l);oR.changeMicrophone("default",null==e?void 0:e.label,!(null==d||!d.muted)),n.push(Gp("default"))}}else if("default"===e){const e=Kf(a),t=Kf(l);a.length>0&&(null==e?void 0:e.label)!==(null==t?void 0:t.label)&&oR.changeMicrophone("default",null==t?void 0:t.label,!(null==d||!d.muted))}var r,i;h.length>0?zf(h[0],s,u)&&(oR.changeSpeaker("default"),n.push(zp("default"))):"default"===s&&u.length>0&&(null===(r=Kf(u))||void 0===r?void 0:r.label)!==(null===(i=Kf(c))||void 0===i?void 0:i.label)&&oR.changeSpeaker("default")}return Ue(n)}))):fe))),epics5:(e,t)=>En(e,as).pipe(Ot((e=>{const{type:o,payload:{body:n}}=e,r=o===`${Ho}`;if(n.add){const e=n.add.map((e=>({userid:e.id,sn:e.zoomID&&pr(e.zoomID)})));if(!r){const{meeting:{gcmSessinKey:o}}=t.value;oR.sendUserNodeList(e,o)}oR.updateUserMediaSN({added:e,isFromMainSession:r,iVType:Yi.SHARING_DECODE}),r&&oR.updateUserMediaSN({added:e,isFromMainSession:r,iVType:Yi.AUDIO_DECODE})}if(n.remove&&n.remove.length>0){if(!r){const{meeting:{gcmSessinKey:e}}=t.value;oR.sendUserNodeList(n.remove.map((e=>({userid:e.id,bremove:!0}))),e)}oR.updateUserMediaSN({removed:n.remove.map((e=>e.id)),isFromMainSession:r,iVType:Yi.SHARING_DECODE}),r&&oR.updateUserMediaSN({removed:n.remove.map((e=>e.id)),isFromMainSession:r,iVType:Yi.AUDIO_DECODE})}})),Et(fe)),epics6:e=>In(e,Na.AesGcmIvResponse).pipe(Ot((e=>{const{payload:{data:{workerType:t,iv:o}}}=e,n=Ni.get(Vi.WebclientIVState);if(n){const e={...n,[t]:o};Ni.set(Vi.WebclientIVState,e,Mi.SessionStorage)}})),Et(fe)),epics7:e=>e.pipe($t(`${Uo}`),mt((e=>[ds,ls,ss].includes(e.payload.evt))),ze((e=>{const{payload:{evt:t,body:{encryptKey:o,additionalType:n}}}=e;return rn({type:t===ds?"audio":t===ls?"video":"sharing",encryptKey:o,additionalType:n})}))),epics8:e=>e.pipe($t(`${nn}`),Ot((e=>{const{payload:t}=e;Jw.setMediaOption({assetsPath:t.assetsPath,enforceMultipleVideos:t.enforceMultipleVideos,enforceVirtualBackground:t.enforceVirtualBackground})})),Et(fe)),epics9:e=>e.pipe($t(`${Ur}`,`${Vr}`),Ot((()=>{Gw.getInstance().inProgress&&(Gw.getInstance().disconnect(),qf.watch(Gw.getInstance().destroy()))})),Et(fe)),epics10:e=>e.pipe($t(`${Ur}`,`${Vr}`),_t((()=>"permissions"in navigator?["microphone","camera"].map((e=>{navigator.permissions.query({name:e}).then((t=>{const o=()=>{Rc(Wl,{name:e,state:t.state})};o(),t.addEventListener("change",o),iR.push((()=>{t.removeEventListener("change",o)}))})).catch((()=>{}))})):fe)),Et(fe)),epics11:e=>e.pipe($t(`${ui}`),mt((e=>e.payload===Ti.Closed)),Ot((()=>{iR.length>0&&(iR.forEach((e=>e())),iR.length=0)})),Et(fe))},aR=fn(sR),uR={meeting:YE,socket:EI,participants:TI,media:MI},dR=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||Bt;function lR(e){return function(e){for(var t=Object.keys(e),o={},n=0;ne.userId===t));if(r.findIndex((e=>e===IR.Attendee))>-1&&(i=Ep(n).find((e=>e.userId===t))),!i)return Promise.reject({type:Rl,reason:"no matching user"});{const{meeting:{userId:e}}=o.getState();for(let o=0;o1?n-1:0),s=1;st.includes(o+1)?YS(e):e)):r)||void 0===a?void 0:a.map((e=>wr(e)));return o.info(`${n},params:${JSON.stringify(s)}`),i.apply(this,r).then((e=>(o.info(`${n} success`),e))).catch((t=>{let o=`${n},params:${JSON.stringify(s)},return failed,`;return"object"==typeof t&&(o=`${o},${t.type?`type:${t.type},`:""}${t.reason?`reason:${t.reason}`:""}`),CR.report(o,`${e} exception flow`,"error"),Promise.reject(t)}))}catch(e){}return i.apply(this,r)}}}function wR(e,t,o){return function(n,r,i){const s=i.value;i.value=function(){for(var n,r,i=arguments.length,a=new Array(i),u=0;ud instanceof e))||o&&!o.every((e=>!!d[e]))?Promise.reject({type:Rl,reason:`Expected to accept ${null===(n=l)||void 0===n?void 0:n.map((e=>e.name)).join(" or ")}, but actual it is ${"object"==typeof d&&null!==d?null===(r=Object.getPrototypeOf(d))||void 0===r?void 0:r.constructor.name:d}`}):s.apply(this,a)}}}class RR{constructor(e){this[pR]=void 0,this[mR]=void 0,this[hR]=void 0,this[vR]=void 0,this[pR]=e,this[mR]=e.dispatch,this[hR]=e.getState}}const OR=["userId","displayName","audio","isHost","avatar","bRaiseHand","bHold","bVideoOn","sharerOn","sharerPause","feedback","bLocalRecord","strPronoun","sdkKey","audioConnectionStatus","caps","bAllowISORecord","bVideoConnect","userIdentity","isSpeakerOnly","bVideoShare","bShareAudioOn","bShareToBORooms","bid",{from:"bInFailover",to:"isInFailover"},{from:"userGUID",to:"userGuid"},{from:"bGuest",to:"isGuest"},{from:"sharerPause",to:"sharePause"},{from:"bCoHost",to:e=>({isCoHost:!!e})},{from:"muted",to:(e,t)=>({muted:null!=t&&t.isSpeakerOnly||""===(null==t?void 0:t.audio)?void 0:e})},{from:"userType",to:(e,t)=>{const o=op(e),n={isPhoneUser:o};return o&&null!=t&&t.phoneNumber&&Object.assign(n,{phoneNumber:t.phoneNumber}),n}}];function TR(e){return OR.reduce(((t,o)=>{const n="string"==typeof o?o:o.from,r=function(e,t,o){if("string"==typeof e)return{[`${e}`]:t};if("object"==typeof e&&void 0!==e.from){const{to:n}=e;return"string"==typeof n?{[`${n}`]:t}:n(t,o)}}(o,e[n],e);return{...t,...r}}),{})}function DR(){const{isSupportAudioWorklet:e,isSupportEssentialAudioAndVideoAbility:t,isAndroidOrIOSBrowser:o,isSupportSendScreenSharing:n}=Gi;return{audio:t&&e||o,video:t&&void 0!==navigator.mediaDevices&&void 0!==navigator.mediaCapabilities,screen:t&&n}}const PR=e=>{let{breakoutRoom:{mainSessionAttendeeList:t}}=e;return t},kR=qc([e=>{let{breakoutRoom:{controlStatus:t}}=e;return t},e=>{let{breakoutRoom:{currentRoom:{status:t}}}=e;return t},e=>{let{breakoutRoom:{currentRoom:{boId:t}}}=e;return t}],((e,t,o)=>!(e!==sp.InProgress&&e!==sp.Closing||t!==up.InRoom&&t!==up.TimeUp||!o))),MR=qc([e=>{let{breakoutRoom:{rooms:t}}=e;return t},Jc,e=>{let{meeting:{zoomId:t}}=e;return t},PR,kR,e=>{let{breakoutRoom:{isHugeBO:t}}=e;return t}],((e,t,o,n,r,i)=>{const s=e.reduce(((e,t)=>{const{attendeeGuidList:o}=t;return e.concat(o)}),[]);return(r?n:t).filter((e=>{return!(e.bHold||e.isHost||e.zoomID===o||e.bid||s.includes(e.userGUID)||i&&(t=e.caps,4!=(4&t)));var t}))})),LR=qc([kR,PR,Ap],((e,t,o)=>e?t.find((e=>e.isHost)):o.find((e=>e.isHost))));var NR,VR,UR,jR;const BR=Ls.createAgent();let xR=(NR=AR(IR.Other),VR=AR(IR.Other),UR=AR(IR.Other),jR=class extends RR{constructor(e){super(e),this.modules=void 0,this.useSDK=void 0,this.useSDK=!1,this.modules=new Map}initWithSDK(e,t,o){return this.useSDK=!0,this.init(e,t,o)}init(e,t,o){const{audio:n,video:r}=DR();if(!n||!r)return console.error("https://developers.zoom.us/docs/video-sdk/web/browser-support"),Promise.reject({type:Il,reason:"Please update to the latest Chrome, Edge, Safari, or Firefox, as your current browser doesn't support audio/video. Retry after the upgrade."});const{[mR]:i,[pR]:s}=this;let a=Of;const u=(null==o?void 0:o.fileWithVersion)||!1;let d="en-US",l=`${Of}/${wi}`;if(o){const{dependentAssets:e,additionalFeatures:t,constraints:n,language:r,webEndpoint:i}=o;r&&(d=r),i&&function(e){_f=Af(e,{hostname:!0})}(i),e===Ri.CDN||e===Rf?(a=Rf,l=`${Rf}/${wi}`):e===Ri.Global||e===Of?(a=Of,l=`${Of}/${wi}`):e===Ri.CN||e===Tf?(a=Tf,l=`${Tf}/${wi}`):e&&/^https?:\/\//.test(e)&&(a=Ir(e),l=u?`${a}/1506_js_media.min.js`:`${a}/${wi}`),t&&Array.isArray(t)&&t.forEach((e=>{if(this[vR][e]&&void 0===s.getState()[e]){const{epic:t,reducer:o,Client:n}=this[vR][e];s.injectReducer(e,o),s.injectEpic(t);const r=new n(s);this.modules.set(e,r)}})),null!=n&&n.audio&&void 0===s.getState().audio&&(s.injectReducer("audio",HA),s.injectEpic(GA)),null!=n&&n.video&&void 0===s.getState().video&&(s.injectReducer("video",xw),s.injectEpic(Ww)),null!=n&&n.screen&&void 0===s.getState().share&&(s.injectReducer("share",SE),s.injectEpic(IE))}return i(Kr({apiKey:e,signature:t,language:d,useSDK:this.useSDK})),i(nn({mediaConstraints:o&&o.constraints||{},assetsPath:a,fileWithVersion:u,enforceMultipleVideos:null==o?void 0:o.enforceMultipleVideos,enforceVirtualBackground:null==o?void 0:o.enforceVirtualBackground,skipJsMedia:null==o?void 0:o.skipJsMedia,patchJsMedia:null==o?void 0:o.patchJsMedia,alternativeNameForVideoPlayer:null==o?void 0:o.alternativeNameForVideoPlayer})),void 0!==(null==o?void 0:o.stayAwake)&&i(yi(o.stayAwake)),void 0!==(null==o?void 0:o.quicklyLeaveMeeting)&&i(Ii(o.quicklyLeaveMeeting)),new Promise(((e,t)=>{null!=o&&o.skipJsMedia?e(""):If(l,(()=>{e("")}),(()=>{t({type:Rl,reason:"dependent assets are not accessible"})}))}))}on(e,t){((e,t)=>{const o=Ac[e];if(o){const n=_c.get(e);if(n)n.push(t),_c.set(e,n);else{const n=[t];_c.set(e,n);const r=ct(...o.map((e=>{const{event:t,payload:o}=e;return st(Cc,t).pipe(ze((e=>o(e))),Le(pe))}))).subscribe((t=>{const o=_c.get(e);o&&o.forEach((e=>{e(t)}))}));wc.push(r)}}})(e,t)}off(e,t){((e,t)=>{if(Ac[e]){const o=_c.get(e);if(Array.isArray(o)){const n=o.filter((e=>e!==t));_c.set(e,n)}}})(e,t)}getFeatureModule(e){return this.modules.get(e)}leave(){const{[hR]:e,[mR]:t}=this;return"connected"===e().socket.zoomSocketStatus?t(xr()):t(Fr()),Fe(dt(500).pipe(yt("")))}end(){const{[hR]:e,[mR]:t}=this;return"connected"===e().socket.zoomSocketStatus?(t(Hr()),Fe(dt(500).pipe(Ot((()=>{Pc()})),yt("")))):Promise.resolve("")}changeName(e,t){const o=this[pR].getState(),{meeting:{bAllowAttendeeRename:n}}=o,r=yp(o),i=rp(r.userRole),s=Sp(o);if(i)return Promise.reject({type:_l});if(t&&t!==(null==r?void 0:r.userId)){if(s){const{participants:{attendeesList:n}}=o,r=n.find((e=>e.userId===t));if(r)return BR.rename(t,ur(e),ur(r.displayName)),Qf(t,(t=>t.displayName===e));{const n=Ep(o).find((e=>e.userId===t));if(n){const t=OE.getInstance();return BR.rename(n.userId,ur(e),ur(n.displayName)),t.rename(n.jid,e),Tc(Ks,(t=>{const o=t.find((e=>e.jid===n.jid));return o&&o.displayName===e}))}return Promise.reject({type:Rl,reason:"no matching user"})}}return Promise.reject({type:_l})}return e===r.displayName?Promise.resolve():s||n?(BR.rename(r.userId,ur(e),ur(r.displayName)),Tc($s,(t=>t.displayName===e))):Promise.reject({type:_l,reason:"host disallow rename themselves"})}makeHost(e){return BR.assignHost(e,!1),Qf(e,(e=>!0===e.isHost))}makeCoHost(e){const t=this[pR].getState(),o=Ap(t).find((t=>t.userId===e));return!0===(null==o?void 0:o.bCoHost)?Promise.reject({type:Rl,reason:`user:[${e}] is already co-host `}):(BR.assignHost(e,!0),Qf(e,(e=>!0===e.bCoHost)))}revokeCoHost(e){const t=this[pR].getState(),o=Ap(t).find((t=>t.userId===e));return!1===(null==o?void 0:o.bCoHost)?Promise.reject({type:Rl,reason:`user:[${e}] is not a co-host`}):(BR.revokeCoHost(e),Qf(e,(e=>!1===e.bCoHost)))}reclaimHost(){const e=this[hR](),{meeting:{isOriginHost:t}}=e,o=yp(e);return null!=o&&o.isHost?Promise.resolve(""):t?(BR.reclaimHost(o.userId,!1),Tc($s,(e=>!0===e.isHost))):Promise.reject({type:_l,reason:"You are not the origin host"})}isHost(){const e=this[pR].getState(),t=yp(e);return!!t&&t.isHost}isCoHost(){const e=this[pR].getState(),t=yp(e);return!!t&&!!t.bCoHost}isOriginHost(){const{meeting:{isOriginHost:e}}=this[hR]();return e}getCurrentUserInfo(){const e=this[pR].getState(),t=yp(e);if(t){const o=TR(t);if(e.meeting.isWebinar&&rp(t.userRole)){const{audio:t}=e,n=null==t?void 0:t.isAllowToTalk;Object.assign(o,{isAllowToTalk:n})}if(e.breakoutRoom&&kR(e)){const{breakoutRoom:{currentRoom:{boId:t}}}=e;Object.assign(o,{bid:t})}return o}return null}getParticipantsList(){const e=this[pR].getState(),{meeting:{meetingStatus:t}}=e,o=yp(e);if(t===Ti.Joined&&o&&!o.bHold){var n,r;const t=e.breakoutRoom&&kR(e)?null===(n=e.breakoutRoom)||void 0===n||null===(r=n.currentRoom)||void 0===r?void 0:r.boId:"";return Ap(e).map((e=>{const o=TR(e);return t&&Object.assign(o,{bid:t}),o}))}return[]}getAssistantsList(){const e=this[pR].getState(),{meeting:{meetingStatus:t}}=e,o=yp(e);return t===Ti.Joined&&o?Cp(e).map((e=>({userId:e.userId,displayName:e.displayName,isNewAst:!0}))):[]}getMeetingHost(){var e;const t=this[hR]();let o=_p(t);return o||(null===(e=t.breakoutRoom)||void 0===e?void 0:e.currentRoom.status)!==up.InRoom||(o=t.breakoutRoom.mainSessionAttendeeList.find((e=>e.isHost))),void 0!==o?TR(o):null}getMeetingInfo(){const{meeting:{meetingStatus:e,isOnHold:t,meetingNumber:o,passWord:n,userName:r,userEmail:i,meetingTopic:s,meetingOptions:a,encType:u,region:d,network:l,topic:c,zlkJwtToken:p,userId:h,lang:m,inviteEmail:v,meetingId:g,participantID:f,h323Password:y,recordingDisclaimer:S,recordingDisclaimerForRecorder:b,wrInfo:E,meetingInfo:I,isNewJoinFlow:A}}=this[hR](),C=e===Ti.Joined&&!t;if(p)return{topic:c,password:n,userName:r,isInMeeting:C,userId:h,meetingId:g};{let e="";return 0===u?e="None":1===u?e="AES ECB":2===u&&(e="AES GCM"),{meetingNumber:o,password:n,userName:r,userEmail:i,inviteEmail:v,meetingTopic:s,encryptionType:e,region:d,network:l,isInMeeting:C,userId:h,lang:m,webEndpoint:Df(),meetingId:g,participantId:f,telPwd:y,recordingInfo:{recordingDisclaimer:S,recordingDisclaimerForRecorder:b,isUserEnableRecordingReminder:null==a?void 0:a.isUserEnableRecordingReminder},wrInfo:Object.assign({},E,{isNew:A}),scheduleInfo:I}}}},cR(jR.prototype,"end",[SR,fR],Object.getOwnPropertyDescriptor(jR.prototype,"end"),jR.prototype),cR(jR.prototype,"changeName",[fR],Object.getOwnPropertyDescriptor(jR.prototype,"changeName"),jR.prototype),cR(jR.prototype,"makeHost",[NR,SR,fR],Object.getOwnPropertyDescriptor(jR.prototype,"makeHost"),jR.prototype),cR(jR.prototype,"makeCoHost",[VR,SR,fR],Object.getOwnPropertyDescriptor(jR.prototype,"makeCoHost"),jR.prototype),cR(jR.prototype,"revokeCoHost",[UR,SR,fR],Object.getOwnPropertyDescriptor(jR.prototype,"revokeCoHost"),jR.prototype),cR(jR.prototype,"reclaimHost",[fR],Object.getOwnPropertyDescriptor(jR.prototype,"reclaimHost"),jR.prototype),jR);const FR=Ls.createAgent(),HR=OE.getInstance(),$R=(e,t,o)=>{const n=null==t?void 0:t.userId;if(null==e||!e.zoomID||null==t||!t.displayName||n===e.userId)return{type:Rl,reason:"invalid target user"};const{chat:{chatPrivilege:r,panelistChatPrivilege:i},meeting:{isWebinar:s}}=o,a=Sp(o),u=t.isHost||t.bCoHost;let d=!1;if(!a){if(s)if(rp(e.userRole))(r===vs.NoAttendee||r===vs.AllPanelist&&n!==fs.Panelist||r===vs.All&&n!==fs.All&&n!==fs.Panelist)&&(d=!0);else{const e=rp(null==t?void 0:t.userRole);(i===gs.Invalid||i===gs.AllPanelist&&(e||n===fs.All))&&(d=!0)}else(r===vs.NoAttendee||r===vs.Host&&!u||n===fs.SilentModeUsers||r===vs.EveryonePublicly&&n!==fs.All&&!u)&&(d=!0);if(d)return{type:_l,reason:"Insufficient chat privilege"}}return null};function WR(e,t){if(t===fs.All)return Cs;if(t===fs.Panelist)return _s;if(t===fs.SilentModeUsers)return ws;{const{meeting:{isWebinar:o},participants:{xmppAttendeeList:n,attendeesList:r}}=e;return o?r.find((e=>e.userId===t))||n.find((e=>e.userId===t)):r.find((e=>e.userId===t))}}function GR(e,t,o){if(null!=o&&o.host)return[_p(e),...wp(e)].filter((e=>(null==e?void 0:e.userId)!==t)).map((e=>({userId:null==e?void 0:e.userId,displayName:null==e?void 0:e.displayName,isHost:null==e?void 0:e.isHost,isCoHost:null==e?void 0:e.bCoHost})));{let n=[_p(e),...wp(e),...e.participants.attendeesList.filter((e=>!(e.bCoHost||e.isHost||e.bHold)))];if(null!=o&&o.includeAttendee){const t=Ep(e).filter((e=>!op(e.userType)));n=[...n,...t]}return n.filter((e=>void 0!==e&&e.userId!==t)).map((e=>({userId:null==e?void 0:e.userId,displayName:null==e?void 0:e.displayName,isHost:null==e?void 0:e.isHost,isCoHost:null==e?void 0:e.bCoHost})))}}function zR(e){const{text:t,destId:o,sn:n,attendeeId:r}=e;return rs.beginEncrypt({text:t,type:es.RWG_CHAT}).then((e=>{FR.chat(e,o,n,r)}))}function KR(e,t){const{chat:{chatHistory:o}}=t;return o.find((t=>{var o,n;return(null===(o=t.file)||void 0===o||null===(n=o.upload)||void 0===n?void 0:n.uniqueId)===e}))}function qR(e,t){const{meeting:{isWebinar:o},participants:{attendeesList:n}}=t,{destNodeID:r,senderName:i,attendeeNodeID:s}=e,a=n.find((e=>e.userId===r)),u=e.sn?e.sn:null==a?void 0:a.zoomID,d=i?dr(i):null==a?void 0:a.displayName;let l,c="";if(s===fs.SilentModeUsers)return{sender:{name:"Host",userId:r},receiver:{name:"Everyone (in Waiting Room)",userId:s},timestamp:(new Date).getTime()};if(s===fs.All)c=o?"All panelists and attendees":"Everyone";else if(s===fs.Panelist)c="All panelists";else{if(o){const e=Ep(t).find((e=>e.userId===s));e&&(c=e.displayName)}if(!c){const e=n.find((e=>e.userId===s));e&&(c=e.displayName,l=e.userGUID)}}return{sn:u,sender:{name:d,userId:r,userGuid:null==a?void 0:a.userGUID,avatar:null==a?void 0:a.avatar},receiver:{name:c,userId:s,userGuid:l},timestamp:(new Date).getTime()}}function JR(e){var t;const[o]=e.split(".").reverse();return null!==(t=Ps[o])&&void 0!==t?t:""}function QR(e,t){const o=[];for(let n=e.length-1;n>=0;n--){const r=e[n];if(!r.file&&(!r.id&&r.sender.userId===t.userId&&[fs.All,fs.Panelist,fs.IndividualCcPanelist,t.destNodeID].includes(r.receiver.userId)&&o.unshift(r),r.id))break}return o.length>0?o[0]:null}const ZR=ob.getInstance(),YR=ZR.makeLogger(["File Transfer"]);function XR(e,t,o){const{name:n,size:r}=e,{meeting:{reportDomain:i,svcUrl:s,conId:a}}=o;return`https://${i}${t}?${new URLSearchParams({filename:n,filesize:r,rwg:s,cid:a}).toString()}`}function eO(e,t){return t.fileObj?`${e}/zoomfile/download?objkey=${t.fileObj}`:`${e}/file/${t.fileID}`}function tO(e,t){return{fileName:e.name,fileSize:e.size,receiverId:null==t?void 0:t.userId,receiverGuid:null==t?void 0:t.userGuid}}function oO(e,t,o){ZR.report(`${e}. file name:${YS(t.name)},file size:${t.size}, ${"type"in t?`file type:${t.type}`:""}, error:${o.name};${o.message}`,["File Transfer"])}function nO(e){var t,o,n;return{id:e.id,fileName:null===(t=e.file)||void 0===t?void 0:t.name,fileSize:null===(o=e.file)||void 0===o?void 0:o.size,fileUrl:null===(n=e.file)||void 0===n?void 0:n.fileUrl,senderId:e.sender.userId,senderGuid:e.sender.userGuid}}function rO(e,t,o){return new Promise(((n,r)=>{const i=new FileReader;i.readAsArrayBuffer(e.slice(t,o)),i.onload=e=>{var t;return n(null===(t=e.target)||void 0===t?void 0:t.result)},i.onerror=e=>r(e)}))}async function iO(e,t){let[o,n]=[e.size,0];null!=t&&(o=Math.min(Os.ChunkSize,e.size-t),n=t);const r=e.size-n<=Os.ChunkSize,i=Math.ceil(o/Os.EncodeBlockSize);try{return function(e){const t=e.reduce(((e,t)=>e+t.byteLength),0),o=new Uint8Array(t);let n=0;for(const t of e)o.set(new Uint8Array(t),n),n+=t.byteLength;return o}(await Promise.all(Array.from({length:r?Math.max(i-1,1):i},((e,t)=>({start:t*Os.EncodeBlockSize+n,end:(r&&t===i-2?t+2:t+1)*Os.EncodeBlockSize+n}))).map((async o=>{let{start:n,end:r}=o;try{const t=await rO(e,n,r);return t?await rs.beginEncrypt({text:new Uint8Array(t),type:es.CHAT_FILE}):Promise.reject(null)}catch(o){return oO(`encrypt file buffer error. offset:${t},`,e,o),Promise.reject(o)}}))))}catch(e){console.warn(e)}return null}function sO(e,t,o,n){return n.pipe($t(`${kv}`,`${No}`),mt((n=>{if(n.type===`${No}`)return!0;const{payload:{uniqueId:r,fileName:i,userId:s}}=n;return t===r&&e.name===i&&o.userId===s})),Ot((n=>{YR.info(`Cancel file upload. file name:${YS(e.name)},file size:${e.size},receiver id:${o.userId}`),Rc(ma,{...tO(e,o),progress:0,status:Ts.Cancel,retryToken:n.type===`${kv}`?t:void 0})})))}function aO(e,t){if(null!=e&&e.file){const{file:o,receiver:n}=e,{upload:{chunkIndex:r,totalChunks:i,uniqueId:s}}=o;return Rc(ma,{...tO(t,n),progress:Math.floor((null!=r?r:0)/(null!=i?i:1)*100),status:Ts.Fail,retryToken:s}),Ue([Pv({upload:{status:Ts.Fail,progress:0,uniqueId:s}}),Mv({uniqueId:s,file:t})])}return fe}function uO(e,t){return Rc(ma,{...tO(e),progress:0,status:Ts.Fail}),je(Pv({upload:{status:Ts.Fail,progress:0,uniqueId:t}}))}async function dO(e,t,o,n){const r=XR(e,"/wc/fileupload",n.value),i=new FormData;try{const s=await iO(e),a=KR(t,n.value);if(s&&a){i.append("file",new File([s],e.name));const{meeting:{zmk:u}}=n.value,{receiver:d}=a;return UE({url:r,method:"POST",headers:{"Zoom-File-Origin":"redirect=support_auth",zmk:u},crossDomain:br(r),body:i,includeUploadProgress:!0}).pipe(wt(sO(e,t,d,o)),Xe((o=>{const{type:r,loaded:i,responseHeaders:s,total:a}=o;let u=0,l=Ts.InProgress;const c={upload:{uniqueId:t}},p=[];if("upload_loadstart"===r)u=0;else if("upload_progress"===r)u=Math.floor(i/a*100*.9);else if("upload_load"===r)u=90;else if("download_load"===r){var h,m;u=100,l=Ts.Success;const{chat:{fileServerDomain:e}}=n.value,t=null===(h=s["zoom-file-id"])||void 0===h?void 0:h.trim(),o=null===(m=s["zoom-file-obj"])||void 0===m?void 0:m.trim(),r=eO(e,{fileObj:o});Object.assign(c,{fileID:t,fileObj:o,fileUrl:r})}return Object.assign(c.upload,{progress:u,status:l}),(u>0||"upload_loadstart"===r)&&(Rc(ma,{...tO(e,d),progress:u,status:l}),p.push(Pv(c))),Ue(p)})),gt((t=>(console.warn(t),oO("Upload small file error.",e,t),aO(a,e)))))}}catch(e){console.warn(e)}return uO(e,t)}const lO=(()=>{const e=new Ef;return t=>async function(){await e.acquire(),t(...arguments),setTimeout((()=>{e.release()}),3e3)}})(),cO=function(e){const t=["chatFileTransfer"];return new Proxy(e,{get:(e,o)=>"string"==typeof o&&t.includes(o)?function(){return lO(e[o].bind(e))(...arguments)}:Reflect.get(e,o)})}(Ls.createAgent()),pO={chatHistory:[],chatPrivilege:vs.All,panelistChatPrivilege:gs.AllPanelist,isAllowAttendeeChat:!0,isFileTransferEnable:!0,isEnableFileTransferEncrypted:!0,fileTransferFileType:[],fileDownloadPromptIgnoreList:[],fileTransferSizeLimit:0,fileServerDomain:"",failedFileTransfer:{}},hO=ko({[`${Cv}`]:fE(((e,t)=>{let{payload:o}=t;e.chatHistory.push(o)})),[`${Iv}`]:fE(((e,t)=>{let{payload:o}=t;e.chatPrivilege=o})),[`${Av}`]:fE(((e,t)=>{let{payload:o}=t;e.panelistChatPrivilege=o})),[`${wv}`]:fE(((e,t)=>{let{payload:o}=t;e.isAllowAttendeeChat=o})),[`${Rv}`]:fE(((e,t)=>{let{payload:o}=t;const{destNodeID:n,msgID:r,userId:i}=o,s=QR(e.chatHistory,{userId:i,destNodeID:n});s&&Object.assign(s,{id:r})})),[`${Ov}`]:fE(((e,t)=>{let{payload:o}=t;const{msgId:n}=o,r=e.chatHistory.findIndex((e=>e.id===n));r>=0&&e.chatHistory.splice(r,1)})),[`${Tv}`]:fE(((e,t)=>{let{payload:o}=t;Object.assign(e,o)})),[`${Dv}`]:fE(((e,t)=>{let{payload:o}=t;const{originFile:n,...r}=o;e.chatHistory.push(r)})),[`${Pv}`]:fE(((e,t)=>{let{payload:o}=t;const{upload:n,download:r,originFile:i,...s}=o;if(n){var a;const{uniqueId:t,...o}=n,r=e.chatHistory.find((e=>{var o;return e.file&&(null===(o=e.file.upload)||void 0===o?void 0:o.uniqueId)===t}));null!=r&&null!==(a=r.file)&&void 0!==a&&a.upload&&(Object.assign(r.file.upload,{...o}),Object.assign(r.file,{...s}),r.file.upload.status===Ts.Success&&e.failedFileTransfer[r.file.upload.uniqueId]&&delete e.failedFileTransfer[r.file.upload.uniqueId])}else if(r){const{id:t,fileUrl:o}=s,n=e.chatHistory.find((e=>{var n;return e.id===t&&(null===(n=e.file)||void 0===n?void 0:n.fileUrl)===o}));null!=n&&n.file&&(n.file.download?Object.assign(n.file.download,{...r}):Object.assign(n.file,{download:r}))}})),[`${kv}`]:fE(((e,t)=>{let{payload:o}=t;const{uniqueId:n,fileName:r,userId:i}=o,s=e.chatHistory.find((e=>e.file&&e.file.name==r&&e.file.upload.uniqueId===n&&e.file.upload.status===Ts.InProgress&&e.receiver.userId===i));var a;null!=s&&s.file&&Object.assign(null===(a=s.file)||void 0===a?void 0:a.upload,{status:Ts.Cancel,progress:0})})),[`${Mv}`]:fE(((e,t)=>{let{payload:o}=t;const{uniqueId:n,file:r}=o;e.failedFileTransfer[`${n}`]||Object.assign(e.failedFileTransfer,{[`${n}`]:r})})),[`${Lv}`]:fE(((e,t)=>{let{payload:o}=t;const{fileID:n,msgID:r,senderId:i}=o,s=e.chatHistory.find((e=>{var t;return(null===(t=e.file)||void 0===t?void 0:t.fileID)===n&&e.sender.userId===i}));s&&Object.assign(s,{id:r})})),[`${Nv}`]:fE(((e,t)=>{let{payload:o}=t;const{id:n,fileUrl:r}=o,i=e.chatHistory.find((e=>{var t,o;return e.id===n&&(null===(t=e.file)||void 0===t?void 0:t.fileUrl)===r&&(null===(o=e.file)||void 0===o?void 0:o.download.status)===Ds.InProgress}));var s;null!=i&&i.file&&Object.assign(null===(s=i.file)||void 0===s?void 0:s.download,{status:Ds.Cancel,progress:0})})),[`${_v}`]:()=>({...pO})},pO);var mO;const vO=Ls.createAgent();let gO=(mO=class extends RR{send(e,t){if(!e)return Promise.reject({type:Rl,reason:"Text is empty"});const{[hR]:o,[mR]:n}=this,r=o(),i=yp(r),s=WR(r,t),a=$R(i,s,r);if(a)return Promise.reject(a);const{meeting:{isWebinar:u,encType:d}}=r,l=d===Xi.AES_GCM;let c=Promise.resolve(),p=!1;const h=u&&rp(s.userRole);return t===fs.SilentModeUsers?vO.chat(ur(e),t):u?h?8==(8&s.clientCap)?c=zR({text:e,destId:fs.IndividualCcPanelist,sn:null==i?void 0:i.zoomID,attendeeId:t}):(c=zR({text:e,destId:fs.Panelist,sn:null==i?void 0:i.zoomID,attendeeId:t}).then((()=>function(e){const{text:t,jid:o,isGCMEnabled:n}=e;return rs.beginEncrypt({text:t,type:es.XMPP_CHAT}).then((e=>{HR.sendWebinarMseeage(e,o,fs.IndividualCcPanelist,n)}))}({text:e,jid:s.jid,isGCMEnabled:l}))),p=!0):s&&(c=zR({text:e,destId:s.userId,sn:null==i?void 0:i.zoomID})):c=zR({text:e,destId:s.userId,sn:null==i?void 0:i.zoomID}),c.then((()=>{const o=function(e,t,o,n){const r=(new Date).getTime(),i=performance.now();return{message:e,sender:{name:t.displayName,userId:t.userId,userGuid:t.userGUID,avatar:t.avatar},receiver:{name:null==o?void 0:o.displayName,userId:n?fs.IndividualCcPanelist:null==o?void 0:o.userId,userGuid:null==o?void 0:o.userGUID},timestamp:r,highResTimeStampForIdentification:i}}(e,i,s,h);return n(Cv(o)),p?(Rc(la,o),o):new Promise(((e,n)=>{Dc(pa).pipe(We(5e3),At((e=>o.highResTimeStampForIdentification!==e.identification||!([e.receiverId,fs.All,fs.Panelist].includes(t)||e.receiverId===fs.IndividualCcPanelist))),ft(1)).subscribe((t=>{const{msgId:n}=t,{highResTimeStampForIdentification:r,...i}=o,a={id:n,...i,...h&&{receiver:{name:null==s?void 0:s.displayName,userId:null==s?void 0:s.userId}}};Rc(la,a),e(a)}),(()=>{n({type:Cl})}))}))}))}setPrivilege(e){const t=this[hR](),{meeting:{isWebinar:o},chat:{chatPrivilege:n},breakoutRoom:r}=t;return n===e?Promise.resolve(""):(null==r?void 0:r.controlStatus)===sp.InProgress&&kR(t)?Promise.reject({type:Il,reason:"Cannot update chat privilege in a subsession"}):!o&&!bs.includes(e)||o&&!Es.includes(e)?Promise.reject({type:Rl,reason:"invalid privilege value of parameter"}):(vO.setChatPriviledge(e),Tc(ca,(t=>t.chatPrivilege===e)))}setPanelistPrivilege(e){const t=this[hR](),{chat:{panelistChatPrivilege:o}}=t,n=As[e];return o===n?Promise.resolve(""):Object.values(Is).includes(e)?(vO.setPanelistChatPrivilege(e),Tc(ca,(e=>e.panelistChatPrivilege===n))):Promise.reject({type:Rl,reason:"Panelist privilege value is invalid"})}deleteMessage(e){const t=this[hR](),{chat:{chatHistory:o},meeting:{meetingOptions:n,userId:r}}=t;if(null!=n&&n.isEnableDeleteChatMsg){const n=Sp(t),i=o.find((t=>t.id===e));if(i){const{sender:t}=i;if(n)vO.chatCmdReq(e,ys.Delete);else{if(t.userId!==r)return Promise.reject({type:_l,reason:"can not delete message"});vO.chatCmdReq(e,ys.Delete)}return Tc(ha,(t=>t.id===e)).then((()=>({id:e})))}return Promise.reject({type:Rl,reason:"msgId is wrong"})}return Promise.reject({type:Il,reason:"can not delete messages"})}lockChat(e){const t=this[hR](),{meeting:{meetingOptions:o}}=t,n=null!=o&&o.isPrivateChatEnabled?vs.All:vs.EveryonePublicly;return this.setPrivilege(e?vs.NoOne:n)}sendFile(e,t){if(!e)return Promise.reject({type:Rl,reason:"File is empty"});const{[hR]:o,[mR]:n}=this,r=o(),{chat:{isFileTransferEnable:i,fileTransferFileType:s,fileTransferSizeLimit:a,failedFileTransfer:u}}=r;if(!i)return Promise.reject({type:Il,reason:"Send files via in-session chat is not enabled"});if("string"==typeof e){const t=KR(e,r);if(null!=t&&t.file&&u[e]){const{file:{upload:o,...r}}=t,{file:{name:i,upload:{uniqueId:s}},receiver:{userId:a}}=t;return n(Pv({originFile:u[e],...r,upload:{...o,status:Ts.InProgress}})),Promise.resolve((()=>{n(kv({uniqueId:s,fileName:i,userId:a}))}))}return Promise.reject({type:Rl,reason:"Retry token is not correct."})}{const{name:o}=e;if(s.length>0){const[e]=o.split(".").reverse();if(!s.some((t=>t===e)))return Promise.reject({type:Il,reason:"File is not in the allow list"})}if(e.size>a)return Promise.reject({type:Il,reason:"File size exceeds the maximum limit."});const i=yp(r),u=WR(r,t),d=$R(i,u,r);if(d)return Promise.reject(d);const l=vr();return n(Dv(function(e,t,o,n,r){const i=(new Date).getTime();return{file:{name:e.name,size:e.size,type:e.type,upload:{progress:0,uniqueId:t,totalChunks:0,chunkIndex:0}},originFile:e,sender:{name:o.displayName,userId:o.userId,userGuid:o.userGUID,avatar:o.avatar},receiver:{name:null==n?void 0:n.displayName,userId:null==n?void 0:n.userId,attendeeId:void 0,userGuid:null==n?void 0:n.userGUID},timestamp:i}}(e,l,i,u))),Promise.resolve((()=>{n(Mv({uniqueId:l,file:e})),n(kv({uniqueId:l,fileName:o,userId:null==u?void 0:u.userId}))}))}}downloadFile(e,t,o){const{[hR]:n,[mR]:r}=this,{chat:{chatHistory:i}}=n();if(!e||!t)return Promise.reject({type:Rl,reason:"Invalid message id or file url!"});const s=i.find((o=>{var n;return o.id===e&&(null===(n=o.file)||void 0===n?void 0:n.fileUrl)===t}));return s?(r(Pv({id:e,fileUrl:t,download:{status:Ds.InProgress,progress:0,blob:o}})),Promise.resolve((()=>r(Nv({id:e,fileUrl:t}))))):Promise.reject({type:Rl,reason:"Invalid message id or file url!"})}getPrivilege(){const{chat:{chatPrivilege:e,isAllowAttendeeChat:t}}=this[hR]();return t?e:vs.NoAttendee}getReceivers(){const e=this[hR](),{chat:{chatPrivilege:t,panelistChatPrivilege:o,isAllowAttendeeChat:n},meeting:{isWebinar:r}}=e;if(!r&&!n)return[];const i=yp(e),s=Sp(e);if(i)if(r)if(rp(i.userRole)){if(!n)return[];if(t===vs.All)return[_s,Cs];if(t===vs.AllPanelist)return[_s];if(t===vs.NoOne)return[]}else{if(s||o===gs.Everyone){const t=GR(e,i.userId,{includeAttendee:!0});return[_s,Cs,...t]}if(o===gs.AllPanelist){const t=GR(e,i.userId);return[_s,...t]}}else{const o=Sp(e);if(t===vs.All||o){const t=GR(e,i.userId);return[Cs,...t]}if(t===vs.Host)return GR(e,i.userId,{host:!0});if(t===vs.EveryonePublicly){const t=GR(e,i.userId,{host:!0});return[Cs,...t]}if(t===vs.NoOne)return[]}return[]}getHistory(){return this[hR]().chat.chatHistory.map((e=>{const{highResTimeStampForIdentification:t,...o}=e;if(o.file){const{name:e,size:t,type:n,fileUrl:r,upload:i,download:s}=o.file,a={name:e,size:t,type:n,fileUrl:r};return i&&Object.assign(a,{upload:{status:i.status,progress:i.progress}}),s&&Object.assign(a,{download:{status:s.status,progress:s.progress}}),{...o,file:a}}return o}))}isAllowToDeleteMessages(){const e=this[hR](),{meeting:{meetingOptions:t}}=e;return null==t?void 0:t.isEnableDeleteChatMsg}isFileTransferEnabled(){return this[hR]().chat.isFileTransferEnable}getFileTransferSetting(){const e=this[hR](),{chat:{fileTransferFileType:t,fileTransferSizeLimit:o}}=e;return{typeLimit:(null!=t?t:[]).map((e=>`.${e}`)).join(","),sizeLimit:o}}},cR(mO.prototype,"send",[fR],Object.getOwnPropertyDescriptor(mO.prototype,"send"),mO.prototype),cR(mO.prototype,"setPrivilege",[yR,fR],Object.getOwnPropertyDescriptor(mO.prototype,"setPrivilege"),mO.prototype),cR(mO.prototype,"setPanelistPrivilege",[yR,fR,function(e,t,o){const n=o.value;o.value=function(){const e=this[pR];if(e){const{meeting:{isWebinar:t}}=e.getState();if(!t)return Promise.reject({type:wl,reason:"non-webinar"})}for(var t=arguments.length,o=new Array(t),r=0;rbn(e,24583).pipe(Tt(t),Xe((e=>{let[t,o]=e;if(o.meeting.zlkJwtToken)return fe;const{payload:{body:{sn:n,senderName:r,senderJid:i,receiver:s,text:a,type:u}}}=t,d=yp(o),l=Ep(o),{meeting:{jid:c,userId:p},participants:{xmppAttendeeList:h}}=o;return rs.beginDecrypt({decryptedText:a,type:es.XMPP_CHAT,zoomId:n}).then((e=>{var t;let{message:o}=e,n=null,a=0,m="";d&&rp(d.userRole)&&c===s?(n=h.find((e=>e.jid===i)),a=p,m=d.displayName):u===fs.Panelist&&(n=l.find((e=>e.jid===i)),a=fs.Panelist,m=_s.displayName);const v={message:o,sender:{name:r,userId:(null===(t=n)||void 0===t?void 0:t.userId)||0,avatar:""},receiver:{name:m,userId:a},timestamp:(new Date).getTime()};return Rc(la,v),Cv(v)}))}))),epics1:(e,t)=>yn(e,7944).pipe(Tt(t),Xe((e=>{let[t,o]=e;const{meeting:{bIbDisableChat:n}}=o,{payload:{body:{attendeeNodeID:r,sn:i,destNodeID:s,text:a,senderName:u,msgID:d}}}=t,l=yp(o);if(l){const e=rp(null==l?void 0:l.userRole)&&r===l.userId&&!d;if(!n&&!e){const{sn:e,...t}=qR({destNodeID:s,attendeeNodeID:r,senderName:u,sn:i},o);return(r===fs.SilentModeUsers?Promise.resolve({id:d,message:dr(a),...t}):rs.beginDecrypt({decryptedText:a,zoomId:e,type:es.RWG_CHAT}).then((e=>{let{message:o}=e;return{id:d,message:o,...t}}))).then((e=>(Rc(la,e),Cv(e))))}}return fe}))),epics2:(e,t)=>yn(e,us).pipe(mt((e=>{var t,o;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.chatPriviledge)||void 0!==(null===(o=e.payload.body)||void 0===o?void 0:o.bAllowAttendeeChat)})),Tt(t),ze((e=>{let[t,o]=e;const{payload:{body:{chatPriviledge:n,bAllowAttendeeChat:r}}}=t,{chat:{chatPrivilege:i}}=o;return void 0!==r?(Rc(ca,!0===r?{chatPrivilege:i}:{chatPrivilege:vs.NoAttendee}),wv(r)):(Rc(ca,{chatPrivilege:n}),Iv(n))}))),epics3:e=>yn(e,us).pipe(mt((e=>{var t;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.panelistChatPriviledge)})),ze((e=>{const{payload:{body:{panelistChatPriviledge:t}}}=e;return Rc(ca,{panelistChatPrivilege:t}),Av(t)}))),epics4:(e,t)=>yn(e,4136).pipe(Tt(t),Xe((e=>{let[t,o]=e;const{payload:{body:{result:n,destNodeID:r,msgID:i,fileID:s}}}=t,{meeting:{userId:a},chat:{chatHistory:u}}=o,d=[];if(n===Ss.Success)if(s){const e=u.find((e=>{var t;return(null===(t=e.file)||void 0===t?void 0:t.fileID)===s}));if(e){const{file:t,receiver:o,...n}=e,{name:r,size:u,type:l,fileUrl:c}=null!=t?t:{},{attendeeId:p,...h}=o;Rc(la,{id:i,file:{name:r,size:u,type:l,fileUrl:c,upload:{status:Ts.Complete,progress:100}},receiver:{...h},...n}),d.push(Lv({fileID:s,msgID:i,senderId:a}))}}else{const e=QR(u,{userId:a,destNodeID:r});var l;e&&(Rc(pa,{msgId:i,receiverId:r,identification:null!==(l=e.highResTimeStampForIdentification)&&void 0!==l?l:0}),d.push(Rv({destNodeID:r,msgID:i,userId:a})))}else n!==Ss.Delete&&n!==Ss.Block||d.push(Ov({msgId:i}));return Ue(d)}))),epics5:e=>yn(e,4238).pipe(Xe((e=>{const{payload:{body:{bSuccess:t,cmd:o,msgID:n}}}=e,r=[];return t&&o===ys.Delete&&(r.push(Ov({msgId:n})),Rc(ha,{id:n})),Ue(r)}))),epics6:e=>yn(e,7960).pipe(Xe((e=>{const{payload:{body:{cmd:t,msgID:o}}}=e,n=[];return t===ys.Delete&&(n.push(Ov({msgId:o})),Rc(ha,{id:o})),Ue(n)})))},yO=fn(fO,{chatFileEpics0:e=>e.pipe($t(`${Wr}`),ze((e=>{var t,o,n;const{payload:{fileTransfer:r,fileServerDomain:i}}=e;return Tv({isFileTransferEnable:null==r?void 0:r.isEnable,isEnableFileTransferEncrypted:null==r?void 0:r.isEnableFileTransferEncrypted,fileTransferFileType:(null!==(t=null==r?void 0:r.fileType)&&void 0!==t?t:"").replace(/\./g,"").split(",").filter(Boolean),fileTransferSizeLimit:1024*(null!==(o=null==r?void 0:r.sizeLimit)&&void 0!==o?o:0)*1024||Os.MaxSize,fileDownloadPromptIgnoreList:(null!==(n=null==r?void 0:r.fileDownloadPromptIgnoreList)&&void 0!==n?n:"").replace(/\./g,"").split(","),fileServerDomain:`https://${i}`})}))),chatFileEpics1:(e,t)=>e.pipe($t(`${Dv}`),Xe((async o=>{const{payload:{originFile:n,file:{upload:{uniqueId:r}}}}=o;return n.size>Os.ChunkSize?await async function(e,t,o,n){const r=XR(e,"/wc/multiupload/init",n.value),i=await async function(e){const t=Math.ceil(e.size/Os.ReaderChunkSize);return(await Promise.all(Array.from({length:t},((e,t)=>({start:t*Os.ReaderChunkSize,end:(t+1)*Os.ReaderChunkSize}))).map((async t=>{let{start:o,end:n}=t;try{const t=await rO(e,o,n);return Ar(await window.crypto.subtle.digest("SHA-256",t))}catch(t){return oO("calculate file hash error.",e,t),Promise.reject(t)}})))).join("")}(e),{meeting:{zmk:s,meetingId:a}}=n.value,u=KR(t,n.value);if(i&&u){const{receiver:n}=u,d={fileName:e.name,length:e.size,channelType:4,digest:i,shareJid:a};return UE({url:r,method:"POST",headers:{"Zoom-File-Origin":"redirect=support_auth",zmk:s},crossDomain:br(r),body:d}).pipe(wt(sO(e,t,n,o)),ze((o=>{var n;const{responseHeaders:r,response:i}=o,s=null===(n=r["x-zm-trackingid"])||void 0===n?void 0:n.trim(),{uploadid:a,path:u,metadata:d}=i,l=Math.ceil(e.size/Os.ChunkSize);return Pv({originFile:e,upload:{uniqueId:t,status:Ts.InProgress,progress:0,chunkIndex:0,totalChunks:l,uploadid:a,trackingId:s,path:u,metadata:d}})})),gt((t=>(console.warn(t),oO("Upload file meta error.",e,t),aO(u,e)))),Ct(Pv({upload:{uniqueId:t,status:Ts.Init}})))}return uO(e,t)}(n,r,e,t):await dO(n,r,e,t)})),Xe((e=>e))),chatFileEpics2:(e,t)=>e.pipe($t(`${Pv}`),mt((e=>{var t;return(null===(t=e.payload.upload)||void 0===t?void 0:t.status)===Ts.Success})),ty((async e=>{const{payload:{upload:{uniqueId:o}}}=e,{chat:{isEnableFileTransferEncrypted:n,chatHistory:r}}=t.value,i=r.find((e=>{var t,n;return(null===(t=e.file)||void 0===t||null===(n=t.upload)||void 0===n?void 0:n.uniqueId)===o})),s=[];if(i&&i.file){const{file:{name:e,size:t,fileObj:r,fileID:a,type:u},receiver:{userId:d,attendeeId:l}}=i;let[c,p]=["",""];if(n){const[o,n]=await Promise.all([e,`${t}`].map((e=>rs.beginEncrypt({text:e,type:es.RWG_CHAT}))));[c,p]=[o,n]}else[c,p]=[e,`${t}`].map((e=>ur(e)));await cO.chatFileTransfer({fileID:a,fileSize:p,fileName:c,fileObj:r,type:u,destNodeID:d,attendeeNodeID:l}),s.push(Pv({upload:{uniqueId:o,status:Ts.Complete}}))}return s}))),chatFileEpics3:(e,t)=>e.pipe($t(`${Pv}`),mt((e=>{const{payload:{upload:t,originFile:o}}=e;return!!t&&!!t.uniqueId&&t.status===Ts.InProgress&&(null==o?void 0:o.size)<=Os.ChunkSize&&0===t.totalChunks})),Xe((async o=>{const{payload:{originFile:n,upload:{uniqueId:r}}}=o;return await dO(n,r,e,t)})),Xe((e=>e))),chatFileEpics4:(e,t)=>e.pipe($t(`${Pv}`),mt((e=>{const{payload:{upload:t}}=e;return!!t&&!!t.uniqueId&&t.totalChunks>0&&t.chunkIndex!==t.totalChunks})),Xe((async o=>{const{payload:{originFile:n,upload:{uniqueId:r}}}=o;return await async function(e,t,o,n){const r=KR(t,n.value);if(null!=r&&r.file){const{file:{upload:{chunkIndex:i,totalChunks:s,uploadid:a,path:u,trackingId:d,etags:l},size:c},receiver:p}=r,h=i*Os.ChunkSize,m=await iO(e,h);if(m){const{chat:{fileServerDomain:h},meeting:{zmk:v}}=n.value,g=`${h}/upload/parts?${new URLSearchParams({uploadid:a,partNumber:i+1}).toString()}`,f=new FormData,y=new File([m],e.name);return f.append("file",y),UE({url:g,method:"POST",headers:{"Zoom-File-Size":y.size,"Zoom-File-Path":u,"x-zm-trackingid":d,"Zoom-File-Origin":"redirect=support_auth",zmk:v},crossDomain:br(g),body:f,includeUploadProgress:!0}).pipe(wt(sO(e,t,p,o)),Xe((o=>{var r;const{type:a,loaded:u,total:d,responseHeaders:h}=o;let m=0;const v={upload:{uniqueId:t,status:Ts.InProgress}},g=[],f=KR(t,n.value),y=null==f||null===(r=f.file)||void 0===r?void 0:r.upload.progress;if("upload_loadstart"===a)m=y||Math.floor(i/s*100);else if("upload_progress"===a)m=Math.floor((i*Os.ChunkSize+.9*u)/c*100);else if("upload_load"===a)m=Math.floor((i*Os.ChunkSize+.9*d)/c*100);else if("download_load"===a){m=y||Math.floor((i+1)/s*100);const t=h["x-zm-etag"].trim(),o=l?{...l,[`${i+1}`]:t}:{[`${i+1}`]:t};Object.assign(v.upload,{etags:o,chunkIndex:i+1,totalChunks:s}),Object.assign(v,{originFile:e})}return(m>0||"upload_loadstart"===a)&&(Object.assign(v.upload,{progress:m}),Rc(ma,{...tO(e,p),progress:m,status:Ts.InProgress}),g.push(Pv(v))),Ue(g)})),gt((t=>(console.warn(t),oO(`Upload file chunk error. chunk:${i},total chunks:${s},uploadid:${a},trackingId:${d}`,e,t),aO(r,e)))))}}return uO(e,t)}(n,r,e,t)})),Xe((e=>e))),chatFileEpics5:(e,t)=>e.pipe($t(`${Pv}`),mt((e=>{const{payload:{upload:t}}=e;return!!t&&!!t.uniqueId&&t.totalChunks>0&&t.chunkIndex==t.totalChunks})),Xe((o=>{const{payload:{originFile:n,upload:{uniqueId:r}}}=o;return function(e,t,o,n){const{chat:{fileServerDomain:r},meeting:{zmk:i}}=n.value,s=KR(t,n.value);if(null!=s&&s.file){const{file:{upload:{uploadid:a,metadata:u,etags:d,trackingId:l}},receiver:c}=s,p=`${r}/upload/complete?uploadid=${a}`;return UE({url:p,method:"POST",headers:{"x-zm-trackingid":l,"Zoom-File-Origin":"redirect=support_auth",zmk:i},crossDomain:br(p),body:{metadata:u,etags:d}}).pipe(wt(sO(e,t,c,o)),ze((o=>{var r,i;const{chat:{fileServerDomain:s}}=n.value,{responseHeaders:a}=o,u=null===(r=a["zoom-file-id"])||void 0===r?void 0:r.trim(),d=null===(i=a["zoom-file-obj"])||void 0===i?void 0:i.trim(),l=`${s}/zoomfile/download?objkey=${d}`;return Rc(ma,{...tO(e,c),progress:100,status:Ts.Success}),Pv({fileID:u,fileObj:d,fileUrl:l,upload:{uniqueId:t,progress:100,status:Ts.Success}})})),gt((t=>(console.warn(t),oO(`Upload chunks checksum error.uploadid${a},trackingId${l}`,e,t),aO(s,e)))))}return uO(e,t)}(n,r,e,t)}))),chatFileEpics6:(e,t)=>yn(e,4308).pipe(ty((async e=>{const{payload:{body:{attendeeNodeID:o,destNodeID:n,fileID:r,fileName:i,fileObj:s,fileSize:a,fileType:u,msgID:d,senderName:l}}}=e,{meeting:{bIbDisableChat:c},chat:{fileServerDomain:p,isEnableFileTransferEncrypted:h}}=t.value,m=[];if(!c){const e=eO(p,{fileObj:s,fileID:r});if(u===Rs.Local){const{sn:u,...c}=qR({destNodeID:n,attendeeNodeID:o,senderName:l},t.value);let[p,v]=["",0];if(h){const[e,t]=await Promise.all([i,a].map((e=>rs.beginDecrypt({decryptedText:e,zoomId:u,type:es.RWG_CHAT}))));p=e.message,v=Number(t.message)}else p=dr(i),v=Number(dr(a));const g={id:d,file:{name:p,size:v,fileUrl:e},...c};m.push(Cv({...g,file:{...g.file,fileID:r,fileObj:s}})),setTimeout((()=>{Rc(la,g)}),0)}}return m}))),chatFileEpics7:(e,t)=>e.pipe($t(`${Pv}`),mt((e=>{var t,o;const{payload:n}=e;return n.id&&n.fileUrl&&(null===(t=n.download)||void 0===t?void 0:t.status)===Ds.InProgress&&0===(null===(o=n.download)||void 0===o?void 0:o.progress)})),Xe((o=>function(e,t,o){var n;const{chat:{chatHistory:r},meeting:{zmk:i},participants:{attendeesList:s}}=o.value,a=r.find((t=>t.id===e));if(null!=a&&null!==(n=a.file)&&void 0!==n&&n.fileUrl){const{file:{fileUrl:o}}=a;return UE({url:o,method:"GET",headers:{"Zoom-File-Origin":"redirect=support_auth",zmk:i},crossDomain:br(o),responseType:"arraybuffer",includeDownloadProgress:!0}).pipe(wt(function(e,t){return t.pipe($t(`${Nv}`,`${No}`),mt((t=>{if(t.type===`${No}`)return!0;const{payload:{id:o}}=t;return e.id===o})),Ot((()=>{var t,o,n;YR.info(`Cancel file download. file name:${YS(null===(t=e.file)||void 0===t?void 0:t.name)},file size:${null===(o=e.file)||void 0===o?void 0:o.size},sender id:${null===(n=e.sender)||void 0===n?void 0:n.userId}`),Rc(va,{...nO(e),progress:0,status:Ds.Cancel})})))}(a,t)),ty((async t=>{const{type:o,loaded:n,total:r}=t,i=[],u={...nO(a),progress:0,status:Ds.InProgress};if("download_loadstart"===o&&Object.assign(u,{progress:0}),"download_progress"===o){var d;const t=Math.floor(n/r*100);i.push(Pv({id:e,fileUrl:null===(d=a.file)||void 0===d?void 0:d.fileUrl,download:{progress:t}})),Object.assign(u,{progress:t})}else if("download_load"===o){var l,c,p;const o=100,n=Ds.Success;Object.assign(u,{progress:o,status:n}),i.push(Pv({id:e,fileUrl:null===(l=a.file)||void 0===l?void 0:l.fileUrl,download:{progress:o,status:n}}));const r=null===(c=s.find((e=>e.userId===a.sender.userId)))||void 0===c?void 0:c.zoomID,d=await async function(e,t,o){const n=Math.ceil(e.byteLength/Os.DecodeBlockSize);try{const r=await Promise.all(Array.from({length:Math.max(n-1,1)},((e,t)=>({start:t*Os.DecodeBlockSize,end:(t===n-2?t+2:t+1)*Os.DecodeBlockSize}))).map((async n=>{let{start:r,end:i}=n;try{const t=e.slice(r,i),{message:n}=await rs.beginDecrypt({decryptedText:t,zoomId:o,type:es.CHAT_FILE});return n}catch(o){return oO("decrypt file buffer error.",{name:t,size:e.byteLength},o),Promise.reject(o)}})));return new Blob(r,{type:JR(t)})}catch(e){return null}}(t.response,null===(p=a.file)||void 0===p?void 0:p.name,r);var h,m;d&&(null!==(h=a.file)&&void 0!==h&&h.download.blob?Object.assign(u,{fileBlob:d}):function(e,t){const o=document.createElement("a"),n=window.URL.createObjectURL(e);o.href=n,o.download=t,o.click(),window.URL.revokeObjectURL(n)}(d,null===(m=a.file)||void 0===m?void 0:m.name))}return(u.progress>0||"download_loadstart"===o)&&Rc(va,u),i})),gt((t=>(console.warn(t),oO(`download file error. file url:${o}`,{name:void 0,size:void 0},t),Rc(va,{...nO(a),progress:0,status:Ds.Fail}),je(Pv({id:e,fileUrl:o,download:{status:Ds.Fail,progress:0}}))))))}return fe}(o.payload.id,e,t))))});function SO(e,t){const{meeting:{isMeetingReset:o,meetingId:n,meetingNumber:r,userName:i,userEmail:s,tid:a,userId:u,userGUID:d},breakoutRoom:l}=e;let c="";var p;return c=o?null!=l&&null!==(p=l.currentRoom)&&void 0!==p&&p.boConfId?"join breakout room":"meeting failover":"join meeting",{label:c,payload:{meetingId:n,tid:a,userId:u||(null==t?void 0:t.userId),userGUID:d||(null==t?void 0:t.userGUID),meetingNumber:YS(r),userName:YS(i),userEmail:YS(s)}}}function bO(e,t,o){return F(_t((n=>{let r=!1;try{var i,s;const{logger:{options:e},meeting:{logConfig:o}}=t.value;r=null!==(i=null==e?void 0:e.enable)&&void 0!==i?i:null===(s=JSON.parse(o||"{}"))||void 0===s?void 0:s.enable}catch(e){}try{if(r){const{logger:{isLaplaceInitialized:r}}=t.value;if(!r)return e.pipe($t(`${mf}`),ft(1),Xe((e=>(e.payload&&o(n),fe))));o(n)}}catch(e){console.warn(e)}return fe})))}function EO(e,t,o,n){return In(e,o).pipe(bO(e,t,n))}function IO(e,t,o,n){return yn(e,o).pipe(bO(e,t,n))}function AO(e){var t,o;const{audio:{activeMicrophone:n,activeSpeaker:r,microphoneDevicesList:i,speakerDevicesList:s}}=e;return`microphone: [${n} - ${null==i||null===(t=i.find((e=>e.deviceId===n)))||void 0===t?void 0:t.label}]; speaker: [${r} - ${null==s||null===(o=s.find((e=>e.deviceId===r)))||void 0===o?void 0:o.label}]`}function CO(e){var t;const{video:{activeCamera:o,cameraDevicesList:n}}=e;return`camera: [${o} - ${null==n||null===(t=n.find((e=>e.deviceId===o)))||void 0===t?void 0:t.label}]`}function _O(e,t){return t?` ,${e}:${t}`:""}const{InitSuccessAudio:wO,InitFailedAudio:RO,InitSuccessVideo:OO,InitFailedVideo:TO,InitSuccessSharing:DO,InitFailedSharing:PO}=Na,{DecodeSuccess:kO,DecodeFailed:MO,EncodeSuccess:LO,EncodeFailed:NO}=Va,VO={[`${wO}`]:{name:"Audio",isException:!1},[`${RO}`]:{name:"Audio",isException:!0},[`${OO}`]:{name:"Video",isException:!1},[`${TO}`]:{name:"Video",isException:!0},[`${DO}`]:{name:"Sharing",isException:!1},[`${PO}`]:{name:"Sharing",isException:!0}};function UO(e){const t=(null!=e?e:"").split("-");return[...new Set(t)].map((e=>({reason:e,count:t.filter((t=>e===t)).length})))}const jO=ob.getInstance(),BO=()=>{if("connection"in navigator){const{effectiveType:e,rtt:t,downlink:o}=navigator.connection;jO.makeLogger(["Network Connection Type"]).info(`Network connection. ect:${e},rtt:${t},downlink:${o}`)}},xO=ob.getInstance().makeLogger(["Remote Control"]),FO=ab(Fs.getInstance()),HO=[{event:Na.AudioBridgeReconnectStart,message:QS.AudioBridgeReconnectStart,logType:"info",additionalTags:["Audio Join Flow"]},{event:Na.AudioBridgeReconnectEnd,message:QS.AudioBridgeReconnectEnd,logType:"info",additionalTags:["Audio Join Flow"]},{event:Na.UserGrantCaptureAudio,message:e=>`${QS.DeviceAudioStreamCaptured},${AO(e)}`,logType:"info",additionalTags:["Audio Capture Flow"]},{event:Na.JoinComputerAudioComplete,message:QS.AudioJoinComplete,logType:"info",additionalTags:["Audio Join Flow"]},{event:Na.LeaveComputerAudioComplete,message:QS.AudioLeaveComplete,logType:"info",additionalTags:["Audio Join Flow"]},{event:Na.JoinSharingAudioComplete,message:QS.SharingAudioStartComplete,logType:"info",additionalTags:["Audio Sharing Flow"]},{event:Na.LeaveSharingAudioComplete,message:QS.SharingAudioStopComplete,logType:"info",additionalTags:["Audio Sharing Flow"]}],$O=[{event:Na.StartVideoCaptureSuccess,message:e=>`${ZS.StartCaptureVideoSuccess}, ${CO(e)}`,logType:"info",additionalTags:["Video Join Flow"]},{event:Na.StopVideoCaptureSuccess,message:ZS.StopCaptureVideoSuccess,logType:"info",additionalTags:["Video Join Flow"]},{event:Na.StartVideoStreamInVbSettingSuccess,message:ZS.VBSettingSuccess,logType:"info",additionalTags:["Video VB Flow"]},{event:Na.VbModelPreloadingOk,message:ZS.VBPreloadSuccess,logType:"info",additionalTags:["Video VB Flow"]},{event:Na.VbModelPreloading_3S,message:ZS.VBPreloading3S,logType:"warn",additionalTags:["Video VB Flow"]},{event:Na.VbModelPreloading_10S,message:ZS.VBPreloading10S,logType:"warn",additionalTags:["Video VB Flow"]},{event:Na.VbSettingParaError,message:ZS.VBSettingFailed,logType:"error",additionalTags:["Video VB Flow"]}],WO=HO.map((e=>({...e,tag:"Audio"}))).concat($O.map((e=>({...e,tag:"Video"})))),GO=ob.getInstance(),{InitSuccessVideo:zO,InitSuccessAudio:KO,InitSuccessSharing:qO,InitFailedVideo:JO,InitFailedAudio:QO,InitFailedSharing:ZO,RecoverWebrtcAudio:YO,AudioBridgeFirstRecvData:XO,AudioBridgeCanSendData:eT,UserForbiddedCaptureAudio:tT,AudioWebsocketBroken:oT,AudioZeroData:nT,UserForbiddedCaptureVideo:rT,UserCameraIsTakenByOtherPrograms:iT,VideoWebsocketBroken:sT,StopVideoCaptureFailed:aT,DesktopSharingPermissionDenied:uT,DesktopSharingSystemError:dT,AudioSpeakerSetError:lT,VbSettingParaError:cT,MaskSettingParaError:pT,WebglLostInMultiView:hT,VideoStreamFailed:mT,AudioStreamFailed:vT,NotifyUIFailover:gT}=Na,fT=ob.getInstance(),yT={options:void 0,isLaplaceInitialized:!1},ST=ko({[`${hf}`]:fE(((e,t)=>{let{payload:o}=t;e.options=o})),[`${mf}`]:fE(((e,t)=>{let{payload:o}=t;e.isLaplaceInitialized=o})),[`${vf}`]:(e,t)=>{let{options:o}=e,{payload:n}=t;return n?{...yT,options:o}:{...yT}}},yT),bT={mlEpics0:(e,t)=>In(e,[zO,KO,qO,JO,QO,ZO]).pipe(bO(e,t,(e=>{const{payload:{type:o,data:n}}=e,{meeting:{userId:r}}=t.value,i=function(e,t){const o=VO[`${e}`];if(o){const{name:e,isException:n}=o,r=[e,`${e} Init Flow`];n&&r.push(`${e} exception flow`);let i="";return[kO,MO].includes(t)&&(i=`${i} decode`.trim()),[LO,NO].includes(t)&&(i=`${i} encode`.trim()),[LO,kO].includes(t)&&(i=`${i} success`.trim()),[MO,NO].includes(t)&&(i=`${i} failed`.trim()),{message:`init ${e.toLowerCase()} ${i}`,tags:r,isException:n}}return null}(o,n);if(i){const{message:e,tags:t,isException:o}=i;o?GO.report(`${e}. userId:${r}`,t):GO.makeLogger(t).info(e)}}))),mlEpics1:(e,t)=>EO(e,t,WO.map((e=>e.event)),(e=>{const{payload:{type:o}}=e,n=WO.find((e=>e.event===o));if(n){const{message:e,logType:o,additionalTags:r,tag:i}=n;let s=e;"function"==typeof e&&(s=e(t.value)),s&&GO.makeLogger([i])[o](s,r)}})),mlEpics2:(e,t)=>e.pipe($t(`${Kp}`),mt((e=>!e.payload)),bO(e,t,(()=>{GO.makeLogger(["Audio"]).warn(`Auto play audio failed,${AO(t.value)}`)}))),mlEpics3:(e,t)=>EO(e,t,YO,(()=>{GO.report("Audio bridge, recover audio failed, need to rejoin the audio",["Audio exception flow"])})),mlEpics4:(e,t)=>EO(e,t,[XO,eT],(e=>{const{payload:{type:t}}=e;GO.makeLogger(["Audio"]).log("Audio bridge connection: "+(t===XO?"first receive data":"can send data"))})),mlEpics5:(e,t)=>EO(e,t,gT,(e=>{GO.report(`Audio bridge, notify ui failover, subreason:${e.payload.data}`,["Audio exception flow"])})),mlEpics6:(e,t)=>EO(e,t,[tT,oT,nT,lT,vT],(e=>{const{payload:{type:o}}=e;let n=`Audio error case:${o}`;o===tT?n="Audio capture is forbidden by the user":o===nT?t.value.audio.webrtcRestartCount<3&&(n="audio capture zero data, auto failover"):o===lT?n="audio change speaker error":o===vT&&(n="audio stream ended or muted, stop capture audio"),GO.report(`${n},${AO(t.value)}`,["Audio exception flow"])})),mlEpics7:(e,t)=>EO(e,t,[rT,iT,sT,aT,mT],(e=>{const{payload:{type:o,data:n}}=e;let r=`Video error case:${o}`;if(o===rT)r="Video capture is forbidden by the user"+(n?` (error name:${null==n?void 0:n.name};error message:${null==n?void 0:n.message})`:"");else if(o===iT)r="Camera is taken by other programs"+(n?` (error name:${null==n?void 0:n.name};error message:${null==n?void 0:n.message})`:"");else if(o===cT){var i;r=`VB setting error, param:${JSON.stringify(null!==(i=t.value.video.virtualBackground)&&void 0!==i?i:{})}`}else if(o===pT){var s;r=`Mask setting error, param:${JSON.stringify(null!==(s=t.value.video.mask)&&void 0!==s?s:{})}`}else o===mT&&(r=`Video stream ended or muted, if it is on iOS platform, will stop capture video.platform:${Gi.browser}`);GO.report(`${r},${CO(t.value)}`,["Video exception flow"])})),mlEpics8:(e,t)=>EO(e,t,[uT,dT],(e=>{const{payload:{type:t}}=e;let o="";t===dT?Gi.isMacOS&&(o="Need to allow screen recording access in system setting on MacOS"):o="Need to allow the permission request",GO.report(`${o}`,["Sharing exception flow"])})),mlEpics9:(e,t)=>EO(e,t,hT,(e=>{const{payload:{data:o}}=e,{video:{renderedVideoList:n}}=t.value;if(null!=o&&o.canvasId){const e=n.filter((e=>e.canvasId===o.canvasId));GO.report(`WebGl Context lost, canvas ID:${o.canvasId}, affected video node Ids:${e.map((e=>e.userId)).join(",")}`,["Video exception flow"])}})),mlEpics10:(e,t)=>st(document,"visibilitychange").pipe(bO(e,t,(()=>{GO.makeLogger(["Video"]).log(`Page visibility ${document.visibilityState} `),setTimeout((()=>{const e="visible"!==document.visibilityState,{video:{subscribedVideoList:o},meeting:{userId:n}}=t.value,r=0===o.filter((e=>e!==n)).length;e&&r&&(Ls.createAgent().sendRWGConnectionPerformance("VCSV"),GO.makeLogger(["Video"]).warn("Still subscribing videos after switching to background"))}),1e3)})))},ET={rmclEpics0:(e,t)=>e.pipe($t(`${rm}`),bO(e,t,(e=>{const{payload:{isRemoteControlEnabled:t,isEnableAutoDeleteRcApp:o}}=e;xO.log(`isRemoteControlEnabled:${t},auto delete:${o}`)}))),rmclEpics1:(e,t)=>e.pipe($t(`${em}`),mt((e=>!!e.payload)),bO(e,t,(e=>{xO.log(`Launch Remote control app, scheme:${e.payload}`)}))),rmclEpics2:(e,t)=>e.pipe($t(`${Kh}`),mt((e=>!!e.payload)),bO(e,t,(e=>{xO.log(`Remote control session starts, controlling ssrc:${e.payload}`)}))),rmclEpics3:(e,t)=>IO(e,t,16430,(()=>{xO.log("Remote control app connected to rwg.")})),rmclEpics4:(e,t)=>IO(e,t,ms,(()=>{xO.log("Remote control app disconnected to rwg.")})),rmclEpics5:(e,t)=>IO(e,t,ms,(e=>{const{share:{status:o,isRemoteControlEnabled:n}}=t.value;n&&o!==Ka.End&&e.payload.body.bOn&&xO.log(`Remote control sharing device info.${JSON.stringify(FO.getShareStreamInfo())}`)})),rmclEpics6:(e,t)=>EO(e,t,Na.CurrentDesktopSharingWidthHeight,(()=>{const{share:{isRemoteControlEnabled:e}}=t.value;e&&xO.log(`Remote control sharing device info changes.${JSON.stringify(FO.getShareStreamInfo())}`)})),rmclEpics7:(e,t)=>EO(e,t,Na.SendRemoteControlQrCode,(e=>{const{share:{status:o}}=t.value,{payload:{data:n}}=e;xO.log(`Remote control QR code result. sharing status:${o}, result${JSON.stringify(n)}`)}))},IT={epics0:(e,t)=>e.pipe($t(`${Wr}`),Xe((async e=>{const{meeting:{logConfig:o,logEncryptionPubKey:n,zlkJwtToken:r,accountId:i,enableAutoLog:s,collectionToggleEnable:a,zsk:u},logger:{options:d}}=t.value;let l=d||{};if(o)try{const{enable:e,enableReport:t}=JSON.parse(o);l={...l,enable:e,enableReport:t}}catch(e){}if(r){const{telemetry_tracking_id:t}=Er(r),{payload:{meetingId:o}}=e,n=null!=t?t:o;l={...l,enable:!0,enableReport:!0,trackingId:n}}else{let e=!1;e=u&&void 0!==a?!(s&&a):!s,Ni.set(ji.DisableAutoReportLogs,e,Mi.Memory)}return jO.init({...l,logConfig:o,logEncryptionPubKey:n,accountId:i}).then((()=>[mf(!0),hf(l)])).catch((()=>[mf(!1)]))})),Xe((e=>Ue(e)))),epics1:(e,t)=>IO(e,t,cs,(e=>{var o,n,r;const{payload:{body:i}}=e;if(i&&i.res===Rr.Success){jO.makeLogger(["A/V Performance Info"]).info(`CPU cores:${navigator.hardwareConcurrency}, SharedArrayBuffer:${!!window.crossOriginIsolated}, browser:${Gi.browser} ${Gi.browserVersion}, OS:${Gi.os} ${Gi.osVersion}${_O("wow64",Gi.wow64)}${_O("GPU",Gi.gpu)}${_O("architecture",Gi.architecture)}${_O("bitness",Gi.bitness)}${_O("model",Gi.model)}${Ni.get(ji.EnforceWebRTCAudio)?"; Enforce WebTRC audio":""}`,["CPU_CORES"]);const{media:{enforceMultipleVideos:e,enforceVirtualBackground:o,assetsPath:n,disableRenderLimits:r},meeting:{stayAwake:i,quicklyLeave:s}}=t.value;jO.makeLogger(["Init Option"]).info(`Init option:${JSON.stringify({enforceMultipleVideos:e,disableRenderLimits:r,enforceVirtualBackground:o,assetsPath:n,stayAwake:i,leaveOnPageUnload:s})}`),"connection"in navigator&&(BO(),navigator.connection.addEventListener("change",BO))}else jO.report(`join meeting failed, error:${JSON.stringify(Mr(null==i?void 0:i.res))}, rwg error code:${null==i?void 0:i.res}, rwg conID:${null==i?void 0:i.conID}, error message:${null==i?void 0:i.error_desc}, rwg url:${null==i?void 0:i.svcUrl},mid:${t.value.meeting.meetingId}`,"JOIN_MEETING_FAILED","error");const{meeting:{meetingInfoTimestamp:s,pingRWCTimestamp:a,tid:u,meetingId:d,topic:l,accountId:c},socket:{rwgServerList:p,retryCount:h},video:{rendererType:m}}=t.value;let v=["conID","confID","mmrFeature","mmrFeatureEx","reportDomain","res","role","svcUrl","userID"].reduce(((e,t)=>void 0!==i[t]?{...e,[`${t}`]:i[t]}:e),{});v=["jid","mn","participantID","zoomID"].reduce(((e,t)=>void 0!==i[t]?{...e,[`${t}`]:YS(i[t])}:e),v),v.response=v.res,delete v.res;const g=["connection_info_map"];let f;if(i.res===Rr.Success&&g.push("Command Socket Event","User Info Map"),u){const e=u.match(/clid=(\S+);/);e&&e.length>1&&(f=e[1])}const y=Math.floor(performance.now()-s),S=Math.floor(performance.now()-a);jO.report(JSON.stringify({...v,tid:u,mid:d,userRegion:f,rwgUrl:p.length>0?null===(o=p[h])||void 0===o?void 0:o.rwg:void 0,hardwareConcurrency:navigator.hardwareConcurrency,sharedArrayBuffer:!!window.crossOriginIsolated,browserVersion:`${Gi.browser} ${Gi.browserVersion}`,osVersion:`${Gi.os} ${Gi.osVersion}`,gpu:Gi.gpu,architecture:Gi.architecture,model:Gi.model,bitness:Gi.bitness,totalDurationOfJoining:y,durationOfRWG:S,rendererType:m,topic:l?YS(l):void 0,accountId:c?YS(c):void 0}),g,"info"),Ls.createAgent().sendRWGConnectionPerformance(`WCL_M, conId: ${null==i?void 0:i.conID}, trackingId: ${null===(n=t.value.logger)||void 0===n||null===(r=n.options)||void 0===r?void 0:r.trackingId}, JOINFS(${y}), JOINFRWC(${S})`)})),epics2:(e,t)=>e.pipe($t(`${jr}`),Tt(t),mt((e=>{let[,t]=e;return void 0===t.meeting.encryptedRWC&&(void 0===t.meeting.encryptedGEORWC||0===t.meeting.encryptedGEORWC.length)})),bO(e,t,(()=>{const{label:e,payload:o}=SO(t.value);jO.report(`${e} ${JSON.stringify(o)}`,["Join Meeting Flow","Ping RWC Domain Empty"],"error")}))),epics3:(e,t)=>e.pipe($t(`${Br}`),mt((e=>e.payload===Pi.OnError||e.payload===Pi.Disconnect||e.payload===Pi.NoHeartbeat)),bO(e,t,(e=>{const{payload:o}=e,{socket:{rwgServerList:n,retryCount:r}}=t.value,{payload:i}=SO(t.value);jO.report(`websocket unexpected disconnected,${JSON.stringify({code:o,rwgHost:n[r],...i})}`,["Join Meeting Flow","RWG Disconnect"])}))),epics4:(e,t)=>e.pipe($t(`${Ei}`),bO(e,t,(e=>{const{payload:{reason:o,count:n,interval:r,sequence:i,userId:s,userGUID:a}}=e,{payload:u}=SO(t.value,{userId:s,userGUID:a});jO.report(`meeting failover,${JSON.stringify({reason:o,count:n,interval:r,sequence:i,detailed:UO(i),...u})}`,["Join Meeting Flow","Failover"]),"connection"in navigator&&navigator.connection.removeEventListener("change",BO)}))),epics5:(e,t)=>e.pipe($t(`${$o}`),mt((e=>e.payload.status===Dp.Connecting)),bO(e,t,(e=>{const{payload:{rwgUrl:o}}=e;let n=o.replace(/(\d+)\?/,`${YS("$1")}?`);n=["email","zoomid","participantID","dn2","customer_key","mpwd","topic"].reduce(((e,t)=>e.indexOf(t)>-1?e.replace(new RegExp(`${t}=([^&]+)`,"g"),`${t}=${YS("$1")}`):e),n);const{payload:r}=SO(t.value);jO.makeLogger(["Join Meeting Flow"]).info(`RWG URL,${JSON.stringify({rwgUrl:n,...r})}`,["RWG Url"])}))),epics6:(e,t)=>e.pipe($t(`${No}`),mt((e=>{const{payload:o}=e;return o?o.retry:t.value.meeting.meetingStatus===Ti.Initial})),bO(e,t,(()=>{const{meeting:{meetingStatus:e},socket:{rwgServerList:o,retryCount:n}}=t.value;if(e!==Ti.Joined){const{payload:e}=SO(t.value),r=(null==o?void 0:o.length)>0?o[n]:void 0;jO.report(JSON.stringify({...e,rwc:null==r?void 0:r.rwc,rwg:null==r?void 0:r.rwg}),["UNAVAILABLE_RWG"])}}))),epics7:(e,t)=>IO(e,t,1,(e=>{const{payload:{body:o}}=e;jO.report(`join meeting failed, version blocked. Current version:${t.value.meeting.cv},upgrade version:${null==o?void 0:o.upgradeVersion}`,"JOIN_MEETING_FAILED","error")})),epics8:(e,t)=>IO(e,t,2,(()=>{jO.report(`join meeting with low version of SDK. Current version:${t.value.meeting.cv}.`,"Join Meeting Flow","warn")})),epics9:(e,t)=>e.pipe($t(`${Vr}`,`${Ur}`),_t((()=>Dc(Qs,1).pipe(Ot((e=>{try{const{payload:o}=SO(t.value);jO.report(`Connection change with join meeting failed. payload:${JSON.stringify(e)}. meeting info:${JSON.stringify(o)}`,"JOIN_MEETING_FAILED","error")}catch(e){}})),Xe((()=>fe))))))},AT=fn(IT,ET,bT),CT=Ls.createAgent(),_T={cmrStatus:Aa.Stop,recordingEnable:!1,recordingIsoEnable:!1,allowStopAutoRecording:!1,automaticCloudRecordingEnable:!1,isZoomIQ:!1,zoomIQChanging:!1,localStatus:Ca.Stop,supportLocalRecording:_a.None,localGrantPermissionOption:wa.None,localPermissionUserList:[]},wT=ko({[`${Ig}`]:fE(((e,t)=>{let{payload:o}=t;e.cmrStatus=o})),[`${Ag}`]:fE(((e,t)=>{let{payload:o}=t;e.recordingEnable=o})),[`${Cg}`]:fE(((e,t)=>{let{payload:o}=t;e.recordingIsoEnable=o})),[`${_g}`]:fE(((e,t)=>{let{payload:o}=t;e.allowStopAutoRecording=o})),[`${wg}`]:fE(((e,t)=>{let{payload:o}=t;e.automaticCloudRecordingEnable=o})),[`${Rg}`]:fE(((e,t)=>{let{payload:o}=t;e.isZoomIQ=o})),[`${Og}`]:fE(((e,t)=>{let{payload:o}=t;e.zoomIQChanging=o})),[`${Tg}`]:fE(((e,t)=>{let{payload:o}=t;e.localStatus=o})),[`${Dg}`]:fE(((e,t)=>{let{payload:o}=t;e.supportLocalRecording=o})),[`${Pg}`]:fE(((e,t)=>{let{payload:o}=t;e.localGrantPermissionOption=o})),[`${kg}`]:fE(((e,t)=>{let{payload:o}=t;e.localPermissionUserList=o})),[`${Mg}`]:()=>({..._T})},_T);var RT,OT,TT,DT,PT,kT,MT,LT,NT,VT;const UT=Ls.createAgent(),jT=_R("Recording");let BT=(RT=bR("recording"),OT=bR("recording"),TT=bR("recording"),DT=bR("recording"),PT=bR("recording"),kT=bR("recording"),MT=bR("recording"),LT=bR("recording"),NT=bR("recording"),VT=class extends RR{startRecording(){const e=this[hR](),{meeting:{bIbDisableRecording:t,recordingEnable:o},recording:{cmrStatus:n}}=e;return t?Promise.reject({type:Il,reason:"Rejected by Information Barrier"}):o?n===Aa.Start?Promise.resolve(""):(UT.recordMeeting(!0,!1),Tc(Ra,(e=>e.cmrServerStatus===Aa.Start))):Promise.reject({type:Il,reason:"The account of the meeting disabled the cloud recording"})}pauseRecording(){const e=this[hR](),{recording:{cmrStatus:t}}=e;return t===Aa.Pause?Promise.resolve(""):t!==Aa.Start?Promise.reject({type:Il,reason:"Recording is not started"}):(UT.recordMeeting(!1,!0),Tc(Ra,(e=>e.cmrServerStatus===Aa.Pause)))}stopRecording(){const e=this[hR](),{recording:{cmrStatus:t}}=e;return t===Aa.Stop?Promise.resolve(""):(UT.recordMeeting(!1,!1),Tc(Ra,(e=>e.cmrServerStatus===Aa.Stop)))}accept(){const e=this[hR](),{recording:{cmrStatus:t,recordingIsoEnable:o}}=e,n=yp(e);return o?t!==Aa.Start&&t!==Aa.Pause?Promise.reject({type:Il,reason:"Recording is not started"}):null!=n&&n.bAllowISORecord?Promise.resolve("You accepted ISO recording"):(UT.allowSelfRecord(!0),Tc(Oa,(e=>(null==e?void 0:e.userId)===(null==n?void 0:n.userId)&&(null==e?void 0:e.status)===Ia.Accept))):Promise.reject({type:Il,reason:"ISO Recording is not enabled"})}decline(){const e=this[hR](),{recording:{cmrStatus:t,recordingIsoEnable:o}}=e,n=yp(e);return o?t!==Aa.Start&&t!==Aa.Pause?Promise.reject({type:Il,reason:"Recording is not started"}):!0===(null==n?void 0:n.bAllowISORecord)?Promise.reject({type:Il,reason:"You had accept ISO recording, cant change it"}):(UT.allowSelfRecord(!1),Promise.resolve("")):Promise.reject({type:Il,reason:"ISO Recording is not enabled"})}getRecordingStatus(){const e=this[hR](),{recording:{cmrStatus:t}}=e,o=Op(e);return t===Aa.Start?Ia.Recording:t===Aa.Pause?Ia.Paused:o?Ia.Recording:Ia.Stopped}isRecordingEnabled(){const e=this[hR](),{recording:{recordingEnable:t}}=e;return t}isAllowedToStopAutoRecording(){const e=this[hR](),{recording:{allowStopAutoRecording:t}}=e;return t}isAutomaticCloudRecordingEnabled(){const e=this[hR](),{recording:{automaticCloudRecordingEnable:t}}=e;return t}enableRecordingWithIQ(e){const{[hR]:t,[mR]:o}=this,n=t(),{recording:{isZoomIQ:r,zoomIQChanging:i},meeting:{meetingOptions:s}}=t();return s.isEnableKiwiRecording?Sp(n)?i?Promise.reject({type:Il,reason:"We are changing, please wait"}):e===r?Promise.reject({type:Il,reason:`You have ${e?"enable":"disable"} Zoom IQ, don't need change`}):(o(Og(!i)),o(Rg(!r)),UT.enableZoomIQRecord(e),Tc(ka,(e=>null==e?void 0:e.success))):Promise.reject({type:Il,reason:"Only Host or co-host can enable/disable Zoom IQ"}):Promise.reject({type:Il,reason:"You not have zoom IQ license or not enable zoom IQ, please check and retry"})}isSupportLocalRecording(){const e=this[hR](),{meeting:{meetingOptions:t,isWebinar:o},breakoutRoom:n}=e;if((null==n?void 0:n.currentRoom.status)===up.InRoom)return!1;const r=yp(e);return(!o||!rp(r.userRole))&&(null==t?void 0:t.isLocalRecordingEnabled)}isSupportLocalRecordingPermission(){const e=this[hR](),{recording:{supportLocalRecording:t}}=e;if(!this.isSupportLocalRecording())return!1;const o=yp(e);return!(null==o||!o.isHost)||t===_a.Allow}askLocalRecordingPermission(){const{[hR]:e}=this,{recording:{supportLocalRecording:t}}=e();return this.isSupportLocalRecording()?t===_a.None?(UT.localRecordingRequestPermission(),Promise.resolve("")):t===_a.Allow?Promise.resolve(""):Promise.reject("permission is denied"):Promise.reject("not support")}startLocalRecording(e){const{[hR]:t,[mR]:o}=this,n=t(),{recording:{localStatus:r,supportLocalRecording:i},meeting:{userId:s}}=n;if(!(e in Ca))return Promise.reject({type:Il,reason:"not support you parameter, only support type are 0(stop)/1(start)/2(pause)."});if(!this.isSupportLocalRecording())return Promise.reject({type:Il,reason:"not support local recording"});if(e===r)return Promise.resolve(`you currently status is ${r}, do nothing`);const a=yp(n);return i===_a.Allow||null!=a&&a.isHost?(UT.localRecordingMeeting(e),Tc(Ta,(t=>(null==t?void 0:t.userId)===s&&(o(Tg(t.bLocalRecord)),t.bLocalRecord===e)),1e3)):Promise.reject({type:Il,reason:"you not have local recording permission, please use askLocalRecordingPermission request it first"})}isSupportLocalRecordingGrantPermission(){const e=this[hR]();if(!this.isSupportLocalRecording())return!1;const t=yp(e);return!(null==t||!t.isHost)&&!!uy(t.caps)}grantLocalRecordingPermission(e,t,o){const{[hR]:n,[mR]:r}=this,i=n(),{recording:{localPermissionUserList:s}}=i;if(!this.isSupportLocalRecording())return Promise.resolve(!1);const a=yp(i);if(!uy(a.caps))return Promise.reject({type:Il,reason:"you can not grant permission"});let u=!1;if(o&&(u=!0),s.filter((t=>t===e)).length>0){if(t===_a.Allow)UT.localRecordingGrantPermission(e,!0,u);else{if(t!==_a.Deny)return Promise.reject({type:Il,reason:"only support DENY(1)/ALLOW(2)"});UT.localRecordingGrantPermission(e,!1,u)}return r(kg(s.filter((t=>t!==e)))),Rc(Da,{type:"answer",value:t===_a.Allow}),Promise.resolve(!1)}return t!==_a.Deny?Promise.reject({type:Il,reason:"Direct grant only support DENY(1)"}):(UT.hostGrantPermission(e,!1),Tc(Da,(o=>(null==o?void 0:o.value)===e&&(t===_a.Allow?(r(kg([...s,e])),!0===(null==o?void 0:o.canRecord)):(r(kg(s.filter((t=>t!==e)))),!1===(null==o?void 0:o.canRecord)))),1e3))}getLocalRecordingPermissionUserList(){const e=this[hR](),{recording:{localPermissionUserList:t}}=e;if(!this.isSupportLocalRecording())return Promise.resolve(!1);const o=yp(e);return uy(o.caps)?t:Promise.reject({type:Il,reason:"you can not grant permission"})}getLocalRecordingPermissionOperation(){const e=this[hR](),{recording:{localGrantPermissionOption:t}}=e;if(!this.isSupportLocalRecording())return null;const o=yp(e);return uy(o.caps)?t:null}},cR(VT.prototype,"startRecording",[yR,fR,RT,jT],Object.getOwnPropertyDescriptor(VT.prototype,"startRecording"),VT.prototype),cR(VT.prototype,"pauseRecording",[yR,fR,OT,jT],Object.getOwnPropertyDescriptor(VT.prototype,"pauseRecording"),VT.prototype),cR(VT.prototype,"stopRecording",[yR,fR,TT,jT],Object.getOwnPropertyDescriptor(VT.prototype,"stopRecording"),VT.prototype),cR(VT.prototype,"accept",[fR,DT,jT],Object.getOwnPropertyDescriptor(VT.prototype,"accept"),VT.prototype),cR(VT.prototype,"decline",[fR,PT,jT],Object.getOwnPropertyDescriptor(VT.prototype,"decline"),VT.prototype),cR(VT.prototype,"askLocalRecordingPermission",[fR,kT],Object.getOwnPropertyDescriptor(VT.prototype,"askLocalRecordingPermission"),VT.prototype),cR(VT.prototype,"startLocalRecording",[fR,MT],Object.getOwnPropertyDescriptor(VT.prototype,"startLocalRecording"),VT.prototype),cR(VT.prototype,"grantLocalRecordingPermission",[fR,SR,LT],Object.getOwnPropertyDescriptor(VT.prototype,"grantLocalRecordingPermission"),VT.prototype),cR(VT.prototype,"getLocalRecordingPermissionUserList",[fR,SR,NT],Object.getOwnPropertyDescriptor(VT.prototype,"getLocalRecordingPermissionUserList"),VT.prototype),VT);const xT={moduleEpics0:e=>e.pipe($t(`${Wr}`),ze((e=>{const{payload:{recordingEnable:t}}=e;return Ag(t)}))),moduleEpics1:(e,t)=>yn(e,us).pipe(mt((e=>{var t,o,n;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.cmrServerStatus)||void 0!==(null===(o=e.payload.body)||void 0===o?void 0:o.disAllowClientStopAutoCmr)||void 0!==(null===(n=e.payload.body)||void 0===n?void 0:n.enableAutomicRecordingCloud)})),Tt(t),Xe((e=>{let[t,o]=e;const{cmrServerStatus:n,disAllowClientStopAutoCmr:r,enableAutomicRecordingCloud:i}=t.payload.body,s=[];return void 0!==n&&(n!==Aa.Init&&(Rc(Ra,{cmrServerStatus:n}),o.recording.recordingIsoEnable&&n===Aa.Start&&Rc(Oa,{status:Ia.Ask})),s.push(Ig(n))),void 0!==r&&s.push(_g(!r)),void 0!==i&&s.push(wg(i)),Ue(s)}))),moduleEpics2:e=>yn(e,us).pipe(mt((e=>{var t;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.bCmrIsoEnble)})),ze((e=>{const{bCmrIsoEnble:t}=e.payload.body;return Cg(t)}))),moduleEpics3:(e,t)=>yn(e,as).pipe(Tt(t),mt((e=>{let[t]=e;const{payload:{body:{update:o,add:n}}}=t;return(null==o?void 0:o.some((e=>void 0!==e.bLocalRecordStatus||void 0!==e.canRecord)))||(null==n?void 0:n.some((e=>void 0!==e.bLocalRecordStatus||void 0!==e.canRecord)))})),Xe((e=>{let[t,o]=e;const{payload:{body:{update:n,add:r}}}=t,{meeting:{userId:i,isHost:s},recording:{supportLocalRecording:a},participants:{attendeesList:u}}=o,d=[];return null==n||n.concat(r||[]).filter((e=>void 0!==e.bLocalRecordStatus||void 0!==e.canRecord)).forEach((e=>{if(void 0!==e.canRecord){const t=Boolean(e.canRecord);if(i===e.id||s){const o=u.find((e=>e.userId===i));!t&&null!=o&&o.bLocalRecord&&(Rc(Da,{type:"revoke",value:e.id,canRecord:t}),CT.localRecordingMeeting(Ca.Stop)),!t||null!=o&&o.bLocalRecord||Rc(Da,{type:"grant",value:e.id,canRecord:t})}i===e.id&&((a!==_a.None||t)&&d.push(Dg(t?_a.Allow:_a.Deny)),t||d.push(Tg(Ca.Stop)))}else Rc(Ta,{userId:e.id,bLocalRecord:e.bLocalRecordStatus})})),Ue(d)}))),moduleEpics4:(e,t)=>yn(e,as).pipe(ze((e=>_I(e.payload.body))),Tt(t),Xe((e=>{let[t,o]=e;const n=[],{recording:{localPermissionUserList:r}}=o;return t.remove&&t.remove.forEach((e=>{r.filter((t=>t===(null==e?void 0:e.userId)))&&(n.push(kg(r.filter((t=>t!==(null==e?void 0:e.userId))))),Rc(Da,{type:"remove",value:null==e?void 0:e.userId}))})),Ue(n)}))),moduleEpics5:e=>yn(e,as).pipe(mt((e=>{const{payload:{body:{update:t}}}=e;return null==t?void 0:t.some((e=>void 0!==e.bAllowISORecord))})),Ot((e=>{const{payload:{body:{update:t}}}=e;t.filter((e=>void 0!==e.bAllowISORecord)).forEach((e=>{Rc(Oa,{userId:e.id,status:e.bAllowISORecord?Ia.Accept:Ia.Decline})}))})),Et(fe)),moduleEpics6:e=>yn(e,us).pipe(mt((e=>{var t;return void 0!==(null===(t=e.payload.body)||void 0===t?void 0:t.SalesRecordingAnalytics)})),ze((e=>{const{SalesRecordingAnalytics:t}=e.payload.body;return Rc(Pa,{isZoomIQ:t}),Rg(t)}))),moduleEpics7:(e,t)=>yn(e,4319).pipe(Tt(t),mt((e=>{var t;let[o]=e;return void 0!==(null===(t=o.payload.body)||void 0===t?void 0:t.success)})),Xe((e=>{let[t,o]=e;const n=[],{success:r}=t.payload.body,{recording:{zoomIQChanging:i}}=o;return Rc(ka,{success:r}),r&&n.push(Og(!i)),Ue(n)}))),moduleEpics8:(e,t)=>yn(e,4344).pipe(Tt(t),mt((e=>{var t;let[o]=e;return void 0!==(null===(t=o.payload.body)||void 0===t?void 0:t.cmdType)})),Xe((e=>{var t;let[o,n]=e;const r=[],{cmdType:i}=o.payload.body,{recording:{localPermissionUserList:s},meeting:{isHost:a}}=n;var u,d,l,c;("permission_req_option"===i&&(Rc(Da,{type:"option",value:null===(u=o.payload.body)||void 0===u?void 0:u.option}),r.push(Pg(null===(d=o.payload.body)||void 0===d?void 0:d.option))),"request_permission"===i&&null!==(t=o.payload.body)&&void 0!==t&&t.userId)&&(a&&Rc(Da,{type:"request",value:null===(c=o.payload.body)||void 0===c?void 0:c.userId}),r.push(kg([...s,null===(l=o.payload.body)||void 0===l?void 0:l.userId])));return"permission_request_answer"===i&&(Rc(Da,{type:"answer",value:o.payload.body.agreed}),r.push(Dg(o.payload.body.agreed?_a.Allow:_a.Deny))),Ue(r)})))},FT=fn(xT);let HT=function(e){return e[e.All=1]="All",e[e.Private=2]="Private",e}({}),$T=function(e){return e.SUCCESS="success",e}({}),WT=function(e){return e.CustomizedKey="__zoom_internal_message_customized_key__@@",e.SpeakerOnly="__zoom_internal_message_speaker_only__@@",e}({});const GT=OE.getInstance(),zT=(e,t,o)=>{const{meeting:{encType:n}}=o,r=t,i=lr(e),s=r?HT.Private:HT.All;return n===Xi.AES_GCM?rs.beginEncrypt({text:i,type:es.XMPP_CHAT}).then((e=>{GT.sendWebinarMseeage(e,r,s,!0)})):GT.sendWebinarMseeage(i,r,s,!1)};function KT(e,t){const{cmd:{jids:o}}=t;return Object.prototype.hasOwnProperty.call(o,e)?Promise.resolve():Fe(Dc(Ks).pipe(At((t=>-1===t.findIndex((t=>Number(t.userId)===e)))),ft(1),Le(he)))}function qT(e){const{cmd:{connectionStatus:t}}=e;return t===$T.SUCCESS?Promise.resolve(!0):Fe(Dc(Sa,1)).then((e=>e===Oi.Connected||Promise.reject({type:Il,reason:"Cannot establish the command channel"})))}function JT(e,t){for(const[o,n]of Object.entries(e))if(n.jid===t)return o}const QT={connectionStatus:"initial",jids:{}},ZT=ko({[`${Ug}`]:()=>({...QT}),[`${Lg}`]:fE(((e,t)=>{let{payload:o}=t;const{data:n,attendees:r}=o;n.forEach((t=>{const{jid:o,node:n}=t;if(!e.jids[n]||e.jids[n].jid!==o){const t=r.find((e=>e.userId===Number(n)));e.jids[n]={jid:o,userGuid:null==t?void 0:t.userGUID}}}))})),[`${Ng}`]:fE(((e,t)=>{let{payload:o}=t;o.forEach((t=>{const{jid:o}=t,n=JT(e.jids,o);n&&delete e.jids[n]}))})),[`${Vg}`]:fE(((e,t)=>{let{payload:o}=t;e.connectionStatus=o}))},QT);var YT;let XT=(YT=class extends RR{send(e,t){if(!e)return Promise.reject({type:Rl,reason:"Text is empty"});if("string"!=typeof e)return Promise.reject({type:Rl,reason:"Text is not a string"});if(e.length>512)return Promise.reject({type:Rl,reason:"Text exceeds the max length(512)."});const{[hR]:o}=this,n=o(),{socket:{xmppSocketStatus:r},meeting:{userId:i}}=n;return r!==Dp.Connected?Promise.reject({type:wl,reason:"Command channel is not ready"}):qT(n).then((()=>t?-1!==Ap(o()).findIndex((e=>e.userId===t))?KT(t,n).then((()=>{const{cmd:{jids:n}}=o();return n[t]?(zT(e,n[t].jid,o()),{timestamp:(new Date).getTime(),text:e,receiverId:t,senderId:i}):Promise.reject({type:Al})})):Promise.reject({type:Rl,reason:"Cannot find the user"}):(zT(e,"",n),{timestamp:(new Date).getTime(),text:e,receiverId:0,senderId:i})))}getJids(){const{[hR]:e}=this,t=e(),{cmd:{jids:o}}=t;return o}},cR(YT.prototype,"send",[fR],Object.getOwnPropertyDescriptor(YT.prototype,"send"),YT.prototype),YT);const eD={extraEpics0:(e,t)=>e.pipe($t(`${lh}`),_t((e=>{const{payload:{speakerOnly:o}}=e,n=yp(t.value);return(void 0!==(null==n?void 0:n.audio)?Ue([n.audio]):Dc($s).pipe(mt((e=>void 0!==e.audio)),ft(1))).pipe(Ot((()=>{qT(t.value).then((()=>{zT(`${WT.SpeakerOnly}${o?1:0}`,"",t.value)}))})),Et(fe))}))),extraEpics1:(e,t)=>yn(e,as).pipe(mt((e=>{var o,n;const{payload:{body:r}}=e;return!!r.add&&!(null===(o=t.value.audio)||void 0===o||null===(n=o.customizeAudioOption)||void 0===n||!n.speakerOnly)})),Le(he),Ot((async e=>{const{payload:{body:{add:o}}}=e,n=t.value,{meeting:{userId:r}}=n;for(let e=0;e{zT(`${WT.SpeakerOnly}1`,e[n].jid,t.value)}),Math.floor(Math.random()*Math.log10(o.length)*1e3))}}})),Et(fe))},tD={epics0:(e,t)=>bn(e,24577).pipe(Tt(t),ze((e=>{let[t]=e;const{payload:{body:{status:o}}}=t;return o===$T.SUCCESS&&Rc(Sa,Oi.Connected),Vg(o)}))),epics1:(e,t)=>bn(e,24583).pipe(Tt(t),Xe((e=>{let[t,o]=e;const{meeting:{userId:n,encType:r},cmd:{jids:i}}=o,{payload:{body:{senderName:s,senderJid:a,text:u,type:d,receiver:l,msgid:c,sn:p}}}=t,h=JT(i,l),m=r===Xi.AES_GCM,v=JT(i,a),g=(new Date).getTime();let f=Promise.resolve({message:u});return m&&(f=rs.beginDecrypt({decryptedText:u,type:es.XMPP_CHAT,zoomId:p})),f.then((e=>{let{message:t}=e;if(d===HT.Private&&Number(h)===n||d===HT.All){const e=dr(t);if(null!=e&&e.startsWith(WT.SpeakerOnly)){const t=e.substring(WT.SpeakerOnly.length),o=1===Number(t);return $c({userId:Number(v),key:"isSpeakerOnly",value:o})}{var o;const t=v&&(null===(o=i[v])||void 0===o?void 0:o.userGuid);Rc(ya,{senderId:v,senderName:s,senderGuid:t,text:e,timestamp:g,msgid:c})}}return""}))})),mt((e=>"object"==typeof e&&null!==e&&void 0!==e.type)),Ot((e=>{const{payload:{userId:t,key:o,value:n}}=e;Rc(Gs,[{userId:t,[`${o}`]:n}])}))),epics2:(e,t)=>bn(e,24595).pipe(Xe((e=>{const{payload:{body:{action:o,data:n}}}=e,r=[];if([wE.List,wE.Add,wE.update].includes(o)&&n){const{breakoutRoom:e,participants:{attendeesList:o}}=t.value,i=(null==e?void 0:e.currentRoom.status)===up.InRoom?o.concat(e.mainSessionAttendeeList):o;r.push(Lg({data:n,attendees:i}))}return o===wE.Remove&&n&&r.push(Ng(n)),Ue(r)})))},oD=fn(tD,eD),nD=(e,t,o,n)=>{const{getState:r,dispatch:i}=o,s=r(),{participants:{attendeesList:a},audio:{localShareAudioUserMutedList:u},share:{isReceiveSharingFromMainSession:d},breakoutRoom:l}=s,c=(d?null==l?void 0:l.mainSessionAttendeeList:a).find((t=>t.userId==e));if(c){if(c.bShareAudioOn){const o=u.find((t=>t.userId===e));return o&&o.muted===!t&&i(EA(n,e,t,s)),Promise.resolve("")}return Promise.reject({type:Il,reason:`Cannot ${t?"mute":"unmute"} share audio when the user's share audio is not enable.`})}return Promise.reject({type:Rl,reason:"Cannot find the user"})},rD=(e,t)=>{const{store:{getState:o},rwgAgent:n}=e,{share:{sharePrivilege:r}}=o();return r===t?Promise.resolve(""):Object.values(za).includes(t)?(n.lockSharing(t),Tc(ea,(e=>e.lockShare===t))):Promise.reject({type:Rl})},iD=qc([Ap],(e=>e.filter((e=>e.bVideoOn)))),sD=qc([iD],(e=>e.filter((e=>(e.caps&sy)===sy)))),aD=(e,t)=>{const o=e.store.getState(),n=py(o).find((e=>e.userId===t));if(n){const{caps:e}=n;return(e=>512==(512&e))(e)}return!1};var uD,dD,lD,cD,pD,hD,mD,vD,gD,fD,yD,SD,bD,ED,ID,AD,CD,_D,wD,RD,OD,TD,DD,PD,kD,MD,LD,ND,VD,UD,jD,BD,xD,FD,HD,$D,WD,GD,zD,KD,qD,JD,QD,ZD,YD,XD,eP,tP,oP,nP,rP,iP,sP,aP,uP,dP,lP,cP,pP,hP,mP,vP,gP,fP,yP,SP,bP,EP,IP,AP,CP,_P,wP,RP,OP,TP,DP;const PP=_R("Audio"),kP=_R("Video"),MP=_R("Sharing"),LP=_R("CameraControl"),NP=_R("Remote Control"),VP=wR(HTMLCanvasElement,0),UP=wR([HTMLCanvasElement,HTMLVideoElement],0),jP=wR(HTMLCanvasElement,0,["id"]),BP=wR([HTMLCanvasElement,HTMLVideoElement],0,["id"]);let xP=(uD=bR("audio"),dD=bR("audio"),lD=bR("audio"),cD=bR("audio"),pD=bR("audio"),hD=_R("Audio",[1,2,3]),mD=bR("audio"),vD=_R("Audio",[1,2]),gD=bR("audio"),fD=bR("audio"),yD=bR("audio"),SD=bR("audio"),bD=bR("share"),ED=bR("audio"),ID=bR("share"),AD=bR("audio"),CD=bR("audio"),_D=bR("audio"),wD=bR("audio"),RD=bR("audio"),OD=bR("audio"),TD=_R("Audio",[1,2]),DD=bR("audio"),PD=_R("Audio",[1,2]),kD=bR("video"),MD=bR("video"),LD=bR("video"),ND=bR("video"),VD=bR("video"),UD=bR("video"),jD=bR("video"),BD=bR("video"),xD=bR("video"),FD=bR("video"),HD=bR("video"),$D=bR("video"),WD=bR("video"),GD=bR("video"),zD=bR("video"),KD=bR("video"),qD=bR("video"),JD=bR("video"),QD=bR("video"),ZD=bR("video"),YD=bR("video"),XD=bR("video"),eP=bR("video"),tP=bR("video"),oP=bR("video"),nP=bR("video"),rP=bR("share"),iP=bR("share"),sP=bR("share"),aP=bR("share"),uP=bR("share"),dP=bR("share"),lP=bR("share"),cP=bR("share"),pP=ER("isShareOptionLocked"),hP=ER("isShareOptionLocked"),mP=bR("share"),vP=bR("share"),gP=bR("share"),fP=bR("share"),yP=bR("share"),SP=bR("share"),bP=bR("share"),EP=bR("share"),IP=bR("share"),AP=bR("share"),CP=bR("share"),_P=bR("share"),wP=bR("share"),RP=bR("share"),OP=bR("share"),TP=bR("share"),DP=class extends RR{constructor(e){super(e),this[pR].dispatch(Jo()),this[gR]={store:e,mediaAgent:xf(ab(Fs.getInstance())),rwgAgent:Ls.createAgent()}}startAudio(e){return((e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=yp(s);if((null==a?void 0:a.audio)===Iu.Computer)return Promise.resolve("");if((null==a?void 0:a.audio)===Iu.Phone)return Promise.reject({type:Il,reason:"joined by phone"});{const{audio:{isAllowToTalk:e,isComputerAudioLoading:u,canPlayAudio:d,customizeAudioOption:{speakerOnly:l}},media:{audioDecodeStatus:c,audioEncodeStatus:p}}=s;if(u)return Promise.reject({type:Il,reason:"Computer audio has been loading, please wait."});const h=function(e){const t=e?{...e}:void 0;if(TA(zi())||!0!==(null==t?void 0:t.backgroundNoiseSuppression)||(console.warn("Background noise suppression requires SharedArrayBuffer and is only supported on desktop browser"),Object.assign(t,{backgroundNoiseSuppression:void 0})),void 0!==(null==t?void 0:t.originalSound)){t.backgroundNoiseSuppression&&t.originalSound&&(console.warn("Enabling original sound will disable background noise suppression."),Object.assign(t,{backgroundNoiseSuppression:!1}));const{originalSound:e}=t;"object"==typeof e&&e.stereo&&!DA()&&(console.warn("Cannot enable stereo audio on current platform due to the browser limitation"),Object.assign(e,{stereo:!1}))}return PA()||!0!==(null==t?void 0:t.syncButtonsOnHeadset)||(console.warn("Sync buttons on headset is not supported on the current platform"),Object.assign(t,{syncButtonsOnHeadset:void 0})),null!=t&&t.mediaFile&&!Fs.isSupportMediaPlaybackAsVideoInput()&&(console.warn("Cannot use media file as audio input due to the browser limitation"),Object.assign(t,{mediaFile:void 0})),t}(t);n(lh(null!=h?h:{}));const{speakerOnly:m,autoStartAudioInSafari:v}=h||{};if(!!l!=!!m&&n($c({userId:s.meeting.userId,key:"isSpeakerOnly",value:!!m})),!a)return Promise.reject({type:Il,reason:"Please call `startAudio` method after the `join` has been resolved"});{const t=rp(a.userRole)&&!e||m,{encodeInitStatus:u,decodeInitStatus:l}=kA(s,a,m);if(wA()&&("success"!==l||"success"!==u))return Promise.reject({type:Il,reason:"It is required to wait for the audio encoding and decoding to be ready before calling `startAudio` method"});n(Jp(!0)),Pf("audio",u,l).subscribe((s=>{let[u,l]=s;if(u&&l){let s=d||(wA()||Gi.isIOSMobile)&&!v?Promise.resolve():function(){const e=URL.createObjectURL($a),t=new Audio(e);t.muted=!1;const o=yr((()=>Promise.reject()),3e3),n=Gi.isIOSMobile?new Promise(((e,o)=>{var n;t.addEventListener("canplaythrough",(()=>{t.play().then((()=>{e(!0)})).catch((e=>{o(e)}))})),null===(n=t.load)||void 0===n||n.call(t)})):t.play();return Promise.race([n,o]).finally((()=>{URL.revokeObjectURL(e)}))}();void 0===s&&(s=Promise.resolve()),s.then((()=>Mf("audio",o()))).then((()=>{const s=o(),{audio:{isSharingAudio:u}}=s;MA(r,s,t),u&&!OA()||IA(i,s,!t),rp(a.userRole)&&e&&n(Qp(!0)),n(Kp(!0))})).catch((()=>{n(Kp(!1)),n(Jp(!1))}))}else n(Jp(!1))}))}return"failed"===p||"failed"===c?(n(Jp(!1)),Promise.reject({type:Al,reason:"audio encode or decode error"})):new Promise(((e,t)=>{vt(Dc(Wd.JoinComputerAudio.success,1),ct(...Wd.JoinComputerAudio.fail.map((e=>Dc(e,1).pipe(Xe((()=>Be({type:_l,reason:e}))))))),dt(45e3).pipe(Xe((()=>Be({type:Cl}))))).subscribe({next:()=>{n(Jp(!1)),e("")},error:e=>{Fs.getInstance().leaveComputerAudio();const i=yp(o());(null==i?void 0:i.audio)!==Iu.Phone&&(n(bh(xa.MicrophoneError)),r.joinOrLeaveVoip(!1)),n(Jp(!1)),t(e)}})}))}})(this[gR],e)}stopAudio(){return(async e=>{const{store:{getState:t,dispatch:o},mediaAgent:n,rwgAgent:r}=e,i=t(),{audio:{isComputerAudioLoading:s,isShareAudioEnabled:a,isSharingAudio:u,isUsingMediaPlayback:d,customizeAudioOption:{speakerOnly:l}}}=i,c=yp(i);if(s)return Promise.reject({type:Il,reason:"Computer audio has not finished joining, please wait."});if(a){if(u&&!OA())return Promise.reject({type:Il,reason:"Cannot stop audio during sharing with audio"});o(eh(void 0)),o(Zp(void 0))}return(null==c?void 0:c.audio)===Iu.Computer?(o(bh(xa.Active)),await n.leaveComputerAudio(),r.joinOrLeaveVoip(!1),l&&o($c({userId:i.meeting.userId,key:"isSpeakerOnly",value:void 0})),d&&SA.getInstance().stopAudioElement(),o(Hp(0)),Tc(Sd)):Promise.resolve("")})(this[gR])}muteAudio(e){return((e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=yp(s);if(null==t||t===(null==a?void 0:a.userId))return""===(null==a?void 0:a.audio)||null===(null==a?void 0:a.audio)?Promise.reject({type:Il,reason:"no audio joined"}):!0===(null==a?void 0:a.muted)?Promise.resolve(""):(n(fh(ja.Active)),r.mute(a.userId,!0),i.muteAudio(),s.audio.isShareAudioEnabled&&!OA()&&n(Zp(!0)),Tc(bd).then((()=>"")));if(Sp(s)){const{participants:{allowTalkAttendeesList:e,attendeesList:o}}=s,n=e.concat(o).find((e=>e.userId===t));return n?""===n.audio||null===n?Promise.reject({type:Il,reason:"no audio joined"}):!1===n.muted?(r.mute(t,!0),Tc(Id,(e=>e.id===t&&1==e.muted))):Promise.resolve(""):Promise.reject({type:Rl,reason:"no matching user"})}return Promise.reject({type:_l})})(this[gR],e)}unmuteAudio(e){return(async(e,t)=>{const{store:{getState:o,dispatch:n},rwgAgent:r,mediaAgent:i}=e,s=o(),a=yp(s);if(void 0===t||t===(null==a?void 0:a.userId)){if(""===(null==a?void 0:a.audio)||null===(null==a?void 0:a.audio))return Promise.reject({type:Il,reason:"no audio joined"});if(!1===(null==a?void 0:a.muted))return Promise.resolve("");if(s.audio.isShareAudioEnabled&&!OA()){if(s.audio.isSharingAudio)return Promise.reject({type:Il,reason:"Cannot unmute audio during sharing with audio"});n(Zp(!1))}if(s.audio.bCanUnmute||null!=a&&a.isHost||null!=a&&a.bCoHost){if(rp(a.userRole)){const{audio:{isAllowToTalk:e,isAllowToTalkAttendeeConnected:t}}=s;e?t||(await i.leaveComputerAudio(),await IA(i,s,!0),n(Qp(!0))):Promise.reject({type:Il,reason:"Webinar attendee cannot unmute self audio."})}return n(yh(Ba.Active)),r.mute(a.userId,!1),i.unmuteAudio(),Tc(Ed).then((()=>""))}return Promise.reject({type:_l,reason:"host not allow unmute themselves"})}if(Sp(s)){const{participants:{allowTalkAttendeesList:e,attendeesList:o}}=s,n=e.concat(o).find((e=>e.userId===t));return n?""===n.audio||null===n?Promise.reject({type:Il,reason:"no audio joined"}):(!0===n.muted&&r.mute(t,!1),Promise.resolve("")):Promise.reject({type:Rl,reason:"no matching user"})}return Promise.reject({type:_l})})(this[gR],e)}dialOut(e,t,o,n){return((e,t,o,n,r)=>{const{store:{getState:i,dispatch:s},rwgAgent:a}=e,u=i(),{meeting:{callOutCountry:d,isSupportCallOut:l}}=u;if(l&&Array.isArray(d)&&d.findIndex((e=>e.code===t))>-1){const{seq:e}=a.audioDialout(t+o,n,!(null==r||!r.callMe),!(null==r||!r.pressingOne),!(null==r||!r.greeting));return s(Np({sequence:e,phoneNumber:t+o})),Oc(Wd.JoinAudioByCallMe)}return Promise.reject({type:Rl,reason:"no matching country code"})})(this[gR],e,t,o,n)}cancelDialOut(e,t,o){return((e,t,o,n)=>{const{rwgAgent:r}=e;return r.audioCancelDialout(t+o,!(null==n||!n.callMe)),Oc(Wd.cancelDialOut)})(this[gR],e,t,o)}hangup(){return(e=>{const{store:{getState:t},rwgAgent:o}=e,n=t(),r=yp(n);return(null==r?void 0:r.audio)===Iu.Phone&&null!==r.userId?(o.audioDrop(r.userId),Oc(Wd.hangup)):Promise.reject({type:Il,reason:"not joined audio by phone"})})(this[gR])}switchMicrophone(e){return((e,t)=>{const{store:{getState:o,dispatch:n},mediaAgent:r}=e,i=o(),{audio:{microphoneDevicesList:s,activeMicrophone:a,mediaPlaybackFile:u,isUsingMediaPlayback:d}}=i,l=s.find((e=>e.deviceId===t));if("default"===t||"string"!=typeof t||l){const e=yp(i);if((null==e?void 0:e.audio)===Iu.Computer){let o=!1;if("string"==typeof t)t!==a&&(r.changeMicrophone(t,null==l?void 0:l.label,!(null==e||!e.muted)),n(hh(void 0)),SA.getInstance().stopAudioElement(),o=!0);else if(t&&(!d||(null==u?void 0:u.url)!==t.url)){const i=SA.getInstance();i.setAudioElement(t).then((()=>{r.changeMicrophone(i.audioElement,void 0,!(null==e||!e.muted)),n(hh(t))})),o=!0}if(o)return Oc(Wd.JoinComputerAudio)}else"string"==typeof t&&n(Gp(t));return Promise.resolve("")}return Promise.reject({type:kd})})(this[gR],e)}switchSpeaker(e){return((e,t)=>{const{store:{getState:o,dispatch:n},mediaAgent:r}=e,{audio:{speakerDevicesList:i,activeSpeaker:s}}=o();if("default"!==t&&-1==i.findIndex((e=>e.deviceId===t)))return Promise.reject({type:kd});var a;if((null===(a=yp(o()))||void 0===a?void 0:a.audio)===Iu.Computer){if(t!==s)return r.changeSpeaker(t),Tc(Ud,(e=>e))}else n(zp(t));return Promise.resolve("")})(this[gR],e)}muteShareAudio(e){return((e,t)=>{const{mediaAgent:o,rwgAgent:n,store:{getState:r,dispatch:i}}=e,s=r(),{meeting:{userId:a}}=s;if(t&&t!==a)return nD(t,!0,e.store,o);{const{audio:{isSharingAudio:e,isShareAudioEnabled:t,isShareAudioMuted:r}}=s;if(!t)return Promise.reject({type:Il,reason:"Cannot mute sharing audio when sharing audio is not enable"});if(r)return Promise.resolve("");{n.muteShareAudio(!0);let t=Promise.resolve();var u;return e&&(t=null===(u=o.leaveSharingAudio(!0))||void 0===u?void 0:u.then((()=>AA(o,n,s).then((e=>{e.forEach((e=>i(e)))}))))),EA(o,a,!0,s),Promise.all([Tc({event:$s,operations:[mt((e=>void 0!==e.bShareAudioOn)),ft(1)]},(e=>!1===e.bShareAudioOn)),t]).then((()=>(i(oh(!0)),e&&(i(nh(!1)),Rc(Ld,{state:"off"})),"")))}}})(this[gR],e)}unmuteShareAudio(e){return((e,t)=>{const{mediaAgent:o,rwgAgent:n,store:{getState:r,dispatch:i}}=e,s=r(),{meeting:{userId:a}}=s;if(t&&t!==a)return nD(t,!1,e.store,o);{const{audio:{isSharingAudio:e,isShareAudioEnabled:t,isShareAudioMuted:r},share:{status:u}}=s;if(!t)return Promise.reject({type:Il,reason:"Cannot unmute sharing audio when sharing audio is not enable"});if(!1===r)return Promise.resolve("");{n.muteShareAudio(!1);let t=Promise.resolve();return!1===e&&u===Ka.Sharing&&(t=_A(o,n,s).then((e=>{e.forEach((e=>i(e)))}))),EA(o,a,!1,s),Promise.all([Tc({event:$s,operations:[mt((e=>void 0!==e.bShareAudioOn)),ft(1)]},(e=>!0===e.bShareAudioOn)),t]).then((()=>(i(oh(!1)),!1===e&&u===Ka.Sharing&&(i(nh(!0)),Rc(Ld,{state:"on"})),"")))}}})(this[gR],e)}subscribeAudioStatisticData(e){return(async(e,t)=>{const{mediaAgent:o,store:{getState:n}}=e,r=n(),i=yp(r),s=!t||t.decode,a=!t||t.encode;if(!i)return Promise.reject({type:Il,reason:"Call this function after the 'join' method resolved."});{const{encodeInitStatus:e,decodeInitStatus:t}=kA(r,i);Pf("audio",e,t).subscribe((e=>{let[t,n]=e;t&&n&&(s&&o.subscribeToQos([Bs.AudioDecode],ru),a&&o.subscribeToQos([Bs.AudioEncode],ru))}))}return""})(this[gR],e)}unsubscribeAudioStatisticData(e){return(async(e,t)=>{const{mediaAgent:o,store:{dispatch:n}}=e,r=!t||t.decode,i=!t||t.encode;return r&&(o.unsubscribeFromQos([Bs.AudioDecode]),n(rh(hu))),i&&(o.unsubscribeFromQos([Bs.AudioEncode]),n(ih(hu))),null})(this[gR],e)}enableBackgroundNoiseSuppression(e){return((e,t)=>{const{mediaAgent:o,store:{getState:n,dispatch:r}}=e,{audio:{isBackgroundNoiseSuppression:i,originalSound:s}}=n();let a=t;return a===!!i||(a&&!TA(zi())?(console.warn("Background noise suppression requires SharedArrayBuffer and is only supported on desktop browser"),a=!1):(a&&s&&(console.warn("Enabling noise suppression will disable original sound."),r(Sh(!1))),r(ch(a)),o.changeAudioProfile(bA(n())))),Promise.resolve("")})(this[gR],e)}enableSyncButtonsOnHeadset(e){return((e,t)=>{const{mediaAgent:o,store:{getState:n,dispatch:r}}=e,i=n(),{audio:{isHIDEnabled:s,microphoneDevicesList:a,activeMicrophone:u}}=i;if(t===!!s)return Promise.resolve("");{const e=yp(i);var d;return e?(t&&!PA()?console.warn("Sync buttons on headset is not supported on the current platform"):(o.enableSyncButtonsOnHeadset(t,null===(d=a.find((e=>e.deviceId===u)))||void 0===d?void 0:d.label,e.muted),r(ph(t))),Promise.resolve("")):Promise.reject({type:Il,reason:"Please call `enableSyncButtonsOnHeadset` method after the `join` has been resolved"})}})(this[gR],e)}enableOriginalSound(e){return((e,t)=>{const{mediaAgent:o,store:{getState:n,dispatch:r}}=e,{audio:{isBackgroundNoiseSuppression:i,originalSound:s}}=n(),a=t;return a===s||"object"==typeof t&&gr(t,s)||("object"!=typeof a||!0!==(null==a?void 0:a.stereo)||DA()||(console.warn("Cannot enable stereo audio on current platform due to the browser limitation"),a.stereo=!1),i&&a&&(console.warn("Enabling original sound will disable background noise suppression."),r(ch(!1))),r(Sh(a)),o.changeAudioProfile(bA(n()))),Promise.resolve("")})(this[gR],e)}callCRCDevice(e,t){return((e,t,o)=>{const{rwgAgent:n,store:{dispatch:r,getState:i}}=e,{seq:s}=n.inviteCRCDevice(t,o);return r(Ih({sequence:s,ip:t,protocol:o})),Oc(Wd.crcCallOut).then((()=>{var e;const{audio:{crcDevice:n}}=i();return null===(e=n.find((e=>e.ip===t&&e.protocol===o&&e.sequence===s)))||void 0===e?void 0:e.uuid}))})(this[gR],e,t)}cancelCallCRCDevice(e,t){return((e,t,o)=>{const{rwgAgent:n,store:{getState:r}}=e,{audio:{crcDevice:i}}=r(),s=i.find((e=>e.ip===t&&e.protocol===o));return s&&s.returnCode===Mu.Ringing?(n.cancelInviteCRCDevice(s.transId),Promise.resolve("")):Promise.reject({type:Il,reason:"Cannot cancel call out "})})(this[gR],e,t)}getMicList(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?[...o.audio.microphoneDevicesList]:[]})(this[gR])}getSpeakerList(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?[...o.audio.speakerDevicesList]:[]})(this[gR])}getAudioState(e){return((e,t)=>{let{store:{getState:o}}=e;const n=o(),{meeting:{isWebinar:r}}=n;let i=null;return null==t?i=yp(n):(i=n.participants.attendeesList.find((e=>e.userId===t)),r&&!i&&(i=n.participants.xmppAttendeeList.find((e=>e.userId===t)))),i?i.audio:null})(this[gR],e)}isAudioMuted(e){return((e,t)=>{let{store:{getState:o}}=e;const n=o(),{meeting:{isWebinar:r}}=n;let i=null;return void 0===t?i=yp(n):(i=n.participants.attendeesList.find((e=>e.userId===t)),r&&!i&&(i=n.participants.xmppAttendeeList.find((e=>e.userId===t)))),!!i&&!!i.muted})(this[gR],e)}getActiveMicrophone(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?o.audio.activeMicrophone:null})(this[gR])}getActiveSpeaker(){return(e=>{let{store:{getState:t}}=e;const o=t();return o.audio?o.audio.activeSpeaker:null})(this[gR])}isSupportCallOut(){return(e=>{let{store:{getState:t}}=e;const{meeting:{isSupportCallOut:o,callOutCountry:n}}=t();return o&&Array.isArray(n)&&(null==n?void 0:n.length)>0})(this[gR])}getDialOutStatus(){return(e=>{let{store:{getState:t}}=e;const{audio:o}=t();return null==o?void 0:o.dialout[o.dialout.length-1].returnCode})(this[gR])}getDialOutCountries(){return(e=>{let{store:{getState:t}}=e;const{meeting:{callOutCountry:o}}=t();return Array.isArray(o)?o:[]})(this[gR])}getShareAudioStatus(){return(e=>{let{store:{getState:t}}=e;const{audio:{isShareAudioEnabled:o,isShareAudioMuted:n,isSharingAudio:r}}=t();return{isShareAudioEnabled:o,isShareAudioMuted:n,isSharingAudio:r}})(this[gR])}isOthersShareAudioMutedLocally(e){return((e,t)=>{var o;let{store:{getState:n}}=e;const{audio:{localShareAudioUserMutedList:r}}=n();return null===(o=r.find((e=>e.userId===t)))||void 0===o?void 0:o.muted})(this[gR],e)}getAudioStatisticData(){return(e=>{let{store:{getState:t}}=e;const{audio:{statistic:o}}=t();return{...o}})(this[gR])}getDialInInfo(){return(e=>{let{store:{getState:t}}=e;const{meeting:{meetingNumber:o,tollNumbers:n,participantID:r,h323Password:i}}=t();return void 0===n?null:{meetingId:o,participantId:r,password:i||"",tollNumbers:n.map((e=>({...e})))}})(this[gR])}isSupportMicrophoneAndShareAudioSimultaneously(){return OA()}startVideo(e){return((e,t)=>{const{store:{getState:o,dispatch:n},mediaAgent:r}=e,i=o(),{media:{videoDecodeStatus:s,videoEncodeStatus:a,enforceVirtualBackground:u},video:{isCaptureCameraLoading:d,isCurrentUserStartedVideo:l,isVideoMuted:c}}=i,p=t?{...t}:void 0;if(l)return Promise.reject({type:Il,reason:"Video is started"});if(d)return Promise.reject({type:Il,reason:"Camera is starting,please wait."});if(c&&!Sp(i))return Promise.reject({type:Il,reason:"Video is muted by the host"});if(Ew(u)&&!((null==p?void 0:p.videoElement)instanceof HTMLVideoElement)){console.warn('Rendering self-view on Chromium browser, Android browser without SharedArrayBuffer or iOS browser requires video tag, Please pass a video element instead of a canvas element in the "renderVideo" method');let e=document.body.querySelector(`#${pu}`);if(!e){e=document.createElement("video");const t=Gi.isSafari||Gi.isIOSMobile?"position:fixed;top:-10000px;left:-10000px":"display:none";e.setAttribute("style",t),e.muted=!0,e.playsInline=!0,e.autoplay=!0,e.id=pu,document.body.appendChild(e)}p&&Object.assign(p,{videoElement:e})}return!Ff(u)&&null!=p&&p.virtualBackground?Promise.reject({type:Rl,reason:"Virtual background only compatible with Chrome and Edge with SharedArrayBuffer enabled."}):(n(fm(!0)),Pf("video",a,s).subscribe((e=>{let[t]=e;if(t){const e=o(),{video:{activeCamera:t,isSupportHDVideo:i,virtualBackground:{imageSrc:s},mask:{imageSrc:a}}}=e,{cameraId:u=t,captureWidth:d=0,captureHeight:l=0,mirrored:c,hd:h,fullHd:m,virtualBackground:v,mask:g}=p||{};c&&r.mirrorVideo(c),(h||m)&&(console.log("HD support is currently limited, and comes with a number of restrictions and limitations. Please visit https://developers.zoom.us/docs/video-sdk/web/video/#720p-video for more details"),i&&Fs.isCompatibleHardwareForEncode()&&Fs.isSupportVideoEncodeHardwareAcceleration().then((e=>{e&&(r.enableHardwareAccelerationForVideoEncode(!0),n(Nm({encode:e})))})),i||console.warn("Cannot capture HD video due to either account restriction and/or hardware limitation"));const f=v||void 0===v&&!!s&&void 0===g,y=g||void 0===g&&!!a;let S=Promise.resolve({});if(f){const t=v||{imageUrl:void 0,cropped:void 0};S=Mw({...t,captureWidth:d,captureHeight:l,cameraId:u,hd:h},r,e).then((()=>t))}else if(y){const t=g||{imageUrl:void 0,cropped:void 0,clip:void 0,rootWidth:void 0,rootHeight:void 0};t.rootWidth||Object.assign(t,{rootWidth:1280}),t.rootHeight||Object.assign(t,{rootHeight:720}),S=Lw({...t,captureWidth:d,captureHeight:l,cameraId:u,hd:h},r,e).then((()=>t))}null!=p&&p.mediaFile&&!Fs.isSupportMediaPlaybackAsVideoInput()&&(console.warn("Cannot use media file as video input due to the browser limitation."),Object.assign(p,{mediaFile:void 0})),S.then((e=>Mf("video",o()).then((()=>e)))).then((t=>{gw(r,e,p).forEach((e=>{n(e)})),f?n(km(t)):y&&n(Jm(t))})).catch((e=>{n(fm(!1)),Rc($u,{reason:e})}))}else n(fm(!1))})),Oc(pd.startCaptureVideo).then((()=>{n(ym(!1)),n(mm(!1))})).finally((()=>{n(fm(!1))})))})(this[gR],e)}stopVideo(){return(e=>{const{store:{getState:t},mediaAgent:o}=e,{video:{isCaptureCameraLoading:n,isCurrentUserStartedVideo:r,isUsingMediaPlayback:i}}=t();return n?Promise.reject({type:Il,reason:"Camera is starting,please wait."}):r?(o.stopCaptureVideo(),i&&SA.getInstance().stopVideoElement(),Tc(zu,(e=>!0!==(null==e?void 0:e.failed)))):Promise.reject({type:Il,reason:"camera is closed"})})(this[gR])}switchCamera(e){return((e,t)=>{const{store:{getState:o,dispatch:n},mediaAgent:r}=e,i=o(),{video:{cameraDevicesList:s,isCurrentUserStartedVideo:a,virtualBackground:u,mask:d,mediaPlaybackFile:l,isUsingMediaPlayback:c,customizedVideoOption:p}}=i;if("string"==typeof t&&!mw(t,s))return Promise.reject({type:Rl,reason:"Cannot find cameraDeviceId in camera devices list."});if(a||null!=u&&u.isVBConfigured||d.isMaskConfigured){if("string"==typeof t){const{captureWidth:e,captureHeight:o}=hw(p);r.changeCamera(t,{width:e,height:o}),n(Ym(void 0)),SA.getInstance().stopVideoElement()}else if(t&&(!c||(null==l?void 0:l.url)!==t.url)){const e=SA.getInstance();e.setVideoElement(t).then((()=>{r.changeCamera(e.videoElement),n(Ym(t))}))}return Oc(pd.switchCameraVideo).then((()=>{n(ym(!1)),n(mm(!1))}))}return Promise.resolve()})(this[gR],e)}renderVideo(e,t,o,n,r,i,s,a,u){return((e,t,o,n,r,i,s,a,u,d)=>{const{store:{getState:l,dispatch:c},mediaAgent:p,rwgAgent:h}=e,m=l(),{meeting:{userId:v},media:{enforceMultipleVideos:g,enforceVirtualBackground:f,disableRenderLimits:y},video:{subscribedVideoList:S,renderedVideoList:b}}=m,E=Ji(!!g,y),I=Ew(f)&&o===v;if(t instanceof HTMLCanvasElement&&!S.includes(o)&&S.length>=E&&new Set(b.map((e=>e.canvasId))).has(t.id))return Promise.reject({type:Il,reason:`subscribe video counts greater than maximum size (${E})`});if(-1===iD(m).findIndex((e=>e.userId===o)))return Promise.reject({type:Rl,reason:"user is not send video"});if(t.id||(t.id=Sr("__ZOOM_SDK_VIDEO_CANVAS_@__")),I){if(t instanceof HTMLVideoElement){t.playsInline=!0,t.muted=!0,t.autoplay=!0,Gi.isIOSMobile&&(p.switchCanvasForVideoCapture(t),c(dv())),p.renderVideo(t,o,u||su,n,r,i,s,a,!0,d||"",!1),c(Em(o)),c(uv(t.id));const e=document.querySelector(`#${pu}`);return e&&e.remove(),Promise.resolve("")}return Promise.reject({type:Rl,reason:"You must use a