@zoom/meetingsdk
Version:
Zoom MeetingSDK-Web Client
1 lines • 511 kB
JavaScript
!function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=61)}([function(e,t,r){var i=r(40),n=r(33);e.exports=function(e,t){var r=n(e,t,"get");return i(e,r)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var i=r(41),n=r(33);e.exports=function(e,t,r){var s=n(e,t,"set");return i(e,s,r),r},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.d(t,"C",(function(){return i})),r.d(t,"j",(function(){return n})),r.d(t,"t",(function(){return s})),r.d(t,"k",(function(){return a})),r.d(t,"v",(function(){return o})),r.d(t,"x",(function(){return h})),r.d(t,"p",(function(){return u})),r.d(t,"s",(function(){return l})),r.d(t,"q",(function(){return c})),r.d(t,"r",(function(){return d})),r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return p})),r.d(t,"w",(function(){return g})),r.d(t,"g",(function(){return m})),r.d(t,"y",(function(){return _})),r.d(t,"z",(function(){return v})),r.d(t,"A",(function(){return b})),r.d(t,"B",(function(){return w})),r.d(t,"e",(function(){return y})),r.d(t,"d",(function(){return x})),r.d(t,"c",(function(){return T})),r.d(t,"f",(function(){return E})),r.d(t,"n",(function(){return R})),r.d(t,"o",(function(){return S})),r.d(t,"m",(function(){return A})),r.d(t,"l",(function(){return k})),r.d(t,"h",(function(){return M})),r.d(t,"u",(function(){return C})),r.d(t,"i",(function(){return P}));const i={AVAILABLE:0,NOT_SUPPORTED:1,CANNOT_REQ_ADAPTER:2,CANNOT_REQ_DEVICE:3},n={AUTO:-1,UNDEFINED:0,WEBGL:1,WEBGPU:2,WEBGL_2:3},s={AVAILABLE:0,VIDEO:1,SHARE:2},a={IDLE:0,PENDING:1,READY:2,RENDERING:3},o={UNKNOWN:-1,BASE_LAYER:0,BLEND_LAYER:1},h={UNKNOWN:-1,EXTERNAL_TEX:0,GPU_TEX_YUV:1,GPU_TEX_RGBA:2,CLEAR_COLOR:3},u=0,l=1,c=2,d=3,f=[{u:1,v:0},{u:1,v:1},{u:0,v:1},{u:1,v:0},{u:0,v:0},{u:0,v:1}],p=[{x:1,y:1},{x:1,y:-1},{x:-1,y:-1},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1}],g={VS_BASE:0,CURSOR:1,WATERMARK:2,MASK:3,END:4},m=["intel","nvidia","apple","amd","qualcomm","arm"],_="\n struct VertexOutput {\n @builtin(position) Position: vec4<f32>,\n @location(0) uv: vec2<f32>,\n };\n \n struct FsUniforms {\n rotation: f32,\n };\n \n @group(0) @binding(0) var vfSampler: sampler;\n @group(0) @binding(1) var vfTexture: texture_external;\n @group(0) @binding(2) var<uniform> vertexUniforms: FsUniforms;\n \n @vertex\n fn vertex_main(\n @builtin(vertex_index) VertexIndex: u32,\n @location(0) vtxPos: vec2<f32>,\n @location(1) uvPos: vec2<f32>\n ) -> VertexOutput {\n \n var output: VertexOutput;\n output.Position = vec4<f32>(vtxPos, 0.0, 1.0);\n \n if (vertexUniforms.rotation == 0) {\n output.uv = vec2f(uvPos.x, 1 - uvPos.y); \n } else if (vertexUniforms.rotation == 1) {\n output.uv = vec2f(1 - uvPos.y, 1 - uvPos.x);\n } else if (vertexUniforms.rotation == 2) {\n output.uv = vec2f(uvPos.x, uvPos.y);\n } else if (vertexUniforms.rotation == 3) {\n output.uv = vec2f(uvPos.y, uvPos.x);\n } else {\n output.uv = uvPos;\n }\n \n return output;\n }\n \n @fragment\n fn fragment_main(@location(0) uv : vec2<f32>) -> @location(0) vec4<f32> {\n var color: vec4<f32> = textureSampleBaseClampToEdge(vfTexture, vfSampler, uv);\n return color;\n }\n ",v="\n struct VertexOutput {\n @builtin(position) Position: vec4<f32>,\n @location(0) uv: vec2<f32>,\n };\n \n @group(0) @binding(6) var<uniform> vertexUniforms: FsUniforms;\n \n @vertex\n fn vertex_main(\n @builtin(vertex_index) VertexIndex: u32,\n @location(0) vtxPos: vec2<f32>,\n @location(1) uvPos: vec2<f32>\n ) -> VertexOutput {\n \n var output: VertexOutput;\n output.Position = vec4<f32>(vtxPos, 0.0, 1.0);\n \n if (vertexUniforms.rotation == 0) {\n output.uv = vec2f(uvPos.x, 1 - uvPos.y); \n } else if (vertexUniforms.rotation == 1) {\n output.uv = vec2f(1 - uvPos.y, 1 - uvPos.x);\n } else if (vertexUniforms.rotation == 2) {\n output.uv = vec2f(uvPos.x, uvPos.y);\n } else if (vertexUniforms.rotation == 3) {\n output.uv = vec2f(uvPos.y, uvPos.x);\n } else {\n output.uv = uvPos;\n }\n \n return output;\n }\n \n struct FsUniforms {\n yuvMode: f32,\n colorRange: f32,\n rotation: f32,\n };\n \n @group(0) @binding(0) var yPlaneSampler: sampler;\n @group(0) @binding(1) var uvPlaneSampler: sampler;\n @group(0) @binding(2) var yPlaneTex: texture_2d<f32>;\n @group(0) @binding(3) var uPlaneTex: texture_2d<f32>;\n @group(0) @binding(4) var vPlaneTex: texture_2d<f32>;\n @group(0) @binding(5) var<uniform> uniforms: FsUniforms;\n // @group(0) @binding(7) var<storage, read_write> outputBuffer: array<f32>;\n \n @fragment\n fn fragment_main(@location(0) uv : vec2<f32>) -> @location(0) vec4<f32> {\n let y = textureSampleBaseClampToEdge(yPlaneTex, yPlaneSampler, uv).r;\n var u: f32;\n var v: f32;\n if (uniforms.yuvMode == 1) {\n u = textureSampleBaseClampToEdge(uPlaneTex, uvPlaneSampler, uv).r;\n v = textureSampleBaseClampToEdge(vPlaneTex, uvPlaneSampler, uv).r;\n } else {\n u = textureSampleBaseClampToEdge(uPlaneTex, uvPlaneSampler, uv).r;\n v = textureSampleBaseClampToEdge(uPlaneTex, uvPlaneSampler, uv).a;\n }\n \n const yuv2RGB_L = mat4x4(\n 1.1643835616, 0, 1.7927410714, -0.9729450750,\n 1.1643835616, -0.2132486143, -0.5329093286, 0.3014826655,\n 1.1643835616, 2.1124017857, 0, -1.1334022179,\n 0, 0, 0, 1\n );\n \n const yuv2RGB_F = mat4x4(\n 1.0, 0, 1.402, -.701,\n 1.0, -.34413, -.71414, .529135,\n 1.0, 1.772, 0, -.886,\n 0, 0, 0, 1\n );\n \n var color = vec4<f32>(y, u, v, 1.0);\n if (uniforms.colorRange == 0) {\n color = color * yuv2RGB_L;\n } else {\n color = color * yuv2RGB_F;\n }\n \n return color;\n }\n ",b="\n struct VertexOutput {\n @builtin(position) Position: vec4<f32>,\n @location(0) uv: vec2<f32>,\n };\n \n @group(0) @binding(5) var<uniform> vertexUniforms: FsUniforms;\n @vertex\n fn vertex_main(\n @builtin(vertex_index) VertexIndex: u32,\n @location(0) vtxPos: vec2<f32>,\n @location(1) uvPos: vec2<f32>\n ) -> VertexOutput {\n \n var output: VertexOutput;\n output.Position = vec4<f32>(vtxPos, 0.0, 1.0);\n \n if (vertexUniforms.rotation == 0) {\n output.uv = vec2f(uvPos.x, 1 - uvPos.y); \n } else if (vertexUniforms.rotation == 1) {\n output.uv = vec2f(1 - uvPos.y, 1 - uvPos.x);\n } else if (vertexUniforms.rotation == 2) {\n output.uv = vec2f(uvPos.x, uvPos.y);\n } else if (vertexUniforms.rotation == 3) {\n output.uv = vec2f(uvPos.y, uvPos.x);\n } else {\n output.uv = uvPos;\n }\n \n return output;\n }\n \n struct FsUniforms {\n yuvMode: f32,\n colorRange: f32,\n rotation: f32,\n };\n \n @group(0) @binding(0) var yPlaneSampler: sampler;\n @group(0) @binding(1) var uvPlaneSampler: sampler;\n @group(0) @binding(2) var yPlaneTex: texture_2d<f32>;\n @group(0) @binding(3) var uPlaneTex: texture_2d<f32>;\n @group(0) @binding(4) var<uniform> uniforms: FsUniforms;\n // @group(0) @binding(5) var<storage, read_write> outputBuffer: array<f32>;\n \n @fragment\n fn fragment_main(@location(0) uv : vec2<f32>) -> @location(0) vec4<f32> {\n let y = textureSampleBaseClampToEdge(yPlaneTex, yPlaneSampler, uv).r;\n var u: f32;\n var v: f32;\n u = textureSampleBaseClampToEdge(uPlaneTex, uvPlaneSampler, uv).r;\n v = textureSampleBaseClampToEdge(uPlaneTex, uvPlaneSampler, uv).g;\n \n const yuv2RGB_L = mat4x4(\n 1.1643835616, 0, 1.7927410714, -0.9729450750,\n 1.1643835616, -0.2132486143, -0.5329093286, 0.3014826655,\n 1.1643835616, 2.1124017857, 0, -1.1334022179,\n 0, 0, 0, 1\n );\n \n const yuv2RGB_F = mat4x4(\n 1.0, 0, 1.402, -.701,\n 1.0, -.34413, -.71414, .529135,\n 1.0, 1.772, 0, -.886,\n 0, 0, 0, 1\n );\n \n var color = vec4<f32>(y, u, v, 1.0);\n if (uniforms.colorRange == 0) {\n color = color * yuv2RGB_L;\n } else {\n color = color * yuv2RGB_F;\n }\n \n // outputBuffer[0] = y;\n // outputBuffer[1] = u;\n // outputBuffer[2] = v;\n // outputBuffer[3] = color.r;\n // outputBuffer[4] = color.g;\n // outputBuffer[5] = color.b;\n // outputBuffer[6] = color.a;\n \n return color;\n }\n ",w="\n @group(0) @binding(0) var watermarkSampler: sampler;\n @group(0) @binding(1) var watermarkTex: texture_2d<f32>;\n \n struct VertexOutput {\n @builtin(position) Position: vec4<f32>,\n @location(0) uv: vec2<f32>,\n };\n \n @vertex\n fn v_main(\n @builtin(vertex_index) VertexIndex: u32,\n @location(0) pos: vec2<f32>,\n @location(1) uvPos: vec2<f32>\n ) -> VertexOutput {\n \n var output: VertexOutput;\n output.Position = vec4<f32>(pos, 0.0, 1.0);\n output.uv = vec2f(uvPos.x, uvPos.y);\n return output;\n }\n \n @fragment\n fn f_main(@location(0) uv: vec2<f32>) -> @location(0) vec4<f32> {\n var color: vec4<f32> = textureSampleBaseClampToEdge(watermarkTex, watermarkSampler, uv);\n if (color.r == 0 && color.g == 0 && color.b == 0) {\n color.a = 0;\n }\n return color;\n }\n ",y="\n \n struct FsUniforms {\n cursorFlag: f32,\n cursorInfo: vec4f\n };\n \n @group(0) @binding(0) var cursorSampler: sampler;\n @group(0) @binding(1) var cursorTex: texture_2d<f32>;\n @group(0) @binding(2) var<uniform> uniforms: FsUniforms;\n \n struct VertexOutput {\n @builtin(position) Position: vec4<f32>,\n @location(0) uv: vec2<f32>,\n };\n \n @vertex\n fn v_main(\n @builtin(vertex_index) VertexIndex: u32,\n @location(0) pos: vec2<f32>,\n @location(1) uvPos: vec2<f32>\n ) -> VertexOutput {\n \n var output: VertexOutput;\n output.Position = vec4<f32>(pos, 0.0, 1.0);\n output.uv = vec2f(uvPos.x, 1 - uvPos.y);\n return output;\n }\n \n @fragment\n fn f_main(@location(0) uv: vec2<f32>) -> @location(0) vec4<f32> {\n var color: vec4<f32> = textureSampleBaseClampToEdge(cursorTex, cursorSampler, uv);\n // if (uniforms.cursorFlag == 1) {\n // if (uniforms.cursorInfo.z > 0.0 \n // && uv.x >= uniforms.cursorInfo.x\n // && uv.y >= uniforms.cursorInfo.y\n // && uv.x < uniforms.cursorInfo.x + uniforms.cursorInfo.z\n // && uv.y < uniforms.cursorInfo.y + uniforms.cursorInfo.w) {\n \n // var cursorCoord: vec2f = uv - uniforms.cursorInfo.xy;\n // cursorCoord = cursorCoord / uniforms.cursorInfo.zw;\n // var cursorColor: vec4<f32> = textureSampleBaseClampToEdge(cursorTex, cursorSampler, cursorCoord);\n // color = color * (1.0 - cursorColor.a) + cursorColor * cursorColor.a;\n // }\n // }\n \n return color;\n }\n ",x="\n @vertex\n fn v_main(\n @builtin(vertex_index) VertexIndex: u32,\n @location(0) vtxPos: vec2<f32>,\n ) -> @builtin(position) vec4<f32> {\n return vec4<f32>(vtxPos, 0.0, 1.0);\n }\n \n @fragment\n fn f_main() -> @location(0) vec4<f32> {\n return vec4(0.0, 0.0, 0.0, 1.0);\n }\n ",T="\n @vertex\n fn v_main(\n @builtin(vertex_index) VertexIndex: u32,\n @location(0) vtxPos: vec2<f32>,\n ) -> @builtin(position) vec4<f32> {\n return vec4<f32>(vtxPos, 0.0, 1.0);\n }\n \n struct ClearColorUniforms {\n clearColor: vec4<f32>,\n };\n \n @group(0) @binding(0) var<uniform> uniforms: ClearColorUniforms;\n @fragment\n fn f_main() -> @location(0) vec4<f32> {\n return uniforms.clearColor;\n }\n ",E={TEXTURE_BUFFER:0,VERTEX_BUFFER:1,TEXTURE:2},R={LOW:0,MEDIUM:1,HIGH:2,OVERUSE:3},S={LOW:6e4,MEDIUM:45e3,HIGH:3e4,OVERUSE:15e3},A=[60,120,180,360,540,720,1080,2160],k={VIDEO_FRAME:0,YUV_I420:1,YUV_NV12:2,RGBA_WATERMARK:3,RGBA_CURSOR:4,CLEAR_COLOR:5},M=6,C=[180,360,540,720,1080,2160],P=5},function(e,t,r){"use strict";var i=r(5),n=r(16);new Error;const s=new Map;function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"|";return e?e.toString().replaceAll(/[,,]/g,t):""}let o=null,h=null;function u(e,t){var r,i;if(!function(e){const t=performance.now();return(!s.has(e)||t-s.get(e)>5e3)&&(s.set(e,t),!0)}(e))return;let u;try{u=a("object"==typeof t?JSON.stringify(t):t)}catch(e){u=a(t)}null===(r=h)||void 0===r||r("NEM-".concat(e,"-").concat(u)),n.a.error("NotifyUIError,event=".concat(e,",data=").concat(u)),null===(i=o)||void 0===i||i(e,t)}var l=r(15);function c(){return self.GROWABLE_HEAP_I8?self.GROWABLE_HEAP_I8():Module.HEAP8}function d(){return self.GROWABLE_HEAP_U8?self.GROWABLE_HEAP_U8():Module.HEAPU8}function f(){return self.GROWABLE_HEAP_U16?self.GROWABLE_HEAP_U16():Module.HEAPU16}function p(){return self.GROWABLE_HEAP_U32?self.GROWABLE_HEAP_U32():Module.HEAPU32}function g(){return self.GROWABLE_HEAP_F32?self.GROWABLE_HEAP_F32():Module.HEAPF32}async function m(e,t){try{const r=await new Promise((e,t)=>{const r=i=>{let n=i.data;"DOWNLOAD_WASM_FROM_MAIN_THREAD_OK"===n.command?(y("DE"),self.removeEventListener("message",r),e(n.data)):"DOWNLOAD_WASM_FROM_MAIN_THREAD_FAILED"===n.command&&(self.removeEventListener("message",r),t(new Error("Failed to download WASM file: ".concat(wasmUrl," from main thread"))))};self.addEventListener("message",r),y("DS"),postMessage({status:i.E,url:wasmUrl})});let n=await WebAssembly.instantiate(r,e);n.instance?(self.wasmModuleToShare=n.module,t(n.instance)):(self.wasmModuleToShare=r,t(n))}catch(e){y("IF"),b("E:H Failed to download and instantiate WASM file: ".concat(wasmUrl),e)}}r.d(t,"d",(function(){return c})),r.d(t,"g",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"f",(function(){return p})),r.d(t,"c",(function(){return g})),r.d(t,"q",(function(){return m})),r.d(t,"i",(function(){return v})),r.d(t,"u",(function(){return b})),r.d(t,"t",(function(){return w})),r.d(t,"o",(function(){return y})),r.d(t,"n",(function(){return x})),r.d(t,"v",(function(){return T})),r.d(t,"w",(function(){return E})),r.d(t,"p",(function(){return R})),r.d(t,"s",(function(){return A})),r.d(t,"k",(function(){return k})),r.d(t,"m",(function(){return M})),r.d(t,"r",(function(){return L})),r.d(t,"l",(function(){return I})),r.d(t,"x",(function(){return W})),r.d(t,"b",(function(){return N})),r.d(t,"h",(function(){return F})),r.d(t,"y",(function(){return V})),r.d(t,"a",(function(){return z})),r.d(t,"j",(function(){return H}));const _="function"!=typeof importScripts;function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;_?n.a.error(e,t):b(e,t)}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var r,n,s,a;(t instanceof Error||t instanceof ErrorEvent)&&(e+=" Message: "+(null===(r=t)||void 0===r?void 0:r.message)+" Stack: "+(null!==(n=null===(s=t)||void 0===s||null===(s=s.error)||void 0===s?void 0:s.stack)&&void 0!==n?n:null===(a=t)||void 0===a?void 0:a.stack),t=null);postMessage({status:i.G,errorMessage:e,errorEvent:t})}function w(e){postMessage({status:i.G,errorMessage:e,level:"low"})}function y(e){postMessage({status:i.zb,data:e})}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return t.postMessage({status:i.f,data:e});postMessage({status:i.f,data:e})}function T(e){postMessage({status:i.M,canvasId:e,replaceCanvas:!1})}function E(e){postMessage({status:i.N,canvasId:e})}function R(e){_?u(l.k,e):postMessage({status:i.Bb,where:e})}function S(){let e=this;this.promise=new Promise((function(t,r){e.reject=r,e.resolve=t}))}function A(e){let t;try{if(t=null==e?void 0:e.getContext("2d",{willReadFrequently:!0}),!t)throw new Error("getContext return null for willReadFrequently, canvas:".concat(e))}catch(r){t=null==e?void 0:e.getContext("2d")}return t||b("get2DContextFromCanvas return null"),t}class k{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15e5;this.uint8Map={},this.availableIndex=[],this.capacity=e,this.bytesPerElement=t,this.avaiableIndexMap={},this.deferedList=[];for(let r=0;r<e;r++)this.uint8Map[r]=new Uint8Array(t),this.availableIndex.push(r),this.avaiableIndexMap[r]=!0}increaseBufferSize(e){let t=this.bytesPerElement+e;this.bytesPerElement=t;for(let e=0;e<this.capacity;e++){let r=this.uint8Map[e],i=new Uint8Array(t);i.set(r,0),this.uint8Map[e]=i}}getCapacity(){return this.capacity}get(){if(this.availableIndex.length>0){let e=this.availableIndex.shift();return this.avaiableIndexMap[e]=!1,new Promise((t,r)=>{t({index:e,uint8s:this.uint8Map[e]})})}{let e=new S;return this.deferedList.push(e),e.promise}}getSync(){if(this.availableIndex.length>0){let e=this.availableIndex.shift();return this.avaiableIndexMap[e]=!1,{index:e,uint8s:this.uint8Map[e]}}return null}recycle(e){if(!0!==this.avaiableIndexMap[e]&&(this.avaiableIndexMap[e]=!0,this.availableIndex.push(e),this.deferedList.length>0)){this.deferedList.shift().resolve(this.get())}}}class M{constructor(e){this.sharedBufferList=e}storeFlexible(e,t){let r=e.byteLength-this.sharedBufferList.bytesPerElement;if(r>0){let e=Math.floor(.1*this.sharedBufferList.bytesPerElement),i=r>e?r:e;if(i+this.sharedBufferList.bytesPerElement>t)return Promise.reject("too big, more than maxBytesPerElement");this.sharedBufferList.increaseBufferSize(i)}return this.store(e)}store(e){return this.sharedBufferList.get().then(t=>{try{return this.obj=t,t.uint8s.set(e,0),this.yuvdata=new Uint8Array(t.uint8s.buffer,0,e.byteLength),!0}catch(e){throw e}finally{this.autoRecycle()}})}storeSync(e){let t=this.sharedBufferList.getSync();return null!==t&&(this.obj=t,t.uint8s.set(e,0),this.yuvdata=new Uint8Array(t.uint8s.buffer,0,e.byteLength),!0)}autoRecycle(){this.autoRecycleInterval=setTimeout(()=>{console.log("autoRecycle",this.obj.index),this.recycle()},5e3)}recycle(){try{this.autoRecycleInterval&&clearInterval(this.autoRecycleInterval),this.sharedBufferList.recycle(this.obj.index)}catch(e){b("Error in YuvWrap.recycle: ".concat(e))}}}function C(e,t){t>=e.groupSize||(e.openStatusArray[t]?console.warn("group web transport index ".concat(t,", status reopene")):(e.openStatusArray[t]=!0,e.openedCount+=1,e.openedCount>1||e.params.onopen(e)))}function P(e,t){t>=e.groupSize||(e.openStatusArray[t]?(e.openStatusArray[t]=!1,e.openedCount>0&&(e.openedCount-=1,0==e.openedCount&&e.params.onclose(e))):console.warn("group web transport index ".concat(t,", not open")))}const U=["","MOZ_","OP_","WEBKIT_"];function L(e,t){for(var r=0;r<U.length;++r){var i=U[r]+t,n=e.getExtension(i);if(n)return n}}class I{constructor(e){this.params=e,this.label=this.params.label||"",this.id=this.params.id||0,this.groupSize=e.groupSize,this.openedCount=0,this.sendIndex=0,this.transportArray=[],this.openStatusArray=[];for(let e=0;e<this.groupSize;e++)this.transportArray.push(null),this.openStatusArray.push(!1)}async connect(){for(let e=0;e<this.groupSize;e++){let t=this.params.url;e>0&&(t+="&index="+e);let r={url:t,label:this.params.label,id:this.id,onmessage:this.params.onmessage,onopen:C,onclose:P,group:this,index:e},i=new O(r);await i.connect(),this.transportArray[e]=i}}send(e){if(!(this.openedCount<=0))for(let t=0;t<this.groupSize;t++){this.sendIndex+=1;let t=this.sendIndex%this.groupSize;if(this.transportArray[t]&&this.openStatusArray[t]){this.transportArray[t].send(e);break}}}forceClose(){for(let e=0;e<this.groupSize;e++)this.transportArray[e]&&this.transportArray[e].forceClose()}}class O{constructor(e){this.params=e,this.label=this.params.label||"",this.id=this.params.id||0,this.successfulConnectedCount=0,this.connectIndex=0,this.heartbeat=new Uint8Array([104,101,97,114,116,98,101,97,116]),this.transport=null,this.transport_ready=!1,this.isDestroyed=!1,this.inReading=!1,this.heartbeatStarted=!1,this.reader=null}async connect(){this.reconnect()}async reconnect(){if(this.isReconnectNow||this.isTimerExist||this.isDestroyed)return;this.isReconnectNow=!0,this.isTimerExist=!0;let e=Math.pow(2,this.connectIndex)-1;this.connectIndex+=1,setTimeout(async()=>{if(this.isDestroyed)return;this.isTimerExist=!1;let{url:e}=this.params,t=new WebTransport(e);this.transport=t,t.closed.then(()=>{this.reader=null,this.transport_ready=!1,this.params.onclose&&this.params.onclose(this.params.group,this.params.index)}).catch(e=>{this.reader=null,this.transport_ready=!1,this.params.onerror&&this.params.onerror(e),this.params.onclose(this.params.group,this.params.index),this.connectIndex<8&&this.reconnect()});try{if(this.isReconnectNow=!1,await t.ready,this.isDestroyed)return void this.close();this.transport_ready=!0,this.successfulConnectedCount++,t.datagrams.incomingMaxAge=1e3,t.datagrams.outgoingMaxAge=100,t.datagrams.incomingHighWaterMark=800,t.datagrams.outgoingHighWaterMark=800,this.writer=t.datagrams.writable.getWriter(),this.reader=t.datagrams.readable.getReader(),await this.writer.ready,this.params.onopen(this.params.group,this.params.index)}catch(e){return this.params.onerror&&this.params.onerror(e),void this.close()}this.startHeartbeat(),this.read()},1e3*e)}send(e){this.transport_ready&&this.writer.write(e)}async sendAwaitReady(e){this.transport_ready&&await this.writer.ready,this.transport_ready&&await this.writer.write(e)}async startHeartbeat(){if(!this.heartbeatStarted)for(this.heartbeatStarted=!0;;)try{await this.sleep(3e3),await this.sendAwaitReady(this.heartbeat)}catch(e){}}sleep(e){return new Promise(t=>setTimeout(t,e))}localTime(){let e=new Date;return"local time : "+e.getDate()+"/"+(e.getMonth()+1)+"/"+e.getFullYear()+" @ "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+" "}close(){try{this.transport_ready=!1,this.transport&&this.transport.close()}catch(e){}}forceClose(){this.isDestroyed||(this.isDestroyed=!0,this.close())}async read(){if(!this.inReading){for(this.inReading=!0;this.reader;)try{const{value:e,done:t}=await this.reader.read();if(t)break;this.params.onmessage(e)}catch(e){break}this.inReading=!1}}}const D=new Map,B=[90,180,360,720,1080],G=new class{constructor(){this.ssrcInfoMap=new Map,this.timer=null}updateSSRCInfo(e,t){this.ssrcInfoMap.has(e)||this.ssrcInfoMap.set(e,{firstTime:0,lastTime:0,frames:0,fps:0}),this._calculateFPS(e,t),this._removeZeroFPS()}_calculateFPS(e,t){const r=this.ssrcInfoMap.get(e);if(0===r.frames?r.firstTime=t:r.lastTime=t,r.frames+=1,r.frames>2&&r.frames%5==0&&r.lastTime-r.firstTime>=1e3){const t=Math.floor(1e3/((r.lastTime-r.firstTime)/(r.frames-1)));r.fps!==t&&(this._notifyFPS(e,t),r.fps=t),r.firstTime=r.lastTime,r.frames=1}}_removeZeroFPS(){let e=Date.now();this.ssrcInfoMap.forEach((t,r)=>{const i=this.ssrcInfoMap.get(r);i&&e-i.lastTime>2e3&&(this.ssrcInfoMap.delete(r),this._notifyFPS(r,0))})}_notifyFPS(e,t){postMessage({status:i.u,data:{ssrc:e,fps:t}})}_checkIfNewFrameComing(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(()=>{this._removeZeroFPS(),this.timer=null},2500)}};function W(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const{r_w:n,r_h:s,rotation:a,ssrc:o}=e;let h=1==a||3==a,u=h?s:n,l=h?n:s;const c=o>>10<<10,d=B.reduce((e,t)=>Math.abs(e-l)>Math.abs(t-l)?t:e,B[0]),f=B.findIndex(e=>e===d);if(!D.get(c)||D.get(c).width!==u||D.get(c).height!==l){const e={width:u,height:l,ssrc:c,quality:f};D.set(c,e),r?r(e):postMessage({status:i.v,data:e})}t&&G.updateSSRCInfo(c,Date.now())}function N(e,t){return e&&t?Math.abs(e/t-4/3)<.01?2:Math.abs(e/t-16/9)<.01?3:1:1}function F(e,t,r,i,n){if(!n&&!i||1==e)return!1;let s=i&&t>=640,a=n&&t>=1280;return 2!=e||640==t&&480==r?s||a:((s||a)&&v("ratio is 4:3 but wencodec not supported width: ".concat(t,", height: ").concat(r)),!1)}function V(e,t){e?e.send(t):b("websocket is null",new Error("message type ".concat(t[0])))}function z(e){return e&&"undefined"!=typeof atob?Uint8Array.from(atob(e),e=>e.charCodeAt(0)):null}function H(e,t){return t&&(!e||e.websocketaddress!=t)}},function(e,t,r){"use strict";r.d(t,"y",(function(){return i})),r.d(t,"Y",(function(){return n})),r.d(t,"L",(function(){return s})),r.d(t,"K",(function(){return a})),r.d(t,"J",(function(){return o})),r.d(t,"v",(function(){return h})),r.d(t,"q",(function(){return u})),r.d(t,"r",(function(){return l})),r.d(t,"w",(function(){return c})),r.d(t,"x",(function(){return d})),r.d(t,"u",(function(){return f})),r.d(t,"X",(function(){return p})),r.d(t,"P",(function(){return g})),r.d(t,"Q",(function(){return m})),r.d(t,"O",(function(){return _})),r.d(t,"M",(function(){return v})),r.d(t,"s",(function(){return b})),r.d(t,"k",(function(){return w})),r.d(t,"n",(function(){return y})),r.d(t,"l",(function(){return x})),r.d(t,"m",(function(){return T})),r.d(t,"db",(function(){return E})),r.d(t,"B",(function(){return R})),r.d(t,"C",(function(){return S})),r.d(t,"W",(function(){return A})),r.d(t,"ab",(function(){return k})),r.d(t,"V",(function(){return M})),r.d(t,"Z",(function(){return C})),r.d(t,"N",(function(){return P})),r.d(t,"h",(function(){return U})),r.d(t,"g",(function(){return L})),r.d(t,"f",(function(){return I})),r.d(t,"A",(function(){return O})),r.d(t,"z",(function(){return D})),r.d(t,"S",(function(){return B})),r.d(t,"R",(function(){return G})),r.d(t,"e",(function(){return W})),r.d(t,"o",(function(){return N})),r.d(t,"T",(function(){return F})),r.d(t,"U",(function(){return V})),r.d(t,"G",(function(){return z})),r.d(t,"E",(function(){return H})),r.d(t,"H",(function(){return j})),r.d(t,"I",(function(){return X})),r.d(t,"F",(function(){return Y})),r.d(t,"bb",(function(){return q})),r.d(t,"c",(function(){return K})),r.d(t,"b",(function(){return Q})),r.d(t,"cb",(function(){return Z})),r.d(t,"d",(function(){return J})),r.d(t,"t",(function(){return $})),r.d(t,"D",(function(){return ee})),r.d(t,"p",(function(){return te})),r.d(t,"a",(function(){return re})),r.d(t,"j",(function(){return ie})),r.d(t,"i",(function(){return ne}));const i=1e3,n=5,s=43,a=44,o=45,h=0,u=1,l=146,c=2,d=7,f=9,p=17,g=10,m=11,_=12,v=102,b=107,w=0,y=1,x=2,T=3,E=65,R=0,S=1,A=-1,k=0,M=1,C=2,P=3,U=1,L=2,I=3,O={SESSION_TYPE_CONF:0,SESSION_TYPE_AUDIO:1,SESSION_TYPE_DESKSHARE:2,SESSION_TYPE_VIDEO:3,SESSION_TYPE_CHAT:4,SESSION_TYPE_TELEPHONE:5,SESSION_TYPE_ZC_PING:6,SESSION_TYPE_TOTAL_CNT:7},D={CONNECT_TYPE_UDP:0,CONNECT_TYPE_TCP:1},B=24,G=20,W=15,N=10,F=8294400,V=5,z=0,H=1,j=2,X=15,Y=5,q=400,K=7,Q=8,Z={DESKTOP:0,MOBILE:1,ANDROID:2,IPHONE:3},J={DESKTOP_SOURCE:0,UAC_SOURCE:1},$={SHARE_REMOTE_CONTROL_UAC_MOUSE:144,SHARE_REMOTE_CONTROL_UAC_JPEG_FRAME:145},ee=1,te=25,re=1,ie=(new Map([["useinbandfec",{value:1,operater:"add"}],["maxaveragebitrate",{value:48e3,operater:"add"}],["maxplaybackrate",{value:24e3,operater:"add"}],["sprop-maxcapturerate",{value:24e3,operater:"add"}],["sprop-stereo",{value:1,operater:"sub"}],["stereo",{value:1,operater:"sub"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:96e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:96e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:128e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:128e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:"96000",operater:"add"}],["maxplaybackrate",{value:"48000",operater:"add"}],["sprop-maxcapturerate",{value:"48000",operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"add"}],["maxaveragebitrate",{value:64e3,operater:"add"}],["maxplaybackrate",{value:24e3,operater:"add"}],["sprop-maxcapturerate",{value:24e3,operater:"add"}],["sprop-stereo",{value:1,operater:"sub"}],["stereo",{value:1,operater:"sub"}]]),{VIDEO:0,SHARE:1}),ne={PAUSE:0,RESUME:1,STOP:2}},function(e,t,r){"use strict";r.d(t,"j",(function(){return i})),r.d(t,"h",(function(){return n})),r.d(t,"l",(function(){return s})),r.d(t,"sb",(function(){return a})),r.d(t,"qb",(function(){return o})),r.d(t,"ub",(function(){return h})),r.d(t,"Z",(function(){return u})),r.d(t,"d",(function(){return l})),r.d(t,"bb",(function(){return c})),r.d(t,"db",(function(){return d})),r.d(t,"D",(function(){return f})),r.d(t,"ob",(function(){return p})),r.d(t,"H",(function(){return g})),r.d(t,"Eb",(function(){return m})),r.d(t,"n",(function(){return _})),r.d(t,"vb",(function(){return v})),r.d(t,"E",(function(){return b})),r.d(t,"b",(function(){return w})),r.d(t,"zb",(function(){return y})),r.d(t,"S",(function(){return x})),r.d(t,"I",(function(){return T})),r.d(t,"T",(function(){return E})),r.d(t,"xb",(function(){return R})),r.d(t,"f",(function(){return S})),r.d(t,"nb",(function(){return A})),r.d(t,"mb",(function(){return k})),r.d(t,"eb",(function(){return M})),r.d(t,"X",(function(){return C})),r.d(t,"V",(function(){return P})),r.d(t,"a",(function(){return U})),r.d(t,"z",(function(){return L})),r.d(t,"Fb",(function(){return I})),r.d(t,"G",(function(){return O})),r.d(t,"wb",(function(){return D})),r.d(t,"v",(function(){return B})),r.d(t,"u",(function(){return G})),r.d(t,"t",(function(){return W})),r.d(t,"w",(function(){return N})),r.d(t,"U",(function(){return F})),r.d(t,"jb",(function(){return V})),r.d(t,"kb",(function(){return z})),r.d(t,"R",(function(){return H})),r.d(t,"hb",(function(){return j})),r.d(t,"ib",(function(){return X})),r.d(t,"F",(function(){return Y})),r.d(t,"r",(function(){return q})),r.d(t,"q",(function(){return K})),r.d(t,"y",(function(){return Q})),r.d(t,"p",(function(){return Z})),r.d(t,"x",(function(){return J})),r.d(t,"Cb",(function(){return $})),r.d(t,"O",(function(){return ee})),r.d(t,"P",(function(){return te})),r.d(t,"Ab",(function(){return re})),r.d(t,"C",(function(){return ie})),r.d(t,"B",(function(){return ne})),r.d(t,"A",(function(){return se})),r.d(t,"K",(function(){return ae})),r.d(t,"J",(function(){return oe})),r.d(t,"L",(function(){return he})),r.d(t,"o",(function(){return ue})),r.d(t,"s",(function(){return le})),r.d(t,"gb",(function(){return ce})),r.d(t,"fb",(function(){return de})),r.d(t,"Db",(function(){return fe})),r.d(t,"Q",(function(){return pe})),r.d(t,"i",(function(){return ge})),r.d(t,"g",(function(){return me})),r.d(t,"k",(function(){return _e})),r.d(t,"m",(function(){return ve})),r.d(t,"rb",(function(){return be})),r.d(t,"pb",(function(){return we})),r.d(t,"tb",(function(){return ye})),r.d(t,"Y",(function(){return xe})),r.d(t,"cb",(function(){return Te})),r.d(t,"ab",(function(){return Ee})),r.d(t,"c",(function(){return Re})),r.d(t,"M",(function(){return Se})),r.d(t,"Bb",(function(){return Ae})),r.d(t,"N",(function(){return ke})),r.d(t,"yb",(function(){return Me})),r.d(t,"W",(function(){return Ce})),r.d(t,"lb",(function(){return Pe})),r.d(t,"e",(function(){return Ue}));const i=1,n=2,s=3,a=7,o=8,h=9,u=12,l=14,c=15,d=16,f=18,p=20,g=21,m=24,_=26,v=27,b=30,w=31,y=35,x=36,T=37,E=38,R=47,S=48,A=50,k=51,M=52,C=53,P=54,U=56,L=57,I=60,O=61,D=62,B=66.5,G=66.6,W=67,N=68,F=69,V=71,z=72,H=73,j=75,X=76,Y=78,q=105,K=106,Q=107,Z=108,J=109,$=120,ee=121,te=122,re=123,ie=124,ne=125,se=126,ae=127,oe=128,he=129,ue=132,le=133,ce=135,de=136,fe=137,pe=151,ge=-1,me=-2,_e=-3,ve=-5,be=-7,we=-8,ye=-9,xe=-12,Te=-14,Ee=-15,Re=-23,Se=-26,Ae=-27,ke=-28,Me=-35,Ce=-129,Pe=-130,Ue=-131},function(e,t,r){"use strict";r.d(t,"e",(function(){return l})),r.d(t,"b",(function(){return d})),r.d(t,"d",(function(){return f})),r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return g}));var i=r(7),n=r.n(i),s=r(14),a=r(17),o=r(5),h=r(10),u=r(13);const l={AUDIO_DECODE:1,AUDIO_ENCODE:2,VIDEO_DECODE:4,VIDEO_ENCODE:8,SHARR_DECODE:16,SHARR_ENCODE:32},c=e=>{0};class d{constructor(){this.onmessage=c,this.status=d.CLOSED,this.onopen=c,this.onclose=c,this.onwer=null}send(e){}delete(){this.onmessage=c,this.onopen=c,this.onclose=c,this.close()}sendVideo(e,t){}sendWasm(e){}open(){this.status=d.OPEN,this.onopen()}close(){this.status=d.CLOSED,this.onclose()}}n()(d,"OPEN",1),n()(d,"CLOSED",2);class f extends d{constructor(){super({}),this.sab={},this.port=null,this.onmessage=c,this.sender=c,this.videoSender=c,this.reciver=c,this.wasmSender=c}send(e){this.sender(e)}sendVideo(e,t){this.videoSender(e,t)}sendWasm(e){this.wasmSender(e)}delete(){try{var e,t;this.onmessage=c,this.sender=c,this.videoSender=c,this.reciver=c,this.wasmSender=c;let{consumer:r}=(null===(e=this.sab)||void 0===e?void 0:e.reciver)||{};null==r||r.setDataCallback(c),null==r||r.cancelConsume(),this.sab={},this.port&&(this.port.onmessage=c),null===(t=this.port)||void 0===t||t.close()}catch(e){}}open(){this.status!=d.OPEN||this.onopen()}close(){this.status=d.CLOSED,this.delete(),this.onclose()}_onmessage(e){let{cmd:t,data:r}=e.data;switch(t){case o.J:this.reciver();break;case o.K:this.onmessage(r,0);break;case o.L:this.status=r,this.status==d.OPEN?this.onopen():this.onclose()}}createSendAndReceive(){if(!this.port)return;let{sender:e,reciver:t}=this.sab,{sabqueue:r,interval:i}=e||{};r?i?(this.sender=e=>{r.enqueue(e)},this.wasmSender=e=>{r.enqueue(e)},this.videoSender=(e,t)=>{if(!r.enqueueSafe([e,t],!1)){let i=new Uint8Array(t.length+e.length);i.set(e,0),i.set(t,e.length),r.enqueueSafe(i)}}):(this.sender=e=>{r.enqueue(e),this.port.postMessage({cmd:o.J})},this.wasmSender=e=>{r.enqueue(e),this.port.postMessage({cmd:o.J})},this.videoSender=(e,t)=>{if(!r.enqueueSafe([e,t],!1)){let i=new Uint8Array(t.length+e.length);i.set(e,0),i.set(t,e.length),r.enqueueSafe(i)}this.port.postMessage({cmd:o.J})}):(this.sender=e=>{this.port.postMessage({cmd:o.K,data:e},[e.buffer])},this.wasmSender=e=>{let t=new Uint8Array(e.length);t.set(e,0),this.port.postMessage({cmd:o.K,data:t},[t.buffer])},this.videoSender=(e,t)=>{let r=new Uint8Array(t.length+e.length);r.set(e,0),r.set(t,e.length),this.port.postMessage({cmd:o.K,data:r},[r.buffer])});let{sabqueue:n,consumer:h,useCopy:u,interval:l,offset:c}=t||{};if(h&&(h.cancelConsume(),h=null),n){const e=u?e=>{this.onmessage(e,0)}:c?e=>{this.onmessage(e.uint8s,e.begin)}:e=>{this.onmessage(e.uint8s,0)};let r=null,i=p.dataTransportMgr.monitorlogfn;if(l&&i){var d;let e=new s.b({tag:"WCL_M,VDRB"+(null===(d=this.onwer)||void 0===d?void 0:d.type),interval:1e4,reportcallback:m});r=e.timeoutReport.bind(e)}h=new a.a(n,e,r),t.consumer=h,l?h.consume(l,u):this.reciver=()=>{h.consumeAll(u)}}}setMsgPort(e){e!=this.port&&(this.port&&(this.port.onmessage=c,this.port.close(),this.port=null),this.port=e,this.port&&(this._listeners||(this._listeners=this._onmessage.bind(this)),this.port.onmessage=this._listeners,this.createSendAndReceive()))}setSabBuffer(e,t){if(null!=e&&e.sab){let{sab:t,useCopy:r,interval:i,offset:n,length:s,useOneElement:o}=e,h=new a.b(n>0?t.buffer:t,void 0,void 0,!!o,n,s,n>0?t:null);this.sab.sender={sabqueue:h,interval:i,useCopy:r,offset:n}}if(null!=t&&t.sab){var r;let{sab:e,useCopy:i,interval:n,offset:s,length:o,useOneElement:h}=t,u=new a.b(s>0?e.buffer:e,void 0,void 0,!!h,s,o,s>0?e:null),{consumer:l}=(null===(r=this.sab)||void 0===r?void 0:r.reciver)||{};l&&(l.cancelConsume(),this.sab.reciver.consumer=null,this.sab.reciver.sabqueue=null),this.sab.reciver={sabqueue:u,interval:n,useCopy:i,offset:s}}this.createSendAndReceive()}setStatus(e){this.port?this.status!=e&&(this.status=e,this.port.postMessage({cmd:o.L,data:e})):console.error("MsgQueueSocket not initialized")}}class p{constructor(e){this.onmessage=c,this.onopen=c,this.onclose=c,this.connect_type=e.connect_type||p.UDP,this.type=e.type,this.id=e.id||Math.floor(performance.now())<<10|e.type,this.sock=e.sock||new d,this.mgr=e.mgr,this.sock.onmessage=this._onmessage.bind(this),this.sock.onclose=this._onclose.bind(this),this.sock.onopen=this._onopen.bind(this),this.sock.onwer=this,this.remote=e.remote,this.sabInfo=null,this.portInfo=null,this.target_thread=h.b.NO_THREAD,this.local=!!e.local,this._create()}_create(){let e=p.dataTransportMgr;e.transportlists.push(this),!this.local&&e&&e.mainThread&&e.type==u.a.THREAD_SUB&&e.createRemoteTransport(this,e.mainThread)}_close(){let e=p.dataTransportMgr,t=e.transportlists.indexOf(this);-1!=t&&e.transportlists.splice(t,1),!this.local&&e&&e.mainThread&&e.type==u.a.THREAD_SUB&&e.closeRemoteTransport(this,e.mainThread)}_onmessage(e,t){this.onmessage(e,t)}_onclose(){this.onclose()}_onopen(){this.onopen()}isReady(){return!0}send(e){this.sock.send(e)}sendVideo(e,t){this.sock.sendVideo(e,t)}sendWasmData(e){this.sock.sendWasm(e)}setSocket(e){let t=this.sock;this.sock=e,this.sock&&(this.sock.onwer=this,this.sock.onmessage=this._onmessage.bind(this),this.sock.onclose=this._onclose.bind(this),this.sock.onopen=this._onopen.bind(this)),t&&t.delete()}open(){this.sock.open()}close(){this._close(),this.sock.close()}setMsgPort(e){if(!(this.sock instanceof f))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setMsgPort(e)}setSabBuffer(e,t){if(!(this.sock instanceof f))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setSabBuffer(e,t)}setStatus(e){this.sock instanceof f&&this.sock.setStatus(e)}}n()(p,"UDP",0),n()(p,"TCP",1),n()(p,"RLB_UDP",2),n()(p,"dataTransportMgr",null);class g{constructor(e){this.sock=null,this.onmessage=c}isReady(){return!1}send(){c()}setStatus(e){0}}function m(e,t,r,i){var n;null===(n=u.a.monitorlogfn)||void 0===n||n.call(u.a,e,"".concat(t,",").concat(r,",").concat(i))}},function(e,t,r){var i=r(35);e.exports=function(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.d(t,"q",(function(){return i})),r.d(t,"b",(function(){return n})),r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return a})),r.d(t,"i",(function(){return o})),r.d(t,"j",(function(){return h})),r.d(t,"l",(function(){return u})),r.d(t,"r",(function(){return l})),r.d(t,"s",(function(){return c})),r.d(t,"t",(function(){return d})),r.d(t,"m",(function(){return f})),r.d(t,"o",(function(){return p})),r.d(t,"e",(function(){return g})),r.d(t,"n",(function(){return m})),r.d(t,"p",(function(){return _})),r.d(t,"g",(function(){return v})),r.d(t,"h",(function(){return b})),r.d(t,"a",(function(){return w})),r.d(t,"f",(function(){return y})),r.d(t,"k",(function(){return x}));const i=1,n=2,s=3,a=4,o=5,h=6,u=7,l=8,c=9,d=10,f=11,p=129,g=130,m=131,_=132,v=133,b=134,w=135,y=136,x=137},function(e,t,r){"use strict";r.d(t,"h",(function(){return s})),r.d(t,"e",(function(){return a})),r.d(t,"g",(function(){return o})),r.d(t,"f",(function(){return h})),r.d(t,"d",(function(){return u})),r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return c})),r.d(t,"c",(function(){return d}));var i=r(3),n=r(2);function s(e,t){const r=Math.pow(10,t);return Math.floor(e*r)/r}function a(e,t){const r=Math.pow(10,t);return Math.ceil(e*r)/r}function o(e,t,r){if(!e||t<0||r<0)throw new Error("isDimensionsOverMaxDimension2DSize() invalid parameters. res=".concat(e,", width=").concat(t,", height=").concat(r));let n=!1,s=0;const a=e.acquireGPUFeaturesHelper();return a&&(s=a.queryMaxTextureDimension2D(),s>0&&(n=t>s||r>s)),n&&(console.log("isDimensionsOverMaxDimension2DSize() w:".concat(t," h:").concat(r," max:").concat(s)),Object(i.o)("WGPU isDimensionsOverMaxDimension2DSize() w:".concat(t," h:").concat(r," max:").concat(s))),n}function h(e,t){if(!e||t<0)throw new Error("isBufferSizeOverMaxSize() invalid parameters. res=".concat(e,", bufferSize=").concat(t));let r=!1,n=0;const s=e.acquireGPUFeaturesHelper();return s&&(n=s.queryMaxBufferSize(),n>0&&(r=t>n)),r&&(console.log("isBufferSizeOverMaxSize() bufferSize:".concat(t," max:").concat(n)),Object(i.o)("isBufferSizeOverMaxSize() bufferSize:".concat(t," max:").concat(n))),r}function u(e,t){if(!e||null==t)throw new Error("evalCroppingRect() invalid parameters!");return t===n.s||t===n.r?{top:e.top,left:e.left,width:e.height,height:e.width}:e}function l(e,t){let r=0,i=0,n=0,s=0;const a=t.width/t.height;return e.width/e.height>a?(i=e.height,r=i*a,n=(e.width-r)/2,s=0):(r=e.width,i=r/a,n=0,s=(e.height-i)/2),r<=e.canvas.width&&(n=(e.canvas.width-r)/2),i<=e.canvas.height&&(s=(e.canvas.height-i)/2),{x:n,y:s,width:r,height:i}}function c(e,t,r,i){if(!e||!t||!r)return null;const s=t.width/t.height;let a=t.width,o=t.height;if(t.width>e.width||t.height>e.height){const r=e.width/t.width,i=e.height/t.height,n=Math.min(r,i);a*=n,o*=n}let h=0,u=0;e.width/e.height>s?(u=Math.floor(e.height/o)*o,h=Math.floor(u*s/a)*a,h>e.width&&(h=Math.floor(e.width/a)*a,u=Math.floor(h/s/o)*o)):(h=Math.floor(e.width/a)*a,u=Math.floor(h/s/o)*o,u>e.height&&(u=Math.floor(e.height/o)*o,h=Math.floor(u*s/a)*a));let l=0,c=0,d=0,f=0;i==n.p?(l=1-(l+(o-1)/e.height),c=t.left/e.width,f=1-t.top/e.height,d=c+a/e.width):i==n.s?(c=1-(l+(o-1)/e.height),d=1-t.top/e.height,l=t.left/e.width,f=c+a/e.width):i==n.q?(l=t.top/e.height,c=t.left/e.width,f=l+(o-1)/e.height,d=c+a/e.width):i==n.r&&(c=t.top/e.height,d=l+(o-1)/e.height,l=t.left/e.width,f=c+a/e.width);let p=[],g=[{x:d,y:f},{x:d,y:l},{x:c,y:l},{x:d,y:f},{x:c,y:f},{x:c,y:l}];for(let e=0;e<g.length;++e){let t={u:g[e].x,v:g[e].y};p.push(t)}let m=[];for(let e=0;e<p.length;++e){let t=p[e];m.push(t.u),m.push(t.v)}return m}function d(e,t,r,i,o,h){let u=0,l=0,c=0,d=0;if(e){const e=o==n.s||o==n.r?t.height/t.width:t.width/t.height,s=i.left||0,a=i.top||0;if(i.width/i.height>e){const t=i.height*e;u=a/r.height,l=(Math.round((i.width-t)/2)+s)/r.width,d=u+(i.height-1)/r.height,c=l+t/r.width}else{const t=i.width/e;u=(Math.round((i.height-t)/2)+a)/r.height,l=s/r.width,d=u+(t-1)/r.height,c=l+i.width/r.width}o==n.p?(u=1-(u+(i.height-1)/r.height),l=i.left/r.width,d=1-i.top/r.height,c=l+i.width/r.width):o==n.s?(l=1-(u+(i.height-1)/r.height),c=1-i.top/r.height,u=i.left/r.width,d=l+i.width/r.width):o==n.q?(u=i.top/r.height,l=i.left/r.width,d=u+(i.height-1)/r.height,c=l+i.width/r.width):o==n.r&&(l=i.top/r.height,c=u+(i.height-1)/r.height,u=i.left/r.width,d=l+i.width/r.width)}else{const e=i.width/i.height;let t=i.width,h=i.height;if(i.width>r.width||i.height>r.height){const e=r.width/i.width,n=r.height/i.height,s=Math.min(e,n);t*=s,h*=s}let f=0,p=0;r.width/r.height>e?(p=Math.floor(r.height/h)*h,f=Math.floor(p*e/t)*t,f>r.width&&(f=Math.floor(r.width/t)*t,p=Math.floor(f/e/h)*h)):(f=Math.floor(r.width/t)*t,p=Math.floor(f/e/h)*h,p>r.height&&(p=Math.floor(r.height/h)*h,f=Math.floor(p*e/t)*t)),o==n.p?(u=1-(u+(h-1)/r.height),l=i.left/r.width,d=1-i.top/r.height,c=l+t/r.width,i.height>i.width&&(l=a(l,2),c=s(c,2))):o==n.s?(l=1-(u+(h-1)/r.height),c=1-i.top/r.height,u=i.left/r.width,d=l+t/r.width):o==n.q?(u=i.top/r.height,l=i.left/r.width,d=u+(h-1)/r.height,c=l+t/r.width):o==n.r&&(l=i.top/r.height,c=u+(h-1)/r.height,u=i.left/r.width,d=l+t/r.width)}let f=[],p=[{x:c,y:d},{x:c,y:u},{x:l,y:u},{x:c,y:d},{x:l,y:d},{x:l,y:u}];for(let e=0;e<p.length;++e){let t=null;if(h){let r=-1*Math.abs(p[e].x);p[e].x=r,t={u:p[e].x+1,v:p[e].y}}else t={u:p[e].x,v:p[e].y};f.push(t)}let g=[];for(let e=0;e<f.length;++e){let t=f[e];g.push(t.u),g.push(t.v)}return g}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return a}));var i=r(7),n=r.n(i);class s{constructor(){this.onmessage=()=>{}}addEventListener(){}close(){}}class a{constructor(e){this.transportMap={},this.netthreadworker=null,this.type=e.type,this.mgr=e,this.transportlistsChnagelinster=[]}addEventListener(e){-1==this.transportlistsChnagelinster.indexOf(e)&&this.transportlistsChnagelinster.push(e)}removeEventListener(e){let t=this.transportlistsChnagelinster.indexOf(e);-1!=t&&this.transportlistsChnagelinster.splice(t,1)}addTransport(e,t){e.id in this.transportMap||(this.transportMap[e.id]=e,this.transportlistsChnagelinster.forEach(r=>{r(e,t,1)}))}removeTransport(e){var t;let r=e.id;r in this.transportMap&&(delete this.transportMap[r],null===(t=e.sock)||void 0===t||t.close(),this.transportlistsChnagelinster.forEach(t=>{t(e,e.channel,0)}))}getTransportByType(e){for(let t in this.transportMap){let r=this.transportMap[t],i=r.target_thread==a.SELF_THREAD;if(r.type==e&&i)return r}return null}}n()(a,"NO_THREAD",0),n()(a,"SELF_THREAD",1)},function(e,t,r){"use strict";function i(){this.a=[],this.b=0,this.residue=null}i.prototype.getLength=function(){return this.a.length-this.b},i.prototype.isEmpty=function(){return 0==this.a.length},i.prototype.enqueue=function(e){this.a.push(e)},i.prototype.dequeue=function(){if(0!=this.a.length){var e=this.a[this.b];return 2*++this.b>=this.a.length&&(this.a=this.a.slice(this.b),this.b=0),e}return null},i.prototype.peek=function(){return 0<this.a.length?this.a[this.b]:void 0},i.prototype.clear=function(){this.a=[],this.b=0},t.a=i},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return n})),r.d(t,"c",(function(){return s}));const i={AUDIO:1,SHARING:2,VIDEO:3},n={VIDEO_ENCODE:"0",VIDEO_DECODE:"1",AUDIO_ENCODE:"2",AUDIO_DECODE:"3",SHARING_ENCODE:"4",SHARING_DECODE:"5"},s=((()=>{const e={};for(const t in n)e[n[t]]="WCL_"+t})(),{[n.AUDIO_ENCODE]:"audio.encode",[n.AUDIO_DECODE]:"audio.decode",[n.VIDEO_ENCODE]:"video.encode",[n.VIDEO_DECODE]:"video.decode",[n.SHARING_ENCODE]:"share.encode",[n.SHARING_DECODE]:"share.decode"})},function(e,t,r){"use strict";r.d(t,"b",(function(){return u})),r.d(t,"a",(function(){return l}));var i=r(7),n=r.n(i),s=r(5),a=r(10),o=r(6),h=r(22);function u(e,t,r){if(!e)return;let i=o.a.dataTransportMgr;i.type===l.THREAD_MAIN?(i.setSabBuffer(e,t,r),e.remote.postMessage({cmd:s.gb,transportId:e.id,sender:r,reciver:t})):(e.setSabBuffer(t,r),i.mainThread.postMessage({cmd:s.gb,transportId:e.id,sender:r,reciver:t}))}class l{constructor(e){let t=e||{};this.type=t.type||l.THREAD_MAIN,this.refs={},this.transportlists=[],this.mainThread=t.remote,this.subthreadlistner=null,this.channellists=[],this.mediadatachannel=new a.b(this)}_onrecvmainthreadlistener(e){let{cmd:t,transportId:r,data:i}=e.data,n=this.transportlists.find(e=>e.id===r);if(n||t==s.s)switch(t){case s.s:this.addRemoteTransport(e.data,null);break;case s.fb:n.setMsgPort(i||new a.a);break;case s.gb:n.setSabBuffer(e.data.sender,e.data.reciver);break;case s.o:n.remote=null,this.removeTransport(n)}}_onrecvsubthreadlistener(e,t){let{cmd:r,transportId:i,transportType:n}=t.data,a=this.transportlists.find(e=>e.id===i);switch(r){case s.s:this.addRemoteTransport(t.data,e);break;case s.gb:this.setSabBufferInfo(a,t.data.sender,t.data.reciver);break;case s.o:a.remote=null,this.removeTransport(a)}}createRemoteTransport(e,t){let r={cmd:s.s,transportType:e.type,transportId:e.id};e.portInfo?(r.port=e.portInfo,t.postMessage(r,[e.portInfo])):t.postMessage(r)}closeRemoteTransport(e,t){t.postMessage({cmd:s.o,transportType:e.type,transportId:e.id})}setRemoteTransportSABBUffer(e,t){var r,i,n,a;(null!==(r=e.sabInfo)&&void 0!==r&&r.sender||null!==(i=e.sabInfo)&&void 0!==i&&i.reciver)&&t.postMessage({cmd:s.gb,transportId:e.id,sender:null===(n=e.sabInfo)||void 0===n?void 0:n.sender,reciver:null===(a=e.sabInfo)||void 0===a?void 0:a.reciver})}addRemoteTransport(e,t){let{transportId:r,port:i,transportType:n}=e;let s=this.createMsgSocketTransport(n);s.id=r,s.remote=t,s.portInfo=i,i?s.setMsgPort(s.portInfo):this.bindMessageChannel(s),this.addTransport(s)}addTransport(e){let t=this.getChannelByTransportT