@zoom/videosdk
Version:
Zoom Web Video SDK
1 lines • 818 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WebVideoSDK={})}(this,(function(e){"use strict";const t=Symbol("store"),o=Symbol("getState"),r=Symbol("dispatch"),n=Symbol("additionFeatures"),i=Symbol("mediaContext");function s(e,t,o){e.readyState?e.onreadystatechange=()=>{"loaded"!==e.readyState&&"complete"!==e.readyState||(e.onreadystatechange=null,t())}:(e.onload=()=>{t()},e.onerror=()=>{o()}),window.crossOriginIsolated&&(e.crossOrigin="anonymous");const r=document.getElementsByTagName("head")[0];"function"==typeof r.append?r.append(e):r.appendChild(e)}function a(e,t,o,r){const n=document.createElement("script");n.type=r?"module":"text/javascript",n.src=e,s(n,t,o)}function d(e,t,o){const r=document.createElement("link");r.href=e,r.type="text/css",r.rel="stylesheet",r.media="screen,print",s(r,t,o)}function u(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 l(e){if(e){var t;const o=document.getElementById(e);null==o||null===(t=o.parentNode)||void 0===t||t.removeChild(o)}}function c(e,t){if(!e||"string"==typeof e)return!1;if(e.ownerDocument===window.document)return e instanceof t;{var o;const r=null===(o=e.ownerDocument)||void 0===o?void 0:o.defaultView;let n;return!!r&&("HTMLVideoElement"===t.name?n=r.HTMLVideoElement:"HTMLCanvasElement"===t.name?n=r.HTMLCanvasElement:"HTMLIFrameElement"===t.name?n=r.HTMLIFrameElement:"HTMLElement"===t.name&&(n=r.HTMLElement),!!n&&e instanceof n||e instanceof t)}}function p(e){return c(e,HTMLVideoElement)}function h(e){return c(e,HTMLCanvasElement)}function m(e,t){return Array.from(document.getElementsByTagName(t)).some((t=>t.contains(e)))}function S(e,t,o){const r=e.parentElement;if(!r)return null;const n=document.createElement("canvas");n.id=t,null==r||r.appendChild(n);let i=null;function s(){o&&o()}return"undefined"!=typeof ResizeObserver?(i=new ResizeObserver(s),i.observe(e),r&&i.observe(r)):window.addEventListener("resize",s),s(),n._overlayCleanup=function(){i?(i.unobserve(e),r&&i.unobserve(r),i.disconnect(),i=null):window.removeEventListener("resize",s),"function"==typeof n.remove?n.remove():r&&r.removeChild(n)},n}function g(e){var t;const o=e.getBoundingClientRect(),r=null===(t=e.parentElement)||void 0===t?void 0:t.getBoundingClientRect(),n=getComputedStyle(e),i=parseFloat(n.borderTopWidth)||0,s=parseFloat(n.borderLeftWidth)||0,a=s+(parseFloat(n.borderRightWidth)||0),d=i+(parseFloat(n.borderBottomWidth)||0),u=Math.max(e.width/(o.width-a),e.height/(o.height-d)),l={width:e.width/u,height:e.height/u},c=o.top-((null==r?void 0:r.top)||0),p=o.left-((null==r?void 0:r.left)||0);return{size:l,position:{top:`${c+((o.height-d-l.height)/2+i)}px`,left:`${p+((o.width-a-l.width)/2+s)}px`}}}let v="";v="zoom.us";const y="5.1.4",E=`https://dmogdx0jrul3u.cloudfront.net/${y}/lib/av`,f=`https://source.zoom.us/${y}/lib/av`,I=`https://jssdk.zoomus.cn/${y}/lib/av`,A=()=>v;function b(e,t){const o=t.match(e);return o&&o.length>0&&o[1]||""}function _(e,t){const o=t.match(e);return o&&o.length>1&&o[2]||""}const C=/version\/(\d+(\.?_?\d+)+)/i,T=[{test:[/opera/i],describe:e=>["Opera(Legacy)",b(C,e)||b(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/opr\/|opios/i],describe:e=>["Opera",b(/(?:opr|opios)[\s/](\S+)/i,e)||b(C,e)]},{test:[/SamsungBrowser/i],describe:e=>["Samsung Internet for Android",b(C,e)||b(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/micromessenger/i],describe:e=>["WeChat",b(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||b(C,e)]},{test:[/qqbrowser/i],describe:e=>[/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser",b(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||b(C,e)]},{test:[/msie|trident/i],describe:e=>["Internet Explorer",b(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e)]},{test:[/\sedg\//i],describe:e=>["Microsoft Edge",b(/\sedg\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/edg([ea]|ios)/i],describe:e=>["Microsoft Edge(Legacy)",_(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/firefox|iceweasel|fxios/i],describe:e=>["Firefox",b(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e)]},{test:[/electron/i],describe:e=>["Electron",b(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e)]},{test:[/chromium/i],describe:e=>["Chromium",b(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||b(C,e)]},{test:[/chrome|crios|crmo/i],describe:e=>["Chrome",b(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e)]},{test:e=>!/like android/i.test(e)&&/android/i.test(e),describe:e=>["Android Browser",b(C,e)]},{test:[/safari|applewebkit/i],describe:e=>["Safari",b(C,e)]}],R=[{test:e=>{const t=e.match(/OpenHarmony (\d+\.?\d*)/);return(null==t?void 0:t.length)&&Number(t[1])>=5},describe:e=>["HarmonyOS",b(/OpenHarmony (\d+\.?\d*)/i,e)]},{test:[/windows /i],describe:e=>["Windows",b(/Windows ((NT|XP)( \d\d?.\d)?)/i,e)]},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:e=>["iOS",_(/(Version\/)(\d[\d.]+)/,e)]},{test:[/macintosh/i],describe:e=>["macOS",b(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,".")]},{test:[/(ipod|iphone|ipad)/i],describe:e=>["iOS",b(/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",b(/android[\s/-](\d+(\.\d+)*)/i,e)]},{test:[/linux/i],describe:()=>["Linux"]},{test:[/CrOS/],describe:()=>["Chrome OS"]}],O=new class{constructor(){this._browser=void 0,this._os=void 0,this._browserVersion=void 0,this._osVersion=void 0,this._clientHintsData=void 0,this._mediaFeatureOptions=void 0,"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;if(null!==(e=this._clientHintsData)&&void 0!==e&&null!==(e=e.brands)&&void 0!==e&&e.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=T.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=R.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;if(null!==(e=this._clientHintsData)&&void 0!==e&&null!==(e=e.brands)&&void 0!==e&&e.length)return null===(t=this._clientHintsData)||void 0===t?void 0:t.brands.some((e=>{var t;return"chromium"===(null===(t=e.brand)||void 0===t?void 0:t.toLocaleLowerCase())}));const{userAgent:o}=navigator;return!this.isLegacyOpera&&!this.isLegacyEdge&&/chrome/i.test(o)&&/webkit/i.test(o)}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 isHarmonyOS(){return"HarmonyOS"===this.os}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(){var e;return this._mediaFeatureOptions?!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e||!e.isSupportMediaStreamTrackProcessor(this._mediaFeatureOptions)):"MediaStreamTrackProcessor"in window}get isSupportOffscreenCanvas(){var e;return null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e?void 0:e.isSupportOffscreenCanvas()}get gpu(){var e;return this.isSupportOffscreenCanvas?null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e||null===(e=e.getGpuInfo())||void 0===e?void 0:e.renderInfo:""}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}get isSupportSharedArrayBuffer(){return"function"==typeof SharedArrayBuffer}get is32bitChrome(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e||!e.is32bitBrowser())}get isSwiftShader(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e||!e.isUsingSwiftShader())}set mediaFeatureOptions(e){this._mediaFeatureOptions=e}get isWeakRefSupported(){return"undefined"!=typeof WeakRef}get isSupportESModule(){return"noModule"in document.createElement("script")}};function w(){var e;const{isAndroidBrowser:t,isIOSMobile:o,osVersion:r,browserVersion:n,isChrome:i,isFirefox:s,isSafari:a}=O;var d,u;if(o)return Number(null===(d=r.match(/^\d+/))||void 0===d?void 0:d[0])>=15;if(t)return Number(null===(u=r.match(/^\d+/))||void 0===u?void 0:u[0])>=10;const l=Number(null===(e=n.match(/^\d+/))||void 0===e?void 0:e[0]);return!!(i&&l>=69)||!!(a&&l>14)||!!(s&&l>=76)}function D(){const{isSupportAudioWorklet:e,isSupportEssentialAudioAndVideoAbility:t,isAndroidOrIOSBrowser:o,isSupportSendScreenSharing:r}=O,n=void 0!==navigator.mediaDevices&&(t&&e||o),i=t&&void 0!==navigator.mediaDevices&&void 0!==navigator.mediaCapabilities,s="function"==typeof"".replaceAll;return{audio:s&&n,video:s&&i,screen:s&&t&&r}}class M{constructor(e){this.instant=void 0,this.context=void 0,this.script=void 0,this.mic=void 0,this.instant=0,this.context=e,this.mic=null,this.script=e.createScriptProcessor(2048,1,1),this.script.onaudioprocess=e=>{const t=e.inputBuffer.getChannelData(0);let o,r=0;for(o=0;o<t.length;++o)r+=t[o]*t[o];this.instant=Math.sqrt(r/t.length)}}connectToSource(e){console.log("InputMicDetector is listening");try{var t;this.mic=this.context.createMediaStreamSource(e),this.mic.connect(this.script),null===(t=this.script)||void 0===t||t.connect(this.context.destination)}catch(e){console.error(e)}}stop(){var e,t;console.log("Audio Previewer stopped"),null===(e=this.mic)||void 0===e||e.disconnect(),this.mic=null,null===(t=this.script)||void 0===t||t.disconnect(),this.script=null}getMicVolume(){return this.instant}}const N="https://st1.zoom.us/web_client/4qu8baa/audio/ring.mp3";class P{constructor(){this.sampleAudio=void 0,this.audioCtx=void 0,this.destinationNode=void 0,this.audioPlayer=void 0,this.analyzserInterval=void 0,this.analyserNode=void 0,this.analyserNodeBufferDataArray=void 0,this.analyserCallback=void 0,this.sourceNode=void 0,this.mAudioStream=void 0,this.mSourceNode=void 0,this.mediaRecorder=void 0,this.isRecording=void 0,this.recorderChunks=[],this.recorderObjUrl=void 0,this.recorderPlayer=void 0,this.maximumRecordingTimer=void 0,this.shouldPlayAfterRecording=!0,this.isRunning=!1}testSpeaker(e){var t;if("function"!=typeof AudioContext||"function"!=typeof MediaStreamAudioDestinationNode||!AudioContext.prototype.decodeAudioData)return void console.warn("Cannot test the speaker due to the browser capability");const{speakerId:o,sampleAudioUrl:r=N,onAnalyseFrequency:n}=e||{};if(this.isRunning)return void console.warn("A tester is running,please stop it first");this.isRunning=!0,this.initAudioContext(),((null===(t=this.sampleAudio)||void 0===t?void 0:t.url)===r&&this.sampleAudio.data?Promise.resolve(this.sampleAudio.data):window.fetch(r).then((e=>e.arrayBuffer())).then((e=>this.audioCtx.decodeAudioData(e))).then((e=>(this.sampleAudio={url:r,data:e},e)))).then((e=>{var t,r,i;this.sourceNode=this.audioCtx.createBufferSource(),this.sourceNode.buffer=e,this.sourceNode.loop=!0,o&&null!==(t=this.audioPlayer)&&void 0!==t&&t.setSinkId&&this.audioPlayer.setSinkId(o),n?"function"==typeof AudioContext.prototype.createAnalyser?(this.analyzserInterval&&window.clearInterval(this.analyzserInterval),this.analyserCallback=n,this.initAnalyserNode(),this.analyserNode&&this.sourceNode.connect(this.analyserNode)):(this.sourceNode.connect(this.destinationNode),console.warn("Cannot analyze the stream due to the browser capability")):(this.analyserCallback=void 0,this.sourceNode.connect(this.destinationNode)),this.sourceNode.start(0),"running"!==(null===(r=this.audioCtx)||void 0===r?void 0:r.state)&&(null===(i=this.audioCtx)||void 0===i||i.resume()),this.audioPlayer&&(this.audioPlayer.muted=!1,this.audioPlayer.currentTime=0,this.audioPlayer.play())}));const i=()=>{this.isRunning=!1,this.audioPlayer&&(this.audioPlayer.currentTime=0,this.audioPlayer.pause()),this.analyserNode&&this.analyzserInterval&&(window.clearInterval(this.analyzserInterval),this.analyzserInterval=void 0,this.analyserNodeBufferDataArray=void 0),this.sourceNode&&(this.sourceNode.stop(0),this.sourceNode.disconnect(),this.sourceNode.buffer=null,this.sourceNode=void 0)};return{stop:i,destroy:()=>{var e;i(),this.analyserNode&&this.destinationNode&&(this.analyserNode.disconnect(this.destinationNode),this.analyserNode=void 0),null===(e=this.audioCtx)||void 0===e||e.close(),this.audioCtx=void 0}}}testMicrophone(e){var t;if("function"!=typeof AudioContext||"function"!=typeof MediaStreamAudioDestinationNode||"function"!=typeof AudioContext.prototype.createMediaStreamSource||"function"!=typeof(null===(t=navigator.mediaDevices)||void 0===t?void 0:t.getUserMedia))return void console.warn("Cannot test the microphone due to the browser capability");const{microphoneId:o,speakerId:r,recordAndPlay:n,maxRecordDuration:i,onAnalyseFrequency:s,onStartRecording:a,onStopRecording:d,onStartPlayRecording:u,onStopPlayRecording:l}=e||{};if(this.isRunning)return void console.warn("A tester is running,please stop it first");this.isRunning=!0,this.initAudioContext();const c=()=>{n&&this.mediaRecorder&&this.isRecording&&(this.shouldPlayAfterRecording=!0,"inactive"!==this.mediaRecorder.state&&this.mediaRecorder.stop())};window.navigator.mediaDevices.getUserMedia({audio:!o||{deviceId:{exact:o}}}).then((e=>{var t,o,p,h;this.mAudioStream=e,this.mSourceNode=null===(t=this.audioCtx)||void 0===t?void 0:t.createMediaStreamSource(e),this.audioPlayer.muted=!0,s?(this.analyzserInterval&&window.clearInterval(this.analyzserInterval),this.analyserCallback=s,this.initAnalyserNode(),this.analyserNode&&(null===(p=this.mSourceNode)||void 0===p||p.connect(this.analyserNode))):this.analyserCallback=void 0,n&&("function"==typeof MediaRecorder?(this.recorderObjUrl&&window.URL.revokeObjectURL(this.recorderObjUrl),this.mediaRecorder=new MediaRecorder(this.mAudioStream),this.mediaRecorder.ondataavailable=e=>{e.data&&this.recorderChunks.push(e.data)},this.mediaRecorder.onstop=()=>{if(this.isRecording=!1,this.maximumRecordingTimer&&(window.clearTimeout(this.maximumRecordingTimer),this.maximumRecordingTimer=void 0),null==d||d(),this.recorderChunks.length>0){var e;const t=new Blob(this.recorderChunks,{type:(null===(e=this.recorderChunks[0])||void 0===e?void 0:e.type)||"audio/ogg; codecs=opus"});this.recorderObjUrl=window.URL.createObjectURL(t),this.shouldPlayAfterRecording&&this.playRecording(this.recorderObjUrl,r,u,l).catch((e=>{this.analyzserInterval&&(window.clearInterval(this.analyzserInterval),this.analyzserInterval=void 0,this.analyserNodeBufferDataArray=void 0),console.warn(e)})),this.recorderChunks=[],this.mediaRecorder&&(this.mediaRecorder.ondataavailable=null,this.mediaRecorder.onstop=null,this.mediaRecorder=void 0)}},this.mediaRecorder.start(),this.isRecording=!0,null==a||a(),this.maximumRecordingTimer=window.setTimeout((()=>{c()}),i||1e4)):console.warn("Cannot record the sound due to the browser capability")),"running"!==(null===(o=this.audioCtx)||void 0===o?void 0:o.state)&&(null===(h=this.audioCtx)||void 0===h||h.resume()),this.audioPlayer&&(this.audioPlayer.currentTime=0,this.audioPlayer.play())}));const p=()=>{this.isRunning=!1,this.maximumRecordingTimer&&(window.clearTimeout(this.maximumRecordingTimer),this.maximumRecordingTimer=void 0),this.audioPlayer&&(this.audioPlayer.currentTime=0,this.audioPlayer.pause()),this.analyserNode&&this.analyzserInterval&&(window.clearInterval(this.analyzserInterval),this.analyzserInterval=void 0,this.analyserNodeBufferDataArray=void 0),this.mSourceNode&&(s&&this.analyserNode&&this.mSourceNode.disconnect(this.analyserNode),this.mSourceNode=void 0),this.mAudioStream&&(this.mAudioStream.getAudioTracks().forEach((e=>{e.stop()})),this.mAudioStream=void 0),this.mediaRecorder&&(this.shouldPlayAfterRecording=!1,this.mediaRecorder.ondataavailable=null,this.mediaRecorder.onstop=null,"inactive"!==this.mediaRecorder.state&&this.mediaRecorder.stop(),this.isRecording=!1,this.mediaRecorder=void 0,this.recorderChunks=[]),this.recorderPlayer&&(this.recorderPlayer.currentTime=0,this.recorderPlayer.pause())};return{stop:p,stopRecording:c,destroy:()=>{var e;p(),this.analyserNode&&this.destinationNode&&(this.analyserNode.disconnect(this.destinationNode),this.analyserNode=void 0),null===(e=this.audioCtx)||void 0===e||e.close(),this.audioCtx=void 0}}}initAudioContext(){this.audioCtx&&this.audioPlayer||(this.audioCtx=new AudioContext,this.destinationNode=new MediaStreamAudioDestinationNode(this.audioCtx),this.audioPlayer=new Audio,this.audioPlayer.loop=!0,this.audioPlayer.srcObject=this.destinationNode.stream)}initAnalyserNode(){if(!this.audioCtx)return;this.analyserNode||(this.analyserNode=this.audioCtx.createAnalyser(),this.analyserNode.connect(this.destinationNode),this.analyserNode.fftSize=1024);const e=this.analyserNode.frequencyBinCount;this.analyserNodeBufferDataArray=new Uint8Array(e),this.analyzserInterval=window.setInterval(this.audioAnalyserCallback.bind(this),20)}audioAnalyserCallback(){if(this.analyserNodeBufferDataArray&&this.analyserNode&&this.analyserCallback){this.analyserNode.getByteFrequencyData(this.analyserNodeBufferDataArray);let e=0;for(const t of this.analyserNodeBufferDataArray)e+=t;const t=e/this.analyserNodeBufferDataArray.length;this.analyserCallback(t)}}playRecording(e,t,o,r){this.recorderPlayer=new Audio,this.recorderPlayer.src=e,this.recorderPlayer.currentTime=0,this.recorderPlayer.setSinkId&&t&&this.recorderPlayer.setSinkId(t);const n=()=>{null==r||r(),this.recorderPlayer&&(this.recorderPlayer.onpause=null,this.recorderPlayer.onended=null,this.recorderPlayer=void 0,this.isRunning=!1)};return new Promise(((e,t)=>{this.recorderPlayer&&(this.recorderPlayer.onpause=()=>{e(!0)},this.recorderPlayer.onended=()=>{e(!0)},this.recorderPlayer.onerror=t,null==o||o(),this.recorderPlayer.play().catch(t))})).finally((()=>{window.URL.revokeObjectURL(e),n()}))}}const L="AudioNotStartedError";class k{constructor(e=""){this.audioContext=void 0,this.inputMicDetector=void 0,this.isMicUnmuted=void 0,this.isAudioStarted=void 0,this.audioStream=void 0,this.deviceId=void 0,this.tester=void 0,this.audioContext=null,this.inputMicDetector=null,this.isMicUnmuted=!1,this.isAudioStarted=!1,this.audioStream=null,this.deviceId=e,this.tester=new P}async start(){if(this.audioStream||this.isAudioStarted)throw new Error("AudioAlreadyStartedError");try{const e=await navigator.mediaDevices.getUserMedia(this.getAudioConstraints());this.audioStream=e,this.isAudioStarted=!0}catch(e){throw e}}async unmute(){if(!this.audioStream||!this.isAudioStarted)throw new Error(L);if(this.isMicUnmuted)throw new Error("AudioAlreadyUnmutedError");return this.toggleMicIsMuted(!0)}async mute(){if(!this.audioStream||!this.isAudioStarted)throw new Error(L);if(!this.isMicUnmuted)throw new Error("AudioAlreadyMutedError");return this.toggleMicIsMuted(!1)}getCurrentVolume(){return this.inputMicDetector?this.inputMicDetector.getMicVolume():0}async stop(){if(!this.audioStream||!this.isAudioStarted)throw new Error(L);this.audioStream.getAudioTracks().forEach((e=>e.stop())),this.audioStream=null,this.isAudioStarted=!1}async toggleMicIsMuted(e){if(e){if(!this.audioContext){const e=window.AudioContext||window.webkitAudioContext;this.audioContext=new e}this.inputMicDetector=new M(this.audioContext),this.inputMicDetector.connectToSource(this.audioStream)}else this.inputMicDetector&&this.inputMicDetector.stop(),this.inputMicDetector=null;this.isMicUnmuted=e}getAudioConstraints(){return{audio:""===this.deviceId||{deviceId:{exact:this.deviceId}},video:!1}}testSpeaker(e){return this.tester.testSpeaker(e)}testMicrophone(e){return this.tester.testMicrophone(e)}}let U=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.WhiteboardSuccess=30]="WhiteboardSuccess",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.SpeakingWhenMute=121]="SpeakingWhenMute",e[e.StartAnnotationSuccess=158]="StartAnnotationSuccess",e[e.DeviceChangeEvent=159]="DeviceChangeEvent",e[e.RecaptureAudio=160]="RecaptureAudio",e[e.MediaStatsLog=209]="MediaStatsLog",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.AudioCaptureFailed=-2]="AudioCaptureFailed",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[e.AudioBridgeSocketConnectionError=-28]="AudioBridgeSocketConnectionError",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.AudiobridgeSetCcLangFailure=-39]="AudiobridgeSetCcLangFailure",e[e.NotifyUIWMSCFailover=-42]="NotifyUIWMSCFailover",e[e.NotifyUIWMSCWSSDisconnected=-43]="NotifyUIWMSCWSSDisconnected",e[e.RecoverWebrtcAudio=-44]="RecoverWebrtcAudio",e[e.WebglContextInvalid=-51]="WebglContextInvalid",e[e.WasmMemoryFail=-52]="WasmMemoryFail",e[e.WorkletProcessExceptions=-53]="WorkletProcessExceptions",e[e.NotSupportExternalCanvasInVTagRenderer=-55]="NotSupportExternalCanvasInVTagRenderer",e[e.HealthCheckFailed=-129]="HealthCheckFailed",e[e.StartAnnotationFailed=-130]="StartAnnotationFailed",e.AudioQosData="AUDIO_QOS_DATA",e.VideoQosData="VIDEO_QOS_DATA",e.ShareQosData="VIDEOSHARE_QOS_DATA",e.CommonQosData="COMMON_QOS_DATA",e.NetworkQualityChange="NETWORK_QUALITY_CHANGE",e.NetworkQualityChangeAudio="NETWORK_QUALITY_CHANGE_AUDIO",e.NetworkQualityChangeSharing="NETWORK_QUALITY_CHANGE_SHARING",e.AudioStreamMuted="AUDIO_STREAM_MUTED",e.AudioStreamUnmuted="AUDIO_STREAM_UNMUTED",e.AnnotationRedoStatus="ANNO_REDO_STATUS",e.AnnotationUndoStatus="ANNO_UNDO_STATUS",e.AnnoViewerRequestDraw="ANNO_VIEWER_REQUEST_DRAW",e.VideoStreamMuted="VIDEO_STREAM_MUTED",e.VideoStreamUnmuted="VIDEO_STREAM_UNMUTED",e}({}),V=function(e){return e[e.EncodeSuccess=1]="EncodeSuccess",e[e.DecodeSuccess=2]="DecodeSuccess",e[e.EncodeFailed=-1]="EncodeFailed",e[e.DecodeFailed=-2]="DecodeFailed",e}({}),H=function(e){return e.Spotlight="Spotlight",e.Unmute="Unmute",e.AllowToTalk="Allow to talk",e}({}),B=function(e){return e.Inherited="inherited",e.Active="active",e.PassiveByMuteOne="passive(mute one)",e.PassiveByMuteAll="passive(mute all)",e.SharingAudio="sharing audio",e}({}),j=function(e){return e.Inherited="inherited",e.Active="active",e.Passive="passive",e.SharingAudio="sharing audio",e}({}),F=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}({}),W=function(e){return e.Join="join",e.Leave="leave",e.Muted="muted",e.Unmuted="unmuted",e}({}),$=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[e.NoAnswer=13]="NoAnswer",e[e.BlockNoHost=14]="BlockNoHost",e[e.BlockHighRate=15]="BlockHighRate",e[e.BlockTooFrequent=16]="BlockTooFrequent",e}({});const x=(()=>{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"})})(),G=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]),q=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 z=function(e){return e[e.HostGrab=0]="HostGrab",e[e.OnlyHost=1]="OnlyHost",e[e.AnyoneGrab=2]="AnyoneGrab",e[e.MultipleShare=3]="MultipleShare",e}({}),K=function(e){return e.Sharing="sharing",e.Paused="paused",e.End="ended",e}({}),J=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}({}),Q=function(e){return e.Active="Active",e.Inactive="Inactive",e}({}),Y=function(e){return e.Muted="Muted",e.Unmuted="Unmuted",e}({}),Z=function(e){return e.Started="Started",e.Stopped="Stopped",e.Failed="Failed",e}({}),X=function(e){return e.Approved="Approved",e.Rejected="Rejected",e}({}),ee=function(e){return e.PrivilegeChange="PrivilegeChange",e.StopScreenCapture="StopScreenCapture",e.ShareFromMainSession="ShareFromMainSession",e.StopCameraCapture="StopCameraCapture",e}({}),te=function(e){return e[e.ImageNotMatch=2]="ImageNotMatch",e[e.CanvasNotMatch=3]="CanvasNotMatch",e[e.VBModelNotMatch=4]="VBModelNotMatch",e}({});const oe="blur";let re=function(e){return e.User="user",e.Environment="environment",e.Left="left",e.Right="right",e}({});const ne=Object.values(re),ie=1e3,se="__ZOOM_SDK_SHARING_VIDEO__",ae="__ZOOM_SDK_ANNOTATION_CANVAS_@__",de="__ZOOM_SDK_VIDEO_ZONE__",ue="__ZOOM_SDK_MEDIA_PLAYBACK_SOURCE_VIDEO__",le="__ZOOM_SDK_DYMMY_VIDEO_PLAYER_CANVAS_ID__",ce="__ZOOM_SDK_DUMMY_HIDDEN_SELF_VIEW_VIDEO_ID__",pe={data:{sample_rate:0,rtt:0,jitter:0,avg_loss:0,max_loss:0,rate:0,bandwidth:0}},he={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 me=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}({}),Se=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}({}),ge=function(e){return e[e.Pan=192]="Pan",e[e.Tilt=48]="Tilt",e[e.Zoom=12]="Zoom",e[e.Focus=3]="Focus",e}({}),ve=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}({}),ye=function(e){return e[e.None=0]="None",e[e.ApproveAnother=3]="ApproveAnother",e[e.Stop=5]="Stop",e}({}),Ee=function(e){return e[e.Null=0]="Null",e[e.Normal=1]="Normal",e[e.VideoMode=2]="VideoMode",e[e.CameraMode=3]="CameraMode",e}({}),fe=function(e){return e[e.Null=0]="Null",e[e.VirtualBackground=1]="VirtualBackground",e[e.Mask=2]="Mask",e[e.VideoProcessor=3]="VideoProcessor",e}({}),Ie=function(e){return e.Computer="computer",e.Phone="phone",e}({}),Ae=function(e){return e[e.Decline=0]="Decline",e[e.Approve=1]="Approve",e[e.CacheClean=2]="CacheClean",e}({}),be=function(e){return e.Unknown="unknown",e.Uninstalled="uninstalled",e.Installed="installed",e}({}),_e=function(e){return e.Unlaunched="unlaunched",e.Launched="launched",e}({}),Ce=function(e){return e.Started="started",e.Ended="ended",e}({}),Te=function(e){return e[e.Max=30]="Max",e[e.Min=10]="Min",e[e.Default=24]="Default",e}({}),Re=function(e){return e[e.Loading=1]="Loading",e[e.Done=2]="Done",e}({}),Oe=function(e){return e.Browser="Browser",e.Zoom="Zoom",e}({}),we=function(e){return e.Denoise="backgroundNoiseSuppression",e.OriginalSound="originalSound",e}({}),De=function(e){return e[e.Undefined=0]="Undefined",e[e.WebGL=1]="WebGL",e[e.WebGPU=2]="WebGPU",e[e.WebGL2=3]="WebGL2",e}({}),Me=function(e){return e[e.H323=1]="H323",e[e.SIP=2]="SIP",e}({}),Ne=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}({}),Pe=function(e){return e[e.Exception=-1]="Exception",e[e.PermissionReset=-2]="PermissionReset",e[e.LostAccess=-3]="LostAccess",e}({}),Le=function(e){return e[e.AudioConnectionFailed=101]="AudioConnectionFailed",e[e.AudioStreamEnded=102]="AudioStreamEnded",e[e.MicrophonePermissionReset=103]="MicrophonePermissionReset",e[e.AudioStreamFailed=104]="AudioStreamFailed",e[e.MicrophoneMuted=105]="MicrophoneMuted",e[e.AudioStreamMuted=106]="AudioStreamMuted",e[e.AudioPlaybackInterrupted=107]="AudioPlaybackInterrupted",e[e.VideoConnectionFailed=201]="VideoConnectionFailed",e[e.VideoStreamEnded=202]="VideoStreamEnded",e[e.CameraPermissionReset=203]="CameraPermissionReset",e[e.WebGlContextInvalid=204]="WebGlContextInvalid",e[e.WasmOutOfMemory=205]="WasmOutOfMemory",e[e.VideoStreamFailed=206]="VideoStreamFailed",e[e.VideoStreamMuted=207]="VideoStreamMuted",e[e.SharingStreamFailed=301]="SharingStreamFailed",e}({}),ke=function(e){return e[e.NoFallback=0]="NoFallback",e[e.FallbackToWasm=1]="FallbackToWasm",e}({}),Ue=function(e){return e[e.WebRTCAudio=1]="WebRTCAudio",e[e.WebRTCVideo=2]="WebRTCVideo",e[e.WebRTCAudio2=4]="WebRTCAudio2",e}({}),Ve=function(e){return e[e.WebRTCAudio=1]="WebRTCAudio",e[e.WebRTCAudio2=2]="WebRTCAudio2",e}({}),He=function(e){return e[e.BROWSER_NOT_SUPPORTED=-3]="BROWSER_NOT_SUPPORTED",e[e.DEVICE_UNSUPPORTED=-4]="DEVICE_UNSUPPORTED",e[e.OTHER_ERROR=-7]="OTHER_ERROR",e[e.DEVICE_UNVERIFIED=-8]="DEVICE_UNVERIFIED",e[e.FEATURE_DISABLED=-9]="FEATURE_DISABLED",e[e.FORCE_SAME_AV_STRATEGY=-10]="FORCE_SAME_AV_STRATEGY",e}({});const Be={[He.BROWSER_NOT_SUPPORTED]:"Your browser does not support WebRTC Video.",[He.DEVICE_UNSUPPORTED]:"WebRTC video cannot currently run on this environment. We are evaluating support for it in the future.",[He.OTHER_ERROR]:"An error occurred with WebRTC video.",[He.DEVICE_UNVERIFIED]:"WebRTC video has not been verified in this environment. We are evaluating it for future support.",[He.FEATURE_DISABLED]:"We disabled WebRTC video for this environment.",[He.FORCE_SAME_AV_STRATEGY]:"The same AV strategy is forced."};let je=function(e){return e[e.SELECT_MOUSE=0]="SELECT_MOUSE",e[e.SELECT_TOOL=1]="SELECT_TOOL",e[e.SELECT_ERASER=2]="SELECT_ERASER",e[e.UNDO=3]="UNDO",e[e.REDO=4]="REDO",e[e.CLEAR=5]="CLEAR",e[e.CLOSE_TOOL_BAR=6]="CLOSE_TOOL_BAR",e[e.UPDATE_PARAMS=7]="UPDATE_PARAMS",e[e.PAUSE_ANNOTATION=8]="PAUSE_ANNOTATION",e[e.SHOW_ANNOTATOR_NAME=9]="SHOW_ANNOTATOR_NAME",e[e.ANNOTATOR_ID_TO_NAME=10]="ANNOTATOR_ID_TO_NAME",e[e.ANNO_CANVAS_SIZE_UPDATE=11]="ANNO_CANVAS_SIZE_UPDATE",e[e.STAMP=12]="STAMP",e[e.SPOTLIGHT=13]="SPOTLIGHT",e[e.TEXTBOX=14]="TEXTBOX",e[e.SELECT_OBJ=15]="SELECT_OBJ",e[e.UPDATE_REMOTE_POSITION_INFO=16]="UPDATE_REMOTE_POSITION_INFO",e[e.UPDATE_VANISHING_TOOL_TIME=17]="UPDATE_VANISHING_TOOL_TIME",e}({}),Fe=function(e){return e[e.Mine=0]="Mine",e[e.Viewer=1]="Viewer",e[e.All=2]="All",e}({}),We=function(e){return e[e.None=0]="None",e[e.Pen=1]="Pen",e[e.Highlighter=2]="Highlighter",e[e.Spotlight=3]="Spotlight",e[e.Arrow=4]="Arrow",e[e.Eraser=7]="Eraser",e[e.Line=11]="Line",e[e.Arrow1=12]="Arrow1",e[e.Rectangle=14]="Rectangle",e[e.RectangleSemiFill=15]="RectangleSemiFill",e[e.Ellipse=18]="Ellipse",e[e.EllipseSemiFill=19]="EllipseSemiFill",e[e.DoubleArrow=20]="DoubleArrow",e[e.RectangleFill=21]="RectangleFill",e[e.EllipseFill=23]="EllipseFill",e[e.Diamond=24]="Diamond",e[e.StampArrow=25]="StampArrow",e[e.StampCheck=26]="StampCheck",e[e.StampX=27]="StampX",e[e.StampStar=31]="StampStar",e[e.StampHeart=32]="StampHeart",e[e.StampQuestionMark=33]="StampQuestionMark",e[e.VanishingPen=36]="VanishingPen",e[e.DiamondSemiFill=37]="DiamondSemiFill",e[e.DiamondFill=38]="DiamondFill",e[e.VanishingArrow=43]="VanishingArrow",e[e.VanishingDoubleArrow=44]="VanishingDoubleArrow",e[e.VanishingDiamond=45]="VanishingDiamond",e[e.VanishingEllipse=46]="VanishingEllipse",e[e.VanishingRectangle=47]="VanishingRectangle",e}({}),$e=function(e){return e[e.White=4294967295]="White",e[e.Red=4294908185]="Red",e[e.Yellow=4294958642]="Yellow",e[e.Green=4286760838]="Green",e[e.Blue=4281240831]="Blue",e[e.LightPurple=4290017791]="LightPurple",e[e.Pink=4294916295]="Pink",e[e.Orange=4294937088]="Orange",e[e.LimeTreeGreen=4283029022]="LimeTreeGreen",e[e.IceBlue=4283554027]="IceBlue",e[e.DarkGrey=4278190080]="DarkGrey",e[e.DarkRed=4286513152]="DarkRed",e[e.Brown=4286006280]="Brown",e[e.DarkGreen=4278940200]="DarkGreen",e[e.DarkBlue=4279521219]="DarkBlue",e}({}),xe=function(e){return e[e.Nominal=0]="Nominal",e[e.Fair=1]="Fair",e[e.Serious=2]="Serious",e[e.Critical=3]="Critical",e}({}),Ge=function(e){return e.FrontCamera="frontCam",e.RearCamera="rearCam",e}({}),qe=function(e){return e[e.Success=0]="Success",e[e.Failed=1]="Failed",e}({});const ze=152,Ke=[{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"},{name:"net_thread.min.js",category:"common",type:"worker",tag:"thread",alias:"netThreadPath"}];class Je{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 Je),this.agentInstance}static getMaxCountRender(e,t,o){var r;const n=o?{disableRenderLimits:!0}:t;return null===(r=window.JsMediaSDK_Instance)||void 0===r?void 0:r.util.getMaxCountRender(e,n)}static initVideoPlayer(e){var t;return null===(t=window.JsMediaSDK_Instance)||void 0===t?void 0:t.initVideoPlayer(e)}static isSupportVirtualBackground(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||!e.util.isSupportVirtualBackground())}static isSupportSending720P(){var e;return!(null===(e=window.JsMediaSDK_Instance)||void 0===e||null===(e=e.util)||void 0===e||!e.get720pcapacity())}init(e,t,o){var r,n,i,s;!this.instance&&window.JsMediaSDK_Instance&&(this.instance=new window.JsMediaSDK_Instance({...null!=t?t:{},mediaSDKConfig:{mediaSDKCDNPath:e}})),this.onMediaSDKCallback=this.onMediaSDKCallback.bind(this),this.mediaOptions=t,null===(r=this.instance)||void 0===r||r.setProps({callback:this.onMediaSDKCallback,isPreviewMode:!0,meetingParams:{cid:"",userId:0,rwgHost:"",nginxHost:"",abToken:"",confId:"",e2eEncrypt:!0,enableWebtransport:!1,webtransportPort:0,rwgToMediaSDKConfig:{},webrtcMode:0},mediaParams:{videoDecodeThreadNum:null!==(n=Je.getMaxCountRender(!1,null===(i=this.mediaOptions)||void 0===i?void 0:i.enableMultiDecodeVideoWithoutSAB,o))&&void 0!==n?n:1,rendererType:1,isEnableHD:!0,isEnableDecodingHW:!0,isEnableEncodingHW:!0}}),null===(s=this.instance)||void 0===s||s.initVideoEncode(),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){var t;const{imageId:o,cameraDeviceId:r,ssid:n,...i}=e;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(91,{bgdom:o,VideoSelectValue:"default"===r?null:r,ssid:0,usingFacingMode:["user","environment"].includes(r),...i})}updateVirtualBackgroundImage(e){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(92,{bgdom:e})}stopVirtualBackgroundSetting(e=!1){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(93,{isSwitch:e})}startMaskSetting(e,t,o,r,n,i,s,a,d){var u;null===(u=this.instance)||void 0===u||u.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"===n?null:n,usingFacingMode:["user","environment"].includes(n)})}stopMaskSetting(e=!1){var t;null===(t=this.instance)||void 0===t||t.Notify_MeidaSDK(65,{isSwitch:e})}}Je.agentInstance=void 0;const Qe="INVALID_OPERATION",Ye="INTERNAL_ERROR",Ze="OPERATION_TIMEOUT",Xe="INSUFFICIENT_PRIVILEGES",et="IMPROPER_MEETING_STATE",tt="INVALID_PARAMETERS",ot="OPERATION_CANCELLED";var rt=function(e,t){return rt=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])},rt(e,t)};function nt(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}rt(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var it=function(){return it=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},it.apply(this,arguments)};function st(e,t){var o,r,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,r&&(n=2&i[0]?r.return:i[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,i[1])).done)return n;switch(r=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){s.label=i[1];break}if(6===i[0]&&s.label<n[1]){s.label=n[1],n=i;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(i);break}n[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{o=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function at(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function dt(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,n,i=o.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return s}function ut(e,t){for(var o=0,r=t.length,n=e.length;o<r;o++,n++)e[n]=t[o];return e}function lt(e){return this instanceof lt?(this.v=e,this):new lt(e)}function ct(e){return"function"==typeof e}function pt(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var ht=pt((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function mt(e,t){if(e){var o=e.indexOf(t);0<=o&&e.splice(o,1)}}var St=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,o,r,n;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var s=at(i),a=s.next();!a.done;a=s.next())a.value.remove(this)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else i.remove(this);var d=this.initialTeardown;if(ct(d))try{d()}catch(e){n=e instanceof ht?e.errors:[e]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=at(u),c=l.next();!c.done;c=l.next()){var p=c.value;try{yt(p)}catch(e){n=null!=n?n:[],e instanceof ht?n=ut(ut([],dt(n)),dt(e.errors)):n.push(e)}}}catch(e){o={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(o)throw o.error}}}if(n)throw new ht(n)}},e.prototype.add=function(t){var o;if(t&&t!==this)if(this.closed)yt(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(o=this._finalizers)&&void 0!==o?o:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&mt(t,e)},e.prototype.remove=function(t){var o=this._finalizers;o&&mt(o,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),gt=St.EMPTY;function vt(e){return e instanceof St||e&&"closed"in e&&ct(e.remove)&&ct(e.add)&&ct(e.unsubscribe)}function yt(e){ct(e)?e():e.unsubscribe()}var Et=void 0;function ft(e){!function(e,t){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];setTimeout.apply(void 0,ut([e,t],dt(o)))}((function(){throw e}))}function It(){}function At(e){e()}var bt=function(e){function t(t){var o=e.call(this)||this;return o.isStopped=!1,t?(o.destination=t,vt(t)&&t.add(o)):o.destination=Rt,o}return nt(t,e),t.create=function(e,t,o){return new Ct(e,t,o)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.des