@vinay.kumar.ha/videosdk-ui-toolkit 2.3.5-1.5 → 2.3.5-1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/annoter.min.js +3 -0
- package/dist/lib/audio.encode.wasm +0 -0
- package/dist/lib/audio.light.simd.wasm +0 -0
- package/dist/lib/audio.simd.wasm +0 -0
- package/dist/lib/audio_light_simd.min.js +2 -0
- package/dist/lib/audio_simd.min.js +2 -0
- package/dist/lib/graphics.min.js +2 -0
- package/dist/lib/js_audio_level_worklet_process.min.js +2 -0
- package/dist/lib/js_audio_level_worklet_process_light.min.js +2 -0
- package/dist/lib/js_audio_process.min.js +2 -0
- package/dist/lib/js_audio_processor_worklet.min.js +2 -0
- package/dist/lib/js_audio_worklet.min.js +2 -0
- package/dist/lib/js_audio_worklet_light_simd.min.js +2 -0
- package/dist/lib/js_audio_worklet_process.min.js +2 -0
- package/dist/lib/js_audio_worklet_simd.min.js +2 -0
- package/dist/lib/js_media.min.js +3 -0
- package/dist/lib/js_sharing_audio_worklet.min.js +2 -0
- package/dist/lib/manifest.json +338 -0
- package/dist/lib/mesh_thread.min.js +2 -0
- package/dist/lib/net.wasm +0 -0
- package/dist/lib/net_thread.min.js +2 -0
- package/dist/lib/pako.min.js +2 -0
- package/dist/lib/qrscanner.min.js +2 -0
- package/dist/lib/share_processor.min.js +2 -0
- package/dist/lib/sharing_m.min.js +3 -0
- package/dist/lib/sharing_mtsimd.min.js +3 -0
- package/dist/lib/sharing_s.min.js +2 -0
- package/dist/lib/sharing_simd.min.js +2 -0
- package/dist/lib/tp.min.js +2 -0
- package/dist/lib/tp.wasm +0 -0
- package/dist/lib/vb-resource/dualModel.bin +0 -0
- package/dist/lib/vb-resource/tf.min.js +18 -0
- package/dist/lib/vb.min.js +2 -0
- package/dist/lib/vb_worker.min.js +2 -0
- package/dist/lib/video.decode.js +1 -0
- package/dist/lib/video.decode.wasm +0 -0
- package/dist/lib/video.mt.js +1 -0
- package/dist/lib/video.mt.wasm +0 -0
- package/dist/lib/video.mtsimd.js +1 -0
- package/dist/lib/video.mtsimd.wasm +0 -0
- package/dist/lib/video.simd.js +1 -0
- package/dist/lib/video.simd.wasm +0 -0
- package/dist/lib/video_m.min.js +3 -0
- package/dist/lib/video_mtsimd.min.js +3 -0
- package/dist/lib/video_processor.min.js +2 -0
- package/dist/lib/video_s.min.js +2 -0
- package/dist/lib/video_share_mtsimd.min.js +3 -0
- package/dist/lib/video_simd.min.js +2 -0
- package/dist/lib/wasm_ssrc_stream_service_dynmod.min.js +2 -0
- package/dist/lib/webgpu_renderer_dynmod.min.js +2 -0
- package/dist/lib/wmsc.min.js +2 -0
- package/dist/videosdk-ui-toolkit.min.esm.js +1832 -1832
- package/dist/videosdk-ui-toolkit.min.umd.js +82 -82
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{var e={1668:(e,t,r)=>{"use strict";const{Deflate:i,deflate:n,deflateRaw:s,gzip:a}=r(3303),{Inflate:o,inflate:l,inflateRaw:c,ungzip:u}=r(7083),h=r(9681);e.exports.Deflate=i,e.exports.deflate=n,e.exports.deflateRaw=s,e.exports.gzip=a,e.exports.Inflate=o,e.exports.inflate=l,e.exports.inflateRaw=c,e.exports.ungzip=u,e.exports.constants=h},3303:(e,t,r)=>{"use strict";const i=r(8411),n=r(9805),s=r(1996),a=r(4674),o=r(4442),l=Object.prototype.toString,{Z_NO_FLUSH:c,Z_SYNC_FLUSH:u,Z_FULL_FLUSH:h,Z_FINISH:d,Z_OK:_,Z_STREAM_END:f,Z_DEFAULT_COMPRESSION:p,Z_DEFAULT_STRATEGY:m,Z_DEFLATED:g}=r(9681);function v(e){this.options=n.assign({level:p,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:m},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;let r=i.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==_)throw new Error(a[r]);if(t.header&&i.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?s.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=i.deflateSetDictionary(this.strm,e),r!==_)throw new Error(a[r]);this._dict_set=!0}}function y(e,t){const r=new v(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}v.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let a,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?d:c,"string"==typeof e?r.input=s.string2buf(e):"[object ArrayBuffer]"===l.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===u||o===h)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(a=i.deflate(r,o),a===f)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=i.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===_;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===_&&(this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Deflate=v,e.exports.deflate=y,e.exports.deflateRaw=function(e,t){return(t=t||{}).raw=!0,y(e,t)},e.exports.gzip=function(e,t){return(t=t||{}).gzip=!0,y(e,t)},e.exports.constants=r(9681)},7083:(e,t,r)=>{"use strict";const i=r(1447),n=r(9805),s=r(1996),a=r(4674),o=r(4442),l=r(7414),c=Object.prototype.toString,{Z_NO_FLUSH:u,Z_FINISH:h,Z_OK:d,Z_STREAM_END:_,Z_NEED_DICT:f,Z_STREAM_ERROR:p,Z_DATA_ERROR:m,Z_MEM_ERROR:g}=r(9681);function v(e){this.options=n.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;let r=i.inflateInit2(this.strm,t.windowBits);if(r!==d)throw new Error(a[r]);if(this.header=new l,i.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=s.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=i.inflateSetDictionary(this.strm,t.dictionary),r!==d)))throw new Error(a[r])}function y(e,t){const r=new v(t);if(r.push(e),r.err)throw r.msg||a[r.err];return r.result}v.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,a=this.options.dictionary;let o,l,v;if(this.ended)return!1;for(l=t===~~t?t:!0===t?h:u,"[object ArrayBuffer]"===c.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=i.inflate(r,l),o===f&&a&&(o=i.inflateSetDictionary(r,a),o===d?o=i.inflate(r,l):o===m&&(o=f));r.avail_in>0&&o===_&&r.state.wrap>0&&0!==e[r.next_in];)i.inflateReset(r),o=i.inflate(r,l);switch(o){case p:case m:case f:case g:return this.onEnd(o),this.ended=!0,!1}if(v=r.avail_out,r.next_out&&(0===r.avail_out||o===_))if("string"===this.options.to){let e=s.utf8border(r.output,r.next_out),t=r.next_out-e,i=s.buf2string(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==d||0!==v){if(o===_)return o=i.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},e.exports.Inflate=v,e.exports.inflate=y,e.exports.inflateRaw=function(e,t){return(t=t||{}).raw=!0,y(e,t)},e.exports.ungzip=y,e.exports.constants=r(9681)},9805:e=>{"use strict";const t=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);e.exports.assign=function(e){const r=Array.prototype.slice.call(arguments,1);for(;r.length;){const i=r.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const r in i)t(i,r)&&(e[r]=i[r])}}return e},e.exports.flattenChunks=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,i=0,n=e.length;t<n;t++){let n=e[t];r.set(n,i),i+=n.length}return r}},1996:e=>{"use strict";let t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}const r=new Uint8Array(256);for(let e=0;e<256;e++)r[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;r[254]=r[254]=1,e.exports.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,i,n,s,a=e.length,o=0;for(n=0;n<a;n++)r=e.charCodeAt(n),55296==(64512&r)&&n+1<a&&(i=e.charCodeAt(n+1),56320==(64512&i)&&(r=65536+(r-55296<<10)+(i-56320),n++)),o+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(o),s=0,n=0;s<o;n++)r=e.charCodeAt(n),55296==(64512&r)&&n+1<a&&(i=e.charCodeAt(n+1),56320==(64512&i)&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|63&r):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|63&r):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|63&r);return t},e.exports.buf2string=(e,i)=>{const n=i||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,i));let s,a;const o=new Array(2*n);for(a=0,s=0;s<n;){let t=e[s++];if(t<128){o[a++]=t;continue}let i=r[t];if(i>4)o[a++]=65533,s+=i-1;else{for(t&=2===i?31:3===i?15:7;i>1&&s<n;)t=t<<6|63&e[s++],i--;i>1?o[a++]=65533:t<65536?o[a++]=t:(t-=65536,o[a++]=55296|t>>10&1023,o[a++]=56320|1023&t)}}return((e,r)=>{if(r<65534&&e.subarray&&t)return String.fromCharCode.apply(null,e.length===r?e:e.subarray(0,r));let i="";for(let t=0;t<r;t++)i+=String.fromCharCode(e[t]);return i})(o,a)},e.exports.utf8border=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+r[e[i]]>t?i:t}},3269:e=>{"use strict";e.exports=(e,t,r,i)=>{let n=65535&e,s=e>>>16&65535,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{n=n+t[i++]|0,s=s+n|0}while(--a);n%=65521,s%=65521}return n|s<<16}},9681:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},4823:e=>{"use strict";const t=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());e.exports=(e,r,i,n)=>{const s=t,a=n+i;e^=-1;for(let t=n;t<a;t++)e=e>>>8^s[255&(e^r[t])];return~e}},8411:(e,t,r)=>{"use strict";const{_tr_init:i,_tr_stored_block:n,_tr_flush_block:s,_tr_tally:a,_tr_align:o}=r(3665),l=r(3269),c=r(4823),u=r(4674),{Z_NO_FLUSH:h,Z_PARTIAL_FLUSH:d,Z_FULL_FLUSH:_,Z_FINISH:f,Z_BLOCK:p,Z_OK:m,Z_STREAM_END:g,Z_STREAM_ERROR:v,Z_DATA_ERROR:y,Z_BUF_ERROR:b,Z_DEFAULT_COMPRESSION:w,Z_FILTERED:S,Z_HUFFMAN_ONLY:E,Z_RLE:x,Z_FIXED:T,Z_DEFAULT_STRATEGY:M,Z_UNKNOWN:R,Z_DEFLATED:k}=r(9681),A=258,C=262,F=42,P=113,L=666,D=(e,t)=>(e.msg=u[t],t),I=e=>2*e-(e>4?9:0),O=e=>{let t=e.length;for(;--t>=0;)e[t]=0},U=e=>{let t,r,i,n=e.w_size;t=e.hash_size,i=t;do{r=e.head[--i],e.head[i]=r>=n?r-n:0}while(--t);t=n,i=t;do{r=e.prev[--i],e.prev[i]=r>=n?r-n:0}while(--t)};let N=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const W=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},B=(e,t)=>{s(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,W(e.strm)},G=(e,t)=>{e.pending_buf[e.pending++]=t},j=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},V=(e,t,r,i)=>{let n=e.avail_in;return n>i&&(n=i),0===n?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),r),1===e.state.wrap?e.adler=l(e.adler,t,n,r):2===e.state.wrap&&(e.adler=c(e.adler,t,n,r)),e.next_in+=n,e.total_in+=n,n)},H=(e,t)=>{let r,i,n=e.max_chain_length,s=e.strstart,a=e.prev_length,o=e.nice_match;const l=e.strstart>e.w_size-C?e.strstart-(e.w_size-C):0,c=e.window,u=e.w_mask,h=e.prev,d=e.strstart+A;let _=c[s+a-1],f=c[s+a];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do{if(r=t,c[r+a]===f&&c[r+a-1]===_&&c[r]===c[s]&&c[++r]===c[s+1]){s+=2,r++;do{}while(c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&s<d);if(i=A-(d-s),s=d-A,i>a){if(e.match_start=t,a=i,i>=o)break;_=c[s+a-1],f=c[s+a]}}}while((t=h[t&u])>l&&0!=--n);return a<=e.lookahead?a:e.lookahead},z=e=>{const t=e.w_size;let r,i,n;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-C)&&(e.window.set(e.window.subarray(t,t+t-i),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),U(e),i+=t),0===e.strm.avail_in)break;if(r=V(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=3)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=N(e,e.ins_h,e.window[n+1]);e.insert&&(e.ins_h=N(e,e.ins_h,e.window[n+3-1]),e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<C&&0!==e.strm.avail_in)},Y=(e,t)=>{let r,i,s,a=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,o=0,l=e.strm.avail_in;do{if(r=65535,s=e.bi_valid+42>>3,e.strm.avail_out<s)break;if(s=e.strm.avail_out-s,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>s&&(r=s),r<a&&(0===r&&t!==f||t===h||r!==i+e.strm.avail_in))break;o=t===f&&r===i+e.strm.avail_in?1:0,n(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,W(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(V(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===o);return l-=e.strm.avail_in,l&&(l>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=l&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-l,e.strm.next_in),e.strstart),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?4:t!==h&&t!==f&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(s=e.window_size-e.strstart,e.strm.avail_in>s&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,s+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),s>e.strm.avail_in&&(s=e.strm.avail_in),s&&(V(e.strm,e.window,e.strstart,s),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.high_water<e.strstart&&(e.high_water=e.strstart),s=e.bi_valid+42>>3,s=e.pending_buf_size-s>65535?65535:e.pending_buf_size-s,a=s>e.w_size?e.w_size:s,i=e.strstart-e.block_start,(i>=a||(i||t===f)&&t!==h&&0===e.strm.avail_in&&i<=s)&&(r=i>s?s:i,o=t===f&&0===e.strm.avail_in&&r===i?1:0,n(e,e.block_start,r,o),e.block_start+=r,W(e.strm)),o?3:1)},q=(e,t)=>{let r,i;for(;;){if(e.lookahead<C){if(z(e),e.lookahead<C&&t===h)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-C&&(e.match_length=H(e,r)),e.match_length>=3)if(i=a(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=N(e,e.ins_h,e.window[e.strstart+1]);else i=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(B(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===f?(B(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(B(e,!1),0===e.strm.avail_out)?1:2},X=(e,t)=>{let r,i,n;for(;;){if(e.lookahead<C){if(z(e),e.lookahead<C&&t===h)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-C&&(e.match_length=H(e,r),e.match_length<=5&&(e.strategy===S||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,i=a(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=N(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(B(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(i=a(e,0,e.window[e.strstart-1]),i&&B(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=a(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===f?(B(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(B(e,!1),0===e.strm.avail_out)?1:2};function K(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n}const Z=[new K(0,0,0,0,Y),new K(4,4,8,4,q),new K(4,5,16,8,q),new K(4,6,32,32,q),new K(4,4,16,16,X),new K(8,16,32,32,X),new K(8,16,128,128,X),new K(8,32,128,256,X),new K(32,128,258,1024,X),new K(32,258,258,4096,X)];function Q(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=k,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),O(this.dyn_ltree),O(this.dyn_dtree),O(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),O(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),O(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const J=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==F&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==P&&t.status!==L?1:0},$=e=>{if(J(e))return D(e,v);e.total_in=e.total_out=0,e.data_type=R;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?F:P,e.adler=2===t.wrap?0:1,t.last_flush=-2,i(t),m},ee=e=>{const t=$(e);var r;return t===m&&((r=e.state).window_size=2*r.w_size,O(r.head),r.max_lazy_match=Z[r.level].max_lazy,r.good_match=Z[r.level].good_length,r.nice_match=Z[r.level].nice_length,r.max_chain_length=Z[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},te=(e,t,r,i,n,s)=>{if(!e)return v;let a=1;if(t===w&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),n<1||n>9||r!==k||i<8||i>15||t<0||t>9||s<0||s>T||8===i&&1!==a)return D(e,v);8===i&&(i=9);const o=new Q;return e.state=o,o.strm=e,o.status=F,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=t,o.strategy=s,o.method=r,ee(e)};e.exports.deflateInit=(e,t)=>te(e,t,k,15,8,M),e.exports.deflateInit2=te,e.exports.deflateReset=ee,e.exports.deflateResetKeep=$,e.exports.deflateSetHeader=(e,t)=>J(e)||2!==e.state.wrap?v:(e.state.gzhead=t,m),e.exports.deflate=(e,t)=>{if(J(e)||t>p||t<0)return e?D(e,v):v;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===L&&t!==f)return D(e,0===e.avail_out?b:v);const i=r.last_flush;if(r.last_flush=t,0!==r.pending){if(W(e),0===e.avail_out)return r.last_flush=-1,m}else if(0===e.avail_in&&I(t)<=I(i)&&t!==f)return D(e,b);if(r.status===L&&0!==e.avail_in)return D(e,b);if(r.status===F&&0===r.wrap&&(r.status=P),r.status===F){let t=k+(r.w_bits-8<<4)<<8,i=-1;if(i=r.strategy>=E||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=i<<6,0!==r.strstart&&(t|=32),t+=31-t%31,j(r,t),0!==r.strstart&&(j(r,e.adler>>>16),j(r,65535&e.adler)),e.adler=1,r.status=P,W(e),0!==r.pending)return r.last_flush=-1,m}if(57===r.status)if(e.adler=0,G(r,31),G(r,139),G(r,8),r.gzhead)G(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),G(r,255&r.gzhead.time),G(r,r.gzhead.time>>8&255),G(r,r.gzhead.time>>16&255),G(r,r.gzhead.time>>24&255),G(r,9===r.level?2:r.strategy>=E||r.level<2?4:0),G(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(G(r,255&r.gzhead.extra.length),G(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=c(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(G(r,0),G(r,0),G(r,0),G(r,0),G(r,0),G(r,9===r.level?2:r.strategy>=E||r.level<2?4:0),G(r,3),r.status=P,W(e),0!==r.pending)return r.last_flush=-1,m;if(69===r.status){if(r.gzhead.extra){let t=r.pending,i=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+i>r.pending_buf_size;){let n=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=c(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=n,W(e),0!==r.pending)return r.last_flush=-1,m;t=0,i-=n}let n=new Uint8Array(r.gzhead.extra);r.pending_buf.set(n.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending+=i,r.gzhead.hcrc&&r.pending>t&&(e.adler=c(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,i=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=c(e.adler,r.pending_buf,r.pending-i,i)),W(e),0!==r.pending)return r.last_flush=-1,m;i=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,G(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>i&&(e.adler=c(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,i=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=c(e.adler,r.pending_buf,r.pending-i,i)),W(e),0!==r.pending)return r.last_flush=-1,m;i=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,G(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>i&&(e.adler=c(e.adler,r.pending_buf,r.pending-i,i))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(W(e),0!==r.pending))return r.last_flush=-1,m;G(r,255&e.adler),G(r,e.adler>>8&255),e.adler=0}if(r.status=P,W(e),0!==r.pending)return r.last_flush=-1,m}if(0!==e.avail_in||0!==r.lookahead||t!==h&&r.status!==L){let i=0===r.level?Y(r,t):r.strategy===E?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(z(e),0===e.lookahead)){if(t===h)return 1;break}if(e.match_length=0,r=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(B(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===f?(B(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(B(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===x?((e,t)=>{let r,i,n,s;const o=e.window;for(;;){if(e.lookahead<=A){if(z(e),e.lookahead<=A&&t===h)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){s=e.strstart+A;do{}while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&n<s);e.match_length=A-(s-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(B(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===f?(B(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(B(e,!1),0===e.strm.avail_out)?1:2})(r,t):Z[r.level].func(r,t);if(3!==i&&4!==i||(r.status=L),1===i||3===i)return 0===e.avail_out&&(r.last_flush=-1),m;if(2===i&&(t===d?o(r):t!==p&&(n(r,0,0,!1),t===_&&(O(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),W(e),0===e.avail_out))return r.last_flush=-1,m}return t!==f?m:r.wrap<=0?g:(2===r.wrap?(G(r,255&e.adler),G(r,e.adler>>8&255),G(r,e.adler>>16&255),G(r,e.adler>>24&255),G(r,255&e.total_in),G(r,e.total_in>>8&255),G(r,e.total_in>>16&255),G(r,e.total_in>>24&255)):(j(r,e.adler>>>16),j(r,65535&e.adler)),W(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?m:g)},e.exports.deflateEnd=e=>{if(J(e))return v;const t=e.state.status;return e.state=null,t===P?D(e,y):m},e.exports.deflateSetDictionary=(e,t)=>{let r=t.length;if(J(e))return v;const i=e.state,n=i.wrap;if(2===n||1===n&&i.status!==F||i.lookahead)return v;if(1===n&&(e.adler=l(e.adler,t,r,0)),i.wrap=0,r>=i.w_size){0===n&&(O(i.head),i.strstart=0,i.block_start=0,i.insert=0);let e=new Uint8Array(i.w_size);e.set(t.subarray(r-i.w_size,r),0),t=e,r=i.w_size}const s=e.avail_in,a=e.next_in,o=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,z(i);i.lookahead>=3;){let e=i.strstart,t=i.lookahead-2;do{i.ins_h=N(i,i.ins_h,i.window[e+3-1]),i.prev[e&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=e,e++}while(--t);i.strstart=e,i.lookahead=2,z(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=a,e.input=o,e.avail_in=s,i.wrap=n,m},e.exports.deflateInfo="pako deflate (from Nodeca project)"},7414:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},7293:e=>{"use strict";const t=16209;e.exports=function(e,r){let i,n,s,a,o,l,c,u,h,d,_,f,p,m,g,v,y,b,w,S,E,x,T,M;const R=e.state;i=e.next_in,T=e.input,n=i+(e.avail_in-5),s=e.next_out,M=e.output,a=s-(r-e.avail_out),o=s+(e.avail_out-257),l=R.dmax,c=R.wsize,u=R.whave,h=R.wnext,d=R.window,_=R.hold,f=R.bits,p=R.lencode,m=R.distcode,g=(1<<R.lenbits)-1,v=(1<<R.distbits)-1;e:do{f<15&&(_+=T[i++]<<f,f+=8,_+=T[i++]<<f,f+=8),y=p[_&g];t:for(;;){if(b=y>>>24,_>>>=b,f-=b,b=y>>>16&255,0===b)M[s++]=65535&y;else{if(!(16&b)){if(64&b){if(32&b){R.mode=16191;break e}e.msg="invalid literal/length code",R.mode=t;break e}y=p[(65535&y)+(_&(1<<b)-1)];continue t}for(w=65535&y,b&=15,b&&(f<b&&(_+=T[i++]<<f,f+=8),w+=_&(1<<b)-1,_>>>=b,f-=b),f<15&&(_+=T[i++]<<f,f+=8,_+=T[i++]<<f,f+=8),y=m[_&v];;){if(b=y>>>24,_>>>=b,f-=b,b=y>>>16&255,16&b){if(S=65535&y,b&=15,f<b&&(_+=T[i++]<<f,f+=8,f<b&&(_+=T[i++]<<f,f+=8)),S+=_&(1<<b)-1,S>l){e.msg="invalid distance too far back",R.mode=t;break e}if(_>>>=b,f-=b,b=s-a,S>b){if(b=S-b,b>u&&R.sane){e.msg="invalid distance too far back",R.mode=t;break e}if(E=0,x=d,0===h){if(E+=c-b,b<w){w-=b;do{M[s++]=d[E++]}while(--b);E=s-S,x=M}}else if(h<b){if(E+=c+h-b,b-=h,b<w){w-=b;do{M[s++]=d[E++]}while(--b);if(E=0,h<w){b=h,w-=b;do{M[s++]=d[E++]}while(--b);E=s-S,x=M}}}else if(E+=h-b,b<w){w-=b;do{M[s++]=d[E++]}while(--b);E=s-S,x=M}for(;w>2;)M[s++]=x[E++],M[s++]=x[E++],M[s++]=x[E++],w-=3;w&&(M[s++]=x[E++],w>1&&(M[s++]=x[E++]))}else{E=s-S;do{M[s++]=M[E++],M[s++]=M[E++],M[s++]=M[E++],w-=3}while(w>2);w&&(M[s++]=M[E++],w>1&&(M[s++]=M[E++]))}break}if(64&b){e.msg="invalid distance code",R.mode=t;break e}y=m[(65535&y)+(_&(1<<b)-1)]}}break}}while(i<n&&s<o);w=f>>3,i-=w,f-=w<<3,_&=(1<<f)-1,e.next_in=i,e.next_out=s,e.avail_in=i<n?n-i+5:5-(i-n),e.avail_out=s<o?o-s+257:257-(s-o),R.hold=_,R.bits=f}},1447:(e,t,r)=>{"use strict";const i=r(3269),n=r(4823),s=r(7293),a=r(1998),{Z_FINISH:o,Z_BLOCK:l,Z_TREES:c,Z_OK:u,Z_STREAM_END:h,Z_NEED_DICT:d,Z_STREAM_ERROR:_,Z_DATA_ERROR:f,Z_MEM_ERROR:p,Z_BUF_ERROR:m,Z_DEFLATED:g}=r(9681),v=16180,y=16190,b=16191,w=16192,S=16194,E=16199,x=16200,T=16206,M=16209,R=16210,k=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function A(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const C=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<v||t.mode>16211?1:0},F=e=>{if(C(e))return _;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=v,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,u},P=e=>{if(C(e))return _;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,F(e)},L=(e,t)=>{let r;if(C(e))return _;const i=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?_:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,P(e))},D=(e,t)=>{if(!e)return _;const r=new A;e.state=r,r.strm=e,r.window=null,r.mode=v;const i=L(e,t);return i!==u&&(e.state=null),i};let I,O,U=!0;const N=e=>{if(U){I=new Int32Array(512),O=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,I,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,O,0,e.work,{bits:5}),U=!1}e.lencode=I,e.lenbits=9,e.distcode=O,e.distbits=5},W=(e,t,r,i)=>{let n;const s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(t.subarray(r-s.wsize,r),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(t.subarray(r-i,r-i+n),s.wnext),(i-=n)?(s.window.set(t.subarray(r-i,r),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0};e.exports.inflateReset=P,e.exports.inflateReset2=L,e.exports.inflateResetKeep=F,e.exports.inflateInit=e=>D(e,15),e.exports.inflateInit2=D,e.exports.inflate=(e,t)=>{let r,A,F,P,L,D,I,O,U,B,G,j,V,H,z,Y,q,X,K,Z,Q,J,$=0;const ee=new Uint8Array(4);let te,re;const ie=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(C(e)||!e.output||!e.input&&0!==e.avail_in)return _;r=e.state,r.mode===b&&(r.mode=w),L=e.next_out,F=e.output,I=e.avail_out,P=e.next_in,A=e.input,D=e.avail_in,O=r.hold,U=r.bits,B=D,G=I,J=u;e:for(;;)switch(r.mode){case v:if(0===r.wrap){r.mode=w;break}for(;U<16;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}if(2&r.wrap&&35615===O){0===r.wbits&&(r.wbits=15),r.check=0,ee[0]=255&O,ee[1]=O>>>8&255,r.check=n(r.check,ee,2,0),O=0,U=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&O)<<8)+(O>>8))%31){e.msg="incorrect header check",r.mode=M;break}if((15&O)!==g){e.msg="unknown compression method",r.mode=M;break}if(O>>>=4,U-=4,Q=8+(15&O),0===r.wbits&&(r.wbits=Q),Q>15||Q>r.wbits){e.msg="invalid window size",r.mode=M;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&O?16189:b,O=0,U=0;break;case 16181:for(;U<16;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}if(r.flags=O,(255&r.flags)!==g){e.msg="unknown compression method",r.mode=M;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=M;break}r.head&&(r.head.text=O>>8&1),512&r.flags&&4&r.wrap&&(ee[0]=255&O,ee[1]=O>>>8&255,r.check=n(r.check,ee,2,0)),O=0,U=0,r.mode=16182;case 16182:for(;U<32;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}r.head&&(r.head.time=O),512&r.flags&&4&r.wrap&&(ee[0]=255&O,ee[1]=O>>>8&255,ee[2]=O>>>16&255,ee[3]=O>>>24&255,r.check=n(r.check,ee,4,0)),O=0,U=0,r.mode=16183;case 16183:for(;U<16;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}r.head&&(r.head.xflags=255&O,r.head.os=O>>8),512&r.flags&&4&r.wrap&&(ee[0]=255&O,ee[1]=O>>>8&255,r.check=n(r.check,ee,2,0)),O=0,U=0,r.mode=16184;case 16184:if(1024&r.flags){for(;U<16;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}r.length=O,r.head&&(r.head.extra_len=O),512&r.flags&&4&r.wrap&&(ee[0]=255&O,ee[1]=O>>>8&255,r.check=n(r.check,ee,2,0)),O=0,U=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(j=r.length,j>D&&(j=D),j&&(r.head&&(Q=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(A.subarray(P,P+j),Q)),512&r.flags&&4&r.wrap&&(r.check=n(r.check,A,j,P)),D-=j,P+=j,r.length-=j),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===D)break e;j=0;do{Q=A[P+j++],r.head&&Q&&r.length<65536&&(r.head.name+=String.fromCharCode(Q))}while(Q&&j<D);if(512&r.flags&&4&r.wrap&&(r.check=n(r.check,A,j,P)),D-=j,P+=j,Q)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===D)break e;j=0;do{Q=A[P+j++],r.head&&Q&&r.length<65536&&(r.head.comment+=String.fromCharCode(Q))}while(Q&&j<D);if(512&r.flags&&4&r.wrap&&(r.check=n(r.check,A,j,P)),D-=j,P+=j,Q)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;U<16;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}if(4&r.wrap&&O!==(65535&r.check)){e.msg="header crc mismatch",r.mode=M;break}O=0,U=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=b;break;case 16189:for(;U<32;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}e.adler=r.check=k(O),O=0,U=0,r.mode=y;case y:if(0===r.havedict)return e.next_out=L,e.avail_out=I,e.next_in=P,e.avail_in=D,r.hold=O,r.bits=U,d;e.adler=r.check=1,r.mode=b;case b:if(t===l||t===c)break e;case w:if(r.last){O>>>=7&U,U-=7&U,r.mode=T;break}for(;U<3;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}switch(r.last=1&O,O>>>=1,U-=1,3&O){case 0:r.mode=16193;break;case 1:if(N(r),r.mode=E,t===c){O>>>=2,U-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=M}O>>>=2,U-=2;break;case 16193:for(O>>>=7&U,U-=7&U;U<32;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}if((65535&O)!=(O>>>16^65535)){e.msg="invalid stored block lengths",r.mode=M;break}if(r.length=65535&O,O=0,U=0,r.mode=S,t===c)break e;case S:r.mode=16195;case 16195:if(j=r.length,j){if(j>D&&(j=D),j>I&&(j=I),0===j)break e;F.set(A.subarray(P,P+j),L),D-=j,P+=j,I-=j,L+=j,r.length-=j;break}r.mode=b;break;case 16196:for(;U<14;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}if(r.nlen=257+(31&O),O>>>=5,U-=5,r.ndist=1+(31&O),O>>>=5,U-=5,r.ncode=4+(15&O),O>>>=4,U-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=M;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;U<3;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}r.lens[ie[r.have++]]=7&O,O>>>=3,U-=3}for(;r.have<19;)r.lens[ie[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,te={bits:r.lenbits},J=a(0,r.lens,0,19,r.lencode,0,r.work,te),r.lenbits=te.bits,J){e.msg="invalid code lengths set",r.mode=M;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;$=r.lencode[O&(1<<r.lenbits)-1],z=$>>>24,Y=$>>>16&255,q=65535&$,!(z<=U);){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}if(q<16)O>>>=z,U-=z,r.lens[r.have++]=q;else{if(16===q){for(re=z+2;U<re;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}if(O>>>=z,U-=z,0===r.have){e.msg="invalid bit length repeat",r.mode=M;break}Q=r.lens[r.have-1],j=3+(3&O),O>>>=2,U-=2}else if(17===q){for(re=z+3;U<re;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}O>>>=z,U-=z,Q=0,j=3+(7&O),O>>>=3,U-=3}else{for(re=z+7;U<re;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}O>>>=z,U-=z,Q=0,j=11+(127&O),O>>>=7,U-=7}if(r.have+j>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=M;break}for(;j--;)r.lens[r.have++]=Q}}if(r.mode===M)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=M;break}if(r.lenbits=9,te={bits:r.lenbits},J=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,te),r.lenbits=te.bits,J){e.msg="invalid literal/lengths set",r.mode=M;break}if(r.distbits=6,r.distcode=r.distdyn,te={bits:r.distbits},J=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,te),r.distbits=te.bits,J){e.msg="invalid distances set",r.mode=M;break}if(r.mode=E,t===c)break e;case E:r.mode=x;case x:if(D>=6&&I>=258){e.next_out=L,e.avail_out=I,e.next_in=P,e.avail_in=D,r.hold=O,r.bits=U,s(e,G),L=e.next_out,F=e.output,I=e.avail_out,P=e.next_in,A=e.input,D=e.avail_in,O=r.hold,U=r.bits,r.mode===b&&(r.back=-1);break}for(r.back=0;$=r.lencode[O&(1<<r.lenbits)-1],z=$>>>24,Y=$>>>16&255,q=65535&$,!(z<=U);){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}if(Y&&!(240&Y)){for(X=z,K=Y,Z=q;$=r.lencode[Z+((O&(1<<X+K)-1)>>X)],z=$>>>24,Y=$>>>16&255,q=65535&$,!(X+z<=U);){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}O>>>=X,U-=X,r.back+=X}if(O>>>=z,U-=z,r.back+=z,r.length=q,0===Y){r.mode=16205;break}if(32&Y){r.back=-1,r.mode=b;break}if(64&Y){e.msg="invalid literal/length code",r.mode=M;break}r.extra=15&Y,r.mode=16201;case 16201:if(r.extra){for(re=r.extra;U<re;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}r.length+=O&(1<<r.extra)-1,O>>>=r.extra,U-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;$=r.distcode[O&(1<<r.distbits)-1],z=$>>>24,Y=$>>>16&255,q=65535&$,!(z<=U);){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}if(!(240&Y)){for(X=z,K=Y,Z=q;$=r.distcode[Z+((O&(1<<X+K)-1)>>X)],z=$>>>24,Y=$>>>16&255,q=65535&$,!(X+z<=U);){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}O>>>=X,U-=X,r.back+=X}if(O>>>=z,U-=z,r.back+=z,64&Y){e.msg="invalid distance code",r.mode=M;break}r.offset=q,r.extra=15&Y,r.mode=16203;case 16203:if(r.extra){for(re=r.extra;U<re;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}r.offset+=O&(1<<r.extra)-1,O>>>=r.extra,U-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=M;break}r.mode=16204;case 16204:if(0===I)break e;if(j=G-I,r.offset>j){if(j=r.offset-j,j>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=M;break}j>r.wnext?(j-=r.wnext,V=r.wsize-j):V=r.wnext-j,j>r.length&&(j=r.length),H=r.window}else H=F,V=L-r.offset,j=r.length;j>I&&(j=I),I-=j,r.length-=j;do{F[L++]=H[V++]}while(--j);0===r.length&&(r.mode=x);break;case 16205:if(0===I)break e;F[L++]=r.length,I--,r.mode=x;break;case T:if(r.wrap){for(;U<32;){if(0===D)break e;D--,O|=A[P++]<<U,U+=8}if(G-=I,e.total_out+=G,r.total+=G,4&r.wrap&&G&&(e.adler=r.check=r.flags?n(r.check,F,G,L-G):i(r.check,F,G,L-G)),G=I,4&r.wrap&&(r.flags?O:k(O))!==r.check){e.msg="incorrect data check",r.mode=M;break}O=0,U=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;U<32;){if(0===D)break e;D--,O+=A[P++]<<U,U+=8}if(4&r.wrap&&O!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=M;break}O=0,U=0}r.mode=16208;case 16208:J=h;break e;case M:J=f;break e;case R:return p;default:return _}return e.next_out=L,e.avail_out=I,e.next_in=P,e.avail_in=D,r.hold=O,r.bits=U,(r.wsize||G!==e.avail_out&&r.mode<M&&(r.mode<T||t!==o))&&W(e,e.output,e.next_out,G-e.avail_out)?(r.mode=R,p):(B-=e.avail_in,G-=e.avail_out,e.total_in+=B,e.total_out+=G,r.total+=G,4&r.wrap&&G&&(e.adler=r.check=r.flags?n(r.check,F,G,e.next_out-G):i(r.check,F,G,e.next_out-G)),e.data_type=r.bits+(r.last?64:0)+(r.mode===b?128:0)+(r.mode===E||r.mode===S?256:0),(0===B&&0===G||t===o)&&J===u&&(J=m),J)},e.exports.inflateEnd=e=>{if(C(e))return _;let t=e.state;return t.window&&(t.window=null),e.state=null,u},e.exports.inflateGetHeader=(e,t)=>{if(C(e))return _;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,u):_},e.exports.inflateSetDictionary=(e,t)=>{const r=t.length;let n,s,a;return C(e)?_:(n=e.state,0!==n.wrap&&n.mode!==y?_:n.mode===y&&(s=1,s=i(s,t,r,0),s!==n.check)?f:(a=W(e,t,r,r),a?(n.mode=R,p):(n.havedict=1,u)))},e.exports.inflateInfo="pako inflate (from Nodeca project)"},1998:e=>{"use strict";const t=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),r=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),i=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),n=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);e.exports=(e,s,a,o,l,c,u,h)=>{const d=h.bits;let _,f,p,m,g,v,y=0,b=0,w=0,S=0,E=0,x=0,T=0,M=0,R=0,k=0,A=null;const C=new Uint16Array(16),F=new Uint16Array(16);let P,L,D,I=null;for(y=0;y<=15;y++)C[y]=0;for(b=0;b<o;b++)C[s[a+b]]++;for(E=d,S=15;S>=1&&0===C[S];S--);if(E>S&&(E=S),0===S)return l[c++]=20971520,l[c++]=20971520,h.bits=1,0;for(w=1;w<S&&0===C[w];w++);for(E<w&&(E=w),M=1,y=1;y<=15;y++)if(M<<=1,M-=C[y],M<0)return-1;if(M>0&&(0===e||1!==S))return-1;for(F[1]=0,y=1;y<15;y++)F[y+1]=F[y]+C[y];for(b=0;b<o;b++)0!==s[a+b]&&(u[F[s[a+b]]++]=b);if(0===e?(A=I=u,v=20):1===e?(A=t,I=r,v=257):(A=i,I=n,v=0),k=0,b=0,y=w,g=c,x=E,T=0,p=-1,R=1<<E,m=R-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){P=y-T,u[b]+1<v?(L=0,D=u[b]):u[b]>=v?(L=I[u[b]-v],D=A[u[b]-v]):(L=96,D=0),_=1<<y-T,f=1<<x,w=f;do{f-=_,l[g+(k>>T)+f]=P<<24|L<<16|D}while(0!==f);for(_=1<<y-1;k&_;)_>>=1;if(0!==_?(k&=_-1,k+=_):k=0,b++,0==--C[y]){if(y===S)break;y=s[a+u[b]]}if(y>E&&(k&m)!==p){for(0===T&&(T=E),g+=w,x=y-T,M=1<<x;x+T<S&&(M-=C[x+T],!(M<=0));)x++,M<<=1;if(R+=1<<x,1===e&&R>852||2===e&&R>592)return 1;p=k&m,l[p]=E<<24|x<<16|g-c}}return 0!==k&&(l[g+k]=y-T<<24|64<<16),h.bits=E,0}},4674:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},3665:e=>{"use strict";function t(e){let t=e.length;for(;--t>=0;)e[t]=0}const r=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),i=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),s=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=new Array(576);t(a);const o=new Array(60);t(o);const l=new Array(512);t(l);const c=new Array(256);t(c);const u=new Array(29);t(u);const h=new Array(30);function d(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}let _,f,p;function m(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}t(h);const g=e=>e<256?l[e]:l[256+(e>>>7)],v=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},y=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,v(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},b=(e,t,r)=>{y(e,r[2*t],r[2*t+1])},w=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},S=(e,t,r)=>{const i=new Array(16);let n,s,a=0;for(n=1;n<=15;n++)a=a+r[n-1]<<1,i[n]=a;for(s=0;s<=t;s++){let t=e[2*s+1];0!==t&&(e[2*s]=w(i[t]++,t))}},E=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},x=e=>{e.bi_valid>8?v(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},T=(e,t,r,i)=>{const n=2*t,s=2*r;return e[n]<e[s]||e[n]===e[s]&&i[t]<=i[r]},M=(e,t,r)=>{const i=e.heap[r];let n=r<<1;for(;n<=e.heap_len&&(n<e.heap_len&&T(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!T(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i},R=(e,t,n)=>{let s,a,o,l,d=0;if(0!==e.sym_next)do{s=255&e.pending_buf[e.sym_buf+d++],s+=(255&e.pending_buf[e.sym_buf+d++])<<8,a=e.pending_buf[e.sym_buf+d++],0===s?b(e,a,t):(o=c[a],b(e,o+256+1,t),l=r[o],0!==l&&(a-=u[o],y(e,a,l)),s--,o=g(s),b(e,o,n),l=i[o],0!==l&&(s-=h[o],y(e,s,l)))}while(d<e.sym_next);b(e,256,t)},k=(e,t)=>{const r=t.dyn_tree,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,o,l,c=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<s;a++)0!==r[2*a]?(e.heap[++e.heap_len]=c=a,e.depth[a]=0):r[2*a+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,r[2*l]=1,e.depth[l]=0,e.opt_len--,n&&(e.static_len-=i[2*l+1]);for(t.max_code=c,a=e.heap_len>>1;a>=1;a--)M(e,r,a);l=s;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],M(e,r,1),o=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=o,r[2*l]=r[2*a]+r[2*o],e.depth[l]=(e.depth[a]>=e.depth[o]?e.depth[a]:e.depth[o])+1,r[2*a+1]=r[2*o+1]=l,e.heap[1]=l++,M(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,i=t.max_code,n=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length;let c,u,h,d,_,f,p=0;for(d=0;d<=15;d++)e.bl_count[d]=0;for(r[2*e.heap[e.heap_max]+1]=0,c=e.heap_max+1;c<573;c++)u=e.heap[c],d=r[2*r[2*u+1]+1]+1,d>l&&(d=l,p++),r[2*u+1]=d,u>i||(e.bl_count[d]++,_=0,u>=o&&(_=a[u-o]),f=r[2*u],e.opt_len+=f*(d+_),s&&(e.static_len+=f*(n[2*u+1]+_)));if(0!==p){do{for(d=l-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[l]--,p-=2}while(p>0);for(d=l;0!==d;d--)for(u=e.bl_count[d];0!==u;)h=e.heap[--c],h>i||(r[2*h+1]!==d&&(e.opt_len+=(d-r[2*h+1])*r[2*h],r[2*h+1]=d),u--)}})(e,t),S(r,c,e.bl_count)},A=(e,t,r)=>{let i,n,s=-1,a=t[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),t[2*(r+1)+1]=65535,i=0;i<=r;i++)n=a,a=t[2*(i+1)+1],++o<l&&n===a||(o<c?e.bl_tree[2*n]+=o:0!==n?(n!==s&&e.bl_tree[2*n]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,s=n,0===a?(l=138,c=3):n===a?(l=6,c=3):(l=7,c=4))},C=(e,t,r)=>{let i,n,s=-1,a=t[1],o=0,l=7,c=4;for(0===a&&(l=138,c=3),i=0;i<=r;i++)if(n=a,a=t[2*(i+1)+1],!(++o<l&&n===a)){if(o<c)do{b(e,n,e.bl_tree)}while(0!=--o);else 0!==n?(n!==s&&(b(e,n,e.bl_tree),o--),b(e,16,e.bl_tree),y(e,o-3,2)):o<=10?(b(e,17,e.bl_tree),y(e,o-3,3)):(b(e,18,e.bl_tree),y(e,o-11,7));o=0,s=n,0===a?(l=138,c=3):n===a?(l=6,c=3):(l=7,c=4)}};let F=!1;const P=(e,t,r,i)=>{y(e,0+(i?1:0),3),x(e),v(e,r),v(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};e.exports._tr_init=e=>{F||((()=>{let e,t,s,m,g;const v=new Array(16);for(s=0,m=0;m<28;m++)for(u[m]=s,e=0;e<1<<r[m];e++)c[s++]=m;for(c[s-1]=m,g=0,m=0;m<16;m++)for(h[m]=g,e=0;e<1<<i[m];e++)l[g++]=m;for(g>>=7;m<30;m++)for(h[m]=g<<7,e=0;e<1<<i[m]-7;e++)l[256+g++]=m;for(t=0;t<=15;t++)v[t]=0;for(e=0;e<=143;)a[2*e+1]=8,e++,v[8]++;for(;e<=255;)a[2*e+1]=9,e++,v[9]++;for(;e<=279;)a[2*e+1]=7,e++,v[7]++;for(;e<=287;)a[2*e+1]=8,e++,v[8]++;for(S(a,287,v),e=0;e<30;e++)o[2*e+1]=5,o[2*e]=w(e,5);_=new d(a,r,257,286,15),f=new d(o,i,0,30,15),p=new d(new Array(0),n,0,19,7)})(),F=!0),e.l_desc=new m(e.dyn_ltree,_),e.d_desc=new m(e.dyn_dtree,f),e.bl_desc=new m(e.bl_tree,p),e.bi_buf=0,e.bi_valid=0,E(e)},e.exports._tr_stored_block=P,e.exports._tr_flush_block=(e,t,r,i)=>{let n,l,c=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),k(e,e.l_desc),k(e,e.d_desc),c=(e=>{let t;for(A(e,e.dyn_ltree,e.l_desc.max_code),A(e,e.dyn_dtree,e.d_desc.max_code),k(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*s[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),n=e.opt_len+3+7>>>3,l=e.static_len+3+7>>>3,l<=n&&(n=l)):n=l=r+5,r+4<=n&&-1!==t?P(e,t,r,i):4===e.strategy||l===n?(y(e,2+(i?1:0),3),R(e,a,o)):(y(e,4+(i?1:0),3),((e,t,r,i)=>{let n;for(y(e,t-257,5),y(e,r-1,5),y(e,i-4,4),n=0;n<i;n++)y(e,e.bl_tree[2*s[n]+1],3);C(e,e.dyn_ltree,t-1),C(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),R(e,e.dyn_ltree,e.dyn_dtree)),E(e),i&&x(e)},e.exports._tr_tally=(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(c[r]+256+1)]++,e.dyn_dtree[2*g(t)]++),e.sym_next===e.sym_end),e.exports._tr_align=e=>{y(e,2,3),b(e,256,a),(e=>{16===e.bi_valid?(v(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}},4442:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},1265:(e,t,r)=>{e.exports=r(4598)},7201:(e,t,r)=>{e.exports=r(3042)},1829:(e,t,r)=>{"use strict";var i=r(2222);e.exports=i},6040:(e,t,r)=>{"use strict";var i=r(8251);e.exports=i},7264:(e,t,r)=>{"use strict";var i=r(4139);r(768),r(8549),r(7152),r(1372),e.exports=i},9692:(e,t,r)=>{"use strict";var i=r(7045);e.exports=i},5663:(e,t,r)=>{"use strict";var i=r(70);e.exports=i},6823:(e,t,r)=>{"use strict";var i=r(8280),n=r(2017),s=String.prototype;e.exports=function(e){var t=e.replaceAll;return"string"==typeof e||e===s||i(s,e)&&t===s.replaceAll?n:t}},1042:(e,t,r)=>{"use strict";var i=r(8280),n=r(7511),s=String.prototype;e.exports=function(e){var t=e.trim;return"string"==typeof e||e===s||i(s,e)&&t===s.trim?n:t}},1926:(e,t,r)=>{"use strict";r(6750);var i=r(2046).Object,n=e.exports=function(e,t,r){return i.defineProperty(e,t,r)};i.defineProperty.sham&&(n.sham=!0)},2017:(e,t,r)=>{"use strict";r(1398),r(1995),r(929);var i=r(1747);e.exports=i("String","replaceAll")},7511:(e,t,r)=>{"use strict";r(727);var i=r(1747);e.exports=i("String","trim")},3842:(e,t,r)=>{"use strict";r(8545),r(3643),r(4452),r(3997),r(5084),r(2596),r(5721),r(4954),r(4123),r(3377),r(2230),r(5344),r(1660),r(4610),r(3669),r(4810),r(3325),r(7024),r(8172),r(5205);var i=r(2046);e.exports=i.Symbol},1730:(e,t,r)=>{"use strict";r(9363),r(3643),r(7057),r(4954);var i=r(560);e.exports=i.f("iterator")},1661:(e,t,r)=>{"use strict";r(8537),r(3669);var i=r(560);e.exports=i.f("toPrimitive")},3042:(e,t,r)=>{"use strict";e.exports=r(9604)},9604:(e,t,r)=>{"use strict";r(6038);var i=r(1829);e.exports=i},4997:(e,t,r)=>{"use strict";var i=r(6040);e.exports=i},2321:(e,t,r)=>{"use strict";var i=r(7264);r(3939),r(1785),r(1697),r(4664),r(3422),r(36),r(8703),r(6878),r(9671),r(359),e.exports=i},2231:(e,t,r)=>{"use strict";var i=r(9692);e.exports=i},9280:(e,t,r)=>{"use strict";var i=r(5663);e.exports=i},2159:(e,t,r)=>{"use strict";var i=r(2250),n=r(4640),s=TypeError;e.exports=function(e){if(i(e))return e;throw new s(n(e)+" is not a function")}},43:(e,t,r)=>{"use strict";var i=r(4018),n=String,s=TypeError;e.exports=function(e){if(i(e))return e;throw new s("Can't set "+n(e)+" as a prototype")}},2156:e=>{"use strict";e.exports=function(){}},6624:(e,t,r)=>{"use strict";var i=r(6285),n=String,s=TypeError;e.exports=function(e){if(i(e))return e;throw new s(n(e)+" is not an object")}},4436:(e,t,r)=>{"use strict";var i=r(7374),n=r(4849),s=r(575),a=function(e){return function(t,r,a){var o=i(t),l=s(o);if(0===l)return!e&&-1;var c,u=n(a,l);if(e&&r!=r){for(;l>u;)if((c=o[u++])!=c)return!0}else for(;l>u;u++)if((e||u in o)&&o[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},726:(e,t,r)=>{"use strict";var i=r(8311),n=r(1907),s=r(6946),a=r(9298),o=r(575),l=r(6968),c=n([].push),u=function(e){var t=1===e,r=2===e,n=3===e,u=4===e,h=6===e,d=7===e,_=5===e||h;return function(f,p,m,g){for(var v,y,b=a(f),w=s(b),S=o(w),E=i(p,m),x=0,T=g||l,M=t?T(f,S):r||d?T(f,0):void 0;S>x;x++)if((_||x in w)&&(y=E(v=w[x],x,b),e))if(t)M[x]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return x;case 2:c(M,v)}else switch(e){case 4:return!1;case 7:c(M,v)}return h?-1:n||u?u:M}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},7171:(e,t,r)=>{"use strict";var i=r(8828),n=r(6264),s=r(798),a=n("species");e.exports=function(e){return s>=51||!i((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},3427:(e,t,r)=>{"use strict";var i=r(1907);e.exports=i([].slice)},4010:(e,t,r)=>{"use strict";var i=r(1793),n=r(5468),s=r(6285),a=r(6264)("species"),o=Array;e.exports=function(e){var t;return i(e)&&(t=e.constructor,(n(t)&&(t===o||i(t.prototype))||s(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?o:t}},6968:(e,t,r)=>{"use strict";var i=r(4010);e.exports=function(e,t){return new(i(e))(0===t?0:t)}},5807:(e,t,r)=>{"use strict";var i=r(1907),n=i({}.toString),s=i("".slice);e.exports=function(e){return s(n(e),8,-1)}},3948:(e,t,r)=>{"use strict";var i=r(2623),n=r(2250),s=r(5807),a=r(6264)("toStringTag"),o=Object,l="Arguments"===s(function(){return arguments}());e.exports=i?s:function(e){var t,r,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=o(e),a))?r:l?s(t):"Object"===(i=s(t))&&n(t.callee)?"Arguments":i}},7382:(e,t,r)=>{"use strict";var i=r(8828);e.exports=!i((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},9550:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},1626:(e,t,r)=>{"use strict";var i=r(9447),n=r(4284),s=r(5817);e.exports=i?function(e,t,r){return n.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},5817:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},5543:(e,t,r)=>{"use strict";var i=r(9447),n=r(4284),s=r(5817);e.exports=function(e,t,r){i?n.f(e,t,s(0,r)):e[t]=r}},9251:(e,t,r)=>{"use strict";var i=r(4284);e.exports=function(e,t,r){return i.f(e,t,r)}},8055:(e,t,r)=>{"use strict";var i=r(1626);e.exports=function(e,t,r,n){return n&&n.enumerable?e[t]=r:i(e,t,r),e}},2532:(e,t,r)=>{"use strict";var i=r(5951),n=Object.defineProperty;e.exports=function(e,t){try{n(i,e,{value:t,configurable:!0,writable:!0})}catch(r){i[e]=t}return t}},9447:(e,t,r)=>{"use strict";var i=r(8828);e.exports=!i((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},9552:(e,t,r)=>{"use strict";var i=r(5951),n=r(6285),s=i.document,a=n(s)&&n(s.createElement);e.exports=function(e){return a?s.createElement(e):{}}},8024:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},9287:e=>{"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},376:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6794:(e,t,r)=>{"use strict";var i=r(5951).navigator,n=i&&i.userAgent;e.exports=n?String(n):""},798:(e,t,r)=>{"use strict";var i,n,s=r(5951),a=r(6794),o=s.process,l=s.Deno,c=o&&o.versions||l&&l.version,u=c&&c.v8;u&&(n=(i=u.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!n&&a&&(!(i=a.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=a.match(/Chrome\/(\d+)/))&&(n=+i[1]),e.exports=n},1091:(e,t,r)=>{"use strict";var i=r(5951),n=r(6024),s=r(2361),a=r(2250),o=r(3846).f,l=r(7463),c=r(2046),u=r(8311),h=r(1626),d=r(9724);r(6128);var _=function(e){var t=function(r,i,s){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,i)}return new e(r,i,s)}return n(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var r,n,f,p,m,g,v,y,b,w=e.target,S=e.global,E=e.stat,x=e.proto,T=S?i:E?i[w]:i[w]&&i[w].prototype,M=S?c:c[w]||h(c,w,{})[w],R=M.prototype;for(p in t)n=!(r=l(S?p:w+(E?".":"#")+p,e.forced))&&T&&d(T,p),g=M[p],n&&(v=e.dontCallGetSet?(b=o(T,p))&&b.value:T[p]),m=n&&v?v:t[p],(r||x||typeof g!=typeof m)&&(y=e.bind&&n?u(m,i):e.wrap&&n?_(m):x&&a(m)?s(m):m,(e.sham||m&&m.sham||g&&g.sham)&&h(y,"sham",!0),h(M,p,y),x&&(d(c,f=w+"Prototype")||h(c,f,{}),h(c[f],p,m),e.real&&R&&(r||!R[p])&&h(R,p,m)))}},8828:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},6024:(e,t,r)=>{"use strict";var i=r(1505),n=Function.prototype,s=n.apply,a=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(i?a.bind(s):function(){return a.apply(s,arguments)})},8311:(e,t,r)=>{"use strict";var i=r(2361),n=r(2159),s=r(1505),a=i(i.bind);e.exports=function(e,t){return n(e),void 0===t?e:s?a(e,t):function(){return e.apply(t,arguments)}}},1505:(e,t,r)=>{"use strict";var i=r(8828);e.exports=!i((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},3930:(e,t,r)=>{"use strict";var i=r(1505),n=Function.prototype.call;e.exports=i?n.bind(n):function(){return n.apply(n,arguments)}},6833:(e,t,r)=>{"use strict";var i=r(9447),n=r(9724),s=Function.prototype,a=i&&Object.getOwnPropertyDescriptor,o=n(s,"name"),l=o&&"something"===function(){}.name,c=o&&(!i||i&&a(s,"name").configurable);e.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},1871:(e,t,r)=>{"use strict";var i=r(1907),n=r(2159);e.exports=function(e,t,r){try{return i(n(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},2361:(e,t,r)=>{"use strict";var i=r(5807),n=r(1907);e.exports=function(e){if("Function"===i(e))return n(e)}},1907:(e,t,r)=>{"use strict";var i=r(1505),n=Function.prototype,s=n.call,a=i&&n.bind.bind(s,s);e.exports=i?a:function(e){return function(){return s.apply(e,arguments)}}},1747:(e,t,r)=>{"use strict";var i=r(5951),n=r(2046);e.exports=function(e,t){var r=n[e+"Prototype"],s=r&&r[t];if(s)return s;var a=i[e],o=a&&a.prototype;return o&&o[t]}},5582:(e,t,r)=>{"use strict";var i=r(2046),n=r(5951),s=r(2250),a=function(e){return s(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?a(i[e])||a(n[e]):i[e]&&i[e][t]||n[e]&&n[e][t]}},6656:(e,t,r)=>{"use strict";var i=r(1907),n=r(1793),s=r(2250),a=r(5807),o=r(160),l=i([].push);e.exports=function(e){if(s(e))return e;if(n(e)){for(var t=e.length,r=[],i=0;i<t;i++){var c=e[i];"string"==typeof c?l(r,c):"number"!=typeof c&&"Number"!==a(c)&&"String"!==a(c)||l(r,o(c))}var u=r.length,h=!0;return function(e,t){if(h)return h=!1,t;if(n(this))return t;for(var i=0;i<u;i++)if(r[i]===e)return t}}}},9367:(e,t,r)=>{"use strict";var i=r(2159),n=r(7136);e.exports=function(e,t){var r=e[t];return n(r)?void 0:i(r)}},7703:(e,t,r)=>{"use strict";var i=r(1907),n=r(9298),s=Math.floor,a=i("".charAt),o=i("".replace),l=i("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,i,h,d){var _=r+e.length,f=i.length,p=u;return void 0!==h&&(h=n(h),p=c),o(d,p,(function(n,o){var c;switch(a(o,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,r);case"'":return l(t,_);case"<":c=h[l(o,1,-1)];break;default:var u=+o;if(0===u)return n;if(u>f){var d=s(u/10);return 0===d?n:d<=f?void 0===i[d-1]?a(o,1):i[d-1]+a(o,1):n}c=i[u-1]}return void 0===c?"":c}))}},5951:function(e,t,r){"use strict";var i=function(e){return e&&e.Math===Math&&e};e.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r.g&&r.g)||i("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9724:(e,t,r)=>{"use strict";var i=r(1907),n=r(9298),s=i({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(n(e),t)}},8530:e=>{"use strict";e.exports={}},2416:(e,t,r)=>{"use strict";var i=r(5582);e.exports=i("document","documentElement")},3648:(e,t,r)=>{"use strict";var i=r(9447),n=r(8828),s=r(9552);e.exports=!i&&!n((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},6946:(e,t,r)=>{"use strict";var i=r(1907),n=r(8828),s=r(5807),a=Object,o=i("".split);e.exports=n((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===s(e)?o(e,""):a(e)}:a},2647:(e,t,r)=>{"use strict";var i=r(1907),n=r(2250),s=r(6128),a=i(Function.toString);n(s.inspectSource)||(s.inspectSource=function(e){return a(e)}),e.exports=s.inspectSource},4932:(e,t,r)=>{"use strict";var i,n,s,a=r(551),o=r(5951),l=r(6285),c=r(1626),u=r(9724),h=r(6128),d=r(2522),_=r(8530),f="Object already initialized",p=o.TypeError,m=o.WeakMap;if(a||h.state){var g=h.state||(h.state=new m);g.get=g.get,g.has=g.has,g.set=g.set,i=function(e,t){if(g.has(e))throw new p(f);return t.facade=e,g.set(e,t),t},n=function(e){return g.get(e)||{}},s=function(e){return g.has(e)}}else{var v=d("state");_[v]=!0,i=function(e,t){if(u(e,v))throw new p(f);return t.facade=e,c(e,v,t),t},n=function(e){return u(e,v)?e[v]:{}},s=function(e){return u(e,v)}}e.exports={set:i,get:n,has:s,enforce:function(e){return s(e)?n(e):i(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=n(t)).type!==e)throw new p("Incompatible receiver, "+e+" required");return r}}}},1793:(e,t,r)=>{"use strict";var i=r(5807);e.exports=Array.isArray||function(e){return"Array"===i(e)}},2250:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},5468:(e,t,r)=>{"use strict";var i=r(1907),n=r(8828),s=r(2250),a=r(3948),o=r(5582),l=r(2647),c=function(){},u=o("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=i(h.exec),_=!h.test(c),f=function(e){if(!s(e))return!1;try{return u(c,[],e),!0}catch(e){return!1}},p=function(e){if(!s(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _||!!d(h,l(e))}catch(e){return!0}};p.sham=!0,e.exports=!u||n((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?p:f},7463:(e,t,r)=>{"use strict";var i=r(8828),n=r(2250),s=/#|\.prototype\./,a=function(e,t){var r=l[o(e)];return r===u||r!==c&&(n(t)?i(t):!!t)},o=a.normalize=function(e){return String(e).replace(s,".").toLowerCase()},l=a.data={},c=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},7136:e=>{"use strict";e.exports=function(e){return null==e}},6285:(e,t,r)=>{"use strict";var i=r(2250);e.exports=function(e){return"object"==typeof e?null!==e:i(e)}},4018:(e,t,r)=>{"use strict";var i=r(6285);e.exports=function(e){return i(e)||null===e}},7376:e=>{"use strict";e.exports=!0},2087:(e,t,r)=>{"use strict";var i=r(6285),n=r(5807),s=r(6264)("match");e.exports=function(e){var t;return i(e)&&(void 0!==(t=e[s])?!!t:"RegExp"===n(e))}},5594:(e,t,r)=>{"use strict";var i=r(5582),n=r(2250),s=r(8280),a=r(1175),o=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=i("Symbol");return n(t)&&s(t.prototype,o(e))}},7181:(e,t,r)=>{"use strict";var i=r(5116).IteratorPrototype,n=r(8075),s=r(5817),a=r(4840),o=r(3742),l=function(){return this};e.exports=function(e,t,r,c){var u=t+" Iterator";return e.prototype=n(i,{next:s(+!c,r)}),a(e,u,!1,!0),o[u]=l,e}},183:(e,t,r)=>{"use strict";var i=r(1091),n=r(3930),s=r(7376),a=r(6833),o=r(2250),l=r(7181),c=r(5972),u=r(9192),h=r(4840),d=r(1626),_=r(8055),f=r(6264),p=r(3742),m=r(5116),g=a.PROPER,v=a.CONFIGURABLE,y=m.IteratorPrototype,b=m.BUGGY_SAFARI_ITERATORS,w=f("iterator"),S="keys",E="values",x="entries",T=function(){return this};e.exports=function(e,t,r,a,f,m,M){l(r,t,a);var R,k,A,C=function(e){if(e===f&&I)return I;if(!b&&e&&e in L)return L[e];switch(e){case S:case E:case x:return function(){return new r(this,e)}}return function(){return new r(this)}},F=t+" Iterator",P=!1,L=e.prototype,D=L[w]||L["@@iterator"]||f&&L[f],I=!b&&D||C(f),O="Array"===t&&L.entries||D;if(O&&(R=c(O.call(new e)))!==Object.prototype&&R.next&&(s||c(R)===y||(u?u(R,y):o(R[w])||_(R,w,T)),h(R,F,!0,!0),s&&(p[F]=T)),g&&f===E&&D&&D.name!==E&&(!s&&v?d(L,"name",E):(P=!0,I=function(){return n(D,this)})),f)if(k={values:C(E),keys:m?I:C(S),entries:C(x)},M)for(A in k)(b||P||!(A in L))&&_(L,A,k[A]);else i({target:t,proto:!0,forced:b||P},k);return s&&!M||L[w]===I||_(L,w,I,{name:f}),p[t]=I,k}},5116:(e,t,r)=>{"use strict";var i,n,s,a=r(8828),o=r(2250),l=r(6285),c=r(8075),u=r(5972),h=r(8055),d=r(6264),_=r(7376),f=d("iterator"),p=!1;[].keys&&("next"in(s=[].keys())?(n=u(u(s)))!==Object.prototype&&(i=n):p=!0),!l(i)||a((function(){var e={};return i[f].call(e)!==e}))?i={}:_&&(i=c(i)),o(i[f])||h(i,f,(function(){return this})),e.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:p}},3742:e=>{"use strict";e.exports={}},575:(e,t,r)=>{"use strict";var i=r(3121);e.exports=function(e){return i(e.length)}},1176:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var i=+e;return(i>0?r:t)(i)}},8075:(e,t,r)=>{"use strict";var i,n=r(6624),s=r(2220),a=r(376),o=r(8530),l=r(2416),c=r(9552),u=r(2522),h="prototype",d="script",_=u("IE_PROTO"),f=function(){},p=function(e){return"<"+d+">"+e+"</"+d+">"},m=function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{i=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;g="undefined"!=typeof document?document.domain&&i?m(i):(t=c("iframe"),r="java"+d+":",t.style.display="none",l.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F):m(i);for(var n=a.length;n--;)delete g[h][a[n]];return g()};o[_]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[h]=n(e),r=new f,f[h]=null,r[_]=e):r=g(),void 0===t?r:s.f(r,t)}},2220:(e,t,r)=>{"use strict";var i=r(9447),n=r(8661),s=r(4284),a=r(6624),o=r(7374),l=r(2875);t.f=i&&!n?Object.defineProperties:function(e,t){a(e);for(var r,i=o(t),n=l(t),c=n.length,u=0;c>u;)s.f(e,r=n[u++],i[r]);return e}},4284:(e,t,r)=>{"use strict";var i=r(9447),n=r(3648),s=r(8661),a=r(6624),o=r(470),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",_="writable";t.f=i?s?function(e,t,r){if(a(e),t=o(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&_ in r&&!r[_]){var i=u(e,t);i&&i[_]&&(e[t]=r.value,r={configurable:d in r?r[d]:i[d],enumerable:h in r?r[h]:i[h],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(a(e),t=o(t),a(r),n)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},3846:(e,t,r)=>{"use strict";var i=r(9447),n=r(3930),s=r(2574),a=r(5817),o=r(7374),l=r(470),c=r(9724),u=r(3648),h=Object.getOwnPropertyDescriptor;t.f=i?h:function(e,t){if(e=o(e),t=l(t),u)try{return h(e,t)}catch(e){}if(c(e,t))return a(!n(s.f,e,t),e[t])}},5407:(e,t,r)=>{"use strict";var i=r(5807),n=r(7374),s=r(4443).f,a=r(3427),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"Window"===i(e)?function(e){try{return s(e)}catch(e){return a(o)}}(e):s(n(e))}},4443:(e,t,r)=>{"use strict";var i=r(3045),n=r(376).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,n)}},7170:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},5972:(e,t,r)=>{"use strict";var i=r(9724),n=r(2250),s=r(9298),a=r(2522),o=r(7382),l=a("IE_PROTO"),c=Object,u=c.prototype;e.exports=o?c.getPrototypeOf:function(e){var t=s(e);if(i(t,l))return t[l];var r=t.constructor;return n(r)&&t instanceof r?r.prototype:t instanceof c?u:null}},8280:(e,t,r)=>{"use strict";var i=r(1907);e.exports=i({}.isPrototypeOf)},3045:(e,t,r)=>{"use strict";var i=r(1907),n=r(9724),s=r(7374),a=r(4436).indexOf,o=r(8530),l=i([].push);e.exports=function(e,t){var r,i=s(e),c=0,u=[];for(r in i)!n(o,r)&&n(i,r)&&l(u,r);for(;t.length>c;)n(i,r=t[c++])&&(~a(u,r)||l(u,r));return u}},2875:(e,t,r)=>{"use strict";var i=r(3045),n=r(376);e.exports=Object.keys||function(e){return i(e,n)}},2574:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,n=i&&!r.call({1:2},1);t.f=n?function(e){var t=i(this,e);return!!t&&t.enumerable}:r},9192:(e,t,r)=>{"use strict";var i=r(1871),n=r(6285),s=r(4239),a=r(43);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=i(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,i){return s(r),a(i),n(r)?(t?e(r,i):r.__proto__=i,r):r}}():void 0)},4878:(e,t,r)=>{"use strict";var i=r(2623),n=r(3948);e.exports=i?{}.toString:function(){return"[object "+n(this)+"]"}},581:(e,t,r)=>{"use strict";var i=r(3930),n=r(2250),s=r(6285),a=TypeError;e.exports=function(e,t){var r,o;if("string"===t&&n(r=e.toString)&&!s(o=i(r,e)))return o;if(n(r=e.valueOf)&&!s(o=i(r,e)))return o;if("string"!==t&&n(r=e.toString)&&!s(o=i(r,e)))return o;throw new a("Can't convert object to primitive value")}},2046:e=>{"use strict";e.exports={}},5606:(e,t,r)=>{"use strict";var i=r(6624);e.exports=function(){var e=i(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},663:(e,t,r)=>{"use strict";var i=r(3930),n=r(9724),s=r(8280),a=r(5606),o=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in o||n(e,"flags")||!s(o,e)?t:i(a,e)}},4239:(e,t,r)=>{"use strict";var i=r(7136),n=TypeError;e.exports=function(e){if(i(e))throw new n("Can't call method on "+e);return e}},4840:(e,t,r)=>{"use strict";var i=r(2623),n=r(4284).f,s=r(1626),a=r(9724),o=r(4878),l=r(6264)("toStringTag");e.exports=function(e,t,r,c){var u=r?e:e&&e.prototype;u&&(a(u,l)||n(u,l,{configurable:!0,value:t}),c&&!i&&s(u,"toString",o))}},2522:(e,t,r)=>{"use strict";var i=r(5816),n=r(6499),s=i("keys");e.exports=function(e){return s[e]||(s[e]=n(e))}},6128:(e,t,r)=>{"use strict";var i=r(7376),n=r(5951),s=r(2532),a="__core-js_shared__",o=e.exports=n[a]||s(a,{});(o.versions||(o.versions=[])).push({version:"3.39.0",mode:i?"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:(e,t,r)=>{"use strict";var i=r(6128);e.exports=function(e,t){return i[e]||(i[e]=t||{})}},1470:(e,t,r)=>{"use strict";var i=r(1907),n=r(5482),s=r(160),a=r(4239),o=i("".charAt),l=i("".charCodeAt),c=i("".slice),u=function(e){return function(t,r){var i,u,h=s(a(t)),d=n(r),_=h.length;return d<0||d>=_?e?"":void 0:(i=l(h,d))<55296||i>56319||d+1===_||(u=l(h,d+1))<56320||u>57343?e?o(h,d):i:e?c(h,d,d+2):u-56320+(i-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},5819:(e,t,r)=>{"use strict";var i=r(6833).PROPER,n=r(8828),s=r(6395);e.exports=function(e){return n((function(){return!!s[e]()||"
"!=="
"[e]()||i&&s[e].name!==e}))}},5993:(e,t,r)=>{"use strict";var i=r(1907),n=r(4239),s=r(160),a=r(6395),o=i("".replace),l=RegExp("^["+a+"]+"),c=RegExp("(^|[^"+a+"])["+a+"]+$"),u=function(e){return function(t){var r=s(n(t));return 1&e&&(r=o(r,l,"")),2&e&&(r=o(r,c,"$1")),r}};e.exports={start:u(1),end:u(2),trim:u(3)}},9846:(e,t,r)=>{"use strict";var i=r(798),n=r(8828),s=r(5951).String;e.exports=!!Object.getOwnPropertySymbols&&!n((function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},3467:(e,t,r)=>{"use strict";var i=r(3930),n=r(5582),s=r(6264),a=r(8055);e.exports=function(){var e=n("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,o=s("toPrimitive");t&&!t[o]&&a(t,o,(function(e){return i(r,this)}),{arity:1})}},2595:(e,t,r)=>{"use strict";var i=r(5582),n=r(1907),s=i("Symbol"),a=s.keyFor,o=n(s.prototype.valueOf);e.exports=s.isRegisteredSymbol||function(e){try{return void 0!==a(o(e))}catch(e){return!1}}},9197:(e,t,r)=>{"use strict";for(var i=r(5816),n=r(5582),s=r(1907),a=r(5594),o=r(6264),l=n("Symbol"),c=l.isWellKnownSymbol,u=n("Object","getOwnPropertyNames"),h=s(l.prototype.valueOf),d=i("wks"),_=0,f=u(l),p=f.length;_<p;_++)try{var m=f[_];a(l[m])&&o(m)}catch(e){}e.exports=function(e){if(c&&c(e))return!0;try{for(var t=h(e),r=0,i=u(d),n=i.length;r<n;r++)if(d[i[r]]==t)return!0}catch(e){}return!1}},4411:(e,t,r)=>{"use strict";var i=r(9846);e.exports=i&&!!Symbol.for&&!!Symbol.keyFor},4849:(e,t,r)=>{"use strict";var i=r(5482),n=Math.max,s=Math.min;e.exports=function(e,t){var r=i(e);return r<0?n(r+t,0):s(r,t)}},7374:(e,t,r)=>{"use strict";var i=r(6946),n=r(4239);e.exports=function(e){return i(n(e))}},5482:(e,t,r)=>{"use strict";var i=r(1176);e.exports=function(e){var t=+e;return t!=t||0===t?0:i(t)}},3121:(e,t,r)=>{"use strict";var i=r(5482),n=Math.min;e.exports=function(e){var t=i(e);return t>0?n(t,9007199254740991):0}},9298:(e,t,r)=>{"use strict";var i=r(4239),n=Object;e.exports=function(e){return n(i(e))}},6028:(e,t,r)=>{"use strict";var i=r(3930),n=r(6285),s=r(5594),a=r(9367),o=r(581),l=r(6264),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!n(e)||s(e))return e;var r,l=a(e,u);if(l){if(void 0===t&&(t="default"),r=i(l,e,t),!n(r)||s(r))return r;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),o(e,t)}},470:(e,t,r)=>{"use strict";var i=r(6028),n=r(5594);e.exports=function(e){var t=i(e,"string");return n(t)?t:t+""}},2623:(e,t,r)=>{"use strict";var i={};i[r(6264)("toStringTag")]="z",e.exports="[object z]"===String(i)},160:(e,t,r)=>{"use strict";var i=r(3948),n=String;e.exports=function(e){if("Symbol"===i(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}},4640:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6499:(e,t,r)=>{"use strict";var i=r(1907),n=0,s=Math.random(),a=i(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++n+s,36)}},1175:(e,t,r)=>{"use strict";var i=r(9846);e.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8661:(e,t,r)=>{"use strict";var i=r(9447),n=r(8828);e.exports=i&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},551:(e,t,r)=>{"use strict";var i=r(5951),n=r(2250),s=i.WeakMap;e.exports=n(s)&&/native code/.test(String(s))},366:(e,t,r)=>{"use strict";var i=r(2046),n=r(9724),s=r(560),a=r(4284).f;e.exports=function(e){var t=i.Symbol||(i.Symbol={});n(t,e)||a(t,e,{value:s.f(e)})}},560:(e,t,r)=>{"use strict";var i=r(6264);t.f=i},6264:(e,t,r)=>{"use strict";var i=r(5951),n=r(5816),s=r(9724),a=r(6499),o=r(9846),l=r(1175),c=i.Symbol,u=n("wks"),h=l?c.for||c:c&&c.withoutSetter||a;e.exports=function(e){return s(u,e)||(u[e]=o&&s(c,e)?c[e]:h("Symbol."+e)),u[e]}},6395:e=>{"use strict";e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},8545:(e,t,r)=>{"use strict";var i=r(1091),n=r(8828),s=r(1793),a=r(6285),o=r(9298),l=r(575),c=r(8024),u=r(5543),h=r(6968),d=r(7171),_=r(6264),f=r(798),p=_("isConcatSpreadable"),m=f>=51||!n((function(){var e=[];return e[p]=!1,e.concat()[0]!==e})),g=function(e){if(!a(e))return!1;var t=e[p];return void 0!==t?!!t:s(e)};i({target:"Array",proto:!0,arity:1,forced:!m||!d("concat")},{concat:function(e){var t,r,i,n,s,a=o(this),d=h(a,0),_=0;for(t=-1,i=arguments.length;t<i;t++)if(g(s=-1===t?a:arguments[t]))for(n=l(s),c(_+n),r=0;r<n;r++,_++)r in s&&u(d,_,s[r]);else c(_+1),u(d,_++,s);return d.length=_,d}})},9363:(e,t,r)=>{"use strict";var i=r(7374),n=r(2156),s=r(3742),a=r(4932),o=r(4284).f,l=r(183),c=r(9550),u=r(7376),h=r(9447),d="Array Iterator",_=a.set,f=a.getterFor(d);e.exports=l(Array,"Array",(function(e,t){_(this,{type:d,target:i(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case"keys":return c(r,!1);case"values":return c(t[r],!1)}return c([r,t[r]],!1)}),"values");var p=s.Arguments=s.Array;if(n("keys"),n("values"),n("entries"),!u&&h&&"values"!==p.name)try{o(p,"name",{value:"values"})}catch(e){}},8537:()=>{},9721:(e,t,r)=>{"use strict";var i=r(1091),n=r(5582),s=r(6024),a=r(3930),o=r(1907),l=r(8828),c=r(2250),u=r(5594),h=r(3427),d=r(6656),_=r(9846),f=String,p=n("JSON","stringify"),m=o(/./.exec),g=o("".charAt),v=o("".charCodeAt),y=o("".replace),b=o(1..toString),w=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,E=/^[\uDC00-\uDFFF]$/,x=!_||l((function(){var e=n("Symbol")("stringify detection");return"[null]"!==p([e])||"{}"!==p({a:e})||"{}"!==p(Object(e))})),T=l((function(){return'"\\udf06\\ud834"'!==p("\udf06\ud834")||'"\\udead"'!==p("\udead")})),M=function(e,t){var r=h(arguments),i=d(t);if(c(i)||void 0!==e&&!u(e))return r[1]=function(e,t){if(c(i)&&(t=a(i,this,f(e),t)),!u(t))return t},s(p,null,r)},R=function(e,t,r){var i=g(r,t-1),n=g(r,t+1);return m(S,e)&&!m(E,n)||m(E,e)&&!m(S,i)?"\\u"+b(v(e,0),16):e};p&&i({target:"JSON",stat:!0,arity:3,forced:x||T},{stringify:function(e,t,r){var i=h(arguments),n=s(x?M:p,null,i);return T&&"string"==typeof n?y(n,w,R):n}})},7024:(e,t,r)=>{"use strict";var i=r(5951);r(4840)(i.JSON,"JSON",!0)},8172:()=>{},6750:(e,t,r)=>{"use strict";var i=r(1091),n=r(9447),s=r(4284).f;i({target:"Object",stat:!0,forced:Object.defineProperty!==s,sham:!n},{defineProperty:s})},5264:(e,t,r)=>{"use strict";var i=r(1091),n=r(9846),s=r(8828),a=r(7170),o=r(9298);i({target:"Object",stat:!0,forced:!n||s((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(o(e)):[]}})},3643:()=>{},5205:()=>{},1398:()=>{},7057:(e,t,r)=>{"use strict";var i=r(1470).charAt,n=r(160),s=r(4932),a=r(183),o=r(9550),l="String Iterator",c=s.set,u=s.getterFor(l);a(String,"String",(function(e){c(this,{type:l,string:n(e),index:0})}),(function(){var e,t=u(this),r=t.string,n=t.index;return n>=r.length?o(void 0,!0):(e=i(r,n),t.index+=e.length,o(e,!1))}))},929:(e,t,r)=>{"use strict";var i=r(1091),n=r(3930),s=r(1907),a=r(4239),o=r(2250),l=r(7136),c=r(2087),u=r(160),h=r(9367),d=r(663),_=r(7703),f=r(6264),p=r(7376),m=f("replace"),g=TypeError,v=s("".indexOf),y=s("".replace),b=s("".slice),w=Math.max;i({target:"String",proto:!0},{replaceAll:function(e,t){var r,i,s,f,S,E,x,T,M,R,k=a(this),A=0,C="";if(!l(e)){if((r=c(e))&&(i=u(a(d(e))),!~v(i,"g")))throw new g("`.replaceAll` does not allow non-global regexes");if(s=h(e,m))return n(s,e,k,t);if(p&&r)return y(u(k),e,t)}for(f=u(k),S=u(e),(E=o(t))||(t=u(t)),x=S.length,T=w(1,x),M=v(f,S);-1!==M;)R=E?u(t(S,M,f)):_(S,f,M,[],void 0,t),C+=b(f,A,M)+R,A=M+x,M=M+T>f.length?-1:v(f,S,M+T);return A<f.length&&(C+=b(f,A)),C}})},1995:()=>{},727:(e,t,r)=>{"use strict";var i=r(1091),n=r(5993).trim;i({target:"String",proto:!0,forced:r(5819)("trim")},{trim:function(){return n(this)}})},3997:(e,t,r)=>{"use strict";r(366)("asyncIterator")},3674:(e,t,r)=>{"use strict";var i=r(1091),n=r(5951),s=r(3930),a=r(1907),o=r(7376),l=r(9447),c=r(9846),u=r(8828),h=r(9724),d=r(8280),_=r(6624),f=r(7374),p=r(470),m=r(160),g=r(5817),v=r(8075),y=r(2875),b=r(4443),w=r(5407),S=r(7170),E=r(3846),x=r(4284),T=r(2220),M=r(2574),R=r(8055),k=r(9251),A=r(5816),C=r(2522),F=r(8530),P=r(6499),L=r(6264),D=r(560),I=r(366),O=r(3467),U=r(4840),N=r(4932),W=r(726).forEach,B=C("hidden"),G="Symbol",j="prototype",V=N.set,H=N.getterFor(G),z=Object[j],Y=n.Symbol,q=Y&&Y[j],X=n.RangeError,K=n.TypeError,Z=n.QObject,Q=E.f,J=x.f,$=w.f,ee=M.f,te=a([].push),re=A("symbols"),ie=A("op-symbols"),ne=A("wks"),se=!Z||!Z[j]||!Z[j].findChild,ae=function(e,t,r){var i=Q(z,t);i&&delete z[t],J(e,t,r),i&&e!==z&&J(z,t,i)},oe=l&&u((function(){return 7!==v(J({},"a",{get:function(){return J(this,"a",{value:7}).a}})).a}))?ae:J,le=function(e,t){var r=re[e]=v(q);return V(r,{type:G,tag:e,description:t}),l||(r.description=t),r},ce=function(e,t,r){e===z&&ce(ie,t,r),_(e);var i=p(t);return _(r),h(re,i)?(r.enumerable?(h(e,B)&&e[B][i]&&(e[B][i]=!1),r=v(r,{enumerable:g(0,!1)})):(h(e,B)||J(e,B,g(1,v(null))),e[B][i]=!0),oe(e,i,r)):J(e,i,r)},ue=function(e,t){_(e);var r=f(t),i=y(r).concat(fe(r));return W(i,(function(t){l&&!s(he,r,t)||ce(e,t,r[t])})),e},he=function(e){var t=p(e),r=s(ee,this,t);return!(this===z&&h(re,t)&&!h(ie,t))&&(!(r||!h(this,t)||!h(re,t)||h(this,B)&&this[B][t])||r)},de=function(e,t){var r=f(e),i=p(t);if(r!==z||!h(re,i)||h(ie,i)){var n=Q(r,i);return!n||!h(re,i)||h(r,B)&&r[B][i]||(n.enumerable=!0),n}},_e=function(e){var t=$(f(e)),r=[];return W(t,(function(e){h(re,e)||h(F,e)||te(r,e)})),r},fe=function(e){var t=e===z,r=$(t?ie:f(e)),i=[];return W(r,(function(e){!h(re,e)||t&&!h(z,e)||te(i,re[e])})),i};c||(R(q=(Y=function(){if(d(q,this))throw new K("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?m(arguments[0]):void 0,t=P(e),r=function(e){var i=void 0===this?n:this;i===z&&s(r,ie,e),h(i,B)&&h(i[B],t)&&(i[B][t]=!1);var a=g(1,e);try{oe(i,t,a)}catch(e){if(!(e instanceof X))throw e;ae(i,t,a)}};return l&&se&&oe(z,t,{configurable:!0,set:r}),le(t,e)})[j],"toString",(function(){return H(this).tag})),R(Y,"withoutSetter",(function(e){return le(P(e),e)})),M.f=he,x.f=ce,T.f=ue,E.f=de,b.f=w.f=_e,S.f=fe,D.f=function(e){return le(L(e),e)},l&&(k(q,"description",{configurable:!0,get:function(){return H(this).description}}),o||R(z,"propertyIsEnumerable",he,{unsafe:!0}))),i({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:Y}),W(y(ne),(function(e){I(e)})),i({target:G,stat:!0,forced:!c},{useSetter:function(){se=!0},useSimple:function(){se=!1}}),i({target:"Object",stat:!0,forced:!c,sham:!l},{create:function(e,t){return void 0===t?v(e):ue(v(e),t)},defineProperty:ce,defineProperties:ue,getOwnPropertyDescriptor:de}),i({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:_e}),O(),U(Y,G),F[B]=!0},5084:()=>{},3313:(e,t,r)=>{"use strict";var i=r(1091),n=r(5582),s=r(9724),a=r(160),o=r(5816),l=r(4411),c=o("string-to-symbol-registry"),u=o("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=a(e);if(s(c,t))return c[t];var r=n("Symbol")(t);return c[t]=r,u[r]=t,r}})},2596:(e,t,r)=>{"use strict";r(366)("hasInstance")},5721:(e,t,r)=>{"use strict";r(366)("isConcatSpreadable")},4954:(e,t,r)=>{"use strict";r(366)("iterator")},4452:(e,t,r)=>{"use strict";r(3674),r(3313),r(751),r(9721),r(5264)},751:(e,t,r)=>{"use strict";var i=r(1091),n=r(9724),s=r(5594),a=r(4640),o=r(5816),l=r(4411),c=o("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!s(e))throw new TypeError(a(e)+" is not a symbol");if(n(c,e))return c[e]}})},3377:(e,t,r)=>{"use strict";r(366)("matchAll")},4123:(e,t,r)=>{"use strict";r(366)("match")},2230:(e,t,r)=>{"use strict";r(366)("replace")},5344:(e,t,r)=>{"use strict";r(366)("search")},1660:(e,t,r)=>{"use strict";r(366)("species")},4610:(e,t,r)=>{"use strict";r(366)("split")},3669:(e,t,r)=>{"use strict";var i=r(366),n=r(3467);i("toPrimitive"),n()},4810:(e,t,r)=>{"use strict";var i=r(5582),n=r(366),s=r(4840);n("toStringTag"),s(i("Symbol"),"Symbol")},3325:(e,t,r)=>{"use strict";r(366)("unscopables")},768:(e,t,r)=>{"use strict";var i=r(6264),n=r(4284).f,s=i("metadata"),a=Function.prototype;void 0===a[s]&&n(a,s,{value:null})},6038:(e,t,r)=>{"use strict";r(929)},8549:(e,t,r)=>{"use strict";r(366)("asyncDispose")},1697:(e,t,r)=>{"use strict";r(366)("customMatcher")},7152:(e,t,r)=>{"use strict";r(366)("dispose")},3939:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0},{isRegisteredSymbol:r(2595)})},3422:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:r(2595)})},1785:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:r(9197)})},36:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:r(9197)})},8703:(e,t,r)=>{"use strict";r(366)("matcher")},6878:(e,t,r)=>{"use strict";r(366)("metadataKey")},1372:(e,t,r)=>{"use strict";r(366)("metadata")},4664:(e,t,r)=>{"use strict";r(366)("observable")},9671:(e,t,r)=>{"use strict";r(366)("patternMatch")},359:(e,t,r)=>{"use strict";r(366)("replaceAll")},2560:(e,t,r)=>{"use strict";r(9363);var i=r(9287),n=r(5951),s=r(4840),a=r(3742);for(var o in i)s(n[o],o),a[o]=a.Array},2222:(e,t,r)=>{"use strict";var i=r(6823);e.exports=i},4598:(e,t,r)=>{"use strict";var i=r(1042);e.exports=i},8251:(e,t,r)=>{"use strict";var i=r(1926);e.exports=i},4139:(e,t,r)=>{"use strict";var i=r(3842);r(2560),e.exports=i},7045:(e,t,r)=>{"use strict";var i=r(1730);r(2560),e.exports=i},70:(e,t,r)=>{"use strict";var i=r(1661);e.exports=i}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i].call(s.exports,s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};r.r(e),r.d(e,{APP_Troubleshoting_Info:()=>ka,BigLog_js:()=>ja,Compute_Capture_Delay:()=>Ra,Compute_WebSocket_Speed:()=>Ma,GetCscThreadNum:()=>da,GetEncThreadNum:()=>_a,GetLogLevel_js:()=>pa,GetWebCodecsEncoderFallbackFlag_js:()=>sa,GetWebCodecsEncoderL1T2Flag_js:()=>na,IsSupportMultiThread:()=>ra,IsSupportMultiThreadForWebcodec:()=>ca,JsMediaSDK_Log:()=>Ds,LOG_OUT:()=>ga,LimitWebCodecsDecoderTo360_js:()=>oa,LimitWebCodecsEncoderTo360_js:()=>aa,MCMMonitor_Sharing_LOG:()=>Oa,Open_Sharing_WebSocket_Connect:()=>Rs,Pace_Sender:()=>xa,Recieve_Wb_Packet:()=>Is,SAVE_IV:()=>Fa,Send_Data_Codec:()=>ma,Send_Out_Qos:()=>Ua,Send_Wb_Rtp_Packet:()=>Us,Set_Share_Mode_js:()=>Va,Sharing_Capture:()=>Aa,Sharing_Decode:()=>fa,SubScribeUpdateSharing:()=>$s,Update_WebSokcet_Speed:()=>Ca,UserAgentIsTesla_js:()=>la,UserWebCodecController_js:()=>Ja,Utf8ArrayToStr:()=>va,checkWebCodecWhitelist_js:()=>Qa,decode_callback:()=>Js,frame_callback_mouse_video_mode:()=>Qs,frame_callback_video_mode:()=>Zs,freeWasmMemory:()=>La,getGraphicName:()=>ua,getNTPBaseTime:()=>$a,getVendorName:()=>ha,getWasmMemory:()=>Pa,hardcodecpunumber:()=>ia,on_keyframe_request:()=>ho,on_keyframe_request_ex:()=>_o,on_share_encode_start:()=>po,reportSenderNTPTime:()=>eo,responseSharingQosData:()=>Ys,share_mouse_raw_data:()=>uo,share_network_quality_callback:()=>Os,share_rtcp_raw_data:()=>co,share_rtp_raw_data:()=>lo,sharing_decode_channel_change:()=>fo,sharing_qos_monitor:()=>Hs,sharing_statistics_monitor:()=>zs,sharing_websocket_on_close:()=>Fs,sharing_websocket_on_error:()=>Ps,sharing_websocket_on_message:()=>Cs,sharing_websocket_on_open:()=>ks,start_pace_sender:()=>Ta,wcl_trace_log:()=>Ns});var t=r(4997),i=r(2321),n=r(2231);function s(e){return s="function"==typeof i&&"symbol"==typeof n?function(e){return typeof e}:function(e){return e&&"function"==typeof i&&e.constructor===i&&e!==i.prototype?"symbol":typeof e},s(e)}var a=r(9280);function o(e,r,i){return(r=function(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[a];if(void 0!==t){var r=t.call(e,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}(r))in e?t(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}const l=15,c=20,u=21,h=31,d=35,_=36,f=37,p=38,m=52,g=56,v=61,y=68,b=69,w=75,S=120,E=127,x=128,T=133,M=135,R=151,k=183,A=184,C=186,F=192,P=196,L=209,D=-14,I=-15,O="VIDEOSHARE_QOS_DATA",U="MEDIASDK_CACHE_INFO",N=new class{constructor(){this._highFrequencyLogs={},this.fixVersion="",this.cacheLogStack=[],this.isFlushing=!1}setInstance(e,t){this._instance=e,this.fixVersion=t}getMessageFromErrorOrEvent(e,t){let r=e;return t instanceof ErrorEvent?(t.filename&&(r+=` File: ${t.filename}`),(t.lineno||t.colno)&&(r+=` Line: ${t.lineno}:${t.colno}`),t.message&&(r+=` Message: ${t.message}`),t.error&&(r+=`\nStack: ${t.error.stack}`)):t instanceof Error?(t.message&&(r+=` Message: ${t.message}`),t.stack&&(r+=` Stack: ${t.stack}`),t.name&&(r+=` Name: ${t.name}`),t.constraint&&(r+=` Constraint: ${t.constraint}`)):t instanceof CloseEvent?(t.code&&(r+=` Code: ${t.code}`),t.reason&&(r+=` Reason: ${t.reason}`),r+=` wasClean: ${t.wasClean}`):t instanceof DOMException?(t.message&&(r+=` Message: ${t.message}`),t.name&&(r+=` Name: ${t.name}`)):r+=t?t.toString():"",r}_addCacheLog(e,t){this.cacheLogStack.length<100&&this.cacheLogStack.push({type:e,message:t})}flushCacheLog(){if(this._instance&&this.cacheLogStack.length>0&&!this.isFlushing){this.isFlushing=!0;let e="";this.cacheLogStack.forEach((t=>{let{type:r,message:{message:i="",tags:n=[]}}=t;const s=i?`${n.join("|")}:${i}|----|`:"";switch(r){case"log":this._log(i,[...n,U]);break;case"warn":case"error":case"severityerror":case"directReport":e+=s}})),e&&this._directReport(e,[U]),this.cacheLogStack=[],this.isFlushing=!1}}log(e,t=[]){this._instance?(this.flushCacheLog(),this._log(e,t)):this._addCacheLog("log",{message:e,tags:t})}warn(e,t=null,r=[]){e=this.getMessageFromErrorOrEvent(e,t),this._instance?(this.flushCacheLog(),this._warn(e,r)):this._addCacheLog("warn",{message:e,tags:r})}error(e,t=null,r=[]){var i;e=this.getMessageFromErrorOrEvent(e,t),this._highFrequencyLogs[e]?this._highFrequencyLogs[e]+=1:this._highFrequencyLogs[e]=1,!((i=this._highFrequencyLogs[e])&i-1)&&(this._instance?(this.flushCacheLog(),this._error(e,r)):this._addCacheLog("error",{message:e,tags:r}))}severityerror(e,t=[]){this._instance?(this.flushCacheLog(),this._severityerror(JSON.stringify(e),t)):this._addCacheLog("severityerror",{message:JSON.stringify(e),tags:t})}directReport(e,t=["MEDIASDK_INFO"]){var r;this._instance?(this.flushCacheLog(),null===(r=this._directReport)||void 0===r||r.call(this,e,t)):this._addCacheLog("directReport",{message:e,tags:t})}_log(e,t=[]){this._instance&&this._instance.log(e,t)}_warn(e,t=[]){this._instance&&this._instance.warn(e,t)}_error(e,t=[]){this._instance&&this._instance.error(e,[this.fixVersion,...t])}_severityerror(e,t=[]){this._instance&&this._instance.error(e,t)}_directReport(e,t=[]){var r,i;this._instance&&(null===(i=(r=this._instance).directReport)||void 0===i||i.call(r,{msg:e},t))}clearHighFrequencyLogs(){this._highFrequencyLogs={}}};new Error;const W=new Map;function B(e,t="|"){return e?e.toString().replaceAll(/[,,]/g,t):""}const G="function"!=typeof importScripts;function j(e){postMessage({status:d,data:e})}function V(e,t=null){G?N.error(e,t):H(e,t)}function H(e,t=null){var r,i;if(t instanceof Error||t instanceof ErrorEvent){const n=t;e+=" Code: "+(null==n?void 0:n.code)+" Message: "+(null==t?void 0:t.message)+" Stack: "+(null!==(i=null===(r=null==n?void 0:n.error)||void 0===r?void 0:r.stack)&&void 0!==i?i:null==n?void 0:n.stack),t=null}postMessage({status:v,errorMessage:e,errorEvent:t})}function z(e){postMessage({status:v,errorMessage:e,level:"low"})}function Y(e){G?function(e,t){if(!function(e){const t=performance.now();return(!W.has(e)||t-W.get(e)>5e3)&&(W.set(e,t),!0)}(e))return;let r;try{r=B("object"==typeof t?JSON.stringify(t):t)}catch(e){r=B(t)}N.error(`NotifyUIError,event=${e},data=${r}`)}(-51,e):postMessage({status:-27,where:e})}function q(){return self.GROWABLE_HEAP_I8?self.GROWABLE_HEAP_I8():Module.HEAP8}function X(){return self.GROWABLE_HEAP_U8?self.GROWABLE_HEAP_U8():Module.HEAPU8}function K(){return self.GROWABLE_HEAP_U32?self.GROWABLE_HEAP_U32():Module.HEAPU32}function Z(){let e=this;this.promise=new Promise((function(t,r){e.reject=r,e.resolve=t}))}class Q{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 Z;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){!0!==this.avaiableIndexMap[e]&&(this.avaiableIndexMap[e]=!0,this.availableIndex.push(e),this.deferedList.length>0)&&this.deferedList.shift().resolve(this.get())}}class J{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}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){H("Error in YuvWrap.recycle: ".concat(e))}}}const $=["","MOZ_","OP_","WEBKIT_"];function ee(e,t){for(var r=0;r<$.length;++r){var i=$[r]+t,n=e.getExtension(i);if(n)return n}}function te(e,t){e?e.send(t):H("websocket is null",new Error("message type ".concat(t[0])))}function re(e){return e&&"undefined"!=typeof atob?Uint8Array.from(atob(e),(e=>e.charCodeAt(0))):null}new Map,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&&i.lastTime&&e-i.lastTime>2e3&&(this.ssrcInfoMap.delete(r),this._notifyFPS(r,0))}))}_notifyFPS(e,t){postMessage({status:66.6,data:{ssrc:e,fps:t}})}_checkIfNewFrameComing(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((()=>{this._removeZeroFPS(),this.timer=null}),2500)}},new class{constructor(){this.ssrcInfoMap=new Map,this.timer=null}updateSSRCInfo(e,t){this.ssrcInfoMap.has(e)||this.ssrcInfoMap.set(e,{timeList:[],lastTime:0,fps:0}),this._calculateFPS(e,t),this._removeZeroFPS(),this._checkIfNewFrameComing()}_calculateFPS(e,t){const r=this.ssrcInfoMap.get(e);if(r.timeList.push(t),r.lastTime=t,r.timeList.length>2){const t=r.timeList[0],i=r.timeList[r.timeList.length-1];if(i-t>=1e3){const n=Math.floor(1e3/((i-t)/(r.timeList.length-1)));r.fps!==n&&(this._notifyFPS(e,n),r.fps=n),r.timeList=[]}}r.timeList.length>30&&(r.timeList=r.timeList.slice(r.timeList.length-30))}_removeZeroFPS(){this.ssrcInfoMap.forEach(((e,t)=>{const r=this.ssrcInfoMap.get(t);r&&Date.now()-r.lastTime>2e3&&(this.ssrcInfoMap.delete(t),this._notifyFPS(t,0))}))}_notifyFPS(e,t){postMessage({status:66.6,data:{ssrc:e,fps:t}})}_checkIfNewFrameComing(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((()=>{this._removeZeroFPS(),this.timer=null}),2500)}};const ie=function(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;const s=i.width,a=i.height,o=s*a,l=o/4,c=t*r,u=c/4,h=t*i.y+i.x,d=t*i.y/4+i.x/2;let _;_=n?new Uint8Array(n,0,o+2*l):new Uint8Array(o+2*l);const f=e.buffer,p=e.byteOffset;if(t==i.width){const e=new Uint8Array(f,p+h,o);_.set(e,0);const t=new Uint8Array(f,p+c+d,l);_.set(t,o);const r=new Uint8Array(f,p+c+u+d,l);_.set(r,o+l)}else{let e=0,r=p+h;for(let i=0;i<a;i++){const i=new Uint8Array(f,r,s);_.set(i,e),e+=s,r+=t}let i=s/2,n=t/2,m=a/2;e=o,r=p+c+h;for(let t=0;t<m;t++){const t=new Uint8Array(f,r,i);_.set(t,e),e+=i,r+=n}e=o+l,r=p+c+u+d;for(let t=0;t<m;t++){const t=new Uint8Array(f,r,i);_.set(t,e),e+=i,r+=n}}return _},ne=1e3,se=43,ae=44,oe=45,le=0,ce=3,ue={DESKTOP_SOURCE:0,UAC_SOURCE:1},he={SHARE_REMOTE_CONTROL_UAC_MOUSE:144,SHARE_REMOTE_CONTROL_UAC_JPEG_FRAME:145},de=(new Map([["useinbandfec",1],["maxaveragebitrate",48e3],["maxplaybackrate",24e3],["sprop-maxcapturerate",24e3],["sprop-stereo",null],["stereo",null]]),new Map([["useinbandfec",null],["maxaveragebitrate",96e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",96e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",128e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",128e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",96e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3]]),new Map([["useinbandfec",1],["maxaveragebitrate",64e3],["maxplaybackrate",24e3],["sprop-maxcapturerate",24e3],["sprop-stereo",null],["stereo",null]]),new Map([["stereo",1]]),0),_e=["intel","nvidia","apple","amd","qualcomm","arm"],fe=.005,pe=class{_drawWatermarkWithShadow(e){let{ctx:t,textPos:r,opacity:i,name:n}=e;t.fillStyle="rgba(0, 0, 0, ".concat(i,")"),t.fillText(n,r.x,r.y),t.fillStyle="rgba(255, 255, 255, ".concat(i,")"),t.fillText(n,r.x+1,r.y+1)}_getTransformInfo(e){let t,{canvas:r,position:i}=e;if(1===i)t={x:r.width/2,y:0,rateRadio:0,maxWidth:r.width};else if(2===i)t={x:r.width/2,y:r.height,rateRadio:0,maxWidth:r.width};else if(4===i)t={x:0,y:r.height/2,rateRadio:Math.PI/2,maxWidth:r.height};else if(8===i)t={x:r.width,y:r.height/2,rateRadio:-Math.PI/2,maxWidth:r.height};else{const e=-21*Math.PI/180;t={x:r.width/2,y:r.height/2,rateRadio:e,maxWidth:Math.min(r.width/Math.cos(e),-r.height/Math.sin(e))}}return t.maxWidth>100&&(t.maxWidth-=50),t}_calcTextPos(e){let{position:t,ctx:r,name:i,textWidth:n}=e;const s=this._getPaddingWidth({ctx:r,position:t,name:i});return 1===t?{x:-n.width/2,y:s}:2===t||4===t||8===t?{x:-n.width/2,y:-s}:{x:-n.width/2,y:r.measureText(i[0]).width/2}}_getPaddingWidth(e){let{ctx:t,position:r,name:i}=e;return[1,2,4,8].includes(r)?32:t.measureText(i[0]).width}_setBaseLine(e){let{ctx:t,position:r}=e;t.textBaseline=1===r?"top":2===r||4===r||8===r?"bottom":"middle"}Get_WaterMarkRGBA(e){let{canvas:t,name:r,width:i,height:n,opacity:s=.15,position:a,convertToDataUrl:o=!1,transferToImage:l=!1}=e;if(!r||!i||!n)return;s=s||.15,i*=1,n*=1,t.width=i,t.height=n;let c=this._getTransformInfo({canvas:t,position:a});var u=t.getContext("2d");let h;if(u.clearRect(0,0,t.width,t.height),u.translate(c.x,c.y),u.rotate(c.rateRadio),this._setBaseLine({ctx:u,position:a}),u.lineWidth=1,u.imageSmoothingEnabled=!0,1==r.length){const e=c.maxWidth/r.length;u.font=e+"px 'Segoe UI'",h=u.measureText(r)}else{let e=16;for(u.font=e+"px 'Segoe UI'",h=u.measureText(r);h.width<c.maxWidth-2*this._getPaddingWidth({ctx:u,position:a,name:r});)e+=1,u.font=e+"px 'Segoe UI'",h=u.measureText(r);if(h.width>c.maxWidth-2*this._getPaddingWidth({ctx:u,position:a,name:r}))if(e>16)e-=1,u.font=e+"px 'Segoe UI'",h=u.measureText(r);else{const e=r;for(;r.length>5&&h.width>c.maxWidth-2*this._getPaddingWidth({ctx:u,position:a,name:r+"..."});)r=r.slice(0,r.length-1),h=u.measureText(r+"...");e!==r&&(r+="...")}}const d=this._calcTextPos({position:a,ctx:u,name:r,textWidth:h});var _;if(this._drawWatermarkWithShadow({ctx:u,name:r,opacity:s,textPos:d}),o)_=t.toDataURL();else if(l)_=t.transferToImageBitmap();else{var f=u.getImageData(0,0,u.canvas.width,u.canvas.height);_=new Uint8Array(f.data.buffer)}return u.rotate(-c.rateRadio),u.translate(-c.x,-c.y),_}Get_Repeated_WaterMarkRGBA(e){let{canvas:t,name:r,width:i,height:n,opacity:s=.15,position:a,convertToDataUrl:o=!1,transferToImage:l=!1}=e;if(!r||!i||!n)return;s=s||.15,i*=1,n*=1,t.width=i,t.height=n;const c=t.getContext("2d");c.clearRect(0,0,t.width,t.height),c.translate(i/2,n/2),c.rotate(-21*Math.PI/180),c.imageSmoothingEnabled=!0,c.font="".concat(32,"px 'Segoe UI'"),c.textBaseline="top";const u=c.measureText(r),h=.37*u.width;let d,_=0,f=-n;do{let e=_%2==0?h-i:-i;do{c.fillStyle="rgba(0, 0, 0, ".concat(s,")"),c.fillText(r,e,f),c.fillStyle="rgba(255, 255, 255, ".concat(s,")"),c.fillText(r,e+1,f+1),e+=u.width+h}while(e<i);f+=32+h,_++}while(f<n);if(o)d=t.toDataURL();else if(l)d=t.transferToImageBitmap();else{const e=c.getImageData(0,0,c.canvas.width,c.canvas.height);d=new Uint8Array(e.data.buffer)}return c.rotate(21*Math.PI/180),c.translate(-i/2,-n/2),d}};function me(){this.a=[],this.b=0,this.residue=null}me.prototype.getLength=function(){return this.a.length-this.b},me.prototype.isEmpty=function(){return 0==this.a.length},me.prototype.enqueue=function(e){this.a.push(e)},me.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},me.prototype.peek=function(){return 0<this.a.length?this.a[this.b]:void 0},me.prototype.clear=function(){this.a=[],this.b=0};const ge=me;function ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const be=8294400;function we(e,t){let r=e>>10;return t&&(r|=1<<23),r}function Se(e){this.Notify_APPUI=e.Notify_APPUI,this.PubSub=e.PubSub,this.jsMediaEngine=e.jsMediaEngine,this.globalTracingLogger=e.globalTracingLogger,this.renderManager=e.renderManager,this.currentshareactive=0,this.isFromMainSession=0,this.sharingWidthAndHeightInfo={logicHeight:0,logicWidth:0},this.isCreateSharingWaterMark=!1,this.sharingWaterMarkName="",this.isWaterMarkRepeatedEnable=!1,this.waterMarkOpacity=.15,this.WaterMarkRGBA=new pe,this.firstFrameForIOS=!1,this.timestart=0,this.asTime=0,this.rAFID=0,this.requestAnimation=!1,this.requestF=this.No_Bindthis_RAF.bind(this),this.cATimeStamp=0,this.lRTimeStamp=0,this.pacingtime=1,this.sharingFps=0,this.lfTimeStamp=0,this.maxQueueLength=0,this.vaTimeDelta=0,this.renderMode=0,this.SharingRenderInterval=0,this.RAFhealthCheckInterval=0,this.RAFLastTime=0,this.brefresh=!1,this.statisticObj=null,this.renderarray=new Map,this.sharingCanvasMap=new Map,this.mMonitorCount=0,this.canvasLogicSize=new Map,this.canvasrealSize=new Map}Se.prototype.Start_Draw=function(){return this.requestAnimation=!0,this.Start_Request_Animation_Frame()},Se.prototype.Stop_Draw=function(){return this.requestAnimation=!1,this.lRTimeStamp=0,this.cATimeStamp=0,this.Stop_Request_Animation_Frame()},Se.prototype.Start_Request_Animation_Frame=function(){return this.rAFID=requestAnimationFrame(this.requestF),this.rAFID},Se.prototype.Stop_Request_Animation_Frame=function(){this.rAFID&&(cancelAnimationFrame(this.rAFID),this.rAFID=0)},Se.prototype.No_Bindthis_RAF=function(){let e=performance.now();this.RAFLastTime=e,this.requestAnimation?(this.calPacingTime(e),e-this.timestart>this.pacingtime&&(this.timestart=e,this.JsMediaSDK_SharingRender()),this.Start_Request_Animation_Frame()):this.Stop_Request_Animation_Frame()},Se.prototype.addRender=function(e,t,r,i,n,s){let a=this.sharingCanvasMap.get(n);if(!a&&i&&this.sharingCanvasMap.set(n,i),!(i=i||a))return!1;i!=a&&a&&i&&this.replaceCanvas(n,i);const o=n||"0";this.canvasLogicSize.has(o)||this.UpdateCanvasSize(o,i.width,i.height,!1);const l=we(e,r),c=this.renderarray.get(l);if(c){if(c.canvasId==n)return c.logicViewPort=s,c.viewport=s,c.zone=t,s&&this.updateViewPort(ye({ssrc:e,zone:t,ismainSession:r},s)),!1;this.removeRender(c.ssrc,c.zone,c.ismainSession)}i.canvasId=n;let u=this.renderManager.getRenderDisplay(i,n,10,this.Log_Error.bind(this),null);return!!u&&(this.renderarray.set(l,{ssrc:e,zone:t,ismainSession:r,display:u,logicViewPort:s,viewport:s,canvas:i,canvasId:n,renderInfo:{xratio:1,yratio:1,logic_w:0,logic_h:0,real_w:0,real_h:0},screenQueue:new ge,mouseQueue:new ge}),s&&this.updateViewPort(ye({ssrc:e,zone:t,ismainSession:r},s)),this.renderarray.size>1&&(this.sharingWidthAndHeightInfo={logicHeight:0,logicWidth:0}),!0)},Se.prototype.getRender=function(e,t,r){if(null!=t){const r=we(e,t);return this.renderarray.get(r)}return Array.from(this.renderarray.values()).find((t=>t.ssrc>>10==e>>10))},Se.prototype.removeRender=function(e,t,r){var i,n;const s=this.getRender(e,r);if(!s||s.zone!=t)return!1;const a=we(s.ssrc,s.ismainSession);this.renderarray.delete(a);try{for(;!s.screenQueue.isEmpty();){let e=s.screenQueue.dequeue();e.yuvdata&&e.yuvdata instanceof J&&e.yuvdata.recycle(),e.dataptr&&Module._free(e.dataptr)}s.mouseQueue.clear()}catch(e){console.error("<<<< error",e)}null===(i=s.display)||void 0===i||null===(n=i.clearDisplay)||void 0===n||n.call(i),this.renderManager.recycleRenderDisplay(s.canvas,s.display,!1)},Se.prototype.removeAllRender=function(){let e=[];this.renderarray.forEach(((t,r)=>{e.push(t)})),e.forEach((e=>{this.removeRender(e.ssrc,e.zone,e.ismainSession)}))},Se.prototype.updateViewPort=function(e){const{ssrc:t,zone:r,isFromMainSession:i,rgba:n}=e,{x:s,y:a,width:o,height:l}=e,c=this.getRender(t,i);if(null!=c&&c.viewport&&(null==c?void 0:c.zone)==r){var u;const e=c.canvasId||"0",t=(null===(u=this.canvasrealSize.get(e))||void 0===u?void 0:u.ratio)||1;c.logicViewPort={x:s,y:a,width:o,height:l},c.viewport={x:Math.floor(s*t),y:Math.floor(a*t),width:Math.floor(o*t),height:Math.floor(l*t)}}},Se.prototype._deleteOldCanvas=function(e,t){let r=[];return this.renderarray.forEach(((e,i)=>{e.canvasId==t&&r.push(e)})),r.forEach((e=>{this.removeRender(e.ssrc,e.zone,e.ismainSession)})),r},Se.prototype.isHasRender=function(){return!!this.renderarray.size},Se.prototype.isSharingCanvas=function(e){return!!this.sharingCanvasMap.get(e)},Se.prototype.replaceCanvas=function(e,t){const r=this.sharingCanvasMap.get(e);if(r==t)return;let i=this._deleteOldCanvas(null,e);this.sharingCanvasMap.delete(e),this.renderManager.clearOffscreenCanvas(r),t?(this.sharingCanvasMap.set(e,t),i.forEach((r=>{const{ssrc:i,zone:n,ismainSession:s,viewport:a}=r;this.addRender(i,n,s,t,e,a)}))):(this.canvasLogicSize.delete(e),this.canvasrealSize.delete(e))},Se.prototype.No_Bindthis_Interval=function(){let e=performance.now();this.calPacingTime(e),e-this.timestart>this.pacingtime&&(this.timestart=e,this.JsMediaSDK_SharingRender())},Se.prototype.calPacingTime=function(e){this.pacingtime=30,this.sharingFps&&this.sharingFps>0&&this.sharingFps<100&&(this.pacingtime=1e3/this.sharingFps);let t=this.Get_Current_QueueLength();if(this.cATimeStamp&&this.lRTimeStamp){let r=this.cATimeStamp+e-this.asTime;this.vaTimeDelta=this.lRTimeStamp+this.pacingtime-r,this.vaTimeDelta>65&&this.vaTimeDelta<1e4&&t>1&&(this.pacingtime=1.5*this.pacingtime),this.vaTimeDelta<-65&&(this.pacingtime=1*this.pacingtime/2)}else this.cATimeStamp||(this.pacingtime>150||t>20?this.pacingtime=1*this.pacingtime/2:this.pacingtime=this.pacingtime-10)},Se.prototype.render_monitor_log=function(e){this.jsMediaEngine?this.jsMediaEngine.Send_Render_Monitor_Log(e):postMessage({status:53,data:e})},Se.prototype.JsMediaSDK_SharingRender=function(){var e;if(!this.renderarray.size)return;null===(e=this.statisticObj)||void 0===e||e.sample();const t=this.brefresh||Array.from(this.renderarray.values()).some((e=>e.screenQueue.getLength()||e.mouseQueue.getLength()));this.brefresh=!1,this.renderarray.forEach(((e,r)=>{var i;const{display:n,screenQueue:s,mouseQueue:a,canvas:o}=e,l=e.ssrc>>10<<10;var c;if(!1===(null===(i=n.isAvaiable)||void 0===i?void 0:i.call(n)))return void(null===(c=n.restoreContext)||void 0===c||c.call(n));const u=s.dequeue(),h=a.dequeue();var d=e.viewport;if(d||(d={x:0,y:0,width:null==o?void 0:o.width,height:null==o?void 0:o.height}),h){const{xratio:t,yratio:r}=e.renderInfo,i=h.r_x*t,s=h.r_y*r,a=h.width*t,o=h.height*r;n.updateCursor(h.width,h.height,h.buffer,h.sync_id),n.updateCursorPosInfo(1,i,s,a,o),++this.mMonitorCount%3e3==0&&this.render_monitor_log("SDSBM")}if(u){let t,r;this.lRTimeStamp=Math.max(u.ntptime,this.lRTimeStamp),u.yuvdata instanceof J?(t=u.yuvdata.yuvdata,r=u.yuvdata):(t=u.yuvdata,r=null);var _=u.logic_h,f=u.logic_w,p=u.r_h,m=u.r_w;e.renderInfo.xratio=m/f,e.renderInfo.yratio=p/_;const i={top:u.r_x,left:u.r_y,height:u.r_h,width:u.r_w},s=d.width,a=d.height;this.Should_Update_Watermark(n,s,a)&&this.Update_Display_Watermark(n,s,a),n.drawNextOutputPictureFrame(u.width,u.height,i,t,null,u.yuv_limited,d),r&&r.recycle(),u.dataptr&&Module._free(u.dataptr)}else if(t&&n.isHasWholeFrame()){const e=d.width,t=d.height;this.Should_Update_Watermark(n,e,t)&&this.Update_Display_Watermark(n,e,t),n.drawNextOutputPictureFrame(n.getTextureWidth(),n.getTextureHeight(),n.getCroppingParams(),null,null,!0,d,!1)}this.UpdateSharingLogicWidthHeightInfo(l,e.canvasId,e.renderInfo,!1)})),t&&this.renderManager.renderFor(2)},Se.prototype.setOnlyAcceptUISize=function(e){this.bOnlyAcceptUISize=e},Se.prototype.updateOffscreenCanvasSize=function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];const s=this.renderarray.size;if(void 0===e&&s>1&&(this.render_monitor_log("UASCANVASERROR:".concat(s)),this.Log_Error("Error updating OffscreenCanvas size > 1 canvasId is null")),!this.bOnlyAcceptUISize||i)try{this.UpdateCanvasSize(e,t,r,n,i),this.brefresh=!0}catch(e){this.Log_Error("Error updating OffscreenCanvas size",e)}},Se.prototype.UpdateCanvasSize=function(e,t,r,i,n){var s;let a=[],o=Array.from(this.renderarray.values());for(let t=0;t<o.length;t++){const r=o[t];r.canvasId!=e&&void 0!==e||a.push(r)}if(void 0===e&&1!=a.length)return;const l=e||"0";this.canvasLogicSize.set(l,{width:t,height:r});const c="undefined"!=typeof DedicatedWorkerGlobalScope;let u={width:t,height:r,ratio:1};if(t*r>be&&c){const e=Math.sqrt(be/(t*r));u.width=Math.round(t*e),u.height=Math.round(r*e),u.ratio=e}this.canvasrealSize.set(l,u);const{width:h,height:d,ratio:_}=u;a.forEach((e=>{const t=null==e?void 0:e.logicViewPort;if(!n||!t)return;const{x:r,y:i,width:s,height:a}=t;e.viewport={x:Math.floor(r*_),y:Math.floor(i*_),width:Math.floor(s*_),height:Math.floor(a*_)}}));const f=null===(s=a[0])||void 0===s?void 0:s.canvas;var p;f&&f instanceof OffscreenCanvas&&(f.width!=h||f.height!=d)&&(f.width=h,f.height=d,null===(p=a[0].display)||void 0===p||p.resizeCanvasTo(h,d),i&&(this.brefresh=!0,this.JsMediaSDK_SharingRender()))},Se.prototype.Change_Current_SSRC=function(e,t){this.currentshareactive=e,this.isFromMainSession=t;const r=we(e,t),i=this.renderarray.get(r);this.firstFrameForIOS=!1,i&&this.UpdateUserSharingInfo(i)},Se.prototype.Set_WaterMark_Info=function(e){let{waterMarkCanvas:t,isCreateSharingWaterMark:r,sharingWaterMarkName:i,watermarkOpacity:n,watermarkRepeated:s,watermarkPosition:a}=e;this.Replace_WaterMark_Canvas(t),this.isCreateSharingWaterMark=r,this.sharingWaterMarkName=i,void 0!==s&&(this.isWaterMarkRepeatedEnable=!!s),void 0!==n&&(this.waterMarkOpacity=n),void 0!==a&&(this.watermarkPosition=a),this.renderarray.forEach(((e,t)=>{var r;null===(r=e.display)||void 0===r||r.setWatermarkFlag(this.isCreateSharingWaterMark?1:0)}))},Se.prototype.Replace_WaterMark_Canvas=function(e){this.waterMarkCanvas=e},Se.prototype.Should_Watermark_Repeated=function(e,t){return this.isWaterMarkRepeatedEnable&&e>306&&t>202};const Ee=function(e,t){if(e<640&&e){const r=640/e;e=640,t=Math.round(t*r)}return{width:e,height:t}};Se.prototype.Update_Display_Watermark=function(e,t,r){if("function"==typeof OffscreenCanvas&&this.waterMarkCanvas instanceof OffscreenCanvas&&OffscreenCanvasRenderingContext2D&&!OffscreenCanvasRenderingContext2D.prototype.measureText)return;const i=t<512||r<288?16:this.watermarkPosition,n=this.Should_Watermark_Repeated(t,r),s=Ee(t,r);t=s.width,r=s.height;const a=n?this.WaterMarkRGBA.Get_Repeated_WaterMarkRGBA({canvas:this.waterMarkCanvas,name:this.sharingWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:i}):this.WaterMarkRGBA.Get_WaterMarkRGBA({canvas:this.waterMarkCanvas,name:this.sharingWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:i});e.updateWatermark(t,r,a)},Se.prototype.Should_Update_Watermark=function(e,t,r){if(!this.isCreateSharingWaterMark)return!1;let i=!1;const n=Ee(t,r);n.width===e.getWatermarkWidth()&&n.height===e.getWatermarkHeight()||(i=!0);const s=this.Should_Watermark_Repeated(t,r);e.isSetWatermark()||(i=!0),s!==e.isWatermarkRepeated()&&(i=!0,e.setWatermarkRepeated(s)),this.waterMarkOpacity&&this.waterMarkOpacity!==e.getWatermarkOpacity()&&(i=!0,e.setWatermarkOpacity(this.waterMarkOpacity),this.waterMarkOpacity=e.getWatermarkOpacity());const a=t<512||r<288?16:this.watermarkPosition;return a!==e.getWatermarkPosition()&&(i=!0,e.setWatermarkPosition(a),this.watermarkPosition=e.getWatermarkPosition()),i},Se.prototype.Put_Sharing_Data_From_Queue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;const r=we(e.ssrc,e.isFromMainSession);let i=this.renderarray.get(r);if(!i)return e.yuvdata instanceof J&&e.yuvdata.recycle(),void(e.dataptr&&Module._free(e.dataptr));this.firstFrameForIOS||e.ssrc>>10!=this.currentshareactive>>10||(this.firstFrameForIOS=!0,this.Notify_APPUI?this.Notify_APPUI(34,this.currentshareactive):postMessage({status:78,ssrc:this.currentshareactive})),this.brefresh=!0,i.screenQueue.enqueue(e);const n=e.ntptime-this.lfTimeStamp;this.lfTimeStamp&&n>0&&(this.sharingFps?this.sharingFps=500/n+this.sharingFps/2:this.sharingFps=1e3/n),this.sharingFps!=1/0&&this.sharingFps||(this.sharingFps=20),this.lfTimeStamp=e.ntptime;var s=i.screenQueue.getLength()-t;for(this.maxQueueLength=t;s>=0;){let e=i.screenQueue.dequeue();e.yuvdata instanceof J&&e.yuvdata.recycle(),e.dataptr&&Module._free(e.dataptr),s--}const a=i.renderInfo;a.real_h==e.r_h&&a.real_w==e.r_w&&a.logic_h==e.logic_h&&a.logic_w==e.logic_w||(a.real_h=e.r_h,a.real_w=e.r_w,a.logic_h=e.logic_h,a.logic_w=e.logic_w,this.UpdateUserSharingInfo(i))},Se.prototype.UpdateUserSharingInfo=function(e){const t=e.ssrc>>10<<10,r=e.renderInfo;if(0==r.logic_w||0==r.logic_h)return;const i=1==this.renderarray.size;this.Notify_APPUI?this.Notify_APPUI(6,{body:{nodeid:t,absHeight:r.real_h,absWidth:r.real_w,height:r.logic_h,width:r.logic_w,logicHeight:r.logic_h,logicWidth:r.logic_w}}):(postMessage({status:m,logicWidth:r.logic_w,logicHeight:r.logic_h,absHeight:r.real_h,absWidth:r.real_w,nodeid:t,updateRemoteInfo:i}),i&&this.updateOffscreenCanvasSize(e.canvasId,r.logic_w,r.logic_h,!1,!0))},Se.prototype.UpdateSharingLogicWidthHeightInfo=function(e,t,r,i){const n=1==this.renderarray.size,{logic_h:s,logic_w:a,real_w:o,real_h:l}=r;!n||this.sharingWidthAndHeightInfo.logicWidth==a&&this.sharingWidthAndHeightInfo.logicHeight==s||(this.updateOffscreenCanvasSize(t,a,s,!1,i),this.PubSub?PubSub.publish("SHARING_PARAM_INFO_FROM_SOCKET",{body:{width:a,height:s,logicWidth:a,logicHeight:s,absWidth:o,absHeight:l}}):postMessage({status:m,logicWidth:a,logicHeight:s,absWidth:o,absHeight:l,nodeid:e,updateRemoteInfo:n}),this.sharingWidthAndHeightInfo.logicWidth=a,this.sharingWidthAndHeightInfo.logicHeight=s)},Se.prototype.Put_Mouse_Data_Into_Queue=function(e){const t=we(e.ssrc,e.isFromMainSession);let r=this.renderarray.get(t);if(r){r.mouseQueue.enqueue(e);for(var i=r.mouseQueue.getLength()-10;i>=0;)r.mouseQueue.dequeue(),i--}},Se.prototype.Get_Current_QueueLength=function(){var e=we(this.currentshareactive,this.isFromMainSession);let t=this.renderarray.get(e);return t?t.screenQueue.getLength():0},Se.prototype.SetcATimeStamp=function(e){this.cATimeStamp=e,this.asTime=performance.now()},Se.prototype.Log_Error=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.globalTracingLogger?this.globalTracingLogger.error(e,t):H(e,t)},Se.prototype.Log_DT=function(e){this.globalTracingLogger?this.globalTracingLogger.directReport(e):z(e)},Se.prototype.setMode=function(e){this.Stop_Draw2(),this.renderMode=e},Se.prototype.Start_Draw2=function(e){var t;null===(t=this.statisticObj)||void 0===t||t.start(),this.renderMode?(this.SharingRenderInterval&&(clearInterval(this.SharingRenderInterval),this.SharingRenderInterval=0),this.SharingRenderInterval=setInterval((()=>{this.No_Bindthis_Interval()}),20)):(this.Start_Draw(),this.startRAFHealthCheck())},Se.prototype.Stop_Draw2=function(e){var t;null===(t=this.statisticObj)||void 0===t||t.stop(),this.renderMode?this.SharingRenderInterval&&(clearInterval(this.SharingRenderInterval),this.SharingRenderInterval=0):(this.Stop_Draw(),this.stopRAFHealthCheck())},Se.prototype.startRAFHealthCheck=function(){this.RAFLastTime=performance.now(),this.RAFhealthCheckInterval=setInterval((()=>{let e=performance.now();!this.renderMode&&e-this.RAFLastTime>2e3&&(this.Stop_Draw2(),this.setMode(1),this.Start_Draw2(),this.Log_DT("Sharing RAF Failed"))}),2e3)},Se.prototype.stopRAFHealthCheck=function(){this.RAFLastTime=0,this.RAFhealthCheckInterval&&clearInterval(this.RAFhealthCheckInterval)},Se.prototype.reDraw=function(){this.brefresh=!0,this.JsMediaSDK_SharingRender()},Se.prototype.getUserIdVideo=function(e,t){const r=this.getRender(e,t),{canvasId:i,display:n,canvas:s,viewport:a}=r;if(!s||!n)return null;if(a){const{x:e,y:t,width:r,height:n}=a;return{canvasId:i,canvas:s,options:{x:e,y:t,width:r,height:n,displayWidth:r,displayHeight:n}}}const{width:o,height:l}=s;return{canvasId:i,canvas:s,options:{x:0,y:0,width:o,height:l,displayWidth:o,displayHeight:l}}};const xe=Se,Te={VIDEO_ENCODE:"0",VIDEO_DECODE:"1",AUDIO_ENCODE:"2",AUDIO_DECODE:"3",SHARING_ENCODE:"4",SHARING_DECODE:"5",WORKER_SERVICE:"6",COMMON:"7",NET:"net",MESH:"mesh"},Me=((()=>{const e={};for(const t in Te)e[Te[t]]="WCL_"+t})(),e=>btoa(String.fromCharCode(...new Uint8Array(e))));class Re{constructor(e){o(this,"process",(async()=>{if(this.processList.length){const e=this.processList.splice(0,30),t=await this.encryptData(this.mergeBuffer(e));this.writeLog(Me(t)),this.writeLog(this.EOL)}requestAnimationFrame(this.process)})),this.textEncoder=new TextEncoder,this.textDecoder=new TextDecoder,this.EOL=this.textEncoder.encode("\n"),this.processList=[],this.writeLog=e,this.key=null,this.initEncryptPromise=this.initEncrypt()}addLogData(e,t){if(!e||!t)return;const r=this.textEncoder.encode(e);this.processList.push(r),this.processList.push(t),this.processList.push(this.EOL)}async initEncrypt(){this.key=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),this.iv=crypto.getRandomValues(new Uint8Array(12));const e=new Uint8Array(await crypto.subtle.exportKey("raw",this.key)),t=new Uint8Array([0]);this.writeLog("v"),this.writeLog(this.EOL),this.writeLog(Me(t.buffer)),this.writeLog(this.EOL);const r=[e,this.iv];this.writeLog("h"),this.writeLog(this.EOL),this.writeLog(Me(this.mergeBuffer(r).buffer)),this.writeLog(this.EOL),this.startProcess()}mergeBuffer(e){const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let i=0;for(const t of e)r.set(t,i),i+=t.length;return r}async encryptData(e){return await this.initEncryptPromise,await crypto.subtle.encrypt({name:"AES-GCM",iv:this.iv},this.key,e)}startProcess(){requestAnimationFrame(this.process)}}class ke{constructor(e){this.port=null,this.cache=[],this.stopCache=!1,e&&(this.logProcesser=new Re(this.writeLog.bind(this)))}readyForLog(){}sendLog(e){}writeLog(e){this.readyForLog()?(this.stopCache||(this.cache.forEach((e=>this.sendLog(e))),this.clearCache()),this.sendLog(e)):this.stopCache||this.cache.push(e)}clearCache(){this.stopCache=!0,this.cache=[]}getTime(){const e=new Date;return e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+":"+e.getMilliseconds()}getLogData(e,t,r){if(t){var i=new Uint8Array(r?t+1:t),n=q().subarray(e+0,e+t);return i.set(n,0,t),r&&(i[t]=10),i}return e.data}writeWasmLog(e,t){const r=this.getTime(),i=this.getLogData(e,t);this.logProcesser?this.logProcesser.addLogData(r,i):(this.writeLog(r),this.writeLog(i),this.writeLog("\n"))}}class Ae extends ke{constructor(){super(!0),this.port=null,this.ready=!1}init(){let e=0;const t=r=>{"local_log_port"===r.data.command?this.port||(this.port=r.data.data):"local_log_ready"===r.data.command&&(this.ready=!0,self.removeEventListener("message",t),clearTimeout(e),this.stopCache||(this.cache.forEach((e=>this.sendLog(e))),this.clearCache()))};self.addEventListener("message",t),e=setTimeout((()=>{self.removeEventListener("message",t),this.clearCache()}),6e4)}readyForLog(){return!!this.port&&this.ready}sendLog(e){this.port.postMessage(e)}}function Ce(e){return e[0]<<24|e[1]<<16|e[2]<<8|e[3]}const Fe=function(e){return 21==e[4]&&0==e[13]},Pe=function(e){return 104==e[0]||16!=e[4]&&1!=e[5]?Ce(e.slice(19,23)):Ce(e.slice(15,19))},Le=function(e){return 103==e[0]};class De{constructor(e){let t=e||{};this.last_report_time=0,this.timeout_count=0,this.interval_report_time=t.interval||3e3,this.tag=t.tag||"monitor",this.max_timeout=0,this.min_timeout=2147483647,this.reportcallback=t.reportcallback,this._timeoutid=0}_report(){this.reportcallback&&this.reportcallback(this.tag,Math.ceil(this.max_timeout),Math.ceil(this.min_timeout),this.timeout_count),this.timeout_count=0,this.max_timeout=0,this.min_timeout=2147483647}timeoutReport(e,t){if(this.timeout_count++,e>this.max_timeout&&(this.max_timeout=e),e<this.min_timeout&&(this.min_timeout=e),this._timeoutid)return;let r=this;this._timeoutid=setTimeout((()=>{r._report(),r._timeoutid=0}),this.interval_report_time)}}class Ie{constructor(e){this._tag=e.tag||"MONITOR",this._base_time=0,this._interval_id=-1,this._timeout=Math.max(1e3,e.timeout||0),this._callback=e.callback}_report(){let e=Date.now(),t=this.getSamples(e);t||(t=[]);let r="".concat(this._base_time,":").concat(e-this._base_time,":").concat(t.join("|"));this._callback&&this._callback(this._tag,r)}getSamples(e){}onStart(){}onStop(){}start(){-1==this._interval_id&&(this._base_time=Date.now(),this._interval_id=setInterval(this._report.bind(this),this._timeout),this.onStart())}stop(){-1!=this._interval_id&&(clearInterval(this._interval_id),this._interval_id=-1,this._report(),this.onStop())}}class Oe extends Ie{constructor(e){super(e),this._count=0}onStart(){this._count=0}sample(){this._count++}getSamples(e){return[this._count]}}var Ue,Ne,We,Be,Ge,je,Ve=function(e){let t=e||{};this._report_interval=t.interval||3e4,this._customer_callback=t.report_call,this._group_interval=t.group_interval||1e3,this._tag=t.tag||"WCL_M,V",this.last_capture_time=0,this._init_report_interval=t._report_interval<1e4?t._report_interval:1e4,this.threshold=200,this._enabled=!1,this.capture_fps=0,this.capture_fps_history=[],this.capture_total_fps=0,this.capture_timeout_report=new De({interval:this._report_interval,tag:this._tag+"CAPTUREDEL",reportcallback:this._capture_timeout_report.bind(this)}),this.close_frames=0,this.close_frames_history=[],this.close_total_frames=0,this.capture_ticket_count=0,this.ref_counts=0,this.unref_counts=0,this._interval_id=0,this._timeout_id=0,this._last_update_time=0};function He(){}function ze(e,t){let r=e;r.length<4||Ne&&Be(r,Ne,We,t)}function Ye(e){}function qe(e,t){return!!Ne&&(e(Ne,t.ssrc,t.streamIndex,t.videoMode),!0)}function Xe(){return Ne}let Ke;Ve.prototype._capture_timeout_report=function(e,t,r,i){if(this._customer_callback){let n="".concat(t,",").concat(r,",").concat(i);this._customer_callback(e,n)}},Ve.prototype._report=function(){if(!this._customer_callback)return;let e=(new Date).getTime(),t="".concat(this.capture_fps_history.length,"-").concat(this.capture_fps_history.join("|")),r="".concat(this.close_frames_history.length,"-").concat(this.close_frames_history.join("|")),i="".concat(e,"-").concat(this.capture_ticket_count,"-").concat(this.capture_total_fps,"-").concat(this.ref_counts,"-").concat(t),n="".concat(e,"-").concat(this.close_total_frames,"-").concat(this.unref_counts,"-").concat(r);this._customer_callback(this._tag+"CAPTURE",i),this._customer_callback(this._tag+"FCLOSE",n)},Ve.prototype._timeout_report=function(){this._timeout_id=0,this._report()},Ve.prototype._group=function(){this.capture_fps_history.push(this.capture_fps),this.close_frames_history.push(this.close_frames),this.capture_fps=0,this.close_frames=0;let e=performance.now();e>=this._last_update_time+this._init_report_interval&&(this._report(),this.capture_fps_history=[],this.close_frames_history=[],this._last_update_time=e,this._init_report_interval<this._report_interval&&(this._init_report_interval+=5e3,this._init_report_interval>this._report_interval&&(this._init_report_interval=this._report_interval)))},Ve.prototype.closeSample=function(){this.close_frames++,this.close_total_frames++},Ve.prototype.setCloseTotalFrames=function(e){this.close_total_frames=e},Ve.prototype.captureTicket=function(){this._enabled&&this.capture_ticket_count++},Ve.prototype.captureSample=function(){if(!this._enabled)return;this.capture_fps++,this.capture_total_fps++;let e=performance.now();if(this.last_capture_time){let t=e-this.last_capture_time;t>this.threshold&&this.capture_timeout_report.timeoutReport(t,e)}this.last_capture_time=e},Ve.prototype.ref=function(){this.ref_counts++},Ve.prototype.unref=function(){this.unref_counts++},Ve.prototype.start=function(){this._enabled||(0!=this._last_update_time&&(clearTimeout(this._last_update_time),this._last_update_time=0,this._report()),this.capture_fps=0,this.capture_fps_history=[],this.capture_total_fps=0,this.close_frames=0,this.close_frames_history=[],this.close_total_frames=0,this.capture_ticket_count=0,this._last_update_time=performance.now(),this._interval_id=setInterval(this._group.bind(this),this._group_interval),this._enabled=!0)},Ve.prototype.stop=function(){this._enabled&&(this._enabled=!1,this._interval_id&&clearInterval(this._interval_id),this._interval_id=0,(this.close_frames>0||this.capture_fps>0||this.capture_fps_history.length>0||this.close_frames_history>0)&&(this._timeout_id=setTimeout(this._timeout_report.bind(this),3e3)))};const Ze=()=>Ke,Qe=function(e,t=""){if(e)return;const r=new Error(t);Ze().tracing.Log_Error(`Assert: ${t}`,r)},Je=function(e){const t=new Error(e);Ze().tracing.Log_Error(`AssertWithFailed: ${e}`,t)};function $e(e,t){const r=Math.pow(10,t);return Math.floor(e*r)/r}function et(e,t){const r=Math.pow(10,t);return Math.ceil(e*r)/r}const tt={NO_CONFIG:0,FALLBACK_TO_TAG_RENDERER_ON_CHROME:1,FALLBACK_TO_TAG_RENDERER_ON_SAFARI:2,FALLBACK_TO_TAG_RENDERER_ON_FIREFOX:4,LOWER_PERFORMANCE_DEVICE:8},rt={NO_CONFIG:0,TAG_RENDERER_ON_CHROME:1,TAG_RENDERER_ON_SAFARI:2,TAG_RENDERER_ON_FIREFOX:4},it=new class{constructor(){o(this,"_platformDesc",{supportGraphicsAcceleration:!1,supportVideoFrame:!1,supportMediaStreamTrackGenerator:!1,supportTransferableStream:!1,supportDrawWatermark:!1,supportVideoFrameInWorker:!1,supportVideoTrackGeneratorInWorker:!1,supportOffscreenCanvasInWorker:!1,supportImageBitmapRenderingInWorker:!1,supportTransferableTrackAcrossWork:!1,supportsRequestAnimationFrameInWork:!1}),o(this,"_inferedDesc",{supportVideoTagRenderer:!1}),o(this,"_analyzing_promise",null),o(this,"_main_analyzed",!1),o(this,"_remote_analyzed",!1),o(this,"_analyzedPromise",void 0),o(this,"_resolveAnalyzedPromise",void 0),this._analyzedPromise=new Promise(((e,t)=>{this._resolveAnalyzedPromise=e}))}init(e){this._platformDesc=e.platform,this._inferedDesc=e.infered,this._main_analyzed=!0,this._remote_analyzed=!0,this._resolveAnalyzedPromise(this._remote_analyzed)}desc(){return{platform:this._platformDesc,infered:this._inferedDesc}}analyzed(){return this._remote_analyzed}analyzedPromise(){return this._analyzedPromise}_analyzeInferredCapabilites(){this._inferedDesc.supportVideoTagRenderer=this._platformDesc.supportVideoFrame&&this._platformDesc.supportVideoFrameInWorker&&(!0===this._platformDesc.supportMediaStreamTrackGenerator&&!0===this._platformDesc.supportTransferableStream||!0===this._platformDesc.supportVideoTrackGeneratorInWorker)}analyze(e){if(this._analyzing_promise)return this._analyzing_promise;const t=e.analyzeMainCapabilites();return Object.assign(this._platformDesc,t),this._main_analyzed=!0,this._analyzing_promise=new Promise(((t,r)=>{e.analyzeRemoteCapabilities().then((e=>{Object.assign(this._platformDesc,e),this._analyzeInferredCapabilites(),this._remote_analyzed=!0,this._resolveAnalyzedPromise(this._remote_analyzed),t(!0)})).catch((e=>{this._resolveAnalyzedPromise(this._remote_analyzed),t(!1)}))})),this._analyzing_promise}supportGraphicsAcceleration(){return Qe(this._main_analyzed),this._platformDesc.supportGraphicsAcceleration}supportTransferableStream(){return Qe(this._main_analyzed),this._platformDesc.supportTransferableStream}supportDrawWatermark(){return Qe(this._main_analyzed),this._platformDesc.supportDrawWatermark}supportVideoTagRenderer(){return!!this._remote_analyzed&&this._inferedDesc.supportVideoTagRenderer}supportMediaStreamTrackGenerator(){return Qe(this._main_analyzed),this._platformDesc.supportMediaStreamTrackGenerator}supportVideoTrackGeneratorInWorker(){return!!this._remote_analyzed&&this._platformDesc.supportVideoTrackGeneratorInWorker}supportTransferableTrackAcrossWork(){return!!this._remote_analyzed&&this._platformDesc.supportTransferableTrackAcrossWork}supportsRequestAnimationFrameInWork(){return!!this._remote_analyzed&&this._platformDesc.supportsRequestAnimationFrameInWork}supportMediaStreamTrackProcessor(){return!!this._remote_analyzed&&this._platformDesc.supportMediaStreamTrackProcessor}};var nt=r(1265),st=r.n(nt);const at=new class{constructor(){o(this,"_info",void 0),this._info={browser:{brand:"",version:"",isBlink:!1,isWebkit:!1},sysinfo:{osType:"",os:"",osVersion:""},gpuinfo:{vendor:"",renderInfo:"",isAstcSupported:!1,isWebGLContextInvalid:!1},browserVersionInfo:{ie:"",edge:"",firefox:"",opera:"",chrome:"",safari:""},isLowerPerformanceDevice:!1,isSwiftShader:!1,isMacIntelSafari:!1},this._derived={gpuArchitecture:"unknown",normalizedOS:"",normalizedBrowser:""},this._updateDerivedInfo()}init(e){this._info=e,this._updateDerivedInfo()}info(){return this._info}browserInfo(){return this._info.browser}browserVersionInfo(){return this._info.browserVersionInfo}browserName(){var e;return null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase()}isChrome(){var e;return"chrome"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isSafari(){var e;return"safari"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isFirefox(){var e;return"firefox"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isEdge(){var e;return"edge"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isBlink(){return this._info.browser.isBlink}isWebkit(){return this._info.browser.isWebkit}isLowerPerformanceDevice(){return!!this._info.isLowerPerformanceDevice}_updateDerivedInfo(){this._derived.normalizedOS=this._computeNormalizedOS(),this._derived.normalizedBrowser=this._computeNormalizedBrowser(),this._derived.gpuArchitecture=this._computeGPUArchitecture()}_computeGPUArchitecture(){var e,t;const r=(null===(e=this._info.gpuinfo)||void 0===e?void 0:e.vendor)||"",i=(null===(t=this._info.gpuinfo)||void 0===t?void 0:t.renderInfo)||"",n=r.toLowerCase(),s=i.toLowerCase(),a=e=>n.includes(e)||s.includes(e);if(this.isSafari())return this._info.isMacIntelSafari?"intel":"apple";if(a("intel"))return"intel";if(a("nvidia")||a("geforce"))return"nvidia";if(a("amd")||a("radeon")||a("ati"))return"amd";if(a("apple")||a("m1")||a("m2")||a("m3"))return"apple";if(a("qualcomm")||a("adreno"))return"qualcomm";if(a("mediatek")||a("mtk"))return"mediatek";if(a("mali"))return"mali";if(a("arm"))return"arm";if(n){var o;const e=st()(o=n.replace(/[^a-z0-9]+/g," ")).call(o).split(" ")[0];if(e)return e.toLowerCase()}return"unknown"}_computeNormalizedOS(){var e;const t=(null===(e=this._info.sysinfo)||void 0===e||null===(e=e.os)||void 0===e?void 0:e.toLowerCase())||"";return"ios"===t?"ios":t.includes("android")?"android":t.includes("chrome os")||t.includes("chromium os")?"chromeos":t.includes("mac")?"mac":t.includes("win")?"win":t.includes("linux")?"linux":t}_computeNormalizedBrowser(){var e,t;return(null===(e=this._info.browser)||void 0===e||null===(e=e.brand)||void 0===e||null===(t=e.toLocaleLowerCase)||void 0===t?void 0:t.call(e))||""}isOnWhitelist(e){if(!Array.isArray(e)||0===e.length)return!1;const t=this._derived.gpuArchitecture,r=this._derived.normalizedOS,i=this._derived.normalizedBrowser,n=!!this._info.isLowerPerformanceDevice,s=!!this._info.isSwiftShader;return e.some((e=>{var a;if("string"!=typeof e)return!1;const o=st()(e).call(e).toLowerCase();if("low-device"===o)return n;if("swift-shader"===o)return s;const[l,c,u]=o.split("/");if(!l||!c)return!1;const h=st()(l).call(l),d=st()(c).call(c),_=st()(a=u||"").call(a);return!(h&&h!==t||d&&!r.includes(d)&&!d.includes(r)||_&&_!==i)}))}},ot=new class{constructor(){o(this,"_desc",{blockConfig:void 0,defaultRendererType:1,isEnableCanvasCtxOptionsOpt:!1,isEnableFallbackToTagRender:!1,isEnableWasmTagRenderer:!1,safariYuvPaddingFixVer:void 0,chromeYuvLeftTopPaddingFixVer:void 0,disableVideoTagOnEdge:void 0,preferredUseSsrcStream:void 0,canUseSsrcStream:void 0,isUseSsrcStream:!1,shouldCropWasmFrameOnPosMismatch:void 0,shouldCropWasmFrameOnSizeMismatchOnly:void 0,avStreamMode:void 0,baseScriptUrl:"",cssPixelScale:1,isVideoHasWaterMark:!1,isSharingHasWaterMark:!1,videoWatermarkInfo:void 0,sharingWatermarkInfo:void 0}),o(this,"_configDone",!1),o(this,"_configDonePromise",void 0),o(this,"_resolveConfigDonePromise",void 0),this._configDonePromise=new Promise(((e,t)=>{this._resolveConfigDonePromise=e}))}_tryResetDerivedConfigIfNeeded(){this._configDone&&(this._desc.canUseSsrcStream=void 0,this._desc.shouldCropWasmFrameOnPosMismatch=void 0,this._desc.shouldCropWasmFrameOnSizeMismatchOnly=void 0)}init(e){this._desc=e,this._configDone=!0}setBlockConfig(e){if(!e)return;this._desc.blockConfig=e;const t=e.safariYuvPaddingFixVer;t&&this.setSafariYuvPaddingFixVer(t);const r=e.chromeYuvLeftTopPaddingFixVer;r&&this.setChromeYuvLeftTopPaddingFixVer(r);const i=e.disableVideoTagOnEdge;"true"===i&&this.setDisableVideoTagOnEdge(i)}configDone(){return this._configDone}configDonePromise(){return this._configDonePromise}markConfigDone(){this._configDone=!0,this._resolveConfigDonePromise(!0)}desc(){return this._desc}preferredUseSsrcStream(){var e;return void 0!==this._desc.preferredUseSsrcStream?!!this._desc.preferredUseSsrcStream:this.canUseSsrcStream()?(this._desc.preferredUseSsrcStream=at.isOnWhitelist((null===(e=this._desc.blockConfig)||void 0===e?void 0:e.SsrcStreamPreferredWhitelist)||[]),this._desc.preferredUseSsrcStream):(this._desc.preferredUseSsrcStream=!1,!1)}defaultRendererType(){return this._desc.defaultRendererType}setDefaultRendererType(e){this._desc.defaultRendererType=e,this._tryResetDerivedConfigIfNeeded()}isEnableCanvasCtxOptionsOpt(){return this._desc.isEnableCanvasCtxOptionsOpt}setIsEnableCanvasCtxOptionsOpt(e){this._desc.isEnableCanvasCtxOptionsOpt=e,this._tryResetDerivedConfigIfNeeded()}isEnableWasmTagRenderer(){return this._desc.isEnableWasmTagRenderer}setWasmTagRendererFlags(e){let t=!1;at.isBlink()?(t=!!(e&rt.TAG_RENDERER_ON_CHROME),at.isEdge()&&this._desc.disableVideoTagOnEdge&&(t=!1)):at.isWebkit()?t=!!(e&rt.TAG_RENDERER_ON_SAFARI):at.isFirefox()&&(t=!!(e&rt.TAG_RENDERER_ON_FIREFOX)),this._desc.isEnableWasmTagRenderer=t,this._tryResetDerivedConfigIfNeeded()}isEnableFallbackToTagRender(){return this._desc.isEnableFallbackToTagRender}setFallbackToTagRenderFlags(e){let t=!1;at.isBlink()?t=!!(e&tt.FALLBACK_TO_TAG_RENDERER_ON_CHROME):at.isWebkit()?t=!!(e&tt.FALLBACK_TO_TAG_RENDERER_ON_SAFARI):at.isFirefox()&&(t=!!(e&tt.FALLBACK_TO_TAG_RENDERER_ON_FIREFOX)),t||at.isLowerPerformanceDevice()&&(t=!!(e&tt.LOWER_PERFORMANCE_DEVICE)),this._desc.isEnableFallbackToTagRender=t,this._tryResetDerivedConfigIfNeeded()}canUseSsrcStream(){return!!this._configDone&&(void 0!==this._desc.canUseSsrcStream?this._desc.canUseSsrcStream:it.supportVideoTagRenderer()?it.supportGraphicsAcceleration()&&!at.isLowerPerformanceDevice()||!this.isEnableFallbackToTagRender()?this.isEnableWasmTagRenderer()?(this._desc.canUseSsrcStream=!0,this._desc.canUseSsrcStream):(this._desc.canUseSsrcStream=!1,!1):(this._desc.canUseSsrcStream=!0,this._desc.canUseSsrcStream):(this._desc.canUseSsrcStream=!1,!1))}isUseSsrcStream(){return this._desc.isUseSsrcStream}setIsUseSsrcStream(e){this._desc.isUseSsrcStream=e}setSafariYuvPaddingFixVer(e){"[object String]"===Object.prototype.toString.call(e)&&(this._desc.safariYuvPaddingFixVer=e)}setChromeYuvLeftTopPaddingFixVer(e){"[object String]"===Object.prototype.toString.call(e)&&(this._desc.chromeYuvLeftTopPaddingFixVer=e)}setDisableVideoTagOnEdge(e){this._desc.disableVideoTagOnEdge=e}_versionGreaterThan(e,t){const r=t.toString().split("."),i=e.toString().split("."),n=r.length,s=i.length,a=Math.min(n,s);for(let e=0;e<a;e++){const t=parseInt(r[e],10),n=parseInt(i[e],10);if(t!==n)return n>t}return s>=n}_logWasmFrameOnPosMismatch(e){Ze().tracing.Log_DT("[vtagq] WasmFrameOnPosMismatch: ".concat(e?"Crop":"No Crop"))}shouldCropWasmFrameOnPosMismatch(){return!!this._configDone&&(void 0!==this._desc.shouldCropWasmFrameOnPosMismatch?this._desc.shouldCropWasmFrameOnPosMismatch:this.isUseSsrcStream()?(this._desc.shouldCropWasmFrameOnPosMismatch=!0,at.isChrome()?this._desc.chromeYuvLeftTopPaddingFixVer&&this._versionGreaterThan(at.browserVersionInfo().chrome,this._desc.chromeYuvLeftTopPaddingFixVer)&&(this._desc.shouldCropWasmFrameOnPosMismatch=!1):at.isSafari()&&this._desc.safariYuvPaddingFixVer&&this._versionGreaterThan(at.browserVersionInfo().safari,this._desc.safariYuvPaddingFixVer)&&(this._desc.shouldCropWasmFrameOnPosMismatch=!1),this._logWasmFrameOnPosMismatch(this._desc.shouldCropWasmFrameOnPosMismatch),this._desc.shouldCropWasmFrameOnPosMismatch):(this._desc.shouldCropWasmFrameOnPosMismatch=!1,this._logWasmFrameOnPosMismatch(!1),!1))}_logWasmFrameOnSizeMismatch(e){Ze().tracing.Log_DT("[vtagq] WasmFrameOnSizeMismatch: ".concat(e?"Crop":"No Crop"))}shouldCropWasmFrameOnSizeMismatchOnly(){return!!this._configDone&&(void 0!==this._desc.shouldCropWasmFrameOnSizeMismatchOnly?this._desc.shouldCropWasmFrameOnSizeMismatchOnly:this.isUseSsrcStream()&&at.isWebkit()?(at.isSafari()&&this._desc.safariYuvPaddingFixVer&&this._versionGreaterThan(at.browserVersionInfo().safari,this._desc.safariYuvPaddingFixVer)?this._desc.shouldCropWasmFrameOnSizeMismatchOnly=!1:this._desc.shouldCropWasmFrameOnSizeMismatchOnly=!0,this._logWasmFrameOnSizeMismatch(this._desc.shouldCropWasmFrameOnSizeMismatchOnly),this._desc.shouldCropWasmFrameOnSizeMismatchOnly):(this._desc.shouldCropWasmFrameOnSizeMismatchOnly=!1,this._logWasmFrameOnSizeMismatch(!1),!1))}shouldCropWasmFrame(e,t,r){return!!this._configDone&&(e!=r.width||t!=r.height)&&(ot.shouldCropWasmFrameOnSizeMismatchOnly()||ot.shouldCropWasmFrameOnPosMismatch()&&(0!=r.x||0!=r.y))}getAVStreamMode(){return this._configDone?(void 0!==this._desc.avStreamMode||(it.supportTransferableStream()?this._desc.avStreamMode="writable-stream":it.supportTransferableTrackAcrossWork()?this._desc.avStreamMode="track":this._desc.avStreamMode="none"),this._desc.avStreamMode):"none"}getBaseScriptUrl(){return this._desc.baseScriptUrl}setBaseScriptUrl(e){this._desc.baseScriptUrl=e}getCssPixelScale(){return this._desc.cssPixelScale}setCssPixelScale(e){this._desc.cssPixelScale=e}isVideoHasWaterMark(){return this._desc.isVideoHasWaterMark}setIsVideoHasWaterMark(e){this._desc.isVideoHasWaterMark=e,this._tryResetDerivedConfigIfNeeded()}isSharingHasWaterMark(){return this._desc.isSharingHasWaterMark}setIsSharingHasWaterMark(e){this._desc.isSharingHasWaterMark=e,this._tryResetDerivedConfigIfNeeded()}getVideoWatermarkInfo(){return this._desc.videoWatermarkInfo}setVideoWatermarkInfo(e){this._desc.videoWatermarkInfo=e}getSharingWatermarkInfo(){return this._desc.sharingWatermarkInfo}setSharingWatermarkInfo(e){this._desc.sharingWatermarkInfo=e}},lt={mgr:null,config:ot,capabilities:it,userAgent:at,tracing:{add_monitor(e){j(e)},globaltracing_error(e,t=null){H(e,t)},Log_Error(e,t=null){V(e,t)},Log_DT(e){var t;t=e,G?N.directReport(t):z(t)}},graphics:{create_webgl_context_failed_monitor(e){Y(e)},calculateUVCoord:(e,t,r,i)=>function(e,t,r,i){if(!e||!t||!r)return null;const n=t.width/t.height;let s=t.width,a=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);s*=n,a*=n}let o=0,l=0;e.width/e.height>n?(l=Math.floor(e.height/a)*a,o=Math.floor(l*n/s)*s,o>e.width&&(o=Math.floor(e.width/s)*s,l=Math.floor(o/n/a)*a)):(o=Math.floor(e.width/s)*s,l=Math.floor(o/n/a)*a,l>e.height&&(l=Math.floor(e.height/a)*a,o=Math.floor(l*n/s)*s));let c=0,u=0,h=0,d=0,_={x:u,y:c,w:h,h:d};0==i?(c=1-(c+(a-1)/e.height),u=t.left/e.width,d=1-t.top/e.height,h=u+s/e.width,_.x=u,_.y=1-d,_.w=h,_.h=1-c):1==i?(u=1-(c+(a-1)/e.height),h=1-t.top/e.height,c=t.left/e.width,d=u+s/e.width):2==i?(c=t.top/e.height,u=t.left/e.width,d=c+(a-1)/e.height,h=u+s/e.width):3==i&&(u=t.top/e.height,h=c+(a-1)/e.height,c=t.left/e.width,d=u+s/e.width);let f=[],p=[{x:h,y:d},{x:h,y:c},{x:u,y:c},{x:h,y:d},{x:u,y:d},{x:u,y:c}];for(let e=0;e<p.length;++e){let t={u:p[e].x,v:p[e].y};f.push(t)}let m=[];for(let e=0;e<f.length;++e){let t=f[e];m.push(t.u),m.push(t.v)}return{uvCoords:m,uvRect:_}}(e,t,r,i),calculateUVCoordsForMultiView:(e,t,r,i,n,s)=>function(e,t,r,i,n,s){let a=0,o=0,l=0,c=0,u={x:o,y:a,w:l,h:c};if(e){const e=1==n||3==n?t.height/t.width:t.width/t.height,s=i.left||0,u=i.top||0;if(i.width/i.height>e){const t=i.height*e;a=u/r.height,o=(Math.round((i.width-t)/2)+s)/r.width,c=a+(i.height-1)/r.height,l=o+t/r.width}else{const t=i.width/e;a=(Math.round((i.height-t)/2)+u)/r.height,o=s/r.width,c=a+(t-1)/r.height,l=o+i.width/r.width}0==n?(a=1-(a+(i.height-1)/r.height),o=i.left/r.width,c=1-i.top/r.height,l=o+i.width/r.width):1==n?(o=1-(a+(i.height-1)/r.height),l=1-i.top/r.height,a=i.left/r.width,c=o+i.width/r.width):2==n?(a=i.top/r.height,o=i.left/r.width,c=a+(i.height-1)/r.height,l=o+i.width/r.width):3==n&&(o=i.top/r.height,l=a+(i.height-1)/r.height,a=i.left/r.width,c=o+i.width/r.width)}else{const e=i.width/i.height;let t=i.width,s=i.height;if(i.width>r.width||i.height>r.height){const e=r.width/i.width,n=r.height/i.height,a=Math.min(e,n);t*=a,s*=a}let h=0,d=0;r.width/r.height>e?(d=Math.floor(r.height/s)*s,h=Math.floor(d*e/t)*t,h>r.width&&(h=Math.floor(r.width/t)*t,d=Math.floor(h/e/s)*s)):(h=Math.floor(r.width/t)*t,d=Math.floor(h/e/s)*s,d>r.height&&(d=Math.floor(r.height/s)*s,h=Math.floor(d*e/t)*t)),0==n?(a=1-(a+(s-1)/r.height),o=i.left/r.width,c=1-i.top/r.height,l=o+t/r.width,u.x=o,u.y=1-c,u.w=l,u.h=1-a,i.height>i.width&&(o=et(o,2),l=$e(l,2))):1==n?(o=1-(a+(s-1)/r.height),l=1-i.top/r.height,a=i.left/r.width,c=o+t/r.width):2==n?(a=i.top/r.height,o=i.left/r.width,c=a+(s-1)/r.height,l=o+t/r.width):3==n&&(o=i.top/r.height,l=a+(s-1)/r.height,a=i.left/r.width,c=o+t/r.width)}let h=[],d=[{x:l,y:c},{x:l,y:a},{x:o,y:a},{x:l,y:c},{x:o,y:c},{x:o,y:a}];for(let e=0;e<d.length;++e){let t=null;if(s){let r=-1*Math.abs(d[e].x);d[e].x=r,t={u:d[e].x+1,v:d[e].y}}else t={u:d[e].x,v:d[e].y};h.push(t)}let _=[];for(let e=0;e<h.length;++e){let t=h[e];_.push(t.u),_.push(t.v)}return{uvCoords:_,uvRect:u}}(e,t,r,i,n,s),calculateRenderRect:(e,t)=>function(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}}(e,t),evalCroppingRect:(e,t)=>function(e,t){if(!e||null==t)throw new Error("evalCroppingRect() invalid parameters!");return 1===t||3===t?{top:e.top,left:e.left,width:e.height,height:e.width}:e}(e,t)},assertion:{assert(e,t=""){Qe(e,t)},assertWithFailed(e){Je(e)},abstractMethod(){!function(){const e=new Error("call abstract method!");Ze().tracing.Log_Error("AbstractMethod!",e)}()},unreachable(){!function(){const e=new Error("Unreachable code reached!");Ze().tracing.Log_Error("Unreachable!",e)}()}}},ct=new class{constructor(){this.moduleCache=new Map,globalThis.__dyn_modules__={}}loadModuleFromBlob(e,t,r){if(this.moduleCache.has(e))return this.moduleCache.get(e);this.moduleCache.set(e,void 0);try{let i;const n=URL.createObjectURL(t);return Qe("function"==typeof importScripts),importScripts(n),i=globalThis.__dyn_modules__[e],i&&"function"==typeof i.init&&(i.init(lt,r),this.moduleCache.set(e,i)),i}catch(t){V(`[DynModuleMgr] loadModuleFromBlob Error: ${e}`,t)}}getModule(e){return this.moduleCache.get(e)||void 0}};function ut(e,t,r){ht(e,t),t.set(e,r)}function ht(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dt(e,t,r){return e.set(ft(e,t),r),r}function _t(e,t){return e.get(ft(e,t))}function ft(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,vt=new WeakMap,yt=new WeakSet;function bt(){return!0}function wt(){if(_t(gt,this)){let e={};return e.architecture=_t(gt,this).architecture,e.vendor=_t(gt,this).vendor,e}return null}async function St(){if(!navigator.gpu)return dt(pt,this,1),!1;const e=await navigator.gpu.requestAdapter();return e?await e.requestDevice()?("function"==typeof e.requestAdapterInfo?(dt(gt,this,await e.requestAdapterInfo()),_t(gt,this)&&console.log("adapter info: ".concat(_t(gt,this).architecture,", ").concat(_t(gt,this).vendor))):"info"in e&&dt(gt,this,e.info),dt(pt,this,de),!0):(dt(pt,this,3),!1):(dt(pt,this,2),!1)}function Et(e){if(!e)return!1;const t=e.vendor;return-1!==_e.indexOf(t)}function xt(e,t,r){return Tt.produce(e,t,r)}class Tt{static produce(e,t,r){let i=null;return 2===e&&(i=ct.getModule("webgpu_renderer_dynmod").exports.createWebGPURenderer(t,r)),i}}const Mt=class{constructor(){var e;ht(this,e=yt),e.add(this),ut(this,pt,de),ut(this,mt,1),ut(this,gt,null),ut(this,vt,new Map)}async evaluate(e){if(dt(mt,this,1),!ft(yt,this,bt).call(this))return _t(mt,this);if(!e.allowedOnTargetPlatforms)return _t(mt,this);if(!e.allowedOnTargetBrowsers)return _t(mt,this);if(!await ft(yt,this,St).call(this))return _t(mt,this);const t=ft(yt,this,wt).call(this);if(!ft(yt,this,Et).call(this,t))return _t(mt,this);let r=new OffscreenCanvas(1,1);return r.getContext("webgpu")?(r=null,dt(mt,this,2),_t(mt,this)):(r=null,_t(mt,this))}acquireRenderer(e,t){let r=null;return arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&_t(vt,this).clear(),_t(vt,this).has(e)&&(r=_t(vt,this).get(e),r&&(e&&(r.setCanvas(e),r.initialize(e)),t&&r.setDevice(t.acquireGPUDevice()))),null==r&&(r=ft(yt,this,xt).call(this,_t(mt,this),e,t),r&&_t(vt,this).set(e,r)),r}rendererReinitialize(){if(_t(vt,this))for(const[e,t]of _t(vt,this))t&&t.initialize(e)}rendererUnconfigureGPUContext(){if(_t(vt,this))for(const[e,t]of _t(vt,this))t&&t.unconfigureGPUContext()}getRendererType(){return _t(mt,this)}loadRenderModuleFromBlob(e,t){t&&(2===e?ct.loadModuleFromBlob("webgpu_renderer_dynmod",t):Je("Invalid render module for ".concat(e)))}setRendererType(e){dt(mt,this,e)}isWebGPURendererType(){return 2===_t(mt,this)}isWebGLRendererType(){return 1===_t(mt,this)}isWebGL2RendererType(){return 3===_t(mt,this)}cleanup(){for(const[e,t]of _t(vt,this))t&&t.cleanup();_t(vt,this).clear()}};function Rt(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var kt=new WeakSet;function At(e){e.forEach((e=>{e.consumePendingGPUEvents()}))}function Ct(e){return!e||0==e.length||-1==e.findIndex((e=>!!e&&(!!e.getTextureLayerByZIndex(0)&&e.isRenderingStateReady())))}const Ft=class{constructor(){var e,t;(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e=this,t=kt),t.add(e)}render(e,t){e?e.isGPUDeviceReady()?t&&0!=t.length?(Rt(kt,this,At).call(this,t),Rt(kt,this,Ct).call(this,t)||e.render(t)):j("WGPU RendererController_render() displays are not available!"):j("WGPU RendererController_render() GPU device is not ready!"):j("WGPU RendererController_render() renderer is not attached!")}};function Pt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function Lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Pt(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}let Dt=new Map,It=[];function Ot(e){e.preventDefault()}function Ut(e,t,r,i,n,s,a){let o=arguments.length>7&&void 0!==arguments[7]&&arguments[7];this.canvasElement=e,this.canvasID=t,this.contextOptions=n,this.textureindex=r||0,this.initmask=!!a,this.isEnableCanvasAlphaChannel=o,Ut.prototype.ROTATION_CLOCK0=0,Ut.prototype.ROTATION_CLOCK90=1,Ut.prototype.ROTATION_CLOCK180=2,Ut.prototype.ROTATION_CLOCK270=3,this.webGLResources=s,s||(this.initContextGL(),this.contextGL&&(this.webGLContextLostProtect(),this.contextGL.isContextLost()&&this.restoreContext())),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.vertexPos=[0,0,0,0],this.texturePos=[0,0,0,0],this.reinit(s);var l=new ArrayBuffer(4);this.dummpyCursor=new Uint8Array(l),this.dummpyWaterMark=new Uint8Array(l),this.cursorWidth=0,this.cursorHeight=0,this.hasCursor=0,this.lastcursorSyncId=-1,this.hasWaterMark=0,this.watermarkOpacity=.15,this.watermarkWidth=0,this.watermarkHeight=0,this.isMultiView=!1,this.hasWholeFrame=0,this.croppingParams={},this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.width=0,this.croppingParams.height=0,this.textureWidth=0,this.textureHeight=0,this.viewWidth=0,this.viewHeight=0,this.picRotation=-1,this.bgColor=[0,0,0],this.cx=0,this.cy=0,this.cw=0,this.ch=0,this.colorRange=-1,this.videoMode=-1,this.rotation=this.ROTATION_CLOCK0,this.fillMode=0,this.fillModeForResolution=0,this.viewPostion=null,this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=fe,this.viewport_rect=null}Ut.prototype.isLocalDisplay=function(){return 0==this.textureindex},Ut.prototype.reinit=function(e){if(this.webGLResources=e,!this.contextGL||this.contextGL.isContextLost()||this.contextGL.glInitSucceed||this.webGLResources){if(this.webGLResources&&this.webGLResources.contextgl&&!this.webGLResources.contextgl.isContextLost()){this.contextGL=this.webGLResources.contextgl,this.shaderProgram=this.webGLResources.program,this.vertexPosBuffer=this.webGLResources.vBuffer,this.texturePosBuffer=this.webGLResources.tBuffer,this.webglTexturePos=this.webGLResources.webglTexturePos,this.webglVertexPos=this.webGLResources.webglVertexPos,this.initTextures(!1);let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}}else{this.initProgram(),this.initmask?this.initTextures(!1):this.initTextures(!0),this.initBuffers();let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}},Ut.prototype.webGLContextLostSimulate=function(){const e=ee(this.contextGL,"WEBGL_lose_context");null==e||e.loseContext()},Ut.prototype.restoreContext=function(){if(this.contextGL)try{var e,t;null!==(e=this.canvasElement)&&void 0!==e&&e.loseContextExtension&&!this.canvasElement.restoreTimeoutId&&this.contextGL.isContextLost()&&(this.canvasElement.restoreTimeoutId=setTimeout((()=>{this.canvasElement.reportcontextloss||(this.canvasElement.reportcontextloss=!0,Y("WebGLRestoreTimeout")),this.canvasElement.restoreTimeoutId=0}),1500),null===(t=this.canvasElement)||void 0===t||t.loseContextExtension.restoreContext())}catch(e){V("webgl restoreContext exception",e)}},Ut.prototype.webgGLContextLostCallback=function(e){z("webglcontextlost event: canvas listener size=".concat(It.length,", canvas id: ").concat(this.canvasID,", , ids:").concat(It.join())),e.preventDefault(),this.contextGL.glInitSucceed=0,this.contextOptions&&this.contextOptions.webglcontextlostCallback&&this.contextOptions.webglcontextlostCallback(e,this.contextOptions.params)},Ut.prototype.removeEventListener=function(e,t){if(e&&t){e.restoreTimeoutId&&(clearTimeout(e.restoreTimeoutId),e.restoreTimeoutId=void 0),e.removeEventListener("webglcontextlost",t.contextLostHandler),e.removeEventListener("webglcontextrestored",t.contextRestoredHandler);const r=It.indexOf(this.canvasID);It.splice(r,1),Dt.delete(e)}},Ut.prototype.webGLContextRestoredCallback=function(e){var t,r;z("webglcontextrestored event from canvas id: ".concat(this.canvasID)),this.canvasElement.restoreTimeoutId&&(clearTimeout(this.canvasElement.restoreTimeoutId),this.canvasElement.restoreTimeoutId=void 0),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.reinit(),null===(t=this.contextOptions)||void 0===t||null===(r=t.webglcontextrestoredCallback)||void 0===r||r.call(t,e,this.contextOptions.params)},Ut.prototype.webGLContextLostProtect=function(){this.canvasElement&&!this.canvasElement.loseContextExtension&&(this.canvasElement.loseContextExtension=ee(this.contextGL,"WEBGL_lose_context"));let e=this.canvasElement,t=Dt.get(e);t&&this.removeEventListener(e,t),Dt.set(e,this),this.contextLostHandler=this.webgGLContextLostCallback.bind(this),this.contextRestoredHandler=this.webGLContextRestoredCallback.bind(this),e.addEventListener("webglcontextlost",this.contextLostHandler,{capture:!1}),e.addEventListener("webglcontextrestored",this.contextRestoredHandler,{capture:!1}),-1===It.indexOf(this.canvasID)&&(It.push(this.canvasID),It.length>4&&z("webglcanvas listener size=".concat(It.length,", ids:").concat(It.join())))},Ut.prototype.isWebGL=function(){return this.contextGL},Ut.prototype.isAvaiable=function(){return this.contextGL&&!this.contextGL.isContextLost()&&this.contextGL.glInitSucceed},Ut.prototype.initContextGL=function(){for(var e,t,r,i=this.canvasElement,n=null,s=["webgl","experimental-webgl","moz-webgl","webkit-3d"],a=0;!n&&a<s.length;){var o=s[a];try{if(Ze().config.isEnableCanvasCtxOptionsOpt()){let e={depth:!1,stencil:!1,antialias:!1,alpha:this.isEnableCanvasAlphaChannel};if(this.contextOptions){let t=Lt(Lt({},this.contextOptions),e);n=i.getContext(o,t)}else n=i.getContext(o,e)}else n=this.contextOptions?i.getContext(o,this.contextOptions):i.getContext(o)}catch(e){n=null}n&&"function"==typeof n.getParameter||(n=null),++a}if(this.contextGL=n,!n||n.isContextLost())return V("Failed when trying to get WebGLContext on canvas(".concat(null===(e=this.canvasElement)||void 0===e?void 0:e.width,",").concat(null===(t=this.canvasElement)||void 0===t?void 0:t.height,"), gl=").concat(n,", lost=").concat(null===(r=n)||void 0===r?void 0:r.isContextLost())),void Y("InitWebGLFail");n.glInitSucceed=0},Ut.prototype.initProgram=function(){var e=this.contextGL,t=e.createShader(e.VERTEX_SHADER);e.shaderSource(t,"\n attribute vec4 vertexPos;\n attribute vec4 texturePos;\n attribute vec4 masktexturePos;\n varying vec2 textureCoord;\n varying vec2 masktextureCoord;\n\n void main() {\n gl_Position = vertexPos;\n textureCoord = texturePos.xy;\n masktextureCoord = masktexturePos.xy;\n }\n "),e.compileShader(t),e.getShaderParameter(t,e.COMPILE_STATUS)||e.isContextLost()||z("webgl Vertex shader failed to compile: "+e.getShaderInfoLog(t));var r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,"\n precision highp float;\n varying highp vec2 textureCoord;\n varying highp vec2 masktextureCoord;\n\n uniform sampler2D ySampler;\n uniform sampler2D uSampler;\n uniform sampler2D vSampler;\n uniform sampler2D cursorSampler;\n uniform sampler2D waterMarkSampler;\n uniform sampler2D previewVideoSampler;\n uniform sampler2D maskSampler;\n\n uniform vec4 cursorInfo;\n uniform int onlyRGBA;\n uniform int bgraMode;\n uniform int colorRange;\n uniform int waterMarkFlag;\n uniform int cursorFlag;\n uniform int yuvmode;\n\n const int MAX_ELLIPSE_COUNT = 10;\n uniform int maskFlag; // 0: mask disabled; 1: mask enabled;\n uniform int maskMode; // 0: static mask; 1: dynamic mask;\n uniform vec4 uEllipses[MAX_ELLIPSE_COUNT]; // each ellipse contains (cx, cy, rx, ry) 4-coords\n uniform int uEllipseCount; // how many ellipses will draw\n\n // rounded corner feature in gl shader\n uniform float u_enable_rounded_corner;\n uniform float u_radius_lt_x;\n uniform float u_radius_lt_y;\n uniform float u_radius_lb_x;\n uniform float u_radius_lb_y;\n uniform float u_radius_rt_x;\n uniform float u_radius_rt_y;\n uniform float u_radius_rb_x;\n uniform float u_radius_rb_y;\n uniform float u_aa_width;\n uniform vec4 u_viewport_rect;\n\n const mat4 YUV2RGB_L = mat4(\n 1.1643828125, 0, 1.59602734375, -0.87078515625,\n 1.1643828125, -0.39176171875, -0.81296875, 0.52959375,\n 1.1643828125, 2.017234375, 0, -1.081390625,\n 0, 0, 0, 1\n );\n\n const mat4 YUV2RGB_F = mat4(\n 1.0, 0, 1.402, -0.701,\n 1.0, -0.34413, -0.71414, 0.529135,\n 1.0, 1.772, 0, -0.886,\n 0, 0, 0, 1\n );\n\n void main(void) {\n vec4 c;\n if (waterMarkFlag != 1) {\n if (onlyRGBA == 0) {\n highp float y = texture2D(ySampler, textureCoord).r;\n highp float u;\n highp float v;\n\n if (yuvmode == 1) {\n u = texture2D(uSampler, textureCoord).r;\n v = texture2D(vSampler, textureCoord).r;\n } else {\n u = texture2D(uSampler, textureCoord).r;\n v = texture2D(uSampler, textureCoord).a;\n }\n\n if (colorRange == 0) {\n c = vec4(y, u, v, 1) * YUV2RGB_L;\n } else {\n c = vec4(y, u, v, 1) * YUV2RGB_F;\n }\n\n if (cursorFlag == 1) {\n if (cursorInfo.z > 0.0 &&\n textureCoord.x >= cursorInfo.x &&\n textureCoord.y >= cursorInfo.y &&\n textureCoord.x < cursorInfo.x + cursorInfo.z &&\n textureCoord.y < cursorInfo.y + cursorInfo.w) {\n\n vec2 cursorCoord = textureCoord - cursorInfo.xy;\n cursorCoord /= cursorInfo.zw;\n vec4 cursor = texture2D(cursorSampler, cursorCoord);\n c = c * (1.0 - cursor.a) + cursor * cursor.a;\n }\n }\n } else {\n c = texture2D(previewVideoSampler, textureCoord);\n if (bgraMode == 1) {\n c = vec4(c.b, c.g, c.r, c.a);\n }\n }\n } else {\n c = texture2D(waterMarkSampler, textureCoord);\n if (c.r == 0.0 && c.g == 0.0 && c.b == 0.0) {\n c.a = 0.0;\n }\n }\n\n if (maskFlag == 1 && waterMarkFlag != 1) {\n vec4 mask = texture2D(maskSampler, masktextureCoord);\n if (maskMode == 0) {\n // -- handle static mask --\n if (mask.r != 0.0 || mask.g != 0.0 || mask.b != 0.0) {\n c = mask * mask.a + c * (1.0 - mask.a);\n }\n } else if (maskMode == 1) {\n // -- handle dynamic mask --\n bool inEllipse = false; // variable for checking whether the pixel to be drawn hits ellipse\n for (int i = 0; i < MAX_ELLIPSE_COUNT; i++) {\n if (i > uEllipseCount) break;\n\n vec2 ellipseCenter = uEllipses[i].xy;\n vec2 ellipseRadii = uEllipses[i].zw;\n vec2 ellipsePos = masktextureCoord - ellipseCenter;\n\n float ellipseEq = (ellipsePos.x * ellipsePos.x) / (ellipseRadii.x * ellipseRadii.x) +\n (ellipsePos.y * ellipsePos.y) / (ellipseRadii.y * ellipseRadii.y);\n if (ellipseEq <= 1.0) {\n // the pixel in the ellipse range\n inEllipse = true;\n break;\n }\n }\n\n if (inEllipse) {\n c = mask * mask.a + c * (1.0 - mask.a);\n }\n }\n }\n\n if (waterMarkFlag != 1) {\n c.a = 1.0;\n }\n\n if (u_enable_rounded_corner < 0.5) {\n gl_FragColor = c;\n return;\n }\n\n // step 1: viewport coordinate mapping\n // convert the fragment coordinate(canvas coordinate) to the viewport coordinate\n // for example, a viewport={x: 100, y: 100, w: 200, h: 160}, a fragCoord.xy={x:120, y: 120}\n // we can get the pos={x: 20, y: 20}\n vec2 pos = gl_FragCoord.xy - u_viewport_rect.xy;\n vec2 viewportSize = u_viewport_rect.zw;\n\n // convert the normalized radius to pixel value\n float r_lt_x = u_radius_lt_x * viewportSize.x;\n float r_lt_y = u_radius_lt_y * viewportSize.y;\n float r_rt_x = u_radius_rt_x * viewportSize.x;\n float r_rt_y = u_radius_rt_y * viewportSize.y;\n float r_lb_x = u_radius_lb_x * viewportSize.x;\n float r_lb_y = u_radius_lb_y * viewportSize.y;\n float r_rb_x = u_radius_rb_x * viewportSize.x;\n float r_rb_y = u_radius_rb_y * viewportSize.y;\n\n // step 2: calculate the rounded corner mask (as alpha)\n float alpha = 1.0;\n\n // --- calculation of the left-top corner ---\n // Condition: if (pos.x < r_lt_x && pos.y < r_lt_y)\n float in_lt = (1.0 - step(r_lt_x, pos.x)) * (1.0 - step(r_lt_y, pos.y));\n // the circle center of the left-top corner in pixel coordinate\n vec2 center_lt = vec2(r_lt_x, r_lt_y);\n // calculate and normalize the distance between the fragment and the center\n vec2 diff_lt = (pos - center_lt) / vec2(r_lt_x, r_lt_y);\n float normDist_lt = length(diff_lt);\n // smoothstep function is used to calculate the alpha value\n float mask_lt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lt);\n float final_lt = mix(1.0, mask_lt, in_lt);\n\n // --- calculation of the right-top corner ---\n float in_rt = (1.0 - step(r_rt_x, viewportSize.x - pos.x)) * (1.0 - step(r_rt_y, pos.y));\n vec2 center_rt = vec2(viewportSize.x - r_rt_x, r_rt_y);\n vec2 diff_rt = (pos - center_rt) / vec2(r_rt_x, r_rt_y);\n float normDist_rt = length(diff_rt);\n float mask_rt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rt);\n float final_rt = mix(1.0, mask_rt, in_rt);\n\n // --- calculation of the left-bottom corner ---\n float in_lb = (1.0 - step(r_lb_x, pos.x)) * (1.0 - step(r_lb_y, viewportSize.y - pos.y));\n vec2 center_lb = vec2(r_lb_x, viewportSize.y - r_lb_y);\n vec2 diff_lb = (pos - center_lb) / vec2(r_lb_x, r_lb_y);\n float normDist_lb = length(diff_lb);\n float mask_lb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lb);\n float final_lb = mix(1.0, mask_lb, in_lb);\n\n // --- calculation of the right-bottom corner ---\n float in_rb = (1.0 - step(r_rb_x, viewportSize.x - pos.x)) * (1.0 - step(r_rb_y, viewportSize.y - pos.y));\n vec2 center_rb = vec2(viewportSize.x - r_rb_x, viewportSize.y - r_rb_y);\n vec2 diff_rb = (pos - center_rb) / vec2(r_rb_x, r_rb_y);\n float normDist_rb = length(diff_rb);\n float mask_rb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rb);\n float final_rb = mix(1.0, mask_rb, in_rb);\n\n // Get the minimum value from the four corners (to ensure that if any corner requires transparency it is applied)\n float finalAlpha = min(min(final_lt, final_rt), min(final_lb, final_rb));\n\n // Final output color\n gl_FragColor = vec4(c.rgb, c.a * finalAlpha);\n }\n"),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)||e.isContextLost()||z("webgl Fragment shader failed to compile: "+e.getShaderInfoLog(r));var i=e.createProgram();e.attachShader(i,t),e.attachShader(i,r),e.linkProgram(i),e.getProgramParameter(i,e.LINK_STATUS)||e.isContextLost()||z("webgl Program failed to compile: "+e.getProgramInfoLog(i)),e.useProgram(i),this.shaderProgram=i},Ut.prototype.initBuffers=function(){var e=this.contextGL,t=this.shaderProgram,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1,1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var i=e.getAttribLocation(t,"vertexPos");e.enableVertexAttribArray(i),e.vertexAttribPointer(i,2,e.FLOAT,!1,0,0),this.vertexPosBuffer=r;var n=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1,1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var s=e.getAttribLocation(t,"texturePos");if(e.enableVertexAttribArray(s),e.vertexAttribPointer(s,2,e.FLOAT,!1,0,0),this.initmask&&!this.masktexturePosBuffer){var a=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,a),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var o=e.getAttribLocation(t,"masktexturePos");e.enableVertexAttribArray(o),e.vertexAttribPointer(o,2,e.FLOAT,!1,0,0),this.masktexturePosBuffer=a}this.texturePosBuffer=n},Ut.prototype.initTextures=function(e){var t=this.contextGL,r=this.shaderProgram;t.pixelStorei(t.UNPACK_ALIGNMENT,1);var i=this.initTexture();this.yTextureRef=i,this.oyTextureRef=i;var n=this.initTexture();this.uTextureRef=n,this.ouTextureRef=n;var s=this.initTexture();this.vTextureRef=s,this.ovTextureRef=s,e&&this.BindTextures(1),this.waterMarkTextureRef=this.initTexture();var a=t.getUniformLocation(r,"waterMarkSampler");t.uniform1i(a,5),this.waterMarkSamplerRef=a;var o=this.initTexture(),l=t.getUniformLocation(r,"cursorSampler");if(t.uniform1i(l,4),this.cursorTextureRef=o,this.cursorSamplerRef=l,this.cursorInfoRef=t.getUniformLocation(r,"cursorInfo"),this.initmask){t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1);var c=this.initTexture(),u=t.getUniformLocation(r,"maskSampler");t.uniform1i(u,4),this.maskTextureRef=c}this.colorRangeRef=t.getUniformLocation(r,"colorRange"),this.onlyRGBARef=t.getUniformLocation(r,"onlyRGBA"),this.bgraModeRef=t.getUniformLocation(r,"bgraMode"),this.waterMarkFlagRef=t.getUniformLocation(r,"waterMarkFlag"),this.maskFlagRef=t.getUniformLocation(r,"maskFlag"),this.cursorFlagRef=t.getUniformLocation(r,"cursorFlag"),this.yuvmodeRef=t.getUniformLocation(r,"yuvmode"),this.ul_enable_rounded_corner=t.getUniformLocation(r,"u_enable_rounded_corner"),this.ul_radius_lt_x=t.getUniformLocation(r,"u_radius_lt_x"),this.ul_radius_lt_y=t.getUniformLocation(r,"u_radius_lt_y"),this.ul_radius_lb_x=t.getUniformLocation(r,"u_radius_lb_x"),this.ul_radius_lb_y=t.getUniformLocation(r,"u_radius_lb_y"),this.ul_radius_rt_x=t.getUniformLocation(r,"u_radius_rt_x"),this.ul_radius_rt_y=t.getUniformLocation(r,"u_radius_rt_y"),this.ul_radius_rb_x=t.getUniformLocation(r,"u_radius_rb_x"),this.ul_radius_rb_y=t.getUniformLocation(r,"u_radius_rb_y"),this.ul_aa_width=t.getUniformLocation(r,"u_aa_width"),this.ul_viewport_rect=t.getUniformLocation(r,"u_viewport_rect")},Ut.prototype.BindTextures=function(e){var t=this.contextGL,r=this.shaderProgram;if(t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.activeTexture(t.TEXTURE0+0),t.bindTexture(t.TEXTURE_2D,this.yTextureRef),t.activeTexture(t.TEXTURE0+1),t.bindTexture(t.TEXTURE_2D,this.uTextureRef),t.activeTexture(t.TEXTURE0+2),t.bindTexture(t.TEXTURE_2D,this.vTextureRef),1==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,1);let n=t.getUniformLocation(r,"vSampler");t.uniform1i(n,2)}else if(this.isRGBAMode(e)){let e=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"ySampler");t.uniform1i(i,0);let n=t.getUniformLocation(r,"uSampler");t.uniform1i(n,0);let s=t.getUniformLocation(r,"vSampler");t.uniform1i(s,0)}else if(2==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,1);let n=t.getUniformLocation(r,"vSampler");t.uniform1i(n,0)}let i=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(i,0);let n=t.getUniformLocation(r,"maskSampler");this.initmask?(t.activeTexture(t.TEXTURE0+4),t.bindTexture(t.TEXTURE_2D,this.maskTextureRef),t.uniform1i(n,4)):t.uniform1i(n,0);let s=t.getUniformLocation(r,"cursorSampler");t.uniform1i(s,0);let a=t.getUniformLocation(this.shaderProgram,"waterMarkSampler");t.uniform1i(a,5)},Ut.prototype.initTexture=function(){var e=this.contextGL,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),t},Ut.prototype.clearDisplay=function(){var e=this.contextGL;e&&(e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT))},Ut.prototype.cleanup=function(){let e=this.canvasElement,t=Dt.get(e);if(t&&this.removeEventListener(e,t),e.defaultContextLostHandler||(e.defaultContextLostHandler=Ot,e.addEventListener("webglcontextlost",Ot,{capture:!1})),this.cleanupRoundedCornerRadius(),this.isAvaiable()){var r=this.contextGL;r.deleteProgram(this.program),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE1),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE2),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE3),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE4),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE5),r.bindTexture(r.TEXTURE_2D,null),r.bindBuffer(r.ARRAY_BUFFER,null),r.deleteTexture(this.yTextureRef),r.deleteTexture(this.uTextureRef),r.deleteTexture(this.vTextureRef),r.deleteTexture(this.cursorTextureRef),r.deleteTexture(this.waterMarkTextureRef),r.deleteBuffer(this.vertexPosBuffer),r.deleteBuffer(this.texturePosBuffer),this.maskTextureRef&&r.deleteTexture(this.maskTextureRef),this.masktexturePosBuffer&&r.deleteBuffer(this.masktexturePosBuffer),r.glInitSucceed=0}},Ut.prototype.updataVertexInfoForSharing=function(){const[e,t,r,i]=this.vertexPos,n=this.webglVertexPos[0],s=this.webglVertexPos[3];if(e!=n||s!=i){this.webglVertexPos[0]=e,this.webglVertexPos[1]=t,this.webglVertexPos[2]=r,this.webglVertexPos[3]=i;var a=new Float32Array([r,t,e,t,r,i,e,i,1,1,-1,1,1,-1,-1,-1]),o=this.contextGL;o.bindBuffer(o.ARRAY_BUFFER,this.vertexPosBuffer),o.bufferData(o.ARRAY_BUFFER,a,o.DYNAMIC_DRAW)}},Ut.prototype.updateTextureInfoForSharing=function(){const[e,t,r,i]=this.texturePos,n=this.webglTexturePos[0],s=this.webglTexturePos[3];if(e!=n||s!=i){this.webglTexturePos[0]=e,this.webglTexturePos[1]=t,this.webglTexturePos[2]=r,this.webglTexturePos[3]=i;var a=new Float32Array([r,t,e,t,r,i,e,i,1,0,0,0,1,1,0,1]),o=this.contextGL;o.bindBuffer(o.ARRAY_BUFFER,this.texturePosBuffer),o.bufferData(o.ARRAY_BUFFER,a,o.DYNAMIC_DRAW)}},Ut.prototype.updateVertexInfoForMultiView=function(e,t,r,i,n){var s,a,o,l,c=this.contextGL;if(this.isUseFillMode({width:r,height:i,rotation:n}))s=0,a=0,o=1,l=1;else{var u=n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?i:r,h=n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?r:i,d=u/h*t;d>e?(s=0,o=1,l=1-(a=(t-h/u*e)/2/t)):(a=0,l=1,o=1-(s=(e-d)/2/e))}s=2*s-1,o=2*o-1,a=1-2*a,l=1-2*l;var _=new Float32Array([o,a,s,a,o,l,s,l,1,1,-1,1,1,-1,-1,-1]);this.viewPostion=_,c.bindBuffer(c.ARRAY_BUFFER,this.vertexPosBuffer),c.bufferData(c.ARRAY_BUFFER,_,c.DYNAMIC_DRAW)},Ut.prototype.getViewPosition=function(){let e=[0,0,1,1];if(!this.viewPostion)return e;const t=this.viewPostion[0],r=this.viewPostion[1],i=this.viewPostion[2],n=this.viewPostion[5];return e[0]=(1-r)/2,e[1]=(1+i)/2,e[2]=(1-n)/2,e[3]=(1+t)/2,e},Ut.prototype.updateTextureInfoForMultiView=function(e,t,r,i,n,s,a){var o,l,c,u,h=this.contextGL;if(this.isUseFillMode({width:r.width,height:r.height,rotation:i})){const n=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?a/s:s/a,h=r.left||0,d=r.top||0;if(r.width/r.height>n){const i=r.height*n;o=d/t,l=(Math.round((r.width-i)/2)+h)/e,c=(d+r.height)/t,u=l+i/e}else{const i=r.width/n;c=(o=(Math.round((r.height-i)/2)+d)/t)+i/t,u=(l=h/e)+r.width/e}}else o=et(r.top/t,2),l=et(r.left/e,2),c=$e((r.top+r.height)/t,2),u=$e((r.width+r.left)/e,2);var d=[l,o,u,o,u,c,l,c];i==this.ROTATION_CLOCK90&&(d.unshift(d[6],d[7]),d=d.slice(0,8)),i==this.ROTATION_CLOCK180&&(d.unshift(d[4],d[5],d[6],d[7]),d=d.slice(0,8)),i==this.ROTATION_CLOCK270&&(d.push(d[0],d[1]),d=d.slice(2,10));var _=d[0],f=d[1];if(d[0]=d[2],d[1]=d[3],d[2]=_,d[3]=f,n)if(i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270){let e=d[1];d[1]=d[3],d[3]=e,e=d[5],d[5]=d[7],d[7]=e}else d[0]=1-d[0],d[2]=1-d[2],d[4]=1-d[4],d[6]=1-d[6];var p=new Float32Array([...d,1,0,0,0,1,1,0,1]);h.bindBuffer(h.ARRAY_BUFFER,this.texturePosBuffer),h.bufferData(h.ARRAY_BUFFER,p,h.DYNAMIC_DRAW)},Ut.prototype.drawNextOutputPictureFrame=function(e,t,r,i,n){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=arguments.length>6?arguments[6]:void 0,o=!(arguments.length>7&&void 0!==arguments[7])||arguments[7];if(!this.isAvaiable())return;var l=this.contextGL,c=this.yTextureRef,u=this.uTextureRef,h=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),n=n||this.ROTATION_CLOCK0;var d=(r=r||{top:0,left:0,width:e,height:t}).width!=this.croppingParams.width||r.height!=this.croppingParams.height,_=(r.top!=this.croppingParams.top||(r.left,this.croppingParams.left),a.width!=this.viewWidth||a.height!=this.viewHeight),f=(e!=this.textureWidth||this.textureHeight,n!=this.picRotation);(d||_||f)&&function(e,t,r,i,n){let s=n.width,a=n.height;var o,l,c,u,h=i==e.ROTATION_CLOCK90||i==e.ROTATION_CLOCK270?r:t,d=i==e.ROTATION_CLOCK90||i==e.ROTATION_CLOCK270?t:r,_=h/d*a;_>s?(o=0,c=1,u=1-(l=(a-d/h*s)/2/a)):(l=0,u=1,c=1-(o=(s-_)/2/s)),o=parseFloat((2*o-1).toFixed(3)),c=parseFloat((2*c-1).toFixed(3)),l=parseFloat((1-2*l).toFixed(3)),u=parseFloat((1-2*u).toFixed(3)),e.vertexPos=[o,l,c,u]}(this,r.width,r.height,n,a),this.updataVertexInfoForSharing(),function(e,t,r,i,n){var s=i.top/r,a=i.left/t,o=(i.top+i.height)/r,l=(i.left+i.width)/t,c=[a,s,l,s,l,o,a,o];n==e.ROTATION_CLOCK90&&(c.unshift(c[6],c[7]),c=c.slice(0,8)),n==e.ROTATION_CLOCK180&&(c.unshift(c[4],c[5],c[6],c[7]),c=c.slice(0,8)),n==e.ROTATION_CLOCK270&&(c.push(c[0],c[1]),c=c.slice(2));var u=c[0],h=c[1];c[0]=c[2],c[1]=c[3],c[2]=u,c[3]=h;var d=new Float32Array([...c,1,0,0,0,1,1,0,1]),_=e.contextGL;_.bindBuffer(_.ARRAY_BUFFER,e.texturePosBuffer),_.bufferData(_.ARRAY_BUFFER,d,_.DYNAMIC_DRAW)}(this,e,t,r,n);let p=s?0:1;p!=this.colorRange&&(l.uniform1i(this.colorRangeRef,p),this.colorRange=p),l.viewport(a.x,a.y,a.width,a.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([a.x,a.y,a.width,a.height],0),l.uniform4fv(this.ul_viewport_rect,this.viewport_rect),l.uniform1i(this.onlyRGBARef,0),l.uniform1i(this.yuvmodeRef,1),Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.picRotation=n,this.viewWidth=a.width,this.viewHeight=a.height;var m=i,g=e*t;if(l.activeTexture(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c),o){var v=m.subarray(0,g);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.UNSIGNED_BYTE,v)}var y=e/2*t/2;if(l.activeTexture(l.TEXTURE1),l.bindTexture(l.TEXTURE_2D,u),o){var b=m.subarray(g,g+y);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}var w=y;if(l.activeTexture(l.TEXTURE2),l.bindTexture(l.TEXTURE_2D,h),o){var S=m.subarray(g+y,g+y+w);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,S)}l.activeTexture(l.TEXTURE0+4),l.bindTexture(l.TEXTURE_2D,this.cursorTextureRef),this.hasCursor?l.uniform1i(this.cursorFlagRef,1):o&&l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,this.dummpyCursor),l.uniform4f(this.cursorInfoRef,this.cx,this.cy,this.cw,this.ch),this.render(),this.hasWholeFrame=1},Ut.prototype.updateCursor=function(e,t,r,i){if(this.isAvaiable()){var n=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||i!=this.lastcursorSyncId&&(this.lastcursorSyncId=i,n.activeTexture(n.TEXTURE0+4),n.bindTexture(n.TEXTURE_2D,this.cursorTextureRef),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e,t,0,n.RGBA,n.UNSIGNED_BYTE,r),this.cursorWidth=e,this.cursorHeight=t,this.hasCursor=1)}},Ut.prototype.updateCursorPosInfo=function(e,t,r,i,n){if(e&&this.hasCursor){let e=t/this.croppingParams.width,s=r/this.croppingParams.height,a=i/this.croppingParams.width,o=n/this.croppingParams.height;this.cx=e,this.cy=s,this.cw=a,this.ch=o}else this.cx=0,this.cy=0,this.cw=0,this.ch=0},Ut.prototype.isHasWholeFrame=function(){return this.hasWholeFrame},Ut.prototype.updateWatermark=function(e,t,r){if(this.isAvaiable()){var i=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||(this.hasWaterMark=1,this.watermarkWidth=e,this.watermarkHeight=t,i.activeTexture(i.TEXTURE0+5),i.bindTexture(i.TEXTURE_2D,this.waterMarkTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.watermarkWidth,this.watermarkHeight,0,i.RGBA,i.UNSIGNED_BYTE,r))}},Ut.prototype.drawWatermark=function(){if(this.isAvaiable()){var e=this.contextGL;this.isSetWatermark()&&this.watermarkWidth&&this.watermarkHeight&&(e.uniform1i(this.waterMarkFlagRef,1),e.activeTexture(e.TEXTURE0+5),e.bindTexture(e.TEXTURE_2D,this.waterMarkTextureRef),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.drawArrays(e.TRIANGLE_STRIP,4,4))}},Ut.prototype.drawRoundedCorner=function(){if(this.isAvaiable()){var e=this.contextGL;e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.uniform1f(this.ul_enable_rounded_corner,this.enable_rounded_corner),e.uniform1f(this.ul_radius_lt_x,this.radius_lt_x),e.uniform1f(this.ul_radius_lt_y,this.radius_lt_y),e.uniform1f(this.ul_radius_lb_x,this.radius_lb_x),e.uniform1f(this.ul_radius_lb_y,this.radius_lb_y),e.uniform1f(this.ul_radius_rt_x,this.radius_rt_x),e.uniform1f(this.ul_radius_rt_y,this.radius_rt_y),e.uniform1f(this.ul_radius_rb_x,this.radius_rb_x),e.uniform1f(this.ul_radius_rb_y,this.radius_rb_y),e.uniform1f(this.ul_aa_width,this.aa_width)}},Ut.prototype.cleanupRoundedCornerRadius=function(){this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=fe,this.viewport_rect=null},Ut.prototype.render=function(){if(this.isAvaiable()){var e=this.contextGL;this.drawRoundedCorner(),e.uniform1i(this.waterMarkFlagRef,0),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.drawWatermark()}},Ut.prototype.clear=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.hasCursor=0,this.watermarkHeight=0,this.watermarkWidth=0,this.watermarkRepeated=!1,this.hasWholeFrame=0,this.lastcursorSyncId=-1,this.cleanupRoundedCornerRadius(),e&&this.clearCanvas({R:0,G:0,B:0,A:0})},Ut.prototype.clearCanvas=function(e){if(this.cleanupRoundedCornerRadius(),this.isAvaiable()){var t=this.contextGL;e?t.clearColor(e.R,e.G,e.B,e.A):t.clearColor(this.bgColor[0],this.bgColor[1],this.bgColor[2],255),t.clear(t.COLOR_BUFFER_BIT)}},Ut.prototype.isRGBAMode=function(e){return-1!==[le,ce].indexOf(e)},Ut.prototype.updateRemoteVideoTextures=function(e,t,r,i,n){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=arguments.length>6?arguments[6]:void 0,o=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(!this.isAvaiable())return;var l=this.contextGL,c=this.yTextureRef,u=this.uTextureRef,h=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);const d=this.isRGBAMode(this.videoMode);if(e<=0||t<=0||!i||!i.length||i.length!=e*t*3/2&&!d||r&&(r.top<0||r.left<0||r.left+r.width>e||r.top+r.height>t))return!1;let _=s?0:1;if(this.colorRange=_,this.rotation=n,Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.viewWidth=a.width,this.viewHeight=a.height,!o)return;if(l.bindTexture(l.TEXTURE_2D,c),d)return void l.texImage2D(l.TEXTURE_2D,0,l.RGBA,e,t,0,l.RGBA,l.UNSIGNED_BYTE,i);var f=i,p=e*t,m=f.subarray(0,p);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.UNSIGNED_BYTE,m);let g=0,v=0;1==this.videoMode?(g=e/2*t/2,v=g):2==this.videoMode&&(g=e*t/2,v=0);var y=f.subarray(p,p+g);if(l.bindTexture(l.TEXTURE_2D,u),v){l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,y);var b=f.subarray(p+g,p+g+v);l.bindTexture(l.TEXTURE_2D,h),l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}else l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE_ALPHA,e/2,t/2,0,l.LUMINANCE_ALPHA,l.UNSIGNED_BYTE,y);return!0},Ut.prototype.updateRemoteVideoTexturesImageBitmap=function(e,t,r,i,n){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e<=0||t<=0||!r)return;if(!this.isAvaiable())return;var a=this.contextGL;if(this.textureWidth=e,this.textureHeight=t,Number.isNaN(n)||(this.rotation=n),Object.assign(this.croppingParams,i),!s)return;a.bindTexture(a.TEXTURE_2D,this.yTextureRef);const o=a.RGBA,l=a.RGBA,c=a.UNSIGNED_BYTE;a.texImage2D(a.TEXTURE_2D,0,o,l,c,r)},Ut.prototype.updateSelfMaskImage=function(e,t,r){if(!(e<=0||t<=0)&&r&&r.length==e*t*4&&this.isAvaiable()){var i=this.contextGL;i.bindTexture(i.TEXTURE_2D,this.maskTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e,t,0,i.RGBA,i.UNSIGNED_BYTE,r)}},Ut.prototype.VideoFlip=function(){if(this.isAvaiable()){var e=this.contextGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1)}},Ut.prototype.drawRemoteVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isAvaiable())return;var r=this.contextGL;let i=this.isRGBAMode(this.videoMode)?1:0;r.uniform1i(this.colorRangeRef,this.colorRange),this.setUniformFlag(i,this.hasCursor,this.videoMode),this.initmask&&r.uniform1i(this.maskFlagRef,1),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,t,e.width,e.height),r.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),r.uniform4fv(this.ul_viewport_rect,this.viewport_rect),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation),this.BindTextures(this.videoMode),r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.render()},Ut.prototype.readPixelsSyncRequest=function(e,t,r,i){if(this.isAvaiable()){var n,s=this.contextGL;return this.destination&&this.destination.length==r*i*4||(this.destination=new Uint8Array(r*i*4)),n=this.destination,s.flush(),s.readPixels(e,t,r,i,s.RGBA,s.UNSIGNED_BYTE,n),n}},Ut.prototype.updateSelfVideoTextures=function(e,t,r,i){let n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(!(e<=0||t<=0)&&r&&r.length%4==0&&this.isAvaiable()){var a=this.contextGL;this.textureWidth=e,this.textureHeight=t,this.rotation=s,Object.assign(this.croppingParams,i),n&&(a.bindTexture(a.TEXTURE_2D,this.yTextureRef),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,e,t,0,a.RGBA,a.UNSIGNED_BYTE,r))}},Ut.prototype.drawSelfVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.isAvaiable()){var i=this.contextGL;this.setUniformFlag(1,this.hasCursor,this.videoMode),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,r,e.width,e.height),i.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),i.uniform4fv(this.ul_viewport_rect,this.viewport_rect),t?(i.enable(i.BLEND),i.blendFunc(i.ZERO,i.ZERO),this.updateVertexInfoForMultiView(e.width,e.height,e.width,e.height,this.ROTATION_CLOCK0)):(i.enable(i.BLEND),i.blendFunc(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation)),this.BindTextures(le),this.render()}},Ut.prototype.isSetWatermark=function(){return this.hasWaterMark},Ut.prototype.setWatermarkFlag=function(e){this.hasWaterMark=e,e||(this.setWatermarkRepeated(!1),this.setWatermarkOpacity(),this.setWatermarkPosition(16))},Ut.prototype.setUniformFlag=function(e,t,r){if(this.isAvaiable()){var i=this.contextGL;i.uniform1i(this.onlyRGBARef,e),i.uniform1i(this.bgraModeRef,e&&r===ce?1:0),i.uniform1i(this.cursorFlagRef,t),e||i.uniform1i(this.yuvmodeRef,r)}},Ut.prototype.setVideoMode=function(e){this.videoMode=e},Ut.prototype.getVideoMode=function(e){return this.videoMode},Ut.prototype.setWatermarkRepeated=function(e){this.watermarkRepeated=e},Ut.prototype.isWatermarkRepeated=function(){return!!this.watermarkRepeated},Ut.prototype.setWatermarkOpacity=function(e){this.watermarkOpacity=e||.15},Ut.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Ut.prototype.setWatermarkPosition=function(e){this.watermarkPosition=e||16},Ut.prototype.getWatermarkPosition=function(){return this.watermarkPosition},Ut.prototype.setMultiView=function(e){return this.isMultiView=e},Ut.prototype.getRepeatedWatermarkUniformValue=function(){return this.isMultiView?30:7},Ut.prototype.getRepeatedWatermarkTextureValue=function(e){return this.isMultiView?e.TEXTURE30:e.TEXTURE7},Ut.prototype.setFillMode=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.fillMode=e,this.fillModeForResolution=t},Ut.prototype.getFillMode=function(){return this.fillMode},Ut.prototype.getFillModeForResolution=function(){return this.fillModeForResolution},Ut.prototype.getTextureIndex=function(){return this.textureindex},Ut.prototype.getTextureWidth=function(){return this.textureWidth},Ut.prototype.getTextureHeight=function(){return this.textureHeight},Ut.prototype.getRotation=function(){return this.rotation},Ut.prototype.getCroppingParams=function(){return this.croppingParams},Ut.prototype.getIndex=function(){return this.textureindex},Ut.prototype.getWatermarkWidth=function(){return this.watermarkWidth},Ut.prototype.getWatermarkHeight=function(){return this.watermarkHeight},Ut.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Ut.prototype.getAttachedCanvas=function(){return this.canvasElement},Ut.prototype.getCanvasId=function(){return this.canvasID},Ut.prototype.resizeCanvasTo=function(e,t){this.contextGL.canvas.width=e,this.contextGL.canvas.height=t},Ut.prototype.isUseFillMode=function(e){let{width:t,height:r,rotation:i}=e;if(!this.fillMode)return!1;if(!this.fillModeForResolution)return!0;if(!t||!r)return!1;const n=i===this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?r/t:t/r;return(Array.isArray(this.fillModeForResolution)?this.fillModeForResolution:[this.fillModeForResolution]).some((e=>Math.abs(n-e)<.01))},Ut.prototype.setRoundedCornerRadius=function(e){e?(this.radius_lt_x=e.radius_lt_x,this.radius_lt_y=e.radius_lt_y,this.radius_lb_x=e.radius_lb_x,this.radius_lb_y=e.radius_lb_y,this.radius_rt_x=e.radius_rt_x,this.radius_rt_y=e.radius_rt_y,this.radius_rb_x=e.radius_rb_x,this.radius_rb_y=e.radius_rb_y,0===this.radius_lt_x&&0===this.radius_lt_y&&0===this.radius_lb_x&&0===this.radius_lb_y&&0===this.radius_rt_x&&0===this.radius_rt_y&&0===this.radius_rb_x&&0===this.radius_rb_y?this.enable_rounded_corner=0:this.enable_rounded_corner=1):this.enable_rounded_corner=0},Ut.prototype.setAntialiasWidth=function(e){(e<=0||e>=1)&&(e=fe),this.aa_width=e};const Nt=Ut;class Wt{getVideoRenderDisplay(e,t,r,i,n){throw new Error("getVideoRenderDisplay() should be implemented by subclass.")}getRenderDisplay(e,t,r){throw new Error("getRenderDisplay() should be implemented by subclass.")}createVideoRenderDisplay(e,t,r){throw new Error("createVideoRenderDisplay() should be implemented by subclass.")}}function Bt(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function Gt(e,t){return e.get(Vt(e,t))}function jt(e,t,r){return e.set(Vt(e,t),r),r}function Vt(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var Ht=new WeakMap,zt=new WeakMap;class Yt extends Wt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),Bt(this,Ht,new Map),Bt(this,zt,!1),jt(zt,this,e)}setCanvasAlphaChannelEnability(e){jt(zt,this,e)}createVideoRenderDisplay(e,t,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=null,s=null,a=null,o=!1;return i&&(n=i.forceNoGL,s=i.contextOptions,a=i.webGLResources,o=i.initMask),new Nt(e,t,r,n,s,a,o,Gt(zt,this))}getVideoRenderDisplay(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=Gt(Ht,this).get(e);if(!s){let i=[];s=[i,[]],Gt(Ht,this).set(e,s);let a=new Nt(e,t,0,void 0,void 0,void 0,void 0,Gt(zt,this));a.setMultiView(!0),n&&n.set(e,a);let o=1;for(;o<=r;o++){const r=new Nt(e,t,o,void 0,void 0,{program:a.shaderProgram,contextgl:a.contextGL,vBuffer:a.vertexPosBuffer,tBuffer:a.texturePosBuffer,waterMarkTextureRef:a.waterMarkTextureRef,repeatedWaterMarkTextureRef:a.repeatedWaterMarkTextureRef},void 0,Gt(zt,this));r.setMultiView(!0),i.push(r)}}let a,o=Gt(Ht,this).get(e),l=o[0],c=o[1];if(o&&l[0]&&(a=l.pop(),c.push(a)),!a){const e=o?"".concat(o.length):"undefined",t=l?"".concat(l.length):"undefined";i("No Display obtained from VideoRender.Get_Display. canvasRenderArray:".concat(e," unusedRenderArray:").concat(t))}return a}onWebglContextLostForMulti(e,t){const{canvas:r}=t;let i=Gt(Ht,this).get(r);var[n,s,a]=i;[...n,...s].forEach((e=>e.clear()))}onRestoredFromLostForMulti(e,t){if(!t)return;const{canvas:r}=t;let i=Gt(Ht,this).get(r);var[n,s,a]=i;const o=[...n,...s];let l=o.find((e=>e.isLocalDisplay()));l.webglVertexPos=[0,0,0,0],l.webglTexturePos=[0,0,0,0],a.args={program:l.shaderProgram,contextgl:l.contextGL,vBuffer:l.vertexPosBuffer,tBuffer:l.texturePosBuffer,webglVertexPos:l.webglVertexPos,webglTexturePos:l.webglTexturePos},o.forEach((e=>{e!=l&&e.reinit(a.args)}))}getRenderDisplay(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=Gt(Ht,this).get(e);if(!i){let n=[],s={canvasId:t,size:1,args:{}};i=[n,[],s],Gt(Ht,this).set(e,i);const a={webglcontextlostCallback:this.onWebglContextLostForMulti.bind(this),webglcontextrestoredCallback:this.onRestoredFromLostForMulti.bind(this),params:{canvas:e,rendercanvasID:t}};let o=new Nt(e,t,0,void 0,a,void 0,void 0,Gt(zt,this));r&&r.set(e,o),n.push(o),s.args={program:o.shaderProgram,contextgl:o.contextGL,vBuffer:o.vertexPosBuffer,tBuffer:o.texturePosBuffer,webglVertexPos:o.webglVertexPos,webglTexturePos:o.webglTexturePos}}if(!i[0].length){const r=new Nt(e,t,i[2].size,void 0,void 0,i[2].args,void 0,Gt(zt,this));i[2].size++,i[0].push(r)}let n=i[0].pop();return i[1].push(n),n}recycleRenderDisplay(e,t,r){t.setWatermarkFlag(0),t.setVideoMode(-1),t.clear(r);let i=Gt(Ht,this).get(e);if(i){let e=i[0],r=i[1];r&&r.some((function(e,i){if(e===t)return r.splice(i,1),!0})),e.push(t)}}onRestoredFromContextLost(e,t,r,i,n){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=Gt(Ht,this).get(r);(!a||a.length<2)&&n("canvasRenderArray:".concat(a,", length:").concat(null==a?void 0:a.length));let o=s.get(t);if(o){o.reinit();for(let e=0;e<(null==a?void 0:a.length);e++)a[e].forEach((e=>{null==e||e.reinit({program:o.shaderProgram,contextgl:o.contextGL,vBuffer:o.vertexPosBuffer,tBuffer:o.texturePosBuffer,waterMarkTextureRef:o.waterMarkTextureRef,repeatedWaterMarkTextureRef:o.repeatedWaterMarkTextureRef})}));return r!==t&&(Gt(Ht,this).delete(r),Gt(Ht,this).set(t,a),s&&(s.delete(r),s.set(t,o))),null}}getRenderDisplayMap(){return Gt(Ht,this)}cleanup(e,t){var r;null==t||null===(r=t.cleanup)||void 0===r||r.call(t,null);for(const[e,t]of Gt(Ht,this)){const e=t[0],r=t[1];for(const t of e)t.cleanup();for(const e of r)e.cleanup()}jt(Ht,this,new Map)}cleanupByCanvas(e){if(Gt(Ht,this).get(e)){let t=Gt(Ht,this).get(e);if(t){let r=t[0],i=t[1];i.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r=[],i=[],Gt(Ht,this).delete(e)}}else{var t,r;null===(t=e.display)||void 0===t||null===(r=t.cleanup)||void 0===r||r.call(t)}}}function qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function Xt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}let Kt=new Map,Zt=[];function Qt(e){e.preventDefault()}function Jt(e,t,r,i,n,s,a){let o=arguments.length>7&&void 0!==arguments[7]&&arguments[7];this.canvasElement=e,this.canvasID=t,this.contextOptions=n,this.textureindex=r||0,this.initmask=!!a,this.isEnableCanvasAlphaChannel=o,Jt.prototype.ROTATION_CLOCK0=0,Jt.prototype.ROTATION_CLOCK90=1,Jt.prototype.ROTATION_CLOCK180=2,Jt.prototype.ROTATION_CLOCK270=3,this.webGLResources=s,s||(this.initContextGL(),this.contextGL&&(this.webGLContextLostProtect(),this.contextGL.isContextLost()&&this.restoreContext())),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.vertexPos=[0,0,0,0],this.texturePos=[0,0,0,0],this.reinit(s);var l=new ArrayBuffer(4);this.dummpyCursor=new Uint8Array(l),this.dummpyWaterMark=new Uint8Array(l),this.cursorWidth=0,this.cursorHeight=0,this.hasCursor=0,this.lastcursorSyncId=-1,this.hasWaterMark=0,this.watermarkOpacity=.15,this.watermarkData=null,this.watermarkWidth=0,this.watermarkHeight=0,this.isMultiView=!1,this.hasWholeFrame=0,this.croppingParams={},this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.width=0,this.croppingParams.height=0,this.textureWidth=0,this.textureHeight=0,this.viewWidth=0,this.viewHeight=0,this.picRotation=-1,this.bgColor=[0,0,0],this.cx=0,this.cy=0,this.cw=0,this.ch=0,this.colorRange=-1,this.videoMode=-1,this.rotation=this.ROTATION_CLOCK0,this.fillMode=0,this.fillModeForResolution=0,this.viewPostion=null,this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=fe,this.uv_rect=null}Jt.prototype.isLocalDisplay=function(){return 0==this.textureindex},Jt.prototype.reinit=function(e){if(this.webGLResources=e,!this.contextGL||this.contextGL.isContextLost()||this.contextGL.glInitSucceed||this.webGLResources){if(this.webGLResources&&this.webGLResources.contextgl&&!this.webGLResources.contextgl.isContextLost()){this.contextGL=this.webGLResources.contextgl,this.shaderProgram=this.webGLResources.program,this.vertexPosBuffer=this.webGLResources.vBuffer,this.texturePosBuffer=this.webGLResources.tBuffer,this.webglTexturePos=this.webGLResources.webglTexturePos,this.webglVertexPos=this.webGLResources.webglVertexPos,this.initTextures(!1);let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}}else{this.initProgram(),this.initmask?this.initTextures(!1):this.initTextures(!0),this.initBuffers();let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}},Jt.prototype.webGLContextLostSimulate=function(){let e="undefined"==typeof window?self:window;e.webGLEXTSimulate=e.webGLEXTSimulate||[],e.webGLEXTSimulate.push(ee(this.contextGL,"WEBGL_lose_context"))},Jt.prototype.restoreContext=function(){if(this.contextGL)try{var e;null!==(e=this.canvasElement)&&void 0!==e&&e.loseContextExtension&&!this.canvasElement.restoreTimeoutId&&this.contextGL.isContextLost()&&(this.canvasElement.restoreTimeoutId=setTimeout((()=>{this.canvasElement.reportcontextloss||(this.canvasElement.reportcontextloss=!0,Y("WebGL2RestoreTimeout")),this.canvasElement.restoreTimeoutId=0}),1500),this.canvasElement.loseContextExtension.restoreContext())}catch(e){V("webgl restoreContext exception2",e)}},Jt.prototype.webgGLContextLostCallback=function(e){z("webglcontextlost2 event: canvas listener size=".concat(Zt.length,", canvas id: ").concat(this.canvasID,", , ids:").concat(Zt.join())),e.preventDefault(),this.contextGL.glInitSucceed=0,this.contextOptions&&this.contextOptions.webglcontextlostCallback&&this.contextOptions.webglcontextlostCallback(e,this.contextOptions.params)},Jt.prototype.removeEventListener=function(e,t){if(e&&t){e.restoreTimeoutId&&(clearTimeout(e.restoreTimeoutId),e.restoreTimeoutId=void 0),e.removeEventListener("webglcontextlost",t.contextLostHandler),e.removeEventListener("webglcontextrestored",t.contextRestoredHandler);const r=Zt.indexOf(this.canvasID);Zt.splice(r,1),Kt.delete(e)}},Jt.prototype.webGLContextRestoredCallback=function(e){var t,r;z("webglcontextrestored2 event from canvas id: ".concat(this.canvasID)),this.canvasElement.restoreTimeoutId&&(clearTimeout(this.canvasElement.restoreTimeoutId),this.canvasElement.restoreTimeoutId=void 0),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.reinit(),null===(t=this.contextOptions)||void 0===t||null===(r=t.webglcontextrestoredCallback)||void 0===r||r.call(t,e,this.contextOptions.params)},Jt.prototype.webGLContextLostProtect=function(){this.canvasElement&&!this.canvasElement.loseContextExtension&&(this.canvasElement.loseContextExtension=ee(this.contextGL,"WEBGL_lose_context"));let e=this.canvasElement,t=Kt.get(e);t&&this.removeEventListener(e,t),Kt.set(e,this),this.contextLostHandler=this.webgGLContextLostCallback.bind(this),this.contextRestoredHandler=this.webGLContextRestoredCallback.bind(this),e.addEventListener("webglcontextlost",this.contextLostHandler,{capture:!1}),e.addEventListener("webglcontextrestored",this.contextRestoredHandler,{capture:!1}),-1===Zt.indexOf(this.canvasID)&&(Zt.push(this.canvasID),Zt.length>4&&z("webgl2canvas listener size=".concat(Zt.length,", ids:").concat(Zt.join())))},Jt.prototype.isWebGL2=function(){return this.contextGL},Jt.prototype.isAvaiable=function(){return this.contextGL&&!this.contextGL.isContextLost()&&this.contextGL.glInitSucceed},Jt.prototype.initContextGL=function(){for(var e,t,r,i=this.canvasElement,n=null,s=["webgl2"],a=0;!n&&a<s.length;){var o=s[a];try{if(Ze().config.isEnableCanvasCtxOptionsOpt()){let e={depth:!1,stencil:!1,antialias:!1,alpha:this.isEnableCanvasAlphaChannel};if(this.contextOptions){let t=Xt(Xt({},this.contextOptions),e);n=i.getContext(o,t)}else n=i.getContext(o,e)}else n=this.contextOptions?i.getContext(o,this.contextOptions):i.getContext(o)}catch(e){n=null}n&&"function"==typeof n.getParameter||(n=null),++a}if(this.contextGL=n,!n||n.isContextLost())return V("Failed when trying to get WebGLContext2 on canvas(".concat(null===(e=this.canvasElement)||void 0===e?void 0:e.width,",").concat(null===(t=this.canvasElement)||void 0===t?void 0:t.height,"), gl=").concat(n,", lost=").concat(null===(r=n)||void 0===r?void 0:r.isContextLost())),void Y("initWebGL2Fail");n.glInitSucceed=0},Jt.prototype.initProgram=function(){var e=this.contextGL,t=e.createShader(e.VERTEX_SHADER);e.shaderSource(t,"#version 300 es\n in vec4 vertexPos;\n in vec4 texturePos;\n in vec4 masktexturePos;\n out vec2 textureCoord;\n out vec2 masktextureCoord;\n\n void main() {\n gl_Position = vertexPos;\n textureCoord = texturePos.xy;\n masktextureCoord = masktexturePos.xy;\n }\n "),e.compileShader(t),e.getShaderParameter(t,e.COMPILE_STATUS)||e.isContextLost()||z("webgl2 Vertex shader failed to compile: "+e.getShaderInfoLog(t));var r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,"#version 300 es\n precision highp float;\n\n in highp vec2 textureCoord;\n in highp vec2 masktextureCoord;\n uniform sampler2D ySampler;\n uniform sampler2D uSampler;\n uniform sampler2D vSampler;\n uniform sampler2D cursorSampler;\n uniform sampler2D waterMarkSampler;\n uniform sampler2D previewVideoSampler;\n uniform sampler2D maskSampler;\n uniform vec4 cursorInfo;\n uniform int onlyRGBA;\n uniform int bgraMode;\n uniform int colorRange;\n uniform int waterMarkFlag;\n uniform int cursorFlag;\n uniform int maskFlag;\n uniform int yuvmode;\n\n // rounded corner feature in gl shader\n uniform float u_enable_rounded_corner;\n uniform float u_radius_lt_x;\n uniform float u_radius_lt_y;\n uniform float u_radius_lb_x;\n uniform float u_radius_lb_y;\n uniform float u_radius_rt_x;\n uniform float u_radius_rt_y;\n uniform float u_radius_rb_x;\n uniform float u_radius_rb_y;\n uniform float u_aa_width;\n uniform vec4 u_viewport_rect;\n\n const mat4 YUV2RGB_L = mat4(\n 1.1643828125, 0, 1.59602734375, -.87078515625,\n 1.1643828125, -.39176171875, -.81296875, .52959375,\n 1.1643828125, 2.017234375, 0, -1.081390625,\n 0, 0, 0, 1\n );\n\n const mat4 YUV2RGB_F = mat4(\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 out vec4 outputColor;\n\n void main(void) {\n vec4 c;\n if (waterMarkFlag != 1) {\n if (onlyRGBA == 0) {\n highp float y = texture(ySampler, textureCoord).r;\n highp float u;\n highp float v;\n if (yuvmode == 1) {\n u = texture(uSampler, textureCoord).r;\n v = texture(vSampler, textureCoord).r;\n } else {\n u = texture(uSampler, textureCoord).r;\n v = texture(uSampler, textureCoord).a;\n }\n\n if (colorRange == 0) {\n c = vec4(y, u, v, 1) * YUV2RGB_L;\n } else {\n c = vec4(y, u, v, 1) * YUV2RGB_F;\n }\n\n if (cursorFlag == 1) {\n if (cursorInfo.z > 0.0 && textureCoord.x >= cursorInfo.x && textureCoord.y >= cursorInfo.y &&\n textureCoord.x < cursorInfo.x+cursorInfo.z && textureCoord.y < cursorInfo.y+cursorInfo.w) {\n vec2 cursorCoord = textureCoord - cursorInfo.xy;\n cursorCoord /= cursorInfo.zw;\n vec4 cursor = texture(cursorSampler, cursorCoord);\n c = c*(1.0-cursor.a) + cursor*cursor.a;\n }\n }\n } else {\n c = texture(previewVideoSampler, textureCoord);\n if (bgraMode == 1) {\n c = vec4(c.b, c.g, c.r, c.a);\n }\n }\n }\n\n if (waterMarkFlag == 1) {\n c = texture(waterMarkSampler, textureCoord);\n if (c.r == 0.0 && c.g == 0.0 && c.b == 0.0) {\n c.a = 0.0;\n }\n }\n\n if (maskFlag == 1 && waterMarkFlag != 1) {\n vec4 mask = texture(maskSampler, masktextureCoord);\n if (mask.r != 0.0 || mask.g != 0.0 || mask.b != 0.0) {\n c = mask * mask.a + c * (1.0 - mask.a);\n }\n }\n\n if (waterMarkFlag != 1) {\n c.a = 1.0;\n }\n\n if (u_enable_rounded_corner < 0.5) {\n outputColor = c;\n return;\n }\n\n // step 1: viewport coordinate mapping\n // convert the fragment coordinate(canvas coordinate) to the viewport coordinate\n // for example, a viewport={x: 100, y: 100, w: 200, h: 160}, a fragCoord.xy={x:120, y: 120}\n // we can get the pos={x: 20, y: 20}\n vec2 pos = gl_FragCoord.xy - u_viewport_rect.xy;\n vec2 viewportSize = u_viewport_rect.zw;\n\n // convert the normalized radius to pixel value\n float r_lt_x = u_radius_lt_x * viewportSize.x;\n float r_lt_y = u_radius_lt_y * viewportSize.y;\n float r_rt_x = u_radius_rt_x * viewportSize.x;\n float r_rt_y = u_radius_rt_y * viewportSize.y;\n float r_lb_x = u_radius_lb_x * viewportSize.x;\n float r_lb_y = u_radius_lb_y * viewportSize.y;\n float r_rb_x = u_radius_rb_x * viewportSize.x;\n float r_rb_y = u_radius_rb_y * viewportSize.y;\n\n // step 2: calculate the rounded corner mask (as alpha)\n float alpha = 1.0;\n\n // --- calculation of the left-top corner ---\n // Condition: if (pos.x < r_lt_x && pos.y < r_lt_y)\n float in_lt = (1.0 - step(r_lt_x, pos.x)) * (1.0 - step(r_lt_y, pos.y));\n // the circle center of the left-top corner in pixel coordinate\n vec2 center_lt = vec2(r_lt_x, r_lt_y);\n // calculate and normalize the distance between the fragment and the center\n vec2 diff_lt = (pos - center_lt) / vec2(r_lt_x, r_lt_y);\n float normDist_lt = length(diff_lt);\n // smoothstep function is used to calculate the alpha value\n float mask_lt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lt);\n float final_lt = mix(1.0, mask_lt, in_lt);\n\n // --- calculation of the right-top corner ---\n float in_rt = (1.0 - step(r_rt_x, viewportSize.x - pos.x)) * (1.0 - step(r_rt_y, pos.y));\n vec2 center_rt = vec2(viewportSize.x - r_rt_x, r_rt_y);\n vec2 diff_rt = (pos - center_rt) / vec2(r_rt_x, r_rt_y);\n float normDist_rt = length(diff_rt);\n float mask_rt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rt);\n float final_rt = mix(1.0, mask_rt, in_rt);\n\n // --- calculation of the left-bottom corner ---\n float in_lb = (1.0 - step(r_lb_x, pos.x)) * (1.0 - step(r_lb_y, viewportSize.y - pos.y));\n vec2 center_lb = vec2(r_lb_x, viewportSize.y - r_lb_y);\n vec2 diff_lb = (pos - center_lb) / vec2(r_lb_x, r_lb_y);\n float normDist_lb = length(diff_lb);\n float mask_lb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lb);\n float final_lb = mix(1.0, mask_lb, in_lb);\n\n // --- calculation of the right-bottom corner ---\n float in_rb = (1.0 - step(r_rb_x, viewportSize.x - pos.x)) * (1.0 - step(r_rb_y, viewportSize.y - pos.y));\n vec2 center_rb = vec2(viewportSize.x - r_rb_x, viewportSize.y - r_rb_y);\n vec2 diff_rb = (pos - center_rb) / vec2(r_rb_x, r_rb_y);\n float normDist_rb = length(diff_rb);\n float mask_rb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rb);\n float final_rb = mix(1.0, mask_rb, in_rb);\n\n // step 3: Get the minimum value from the four corners (to ensure that if any corner requires transparency it is applied)\n float finalAlpha = min(min(final_lt, final_rt), min(final_lb, final_rb));\n\n // step 4: Final output color\n outputColor = vec4(c.rgb, c.a * finalAlpha);\n }\n "),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)||e.isContextLost()||z("webgl2 Fragment shader failed to compile: "+e.getShaderInfoLog(r));var i=e.createProgram();e.attachShader(i,t),e.attachShader(i,r),e.linkProgram(i),e.getProgramParameter(i,e.LINK_STATUS)||e.isContextLost()||z("webgl2 Program failed to compile: "+e.getProgramInfoLog(i)),e.useProgram(i),this.shaderProgram=i},Jt.prototype.initBuffers=function(){var e=this.contextGL,t=this.shaderProgram,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1,1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var i=e.getAttribLocation(t,"vertexPos");e.enableVertexAttribArray(i),e.vertexAttribPointer(i,2,e.FLOAT,!1,0,0),this.vertexPosBuffer=r;var n=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1,1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var s=e.getAttribLocation(t,"texturePos");if(e.enableVertexAttribArray(s),e.vertexAttribPointer(s,2,e.FLOAT,!1,0,0),this.initmask&&!this.masktexturePosBuffer){var a=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,a),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var o=e.getAttribLocation(t,"masktexturePos");e.enableVertexAttribArray(o),e.vertexAttribPointer(o,2,e.FLOAT,!1,0,0),this.masktexturePosBuffer=a}this.texturePosBuffer=n},Jt.prototype.initTextures=function(e){var t=this.contextGL,r=this.shaderProgram;t.pixelStorei(t.UNPACK_ALIGNMENT,1);var i=this.initTexture();this.yTextureRef=i,this.oyTextureRef=i;var n=this.initTexture();this.uTextureRef=n,this.ouTextureRef=n;var s=this.initTexture();this.vTextureRef=s,this.ovTextureRef=s,e&&this.BindTextures(1),this.waterMarkTextureRef=this.initTexture();var a=t.getUniformLocation(r,"waterMarkSampler");t.uniform1i(a,5),this.waterMarkSamplerRef=a;var o=this.initTexture(),l=t.getUniformLocation(r,"cursorSampler");if(t.uniform1i(l,4),this.cursorTextureRef=o,this.cursorSamplerRef=l,this.cursorInfoRef=t.getUniformLocation(r,"cursorInfo"),this.initmask){t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1);var c=this.initTexture(),u=t.getUniformLocation(r,"maskSampler");t.uniform1i(u,4),this.maskTextureRef=c}this.colorRangeRef=t.getUniformLocation(r,"colorRange"),this.onlyRGBARef=t.getUniformLocation(r,"onlyRGBA"),this.bgraModeRef=t.getUniformLocation(r,"bgraMode"),this.waterMarkFlagRef=t.getUniformLocation(r,"waterMarkFlag"),this.maskFlagRef=t.getUniformLocation(r,"maskFlag"),this.cursorFlagRef=t.getUniformLocation(r,"cursorFlag"),this.yuvmodeRef=t.getUniformLocation(r,"yuvmode"),this.ul_enable_rounded_corner=t.getUniformLocation(r,"u_enable_rounded_corner"),this.ul_radius_lt_x=t.getUniformLocation(r,"u_radius_lt_x"),this.ul_radius_lt_y=t.getUniformLocation(r,"u_radius_lt_y"),this.ul_radius_lb_x=t.getUniformLocation(r,"u_radius_lb_x"),this.ul_radius_lb_y=t.getUniformLocation(r,"u_radius_lb_y"),this.ul_radius_rt_x=t.getUniformLocation(r,"u_radius_rt_x"),this.ul_radius_rt_y=t.getUniformLocation(r,"u_radius_rt_y"),this.ul_radius_rb_x=t.getUniformLocation(r,"u_radius_rb_x"),this.ul_radius_rb_y=t.getUniformLocation(r,"u_radius_rb_y"),this.ul_aa_width=t.getUniformLocation(r,"u_aa_width"),this.ul_viewport_rect=t.getUniformLocation(r,"u_viewport_rect")},Jt.prototype.BindTextures=function(e){var t=this.contextGL,r=this.shaderProgram;if(t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.activeTexture(t.TEXTURE0+0),t.bindTexture(t.TEXTURE_2D,this.yTextureRef),t.activeTexture(t.TEXTURE0+1),t.bindTexture(t.TEXTURE_2D,this.uTextureRef),t.activeTexture(t.TEXTURE0+2),t.bindTexture(t.TEXTURE_2D,this.vTextureRef),1==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,1);let n=t.getUniformLocation(r,"vSampler");t.uniform1i(n,2)}else if(this.isRGBAMode(e)){let e=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"ySampler");t.uniform1i(i,0);let n=t.getUniformLocation(r,"uSampler");t.uniform1i(n,0);let s=t.getUniformLocation(r,"vSampler");t.uniform1i(s,0)}else if(2==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,1);let n=t.getUniformLocation(r,"vSampler");t.uniform1i(n,0)}let i=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(i,0);let n=t.getUniformLocation(r,"maskSampler");this.initmask?(t.activeTexture(t.TEXTURE0+4),t.bindTexture(t.TEXTURE_2D,this.maskTextureRef),t.uniform1i(n,4)):t.uniform1i(n,0);let s=t.getUniformLocation(r,"cursorSampler");t.uniform1i(s,0);let a=t.getUniformLocation(this.shaderProgram,"waterMarkSampler");t.uniform1i(a,5)},Jt.prototype.initTexture=function(){var e=this.contextGL,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),t},Jt.prototype.clearDisplay=function(){var e=this.contextGL;e&&(e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT))},Jt.prototype.cleanup=function(){let e=this.canvasElement,t=Kt.get(e);if(t&&this.removeEventListener(e,t),e.defaultContextLostHandler||(e.defaultContextLostHandler=Qt,e.addEventListener("webglcontextlost",Qt,{capture:!1})),this.cleanupRoundedCornerRadius(),this.isAvaiable()){var r=this.contextGL;r.deleteProgram(this.program),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE1),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE2),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE3),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE4),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE5),r.bindTexture(r.TEXTURE_2D,null),r.deleteTexture(this.yTextureRef),r.deleteTexture(this.uTextureRef),r.deleteTexture(this.vTextureRef),r.deleteTexture(this.cursorTextureRef),r.deleteTexture(this.waterMarkTextureRef),r.bindBuffer(r.ARRAY_BUFFER,null),r.deleteBuffer(this.vertexPosBuffer),r.deleteBuffer(this.texturePosBuffer),this.maskTextureRef&&r.deleteTexture(this.maskTextureRef),this.masktexturePosBuffer&&r.deleteBuffer(this.masktexturePosBuffer),r.glInitSucceed=0}},Jt.prototype.updateVertexInfoForSharing=function(){const[e,t,r,i]=this.vertexPos,n=this.webglVertexPos[0],s=this.webglVertexPos[3];if(e!=n||s!=i){this.webglVertexPos[0]=e,this.webglVertexPos[1]=t,this.webglVertexPos[2]=r,this.webglVertexPos[3]=i;var a=new Float32Array([r,t,e,t,r,i,e,i,1,1,-1,1,1,-1,-1,-1]),o=this.contextGL;o.bindBuffer(o.ARRAY_BUFFER,this.vertexPosBuffer),o.bufferData(o.ARRAY_BUFFER,a,o.DYNAMIC_DRAW)}},Jt.prototype.updateTextureInfoForSharing=function(){const[e,t,r,i]=this.texturePos,n=this.webglTexturePos[0],s=this.webglTexturePos[3];if(e!=n||s!=i){this.webglTexturePos[0]=e,this.webglTexturePos[1]=t,this.webglTexturePos[2]=r,this.webglTexturePos[3]=i;var a=new Float32Array([r,t,e,t,r,i,e,i,1,0,0,0,1,1,0,1]),o=this.contextGL;o.bindBuffer(o.ARRAY_BUFFER,this.texturePosBuffer),o.bufferData(o.ARRAY_BUFFER,a,o.DYNAMIC_DRAW)}},Jt.prototype.updateVertexInfoForMultiView=function(e,t,r,i,n){var s,a,o,l,c=this.contextGL;if(this.isUseFillMode({width:r,height:i,rotation:n}))s=0,a=0,o=1,l=1;else{var u=n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?i:r,h=n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?r:i,d=u/h*t;d>e?(s=0,o=1,l=1-(a=(t-h/u*e)/2/t)):(a=0,l=1,o=1-(s=(e-d)/2/e))}s=2*s-1,o=2*o-1,a=1-2*a,l=1-2*l;var _=new Float32Array([o,a,s,a,o,l,s,l,1,1,-1,1,1,-1,-1,-1]);this.viewPostion=_,c.bindBuffer(c.ARRAY_BUFFER,this.vertexPosBuffer),c.bufferData(c.ARRAY_BUFFER,_,c.DYNAMIC_DRAW)},Jt.prototype.updateTextureInfoForMultiView=function(e,t,r,i,n,s,a){var o,l,c,u,h=this.contextGL;if(this.isUseFillMode({width:r.width,height:r.height,rotation:i})){const n=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?a/s:s/a,h=r.left||0,d=r.top||0;if(r.width/r.height>n){const i=r.height*n;o=d/t,l=(Math.round((r.width-i)/2)+h)/e,c=(d+r.height)/t,u=l+i/e}else{const i=r.width/n;c=(o=(Math.round((r.height-i)/2)+d)/t)+i/t,u=(l=h/e)+r.width/e}}else o=et(r.top/t,2),l=et(r.left/e,2),c=$e((r.top+r.height)/t,2),u=$e((r.width+r.left)/e,2);var d=[l,o,u,o,u,c,l,c];i==this.ROTATION_CLOCK90&&(d.unshift(d[6],d[7]),d=d.slice(0,8)),i==this.ROTATION_CLOCK180&&(d.unshift(d[4],d[5],d[6],d[7]),d=d.slice(0,8)),i==this.ROTATION_CLOCK270&&(d.push(d[0],d[1]),d=d.slice(2,10));var _=d[0],f=d[1];if(d[0]=d[2],d[1]=d[3],d[2]=_,d[3]=f,n)if(i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270){let e=d[1];d[1]=d[3],d[3]=e,e=d[5],d[5]=d[7],d[7]=e}else d[0]=1-d[0],d[2]=1-d[2],d[4]=1-d[4],d[6]=1-d[6];var p=new Float32Array([...d,1,0,0,0,1,1,0,1]);h.bindBuffer(h.ARRAY_BUFFER,this.texturePosBuffer),h.bufferData(h.ARRAY_BUFFER,p,h.DYNAMIC_DRAW)},Jt.prototype.getViewPosition=function(){let e=[0,0,1,1];if(!this.viewPostion)return e;const t=this.viewPostion[0],r=this.viewPostion[1],i=this.viewPostion[2],n=this.viewPostion[5];return e[0]=(1-r)/2,e[1]=(1+i)/2,e[2]=(1-n)/2,e[3]=(1+t)/2,e},Jt.prototype.drawNextOutputPictureFrame=function(e,t,r,i,n){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=arguments.length>6?arguments[6]:void 0,o=!(arguments.length>7&&void 0!==arguments[7])||arguments[7];if(!this.isAvaiable())return;var l=this.contextGL,c=this.yTextureRef,u=this.uTextureRef,h=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),n=n||this.ROTATION_CLOCK0;var d=(r=r||{top:0,left:0,width:e,height:t}).width!=this.croppingParams.width||r.height!=this.croppingParams.height,_=(r.top!=this.croppingParams.top||(r.left,this.croppingParams.left),a.width!=this.viewWidth||a.height!=this.viewHeight),f=(e!=this.textureWidth||this.textureHeight,n!=this.picRotation);(d||_||f)&&function(e,t,r,i,n){e.contextGL;let s=n.width,a=n.height;var o,l,c,u,h=i==e.ROTATION_CLOCK90||i==e.ROTATION_CLOCK270?r:t,d=i==e.ROTATION_CLOCK90||i==e.ROTATION_CLOCK270?t:r,_=h/d*a;_>s?(o=0,c=1,u=1-(l=(a-d/h*s)/2/a)):(l=0,u=1,c=1-(o=(s-_)/2/s)),o=parseFloat((2*o-1).toFixed(3)),c=parseFloat((2*c-1).toFixed(3)),l=parseFloat((1-2*l).toFixed(3)),u=parseFloat((1-2*u).toFixed(3)),e.vertexPos=[o,l,c,u]}(this,r.width,r.height,n,a),this.updateVertexInfoForSharing(),function(e,t,r,i,n){var s=i.top/r,a=i.left/t,o=(i.height+i.top)/r,l=(i.left+i.width)/t,c=[a,s,l,s,l,o,a,o];n==e.ROTATION_CLOCK90&&(c.unshift(c[6],c[7]),c=c.slice(0,8)),n==e.ROTATION_CLOCK180&&(c.unshift(c[4],c[5],c[6],c[7]),c=c.slice(0,8)),n==e.ROTATION_CLOCK270&&(c.push(c[0],c[1]),c=c.slice(2));var u=c[0],h=c[1];c[0]=c[2],c[1]=c[3],c[2]=u,c[3]=h;var d=new Float32Array([...c,1,0,0,0,1,1,0,1]),_=e.contextGL;_.bindBuffer(_.ARRAY_BUFFER,e.texturePosBuffer),_.bufferData(_.ARRAY_BUFFER,d,_.DYNAMIC_DRAW)}(this,e,t,r,n);let p=s?0:1;p!=this.colorRange&&(l.uniform1i(this.colorRangeRef,p),this.colorRange=p),l.viewport(a.x,a.y,a.width,a.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([a.x,a.y,a.width,a.height],0),l.uniform4fv(this.ul_viewport_rect,this.viewport_rect),l.uniform1i(this.onlyRGBARef,0),l.uniform1i(this.yuvmodeRef,1),Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.picRotation=n,this.viewWidth=a.width,this.viewHeight=a.height;var m=i,g=e*t;if(l.activeTexture(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c),o){var v=m.subarray(0,g);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.UNSIGNED_BYTE,v)}var y=e/2*t/2;if(l.activeTexture(l.TEXTURE1),l.bindTexture(l.TEXTURE_2D,u),o){var b=m.subarray(g,g+y);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}var w=y;if(l.activeTexture(l.TEXTURE2),l.bindTexture(l.TEXTURE_2D,h),o){var S=m.subarray(g+y,g+y+w);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,S)}l.activeTexture(l.TEXTURE0+4),l.bindTexture(l.TEXTURE_2D,this.cursorTextureRef),l.uniform1i(this.cursorSamplerRef,4),this.hasCursor?l.uniform1i(this.cursorFlagRef,1):o&&l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,this.dummpyCursor),l.uniform4f(this.cursorInfoRef,this.cx,this.cy,this.cw,this.ch),this.render(),this.hasWholeFrame=1},Jt.prototype.updateCursor=function(e,t,r,i){if(this.isAvaiable()){var n=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||i!=this.lastcursorSyncId&&(this.lastcursorSyncId=i,n.activeTexture(n.TEXTURE0+4),n.bindTexture(n.TEXTURE_2D,this.cursorTextureRef),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e,t,0,n.RGBA,n.UNSIGNED_BYTE,r),this.cursorWidth=e,this.cursorHeight=t,this.hasCursor=1)}},Jt.prototype.updateCursorPosInfo=function(e,t,r,i,n){if(e&&this.hasCursor){let e=t/this.croppingParams.width,s=r/this.croppingParams.height,a=i/this.croppingParams.width,o=n/this.croppingParams.height;this.cx=e,this.cy=s,this.cw=a,this.ch=o}else this.cx=0,this.cy=0,this.cw=0,this.ch=0},Jt.prototype.isHasWholeFrame=function(){return this.hasWholeFrame},Jt.prototype.updateWatermark=function(e,t,r){if(this.isAvaiable()){var i=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||(this.hasWaterMark=1,this.watermarkWidth=e,this.watermarkHeight=t,i.activeTexture(i.TEXTURE0+5),i.bindTexture(i.TEXTURE_2D,this.waterMarkTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.watermarkWidth,this.watermarkHeight,0,i.RGBA,i.UNSIGNED_BYTE,r))}},Jt.prototype.drawWatermark=function(){if(this.isAvaiable()){var e=this.contextGL;this.isSetWatermark()&&this.watermarkWidth&&this.watermarkHeight&&(e.uniform1i(this.waterMarkFlagRef,1),e.activeTexture(e.TEXTURE0+5),e.bindTexture(e.TEXTURE_2D,this.waterMarkTextureRef),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.drawArrays(e.TRIANGLE_STRIP,4,4))}},Jt.prototype.drawRoundedCorner=function(){if(this.isAvaiable()){var e=this.contextGL;e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.uniform1f(this.ul_enable_rounded_corner,this.enable_rounded_corner),e.uniform1f(this.ul_radius_lt_x,this.radius_lt_x),e.uniform1f(this.ul_radius_lt_y,this.radius_lt_y),e.uniform1f(this.ul_radius_lb_x,this.radius_lb_x),e.uniform1f(this.ul_radius_lb_y,this.radius_lb_y),e.uniform1f(this.ul_radius_rt_x,this.radius_rt_x),e.uniform1f(this.ul_radius_rt_y,this.radius_rt_y),e.uniform1f(this.ul_radius_rb_x,this.radius_rb_x),e.uniform1f(this.ul_radius_rb_y,this.radius_rb_y),e.uniform1f(this.ul_aa_width,this.aa_width)}},Jt.prototype.cleanupRoundedCornerRadius=function(){this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=fe,this.viewport_rect=null},Jt.prototype.render=function(){if(this.isAvaiable()){var e=this.contextGL;this.drawRoundedCorner(),e.uniform1i(this.waterMarkFlagRef,0),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.drawWatermark()}},Jt.prototype.clear=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.hasCursor=0,this.watermarkHeight=0,this.watermarkWidth=0,this.watermarkRepeated=!1,this.hasWholeFrame=0,this.lastcursorSyncId=-1,this.cleanupRoundedCornerRadius(),e&&this.clearCanvas({R:0,G:0,B:0,A:0})},Jt.prototype.clearCanvas=function(e){if(this.cleanupRoundedCornerRadius(),this.isAvaiable()){var t=this.contextGL;e?t.clearColor(e.R,e.G,e.B,e.A):t.clearColor(this.bgColor[0],this.bgColor[1],this.bgColor[2],255),t.clear(t.COLOR_BUFFER_BIT)}},Jt.prototype.isRGBAMode=function(e){return-1!==[le,ce].indexOf(e)},Jt.prototype.updateRemoteVideoTextures=function(e,t,r,i,n){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=arguments.length>6?arguments[6]:void 0,o=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(!this.isAvaiable())return;var l=this.contextGL,c=this.yTextureRef,u=this.uTextureRef,h=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);const d=this.isRGBAMode(this.videoMode);if(e<=0||t<=0||!i||!i.length||i.length!=e*t*3/2&&!d||r&&(r.top<0||r.left<0||r.left+r.width>e||r.top+r.height>t))return!1;let _=s?0:1;if(this.colorRange=_,this.rotation=n,Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.viewWidth=a.width,this.viewHeight=a.height,!o)return;if(l.bindTexture(l.TEXTURE_2D,c),d)return void l.texImage2D(l.TEXTURE_2D,0,l.RGBA,e,t,0,l.RGBA,l.UNSIGNED_BYTE,i);var f=i,p=e*t,m=f.subarray(0,p);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.UNSIGNED_BYTE,m);let g=0,v=0;1==this.videoMode?(g=e/2*t/2,v=g):2==this.videoMode&&(g=e*t/2,v=0);var y=f.subarray(p,p+g);if(l.bindTexture(l.TEXTURE_2D,u),v){l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,y);var b=f.subarray(p+g,p+g+v);l.bindTexture(l.TEXTURE_2D,h),l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}else l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE_ALPHA,e/2,t/2,0,l.LUMINANCE_ALPHA,l.UNSIGNED_BYTE,y);return!0},Jt.prototype.updateRemoteVideoTexturesImageBitmap=function(e,t,r,i,n){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e<=0||t<=0||!r)return;if(!this.isAvaiable())return;var a=this.contextGL;if(this.textureWidth=e,this.textureHeight=t,Number.isNaN(n)||(this.rotation=n),Object.assign(this.croppingParams,i),!s)return;a.bindTexture(a.TEXTURE_2D,this.yTextureRef);const o=a.RGBA,l=a.RGBA,c=a.UNSIGNED_BYTE;a.texImage2D(a.TEXTURE_2D,0,o,l,c,r)},Jt.prototype.updateSelfMaskImage=function(e,t,r){if(!(e<=0||t<=0)&&r&&r.length==e*t*4&&this.isAvaiable()){var i=this.contextGL;i.bindTexture(i.TEXTURE_2D,this.maskTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e,t,0,i.RGBA,i.UNSIGNED_BYTE,r)}},Jt.prototype.VideoFlip=function(){if(this.isAvaiable()){var e=this.contextGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1)}},Jt.prototype.drawRemoteVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isAvaiable())return;var r=this.contextGL;let i=this.isRGBAMode(this.videoMode)?1:0;r.uniform1i(this.colorRangeRef,this.colorRange),this.setUniformFlag(i,this.hasCursor,this.videoMode),this.initmask&&r.uniform1i(this.maskFlagRef,1),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,t,e.width,e.height),r.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),r.uniform4fv(this.ul_viewport_rect,this.viewport_rect),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation),this.BindTextures(this.videoMode),r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.render()},Jt.prototype.readPixelsSyncRequest=function(e,t,r,i){if(this.isAvaiable()){var n,s=this.contextGL;return this.destination&&this.destination.length==r*i*4||(this.destination=new Uint8Array(r*i*4)),n=this.destination,s.flush(),s.readPixels(e,t,r,i,s.RGBA,s.UNSIGNED_BYTE,n),n}},Jt.prototype.updateSelfVideoTextures=function(e,t,r,i){let n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(!(e<=0||t<=0)&&r&&r.length%4==0&&this.isAvaiable()){var a=this.contextGL;this.textureWidth=e,this.textureHeight=t,this.rotation=s,Object.assign(this.croppingParams,i),n&&(a.bindTexture(a.TEXTURE_2D,this.yTextureRef),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,e,t,0,a.RGBA,a.UNSIGNED_BYTE,r))}},Jt.prototype.drawSelfVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.isAvaiable()){var i=this.contextGL;this.setUniformFlag(1,this.hasCursor,this.videoMode),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,r,e.width,e.height),i.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),i.uniform4fv(this.ul_viewport_rect,this.viewport_rect),t?(i.enable(i.BLEND),i.blendFunc(i.ZERO,i.ZERO),this.updateVertexInfoForMultiView(e.width,e.height,e.width,e.height,this.ROTATION_CLOCK0)):(i.enable(i.BLEND),i.blendFunc(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation)),this.BindTextures(le),this.render()}},Jt.prototype.isSetWatermark=function(){return this.hasWaterMark},Jt.prototype.setWatermarkFlag=function(e){this.hasWaterMark=e,e||(this.setWatermarkRepeated(!1),this.setWatermarkOpacity(),this.setWatermarkPosition(16))},Jt.prototype.setUniformFlag=function(e,t,r){if(this.isAvaiable()){var i=this.contextGL;i.uniform1i(this.onlyRGBARef,e),i.uniform1i(this.bgraModeRef,e&&r===ce?1:0),i.uniform1i(this.cursorFlagRef,t),e||i.uniform1i(this.yuvmodeRef,r)}},Jt.prototype.setVideoMode=function(e){this.videoMode=e},Jt.prototype.getVideoMode=function(e){return this.videoMode},Jt.prototype.setWatermarkRepeated=function(e){this.watermarkRepeated=e},Jt.prototype.isWatermarkRepeated=function(){return!!this.watermarkRepeated},Jt.prototype.setWatermarkOpacity=function(e){this.watermarkOpacity=e||.15},Jt.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Jt.prototype.setWatermarkPosition=function(e){this.watermarkPosition=e||16},Jt.prototype.getWatermarkPosition=function(){return this.watermarkPosition},Jt.prototype.setMultiView=function(e){return this.isMultiView=e},Jt.prototype.getRepeatedWatermarkUniformValue=function(){return this.isMultiView?30:7},Jt.prototype.getRepeatedWatermarkTextureValue=function(e){return this.isMultiView?e.TEXTURE30:e.TEXTURE7},Jt.prototype.setFillMode=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.fillMode=e,this.fillModeForResolution=t},Jt.prototype.getFillMode=function(){return this.fillMode},Jt.prototype.getFillModeForResolution=function(){return this.fillModeForResolution},Jt.prototype.getTextureIndex=function(){return this.textureindex},Jt.prototype.getIndex=function(){return this.textureindex},Jt.prototype.getWatermarkWidth=function(){return this.watermarkWidth},Jt.prototype.getWatermarkHeight=function(){return this.watermarkHeight},Jt.prototype.getTextureWidth=function(){return this.textureWidth},Jt.prototype.getTextureHeight=function(){return this.textureHeight},Jt.prototype.getRotation=function(){return this.rotation},Jt.prototype.getCroppingParams=function(){return this.croppingParams},Jt.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Jt.prototype.getAttachedCanvas=function(){return this.canvasElement},Jt.prototype.getCanvasId=function(){return this.canvasID},Jt.prototype.resizeCanvasTo=function(e,t){this.contextGL.canvas.width=e,this.contextGL.canvas.height=t},Jt.prototype.isUseFillMode=function(e){let{width:t,height:r,rotation:i}=e;if(!this.fillMode)return!1;if(!this.fillModeForResolution)return!0;if(!t||!r)return!1;const n=i===this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?r/t:t/r;return(Array.isArray(this.fillModeForResolution)?this.fillModeForResolution:[this.fillModeForResolution]).some((e=>Math.abs(n-e)<.01))},Jt.prototype.setRoundedCornerRadius=function(e){e?(this.radius_lt_x=e.radius_lt_x,this.radius_lt_y=e.radius_lt_y,this.radius_lb_x=e.radius_lb_x,this.radius_lb_y=e.radius_lb_y,this.radius_rt_x=e.radius_rt_x,this.radius_rt_y=e.radius_rt_y,this.radius_rb_x=e.radius_rb_x,this.radius_rb_y=e.radius_rb_y,0===this.radius_lt_x&&0===this.radius_lt_y&&0===this.radius_lb_x&&0===this.radius_lb_y&&0===this.radius_rt_x&&0===this.radius_rt_y&&0===this.radius_rb_x&&0===this.radius_rb_y?this.enable_rounded_corner=0:this.enable_rounded_corner=1):this.enable_rounded_corner=0},Jt.prototype.setAntialiasWidth=function(e){(e<=0||e>=1)&&(e=fe),this.aa_width=e};const $t=Jt;function er(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function tr(e,t){return e.get(ir(e,t))}function rr(e,t,r){return e.set(ir(e,t),r),r}function ir(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var nr=new WeakMap,sr=new WeakMap;class ar extends Wt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),er(this,nr,new Map),er(this,sr,!1),rr(sr,this,e)}setCanvasAlphaChannelEnability(e){rr(sr,this,e)}createVideoRenderDisplay(e,t,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=null,s=null,a=null,o=!1;return i&&(n=i.forceNoGL,s=i.contextOptions,a=i.webGLResources,o=i.initMask),new $t(e,t,r,n,s,a,o,tr(sr,this))}getVideoRenderDisplay(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=tr(nr,this).get(e);if(!s){let i=[];s=[i,[]],tr(nr,this).set(e,s);let a=new $t(e,t,0,void 0,void 0,void 0,void 0,tr(sr,this));a.setMultiView(!0),n&&n.set(e,a);let o=1;for(;o<=r;o++){const r=new $t(e,t,o,void 0,void 0,{program:a.shaderProgram,contextgl:a.contextGL,vBuffer:a.vertexPosBuffer,tBuffer:a.texturePosBuffer,waterMarkTextureRef:a.waterMarkTextureRef,repeatedWaterMarkTextureRef:a.repeatedWaterMarkTextureRef},void 0,void 0,tr(sr,this));r.setMultiView(!0),i.push(r)}}let a,o=tr(nr,this).get(e),l=o[0],c=o[1];if(o&&l[0]&&(a=l.pop(),c.push(a)),!a){const e=o?"".concat(o.length):"undefined",t=l?"".concat(l.length):"undefined";i("No Display obtained from VideoRender.Get_Display. canvasRenderArray:".concat(e," unusedRenderArray:").concat(t))}return a}onWebglContextLostForMulti(e,t){const{canvas:r}=t;let i=tr(nr,this).get(r);var[n,s,a]=i;[...n,...s].forEach((e=>e.clear()))}onRestoredFromLostForMulti(e,t){if(!t)return;const{canvas:r}=t;let i=tr(nr,this).get(r);var[n,s,a]=i;const o=[...n,...s];let l=o.find((e=>e.isLocalDisplay()));l.webglVertexPos=[0,0,0,0],l.webglTexturePos=[0,0,0,0],a.args={program:l.shaderProgram,contextgl:l.contextGL,vBuffer:l.vertexPosBuffer,tBuffer:l.texturePosBuffer,webglVertexPos:l.webglVertexPos,webglTexturePos:l.webglTexturePos},o.forEach((e=>{e!=l&&e.reinit(a.args)}))}getRenderDisplay(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=tr(nr,this).get(e);if(!i){let n=[],s={canvasId:t,size:1,args:{}};i=[n,[],s],tr(nr,this).set(e,i);const a={webglcontextlostCallback:this.onWebglContextLostForMulti.bind(this),webglcontextrestoredCallback:this.onRestoredFromLostForMulti.bind(this),params:{canvas:e,rendercanvasID:t}};let o=new $t(e,t,0,void 0,a,void 0,void 0,tr(sr,this));r&&r.set(e,o),n.push(o),s.args={program:o.shaderProgram,contextgl:o.contextGL,vBuffer:o.vertexPosBuffer,tBuffer:o.texturePosBuffer,webglVertexPos:o.webglVertexPos,webglTexturePos:o.webglTexturePos}}if(!i[0].length){const r=new $t(e,t,i[2].size,void 0,void 0,i[2].args,void 0,tr(sr,this));i[2].size++,i[0].push(r)}let n=i[0].pop();return i[1].push(n),n}recycleRenderDisplay(e,t,r){t.setWatermarkFlag(0),t.setVideoMode(-1),t.clear(r);let i=tr(nr,this).get(e);if(i){let e=i[0],r=i[1];r&&r.some((function(e,i){if(e===t)return r.splice(i,1),!0})),e.push(t)}}onRestoredFromContextLost(e,t,r,i,n){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=tr(nr,this).get(r);(!a||a.length<2)&&n("canvasRenderArray:".concat(a,", length:").concat(null==a?void 0:a.length));let o=s.get(t);if(o){o.reinit();for(let e=0;e<(null==a?void 0:a.length);e++)a[e].forEach((e=>{null==e||e.reinit({program:o.shaderProgram,contextgl:o.contextGL,vBuffer:o.vertexPosBuffer,tBuffer:o.texturePosBuffer,waterMarkTextureRef:o.waterMarkTextureRef,repeatedWaterMarkTextureRef:o.repeatedWaterMarkTextureRef})}));return r!==t&&(tr(nr,this).delete(r),tr(nr,this).set(t,a),s&&(s.delete(r),s.set(t,o))),null}}getRenderDisplayMap(){return tr(nr,this)}cleanup(e,t){var r;null==t||null===(r=t.cleanup)||void 0===r||r.call(t);for(const[e,t]of tr(nr,this)){const e=t[0],r=t[1];for(const t of e)t.cleanup();for(const e of r)e.cleanup()}rr(nr,this,new Map)}cleanupByCanvas(e){if(tr(nr,this).get(e)){let t=tr(nr,this).get(e);if(t){let r=t[0],i=t[1];i.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r=[],i=[],tr(nr,this).delete(e)}}else{var t,r;null===(t=e.display)||void 0===t||null===(r=t.cleanup)||void 0===r||r.call(t)}}}function or(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function lr(e,t){return e.get(ur(e,t))}function cr(e,t,r){return e.set(ur(e,t),r),r}function ur(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var hr=new WeakMap,dr=new WeakMap,_r=new WeakMap,fr=new WeakMap,pr=new WeakMap;const mr=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];or(this,hr,null),or(this,dr,null),or(this,_r,null),or(this,fr,null),or(this,pr,!1),cr(pr,this,e)}setGPUResourceMgrGetter(e){cr(fr,this,e)}isEnableCanvasAlphaChannel(){return lr(pr,this)}setCanvasAlphaChannelEnability(e){cr(pr,this,e),lr(hr,this)&&lr(hr,this).setCanvasAlphaChannelEnability(e),lr(dr,this)&&lr(dr,this).setCanvasAlphaChannelEnability(e)}getWebGLRenderDisplayMgr(){return lr(hr,this)||(cr(hr,this,new Yt(lr(pr,this))),j("[Render] getWebGLRenderDisplayMgr")),lr(hr,this)}getWebGL2RenderDisplayMgr(){return lr(dr,this)||cr(dr,this,new ar(lr(pr,this))),lr(dr,this)}getWebGPURenderDisplayMgr(){if(!lr(_r,this)){const e=ct.getModule("webgpu_renderer_dynmod");cr(_r,this,e.exports.createWebGPURenderDisplayMgr()),lr(_r,this).setGPUResourceMgrGetter(lr(fr,this).call(this,2))}return lr(_r,this)}getRenderDisplayMgr(e){switch(e){case 1:return this.getWebGLRenderDisplayMgr();case 3:return this.getWebGL2RenderDisplayMgr();case 2:return this.getWebGPURenderDisplayMgr();case 4:return Je("VIDEO_TAG has no RenderDisplayMgr!"),null;default:return null}}getVideoRenderDisplay(e,t,r,i,n){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,o=this.getRenderDisplayMgr(e).getVideoRenderDisplay(t,r,i,n,a);return o&&2===e&&(o.addRenderer(s),o.attachCanvas(t,r),o.setGPUResMgr(lr(fr,this).call(this,e))),o}getRenderDisplay(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=this.getRenderDisplayMgr(e).getRenderDisplay(t,r,n);return s&&2===e&&(s.addRenderer(i),s.attachCanvas(t,r),s.setGPUResMgr(lr(fr,this).call(this,e))),s}createVideoRenderDisplay(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=this.getRenderDisplayMgr(e).createVideoRenderDisplay(t,r,i,n,s);return a&&2===e&&(a.addRenderer(n),a.attachCanvas(t,r),a.setGPUResMgr(lr(fr,this).call(this,e))),a}recycleRenderDisplay(e,t,r,i){let n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];switch(e){case 2:lr(_r,this)&&lr(_r,this).recycleRenderDisplay(r,i,n);break;case 1:lr(hr,this)&&lr(hr,this).recycleRenderDisplay(t,r,n);break;case 3:lr(dr,this)&&lr(dr,this).recycleRenderDisplay(t,r,n);break;case 4:Je("VIDEO_TAG has no display")}}collectInUseRenderDisplays(e,t){let r=null;return 2===e&&lr(_r,this)&&(r=lr(_r,this).collectInUseRenderDisplays(t)),r}collectInUseRenderDisplaysByCanvas(e,t,r){let i=null;return 2===e&&lr(_r,this)&&(i=lr(_r,this).collectInUseRenderDisplaysByCanvas(t,r)),i}getRenderDisplayMap(e,t){if(1===e){if(lr(hr,this))return lr(hr,this).getRenderDisplayMap()}else if(2===e){if(lr(_r,this))return lr(_r,this).getRenderDisplayMap(t)}else if(3===e&&lr(dr,this))return lr(dr,this).getRenderDisplayMap(t);return null}onRestoredFromContextLost(e,t,r,i,n){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;return lr(hr,this)?lr(hr,this).onRestoredFromContextLost(e,t,r,i,n,s):lr(dr,this)?lr(dr,this).onRestoredFromContextLost(e,t,r,i,n,s):null}cleanup(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];null!==lr(hr,this)&&lr(hr,this).cleanup(e,t),lr(dr,this)&&lr(dr,this).cleanup(e,t),null!==lr(_r,this)&&lr(_r,this).cleanup(t,r)}cleanupByCanvas(e){null!==lr(hr,this)&&lr(hr,this).cleanupByCanvas(e),null!==lr(dr,this)&&lr(dr,this).cleanupByCanvas(e),null!==lr(_r,this)&&lr(_r,this).cleanupByCanvas(e)}};function gr(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function vr(e,t){return e.get(br(e,t))}function yr(e,t,r){return e.set(br(e,t),r),r}function br(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var wr=new WeakMap,Sr=new WeakMap,Er=new WeakMap,xr=new WeakMap,Tr=new WeakMap;var Mr=r(7201),Rr=r.n(Mr);function kr(e){let t=e||{};this._samples=[],this._interval_id=0,this._lasted_update_time=0,this._lasted_group_time=0,this._enable=!1,this._interval_time=t.interval||3e4,this._customer_callback=t.report_call,this._tag=t.tag||"netreport",this._group_interval=t.group_interval||1e3,this._enable_advanced=t.advanced||!1,this._current_count=0,this._qos_report=new De({tag:"jitter",interval:3e4,reportcallback:this._qos_report_timeout.bind(this)}),this._qos_report_samples=[],this._cureen_qos_report=0}kr.prototype._qos_report_timeout=function(e,t,r,i){if(this._customer_callback){let n="".concat(e,",").concat(t,",").concat(r,",").concat(i);this._customer_callback(this._tag+"TimeOut",n)}},kr.prototype._report=function(){let e=(new Date).getTime(),t="".concat(e,"-").concat(this._samples.length,"-").concat(this._samples),r="".concat(e,"-").concat(this._qos_report_samples.length,"-").concat(this._qos_report_samples);t=Rr()(t).call(t,",","|"),r=Rr()(r).call(r,",","|"),this._customer_callback?(this._customer_callback(this._tag,t),this._enable_advanced&&this._customer_callback(this._tag+"QOS",r)):console.error("tag:".concat(this._tag,",").concat(t))},kr.prototype._group=function(){let e=performance.now();if(e>=this._lasted_group_time+1700){let t=Math.round((e-this._lasted_group_time)/1e3)-1;for(let e=0;e<t;e++)this._samples.push(-1)}this._lasted_group_time=e,this._samples.push(this._current_count),this._qos_report_samples.push(this._cureen_qos_report),this._cureen_qos_report=0,this._current_count=0,e>=this._lasted_update_time+this._interval_time&&(this._lasted_update_time=e,this._report(),this._samples=[],this._qos_report_samples=[])},kr.prototype.start=function(){this._enable||(this._lasted_update_time=performance.now(),this._lasted_group_time=this._lasted_update_time,this._samples=[],this._current_count=0,this._qos_report_samples=[],this._cureen_qos_report=0,this._interval_id=setInterval(this._group.bind(this),this._group_interval),this._enable=!0)},kr.prototype.stop=function(){this._enable&&(clearInterval(this._interval_id),this._interval_id=0,this._enable=!1)},kr.prototype.sample=function(e){if(this._enable&&(this._current_count++,this._enable_advanced)){if(Fe(e))return void this._cureen_qos_report++;if(Le(e)){let t=Pe(e),r=performance.now();if(this._lasted_qos_ts){let e=r-this._lasted_sys_ts-(t-this._lasted_qos_ts);e>30&&this._qos_report.timeoutReport(e,r)}this._lasted_qos_ts=t,this._lasted_sys_ts=r,this._lasted_data=e}}};class Ar{constructor(e,t){this.sendsize=0,this.dropsize=0,this.presamples={sendsize:0,drop:0,time:0,size:0,nosendcount:0,dckbps:0,updatetime:0,smoothsend:0},this.channel=t,this.id=0,this.wraper=e,this.overusetime=0}send(e){this.sendsize+=e}drop(e){this.dropsize+=e}setbuffer(e){const t=performance.now(),{sendsize:r,drop:i,size:n,time:s}=this.presamples,a=t-s,o=this.sendsize-r,l=this.dropsize-i,c=e-n;if(a>150&&o>5e3){const r=100*l/o,i=8e3*(o-l-c)/(a*(this.presamples.nosendcount+1)),n=8e3*o/a,s=8e3*(e+l+Math.max(c/2,0)),u=0==i?5e3:s/i;if(0==i?this.presamples.nosendcount++:(this.presamples.nosendcount=0,this.presamples.dckbps=i),0==this.presamples.smoothsend)this.presamples.smoothsend=n;else{const e=.5;this.presamples.smoothsend=e*this.presamples.smoothsend+n*(1-e)}r>10&&e>16384||a<500&&u>500?0==this.overusetime?this.overusetime=Math.min(250,a)/2:this.overusetime+=Math.min(250,a):e<16384&&u<100&&(this.overusetime=0);const h=i||this.presamples.dckbps/(this.presamples.nosendcount+1),d=h/this.presamples.smoothsend;if(this.overusetime>700&&d<.75&&t>this.presamples.updatetime+3e3){const e={status:1,dckbps:h,sendkbps:this.presamples.smoothsend,overusetime:this.overusetime,nosendcount:this.presamples.nosendcount};this.wraper._onbadnet(e),this.presamples.updatetime=t}this.presamples.sendsize=this.sendsize,this.presamples.drop=this.dropsize,this.presamples.size=e,this.presamples.time=t}}start(){this.id||(this.presamples.time=performance.now(),this.id=setInterval((()=>{let e=this.channel.bufferedAmount;this.setbuffer(e)}),100))}stop(){this.id&&(clearInterval(this.id),this.id=0)}}class Cr{constructor(e,t,r,i,n,s){this.id=e,this.tag=n||"",this.type=t,this.datachannel=r,this._recv_statistic=null,this.onmessageFn=()=>{},this.disconnectedFn=null,this.connectedFn=null,this._status=Cr.UNINIT,this.target_thread=i,this.transfered=!1,this._listener=null,this.transportlists=[],this._send_statistic=null,this.report_monitor_func=()=>{},this.bsuppend=!1,this.mgr=s,this.bufferIncreaseCount=0,this.lastBufferedAmount=0,this.highWaterMarkCount=0,this.sendcount=0,this.sendStatic=null,this.enableSendStatic=!1,this.onnetbadFn=e=>{}}isReady(){return this._status===Cr.CONNECTED}isTransfered(){return!!this.transfered}send(e){if(this.enableSendStatic){if(this.sendcount++,this.sendStatic.send(e.length),this.datachannel.bufferedAmount>65536)return void this.sendStatic.drop(e.length);if(this.datachannel.bufferedAmount>32768&&(this.sendcount%5==0||21==e[4]&&1==e[1]&&51==e[13]))return void this.sendStatic.drop(e.length)}this.datachannel.send(e),this._send_statistic.sample(!1)}open(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.target_thread)try{var t;return this.target_thread.postMessage({command:134,id:this.id,type:this.type,channel:this.datachannel,transportlists:this.transportlists,tag:this.tag},[this.datachannel]),this.transfered=!0,this.datachannel=null,void(null===(t=this.mgr)||void 0===t||t.addRTCChannel(this))}catch(e){this.target_thread=null}this._addEventListener(e)}close(){var e;null===(e=this.mgr)||void 0===e||e.removeRTCChannel(this);let t=this.disconnectedFn;this.transfered&&this.target_thread&&this.target_thread.postMessage({command:135,id:this.id,type:this.type}),this._status!=Cr.DISCONNECT&&this._clear(),this._status=Cr.DISCONNECT,null==t||t()}onmessage(e){this.onmessageFn=e}onopen(e){this.connectedFn=e}onclose(e){this.disconnectedFn=e}onerror(e){this.errorFn=e}onbadnet(e){this.onnetbadFn=e||(e=>{})}_onbadnet(e){this.onnetbadFn(e)}_addEventListener(e){this.datachannel.onmessage=e?this._onmessage2.bind(this):this._onmessage.bind(this),this.datachannel.onopen=this._onopen.bind(this),this.datachannel.onclose=this._onclose.bind(this),this.datachannel.onclosing=this._onclose.bind(this),this.datachannel.onerror=this._onerror.bind(this),"open"==this.datachannel.readyState&&this._status==Cr.UNINIT&&this._onopen()}_onmessage2(e){this._status==Cr.UNINIT&&this._onopen(),this._recv_statistic.sample(!1),this.onmessageFn(e)}_onmessage(e){this._recv_statistic.sample(!1),this.onmessageFn(e)}_onopen(e){let t=this._status;if(this._status=Cr.CONNECTED,!this.transfered){const e=this.report_monitor_func;if(!this._send_statistic){const t=this.tag?this.tag+"_SEND":3==this.type?"VDCS":"ADCS";this._send_statistic=new kr({tag:t,report_call:e})}if(!this._recv_statistic){const t=this.tag?this.tag+"_RECV":3==this.type?"VDCR":"ADCR";this._recv_statistic=new kr({tag:t,report_call:e})}this._send_statistic.start(),this._recv_statistic.start(),this.enableSendStatic=3==this.type,this.sendStatic=new Ar(this,this.datachannel),this.enableSendStatic&&this.sendStatic.start()}var r;t!=Cr.CONNECTED&&(null===(r=this.connectedFn)||void 0===r||r.call(this))}_onerror(e){var t;null===(t=this.errorFn)||void 0===t||t.call(this,e),this._onclose(e)}_onclose(e){let t=this._status;this._status=Cr.DISCONNECT;let r=this.disconnectedFn;this._clear(),t!=Cr.DISCONNECT&&(null==r||r())}_clear(){var e,t,r;!this.transfered&&this.datachannel&&(this.datachannel.onmessage=null,this.datachannel.onopen=null,this.datachannel.onclose=null,this.datachannel.onclosing=null,this.datachannel.onerror=null),this.onmessageFn=null,this.connectedFn=null,this.disconnectedFn=null,this.errorFn=null;let i=this.datachannel;this.datachannel=null,null===(e=this._send_statistic)||void 0===e||e.stop(),null===(t=this._recv_statistic)||void 0===t||t.stop(),null===(r=this.sendStatic)||void 0===r||r.stop(),null==i||i.close()}mesagelistener(e){let t=e.data;if(t&&t.id==this.id)switch(t.cmd){case 126:this._onclose();break;case 124:this._onopen();break;case 125:this._onerror(t.ev);break;case u:this.report_monitor_func(t.tag,t.data)}}}o(Cr,"UNINIT",0),o(Cr,"CONNECTED",1),o(Cr,"DISCONNECT",2);class Fr{static getStorageForCapacity(){return new SharedArrayBuffer(8+((arguments.length>0&&void 0!==arguments[0]?arguments[0]:80)+1)*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500))}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e.byteLength,a=arguments.length>6?arguments[6]:void 0;this.offset=n,this._BYTES_PER_ELEMENT=t,this.capacity=(s-8)/t,this.usableCapacity=this.capacity-1,this.buf=e,this.write_ptr=new Uint32Array(this.buf,n,1),this.read_ptr=new Uint32Array(this.buf,n+4,1),this.storageUint8sByteOffset=n+8,this.storageUint8s=new Uint8Array(this.buf,this.storageUint8sByteOffset,s-8),this.byteLength=s,this.label=r,this.usingOneElementBuffer=i,a&&(this.wasmMemory=a),i&&(this.oneElementBuffer=new ArrayBuffer(t)),this.repushhander=0,this.repushlogcount=0,this.monitorpace=0}checkBuffer(){this.wasmMemory&&this.wasmMemory.buffer!=this.buf&&(this.buf=this.wasmMemory.buffer,this.storageUint8s=new Uint8Array(this.buf,this.storageUint8sByteOffset,this.byteLength-8))}enqueue(e){return this.available_write()>0&&this.push(e),{rd:Atomics.load(this.read_ptr,0),wr:Atomics.load(this.write_ptr,0)}}enqueueSafe(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;for(this.dataBuffer||(this.dataBuffer=new ge);this.dataBuffer.getLength()>0&&this.available_write()>0;){let e=this.dataBuffer.dequeue();e&&this.push(e)}let i=this.dataBuffer.getLength();if(e){if(this.available_write()>0&&0==i)return this.push(e),!0;if(!t)return!1;this.dataBuffer.enqueue(e),++i}if(i>0&&!this.repushhander&&(this.repushhander=setTimeout((()=>{this.repushlogcount%10==0&&console.warn("<<< retry consume cache data"),this.repushlogcount++,this.repushhander=0,this.enqueueSafe(null)}),30)),i>=1e3&&(N.warn("Cached data in SAB reached critical value, will be cleared"),this.dataBuffer.clear(),r&&r("vqslclear")),i>0&&r){let e=performance.now();(!this.monitorpace||e-this.monitorpace>2e4)&&(this.monitorpace=e,r&&r("vqsl"+i))}return!0}push(e){return e instanceof Array?this._pushArray(e):this._push(e)}_pushArray(e){var t=Atomics.load(this.write_ptr,0);this.checkBuffer();let r=0;e.forEach((e=>{this.storageUint8s.set(e,t*this._BYTES_PER_ELEMENT+8+4+r),r+=e.byteLength})),new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1)[0]=r;let i=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,i),!0}_push(e){var t=Atomics.load(this.write_ptr,0);this.checkBuffer(),this.storageUint8s.set(e,t*this._BYTES_PER_ELEMENT+8+4,e.byteLength),new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1)[0]=e.byteLength;let r=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,r),!0}addReadPtr(){var e=Atomics.load(this.read_ptr,0);Atomics.store(this.read_ptr,0,(e+1)%this.capacity)}dequeue(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var t=Atomics.load(this.read_ptr,0);this.checkBuffer();let r,i,n,s=new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1);if(e){r=this.oneElementBuffer?new Uint8Array(this.oneElementBuffer,0,s[0]):new Uint8Array(s[0]);let e=new Uint8Array(this.storageUint8s.buffer,t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,r.byteLength);r.set(e,0)}else r=this.storageUint8s.subarray(t*this._BYTES_PER_ELEMENT+8+4,t*this._BYTES_PER_ELEMENT+8+4+s[0]),i=t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,n=t*this._BYTES_PER_ELEMENT+8+4+s[0]+this.storageUint8sByteOffset;return e&&Atomics.store(this.read_ptr,0,(t+1)%this.capacity),e?r:{bCopyData:e,uint8s:r,begin:i,end:n}}available_read(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._available_read(e,t)}available_write(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._available_write(e,t)}is_available_write(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._is_available_write(e,t)}_available_read(e,t){return(t+this.capacity-e)%this.capacity}_available_write(e,t){return this.usableCapacity-this._available_read(e,t)}_is_available_write(e,t){return this._available_write(e,t)>0}_storage_capacity(){return this.capacity}}class Pr{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:80;if(!(e instanceof Fr))throw new Error("RingBuffer required");this.rb=e,this.dataCallback=t,this.interval=null,this.requestID=null,this.timeout_call=r,this.tick_lasted_time=0,this.timeoutMS=i,this.maxCount=n}setDataCallback(e){this.dataCallback=e}consume(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.interval||(this.bCopyData=t,this.interval=setInterval((()=>{let e=performance.now();if(this.timeout_call){if(0!=this.tick_lasted_time){let t=e-this.tick_lasted_time;t>=this.timeoutMS&&this.timeout_call(t,e)}this.tick_lasted_time=e}this._dequeue()}),e))}consumeAll(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.bCopyData=e,this._dequeue()}_dequeue(){let e=Math.min(this.rb.available_read(),this.maxCount);for(this.consoume_count=0;this.consoume_count<e;){this.consoume_count++;let e=this.rb.dequeue(this.bCopyData);this.dataCallback(e),this.bCopyData||this.rb.addReadPtr()}}_consumeForAnimationFrame(){this._dequeue(),this.requestID=requestAnimationFrame(this._consumeForAnimationFrame.bind(this))}consumeUsingRequestAnimationFrame(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.requestID||(this.bCopyData=e,this._consumeForAnimationFrame())}cancelConsume(){console.log("cancelConsume interval ".concat(this.interval," requestID ").concat(this.requestID)),this.tick_lasted_time=0,clearInterval(this.interval),this.requestID&&cancelAnimationFrame(this.requestID),this.interval=null,this.requestID=null}}function Lr(e,t,r){if(!e)return;let i=Br.dataTransportMgr;i.type===Dr.THREAD_MAIN?(i.setSabBuffer(e,t,r),e.remote.postMessage({cmd:M,transportId:e.id,sender:r,reciver:t})):(e.setSabBuffer(t,r),i.mainThread.postMessage({cmd:M,transportId:e.id,sender:r,reciver:t}))}class Dr{constructor(e){let t=e||{};this.type=t.type||Dr.THREAD_MAIN,this.refs={},this.transportlists=[],this.mainThread=t.remote,this.subthreadlistner=null,this.transportListeners=[],this.onRemoteTransportFn=()=>{}}_onrecvmainthreadlistener(e){let{cmd:t,transportId:r,data:i}=e.data,n=this.transportlists.find((e=>e.id===r));if(n||t==T)switch(t){case T:this.addRemoteTransport(e.data,null);break;case 136:n.setMsgPort(i||new Gr);break;case M:n.setSabBuffer(e.data.sender,e.data.reciver);break;case 132:n.remote=null,this.removeTransport(n)}}_onrecvsubthreadlistener(e,t){let{cmd:r,transportId:i}=t.data,n=this.transportlists.find((e=>e.id===i));switch(r){case T:this.addRemoteTransport(t.data,e);break;case M:this.setSabBufferInfo(n,t.data.sender,t.data.reciver);break;case 132:n.remote==e&&(n.remote=null),this.removeTransport(n)}}createTransport(e){this.transportlists.push(e),setTimeout((()=>{this.transportListeners.forEach((t=>{t.TransportListChange(e,!0)}))}),0)}transportIsExit(e){return-1!=this.transportlists.indexOf(e)}closeTransport(e){let t=this.transportlists.indexOf(e);return-1!=t&&(this.transportlists.splice(t,1),setTimeout((()=>{this.transportListeners.forEach((t=>{t.TransportListChange(e,!1)}))}),0),!0)}createRemoteTransportRPC(e,t){let r={cmd:T,transportType:e.type,transportId:e.id};e.portInfo?(r.port=e.portInfo,t.postMessage(r,[e.portInfo])):t.postMessage(r)}closeRemoteTransportRPC(e,t){t.postMessage({cmd:132,transportType:e.type,transportId:e.id})}setRemoteTransportSABBUfferRPC(e,t){var r,i,n,s;(null!==(r=e.sabInfo)&&void 0!==r&&r.sender||null!==(i=e.sabInfo)&&void 0!==i&&i.reciver)&&t.postMessage({cmd:M,transportId:e.id,sender:null===(n=e.sabInfo)||void 0===n?void 0:n.sender,reciver:null===(s=e.sabInfo)||void 0===s?void 0:s.reciver})}addRemoteTransport(e,t){let{transportId:r,port:i,transportType:n}=e,s=this.createMsgSocketTransport(n,r);var a;s.id=r,s.remote=t,s.portInfo=i,i?s.setMsgPort(s.portInfo):this.bindMessageChannel(s),i&&(null===(a=this.onRemoteTransportFn)||void 0===a||a.call(this,s))}removeTransport(e){-1!=this.transportlists.indexOf(e)&&(this.closeTransport(e),e.close(),e.remote&&this.closeRemoteTransportRPC(e,e.remote),this.closeTransportForTargetThread(e))}createMsgSocketTransport(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=null;return r=new Br({mgr:this,sock:new Nr,type:e,local:!0,id:t}),r}bindMessageChannel(e){if(this.type!=Dr.THREAD_MAIN)return void console.error("error this call only in main thread");let t=new MessageChannel;e.portInfo=t.port1,e.remote.postMessage({cmd:136,transportId:e.id,data:t.port2},[t.port2])}setSabBufferInfo(e,t,r){this.type==Dr.THREAD_MAIN&&(e.sabInfo||(e.sabInfo={}),r&&(r.useCopy=!0),t&&(t.useCopy=!0),e.sabInfo={sender:t,reciver:r},0!=e.target_thread&&(1!=e.target_thread?this.setRemoteTransportSABBUfferRPC(e,e.target_thread):e.setSabBuffer(t,r)))}removeTransportByRemote(e){let t=[];for(let r=0;r<this.transportlists.length;r++){let i=this.transportlists[r];i.remote===e&&t.push(i)}for(let e=0;e<t.length;e++)this.removeTransport(t[e])}reinit(){let e=[...this.transportlists];for(let t=0;t<e.length;t++)this.removeTransport(e[t])}getTransportByType(e){for(let t in this.transportlists){let r=this.transportlists[t],i=1==r.target_thread;if(r.type==e&&i)return r}return null}addTransportListChangeListener(e){-1==this.transportListeners.indexOf(e)&&this.transportListeners.push(e)}remoteTransportListChangeListener(e){let t=this.transportListeners.indexOf(e);-1!=t&&this.transportListeners.splice(t,1)}checkTransport(e){this.transportlists.forEach((t=>{if(!e.transportlists.includes(t.type))return;let r=e.target_thread||1;this.addTransportForTargetThread(t,r)}))}checkTransportForThread(){setTimeout((()=>{this.transportlists.forEach((e=>{this.transportListeners.forEach((t=>{t.TransportListChange(e,!0)}))}))}),0)}addTransportForTargetThread(e,t){const r=t;var i,n,s,a;e.target_thread!=r&&0!=r&&(this.type==Dr.THREAD_MAIN&&0!=e.target_thread&&e.target_thread!=r&&(this.closeTransportForTargetThread(e),this.bindMessageChannel(e)),e.target_thread=r,1!=r?(this.createRemoteTransportRPC(e,r),this.setRemoteTransportSABBUfferRPC(e,r)):(e.portInfo&&e.setMsgPort(e.portInfo),(null!==(i=e.sabInfo)&&void 0!==i&&i.sender||null!==(n=e.sabInfo)&&void 0!==n&&n.reciver)&&e.setSabBuffer(null===(s=e.sabInfo)||void 0===s?void 0:s.sender,null===(a=e.sabInfo)||void 0===a?void 0:a.reciver)))}closeTransportForTargetThread(e){0!=e.target_thread&&1!=e.target_thread&&this.type==Dr.THREAD_MAIN&&this.closeRemoteTransportRPC(e,e.target_thread),e.target_thread=0}}o(Dr,"THREAD_MAIN",1),o(Dr,"THREAD_SUB",2);const Ir={AUDIO_ENCODE:4,AUDIO_DECODE:5,MAUDIO_DECODE:7,SHARE_ENCODE:8,SHARE_DECODE:9,MSHARE_DECODE:11,VIDEO_ENCODE:12,VIDEO_DECODE:13,AUDIO_NETRTC:64,VIDEO_NETRTC:128,MESH_NETRTC:256,CUSTOME_TYPE:1<<31,MESHBRIDGEAUDIO:1<<31|1,MESHBRIDGE:1<<31|2},Or=e=>{};class Ur{constructor(){this.onmessage=Or,this.status=Ur.CLOSED,this.onopen=Or,this.onclose=Or,this.onwer=null}send(e){}delete(){this.onmessage=Or,this.onopen=Or,this.onclose=Or,this.close()}sendVideo(e,t){}sendWasm(e){}sendCommand(e){}open(){this.status=Ur.OPEN,this.onopen()}close(){this.status=Ur.CLOSED,this.onclose()}isReady(){return!1}}o(Ur,"OPEN",1),o(Ur,"CLOSED",2);class Nr extends Ur{constructor(){super({}),this.sab={},this.port=null,this.onmessage=Or,this.sender=Or,this.videoSender=Or,this.reciver=Or,this.wasmSender=Or,this.oncommand=e=>{}}sendCommand(e){var t;null===(t=this.port)||void 0===t||t.postMessage({cmd:130,data:e})}send(e){this.sender(e)}sendVideo(e,t){this.videoSender(e,t)}sendWasm(e){this.wasmSender(e)}delete(){try{var e,t;this.onmessage=Or,this.sender=Or,this.videoSender=Or,this.reciver=Or,this.wasmSender=Or;let{consumer:r}=(null===(e=this.sab)||void 0===e?void 0:e.reciver)||{};null==r||r.setDataCallback(Or),null==r||r.cancelConsume(),this.sab={},this.port&&(this.port.onmessage=Or),null===(t=this.port)||void 0===t||t.close()}catch(e){}}open(){this.status!=Ur.OPEN||this.onopen()}close(){this.status=Ur.CLOSED,this.delete(),this.onclose()}_onmessage(e){let{cmd:t,data:r}=e.data;switch(t){case x:this.reciver();break;case E:this.onmessage(r,0);break;case 129:this.status=r,this.status==Ur.OPEN?this.onopen():this.onclose();break;case 130:this.oncommand(r)}}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:x})},this.wasmSender=e=>{r.enqueue(e),this.port.postMessage({cmd:x})},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:x})}):(this.sender=e=>{this.port.postMessage({cmd:E,data:e},[e.buffer])},this.wasmSender=e=>{let t=new Uint8Array(e.length);t.set(e,0),this.port.postMessage({cmd:E,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:E,data:r},[r.buffer])});let{sabqueue:n,consumer:s,useCopy:a,interval:o,offset:l}=t||{};if(s&&(s.cancelConsume(),s=null),n){const e=a?e=>{this.onmessage(e,0)}:l?e=>{this.onmessage(e.uint8s,e.begin)}:e=>{this.onmessage(e.uint8s,0)};let r=null,i=Br.dataTransportMgr.monitorlogfn;if(o&&i){var c;let e=new De({tag:"WCL_M,VDRB"+(null===(c=this.onwer)||void 0===c?void 0:c.type),interval:1e4,reportcallback:jr});r=e.timeoutReport.bind(e)}s=new Pr(n,e,r),t.consumer=s,o?s.consume(o,a):this.reciver=()=>{s.consumeAll(a)}}}setMsgPort(e){e!=this.port&&(this.port&&(this.port.onmessage=Or,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:a}=e,o=new Fr(n>0?t.buffer:t,void 0,void 0,!!a,n,s,n>0?t:null);this.sab.sender={sabqueue:o,interval:i,useCopy:r,offset:n}}if(null!=t&&t.sab){var r;let{sab:e,useCopy:i,interval:n,offset:s,length:a,useOneElement:o}=t,l=new Fr(s>0?e.buffer:e,void 0,void 0,!!o,s,a,s>0?e:null),{consumer:c}=(null===(r=this.sab)||void 0===r?void 0:r.reciver)||{};c&&(c.cancelConsume(),this.sab.reciver.consumer=null,this.sab.reciver.sabqueue=null),this.sab.reciver={sabqueue:l,interval:n,useCopy:i,offset:s}}this.createSendAndReceive()}setStatus(e){this.port?this.status!=e&&(this.status=e,this.port.postMessage({cmd:129,data:e})):console.error("MsgQueueSocket not initialized")}}class Wr{constructor(){}TransportListChange(e,t){}}class Br{constructor(e){this.onmessage=Or,this.onopen=Or,this.onclose=Or,this.oncommand=Or,this.type=e.type,this.id=e.id||Math.floor(performance.now())<<10|e.type,this.sock=e.sock||new Ur,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.oncommand=this._oncommand.bind(this),this.sock.onwer=this,this.remote=e.remote,this.sabInfo=null,this.portInfo=null,this.target_thread=0,this.local=!!e.local,this.args=e.args,this._create()}_create(){let e=Br.dataTransportMgr;e.createTransport(this),!this.local&&e&&e.mainThread&&e.type==Dr.THREAD_SUB&&e.createRemoteTransportRPC(this,e.mainThread)}_close(){let e=Br.dataTransportMgr;const t=e.transportIsExit(this);!this.local&&t&&e.type==Dr.THREAD_SUB&&e.closeRemoteTransportRPC(this,e.mainThread),t&&e.closeTransport(this)}_oncommand(e){this.oncommand(e)}_onmessage(e,t){this.onmessage(e,t)}_onclose(){this.onclose()}_onopen(){this.onopen()}isReady(){return!0}send(e){this.sock.send(e)}sendCommand(e){this.sock.sendCommand(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 Nr))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setMsgPort(e)}setSabBuffer(e,t){if(!(this.sock instanceof Nr))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setSabBuffer(e,t)}setStatus(e){this.sock instanceof Nr&&this.sock.setStatus(e)}}o(Br,"UDP",0),o(Br,"TCP",1),o(Br,"RLB_UDP",2),o(Br,"dataTransportMgr",null);class Gr{constructor(e){this.sock=null,this.onmessage=Or}isReady(){return!1}send(){}sendVideo(){}sendCommand(){}setStatus(e){}}function jr(e,t,r,i){var n;null===(n=Dr.monitorlogfn)||void 0===n||n.call(Dr,e,"".concat(t,",").concat(r,",").concat(i))}class Vr extends Wr{constructor(){super()}TransportListChange(e,t){}TransportStatus(e,t,r){}DataChannelStatus(e,t){}}class Hr extends Wr{constructor(e){super(),this.transportMap={},this.type=e.type,this.mgr=e,this.channellists=[],this.channelListeners=[]}addDataChannel(e){if(e instanceof Cr){if(-1==this.channellists.findIndex((t=>t==e))){this.channellists.push(e);try{this.mgr.checkTransport(e)}catch(e){console.error("addDataChannel error",e)}this.channelListeners.forEach((t=>{t.DataChannelStatus(e,!0)}))}}else console.error("channel must be a DataChannelWrapper")}TransportListChange(e,t){let r=this.getChannelByTransportType(e.type);if(t&&null!=r&&r.isReady()){let t=r.target_thread||1;this.mgr.addTransportForTargetThread(e,t)}t||this.mgr.closeTransportForTargetThread(e),r&&this.channelListeners.forEach((i=>{i.TransportStatus(e,r,t)})),this.channelListeners.forEach((r=>{r.TransportListChange(e,t)}))}removeDataChannel(e){if(!(e instanceof Cr))return void console.error("channel must be a DataChannelWrapper");let t=this.channellists.indexOf(e);-1!==t&&this.channellists.splice(t,1),this.channelListeners.forEach((t=>{t.DataChannelStatus(e,!1)}))}addMediaChannelController(e){e instanceof Vr?-1==this.channelListeners.findIndex((t=>t==e))&&this.channelListeners.push(e):console.error("controller must be a MediaChannelController")}rmMediaChannelController(e){let t=this.channelListeners.findIndex((t=>t==e));-1!=t&&this.channelListeners.splice(t,1)}getChannelByTransportType(e){for(let t=0;t<this.channellists.length;t++){let r=this.channellists[t];if(r.isReady()&&r.transportlists.includes(e))return r}return null}reinit(){let e=this.channellists;this.channellists=[],e.forEach((e=>{e.isReady()&&(e.close(),this.channelListeners.forEach((t=>{t.DataChannelStatus(e,!1)})))}))}}o(Hr,"target",null);class zr{constructor(){this._interval=-1,this.monitorworkers={},this.timeoutcallbackfn=(e,t)=>{}}setTimeoutCallback(e){this.timeoutcallbackfn=e}registerWorker(e,t){if(e in this.monitorworkers){let t=this.monitorworkers[e];t.worker.removeEventListener("message",t.listener),delete this.monitorworkers[e]}let r={id:e,worker:t},i=this._recvheartbeat.bind(this,r);r.listener=i,r.lastedtimestamp=Date.now(),r.timeoutcount=0,r.worker.addEventListener("message",r.listener),this.monitorworkers[e]=r}unRegisterWorker(e){if(!(e in this.monitorworkers))return;let t=this.monitorworkers[e];delete this.monitorworkers[e],t.worker.removeEventListener("message",t.listener)}_recvheartbeat(e,t){let r=t.data;137===r.cmd&&(e.lastedtimestamp=r.timestamp,e.timeoutcount=0)}start(e){const t="undefined"!=typeof DedicatedWorkerGlobalScope&&e&&e instanceof DedicatedWorkerGlobalScope;if(-1!=this._interval)return;if(t)return void(this._interval=setInterval((()=>{e.postMessage({cmd:137,timestamp:Date.now()})}),zr.INTREVAL_TIME_MS));const r=()=>{this._interval=setTimeout((()=>{r();let e=zr.instance,t=Object.keys(e.monitorworkers),i=Date.now();t.forEach((t=>{let r=e.monitorworkers[t];r.timeoutcount>5?i-r.lastedtimestamp>zr.HEART_TIMEOUT_MS&&(e.timeoutcallbackfn(r.id,i-r.lastedtimestamp),r.lastedtimestamp=i):(r.timeoutcount++,r.worker.postMessage({command:138}))}))}),zr.INTREVAL_TIME_MS)};r()}close(){try{this._interval&&clearTimeout(this._interval),this._interval=-1,Object.keys(this.monitorworkers).forEach((e=>{let t=this.monitorworkers[e];delete this.monitorworkers[e],t.worker.removeEventListener("message",t.listener)}))}catch(e){}}}o(zr,"INTREVAL_TIME_MS",3e3),o(zr,"HEART_TIMEOUT_MS",15e3),o(zr,"MAX_HEART_TIMEOUT_MS",3e4),o(zr,"instance",null);class Yr{constructor(e,t,r,i){var n;this.url=e,this.onopen=()=>{},this.onclose=()=>{},this.oncommand=()=>{},this.transportopened=!1,this.websockClosed=!1,this.dataTransport=(n=t,new Br({sock:new Nr,type:n,local:!1,userArgs:undefined})),this.dataTransport.onopen=this._dataTransportOpen.bind(this),this.dataTransport.onclose=this._dataTransportClose.bind(this),this.dataTransport.oncommand=this._dataTransportCommand.bind(this),this.websocketopen=!1,this.senderSab=null,this.reciverSab=null,this.webtransporturl=null,this.disabletcp=!!r,this.isLSSPlayer=!!i}_dataTransportCommand(e){let{cmd:t}=e;182!=t||this.websockClosed||(this.websocketopen=!0,this.onopen()),t==k&&this.onclose(),this.oncommand(e)}_dataTransportOpen(){this.transportopened=!0,this.disabletcp&&this.onopen();{const e=this.isLSSPlayer,t={cmd:175,data:this.disabletcp,isLSSPlayer:e};this.dataTransport.sendCommand(t)}const e={cmd:180,data:this.url};this.url&&!this.disabletcp&&this.dataTransport.sendCommand(e);const t={cmd:176,data:this.webtransporturl};this.webtransporturl&&this.dataTransport.sendCommand(t),(this.senderSab||this.reciverSab)&&Lr(this.dataTransport,this.senderSab,this.reciverSab)}_dataTransportClose(){this.transportopened=!1}resetURL(e){this.websockClosed=!1;let t=this.url;this.url=e;const r={cmd:180,data:this.url};this.transportopened&&this.url&&t!=this.url&&this.dataTransport.sendCommand(r)}resetWebrTransportUrl(e){let t=this.webtransporturl;this.webtransporturl=e;const r={cmd:176,data:e};this.transportopened&&this.webtransporturl&&t!=this.webtransporturl&&this.dataTransport.sendCommand(r)}closeWebsocket(){let e=this.url;this.websockClosed=!0,this.url=null;const t={cmd:181,data:this.url};this.transportopened&&e&&this.dataTransport.sendCommand(t)}closeWebTransport(){let e=this.webtransporturl;this.webtransporturl=null;const t={cmd:177,data:e};this.transportopened&&e&&this.dataTransport.sendCommand(t)}isReady(){return this.websocketopen||this.disabletcp&&this.transportopened}setOnMessage(e){this.dataTransport.onmessage=e}sendWasm(e){this.dataTransport.sendWasmData(e)}send(e){this.dataTransport.send(e)}sendVideo(e,t){this.dataTransport.sendVideo(e,t)}sendCommand(e){this.transportopened&&this.dataTransport.sendCommand(e)}close(){this.dataTransport&&(this.dataTransport.onopen=()=>{},this.dataTransport.onclose=()=>{},this.dataTransport.oncommand=()=>{},this.dataTransport.sendCommand({cmd:181}),this.dataTransport.sendCommand({cmd:177}),this.dataTransport.close())}setSabBuffer(e,t){this.senderSab=e,this.reciverSab=t,this.transportopened&&Lr(this.dataTransport,e,t)}sendCmdData(e){const t={cmd:198,data:new Uint8Array(e)};this.dataTransport.sendCommand(t)}}var qr,Xr,Kr,Zr,Qr,Jr,$r,ei,ti;!function(e){e[e.Unknow=0]="Unknow",e[e.MediaCommand=1]="MediaCommand",e[e.P2PControl=2]="P2PControl",e[e.MeshControl=3]="MeshControl"}(qr||(qr={})),function(e){e[e.normal=0]="normal",e[e.child=1]="child",e[e.parent=2]="parent",e[e.invalid=31]="invalid"}(Xr||(Xr={})),function(e){e[e.bridge=0]="bridge",e[e.setRole=1]="setRole",e[e.connectTestParams=2]="connectTestParams",e[e.reportConnectedSet=3]="reportConnectedSet",e[e.notifyChildParentLeave=4]="notifyChildParentLeave",e[e.notifyParentChildLeave=5]="notifyParentChildLeave",e[e.availableParents=6]="availableParents",e[e.updateNodeStatus=7]="updateNodeStatus",e[e.joinSuccess=8]="joinSuccess",e[e.kickChild=9]="kickChild",e[e.leaveParent=10]="leaveParent",e[e.subscriptionMap=11]="subscriptionMap",e[e.channelopt=12]="channelopt",e[e.joinSuccessConfirm=13]="joinSuccessConfirm",e[e.registerMeshNode=14]="registerMeshNode",e[e.meshAllowTalk=15]="meshAllowTalk",e[e.statInfo=16]="statInfo",e[e.adapt=17]="adapt",e[e.refershConnectParams=18]="refershConnectParams",e[e.joinConnectedSetConfirm=19]="joinConnectedSetConfirm",e[e.registerMeshNodeResult=20]="registerMeshNodeResult",e[e.meshSigType=21]="meshSigType",e[e.meshSigKey=22]="meshSigKey",e[e.mediaAccess=23]="mediaAccess",e[e.unknown=1e3]="unknown"}(Kr||(Kr={})),function(e){e[e.Unknow=0]="Unknow",e[e.Offer=1]="Offer",e[e.Answer=2]="Answer"}(Zr||(Zr={})),function(e){e.ADD_VIDEO_PORT="add_video_port",e.ADD_SHADOW_PORT="add_shadow_port",e.ADD_VIDEO_PROCESSOR="add_video_processor",e.PROCESSOR_READY="processor_ready",e.PROCESSOR_ERROR="processor_error"}(Qr||(Qr={})),function(e){e.ADD_SHARE_PORT="add_share_port",e.ADD_SHADOW_PORT="add_shadow_port",e.ADD_SHARE_PROCESSOR="add_share_processor",e.ADD_SHARE_ENCODE_PORT="add_share_encode_port",e.PROCESSOR_READY="processor_ready",e.PROCESSOR_ERROR="processor_error"}(Jr||(Jr={})),(ti=$r||($r={})).INIT_PROCESSOR="init_processor",ti.UNINIT_PROCESSOR="uninit_processor",ti.INIT_OUTPUT_CANVAS="init_output_canvas",ti.OUTPUT_WRITABLE_STREAM="output_writable_stream",ti.INPUT_READABLE_STREAM="input_readable_stream",ti.FRAME_DATA="frame_data",ti.START_REQUEST_FRAME="start_request_frame",ti.STOP_REQUEST_FRAME="stop_request_frame",ti.REQUEST_FRAME="request_frame",ti.FRAME_CALLBACK="frame_callback",ti.RESOLUTION_CHANGE="RESOLUTION_CHANGE",ti.PROCESSOR_WORKER_ERROR="PROCESSOR_WORKER_ERROR",ti.PROCESSOR_STOP_COMPLETE="PROCESSOR_STOP_COMPLETE",ei||(ei={});class ri{constructor(e,t,r){this.port=e,this.name=t,this.VideoFrameNeeded=r}setStream(e){const t=e.getVideoTracks()[0],r=t.getSettings(),{frameRate:i=24}=r;this.trackProcessor=new MediaStreamTrackProcessor({track:t});const n=this.trackProcessor.readable;this.port.postMessage({cmd:$r.INPUT_READABLE_STREAM,frameRate:Math.min(i,24),readableStream:n,processorName:this.name},[n]),this.port.postMessage({cmd:$r.START_REQUEST_FRAME,frameRate:i,processorName:this.name,VideoFrameNeeded:this.VideoFrameNeeded})}removeStream(){this.port.postMessage({cmd:$r.STOP_REQUEST_FRAME,processorName:this.name})}destroy(){this.removeStream()}}class ii{constructor(e,t,r=!1,i=!1){this.port=e,this.name=t,this.isIOSDevice=r,this.VideoFrameNeeded=i,this.onMessage=e=>{if(e.data.cmd===$r.REQUEST_FRAME&&this.captureVideoEleLoaded){let e=this.captureVideoEle.videoWidth,t=this.captureVideoEle.videoHeight;if(e<=0||t<=0)return;this.isIOSDevice&&(this.captureCanvasEle.width=e,this.captureCanvasEle.height=t,this.captureCanvasEleCtx.drawImage(this.captureVideoEle,0,0,e,t));const r=new VideoFrame(this.isIOSDevice?this.captureCanvasEle:this.captureVideoEle,{timestamp:1e3*performance.now()});this.port.postMessage({cmd:$r.FRAME_DATA,frame:r,processorName:this.name}),r.close()}},this.port.addEventListener("message",this.onMessage)}createCaptureVideoElement(e){this.captureVideoEle=document.querySelector("#share-processor-video"),this.captureVideoEle||(this.captureVideoEle=document.createElement("video"),this.captureVideoEle.autoplay=!0,this.captureVideoEle.playsInline=!0,this.captureVideoEle.id="share-processor-video",this.captureVideoEle.style.position="fixed",this.captureVideoEle.style.width="1px",this.captureVideoEle.style.height="1px",this.captureVideoEle.style.bottom="0px",this.captureVideoEle.style.right="0px",this.captureVideoEle.muted=!0,document.body.appendChild(this.captureVideoEle)),this.isIOSDevice&&!this.captureCanvasEle&&(this.captureCanvasEle=document.createElement("canvas"),this.captureCanvasEleCtx=this.captureCanvasEle.getContext("2d")),this.captureVideoEle.srcObject=e,this.captureVideoEle.addEventListener("loadedmetadata",(()=>{this.captureVideoEleLoaded=!0})),this.captureVideoEle.play()}setStream(e){const t=e.getVideoTracks()[0].getSettings(),{frameRate:r=24}=t;this.createCaptureVideoElement(e),this.port.postMessage({cmd:$r.START_REQUEST_FRAME,frameRate:Math.min(r,24),processorName:this.name,VideoFrameNeeded:this.VideoFrameNeeded})}removeStream(){this.port.postMessage({cmd:$r.STOP_REQUEST_FRAME,processorName:this.name})}destroy(){this.port.removeEventListener("message",this.onMessage)}}class ni{constructor(e,t){this.trackGenerator=new MediaStreamTrackGenerator({kind:"video"});const r=this.trackGenerator.writable;e.postMessage({cmd:$r.OUTPUT_WRITABLE_STREAM,writableStream:r,processorName:t},[r]),this.stream=new MediaStream([this.trackGenerator])}getStream(){return this.stream}}class si{constructor(e,t,r){this.canvas=document.createElement("canvas"),this.canvas.width=1,this.canvas.height=1,this.stream=this.canvas.captureStream(24),r?r.canCanvasAsOffscreenAfterCaptureStream?this.offScreenCanvas=this.canvas.transferControlToOffscreen():this.offScreenCanvas=null:this.offScreenCanvas=this.canvas.transferControlToOffscreen()}getOutputCanvas(){return this.offScreenCanvas}getStream(){return this.stream}getStreamingCanvas(){return this.canvas}}class ai{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.reject=e=>(this.status="rejected",t(e)),this.resolve=t=>(this.status="fullfilled",e(t))})),this.then=this.promise.then,this.catch=this.promise.catch}}var oi=function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function a(e){try{l(i.next(e))}catch(e){s(e)}}function o(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,o)}l((i=i.apply(e,t||[])).next())}))};class li{constructor(e,t,r){this.processorName=e,this.port=t,this.config=r,this.frameCallback=null,this.callback=null,this._config=null,this.onMessage=e=>{var t,r,i,n;if(e.data.cmd===$r.FRAME_CALLBACK)if(this.frameCallback)this.frameCallback(e.data.frame);else if(this instanceof ci)if(this.getOutPutCanvas())null===(r=e.data.frame)||void 0===r||r.close();else{const r=e.data.frame;if(r instanceof VideoFrame){const i=r.displayWidth,n=r.displayHeight,s=this.getTargetGenerator();if(s instanceof si){const e=s.getStreamingCanvas();e.width!==i&&(e.width=i),e.height!==n&&(e.height=n);const t=e.getContext("2d");if(!t)return console.error("cannot get canvas context!"),void r.close();createImageBitmap(r).then((e=>{t.clearRect(0,0,i,n),t.drawImage(e,0,0,i,n),e.close(),r.close()})).catch((e=>{console.error("failed in rendering frame! e:",e),r.close()}))}else null===(t=e.data.frame)||void 0===t||t.close()}}else null===(i=e.data.frame)||void 0===i||i.close();else e.data.cmd===$r.PROCESSOR_STOP_COMPLETE?this instanceof ci&&this.resolveEndCompleteDeferred():null===(n=this.callback)||void 0===n||n.call(this,e.data.cmd,e.data.data)},this.port.start(),this.port.addEventListener("message",this.onMessage),this._config=r;const i=this.getOutPutCanvas();i?this.port.postMessage({cmd:$r.INIT_OUTPUT_CANVAS,canvas:i,processorName:e},[i]):this.port.postMessage({cmd:$r.INIT_OUTPUT_CANVAS,processorName:e})}init(){this.port.postMessage({cmd:$r.INIT_PROCESSOR,processorName:this.processorName})}addCallback(e){this.callback=e}removeCallback(){this.callback=null}uninit(){this.port.postMessage({cmd:$r.UNINIT_PROCESSOR,processorName:this.processorName}),this.port.removeEventListener("message",this.onMessage)}getOutPutCanvas(){return null}getConfig(){return this._config}getStream(){throw new Error("Method not implemented.")}setStream(e){throw new Error("Method not implemented.")}removeStream(){return oi(this,void 0,void 0,(function*(){}))}onFrame(e){throw new Error("Method not implemented.")}addFrameCallback(e){throw new Error("Method not implemented.")}removeFrameCallback(){}}class ci extends li{constructor(e,t,r){super(e,t,r),this.processorName=e,this.port=t,this.endCompleteDeferred=null,this.initGenerator()}initGenerator(){var e;const t=this.getConfig(),r=null!==(e=null==t?void 0:t.needFixedCaptureRate)&&void 0!==e?e:void 0;this.originGenerator||(this.originGenerator=!0===r?new ii(this.port,this.processorName,!1,!0):"function"==typeof MediaStreamTrackProcessor?new ri(this.port,this.processorName,!0):new ii(this.port,this.processorName,!1,!0)),this.targetGenerator||(this.targetGenerator=!0===r?new si(this.port,this.processorName,t):"function"==typeof MediaStreamTrackGenerator?new ni(this.port,this.processorName):new si(this.port,this.processorName,t))}uninit(){var e,t,r,i;null===(t=null===(e=this.originGenerator)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e),null===(i=null===(r=this.targetGenerator)||void 0===r?void 0:r.destroy)||void 0===i||i.call(r),super.uninit()}getOutPutCanvas(){var e,t;return this.initGenerator(),null===(t=(e=this.targetGenerator).getOutputCanvas)||void 0===t?void 0:t.call(e)}getStream(){return this.targetGenerator.getStream()}setStream(e){this.originGenerator.setStream(e)}removeStream(){return oi(this,void 0,void 0,(function*(){this.originGenerator.removeStream(),this.endCompleteDeferred||(this.endCompleteDeferred=new ai),yield this.endCompleteDeferred.promise}))}resolveEndCompleteDeferred(){this.endCompleteDeferred&&this.endCompleteDeferred.resolve(),this.endCompleteDeferred=null}addFrameCallback(e){this.frameCallback=e}getTargetGenerator(){return this.targetGenerator}}class ui extends li{constructor(e,t,r){super(e,t,r),this.processorName=e,this.port=t,this.config=r}onFrame(e){this.port.postMessage({cmd:$r.FRAME_DATA,frame:e,processorName:this.processorName})}addFrameCallback(e){this.frameCallback=e}removeFrameCallback(){this.frameCallback=null}}var hi=function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function a(e){try{l(i.next(e))}catch(e){s(e)}}function o(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,o)}l((i=i.apply(e,t||[])).next())}))};class di{static hasProcessor(){return this.shareProcessorAgentMap.size>0}static isProcessorStarted(e){return this.shareProcessorAgentMap.has(e)}static setProcessorOptions(e,t){this.shareProcessorOptionsMap.set(e,t)}static getProcessorOptions(e){return this.shareProcessorOptionsMap.get(e)}static hasMediaStreamFrameProcessor(){return[...this.shareProcessorAgentMap.values()].some((e=>e instanceof ci))}static addFrameCallback(e,t){this.shareFrameCallbackMap.set(e,t),this.getProcessor(e)&&this.getProcessor(e).addFrameCallback(t)}static addCallback(e,t){this.shareCallbackMap.set(e,t),this.getProcessor(e)&&this.getProcessor(e).addCallback(t)}static getProcessor(e){return this.shareProcessorAgentMap.get(e)}static onFrame(e){for(const t of this.shareProcessorAgentMap.values())t.onFrame(e)}static getStream(){return[...this.shareProcessorAgentMap.values()].pop().getStream()}static setStream(e){for(const t of this.shareProcessorAgentMap.values())t.setStream(e)}static removeStream(){return hi(this,void 0,void 0,(function*(){const e=[];for(const t of this.shareProcessorAgentMap.values())e.push(t.removeStream());yield Promise.all(e)}))}static startProcessor(e,t){t.init();const r=this.shareFrameCallbackMap.get(e);r&&t.addFrameCallback(r);const i=this.shareCallbackMap.get(e);i&&t.addCallback(i),this.shareProcessorAgentMap.set(e,t)}static stopProcessor(e){return hi(this,void 0,void 0,(function*(){const t=this.getProcessor(e);t&&(t.removeFrameCallback(),t.removeCallback(),this.shareFrameCallbackMap.delete(e),this.shareCallbackMap.delete(e),this.shareProcessorOptionsMap.delete(e),yield t.removeStream(),t.uninit()),this.shareProcessorAgentMap.delete(e)}))}static resetProcessorManager(){for(const e of this.shareFrameCallbackMap.keys())this.stopProcessor(e)}}function _i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}di.shareProcessorAgentMap=new Map,di.shareProcessorOptionsMap=new Map,di.shareFrameCallbackMap=new Map,di.shareCallbackMap=new Map;const fi=r(1668);var pi;self.wasmSuccessEvent=12,self.wasmFailEvent=-12,self.downloadAndInstantiateWebAssembly=async function(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?(j("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),j("DS"),postMessage({status:30,url:wasmUrl})}));let i=await WebAssembly.instantiate(r,e);i.instance?(self.wasmModuleToShare=i.module,t(i.instance)):(self.wasmModuleToShare=r,t(i))}catch(e){j("IF"),H("E:H Failed to download and instantiate WASM file: ".concat(wasmUrl),e)}},self.onunhandledrejection=e=>{H("Unhandled rejection in worker: ".concat(JSON.stringify(e.reason)),e.reason instanceof Error?e.reason:null)};var mi,gi,vi,yi,bi,wi,Si,Ei,xi,Ti,Mi,Ri,ki,Ai,Ci,Fi,Pi,Li,Di,Ii,Oi,Ui,Ni,Wi,Bi,Gi,ji,Vi,Hi,zi,Yi,qi,Xi,Ki,Zi=150,Qi=new Map,Ji=!1,$i=!1,en=0,tn=0,rn=0,nn=!1;const sn=new class{constructor(e){gr(this,wr,""),gr(this,Sr,new Mt),gr(this,Er,new mr),gr(this,xr,new Ft),gr(this,Tr,null),yr(wr,this,e),vr(Er,this).setGPUResourceMgrGetter((()=>this.getWebGPUResMgr()))}isEnableCanvasAlphaChannel(){return vr(Er,this).isEnableCanvasAlphaChannel()}setCanvasAlphaChannelEnability(e){vr(Er,this).setCanvasAlphaChannelEnability(e)}async evalRendererType(e){const t=await vr(Sr,this).evaluate(e);console.log("[RenderManager] rendererType is ".concat(t))}getVideoRenderDisplay(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const s=vr(Sr,this).getRendererType(),a=vr(Sr,this).acquireRenderer(e,this.getWebGPUResMgr(s));return vr(Er,this).getVideoRenderDisplay(s,e,t,r,i,a,n)}getRenderDisplay(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const s=vr(Sr,this).getRendererType(),a=vr(Sr,this).acquireRenderer(e,vr(Tr,this));return vr(Er,this).getRenderDisplay(s,e,t,a,n)}createWebGLVideoRenderDisplay(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return vr(Sr,this).isWebGL2RendererType()?vr(Er,this).getWebGL2RenderDisplayMgr().createVideoRenderDisplay(e,t,r,null,i):vr(Sr,this).isWebGLRendererType()?vr(Er,this).getWebGLRenderDisplayMgr().createVideoRenderDisplay(e,t,r,null,i):(Je("Can not create webgl display!!"),null)}createVideoRenderDisplay(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const n=vr(Sr,this).getRendererType(),s=vr(Sr,this).acquireRenderer(e,this.getWebGPUResMgr(n));return vr(Er,this).createVideoRenderDisplay(n,e,t,r,s,i)}recycleRenderDisplay(e,t,r){const i=vr(Sr,this).getRendererType();vr(Er,this).recycleRenderDisplay(i,e,t,this.getWebGPUResMgr(i),r)}renderFor(e){if(vr(Sr,this).isWebGPURendererType()){const t=vr(Sr,this).getRendererType(),r=vr(Er,this).collectInUseRenderDisplays(t,e);r&&r.forEach((e=>{const r=vr(Sr,this).acquireRenderer(e.canvas,this.getWebGPUResMgr(t));vr(xr,this).render(r,e.renderDisplays)}))}}renderWith(e){if(vr(Sr,this).isWebGPURendererType()){const t=e.getAttachedCanvas();if(t){const r=vr(Sr,this).getRendererType(),i=vr(Sr,this).acquireRenderer(t,this.getWebGPUResMgr(r)),n=[];n.push(e),vr(xr,this).render(i,n)}}}getRenderDisplayMap(e){const t=vr(Sr,this).getRendererType();return vr(Er,this).getRenderDisplayMap(t,e)}onRestoredFromContextLost(e,t,r,i,n){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;return vr(Sr,this).isWebGLRendererType()||vr(Sr,this).isWebGL2RendererType()?vr(Er,this).onRestoredFromContextLost(e,t,r,i,n,s):null}destroyUnusedVideoFrame(e){"undefined"!=typeof VideoFrame&&e instanceof VideoFrame&&vr(Sr,this).isWebGPURendererType()&&e.close()}getRendererProvider(){return vr(Sr,this)}getRenderDisplayManager(){return vr(Er,this)}getWebGPUResMgr(e){if(vr(Tr,this))return vr(Tr,this);if(2===e){const e=ct.getModule("webgpu_renderer_dynmod");yr(Tr,this,e.exports.createWebGPUResManager()),vr(Tr,this).addRendererProviderModule(vr(Sr,this)),vr(Tr,this).setLabel(vr(wr,this))}return vr(Tr,this)}cleanup(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];vr(Sr,this)&&vr(Sr,this).cleanup(),vr(Er,this)&&vr(Er,this).cleanup(e,t,r),r||vr(Tr,this)&&vr(Tr,this).cleanup()}clearOffscreenCanvas(e){vr(Er,this)&&vr(Er,this).cleanupByCanvas(e)}}("sharing"),an="meetingNumber";var on,ln,cn,un,hn=null,dn=new class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.checkInterval=0,this.hasRTPPackets=!1,this.callBackEvent=e,this.subforme=!1,this.lastsubformetime=0,this.videoType=t,this.paused=!1,this.isVbEnabled=!1,this.isVideoCaptured=!1,this.hasWasmMemoryError=!1}startCheck(){this.checkInterval&&(clearInterval(this.checkInterval),this.hasRTPPackets=!1,this.subforme=!1,this.paused=!1),this.checkInterval=setInterval((()=>{if((this.videoType&&this.subforme||!this.videoType)&&!this.hasRTPPackets&&!this.paused){let e=!1;this.videoType&&this.isVbEnabled&&this.isVideoCaptured&&!this.hasWasmMemoryError&&(e=!0),performance.now()-this.lastsubformetime>2e4&&postMessage({status:this.callBackEvent,videoType:this.videoType,subforme:this.subforme,hasRTPPackets:this.hasRTPPackets,vberror:e})}this.hasRTPPackets=!1,this.isVideoCaptured=!1}),3e4)}stopCheck(){this.checkInterval&&clearInterval(this.checkInterval),this.checkSharingInterval=0,this.subforme=!1,this.paused=!1}setRtpPackets(){this.hasRTPPackets=!0}setSubForMe(e){let t=e>=0;this.subforme!==t&&(this.subforme=t,this.lastsubformetime=performance.now())}setVBFlag(e){this.isVbEnabled=e}setVideoCaptured(e){this.isVideoCaptured=e}setWasmMemoryError(e){this.hasWasmMemoryError=e}setPaused(e){e||(this.lastsubformetime=performance.now()),this.paused=e,this.hasRTPPackets=!1}}(-129,!0);self.onWasmModuleReady=()=>{pi=Module.cwrap("_Sharing_Encode","number",["number","number","number","number","number","number"]),bi=Module.cwrap("_Sharing_Encode_Mouse_Data","number",["number","number","number"]),mi=Module.cwrap("_Sharing_Encode_Uninit","number",["number"]),gi=Module.cwrap("_Sharing_Encode_Try_Analysis","number",["number","array","number"]),vi=Module.cwrap("_Sharing_Encode_Try_Analysis","number",["number","number","number"]),yi=Module.cwrap("_Sharing_Encode_Init","number",["number","number","number","number","number","number","boolean","boolean","boolean"]),wi=Module.cwrap("_Sharing_Set_Data_Encryption","number",["number","number"]),Li=Module.cwrap("_Request_Sharing_Qos_Data","number",["number","boolean","boolean"]),Si=Module.cwrap("_Sharing_Pause_Encode","number",["number"]),Module.cwrap("_Sharing_Stop_Encode","number",["number"]),Ei=Module.cwrap("_Sharing_Resume_Encode","number",["number"]),xi=Module.cwrap("_Sharing_Websocket_Speed","number",["number","number"]),Ti=Module.cwrap("_Add_Sharing_Cooker_info","number",["number","number","number","number"]),Ri=Module.cwrap("_Get_Sharing_Meat_Weight","number",["number"]),Mi=Module.cwrap("_Remove_Sharing_Cooker_Info","number",["number","number"]),ki=Module.cwrap("_Set_Sharing_Encryption_Key_Directly","number",["number","number","number","number"]),Ai=Module.cwrap("_Add_Roster_Info_Directly","number",["number","number","number","number"]),Ci=Module.cwrap("_Add_Rev_Channel","number",["number","number","number","number"]),Fi=Module.cwrap("_Remove_Rev_Channel","number",["number","number"]),Pi=Module.cwrap("_update_sharing_uplink_bandwidth_limitation_by_server","number",["number","number"]),Ii=Module.cwrap("_set_annotation_action","number",["number","number","number","number"]),Ui=Module.cwrap("_collect_sharing_monitor_info","number",["number","boolean","boolean"]),Ni=Module.cwrap("_Change_Connect_Type_For_Sharing","number",["number","number"]),Wi=Module.cwrap("_request_nack_t_periodically_for_sharing_qos","number",["number"]),ln=Module.cwrap("_Jpeg_Init","number",[]),Module.cwrap("_Jpeg_Uninit","number",["number"]),cn=Module.cwrap("_Jpeg_HeardInfo","number",["number","number","number"]),un=Module.cwrap("_Jpeg_Decode","number",["number","number","number","number","number","number"]),Di=Module.cwrap("_set_sharing_network_info","number",["number","boolean","boolean","number","number","number","number","number","number","number"]),Hi=Module.cwrap("_set_mmr_signature_info","number",["number","number","array","number"]),zi=Module.cwrap("_set_singature_info","number",["number","number","number"]),Yi=Module.cwrap("_set_meeting_uuid_for_signature","number",["number","number","string","number"]),qi=Module.cwrap("_update_signagure_verify_action","number",["number","number","boolean"]),Ki=Module.cwrap("_set_sharing_statistics_flag","number",["number","boolean"]),Xi=Module.cwrap("_set_sharing_bandwidth_alloc","number",["number","boolean","number","number"]),Module._malloc=function(){let e=Module.asm.malloc.apply(null,arguments);return e||nn||(nn=!0,j("MEMERR:SHARE-".concat(Jn,"-").concat(wasmMemory.buffer.byteLength,"-").concat(arguments[0])),H("memry malloc error",new Error("memry malloc error SHARE-".concat(Jn,"-").concat(wasmMemory.buffer.byteLength,"-").concat(arguments[0])))),e},void 0!==_malloc&&(_malloc=Module._malloc)};var _n,fn,pn,mn,gn,vn,yn,bn,wn,Sn,En,xn=0,Tn=null,Mn=0,Rn=0,kn=0,An=8e5,Cn=null,Fn=null,Pn=null,Ln=null,Dn=null,In=!1,On=!1,Un=!1,Nn=null,Wn=!1,Bn=0,Gn=0,jn=0,Vn=0,Hn=new ge,zn=(new ge,0),Yn=2e4,qn=!1,Xn=!1,Kn=null,Zn=null,Qn=null,Jn=!1,$n=new ge,es=se,ts=!1,rs=!1,is=1,ns=!1,ss=0,as=new class{constructor(){this.readStream=null,this.reader=null,this.streamProcessor=null,this.videotrack=null,this.rotation=0,this.videotag=!1,this.isSafari=!1}setReadStream(e){this.closeReadStream(),e&&(this.rotation=0,this.videotag=!1,this.readStream=e,this.reader=e.getReader(),this.isSafari=!1)}closeReadStream(){try{var e;null===(e=this.videotrack)||void 0===e||e.stop(),this.videotag||(this.reader&&this.reader.releaseLock&&this.reader.releaseLock(),this.readStream&&this.readStream.cancel&&this.readStream.cancel())}catch(e){}finally{this.reader=null,this.readStream=null,this.streamProcessor=null,this.videotrack=null}}createReadStream(e,t){this.closeReadStream(),this.rotation=t,this.videotag=!0,this.isSafari=!0,e&&(this.videotrack=e,this.streamProcessor=new MediaStreamTrackProcessor({track:e}),this.readStream=this.streamProcessor.readable,this.reader=this.readStream.getReader())}setRotation(e){this.isSafari&&this.videotrack&&(this.rotation=e)}async read(){let{done:e,value:t}=await this.reader.read();return{done:e,value:t,rotation:this.rotation,videotag:this.videotag}}},os=!1,ls=ue.DESKTOP_SOURCE,cs=0,us=null,hs=null,ds=0,_s=null,fs=0,ps=null,ms=0,gs=0,vs=!1,ys=[],bs=[],ws=[],Ss=0;function Es(e,t){postMessage({status:u,data:"".concat(e,":").concat(t)})}function xs(e,t){j("".concat(e,":").concat(t,":F"))}var Ts=new De({tag:"WCL_M,ASRENDER_ERR",interval:1e4,reportcallback:function(e,t,r,i){Es(e,"".concat(t,",").concat(r,",").concat(i))}}),Ms=new Ve({tag:"WCL,AS",report_call:Es});function Rs(e){if(j("WSURL:false:".concat(e.replace(/(\/media\/)\d+/,"$1".concat(an)))),Cn)return void Cn.resetURL(e);const t=Ir.SHARE_ENCODE;var r=new Yr(e,t);return r.setOnMessage(Cs),r.onopen=ks,r.onclose=Fs,r.oncommand=Ls,Cn=r,r}function ks(){postMessage({status:l})}Ms.threshold=300;let As=!0;function Cs(e){let t;if(e instanceof Uint8Array){if(t=e,!(t.length<4))if(37!==t[0]){if(102!=t[0]){if(t[0]==he.SHARE_REMOTE_CONTROL_UAC_JPEG_FRAME){if(!Ji||!Pn||ls!=ue.UAC_SOURCE)return;let e,r=0;if(As?(e=fi.inflate(Buffer.from(t.subarray(4,t.length)),{windowBits:31}),r=e.length):r=t.length-4,r>ds&&(hs&&Module._free(hs),ds=3*r/2,hs=Module._malloc(ds)),!hs)return ds=0,void console.error("Couldn't allocate memory");writeArrayToMemory(As?e:t.subarray(4,t.length),hs);let i=cn(us,hs,r);if(!i)return;let n=65535&i,s=i>>16&65535,a=n*s*4;if(a>fs&&(_s&&Module._free(_s),fs=a,_s=Module._malloc(a)),!_s)return fs=0,void console.error("Couldn't allocate memory");if(cs++,i=un(us,hs,r,s,n,_s),0!=i)return;return ao(s,n),1!=bn&&(bn=1),void pi(Pn,_s,a,s,n,bn)}if(t[0]!=he.SHARE_REMOTE_CONTROL_UAC_MOUSE)if(111!=t[0])if(109!=t[0])if(0==t[0])Cn&&Cn.send(t);else if(Pn)if(On){if(t instanceof Uint8Array){Hn.enqueue(t);let e=Hn.dequeue();for(;e;)gi(Pn,e,e.length),e=Hn.dequeue()}}else fa(t.buffer);else t instanceof Uint8Array&&0!=t[0]&&Hn.enqueue(t);else Ln&&gi(Ln,t,t.length);else 1==t[4]?(j("UAC_START"),cs=0,us||(us=ln()),ls=ue.UAC_SOURCE):(j("UAC_STOP"),j("UAC_ASCAPTURE:".concat(cs)),ls=ue.DESKTOP_SOURCE,Un=!0,_s&&Module._free(_s),_s=null,fs=0,hs&&Module._free(hs),hs=null,ds=0,ps&&Module._free(ps),ps=null,ms=0);else if(Pn&&Ji&&ls==ue.UAC_SOURCE){if(t.length>ms&&(ps&&Module._free(ps),ms=3*t.length/2,ps=Module._malloc(ms)),!ps)return void(ms=0);writeArrayToMemory(t,ps),bi(Pn,ps,t.length)}}}else postMessage({status:R,data:t})}else H("sharing_websocket_on_message: Unsupported data type ".concat(e instanceof Object?typeof e.data:typeof e))}function Fs(e){Ds("sharing_websocket_on_close")}function Ps(e){Ds("sharing_websocket_on_error")}function Ls(e){const{cmd:t}=e;switch(t){case A:{const{rtt:t,jitter:r,avg_loss:i,max_loss:n,bandwidth:s,rate:a,issend:o,ismain:l,lost_packet_num:c}=e;let u=l?Xe():Pn;u&&Di(u,o,l,t,r,i,n,s,a,c);break}case k:postMessage({status:I}),H("NetWork is Bad, Don't to reconnect the serer!");break;case P:{const{type:t,networkLevel:r,bwLevel:i}=e;postMessage({status:L,isUplink:0===t,networkLevel:r,bwLevel:i});break}case C:{const{bandwidth:t,lostrate:r,issend:i}=e;Pn&&Xi(Pn,i,t,r);break}}}function Ds(e){console.log(e)}function Is(e,t){var r=new Uint8Array(t),i=q().subarray(e+0,e+t);r.set(i,0,t),postMessage({status:S,data:r},[r.buffer])}function Os(e,t,r){postMessage({status:L,isUplink:0===e,networkLevel:t,bwLevel:r})}function Us(e,t,r){var i=new Uint8Array(r+8),n=q().subarray(t+0,t+r);i.set(n,8),i[0]=109;var s=new Uint32Array(1);s[0]=e;var a=new Uint8Array(s.buffer);i.set(a,4),te(Cn,i),dn.setRtpPackets()}function Ns(e,t){Wa&&Wa.writeWasmLog(e,t)}var Ws,Bs,Gs={sharingqosIntervalId:0,sharingmonitorPanelFlag:!1,panelpollingInterval:0},js={sharingStatisticsFlag:!1},Vs=!0;function Hs(){Gs.sharingqosIntervalId&&clearInterval(Gs.sharingqosIntervalId),Gs.sharingmonitorPanelFlag&&(Gs.sharingqosIntervalId=setInterval((()=>{if(Jn&&!Vs&&Pn)Li(Pn,!0);else if(!Jn&&(!qn||Xn)){let e=vs?Xe():Pn;e&&Li(e,!1)}}),Gs.panelpollingInterval||ne))}function zs(e){Jn&&Pn?Ki(e):Jn||Ki(e)}function Ys(e,t,r,i,n,s,a,o,l){Gs.sharingmonitorPanelFlag&&postMessage({status:O,data:{width:e,height:t,fps:r,rtt:i,jitter:n,avg_loss:s,max_loss:a,bandwidth:o,rate:l}})}var qs=new Map,Xs=-1,Ks=-1;function Zs(e,t,r,i,n,s,a,o,l,c,u,h,d,f){let p=!(f==Pn);vs=p,qs.get(i)||(qs.set(i,!0),postMessage({status:b,ssrc:i}));var g=q().subarray(e+0,e+t),v=X().subarray(r,r+8),y=0;for(let e=0;e<8;e++)y+=v[e]*Math.pow(256,e);var w=i,S=n,E=s;if(ot.isUseSsrcStream()){let e=g;ot.shouldCropWasmFrame(n,s,{x:a,y:o,width:l,height:c})&&(e=ie(g,n,s,{x:a,y:o,width:l,height:c}),S=l,E=c,a=0,o=0),za.pushSharingVideoData(i,e,"I420",S,E,{left:a,top:o,width:l,height:c});const t=1===za.getSinksCount("sharing");t?u==Xs&&h==Ks||(postMessage({status:m,logicWidth:u,logicHeight:h,absWidth:l,absHeight:c,updateRemoteInfo:t}),Xs=u,Ks=h):(Xs=-1,Ks=-1)}else if(qn){if(!Xn)return;if(t>Ws)return void Ts.timeoutReport(0,performance.now());let e=new J(Bs);if(e.storeSync(g)){var x={yuvdata:e,ntptime:y,ssrc:w,width:S,height:E,r_x:a,r_y:o,r_w:l,r_h:c,logic_w:u,logic_h:h,yuv_limited:d,isFromMainSession:p};Qn&&Qn.Put_Sharing_Data_From_Queue(x,5)}}else{const e=new Uint8Array(g);postMessage({status:_,data:e,sharing_timestamp:y,sharing_ssrc:w,sharing_width:S,sharing_height:E,rendering_x:a,rendering_y:o,rendering_w:l,rendering_h:c,logic_w:u,logic_h:h,yuv_limited:d,isFromMainSession:p},[e.buffer])}}function Qs(e,t,r,i,n,s,a,o,l,c,u,h){const d=new Uint8Array(t);var _=q().subarray(e+0,e+t);d.set(_,0);var p=i,m=n,g=s;let v=!(h==Pn);const y=u>>>0;if(ot.isUseSsrcStream())za.pushRemoteCursorFrame(p,d,m,g,y),za.pushRemoteCursorPosition(p,a,o,l,c);else if(qn){if(Qn){var b={type:"mouse_data",buffer:d,ntptime:r,ssrc:p,width:m,height:g,r_x:a,r_y:o,mLogic_w:l,mLogic_h:c,sync_id:y,isFromMainSession:v};Qn.Put_Mouse_Data_Into_Queue(b)}}else postMessage({status:f,data:d,mouse_timestamp:r,mouse_ssrc:p,mouse_width:m,mouse_height:g,mouse_x:a,mouse_y:o,mLogic_w:l,mLogic_h:c,sync_id:y,isFromMainSession:v},[d.buffer])}function Js(e,t,r,i){postMessage({status:p,ssrc:e,size:t,isFromMainSession:!(r==Pn),videomode:i})}function $s(e){dn.setSubForMe(e)}function ea(e,t,r,i){if(Jn||++en%24e4==0&&postMessage({status:u,data:"WCL_M,RTCPSN"+en}),t&&r){if(rs&&(77==e[0]||79==e[0])&&!ts){es=ae;for(var n=0;n<is;n++)PThread.allocateUnusedWorker(),PThread.loadWasmModuleToWorker(PThread.unusedWorkers[n],(function(){++ss==is&&(es=oe)}));ts=!0}if(es==se)i?vi(t,i,e.length):r(t,e,e.length);else if(es===ae)$n.enqueue(e);else if(es===oe){let i=$n.dequeue();for(;i;)r(t,i,i.length),i=$n.dequeue();r(t,e,e.length)}}}function ta(e){if(e.ssid!=gn&&Pn&&(mi(Pn),Pn=null),!Pn){let t,r=yn;t=r?r.length:0;let i=0;if(i=Pa(r),Pn=yi(e.ssid,0,0,i,t,gs,!1,!0,!1),function(){var e;const t={cmd:197,appid:2,enable:!0};null===(e=Cn)||void 0===e||e.sendCommand(t)}(),La(i),!Pn)return void postMessage({status:D});gn=e.ssid,Sn&&Ia(Pn,Sn.updateParams.userId,Sn.updateParams.sn,Sn.updateParams.encryptKey,Sn.updateParams.encryptType),wi(Pn,Wn?1:0)}Un=!0,wn?wn&&as.reader&&Nn&&(Nn=null):postMessage({status:c}),Ta()}function ra(){return rs?1:0}function ia(){return navigator.hardwareConcurrency||1}function na(){return 1}function sa(){return 1}function aa(){return!1}function oa(){return!1}function la(){return!1}function ca(){return 0}function ua(){return ji}function ha(){return Vi}function da(){return 1}function _a(){return 3}function fa(e){e instanceof ArrayBuffer&&ea(new Uint8Array(e),Pn,gi)}function pa(){return 1}function ma(e,t){var r=new Uint8Array(t),i=q().subarray(e+0,e+t);r.set(i,0,t)}function ga(e,t){Wa&&Wa.writeWasmLog(e,t)}function va(e){var t,r,i,n,s,a;for(t="",i=e.length,r=0;r<i;)switch((n=e[r++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(n);break;case 12:case 13:s=e[r++],t+=String.fromCharCode((31&n)<<6|63&s);break;case 14:s=e[r++],a=e[r++],t+=String.fromCharCode((15&n)<<12|(63&s)<<6|63&a)}return t}var ya=0,ba=Zi,wa=!1,Sa=0;const Ea=5;function xa(e){if(0!==ya?(ba=performance.now()-ya)>=Zi&&(ya=performance.now()):ya=performance.now(),("over_run"===e||ba+Ea>=Zi)&&Un&&!Vs)Un=!Un,wn&&as.reader?(Nn&&(Nn=null),as.reader.read().then((async function(e){let{done:t,value:r}=e;if(t)return H("sharing capture videoframe is done status"),void(Un=!0);let i={data:r};wa=!1,clearTimeout(Sa),Sa=0,await Da(i),wa&&(Sa=setTimeout((()=>{wa=!1,Sa=0,xa("over_run")}),0))})).catch((e=>{Un=!0,H("Error trying to process sharing frame",e)}))):Nn?(Aa(Nn),Nn=null):postMessage({status:c});else{wa=wa||!Un&&ba>=Zi;let t=performance.now();if(tn&&rn&&jn&&t-tn>3e3){if(tn=t,ls!=ue.DESKTOP_SOURCE)return;pi(Pn,jn,rn,Bn,Gn,bn),j("SHARING_STATUS:c=".concat(Un,",p=").concat(Vs,",r=").concat(e||"unknown"))}}}function Ta(){zn||(zn=setInterval((function(){xa()}),40))}function Ma(e){var t;if(Tn){var r=(new Date).getTime()/1e3;if((t=r-Tn)>10){var i=Mn-Cn.socket.bufferedAmount;0==Cn.socket.bufferedAmount?(kn=kn?.8*kn+.2*An:An,Pn&&xi(Pn,kn)):(Rn=8*i/(1*t),kn=kn?.8*kn+.2*Rn:An,Pn&&xi(Pn,kn)),Mn-=i,Tn=r}}else Mn=0,Tn=(new Date).getTime()/1e3,Pn&&xi(Pn,An);Mn+=e.length}function Ra(){var e=xn+Mn-Yn/2;return 0==Vn||e<=0?0:Vn>0?e/Vn:void 0}function ka(e,t){var r=new Uint8Array(t),i=q().subarray(e+0,e+t);r.set(i,0,t),postMessage({status:h,data:va(r)})}function Aa(e){!In&&e?postMessage({status:c,data:e.data},[e.data.buffer]):postMessage({status:c})}function Ca(e){Vn=Vn?(Vn+e)/2:e}function Fa(e,t){vn||(vn=setInterval((function(){Pn&&Ri(Pn)}),6e4));let r=new Uint8Array(t),i=q().subarray(e+0,e+t);r.set(i,0,t),yn=r,postMessage({status:g,data:r})}function Pa(e){if(!e)return 0;let t=Module._malloc(e.length);return X().subarray(t,t+e.length).set(e,0,e.length),t}function La(e){e&&Module._free(e)}async function Da(e){if((arguments.length>1&&void 0!==arguments[1]?arguments[1]:ue.DESKTOP_SOURCE)<ls){if(e&&e.data&&e.data.format)try{e.data.close()}catch(e){}return void H("UAC sharing capture format error")}if(tn=performance.now(),Ms.captureSample(),es==se||es==oe);else if(es==ae)return Un=!0,void(e.data&&wn&&(Ms.closeSample(),e.data.close()));const t=e&&e.data&&wn;if(!Pn)return void(t&&e.data.close());let r={data:null,width:0,height:0};if(t){let t=e.data,r=null,i=0,n=0,s=0,a=0,l=0,c=0,u=0,h=function(e){let t={rect:{x:0,y:0,width:0,height:0}};return e.visibleRect.left%2!=0?t.rect.x=e.visibleRect.left-1:t.rect.x=e.visibleRect.left,e.visibleRect.top%2!=0?t.rect.y=e.visibleRect.top-1:t.rect.y=e.visibleRect.top,e.visibleRect.width%2!=0?t.rect.width=e.visibleRect.width-1:t.rect.width=e.visibleRect.width,e.visibleRect.height%2!=0?t.rect.height=e.visibleRect.height-1:t.rect.height=e.visibleRect.height,t}(t);"I420"==t.format?(2!=bn&&(bn=2),a=h.rect.width,l=h.rect.height,c=a,u=l,i=a*l,n=a*l/4,s=a*l/4,rn=a*l*3/2,ao(c,u)&&(jn&&Module._free(jn),jn=Module._malloc(rn)),r=X().subarray(jn,jn+rn),await t.copyTo(r,h),Pn&&pi(Pn,jn,rn,Bn,Gn,bn)):"NV12"==t.format?(3!=bn&&(bn=3),a=h.rect.width,l=h.rect.height,c=a,u=l,i=a*l,n=a*l/2,rn=a*l*3/2,ao(c,u)&&(jn&&Module._free(jn),jn=Module._malloc(rn)),r=X().subarray(jn,jn+rn),await t.copyTo(r,h),Pn&&pi(Pn,jn,rn,Bn,Gn,bn)):"BGRA"==t.format||"RGBA"==t.format?(a=h.rect.width,l=h.rect.height,c=a,u=l,rn=a*l*4,ao(c,u),jn&&Module._free(jn),jn=Module._malloc(rn),r=X().subarray(jn,jn+rn),await t.copyTo(r,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_i(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},h)),bn=4,"RGBA"==t.format&&(bn=1),Pn&&pi(Pn,jn,rn,Bn,Gn,bn)):t.format&&(console.log("dataformat:",t.format,"is not supported"),os||(os=!0,postMessage({status:w,format:t.format}))),Ms.closeSample(),t.close()}else r=e;r&&r.data&&Pn&&(ao(r.width,r.height)&&(jn&&Module._free(jn),jn=Module._malloc(4*Bn*Gn)),1!=bn&&(bn=1),X().subarray(jn,jn+4*Bn*Gn).set(r.data,0,r.data.length),pi(Pn,jn,r.data.length,Bn,Gn,bn)),Un=!0,r&&r.data&&(Nn=r)}function Ia(e,t,r,i,n){let s=Pa(i);ki(e,s,i.length,n),La(s),s=Pa(r),Ai(e,t,s,r.length),La(s)}function Oa(e,t){var r=q().subarray(e+0,e+t);postMessage({status:u,data:va(r)})}function Ua(e,t,r,i,n,s,a){let o=new Uint8Array(r+4),l=X().subarray(t+0,t+r);o[0]=i,o[1]=n,a!=Pn&&null!=Pn&&(o[1]=2|o[1]),o.set(l,4),te(a!=Pn&&null!=Pn?Fn:Cn,o)}function Na(e,t){if(e){if(37===e[0]){let t=new Uint8Array(e);return void postMessage({status:R,data:t})}ea(e,Pn,gi,t)}}var Wa=null;var Ba=0;self.addEventListener("message",(function(e){var t,r,i,n,s,a,o,l=e.data;switch(l.command){case 1:j("STARTMEDIA:".concat(function(e){let t=e.confId,r=!!e.isPreviewMode?1:0;return r|=Ka()?2:0,"".concat(t,":").concat(r)}(l)));try{if(Oi||(Oi=setInterval((()=>{let e=vs?Xe():Pn;Ji&&e&&Ui(e,!!Jn)}),1e3)),l.isPreviewMode)break;Ka()||(Xa=!1,j("RSTHOLD")),function(e){let t=e;if(Ba=e._id,Ss=e.currentTime-performance.now(),ji=e.graphicalname,Vi=e.vendorname,_n=e.meetingnumb+"",fn=e.meetingid,is=e.multiThreadNum,gs=e.uplimit?e.uplimit:0,Jn=!!e.encode,mn=e.confId,On=Jn,t.isSafari,In=!!e.isChromeOrEdge,rs=is>1,Ke=lt,at.init(e.renderUserAgentInfo),it.init(e.renderCapabilitiesDesc),ot.init(e.renderConfigDesc),4===e.rendererType&&(ot.setIsUseSsrcStream(!0),!Jn)){const t=ct.loadModuleFromBlob("wasm_ssrc_stream_service_dynmod",e.wasmSsrcStreamServiceDynmodBlob);Ha=t,za=Ha.exports.getWasmSsrcStreamPublisher(),Ha.exports.setRegistryServicePort(e.registryServicePort),Ha.exports.exposeService("sharing")}}(l),Ya||(a=Jn?Te.SHARING_ENCODE:Te.SHARING_DECODE,Wa||null===(o=Wa=function(){let e=!1;try{e=!1}catch(e){}return e?new Ae:null}())||void 0===o||o.init({workerType:a}),Ya=!0),function(e){sn.getRendererProvider().setRendererType(e.rendererType),e.rendererDynModBlob&&sn.getRendererProvider().loadRenderModuleFromBlob(e.rendererType,e.rendererDynModBlob),sn.setCanvasAlphaChannelEnability(e.isEnableCanvasAlphaChannel),sn.getRendererProvider().isWebGPURendererType()&&sn.getWebGPUResMgr(2).initialize()}(l),function(e){if(!e.websocket_ip_address)return;let t=e.websocket_ip_address+"&mode=1";var r,i;Jn&&(t=e.websocket_ip_address.slice(0,e.websocket_ip_address.length-42)+"s"+e.websocket_ip_address.slice(e.websocket_ip_address.length-41,e.websocket_ip_address.length)+"&mode=2"),Jn?!Jn||(r=Cn,!(i=t)||r&&r.url==i)||Rs(t):function(e){if(Jn)return;if(j("WSURL:false:".concat(e.replace(/(\/media\/)\d+/,"$1".concat(an)))),Cn)return void Cn.resetURL(e);let t=new Yr(e,Ir.SHARE_DECODE);t.setOnMessage(Na),t.onopen=ks,t.onclose=Fs,t.oncommand=Ls,Cn=t,(ro.sender||ro.reciver)&&Cn.setSabBuffer(ro.sender,ro.reciver)}(t)}(l),Jn||(Bs||(Bs=new Q(5,Ws=15728640)),qa()),postMessage({status:Pn||Jn?16:D})}catch(e){postMessage({status:D}),H("sharing startr media error",e)}break;case 2:Oi&&(clearInterval(Oi),Oi=null),Pn&&mi(Pn),Pn=null,Dn&&mi(Dn),Dn=null,close();break;case"ENCRYPT":Wn=l.encrypt,Pn&&wi(Pn,Wn?1:0);break;case 11:Gs.panelpollingInterval=l.data.pollingInterval,Gs.sharingmonitorPanelFlag=l.data.enable,Hs();break;case 160:js.sharingStatisticsFlag=l.data.enable,zs(js.sharingStatisticsFlag);break;case"start_share_processor":di.startProcessor(l.name,new ui(l.name,on));break;case"share_processor_message_port":on=l.data;break;case"stop_share_processor":di.stopProcessor(l.name);break;case"startSharingEncode":Ji=!0,bn=1,wn=!!l.isSupportMediaStreamTrackProcessor,rs&&es==se?function(e){if(rs&&!ts){es=ae;for(var t=0;t<is;t++)PThread.allocateUnusedWorker(),PThread.loadWasmModuleToWorker(PThread.unusedWorkers[t],(function(){++ss==is&&(es=oe,ts=!0,ta(e))}))}}(l):ta(l),Ms.start(),Vs=!1,l.isWhiteboardSharing||dn.startCheck();break;case"stopsharingencode":as.closeReadStream();break;case"frameStream":as.setReadStream(l.data);break;case 12:as.createReadStream(l.data);break;case"encodeSharingFrame":l&&Da(l);break;case"pause":Pn&&Si(Pn),Un=!1,ya=0,Vs=!0,dn.stopCheck();break;case"stopsharing":Za();break;case"resume":Pn&&Ei(Pn),Da({data:null}),ya=0,Vs=!1,dn.startCheck();break;case"SOCKET_RECONNECT":self.IS_DISABLE_SOCKET_RECONNECT=!0===l.disable;break;case"SharingPlayStatus":Xn=l.isSharingPlayWork;break;case 16:{var c;j("ASCANVAS:".concat(l.ssrc,":").concat(l.isFromMainSession,":").concat(l.rendercanvasID,":").concat(!!l.canvas)),Xn=!0,qn=!0;const e=l.isCreateSharingWaterMark,t=l.sharingWaterMarkName;if(pn=l.ssrc,Zn||(Zn=new OffscreenCanvas(0,0)),hn||(hn=new Oe({timeout:3e4,tag:"ASRENDER",callback:xs})),Qn||((Qn=new xe(Object.assign({},{Notify_APPUI:null,PubSub:null,jsMediaEngine:null,renderManager:sn}))).statisticObj=hn,self.SharingRenderObj=Qn),Qn.addRender(l.ssrc,l.zone,l.isFromMainSession,l.canvas,l.rendercanvasID,l.viewPort),Qn.Change_Current_SSRC(pn,l.isFromMainSession),Qn.Set_WaterMark_Info({waterMarkCanvas:Zn,isCreateSharingWaterMark:e,sharingWaterMarkName:t,watermarkOpacity:l.watermarkOpacity,watermarkRepeated:l.watermarkRepeated,watermarkPosition:l.watermarkPosition}),Kn&&clearInterval(Kn),!ot.isUseSsrcStream()){var u=Qn.No_Bindthis_Interval.bind(Qn);Kn=setInterval(u,50),self.sharingRenderInterval=Kn}null===(c=Qn.statisticObj)||void 0===c||c.start()}break;case 15:{var h;const{ssrc:e,zone:t=0,isFromMainSession:r}=l;var d;e?Qn.removeRender(e,t,r):Qn.removeAllRender(),null!==(h=Qn)&&void 0!==h&&h.isHasRender()&&e||(Ji=!1,Xn=!1,null===(d=Qn)||void 0===d||null===(d=d.statisticObj)||void 0===d||d.stop(),Kn&&(clearInterval(Kn),Kn=null),Gi&&(clearInterval(Gi),Gi=0),qs=new Map)}break;case 19:qs.delete(l.ssrc);break;case 14:var _;null===(_=Qn)||void 0===_||_.updateViewPort(l);break;case 17:j("ASU:".concat(l.ssrc,":").concat(!!l.isFromMainSession)),pn=l.ssrc,Qn||(Qn=new xe(Object.assign({},{Notify_APPUI:null,PubSub:null,jsMediaEngine:null,renderManager:sn}))),Qn.Change_Current_SSRC(pn,l.isFromMainSession);break;case 129:{let e=l.data.userNodeList;e&&e.forEach((e=>{let t=parseInt(e.userid);if(e.bremove)return void(Pn&&Mi(Pn,t));let r=e.sn;if(16!=r.length&&32!=r.length)return;let i=Pa(r);if(Pn){let e=!1;Jn&&mn!=t||(e=!0),e&&Ti(Pn,t,i,r.length)}La(i)}));break}case 18:{const{id:e,width:t,height:r}=l.data;Qn&&(Qn.setOnlyAcceptUISize(!0),Qn.updateOffscreenCanvasSize(e,t,r,!0));break}case"BUILD_MS_CHANNEL_IN_BO":t=io,r=l.data,i=ea,n=gi,Ue=t(r,He,ze,Ye),Be=i,We=n;break;case"SHARING_REMOVE_REV_CHANNEL_TYPE":{let e=l.data;j("ASD:".concat(e.ssrc,":").concat(!!e.isFromMainSession)),e.isFromMainSession?Ne&&so(Ne,e.ssrc):Pn&&so(Pn,e.ssrc)}break;case 157:{let e=l.data;j("ASC:".concat(e.ssrc,":").concat(!!e.isFromMainSession)),e.isFromMainSession?Xe()?qe(no,e):ys.push(e):Pn?no(Pn,e.ssrc,e.streamIndex,e.videoMode):bs.push(e)}break;case 9:{let e=l.data;if(e.isFromMainSession)Dn=function(e,t,r,i,n){if(Ge=i,je=n,e){Ne=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?e(r.userId,0,0,0,0,!1,0,!0):e(r.userId,0,0,0,0,0,!1,!1,!0);let i=Ge(r.encryptKey);return t(Ne,i,r.encryptKey.length,r.encryptType),je(i),Ne}return 0}(yi,ki,e.updateParams,Pa,La),ys.length>0&&(H("retry add recv channel for master share"),ys.forEach((e=>{qe(no,e)})),ys=[]),Ni(Dn,2);else if(Sn=e,On)Pn&&Ia(Pn,Sn.updateParams.userId,Sn.updateParams.sn,Sn.updateParams.encryptKey,Sn.updateParams.encryptType);else if(Pn){let t=Pa(e.updateParams.encryptKey);ki(Pn,t,e.updateParams.encryptKey.length,e.updateParams.encryptType),La(t)}}break;case 10:{let e=l.data;if(e.isFromMainSession)!function(e,t){if(Ne&&t.body){if(t.body.add){let r=0,i=t.body.add;for(;r<i.length;r++){let t=Ge(i[r].sn);e(Ne,i[r].userid,t,i[r].sn.length),je(t)}}t.body.remove}}(Ai,e);else if(Pn&&e.body){if(e.body.add){let t=0,r=e.body.add;for(;t<r.length;t++){let e=Pa(r[t].sn);Ai(Pn,r[t].userid,e,r[t].sn.length),La(e)}}e.body.remove}}break;case"SWITCH_WATER_MARK_FLAG":if(ot.setIsSharingHasWaterMark(l.isCreateSharingWaterMark),ot.setSharingWatermarkInfo({name:l.videoWaterMarkName,opacity:l.watermarkOpacity,repeated:l.watermarkRepeated,position:l.watermarkPosition}),Qn){const e=l.isCreateSharingWaterMark;e&&(Zn||(Zn=new OffscreenCanvas(0,0)));const t=l.sharingWaterMarkName||"";Qn.Set_WaterMark_Info({waterMarkCanvas:Zn,isCreateSharingWaterMark:e,sharingWaterMarkName:t,watermarkOpacity:l.watermarkOpacity,watermarkRepeated:l.watermarkRepeated,watermarkPosition:l.watermarkPosition})}break;case"startVideoEncode":gs/=2,Pn&&Pi(Pn,gs);break;case"stopVideoEncode":gs*=2,Pn&&Pi(Pn,gs);break;case 127:{var f;const{canvas:e,canvasId:t}=l.data||{};if(e&&null!==(f=Qn)&&void 0!==f&&f.isSharingCanvas(t)){Qn.replaceCanvas(t,e);break}}break;case 128:{var p;const e=l.rendercanvasID;var m;null!==(p=Qn)&&void 0!==p&&p.isSharingCanvas(e)&&(null===(m=Qn)||void 0===m||m.replaceCanvas(e,null));break}case 13:Ji=!0,Gi||(Gi=setInterval((()=>{Wi(Pn)}),50)),$i||($i=!0,"function"==typeof SharedArrayBuffer&&wasmMemory.buffer instanceof SharedArrayBuffer&&function(){const e=601508;Bi||(null!=(Bi=Module._malloc(e))?(Atomics.store(K().subarray(Bi/4,Bi/4+e),0,0),Atomics.store(K().subarray(Bi/4,Bi/4+e),1,0),ro.reciver={sab:wasmMemory,offset:Bi,length:e,interval:10,useCopy:!1,useOneElement:!1},!Jn&&Cn&&Cn.setSabBuffer(null,ro.reciver)):console.log("malloc failed"))}());break;case"WHITEBOARD_JOIN_MESSAGE":if(Ln||Ia(Ln=yi(l.nodeId,"1","1",0,0,0,!1,!0,!1),l.nodeId,l.sn,l.encryptKey,2),!Qi.get(l.dcsId)){Qi.set(l.dcsId,!0);let e=Pa(l.EncodedSn);Ai(Ln,l.dcsId,e,l.EncodedSn.length),La(e),wi(Ln,1)}if(Ln){Ii(Ln,0,l.dcsId,0);let e=Pa(l.data);Ii(Ln,1,e,l.data.length),La(e)}break;case"audioTimestamp":Qn&&Qn.SetcATimeStamp(l.data);break;case"vsport":En&&(En.close(),En=null),(En=e.ports[0]).onmessage=function(e){Qn&&Qn.SetcATimeStamp(e.data)};break;case 130:{let e=l.data||{},t=!!e.hold;j("HOLD:".concat(t,":").concat(e.userid,":").concat(e.reinit)),t?function(e){if(Xa)return;if(mn&&e.userid&&e.userid>>10!=mn>>10)return void j("HOLDINVALID");Xa=!0,Jn&&Za();let t=Pn;Pn=null,t&&mi(t),Ln&&(mi(Ln),Ln=null),Qi.clear()}(e):(s=e,Xa&&(Xa=!1,s.reinit&&(mn=s.userid,Pn||0==Ba||(qa(),postMessage({status:Pn||Jn?16:D})))))}break;case"SEND_ANNOTATION_PDU":var g;l.data instanceof Uint8Array&&(null===(g=Cn)||void 0===g||g.send(l.data));break;case 133:!function(e){let t=e.content_type,r=e.cmd,i=e.type;"PDU"==t&&(r=re(r),4==i&&Cs(r))}(l.data);break;case 139:{const{ssrc:e,type:t,id:r}=l;!function(e,t,r,i){let n={id:i,status:138,success:!1};try{const{canvasId:r,options:i}=(null==e?void 0:e.getUserIdVideo(t))||{};n.success=!!r,n.data={canvasId:r,options:i},postMessage(n)}catch(e){postMessage(n)}}(Qn,e,0,r);break}case 144:(Ga=l.data)!=Xr.child&&qi(Pn,2,!1);break;case 147:{const{type:e,meetinguuid:t,mmrsigkey:r}=l;if(Ga==Xr.child&&Pn){const i=2==e||1==e;if(Yi(Pn,2,t,t.length),2==e){let e=re(r);Hi(Pn,2,e,e.length)}zi(Pn,2,e),qi(Pn,2,i)}else Pn&&qi(Pn,2,!1);break}case"SWITCH_SHARING_TYPE":{let e=l.data;Zi=3===e?40:150,zn&&xa();break}}}));var Ga=Xr.normal;function ja(){return!1}function Va(e){console.log(">>> Set_Share_Mode_js")}let Ha,za;var Ya=!1;function qa(){if(!Ka())return;if(gn==mn&&Pn)return;Pn&&(mi(Pn),Pn=null),Pn=yi(mn,_n,fn,0,0,gs,!1,!1,!1);let e=Sn;if(e&&Pn){let t=Pa(e.updateParams.encryptKey);ki(Pn,t,e.updateParams.encryptKey.length,e.updateParams.encryptType),La(t),gn=mn}bs.length>0&&(H("retry add recv channel for share decode"),bs.forEach((e=>{no(Pn,e.ssrc,e.streamIndex,e.videoMode)})),bs=[])}var Xa=!1;function Ka(){return!Xa}function Za(){Ms.stop(),vn&&(clearInterval(vn),vn=null),Pn&&new ge,zn&&(clearInterval(zn),zn=0),Un=!1,xn=0,ya=0,rn=0,tn=0,ns=!0,Vs=!1,Ji=!1,ls=ue.DESKTOP_SOURCE,es!=se&&setTimeout((function(){ns&&(PThread.terminateAllThreads(),ts=!1,es=se,ss=0,console.log("terminate multiple threads"))}),6e5),dn.stopCheck()}function Qa(){return-1}function Ja(){return!1}function $a(){return Ss}function eo(e,t){j("TO:"+Ss+", CT:"+performance.now()+", NT:"+(e>>>0)+","+(t>>>0))}var to,ro={};function io(e,t,r,i){if(Jn)return null;if(j("WSURL:false:".concat(e.replace(/(\/media\/)\d+/,"$1".concat(an)))),Fn)return Fn.resetURL(e),n.setOnMessage(r),Fn.onopen=t,Fn.onclose=i,Fn;let n=new Yr(e,Ir.MSHARE_DECODE);return n.setOnMessage(r),n.onopen=t,n.onclose=i,n.oncommand=Ls,Fn=n,n}function no(e,t,r,i){-1!=ws.findIndex((r=>r.handle==e&&r.ssrc==t))&&(so(e,t),H("Duplicate add sharing recv ".concat(t))),Ci(e,t,r,i),j("ASCHANNEL:".concat(t,":").concat(r)),ws.push({ssrc:t,index:r,videoMode:i,handle:e})}function so(e,t){let r=ws.findIndex((r=>r.handle==e&&r.ssrc==t));-1!=r&&ws.splice(r,1),Fi(e,t),j("RMASCHANNEL:".concat(t))}function ao(e,t){return(Bn!=e||Gn!=t)&&(postMessage({status:y,width:e,height:t}),Bn=e,Gn=t,!0)}!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{const t="undefined"!=typeof DedicatedWorkerGlobalScope;if(Br.dataTransportMgr)return;let r=new Dr({type:t?Dr.THREAD_SUB:Dr.THREAD_MAIN,remote:t?self:null});Br.dataTransportMgr=r,r.monitorlogfn=e,Hr.target||(Hr.target=new Hr(r),r.addTransportListChangeListener(Hr.target)),t&&self.addEventListener("message",r._onrecvmainthreadlistener.bind(r))}catch(e){console.error("<<<< InitDataTransportModule",e)}}(),to=self,zr.instance||(zr.instance=new zr),zr.instance.start(to);let oo=function(){let e=0;try{const t="function"==typeof MediaStreamTrack,r="function"==typeof MediaStreamTrackProcessor,i="function"==typeof VideoTrackGenerator;if(e|="function"==typeof OffscreenCanvas?1:0,e|=r&&t?4:0,e|=i&&t?8:0,1&e){let t=new OffscreenCanvas(1,1),r=t.getContext("webgl");e|=null!=r?2:0,r=null,t=null}}catch(e){}return e}();function lo(e,t,r){var i;dn.setRtpPackets();let n=new Uint8Array(4+t);var s=X().subarray(e,e+t);n[0]=r,n.set(s,4),null===(i=Cn)||void 0===i||i.send(n)}function co(e,t,r,i){var n,s;let a=new Uint8Array(4+t);var o=X().subarray(e,e+t);a[0]=r,a.set(o,4),i==Pn?null===(n=Cn)||void 0===n||n.send(a):null===(s=Ue)||void 0===s||s.send(a)}function uo(e,t,r){var i,n;let s=new Uint8Array(4+t);var a=X().subarray(e,e+t);s[0]=r,s.set(a,4),handle==Pn?null===(i=Cn)||void 0===i||i.send(s):null===(n=Ue)||void 0===n||n.send(s)}function ho(e,t,r){var i,n,s=X().subarray(e,e+t);let a=new Uint8Array(t);a.set(s,0),r==Pn?null===(i=Cn)||void 0===i||i.send(a):null===(n=Ue)||void 0===n||n.send(a)}function _o(e,t,r){var i,n,s=X().subarray(e,e+t);let a=new Uint8Array(t);a.set(s,0),r==Pn?null===(i=Cn)||void 0===i||i.send(a):null===(n=Ue)||void 0===n||n.send(a)}function fo(e,t,r,i){let n={ismain:i!=Pn,cmd:F,mode:r};Cn.sendCommand&&Cn.sendCommand(n)}function po(e,t){}self.postMessage({status:139,data:oo}),Object.keys(e).forEach((t=>self[t]=e[t]))})()})(),self.__wasmCodeDataEndFlag=1,(Module=void 0!==Module?Module:{}).locateFile=function(e){if(e.endsWith("wasm"))return wasmUrl},Module.instantiateWasm=function(e,t){return self.downloadAndInstantiateWebAssembly(e,t),{}},isZoomWasm32Bit&&(Module.wasmMemory=new WebAssembly.Memory({initial:(nonsabVB,1024),maximum:nonsabVB?1024:4096})),Module.onRuntimeInitialized=function(){postMessage({status:wasmSuccessEvent}),self.onWasmModuleReady()},Module.onAbort=function(e){postMessage({status:wasmFailEvent,data:e})};var read_,readAsync,readBinary,setWindowTitle,Module=void 0!==Module?Module:{},moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,t)=>{throw t},ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:"undefined"!=typeof document&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=0!==scriptDirectory.indexOf("blob:")?scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1):"",read_=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=(e,t,r)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)},setWindowTitle=e=>document.title=e);var out=Module.print||console.log.bind(console),err=Module.printErr||console.warn.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var wasmBinary,POINTER_SIZE=4;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var wasmMemory,noExitRuntime=Module.noExitRuntime||!0;"object"!=typeof WebAssembly&&abort("no native wasm support detected");var EXITSTATUS,ABORT=!1;function assert(e,t){e||abort(t)}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,t,r){for(var i=t+r,n=t;e[n]&&!(n>=i);)++n;if(n-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,n));for(var s="";t<n;){var a=e[t++];if(128&a){var o=63&e[t++];if(192!=(224&a)){var l=63&e[t++];if((a=224==(240&a)?(15&a)<<12|o<<6|l:(7&a)<<18|o<<12|l<<6|63&e[t++])<65536)s+=String.fromCharCode(a);else{var c=a-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&a)<<6|o)}else s+=String.fromCharCode(a)}return s}function UTF8ToString(e,t){return e?UTF8ArrayToString(HEAPU8,e,t):""}function stringToUTF8Array(e,t,r,i){if(!(i>0))return 0;for(var n=r,s=r+i-1,a=0;a<e.length;++a){var o=e.charCodeAt(a);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),o<=127){if(r>=s)break;t[r++]=o}else if(o<=2047){if(r+1>=s)break;t[r++]=192|o>>6,t[r++]=128|63&o}else if(o<=65535){if(r+2>=s)break;t[r++]=224|o>>12,t[r++]=128|o>>6&63,t[r++]=128|63&o}else{if(r+3>=s)break;t[r++]=240|o>>18,t[r++]=128|o>>12&63,t[r++]=128|o>>6&63,t[r++]=128|63&o}}return t[r]=0,r-n}function stringToUTF8(e,t,r){return stringToUTF8Array(e,HEAPU8,t,r)}function lengthBytesUTF8(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);i<=127?t++:i<=2047?t+=2:i>=55296&&i<=57343?(t+=4,++r):t+=3}return t}function updateGlobalBufferAndViews(e){buffer=e,Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}var wasmTable,INITIAL_MEMORY=Module.INITIAL_MEMORY||37748736;(wasmMemory=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768}))&&(buffer=wasmMemory.buffer),INITIAL_MEMORY=buffer.byteLength,updateGlobalBufferAndViews(buffer);var __ATPRERUN__=[],__ATINIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,Module.noFSInit||FS.init.initialized||FS.init(),FS.ignorePermissions=!1,TTY.init(),PIPEFS.root=FS.mount(PIPEFS,{},null),callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){throw Module.onAbort&&Module.onAbort(e),err(e="Aborted("+e+")"),ABORT=!0,EXITSTATUS=1,e+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(e)}var wasmBinaryFile,tempDouble,tempI64,dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(e){return e.startsWith(dataURIPrefix)}function isFileURI(e){return e.startsWith("file://")}function getBinary(e){try{if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}catch(e){abort(e)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if("function"==typeof fetch&&!isFileURI(wasmBinaryFile))return fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+wasmBinaryFile+"'";return e.arrayBuffer()})).catch((function(){return getBinary(wasmBinaryFile)}));if(readAsync)return new Promise((function(e,t){readAsync(wasmBinaryFile,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return getBinary(wasmBinaryFile)}))}function createWasm(){var e={env:asmLibraryArg,wasi_snapshot_preview1:asmLibraryArg};function t(e,t){var r=e.exports;Module.asm=r,wasmTable=Module.asm.__indirect_function_table,addOnInit(Module.asm.__wasm_call_ctors),removeRunDependency("wasm-instantiate")}function r(e){t(e.instance)}function i(t){return getBinaryPromise().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){err("failed to asynchronously prepare wasm: "+e),abort(e)}))}if(addRunDependency("wasm-instantiate"),Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(e){return err("Module.instantiateWasm callback failed with error: "+e),!1}return wasmBinary||"function"!=typeof WebAssembly.instantiateStreaming||isDataURI(wasmBinaryFile)||isFileURI(wasmBinaryFile)||"function"!=typeof fetch?i(r):fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return err("wasm streaming compile failed: "+e),err("falling back to ArrayBuffer instantiation"),i(r)}))})),{}}isDataURI(wasmBinaryFile="video.simd.wasm")||(wasmBinaryFile=locateFile(wasmBinaryFile));var ASM_CONSTS={554464:e=>{console.log("Video Version: ",e)},554501:(e,t,r)=>{js_info_from_wcl(e,t,r)},554535:e=>{change_capture_resolution(e)},554570:(e,t,r,i,n,s,a,o,l,c)=>{processed_capture_data_callback(e,t,r,i,n,s,a,o,l,c)},554647:(e,t,r,i,n,s,a,o,l,c,u,h)=>{frame_callback(e,t,r,i,n,s,a,o,l,c,u,h)},554717:(e,t,r,i,n,s,a,o,l,c,u,h)=>{frame_callback_webcodec(e,t,r,i,n,s,a,o,l,c,u,h)},554796:(e,t)=>{decode_callback(e,t)},554825:(e,t,r)=>{js_info_from_wcl(e,t,r)},554859:(e,t)=>{video_rtp_data(e,t)},554884:(e,t,r)=>{video_rtcp_data(e,t,r)},554914:(e,t,r,i,n,s)=>{js_info_from_wcl_video_data(e,t,r,i,n,s)},554971:e=>{Exit_Thread(e)},554989:e=>Before_Create_Thread(e),555026:e=>Before_Create_Thread(e),555063:(e,t)=>{APP_Troubleshoting_Info(e,t)},555097:(e,t,r)=>{network_quality_callback(e,t,r)},555137:(e,t)=>{MCMMonitor_Video_LOG(e,t)},555167:(e,t,r,i,n,s,a,o,l,c,u,h,d,_,f)=>{sender_stats_log(e,t,r,i,n,s,a,o,l,c,u,h,d,_,f)},555257:(e,t,r,i,n,s,a,o,l,c,u,h,d,_,f)=>{receiver_stats_log(e,t,r,i,n,s,a,o,l,c,u,h,d,_,f)},555349:e=>{SubScribeUpdateVideo(e)},555377:(e,t)=>{send_data(e,t)},555400:e=>{SubScribeUpdateVideo(e)},555428:(e,t,r,i,n,s,a,o,l,c)=>{responseVideoQosData(e,t,r,i,n,s,a,o,l,c)},555489:(e,t)=>{SAVE_IV(e,t)},555507:()=>Date.now(),555530:()=>getNTPBaseTime(),555559:()=>performance.now(),555589:(e,t)=>{reportSenderNTPTime(e,t)},555622:(e,t)=>{Update_Required_Bandwidth(e,t)},555658:e=>{Update_Video_Hd_Info(e)},555686:(e,t,r,i,n)=>{on_psl_mix_share_info_changed(e,t,r,i,n)},555738:e=>{console.log("Sharing Version: ",e)},555777:(e,t)=>{share_rtp_data(e,t)},555802:(e,t,r)=>{SAVE_IV(e,t,r)},555824:(e,t,r)=>{share_rtp_raw_data(e,t,r)},555857:(e,t,r,i)=>{share_rtcp_data(e,t,r,i)},555890:(e,t,r,i)=>{share_rtcp_raw_data(e,t,r,i)},555927:(e,t,r,i)=>{share_mouse_data(e,t,r,i)},555962:(e,t,r)=>{share_mouse_raw_data(e,t,r)},555997:(e,t,r)=>{APP_Troubleshoting_Info(e,t,r)},556035:(e,t,r,i)=>{decode_callback(e,t,r,i)},556072:(e,t,r)=>{on_keyframe_request(e,t,r)},556109:(e,t,r)=>{on_keyframe_request_ex(e,t,r)},556149:(e,t,r,i,n,s,a,o,l,c,u,h,d,_)=>{frame_callback_video_mode(e,t,r,i,n,s,a,o,l,c,u,h,d,_)},556240:(e,t,r,i,n,s,a,o,l,c,u,h)=>{frame_callback_mouse_video_mode(e,t,r,i,n,s,a,o,l,c,u,h)},556327:(e,t)=>{MCMMonitor_Sharing_LOG(e,t)},556359:(e,t,r,i,n,s,a)=>{Send_Out_Qos(e,t,r,i,n,s,a)},556404:e=>{SubScribeUpdateSharing(e)},556434:e=>{SubScribeUpdateSharing(e)},556464:e=>{Update_WebSokcet_Speed(e)},556496:(e,t,r,i,n,s,a,o,l,c)=>{responseSharingQosData(e,t,r,i,n,s,a,o,l,c)},556559:(e,t)=>{SAVE_IV(e,t)},556577:e=>{console.error("tjDecompressHeader3 error %d ",e)},556630:e=>{console.error("tjDecompress2 error %d ",e)},556677:(e,t)=>{on_share_encode_start(e,t)},556709:(e,t)=>{on_share_encode_start(e,t)},556741:(e,t,r,i)=>{sharing_decode_channel_change(e,t,r,i)},556788:(e,t,r,i)=>{sharing_decode_channel_change(e,t,r,i)},556835:(e,t)=>{Update_Required_Bandwidth(e,t)},556871:(e,t,r)=>{Send_Wb_Rtp_Packet(e,t,r)},556902:(e,t)=>{Recieve_Wb_Packet(e,t)},556929:(e,t)=>{COMMIT_PRINT(e,t)},556951:()=>Module.getRandomValue(),556987:()=>{if(void 0===Module.getRandomValue)try{var e="object"==typeof window?window:self,t=void 0!==e.crypto?e.crypto:e.msCrypto,r=function(){var e=new Uint32Array(1);return t.getRandomValues(e),e[0]>>>0};r(),Module.getRandomValue=r}catch(e){try{var i=require("crypto"),n=function(){var e=i.randomBytes(4);return(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0};n(),Module.getRandomValue=n}catch(e){throw"No secure random number generator found"}}},557709:()=>{videoencode_create_helpthread()},557744:(e,t)=>{LOG_OUT(e,t)},557765:(e,t)=>{wcl_trace_log(e,t)}};function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function callRuntimeCallbacks(e){for(;e.length>0;)e.shift()(Module)}function withStackSave(e){var t=stackSave(),r=e();return stackRestore(t),r}function demangle(e){return demangle.recursionGuard=1+(0|demangle.recursionGuard),demangle.recursionGuard>1?e:withStackSave((function(){try{var t=e;t.startsWith("__Z")&&(t=t.substr(1));var r=lengthBytesUTF8(t)+1,i=stackAlloc(r);stringToUTF8(t,i,r);var n=stackAlloc(4),s=___cxa_demangle(i,0,0,n);if(0===HEAP32[n>>2]&&s)return UTF8ToString(s)}catch(e){}finally{_free(s),demangle.recursionGuard<2&&--demangle.recursionGuard}return e}))}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function demangleAll(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){var t=demangle(e);return e===t?e:t+" ["+e+"]"}))}function _AdapterWhiteListCheck(){return checkWebCodecWhitelist_js()}function _CloseVideoEncoder(e){CloseVideoEncoder_js(e)}function _CreateGltPlatform(){err("missing function: CreateGltPlatform"),abort(-1)}function _DestroyGltPlatform(){err("missing function: DestroyGltPlatform"),abort(-1)}function _GetEncoderState(e){return GetEncoderState_js(e)}function _GetLogLevel(){return GetLogLevel_js()}function _GetWebCodecsEncoderFallbackFlag(){return GetWebCodecsEncoderFallbackFlag_js()}function _GetWebCodecsEncoderL1T2Flag(){return GetWebCodecsEncoderL1T2Flag_js()}function _InitVideoDecoder(e,t){return InitVideoDecoder_js(e,t)}function _InitVideoEncoder(e,t){return InitVideoEncoder_js(e,t)}function _LimitWebCodecsDecoderTo360(){return LimitWebCodecsDecoderTo360_js()}function _LimitWebCodecsEncoderTo360(){return LimitWebCodecsEncoderTo360_js()}function _Set_Share_Mode(e){return Set_Share_Mode_js(e)}function _UserAgentIsTesla(){return UserAgentIsTesla_js()}function _VideoDecoder(e,t,r,i,n){return VideoDecoder_js(e,t,r,i,n)}function _VideoDecoderConfigure(e,t,r,i,n){return VideoDecoderConfigure_js(e,t,r,i,n)}function _VideoEncoderConfigure(e,t,r,i,n,s){return VideoEncoderConfigure_js(e,t,r,i,n,s)}function _WebCodecsDecoderFail(e){WebCodecsDecoderFail_js(e)}function _WebCodecsEncoderFail(e,t){WebCodecsEncoderFail_js(e,t)}function _WebCodecsVideoEncoder(e,t,r,i,n,s){return VideoEncoder_js(e,t,r,i,n,s)}function __ZN11cpt_generic6thread4joinEv(){err("missing function: _ZN11cpt_generic6thread4joinEv"),abort(-1)}function __ZN11cpt_generic6threadD1Ev(){err("missing function: _ZN11cpt_generic6threadD1Ev"),abort(-1)}function __ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE(){err("missing function: _ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE"),abort(-1)}function ___assert_fail(e,t,r,i){abort("Assertion failed: "+UTF8ToString(e)+", at: "+[t?UTF8ToString(t):"unknown filename",r,i?UTF8ToString(i):"unknown function"])}function ___cxa_allocate_exception(e){return _malloc(e+24)+24}var exceptionCaught=[];function exception_addRef(e){e.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(e){var t=new ExceptionInfo(e);return t.get_caught()||(t.set_caught(!0),uncaughtExceptionCount--),t.set_rethrown(!1),exceptionCaught.push(t),exception_addRef(t),t.get_exception_ptr()}var exceptionLast=0;function ExceptionInfo(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){HEAPU32[this.ptr+4>>2]=e},this.get_type=function(){return HEAPU32[this.ptr+4>>2]},this.set_destructor=function(e){HEAPU32[this.ptr+8>>2]=e},this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]},this.set_refcount=function(e){HEAP32[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,HEAP8[this.ptr+12|0]=e},this.get_caught=function(){return 0!=HEAP8[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,HEAP8[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=HEAP8[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=e+1},this.release_ref=function(){var e=HEAP32[this.ptr>>2];return HEAP32[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){HEAPU32[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]},this.get_exception_ptr=function(){if(___cxa_is_pointer_type(this.get_type()))return HEAPU32[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function ___cxa_free_exception(e){return _free(new ExceptionInfo(e).ptr)}var wasmTableMirror=[];function getWasmTableEntry(e){var t=wasmTableMirror[e];return t||(e>=wasmTableMirror.length&&(wasmTableMirror.length=e+1),wasmTableMirror[e]=t=wasmTable.get(e)),t}function exception_decRef(e){if(e.release_ref()&&!e.get_rethrown()){var t=e.get_destructor();t&&getWasmTableEntry(t)(e.excPtr),___cxa_free_exception(e.excPtr)}}function ___cxa_end_catch(){_setThrew(0),exception_decRef(exceptionCaught.pop()),exceptionLast=0}function ___resumeException(e){throw exceptionLast||(exceptionLast=e),e}function ___cxa_find_matching_catch_2(){var e=exceptionLast;if(!e)return setTempRet0(0),0;var t=new ExceptionInfo(e);t.set_adjusted_ptr(e);var r=t.get_type();if(!r)return setTempRet0(0),e;for(var i=0;i<arguments.length;i++){var n=arguments[i];if(0===n||n===r)break;var s=t.ptr+16;if(___cxa_can_catch(n,r,s))return setTempRet0(n),e}return setTempRet0(r),e}function ___cxa_find_matching_catch_3(){var e=exceptionLast;if(!e)return setTempRet0(0),0;var t=new ExceptionInfo(e);t.set_adjusted_ptr(e);var r=t.get_type();if(!r)return setTempRet0(0),e;for(var i=0;i<arguments.length;i++){var n=arguments[i];if(0===n||n===r)break;var s=t.ptr+16;if(___cxa_can_catch(n,r,s))return setTempRet0(n),e}return setTempRet0(r),e}function ___cxa_find_matching_catch_4(){var e=exceptionLast;if(!e)return setTempRet0(0),0;var t=new ExceptionInfo(e);t.set_adjusted_ptr(e);var r=t.get_type();if(!r)return setTempRet0(0),e;for(var i=0;i<arguments.length;i++){var n=arguments[i];if(0===n||n===r)break;var s=t.ptr+16;if(___cxa_can_catch(n,r,s))return setTempRet0(n),e}return setTempRet0(r),e}function ___cxa_rethrow(){var e=exceptionCaught.pop();e||abort("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(exceptionCaught.push(e),e.set_rethrown(!0),e.set_caught(!1),uncaughtExceptionCount++),exceptionLast=t,t}function ___cxa_throw(e,t,r){throw new ExceptionInfo(e).init(t,r),exceptionLast=e,uncaughtExceptionCount++,e}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function ___stack_chk_fail(){err("missing function: __stack_chk_fail"),abort(-1)}function setErrNo(e){return HEAP32[___errno_location()>>2]=e,e}var PATH={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,i=e.length-1;i>=0;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=PATH.isAbs(e),r="/"===e.substr(-1);return(e=PATH.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=PATH.splitPath(e),r=t[0],i=t[1];return r||i?(i&&(i=i.substr(0,i.length-1)),r+i):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=PATH.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return PATH.normalize(e.join("/"))},join2:(e,t)=>PATH.normalize(e+"/"+t)};function getRandomDevice(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}return()=>abort("randomDevice")}var PATH_FS={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var i=r>=0?arguments[r]:FS.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";e=i+"/"+e,t=PATH.isAbs(i)}return(t?"/":"")+(e=PATH.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);for(var i=r(e.split("/")),n=r(t.split("/")),s=Math.min(i.length,n.length),a=s,o=0;o<s;o++)if(i[o]!==n[o]){a=o;break}var l=[];for(o=a;o<i.length;o++)l.push("..");return(l=l.concat(n.slice(a))).join("/")}};function intArrayFromString(e,t,r){var i=r>0?r:lengthBytesUTF8(e)+1,n=new Array(i),s=stringToUTF8Array(e,n,0,n.length);return t&&(n.length=s),n}var TTY={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){TTY.ttys[e]={input:[],output:[],ops:t},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open:function(e){var t=TTY.ttys[e.node.rdev];if(!t)throw new FS.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,t,r,i,n){if(!e.tty||!e.tty.ops.get_char)throw new FS.ErrnoError(60);for(var s=0,a=0;a<i;a++){var o;try{o=e.tty.ops.get_char(e.tty)}catch(e){throw new FS.ErrnoError(29)}if(void 0===o&&0===s)throw new FS.ErrnoError(6);if(null==o)break;s++,t[r+a]=o}return s&&(e.node.timestamp=Date.now()),s},write:function(e,t,r,i,n){if(!e.tty||!e.tty.ops.put_char)throw new FS.ErrnoError(60);try{for(var s=0;s<i;s++)e.tty.ops.put_char(e.tty,t[r+s])}catch(e){throw new FS.ErrnoError(29)}return i&&(e.node.timestamp=Date.now()),s}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=intArrayFromString(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(out(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(out(UTF8ArrayToString(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(err(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output,0)),e.output=[])}}};function zeroMemory(e,t){return HEAPU8.fill(0,e,e+t),e}function alignMemory(e,t){return Math.ceil(e/t)*t}function mmapAlloc(e){e=alignMemory(e,65536);var t=_emscripten_builtin_memalign(65536,e);return t?zeroMemory(t,e):0}var MEMFS={ops_table:null,mount:function(e){return MEMFS.createNode(null,"/",16895,0)},createNode:function(e,t,r,i){if(FS.isBlkdev(r)||FS.isFIFO(r))throw new FS.ErrnoError(63);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});var n=FS.createNode(e,t,r,i);return FS.isDir(n.mode)?(n.node_ops=MEMFS.ops_table.dir.node,n.stream_ops=MEMFS.ops_table.dir.stream,n.contents={}):FS.isFile(n.mode)?(n.node_ops=MEMFS.ops_table.file.node,n.stream_ops=MEMFS.ops_table.file.stream,n.usedBytes=0,n.contents=null):FS.isLink(n.mode)?(n.node_ops=MEMFS.ops_table.link.node,n.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(n.mode)&&(n.node_ops=MEMFS.ops_table.chrdev.node,n.stream_ops=MEMFS.ops_table.chrdev.stream),n.timestamp=Date.now(),e&&(e.contents[t]=n,e.timestamp=n.timestamp),n},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var i=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(i.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=FS.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,FS.isDir(e.mode)?t.size=4096:FS.isFile(e.mode)?t.size=e.usedBytes:FS.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&MEMFS.resizeFileStorage(e,t.size)},lookup:function(e,t){throw FS.genericErrors[44]},mknod:function(e,t,r,i){return MEMFS.createNode(e,t,r,i)},rename:function(e,t,r){if(FS.isDir(e.mode)){var i;try{i=FS.lookupNode(t,r)}catch(e){}if(i)for(var n in i.contents)throw new FS.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=FS.lookupNode(e,t);for(var i in r.contents)throw new FS.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var i=MEMFS.createNode(e,t,41471,0);return i.link=r,i},readlink:function(e){if(!FS.isLink(e.mode))throw new FS.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,i,n){var s=e.node.contents;if(n>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-n,i);if(a>8&&s.subarray)t.set(s.subarray(n,n+a),r);else for(var o=0;o<a;o++)t[r+o]=s[n+o];return a},write:function(e,t,r,i,n,s){if(t.buffer===HEAP8.buffer&&(s=!1),!i)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(s)return a.contents=t.subarray(r,r+i),a.usedBytes=i,i;if(0===a.usedBytes&&0===n)return a.contents=t.slice(r,r+i),a.usedBytes=i,i;if(n+i<=a.usedBytes)return a.contents.set(t.subarray(r,r+i),n),i}if(MEMFS.expandFileStorage(a,n+i),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+i),n);else for(var o=0;o<i;o++)a.contents[n+o]=t[r+o];return a.usedBytes=Math.max(a.usedBytes,n+i),i},llseek:function(e,t,r){var i=t;if(1===r?i+=e.position:2===r&&FS.isFile(e.node.mode)&&(i+=e.node.usedBytes),i<0)throw new FS.ErrnoError(28);return i},allocate:function(e,t,r){MEMFS.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,i,n){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);var s,a,o=e.node.contents;if(2&n||o.buffer!==buffer){if((r>0||r+t<o.length)&&(o=o.subarray?o.subarray(r,r+t):Array.prototype.slice.call(o,r,r+t)),a=!0,!(s=mmapAlloc(t)))throw new FS.ErrnoError(48);HEAP8.set(o,s)}else a=!1,s=o.byteOffset;return{ptr:s,allocated:a}},msync:function(e,t,r,i,n){return MEMFS.stream_ops.write(e,t,0,i,r,!1),0}}};function asyncLoad(e,t,r,i){var n=i?"":getUniqueRunDependency("al "+e);readAsync(e,(r=>{assert(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),n&&removeRunDependency(n)}),(t=>{if(!r)throw'Loading data file "'+e+'" failed.';r()})),n&&addRunDependency(n)}var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=PATH_FS.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new FS.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),i=FS.root,n="/",s=0;s<r.length;s++){var a=s===r.length-1;if(a&&t.parent)break;if(i=FS.lookupNode(i,r[s]),n=PATH.join2(n,r[s]),FS.isMountpoint(i)&&(!a||a&&t.follow_mount)&&(i=i.mounted.root),!a||t.follow)for(var o=0;FS.isLink(i.mode);){var l=FS.readlink(n);if(n=PATH_FS.resolve(PATH.dirname(n),l),i=FS.lookupPath(n,{recurse_count:t.recurse_count+1}).node,o++>40)throw new FS.ErrnoError(32)}}return{path:n,node:i}},getPath:e=>{for(var t;;){if(FS.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,i=0;i<t.length;i++)r=(r<<5)-r+t.charCodeAt(i)|0;return(e+r>>>0)%FS.nameTable.length},hashAddNode:e=>{var t=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[t],FS.nameTable[t]=e},hashRemoveNode:e=>{var t=FS.hashName(e.parent.id,e.name);if(FS.nameTable[t]===e)FS.nameTable[t]=e.name_next;else for(var r=FS.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=FS.mayLookup(e);if(r)throw new FS.ErrnoError(r,e);for(var i=FS.hashName(e.id,t),n=FS.nameTable[i];n;n=n.name_next){var s=n.name;if(n.parent.id===e.id&&s===t)return n}return FS.lookup(e,t)},createNode:(e,t,r,i)=>{var n=new FS.FSNode(e,t,r,i);return FS.hashAddNode(n),n},destroyNode:e=>{FS.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=FS.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>FS.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>FS.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return FS.lookupNode(e,t),20}catch(e){}return FS.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var i;try{i=FS.lookupNode(e,t)}catch(e){return e.errno}var n=FS.nodePermissions(e,"wx");if(n)return n;if(r){if(!FS.isDir(i.mode))return 54;if(FS.isRoot(i)||FS.getPath(i)===FS.cwd())return 10}else if(FS.isDir(i.mode))return 31;return 0},mayOpen:(e,t)=>e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&("r"!==FS.flagsToPermissionString(t)||512&t)?31:FS.nodePermissions(e,FS.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=FS.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!FS.streams[r])return r;throw new FS.ErrnoError(33)},getStream:e=>FS.streams[e],createStream:(e,t,r)=>{FS.FSStream||(FS.FSStream=function(){this.shared={}},FS.FSStream.prototype={},Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return!!(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new FS.FSStream,e);var i=FS.nextfd(t,r);return e.fd=i,FS.streams[i]=e,e},closeStream:e=>{FS.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new FS.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{FS.devices[e]={stream_ops:t}},getDevice:e=>FS.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var i=r.pop();t.push(i),r.push.apply(r,i.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=FS.getMounts(FS.root.mount),i=0;function n(e){return FS.syncFSRequests--,t(e)}function s(e){if(e)return s.errored?void 0:(s.errored=!0,n(e));++i>=r.length&&n(null)}r.forEach((t=>{if(!t.type.syncfs)return s(null);t.type.syncfs(t,e,s)}))},mount:(e,t,r)=>{var i,n="/"===r,s=!r;if(n&&FS.root)throw new FS.ErrnoError(10);if(!n&&!s){var a=FS.lookupPath(r,{follow_mount:!1});if(r=a.path,i=a.node,FS.isMountpoint(i))throw new FS.ErrnoError(10);if(!FS.isDir(i.mode))throw new FS.ErrnoError(54)}var o={type:e,opts:t,mountpoint:r,mounts:[]},l=e.mount(o);return l.mount=o,o.root=l,n?FS.root=l:i&&(i.mounted=o,i.mount&&i.mount.mounts.push(o)),l},unmount:e=>{var t=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(t.node))throw new FS.ErrnoError(28);var r=t.node,i=r.mounted,n=FS.getMounts(i);Object.keys(FS.nameTable).forEach((e=>{for(var t=FS.nameTable[e];t;){var r=t.name_next;n.includes(t.mount)&&FS.destroyNode(t),t=r}})),r.mounted=null;var s=r.mount.mounts.indexOf(i);r.mount.mounts.splice(s,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var i=FS.lookupPath(e,{parent:!0}).node,n=PATH.basename(e);if(!n||"."===n||".."===n)throw new FS.ErrnoError(28);var s=FS.mayCreate(i,n);if(s)throw new FS.ErrnoError(s);if(!i.node_ops.mknod)throw new FS.ErrnoError(63);return i.node_ops.mknod(i,n,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,FS.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,FS.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),i="",n=0;n<r.length;++n)if(r[n]){i+="/"+r[n];try{FS.mkdir(i,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,FS.mknod(e,t,r)),symlink:(e,t)=>{if(!PATH_FS.resolve(e))throw new FS.ErrnoError(44);var r=FS.lookupPath(t,{parent:!0}).node;if(!r)throw new FS.ErrnoError(44);var i=PATH.basename(t),n=FS.mayCreate(r,i);if(n)throw new FS.ErrnoError(n);if(!r.node_ops.symlink)throw new FS.ErrnoError(63);return r.node_ops.symlink(r,i,e)},rename:(e,t)=>{var r,i,n=PATH.dirname(e),s=PATH.dirname(t),a=PATH.basename(e),o=PATH.basename(t);if(r=FS.lookupPath(e,{parent:!0}).node,i=FS.lookupPath(t,{parent:!0}).node,!r||!i)throw new FS.ErrnoError(44);if(r.mount!==i.mount)throw new FS.ErrnoError(75);var l,c=FS.lookupNode(r,a),u=PATH_FS.relative(e,s);if("."!==u.charAt(0))throw new FS.ErrnoError(28);if("."!==(u=PATH_FS.relative(t,n)).charAt(0))throw new FS.ErrnoError(55);try{l=FS.lookupNode(i,o)}catch(e){}if(c!==l){var h=FS.isDir(c.mode),d=FS.mayDelete(r,a,h);if(d)throw new FS.ErrnoError(d);if(d=l?FS.mayDelete(i,o,h):FS.mayCreate(i,o))throw new FS.ErrnoError(d);if(!r.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(c)||l&&FS.isMountpoint(l))throw new FS.ErrnoError(10);if(i!==r&&(d=FS.nodePermissions(r,"w")))throw new FS.ErrnoError(d);FS.hashRemoveNode(c);try{r.node_ops.rename(c,i,o)}catch(e){throw e}finally{FS.hashAddNode(c)}}},rmdir:e=>{var t=FS.lookupPath(e,{parent:!0}).node,r=PATH.basename(e),i=FS.lookupNode(t,r),n=FS.mayDelete(t,r,!0);if(n)throw new FS.ErrnoError(n);if(!t.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(i))throw new FS.ErrnoError(10);t.node_ops.rmdir(t,r),FS.destroyNode(i)},readdir:e=>{var t=FS.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new FS.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=FS.lookupPath(e,{parent:!0}).node;if(!t)throw new FS.ErrnoError(44);var r=PATH.basename(e),i=FS.lookupNode(t,r),n=FS.mayDelete(t,r,!1);if(n)throw new FS.ErrnoError(n);if(!t.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(i))throw new FS.ErrnoError(10);t.node_ops.unlink(t,r),FS.destroyNode(i)},readlink:e=>{var t=FS.lookupPath(e).node;if(!t)throw new FS.ErrnoError(44);if(!t.node_ops.readlink)throw new FS.ErrnoError(28);return PATH_FS.resolve(FS.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=FS.lookupPath(e,{follow:!t}).node;if(!r)throw new FS.ErrnoError(44);if(!r.node_ops.getattr)throw new FS.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>FS.stat(e,!0),chmod:(e,t,r)=>{var i;if(!(i="string"==typeof e?FS.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new FS.ErrnoError(63);i.node_ops.setattr(i,{mode:4095&t|-4096&i.mode,timestamp:Date.now()})},lchmod:(e,t)=>{FS.chmod(e,t,!0)},fchmod:(e,t)=>{var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(8);FS.chmod(r.node,t)},chown:(e,t,r,i)=>{var n;if(!(n="string"==typeof e?FS.lookupPath(e,{follow:!i}).node:e).node_ops.setattr)throw new FS.ErrnoError(63);n.node_ops.setattr(n,{timestamp:Date.now()})},lchown:(e,t,r)=>{FS.chown(e,t,r,!0)},fchown:(e,t,r)=>{var i=FS.getStream(e);if(!i)throw new FS.ErrnoError(8);FS.chown(i.node,t,r)},truncate:(e,t)=>{if(t<0)throw new FS.ErrnoError(28);var r;if(!(r="string"==typeof e?FS.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new FS.ErrnoError(63);if(FS.isDir(r.mode))throw new FS.ErrnoError(31);if(!FS.isFile(r.mode))throw new FS.ErrnoError(28);var i=FS.nodePermissions(r,"w");if(i)throw new FS.ErrnoError(i);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(8);if(!(2097155&r.flags))throw new FS.ErrnoError(28);FS.truncate(r.node,t)},utime:(e,t,r)=>{var i=FS.lookupPath(e,{follow:!0}).node;i.node_ops.setattr(i,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new FS.ErrnoError(44);var i;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?FS.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)i=e;else{e=PATH.normalize(e);try{i=FS.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var n=!1;if(64&t)if(i){if(128&t)throw new FS.ErrnoError(20)}else i=FS.mknod(e,r,0),n=!0;if(!i)throw new FS.ErrnoError(44);if(FS.isChrdev(i.mode)&&(t&=-513),65536&t&&!FS.isDir(i.mode))throw new FS.ErrnoError(54);if(!n){var s=FS.mayOpen(i,t);if(s)throw new FS.ErrnoError(s)}512&t&&!n&&FS.truncate(i,0),t&=-131713;var a=FS.createStream({node:i,path:FS.getPath(i),flags:t,seekable:!0,position:0,stream_ops:i.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!Module.logReadFiles||1&t||(FS.readFiles||(FS.readFiles={}),e in FS.readFiles||(FS.readFiles[e]=1)),a},close:e=>{if(FS.isClosed(e))throw new FS.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{FS.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new FS.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,i,n)=>{if(i<0||n<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(1==(2097155&e.flags))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.read)throw new FS.ErrnoError(28);var s=void 0!==n;if(s){if(!e.seekable)throw new FS.ErrnoError(70)}else n=e.position;var a=e.stream_ops.read(e,t,r,i,n);return s||(e.position+=a),a},write:(e,t,r,i,n,s)=>{if(i<0||n<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!(2097155&e.flags))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.write)throw new FS.ErrnoError(28);e.seekable&&1024&e.flags&&FS.llseek(e,0,2);var a=void 0!==n;if(a){if(!e.seekable)throw new FS.ErrnoError(70)}else n=e.position;var o=e.stream_ops.write(e,t,r,i,n,s);return a||(e.position+=o),o},allocate:(e,t,r)=>{if(FS.isClosed(e))throw new FS.ErrnoError(8);if(t<0||r<=0)throw new FS.ErrnoError(28);if(!(2097155&e.flags))throw new FS.ErrnoError(8);if(!FS.isFile(e.node.mode)&&!FS.isDir(e.node.mode))throw new FS.ErrnoError(43);if(!e.stream_ops.allocate)throw new FS.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,i,n)=>{if(2&i&&!(2&n)&&2!=(2097155&e.flags))throw new FS.ErrnoError(2);if(1==(2097155&e.flags))throw new FS.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS.ErrnoError(43);return e.stream_ops.mmap(e,t,r,i,n)},msync:(e,t,r,i,n)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,i,n):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new FS.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,i=FS.open(e,t.flags),n=FS.stat(e).size,s=new Uint8Array(n);return FS.read(i,s,0,n,0),"utf8"===t.encoding?r=UTF8ArrayToString(s,0):"binary"===t.encoding&&(r=s),FS.close(i),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var i=FS.open(e,r.flags,r.mode);if("string"==typeof t){var n=new Uint8Array(lengthBytesUTF8(t)+1),s=stringToUTF8Array(t,n,0,n.length);FS.write(i,n,0,s,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");FS.write(i,t,0,t.byteLength,void 0,r.canOwn)}FS.close(i)},cwd:()=>FS.currentPath,chdir:e=>{var t=FS.lookupPath(e,{follow:!0});if(null===t.node)throw new FS.ErrnoError(44);if(!FS.isDir(t.node.mode))throw new FS.ErrnoError(54);var r=FS.nodePermissions(t.node,"x");if(r)throw new FS.ErrnoError(r);FS.currentPath=t.path},createDefaultDirectories:()=>{FS.mkdir("/tmp"),FS.mkdir("/home"),FS.mkdir("/home/web_user")},createDefaultDevices:()=>{FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(e,t,r,i,n)=>i}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0));var e=getRandomDevice();FS.createDevice("/dev","random",e),FS.createDevice("/dev","urandom",e),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{FS.mkdir("/proc");var e=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount:()=>{var t=FS.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,i=FS.getStream(r);if(!i)throw new FS.ErrnoError(8);var n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return n.parent=n,n}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{Module.stdin?FS.createDevice("/dev","stdin",Module.stdin):FS.symlink("/dev/tty","/dev/stdin"),Module.stdout?FS.createDevice("/dev","stdout",null,Module.stdout):FS.symlink("/dev/tty","/dev/stdout"),Module.stderr?FS.createDevice("/dev","stderr",null,Module.stderr):FS.symlink("/dev/tty1","/dev/stderr"),FS.open("/dev/stdin",0),FS.open("/dev/stdout",1),FS.open("/dev/stderr",1)},ensureErrnoError:()=>{FS.ErrnoError||(FS.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},FS.ErrnoError.prototype=new Error,FS.ErrnoError.prototype.constructor=FS.ErrnoError,[44].forEach((e=>{FS.genericErrors[e]=new FS.ErrnoError(e),FS.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{FS.ensureErrnoError(),FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS}},init:(e,t,r)=>{FS.init.initialized=!0,FS.ensureErrnoError(),Module.stdin=e||Module.stdin,Module.stdout=t||Module.stdout,Module.stderr=r||Module.stderr,FS.createStandardStreams()},quit:()=>{FS.init.initialized=!1;for(var e=0;e<FS.streams.length;e++){var t=FS.streams[e];t&&FS.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=FS.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(i=FS.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var i=FS.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=i.path,r.parentObject=i.node,r.name=PATH.basename(e),i=FS.lookupPath(e,{follow:!t}),r.exists=!0,r.path=i.path,r.object=i.node,r.name=i.node.name,r.isRoot="/"===i.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,i)=>{e="string"==typeof e?e:FS.getPath(e);for(var n=t.split("/").reverse();n.length;){var s=n.pop();if(s){var a=PATH.join2(e,s);try{FS.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,i,n)=>{var s=PATH.join2("string"==typeof e?e:FS.getPath(e),t),a=FS.getMode(i,n);return FS.create(s,a)},createDataFile:(e,t,r,i,n,s)=>{var a=t;e&&(e="string"==typeof e?e:FS.getPath(e),a=t?PATH.join2(e,t):e);var o=FS.getMode(i,n),l=FS.create(a,o);if(r){if("string"==typeof r){for(var c=new Array(r.length),u=0,h=r.length;u<h;++u)c[u]=r.charCodeAt(u);r=c}FS.chmod(l,146|o);var d=FS.open(l,577);FS.write(d,r,0,r.length,0,s),FS.close(d),FS.chmod(l,o)}return l},createDevice:(e,t,r,i)=>{var n=PATH.join2("string"==typeof e?e:FS.getPath(e),t),s=FS.getMode(!!r,!!i);FS.createDevice.major||(FS.createDevice.major=64);var a=FS.makedev(FS.createDevice.major++,0);return FS.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{i&&i.buffer&&i.buffer.length&&i(10)},read:(e,t,i,n,s)=>{for(var a=0,o=0;o<n;o++){var l;try{l=r()}catch(e){throw new FS.ErrnoError(29)}if(void 0===l&&0===a)throw new FS.ErrnoError(6);if(null==l)break;a++,t[i+o]=l}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,n,s)=>{for(var a=0;a<n;a++)try{i(t[r+a])}catch(e){throw new FS.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}}),FS.mkdev(n,s,a)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!read_)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=intArrayFromString(read_(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new FS.ErrnoError(29)}},createLazyFile:(e,t,r,i,n)=>{function s(){this.lengthKnown=!1,this.chunks=[]}if(s.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},s.prototype.setDataGetter=function(e){this.getter=e},s.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,i=Number(e.getResponseHeader("Content-length")),n=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,s=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;n||(a=i);var o=this;o.setDataGetter((e=>{var t=e*a,n=(e+1)*a-1;if(n=Math.min(n,i-1),void 0===o.chunks[e]&&(o.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>i-1)throw new Error("only "+i+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",r,!1),i!==a&&n.setRequestHeader("Range","bytes="+e+"-"+t),n.responseType="arraybuffer",n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.send(null),!(n.status>=200&&n.status<300||304===n.status))throw new Error("Couldn't load "+r+". Status: "+n.status);return void 0!==n.response?new Uint8Array(n.response||[]):intArrayFromString(n.responseText||"",!0)})(t,n)),void 0===o.chunks[e])throw new Error("doXHR failed!");return o.chunks[e]})),!s&&i||(a=i=1,i=this.getter(0).length,a=i,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=i,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new s;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var o={isDevice:!1,contents:a}}else o={isDevice:!1,url:r};var l=FS.createFile(e,t,o,i,n);o.contents?l.contents=o.contents:o.url&&(l.contents=null,l.url=o.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var c={};function u(e,t,r,i,n){var s=e.node.contents;if(n>=s.length)return 0;var a=Math.min(s.length-n,i);if(s.slice)for(var o=0;o<a;o++)t[r+o]=s[n+o];else for(o=0;o<a;o++)t[r+o]=s.get(n+o);return a}return Object.keys(l.stream_ops).forEach((e=>{var t=l.stream_ops[e];c[e]=function(){return FS.forceLoadFile(l),t.apply(null,arguments)}})),c.read=(e,t,r,i,n)=>(FS.forceLoadFile(l),u(e,t,r,i,n)),c.mmap=(e,t,r,i,n)=>{FS.forceLoadFile(l);var s=mmapAlloc(t);if(!s)throw new FS.ErrnoError(48);return u(e,HEAP8,s,t,r),{ptr:s,allocated:!0}},l.stream_ops=c,l},createPreloadedFile:(e,t,r,i,n,s,a,o,l,c)=>{var u=t?PATH_FS.resolve(PATH.join2(e,t)):e,h=getUniqueRunDependency("cp "+u);function d(r){function d(r){c&&c(),o||FS.createDataFile(e,t,r,i,n,l),s&&s(),removeRunDependency(h)}Browser.handledByPreloadPlugin(r,u,d,(()=>{a&&a(),removeRunDependency(h)}))||d(r)}addRunDependency(h),"string"==typeof r?asyncLoad(r,(e=>d(e)),a):d(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var i=FS.indexedDB();try{var n=i.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return r(e)}n.onupgradeneeded=()=>{out("creating db"),n.result.createObjectStore(FS.DB_STORE_NAME)},n.onsuccess=()=>{var i=n.result.transaction([FS.DB_STORE_NAME],"readwrite"),s=i.objectStore(FS.DB_STORE_NAME),a=0,o=0,l=e.length;function c(){0==o?t():r()}e.forEach((e=>{var t=s.put(FS.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+o==l&&c()},t.onerror=()=>{o++,a+o==l&&c()}})),i.onerror=r},n.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var i=FS.indexedDB();try{var n=i.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return r(e)}n.onupgradeneeded=r,n.onsuccess=()=>{var i=n.result;try{var s=i.transaction([FS.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=s.objectStore(FS.DB_STORE_NAME),o=0,l=0,c=e.length;function u(){0==l?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{FS.analyzePath(e).exists&&FS.unlink(e),FS.createDataFile(PATH.dirname(e),PATH.basename(e),t.result,!0,!0,!0),++o+l==c&&u()},t.onerror=()=>{l++,o+l==c&&u()}})),s.onerror=r},n.onerror=r}},SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(PATH.isAbs(t))return t;var i;if(i=-100===e?FS.cwd():SYSCALLS.getStreamFromFD(e).path,0==t.length){if(!r)throw new FS.ErrnoError(44);return i}return PATH.join2(i,t)},doStat:function(e,t,r){try{var i=e(t)}catch(e){if(e&&e.node&&PATH.normalize(t)!==PATH.normalize(FS.getPath(e.node)))return-54;throw e}return HEAP32[r>>2]=i.dev,HEAP32[r+8>>2]=i.ino,HEAP32[r+12>>2]=i.mode,HEAPU32[r+16>>2]=i.nlink,HEAP32[r+20>>2]=i.uid,HEAP32[r+24>>2]=i.gid,HEAP32[r+28>>2]=i.rdev,tempI64=[i.size>>>0,(tempDouble=i.size,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+40>>2]=tempI64[0],HEAP32[r+44>>2]=tempI64[1],HEAP32[r+48>>2]=4096,HEAP32[r+52>>2]=i.blocks,tempI64=[Math.floor(i.atime.getTime()/1e3)>>>0,(tempDouble=Math.floor(i.atime.getTime()/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+56>>2]=tempI64[0],HEAP32[r+60>>2]=tempI64[1],HEAPU32[r+64>>2]=0,tempI64=[Math.floor(i.mtime.getTime()/1e3)>>>0,(tempDouble=Math.floor(i.mtime.getTime()/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+72>>2]=tempI64[0],HEAP32[r+76>>2]=tempI64[1],HEAPU32[r+80>>2]=0,tempI64=[Math.floor(i.ctime.getTime()/1e3)>>>0,(tempDouble=Math.floor(i.ctime.getTime()/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+88>>2]=tempI64[0],HEAP32[r+92>>2]=tempI64[1],HEAPU32[r+96>>2]=0,tempI64=[i.ino>>>0,(tempDouble=i.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+104>>2]=tempI64[0],HEAP32[r+108>>2]=tempI64[1],0},doMsync:function(e,t,r,i,n){if(!FS.isFile(t.node.mode))throw new FS.ErrnoError(43);if(2&i)return 0;var s=HEAPU8.slice(e,e+r);FS.msync(t,s,n,r,i)},varargs:void 0,get:function(){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(e){return UTF8ToString(e)},getStreamFromFD:function(e){var t=FS.getStream(e);if(!t)throw new FS.ErrnoError(8);return t}};function ___syscall_fcntl64(e,t,r){SYSCALLS.varargs=r;try{var i=SYSCALLS.getStreamFromFD(e);switch(t){case 0:return(n=SYSCALLS.get())<0?-28:FS.createStream(i,n).fd;case 1:case 2:case 6:case 7:return 0;case 3:return i.flags;case 4:var n=SYSCALLS.get();return i.flags|=n,0;case 5:return n=SYSCALLS.get(),HEAP16[n+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return setErrNo(28),-1}}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_fstat64(e,t){try{var r=SYSCALLS.getStreamFromFD(e);return SYSCALLS.doStat(FS.stat,r.path,t)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_getcwd(e,t){try{if(0===t)return-28;var r=FS.cwd(),i=lengthBytesUTF8(r)+1;return t<i?-68:(stringToUTF8(r,e,t),i)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_getdents64(e,t,r){try{var i=SYSCALLS.getStreamFromFD(e);i.getdents||(i.getdents=FS.readdir(i.path));for(var n=280,s=0,a=FS.llseek(i,0,1),o=Math.floor(a/n);o<i.getdents.length&&s+n<=r;){var l,c,u=i.getdents[o];if("."===u)l=i.node.id,c=4;else if(".."===u)l=FS.lookupPath(i.path,{parent:!0}).node.id,c=4;else{var h=FS.lookupNode(i.node,u);l=h.id,c=FS.isChrdev(h.mode)?2:FS.isDir(h.mode)?4:FS.isLink(h.mode)?10:8}tempI64=[l>>>0,(tempDouble=l,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+s>>2]=tempI64[0],HEAP32[t+s+4>>2]=tempI64[1],tempI64=[(o+1)*n>>>0,(tempDouble=(o+1)*n,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+s+8>>2]=tempI64[0],HEAP32[t+s+12>>2]=tempI64[1],HEAP16[t+s+16>>1]=280,HEAP8[t+s+18|0]=c,stringToUTF8(u,t+s+19,256),s+=n,o+=1}return FS.llseek(i,o*n,0),s}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_ioctl(e,t,r){SYSCALLS.varargs=r;try{var i=SYSCALLS.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return i.tty?0:-59;case 21519:if(!i.tty)return-59;var n=SYSCALLS.get();return HEAP32[n>>2]=0,0;case 21520:return i.tty?-28:-59;case 21531:return n=SYSCALLS.get(),FS.ioctl(i,t,n);default:return-28}}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_lstat64(e,t){try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.lstat,e,t)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_mkdirat(e,t,r){try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),"/"===(t=PATH.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),FS.mkdir(t,r,0),0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_newfstatat(e,t,r,i){try{t=SYSCALLS.getStr(t);var n=256&i,s=4096&i;return i&=-6401,t=SYSCALLS.calculateAt(e,t,s),SYSCALLS.doStat(n?FS.lstat:FS.stat,t,r)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_openat(e,t,r,i){SYSCALLS.varargs=i;try{t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t);var n=i?SYSCALLS.get():0;return FS.open(t,r,n).fd}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount:function(e){return FS.createNode(null,"/",16895,0)},createPipe:function(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=PIPEFS.nextname(),r=PIPEFS.nextname(),i=FS.createNode(PIPEFS.root,t,4096,0),n=FS.createNode(PIPEFS.root,r,4096,0);i.pipe=e,n.pipe=e;var s=FS.createStream({path:t,node:i,flags:0,seekable:!1,stream_ops:PIPEFS.stream_ops});i.stream=s;var a=FS.createStream({path:r,node:n,flags:1,seekable:!1,stream_ops:PIPEFS.stream_ops});return n.stream=a,{readable_fd:s.fd,writable_fd:a.fd}},stream_ops:{poll:function(e){var t=e.node.pipe;if(1==(2097155&e.flags))return 260;if(t.buckets.length>0)for(var r=0;r<t.buckets.length;r++){var i=t.buckets[r];if(i.offset-i.roffset>0)return 65}return 0},ioctl:function(e,t,r){return 28},fsync:function(e){return 28},read:function(e,t,r,i,n){for(var s=e.node.pipe,a=0,o=0;o<s.buckets.length;o++){var l=s.buckets[o];a+=l.offset-l.roffset}assert(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var c=t.subarray(r,r+i);if(i<=0)return 0;if(0==a)throw new FS.ErrnoError(6);var u=Math.min(a,i),h=u,d=0;for(o=0;o<s.buckets.length;o++){var _=s.buckets[o],f=_.offset-_.roffset;if(u<=f){var p=_.buffer.subarray(_.roffset,_.offset);u<f?(p=p.subarray(0,u),_.roffset+=u):d++,c.set(p);break}p=_.buffer.subarray(_.roffset,_.offset),c.set(p),c=c.subarray(p.byteLength),u-=p.byteLength,d++}return d&&d==s.buckets.length&&(d--,s.buckets[d].offset=0,s.buckets[d].roffset=0),s.buckets.splice(0,d),h},write:function(e,t,r,i,n){var s=e.node.pipe;assert(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var a=t.subarray(r,r+i),o=a.byteLength;if(o<=0)return 0;var l=null;0==s.buckets.length?(l={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0},s.buckets.push(l)):l=s.buckets[s.buckets.length-1],assert(l.offset<=PIPEFS.BUCKET_BUFFER_SIZE);var c=PIPEFS.BUCKET_BUFFER_SIZE-l.offset;if(c>=o)return l.buffer.set(a,l.offset),l.offset+=o,o;c>0&&(l.buffer.set(a.subarray(0,c),l.offset),l.offset+=c,a=a.subarray(c,a.byteLength));for(var u=a.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0,h=a.byteLength%PIPEFS.BUCKET_BUFFER_SIZE,d=0;d<u;d++){var _={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:PIPEFS.BUCKET_BUFFER_SIZE,roffset:0};s.buckets.push(_),_.buffer.set(a.subarray(0,PIPEFS.BUCKET_BUFFER_SIZE)),a=a.subarray(PIPEFS.BUCKET_BUFFER_SIZE,a.byteLength)}return h>0&&(_={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:a.byteLength,roffset:0},s.buckets.push(_),_.buffer.set(a)),o},close:function(e){var t=e.node.pipe;t.refcnt--,0===t.refcnt&&(t.buckets=null)}},nextname:function(){return PIPEFS.nextname.current||(PIPEFS.nextname.current=0),"pipe["+PIPEFS.nextname.current+++"]"}};function ___syscall_pipe(e){try{if(0==e)throw new FS.ErrnoError(21);var t=PIPEFS.createPipe();return HEAP32[e>>2]=t.readable_fd,HEAP32[e+4>>2]=t.writable_fd,0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_poll(e,t,r){try{for(var i=0,n=0;n<t;n++){var s=e+8*n,a=HEAP32[s>>2],o=HEAP16[s+4>>1],l=32,c=FS.getStream(a);c&&(l=SYSCALLS.DEFAULT_POLLMASK,c.stream_ops.poll&&(l=c.stream_ops.poll(c))),(l&=24|o)&&i++,HEAP16[s+6>>1]=l}return i}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_stat64(e,t){try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.stat,e,t)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}var nowIsMonotonic=!0;function __emscripten_get_now_is_monotonic(){return nowIsMonotonic}function __emscripten_throw_longjmp(){throw 1/0}function readI53FromI64(e){return HEAPU32[e>>2]+4294967296*HEAP32[e+4>>2]}function __gmtime_js(e,t){var r=new Date(1e3*readI53FromI64(e));HEAP32[t>>2]=r.getUTCSeconds(),HEAP32[t+4>>2]=r.getUTCMinutes(),HEAP32[t+8>>2]=r.getUTCHours(),HEAP32[t+12>>2]=r.getUTCDate(),HEAP32[t+16>>2]=r.getUTCMonth(),HEAP32[t+20>>2]=r.getUTCFullYear()-1900,HEAP32[t+24>>2]=r.getUTCDay();var i=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),n=(r.getTime()-i)/864e5|0;HEAP32[t+28>>2]=n}function __isLeapYear(e){return e%4==0&&(e%100!=0||e%400==0)}var __MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335],__MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];function __yday_from_date(e){return(__isLeapYear(e.getFullYear())?__MONTH_DAYS_LEAP_CUMULATIVE:__MONTH_DAYS_REGULAR_CUMULATIVE)[e.getMonth()]+e.getDate()-1}function __localtime_js(e,t){var r=new Date(1e3*readI53FromI64(e));HEAP32[t>>2]=r.getSeconds(),HEAP32[t+4>>2]=r.getMinutes(),HEAP32[t+8>>2]=r.getHours(),HEAP32[t+12>>2]=r.getDate(),HEAP32[t+16>>2]=r.getMonth(),HEAP32[t+20>>2]=r.getFullYear()-1900,HEAP32[t+24>>2]=r.getDay();var i=0|__yday_from_date(r);HEAP32[t+28>>2]=i,HEAP32[t+36>>2]=-60*r.getTimezoneOffset();var n=new Date(r.getFullYear(),0,1),s=new Date(r.getFullYear(),6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),o=0|(s!=a&&r.getTimezoneOffset()==Math.min(a,s));HEAP32[t+32>>2]=o}function __munmap_js(e,t,r,i,n,s){try{var a=SYSCALLS.getStreamFromFD(n);2&r&&SYSCALLS.doMsync(e,a,t,i,s),FS.munmap(a)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function allocateUTF8(e){var t=lengthBytesUTF8(e)+1,r=_malloc(t);return r&&stringToUTF8Array(e,HEAP8,r,t),r}function __tzset_js(e,t,r){var i=(new Date).getFullYear(),n=new Date(i,0,1),s=new Date(i,6,1),a=n.getTimezoneOffset(),o=s.getTimezoneOffset(),l=Math.max(a,o);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}HEAPU32[e>>2]=60*l,HEAP32[t>>2]=Number(a!=o);var u=c(n),h=c(s),d=allocateUTF8(u),_=allocateUTF8(h);o<a?(HEAPU32[r>>2]=d,HEAPU32[r+4>>2]=_):(HEAPU32[r>>2]=_,HEAPU32[r+4>>2]=d)}function _abort(){abort("")}var _emscripten_get_now,readEmAsmArgsArray=[];function readEmAsmArgs(e,t){var r;for(readEmAsmArgsArray.length=0,t>>=2;r=HEAPU8[e++];)t+=105!=r&t,readEmAsmArgsArray.push(105==r?HEAP32[t]:HEAPF64[t++>>1]),++t;return readEmAsmArgsArray}function runEmAsmFunction(e,t,r){var i=readEmAsmArgs(t,r);return ASM_CONSTS[e].apply(null,i)}function _emscripten_asm_const_double(e,t,r){return runEmAsmFunction(e,t,r)}function _emscripten_asm_const_int(e,t,r){return runEmAsmFunction(e,t,r)}function runMainThreadEmAsm(e,t,r,i){var n=readEmAsmArgs(t,r);return ASM_CONSTS[e].apply(null,n)}function _emscripten_asm_const_int_sync_on_main_thread(e,t,r){return runMainThreadEmAsm(e,t,r,1)}function _emscripten_date_now(){return Date.now()}function getHeapMax(){return 2147483648}function _emscripten_get_heap_max(){return getHeapMax()}function _emscripten_memcpy_big(e,t,r){HEAPU8.copyWithin(e,t,t+r)}function emscripten_realloc_buffer(e){try{return wasmMemory.grow(e-buffer.byteLength+65535>>>16),updateGlobalBufferAndViews(wasmMemory.buffer),1}catch(e){postMessage({status:-35,cmd:-35})}}function _emscripten_resize_heap(e){var t=HEAPU8.length;e>>>=0;var r,i=getHeapMax();if(e>i)return!1;for(var n=1;n<=4;n*=2){var s=t*(1+.2/n);if(s=Math.min(s,e+100663296),emscripten_realloc_buffer(Math.min(i,(r=Math.max(e,s))+(65536-r%65536)%65536)))return!0}return!1}_emscripten_get_now=()=>performance.now();var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:getExecutableName()};for(var t in ENV)void 0===ENV[t]?delete e[t]:e[t]=ENV[t];var r=[];for(var t in e)r.push(t+"="+e[t]);getEnvStrings.strings=r}return getEnvStrings.strings}function writeAsciiToMemory(e,t,r){for(var i=0;i<e.length;++i)HEAP8[0|t++]=e.charCodeAt(i);r||(HEAP8[0|t]=0)}function _environ_get(e,t){var r=0;return getEnvStrings().forEach((function(i,n){var s=t+r;HEAPU32[e+4*n>>2]=s,writeAsciiToMemory(i,s),r+=i.length+1})),0}function _environ_sizes_get(e,t){var r=getEnvStrings();HEAPU32[e>>2]=r.length;var i=0;return r.forEach((function(e){i+=e.length+1})),HEAPU32[t>>2]=i,0}function _proc_exit(e){EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit&&Module.onExit(e),ABORT=!0),quit_(e,new ExitStatus(e))}function exitJS(e,t){EXITSTATUS=e,_proc_exit(e)}var _exit=exitJS;function _fd_close(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.close(t),0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function doReadv(e,t,r,i){for(var n=0,s=0;s<r;s++){var a=HEAPU32[t>>2],o=HEAPU32[t+4>>2];t+=8;var l=FS.read(e,HEAP8,a,o,i);if(l<0)return-1;if(n+=l,l<o)break}return n}function _fd_read(e,t,r,i){try{var n=doReadv(SYSCALLS.getStreamFromFD(e),t,r);return HEAPU32[i>>2]=n,0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function convertI32PairToI53Checked(e,t){return t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN}function _fd_seek(e,t,r,i,n){try{var s=convertI32PairToI53Checked(t,r);if(isNaN(s))return 61;var a=SYSCALLS.getStreamFromFD(e);return FS.llseek(a,s,i),tempI64=[a.position>>>0,(tempDouble=a.position,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[n>>2]=tempI64[0],HEAP32[n+4>>2]=tempI64[1],a.getdents&&0===s&&0===i&&(a.getdents=null),0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function doWritev(e,t,r,i){for(var n=0,s=0;s<r;s++){var a=HEAPU32[t>>2],o=HEAPU32[t+4>>2];t+=8;var l=FS.write(e,HEAP8,a,o,i);if(l<0)return-1;n+=l}return n}function _fd_write(e,t,r,i){try{var n=doWritev(SYSCALLS.getStreamFromFD(e),t,r);return HEAPU32[i>>2]=n,0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function _llvm_eh_typeid_for(e){return e}function _setCurrentThreadSsrc(e){setCurrentThreadSsrc_js(e)}function __arraySum(e,t){for(var r=0,i=0;i<=t;r+=e[i++]);return r}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31],__MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(e,t){for(var r=new Date(e.getTime());t>0;){var i=__isLeapYear(r.getFullYear()),n=r.getMonth(),s=(i?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[n];if(!(t>s-r.getDate()))return r.setDate(r.getDate()+t),r;t-=s-r.getDate()+1,r.setDate(1),n<11?r.setMonth(n+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function writeArrayToMemory(e,t){HEAP8.set(e,t)}function _strftime(e,t,r,i){var n=HEAP32[i+40>>2],s={tm_sec:HEAP32[i>>2],tm_min:HEAP32[i+4>>2],tm_hour:HEAP32[i+8>>2],tm_mday:HEAP32[i+12>>2],tm_mon:HEAP32[i+16>>2],tm_year:HEAP32[i+20>>2],tm_wday:HEAP32[i+24>>2],tm_yday:HEAP32[i+28>>2],tm_isdst:HEAP32[i+32>>2],tm_gmtoff:HEAP32[i+36>>2],tm_zone:n?UTF8ToString(n):""},a=UTF8ToString(r),o={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in o)a=a.replace(new RegExp(l,"g"),o[l]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"];function h(e,t,r){for(var i="number"==typeof e?e.toString():e||"";i.length<t;)i=r[0]+i;return i}function d(e,t){return h(e,t,"0")}function _(e,t){function r(e){return e<0?-1:e>0?1:0}var i;return 0===(i=r(e.getFullYear()-t.getFullYear()))&&0===(i=r(e.getMonth()-t.getMonth()))&&(i=r(e.getDate()-t.getDate())),i}function f(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function p(e){var t=__addDays(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),i=new Date(t.getFullYear()+1,0,4),n=f(r),s=f(i);return _(n,t)<=0?_(s,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var m={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return u[e.tm_mon].substring(0,3)},"%B":function(e){return u[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return h(e.tm_mday,2," ")},"%g":function(e){return p(e).toString().substring(2)},"%G":function(e){return p(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+__arraySum(__isLeapYear(e.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=e.tm_yday+7-e.tm_wday;return d(Math.floor(t/7),2)},"%V":function(e){var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&__isLeapYear(e.tm_year)||(t=1)}}else{t=52;var i=(e.tm_wday+7-e.tm_yday-1)%7;(4==i||5==i&&__isLeapYear(e.tm_year%400-1))&&t++}return d(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return d(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var l in a=a.replace(/%%/g,"\0\0"),m)a.includes(l)&&(a=a.replace(new RegExp(l,"g"),m[l](s)));var g=intArrayFromString(a=a.replace(/\0\0/g,"%"),!1);return g.length>t?0:(writeArrayToMemory(g,e),g.length-1)}function _strftime_l(e,t,r,i,n){return _strftime(e,t,r,i)}function _zlt_tfjs_execute_afn(e,t,r,i,n){return execute_afn(e,t,r,i,n)}function _zlt_tfjs_execute_base_cls(e,t,r,i){return execute_base(e,t,r,i)}async function _zlt_tfjs_init(){}function _zoom_wcl_get_cpu_num(){return hardcodecpunumber()}function _zoom_wcl_get_csc_thread_num(){return 1}function _zoom_wcl_support_multi_thread(){return IsSupportMultiThread()}function getCFunc(e){return Module["_"+e]}function ccall(e,t,r,i,n){var s={string:e=>{var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);stringToUTF8(e,t=stackAlloc(r),r)}return t},array:e=>{var t=stackAlloc(e.length);return writeArrayToMemory(e,t),t}},a=getCFunc(e),o=[],l=0;if(i)for(var c=0;c<i.length;c++){var u=s[r[c]];u?(0===l&&(l=stackSave()),o[c]=u(i[c])):o[c]=i[c]}var h=a.apply(null,o);return function(e){return 0!==l&&stackRestore(l),function(e){return"string"===t?UTF8ToString(e):"boolean"===t?Boolean(e):e}(e)}(h)}function cwrap(e,t,r,i){var n=(r=r||[]).every((e=>"number"===e||"boolean"===e));return"string"!==t&&n&&!i?getCFunc(e):function(){return ccall(e,t,r,arguments,i)}}var FSNode=function(e,t,r,i){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=FS.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=i},readMode=365,writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(e){e?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(e){e?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}}),FS.FSNode=FSNode,FS.staticInit();var calledRun,asmLibraryArg={AdapterWhiteListCheck:_AdapterWhiteListCheck,CloseVideoEncoder:_CloseVideoEncoder,CreateGltPlatform:_CreateGltPlatform,DestroyGltPlatform:_DestroyGltPlatform,GetEncoderState:_GetEncoderState,GetLogLevel:_GetLogLevel,GetWebCodecsEncoderFallbackFlag:_GetWebCodecsEncoderFallbackFlag,GetWebCodecsEncoderL1T2Flag:_GetWebCodecsEncoderL1T2Flag,InitVideoDecoder:_InitVideoDecoder,InitVideoEncoder:_InitVideoEncoder,LimitWebCodecsDecoderTo360:_LimitWebCodecsDecoderTo360,LimitWebCodecsEncoderTo360:_LimitWebCodecsEncoderTo360,Set_Share_Mode:_Set_Share_Mode,UserAgentIsTesla:_UserAgentIsTesla,VideoDecoder:_VideoDecoder,VideoDecoderConfigure:_VideoDecoderConfigure,VideoEncoderConfigure:_VideoEncoderConfigure,WebCodecsDecoderFail:_WebCodecsDecoderFail,WebCodecsEncoderFail:_WebCodecsEncoderFail,WebCodecsVideoEncoder:_WebCodecsVideoEncoder,_ZN11cpt_generic6thread4joinEv:__ZN11cpt_generic6thread4joinEv,_ZN11cpt_generic6threadD1Ev:__ZN11cpt_generic6threadD1Ev,_ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE:__ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE,__assert_fail:___assert_fail,__cxa_allocate_exception:___cxa_allocate_exception,__cxa_begin_catch:___cxa_begin_catch,__cxa_end_catch:___cxa_end_catch,__cxa_find_matching_catch_2:___cxa_find_matching_catch_2,__cxa_find_matching_catch_3:___cxa_find_matching_catch_3,__cxa_find_matching_catch_4:___cxa_find_matching_catch_4,__cxa_free_exception:___cxa_free_exception,__cxa_rethrow:___cxa_rethrow,__cxa_throw:___cxa_throw,__cxa_uncaught_exceptions:___cxa_uncaught_exceptions,__resumeException:___resumeException,__stack_chk_fail:___stack_chk_fail,__syscall_fcntl64:___syscall_fcntl64,__syscall_fstat64:___syscall_fstat64,__syscall_getcwd:___syscall_getcwd,__syscall_getdents64:___syscall_getdents64,__syscall_ioctl:___syscall_ioctl,__syscall_lstat64:___syscall_lstat64,__syscall_mkdirat:___syscall_mkdirat,__syscall_newfstatat:___syscall_newfstatat,__syscall_openat:___syscall_openat,__syscall_pipe:___syscall_pipe,__syscall_poll:___syscall_poll,__syscall_stat64:___syscall_stat64,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_gmtime_js:__gmtime_js,_localtime_js:__localtime_js,_munmap_js:__munmap_js,_tzset_js:__tzset_js,abort:_abort,emscripten_asm_const_double:_emscripten_asm_const_double,emscripten_asm_const_int:_emscripten_asm_const_int,emscripten_asm_const_int_sync_on_main_thread:_emscripten_asm_const_int_sync_on_main_thread,emscripten_date_now:_emscripten_date_now,emscripten_get_heap_max:_emscripten_get_heap_max,emscripten_get_now:_emscripten_get_now,emscripten_memcpy_big:_emscripten_memcpy_big,emscripten_resize_heap:_emscripten_resize_heap,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,exit:_exit,fd_close:_fd_close,fd_read:_fd_read,fd_seek:_fd_seek,fd_write:_fd_write,invoke_diii,invoke_fiii,invoke_i,invoke_ii,invoke_iii,invoke_iiii,invoke_iiiii,invoke_iiiiii,invoke_iiiiiii,invoke_iiiiiiii,invoke_iiiiiiiiiii,invoke_iiiiiiiiiiii,invoke_iiiiiiiiiiiii,invoke_jiiii,invoke_v,invoke_vi,invoke_vii,invoke_viii,invoke_viiii,invoke_viiiiiii,invoke_viiiiiiiiii,invoke_viiiiiiiiiiiiiii,invoke_viiiij,invoke_viijii,invoke_vij,llvm_eh_typeid_for:_llvm_eh_typeid_for,memory:wasmMemory,setCurrentThreadSsrc:_setCurrentThreadSsrc,strftime:_strftime,strftime_l:_strftime_l,zlt_tfjs_execute_afn:_zlt_tfjs_execute_afn,zlt_tfjs_execute_base_cls:_zlt_tfjs_execute_base_cls,zlt_tfjs_init:_zlt_tfjs_init,zoom_wcl_get_cpu_num:_zoom_wcl_get_cpu_num,zoom_wcl_get_csc_thread_num:_zoom_wcl_get_csc_thread_num,zoom_wcl_support_multi_thread:_zoom_wcl_support_multi_thread},asm=createWasm(),___wasm_call_ctors=Module.___wasm_call_ctors=function(){return(___wasm_call_ctors=Module.___wasm_call_ctors=Module.asm.__wasm_call_ctors).apply(null,arguments)},_malloc=Module._malloc=function(){return(_malloc=Module._malloc=Module.asm.malloc).apply(null,arguments)},__Video_Init=Module.__Video_Init=function(){return(__Video_Init=Module.__Video_Init=Module.asm._Video_Init).apply(null,arguments)},__Video_UnInit=Module.__Video_UnInit=function(){return(__Video_UnInit=Module.__Video_UnInit=Module.asm._Video_UnInit).apply(null,arguments)},__Video_Decode=Module.__Video_Decode=function(){return(__Video_Decode=Module.__Video_Decode=Module.asm._Video_Decode).apply(null,arguments)},__Change_Connect_Type=Module.__Change_Connect_Type=function(){return(__Change_Connect_Type=Module.__Change_Connect_Type=Module.asm._Change_Connect_Type).apply(null,arguments)},__Smooth_Send_For_Qos=Module.__Smooth_Send_For_Qos=function(){return(__Smooth_Send_For_Qos=Module.__Smooth_Send_For_Qos=Module.asm._Smooth_Send_For_Qos).apply(null,arguments)},__Video_Try_Analysis=Module.__Video_Try_Analysis=function(){return(__Video_Try_Analysis=Module.__Video_Try_Analysis=Module.asm._Video_Try_Analysis).apply(null,arguments)},_free=Module._free=function(){return(_free=Module._free=Module.asm.free).apply(null,arguments)},__Video_Encode=Module.__Video_Encode=function(){return(__Video_Encode=Module.__Video_Encode=Module.asm._Video_Encode).apply(null,arguments)},__rotate_video=Module.__rotate_video=function(){return(__rotate_video=Module.__rotate_video=Module.asm._rotate_video).apply(null,arguments)},__Video_Encode_YUV=Module.__Video_Encode_YUV=function(){return(__Video_Encode_YUV=Module.__Video_Encode_YUV=Module.asm._Video_Encode_YUV).apply(null,arguments)},__Video_VirtualBackground_Special_Action=Module.__Video_VirtualBackground_Special_Action=function(){return(__Video_VirtualBackground_Special_Action=Module.__Video_VirtualBackground_Special_Action=Module.asm._Video_VirtualBackground_Special_Action).apply(null,arguments)},__Qos_Sender_Send_Data_In_Main_Thread=Module.__Qos_Sender_Send_Data_In_Main_Thread=function(){return(__Qos_Sender_Send_Data_In_Main_Thread=Module.__Qos_Sender_Send_Data_In_Main_Thread=Module.asm._Qos_Sender_Send_Data_In_Main_Thread).apply(null,arguments)},__Video_Websocket_Speed=Module.__Video_Websocket_Speed=function(){return(__Video_Websocket_Speed=Module.__Video_Websocket_Speed=Module.asm._Video_Websocket_Speed).apply(null,arguments)},__Video_Start_Encode=Module.__Video_Start_Encode=function(){return(__Video_Start_Encode=Module.__Video_Start_Encode=Module.asm._Video_Start_Encode).apply(null,arguments)},__Video_Stop_Encode=Module.__Video_Stop_Encode=function(){return(__Video_Stop_Encode=Module.__Video_Stop_Encode=Module.asm._Video_Stop_Encode).apply(null,arguments)},__Request_Video_Qos_Data=Module.__Request_Video_Qos_Data=function(){return(__Request_Video_Qos_Data=Module.__Request_Video_Qos_Data=Module.asm._Request_Video_Qos_Data).apply(null,arguments)},__Video_Update_Format=Module.__Video_Update_Format=function(){return(__Video_Update_Format=Module.__Video_Update_Format=Module.asm._Video_Update_Format).apply(null,arguments)},__Video_Set_Data_Encryption=Module.__Video_Set_Data_Encryption=function(){return(__Video_Set_Data_Encryption=Module.__Video_Set_Data_Encryption=Module.asm._Video_Set_Data_Encryption).apply(null,arguments)},__Add_Video_Cooker_info=Module.__Add_Video_Cooker_info=function(){return(__Add_Video_Cooker_info=Module.__Add_Video_Cooker_info=Module.asm._Add_Video_Cooker_info).apply(null,arguments)},__Remove_Video_Cooker_Info=Module.__Remove_Video_Cooker_Info=function(){return(__Remove_Video_Cooker_Info=Module.__Remove_Video_Cooker_Info=Module.asm._Remove_Video_Cooker_Info).apply(null,arguments)},__Get_Video_Meat_Weight=Module.__Get_Video_Meat_Weight=function(){return(__Get_Video_Meat_Weight=Module.__Get_Video_Meat_Weight=Module.asm._Get_Video_Meat_Weight).apply(null,arguments)},__Set_Max_Receiving_Channel_Num=Module.__Set_Max_Receiving_Channel_Num=function(){return(__Set_Max_Receiving_Channel_Num=Module.__Set_Max_Receiving_Channel_Num=Module.asm._Set_Max_Receiving_Channel_Num).apply(null,arguments)},__update_sync_time=Module.__update_sync_time=function(){return(__update_sync_time=Module.__update_sync_time=Module.asm._update_sync_time).apply(null,arguments)},__release_video_receiving_channel=Module.__release_video_receiving_channel=function(){return(__release_video_receiving_channel=Module.__release_video_receiving_channel=Module.asm._release_video_receiving_channel).apply(null,arguments)},__change_hw_status=Module.__change_hw_status=function(){return(__change_hw_status=Module.__change_hw_status=Module.asm._change_hw_status).apply(null,arguments)},__update_video_uplink_bandwidth_limitation_by_server=Module.__update_video_uplink_bandwidth_limitation_by_server=function(){return(__update_video_uplink_bandwidth_limitation_by_server=Module.__update_video_uplink_bandwidth_limitation_by_server=Module.asm._update_video_uplink_bandwidth_limitation_by_server).apply(null,arguments)},__create_vb_thread=Module.__create_vb_thread=function(){return(__create_vb_thread=Module.__create_vb_thread=Module.asm._create_vb_thread).apply(null,arguments)},__create_vb_no_sab_thread=Module.__create_vb_no_sab_thread=function(){return(__create_vb_no_sab_thread=Module.__create_vb_no_sab_thread=Module.asm._create_vb_no_sab_thread).apply(null,arguments)},__signal_vb_thread_blur=Module.__signal_vb_thread_blur=function(){return(__signal_vb_thread_blur=Module.__signal_vb_thread_blur=Module.asm._signal_vb_thread_blur).apply(null,arguments)},__signal_vb_thread_bg=Module.__signal_vb_thread_bg=function(){return(__signal_vb_thread_bg=Module.__signal_vb_thread_bg=Module.asm._signal_vb_thread_bg).apply(null,arguments)},__signal_vb_thread_video_yuv=Module.__signal_vb_thread_video_yuv=function(){return(__signal_vb_thread_video_yuv=Module.__signal_vb_thread_video_yuv=Module.asm._signal_vb_thread_video_yuv).apply(null,arguments)},__signal_vb_thread_video_rgba=Module.__signal_vb_thread_video_rgba=function(){return(__signal_vb_thread_video_rgba=Module.__signal_vb_thread_video_rgba=Module.asm._signal_vb_thread_video_rgba).apply(null,arguments)},__signal_vb_thread_close=Module.__signal_vb_thread_close=function(){return(__signal_vb_thread_close=Module.__signal_vb_thread_close=Module.asm._signal_vb_thread_close).apply(null,arguments)},__update_video_cropping_mode=Module.__update_video_cropping_mode=function(){return(__update_video_cropping_mode=Module.__update_video_cropping_mode=Module.asm._update_video_cropping_mode).apply(null,arguments)},__collect_video_monitor_info=Module.__collect_video_monitor_info=function(){return(__collect_video_monitor_info=Module.__collect_video_monitor_info=Module.asm._collect_video_monitor_info).apply(null,arguments)},__request_nack_t_periodically_for_qos=Module.__request_nack_t_periodically_for_qos=function(){return(__request_nack_t_periodically_for_qos=Module.__request_nack_t_periodically_for_qos=Module.asm._request_nack_t_periodically_for_qos).apply(null,arguments)},__set_video_network_info=Module.__set_video_network_info=function(){return(__set_video_network_info=Module.__set_video_network_info=Module.asm._set_video_network_info).apply(null,arguments)},__set_video_fec_info=Module.__set_video_fec_info=function(){return(__set_video_fec_info=Module.__set_video_fec_info=Module.asm._set_video_fec_info).apply(null,arguments)},__set_video_retran_info=Module.__set_video_retran_info=function(){return(__set_video_retran_info=Module.__set_video_retran_info=Module.asm._set_video_retran_info).apply(null,arguments)},__set_video_bandwidth_alloc=Module.__set_video_bandwidth_alloc=function(){return(__set_video_bandwidth_alloc=Module.__set_video_bandwidth_alloc=Module.asm._set_video_bandwidth_alloc).apply(null,arguments)},__set_video_statistics_flag=Module.__set_video_statistics_flag=function(){return(__set_video_statistics_flag=Module.__set_video_statistics_flag=Module.asm._set_video_statistics_flag).apply(null,arguments)},__Sharing_Encode_Init=Module.__Sharing_Encode_Init=function(){return(__Sharing_Encode_Init=Module.__Sharing_Encode_Init=Module.asm._Sharing_Encode_Init).apply(null,arguments)},__Sharing_Encode_Try_Analysis=Module.__Sharing_Encode_Try_Analysis=function(){return(__Sharing_Encode_Try_Analysis=Module.__Sharing_Encode_Try_Analysis=Module.asm._Sharing_Encode_Try_Analysis).apply(null,arguments)},__Sharing_Encode_Uninit=Module.__Sharing_Encode_Uninit=function(){return(__Sharing_Encode_Uninit=Module.__Sharing_Encode_Uninit=Module.asm._Sharing_Encode_Uninit).apply(null,arguments)},__Sharing_Encode=Module.__Sharing_Encode=function(){return(__Sharing_Encode=Module.__Sharing_Encode=Module.asm._Sharing_Encode).apply(null,arguments)},__Sharing_Encode_Mouse_Data=Module.__Sharing_Encode_Mouse_Data=function(){return(__Sharing_Encode_Mouse_Data=Module.__Sharing_Encode_Mouse_Data=Module.asm._Sharing_Encode_Mouse_Data).apply(null,arguments)},__Request_Sharing_Qos_Data=Module.__Request_Sharing_Qos_Data=function(){return(__Request_Sharing_Qos_Data=Module.__Request_Sharing_Qos_Data=Module.asm._Request_Sharing_Qos_Data).apply(null,arguments)},__Sharing_Set_Data_Encryption=Module.__Sharing_Set_Data_Encryption=function(){return(__Sharing_Set_Data_Encryption=Module.__Sharing_Set_Data_Encryption=Module.asm._Sharing_Set_Data_Encryption).apply(null,arguments)},__Sharing_Pause_Encode=Module.__Sharing_Pause_Encode=function(){return(__Sharing_Pause_Encode=Module.__Sharing_Pause_Encode=Module.asm._Sharing_Pause_Encode).apply(null,arguments)},__Sharing_Resume_Encode=Module.__Sharing_Resume_Encode=function(){return(__Sharing_Resume_Encode=Module.__Sharing_Resume_Encode=Module.asm._Sharing_Resume_Encode).apply(null,arguments)},__Sharing_Stop_Encode=Module.__Sharing_Stop_Encode=function(){return(__Sharing_Stop_Encode=Module.__Sharing_Stop_Encode=Module.asm._Sharing_Stop_Encode).apply(null,arguments)},__Sharing_Websocket_Speed=Module.__Sharing_Websocket_Speed=function(){return(__Sharing_Websocket_Speed=Module.__Sharing_Websocket_Speed=Module.asm._Sharing_Websocket_Speed).apply(null,arguments)},__Add_Sharing_Cooker_info=Module.__Add_Sharing_Cooker_info=function(){return(__Add_Sharing_Cooker_info=Module.__Add_Sharing_Cooker_info=Module.asm._Add_Sharing_Cooker_info).apply(null,arguments)},__Remove_Sharing_Cooker_Info=Module.__Remove_Sharing_Cooker_Info=function(){return(__Remove_Sharing_Cooker_Info=Module.__Remove_Sharing_Cooker_Info=Module.asm._Remove_Sharing_Cooker_Info).apply(null,arguments)},__Get_Sharing_Meat_Weight=Module.__Get_Sharing_Meat_Weight=function(){return(__Get_Sharing_Meat_Weight=Module.__Get_Sharing_Meat_Weight=Module.asm._Get_Sharing_Meat_Weight).apply(null,arguments)},__Set_Sharing_Encryption_Key_Directly=Module.__Set_Sharing_Encryption_Key_Directly=function(){return(__Set_Sharing_Encryption_Key_Directly=Module.__Set_Sharing_Encryption_Key_Directly=Module.asm._Set_Sharing_Encryption_Key_Directly).apply(null,arguments)},__Add_Roster_Info_Directly=Module.__Add_Roster_Info_Directly=function(){return(__Add_Roster_Info_Directly=Module.__Add_Roster_Info_Directly=Module.asm._Add_Roster_Info_Directly).apply(null,arguments)},__Add_Rev_Channel=Module.__Add_Rev_Channel=function(){return(__Add_Rev_Channel=Module.__Add_Rev_Channel=Module.asm._Add_Rev_Channel).apply(null,arguments)},__Remove_Rev_Channel=Module.__Remove_Rev_Channel=function(){return(__Remove_Rev_Channel=Module.__Remove_Rev_Channel=Module.asm._Remove_Rev_Channel).apply(null,arguments)},__update_sharing_uplink_bandwidth_limitation_by_server=Module.__update_sharing_uplink_bandwidth_limitation_by_server=function(){return(__update_sharing_uplink_bandwidth_limitation_by_server=Module.__update_sharing_uplink_bandwidth_limitation_by_server=Module.asm._update_sharing_uplink_bandwidth_limitation_by_server).apply(null,arguments)},__collect_sharing_monitor_info=Module.__collect_sharing_monitor_info=function(){return(__collect_sharing_monitor_info=Module.__collect_sharing_monitor_info=Module.asm._collect_sharing_monitor_info).apply(null,arguments)},__set_sharing_statistics_flag=Module.__set_sharing_statistics_flag=function(){return(__set_sharing_statistics_flag=Module.__set_sharing_statistics_flag=Module.asm._set_sharing_statistics_flag).apply(null,arguments)},__set_annotation_action=Module.__set_annotation_action=function(){return(__set_annotation_action=Module.__set_annotation_action=Module.asm._set_annotation_action).apply(null,arguments)},__request_nack_t_periodically_for_sharing_qos=Module.__request_nack_t_periodically_for_sharing_qos=function(){return(__request_nack_t_periodically_for_sharing_qos=Module.__request_nack_t_periodically_for_sharing_qos=Module.asm._request_nack_t_periodically_for_sharing_qos).apply(null,arguments)},__Change_Connect_Type_For_Sharing=Module.__Change_Connect_Type_For_Sharing=function(){return(__Change_Connect_Type_For_Sharing=Module.__Change_Connect_Type_For_Sharing=Module.asm._Change_Connect_Type_For_Sharing).apply(null,arguments)},__Jpeg_Init=Module.__Jpeg_Init=function(){return(__Jpeg_Init=Module.__Jpeg_Init=Module.asm._Jpeg_Init).apply(null,arguments)},__Jpeg_Uninit=Module.__Jpeg_Uninit=function(){return(__Jpeg_Uninit=Module.__Jpeg_Uninit=Module.asm._Jpeg_Uninit).apply(null,arguments)},__Jpeg_HeardInfo=Module.__Jpeg_HeardInfo=function(){return(__Jpeg_HeardInfo=Module.__Jpeg_HeardInfo=Module.asm._Jpeg_HeardInfo).apply(null,arguments)},__Jpeg_Decode=Module.__Jpeg_Decode=function(){return(__Jpeg_Decode=Module.__Jpeg_Decode=Module.asm._Jpeg_Decode).apply(null,arguments)},__set_sharing_network_info=Module.__set_sharing_network_info=function(){return(__set_sharing_network_info=Module.__set_sharing_network_info=Module.asm._set_sharing_network_info).apply(null,arguments)},__set_sharing_fec_info=Module.__set_sharing_fec_info=function(){return(__set_sharing_fec_info=Module.__set_sharing_fec_info=Module.asm._set_sharing_fec_info).apply(null,arguments)},__set_sharing_retran_info=Module.__set_sharing_retran_info=function(){return(__set_sharing_retran_info=Module.__set_sharing_retran_info=Module.asm._set_sharing_retran_info).apply(null,arguments)},__set_sharing_bandwidth_alloc=Module.__set_sharing_bandwidth_alloc=function(){return(__set_sharing_bandwidth_alloc=Module.__set_sharing_bandwidth_alloc=Module.asm._set_sharing_bandwidth_alloc).apply(null,arguments)},__set_mmr_signature_info=Module.__set_mmr_signature_info=function(){return(__set_mmr_signature_info=Module.__set_mmr_signature_info=Module.asm._set_mmr_signature_info).apply(null,arguments)},__set_singature_info=Module.__set_singature_info=function(){return(__set_singature_info=Module.__set_singature_info=Module.asm._set_singature_info).apply(null,arguments)},__set_meeting_uuid_for_signature=Module.__set_meeting_uuid_for_signature=function(){return(__set_meeting_uuid_for_signature=Module.__set_meeting_uuid_for_signature=Module.asm._set_meeting_uuid_for_signature).apply(null,arguments)},__update_signagure_verify_action=Module.__update_signagure_verify_action=function(){return(__update_signagure_verify_action=Module.__update_signagure_verify_action=Module.asm._update_signagure_verify_action).apply(null,arguments)},_GIT_COMMIT_VERSION=Module._GIT_COMMIT_VERSION=function(){return(_GIT_COMMIT_VERSION=Module._GIT_COMMIT_VERSION=Module.asm.GIT_COMMIT_VERSION).apply(null,arguments)},getTempRet0=Module.getTempRet0=function(){return(getTempRet0=Module.getTempRet0=Module.asm.getTempRet0).apply(null,arguments)},___errno_location=Module.___errno_location=function(){return(___errno_location=Module.___errno_location=Module.asm.__errno_location).apply(null,arguments)},_htonl=Module._htonl=function(){return(_htonl=Module._htonl=Module.asm.htonl).apply(null,arguments)},_ntohs=Module._ntohs=function(){return(_ntohs=Module._ntohs=Module.asm.ntohs).apply(null,arguments)},_htons=Module._htons=function(){return(_htons=Module._htons=Module.asm.htons).apply(null,arguments)},_OnVideoFrameOutputCallback=Module._OnVideoFrameOutputCallback=function(){return(_OnVideoFrameOutputCallback=Module._OnVideoFrameOutputCallback=Module.asm.OnVideoFrameOutputCallback).apply(null,arguments)},_OnEncodedVideoChunkOutputCallback=Module._OnEncodedVideoChunkOutputCallback=function(){return(_OnEncodedVideoChunkOutputCallback=Module._OnEncodedVideoChunkOutputCallback=Module.asm.OnEncodedVideoChunkOutputCallback).apply(null,arguments)},_saveSetjmp=Module._saveSetjmp=function(){return(_saveSetjmp=Module._saveSetjmp=Module.asm.saveSetjmp).apply(null,arguments)},setTempRet0=Module.setTempRet0=function(){return(setTempRet0=Module.setTempRet0=Module.asm.setTempRet0).apply(null,arguments)},_emscripten_builtin_memalign=Module._emscripten_builtin_memalign=function(){return(_emscripten_builtin_memalign=Module._emscripten_builtin_memalign=Module.asm.emscripten_builtin_memalign).apply(null,arguments)},_setThrew=Module._setThrew=function(){return(_setThrew=Module._setThrew=Module.asm.setThrew).apply(null,arguments)},stackSave=Module.stackSave=function(){return(stackSave=Module.stackSave=Module.asm.stackSave).apply(null,arguments)},stackRestore=Module.stackRestore=function(){return(stackRestore=Module.stackRestore=Module.asm.stackRestore).apply(null,arguments)},stackAlloc=Module.stackAlloc=function(){return(stackAlloc=Module.stackAlloc=Module.asm.stackAlloc).apply(null,arguments)},___cxa_demangle=Module.___cxa_demangle=function(){return(___cxa_demangle=Module.___cxa_demangle=Module.asm.__cxa_demangle).apply(null,arguments)},___cxa_can_catch=Module.___cxa_can_catch=function(){return(___cxa_can_catch=Module.___cxa_can_catch=Module.asm.__cxa_can_catch).apply(null,arguments)},___cxa_is_pointer_type=Module.___cxa_is_pointer_type=function(){return(___cxa_is_pointer_type=Module.___cxa_is_pointer_type=Module.asm.__cxa_is_pointer_type).apply(null,arguments)},dynCall_iijiiiiiiiiiiii=Module.dynCall_iijiiiiiiiiiiii=function(){return(dynCall_iijiiiiiiiiiiii=Module.dynCall_iijiiiiiiiiiiii=Module.asm.dynCall_iijiiiiiiiiiiii).apply(null,arguments)},dynCall_iijiiiiiiiiii=Module.dynCall_iijiiiiiiiiii=function(){return(dynCall_iijiiiiiiiiii=Module.dynCall_iijiiiiiiiiii=Module.asm.dynCall_iijiiiiiiiiii).apply(null,arguments)},dynCall_iij=Module.dynCall_iij=function(){return(dynCall_iij=Module.dynCall_iij=Module.asm.dynCall_iij).apply(null,arguments)},dynCall_iijii=Module.dynCall_iijii=function(){return(dynCall_iijii=Module.dynCall_iijii=Module.asm.dynCall_iijii).apply(null,arguments)},dynCall_iiijiji=Module.dynCall_iiijiji=function(){return(dynCall_iiijiji=Module.dynCall_iiijiji=Module.asm.dynCall_iiijiji).apply(null,arguments)},dynCall_iiijiii=Module.dynCall_iiijiii=function(){return(dynCall_iiijiii=Module.dynCall_iiijiii=Module.asm.dynCall_iiijiii).apply(null,arguments)},dynCall_iiiji=Module.dynCall_iiiji=function(){return(dynCall_iiiji=Module.dynCall_iiiji=Module.asm.dynCall_iiiji).apply(null,arguments)},dynCall_iiij=Module.dynCall_iiij=function(){return(dynCall_iiij=Module.dynCall_iiij=Module.asm.dynCall_iiij).apply(null,arguments)},dynCall_vij=Module.dynCall_vij=function(){return(dynCall_vij=Module.dynCall_vij=Module.asm.dynCall_vij).apply(null,arguments)},dynCall_viiiij=Module.dynCall_viiiij=function(){return(dynCall_viiiij=Module.dynCall_viiiij=Module.asm.dynCall_viiiij).apply(null,arguments)},dynCall_viiijii=Module.dynCall_viiijii=function(){return(dynCall_viiijii=Module.dynCall_viiijii=Module.asm.dynCall_viiijii).apply(null,arguments)},dynCall_iiijii=Module.dynCall_iiijii=function(){return(dynCall_iiijii=Module.dynCall_iiijii=Module.asm.dynCall_iiijii).apply(null,arguments)},dynCall_iiiiiiiiij=Module.dynCall_iiiiiiiiij=function(){return(dynCall_iiiiiiiiij=Module.dynCall_iiiiiiiiij=Module.asm.dynCall_iiiiiiiiij).apply(null,arguments)},dynCall_iiiiiijiji=Module.dynCall_iiiiiijiji=function(){return(dynCall_iiiiiijiji=Module.dynCall_iiiiiijiji=Module.asm.dynCall_iiiiiijiji).apply(null,arguments)},dynCall_iiiiiiiiiiiij=Module.dynCall_iiiiiiiiiiiij=function(){return(dynCall_iiiiiiiiiiiij=Module.dynCall_iiiiiiiiiiiij=Module.asm.dynCall_iiiiiiiiiiiij).apply(null,arguments)},dynCall_viiiiiij=Module.dynCall_viiiiiij=function(){return(dynCall_viiiiiij=Module.dynCall_viiiiiij=Module.asm.dynCall_viiiiiij).apply(null,arguments)},dynCall_viji=Module.dynCall_viji=function(){return(dynCall_viji=Module.dynCall_viji=Module.asm.dynCall_viji).apply(null,arguments)},dynCall_iiiiiiji=Module.dynCall_iiiiiiji=function(){return(dynCall_iiiiiiji=Module.dynCall_iiiiiiji=Module.asm.dynCall_iiiiiiji).apply(null,arguments)},dynCall_iiiiijiji=Module.dynCall_iiiiijiji=function(){return(dynCall_iiiiijiji=Module.dynCall_iiiiijiji=Module.asm.dynCall_iiiiijiji).apply(null,arguments)},dynCall_iiiiiiiiiiij=Module.dynCall_iiiiiiiiiiij=function(){return(dynCall_iiiiiiiiiiij=Module.dynCall_iiiiiiiiiiij=Module.asm.dynCall_iiiiiiiiiiij).apply(null,arguments)},dynCall_iiiiiiiij=Module.dynCall_iiiiiiiij=function(){return(dynCall_iiiiiiiij=Module.dynCall_iiiiiiiij=Module.asm.dynCall_iiiiiiiij).apply(null,arguments)},dynCall_iiji=Module.dynCall_iiji=function(){return(dynCall_iiji=Module.dynCall_iiji=Module.asm.dynCall_iiji).apply(null,arguments)},dynCall_ji=Module.dynCall_ji=function(){return(dynCall_ji=Module.dynCall_ji=Module.asm.dynCall_ji).apply(null,arguments)},dynCall_jiiiiii=Module.dynCall_jiiiiii=function(){return(dynCall_jiiiiii=Module.dynCall_jiiiiii=Module.asm.dynCall_jiiiiii).apply(null,arguments)},dynCall_jiji=Module.dynCall_jiji=function(){return(dynCall_jiji=Module.dynCall_jiji=Module.asm.dynCall_jiji).apply(null,arguments)},dynCall_viijii=Module.dynCall_viijii=function(){return(dynCall_viijii=Module.dynCall_viijii=Module.asm.dynCall_viijii).apply(null,arguments)},dynCall_jiiii=Module.dynCall_jiiii=function(){return(dynCall_jiiii=Module.dynCall_jiiii=Module.asm.dynCall_jiiii).apply(null,arguments)},dynCall_iiiiij=Module.dynCall_iiiiij=function(){return(dynCall_iiiiij=Module.dynCall_iiiiij=Module.asm.dynCall_iiiiij).apply(null,arguments)},dynCall_iiiiijj=Module.dynCall_iiiiijj=function(){return(dynCall_iiiiijj=Module.dynCall_iiiiijj=Module.asm.dynCall_iiiiijj).apply(null,arguments)},dynCall_iiiiiijj=Module.dynCall_iiiiiijj=function(){return(dynCall_iiiiiijj=Module.dynCall_iiiiiijj=Module.asm.dynCall_iiiiiijj).apply(null,arguments)};function invoke_vii(e,t,r){var i=stackSave();try{getWasmTableEntry(e)(t,r)}catch(e){if(stackRestore(i),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(e,t,r,i,n){var s=stackSave();try{return getWasmTableEntry(e)(t,r,i,n)}catch(e){if(stackRestore(s),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(e,t,r,i){var n=stackSave();try{return getWasmTableEntry(e)(t,r,i)}catch(e){if(stackRestore(n),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(e,t,r){var i=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(e){if(stackRestore(i),e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(e){if(stackRestore(r),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(e,t,r,i,n){var s=stackSave();try{getWasmTableEntry(e)(t,r,i,n)}catch(e){if(stackRestore(s),e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(e,t){var r=stackSave();try{getWasmTableEntry(e)(t)}catch(e){if(stackRestore(r),e!==e+0)throw e;_setThrew(1,0)}}function invoke_v(e){var t=stackSave();try{getWasmTableEntry(e)()}catch(e){if(stackRestore(t),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(e,t,r,i){var n=stackSave();try{getWasmTableEntry(e)(t,r,i)}catch(e){if(stackRestore(n),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiii(e,t,r,i,n,s,a){var o=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,s,a)}catch(e){if(stackRestore(o),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(e,t,r,i,n,s){var a=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,s)}catch(e){if(stackRestore(a),e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(e){if(stackRestore(t),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiii(e,t,r,i,n,s,a,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,s,a,o)}catch(e){if(stackRestore(l),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(e,t,r,i,n,s,a,o){var l=stackSave();try{getWasmTableEntry(e)(t,r,i,n,s,a,o)}catch(e){if(stackRestore(l),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiii(e,t,r,i,n,s,a,o,l,c,u){var h=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,s,a,o,l,c,u)}catch(e){if(stackRestore(h),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiiii(e,t,r,i,n,s,a,o,l,c,u,h,d){var _=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,s,a,o,l,c,u,h,d)}catch(e){if(stackRestore(_),e!==e+0)throw e;_setThrew(1,0)}}function invoke_fiii(e,t,r,i){var n=stackSave();try{return getWasmTableEntry(e)(t,r,i)}catch(e){if(stackRestore(n),e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(e,t,r,i){var n=stackSave();try{return getWasmTableEntry(e)(t,r,i)}catch(e){if(stackRestore(n),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(e,t,r,i,n,s,a,o,l,c,u,h){var d=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,s,a,o,l,c,u,h)}catch(e){if(stackRestore(d),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(e,t,r,i,n,s,a,o,l,c,u){var h=stackSave();try{getWasmTableEntry(e)(t,r,i,n,s,a,o,l,c,u)}catch(e){if(stackRestore(h),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(e,t,r,i,n,s,a,o,l,c,u,h,d,_,f,p){var m=stackSave();try{getWasmTableEntry(e)(t,r,i,n,s,a,o,l,c,u,h,d,_,f,p)}catch(e){if(stackRestore(m),e!==e+0)throw e;_setThrew(1,0)}}function invoke_vij(e,t,r,i){var n=stackSave();try{dynCall_vij(e,t,r,i)}catch(e){if(stackRestore(n),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiij(e,t,r,i,n,s,a){var o=stackSave();try{dynCall_viiiij(e,t,r,i,n,s,a)}catch(e){if(stackRestore(o),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viijii(e,t,r,i,n,s,a){var o=stackSave();try{dynCall_viijii(e,t,r,i,n,s,a)}catch(e){if(stackRestore(o),e!==e+0)throw e;_setThrew(1,0)}}function invoke_jiiii(e,t,r,i,n){var s=stackSave();try{return dynCall_jiiii(e,t,r,i,n)}catch(e){if(stackRestore(s),e!==e+0)throw e;_setThrew(1,0)}}function run(e){function t(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),postRun()))}e=e||arguments_,runDependencies>0||(preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Module.setStatus("")}),1),t()}),1)):t()))}if(Module.cwrap=cwrap,dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)},Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();run();
|
|
2
|
+
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/sharing_simd.min.js-41e168998e008fc7d41c.map
|