@zoom/videosdk
Version:
Zoom Web Video SDK
2 lines • 44.4 kB
JavaScript
(()=>{var t={2601:(t,e,r)=>{t.exports=r(4444)},7201:(t,e,r)=>{r(3042)},3565:(t,e,r)=>{"use strict";var s=r(1960);t.exports=s},1829:(t,e,r)=>{"use strict";var s=r(2222);t.exports=s},2671:(t,e,r)=>{"use strict";r(2344),t.exports=r(5951)},6823:(t,e,r)=>{"use strict";var s=r(8280),i=r(2017),o=String.prototype;t.exports=function(t){var e=t.replaceAll;return"string"==typeof t||t===o||s(o,t)&&e===o.replaceAll?i:e}},2017:(t,e,r)=>{"use strict";r(1398),r(1995),r(929);var s=r(1747);t.exports=s("String","replaceAll")},4444:(t,e,r)=>{"use strict";t.exports=r(214)},3042:(t,e,r)=>{"use strict";r(9604)},214:(t,e,r)=>{"use strict";r(397);var s=r(3565);t.exports=s},9604:(t,e,r)=>{"use strict";r(6038);var s=r(1829);t.exports=s},2159:(t,e,r)=>{"use strict";var s=r(2250),i=r(4640),o=TypeError;t.exports=function(t){if(s(t))return t;throw new o(i(t)+" is not a function")}},6624:(t,e,r)=>{"use strict";var s=r(6285),i=String,o=TypeError;t.exports=function(t){if(s(t))return t;throw new o(i(t)+" is not an object")}},5807:(t,e,r)=>{"use strict";var s=r(1907),i=s({}.toString),o=s("".slice);t.exports=function(t){return o(i(t),8,-1)}},3948:(t,e,r)=>{"use strict";var s=r(2623),i=r(2250),o=r(5807),a=r(6264)("toStringTag"),n=Object,u="Arguments"===o(function(){return arguments}());t.exports=s?o:function(t){var e,r,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=n(t),a))?r:u?o(e):"Object"===(s=o(e))&&i(e.callee)?"Arguments":s}},1626:(t,e,r)=>{"use strict";var s=r(9447),i=r(4284),o=r(5817);t.exports=s?function(t,e,r){return i.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},5817:t=>{"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},2532:(t,e,r)=>{"use strict";var s=r(5951),i=Object.defineProperty;t.exports=function(t,e){try{i(s,t,{value:e,configurable:!0,writable:!0})}catch(r){s[t]=e}return e}},9447:(t,e,r)=>{"use strict";var s=r(8828);t.exports=!s((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},9552:(t,e,r)=>{"use strict";var s=r(5951),i=r(6285),o=s.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},6794:(t,e,r)=>{"use strict";var s=r(5951).navigator,i=s&&s.userAgent;t.exports=i?String(i):""},798:(t,e,r)=>{"use strict";var s,i,o=r(5951),a=r(6794),n=o.process,u=o.Deno,h=n&&n.versions||u&&u.version,c=h&&h.v8;c&&(i=(s=c.split("."))[0]>0&&s[0]<4?1:+(s[0]+s[1])),!i&&a&&(!(s=a.match(/Edge\/(\d+)/))||s[1]>=74)&&(s=a.match(/Chrome\/(\d+)/))&&(i=+s[1]),t.exports=i},1091:(t,e,r)=>{"use strict";var s=r(5951),i=r(6024),o=r(2361),a=r(2250),n=r(3846).f,u=r(7463),h=r(2046),c=r(8311),l=r(1626),f=r(9724);r(6128);var d=function(t){var e=function(r,s,o){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(r);case 2:return new t(r,s)}return new t(r,s,o)}return i(t,this,arguments)};return e.prototype=t.prototype,e};t.exports=function(t,e){var r,i,p,g,b,_,m,A,S,E=t.target,y=t.global,v=t.stat,T=t.proto,w=y?s:v?s[E]:s[E]&&s[E].prototype,C=y?h:h[E]||l(h,E,{})[E],P=C.prototype;for(g in e)i=!(r=u(y?g:E+(v?".":"#")+g,t.forced))&&w&&f(w,g),_=C[g],i&&(m=t.dontCallGetSet?(S=n(w,g))&&S.value:w[g]),b=i&&m?m:e[g],(r||T||typeof _!=typeof b)&&(A=t.bind&&i?c(b,s):t.wrap&&i?d(b):T&&a(b)?o(b):b,(t.sham||b&&b.sham||_&&_.sham)&&l(A,"sham",!0),l(C,g,A),T&&(f(h,p=E+"Prototype")||l(h,p,{}),l(h[p],g,b),t.real&&P&&(r||!P[g])&&l(P,g,b)))}},8828:t=>{"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},6024:(t,e,r)=>{"use strict";var s=r(1505),i=Function.prototype,o=i.apply,a=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(s?a.bind(o):function(){return a.apply(o,arguments)})},8311:(t,e,r)=>{"use strict";var s=r(2361),i=r(2159),o=r(1505),a=s(s.bind);t.exports=function(t,e){return i(t),void 0===e?t:o?a(t,e):function(){return t.apply(e,arguments)}}},1505:(t,e,r)=>{"use strict";var s=r(8828);t.exports=!s((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},3930:(t,e,r)=>{"use strict";var s=r(1505),i=Function.prototype.call;t.exports=s?i.bind(i):function(){return i.apply(i,arguments)}},2361:(t,e,r)=>{"use strict";var s=r(5807),i=r(1907);t.exports=function(t){if("Function"===s(t))return i(t)}},1907:(t,e,r)=>{"use strict";var s=r(1505),i=Function.prototype,o=i.call,a=s&&i.bind.bind(o,o);t.exports=s?a:function(t){return function(){return o.apply(t,arguments)}}},1747:(t,e,r)=>{"use strict";var s=r(5951),i=r(2046);t.exports=function(t,e){var r=i[t+"Prototype"],o=r&&r[e];if(o)return o;var a=s[t],n=a&&a.prototype;return n&&n[e]}},5582:(t,e,r)=>{"use strict";var s=r(2046),i=r(5951),o=r(2250),a=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?a(s[t])||a(i[t]):s[t]&&s[t][e]||i[t]&&i[t][e]}},9367:(t,e,r)=>{"use strict";var s=r(2159),i=r(7136);t.exports=function(t,e){var r=t[e];return i(r)?void 0:s(r)}},7703:(t,e,r)=>{"use strict";var s=r(1907),i=r(9298),o=Math.floor,a=s("".charAt),n=s("".replace),u=s("".slice),h=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,r,s,l,f){var d=r+t.length,p=s.length,g=c;return void 0!==l&&(l=i(l),g=h),n(f,g,(function(i,n){var h;switch(a(n,0)){case"$":return"$";case"&":return t;case"`":return u(e,0,r);case"'":return u(e,d);case"<":h=l[u(n,1,-1)];break;default:var c=+n;if(0===c)return i;if(c>p){var f=o(c/10);return 0===f?i:f<=p?void 0===s[f-1]?a(n,1):s[f-1]+a(n,1):i}h=s[c-1]}return void 0===h?"":h}))}},5951:function(t,e,r){"use strict";var s=function(t){return t&&t.Math===Math&&t};t.exports=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof r.g&&r.g)||s("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9724:(t,e,r)=>{"use strict";var s=r(1907),i=r(9298),o=s({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},3648:(t,e,r)=>{"use strict";var s=r(9447),i=r(8828),o=r(9552);t.exports=!s&&!i((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},6946:(t,e,r)=>{"use strict";var s=r(1907),i=r(8828),o=r(5807),a=Object,n=s("".split);t.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"===o(t)?n(t,""):a(t)}:a},2250:t=>{"use strict";var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},7463:(t,e,r)=>{"use strict";var s=r(8828),i=r(2250),o=/#|\.prototype\./,a=function(t,e){var r=u[n(t)];return r===c||r!==h&&(i(e)?s(e):!!e)},n=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=a.data={},h=a.NATIVE="N",c=a.POLYFILL="P";t.exports=a},7136:t=>{"use strict";t.exports=function(t){return null==t}},6285:(t,e,r)=>{"use strict";var s=r(2250);t.exports=function(t){return"object"==typeof t?null!==t:s(t)}},7376:t=>{"use strict";t.exports=!0},2087:(t,e,r)=>{"use strict";var s=r(6285),i=r(5807),o=r(6264)("match");t.exports=function(t){var e;return s(t)&&(void 0!==(e=t[o])?!!e:"RegExp"===i(t))}},5594:(t,e,r)=>{"use strict";var s=r(5582),i=r(2250),o=r(8280),a=r(1175),n=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=s("Symbol");return i(e)&&o(e.prototype,n(t))}},4284:(t,e,r)=>{"use strict";var s=r(9447),i=r(3648),o=r(8661),a=r(6624),n=r(470),u=TypeError,h=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l="enumerable",f="configurable",d="writable";e.f=s?o?function(t,e,r){if(a(t),e=n(e),a(r),"function"==typeof t&&"prototype"===e&&"value"in r&&d in r&&!r[d]){var s=c(t,e);s&&s[d]&&(t[e]=r.value,r={configurable:f in r?r[f]:s[f],enumerable:l in r?r[l]:s[l],writable:!1})}return h(t,e,r)}:h:function(t,e,r){if(a(t),e=n(e),a(r),i)try{return h(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new u("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},3846:(t,e,r)=>{"use strict";var s=r(9447),i=r(3930),o=r(2574),a=r(5817),n=r(7374),u=r(470),h=r(9724),c=r(3648),l=Object.getOwnPropertyDescriptor;e.f=s?l:function(t,e){if(t=n(t),e=u(e),c)try{return l(t,e)}catch(t){}if(h(t,e))return a(!i(o.f,t,e),t[e])}},8280:(t,e,r)=>{"use strict";var s=r(1907);t.exports=s({}.isPrototypeOf)},2574:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,i=s&&!r.call({1:2},1);e.f=i?function(t){var e=s(this,t);return!!e&&e.enumerable}:r},581:(t,e,r)=>{"use strict";var s=r(3930),i=r(2250),o=r(6285),a=TypeError;t.exports=function(t,e){var r,n;if("string"===e&&i(r=t.toString)&&!o(n=s(r,t)))return n;if(i(r=t.valueOf)&&!o(n=s(r,t)))return n;if("string"!==e&&i(r=t.toString)&&!o(n=s(r,t)))return n;throw new a("Can't convert object to primitive value")}},2046:t=>{"use strict";t.exports={}},5606:(t,e,r)=>{"use strict";var s=r(6624);t.exports=function(){var t=s(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},663:(t,e,r)=>{"use strict";var s=r(3930),i=r(9724),o=r(8280),a=r(5606),n=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in n||i(t,"flags")||!o(n,t)?e:s(a,t)}},4239:(t,e,r)=>{"use strict";var s=r(7136),i=TypeError;t.exports=function(t){if(s(t))throw new i("Can't call method on "+t);return t}},6128:(t,e,r)=>{"use strict";var s=r(7376),i=r(5951),o=r(2532),a="__core-js_shared__",n=t.exports=i[a]||o(a,{});(n.versions||(n.versions=[])).push({version:"3.39.0",mode:s?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5816:(t,e,r)=>{"use strict";var s=r(6128);t.exports=function(t,e){return s[t]||(s[t]=e||{})}},9846:(t,e,r)=>{"use strict";var s=r(798),i=r(8828),o=r(5951).String;t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol("symbol detection");return!o(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&s&&s<41}))},7374:(t,e,r)=>{"use strict";var s=r(6946),i=r(4239);t.exports=function(t){return s(i(t))}},9298:(t,e,r)=>{"use strict";var s=r(4239),i=Object;t.exports=function(t){return i(s(t))}},6028:(t,e,r)=>{"use strict";var s=r(3930),i=r(6285),o=r(5594),a=r(9367),n=r(581),u=r(6264),h=TypeError,c=u("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var r,u=a(t,c);if(u){if(void 0===e&&(e="default"),r=s(u,t,e),!i(r)||o(r))return r;throw new h("Can't convert object to primitive value")}return void 0===e&&(e="number"),n(t,e)}},470:(t,e,r)=>{"use strict";var s=r(6028),i=r(5594);t.exports=function(t){var e=s(t,"string");return i(e)?e:e+""}},2623:(t,e,r)=>{"use strict";var s={};s[r(6264)("toStringTag")]="z",t.exports="[object z]"===String(s)},160:(t,e,r)=>{"use strict";var s=r(3948),i=String;t.exports=function(t){if("Symbol"===s(t))throw new TypeError("Cannot convert a Symbol value to a string");return i(t)}},4640:t=>{"use strict";var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},6499:(t,e,r)=>{"use strict";var s=r(1907),i=0,o=Math.random(),a=s(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++i+o,36)}},1175:(t,e,r)=>{"use strict";var s=r(9846);t.exports=s&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8661:(t,e,r)=>{"use strict";var s=r(9447),i=r(8828);t.exports=s&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},6264:(t,e,r)=>{"use strict";var s=r(5951),i=r(5816),o=r(9724),a=r(6499),n=r(9846),u=r(1175),h=s.Symbol,c=i("wks"),l=u?h.for||h:h&&h.withoutSetter||a;t.exports=function(t){return o(c,t)||(c[t]=n&&o(h,t)?h[t]:l("Symbol."+t)),c[t]}},2344:(t,e,r)=>{"use strict";var s=r(1091),i=r(5951);s({global:!0,forced:i.globalThis!==i},{globalThis:i})},1398:()=>{},929:(t,e,r)=>{"use strict";var s=r(1091),i=r(3930),o=r(1907),a=r(4239),n=r(2250),u=r(7136),h=r(2087),c=r(160),l=r(9367),f=r(663),d=r(7703),p=r(6264),g=r(7376),b=p("replace"),_=TypeError,m=o("".indexOf),A=o("".replace),S=o("".slice),E=Math.max;s({target:"String",proto:!0},{replaceAll:function(t,e){var r,s,o,p,y,v,T,w,C,P,D=a(this),M=0,L="";if(!u(t)){if((r=h(t))&&(s=c(a(f(t))),!~m(s,"g")))throw new _("`.replaceAll` does not allow non-global regexes");if(o=l(t,b))return i(o,t,D,e);if(g&&r)return A(c(D),t,e)}for(p=c(D),y=c(t),(v=n(e))||(e=c(e)),T=y.length,w=E(1,T),C=m(p,y);-1!==C;)P=v?c(e(y,C,p)):d(y,p,C,[],void 0,e),L+=S(p,M,C)+P,M=C+T,C=C+w>p.length?-1:m(p,y,C+w);return M<p.length&&(L+=S(p,M)),L}})},1995:()=>{},397:(t,e,r)=>{"use strict";r(2344)},6038:(t,e,r)=>{"use strict";r(929)},1960:(t,e,r)=>{"use strict";var s=r(2671);t.exports=s},2222:(t,e,r)=>{"use strict";var s=r(6823);t.exports=s}},e={};function r(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={exports:{}};return t[s].call(o.exports,o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var s in e)r.o(e,s)&&!r.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(2601),e=r.n(t),s=function(t,e){this._BYTES_PER_ELEMENT=e,this.capacity=(t.byteLength-8)/e,this.usableCapacity=this.capacity-1,this.buf=t,this.write_ptr=new Uint32Array(this.buf,0,1),this.read_ptr=new Uint32Array(this.buf,4,1),this.storageUint8s=new Uint8Array(this.buf,8,t.byteLength-8)};s.prototype.available_read=function(){var t=Atomics.load(this.read_ptr,0),e=Atomics.load(this.write_ptr,0);return this._available_read(t,e)},s.prototype._available_read=function(t,e){return(e+this.capacity-t)%this.capacity},s.prototype.dequeue=function(){var t=Atomics.load(this.read_ptr,0);let e=new Uint32Array(this.buf,t*this._BYTES_PER_ELEMENT+8,1);return this.storageUint8s.subarray(t*this._BYTES_PER_ELEMENT+4,t*this._BYTES_PER_ELEMENT+4+e[0])},s.prototype.addReadPtr=function(){var t=Atomics.load(this.read_ptr,0);Atomics.store(this.read_ptr,0,(t+1)%this.capacity)},s.prototype.getReaderPtr=function(){return this.read_ptr[0]},s.prototype.setReaderPtr=function(t){Atomics.store(this.read_ptr,0,t%this.capacity)},s.prototype.get=function(t){let e=t%this.capacity,r=new Uint32Array(this.buf,e*this._BYTES_PER_ELEMENT+8,1);return this.storageUint8s.subarray(e*this._BYTES_PER_ELEMENT+4,e*this._BYTES_PER_ELEMENT+4+r[0])};const i=s,o="MEDIASDK_CACHE_INFO";function a(t){postMessage({status:35,data:t})}function n(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e)return e.postMessage({status:48,data:t});postMessage({status:48,data:t})}new class{constructor(){this._highFrequencyLogs={},this.fixVersion="",this.cacheLogStack=[],this.isFlushing=!1}setInstance(t,e){this._instance=t,this.fixVersion=e}getMessageFromErrorOrEvent(t,e){let r=t;return e instanceof ErrorEvent?(e.filename&&(r+=" File: ".concat(e.filename)),(e.lineno||e.colno)&&(r+=" Line: ".concat(e.lineno,":").concat(e.colno)),e.message&&(r+=" Message: ".concat(e.message)),e.error&&(r+="\nStack: ".concat(e.error.stack))):e instanceof Error?(e.fileName&&(r+=" File: ".concat(e.fileName)),(e.lineNumber||e.columnNumber)&&(r+=" Line: ".concat(e.lineNumber,":").concat(e.columnNumber)),e.message&&(r+=" Message: ".concat(e.message)),e.stack&&(r+=" Stack: ".concat(e.stack)),e.name&&(r+=" Name: ".concat(e.name)),e.constraint&&(r+=" Constraint: ".concat(e.constraint))):e instanceof CloseEvent?(e.code&&(r+=" Code: ".concat(e.code)),e.reason&&(r+=" Reason: ".concat(e.reason)),r+=" wasClean: ".concat(e.wasClean)):e instanceof DOMException?(e.message&&(r+=" Message: ".concat(e.message)),e.name&&(r+=" Name: ".concat(e.name))):r+=e?e.toString():"",r}_addCacheLog(t,e){this.cacheLogStack.length<100&&this.cacheLogStack.push({type:t,message:e})}flushCacheLog(){if(this._instance&&this.cacheLogStack.length>0&&!this.isFlushing){this.isFlushing=!0;let t="";this.cacheLogStack.forEach((e=>{let{type:r,message:{message:s="",tags:i=[]}}=e;const a=s?"".concat(i.join("|"),":").concat(s).concat("|----|"):"";switch(r){case"log":this._log(s,[...i,o]);break;case"warn":case"error":case"severityerror":case"directReport":t+=a}})),t&&this._directReport(t,[o]),this.cacheLogStack=[],this.isFlushing=!1}}log(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this._instance?(this.flushCacheLog(),this._log(t,e)):this._addCacheLog("log",{message:t,tags:e})}warn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];t=this.getMessageFromErrorOrEvent(t,e),this._instance?(this.flushCacheLog(),this._warn(t,r)):this._addCacheLog("warn",{message:t,tags:r})}error(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];var s;t=this.getMessageFromErrorOrEvent(t,e),this._highFrequencyLogs[t]?this._highFrequencyLogs[t]+=1:this._highFrequencyLogs[t]=1,!((s=this._highFrequencyLogs[t])&s-1)&&(this._instance?(this.flushCacheLog(),this._error(t,r)):this._addCacheLog("error",{message:t,tags:r}))}severityerror(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this._instance?(this.flushCacheLog(),this._severityerror(JSON.stringify(t),e)):this._addCacheLog("severityerror",{message:JSON.stringify(t),tags:e})}directReport(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["MEDIASDK_INFO"];var r;this._instance?(this.flushCacheLog(),null===(r=this._directReport)||void 0===r||r.call(this,t,e)):this._addCacheLog("directReport",{message:t,tags:e})}_log(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this._instance&&this._instance.log(t,e)}_warn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this._instance&&this._instance.warn(t,e)}_error(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this._instance&&this._instance.error(t,[this.fixVersion,...e])}_severityerror(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this._instance&&this._instance.error(t,e)}_directReport(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];var r,s;this._instance&&(null===(r=(s=this._instance).directReport)||void 0===r||r.call(s,{msg:t},e))}clearHighFrequencyLogs(){this._highFrequencyLogs={}}},r(7201),new Error,new Map,new Map,new class{constructor(){this.ssrcInfoMap=new Map,this.timer=null}updateSSRCInfo(t,e){this.ssrcInfoMap.has(t)||this.ssrcInfoMap.set(t,{firstTime:0,lastTime:0,frames:0,fps:0}),this._calculateFPS(t,e),this._removeZeroFPS()}_calculateFPS(t,e){const r=this.ssrcInfoMap.get(t);if(0===r.frames?r.firstTime=e:r.lastTime=e,r.frames+=1,r.frames>2&&r.frames%5==0&&r.lastTime-r.firstTime>=1e3){const e=Math.floor(1e3/((r.lastTime-r.firstTime)/(r.frames-1)));r.fps!==e&&(this._notifyFPS(t,e),r.fps=e),r.firstTime=r.lastTime,r.frames=1}}_removeZeroFPS(){let t=Date.now();this.ssrcInfoMap.forEach(((e,r)=>{const s=this.ssrcInfoMap.get(r);s&&t-s.lastTime>2e3&&(this.ssrcInfoMap.delete(r),this._notifyFPS(r,0))}))}_notifyFPS(t,e){postMessage({status:66.6,data:{ssrc:t,fps:e}})}_checkIfNewFrameComing(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((()=>{this._removeZeroFPS(),this.timer=null}),2500)}};const u={ENCODE:1,DECODE:2,DECRPT:3,DECRPT_DECODE:4,WORKLET_APM_ONLY:5},h={MUTE:0,UNMUTE:1,LEAVED:2,MUTE_APM_ONLY:3,UNMUTE_APM_ONLY:4};let c,l,f,d,p,g,b,_,m,A,S=0,E=!0;var y=0,v=!1,T=null,w=!1;const C={WASMTYPE:u,AUDIO_STATE:h,onWasmModuleReady:function(t){if(!t)return console.warn("[AudioWASMAdapter] Module undefined");f=t.cwrap("_Heartbeat","number",["number"]),d=t.cwrap("_MuteUnmuteState","number",["number","number"]),p=t.cwrap("_Switch_Original_Sound","number",["number","boolean","boolean","boolean","boolean"]),g=t.cwrap("_Deliver_Recorded_Data","number",["number","number","number","number","number","number"]),b=t.cwrap("_Switch_Denoise","number",["number","number","number","number"]),_=t.cwrap("_Audio_Init","number",["number","string","string","number","number","boolean","boolean","boolean","number","boolean"]),m=t.cwrap("_Switch_High_Bitrate","number",["number","number"]),A=t.cwrap("_Set_All_Speech_Volume_Level","number",["number"])},setAudioInstanceAndType:function(t,e,r){c=t,e&&(S=e),r&&(l=r)},muteUnmuteState:function(t){if(null!=Object.values(h).find((e=>e==t)))return c?void(S!=u.WORKLET_APM_ONLY&&(d(c,t),a("muteUnmuteState: "+t))):a("muteUnmuteState: -1")},switchOriginalSound:function(t,e,r,s){c&&p(c,t,e,r,s)},deliverRecordedData:function(t,e,r,s){c&&g(c,t,e,0,r,s)},switchDenoise:function(t,e){c&&(v=t,b(c,!!t,3,!!e))},audioInit:function(t,e,r,s,i,o,a,n,u,h){return _(t,e,r,s,i,o,a,n,u,h)},setDecoder:function(t){T=t},needCalculateDenoiseOutput:function(){w=!0},switchHighBitrate:function(t){c&&m(c,t)},disableJitterLog:function(){E=!1},setAllSpeechVolume:function(t){c&&A(c,t)},onMonitorLogWASM:function(t,e){if(e<=0)return;const r=Module.HEAPU8.subarray(t,t+e),s=String.fromCharCode.apply(null,r);s&&(!E&&s.includes("JITTER")||s.includes("WCL_MCM_AUDIO_RECEIVE")&&S!=u.DECRPT&&S!=u.DECRPT_DECODE||s.includes("WCL_MCM_AUDIO,")&&S==u.DECRPT||(S==u.ENCODE||S==u.DECRPT||S==u.DECRPT_DECODE?n(s):S==u.DECODE?l&&l.port&&n(s,l.port):S==u.WORKLET_APM_ONLY&&l.port&&l.port.postMessage({status:"SPEECH_LOG",data:{log:s}})))},onMuteSpeechWarningWASM:function(){postMessage({status:121})},onAudioLevelWASM:function(t,e,r){var s;S!=u.ENCODE&&S!=u.WORKLET_APM_ONLY||1==t&&(0===e&&0===y||(y=e,S===u.ENCODE?postMessage({status:38,value:e}):null!==(s=l)&&void 0!==s&&s.port&&l.port.postMessage({status:38,data:e})))},onAPMProcessedPCMWASM:function(t,e,r,s){if(!v)return;let i=Module.HEAPF32.subarray(t/4,t/4+e);if(T){if(w){w=!1;let{sumRms:t}=function(t,e){let r=0,s=0;for(let i=0;i<t.length;i+=e){s+=t[i]*t[i];let e=Math.abs(t[i]);e>r&&(r=e)}return r=r>1?1:r,{sumRms:s/t.length/e,absMax:r}}(i,2),e=function(t){let e=0;return e=t>.1995?15:t>.0794?14:t>.0316?13:t>.0126?12:t>.005?11:t>.002?10:t>79433e-8?9:t>31623e-8?8:t>12589e-8?7:t>50119e-9?6:t>19953e-9?5:t>79433e-10?4:t>31623e-10?3:t>12589e-10?2:t>5.0119e-7?1:0,e}(t);l.port&&l.port.postMessage({status:"AUDIO_LEVEL_R16_DENOISE",level:e})}T.push([i])}}};class P{constructor(){this.cacheSize=0,this.sameCacheSizeCounter=0}shouldSendCacheSize(t){return t===this.cacheSize&&this.sameCacheSizeCounter++,(this.cacheSize!==t||200===this.sameCacheSizeCounter)&&(this.sameCacheSizeCounter=0,this.cacheSize=t,!0)}}class D{constructor(t,e,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(this.STATE_READ_READY=0,this.STATE_READ_INDEX=1,this.STATE_WRITE_READY=2,this.STATE_WRITE_INDEX=3,this.STATE_DATA_COUNT=4,this.STATE_CACHE_SIZE=5,this.STATY_READY_NO=0,this.STATY_READY_YES=1,this.sabState=new Uint32Array(t),this.sabBuffer=new Float32Array(e),this.perFrameLength=r,this.writeChannelNumb=s,this.bufferLen=this.sabBuffer.length,this.supportSpecialOptimization=this.bufferLen%r==0,this.bufferIndex=null,this.supportSpecialOptimization){let t=this.bufferLen/r;this.bufferIndex=[];for(let e=0;e<t;e++)this.bufferIndex.push(this.sabBuffer.subarray(e*r,e*r+r))}this.placeBuffer=new Float32Array(this.perFrameLength),this.QUANTUM_SIZE=128,this.CACHE_SIZE_MAX_VALUE=Math.floor(Math.floor(this.bufferLen/this.QUANTUM_SIZE)/2),this.CACHE_SIZE_MIN_VALUE=6,this.CACHE_SIZE_MAX_VALUE<this.CACHE_SIZE_MIN_VALUE&&(this.CACHE_SIZE_MAX_VALUE=this.CACHE_SIZE_MIN_VALUE),this.setCacheSize(this.CACHE_SIZE_MIN_VALUE),this._counter=0,this.onCacheSizeChange=null,this.cacheSizeController=new P}getCacheSize(){return Atomics.load(this.sabState,this.STATE_CACHE_SIZE)}setCacheSize(t){t>this.CACHE_SIZE_MAX_VALUE&&(t=this.CACHE_SIZE_MAX_VALUE),t<this.CACHE_SIZE_MIN_VALUE&&(t=this.CACHE_SIZE_MIN_VALUE),this.onCacheSizeChange&&this.cacheSizeController.shouldSendCacheSize(t)&&this.onCacheSizeChange(t),Atomics.store(this.sabState,this.STATE_CACHE_SIZE,t)}setQuantumSize(t){this.QUANTUM_SIZE=t,this.CACHE_SIZE_MAX_VALUE=Math.floor(Math.floor(this.bufferLen/this.QUANTUM_SIZE)/2),this.CACHE_SIZE_MAX_VALUE<this.CACHE_SIZE_MIN_VALUE&&(this.CACHE_SIZE_MAX_VALUE=this.CACHE_SIZE_MIN_VALUE)}isNeedMoreData(){let t=Atomics.load(this.sabState,this.STATE_CACHE_SIZE);return Atomics.load(this.sabState,this.STATE_DATA_COUNT)<t*this.QUANTUM_SIZE}shouldAdjustCacheBuffer(){this._counter>0&&this.setCacheSize(this.getCacheSize()+1)}clear(){this.sabState&&(this.sabState[this.STATE_READ_READY]=0,this.sabState[this.STATE_READ_INDEX]=0,this.sabState[this.STATE_WRITE_READY]=0,this.sabState[this.STATE_WRITE_INDEX]=0,this.sabState[this.STATE_DATA_COUNT]=0),this._counter=0}setWriteReady(){this.sabState[this.STATE_WRITE_READY]=this.STATY_READY_YES}isReady(){return this.sabState[this.STATE_WRITE_READY]&&this.sabState[this.STATE_READ_READY]}getDataCount(){return Atomics.load(this.sabState,this.STATE_DATA_COUNT)}write(t){if(void 0===t[0]||t[0].length*this.writeChannelNumb!==this.perFrameLength)return;let e=this.sabState[this.STATE_READ_READY];return this.sabState[this.STATE_WRITE_READY]||(this.sabState[this.STATE_WRITE_READY]=this.STATY_READY_YES,this.sabState[this.STATE_WRITE_INDEX]=0),e?this.supportSpecialOptimization?this.writeSpecial(t):this.writeNormal(t):void 0}writeNormal(t){let e=this.sabState[this.STATE_WRITE_INDEX];for(let r=0;r<this.writeChannelNumb;r++)for(let s=0;t[r]&&s<t[r].length;s++)this.sabBuffer[(e+s*this.writeChannelNumb+r)%this.bufferLen]=t[r][s];e+=this.perFrameLength,e>=this.bufferLen&&(e-=this.bufferLen),this.sabState[this.STATE_WRITE_INDEX]=e,Atomics.add(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength)}writeSpecial(t){let e=this.sabState[this.STATE_WRITE_INDEX];for(let r=0;r<this.writeChannelNumb;r++)for(let s=0;t[r]&&s<t[r].length;s++)this.bufferIndex[e][s*this.writeChannelNumb+r]=t[r][s];e=(e+1)%this.bufferIndex.length,this.sabState[this.STATE_WRITE_INDEX]=e,Atomics.add(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength)}read(){let t=this.sabState[this.STATE_READ_READY],e=this.sabState[this.STATE_WRITE_READY];if(t||(this.sabState[this.STATE_READ_READY]=this.STATY_READY_YES,this.sabState[this.STATE_READ_INDEX]=0),!e)return null;let r=this.supportSpecialOptimization?this.readSpecial():this.readNormal();return null===r?this.shouldAdjustCacheBuffer():this._counter++,r}readNormal(){let t=this.sabState[this.STATE_READ_INDEX],e=Atomics.load(this.sabState,this.STATE_DATA_COUNT);if(e<this.perFrameLength)return null;if(e>this.bufferLen){let r=Math.ceil((e-this.bufferLen)/this.perFrameLength)+1;t=(r*this.perFrameLength+t)%this.bufferLen,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,r*this.perFrameLength)}let r=null;if(this.bufferLen-t>=this.perFrameLength)r=this.sabBuffer.subarray(t,t+this.perFrameLength);else{let e=this.sabBuffer.subarray(t),s=this.sabBuffer.subarray(0,this.perFrameLength-e.length);r=this.placeBuffer,r.set(e),r.set(s,e.length)}return t+=this.perFrameLength,t>=this.bufferLen&&(t-=this.bufferLen),this.sabState[this.STATE_READ_INDEX]=t,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength),r}readSpecial(){let t=this.sabState[this.STATE_READ_INDEX],e=Atomics.load(this.sabState,this.STATE_DATA_COUNT);if(e<this.perFrameLength)return null;if(e>this.bufferLen){let r=Math.ceil((e-this.bufferLen)/this.perFrameLength)+1;t=(r+t)%this.bufferIndex.length,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,r*this.perFrameLength)}let r=this.bufferIndex[t];return t=(t+1)%this.bufferIndex.length,this.sabState[this.STATE_READ_INDEX]=t,Atomics.sub(this.sabState,this.STATE_DATA_COUNT,this.perFrameLength),r}}class M{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.rframes=t,this.wframes=e,this.writeChannelNumb=r,this.cap=this.lcm(t,e),this.buffer=new Float32Array(this.cap),this.remain=0,this.woffset=0,this.roffset=0}gcd(t,e){return 0===e?t:this.gcd(e,t%e)}lcm(t,e){return t/this.gcd(t,e)*e}push(t){if(null==t[0]||t[0].length*this.writeChannelNumb==this.wframes){for(let e=0;e<this.writeChannelNumb;e++)for(let r=0;r<t[0].length;r++)this.buffer[(this.woffset+r*this.writeChannelNumb+e)%this.cap]=t[e]?t[e][r]:t[0][r];this.woffset+=this.wframes,this.remain+=this.wframes,this.woffset>=this.cap&&(this.woffset=this.woffset%this.cap)}else{var e;console.error("[Audio] critical error in AudioWorklet: data.length:",t.length,"this.woffset:",this.woffset,"this.cap:",this.cap),_workletPrinter&&_workletPrinter.error("critical error in AudioWorklet: ".concat(null===(e=t[0])||void 0===e?void 0:e.length," ").concat(his.writeChannelNumb," ").concat(this.wframes))}}read(){if(!this.hasData())return null;let t=this.buffer.subarray(this.roffset,this.roffset+this.rframes);return this.remain-=this.rframes,this.roffset+=this.rframes,this.roffset>=this.cap&&(this.roffset=this.roffset%this.cap),t}hasData(){return this.remain>=this.rframes}clear(){this.buffer.fill(0),this.remain=0,this.woffset=0,this.roffset=0}}e().onWasmModuleReady=function(){C.onWasmModuleReady(Module),x=Module.cwrap("_Audio_Init","number",["number","string","string","number","number","boolean","boolean","boolean","number","boolean"]),(B=x(H,W,z,0,0,!0,!1,!1,1))?C.setAudioInstanceAndType(B,C.WASMTYPE.DECODE,st):_workletPrinter.error("audio_handle not exist"),k=Module.cwrap("_Audio_Try_Analysis","number",["number","number","number","number"]),U=Module.cwrap("_Get_Mixed_Audio","number",["number","number","number","number"]),F=Module.cwrap("_setMultiViewFlag","number",["number","boolean"]),G=Module.cwrap("_Interpretation_Configure","number",["number","number","number","number"]),Q=Module.cwrap("_Set_Speech_Volume_Level","number",["number","number","number"]),q=Module._malloc(4*$),Module.HEAPU32.subarray(q/4,q/4+$),F(B,j),K=Module._malloc(J),Module.HEAP8.subarray(K,K+J),st.port.postMessage({status:"WASM_INIT_SUCCESS",data:{audio_handle:0!==B}})},e().onAbort=function(t){_workletPrinter.error("WASM onAbort "+(t?t.message:""),t)},e().preInit=function(t){_workletPrinter.debug("WASM preInit"+(t?t.message:""),t)},e().preRun=function(t){_workletPrinter.debug("WASM preRun"+(t?t.message:""),t)},e()._workletPrinter=new class{constructor(t){this.messageQueue=[],this.auidoNodePort,this.userAgent="",this.isSafari=!1,this.debug=this.debug.bind(this),this.log=this.log.bind(this),this.warn=this.warn.bind(this),this.error=this.error.bind(this),this.print_=this.print_.bind(this),this.messageHeader=t}setUserAgent(t){this.userAgent=t,this.userAgent.match(/AppleWebKit\/(\d+)\./)&&(this.isSafari=!0)}setAuidoNodePort(t){this.auidoNodePort=t}debug(t){t=this.messageHeader+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),s=1;s<e;s++)r[s-1]=arguments[s];this.print_({level:"debug",message:t,data:r})}log(t){t=this.messageHeader+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),s=1;s<e;s++)r[s-1]=arguments[s];this.print_({level:"log",message:t,data:r})}warn(t){t=this.messageHeader+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),s=1;s<e;s++)r[s-1]=arguments[s];this.print_({level:"warn",message:t,data:r})}error(t){t=this.messageHeader+t;for(var e=arguments.length,r=new Array(e>1?e-1:0),s=1;s<e;s++)r[s-1]=arguments[s];this.print_({level:"error",message:t,data:r})}print_(t){if(this.messageQueue.push(t),this.auidoNodePort)for(;this.messageQueue.length;){let t=this.messageQueue.shift();this._postToWorkerPrint(t)}}_postToWorkerPrint(t){this.auidoNodePort&&this.auidoNodePort.postMessage({status:"workletMessage",data:{level:t.level,message:t.message,data:t.data}})}}("[Audio][Worklet][WASM]"),e().AudioWasmAdapter=C;class L{constructor(){this.buffList=[],this.cacheMinSize=4,this.cacheMaxSize=16,this.cacheSize=this.cacheMinSize,this.onCacheSizeChange=null,this.onrollbackbuffer=null,this.onneedmoredata=null,this.isReady=!1,this.cacheSizeController=new P}push(t){this.isReady=!0,this.buffList.push({buff:t,offset:0})}copy(t,e,r,s){return t.length-e<=r.length-s?(0===e?r.set(t,s):r.set(t.subarray(e),s),t.length-e):(r.set(t.subarray(e,e+r.length-s),s),r.length-s)}increaseCacheSize(){this.isReady&&this.cacheSize++,this.cacheSize>this.cacheMaxSize&&(this.cacheSize=this.cacheMaxSize),this.onCacheSizeChange&&this.isReady&&this.cacheSizeController.shouldSendCacheSize(this.cacheSize)&&this.onCacheSizeChange(this.cacheSize)}copyTo(t){if(0===this.buffList.length)return t.fill(0),void this.increaseCacheSize();let e=this.buffList[0];if(e.buff.length-e.offset>=t.length)this.copy(e.buff,e.offset,t,0),e.offset+=t.length,e.offset===e.buff.length&&(this.buffList.shift(),this.onrollbackbuffer&&this.onrollbackbuffer(e.buff));else{if(this.buffList.length<2)return t.fill(0),void this.increaseCacheSize();let r=this.copy(e.buff,e.offset,t,0);this.buffList.shift(),this.onrollbackbuffer&&this.onrollbackbuffer(e.buff),e=this.buffList[0],r=this.copy(e.buff,e.offset,t,r),e.offset+=r}}requestMoreData(){this.buffList.length<this.cacheSize&&this.onneedmoredata&&this.onneedmoredata()}hasData(){return this.buffList.length>=2}}class R{constructor(t){this.buffList=[],this.frameLength=t,this.onframedata=null}copy(t,e,r,s){if(t[0].length*V<=r.length-s){for(let e=0;e<V;e++)for(let i=0;t[e]&&i<t[e].length;i++)r[s+i*V+e]=t[e][i];return(t[0].length-e)*V}for(let e=0;e<V;e++)for(let i=0;t[e]&&i<t[e].length&&s+i*V+e<r.length;i++)r[s+i*V+e]=t[e][i];return r.length-s}rollbackbuffer(t){this.buffList.push({buff:t,offset:0})}push(t){0===this.buffList.length&&this.buffList.push({buff:new Float32Array(this.frameLength),offset:0});let e=this.buffList[0];if(e.buff.length-e.offset>=t[0].length*V){let r=this.copy(t,0,e.buff,e.offset);e.offset+=r,e.buff.length===e.offset&&(this.buffList.shift(),this.onframedata&&this.onframedata(e.buff))}else{let r=this.copy(t,0,e.buff,e.offset);if(this.buffList.shift(),this.onframedata&&this.onframedata(e.buff),t[0].length*V>r){let e=[];for(let s=0;s<V;s++)e.push(t[s].subarray(Math.floor(r/V)+(r%V>s?1:0)));this.push(e)}}}}class N{constructor(t,e){this.context=e,this.decodePort=null,this.encodePort=null,this.captureSize=t/100*V,this.playBuffer=new L,this.playBuffer.onrollbackbuffer=t=>{this.decodePort},this.playBuffer.onneedmoredata=()=>{this.decodePort&&this.decodePort.postMessage({status:1})},this.playBuffer.onCacheSizeChange=t=>{this.decodePort&&this.decodePort.postMessage({status:3,cacheSize:t})},this.quantum=new Float32Array(128*Z),this.captureBuffer=new R(this.captureSize),this.captureBuffer.onframedata=t=>{this.encodePort&&this.encodePort.postMessage({command:2,buffer:t},[t.buffer])}}setDecodePort(t){this.decodePort&&this.decodePort.close(),this.decodePort=t,this.decodePort.onmessage=this.handleDecodeData.bind(this)}setEncodePort(t){this.encodePort&&this.encodePort.close(),this.encodePort=t,this.encodePort.onmessage=this.handleEncodeData.bind(this)}handleDecodeData(t){this.context.isPlaying&&this.playBuffer.push(t.data.data)}handleEncodeData(t){0===t.data.event&&this.captureBuffer.rollbackbuffer(t.data.buffer)}requestMoreData(){this.playBuffer.requestMoreData()}close(){this.decodePort&&(this.decodePort=null,this.decodePort.close()),this.encodePort&&(this.encodePort=null,this.encodePort.close())}write(t){this.captureBuffer.push(t)}read(){return this.playBuffer.copyTo(this.quantum),this.requestMoreData(),this.quantum}}let I="undefined"!=typeof SharedArrayBuffer,O=!0;var x=null,k=null,B=null,U=null,F=null;let z=0,W=0,H=0,Y=0,j=!1,V=1,Z=1,X=null;var G,q,Q,K,$=10;let J=1500;function tt(t){let e=t[1];return 4294967296*t[2]+e}new Map,e().update_play_time=function(t,e){if(e){var r=new Uint8Array(e),s=Module.HEAP8.subarray(t+0,t+e);if(r.set(s),j){var i;null===(i=st.videoDecodePort)||void 0===i||i.postMessage({status:1,data:r},[r.buffer])}else{let t=new Uint32Array(r.buffer),e=null,s=null,i=0,o=0;for(let a=0;a<r.length/16;a++){let r=t[4*a];512&r?(e=t.subarray(4*a,4*a+4),o=tt(e)):r>>10==Y>>10&&(s=t.subarray(4*a,4*a+4),i=tt(s))}if(!i&&!o)return;st.port.postMessage({status:57,at:i,st:o})}}};let et=null,rt=null;e().frame_callback=function(t,e,r,s,i,o,a,n){et===t&&rt.length==e*a||(rt=Module.HEAPF32.subarray(t/4,t/4+e*a),et=t),X.push([rt])};let st=null;class it extends AudioWorkletProcessor{static get parameterDescriptors(){return[{name:"pcm",defaultValue:1}]}constructor(t){var r,s;super(),st=this,monitorLOG("WIB"),this.port.onmessage=this.handleMessage.bind(this),this.isPlaying=!1,this.isCapturing=!1,this.wasmModule=null==t||null===(r=t.processorOptions)||void 0===r?void 0:r.wasmModule,t&&t.processorOptions&&(t.processorOptions.audioEncodeChannelsNum&&(V=t.processorOptions.audioEncodeChannelsNum),t.processorOptions.audioDecodeChannelsNum&&(Z=t.processorOptions.audioDecodeChannelsNum)),this.SABConstructor(t&&t.processorOptions?t.processorOptions.sharedBuffer:null),this.noSABConstructor(),e().fsHandler&&e().fsHandler.setPort(this.port),null!=t&&null!==(s=t.processorOptions)&&void 0!==s&&s.userAgent&&_workletPrinter.setUserAgent(t.processorOptions.userAgent),_workletPrinter.setAuidoNodePort(this.port),monitorLOG("WIE")}SABConstructor(t){this.sampleRate_=0,this.g_sharedbuffer=t||null,this.encodeSAB=null,this.decodeSAB=null,this.audioEncodePort=null,this.audioDecodePort=null,this.videoDecodePort=null,this.rtpSAB=null,this.stopPlayAudio=!1,X=new M(128*Z,sampleRate/100*Z)}noSABConstructor(){this.audioProcessBuffer=new N(sampleRate,this),this.isRunning=!0}handleMessage(t){const{status:e,data:r}=t.data;switch(e){case"diableSharedArrayBuffer":I=!1;break;case"disableDecoderinworklet":O=!1;break;case"data":console.info("Dropped audio data before initialized");break;case"stopPlayAudio":this.isPlaying=!1;break;case"stopWorklet":nt=!0;break;case"startPlayAudio":this.isPlaying=!0;break;case"StartCaptureAudio":this.isCapturing=!0;break;case"sampleRate":this.sampleRate_=r;break;case"audiowasm":try{initWasm(Module,this.wasmModule)}catch(t){st.port.postMessage({status:"WASM_INIT_FAILED"}),_workletPrinter.error("init WASM failed, error message:"+t.message+t.stack)}break;case"initData":H=r.userid,z=r.meetingid,W=r.meetingnum;break;case"currentSSRC":Y=r;break;case"stop_audio_incoming":this.stopPlayAudio=r;break;case"codecDoAVSync":j=!0,F&&B&&F(B,!0);break;case"checkProcess":{monitorLOG("PCC"+ut);let t=parseInt(1e3*ht/this.sampleRate_);monitorLOG("ADD:"+t),!ut!==ct&&(ct=!ut,st.port.postMessage({status:"PROCESS_EXCEPTIONS",data:ct})),ut=0,ht=0;break}case"interpretation_set_lang":Module.HEAPU32.subarray(q/4,q/4+$)[0]=r.lang,G(B,1,q,1);break;case"interpretation_enable":Module.HEAPU32.subarray(q/4,q/4+$)[0]=r.enable?1:0,G(B,0,q,1);break;case"interpretation_mute_origin":Module.HEAPU32.subarray(q/4,q/4+$)[0]=r.mute?1:0,G(B,2,q,1);break;case"interpretation_set_interpreter":{let t=Module.HEAPU32.subarray(q/4,q/4+$),e=q;r.interpreterList.length>=$&&(e=Module._malloc(4*r.interpreterList.length),t=Module.HEAPU32.subarray(e/4,e/4+r.interpreterList.length));for(let e=0;e<r.interpreterList.length;e++)t[e]=r.interpreterList[e];G(B,3,e,r.interpreterList.length),r.interpreterList.length>=$&&Module._free(e);break}case"setSpeechVolumeLevel":if(!B)return;Q(B,r.userid,r.volume);break;case 131:C.setAllSpeechVolume(r.volume);break;default:I?this.handleMessageForSAB(t):this.handleMessageForNoSAB(t)}}handleMessageForSAB(t){const{status:e,data:r}=t.data;switch(e){case"encodeAudioPort":this.audioEncodePort&&this.audioEncodePort.close(),this.audioEncodePort=t.ports[0];break;case"decodeAudioPort":this.audioDecodePort&&this.audioDecodePort.close(),this.audioDecodePort=t.ports[0],this.audioDecodePort.onmessage=function(t){};break;case"decodeVideoPort":this.videoDecodePort&&this.videoDecodePort.close(),this.videoDecodePort=t.ports[0];break;case"close":break;case"sharedBuffer":r&&(this.g_sharedbuffer=r),this.g_sharedbuffer&&(this.encodeSAB=new D(this.g_sharedbuffer.inputState,this.g_sharedbuffer.inputBuffer,128*V,V),this.decodeSAB=new D(this.g_sharedbuffer.outputState,this.g_sharedbuffer.outputBuffer,128*Z),this.g_sharedbuffer.echoState&&this.g_sharedbuffer.echoBuffer&&(this.echoSAB=new D(this.g_sharedbuffer.echoState,this.g_sharedbuffer.echoBuffer,128*Z,Z)),this.rtpSAB=new i(this.g_sharedbuffer.rtpBuffer,1200),this.decodeSAB.onCacheSizeChange=t=>{this.audioDecodePort&&this.audioDecodePort.postMessage({status:3,cacheSize:t,isSAB:!0})});break;default:console.warn("unhanle commands in audioworklet",e)}}handleMessageForNoSAB(t){const{status:e}=t.data;switch(e){case"encodeAudioPort":this.audioProcessBuffer.setEncodePort(t.ports[0]);break;case"decodeAudioPort":this.audioProcessBuffer.setDecodePort(t.ports[0]);break;case"close":this.audioProcessBuffer.close(),this.isPlaying=!1,this.isRunning=!1;break;default:console.warn("unhanle commands in audioworklet",e)}}onReceivedRTP(){}process(t,e,r){if(ut++,nt)return!1;try{return I?O?this.SABDecodeProcess(t,e,r):this.SABProcess(t,e,r):this.NoSABprocess(t,e,r)}catch(t){return _workletPrinter.error("::process() exception: "+t.message+t.stack),!0}}NoSABprocess(t,e,r){return!(!this.isRunning||this.isPlaying&&(this.inputDataForNoSAB(t),this.outputDataForNoSAB(e),0))}inputDataForNoSAB(t){if(!t[0]||!t[0][0])return!0;let e=t[0];if(ht+=e[0].length,!at&&t[0].length<V)try{for(let r=t[0].length;!at&&r<V;r++)e.push(e[0])}catch(t){at=!0,_workletPrinter.error("::inputDataForNoSAB() exception: "+t.message+t.stack)}this.audioProcessBuffer.write(e)}outputDataForNoSAB(t){let e=this.audioProcessBuffer.read();if(this.stopPlayAudio)return!0;let r=t[0];if(1===Z)for(let t=0;t<r.length;t++)r[t].set(e);else for(let t=0;t<Z;t++)for(let s=0;r[t]&&s<r[t].length;s++)r[t][s]=e[s*Z+t]}inputData(t){if(!this.encodeSAB)return!0;ht+=t[0].length,this.encodeSAB.write(t),this.audioEncodePort.postMessage({command:2,buffer:!1})}outputDecodeData(t,r){try{X.hasData()||U&&(sampleRate!=ot&&(e().sampleRateLog(ot,sampleRate,"","",3),ot=sampleRate),U(B,sampleRate/100,0,sampleRate,Z))}catch(t){_workletPrinter.error("::outputDecodeData() get_mixed_Audio exception: "+t.message+t.stack)}try{let e=X.read();if(!e)return;if(1===Z)for(let r=0;r<t.length;r++)t[r].set(e);else for(let r=0;r<Z;r++)for(let s=0;t[r]&&s<t[r].length;s++)t[r][s]=e[s*Z+r];r&&this.echoSAB&&this.echoSAB.write(t)}catch(t){_workletPrinter.error("::outputDecodeData() set outputs exception: "+t.message+t.stack)}}outputData(t){if(!this.decodeSAB)return!0;let e=this.decodeSAB.read();if(null===e||this.stopPlayAudio)return!0;if(1===Z)for(let r=0;r<t.length;r++)t[r].set(e);else for(let r=0;r<Z;r++)for(let s=0;t[r]&&s<t[r].length;s++)t[r][s]=e[s*Z+r]}SABDecodeProcess(t,r,s){try{if(!this.rtpSAB)return e().monitorLOG("SABN"),!0;{let t=this.rtpSAB.available_read();t>100&&(t=100);let e=this.rtpSAB.getReaderPtr(),r=0;for(;r<t;){r++;let t=this.rtpSAB.get(e);e++,B&&K&&(Module.HEAP8.subarray(K,K+J).set(t),k(B,0,K,t.length))}this.rtpSAB.setReaderPtr(e)}}catch(t){_workletPrinter.error("::SABDecodeProcess() audio_decode exception: "+t.message+t.stack)}try{let e=t[0],s=r[0];if(!this.g_sharedbuffer)return!0;if(!this.sampleRate_||!s[0])return!0;let i=e[0]&&this.isCapturing;if(i){if(e.length<V&&!at)try{for(let t=e.length;!at&&t<V;t++)e.push(e[0])}catch(t){at=!0,_workletPrinter.error("::SABDecodeProcess() copy input data exception: "+t.message+t.stack)}this.inputData(e)}return this.outputDecodeData(s,i),!0}catch(t){_workletPrinter.error("::SABDecodeProcess() inputs or outputs exception: "+t.message+t.stack)}return!0}SABProcess(t,e,r){let s=t[0],i=e[0];if(!this.g_sharedbuffer)return!0;if(!this.sampleRate_||!i[0])return!0;if(s[0]&&this.isCapturing){if(!at&&s.length<V)try{for(let t=s.length;!at&&t<V;t++)s.push(s[0])}catch(t){at=!0,_workletPrinter.error("::SABProcess() exception: "+t.message+t.stack)}this.inputData(s)}return this.outputData(i),!0}}var ot=0,at=!1,nt=!1,ut=0,ht=0,ct=!1;e().LOG_OUT=function(){},e().fsHandler?(e().LOG_OUT_WEBRTC=e().fsHandler.handleFile,e().Get_ExternalRecord=e().fsHandler.handleViperPrint):(e().LOG_OUT_WEBRTC=function(){},e().Get_ExternalRecord=function(){}),e().send_data=function(){},e().monitorLOG=function(t){t&&st.port.postMessage({status:"MONITOR_LOG",data:t})},e().sampleRateLog=function(t,r,s,i,o){if(!t&&!r)return;let a=null;switch(o){case 1:a="GGDS: ";break;case 2:a="SCAG: ";break;case 3:a="SCIW: "}let n=a+t+"|"+r+"|"+s+"|"+i;e().monitorLOG(n)},e().wcl_trace_log=function(t,r){e().fsHandler&&e().fsHandler.handleAudioSDKUtilPrint(t,r)},e().Viper_NetworkTrace=function(t,e){},registerProcessor("zoomAudioWorklet",it)})()})();
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/js_audio_worklet.min.js-3dd4acc540545c2ca2a5.map