quickvo-sdk-js 1.5.10 → 1.5.11

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.
@@ -1,4 +1,4 @@
1
- (function(N,M){typeof exports=="object"&&typeof module<"u"?M(exports):typeof define=="function"&&define.amd?define(["exports"],M):(N=typeof globalThis<"u"?globalThis:N||self,M(N["snqu-calls-sdk-js"]={}))})(this,(function(exports){"use strict";const at=(N,M={})=>{const B={unit:"B",splitStr:" ",...M};let{unit:F,splitStr:A}=B;const D=["B","KB","MB","GB","TB","PB","EB","ZB","YB","DB","NB"],i=D.findIndex(te=>te===F),T=D.slice(i+1,D.length);let C=`${N}`;const U=C[0]==="-";U&&(C=C.replace("-",""));const j=C.split(""),z=L$1(j,4).reverse();let K="",Y=0;for(const te of z)if(K=`${te.join("")}${K}`,Y=+`${K}`,!(Y<1024)){for(const ae of T)if(F=ae,Y=Y/1024,Math.abs(Y)<1024)break}return`${U?"-":""}${Y.toFixed(2)}${A}${F}`},_=(N,M=[])=>{const B={...N},F=Object.keys(B);for(const A of F)M.findIndex(D=>String(D)===A)===-1&&delete B[A];return B},L$1=(N,M)=>{const B=Math.max(1,M),F=Math.ceil(N.length/B),A=[];for(let D=0;D<F;D++){const i=D*B,T=Math.min(i+B,N.length);A.push(N.slice(i,T))}return A},ft=(N,M=[],B=!0)=>{const F=new Map;for(const D of N){const i=[];for(const C of M)i.push(D[C]);const T=`map-${i.join("-")}`;if(!F.has(T)){F.set(T,D);continue}B&&F.set(T,D)}const A=F.entries();return Array.from(A,([D,i])=>i)},dt=(N,M=[])=>{const B=[];for(const F of N){const A=_(F,M);B.push(A)}return B},pt=(N,M="value",B="label")=>{const F=[],A=Object.entries(N);for(const[D,i]of A){const T={[B]:i,[M]:D};F.push(T)}return F},Q=(N=0,M=1)=>{const B=Math.max(0,N),F=Math.max(1,M),A=Math.random()*(F-B+1)+B;return parseInt(`${A}`,10)},Mt=(N=16,M=16)=>{const B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),F=Math.min(B.length,M),A=Date.now().toString(F),D=A.split(""),i=Math.max(4,N-A.length);for(let T=0;T<i;T++){const C=Q(0,F-1),U=B[C];D.push(U)}return D.join("").toUpperCase()},R$1=(N,M)=>{try{let B=Number(N);if(isNaN(B)){const F=new Date(`${N}`);if(`${F}`=="Invalid Date")return 0;B=F.getTime()}if(M!==void 0){const F=new Date().getTimezoneOffset();B+=(F+M)*60*1e3}return B}catch(B){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:N,_offset:M,error:B}),0}},E$1=1e3,G$1=6e4,O=36e5,$=864e5,X={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},W=N=>R$1(N),u=(N,M="YYYY-MM-DD hh:mm:ss",B={})=>{const F={empty_str:"-",...B},{empty_str:A,offset:D}=F,i=R$1(N,D);if(Number(N)!==0&&i===0)return A;const T=new Date(i),C=`${T.getFullYear()}`,U=`${T.getMonth()+1}`,j=`${["1","2","3"].includes(U)?1:["4","5","6"].includes(U)?2:["7","8","9"].includes(U)?3:4}`,z=`${T.getDate()}`,K=`${T.getDay()===0?7:T.getDay()}`,Y=`${T.getHours()}`,te=`${T.getMinutes()}`,ae=`${T.getSeconds()}`,se=`${Math.ceil((i-W(`${C}/01/01 00:00:00`)+1)/864e5)}`,oe=`${Math.ceil(((i-W(`${C}/01/01 00:00:00`))/864e5-Number(K))/7)+1}`,he=[{k:"Y+",v:C},{k:"M+",v:U},{k:"Q+",v:j},{k:"D+",v:z},{k:"W+",v:K},{k:"h+",v:Y},{k:"m+",v:te},{k:"s+",v:ae},{k:"d+",v:se},{k:"w+",v:oe}];let ke;for(let{k:ie,v:ce}of he)if(ke=new RegExp(`(${ie})`).exec(M),ke){const pe=ke[1];let ue=ce.padStart(pe.length,"0");pe.includes("W")&&(ue=X[ue.slice(0,2)]),M=M.replace(pe,ue)}return M},V=new Map,kt=(N,M={})=>new Promise(async(B,F)=>{const{timeout:A=5*1e3,message:D="timeout"}=M,i=window.setTimeout(()=>F(D),A);try{const T=await N();B(T)}catch(T){F(T)}clearTimeout(i)}),At=(N,M,B)=>{const F=new Date().getTime(),A=V.get(N)||0;F-B>A&&(M(),V.set(N,F))},enum_mediaType={microphoneCamera_audio:"麦克风-默认轨道",microphoneCamera_video:"摄像头-默认轨道",screenSharing_video:"屏幕共享-视频轨道",screenSharing_audio:"屏幕共享-音频轨道"};pt(enum_mediaType);const mediaType_keys=Object.keys(enum_mediaType);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(N){return N&&N.__esModule&&Object.prototype.hasOwnProperty.call(N,"default")?N.default:N}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var N=grammar.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(M){return M.encoding?"rtpmap:%d %s/%s/%s":M.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(M){return M.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(M){return M.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(M){return"extmap:%d"+(M.direction?"/%s":"%v")+(M["encrypt-uri"]?" %s":"%v")+" %s"+(M.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(M){return M.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{push:"msid",reg:/^msid:([\w-]+)(?: ([\w-]+))?/,names:["id","appdata"],format:"msid:%s %s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(M){var B="candidate:%s %d %s %d %s %d typ %s";return B+=M.raddr!=null?" raddr %s rport %d":"%v%v",B+=M.tcptype!=null?" tcptype %s":"%v",M.generation!=null&&(B+=" generation %d"),B+=M["network-id"]!=null?" network-id %d":"%v",B+=M["network-cost"]!=null?" network-cost %d":"%v",B}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(M){var B="ssrc:%d";return M.attribute!=null&&(B+=" %s",M.value!=null&&(B+=":%s")),B}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(M){return M.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(M){return M.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(M){return"imageattr:%s %s %s"+(M.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(M){return"simulcast:%s %s"+(M.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(M){return"ts-refclk:%s"+(M.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(M){var B="mediaclk:";return B+=M.id!=null?"id=%s %s":"%v%s",B+=M.mediaClockValue!=null?"=%s":"",B+=M.rateNumerator!=null?" rate=%s":"",B+=M.rateDenominator!=null?"/%s":"",B}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(N).forEach(function(M){var B=N[M];B.forEach(function(F){F.reg||(F.reg=/(.*)/),F.format||(F.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,(function(N){var M=function(T){return String(Number(T))===T?Number(T):T},B=function(T,C,U,j){if(j&&!U)C[j]=M(T[1]);else for(var z=0;z<U.length;z+=1)T[z+1]!=null&&(C[U[z]]=M(T[z+1]))},F=function(T,C,U){var j=T.name&&T.names;T.push&&!C[T.push]?C[T.push]=[]:j&&!C[T.name]&&(C[T.name]={});var z=T.push?{}:j?C[T.name]:C;B(U.match(T.reg),z,T.names,T.name),T.push&&C[T.push].push(z)},A=requireGrammar(),D=RegExp.prototype.test.bind(/^([a-z])=(.*)/);N.parse=function(T){var C={},U=[],j=C;return T.split(/(\r\n|\r|\n)/).filter(D).forEach(function(z){var K=z[0],Y=z.slice(2);K==="m"&&(U.push({rtp:[],fmtp:[]}),j=U[U.length-1]);for(var te=0;te<(A[K]||[]).length;te+=1){var ae=A[K][te];if(ae.reg.test(Y))return F(ae,j,Y)}}),C.media=U,C};var i=function(T,C){var U=C.split(/=(.+)/,2);return U.length===2?T[U[0]]=M(U[1]):U.length===1&&C.length>1&&(T[U[0]]=void 0),T};N.parseParams=function(T){return T.split(/;\s?/).reduce(i,{})},N.parseFmtpConfig=N.parseParams,N.parsePayloads=function(T){return T.toString().split(" ").map(Number)},N.parseRemoteCandidates=function(T){for(var C=[],U=T.split(" ").map(M),j=0;j<U.length;j+=3)C.push({component:U[j],ip:U[j+1],port:U[j+2]});return C},N.parseImageAttributes=function(T){return T.split(" ").map(function(C){return C.substring(1,C.length-1).split(",").reduce(i,{})})},N.parseSimulcastStreamList=function(T){return T.split(";").map(function(C){return C.split(",").map(function(U){var j,z=!1;return U[0]!=="~"?j=M(U):(j=M(U.substring(1,U.length)),z=!0),{scid:j,paused:z}})})}})(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var N=requireGrammar(),M=/%[sdv%]/g,B=function(i){var T=1,C=arguments,U=C.length;return i.replace(M,function(j){if(T>=U)return j;var z=C[T];switch(T+=1,j){case"%%":return"%";case"%s":return String(z);case"%d":return Number(z);case"%v":return""}})},F=function(i,T,C){var U=T.format instanceof Function?T.format(T.push?C:C[T.name]):T.format,j=[i+"="+U];if(T.names)for(var z=0;z<T.names.length;z+=1){var K=T.names[z];T.name?j.push(C[T.name][K]):j.push(C[T.names[z]])}else j.push(C[T.name]);return B.apply(null,j)},A=["v","o","s","i","u","e","p","c","b","t","r","z","a"],D=["i","c","b","a"];return writer$1=function(i,T){T=T||{},i.version==null&&(i.version=0),i.name==null&&(i.name=" "),i.media.forEach(function(z){z.payloads==null&&(z.payloads="")});var C=T.outerOrder||A,U=T.innerOrder||D,j=[];return C.forEach(function(z){N[z].forEach(function(K){K.name in i&&i[K.name]!=null?j.push(F(z,K,i)):K.push in i&&i[K.push]!=null&&i[K.push].forEach(function(Y){j.push(F(z,K,Y))})})}),i.media.forEach(function(z){j.push(F("m",N.m[0],z)),U.forEach(function(K){N[K].forEach(function(Y){Y.name in z&&z[Y.name]!=null?j.push(F(K,Y,z)):Y.push in z&&z[Y.push]!=null&&z[Y.push].forEach(function(te){j.push(F(K,Y,te))})})})}),j.join(`\r
1
+ (function(N,M){typeof exports=="object"&&typeof module<"u"?M(exports):typeof define=="function"&&define.amd?define(["exports"],M):(N=typeof globalThis<"u"?globalThis:N||self,M(N["snqu-calls-sdk-js"]={}))})(this,(function(exports){"use strict";const at=(N,M={})=>{const B={unit:"B",splitStr:" ",...M};let{unit:F,splitStr:C}=B;const D=["B","KB","MB","GB","TB","PB","EB","ZB","YB","DB","NB"],i=D.findIndex(te=>te===F),T=D.slice(i+1,D.length);let A=`${N}`;const U=A[0]==="-";U&&(A=A.replace("-",""));const j=A.split(""),z=L$1(j,4).reverse();let K="",Y=0;for(const te of z)if(K=`${te.join("")}${K}`,Y=+`${K}`,!(Y<1024)){for(const ae of T)if(F=ae,Y=Y/1024,Math.abs(Y)<1024)break}return`${U?"-":""}${Y.toFixed(2)}${C}${F}`},_=(N,M=[])=>{const B={...N},F=Object.keys(B);for(const C of F)M.findIndex(D=>String(D)===C)===-1&&delete B[C];return B},L$1=(N,M)=>{const B=Math.max(1,M),F=Math.ceil(N.length/B),C=[];for(let D=0;D<F;D++){const i=D*B,T=Math.min(i+B,N.length);C.push(N.slice(i,T))}return C},ft=(N,M=[],B=!0)=>{const F=new Map;for(const D of N){const i=[];for(const A of M)i.push(D[A]);const T=`map-${i.join("-")}`;if(!F.has(T)){F.set(T,D);continue}B&&F.set(T,D)}const C=F.entries();return Array.from(C,([D,i])=>i)},dt=(N,M=[])=>{const B=[];for(const F of N){const C=_(F,M);B.push(C)}return B},pt=(N,M="value",B="label")=>{const F=[],C=Object.entries(N);for(const[D,i]of C){const T={[B]:i,[M]:D};F.push(T)}return F},Q=(N=0,M=1)=>{const B=Math.max(0,N),F=Math.max(1,M),C=Math.random()*(F-B+1)+B;return parseInt(`${C}`,10)},Mt=(N=16,M=16)=>{const B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),F=Math.min(B.length,M),C=Date.now().toString(F),D=C.split(""),i=Math.max(4,N-C.length);for(let T=0;T<i;T++){const A=Q(0,F-1),U=B[A];D.push(U)}return D.join("").toUpperCase()},R$1=(N,M)=>{try{let B=Number(N);if(isNaN(B)){const F=new Date(`${N}`);if(`${F}`=="Invalid Date")return 0;B=F.getTime()}if(M!==void 0){const F=new Date().getTimezoneOffset();B+=(F+M)*60*1e3}return B}catch(B){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:N,_offset:M,error:B}),0}},E$1=1e3,G$1=6e4,O=36e5,$=864e5,X={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},W=N=>R$1(N),u=(N,M="YYYY-MM-DD hh:mm:ss",B={})=>{const F={empty_str:"-",...B},{empty_str:C,offset:D}=F,i=R$1(N,D);if(Number(N)!==0&&i===0)return C;const T=new Date(i),A=`${T.getFullYear()}`,U=`${T.getMonth()+1}`,j=`${["1","2","3"].includes(U)?1:["4","5","6"].includes(U)?2:["7","8","9"].includes(U)?3:4}`,z=`${T.getDate()}`,K=`${T.getDay()===0?7:T.getDay()}`,Y=`${T.getHours()}`,te=`${T.getMinutes()}`,ae=`${T.getSeconds()}`,se=`${Math.ceil((i-W(`${A}/01/01 00:00:00`)+1)/864e5)}`,re=`${Math.ceil(((i-W(`${A}/01/01 00:00:00`))/864e5-Number(K))/7)+1}`,pe=[{k:"Y+",v:A},{k:"M+",v:U},{k:"Q+",v:j},{k:"D+",v:z},{k:"W+",v:K},{k:"h+",v:Y},{k:"m+",v:te},{k:"s+",v:ae},{k:"d+",v:se},{k:"w+",v:re}];let ke;for(let{k:ie,v:ce}of pe)if(ke=new RegExp(`(${ie})`).exec(M),ke){const he=ke[1];let ue=ce.padStart(he.length,"0");he.includes("W")&&(ue=X[ue.slice(0,2)]),M=M.replace(he,ue)}return M},V=new Map,kt=(N,M={})=>new Promise(async(B,F)=>{const{timeout:C=5*1e3,message:D="timeout"}=M,i=window.setTimeout(()=>F(D),C);try{const T=await N();B(T)}catch(T){F(T)}clearTimeout(i)}),At=(N,M,B)=>{const F=new Date().getTime(),C=V.get(N)||0;F-B>C&&(M(),V.set(N,F))},enum_mediaType={microphoneCamera_audio:"麦克风-默认轨道",microphoneCamera_video:"摄像头-默认轨道",screenSharing_video:"屏幕共享-视频轨道",screenSharing_audio:"屏幕共享-音频轨道"};pt(enum_mediaType);const mediaType_keys=Object.keys(enum_mediaType);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(N){return N&&N.__esModule&&Object.prototype.hasOwnProperty.call(N,"default")?N.default:N}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var N=grammar.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(M){return M.encoding?"rtpmap:%d %s/%s/%s":M.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(M){return M.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(M){return M.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(M){return"extmap:%d"+(M.direction?"/%s":"%v")+(M["encrypt-uri"]?" %s":"%v")+" %s"+(M.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(M){return M.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{push:"msid",reg:/^msid:([\w-]+)(?: ([\w-]+))?/,names:["id","appdata"],format:"msid:%s %s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(M){var B="candidate:%s %d %s %d %s %d typ %s";return B+=M.raddr!=null?" raddr %s rport %d":"%v%v",B+=M.tcptype!=null?" tcptype %s":"%v",M.generation!=null&&(B+=" generation %d"),B+=M["network-id"]!=null?" network-id %d":"%v",B+=M["network-cost"]!=null?" network-cost %d":"%v",B}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(M){var B="ssrc:%d";return M.attribute!=null&&(B+=" %s",M.value!=null&&(B+=":%s")),B}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(M){return M.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(M){return M.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(M){return"imageattr:%s %s %s"+(M.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(M){return"simulcast:%s %s"+(M.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(M){return"ts-refclk:%s"+(M.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(M){var B="mediaclk:";return B+=M.id!=null?"id=%s %s":"%v%s",B+=M.mediaClockValue!=null?"=%s":"",B+=M.rateNumerator!=null?" rate=%s":"",B+=M.rateDenominator!=null?"/%s":"",B}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(N).forEach(function(M){var B=N[M];B.forEach(function(F){F.reg||(F.reg=/(.*)/),F.format||(F.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,(function(N){var M=function(T){return String(Number(T))===T?Number(T):T},B=function(T,A,U,j){if(j&&!U)A[j]=M(T[1]);else for(var z=0;z<U.length;z+=1)T[z+1]!=null&&(A[U[z]]=M(T[z+1]))},F=function(T,A,U){var j=T.name&&T.names;T.push&&!A[T.push]?A[T.push]=[]:j&&!A[T.name]&&(A[T.name]={});var z=T.push?{}:j?A[T.name]:A;B(U.match(T.reg),z,T.names,T.name),T.push&&A[T.push].push(z)},C=requireGrammar(),D=RegExp.prototype.test.bind(/^([a-z])=(.*)/);N.parse=function(T){var A={},U=[],j=A;return T.split(/(\r\n|\r|\n)/).filter(D).forEach(function(z){var K=z[0],Y=z.slice(2);K==="m"&&(U.push({rtp:[],fmtp:[]}),j=U[U.length-1]);for(var te=0;te<(C[K]||[]).length;te+=1){var ae=C[K][te];if(ae.reg.test(Y))return F(ae,j,Y)}}),A.media=U,A};var i=function(T,A){var U=A.split(/=(.+)/,2);return U.length===2?T[U[0]]=M(U[1]):U.length===1&&A.length>1&&(T[U[0]]=void 0),T};N.parseParams=function(T){return T.split(/;\s?/).reduce(i,{})},N.parseFmtpConfig=N.parseParams,N.parsePayloads=function(T){return T.toString().split(" ").map(Number)},N.parseRemoteCandidates=function(T){for(var A=[],U=T.split(" ").map(M),j=0;j<U.length;j+=3)A.push({component:U[j],ip:U[j+1],port:U[j+2]});return A},N.parseImageAttributes=function(T){return T.split(" ").map(function(A){return A.substring(1,A.length-1).split(",").reduce(i,{})})},N.parseSimulcastStreamList=function(T){return T.split(";").map(function(A){return A.split(",").map(function(U){var j,z=!1;return U[0]!=="~"?j=M(U):(j=M(U.substring(1,U.length)),z=!0),{scid:j,paused:z}})})}})(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var N=requireGrammar(),M=/%[sdv%]/g,B=function(i){var T=1,A=arguments,U=A.length;return i.replace(M,function(j){if(T>=U)return j;var z=A[T];switch(T+=1,j){case"%%":return"%";case"%s":return String(z);case"%d":return Number(z);case"%v":return""}})},F=function(i,T,A){var U=T.format instanceof Function?T.format(T.push?A:A[T.name]):T.format,j=[i+"="+U];if(T.names)for(var z=0;z<T.names.length;z+=1){var K=T.names[z];T.name?j.push(A[T.name][K]):j.push(A[T.names[z]])}else j.push(A[T.name]);return B.apply(null,j)},C=["v","o","s","i","u","e","p","c","b","t","r","z","a"],D=["i","c","b","a"];return writer$1=function(i,T){T=T||{},i.version==null&&(i.version=0),i.name==null&&(i.name=" "),i.media.forEach(function(z){z.payloads==null&&(z.payloads="")});var A=T.outerOrder||C,U=T.innerOrder||D,j=[];return A.forEach(function(z){N[z].forEach(function(K){K.name in i&&i[K.name]!=null?j.push(F(z,K,i)):K.push in i&&i[K.push]!=null&&i[K.push].forEach(function(Y){j.push(F(z,K,Y))})})}),i.media.forEach(function(z){j.push(F("m",N.m[0],z)),U.forEach(function(K){N[K].forEach(function(Y){Y.name in z&&z[Y.name]!=null?j.push(F(K,Y,z)):Y.push in z&&z[Y.push]!=null&&z[Y.push].forEach(function(te){j.push(F(K,Y,te))})})})}),j.join(`\r
2
2
  `)+`\r
3
- `},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var N=requireParser(),M=requireWriter$1(),B=requireGrammar();return lib$1.grammar=B,lib$1.write=M,lib$1.parse=N.parse,lib$1.parseParams=N.parseParams,lib$1.parseFmtpConfig=N.parseFmtpConfig,lib$1.parsePayloads=N.parsePayloads,lib$1.parseRemoteCandidates=N.parseRemoteCandidates,lib$1.parseImageAttributes=N.parseImageAttributes,lib$1.parseSimulcastStreamList=N.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{kind="video";stream=new MediaStream;constructor(M){this.stream.addTrack(M)}stop=()=>{const M=this.stream.getTracks();for(const B of M)this.stream.removeTrack(B),B.stop()};replaceStream=M=>{const B=this.stream,F=B.getTracks();for(const D of F)B.removeTrack(D),D.stop();const[A]=M.getVideoTracks();A&&B.addTrack(A)};pause=async M=>{const B=this.stream.getTracks();for(const F of B)F.enabled=!M};getStream=()=>this.stream;getTrack=()=>this.stream.getTracks()[0]}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};pt(enum_roomState);var I=Object.defineProperty,k=N=>{throw TypeError(N)},S=(N,M,B)=>M in N?I(N,M,{enumerable:!0,configurable:!0,writable:!0,value:B}):N[M]=B,a$1=(N,M,B)=>S(N,typeof M!="symbol"?M+"":M,B),R=(N,M,B)=>M.has(N)||k("Cannot "+B),t=(N,M,B)=>(R(N,M,"read from private field"),B?B.call(N):M.get(N)),h$1=(N,M,B)=>M.has(N)?k("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(N):M.set(N,B),r=(N,M,B,F)=>(R(N,M,"write to private field"),M.set(N,B),B);const E=(N=0,M=1)=>{const B=Math.max(0,N),F=Math.max(1,M),A=Math.random()*(F-B+1)+B;return parseInt(`${A}`,10)},L=(N=16,M=16)=>{const B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),F=Math.min(B.length,M),A=Date.now().toString(F),D=A.split(""),i=Math.max(4,N-A.length);for(let T=0;T<i;T++){const C=E(0,F-1),U=B[C];D.push(U)}return D.join("").toUpperCase()};var s$1,c,l$1,m$1,p$1,f,w,g$2,b,y$1,x;class H{constructor(M){h$1(this,s$1,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,autoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4}),a$1(this,"ws"),h$1(this,c,""),h$1(this,l$1,-1),h$1(this,m$1,-1),h$1(this,p$1,0),h$1(this,f,0),h$1(this,w,!1),a$1(this,"checkReconnect",async B=>!0),a$1(this,"onReconnectSuccess",async B=>{}),a$1(this,"onReconnectStop",async B=>{}),a$1(this,"getHeartbeatMsg",()=>JSON.stringify({event:"heartbeat"})),a$1(this,"onMessage",B=>{}),a$1(this,"setOptions",B=>{r(this,s$1,{...t(this,s$1),...B})}),a$1(this,"connect",()=>new Promise(async(B,F)=>{r(this,c,L()),t(this,s$1).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;padding:16px 0;","------->pr-ws: connecting.",{key:t(this,c),url:t(this,s$1).url}),this.ws=new WebSocket(t(this,s$1).url),this.ws.binaryType=t(this,s$1).binaryType,this.ws.addEventListener("message",t(this,b)),this.ws.addEventListener("open",A=>{clearTimeout(t(this,p$1)),r(this,l$1,t(this,s$1).reconnectCount),r(this,w,!1),r(this,m$1,-1),t(this,y$1).call(this),t(this,s$1).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;padding:16px 0;","------->pr-ws: connected.",{key:t(this,c),url:t(this,s$1).url}),B(A)}),this.ws.addEventListener("error",A=>{clearTimeout(t(this,p$1)),t(this,s$1).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;padding:16px 0;","------->pr-ws: connect is error.",{key:t(this,c),url:t(this,s$1).url,e:A}),F(A)}),this.ws.addEventListener("close",A=>{if(t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;padding:16px 0;","------->pr-ws: connect is close.",{key:t(this,c),url:t(this,s$1).url,e:A}),t(this,w)===!1)return this.reconnect(A);t(this,x).call(this),this.ws=void 0}),r(this,p$1,window.setTimeout(()=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is timeout.",{key:t(this,c),url:t(this,s$1).url}),F("connect is timeout.")},t(this,s$1).timeout))})),a$1(this,"reconnect",async B=>new Promise(async(F,A)=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.",{key:t(this,c),url:t(this,s$1).url});const D=i=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: reconnect is stop. ",{key:t(this,c),url:t(this,s$1).url,msg:i}),this.onReconnectStop({msg:i}),A(i)};if(t(this,g$2).call(this)===!1)return D("stop reconnect. exceed maxReconnectionTime.");if(t(this,l$1)!==-1&&t(this,l$1)===0)return D("stop reconnect. surplusReconnectCount is 0.");if(!await this.checkReconnect(B))return D("stop reconnect. checkReconnect is false.");t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,s$1).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,l$1)}`,{key:t(this,c)}),await new Promise(i=>setTimeout(()=>i(!0),t(this,s$1).reconnectIntervalTime)),r(this,l$1,Math.max(-1,t(this,l$1)-1)),await this.connect().then(this.onReconnectSuccess),F(this.ws)})),a$1(this,"sendMessage",async B=>{var F;(!this.ws||this.ws.readyState!==1)&&(t(this,s$1).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready.",{key:t(this,c),url:t(this,s$1).url}),t(this,s$1).autoConnect&&(t(this,s$1).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws auto connect.",{key:t(this,c),url:t(this,s$1).url}),await this.connect())),(F=this.ws)==null||F.send(B)}),a$1(this,"close",async(B=1e3,F="correctly close.")=>{var A;this.ws&&(r(this,w,!0),t(this,x).call(this),(A=this.ws)==null||A.close(B,F))}),h$1(this,g$2,()=>{const B=Date.now();return t(this,m$1)===-1&&r(this,m$1,B+t(this,s$1).reconnectTime),!(B>t(this,m$1))}),h$1(this,b,B=>{const{data:F}=B;this.onMessage(F)}),h$1(this,y$1,()=>{r(this,f,window.setInterval(()=>{const B=this.getHeartbeatMsg();B&&this.sendMessage(B)},t(this,s$1).heartbeatIntervalTime))}),h$1(this,x,()=>{clearInterval(t(this,f))}),r(this,s$1,{...t(this,s$1),...M}),r(this,l$1,t(this,s$1).reconnectCount)}}s$1=new WeakMap,c=new WeakMap,l$1=new WeakMap,m$1=new WeakMap,p$1=new WeakMap,f=new WeakMap,w=new WeakMap,g$2=new WeakMap,b=new WeakMap,y$1=new WeakMap,x=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=N;function N(M,B){for(var F=new Array(arguments.length-1),A=0,D=2,i=!0;D<arguments.length;)F[A++]=arguments[D++];return new Promise(function(C,U){F[A]=function(z){if(i)if(i=!1,z)U(z);else{for(var K=new Array(arguments.length-1),Y=0;Y<K.length;)K[Y++]=arguments[Y];C.apply(null,K)}};try{M.apply(B||null,F)}catch(j){i&&(i=!1,U(j))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,(function(N){var M=N;M.length=function(T){var C=T.length;if(!C)return 0;for(var U=0;--C%4>1&&T.charAt(C)==="=";)++U;return Math.ceil(T.length*3)/4-U};for(var B=new Array(64),F=new Array(123),A=0;A<64;)F[B[A]=A<26?A+65:A<52?A+71:A<62?A-4:A-59|43]=A++;M.encode=function(T,C,U){for(var j=null,z=[],K=0,Y=0,te;C<U;){var ae=T[C++];switch(Y){case 0:z[K++]=B[ae>>2],te=(ae&3)<<4,Y=1;break;case 1:z[K++]=B[te|ae>>4],te=(ae&15)<<2,Y=2;break;case 2:z[K++]=B[te|ae>>6],z[K++]=B[ae&63],Y=0;break}K>8191&&((j||(j=[])).push(String.fromCharCode.apply(String,z)),K=0)}return Y&&(z[K++]=B[te],z[K++]=61,Y===1&&(z[K++]=61)),j?(K&&j.push(String.fromCharCode.apply(String,z.slice(0,K))),j.join("")):String.fromCharCode.apply(String,z.slice(0,K))};var D="invalid encoding";M.decode=function(T,C,U){for(var j=U,z=0,K,Y=0;Y<T.length;){var te=T.charCodeAt(Y++);if(te===61&&z>1)break;if((te=F[te])===void 0)throw Error(D);switch(z){case 0:K=te,z=1;break;case 1:C[U++]=K<<2|(te&48)>>4,K=te,z=2;break;case 2:C[U++]=(K&15)<<4|(te&60)>>2,K=te,z=3;break;case 3:C[U++]=(K&3)<<6|te,z=0;break}}if(z===1)throw Error(D);return U-j},M.test=function(T){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(T)}})(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=N;function N(){this._listeners={}}return N.prototype.on=function(B,F,A){return(this._listeners[B]||(this._listeners[B]=[])).push({fn:F,ctx:A||this}),this},N.prototype.off=function(B,F){if(B===void 0)this._listeners={};else if(F===void 0)this._listeners[B]=[];else for(var A=this._listeners[B],D=0;D<A.length;)A[D].fn===F?A.splice(D,1):++D;return this},N.prototype.emit=function(B){var F=this._listeners[B];if(F){for(var A=[],D=1;D<arguments.length;)A.push(arguments[D++]);for(D=0;D<F.length;)F[D].fn.apply(F[D++].ctx,A)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=N(N);function N(D){return typeof Float32Array<"u"?(function(){var i=new Float32Array([-0]),T=new Uint8Array(i.buffer),C=T[3]===128;function U(Y,te,ae){i[0]=Y,te[ae]=T[0],te[ae+1]=T[1],te[ae+2]=T[2],te[ae+3]=T[3]}function j(Y,te,ae){i[0]=Y,te[ae]=T[3],te[ae+1]=T[2],te[ae+2]=T[1],te[ae+3]=T[0]}D.writeFloatLE=C?U:j,D.writeFloatBE=C?j:U;function z(Y,te){return T[0]=Y[te],T[1]=Y[te+1],T[2]=Y[te+2],T[3]=Y[te+3],i[0]}function K(Y,te){return T[3]=Y[te],T[2]=Y[te+1],T[1]=Y[te+2],T[0]=Y[te+3],i[0]}D.readFloatLE=C?z:K,D.readFloatBE=C?K:z})():(function(){function i(C,U,j,z){var K=U<0?1:0;if(K&&(U=-U),U===0)C(1/U>0?0:2147483648,j,z);else if(isNaN(U))C(2143289344,j,z);else if(U>34028234663852886e22)C((K<<31|2139095040)>>>0,j,z);else if(U<11754943508222875e-54)C((K<<31|Math.round(U/1401298464324817e-60))>>>0,j,z);else{var Y=Math.floor(Math.log(U)/Math.LN2),te=Math.round(U*Math.pow(2,-Y)*8388608)&8388607;C((K<<31|Y+127<<23|te)>>>0,j,z)}}D.writeFloatLE=i.bind(null,M),D.writeFloatBE=i.bind(null,B);function T(C,U,j){var z=C(U,j),K=(z>>31)*2+1,Y=z>>>23&255,te=z&8388607;return Y===255?te?NaN:K*(1/0):Y===0?K*1401298464324817e-60*te:K*Math.pow(2,Y-150)*(te+8388608)}D.readFloatLE=T.bind(null,F),D.readFloatBE=T.bind(null,A)})(),typeof Float64Array<"u"?(function(){var i=new Float64Array([-0]),T=new Uint8Array(i.buffer),C=T[7]===128;function U(Y,te,ae){i[0]=Y,te[ae]=T[0],te[ae+1]=T[1],te[ae+2]=T[2],te[ae+3]=T[3],te[ae+4]=T[4],te[ae+5]=T[5],te[ae+6]=T[6],te[ae+7]=T[7]}function j(Y,te,ae){i[0]=Y,te[ae]=T[7],te[ae+1]=T[6],te[ae+2]=T[5],te[ae+3]=T[4],te[ae+4]=T[3],te[ae+5]=T[2],te[ae+6]=T[1],te[ae+7]=T[0]}D.writeDoubleLE=C?U:j,D.writeDoubleBE=C?j:U;function z(Y,te){return T[0]=Y[te],T[1]=Y[te+1],T[2]=Y[te+2],T[3]=Y[te+3],T[4]=Y[te+4],T[5]=Y[te+5],T[6]=Y[te+6],T[7]=Y[te+7],i[0]}function K(Y,te){return T[7]=Y[te],T[6]=Y[te+1],T[5]=Y[te+2],T[4]=Y[te+3],T[3]=Y[te+4],T[2]=Y[te+5],T[1]=Y[te+6],T[0]=Y[te+7],i[0]}D.readDoubleLE=C?z:K,D.readDoubleBE=C?K:z})():(function(){function i(C,U,j,z,K,Y){var te=z<0?1:0;if(te&&(z=-z),z===0)C(0,K,Y+U),C(1/z>0?0:2147483648,K,Y+j);else if(isNaN(z))C(0,K,Y+U),C(2146959360,K,Y+j);else if(z>17976931348623157e292)C(0,K,Y+U),C((te<<31|2146435072)>>>0,K,Y+j);else{var ae;if(z<22250738585072014e-324)ae=z/5e-324,C(ae>>>0,K,Y+U),C((te<<31|ae/4294967296)>>>0,K,Y+j);else{var se=Math.floor(Math.log(z)/Math.LN2);se===1024&&(se=1023),ae=z*Math.pow(2,-se),C(ae*4503599627370496>>>0,K,Y+U),C((te<<31|se+1023<<20|ae*1048576&1048575)>>>0,K,Y+j)}}}D.writeDoubleLE=i.bind(null,M,0,4),D.writeDoubleBE=i.bind(null,B,4,0);function T(C,U,j,z,K){var Y=C(z,K+U),te=C(z,K+j),ae=(te>>31)*2+1,se=te>>>20&2047,oe=4294967296*(te&1048575)+Y;return se===2047?oe?NaN:ae*(1/0):se===0?ae*5e-324*oe:ae*Math.pow(2,se-1075)*(oe+4503599627370496)}D.readDoubleLE=T.bind(null,F,0,4),D.readDoubleBE=T.bind(null,A,4,0)})(),D}function M(D,i,T){i[T]=D&255,i[T+1]=D>>>8&255,i[T+2]=D>>>16&255,i[T+3]=D>>>24}function B(D,i,T){i[T]=D>>>24,i[T+1]=D>>>16&255,i[T+2]=D>>>8&255,i[T+3]=D&255}function F(D,i){return(D[i]|D[i+1]<<8|D[i+2]<<16|D[i+3]<<24)>>>0}function A(D,i){return(D[i]<<24|D[i+1]<<16|D[i+2]<<8|D[i+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(N){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(function(N){var M=N;M.length=function(F){for(var A=0,D=0,i=0;i<F.length;++i)D=F.charCodeAt(i),D<128?A+=1:D<2048?A+=2:(D&64512)===55296&&(F.charCodeAt(i+1)&64512)===56320?(++i,A+=4):A+=3;return A},M.read=function(F,A,D){var i=D-A;if(i<1)return"";for(var T=null,C=[],U=0,j;A<D;)j=F[A++],j<128?C[U++]=j:j>191&&j<224?C[U++]=(j&31)<<6|F[A++]&63:j>239&&j<365?(j=((j&7)<<18|(F[A++]&63)<<12|(F[A++]&63)<<6|F[A++]&63)-65536,C[U++]=55296+(j>>10),C[U++]=56320+(j&1023)):C[U++]=(j&15)<<12|(F[A++]&63)<<6|F[A++]&63,U>8191&&((T||(T=[])).push(String.fromCharCode.apply(String,C)),U=0);return T?(U&&T.push(String.fromCharCode.apply(String,C.slice(0,U))),T.join("")):String.fromCharCode.apply(String,C.slice(0,U))},M.write=function(F,A,D){for(var i=D,T,C,U=0;U<F.length;++U)T=F.charCodeAt(U),T<128?A[D++]=T:T<2048?(A[D++]=T>>6|192,A[D++]=T&63|128):(T&64512)===55296&&((C=F.charCodeAt(U+1))&64512)===56320?(T=65536+((T&1023)<<10)+(C&1023),++U,A[D++]=T>>18|240,A[D++]=T>>12&63|128,A[D++]=T>>6&63|128,A[D++]=T&63|128):(A[D++]=T>>12|224,A[D++]=T>>6&63|128,A[D++]=T&63|128);return D-i}})(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=N;function N(M,B,F){var A=F||8192,D=A>>>1,i=null,T=A;return function(U){if(U<1||U>D)return M(U);T+U>A&&(i=M(A),T=0);var j=B.call(i,T,T+=U);return T&7&&(T=(T|7)+1),j}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=M;var N=requireMinimal$1();function M(D,i){this.lo=D>>>0,this.hi=i>>>0}var B=M.zero=new M(0,0);B.toNumber=function(){return 0},B.zzEncode=B.zzDecode=function(){return this},B.length=function(){return 1};var F=M.zeroHash="\0\0\0\0\0\0\0\0";M.fromNumber=function(i){if(i===0)return B;var T=i<0;T&&(i=-i);var C=i>>>0,U=(i-C)/4294967296>>>0;return T&&(U=~U>>>0,C=~C>>>0,++C>4294967295&&(C=0,++U>4294967295&&(U=0))),new M(C,U)},M.from=function(i){if(typeof i=="number")return M.fromNumber(i);if(N.isString(i))if(N.Long)i=N.Long.fromString(i);else return M.fromNumber(parseInt(i,10));return i.low||i.high?new M(i.low>>>0,i.high>>>0):B},M.prototype.toNumber=function(i){if(!i&&this.hi>>>31){var T=~this.lo+1>>>0,C=~this.hi>>>0;return T||(C=C+1>>>0),-(T+C*4294967296)}return this.lo+this.hi*4294967296},M.prototype.toLong=function(i){return N.Long?new N.Long(this.lo|0,this.hi|0,!!i):{low:this.lo|0,high:this.hi|0,unsigned:!!i}};var A=String.prototype.charCodeAt;return M.fromHash=function(i){return i===F?B:new M((A.call(i,0)|A.call(i,1)<<8|A.call(i,2)<<16|A.call(i,3)<<24)>>>0,(A.call(i,4)|A.call(i,5)<<8|A.call(i,6)<<16|A.call(i,7)<<24)>>>0)},M.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},M.prototype.zzEncode=function(){var i=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^i)>>>0,this.lo=(this.lo<<1^i)>>>0,this},M.prototype.zzDecode=function(){var i=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^i)>>>0,this.hi=(this.hi>>>1^i)>>>0,this},M.prototype.length=function(){var i=this.lo,T=(this.lo>>>28|this.hi<<4)>>>0,C=this.hi>>>24;return C===0?T===0?i<16384?i<128?1:2:i<2097152?3:4:T<16384?T<128?5:6:T<2097152?7:8:C<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,(function(N){var M=N;M.asPromise=requireAspromise(),M.base64=requireBase64(),M.EventEmitter=requireEventemitter(),M.float=requireFloat(),M.inquire=requireInquire(),M.utf8=requireUtf8(),M.pool=requirePool(),M.LongBits=requireLongbits(),M.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),M.global=M.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,M.emptyArray=Object.freeze?Object.freeze([]):[],M.emptyObject=Object.freeze?Object.freeze({}):{},M.isInteger=Number.isInteger||function(D){return typeof D=="number"&&isFinite(D)&&Math.floor(D)===D},M.isString=function(D){return typeof D=="string"||D instanceof String},M.isObject=function(D){return D&&typeof D=="object"},M.isset=M.isSet=function(D,i){var T=D[i];return T!=null&&D.hasOwnProperty(i)?typeof T!="object"||(Array.isArray(T)?T.length:Object.keys(T).length)>0:!1},M.Buffer=(function(){try{var A=M.inquire("buffer").Buffer;return A.prototype.utf8Write?A:null}catch{return null}})(),M._Buffer_from=null,M._Buffer_allocUnsafe=null,M.newBuffer=function(D){return typeof D=="number"?M.Buffer?M._Buffer_allocUnsafe(D):new M.Array(D):M.Buffer?M._Buffer_from(D):typeof Uint8Array>"u"?D:new Uint8Array(D)},M.Array=typeof Uint8Array<"u"?Uint8Array:Array,M.Long=M.global.dcodeIO&&M.global.dcodeIO.Long||M.global.Long||M.inquire("long"),M.key2Re=/^true|false|0|1$/,M.key32Re=/^-?(?:0|[1-9][0-9]*)$/,M.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,M.longToHash=function(D){return D?M.LongBits.from(D).toHash():M.LongBits.zeroHash},M.longFromHash=function(D,i){var T=M.LongBits.fromHash(D);return M.Long?M.Long.fromBits(T.lo,T.hi,i):T.toNumber(!!i)};function B(A,D,i){for(var T=Object.keys(D),C=0;C<T.length;++C)(A[T[C]]===void 0||!i)&&(A[T[C]]=D[T[C]]);return A}M.merge=B,M.lcFirst=function(D){return D.charAt(0).toLowerCase()+D.substring(1)};function F(A){function D(i,T){if(!(this instanceof D))return new D(i,T);Object.defineProperty(this,"message",{get:function(){return i}}),Error.captureStackTrace?Error.captureStackTrace(this,D):Object.defineProperty(this,"stack",{value:new Error().stack||""}),T&&B(this,T)}return D.prototype=Object.create(Error.prototype,{constructor:{value:D,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return A},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),D}M.newError=F,M.ProtocolError=F("ProtocolError"),M.oneOfGetter=function(D){for(var i={},T=0;T<D.length;++T)i[D[T]]=1;return function(){for(var C=Object.keys(this),U=C.length-1;U>-1;--U)if(i[C[U]]===1&&this[C[U]]!==void 0&&this[C[U]]!==null)return C[U]}},M.oneOfSetter=function(D){return function(i){for(var T=0;T<D.length;++T)D[T]!==i&&delete this[D[T]]}},M.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},M._configure=function(){var A=M.Buffer;if(!A){M._Buffer_from=M._Buffer_allocUnsafe=null;return}M._Buffer_from=A.from!==Uint8Array.from&&A.from||function(i,T){return new A(i,T)},M._Buffer_allocUnsafe=A.allocUnsafe||function(i){return new A(i)}}})(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=C;var N=requireMinimal$1(),M,B=N.LongBits,F=N.base64,A=N.utf8;function D(se,oe,he){this.fn=se,this.len=oe,this.next=void 0,this.val=he}function i(){}function T(se){this.head=se.head,this.tail=se.tail,this.len=se.len,this.next=se.states}function C(){this.len=0,this.head=new D(i,0,0),this.tail=this.head,this.states=null}var U=function(){return N.Buffer?function(){return(C.create=function(){return new M})()}:function(){return new C}};C.create=U(),C.alloc=function(oe){return new N.Array(oe)},N.Array!==Array&&(C.alloc=N.pool(C.alloc,N.Array.prototype.subarray)),C.prototype._push=function(oe,he,ke){return this.tail=this.tail.next=new D(oe,he,ke),this.len+=he,this};function j(se,oe,he){oe[he]=se&255}function z(se,oe,he){for(;se>127;)oe[he++]=se&127|128,se>>>=7;oe[he]=se}function K(se,oe){this.len=se,this.next=void 0,this.val=oe}K.prototype=Object.create(D.prototype),K.prototype.fn=z,C.prototype.uint32=function(oe){return this.len+=(this.tail=this.tail.next=new K((oe=oe>>>0)<128?1:oe<16384?2:oe<2097152?3:oe<268435456?4:5,oe)).len,this},C.prototype.int32=function(oe){return oe<0?this._push(Y,10,B.fromNumber(oe)):this.uint32(oe)},C.prototype.sint32=function(oe){return this.uint32((oe<<1^oe>>31)>>>0)};function Y(se,oe,he){for(;se.hi;)oe[he++]=se.lo&127|128,se.lo=(se.lo>>>7|se.hi<<25)>>>0,se.hi>>>=7;for(;se.lo>127;)oe[he++]=se.lo&127|128,se.lo=se.lo>>>7;oe[he++]=se.lo}C.prototype.uint64=function(oe){var he=B.from(oe);return this._push(Y,he.length(),he)},C.prototype.int64=C.prototype.uint64,C.prototype.sint64=function(oe){var he=B.from(oe).zzEncode();return this._push(Y,he.length(),he)},C.prototype.bool=function(oe){return this._push(j,1,oe?1:0)};function te(se,oe,he){oe[he]=se&255,oe[he+1]=se>>>8&255,oe[he+2]=se>>>16&255,oe[he+3]=se>>>24}C.prototype.fixed32=function(oe){return this._push(te,4,oe>>>0)},C.prototype.sfixed32=C.prototype.fixed32,C.prototype.fixed64=function(oe){var he=B.from(oe);return this._push(te,4,he.lo)._push(te,4,he.hi)},C.prototype.sfixed64=C.prototype.fixed64,C.prototype.float=function(oe){return this._push(N.float.writeFloatLE,4,oe)},C.prototype.double=function(oe){return this._push(N.float.writeDoubleLE,8,oe)};var ae=N.Array.prototype.set?function(oe,he,ke){he.set(oe,ke)}:function(oe,he,ke){for(var ie=0;ie<oe.length;++ie)he[ke+ie]=oe[ie]};return C.prototype.bytes=function(oe){var he=oe.length>>>0;if(!he)return this._push(j,1,0);if(N.isString(oe)){var ke=C.alloc(he=F.length(oe));F.decode(oe,ke,0),oe=ke}return this.uint32(he)._push(ae,he,oe)},C.prototype.string=function(oe){var he=A.length(oe);return he?this.uint32(he)._push(A.write,he,oe):this._push(j,1,0)},C.prototype.fork=function(){return this.states=new T(this),this.head=this.tail=new D(i,0,0),this.len=0,this},C.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new D(i,0,0),this.len=0),this},C.prototype.ldelim=function(){var oe=this.head,he=this.tail,ke=this.len;return this.reset().uint32(ke),ke&&(this.tail.next=oe.next,this.tail=he,this.len+=ke),this},C.prototype.finish=function(){for(var oe=this.head.next,he=this.constructor.alloc(this.len),ke=0;oe;)oe.fn(oe.val,he,ke),ke+=oe.len,oe=oe.next;return he},C._configure=function(se){M=se,C.create=U(),M._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=B;var N=requireWriter();(B.prototype=Object.create(N.prototype)).constructor=B;var M=requireMinimal$1();function B(){N.call(this)}B._configure=function(){B.alloc=M._Buffer_allocUnsafe,B.writeBytesBuffer=M.Buffer&&M.Buffer.prototype instanceof Uint8Array&&M.Buffer.prototype.set.name==="set"?function(D,i,T){i.set(D,T)}:function(D,i,T){if(D.copy)D.copy(i,T,0,D.length);else for(var C=0;C<D.length;)i[T++]=D[C++]}},B.prototype.bytes=function(D){M.isString(D)&&(D=M._Buffer_from(D,"base64"));var i=D.length>>>0;return this.uint32(i),i&&this._push(B.writeBytesBuffer,i,D),this};function F(A,D,i){A.length<40?M.utf8.write(A,D,i):D.utf8Write?D.utf8Write(A,i):D.write(A,i)}return B.prototype.string=function(D){var i=M.Buffer.byteLength(D);return this.uint32(i),i&&this._push(F,i,D),this},B._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=D;var N=requireMinimal$1(),M,B=N.LongBits,F=N.utf8;function A(z,K){return RangeError("index out of range: "+z.pos+" + "+(K||1)+" > "+z.len)}function D(z){this.buf=z,this.pos=0,this.len=z.length}var i=typeof Uint8Array<"u"?function(K){if(K instanceof Uint8Array||Array.isArray(K))return new D(K);throw Error("illegal buffer")}:function(K){if(Array.isArray(K))return new D(K);throw Error("illegal buffer")},T=function(){return N.Buffer?function(Y){return(D.create=function(ae){return N.Buffer.isBuffer(ae)?new M(ae):i(ae)})(Y)}:i};D.create=T(),D.prototype._slice=N.Array.prototype.subarray||N.Array.prototype.slice,D.prototype.uint32=(function(){var K=4294967295;return function(){if(K=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(K=(K|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return K;if((this.pos+=5)>this.len)throw this.pos=this.len,A(this,10);return K}})(),D.prototype.int32=function(){return this.uint32()|0},D.prototype.sint32=function(){var K=this.uint32();return K>>>1^-(K&1)|0};function C(){var z=new B(0,0),K=0;if(this.len-this.pos>4){for(;K<4;++K)if(z.lo=(z.lo|(this.buf[this.pos]&127)<<K*7)>>>0,this.buf[this.pos++]<128)return z;if(z.lo=(z.lo|(this.buf[this.pos]&127)<<28)>>>0,z.hi=(z.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return z;K=0}else{for(;K<3;++K){if(this.pos>=this.len)throw A(this);if(z.lo=(z.lo|(this.buf[this.pos]&127)<<K*7)>>>0,this.buf[this.pos++]<128)return z}return z.lo=(z.lo|(this.buf[this.pos++]&127)<<K*7)>>>0,z}if(this.len-this.pos>4){for(;K<5;++K)if(z.hi=(z.hi|(this.buf[this.pos]&127)<<K*7+3)>>>0,this.buf[this.pos++]<128)return z}else for(;K<5;++K){if(this.pos>=this.len)throw A(this);if(z.hi=(z.hi|(this.buf[this.pos]&127)<<K*7+3)>>>0,this.buf[this.pos++]<128)return z}throw Error("invalid varint encoding")}D.prototype.bool=function(){return this.uint32()!==0};function U(z,K){return(z[K-4]|z[K-3]<<8|z[K-2]<<16|z[K-1]<<24)>>>0}D.prototype.fixed32=function(){if(this.pos+4>this.len)throw A(this,4);return U(this.buf,this.pos+=4)},D.prototype.sfixed32=function(){if(this.pos+4>this.len)throw A(this,4);return U(this.buf,this.pos+=4)|0};function j(){if(this.pos+8>this.len)throw A(this,8);return new B(U(this.buf,this.pos+=4),U(this.buf,this.pos+=4))}return D.prototype.float=function(){if(this.pos+4>this.len)throw A(this,4);var K=N.float.readFloatLE(this.buf,this.pos);return this.pos+=4,K},D.prototype.double=function(){if(this.pos+8>this.len)throw A(this,4);var K=N.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,K},D.prototype.bytes=function(){var K=this.uint32(),Y=this.pos,te=this.pos+K;if(te>this.len)throw A(this,K);if(this.pos+=K,Array.isArray(this.buf))return this.buf.slice(Y,te);if(Y===te){var ae=N.Buffer;return ae?ae.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,Y,te)},D.prototype.string=function(){var K=this.bytes();return F.read(K,0,K.length)},D.prototype.skip=function(K){if(typeof K=="number"){if(this.pos+K>this.len)throw A(this,K);this.pos+=K}else do if(this.pos>=this.len)throw A(this);while(this.buf[this.pos++]&128);return this},D.prototype.skipType=function(z){switch(z){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(z=this.uint32()&7)!==4;)this.skipType(z);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+z+" at offset "+this.pos)}return this},D._configure=function(z){M=z,D.create=T(),M._configure();var K=N.Long?"toLong":"toNumber";N.merge(D.prototype,{int64:function(){return C.call(this)[K](!1)},uint64:function(){return C.call(this)[K](!0)},sint64:function(){return C.call(this).zzDecode()[K](!1)},fixed64:function(){return j.call(this)[K](!0)},sfixed64:function(){return j.call(this)[K](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=B;var N=requireReader();(B.prototype=Object.create(N.prototype)).constructor=B;var M=requireMinimal$1();function B(F){N.call(this,F)}return B._configure=function(){M.Buffer&&(B.prototype._slice=M.Buffer.prototype.slice)},B.prototype.string=function(){var A=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+A,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+A,this.len))},B._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=M;var N=requireMinimal$1();(M.prototype=Object.create(N.EventEmitter.prototype)).constructor=M;function M(B,F,A){if(typeof B!="function")throw TypeError("rpcImpl must be a function");N.EventEmitter.call(this),this.rpcImpl=B,this.requestDelimited=!!F,this.responseDelimited=!!A}return M.prototype.rpcCall=function B(F,A,D,i,T){if(!i)throw TypeError("request must be specified");var C=this;if(!T)return N.asPromise(B,C,F,A,D,i);if(!C.rpcImpl){setTimeout(function(){T(Error("already ended"))},0);return}try{return C.rpcImpl(F,A[C.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(j,z){if(j)return C.emit("error",j,F),T(j);if(z===null){C.end(!0);return}if(!(z instanceof D))try{z=D[C.responseDelimited?"decodeDelimited":"decode"](z)}catch(K){return C.emit("error",K,F),T(K)}return C.emit("data",z,F),T(null,z)})}catch(U){C.emit("error",U,F),setTimeout(function(){T(U)},0);return}},M.prototype.end=function(F){return this.rpcImpl&&(F||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,(function(N){var M=N;M.Service=requireService()})(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,(function(N){var M=N;M.build="minimal",M.Writer=requireWriter(),M.BufferWriter=requireWriter_buffer(),M.Reader=requireReader(),M.BufferReader=requireReader_buffer(),M.util=requireMinimal$1(),M.rpc=requireRpc(),M.roots=requireRoots(),M.configure=B;function B(){M.util._configure(),M.Writer._configure(M.BufferWriter),M.Reader._configure(M.BufferReader)}B()})(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$Writer=minimalExports.Writer,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const N={};return N.quick=(function(){const M={};return M.voice=(function(){const B={};return B.proto=(function(){const F={};return F.CommonReq=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.event="",A.prototype.data=$util.newBuffer([]),A.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,A.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,A.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,A.prototype.version=0,A.prototype.compress=!1,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&T.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&T.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&T.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&T.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&T.uint32(40).int64(i.valid),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&T.uint32(48).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&T.uint32(56).bool(i.compress),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CommonReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.event=i.string();break}case 2:{j.data=i.bytes();break}case 3:{j.sn=i.int64();break}case 4:{j.time=i.int64();break}case 5:{j.valid=i.int64();break}case 6:{j.version=i.int32();break}case 7:{j.compress=i.bool();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonReq)return i;let T=new $root.com.quick.voice.proto.CommonReq;return i.event!=null&&(T.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,T.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(T.data=i.data)),i.sn!=null&&($util.Long?(T.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?T.sn=parseInt(i.sn,10):typeof i.sn=="number"?T.sn=i.sn:typeof i.sn=="object"&&(T.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(T.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?T.time=parseInt(i.time,10):typeof i.time=="number"?T.time=i.time:typeof i.time=="object"&&(T.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(T.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?T.valid=parseInt(i.valid,10):typeof i.valid=="number"?T.valid=i.valid:typeof i.valid=="object"&&(T.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.version!=null&&(T.version=i.version|0),i.compress!=null&&(T.compress=!!i.compress),T},A.toObject=function(i,T){T||(T={});let C={};if(T.defaults){if(C.event="",T.bytes===String?C.data="":(C.data=[],T.bytes!==Array&&(C.data=$util.newBuffer(C.data))),$util.Long){let U=new $util.Long(0,0,!1);C.sn=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else C.sn=T.longs===String?"0":0;if($util.Long){let U=new $util.Long(0,0,!1);C.time=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else C.time=T.longs===String?"0":0;if($util.Long){let U=new $util.Long(0,0,!1);C.valid=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else C.valid=T.longs===String?"0":0;C.version=0,C.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&(C.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&(C.data=T.bytes===String?$util.base64.encode(i.data,0,i.data.length):T.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?C.sn=T.longs===String?String(i.sn):i.sn:C.sn=T.longs===String?$util.Long.prototype.toString.call(i.sn):T.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?C.time=T.longs===String?String(i.time):i.time:C.time=T.longs===String?$util.Long.prototype.toString.call(i.time):T.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?C.valid=T.longs===String?String(i.valid):i.valid:C.valid=T.longs===String?$util.Long.prototype.toString.call(i.valid):T.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.version!=null&&i.hasOwnProperty("version")&&(C.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&(C.compress=i.compress),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonReq"},A})(),F.CommonRsp=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.event="",A.prototype.data=$util.newBuffer([]),A.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,A.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,A.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,A.prototype.code=0,A.prototype.desc="",A.prototype.version=0,A.prototype.compress=!1,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&T.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&T.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&T.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&T.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&T.uint32(40).int64(i.valid),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&T.uint32(48).int32(i.code),i.desc!=null&&Object.hasOwnProperty.call(i,"desc")&&T.uint32(58).string(i.desc),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&T.uint32(64).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&T.uint32(72).bool(i.compress),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CommonRsp;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.event=i.string();break}case 2:{j.data=i.bytes();break}case 3:{j.sn=i.int64();break}case 4:{j.time=i.int64();break}case 5:{j.valid=i.int64();break}case 6:{j.code=i.int32();break}case 7:{j.desc=i.string();break}case 8:{j.version=i.int32();break}case 9:{j.compress=i.bool();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.code!=null&&i.hasOwnProperty("code")&&!$util.isInteger(i.code)?"code: integer expected":i.desc!=null&&i.hasOwnProperty("desc")&&!$util.isString(i.desc)?"desc: string expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonRsp)return i;let T=new $root.com.quick.voice.proto.CommonRsp;return i.event!=null&&(T.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,T.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(T.data=i.data)),i.sn!=null&&($util.Long?(T.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?T.sn=parseInt(i.sn,10):typeof i.sn=="number"?T.sn=i.sn:typeof i.sn=="object"&&(T.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(T.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?T.time=parseInt(i.time,10):typeof i.time=="number"?T.time=i.time:typeof i.time=="object"&&(T.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(T.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?T.valid=parseInt(i.valid,10):typeof i.valid=="number"?T.valid=i.valid:typeof i.valid=="object"&&(T.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.code!=null&&(T.code=i.code|0),i.desc!=null&&(T.desc=String(i.desc)),i.version!=null&&(T.version=i.version|0),i.compress!=null&&(T.compress=!!i.compress),T},A.toObject=function(i,T){T||(T={});let C={};if(T.defaults){if(C.event="",T.bytes===String?C.data="":(C.data=[],T.bytes!==Array&&(C.data=$util.newBuffer(C.data))),$util.Long){let U=new $util.Long(0,0,!1);C.sn=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else C.sn=T.longs===String?"0":0;if($util.Long){let U=new $util.Long(0,0,!1);C.time=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else C.time=T.longs===String?"0":0;if($util.Long){let U=new $util.Long(0,0,!1);C.valid=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else C.valid=T.longs===String?"0":0;C.code=0,C.desc="",C.version=0,C.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&(C.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&(C.data=T.bytes===String?$util.base64.encode(i.data,0,i.data.length):T.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?C.sn=T.longs===String?String(i.sn):i.sn:C.sn=T.longs===String?$util.Long.prototype.toString.call(i.sn):T.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?C.time=T.longs===String?String(i.time):i.time:C.time=T.longs===String?$util.Long.prototype.toString.call(i.time):T.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?C.valid=T.longs===String?String(i.valid):i.valid:C.valid=T.longs===String?$util.Long.prototype.toString.call(i.valid):T.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.code!=null&&i.hasOwnProperty("code")&&(C.code=i.code),i.desc!=null&&i.hasOwnProperty("desc")&&(C.desc=i.desc),i.version!=null&&i.hasOwnProperty("version")&&(C.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&(C.compress=i.compress),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonRsp"},A})(),F.User=(function(){function A(i){if(this.tracks=[],i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.id="",A.prototype.callAction=null,A.prototype.callState=null,A.prototype.joinTime=null,A.prototype.tracks=$util.emptyArray,A.prototype.permissions=null,A.prototype.isPublished=null,A.prototype.behavior=null,A.prototype.channelCache=null;let D;return Object.defineProperty(A.prototype,"_callAction",{get:$util.oneOfGetter(D=["callAction"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_callState",{get:$util.oneOfGetter(D=["callState"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_joinTime",{get:$util.oneOfGetter(D=["joinTime"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_permissions",{get:$util.oneOfGetter(D=["permissions"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_isPublished",{get:$util.oneOfGetter(D=["isPublished"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_behavior",{get:$util.oneOfGetter(D=["behavior"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_channelCache",{get:$util.oneOfGetter(D=["channelCache"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){if(C||(C=$Writer.create()),T.id!=null&&Object.hasOwnProperty.call(T,"id")&&C.uint32(10).string(T.id),T.callAction!=null&&Object.hasOwnProperty.call(T,"callAction")&&C.uint32(16).int32(T.callAction),T.callState!=null&&Object.hasOwnProperty.call(T,"callState")&&C.uint32(24).int32(T.callState),T.joinTime!=null&&Object.hasOwnProperty.call(T,"joinTime")&&C.uint32(32).int64(T.joinTime),T.tracks!=null&&T.tracks.length)for(let U=0;U<T.tracks.length;++U)$root.com.quick.voice.proto.Track.encode(T.tracks[U],C.uint32(42).fork()).ldelim();return T.permissions!=null&&Object.hasOwnProperty.call(T,"permissions")&&C.uint32(48).int32(T.permissions),T.isPublished!=null&&Object.hasOwnProperty.call(T,"isPublished")&&C.uint32(56).bool(T.isPublished),T.behavior!=null&&Object.hasOwnProperty.call(T,"behavior")&&C.uint32(64).int32(T.behavior),T.channelCache!=null&&Object.hasOwnProperty.call(T,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(T.channelCache,C.uint32(74).fork()).ldelim(),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.User;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.id=T.string();break}case 2:{z.callAction=T.int32();break}case 3:{z.callState=T.int32();break}case 4:{z.joinTime=T.int64();break}case 5:{z.tracks&&z.tracks.length||(z.tracks=[]),z.tracks.push($root.com.quick.voice.proto.Track.decode(T,T.uint32()));break}case 6:{z.permissions=T.int32();break}case 7:{z.isPublished=T.bool();break}case 8:{z.behavior=T.int32();break}case 9:{z.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(T,T.uint32());break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.id!=null&&T.hasOwnProperty("id")&&!$util.isString(T.id))return"id: string expected";if(T.callAction!=null&&T.hasOwnProperty("callAction")&&!$util.isInteger(T.callAction))return"callAction: integer expected";if(T.callState!=null&&T.hasOwnProperty("callState")&&!$util.isInteger(T.callState))return"callState: integer expected";if(T.joinTime!=null&&T.hasOwnProperty("joinTime")&&!$util.isInteger(T.joinTime)&&!(T.joinTime&&$util.isInteger(T.joinTime.low)&&$util.isInteger(T.joinTime.high)))return"joinTime: integer|Long expected";if(T.tracks!=null&&T.hasOwnProperty("tracks")){if(!Array.isArray(T.tracks))return"tracks: array expected";for(let C=0;C<T.tracks.length;++C){let U=$root.com.quick.voice.proto.Track.verify(T.tracks[C]);if(U)return"tracks."+U}}if(T.permissions!=null&&T.hasOwnProperty("permissions")&&!$util.isInteger(T.permissions))return"permissions: integer expected";if(T.isPublished!=null&&T.hasOwnProperty("isPublished")&&typeof T.isPublished!="boolean")return"isPublished: boolean expected";if(T.behavior!=null&&T.hasOwnProperty("behavior")&&!$util.isInteger(T.behavior))return"behavior: integer expected";if(T.channelCache!=null&&T.hasOwnProperty("channelCache")){let C=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(T.channelCache);if(C)return"channelCache."+C}return null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.User)return T;let C=new $root.com.quick.voice.proto.User;if(T.id!=null&&(C.id=String(T.id)),T.callAction!=null&&(C.callAction=T.callAction|0),T.callState!=null&&(C.callState=T.callState|0),T.joinTime!=null&&($util.Long?(C.joinTime=$util.Long.fromValue(T.joinTime)).unsigned=!1:typeof T.joinTime=="string"?C.joinTime=parseInt(T.joinTime,10):typeof T.joinTime=="number"?C.joinTime=T.joinTime:typeof T.joinTime=="object"&&(C.joinTime=new $util.LongBits(T.joinTime.low>>>0,T.joinTime.high>>>0).toNumber())),T.tracks){if(!Array.isArray(T.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");C.tracks=[];for(let U=0;U<T.tracks.length;++U){if(typeof T.tracks[U]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");C.tracks[U]=$root.com.quick.voice.proto.Track.fromObject(T.tracks[U])}}if(T.permissions!=null&&(C.permissions=T.permissions|0),T.isPublished!=null&&(C.isPublished=!!T.isPublished),T.behavior!=null&&(C.behavior=T.behavior|0),T.channelCache!=null){if(typeof T.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");C.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(T.channelCache)}return C},A.toObject=function(T,C){C||(C={});let U={};if((C.arrays||C.defaults)&&(U.tracks=[]),C.defaults&&(U.id=""),T.id!=null&&T.hasOwnProperty("id")&&(U.id=T.id),T.callAction!=null&&T.hasOwnProperty("callAction")&&(U.callAction=T.callAction,C.oneofs&&(U._callAction="callAction")),T.callState!=null&&T.hasOwnProperty("callState")&&(U.callState=T.callState,C.oneofs&&(U._callState="callState")),T.joinTime!=null&&T.hasOwnProperty("joinTime")&&(typeof T.joinTime=="number"?U.joinTime=C.longs===String?String(T.joinTime):T.joinTime:U.joinTime=C.longs===String?$util.Long.prototype.toString.call(T.joinTime):C.longs===Number?new $util.LongBits(T.joinTime.low>>>0,T.joinTime.high>>>0).toNumber():T.joinTime,C.oneofs&&(U._joinTime="joinTime")),T.tracks&&T.tracks.length){U.tracks=[];for(let j=0;j<T.tracks.length;++j)U.tracks[j]=$root.com.quick.voice.proto.Track.toObject(T.tracks[j],C)}return T.permissions!=null&&T.hasOwnProperty("permissions")&&(U.permissions=T.permissions,C.oneofs&&(U._permissions="permissions")),T.isPublished!=null&&T.hasOwnProperty("isPublished")&&(U.isPublished=T.isPublished,C.oneofs&&(U._isPublished="isPublished")),T.behavior!=null&&T.hasOwnProperty("behavior")&&(U.behavior=T.behavior,C.oneofs&&(U._behavior="behavior")),T.channelCache!=null&&T.hasOwnProperty("channelCache")&&(U.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(T.channelCache,C),C.oneofs&&(U._channelCache="channelCache")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.User"},A})(),F.DataChannelCacheInfo=(function(){function A(D){if(this.channels=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.channels=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.channels!=null&&i.channels.length)for(let C=0;C<i.channels.length;++C)$root.com.quick.voice.proto.DataChannel.encode(i.channels[C],T.uint32(10).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.channels&&j.channels.length||(j.channels=[]),j.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let T=0;T<i.channels.length;++T){let C=$root.com.quick.voice.proto.DataChannel.verify(i.channels[T]);if(C)return"channels."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return i;let T=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");T.channels=[];for(let C=0;C<i.channels.length;++C){if(typeof i.channels[C]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");T.channels[C]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.channels=[]),i.channels&&i.channels.length){C.channels=[];for(let U=0;U<i.channels.length;++U)C.channels[U]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelCacheInfo"},A})(),F.DataChannel=(function(){function A(i){if(i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.dataChannelName="",A.prototype.id=null;let D;return Object.defineProperty(A.prototype,"_id",{get:$util.oneOfGetter(D=["id"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){return C||(C=$Writer.create()),T.dataChannelName!=null&&Object.hasOwnProperty.call(T,"dataChannelName")&&C.uint32(10).string(T.dataChannelName),T.id!=null&&Object.hasOwnProperty.call(T,"id")&&C.uint32(16).int32(T.id),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.DataChannel;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.dataChannelName=T.string();break}case 2:{z.id=T.int32();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){return typeof T!="object"||T===null?"object expected":T.dataChannelName!=null&&T.hasOwnProperty("dataChannelName")&&!$util.isString(T.dataChannelName)?"dataChannelName: string expected":T.id!=null&&T.hasOwnProperty("id")&&!$util.isInteger(T.id)?"id: integer expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.DataChannel)return T;let C=new $root.com.quick.voice.proto.DataChannel;return T.dataChannelName!=null&&(C.dataChannelName=String(T.dataChannelName)),T.id!=null&&(C.id=T.id|0),C},A.toObject=function(T,C){C||(C={});let U={};return C.defaults&&(U.dataChannelName=""),T.dataChannelName!=null&&T.hasOwnProperty("dataChannelName")&&(U.dataChannelName=T.dataChannelName),T.id!=null&&T.hasOwnProperty("id")&&(U.id=T.id,C.oneofs&&(U._id="id")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.DataChannel"},A})(),F.Login=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.appid="",A.prototype.userId="",A.prototype.sdkToken="",A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.appid!=null&&Object.hasOwnProperty.call(i,"appid")&&T.uint32(10).string(i.appid),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(18).string(i.userId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&T.uint32(26).string(i.sdkToken),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.Login;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.appid=i.string();break}case 2:{j.userId=i.string();break}case 3:{j.sdkToken=i.string();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.appid!=null&&i.hasOwnProperty("appid")&&!$util.isString(i.appid)?"appid: string expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Login)return i;let T=new $root.com.quick.voice.proto.Login;return i.appid!=null&&(T.appid=String(i.appid)),i.userId!=null&&(T.userId=String(i.userId)),i.sdkToken!=null&&(T.sdkToken=String(i.sdkToken)),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.appid="",C.userId="",C.sdkToken=""),i.appid!=null&&i.hasOwnProperty("appid")&&(C.appid=i.appid),i.userId!=null&&i.hasOwnProperty("userId")&&(C.userId=i.userId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&(C.sdkToken=i.sdkToken),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Login"},A})(),F.Track=(function(){function A(i){if(i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.mid="",A.prototype.trackName=null,A.prototype.location=null,A.prototype.userId=null,A.prototype.code=null,A.prototype.desc=null,A.prototype.type=null,A.prototype.isValid=null,A.prototype.simulcast=null,A.prototype.lastRetry=null;let D;return Object.defineProperty(A.prototype,"_trackName",{get:$util.oneOfGetter(D=["trackName"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_location",{get:$util.oneOfGetter(D=["location"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_userId",{get:$util.oneOfGetter(D=["userId"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_code",{get:$util.oneOfGetter(D=["code"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_desc",{get:$util.oneOfGetter(D=["desc"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_type",{get:$util.oneOfGetter(D=["type"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_isValid",{get:$util.oneOfGetter(D=["isValid"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_simulcast",{get:$util.oneOfGetter(D=["simulcast"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_lastRetry",{get:$util.oneOfGetter(D=["lastRetry"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){return C||(C=$Writer.create()),T.mid!=null&&Object.hasOwnProperty.call(T,"mid")&&C.uint32(10).string(T.mid),T.trackName!=null&&Object.hasOwnProperty.call(T,"trackName")&&C.uint32(18).string(T.trackName),T.location!=null&&Object.hasOwnProperty.call(T,"location")&&C.uint32(26).string(T.location),T.userId!=null&&Object.hasOwnProperty.call(T,"userId")&&C.uint32(34).string(T.userId),T.code!=null&&Object.hasOwnProperty.call(T,"code")&&C.uint32(40).int32(T.code),T.desc!=null&&Object.hasOwnProperty.call(T,"desc")&&C.uint32(50).string(T.desc),T.type!=null&&Object.hasOwnProperty.call(T,"type")&&C.uint32(56).int32(T.type),T.isValid!=null&&Object.hasOwnProperty.call(T,"isValid")&&C.uint32(64).bool(T.isValid),T.simulcast!=null&&Object.hasOwnProperty.call(T,"simulcast")&&C.uint32(74).string(T.simulcast),T.lastRetry!=null&&Object.hasOwnProperty.call(T,"lastRetry")&&C.uint32(80).bool(T.lastRetry),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.Track;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.mid=T.string();break}case 2:{z.trackName=T.string();break}case 3:{z.location=T.string();break}case 4:{z.userId=T.string();break}case 5:{z.code=T.int32();break}case 6:{z.desc=T.string();break}case 7:{z.type=T.int32();break}case 8:{z.isValid=T.bool();break}case 9:{z.simulcast=T.string();break}case 10:{z.lastRetry=T.bool();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.mid!=null&&T.hasOwnProperty("mid")&&!$util.isString(T.mid))return"mid: string expected";if(T.trackName!=null&&T.hasOwnProperty("trackName")&&!$util.isString(T.trackName))return"trackName: string expected";if(T.location!=null&&T.hasOwnProperty("location")&&!$util.isString(T.location))return"location: string expected";if(T.userId!=null&&T.hasOwnProperty("userId")&&!$util.isString(T.userId))return"userId: string expected";if(T.code!=null&&T.hasOwnProperty("code")&&!$util.isInteger(T.code))return"code: integer expected";if(T.desc!=null&&T.hasOwnProperty("desc")&&!$util.isString(T.desc))return"desc: string expected";if(T.type!=null&&T.hasOwnProperty("type"))switch(T.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return T.isValid!=null&&T.hasOwnProperty("isValid")&&typeof T.isValid!="boolean"?"isValid: boolean expected":T.simulcast!=null&&T.hasOwnProperty("simulcast")&&!$util.isString(T.simulcast)?"simulcast: string expected":T.lastRetry!=null&&T.hasOwnProperty("lastRetry")&&typeof T.lastRetry!="boolean"?"lastRetry: boolean expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.Track)return T;let C=new $root.com.quick.voice.proto.Track;switch(T.mid!=null&&(C.mid=String(T.mid)),T.trackName!=null&&(C.trackName=String(T.trackName)),T.location!=null&&(C.location=String(T.location)),T.userId!=null&&(C.userId=String(T.userId)),T.code!=null&&(C.code=T.code|0),T.desc!=null&&(C.desc=String(T.desc)),T.type){default:if(typeof T.type=="number"){C.type=T.type;break}break;case"Microphone":case 0:C.type=0;break;case"Camera":case 1:C.type=1;break;case"Screen":case 2:C.type=2;break;case"SystemVoice":case 3:C.type=3;break}return T.isValid!=null&&(C.isValid=!!T.isValid),T.simulcast!=null&&(C.simulcast=String(T.simulcast)),T.lastRetry!=null&&(C.lastRetry=!!T.lastRetry),C},A.toObject=function(T,C){C||(C={});let U={};return C.defaults&&(U.mid=""),T.mid!=null&&T.hasOwnProperty("mid")&&(U.mid=T.mid),T.trackName!=null&&T.hasOwnProperty("trackName")&&(U.trackName=T.trackName,C.oneofs&&(U._trackName="trackName")),T.location!=null&&T.hasOwnProperty("location")&&(U.location=T.location,C.oneofs&&(U._location="location")),T.userId!=null&&T.hasOwnProperty("userId")&&(U.userId=T.userId,C.oneofs&&(U._userId="userId")),T.code!=null&&T.hasOwnProperty("code")&&(U.code=T.code,C.oneofs&&(U._code="code")),T.desc!=null&&T.hasOwnProperty("desc")&&(U.desc=T.desc,C.oneofs&&(U._desc="desc")),T.type!=null&&T.hasOwnProperty("type")&&(U.type=C.enums===String?$root.com.quick.voice.proto.TrackType[T.type]===void 0?T.type:$root.com.quick.voice.proto.TrackType[T.type]:T.type,C.oneofs&&(U._type="type")),T.isValid!=null&&T.hasOwnProperty("isValid")&&(U.isValid=T.isValid,C.oneofs&&(U._isValid="isValid")),T.simulcast!=null&&T.hasOwnProperty("simulcast")&&(U.simulcast=T.simulcast,C.oneofs&&(U._simulcast="simulcast")),T.lastRetry!=null&&T.hasOwnProperty("lastRetry")&&(U.lastRetry=T.lastRetry,C.oneofs&&(U._lastRetry="lastRetry")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.Track"},A})(),F.JoinReq=(function(){function A(i){if(i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.roomId="",A.prototype.user=null,A.prototype.callType=0,A.prototype.token=null,A.prototype.lang=null,A.prototype.stt=null;let D;return Object.defineProperty(A.prototype,"_token",{get:$util.oneOfGetter(D=["token"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_lang",{get:$util.oneOfGetter(D=["lang"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_stt",{get:$util.oneOfGetter(D=["stt"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){return C||(C=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&C.uint32(10).string(T.roomId),T.user!=null&&Object.hasOwnProperty.call(T,"user")&&$root.com.quick.voice.proto.User.encode(T.user,C.uint32(18).fork()).ldelim(),T.callType!=null&&Object.hasOwnProperty.call(T,"callType")&&C.uint32(24).int32(T.callType),T.token!=null&&Object.hasOwnProperty.call(T,"token")&&C.uint32(34).string(T.token),T.lang!=null&&Object.hasOwnProperty.call(T,"lang")&&$root.com.quick.voice.proto.AiLangSetting.encode(T.lang,C.uint32(42).fork()).ldelim(),T.stt!=null&&Object.hasOwnProperty.call(T,"stt")&&C.uint32(48).bool(T.stt),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.JoinReq;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(T,T.uint32());break}case 3:{z.callType=T.int32();break}case 4:{z.token=T.string();break}case 5:{z.lang=$root.com.quick.voice.proto.AiLangSetting.decode(T,T.uint32());break}case 6:{z.stt=T.bool();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.user!=null&&T.hasOwnProperty("user")){let C=$root.com.quick.voice.proto.User.verify(T.user);if(C)return"user."+C}if(T.callType!=null&&T.hasOwnProperty("callType"))switch(T.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}if(T.token!=null&&T.hasOwnProperty("token")&&!$util.isString(T.token))return"token: string expected";if(T.lang!=null&&T.hasOwnProperty("lang")){let C=$root.com.quick.voice.proto.AiLangSetting.verify(T.lang);if(C)return"lang."+C}return T.stt!=null&&T.hasOwnProperty("stt")&&typeof T.stt!="boolean"?"stt: boolean expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.JoinReq)return T;let C=new $root.com.quick.voice.proto.JoinReq;if(T.roomId!=null&&(C.roomId=String(T.roomId)),T.user!=null){if(typeof T.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");C.user=$root.com.quick.voice.proto.User.fromObject(T.user)}switch(T.callType){default:if(typeof T.callType=="number"){C.callType=T.callType;break}break;case"Normal":case 0:C.callType=0;break;case"Meeting":case 1:C.callType=1;break;case"Live":case 2:C.callType=2;break}if(T.token!=null&&(C.token=String(T.token)),T.lang!=null){if(typeof T.lang!="object")throw TypeError(".com.quick.voice.proto.JoinReq.lang: object expected");C.lang=$root.com.quick.voice.proto.AiLangSetting.fromObject(T.lang)}return T.stt!=null&&(C.stt=!!T.stt),C},A.toObject=function(T,C){C||(C={});let U={};return C.defaults&&(U.roomId="",U.user=null,U.callType=C.enums===String?"Normal":0),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.user!=null&&T.hasOwnProperty("user")&&(U.user=$root.com.quick.voice.proto.User.toObject(T.user,C)),T.callType!=null&&T.hasOwnProperty("callType")&&(U.callType=C.enums===String?$root.com.quick.voice.proto.CallType[T.callType]===void 0?T.callType:$root.com.quick.voice.proto.CallType[T.callType]:T.callType),T.token!=null&&T.hasOwnProperty("token")&&(U.token=T.token,C.oneofs&&(U._token="token")),T.lang!=null&&T.hasOwnProperty("lang")&&(U.lang=$root.com.quick.voice.proto.AiLangSetting.toObject(T.lang,C),C.oneofs&&(U._lang="lang")),T.stt!=null&&T.hasOwnProperty("stt")&&(U.stt=T.stt,C.oneofs&&(U._stt="stt")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.JoinReq"},A})(),F.JoinRsp=(function(){function A(D){if(this.roomUsers=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.roomUsers=$util.emptyArray,A.prototype.callType=0,A.prototype.wifiOnly=!1,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.roomUsers!=null&&i.roomUsers.length)for(let C=0;C<i.roomUsers.length;++C)$root.com.quick.voice.proto.User.encode(i.roomUsers[C],T.uint32(18).fork()).ldelim();return i.callType!=null&&Object.hasOwnProperty.call(i,"callType")&&T.uint32(24).int32(i.callType),i.wifiOnly!=null&&Object.hasOwnProperty.call(i,"wifiOnly")&&T.uint32(32).bool(i.wifiOnly),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.JoinRsp;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.roomUsers&&j.roomUsers.length||(j.roomUsers=[]),j.roomUsers.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 3:{j.callType=i.int32();break}case 4:{j.wifiOnly=i.bool();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.roomUsers!=null&&i.hasOwnProperty("roomUsers")){if(!Array.isArray(i.roomUsers))return"roomUsers: array expected";for(let T=0;T<i.roomUsers.length;++T){let C=$root.com.quick.voice.proto.User.verify(i.roomUsers[T]);if(C)return"roomUsers."+C}}if(i.callType!=null&&i.hasOwnProperty("callType"))switch(i.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return i.wifiOnly!=null&&i.hasOwnProperty("wifiOnly")&&typeof i.wifiOnly!="boolean"?"wifiOnly: boolean expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinRsp)return i;let T=new $root.com.quick.voice.proto.JoinRsp;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.roomUsers){if(!Array.isArray(i.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");T.roomUsers=[];for(let C=0;C<i.roomUsers.length;++C){if(typeof i.roomUsers[C]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");T.roomUsers[C]=$root.com.quick.voice.proto.User.fromObject(i.roomUsers[C])}}switch(i.callType){default:if(typeof i.callType=="number"){T.callType=i.callType;break}break;case"Normal":case 0:T.callType=0;break;case"Meeting":case 1:T.callType=1;break;case"Live":case 2:T.callType=2;break}return i.wifiOnly!=null&&(T.wifiOnly=!!i.wifiOnly),T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.roomUsers=[]),T.defaults&&(C.roomId="",C.callType=T.enums===String?"Normal":0,C.wifiOnly=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.roomUsers&&i.roomUsers.length){C.roomUsers=[];for(let U=0;U<i.roomUsers.length;++U)C.roomUsers[U]=$root.com.quick.voice.proto.User.toObject(i.roomUsers[U],T)}return i.callType!=null&&i.hasOwnProperty("callType")&&(C.callType=T.enums===String?$root.com.quick.voice.proto.CallType[i.callType]===void 0?i.callType:$root.com.quick.voice.proto.CallType[i.callType]:i.callType),i.wifiOnly!=null&&i.hasOwnProperty("wifiOnly")&&(C.wifiOnly=i.wifiOnly),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinRsp"},A})(),F.JoinNotify=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.user=null,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,T.uint32(18).fork()).ldelim(),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.JoinNotify;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let T=$root.com.quick.voice.proto.User.verify(i.user);if(T)return"user."+T}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinNotify)return i;let T=new $root.com.quick.voice.proto.JoinNotify;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");T.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.roomId="",C.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(i.user,T)),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinNotify"},A})(),F.ConnectCFReq=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.sdp="",A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&T.uint32(10).string(i.sdp),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ConnectCFReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.sdp=i.string();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ConnectCFReq)return i;let T=new $root.com.quick.voice.proto.ConnectCFReq;return i.sdp!=null&&(T.sdp=String(i.sdp)),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.sdp=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&(C.sdp=i.sdp),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ConnectCFReq"},A})(),F.ConnectCFRsp=(function(){function A(i){if(this.subscribeUsers=[],i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.remoteSdp="",A.prototype.subscribeUsers=$util.emptyArray,A.prototype.session=null;let D;return Object.defineProperty(A.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){if(C||(C=$Writer.create()),T.remoteSdp!=null&&Object.hasOwnProperty.call(T,"remoteSdp")&&C.uint32(10).string(T.remoteSdp),T.subscribeUsers!=null&&T.subscribeUsers.length)for(let U=0;U<T.subscribeUsers.length;++U)$root.com.quick.voice.proto.User.encode(T.subscribeUsers[U],C.uint32(18).fork()).ldelim();return T.session!=null&&Object.hasOwnProperty.call(T,"session")&&C.uint32(26).string(T.session),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.ConnectCFRsp;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.remoteSdp=T.string();break}case 2:{z.subscribeUsers&&z.subscribeUsers.length||(z.subscribeUsers=[]),z.subscribeUsers.push($root.com.quick.voice.proto.User.decode(T,T.uint32()));break}case 3:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&!$util.isString(T.remoteSdp))return"remoteSdp: string expected";if(T.subscribeUsers!=null&&T.hasOwnProperty("subscribeUsers")){if(!Array.isArray(T.subscribeUsers))return"subscribeUsers: array expected";for(let C=0;C<T.subscribeUsers.length;++C){let U=$root.com.quick.voice.proto.User.verify(T.subscribeUsers[C]);if(U)return"subscribeUsers."+U}}return T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.ConnectCFRsp)return T;let C=new $root.com.quick.voice.proto.ConnectCFRsp;if(T.remoteSdp!=null&&(C.remoteSdp=String(T.remoteSdp)),T.subscribeUsers){if(!Array.isArray(T.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");C.subscribeUsers=[];for(let U=0;U<T.subscribeUsers.length;++U){if(typeof T.subscribeUsers[U]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");C.subscribeUsers[U]=$root.com.quick.voice.proto.User.fromObject(T.subscribeUsers[U])}}return T.session!=null&&(C.session=String(T.session)),C},A.toObject=function(T,C){C||(C={});let U={};if((C.arrays||C.defaults)&&(U.subscribeUsers=[]),C.defaults&&(U.remoteSdp=""),T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&(U.remoteSdp=T.remoteSdp),T.subscribeUsers&&T.subscribeUsers.length){U.subscribeUsers=[];for(let j=0;j<T.subscribeUsers.length;++j)U.subscribeUsers[j]=$root.com.quick.voice.proto.User.toObject(T.subscribeUsers[j],C)}return T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,C.oneofs&&(U._session="session")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.ConnectCFRsp"},A})(),F.PublishReq=(function(){function A(i){if(this.tracks=[],i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.sdp="",A.prototype.tracks=$util.emptyArray,A.prototype.callAction=0,A.prototype.recreate=null,A.prototype.session=null;let D;return Object.defineProperty(A.prototype,"_recreate",{get:$util.oneOfGetter(D=["recreate"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){if(C||(C=$Writer.create()),T.sdp!=null&&Object.hasOwnProperty.call(T,"sdp")&&C.uint32(10).string(T.sdp),T.tracks!=null&&T.tracks.length)for(let U=0;U<T.tracks.length;++U)$root.com.quick.voice.proto.Track.encode(T.tracks[U],C.uint32(18).fork()).ldelim();return T.callAction!=null&&Object.hasOwnProperty.call(T,"callAction")&&C.uint32(24).int32(T.callAction),T.recreate!=null&&Object.hasOwnProperty.call(T,"recreate")&&C.uint32(32).bool(T.recreate),T.session!=null&&Object.hasOwnProperty.call(T,"session")&&C.uint32(42).string(T.session),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.PublishReq;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.sdp=T.string();break}case 2:{z.tracks&&z.tracks.length||(z.tracks=[]),z.tracks.push($root.com.quick.voice.proto.Track.decode(T,T.uint32()));break}case 3:{z.callAction=T.int32();break}case 4:{z.recreate=T.bool();break}case 5:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.sdp!=null&&T.hasOwnProperty("sdp")&&!$util.isString(T.sdp))return"sdp: string expected";if(T.tracks!=null&&T.hasOwnProperty("tracks")){if(!Array.isArray(T.tracks))return"tracks: array expected";for(let C=0;C<T.tracks.length;++C){let U=$root.com.quick.voice.proto.Track.verify(T.tracks[C]);if(U)return"tracks."+U}}return T.callAction!=null&&T.hasOwnProperty("callAction")&&!$util.isInteger(T.callAction)?"callAction: integer expected":T.recreate!=null&&T.hasOwnProperty("recreate")&&typeof T.recreate!="boolean"?"recreate: boolean expected":T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.PublishReq)return T;let C=new $root.com.quick.voice.proto.PublishReq;if(T.sdp!=null&&(C.sdp=String(T.sdp)),T.tracks){if(!Array.isArray(T.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");C.tracks=[];for(let U=0;U<T.tracks.length;++U){if(typeof T.tracks[U]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");C.tracks[U]=$root.com.quick.voice.proto.Track.fromObject(T.tracks[U])}}return T.callAction!=null&&(C.callAction=T.callAction|0),T.recreate!=null&&(C.recreate=!!T.recreate),T.session!=null&&(C.session=String(T.session)),C},A.toObject=function(T,C){C||(C={});let U={};if((C.arrays||C.defaults)&&(U.tracks=[]),C.defaults&&(U.sdp="",U.callAction=0),T.sdp!=null&&T.hasOwnProperty("sdp")&&(U.sdp=T.sdp),T.tracks&&T.tracks.length){U.tracks=[];for(let j=0;j<T.tracks.length;++j)U.tracks[j]=$root.com.quick.voice.proto.Track.toObject(T.tracks[j],C)}return T.callAction!=null&&T.hasOwnProperty("callAction")&&(U.callAction=T.callAction),T.recreate!=null&&T.hasOwnProperty("recreate")&&(U.recreate=T.recreate,C.oneofs&&(U._recreate="recreate")),T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,C.oneofs&&(U._session="session")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.PublishReq"},A})(),F.PublishRsp=(function(){function A(i){if(i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.remoteSdp="",A.prototype.session=null;let D;return Object.defineProperty(A.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){return C||(C=$Writer.create()),T.remoteSdp!=null&&Object.hasOwnProperty.call(T,"remoteSdp")&&C.uint32(10).string(T.remoteSdp),T.session!=null&&Object.hasOwnProperty.call(T,"session")&&C.uint32(18).string(T.session),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.PublishRsp;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.remoteSdp=T.string();break}case 2:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){return typeof T!="object"||T===null?"object expected":T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&!$util.isString(T.remoteSdp)?"remoteSdp: string expected":T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.PublishRsp)return T;let C=new $root.com.quick.voice.proto.PublishRsp;return T.remoteSdp!=null&&(C.remoteSdp=String(T.remoteSdp)),T.session!=null&&(C.session=String(T.session)),C},A.toObject=function(T,C){C||(C={});let U={};return C.defaults&&(U.remoteSdp=""),T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&(U.remoteSdp=T.remoteSdp),T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,C.oneofs&&(U._session="session")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.PublishRsp"},A})(),F.PublishNotify=(function(){function A(i){if(i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.roomId="",A.prototype.user=null,A.prototype.session=null;let D;return Object.defineProperty(A.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){return C||(C=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&C.uint32(10).string(T.roomId),T.user!=null&&Object.hasOwnProperty.call(T,"user")&&$root.com.quick.voice.proto.User.encode(T.user,C.uint32(18).fork()).ldelim(),T.session!=null&&Object.hasOwnProperty.call(T,"session")&&C.uint32(26).string(T.session),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.PublishNotify;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(T,T.uint32());break}case 3:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.user!=null&&T.hasOwnProperty("user")){let C=$root.com.quick.voice.proto.User.verify(T.user);if(C)return"user."+C}return T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.PublishNotify)return T;let C=new $root.com.quick.voice.proto.PublishNotify;if(T.roomId!=null&&(C.roomId=String(T.roomId)),T.user!=null){if(typeof T.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");C.user=$root.com.quick.voice.proto.User.fromObject(T.user)}return T.session!=null&&(C.session=String(T.session)),C},A.toObject=function(T,C){C||(C={});let U={};return C.defaults&&(U.roomId="",U.user=null),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.user!=null&&T.hasOwnProperty("user")&&(U.user=$root.com.quick.voice.proto.User.toObject(T.user,C)),T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,C.oneofs&&(U._session="session")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.PublishNotify"},A})(),F.SubscribeReq=(function(){function A(i){if(this.users=[],i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.users=$util.emptyArray,A.prototype.session=null;let D;return Object.defineProperty(A.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){if(C||(C=$Writer.create()),T.users!=null&&T.users.length)for(let U=0;U<T.users.length;++U)$root.com.quick.voice.proto.User.encode(T.users[U],C.uint32(10).fork()).ldelim();return T.session!=null&&Object.hasOwnProperty.call(T,"session")&&C.uint32(18).string(T.session),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.SubscribeReq;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.users&&z.users.length||(z.users=[]),z.users.push($root.com.quick.voice.proto.User.decode(T,T.uint32()));break}case 2:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.users!=null&&T.hasOwnProperty("users")){if(!Array.isArray(T.users))return"users: array expected";for(let C=0;C<T.users.length;++C){let U=$root.com.quick.voice.proto.User.verify(T.users[C]);if(U)return"users."+U}}return T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.SubscribeReq)return T;let C=new $root.com.quick.voice.proto.SubscribeReq;if(T.users){if(!Array.isArray(T.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");C.users=[];for(let U=0;U<T.users.length;++U){if(typeof T.users[U]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");C.users[U]=$root.com.quick.voice.proto.User.fromObject(T.users[U])}}return T.session!=null&&(C.session=String(T.session)),C},A.toObject=function(T,C){C||(C={});let U={};if((C.arrays||C.defaults)&&(U.users=[]),T.users&&T.users.length){U.users=[];for(let j=0;j<T.users.length;++j)U.users[j]=$root.com.quick.voice.proto.User.toObject(T.users[j],C)}return T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,C.oneofs&&(U._session="session")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.SubscribeReq"},A})(),F.SubscribeRsp=(function(){function A(i){if(this.users=[],i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.remoteSdp="",A.prototype.users=$util.emptyArray,A.prototype.session=null;let D;return Object.defineProperty(A.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){if(C||(C=$Writer.create()),T.remoteSdp!=null&&Object.hasOwnProperty.call(T,"remoteSdp")&&C.uint32(10).string(T.remoteSdp),T.users!=null&&T.users.length)for(let U=0;U<T.users.length;++U)$root.com.quick.voice.proto.User.encode(T.users[U],C.uint32(18).fork()).ldelim();return T.session!=null&&Object.hasOwnProperty.call(T,"session")&&C.uint32(26).string(T.session),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.SubscribeRsp;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.remoteSdp=T.string();break}case 2:{z.users&&z.users.length||(z.users=[]),z.users.push($root.com.quick.voice.proto.User.decode(T,T.uint32()));break}case 3:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&!$util.isString(T.remoteSdp))return"remoteSdp: string expected";if(T.users!=null&&T.hasOwnProperty("users")){if(!Array.isArray(T.users))return"users: array expected";for(let C=0;C<T.users.length;++C){let U=$root.com.quick.voice.proto.User.verify(T.users[C]);if(U)return"users."+U}}return T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.SubscribeRsp)return T;let C=new $root.com.quick.voice.proto.SubscribeRsp;if(T.remoteSdp!=null&&(C.remoteSdp=String(T.remoteSdp)),T.users){if(!Array.isArray(T.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");C.users=[];for(let U=0;U<T.users.length;++U){if(typeof T.users[U]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");C.users[U]=$root.com.quick.voice.proto.User.fromObject(T.users[U])}}return T.session!=null&&(C.session=String(T.session)),C},A.toObject=function(T,C){C||(C={});let U={};if((C.arrays||C.defaults)&&(U.users=[]),C.defaults&&(U.remoteSdp=""),T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&(U.remoteSdp=T.remoteSdp),T.users&&T.users.length){U.users=[];for(let j=0;j<T.users.length;++j)U.users[j]=$root.com.quick.voice.proto.User.toObject(T.users[j],C)}return T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,C.oneofs&&(U._session="session")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.SubscribeRsp"},A})(),F.RenegotiateReq=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.userId="",A.prototype.sdp="",A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(10).string(i.userId),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&T.uint32(18).string(i.sdp),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.RenegotiateReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.userId=i.string();break}case 2:{j.sdp=i.string();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RenegotiateReq)return i;let T=new $root.com.quick.voice.proto.RenegotiateReq;return i.userId!=null&&(T.userId=String(i.userId)),i.sdp!=null&&(T.sdp=String(i.sdp)),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.userId="",C.sdp=""),i.userId!=null&&i.hasOwnProperty("userId")&&(C.userId=i.userId),i.sdp!=null&&i.hasOwnProperty("sdp")&&(C.sdp=i.sdp),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RenegotiateReq"},A})(),F.QuitReq=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.userId="",A.prototype.roomId="",A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(18).string(i.roomId),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.QuitReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.userId=i.string();break}case 2:{j.roomId=i.string();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.QuitReq)return i;let T=new $root.com.quick.voice.proto.QuitReq;return i.userId!=null&&(T.userId=String(i.userId)),i.roomId!=null&&(T.roomId=String(i.roomId)),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.userId="",C.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(C.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.QuitReq"},A})(),F.QuitNotify=(function(){function A(i){if(i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.roomId="",A.prototype.user=null,A.prototype.code=null,A.prototype.desc=null;let D;return Object.defineProperty(A.prototype,"_code",{get:$util.oneOfGetter(D=["code"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_desc",{get:$util.oneOfGetter(D=["desc"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){return C||(C=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&C.uint32(10).string(T.roomId),T.user!=null&&Object.hasOwnProperty.call(T,"user")&&$root.com.quick.voice.proto.User.encode(T.user,C.uint32(18).fork()).ldelim(),T.code!=null&&Object.hasOwnProperty.call(T,"code")&&C.uint32(24).int32(T.code),T.desc!=null&&Object.hasOwnProperty.call(T,"desc")&&C.uint32(34).string(T.desc),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.QuitNotify;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(T,T.uint32());break}case 3:{z.code=T.int32();break}case 4:{z.desc=T.string();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.user!=null&&T.hasOwnProperty("user")){let C=$root.com.quick.voice.proto.User.verify(T.user);if(C)return"user."+C}return T.code!=null&&T.hasOwnProperty("code")&&!$util.isInteger(T.code)?"code: integer expected":T.desc!=null&&T.hasOwnProperty("desc")&&!$util.isString(T.desc)?"desc: string expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.QuitNotify)return T;let C=new $root.com.quick.voice.proto.QuitNotify;if(T.roomId!=null&&(C.roomId=String(T.roomId)),T.user!=null){if(typeof T.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");C.user=$root.com.quick.voice.proto.User.fromObject(T.user)}return T.code!=null&&(C.code=T.code|0),T.desc!=null&&(C.desc=String(T.desc)),C},A.toObject=function(T,C){C||(C={});let U={};return C.defaults&&(U.roomId="",U.user=null),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.user!=null&&T.hasOwnProperty("user")&&(U.user=$root.com.quick.voice.proto.User.toObject(T.user,C)),T.code!=null&&T.hasOwnProperty("code")&&(U.code=T.code,C.oneofs&&(U._code="code")),T.desc!=null&&T.hasOwnProperty("desc")&&(U.desc=T.desc,C.oneofs&&(U._desc="desc")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.QuitNotify"},A})(),F.TokenExpireNotify=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.TokenExpireNotify;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.TokenExpireNotify)return i;let T=new $root.com.quick.voice.proto.TokenExpireNotify;return i.roomId!=null&&(T.roomId=String(i.roomId)),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.TokenExpireNotify"},A})(),F.UpdateTokenReq=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.sdkToken="",A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&T.uint32(18).string(i.sdkToken),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UpdateTokenReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.sdkToken=i.string();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTokenReq)return i;let T=new $root.com.quick.voice.proto.UpdateTokenReq;return i.roomId!=null&&(T.roomId=String(i.roomId)),i.sdkToken!=null&&(T.sdkToken=String(i.sdkToken)),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.roomId="",C.sdkToken=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&(C.sdkToken=i.sdkToken),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTokenReq"},A})(),F.NetQualityChange=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.userId="",A.prototype.roomId="",A.prototype.egress=0,A.prototype.ingress=0,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(18).string(i.roomId),i.egress!=null&&Object.hasOwnProperty.call(i,"egress")&&T.uint32(24).int32(i.egress),i.ingress!=null&&Object.hasOwnProperty.call(i,"ingress")&&T.uint32(32).int32(i.ingress),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.NetQualityChange;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.userId=i.string();break}case 2:{j.roomId=i.string();break}case 3:{j.egress=i.int32();break}case 4:{j.ingress=i.int32();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.egress!=null&&i.hasOwnProperty("egress")&&!$util.isInteger(i.egress)?"egress: integer expected":i.ingress!=null&&i.hasOwnProperty("ingress")&&!$util.isInteger(i.ingress)?"ingress: integer expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityChange)return i;let T=new $root.com.quick.voice.proto.NetQualityChange;return i.userId!=null&&(T.userId=String(i.userId)),i.roomId!=null&&(T.roomId=String(i.roomId)),i.egress!=null&&(T.egress=i.egress|0),i.ingress!=null&&(T.ingress=i.ingress|0),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.userId="",C.roomId="",C.egress=0,C.ingress=0),i.userId!=null&&i.hasOwnProperty("userId")&&(C.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.egress!=null&&i.hasOwnProperty("egress")&&(C.egress=i.egress),i.ingress!=null&&i.hasOwnProperty("ingress")&&(C.ingress=i.ingress),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityChange"},A})(),F.NetQualityNotify=(function(){function A(D){if(this.qualities=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.qualities=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.qualities!=null&&i.qualities.length)for(let C=0;C<i.qualities.length;++C)$root.com.quick.voice.proto.NetQualityChange.encode(i.qualities[C],T.uint32(10).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.NetQualityNotify;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.qualities&&j.qualities.length||(j.qualities=[]),j.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.qualities!=null&&i.hasOwnProperty("qualities")){if(!Array.isArray(i.qualities))return"qualities: array expected";for(let T=0;T<i.qualities.length;++T){let C=$root.com.quick.voice.proto.NetQualityChange.verify(i.qualities[T]);if(C)return"qualities."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityNotify)return i;let T=new $root.com.quick.voice.proto.NetQualityNotify;if(i.qualities){if(!Array.isArray(i.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");T.qualities=[];for(let C=0;C<i.qualities.length;++C){if(typeof i.qualities[C]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");T.qualities[C]=$root.com.quick.voice.proto.NetQualityChange.fromObject(i.qualities[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.qualities=[]),i.qualities&&i.qualities.length){C.qualities=[];for(let U=0;U<i.qualities.length;++U)C.qualities[U]=$root.com.quick.voice.proto.NetQualityChange.toObject(i.qualities[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityNotify"},A})(),F.UpdateCall=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.user=null,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,T.uint32(18).fork()).ldelim(),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UpdateCall;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let T=$root.com.quick.voice.proto.User.verify(i.user);if(T)return"user."+T}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateCall)return i;let T=new $root.com.quick.voice.proto.UpdateCall;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");T.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.roomId="",C.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(i.user,T)),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateCall"},A})(),F.SyncRoomInfoReq=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.user=null,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,T.uint32(18).fork()).ldelim(),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let T=$root.com.quick.voice.proto.User.verify(i.user);if(T)return"user."+T}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return i;let T=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");T.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.roomId="",C.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(i.user,T)),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoReq"},A})(),F.SyncRoomInfoRsp=(function(){function A(D){if(this.users=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.isValid=!1,A.prototype.users=$util.emptyArray,A.prototype.isActive=!1,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.isValid!=null&&Object.hasOwnProperty.call(i,"isValid")&&T.uint32(16).bool(i.isValid),i.users!=null&&i.users.length)for(let C=0;C<i.users.length;++C)$root.com.quick.voice.proto.User.encode(i.users[C],T.uint32(26).fork()).ldelim();return i.isActive!=null&&Object.hasOwnProperty.call(i,"isActive")&&T.uint32(32).bool(i.isActive),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.isValid=i.bool();break}case 3:{j.users&&j.users.length||(j.users=[]),j.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 4:{j.isActive=i.bool();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.isValid!=null&&i.hasOwnProperty("isValid")&&typeof i.isValid!="boolean")return"isValid: boolean expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let T=0;T<i.users.length;++T){let C=$root.com.quick.voice.proto.User.verify(i.users[T]);if(C)return"users."+C}}return i.isActive!=null&&i.hasOwnProperty("isActive")&&typeof i.isActive!="boolean"?"isActive: boolean expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return i;let T=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.isValid!=null&&(T.isValid=!!i.isValid),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");T.users=[];for(let C=0;C<i.users.length;++C){if(typeof i.users[C]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");T.users[C]=$root.com.quick.voice.proto.User.fromObject(i.users[C])}}return i.isActive!=null&&(T.isActive=!!i.isActive),T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.users=[]),T.defaults&&(C.roomId="",C.isValid=!1,C.isActive=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.isValid!=null&&i.hasOwnProperty("isValid")&&(C.isValid=i.isValid),i.users&&i.users.length){C.users=[];for(let U=0;U<i.users.length;++U)C.users[U]=$root.com.quick.voice.proto.User.toObject(i.users[U],T)}return i.isActive!=null&&i.hasOwnProperty("isActive")&&(C.isActive=i.isActive),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoRsp"},A})(),F.UpdateTime=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&T.uint32(8).int64(i.time),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UpdateTime;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.time=i.int64();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTime)return i;let T=new $root.com.quick.voice.proto.UpdateTime;return i.time!=null&&($util.Long?(T.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?T.time=parseInt(i.time,10):typeof i.time=="number"?T.time=i.time:typeof i.time=="object"&&(T.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),T},A.toObject=function(i,T){T||(T={});let C={};if(T.defaults)if($util.Long){let U=new $util.Long(0,0,!1);C.time=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else C.time=T.longs===String?"0":0;return i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?C.time=T.longs===String?String(i.time):i.time:C.time=T.longs===String?$util.Long.prototype.toString.call(i.time):T.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTime"},A})(),F.CloseTrackReq=(function(){function A(D){if(this.tracks=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.sdp="",A.prototype.tracks=$util.emptyArray,A.prototype.roomId="",A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&T.uint32(10).string(i.sdp),i.tracks!=null&&i.tracks.length)for(let C=0;C<i.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(i.tracks[C],T.uint32(18).fork()).ldelim();return i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(26).string(i.roomId),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CloseTrackReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.sdp=i.string();break}case 2:{j.tracks&&j.tracks.length||(j.tracks=[]),j.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{j.roomId=i.string();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp))return"sdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let T=0;T<i.tracks.length;++T){let C=$root.com.quick.voice.proto.Track.verify(i.tracks[T]);if(C)return"tracks."+C}}return i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackReq)return i;let T=new $root.com.quick.voice.proto.CloseTrackReq;if(i.sdp!=null&&(T.sdp=String(i.sdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");T.tracks=[];for(let C=0;C<i.tracks.length;++C){if(typeof i.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");T.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[C])}}return i.roomId!=null&&(T.roomId=String(i.roomId)),T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.tracks=[]),T.defaults&&(C.sdp="",C.roomId=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&(C.sdp=i.sdp),i.tracks&&i.tracks.length){C.tracks=[];for(let U=0;U<i.tracks.length;++U)C.tracks[U]=$root.com.quick.voice.proto.Track.toObject(i.tracks[U],T)}return i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackReq"},A})(),F.CloseTrackRsp=(function(){function A(D){if(this.tracks=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.remoteSdp="",A.prototype.tracks=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.remoteSdp!=null&&Object.hasOwnProperty.call(i,"remoteSdp")&&T.uint32(10).string(i.remoteSdp),i.tracks!=null&&i.tracks.length)for(let C=0;C<i.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(i.tracks[C],T.uint32(18).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CloseTrackRsp;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.remoteSdp=i.string();break}case 2:{j.tracks&&j.tracks.length||(j.tracks=[]),j.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&!$util.isString(i.remoteSdp))return"remoteSdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let T=0;T<i.tracks.length;++T){let C=$root.com.quick.voice.proto.Track.verify(i.tracks[T]);if(C)return"tracks."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackRsp)return i;let T=new $root.com.quick.voice.proto.CloseTrackRsp;if(i.remoteSdp!=null&&(T.remoteSdp=String(i.remoteSdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");T.tracks=[];for(let C=0;C<i.tracks.length;++C){if(typeof i.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");T.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.tracks=[]),T.defaults&&(C.remoteSdp=""),i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&(C.remoteSdp=i.remoteSdp),i.tracks&&i.tracks.length){C.tracks=[];for(let U=0;U<i.tracks.length;++U)C.tracks[U]=$root.com.quick.voice.proto.Track.toObject(i.tracks[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackRsp"},A})(),F.CloseTrackNotify=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.user=null,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,T.uint32(10).fork()).ldelim(),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CloseTrackNotify;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.user!=null&&i.hasOwnProperty("user")){let T=$root.com.quick.voice.proto.User.verify(i.user);if(T)return"user."+T}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackNotify)return i;let T=new $root.com.quick.voice.proto.CloseTrackNotify;if(i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");T.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.user=null),i.user!=null&&i.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(i.user,T)),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackNotify"},A})(),F.TrackType=(function(){const A={},D=Object.create(A);return D[A[0]="Microphone"]=0,D[A[1]="Camera"]=1,D[A[2]="Screen"]=2,D[A[3]="SystemVoice"]=3,D})(),F.UpdatePermissions=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.user=null,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,T.uint32(18).fork()).ldelim(),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UpdatePermissions;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let T=$root.com.quick.voice.proto.User.verify(i.user);if(T)return"user."+T}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdatePermissions)return i;let T=new $root.com.quick.voice.proto.UpdatePermissions;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");T.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.roomId="",C.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(i.user,T)),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdatePermissions"},A})(),F.CallType=(function(){const A={},D=Object.create(A);return D[A[0]="Normal"]=0,D[A[1]="Meeting"]=1,D[A[2]="Live"]=2,D})(),F.QuitNotifyCode=(function(){const A={},D=Object.create(A);return D[A[0]="NormalQuit"]=0,D[A[2021]="Timeout"]=2021,D[A[2011]="TokenExpired"]=2011,D[A[2022]="KickOut"]=2022,D[A[2023]="EndPk"]=2023,D[A[2024]="EndLive"]=2024,D})(),F.UserBehavior=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.type=0,A.prototype.behavior=!1,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&T.uint32(8).int32(i.type),i.behavior!=null&&Object.hasOwnProperty.call(i,"behavior")&&T.uint32(16).bool(i.behavior),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UserBehavior;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.type=i.int32();break}case 2:{j.behavior=i.bool();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return i.behavior!=null&&i.hasOwnProperty("behavior")&&typeof i.behavior!="boolean"?"behavior: boolean expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserBehavior)return i;let T=new $root.com.quick.voice.proto.UserBehavior;switch(i.type){default:if(typeof i.type=="number"){T.type=i.type;break}break;case"Microphone":case 0:T.type=0;break;case"Camera":case 1:T.type=1;break;case"Screen":case 2:T.type=2;break;case"SystemVoice":case 3:T.type=3;break}return i.behavior!=null&&(T.behavior=!!i.behavior),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.type=T.enums===String?"Microphone":0,C.behavior=!1),i.type!=null&&i.hasOwnProperty("type")&&(C.type=T.enums===String?$root.com.quick.voice.proto.TrackType[i.type]===void 0?i.type:$root.com.quick.voice.proto.TrackType[i.type]:i.type),i.behavior!=null&&i.hasOwnProperty("behavior")&&(C.behavior=i.behavior),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserBehavior"},A})(),F.PreventUser=(function(){function A(D){if(this.behaviors=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.id="",A.prototype.behaviors=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.id!=null&&Object.hasOwnProperty.call(i,"id")&&T.uint32(10).string(i.id),i.behaviors!=null&&i.behaviors.length)for(let C=0;C<i.behaviors.length;++C)$root.com.quick.voice.proto.UserBehavior.encode(i.behaviors[C],T.uint32(18).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.PreventUser;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.id=i.string();break}case 2:{j.behaviors&&j.behaviors.length||(j.behaviors=[]),j.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.id!=null&&i.hasOwnProperty("id")&&!$util.isString(i.id))return"id: string expected";if(i.behaviors!=null&&i.hasOwnProperty("behaviors")){if(!Array.isArray(i.behaviors))return"behaviors: array expected";for(let T=0;T<i.behaviors.length;++T){let C=$root.com.quick.voice.proto.UserBehavior.verify(i.behaviors[T]);if(C)return"behaviors."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUser)return i;let T=new $root.com.quick.voice.proto.PreventUser;if(i.id!=null&&(T.id=String(i.id)),i.behaviors){if(!Array.isArray(i.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");T.behaviors=[];for(let C=0;C<i.behaviors.length;++C){if(typeof i.behaviors[C]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");T.behaviors[C]=$root.com.quick.voice.proto.UserBehavior.fromObject(i.behaviors[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.behaviors=[]),T.defaults&&(C.id=""),i.id!=null&&i.hasOwnProperty("id")&&(C.id=i.id),i.behaviors&&i.behaviors.length){C.behaviors=[];for(let U=0;U<i.behaviors.length;++U)C.behaviors[U]=$root.com.quick.voice.proto.UserBehavior.toObject(i.behaviors[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUser"},A})(),F.PreventUsersBehaviorReq=(function(){function A(D){if(this.users=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.users=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let C=0;C<i.users.length;++C)$root.com.quick.voice.proto.PreventUser.encode(i.users[C],T.uint32(18).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.users&&j.users.length||(j.users=[]),j.users.push($root.com.quick.voice.proto.PreventUser.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let T=0;T<i.users.length;++T){let C=$root.com.quick.voice.proto.PreventUser.verify(i.users[T]);if(C)return"users."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return i;let T=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");T.users=[];for(let C=0;C<i.users.length;++C){if(typeof i.users[C]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");T.users[C]=$root.com.quick.voice.proto.PreventUser.fromObject(i.users[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.users=[]),T.defaults&&(C.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.users&&i.users.length){C.users=[];for(let U=0;U<i.users.length;++U)C.users[U]=$root.com.quick.voice.proto.PreventUser.toObject(i.users[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorReq"},A})(),F.PreventUsersBehaviorNotify=(function(){function A(D){if(this.users=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.users=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let C=0;C<i.users.length;++C)$root.com.quick.voice.proto.User.encode(i.users[C],T.uint32(18).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.users&&j.users.length||(j.users=[]),j.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let T=0;T<i.users.length;++T){let C=$root.com.quick.voice.proto.User.verify(i.users[T]);if(C)return"users."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return i;let T=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");T.users=[];for(let C=0;C<i.users.length;++C){if(typeof i.users[C]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");T.users[C]=$root.com.quick.voice.proto.User.fromObject(i.users[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.users=[]),T.defaults&&(C.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.users&&i.users.length){C.users=[];for(let U=0;U<i.users.length;++U)C.users[U]=$root.com.quick.voice.proto.User.toObject(i.users[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},A})(),F.AccelerationAreas=(function(){const A={},D=Object.create(A);return D[A[0]="chinaMainland"]=0,D[A[1]="global"]=1,D[A[2]="overseas"]=2,D})(),F.CountMethods=(function(){const A={},D=Object.create(A);return D[A[0]="flow"]=0,D[A[1]="minutes"]=1,D})(),F.BaseCDNAddress=(function(){function A(D){if(this.urlMap={},D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.area=0,A.prototype.countType=0,A.prototype.urlMap=$util.emptyObject,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.area!=null&&Object.hasOwnProperty.call(i,"area")&&T.uint32(8).int32(i.area),i.countType!=null&&Object.hasOwnProperty.call(i,"countType")&&T.uint32(16).int32(i.countType),i.urlMap!=null&&Object.hasOwnProperty.call(i,"urlMap"))for(let C=Object.keys(i.urlMap),U=0;U<C.length;++U)T.uint32(26).fork().uint32(10).string(C[U]).uint32(18).string(i.urlMap[C[U]]).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.BaseCDNAddress,z,K;for(;i.pos<U;){let Y=i.uint32();if(Y===C)break;switch(Y>>>3){case 1:{j.area=i.int32();break}case 2:{j.countType=i.int32();break}case 3:{j.urlMap===$util.emptyObject&&(j.urlMap={});let te=i.uint32()+i.pos;for(z="",K="";i.pos<te;){let ae=i.uint32();switch(ae>>>3){case 1:z=i.string();break;case 2:K=i.string();break;default:i.skipType(ae&7);break}}j.urlMap[z]=K;break}default:i.skipType(Y&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.area!=null&&i.hasOwnProperty("area"))switch(i.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(i.countType!=null&&i.hasOwnProperty("countType"))switch(i.countType){default:return"countType: enum value expected";case 0:case 1:break}if(i.urlMap!=null&&i.hasOwnProperty("urlMap")){if(!$util.isObject(i.urlMap))return"urlMap: object expected";let T=Object.keys(i.urlMap);for(let C=0;C<T.length;++C)if(!$util.isString(i.urlMap[T[C]]))return"urlMap: string{k:string} expected"}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.BaseCDNAddress)return i;let T=new $root.com.quick.voice.proto.BaseCDNAddress;switch(i.area){default:if(typeof i.area=="number"){T.area=i.area;break}break;case"chinaMainland":case 0:T.area=0;break;case"global":case 1:T.area=1;break;case"overseas":case 2:T.area=2;break}switch(i.countType){default:if(typeof i.countType=="number"){T.countType=i.countType;break}break;case"flow":case 0:T.countType=0;break;case"minutes":case 1:T.countType=1;break}if(i.urlMap){if(typeof i.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");T.urlMap={};for(let C=Object.keys(i.urlMap),U=0;U<C.length;++U)T.urlMap[C[U]]=String(i.urlMap[C[U]])}return T},A.toObject=function(i,T){T||(T={});let C={};(T.objects||T.defaults)&&(C.urlMap={}),T.defaults&&(C.area=T.enums===String?"chinaMainland":0,C.countType=T.enums===String?"flow":0),i.area!=null&&i.hasOwnProperty("area")&&(C.area=T.enums===String?$root.com.quick.voice.proto.AccelerationAreas[i.area]===void 0?i.area:$root.com.quick.voice.proto.AccelerationAreas[i.area]:i.area),i.countType!=null&&i.hasOwnProperty("countType")&&(C.countType=T.enums===String?$root.com.quick.voice.proto.CountMethods[i.countType]===void 0?i.countType:$root.com.quick.voice.proto.CountMethods[i.countType]:i.countType);let U;if(i.urlMap&&(U=Object.keys(i.urlMap)).length){C.urlMap={};for(let j=0;j<U.length;++j)C.urlMap[U[j]]=i.urlMap[U[j]]}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.BaseCDNAddress"},A})(),F.CDNPlayAddressNotify=(function(){function A(i){if(this.standLines=[],i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.roomId="",A.prototype.m3u8=null,A.prototype.rtmp=null,A.prototype.flv=null,A.prototype.rtmps=null,A.prototype.mainLine=null,A.prototype.standLines=$util.emptyArray;let D;return Object.defineProperty(A.prototype,"_m3u8",{get:$util.oneOfGetter(D=["m3u8"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_rtmp",{get:$util.oneOfGetter(D=["rtmp"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_flv",{get:$util.oneOfGetter(D=["flv"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_rtmps",{get:$util.oneOfGetter(D=["rtmps"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_mainLine",{get:$util.oneOfGetter(D=["mainLine"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){if(C||(C=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&C.uint32(10).string(T.roomId),T.m3u8!=null&&Object.hasOwnProperty.call(T,"m3u8")&&C.uint32(18).string(T.m3u8),T.rtmp!=null&&Object.hasOwnProperty.call(T,"rtmp")&&C.uint32(26).string(T.rtmp),T.flv!=null&&Object.hasOwnProperty.call(T,"flv")&&C.uint32(34).string(T.flv),T.rtmps!=null&&Object.hasOwnProperty.call(T,"rtmps")&&C.uint32(42).string(T.rtmps),T.mainLine!=null&&Object.hasOwnProperty.call(T,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(T.mainLine,C.uint32(50).fork()).ldelim(),T.standLines!=null&&T.standLines.length)for(let U=0;U<T.standLines.length;++U)$root.com.quick.voice.proto.BaseCDNAddress.encode(T.standLines[U],C.uint32(58).fork()).ldelim();return C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.m3u8=T.string();break}case 3:{z.rtmp=T.string();break}case 4:{z.flv=T.string();break}case 5:{z.rtmps=T.string();break}case 6:{z.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(T,T.uint32());break}case 7:{z.standLines&&z.standLines.length||(z.standLines=[]),z.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(T,T.uint32()));break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.m3u8!=null&&T.hasOwnProperty("m3u8")&&!$util.isString(T.m3u8))return"m3u8: string expected";if(T.rtmp!=null&&T.hasOwnProperty("rtmp")&&!$util.isString(T.rtmp))return"rtmp: string expected";if(T.flv!=null&&T.hasOwnProperty("flv")&&!$util.isString(T.flv))return"flv: string expected";if(T.rtmps!=null&&T.hasOwnProperty("rtmps")&&!$util.isString(T.rtmps))return"rtmps: string expected";if(T.mainLine!=null&&T.hasOwnProperty("mainLine")){let C=$root.com.quick.voice.proto.BaseCDNAddress.verify(T.mainLine);if(C)return"mainLine."+C}if(T.standLines!=null&&T.hasOwnProperty("standLines")){if(!Array.isArray(T.standLines))return"standLines: array expected";for(let C=0;C<T.standLines.length;++C){let U=$root.com.quick.voice.proto.BaseCDNAddress.verify(T.standLines[C]);if(U)return"standLines."+U}}return null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return T;let C=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(T.roomId!=null&&(C.roomId=String(T.roomId)),T.m3u8!=null&&(C.m3u8=String(T.m3u8)),T.rtmp!=null&&(C.rtmp=String(T.rtmp)),T.flv!=null&&(C.flv=String(T.flv)),T.rtmps!=null&&(C.rtmps=String(T.rtmps)),T.mainLine!=null){if(typeof T.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");C.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(T.mainLine)}if(T.standLines){if(!Array.isArray(T.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");C.standLines=[];for(let U=0;U<T.standLines.length;++U){if(typeof T.standLines[U]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");C.standLines[U]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(T.standLines[U])}}return C},A.toObject=function(T,C){C||(C={});let U={};if((C.arrays||C.defaults)&&(U.standLines=[]),C.defaults&&(U.roomId=""),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.m3u8!=null&&T.hasOwnProperty("m3u8")&&(U.m3u8=T.m3u8,C.oneofs&&(U._m3u8="m3u8")),T.rtmp!=null&&T.hasOwnProperty("rtmp")&&(U.rtmp=T.rtmp,C.oneofs&&(U._rtmp="rtmp")),T.flv!=null&&T.hasOwnProperty("flv")&&(U.flv=T.flv,C.oneofs&&(U._flv="flv")),T.rtmps!=null&&T.hasOwnProperty("rtmps")&&(U.rtmps=T.rtmps,C.oneofs&&(U._rtmps="rtmps")),T.mainLine!=null&&T.hasOwnProperty("mainLine")&&(U.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(T.mainLine,C),C.oneofs&&(U._mainLine="mainLine")),T.standLines&&T.standLines.length){U.standLines=[];for(let j=0;j<T.standLines.length;++j)U.standLines[j]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(T.standLines[j],C)}return U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.CDNPlayAddressNotify"},A})(),F.UserChannel=(function(){function A(D){if(this.channels=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.userId="",A.prototype.channels=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(10).string(i.userId),i.channels!=null&&i.channels.length)for(let C=0;C<i.channels.length;++C)$root.com.quick.voice.proto.DataChannel.encode(i.channels[C],T.uint32(18).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UserChannel;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.userId=i.string();break}case 2:{j.channels&&j.channels.length||(j.channels=[]),j.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId))return"userId: string expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let T=0;T<i.channels.length;++T){let C=$root.com.quick.voice.proto.DataChannel.verify(i.channels[T]);if(C)return"channels."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserChannel)return i;let T=new $root.com.quick.voice.proto.UserChannel;if(i.userId!=null&&(T.userId=String(i.userId)),i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");T.channels=[];for(let C=0;C<i.channels.length;++C){if(typeof i.channels[C]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");T.channels[C]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.channels=[]),T.defaults&&(C.userId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(C.userId=i.userId),i.channels&&i.channels.length){C.channels=[];for(let U=0;U<i.channels.length;++U)C.channels[U]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserChannel"},A})(),F.ChannelPublishReq=(function(){function A(D){if(this.channels=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.channels=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.channels!=null&&i.channels.length)for(let C=0;C<i.channels.length;++C)$root.com.quick.voice.proto.DataChannel.encode(i.channels[C],T.uint32(10).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ChannelPublishReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.channels&&j.channels.length||(j.channels=[]),j.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let T=0;T<i.channels.length;++T){let C=$root.com.quick.voice.proto.DataChannel.verify(i.channels[T]);if(C)return"channels."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishReq)return i;let T=new $root.com.quick.voice.proto.ChannelPublishReq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");T.channels=[];for(let C=0;C<i.channels.length;++C){if(typeof i.channels[C]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");T.channels[C]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.channels=[]),i.channels&&i.channels.length){C.channels=[];for(let U=0;U<i.channels.length;++U)C.channels[U]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishReq"},A})(),F.ChannelPublishRsq=(function(){function A(D){if(this.channels=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.channels=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.channels!=null&&i.channels.length)for(let C=0;C<i.channels.length;++C)$root.com.quick.voice.proto.UserChannel.encode(i.channels[C],T.uint32(10).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.channels&&j.channels.length||(j.channels=[]),j.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let T=0;T<i.channels.length;++T){let C=$root.com.quick.voice.proto.UserChannel.verify(i.channels[T]);if(C)return"channels."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return i;let T=new $root.com.quick.voice.proto.ChannelPublishRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");T.channels=[];for(let C=0;C<i.channels.length;++C){if(typeof i.channels[C]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");T.channels[C]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.channels=[]),i.channels&&i.channels.length){C.channels=[];for(let U=0;U<i.channels.length;++U)C.channels[U]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishRsq"},A})(),F.ChannelSubscribeReq=(function(){function A(D){if(this.users=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.users=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.users!=null&&i.users.length)for(let C=0;C<i.users.length;++C)$root.com.quick.voice.proto.UserChannel.encode(i.users[C],T.uint32(10).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.users&&j.users.length||(j.users=[]),j.users.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let T=0;T<i.users.length;++T){let C=$root.com.quick.voice.proto.UserChannel.verify(i.users[T]);if(C)return"users."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return i;let T=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");T.users=[];for(let C=0;C<i.users.length;++C){if(typeof i.users[C]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");T.users[C]=$root.com.quick.voice.proto.UserChannel.fromObject(i.users[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.users=[]),i.users&&i.users.length){C.users=[];for(let U=0;U<i.users.length;++U)C.users[U]=$root.com.quick.voice.proto.UserChannel.toObject(i.users[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeReq"},A})(),F.ChannelSubscribeRsq=(function(){function A(D){if(this.channels=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.channels=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.channels!=null&&i.channels.length)for(let C=0;C<i.channels.length;++C)$root.com.quick.voice.proto.UserChannel.encode(i.channels[C],T.uint32(10).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.channels&&j.channels.length||(j.channels=[]),j.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let T=0;T<i.channels.length;++T){let C=$root.com.quick.voice.proto.UserChannel.verify(i.channels[T]);if(C)return"channels."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return i;let T=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");T.channels=[];for(let C=0;C<i.channels.length;++C){if(typeof i.channels[C]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");T.channels[C]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.channels=[]),i.channels&&i.channels.length){C.channels=[];for(let U=0;U<i.channels.length;++U)C.channels[U]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeRsq"},A})(),F.DataChannelData=(function(){function A(i){if(i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.userId="",A.prototype.type=0,A.prototype.audioData=null;let D;return Object.defineProperty(A.prototype,"_audioData",{get:$util.oneOfGetter(D=["audioData"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){return C||(C=$Writer.create()),T.userId!=null&&Object.hasOwnProperty.call(T,"userId")&&C.uint32(10).string(T.userId),T.type!=null&&Object.hasOwnProperty.call(T,"type")&&C.uint32(16).int32(T.type),T.audioData!=null&&Object.hasOwnProperty.call(T,"audioData")&&$root.com.quick.voice.proto.DataChannelAudioData.encode(T.audioData,C.uint32(26).fork()).ldelim(),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.DataChannelData;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.userId=T.string();break}case 2:{z.type=T.int32();break}case 3:{z.audioData=$root.com.quick.voice.proto.DataChannelAudioData.decode(T,T.uint32());break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.userId!=null&&T.hasOwnProperty("userId")&&!$util.isString(T.userId))return"userId: string expected";if(T.type!=null&&T.hasOwnProperty("type"))switch(T.type){default:return"type: enum value expected";case 0:break}if(T.audioData!=null&&T.hasOwnProperty("audioData")){let C=$root.com.quick.voice.proto.DataChannelAudioData.verify(T.audioData);if(C)return"audioData."+C}return null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.DataChannelData)return T;let C=new $root.com.quick.voice.proto.DataChannelData;switch(T.userId!=null&&(C.userId=String(T.userId)),T.type){default:if(typeof T.type=="number"){C.type=T.type;break}break;case"backAuido":case 0:C.type=0;break}if(T.audioData!=null){if(typeof T.audioData!="object")throw TypeError(".com.quick.voice.proto.DataChannelData.audioData: object expected");C.audioData=$root.com.quick.voice.proto.DataChannelAudioData.fromObject(T.audioData)}return C},A.toObject=function(T,C){C||(C={});let U={};return C.defaults&&(U.userId="",U.type=C.enums===String?"backAuido":0),T.userId!=null&&T.hasOwnProperty("userId")&&(U.userId=T.userId),T.type!=null&&T.hasOwnProperty("type")&&(U.type=C.enums===String?$root.com.quick.voice.proto.DataChannelType[T.type]===void 0?T.type:$root.com.quick.voice.proto.DataChannelType[T.type]:T.type),T.audioData!=null&&T.hasOwnProperty("audioData")&&(U.audioData=$root.com.quick.voice.proto.DataChannelAudioData.toObject(T.audioData,C),C.oneofs&&(U._audioData="audioData")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.DataChannelData"},A})(),F.DataChannelType=(function(){const A={},D=Object.create(A);return D[A[0]="backAuido"]=0,D})(),F.DataChannelAudioData=(function(){function A(i){if(i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.data=$util.newBuffer([]),A.prototype.format=null,A.prototype.time=null;let D;return Object.defineProperty(A.prototype,"_time",{get:$util.oneOfGetter(D=["time"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){return C||(C=$Writer.create()),T.data!=null&&Object.hasOwnProperty.call(T,"data")&&C.uint32(10).bytes(T.data),T.format!=null&&Object.hasOwnProperty.call(T,"format")&&$root.com.quick.voice.proto.DataChannelAudioFormat.encode(T.format,C.uint32(18).fork()).ldelim(),T.time!=null&&Object.hasOwnProperty.call(T,"time")&&C.uint32(24).int64(T.time),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.DataChannelAudioData;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.data=T.bytes();break}case 2:{z.format=$root.com.quick.voice.proto.DataChannelAudioFormat.decode(T,T.uint32());break}case 3:{z.time=T.int64();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.data!=null&&T.hasOwnProperty("data")&&!(T.data&&typeof T.data.length=="number"||$util.isString(T.data)))return"data: buffer expected";if(T.format!=null&&T.hasOwnProperty("format")){let C=$root.com.quick.voice.proto.DataChannelAudioFormat.verify(T.format);if(C)return"format."+C}return T.time!=null&&T.hasOwnProperty("time")&&!$util.isInteger(T.time)&&!(T.time&&$util.isInteger(T.time.low)&&$util.isInteger(T.time.high))?"time: integer|Long expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.DataChannelAudioData)return T;let C=new $root.com.quick.voice.proto.DataChannelAudioData;if(T.data!=null&&(typeof T.data=="string"?$util.base64.decode(T.data,C.data=$util.newBuffer($util.base64.length(T.data)),0):T.data.length>=0&&(C.data=T.data)),T.format!=null){if(typeof T.format!="object")throw TypeError(".com.quick.voice.proto.DataChannelAudioData.format: object expected");C.format=$root.com.quick.voice.proto.DataChannelAudioFormat.fromObject(T.format)}return T.time!=null&&($util.Long?(C.time=$util.Long.fromValue(T.time)).unsigned=!1:typeof T.time=="string"?C.time=parseInt(T.time,10):typeof T.time=="number"?C.time=T.time:typeof T.time=="object"&&(C.time=new $util.LongBits(T.time.low>>>0,T.time.high>>>0).toNumber())),C},A.toObject=function(T,C){C||(C={});let U={};return C.defaults&&(C.bytes===String?U.data="":(U.data=[],C.bytes!==Array&&(U.data=$util.newBuffer(U.data))),U.format=null),T.data!=null&&T.hasOwnProperty("data")&&(U.data=C.bytes===String?$util.base64.encode(T.data,0,T.data.length):C.bytes===Array?Array.prototype.slice.call(T.data):T.data),T.format!=null&&T.hasOwnProperty("format")&&(U.format=$root.com.quick.voice.proto.DataChannelAudioFormat.toObject(T.format,C)),T.time!=null&&T.hasOwnProperty("time")&&(typeof T.time=="number"?U.time=C.longs===String?String(T.time):T.time:U.time=C.longs===String?$util.Long.prototype.toString.call(T.time):C.longs===Number?new $util.LongBits(T.time.low>>>0,T.time.high>>>0).toNumber():T.time,C.oneofs&&(U._time="time")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.DataChannelAudioData"},A})(),F.DataChannelAudioFormat=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.sampleRate=0,A.prototype.channels=0,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.sampleRate!=null&&Object.hasOwnProperty.call(i,"sampleRate")&&T.uint32(9).double(i.sampleRate),i.channels!=null&&Object.hasOwnProperty.call(i,"channels")&&T.uint32(16).int32(i.channels),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.DataChannelAudioFormat;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.sampleRate=i.double();break}case 2:{j.channels=i.int32();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&typeof i.sampleRate!="number"?"sampleRate: number expected":i.channels!=null&&i.hasOwnProperty("channels")&&!$util.isInteger(i.channels)?"channels: integer expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelAudioFormat)return i;let T=new $root.com.quick.voice.proto.DataChannelAudioFormat;return i.sampleRate!=null&&(T.sampleRate=Number(i.sampleRate)),i.channels!=null&&(T.channels=i.channels|0),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.sampleRate=0,C.channels=0),i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&(C.sampleRate=T.json&&!isFinite(i.sampleRate)?String(i.sampleRate):i.sampleRate),i.channels!=null&&i.hasOwnProperty("channels")&&(C.channels=i.channels),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelAudioFormat"},A})(),F.AckMsgReq=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.msgId=$util.Long?$util.Long.fromBits(0,0,!1):0,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.msgId!=null&&Object.hasOwnProperty.call(i,"msgId")&&T.uint32(8).int64(i.msgId),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.AckMsgReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.msgId=i.int64();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.msgId!=null&&i.hasOwnProperty("msgId")&&!$util.isInteger(i.msgId)&&!(i.msgId&&$util.isInteger(i.msgId.low)&&$util.isInteger(i.msgId.high))?"msgId: integer|Long expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.AckMsgReq)return i;let T=new $root.com.quick.voice.proto.AckMsgReq;return i.msgId!=null&&($util.Long?(T.msgId=$util.Long.fromValue(i.msgId)).unsigned=!1:typeof i.msgId=="string"?T.msgId=parseInt(i.msgId,10):typeof i.msgId=="number"?T.msgId=i.msgId:typeof i.msgId=="object"&&(T.msgId=new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber())),T},A.toObject=function(i,T){T||(T={});let C={};if(T.defaults)if($util.Long){let U=new $util.Long(0,0,!1);C.msgId=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else C.msgId=T.longs===String?"0":0;return i.msgId!=null&&i.hasOwnProperty("msgId")&&(typeof i.msgId=="number"?C.msgId=T.longs===String?String(i.msgId):i.msgId:C.msgId=T.longs===String?$util.Long.prototype.toString.call(i.msgId):T.longs===Number?new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber():i.msgId),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.AckMsgReq"},A})(),F.SdpConsult=(function(){function A(i){if(this.tracks=[],i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.roomId="",A.prototype.sender=null,A.prototype.receiverId="",A.prototype.sdp="",A.prototype.tracks=$util.emptyArray;let D;return Object.defineProperty(A.prototype,"_sender",{get:$util.oneOfGetter(D=["sender"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){if(C||(C=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&C.uint32(10).string(T.roomId),T.sender!=null&&Object.hasOwnProperty.call(T,"sender")&&$root.com.quick.voice.proto.User.encode(T.sender,C.uint32(18).fork()).ldelim(),T.receiverId!=null&&Object.hasOwnProperty.call(T,"receiverId")&&C.uint32(26).string(T.receiverId),T.sdp!=null&&Object.hasOwnProperty.call(T,"sdp")&&C.uint32(34).string(T.sdp),T.tracks!=null&&T.tracks.length)for(let U=0;U<T.tracks.length;++U)$root.com.quick.voice.proto.Track.encode(T.tracks[U],C.uint32(42).fork()).ldelim();return C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.SdpConsult;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.sender=$root.com.quick.voice.proto.User.decode(T,T.uint32());break}case 3:{z.receiverId=T.string();break}case 4:{z.sdp=T.string();break}case 5:{z.tracks&&z.tracks.length||(z.tracks=[]),z.tracks.push($root.com.quick.voice.proto.Track.decode(T,T.uint32()));break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.sender!=null&&T.hasOwnProperty("sender")){let C=$root.com.quick.voice.proto.User.verify(T.sender);if(C)return"sender."+C}if(T.receiverId!=null&&T.hasOwnProperty("receiverId")&&!$util.isString(T.receiverId))return"receiverId: string expected";if(T.sdp!=null&&T.hasOwnProperty("sdp")&&!$util.isString(T.sdp))return"sdp: string expected";if(T.tracks!=null&&T.hasOwnProperty("tracks")){if(!Array.isArray(T.tracks))return"tracks: array expected";for(let C=0;C<T.tracks.length;++C){let U=$root.com.quick.voice.proto.Track.verify(T.tracks[C]);if(U)return"tracks."+U}}return null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.SdpConsult)return T;let C=new $root.com.quick.voice.proto.SdpConsult;if(T.roomId!=null&&(C.roomId=String(T.roomId)),T.sender!=null){if(typeof T.sender!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.sender: object expected");C.sender=$root.com.quick.voice.proto.User.fromObject(T.sender)}if(T.receiverId!=null&&(C.receiverId=String(T.receiverId)),T.sdp!=null&&(C.sdp=String(T.sdp)),T.tracks){if(!Array.isArray(T.tracks))throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: array expected");C.tracks=[];for(let U=0;U<T.tracks.length;++U){if(typeof T.tracks[U]!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: object expected");C.tracks[U]=$root.com.quick.voice.proto.Track.fromObject(T.tracks[U])}}return C},A.toObject=function(T,C){C||(C={});let U={};if((C.arrays||C.defaults)&&(U.tracks=[]),C.defaults&&(U.roomId="",U.receiverId="",U.sdp=""),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.sender!=null&&T.hasOwnProperty("sender")&&(U.sender=$root.com.quick.voice.proto.User.toObject(T.sender,C),C.oneofs&&(U._sender="sender")),T.receiverId!=null&&T.hasOwnProperty("receiverId")&&(U.receiverId=T.receiverId),T.sdp!=null&&T.hasOwnProperty("sdp")&&(U.sdp=T.sdp),T.tracks&&T.tracks.length){U.tracks=[];for(let j=0;j<T.tracks.length;++j)U.tracks[j]=$root.com.quick.voice.proto.Track.toObject(T.tracks[j],C)}return U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.SdpConsult"},A})(),F.Candidate=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.sdpMid="",A.prototype.sdpMLineIndex=0,A.prototype.sdp="",A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.sdpMid!=null&&Object.hasOwnProperty.call(i,"sdpMid")&&T.uint32(10).string(i.sdpMid),i.sdpMLineIndex!=null&&Object.hasOwnProperty.call(i,"sdpMLineIndex")&&T.uint32(16).int32(i.sdpMLineIndex),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&T.uint32(26).string(i.sdp),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.Candidate;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.sdpMid=i.string();break}case 2:{j.sdpMLineIndex=i.int32();break}case 3:{j.sdp=i.string();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sdpMid!=null&&i.hasOwnProperty("sdpMid")&&!$util.isString(i.sdpMid)?"sdpMid: string expected":i.sdpMLineIndex!=null&&i.hasOwnProperty("sdpMLineIndex")&&!$util.isInteger(i.sdpMLineIndex)?"sdpMLineIndex: integer expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidate)return i;let T=new $root.com.quick.voice.proto.Candidate;return i.sdpMid!=null&&(T.sdpMid=String(i.sdpMid)),i.sdpMLineIndex!=null&&(T.sdpMLineIndex=i.sdpMLineIndex|0),i.sdp!=null&&(T.sdp=String(i.sdp)),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.sdpMid="",C.sdpMLineIndex=0,C.sdp=""),i.sdpMid!=null&&i.hasOwnProperty("sdpMid")&&(C.sdpMid=i.sdpMid),i.sdpMLineIndex!=null&&i.hasOwnProperty("sdpMLineIndex")&&(C.sdpMLineIndex=i.sdpMLineIndex),i.sdp!=null&&i.hasOwnProperty("sdp")&&(C.sdp=i.sdp),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidate"},A})(),F.Candidates=(function(){function A(D){if(this.candidates=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.senderId="",A.prototype.receiverId="",A.prototype.candidates=$util.emptyArray,A.prototype.isSubscribeReceiver=!1,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.senderId!=null&&Object.hasOwnProperty.call(i,"senderId")&&T.uint32(18).string(i.senderId),i.receiverId!=null&&Object.hasOwnProperty.call(i,"receiverId")&&T.uint32(26).string(i.receiverId),i.candidates!=null&&i.candidates.length)for(let C=0;C<i.candidates.length;++C)$root.com.quick.voice.proto.Candidate.encode(i.candidates[C],T.uint32(34).fork()).ldelim();return i.isSubscribeReceiver!=null&&Object.hasOwnProperty.call(i,"isSubscribeReceiver")&&T.uint32(40).bool(i.isSubscribeReceiver),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.Candidates;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.senderId=i.string();break}case 3:{j.receiverId=i.string();break}case 4:{j.candidates&&j.candidates.length||(j.candidates=[]),j.candidates.push($root.com.quick.voice.proto.Candidate.decode(i,i.uint32()));break}case 5:{j.isSubscribeReceiver=i.bool();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.senderId!=null&&i.hasOwnProperty("senderId")&&!$util.isString(i.senderId))return"senderId: string expected";if(i.receiverId!=null&&i.hasOwnProperty("receiverId")&&!$util.isString(i.receiverId))return"receiverId: string expected";if(i.candidates!=null&&i.hasOwnProperty("candidates")){if(!Array.isArray(i.candidates))return"candidates: array expected";for(let T=0;T<i.candidates.length;++T){let C=$root.com.quick.voice.proto.Candidate.verify(i.candidates[T]);if(C)return"candidates."+C}}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&typeof i.isSubscribeReceiver!="boolean"?"isSubscribeReceiver: boolean expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidates)return i;let T=new $root.com.quick.voice.proto.Candidates;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.senderId!=null&&(T.senderId=String(i.senderId)),i.receiverId!=null&&(T.receiverId=String(i.receiverId)),i.candidates){if(!Array.isArray(i.candidates))throw TypeError(".com.quick.voice.proto.Candidates.candidates: array expected");T.candidates=[];for(let C=0;C<i.candidates.length;++C){if(typeof i.candidates[C]!="object")throw TypeError(".com.quick.voice.proto.Candidates.candidates: object expected");T.candidates[C]=$root.com.quick.voice.proto.Candidate.fromObject(i.candidates[C])}}return i.isSubscribeReceiver!=null&&(T.isSubscribeReceiver=!!i.isSubscribeReceiver),T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.candidates=[]),T.defaults&&(C.roomId="",C.senderId="",C.receiverId="",C.isSubscribeReceiver=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.senderId!=null&&i.hasOwnProperty("senderId")&&(C.senderId=i.senderId),i.receiverId!=null&&i.hasOwnProperty("receiverId")&&(C.receiverId=i.receiverId),i.candidates&&i.candidates.length){C.candidates=[];for(let U=0;U<i.candidates.length;++U)C.candidates[U]=$root.com.quick.voice.proto.Candidate.toObject(i.candidates[U],T)}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&(C.isSubscribeReceiver=i.isSubscribeReceiver),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidates"},A})(),F.NatType=(function(){const A={},D=Object.create(A);return D[A[0]="Symmetric"]=0,D[A[1]="Cone"]=1,D[A[2]="Port"]=2,D[A[3]="IP"]=3,D[A[4]="UnKnown"]=4,D})(),F.NetworkType=(function(){const A={},D=Object.create(A);return D[A[0]="Wifi"]=0,D[A[1]="Wired"]=1,D[A[2]="Mobile"]=2,D})(),F.ReportNetInfo=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.nat=0,A.prototype.type=0,A.prototype.ip="",A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.nat!=null&&Object.hasOwnProperty.call(i,"nat")&&T.uint32(8).int32(i.nat),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&T.uint32(16).int32(i.type),i.ip!=null&&Object.hasOwnProperty.call(i,"ip")&&T.uint32(26).string(i.ip),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ReportNetInfo;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.nat=i.int32();break}case 2:{j.type=i.int32();break}case 3:{j.ip=i.string();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.nat!=null&&i.hasOwnProperty("nat"))switch(i.nat){default:return"nat: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:break}return i.ip!=null&&i.hasOwnProperty("ip")&&!$util.isString(i.ip)?"ip: string expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ReportNetInfo)return i;let T=new $root.com.quick.voice.proto.ReportNetInfo;switch(i.nat){default:if(typeof i.nat=="number"){T.nat=i.nat;break}break;case"Symmetric":case 0:T.nat=0;break;case"Cone":case 1:T.nat=1;break;case"Port":case 2:T.nat=2;break;case"IP":case 3:T.nat=3;break;case"UnKnown":case 4:T.nat=4;break}switch(i.type){default:if(typeof i.type=="number"){T.type=i.type;break}break;case"Wifi":case 0:T.type=0;break;case"Wired":case 1:T.type=1;break;case"Mobile":case 2:T.type=2;break}return i.ip!=null&&(T.ip=String(i.ip)),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.nat=T.enums===String?"Symmetric":0,C.type=T.enums===String?"Wifi":0,C.ip=""),i.nat!=null&&i.hasOwnProperty("nat")&&(C.nat=T.enums===String?$root.com.quick.voice.proto.NatType[i.nat]===void 0?i.nat:$root.com.quick.voice.proto.NatType[i.nat]:i.nat),i.type!=null&&i.hasOwnProperty("type")&&(C.type=T.enums===String?$root.com.quick.voice.proto.NetworkType[i.type]===void 0?i.type:$root.com.quick.voice.proto.NetworkType[i.type]:i.type),i.ip!=null&&i.hasOwnProperty("ip")&&(C.ip=i.ip),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ReportNetInfo"},A})(),F.P2PCode=(function(){const A={},D=Object.create(A);return D[A[0]="Success"]=0,D[A[1]="Failed"]=1,D[A[2]="Ignore"]=2,D[A[3]="Disconnected"]=3,D[A[4]="LowQuality"]=4,D})(),F.ReportTrafficUsage=(function(){function A(i){if(i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.p2pPush=null,A.prototype.p2pPull=null,A.prototype.sfuPush=null,A.prototype.sfuPull=null;let D;return Object.defineProperty(A.prototype,"_p2pPush",{get:$util.oneOfGetter(D=["p2pPush"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_p2pPull",{get:$util.oneOfGetter(D=["p2pPull"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_sfuPush",{get:$util.oneOfGetter(D=["sfuPush"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_sfuPull",{get:$util.oneOfGetter(D=["sfuPull"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){return C||(C=$Writer.create()),T.p2pPush!=null&&Object.hasOwnProperty.call(T,"p2pPush")&&C.uint32(8).int64(T.p2pPush),T.p2pPull!=null&&Object.hasOwnProperty.call(T,"p2pPull")&&C.uint32(16).int64(T.p2pPull),T.sfuPush!=null&&Object.hasOwnProperty.call(T,"sfuPush")&&C.uint32(24).int64(T.sfuPush),T.sfuPull!=null&&Object.hasOwnProperty.call(T,"sfuPull")&&C.uint32(32).int64(T.sfuPull),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.ReportTrafficUsage;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.p2pPush=T.int64();break}case 2:{z.p2pPull=T.int64();break}case 3:{z.sfuPush=T.int64();break}case 4:{z.sfuPull=T.int64();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){return typeof T!="object"||T===null?"object expected":T.p2pPush!=null&&T.hasOwnProperty("p2pPush")&&!$util.isInteger(T.p2pPush)&&!(T.p2pPush&&$util.isInteger(T.p2pPush.low)&&$util.isInteger(T.p2pPush.high))?"p2pPush: integer|Long expected":T.p2pPull!=null&&T.hasOwnProperty("p2pPull")&&!$util.isInteger(T.p2pPull)&&!(T.p2pPull&&$util.isInteger(T.p2pPull.low)&&$util.isInteger(T.p2pPull.high))?"p2pPull: integer|Long expected":T.sfuPush!=null&&T.hasOwnProperty("sfuPush")&&!$util.isInteger(T.sfuPush)&&!(T.sfuPush&&$util.isInteger(T.sfuPush.low)&&$util.isInteger(T.sfuPush.high))?"sfuPush: integer|Long expected":T.sfuPull!=null&&T.hasOwnProperty("sfuPull")&&!$util.isInteger(T.sfuPull)&&!(T.sfuPull&&$util.isInteger(T.sfuPull.low)&&$util.isInteger(T.sfuPull.high))?"sfuPull: integer|Long expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.ReportTrafficUsage)return T;let C=new $root.com.quick.voice.proto.ReportTrafficUsage;return T.p2pPush!=null&&($util.Long?(C.p2pPush=$util.Long.fromValue(T.p2pPush)).unsigned=!1:typeof T.p2pPush=="string"?C.p2pPush=parseInt(T.p2pPush,10):typeof T.p2pPush=="number"?C.p2pPush=T.p2pPush:typeof T.p2pPush=="object"&&(C.p2pPush=new $util.LongBits(T.p2pPush.low>>>0,T.p2pPush.high>>>0).toNumber())),T.p2pPull!=null&&($util.Long?(C.p2pPull=$util.Long.fromValue(T.p2pPull)).unsigned=!1:typeof T.p2pPull=="string"?C.p2pPull=parseInt(T.p2pPull,10):typeof T.p2pPull=="number"?C.p2pPull=T.p2pPull:typeof T.p2pPull=="object"&&(C.p2pPull=new $util.LongBits(T.p2pPull.low>>>0,T.p2pPull.high>>>0).toNumber())),T.sfuPush!=null&&($util.Long?(C.sfuPush=$util.Long.fromValue(T.sfuPush)).unsigned=!1:typeof T.sfuPush=="string"?C.sfuPush=parseInt(T.sfuPush,10):typeof T.sfuPush=="number"?C.sfuPush=T.sfuPush:typeof T.sfuPush=="object"&&(C.sfuPush=new $util.LongBits(T.sfuPush.low>>>0,T.sfuPush.high>>>0).toNumber())),T.sfuPull!=null&&($util.Long?(C.sfuPull=$util.Long.fromValue(T.sfuPull)).unsigned=!1:typeof T.sfuPull=="string"?C.sfuPull=parseInt(T.sfuPull,10):typeof T.sfuPull=="number"?C.sfuPull=T.sfuPull:typeof T.sfuPull=="object"&&(C.sfuPull=new $util.LongBits(T.sfuPull.low>>>0,T.sfuPull.high>>>0).toNumber())),C},A.toObject=function(T,C){C||(C={});let U={};return T.p2pPush!=null&&T.hasOwnProperty("p2pPush")&&(typeof T.p2pPush=="number"?U.p2pPush=C.longs===String?String(T.p2pPush):T.p2pPush:U.p2pPush=C.longs===String?$util.Long.prototype.toString.call(T.p2pPush):C.longs===Number?new $util.LongBits(T.p2pPush.low>>>0,T.p2pPush.high>>>0).toNumber():T.p2pPush,C.oneofs&&(U._p2pPush="p2pPush")),T.p2pPull!=null&&T.hasOwnProperty("p2pPull")&&(typeof T.p2pPull=="number"?U.p2pPull=C.longs===String?String(T.p2pPull):T.p2pPull:U.p2pPull=C.longs===String?$util.Long.prototype.toString.call(T.p2pPull):C.longs===Number?new $util.LongBits(T.p2pPull.low>>>0,T.p2pPull.high>>>0).toNumber():T.p2pPull,C.oneofs&&(U._p2pPull="p2pPull")),T.sfuPush!=null&&T.hasOwnProperty("sfuPush")&&(typeof T.sfuPush=="number"?U.sfuPush=C.longs===String?String(T.sfuPush):T.sfuPush:U.sfuPush=C.longs===String?$util.Long.prototype.toString.call(T.sfuPush):C.longs===Number?new $util.LongBits(T.sfuPush.low>>>0,T.sfuPush.high>>>0).toNumber():T.sfuPush,C.oneofs&&(U._sfuPush="sfuPush")),T.sfuPull!=null&&T.hasOwnProperty("sfuPull")&&(typeof T.sfuPull=="number"?U.sfuPull=C.longs===String?String(T.sfuPull):T.sfuPull:U.sfuPull=C.longs===String?$util.Long.prototype.toString.call(T.sfuPull):C.longs===Number?new $util.LongBits(T.sfuPull.low>>>0,T.sfuPull.high>>>0).toNumber():T.sfuPull,C.oneofs&&(U._sfuPull="sfuPull")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.ReportTrafficUsage"},A})(),F.CheckSessionReq=(function(){function A(D){if(this.tracks=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.session="",A.prototype.tracks=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.session!=null&&Object.hasOwnProperty.call(i,"session")&&T.uint32(10).string(i.session),i.tracks!=null&&i.tracks.length)for(let C=0;C<i.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(i.tracks[C],T.uint32(18).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CheckSessionReq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.session=i.string();break}case 2:{j.tracks&&j.tracks.length||(j.tracks=[]),j.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.session!=null&&i.hasOwnProperty("session")&&!$util.isString(i.session))return"session: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let T=0;T<i.tracks.length;++T){let C=$root.com.quick.voice.proto.Track.verify(i.tracks[T]);if(C)return"tracks."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CheckSessionReq)return i;let T=new $root.com.quick.voice.proto.CheckSessionReq;if(i.session!=null&&(T.session=String(i.session)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: array expected");T.tracks=[];for(let C=0;C<i.tracks.length;++C){if(typeof i.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: object expected");T.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.tracks=[]),T.defaults&&(C.session=""),i.session!=null&&i.hasOwnProperty("session")&&(C.session=i.session),i.tracks&&i.tracks.length){C.tracks=[];for(let U=0;U<i.tracks.length;++U)C.tracks[U]=$root.com.quick.voice.proto.Track.toObject(i.tracks[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CheckSessionReq"},A})(),F.CheckSessionRsq=(function(){function A(D){if(this.tracks=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.sessionIsValid=!1,A.prototype.tracks=$util.emptyArray,A.prototype.session="",A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.sessionIsValid!=null&&Object.hasOwnProperty.call(i,"sessionIsValid")&&T.uint32(8).bool(i.sessionIsValid),i.tracks!=null&&i.tracks.length)for(let C=0;C<i.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(i.tracks[C],T.uint32(18).fork()).ldelim();return i.session!=null&&Object.hasOwnProperty.call(i,"session")&&T.uint32(26).string(i.session),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CheckSessionRsq;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.sessionIsValid=i.bool();break}case 2:{j.tracks&&j.tracks.length||(j.tracks=[]),j.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{j.session=i.string();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.sessionIsValid!=null&&i.hasOwnProperty("sessionIsValid")&&typeof i.sessionIsValid!="boolean")return"sessionIsValid: boolean expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let T=0;T<i.tracks.length;++T){let C=$root.com.quick.voice.proto.Track.verify(i.tracks[T]);if(C)return"tracks."+C}}return i.session!=null&&i.hasOwnProperty("session")&&!$util.isString(i.session)?"session: string expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CheckSessionRsq)return i;let T=new $root.com.quick.voice.proto.CheckSessionRsq;if(i.sessionIsValid!=null&&(T.sessionIsValid=!!i.sessionIsValid),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: array expected");T.tracks=[];for(let C=0;C<i.tracks.length;++C){if(typeof i.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: object expected");T.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[C])}}return i.session!=null&&(T.session=String(i.session)),T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.tracks=[]),T.defaults&&(C.sessionIsValid=!1,C.session=""),i.sessionIsValid!=null&&i.hasOwnProperty("sessionIsValid")&&(C.sessionIsValid=i.sessionIsValid),i.tracks&&i.tracks.length){C.tracks=[];for(let U=0;U<i.tracks.length;++U)C.tracks[U]=$root.com.quick.voice.proto.Track.toObject(i.tracks[U],T)}return i.session!=null&&i.hasOwnProperty("session")&&(C.session=i.session),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CheckSessionRsq"},A})(),F.RoomSpeechNotify=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.userId="",A.prototype.text="",A.prototype.timestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(18).string(i.userId),i.text!=null&&Object.hasOwnProperty.call(i,"text")&&T.uint32(26).string(i.text),i.timestamp!=null&&Object.hasOwnProperty.call(i,"timestamp")&&T.uint32(32).int64(i.timestamp),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.RoomSpeechNotify;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.userId=i.string();break}case 3:{j.text=i.string();break}case 4:{j.timestamp=i.int64();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.text!=null&&i.hasOwnProperty("text")&&!$util.isString(i.text)?"text: string expected":i.timestamp!=null&&i.hasOwnProperty("timestamp")&&!$util.isInteger(i.timestamp)&&!(i.timestamp&&$util.isInteger(i.timestamp.low)&&$util.isInteger(i.timestamp.high))?"timestamp: integer|Long expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RoomSpeechNotify)return i;let T=new $root.com.quick.voice.proto.RoomSpeechNotify;return i.roomId!=null&&(T.roomId=String(i.roomId)),i.userId!=null&&(T.userId=String(i.userId)),i.text!=null&&(T.text=String(i.text)),i.timestamp!=null&&($util.Long?(T.timestamp=$util.Long.fromValue(i.timestamp)).unsigned=!1:typeof i.timestamp=="string"?T.timestamp=parseInt(i.timestamp,10):typeof i.timestamp=="number"?T.timestamp=i.timestamp:typeof i.timestamp=="object"&&(T.timestamp=new $util.LongBits(i.timestamp.low>>>0,i.timestamp.high>>>0).toNumber())),T},A.toObject=function(i,T){T||(T={});let C={};if(T.defaults)if(C.roomId="",C.userId="",C.text="",$util.Long){let U=new $util.Long(0,0,!1);C.timestamp=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else C.timestamp=T.longs===String?"0":0;return i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.userId!=null&&i.hasOwnProperty("userId")&&(C.userId=i.userId),i.text!=null&&i.hasOwnProperty("text")&&(C.text=i.text),i.timestamp!=null&&i.hasOwnProperty("timestamp")&&(typeof i.timestamp=="number"?C.timestamp=T.longs===String?String(i.timestamp):i.timestamp:C.timestamp=T.longs===String?$util.Long.prototype.toString.call(i.timestamp):T.longs===Number?new $util.LongBits(i.timestamp.low>>>0,i.timestamp.high>>>0).toNumber():i.timestamp),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RoomSpeechNotify"},A})(),F.AiLangSetting=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.input="",A.prototype.output="",A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.input!=null&&Object.hasOwnProperty.call(i,"input")&&T.uint32(10).string(i.input),i.output!=null&&Object.hasOwnProperty.call(i,"output")&&T.uint32(18).string(i.output),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.AiLangSetting;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.input=i.string();break}case 2:{j.output=i.string();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){return typeof i!="object"||i===null?"object expected":i.input!=null&&i.hasOwnProperty("input")&&!$util.isString(i.input)?"input: string expected":i.output!=null&&i.hasOwnProperty("output")&&!$util.isString(i.output)?"output: string expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.AiLangSetting)return i;let T=new $root.com.quick.voice.proto.AiLangSetting;return i.input!=null&&(T.input=String(i.input)),i.output!=null&&(T.output=String(i.output)),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.input="",C.output=""),i.input!=null&&i.hasOwnProperty("input")&&(C.input=i.input),i.output!=null&&i.hasOwnProperty("output")&&(C.output=i.output),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.AiLangSetting"},A})(),F.P2PIgnoreReason=(function(){const A={},D=Object.create(A);return D[A[0]="CHANNEL_LIMIT"]=0,D[A[1]="SUBSCRIBE_NOT_EXIST"]=1,D[A[2]="Busying"]=2,D[A[3]="TRACK_NOT_EXIST"]=3,D[A[4]="OTHER"]=4,D})(),F.P2PAvailablePeerNotify=(function(){function A(D){if(this.types=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.pushId="",A.prototype.types=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.pushId!=null&&Object.hasOwnProperty.call(i,"pushId")&&T.uint32(18).string(i.pushId),i.types!=null&&i.types.length){T.uint32(26).fork();for(let C=0;C<i.types.length;++C)T.int32(i.types[C]);T.ldelim()}return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.P2PAvailablePeerNotify;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.pushId=i.string();break}case 3:{if(j.types&&j.types.length||(j.types=[]),(z&7)===2){let K=i.uint32()+i.pos;for(;i.pos<K;)j.types.push(i.int32())}else j.types.push(i.int32());break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.pushId!=null&&i.hasOwnProperty("pushId")&&!$util.isString(i.pushId))return"pushId: string expected";if(i.types!=null&&i.hasOwnProperty("types")){if(!Array.isArray(i.types))return"types: array expected";for(let T=0;T<i.types.length;++T)switch(i.types[T]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.P2PAvailablePeerNotify)return i;let T=new $root.com.quick.voice.proto.P2PAvailablePeerNotify;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.pushId!=null&&(T.pushId=String(i.pushId)),i.types){if(!Array.isArray(i.types))throw TypeError(".com.quick.voice.proto.P2PAvailablePeerNotify.types: array expected");T.types=[];for(let C=0;C<i.types.length;++C)switch(i.types[C]){default:if(typeof i.types[C]=="number"){T.types[C]=i.types[C];break}case"Microphone":case 0:T.types[C]=0;break;case"Camera":case 1:T.types[C]=1;break;case"Screen":case 2:T.types[C]=2;break;case"SystemVoice":case 3:T.types[C]=3;break}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.types=[]),T.defaults&&(C.roomId="",C.pushId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.pushId!=null&&i.hasOwnProperty("pushId")&&(C.pushId=i.pushId),i.types&&i.types.length){C.types=[];for(let U=0;U<i.types.length;++U)C.types[U]=T.enums===String?$root.com.quick.voice.proto.TrackType[i.types[U]]===void 0?i.types[U]:$root.com.quick.voice.proto.TrackType[i.types[U]]:i.types[U]}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.P2PAvailablePeerNotify"},A})(),F.ReportP2PExReq=(function(){function A(i){if(this.types=[],i)for(let T=Object.keys(i),C=0;C<T.length;++C)i[T[C]]!=null&&(this[T[C]]=i[T[C]])}A.prototype.roomId="",A.prototype.pushId="",A.prototype.pullId="",A.prototype.code=0,A.prototype.types=$util.emptyArray,A.prototype.desc=null,A.prototype.connectedTime=null;let D;return Object.defineProperty(A.prototype,"_desc",{get:$util.oneOfGetter(D=["desc"]),set:$util.oneOfSetter(D)}),Object.defineProperty(A.prototype,"_connectedTime",{get:$util.oneOfGetter(D=["connectedTime"]),set:$util.oneOfSetter(D)}),A.create=function(T){return new A(T)},A.encode=function(T,C){if(C||(C=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&C.uint32(10).string(T.roomId),T.pushId!=null&&Object.hasOwnProperty.call(T,"pushId")&&C.uint32(18).string(T.pushId),T.pullId!=null&&Object.hasOwnProperty.call(T,"pullId")&&C.uint32(26).string(T.pullId),T.code!=null&&Object.hasOwnProperty.call(T,"code")&&C.uint32(32).int32(T.code),T.types!=null&&T.types.length){C.uint32(42).fork();for(let U=0;U<T.types.length;++U)C.int32(T.types[U]);C.ldelim()}return T.desc!=null&&Object.hasOwnProperty.call(T,"desc")&&C.uint32(50).string(T.desc),T.connectedTime!=null&&Object.hasOwnProperty.call(T,"connectedTime")&&C.uint32(58).string(T.connectedTime),C},A.encodeDelimited=function(T,C){return this.encode(T,C).ldelim()},A.decode=function(T,C,U){T instanceof $Reader||(T=$Reader.create(T));let j=C===void 0?T.len:T.pos+C,z=new $root.com.quick.voice.proto.ReportP2PExReq;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.pushId=T.string();break}case 3:{z.pullId=T.string();break}case 4:{z.code=T.int32();break}case 5:{if(z.types&&z.types.length||(z.types=[]),(K&7)===2){let Y=T.uint32()+T.pos;for(;T.pos<Y;)z.types.push(T.int32())}else z.types.push(T.int32());break}case 6:{z.desc=T.string();break}case 7:{z.connectedTime=T.string();break}default:T.skipType(K&7);break}}return z},A.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},A.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.pushId!=null&&T.hasOwnProperty("pushId")&&!$util.isString(T.pushId))return"pushId: string expected";if(T.pullId!=null&&T.hasOwnProperty("pullId")&&!$util.isString(T.pullId))return"pullId: string expected";if(T.code!=null&&T.hasOwnProperty("code"))switch(T.code){default:return"code: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(T.types!=null&&T.hasOwnProperty("types")){if(!Array.isArray(T.types))return"types: array expected";for(let C=0;C<T.types.length;++C)switch(T.types[C]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return T.desc!=null&&T.hasOwnProperty("desc")&&!$util.isString(T.desc)?"desc: string expected":T.connectedTime!=null&&T.hasOwnProperty("connectedTime")&&!$util.isString(T.connectedTime)?"connectedTime: string expected":null},A.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.ReportP2PExReq)return T;let C=new $root.com.quick.voice.proto.ReportP2PExReq;switch(T.roomId!=null&&(C.roomId=String(T.roomId)),T.pushId!=null&&(C.pushId=String(T.pushId)),T.pullId!=null&&(C.pullId=String(T.pullId)),T.code){default:if(typeof T.code=="number"){C.code=T.code;break}break;case"Success":case 0:C.code=0;break;case"Failed":case 1:C.code=1;break;case"Ignore":case 2:C.code=2;break;case"Disconnected":case 3:C.code=3;break;case"LowQuality":case 4:C.code=4;break}if(T.types){if(!Array.isArray(T.types))throw TypeError(".com.quick.voice.proto.ReportP2PExReq.types: array expected");C.types=[];for(let U=0;U<T.types.length;++U)switch(T.types[U]){default:if(typeof T.types[U]=="number"){C.types[U]=T.types[U];break}case"Microphone":case 0:C.types[U]=0;break;case"Camera":case 1:C.types[U]=1;break;case"Screen":case 2:C.types[U]=2;break;case"SystemVoice":case 3:C.types[U]=3;break}}return T.desc!=null&&(C.desc=String(T.desc)),T.connectedTime!=null&&(C.connectedTime=String(T.connectedTime)),C},A.toObject=function(T,C){C||(C={});let U={};if((C.arrays||C.defaults)&&(U.types=[]),C.defaults&&(U.roomId="",U.pushId="",U.pullId="",U.code=C.enums===String?"Success":0),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.pushId!=null&&T.hasOwnProperty("pushId")&&(U.pushId=T.pushId),T.pullId!=null&&T.hasOwnProperty("pullId")&&(U.pullId=T.pullId),T.code!=null&&T.hasOwnProperty("code")&&(U.code=C.enums===String?$root.com.quick.voice.proto.P2PCode[T.code]===void 0?T.code:$root.com.quick.voice.proto.P2PCode[T.code]:T.code),T.types&&T.types.length){U.types=[];for(let j=0;j<T.types.length;++j)U.types[j]=C.enums===String?$root.com.quick.voice.proto.TrackType[T.types[j]]===void 0?T.types[j]:$root.com.quick.voice.proto.TrackType[T.types[j]]:T.types[j]}return T.desc!=null&&T.hasOwnProperty("desc")&&(U.desc=T.desc,C.oneofs&&(U._desc="desc")),T.connectedTime!=null&&T.hasOwnProperty("connectedTime")&&(U.connectedTime=T.connectedTime,C.oneofs&&(U._connectedTime="connectedTime")),U},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.ReportP2PExReq"},A})(),F.P2PDisconnectedNotify=(function(){function A(D){if(this.types=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.remoteUserId="",A.prototype.types=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.remoteUserId!=null&&Object.hasOwnProperty.call(i,"remoteUserId")&&T.uint32(18).string(i.remoteUserId),i.types!=null&&i.types.length){T.uint32(26).fork();for(let C=0;C<i.types.length;++C)T.int32(i.types[C]);T.ldelim()}return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.P2PDisconnectedNotify;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.remoteUserId=i.string();break}case 3:{if(j.types&&j.types.length||(j.types=[]),(z&7)===2){let K=i.uint32()+i.pos;for(;i.pos<K;)j.types.push(i.int32())}else j.types.push(i.int32());break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.remoteUserId!=null&&i.hasOwnProperty("remoteUserId")&&!$util.isString(i.remoteUserId))return"remoteUserId: string expected";if(i.types!=null&&i.hasOwnProperty("types")){if(!Array.isArray(i.types))return"types: array expected";for(let T=0;T<i.types.length;++T)switch(i.types[T]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.P2PDisconnectedNotify)return i;let T=new $root.com.quick.voice.proto.P2PDisconnectedNotify;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.remoteUserId!=null&&(T.remoteUserId=String(i.remoteUserId)),i.types){if(!Array.isArray(i.types))throw TypeError(".com.quick.voice.proto.P2PDisconnectedNotify.types: array expected");T.types=[];for(let C=0;C<i.types.length;++C)switch(i.types[C]){default:if(typeof i.types[C]=="number"){T.types[C]=i.types[C];break}case"Microphone":case 0:T.types[C]=0;break;case"Camera":case 1:T.types[C]=1;break;case"Screen":case 2:T.types[C]=2;break;case"SystemVoice":case 3:T.types[C]=3;break}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.types=[]),T.defaults&&(C.roomId="",C.remoteUserId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.remoteUserId!=null&&i.hasOwnProperty("remoteUserId")&&(C.remoteUserId=i.remoteUserId),i.types&&i.types.length){C.types=[];for(let U=0;U<i.types.length;++U)C.types[U]=T.enums===String?$root.com.quick.voice.proto.TrackType[i.types[U]]===void 0?i.types[U]:$root.com.quick.voice.proto.TrackType[i.types[U]]:i.types[U]}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.P2PDisconnectedNotify"},A})(),F.RtcEvent=(function(){const A={},D=Object.create(A);return D[A[0]="UpdateTrackActive"]=0,D})(),F.RtcTrack=(function(){function A(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.userId="",A.prototype.mid="",A.prototype.trackName="",A.prototype.type=0,A.prototype.isActive=!1,A.create=function(i){return new A(i)},A.encode=function(i,T){return T||(T=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(10).string(i.userId),i.mid!=null&&Object.hasOwnProperty.call(i,"mid")&&T.uint32(18).string(i.mid),i.trackName!=null&&Object.hasOwnProperty.call(i,"trackName")&&T.uint32(26).string(i.trackName),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&T.uint32(32).int32(i.type),i.isActive!=null&&Object.hasOwnProperty.call(i,"isActive")&&T.uint32(40).bool(i.isActive),T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.RtcTrack;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.userId=i.string();break}case 2:{j.mid=i.string();break}case 3:{j.trackName=i.string();break}case 4:{j.type=i.int32();break}case 5:{j.isActive=i.bool();break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId))return"userId: string expected";if(i.mid!=null&&i.hasOwnProperty("mid")&&!$util.isString(i.mid))return"mid: string expected";if(i.trackName!=null&&i.hasOwnProperty("trackName")&&!$util.isString(i.trackName))return"trackName: string expected";if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return i.isActive!=null&&i.hasOwnProperty("isActive")&&typeof i.isActive!="boolean"?"isActive: boolean expected":null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RtcTrack)return i;let T=new $root.com.quick.voice.proto.RtcTrack;switch(i.userId!=null&&(T.userId=String(i.userId)),i.mid!=null&&(T.mid=String(i.mid)),i.trackName!=null&&(T.trackName=String(i.trackName)),i.type){default:if(typeof i.type=="number"){T.type=i.type;break}break;case"Microphone":case 0:T.type=0;break;case"Camera":case 1:T.type=1;break;case"Screen":case 2:T.type=2;break;case"SystemVoice":case 3:T.type=3;break}return i.isActive!=null&&(T.isActive=!!i.isActive),T},A.toObject=function(i,T){T||(T={});let C={};return T.defaults&&(C.userId="",C.mid="",C.trackName="",C.type=T.enums===String?"Microphone":0,C.isActive=!1),i.userId!=null&&i.hasOwnProperty("userId")&&(C.userId=i.userId),i.mid!=null&&i.hasOwnProperty("mid")&&(C.mid=i.mid),i.trackName!=null&&i.hasOwnProperty("trackName")&&(C.trackName=i.trackName),i.type!=null&&i.hasOwnProperty("type")&&(C.type=T.enums===String?$root.com.quick.voice.proto.RtcTrackType[i.type]===void 0?i.type:$root.com.quick.voice.proto.RtcTrackType[i.type]:i.type),i.isActive!=null&&i.hasOwnProperty("isActive")&&(C.isActive=i.isActive),C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RtcTrack"},A})(),F.RtcTrackType=(function(){const A={},D=Object.create(A);return D[A[0]="Microphone"]=0,D[A[1]="Camera"]=1,D[A[2]="Screen"]=2,D[A[3]="SystemVoice"]=3,D})(),F.UpdateTrackState=(function(){function A(D){if(this.tracks=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return A.prototype.roomId="",A.prototype.tracks=$util.emptyArray,A.create=function(i){return new A(i)},A.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.tracks!=null&&i.tracks.length)for(let C=0;C<i.tracks.length;++C)$root.com.quick.voice.proto.RtcTrack.encode(i.tracks[C],T.uint32(18).fork()).ldelim();return T},A.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},A.decode=function(i,T,C){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UpdateTrackState;for(;i.pos<U;){let z=i.uint32();if(z===C)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.tracks&&j.tracks.length||(j.tracks=[]),j.tracks.push($root.com.quick.voice.proto.RtcTrack.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},A.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},A.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let T=0;T<i.tracks.length;++T){let C=$root.com.quick.voice.proto.RtcTrack.verify(i.tracks[T]);if(C)return"tracks."+C}}return null},A.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTrackState)return i;let T=new $root.com.quick.voice.proto.UpdateTrackState;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.UpdateTrackState.tracks: array expected");T.tracks=[];for(let C=0;C<i.tracks.length;++C){if(typeof i.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.UpdateTrackState.tracks: object expected");T.tracks[C]=$root.com.quick.voice.proto.RtcTrack.fromObject(i.tracks[C])}}return T},A.toObject=function(i,T){T||(T={});let C={};if((T.arrays||T.defaults)&&(C.tracks=[]),T.defaults&&(C.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(C.roomId=i.roomId),i.tracks&&i.tracks.length){C.tracks=[];for(let U=0;U<i.tracks.length;++U)C.tracks[U]=$root.com.quick.voice.proto.RtcTrack.toObject(i.tracks[U],T)}return C},A.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},A.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTrackState"},A})(),F})(),B})(),M})(),N})(),enum_notifyName={onChangeNetwork:"网络情况变更",onRoomNetwork:"房间实时网络数据",onNetQuality:"网络质量回调",onLogin:"登录回调",onRemotePeerReady:"开始推流",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",UpdateTrackActive:"更新轨道状态",onRoomState:"房间状态变化",onIceState:"webrtc状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onDataChannelPublish:"监听数据通道发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",onTrackInactive:"通知轨道失效",onAttemptP2PEx:"尝试与对方建立P2P连接",onOffer:"收到P2P-offer",onAnswer:"收到P2P-answer",onCandidate:"收到P2P候选信息-candidate",onDisconnectedP2P:"监听关闭P2P",onUpdatePermissions:"更新推流权限通知",onTokenExpired:"Token已过期",onDestroyRoom:"直播模式房间销毁",onUpdateBehavior:"行为允许权限变更",destroyRoom:"服务器要求销毁房间",onCDNPlayUrlAdd:"cdn播放地址变化",onRoomUserSpeech:"用户讲话",onDestroy:"SDK销毁"};pt(enum_notifyName);const notifyName_keys=Object.keys(enum_notifyName);const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(N){let M=N.length;for(;--M>=0;)N[M]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=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]),extra_dbits=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]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(N,M,B,F,A){this.static_tree=N,this.extra_bits=M,this.extra_base=B,this.elems=F,this.max_length=A,this.has_stree=N&&N.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(N,M){this.dyn_tree=N,this.max_code=0,this.stat_desc=M}const d_code=N=>N<256?_dist_code[N]:_dist_code[256+(N>>>7)],put_short=(N,M)=>{N.pending_buf[N.pending++]=M&255,N.pending_buf[N.pending++]=M>>>8&255},send_bits=(N,M,B)=>{N.bi_valid>Buf_size-B?(N.bi_buf|=M<<N.bi_valid&65535,put_short(N,N.bi_buf),N.bi_buf=M>>Buf_size-N.bi_valid,N.bi_valid+=B-Buf_size):(N.bi_buf|=M<<N.bi_valid&65535,N.bi_valid+=B)},send_code=(N,M,B)=>{send_bits(N,B[M*2],B[M*2+1])},bi_reverse=(N,M)=>{let B=0;do B|=N&1,N>>>=1,B<<=1;while(--M>0);return B>>>1},bi_flush=N=>{N.bi_valid===16?(put_short(N,N.bi_buf),N.bi_buf=0,N.bi_valid=0):N.bi_valid>=8&&(N.pending_buf[N.pending++]=N.bi_buf&255,N.bi_buf>>=8,N.bi_valid-=8)},gen_bitlen=(N,M)=>{const B=M.dyn_tree,F=M.max_code,A=M.stat_desc.static_tree,D=M.stat_desc.has_stree,i=M.stat_desc.extra_bits,T=M.stat_desc.extra_base,C=M.stat_desc.max_length;let U,j,z,K,Y,te,ae=0;for(K=0;K<=MAX_BITS$1;K++)N.bl_count[K]=0;for(B[N.heap[N.heap_max]*2+1]=0,U=N.heap_max+1;U<HEAP_SIZE$1;U++)j=N.heap[U],K=B[B[j*2+1]*2+1]+1,K>C&&(K=C,ae++),B[j*2+1]=K,!(j>F)&&(N.bl_count[K]++,Y=0,j>=T&&(Y=i[j-T]),te=B[j*2],N.opt_len+=te*(K+Y),D&&(N.static_len+=te*(A[j*2+1]+Y)));if(ae!==0){do{for(K=C-1;N.bl_count[K]===0;)K--;N.bl_count[K]--,N.bl_count[K+1]+=2,N.bl_count[C]--,ae-=2}while(ae>0);for(K=C;K!==0;K--)for(j=N.bl_count[K];j!==0;)z=N.heap[--U],!(z>F)&&(B[z*2+1]!==K&&(N.opt_len+=(K-B[z*2+1])*B[z*2],B[z*2+1]=K),j--)}},gen_codes=(N,M,B)=>{const F=new Array(MAX_BITS$1+1);let A=0,D,i;for(D=1;D<=MAX_BITS$1;D++)A=A+B[D-1]<<1,F[D]=A;for(i=0;i<=M;i++){let T=N[i*2+1];T!==0&&(N[i*2]=bi_reverse(F[T]++,T))}},tr_static_init=()=>{let N,M,B,F,A;const D=new Array(MAX_BITS$1+1);for(B=0,F=0;F<LENGTH_CODES$1-1;F++)for(base_length[F]=B,N=0;N<1<<extra_lbits[F];N++)_length_code[B++]=F;for(_length_code[B-1]=F,A=0,F=0;F<16;F++)for(base_dist[F]=A,N=0;N<1<<extra_dbits[F];N++)_dist_code[A++]=F;for(A>>=7;F<D_CODES$1;F++)for(base_dist[F]=A<<7,N=0;N<1<<extra_dbits[F]-7;N++)_dist_code[256+A++]=F;for(M=0;M<=MAX_BITS$1;M++)D[M]=0;for(N=0;N<=143;)static_ltree[N*2+1]=8,N++,D[8]++;for(;N<=255;)static_ltree[N*2+1]=9,N++,D[9]++;for(;N<=279;)static_ltree[N*2+1]=7,N++,D[7]++;for(;N<=287;)static_ltree[N*2+1]=8,N++,D[8]++;for(gen_codes(static_ltree,L_CODES$1+1,D),N=0;N<D_CODES$1;N++)static_dtree[N*2+1]=5,static_dtree[N*2]=bi_reverse(N,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=N=>{let M;for(M=0;M<L_CODES$1;M++)N.dyn_ltree[M*2]=0;for(M=0;M<D_CODES$1;M++)N.dyn_dtree[M*2]=0;for(M=0;M<BL_CODES$1;M++)N.bl_tree[M*2]=0;N.dyn_ltree[END_BLOCK*2]=1,N.opt_len=N.static_len=0,N.sym_next=N.matches=0},bi_windup=N=>{N.bi_valid>8?put_short(N,N.bi_buf):N.bi_valid>0&&(N.pending_buf[N.pending++]=N.bi_buf),N.bi_buf=0,N.bi_valid=0},smaller=(N,M,B,F)=>{const A=M*2,D=B*2;return N[A]<N[D]||N[A]===N[D]&&F[M]<=F[B]},pqdownheap=(N,M,B)=>{const F=N.heap[B];let A=B<<1;for(;A<=N.heap_len&&(A<N.heap_len&&smaller(M,N.heap[A+1],N.heap[A],N.depth)&&A++,!smaller(M,F,N.heap[A],N.depth));)N.heap[B]=N.heap[A],B=A,A<<=1;N.heap[B]=F},compress_block=(N,M,B)=>{let F,A,D=0,i,T;if(N.sym_next!==0)do F=N.pending_buf[N.sym_buf+D++]&255,F+=(N.pending_buf[N.sym_buf+D++]&255)<<8,A=N.pending_buf[N.sym_buf+D++],F===0?send_code(N,A,M):(i=_length_code[A],send_code(N,i+LITERALS$1+1,M),T=extra_lbits[i],T!==0&&(A-=base_length[i],send_bits(N,A,T)),F--,i=d_code(F),send_code(N,i,B),T=extra_dbits[i],T!==0&&(F-=base_dist[i],send_bits(N,F,T)));while(D<N.sym_next);send_code(N,END_BLOCK,M)},build_tree=(N,M)=>{const B=M.dyn_tree,F=M.stat_desc.static_tree,A=M.stat_desc.has_stree,D=M.stat_desc.elems;let i,T,C=-1,U;for(N.heap_len=0,N.heap_max=HEAP_SIZE$1,i=0;i<D;i++)B[i*2]!==0?(N.heap[++N.heap_len]=C=i,N.depth[i]=0):B[i*2+1]=0;for(;N.heap_len<2;)U=N.heap[++N.heap_len]=C<2?++C:0,B[U*2]=1,N.depth[U]=0,N.opt_len--,A&&(N.static_len-=F[U*2+1]);for(M.max_code=C,i=N.heap_len>>1;i>=1;i--)pqdownheap(N,B,i);U=D;do i=N.heap[1],N.heap[1]=N.heap[N.heap_len--],pqdownheap(N,B,1),T=N.heap[1],N.heap[--N.heap_max]=i,N.heap[--N.heap_max]=T,B[U*2]=B[i*2]+B[T*2],N.depth[U]=(N.depth[i]>=N.depth[T]?N.depth[i]:N.depth[T])+1,B[i*2+1]=B[T*2+1]=U,N.heap[1]=U++,pqdownheap(N,B,1);while(N.heap_len>=2);N.heap[--N.heap_max]=N.heap[1],gen_bitlen(N,M),gen_codes(B,C,N.bl_count)},scan_tree=(N,M,B)=>{let F,A=-1,D,i=M[1],T=0,C=7,U=4;for(i===0&&(C=138,U=3),M[(B+1)*2+1]=65535,F=0;F<=B;F++)D=i,i=M[(F+1)*2+1],!(++T<C&&D===i)&&(T<U?N.bl_tree[D*2]+=T:D!==0?(D!==A&&N.bl_tree[D*2]++,N.bl_tree[REP_3_6*2]++):T<=10?N.bl_tree[REPZ_3_10*2]++:N.bl_tree[REPZ_11_138*2]++,T=0,A=D,i===0?(C=138,U=3):D===i?(C=6,U=3):(C=7,U=4))},send_tree=(N,M,B)=>{let F,A=-1,D,i=M[1],T=0,C=7,U=4;for(i===0&&(C=138,U=3),F=0;F<=B;F++)if(D=i,i=M[(F+1)*2+1],!(++T<C&&D===i)){if(T<U)do send_code(N,D,N.bl_tree);while(--T!==0);else D!==0?(D!==A&&(send_code(N,D,N.bl_tree),T--),send_code(N,REP_3_6,N.bl_tree),send_bits(N,T-3,2)):T<=10?(send_code(N,REPZ_3_10,N.bl_tree),send_bits(N,T-3,3)):(send_code(N,REPZ_11_138,N.bl_tree),send_bits(N,T-11,7));T=0,A=D,i===0?(C=138,U=3):D===i?(C=6,U=3):(C=7,U=4)}},build_bl_tree=N=>{let M;for(scan_tree(N,N.dyn_ltree,N.l_desc.max_code),scan_tree(N,N.dyn_dtree,N.d_desc.max_code),build_tree(N,N.bl_desc),M=BL_CODES$1-1;M>=3&&N.bl_tree[bl_order[M]*2+1]===0;M--);return N.opt_len+=3*(M+1)+5+5+4,M},send_all_trees=(N,M,B,F)=>{let A;for(send_bits(N,M-257,5),send_bits(N,B-1,5),send_bits(N,F-4,4),A=0;A<F;A++)send_bits(N,N.bl_tree[bl_order[A]*2+1],3);send_tree(N,N.dyn_ltree,M-1),send_tree(N,N.dyn_dtree,B-1)},detect_data_type=N=>{let M=4093624447,B;for(B=0;B<=31;B++,M>>>=1)if(M&1&&N.dyn_ltree[B*2]!==0)return Z_BINARY;if(N.dyn_ltree[18]!==0||N.dyn_ltree[20]!==0||N.dyn_ltree[26]!==0)return Z_TEXT;for(B=32;B<LITERALS$1;B++)if(N.dyn_ltree[B*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=N=>{static_init_done||(tr_static_init(),static_init_done=!0),N.l_desc=new TreeDesc(N.dyn_ltree,static_l_desc),N.d_desc=new TreeDesc(N.dyn_dtree,static_d_desc),N.bl_desc=new TreeDesc(N.bl_tree,static_bl_desc),N.bi_buf=0,N.bi_valid=0,init_block(N)},_tr_stored_block$1=(N,M,B,F)=>{send_bits(N,(STORED_BLOCK<<1)+(F?1:0),3),bi_windup(N),put_short(N,B),put_short(N,~B),B&&N.pending_buf.set(N.window.subarray(M,M+B),N.pending),N.pending+=B},_tr_align$1=N=>{send_bits(N,STATIC_TREES<<1,3),send_code(N,END_BLOCK,static_ltree),bi_flush(N)},_tr_flush_block$1=(N,M,B,F)=>{let A,D,i=0;N.level>0?(N.strm.data_type===Z_UNKNOWN$1&&(N.strm.data_type=detect_data_type(N)),build_tree(N,N.l_desc),build_tree(N,N.d_desc),i=build_bl_tree(N),A=N.opt_len+3+7>>>3,D=N.static_len+3+7>>>3,D<=A&&(A=D)):A=D=B+5,B+4<=A&&M!==-1?_tr_stored_block$1(N,M,B,F):N.strategy===Z_FIXED$1||D===A?(send_bits(N,(STATIC_TREES<<1)+(F?1:0),3),compress_block(N,static_ltree,static_dtree)):(send_bits(N,(DYN_TREES<<1)+(F?1:0),3),send_all_trees(N,N.l_desc.max_code+1,N.d_desc.max_code+1,i+1),compress_block(N,N.dyn_ltree,N.dyn_dtree)),init_block(N),F&&bi_windup(N)},_tr_tally$1=(N,M,B)=>(N.pending_buf[N.sym_buf+N.sym_next++]=M,N.pending_buf[N.sym_buf+N.sym_next++]=M>>8,N.pending_buf[N.sym_buf+N.sym_next++]=B,M===0?N.dyn_ltree[B*2]++:(N.matches++,M--,N.dyn_ltree[(_length_code[B]+LITERALS$1+1)*2]++,N.dyn_dtree[d_code(M)*2]++),N.sym_next===N.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(N,M,B,F)=>{let A=N&65535|0,D=N>>>16&65535|0,i=0;for(;B!==0;){i=B>2e3?2e3:B,B-=i;do A=A+M[F++]|0,D=D+A|0;while(--i);A%=65521,D%=65521}return A|D<<16|0};var adler32_1=adler32;const makeTable=()=>{let N,M=[];for(var B=0;B<256;B++){N=B;for(var F=0;F<8;F++)N=N&1?3988292384^N>>>1:N>>>1;M[B]=N}return M},crcTable=new Uint32Array(makeTable()),crc32=(N,M,B,F)=>{const A=crcTable,D=F+B;N^=-1;for(let i=F;i<D;i++)N=N>>>8^A[(N^M[i])&255];return N^-1};var crc32_1=crc32,messages={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"},constants$2={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};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(N,M)=>(N.msg=messages[M],M),rank=N=>N*2-(N>4?9:0),zero=N=>{let M=N.length;for(;--M>=0;)N[M]=0},slide_hash=N=>{let M,B,F,A=N.w_size;M=N.hash_size,F=M;do B=N.head[--F],N.head[F]=B>=A?B-A:0;while(--M);M=A,F=M;do B=N.prev[--F],N.prev[F]=B>=A?B-A:0;while(--M)};let HASH_ZLIB=(N,M,B)=>(M<<N.hash_shift^B)&N.hash_mask,HASH=HASH_ZLIB;const flush_pending=N=>{const M=N.state;let B=M.pending;B>N.avail_out&&(B=N.avail_out),B!==0&&(N.output.set(M.pending_buf.subarray(M.pending_out,M.pending_out+B),N.next_out),N.next_out+=B,M.pending_out+=B,N.total_out+=B,N.avail_out-=B,M.pending-=B,M.pending===0&&(M.pending_out=0))},flush_block_only=(N,M)=>{_tr_flush_block(N,N.block_start>=0?N.block_start:-1,N.strstart-N.block_start,M),N.block_start=N.strstart,flush_pending(N.strm)},put_byte=(N,M)=>{N.pending_buf[N.pending++]=M},putShortMSB=(N,M)=>{N.pending_buf[N.pending++]=M>>>8&255,N.pending_buf[N.pending++]=M&255},read_buf=(N,M,B,F)=>{let A=N.avail_in;return A>F&&(A=F),A===0?0:(N.avail_in-=A,M.set(N.input.subarray(N.next_in,N.next_in+A),B),N.state.wrap===1?N.adler=adler32_1(N.adler,M,A,B):N.state.wrap===2&&(N.adler=crc32_1(N.adler,M,A,B)),N.next_in+=A,N.total_in+=A,A)},longest_match=(N,M)=>{let B=N.max_chain_length,F=N.strstart,A,D,i=N.prev_length,T=N.nice_match;const C=N.strstart>N.w_size-MIN_LOOKAHEAD?N.strstart-(N.w_size-MIN_LOOKAHEAD):0,U=N.window,j=N.w_mask,z=N.prev,K=N.strstart+MAX_MATCH;let Y=U[F+i-1],te=U[F+i];N.prev_length>=N.good_match&&(B>>=2),T>N.lookahead&&(T=N.lookahead);do if(A=M,!(U[A+i]!==te||U[A+i-1]!==Y||U[A]!==U[F]||U[++A]!==U[F+1])){F+=2,A++;do;while(U[++F]===U[++A]&&U[++F]===U[++A]&&U[++F]===U[++A]&&U[++F]===U[++A]&&U[++F]===U[++A]&&U[++F]===U[++A]&&U[++F]===U[++A]&&U[++F]===U[++A]&&F<K);if(D=MAX_MATCH-(K-F),F=K-MAX_MATCH,D>i){if(N.match_start=M,i=D,D>=T)break;Y=U[F+i-1],te=U[F+i]}}while((M=z[M&j])>C&&--B!==0);return i<=N.lookahead?i:N.lookahead},fill_window=N=>{const M=N.w_size;let B,F,A;do{if(F=N.window_size-N.lookahead-N.strstart,N.strstart>=M+(M-MIN_LOOKAHEAD)&&(N.window.set(N.window.subarray(M,M+M-F),0),N.match_start-=M,N.strstart-=M,N.block_start-=M,N.insert>N.strstart&&(N.insert=N.strstart),slide_hash(N),F+=M),N.strm.avail_in===0)break;if(B=read_buf(N.strm,N.window,N.strstart+N.lookahead,F),N.lookahead+=B,N.lookahead+N.insert>=MIN_MATCH)for(A=N.strstart-N.insert,N.ins_h=N.window[A],N.ins_h=HASH(N,N.ins_h,N.window[A+1]);N.insert&&(N.ins_h=HASH(N,N.ins_h,N.window[A+MIN_MATCH-1]),N.prev[A&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=A,A++,N.insert--,!(N.lookahead+N.insert<MIN_MATCH)););}while(N.lookahead<MIN_LOOKAHEAD&&N.strm.avail_in!==0)},deflate_stored=(N,M)=>{let B=N.pending_buf_size-5>N.w_size?N.w_size:N.pending_buf_size-5,F,A,D,i=0,T=N.strm.avail_in;do{if(F=65535,D=N.bi_valid+42>>3,N.strm.avail_out<D||(D=N.strm.avail_out-D,A=N.strstart-N.block_start,F>A+N.strm.avail_in&&(F=A+N.strm.avail_in),F>D&&(F=D),F<B&&(F===0&&M!==Z_FINISH$3||M===Z_NO_FLUSH$2||F!==A+N.strm.avail_in)))break;i=M===Z_FINISH$3&&F===A+N.strm.avail_in?1:0,_tr_stored_block(N,0,0,i),N.pending_buf[N.pending-4]=F,N.pending_buf[N.pending-3]=F>>8,N.pending_buf[N.pending-2]=~F,N.pending_buf[N.pending-1]=~F>>8,flush_pending(N.strm),A&&(A>F&&(A=F),N.strm.output.set(N.window.subarray(N.block_start,N.block_start+A),N.strm.next_out),N.strm.next_out+=A,N.strm.avail_out-=A,N.strm.total_out+=A,N.block_start+=A,F-=A),F&&(read_buf(N.strm,N.strm.output,N.strm.next_out,F),N.strm.next_out+=F,N.strm.avail_out-=F,N.strm.total_out+=F)}while(i===0);return T-=N.strm.avail_in,T&&(T>=N.w_size?(N.matches=2,N.window.set(N.strm.input.subarray(N.strm.next_in-N.w_size,N.strm.next_in),0),N.strstart=N.w_size,N.insert=N.strstart):(N.window_size-N.strstart<=T&&(N.strstart-=N.w_size,N.window.set(N.window.subarray(N.w_size,N.w_size+N.strstart),0),N.matches<2&&N.matches++,N.insert>N.strstart&&(N.insert=N.strstart)),N.window.set(N.strm.input.subarray(N.strm.next_in-T,N.strm.next_in),N.strstart),N.strstart+=T,N.insert+=T>N.w_size-N.insert?N.w_size-N.insert:T),N.block_start=N.strstart),N.high_water<N.strstart&&(N.high_water=N.strstart),i?BS_FINISH_DONE:M!==Z_NO_FLUSH$2&&M!==Z_FINISH$3&&N.strm.avail_in===0&&N.strstart===N.block_start?BS_BLOCK_DONE:(D=N.window_size-N.strstart,N.strm.avail_in>D&&N.block_start>=N.w_size&&(N.block_start-=N.w_size,N.strstart-=N.w_size,N.window.set(N.window.subarray(N.w_size,N.w_size+N.strstart),0),N.matches<2&&N.matches++,D+=N.w_size,N.insert>N.strstart&&(N.insert=N.strstart)),D>N.strm.avail_in&&(D=N.strm.avail_in),D&&(read_buf(N.strm,N.window,N.strstart,D),N.strstart+=D,N.insert+=D>N.w_size-N.insert?N.w_size-N.insert:D),N.high_water<N.strstart&&(N.high_water=N.strstart),D=N.bi_valid+42>>3,D=N.pending_buf_size-D>65535?65535:N.pending_buf_size-D,B=D>N.w_size?N.w_size:D,A=N.strstart-N.block_start,(A>=B||(A||M===Z_FINISH$3)&&M!==Z_NO_FLUSH$2&&N.strm.avail_in===0&&A<=D)&&(F=A>D?D:A,i=M===Z_FINISH$3&&N.strm.avail_in===0&&F===A?1:0,_tr_stored_block(N,N.block_start,F,i),N.block_start+=F,flush_pending(N.strm)),i?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(N,M)=>{let B,F;for(;;){if(N.lookahead<MIN_LOOKAHEAD){if(fill_window(N),N.lookahead<MIN_LOOKAHEAD&&M===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(B=0,N.lookahead>=MIN_MATCH&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),B=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),B!==0&&N.strstart-B<=N.w_size-MIN_LOOKAHEAD&&(N.match_length=longest_match(N,B)),N.match_length>=MIN_MATCH)if(F=_tr_tally(N,N.strstart-N.match_start,N.match_length-MIN_MATCH),N.lookahead-=N.match_length,N.match_length<=N.max_lazy_match&&N.lookahead>=MIN_MATCH){N.match_length--;do N.strstart++,N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),B=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart;while(--N.match_length!==0);N.strstart++}else N.strstart+=N.match_length,N.match_length=0,N.ins_h=N.window[N.strstart],N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+1]);else F=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++;if(F&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=N.strstart<MIN_MATCH-1?N.strstart:MIN_MATCH-1,M===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(N,M)=>{let B,F,A;for(;;){if(N.lookahead<MIN_LOOKAHEAD){if(fill_window(N),N.lookahead<MIN_LOOKAHEAD&&M===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(B=0,N.lookahead>=MIN_MATCH&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),B=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),N.prev_length=N.match_length,N.prev_match=N.match_start,N.match_length=MIN_MATCH-1,B!==0&&N.prev_length<N.max_lazy_match&&N.strstart-B<=N.w_size-MIN_LOOKAHEAD&&(N.match_length=longest_match(N,B),N.match_length<=5&&(N.strategy===Z_FILTERED||N.match_length===MIN_MATCH&&N.strstart-N.match_start>4096)&&(N.match_length=MIN_MATCH-1)),N.prev_length>=MIN_MATCH&&N.match_length<=N.prev_length){A=N.strstart+N.lookahead-MIN_MATCH,F=_tr_tally(N,N.strstart-1-N.prev_match,N.prev_length-MIN_MATCH),N.lookahead-=N.prev_length-1,N.prev_length-=2;do++N.strstart<=A&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),B=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart);while(--N.prev_length!==0);if(N.match_available=0,N.match_length=MIN_MATCH-1,N.strstart++,F&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}else if(N.match_available){if(F=_tr_tally(N,0,N.window[N.strstart-1]),F&&flush_block_only(N,!1),N.strstart++,N.lookahead--,N.strm.avail_out===0)return BS_NEED_MORE}else N.match_available=1,N.strstart++,N.lookahead--}return N.match_available&&(F=_tr_tally(N,0,N.window[N.strstart-1]),N.match_available=0),N.insert=N.strstart<MIN_MATCH-1?N.strstart:MIN_MATCH-1,M===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(N,M)=>{let B,F,A,D;const i=N.window;for(;;){if(N.lookahead<=MAX_MATCH){if(fill_window(N),N.lookahead<=MAX_MATCH&&M===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(N.match_length=0,N.lookahead>=MIN_MATCH&&N.strstart>0&&(A=N.strstart-1,F=i[A],F===i[++A]&&F===i[++A]&&F===i[++A])){D=N.strstart+MAX_MATCH;do;while(F===i[++A]&&F===i[++A]&&F===i[++A]&&F===i[++A]&&F===i[++A]&&F===i[++A]&&F===i[++A]&&F===i[++A]&&A<D);N.match_length=MAX_MATCH-(D-A),N.match_length>N.lookahead&&(N.match_length=N.lookahead)}if(N.match_length>=MIN_MATCH?(B=_tr_tally(N,1,N.match_length-MIN_MATCH),N.lookahead-=N.match_length,N.strstart+=N.match_length,N.match_length=0):(B=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++),B&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=0,M===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(N,M)=>{let B;for(;;){if(N.lookahead===0&&(fill_window(N),N.lookahead===0)){if(M===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(N.match_length=0,B=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++,B&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=0,M===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(N,M,B,F,A){this.good_length=N,this.max_lazy=M,this.nice_length=B,this.max_chain=F,this.func=A}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=N=>{N.window_size=2*N.w_size,zero(N.head),N.max_lazy_match=configuration_table[N.level].max_lazy,N.good_match=configuration_table[N.level].good_length,N.nice_match=configuration_table[N.level].nice_length,N.max_chain_length=configuration_table[N.level].max_chain,N.strstart=0,N.block_start=0,N.lookahead=0,N.insert=0,N.match_length=N.prev_length=MIN_MATCH-1,N.match_available=0,N.ins_h=0};function DeflateState(){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=Z_DEFLATED$2,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(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(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 deflateStateCheck=N=>{if(!N)return 1;const M=N.state;return!M||M.strm!==N||M.status!==INIT_STATE&&M.status!==GZIP_STATE&&M.status!==EXTRA_STATE&&M.status!==NAME_STATE&&M.status!==COMMENT_STATE&&M.status!==HCRC_STATE&&M.status!==BUSY_STATE&&M.status!==FINISH_STATE?1:0},deflateResetKeep=N=>{if(deflateStateCheck(N))return err(N,Z_STREAM_ERROR$2);N.total_in=N.total_out=0,N.data_type=Z_UNKNOWN;const M=N.state;return M.pending=0,M.pending_out=0,M.wrap<0&&(M.wrap=-M.wrap),M.status=M.wrap===2?GZIP_STATE:M.wrap?INIT_STATE:BUSY_STATE,N.adler=M.wrap===2?0:1,M.last_flush=-2,_tr_init(M),Z_OK$3},deflateReset=N=>{const M=deflateResetKeep(N);return M===Z_OK$3&&lm_init(N.state),M},deflateSetHeader=(N,M)=>deflateStateCheck(N)||N.state.wrap!==2?Z_STREAM_ERROR$2:(N.state.gzhead=M,Z_OK$3),deflateInit2=(N,M,B,F,A,D)=>{if(!N)return Z_STREAM_ERROR$2;let i=1;if(M===Z_DEFAULT_COMPRESSION$1&&(M=6),F<0?(i=0,F=-F):F>15&&(i=2,F-=16),A<1||A>MAX_MEM_LEVEL||B!==Z_DEFLATED$2||F<8||F>15||M<0||M>9||D<0||D>Z_FIXED||F===8&&i!==1)return err(N,Z_STREAM_ERROR$2);F===8&&(F=9);const T=new DeflateState;return N.state=T,T.strm=N,T.status=INIT_STATE,T.wrap=i,T.gzhead=null,T.w_bits=F,T.w_size=1<<T.w_bits,T.w_mask=T.w_size-1,T.hash_bits=A+7,T.hash_size=1<<T.hash_bits,T.hash_mask=T.hash_size-1,T.hash_shift=~~((T.hash_bits+MIN_MATCH-1)/MIN_MATCH),T.window=new Uint8Array(T.w_size*2),T.head=new Uint16Array(T.hash_size),T.prev=new Uint16Array(T.w_size),T.lit_bufsize=1<<A+6,T.pending_buf_size=T.lit_bufsize*4,T.pending_buf=new Uint8Array(T.pending_buf_size),T.sym_buf=T.lit_bufsize,T.sym_end=(T.lit_bufsize-1)*3,T.level=M,T.strategy=D,T.method=B,deflateReset(N)},deflateInit=(N,M)=>deflateInit2(N,M,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(N,M)=>{if(deflateStateCheck(N)||M>Z_BLOCK$1||M<0)return N?err(N,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const B=N.state;if(!N.output||N.avail_in!==0&&!N.input||B.status===FINISH_STATE&&M!==Z_FINISH$3)return err(N,N.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const F=B.last_flush;if(B.last_flush=M,B.pending!==0){if(flush_pending(N),N.avail_out===0)return B.last_flush=-1,Z_OK$3}else if(N.avail_in===0&&rank(M)<=rank(F)&&M!==Z_FINISH$3)return err(N,Z_BUF_ERROR$1);if(B.status===FINISH_STATE&&N.avail_in!==0)return err(N,Z_BUF_ERROR$1);if(B.status===INIT_STATE&&B.wrap===0&&(B.status=BUSY_STATE),B.status===INIT_STATE){let A=Z_DEFLATED$2+(B.w_bits-8<<4)<<8,D=-1;if(B.strategy>=Z_HUFFMAN_ONLY||B.level<2?D=0:B.level<6?D=1:B.level===6?D=2:D=3,A|=D<<6,B.strstart!==0&&(A|=PRESET_DICT),A+=31-A%31,putShortMSB(B,A),B.strstart!==0&&(putShortMSB(B,N.adler>>>16),putShortMSB(B,N.adler&65535)),N.adler=1,B.status=BUSY_STATE,flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3}if(B.status===GZIP_STATE){if(N.adler=0,put_byte(B,31),put_byte(B,139),put_byte(B,8),B.gzhead)put_byte(B,(B.gzhead.text?1:0)+(B.gzhead.hcrc?2:0)+(B.gzhead.extra?4:0)+(B.gzhead.name?8:0)+(B.gzhead.comment?16:0)),put_byte(B,B.gzhead.time&255),put_byte(B,B.gzhead.time>>8&255),put_byte(B,B.gzhead.time>>16&255),put_byte(B,B.gzhead.time>>24&255),put_byte(B,B.level===9?2:B.strategy>=Z_HUFFMAN_ONLY||B.level<2?4:0),put_byte(B,B.gzhead.os&255),B.gzhead.extra&&B.gzhead.extra.length&&(put_byte(B,B.gzhead.extra.length&255),put_byte(B,B.gzhead.extra.length>>8&255)),B.gzhead.hcrc&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending,0)),B.gzindex=0,B.status=EXTRA_STATE;else if(put_byte(B,0),put_byte(B,0),put_byte(B,0),put_byte(B,0),put_byte(B,0),put_byte(B,B.level===9?2:B.strategy>=Z_HUFFMAN_ONLY||B.level<2?4:0),put_byte(B,OS_CODE),B.status=BUSY_STATE,flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3}if(B.status===EXTRA_STATE){if(B.gzhead.extra){let A=B.pending,D=(B.gzhead.extra.length&65535)-B.gzindex;for(;B.pending+D>B.pending_buf_size;){let T=B.pending_buf_size-B.pending;if(B.pending_buf.set(B.gzhead.extra.subarray(B.gzindex,B.gzindex+T),B.pending),B.pending=B.pending_buf_size,B.gzhead.hcrc&&B.pending>A&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-A,A)),B.gzindex+=T,flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3;A=0,D-=T}let i=new Uint8Array(B.gzhead.extra);B.pending_buf.set(i.subarray(B.gzindex,B.gzindex+D),B.pending),B.pending+=D,B.gzhead.hcrc&&B.pending>A&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-A,A)),B.gzindex=0}B.status=NAME_STATE}if(B.status===NAME_STATE){if(B.gzhead.name){let A=B.pending,D;do{if(B.pending===B.pending_buf_size){if(B.gzhead.hcrc&&B.pending>A&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-A,A)),flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3;A=0}B.gzindex<B.gzhead.name.length?D=B.gzhead.name.charCodeAt(B.gzindex++)&255:D=0,put_byte(B,D)}while(D!==0);B.gzhead.hcrc&&B.pending>A&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-A,A)),B.gzindex=0}B.status=COMMENT_STATE}if(B.status===COMMENT_STATE){if(B.gzhead.comment){let A=B.pending,D;do{if(B.pending===B.pending_buf_size){if(B.gzhead.hcrc&&B.pending>A&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-A,A)),flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3;A=0}B.gzindex<B.gzhead.comment.length?D=B.gzhead.comment.charCodeAt(B.gzindex++)&255:D=0,put_byte(B,D)}while(D!==0);B.gzhead.hcrc&&B.pending>A&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-A,A))}B.status=HCRC_STATE}if(B.status===HCRC_STATE){if(B.gzhead.hcrc){if(B.pending+2>B.pending_buf_size&&(flush_pending(N),B.pending!==0))return B.last_flush=-1,Z_OK$3;put_byte(B,N.adler&255),put_byte(B,N.adler>>8&255),N.adler=0}if(B.status=BUSY_STATE,flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3}if(N.avail_in!==0||B.lookahead!==0||M!==Z_NO_FLUSH$2&&B.status!==FINISH_STATE){let A=B.level===0?deflate_stored(B,M):B.strategy===Z_HUFFMAN_ONLY?deflate_huff(B,M):B.strategy===Z_RLE?deflate_rle(B,M):configuration_table[B.level].func(B,M);if((A===BS_FINISH_STARTED||A===BS_FINISH_DONE)&&(B.status=FINISH_STATE),A===BS_NEED_MORE||A===BS_FINISH_STARTED)return N.avail_out===0&&(B.last_flush=-1),Z_OK$3;if(A===BS_BLOCK_DONE&&(M===Z_PARTIAL_FLUSH?_tr_align(B):M!==Z_BLOCK$1&&(_tr_stored_block(B,0,0,!1),M===Z_FULL_FLUSH$1&&(zero(B.head),B.lookahead===0&&(B.strstart=0,B.block_start=0,B.insert=0))),flush_pending(N),N.avail_out===0))return B.last_flush=-1,Z_OK$3}return M!==Z_FINISH$3?Z_OK$3:B.wrap<=0?Z_STREAM_END$3:(B.wrap===2?(put_byte(B,N.adler&255),put_byte(B,N.adler>>8&255),put_byte(B,N.adler>>16&255),put_byte(B,N.adler>>24&255),put_byte(B,N.total_in&255),put_byte(B,N.total_in>>8&255),put_byte(B,N.total_in>>16&255),put_byte(B,N.total_in>>24&255)):(putShortMSB(B,N.adler>>>16),putShortMSB(B,N.adler&65535)),flush_pending(N),B.wrap>0&&(B.wrap=-B.wrap),B.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=N=>{if(deflateStateCheck(N))return Z_STREAM_ERROR$2;const M=N.state.status;return N.state=null,M===BUSY_STATE?err(N,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(N,M)=>{let B=M.length;if(deflateStateCheck(N))return Z_STREAM_ERROR$2;const F=N.state,A=F.wrap;if(A===2||A===1&&F.status!==INIT_STATE||F.lookahead)return Z_STREAM_ERROR$2;if(A===1&&(N.adler=adler32_1(N.adler,M,B,0)),F.wrap=0,B>=F.w_size){A===0&&(zero(F.head),F.strstart=0,F.block_start=0,F.insert=0);let C=new Uint8Array(F.w_size);C.set(M.subarray(B-F.w_size,B),0),M=C,B=F.w_size}const D=N.avail_in,i=N.next_in,T=N.input;for(N.avail_in=B,N.next_in=0,N.input=M,fill_window(F);F.lookahead>=MIN_MATCH;){let C=F.strstart,U=F.lookahead-(MIN_MATCH-1);do F.ins_h=HASH(F,F.ins_h,F.window[C+MIN_MATCH-1]),F.prev[C&F.w_mask]=F.head[F.ins_h],F.head[F.ins_h]=C,C++;while(--U);F.strstart=C,F.lookahead=MIN_MATCH-1,fill_window(F)}return F.strstart+=F.lookahead,F.block_start=F.strstart,F.insert=F.lookahead,F.lookahead=0,F.match_length=F.prev_length=MIN_MATCH-1,F.match_available=0,N.next_in=i,N.input=T,N.avail_in=D,F.wrap=A,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(N,M)=>Object.prototype.hasOwnProperty.call(N,M);var assign=function(N){const M=Array.prototype.slice.call(arguments,1);for(;M.length;){const B=M.shift();if(B){if(typeof B!="object")throw new TypeError(B+"must be non-object");for(const F in B)_has(B,F)&&(N[F]=B[F])}}return N},flattenChunks=N=>{let M=0;for(let F=0,A=N.length;F<A;F++)M+=N[F].length;const B=new Uint8Array(M);for(let F=0,A=0,D=N.length;F<D;F++){let i=N[F];B.set(i,A),A+=i.length}return B},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(N){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let N=0;N<256;N++)_utf8len[N]=N>=252?6:N>=248?5:N>=240?4:N>=224?3:N>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=N=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(N);let M,B,F,A,D,i=N.length,T=0;for(A=0;A<i;A++)B=N.charCodeAt(A),(B&64512)===55296&&A+1<i&&(F=N.charCodeAt(A+1),(F&64512)===56320&&(B=65536+(B-55296<<10)+(F-56320),A++)),T+=B<128?1:B<2048?2:B<65536?3:4;for(M=new Uint8Array(T),D=0,A=0;D<T;A++)B=N.charCodeAt(A),(B&64512)===55296&&A+1<i&&(F=N.charCodeAt(A+1),(F&64512)===56320&&(B=65536+(B-55296<<10)+(F-56320),A++)),B<128?M[D++]=B:B<2048?(M[D++]=192|B>>>6,M[D++]=128|B&63):B<65536?(M[D++]=224|B>>>12,M[D++]=128|B>>>6&63,M[D++]=128|B&63):(M[D++]=240|B>>>18,M[D++]=128|B>>>12&63,M[D++]=128|B>>>6&63,M[D++]=128|B&63);return M};const buf2binstring=(N,M)=>{if(M<65534&&N.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,N.length===M?N:N.subarray(0,M));let B="";for(let F=0;F<M;F++)B+=String.fromCharCode(N[F]);return B};var buf2string=(N,M)=>{const B=M||N.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(N.subarray(0,M));let F,A;const D=new Array(B*2);for(A=0,F=0;F<B;){let i=N[F++];if(i<128){D[A++]=i;continue}let T=_utf8len[i];if(T>4){D[A++]=65533,F+=T-1;continue}for(i&=T===2?31:T===3?15:7;T>1&&F<B;)i=i<<6|N[F++]&63,T--;if(T>1){D[A++]=65533;continue}i<65536?D[A++]=i:(i-=65536,D[A++]=55296|i>>10&1023,D[A++]=56320|i&1023)}return buf2binstring(D,A)},utf8border=(N,M)=>{M=M||N.length,M>N.length&&(M=N.length);let B=M-1;for(;B>=0&&(N[B]&192)===128;)B--;return B<0||B===0?M:B+_utf8len[N[B]]>M?B:M},strings={string2buf,buf2string,utf8border};function ZStream(){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}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(N){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},N||{});let M=this.options;M.raw&&M.windowBits>0?M.windowBits=-M.windowBits:M.gzip&&M.windowBits>0&&M.windowBits<16&&(M.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let B=deflate_1$2.deflateInit2(this.strm,M.level,M.method,M.windowBits,M.memLevel,M.strategy);if(B!==Z_OK$2)throw new Error(messages[B]);if(M.header&&deflate_1$2.deflateSetHeader(this.strm,M.header),M.dictionary){let F;if(typeof M.dictionary=="string"?F=strings.string2buf(M.dictionary):toString$1.call(M.dictionary)==="[object ArrayBuffer]"?F=new Uint8Array(M.dictionary):F=M.dictionary,B=deflate_1$2.deflateSetDictionary(this.strm,F),B!==Z_OK$2)throw new Error(messages[B]);this._dict_set=!0}}Deflate$1.prototype.push=function(N,M){const B=this.strm,F=this.options.chunkSize;let A,D;if(this.ended)return!1;for(M===~~M?D=M:D=M===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof N=="string"?B.input=strings.string2buf(N):toString$1.call(N)==="[object ArrayBuffer]"?B.input=new Uint8Array(N):B.input=N,B.next_in=0,B.avail_in=B.input.length;;){if(B.avail_out===0&&(B.output=new Uint8Array(F),B.next_out=0,B.avail_out=F),(D===Z_SYNC_FLUSH||D===Z_FULL_FLUSH)&&B.avail_out<=6){this.onData(B.output.subarray(0,B.next_out)),B.avail_out=0;continue}if(A=deflate_1$2.deflate(B,D),A===Z_STREAM_END$2)return B.next_out>0&&this.onData(B.output.subarray(0,B.next_out)),A=deflate_1$2.deflateEnd(this.strm),this.onEnd(A),this.ended=!0,A===Z_OK$2;if(B.avail_out===0){this.onData(B.output);continue}if(D>0&&B.next_out>0){this.onData(B.output.subarray(0,B.next_out)),B.avail_out=0;continue}if(B.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(N){this.chunks.push(N)},Deflate$1.prototype.onEnd=function(N){N===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=N,this.msg=this.strm.msg};function deflate$1(N,M){const B=new Deflate$1(M);if(B.push(N,!0),B.err)throw B.msg||messages[B.err];return B.result}function deflateRaw$1(N,M){return M=M||{},M.raw=!0,deflate$1(N,M)}function gzip$1(N,M){return M=M||{},M.gzip=!0,deflate$1(N,M)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1};const BAD$1=16209,TYPE$1=16191;var inffast=function N(M,B){let F,A,D,i,T,C,U,j,z,K,Y,te,ae,se,oe,he,ke,ie,ce,pe,ue,fe,ye,re;const de=M.state;F=M.next_in,ye=M.input,A=F+(M.avail_in-5),D=M.next_out,re=M.output,i=D-(B-M.avail_out),T=D+(M.avail_out-257),C=de.dmax,U=de.wsize,j=de.whave,z=de.wnext,K=de.window,Y=de.hold,te=de.bits,ae=de.lencode,se=de.distcode,oe=(1<<de.lenbits)-1,he=(1<<de.distbits)-1;e:do{te<15&&(Y+=ye[F++]<<te,te+=8,Y+=ye[F++]<<te,te+=8),ke=ae[Y&oe];t:for(;;){if(ie=ke>>>24,Y>>>=ie,te-=ie,ie=ke>>>16&255,ie===0)re[D++]=ke&65535;else if(ie&16){ce=ke&65535,ie&=15,ie&&(te<ie&&(Y+=ye[F++]<<te,te+=8),ce+=Y&(1<<ie)-1,Y>>>=ie,te-=ie),te<15&&(Y+=ye[F++]<<te,te+=8,Y+=ye[F++]<<te,te+=8),ke=se[Y&he];n:for(;;){if(ie=ke>>>24,Y>>>=ie,te-=ie,ie=ke>>>16&255,ie&16){if(pe=ke&65535,ie&=15,te<ie&&(Y+=ye[F++]<<te,te+=8,te<ie&&(Y+=ye[F++]<<te,te+=8)),pe+=Y&(1<<ie)-1,pe>C){M.msg="invalid distance too far back",de.mode=BAD$1;break e}if(Y>>>=ie,te-=ie,ie=D-i,pe>ie){if(ie=pe-ie,ie>j&&de.sane){M.msg="invalid distance too far back",de.mode=BAD$1;break e}if(ue=0,fe=K,z===0){if(ue+=U-ie,ie<ce){ce-=ie;do re[D++]=K[ue++];while(--ie);ue=D-pe,fe=re}}else if(z<ie){if(ue+=U+z-ie,ie-=z,ie<ce){ce-=ie;do re[D++]=K[ue++];while(--ie);if(ue=0,z<ce){ie=z,ce-=ie;do re[D++]=K[ue++];while(--ie);ue=D-pe,fe=re}}}else if(ue+=z-ie,ie<ce){ce-=ie;do re[D++]=K[ue++];while(--ie);ue=D-pe,fe=re}for(;ce>2;)re[D++]=fe[ue++],re[D++]=fe[ue++],re[D++]=fe[ue++],ce-=3;ce&&(re[D++]=fe[ue++],ce>1&&(re[D++]=fe[ue++]))}else{ue=D-pe;do re[D++]=re[ue++],re[D++]=re[ue++],re[D++]=re[ue++],ce-=3;while(ce>2);ce&&(re[D++]=re[ue++],ce>1&&(re[D++]=re[ue++]))}}else if((ie&64)===0){ke=se[(ke&65535)+(Y&(1<<ie)-1)];continue n}else{M.msg="invalid distance code",de.mode=BAD$1;break e}break}}else if((ie&64)===0){ke=ae[(ke&65535)+(Y&(1<<ie)-1)];continue t}else if(ie&32){de.mode=TYPE$1;break e}else{M.msg="invalid literal/length code",de.mode=BAD$1;break e}break}}while(F<A&&D<T);ce=te>>3,F-=ce,te-=ce<<3,Y&=(1<<te)-1,M.next_in=F,M.next_out=D,M.avail_in=F<A?5+(A-F):5-(F-A),M.avail_out=D<T?257+(T-D):257-(D-T),de.hold=Y,de.bits=te};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=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]),lext=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]),dbase=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]),dext=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]),inflate_table=(N,M,B,F,A,D,i,T)=>{const C=T.bits;let U=0,j=0,z=0,K=0,Y=0,te=0,ae=0,se=0,oe=0,he=0,ke,ie,ce,pe,ue,fe=null,ye;const re=new Uint16Array(MAXBITS+1),de=new Uint16Array(MAXBITS+1);let be=null,_e,we,ge;for(U=0;U<=MAXBITS;U++)re[U]=0;for(j=0;j<F;j++)re[M[B+j]]++;for(Y=C,K=MAXBITS;K>=1&&re[K]===0;K--);if(Y>K&&(Y=K),K===0)return A[D++]=1<<24|64<<16|0,A[D++]=1<<24|64<<16|0,T.bits=1,0;for(z=1;z<K&&re[z]===0;z++);for(Y<z&&(Y=z),se=1,U=1;U<=MAXBITS;U++)if(se<<=1,se-=re[U],se<0)return-1;if(se>0&&(N===CODES$1||K!==1))return-1;for(de[1]=0,U=1;U<MAXBITS;U++)de[U+1]=de[U]+re[U];for(j=0;j<F;j++)M[B+j]!==0&&(i[de[M[B+j]]++]=j);if(N===CODES$1?(fe=be=i,ye=20):N===LENS$1?(fe=lbase,be=lext,ye=257):(fe=dbase,be=dext,ye=0),he=0,j=0,U=z,ue=D,te=Y,ae=0,ce=-1,oe=1<<Y,pe=oe-1,N===LENS$1&&oe>ENOUGH_LENS$1||N===DISTS$1&&oe>ENOUGH_DISTS$1)return 1;for(;;){_e=U-ae,i[j]+1<ye?(we=0,ge=i[j]):i[j]>=ye?(we=be[i[j]-ye],ge=fe[i[j]-ye]):(we=96,ge=0),ke=1<<U-ae,ie=1<<te,z=ie;do ie-=ke,A[ue+(he>>ae)+ie]=_e<<24|we<<16|ge|0;while(ie!==0);for(ke=1<<U-1;he&ke;)ke>>=1;if(ke!==0?(he&=ke-1,he+=ke):he=0,j++,--re[U]===0){if(U===K)break;U=M[B+i[j]]}if(U>Y&&(he&pe)!==ce){for(ae===0&&(ae=Y),ue+=z,te=U-ae,se=1<<te;te+ae<K&&(se-=re[te+ae],!(se<=0));)te++,se<<=1;if(oe+=1<<te,N===LENS$1&&oe>ENOUGH_LENS$1||N===DISTS$1&&oe>ENOUGH_DISTS$1)return 1;ce=he&pe,A[ce]=Y<<24|te<<16|ue-D|0}}return he!==0&&(A[ue+he]=U-ae<<24|64<<16|0),T.bits=Y,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=N=>(N>>>24&255)+(N>>>8&65280)+((N&65280)<<8)+((N&255)<<24);function InflateState(){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 inflateStateCheck=N=>{if(!N)return 1;const M=N.state;return!M||M.strm!==N||M.mode<HEAD||M.mode>SYNC?1:0},inflateResetKeep=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const M=N.state;return N.total_in=N.total_out=M.total=0,N.msg="",M.wrap&&(N.adler=M.wrap&1),M.mode=HEAD,M.last=0,M.havedict=0,M.flags=-1,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new Int32Array(ENOUGH_LENS),M.distcode=M.distdyn=new Int32Array(ENOUGH_DISTS),M.sane=1,M.back=-1,Z_OK$1},inflateReset=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const M=N.state;return M.wsize=0,M.whave=0,M.wnext=0,inflateResetKeep(N)},inflateReset2=(N,M)=>{let B;if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const F=N.state;return M<0?(B=0,M=-M):(B=(M>>4)+5,M<48&&(M&=15)),M&&(M<8||M>15)?Z_STREAM_ERROR$1:(F.window!==null&&F.wbits!==M&&(F.window=null),F.wrap=B,F.wbits=M,inflateReset(N))},inflateInit2=(N,M)=>{if(!N)return Z_STREAM_ERROR$1;const B=new InflateState;N.state=B,B.strm=N,B.window=null,B.mode=HEAD;const F=inflateReset2(N,M);return F!==Z_OK$1&&(N.state=null),F},inflateInit=N=>inflateInit2(N,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=N=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let M=0;for(;M<144;)N.lens[M++]=8;for(;M<256;)N.lens[M++]=9;for(;M<280;)N.lens[M++]=7;for(;M<288;)N.lens[M++]=8;for(inftrees(LENS,N.lens,0,288,lenfix,0,N.work,{bits:9}),M=0;M<32;)N.lens[M++]=5;inftrees(DISTS,N.lens,0,32,distfix,0,N.work,{bits:5}),virgin=!1}N.lencode=lenfix,N.lenbits=9,N.distcode=distfix,N.distbits=5},updatewindow=(N,M,B,F)=>{let A;const D=N.state;return D.window===null&&(D.wsize=1<<D.wbits,D.wnext=0,D.whave=0,D.window=new Uint8Array(D.wsize)),F>=D.wsize?(D.window.set(M.subarray(B-D.wsize,B),0),D.wnext=0,D.whave=D.wsize):(A=D.wsize-D.wnext,A>F&&(A=F),D.window.set(M.subarray(B-F,B-F+A),D.wnext),F-=A,F?(D.window.set(M.subarray(B-F,B),0),D.wnext=F,D.whave=D.wsize):(D.wnext+=A,D.wnext===D.wsize&&(D.wnext=0),D.whave<D.wsize&&(D.whave+=A))),0},inflate$2=(N,M)=>{let B,F,A,D,i,T,C,U,j,z,K,Y,te,ae,se=0,oe,he,ke,ie,ce,pe,ue,fe;const ye=new Uint8Array(4);let re,de;const be=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(N)||!N.output||!N.input&&N.avail_in!==0)return Z_STREAM_ERROR$1;B=N.state,B.mode===TYPE&&(B.mode=TYPEDO),i=N.next_out,A=N.output,C=N.avail_out,D=N.next_in,F=N.input,T=N.avail_in,U=B.hold,j=B.bits,z=T,K=C,fe=Z_OK$1;e:for(;;)switch(B.mode){case HEAD:if(B.wrap===0){B.mode=TYPEDO;break}for(;j<16;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(B.wrap&2&&U===35615){B.wbits===0&&(B.wbits=15),B.check=0,ye[0]=U&255,ye[1]=U>>>8&255,B.check=crc32_1(B.check,ye,2,0),U=0,j=0,B.mode=FLAGS;break}if(B.head&&(B.head.done=!1),!(B.wrap&1)||(((U&255)<<8)+(U>>8))%31){N.msg="incorrect header check",B.mode=BAD;break}if((U&15)!==Z_DEFLATED){N.msg="unknown compression method",B.mode=BAD;break}if(U>>>=4,j-=4,ue=(U&15)+8,B.wbits===0&&(B.wbits=ue),ue>15||ue>B.wbits){N.msg="invalid window size",B.mode=BAD;break}B.dmax=1<<B.wbits,B.flags=0,N.adler=B.check=1,B.mode=U&512?DICTID:TYPE,U=0,j=0;break;case FLAGS:for(;j<16;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(B.flags=U,(B.flags&255)!==Z_DEFLATED){N.msg="unknown compression method",B.mode=BAD;break}if(B.flags&57344){N.msg="unknown header flags set",B.mode=BAD;break}B.head&&(B.head.text=U>>8&1),B.flags&512&&B.wrap&4&&(ye[0]=U&255,ye[1]=U>>>8&255,B.check=crc32_1(B.check,ye,2,0)),U=0,j=0,B.mode=TIME;case TIME:for(;j<32;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.head&&(B.head.time=U),B.flags&512&&B.wrap&4&&(ye[0]=U&255,ye[1]=U>>>8&255,ye[2]=U>>>16&255,ye[3]=U>>>24&255,B.check=crc32_1(B.check,ye,4,0)),U=0,j=0,B.mode=OS;case OS:for(;j<16;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.head&&(B.head.xflags=U&255,B.head.os=U>>8),B.flags&512&&B.wrap&4&&(ye[0]=U&255,ye[1]=U>>>8&255,B.check=crc32_1(B.check,ye,2,0)),U=0,j=0,B.mode=EXLEN;case EXLEN:if(B.flags&1024){for(;j<16;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.length=U,B.head&&(B.head.extra_len=U),B.flags&512&&B.wrap&4&&(ye[0]=U&255,ye[1]=U>>>8&255,B.check=crc32_1(B.check,ye,2,0)),U=0,j=0}else B.head&&(B.head.extra=null);B.mode=EXTRA;case EXTRA:if(B.flags&1024&&(Y=B.length,Y>T&&(Y=T),Y&&(B.head&&(ue=B.head.extra_len-B.length,B.head.extra||(B.head.extra=new Uint8Array(B.head.extra_len)),B.head.extra.set(F.subarray(D,D+Y),ue)),B.flags&512&&B.wrap&4&&(B.check=crc32_1(B.check,F,Y,D)),T-=Y,D+=Y,B.length-=Y),B.length))break e;B.length=0,B.mode=NAME;case NAME:if(B.flags&2048){if(T===0)break e;Y=0;do ue=F[D+Y++],B.head&&ue&&B.length<65536&&(B.head.name+=String.fromCharCode(ue));while(ue&&Y<T);if(B.flags&512&&B.wrap&4&&(B.check=crc32_1(B.check,F,Y,D)),T-=Y,D+=Y,ue)break e}else B.head&&(B.head.name=null);B.length=0,B.mode=COMMENT;case COMMENT:if(B.flags&4096){if(T===0)break e;Y=0;do ue=F[D+Y++],B.head&&ue&&B.length<65536&&(B.head.comment+=String.fromCharCode(ue));while(ue&&Y<T);if(B.flags&512&&B.wrap&4&&(B.check=crc32_1(B.check,F,Y,D)),T-=Y,D+=Y,ue)break e}else B.head&&(B.head.comment=null);B.mode=HCRC;case HCRC:if(B.flags&512){for(;j<16;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(B.wrap&4&&U!==(B.check&65535)){N.msg="header crc mismatch",B.mode=BAD;break}U=0,j=0}B.head&&(B.head.hcrc=B.flags>>9&1,B.head.done=!0),N.adler=B.check=0,B.mode=TYPE;break;case DICTID:for(;j<32;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}N.adler=B.check=zswap32(U),U=0,j=0,B.mode=DICT;case DICT:if(B.havedict===0)return N.next_out=i,N.avail_out=C,N.next_in=D,N.avail_in=T,B.hold=U,B.bits=j,Z_NEED_DICT$1;N.adler=B.check=1,B.mode=TYPE;case TYPE:if(M===Z_BLOCK||M===Z_TREES)break e;case TYPEDO:if(B.last){U>>>=j&7,j-=j&7,B.mode=CHECK;break}for(;j<3;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}switch(B.last=U&1,U>>>=1,j-=1,U&3){case 0:B.mode=STORED;break;case 1:if(fixedtables(B),B.mode=LEN_,M===Z_TREES){U>>>=2,j-=2;break e}break;case 2:B.mode=TABLE;break;case 3:N.msg="invalid block type",B.mode=BAD}U>>>=2,j-=2;break;case STORED:for(U>>>=j&7,j-=j&7;j<32;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if((U&65535)!==(U>>>16^65535)){N.msg="invalid stored block lengths",B.mode=BAD;break}if(B.length=U&65535,U=0,j=0,B.mode=COPY_,M===Z_TREES)break e;case COPY_:B.mode=COPY;case COPY:if(Y=B.length,Y){if(Y>T&&(Y=T),Y>C&&(Y=C),Y===0)break e;A.set(F.subarray(D,D+Y),i),T-=Y,D+=Y,C-=Y,i+=Y,B.length-=Y;break}B.mode=TYPE;break;case TABLE:for(;j<14;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(B.nlen=(U&31)+257,U>>>=5,j-=5,B.ndist=(U&31)+1,U>>>=5,j-=5,B.ncode=(U&15)+4,U>>>=4,j-=4,B.nlen>286||B.ndist>30){N.msg="too many length or distance symbols",B.mode=BAD;break}B.have=0,B.mode=LENLENS;case LENLENS:for(;B.have<B.ncode;){for(;j<3;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.lens[be[B.have++]]=U&7,U>>>=3,j-=3}for(;B.have<19;)B.lens[be[B.have++]]=0;if(B.lencode=B.lendyn,B.lenbits=7,re={bits:B.lenbits},fe=inftrees(CODES,B.lens,0,19,B.lencode,0,B.work,re),B.lenbits=re.bits,fe){N.msg="invalid code lengths set",B.mode=BAD;break}B.have=0,B.mode=CODELENS;case CODELENS:for(;B.have<B.nlen+B.ndist;){for(;se=B.lencode[U&(1<<B.lenbits)-1],oe=se>>>24,he=se>>>16&255,ke=se&65535,!(oe<=j);){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(ke<16)U>>>=oe,j-=oe,B.lens[B.have++]=ke;else{if(ke===16){for(de=oe+2;j<de;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(U>>>=oe,j-=oe,B.have===0){N.msg="invalid bit length repeat",B.mode=BAD;break}ue=B.lens[B.have-1],Y=3+(U&3),U>>>=2,j-=2}else if(ke===17){for(de=oe+3;j<de;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}U>>>=oe,j-=oe,ue=0,Y=3+(U&7),U>>>=3,j-=3}else{for(de=oe+7;j<de;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}U>>>=oe,j-=oe,ue=0,Y=11+(U&127),U>>>=7,j-=7}if(B.have+Y>B.nlen+B.ndist){N.msg="invalid bit length repeat",B.mode=BAD;break}for(;Y--;)B.lens[B.have++]=ue}}if(B.mode===BAD)break;if(B.lens[256]===0){N.msg="invalid code -- missing end-of-block",B.mode=BAD;break}if(B.lenbits=9,re={bits:B.lenbits},fe=inftrees(LENS,B.lens,0,B.nlen,B.lencode,0,B.work,re),B.lenbits=re.bits,fe){N.msg="invalid literal/lengths set",B.mode=BAD;break}if(B.distbits=6,B.distcode=B.distdyn,re={bits:B.distbits},fe=inftrees(DISTS,B.lens,B.nlen,B.ndist,B.distcode,0,B.work,re),B.distbits=re.bits,fe){N.msg="invalid distances set",B.mode=BAD;break}if(B.mode=LEN_,M===Z_TREES)break e;case LEN_:B.mode=LEN;case LEN:if(T>=6&&C>=258){N.next_out=i,N.avail_out=C,N.next_in=D,N.avail_in=T,B.hold=U,B.bits=j,inffast(N,K),i=N.next_out,A=N.output,C=N.avail_out,D=N.next_in,F=N.input,T=N.avail_in,U=B.hold,j=B.bits,B.mode===TYPE&&(B.back=-1);break}for(B.back=0;se=B.lencode[U&(1<<B.lenbits)-1],oe=se>>>24,he=se>>>16&255,ke=se&65535,!(oe<=j);){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(he&&(he&240)===0){for(ie=oe,ce=he,pe=ke;se=B.lencode[pe+((U&(1<<ie+ce)-1)>>ie)],oe=se>>>24,he=se>>>16&255,ke=se&65535,!(ie+oe<=j);){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}U>>>=ie,j-=ie,B.back+=ie}if(U>>>=oe,j-=oe,B.back+=oe,B.length=ke,he===0){B.mode=LIT;break}if(he&32){B.back=-1,B.mode=TYPE;break}if(he&64){N.msg="invalid literal/length code",B.mode=BAD;break}B.extra=he&15,B.mode=LENEXT;case LENEXT:if(B.extra){for(de=B.extra;j<de;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.length+=U&(1<<B.extra)-1,U>>>=B.extra,j-=B.extra,B.back+=B.extra}B.was=B.length,B.mode=DIST;case DIST:for(;se=B.distcode[U&(1<<B.distbits)-1],oe=se>>>24,he=se>>>16&255,ke=se&65535,!(oe<=j);){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if((he&240)===0){for(ie=oe,ce=he,pe=ke;se=B.distcode[pe+((U&(1<<ie+ce)-1)>>ie)],oe=se>>>24,he=se>>>16&255,ke=se&65535,!(ie+oe<=j);){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}U>>>=ie,j-=ie,B.back+=ie}if(U>>>=oe,j-=oe,B.back+=oe,he&64){N.msg="invalid distance code",B.mode=BAD;break}B.offset=ke,B.extra=he&15,B.mode=DISTEXT;case DISTEXT:if(B.extra){for(de=B.extra;j<de;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.offset+=U&(1<<B.extra)-1,U>>>=B.extra,j-=B.extra,B.back+=B.extra}if(B.offset>B.dmax){N.msg="invalid distance too far back",B.mode=BAD;break}B.mode=MATCH;case MATCH:if(C===0)break e;if(Y=K-C,B.offset>Y){if(Y=B.offset-Y,Y>B.whave&&B.sane){N.msg="invalid distance too far back",B.mode=BAD;break}Y>B.wnext?(Y-=B.wnext,te=B.wsize-Y):te=B.wnext-Y,Y>B.length&&(Y=B.length),ae=B.window}else ae=A,te=i-B.offset,Y=B.length;Y>C&&(Y=C),C-=Y,B.length-=Y;do A[i++]=ae[te++];while(--Y);B.length===0&&(B.mode=LEN);break;case LIT:if(C===0)break e;A[i++]=B.length,C--,B.mode=LEN;break;case CHECK:if(B.wrap){for(;j<32;){if(T===0)break e;T--,U|=F[D++]<<j,j+=8}if(K-=C,N.total_out+=K,B.total+=K,B.wrap&4&&K&&(N.adler=B.check=B.flags?crc32_1(B.check,A,K,i-K):adler32_1(B.check,A,K,i-K)),K=C,B.wrap&4&&(B.flags?U:zswap32(U))!==B.check){N.msg="incorrect data check",B.mode=BAD;break}U=0,j=0}B.mode=LENGTH;case LENGTH:if(B.wrap&&B.flags){for(;j<32;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(B.wrap&4&&U!==(B.total&4294967295)){N.msg="incorrect length check",B.mode=BAD;break}U=0,j=0}B.mode=DONE;case DONE:fe=Z_STREAM_END$1;break e;case BAD:fe=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return N.next_out=i,N.avail_out=C,N.next_in=D,N.avail_in=T,B.hold=U,B.bits=j,(B.wsize||K!==N.avail_out&&B.mode<BAD&&(B.mode<CHECK||M!==Z_FINISH$1))&&updatewindow(N,N.output,N.next_out,K-N.avail_out),z-=N.avail_in,K-=N.avail_out,N.total_in+=z,N.total_out+=K,B.total+=K,B.wrap&4&&K&&(N.adler=B.check=B.flags?crc32_1(B.check,A,K,N.next_out-K):adler32_1(B.check,A,K,N.next_out-K)),N.data_type=B.bits+(B.last?64:0)+(B.mode===TYPE?128:0)+(B.mode===LEN_||B.mode===COPY_?256:0),(z===0&&K===0||M===Z_FINISH$1)&&fe===Z_OK$1&&(fe=Z_BUF_ERROR),fe},inflateEnd=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;let M=N.state;return M.window&&(M.window=null),N.state=null,Z_OK$1},inflateGetHeader=(N,M)=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const B=N.state;return(B.wrap&2)===0?Z_STREAM_ERROR$1:(B.head=M,M.done=!1,Z_OK$1)},inflateSetDictionary=(N,M)=>{const B=M.length;let F,A,D;return inflateStateCheck(N)||(F=N.state,F.wrap!==0&&F.mode!==DICT)?Z_STREAM_ERROR$1:F.mode===DICT&&(A=1,A=adler32_1(A,M,B,0),A!==F.check)?Z_DATA_ERROR$1:(D=updatewindow(N,M,B,B),D?(F.mode=MEM,Z_MEM_ERROR$1):(F.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){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}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(N){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},N||{});const M=this.options;M.raw&&M.windowBits>=0&&M.windowBits<16&&(M.windowBits=-M.windowBits,M.windowBits===0&&(M.windowBits=-15)),M.windowBits>=0&&M.windowBits<16&&!(N&&N.windowBits)&&(M.windowBits+=32),M.windowBits>15&&M.windowBits<48&&(M.windowBits&15)===0&&(M.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let B=inflate_1$2.inflateInit2(this.strm,M.windowBits);if(B!==Z_OK)throw new Error(messages[B]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),M.dictionary&&(typeof M.dictionary=="string"?M.dictionary=strings.string2buf(M.dictionary):toString.call(M.dictionary)==="[object ArrayBuffer]"&&(M.dictionary=new Uint8Array(M.dictionary)),M.raw&&(B=inflate_1$2.inflateSetDictionary(this.strm,M.dictionary),B!==Z_OK)))throw new Error(messages[B])}Inflate$1.prototype.push=function(N,M){const B=this.strm,F=this.options.chunkSize,A=this.options.dictionary;let D,i,T;if(this.ended)return!1;for(M===~~M?i=M:i=M===!0?Z_FINISH:Z_NO_FLUSH,toString.call(N)==="[object ArrayBuffer]"?B.input=new Uint8Array(N):B.input=N,B.next_in=0,B.avail_in=B.input.length;;){for(B.avail_out===0&&(B.output=new Uint8Array(F),B.next_out=0,B.avail_out=F),D=inflate_1$2.inflate(B,i),D===Z_NEED_DICT&&A&&(D=inflate_1$2.inflateSetDictionary(B,A),D===Z_OK?D=inflate_1$2.inflate(B,i):D===Z_DATA_ERROR&&(D=Z_NEED_DICT));B.avail_in>0&&D===Z_STREAM_END&&B.state.wrap>0&&N[B.next_in]!==0;)inflate_1$2.inflateReset(B),D=inflate_1$2.inflate(B,i);switch(D){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(D),this.ended=!0,!1}if(T=B.avail_out,B.next_out&&(B.avail_out===0||D===Z_STREAM_END))if(this.options.to==="string"){let C=strings.utf8border(B.output,B.next_out),U=B.next_out-C,j=strings.buf2string(B.output,C);B.next_out=U,B.avail_out=F-U,U&&B.output.set(B.output.subarray(C,C+U),0),this.onData(j)}else this.onData(B.output.length===B.next_out?B.output:B.output.subarray(0,B.next_out));if(!(D===Z_OK&&T===0)){if(D===Z_STREAM_END)return D=inflate_1$2.inflateEnd(this.strm),this.onEnd(D),this.ended=!0,!0;if(B.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(N){this.chunks.push(N)},Inflate$1.prototype.onEnd=function(N){N===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=N,this.msg=this.strm.msg};function inflate$1(N,M){const B=new Inflate$1(M);if(B.push(N),B.err)throw B.msg||messages[B.err];return B.result}function inflateRaw$1(N,M){return M=M||{},M.raw=!0,inflate$1(N,M)}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1,{Inflate,inflate,inflateRaw,ungzip}=inflate_1$1;var Deflate_1=Deflate,deflate_1=deflate,deflateRaw_1=deflateRaw,gzip_1=gzip,Inflate_1=Inflate,inflate_1=inflate,inflateRaw_1=inflateRaw,ungzip_1=ungzip,constants_1=constants$2,pako={Deflate:Deflate_1,deflate:deflate_1,deflateRaw:deflateRaw_1,gzip:gzip_1,Inflate:Inflate_1,inflate:inflate_1,inflateRaw:inflateRaw_1,ungzip:ungzip_1,constants:constants_1};const compressArrayBuffer=N=>{const M=new Uint8Array(N),B=pako.deflate(M,{gzip:!0});return new Uint8Array(B?.buffer)},decompressArrayBuffer=N=>{const M=new Uint8Array(N),B=pako.inflate(M,{gzip:!0});return new Uint8Array(B?.buffer)},sendMessageFormat=N=>{const{event:M,compress:B=!1}=N;switch(N.data_original=N.data,N.time&&(N.timeStr=u(N.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),M){case"login":N.data=com.quick.voice.proto.Login.encode(N.data).finish();break;case"joinRoom":case"joinRoomEx":N.data=com.quick.voice.proto.JoinReq.encode(N.data).finish();break;case"quitRoom":N.data=com.quick.voice.proto.QuitReq.encode(N.data).finish();break;case"connectCF":N.data=com.quick.voice.proto.ConnectCFReq.encode(N.data).finish();break;case"publish":N.data=com.quick.voice.proto.PublishReq.encode(N.data).finish();break;case"pubChannel":N.data=com.quick.voice.proto.ChannelPublishReq.encode(N.data).finish();break;case"subscribe":N.data=com.quick.voice.proto.SubscribeReq.encode(N.data).finish();break;case"subscribeEx":N.data=com.quick.voice.proto.SubscribeReq.encode(N.data).finish();break;case"updateSimulcast":N.data=com.quick.voice.proto.SubscribeReq.encode(N.data).finish();break;case"offer":N.data=com.quick.voice.proto.SdpConsult.encode(N.data).finish();break;case"answer":N.data=com.quick.voice.proto.SdpConsult.encode(N.data).finish();break;case"candidate":N.data=com.quick.voice.proto.Candidates.encode(N.data).finish();break;case"subChannel":N.data=com.quick.voice.proto.ChannelSubscribeRsq.encode(N.data).finish();break;case"closeTrack":N.data=com.quick.voice.proto.CloseTrackReq.encode(N.data).finish();break;case"renegotiate":N.data=com.quick.voice.proto.RenegotiateReq.encode(N.data).finish();break;case"reportNetwork":N.data=com.quick.voice.proto.ReportNetInfo.encode(N.data).finish();break;case"reportP2PConnectEx":N.data=com.quick.voice.proto.ReportP2PExReq.encode(N.data).finish();break;case"syncRoomInfo":N.data=com.quick.voice.proto.SyncRoomInfoReq.encode(N.data).finish();break;case"updateCall":N.data=com.quick.voice.proto.UpdateCall.encode(N.data).finish();break;case"networkQualityChange":N.data=com.quick.voice.proto.NetQualityChange.encode(N.data).finish();break;case"pubNotify":N.data=com.quick.voice.proto.PublishNotify.encode(N.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":N.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode(N.data).finish();break;case"heartbeat":N.data=com.quick.voice.proto.ReportTrafficUsage.encode(N.data).finish();break;case"ackMsg":N.data=com.quick.voice.proto.AckMsgReq.encode(N.data).finish();break;case"UpdateTrackActive":N.data=com.quick.voice.proto.UpdateTrackState.encode(N.data).finish();break;default:N.data=new Uint8Array;break}if(B)try{N.data=compressArrayBuffer(N.data)}catch(F){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息压缩错误",F)}return N},onMessageFormat=N=>{const{event:M,compress:B=!1}=N;if(N.data_remote=N.data,N.time&&(N.timeStr=u(N.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),B)try{N.data=decompressArrayBuffer(N.data)}catch(F){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",F)}switch(M){case"login":N.data=com.quick.voice.proto.Login.decode(N.data);break;case"joinRoom":case"joinRoomEx":N.data=com.quick.voice.proto.JoinRsp.decode(N.data);break;case"onJoinRoom":N.data=com.quick.voice.proto.JoinNotify.decode(N.data);break;case"onQuitRoom":N.data=com.quick.voice.proto.QuitNotify.decode(N.data);break;case"connectCF":N.data=com.quick.voice.proto.ConnectCFRsp.decode(N.data);break;case"publish":N.data=com.quick.voice.proto.PublishRsp.decode(N.data);break;case"pubChannel":N.data=com.quick.voice.proto.ChannelPublishRsq.decode(N.data);break;case"onPublish":N.data=com.quick.voice.proto.PublishNotify.decode(N.data);break;case"subscribe":N.data=com.quick.voice.proto.SubscribeRsp.decode(N.data);break;case"subscribeEx":N.data=com.quick.voice.proto.SubscribeRsp.decode(N.data);break;case"updateVideoTracks":N.data=com.quick.voice.proto.SubscribeRsp.decode(N.data);break;case"onAttemptP2PEx":N.data=com.quick.voice.proto.P2PAvailablePeerNotify.decode(N.data);break;case"onOffer":N.data=com.quick.voice.proto.SdpConsult.decode(N.data);break;case"onAnswer":N.data=com.quick.voice.proto.SdpConsult.decode(N.data);break;case"onCandidate":N.data=com.quick.voice.proto.Candidates.decode(N.data);break;case"subChannel":N.data=com.quick.voice.proto.ChannelSubscribeRsq.decode(N.data);break;case"closeTrack":N.data=com.quick.voice.proto.CloseTrackRsp.decode(N.data);break;case"onCloseTrack":N.data=com.quick.voice.proto.CloseTrackNotify.decode(N.data);break;case"onTrackInactive":N.data=com.quick.voice.proto.CheckSessionRsq.decode(N.data);break;case"onDisconnectedP2P":N.data=com.quick.voice.proto.P2PDisconnectedNotify.decode(N.data);break;case"onUpdateCall":N.data=com.quick.voice.proto.UpdateCall.decode(N.data);break;case"onDataChannelPublish":N.data=com.quick.voice.proto.UserChannel.decode(N.data);break;case"onDestroyRoom":N.data=com.quick.voice.proto.QuitNotify.decode(N.data);break;case"onUpdatePermissions":N.data=com.quick.voice.proto.UpdatePermissions.decode(N.data);break;case"onNetQuality":N.data=com.quick.voice.proto.NetQualityNotify.decode(N.data);break;case"syncRoomInfo":N.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(N.data);break;case"onCDNPlayUrlAdd":N.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(N.data);break;case"onUpdateBehavior":N.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(N.data);break;case"UpdateTrackActive":N.data=com.quick.voice.proto.UpdateTrackState.decode(N.data);break;case"onRoomUserSpeech":N.data=com.quick.voice.proto.RoomSpeechNotify.decode(N.data);break;case"debugger":case"ai":{N.data=JSON.parse(new TextDecoder().decode(N.data));break}}return N},obj2pb=N=>com.quick.voice.proto.CommonReq.encode(N).finish(),pb2obj=N=>com.quick.voice.proto.CommonRsp.decode(N),reqIgnoreEvents=["updateSeverTime"];reqIgnoreEvents.push("heartbeat"),reqIgnoreEvents.push("heartbeatEx"),reqIgnoreEvents.push("networkQualityChange"),reqIgnoreEvents.push("updateCall"),reqIgnoreEvents.push("ackMsg");const resIgnoreEvents=["updateSeverTime"];resIgnoreEvents.push("heartbeat"),resIgnoreEvents.push("heartbeatEx"),resIgnoreEvents.push("networkQualityChange"),resIgnoreEvents.push("onRoomUserSpeech"),resIgnoreEvents.push("onNetQuality"),resIgnoreEvents.push("updateCall"),resIgnoreEvents.push("pubNotify"),resIgnoreEvents.push("reportNetwork"),resIgnoreEvents.push("ackMsg"),resIgnoreEvents.push("offer"),resIgnoreEvents.push("candidate"),resIgnoreEvents.push("answer"),resIgnoreEvents.push("reportP2PConnect");class CallsWebSocket{#e={url:"wss://putplay.cqrjz.com/websocket",debug:!1,timeout:30*1e3};prws=new H({url:"",binaryType:"arraybuffer",reconnectCount:8,timeout:10*1e3,reconnectTime:40*1e3});activeTimeStamp=0;#n={};#t={};constructor(M){this.#e={...this.#e,...M},this.prws.setOptions(this.#e),this.prws.onMessage=this.#a,this.prws.getHeartbeatMsg=()=>""}getUrl=async(M="prod")=>{try{const A=(await(await fetch(`https://address.putplay.cc/?env=${M}`)).json()).domain;this.#e.url=A,this.prws.setOptions({url:A})}catch(B){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: get serve url is error.",B)}};afreshSends=()=>{const M=Object.keys(this.#n);if(M.length!==0){if(this.#e){const B=Array.from(Object.values(this.#n),F=>F.message.event);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: afreshSends",B)}for(const B of M){const F=this.#n[B];F&&F.send()}}};#r=(M,B={})=>{try{const{time:F,event:A,data:D={},data_original:i={},data_remote:T,...C}=B,U=u(F,"YYYY-MM-DD hh:mm:ss",{offset:480});let j={};const z=(ke={})=>{const ie=JSON.parse(JSON.stringify(ke)),ce=Object.keys(ie);for(const pe of ce)(pe.includes("sdp")||pe.includes("Sdp"))&&(ie[pe]="");return ie};let K="res ↓";switch(M){case"res":K="res ↓",j=z(D);break;case"req":K="req ↑",j=z(i);break}let Y="#quickvo.logs";(reqIgnoreEvents.includes(A)||resIgnoreEvents.includes(A))&&(Y="#quickvo.ignoreEvents");const te={"#action":K,timeStr:U,event:A,data:j,time:F,...C},ae=localStorage.getItem(Y)||JSON.stringify([]),se=JSON.parse(ae);let oe=A==="heartbeat"||A==="heartbeatEx";const he=[te];for(const ke of se){const{event:ie}=ke;if(ie==="heartbeat"||ie==="heartbeatEx"){if(oe)continue;oe=!0}if(he.length===200)break;he.push(ke)}localStorage.setItem(Y,JSON.stringify(he))}catch(F){this.#e.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",F)}};#o=(M,{resolve:B,reject:F},A)=>{const{sn:D=""}=M,i={message:M,resolve:B,reject:F,send:()=>{},destruction:()=>{}};let T=0;if(A&&(T=window.setTimeout(()=>{console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: event is timeout: ${T}`,i),delete this.#n[D],F(`event is timeout: ${T}`)},this.#e.timeout)),i.destruction=()=>{clearTimeout(T),delete this.#n[D]},i.send=()=>{i.message.time=Date.now(),this.#e.debug&&!reqIgnoreEvents.includes(i.message.event)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",M);const C=com.quick.voice.proto.CommonReq.encode(M).finish();this.prws?.sendMessage(C),A||B(!0)},A){const C=this.#n[D];C&&C.destruction(),this.#n[D]=i}return i};#i=M=>this.#n[M];#a=async M=>{const B=new Uint8Array(M),F=com.quick.voice.proto.CommonRsp.decode(B),{sn:A,event:D}=F,i=onMessageFormat(F);if(this.#r("res",i),this.#e.debug&&!resIgnoreEvents.includes(D)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",i),["heartbeat","heartbeatEx"].includes(D)&&(this.activeTimeStamp=new Date().getTime()),notifyName_keys.includes(D))return this.emitNotify(D,_(i,["code","data","desc"]));const C=this.#i(A);if(C){const{resolve:U=z=>{},destruction:j=()=>{}}=C;U(_(i,["code","data","desc","sn"])),j()}};clearEvents=(M=[])=>{const B=Object.keys(this.#n);M.length===0&&(M=B);for(const F of B){if(!M.includes(F))continue;const A=this.#n[F];if(A){const{destruction:D}=A;D()}}};connect=async()=>new Promise(async(M,B)=>{try{const F=new Date().getTime();await this.prws.connect();const A=new Date().getTime();if(this.activeTimeStamp=A,this.#e.debug){const D=A-F;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${D}ms-广播事件`,this.#t)}M(this.prws)}catch(F){B(F)}});close=async()=>{this.clearEvents(),await this.prws?.close(),this.#e.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.")};sendMessage=(M,B=!0)=>new Promise(async(F,A)=>{const{event:D,...i}=M,T=Date.now(),C=sendMessageFormat({event:D,sn:+`${T}${Q(1e3,9999)}`,time:T,valid:this.#e.timeout,version:3,compress:!1,...i});this.#r("req",C),this.#o(C,{resolve:F,reject:A},B).send()});emitNotify=async(M,B)=>{const F=this.#t[M];if(!F)return;const A=[...F.keys()];for(const D of A){const i=F.get(D);if(!i)continue;const{callback:T=async()=>{}}=i;await T(B)}};addNotify=(M,B=!1)=>{M.sn||(M.sn=Mt(32));const{event:F,sn:A}=M;return this.#t[F]||(this.#t[F]=new Map),this.#t[F].set(A,M),A};removeNotify=(M=[])=>{if(M.length===0)this.#t={};else{const B=Object.keys(this.#t);for(const F of B){const A=this.#t[F];if(!A)continue;const D=[...A.keys()];for(const i of D)M.includes(i)&&A.delete(i)}}this.#e.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",this.#t)}}const createMutedAudioStream=N=>{const M=N.createOscillator();M.type="sine",M.frequency.setValueAtTime(0,N.currentTime);const B=N.createGain();B.gain.value=0,M.connect(B),B.connect(N.destination),M.start();const F=N.createMediaStreamDestination();return B.disconnect(),M.connect(F),F.stream},createFakeVideoStream=(N=10,M=10,B=1)=>{const F=document.createElement("canvas"),A=F.getContext("2d");F.width=N,F.height=M;let D=0;const i=F.captureStream(B),T=()=>{A.clearRect(0,0,F.width,F.height);const C=A.createLinearGradient(0,0,F.width,F.height);C.addColorStop(0,`hsla(${D}, 100%, 50%, 0)`),C.addColorStop(1,`hsla(${D+120}, 100%, 50%, 0)`),A.fillStyle=C,A.fillRect(0,0,F.width,F.height),D=(D+1)%360,i.active===!0&&setTimeout(T,1e3)};return T(),i},isMobile=()=>{const N=navigator.userAgent.toLowerCase();return new RegExp("mobile|android|iphone|ipad|ipod|windows phone|phone|webos","i").test(N)};var lib={},ebml={},EBML={},hasRequiredEBML;function requireEBML(){return hasRequiredEBML||(hasRequiredEBML=1,Object.defineProperty(EBML,"__esModule",{value:!0})),EBML}var EBMLDecoder={},int64Buffer={},hasRequiredInt64Buffer;function requireInt64Buffer(){return hasRequiredInt64Buffer||(hasRequiredInt64Buffer=1,(function(N){(function(M){var B="undefined",F=B!==typeof Buffer&&Buffer,A=B!==typeof Uint8Array&&Uint8Array,D=B!==typeof ArrayBuffer&&ArrayBuffer,i=[0,0,0,0,0,0,0,0],T=Array.isArray||pe,C=4294967296,U=16777216,j;z("Uint64BE",!0,!0),z("Int64BE",!0,!1),z("Uint64LE",!1,!0),z("Int64LE",!1,!1);function z(ue,fe,ye){var re=fe?0:4,de=fe?4:0,be=fe?0:3,_e=fe?1:2,we=fe?2:1,ge=fe?3:0,Ee=fe?he:ie,qe=fe?ke:ce,Me=Re.prototype,ze="is"+ue,Ke="_"+ze;return Me.buffer=void 0,Me.offset=0,Me[Ke]=!0,Me.toNumber=He,Me.toString=Ge,Me.toJSON=He,Me.toArray=K,F&&(Me.toBuffer=Y),A&&(Me.toArrayBuffer=te),Re[ze]=$e,M[ue]=Re,Re;function Re(Oe,Se,Ie,Te){return this instanceof Re?Ve(this,Oe,Se,Ie,Te):new Re(Oe,Se,Ie,Te)}function $e(Oe){return!!(Oe&&Oe[Ke])}function Ve(Oe,Se,Ie,Te,Ce){if(A&&D&&(Se instanceof D&&(Se=new A(Se)),Te instanceof D&&(Te=new A(Te))),!Se&&!Ie&&!Te&&!j){Oe.buffer=oe(i,0);return}if(!ae(Se,Ie)){var Ue=j||Array;Ce=Ie,Te=Se,Ie=0,Se=j===F?F.alloc(8):new Ue(8)}Oe.buffer=Se,Oe.offset=Ie|=0,B!==typeof Te&&(typeof Te=="string"?Ne(Se,Ie,Te,Ce||10):ae(Te,Ce)?se(Se,Ie,Te,Ce):typeof Ce=="number"?(Ze(Se,Ie+re,Te),Ze(Se,Ie+de,Ce)):Te>0?Ee(Se,Ie,Te):Te<0?qe(Se,Ie,Te):se(Se,Ie,i,0))}function Ne(Oe,Se,Ie,Te){var Ce=0,Ue=Ie.length,je=0,Fe=0;Ie[0]==="-"&&Ce++;for(var We=Ce;Ce<Ue;){var Qe=parseInt(Ie[Ce++],Te);if(!(Qe>=0))break;Fe=Fe*Te+Qe,je=je*Te+Math.floor(Fe/C),Fe%=C}We&&(je=~je,Fe?Fe=C-Fe:je++),Ze(Oe,Se+re,je),Ze(Oe,Se+de,Fe)}function He(){var Oe=this.buffer,Se=this.offset,Ie=Le(Oe,Se+re),Te=Le(Oe,Se+de);return ye||(Ie|=0),Ie?Ie*C+Te:Te}function Ge(Oe){var Se=this.buffer,Ie=this.offset,Te=Le(Se,Ie+re),Ce=Le(Se,Ie+de),Ue="",je=!ye&&Te&2147483648;for(je&&(Te=~Te,Ce=C-Ce),Oe=Oe||10;;){var Fe=Te%Oe*C+Ce;if(Te=Math.floor(Te/Oe),Ce=Math.floor(Fe/Oe),Ue=(Fe%Oe).toString(Oe)+Ue,!Te&&!Ce)break}return je&&(Ue="-"+Ue),Ue}function Ze(Oe,Se,Ie){Oe[Se+ge]=Ie&255,Ie=Ie>>8,Oe[Se+we]=Ie&255,Ie=Ie>>8,Oe[Se+_e]=Ie&255,Ie=Ie>>8,Oe[Se+be]=Ie&255}function Le(Oe,Se){return Oe[Se+be]*U+(Oe[Se+_e]<<16)+(Oe[Se+we]<<8)+Oe[Se+ge]}}function K(ue){var fe=this.buffer,ye=this.offset;return j=null,ue!==!1&&T(fe)?fe.length===8?fe:fe.slice(ye,ye+8):oe(fe,ye)}function Y(ue){var fe=this.buffer,ye=this.offset;return j=F,ue!==!1&&F.isBuffer(fe)?fe.length===8?fe:fe.slice(ye,ye+8):F.from(te.call(this,ue))}function te(ue){var fe=this.buffer,ye=this.offset,re=fe.buffer;if(j=A,ue!==!1&&!fe.offset&&re instanceof D)return re.byteLength===8?re:re.slice(ye,ye+8);var de=new A(8);return se(de,0,fe,ye),de.buffer}function ae(ue,fe){var ye=ue&&ue.length;return fe|=0,ye&&fe+8<=ye&&typeof ue[fe]!="string"}function se(ue,fe,ye,re){fe|=0,re|=0;for(var de=0;de<8;de++)ue[fe++]=ye[re++]&255}function oe(ue,fe){return Array.prototype.slice.call(ue,fe,fe+8)}function he(ue,fe,ye){for(var re=fe+8;re>fe;)ue[--re]=ye&255,ye/=256}function ke(ue,fe,ye){var re=fe+8;for(ye++;re>fe;)ue[--re]=-ye&255^255,ye/=256}function ie(ue,fe,ye){for(var re=fe+8;fe<re;)ue[fe++]=ye&255,ye/=256}function ce(ue,fe,ye){var re=fe+8;for(ye++;fe<re;)ue[fe++]=-ye&255^255,ye/=256}function pe(ue){return!!ue&&Object.prototype.toString.call(ue)=="[object Array]"}})(typeof N.nodeName!="string"?N:int64Buffer||{})})(int64Buffer)),int64Buffer}var tools={},EBMLEncoder={},ebmlID={},hasRequiredEbmlID;function requireEbmlID(){return hasRequiredEbmlID||(hasRequiredEbmlID=1,Object.defineProperty(ebmlID,"__esModule",{value:!0}),ebmlID.byEbmlID=void 0,ebmlID.byEbmlID={128:{name:"ChapterDisplay",level:4,type:"m",multiple:!0,minver:1,webm:!0,description:"Contains all possible strings to use for the chapter display."},131:{name:"TrackType",level:3,type:"u",mandatory:!0,minver:1,range:"1-254",description:"A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control)."},133:{name:"ChapString",cppname:"ChapterString",level:5,type:"8",mandatory:!0,minver:1,webm:!0,description:"Contains the string to use as the chapter atom."},134:{name:"CodecID",level:3,type:"s",mandatory:!0,minver:1,description:"An ID corresponding to the codec, see the codec page for more info."},136:{name:"FlagDefault",cppname:"TrackFlagDefault",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)"},137:{name:"ChapterTrackNumber",level:5,type:"u",mandatory:!0,multiple:!0,minver:1,webm:!1,range:"not 0",description:"UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks."},145:{name:"ChapterTimeStart",level:4,type:"u",mandatory:!0,minver:1,webm:!0,description:"Timestamp of the start of Chapter (not scaled)."},146:{name:"ChapterTimeEnd",level:4,type:"u",minver:1,webm:!1,description:"Timestamp of the end of Chapter (timestamp excluded, not scaled)."},150:{name:"CueRefTime",level:5,type:"u",mandatory:!0,minver:2,webm:!1,description:"Timestamp of the referenced Block."},151:{name:"CueRefCluster",level:5,type:"u",mandatory:!0,webm:!1,description:"The Position of the Cluster containing the referenced Block."},152:{name:"ChapterFlagHidden",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},16980:{name:"ContentCompAlgo",level:6,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping"},16981:{name:"ContentCompSettings",level:6,type:"b",minver:1,webm:!1,description:"Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track."},17026:{name:"DocType",level:1,type:"s",mandatory:!0,default:"matroska",minver:1,description:"A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files."},17029:{name:"DocTypeReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum DocType version an interpreter has to support to read this file."},17030:{name:"EBMLVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of EBML parser used to create the file."},17031:{name:"DocTypeVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of DocType interpreter used to create the file."},17476:{name:"SegmentFamily",level:2,type:"b",multiple:!0,minver:1,webm:!1,bytesize:16,description:"A randomly generated unique ID that all segments related to each other must use (128 bits)."},17505:{name:"DateUTC",level:2,type:"d",minver:1,description:"Date of the origin of timestamp (value 0), i.e. production date."},17540:{name:"TagDefault",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Indication to know if this is the default/original language to use for the given tag. (1 bit)"},17541:{name:"TagBinary",level:4,type:"b",minver:1,webm:!1,description:"The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString."},17543:{name:"TagString",level:4,type:"8",minver:1,webm:!1,description:"The value of the Element."},17545:{name:"Duration",level:2,type:"f",minver:1,range:"> 0",description:"Duration of the segment (based on TimecodeScale)."},17816:{name:"ChapterFlagEnabled",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)"},18016:{name:"FileMimeType",level:3,type:"s",mandatory:!0,minver:1,webm:!1,description:"MIME type of the file."},18017:{name:"FileUsedStartTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18018:{name:"FileUsedEndTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18037:{name:"FileReferral",level:3,type:"b",webm:!1,description:"A binary value that a track/codec can refer to when the attachment is needed."},20529:{name:"ContentEncodingOrder",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment."},20530:{name:"ContentEncodingScope",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)"},20531:{name:"ContentEncodingType",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption"},20532:{name:"ContentCompression",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking."},20533:{name:"ContentEncryption",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise."},21368:{name:"CueBlockNumber",level:4,type:"u",minver:1,default:1,range:"not 0",description:"Number of the Block in the specified Cluster."},22100:{name:"ChapterStringUID",level:4,type:"8",mandatory:!1,minver:3,webm:!0,description:"A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage."},22337:{name:"WritingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Writing application ("mkvmerge-0.3.3").'},22612:{name:"SilentTracks",cppname:"ClusterSilentTracks",level:2,type:"m",minver:1,webm:!1,description:"The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use."},25152:{name:"ContentEncoding",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Settings for one content encoding like compression or encryption."},25188:{name:"BitDepth",cppname:"AudioBitDepth",level:4,type:"u",minver:1,range:"not 0",description:"Bits per sample, mostly used for PCM."},25906:{name:"SignedElement",level:3,type:"b",multiple:!0,webm:!1,description:"An element ID whose data will be used to compute the signature."},26148:{name:"TrackTranslate",level:3,type:"m",multiple:!0,minver:1,webm:!1,description:"The track identification for the given Chapter Codec."},26897:{name:"ChapProcessCommand",cppname:"ChapterProcessCommand",level:5,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26914:{name:"ChapProcessTime",cppname:"ChapterProcessTime",level:6,type:"u",mandatory:!0,minver:1,webm:!1,description:"Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter)."},26916:{name:"ChapterTranslate",level:2,type:"m",multiple:!0,minver:1,webm:!1,description:"A tuple of corresponding ID used by chapter codecs to represent this segment."},26931:{name:"ChapProcessData",cppname:"ChapterProcessData",level:6,type:"b",mandatory:!0,minver:1,webm:!1,description:"Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands."},26948:{name:"ChapProcess",cppname:"ChapterProcess",level:4,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26965:{name:"ChapProcessCodecID",cppname:"ChapterProcessCodecID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later."},29555:{name:"Tag",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters."},29572:{name:"SegmentFilename",level:2,type:"8",minver:1,webm:!1,description:"A filename corresponding to this segment."},29766:{name:"AttachmentLink",cppname:"TrackAttachmentLink",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"The UID of an attachment that is used by this codec."},2459272:{name:"CodecName",level:3,type:"8",minver:1,description:"A human-readable string specifying the codec."},408125543:{name:"Segment",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment."},17530:{name:"TagLanguage",level:4,type:"s",mandatory:!0,minver:1,webm:!1,default:"und",description:"Specifies the language of the tag specified, in the Matroska languages form."},17827:{name:"TagName",level:4,type:"8",mandatory:!0,minver:1,webm:!1,description:"The name of the Tag that is going to be stored."},26568:{name:"SimpleTag",cppname:"TagSimple",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contains general information about the target."},25542:{name:"TagAttachmentUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment."},25540:{name:"TagChapterUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment."},25545:{name:"TagEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment."},25541:{name:"TagTrackUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment."},25546:{name:"TargetType",cppname:"TagTargetType",level:4,type:"s",minver:1,webm:!1,strong:"informational",description:'An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).'},26826:{name:"TargetTypeValue",cppname:"TagTargetTypeValue",level:4,type:"u",minver:1,webm:!1,default:50,description:"A number to indicate the logical level of the target (see TargetType)."},25536:{name:"Targets",cppname:"TagTargets",level:3,type:"m",mandatory:!0,minver:1,webm:!1,description:"Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment."},307544935:{name:"Tags",level:1,type:"m",multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here."},17677:{name:"ChapProcessPrivate",cppname:"ChapterProcessPrivate",level:5,type:"b",minver:1,webm:!1,description:'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.'},17278:{name:"ChapCountry",cppname:"ChapterCountry",level:5,type:"s",multiple:!0,minver:1,webm:!1,description:"The countries corresponding to the string, same 2 octets as in Internet domains."},17276:{name:"ChapLanguage",cppname:"ChapterLanguage",level:5,type:"s",mandatory:!0,multiple:!0,minver:1,webm:!0,default:"eng",description:"The languages corresponding to the string, in the bibliographic ISO-639-2 form."},143:{name:"ChapterTrack",level:4,type:"m",minver:1,webm:!1,description:"List of tracks on which the chapter applies. If this element is not present, all tracks apply"},25539:{name:"ChapterPhysicalEquiv",level:4,type:"u",minver:1,webm:!1,description:'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.'},28348:{name:"ChapterSegmentEditionUID",level:4,type:"u",minver:1,webm:!1,range:"not 0",description:"The EditionUID to play from the segment linked in ChapterSegmentUID."},28263:{name:"ChapterSegmentUID",level:4,type:"b",minver:1,webm:!1,range:">0",bytesize:16,description:"A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used."},29636:{name:"ChapterUID",level:4,type:"u",mandatory:!0,minver:1,webm:!0,range:"not 0",description:"A unique ID to identify the Chapter."},182:{name:"ChapterAtom",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains the atom information to use as the chapter atom (apply to all tracks)."},17885:{name:"EditionFlagOrdered",level:3,type:"u",minver:1,webm:!1,default:0,range:"0-1",description:"Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)"},17883:{name:"EditionFlagDefault",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a flag is set (1) the edition should be used as the default one. (1 bit)"},17853:{name:"EditionFlagHidden",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},17852:{name:"EditionUID",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"A unique ID to identify the edition. It's useful for tagging an edition."},17849:{name:"EditionEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains all information about a segment edition."},272869232:{name:"Chapters",level:1,type:"m",minver:1,webm:!0,description:"A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation."},18094:{name:"FileUID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,range:"not 0",description:"Unique ID representing the file, as random as possible."},18012:{name:"FileData",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The data of the file."},18030:{name:"FileName",level:3,type:"8",mandatory:!0,minver:1,webm:!1,description:"Filename of the attached file."},18046:{name:"FileDescription",level:3,type:"8",minver:1,webm:!1,description:"A human-friendly name for the attached file."},24999:{name:"AttachedFile",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"An attached file."},423732329:{name:"Attachments",level:1,type:"m",minver:1,webm:!1,description:"Contain attached files."},235:{name:"CueRefCodecState",level:5,type:"u",webm:!1,default:0,description:"The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry."},21343:{name:"CueRefNumber",level:5,type:"u",webm:!1,default:1,range:"not 0",description:"Number of the referenced Block of Track X in the specified Cluster."},219:{name:"CueReference",level:4,type:"m",multiple:!0,minver:2,webm:!1,description:"The Clusters containing the required referenced Blocks."},234:{name:"CueCodecState",level:4,type:"u",minver:2,webm:!1,default:0,description:"The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry."},178:{name:"CueDuration",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues."},240:{name:"CueRelativePosition",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.",position:"clusterRelative"},241:{name:"CueClusterPosition",level:4,type:"u",mandatory:!0,minver:1,description:"The position of the Cluster containing the required Block.",position:"segment"},247:{name:"CueTrack",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track for which a position is given."},183:{name:"CueTrackPositions",level:3,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contain positions for different tracks corresponding to the timestamp."},179:{name:"CueTime",level:3,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp according to the segment time base."},187:{name:"CuePoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains all information relative to a seek point in the segment."},475249515:{name:"Cues",level:1,type:"m",minver:1,description:'A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.'},18406:{name:"ContentSigHashAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5"},18405:{name:"ContentSigAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA"},18404:{name:"ContentSigKeyID",level:6,type:"b",minver:1,webm:!1,description:"This is the ID of the private key the data was signed with."},18403:{name:"ContentSignature",level:6,type:"b",minver:1,webm:!1,description:"A cryptographic signature of the contents."},18402:{name:"ContentEncKeyID",level:6,type:"b",minver:1,webm:!1,description:"For public key algorithms this is the ID of the public key the the data was encrypted with."},18401:{name:"ContentEncAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES"},28032:{name:"ContentEncodings",level:3,type:"m",minver:1,webm:!1,description:"Settings for several content encoding mechanisms like compression or encryption."},196:{name:"TrickMasterTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},199:{name:"TrickMasterTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},198:{name:"TrickTrackFlag",level:3,type:"u",divx:!0,default:0,description:"DivX trick track extenstions"},193:{name:"TrickTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},192:{name:"TrickTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},237:{name:"TrackJoinUID",level:5,type:"u",mandatory:!0,multiple:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of a track whose blocks are used to create this virtual track."},233:{name:"TrackJoinBlocks",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all tracks whose Blocks need to be combined to create this virtual track"},230:{name:"TrackPlaneType",level:6,type:"u",mandatory:!0,minver:3,webm:!1,description:"The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background)."},229:{name:"TrackPlaneUID",level:6,type:"u",mandatory:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of the track representing the plane."},228:{name:"TrackPlane",level:5,type:"m",mandatory:!0,multiple:!0,minver:3,webm:!1,description:"Contains a video plane track that need to be combined to create this 3D track"},227:{name:"TrackCombinePlanes",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all video plane tracks that need to be combined to create this 3D track"},226:{name:"TrackOperation",level:3,type:"m",minver:3,webm:!1,description:"Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject."},32123:{name:"ChannelPositions",cppname:"AudioPosition",level:4,type:"b",webm:!1,description:"Table of horizontal angles for each successive channel, see appendix."},159:{name:"Channels",cppname:"AudioChannels",level:4,type:"u",mandatory:!0,minver:1,default:1,range:"not 0",description:"Numbers of channels in the track."},30901:{name:"OutputSamplingFrequency",cppname:"AudioOutputSamplingFreq",level:4,type:"f",minver:1,default:"Sampling Frequency",range:"> 0",description:"Real output sampling frequency in Hz (used for SBR techniques)."},181:{name:"SamplingFrequency",cppname:"AudioSamplingFreq",level:4,type:"f",mandatory:!0,minver:1,default:8e3,range:"> 0",description:"Sampling frequency in Hz."},225:{name:"Audio",cppname:"TrackAudio",level:3,type:"m",minver:1,description:"Audio settings."},2327523:{name:"FrameRate",cppname:"VideoFrameRate",level:4,type:"f",range:"> 0",strong:"Informational",description:"Number of frames per second. only."},3126563:{name:"GammaValue",cppname:"VideoGamma",level:4,type:"f",webm:!1,range:"> 0",description:"Gamma Value."},3061028:{name:"ColourSpace",cppname:"VideoColourSpace",level:4,type:"b",minver:1,webm:!1,bytesize:4,description:"Same value as in AVI (32 bits)."},21683:{name:"AspectRatioType",cppname:"VideoAspectRatio",level:4,type:"u",minver:1,default:0,description:"Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)."},21682:{name:"DisplayUnit",cppname:"VideoDisplayUnit",level:4,type:"u",minver:1,default:0,description:"How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio)."},21690:{name:"DisplayHeight",cppname:"VideoDisplayHeight",level:4,type:"u",minver:1,default:"PixelHeight",range:"not 0",description:"Height of the video frames to display. The default value is only valid when DisplayUnit is 0."},21680:{name:"DisplayWidth",cppname:"VideoDisplayWidth",level:4,type:"u",minver:1,default:"PixelWidth",range:"not 0",description:"Width of the video frames to display. The default value is only valid when DisplayUnit is 0."},21725:{name:"PixelCropRight",cppname:"VideoPixelCropRight",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the right of the image."},21708:{name:"PixelCropLeft",cppname:"VideoPixelCropLeft",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the left of the image."},21691:{name:"PixelCropTop",cppname:"VideoPixelCropTop",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the top of the image."},21674:{name:"PixelCropBottom",cppname:"VideoPixelCropBottom",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the bottom of the image (for HDTV content)."},186:{name:"PixelHeight",cppname:"VideoPixelHeight",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Height of the encoded video frames in pixels."},176:{name:"PixelWidth",cppname:"VideoPixelWidth",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Width of the encoded video frames in pixels."},21433:{name:"OldStereoMode",level:4,type:"u",maxver:"0",webm:!1,divx:!1,description:"DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes)."},21440:{name:"AlphaMode",cppname:"VideoAlphaMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data."},21432:{name:"StereoMode",cppname:"VideoStereoMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes."},154:{name:"FlagInterlaced",cppname:"VideoFlagInterlaced",level:4,type:"u",mandatory:!0,minver:2,webm:!0,default:0,range:"0-1",description:"Set if the video is interlaced. (1 bit)"},224:{name:"Video",cppname:"TrackVideo",level:3,type:"m",minver:1,description:"Video settings."},26277:{name:"TrackTranslateTrackID",level:4,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used."},26303:{name:"TrackTranslateCodec",level:4,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},26364:{name:"TrackTranslateEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment."},22203:{name:"SeekPreRoll",level:3,type:"u",mandatory:!0,multiple:!1,default:0,minver:4,webm:!0,description:"After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid."},22186:{name:"CodecDelay",level:3,type:"u",multiple:!1,default:0,minver:4,webm:!0,description:"CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster."},28587:{name:"TrackOverlay",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc."},170:{name:"CodecDecodeAll",level:3,type:"u",mandatory:!0,minver:2,webm:!1,default:1,range:"0-1",description:"The codec can decode potentially damaged data (1 bit)."},2536e3:{name:"CodecDownloadURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to download about the codec used."},3883072:{name:"CodecInfoURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to find information about the codec used."},3839639:{name:"CodecSettings",level:3,type:"8",webm:!1,description:"A string describing the encoding setting used."},25506:{name:"CodecPrivate",level:3,type:"b",minver:1,description:"Private data only known to the codec."},2274716:{name:"Language",cppname:"TrackLanguage",level:3,type:"s",minver:1,default:"eng",description:"Specifies the language of the track in the Matroska languages form."},21358:{name:"Name",cppname:"TrackName",level:3,type:"8",minver:1,description:"A human-readable track name."},21998:{name:"MaxBlockAdditionID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The maximum value of BlockAdditions for this track."},21375:{name:"TrackOffset",level:3,type:"i",webm:!1,default:0,description:"A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track."},2306383:{name:"TrackTimecodeScale",level:3,type:"f",mandatory:!0,minver:1,maxver:"3",webm:!1,default:1,range:"> 0",description:"DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)."},2313850:{name:"DefaultDecodedFieldDuration",cppname:"TrackDefaultDecodedFieldDuration",level:3,type:"u",minver:4,range:"not 0",description:`The period in nanoseconds (not scaled by TimcodeScale)
4
- between two successive fields at the output of the decoding process (see the notes)`},2352003:{name:"DefaultDuration",cppname:"TrackDefaultDuration",level:3,type:"u",minver:1,range:"not 0",description:"Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block)."},28152:{name:"MaxCache",cppname:"TrackMaxCache",level:3,type:"u",minver:1,webm:!1,description:"The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed."},28135:{name:"MinCache",cppname:"TrackMinCache",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used."},156:{name:"FlagLacing",cppname:"TrackFlagLacing",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if the track may contain blocks using lacing. (1 bit)"},21930:{name:"FlagForced",cppname:"TrackFlagForced",level:3,type:"u",mandatory:!0,minver:1,default:0,range:"0-1",description:"Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)"},185:{name:"FlagEnabled",cppname:"TrackFlagEnabled",level:3,type:"u",mandatory:!0,minver:2,webm:!0,default:1,range:"0-1",description:"Set if the track is usable. (1 bit)"},29637:{name:"TrackUID",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file."},215:{name:"TrackNumber",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)."},174:{name:"TrackEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Describes a track with all elements."},374648427:{name:"Tracks",level:1,type:"m",multiple:!0,minver:1,description:"A top-level block of information with many tracks described."},175:{name:"EncryptedBlock",level:2,type:"b",multiple:!0,webm:!1,description:"Similar to EncryptedBlock Structure)"},202:{name:"ReferenceTimeCode",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},201:{name:"ReferenceOffset",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},200:{name:"ReferenceFrame",level:3,type:"m",multiple:!1,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},207:{name:"SliceDuration",level:5,type:"u",default:0,description:"The (scaled) duration to apply to the element."},206:{name:"Delay",cppname:"SliceDelay",level:5,type:"u",default:0,description:"The (scaled) delay to apply to the element."},203:{name:"BlockAdditionID",cppname:"SliceBlockAddID",level:5,type:"u",default:0,description:"The ID of the BlockAdditional element (0 is the main Block)."},205:{name:"FrameNumber",cppname:"SliceFrameNumber",level:5,type:"u",default:0,description:"The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)."},204:{name:"LaceNumber",cppname:"SliceLaceNumber",level:5,type:"u",minver:1,default:0,divx:!1,description:"The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},232:{name:"TimeSlice",level:4,type:"m",multiple:!0,minver:1,divx:!1,description:"Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},142:{name:"Slices",level:3,type:"m",minver:1,divx:!1,description:"Contains slices description."},30114:{name:"DiscardPadding",level:3,type:"i",minver:4,webm:!0,description:"Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback."},164:{name:"CodecState",level:3,type:"b",minver:2,webm:!1,description:"The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry."},253:{name:"ReferenceVirtual",level:3,type:"i",webm:!1,description:"Relative position of the data that should be in position of the virtual block."},251:{name:"ReferenceBlock",level:3,type:"i",multiple:!0,minver:1,description:"Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to."},250:{name:"ReferencePriority",cppname:"FlagReferenced",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced."},155:{name:"BlockDuration",level:3,type:"u",minver:1,default:"TrackDuration",description:'The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.'},165:{name:"BlockAdditional",level:5,type:"b",mandatory:!0,minver:1,webm:!1,description:"Interpreted by the codec as it wishes (using the BlockAddID)."},238:{name:"BlockAddID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"An ID to identify the BlockAdditional level."},166:{name:"BlockMore",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contain the BlockAdditional and some parameters."},30113:{name:"BlockAdditions",level:3,type:"m",minver:1,webm:!1,description:"Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data."},162:{name:"BlockVirtual",level:3,type:"b",webm:!1,description:"A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)"},161:{name:"Block",level:3,type:"b",mandatory:!0,minver:1,description:"Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)"},160:{name:"BlockGroup",level:2,type:"m",multiple:!0,minver:1,description:"Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock."},163:{name:"SimpleBlock",level:2,type:"b",multiple:!0,minver:2,webm:!0,divx:!0,description:"Similar to SimpleBlock Structure"},171:{name:"PrevSize",cppname:"ClusterPrevSize",level:2,type:"u",minver:1,description:"Size of the previous Cluster, in octets. Can be useful for backward playing.",position:"prevCluster"},167:{name:"Position",cppname:"ClusterPosition",level:2,type:"u",minver:1,webm:!1,description:"The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.",position:"segment"},22743:{name:"SilentTrackNumber",cppname:"ClusterSilentTrackNumber",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster."},231:{name:"Timecode",cppname:"ClusterTimecode",level:2,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp of the cluster (based on TimecodeScale)."},524531317:{name:"Cluster",level:1,type:"m",multiple:!0,minver:1,description:"The lower level element containing the (monolithic) Block structure."},19840:{name:"MuxingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Muxing application or library ("libmatroska-0.4.3").'},31657:{name:"Title",level:2,type:"8",minver:1,webm:!1,description:"General name of the segment."},2807730:{name:"TimecodeScaleDenominator",level:2,type:"u",mandatory:!0,minver:4,default:"1000000000",description:"Timestamp scale numerator, see TimecodeScale."},2807729:{name:"TimecodeScale",level:2,type:"u",mandatory:!0,minver:1,default:"1000000",description:"Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds)."},27045:{name:"ChapterTranslateID",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used."},27071:{name:"ChapterTranslateCodec",level:3,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},27132:{name:"ChapterTranslateEditionUID",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment."},4096955:{name:"NextFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the next segment."},4110627:{name:"NextUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the next chained segment (128 bits)."},3965867:{name:"PrevFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the previous segment."},3979555:{name:"PrevUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the previous chained segment (128 bits)."},29604:{name:"SegmentUID",level:2,type:"b",minver:1,webm:!1,range:"not 0",bytesize:16,description:"A randomly generated unique ID to identify the current segment between many others (128 bits)."},357149030:{name:"Info",level:1,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains miscellaneous general information and statistics on the file."},21420:{name:"SeekPosition",level:3,type:"u",mandatory:!0,minver:1,description:"The position of the element in the segment in octets (0 = first level 1 element).",position:"segment"},21419:{name:"SeekID",level:3,type:"b",mandatory:!0,minver:1,description:"The binary ID corresponding to the element name.",type2:"ebmlID"},19899:{name:"Seek",cppname:"SeekPoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains a single seek entry to an EBML element."},290298740:{name:"SeekHead",cppname:"SeekHeader",level:1,type:"m",multiple:!0,minver:1,description:"Contains the position of other level 1 elements."},32379:{name:"SignatureElementList",level:2,type:"m",multiple:!0,webm:!1,i:"Cluster|Block|BlockAdditional",description:"A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption."},32347:{name:"SignatureElements",level:1,type:"m",webm:!1,description:"Contains elements that will be used to compute the signature."},32437:{name:"Signature",level:1,type:"b",webm:!1,description:"The signature of the data (until a new."},32421:{name:"SignaturePublicKey",level:1,type:"b",webm:!1,description:"The public key to use with the algorithm (in the case of a PKI-based signature)."},32410:{name:"SignatureHash",level:1,type:"u",webm:!1,description:"Hash algorithm used (1=SHA1-160, 2=MD5)."},32394:{name:"SignatureAlgo",level:1,type:"u",webm:!1,description:"Signature algorithm used (1=RSA, 2=elliptic)."},458458727:{name:"SignatureSlot",level:-1,type:"m",multiple:!0,webm:!1,description:"Contain signature of some (coming) elements in the stream."},191:{name:"CRC-32",level:-1,type:"b",minver:1,webm:!1,description:"The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian",crc:!0},236:{name:"Void",level:-1,type:"b",minver:1,description:"Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use."},17139:{name:"EBMLMaxSizeLength",level:1,type:"u",mandatory:!0,default:8,minver:1,description:"The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid."},17138:{name:"EBMLMaxIDLength",level:1,type:"u",mandatory:!0,default:4,minver:1,description:"The maximum length of the IDs you'll find in this file (4 or less in Matroska)."},17143:{name:"EBMLReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum EBML version a parser has to support to read this file."},440786851:{name:"EBML",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"Set the EBML characteristics of the data to follow. Each EBML document has to start with this."},21936:{name:"Colour",level:"4",type:"m",mandatory:!0,multiple:!0,description:"Settings describing the colour format."},21937:{name:"MatrixCoefficients",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273."},21945:{name:"Range",level:"5",type:"u",mandatory:!0,multiple:!0,description:"Clipping of the color ranges."},21946:{name:"TransferCharacteristics",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The transfer characteristics of the video."},21947:{name:"Primaries",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273."}}),ebmlID}var hasRequiredEBMLEncoder;function requireEBMLEncoder(){if(hasRequiredEBMLEncoder)return EBMLEncoder;hasRequiredEBMLEncoder=1,Object.defineProperty(EBMLEncoder,"__esModule",{value:!0});var N=requireTools(),M=requireTools(),B=requireEbmlID(),F=(function(){function A(){this._schema=B.byEbmlID,this._buffers=[],this._stack=[]}return A.prototype.encode=function(D){var i=this;return N.concat(D.reduce(function(T,C){return T.concat(i.encodeChunk(C))},[])).buffer},A.prototype.encodeChunk=function(D){return D.type==="m"?D.isEnd?this.endTag(D):this.startTag(D):(D.data=M.Buffer.from(D.data),this.writeTag(D)),this.flush()},A.prototype.flush=function(){var D=this._buffers;return this._buffers=[],D},A.prototype.getSchemaInfo=function(D){for(var i=Object.keys(this._schema).map(Number),T=0;T<i.length;T++){var C=i[T];if(this._schema[C].name===D)return new M.Buffer(C.toString(16),"hex")}return null},A.prototype.writeTag=function(D){var i=D.name,T=this.getSchemaInfo(i),C=D.data;if(T==null)throw new Error("No schema entry found for "+i);var U=N.encodeTag(T,C);if(this._stack.length>0){var j=this._stack[this._stack.length-1];j.children.push({tagId:T,elm:D,children:[],data:U});return}this._buffers=this._buffers.concat(U)},A.prototype.startTag=function(D){var i=D.name,T=this.getSchemaInfo(i);if(T==null)throw new Error("No schema entry found for "+i);if(D.unknownSize){var C=N.encodeTag(T,new M.Buffer(0),D.unknownSize);this._buffers=this._buffers.concat(C);return}var U={tagId:T,elm:D,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(U),this._stack.push(U)},A.prototype.endTag=function(D){D.name;var i=this._stack.pop();if(i==null)throw new Error("EBML structure is broken");if(i.elm.name!==D.name)throw new Error("EBML structure is broken");var T=i.children.reduce(function(U,j){if(j.data===null)throw new Error("EBML structure is broken");return U.concat(j.data)},[]),C=N.concat(T);i.elm.type==="m"?i.data=N.encodeTag(i.tagId,C,i.elm.unknownSize):i.data=N.encodeTag(i.tagId,C),this._stack.length<1&&(this._buffers=this._buffers.concat(i.data))},A})();return EBMLEncoder.default=F,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=T,base64Js.toByteArray=U,base64Js.fromByteArray=K;for(var N=[],M=[],B=typeof Uint8Array<"u"?Uint8Array:Array,F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=0,D=F.length;A<D;++A)N[A]=F[A],M[F.charCodeAt(A)]=A;M[45]=62,M[95]=63;function i(Y){var te=Y.length;if(te%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var ae=Y.indexOf("=");ae===-1&&(ae=te);var se=ae===te?0:4-ae%4;return[ae,se]}function T(Y){var te=i(Y),ae=te[0],se=te[1];return(ae+se)*3/4-se}function C(Y,te,ae){return(te+ae)*3/4-ae}function U(Y){var te,ae=i(Y),se=ae[0],oe=ae[1],he=new B(C(Y,se,oe)),ke=0,ie=oe>0?se-4:se,ce;for(ce=0;ce<ie;ce+=4)te=M[Y.charCodeAt(ce)]<<18|M[Y.charCodeAt(ce+1)]<<12|M[Y.charCodeAt(ce+2)]<<6|M[Y.charCodeAt(ce+3)],he[ke++]=te>>16&255,he[ke++]=te>>8&255,he[ke++]=te&255;return oe===2&&(te=M[Y.charCodeAt(ce)]<<2|M[Y.charCodeAt(ce+1)]>>4,he[ke++]=te&255),oe===1&&(te=M[Y.charCodeAt(ce)]<<10|M[Y.charCodeAt(ce+1)]<<4|M[Y.charCodeAt(ce+2)]>>2,he[ke++]=te>>8&255,he[ke++]=te&255),he}function j(Y){return N[Y>>18&63]+N[Y>>12&63]+N[Y>>6&63]+N[Y&63]}function z(Y,te,ae){for(var se,oe=[],he=te;he<ae;he+=3)se=(Y[he]<<16&16711680)+(Y[he+1]<<8&65280)+(Y[he+2]&255),oe.push(j(se));return oe.join("")}function K(Y){for(var te,ae=Y.length,se=ae%3,oe=[],he=16383,ke=0,ie=ae-se;ke<ie;ke+=he)oe.push(z(Y,ke,ke+he>ie?ie:ke+he));return se===1?(te=Y[ae-1],oe.push(N[te>>2]+N[te<<4&63]+"==")):se===2&&(te=(Y[ae-2]<<8)+Y[ae-1],oe.push(N[te>>10]+N[te>>4&63]+N[te<<2&63]+"=")),oe.join("")}return base64Js}var ieee754={};var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754.read=function(N,M,B,F,A){var D,i,T=A*8-F-1,C=(1<<T)-1,U=C>>1,j=-7,z=B?A-1:0,K=B?-1:1,Y=N[M+z];for(z+=K,D=Y&(1<<-j)-1,Y>>=-j,j+=T;j>0;D=D*256+N[M+z],z+=K,j-=8);for(i=D&(1<<-j)-1,D>>=-j,j+=F;j>0;i=i*256+N[M+z],z+=K,j-=8);if(D===0)D=1-U;else{if(D===C)return i?NaN:(Y?-1:1)*(1/0);i=i+Math.pow(2,F),D=D-U}return(Y?-1:1)*i*Math.pow(2,D-F)},ieee754.write=function(N,M,B,F,A,D){var i,T,C,U=D*8-A-1,j=(1<<U)-1,z=j>>1,K=A===23?Math.pow(2,-24)-Math.pow(2,-77):0,Y=F?0:D-1,te=F?1:-1,ae=M<0||M===0&&1/M<0?1:0;for(M=Math.abs(M),isNaN(M)||M===1/0?(T=isNaN(M)?1:0,i=j):(i=Math.floor(Math.log(M)/Math.LN2),M*(C=Math.pow(2,-i))<1&&(i--,C*=2),i+z>=1?M+=K/C:M+=K*Math.pow(2,1-z),M*C>=2&&(i++,C/=2),i+z>=j?(T=0,i=j):i+z>=1?(T=(M*C-1)*Math.pow(2,A),i=i+z):(T=M*Math.pow(2,z-1)*Math.pow(2,A),i=0));A>=8;N[B+Y]=T&255,Y+=te,T/=256,A-=8);for(i=i<<A|T,U+=A;U>0;N[B+Y]=i&255,Y+=te,i/=256,U-=8);N[B+Y-te]|=ae*128}),ieee754}var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,(function(N){const M=requireBase64Js(),B=requireIeee754(),F=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;N.Buffer=T,N.SlowBuffer=he,N.INSPECT_MAX_BYTES=50;const A=2147483647;N.kMaxLength=A,T.TYPED_ARRAY_SUPPORT=D(),!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function D(){try{const ee=new Uint8Array(1),Z={foo:function(){return 42}};return Object.setPrototypeOf(Z,Uint8Array.prototype),Object.setPrototypeOf(ee,Z),ee.foo()===42}catch{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}}),Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function i(ee){if(ee>A)throw new RangeError('The value "'+ee+'" is invalid for option "size"');const Z=new Uint8Array(ee);return Object.setPrototypeOf(Z,T.prototype),Z}function T(ee,Z,J){if(typeof ee=="number"){if(typeof Z=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return z(ee)}return C(ee,Z,J)}T.poolSize=8192;function C(ee,Z,J){if(typeof ee=="string")return K(ee,Z);if(ArrayBuffer.isView(ee))return te(ee);if(ee==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ee);if(Je(ee,ArrayBuffer)||ee&&Je(ee.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Je(ee,SharedArrayBuffer)||ee&&Je(ee.buffer,SharedArrayBuffer)))return ae(ee,Z,J);if(typeof ee=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ne=ee.valueOf&&ee.valueOf();if(ne!=null&&ne!==ee)return T.from(ne,Z,J);const le=se(ee);if(le)return le;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ee[Symbol.toPrimitive]=="function")return T.from(ee[Symbol.toPrimitive]("string"),Z,J);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ee)}T.from=function(ee,Z,J){return C(ee,Z,J)},Object.setPrototypeOf(T.prototype,Uint8Array.prototype),Object.setPrototypeOf(T,Uint8Array);function U(ee){if(typeof ee!="number")throw new TypeError('"size" argument must be of type number');if(ee<0)throw new RangeError('The value "'+ee+'" is invalid for option "size"')}function j(ee,Z,J){return U(ee),ee<=0?i(ee):Z!==void 0?typeof J=="string"?i(ee).fill(Z,J):i(ee).fill(Z):i(ee)}T.alloc=function(ee,Z,J){return j(ee,Z,J)};function z(ee){return U(ee),i(ee<0?0:oe(ee)|0)}T.allocUnsafe=function(ee){return z(ee)},T.allocUnsafeSlow=function(ee){return z(ee)};function K(ee,Z){if((typeof Z!="string"||Z==="")&&(Z="utf8"),!T.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);const J=ke(ee,Z)|0;let ne=i(J);const le=ne.write(ee,Z);return le!==J&&(ne=ne.slice(0,le)),ne}function Y(ee){const Z=ee.length<0?0:oe(ee.length)|0,J=i(Z);for(let ne=0;ne<Z;ne+=1)J[ne]=ee[ne]&255;return J}function te(ee){if(Je(ee,Uint8Array)){const Z=new Uint8Array(ee);return ae(Z.buffer,Z.byteOffset,Z.byteLength)}return Y(ee)}function ae(ee,Z,J){if(Z<0||ee.byteLength<Z)throw new RangeError('"offset" is outside of buffer bounds');if(ee.byteLength<Z+(J||0))throw new RangeError('"length" is outside of buffer bounds');let ne;return Z===void 0&&J===void 0?ne=new Uint8Array(ee):J===void 0?ne=new Uint8Array(ee,Z):ne=new Uint8Array(ee,Z,J),Object.setPrototypeOf(ne,T.prototype),ne}function se(ee){if(T.isBuffer(ee)){const Z=oe(ee.length)|0,J=i(Z);return J.length===0||ee.copy(J,0,0,Z),J}if(ee.length!==void 0)return typeof ee.length!="number"||nt(ee.length)?i(0):Y(ee);if(ee.type==="Buffer"&&Array.isArray(ee.data))return Y(ee.data)}function oe(ee){if(ee>=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return ee|0}function he(ee){return+ee!=ee&&(ee=0),T.alloc(+ee)}T.isBuffer=function(Z){return Z!=null&&Z._isBuffer===!0&&Z!==T.prototype},T.compare=function(Z,J){if(Je(Z,Uint8Array)&&(Z=T.from(Z,Z.offset,Z.byteLength)),Je(J,Uint8Array)&&(J=T.from(J,J.offset,J.byteLength)),!T.isBuffer(Z)||!T.isBuffer(J))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Z===J)return 0;let ne=Z.length,le=J.length;for(let me=0,ve=Math.min(ne,le);me<ve;++me)if(Z[me]!==J[me]){ne=Z[me],le=J[me];break}return ne<le?-1:le<ne?1:0},T.isEncoding=function(Z){switch(String(Z).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},T.concat=function(Z,J){if(!Array.isArray(Z))throw new TypeError('"list" argument must be an Array of Buffers');if(Z.length===0)return T.alloc(0);let ne;if(J===void 0)for(J=0,ne=0;ne<Z.length;++ne)J+=Z[ne].length;const le=T.allocUnsafe(J);let me=0;for(ne=0;ne<Z.length;++ne){let ve=Z[ne];if(Je(ve,Uint8Array))me+ve.length>le.length?(T.isBuffer(ve)||(ve=T.from(ve)),ve.copy(le,me)):Uint8Array.prototype.set.call(le,ve,me);else if(T.isBuffer(ve))ve.copy(le,me);else throw new TypeError('"list" argument must be an Array of Buffers');me+=ve.length}return le};function ke(ee,Z){if(T.isBuffer(ee))return ee.length;if(ArrayBuffer.isView(ee)||Je(ee,ArrayBuffer))return ee.byteLength;if(typeof ee!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ee);const J=ee.length,ne=arguments.length>2&&arguments[2]===!0;if(!ne&&J===0)return 0;let le=!1;for(;;)switch(Z){case"ascii":case"latin1":case"binary":return J;case"utf8":case"utf-8":return We(ee).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J*2;case"hex":return J>>>1;case"base64":return Xe(ee).length;default:if(le)return ne?-1:We(ee).length;Z=(""+Z).toLowerCase(),le=!0}}T.byteLength=ke;function ie(ee,Z,J){let ne=!1;if((Z===void 0||Z<0)&&(Z=0),Z>this.length||((J===void 0||J>this.length)&&(J=this.length),J<=0)||(J>>>=0,Z>>>=0,J<=Z))return"";for(ee||(ee="utf8");;)switch(ee){case"hex":return ze(this,Z,J);case"utf8":case"utf-8":return we(this,Z,J);case"ascii":return qe(this,Z,J);case"latin1":case"binary":return Me(this,Z,J);case"base64":return _e(this,Z,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,Z,J);default:if(ne)throw new TypeError("Unknown encoding: "+ee);ee=(ee+"").toLowerCase(),ne=!0}}T.prototype._isBuffer=!0;function ce(ee,Z,J){const ne=ee[Z];ee[Z]=ee[J],ee[J]=ne}T.prototype.swap16=function(){const Z=this.length;if(Z%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let J=0;J<Z;J+=2)ce(this,J,J+1);return this},T.prototype.swap32=function(){const Z=this.length;if(Z%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let J=0;J<Z;J+=4)ce(this,J,J+3),ce(this,J+1,J+2);return this},T.prototype.swap64=function(){const Z=this.length;if(Z%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let J=0;J<Z;J+=8)ce(this,J,J+7),ce(this,J+1,J+6),ce(this,J+2,J+5),ce(this,J+3,J+4);return this},T.prototype.toString=function(){const Z=this.length;return Z===0?"":arguments.length===0?we(this,0,Z):ie.apply(this,arguments)},T.prototype.toLocaleString=T.prototype.toString,T.prototype.equals=function(Z){if(!T.isBuffer(Z))throw new TypeError("Argument must be a Buffer");return this===Z?!0:T.compare(this,Z)===0},T.prototype.inspect=function(){let Z="";const J=N.INSPECT_MAX_BYTES;return Z=this.toString("hex",0,J).replace(/(.{2})/g,"$1 ").trim(),this.length>J&&(Z+=" ... "),"<Buffer "+Z+">"},F&&(T.prototype[F]=T.prototype.inspect),T.prototype.compare=function(Z,J,ne,le,me){if(Je(Z,Uint8Array)&&(Z=T.from(Z,Z.offset,Z.byteLength)),!T.isBuffer(Z))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Z);if(J===void 0&&(J=0),ne===void 0&&(ne=Z?Z.length:0),le===void 0&&(le=0),me===void 0&&(me=this.length),J<0||ne>Z.length||le<0||me>this.length)throw new RangeError("out of range index");if(le>=me&&J>=ne)return 0;if(le>=me)return-1;if(J>=ne)return 1;if(J>>>=0,ne>>>=0,le>>>=0,me>>>=0,this===Z)return 0;let ve=me-le,xe=ne-J;const De=Math.min(ve,xe),Ae=this.slice(le,me),Be=Z.slice(J,ne);for(let Pe=0;Pe<De;++Pe)if(Ae[Pe]!==Be[Pe]){ve=Ae[Pe],xe=Be[Pe];break}return ve<xe?-1:xe<ve?1:0};function pe(ee,Z,J,ne,le){if(ee.length===0)return-1;if(typeof J=="string"?(ne=J,J=0):J>2147483647?J=2147483647:J<-2147483648&&(J=-2147483648),J=+J,nt(J)&&(J=le?0:ee.length-1),J<0&&(J=ee.length+J),J>=ee.length){if(le)return-1;J=ee.length-1}else if(J<0)if(le)J=0;else return-1;if(typeof Z=="string"&&(Z=T.from(Z,ne)),T.isBuffer(Z))return Z.length===0?-1:ue(ee,Z,J,ne,le);if(typeof Z=="number")return Z=Z&255,typeof Uint8Array.prototype.indexOf=="function"?le?Uint8Array.prototype.indexOf.call(ee,Z,J):Uint8Array.prototype.lastIndexOf.call(ee,Z,J):ue(ee,[Z],J,ne,le);throw new TypeError("val must be string, number or Buffer")}function ue(ee,Z,J,ne,le){let me=1,ve=ee.length,xe=Z.length;if(ne!==void 0&&(ne=String(ne).toLowerCase(),ne==="ucs2"||ne==="ucs-2"||ne==="utf16le"||ne==="utf-16le")){if(ee.length<2||Z.length<2)return-1;me=2,ve/=2,xe/=2,J/=2}function De(Be,Pe){return me===1?Be[Pe]:Be.readUInt16BE(Pe*me)}let Ae;if(le){let Be=-1;for(Ae=J;Ae<ve;Ae++)if(De(ee,Ae)===De(Z,Be===-1?0:Ae-Be)){if(Be===-1&&(Be=Ae),Ae-Be+1===xe)return Be*me}else Be!==-1&&(Ae-=Ae-Be),Be=-1}else for(J+xe>ve&&(J=ve-xe),Ae=J;Ae>=0;Ae--){let Be=!0;for(let Pe=0;Pe<xe;Pe++)if(De(ee,Ae+Pe)!==De(Z,Pe)){Be=!1;break}if(Be)return Ae}return-1}T.prototype.includes=function(Z,J,ne){return this.indexOf(Z,J,ne)!==-1},T.prototype.indexOf=function(Z,J,ne){return pe(this,Z,J,ne,!0)},T.prototype.lastIndexOf=function(Z,J,ne){return pe(this,Z,J,ne,!1)};function fe(ee,Z,J,ne){J=Number(J)||0;const le=ee.length-J;ne?(ne=Number(ne),ne>le&&(ne=le)):ne=le;const me=Z.length;ne>me/2&&(ne=me/2);let ve;for(ve=0;ve<ne;++ve){const xe=parseInt(Z.substr(ve*2,2),16);if(nt(xe))return ve;ee[J+ve]=xe}return ve}function ye(ee,Z,J,ne){return et(We(Z,ee.length-J),ee,J,ne)}function re(ee,Z,J,ne){return et(Qe(Z),ee,J,ne)}function de(ee,Z,J,ne){return et(Xe(Z),ee,J,ne)}function be(ee,Z,J,ne){return et(tt(Z,ee.length-J),ee,J,ne)}T.prototype.write=function(Z,J,ne,le){if(J===void 0)le="utf8",ne=this.length,J=0;else if(ne===void 0&&typeof J=="string")le=J,ne=this.length,J=0;else if(isFinite(J))J=J>>>0,isFinite(ne)?(ne=ne>>>0,le===void 0&&(le="utf8")):(le=ne,ne=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const me=this.length-J;if((ne===void 0||ne>me)&&(ne=me),Z.length>0&&(ne<0||J<0)||J>this.length)throw new RangeError("Attempt to write outside buffer bounds");le||(le="utf8");let ve=!1;for(;;)switch(le){case"hex":return fe(this,Z,J,ne);case"utf8":case"utf-8":return ye(this,Z,J,ne);case"ascii":case"latin1":case"binary":return re(this,Z,J,ne);case"base64":return de(this,Z,J,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return be(this,Z,J,ne);default:if(ve)throw new TypeError("Unknown encoding: "+le);le=(""+le).toLowerCase(),ve=!0}},T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _e(ee,Z,J){return Z===0&&J===ee.length?M.fromByteArray(ee):M.fromByteArray(ee.slice(Z,J))}function we(ee,Z,J){J=Math.min(ee.length,J);const ne=[];let le=Z;for(;le<J;){const me=ee[le];let ve=null,xe=me>239?4:me>223?3:me>191?2:1;if(le+xe<=J){let De,Ae,Be,Pe;switch(xe){case 1:me<128&&(ve=me);break;case 2:De=ee[le+1],(De&192)===128&&(Pe=(me&31)<<6|De&63,Pe>127&&(ve=Pe));break;case 3:De=ee[le+1],Ae=ee[le+2],(De&192)===128&&(Ae&192)===128&&(Pe=(me&15)<<12|(De&63)<<6|Ae&63,Pe>2047&&(Pe<55296||Pe>57343)&&(ve=Pe));break;case 4:De=ee[le+1],Ae=ee[le+2],Be=ee[le+3],(De&192)===128&&(Ae&192)===128&&(Be&192)===128&&(Pe=(me&15)<<18|(De&63)<<12|(Ae&63)<<6|Be&63,Pe>65535&&Pe<1114112&&(ve=Pe))}}ve===null?(ve=65533,xe=1):ve>65535&&(ve-=65536,ne.push(ve>>>10&1023|55296),ve=56320|ve&1023),ne.push(ve),le+=xe}return Ee(ne)}const ge=4096;function Ee(ee){const Z=ee.length;if(Z<=ge)return String.fromCharCode.apply(String,ee);let J="",ne=0;for(;ne<Z;)J+=String.fromCharCode.apply(String,ee.slice(ne,ne+=ge));return J}function qe(ee,Z,J){let ne="";J=Math.min(ee.length,J);for(let le=Z;le<J;++le)ne+=String.fromCharCode(ee[le]&127);return ne}function Me(ee,Z,J){let ne="";J=Math.min(ee.length,J);for(let le=Z;le<J;++le)ne+=String.fromCharCode(ee[le]);return ne}function ze(ee,Z,J){const ne=ee.length;(!Z||Z<0)&&(Z=0),(!J||J<0||J>ne)&&(J=ne);let le="";for(let me=Z;me<J;++me)le+=it[ee[me]];return le}function Ke(ee,Z,J){const ne=ee.slice(Z,J);let le="";for(let me=0;me<ne.length-1;me+=2)le+=String.fromCharCode(ne[me]+ne[me+1]*256);return le}T.prototype.slice=function(Z,J){const ne=this.length;Z=~~Z,J=J===void 0?ne:~~J,Z<0?(Z+=ne,Z<0&&(Z=0)):Z>ne&&(Z=ne),J<0?(J+=ne,J<0&&(J=0)):J>ne&&(J=ne),J<Z&&(J=Z);const le=this.subarray(Z,J);return Object.setPrototypeOf(le,T.prototype),le};function Re(ee,Z,J){if(ee%1!==0||ee<0)throw new RangeError("offset is not uint");if(ee+Z>J)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(Z,J,ne){Z=Z>>>0,J=J>>>0,ne||Re(Z,J,this.length);let le=this[Z],me=1,ve=0;for(;++ve<J&&(me*=256);)le+=this[Z+ve]*me;return le},T.prototype.readUintBE=T.prototype.readUIntBE=function(Z,J,ne){Z=Z>>>0,J=J>>>0,ne||Re(Z,J,this.length);let le=this[Z+--J],me=1;for(;J>0&&(me*=256);)le+=this[Z+--J]*me;return le},T.prototype.readUint8=T.prototype.readUInt8=function(Z,J){return Z=Z>>>0,J||Re(Z,1,this.length),this[Z]},T.prototype.readUint16LE=T.prototype.readUInt16LE=function(Z,J){return Z=Z>>>0,J||Re(Z,2,this.length),this[Z]|this[Z+1]<<8},T.prototype.readUint16BE=T.prototype.readUInt16BE=function(Z,J){return Z=Z>>>0,J||Re(Z,2,this.length),this[Z]<<8|this[Z+1]},T.prototype.readUint32LE=T.prototype.readUInt32LE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),(this[Z]|this[Z+1]<<8|this[Z+2]<<16)+this[Z+3]*16777216},T.prototype.readUint32BE=T.prototype.readUInt32BE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),this[Z]*16777216+(this[Z+1]<<16|this[Z+2]<<8|this[Z+3])},T.prototype.readBigUInt64LE=Ye(function(Z){Z=Z>>>0,Ce(Z,"offset");const J=this[Z],ne=this[Z+7];(J===void 0||ne===void 0)&&Ue(Z,this.length-8);const le=J+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24,me=this[++Z]+this[++Z]*2**8+this[++Z]*2**16+ne*2**24;return BigInt(le)+(BigInt(me)<<BigInt(32))}),T.prototype.readBigUInt64BE=Ye(function(Z){Z=Z>>>0,Ce(Z,"offset");const J=this[Z],ne=this[Z+7];(J===void 0||ne===void 0)&&Ue(Z,this.length-8);const le=J*2**24+this[++Z]*2**16+this[++Z]*2**8+this[++Z],me=this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ne;return(BigInt(le)<<BigInt(32))+BigInt(me)}),T.prototype.readIntLE=function(Z,J,ne){Z=Z>>>0,J=J>>>0,ne||Re(Z,J,this.length);let le=this[Z],me=1,ve=0;for(;++ve<J&&(me*=256);)le+=this[Z+ve]*me;return me*=128,le>=me&&(le-=Math.pow(2,8*J)),le},T.prototype.readIntBE=function(Z,J,ne){Z=Z>>>0,J=J>>>0,ne||Re(Z,J,this.length);let le=J,me=1,ve=this[Z+--le];for(;le>0&&(me*=256);)ve+=this[Z+--le]*me;return me*=128,ve>=me&&(ve-=Math.pow(2,8*J)),ve},T.prototype.readInt8=function(Z,J){return Z=Z>>>0,J||Re(Z,1,this.length),this[Z]&128?(255-this[Z]+1)*-1:this[Z]},T.prototype.readInt16LE=function(Z,J){Z=Z>>>0,J||Re(Z,2,this.length);const ne=this[Z]|this[Z+1]<<8;return ne&32768?ne|4294901760:ne},T.prototype.readInt16BE=function(Z,J){Z=Z>>>0,J||Re(Z,2,this.length);const ne=this[Z+1]|this[Z]<<8;return ne&32768?ne|4294901760:ne},T.prototype.readInt32LE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),this[Z]|this[Z+1]<<8|this[Z+2]<<16|this[Z+3]<<24},T.prototype.readInt32BE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),this[Z]<<24|this[Z+1]<<16|this[Z+2]<<8|this[Z+3]},T.prototype.readBigInt64LE=Ye(function(Z){Z=Z>>>0,Ce(Z,"offset");const J=this[Z],ne=this[Z+7];(J===void 0||ne===void 0)&&Ue(Z,this.length-8);const le=this[Z+4]+this[Z+5]*2**8+this[Z+6]*2**16+(ne<<24);return(BigInt(le)<<BigInt(32))+BigInt(J+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24)}),T.prototype.readBigInt64BE=Ye(function(Z){Z=Z>>>0,Ce(Z,"offset");const J=this[Z],ne=this[Z+7];(J===void 0||ne===void 0)&&Ue(Z,this.length-8);const le=(J<<24)+this[++Z]*2**16+this[++Z]*2**8+this[++Z];return(BigInt(le)<<BigInt(32))+BigInt(this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ne)}),T.prototype.readFloatLE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),B.read(this,Z,!0,23,4)},T.prototype.readFloatBE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),B.read(this,Z,!1,23,4)},T.prototype.readDoubleLE=function(Z,J){return Z=Z>>>0,J||Re(Z,8,this.length),B.read(this,Z,!0,52,8)},T.prototype.readDoubleBE=function(Z,J){return Z=Z>>>0,J||Re(Z,8,this.length),B.read(this,Z,!1,52,8)};function $e(ee,Z,J,ne,le,me){if(!T.isBuffer(ee))throw new TypeError('"buffer" argument must be a Buffer instance');if(Z>le||Z<me)throw new RangeError('"value" argument is out of bounds');if(J+ne>ee.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(Z,J,ne,le){if(Z=+Z,J=J>>>0,ne=ne>>>0,!le){const xe=Math.pow(2,8*ne)-1;$e(this,Z,J,ne,xe,0)}let me=1,ve=0;for(this[J]=Z&255;++ve<ne&&(me*=256);)this[J+ve]=Z/me&255;return J+ne},T.prototype.writeUintBE=T.prototype.writeUIntBE=function(Z,J,ne,le){if(Z=+Z,J=J>>>0,ne=ne>>>0,!le){const xe=Math.pow(2,8*ne)-1;$e(this,Z,J,ne,xe,0)}let me=ne-1,ve=1;for(this[J+me]=Z&255;--me>=0&&(ve*=256);)this[J+me]=Z/ve&255;return J+ne},T.prototype.writeUint8=T.prototype.writeUInt8=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,1,255,0),this[J]=Z&255,J+1},T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,2,65535,0),this[J]=Z&255,this[J+1]=Z>>>8,J+2},T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,2,65535,0),this[J]=Z>>>8,this[J+1]=Z&255,J+2},T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,4,4294967295,0),this[J+3]=Z>>>24,this[J+2]=Z>>>16,this[J+1]=Z>>>8,this[J]=Z&255,J+4},T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,4,4294967295,0),this[J]=Z>>>24,this[J+1]=Z>>>16,this[J+2]=Z>>>8,this[J+3]=Z&255,J+4};function Ve(ee,Z,J,ne,le){Te(Z,ne,le,ee,J,7);let me=Number(Z&BigInt(4294967295));ee[J++]=me,me=me>>8,ee[J++]=me,me=me>>8,ee[J++]=me,me=me>>8,ee[J++]=me;let ve=Number(Z>>BigInt(32)&BigInt(4294967295));return ee[J++]=ve,ve=ve>>8,ee[J++]=ve,ve=ve>>8,ee[J++]=ve,ve=ve>>8,ee[J++]=ve,J}function Ne(ee,Z,J,ne,le){Te(Z,ne,le,ee,J,7);let me=Number(Z&BigInt(4294967295));ee[J+7]=me,me=me>>8,ee[J+6]=me,me=me>>8,ee[J+5]=me,me=me>>8,ee[J+4]=me;let ve=Number(Z>>BigInt(32)&BigInt(4294967295));return ee[J+3]=ve,ve=ve>>8,ee[J+2]=ve,ve=ve>>8,ee[J+1]=ve,ve=ve>>8,ee[J]=ve,J+8}T.prototype.writeBigUInt64LE=Ye(function(Z,J=0){return Ve(this,Z,J,BigInt(0),BigInt("0xffffffffffffffff"))}),T.prototype.writeBigUInt64BE=Ye(function(Z,J=0){return Ne(this,Z,J,BigInt(0),BigInt("0xffffffffffffffff"))}),T.prototype.writeIntLE=function(Z,J,ne,le){if(Z=+Z,J=J>>>0,!le){const De=Math.pow(2,8*ne-1);$e(this,Z,J,ne,De-1,-De)}let me=0,ve=1,xe=0;for(this[J]=Z&255;++me<ne&&(ve*=256);)Z<0&&xe===0&&this[J+me-1]!==0&&(xe=1),this[J+me]=(Z/ve>>0)-xe&255;return J+ne},T.prototype.writeIntBE=function(Z,J,ne,le){if(Z=+Z,J=J>>>0,!le){const De=Math.pow(2,8*ne-1);$e(this,Z,J,ne,De-1,-De)}let me=ne-1,ve=1,xe=0;for(this[J+me]=Z&255;--me>=0&&(ve*=256);)Z<0&&xe===0&&this[J+me+1]!==0&&(xe=1),this[J+me]=(Z/ve>>0)-xe&255;return J+ne},T.prototype.writeInt8=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,1,127,-128),Z<0&&(Z=255+Z+1),this[J]=Z&255,J+1},T.prototype.writeInt16LE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,2,32767,-32768),this[J]=Z&255,this[J+1]=Z>>>8,J+2},T.prototype.writeInt16BE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,2,32767,-32768),this[J]=Z>>>8,this[J+1]=Z&255,J+2},T.prototype.writeInt32LE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,4,2147483647,-2147483648),this[J]=Z&255,this[J+1]=Z>>>8,this[J+2]=Z>>>16,this[J+3]=Z>>>24,J+4},T.prototype.writeInt32BE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,4,2147483647,-2147483648),Z<0&&(Z=4294967295+Z+1),this[J]=Z>>>24,this[J+1]=Z>>>16,this[J+2]=Z>>>8,this[J+3]=Z&255,J+4},T.prototype.writeBigInt64LE=Ye(function(Z,J=0){return Ve(this,Z,J,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),T.prototype.writeBigInt64BE=Ye(function(Z,J=0){return Ne(this,Z,J,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function He(ee,Z,J,ne,le,me){if(J+ne>ee.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("Index out of range")}function Ge(ee,Z,J,ne,le){return Z=+Z,J=J>>>0,le||He(ee,Z,J,4),B.write(ee,Z,J,ne,23,4),J+4}T.prototype.writeFloatLE=function(Z,J,ne){return Ge(this,Z,J,!0,ne)},T.prototype.writeFloatBE=function(Z,J,ne){return Ge(this,Z,J,!1,ne)};function Ze(ee,Z,J,ne,le){return Z=+Z,J=J>>>0,le||He(ee,Z,J,8),B.write(ee,Z,J,ne,52,8),J+8}T.prototype.writeDoubleLE=function(Z,J,ne){return Ze(this,Z,J,!0,ne)},T.prototype.writeDoubleBE=function(Z,J,ne){return Ze(this,Z,J,!1,ne)},T.prototype.copy=function(Z,J,ne,le){if(!T.isBuffer(Z))throw new TypeError("argument should be a Buffer");if(ne||(ne=0),!le&&le!==0&&(le=this.length),J>=Z.length&&(J=Z.length),J||(J=0),le>0&&le<ne&&(le=ne),le===ne||Z.length===0||this.length===0)return 0;if(J<0)throw new RangeError("targetStart out of bounds");if(ne<0||ne>=this.length)throw new RangeError("Index out of range");if(le<0)throw new RangeError("sourceEnd out of bounds");le>this.length&&(le=this.length),Z.length-J<le-ne&&(le=Z.length-J+ne);const me=le-ne;return this===Z&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(J,ne,le):Uint8Array.prototype.set.call(Z,this.subarray(ne,le),J),me},T.prototype.fill=function(Z,J,ne,le){if(typeof Z=="string"){if(typeof J=="string"?(le=J,J=0,ne=this.length):typeof ne=="string"&&(le=ne,ne=this.length),le!==void 0&&typeof le!="string")throw new TypeError("encoding must be a string");if(typeof le=="string"&&!T.isEncoding(le))throw new TypeError("Unknown encoding: "+le);if(Z.length===1){const ve=Z.charCodeAt(0);(le==="utf8"&&ve<128||le==="latin1")&&(Z=ve)}}else typeof Z=="number"?Z=Z&255:typeof Z=="boolean"&&(Z=Number(Z));if(J<0||this.length<J||this.length<ne)throw new RangeError("Out of range index");if(ne<=J)return this;J=J>>>0,ne=ne===void 0?this.length:ne>>>0,Z||(Z=0);let me;if(typeof Z=="number")for(me=J;me<ne;++me)this[me]=Z;else{const ve=T.isBuffer(Z)?Z:T.from(Z,le),xe=ve.length;if(xe===0)throw new TypeError('The value "'+Z+'" is invalid for argument "value"');for(me=0;me<ne-J;++me)this[me+J]=ve[me%xe]}return this};const Le={};function Oe(ee,Z,J){Le[ee]=class extends J{constructor(){super(),Object.defineProperty(this,"message",{value:Z.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${ee}]`,this.stack,delete this.name}get code(){return ee}set code(le){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:le,writable:!0})}toString(){return`${this.name} [${ee}]: ${this.message}`}}}Oe("ERR_BUFFER_OUT_OF_BOUNDS",function(ee){return ee?`${ee} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Oe("ERR_INVALID_ARG_TYPE",function(ee,Z){return`The "${ee}" argument must be of type number. Received type ${typeof Z}`},TypeError),Oe("ERR_OUT_OF_RANGE",function(ee,Z,J){let ne=`The value of "${ee}" is out of range.`,le=J;return Number.isInteger(J)&&Math.abs(J)>2**32?le=Se(String(J)):typeof J=="bigint"&&(le=String(J),(J>BigInt(2)**BigInt(32)||J<-(BigInt(2)**BigInt(32)))&&(le=Se(le)),le+="n"),ne+=` It must be ${Z}. Received ${le}`,ne},RangeError);function Se(ee){let Z="",J=ee.length;const ne=ee[0]==="-"?1:0;for(;J>=ne+4;J-=3)Z=`_${ee.slice(J-3,J)}${Z}`;return`${ee.slice(0,J)}${Z}`}function Ie(ee,Z,J){Ce(Z,"offset"),(ee[Z]===void 0||ee[Z+J]===void 0)&&Ue(Z,ee.length-(J+1))}function Te(ee,Z,J,ne,le,me){if(ee>J||ee<Z){const ve=typeof Z=="bigint"?"n":"";let xe;throw Z===0||Z===BigInt(0)?xe=`>= 0${ve} and < 2${ve} ** ${(me+1)*8}${ve}`:xe=`>= -(2${ve} ** ${(me+1)*8-1}${ve}) and < 2 ** ${(me+1)*8-1}${ve}`,new Le.ERR_OUT_OF_RANGE("value",xe,ee)}Ie(ne,le,me)}function Ce(ee,Z){if(typeof ee!="number")throw new Le.ERR_INVALID_ARG_TYPE(Z,"number",ee)}function Ue(ee,Z,J){throw Math.floor(ee)!==ee?(Ce(ee,J),new Le.ERR_OUT_OF_RANGE("offset","an integer",ee)):Z<0?new Le.ERR_BUFFER_OUT_OF_BOUNDS:new Le.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Z}`,ee)}const je=/[^+/0-9A-Za-z-_]/g;function Fe(ee){if(ee=ee.split("=")[0],ee=ee.trim().replace(je,""),ee.length<2)return"";for(;ee.length%4!==0;)ee=ee+"=";return ee}function We(ee,Z){Z=Z||1/0;let J;const ne=ee.length;let le=null;const me=[];for(let ve=0;ve<ne;++ve){if(J=ee.charCodeAt(ve),J>55295&&J<57344){if(!le){if(J>56319){(Z-=3)>-1&&me.push(239,191,189);continue}else if(ve+1===ne){(Z-=3)>-1&&me.push(239,191,189);continue}le=J;continue}if(J<56320){(Z-=3)>-1&&me.push(239,191,189),le=J;continue}J=(le-55296<<10|J-56320)+65536}else le&&(Z-=3)>-1&&me.push(239,191,189);if(le=null,J<128){if((Z-=1)<0)break;me.push(J)}else if(J<2048){if((Z-=2)<0)break;me.push(J>>6|192,J&63|128)}else if(J<65536){if((Z-=3)<0)break;me.push(J>>12|224,J>>6&63|128,J&63|128)}else if(J<1114112){if((Z-=4)<0)break;me.push(J>>18|240,J>>12&63|128,J>>6&63|128,J&63|128)}else throw new Error("Invalid code point")}return me}function Qe(ee){const Z=[];for(let J=0;J<ee.length;++J)Z.push(ee.charCodeAt(J)&255);return Z}function tt(ee,Z){let J,ne,le;const me=[];for(let ve=0;ve<ee.length&&!((Z-=2)<0);++ve)J=ee.charCodeAt(ve),ne=J>>8,le=J%256,me.push(le),me.push(ne);return me}function Xe(ee){return M.toByteArray(Fe(ee))}function et(ee,Z,J,ne){let le;for(le=0;le<ne&&!(le+J>=Z.length||le>=ee.length);++le)Z[le+J]=ee[le];return le}function Je(ee,Z){return ee instanceof Z||ee!=null&&ee.constructor!=null&&ee.constructor.name!=null&&ee.constructor.name===Z.name}function nt(ee){return ee!==ee}const it=(function(){const ee="0123456789abcdef",Z=new Array(256);for(let J=0;J<16;++J){const ne=J*16;for(let le=0;le<16;++le)Z[ne+le]=ee[J]+ee[le]}return Z})();function Ye(ee){return typeof BigInt>"u"?rt:ee}function rt(){throw new Error("BigInt not supported")}})(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var N=toolsEbml&&toolsEbml.__assign||function(){return N=Object.assign||function(A){for(var D,i=1,T=arguments.length;i<T;i++){D=arguments[i];for(var C in D)Object.prototype.hasOwnProperty.call(D,C)&&(A[C]=D[C])}return A},N.apply(this,arguments)},M=toolsEbml&&toolsEbml.__spreadArray||function(A,D,i){if(i||arguments.length===2)for(var T=0,C=D.length,U;T<C;T++)(U||!(T in D))&&(U||(U=Array.prototype.slice.call(D,0,T)),U[T]=D[T]);return A.concat(U||Array.prototype.slice.call(D))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var B=requireTools(),F=(function(){function A(){}return A.readVint=function(D,i){i===void 0&&(i=0);var T=8-Math.floor(Math.log2(D[i]));if(T>8){var C=A.readHexString(D,i,i+T);throw new Error("Unrepresentable length: ".concat(T," ").concat(C))}if(i+T>D.length)return null;for(var U=D[i]&(1<<8-T)-1,j=1;j<T;j+=1){if(j===7&&U>=Math.pow(2,8)&&D[i+7]>0)return{length:T,value:-1};U*=Math.pow(2,8),U+=D[i+j]}return{length:T,value:U}},A.writeVint=function(D){if(D<0||D>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(D));var i=1;for(i=1;i<=8&&!(D<Math.pow(2,7*i)-1);i+=1);for(var T=B.Buffer.alloc(i),C=D,U=1;U<=i;U+=1){var j=C&255;T[i-U]=j,C-=j,C/=Math.pow(2,8)}return T[0]|=1<<8-i,T},A.concatenate=function(D,i){return!D&&!i?B.Buffer.from([]):!D||D.byteLength===0?i:!i||i.byteLength===0?D:B.Buffer.from(M(M([],D,!0),i,!0))},A.readHexString=function(D,i,T){return i===void 0&&(i=0),T===void 0&&(T=D.byteLength),Array.from(D.slice(i,T)).map(function(C){return Number(C).toString(16)}).reduce(function(C,U){return"".concat(C).concat(U.padStart(2,"0"))},"")},A.readUtf8=function(D){try{return B.Buffer.from(D).toString("utf8")}catch{return null}},A.readUnsigned=function(D){var i=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 1:return i.getUint8(0);case 2:return i.getUint16(0);case 4:return i.getUint32(0)}return D.byteLength<=6?D.reduce(function(T,C){return T*256+C},0):A.readHexString(D,0,D.byteLength)},A.readSigned=function(D){var i=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 1:return i.getInt8(0);case 2:return i.getInt16(0);case 4:return i.getInt32(0);default:return NaN}},A.readFloat=function(D){var i=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 4:return i.getFloat32(0);case 8:return i.getFloat64(0);default:return NaN}},A.readDate=function(D){var i=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 1:return new Date(i.getUint8(0));case 2:return new Date(i.getUint16(0));case 4:return new Date(i.getUint32(0));case 8:return new Date(Number.parseInt(A.readHexString(D),16));default:return new Date(0)}},A.readDataFromTag=function(D,i){var T=D.type,C=D.name,U=D.track,j=D.discardable||!1,z=D.keyframe||!1,K=null,Y;switch(T){case"u":Y=A.readUnsigned(i);break;case"f":Y=A.readFloat(i);break;case"i":Y=A.readSigned(i);break;case"s":Y=String.fromCharCode.apply(String,i);break;case"8":Y=A.readUtf8(i);break;case"d":Y=A.readDate(i);break}if(C==="SimpleBlock"||C==="Block"){var te=0,ae=A.readVint(i,te),se=ae.length,oe=ae.value;te+=se,U=oe,Y=A.readSigned(i.subarray(te,te+2)),te+=2,C==="SimpleBlock"&&(z=!!(i[se+2]&128),j=!!(i[se+2]&1)),te+=1,K=i.subarray(te)}return N(N({},D),{data:i,discardable:j,keyframe:z,payload:K,track:U,value:Y})},A})();return toolsEbml.default=F,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(N,M,B){M=M||0;for(var F=1;F<=8&&!(N[M]>=Math.pow(2,8-F));F++);if(F>8)throw new Error("Unrepresentable length: "+F+" "+N.toString("hex",M,M+F));if(M+F>N.length)return null;var A,D=N[M]&(1<<8-F)-1;for(A=1;A<F;A++){if(A===7&&D>=Math.pow(2,45)&&N[M+7]>0)return{length:F,value:-1};D*=Math.pow(2,8),D+=N[M+A]}return B&&(D-=Math.pow(2,F*7-1)-1),{length:F,value:D}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var N=requireVint();function M(B){this.buffer=B,this.offset=0}return M.prototype.nextInt16BE=function(){var B=this.buffer.readInt16BE(this.offset);return this.offset+=2,B},M.prototype.nextUInt8=function(){var B=this.buffer.readUInt8(this.offset);return this.offset+=1,B},M.prototype.nextUIntV=function(){var B=N(this.buffer,this.offset);return this.offset+=B.length,B.value},M.prototype.nextIntV=function(){var B=N(this.buffer,this.offset,!0);return this.offset+=B.length,B.value},M.prototype.nextBuffer=function(B){var F=B?this.buffer.slice(this.offset,this.offset+B):this.buffer.slice(this.offset);return this.offset+=B||this.length,F},Object.defineProperty(M.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=M,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var N=requireBufferReader(),M=1,B=3,F=2;ebmlBlock=function(D){var i={},T=new N(D);i.trackNumber=T.nextUIntV(),i.timecode=T.nextInt16BE();var C=T.nextUInt8();i.invisible=!!(C&8),i.keyframe=!!(C&128),i.discardable=!!(C&1);var U=(C&6)>>1;return i.frames=A(T,U),i};function A(D,i){if(!i)return[D.nextBuffer()];var T,C,U=[],j=D.nextUInt8()+1;if(i===F){if(D.length%j!==0)throw new Error("Fixed-Size Lacing Error");for(C=D.length/j,T=0;T<j;T++)U.push(D.nextBuffer(C));return U}var z=[];if(i===M)for(T=0;T<j-1;T++){var K;C=0;do K=D.nextUInt8(),C+=K;while(K===255);z.push(C)}else if(i===B)for(C=D.nextUIntV(),z.push(C),T=1;T<j-1;T++)C+=D.nextIntV(),z.push(C);for(T=0;T<j-1;T++)U.push(D.nextBuffer(z[T]));return U.push(D.nextBuffer()),U}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,(function(N){Object.defineProperty(N,"__esModule",{value:!0}),N.convertEBMLDateToJSDate=N.createFloatBuffer=N.createIntBuffer=N.createUIntBuffer=N.encodeValueToBuffer=N.concat=N.putRefinedMetaData=N.extractElement=N.removeElement=N.makeMetadataSeekable=N.createRIFFChunk=N.VP8BitStreamToRiffWebPBuffer=N.WebPBlockFilter=N.encodeTag=N.readBlock=N.ebmlBlock=N.writeVint=N.readVint=N.Buffer=void 0;var M=requireInt64Buffer(),B=requireEBMLEncoder(),F=requireBuffer(),A=requireToolsEbml(),D=requireEbmlBlock();N.Buffer=F.Buffer,N.readVint=A.default.readVint,N.writeVint=A.default.writeVint,N.ebmlBlock=D;function i(re){return(0,N.ebmlBlock)(new N.Buffer(re))}N.readBlock=i;function T(re,de,be){return be===void 0&&(be=!1),ie([re,be?new N.Buffer("01ffffffffffffff","hex"):(0,N.writeVint)(de.length),de])}N.encodeTag=T;function C(re){return re.reduce(function(de,be){if(be.type!=="b"||be.name!=="SimpleBlock")return de;var _e=(0,N.ebmlBlock)(be.data),we=_e.frames.some(function(ge){var Ee=ge.slice(3,6).toString("hex");return Ee==="9d012a"});return we?de.concat(be):de},[])}N.WebPBlockFilter=C;function U(re){var de=j("VP8 ",re),be=ie([new N.Buffer("WEBP","ascii"),de]);return j("RIFF",be)}N.VP8BitStreamToRiffWebPBuffer=U;function j(re,de){var be=new N.Buffer(4);return be.writeUInt32LE(de.byteLength,0),ie([new N.Buffer(re.substr(0,4),"ascii"),be,de,new N.Buffer(de.byteLength%2===0?0:1)])}N.createRIFFChunk=j;function z(re,de,be){var _e=Y("EBML",re),we=ae(_e),ge=we+12,Ee=re[re.length-1].dataEnd-ge,qe=Y("Info",re);K("Duration",qe),qe.splice(1,0,{name:"Duration",type:"f",data:fe(de,8)});for(var Me=ae(qe),ze=Y("Tracks",re),Ke=ae(ze),Re=47,$e=[],Ve=5+be.length*15,Ne=[],He=-1,Ge=10,Ze=function(Te){var Ce=Re,Ue=Ce+Me,je=Ue+Ke,Fe=je+Ve,We=Fe-Ee;if($e=[],$e.push({name:"SeekHead",type:"m",isEnd:!1}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new N.Buffer([21,73,169,102])}),$e.push({name:"SeekPosition",type:"u",data:pe(Ce)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new N.Buffer([22,84,174,107])}),$e.push({name:"SeekPosition",type:"u",data:pe(Ue)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new N.Buffer([28,83,187,107])}),$e.push({name:"SeekPosition",type:"u",data:pe(je)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"SeekHead",type:"m",isEnd:!0}),Re=ae($e),Ne=[],Ne.push({name:"Cues",type:"m",isEnd:!1}),be.forEach(function(Qe){var tt=Qe.CueTrack,Xe=Qe.CueClusterPosition,et=Qe.CueTime;Ne.push({name:"CuePoint",type:"m",isEnd:!1}),Ne.push({name:"CueTime",type:"u",data:pe(et)}),Ne.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Ne.push({name:"CueTrack",type:"u",data:pe(tt)}),Xe-=ge,Xe+=We,Ne.push({name:"CueClusterPosition",type:"u",data:pe(Xe)}),Ne.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Ne.push({name:"CuePoint",type:"m",isEnd:!0})}),Ne.push({name:"Cues",type:"m",isEnd:!0}),Ve=ae(Ne),He!==We){if(He=We,Te===Ge-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},Le=0;Le<Ge;Le++){var Oe=Ze(Le);if(Oe==="break")break}var Se=[].concat.apply([],[_e,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},$e,qe,ze,Ne]),Ie=new B.default().encode(Se);return Ie}N.makeMetadataSeekable=z;function K(re,de){for(var be=-1,_e=0;_e<de.length;_e++){var we=de[_e];if(we.name===re)if(we.type==="m")if(!we.isEnd)be=_e;else{if(be==-1)throw new Error("Detected ".concat(re," closing element before finding the start"));de.splice(be,_e-be+1);return}else{de.splice(_e,1);return}}}N.removeElement=K;function Y(re,de){for(var be=[],_e=-1,we=0;we<de.length;we++){var ge=de[we];if(ge.name===re)if(ge.type==="m")if(!ge.isEnd)_e=we;else{if(_e==-1)throw new Error("Detected ".concat(re," closing element before finding the start"));be=de.slice(_e,we+1);break}else{be.push(de[we]);break}}return be}N.extractElement=Y;function te(re,de){Array.isArray(de.cueInfos)&&!Array.isArray(de.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),de.cues=de.cueInfos);for(var be=[],_e=[],we=0;we<re.length;we++){var ge=re[we];if(ge.type==="m"&&ge.name==="Segment"){if(be=re.slice(0,we),_e=re.slice(we),ge.unknownSize){_e.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(_e[_e.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var Ee=_e[_e.length-1].dataEnd,qe=be[be.length-1].dataEnd,Me=new B.default().encode(be).byteLength,ze=Me-qe,Ke=Ee-_e[0].tagStart;_e[0].tagStart-qe,_e[0].tagStart;var Re=new N.Buffer([24,83,128,103]),$e=new N.Buffer("01ffffffffffffff","hex"),Ve=Re.byteLength+$e.byteLength,Ne=Ke,He;for(He=1;He<20;He++){var Ge=qe+Ve+Ne,Ze=Ge-Ee,Le=ze+Ze,Oe=se(_e,Le,de),Se=new B.default().encode(Oe).byteLength;if(Se===Ne)return new B.default().encode([].concat(be,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],Oe));Ne=Se}throw new Error("unable to refine metadata, stable size could not be found in "+He+" iterations!")}N.putRefinedMetaData=te;function ae(re){var de=new B.default;return re.reduce(function(be,_e){return be.concat(de.encode([_e]))},[]).reduce(function(be,_e){return be+_e.byteLength},0)}function se(re,de,be){var _e=be.duration,we=be.clusterPtrs,ge=be.cues,Ee=re.slice(0);if(typeof _e=="number"){var qe=!1;Ee.forEach(function(ze){ze.type==="f"&&ze.name==="Duration"&&(qe=!0,ze.data=fe(_e,8))}),qe||ke(Ee,"Info",[{name:"Duration",type:"f",data:fe(_e,8)}])}Array.isArray(ge)&&ke(Ee,"Cues",he(ge,de));var Me=[];return Array.isArray(we)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Me=oe(we,de)),ke(Ee,"SeekHead",Me,!0),Ee}function oe(re,de){var be=[];return re.forEach(function(_e){be.push({name:"Seek",type:"m",isEnd:!1}),be.push({name:"SeekID",type:"b",data:new N.Buffer([31,67,182,117])}),be.push({name:"SeekPosition",type:"u",data:pe(_e+de)}),be.push({name:"Seek",type:"m",isEnd:!0})}),be}function he(re,de){var be=[];return re.forEach(function(_e){var we=_e.CueTrack,ge=_e.CueClusterPosition,Ee=_e.CueTime;be.push({name:"CuePoint",type:"m",isEnd:!1}),be.push({name:"CueTime",type:"u",data:pe(Ee)}),be.push({name:"CueTrackPositions",type:"m",isEnd:!1}),be.push({name:"CueTrack",type:"u",data:pe(we)}),be.push({name:"CueClusterPosition",type:"u",data:pe(ge+de)}),be.push({name:"CueTrackPositions",type:"m",isEnd:!0}),be.push({name:"CuePoint",type:"m",isEnd:!0})}),be}function ke(re,de,be,_e){_e===void 0&&(_e=!1);for(var we=-1,ge=0;ge<re.length;ge++){var Ee=re[ge];if(Ee.type==="m"&&Ee.name===de&&Ee.isEnd===!1){we=ge;break}}we>=0?Array.prototype.splice.apply(re,[we+1,0].concat(be)):_e?[].concat([{name:de,type:"m",isEnd:!1}],be,[{name:de,type:"m",isEnd:!0}]).reverse().forEach(function(qe){re.unshift(qe)}):(re.push({name:de,type:"m",isEnd:!1}),be.forEach(function(qe){re.push(qe)}),re.push({name:de,type:"m",isEnd:!0}))}function ie(re){return N.Buffer.concat(re)}N.concat=ie;function ce(re){var de=new N.Buffer(0);if(re.type==="m")return re;switch(re.type){case"u":de=pe(re.value);break;case"i":de=ue(re.value);break;case"f":de=fe(re.value);break;case"s":de=new N.Buffer(re.value,"ascii");break;case"8":de=new N.Buffer(re.value,"utf8");break;case"b":de=re.value;break;case"d":de=new M.Int64BE(re.value.getTime().toString()).toBuffer();break}return Object.assign({},re,{data:de})}N.encodeValueToBuffer=ce;function pe(re){for(var de=1;re>=Math.pow(2,8*de);de++);if(de>=7)return console.warn("7bit or more bigger uint not supported."),new M.Uint64BE(re).toBuffer();var be=new N.Buffer(de);return be.writeUIntBE(re,0,de),be}N.createUIntBuffer=pe;function ue(re){for(var de=1;re>=Math.pow(2,8*de);de++);if(de>=7)return console.warn("7bit or more bigger uint not supported."),new M.Int64BE(re).toBuffer();var be=new N.Buffer(de);return be.writeIntBE(re,0,de),be}N.createIntBuffer=ue;function fe(re,de){if(de===void 0&&(de=8),de===8){var be=new N.Buffer(8);return be.writeDoubleBE(re,0),be}else if(de===4){var be=new N.Buffer(4);return be.writeFloatBE(re,0),be}else throw new Error("float type bits must 4bytes or 8bytes")}N.createFloatBuffer=fe;function ye(re){return re instanceof Date?re:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(re)/1e3/1e3)}N.convertEBMLDateToJSDate=ye})(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var N=requireInt64Buffer(),M=requireTools(),B=requireTools(),F=requireEbmlID(),A;(function(i){i[i.STATE_TAG=1]="STATE_TAG",i[i.STATE_SIZE=2]="STATE_SIZE",i[i.STATE_CONTENT=3]="STATE_CONTENT"})(A||(A={}));var D=(function(){function i(){this._buffer=new M.Buffer(0),this._tag_stack=[],this._state=A.STATE_TAG,this._cursor=0,this._total=0,this._schema=F.byEbmlID,this._result=[]}return i.prototype.decode=function(T){this.readChunk(T);var C=this._result;return this._result=[],C},i.prototype.readChunk=function(T){for(this._buffer=B.concat([this._buffer,new M.Buffer(T)]);this._cursor<this._buffer.length&&!(this._state===A.STATE_TAG&&!this.readTag()||this._state===A.STATE_SIZE&&!this.readSize()||this._state===A.STATE_CONTENT&&!this.readContent()););},i.prototype.getSchemaInfo=function(T){return this._schema[T]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},i.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var T=(0,M.readVint)(this._buffer,this._cursor);if(T==null)return!1;var C=this._buffer.slice(this._cursor,this._cursor+T.length),U=C.reduce(function(K,Y,te,ae){return K+Y*Math.pow(16,2*(ae.length-1-te))},0),j=this.getSchemaInfo(U),z={EBML_ID:U.toString(16),schema:j,type:j.type,name:j.name,level:j.level,tagStart:this._total,tagEnd:this._total+T.length,sizeStart:this._total+T.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(z),this._cursor+=T.length,this._total+=T.length,this._state=A.STATE_SIZE,!0},i.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var T=(0,M.readVint)(this._buffer,this._cursor);if(T==null)return!1;var C=this._tag_stack[this._tag_stack.length-1];return C.sizeEnd=C.sizeStart+T.length,C.dataStart=C.sizeEnd,C.dataSize=T.value,T.value===-1?(C.dataEnd=-1,C.type==="m"&&(C.unknownSize=!0)):C.dataEnd=C.sizeEnd+T.value,this._cursor+=T.length,this._total+=T.length,this._state=A.STATE_CONTENT,!0},i.prototype.readContent=function(){var T=this._tag_stack[this._tag_stack.length-1];if(T.type==="m"){if(T.isEnd=!1,this._result.push(T),this._state=A.STATE_TAG,T.dataSize===0){var C=Object.assign({},T,{isEnd:!0});this._result.push(C),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+T.dataSize)return!1;var U=this._buffer.slice(this._cursor,this._cursor+T.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+T.dataSize),T.data=U,T.type){case"u":T.value=U.readUIntBE(0,U.length);break;case"i":T.value=U.readIntBE(0,U.length);break;case"f":T.value=T.dataSize===4?U.readFloatBE(0):T.dataSize===8?U.readDoubleBE(0):(console.warn("cannot read ".concat(T.dataSize," octets float. failback to 0")),0);break;case"s":T.value=U.toString("ascii");break;case"8":T.value=U.toString("utf8");break;case"b":T.value=U;break;case"d":T.value=(0,M.convertEBMLDateToJSDate)(new N.Int64BE(U).toNumber());break}if(T.value===null)throw new Error("unknown tag type:"+T.type);for(this._result.push(T),this._total+=T.dataSize,this._state=A.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var j=this._tag_stack[this._tag_stack.length-1];if(j.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<j.dataEnd)break;if(j.type!=="m")throw new Error("parent element is not master element");var C=Object.assign({},j,{isEnd:!0});this._result.push(C),this._tag_stack.pop()}return!0},i})();return EBMLDecoder.default=D,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var N=typeof Reflect=="object"?Reflect:null,M=N&&typeof N.apply=="function"?N.apply:function(ce,pe,ue){return Function.prototype.apply.call(ce,pe,ue)},B;N&&typeof N.ownKeys=="function"?B=N.ownKeys:Object.getOwnPropertySymbols?B=function(ce){return Object.getOwnPropertyNames(ce).concat(Object.getOwnPropertySymbols(ce))}:B=function(ce){return Object.getOwnPropertyNames(ce)};function F(ie){console&&console.warn&&console.warn(ie)}var A=Number.isNaN||function(ce){return ce!==ce};function D(){D.init.call(this)}events.exports=D,events.exports.once=oe,D.EventEmitter=D,D.prototype._events=void 0,D.prototype._eventsCount=0,D.prototype._maxListeners=void 0;var i=10;function T(ie){if(typeof ie!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ie)}Object.defineProperty(D,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(ie){if(typeof ie!="number"||ie<0||A(ie))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ie+".");i=ie}}),D.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},D.prototype.setMaxListeners=function(ce){if(typeof ce!="number"||ce<0||A(ce))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ce+".");return this._maxListeners=ce,this};function C(ie){return ie._maxListeners===void 0?D.defaultMaxListeners:ie._maxListeners}D.prototype.getMaxListeners=function(){return C(this)},D.prototype.emit=function(ce){for(var pe=[],ue=1;ue<arguments.length;ue++)pe.push(arguments[ue]);var fe=ce==="error",ye=this._events;if(ye!==void 0)fe=fe&&ye.error===void 0;else if(!fe)return!1;if(fe){var re;if(pe.length>0&&(re=pe[0]),re instanceof Error)throw re;var de=new Error("Unhandled error."+(re?" ("+re.message+")":""));throw de.context=re,de}var be=ye[ce];if(be===void 0)return!1;if(typeof be=="function")M(be,this,pe);else for(var _e=be.length,we=te(be,_e),ue=0;ue<_e;++ue)M(we[ue],this,pe);return!0};function U(ie,ce,pe,ue){var fe,ye,re;if(T(pe),ye=ie._events,ye===void 0?(ye=ie._events=Object.create(null),ie._eventsCount=0):(ye.newListener!==void 0&&(ie.emit("newListener",ce,pe.listener?pe.listener:pe),ye=ie._events),re=ye[ce]),re===void 0)re=ye[ce]=pe,++ie._eventsCount;else if(typeof re=="function"?re=ye[ce]=ue?[pe,re]:[re,pe]:ue?re.unshift(pe):re.push(pe),fe=C(ie),fe>0&&re.length>fe&&!re.warned){re.warned=!0;var de=new Error("Possible EventEmitter memory leak detected. "+re.length+" "+String(ce)+" listeners added. Use emitter.setMaxListeners() to increase limit");de.name="MaxListenersExceededWarning",de.emitter=ie,de.type=ce,de.count=re.length,F(de)}return ie}D.prototype.addListener=function(ce,pe){return U(this,ce,pe,!1)},D.prototype.on=D.prototype.addListener,D.prototype.prependListener=function(ce,pe){return U(this,ce,pe,!0)};function j(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function z(ie,ce,pe){var ue={fired:!1,wrapFn:void 0,target:ie,type:ce,listener:pe},fe=j.bind(ue);return fe.listener=pe,ue.wrapFn=fe,fe}D.prototype.once=function(ce,pe){return T(pe),this.on(ce,z(this,ce,pe)),this},D.prototype.prependOnceListener=function(ce,pe){return T(pe),this.prependListener(ce,z(this,ce,pe)),this},D.prototype.removeListener=function(ce,pe){var ue,fe,ye,re,de;if(T(pe),fe=this._events,fe===void 0)return this;if(ue=fe[ce],ue===void 0)return this;if(ue===pe||ue.listener===pe)--this._eventsCount===0?this._events=Object.create(null):(delete fe[ce],fe.removeListener&&this.emit("removeListener",ce,ue.listener||pe));else if(typeof ue!="function"){for(ye=-1,re=ue.length-1;re>=0;re--)if(ue[re]===pe||ue[re].listener===pe){de=ue[re].listener,ye=re;break}if(ye<0)return this;ye===0?ue.shift():ae(ue,ye),ue.length===1&&(fe[ce]=ue[0]),fe.removeListener!==void 0&&this.emit("removeListener",ce,de||pe)}return this},D.prototype.off=D.prototype.removeListener,D.prototype.removeAllListeners=function(ce){var pe,ue,fe;if(ue=this._events,ue===void 0)return this;if(ue.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ue[ce]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ue[ce]),this;if(arguments.length===0){var ye=Object.keys(ue),re;for(fe=0;fe<ye.length;++fe)re=ye[fe],re!=="removeListener"&&this.removeAllListeners(re);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(pe=ue[ce],typeof pe=="function")this.removeListener(ce,pe);else if(pe!==void 0)for(fe=pe.length-1;fe>=0;fe--)this.removeListener(ce,pe[fe]);return this};function K(ie,ce,pe){var ue=ie._events;if(ue===void 0)return[];var fe=ue[ce];return fe===void 0?[]:typeof fe=="function"?pe?[fe.listener||fe]:[fe]:pe?se(fe):te(fe,fe.length)}D.prototype.listeners=function(ce){return K(this,ce,!0)},D.prototype.rawListeners=function(ce){return K(this,ce,!1)},D.listenerCount=function(ie,ce){return typeof ie.listenerCount=="function"?ie.listenerCount(ce):Y.call(ie,ce)},D.prototype.listenerCount=Y;function Y(ie){var ce=this._events;if(ce!==void 0){var pe=ce[ie];if(typeof pe=="function")return 1;if(pe!==void 0)return pe.length}return 0}D.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function te(ie,ce){for(var pe=new Array(ce),ue=0;ue<ce;++ue)pe[ue]=ie[ue];return pe}function ae(ie,ce){for(;ce+1<ie.length;ce++)ie[ce]=ie[ce+1];ie.pop()}function se(ie){for(var ce=new Array(ie.length),pe=0;pe<ce.length;++pe)ce[pe]=ie[pe].listener||ie[pe];return ce}function oe(ie,ce){return new Promise(function(pe,ue){function fe(re){ie.removeListener(ce,ye),ue(re)}function ye(){typeof ie.removeListener=="function"&&ie.removeListener("error",fe),pe([].slice.call(arguments))}ke(ie,ce,ye,{once:!0}),ce!=="error"&&he(ie,fe,{once:!0})})}function he(ie,ce,pe){typeof ie.on=="function"&&ke(ie,"error",ce,pe)}function ke(ie,ce,pe,ue){if(typeof ie.on=="function")ue.once?ie.once(ce,pe):ie.on(ce,pe);else if(typeof ie.addEventListener=="function")ie.addEventListener(ce,function fe(ye){ue.once&&ie.removeEventListener(ce,fe),pe(ye)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ie)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var N=EBMLReader&&EBMLReader.__extends||(function(){var A=function(D,i){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,C){T.__proto__=C}||function(T,C){for(var U in C)Object.prototype.hasOwnProperty.call(C,U)&&(T[U]=C[U])},A(D,i)};return function(D,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");A(D,i);function T(){this.constructor=D}D.prototype=i===null?Object.create(i):(T.prototype=i.prototype,new T)}})();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var M=requireEvents(),B=requireTools(),F=(function(A){N(D,A);function D(){var i=A.call(this)||this;return i.logGroup="",i.hasLoggingStarted=!1,i.metadataloaded=!1,i.chunks=[],i.stack=[],i.segmentOffset=0,i.last2SimpleBlockVideoTrackTimecode=[0,0],i.last2SimpleBlockAudioTrackTimecode=[0,0],i.lastClusterTimecode=0,i.lastClusterPosition=0,i.timecodeScale=1e6,i.metadataSize=0,i.metadatas=[],i.cues=[],i.firstVideoBlockRead=!1,i.firstAudioBlockRead=!1,i.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},i.trackTypes=[],i.trackDefaultDuration=[],i.trackCodecDelay=[],i.trackInfo={type:"nothing"},i.ended=!1,i.logging=!1,i.use_duration_every_simpleblock=!1,i.use_webp=!1,i.use_segment_info=!0,i.drop_default_duration=!0,i}return D.prototype.stop=function(){for(this.ended=!0,this.emit_segment_info();this.stack.length;)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},D.prototype.emit_segment_info=function(){var i=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var U=this.lastClusterTimecode,j=this.duration,z=this.timecodeScale;this.emit("cluster",{timecode:U,data:i}),this.emit("duration",{timecodeScale:z,duration:j})}else{this.metadataloaded=!0,this.metadatas=i;var T=this.trackTypes.indexOf(1),C=this.trackTypes.indexOf(2);if(this.trackInfo=T>=0&&C>=0?{type:"both",trackNumber:T}:T>=0?{type:"video",trackNumber:T}:C>=0?{type:"audio",trackNumber:C}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:i,metadataSize:this.metadataSize})}},D.prototype.read=function(i){var T=this,C=!1;if(!this.ended){if(i.type==="m")if(i.isEnd)this.stack.pop();else{var U=this.stack[this.stack.length-1];if(U!=null&&U.level>=i.level){this.stack.pop(),this.logging&&console.groupEnd(),U.dataEnd=i.dataEnd,U.dataSize=i.dataEnd-U.dataStart,U.unknownSize=!1;var j=Object.assign({},U,{name:U.name,type:U.type,isEnd:!0});this.chunks.push(j)}this.stack.push(i)}if(i.type==="m"&&i.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=i.dataStart,this.emit("segment_offset",this.segmentOffset);else if(i.type==="b"&&i.name==="SimpleBlock"){var z=B.ebmlBlock(i.data),K=z.timecode,Y=z.trackNumber,te=z.frames;if(this.trackTypes[Y]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var ae=this.lastClusterTimecode+K;this.cues.push({CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:ae}),this.emit("cue_info",{CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:ae})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],K]}else if(this.trackTypes[Y]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var ae=this.lastClusterTimecode+K;this.cues.push({CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:ae}),this.emit("cue_info",{CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:ae})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],K]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&te.forEach(function(se){var oe=se.slice(3,6).toString("hex");if(oe==="9d012a"){var he=B.VP8BitStreamToRiffWebPBuffer(se),ke=new Blob([he],{type:"image/webp"}),ie=T.duration;T.emit("webp",{currentTime:ie,webp:ke})}})}else i.type==="m"&&i.name==="Cluster"&&i.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",i.tagStart),this.lastClusterPosition=i.tagStart):i.type==="u"&&i.name==="Timecode"?this.lastClusterTimecode=i.value:i.type==="u"&&i.name==="TimecodeScale"?this.timecodeScale=i.value:i.type==="m"&&i.name==="TrackEntry"?i.isEnd?(this.trackTypes[this.currentTrack.TrackNumber]=this.currentTrack.TrackType,this.trackDefaultDuration[this.currentTrack.TrackNumber]=this.currentTrack.DefaultDuration,this.trackCodecDelay[this.currentTrack.TrackNumber]=this.currentTrack.CodecDelay):this.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null}:i.type==="u"&&i.name==="TrackType"?this.currentTrack.TrackType=i.value:i.type==="u"&&i.name==="TrackNumber"?this.currentTrack.TrackNumber=i.value:i.type==="u"&&i.name==="CodecDelay"?this.currentTrack.CodecDelay=i.value:i.type==="u"&&i.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),C=!0):this.currentTrack.DefaultDuration=i.value:i.name==="unknown"&&console.warn(i);!this.metadataloaded&&i.dataEnd>0&&(this.metadataSize=i.dataEnd),C||this.chunks.push(i),this.logging&&this.put(i)}},Object.defineProperty(D.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var i=0,T=0,C=0,U=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof U=="number")i=U;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var j=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof j=="number"&&(T=j),C=this.last2SimpleBlockAudioTrackTimecode[1]}else{i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var j=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof j=="number"&&(T=j),C=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var j=this.trackCodecDelay[this.trackInfo.trackNumber];typeof j=="number"&&(T=j),C=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var j=this.trackCodecDelay[this.trackInfo.trackNumber];typeof j=="number"&&(T=j),C=this.last2SimpleBlockAudioTrackTimecode[1]}var z=(this.lastClusterTimecode+C)*this.timecodeScale+i-T,K=z/this.timecodeScale;return Math.floor(K)},enumerable:!1,configurable:!0}),D.prototype.addListener=function(i,T){return A.prototype.addListener.call(this,i,T)},D.prototype.put=function(i){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),i.type==="m"?i.isEnd?console.groupEnd():console.group(i.name+":"+i.tagStart):i.type==="b"?console.log(i.name,i.type):console.log(i.name,i.tagStart,i.type,i.value)},D})(M.EventEmitter);return EBMLReader.default=F,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,(function(N){var M=ebml&&ebml.__createBinding||(Object.create?(function(T,C,U,j){j===void 0&&(j=U),Object.defineProperty(T,j,{enumerable:!0,get:function(){return C[U]}})}):(function(T,C,U,j){j===void 0&&(j=U),T[j]=C[U]})),B=ebml&&ebml.__exportStar||function(T,C){for(var U in T)U!=="default"&&!Object.prototype.hasOwnProperty.call(C,U)&&M(C,T,U)};Object.defineProperty(N,"__esModule",{value:!0}),N.tools=N.Reader=N.Encoder=N.Decoder=void 0,B(requireEBML(),N);var F=requireEBMLDecoder();N.Decoder=F.default;var A=requireEBMLEncoder();N.Encoder=A.default;var D=requireEBMLReader();N.Reader=D.default;var i=requireTools();N.tools=i})(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var N=lib&&lib.__awaiter||function(A,D,i,T){function C(U){return U instanceof i?U:new i(function(j){j(U)})}return new(i||(i=Promise))(function(U,j){function z(te){try{Y(T.next(te))}catch(ae){j(ae)}}function K(te){try{Y(T.throw(te))}catch(ae){j(ae)}}function Y(te){te.done?U(te.value):C(te.value).then(z,K)}Y((T=T.apply(A,D||[])).next())})},M=lib&&lib.__generator||function(A,D){var i={label:0,sent:function(){if(U[0]&1)throw U[1];return U[1]},trys:[],ops:[]},T,C,U,j;return j={next:z(0),throw:z(1),return:z(2)},typeof Symbol=="function"&&(j[Symbol.iterator]=function(){return this}),j;function z(Y){return function(te){return K([Y,te])}}function K(Y){if(T)throw new TypeError("Generator is already executing.");for(;i;)try{if(T=1,C&&(U=Y[0]&2?C.return:Y[0]?C.throw||((U=C.return)&&U.call(C),0):C.next)&&!(U=U.call(C,Y[1])).done)return U;switch(C=0,U&&(Y=[Y[0]&2,U.value]),Y[0]){case 0:case 1:U=Y;break;case 4:return i.label++,{value:Y[1],done:!1};case 5:i.label++,C=Y[1],Y=[0];continue;case 7:Y=i.ops.pop(),i.trys.pop();continue;default:if(U=i.trys,!(U=U.length>0&&U[U.length-1])&&(Y[0]===6||Y[0]===2)){i=0;continue}if(Y[0]===3&&(!U||Y[1]>U[0]&&Y[1]<U[3])){i.label=Y[1];break}if(Y[0]===6&&i.label<U[1]){i.label=U[1],U=Y;break}if(U&&i.label<U[2]){i.label=U[2],i.ops.push(Y);break}U[2]&&i.ops.pop(),i.trys.pop();continue}Y=D.call(A,i)}catch(te){Y=[6,te],C=0}finally{T=U=0}if(Y[0]&5)throw Y[1];return{value:Y[0]?Y[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var B=requireEbml();function F(A){return N(this,void 0,void 0,function(){var D,i,T,C,U,j,z,K,Y,te,ae,se;return M(this,function(oe){switch(oe.label){case 0:if(!A)throw Error("call to fixWebmDuration requires a blob");D=new B.Decoder,i=new B.Reader,T=A.stream(),C=T.getReader(),oe.label=1;case 1:return[4,C.read()];case 2:return U=oe.sent(),j=U.done,z=U.value,j?(i.stop(),[3,3]):(K=D.decode(z),K=K?.filter(function(he){return he.type!=="unknown"}),K.forEach(function(he){i.read(he)}),z=null,[3,1]);case 3:return Y=B.tools.makeMetadataSeekable(i.metadatas,i.duration,i.cues),te=new Blob([Y],{type:A.type}),ae=A.slice(i.metadataSize),se=new Blob([te,ae],{type:A.type}),[2,se]}})})}return lib.default=F,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{#e;#n=!1;#t=!1;#r=0;#o=0;#i=0;#a=0;#s=0;onchange=M=>{};onDurationChange=M=>{};constructor(){}start=async(M="")=>{M||(M=`video_Record_${u(Date.now())}`);let B=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(F=>{const A=F.getTracks();for(const i of A)i.onended=()=>this.stop();this.#n=!0,this.#t=!1,this.#e=new MediaRecorder(F),this.#e.start();const D=new Date().getTime();this.#r=D,this.#i=D,this.#c(),this.#l(),this.#e.addEventListener("dataavailable",i=>{B.push(i.data)}),this.#e.addEventListener("stop",async()=>{this.#n=!1;const i=new Date().getTime();this.#o=i,this.#a+=i-this.#i,this.#c(),clearInterval(this.#s);const T=F.getTracks();for(const K of T)K.stop();if(this.#e===null)return;const C=new Blob(B,{type:this.#e.mimeType}),U=await fixWebmDuration(C),j=URL.createObjectURL(U),z=document.createElement("a");z.href=j,z.download=`${M}.mp4`,z.click(),URL.revokeObjectURL(j),B=[],this.#e=null})})};pause=async()=>{await new Promise(B=>setTimeout(()=>B(!0),300)),this.#e?.pause(),this.#t=!0;const M=new Date().getTime();this.#a+=M-this.#i,this.#c(),clearInterval(this.#s)};resume=async()=>{this.#e?.resume(),this.#t=!1;const M=new Date().getTime();this.#i=M,this.#c(),this.#l()};stop=async()=>{this.#e?.stop()};getDuration=()=>{if(this.#i===0)return 0;let M=this.#a;const B=new Date().getTime();if(this.#n&&this.#t===!1){const F=B-this.#i;this.#i=B,M=M+F}return M};getInfo=()=>({active:this.#n,pause:this.#t,startTime:this.#r,endTime:this.#o,duration:this.#a});#c=()=>{const M=this.getInfo();this.onchange(M)};#l=()=>{clearInterval(this.#s),this.#s=window.setInterval(()=>{this.#a=this.getDuration(),this.onDurationChange(this.#a)},500)}}var l=Object.defineProperty,y=N=>{throw TypeError(N)},q=(N,M,B)=>M in N?l(N,M,{enumerable:!0,configurable:!0,writable:!0,value:B}):N[M]=B,s=(N,M,B)=>q(N,typeof M!="symbol"?M+"":M,B),P=(N,M,B)=>M.has(N)||y("Cannot "+B),n=(N,M,B)=>(P(N,M,"read from private field"),B?B.call(N):M.get(N)),a=(N,M,B)=>M.has(N)?y("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(N):M.set(N,B),d,v,o;class p{constructor(M={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",(B,F={})=>new Promise(async(A,D)=>{const i=F.timeout||this.options.timeout,T=F.key||n(this,d).call(this),C=F.describe||"";if(this.queue.findIndex(j=>j.key===T)!==-1)return D(`${T} is exist.`);const U={key:T,func:B,describe:C,timeout:i,resolve:A,reject:D};this.queue.unshift(U),this.activePromise||n(this,o).call(this)})),s(this,"clear",()=>{this.queue=[],this.activePromise=void 0,clearTimeout(this.timer)}),s(this,"retry",()=>{n(this,o).call(this)}),a(this,d,()=>(this.activeIndex=this.activeIndex+1,`${this.activeIndex}`)),a(this,v,B=>{const F=this.queue.findIndex(A=>A.key===B);this.queue.splice(F,1)}),a(this,o,async()=>{const B=this.queue.length;if(B===0)return;const F=B-1,A=this.queue[F];this.activePromise=A;const{key:D,func:i,resolve:T,reject:C,timeout:U}=this.activePromise;U&&(this.timer=window.setTimeout(()=>{C(`pr-async-queue: ${D} is timeout.`),n(this,o).call(this)},U)),await i().then(T).catch(C).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,v).call(this,D),n(this,o).call(this)})}),this.options={timeout:0,...M}}}d=new WeakMap,v=new WeakMap,o=new WeakMap;const enum_iceState={connecting:"连接中",connected:"已连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};pt(enum_iceState);class PrResolves{resolvesMap=new Map;index=0;constructor(){}add=(M,B=()=>!1,F=0)=>new Promise(A=>{if(B())return A(!0);this.resolvesMap.has(M)||this.resolvesMap.set(M,new Map),this.index++;const T=`${this.index}`;if(F=Math.max(0,F),F===0){this.resolvesMap.get(M)?.set(T,{resolve:A,timer:0});return}const C=window.setTimeout(()=>{this.emit(M)},F);this.resolvesMap.get(M)?.set(T,{resolve:A,timer:C})});emit=async M=>{const B=this.resolvesMap.get(M);if(!B)return;const F=[...B.keys()];for(const A of F){const D=B.get(A);D&&(clearTimeout(D.timer),D.resolve(),B.delete(A))}}}class RoomBase{options={appid:"",sdkToken:"",roomId:"",userId:"",earlyId:Mt(),callType:0,debug:!1,reportErr:!0,useP2P:!0,logUrl:"https://logs1.quickvo.org",newPublishAutoSubscribe:!0};sfuPush=0;sfuPull=0;p2pPush=0;p2pPull=0;historical_publish_mediaTypes=[];historical_subscribe_mediaTypes=[];prResolves=new PrResolves;sdk_service_version="1.0.8";sdk_session="";isEarly=!1;isInRoom=!1;asyncQueue;await_remote_publish_users=[];roomState="ready";iceState="closed";createAt=Date.now();cwsIns;peerIns;sfuOffsetAverageQuality=-2;transceiverMap=new Map;transceiverTrackMap=new Map;sendChannel;receiveChannel;userMap=new Map;p2pMap=new Map;setLocalStreamActiveMap=new Map;phoneyStreams=new Map;recorder=new StreamRecorder;mediaDevicesErrInfo={microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""};constructor(M){this.setOptions(M),this.cwsIns=new CallsWebSocket({...M}),this.asyncQueue=new p}hasAsyncTask=M=>{let B=!1;return this.asyncQueue.activePromise?.describe===M&&(B=!0),B===!1&&this.asyncQueue.queue.find(A=>A.describe===M)&&(B=!0),B};createUserUpdateStreams=(M=[])=>{const B={};for(const F of M)B[F]=Mt();return B};reportLogs=(M,B="未知错误")=>{const F=this.getOptions(),{appid:A,userId:D,earlyId:i="",logUrl:T,reportErr:C}=F;if(!C)return;const U="web",j=z=>({ws_c_timeout:0,webrtc_c_timeout:1,join_room_error:2,publish_error:3,subscribe_error:4,close_track_error:5,heartbeat_e_timeout:6,heartbeat_i_timeout:7,quit_room_error:8})[z].toString();{const z=j(M),K={origin:U,type:z,app_id:A,user_id:D,ins_id:i,desc:B},Y=btoa(encodeURI(JSON.stringify(K))),te=`${T}/upload/log?log_key=${Y}`;{const ae=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),oe=new TextEncoder().encode(ae),he=pako.deflate(oe,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:K,url:te,size:at(he.byteLength)}),fetch(te,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:he})}}};stopPhoneyStreams=(M=[])=>{M.length===0&&(M=mediaType_keys);for(const B of M){const F=this.phoneyStreams.get(B);if(F){const A=F.getTracks();for(const D of A)D.stop()}}};initPhoneyStreams=(M,B=[])=>{B.length===0&&(B=mediaType_keys);for(const F of B)switch(this.stopPhoneyStreams([F]),F){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(M));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(M));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}};getPhoneyStreams=M=>this.phoneyStreams.get(M);getRoomInfo=()=>{const{options:M,roomState:B,createAt:F}=this;return{...M,roomState:B,createAt:F}};setRoomState=M=>{if(this.roomState===M)return;this.roomState=M;const B=enum_roomState[M],F={state:M,stateStr:B};this.cwsIns.emitNotify("onRoomState",{code:200,data:F,desc:"room state is change."})};setIceState=M=>{if(this.iceState===M)return;this.iceState=M;const B=enum_iceState[M],F={state:M,stateStr:B};this.cwsIns.emitNotify("onIceState",{code:200,data:F,desc:"ice state is change."})};setOptions=M=>(this.options={...this.options,...M},this.options);getOptions=()=>this.options;stopStream=async M=>{const B=M.getTracks();for(const F of B)F.stop()};getMediaDevicesErrInfo=async()=>{try{const M=await navigator.mediaDevices.enumerateDevices();M.find(F=>F.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),M.find(F=>F.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(M){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",M)}return this.mediaDevicesErrInfo};getUserMediaKey=(M,B)=>`${M}-${B}`;getCallAction=async M=>{let B="";const F=D=>M.findIndex(({type:T,enabled:C=!0})=>T===D&&C)===-1?"0":"1";return B=`${F(0)}${B}`,B=`${F(1)}${B}`,B=`${F(2)}${B}`,B=`${F(3)}${B}`,parseInt(B,2)};getCallActionMap=(M=0)=>{const F=Number(M).toString(2).padStart(4,"0").split(""),[A,D,i,T]=F;return{microphoneCamera_audio:!!Number(T),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(D),screenSharing_audio:!!Number(A)}};getBanBehaviorMap=(M=0)=>{const F=Number(M).toString(2).padStart(4,"0").split(""),[A,D,i,T]=F;return{microphoneCamera_audio:!!Number(T),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(D),screenSharing_audio:!!Number(A)}};debugSdp=(M,B)=>{if(this.options.debug){const F=libExports$1.parse(M),A=dt(F.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;",`------->quickvo: debugSdp [${B}]`,{msidArr:A,sdpJson:F})}};getAverageVolume=(M,B)=>{M.getByteFrequencyData(B);let F=0;for(let D=0;D<B.length;D++)F+=B[D];return Math.ceil(F/B.length)};getTrackNamesFormTracks=(M,B=[],F="trackName")=>{const A=[];for(const D of M){const{type:i}=D;if(B.length===0||B.includes(i)){const T=D[F];T&&A.push(`${T}`)}}return A};usersFilter=M=>dt(M,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap","useP2P"]).sort((A,D)=>A.id.localeCompare(D.id,"en"))}var m=Object.defineProperty,G=(N,M,B)=>M in N?m(N,M,{enumerable:!0,configurable:!0,writable:!0,value:B}):N[M]=B,e=(N,M,B)=>G(N,typeof M!="symbol"?M+"":M,B);let g$1=class{constructor(M,B){e(this,"inputStream",new MediaStream),e(this,"outputStream",new MediaStream),e(this,"inputGain",1),e(this,"enhanceGain",1),e(this,"bgsGain",1),e(this,"bgmGain",1),e(this,"outputGain",1),e(this,"mixAudioMap",new Map),e(this,"audioContext",new AudioContext),e(this,"sourceNode"),e(this,"inputGainNode"),e(this,"enhanceGainNode"),e(this,"bgsGainNode"),e(this,"bgmGainNode"),e(this,"analyserNode"),e(this,"analyserArrayData"),e(this,"outputGainNode"),e(this,"destinationNode"),e(this,"filterStream",F=>F),e(this,"stop",()=>{{const F=this.inputStream.getTracks();for(const A of F)A.stop(),this.inputStream.removeTrack(A)}}),e(this,"pause",async F=>{const A=this.inputStream.getTracks();for(const D of A)D.enabled=!F}),e(this,"getStream",()=>this.filterStream(this.outputStream)),e(this,"setMute",(F=!0)=>{F?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)}),e(this,"setInputGain",F=>{this.inputGain=F,this.inputGainNode.gain.setValueAtTime(F,this.audioContext.currentTime)}),e(this,"setEnhanceGain",async F=>{this.enhanceGain=F+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)}),e(this,"setBgsGain",F=>{this.bgsGain=F,this.bgsGainNode.gain.setValueAtTime(F,this.audioContext.currentTime)}),e(this,"setBgmGain",F=>{this.bgmGain=F,this.bgmGainNode.gain.setValueAtTime(F,this.audioContext.currentTime)}),e(this,"setOutputGain",F=>{this.outputGain=F,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)}),e(this,"getVolume",()=>{const{analyserNode:F,analyserArrayData:A}=this;F.getByteFrequencyData(A);let D=0;for(let i=0;i<A.length;i++)D+=A[i];return Math.ceil(D/A.length)}),e(this,"mixAudio",(F,A="bgm")=>new Promise(async(D,i)=>{try{{const U=this.mixAudioMap.get(A);U&&U.stop()}const T=A==="bgs"?this.bgsGainNode:this.bgmGainNode,C=this.audioContext.createBufferSource();this.mixAudioMap.set(A,C),C.buffer=F,C.connect(T),C.onended=()=>{C.disconnect(T),this.mixAudioMap.delete(A),D(!0)},C.start(0)}catch(T){i(T)}})),e(this,"mixAudioStop",F=>{const A=this.mixAudioMap.get(F);A?.stop()}),e(this,"changeMix",(F,A)=>{const D=F==="bgs"?this.bgsGainNode:this.bgmGainNode;A?D.connect(this.destinationNode):D.disconnect(this.destinationNode)}),B&&(this.audioContext=B),this.inputStream=M,this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.inputGainNode=this.audioContext.createGain(),this.inputGainNode.gain.setValueAtTime(this.inputGain,this.audioContext.currentTime),this.enhanceGainNode=this.audioContext.createGain(),this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime),this.bgsGainNode=this.audioContext.createGain(),this.bgsGainNode.gain.setValueAtTime(this.bgsGain,this.audioContext.currentTime),this.bgmGainNode=this.audioContext.createGain(),this.bgmGainNode.gain.setValueAtTime(this.bgmGain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount),this.outputGainNode=this.audioContext.createGain(),this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime),this.destinationNode=this.audioContext.createMediaStreamDestination(),this.outputStream=this.destinationNode.stream;{const{sourceNode:F,inputGainNode:A,enhanceGainNode:D,bgsGainNode:i,bgmGainNode:T,analyserNode:C,outputGainNode:U,destinationNode:j}=this;F.connect(A),A.connect(D),D.connect(C),i.connect(C),T.connect(C),D.connect(j),i.connect(j),T.connect(j),C.connect(U),U.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}};class RoomMedias extends RoomBase{#e=[];#n=new Map;#t=new Map;#r=new Map;#o=new Map;#i=new Map;localStreamsActionMap=new Map;#a=new Map;audioContext=new(window.AudioContext||window.webkitAudioContext);constructor(M){super(M),this.#u(),this.#c(),this.#s(),document.addEventListener("click",()=>{this.audioContext?.state==="suspended"&&this.audioContext.resume()})}initMediaPhoneyStreams=(M=[])=>this.initPhoneyStreams(this.audioContext,M);initLocalStreamsFilter=()=>{for(const M of mediaType_keys){const B=async F=>F;this.#a.set(M,B)}};setLocalFilterStream=(M,B)=>{this.#a.set(M,B)};#s=()=>{this.#t.set("microphoneCamera_audio",{sampleRate:48e3,channelCount:2,autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),this.#t.set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),this.#t.set("screenSharing_video",{frameRate:{min:10,ideal:30}}),this.#t.set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})};#c=()=>{this.#n.set("audioinput",void 0),this.#n.set("videoinput",void 0),this.#n.set("audiooutput",void 0)};emitNotifyUpdateUsersStreams=async M=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:M,desc:"users streams is change."})};initUserMediaStreamContext=async(M,B,F,A)=>{const[D]=F.getTracks();if(F.active===!1||!D)return;A&&this.removeUserMediaStreamContext(M,B);const i=this.getUserMediaKey(M,B),{kind:T}=D;switch(T){case"audio":{const C=new MediaStream;C.addTrack(D);const U=new g$1(C,this.audioContext);this.#r.set(i,U)}break;case"video":{const C=new VideoMediaContext(D);this.#o.set(i,C)}break}};getUserMediaStreamContext=(M,B)=>{const F=this.getUserMediaKey(M,B);if(["microphoneCamera_audio","screenSharing_audio"].includes(B))return this.#r.get(F);if(["microphoneCamera_video","screenSharing_video"].includes(B))return this.#o.get(F)};getUserAudioMediaStreamContext=(M,B)=>{const F=this.getUserMediaKey(M,B);return this.#r.get(F)};removeUserMediaStreamContext=(M,B)=>{const F=this.getUserMediaKey(M,B);if(["microphoneCamera_audio","screenSharing_audio"].includes(B))return this.#r.get(F)?.stop(),this.#r.delete(F);if(["microphoneCamera_video","screenSharing_video"].includes(B))return this.#o.get(F)?.stop(),this.#o.get(F)};getUserStream=(M,B)=>this.getUserMediaStreamContext(M,B)?.getStream()||new MediaStream;getUserStreams=(M,B=[])=>{B.length===0&&(B=mediaType_keys);const F={};for(const A of B){const D=this.getUserStream(M,A);F[A]=D}return F};removeUserStreams=async(M,B=[])=>{B.length===0&&(B=mediaType_keys);for(const F of B)this.removeUserMediaStreamContext(M,F)};clearUserStreams=()=>{{const M=this.#r.values();for(const B of M)B.stop();this.#r=new Map}{const M=this.#o.values();for(const B of M)B.stop();this.#o=new Map}};setMediaTrackConstraints=async(M,B)=>{this.#t.set(M,B);const F=await this.getLocalStream(M);if(!F)return;const A=F.getTracks();if(A.length!==0)for(const D of A){const i=D.getConstraints(),C={...this.#t.get(M),...i,...B};await D.applyConstraints(C)}};checkLocalStream=async(M=[])=>{M.length===0&&(M=mediaType_keys);let B=[],F=[];for(const A of M)await this.getLocalStream(A)?F.push(A):B.push(A);return{valid_mediaTypes:F,invalid_mediaTypes:B}};stopLocalStreams=async(M=[])=>{M.length===0&&(M=mediaType_keys);for(const B of M){const F=this.#i.get(B);F&&await this.stopStream(F),this.#i.delete(B)}};addLocalStream=(M,B)=>{const F=this.#i.get(M);F&&this.stopStream(F),this.#i.set(M,B)};initLocalStream=async M=>{switch(M){case"microphoneCamera_audio":{const B=this.#n.get("audioinput"),F=this.#t.get("microphoneCamera_audio"),A=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:B},...F},video:!1});this.addLocalStream("microphoneCamera_audio",A)}break;case"microphoneCamera_video":{const B=this.#n.get("videoinput"),F=this.#t.get("microphoneCamera_video"),A=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:{exact:B},...F}});this.addLocalStream("microphoneCamera_video",A)}break;case"microphoneCamera":{const B=this.#n.get("audioinput"),F=this.#n.get("videoinput"),A=this.#t.get("microphoneCamera_audio"),D=this.#t.get("microphoneCamera_video"),T=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:B},...A},video:{deviceId:{exact:F},...D}})).getTracks();for(const C of T){const{kind:U}=C;if(U==="audio"){const j=new MediaStream;j.addTrack(C),this.addLocalStream("microphoneCamera_audio",j)}if(U==="video"){const j=new MediaStream;j.addTrack(C),this.addLocalStream("microphoneCamera_video",j)}}}break;case"screenSharing_audio":{const B=this.#t.get("screenSharing_audio"),A=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...B})).getTracks();for(const D of A){const{kind:i}=D;if(i==="audio"){const T=new MediaStream;T.addTrack(D),this.addLocalStream("screenSharing_audio",T)}}}break;case"screenSharing_video":{const B=this.#t.get(M),A=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...B})).getTracks();for(const D of A){const{kind:i}=D;if(i==="video"){const T=new MediaStream;T.addTrack(D),this.addLocalStream("screenSharing_video",T)}}}break;case"screenSharing":{const B=this.#t.get("screenSharing_audio"),F=this.#t.get("screenSharing_video"),D=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...B,...F})).getTracks();for(const i of D){const{kind:T}=i;if(T==="audio"){const C=new MediaStream;C.addTrack(i),this.addLocalStream("screenSharing_audio",C)}if(T==="video"){const C=new MediaStream;C.addTrack(i),this.addLocalStream("screenSharing_video",C)}}}break}};getLocalStream=async M=>{const B=this.#i.get(M),F=this.#a.get(M);let A=B;return B&&F&&(A=await F(B)),A};getLocalStreams=async(M=[])=>{M.length===0&&(M=mediaType_keys);const B={};for(const F of M)B[F]=await this.getLocalStream(F);return B};#l=async()=>!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices?(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 不支持 enumerateDevices"),[]):(await navigator.mediaDevices.enumerateDevices().then(M=>{const B=M.filter(F=>!["communications"].includes(F.deviceId));this.#e=B.sort((F,A)=>F.label.localeCompare(A.label,"zh-Hans-CN",{sensitivity:"accent"}))}).catch(function(M){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",M)}),this.#e);#u=()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await this.#l(),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),this.#l()};getMediaDeviceKind=M=>this.#n.get(M);changeAudiooutput=async()=>{try{const M=this.#n.get("audiooutput");await this.audioContext.setSinkId(M||"default")}catch(M){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",M)}};setDeviceKind=(M,B)=>{this.#n.set(M,B)};setAudioOutputDevice=M=>this.setDeviceKind("audiooutput",M);getEnumerateDevices=async M=>(await this.#l(),this.#e.filter(F=>F.kind===M));getEnumerateAudioinputDevices=()=>this.getEnumerateDevices("audioinput");getEnumerateAudioOutputDevices=()=>this.getEnumerateDevices("audiooutput");getEnumerateVideoinputDevices=()=>this.getEnumerateDevices("videoinput")}const getNetworkQuality=(N,M,B)=>{const F=Number(N),A=Number(M),D=Number(B);let i=0;return F<.03&&A<100&&D<.05?i=5:F<.06&&A<160&&D<.1?i=4:F<.1&&A<250&&D<.15?i=3:F<.15&&A<400&&D<.2?i=2:i=1,Number(i)};class PeerAnalyzeStats{pc;network={inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0",quality:0,averageQuality:0,velocityPull:0,velocityPush:0};reports=[];averageQualitys=[];timer=0;constructor(){}onNetwork=M=>{};getNetwork=()=>this.network;getAverageQuality=()=>this.network.averageQuality;start=M=>{this.stop(),this.network={inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0",quality:0,averageQuality:0,velocityPull:0,velocityPush:0},this.reports=[],this.averageQualitys=[],this.pc=M,clearInterval(this.timer),this.timer=window.setInterval(this.analyzeStats,1*1e3)};analyzeStats=async()=>{try{if(!this.pc)return;if(["failed","closed"].includes(this.pc?.connectionState))return this.network.averageQuality=0,this.network.quality=0,this.network.velocityPull=0,this.network.velocityPush=0,this.averageQualitys=[],this.onNetwork(this.network);const M=await this.pc.getStats(),B=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport","codec"],A=[...M.values()].filter(ue=>B.includes(ue.type));let D=0,i=0,T=0,C=0,U=0,j=0,z=[],K=[];for(const ue of this.reports){const{packetsSent:fe,packetsLost:ye}=ue;fe&&(T+=fe),ye&&(C+=ye)}this.reports=A;for(const ue of this.reports){const{bytesSent:fe,bytesReceived:ye,packetsSent:re,packetsLost:de,roundTripTime:be,jitter:_e}=ue;fe&&(i=fe),ye&&(D=ye),re&&(U+=re),de&&(j+=de),be&&z.push((be*100).toFixed(2)),_e&&K.push(_e.toFixed(2))}K.sort().reverse(),z.sort().reverse();const Y=U-T,te=j-C,ae=Y===0?"0.00":Math.max(0,te/Y).toFixed(2),[se="0"]=z,[oe="0"]=K,he=getNetworkQuality(ae,se,oe);let ke,ie,ce;this.averageQualitys.unshift(he),this.averageQualitys=this.averageQualitys.slice(0,10),ke=this.averageQualitys.length===10?Math.round(this.averageQualitys.reduce((fe,ye)=>fe+ye)/this.averageQualitys.length):0,ie=Math.max(0,D-this.network.inboundBytes),ce=Math.max(0,i-this.network.outboundBytes);const pe={outboundBytes:i,inboundBytes:D,lostRate:ae,roundTripTime:se,jitter:oe,quality:he,averageQuality:ke,velocityPull:ie,velocityPush:ce};this.network=pe,this.onNetwork(this.network)}catch(M){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: analyzeStats is err.",M)}};getReports=async(M=[])=>{let B=[...this.reports];return M.length!==0&&(B=B.filter(F=>M.includes(F.mid))),B};stop=()=>{clearInterval(this.timer)}}class P2P{pr_resolves=new PrResolves;roomId;userId;remoteUserId;phoney_streams_map=new Map;peer_ins;timer;local_channel;remote_channel;icecandidates=[];candidate_collected=!1;analyze_stats_ins=new PeerAnalyzeStats;send_transceiver_map=new Map;recv_transceiver_map=new Map;tracks=[];onClose=()=>{};constructor(M,B,F,A){this.roomId=M,this.userId=B,this.remoteUserId=F,this.phoney_streams_map=A}remoteChannelSend=M=>{if(this.remote_channel?.readyState!=="open")return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: remote_channel is error.",{remote_channel:this.remote_channel});const B=sendMessageFormat(M),F=new Uint8Array(obj2pb(B));this.remote_channel?.send(F)};#e=async M=>{const B=new Uint8Array(M),F=pb2obj(B),A=onMessageFormat(F),{event:D,data:i}=A;switch(D){case"UpdateTrackActive":{const{tracks:T=[]}=i;for(const C of T){const{type:U,isActive:j=!1}=C,z=mediaType_keys[U];await this.pauseSends([z],!j)}}break}};#n=M=>{M.candidate?this.icecandidates.push(M.candidate):(this.candidate_collected=!0,this.pr_resolves.emit("candidateCollected"))};#t=async M=>{const B=M.target.connectionState;switch(B){case"connected":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: p2p.peer_ins: ${B}`),this.pr_resolves.emit("iceConnected");break;case"disconnect":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: p2p.peer_ins: ${B}`),this.timer=setTimeout(()=>this.close(),20*1e3);break;case"failed":case"closed":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: p2p.peer_ins: ${B}`),this.close();break;default:console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: p2p.peer_ins: ${B}`);break}};init=async()=>{this.peer_ins?.connectionState!=="connected"&&(this.destroy(),this.peer_ins=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}]}),this.peer_ins.addTransceiver("audio",{direction:"inactive"}),this.local_channel=this.peer_ins.createDataChannel("p2p_pause_action",{}),this.local_channel.onmessage=M=>this.#e(M.data),this.peer_ins.ondatachannel=M=>{this.remote_channel=M.channel,this.pr_resolves.emit("remoteChannelConnected")},this.peer_ins.addEventListener("icecandidate",this.#n),this.peer_ins.addEventListener("connectionstatechange",this.#t),this.analyze_stats_ins?.start(this.peer_ins))};initSenders=async(M=[],B="sendrecv")=>{const F=this.checkPeer(),A=[],D=F?.getTransceivers()||[];for(const i of mediaType_keys){const T=this.send_transceiver_map.get(i);if(!T)continue;D.find(U=>U.direction!=="stopped"&&U.mid===T?.mid)||this.send_transceiver_map.delete(i)}for(const i of M){const{mid:T,mediaType:C}=i;let U=D?.find(j=>j.mid===T);if(U){if(!U.sender.track){const j=this.getPhoneyStreams(C),[z]=j.getTracks();U.sender.replaceTrack(z)}U.direction=B,this.send_transceiver_map.set(C,U),A.push(C),B=="sendrecv"&&!this.recv_transceiver_map.has(C)&&(U.receiver.track.enabled=!1,this.recv_transceiver_map.set(C,U))}}return A};initRecvs=async(M=[],B="sendrecv")=>{const F=this.checkPeer(),A=[],D=F?.getTransceivers()||[];for(const i of mediaType_keys){const T=this.recv_transceiver_map.get(i);if(!T)continue;D.find(U=>U.direction!=="stopped"&&U.mid===T?.mid)||this.recv_transceiver_map.delete(i)}for(const i of M){if(this.recv_transceiver_map.get(i))continue;const C=this.getPhoneyStreams(i),[U]=C.getTracks(),j=F.addTransceiver(U,{direction:B});j.direction=B,this.recv_transceiver_map.set(i,j),A.push(i)}return A};hasRecv=async M=>this.recv_transceiver_map.has(M);checkActive=()=>{if(!this.peer_ins||this.peer_ins.connectionState!=="connected")return!1;let M=!1;for(const B of mediaType_keys){const F=this.send_transceiver_map.get(B);if(!F)continue;const{sender:A}=F;if(A.track&&A.track.enabled!==!1){M=!0;break}}for(const B of mediaType_keys){const F=this.recv_transceiver_map.get(B);if(!F)continue;const{receiver:A}=F;if(A.track&&A.track.enabled!==!1){M=!0;break}}return M};pauseSends=async(M=[],B)=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: pauseSends: ${B}`,M);const F=[];for(const A of M){const D=this.send_transceiver_map.get(A);if(!D)continue;const{sender:i}=D;i.track&&(i.track.enabled=!B)}return F};pauseRecvs=async(M=[],B)=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: pauseRecvs: ${B}`,M);const F=[];for(const D of M){const i=this.recv_transceiver_map.get(D);if(!i)continue;const{receiver:T}=i;T.track&&(T.track.enabled=!B,F.push(D))}const A=await this.getRecvTracks(F);return this.remoteChannelSend({event:"UpdateTrackActive",data:{roomId:this.roomId,tracks:A}}),F};createOffer=async()=>{const M=this.checkPeer(),B=await M.createOffer();return await M.setLocalDescription(B),B};setOffer=async M=>{await this.checkPeer().setRemoteDescription(M),await this.pr_resolves.emit("setOffered")};createAnswer=async()=>{const M=this.checkPeer(),B=await M.createAnswer();return await M.setLocalDescription(B),B};setAnswer=async M=>{await this.checkPeer().setRemoteDescription(M)};getIcecandidates=async()=>(await this.candidateCollected(),this.icecandidates);addCandidates=async M=>{const B=this.checkPeer();await this.setOffered();for(const F of M)await B.addIceCandidate(F)};getSenderTracks=async(M=[])=>{const B=[];for(const F of M){const A=this.send_transceiver_map.get(F);if(!A)continue;const{mid:D,sender:i}=A,{track:T}=i;if(!T)continue;const{id:C,enabled:U}=T,j=mediaType_keys.findIndex(Y=>Y===F),z=Mt(),K={type:j,enabled:U,trackName:`web-${j}-${C}`,location:"local",mid:D,key:z,origin:"p2p",mediaType:F};B.push(K)}return B};getRecvTracks=async(M=[])=>{const B=[];for(const F of M){const A=this.recv_transceiver_map.get(F);if(!A)continue;const{mid:D,receiver:i}=A,{track:T}=i;if(!T)continue;const{id:C,enabled:U}=T,j=mediaType_keys.findIndex(Y=>Y===F),z=Mt(),K={type:j,enabled:U,trackName:`web-${j}-${C}`,location:"local",mid:D,key:z,isActive:U};B.push(K)}return B};isActive=M=>!this.peer_ins||this.peer_ins.connectionState!=="connected"?!1:this.recv_transceiver_map.get(M)?.receiver?.track.enabled||!1;getTrack=M=>this.recv_transceiver_map.get(M)?.receiver?.track;getPhoneyStreams=M=>this.phoney_streams_map.get(M);candidateCollected=()=>this.pr_resolves.add("candidateCollected",()=>this.candidate_collected);remoteChannelConnected=()=>this.pr_resolves.add("remoteChannelConnected",()=>this.remote_channel?.readyState==="open");iceConnected=()=>this.pr_resolves.add("iceConnected",()=>this.peer_ins?.connectionState==="connected");setOffered=()=>this.pr_resolves.add("setOffered",()=>this.peer_ins?.remoteDescription);checkPeer=()=>{if(!this.peer_ins)throw new Error("you need init peer.");return this.peer_ins};close=()=>{clearTimeout(this.timer);{const M=[...this.send_transceiver_map.values()];for(const B of M)B.currentDirection!=="stopped"&&B.stop();this.send_transceiver_map=new Map}{const M=[...this.recv_transceiver_map.values()];for(const B of M)B.currentDirection!=="stopped"&&B.stop();this.recv_transceiver_map=new Map}this.peer_ins?.removeEventListener("icecandidate",this.#n),this.peer_ins?.removeEventListener("connectionstatechange",this.#t),this.peer_ins?.close(),this.onClose()};destroy=async()=>{this.analyze_stats_ins.stop(),this.analyze_stats_ins.onNetwork=()=>{},this.close(),this.icecandidates=[],this.candidate_collected=!1,this.local_channel=void 0,this.remote_channel=void 0,this.peer_ins=void 0}}class RoomUsers extends RoomMedias{constructor(M){super(M)}getP2PIns=async M=>this.p2pMap.get(M);getMaxVolumeUser=()=>{const M=Array.from(this.userMap.values(),({id:F})=>F);if(M.length===0)return;let B=[];for(const F of M){const A=this.getUserAudioMediaStreamContext(F,"microphoneCamera_audio");if(!A)continue;const D=A.getVolume();B.push({id:F,volume:D})}return B=B.sort((F,A)=>F.volume-A.volume>0?-1:1),B[0]};setVolume=(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.setInputGain(F)};setEnhanceGain=async(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.setEnhanceGain(F)};setSpeaker=(M,B,F)=>{const A=this.getUserAudioMediaStreamContext(M,B);A?.setOutputGain(F);const D=F===0;try{A?.setMute(D)}catch{}};playBgs=(M,B,F)=>this.getUserAudioMediaStreamContext(M,B)?.mixAudio(F,"bgs");setBgsGain=(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.setBgsGain(F)};stopBgs=(M,B)=>{this.getUserAudioMediaStreamContext(M,B)?.mixAudioStop("bgs")};playBgm=(M,B,F)=>this.getUserAudioMediaStreamContext(M,B)?.mixAudio(F,"bgm");setBgmGain=(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.setBgmGain(F)};stopBgm=(M,B)=>{this.getUserAudioMediaStreamContext(M,B)?.mixAudioStop("bgm")};changBgsMix=(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.changeMix("bgs",F)};changBgmMix=(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.changeMix("bgm",F)};getVolume=(M,B)=>this.getUserAudioMediaStreamContext(M,B)?.getVolume();clearUsers=()=>{this.userMap=new Map};removeUsers=async M=>{for(const B of M)this.userMap.delete(B),this.p2pMap.delete(B),await this.removeUserStreams(B)};createUser=async M=>{const B=Date.now(),F=this.getOptions(),A={id:M,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},banBehavior:0,banBehaviorStr:"",banBehaviorMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isOwner:this.userMap.size===0,isSelf:M===F.userId,isPublished:!1,useP2P:!1,joinTime:B,updateAt:B,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};if(this.userMap.set(M,A),A.isSelf===!1&&!this.p2pMap.has(M)){const D=new P2P(this.options.roomId,this.options.userId,M,this.phoneyStreams);this.p2pMap.set(M,D)}};getUser=async M=>(this.userMap.has(M)||await this.createUser(M),this.userMap.get(M));getUsers=async(M=[])=>{M.length===0&&(M=[...this.userMap.keys()]);const B=[];for(const F of M){const A=await this.getUser(F);B.push(A)}return B};getAllUserTrackMids=async()=>{const M=await this.getUsers(),B=[];for(const F of M){const{tracks:A=[]}=F;for(const D of A)B.push(D.mid)}return B};getUserTrackByTrackName=async M=>{const B=await this.getUsers(),F=[];for(const A of B){const{tracks:D=[]}=A;for(const i of D){const{trackName:T}=i;M.includes(T)&&F.push(i)}}return F};getUserTrackByMid=async M=>{const B=await this.getUsers();let F;for(const A of B){const{tracks:D=[]}=A;for(const i of D)if(i.mid===M){F=i;break}}return F};getUsersMediaTypeBytrackNames=async M=>{if(M.length===0)return[];const B=[],F=await this.getUsers();for(const A of F){const{id:D,tracks:i=[]}=A,T=[];for(const U of i){const{trackName:j,mediaType:z}=U;!M.includes(j)||!z||T.push(z)}if(T.length===0)continue;const C={userId:D,mediaTypes:T};B.push(C)}return B};checkSubscribed=async(M,B)=>{const F=await this.getUser(M),{tracks:A=[]}=F,D=[],i=[];for(const T of B)A.find(U=>U.mediaType===T&&(U.msid||U.origin==="p2p"))?D.push(T):i.push(T);return{subscribed_mediaTypes:D,prohibited_mediaTypes:i}};createUserTrackByUserMediaTypes=async(M=[],B={})=>{const F=[],A=await this.getUsers();for(const D of A){const{id:i,tracks:T=[]}=D;let C=[];const U=M.find(j=>j.userId===i);if(U){for(const j of T){if(!U.mediaTypes.includes(j.mediaType))continue;const z={...j,...B};C.push(z)}C.length!==0&&F.push({id:i,tracks:C})}}return F};getUserStreamOrigin=async(M,B)=>{const F=await this.getUser(M),{tracks:A=[]}=F;return A.find(D=>D.mediaType===B)?.origin||"unknown"};getAllUserMediaTypes=async()=>{const M=[],B=await this.getUsers();for(const F of B){const{id:A,tracks:D=[],isSelf:i}=F;if(i)continue;const T=Array.from(D,C=>C.mediaType);M.push({userId:A,mediaTypes:T})}return M};checkUserInRoom=M=>this.userMap.has(M);getUsersId=async()=>[...this.userMap.keys()];getSelfInfo=async()=>await this.getUser(this.options.userId);updateIsPublished=async(M,B=!1)=>{const F=await this.getUser(M);F.isPublished=B};setUserUpdateStreams=async(M,B,F=!0)=>{const A=await this.getUser(M),D={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};D[B]=F,A.updateStreams=D};updateUsertracks=async(M,B=[],F)=>{const A=await this.getUser(M);F&&(B=[...A.tracks,...B]),B=B.filter(({mid:T=""})=>T!==""),B=ft(B,["type"]),B=B.sort((T,C)=>T.type-C.type<0?-1:1);for(const T of B)T.userId=M,T.mediaType=mediaType_keys[T.type],T.enabled===void 0&&(T.enabled=!0),T.origin===void 0&&(T.origin="sfu");A.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const D=dt(A.tracks,["mediaType","enabled","mid","msid","trackName","key"]),i=dt(B,["mediaType","enabled","mid","msid","trackName","key"]);for(const T of mediaType_keys){const C=i.find(z=>z.mediaType===T),U=D.find(z=>z.mediaType===T),j=JSON.stringify(C)!==JSON.stringify(U);A.updateStreams[T]=j}A.tracks=B};updateUserCallAction=async(M,B=0)=>{const F=await this.getUser(M);F.callAction=B,F.callActionStr=B.toString(2).padStart(4,"0"),F.callActionMap=this.getCallActionMap(B)};updateUserBehaviors=async(M,B=0)=>{const F=await this.getUser(M);F.banBehavior=B,F.banBehaviorStr=B.toString(2).padStart(4,"0"),F.banBehaviorMap=this.getBanBehaviorMap(B)};updateUserNetwork=async(M,B={egress:5,ingress:5})=>{const F=await this.getUser(M);F.network=B};updateUserPermissions=async(M,B)=>{if(B){const F=await this.getUser(M);F.permissions=B}};updateUserUseP2P=async(M,B)=>{const F=await this.getUser(M);F.useP2P=B};updateUserBase=async M=>{const B=this.getOptions(),F=await this.getUser(M);F.isSelf=M===B.userId,F.updateAt=Date.now()};updateUsers=async M=>{for(const B of M){const{id:F,tracks:A,callAction:D,permissions:i,isPublished:T,useP2P:C}=B;await this.updateUserBase(F),await this.updateIsPublished(F,T),await this.updateUserPermissions(F,i),await this.updateUsertracks(F,A,!0),await this.updateUserCallAction(F,D),await this.updateUserNetwork(F),await this.updateUserUseP2P(F,C)}};emitNotifyUpdateUser=async M=>{const B=await this.getUsers([M]),[F]=this.usersFilter(B);this.cwsIns.emitNotify("onRoomUser",{code:200,data:F,desc:"user info is change."})};emitNotifyUpdateUsers=async()=>{const M=await this.getUsers(),B=this.usersFilter(M);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:B,desc:"all users info is change."})}}class RoomPeer extends RoomUsers{#e=0;peerAnalyzeStatsIns=new PeerAnalyzeStats;simulcast="f";offset_inboundBytes=0;offset_outboundBytes=0;constructor(M){super(M),this.initPeer(),this.peerAnalyzeStatsIns.onNetwork=this.#r}saveBoundBytes=M=>{const B=this.peerAnalyzeStatsIns?.getNetwork();B&&(M==="superfluous"&&(this.offset_inboundBytes=-B.inboundBytes,this.offset_outboundBytes=-B.outboundBytes),M==="missing"&&(this.offset_inboundBytes=this.offset_inboundBytes+B.inboundBytes,this.offset_outboundBytes=this.offset_outboundBytes+B.outboundBytes))};getTrafficUse=()=>{const{sfuPush:M,sfuPull:B,p2pPush:F,p2pPull:A}=this;return{sfuPush:M,sfuPull:B,p2pPush:F,p2pPull:A}};initPeer=()=>{clearTimeout(this.#e),this.saveBoundBytes("missing"),this.transceiverMap=new Map,this.peerIns?.close(),this.peerIns=void 0,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.#n(),this.initMediaPhoneyStreams(),this.startGetPeerStats()};replaceSenderStream=async(M=[],B)=>{const F=this.getOptions(),{userId:A}=F;M.length===0&&(M=mediaType_keys);for(const D of M){const i=this.transceiverMap.get(D);let T;if(i){const{sender:C}=i;B?T=this.getUserStream(A,D):T=this.getPhoneyStreams(D);const[U]=T.getTracks();await C.replaceTrack(U)}}};getSenderTracks=async(M=[])=>{const B=[];for(const F of M){const A=this.transceiverTrackMap.get(F);A&&B.push(A)}return B};setCodecPreferences=M=>{if(!["microphoneCamera_video"].includes(M))return;const B=(C,U)=>C.sort((j,z)=>{const K=U.indexOf(j.mimeType),Y=U.indexOf(z.mimeType),te=K>=0?K:Number.MAX_VALUE,ae=Y>=0?Y:Number.MAX_VALUE;return te-ae}),F=RTCRtpReceiver.getCapabilities("video")?.codecs||[],i=[B(F,["video/H264","video/VP8","video/VP9"])[0]],T=this.transceiverMap.get(M);T&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: sortedCodecs",i),T?.setCodecPreferences(i))};addSenders=async(M=[])=>{const B={direction:"sendonly"};M.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const F=[];for(const A of M){if(this.transceiverMap.get(A))continue;const i=this.getPhoneyStreams(A),[T]=i.getTracks(),C=this.peerIns.addTransceiver(T,B);this.transceiverMap.set(A,C),F.push(A)}if(M.length===0||F.length!==0){const A=await this.peerIns.createOffer();if(this.options.debug){const D=libExports$1.parse(A.sdp),i=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:i,sdpJson:D,description:A})}await this.peerIns.setLocalDescription(A);for(const D of M){const i=this.transceiverMap.get(D);if(!i)continue;const{mid:T,sender:C}=i,{track:U}=C;if(!U)continue;const{enabled:j}=U,z=mediaType_keys.findIndex(te=>te===D),K=`WEB-${z}-${Mt()}`,Y={type:z,mediaType:D,enabled:j,trackName:K,location:"local",mid:T,key:"",origin:"unknown"};this.transceiverTrackMap.set(D,Y)}}return F};removeSenders=async(M=[])=>{M.length===0&&(M=mediaType_keys);for(const B of M)this.transceiverMap.has(B)&&(this.transceiverMap.delete(B),this.transceiverTrackMap.delete(B))};stopSenders=(M=[])=>{M.length===0&&(M=mediaType_keys);for(const B of M){if(!this.transceiverMap.has(B))continue;const F=this.transceiverMap.get(B);F?.sender.track?.stop(),F?.stop()}};#n=()=>{const M=()=>{clearTimeout(this.#e),this.setIceState("failed")};this.peerIns.onconnectionstatechange=async B=>{const F=B.target.connectionState;switch(F){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${F}`),clearTimeout(this.#e),this.setIceState("connected"),this.prResolves.emit("iceConnected");break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${F}`),this.setIceState("disconnected"),this.#e=window.setTimeout(M,15*1e3);break;case"failed":{if(this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${F}`),this.iceState==="closed")return;this.setIceState("failed")}break;case"closed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${F}`),clearTimeout(this.#e),this.setIceState("closed");break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${F}`);break}}};iceConnected=()=>{const M=()=>this.peerIns.iceConnectionState==="connected";return this.prResolves.add("iceConnected",M)};stopTransceivers=async M=>{const B=this.peerIns.getTransceivers();for(const F of B){const{mid:A}=F;A&&M.includes(A)&&(F.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver: ${A} is stop.`,F))}};createOffer=async()=>{const M=await this.peerIns.createOffer();if(this.options.debug){const B=libExports$1.parse(M.sdp),F=dt(B.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:F,sdpJson:B,description:M})}await this.peerIns.setLocalDescription(M)};createAnswer=async()=>{const M=await this.peerIns.createAnswer();if(this.options.debug){const B=libExports$1.parse(M.sdp),F=dt(B.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:F,sdpJson:B,description:M})}await this.peerIns.setLocalDescription(M)};getSdp=()=>this.peerIns.localDescription?.sdp;setRemoteDescription=async M=>{if(this.options.debug){const B=libExports$1.parse(M.sdp),F=dt(B.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:F,sdpJson:B,description:M})}return await this.peerIns.setRemoteDescription(M),M};setCallStrategy=async(M,B=[])=>{B.length===0&&(B=mediaType_keys);let F="balanced";switch(M){case"qualityPriority":F="maintain-resolution";break;case"fluencyPriority":F="maintain-framerate";break;case"balancedDowngrade":F="balanced";break}const A=await this.getSelfInfo(),D=Array.from(A.tracks,({trackName:T})=>T),i=this.peerIns.getSenders();for(const T of i){const{track:C}=T;if(!C||!D.includes(C.id))continue;const U=T.getParameters();T.setParameters({...U,degradationPreference:F})}};setRTCRtpSenderParameters=M=>{try{const B=this.peerIns.getSenders();for(const F of B){const A=F.getParameters();console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: _parameters",A),F.setParameters({...A,...M})}}catch(B){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",B)}};setSimulcast=M=>{this.simulcast=M};getPeerNetwork=()=>{const M=this.peerAnalyzeStatsIns?.getNetwork();return JSON.parse(JSON.stringify(M))};getRoomNetwork=()=>{const M=this.peerAnalyzeStatsIns?.getNetwork(),B=JSON.parse(JSON.stringify(M));B.inboundBytes=Math.max(0,B.inboundBytes+this.offset_inboundBytes),B.outboundBytes=Math.max(0,B.outboundBytes+this.offset_outboundBytes);const F=[...this.p2pMap.keys()],A={averageQuality:0,inboundBytes:0,jitter:0,lostRate:0,outboundBytes:0,quality:0,roundTripTime:0,velocityPull:0,velocityPush:0};if(F.length!==0){const D=[];for(const i of F){const T=this.p2pMap.get(i)?.analyze_stats_ins.getNetwork();D.push(T)}A.averageQuality=Math.round(Array.from(D,i=>i?.averageQuality).reduce((i,T)=>i+T,0)/D.length*100)/100,A.inboundBytes=Array.from(D,i=>i?.inboundBytes).reduce((i,T)=>i+T,0),A.jitter=Array.from(D,i=>i?.jitter).reduce((i,T)=>i+T,0)/D.length,A.lostRate=Array.from(D,i=>i?.lostRate).reduce((i,T)=>i+T,0)/D.length,A.outboundBytes=Array.from(D,i=>i?.outboundBytes).reduce((i,T)=>i+T,0),A.quality=Math.round(Array.from(D,i=>i?.quality).reduce((i,T)=>i+T,0)/D.length*100)/100,A.roundTripTime=Array.from(D,i=>i?.roundTripTime).reduce((i,T)=>i+T,0)/D.length,A.velocityPull=Array.from(D,i=>i?.velocityPull).reduce((i,T)=>i+T,0)/D.length,A.velocityPush=Array.from(D,i=>i?.velocityPush).reduce((i,T)=>i+T,0)/D.length}return{sfu:B,p2p:A}};#t=()=>{const M=this.getRoomNetwork();{const{outboundBytes:B,inboundBytes:F}=M.sfu;this.sfuPush=Math.ceil(B/1024),this.sfuPull=Math.ceil(F/1024)}this.cwsIns.emitNotify("onRoomNetwork",{code:200,data:M,desc:"room network is change."})};#r=async M=>{try{if(this.roomState!=="connected")return;const{quality:B}=M;B>=2&&this.prResolves.emit("senderActived"),this.#t();const F=await this.getSelfInfo(),{network:A}=F,D={egress:B,ingress:B};At("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,D),JSON.stringify(A)!==JSON.stringify(D)){this.emitNotifyUpdateUsers();const C=this.getOptions(),{userId:U,roomId:j}=C,z={...D,userId:U,roomId:j};this.cwsIns.sendMessage({event:"networkQualityChange",data:z},!1)}},3*1e3)}catch(B){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",B)}};getReportsByMid=async(M=[])=>await this.peerAnalyzeStatsIns?.getReports(M);startGetPeerStats=()=>{this.peerAnalyzeStatsIns.start(this.peerIns);const M=[...this.p2pMap.values()];for(const B of M)B.peer_ins&&B.analyze_stats_ins.start(B.peer_ins)};stopGetPeerStats=()=>{this.peerAnalyzeStatsIns.stop();const M=[...this.p2pMap.values()];for(const B of M)B.analyze_stats_ins.stop()}}const g=(N,M)=>{if(!(N!=null&&N.ip)||!(N!=null&&N.port)||!(N!=null&&N.serve_ip)||!(N!=null&&N.serve_port)||!(M!=null&&M.ip)||!(M!=null&&M.port)||!(M!=null&&M.serve_ip)||!(M!=null&&M.serve_port))return"Unknown";const[B,F]=[N.ip,N.port],[A,D]=[N.serve_ip,N.serve_port],[i,T]=[M.ip,M.port],[C,U]=[M.serve_ip,M.serve_port];return B===i&&F===T?"Full Cone":B===A&&(i!==A||T!==F)||i===C&&(B!==C||F!==T)?"Restricted Cone":B===A&&F===D&&(i!==A||T!==D)||i===C&&T===U&&(B!==C||F!==U)?"Port Restricted Cone":"Symmetric"},h=async()=>{const N="stun.cloudflare.com:3478",M="stun.l.google.com:19302",B=async F=>new Promise(A=>{const D=new RTCPeerConnection({iceServers:[{urls:`stun:${F}`}]});D.createDataChannel("ice-channel");let i=null;D.onicecandidate=T=>{var C,U;if(((C=T.candidate)==null?void 0:C.type)==="srflx"){const[j,z]=F.split(":").map(K=>K.trim());i={ip:T.candidate.address||"",port:(U=T.candidate.port)==null?void 0:U.toString(),serve_ip:j,serve_port:z},D.close(),A(i)}},setTimeout(()=>{D.close(),A(null)},5e3),D.createOffer().then(T=>D.setLocalDescription(T)).catch(()=>A(null))});try{const F=await B(N),A=await B(M);if(!F||!A)return{address:"",natType:"Unknown"};const D=g(F,A);return{address:F.ip||"",natType:D}}catch(F){return console.error("获取NAT类型失败:",F),{address:"",natType:"Unknown"}}};class RoomCalls extends RoomPeer{#e=0;#n;constructor(M){super(M),this.#f(),window.addEventListener("online",()=>this.p2p.reportNetwork())}setLocalStream=(M,B)=>new Promise(async(F,A)=>{try{const D=[];typeof M=="string"?D.push(M):D.push(...M);for(const T of D)this.localStreamsActionMap.set(T,B);if(B){if(M.includes("microphoneCamera_audio")&&M.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):M.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):M.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):M.includes("screenSharing_audio")&&M.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):M.includes("screenSharing_audio")&&!M.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):M.includes("screenSharing_video")&&!M.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),M.includes("screenSharing_audio")){const T=await this.getLocalStream("screenSharing_audio");if(T){const C=T.getTracks();for(const U of C)U.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(M.includes("screenSharing_video")){const T=await this.getLocalStream("screenSharing_video");if(T){const C=T.getTracks();for(const U of C)U.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(D);const i=await this.getLocalStreams(D);if(await this.cwsIns.emitNotify("onLocalStream",{code:200,data:i,desc:"local stream is change."}),this.isInRoom){const T=()=>new Promise(async C=>{const U=this.getOptions(),{userId:j}=U,z={};for(const K of D){const Y=await this.getLocalStream(K);Y&&(z[K]=Mt(),await this.initUserMediaStreamContext(j,K,Y,!1))}await this.replaceSenderStream(D,B),await this.emitNotifyUpdateUsersStreams([{userId:j,updateStreams:z}]),C(!0)});this.asyncQueue.add(T,{describe:"setLocalStream"})}F(i)}catch(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",D),A(D)}});setMediaDeviceKind=(M,B)=>{const F=()=>new Promise(async(A,D)=>{this.setDeviceKind(M,B);const i=await this.getSelfInfo(),{id:T,tracks:C=[],callActionMap:U}=i,j=[],z=async K=>{const Y=this.localStreamsActionMap.get(K),te=C.find(se=>se.mediaType===K),ae=U[K];if(Y){j.push(K),await this.stopLocalStreams([K]);try{await this.initLocalStream(K)}catch(se){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",se),D(se)}}if(te){const se=await this.getLocalStream(K);if(se&&(await this.initUserMediaStreamContext(T,K,se,!0),ae)){await this.replaceSenderStream([K],!0);const oe=await this.getUsersId();await this.p2p.replaceSenderStreams(oe,j,!0)}}{if(j.length!==0){const se=await this.getLocalStreams(j);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:se,desc:"local stream is change."});const oe=this.createUserUpdateStreams(j);await this.emitNotifyUpdateUsersStreams([{userId:this.options.userId,updateStreams:oe}]),await this.emitNotifyUpdateUsers()}A(!0)}};M==="audioinput"&&await z("microphoneCamera_audio"),M==="videoinput"&&await z("microphoneCamera_video"),M==="audiooutput"&&(await this.changeAudiooutput(),A(!0))});return this.asyncQueue.add(F,{describe:"publish"})};changeScreenSharing=async M=>{const B=await this.getSelfInfo(),{tracks:F=[],callActionMap:A}=B;try{await this.setLocalStream(M,!0);for(const D of M)F.find(T=>T.mediaType===D&&A[D])&&await this.replaceSenderStream([D],!0)}catch(D){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",D)}};earlyConnect=(M=[])=>new Promise(async(B,F)=>{try{this.isEarly=!0,await this.#a(),await this.createSession(),M.length===0&&(M=["microphoneCamera_audio","microphoneCamera_video"]),await this.#s(M),B(!0)}catch(A){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",A),F(A)}});joinRoom=async M=>(this.setOptions(M),await this.#a(),await this.cwsConnected(),new Promise(async(B,F)=>{const D=`${Date.now()}${Q(1e3,9999)}`;this.#n=async()=>{try{this.isInRoom=!0;const{userId:i,callType:T,sdkToken:C,roomId:U,stt:j=!1,lang:z}=this.getOptions(),{input:K="zh",output:Y="zh"}=z||{};this.clearUsers(),await this.cwsIns.sendMessage({sn:Number(D),event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:T,roomId:U,user:{id:i,tracks:[],callAction:0},token:C,stt:j,lang:{input:K,output:Y}},version:2}).then(async te=>{const{code:ae=0,desc:se="服务器繁忙",data:oe}=te;if(ae!==200)throw new Error(se);const{roomId:he="",roomUsers:ke=[]}=oe;if(he!==U)return F("加入的房间不匹配");this.sfuPush=0,this.sfuPull=0,this.p2pPush=0,this.p2pPull=0,this.saveBoundBytes("superfluous"),this.initHeartbeat(),this.startGetPeerStats(),this.isEarly===!1&&await this.createSession(),await this.updateUsers(ke);for(const ce of ke){const{id:pe}=ce;await this.updateUserBehaviors(pe,ce.behavior)}await this.emitNotifyUpdateUsers();const ie=await this.getUsers();B(ie)})}catch(i){F(i)}},this.#n()}));quitRoom=()=>new Promise(async M=>{const B=this.getOptions(),{roomId:F,userId:A}=B;try{if(this.isInRoom===!1)return M(!0);this.isInRoom=!1;const D=async T=>{clearTimeout(T),this.stopHeartbeat(),this.transceiverMap=new Map,this.peerAnalyzeStatsIns?.stop();const C=()=>this.stopSubscribe(),U=()=>this.cwsIns.sendMessage({event:"quitRoom",data:{roomId:F,user:{id:A}}});Promise.all([C(),U()]).finally(()=>()=>this.cwsIns.clearEvents()),this.asyncQueue.clear(),this.clearUserStreams(),this.clearUsers(),this.stopLocalStreams(),this.setRoomState("ready")},i=window.setTimeout(()=>D(i),2*1e3);try{await this.stopPublish(),D(i)}catch{}M(!0)}catch(D){this.reportLogs("quit_room_error",D.message||D)}});quitRoomEx=()=>new Promise(async M=>{const B=this.getOptions(),{roomId:F,userId:A}=B;try{if(this.isInRoom===!1)return M(!0);this.isInRoom=!1;const D=async T=>{clearTimeout(T),this.initHeartbeat(),this.peerAnalyzeStatsIns?.stop();const C=()=>this.stopSubscribe(),U=()=>this.cwsIns.sendMessage({event:"quitRoomEx",data:{roomId:F,user:{id:A}}});Promise.all([C(),U()]).finally(()=>()=>this.cwsIns.clearEvents()),this.asyncQueue.clear(),this.clearUserStreams(),this.stopLocalStreams(),this.clearUsers()},i=window.setTimeout(()=>D(i),2*1e3);try{await this.stopLocalStreams(),D(i)}catch{this.restoreICE()}M(!0)}catch(D){this.reportLogs("quit_room_error",D.message||D)}});syncRoomInfo=()=>new Promise(async(M,B)=>{try{const F=this.getOptions(),{userId:A}=F,D=await this.getUser(A),{id:i=A,callAction:T=0}=D;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:i,callAction:T}}}).then(async C=>{const{code:U=0,desc:j,data:z={}}=C;if(U!==200)throw new Error(j);const{isActive:K=!1,users:Y=[]}=z;if(K===!1)throw new Error("Do not stay in this room.");if(Y.find(ae=>ae.id===A)===!1)throw new Error("Need to rejoin the room.");this.clearUsers(),await this.updateUsers(Y),await this.updateUsertracks(D.id,D.tracks,!1);{const ae=await this.getUsers();M(ae)}})}catch(F){B(F)}});checkInRoom=()=>new Promise(async M=>{const B=this.getOptions(),{userId:F}=B,A=await this.getUser(F),{id:D=F,callAction:i=0}=A;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:D,callAction:i}}}).then(async T=>{const{code:C=0,desc:U}=T;if(C!==200)throw new Error(U);const j=T.data.users;return T.data?.isActive||j.find(K=>K.id===F)?M(!0):M(!1)}).catch(()=>M(!1))});senderActived=async M=>{const B=()=>{const{quality:F}=this.peerAnalyzeStatsIns?.getNetwork();return F>=2};await this.prResolves.add("senderActived",B,M)};publish=M=>new Promise(async(B,F)=>{try{{const T=await this.getSelfInfo(),{banBehaviorMap:C}=T;let U=!0;for(const j of M)if(C[j]){U=!1;break}if(U===!1)return F("publish is error: prohibited by administrator.")}const A=await this.getSelfInfo();await this.replaceSenderStream(M,!1),await this.#s(M);const D=[];let i=await this.checkLocalStream(M);D.push(...i.valid_mediaTypes);for(const T of i.valid_mediaTypes){const C=await this.getLocalStream(T);C&&await this.initUserMediaStreamContext(A.id,T,C,!1)}i.invalid_mediaTypes.length!==0&&await(async()=>{await this.setLocalStream(i.invalid_mediaTypes,!0).then(async()=>{i=await this.checkLocalStream(i.invalid_mediaTypes),D.push(...i.valid_mediaTypes);for(const C of i.valid_mediaTypes){const U=await this.getLocalStream(C);U&&await this.initUserMediaStreamContext(A.id,C,U,!1)}if(i.invalid_mediaTypes.includes("screenSharing_audio")&&!i.invalid_mediaTypes.includes("screenSharing_video")){const C=M.findIndex(U=>U==="screenSharing_audio");M.splice(C,1)}})})();{await this.replaceSenderStream(M,!0);const T=await this.getSenderTracks(M);await this.updateUsertracks(A.id,T,!0);const C=await this.getCallAction(A.tracks);await this.#i(C)}{const T=[...this.p2pMap.keys()];await this.p2p.replaceSenderStreams(T,M,!0),await this.p2p.pauseSends(T,M,!0)}{await this.senderActived(3e3),this.#r(M),await this.emitNotifyUpdateUsers();const T=this.createUserUpdateStreams(M);await this.emitNotifyUpdateUsersStreams([{userId:A.id,updateStreams:T}])}B(!0)}catch(A){this.reportLogs("publish_error",A.message||A),F(A)}});stopPublish=(M=[])=>new Promise(async(B,F)=>{try{const A=await this.getSelfInfo();M.length===0&&(M=mediaType_keys),await this.replaceSenderStream(M,!0),await this.removeSenders(M);{const i=A.tracks.filter(T=>M.includes(T.mediaType));await this.#c(i),A.tracks=A.tracks.filter(T=>!M.includes(T.mediaType))}const D=await this.getCallAction(A.tracks);await this.#i(D),await this.setLocalStream(M,!1),await this.p2p.pauseSends([],M,!0),await this.emitNotifyUpdateUsers(),B(!0)}catch(A){this.reportLogs("close_track_error",A.message||A),F(A)}});pauseTracks=async(M,B)=>{const F=()=>new Promise(async A=>{const D=await this.getSelfInfo();if(!D||!D.id)return A(!0);const{tracks:i=[]}=D,T=[...i];for(let U of T){const{mediaType:j}=U;j&&M.includes(j)&&(U.enabled=!B,this.getUserMediaStreamContext(D.id,j)?.pause(B))}{const U=[...this.p2pMap.keys()];await this.p2p.pauseSends(U,M,B)}const C=await this.getCallAction(T);await this.#i(C),await this.emitNotifyUpdateUsers(),A(!0)});return this.asyncQueue.add(F,{describe:"pauseTracks"})};inactiveTracks=async(M,B)=>this.pauseTracks(M,!B);subscribe=(M=[])=>{const B=()=>new Promise(async(F,A)=>{try{M.length===0&&(M=await this.getAllUserMediaTypes()),await this.iceConnected();const D=(C,U=!1)=>new Promise(async j=>{const z=async Y=>{const te=[],ae=[],se=[];let oe=0,he=0;for(const ke of Y){const{id:ie,tracks:ce=[]}=ke;if(oe=oe+ce.length,!this.checkUserInRoom(ie))continue;const ue=await this.getUser(ie),fe=[],ye=[],re=[];for(const de of ce){const{code:be=0,mid:_e,type:we}=de,ge=ue.tracks.find(Ee=>Ee.type===we);if(ge)switch(be){case 200:fe.push({...ge,mid:_e});break;case 2026:re.push({...ge,mid:_e});break;default:ye.push({...ge});break}}fe.length!==0&&(te.push({id:ie,tracks:fe}),he=he+fe.length),ye.length!==0&&ae.push({id:ie,tracks:ye}),re.length!==0&&se.push({id:ie,tracks:re})}return{expectation_num:oe,success_num:he,success_users:te,fail_users:ae,retry_users:se}},K=async(Y,te="成功",ae=[])=>{const{expectation_num:se,success_num:oe,success_users:he,fail_users:ke,retry_users:ie}=await z(ae);j({code:Y,msg:te,expectation_num:se,success_num:oe,success_users:he,fail_users:ke,retry_users:ie})};try{const Y=await this.createUserTrackByUserMediaTypes(C,{lastRetry:U});if(Y.length===0)return K(200,"成功",[]);const te=await this.cwsIns.sendMessage({event:"subscribe",data:{session:this.sdk_session,users:Y}}),{code:ae=0,desc:se,sn:oe="",data:he={}}=te;if(this.#o(oe),ae===2017&&se.includes("renegotiation is expected before pulling or pushing tracks")&&await this.#t(),ae===2026){const ce=[];for(const pe of Y)ce.push({...pe,code:2026});return await K(ae,se,ce)}if(ae!==200)return await K(ae,se);const{remoteSdp:ke,users:ie=[]}=he;if(ke){const ce=new RTCSessionDescription({type:"offer",sdp:ke});await this.setRemoteDescription(ce),await this.#t()}await K(200,"成功",ie)}catch(Y){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: error",Y),await K(0,Y.message||Y)}}),i=(C=[])=>new Promise(U=>{this.await_remote_publish_users=C;let j=0;for(const se of C)j=j+se.tracks.length;const z=[],K=Mt(),Y=async()=>{this.cwsIns.removeNotify([K]),this.await_remote_publish_users=[];const se=await D(z);U(se)},te=setTimeout(()=>Y(),30*1e3),ae=async se=>{const{user:oe}=se.data,{id:he,tracks:ke=[],callAction:ie=0}=oe;await this.updateUserCallAction(he,ie),await this.updateUserPermissions(he,3),await this.updateUsertracks(he,ke,!0);const ce=[],pe=C.find(ye=>ye.id===he);if(!pe)return;for(const ye of pe.tracks)for(const re of ke)re.type===ye.type&&ce.push(ye.mediaType);const ue=[...new Set(ce)];ue.length!==0&&z.push({userId:he,mediaTypes:ue});let fe=0;for(const ye of z)fe=fe+ye.mediaTypes.length;fe===j&&(clearTimeout(te),await Y())};this.cwsIns.addNotify({sn:K,event:"onPublish",callback:ae},!0)}),T=async(C=[])=>{let U=0;const j=new Map,z=this.peerIns.getTransceivers();for(const Y of C){const{id:te,tracks:ae=[]}=Y;if(this.checkUserInRoom(te)){await this.updateUsertracks(te,ae,!0);for(const oe of ae){const{mid:he,mediaType:ke}=oe;ke==="microphoneCamera_video"&&(await this.getP2PIns(te))?.isActive("microphoneCamera_video")&&(await this.p2p.pauseRecvs([te],["microphoneCamera_video"],!0),await this.p2p.reportP2PConnect("disconnect",{desc:"p2p is close.",pullId:this.options.userId,pushId:te,mediaTypes:["microphoneCamera_video"]})),ke==="screenSharing_video"&&(await this.getP2PIns(te))?.isActive("screenSharing_video")&&(await this.p2p.pauseRecvs([te],["screenSharing_video"],!0),await this.p2p.reportP2PConnect("disconnect",{desc:"p2p is close.",pullId:this.options.userId,pushId:te,mediaTypes:["screenSharing_video"]}));const ie=z.find(pe=>pe.mid===he);if(!ie)continue;const{receiver:ce}=ie;if(ce.track){{oe.origin="sfu",oe.msid=ce.track.id;const pe=new MediaStream;if(pe.addTrack(ce.track),await this.initUserMediaStreamContext(te,ke,pe,!0),["microphoneCamera_audio","screenSharing_audio"].includes(ke)){const ue=new Audio;ue.srcObject=pe,(ke==="microphoneCamera_audio"||ke==="screenSharing_audio")&&this.getUserAudioMediaStreamContext(te,ke)?.setMute(!1)}{j.has(te)||j.set(te,{userId:te,tracks:[],updateStreams:{}});const fe=j.get(te);fe.tracks.push(oe),fe.updateStreams[ke]=Mt()}}U=U+1}}}}const K=[...j.values()];return await this.emitNotifyUpdateUsersStreams(K),await this.emitNotifyUpdateUsers(),U};{let C=await D(M,!1),{expectation_num:U,success_num:j,success_users:z=[],fail_users:K=[]}=C;if(z.length!==0){const Y=await T(z);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${Y}/${j}/${U}`,{actual_num:Y,success_num:j,expectation_num:U})}if(K.length!==0){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ","The first subscription attempt failed completely. It will attempt to subscribe again in 4 seconds."),await new Promise(ke=>setTimeout(()=>ke(!0),4e3));const Y=[];for(const ke of K){const ie=Array.from(ke.tracks,ce=>ce.mediaType);Y.push({userId:ke.id,mediaTypes:ie})}const te=await D(Y,!0);let{expectation_num:ae,success_num:se,success_users:oe=[],retry_users:he=[]}=te;if(oe.length!==0){const ke=await T(oe);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${ke}/${se}/${ae}`,{actual_num:ke,success_num:se,expectation_num:ae})}if(he.length!==0){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;","------->quickvo: waiting for the other party to republish before subscribing.");const ie=await kt(()=>i(he),{message:"Wait for a timeout before publishing. No re-published track received from the other party within 40 seconds.",timeout:40*1e3});let{expectation_num:ce,success_num:pe,success_users:ue=[]}=ie;if(ue.length!==0){const fe=await T(ue);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${fe}/${pe}/${ce}`,{actual_num:fe,success_num:pe,expectation_num:ce})}}}F(!0)}}catch(D){this.reportLogs("subscribe_error",D.message||D),A(D)}});return this.asyncQueue.add(B,{describe:"subscribe"})};#t=()=>new Promise(async(M,B)=>{try{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",compress:!0,data:{sdp:this.getSdp()}}).then(async F=>{const{code:A=0,desc:D,sn:i=""}=F;if(await this.#o(i),A!==200)throw new Error(D);M(F)})}catch(F){B(F)}});stopSubscribe=(M=[])=>new Promise(async(B,F)=>{try{M.length===0&&(M=await this.getAllUserMediaTypes());const A=[],D=[];for(const i of M){const{userId:T,mediaTypes:C}=i,U=await this.getUser(T),{id:j,tracks:z=[]}=U;for(const K of z){const{mediaType:Y,origin:te,msid:ae,mid:se}=K;if(C.includes(Y)){if(te==="sfu"){if(!ae||!se)continue;A.push({...K}),D.push(se)}if(te==="p2p"){const oe=await this.getP2PIns(j);oe&&(oe.analyze_stats_ins.onNetwork=()=>{},await oe.pauseRecvs([Y],!0),await this.p2p.reportP2PConnect("disconnect",{desc:"p2p is close.",pullId:this.options.userId,pushId:T,mediaTypes:[Y]}))}K.msid="",K.origin="unknown"}}}A.length!==0&&(await this.stopTransceivers(D),await this.#c(A)),await this.emitNotifyUpdateUsers(),B(!0)}catch(A){this.reportLogs("close_track_error",A.message||A),F(A)}});updateSimulcast=async M=>{this.simulcast=M;const B=await this.getUsers(),F=[];for(const A of B){const{id:D,tracks:i=[]}=A,T=[];for(const C of i){const{mediaType:U}=C;if(["microphoneCamera_video","screenSharing_video"].includes(U)){const j={...C,simulcast:this.simulcast};T.push(j)}}T.length!==0&&F.push({id:D,tracks:T})}return await this.cwsIns.sendMessage({event:"updateSimulcast",data:{session:this.sdk_session,users:F}})};setBanBehaviors=M=>new Promise(async(B,F)=>{try{const A=this.getOptions(),{roomId:D}=A,i=[];for(const T of M){const{id:C,banBehaviors:U}=T,j=Object.keys(U);if(j.length===0)continue;const z=[];for(const Y of j){const te=mediaType_keys.findIndex(oe=>oe===Y),ae=U[Y],se={type:te,behavior:ae};z.push(se)}const K={id:C,behaviors:z};i.push(K)}await this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:D,users:i}}).then(async T=>{const{code:C=0,desc:U}=T;if(C!==200)return F(U);B(T)})}catch(A){F(A)}});debugger=()=>this.cwsIns.sendMessage({event:"debugger"},!1);ai=()=>this.cwsIns.sendMessage({event:"ai"},!1);shutdown=()=>this.cwsIns.sendMessage({event:"shutdown"},!1);restoreRoom=async()=>{if(this.isInRoom===!1)return;await this.checkInRoom()===!1&&this.#n&&await this.#n(),this.cwsIns.afreshSends()};restoreICE=async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: restore ice."),await this.cwsConnected(),this.initPeer(),this.isEarly?this.earlyConnect():await this.createSession();const M=await this.getUsers();for(const B of M){const{id:F,isSelf:A,callActionMap:D,tracks:i=[]}=B;if(A){for(const C of mediaType_keys)D[C]&&this.historical_publish_mediaTypes.push(C);continue}const T=[];for(const C of i)(C.msid||C.origin==="p2p")&&T.push(C.mediaType);T.length!==0&&this.historical_subscribe_mediaTypes.push({userId:F,mediaTypes:T})}await this.syncRoomInfo(),this.historical_publish_mediaTypes.length!==0&&await this.publish(this.historical_publish_mediaTypes).then(()=>{this.historical_publish_mediaTypes=[]}),this.historical_subscribe_mediaTypes.length!==0&&await this.subscribe(this.historical_subscribe_mediaTypes).then(()=>{this.historical_subscribe_mediaTypes=[]})};initHeartbeat=()=>{this.stopHeartbeat();const M=async()=>{if(this.isInRoom){const F=this.getTrafficUse();this.cwsIns.sendMessage({event:"heartbeat",data:F},!1)}else this.cwsIns.sendMessage({event:"heartbeatEx",data:{}},!1)},B=this.isInRoom?10*1e3:30*1e3;this.#e=window.setInterval(M,B),M()};stopHeartbeat=()=>{clearInterval(this.#e)};#r=async M=>new Promise(async(B,F)=>{try{const A=this.getOptions(),{roomId:D}=A;if(!D)return;const{id:i,tracks:T=[]}=await this.getSelfInfo(),C=T.filter(j=>j.mediaType&&M.includes(j.mediaType));if(C.length===0)return;const U=dt(C,["type","trackName","mid"]);await this.cwsIns.sendMessage({event:"pubNotify",data:{session:this.sdk_session,roomId:D,user:{id:i,tracks:U}}}),B(!0)}catch(A){F(A)}});#o=M=>new Promise(B=>{this.cwsIns.sendMessage({event:"ackMsg",data:{msgId:M}},!1),B(!0)});#i=async M=>new Promise(async(B,F)=>{const A=this.getOptions(),{roomId:D,userId:i}=A,T={roomId:D,user:{id:i,callAction:M}};await this.cwsIns.sendMessage({event:"updateCall",data:T}).then(async C=>{const{code:U=0}=C;if(U!==200)return F(C);await this.updateUserCallAction(i,M),B(M)}).catch(C=>F(C))});setSession=()=>{const M=this.getOptions(),{appid:B,roomId:F,userId:A,earlyId:D}=M;if(!B)throw new Error("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const i={c:B,r:F,p:"web",h:location.hostname,v:this.sdk_service_version};this.isEarly&&this.isInRoom===!1&&(i.r=""),this.isEarly?i.i=D:i.b=A;const T=btoa(encodeURI(JSON.stringify(i)));this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: session",i);const C=`${this.options.url}?s=${T}&t=${Date.now()}`;this.cwsIns.prws.setOptions({url:C})};#a=()=>new Promise(async(M,B)=>{try{if(["connecting","connected"].includes(this.roomState))return M(!0);this.setRoomState("connecting"),this.cwsIns.clearEvents(),this.setSession(),await this.cwsIns.connect(),this.initHeartbeat(),this.setRoomState("connected"),await this.prResolves.emit("cwsConnected"),M(this.cwsIns)}catch(F){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",F),this.reportLogs("ws_c_timeout",F.message||F),B(F)}});cwsConnected=()=>{const M=()=>this.roomState==="connected";return this.prResolves.add("cwsConnected",M)};createSession=async()=>new Promise(async M=>{const B=async()=>{await this.cwsConnected(),this.initPeer(),await this.addSenders();let F;F=await this.cwsIns.sendMessage({event:"connectCF",compress:!0,data:{sdp:this.getSdp()}});const{code:A=0,desc:D,data:i,sn:T=""}=F;if(this.#o(T),A!==200)throw new Error(D);const{remoteSdp:C,session:U=""}=i;this.sdk_session=U,this.debugSdp(C,"createSession"),await this.setRemoteDescription({type:"answer",sdp:C}),await kt(this.iceConnected,{message:"ice connect is timeout.",timeout:1e4}),this.p2p.reportNetwork()};for(;;){try{await B();break}catch(F){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ice connect is error. recreate in 5 seconds.",F)}await new Promise(F=>setTimeout(()=>F(!0),5*1e3))}M(!0)});#s=async M=>{const B=()=>new Promise(async(F,A)=>{try{await this.iceConnected();const D=await this.addSenders(M),i=await this.getSenderTracks(D);if(i.length===0)return F(!0);const T=await this.cwsIns.sendMessage({event:"publish",compress:!0,data:{session:this.sdk_session,sdp:this.getSdp(),tracks:i,callAction:0}}),{code:C=0,desc:U,sn:j="",data:z={}}=T;if(await this.#o(j),C!==200)throw new Error(U);const{remoteSdp:K}=z;await this.setRemoteDescription({type:"answer",sdp:K}),F(!0)}catch(D){await this.removeSenders(M),A(D)}});return this.asyncQueue.add(B,{describe:"createTrack"})};#c=(M=[])=>{const B=()=>new Promise(async(F,A)=>{try{await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",compress:!0,data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:M}}).then(async D=>{const{code:i=0,desc:T,data:C={}}=D;if(i!==200)throw new Error(T);const{remoteSdp:U}=C;await this.setRemoteDescription({type:"answer",sdp:U})}),F(!0)}catch(D){A(D)}});return this.asyncQueue.add(B,{describe:"closeTrack"})};#l=async(M,B,F)=>{for(const A of B){let D;if(!this.checkUserInRoom(M))continue;const T=await this.getUser(M),{tracks:C=[]}=T,U=C.find(z=>z.mediaType===A);if(!U)continue;if(F==="sfu"){const{mid:z}=U;D=this.peerIns.getTransceivers().find(te=>te.mid===z)?.receiver.track,U.origin="sfu"}if(F==="p2p"&&(D=(await this.getP2PIns(M))?.getTrack(A),U.origin="p2p"),!D)continue;const j=new MediaStream;j.addTrack(D),await this.initUserMediaStreamContext(M,A,j,!1),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;","------->quickvo: switching to",F,{userId:M,mediaType:A,origin:F,stream:j})}};#u=async(M,B)=>{let F="sfu",A="unknown";const D=await this.getP2PIns(M);if(A=await this.getUserStreamOrigin(M,B),D&&D.isActive(B)){const T=D?.analyze_stats_ins.getAverageQuality();if(T!==0){const{averageQuality:C}=this.getPeerNetwork();T-C>=this.sfuOffsetAverageQuality&&(F="p2p")}}return{current_origin:A,suggest_origin:F}};#f=()=>{{const M=async B=>{let F="";const A=await this.getSelfInfo(),{code:D,data:i}=B;if(D!==200)return;const{sdp:T,sender:C={},tracks:U=[]}=i,{id:j}=C;F=j;{const K=await this.getUsersId();let Y=0;for(const te of K)(await this.getP2PIns(te))?.checkActive()&&(Y+=1);Y>=3&&await this.p2p.reportP2PConnect("ignore",{desc:"P2P connections have reached the maximum limit.",pullId:this.options.userId,pushId:F,mediaTypes:[]})}const z=await this.getP2PIns(F);if(z)try{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${F}]: start connect p2p.`),await z.init(),z.analyze_stats_ins.onNetwork=ie=>{this.p2pPush+=Math.ceil(ie.outboundBytes/1024)};const K=[],Y=[];for(const ie of U){const{type:ce,mid:pe,enabled:ue=!1}=ie;if(ce===void 0)continue;const fe=mediaType_keys[ie.type];K.push(fe),Y.push({mediaType:fe,mid:pe,enabled:ue})}await z.setOffer({type:"offer",sdp:T}),await z.initSenders(Y),await this.p2p.replaceSenderStreams([F],K,!0),await z.pauseSends(K,!0);const te=await z.createAnswer();this.debugSdp(te.sdp,"p2p.answer");const ae=await z.getSenderTracks(K),se=this.getOptions(),{roomId:oe}=se,he=()=>new Promise(async(ie,ce)=>{try{const pe=await this.cwsIns.sendMessage({event:"answer",data:{roomId:oe,tracks:ae,sender:{id:A.id,callAction:A.callAction},receiverId:F,sdp:te.sdp}}),{code:ue=0,desc:fe}=pe;if(ue!==200)throw new Error(fe);ie(!0)}catch(pe){ce(pe)}}),ke=()=>new Promise(async(ie,ce)=>{try{const pe=await kt(z.getIcecandidates,{message:"await get send candidates is timeout.",timeout:1e4}),ue=Array.from(pe,({sdpMid:de,sdpMLineIndex:be,candidate:_e})=>({sdpMid:de,sdpMLineIndex:be,sdp:_e})),fe=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:oe,senderId:A.id,receiverId:F,candidates:ue,isSubscribeReceiver:!1}}),{code:ye=0,desc:re}=fe;if(ye!==200)throw new Error(re);ie(!0)}catch(pe){ce(pe)}});await he(),await new Promise(ie=>setTimeout(()=>ie(!0),1e3)),await ke(),await kt(z.iceConnected,{message:"await ice connect is timeout.",timeout:1e4})}catch(K){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${F}]: connect p2p is error.`,K)}};this.cwsIns.addNotify({event:"onOffer",callback:M},!0)}{const M=async B=>{const{code:F,data:A}=B;if(F!==200)return;const{senderId:D,candidates:i=[],receiverId:T,isSubscribeReceiver:C=!1}=A,U=this.getOptions(),{userId:j}=U;if(C===!1||T!==j)return;const z=await this.getP2PIns(D);if(!z)return;const K=Array.from(i,({sdpMid:Y,sdpMLineIndex:te,sdp:ae})=>({sdpMid:Y,sdpMLineIndex:te,candidate:ae}));await z.addCandidates(K)};this.cwsIns.addNotify({event:"onCandidate",callback:M},!0)}};p2p={open:(M,B)=>new Promise(async(F,A)=>{if(B.length===0)return;if(this.options.useP2P===!1)return A("You have disabled the p2p function on the client side.");const D=this.getOptions(),{roomId:i}=D,T=await this.getSelfInfo(),C=Mt(),U=new Date().getTime(),j=await this.getP2PIns(M);if(!j)return A("illegal user object.");if(!this.checkUserInRoom(M))return A("This user is not in the room.");const{prohibited_mediaTypes:K=[],subscribed_mediaTypes:Y=[]}=await this.checkSubscribed(M,B);K.length!==0&&this.p2p.reportP2PConnect("ignore",{desc:"P2P connections without a subscription relationship are not allowed.",pullId:this.options.userId,pushId:M,mediaTypes:K});try{if(this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${M}]: start connect p2p.`),j.checkActive()===!1&&await j.init(),(await j.initRecvs(Y)).length!==0){const ke=()=>new Promise(async(ue,fe)=>{try{const ye=await j.createOffer();this.debugSdp(ye.sdp,"p2p_offer");const re=await j.getRecvTracks(Y),de=await this.cwsIns.sendMessage({event:"offer",data:{roomId:i,tracks:re,sender:{id:T.id,callAction:T.callAction},receiverId:M,sdp:ye.sdp}}),{code:be=0,desc:_e}=de;if(be!==200)throw new Error(_e);ue(!0)}catch(ye){fe(ye)}}),ie=()=>kt(()=>new Promise(fe=>{const ye=async re=>{const{code:de,data:be}=re;if(de!==200)return;const{sender:_e,sdp:we,tracks:ge=[]}=be,{id:Ee}=_e;M===Ee&&fe({answer:{type:"answer",sdp:we},tracks:ge})};this.cwsIns.addNotify({event:"onAnswer",callback:ye,sn:`await_answer: ${C}`},!0),ke()}),{message:"await_answer is timeout.",timeout:2e4}),ce=()=>new Promise(async(ue,fe)=>{try{const ye=await kt(j.getIcecandidates,{message:"await get recv candidates is timeout.",timeout:1e4}),re=Array.from(ye,({sdpMid:we,sdpMLineIndex:ge,candidate:Ee})=>({sdpMid:we,sdpMLineIndex:ge,sdp:Ee})),de=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:i,senderId:T.id,receiverId:M,candidates:re,isSubscribeReceiver:!0}}),{code:be=0,desc:_e}=de;if(be!==200)throw new Error(_e);ue(!0)}catch(ye){fe(ye)}});kt(()=>new Promise(fe=>{const ye=async re=>{const{code:de,data:be}=re;if(de!==200)return;const{candidates:_e=[],isSubscribeReceiver:we=!1}=be;if(we===!1){const ge=Array.from(_e,({sdpMid:Ee,sdpMLineIndex:qe,sdp:Me})=>({sdpMid:Ee,sdpMLineIndex:qe,candidate:Me}));fe(ge)}};this.cwsIns.addNotify({event:"onCandidate",callback:ye,sn:`await_answer_candidates: ${C}`},!0),ce()}),{message:"await_answer_candidates is timeout.",timeout:2e4}).then(ue=>j.addCandidates(ue)).finally(()=>this.cwsIns.removeNotify([`onCandidate: ${C}`]));{const ue=await ie().finally(()=>{this.cwsIns.removeNotify([`onAnswer: ${C}`])}),{answer:fe,tracks:ye=[]}=ue;this.debugSdp(fe.sdp,"p2p.answer"),await j.setAnswer(fe);const re=[],de=[];for(const be of ye){const{type:_e,mid:we,enabled:ge=!1}=be;if(_e===void 0)continue;const Ee=mediaType_keys[be.type];de.push(Ee),re.push({mediaType:Ee,mid:we,enabled:ge})}await j.initSenders(re),await this.p2p.replaceSenderStreams([M],de,!0),await j.pauseSends(de,!0)}}await kt(j.iceConnected,{message:"ice connect is timeout.",timeout:10*1e3}),await kt(j.remoteChannelConnected,{message:"remote_channel connect is timeout.",timeout:10*1e3}),await this.p2p.pauseRecvs([M],Y,!1);const se=`${new Date().getTime()-U}`;await this.p2p.reportP2PConnect("success",{desc:"P2P connection successful.",pullId:this.options.userId,pushId:M,mediaTypes:Y,connectedTime:se}),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${M}]: will compare the quality of P2P and SFU networks in 10 seconds.`);const oe={microphoneCamera_video:!0,screenSharing_video:!0},he=async()=>{const{averageQuality:ke,inboundBytes:ie}=j.analyze_stats_ins.getNetwork();if(this.p2pPull+=Math.ceil(ie/1024),ke!==0)for(const ce of Y){if(oe[ce]===!1)continue;const{current_origin:pe,suggest_origin:ue}=await this.#u(M,ce);if(pe!==ue){if(ue==="sfu"){if(j.analyze_stats_ins.onNetwork=()=>{},this.hasAsyncTask("subscribe"))continue;const{subscribed_mediaTypes:fe=[]}=await this.checkSubscribed(M,[ce]);if(fe.length===0)continue;await j.pauseRecvs([ce],!0),await this.p2p.reportP2PConnect("poor_network",{desc:`P2P quality is ${ke}.`,pullId:this.options.userId,pushId:M,mediaTypes:[ce]}),this.subscribe([{userId:M,mediaTypes:[ce]}])}if(ue==="p2p"&&oe[ce]){oe[ce]=!1,await this.#l(M,[ce],"p2p"),await this.emitNotifyUpdateUsers();const fe=this.createUserUpdateStreams([ce]);await this.emitNotifyUpdateUsersStreams([{userId:M,updateStreams:fe}]);const re=(await this.getUser(M)).tracks.filter(de=>[ce].includes(de.mediaType));this.#c(re)}}}};j.analyze_stats_ins.onNetwork=()=>he(),F(!0)}catch(te){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${M}]: connect p2p is error.`,te),await this.p2p.reportP2PConnect("fail",{desc:te.message||te,pullId:this.options.userId,pushId:M,mediaTypes:Y}),A(te)}}),replaceSenderStreams:async(M,B=[],F)=>{const A=this.getOptions();for(const D of M){const{userId:i}=A,T=await this.getP2PIns(D);if(T)for(const C of B){const U=T.send_transceiver_map.get(C);if(!U||U.direction==="stopped")continue;let j;const{sender:z}=U;F?j=this.getUserStream(i,C).clone():j=this.getPhoneyStreams(C);const[K]=j.getTracks();K&&await z.replaceTrack(K)}}},pauseSends:async(M,B=[],F)=>{for(const A of M){const D=await this.getP2PIns(A);D&&await D.pauseSends(B,F)}},pauseRecvs:async(M,B=[],F)=>{for(const A of M){const D=await this.getP2PIns(A);D&&await D.pauseRecvs(B,F)}await this.p2p.close(M)},reportNetwork:()=>new Promise(async(M,B)=>{try{let F=0;const{address:A,natType:D}=await h();switch(D){case"Symmetric":F=0;break;case"Full Cone":F=1;break;case"Port Restricted Cone":F=2;break;case"Restricted Cone":F=3;break}let i=0;{const T=isMobile(),U=(navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType;T||(["wifi","4g"].includes(U)?i=0:i=2),T&&(["wifi"].includes(U)?i=0:i=2)}await this.cwsConnected(),await this.cwsIns.sendMessage({event:"reportNetwork",data:{nat:F,type:i,ip:A}}),M(!0)}catch(F){B(F)}}),reportP2PConnect:(M,B)=>{let F;switch(M){case"success":F=0;break;case"fail":F=1;break;case"ignore":F=2;break;case"disconnect":F=3;break;case"poor_network":F=4;break}const{mediaTypes:A,...D}=B,i=[];for(const T of A){const C=mediaType_keys.findIndex(U=>U===T);i.push(C)}return this.cwsIns.sendMessage({event:"reportP2PConnectEx",data:{...D,code:F,types:i}})},close:async(M=[])=>{M.length===0&&(M=[...this.p2pMap.keys()]);for(const B of M){const F=await this.getP2PIns(B);!F||!F.peer_ins||F.peer_ins.connectionState!=="connected"||F.checkActive()===!0||(F.destroy(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: p2p.close: ${B}`))}}}}class Room extends RoomCalls{constructor(M){super(M)}}class QuickVO extends Room{#e=new Map;constructor(M){super(M),this.#t(),this.#n()}#n=()=>{{const M=async B=>{const{state:F}=B.data;if(F==="closed"){const{roomId:A,userId:D}=this.getOptions(),i={roomId:A,user:{id:D}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:i}),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}};this.cwsIns.addNotify({event:"onRoomState",callback:M},!0)}{const M=async B=>{const{state:F}=B.data;["closed","failed"].includes(F)&&this.restoreICE()};this.cwsIns.addNotify({event:"onIceState",callback:M},!0)}{const M=async B=>{const{qualities:F=[]}=B.data,[A]=F,{userId:D}=this.getOptions();if(!(A&&A.userId===D&&F.length===1)){for(const i of F){const{userId:T,egress:C,ingress:U}=i;this.checkUserInRoom(T)&&await this.updateUserNetwork(T,{egress:C,ingress:U})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:M},!0)}{const M=async B=>{const F=B.data.user;await this.removeUsers([F.id]),await this.updateUsers([F]),await this.updateUsertracks(F.id,F.track,!1),await this.updateUserBehaviors(F.id,F.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:M},!0)}{const M=async B=>{await this.removeUsers([B.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:M},!0)}{const M=async B=>{const{user:F}=B.data,{id:A,tracks:D=[],callAction:i=0}=F;if(await this.updateUserCallAction(A,i),await this.updateUserPermissions(A,3),await this.updateUsertracks(A,D,!0),this.await_remote_publish_users.length!==0&&this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ignore some user track releases.",this.await_remote_publish_users),this.options.newPublishAutoSubscribe){const T=(K,Y)=>{const te=this.await_remote_publish_users.find(se=>se.id===K);return!(!te||te.tracks.findIndex(se=>se.type===Y)===-1)},C=[];if(!this.checkUserInRoom(A))return;const j=await this.getUser(A);for(const K of j.tracks)for(const Y of D)K.type===Y.type&&T(A,Y.type)===!1&&C.push(Y.mediaType);const z=[...new Set(C)];if(z.length!==0){const K=[{userId:A,mediaTypes:z}];await this.subscribe(K)}}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:M},!0)}{const M=async B=>{const{id:F,tracks:A}=B.data.user,{userId:D}=this.getOptions();if(F===D)return;const i=Array.from(A,j=>j.trackName),T=await this.getUser(F),C=[];for(const j of T.tracks)i.includes(j.trackName)&&C.push(j.mediaType);if(await this.stopSubscribe([{userId:F,mediaTypes:C}]),this.checkUserInRoom(F)){const j=T.tracks.filter(z=>!i.includes(z.trackName));await this.updateUsertracks(F,j,!1),await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onCloseTrack",callback:M},!0)}{const M=async B=>{const{id:F,callAction:A}=B.data.user;this.checkUserInRoom(F)&&(await this.updateUserCallAction(F,A),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:M},!0)}{const M=async B=>{const{roomId:F,remoteUserId:A}=B.data,D=this.getOptions();this.checkUserInRoom(A)&&F===D.roomId&&await this.p2p.close([A])};this.cwsIns.addNotify({event:"onDisconnectedP2P",callback:M},!0)}{const M=async B=>{const{roomId:F,remotePullPeerId:A}=B.data,D=this.getOptions();F===D.roomId&&this.p2p.pauseSends([A],["microphoneCamera_audio","microphoneCamera_video","screenSharing_audio","screenSharing_video"],!1)};this.cwsIns.addNotify({event:"onRemotePeerReady",callback:M},!0)}{const M=async B=>{const{user:F}=B.data,{id:A,permissions:D=1}=F;D===1?await this.removeUsers([A]):D===3&&await this.updateUsers([F]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:M},!0)}{const M=async B=>{const{users:F}=B.data;for(const A of F){const{id:D,behavior:i}=A;await this.updateUserBehaviors(D,i)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:M},!0)}{const M=async B=>{const{roomId:F,pushId:A,types:D=[]}=B.data;if(!this.checkUserInRoom(A)||D.length===0||this.options.roomId!==F)return;await new Promise(T=>setTimeout(()=>T(!0),1e3));const i=[];for(const T of D){const C=mediaType_keys[T];i.push(C)}this.p2p.open(A,i)};this.cwsIns.addNotify({event:"onAttemptP2PEx",callback:M},!0)}{const M=async B=>{const{session:F,sessionIsValid:A=!0,tracks:D=[]}=B.data;if(F!==this.sdk_session||A===!1)return this.restoreICE();const i=[],T=Array.from(D,U=>U.trackName),C=await this.getUserTrackByTrackName(T);for(const U of C)U&&U.mediaType&&i.push(U.mediaType);await this.stopPublish(i),await this.publish(i)};this.cwsIns.addNotify({event:"onTrackInactive",callback:M},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async M=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)};addNotify=M=>this.cwsIns.addNotify(M);#t=()=>{this.cwsIns.prws.checkReconnect=async M=>M.code===1e3?(this.setRoomState("closed"),!1):M.code===4001?(this.setRoomState("closed"),!1):M.code===4002?(this.setRoomState("closed"),!1):M.code===4003?(this.setRoomState("closed"),!1):(this.setSession(),M.code===4010?(this.setRoomState("connecting"),!0):(this.setRoomState("connecting"),!0)),this.cwsIns.prws.onReconnectSuccess=async M=>{this.setRoomState("connected"),await this.restoreRoom(),await this.prResolves.emit("cwsConnected")},this.cwsIns.prws.onReconnectStop=async M=>{this.setRoomState("closed")}};addRequestAnimationFrame=async(M,B)=>{{const A=this.#e.get(M);A&&cancelAnimationFrame(A)}const F=(A=Date.now())=>{B(A);const D=requestAnimationFrame(F);this.#e.set(M,D)};F()};clearRequestAnimationFrame=async(M=[])=>{M.length===0&&(M=[...this.#e.keys()]);const B=[];for(const F of M){const A=this.#e.get(F);A&&(cancelAnimationFrame(A),B.push(A))}return B};destroy=async()=>{this.stopPhoneyStreams(),this.stopLocalStreams(),this.stopGetPeerStats(),this.quitRoom(),this.clearUsers(),this.clearUserStreams(),this.stopHeartbeat(),await new Promise(M=>setTimeout(()=>M(!0),300)),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.cwsIns.close(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK")}}exports.QuickVO=QuickVO,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
3
+ `},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var N=requireParser(),M=requireWriter$1(),B=requireGrammar();return lib$1.grammar=B,lib$1.write=M,lib$1.parse=N.parse,lib$1.parseParams=N.parseParams,lib$1.parseFmtpConfig=N.parseFmtpConfig,lib$1.parsePayloads=N.parsePayloads,lib$1.parseRemoteCandidates=N.parseRemoteCandidates,lib$1.parseImageAttributes=N.parseImageAttributes,lib$1.parseSimulcastStreamList=N.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{kind="video";stream=new MediaStream;constructor(M){this.stream.addTrack(M)}stop=()=>{const M=this.stream.getTracks();for(const B of M)this.stream.removeTrack(B),B.stop()};replaceStream=M=>{const B=this.stream,F=B.getTracks();for(const D of F)B.removeTrack(D),D.stop();const[C]=M.getVideoTracks();C&&B.addTrack(C)};pause=async M=>{const B=this.stream.getTracks();for(const F of B)F.enabled=!M};getStream=()=>this.stream;getTrack=()=>this.stream.getTracks()[0]}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};pt(enum_roomState);var I=Object.defineProperty,k=N=>{throw TypeError(N)},S=(N,M,B)=>M in N?I(N,M,{enumerable:!0,configurable:!0,writable:!0,value:B}):N[M]=B,a$1=(N,M,B)=>S(N,typeof M!="symbol"?M+"":M,B),R=(N,M,B)=>M.has(N)||k("Cannot "+B),t=(N,M,B)=>(R(N,M,"read from private field"),B?B.call(N):M.get(N)),h$1=(N,M,B)=>M.has(N)?k("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(N):M.set(N,B),r=(N,M,B,F)=>(R(N,M,"write to private field"),M.set(N,B),B);const E=(N=0,M=1)=>{const B=Math.max(0,N),F=Math.max(1,M),C=Math.random()*(F-B+1)+B;return parseInt(`${C}`,10)},L=(N=16,M=16)=>{const B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),F=Math.min(B.length,M),C=Date.now().toString(F),D=C.split(""),i=Math.max(4,N-C.length);for(let T=0;T<i;T++){const A=E(0,F-1),U=B[A];D.push(U)}return D.join("").toUpperCase()};var s$1,c,l$1,m$1,p$1,f,w,g$2,b,y$1,x;class H{constructor(M){h$1(this,s$1,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,autoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4}),a$1(this,"ws"),h$1(this,c,""),h$1(this,l$1,-1),h$1(this,m$1,-1),h$1(this,p$1,0),h$1(this,f,0),h$1(this,w,!1),a$1(this,"checkReconnect",async B=>!0),a$1(this,"onReconnectSuccess",async B=>{}),a$1(this,"onReconnectStop",async B=>{}),a$1(this,"getHeartbeatMsg",()=>JSON.stringify({event:"heartbeat"})),a$1(this,"onMessage",B=>{}),a$1(this,"setOptions",B=>{r(this,s$1,{...t(this,s$1),...B})}),a$1(this,"connect",()=>new Promise(async(B,F)=>{r(this,c,L()),t(this,s$1).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;padding:16px 0;","------->pr-ws: connecting.",{key:t(this,c),url:t(this,s$1).url}),this.ws=new WebSocket(t(this,s$1).url),this.ws.binaryType=t(this,s$1).binaryType,this.ws.addEventListener("message",t(this,b)),this.ws.addEventListener("open",C=>{clearTimeout(t(this,p$1)),r(this,l$1,t(this,s$1).reconnectCount),r(this,w,!1),r(this,m$1,-1),t(this,y$1).call(this),t(this,s$1).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;padding:16px 0;","------->pr-ws: connected.",{key:t(this,c),url:t(this,s$1).url}),B(C)}),this.ws.addEventListener("error",C=>{clearTimeout(t(this,p$1)),t(this,s$1).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;padding:16px 0;","------->pr-ws: connect is error.",{key:t(this,c),url:t(this,s$1).url,e:C}),F(C)}),this.ws.addEventListener("close",C=>{if(t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;padding:16px 0;","------->pr-ws: connect is close.",{key:t(this,c),url:t(this,s$1).url,e:C}),t(this,w)===!1)return this.reconnect(C);t(this,x).call(this),this.ws=void 0}),r(this,p$1,window.setTimeout(()=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is timeout.",{key:t(this,c),url:t(this,s$1).url}),F("connect is timeout.")},t(this,s$1).timeout))})),a$1(this,"reconnect",async B=>new Promise(async(F,C)=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.",{key:t(this,c),url:t(this,s$1).url});const D=i=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: reconnect is stop. ",{key:t(this,c),url:t(this,s$1).url,msg:i}),this.onReconnectStop({msg:i}),C(i)};if(t(this,g$2).call(this)===!1)return D("stop reconnect. exceed maxReconnectionTime.");if(t(this,l$1)!==-1&&t(this,l$1)===0)return D("stop reconnect. surplusReconnectCount is 0.");if(!await this.checkReconnect(B))return D("stop reconnect. checkReconnect is false.");t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,s$1).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,l$1)}`,{key:t(this,c)}),await new Promise(i=>setTimeout(()=>i(!0),t(this,s$1).reconnectIntervalTime)),r(this,l$1,Math.max(-1,t(this,l$1)-1)),await this.connect().then(this.onReconnectSuccess),F(this.ws)})),a$1(this,"sendMessage",async B=>{var F;(!this.ws||this.ws.readyState!==1)&&(t(this,s$1).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready.",{key:t(this,c),url:t(this,s$1).url}),t(this,s$1).autoConnect&&(t(this,s$1).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws auto connect.",{key:t(this,c),url:t(this,s$1).url}),await this.connect())),(F=this.ws)==null||F.send(B)}),a$1(this,"close",async(B=1e3,F="correctly close.")=>{var C;this.ws&&(r(this,w,!0),t(this,x).call(this),(C=this.ws)==null||C.close(B,F))}),h$1(this,g$2,()=>{const B=Date.now();return t(this,m$1)===-1&&r(this,m$1,B+t(this,s$1).reconnectTime),!(B>t(this,m$1))}),h$1(this,b,B=>{const{data:F}=B;this.onMessage(F)}),h$1(this,y$1,()=>{r(this,f,window.setInterval(()=>{const B=this.getHeartbeatMsg();B&&this.sendMessage(B)},t(this,s$1).heartbeatIntervalTime))}),h$1(this,x,()=>{clearInterval(t(this,f))}),r(this,s$1,{...t(this,s$1),...M}),r(this,l$1,t(this,s$1).reconnectCount)}}s$1=new WeakMap,c=new WeakMap,l$1=new WeakMap,m$1=new WeakMap,p$1=new WeakMap,f=new WeakMap,w=new WeakMap,g$2=new WeakMap,b=new WeakMap,y$1=new WeakMap,x=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=N;function N(M,B){for(var F=new Array(arguments.length-1),C=0,D=2,i=!0;D<arguments.length;)F[C++]=arguments[D++];return new Promise(function(A,U){F[C]=function(z){if(i)if(i=!1,z)U(z);else{for(var K=new Array(arguments.length-1),Y=0;Y<K.length;)K[Y++]=arguments[Y];A.apply(null,K)}};try{M.apply(B||null,F)}catch(j){i&&(i=!1,U(j))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,(function(N){var M=N;M.length=function(T){var A=T.length;if(!A)return 0;for(var U=0;--A%4>1&&T.charAt(A)==="=";)++U;return Math.ceil(T.length*3)/4-U};for(var B=new Array(64),F=new Array(123),C=0;C<64;)F[B[C]=C<26?C+65:C<52?C+71:C<62?C-4:C-59|43]=C++;M.encode=function(T,A,U){for(var j=null,z=[],K=0,Y=0,te;A<U;){var ae=T[A++];switch(Y){case 0:z[K++]=B[ae>>2],te=(ae&3)<<4,Y=1;break;case 1:z[K++]=B[te|ae>>4],te=(ae&15)<<2,Y=2;break;case 2:z[K++]=B[te|ae>>6],z[K++]=B[ae&63],Y=0;break}K>8191&&((j||(j=[])).push(String.fromCharCode.apply(String,z)),K=0)}return Y&&(z[K++]=B[te],z[K++]=61,Y===1&&(z[K++]=61)),j?(K&&j.push(String.fromCharCode.apply(String,z.slice(0,K))),j.join("")):String.fromCharCode.apply(String,z.slice(0,K))};var D="invalid encoding";M.decode=function(T,A,U){for(var j=U,z=0,K,Y=0;Y<T.length;){var te=T.charCodeAt(Y++);if(te===61&&z>1)break;if((te=F[te])===void 0)throw Error(D);switch(z){case 0:K=te,z=1;break;case 1:A[U++]=K<<2|(te&48)>>4,K=te,z=2;break;case 2:A[U++]=(K&15)<<4|(te&60)>>2,K=te,z=3;break;case 3:A[U++]=(K&3)<<6|te,z=0;break}}if(z===1)throw Error(D);return U-j},M.test=function(T){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(T)}})(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=N;function N(){this._listeners={}}return N.prototype.on=function(B,F,C){return(this._listeners[B]||(this._listeners[B]=[])).push({fn:F,ctx:C||this}),this},N.prototype.off=function(B,F){if(B===void 0)this._listeners={};else if(F===void 0)this._listeners[B]=[];else for(var C=this._listeners[B],D=0;D<C.length;)C[D].fn===F?C.splice(D,1):++D;return this},N.prototype.emit=function(B){var F=this._listeners[B];if(F){for(var C=[],D=1;D<arguments.length;)C.push(arguments[D++]);for(D=0;D<F.length;)F[D].fn.apply(F[D++].ctx,C)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=N(N);function N(D){return typeof Float32Array<"u"?(function(){var i=new Float32Array([-0]),T=new Uint8Array(i.buffer),A=T[3]===128;function U(Y,te,ae){i[0]=Y,te[ae]=T[0],te[ae+1]=T[1],te[ae+2]=T[2],te[ae+3]=T[3]}function j(Y,te,ae){i[0]=Y,te[ae]=T[3],te[ae+1]=T[2],te[ae+2]=T[1],te[ae+3]=T[0]}D.writeFloatLE=A?U:j,D.writeFloatBE=A?j:U;function z(Y,te){return T[0]=Y[te],T[1]=Y[te+1],T[2]=Y[te+2],T[3]=Y[te+3],i[0]}function K(Y,te){return T[3]=Y[te],T[2]=Y[te+1],T[1]=Y[te+2],T[0]=Y[te+3],i[0]}D.readFloatLE=A?z:K,D.readFloatBE=A?K:z})():(function(){function i(A,U,j,z){var K=U<0?1:0;if(K&&(U=-U),U===0)A(1/U>0?0:2147483648,j,z);else if(isNaN(U))A(2143289344,j,z);else if(U>34028234663852886e22)A((K<<31|2139095040)>>>0,j,z);else if(U<11754943508222875e-54)A((K<<31|Math.round(U/1401298464324817e-60))>>>0,j,z);else{var Y=Math.floor(Math.log(U)/Math.LN2),te=Math.round(U*Math.pow(2,-Y)*8388608)&8388607;A((K<<31|Y+127<<23|te)>>>0,j,z)}}D.writeFloatLE=i.bind(null,M),D.writeFloatBE=i.bind(null,B);function T(A,U,j){var z=A(U,j),K=(z>>31)*2+1,Y=z>>>23&255,te=z&8388607;return Y===255?te?NaN:K*(1/0):Y===0?K*1401298464324817e-60*te:K*Math.pow(2,Y-150)*(te+8388608)}D.readFloatLE=T.bind(null,F),D.readFloatBE=T.bind(null,C)})(),typeof Float64Array<"u"?(function(){var i=new Float64Array([-0]),T=new Uint8Array(i.buffer),A=T[7]===128;function U(Y,te,ae){i[0]=Y,te[ae]=T[0],te[ae+1]=T[1],te[ae+2]=T[2],te[ae+3]=T[3],te[ae+4]=T[4],te[ae+5]=T[5],te[ae+6]=T[6],te[ae+7]=T[7]}function j(Y,te,ae){i[0]=Y,te[ae]=T[7],te[ae+1]=T[6],te[ae+2]=T[5],te[ae+3]=T[4],te[ae+4]=T[3],te[ae+5]=T[2],te[ae+6]=T[1],te[ae+7]=T[0]}D.writeDoubleLE=A?U:j,D.writeDoubleBE=A?j:U;function z(Y,te){return T[0]=Y[te],T[1]=Y[te+1],T[2]=Y[te+2],T[3]=Y[te+3],T[4]=Y[te+4],T[5]=Y[te+5],T[6]=Y[te+6],T[7]=Y[te+7],i[0]}function K(Y,te){return T[7]=Y[te],T[6]=Y[te+1],T[5]=Y[te+2],T[4]=Y[te+3],T[3]=Y[te+4],T[2]=Y[te+5],T[1]=Y[te+6],T[0]=Y[te+7],i[0]}D.readDoubleLE=A?z:K,D.readDoubleBE=A?K:z})():(function(){function i(A,U,j,z,K,Y){var te=z<0?1:0;if(te&&(z=-z),z===0)A(0,K,Y+U),A(1/z>0?0:2147483648,K,Y+j);else if(isNaN(z))A(0,K,Y+U),A(2146959360,K,Y+j);else if(z>17976931348623157e292)A(0,K,Y+U),A((te<<31|2146435072)>>>0,K,Y+j);else{var ae;if(z<22250738585072014e-324)ae=z/5e-324,A(ae>>>0,K,Y+U),A((te<<31|ae/4294967296)>>>0,K,Y+j);else{var se=Math.floor(Math.log(z)/Math.LN2);se===1024&&(se=1023),ae=z*Math.pow(2,-se),A(ae*4503599627370496>>>0,K,Y+U),A((te<<31|se+1023<<20|ae*1048576&1048575)>>>0,K,Y+j)}}}D.writeDoubleLE=i.bind(null,M,0,4),D.writeDoubleBE=i.bind(null,B,4,0);function T(A,U,j,z,K){var Y=A(z,K+U),te=A(z,K+j),ae=(te>>31)*2+1,se=te>>>20&2047,re=4294967296*(te&1048575)+Y;return se===2047?re?NaN:ae*(1/0):se===0?ae*5e-324*re:ae*Math.pow(2,se-1075)*(re+4503599627370496)}D.readDoubleLE=T.bind(null,F,0,4),D.readDoubleBE=T.bind(null,C,4,0)})(),D}function M(D,i,T){i[T]=D&255,i[T+1]=D>>>8&255,i[T+2]=D>>>16&255,i[T+3]=D>>>24}function B(D,i,T){i[T]=D>>>24,i[T+1]=D>>>16&255,i[T+2]=D>>>8&255,i[T+3]=D&255}function F(D,i){return(D[i]|D[i+1]<<8|D[i+2]<<16|D[i+3]<<24)>>>0}function C(D,i){return(D[i]<<24|D[i+1]<<16|D[i+2]<<8|D[i+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(N){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(function(N){var M=N;M.length=function(F){for(var C=0,D=0,i=0;i<F.length;++i)D=F.charCodeAt(i),D<128?C+=1:D<2048?C+=2:(D&64512)===55296&&(F.charCodeAt(i+1)&64512)===56320?(++i,C+=4):C+=3;return C},M.read=function(F,C,D){var i=D-C;if(i<1)return"";for(var T=null,A=[],U=0,j;C<D;)j=F[C++],j<128?A[U++]=j:j>191&&j<224?A[U++]=(j&31)<<6|F[C++]&63:j>239&&j<365?(j=((j&7)<<18|(F[C++]&63)<<12|(F[C++]&63)<<6|F[C++]&63)-65536,A[U++]=55296+(j>>10),A[U++]=56320+(j&1023)):A[U++]=(j&15)<<12|(F[C++]&63)<<6|F[C++]&63,U>8191&&((T||(T=[])).push(String.fromCharCode.apply(String,A)),U=0);return T?(U&&T.push(String.fromCharCode.apply(String,A.slice(0,U))),T.join("")):String.fromCharCode.apply(String,A.slice(0,U))},M.write=function(F,C,D){for(var i=D,T,A,U=0;U<F.length;++U)T=F.charCodeAt(U),T<128?C[D++]=T:T<2048?(C[D++]=T>>6|192,C[D++]=T&63|128):(T&64512)===55296&&((A=F.charCodeAt(U+1))&64512)===56320?(T=65536+((T&1023)<<10)+(A&1023),++U,C[D++]=T>>18|240,C[D++]=T>>12&63|128,C[D++]=T>>6&63|128,C[D++]=T&63|128):(C[D++]=T>>12|224,C[D++]=T>>6&63|128,C[D++]=T&63|128);return D-i}})(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=N;function N(M,B,F){var C=F||8192,D=C>>>1,i=null,T=C;return function(U){if(U<1||U>D)return M(U);T+U>C&&(i=M(C),T=0);var j=B.call(i,T,T+=U);return T&7&&(T=(T|7)+1),j}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=M;var N=requireMinimal$1();function M(D,i){this.lo=D>>>0,this.hi=i>>>0}var B=M.zero=new M(0,0);B.toNumber=function(){return 0},B.zzEncode=B.zzDecode=function(){return this},B.length=function(){return 1};var F=M.zeroHash="\0\0\0\0\0\0\0\0";M.fromNumber=function(i){if(i===0)return B;var T=i<0;T&&(i=-i);var A=i>>>0,U=(i-A)/4294967296>>>0;return T&&(U=~U>>>0,A=~A>>>0,++A>4294967295&&(A=0,++U>4294967295&&(U=0))),new M(A,U)},M.from=function(i){if(typeof i=="number")return M.fromNumber(i);if(N.isString(i))if(N.Long)i=N.Long.fromString(i);else return M.fromNumber(parseInt(i,10));return i.low||i.high?new M(i.low>>>0,i.high>>>0):B},M.prototype.toNumber=function(i){if(!i&&this.hi>>>31){var T=~this.lo+1>>>0,A=~this.hi>>>0;return T||(A=A+1>>>0),-(T+A*4294967296)}return this.lo+this.hi*4294967296},M.prototype.toLong=function(i){return N.Long?new N.Long(this.lo|0,this.hi|0,!!i):{low:this.lo|0,high:this.hi|0,unsigned:!!i}};var C=String.prototype.charCodeAt;return M.fromHash=function(i){return i===F?B:new M((C.call(i,0)|C.call(i,1)<<8|C.call(i,2)<<16|C.call(i,3)<<24)>>>0,(C.call(i,4)|C.call(i,5)<<8|C.call(i,6)<<16|C.call(i,7)<<24)>>>0)},M.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},M.prototype.zzEncode=function(){var i=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^i)>>>0,this.lo=(this.lo<<1^i)>>>0,this},M.prototype.zzDecode=function(){var i=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^i)>>>0,this.hi=(this.hi>>>1^i)>>>0,this},M.prototype.length=function(){var i=this.lo,T=(this.lo>>>28|this.hi<<4)>>>0,A=this.hi>>>24;return A===0?T===0?i<16384?i<128?1:2:i<2097152?3:4:T<16384?T<128?5:6:T<2097152?7:8:A<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,(function(N){var M=N;M.asPromise=requireAspromise(),M.base64=requireBase64(),M.EventEmitter=requireEventemitter(),M.float=requireFloat(),M.inquire=requireInquire(),M.utf8=requireUtf8(),M.pool=requirePool(),M.LongBits=requireLongbits(),M.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),M.global=M.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,M.emptyArray=Object.freeze?Object.freeze([]):[],M.emptyObject=Object.freeze?Object.freeze({}):{},M.isInteger=Number.isInteger||function(D){return typeof D=="number"&&isFinite(D)&&Math.floor(D)===D},M.isString=function(D){return typeof D=="string"||D instanceof String},M.isObject=function(D){return D&&typeof D=="object"},M.isset=M.isSet=function(D,i){var T=D[i];return T!=null&&D.hasOwnProperty(i)?typeof T!="object"||(Array.isArray(T)?T.length:Object.keys(T).length)>0:!1},M.Buffer=(function(){try{var C=M.inquire("buffer").Buffer;return C.prototype.utf8Write?C:null}catch{return null}})(),M._Buffer_from=null,M._Buffer_allocUnsafe=null,M.newBuffer=function(D){return typeof D=="number"?M.Buffer?M._Buffer_allocUnsafe(D):new M.Array(D):M.Buffer?M._Buffer_from(D):typeof Uint8Array>"u"?D:new Uint8Array(D)},M.Array=typeof Uint8Array<"u"?Uint8Array:Array,M.Long=M.global.dcodeIO&&M.global.dcodeIO.Long||M.global.Long||M.inquire("long"),M.key2Re=/^true|false|0|1$/,M.key32Re=/^-?(?:0|[1-9][0-9]*)$/,M.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,M.longToHash=function(D){return D?M.LongBits.from(D).toHash():M.LongBits.zeroHash},M.longFromHash=function(D,i){var T=M.LongBits.fromHash(D);return M.Long?M.Long.fromBits(T.lo,T.hi,i):T.toNumber(!!i)};function B(C,D,i){for(var T=Object.keys(D),A=0;A<T.length;++A)(C[T[A]]===void 0||!i)&&(C[T[A]]=D[T[A]]);return C}M.merge=B,M.lcFirst=function(D){return D.charAt(0).toLowerCase()+D.substring(1)};function F(C){function D(i,T){if(!(this instanceof D))return new D(i,T);Object.defineProperty(this,"message",{get:function(){return i}}),Error.captureStackTrace?Error.captureStackTrace(this,D):Object.defineProperty(this,"stack",{value:new Error().stack||""}),T&&B(this,T)}return D.prototype=Object.create(Error.prototype,{constructor:{value:D,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return C},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),D}M.newError=F,M.ProtocolError=F("ProtocolError"),M.oneOfGetter=function(D){for(var i={},T=0;T<D.length;++T)i[D[T]]=1;return function(){for(var A=Object.keys(this),U=A.length-1;U>-1;--U)if(i[A[U]]===1&&this[A[U]]!==void 0&&this[A[U]]!==null)return A[U]}},M.oneOfSetter=function(D){return function(i){for(var T=0;T<D.length;++T)D[T]!==i&&delete this[D[T]]}},M.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},M._configure=function(){var C=M.Buffer;if(!C){M._Buffer_from=M._Buffer_allocUnsafe=null;return}M._Buffer_from=C.from!==Uint8Array.from&&C.from||function(i,T){return new C(i,T)},M._Buffer_allocUnsafe=C.allocUnsafe||function(i){return new C(i)}}})(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=A;var N=requireMinimal$1(),M,B=N.LongBits,F=N.base64,C=N.utf8;function D(se,re,pe){this.fn=se,this.len=re,this.next=void 0,this.val=pe}function i(){}function T(se){this.head=se.head,this.tail=se.tail,this.len=se.len,this.next=se.states}function A(){this.len=0,this.head=new D(i,0,0),this.tail=this.head,this.states=null}var U=function(){return N.Buffer?function(){return(A.create=function(){return new M})()}:function(){return new A}};A.create=U(),A.alloc=function(re){return new N.Array(re)},N.Array!==Array&&(A.alloc=N.pool(A.alloc,N.Array.prototype.subarray)),A.prototype._push=function(re,pe,ke){return this.tail=this.tail.next=new D(re,pe,ke),this.len+=pe,this};function j(se,re,pe){re[pe]=se&255}function z(se,re,pe){for(;se>127;)re[pe++]=se&127|128,se>>>=7;re[pe]=se}function K(se,re){this.len=se,this.next=void 0,this.val=re}K.prototype=Object.create(D.prototype),K.prototype.fn=z,A.prototype.uint32=function(re){return this.len+=(this.tail=this.tail.next=new K((re=re>>>0)<128?1:re<16384?2:re<2097152?3:re<268435456?4:5,re)).len,this},A.prototype.int32=function(re){return re<0?this._push(Y,10,B.fromNumber(re)):this.uint32(re)},A.prototype.sint32=function(re){return this.uint32((re<<1^re>>31)>>>0)};function Y(se,re,pe){for(;se.hi;)re[pe++]=se.lo&127|128,se.lo=(se.lo>>>7|se.hi<<25)>>>0,se.hi>>>=7;for(;se.lo>127;)re[pe++]=se.lo&127|128,se.lo=se.lo>>>7;re[pe++]=se.lo}A.prototype.uint64=function(re){var pe=B.from(re);return this._push(Y,pe.length(),pe)},A.prototype.int64=A.prototype.uint64,A.prototype.sint64=function(re){var pe=B.from(re).zzEncode();return this._push(Y,pe.length(),pe)},A.prototype.bool=function(re){return this._push(j,1,re?1:0)};function te(se,re,pe){re[pe]=se&255,re[pe+1]=se>>>8&255,re[pe+2]=se>>>16&255,re[pe+3]=se>>>24}A.prototype.fixed32=function(re){return this._push(te,4,re>>>0)},A.prototype.sfixed32=A.prototype.fixed32,A.prototype.fixed64=function(re){var pe=B.from(re);return this._push(te,4,pe.lo)._push(te,4,pe.hi)},A.prototype.sfixed64=A.prototype.fixed64,A.prototype.float=function(re){return this._push(N.float.writeFloatLE,4,re)},A.prototype.double=function(re){return this._push(N.float.writeDoubleLE,8,re)};var ae=N.Array.prototype.set?function(re,pe,ke){pe.set(re,ke)}:function(re,pe,ke){for(var ie=0;ie<re.length;++ie)pe[ke+ie]=re[ie]};return A.prototype.bytes=function(re){var pe=re.length>>>0;if(!pe)return this._push(j,1,0);if(N.isString(re)){var ke=A.alloc(pe=F.length(re));F.decode(re,ke,0),re=ke}return this.uint32(pe)._push(ae,pe,re)},A.prototype.string=function(re){var pe=C.length(re);return pe?this.uint32(pe)._push(C.write,pe,re):this._push(j,1,0)},A.prototype.fork=function(){return this.states=new T(this),this.head=this.tail=new D(i,0,0),this.len=0,this},A.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new D(i,0,0),this.len=0),this},A.prototype.ldelim=function(){var re=this.head,pe=this.tail,ke=this.len;return this.reset().uint32(ke),ke&&(this.tail.next=re.next,this.tail=pe,this.len+=ke),this},A.prototype.finish=function(){for(var re=this.head.next,pe=this.constructor.alloc(this.len),ke=0;re;)re.fn(re.val,pe,ke),ke+=re.len,re=re.next;return pe},A._configure=function(se){M=se,A.create=U(),M._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=B;var N=requireWriter();(B.prototype=Object.create(N.prototype)).constructor=B;var M=requireMinimal$1();function B(){N.call(this)}B._configure=function(){B.alloc=M._Buffer_allocUnsafe,B.writeBytesBuffer=M.Buffer&&M.Buffer.prototype instanceof Uint8Array&&M.Buffer.prototype.set.name==="set"?function(D,i,T){i.set(D,T)}:function(D,i,T){if(D.copy)D.copy(i,T,0,D.length);else for(var A=0;A<D.length;)i[T++]=D[A++]}},B.prototype.bytes=function(D){M.isString(D)&&(D=M._Buffer_from(D,"base64"));var i=D.length>>>0;return this.uint32(i),i&&this._push(B.writeBytesBuffer,i,D),this};function F(C,D,i){C.length<40?M.utf8.write(C,D,i):D.utf8Write?D.utf8Write(C,i):D.write(C,i)}return B.prototype.string=function(D){var i=M.Buffer.byteLength(D);return this.uint32(i),i&&this._push(F,i,D),this},B._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=D;var N=requireMinimal$1(),M,B=N.LongBits,F=N.utf8;function C(z,K){return RangeError("index out of range: "+z.pos+" + "+(K||1)+" > "+z.len)}function D(z){this.buf=z,this.pos=0,this.len=z.length}var i=typeof Uint8Array<"u"?function(K){if(K instanceof Uint8Array||Array.isArray(K))return new D(K);throw Error("illegal buffer")}:function(K){if(Array.isArray(K))return new D(K);throw Error("illegal buffer")},T=function(){return N.Buffer?function(Y){return(D.create=function(ae){return N.Buffer.isBuffer(ae)?new M(ae):i(ae)})(Y)}:i};D.create=T(),D.prototype._slice=N.Array.prototype.subarray||N.Array.prototype.slice,D.prototype.uint32=(function(){var K=4294967295;return function(){if(K=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(K=(K|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return K;if((this.pos+=5)>this.len)throw this.pos=this.len,C(this,10);return K}})(),D.prototype.int32=function(){return this.uint32()|0},D.prototype.sint32=function(){var K=this.uint32();return K>>>1^-(K&1)|0};function A(){var z=new B(0,0),K=0;if(this.len-this.pos>4){for(;K<4;++K)if(z.lo=(z.lo|(this.buf[this.pos]&127)<<K*7)>>>0,this.buf[this.pos++]<128)return z;if(z.lo=(z.lo|(this.buf[this.pos]&127)<<28)>>>0,z.hi=(z.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return z;K=0}else{for(;K<3;++K){if(this.pos>=this.len)throw C(this);if(z.lo=(z.lo|(this.buf[this.pos]&127)<<K*7)>>>0,this.buf[this.pos++]<128)return z}return z.lo=(z.lo|(this.buf[this.pos++]&127)<<K*7)>>>0,z}if(this.len-this.pos>4){for(;K<5;++K)if(z.hi=(z.hi|(this.buf[this.pos]&127)<<K*7+3)>>>0,this.buf[this.pos++]<128)return z}else for(;K<5;++K){if(this.pos>=this.len)throw C(this);if(z.hi=(z.hi|(this.buf[this.pos]&127)<<K*7+3)>>>0,this.buf[this.pos++]<128)return z}throw Error("invalid varint encoding")}D.prototype.bool=function(){return this.uint32()!==0};function U(z,K){return(z[K-4]|z[K-3]<<8|z[K-2]<<16|z[K-1]<<24)>>>0}D.prototype.fixed32=function(){if(this.pos+4>this.len)throw C(this,4);return U(this.buf,this.pos+=4)},D.prototype.sfixed32=function(){if(this.pos+4>this.len)throw C(this,4);return U(this.buf,this.pos+=4)|0};function j(){if(this.pos+8>this.len)throw C(this,8);return new B(U(this.buf,this.pos+=4),U(this.buf,this.pos+=4))}return D.prototype.float=function(){if(this.pos+4>this.len)throw C(this,4);var K=N.float.readFloatLE(this.buf,this.pos);return this.pos+=4,K},D.prototype.double=function(){if(this.pos+8>this.len)throw C(this,4);var K=N.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,K},D.prototype.bytes=function(){var K=this.uint32(),Y=this.pos,te=this.pos+K;if(te>this.len)throw C(this,K);if(this.pos+=K,Array.isArray(this.buf))return this.buf.slice(Y,te);if(Y===te){var ae=N.Buffer;return ae?ae.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,Y,te)},D.prototype.string=function(){var K=this.bytes();return F.read(K,0,K.length)},D.prototype.skip=function(K){if(typeof K=="number"){if(this.pos+K>this.len)throw C(this,K);this.pos+=K}else do if(this.pos>=this.len)throw C(this);while(this.buf[this.pos++]&128);return this},D.prototype.skipType=function(z){switch(z){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(z=this.uint32()&7)!==4;)this.skipType(z);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+z+" at offset "+this.pos)}return this},D._configure=function(z){M=z,D.create=T(),M._configure();var K=N.Long?"toLong":"toNumber";N.merge(D.prototype,{int64:function(){return A.call(this)[K](!1)},uint64:function(){return A.call(this)[K](!0)},sint64:function(){return A.call(this).zzDecode()[K](!1)},fixed64:function(){return j.call(this)[K](!0)},sfixed64:function(){return j.call(this)[K](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=B;var N=requireReader();(B.prototype=Object.create(N.prototype)).constructor=B;var M=requireMinimal$1();function B(F){N.call(this,F)}return B._configure=function(){M.Buffer&&(B.prototype._slice=M.Buffer.prototype.slice)},B.prototype.string=function(){var C=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+C,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+C,this.len))},B._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=M;var N=requireMinimal$1();(M.prototype=Object.create(N.EventEmitter.prototype)).constructor=M;function M(B,F,C){if(typeof B!="function")throw TypeError("rpcImpl must be a function");N.EventEmitter.call(this),this.rpcImpl=B,this.requestDelimited=!!F,this.responseDelimited=!!C}return M.prototype.rpcCall=function B(F,C,D,i,T){if(!i)throw TypeError("request must be specified");var A=this;if(!T)return N.asPromise(B,A,F,C,D,i);if(!A.rpcImpl){setTimeout(function(){T(Error("already ended"))},0);return}try{return A.rpcImpl(F,C[A.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(j,z){if(j)return A.emit("error",j,F),T(j);if(z===null){A.end(!0);return}if(!(z instanceof D))try{z=D[A.responseDelimited?"decodeDelimited":"decode"](z)}catch(K){return A.emit("error",K,F),T(K)}return A.emit("data",z,F),T(null,z)})}catch(U){A.emit("error",U,F),setTimeout(function(){T(U)},0);return}},M.prototype.end=function(F){return this.rpcImpl&&(F||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,(function(N){var M=N;M.Service=requireService()})(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,(function(N){var M=N;M.build="minimal",M.Writer=requireWriter(),M.BufferWriter=requireWriter_buffer(),M.Reader=requireReader(),M.BufferReader=requireReader_buffer(),M.util=requireMinimal$1(),M.rpc=requireRpc(),M.roots=requireRoots(),M.configure=B;function B(){M.util._configure(),M.Writer._configure(M.BufferWriter),M.Reader._configure(M.BufferReader)}B()})(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$Writer=minimalExports.Writer,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const N={};return N.quick=(function(){const M={};return M.voice=(function(){const B={};return B.proto=(function(){const F={};return F.CommonReq=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.event="",C.prototype.data=$util.newBuffer([]),C.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,C.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,C.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,C.prototype.version=0,C.prototype.compress=!1,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&T.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&T.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&T.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&T.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&T.uint32(40).int64(i.valid),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&T.uint32(48).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&T.uint32(56).bool(i.compress),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CommonReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.event=i.string();break}case 2:{j.data=i.bytes();break}case 3:{j.sn=i.int64();break}case 4:{j.time=i.int64();break}case 5:{j.valid=i.int64();break}case 6:{j.version=i.int32();break}case 7:{j.compress=i.bool();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonReq)return i;let T=new $root.com.quick.voice.proto.CommonReq;return i.event!=null&&(T.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,T.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(T.data=i.data)),i.sn!=null&&($util.Long?(T.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?T.sn=parseInt(i.sn,10):typeof i.sn=="number"?T.sn=i.sn:typeof i.sn=="object"&&(T.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(T.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?T.time=parseInt(i.time,10):typeof i.time=="number"?T.time=i.time:typeof i.time=="object"&&(T.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(T.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?T.valid=parseInt(i.valid,10):typeof i.valid=="number"?T.valid=i.valid:typeof i.valid=="object"&&(T.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.version!=null&&(T.version=i.version|0),i.compress!=null&&(T.compress=!!i.compress),T},C.toObject=function(i,T){T||(T={});let A={};if(T.defaults){if(A.event="",T.bytes===String?A.data="":(A.data=[],T.bytes!==Array&&(A.data=$util.newBuffer(A.data))),$util.Long){let U=new $util.Long(0,0,!1);A.sn=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else A.sn=T.longs===String?"0":0;if($util.Long){let U=new $util.Long(0,0,!1);A.time=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else A.time=T.longs===String?"0":0;if($util.Long){let U=new $util.Long(0,0,!1);A.valid=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else A.valid=T.longs===String?"0":0;A.version=0,A.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&(A.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&(A.data=T.bytes===String?$util.base64.encode(i.data,0,i.data.length):T.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?A.sn=T.longs===String?String(i.sn):i.sn:A.sn=T.longs===String?$util.Long.prototype.toString.call(i.sn):T.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?A.time=T.longs===String?String(i.time):i.time:A.time=T.longs===String?$util.Long.prototype.toString.call(i.time):T.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?A.valid=T.longs===String?String(i.valid):i.valid:A.valid=T.longs===String?$util.Long.prototype.toString.call(i.valid):T.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.version!=null&&i.hasOwnProperty("version")&&(A.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&(A.compress=i.compress),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonReq"},C})(),F.CommonRsp=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.event="",C.prototype.data=$util.newBuffer([]),C.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,C.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,C.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,C.prototype.code=0,C.prototype.desc="",C.prototype.version=0,C.prototype.compress=!1,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&T.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&T.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&T.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&T.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&T.uint32(40).int64(i.valid),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&T.uint32(48).int32(i.code),i.desc!=null&&Object.hasOwnProperty.call(i,"desc")&&T.uint32(58).string(i.desc),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&T.uint32(64).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&T.uint32(72).bool(i.compress),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CommonRsp;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.event=i.string();break}case 2:{j.data=i.bytes();break}case 3:{j.sn=i.int64();break}case 4:{j.time=i.int64();break}case 5:{j.valid=i.int64();break}case 6:{j.code=i.int32();break}case 7:{j.desc=i.string();break}case 8:{j.version=i.int32();break}case 9:{j.compress=i.bool();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.code!=null&&i.hasOwnProperty("code")&&!$util.isInteger(i.code)?"code: integer expected":i.desc!=null&&i.hasOwnProperty("desc")&&!$util.isString(i.desc)?"desc: string expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonRsp)return i;let T=new $root.com.quick.voice.proto.CommonRsp;return i.event!=null&&(T.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,T.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(T.data=i.data)),i.sn!=null&&($util.Long?(T.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?T.sn=parseInt(i.sn,10):typeof i.sn=="number"?T.sn=i.sn:typeof i.sn=="object"&&(T.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(T.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?T.time=parseInt(i.time,10):typeof i.time=="number"?T.time=i.time:typeof i.time=="object"&&(T.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(T.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?T.valid=parseInt(i.valid,10):typeof i.valid=="number"?T.valid=i.valid:typeof i.valid=="object"&&(T.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.code!=null&&(T.code=i.code|0),i.desc!=null&&(T.desc=String(i.desc)),i.version!=null&&(T.version=i.version|0),i.compress!=null&&(T.compress=!!i.compress),T},C.toObject=function(i,T){T||(T={});let A={};if(T.defaults){if(A.event="",T.bytes===String?A.data="":(A.data=[],T.bytes!==Array&&(A.data=$util.newBuffer(A.data))),$util.Long){let U=new $util.Long(0,0,!1);A.sn=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else A.sn=T.longs===String?"0":0;if($util.Long){let U=new $util.Long(0,0,!1);A.time=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else A.time=T.longs===String?"0":0;if($util.Long){let U=new $util.Long(0,0,!1);A.valid=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else A.valid=T.longs===String?"0":0;A.code=0,A.desc="",A.version=0,A.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&(A.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&(A.data=T.bytes===String?$util.base64.encode(i.data,0,i.data.length):T.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?A.sn=T.longs===String?String(i.sn):i.sn:A.sn=T.longs===String?$util.Long.prototype.toString.call(i.sn):T.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?A.time=T.longs===String?String(i.time):i.time:A.time=T.longs===String?$util.Long.prototype.toString.call(i.time):T.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?A.valid=T.longs===String?String(i.valid):i.valid:A.valid=T.longs===String?$util.Long.prototype.toString.call(i.valid):T.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.code!=null&&i.hasOwnProperty("code")&&(A.code=i.code),i.desc!=null&&i.hasOwnProperty("desc")&&(A.desc=i.desc),i.version!=null&&i.hasOwnProperty("version")&&(A.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&(A.compress=i.compress),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonRsp"},C})(),F.User=(function(){function C(i){if(this.tracks=[],i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.id="",C.prototype.callAction=null,C.prototype.callState=null,C.prototype.joinTime=null,C.prototype.tracks=$util.emptyArray,C.prototype.permissions=null,C.prototype.isPublished=null,C.prototype.behavior=null,C.prototype.channelCache=null;let D;return Object.defineProperty(C.prototype,"_callAction",{get:$util.oneOfGetter(D=["callAction"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_callState",{get:$util.oneOfGetter(D=["callState"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_joinTime",{get:$util.oneOfGetter(D=["joinTime"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_permissions",{get:$util.oneOfGetter(D=["permissions"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_isPublished",{get:$util.oneOfGetter(D=["isPublished"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_behavior",{get:$util.oneOfGetter(D=["behavior"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_channelCache",{get:$util.oneOfGetter(D=["channelCache"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){if(A||(A=$Writer.create()),T.id!=null&&Object.hasOwnProperty.call(T,"id")&&A.uint32(10).string(T.id),T.callAction!=null&&Object.hasOwnProperty.call(T,"callAction")&&A.uint32(16).int32(T.callAction),T.callState!=null&&Object.hasOwnProperty.call(T,"callState")&&A.uint32(24).int32(T.callState),T.joinTime!=null&&Object.hasOwnProperty.call(T,"joinTime")&&A.uint32(32).int64(T.joinTime),T.tracks!=null&&T.tracks.length)for(let U=0;U<T.tracks.length;++U)$root.com.quick.voice.proto.Track.encode(T.tracks[U],A.uint32(42).fork()).ldelim();return T.permissions!=null&&Object.hasOwnProperty.call(T,"permissions")&&A.uint32(48).int32(T.permissions),T.isPublished!=null&&Object.hasOwnProperty.call(T,"isPublished")&&A.uint32(56).bool(T.isPublished),T.behavior!=null&&Object.hasOwnProperty.call(T,"behavior")&&A.uint32(64).int32(T.behavior),T.channelCache!=null&&Object.hasOwnProperty.call(T,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(T.channelCache,A.uint32(74).fork()).ldelim(),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.User;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.id=T.string();break}case 2:{z.callAction=T.int32();break}case 3:{z.callState=T.int32();break}case 4:{z.joinTime=T.int64();break}case 5:{z.tracks&&z.tracks.length||(z.tracks=[]),z.tracks.push($root.com.quick.voice.proto.Track.decode(T,T.uint32()));break}case 6:{z.permissions=T.int32();break}case 7:{z.isPublished=T.bool();break}case 8:{z.behavior=T.int32();break}case 9:{z.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(T,T.uint32());break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.id!=null&&T.hasOwnProperty("id")&&!$util.isString(T.id))return"id: string expected";if(T.callAction!=null&&T.hasOwnProperty("callAction")&&!$util.isInteger(T.callAction))return"callAction: integer expected";if(T.callState!=null&&T.hasOwnProperty("callState")&&!$util.isInteger(T.callState))return"callState: integer expected";if(T.joinTime!=null&&T.hasOwnProperty("joinTime")&&!$util.isInteger(T.joinTime)&&!(T.joinTime&&$util.isInteger(T.joinTime.low)&&$util.isInteger(T.joinTime.high)))return"joinTime: integer|Long expected";if(T.tracks!=null&&T.hasOwnProperty("tracks")){if(!Array.isArray(T.tracks))return"tracks: array expected";for(let A=0;A<T.tracks.length;++A){let U=$root.com.quick.voice.proto.Track.verify(T.tracks[A]);if(U)return"tracks."+U}}if(T.permissions!=null&&T.hasOwnProperty("permissions")&&!$util.isInteger(T.permissions))return"permissions: integer expected";if(T.isPublished!=null&&T.hasOwnProperty("isPublished")&&typeof T.isPublished!="boolean")return"isPublished: boolean expected";if(T.behavior!=null&&T.hasOwnProperty("behavior")&&!$util.isInteger(T.behavior))return"behavior: integer expected";if(T.channelCache!=null&&T.hasOwnProperty("channelCache")){let A=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(T.channelCache);if(A)return"channelCache."+A}return null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.User)return T;let A=new $root.com.quick.voice.proto.User;if(T.id!=null&&(A.id=String(T.id)),T.callAction!=null&&(A.callAction=T.callAction|0),T.callState!=null&&(A.callState=T.callState|0),T.joinTime!=null&&($util.Long?(A.joinTime=$util.Long.fromValue(T.joinTime)).unsigned=!1:typeof T.joinTime=="string"?A.joinTime=parseInt(T.joinTime,10):typeof T.joinTime=="number"?A.joinTime=T.joinTime:typeof T.joinTime=="object"&&(A.joinTime=new $util.LongBits(T.joinTime.low>>>0,T.joinTime.high>>>0).toNumber())),T.tracks){if(!Array.isArray(T.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");A.tracks=[];for(let U=0;U<T.tracks.length;++U){if(typeof T.tracks[U]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");A.tracks[U]=$root.com.quick.voice.proto.Track.fromObject(T.tracks[U])}}if(T.permissions!=null&&(A.permissions=T.permissions|0),T.isPublished!=null&&(A.isPublished=!!T.isPublished),T.behavior!=null&&(A.behavior=T.behavior|0),T.channelCache!=null){if(typeof T.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");A.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(T.channelCache)}return A},C.toObject=function(T,A){A||(A={});let U={};if((A.arrays||A.defaults)&&(U.tracks=[]),A.defaults&&(U.id=""),T.id!=null&&T.hasOwnProperty("id")&&(U.id=T.id),T.callAction!=null&&T.hasOwnProperty("callAction")&&(U.callAction=T.callAction,A.oneofs&&(U._callAction="callAction")),T.callState!=null&&T.hasOwnProperty("callState")&&(U.callState=T.callState,A.oneofs&&(U._callState="callState")),T.joinTime!=null&&T.hasOwnProperty("joinTime")&&(typeof T.joinTime=="number"?U.joinTime=A.longs===String?String(T.joinTime):T.joinTime:U.joinTime=A.longs===String?$util.Long.prototype.toString.call(T.joinTime):A.longs===Number?new $util.LongBits(T.joinTime.low>>>0,T.joinTime.high>>>0).toNumber():T.joinTime,A.oneofs&&(U._joinTime="joinTime")),T.tracks&&T.tracks.length){U.tracks=[];for(let j=0;j<T.tracks.length;++j)U.tracks[j]=$root.com.quick.voice.proto.Track.toObject(T.tracks[j],A)}return T.permissions!=null&&T.hasOwnProperty("permissions")&&(U.permissions=T.permissions,A.oneofs&&(U._permissions="permissions")),T.isPublished!=null&&T.hasOwnProperty("isPublished")&&(U.isPublished=T.isPublished,A.oneofs&&(U._isPublished="isPublished")),T.behavior!=null&&T.hasOwnProperty("behavior")&&(U.behavior=T.behavior,A.oneofs&&(U._behavior="behavior")),T.channelCache!=null&&T.hasOwnProperty("channelCache")&&(U.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(T.channelCache,A),A.oneofs&&(U._channelCache="channelCache")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.User"},C})(),F.DataChannelCacheInfo=(function(){function C(D){if(this.channels=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.channels=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.channels!=null&&i.channels.length)for(let A=0;A<i.channels.length;++A)$root.com.quick.voice.proto.DataChannel.encode(i.channels[A],T.uint32(10).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.channels&&j.channels.length||(j.channels=[]),j.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let T=0;T<i.channels.length;++T){let A=$root.com.quick.voice.proto.DataChannel.verify(i.channels[T]);if(A)return"channels."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return i;let T=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");T.channels=[];for(let A=0;A<i.channels.length;++A){if(typeof i.channels[A]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");T.channels[A]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.channels=[]),i.channels&&i.channels.length){A.channels=[];for(let U=0;U<i.channels.length;++U)A.channels[U]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelCacheInfo"},C})(),F.DataChannel=(function(){function C(i){if(i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.dataChannelName="",C.prototype.id=null;let D;return Object.defineProperty(C.prototype,"_id",{get:$util.oneOfGetter(D=["id"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){return A||(A=$Writer.create()),T.dataChannelName!=null&&Object.hasOwnProperty.call(T,"dataChannelName")&&A.uint32(10).string(T.dataChannelName),T.id!=null&&Object.hasOwnProperty.call(T,"id")&&A.uint32(16).int32(T.id),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.DataChannel;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.dataChannelName=T.string();break}case 2:{z.id=T.int32();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){return typeof T!="object"||T===null?"object expected":T.dataChannelName!=null&&T.hasOwnProperty("dataChannelName")&&!$util.isString(T.dataChannelName)?"dataChannelName: string expected":T.id!=null&&T.hasOwnProperty("id")&&!$util.isInteger(T.id)?"id: integer expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.DataChannel)return T;let A=new $root.com.quick.voice.proto.DataChannel;return T.dataChannelName!=null&&(A.dataChannelName=String(T.dataChannelName)),T.id!=null&&(A.id=T.id|0),A},C.toObject=function(T,A){A||(A={});let U={};return A.defaults&&(U.dataChannelName=""),T.dataChannelName!=null&&T.hasOwnProperty("dataChannelName")&&(U.dataChannelName=T.dataChannelName),T.id!=null&&T.hasOwnProperty("id")&&(U.id=T.id,A.oneofs&&(U._id="id")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.DataChannel"},C})(),F.Login=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.appid="",C.prototype.userId="",C.prototype.sdkToken="",C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.appid!=null&&Object.hasOwnProperty.call(i,"appid")&&T.uint32(10).string(i.appid),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(18).string(i.userId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&T.uint32(26).string(i.sdkToken),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.Login;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.appid=i.string();break}case 2:{j.userId=i.string();break}case 3:{j.sdkToken=i.string();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.appid!=null&&i.hasOwnProperty("appid")&&!$util.isString(i.appid)?"appid: string expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Login)return i;let T=new $root.com.quick.voice.proto.Login;return i.appid!=null&&(T.appid=String(i.appid)),i.userId!=null&&(T.userId=String(i.userId)),i.sdkToken!=null&&(T.sdkToken=String(i.sdkToken)),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.appid="",A.userId="",A.sdkToken=""),i.appid!=null&&i.hasOwnProperty("appid")&&(A.appid=i.appid),i.userId!=null&&i.hasOwnProperty("userId")&&(A.userId=i.userId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&(A.sdkToken=i.sdkToken),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Login"},C})(),F.Track=(function(){function C(i){if(i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.mid="",C.prototype.trackName=null,C.prototype.location=null,C.prototype.userId=null,C.prototype.code=null,C.prototype.desc=null,C.prototype.type=null,C.prototype.isValid=null,C.prototype.simulcast=null,C.prototype.lastRetry=null;let D;return Object.defineProperty(C.prototype,"_trackName",{get:$util.oneOfGetter(D=["trackName"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_location",{get:$util.oneOfGetter(D=["location"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_userId",{get:$util.oneOfGetter(D=["userId"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_code",{get:$util.oneOfGetter(D=["code"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_desc",{get:$util.oneOfGetter(D=["desc"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_type",{get:$util.oneOfGetter(D=["type"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_isValid",{get:$util.oneOfGetter(D=["isValid"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_simulcast",{get:$util.oneOfGetter(D=["simulcast"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_lastRetry",{get:$util.oneOfGetter(D=["lastRetry"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){return A||(A=$Writer.create()),T.mid!=null&&Object.hasOwnProperty.call(T,"mid")&&A.uint32(10).string(T.mid),T.trackName!=null&&Object.hasOwnProperty.call(T,"trackName")&&A.uint32(18).string(T.trackName),T.location!=null&&Object.hasOwnProperty.call(T,"location")&&A.uint32(26).string(T.location),T.userId!=null&&Object.hasOwnProperty.call(T,"userId")&&A.uint32(34).string(T.userId),T.code!=null&&Object.hasOwnProperty.call(T,"code")&&A.uint32(40).int32(T.code),T.desc!=null&&Object.hasOwnProperty.call(T,"desc")&&A.uint32(50).string(T.desc),T.type!=null&&Object.hasOwnProperty.call(T,"type")&&A.uint32(56).int32(T.type),T.isValid!=null&&Object.hasOwnProperty.call(T,"isValid")&&A.uint32(64).bool(T.isValid),T.simulcast!=null&&Object.hasOwnProperty.call(T,"simulcast")&&A.uint32(74).string(T.simulcast),T.lastRetry!=null&&Object.hasOwnProperty.call(T,"lastRetry")&&A.uint32(80).bool(T.lastRetry),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.Track;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.mid=T.string();break}case 2:{z.trackName=T.string();break}case 3:{z.location=T.string();break}case 4:{z.userId=T.string();break}case 5:{z.code=T.int32();break}case 6:{z.desc=T.string();break}case 7:{z.type=T.int32();break}case 8:{z.isValid=T.bool();break}case 9:{z.simulcast=T.string();break}case 10:{z.lastRetry=T.bool();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.mid!=null&&T.hasOwnProperty("mid")&&!$util.isString(T.mid))return"mid: string expected";if(T.trackName!=null&&T.hasOwnProperty("trackName")&&!$util.isString(T.trackName))return"trackName: string expected";if(T.location!=null&&T.hasOwnProperty("location")&&!$util.isString(T.location))return"location: string expected";if(T.userId!=null&&T.hasOwnProperty("userId")&&!$util.isString(T.userId))return"userId: string expected";if(T.code!=null&&T.hasOwnProperty("code")&&!$util.isInteger(T.code))return"code: integer expected";if(T.desc!=null&&T.hasOwnProperty("desc")&&!$util.isString(T.desc))return"desc: string expected";if(T.type!=null&&T.hasOwnProperty("type"))switch(T.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return T.isValid!=null&&T.hasOwnProperty("isValid")&&typeof T.isValid!="boolean"?"isValid: boolean expected":T.simulcast!=null&&T.hasOwnProperty("simulcast")&&!$util.isString(T.simulcast)?"simulcast: string expected":T.lastRetry!=null&&T.hasOwnProperty("lastRetry")&&typeof T.lastRetry!="boolean"?"lastRetry: boolean expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.Track)return T;let A=new $root.com.quick.voice.proto.Track;switch(T.mid!=null&&(A.mid=String(T.mid)),T.trackName!=null&&(A.trackName=String(T.trackName)),T.location!=null&&(A.location=String(T.location)),T.userId!=null&&(A.userId=String(T.userId)),T.code!=null&&(A.code=T.code|0),T.desc!=null&&(A.desc=String(T.desc)),T.type){default:if(typeof T.type=="number"){A.type=T.type;break}break;case"Microphone":case 0:A.type=0;break;case"Camera":case 1:A.type=1;break;case"Screen":case 2:A.type=2;break;case"SystemVoice":case 3:A.type=3;break}return T.isValid!=null&&(A.isValid=!!T.isValid),T.simulcast!=null&&(A.simulcast=String(T.simulcast)),T.lastRetry!=null&&(A.lastRetry=!!T.lastRetry),A},C.toObject=function(T,A){A||(A={});let U={};return A.defaults&&(U.mid=""),T.mid!=null&&T.hasOwnProperty("mid")&&(U.mid=T.mid),T.trackName!=null&&T.hasOwnProperty("trackName")&&(U.trackName=T.trackName,A.oneofs&&(U._trackName="trackName")),T.location!=null&&T.hasOwnProperty("location")&&(U.location=T.location,A.oneofs&&(U._location="location")),T.userId!=null&&T.hasOwnProperty("userId")&&(U.userId=T.userId,A.oneofs&&(U._userId="userId")),T.code!=null&&T.hasOwnProperty("code")&&(U.code=T.code,A.oneofs&&(U._code="code")),T.desc!=null&&T.hasOwnProperty("desc")&&(U.desc=T.desc,A.oneofs&&(U._desc="desc")),T.type!=null&&T.hasOwnProperty("type")&&(U.type=A.enums===String?$root.com.quick.voice.proto.TrackType[T.type]===void 0?T.type:$root.com.quick.voice.proto.TrackType[T.type]:T.type,A.oneofs&&(U._type="type")),T.isValid!=null&&T.hasOwnProperty("isValid")&&(U.isValid=T.isValid,A.oneofs&&(U._isValid="isValid")),T.simulcast!=null&&T.hasOwnProperty("simulcast")&&(U.simulcast=T.simulcast,A.oneofs&&(U._simulcast="simulcast")),T.lastRetry!=null&&T.hasOwnProperty("lastRetry")&&(U.lastRetry=T.lastRetry,A.oneofs&&(U._lastRetry="lastRetry")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.Track"},C})(),F.JoinReq=(function(){function C(i){if(i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.roomId="",C.prototype.user=null,C.prototype.callType=0,C.prototype.token=null,C.prototype.lang=null,C.prototype.stt=null;let D;return Object.defineProperty(C.prototype,"_token",{get:$util.oneOfGetter(D=["token"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_lang",{get:$util.oneOfGetter(D=["lang"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_stt",{get:$util.oneOfGetter(D=["stt"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){return A||(A=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&A.uint32(10).string(T.roomId),T.user!=null&&Object.hasOwnProperty.call(T,"user")&&$root.com.quick.voice.proto.User.encode(T.user,A.uint32(18).fork()).ldelim(),T.callType!=null&&Object.hasOwnProperty.call(T,"callType")&&A.uint32(24).int32(T.callType),T.token!=null&&Object.hasOwnProperty.call(T,"token")&&A.uint32(34).string(T.token),T.lang!=null&&Object.hasOwnProperty.call(T,"lang")&&$root.com.quick.voice.proto.AiLangSetting.encode(T.lang,A.uint32(42).fork()).ldelim(),T.stt!=null&&Object.hasOwnProperty.call(T,"stt")&&A.uint32(48).bool(T.stt),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.JoinReq;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(T,T.uint32());break}case 3:{z.callType=T.int32();break}case 4:{z.token=T.string();break}case 5:{z.lang=$root.com.quick.voice.proto.AiLangSetting.decode(T,T.uint32());break}case 6:{z.stt=T.bool();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.user!=null&&T.hasOwnProperty("user")){let A=$root.com.quick.voice.proto.User.verify(T.user);if(A)return"user."+A}if(T.callType!=null&&T.hasOwnProperty("callType"))switch(T.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}if(T.token!=null&&T.hasOwnProperty("token")&&!$util.isString(T.token))return"token: string expected";if(T.lang!=null&&T.hasOwnProperty("lang")){let A=$root.com.quick.voice.proto.AiLangSetting.verify(T.lang);if(A)return"lang."+A}return T.stt!=null&&T.hasOwnProperty("stt")&&typeof T.stt!="boolean"?"stt: boolean expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.JoinReq)return T;let A=new $root.com.quick.voice.proto.JoinReq;if(T.roomId!=null&&(A.roomId=String(T.roomId)),T.user!=null){if(typeof T.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");A.user=$root.com.quick.voice.proto.User.fromObject(T.user)}switch(T.callType){default:if(typeof T.callType=="number"){A.callType=T.callType;break}break;case"Normal":case 0:A.callType=0;break;case"Meeting":case 1:A.callType=1;break;case"Live":case 2:A.callType=2;break}if(T.token!=null&&(A.token=String(T.token)),T.lang!=null){if(typeof T.lang!="object")throw TypeError(".com.quick.voice.proto.JoinReq.lang: object expected");A.lang=$root.com.quick.voice.proto.AiLangSetting.fromObject(T.lang)}return T.stt!=null&&(A.stt=!!T.stt),A},C.toObject=function(T,A){A||(A={});let U={};return A.defaults&&(U.roomId="",U.user=null,U.callType=A.enums===String?"Normal":0),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.user!=null&&T.hasOwnProperty("user")&&(U.user=$root.com.quick.voice.proto.User.toObject(T.user,A)),T.callType!=null&&T.hasOwnProperty("callType")&&(U.callType=A.enums===String?$root.com.quick.voice.proto.CallType[T.callType]===void 0?T.callType:$root.com.quick.voice.proto.CallType[T.callType]:T.callType),T.token!=null&&T.hasOwnProperty("token")&&(U.token=T.token,A.oneofs&&(U._token="token")),T.lang!=null&&T.hasOwnProperty("lang")&&(U.lang=$root.com.quick.voice.proto.AiLangSetting.toObject(T.lang,A),A.oneofs&&(U._lang="lang")),T.stt!=null&&T.hasOwnProperty("stt")&&(U.stt=T.stt,A.oneofs&&(U._stt="stt")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.JoinReq"},C})(),F.JoinRsp=(function(){function C(D){if(this.roomUsers=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.roomUsers=$util.emptyArray,C.prototype.callType=0,C.prototype.wifiOnly=!1,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.roomUsers!=null&&i.roomUsers.length)for(let A=0;A<i.roomUsers.length;++A)$root.com.quick.voice.proto.User.encode(i.roomUsers[A],T.uint32(18).fork()).ldelim();return i.callType!=null&&Object.hasOwnProperty.call(i,"callType")&&T.uint32(24).int32(i.callType),i.wifiOnly!=null&&Object.hasOwnProperty.call(i,"wifiOnly")&&T.uint32(32).bool(i.wifiOnly),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.JoinRsp;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.roomUsers&&j.roomUsers.length||(j.roomUsers=[]),j.roomUsers.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 3:{j.callType=i.int32();break}case 4:{j.wifiOnly=i.bool();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.roomUsers!=null&&i.hasOwnProperty("roomUsers")){if(!Array.isArray(i.roomUsers))return"roomUsers: array expected";for(let T=0;T<i.roomUsers.length;++T){let A=$root.com.quick.voice.proto.User.verify(i.roomUsers[T]);if(A)return"roomUsers."+A}}if(i.callType!=null&&i.hasOwnProperty("callType"))switch(i.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return i.wifiOnly!=null&&i.hasOwnProperty("wifiOnly")&&typeof i.wifiOnly!="boolean"?"wifiOnly: boolean expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinRsp)return i;let T=new $root.com.quick.voice.proto.JoinRsp;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.roomUsers){if(!Array.isArray(i.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");T.roomUsers=[];for(let A=0;A<i.roomUsers.length;++A){if(typeof i.roomUsers[A]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");T.roomUsers[A]=$root.com.quick.voice.proto.User.fromObject(i.roomUsers[A])}}switch(i.callType){default:if(typeof i.callType=="number"){T.callType=i.callType;break}break;case"Normal":case 0:T.callType=0;break;case"Meeting":case 1:T.callType=1;break;case"Live":case 2:T.callType=2;break}return i.wifiOnly!=null&&(T.wifiOnly=!!i.wifiOnly),T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.roomUsers=[]),T.defaults&&(A.roomId="",A.callType=T.enums===String?"Normal":0,A.wifiOnly=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.roomUsers&&i.roomUsers.length){A.roomUsers=[];for(let U=0;U<i.roomUsers.length;++U)A.roomUsers[U]=$root.com.quick.voice.proto.User.toObject(i.roomUsers[U],T)}return i.callType!=null&&i.hasOwnProperty("callType")&&(A.callType=T.enums===String?$root.com.quick.voice.proto.CallType[i.callType]===void 0?i.callType:$root.com.quick.voice.proto.CallType[i.callType]:i.callType),i.wifiOnly!=null&&i.hasOwnProperty("wifiOnly")&&(A.wifiOnly=i.wifiOnly),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinRsp"},C})(),F.JoinNotify=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.user=null,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,T.uint32(18).fork()).ldelim(),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.JoinNotify;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let T=$root.com.quick.voice.proto.User.verify(i.user);if(T)return"user."+T}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinNotify)return i;let T=new $root.com.quick.voice.proto.JoinNotify;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");T.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.roomId="",A.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(A.user=$root.com.quick.voice.proto.User.toObject(i.user,T)),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinNotify"},C})(),F.ConnectCFReq=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.sdp="",C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&T.uint32(10).string(i.sdp),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ConnectCFReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.sdp=i.string();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ConnectCFReq)return i;let T=new $root.com.quick.voice.proto.ConnectCFReq;return i.sdp!=null&&(T.sdp=String(i.sdp)),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.sdp=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&(A.sdp=i.sdp),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ConnectCFReq"},C})(),F.ConnectCFRsp=(function(){function C(i){if(this.subscribeUsers=[],i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.remoteSdp="",C.prototype.subscribeUsers=$util.emptyArray,C.prototype.session=null;let D;return Object.defineProperty(C.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){if(A||(A=$Writer.create()),T.remoteSdp!=null&&Object.hasOwnProperty.call(T,"remoteSdp")&&A.uint32(10).string(T.remoteSdp),T.subscribeUsers!=null&&T.subscribeUsers.length)for(let U=0;U<T.subscribeUsers.length;++U)$root.com.quick.voice.proto.User.encode(T.subscribeUsers[U],A.uint32(18).fork()).ldelim();return T.session!=null&&Object.hasOwnProperty.call(T,"session")&&A.uint32(26).string(T.session),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.ConnectCFRsp;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.remoteSdp=T.string();break}case 2:{z.subscribeUsers&&z.subscribeUsers.length||(z.subscribeUsers=[]),z.subscribeUsers.push($root.com.quick.voice.proto.User.decode(T,T.uint32()));break}case 3:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&!$util.isString(T.remoteSdp))return"remoteSdp: string expected";if(T.subscribeUsers!=null&&T.hasOwnProperty("subscribeUsers")){if(!Array.isArray(T.subscribeUsers))return"subscribeUsers: array expected";for(let A=0;A<T.subscribeUsers.length;++A){let U=$root.com.quick.voice.proto.User.verify(T.subscribeUsers[A]);if(U)return"subscribeUsers."+U}}return T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.ConnectCFRsp)return T;let A=new $root.com.quick.voice.proto.ConnectCFRsp;if(T.remoteSdp!=null&&(A.remoteSdp=String(T.remoteSdp)),T.subscribeUsers){if(!Array.isArray(T.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");A.subscribeUsers=[];for(let U=0;U<T.subscribeUsers.length;++U){if(typeof T.subscribeUsers[U]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");A.subscribeUsers[U]=$root.com.quick.voice.proto.User.fromObject(T.subscribeUsers[U])}}return T.session!=null&&(A.session=String(T.session)),A},C.toObject=function(T,A){A||(A={});let U={};if((A.arrays||A.defaults)&&(U.subscribeUsers=[]),A.defaults&&(U.remoteSdp=""),T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&(U.remoteSdp=T.remoteSdp),T.subscribeUsers&&T.subscribeUsers.length){U.subscribeUsers=[];for(let j=0;j<T.subscribeUsers.length;++j)U.subscribeUsers[j]=$root.com.quick.voice.proto.User.toObject(T.subscribeUsers[j],A)}return T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,A.oneofs&&(U._session="session")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.ConnectCFRsp"},C})(),F.PublishReq=(function(){function C(i){if(this.tracks=[],i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.sdp="",C.prototype.tracks=$util.emptyArray,C.prototype.callAction=0,C.prototype.recreate=null,C.prototype.session=null;let D;return Object.defineProperty(C.prototype,"_recreate",{get:$util.oneOfGetter(D=["recreate"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){if(A||(A=$Writer.create()),T.sdp!=null&&Object.hasOwnProperty.call(T,"sdp")&&A.uint32(10).string(T.sdp),T.tracks!=null&&T.tracks.length)for(let U=0;U<T.tracks.length;++U)$root.com.quick.voice.proto.Track.encode(T.tracks[U],A.uint32(18).fork()).ldelim();return T.callAction!=null&&Object.hasOwnProperty.call(T,"callAction")&&A.uint32(24).int32(T.callAction),T.recreate!=null&&Object.hasOwnProperty.call(T,"recreate")&&A.uint32(32).bool(T.recreate),T.session!=null&&Object.hasOwnProperty.call(T,"session")&&A.uint32(42).string(T.session),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.PublishReq;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.sdp=T.string();break}case 2:{z.tracks&&z.tracks.length||(z.tracks=[]),z.tracks.push($root.com.quick.voice.proto.Track.decode(T,T.uint32()));break}case 3:{z.callAction=T.int32();break}case 4:{z.recreate=T.bool();break}case 5:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.sdp!=null&&T.hasOwnProperty("sdp")&&!$util.isString(T.sdp))return"sdp: string expected";if(T.tracks!=null&&T.hasOwnProperty("tracks")){if(!Array.isArray(T.tracks))return"tracks: array expected";for(let A=0;A<T.tracks.length;++A){let U=$root.com.quick.voice.proto.Track.verify(T.tracks[A]);if(U)return"tracks."+U}}return T.callAction!=null&&T.hasOwnProperty("callAction")&&!$util.isInteger(T.callAction)?"callAction: integer expected":T.recreate!=null&&T.hasOwnProperty("recreate")&&typeof T.recreate!="boolean"?"recreate: boolean expected":T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.PublishReq)return T;let A=new $root.com.quick.voice.proto.PublishReq;if(T.sdp!=null&&(A.sdp=String(T.sdp)),T.tracks){if(!Array.isArray(T.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");A.tracks=[];for(let U=0;U<T.tracks.length;++U){if(typeof T.tracks[U]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");A.tracks[U]=$root.com.quick.voice.proto.Track.fromObject(T.tracks[U])}}return T.callAction!=null&&(A.callAction=T.callAction|0),T.recreate!=null&&(A.recreate=!!T.recreate),T.session!=null&&(A.session=String(T.session)),A},C.toObject=function(T,A){A||(A={});let U={};if((A.arrays||A.defaults)&&(U.tracks=[]),A.defaults&&(U.sdp="",U.callAction=0),T.sdp!=null&&T.hasOwnProperty("sdp")&&(U.sdp=T.sdp),T.tracks&&T.tracks.length){U.tracks=[];for(let j=0;j<T.tracks.length;++j)U.tracks[j]=$root.com.quick.voice.proto.Track.toObject(T.tracks[j],A)}return T.callAction!=null&&T.hasOwnProperty("callAction")&&(U.callAction=T.callAction),T.recreate!=null&&T.hasOwnProperty("recreate")&&(U.recreate=T.recreate,A.oneofs&&(U._recreate="recreate")),T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,A.oneofs&&(U._session="session")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.PublishReq"},C})(),F.PublishRsp=(function(){function C(i){if(i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.remoteSdp="",C.prototype.session=null;let D;return Object.defineProperty(C.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){return A||(A=$Writer.create()),T.remoteSdp!=null&&Object.hasOwnProperty.call(T,"remoteSdp")&&A.uint32(10).string(T.remoteSdp),T.session!=null&&Object.hasOwnProperty.call(T,"session")&&A.uint32(18).string(T.session),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.PublishRsp;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.remoteSdp=T.string();break}case 2:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){return typeof T!="object"||T===null?"object expected":T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&!$util.isString(T.remoteSdp)?"remoteSdp: string expected":T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.PublishRsp)return T;let A=new $root.com.quick.voice.proto.PublishRsp;return T.remoteSdp!=null&&(A.remoteSdp=String(T.remoteSdp)),T.session!=null&&(A.session=String(T.session)),A},C.toObject=function(T,A){A||(A={});let U={};return A.defaults&&(U.remoteSdp=""),T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&(U.remoteSdp=T.remoteSdp),T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,A.oneofs&&(U._session="session")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.PublishRsp"},C})(),F.PublishNotify=(function(){function C(i){if(i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.roomId="",C.prototype.user=null,C.prototype.session=null;let D;return Object.defineProperty(C.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){return A||(A=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&A.uint32(10).string(T.roomId),T.user!=null&&Object.hasOwnProperty.call(T,"user")&&$root.com.quick.voice.proto.User.encode(T.user,A.uint32(18).fork()).ldelim(),T.session!=null&&Object.hasOwnProperty.call(T,"session")&&A.uint32(26).string(T.session),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.PublishNotify;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(T,T.uint32());break}case 3:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.user!=null&&T.hasOwnProperty("user")){let A=$root.com.quick.voice.proto.User.verify(T.user);if(A)return"user."+A}return T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.PublishNotify)return T;let A=new $root.com.quick.voice.proto.PublishNotify;if(T.roomId!=null&&(A.roomId=String(T.roomId)),T.user!=null){if(typeof T.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");A.user=$root.com.quick.voice.proto.User.fromObject(T.user)}return T.session!=null&&(A.session=String(T.session)),A},C.toObject=function(T,A){A||(A={});let U={};return A.defaults&&(U.roomId="",U.user=null),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.user!=null&&T.hasOwnProperty("user")&&(U.user=$root.com.quick.voice.proto.User.toObject(T.user,A)),T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,A.oneofs&&(U._session="session")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.PublishNotify"},C})(),F.SubscribeReq=(function(){function C(i){if(this.users=[],i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.users=$util.emptyArray,C.prototype.session=null;let D;return Object.defineProperty(C.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){if(A||(A=$Writer.create()),T.users!=null&&T.users.length)for(let U=0;U<T.users.length;++U)$root.com.quick.voice.proto.User.encode(T.users[U],A.uint32(10).fork()).ldelim();return T.session!=null&&Object.hasOwnProperty.call(T,"session")&&A.uint32(18).string(T.session),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.SubscribeReq;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.users&&z.users.length||(z.users=[]),z.users.push($root.com.quick.voice.proto.User.decode(T,T.uint32()));break}case 2:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.users!=null&&T.hasOwnProperty("users")){if(!Array.isArray(T.users))return"users: array expected";for(let A=0;A<T.users.length;++A){let U=$root.com.quick.voice.proto.User.verify(T.users[A]);if(U)return"users."+U}}return T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.SubscribeReq)return T;let A=new $root.com.quick.voice.proto.SubscribeReq;if(T.users){if(!Array.isArray(T.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");A.users=[];for(let U=0;U<T.users.length;++U){if(typeof T.users[U]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");A.users[U]=$root.com.quick.voice.proto.User.fromObject(T.users[U])}}return T.session!=null&&(A.session=String(T.session)),A},C.toObject=function(T,A){A||(A={});let U={};if((A.arrays||A.defaults)&&(U.users=[]),T.users&&T.users.length){U.users=[];for(let j=0;j<T.users.length;++j)U.users[j]=$root.com.quick.voice.proto.User.toObject(T.users[j],A)}return T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,A.oneofs&&(U._session="session")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.SubscribeReq"},C})(),F.SubscribeRsp=(function(){function C(i){if(this.users=[],i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.remoteSdp="",C.prototype.users=$util.emptyArray,C.prototype.session=null;let D;return Object.defineProperty(C.prototype,"_session",{get:$util.oneOfGetter(D=["session"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){if(A||(A=$Writer.create()),T.remoteSdp!=null&&Object.hasOwnProperty.call(T,"remoteSdp")&&A.uint32(10).string(T.remoteSdp),T.users!=null&&T.users.length)for(let U=0;U<T.users.length;++U)$root.com.quick.voice.proto.User.encode(T.users[U],A.uint32(18).fork()).ldelim();return T.session!=null&&Object.hasOwnProperty.call(T,"session")&&A.uint32(26).string(T.session),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.SubscribeRsp;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.remoteSdp=T.string();break}case 2:{z.users&&z.users.length||(z.users=[]),z.users.push($root.com.quick.voice.proto.User.decode(T,T.uint32()));break}case 3:{z.session=T.string();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&!$util.isString(T.remoteSdp))return"remoteSdp: string expected";if(T.users!=null&&T.hasOwnProperty("users")){if(!Array.isArray(T.users))return"users: array expected";for(let A=0;A<T.users.length;++A){let U=$root.com.quick.voice.proto.User.verify(T.users[A]);if(U)return"users."+U}}return T.session!=null&&T.hasOwnProperty("session")&&!$util.isString(T.session)?"session: string expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.SubscribeRsp)return T;let A=new $root.com.quick.voice.proto.SubscribeRsp;if(T.remoteSdp!=null&&(A.remoteSdp=String(T.remoteSdp)),T.users){if(!Array.isArray(T.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");A.users=[];for(let U=0;U<T.users.length;++U){if(typeof T.users[U]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");A.users[U]=$root.com.quick.voice.proto.User.fromObject(T.users[U])}}return T.session!=null&&(A.session=String(T.session)),A},C.toObject=function(T,A){A||(A={});let U={};if((A.arrays||A.defaults)&&(U.users=[]),A.defaults&&(U.remoteSdp=""),T.remoteSdp!=null&&T.hasOwnProperty("remoteSdp")&&(U.remoteSdp=T.remoteSdp),T.users&&T.users.length){U.users=[];for(let j=0;j<T.users.length;++j)U.users[j]=$root.com.quick.voice.proto.User.toObject(T.users[j],A)}return T.session!=null&&T.hasOwnProperty("session")&&(U.session=T.session,A.oneofs&&(U._session="session")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.SubscribeRsp"},C})(),F.RenegotiateReq=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.userId="",C.prototype.sdp="",C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(10).string(i.userId),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&T.uint32(18).string(i.sdp),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.RenegotiateReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.userId=i.string();break}case 2:{j.sdp=i.string();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RenegotiateReq)return i;let T=new $root.com.quick.voice.proto.RenegotiateReq;return i.userId!=null&&(T.userId=String(i.userId)),i.sdp!=null&&(T.sdp=String(i.sdp)),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.userId="",A.sdp=""),i.userId!=null&&i.hasOwnProperty("userId")&&(A.userId=i.userId),i.sdp!=null&&i.hasOwnProperty("sdp")&&(A.sdp=i.sdp),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RenegotiateReq"},C})(),F.QuitReq=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.userId="",C.prototype.roomId="",C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(18).string(i.roomId),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.QuitReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.userId=i.string();break}case 2:{j.roomId=i.string();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.QuitReq)return i;let T=new $root.com.quick.voice.proto.QuitReq;return i.userId!=null&&(T.userId=String(i.userId)),i.roomId!=null&&(T.roomId=String(i.roomId)),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.userId="",A.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(A.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.QuitReq"},C})(),F.QuitNotify=(function(){function C(i){if(i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.roomId="",C.prototype.user=null,C.prototype.code=null,C.prototype.desc=null;let D;return Object.defineProperty(C.prototype,"_code",{get:$util.oneOfGetter(D=["code"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_desc",{get:$util.oneOfGetter(D=["desc"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){return A||(A=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&A.uint32(10).string(T.roomId),T.user!=null&&Object.hasOwnProperty.call(T,"user")&&$root.com.quick.voice.proto.User.encode(T.user,A.uint32(18).fork()).ldelim(),T.code!=null&&Object.hasOwnProperty.call(T,"code")&&A.uint32(24).int32(T.code),T.desc!=null&&Object.hasOwnProperty.call(T,"desc")&&A.uint32(34).string(T.desc),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.QuitNotify;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(T,T.uint32());break}case 3:{z.code=T.int32();break}case 4:{z.desc=T.string();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.user!=null&&T.hasOwnProperty("user")){let A=$root.com.quick.voice.proto.User.verify(T.user);if(A)return"user."+A}return T.code!=null&&T.hasOwnProperty("code")&&!$util.isInteger(T.code)?"code: integer expected":T.desc!=null&&T.hasOwnProperty("desc")&&!$util.isString(T.desc)?"desc: string expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.QuitNotify)return T;let A=new $root.com.quick.voice.proto.QuitNotify;if(T.roomId!=null&&(A.roomId=String(T.roomId)),T.user!=null){if(typeof T.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");A.user=$root.com.quick.voice.proto.User.fromObject(T.user)}return T.code!=null&&(A.code=T.code|0),T.desc!=null&&(A.desc=String(T.desc)),A},C.toObject=function(T,A){A||(A={});let U={};return A.defaults&&(U.roomId="",U.user=null),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.user!=null&&T.hasOwnProperty("user")&&(U.user=$root.com.quick.voice.proto.User.toObject(T.user,A)),T.code!=null&&T.hasOwnProperty("code")&&(U.code=T.code,A.oneofs&&(U._code="code")),T.desc!=null&&T.hasOwnProperty("desc")&&(U.desc=T.desc,A.oneofs&&(U._desc="desc")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.QuitNotify"},C})(),F.TokenExpireNotify=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.TokenExpireNotify;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.TokenExpireNotify)return i;let T=new $root.com.quick.voice.proto.TokenExpireNotify;return i.roomId!=null&&(T.roomId=String(i.roomId)),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.TokenExpireNotify"},C})(),F.UpdateTokenReq=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.sdkToken="",C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&T.uint32(18).string(i.sdkToken),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UpdateTokenReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.sdkToken=i.string();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTokenReq)return i;let T=new $root.com.quick.voice.proto.UpdateTokenReq;return i.roomId!=null&&(T.roomId=String(i.roomId)),i.sdkToken!=null&&(T.sdkToken=String(i.sdkToken)),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.roomId="",A.sdkToken=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&(A.sdkToken=i.sdkToken),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTokenReq"},C})(),F.NetQualityChange=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.userId="",C.prototype.roomId="",C.prototype.egress=0,C.prototype.ingress=0,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(18).string(i.roomId),i.egress!=null&&Object.hasOwnProperty.call(i,"egress")&&T.uint32(24).int32(i.egress),i.ingress!=null&&Object.hasOwnProperty.call(i,"ingress")&&T.uint32(32).int32(i.ingress),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.NetQualityChange;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.userId=i.string();break}case 2:{j.roomId=i.string();break}case 3:{j.egress=i.int32();break}case 4:{j.ingress=i.int32();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.egress!=null&&i.hasOwnProperty("egress")&&!$util.isInteger(i.egress)?"egress: integer expected":i.ingress!=null&&i.hasOwnProperty("ingress")&&!$util.isInteger(i.ingress)?"ingress: integer expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityChange)return i;let T=new $root.com.quick.voice.proto.NetQualityChange;return i.userId!=null&&(T.userId=String(i.userId)),i.roomId!=null&&(T.roomId=String(i.roomId)),i.egress!=null&&(T.egress=i.egress|0),i.ingress!=null&&(T.ingress=i.ingress|0),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.userId="",A.roomId="",A.egress=0,A.ingress=0),i.userId!=null&&i.hasOwnProperty("userId")&&(A.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.egress!=null&&i.hasOwnProperty("egress")&&(A.egress=i.egress),i.ingress!=null&&i.hasOwnProperty("ingress")&&(A.ingress=i.ingress),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityChange"},C})(),F.NetQualityNotify=(function(){function C(D){if(this.qualities=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.qualities=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.qualities!=null&&i.qualities.length)for(let A=0;A<i.qualities.length;++A)$root.com.quick.voice.proto.NetQualityChange.encode(i.qualities[A],T.uint32(10).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.NetQualityNotify;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.qualities&&j.qualities.length||(j.qualities=[]),j.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.qualities!=null&&i.hasOwnProperty("qualities")){if(!Array.isArray(i.qualities))return"qualities: array expected";for(let T=0;T<i.qualities.length;++T){let A=$root.com.quick.voice.proto.NetQualityChange.verify(i.qualities[T]);if(A)return"qualities."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityNotify)return i;let T=new $root.com.quick.voice.proto.NetQualityNotify;if(i.qualities){if(!Array.isArray(i.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");T.qualities=[];for(let A=0;A<i.qualities.length;++A){if(typeof i.qualities[A]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");T.qualities[A]=$root.com.quick.voice.proto.NetQualityChange.fromObject(i.qualities[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.qualities=[]),i.qualities&&i.qualities.length){A.qualities=[];for(let U=0;U<i.qualities.length;++U)A.qualities[U]=$root.com.quick.voice.proto.NetQualityChange.toObject(i.qualities[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityNotify"},C})(),F.UpdateCall=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.user=null,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,T.uint32(18).fork()).ldelim(),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UpdateCall;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let T=$root.com.quick.voice.proto.User.verify(i.user);if(T)return"user."+T}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateCall)return i;let T=new $root.com.quick.voice.proto.UpdateCall;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");T.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.roomId="",A.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(A.user=$root.com.quick.voice.proto.User.toObject(i.user,T)),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateCall"},C})(),F.SyncRoomInfoReq=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.user=null,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,T.uint32(18).fork()).ldelim(),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let T=$root.com.quick.voice.proto.User.verify(i.user);if(T)return"user."+T}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return i;let T=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");T.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.roomId="",A.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(A.user=$root.com.quick.voice.proto.User.toObject(i.user,T)),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoReq"},C})(),F.SyncRoomInfoRsp=(function(){function C(D){if(this.users=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.isValid=!1,C.prototype.users=$util.emptyArray,C.prototype.isActive=!1,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.isValid!=null&&Object.hasOwnProperty.call(i,"isValid")&&T.uint32(16).bool(i.isValid),i.users!=null&&i.users.length)for(let A=0;A<i.users.length;++A)$root.com.quick.voice.proto.User.encode(i.users[A],T.uint32(26).fork()).ldelim();return i.isActive!=null&&Object.hasOwnProperty.call(i,"isActive")&&T.uint32(32).bool(i.isActive),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.isValid=i.bool();break}case 3:{j.users&&j.users.length||(j.users=[]),j.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 4:{j.isActive=i.bool();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.isValid!=null&&i.hasOwnProperty("isValid")&&typeof i.isValid!="boolean")return"isValid: boolean expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let T=0;T<i.users.length;++T){let A=$root.com.quick.voice.proto.User.verify(i.users[T]);if(A)return"users."+A}}return i.isActive!=null&&i.hasOwnProperty("isActive")&&typeof i.isActive!="boolean"?"isActive: boolean expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return i;let T=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.isValid!=null&&(T.isValid=!!i.isValid),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");T.users=[];for(let A=0;A<i.users.length;++A){if(typeof i.users[A]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");T.users[A]=$root.com.quick.voice.proto.User.fromObject(i.users[A])}}return i.isActive!=null&&(T.isActive=!!i.isActive),T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.users=[]),T.defaults&&(A.roomId="",A.isValid=!1,A.isActive=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.isValid!=null&&i.hasOwnProperty("isValid")&&(A.isValid=i.isValid),i.users&&i.users.length){A.users=[];for(let U=0;U<i.users.length;++U)A.users[U]=$root.com.quick.voice.proto.User.toObject(i.users[U],T)}return i.isActive!=null&&i.hasOwnProperty("isActive")&&(A.isActive=i.isActive),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoRsp"},C})(),F.UpdateTime=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&T.uint32(8).int64(i.time),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UpdateTime;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.time=i.int64();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTime)return i;let T=new $root.com.quick.voice.proto.UpdateTime;return i.time!=null&&($util.Long?(T.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?T.time=parseInt(i.time,10):typeof i.time=="number"?T.time=i.time:typeof i.time=="object"&&(T.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),T},C.toObject=function(i,T){T||(T={});let A={};if(T.defaults)if($util.Long){let U=new $util.Long(0,0,!1);A.time=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else A.time=T.longs===String?"0":0;return i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?A.time=T.longs===String?String(i.time):i.time:A.time=T.longs===String?$util.Long.prototype.toString.call(i.time):T.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTime"},C})(),F.CloseTrackReq=(function(){function C(D){if(this.tracks=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.sdp="",C.prototype.tracks=$util.emptyArray,C.prototype.roomId="",C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&T.uint32(10).string(i.sdp),i.tracks!=null&&i.tracks.length)for(let A=0;A<i.tracks.length;++A)$root.com.quick.voice.proto.Track.encode(i.tracks[A],T.uint32(18).fork()).ldelim();return i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(26).string(i.roomId),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CloseTrackReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.sdp=i.string();break}case 2:{j.tracks&&j.tracks.length||(j.tracks=[]),j.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{j.roomId=i.string();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp))return"sdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let T=0;T<i.tracks.length;++T){let A=$root.com.quick.voice.proto.Track.verify(i.tracks[T]);if(A)return"tracks."+A}}return i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackReq)return i;let T=new $root.com.quick.voice.proto.CloseTrackReq;if(i.sdp!=null&&(T.sdp=String(i.sdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");T.tracks=[];for(let A=0;A<i.tracks.length;++A){if(typeof i.tracks[A]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");T.tracks[A]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[A])}}return i.roomId!=null&&(T.roomId=String(i.roomId)),T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.tracks=[]),T.defaults&&(A.sdp="",A.roomId=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&(A.sdp=i.sdp),i.tracks&&i.tracks.length){A.tracks=[];for(let U=0;U<i.tracks.length;++U)A.tracks[U]=$root.com.quick.voice.proto.Track.toObject(i.tracks[U],T)}return i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackReq"},C})(),F.CloseTrackRsp=(function(){function C(D){if(this.tracks=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.remoteSdp="",C.prototype.tracks=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.remoteSdp!=null&&Object.hasOwnProperty.call(i,"remoteSdp")&&T.uint32(10).string(i.remoteSdp),i.tracks!=null&&i.tracks.length)for(let A=0;A<i.tracks.length;++A)$root.com.quick.voice.proto.Track.encode(i.tracks[A],T.uint32(18).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CloseTrackRsp;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.remoteSdp=i.string();break}case 2:{j.tracks&&j.tracks.length||(j.tracks=[]),j.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&!$util.isString(i.remoteSdp))return"remoteSdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let T=0;T<i.tracks.length;++T){let A=$root.com.quick.voice.proto.Track.verify(i.tracks[T]);if(A)return"tracks."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackRsp)return i;let T=new $root.com.quick.voice.proto.CloseTrackRsp;if(i.remoteSdp!=null&&(T.remoteSdp=String(i.remoteSdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");T.tracks=[];for(let A=0;A<i.tracks.length;++A){if(typeof i.tracks[A]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");T.tracks[A]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.tracks=[]),T.defaults&&(A.remoteSdp=""),i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&(A.remoteSdp=i.remoteSdp),i.tracks&&i.tracks.length){A.tracks=[];for(let U=0;U<i.tracks.length;++U)A.tracks[U]=$root.com.quick.voice.proto.Track.toObject(i.tracks[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackRsp"},C})(),F.CloseTrackNotify=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.user=null,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,T.uint32(10).fork()).ldelim(),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CloseTrackNotify;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.user!=null&&i.hasOwnProperty("user")){let T=$root.com.quick.voice.proto.User.verify(i.user);if(T)return"user."+T}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackNotify)return i;let T=new $root.com.quick.voice.proto.CloseTrackNotify;if(i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");T.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.user=null),i.user!=null&&i.hasOwnProperty("user")&&(A.user=$root.com.quick.voice.proto.User.toObject(i.user,T)),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackNotify"},C})(),F.TrackType=(function(){const C={},D=Object.create(C);return D[C[0]="Microphone"]=0,D[C[1]="Camera"]=1,D[C[2]="Screen"]=2,D[C[3]="SystemVoice"]=3,D})(),F.UpdatePermissions=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.user=null,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,T.uint32(18).fork()).ldelim(),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UpdatePermissions;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let T=$root.com.quick.voice.proto.User.verify(i.user);if(T)return"user."+T}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdatePermissions)return i;let T=new $root.com.quick.voice.proto.UpdatePermissions;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");T.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.roomId="",A.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(A.user=$root.com.quick.voice.proto.User.toObject(i.user,T)),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdatePermissions"},C})(),F.CallType=(function(){const C={},D=Object.create(C);return D[C[0]="Normal"]=0,D[C[1]="Meeting"]=1,D[C[2]="Live"]=2,D})(),F.QuitNotifyCode=(function(){const C={},D=Object.create(C);return D[C[0]="NormalQuit"]=0,D[C[2021]="Timeout"]=2021,D[C[2011]="TokenExpired"]=2011,D[C[2022]="KickOut"]=2022,D[C[2023]="EndPk"]=2023,D[C[2024]="EndLive"]=2024,D})(),F.UserBehavior=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.type=0,C.prototype.behavior=!1,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&T.uint32(8).int32(i.type),i.behavior!=null&&Object.hasOwnProperty.call(i,"behavior")&&T.uint32(16).bool(i.behavior),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UserBehavior;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.type=i.int32();break}case 2:{j.behavior=i.bool();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return i.behavior!=null&&i.hasOwnProperty("behavior")&&typeof i.behavior!="boolean"?"behavior: boolean expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserBehavior)return i;let T=new $root.com.quick.voice.proto.UserBehavior;switch(i.type){default:if(typeof i.type=="number"){T.type=i.type;break}break;case"Microphone":case 0:T.type=0;break;case"Camera":case 1:T.type=1;break;case"Screen":case 2:T.type=2;break;case"SystemVoice":case 3:T.type=3;break}return i.behavior!=null&&(T.behavior=!!i.behavior),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.type=T.enums===String?"Microphone":0,A.behavior=!1),i.type!=null&&i.hasOwnProperty("type")&&(A.type=T.enums===String?$root.com.quick.voice.proto.TrackType[i.type]===void 0?i.type:$root.com.quick.voice.proto.TrackType[i.type]:i.type),i.behavior!=null&&i.hasOwnProperty("behavior")&&(A.behavior=i.behavior),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserBehavior"},C})(),F.PreventUser=(function(){function C(D){if(this.behaviors=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.id="",C.prototype.behaviors=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.id!=null&&Object.hasOwnProperty.call(i,"id")&&T.uint32(10).string(i.id),i.behaviors!=null&&i.behaviors.length)for(let A=0;A<i.behaviors.length;++A)$root.com.quick.voice.proto.UserBehavior.encode(i.behaviors[A],T.uint32(18).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.PreventUser;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.id=i.string();break}case 2:{j.behaviors&&j.behaviors.length||(j.behaviors=[]),j.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.id!=null&&i.hasOwnProperty("id")&&!$util.isString(i.id))return"id: string expected";if(i.behaviors!=null&&i.hasOwnProperty("behaviors")){if(!Array.isArray(i.behaviors))return"behaviors: array expected";for(let T=0;T<i.behaviors.length;++T){let A=$root.com.quick.voice.proto.UserBehavior.verify(i.behaviors[T]);if(A)return"behaviors."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUser)return i;let T=new $root.com.quick.voice.proto.PreventUser;if(i.id!=null&&(T.id=String(i.id)),i.behaviors){if(!Array.isArray(i.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");T.behaviors=[];for(let A=0;A<i.behaviors.length;++A){if(typeof i.behaviors[A]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");T.behaviors[A]=$root.com.quick.voice.proto.UserBehavior.fromObject(i.behaviors[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.behaviors=[]),T.defaults&&(A.id=""),i.id!=null&&i.hasOwnProperty("id")&&(A.id=i.id),i.behaviors&&i.behaviors.length){A.behaviors=[];for(let U=0;U<i.behaviors.length;++U)A.behaviors[U]=$root.com.quick.voice.proto.UserBehavior.toObject(i.behaviors[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUser"},C})(),F.PreventUsersBehaviorReq=(function(){function C(D){if(this.users=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.users=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let A=0;A<i.users.length;++A)$root.com.quick.voice.proto.PreventUser.encode(i.users[A],T.uint32(18).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.users&&j.users.length||(j.users=[]),j.users.push($root.com.quick.voice.proto.PreventUser.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let T=0;T<i.users.length;++T){let A=$root.com.quick.voice.proto.PreventUser.verify(i.users[T]);if(A)return"users."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return i;let T=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");T.users=[];for(let A=0;A<i.users.length;++A){if(typeof i.users[A]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");T.users[A]=$root.com.quick.voice.proto.PreventUser.fromObject(i.users[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.users=[]),T.defaults&&(A.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.users&&i.users.length){A.users=[];for(let U=0;U<i.users.length;++U)A.users[U]=$root.com.quick.voice.proto.PreventUser.toObject(i.users[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorReq"},C})(),F.PreventUsersBehaviorNotify=(function(){function C(D){if(this.users=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.users=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let A=0;A<i.users.length;++A)$root.com.quick.voice.proto.User.encode(i.users[A],T.uint32(18).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.users&&j.users.length||(j.users=[]),j.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let T=0;T<i.users.length;++T){let A=$root.com.quick.voice.proto.User.verify(i.users[T]);if(A)return"users."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return i;let T=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");T.users=[];for(let A=0;A<i.users.length;++A){if(typeof i.users[A]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");T.users[A]=$root.com.quick.voice.proto.User.fromObject(i.users[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.users=[]),T.defaults&&(A.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.users&&i.users.length){A.users=[];for(let U=0;U<i.users.length;++U)A.users[U]=$root.com.quick.voice.proto.User.toObject(i.users[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},C})(),F.AccelerationAreas=(function(){const C={},D=Object.create(C);return D[C[0]="chinaMainland"]=0,D[C[1]="global"]=1,D[C[2]="overseas"]=2,D})(),F.CountMethods=(function(){const C={},D=Object.create(C);return D[C[0]="flow"]=0,D[C[1]="minutes"]=1,D})(),F.BaseCDNAddress=(function(){function C(D){if(this.urlMap={},D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.area=0,C.prototype.countType=0,C.prototype.urlMap=$util.emptyObject,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.area!=null&&Object.hasOwnProperty.call(i,"area")&&T.uint32(8).int32(i.area),i.countType!=null&&Object.hasOwnProperty.call(i,"countType")&&T.uint32(16).int32(i.countType),i.urlMap!=null&&Object.hasOwnProperty.call(i,"urlMap"))for(let A=Object.keys(i.urlMap),U=0;U<A.length;++U)T.uint32(26).fork().uint32(10).string(A[U]).uint32(18).string(i.urlMap[A[U]]).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.BaseCDNAddress,z,K;for(;i.pos<U;){let Y=i.uint32();if(Y===A)break;switch(Y>>>3){case 1:{j.area=i.int32();break}case 2:{j.countType=i.int32();break}case 3:{j.urlMap===$util.emptyObject&&(j.urlMap={});let te=i.uint32()+i.pos;for(z="",K="";i.pos<te;){let ae=i.uint32();switch(ae>>>3){case 1:z=i.string();break;case 2:K=i.string();break;default:i.skipType(ae&7);break}}j.urlMap[z]=K;break}default:i.skipType(Y&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.area!=null&&i.hasOwnProperty("area"))switch(i.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(i.countType!=null&&i.hasOwnProperty("countType"))switch(i.countType){default:return"countType: enum value expected";case 0:case 1:break}if(i.urlMap!=null&&i.hasOwnProperty("urlMap")){if(!$util.isObject(i.urlMap))return"urlMap: object expected";let T=Object.keys(i.urlMap);for(let A=0;A<T.length;++A)if(!$util.isString(i.urlMap[T[A]]))return"urlMap: string{k:string} expected"}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.BaseCDNAddress)return i;let T=new $root.com.quick.voice.proto.BaseCDNAddress;switch(i.area){default:if(typeof i.area=="number"){T.area=i.area;break}break;case"chinaMainland":case 0:T.area=0;break;case"global":case 1:T.area=1;break;case"overseas":case 2:T.area=2;break}switch(i.countType){default:if(typeof i.countType=="number"){T.countType=i.countType;break}break;case"flow":case 0:T.countType=0;break;case"minutes":case 1:T.countType=1;break}if(i.urlMap){if(typeof i.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");T.urlMap={};for(let A=Object.keys(i.urlMap),U=0;U<A.length;++U)T.urlMap[A[U]]=String(i.urlMap[A[U]])}return T},C.toObject=function(i,T){T||(T={});let A={};(T.objects||T.defaults)&&(A.urlMap={}),T.defaults&&(A.area=T.enums===String?"chinaMainland":0,A.countType=T.enums===String?"flow":0),i.area!=null&&i.hasOwnProperty("area")&&(A.area=T.enums===String?$root.com.quick.voice.proto.AccelerationAreas[i.area]===void 0?i.area:$root.com.quick.voice.proto.AccelerationAreas[i.area]:i.area),i.countType!=null&&i.hasOwnProperty("countType")&&(A.countType=T.enums===String?$root.com.quick.voice.proto.CountMethods[i.countType]===void 0?i.countType:$root.com.quick.voice.proto.CountMethods[i.countType]:i.countType);let U;if(i.urlMap&&(U=Object.keys(i.urlMap)).length){A.urlMap={};for(let j=0;j<U.length;++j)A.urlMap[U[j]]=i.urlMap[U[j]]}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.BaseCDNAddress"},C})(),F.CDNPlayAddressNotify=(function(){function C(i){if(this.standLines=[],i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.roomId="",C.prototype.m3u8=null,C.prototype.rtmp=null,C.prototype.flv=null,C.prototype.rtmps=null,C.prototype.mainLine=null,C.prototype.standLines=$util.emptyArray;let D;return Object.defineProperty(C.prototype,"_m3u8",{get:$util.oneOfGetter(D=["m3u8"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_rtmp",{get:$util.oneOfGetter(D=["rtmp"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_flv",{get:$util.oneOfGetter(D=["flv"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_rtmps",{get:$util.oneOfGetter(D=["rtmps"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_mainLine",{get:$util.oneOfGetter(D=["mainLine"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){if(A||(A=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&A.uint32(10).string(T.roomId),T.m3u8!=null&&Object.hasOwnProperty.call(T,"m3u8")&&A.uint32(18).string(T.m3u8),T.rtmp!=null&&Object.hasOwnProperty.call(T,"rtmp")&&A.uint32(26).string(T.rtmp),T.flv!=null&&Object.hasOwnProperty.call(T,"flv")&&A.uint32(34).string(T.flv),T.rtmps!=null&&Object.hasOwnProperty.call(T,"rtmps")&&A.uint32(42).string(T.rtmps),T.mainLine!=null&&Object.hasOwnProperty.call(T,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(T.mainLine,A.uint32(50).fork()).ldelim(),T.standLines!=null&&T.standLines.length)for(let U=0;U<T.standLines.length;++U)$root.com.quick.voice.proto.BaseCDNAddress.encode(T.standLines[U],A.uint32(58).fork()).ldelim();return A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.m3u8=T.string();break}case 3:{z.rtmp=T.string();break}case 4:{z.flv=T.string();break}case 5:{z.rtmps=T.string();break}case 6:{z.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(T,T.uint32());break}case 7:{z.standLines&&z.standLines.length||(z.standLines=[]),z.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(T,T.uint32()));break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.m3u8!=null&&T.hasOwnProperty("m3u8")&&!$util.isString(T.m3u8))return"m3u8: string expected";if(T.rtmp!=null&&T.hasOwnProperty("rtmp")&&!$util.isString(T.rtmp))return"rtmp: string expected";if(T.flv!=null&&T.hasOwnProperty("flv")&&!$util.isString(T.flv))return"flv: string expected";if(T.rtmps!=null&&T.hasOwnProperty("rtmps")&&!$util.isString(T.rtmps))return"rtmps: string expected";if(T.mainLine!=null&&T.hasOwnProperty("mainLine")){let A=$root.com.quick.voice.proto.BaseCDNAddress.verify(T.mainLine);if(A)return"mainLine."+A}if(T.standLines!=null&&T.hasOwnProperty("standLines")){if(!Array.isArray(T.standLines))return"standLines: array expected";for(let A=0;A<T.standLines.length;++A){let U=$root.com.quick.voice.proto.BaseCDNAddress.verify(T.standLines[A]);if(U)return"standLines."+U}}return null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return T;let A=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(T.roomId!=null&&(A.roomId=String(T.roomId)),T.m3u8!=null&&(A.m3u8=String(T.m3u8)),T.rtmp!=null&&(A.rtmp=String(T.rtmp)),T.flv!=null&&(A.flv=String(T.flv)),T.rtmps!=null&&(A.rtmps=String(T.rtmps)),T.mainLine!=null){if(typeof T.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");A.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(T.mainLine)}if(T.standLines){if(!Array.isArray(T.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");A.standLines=[];for(let U=0;U<T.standLines.length;++U){if(typeof T.standLines[U]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");A.standLines[U]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(T.standLines[U])}}return A},C.toObject=function(T,A){A||(A={});let U={};if((A.arrays||A.defaults)&&(U.standLines=[]),A.defaults&&(U.roomId=""),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.m3u8!=null&&T.hasOwnProperty("m3u8")&&(U.m3u8=T.m3u8,A.oneofs&&(U._m3u8="m3u8")),T.rtmp!=null&&T.hasOwnProperty("rtmp")&&(U.rtmp=T.rtmp,A.oneofs&&(U._rtmp="rtmp")),T.flv!=null&&T.hasOwnProperty("flv")&&(U.flv=T.flv,A.oneofs&&(U._flv="flv")),T.rtmps!=null&&T.hasOwnProperty("rtmps")&&(U.rtmps=T.rtmps,A.oneofs&&(U._rtmps="rtmps")),T.mainLine!=null&&T.hasOwnProperty("mainLine")&&(U.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(T.mainLine,A),A.oneofs&&(U._mainLine="mainLine")),T.standLines&&T.standLines.length){U.standLines=[];for(let j=0;j<T.standLines.length;++j)U.standLines[j]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(T.standLines[j],A)}return U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.CDNPlayAddressNotify"},C})(),F.UserChannel=(function(){function C(D){if(this.channels=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.userId="",C.prototype.channels=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(10).string(i.userId),i.channels!=null&&i.channels.length)for(let A=0;A<i.channels.length;++A)$root.com.quick.voice.proto.DataChannel.encode(i.channels[A],T.uint32(18).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UserChannel;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.userId=i.string();break}case 2:{j.channels&&j.channels.length||(j.channels=[]),j.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId))return"userId: string expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let T=0;T<i.channels.length;++T){let A=$root.com.quick.voice.proto.DataChannel.verify(i.channels[T]);if(A)return"channels."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserChannel)return i;let T=new $root.com.quick.voice.proto.UserChannel;if(i.userId!=null&&(T.userId=String(i.userId)),i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");T.channels=[];for(let A=0;A<i.channels.length;++A){if(typeof i.channels[A]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");T.channels[A]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.channels=[]),T.defaults&&(A.userId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(A.userId=i.userId),i.channels&&i.channels.length){A.channels=[];for(let U=0;U<i.channels.length;++U)A.channels[U]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserChannel"},C})(),F.ChannelPublishReq=(function(){function C(D){if(this.channels=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.channels=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.channels!=null&&i.channels.length)for(let A=0;A<i.channels.length;++A)$root.com.quick.voice.proto.DataChannel.encode(i.channels[A],T.uint32(10).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ChannelPublishReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.channels&&j.channels.length||(j.channels=[]),j.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let T=0;T<i.channels.length;++T){let A=$root.com.quick.voice.proto.DataChannel.verify(i.channels[T]);if(A)return"channels."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishReq)return i;let T=new $root.com.quick.voice.proto.ChannelPublishReq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");T.channels=[];for(let A=0;A<i.channels.length;++A){if(typeof i.channels[A]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");T.channels[A]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.channels=[]),i.channels&&i.channels.length){A.channels=[];for(let U=0;U<i.channels.length;++U)A.channels[U]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishReq"},C})(),F.ChannelPublishRsq=(function(){function C(D){if(this.channels=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.channels=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.channels!=null&&i.channels.length)for(let A=0;A<i.channels.length;++A)$root.com.quick.voice.proto.UserChannel.encode(i.channels[A],T.uint32(10).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.channels&&j.channels.length||(j.channels=[]),j.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let T=0;T<i.channels.length;++T){let A=$root.com.quick.voice.proto.UserChannel.verify(i.channels[T]);if(A)return"channels."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return i;let T=new $root.com.quick.voice.proto.ChannelPublishRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");T.channels=[];for(let A=0;A<i.channels.length;++A){if(typeof i.channels[A]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");T.channels[A]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.channels=[]),i.channels&&i.channels.length){A.channels=[];for(let U=0;U<i.channels.length;++U)A.channels[U]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishRsq"},C})(),F.ChannelSubscribeReq=(function(){function C(D){if(this.users=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.users=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.users!=null&&i.users.length)for(let A=0;A<i.users.length;++A)$root.com.quick.voice.proto.UserChannel.encode(i.users[A],T.uint32(10).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.users&&j.users.length||(j.users=[]),j.users.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let T=0;T<i.users.length;++T){let A=$root.com.quick.voice.proto.UserChannel.verify(i.users[T]);if(A)return"users."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return i;let T=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");T.users=[];for(let A=0;A<i.users.length;++A){if(typeof i.users[A]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");T.users[A]=$root.com.quick.voice.proto.UserChannel.fromObject(i.users[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.users=[]),i.users&&i.users.length){A.users=[];for(let U=0;U<i.users.length;++U)A.users[U]=$root.com.quick.voice.proto.UserChannel.toObject(i.users[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeReq"},C})(),F.ChannelSubscribeRsq=(function(){function C(D){if(this.channels=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.channels=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.channels!=null&&i.channels.length)for(let A=0;A<i.channels.length;++A)$root.com.quick.voice.proto.UserChannel.encode(i.channels[A],T.uint32(10).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.channels&&j.channels.length||(j.channels=[]),j.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let T=0;T<i.channels.length;++T){let A=$root.com.quick.voice.proto.UserChannel.verify(i.channels[T]);if(A)return"channels."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return i;let T=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");T.channels=[];for(let A=0;A<i.channels.length;++A){if(typeof i.channels[A]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");T.channels[A]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.channels=[]),i.channels&&i.channels.length){A.channels=[];for(let U=0;U<i.channels.length;++U)A.channels[U]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeRsq"},C})(),F.DataChannelData=(function(){function C(i){if(i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.userId="",C.prototype.type=0,C.prototype.audioData=null;let D;return Object.defineProperty(C.prototype,"_audioData",{get:$util.oneOfGetter(D=["audioData"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){return A||(A=$Writer.create()),T.userId!=null&&Object.hasOwnProperty.call(T,"userId")&&A.uint32(10).string(T.userId),T.type!=null&&Object.hasOwnProperty.call(T,"type")&&A.uint32(16).int32(T.type),T.audioData!=null&&Object.hasOwnProperty.call(T,"audioData")&&$root.com.quick.voice.proto.DataChannelAudioData.encode(T.audioData,A.uint32(26).fork()).ldelim(),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.DataChannelData;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.userId=T.string();break}case 2:{z.type=T.int32();break}case 3:{z.audioData=$root.com.quick.voice.proto.DataChannelAudioData.decode(T,T.uint32());break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.userId!=null&&T.hasOwnProperty("userId")&&!$util.isString(T.userId))return"userId: string expected";if(T.type!=null&&T.hasOwnProperty("type"))switch(T.type){default:return"type: enum value expected";case 0:break}if(T.audioData!=null&&T.hasOwnProperty("audioData")){let A=$root.com.quick.voice.proto.DataChannelAudioData.verify(T.audioData);if(A)return"audioData."+A}return null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.DataChannelData)return T;let A=new $root.com.quick.voice.proto.DataChannelData;switch(T.userId!=null&&(A.userId=String(T.userId)),T.type){default:if(typeof T.type=="number"){A.type=T.type;break}break;case"backAuido":case 0:A.type=0;break}if(T.audioData!=null){if(typeof T.audioData!="object")throw TypeError(".com.quick.voice.proto.DataChannelData.audioData: object expected");A.audioData=$root.com.quick.voice.proto.DataChannelAudioData.fromObject(T.audioData)}return A},C.toObject=function(T,A){A||(A={});let U={};return A.defaults&&(U.userId="",U.type=A.enums===String?"backAuido":0),T.userId!=null&&T.hasOwnProperty("userId")&&(U.userId=T.userId),T.type!=null&&T.hasOwnProperty("type")&&(U.type=A.enums===String?$root.com.quick.voice.proto.DataChannelType[T.type]===void 0?T.type:$root.com.quick.voice.proto.DataChannelType[T.type]:T.type),T.audioData!=null&&T.hasOwnProperty("audioData")&&(U.audioData=$root.com.quick.voice.proto.DataChannelAudioData.toObject(T.audioData,A),A.oneofs&&(U._audioData="audioData")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.DataChannelData"},C})(),F.DataChannelType=(function(){const C={},D=Object.create(C);return D[C[0]="backAuido"]=0,D})(),F.DataChannelAudioData=(function(){function C(i){if(i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.data=$util.newBuffer([]),C.prototype.format=null,C.prototype.time=null;let D;return Object.defineProperty(C.prototype,"_time",{get:$util.oneOfGetter(D=["time"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){return A||(A=$Writer.create()),T.data!=null&&Object.hasOwnProperty.call(T,"data")&&A.uint32(10).bytes(T.data),T.format!=null&&Object.hasOwnProperty.call(T,"format")&&$root.com.quick.voice.proto.DataChannelAudioFormat.encode(T.format,A.uint32(18).fork()).ldelim(),T.time!=null&&Object.hasOwnProperty.call(T,"time")&&A.uint32(24).int64(T.time),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.DataChannelAudioData;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.data=T.bytes();break}case 2:{z.format=$root.com.quick.voice.proto.DataChannelAudioFormat.decode(T,T.uint32());break}case 3:{z.time=T.int64();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.data!=null&&T.hasOwnProperty("data")&&!(T.data&&typeof T.data.length=="number"||$util.isString(T.data)))return"data: buffer expected";if(T.format!=null&&T.hasOwnProperty("format")){let A=$root.com.quick.voice.proto.DataChannelAudioFormat.verify(T.format);if(A)return"format."+A}return T.time!=null&&T.hasOwnProperty("time")&&!$util.isInteger(T.time)&&!(T.time&&$util.isInteger(T.time.low)&&$util.isInteger(T.time.high))?"time: integer|Long expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.DataChannelAudioData)return T;let A=new $root.com.quick.voice.proto.DataChannelAudioData;if(T.data!=null&&(typeof T.data=="string"?$util.base64.decode(T.data,A.data=$util.newBuffer($util.base64.length(T.data)),0):T.data.length>=0&&(A.data=T.data)),T.format!=null){if(typeof T.format!="object")throw TypeError(".com.quick.voice.proto.DataChannelAudioData.format: object expected");A.format=$root.com.quick.voice.proto.DataChannelAudioFormat.fromObject(T.format)}return T.time!=null&&($util.Long?(A.time=$util.Long.fromValue(T.time)).unsigned=!1:typeof T.time=="string"?A.time=parseInt(T.time,10):typeof T.time=="number"?A.time=T.time:typeof T.time=="object"&&(A.time=new $util.LongBits(T.time.low>>>0,T.time.high>>>0).toNumber())),A},C.toObject=function(T,A){A||(A={});let U={};return A.defaults&&(A.bytes===String?U.data="":(U.data=[],A.bytes!==Array&&(U.data=$util.newBuffer(U.data))),U.format=null),T.data!=null&&T.hasOwnProperty("data")&&(U.data=A.bytes===String?$util.base64.encode(T.data,0,T.data.length):A.bytes===Array?Array.prototype.slice.call(T.data):T.data),T.format!=null&&T.hasOwnProperty("format")&&(U.format=$root.com.quick.voice.proto.DataChannelAudioFormat.toObject(T.format,A)),T.time!=null&&T.hasOwnProperty("time")&&(typeof T.time=="number"?U.time=A.longs===String?String(T.time):T.time:U.time=A.longs===String?$util.Long.prototype.toString.call(T.time):A.longs===Number?new $util.LongBits(T.time.low>>>0,T.time.high>>>0).toNumber():T.time,A.oneofs&&(U._time="time")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.DataChannelAudioData"},C})(),F.DataChannelAudioFormat=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.sampleRate=0,C.prototype.channels=0,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.sampleRate!=null&&Object.hasOwnProperty.call(i,"sampleRate")&&T.uint32(9).double(i.sampleRate),i.channels!=null&&Object.hasOwnProperty.call(i,"channels")&&T.uint32(16).int32(i.channels),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.DataChannelAudioFormat;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.sampleRate=i.double();break}case 2:{j.channels=i.int32();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&typeof i.sampleRate!="number"?"sampleRate: number expected":i.channels!=null&&i.hasOwnProperty("channels")&&!$util.isInteger(i.channels)?"channels: integer expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelAudioFormat)return i;let T=new $root.com.quick.voice.proto.DataChannelAudioFormat;return i.sampleRate!=null&&(T.sampleRate=Number(i.sampleRate)),i.channels!=null&&(T.channels=i.channels|0),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.sampleRate=0,A.channels=0),i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&(A.sampleRate=T.json&&!isFinite(i.sampleRate)?String(i.sampleRate):i.sampleRate),i.channels!=null&&i.hasOwnProperty("channels")&&(A.channels=i.channels),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelAudioFormat"},C})(),F.AckMsgReq=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.msgId=$util.Long?$util.Long.fromBits(0,0,!1):0,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.msgId!=null&&Object.hasOwnProperty.call(i,"msgId")&&T.uint32(8).int64(i.msgId),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.AckMsgReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.msgId=i.int64();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.msgId!=null&&i.hasOwnProperty("msgId")&&!$util.isInteger(i.msgId)&&!(i.msgId&&$util.isInteger(i.msgId.low)&&$util.isInteger(i.msgId.high))?"msgId: integer|Long expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.AckMsgReq)return i;let T=new $root.com.quick.voice.proto.AckMsgReq;return i.msgId!=null&&($util.Long?(T.msgId=$util.Long.fromValue(i.msgId)).unsigned=!1:typeof i.msgId=="string"?T.msgId=parseInt(i.msgId,10):typeof i.msgId=="number"?T.msgId=i.msgId:typeof i.msgId=="object"&&(T.msgId=new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber())),T},C.toObject=function(i,T){T||(T={});let A={};if(T.defaults)if($util.Long){let U=new $util.Long(0,0,!1);A.msgId=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else A.msgId=T.longs===String?"0":0;return i.msgId!=null&&i.hasOwnProperty("msgId")&&(typeof i.msgId=="number"?A.msgId=T.longs===String?String(i.msgId):i.msgId:A.msgId=T.longs===String?$util.Long.prototype.toString.call(i.msgId):T.longs===Number?new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber():i.msgId),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.AckMsgReq"},C})(),F.SdpConsult=(function(){function C(i){if(this.tracks=[],i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.roomId="",C.prototype.sender=null,C.prototype.receiverId="",C.prototype.sdp="",C.prototype.tracks=$util.emptyArray;let D;return Object.defineProperty(C.prototype,"_sender",{get:$util.oneOfGetter(D=["sender"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){if(A||(A=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&A.uint32(10).string(T.roomId),T.sender!=null&&Object.hasOwnProperty.call(T,"sender")&&$root.com.quick.voice.proto.User.encode(T.sender,A.uint32(18).fork()).ldelim(),T.receiverId!=null&&Object.hasOwnProperty.call(T,"receiverId")&&A.uint32(26).string(T.receiverId),T.sdp!=null&&Object.hasOwnProperty.call(T,"sdp")&&A.uint32(34).string(T.sdp),T.tracks!=null&&T.tracks.length)for(let U=0;U<T.tracks.length;++U)$root.com.quick.voice.proto.Track.encode(T.tracks[U],A.uint32(42).fork()).ldelim();return A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.SdpConsult;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.sender=$root.com.quick.voice.proto.User.decode(T,T.uint32());break}case 3:{z.receiverId=T.string();break}case 4:{z.sdp=T.string();break}case 5:{z.tracks&&z.tracks.length||(z.tracks=[]),z.tracks.push($root.com.quick.voice.proto.Track.decode(T,T.uint32()));break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.sender!=null&&T.hasOwnProperty("sender")){let A=$root.com.quick.voice.proto.User.verify(T.sender);if(A)return"sender."+A}if(T.receiverId!=null&&T.hasOwnProperty("receiverId")&&!$util.isString(T.receiverId))return"receiverId: string expected";if(T.sdp!=null&&T.hasOwnProperty("sdp")&&!$util.isString(T.sdp))return"sdp: string expected";if(T.tracks!=null&&T.hasOwnProperty("tracks")){if(!Array.isArray(T.tracks))return"tracks: array expected";for(let A=0;A<T.tracks.length;++A){let U=$root.com.quick.voice.proto.Track.verify(T.tracks[A]);if(U)return"tracks."+U}}return null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.SdpConsult)return T;let A=new $root.com.quick.voice.proto.SdpConsult;if(T.roomId!=null&&(A.roomId=String(T.roomId)),T.sender!=null){if(typeof T.sender!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.sender: object expected");A.sender=$root.com.quick.voice.proto.User.fromObject(T.sender)}if(T.receiverId!=null&&(A.receiverId=String(T.receiverId)),T.sdp!=null&&(A.sdp=String(T.sdp)),T.tracks){if(!Array.isArray(T.tracks))throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: array expected");A.tracks=[];for(let U=0;U<T.tracks.length;++U){if(typeof T.tracks[U]!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: object expected");A.tracks[U]=$root.com.quick.voice.proto.Track.fromObject(T.tracks[U])}}return A},C.toObject=function(T,A){A||(A={});let U={};if((A.arrays||A.defaults)&&(U.tracks=[]),A.defaults&&(U.roomId="",U.receiverId="",U.sdp=""),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.sender!=null&&T.hasOwnProperty("sender")&&(U.sender=$root.com.quick.voice.proto.User.toObject(T.sender,A),A.oneofs&&(U._sender="sender")),T.receiverId!=null&&T.hasOwnProperty("receiverId")&&(U.receiverId=T.receiverId),T.sdp!=null&&T.hasOwnProperty("sdp")&&(U.sdp=T.sdp),T.tracks&&T.tracks.length){U.tracks=[];for(let j=0;j<T.tracks.length;++j)U.tracks[j]=$root.com.quick.voice.proto.Track.toObject(T.tracks[j],A)}return U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.SdpConsult"},C})(),F.Candidate=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.sdpMid="",C.prototype.sdpMLineIndex=0,C.prototype.sdp="",C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.sdpMid!=null&&Object.hasOwnProperty.call(i,"sdpMid")&&T.uint32(10).string(i.sdpMid),i.sdpMLineIndex!=null&&Object.hasOwnProperty.call(i,"sdpMLineIndex")&&T.uint32(16).int32(i.sdpMLineIndex),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&T.uint32(26).string(i.sdp),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.Candidate;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.sdpMid=i.string();break}case 2:{j.sdpMLineIndex=i.int32();break}case 3:{j.sdp=i.string();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sdpMid!=null&&i.hasOwnProperty("sdpMid")&&!$util.isString(i.sdpMid)?"sdpMid: string expected":i.sdpMLineIndex!=null&&i.hasOwnProperty("sdpMLineIndex")&&!$util.isInteger(i.sdpMLineIndex)?"sdpMLineIndex: integer expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidate)return i;let T=new $root.com.quick.voice.proto.Candidate;return i.sdpMid!=null&&(T.sdpMid=String(i.sdpMid)),i.sdpMLineIndex!=null&&(T.sdpMLineIndex=i.sdpMLineIndex|0),i.sdp!=null&&(T.sdp=String(i.sdp)),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.sdpMid="",A.sdpMLineIndex=0,A.sdp=""),i.sdpMid!=null&&i.hasOwnProperty("sdpMid")&&(A.sdpMid=i.sdpMid),i.sdpMLineIndex!=null&&i.hasOwnProperty("sdpMLineIndex")&&(A.sdpMLineIndex=i.sdpMLineIndex),i.sdp!=null&&i.hasOwnProperty("sdp")&&(A.sdp=i.sdp),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidate"},C})(),F.Candidates=(function(){function C(D){if(this.candidates=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.senderId="",C.prototype.receiverId="",C.prototype.candidates=$util.emptyArray,C.prototype.isSubscribeReceiver=!1,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.senderId!=null&&Object.hasOwnProperty.call(i,"senderId")&&T.uint32(18).string(i.senderId),i.receiverId!=null&&Object.hasOwnProperty.call(i,"receiverId")&&T.uint32(26).string(i.receiverId),i.candidates!=null&&i.candidates.length)for(let A=0;A<i.candidates.length;++A)$root.com.quick.voice.proto.Candidate.encode(i.candidates[A],T.uint32(34).fork()).ldelim();return i.isSubscribeReceiver!=null&&Object.hasOwnProperty.call(i,"isSubscribeReceiver")&&T.uint32(40).bool(i.isSubscribeReceiver),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.Candidates;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.senderId=i.string();break}case 3:{j.receiverId=i.string();break}case 4:{j.candidates&&j.candidates.length||(j.candidates=[]),j.candidates.push($root.com.quick.voice.proto.Candidate.decode(i,i.uint32()));break}case 5:{j.isSubscribeReceiver=i.bool();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.senderId!=null&&i.hasOwnProperty("senderId")&&!$util.isString(i.senderId))return"senderId: string expected";if(i.receiverId!=null&&i.hasOwnProperty("receiverId")&&!$util.isString(i.receiverId))return"receiverId: string expected";if(i.candidates!=null&&i.hasOwnProperty("candidates")){if(!Array.isArray(i.candidates))return"candidates: array expected";for(let T=0;T<i.candidates.length;++T){let A=$root.com.quick.voice.proto.Candidate.verify(i.candidates[T]);if(A)return"candidates."+A}}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&typeof i.isSubscribeReceiver!="boolean"?"isSubscribeReceiver: boolean expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidates)return i;let T=new $root.com.quick.voice.proto.Candidates;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.senderId!=null&&(T.senderId=String(i.senderId)),i.receiverId!=null&&(T.receiverId=String(i.receiverId)),i.candidates){if(!Array.isArray(i.candidates))throw TypeError(".com.quick.voice.proto.Candidates.candidates: array expected");T.candidates=[];for(let A=0;A<i.candidates.length;++A){if(typeof i.candidates[A]!="object")throw TypeError(".com.quick.voice.proto.Candidates.candidates: object expected");T.candidates[A]=$root.com.quick.voice.proto.Candidate.fromObject(i.candidates[A])}}return i.isSubscribeReceiver!=null&&(T.isSubscribeReceiver=!!i.isSubscribeReceiver),T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.candidates=[]),T.defaults&&(A.roomId="",A.senderId="",A.receiverId="",A.isSubscribeReceiver=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.senderId!=null&&i.hasOwnProperty("senderId")&&(A.senderId=i.senderId),i.receiverId!=null&&i.hasOwnProperty("receiverId")&&(A.receiverId=i.receiverId),i.candidates&&i.candidates.length){A.candidates=[];for(let U=0;U<i.candidates.length;++U)A.candidates[U]=$root.com.quick.voice.proto.Candidate.toObject(i.candidates[U],T)}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&(A.isSubscribeReceiver=i.isSubscribeReceiver),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidates"},C})(),F.NatType=(function(){const C={},D=Object.create(C);return D[C[0]="Symmetric"]=0,D[C[1]="Cone"]=1,D[C[2]="Port"]=2,D[C[3]="IP"]=3,D[C[4]="UnKnown"]=4,D})(),F.NetworkType=(function(){const C={},D=Object.create(C);return D[C[0]="Wifi"]=0,D[C[1]="Wired"]=1,D[C[2]="Mobile"]=2,D})(),F.ReportNetInfo=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.nat=0,C.prototype.type=0,C.prototype.ip="",C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.nat!=null&&Object.hasOwnProperty.call(i,"nat")&&T.uint32(8).int32(i.nat),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&T.uint32(16).int32(i.type),i.ip!=null&&Object.hasOwnProperty.call(i,"ip")&&T.uint32(26).string(i.ip),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.ReportNetInfo;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.nat=i.int32();break}case 2:{j.type=i.int32();break}case 3:{j.ip=i.string();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.nat!=null&&i.hasOwnProperty("nat"))switch(i.nat){default:return"nat: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:break}return i.ip!=null&&i.hasOwnProperty("ip")&&!$util.isString(i.ip)?"ip: string expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ReportNetInfo)return i;let T=new $root.com.quick.voice.proto.ReportNetInfo;switch(i.nat){default:if(typeof i.nat=="number"){T.nat=i.nat;break}break;case"Symmetric":case 0:T.nat=0;break;case"Cone":case 1:T.nat=1;break;case"Port":case 2:T.nat=2;break;case"IP":case 3:T.nat=3;break;case"UnKnown":case 4:T.nat=4;break}switch(i.type){default:if(typeof i.type=="number"){T.type=i.type;break}break;case"Wifi":case 0:T.type=0;break;case"Wired":case 1:T.type=1;break;case"Mobile":case 2:T.type=2;break}return i.ip!=null&&(T.ip=String(i.ip)),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.nat=T.enums===String?"Symmetric":0,A.type=T.enums===String?"Wifi":0,A.ip=""),i.nat!=null&&i.hasOwnProperty("nat")&&(A.nat=T.enums===String?$root.com.quick.voice.proto.NatType[i.nat]===void 0?i.nat:$root.com.quick.voice.proto.NatType[i.nat]:i.nat),i.type!=null&&i.hasOwnProperty("type")&&(A.type=T.enums===String?$root.com.quick.voice.proto.NetworkType[i.type]===void 0?i.type:$root.com.quick.voice.proto.NetworkType[i.type]:i.type),i.ip!=null&&i.hasOwnProperty("ip")&&(A.ip=i.ip),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ReportNetInfo"},C})(),F.P2PCode=(function(){const C={},D=Object.create(C);return D[C[0]="Success"]=0,D[C[1]="Failed"]=1,D[C[2]="Ignore"]=2,D[C[3]="Disconnected"]=3,D[C[4]="LowQuality"]=4,D})(),F.ReportTrafficUsage=(function(){function C(i){if(i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.p2pPush=null,C.prototype.p2pPull=null,C.prototype.sfuPush=null,C.prototype.sfuPull=null;let D;return Object.defineProperty(C.prototype,"_p2pPush",{get:$util.oneOfGetter(D=["p2pPush"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_p2pPull",{get:$util.oneOfGetter(D=["p2pPull"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_sfuPush",{get:$util.oneOfGetter(D=["sfuPush"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_sfuPull",{get:$util.oneOfGetter(D=["sfuPull"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){return A||(A=$Writer.create()),T.p2pPush!=null&&Object.hasOwnProperty.call(T,"p2pPush")&&A.uint32(8).int64(T.p2pPush),T.p2pPull!=null&&Object.hasOwnProperty.call(T,"p2pPull")&&A.uint32(16).int64(T.p2pPull),T.sfuPush!=null&&Object.hasOwnProperty.call(T,"sfuPush")&&A.uint32(24).int64(T.sfuPush),T.sfuPull!=null&&Object.hasOwnProperty.call(T,"sfuPull")&&A.uint32(32).int64(T.sfuPull),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.ReportTrafficUsage;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.p2pPush=T.int64();break}case 2:{z.p2pPull=T.int64();break}case 3:{z.sfuPush=T.int64();break}case 4:{z.sfuPull=T.int64();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){return typeof T!="object"||T===null?"object expected":T.p2pPush!=null&&T.hasOwnProperty("p2pPush")&&!$util.isInteger(T.p2pPush)&&!(T.p2pPush&&$util.isInteger(T.p2pPush.low)&&$util.isInteger(T.p2pPush.high))?"p2pPush: integer|Long expected":T.p2pPull!=null&&T.hasOwnProperty("p2pPull")&&!$util.isInteger(T.p2pPull)&&!(T.p2pPull&&$util.isInteger(T.p2pPull.low)&&$util.isInteger(T.p2pPull.high))?"p2pPull: integer|Long expected":T.sfuPush!=null&&T.hasOwnProperty("sfuPush")&&!$util.isInteger(T.sfuPush)&&!(T.sfuPush&&$util.isInteger(T.sfuPush.low)&&$util.isInteger(T.sfuPush.high))?"sfuPush: integer|Long expected":T.sfuPull!=null&&T.hasOwnProperty("sfuPull")&&!$util.isInteger(T.sfuPull)&&!(T.sfuPull&&$util.isInteger(T.sfuPull.low)&&$util.isInteger(T.sfuPull.high))?"sfuPull: integer|Long expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.ReportTrafficUsage)return T;let A=new $root.com.quick.voice.proto.ReportTrafficUsage;return T.p2pPush!=null&&($util.Long?(A.p2pPush=$util.Long.fromValue(T.p2pPush)).unsigned=!1:typeof T.p2pPush=="string"?A.p2pPush=parseInt(T.p2pPush,10):typeof T.p2pPush=="number"?A.p2pPush=T.p2pPush:typeof T.p2pPush=="object"&&(A.p2pPush=new $util.LongBits(T.p2pPush.low>>>0,T.p2pPush.high>>>0).toNumber())),T.p2pPull!=null&&($util.Long?(A.p2pPull=$util.Long.fromValue(T.p2pPull)).unsigned=!1:typeof T.p2pPull=="string"?A.p2pPull=parseInt(T.p2pPull,10):typeof T.p2pPull=="number"?A.p2pPull=T.p2pPull:typeof T.p2pPull=="object"&&(A.p2pPull=new $util.LongBits(T.p2pPull.low>>>0,T.p2pPull.high>>>0).toNumber())),T.sfuPush!=null&&($util.Long?(A.sfuPush=$util.Long.fromValue(T.sfuPush)).unsigned=!1:typeof T.sfuPush=="string"?A.sfuPush=parseInt(T.sfuPush,10):typeof T.sfuPush=="number"?A.sfuPush=T.sfuPush:typeof T.sfuPush=="object"&&(A.sfuPush=new $util.LongBits(T.sfuPush.low>>>0,T.sfuPush.high>>>0).toNumber())),T.sfuPull!=null&&($util.Long?(A.sfuPull=$util.Long.fromValue(T.sfuPull)).unsigned=!1:typeof T.sfuPull=="string"?A.sfuPull=parseInt(T.sfuPull,10):typeof T.sfuPull=="number"?A.sfuPull=T.sfuPull:typeof T.sfuPull=="object"&&(A.sfuPull=new $util.LongBits(T.sfuPull.low>>>0,T.sfuPull.high>>>0).toNumber())),A},C.toObject=function(T,A){A||(A={});let U={};return T.p2pPush!=null&&T.hasOwnProperty("p2pPush")&&(typeof T.p2pPush=="number"?U.p2pPush=A.longs===String?String(T.p2pPush):T.p2pPush:U.p2pPush=A.longs===String?$util.Long.prototype.toString.call(T.p2pPush):A.longs===Number?new $util.LongBits(T.p2pPush.low>>>0,T.p2pPush.high>>>0).toNumber():T.p2pPush,A.oneofs&&(U._p2pPush="p2pPush")),T.p2pPull!=null&&T.hasOwnProperty("p2pPull")&&(typeof T.p2pPull=="number"?U.p2pPull=A.longs===String?String(T.p2pPull):T.p2pPull:U.p2pPull=A.longs===String?$util.Long.prototype.toString.call(T.p2pPull):A.longs===Number?new $util.LongBits(T.p2pPull.low>>>0,T.p2pPull.high>>>0).toNumber():T.p2pPull,A.oneofs&&(U._p2pPull="p2pPull")),T.sfuPush!=null&&T.hasOwnProperty("sfuPush")&&(typeof T.sfuPush=="number"?U.sfuPush=A.longs===String?String(T.sfuPush):T.sfuPush:U.sfuPush=A.longs===String?$util.Long.prototype.toString.call(T.sfuPush):A.longs===Number?new $util.LongBits(T.sfuPush.low>>>0,T.sfuPush.high>>>0).toNumber():T.sfuPush,A.oneofs&&(U._sfuPush="sfuPush")),T.sfuPull!=null&&T.hasOwnProperty("sfuPull")&&(typeof T.sfuPull=="number"?U.sfuPull=A.longs===String?String(T.sfuPull):T.sfuPull:U.sfuPull=A.longs===String?$util.Long.prototype.toString.call(T.sfuPull):A.longs===Number?new $util.LongBits(T.sfuPull.low>>>0,T.sfuPull.high>>>0).toNumber():T.sfuPull,A.oneofs&&(U._sfuPull="sfuPull")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.ReportTrafficUsage"},C})(),F.CheckSessionReq=(function(){function C(D){if(this.tracks=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.session="",C.prototype.tracks=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.session!=null&&Object.hasOwnProperty.call(i,"session")&&T.uint32(10).string(i.session),i.tracks!=null&&i.tracks.length)for(let A=0;A<i.tracks.length;++A)$root.com.quick.voice.proto.Track.encode(i.tracks[A],T.uint32(18).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CheckSessionReq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.session=i.string();break}case 2:{j.tracks&&j.tracks.length||(j.tracks=[]),j.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.session!=null&&i.hasOwnProperty("session")&&!$util.isString(i.session))return"session: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let T=0;T<i.tracks.length;++T){let A=$root.com.quick.voice.proto.Track.verify(i.tracks[T]);if(A)return"tracks."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CheckSessionReq)return i;let T=new $root.com.quick.voice.proto.CheckSessionReq;if(i.session!=null&&(T.session=String(i.session)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: array expected");T.tracks=[];for(let A=0;A<i.tracks.length;++A){if(typeof i.tracks[A]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: object expected");T.tracks[A]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.tracks=[]),T.defaults&&(A.session=""),i.session!=null&&i.hasOwnProperty("session")&&(A.session=i.session),i.tracks&&i.tracks.length){A.tracks=[];for(let U=0;U<i.tracks.length;++U)A.tracks[U]=$root.com.quick.voice.proto.Track.toObject(i.tracks[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CheckSessionReq"},C})(),F.CheckSessionRsq=(function(){function C(D){if(this.tracks=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.sessionIsValid=!1,C.prototype.tracks=$util.emptyArray,C.prototype.session="",C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.sessionIsValid!=null&&Object.hasOwnProperty.call(i,"sessionIsValid")&&T.uint32(8).bool(i.sessionIsValid),i.tracks!=null&&i.tracks.length)for(let A=0;A<i.tracks.length;++A)$root.com.quick.voice.proto.Track.encode(i.tracks[A],T.uint32(18).fork()).ldelim();return i.session!=null&&Object.hasOwnProperty.call(i,"session")&&T.uint32(26).string(i.session),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.CheckSessionRsq;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.sessionIsValid=i.bool();break}case 2:{j.tracks&&j.tracks.length||(j.tracks=[]),j.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{j.session=i.string();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.sessionIsValid!=null&&i.hasOwnProperty("sessionIsValid")&&typeof i.sessionIsValid!="boolean")return"sessionIsValid: boolean expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let T=0;T<i.tracks.length;++T){let A=$root.com.quick.voice.proto.Track.verify(i.tracks[T]);if(A)return"tracks."+A}}return i.session!=null&&i.hasOwnProperty("session")&&!$util.isString(i.session)?"session: string expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CheckSessionRsq)return i;let T=new $root.com.quick.voice.proto.CheckSessionRsq;if(i.sessionIsValid!=null&&(T.sessionIsValid=!!i.sessionIsValid),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: array expected");T.tracks=[];for(let A=0;A<i.tracks.length;++A){if(typeof i.tracks[A]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: object expected");T.tracks[A]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[A])}}return i.session!=null&&(T.session=String(i.session)),T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.tracks=[]),T.defaults&&(A.sessionIsValid=!1,A.session=""),i.sessionIsValid!=null&&i.hasOwnProperty("sessionIsValid")&&(A.sessionIsValid=i.sessionIsValid),i.tracks&&i.tracks.length){A.tracks=[];for(let U=0;U<i.tracks.length;++U)A.tracks[U]=$root.com.quick.voice.proto.Track.toObject(i.tracks[U],T)}return i.session!=null&&i.hasOwnProperty("session")&&(A.session=i.session),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CheckSessionRsq"},C})(),F.RoomSpeechNotify=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.userId="",C.prototype.text="",C.prototype.timestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(18).string(i.userId),i.text!=null&&Object.hasOwnProperty.call(i,"text")&&T.uint32(26).string(i.text),i.timestamp!=null&&Object.hasOwnProperty.call(i,"timestamp")&&T.uint32(32).int64(i.timestamp),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.RoomSpeechNotify;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.userId=i.string();break}case 3:{j.text=i.string();break}case 4:{j.timestamp=i.int64();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.text!=null&&i.hasOwnProperty("text")&&!$util.isString(i.text)?"text: string expected":i.timestamp!=null&&i.hasOwnProperty("timestamp")&&!$util.isInteger(i.timestamp)&&!(i.timestamp&&$util.isInteger(i.timestamp.low)&&$util.isInteger(i.timestamp.high))?"timestamp: integer|Long expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RoomSpeechNotify)return i;let T=new $root.com.quick.voice.proto.RoomSpeechNotify;return i.roomId!=null&&(T.roomId=String(i.roomId)),i.userId!=null&&(T.userId=String(i.userId)),i.text!=null&&(T.text=String(i.text)),i.timestamp!=null&&($util.Long?(T.timestamp=$util.Long.fromValue(i.timestamp)).unsigned=!1:typeof i.timestamp=="string"?T.timestamp=parseInt(i.timestamp,10):typeof i.timestamp=="number"?T.timestamp=i.timestamp:typeof i.timestamp=="object"&&(T.timestamp=new $util.LongBits(i.timestamp.low>>>0,i.timestamp.high>>>0).toNumber())),T},C.toObject=function(i,T){T||(T={});let A={};if(T.defaults)if(A.roomId="",A.userId="",A.text="",$util.Long){let U=new $util.Long(0,0,!1);A.timestamp=T.longs===String?U.toString():T.longs===Number?U.toNumber():U}else A.timestamp=T.longs===String?"0":0;return i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.userId!=null&&i.hasOwnProperty("userId")&&(A.userId=i.userId),i.text!=null&&i.hasOwnProperty("text")&&(A.text=i.text),i.timestamp!=null&&i.hasOwnProperty("timestamp")&&(typeof i.timestamp=="number"?A.timestamp=T.longs===String?String(i.timestamp):i.timestamp:A.timestamp=T.longs===String?$util.Long.prototype.toString.call(i.timestamp):T.longs===Number?new $util.LongBits(i.timestamp.low>>>0,i.timestamp.high>>>0).toNumber():i.timestamp),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RoomSpeechNotify"},C})(),F.AiLangSetting=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.input="",C.prototype.output="",C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.input!=null&&Object.hasOwnProperty.call(i,"input")&&T.uint32(10).string(i.input),i.output!=null&&Object.hasOwnProperty.call(i,"output")&&T.uint32(18).string(i.output),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.AiLangSetting;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.input=i.string();break}case 2:{j.output=i.string();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){return typeof i!="object"||i===null?"object expected":i.input!=null&&i.hasOwnProperty("input")&&!$util.isString(i.input)?"input: string expected":i.output!=null&&i.hasOwnProperty("output")&&!$util.isString(i.output)?"output: string expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.AiLangSetting)return i;let T=new $root.com.quick.voice.proto.AiLangSetting;return i.input!=null&&(T.input=String(i.input)),i.output!=null&&(T.output=String(i.output)),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.input="",A.output=""),i.input!=null&&i.hasOwnProperty("input")&&(A.input=i.input),i.output!=null&&i.hasOwnProperty("output")&&(A.output=i.output),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.AiLangSetting"},C})(),F.P2PIgnoreReason=(function(){const C={},D=Object.create(C);return D[C[0]="CHANNEL_LIMIT"]=0,D[C[1]="SUBSCRIBE_NOT_EXIST"]=1,D[C[2]="Busying"]=2,D[C[3]="TRACK_NOT_EXIST"]=3,D[C[4]="OTHER"]=4,D})(),F.P2PAvailablePeerNotify=(function(){function C(D){if(this.types=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.pushId="",C.prototype.types=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.pushId!=null&&Object.hasOwnProperty.call(i,"pushId")&&T.uint32(18).string(i.pushId),i.types!=null&&i.types.length){T.uint32(26).fork();for(let A=0;A<i.types.length;++A)T.int32(i.types[A]);T.ldelim()}return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.P2PAvailablePeerNotify;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.pushId=i.string();break}case 3:{if(j.types&&j.types.length||(j.types=[]),(z&7)===2){let K=i.uint32()+i.pos;for(;i.pos<K;)j.types.push(i.int32())}else j.types.push(i.int32());break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.pushId!=null&&i.hasOwnProperty("pushId")&&!$util.isString(i.pushId))return"pushId: string expected";if(i.types!=null&&i.hasOwnProperty("types")){if(!Array.isArray(i.types))return"types: array expected";for(let T=0;T<i.types.length;++T)switch(i.types[T]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.P2PAvailablePeerNotify)return i;let T=new $root.com.quick.voice.proto.P2PAvailablePeerNotify;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.pushId!=null&&(T.pushId=String(i.pushId)),i.types){if(!Array.isArray(i.types))throw TypeError(".com.quick.voice.proto.P2PAvailablePeerNotify.types: array expected");T.types=[];for(let A=0;A<i.types.length;++A)switch(i.types[A]){default:if(typeof i.types[A]=="number"){T.types[A]=i.types[A];break}case"Microphone":case 0:T.types[A]=0;break;case"Camera":case 1:T.types[A]=1;break;case"Screen":case 2:T.types[A]=2;break;case"SystemVoice":case 3:T.types[A]=3;break}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.types=[]),T.defaults&&(A.roomId="",A.pushId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.pushId!=null&&i.hasOwnProperty("pushId")&&(A.pushId=i.pushId),i.types&&i.types.length){A.types=[];for(let U=0;U<i.types.length;++U)A.types[U]=T.enums===String?$root.com.quick.voice.proto.TrackType[i.types[U]]===void 0?i.types[U]:$root.com.quick.voice.proto.TrackType[i.types[U]]:i.types[U]}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.P2PAvailablePeerNotify"},C})(),F.ReportP2PExReq=(function(){function C(i){if(this.types=[],i)for(let T=Object.keys(i),A=0;A<T.length;++A)i[T[A]]!=null&&(this[T[A]]=i[T[A]])}C.prototype.roomId="",C.prototype.pushId="",C.prototype.pullId="",C.prototype.code=0,C.prototype.types=$util.emptyArray,C.prototype.desc=null,C.prototype.connectedTime=null;let D;return Object.defineProperty(C.prototype,"_desc",{get:$util.oneOfGetter(D=["desc"]),set:$util.oneOfSetter(D)}),Object.defineProperty(C.prototype,"_connectedTime",{get:$util.oneOfGetter(D=["connectedTime"]),set:$util.oneOfSetter(D)}),C.create=function(T){return new C(T)},C.encode=function(T,A){if(A||(A=$Writer.create()),T.roomId!=null&&Object.hasOwnProperty.call(T,"roomId")&&A.uint32(10).string(T.roomId),T.pushId!=null&&Object.hasOwnProperty.call(T,"pushId")&&A.uint32(18).string(T.pushId),T.pullId!=null&&Object.hasOwnProperty.call(T,"pullId")&&A.uint32(26).string(T.pullId),T.code!=null&&Object.hasOwnProperty.call(T,"code")&&A.uint32(32).int32(T.code),T.types!=null&&T.types.length){A.uint32(42).fork();for(let U=0;U<T.types.length;++U)A.int32(T.types[U]);A.ldelim()}return T.desc!=null&&Object.hasOwnProperty.call(T,"desc")&&A.uint32(50).string(T.desc),T.connectedTime!=null&&Object.hasOwnProperty.call(T,"connectedTime")&&A.uint32(58).string(T.connectedTime),A},C.encodeDelimited=function(T,A){return this.encode(T,A).ldelim()},C.decode=function(T,A,U){T instanceof $Reader||(T=$Reader.create(T));let j=A===void 0?T.len:T.pos+A,z=new $root.com.quick.voice.proto.ReportP2PExReq;for(;T.pos<j;){let K=T.uint32();if(K===U)break;switch(K>>>3){case 1:{z.roomId=T.string();break}case 2:{z.pushId=T.string();break}case 3:{z.pullId=T.string();break}case 4:{z.code=T.int32();break}case 5:{if(z.types&&z.types.length||(z.types=[]),(K&7)===2){let Y=T.uint32()+T.pos;for(;T.pos<Y;)z.types.push(T.int32())}else z.types.push(T.int32());break}case 6:{z.desc=T.string();break}case 7:{z.connectedTime=T.string();break}default:T.skipType(K&7);break}}return z},C.decodeDelimited=function(T){return T instanceof $Reader||(T=new $Reader(T)),this.decode(T,T.uint32())},C.verify=function(T){if(typeof T!="object"||T===null)return"object expected";if(T.roomId!=null&&T.hasOwnProperty("roomId")&&!$util.isString(T.roomId))return"roomId: string expected";if(T.pushId!=null&&T.hasOwnProperty("pushId")&&!$util.isString(T.pushId))return"pushId: string expected";if(T.pullId!=null&&T.hasOwnProperty("pullId")&&!$util.isString(T.pullId))return"pullId: string expected";if(T.code!=null&&T.hasOwnProperty("code"))switch(T.code){default:return"code: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(T.types!=null&&T.hasOwnProperty("types")){if(!Array.isArray(T.types))return"types: array expected";for(let A=0;A<T.types.length;++A)switch(T.types[A]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return T.desc!=null&&T.hasOwnProperty("desc")&&!$util.isString(T.desc)?"desc: string expected":T.connectedTime!=null&&T.hasOwnProperty("connectedTime")&&!$util.isString(T.connectedTime)?"connectedTime: string expected":null},C.fromObject=function(T){if(T instanceof $root.com.quick.voice.proto.ReportP2PExReq)return T;let A=new $root.com.quick.voice.proto.ReportP2PExReq;switch(T.roomId!=null&&(A.roomId=String(T.roomId)),T.pushId!=null&&(A.pushId=String(T.pushId)),T.pullId!=null&&(A.pullId=String(T.pullId)),T.code){default:if(typeof T.code=="number"){A.code=T.code;break}break;case"Success":case 0:A.code=0;break;case"Failed":case 1:A.code=1;break;case"Ignore":case 2:A.code=2;break;case"Disconnected":case 3:A.code=3;break;case"LowQuality":case 4:A.code=4;break}if(T.types){if(!Array.isArray(T.types))throw TypeError(".com.quick.voice.proto.ReportP2PExReq.types: array expected");A.types=[];for(let U=0;U<T.types.length;++U)switch(T.types[U]){default:if(typeof T.types[U]=="number"){A.types[U]=T.types[U];break}case"Microphone":case 0:A.types[U]=0;break;case"Camera":case 1:A.types[U]=1;break;case"Screen":case 2:A.types[U]=2;break;case"SystemVoice":case 3:A.types[U]=3;break}}return T.desc!=null&&(A.desc=String(T.desc)),T.connectedTime!=null&&(A.connectedTime=String(T.connectedTime)),A},C.toObject=function(T,A){A||(A={});let U={};if((A.arrays||A.defaults)&&(U.types=[]),A.defaults&&(U.roomId="",U.pushId="",U.pullId="",U.code=A.enums===String?"Success":0),T.roomId!=null&&T.hasOwnProperty("roomId")&&(U.roomId=T.roomId),T.pushId!=null&&T.hasOwnProperty("pushId")&&(U.pushId=T.pushId),T.pullId!=null&&T.hasOwnProperty("pullId")&&(U.pullId=T.pullId),T.code!=null&&T.hasOwnProperty("code")&&(U.code=A.enums===String?$root.com.quick.voice.proto.P2PCode[T.code]===void 0?T.code:$root.com.quick.voice.proto.P2PCode[T.code]:T.code),T.types&&T.types.length){U.types=[];for(let j=0;j<T.types.length;++j)U.types[j]=A.enums===String?$root.com.quick.voice.proto.TrackType[T.types[j]]===void 0?T.types[j]:$root.com.quick.voice.proto.TrackType[T.types[j]]:T.types[j]}return T.desc!=null&&T.hasOwnProperty("desc")&&(U.desc=T.desc,A.oneofs&&(U._desc="desc")),T.connectedTime!=null&&T.hasOwnProperty("connectedTime")&&(U.connectedTime=T.connectedTime,A.oneofs&&(U._connectedTime="connectedTime")),U},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(T){return T===void 0&&(T="type.googleapis.com"),T+"/com.quick.voice.proto.ReportP2PExReq"},C})(),F.P2PDisconnectedNotify=(function(){function C(D){if(this.types=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.remoteUserId="",C.prototype.types=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.remoteUserId!=null&&Object.hasOwnProperty.call(i,"remoteUserId")&&T.uint32(18).string(i.remoteUserId),i.types!=null&&i.types.length){T.uint32(26).fork();for(let A=0;A<i.types.length;++A)T.int32(i.types[A]);T.ldelim()}return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.P2PDisconnectedNotify;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.remoteUserId=i.string();break}case 3:{if(j.types&&j.types.length||(j.types=[]),(z&7)===2){let K=i.uint32()+i.pos;for(;i.pos<K;)j.types.push(i.int32())}else j.types.push(i.int32());break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.remoteUserId!=null&&i.hasOwnProperty("remoteUserId")&&!$util.isString(i.remoteUserId))return"remoteUserId: string expected";if(i.types!=null&&i.hasOwnProperty("types")){if(!Array.isArray(i.types))return"types: array expected";for(let T=0;T<i.types.length;++T)switch(i.types[T]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.P2PDisconnectedNotify)return i;let T=new $root.com.quick.voice.proto.P2PDisconnectedNotify;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.remoteUserId!=null&&(T.remoteUserId=String(i.remoteUserId)),i.types){if(!Array.isArray(i.types))throw TypeError(".com.quick.voice.proto.P2PDisconnectedNotify.types: array expected");T.types=[];for(let A=0;A<i.types.length;++A)switch(i.types[A]){default:if(typeof i.types[A]=="number"){T.types[A]=i.types[A];break}case"Microphone":case 0:T.types[A]=0;break;case"Camera":case 1:T.types[A]=1;break;case"Screen":case 2:T.types[A]=2;break;case"SystemVoice":case 3:T.types[A]=3;break}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.types=[]),T.defaults&&(A.roomId="",A.remoteUserId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.remoteUserId!=null&&i.hasOwnProperty("remoteUserId")&&(A.remoteUserId=i.remoteUserId),i.types&&i.types.length){A.types=[];for(let U=0;U<i.types.length;++U)A.types[U]=T.enums===String?$root.com.quick.voice.proto.TrackType[i.types[U]]===void 0?i.types[U]:$root.com.quick.voice.proto.TrackType[i.types[U]]:i.types[U]}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.P2PDisconnectedNotify"},C})(),F.RtcEvent=(function(){const C={},D=Object.create(C);return D[C[0]="UpdateTrackActive"]=0,D})(),F.RtcTrack=(function(){function C(D){if(D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.userId="",C.prototype.mid="",C.prototype.trackName="",C.prototype.type=0,C.prototype.isActive=!1,C.create=function(i){return new C(i)},C.encode=function(i,T){return T||(T=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&T.uint32(10).string(i.userId),i.mid!=null&&Object.hasOwnProperty.call(i,"mid")&&T.uint32(18).string(i.mid),i.trackName!=null&&Object.hasOwnProperty.call(i,"trackName")&&T.uint32(26).string(i.trackName),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&T.uint32(32).int32(i.type),i.isActive!=null&&Object.hasOwnProperty.call(i,"isActive")&&T.uint32(40).bool(i.isActive),T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.RtcTrack;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.userId=i.string();break}case 2:{j.mid=i.string();break}case 3:{j.trackName=i.string();break}case 4:{j.type=i.int32();break}case 5:{j.isActive=i.bool();break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId))return"userId: string expected";if(i.mid!=null&&i.hasOwnProperty("mid")&&!$util.isString(i.mid))return"mid: string expected";if(i.trackName!=null&&i.hasOwnProperty("trackName")&&!$util.isString(i.trackName))return"trackName: string expected";if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return i.isActive!=null&&i.hasOwnProperty("isActive")&&typeof i.isActive!="boolean"?"isActive: boolean expected":null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RtcTrack)return i;let T=new $root.com.quick.voice.proto.RtcTrack;switch(i.userId!=null&&(T.userId=String(i.userId)),i.mid!=null&&(T.mid=String(i.mid)),i.trackName!=null&&(T.trackName=String(i.trackName)),i.type){default:if(typeof i.type=="number"){T.type=i.type;break}break;case"Microphone":case 0:T.type=0;break;case"Camera":case 1:T.type=1;break;case"Screen":case 2:T.type=2;break;case"SystemVoice":case 3:T.type=3;break}return i.isActive!=null&&(T.isActive=!!i.isActive),T},C.toObject=function(i,T){T||(T={});let A={};return T.defaults&&(A.userId="",A.mid="",A.trackName="",A.type=T.enums===String?"Microphone":0,A.isActive=!1),i.userId!=null&&i.hasOwnProperty("userId")&&(A.userId=i.userId),i.mid!=null&&i.hasOwnProperty("mid")&&(A.mid=i.mid),i.trackName!=null&&i.hasOwnProperty("trackName")&&(A.trackName=i.trackName),i.type!=null&&i.hasOwnProperty("type")&&(A.type=T.enums===String?$root.com.quick.voice.proto.RtcTrackType[i.type]===void 0?i.type:$root.com.quick.voice.proto.RtcTrackType[i.type]:i.type),i.isActive!=null&&i.hasOwnProperty("isActive")&&(A.isActive=i.isActive),A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RtcTrack"},C})(),F.RtcTrackType=(function(){const C={},D=Object.create(C);return D[C[0]="Microphone"]=0,D[C[1]="Camera"]=1,D[C[2]="Screen"]=2,D[C[3]="SystemVoice"]=3,D})(),F.UpdateTrackState=(function(){function C(D){if(this.tracks=[],D)for(let i=Object.keys(D),T=0;T<i.length;++T)D[i[T]]!=null&&(this[i[T]]=D[i[T]])}return C.prototype.roomId="",C.prototype.tracks=$util.emptyArray,C.create=function(i){return new C(i)},C.encode=function(i,T){if(T||(T=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&T.uint32(10).string(i.roomId),i.tracks!=null&&i.tracks.length)for(let A=0;A<i.tracks.length;++A)$root.com.quick.voice.proto.RtcTrack.encode(i.tracks[A],T.uint32(18).fork()).ldelim();return T},C.encodeDelimited=function(i,T){return this.encode(i,T).ldelim()},C.decode=function(i,T,A){i instanceof $Reader||(i=$Reader.create(i));let U=T===void 0?i.len:i.pos+T,j=new $root.com.quick.voice.proto.UpdateTrackState;for(;i.pos<U;){let z=i.uint32();if(z===A)break;switch(z>>>3){case 1:{j.roomId=i.string();break}case 2:{j.tracks&&j.tracks.length||(j.tracks=[]),j.tracks.push($root.com.quick.voice.proto.RtcTrack.decode(i,i.uint32()));break}default:i.skipType(z&7);break}}return j},C.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},C.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let T=0;T<i.tracks.length;++T){let A=$root.com.quick.voice.proto.RtcTrack.verify(i.tracks[T]);if(A)return"tracks."+A}}return null},C.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTrackState)return i;let T=new $root.com.quick.voice.proto.UpdateTrackState;if(i.roomId!=null&&(T.roomId=String(i.roomId)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.UpdateTrackState.tracks: array expected");T.tracks=[];for(let A=0;A<i.tracks.length;++A){if(typeof i.tracks[A]!="object")throw TypeError(".com.quick.voice.proto.UpdateTrackState.tracks: object expected");T.tracks[A]=$root.com.quick.voice.proto.RtcTrack.fromObject(i.tracks[A])}}return T},C.toObject=function(i,T){T||(T={});let A={};if((T.arrays||T.defaults)&&(A.tracks=[]),T.defaults&&(A.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(A.roomId=i.roomId),i.tracks&&i.tracks.length){A.tracks=[];for(let U=0;U<i.tracks.length;++U)A.tracks[U]=$root.com.quick.voice.proto.RtcTrack.toObject(i.tracks[U],T)}return A},C.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},C.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTrackState"},C})(),F})(),B})(),M})(),N})(),enum_notifyName={onChangeNetwork:"网络情况变更",onRoomNetwork:"房间实时网络数据",onNetQuality:"网络质量回调",onLogin:"登录回调",onRemotePeerReady:"开始推流",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",UpdateTrackActive:"更新轨道状态",onRoomState:"房间状态变化",onIceState:"webrtc状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onDataChannelPublish:"监听数据通道发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",onTrackInactive:"通知轨道失效",onAttemptP2PEx:"尝试与对方建立P2P连接",onOffer:"收到P2P-offer",onAnswer:"收到P2P-answer",onCandidate:"收到P2P候选信息-candidate",onDisconnectedP2P:"监听关闭P2P",onUpdatePermissions:"更新推流权限通知",onTokenExpired:"Token已过期",onDestroyRoom:"直播模式房间销毁",onUpdateBehavior:"行为允许权限变更",destroyRoom:"服务器要求销毁房间",onCDNPlayUrlAdd:"cdn播放地址变化",onRoomUserSpeech:"用户讲话",onDestroy:"SDK销毁"};pt(enum_notifyName);const notifyName_keys=Object.keys(enum_notifyName);const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(N){let M=N.length;for(;--M>=0;)N[M]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=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]),extra_dbits=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]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(N,M,B,F,C){this.static_tree=N,this.extra_bits=M,this.extra_base=B,this.elems=F,this.max_length=C,this.has_stree=N&&N.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(N,M){this.dyn_tree=N,this.max_code=0,this.stat_desc=M}const d_code=N=>N<256?_dist_code[N]:_dist_code[256+(N>>>7)],put_short=(N,M)=>{N.pending_buf[N.pending++]=M&255,N.pending_buf[N.pending++]=M>>>8&255},send_bits=(N,M,B)=>{N.bi_valid>Buf_size-B?(N.bi_buf|=M<<N.bi_valid&65535,put_short(N,N.bi_buf),N.bi_buf=M>>Buf_size-N.bi_valid,N.bi_valid+=B-Buf_size):(N.bi_buf|=M<<N.bi_valid&65535,N.bi_valid+=B)},send_code=(N,M,B)=>{send_bits(N,B[M*2],B[M*2+1])},bi_reverse=(N,M)=>{let B=0;do B|=N&1,N>>>=1,B<<=1;while(--M>0);return B>>>1},bi_flush=N=>{N.bi_valid===16?(put_short(N,N.bi_buf),N.bi_buf=0,N.bi_valid=0):N.bi_valid>=8&&(N.pending_buf[N.pending++]=N.bi_buf&255,N.bi_buf>>=8,N.bi_valid-=8)},gen_bitlen=(N,M)=>{const B=M.dyn_tree,F=M.max_code,C=M.stat_desc.static_tree,D=M.stat_desc.has_stree,i=M.stat_desc.extra_bits,T=M.stat_desc.extra_base,A=M.stat_desc.max_length;let U,j,z,K,Y,te,ae=0;for(K=0;K<=MAX_BITS$1;K++)N.bl_count[K]=0;for(B[N.heap[N.heap_max]*2+1]=0,U=N.heap_max+1;U<HEAP_SIZE$1;U++)j=N.heap[U],K=B[B[j*2+1]*2+1]+1,K>A&&(K=A,ae++),B[j*2+1]=K,!(j>F)&&(N.bl_count[K]++,Y=0,j>=T&&(Y=i[j-T]),te=B[j*2],N.opt_len+=te*(K+Y),D&&(N.static_len+=te*(C[j*2+1]+Y)));if(ae!==0){do{for(K=A-1;N.bl_count[K]===0;)K--;N.bl_count[K]--,N.bl_count[K+1]+=2,N.bl_count[A]--,ae-=2}while(ae>0);for(K=A;K!==0;K--)for(j=N.bl_count[K];j!==0;)z=N.heap[--U],!(z>F)&&(B[z*2+1]!==K&&(N.opt_len+=(K-B[z*2+1])*B[z*2],B[z*2+1]=K),j--)}},gen_codes=(N,M,B)=>{const F=new Array(MAX_BITS$1+1);let C=0,D,i;for(D=1;D<=MAX_BITS$1;D++)C=C+B[D-1]<<1,F[D]=C;for(i=0;i<=M;i++){let T=N[i*2+1];T!==0&&(N[i*2]=bi_reverse(F[T]++,T))}},tr_static_init=()=>{let N,M,B,F,C;const D=new Array(MAX_BITS$1+1);for(B=0,F=0;F<LENGTH_CODES$1-1;F++)for(base_length[F]=B,N=0;N<1<<extra_lbits[F];N++)_length_code[B++]=F;for(_length_code[B-1]=F,C=0,F=0;F<16;F++)for(base_dist[F]=C,N=0;N<1<<extra_dbits[F];N++)_dist_code[C++]=F;for(C>>=7;F<D_CODES$1;F++)for(base_dist[F]=C<<7,N=0;N<1<<extra_dbits[F]-7;N++)_dist_code[256+C++]=F;for(M=0;M<=MAX_BITS$1;M++)D[M]=0;for(N=0;N<=143;)static_ltree[N*2+1]=8,N++,D[8]++;for(;N<=255;)static_ltree[N*2+1]=9,N++,D[9]++;for(;N<=279;)static_ltree[N*2+1]=7,N++,D[7]++;for(;N<=287;)static_ltree[N*2+1]=8,N++,D[8]++;for(gen_codes(static_ltree,L_CODES$1+1,D),N=0;N<D_CODES$1;N++)static_dtree[N*2+1]=5,static_dtree[N*2]=bi_reverse(N,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=N=>{let M;for(M=0;M<L_CODES$1;M++)N.dyn_ltree[M*2]=0;for(M=0;M<D_CODES$1;M++)N.dyn_dtree[M*2]=0;for(M=0;M<BL_CODES$1;M++)N.bl_tree[M*2]=0;N.dyn_ltree[END_BLOCK*2]=1,N.opt_len=N.static_len=0,N.sym_next=N.matches=0},bi_windup=N=>{N.bi_valid>8?put_short(N,N.bi_buf):N.bi_valid>0&&(N.pending_buf[N.pending++]=N.bi_buf),N.bi_buf=0,N.bi_valid=0},smaller=(N,M,B,F)=>{const C=M*2,D=B*2;return N[C]<N[D]||N[C]===N[D]&&F[M]<=F[B]},pqdownheap=(N,M,B)=>{const F=N.heap[B];let C=B<<1;for(;C<=N.heap_len&&(C<N.heap_len&&smaller(M,N.heap[C+1],N.heap[C],N.depth)&&C++,!smaller(M,F,N.heap[C],N.depth));)N.heap[B]=N.heap[C],B=C,C<<=1;N.heap[B]=F},compress_block=(N,M,B)=>{let F,C,D=0,i,T;if(N.sym_next!==0)do F=N.pending_buf[N.sym_buf+D++]&255,F+=(N.pending_buf[N.sym_buf+D++]&255)<<8,C=N.pending_buf[N.sym_buf+D++],F===0?send_code(N,C,M):(i=_length_code[C],send_code(N,i+LITERALS$1+1,M),T=extra_lbits[i],T!==0&&(C-=base_length[i],send_bits(N,C,T)),F--,i=d_code(F),send_code(N,i,B),T=extra_dbits[i],T!==0&&(F-=base_dist[i],send_bits(N,F,T)));while(D<N.sym_next);send_code(N,END_BLOCK,M)},build_tree=(N,M)=>{const B=M.dyn_tree,F=M.stat_desc.static_tree,C=M.stat_desc.has_stree,D=M.stat_desc.elems;let i,T,A=-1,U;for(N.heap_len=0,N.heap_max=HEAP_SIZE$1,i=0;i<D;i++)B[i*2]!==0?(N.heap[++N.heap_len]=A=i,N.depth[i]=0):B[i*2+1]=0;for(;N.heap_len<2;)U=N.heap[++N.heap_len]=A<2?++A:0,B[U*2]=1,N.depth[U]=0,N.opt_len--,C&&(N.static_len-=F[U*2+1]);for(M.max_code=A,i=N.heap_len>>1;i>=1;i--)pqdownheap(N,B,i);U=D;do i=N.heap[1],N.heap[1]=N.heap[N.heap_len--],pqdownheap(N,B,1),T=N.heap[1],N.heap[--N.heap_max]=i,N.heap[--N.heap_max]=T,B[U*2]=B[i*2]+B[T*2],N.depth[U]=(N.depth[i]>=N.depth[T]?N.depth[i]:N.depth[T])+1,B[i*2+1]=B[T*2+1]=U,N.heap[1]=U++,pqdownheap(N,B,1);while(N.heap_len>=2);N.heap[--N.heap_max]=N.heap[1],gen_bitlen(N,M),gen_codes(B,A,N.bl_count)},scan_tree=(N,M,B)=>{let F,C=-1,D,i=M[1],T=0,A=7,U=4;for(i===0&&(A=138,U=3),M[(B+1)*2+1]=65535,F=0;F<=B;F++)D=i,i=M[(F+1)*2+1],!(++T<A&&D===i)&&(T<U?N.bl_tree[D*2]+=T:D!==0?(D!==C&&N.bl_tree[D*2]++,N.bl_tree[REP_3_6*2]++):T<=10?N.bl_tree[REPZ_3_10*2]++:N.bl_tree[REPZ_11_138*2]++,T=0,C=D,i===0?(A=138,U=3):D===i?(A=6,U=3):(A=7,U=4))},send_tree=(N,M,B)=>{let F,C=-1,D,i=M[1],T=0,A=7,U=4;for(i===0&&(A=138,U=3),F=0;F<=B;F++)if(D=i,i=M[(F+1)*2+1],!(++T<A&&D===i)){if(T<U)do send_code(N,D,N.bl_tree);while(--T!==0);else D!==0?(D!==C&&(send_code(N,D,N.bl_tree),T--),send_code(N,REP_3_6,N.bl_tree),send_bits(N,T-3,2)):T<=10?(send_code(N,REPZ_3_10,N.bl_tree),send_bits(N,T-3,3)):(send_code(N,REPZ_11_138,N.bl_tree),send_bits(N,T-11,7));T=0,C=D,i===0?(A=138,U=3):D===i?(A=6,U=3):(A=7,U=4)}},build_bl_tree=N=>{let M;for(scan_tree(N,N.dyn_ltree,N.l_desc.max_code),scan_tree(N,N.dyn_dtree,N.d_desc.max_code),build_tree(N,N.bl_desc),M=BL_CODES$1-1;M>=3&&N.bl_tree[bl_order[M]*2+1]===0;M--);return N.opt_len+=3*(M+1)+5+5+4,M},send_all_trees=(N,M,B,F)=>{let C;for(send_bits(N,M-257,5),send_bits(N,B-1,5),send_bits(N,F-4,4),C=0;C<F;C++)send_bits(N,N.bl_tree[bl_order[C]*2+1],3);send_tree(N,N.dyn_ltree,M-1),send_tree(N,N.dyn_dtree,B-1)},detect_data_type=N=>{let M=4093624447,B;for(B=0;B<=31;B++,M>>>=1)if(M&1&&N.dyn_ltree[B*2]!==0)return Z_BINARY;if(N.dyn_ltree[18]!==0||N.dyn_ltree[20]!==0||N.dyn_ltree[26]!==0)return Z_TEXT;for(B=32;B<LITERALS$1;B++)if(N.dyn_ltree[B*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=N=>{static_init_done||(tr_static_init(),static_init_done=!0),N.l_desc=new TreeDesc(N.dyn_ltree,static_l_desc),N.d_desc=new TreeDesc(N.dyn_dtree,static_d_desc),N.bl_desc=new TreeDesc(N.bl_tree,static_bl_desc),N.bi_buf=0,N.bi_valid=0,init_block(N)},_tr_stored_block$1=(N,M,B,F)=>{send_bits(N,(STORED_BLOCK<<1)+(F?1:0),3),bi_windup(N),put_short(N,B),put_short(N,~B),B&&N.pending_buf.set(N.window.subarray(M,M+B),N.pending),N.pending+=B},_tr_align$1=N=>{send_bits(N,STATIC_TREES<<1,3),send_code(N,END_BLOCK,static_ltree),bi_flush(N)},_tr_flush_block$1=(N,M,B,F)=>{let C,D,i=0;N.level>0?(N.strm.data_type===Z_UNKNOWN$1&&(N.strm.data_type=detect_data_type(N)),build_tree(N,N.l_desc),build_tree(N,N.d_desc),i=build_bl_tree(N),C=N.opt_len+3+7>>>3,D=N.static_len+3+7>>>3,D<=C&&(C=D)):C=D=B+5,B+4<=C&&M!==-1?_tr_stored_block$1(N,M,B,F):N.strategy===Z_FIXED$1||D===C?(send_bits(N,(STATIC_TREES<<1)+(F?1:0),3),compress_block(N,static_ltree,static_dtree)):(send_bits(N,(DYN_TREES<<1)+(F?1:0),3),send_all_trees(N,N.l_desc.max_code+1,N.d_desc.max_code+1,i+1),compress_block(N,N.dyn_ltree,N.dyn_dtree)),init_block(N),F&&bi_windup(N)},_tr_tally$1=(N,M,B)=>(N.pending_buf[N.sym_buf+N.sym_next++]=M,N.pending_buf[N.sym_buf+N.sym_next++]=M>>8,N.pending_buf[N.sym_buf+N.sym_next++]=B,M===0?N.dyn_ltree[B*2]++:(N.matches++,M--,N.dyn_ltree[(_length_code[B]+LITERALS$1+1)*2]++,N.dyn_dtree[d_code(M)*2]++),N.sym_next===N.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(N,M,B,F)=>{let C=N&65535|0,D=N>>>16&65535|0,i=0;for(;B!==0;){i=B>2e3?2e3:B,B-=i;do C=C+M[F++]|0,D=D+C|0;while(--i);C%=65521,D%=65521}return C|D<<16|0};var adler32_1=adler32;const makeTable=()=>{let N,M=[];for(var B=0;B<256;B++){N=B;for(var F=0;F<8;F++)N=N&1?3988292384^N>>>1:N>>>1;M[B]=N}return M},crcTable=new Uint32Array(makeTable()),crc32=(N,M,B,F)=>{const C=crcTable,D=F+B;N^=-1;for(let i=F;i<D;i++)N=N>>>8^C[(N^M[i])&255];return N^-1};var crc32_1=crc32,messages={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"},constants$2={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};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(N,M)=>(N.msg=messages[M],M),rank=N=>N*2-(N>4?9:0),zero=N=>{let M=N.length;for(;--M>=0;)N[M]=0},slide_hash=N=>{let M,B,F,C=N.w_size;M=N.hash_size,F=M;do B=N.head[--F],N.head[F]=B>=C?B-C:0;while(--M);M=C,F=M;do B=N.prev[--F],N.prev[F]=B>=C?B-C:0;while(--M)};let HASH_ZLIB=(N,M,B)=>(M<<N.hash_shift^B)&N.hash_mask,HASH=HASH_ZLIB;const flush_pending=N=>{const M=N.state;let B=M.pending;B>N.avail_out&&(B=N.avail_out),B!==0&&(N.output.set(M.pending_buf.subarray(M.pending_out,M.pending_out+B),N.next_out),N.next_out+=B,M.pending_out+=B,N.total_out+=B,N.avail_out-=B,M.pending-=B,M.pending===0&&(M.pending_out=0))},flush_block_only=(N,M)=>{_tr_flush_block(N,N.block_start>=0?N.block_start:-1,N.strstart-N.block_start,M),N.block_start=N.strstart,flush_pending(N.strm)},put_byte=(N,M)=>{N.pending_buf[N.pending++]=M},putShortMSB=(N,M)=>{N.pending_buf[N.pending++]=M>>>8&255,N.pending_buf[N.pending++]=M&255},read_buf=(N,M,B,F)=>{let C=N.avail_in;return C>F&&(C=F),C===0?0:(N.avail_in-=C,M.set(N.input.subarray(N.next_in,N.next_in+C),B),N.state.wrap===1?N.adler=adler32_1(N.adler,M,C,B):N.state.wrap===2&&(N.adler=crc32_1(N.adler,M,C,B)),N.next_in+=C,N.total_in+=C,C)},longest_match=(N,M)=>{let B=N.max_chain_length,F=N.strstart,C,D,i=N.prev_length,T=N.nice_match;const A=N.strstart>N.w_size-MIN_LOOKAHEAD?N.strstart-(N.w_size-MIN_LOOKAHEAD):0,U=N.window,j=N.w_mask,z=N.prev,K=N.strstart+MAX_MATCH;let Y=U[F+i-1],te=U[F+i];N.prev_length>=N.good_match&&(B>>=2),T>N.lookahead&&(T=N.lookahead);do if(C=M,!(U[C+i]!==te||U[C+i-1]!==Y||U[C]!==U[F]||U[++C]!==U[F+1])){F+=2,C++;do;while(U[++F]===U[++C]&&U[++F]===U[++C]&&U[++F]===U[++C]&&U[++F]===U[++C]&&U[++F]===U[++C]&&U[++F]===U[++C]&&U[++F]===U[++C]&&U[++F]===U[++C]&&F<K);if(D=MAX_MATCH-(K-F),F=K-MAX_MATCH,D>i){if(N.match_start=M,i=D,D>=T)break;Y=U[F+i-1],te=U[F+i]}}while((M=z[M&j])>A&&--B!==0);return i<=N.lookahead?i:N.lookahead},fill_window=N=>{const M=N.w_size;let B,F,C;do{if(F=N.window_size-N.lookahead-N.strstart,N.strstart>=M+(M-MIN_LOOKAHEAD)&&(N.window.set(N.window.subarray(M,M+M-F),0),N.match_start-=M,N.strstart-=M,N.block_start-=M,N.insert>N.strstart&&(N.insert=N.strstart),slide_hash(N),F+=M),N.strm.avail_in===0)break;if(B=read_buf(N.strm,N.window,N.strstart+N.lookahead,F),N.lookahead+=B,N.lookahead+N.insert>=MIN_MATCH)for(C=N.strstart-N.insert,N.ins_h=N.window[C],N.ins_h=HASH(N,N.ins_h,N.window[C+1]);N.insert&&(N.ins_h=HASH(N,N.ins_h,N.window[C+MIN_MATCH-1]),N.prev[C&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=C,C++,N.insert--,!(N.lookahead+N.insert<MIN_MATCH)););}while(N.lookahead<MIN_LOOKAHEAD&&N.strm.avail_in!==0)},deflate_stored=(N,M)=>{let B=N.pending_buf_size-5>N.w_size?N.w_size:N.pending_buf_size-5,F,C,D,i=0,T=N.strm.avail_in;do{if(F=65535,D=N.bi_valid+42>>3,N.strm.avail_out<D||(D=N.strm.avail_out-D,C=N.strstart-N.block_start,F>C+N.strm.avail_in&&(F=C+N.strm.avail_in),F>D&&(F=D),F<B&&(F===0&&M!==Z_FINISH$3||M===Z_NO_FLUSH$2||F!==C+N.strm.avail_in)))break;i=M===Z_FINISH$3&&F===C+N.strm.avail_in?1:0,_tr_stored_block(N,0,0,i),N.pending_buf[N.pending-4]=F,N.pending_buf[N.pending-3]=F>>8,N.pending_buf[N.pending-2]=~F,N.pending_buf[N.pending-1]=~F>>8,flush_pending(N.strm),C&&(C>F&&(C=F),N.strm.output.set(N.window.subarray(N.block_start,N.block_start+C),N.strm.next_out),N.strm.next_out+=C,N.strm.avail_out-=C,N.strm.total_out+=C,N.block_start+=C,F-=C),F&&(read_buf(N.strm,N.strm.output,N.strm.next_out,F),N.strm.next_out+=F,N.strm.avail_out-=F,N.strm.total_out+=F)}while(i===0);return T-=N.strm.avail_in,T&&(T>=N.w_size?(N.matches=2,N.window.set(N.strm.input.subarray(N.strm.next_in-N.w_size,N.strm.next_in),0),N.strstart=N.w_size,N.insert=N.strstart):(N.window_size-N.strstart<=T&&(N.strstart-=N.w_size,N.window.set(N.window.subarray(N.w_size,N.w_size+N.strstart),0),N.matches<2&&N.matches++,N.insert>N.strstart&&(N.insert=N.strstart)),N.window.set(N.strm.input.subarray(N.strm.next_in-T,N.strm.next_in),N.strstart),N.strstart+=T,N.insert+=T>N.w_size-N.insert?N.w_size-N.insert:T),N.block_start=N.strstart),N.high_water<N.strstart&&(N.high_water=N.strstart),i?BS_FINISH_DONE:M!==Z_NO_FLUSH$2&&M!==Z_FINISH$3&&N.strm.avail_in===0&&N.strstart===N.block_start?BS_BLOCK_DONE:(D=N.window_size-N.strstart,N.strm.avail_in>D&&N.block_start>=N.w_size&&(N.block_start-=N.w_size,N.strstart-=N.w_size,N.window.set(N.window.subarray(N.w_size,N.w_size+N.strstart),0),N.matches<2&&N.matches++,D+=N.w_size,N.insert>N.strstart&&(N.insert=N.strstart)),D>N.strm.avail_in&&(D=N.strm.avail_in),D&&(read_buf(N.strm,N.window,N.strstart,D),N.strstart+=D,N.insert+=D>N.w_size-N.insert?N.w_size-N.insert:D),N.high_water<N.strstart&&(N.high_water=N.strstart),D=N.bi_valid+42>>3,D=N.pending_buf_size-D>65535?65535:N.pending_buf_size-D,B=D>N.w_size?N.w_size:D,C=N.strstart-N.block_start,(C>=B||(C||M===Z_FINISH$3)&&M!==Z_NO_FLUSH$2&&N.strm.avail_in===0&&C<=D)&&(F=C>D?D:C,i=M===Z_FINISH$3&&N.strm.avail_in===0&&F===C?1:0,_tr_stored_block(N,N.block_start,F,i),N.block_start+=F,flush_pending(N.strm)),i?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(N,M)=>{let B,F;for(;;){if(N.lookahead<MIN_LOOKAHEAD){if(fill_window(N),N.lookahead<MIN_LOOKAHEAD&&M===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(B=0,N.lookahead>=MIN_MATCH&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),B=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),B!==0&&N.strstart-B<=N.w_size-MIN_LOOKAHEAD&&(N.match_length=longest_match(N,B)),N.match_length>=MIN_MATCH)if(F=_tr_tally(N,N.strstart-N.match_start,N.match_length-MIN_MATCH),N.lookahead-=N.match_length,N.match_length<=N.max_lazy_match&&N.lookahead>=MIN_MATCH){N.match_length--;do N.strstart++,N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),B=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart;while(--N.match_length!==0);N.strstart++}else N.strstart+=N.match_length,N.match_length=0,N.ins_h=N.window[N.strstart],N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+1]);else F=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++;if(F&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=N.strstart<MIN_MATCH-1?N.strstart:MIN_MATCH-1,M===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(N,M)=>{let B,F,C;for(;;){if(N.lookahead<MIN_LOOKAHEAD){if(fill_window(N),N.lookahead<MIN_LOOKAHEAD&&M===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(B=0,N.lookahead>=MIN_MATCH&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),B=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),N.prev_length=N.match_length,N.prev_match=N.match_start,N.match_length=MIN_MATCH-1,B!==0&&N.prev_length<N.max_lazy_match&&N.strstart-B<=N.w_size-MIN_LOOKAHEAD&&(N.match_length=longest_match(N,B),N.match_length<=5&&(N.strategy===Z_FILTERED||N.match_length===MIN_MATCH&&N.strstart-N.match_start>4096)&&(N.match_length=MIN_MATCH-1)),N.prev_length>=MIN_MATCH&&N.match_length<=N.prev_length){C=N.strstart+N.lookahead-MIN_MATCH,F=_tr_tally(N,N.strstart-1-N.prev_match,N.prev_length-MIN_MATCH),N.lookahead-=N.prev_length-1,N.prev_length-=2;do++N.strstart<=C&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),B=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart);while(--N.prev_length!==0);if(N.match_available=0,N.match_length=MIN_MATCH-1,N.strstart++,F&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}else if(N.match_available){if(F=_tr_tally(N,0,N.window[N.strstart-1]),F&&flush_block_only(N,!1),N.strstart++,N.lookahead--,N.strm.avail_out===0)return BS_NEED_MORE}else N.match_available=1,N.strstart++,N.lookahead--}return N.match_available&&(F=_tr_tally(N,0,N.window[N.strstart-1]),N.match_available=0),N.insert=N.strstart<MIN_MATCH-1?N.strstart:MIN_MATCH-1,M===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(N,M)=>{let B,F,C,D;const i=N.window;for(;;){if(N.lookahead<=MAX_MATCH){if(fill_window(N),N.lookahead<=MAX_MATCH&&M===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(N.match_length=0,N.lookahead>=MIN_MATCH&&N.strstart>0&&(C=N.strstart-1,F=i[C],F===i[++C]&&F===i[++C]&&F===i[++C])){D=N.strstart+MAX_MATCH;do;while(F===i[++C]&&F===i[++C]&&F===i[++C]&&F===i[++C]&&F===i[++C]&&F===i[++C]&&F===i[++C]&&F===i[++C]&&C<D);N.match_length=MAX_MATCH-(D-C),N.match_length>N.lookahead&&(N.match_length=N.lookahead)}if(N.match_length>=MIN_MATCH?(B=_tr_tally(N,1,N.match_length-MIN_MATCH),N.lookahead-=N.match_length,N.strstart+=N.match_length,N.match_length=0):(B=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++),B&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=0,M===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(N,M)=>{let B;for(;;){if(N.lookahead===0&&(fill_window(N),N.lookahead===0)){if(M===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(N.match_length=0,B=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++,B&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=0,M===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(N,M,B,F,C){this.good_length=N,this.max_lazy=M,this.nice_length=B,this.max_chain=F,this.func=C}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=N=>{N.window_size=2*N.w_size,zero(N.head),N.max_lazy_match=configuration_table[N.level].max_lazy,N.good_match=configuration_table[N.level].good_length,N.nice_match=configuration_table[N.level].nice_length,N.max_chain_length=configuration_table[N.level].max_chain,N.strstart=0,N.block_start=0,N.lookahead=0,N.insert=0,N.match_length=N.prev_length=MIN_MATCH-1,N.match_available=0,N.ins_h=0};function DeflateState(){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=Z_DEFLATED$2,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(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(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 deflateStateCheck=N=>{if(!N)return 1;const M=N.state;return!M||M.strm!==N||M.status!==INIT_STATE&&M.status!==GZIP_STATE&&M.status!==EXTRA_STATE&&M.status!==NAME_STATE&&M.status!==COMMENT_STATE&&M.status!==HCRC_STATE&&M.status!==BUSY_STATE&&M.status!==FINISH_STATE?1:0},deflateResetKeep=N=>{if(deflateStateCheck(N))return err(N,Z_STREAM_ERROR$2);N.total_in=N.total_out=0,N.data_type=Z_UNKNOWN;const M=N.state;return M.pending=0,M.pending_out=0,M.wrap<0&&(M.wrap=-M.wrap),M.status=M.wrap===2?GZIP_STATE:M.wrap?INIT_STATE:BUSY_STATE,N.adler=M.wrap===2?0:1,M.last_flush=-2,_tr_init(M),Z_OK$3},deflateReset=N=>{const M=deflateResetKeep(N);return M===Z_OK$3&&lm_init(N.state),M},deflateSetHeader=(N,M)=>deflateStateCheck(N)||N.state.wrap!==2?Z_STREAM_ERROR$2:(N.state.gzhead=M,Z_OK$3),deflateInit2=(N,M,B,F,C,D)=>{if(!N)return Z_STREAM_ERROR$2;let i=1;if(M===Z_DEFAULT_COMPRESSION$1&&(M=6),F<0?(i=0,F=-F):F>15&&(i=2,F-=16),C<1||C>MAX_MEM_LEVEL||B!==Z_DEFLATED$2||F<8||F>15||M<0||M>9||D<0||D>Z_FIXED||F===8&&i!==1)return err(N,Z_STREAM_ERROR$2);F===8&&(F=9);const T=new DeflateState;return N.state=T,T.strm=N,T.status=INIT_STATE,T.wrap=i,T.gzhead=null,T.w_bits=F,T.w_size=1<<T.w_bits,T.w_mask=T.w_size-1,T.hash_bits=C+7,T.hash_size=1<<T.hash_bits,T.hash_mask=T.hash_size-1,T.hash_shift=~~((T.hash_bits+MIN_MATCH-1)/MIN_MATCH),T.window=new Uint8Array(T.w_size*2),T.head=new Uint16Array(T.hash_size),T.prev=new Uint16Array(T.w_size),T.lit_bufsize=1<<C+6,T.pending_buf_size=T.lit_bufsize*4,T.pending_buf=new Uint8Array(T.pending_buf_size),T.sym_buf=T.lit_bufsize,T.sym_end=(T.lit_bufsize-1)*3,T.level=M,T.strategy=D,T.method=B,deflateReset(N)},deflateInit=(N,M)=>deflateInit2(N,M,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(N,M)=>{if(deflateStateCheck(N)||M>Z_BLOCK$1||M<0)return N?err(N,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const B=N.state;if(!N.output||N.avail_in!==0&&!N.input||B.status===FINISH_STATE&&M!==Z_FINISH$3)return err(N,N.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const F=B.last_flush;if(B.last_flush=M,B.pending!==0){if(flush_pending(N),N.avail_out===0)return B.last_flush=-1,Z_OK$3}else if(N.avail_in===0&&rank(M)<=rank(F)&&M!==Z_FINISH$3)return err(N,Z_BUF_ERROR$1);if(B.status===FINISH_STATE&&N.avail_in!==0)return err(N,Z_BUF_ERROR$1);if(B.status===INIT_STATE&&B.wrap===0&&(B.status=BUSY_STATE),B.status===INIT_STATE){let C=Z_DEFLATED$2+(B.w_bits-8<<4)<<8,D=-1;if(B.strategy>=Z_HUFFMAN_ONLY||B.level<2?D=0:B.level<6?D=1:B.level===6?D=2:D=3,C|=D<<6,B.strstart!==0&&(C|=PRESET_DICT),C+=31-C%31,putShortMSB(B,C),B.strstart!==0&&(putShortMSB(B,N.adler>>>16),putShortMSB(B,N.adler&65535)),N.adler=1,B.status=BUSY_STATE,flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3}if(B.status===GZIP_STATE){if(N.adler=0,put_byte(B,31),put_byte(B,139),put_byte(B,8),B.gzhead)put_byte(B,(B.gzhead.text?1:0)+(B.gzhead.hcrc?2:0)+(B.gzhead.extra?4:0)+(B.gzhead.name?8:0)+(B.gzhead.comment?16:0)),put_byte(B,B.gzhead.time&255),put_byte(B,B.gzhead.time>>8&255),put_byte(B,B.gzhead.time>>16&255),put_byte(B,B.gzhead.time>>24&255),put_byte(B,B.level===9?2:B.strategy>=Z_HUFFMAN_ONLY||B.level<2?4:0),put_byte(B,B.gzhead.os&255),B.gzhead.extra&&B.gzhead.extra.length&&(put_byte(B,B.gzhead.extra.length&255),put_byte(B,B.gzhead.extra.length>>8&255)),B.gzhead.hcrc&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending,0)),B.gzindex=0,B.status=EXTRA_STATE;else if(put_byte(B,0),put_byte(B,0),put_byte(B,0),put_byte(B,0),put_byte(B,0),put_byte(B,B.level===9?2:B.strategy>=Z_HUFFMAN_ONLY||B.level<2?4:0),put_byte(B,OS_CODE),B.status=BUSY_STATE,flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3}if(B.status===EXTRA_STATE){if(B.gzhead.extra){let C=B.pending,D=(B.gzhead.extra.length&65535)-B.gzindex;for(;B.pending+D>B.pending_buf_size;){let T=B.pending_buf_size-B.pending;if(B.pending_buf.set(B.gzhead.extra.subarray(B.gzindex,B.gzindex+T),B.pending),B.pending=B.pending_buf_size,B.gzhead.hcrc&&B.pending>C&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-C,C)),B.gzindex+=T,flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3;C=0,D-=T}let i=new Uint8Array(B.gzhead.extra);B.pending_buf.set(i.subarray(B.gzindex,B.gzindex+D),B.pending),B.pending+=D,B.gzhead.hcrc&&B.pending>C&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-C,C)),B.gzindex=0}B.status=NAME_STATE}if(B.status===NAME_STATE){if(B.gzhead.name){let C=B.pending,D;do{if(B.pending===B.pending_buf_size){if(B.gzhead.hcrc&&B.pending>C&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-C,C)),flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3;C=0}B.gzindex<B.gzhead.name.length?D=B.gzhead.name.charCodeAt(B.gzindex++)&255:D=0,put_byte(B,D)}while(D!==0);B.gzhead.hcrc&&B.pending>C&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-C,C)),B.gzindex=0}B.status=COMMENT_STATE}if(B.status===COMMENT_STATE){if(B.gzhead.comment){let C=B.pending,D;do{if(B.pending===B.pending_buf_size){if(B.gzhead.hcrc&&B.pending>C&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-C,C)),flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3;C=0}B.gzindex<B.gzhead.comment.length?D=B.gzhead.comment.charCodeAt(B.gzindex++)&255:D=0,put_byte(B,D)}while(D!==0);B.gzhead.hcrc&&B.pending>C&&(N.adler=crc32_1(N.adler,B.pending_buf,B.pending-C,C))}B.status=HCRC_STATE}if(B.status===HCRC_STATE){if(B.gzhead.hcrc){if(B.pending+2>B.pending_buf_size&&(flush_pending(N),B.pending!==0))return B.last_flush=-1,Z_OK$3;put_byte(B,N.adler&255),put_byte(B,N.adler>>8&255),N.adler=0}if(B.status=BUSY_STATE,flush_pending(N),B.pending!==0)return B.last_flush=-1,Z_OK$3}if(N.avail_in!==0||B.lookahead!==0||M!==Z_NO_FLUSH$2&&B.status!==FINISH_STATE){let C=B.level===0?deflate_stored(B,M):B.strategy===Z_HUFFMAN_ONLY?deflate_huff(B,M):B.strategy===Z_RLE?deflate_rle(B,M):configuration_table[B.level].func(B,M);if((C===BS_FINISH_STARTED||C===BS_FINISH_DONE)&&(B.status=FINISH_STATE),C===BS_NEED_MORE||C===BS_FINISH_STARTED)return N.avail_out===0&&(B.last_flush=-1),Z_OK$3;if(C===BS_BLOCK_DONE&&(M===Z_PARTIAL_FLUSH?_tr_align(B):M!==Z_BLOCK$1&&(_tr_stored_block(B,0,0,!1),M===Z_FULL_FLUSH$1&&(zero(B.head),B.lookahead===0&&(B.strstart=0,B.block_start=0,B.insert=0))),flush_pending(N),N.avail_out===0))return B.last_flush=-1,Z_OK$3}return M!==Z_FINISH$3?Z_OK$3:B.wrap<=0?Z_STREAM_END$3:(B.wrap===2?(put_byte(B,N.adler&255),put_byte(B,N.adler>>8&255),put_byte(B,N.adler>>16&255),put_byte(B,N.adler>>24&255),put_byte(B,N.total_in&255),put_byte(B,N.total_in>>8&255),put_byte(B,N.total_in>>16&255),put_byte(B,N.total_in>>24&255)):(putShortMSB(B,N.adler>>>16),putShortMSB(B,N.adler&65535)),flush_pending(N),B.wrap>0&&(B.wrap=-B.wrap),B.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=N=>{if(deflateStateCheck(N))return Z_STREAM_ERROR$2;const M=N.state.status;return N.state=null,M===BUSY_STATE?err(N,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(N,M)=>{let B=M.length;if(deflateStateCheck(N))return Z_STREAM_ERROR$2;const F=N.state,C=F.wrap;if(C===2||C===1&&F.status!==INIT_STATE||F.lookahead)return Z_STREAM_ERROR$2;if(C===1&&(N.adler=adler32_1(N.adler,M,B,0)),F.wrap=0,B>=F.w_size){C===0&&(zero(F.head),F.strstart=0,F.block_start=0,F.insert=0);let A=new Uint8Array(F.w_size);A.set(M.subarray(B-F.w_size,B),0),M=A,B=F.w_size}const D=N.avail_in,i=N.next_in,T=N.input;for(N.avail_in=B,N.next_in=0,N.input=M,fill_window(F);F.lookahead>=MIN_MATCH;){let A=F.strstart,U=F.lookahead-(MIN_MATCH-1);do F.ins_h=HASH(F,F.ins_h,F.window[A+MIN_MATCH-1]),F.prev[A&F.w_mask]=F.head[F.ins_h],F.head[F.ins_h]=A,A++;while(--U);F.strstart=A,F.lookahead=MIN_MATCH-1,fill_window(F)}return F.strstart+=F.lookahead,F.block_start=F.strstart,F.insert=F.lookahead,F.lookahead=0,F.match_length=F.prev_length=MIN_MATCH-1,F.match_available=0,N.next_in=i,N.input=T,N.avail_in=D,F.wrap=C,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(N,M)=>Object.prototype.hasOwnProperty.call(N,M);var assign=function(N){const M=Array.prototype.slice.call(arguments,1);for(;M.length;){const B=M.shift();if(B){if(typeof B!="object")throw new TypeError(B+"must be non-object");for(const F in B)_has(B,F)&&(N[F]=B[F])}}return N},flattenChunks=N=>{let M=0;for(let F=0,C=N.length;F<C;F++)M+=N[F].length;const B=new Uint8Array(M);for(let F=0,C=0,D=N.length;F<D;F++){let i=N[F];B.set(i,C),C+=i.length}return B},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(N){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let N=0;N<256;N++)_utf8len[N]=N>=252?6:N>=248?5:N>=240?4:N>=224?3:N>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=N=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(N);let M,B,F,C,D,i=N.length,T=0;for(C=0;C<i;C++)B=N.charCodeAt(C),(B&64512)===55296&&C+1<i&&(F=N.charCodeAt(C+1),(F&64512)===56320&&(B=65536+(B-55296<<10)+(F-56320),C++)),T+=B<128?1:B<2048?2:B<65536?3:4;for(M=new Uint8Array(T),D=0,C=0;D<T;C++)B=N.charCodeAt(C),(B&64512)===55296&&C+1<i&&(F=N.charCodeAt(C+1),(F&64512)===56320&&(B=65536+(B-55296<<10)+(F-56320),C++)),B<128?M[D++]=B:B<2048?(M[D++]=192|B>>>6,M[D++]=128|B&63):B<65536?(M[D++]=224|B>>>12,M[D++]=128|B>>>6&63,M[D++]=128|B&63):(M[D++]=240|B>>>18,M[D++]=128|B>>>12&63,M[D++]=128|B>>>6&63,M[D++]=128|B&63);return M};const buf2binstring=(N,M)=>{if(M<65534&&N.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,N.length===M?N:N.subarray(0,M));let B="";for(let F=0;F<M;F++)B+=String.fromCharCode(N[F]);return B};var buf2string=(N,M)=>{const B=M||N.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(N.subarray(0,M));let F,C;const D=new Array(B*2);for(C=0,F=0;F<B;){let i=N[F++];if(i<128){D[C++]=i;continue}let T=_utf8len[i];if(T>4){D[C++]=65533,F+=T-1;continue}for(i&=T===2?31:T===3?15:7;T>1&&F<B;)i=i<<6|N[F++]&63,T--;if(T>1){D[C++]=65533;continue}i<65536?D[C++]=i:(i-=65536,D[C++]=55296|i>>10&1023,D[C++]=56320|i&1023)}return buf2binstring(D,C)},utf8border=(N,M)=>{M=M||N.length,M>N.length&&(M=N.length);let B=M-1;for(;B>=0&&(N[B]&192)===128;)B--;return B<0||B===0?M:B+_utf8len[N[B]]>M?B:M},strings={string2buf,buf2string,utf8border};function ZStream(){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}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(N){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},N||{});let M=this.options;M.raw&&M.windowBits>0?M.windowBits=-M.windowBits:M.gzip&&M.windowBits>0&&M.windowBits<16&&(M.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let B=deflate_1$2.deflateInit2(this.strm,M.level,M.method,M.windowBits,M.memLevel,M.strategy);if(B!==Z_OK$2)throw new Error(messages[B]);if(M.header&&deflate_1$2.deflateSetHeader(this.strm,M.header),M.dictionary){let F;if(typeof M.dictionary=="string"?F=strings.string2buf(M.dictionary):toString$1.call(M.dictionary)==="[object ArrayBuffer]"?F=new Uint8Array(M.dictionary):F=M.dictionary,B=deflate_1$2.deflateSetDictionary(this.strm,F),B!==Z_OK$2)throw new Error(messages[B]);this._dict_set=!0}}Deflate$1.prototype.push=function(N,M){const B=this.strm,F=this.options.chunkSize;let C,D;if(this.ended)return!1;for(M===~~M?D=M:D=M===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof N=="string"?B.input=strings.string2buf(N):toString$1.call(N)==="[object ArrayBuffer]"?B.input=new Uint8Array(N):B.input=N,B.next_in=0,B.avail_in=B.input.length;;){if(B.avail_out===0&&(B.output=new Uint8Array(F),B.next_out=0,B.avail_out=F),(D===Z_SYNC_FLUSH||D===Z_FULL_FLUSH)&&B.avail_out<=6){this.onData(B.output.subarray(0,B.next_out)),B.avail_out=0;continue}if(C=deflate_1$2.deflate(B,D),C===Z_STREAM_END$2)return B.next_out>0&&this.onData(B.output.subarray(0,B.next_out)),C=deflate_1$2.deflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===Z_OK$2;if(B.avail_out===0){this.onData(B.output);continue}if(D>0&&B.next_out>0){this.onData(B.output.subarray(0,B.next_out)),B.avail_out=0;continue}if(B.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(N){this.chunks.push(N)},Deflate$1.prototype.onEnd=function(N){N===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=N,this.msg=this.strm.msg};function deflate$1(N,M){const B=new Deflate$1(M);if(B.push(N,!0),B.err)throw B.msg||messages[B.err];return B.result}function deflateRaw$1(N,M){return M=M||{},M.raw=!0,deflate$1(N,M)}function gzip$1(N,M){return M=M||{},M.gzip=!0,deflate$1(N,M)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1};const BAD$1=16209,TYPE$1=16191;var inffast=function N(M,B){let F,C,D,i,T,A,U,j,z,K,Y,te,ae,se,re,pe,ke,ie,ce,he,ue,fe,ye,oe;const de=M.state;F=M.next_in,ye=M.input,C=F+(M.avail_in-5),D=M.next_out,oe=M.output,i=D-(B-M.avail_out),T=D+(M.avail_out-257),A=de.dmax,U=de.wsize,j=de.whave,z=de.wnext,K=de.window,Y=de.hold,te=de.bits,ae=de.lencode,se=de.distcode,re=(1<<de.lenbits)-1,pe=(1<<de.distbits)-1;e:do{te<15&&(Y+=ye[F++]<<te,te+=8,Y+=ye[F++]<<te,te+=8),ke=ae[Y&re];t:for(;;){if(ie=ke>>>24,Y>>>=ie,te-=ie,ie=ke>>>16&255,ie===0)oe[D++]=ke&65535;else if(ie&16){ce=ke&65535,ie&=15,ie&&(te<ie&&(Y+=ye[F++]<<te,te+=8),ce+=Y&(1<<ie)-1,Y>>>=ie,te-=ie),te<15&&(Y+=ye[F++]<<te,te+=8,Y+=ye[F++]<<te,te+=8),ke=se[Y&pe];n:for(;;){if(ie=ke>>>24,Y>>>=ie,te-=ie,ie=ke>>>16&255,ie&16){if(he=ke&65535,ie&=15,te<ie&&(Y+=ye[F++]<<te,te+=8,te<ie&&(Y+=ye[F++]<<te,te+=8)),he+=Y&(1<<ie)-1,he>A){M.msg="invalid distance too far back",de.mode=BAD$1;break e}if(Y>>>=ie,te-=ie,ie=D-i,he>ie){if(ie=he-ie,ie>j&&de.sane){M.msg="invalid distance too far back",de.mode=BAD$1;break e}if(ue=0,fe=K,z===0){if(ue+=U-ie,ie<ce){ce-=ie;do oe[D++]=K[ue++];while(--ie);ue=D-he,fe=oe}}else if(z<ie){if(ue+=U+z-ie,ie-=z,ie<ce){ce-=ie;do oe[D++]=K[ue++];while(--ie);if(ue=0,z<ce){ie=z,ce-=ie;do oe[D++]=K[ue++];while(--ie);ue=D-he,fe=oe}}}else if(ue+=z-ie,ie<ce){ce-=ie;do oe[D++]=K[ue++];while(--ie);ue=D-he,fe=oe}for(;ce>2;)oe[D++]=fe[ue++],oe[D++]=fe[ue++],oe[D++]=fe[ue++],ce-=3;ce&&(oe[D++]=fe[ue++],ce>1&&(oe[D++]=fe[ue++]))}else{ue=D-he;do oe[D++]=oe[ue++],oe[D++]=oe[ue++],oe[D++]=oe[ue++],ce-=3;while(ce>2);ce&&(oe[D++]=oe[ue++],ce>1&&(oe[D++]=oe[ue++]))}}else if((ie&64)===0){ke=se[(ke&65535)+(Y&(1<<ie)-1)];continue n}else{M.msg="invalid distance code",de.mode=BAD$1;break e}break}}else if((ie&64)===0){ke=ae[(ke&65535)+(Y&(1<<ie)-1)];continue t}else if(ie&32){de.mode=TYPE$1;break e}else{M.msg="invalid literal/length code",de.mode=BAD$1;break e}break}}while(F<C&&D<T);ce=te>>3,F-=ce,te-=ce<<3,Y&=(1<<te)-1,M.next_in=F,M.next_out=D,M.avail_in=F<C?5+(C-F):5-(F-C),M.avail_out=D<T?257+(T-D):257-(D-T),de.hold=Y,de.bits=te};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=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]),lext=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]),dbase=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]),dext=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]),inflate_table=(N,M,B,F,C,D,i,T)=>{const A=T.bits;let U=0,j=0,z=0,K=0,Y=0,te=0,ae=0,se=0,re=0,pe=0,ke,ie,ce,he,ue,fe=null,ye;const oe=new Uint16Array(MAXBITS+1),de=new Uint16Array(MAXBITS+1);let be=null,_e,we,ge;for(U=0;U<=MAXBITS;U++)oe[U]=0;for(j=0;j<F;j++)oe[M[B+j]]++;for(Y=A,K=MAXBITS;K>=1&&oe[K]===0;K--);if(Y>K&&(Y=K),K===0)return C[D++]=1<<24|64<<16|0,C[D++]=1<<24|64<<16|0,T.bits=1,0;for(z=1;z<K&&oe[z]===0;z++);for(Y<z&&(Y=z),se=1,U=1;U<=MAXBITS;U++)if(se<<=1,se-=oe[U],se<0)return-1;if(se>0&&(N===CODES$1||K!==1))return-1;for(de[1]=0,U=1;U<MAXBITS;U++)de[U+1]=de[U]+oe[U];for(j=0;j<F;j++)M[B+j]!==0&&(i[de[M[B+j]]++]=j);if(N===CODES$1?(fe=be=i,ye=20):N===LENS$1?(fe=lbase,be=lext,ye=257):(fe=dbase,be=dext,ye=0),pe=0,j=0,U=z,ue=D,te=Y,ae=0,ce=-1,re=1<<Y,he=re-1,N===LENS$1&&re>ENOUGH_LENS$1||N===DISTS$1&&re>ENOUGH_DISTS$1)return 1;for(;;){_e=U-ae,i[j]+1<ye?(we=0,ge=i[j]):i[j]>=ye?(we=be[i[j]-ye],ge=fe[i[j]-ye]):(we=96,ge=0),ke=1<<U-ae,ie=1<<te,z=ie;do ie-=ke,C[ue+(pe>>ae)+ie]=_e<<24|we<<16|ge|0;while(ie!==0);for(ke=1<<U-1;pe&ke;)ke>>=1;if(ke!==0?(pe&=ke-1,pe+=ke):pe=0,j++,--oe[U]===0){if(U===K)break;U=M[B+i[j]]}if(U>Y&&(pe&he)!==ce){for(ae===0&&(ae=Y),ue+=z,te=U-ae,se=1<<te;te+ae<K&&(se-=oe[te+ae],!(se<=0));)te++,se<<=1;if(re+=1<<te,N===LENS$1&&re>ENOUGH_LENS$1||N===DISTS$1&&re>ENOUGH_DISTS$1)return 1;ce=pe&he,C[ce]=Y<<24|te<<16|ue-D|0}}return pe!==0&&(C[ue+pe]=U-ae<<24|64<<16|0),T.bits=Y,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=N=>(N>>>24&255)+(N>>>8&65280)+((N&65280)<<8)+((N&255)<<24);function InflateState(){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 inflateStateCheck=N=>{if(!N)return 1;const M=N.state;return!M||M.strm!==N||M.mode<HEAD||M.mode>SYNC?1:0},inflateResetKeep=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const M=N.state;return N.total_in=N.total_out=M.total=0,N.msg="",M.wrap&&(N.adler=M.wrap&1),M.mode=HEAD,M.last=0,M.havedict=0,M.flags=-1,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new Int32Array(ENOUGH_LENS),M.distcode=M.distdyn=new Int32Array(ENOUGH_DISTS),M.sane=1,M.back=-1,Z_OK$1},inflateReset=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const M=N.state;return M.wsize=0,M.whave=0,M.wnext=0,inflateResetKeep(N)},inflateReset2=(N,M)=>{let B;if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const F=N.state;return M<0?(B=0,M=-M):(B=(M>>4)+5,M<48&&(M&=15)),M&&(M<8||M>15)?Z_STREAM_ERROR$1:(F.window!==null&&F.wbits!==M&&(F.window=null),F.wrap=B,F.wbits=M,inflateReset(N))},inflateInit2=(N,M)=>{if(!N)return Z_STREAM_ERROR$1;const B=new InflateState;N.state=B,B.strm=N,B.window=null,B.mode=HEAD;const F=inflateReset2(N,M);return F!==Z_OK$1&&(N.state=null),F},inflateInit=N=>inflateInit2(N,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=N=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let M=0;for(;M<144;)N.lens[M++]=8;for(;M<256;)N.lens[M++]=9;for(;M<280;)N.lens[M++]=7;for(;M<288;)N.lens[M++]=8;for(inftrees(LENS,N.lens,0,288,lenfix,0,N.work,{bits:9}),M=0;M<32;)N.lens[M++]=5;inftrees(DISTS,N.lens,0,32,distfix,0,N.work,{bits:5}),virgin=!1}N.lencode=lenfix,N.lenbits=9,N.distcode=distfix,N.distbits=5},updatewindow=(N,M,B,F)=>{let C;const D=N.state;return D.window===null&&(D.wsize=1<<D.wbits,D.wnext=0,D.whave=0,D.window=new Uint8Array(D.wsize)),F>=D.wsize?(D.window.set(M.subarray(B-D.wsize,B),0),D.wnext=0,D.whave=D.wsize):(C=D.wsize-D.wnext,C>F&&(C=F),D.window.set(M.subarray(B-F,B-F+C),D.wnext),F-=C,F?(D.window.set(M.subarray(B-F,B),0),D.wnext=F,D.whave=D.wsize):(D.wnext+=C,D.wnext===D.wsize&&(D.wnext=0),D.whave<D.wsize&&(D.whave+=C))),0},inflate$2=(N,M)=>{let B,F,C,D,i,T,A,U,j,z,K,Y,te,ae,se=0,re,pe,ke,ie,ce,he,ue,fe;const ye=new Uint8Array(4);let oe,de;const be=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(N)||!N.output||!N.input&&N.avail_in!==0)return Z_STREAM_ERROR$1;B=N.state,B.mode===TYPE&&(B.mode=TYPEDO),i=N.next_out,C=N.output,A=N.avail_out,D=N.next_in,F=N.input,T=N.avail_in,U=B.hold,j=B.bits,z=T,K=A,fe=Z_OK$1;e:for(;;)switch(B.mode){case HEAD:if(B.wrap===0){B.mode=TYPEDO;break}for(;j<16;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(B.wrap&2&&U===35615){B.wbits===0&&(B.wbits=15),B.check=0,ye[0]=U&255,ye[1]=U>>>8&255,B.check=crc32_1(B.check,ye,2,0),U=0,j=0,B.mode=FLAGS;break}if(B.head&&(B.head.done=!1),!(B.wrap&1)||(((U&255)<<8)+(U>>8))%31){N.msg="incorrect header check",B.mode=BAD;break}if((U&15)!==Z_DEFLATED){N.msg="unknown compression method",B.mode=BAD;break}if(U>>>=4,j-=4,ue=(U&15)+8,B.wbits===0&&(B.wbits=ue),ue>15||ue>B.wbits){N.msg="invalid window size",B.mode=BAD;break}B.dmax=1<<B.wbits,B.flags=0,N.adler=B.check=1,B.mode=U&512?DICTID:TYPE,U=0,j=0;break;case FLAGS:for(;j<16;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(B.flags=U,(B.flags&255)!==Z_DEFLATED){N.msg="unknown compression method",B.mode=BAD;break}if(B.flags&57344){N.msg="unknown header flags set",B.mode=BAD;break}B.head&&(B.head.text=U>>8&1),B.flags&512&&B.wrap&4&&(ye[0]=U&255,ye[1]=U>>>8&255,B.check=crc32_1(B.check,ye,2,0)),U=0,j=0,B.mode=TIME;case TIME:for(;j<32;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.head&&(B.head.time=U),B.flags&512&&B.wrap&4&&(ye[0]=U&255,ye[1]=U>>>8&255,ye[2]=U>>>16&255,ye[3]=U>>>24&255,B.check=crc32_1(B.check,ye,4,0)),U=0,j=0,B.mode=OS;case OS:for(;j<16;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.head&&(B.head.xflags=U&255,B.head.os=U>>8),B.flags&512&&B.wrap&4&&(ye[0]=U&255,ye[1]=U>>>8&255,B.check=crc32_1(B.check,ye,2,0)),U=0,j=0,B.mode=EXLEN;case EXLEN:if(B.flags&1024){for(;j<16;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.length=U,B.head&&(B.head.extra_len=U),B.flags&512&&B.wrap&4&&(ye[0]=U&255,ye[1]=U>>>8&255,B.check=crc32_1(B.check,ye,2,0)),U=0,j=0}else B.head&&(B.head.extra=null);B.mode=EXTRA;case EXTRA:if(B.flags&1024&&(Y=B.length,Y>T&&(Y=T),Y&&(B.head&&(ue=B.head.extra_len-B.length,B.head.extra||(B.head.extra=new Uint8Array(B.head.extra_len)),B.head.extra.set(F.subarray(D,D+Y),ue)),B.flags&512&&B.wrap&4&&(B.check=crc32_1(B.check,F,Y,D)),T-=Y,D+=Y,B.length-=Y),B.length))break e;B.length=0,B.mode=NAME;case NAME:if(B.flags&2048){if(T===0)break e;Y=0;do ue=F[D+Y++],B.head&&ue&&B.length<65536&&(B.head.name+=String.fromCharCode(ue));while(ue&&Y<T);if(B.flags&512&&B.wrap&4&&(B.check=crc32_1(B.check,F,Y,D)),T-=Y,D+=Y,ue)break e}else B.head&&(B.head.name=null);B.length=0,B.mode=COMMENT;case COMMENT:if(B.flags&4096){if(T===0)break e;Y=0;do ue=F[D+Y++],B.head&&ue&&B.length<65536&&(B.head.comment+=String.fromCharCode(ue));while(ue&&Y<T);if(B.flags&512&&B.wrap&4&&(B.check=crc32_1(B.check,F,Y,D)),T-=Y,D+=Y,ue)break e}else B.head&&(B.head.comment=null);B.mode=HCRC;case HCRC:if(B.flags&512){for(;j<16;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(B.wrap&4&&U!==(B.check&65535)){N.msg="header crc mismatch",B.mode=BAD;break}U=0,j=0}B.head&&(B.head.hcrc=B.flags>>9&1,B.head.done=!0),N.adler=B.check=0,B.mode=TYPE;break;case DICTID:for(;j<32;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}N.adler=B.check=zswap32(U),U=0,j=0,B.mode=DICT;case DICT:if(B.havedict===0)return N.next_out=i,N.avail_out=A,N.next_in=D,N.avail_in=T,B.hold=U,B.bits=j,Z_NEED_DICT$1;N.adler=B.check=1,B.mode=TYPE;case TYPE:if(M===Z_BLOCK||M===Z_TREES)break e;case TYPEDO:if(B.last){U>>>=j&7,j-=j&7,B.mode=CHECK;break}for(;j<3;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}switch(B.last=U&1,U>>>=1,j-=1,U&3){case 0:B.mode=STORED;break;case 1:if(fixedtables(B),B.mode=LEN_,M===Z_TREES){U>>>=2,j-=2;break e}break;case 2:B.mode=TABLE;break;case 3:N.msg="invalid block type",B.mode=BAD}U>>>=2,j-=2;break;case STORED:for(U>>>=j&7,j-=j&7;j<32;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if((U&65535)!==(U>>>16^65535)){N.msg="invalid stored block lengths",B.mode=BAD;break}if(B.length=U&65535,U=0,j=0,B.mode=COPY_,M===Z_TREES)break e;case COPY_:B.mode=COPY;case COPY:if(Y=B.length,Y){if(Y>T&&(Y=T),Y>A&&(Y=A),Y===0)break e;C.set(F.subarray(D,D+Y),i),T-=Y,D+=Y,A-=Y,i+=Y,B.length-=Y;break}B.mode=TYPE;break;case TABLE:for(;j<14;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(B.nlen=(U&31)+257,U>>>=5,j-=5,B.ndist=(U&31)+1,U>>>=5,j-=5,B.ncode=(U&15)+4,U>>>=4,j-=4,B.nlen>286||B.ndist>30){N.msg="too many length or distance symbols",B.mode=BAD;break}B.have=0,B.mode=LENLENS;case LENLENS:for(;B.have<B.ncode;){for(;j<3;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.lens[be[B.have++]]=U&7,U>>>=3,j-=3}for(;B.have<19;)B.lens[be[B.have++]]=0;if(B.lencode=B.lendyn,B.lenbits=7,oe={bits:B.lenbits},fe=inftrees(CODES,B.lens,0,19,B.lencode,0,B.work,oe),B.lenbits=oe.bits,fe){N.msg="invalid code lengths set",B.mode=BAD;break}B.have=0,B.mode=CODELENS;case CODELENS:for(;B.have<B.nlen+B.ndist;){for(;se=B.lencode[U&(1<<B.lenbits)-1],re=se>>>24,pe=se>>>16&255,ke=se&65535,!(re<=j);){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(ke<16)U>>>=re,j-=re,B.lens[B.have++]=ke;else{if(ke===16){for(de=re+2;j<de;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(U>>>=re,j-=re,B.have===0){N.msg="invalid bit length repeat",B.mode=BAD;break}ue=B.lens[B.have-1],Y=3+(U&3),U>>>=2,j-=2}else if(ke===17){for(de=re+3;j<de;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}U>>>=re,j-=re,ue=0,Y=3+(U&7),U>>>=3,j-=3}else{for(de=re+7;j<de;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}U>>>=re,j-=re,ue=0,Y=11+(U&127),U>>>=7,j-=7}if(B.have+Y>B.nlen+B.ndist){N.msg="invalid bit length repeat",B.mode=BAD;break}for(;Y--;)B.lens[B.have++]=ue}}if(B.mode===BAD)break;if(B.lens[256]===0){N.msg="invalid code -- missing end-of-block",B.mode=BAD;break}if(B.lenbits=9,oe={bits:B.lenbits},fe=inftrees(LENS,B.lens,0,B.nlen,B.lencode,0,B.work,oe),B.lenbits=oe.bits,fe){N.msg="invalid literal/lengths set",B.mode=BAD;break}if(B.distbits=6,B.distcode=B.distdyn,oe={bits:B.distbits},fe=inftrees(DISTS,B.lens,B.nlen,B.ndist,B.distcode,0,B.work,oe),B.distbits=oe.bits,fe){N.msg="invalid distances set",B.mode=BAD;break}if(B.mode=LEN_,M===Z_TREES)break e;case LEN_:B.mode=LEN;case LEN:if(T>=6&&A>=258){N.next_out=i,N.avail_out=A,N.next_in=D,N.avail_in=T,B.hold=U,B.bits=j,inffast(N,K),i=N.next_out,C=N.output,A=N.avail_out,D=N.next_in,F=N.input,T=N.avail_in,U=B.hold,j=B.bits,B.mode===TYPE&&(B.back=-1);break}for(B.back=0;se=B.lencode[U&(1<<B.lenbits)-1],re=se>>>24,pe=se>>>16&255,ke=se&65535,!(re<=j);){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(pe&&(pe&240)===0){for(ie=re,ce=pe,he=ke;se=B.lencode[he+((U&(1<<ie+ce)-1)>>ie)],re=se>>>24,pe=se>>>16&255,ke=se&65535,!(ie+re<=j);){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}U>>>=ie,j-=ie,B.back+=ie}if(U>>>=re,j-=re,B.back+=re,B.length=ke,pe===0){B.mode=LIT;break}if(pe&32){B.back=-1,B.mode=TYPE;break}if(pe&64){N.msg="invalid literal/length code",B.mode=BAD;break}B.extra=pe&15,B.mode=LENEXT;case LENEXT:if(B.extra){for(de=B.extra;j<de;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.length+=U&(1<<B.extra)-1,U>>>=B.extra,j-=B.extra,B.back+=B.extra}B.was=B.length,B.mode=DIST;case DIST:for(;se=B.distcode[U&(1<<B.distbits)-1],re=se>>>24,pe=se>>>16&255,ke=se&65535,!(re<=j);){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if((pe&240)===0){for(ie=re,ce=pe,he=ke;se=B.distcode[he+((U&(1<<ie+ce)-1)>>ie)],re=se>>>24,pe=se>>>16&255,ke=se&65535,!(ie+re<=j);){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}U>>>=ie,j-=ie,B.back+=ie}if(U>>>=re,j-=re,B.back+=re,pe&64){N.msg="invalid distance code",B.mode=BAD;break}B.offset=ke,B.extra=pe&15,B.mode=DISTEXT;case DISTEXT:if(B.extra){for(de=B.extra;j<de;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}B.offset+=U&(1<<B.extra)-1,U>>>=B.extra,j-=B.extra,B.back+=B.extra}if(B.offset>B.dmax){N.msg="invalid distance too far back",B.mode=BAD;break}B.mode=MATCH;case MATCH:if(A===0)break e;if(Y=K-A,B.offset>Y){if(Y=B.offset-Y,Y>B.whave&&B.sane){N.msg="invalid distance too far back",B.mode=BAD;break}Y>B.wnext?(Y-=B.wnext,te=B.wsize-Y):te=B.wnext-Y,Y>B.length&&(Y=B.length),ae=B.window}else ae=C,te=i-B.offset,Y=B.length;Y>A&&(Y=A),A-=Y,B.length-=Y;do C[i++]=ae[te++];while(--Y);B.length===0&&(B.mode=LEN);break;case LIT:if(A===0)break e;C[i++]=B.length,A--,B.mode=LEN;break;case CHECK:if(B.wrap){for(;j<32;){if(T===0)break e;T--,U|=F[D++]<<j,j+=8}if(K-=A,N.total_out+=K,B.total+=K,B.wrap&4&&K&&(N.adler=B.check=B.flags?crc32_1(B.check,C,K,i-K):adler32_1(B.check,C,K,i-K)),K=A,B.wrap&4&&(B.flags?U:zswap32(U))!==B.check){N.msg="incorrect data check",B.mode=BAD;break}U=0,j=0}B.mode=LENGTH;case LENGTH:if(B.wrap&&B.flags){for(;j<32;){if(T===0)break e;T--,U+=F[D++]<<j,j+=8}if(B.wrap&4&&U!==(B.total&4294967295)){N.msg="incorrect length check",B.mode=BAD;break}U=0,j=0}B.mode=DONE;case DONE:fe=Z_STREAM_END$1;break e;case BAD:fe=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return N.next_out=i,N.avail_out=A,N.next_in=D,N.avail_in=T,B.hold=U,B.bits=j,(B.wsize||K!==N.avail_out&&B.mode<BAD&&(B.mode<CHECK||M!==Z_FINISH$1))&&updatewindow(N,N.output,N.next_out,K-N.avail_out),z-=N.avail_in,K-=N.avail_out,N.total_in+=z,N.total_out+=K,B.total+=K,B.wrap&4&&K&&(N.adler=B.check=B.flags?crc32_1(B.check,C,K,N.next_out-K):adler32_1(B.check,C,K,N.next_out-K)),N.data_type=B.bits+(B.last?64:0)+(B.mode===TYPE?128:0)+(B.mode===LEN_||B.mode===COPY_?256:0),(z===0&&K===0||M===Z_FINISH$1)&&fe===Z_OK$1&&(fe=Z_BUF_ERROR),fe},inflateEnd=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;let M=N.state;return M.window&&(M.window=null),N.state=null,Z_OK$1},inflateGetHeader=(N,M)=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const B=N.state;return(B.wrap&2)===0?Z_STREAM_ERROR$1:(B.head=M,M.done=!1,Z_OK$1)},inflateSetDictionary=(N,M)=>{const B=M.length;let F,C,D;return inflateStateCheck(N)||(F=N.state,F.wrap!==0&&F.mode!==DICT)?Z_STREAM_ERROR$1:F.mode===DICT&&(C=1,C=adler32_1(C,M,B,0),C!==F.check)?Z_DATA_ERROR$1:(D=updatewindow(N,M,B,B),D?(F.mode=MEM,Z_MEM_ERROR$1):(F.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){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}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(N){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},N||{});const M=this.options;M.raw&&M.windowBits>=0&&M.windowBits<16&&(M.windowBits=-M.windowBits,M.windowBits===0&&(M.windowBits=-15)),M.windowBits>=0&&M.windowBits<16&&!(N&&N.windowBits)&&(M.windowBits+=32),M.windowBits>15&&M.windowBits<48&&(M.windowBits&15)===0&&(M.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let B=inflate_1$2.inflateInit2(this.strm,M.windowBits);if(B!==Z_OK)throw new Error(messages[B]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),M.dictionary&&(typeof M.dictionary=="string"?M.dictionary=strings.string2buf(M.dictionary):toString.call(M.dictionary)==="[object ArrayBuffer]"&&(M.dictionary=new Uint8Array(M.dictionary)),M.raw&&(B=inflate_1$2.inflateSetDictionary(this.strm,M.dictionary),B!==Z_OK)))throw new Error(messages[B])}Inflate$1.prototype.push=function(N,M){const B=this.strm,F=this.options.chunkSize,C=this.options.dictionary;let D,i,T;if(this.ended)return!1;for(M===~~M?i=M:i=M===!0?Z_FINISH:Z_NO_FLUSH,toString.call(N)==="[object ArrayBuffer]"?B.input=new Uint8Array(N):B.input=N,B.next_in=0,B.avail_in=B.input.length;;){for(B.avail_out===0&&(B.output=new Uint8Array(F),B.next_out=0,B.avail_out=F),D=inflate_1$2.inflate(B,i),D===Z_NEED_DICT&&C&&(D=inflate_1$2.inflateSetDictionary(B,C),D===Z_OK?D=inflate_1$2.inflate(B,i):D===Z_DATA_ERROR&&(D=Z_NEED_DICT));B.avail_in>0&&D===Z_STREAM_END&&B.state.wrap>0&&N[B.next_in]!==0;)inflate_1$2.inflateReset(B),D=inflate_1$2.inflate(B,i);switch(D){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(D),this.ended=!0,!1}if(T=B.avail_out,B.next_out&&(B.avail_out===0||D===Z_STREAM_END))if(this.options.to==="string"){let A=strings.utf8border(B.output,B.next_out),U=B.next_out-A,j=strings.buf2string(B.output,A);B.next_out=U,B.avail_out=F-U,U&&B.output.set(B.output.subarray(A,A+U),0),this.onData(j)}else this.onData(B.output.length===B.next_out?B.output:B.output.subarray(0,B.next_out));if(!(D===Z_OK&&T===0)){if(D===Z_STREAM_END)return D=inflate_1$2.inflateEnd(this.strm),this.onEnd(D),this.ended=!0,!0;if(B.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(N){this.chunks.push(N)},Inflate$1.prototype.onEnd=function(N){N===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=N,this.msg=this.strm.msg};function inflate$1(N,M){const B=new Inflate$1(M);if(B.push(N),B.err)throw B.msg||messages[B.err];return B.result}function inflateRaw$1(N,M){return M=M||{},M.raw=!0,inflate$1(N,M)}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1,{Inflate,inflate,inflateRaw,ungzip}=inflate_1$1;var Deflate_1=Deflate,deflate_1=deflate,deflateRaw_1=deflateRaw,gzip_1=gzip,Inflate_1=Inflate,inflate_1=inflate,inflateRaw_1=inflateRaw,ungzip_1=ungzip,constants_1=constants$2,pako={Deflate:Deflate_1,deflate:deflate_1,deflateRaw:deflateRaw_1,gzip:gzip_1,Inflate:Inflate_1,inflate:inflate_1,inflateRaw:inflateRaw_1,ungzip:ungzip_1,constants:constants_1};const compressArrayBuffer=N=>{const M=new Uint8Array(N),B=pako.deflate(M,{gzip:!0});return new Uint8Array(B?.buffer)},decompressArrayBuffer=N=>{const M=new Uint8Array(N),B=pako.inflate(M,{gzip:!0});return new Uint8Array(B?.buffer)},sendMessageFormat=N=>{const{event:M,compress:B=!1}=N;switch(N.data_original=N.data,N.time&&(N.timeStr=u(N.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),M){case"login":N.data=com.quick.voice.proto.Login.encode(N.data).finish();break;case"joinRoom":case"joinRoomEx":N.data=com.quick.voice.proto.JoinReq.encode(N.data).finish();break;case"quitRoom":N.data=com.quick.voice.proto.QuitReq.encode(N.data).finish();break;case"connectCF":N.data=com.quick.voice.proto.ConnectCFReq.encode(N.data).finish();break;case"publish":N.data=com.quick.voice.proto.PublishReq.encode(N.data).finish();break;case"pubChannel":N.data=com.quick.voice.proto.ChannelPublishReq.encode(N.data).finish();break;case"subscribe":N.data=com.quick.voice.proto.SubscribeReq.encode(N.data).finish();break;case"subscribeEx":N.data=com.quick.voice.proto.SubscribeReq.encode(N.data).finish();break;case"updateSimulcast":N.data=com.quick.voice.proto.SubscribeReq.encode(N.data).finish();break;case"offer":N.data=com.quick.voice.proto.SdpConsult.encode(N.data).finish();break;case"answer":N.data=com.quick.voice.proto.SdpConsult.encode(N.data).finish();break;case"candidate":N.data=com.quick.voice.proto.Candidates.encode(N.data).finish();break;case"subChannel":N.data=com.quick.voice.proto.ChannelSubscribeRsq.encode(N.data).finish();break;case"closeTrack":N.data=com.quick.voice.proto.CloseTrackReq.encode(N.data).finish();break;case"renegotiate":N.data=com.quick.voice.proto.RenegotiateReq.encode(N.data).finish();break;case"reportNetwork":N.data=com.quick.voice.proto.ReportNetInfo.encode(N.data).finish();break;case"reportP2PConnectEx":N.data=com.quick.voice.proto.ReportP2PExReq.encode(N.data).finish();break;case"syncRoomInfo":N.data=com.quick.voice.proto.SyncRoomInfoReq.encode(N.data).finish();break;case"updateCall":N.data=com.quick.voice.proto.UpdateCall.encode(N.data).finish();break;case"networkQualityChange":N.data=com.quick.voice.proto.NetQualityChange.encode(N.data).finish();break;case"pubNotify":N.data=com.quick.voice.proto.PublishNotify.encode(N.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":N.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode(N.data).finish();break;case"heartbeat":N.data=com.quick.voice.proto.ReportTrafficUsage.encode(N.data).finish();break;case"ackMsg":N.data=com.quick.voice.proto.AckMsgReq.encode(N.data).finish();break;case"UpdateTrackActive":N.data=com.quick.voice.proto.UpdateTrackState.encode(N.data).finish();break;default:N.data=new Uint8Array;break}if(B)try{N.data=compressArrayBuffer(N.data)}catch(F){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息压缩错误",F)}return N},onMessageFormat=N=>{const{event:M,compress:B=!1}=N;if(N.data_remote=N.data,N.time&&(N.timeStr=u(N.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),B)try{N.data=decompressArrayBuffer(N.data)}catch(F){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",F)}switch(M){case"login":N.data=com.quick.voice.proto.Login.decode(N.data);break;case"joinRoom":case"joinRoomEx":N.data=com.quick.voice.proto.JoinRsp.decode(N.data);break;case"onJoinRoom":N.data=com.quick.voice.proto.JoinNotify.decode(N.data);break;case"onQuitRoom":N.data=com.quick.voice.proto.QuitNotify.decode(N.data);break;case"connectCF":N.data=com.quick.voice.proto.ConnectCFRsp.decode(N.data);break;case"publish":N.data=com.quick.voice.proto.PublishRsp.decode(N.data);break;case"pubChannel":N.data=com.quick.voice.proto.ChannelPublishRsq.decode(N.data);break;case"onPublish":N.data=com.quick.voice.proto.PublishNotify.decode(N.data);break;case"subscribe":N.data=com.quick.voice.proto.SubscribeRsp.decode(N.data);break;case"subscribeEx":N.data=com.quick.voice.proto.SubscribeRsp.decode(N.data);break;case"updateVideoTracks":N.data=com.quick.voice.proto.SubscribeRsp.decode(N.data);break;case"onAttemptP2PEx":N.data=com.quick.voice.proto.P2PAvailablePeerNotify.decode(N.data);break;case"onOffer":N.data=com.quick.voice.proto.SdpConsult.decode(N.data);break;case"onAnswer":N.data=com.quick.voice.proto.SdpConsult.decode(N.data);break;case"onCandidate":N.data=com.quick.voice.proto.Candidates.decode(N.data);break;case"subChannel":N.data=com.quick.voice.proto.ChannelSubscribeRsq.decode(N.data);break;case"closeTrack":N.data=com.quick.voice.proto.CloseTrackRsp.decode(N.data);break;case"onCloseTrack":N.data=com.quick.voice.proto.CloseTrackNotify.decode(N.data);break;case"onTrackInactive":N.data=com.quick.voice.proto.CheckSessionRsq.decode(N.data);break;case"onDisconnectedP2P":N.data=com.quick.voice.proto.P2PDisconnectedNotify.decode(N.data);break;case"onUpdateCall":N.data=com.quick.voice.proto.UpdateCall.decode(N.data);break;case"onDataChannelPublish":N.data=com.quick.voice.proto.UserChannel.decode(N.data);break;case"onDestroyRoom":N.data=com.quick.voice.proto.QuitNotify.decode(N.data);break;case"onUpdatePermissions":N.data=com.quick.voice.proto.UpdatePermissions.decode(N.data);break;case"onNetQuality":N.data=com.quick.voice.proto.NetQualityNotify.decode(N.data);break;case"syncRoomInfo":N.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(N.data);break;case"onCDNPlayUrlAdd":N.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(N.data);break;case"onUpdateBehavior":N.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(N.data);break;case"UpdateTrackActive":N.data=com.quick.voice.proto.UpdateTrackState.decode(N.data);break;case"onRoomUserSpeech":N.data=com.quick.voice.proto.RoomSpeechNotify.decode(N.data);break;case"debugger":case"ai":{N.data=JSON.parse(new TextDecoder().decode(N.data));break}}return N},obj2pb=N=>com.quick.voice.proto.CommonReq.encode(N).finish(),pb2obj=N=>com.quick.voice.proto.CommonRsp.decode(N),reqIgnoreEvents=["updateSeverTime"];reqIgnoreEvents.push("heartbeat"),reqIgnoreEvents.push("heartbeatEx"),reqIgnoreEvents.push("networkQualityChange"),reqIgnoreEvents.push("updateCall"),reqIgnoreEvents.push("ackMsg");const resIgnoreEvents=["updateSeverTime"];resIgnoreEvents.push("heartbeat"),resIgnoreEvents.push("heartbeatEx"),resIgnoreEvents.push("networkQualityChange"),resIgnoreEvents.push("onRoomUserSpeech"),resIgnoreEvents.push("onNetQuality"),resIgnoreEvents.push("updateCall"),resIgnoreEvents.push("pubNotify"),resIgnoreEvents.push("reportNetwork"),resIgnoreEvents.push("ackMsg"),resIgnoreEvents.push("offer"),resIgnoreEvents.push("candidate"),resIgnoreEvents.push("answer"),resIgnoreEvents.push("reportP2PConnect");class CallsWebSocket{#e={url:"wss://putplay.cqrjz.com/websocket",debug:!1,timeout:30*1e3};prws=new H({url:"",binaryType:"arraybuffer",reconnectCount:8,timeout:10*1e3,reconnectTime:40*1e3});activeTimeStamp=0;#n={};#t={};constructor(M){this.#e={...this.#e,...M},this.prws.setOptions(this.#e),this.prws.onMessage=this.#a,this.prws.getHeartbeatMsg=()=>""}getUrl=async(M="prod")=>{try{const C=(await(await fetch(`https://address.putplay.cc/?env=${M}`)).json()).domain;this.#e.url=C,this.prws.setOptions({url:C})}catch(B){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: get serve url is error.",B)}};afreshSends=()=>{const M=Object.keys(this.#n);if(M.length!==0){if(this.#e){const B=Array.from(Object.values(this.#n),F=>F.message.event);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: afreshSends",B)}for(const B of M){const F=this.#n[B];F&&F.send()}}};#r=(M,B={})=>{try{const{time:F,event:C,data:D={},data_original:i={},data_remote:T,...A}=B,U=u(F,"YYYY-MM-DD hh:mm:ss",{offset:480});let j={};const z=(ke={})=>{const ie=JSON.parse(JSON.stringify(ke)),ce=Object.keys(ie);for(const he of ce)(he.includes("sdp")||he.includes("Sdp"))&&(ie[he]="");return ie};let K="res ↓";switch(M){case"res":K="res ↓",j=z(D);break;case"req":K="req ↑",j=z(i);break}let Y="#quickvo.logs";(reqIgnoreEvents.includes(C)||resIgnoreEvents.includes(C))&&(Y="#quickvo.ignoreEvents");const te={"#action":K,timeStr:U,event:C,data:j,time:F,...A},ae=localStorage.getItem(Y)||JSON.stringify([]),se=JSON.parse(ae);let re=C==="heartbeat"||C==="heartbeatEx";const pe=[te];for(const ke of se){const{event:ie}=ke;if(ie==="heartbeat"||ie==="heartbeatEx"){if(re)continue;re=!0}if(pe.length===200)break;pe.push(ke)}localStorage.setItem(Y,JSON.stringify(pe))}catch(F){this.#e.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",F)}};#o=(M,{resolve:B,reject:F},C)=>{const{sn:D=""}=M,i={message:M,resolve:B,reject:F,send:()=>{},destruction:()=>{}};let T=0;if(C&&(T=window.setTimeout(()=>{console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: event is timeout: ${T}`,i),delete this.#n[D],F(`event is timeout: ${T}`)},this.#e.timeout)),i.destruction=()=>{clearTimeout(T),delete this.#n[D]},i.send=()=>{i.message.time=Date.now(),this.#e.debug&&!reqIgnoreEvents.includes(i.message.event)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",M);const A=com.quick.voice.proto.CommonReq.encode(M).finish();this.prws?.sendMessage(A),C||B(!0)},C){const A=this.#n[D];A&&A.destruction(),this.#n[D]=i}return i};#i=M=>this.#n[M];#a=async M=>{const B=new Uint8Array(M),F=com.quick.voice.proto.CommonRsp.decode(B),{sn:C,event:D}=F,i=onMessageFormat(F);if(this.#r("res",i),this.#e.debug&&!resIgnoreEvents.includes(D)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",i),["heartbeat","heartbeatEx"].includes(D)&&(this.activeTimeStamp=new Date().getTime()),notifyName_keys.includes(D))return this.emitNotify(D,_(i,["code","data","desc"]));const A=this.#i(C);if(A){const{resolve:U=z=>{},destruction:j=()=>{}}=A;U(_(i,["code","data","desc","sn"])),j()}};clearEvents=(M=[])=>{const B=Object.keys(this.#n);M.length===0&&(M=B);for(const F of B){if(!M.includes(F))continue;const C=this.#n[F];if(C){const{destruction:D}=C;D()}}};connect=async()=>new Promise(async(M,B)=>{try{const F=new Date().getTime();await this.prws.connect();const C=new Date().getTime();if(this.activeTimeStamp=C,this.#e.debug){const D=C-F;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${D}ms-广播事件`,this.#t)}M(this.prws)}catch(F){B(F)}});close=async()=>{this.clearEvents(),await this.prws?.close(),this.#e.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.")};sendMessage=(M,B=!0)=>new Promise(async(F,C)=>{const{event:D,...i}=M,T=Date.now(),A=sendMessageFormat({event:D,sn:+`${T}${Q(1e3,9999)}`,time:T,valid:this.#e.timeout,version:3,compress:!1,...i});this.#r("req",A),this.#o(A,{resolve:F,reject:C},B).send()});emitNotify=async(M,B)=>{const F=this.#t[M];if(!F)return;const C=[...F.keys()];for(const D of C){const i=F.get(D);if(!i)continue;const{callback:T=async()=>{}}=i;await T(B)}};addNotify=(M,B=!1)=>{M.sn||(M.sn=Mt(32));const{event:F,sn:C}=M;return this.#t[F]||(this.#t[F]=new Map),this.#t[F].set(C,M),C};removeNotify=(M=[])=>{if(M.length===0)this.#t={};else{const B=Object.keys(this.#t);for(const F of B){const C=this.#t[F];if(!C)continue;const D=[...C.keys()];for(const i of D)M.includes(i)&&C.delete(i)}}this.#e.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",this.#t)}}const createMutedAudioStream=N=>{const M=N.createOscillator();M.type="sine",M.frequency.setValueAtTime(0,N.currentTime);const B=N.createGain();B.gain.value=0,M.connect(B),B.connect(N.destination),M.start();const F=N.createMediaStreamDestination();return B.disconnect(),M.connect(F),F.stream},createFakeVideoStream=(N=10,M=10,B=1)=>{const F=document.createElement("canvas"),C=F.getContext("2d");F.width=N,F.height=M;let D=0;const i=F.captureStream(B),T=()=>{C.clearRect(0,0,F.width,F.height);const A=C.createLinearGradient(0,0,F.width,F.height);A.addColorStop(0,`hsla(${D}, 100%, 50%, 0)`),A.addColorStop(1,`hsla(${D+120}, 100%, 50%, 0)`),C.fillStyle=A,C.fillRect(0,0,F.width,F.height),D=(D+1)%360,i.active===!0&&setTimeout(T,1e3)};return T(),i},isMobile=()=>{const N=navigator.userAgent.toLowerCase();return new RegExp("mobile|android|iphone|ipad|ipod|windows phone|phone|webos","i").test(N)};var lib={},ebml={},EBML={},hasRequiredEBML;function requireEBML(){return hasRequiredEBML||(hasRequiredEBML=1,Object.defineProperty(EBML,"__esModule",{value:!0})),EBML}var EBMLDecoder={},int64Buffer={},hasRequiredInt64Buffer;function requireInt64Buffer(){return hasRequiredInt64Buffer||(hasRequiredInt64Buffer=1,(function(N){(function(M){var B="undefined",F=B!==typeof Buffer&&Buffer,C=B!==typeof Uint8Array&&Uint8Array,D=B!==typeof ArrayBuffer&&ArrayBuffer,i=[0,0,0,0,0,0,0,0],T=Array.isArray||he,A=4294967296,U=16777216,j;z("Uint64BE",!0,!0),z("Int64BE",!0,!1),z("Uint64LE",!1,!0),z("Int64LE",!1,!1);function z(ue,fe,ye){var oe=fe?0:4,de=fe?4:0,be=fe?0:3,_e=fe?1:2,we=fe?2:1,ge=fe?3:0,Ee=fe?pe:ie,qe=fe?ke:ce,Me=Re.prototype,ze="is"+ue,Ke="_"+ze;return Me.buffer=void 0,Me.offset=0,Me[Ke]=!0,Me.toNumber=He,Me.toString=Ge,Me.toJSON=He,Me.toArray=K,F&&(Me.toBuffer=Y),C&&(Me.toArrayBuffer=te),Re[ze]=$e,M[ue]=Re,Re;function Re(Oe,Se,Ie,Te){return this instanceof Re?Ve(this,Oe,Se,Ie,Te):new Re(Oe,Se,Ie,Te)}function $e(Oe){return!!(Oe&&Oe[Ke])}function Ve(Oe,Se,Ie,Te,Ce){if(C&&D&&(Se instanceof D&&(Se=new C(Se)),Te instanceof D&&(Te=new C(Te))),!Se&&!Ie&&!Te&&!j){Oe.buffer=re(i,0);return}if(!ae(Se,Ie)){var Ue=j||Array;Ce=Ie,Te=Se,Ie=0,Se=j===F?F.alloc(8):new Ue(8)}Oe.buffer=Se,Oe.offset=Ie|=0,B!==typeof Te&&(typeof Te=="string"?Ne(Se,Ie,Te,Ce||10):ae(Te,Ce)?se(Se,Ie,Te,Ce):typeof Ce=="number"?(Ze(Se,Ie+oe,Te),Ze(Se,Ie+de,Ce)):Te>0?Ee(Se,Ie,Te):Te<0?qe(Se,Ie,Te):se(Se,Ie,i,0))}function Ne(Oe,Se,Ie,Te){var Ce=0,Ue=Ie.length,je=0,Fe=0;Ie[0]==="-"&&Ce++;for(var We=Ce;Ce<Ue;){var Qe=parseInt(Ie[Ce++],Te);if(!(Qe>=0))break;Fe=Fe*Te+Qe,je=je*Te+Math.floor(Fe/A),Fe%=A}We&&(je=~je,Fe?Fe=A-Fe:je++),Ze(Oe,Se+oe,je),Ze(Oe,Se+de,Fe)}function He(){var Oe=this.buffer,Se=this.offset,Ie=Le(Oe,Se+oe),Te=Le(Oe,Se+de);return ye||(Ie|=0),Ie?Ie*A+Te:Te}function Ge(Oe){var Se=this.buffer,Ie=this.offset,Te=Le(Se,Ie+oe),Ce=Le(Se,Ie+de),Ue="",je=!ye&&Te&2147483648;for(je&&(Te=~Te,Ce=A-Ce),Oe=Oe||10;;){var Fe=Te%Oe*A+Ce;if(Te=Math.floor(Te/Oe),Ce=Math.floor(Fe/Oe),Ue=(Fe%Oe).toString(Oe)+Ue,!Te&&!Ce)break}return je&&(Ue="-"+Ue),Ue}function Ze(Oe,Se,Ie){Oe[Se+ge]=Ie&255,Ie=Ie>>8,Oe[Se+we]=Ie&255,Ie=Ie>>8,Oe[Se+_e]=Ie&255,Ie=Ie>>8,Oe[Se+be]=Ie&255}function Le(Oe,Se){return Oe[Se+be]*U+(Oe[Se+_e]<<16)+(Oe[Se+we]<<8)+Oe[Se+ge]}}function K(ue){var fe=this.buffer,ye=this.offset;return j=null,ue!==!1&&T(fe)?fe.length===8?fe:fe.slice(ye,ye+8):re(fe,ye)}function Y(ue){var fe=this.buffer,ye=this.offset;return j=F,ue!==!1&&F.isBuffer(fe)?fe.length===8?fe:fe.slice(ye,ye+8):F.from(te.call(this,ue))}function te(ue){var fe=this.buffer,ye=this.offset,oe=fe.buffer;if(j=C,ue!==!1&&!fe.offset&&oe instanceof D)return oe.byteLength===8?oe:oe.slice(ye,ye+8);var de=new C(8);return se(de,0,fe,ye),de.buffer}function ae(ue,fe){var ye=ue&&ue.length;return fe|=0,ye&&fe+8<=ye&&typeof ue[fe]!="string"}function se(ue,fe,ye,oe){fe|=0,oe|=0;for(var de=0;de<8;de++)ue[fe++]=ye[oe++]&255}function re(ue,fe){return Array.prototype.slice.call(ue,fe,fe+8)}function pe(ue,fe,ye){for(var oe=fe+8;oe>fe;)ue[--oe]=ye&255,ye/=256}function ke(ue,fe,ye){var oe=fe+8;for(ye++;oe>fe;)ue[--oe]=-ye&255^255,ye/=256}function ie(ue,fe,ye){for(var oe=fe+8;fe<oe;)ue[fe++]=ye&255,ye/=256}function ce(ue,fe,ye){var oe=fe+8;for(ye++;fe<oe;)ue[fe++]=-ye&255^255,ye/=256}function he(ue){return!!ue&&Object.prototype.toString.call(ue)=="[object Array]"}})(typeof N.nodeName!="string"?N:int64Buffer||{})})(int64Buffer)),int64Buffer}var tools={},EBMLEncoder={},ebmlID={},hasRequiredEbmlID;function requireEbmlID(){return hasRequiredEbmlID||(hasRequiredEbmlID=1,Object.defineProperty(ebmlID,"__esModule",{value:!0}),ebmlID.byEbmlID=void 0,ebmlID.byEbmlID={128:{name:"ChapterDisplay",level:4,type:"m",multiple:!0,minver:1,webm:!0,description:"Contains all possible strings to use for the chapter display."},131:{name:"TrackType",level:3,type:"u",mandatory:!0,minver:1,range:"1-254",description:"A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control)."},133:{name:"ChapString",cppname:"ChapterString",level:5,type:"8",mandatory:!0,minver:1,webm:!0,description:"Contains the string to use as the chapter atom."},134:{name:"CodecID",level:3,type:"s",mandatory:!0,minver:1,description:"An ID corresponding to the codec, see the codec page for more info."},136:{name:"FlagDefault",cppname:"TrackFlagDefault",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)"},137:{name:"ChapterTrackNumber",level:5,type:"u",mandatory:!0,multiple:!0,minver:1,webm:!1,range:"not 0",description:"UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks."},145:{name:"ChapterTimeStart",level:4,type:"u",mandatory:!0,minver:1,webm:!0,description:"Timestamp of the start of Chapter (not scaled)."},146:{name:"ChapterTimeEnd",level:4,type:"u",minver:1,webm:!1,description:"Timestamp of the end of Chapter (timestamp excluded, not scaled)."},150:{name:"CueRefTime",level:5,type:"u",mandatory:!0,minver:2,webm:!1,description:"Timestamp of the referenced Block."},151:{name:"CueRefCluster",level:5,type:"u",mandatory:!0,webm:!1,description:"The Position of the Cluster containing the referenced Block."},152:{name:"ChapterFlagHidden",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},16980:{name:"ContentCompAlgo",level:6,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping"},16981:{name:"ContentCompSettings",level:6,type:"b",minver:1,webm:!1,description:"Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track."},17026:{name:"DocType",level:1,type:"s",mandatory:!0,default:"matroska",minver:1,description:"A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files."},17029:{name:"DocTypeReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum DocType version an interpreter has to support to read this file."},17030:{name:"EBMLVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of EBML parser used to create the file."},17031:{name:"DocTypeVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of DocType interpreter used to create the file."},17476:{name:"SegmentFamily",level:2,type:"b",multiple:!0,minver:1,webm:!1,bytesize:16,description:"A randomly generated unique ID that all segments related to each other must use (128 bits)."},17505:{name:"DateUTC",level:2,type:"d",minver:1,description:"Date of the origin of timestamp (value 0), i.e. production date."},17540:{name:"TagDefault",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Indication to know if this is the default/original language to use for the given tag. (1 bit)"},17541:{name:"TagBinary",level:4,type:"b",minver:1,webm:!1,description:"The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString."},17543:{name:"TagString",level:4,type:"8",minver:1,webm:!1,description:"The value of the Element."},17545:{name:"Duration",level:2,type:"f",minver:1,range:"> 0",description:"Duration of the segment (based on TimecodeScale)."},17816:{name:"ChapterFlagEnabled",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)"},18016:{name:"FileMimeType",level:3,type:"s",mandatory:!0,minver:1,webm:!1,description:"MIME type of the file."},18017:{name:"FileUsedStartTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18018:{name:"FileUsedEndTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18037:{name:"FileReferral",level:3,type:"b",webm:!1,description:"A binary value that a track/codec can refer to when the attachment is needed."},20529:{name:"ContentEncodingOrder",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment."},20530:{name:"ContentEncodingScope",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)"},20531:{name:"ContentEncodingType",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption"},20532:{name:"ContentCompression",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking."},20533:{name:"ContentEncryption",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise."},21368:{name:"CueBlockNumber",level:4,type:"u",minver:1,default:1,range:"not 0",description:"Number of the Block in the specified Cluster."},22100:{name:"ChapterStringUID",level:4,type:"8",mandatory:!1,minver:3,webm:!0,description:"A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage."},22337:{name:"WritingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Writing application ("mkvmerge-0.3.3").'},22612:{name:"SilentTracks",cppname:"ClusterSilentTracks",level:2,type:"m",minver:1,webm:!1,description:"The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use."},25152:{name:"ContentEncoding",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Settings for one content encoding like compression or encryption."},25188:{name:"BitDepth",cppname:"AudioBitDepth",level:4,type:"u",minver:1,range:"not 0",description:"Bits per sample, mostly used for PCM."},25906:{name:"SignedElement",level:3,type:"b",multiple:!0,webm:!1,description:"An element ID whose data will be used to compute the signature."},26148:{name:"TrackTranslate",level:3,type:"m",multiple:!0,minver:1,webm:!1,description:"The track identification for the given Chapter Codec."},26897:{name:"ChapProcessCommand",cppname:"ChapterProcessCommand",level:5,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26914:{name:"ChapProcessTime",cppname:"ChapterProcessTime",level:6,type:"u",mandatory:!0,minver:1,webm:!1,description:"Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter)."},26916:{name:"ChapterTranslate",level:2,type:"m",multiple:!0,minver:1,webm:!1,description:"A tuple of corresponding ID used by chapter codecs to represent this segment."},26931:{name:"ChapProcessData",cppname:"ChapterProcessData",level:6,type:"b",mandatory:!0,minver:1,webm:!1,description:"Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands."},26948:{name:"ChapProcess",cppname:"ChapterProcess",level:4,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26965:{name:"ChapProcessCodecID",cppname:"ChapterProcessCodecID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later."},29555:{name:"Tag",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters."},29572:{name:"SegmentFilename",level:2,type:"8",minver:1,webm:!1,description:"A filename corresponding to this segment."},29766:{name:"AttachmentLink",cppname:"TrackAttachmentLink",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"The UID of an attachment that is used by this codec."},2459272:{name:"CodecName",level:3,type:"8",minver:1,description:"A human-readable string specifying the codec."},408125543:{name:"Segment",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment."},17530:{name:"TagLanguage",level:4,type:"s",mandatory:!0,minver:1,webm:!1,default:"und",description:"Specifies the language of the tag specified, in the Matroska languages form."},17827:{name:"TagName",level:4,type:"8",mandatory:!0,minver:1,webm:!1,description:"The name of the Tag that is going to be stored."},26568:{name:"SimpleTag",cppname:"TagSimple",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contains general information about the target."},25542:{name:"TagAttachmentUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment."},25540:{name:"TagChapterUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment."},25545:{name:"TagEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment."},25541:{name:"TagTrackUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment."},25546:{name:"TargetType",cppname:"TagTargetType",level:4,type:"s",minver:1,webm:!1,strong:"informational",description:'An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).'},26826:{name:"TargetTypeValue",cppname:"TagTargetTypeValue",level:4,type:"u",minver:1,webm:!1,default:50,description:"A number to indicate the logical level of the target (see TargetType)."},25536:{name:"Targets",cppname:"TagTargets",level:3,type:"m",mandatory:!0,minver:1,webm:!1,description:"Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment."},307544935:{name:"Tags",level:1,type:"m",multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here."},17677:{name:"ChapProcessPrivate",cppname:"ChapterProcessPrivate",level:5,type:"b",minver:1,webm:!1,description:'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.'},17278:{name:"ChapCountry",cppname:"ChapterCountry",level:5,type:"s",multiple:!0,minver:1,webm:!1,description:"The countries corresponding to the string, same 2 octets as in Internet domains."},17276:{name:"ChapLanguage",cppname:"ChapterLanguage",level:5,type:"s",mandatory:!0,multiple:!0,minver:1,webm:!0,default:"eng",description:"The languages corresponding to the string, in the bibliographic ISO-639-2 form."},143:{name:"ChapterTrack",level:4,type:"m",minver:1,webm:!1,description:"List of tracks on which the chapter applies. If this element is not present, all tracks apply"},25539:{name:"ChapterPhysicalEquiv",level:4,type:"u",minver:1,webm:!1,description:'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.'},28348:{name:"ChapterSegmentEditionUID",level:4,type:"u",minver:1,webm:!1,range:"not 0",description:"The EditionUID to play from the segment linked in ChapterSegmentUID."},28263:{name:"ChapterSegmentUID",level:4,type:"b",minver:1,webm:!1,range:">0",bytesize:16,description:"A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used."},29636:{name:"ChapterUID",level:4,type:"u",mandatory:!0,minver:1,webm:!0,range:"not 0",description:"A unique ID to identify the Chapter."},182:{name:"ChapterAtom",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains the atom information to use as the chapter atom (apply to all tracks)."},17885:{name:"EditionFlagOrdered",level:3,type:"u",minver:1,webm:!1,default:0,range:"0-1",description:"Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)"},17883:{name:"EditionFlagDefault",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a flag is set (1) the edition should be used as the default one. (1 bit)"},17853:{name:"EditionFlagHidden",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},17852:{name:"EditionUID",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"A unique ID to identify the edition. It's useful for tagging an edition."},17849:{name:"EditionEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains all information about a segment edition."},272869232:{name:"Chapters",level:1,type:"m",minver:1,webm:!0,description:"A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation."},18094:{name:"FileUID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,range:"not 0",description:"Unique ID representing the file, as random as possible."},18012:{name:"FileData",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The data of the file."},18030:{name:"FileName",level:3,type:"8",mandatory:!0,minver:1,webm:!1,description:"Filename of the attached file."},18046:{name:"FileDescription",level:3,type:"8",minver:1,webm:!1,description:"A human-friendly name for the attached file."},24999:{name:"AttachedFile",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"An attached file."},423732329:{name:"Attachments",level:1,type:"m",minver:1,webm:!1,description:"Contain attached files."},235:{name:"CueRefCodecState",level:5,type:"u",webm:!1,default:0,description:"The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry."},21343:{name:"CueRefNumber",level:5,type:"u",webm:!1,default:1,range:"not 0",description:"Number of the referenced Block of Track X in the specified Cluster."},219:{name:"CueReference",level:4,type:"m",multiple:!0,minver:2,webm:!1,description:"The Clusters containing the required referenced Blocks."},234:{name:"CueCodecState",level:4,type:"u",minver:2,webm:!1,default:0,description:"The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry."},178:{name:"CueDuration",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues."},240:{name:"CueRelativePosition",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.",position:"clusterRelative"},241:{name:"CueClusterPosition",level:4,type:"u",mandatory:!0,minver:1,description:"The position of the Cluster containing the required Block.",position:"segment"},247:{name:"CueTrack",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track for which a position is given."},183:{name:"CueTrackPositions",level:3,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contain positions for different tracks corresponding to the timestamp."},179:{name:"CueTime",level:3,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp according to the segment time base."},187:{name:"CuePoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains all information relative to a seek point in the segment."},475249515:{name:"Cues",level:1,type:"m",minver:1,description:'A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.'},18406:{name:"ContentSigHashAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5"},18405:{name:"ContentSigAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA"},18404:{name:"ContentSigKeyID",level:6,type:"b",minver:1,webm:!1,description:"This is the ID of the private key the data was signed with."},18403:{name:"ContentSignature",level:6,type:"b",minver:1,webm:!1,description:"A cryptographic signature of the contents."},18402:{name:"ContentEncKeyID",level:6,type:"b",minver:1,webm:!1,description:"For public key algorithms this is the ID of the public key the the data was encrypted with."},18401:{name:"ContentEncAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES"},28032:{name:"ContentEncodings",level:3,type:"m",minver:1,webm:!1,description:"Settings for several content encoding mechanisms like compression or encryption."},196:{name:"TrickMasterTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},199:{name:"TrickMasterTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},198:{name:"TrickTrackFlag",level:3,type:"u",divx:!0,default:0,description:"DivX trick track extenstions"},193:{name:"TrickTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},192:{name:"TrickTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},237:{name:"TrackJoinUID",level:5,type:"u",mandatory:!0,multiple:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of a track whose blocks are used to create this virtual track."},233:{name:"TrackJoinBlocks",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all tracks whose Blocks need to be combined to create this virtual track"},230:{name:"TrackPlaneType",level:6,type:"u",mandatory:!0,minver:3,webm:!1,description:"The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background)."},229:{name:"TrackPlaneUID",level:6,type:"u",mandatory:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of the track representing the plane."},228:{name:"TrackPlane",level:5,type:"m",mandatory:!0,multiple:!0,minver:3,webm:!1,description:"Contains a video plane track that need to be combined to create this 3D track"},227:{name:"TrackCombinePlanes",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all video plane tracks that need to be combined to create this 3D track"},226:{name:"TrackOperation",level:3,type:"m",minver:3,webm:!1,description:"Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject."},32123:{name:"ChannelPositions",cppname:"AudioPosition",level:4,type:"b",webm:!1,description:"Table of horizontal angles for each successive channel, see appendix."},159:{name:"Channels",cppname:"AudioChannels",level:4,type:"u",mandatory:!0,minver:1,default:1,range:"not 0",description:"Numbers of channels in the track."},30901:{name:"OutputSamplingFrequency",cppname:"AudioOutputSamplingFreq",level:4,type:"f",minver:1,default:"Sampling Frequency",range:"> 0",description:"Real output sampling frequency in Hz (used for SBR techniques)."},181:{name:"SamplingFrequency",cppname:"AudioSamplingFreq",level:4,type:"f",mandatory:!0,minver:1,default:8e3,range:"> 0",description:"Sampling frequency in Hz."},225:{name:"Audio",cppname:"TrackAudio",level:3,type:"m",minver:1,description:"Audio settings."},2327523:{name:"FrameRate",cppname:"VideoFrameRate",level:4,type:"f",range:"> 0",strong:"Informational",description:"Number of frames per second. only."},3126563:{name:"GammaValue",cppname:"VideoGamma",level:4,type:"f",webm:!1,range:"> 0",description:"Gamma Value."},3061028:{name:"ColourSpace",cppname:"VideoColourSpace",level:4,type:"b",minver:1,webm:!1,bytesize:4,description:"Same value as in AVI (32 bits)."},21683:{name:"AspectRatioType",cppname:"VideoAspectRatio",level:4,type:"u",minver:1,default:0,description:"Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)."},21682:{name:"DisplayUnit",cppname:"VideoDisplayUnit",level:4,type:"u",minver:1,default:0,description:"How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio)."},21690:{name:"DisplayHeight",cppname:"VideoDisplayHeight",level:4,type:"u",minver:1,default:"PixelHeight",range:"not 0",description:"Height of the video frames to display. The default value is only valid when DisplayUnit is 0."},21680:{name:"DisplayWidth",cppname:"VideoDisplayWidth",level:4,type:"u",minver:1,default:"PixelWidth",range:"not 0",description:"Width of the video frames to display. The default value is only valid when DisplayUnit is 0."},21725:{name:"PixelCropRight",cppname:"VideoPixelCropRight",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the right of the image."},21708:{name:"PixelCropLeft",cppname:"VideoPixelCropLeft",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the left of the image."},21691:{name:"PixelCropTop",cppname:"VideoPixelCropTop",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the top of the image."},21674:{name:"PixelCropBottom",cppname:"VideoPixelCropBottom",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the bottom of the image (for HDTV content)."},186:{name:"PixelHeight",cppname:"VideoPixelHeight",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Height of the encoded video frames in pixels."},176:{name:"PixelWidth",cppname:"VideoPixelWidth",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Width of the encoded video frames in pixels."},21433:{name:"OldStereoMode",level:4,type:"u",maxver:"0",webm:!1,divx:!1,description:"DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes)."},21440:{name:"AlphaMode",cppname:"VideoAlphaMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data."},21432:{name:"StereoMode",cppname:"VideoStereoMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes."},154:{name:"FlagInterlaced",cppname:"VideoFlagInterlaced",level:4,type:"u",mandatory:!0,minver:2,webm:!0,default:0,range:"0-1",description:"Set if the video is interlaced. (1 bit)"},224:{name:"Video",cppname:"TrackVideo",level:3,type:"m",minver:1,description:"Video settings."},26277:{name:"TrackTranslateTrackID",level:4,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used."},26303:{name:"TrackTranslateCodec",level:4,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},26364:{name:"TrackTranslateEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment."},22203:{name:"SeekPreRoll",level:3,type:"u",mandatory:!0,multiple:!1,default:0,minver:4,webm:!0,description:"After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid."},22186:{name:"CodecDelay",level:3,type:"u",multiple:!1,default:0,minver:4,webm:!0,description:"CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster."},28587:{name:"TrackOverlay",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc."},170:{name:"CodecDecodeAll",level:3,type:"u",mandatory:!0,minver:2,webm:!1,default:1,range:"0-1",description:"The codec can decode potentially damaged data (1 bit)."},2536e3:{name:"CodecDownloadURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to download about the codec used."},3883072:{name:"CodecInfoURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to find information about the codec used."},3839639:{name:"CodecSettings",level:3,type:"8",webm:!1,description:"A string describing the encoding setting used."},25506:{name:"CodecPrivate",level:3,type:"b",minver:1,description:"Private data only known to the codec."},2274716:{name:"Language",cppname:"TrackLanguage",level:3,type:"s",minver:1,default:"eng",description:"Specifies the language of the track in the Matroska languages form."},21358:{name:"Name",cppname:"TrackName",level:3,type:"8",minver:1,description:"A human-readable track name."},21998:{name:"MaxBlockAdditionID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The maximum value of BlockAdditions for this track."},21375:{name:"TrackOffset",level:3,type:"i",webm:!1,default:0,description:"A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track."},2306383:{name:"TrackTimecodeScale",level:3,type:"f",mandatory:!0,minver:1,maxver:"3",webm:!1,default:1,range:"> 0",description:"DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)."},2313850:{name:"DefaultDecodedFieldDuration",cppname:"TrackDefaultDecodedFieldDuration",level:3,type:"u",minver:4,range:"not 0",description:`The period in nanoseconds (not scaled by TimcodeScale)
4
+ between two successive fields at the output of the decoding process (see the notes)`},2352003:{name:"DefaultDuration",cppname:"TrackDefaultDuration",level:3,type:"u",minver:1,range:"not 0",description:"Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block)."},28152:{name:"MaxCache",cppname:"TrackMaxCache",level:3,type:"u",minver:1,webm:!1,description:"The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed."},28135:{name:"MinCache",cppname:"TrackMinCache",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used."},156:{name:"FlagLacing",cppname:"TrackFlagLacing",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if the track may contain blocks using lacing. (1 bit)"},21930:{name:"FlagForced",cppname:"TrackFlagForced",level:3,type:"u",mandatory:!0,minver:1,default:0,range:"0-1",description:"Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)"},185:{name:"FlagEnabled",cppname:"TrackFlagEnabled",level:3,type:"u",mandatory:!0,minver:2,webm:!0,default:1,range:"0-1",description:"Set if the track is usable. (1 bit)"},29637:{name:"TrackUID",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file."},215:{name:"TrackNumber",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)."},174:{name:"TrackEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Describes a track with all elements."},374648427:{name:"Tracks",level:1,type:"m",multiple:!0,minver:1,description:"A top-level block of information with many tracks described."},175:{name:"EncryptedBlock",level:2,type:"b",multiple:!0,webm:!1,description:"Similar to EncryptedBlock Structure)"},202:{name:"ReferenceTimeCode",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},201:{name:"ReferenceOffset",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},200:{name:"ReferenceFrame",level:3,type:"m",multiple:!1,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},207:{name:"SliceDuration",level:5,type:"u",default:0,description:"The (scaled) duration to apply to the element."},206:{name:"Delay",cppname:"SliceDelay",level:5,type:"u",default:0,description:"The (scaled) delay to apply to the element."},203:{name:"BlockAdditionID",cppname:"SliceBlockAddID",level:5,type:"u",default:0,description:"The ID of the BlockAdditional element (0 is the main Block)."},205:{name:"FrameNumber",cppname:"SliceFrameNumber",level:5,type:"u",default:0,description:"The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)."},204:{name:"LaceNumber",cppname:"SliceLaceNumber",level:5,type:"u",minver:1,default:0,divx:!1,description:"The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},232:{name:"TimeSlice",level:4,type:"m",multiple:!0,minver:1,divx:!1,description:"Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},142:{name:"Slices",level:3,type:"m",minver:1,divx:!1,description:"Contains slices description."},30114:{name:"DiscardPadding",level:3,type:"i",minver:4,webm:!0,description:"Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback."},164:{name:"CodecState",level:3,type:"b",minver:2,webm:!1,description:"The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry."},253:{name:"ReferenceVirtual",level:3,type:"i",webm:!1,description:"Relative position of the data that should be in position of the virtual block."},251:{name:"ReferenceBlock",level:3,type:"i",multiple:!0,minver:1,description:"Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to."},250:{name:"ReferencePriority",cppname:"FlagReferenced",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced."},155:{name:"BlockDuration",level:3,type:"u",minver:1,default:"TrackDuration",description:'The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.'},165:{name:"BlockAdditional",level:5,type:"b",mandatory:!0,minver:1,webm:!1,description:"Interpreted by the codec as it wishes (using the BlockAddID)."},238:{name:"BlockAddID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"An ID to identify the BlockAdditional level."},166:{name:"BlockMore",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contain the BlockAdditional and some parameters."},30113:{name:"BlockAdditions",level:3,type:"m",minver:1,webm:!1,description:"Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data."},162:{name:"BlockVirtual",level:3,type:"b",webm:!1,description:"A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)"},161:{name:"Block",level:3,type:"b",mandatory:!0,minver:1,description:"Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)"},160:{name:"BlockGroup",level:2,type:"m",multiple:!0,minver:1,description:"Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock."},163:{name:"SimpleBlock",level:2,type:"b",multiple:!0,minver:2,webm:!0,divx:!0,description:"Similar to SimpleBlock Structure"},171:{name:"PrevSize",cppname:"ClusterPrevSize",level:2,type:"u",minver:1,description:"Size of the previous Cluster, in octets. Can be useful for backward playing.",position:"prevCluster"},167:{name:"Position",cppname:"ClusterPosition",level:2,type:"u",minver:1,webm:!1,description:"The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.",position:"segment"},22743:{name:"SilentTrackNumber",cppname:"ClusterSilentTrackNumber",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster."},231:{name:"Timecode",cppname:"ClusterTimecode",level:2,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp of the cluster (based on TimecodeScale)."},524531317:{name:"Cluster",level:1,type:"m",multiple:!0,minver:1,description:"The lower level element containing the (monolithic) Block structure."},19840:{name:"MuxingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Muxing application or library ("libmatroska-0.4.3").'},31657:{name:"Title",level:2,type:"8",minver:1,webm:!1,description:"General name of the segment."},2807730:{name:"TimecodeScaleDenominator",level:2,type:"u",mandatory:!0,minver:4,default:"1000000000",description:"Timestamp scale numerator, see TimecodeScale."},2807729:{name:"TimecodeScale",level:2,type:"u",mandatory:!0,minver:1,default:"1000000",description:"Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds)."},27045:{name:"ChapterTranslateID",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used."},27071:{name:"ChapterTranslateCodec",level:3,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},27132:{name:"ChapterTranslateEditionUID",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment."},4096955:{name:"NextFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the next segment."},4110627:{name:"NextUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the next chained segment (128 bits)."},3965867:{name:"PrevFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the previous segment."},3979555:{name:"PrevUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the previous chained segment (128 bits)."},29604:{name:"SegmentUID",level:2,type:"b",minver:1,webm:!1,range:"not 0",bytesize:16,description:"A randomly generated unique ID to identify the current segment between many others (128 bits)."},357149030:{name:"Info",level:1,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains miscellaneous general information and statistics on the file."},21420:{name:"SeekPosition",level:3,type:"u",mandatory:!0,minver:1,description:"The position of the element in the segment in octets (0 = first level 1 element).",position:"segment"},21419:{name:"SeekID",level:3,type:"b",mandatory:!0,minver:1,description:"The binary ID corresponding to the element name.",type2:"ebmlID"},19899:{name:"Seek",cppname:"SeekPoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains a single seek entry to an EBML element."},290298740:{name:"SeekHead",cppname:"SeekHeader",level:1,type:"m",multiple:!0,minver:1,description:"Contains the position of other level 1 elements."},32379:{name:"SignatureElementList",level:2,type:"m",multiple:!0,webm:!1,i:"Cluster|Block|BlockAdditional",description:"A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption."},32347:{name:"SignatureElements",level:1,type:"m",webm:!1,description:"Contains elements that will be used to compute the signature."},32437:{name:"Signature",level:1,type:"b",webm:!1,description:"The signature of the data (until a new."},32421:{name:"SignaturePublicKey",level:1,type:"b",webm:!1,description:"The public key to use with the algorithm (in the case of a PKI-based signature)."},32410:{name:"SignatureHash",level:1,type:"u",webm:!1,description:"Hash algorithm used (1=SHA1-160, 2=MD5)."},32394:{name:"SignatureAlgo",level:1,type:"u",webm:!1,description:"Signature algorithm used (1=RSA, 2=elliptic)."},458458727:{name:"SignatureSlot",level:-1,type:"m",multiple:!0,webm:!1,description:"Contain signature of some (coming) elements in the stream."},191:{name:"CRC-32",level:-1,type:"b",minver:1,webm:!1,description:"The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian",crc:!0},236:{name:"Void",level:-1,type:"b",minver:1,description:"Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use."},17139:{name:"EBMLMaxSizeLength",level:1,type:"u",mandatory:!0,default:8,minver:1,description:"The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid."},17138:{name:"EBMLMaxIDLength",level:1,type:"u",mandatory:!0,default:4,minver:1,description:"The maximum length of the IDs you'll find in this file (4 or less in Matroska)."},17143:{name:"EBMLReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum EBML version a parser has to support to read this file."},440786851:{name:"EBML",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"Set the EBML characteristics of the data to follow. Each EBML document has to start with this."},21936:{name:"Colour",level:"4",type:"m",mandatory:!0,multiple:!0,description:"Settings describing the colour format."},21937:{name:"MatrixCoefficients",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273."},21945:{name:"Range",level:"5",type:"u",mandatory:!0,multiple:!0,description:"Clipping of the color ranges."},21946:{name:"TransferCharacteristics",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The transfer characteristics of the video."},21947:{name:"Primaries",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273."}}),ebmlID}var hasRequiredEBMLEncoder;function requireEBMLEncoder(){if(hasRequiredEBMLEncoder)return EBMLEncoder;hasRequiredEBMLEncoder=1,Object.defineProperty(EBMLEncoder,"__esModule",{value:!0});var N=requireTools(),M=requireTools(),B=requireEbmlID(),F=(function(){function C(){this._schema=B.byEbmlID,this._buffers=[],this._stack=[]}return C.prototype.encode=function(D){var i=this;return N.concat(D.reduce(function(T,A){return T.concat(i.encodeChunk(A))},[])).buffer},C.prototype.encodeChunk=function(D){return D.type==="m"?D.isEnd?this.endTag(D):this.startTag(D):(D.data=M.Buffer.from(D.data),this.writeTag(D)),this.flush()},C.prototype.flush=function(){var D=this._buffers;return this._buffers=[],D},C.prototype.getSchemaInfo=function(D){for(var i=Object.keys(this._schema).map(Number),T=0;T<i.length;T++){var A=i[T];if(this._schema[A].name===D)return new M.Buffer(A.toString(16),"hex")}return null},C.prototype.writeTag=function(D){var i=D.name,T=this.getSchemaInfo(i),A=D.data;if(T==null)throw new Error("No schema entry found for "+i);var U=N.encodeTag(T,A);if(this._stack.length>0){var j=this._stack[this._stack.length-1];j.children.push({tagId:T,elm:D,children:[],data:U});return}this._buffers=this._buffers.concat(U)},C.prototype.startTag=function(D){var i=D.name,T=this.getSchemaInfo(i);if(T==null)throw new Error("No schema entry found for "+i);if(D.unknownSize){var A=N.encodeTag(T,new M.Buffer(0),D.unknownSize);this._buffers=this._buffers.concat(A);return}var U={tagId:T,elm:D,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(U),this._stack.push(U)},C.prototype.endTag=function(D){D.name;var i=this._stack.pop();if(i==null)throw new Error("EBML structure is broken");if(i.elm.name!==D.name)throw new Error("EBML structure is broken");var T=i.children.reduce(function(U,j){if(j.data===null)throw new Error("EBML structure is broken");return U.concat(j.data)},[]),A=N.concat(T);i.elm.type==="m"?i.data=N.encodeTag(i.tagId,A,i.elm.unknownSize):i.data=N.encodeTag(i.tagId,A),this._stack.length<1&&(this._buffers=this._buffers.concat(i.data))},C})();return EBMLEncoder.default=F,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=T,base64Js.toByteArray=U,base64Js.fromByteArray=K;for(var N=[],M=[],B=typeof Uint8Array<"u"?Uint8Array:Array,F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=0,D=F.length;C<D;++C)N[C]=F[C],M[F.charCodeAt(C)]=C;M[45]=62,M[95]=63;function i(Y){var te=Y.length;if(te%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var ae=Y.indexOf("=");ae===-1&&(ae=te);var se=ae===te?0:4-ae%4;return[ae,se]}function T(Y){var te=i(Y),ae=te[0],se=te[1];return(ae+se)*3/4-se}function A(Y,te,ae){return(te+ae)*3/4-ae}function U(Y){var te,ae=i(Y),se=ae[0],re=ae[1],pe=new B(A(Y,se,re)),ke=0,ie=re>0?se-4:se,ce;for(ce=0;ce<ie;ce+=4)te=M[Y.charCodeAt(ce)]<<18|M[Y.charCodeAt(ce+1)]<<12|M[Y.charCodeAt(ce+2)]<<6|M[Y.charCodeAt(ce+3)],pe[ke++]=te>>16&255,pe[ke++]=te>>8&255,pe[ke++]=te&255;return re===2&&(te=M[Y.charCodeAt(ce)]<<2|M[Y.charCodeAt(ce+1)]>>4,pe[ke++]=te&255),re===1&&(te=M[Y.charCodeAt(ce)]<<10|M[Y.charCodeAt(ce+1)]<<4|M[Y.charCodeAt(ce+2)]>>2,pe[ke++]=te>>8&255,pe[ke++]=te&255),pe}function j(Y){return N[Y>>18&63]+N[Y>>12&63]+N[Y>>6&63]+N[Y&63]}function z(Y,te,ae){for(var se,re=[],pe=te;pe<ae;pe+=3)se=(Y[pe]<<16&16711680)+(Y[pe+1]<<8&65280)+(Y[pe+2]&255),re.push(j(se));return re.join("")}function K(Y){for(var te,ae=Y.length,se=ae%3,re=[],pe=16383,ke=0,ie=ae-se;ke<ie;ke+=pe)re.push(z(Y,ke,ke+pe>ie?ie:ke+pe));return se===1?(te=Y[ae-1],re.push(N[te>>2]+N[te<<4&63]+"==")):se===2&&(te=(Y[ae-2]<<8)+Y[ae-1],re.push(N[te>>10]+N[te>>4&63]+N[te<<2&63]+"=")),re.join("")}return base64Js}var ieee754={};var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754.read=function(N,M,B,F,C){var D,i,T=C*8-F-1,A=(1<<T)-1,U=A>>1,j=-7,z=B?C-1:0,K=B?-1:1,Y=N[M+z];for(z+=K,D=Y&(1<<-j)-1,Y>>=-j,j+=T;j>0;D=D*256+N[M+z],z+=K,j-=8);for(i=D&(1<<-j)-1,D>>=-j,j+=F;j>0;i=i*256+N[M+z],z+=K,j-=8);if(D===0)D=1-U;else{if(D===A)return i?NaN:(Y?-1:1)*(1/0);i=i+Math.pow(2,F),D=D-U}return(Y?-1:1)*i*Math.pow(2,D-F)},ieee754.write=function(N,M,B,F,C,D){var i,T,A,U=D*8-C-1,j=(1<<U)-1,z=j>>1,K=C===23?Math.pow(2,-24)-Math.pow(2,-77):0,Y=F?0:D-1,te=F?1:-1,ae=M<0||M===0&&1/M<0?1:0;for(M=Math.abs(M),isNaN(M)||M===1/0?(T=isNaN(M)?1:0,i=j):(i=Math.floor(Math.log(M)/Math.LN2),M*(A=Math.pow(2,-i))<1&&(i--,A*=2),i+z>=1?M+=K/A:M+=K*Math.pow(2,1-z),M*A>=2&&(i++,A/=2),i+z>=j?(T=0,i=j):i+z>=1?(T=(M*A-1)*Math.pow(2,C),i=i+z):(T=M*Math.pow(2,z-1)*Math.pow(2,C),i=0));C>=8;N[B+Y]=T&255,Y+=te,T/=256,C-=8);for(i=i<<C|T,U+=C;U>0;N[B+Y]=i&255,Y+=te,i/=256,U-=8);N[B+Y-te]|=ae*128}),ieee754}var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,(function(N){const M=requireBase64Js(),B=requireIeee754(),F=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;N.Buffer=T,N.SlowBuffer=pe,N.INSPECT_MAX_BYTES=50;const C=2147483647;N.kMaxLength=C,T.TYPED_ARRAY_SUPPORT=D(),!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function D(){try{const ee=new Uint8Array(1),Z={foo:function(){return 42}};return Object.setPrototypeOf(Z,Uint8Array.prototype),Object.setPrototypeOf(ee,Z),ee.foo()===42}catch{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}}),Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function i(ee){if(ee>C)throw new RangeError('The value "'+ee+'" is invalid for option "size"');const Z=new Uint8Array(ee);return Object.setPrototypeOf(Z,T.prototype),Z}function T(ee,Z,J){if(typeof ee=="number"){if(typeof Z=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return z(ee)}return A(ee,Z,J)}T.poolSize=8192;function A(ee,Z,J){if(typeof ee=="string")return K(ee,Z);if(ArrayBuffer.isView(ee))return te(ee);if(ee==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ee);if(Je(ee,ArrayBuffer)||ee&&Je(ee.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Je(ee,SharedArrayBuffer)||ee&&Je(ee.buffer,SharedArrayBuffer)))return ae(ee,Z,J);if(typeof ee=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ne=ee.valueOf&&ee.valueOf();if(ne!=null&&ne!==ee)return T.from(ne,Z,J);const le=se(ee);if(le)return le;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ee[Symbol.toPrimitive]=="function")return T.from(ee[Symbol.toPrimitive]("string"),Z,J);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ee)}T.from=function(ee,Z,J){return A(ee,Z,J)},Object.setPrototypeOf(T.prototype,Uint8Array.prototype),Object.setPrototypeOf(T,Uint8Array);function U(ee){if(typeof ee!="number")throw new TypeError('"size" argument must be of type number');if(ee<0)throw new RangeError('The value "'+ee+'" is invalid for option "size"')}function j(ee,Z,J){return U(ee),ee<=0?i(ee):Z!==void 0?typeof J=="string"?i(ee).fill(Z,J):i(ee).fill(Z):i(ee)}T.alloc=function(ee,Z,J){return j(ee,Z,J)};function z(ee){return U(ee),i(ee<0?0:re(ee)|0)}T.allocUnsafe=function(ee){return z(ee)},T.allocUnsafeSlow=function(ee){return z(ee)};function K(ee,Z){if((typeof Z!="string"||Z==="")&&(Z="utf8"),!T.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);const J=ke(ee,Z)|0;let ne=i(J);const le=ne.write(ee,Z);return le!==J&&(ne=ne.slice(0,le)),ne}function Y(ee){const Z=ee.length<0?0:re(ee.length)|0,J=i(Z);for(let ne=0;ne<Z;ne+=1)J[ne]=ee[ne]&255;return J}function te(ee){if(Je(ee,Uint8Array)){const Z=new Uint8Array(ee);return ae(Z.buffer,Z.byteOffset,Z.byteLength)}return Y(ee)}function ae(ee,Z,J){if(Z<0||ee.byteLength<Z)throw new RangeError('"offset" is outside of buffer bounds');if(ee.byteLength<Z+(J||0))throw new RangeError('"length" is outside of buffer bounds');let ne;return Z===void 0&&J===void 0?ne=new Uint8Array(ee):J===void 0?ne=new Uint8Array(ee,Z):ne=new Uint8Array(ee,Z,J),Object.setPrototypeOf(ne,T.prototype),ne}function se(ee){if(T.isBuffer(ee)){const Z=re(ee.length)|0,J=i(Z);return J.length===0||ee.copy(J,0,0,Z),J}if(ee.length!==void 0)return typeof ee.length!="number"||nt(ee.length)?i(0):Y(ee);if(ee.type==="Buffer"&&Array.isArray(ee.data))return Y(ee.data)}function re(ee){if(ee>=C)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C.toString(16)+" bytes");return ee|0}function pe(ee){return+ee!=ee&&(ee=0),T.alloc(+ee)}T.isBuffer=function(Z){return Z!=null&&Z._isBuffer===!0&&Z!==T.prototype},T.compare=function(Z,J){if(Je(Z,Uint8Array)&&(Z=T.from(Z,Z.offset,Z.byteLength)),Je(J,Uint8Array)&&(J=T.from(J,J.offset,J.byteLength)),!T.isBuffer(Z)||!T.isBuffer(J))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Z===J)return 0;let ne=Z.length,le=J.length;for(let me=0,ve=Math.min(ne,le);me<ve;++me)if(Z[me]!==J[me]){ne=Z[me],le=J[me];break}return ne<le?-1:le<ne?1:0},T.isEncoding=function(Z){switch(String(Z).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},T.concat=function(Z,J){if(!Array.isArray(Z))throw new TypeError('"list" argument must be an Array of Buffers');if(Z.length===0)return T.alloc(0);let ne;if(J===void 0)for(J=0,ne=0;ne<Z.length;++ne)J+=Z[ne].length;const le=T.allocUnsafe(J);let me=0;for(ne=0;ne<Z.length;++ne){let ve=Z[ne];if(Je(ve,Uint8Array))me+ve.length>le.length?(T.isBuffer(ve)||(ve=T.from(ve)),ve.copy(le,me)):Uint8Array.prototype.set.call(le,ve,me);else if(T.isBuffer(ve))ve.copy(le,me);else throw new TypeError('"list" argument must be an Array of Buffers');me+=ve.length}return le};function ke(ee,Z){if(T.isBuffer(ee))return ee.length;if(ArrayBuffer.isView(ee)||Je(ee,ArrayBuffer))return ee.byteLength;if(typeof ee!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ee);const J=ee.length,ne=arguments.length>2&&arguments[2]===!0;if(!ne&&J===0)return 0;let le=!1;for(;;)switch(Z){case"ascii":case"latin1":case"binary":return J;case"utf8":case"utf-8":return We(ee).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J*2;case"hex":return J>>>1;case"base64":return Xe(ee).length;default:if(le)return ne?-1:We(ee).length;Z=(""+Z).toLowerCase(),le=!0}}T.byteLength=ke;function ie(ee,Z,J){let ne=!1;if((Z===void 0||Z<0)&&(Z=0),Z>this.length||((J===void 0||J>this.length)&&(J=this.length),J<=0)||(J>>>=0,Z>>>=0,J<=Z))return"";for(ee||(ee="utf8");;)switch(ee){case"hex":return ze(this,Z,J);case"utf8":case"utf-8":return we(this,Z,J);case"ascii":return qe(this,Z,J);case"latin1":case"binary":return Me(this,Z,J);case"base64":return _e(this,Z,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,Z,J);default:if(ne)throw new TypeError("Unknown encoding: "+ee);ee=(ee+"").toLowerCase(),ne=!0}}T.prototype._isBuffer=!0;function ce(ee,Z,J){const ne=ee[Z];ee[Z]=ee[J],ee[J]=ne}T.prototype.swap16=function(){const Z=this.length;if(Z%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let J=0;J<Z;J+=2)ce(this,J,J+1);return this},T.prototype.swap32=function(){const Z=this.length;if(Z%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let J=0;J<Z;J+=4)ce(this,J,J+3),ce(this,J+1,J+2);return this},T.prototype.swap64=function(){const Z=this.length;if(Z%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let J=0;J<Z;J+=8)ce(this,J,J+7),ce(this,J+1,J+6),ce(this,J+2,J+5),ce(this,J+3,J+4);return this},T.prototype.toString=function(){const Z=this.length;return Z===0?"":arguments.length===0?we(this,0,Z):ie.apply(this,arguments)},T.prototype.toLocaleString=T.prototype.toString,T.prototype.equals=function(Z){if(!T.isBuffer(Z))throw new TypeError("Argument must be a Buffer");return this===Z?!0:T.compare(this,Z)===0},T.prototype.inspect=function(){let Z="";const J=N.INSPECT_MAX_BYTES;return Z=this.toString("hex",0,J).replace(/(.{2})/g,"$1 ").trim(),this.length>J&&(Z+=" ... "),"<Buffer "+Z+">"},F&&(T.prototype[F]=T.prototype.inspect),T.prototype.compare=function(Z,J,ne,le,me){if(Je(Z,Uint8Array)&&(Z=T.from(Z,Z.offset,Z.byteLength)),!T.isBuffer(Z))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Z);if(J===void 0&&(J=0),ne===void 0&&(ne=Z?Z.length:0),le===void 0&&(le=0),me===void 0&&(me=this.length),J<0||ne>Z.length||le<0||me>this.length)throw new RangeError("out of range index");if(le>=me&&J>=ne)return 0;if(le>=me)return-1;if(J>=ne)return 1;if(J>>>=0,ne>>>=0,le>>>=0,me>>>=0,this===Z)return 0;let ve=me-le,xe=ne-J;const De=Math.min(ve,xe),Ae=this.slice(le,me),Be=Z.slice(J,ne);for(let Pe=0;Pe<De;++Pe)if(Ae[Pe]!==Be[Pe]){ve=Ae[Pe],xe=Be[Pe];break}return ve<xe?-1:xe<ve?1:0};function he(ee,Z,J,ne,le){if(ee.length===0)return-1;if(typeof J=="string"?(ne=J,J=0):J>2147483647?J=2147483647:J<-2147483648&&(J=-2147483648),J=+J,nt(J)&&(J=le?0:ee.length-1),J<0&&(J=ee.length+J),J>=ee.length){if(le)return-1;J=ee.length-1}else if(J<0)if(le)J=0;else return-1;if(typeof Z=="string"&&(Z=T.from(Z,ne)),T.isBuffer(Z))return Z.length===0?-1:ue(ee,Z,J,ne,le);if(typeof Z=="number")return Z=Z&255,typeof Uint8Array.prototype.indexOf=="function"?le?Uint8Array.prototype.indexOf.call(ee,Z,J):Uint8Array.prototype.lastIndexOf.call(ee,Z,J):ue(ee,[Z],J,ne,le);throw new TypeError("val must be string, number or Buffer")}function ue(ee,Z,J,ne,le){let me=1,ve=ee.length,xe=Z.length;if(ne!==void 0&&(ne=String(ne).toLowerCase(),ne==="ucs2"||ne==="ucs-2"||ne==="utf16le"||ne==="utf-16le")){if(ee.length<2||Z.length<2)return-1;me=2,ve/=2,xe/=2,J/=2}function De(Be,Pe){return me===1?Be[Pe]:Be.readUInt16BE(Pe*me)}let Ae;if(le){let Be=-1;for(Ae=J;Ae<ve;Ae++)if(De(ee,Ae)===De(Z,Be===-1?0:Ae-Be)){if(Be===-1&&(Be=Ae),Ae-Be+1===xe)return Be*me}else Be!==-1&&(Ae-=Ae-Be),Be=-1}else for(J+xe>ve&&(J=ve-xe),Ae=J;Ae>=0;Ae--){let Be=!0;for(let Pe=0;Pe<xe;Pe++)if(De(ee,Ae+Pe)!==De(Z,Pe)){Be=!1;break}if(Be)return Ae}return-1}T.prototype.includes=function(Z,J,ne){return this.indexOf(Z,J,ne)!==-1},T.prototype.indexOf=function(Z,J,ne){return he(this,Z,J,ne,!0)},T.prototype.lastIndexOf=function(Z,J,ne){return he(this,Z,J,ne,!1)};function fe(ee,Z,J,ne){J=Number(J)||0;const le=ee.length-J;ne?(ne=Number(ne),ne>le&&(ne=le)):ne=le;const me=Z.length;ne>me/2&&(ne=me/2);let ve;for(ve=0;ve<ne;++ve){const xe=parseInt(Z.substr(ve*2,2),16);if(nt(xe))return ve;ee[J+ve]=xe}return ve}function ye(ee,Z,J,ne){return et(We(Z,ee.length-J),ee,J,ne)}function oe(ee,Z,J,ne){return et(Qe(Z),ee,J,ne)}function de(ee,Z,J,ne){return et(Xe(Z),ee,J,ne)}function be(ee,Z,J,ne){return et(tt(Z,ee.length-J),ee,J,ne)}T.prototype.write=function(Z,J,ne,le){if(J===void 0)le="utf8",ne=this.length,J=0;else if(ne===void 0&&typeof J=="string")le=J,ne=this.length,J=0;else if(isFinite(J))J=J>>>0,isFinite(ne)?(ne=ne>>>0,le===void 0&&(le="utf8")):(le=ne,ne=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const me=this.length-J;if((ne===void 0||ne>me)&&(ne=me),Z.length>0&&(ne<0||J<0)||J>this.length)throw new RangeError("Attempt to write outside buffer bounds");le||(le="utf8");let ve=!1;for(;;)switch(le){case"hex":return fe(this,Z,J,ne);case"utf8":case"utf-8":return ye(this,Z,J,ne);case"ascii":case"latin1":case"binary":return oe(this,Z,J,ne);case"base64":return de(this,Z,J,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return be(this,Z,J,ne);default:if(ve)throw new TypeError("Unknown encoding: "+le);le=(""+le).toLowerCase(),ve=!0}},T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _e(ee,Z,J){return Z===0&&J===ee.length?M.fromByteArray(ee):M.fromByteArray(ee.slice(Z,J))}function we(ee,Z,J){J=Math.min(ee.length,J);const ne=[];let le=Z;for(;le<J;){const me=ee[le];let ve=null,xe=me>239?4:me>223?3:me>191?2:1;if(le+xe<=J){let De,Ae,Be,Pe;switch(xe){case 1:me<128&&(ve=me);break;case 2:De=ee[le+1],(De&192)===128&&(Pe=(me&31)<<6|De&63,Pe>127&&(ve=Pe));break;case 3:De=ee[le+1],Ae=ee[le+2],(De&192)===128&&(Ae&192)===128&&(Pe=(me&15)<<12|(De&63)<<6|Ae&63,Pe>2047&&(Pe<55296||Pe>57343)&&(ve=Pe));break;case 4:De=ee[le+1],Ae=ee[le+2],Be=ee[le+3],(De&192)===128&&(Ae&192)===128&&(Be&192)===128&&(Pe=(me&15)<<18|(De&63)<<12|(Ae&63)<<6|Be&63,Pe>65535&&Pe<1114112&&(ve=Pe))}}ve===null?(ve=65533,xe=1):ve>65535&&(ve-=65536,ne.push(ve>>>10&1023|55296),ve=56320|ve&1023),ne.push(ve),le+=xe}return Ee(ne)}const ge=4096;function Ee(ee){const Z=ee.length;if(Z<=ge)return String.fromCharCode.apply(String,ee);let J="",ne=0;for(;ne<Z;)J+=String.fromCharCode.apply(String,ee.slice(ne,ne+=ge));return J}function qe(ee,Z,J){let ne="";J=Math.min(ee.length,J);for(let le=Z;le<J;++le)ne+=String.fromCharCode(ee[le]&127);return ne}function Me(ee,Z,J){let ne="";J=Math.min(ee.length,J);for(let le=Z;le<J;++le)ne+=String.fromCharCode(ee[le]);return ne}function ze(ee,Z,J){const ne=ee.length;(!Z||Z<0)&&(Z=0),(!J||J<0||J>ne)&&(J=ne);let le="";for(let me=Z;me<J;++me)le+=it[ee[me]];return le}function Ke(ee,Z,J){const ne=ee.slice(Z,J);let le="";for(let me=0;me<ne.length-1;me+=2)le+=String.fromCharCode(ne[me]+ne[me+1]*256);return le}T.prototype.slice=function(Z,J){const ne=this.length;Z=~~Z,J=J===void 0?ne:~~J,Z<0?(Z+=ne,Z<0&&(Z=0)):Z>ne&&(Z=ne),J<0?(J+=ne,J<0&&(J=0)):J>ne&&(J=ne),J<Z&&(J=Z);const le=this.subarray(Z,J);return Object.setPrototypeOf(le,T.prototype),le};function Re(ee,Z,J){if(ee%1!==0||ee<0)throw new RangeError("offset is not uint");if(ee+Z>J)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(Z,J,ne){Z=Z>>>0,J=J>>>0,ne||Re(Z,J,this.length);let le=this[Z],me=1,ve=0;for(;++ve<J&&(me*=256);)le+=this[Z+ve]*me;return le},T.prototype.readUintBE=T.prototype.readUIntBE=function(Z,J,ne){Z=Z>>>0,J=J>>>0,ne||Re(Z,J,this.length);let le=this[Z+--J],me=1;for(;J>0&&(me*=256);)le+=this[Z+--J]*me;return le},T.prototype.readUint8=T.prototype.readUInt8=function(Z,J){return Z=Z>>>0,J||Re(Z,1,this.length),this[Z]},T.prototype.readUint16LE=T.prototype.readUInt16LE=function(Z,J){return Z=Z>>>0,J||Re(Z,2,this.length),this[Z]|this[Z+1]<<8},T.prototype.readUint16BE=T.prototype.readUInt16BE=function(Z,J){return Z=Z>>>0,J||Re(Z,2,this.length),this[Z]<<8|this[Z+1]},T.prototype.readUint32LE=T.prototype.readUInt32LE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),(this[Z]|this[Z+1]<<8|this[Z+2]<<16)+this[Z+3]*16777216},T.prototype.readUint32BE=T.prototype.readUInt32BE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),this[Z]*16777216+(this[Z+1]<<16|this[Z+2]<<8|this[Z+3])},T.prototype.readBigUInt64LE=Ye(function(Z){Z=Z>>>0,Ce(Z,"offset");const J=this[Z],ne=this[Z+7];(J===void 0||ne===void 0)&&Ue(Z,this.length-8);const le=J+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24,me=this[++Z]+this[++Z]*2**8+this[++Z]*2**16+ne*2**24;return BigInt(le)+(BigInt(me)<<BigInt(32))}),T.prototype.readBigUInt64BE=Ye(function(Z){Z=Z>>>0,Ce(Z,"offset");const J=this[Z],ne=this[Z+7];(J===void 0||ne===void 0)&&Ue(Z,this.length-8);const le=J*2**24+this[++Z]*2**16+this[++Z]*2**8+this[++Z],me=this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ne;return(BigInt(le)<<BigInt(32))+BigInt(me)}),T.prototype.readIntLE=function(Z,J,ne){Z=Z>>>0,J=J>>>0,ne||Re(Z,J,this.length);let le=this[Z],me=1,ve=0;for(;++ve<J&&(me*=256);)le+=this[Z+ve]*me;return me*=128,le>=me&&(le-=Math.pow(2,8*J)),le},T.prototype.readIntBE=function(Z,J,ne){Z=Z>>>0,J=J>>>0,ne||Re(Z,J,this.length);let le=J,me=1,ve=this[Z+--le];for(;le>0&&(me*=256);)ve+=this[Z+--le]*me;return me*=128,ve>=me&&(ve-=Math.pow(2,8*J)),ve},T.prototype.readInt8=function(Z,J){return Z=Z>>>0,J||Re(Z,1,this.length),this[Z]&128?(255-this[Z]+1)*-1:this[Z]},T.prototype.readInt16LE=function(Z,J){Z=Z>>>0,J||Re(Z,2,this.length);const ne=this[Z]|this[Z+1]<<8;return ne&32768?ne|4294901760:ne},T.prototype.readInt16BE=function(Z,J){Z=Z>>>0,J||Re(Z,2,this.length);const ne=this[Z+1]|this[Z]<<8;return ne&32768?ne|4294901760:ne},T.prototype.readInt32LE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),this[Z]|this[Z+1]<<8|this[Z+2]<<16|this[Z+3]<<24},T.prototype.readInt32BE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),this[Z]<<24|this[Z+1]<<16|this[Z+2]<<8|this[Z+3]},T.prototype.readBigInt64LE=Ye(function(Z){Z=Z>>>0,Ce(Z,"offset");const J=this[Z],ne=this[Z+7];(J===void 0||ne===void 0)&&Ue(Z,this.length-8);const le=this[Z+4]+this[Z+5]*2**8+this[Z+6]*2**16+(ne<<24);return(BigInt(le)<<BigInt(32))+BigInt(J+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24)}),T.prototype.readBigInt64BE=Ye(function(Z){Z=Z>>>0,Ce(Z,"offset");const J=this[Z],ne=this[Z+7];(J===void 0||ne===void 0)&&Ue(Z,this.length-8);const le=(J<<24)+this[++Z]*2**16+this[++Z]*2**8+this[++Z];return(BigInt(le)<<BigInt(32))+BigInt(this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ne)}),T.prototype.readFloatLE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),B.read(this,Z,!0,23,4)},T.prototype.readFloatBE=function(Z,J){return Z=Z>>>0,J||Re(Z,4,this.length),B.read(this,Z,!1,23,4)},T.prototype.readDoubleLE=function(Z,J){return Z=Z>>>0,J||Re(Z,8,this.length),B.read(this,Z,!0,52,8)},T.prototype.readDoubleBE=function(Z,J){return Z=Z>>>0,J||Re(Z,8,this.length),B.read(this,Z,!1,52,8)};function $e(ee,Z,J,ne,le,me){if(!T.isBuffer(ee))throw new TypeError('"buffer" argument must be a Buffer instance');if(Z>le||Z<me)throw new RangeError('"value" argument is out of bounds');if(J+ne>ee.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(Z,J,ne,le){if(Z=+Z,J=J>>>0,ne=ne>>>0,!le){const xe=Math.pow(2,8*ne)-1;$e(this,Z,J,ne,xe,0)}let me=1,ve=0;for(this[J]=Z&255;++ve<ne&&(me*=256);)this[J+ve]=Z/me&255;return J+ne},T.prototype.writeUintBE=T.prototype.writeUIntBE=function(Z,J,ne,le){if(Z=+Z,J=J>>>0,ne=ne>>>0,!le){const xe=Math.pow(2,8*ne)-1;$e(this,Z,J,ne,xe,0)}let me=ne-1,ve=1;for(this[J+me]=Z&255;--me>=0&&(ve*=256);)this[J+me]=Z/ve&255;return J+ne},T.prototype.writeUint8=T.prototype.writeUInt8=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,1,255,0),this[J]=Z&255,J+1},T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,2,65535,0),this[J]=Z&255,this[J+1]=Z>>>8,J+2},T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,2,65535,0),this[J]=Z>>>8,this[J+1]=Z&255,J+2},T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,4,4294967295,0),this[J+3]=Z>>>24,this[J+2]=Z>>>16,this[J+1]=Z>>>8,this[J]=Z&255,J+4},T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,4,4294967295,0),this[J]=Z>>>24,this[J+1]=Z>>>16,this[J+2]=Z>>>8,this[J+3]=Z&255,J+4};function Ve(ee,Z,J,ne,le){Te(Z,ne,le,ee,J,7);let me=Number(Z&BigInt(4294967295));ee[J++]=me,me=me>>8,ee[J++]=me,me=me>>8,ee[J++]=me,me=me>>8,ee[J++]=me;let ve=Number(Z>>BigInt(32)&BigInt(4294967295));return ee[J++]=ve,ve=ve>>8,ee[J++]=ve,ve=ve>>8,ee[J++]=ve,ve=ve>>8,ee[J++]=ve,J}function Ne(ee,Z,J,ne,le){Te(Z,ne,le,ee,J,7);let me=Number(Z&BigInt(4294967295));ee[J+7]=me,me=me>>8,ee[J+6]=me,me=me>>8,ee[J+5]=me,me=me>>8,ee[J+4]=me;let ve=Number(Z>>BigInt(32)&BigInt(4294967295));return ee[J+3]=ve,ve=ve>>8,ee[J+2]=ve,ve=ve>>8,ee[J+1]=ve,ve=ve>>8,ee[J]=ve,J+8}T.prototype.writeBigUInt64LE=Ye(function(Z,J=0){return Ve(this,Z,J,BigInt(0),BigInt("0xffffffffffffffff"))}),T.prototype.writeBigUInt64BE=Ye(function(Z,J=0){return Ne(this,Z,J,BigInt(0),BigInt("0xffffffffffffffff"))}),T.prototype.writeIntLE=function(Z,J,ne,le){if(Z=+Z,J=J>>>0,!le){const De=Math.pow(2,8*ne-1);$e(this,Z,J,ne,De-1,-De)}let me=0,ve=1,xe=0;for(this[J]=Z&255;++me<ne&&(ve*=256);)Z<0&&xe===0&&this[J+me-1]!==0&&(xe=1),this[J+me]=(Z/ve>>0)-xe&255;return J+ne},T.prototype.writeIntBE=function(Z,J,ne,le){if(Z=+Z,J=J>>>0,!le){const De=Math.pow(2,8*ne-1);$e(this,Z,J,ne,De-1,-De)}let me=ne-1,ve=1,xe=0;for(this[J+me]=Z&255;--me>=0&&(ve*=256);)Z<0&&xe===0&&this[J+me+1]!==0&&(xe=1),this[J+me]=(Z/ve>>0)-xe&255;return J+ne},T.prototype.writeInt8=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,1,127,-128),Z<0&&(Z=255+Z+1),this[J]=Z&255,J+1},T.prototype.writeInt16LE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,2,32767,-32768),this[J]=Z&255,this[J+1]=Z>>>8,J+2},T.prototype.writeInt16BE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,2,32767,-32768),this[J]=Z>>>8,this[J+1]=Z&255,J+2},T.prototype.writeInt32LE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,4,2147483647,-2147483648),this[J]=Z&255,this[J+1]=Z>>>8,this[J+2]=Z>>>16,this[J+3]=Z>>>24,J+4},T.prototype.writeInt32BE=function(Z,J,ne){return Z=+Z,J=J>>>0,ne||$e(this,Z,J,4,2147483647,-2147483648),Z<0&&(Z=4294967295+Z+1),this[J]=Z>>>24,this[J+1]=Z>>>16,this[J+2]=Z>>>8,this[J+3]=Z&255,J+4},T.prototype.writeBigInt64LE=Ye(function(Z,J=0){return Ve(this,Z,J,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),T.prototype.writeBigInt64BE=Ye(function(Z,J=0){return Ne(this,Z,J,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function He(ee,Z,J,ne,le,me){if(J+ne>ee.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("Index out of range")}function Ge(ee,Z,J,ne,le){return Z=+Z,J=J>>>0,le||He(ee,Z,J,4),B.write(ee,Z,J,ne,23,4),J+4}T.prototype.writeFloatLE=function(Z,J,ne){return Ge(this,Z,J,!0,ne)},T.prototype.writeFloatBE=function(Z,J,ne){return Ge(this,Z,J,!1,ne)};function Ze(ee,Z,J,ne,le){return Z=+Z,J=J>>>0,le||He(ee,Z,J,8),B.write(ee,Z,J,ne,52,8),J+8}T.prototype.writeDoubleLE=function(Z,J,ne){return Ze(this,Z,J,!0,ne)},T.prototype.writeDoubleBE=function(Z,J,ne){return Ze(this,Z,J,!1,ne)},T.prototype.copy=function(Z,J,ne,le){if(!T.isBuffer(Z))throw new TypeError("argument should be a Buffer");if(ne||(ne=0),!le&&le!==0&&(le=this.length),J>=Z.length&&(J=Z.length),J||(J=0),le>0&&le<ne&&(le=ne),le===ne||Z.length===0||this.length===0)return 0;if(J<0)throw new RangeError("targetStart out of bounds");if(ne<0||ne>=this.length)throw new RangeError("Index out of range");if(le<0)throw new RangeError("sourceEnd out of bounds");le>this.length&&(le=this.length),Z.length-J<le-ne&&(le=Z.length-J+ne);const me=le-ne;return this===Z&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(J,ne,le):Uint8Array.prototype.set.call(Z,this.subarray(ne,le),J),me},T.prototype.fill=function(Z,J,ne,le){if(typeof Z=="string"){if(typeof J=="string"?(le=J,J=0,ne=this.length):typeof ne=="string"&&(le=ne,ne=this.length),le!==void 0&&typeof le!="string")throw new TypeError("encoding must be a string");if(typeof le=="string"&&!T.isEncoding(le))throw new TypeError("Unknown encoding: "+le);if(Z.length===1){const ve=Z.charCodeAt(0);(le==="utf8"&&ve<128||le==="latin1")&&(Z=ve)}}else typeof Z=="number"?Z=Z&255:typeof Z=="boolean"&&(Z=Number(Z));if(J<0||this.length<J||this.length<ne)throw new RangeError("Out of range index");if(ne<=J)return this;J=J>>>0,ne=ne===void 0?this.length:ne>>>0,Z||(Z=0);let me;if(typeof Z=="number")for(me=J;me<ne;++me)this[me]=Z;else{const ve=T.isBuffer(Z)?Z:T.from(Z,le),xe=ve.length;if(xe===0)throw new TypeError('The value "'+Z+'" is invalid for argument "value"');for(me=0;me<ne-J;++me)this[me+J]=ve[me%xe]}return this};const Le={};function Oe(ee,Z,J){Le[ee]=class extends J{constructor(){super(),Object.defineProperty(this,"message",{value:Z.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${ee}]`,this.stack,delete this.name}get code(){return ee}set code(le){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:le,writable:!0})}toString(){return`${this.name} [${ee}]: ${this.message}`}}}Oe("ERR_BUFFER_OUT_OF_BOUNDS",function(ee){return ee?`${ee} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Oe("ERR_INVALID_ARG_TYPE",function(ee,Z){return`The "${ee}" argument must be of type number. Received type ${typeof Z}`},TypeError),Oe("ERR_OUT_OF_RANGE",function(ee,Z,J){let ne=`The value of "${ee}" is out of range.`,le=J;return Number.isInteger(J)&&Math.abs(J)>2**32?le=Se(String(J)):typeof J=="bigint"&&(le=String(J),(J>BigInt(2)**BigInt(32)||J<-(BigInt(2)**BigInt(32)))&&(le=Se(le)),le+="n"),ne+=` It must be ${Z}. Received ${le}`,ne},RangeError);function Se(ee){let Z="",J=ee.length;const ne=ee[0]==="-"?1:0;for(;J>=ne+4;J-=3)Z=`_${ee.slice(J-3,J)}${Z}`;return`${ee.slice(0,J)}${Z}`}function Ie(ee,Z,J){Ce(Z,"offset"),(ee[Z]===void 0||ee[Z+J]===void 0)&&Ue(Z,ee.length-(J+1))}function Te(ee,Z,J,ne,le,me){if(ee>J||ee<Z){const ve=typeof Z=="bigint"?"n":"";let xe;throw Z===0||Z===BigInt(0)?xe=`>= 0${ve} and < 2${ve} ** ${(me+1)*8}${ve}`:xe=`>= -(2${ve} ** ${(me+1)*8-1}${ve}) and < 2 ** ${(me+1)*8-1}${ve}`,new Le.ERR_OUT_OF_RANGE("value",xe,ee)}Ie(ne,le,me)}function Ce(ee,Z){if(typeof ee!="number")throw new Le.ERR_INVALID_ARG_TYPE(Z,"number",ee)}function Ue(ee,Z,J){throw Math.floor(ee)!==ee?(Ce(ee,J),new Le.ERR_OUT_OF_RANGE("offset","an integer",ee)):Z<0?new Le.ERR_BUFFER_OUT_OF_BOUNDS:new Le.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Z}`,ee)}const je=/[^+/0-9A-Za-z-_]/g;function Fe(ee){if(ee=ee.split("=")[0],ee=ee.trim().replace(je,""),ee.length<2)return"";for(;ee.length%4!==0;)ee=ee+"=";return ee}function We(ee,Z){Z=Z||1/0;let J;const ne=ee.length;let le=null;const me=[];for(let ve=0;ve<ne;++ve){if(J=ee.charCodeAt(ve),J>55295&&J<57344){if(!le){if(J>56319){(Z-=3)>-1&&me.push(239,191,189);continue}else if(ve+1===ne){(Z-=3)>-1&&me.push(239,191,189);continue}le=J;continue}if(J<56320){(Z-=3)>-1&&me.push(239,191,189),le=J;continue}J=(le-55296<<10|J-56320)+65536}else le&&(Z-=3)>-1&&me.push(239,191,189);if(le=null,J<128){if((Z-=1)<0)break;me.push(J)}else if(J<2048){if((Z-=2)<0)break;me.push(J>>6|192,J&63|128)}else if(J<65536){if((Z-=3)<0)break;me.push(J>>12|224,J>>6&63|128,J&63|128)}else if(J<1114112){if((Z-=4)<0)break;me.push(J>>18|240,J>>12&63|128,J>>6&63|128,J&63|128)}else throw new Error("Invalid code point")}return me}function Qe(ee){const Z=[];for(let J=0;J<ee.length;++J)Z.push(ee.charCodeAt(J)&255);return Z}function tt(ee,Z){let J,ne,le;const me=[];for(let ve=0;ve<ee.length&&!((Z-=2)<0);++ve)J=ee.charCodeAt(ve),ne=J>>8,le=J%256,me.push(le),me.push(ne);return me}function Xe(ee){return M.toByteArray(Fe(ee))}function et(ee,Z,J,ne){let le;for(le=0;le<ne&&!(le+J>=Z.length||le>=ee.length);++le)Z[le+J]=ee[le];return le}function Je(ee,Z){return ee instanceof Z||ee!=null&&ee.constructor!=null&&ee.constructor.name!=null&&ee.constructor.name===Z.name}function nt(ee){return ee!==ee}const it=(function(){const ee="0123456789abcdef",Z=new Array(256);for(let J=0;J<16;++J){const ne=J*16;for(let le=0;le<16;++le)Z[ne+le]=ee[J]+ee[le]}return Z})();function Ye(ee){return typeof BigInt>"u"?rt:ee}function rt(){throw new Error("BigInt not supported")}})(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var N=toolsEbml&&toolsEbml.__assign||function(){return N=Object.assign||function(C){for(var D,i=1,T=arguments.length;i<T;i++){D=arguments[i];for(var A in D)Object.prototype.hasOwnProperty.call(D,A)&&(C[A]=D[A])}return C},N.apply(this,arguments)},M=toolsEbml&&toolsEbml.__spreadArray||function(C,D,i){if(i||arguments.length===2)for(var T=0,A=D.length,U;T<A;T++)(U||!(T in D))&&(U||(U=Array.prototype.slice.call(D,0,T)),U[T]=D[T]);return C.concat(U||Array.prototype.slice.call(D))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var B=requireTools(),F=(function(){function C(){}return C.readVint=function(D,i){i===void 0&&(i=0);var T=8-Math.floor(Math.log2(D[i]));if(T>8){var A=C.readHexString(D,i,i+T);throw new Error("Unrepresentable length: ".concat(T," ").concat(A))}if(i+T>D.length)return null;for(var U=D[i]&(1<<8-T)-1,j=1;j<T;j+=1){if(j===7&&U>=Math.pow(2,8)&&D[i+7]>0)return{length:T,value:-1};U*=Math.pow(2,8),U+=D[i+j]}return{length:T,value:U}},C.writeVint=function(D){if(D<0||D>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(D));var i=1;for(i=1;i<=8&&!(D<Math.pow(2,7*i)-1);i+=1);for(var T=B.Buffer.alloc(i),A=D,U=1;U<=i;U+=1){var j=A&255;T[i-U]=j,A-=j,A/=Math.pow(2,8)}return T[0]|=1<<8-i,T},C.concatenate=function(D,i){return!D&&!i?B.Buffer.from([]):!D||D.byteLength===0?i:!i||i.byteLength===0?D:B.Buffer.from(M(M([],D,!0),i,!0))},C.readHexString=function(D,i,T){return i===void 0&&(i=0),T===void 0&&(T=D.byteLength),Array.from(D.slice(i,T)).map(function(A){return Number(A).toString(16)}).reduce(function(A,U){return"".concat(A).concat(U.padStart(2,"0"))},"")},C.readUtf8=function(D){try{return B.Buffer.from(D).toString("utf8")}catch{return null}},C.readUnsigned=function(D){var i=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 1:return i.getUint8(0);case 2:return i.getUint16(0);case 4:return i.getUint32(0)}return D.byteLength<=6?D.reduce(function(T,A){return T*256+A},0):C.readHexString(D,0,D.byteLength)},C.readSigned=function(D){var i=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 1:return i.getInt8(0);case 2:return i.getInt16(0);case 4:return i.getInt32(0);default:return NaN}},C.readFloat=function(D){var i=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 4:return i.getFloat32(0);case 8:return i.getFloat64(0);default:return NaN}},C.readDate=function(D){var i=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 1:return new Date(i.getUint8(0));case 2:return new Date(i.getUint16(0));case 4:return new Date(i.getUint32(0));case 8:return new Date(Number.parseInt(C.readHexString(D),16));default:return new Date(0)}},C.readDataFromTag=function(D,i){var T=D.type,A=D.name,U=D.track,j=D.discardable||!1,z=D.keyframe||!1,K=null,Y;switch(T){case"u":Y=C.readUnsigned(i);break;case"f":Y=C.readFloat(i);break;case"i":Y=C.readSigned(i);break;case"s":Y=String.fromCharCode.apply(String,i);break;case"8":Y=C.readUtf8(i);break;case"d":Y=C.readDate(i);break}if(A==="SimpleBlock"||A==="Block"){var te=0,ae=C.readVint(i,te),se=ae.length,re=ae.value;te+=se,U=re,Y=C.readSigned(i.subarray(te,te+2)),te+=2,A==="SimpleBlock"&&(z=!!(i[se+2]&128),j=!!(i[se+2]&1)),te+=1,K=i.subarray(te)}return N(N({},D),{data:i,discardable:j,keyframe:z,payload:K,track:U,value:Y})},C})();return toolsEbml.default=F,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(N,M,B){M=M||0;for(var F=1;F<=8&&!(N[M]>=Math.pow(2,8-F));F++);if(F>8)throw new Error("Unrepresentable length: "+F+" "+N.toString("hex",M,M+F));if(M+F>N.length)return null;var C,D=N[M]&(1<<8-F)-1;for(C=1;C<F;C++){if(C===7&&D>=Math.pow(2,45)&&N[M+7]>0)return{length:F,value:-1};D*=Math.pow(2,8),D+=N[M+C]}return B&&(D-=Math.pow(2,F*7-1)-1),{length:F,value:D}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var N=requireVint();function M(B){this.buffer=B,this.offset=0}return M.prototype.nextInt16BE=function(){var B=this.buffer.readInt16BE(this.offset);return this.offset+=2,B},M.prototype.nextUInt8=function(){var B=this.buffer.readUInt8(this.offset);return this.offset+=1,B},M.prototype.nextUIntV=function(){var B=N(this.buffer,this.offset);return this.offset+=B.length,B.value},M.prototype.nextIntV=function(){var B=N(this.buffer,this.offset,!0);return this.offset+=B.length,B.value},M.prototype.nextBuffer=function(B){var F=B?this.buffer.slice(this.offset,this.offset+B):this.buffer.slice(this.offset);return this.offset+=B||this.length,F},Object.defineProperty(M.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=M,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var N=requireBufferReader(),M=1,B=3,F=2;ebmlBlock=function(D){var i={},T=new N(D);i.trackNumber=T.nextUIntV(),i.timecode=T.nextInt16BE();var A=T.nextUInt8();i.invisible=!!(A&8),i.keyframe=!!(A&128),i.discardable=!!(A&1);var U=(A&6)>>1;return i.frames=C(T,U),i};function C(D,i){if(!i)return[D.nextBuffer()];var T,A,U=[],j=D.nextUInt8()+1;if(i===F){if(D.length%j!==0)throw new Error("Fixed-Size Lacing Error");for(A=D.length/j,T=0;T<j;T++)U.push(D.nextBuffer(A));return U}var z=[];if(i===M)for(T=0;T<j-1;T++){var K;A=0;do K=D.nextUInt8(),A+=K;while(K===255);z.push(A)}else if(i===B)for(A=D.nextUIntV(),z.push(A),T=1;T<j-1;T++)A+=D.nextIntV(),z.push(A);for(T=0;T<j-1;T++)U.push(D.nextBuffer(z[T]));return U.push(D.nextBuffer()),U}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,(function(N){Object.defineProperty(N,"__esModule",{value:!0}),N.convertEBMLDateToJSDate=N.createFloatBuffer=N.createIntBuffer=N.createUIntBuffer=N.encodeValueToBuffer=N.concat=N.putRefinedMetaData=N.extractElement=N.removeElement=N.makeMetadataSeekable=N.createRIFFChunk=N.VP8BitStreamToRiffWebPBuffer=N.WebPBlockFilter=N.encodeTag=N.readBlock=N.ebmlBlock=N.writeVint=N.readVint=N.Buffer=void 0;var M=requireInt64Buffer(),B=requireEBMLEncoder(),F=requireBuffer(),C=requireToolsEbml(),D=requireEbmlBlock();N.Buffer=F.Buffer,N.readVint=C.default.readVint,N.writeVint=C.default.writeVint,N.ebmlBlock=D;function i(oe){return(0,N.ebmlBlock)(new N.Buffer(oe))}N.readBlock=i;function T(oe,de,be){return be===void 0&&(be=!1),ie([oe,be?new N.Buffer("01ffffffffffffff","hex"):(0,N.writeVint)(de.length),de])}N.encodeTag=T;function A(oe){return oe.reduce(function(de,be){if(be.type!=="b"||be.name!=="SimpleBlock")return de;var _e=(0,N.ebmlBlock)(be.data),we=_e.frames.some(function(ge){var Ee=ge.slice(3,6).toString("hex");return Ee==="9d012a"});return we?de.concat(be):de},[])}N.WebPBlockFilter=A;function U(oe){var de=j("VP8 ",oe),be=ie([new N.Buffer("WEBP","ascii"),de]);return j("RIFF",be)}N.VP8BitStreamToRiffWebPBuffer=U;function j(oe,de){var be=new N.Buffer(4);return be.writeUInt32LE(de.byteLength,0),ie([new N.Buffer(oe.substr(0,4),"ascii"),be,de,new N.Buffer(de.byteLength%2===0?0:1)])}N.createRIFFChunk=j;function z(oe,de,be){var _e=Y("EBML",oe),we=ae(_e),ge=we+12,Ee=oe[oe.length-1].dataEnd-ge,qe=Y("Info",oe);K("Duration",qe),qe.splice(1,0,{name:"Duration",type:"f",data:fe(de,8)});for(var Me=ae(qe),ze=Y("Tracks",oe),Ke=ae(ze),Re=47,$e=[],Ve=5+be.length*15,Ne=[],He=-1,Ge=10,Ze=function(Te){var Ce=Re,Ue=Ce+Me,je=Ue+Ke,Fe=je+Ve,We=Fe-Ee;if($e=[],$e.push({name:"SeekHead",type:"m",isEnd:!1}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new N.Buffer([21,73,169,102])}),$e.push({name:"SeekPosition",type:"u",data:he(Ce)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new N.Buffer([22,84,174,107])}),$e.push({name:"SeekPosition",type:"u",data:he(Ue)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new N.Buffer([28,83,187,107])}),$e.push({name:"SeekPosition",type:"u",data:he(je)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"SeekHead",type:"m",isEnd:!0}),Re=ae($e),Ne=[],Ne.push({name:"Cues",type:"m",isEnd:!1}),be.forEach(function(Qe){var tt=Qe.CueTrack,Xe=Qe.CueClusterPosition,et=Qe.CueTime;Ne.push({name:"CuePoint",type:"m",isEnd:!1}),Ne.push({name:"CueTime",type:"u",data:he(et)}),Ne.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Ne.push({name:"CueTrack",type:"u",data:he(tt)}),Xe-=ge,Xe+=We,Ne.push({name:"CueClusterPosition",type:"u",data:he(Xe)}),Ne.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Ne.push({name:"CuePoint",type:"m",isEnd:!0})}),Ne.push({name:"Cues",type:"m",isEnd:!0}),Ve=ae(Ne),He!==We){if(He=We,Te===Ge-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},Le=0;Le<Ge;Le++){var Oe=Ze(Le);if(Oe==="break")break}var Se=[].concat.apply([],[_e,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},$e,qe,ze,Ne]),Ie=new B.default().encode(Se);return Ie}N.makeMetadataSeekable=z;function K(oe,de){for(var be=-1,_e=0;_e<de.length;_e++){var we=de[_e];if(we.name===oe)if(we.type==="m")if(!we.isEnd)be=_e;else{if(be==-1)throw new Error("Detected ".concat(oe," closing element before finding the start"));de.splice(be,_e-be+1);return}else{de.splice(_e,1);return}}}N.removeElement=K;function Y(oe,de){for(var be=[],_e=-1,we=0;we<de.length;we++){var ge=de[we];if(ge.name===oe)if(ge.type==="m")if(!ge.isEnd)_e=we;else{if(_e==-1)throw new Error("Detected ".concat(oe," closing element before finding the start"));be=de.slice(_e,we+1);break}else{be.push(de[we]);break}}return be}N.extractElement=Y;function te(oe,de){Array.isArray(de.cueInfos)&&!Array.isArray(de.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),de.cues=de.cueInfos);for(var be=[],_e=[],we=0;we<oe.length;we++){var ge=oe[we];if(ge.type==="m"&&ge.name==="Segment"){if(be=oe.slice(0,we),_e=oe.slice(we),ge.unknownSize){_e.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(_e[_e.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var Ee=_e[_e.length-1].dataEnd,qe=be[be.length-1].dataEnd,Me=new B.default().encode(be).byteLength,ze=Me-qe,Ke=Ee-_e[0].tagStart;_e[0].tagStart-qe,_e[0].tagStart;var Re=new N.Buffer([24,83,128,103]),$e=new N.Buffer("01ffffffffffffff","hex"),Ve=Re.byteLength+$e.byteLength,Ne=Ke,He;for(He=1;He<20;He++){var Ge=qe+Ve+Ne,Ze=Ge-Ee,Le=ze+Ze,Oe=se(_e,Le,de),Se=new B.default().encode(Oe).byteLength;if(Se===Ne)return new B.default().encode([].concat(be,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],Oe));Ne=Se}throw new Error("unable to refine metadata, stable size could not be found in "+He+" iterations!")}N.putRefinedMetaData=te;function ae(oe){var de=new B.default;return oe.reduce(function(be,_e){return be.concat(de.encode([_e]))},[]).reduce(function(be,_e){return be+_e.byteLength},0)}function se(oe,de,be){var _e=be.duration,we=be.clusterPtrs,ge=be.cues,Ee=oe.slice(0);if(typeof _e=="number"){var qe=!1;Ee.forEach(function(ze){ze.type==="f"&&ze.name==="Duration"&&(qe=!0,ze.data=fe(_e,8))}),qe||ke(Ee,"Info",[{name:"Duration",type:"f",data:fe(_e,8)}])}Array.isArray(ge)&&ke(Ee,"Cues",pe(ge,de));var Me=[];return Array.isArray(we)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Me=re(we,de)),ke(Ee,"SeekHead",Me,!0),Ee}function re(oe,de){var be=[];return oe.forEach(function(_e){be.push({name:"Seek",type:"m",isEnd:!1}),be.push({name:"SeekID",type:"b",data:new N.Buffer([31,67,182,117])}),be.push({name:"SeekPosition",type:"u",data:he(_e+de)}),be.push({name:"Seek",type:"m",isEnd:!0})}),be}function pe(oe,de){var be=[];return oe.forEach(function(_e){var we=_e.CueTrack,ge=_e.CueClusterPosition,Ee=_e.CueTime;be.push({name:"CuePoint",type:"m",isEnd:!1}),be.push({name:"CueTime",type:"u",data:he(Ee)}),be.push({name:"CueTrackPositions",type:"m",isEnd:!1}),be.push({name:"CueTrack",type:"u",data:he(we)}),be.push({name:"CueClusterPosition",type:"u",data:he(ge+de)}),be.push({name:"CueTrackPositions",type:"m",isEnd:!0}),be.push({name:"CuePoint",type:"m",isEnd:!0})}),be}function ke(oe,de,be,_e){_e===void 0&&(_e=!1);for(var we=-1,ge=0;ge<oe.length;ge++){var Ee=oe[ge];if(Ee.type==="m"&&Ee.name===de&&Ee.isEnd===!1){we=ge;break}}we>=0?Array.prototype.splice.apply(oe,[we+1,0].concat(be)):_e?[].concat([{name:de,type:"m",isEnd:!1}],be,[{name:de,type:"m",isEnd:!0}]).reverse().forEach(function(qe){oe.unshift(qe)}):(oe.push({name:de,type:"m",isEnd:!1}),be.forEach(function(qe){oe.push(qe)}),oe.push({name:de,type:"m",isEnd:!0}))}function ie(oe){return N.Buffer.concat(oe)}N.concat=ie;function ce(oe){var de=new N.Buffer(0);if(oe.type==="m")return oe;switch(oe.type){case"u":de=he(oe.value);break;case"i":de=ue(oe.value);break;case"f":de=fe(oe.value);break;case"s":de=new N.Buffer(oe.value,"ascii");break;case"8":de=new N.Buffer(oe.value,"utf8");break;case"b":de=oe.value;break;case"d":de=new M.Int64BE(oe.value.getTime().toString()).toBuffer();break}return Object.assign({},oe,{data:de})}N.encodeValueToBuffer=ce;function he(oe){for(var de=1;oe>=Math.pow(2,8*de);de++);if(de>=7)return console.warn("7bit or more bigger uint not supported."),new M.Uint64BE(oe).toBuffer();var be=new N.Buffer(de);return be.writeUIntBE(oe,0,de),be}N.createUIntBuffer=he;function ue(oe){for(var de=1;oe>=Math.pow(2,8*de);de++);if(de>=7)return console.warn("7bit or more bigger uint not supported."),new M.Int64BE(oe).toBuffer();var be=new N.Buffer(de);return be.writeIntBE(oe,0,de),be}N.createIntBuffer=ue;function fe(oe,de){if(de===void 0&&(de=8),de===8){var be=new N.Buffer(8);return be.writeDoubleBE(oe,0),be}else if(de===4){var be=new N.Buffer(4);return be.writeFloatBE(oe,0),be}else throw new Error("float type bits must 4bytes or 8bytes")}N.createFloatBuffer=fe;function ye(oe){return oe instanceof Date?oe:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(oe)/1e3/1e3)}N.convertEBMLDateToJSDate=ye})(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var N=requireInt64Buffer(),M=requireTools(),B=requireTools(),F=requireEbmlID(),C;(function(i){i[i.STATE_TAG=1]="STATE_TAG",i[i.STATE_SIZE=2]="STATE_SIZE",i[i.STATE_CONTENT=3]="STATE_CONTENT"})(C||(C={}));var D=(function(){function i(){this._buffer=new M.Buffer(0),this._tag_stack=[],this._state=C.STATE_TAG,this._cursor=0,this._total=0,this._schema=F.byEbmlID,this._result=[]}return i.prototype.decode=function(T){this.readChunk(T);var A=this._result;return this._result=[],A},i.prototype.readChunk=function(T){for(this._buffer=B.concat([this._buffer,new M.Buffer(T)]);this._cursor<this._buffer.length&&!(this._state===C.STATE_TAG&&!this.readTag()||this._state===C.STATE_SIZE&&!this.readSize()||this._state===C.STATE_CONTENT&&!this.readContent()););},i.prototype.getSchemaInfo=function(T){return this._schema[T]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},i.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var T=(0,M.readVint)(this._buffer,this._cursor);if(T==null)return!1;var A=this._buffer.slice(this._cursor,this._cursor+T.length),U=A.reduce(function(K,Y,te,ae){return K+Y*Math.pow(16,2*(ae.length-1-te))},0),j=this.getSchemaInfo(U),z={EBML_ID:U.toString(16),schema:j,type:j.type,name:j.name,level:j.level,tagStart:this._total,tagEnd:this._total+T.length,sizeStart:this._total+T.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(z),this._cursor+=T.length,this._total+=T.length,this._state=C.STATE_SIZE,!0},i.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var T=(0,M.readVint)(this._buffer,this._cursor);if(T==null)return!1;var A=this._tag_stack[this._tag_stack.length-1];return A.sizeEnd=A.sizeStart+T.length,A.dataStart=A.sizeEnd,A.dataSize=T.value,T.value===-1?(A.dataEnd=-1,A.type==="m"&&(A.unknownSize=!0)):A.dataEnd=A.sizeEnd+T.value,this._cursor+=T.length,this._total+=T.length,this._state=C.STATE_CONTENT,!0},i.prototype.readContent=function(){var T=this._tag_stack[this._tag_stack.length-1];if(T.type==="m"){if(T.isEnd=!1,this._result.push(T),this._state=C.STATE_TAG,T.dataSize===0){var A=Object.assign({},T,{isEnd:!0});this._result.push(A),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+T.dataSize)return!1;var U=this._buffer.slice(this._cursor,this._cursor+T.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+T.dataSize),T.data=U,T.type){case"u":T.value=U.readUIntBE(0,U.length);break;case"i":T.value=U.readIntBE(0,U.length);break;case"f":T.value=T.dataSize===4?U.readFloatBE(0):T.dataSize===8?U.readDoubleBE(0):(console.warn("cannot read ".concat(T.dataSize," octets float. failback to 0")),0);break;case"s":T.value=U.toString("ascii");break;case"8":T.value=U.toString("utf8");break;case"b":T.value=U;break;case"d":T.value=(0,M.convertEBMLDateToJSDate)(new N.Int64BE(U).toNumber());break}if(T.value===null)throw new Error("unknown tag type:"+T.type);for(this._result.push(T),this._total+=T.dataSize,this._state=C.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var j=this._tag_stack[this._tag_stack.length-1];if(j.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<j.dataEnd)break;if(j.type!=="m")throw new Error("parent element is not master element");var A=Object.assign({},j,{isEnd:!0});this._result.push(A),this._tag_stack.pop()}return!0},i})();return EBMLDecoder.default=D,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var N=typeof Reflect=="object"?Reflect:null,M=N&&typeof N.apply=="function"?N.apply:function(ce,he,ue){return Function.prototype.apply.call(ce,he,ue)},B;N&&typeof N.ownKeys=="function"?B=N.ownKeys:Object.getOwnPropertySymbols?B=function(ce){return Object.getOwnPropertyNames(ce).concat(Object.getOwnPropertySymbols(ce))}:B=function(ce){return Object.getOwnPropertyNames(ce)};function F(ie){console&&console.warn&&console.warn(ie)}var C=Number.isNaN||function(ce){return ce!==ce};function D(){D.init.call(this)}events.exports=D,events.exports.once=re,D.EventEmitter=D,D.prototype._events=void 0,D.prototype._eventsCount=0,D.prototype._maxListeners=void 0;var i=10;function T(ie){if(typeof ie!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ie)}Object.defineProperty(D,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(ie){if(typeof ie!="number"||ie<0||C(ie))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ie+".");i=ie}}),D.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},D.prototype.setMaxListeners=function(ce){if(typeof ce!="number"||ce<0||C(ce))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ce+".");return this._maxListeners=ce,this};function A(ie){return ie._maxListeners===void 0?D.defaultMaxListeners:ie._maxListeners}D.prototype.getMaxListeners=function(){return A(this)},D.prototype.emit=function(ce){for(var he=[],ue=1;ue<arguments.length;ue++)he.push(arguments[ue]);var fe=ce==="error",ye=this._events;if(ye!==void 0)fe=fe&&ye.error===void 0;else if(!fe)return!1;if(fe){var oe;if(he.length>0&&(oe=he[0]),oe instanceof Error)throw oe;var de=new Error("Unhandled error."+(oe?" ("+oe.message+")":""));throw de.context=oe,de}var be=ye[ce];if(be===void 0)return!1;if(typeof be=="function")M(be,this,he);else for(var _e=be.length,we=te(be,_e),ue=0;ue<_e;++ue)M(we[ue],this,he);return!0};function U(ie,ce,he,ue){var fe,ye,oe;if(T(he),ye=ie._events,ye===void 0?(ye=ie._events=Object.create(null),ie._eventsCount=0):(ye.newListener!==void 0&&(ie.emit("newListener",ce,he.listener?he.listener:he),ye=ie._events),oe=ye[ce]),oe===void 0)oe=ye[ce]=he,++ie._eventsCount;else if(typeof oe=="function"?oe=ye[ce]=ue?[he,oe]:[oe,he]:ue?oe.unshift(he):oe.push(he),fe=A(ie),fe>0&&oe.length>fe&&!oe.warned){oe.warned=!0;var de=new Error("Possible EventEmitter memory leak detected. "+oe.length+" "+String(ce)+" listeners added. Use emitter.setMaxListeners() to increase limit");de.name="MaxListenersExceededWarning",de.emitter=ie,de.type=ce,de.count=oe.length,F(de)}return ie}D.prototype.addListener=function(ce,he){return U(this,ce,he,!1)},D.prototype.on=D.prototype.addListener,D.prototype.prependListener=function(ce,he){return U(this,ce,he,!0)};function j(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function z(ie,ce,he){var ue={fired:!1,wrapFn:void 0,target:ie,type:ce,listener:he},fe=j.bind(ue);return fe.listener=he,ue.wrapFn=fe,fe}D.prototype.once=function(ce,he){return T(he),this.on(ce,z(this,ce,he)),this},D.prototype.prependOnceListener=function(ce,he){return T(he),this.prependListener(ce,z(this,ce,he)),this},D.prototype.removeListener=function(ce,he){var ue,fe,ye,oe,de;if(T(he),fe=this._events,fe===void 0)return this;if(ue=fe[ce],ue===void 0)return this;if(ue===he||ue.listener===he)--this._eventsCount===0?this._events=Object.create(null):(delete fe[ce],fe.removeListener&&this.emit("removeListener",ce,ue.listener||he));else if(typeof ue!="function"){for(ye=-1,oe=ue.length-1;oe>=0;oe--)if(ue[oe]===he||ue[oe].listener===he){de=ue[oe].listener,ye=oe;break}if(ye<0)return this;ye===0?ue.shift():ae(ue,ye),ue.length===1&&(fe[ce]=ue[0]),fe.removeListener!==void 0&&this.emit("removeListener",ce,de||he)}return this},D.prototype.off=D.prototype.removeListener,D.prototype.removeAllListeners=function(ce){var he,ue,fe;if(ue=this._events,ue===void 0)return this;if(ue.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ue[ce]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ue[ce]),this;if(arguments.length===0){var ye=Object.keys(ue),oe;for(fe=0;fe<ye.length;++fe)oe=ye[fe],oe!=="removeListener"&&this.removeAllListeners(oe);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(he=ue[ce],typeof he=="function")this.removeListener(ce,he);else if(he!==void 0)for(fe=he.length-1;fe>=0;fe--)this.removeListener(ce,he[fe]);return this};function K(ie,ce,he){var ue=ie._events;if(ue===void 0)return[];var fe=ue[ce];return fe===void 0?[]:typeof fe=="function"?he?[fe.listener||fe]:[fe]:he?se(fe):te(fe,fe.length)}D.prototype.listeners=function(ce){return K(this,ce,!0)},D.prototype.rawListeners=function(ce){return K(this,ce,!1)},D.listenerCount=function(ie,ce){return typeof ie.listenerCount=="function"?ie.listenerCount(ce):Y.call(ie,ce)},D.prototype.listenerCount=Y;function Y(ie){var ce=this._events;if(ce!==void 0){var he=ce[ie];if(typeof he=="function")return 1;if(he!==void 0)return he.length}return 0}D.prototype.eventNames=function(){return this._eventsCount>0?B(this._events):[]};function te(ie,ce){for(var he=new Array(ce),ue=0;ue<ce;++ue)he[ue]=ie[ue];return he}function ae(ie,ce){for(;ce+1<ie.length;ce++)ie[ce]=ie[ce+1];ie.pop()}function se(ie){for(var ce=new Array(ie.length),he=0;he<ce.length;++he)ce[he]=ie[he].listener||ie[he];return ce}function re(ie,ce){return new Promise(function(he,ue){function fe(oe){ie.removeListener(ce,ye),ue(oe)}function ye(){typeof ie.removeListener=="function"&&ie.removeListener("error",fe),he([].slice.call(arguments))}ke(ie,ce,ye,{once:!0}),ce!=="error"&&pe(ie,fe,{once:!0})})}function pe(ie,ce,he){typeof ie.on=="function"&&ke(ie,"error",ce,he)}function ke(ie,ce,he,ue){if(typeof ie.on=="function")ue.once?ie.once(ce,he):ie.on(ce,he);else if(typeof ie.addEventListener=="function")ie.addEventListener(ce,function fe(ye){ue.once&&ie.removeEventListener(ce,fe),he(ye)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ie)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var N=EBMLReader&&EBMLReader.__extends||(function(){var C=function(D,i){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,A){T.__proto__=A}||function(T,A){for(var U in A)Object.prototype.hasOwnProperty.call(A,U)&&(T[U]=A[U])},C(D,i)};return function(D,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");C(D,i);function T(){this.constructor=D}D.prototype=i===null?Object.create(i):(T.prototype=i.prototype,new T)}})();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var M=requireEvents(),B=requireTools(),F=(function(C){N(D,C);function D(){var i=C.call(this)||this;return i.logGroup="",i.hasLoggingStarted=!1,i.metadataloaded=!1,i.chunks=[],i.stack=[],i.segmentOffset=0,i.last2SimpleBlockVideoTrackTimecode=[0,0],i.last2SimpleBlockAudioTrackTimecode=[0,0],i.lastClusterTimecode=0,i.lastClusterPosition=0,i.timecodeScale=1e6,i.metadataSize=0,i.metadatas=[],i.cues=[],i.firstVideoBlockRead=!1,i.firstAudioBlockRead=!1,i.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},i.trackTypes=[],i.trackDefaultDuration=[],i.trackCodecDelay=[],i.trackInfo={type:"nothing"},i.ended=!1,i.logging=!1,i.use_duration_every_simpleblock=!1,i.use_webp=!1,i.use_segment_info=!0,i.drop_default_duration=!0,i}return D.prototype.stop=function(){for(this.ended=!0,this.emit_segment_info();this.stack.length;)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},D.prototype.emit_segment_info=function(){var i=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var U=this.lastClusterTimecode,j=this.duration,z=this.timecodeScale;this.emit("cluster",{timecode:U,data:i}),this.emit("duration",{timecodeScale:z,duration:j})}else{this.metadataloaded=!0,this.metadatas=i;var T=this.trackTypes.indexOf(1),A=this.trackTypes.indexOf(2);if(this.trackInfo=T>=0&&A>=0?{type:"both",trackNumber:T}:T>=0?{type:"video",trackNumber:T}:A>=0?{type:"audio",trackNumber:A}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:i,metadataSize:this.metadataSize})}},D.prototype.read=function(i){var T=this,A=!1;if(!this.ended){if(i.type==="m")if(i.isEnd)this.stack.pop();else{var U=this.stack[this.stack.length-1];if(U!=null&&U.level>=i.level){this.stack.pop(),this.logging&&console.groupEnd(),U.dataEnd=i.dataEnd,U.dataSize=i.dataEnd-U.dataStart,U.unknownSize=!1;var j=Object.assign({},U,{name:U.name,type:U.type,isEnd:!0});this.chunks.push(j)}this.stack.push(i)}if(i.type==="m"&&i.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=i.dataStart,this.emit("segment_offset",this.segmentOffset);else if(i.type==="b"&&i.name==="SimpleBlock"){var z=B.ebmlBlock(i.data),K=z.timecode,Y=z.trackNumber,te=z.frames;if(this.trackTypes[Y]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var ae=this.lastClusterTimecode+K;this.cues.push({CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:ae}),this.emit("cue_info",{CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:ae})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],K]}else if(this.trackTypes[Y]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var ae=this.lastClusterTimecode+K;this.cues.push({CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:ae}),this.emit("cue_info",{CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:Y,CueClusterPosition:this.lastClusterPosition,CueTime:ae})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],K]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&te.forEach(function(se){var re=se.slice(3,6).toString("hex");if(re==="9d012a"){var pe=B.VP8BitStreamToRiffWebPBuffer(se),ke=new Blob([pe],{type:"image/webp"}),ie=T.duration;T.emit("webp",{currentTime:ie,webp:ke})}})}else i.type==="m"&&i.name==="Cluster"&&i.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",i.tagStart),this.lastClusterPosition=i.tagStart):i.type==="u"&&i.name==="Timecode"?this.lastClusterTimecode=i.value:i.type==="u"&&i.name==="TimecodeScale"?this.timecodeScale=i.value:i.type==="m"&&i.name==="TrackEntry"?i.isEnd?(this.trackTypes[this.currentTrack.TrackNumber]=this.currentTrack.TrackType,this.trackDefaultDuration[this.currentTrack.TrackNumber]=this.currentTrack.DefaultDuration,this.trackCodecDelay[this.currentTrack.TrackNumber]=this.currentTrack.CodecDelay):this.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null}:i.type==="u"&&i.name==="TrackType"?this.currentTrack.TrackType=i.value:i.type==="u"&&i.name==="TrackNumber"?this.currentTrack.TrackNumber=i.value:i.type==="u"&&i.name==="CodecDelay"?this.currentTrack.CodecDelay=i.value:i.type==="u"&&i.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),A=!0):this.currentTrack.DefaultDuration=i.value:i.name==="unknown"&&console.warn(i);!this.metadataloaded&&i.dataEnd>0&&(this.metadataSize=i.dataEnd),A||this.chunks.push(i),this.logging&&this.put(i)}},Object.defineProperty(D.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var i=0,T=0,A=0,U=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof U=="number")i=U;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var j=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof j=="number"&&(T=j),A=this.last2SimpleBlockAudioTrackTimecode[1]}else{i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var j=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof j=="number"&&(T=j),A=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var j=this.trackCodecDelay[this.trackInfo.trackNumber];typeof j=="number"&&(T=j),A=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var j=this.trackCodecDelay[this.trackInfo.trackNumber];typeof j=="number"&&(T=j),A=this.last2SimpleBlockAudioTrackTimecode[1]}var z=(this.lastClusterTimecode+A)*this.timecodeScale+i-T,K=z/this.timecodeScale;return Math.floor(K)},enumerable:!1,configurable:!0}),D.prototype.addListener=function(i,T){return C.prototype.addListener.call(this,i,T)},D.prototype.put=function(i){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),i.type==="m"?i.isEnd?console.groupEnd():console.group(i.name+":"+i.tagStart):i.type==="b"?console.log(i.name,i.type):console.log(i.name,i.tagStart,i.type,i.value)},D})(M.EventEmitter);return EBMLReader.default=F,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,(function(N){var M=ebml&&ebml.__createBinding||(Object.create?(function(T,A,U,j){j===void 0&&(j=U),Object.defineProperty(T,j,{enumerable:!0,get:function(){return A[U]}})}):(function(T,A,U,j){j===void 0&&(j=U),T[j]=A[U]})),B=ebml&&ebml.__exportStar||function(T,A){for(var U in T)U!=="default"&&!Object.prototype.hasOwnProperty.call(A,U)&&M(A,T,U)};Object.defineProperty(N,"__esModule",{value:!0}),N.tools=N.Reader=N.Encoder=N.Decoder=void 0,B(requireEBML(),N);var F=requireEBMLDecoder();N.Decoder=F.default;var C=requireEBMLEncoder();N.Encoder=C.default;var D=requireEBMLReader();N.Reader=D.default;var i=requireTools();N.tools=i})(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var N=lib&&lib.__awaiter||function(C,D,i,T){function A(U){return U instanceof i?U:new i(function(j){j(U)})}return new(i||(i=Promise))(function(U,j){function z(te){try{Y(T.next(te))}catch(ae){j(ae)}}function K(te){try{Y(T.throw(te))}catch(ae){j(ae)}}function Y(te){te.done?U(te.value):A(te.value).then(z,K)}Y((T=T.apply(C,D||[])).next())})},M=lib&&lib.__generator||function(C,D){var i={label:0,sent:function(){if(U[0]&1)throw U[1];return U[1]},trys:[],ops:[]},T,A,U,j;return j={next:z(0),throw:z(1),return:z(2)},typeof Symbol=="function"&&(j[Symbol.iterator]=function(){return this}),j;function z(Y){return function(te){return K([Y,te])}}function K(Y){if(T)throw new TypeError("Generator is already executing.");for(;i;)try{if(T=1,A&&(U=Y[0]&2?A.return:Y[0]?A.throw||((U=A.return)&&U.call(A),0):A.next)&&!(U=U.call(A,Y[1])).done)return U;switch(A=0,U&&(Y=[Y[0]&2,U.value]),Y[0]){case 0:case 1:U=Y;break;case 4:return i.label++,{value:Y[1],done:!1};case 5:i.label++,A=Y[1],Y=[0];continue;case 7:Y=i.ops.pop(),i.trys.pop();continue;default:if(U=i.trys,!(U=U.length>0&&U[U.length-1])&&(Y[0]===6||Y[0]===2)){i=0;continue}if(Y[0]===3&&(!U||Y[1]>U[0]&&Y[1]<U[3])){i.label=Y[1];break}if(Y[0]===6&&i.label<U[1]){i.label=U[1],U=Y;break}if(U&&i.label<U[2]){i.label=U[2],i.ops.push(Y);break}U[2]&&i.ops.pop(),i.trys.pop();continue}Y=D.call(C,i)}catch(te){Y=[6,te],A=0}finally{T=U=0}if(Y[0]&5)throw Y[1];return{value:Y[0]?Y[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var B=requireEbml();function F(C){return N(this,void 0,void 0,function(){var D,i,T,A,U,j,z,K,Y,te,ae,se;return M(this,function(re){switch(re.label){case 0:if(!C)throw Error("call to fixWebmDuration requires a blob");D=new B.Decoder,i=new B.Reader,T=C.stream(),A=T.getReader(),re.label=1;case 1:return[4,A.read()];case 2:return U=re.sent(),j=U.done,z=U.value,j?(i.stop(),[3,3]):(K=D.decode(z),K=K?.filter(function(pe){return pe.type!=="unknown"}),K.forEach(function(pe){i.read(pe)}),z=null,[3,1]);case 3:return Y=B.tools.makeMetadataSeekable(i.metadatas,i.duration,i.cues),te=new Blob([Y],{type:C.type}),ae=C.slice(i.metadataSize),se=new Blob([te,ae],{type:C.type}),[2,se]}})})}return lib.default=F,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{#e;#n=!1;#t=!1;#r=0;#o=0;#i=0;#a=0;#s=0;onchange=M=>{};onDurationChange=M=>{};constructor(){}start=async(M="")=>{M||(M=`video_Record_${u(Date.now())}`);let B=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(F=>{const C=F.getTracks();for(const i of C)i.onended=()=>this.stop();this.#n=!0,this.#t=!1,this.#e=new MediaRecorder(F),this.#e.start();const D=new Date().getTime();this.#r=D,this.#i=D,this.#c(),this.#l(),this.#e.addEventListener("dataavailable",i=>{B.push(i.data)}),this.#e.addEventListener("stop",async()=>{this.#n=!1;const i=new Date().getTime();this.#o=i,this.#a+=i-this.#i,this.#c(),clearInterval(this.#s);const T=F.getTracks();for(const K of T)K.stop();if(this.#e===null)return;const A=new Blob(B,{type:this.#e.mimeType}),U=await fixWebmDuration(A),j=URL.createObjectURL(U),z=document.createElement("a");z.href=j,z.download=`${M}.mp4`,z.click(),URL.revokeObjectURL(j),B=[],this.#e=null})})};pause=async()=>{await new Promise(B=>setTimeout(()=>B(!0),300)),this.#e?.pause(),this.#t=!0;const M=new Date().getTime();this.#a+=M-this.#i,this.#c(),clearInterval(this.#s)};resume=async()=>{this.#e?.resume(),this.#t=!1;const M=new Date().getTime();this.#i=M,this.#c(),this.#l()};stop=async()=>{this.#e?.stop()};getDuration=()=>{if(this.#i===0)return 0;let M=this.#a;const B=new Date().getTime();if(this.#n&&this.#t===!1){const F=B-this.#i;this.#i=B,M=M+F}return M};getInfo=()=>({active:this.#n,pause:this.#t,startTime:this.#r,endTime:this.#o,duration:this.#a});#c=()=>{const M=this.getInfo();this.onchange(M)};#l=()=>{clearInterval(this.#s),this.#s=window.setInterval(()=>{this.#a=this.getDuration(),this.onDurationChange(this.#a)},500)}}var l=Object.defineProperty,y=N=>{throw TypeError(N)},q=(N,M,B)=>M in N?l(N,M,{enumerable:!0,configurable:!0,writable:!0,value:B}):N[M]=B,s=(N,M,B)=>q(N,typeof M!="symbol"?M+"":M,B),P=(N,M,B)=>M.has(N)||y("Cannot "+B),n=(N,M,B)=>(P(N,M,"read from private field"),B?B.call(N):M.get(N)),a=(N,M,B)=>M.has(N)?y("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(N):M.set(N,B),d,v,o;class p{constructor(M={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",(B,F={})=>new Promise(async(C,D)=>{const i=F.timeout||this.options.timeout,T=F.key||n(this,d).call(this),A=F.describe||"";if(this.queue.findIndex(j=>j.key===T)!==-1)return D(`${T} is exist.`);const U={key:T,func:B,describe:A,timeout:i,resolve:C,reject:D};this.queue.unshift(U),this.activePromise||n(this,o).call(this)})),s(this,"clear",()=>{this.queue=[],this.activePromise=void 0,clearTimeout(this.timer)}),s(this,"retry",()=>{n(this,o).call(this)}),a(this,d,()=>(this.activeIndex=this.activeIndex+1,`${this.activeIndex}`)),a(this,v,B=>{const F=this.queue.findIndex(C=>C.key===B);this.queue.splice(F,1)}),a(this,o,async()=>{const B=this.queue.length;if(B===0)return;const F=B-1,C=this.queue[F];this.activePromise=C;const{key:D,func:i,resolve:T,reject:A,timeout:U}=this.activePromise;U&&(this.timer=window.setTimeout(()=>{A(`pr-async-queue: ${D} is timeout.`),n(this,o).call(this)},U)),await i().then(T).catch(A).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,v).call(this,D),n(this,o).call(this)})}),this.options={timeout:0,...M}}}d=new WeakMap,v=new WeakMap,o=new WeakMap;const enum_iceState={connecting:"连接中",connected:"已连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};pt(enum_iceState);class PrResolves{resolvesMap=new Map;index=0;constructor(){}add=(M,B=()=>!1,F=0)=>new Promise(C=>{if(B())return C(!0);this.resolvesMap.has(M)||this.resolvesMap.set(M,new Map),this.index++;const T=`${this.index}`;if(F=Math.max(0,F),F===0){this.resolvesMap.get(M)?.set(T,{resolve:C,timer:0});return}const A=window.setTimeout(()=>{this.emit(M)},F);this.resolvesMap.get(M)?.set(T,{resolve:C,timer:A})});emit=async M=>{const B=this.resolvesMap.get(M);if(!B)return;const F=[...B.keys()];for(const C of F){const D=B.get(C);D&&(clearTimeout(D.timer),D.resolve(),B.delete(C))}}}class RoomBase{options={appid:"",sdkToken:"",roomId:"",userId:"",earlyId:Mt(),callType:0,debug:!1,reportErr:!0,useP2P:!0,logUrl:"https://logs1.quickvo.org",newPublishAutoSubscribe:!0};sfuPush=0;sfuPull=0;p2pPush=0;p2pPull=0;historical_publish_mediaTypes=[];historical_subscribe_mediaTypes=[];prResolves=new PrResolves;sdk_service_version="1.0.8";sdk_session="";isEarly=!1;isInRoom=!1;asyncQueue;await_remote_publish_users=[];roomState="ready";iceState="closed";createAt=Date.now();cwsIns;peerIns;sfuOffsetAverageQuality=-2;transceiverMap=new Map;transceiverTrackMap=new Map;sendChannel;receiveChannel;userMap=new Map;p2pMap=new Map;setLocalStreamActiveMap=new Map;phoneyStreams=new Map;recorder=new StreamRecorder;mediaDevicesErrInfo={microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""};constructor(M){this.setOptions(M),this.cwsIns=new CallsWebSocket({...M}),this.asyncQueue=new p}hasAsyncTask=M=>{let B=!1;return this.asyncQueue.activePromise?.describe===M&&(B=!0),B===!1&&this.asyncQueue.queue.find(C=>C.describe===M)&&(B=!0),B};createUserUpdateStreams=(M=[])=>{const B={};for(const F of M)B[F]=Mt();return B};reportLogs=(M,B="未知错误")=>{const F=this.getOptions(),{appid:C,userId:D,earlyId:i="",logUrl:T,reportErr:A}=F;if(!A)return;const U="web",j=z=>({ws_c_timeout:0,webrtc_c_timeout:1,join_room_error:2,publish_error:3,subscribe_error:4,close_track_error:5,heartbeat_e_timeout:6,heartbeat_i_timeout:7,quit_room_error:8})[z].toString();{const z=j(M),K={origin:U,type:z,app_id:C,user_id:D,ins_id:i,desc:B},Y=btoa(encodeURI(JSON.stringify(K))),te=`${T}/upload/log?log_key=${Y}`;{const ae=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),re=new TextEncoder().encode(ae),pe=pako.deflate(re,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:K,url:te,size:at(pe.byteLength)}),fetch(te,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:pe})}}};stopPhoneyStreams=(M=[])=>{M.length===0&&(M=mediaType_keys);for(const B of M){const F=this.phoneyStreams.get(B);if(F){const C=F.getTracks();for(const D of C)D.stop()}}};initPhoneyStreams=(M,B=[])=>{B.length===0&&(B=mediaType_keys);for(const F of B)switch(this.stopPhoneyStreams([F]),F){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(M));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(M));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}};getPhoneyStreams=M=>this.phoneyStreams.get(M);getRoomInfo=()=>{const{options:M,roomState:B,createAt:F}=this;return{...M,roomState:B,createAt:F}};setRoomState=M=>{if(this.roomState===M)return;this.roomState=M;const B=enum_roomState[M],F={state:M,stateStr:B};this.cwsIns.emitNotify("onRoomState",{code:200,data:F,desc:"room state is change."})};setIceState=M=>{if(this.iceState===M)return;this.iceState=M;const B=enum_iceState[M],F={state:M,stateStr:B};this.cwsIns.emitNotify("onIceState",{code:200,data:F,desc:"ice state is change."})};setOptions=M=>(this.options={...this.options,...M},this.options);getOptions=()=>this.options;stopStream=async M=>{const B=M.getTracks();for(const F of B)F.stop()};getMediaDevicesErrInfo=async()=>{try{const M=await navigator.mediaDevices.enumerateDevices();M.find(F=>F.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),M.find(F=>F.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(M){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",M)}return this.mediaDevicesErrInfo};getUserMediaKey=(M,B)=>`${M}-${B}`;getCallAction=async M=>{let B="";const F=D=>M.findIndex(({type:T,enabled:A=!0})=>T===D&&A)===-1?"0":"1";return B=`${F(0)}${B}`,B=`${F(1)}${B}`,B=`${F(2)}${B}`,B=`${F(3)}${B}`,parseInt(B,2)};getCallActionMap=(M=0)=>{const F=Number(M).toString(2).padStart(4,"0").split(""),[C,D,i,T]=F;return{microphoneCamera_audio:!!Number(T),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(D),screenSharing_audio:!!Number(C)}};getBanBehaviorMap=(M=0)=>{const F=Number(M).toString(2).padStart(4,"0").split(""),[C,D,i,T]=F;return{microphoneCamera_audio:!!Number(T),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(D),screenSharing_audio:!!Number(C)}};debugSdp=(M,B)=>{if(this.options.debug){const F=libExports$1.parse(M),C=dt(F.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;",`------->quickvo: debugSdp [${B}]`,{msidArr:C,sdpJson:F})}};getAverageVolume=(M,B)=>{M.getByteFrequencyData(B);let F=0;for(let D=0;D<B.length;D++)F+=B[D];return Math.ceil(F/B.length)};getTrackNamesFormTracks=(M,B=[],F="trackName")=>{const C=[];for(const D of M){const{type:i}=D;if(B.length===0||B.includes(i)){const T=D[F];T&&C.push(`${T}`)}}return C};usersFilter=M=>dt(M,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap","useP2P"]).sort((C,D)=>C.id.localeCompare(D.id,"en"))}var m=Object.defineProperty,G=(N,M,B)=>M in N?m(N,M,{enumerable:!0,configurable:!0,writable:!0,value:B}):N[M]=B,e=(N,M,B)=>G(N,typeof M!="symbol"?M+"":M,B);let g$1=class{constructor(M,B){e(this,"inputStream",new MediaStream),e(this,"outputStream",new MediaStream),e(this,"inputGain",1),e(this,"enhanceGain",1),e(this,"bgsGain",1),e(this,"bgmGain",1),e(this,"outputGain",1),e(this,"mixAudioMap",new Map),e(this,"audioContext",new AudioContext),e(this,"sourceNode"),e(this,"inputGainNode"),e(this,"enhanceGainNode"),e(this,"bgsGainNode"),e(this,"bgmGainNode"),e(this,"analyserNode"),e(this,"analyserArrayData"),e(this,"outputGainNode"),e(this,"destinationNode"),e(this,"filterStream",F=>F),e(this,"stop",()=>{{const F=this.inputStream.getTracks();for(const C of F)C.stop(),this.inputStream.removeTrack(C)}}),e(this,"pause",async F=>{const C=this.inputStream.getTracks();for(const D of C)D.enabled=!F}),e(this,"getStream",()=>this.filterStream(this.outputStream)),e(this,"setMute",(F=!0)=>{F?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)}),e(this,"setInputGain",F=>{this.inputGain=F,this.inputGainNode.gain.setValueAtTime(F,this.audioContext.currentTime)}),e(this,"setEnhanceGain",async F=>{this.enhanceGain=F+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)}),e(this,"setBgsGain",F=>{this.bgsGain=F,this.bgsGainNode.gain.setValueAtTime(F,this.audioContext.currentTime)}),e(this,"setBgmGain",F=>{this.bgmGain=F,this.bgmGainNode.gain.setValueAtTime(F,this.audioContext.currentTime)}),e(this,"setOutputGain",F=>{this.outputGain=F,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)}),e(this,"getVolume",()=>{const{analyserNode:F,analyserArrayData:C}=this;F.getByteFrequencyData(C);let D=0;for(let i=0;i<C.length;i++)D+=C[i];return Math.ceil(D/C.length)}),e(this,"mixAudio",(F,C="bgm")=>new Promise(async(D,i)=>{try{{const U=this.mixAudioMap.get(C);U&&U.stop()}const T=C==="bgs"?this.bgsGainNode:this.bgmGainNode,A=this.audioContext.createBufferSource();this.mixAudioMap.set(C,A),A.buffer=F,A.connect(T),A.onended=()=>{A.disconnect(T),this.mixAudioMap.delete(C),D(!0)},A.start(0)}catch(T){i(T)}})),e(this,"mixAudioStop",F=>{const C=this.mixAudioMap.get(F);C?.stop()}),e(this,"changeMix",(F,C)=>{const D=F==="bgs"?this.bgsGainNode:this.bgmGainNode;C?D.connect(this.destinationNode):D.disconnect(this.destinationNode)}),B&&(this.audioContext=B),this.inputStream=M,this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.inputGainNode=this.audioContext.createGain(),this.inputGainNode.gain.setValueAtTime(this.inputGain,this.audioContext.currentTime),this.enhanceGainNode=this.audioContext.createGain(),this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime),this.bgsGainNode=this.audioContext.createGain(),this.bgsGainNode.gain.setValueAtTime(this.bgsGain,this.audioContext.currentTime),this.bgmGainNode=this.audioContext.createGain(),this.bgmGainNode.gain.setValueAtTime(this.bgmGain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount),this.outputGainNode=this.audioContext.createGain(),this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime),this.destinationNode=this.audioContext.createMediaStreamDestination(),this.outputStream=this.destinationNode.stream;{const{sourceNode:F,inputGainNode:C,enhanceGainNode:D,bgsGainNode:i,bgmGainNode:T,analyserNode:A,outputGainNode:U,destinationNode:j}=this;F.connect(C),C.connect(D),D.connect(A),i.connect(A),T.connect(A),D.connect(j),i.connect(j),T.connect(j),A.connect(U),U.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}};class RoomMedias extends RoomBase{#e=[];#n=new Map;#t=new Map;#r=new Map;#o=new Map;#i=new Map;localStreamsActionMap=new Map;#a=new Map;audioContext=new(window.AudioContext||window.webkitAudioContext);constructor(M){super(M),this.#u(),this.#c(),this.#s(),document.addEventListener("click",()=>{this.audioContext?.state==="suspended"&&this.audioContext.resume()})}initMediaPhoneyStreams=(M=[])=>this.initPhoneyStreams(this.audioContext,M);initLocalStreamsFilter=()=>{for(const M of mediaType_keys){const B=async F=>F;this.#a.set(M,B)}};setLocalFilterStream=(M,B)=>{this.#a.set(M,B)};#s=()=>{this.#t.set("microphoneCamera_audio",{sampleRate:48e3,channelCount:2,autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),this.#t.set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),this.#t.set("screenSharing_video",{frameRate:{min:10,ideal:30}}),this.#t.set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})};#c=()=>{this.#n.set("audioinput",void 0),this.#n.set("videoinput",void 0),this.#n.set("audiooutput",void 0)};emitNotifyUpdateUsersStreams=async M=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:M,desc:"users streams is change."})};initUserMediaStreamContext=async(M,B,F)=>{const C=this.getUserMediaKey(M,B),{kind:D}=F;switch(D){case"audio":{const i=new MediaStream;i.addTrack(F);const T=new g$1(i,this.audioContext);this.#r.set(C,T)}break;case"video":{const i=new VideoMediaContext(F);this.#o.set(C,i)}break}};getUserMediaStreamContext=(M,B)=>{const F=this.getUserMediaKey(M,B);if(["microphoneCamera_audio","screenSharing_audio"].includes(B))return this.#r.get(F);if(["microphoneCamera_video","screenSharing_video"].includes(B))return this.#o.get(F)};getUserAudioMediaStreamContext=(M,B)=>{const F=this.getUserMediaKey(M,B);return this.#r.get(F)};removeUserMediaStreamContext=(M,B)=>{const F=this.getUserMediaKey(M,B);if(["microphoneCamera_audio","screenSharing_audio"].includes(B))return this.#r.get(F)?.stop(),this.#r.delete(F);if(["microphoneCamera_video","screenSharing_video"].includes(B))return this.#o.get(F)?.stop(),this.#o.get(F)};getUserStream=(M,B)=>this.getUserMediaStreamContext(M,B)?.getStream()||new MediaStream;getUserStreams=(M,B=[])=>{B.length===0&&(B=mediaType_keys);const F={};for(const C of B){const D=this.getUserStream(M,C);F[C]=D}return F};removeUserStreams=async(M,B=[])=>{B.length===0&&(B=mediaType_keys);for(const F of B)this.removeUserMediaStreamContext(M,F)};clearUserStreams=()=>{{const M=this.#r.values();for(const B of M)B.stop();this.#r=new Map}{const M=this.#o.values();for(const B of M)B.stop();this.#o=new Map}};setMediaTrackConstraints=async(M,B)=>{this.#t.set(M,B);const F=await this.getLocalStream(M);if(!F)return;const C=F.getTracks();if(C.length!==0)for(const D of C){const i=D.getConstraints(),A={...this.#t.get(M),...i,...B};await D.applyConstraints(A)}};checkLocalStream=async(M=[])=>{M.length===0&&(M=mediaType_keys);let B=[],F=[];for(const C of M)await this.getLocalStream(C)?F.push(C):B.push(C);return{valid_mediaTypes:F,invalid_mediaTypes:B}};stopLocalStreams=async(M=[])=>{M.length===0&&(M=mediaType_keys);for(const B of M){const F=this.#i.get(B);F&&await this.stopStream(F),this.#i.delete(B)}};addLocalStream=(M,B)=>{const F=this.#i.get(M);F&&this.stopStream(F),this.#i.set(M,B)};initLocalStream=async M=>{switch(M){case"microphoneCamera_audio":{const B=this.#n.get("audioinput"),F=this.#t.get("microphoneCamera_audio"),C=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:B},...F},video:!1});this.addLocalStream("microphoneCamera_audio",C)}break;case"microphoneCamera_video":{const B=this.#n.get("videoinput"),F=this.#t.get("microphoneCamera_video"),C=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:{exact:B},...F}});this.addLocalStream("microphoneCamera_video",C)}break;case"microphoneCamera":{const B=this.#n.get("audioinput"),F=this.#n.get("videoinput"),C=this.#t.get("microphoneCamera_audio"),D=this.#t.get("microphoneCamera_video"),T=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:B},...C},video:{deviceId:{exact:F},...D}})).getTracks();for(const A of T){const{kind:U}=A;if(U==="audio"){const j=new MediaStream;j.addTrack(A),this.addLocalStream("microphoneCamera_audio",j)}if(U==="video"){const j=new MediaStream;j.addTrack(A),this.addLocalStream("microphoneCamera_video",j)}}}break;case"screenSharing_audio":{const B=this.#t.get("screenSharing_audio"),C=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...B})).getTracks();for(const D of C){const{kind:i}=D;if(i==="audio"){const T=new MediaStream;T.addTrack(D),this.addLocalStream("screenSharing_audio",T)}}}break;case"screenSharing_video":{const B=this.#t.get(M),C=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...B})).getTracks();for(const D of C){const{kind:i}=D;if(i==="video"){const T=new MediaStream;T.addTrack(D),this.addLocalStream("screenSharing_video",T)}}}break;case"screenSharing":{const B=this.#t.get("screenSharing_audio"),F=this.#t.get("screenSharing_video"),D=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...B,...F})).getTracks();for(const i of D){const{kind:T}=i;if(T==="audio"){const A=new MediaStream;A.addTrack(i),this.addLocalStream("screenSharing_audio",A)}if(T==="video"){const A=new MediaStream;A.addTrack(i),this.addLocalStream("screenSharing_video",A)}}}break}};getLocalStream=async M=>{const B=this.#i.get(M),F=this.#a.get(M);let C=B;return B&&F&&(C=await F(B)),C};getLocalStreams=async(M=[])=>{M.length===0&&(M=mediaType_keys);const B={};for(const F of M)B[F]=await this.getLocalStream(F);return B};#l=async()=>!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices?(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 不支持 enumerateDevices"),[]):(await navigator.mediaDevices.enumerateDevices().then(M=>{const B=M.filter(F=>!["communications"].includes(F.deviceId));this.#e=B.sort((F,C)=>F.label.localeCompare(C.label,"zh-Hans-CN",{sensitivity:"accent"}))}).catch(function(M){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",M)}),this.#e);#u=()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await this.#l(),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),this.#l()};getMediaDeviceKind=M=>this.#n.get(M);changeAudiooutput=async()=>{try{const M=this.#n.get("audiooutput");await this.audioContext.setSinkId(M||"default")}catch(M){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",M)}};setDeviceKind=(M,B)=>{this.#n.set(M,B)};setAudioOutputDevice=M=>this.setDeviceKind("audiooutput",M);getEnumerateDevices=async M=>(await this.#l(),this.#e.filter(F=>F.kind===M));getEnumerateAudioinputDevices=()=>this.getEnumerateDevices("audioinput");getEnumerateAudioOutputDevices=()=>this.getEnumerateDevices("audiooutput");getEnumerateVideoinputDevices=()=>this.getEnumerateDevices("videoinput")}const getNetworkQuality=(N,M,B)=>{const F=Number(N),C=Number(M),D=Number(B);let i=0;return F<.03&&C<100&&D<.05?i=5:F<.06&&C<160&&D<.1?i=4:F<.1&&C<250&&D<.15?i=3:F<.15&&C<400&&D<.2?i=2:i=1,Number(i)};class PeerAnalyzeStats{pc;network={inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0",quality:0,averageQuality:0,velocityPull:0,velocityPush:0};reports=[];averageQualitys=[];timer=0;constructor(){}onNetwork=M=>{};getNetwork=()=>this.network;getAverageQuality=()=>this.network.averageQuality;start=M=>{this.stop(),this.network={inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0",quality:0,averageQuality:0,velocityPull:0,velocityPush:0},this.reports=[],this.averageQualitys=[],this.pc=M,clearInterval(this.timer),this.timer=window.setInterval(this.analyzeStats,1*1e3)};analyzeStats=async()=>{try{if(!this.pc)return;if(["failed","closed"].includes(this.pc?.connectionState))return this.network.averageQuality=0,this.network.quality=0,this.network.velocityPull=0,this.network.velocityPush=0,this.averageQualitys=[],this.onNetwork(this.network);const M=await this.pc.getStats(),B=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport","codec"],C=[...M.values()].filter(ue=>B.includes(ue.type));let D=0,i=0,T=0,A=0,U=0,j=0,z=[],K=[];for(const ue of this.reports){const{packetsSent:fe,packetsLost:ye}=ue;fe&&(T+=fe),ye&&(A+=ye)}this.reports=C;for(const ue of this.reports){const{bytesSent:fe,bytesReceived:ye,packetsSent:oe,packetsLost:de,roundTripTime:be,jitter:_e}=ue;fe&&(i=fe),ye&&(D=ye),oe&&(U+=oe),de&&(j+=de),be&&z.push((be*100).toFixed(2)),_e&&K.push(_e.toFixed(2))}K.sort().reverse(),z.sort().reverse();const Y=U-T,te=j-A,ae=Y===0?"0.00":Math.max(0,te/Y).toFixed(2),[se="0"]=z,[re="0"]=K,pe=getNetworkQuality(ae,se,re);let ke,ie,ce;this.averageQualitys.unshift(pe),this.averageQualitys=this.averageQualitys.slice(0,10),ke=this.averageQualitys.length===10?Math.round(this.averageQualitys.reduce((fe,ye)=>fe+ye)/this.averageQualitys.length):0,ie=Math.max(0,D-this.network.inboundBytes),ce=Math.max(0,i-this.network.outboundBytes);const he={outboundBytes:i,inboundBytes:D,lostRate:ae,roundTripTime:se,jitter:re,quality:pe,averageQuality:ke,velocityPull:ie,velocityPush:ce};this.network=he,this.onNetwork(this.network)}catch(M){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: analyzeStats is err.",M)}};getReports=async(M=[])=>{let B=[...this.reports];return M.length!==0&&(B=B.filter(F=>M.includes(F.mid))),B};stop=()=>{clearInterval(this.timer)}}class P2P{pr_resolves=new PrResolves;roomId;userId;remoteUserId;phoney_streams_map=new Map;peer_ins;timer;local_channel;remote_channel;icecandidates=[];candidate_collected=!1;analyze_stats_ins=new PeerAnalyzeStats;send_transceiver_map=new Map;recv_transceiver_map=new Map;tracks=[];onClose=()=>{};constructor(M,B,F,C){this.roomId=M,this.userId=B,this.remoteUserId=F,this.phoney_streams_map=C}remoteChannelSend=M=>{if(this.remote_channel?.readyState!=="open")return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: remote_channel is error.",{remote_channel:this.remote_channel});const B=sendMessageFormat(M),F=new Uint8Array(obj2pb(B));this.remote_channel?.send(F)};#e=async M=>{const B=new Uint8Array(M),F=pb2obj(B),C=onMessageFormat(F),{event:D,data:i}=C;switch(D){case"UpdateTrackActive":{const{tracks:T=[]}=i;for(const A of T){const{type:U,isActive:j=!1}=A,z=mediaType_keys[U];await this.pauseSends([z],!j)}}break}};#n=M=>{M.candidate?this.icecandidates.push(M.candidate):(this.candidate_collected=!0,this.pr_resolves.emit("candidateCollected"))};#t=async M=>{const B=M.target.connectionState;switch(B){case"connected":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: p2p.peer_ins: ${B}`),this.pr_resolves.emit("iceConnected");break;case"disconnect":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: p2p.peer_ins: ${B}`),this.timer=setTimeout(()=>this.close(),20*1e3);break;case"failed":case"closed":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: p2p.peer_ins: ${B}`),this.close();break;default:console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: p2p.peer_ins: ${B}`);break}};init=async()=>{this.peer_ins?.connectionState!=="connected"&&(this.destroy(),this.peer_ins=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}]}),this.peer_ins.addTransceiver("audio",{direction:"inactive"}),this.local_channel=this.peer_ins.createDataChannel("p2p_pause_action",{}),this.local_channel.onmessage=M=>this.#e(M.data),this.peer_ins.ondatachannel=M=>{this.remote_channel=M.channel,this.pr_resolves.emit("remoteChannelConnected")},this.peer_ins.addEventListener("icecandidate",this.#n),this.peer_ins.addEventListener("connectionstatechange",this.#t),this.analyze_stats_ins?.start(this.peer_ins))};initSenders=async(M=[],B="sendrecv")=>{const F=this.checkPeer(),C=[],D=F?.getTransceivers()||[];for(const i of mediaType_keys){const T=this.send_transceiver_map.get(i);if(!T)continue;D.find(U=>U.direction!=="stopped"&&U.mid===T?.mid)||this.send_transceiver_map.delete(i)}for(const i of M){const{mid:T,mediaType:A}=i;let U=D?.find(j=>j.mid===T);if(U){if(!U.sender.track){const j=this.getPhoneyStreams(A),[z]=j.getTracks();U.sender.replaceTrack(z)}U.direction=B,this.send_transceiver_map.set(A,U),C.push(A),B=="sendrecv"&&!this.recv_transceiver_map.has(A)&&(U.receiver.track.enabled=!1,this.recv_transceiver_map.set(A,U))}}return C};initRecvs=async(M=[],B="sendrecv")=>{const F=this.checkPeer(),C=[],D=F?.getTransceivers()||[];for(const i of mediaType_keys){const T=this.recv_transceiver_map.get(i);if(!T)continue;D.find(U=>U.direction!=="stopped"&&U.mid===T?.mid)||this.recv_transceiver_map.delete(i)}for(const i of M){if(this.recv_transceiver_map.get(i))continue;const A=this.getPhoneyStreams(i),[U]=A.getTracks(),j=F.addTransceiver(U,{direction:B});j.direction=B,this.recv_transceiver_map.set(i,j),C.push(i)}return C};hasRecv=async M=>this.recv_transceiver_map.has(M);checkActive=()=>{if(!this.peer_ins||this.peer_ins.connectionState!=="connected")return!1;let M=!1;for(const B of mediaType_keys){const F=this.send_transceiver_map.get(B);if(!F)continue;const{sender:C}=F;if(C.track&&C.track.enabled!==!1){M=!0;break}}for(const B of mediaType_keys){const F=this.recv_transceiver_map.get(B);if(!F)continue;const{receiver:C}=F;if(C.track&&C.track.enabled!==!1){M=!0;break}}return M};pauseSends=async(M=[],B)=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: pauseSends:${this.userId}:${B}`,M);const F=[];for(const C of M){const D=this.send_transceiver_map.get(C);if(!D)continue;const{sender:i}=D;i.track&&(i.track.enabled=!B,F.push(C))}return F};pauseRecvs=async(M=[],B)=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: pauseRecvs:${this.userId}:${B}`,M);const F=[];for(const D of M){const i=this.recv_transceiver_map.get(D);if(!i)continue;const{receiver:T}=i;T.track&&(T.track.enabled=!B,F.push(D))}const C=await this.getRecvTracks(F);return this.remoteChannelSend({event:"UpdateTrackActive",data:{roomId:this.roomId,tracks:C}}),F};createOffer=async()=>{const M=this.checkPeer(),B=await M.createOffer();return await M.setLocalDescription(B),B};setOffer=async M=>{await this.checkPeer().setRemoteDescription(M),await this.pr_resolves.emit("setOffered")};createAnswer=async()=>{const M=this.checkPeer(),B=await M.createAnswer();return await M.setLocalDescription(B),B};setAnswer=async M=>{await this.checkPeer().setRemoteDescription(M)};getIcecandidates=async()=>(await this.candidateCollected(),this.icecandidates);addCandidates=async M=>{const B=this.checkPeer();await this.setOffered();for(const F of M)await B.addIceCandidate(F)};getSenderTracks=async(M=[])=>{const B=[];for(const F of M){const C=this.send_transceiver_map.get(F);if(!C)continue;const{mid:D,sender:i}=C,{track:T}=i;if(!T)continue;const{id:A,enabled:U}=T,j=mediaType_keys.findIndex(Y=>Y===F),z=Mt(),K={type:j,enabled:U,trackName:`web-${j}-${A}`,location:"local",mid:D,key:z,origin:"p2p",mediaType:F};B.push(K)}return B};getRecvTracks=async(M=[])=>{const B=[];for(const F of M){const C=this.recv_transceiver_map.get(F);if(!C)continue;const{mid:D,receiver:i}=C,{track:T}=i;if(!T)continue;const{id:A,enabled:U}=T,j=mediaType_keys.findIndex(Y=>Y===F),z=Mt(),K={type:j,enabled:U,trackName:`web-${j}-${A}`,location:"local",mid:D,key:z,isActive:U};B.push(K)}return B};isActive=M=>!this.peer_ins||this.peer_ins.connectionState!=="connected"?!1:this.recv_transceiver_map.get(M)?.receiver?.track.enabled||!1;getTrack=M=>this.recv_transceiver_map.get(M)?.receiver?.track;getPhoneyStreams=M=>this.phoney_streams_map.get(M);candidateCollected=()=>this.pr_resolves.add("candidateCollected",()=>this.candidate_collected);remoteChannelConnected=()=>this.pr_resolves.add("remoteChannelConnected",()=>this.remote_channel?.readyState==="open");iceConnected=()=>this.pr_resolves.add("iceConnected",()=>this.peer_ins?.connectionState==="connected");setOffered=()=>this.pr_resolves.add("setOffered",()=>this.peer_ins?.remoteDescription);checkPeer=()=>{if(!this.peer_ins)throw new Error("you need init peer.");return this.peer_ins};close=()=>{clearTimeout(this.timer);{const M=[...this.send_transceiver_map.values()];for(const B of M)B.currentDirection!=="stopped"&&B.stop();this.send_transceiver_map=new Map}{const M=[...this.recv_transceiver_map.values()];for(const B of M)B.currentDirection!=="stopped"&&B.stop();this.recv_transceiver_map=new Map}this.peer_ins?.removeEventListener("icecandidate",this.#n),this.peer_ins?.removeEventListener("connectionstatechange",this.#t),this.peer_ins?.close(),this.onClose()};destroy=async()=>{this.analyze_stats_ins.stop(),this.analyze_stats_ins.onNetwork=()=>{},this.close(),this.icecandidates=[],this.candidate_collected=!1,this.local_channel=void 0,this.remote_channel=void 0,this.peer_ins=void 0}}class RoomUsers extends RoomMedias{constructor(M){super(M)}getP2PIns=async M=>this.p2pMap.get(M);getMaxVolumeUser=()=>{const M=Array.from(this.userMap.values(),({id:F})=>F);if(M.length===0)return;let B=[];for(const F of M){const C=this.getUserAudioMediaStreamContext(F,"microphoneCamera_audio");if(!C)continue;const D=C.getVolume();B.push({id:F,volume:D})}return B=B.sort((F,C)=>F.volume-C.volume>0?-1:1),B[0]};setVolume=(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.setInputGain(F)};setEnhanceGain=async(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.setEnhanceGain(F)};setSpeaker=(M,B,F)=>{const C=this.getUserAudioMediaStreamContext(M,B);C?.setOutputGain(F);const D=F===0;try{C?.setMute(D)}catch{}};playBgs=(M,B,F)=>this.getUserAudioMediaStreamContext(M,B)?.mixAudio(F,"bgs");setBgsGain=(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.setBgsGain(F)};stopBgs=(M,B)=>{this.getUserAudioMediaStreamContext(M,B)?.mixAudioStop("bgs")};playBgm=(M,B,F)=>this.getUserAudioMediaStreamContext(M,B)?.mixAudio(F,"bgm");setBgmGain=(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.setBgmGain(F)};stopBgm=(M,B)=>{this.getUserAudioMediaStreamContext(M,B)?.mixAudioStop("bgm")};changBgsMix=(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.changeMix("bgs",F)};changBgmMix=(M,B,F)=>{this.getUserAudioMediaStreamContext(M,B)?.changeMix("bgm",F)};getVolume=(M,B)=>this.getUserAudioMediaStreamContext(M,B)?.getVolume();clearUsers=()=>{this.userMap=new Map};removeUsers=async M=>{for(const B of M)this.userMap.delete(B),this.p2pMap.delete(B),await this.removeUserStreams(B)};createUser=async M=>{const B=Date.now(),F=this.getOptions(),C={id:M,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},banBehavior:0,banBehaviorStr:"",banBehaviorMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isOwner:this.userMap.size===0,isSelf:M===F.userId,isPublished:!1,useP2P:!1,joinTime:B,updateAt:B,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};if(this.userMap.set(M,C),C.isSelf===!1&&!this.p2pMap.has(M)){const D=new P2P(this.options.roomId,this.options.userId,M,this.phoneyStreams);this.p2pMap.set(M,D)}};getUser=async M=>(this.userMap.has(M)||await this.createUser(M),this.userMap.get(M));getUsers=async(M=[])=>{M.length===0&&(M=[...this.userMap.keys()]);const B=[];for(const F of M){const C=await this.getUser(F);B.push(C)}return B};getAllUserTrackMids=async()=>{const M=await this.getUsers(),B=[];for(const F of M){const{tracks:C=[]}=F;for(const D of C)B.push(D.mid)}return B};getUserTrackByTrackName=async M=>{const B=await this.getUsers(),F=[];for(const C of B){const{tracks:D=[]}=C;for(const i of D){const{trackName:T}=i;M.includes(T)&&F.push(i)}}return F};getUserTrackByMid=async M=>{const B=await this.getUsers();let F;for(const C of B){const{tracks:D=[]}=C;for(const i of D)if(i.mid===M){F=i;break}}return F};getUsersMediaTypeBytrackNames=async M=>{if(M.length===0)return[];const B=[],F=await this.getUsers();for(const C of F){const{id:D,tracks:i=[]}=C,T=[];for(const U of i){const{trackName:j,mediaType:z}=U;!M.includes(j)||!z||T.push(z)}if(T.length===0)continue;const A={userId:D,mediaTypes:T};B.push(A)}return B};checkSubscribed=async(M,B)=>{const F=await this.getUser(M),{tracks:C=[]}=F,D=[],i=[];for(const T of B)C.find(U=>U.mediaType===T&&(U.msid||U.origin==="p2p"))?D.push(T):i.push(T);return{subscribed_mediaTypes:D,prohibited_mediaTypes:i}};createUserTrackByUserMediaTypes=async(M=[],B={})=>{const F=[],C=await this.getUsers();for(const D of C){const{id:i,tracks:T=[]}=D;let A=[];const U=M.find(j=>j.userId===i);if(U){for(const j of T){if(!U.mediaTypes.includes(j.mediaType))continue;const z={...j,...B};A.push(z)}A.length!==0&&F.push({id:i,tracks:A})}}return F};getUserStreamOrigin=async(M,B)=>{const F=await this.getUser(M),{tracks:C=[]}=F;return C.find(D=>D.mediaType===B)?.origin||"unknown"};getAllUserMediaTypes=async()=>{const M=[],B=await this.getUsers();for(const F of B){const{id:C,tracks:D=[],isSelf:i}=F;if(i)continue;const T=Array.from(D,A=>A.mediaType);M.push({userId:C,mediaTypes:T})}return M};checkUserInRoom=M=>this.userMap.has(M);getUsersId=async()=>[...this.userMap.keys()];getSelfInfo=async()=>await this.getUser(this.options.userId);updateIsPublished=async(M,B=!1)=>{const F=await this.getUser(M);F.isPublished=B};setUserUpdateStreams=async(M,B,F=!0)=>{const C=await this.getUser(M),D={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};D[B]=F,C.updateStreams=D};updateUsertracks=async(M,B=[],F)=>{const C=await this.getUser(M);F&&(B=[...C.tracks,...B]),B=B.filter(({mid:T=""})=>T!==""),B=ft(B,["type"]),B=B.sort((T,A)=>T.type-A.type<0?-1:1);for(const T of B)T.userId=M,T.mediaType=mediaType_keys[T.type],T.enabled===void 0&&(T.enabled=!0),T.origin===void 0&&(T.origin="sfu");C.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const D=dt(C.tracks,["mediaType","enabled","mid","msid","trackName","key"]),i=dt(B,["mediaType","enabled","mid","msid","trackName","key"]);for(const T of mediaType_keys){const A=i.find(z=>z.mediaType===T),U=D.find(z=>z.mediaType===T),j=JSON.stringify(A)!==JSON.stringify(U);C.updateStreams[T]=j}C.tracks=B};updateUserCallAction=async(M,B=0)=>{const F=await this.getUser(M);F.callAction=B,F.callActionStr=B.toString(2).padStart(4,"0"),F.callActionMap=this.getCallActionMap(B)};updateUserBehaviors=async(M,B=0)=>{const F=await this.getUser(M);F.banBehavior=B,F.banBehaviorStr=B.toString(2).padStart(4,"0"),F.banBehaviorMap=this.getBanBehaviorMap(B)};updateUserNetwork=async(M,B={egress:5,ingress:5})=>{const F=await this.getUser(M);F.network=B};updateUserPermissions=async(M,B)=>{if(B){const F=await this.getUser(M);F.permissions=B}};updateUserUseP2P=async(M,B)=>{const F=await this.getUser(M);F.useP2P=B};updateUserBase=async M=>{const B=this.getOptions(),F=await this.getUser(M);F.isSelf=M===B.userId,F.updateAt=Date.now()};updateUsers=async M=>{for(const B of M){const{id:F,tracks:C,callAction:D,permissions:i,isPublished:T,useP2P:A}=B;await this.updateUserBase(F),await this.updateIsPublished(F,T),await this.updateUserPermissions(F,i),await this.updateUsertracks(F,C,!0),await this.updateUserCallAction(F,D),await this.updateUserNetwork(F),await this.updateUserUseP2P(F,A)}};emitNotifyUpdateUser=async M=>{const B=await this.getUsers([M]),[F]=this.usersFilter(B);this.cwsIns.emitNotify("onRoomUser",{code:200,data:F,desc:"user info is change."})};emitNotifyUpdateUsers=async()=>{const M=await this.getUsers(),B=this.usersFilter(M);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:B,desc:"all users info is change."})}}class RoomPeer extends RoomUsers{#e=0;peerAnalyzeStatsIns=new PeerAnalyzeStats;simulcast="f";offset_inboundBytes=0;offset_outboundBytes=0;constructor(M){super(M),this.initPeer(),this.peerAnalyzeStatsIns.onNetwork=this.#r}saveBoundBytes=M=>{const B=this.peerAnalyzeStatsIns?.getNetwork();B&&(M==="superfluous"&&(this.offset_inboundBytes=-B.inboundBytes,this.offset_outboundBytes=-B.outboundBytes),M==="missing"&&(this.offset_inboundBytes=this.offset_inboundBytes+B.inboundBytes,this.offset_outboundBytes=this.offset_outboundBytes+B.outboundBytes))};getTrafficUse=()=>{const{sfuPush:M,sfuPull:B,p2pPush:F,p2pPull:C}=this;return{sfuPush:M,sfuPull:B,p2pPush:F,p2pPull:C}};initPeer=()=>{clearTimeout(this.#e),this.saveBoundBytes("missing"),this.transceiverMap=new Map,this.peerIns?.close(),this.peerIns=void 0,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.#n(),this.initMediaPhoneyStreams(),this.startGetPeerStats()};replaceSenderStream=async(M=[],B)=>{const F=this.getOptions(),{userId:C}=F;M.length===0&&(M=mediaType_keys);for(const D of M){const i=this.transceiverMap.get(D);let T;if(i){const{sender:A}=i;B?T=this.getUserStream(C,D):T=this.getPhoneyStreams(D);const[U]=T.getTracks();await A.replaceTrack(U)}}};getSenderTracks=async(M=[])=>{const B=[];for(const F of M){const C=this.transceiverMap.get(F),D=this.transceiverTrackMap.get(F);D&&(D.enabled=C?.sender.track?.enabled,B.push(D))}return B};setCodecPreferences=M=>{if(!["microphoneCamera_video"].includes(M))return;const B=(A,U)=>A.sort((j,z)=>{const K=U.indexOf(j.mimeType),Y=U.indexOf(z.mimeType),te=K>=0?K:Number.MAX_VALUE,ae=Y>=0?Y:Number.MAX_VALUE;return te-ae}),F=RTCRtpReceiver.getCapabilities("video")?.codecs||[],i=[B(F,["video/H264","video/VP8","video/VP9"])[0]],T=this.transceiverMap.get(M);T&&(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: sortedCodecs",i),T?.setCodecPreferences(i))};addSenders=async(M=[])=>{const B={direction:"sendonly"};M.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const F=[];for(const C of M){if(this.transceiverMap.get(C))continue;const i=this.getPhoneyStreams(C),[T]=i.getTracks(),A=this.peerIns.addTransceiver(T,B);this.transceiverMap.set(C,A),F.push(C)}if(M.length===0||F.length!==0){const C=await this.peerIns.createOffer();if(this.options.debug){const D=libExports$1.parse(C.sdp),i=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:i,sdpJson:D,description:C})}await this.peerIns.setLocalDescription(C);for(const D of F){const i=this.transceiverMap.get(D);if(!i)continue;const{mid:T,sender:A}=i,{track:U}=A;if(!U)continue;const{enabled:j}=U,z=mediaType_keys.findIndex(te=>te===D),K=`WEB-${z}-${Mt()}`,Y={type:z,mediaType:D,enabled:j,trackName:K,location:"local",mid:T,key:"",origin:"unknown"};this.transceiverTrackMap.set(D,Y)}}return F};removeSenders=async(M=[])=>{M.length===0&&(M=mediaType_keys);for(const B of M)this.transceiverMap.has(B)&&(this.transceiverMap.delete(B),this.transceiverTrackMap.delete(B))};stopSenders=(M=[])=>{M.length===0&&(M=mediaType_keys);for(const B of M){if(!this.transceiverMap.has(B))continue;const F=this.transceiverMap.get(B);F?.sender.track?.stop(),F?.stop()}};#n=()=>{const M=()=>{clearTimeout(this.#e),this.setIceState("failed")};this.peerIns.onconnectionstatechange=async B=>{const F=B.target.connectionState;switch(F){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${F}`),clearTimeout(this.#e),this.setIceState("connected"),this.prResolves.emit("iceConnected");break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${F}`),this.setIceState("disconnected"),this.#e=window.setTimeout(M,15*1e3);break;case"failed":{if(this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${F}`),this.iceState==="closed")return;this.setIceState("failed")}break;case"closed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${F}`),clearTimeout(this.#e),this.setIceState("closed");break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${F}`);break}}};iceConnected=()=>{const M=()=>this.peerIns.iceConnectionState==="connected";return this.prResolves.add("iceConnected",M)};stopTransceivers=async M=>{const B=this.peerIns.getTransceivers();for(const F of B){const{mid:C}=F;C&&M.includes(C)&&(F.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver: ${C} is stop.`,F))}};createOffer=async()=>{const M=await this.peerIns.createOffer();if(this.options.debug){const B=libExports$1.parse(M.sdp),F=dt(B.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:F,sdpJson:B,description:M})}await this.peerIns.setLocalDescription(M)};createAnswer=async()=>{const M=await this.peerIns.createAnswer();if(this.options.debug){const B=libExports$1.parse(M.sdp),F=dt(B.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:F,sdpJson:B,description:M})}await this.peerIns.setLocalDescription(M)};getSdp=()=>this.peerIns.localDescription?.sdp;setRemoteDescription=async M=>{if(this.options.debug){const B=libExports$1.parse(M.sdp),F=dt(B.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:F,sdpJson:B,description:M})}return await this.peerIns.setRemoteDescription(M),M};setCallStrategy=async(M,B=[])=>{B.length===0&&(B=mediaType_keys);let F="balanced";switch(M){case"qualityPriority":F="maintain-resolution";break;case"fluencyPriority":F="maintain-framerate";break;case"balancedDowngrade":F="balanced";break}const C=await this.getSelfInfo(),D=Array.from(C.tracks,({trackName:T})=>T),i=this.peerIns.getSenders();for(const T of i){const{track:A}=T;if(!A||!D.includes(A.id))continue;const U=T.getParameters();T.setParameters({...U,degradationPreference:F})}};setRTCRtpSenderParameters=M=>{try{const B=this.peerIns.getSenders();for(const F of B){const C=F.getParameters();console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: _parameters",C),F.setParameters({...C,...M})}}catch(B){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",B)}};setSimulcast=M=>{this.simulcast=M};getPeerNetwork=()=>{const M=this.peerAnalyzeStatsIns?.getNetwork();return JSON.parse(JSON.stringify(M))};getRoomNetwork=()=>{const M=this.peerAnalyzeStatsIns?.getNetwork(),B=JSON.parse(JSON.stringify(M));B.inboundBytes=Math.max(0,B.inboundBytes+this.offset_inboundBytes),B.outboundBytes=Math.max(0,B.outboundBytes+this.offset_outboundBytes);const F=[...this.p2pMap.keys()],C={averageQuality:0,inboundBytes:0,jitter:0,lostRate:0,outboundBytes:0,quality:0,roundTripTime:0,velocityPull:0,velocityPush:0};if(F.length!==0){const D=[];for(const i of F){const T=this.p2pMap.get(i)?.analyze_stats_ins.getNetwork();D.push(T)}C.averageQuality=Math.round(Array.from(D,i=>i?.averageQuality).reduce((i,T)=>i+T,0)/D.length*100)/100,C.inboundBytes=Array.from(D,i=>i?.inboundBytes).reduce((i,T)=>i+T,0),C.jitter=Array.from(D,i=>i?.jitter).reduce((i,T)=>i+T,0)/D.length,C.lostRate=Array.from(D,i=>i?.lostRate).reduce((i,T)=>i+T,0)/D.length,C.outboundBytes=Array.from(D,i=>i?.outboundBytes).reduce((i,T)=>i+T,0),C.quality=Math.round(Array.from(D,i=>i?.quality).reduce((i,T)=>i+T,0)/D.length*100)/100,C.roundTripTime=Array.from(D,i=>i?.roundTripTime).reduce((i,T)=>i+T,0)/D.length,C.velocityPull=Array.from(D,i=>i?.velocityPull).reduce((i,T)=>i+T,0)/D.length,C.velocityPush=Array.from(D,i=>i?.velocityPush).reduce((i,T)=>i+T,0)/D.length}return{sfu:B,p2p:C}};#t=()=>{const M=this.getRoomNetwork();{const{outboundBytes:B,inboundBytes:F}=M.sfu;this.sfuPush=Math.ceil(B/1024),this.sfuPull=Math.ceil(F/1024)}this.cwsIns.emitNotify("onRoomNetwork",{code:200,data:M,desc:"room network is change."})};#r=async M=>{try{if(this.roomState!=="connected")return;const{quality:B}=M;B>=2&&this.prResolves.emit("senderActived"),this.#t();const F=await this.getSelfInfo(),{network:C}=F,D={egress:B,ingress:B};At("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,D),JSON.stringify(C)!==JSON.stringify(D)){this.emitNotifyUpdateUsers();const A=this.getOptions(),{userId:U,roomId:j}=A,z={...D,userId:U,roomId:j};this.cwsIns.sendMessage({event:"networkQualityChange",data:z},!1)}},3*1e3)}catch(B){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",B)}};getReportsByMid=async(M=[])=>await this.peerAnalyzeStatsIns?.getReports(M);startGetPeerStats=()=>{this.peerAnalyzeStatsIns.start(this.peerIns);const M=[...this.p2pMap.values()];for(const B of M)B.peer_ins&&B.analyze_stats_ins.start(B.peer_ins)};stopGetPeerStats=()=>{this.peerAnalyzeStatsIns.stop();const M=[...this.p2pMap.values()];for(const B of M)B.analyze_stats_ins.stop()}}const g=(N,M)=>{if(!(N!=null&&N.ip)||!(N!=null&&N.port)||!(N!=null&&N.serve_ip)||!(N!=null&&N.serve_port)||!(M!=null&&M.ip)||!(M!=null&&M.port)||!(M!=null&&M.serve_ip)||!(M!=null&&M.serve_port))return"Unknown";const[B,F]=[N.ip,N.port],[C,D]=[N.serve_ip,N.serve_port],[i,T]=[M.ip,M.port],[A,U]=[M.serve_ip,M.serve_port];return B===i&&F===T?"Full Cone":B===C&&(i!==C||T!==F)||i===A&&(B!==A||F!==T)?"Restricted Cone":B===C&&F===D&&(i!==C||T!==D)||i===A&&T===U&&(B!==A||F!==U)?"Port Restricted Cone":"Symmetric"},h=async()=>{const N="stun.cloudflare.com:3478",M="stun.l.google.com:19302",B=async F=>new Promise(C=>{const D=new RTCPeerConnection({iceServers:[{urls:`stun:${F}`}]});D.createDataChannel("ice-channel");let i=null;D.onicecandidate=T=>{var A,U;if(((A=T.candidate)==null?void 0:A.type)==="srflx"){const[j,z]=F.split(":").map(K=>K.trim());i={ip:T.candidate.address||"",port:(U=T.candidate.port)==null?void 0:U.toString(),serve_ip:j,serve_port:z},D.close(),C(i)}},setTimeout(()=>{D.close(),C(null)},5e3),D.createOffer().then(T=>D.setLocalDescription(T)).catch(()=>C(null))});try{const F=await B(N),C=await B(M);if(!F||!C)return{address:"",natType:"Unknown"};const D=g(F,C);return{address:F.ip||"",natType:D}}catch(F){return console.error("获取NAT类型失败:",F),{address:"",natType:"Unknown"}}};class RoomCalls extends RoomPeer{#e=0;#n;constructor(M){super(M),this.#f(),window.addEventListener("online",()=>this.p2p.reportNetwork())}setLocalStream=(M,B)=>new Promise(async(F,C)=>{try{const D=[];typeof M=="string"?D.push(M):D.push(...M);for(const T of D)this.localStreamsActionMap.set(T,B);if(B){if(M.includes("microphoneCamera_audio")&&M.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):M.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):M.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):M.includes("screenSharing_audio")&&M.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):M.includes("screenSharing_audio")&&!M.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):M.includes("screenSharing_video")&&!M.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),M.includes("screenSharing_audio")){const T=await this.getLocalStream("screenSharing_audio");if(T){const A=T.getTracks();for(const U of A)U.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(M.includes("screenSharing_video")){const T=await this.getLocalStream("screenSharing_video");if(T){const A=T.getTracks();for(const U of A)U.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(D);const i=await this.getLocalStreams(D);if(await this.cwsIns.emitNotify("onLocalStream",{code:200,data:i,desc:"local stream is change."}),this.isInRoom){const T=()=>new Promise(async A=>{const U=this.getOptions(),{userId:j}=U,z={};for(const K of D){const Y=await this.getLocalStream(K);if(Y){z[K]=Mt();const[te]=Y.getTracks();await this.initUserMediaStreamContext(j,K,te)}}await this.replaceSenderStream(D,B),await this.emitNotifyUpdateUsersStreams([{userId:j,updateStreams:z}]),A(!0)});this.asyncQueue.add(T,{describe:"setLocalStream"})}F(i)}catch(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",D),C(D)}});setMediaDeviceKind=(M,B)=>{const F=()=>new Promise(async(C,D)=>{this.setDeviceKind(M,B);const i=await this.getSelfInfo(),{id:T,tracks:A=[],callActionMap:U}=i,j=[],z=async K=>{const Y=this.localStreamsActionMap.get(K),te=A.find(se=>se.mediaType===K),ae=U[K];if(Y){j.push(K),await this.stopLocalStreams([K]);try{await this.initLocalStream(K)}catch(se){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",se),D(se)}}if(te){const se=await this.getLocalStream(K);if(se){const[re]=se.getTracks();if(await this.initUserMediaStreamContext(T,K,re),ae){await this.replaceSenderStream([K],!0);const pe=await this.getUsersId();await this.p2p.replaceSenderStreams(pe,j,!0)}}}{if(j.length!==0){const se=await this.getLocalStreams(j);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:se,desc:"local stream is change."});const re=this.createUserUpdateStreams(j);await this.emitNotifyUpdateUsersStreams([{userId:this.options.userId,updateStreams:re}]),await this.emitNotifyUpdateUsers()}C(!0)}};M==="audioinput"&&await z("microphoneCamera_audio"),M==="videoinput"&&await z("microphoneCamera_video"),M==="audiooutput"&&(await this.changeAudiooutput(),C(!0))});return this.asyncQueue.add(F,{describe:"publish"})};changeScreenSharing=async M=>{const B=await this.getSelfInfo(),{tracks:F=[],callActionMap:C}=B;try{await this.setLocalStream(M,!0);for(const D of M)F.find(T=>T.mediaType===D&&C[D])&&await this.replaceSenderStream([D],!0)}catch(D){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",D)}};earlyConnect=(M=[])=>new Promise(async(B,F)=>{try{this.isEarly=!0,await this.#a(),await this.createSession(),M.length===0&&(M=["microphoneCamera_audio","microphoneCamera_video"]),await this.#s(M),B(!0)}catch(C){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",C),F(C)}});joinRoom=async M=>(this.setOptions(M),await this.#a(),await this.cwsConnected(),new Promise(async(B,F)=>{const D=`${Date.now()}${Q(1e3,9999)}`;this.#n=async()=>{try{this.isInRoom=!0;const{userId:i,callType:T,sdkToken:A,roomId:U,stt:j=!1,lang:z}=this.getOptions(),{input:K="zh",output:Y="zh"}=z||{};this.clearUsers(),await this.cwsIns.sendMessage({sn:Number(D),event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:T,roomId:U,user:{id:i,tracks:[],callAction:0},token:A,stt:j,lang:{input:K,output:Y}},version:2}).then(async te=>{const{code:ae=0,desc:se="服务器繁忙",data:re}=te;if(ae!==200)throw new Error(se);const{roomId:pe="",roomUsers:ke=[]}=re;if(pe!==U)return F("加入的房间不匹配");this.sfuPush=0,this.sfuPull=0,this.p2pPush=0,this.p2pPull=0,this.saveBoundBytes("superfluous"),this.initHeartbeat(),this.startGetPeerStats(),this.isEarly===!1&&await this.createSession(),await this.updateUsers(ke);for(const ce of ke){const{id:he}=ce;await this.updateUserBehaviors(he,ce.behavior)}await this.emitNotifyUpdateUsers();const ie=await this.getUsers();B(ie)})}catch(i){F(i)}},this.#n()}));quitRoom=()=>new Promise(async M=>{const B=this.getOptions(),{roomId:F,userId:C}=B;try{if(this.isInRoom===!1)return M(!0);this.isInRoom=!1;const D=async T=>{clearTimeout(T),this.stopHeartbeat(),this.transceiverMap=new Map,this.peerAnalyzeStatsIns?.stop();const A=()=>this.stopSubscribe(),U=()=>this.cwsIns.sendMessage({event:"quitRoom",data:{roomId:F,user:{id:C}}});Promise.all([A(),U()]).finally(()=>()=>this.cwsIns.clearEvents()),this.asyncQueue.clear(),this.clearUserStreams(),this.clearUsers(),this.stopLocalStreams(),this.setRoomState("ready")},i=window.setTimeout(()=>D(i),2*1e3);try{await this.stopPublish(),D(i)}catch{}M(!0)}catch(D){this.reportLogs("quit_room_error",D.message||D)}});quitRoomEx=()=>new Promise(async M=>{const B=this.getOptions(),{roomId:F,userId:C}=B;try{if(this.isInRoom===!1)return M(!0);this.isInRoom=!1;const D=async T=>{clearTimeout(T),this.initHeartbeat(),this.peerAnalyzeStatsIns?.stop();const A=()=>this.stopSubscribe(),U=()=>this.cwsIns.sendMessage({event:"quitRoomEx",data:{roomId:F,user:{id:C}}});Promise.all([A(),U()]).finally(()=>()=>this.cwsIns.clearEvents()),this.asyncQueue.clear(),this.clearUserStreams(),this.stopLocalStreams(),this.clearUsers()},i=window.setTimeout(()=>D(i),2*1e3);try{await this.stopLocalStreams(),D(i)}catch{this.restoreICE()}M(!0)}catch(D){this.reportLogs("quit_room_error",D.message||D)}});syncRoomInfo=()=>new Promise(async(M,B)=>{try{const F=this.getOptions(),{userId:C}=F,D=await this.getUser(C),{id:i=C,callAction:T=0}=D;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:i,callAction:T}}}).then(async A=>{const{code:U=0,desc:j,data:z={}}=A;if(U!==200)throw new Error(j);const{isActive:K=!1,users:Y=[]}=z;if(K===!1)throw new Error("Do not stay in this room.");if(Y.find(ae=>ae.id===C)===!1)throw new Error("Need to rejoin the room.");this.clearUsers(),await this.updateUsers(Y),await this.updateUsertracks(D.id,D.tracks,!1);{const ae=await this.getUsers();M(ae)}})}catch(F){B(F)}});checkInRoom=()=>new Promise(async M=>{const B=this.getOptions(),{userId:F}=B,C=await this.getUser(F),{id:D=F,callAction:i=0}=C;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:D,callAction:i}}}).then(async T=>{const{code:A=0,desc:U}=T;if(A!==200)throw new Error(U);const j=T.data.users;return T.data?.isActive||j.find(K=>K.id===F)?M(!0):M(!1)}).catch(()=>M(!1))});senderActived=async M=>{const B=()=>{const{quality:F}=this.peerAnalyzeStatsIns?.getNetwork();return F>=2};await this.prResolves.add("senderActived",B,M)};publish=M=>new Promise(async(B,F)=>{try{{const T=await this.getSelfInfo(),{banBehaviorMap:A}=T;let U=!0;for(const j of M)if(A[j]){U=!1;break}if(U===!1)return F("publish is error: prohibited by administrator.")}const C=await this.getSelfInfo();await this.replaceSenderStream(M,!1),await this.#s(M);const D=[];let i=await this.checkLocalStream(M);D.push(...i.valid_mediaTypes);for(const T of i.valid_mediaTypes){const A=await this.getLocalStream(T);if(!A)continue;const[U]=A.getTracks();await this.initUserMediaStreamContext(C.id,T,U)}i.invalid_mediaTypes.length!==0&&await(async()=>{await this.setLocalStream(i.invalid_mediaTypes,!0).then(async()=>{i=await this.checkLocalStream(i.invalid_mediaTypes),D.push(...i.valid_mediaTypes);for(const A of i.valid_mediaTypes){const U=await this.getLocalStream(A);if(!U)continue;const[j]=U.getTracks();await this.initUserMediaStreamContext(C.id,A,j)}if(i.invalid_mediaTypes.includes("screenSharing_audio")&&!i.invalid_mediaTypes.includes("screenSharing_video")){const A=M.findIndex(U=>U==="screenSharing_audio");M.splice(A,1)}})})();{await this.replaceSenderStream(M,!0);const T=await this.getSenderTracks(M);await this.updateUsertracks(C.id,T,!0);const A=await this.getCallAction(C.tracks);await this.#i(A)}{const T=[...this.p2pMap.keys()];await this.p2p.replaceSenderStreams(T,M,!0),await this.p2p.pauseSends(T,M,!0)}{await this.senderActived(3e3),this.#r(M),await this.emitNotifyUpdateUsers();const T=this.createUserUpdateStreams(M);await this.emitNotifyUpdateUsersStreams([{userId:C.id,updateStreams:T}])}B(!0)}catch(C){this.reportLogs("publish_error",C.message||C),F(C)}});stopPublish=(M=[])=>new Promise(async(B,F)=>{try{const C=await this.getSelfInfo();M.length===0&&(M=mediaType_keys),await this.replaceSenderStream(M,!0),await this.removeSenders(M);{const i=C.tracks.filter(T=>M.includes(T.mediaType));await this.#c(i),C.tracks=C.tracks.filter(T=>!M.includes(T.mediaType))}const D=await this.getCallAction(C.tracks);await this.#i(D),await this.setLocalStream(M,!1),await this.p2p.pauseSends([],M,!0),await this.emitNotifyUpdateUsers(),B(!0)}catch(C){this.reportLogs("close_track_error",C.message||C),F(C)}});pauseTracks=async(M,B)=>{const F=()=>new Promise(async C=>{const D=await this.getSelfInfo();if(!D||!D.id)return C(!0);const{tracks:i=[]}=D,T=[...i];for(let U of T){const{mediaType:j}=U;j&&M.includes(j)&&(U.enabled=!B,this.getUserMediaStreamContext(D.id,j)?.pause(B))}{const U=[...this.p2pMap.keys()];await this.p2p.pauseSends(U,M,B)}const A=await this.getCallAction(T);await this.#i(A),await this.emitNotifyUpdateUsers(),C(!0)});return this.asyncQueue.add(F,{describe:"pauseTracks"})};inactiveTracks=async(M,B)=>this.pauseTracks(M,!B);subscribe=(M=[])=>{const B=()=>new Promise(async(F,C)=>{try{M.length===0&&(M=await this.getAllUserMediaTypes()),await this.iceConnected();const D=(A,U=!1)=>new Promise(async j=>{const z=async Y=>{const te=[],ae=[],se=[];let re=0,pe=0;for(const ke of Y){const{id:ie,tracks:ce=[]}=ke;if(re=re+ce.length,!this.checkUserInRoom(ie))continue;const ue=await this.getUser(ie),fe=[],ye=[],oe=[];for(const de of ce){const{code:be=0,mid:_e,type:we}=de,ge=ue.tracks.find(Ee=>Ee.type===we);if(ge)switch(be){case 200:fe.push({...ge,mid:_e});break;case 2026:oe.push({...ge,mid:_e});break;default:ye.push({...ge});break}}fe.length!==0&&(te.push({id:ie,tracks:fe}),pe=pe+fe.length),ye.length!==0&&ae.push({id:ie,tracks:ye}),oe.length!==0&&se.push({id:ie,tracks:oe})}return{expectation_num:re,success_num:pe,success_users:te,fail_users:ae,retry_users:se}},K=async(Y,te="成功",ae=[])=>{const{expectation_num:se,success_num:re,success_users:pe,fail_users:ke,retry_users:ie}=await z(ae);j({code:Y,msg:te,expectation_num:se,success_num:re,success_users:pe,fail_users:ke,retry_users:ie})};try{const Y=await this.createUserTrackByUserMediaTypes(A,{lastRetry:U});if(Y.length===0)return K(200,"成功",[]);const te=await this.cwsIns.sendMessage({event:"subscribe",data:{session:this.sdk_session,users:Y}}),{code:ae=0,desc:se,sn:re="",data:pe={}}=te;if(this.#o(re),ae===2017&&se.includes("renegotiation is expected before pulling or pushing tracks")&&await this.#t(),ae===2026){const ce=[];for(const he of Y)ce.push({...he,code:2026});return await K(ae,se,ce)}if(ae!==200)return await K(ae,se);const{remoteSdp:ke,users:ie=[]}=pe;if(ke){const ce=new RTCSessionDescription({type:"offer",sdp:ke});await this.setRemoteDescription(ce),await this.#t()}await K(200,"成功",ie)}catch(Y){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: error",Y),await K(0,Y.message||Y)}}),i=(A=[])=>new Promise(U=>{this.await_remote_publish_users=A;let j=0;for(const se of A)j=j+se.tracks.length;const z=[],K=Mt(),Y=async()=>{this.cwsIns.removeNotify([K]),this.await_remote_publish_users=[];const se=await D(z);U(se)},te=setTimeout(()=>Y(),30*1e3),ae=async se=>{const{user:re}=se.data,{id:pe,tracks:ke=[],callAction:ie=0}=re;await this.updateUserCallAction(pe,ie),await this.updateUserPermissions(pe,3),await this.updateUsertracks(pe,ke,!0);const ce=[],he=A.find(ye=>ye.id===pe);if(!he)return;for(const ye of he.tracks)for(const oe of ke)oe.type===ye.type&&ce.push(ye.mediaType);const ue=[...new Set(ce)];ue.length!==0&&z.push({userId:pe,mediaTypes:ue});let fe=0;for(const ye of z)fe=fe+ye.mediaTypes.length;fe===j&&(clearTimeout(te),await Y())};this.cwsIns.addNotify({sn:K,event:"onPublish",callback:ae},!0)}),T=async(A=[])=>{let U=0;const j=new Map,z=this.peerIns.getTransceivers();for(const Y of A){const{id:te,tracks:ae=[]}=Y;if(this.checkUserInRoom(te)){await this.updateUsertracks(te,ae,!0);for(const re of ae){const{mid:pe,mediaType:ke}=re;ke==="microphoneCamera_video"&&(await this.getP2PIns(te))?.isActive("microphoneCamera_video")&&(await this.p2p.pauseRecvs([te],["microphoneCamera_video"],!0),await this.p2p.reportP2PConnect("disconnect",{desc:"p2p is close.",pullId:this.options.userId,pushId:te,mediaTypes:["microphoneCamera_video"]})),ke==="screenSharing_video"&&(await this.getP2PIns(te))?.isActive("screenSharing_video")&&(await this.p2p.pauseRecvs([te],["screenSharing_video"],!0),await this.p2p.reportP2PConnect("disconnect",{desc:"p2p is close.",pullId:this.options.userId,pushId:te,mediaTypes:["screenSharing_video"]}));const ie=z.find(he=>he.mid===pe);if(!ie)continue;const{receiver:ce}=ie;if(ce.track){{if(re.origin==="sfu"&&this.removeUserMediaStreamContext(te,ke),re.origin="sfu",re.msid=ce.track.id,await this.initUserMediaStreamContext(te,ke,ce.track),["microphoneCamera_audio","screenSharing_audio"].includes(ke)){const he=new Audio;he.srcObject=this.getUserStream(te,ke),(ke==="microphoneCamera_audio"||ke==="screenSharing_audio")&&this.getUserAudioMediaStreamContext(te,ke)?.setMute(!1)}{j.has(te)||j.set(te,{userId:te,tracks:[],updateStreams:{}});const ue=j.get(te);ue.tracks.push(re),ue.updateStreams[ke]=Mt()}}U=U+1}}}}const K=[...j.values()];return await this.emitNotifyUpdateUsersStreams(K),await this.emitNotifyUpdateUsers(),U};{let A=await D(M,!1),{expectation_num:U,success_num:j,success_users:z=[],fail_users:K=[]}=A;if(z.length!==0){const Y=await T(z);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${Y}/${j}/${U}`,{actual_num:Y,success_num:j,expectation_num:U})}if(K.length!==0){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ","The first subscription attempt failed completely. It will attempt to subscribe again in 4 seconds."),await new Promise(ke=>setTimeout(()=>ke(!0),4e3));const Y=[];for(const ke of K){const ie=Array.from(ke.tracks,ce=>ce.mediaType);Y.push({userId:ke.id,mediaTypes:ie})}const te=await D(Y,!0);let{expectation_num:ae,success_num:se,success_users:re=[],retry_users:pe=[]}=te;if(re.length!==0){const ke=await T(re);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${ke}/${se}/${ae}`,{actual_num:ke,success_num:se,expectation_num:ae})}if(pe.length!==0){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;","------->quickvo: waiting for the other party to republish before subscribing.");const ie=await kt(()=>i(pe),{message:"Wait for a timeout before publishing. No re-published track received from the other party within 40 seconds.",timeout:40*1e3});let{expectation_num:ce,success_num:he,success_users:ue=[]}=ie;if(ue.length!==0){const fe=await T(ue);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${fe}/${he}/${ce}`,{actual_num:fe,success_num:he,expectation_num:ce})}}}F(!0)}}catch(D){this.reportLogs("subscribe_error",D.message||D),C(D)}});return this.asyncQueue.add(B,{describe:"subscribe"})};#t=()=>new Promise(async(M,B)=>{try{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",compress:!0,data:{sdp:this.getSdp()}}).then(async F=>{const{code:C=0,desc:D,sn:i=""}=F;if(await this.#o(i),C!==200)throw new Error(D);M(F)})}catch(F){B(F)}});stopSubscribe=(M=[])=>new Promise(async(B,F)=>{try{M.length===0&&(M=await this.getAllUserMediaTypes());const C=[],D=[];for(const i of M){const{userId:T,mediaTypes:A}=i,U=await this.getUser(T),{id:j,tracks:z=[]}=U;for(const K of z){const{mediaType:Y,origin:te,msid:ae,mid:se}=K;if(A.includes(Y)){if(te==="sfu"){if(!ae||!se)continue;C.push({...K}),D.push(se)}if(te==="p2p"){const re=await this.getP2PIns(j);re&&(re.analyze_stats_ins.onNetwork=()=>{},await re.pauseRecvs([Y],!0),await this.p2p.reportP2PConnect("disconnect",{desc:"p2p is close.",pullId:this.options.userId,pushId:T,mediaTypes:[Y]}))}K.msid="",K.origin="unknown"}}}C.length!==0&&(await this.stopTransceivers(D),await this.#c(C)),await this.emitNotifyUpdateUsers(),B(!0)}catch(C){this.reportLogs("close_track_error",C.message||C),F(C)}});updateSimulcast=async M=>{this.simulcast=M;const B=await this.getUsers(),F=[];for(const C of B){const{id:D,tracks:i=[]}=C,T=[];for(const A of i){const{mediaType:U}=A;if(["microphoneCamera_video","screenSharing_video"].includes(U)){const j={...A,simulcast:this.simulcast};T.push(j)}}T.length!==0&&F.push({id:D,tracks:T})}return await this.cwsIns.sendMessage({event:"updateSimulcast",data:{session:this.sdk_session,users:F}})};setBanBehaviors=M=>new Promise(async(B,F)=>{try{const C=this.getOptions(),{roomId:D}=C,i=[];for(const T of M){const{id:A,banBehaviors:U}=T,j=Object.keys(U);if(j.length===0)continue;const z=[];for(const Y of j){const te=mediaType_keys.findIndex(re=>re===Y),ae=U[Y],se={type:te,behavior:ae};z.push(se)}const K={id:A,behaviors:z};i.push(K)}await this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:D,users:i}}).then(async T=>{const{code:A=0,desc:U}=T;if(A!==200)return F(U);B(T)})}catch(C){F(C)}});debugger=()=>this.cwsIns.sendMessage({event:"debugger"},!1);ai=()=>this.cwsIns.sendMessage({event:"ai"},!1);shutdown=()=>this.cwsIns.sendMessage({event:"shutdown"},!1);restoreRoom=async()=>{if(this.isInRoom===!1)return;await this.checkInRoom()===!1&&this.#n&&await this.#n(),this.cwsIns.afreshSends()};restoreICE=async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: restore ice."),await this.cwsConnected(),this.initPeer(),this.isEarly?this.earlyConnect():await this.createSession();const M=await this.getUsers();for(const B of M){const{id:F,isSelf:C,callActionMap:D,tracks:i=[]}=B;if(C){for(const A of mediaType_keys)D[A]&&this.historical_publish_mediaTypes.push(A);continue}const T=[];for(const A of i)(A.msid||A.origin==="p2p")&&T.push(A.mediaType);T.length!==0&&this.historical_subscribe_mediaTypes.push({userId:F,mediaTypes:T})}await this.syncRoomInfo(),this.historical_publish_mediaTypes.length!==0&&await this.publish(this.historical_publish_mediaTypes).then(()=>{this.historical_publish_mediaTypes=[]}),this.historical_subscribe_mediaTypes.length!==0&&await this.subscribe(this.historical_subscribe_mediaTypes).then(()=>{this.historical_subscribe_mediaTypes=[]})};initHeartbeat=()=>{this.stopHeartbeat();const M=async()=>{if(this.isInRoom){const F=this.getTrafficUse();this.cwsIns.sendMessage({event:"heartbeat",data:F},!1)}else this.cwsIns.sendMessage({event:"heartbeatEx",data:{}},!1)},B=this.isInRoom?10*1e3:30*1e3;this.#e=window.setInterval(M,B),M()};stopHeartbeat=()=>{clearInterval(this.#e)};#r=async M=>new Promise(async(B,F)=>{try{const C=this.getOptions(),{roomId:D}=C;if(!D)return;const{id:i,tracks:T=[]}=await this.getSelfInfo(),A=T.filter(j=>j.mediaType&&M.includes(j.mediaType));if(A.length===0)return;const U=dt(A,["type","trackName","mid"]);await this.cwsIns.sendMessage({event:"pubNotify",data:{session:this.sdk_session,roomId:D,user:{id:i,tracks:U}}}),B(!0)}catch(C){F(C)}});#o=M=>new Promise(B=>{this.cwsIns.sendMessage({event:"ackMsg",data:{msgId:M}},!1),B(!0)});#i=async M=>new Promise(async(B,F)=>{const C=this.getOptions(),{roomId:D,userId:i}=C,T={roomId:D,user:{id:i,callAction:M}};await this.cwsIns.sendMessage({event:"updateCall",data:T}).then(async A=>{const{code:U=0}=A;if(U!==200)return F(A);await this.updateUserCallAction(i,M),B(M)}).catch(A=>F(A))});setSession=()=>{const M=this.getOptions(),{appid:B,roomId:F,userId:C,earlyId:D}=M;if(!B)throw new Error("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const i={c:B,r:F,p:"web",h:location.hostname,v:this.sdk_service_version};this.isEarly&&this.isInRoom===!1&&(i.r=""),this.isEarly?i.i=D:i.b=C;const T=btoa(encodeURI(JSON.stringify(i)));this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: session",i);const A=`${this.options.url}?s=${T}&t=${Date.now()}`;this.cwsIns.prws.setOptions({url:A})};#a=()=>new Promise(async(M,B)=>{try{if(["connecting","connected"].includes(this.roomState))return M(!0);this.setRoomState("connecting"),this.cwsIns.clearEvents(),this.setSession(),await this.cwsIns.connect(),this.initHeartbeat(),this.setRoomState("connected"),await this.prResolves.emit("cwsConnected"),M(this.cwsIns)}catch(F){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",F),this.reportLogs("ws_c_timeout",F.message||F),B(F)}});cwsConnected=()=>{const M=()=>this.roomState==="connected";return this.prResolves.add("cwsConnected",M)};createSession=async()=>new Promise(async M=>{const B=async()=>{await this.cwsConnected(),this.initPeer(),await this.addSenders();let F;F=await this.cwsIns.sendMessage({event:"connectCF",compress:!0,data:{sdp:this.getSdp()}});const{code:C=0,desc:D,data:i,sn:T=""}=F;if(this.#o(T),C!==200)throw new Error(D);const{remoteSdp:A,session:U=""}=i;this.sdk_session=U,this.debugSdp(A,"createSession"),await this.setRemoteDescription({type:"answer",sdp:A}),await kt(this.iceConnected,{message:"ice connect is timeout.",timeout:1e4}),this.p2p.reportNetwork()};for(;;){try{await B();break}catch(F){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ice connect is error. recreate in 5 seconds.",F)}await new Promise(F=>setTimeout(()=>F(!0),5*1e3))}M(!0)});#s=async M=>{const B=()=>new Promise(async(F,C)=>{try{await this.iceConnected();const D=await this.addSenders(M),i=await this.getSenderTracks(D);if(i.length===0)return F(!0);const T=await this.cwsIns.sendMessage({event:"publish",compress:!0,data:{session:this.sdk_session,sdp:this.getSdp(),tracks:i,callAction:0}}),{code:A=0,desc:U,sn:j="",data:z={}}=T;if(await this.#o(j),A!==200)throw new Error(U);const{remoteSdp:K}=z;await this.setRemoteDescription({type:"answer",sdp:K}),F(!0)}catch(D){await this.removeSenders(M),C(D)}});return this.asyncQueue.add(B,{describe:"createTrack"})};#c=(M=[])=>{const B=()=>new Promise(async(F,C)=>{try{await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",compress:!0,data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:M}}).then(async D=>{const{code:i=0,desc:T,data:A={}}=D;if(i!==200)throw new Error(T);const{remoteSdp:U}=A;await this.setRemoteDescription({type:"answer",sdp:U})}),F(!0)}catch(D){C(D)}});return this.asyncQueue.add(B,{describe:"closeTrack"})};#l=async(M,B,F)=>{for(const C of B){let D;if(!this.checkUserInRoom(M))continue;const T=await this.getUser(M),{tracks:A=[]}=T,U=A.find(j=>j.mediaType===C);if(U){if(F==="sfu"){const{mid:j}=U;D=this.peerIns.getTransceivers().find(Y=>Y.mid===j)?.receiver.track,U.origin="sfu"}F==="p2p"&&(D=(await this.getP2PIns(M))?.getTrack(C),U.origin="p2p"),D&&(await this.initUserMediaStreamContext(M,C,D),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;","------->quickvo: switching to",F,{userId:M,mediaType:C,origin:F,mediaStreamTrack:D}))}}};#u=async(M,B)=>{let F="sfu",C="unknown";const D=await this.getP2PIns(M);if(C=await this.getUserStreamOrigin(M,B),D&&D.isActive(B)){const T=D?.analyze_stats_ins.getAverageQuality();if(T!==0){const{averageQuality:A}=this.getPeerNetwork();T-A>=this.sfuOffsetAverageQuality&&(F="p2p")}}return{current_origin:C,suggest_origin:F}};#f=()=>{{const M=async B=>{let F="";const C=await this.getSelfInfo(),{code:D,data:i}=B;if(D!==200)return;const{sdp:T,sender:A={},tracks:U=[]}=i,{id:j}=A;F=j;{const K=await this.getUsersId();let Y=0;for(const te of K)(await this.getP2PIns(te))?.checkActive()&&(Y+=1);Y>=3&&await this.p2p.reportP2PConnect("ignore",{desc:"P2P connections have reached the maximum limit.",pullId:this.options.userId,pushId:F,mediaTypes:[]})}const z=await this.getP2PIns(F);if(z)try{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${F}]: start connect p2p.`),await z.init(),z.analyze_stats_ins.onNetwork=ie=>{this.p2pPush+=Math.ceil(ie.outboundBytes/1024)};const K=[],Y=[];for(const ie of U){const{type:ce,mid:he,enabled:ue=!1}=ie;if(ce===void 0)continue;const fe=mediaType_keys[ie.type];K.push(fe),Y.push({mediaType:fe,mid:he,enabled:ue})}await z.setOffer({type:"offer",sdp:T}),await z.initSenders(Y),await this.p2p.replaceSenderStreams([F],K,!0),await z.pauseSends(K,!0);const te=await z.createAnswer();this.debugSdp(te.sdp,"p2p.answer");const ae=await z.getSenderTracks(K),se=this.getOptions(),{roomId:re}=se,pe=()=>new Promise(async(ie,ce)=>{try{const he=await this.cwsIns.sendMessage({event:"answer",data:{roomId:re,tracks:ae,sender:{id:C.id,callAction:C.callAction},receiverId:F,sdp:te.sdp}}),{code:ue=0,desc:fe}=he;if(ue!==200)throw new Error(fe);ie(!0)}catch(he){ce(he)}}),ke=()=>new Promise(async(ie,ce)=>{try{const he=await kt(z.getIcecandidates,{message:"await get send candidates is timeout.",timeout:1e4}),ue=Array.from(he,({sdpMid:de,sdpMLineIndex:be,candidate:_e})=>({sdpMid:de,sdpMLineIndex:be,sdp:_e})),fe=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:re,senderId:C.id,receiverId:F,candidates:ue,isSubscribeReceiver:!1}}),{code:ye=0,desc:oe}=fe;if(ye!==200)throw new Error(oe);ie(!0)}catch(he){ce(he)}});await pe(),await new Promise(ie=>setTimeout(()=>ie(!0),1e3)),await ke(),await kt(z.iceConnected,{message:"await ice connect is timeout.",timeout:1e4})}catch(K){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${F}]: connect p2p is error.`,K)}};this.cwsIns.addNotify({event:"onOffer",callback:M},!0)}{const M=async B=>{const{code:F,data:C}=B;if(F!==200)return;const{senderId:D,candidates:i=[],receiverId:T,isSubscribeReceiver:A=!1}=C,U=this.getOptions(),{userId:j}=U;if(A===!1||T!==j)return;const z=await this.getP2PIns(D);if(!z)return;const K=Array.from(i,({sdpMid:Y,sdpMLineIndex:te,sdp:ae})=>({sdpMid:Y,sdpMLineIndex:te,candidate:ae}));await z.addCandidates(K)};this.cwsIns.addNotify({event:"onCandidate",callback:M},!0)}};p2p={open:(M,B)=>new Promise(async(F,C)=>{if(B.length===0)return;if(this.options.useP2P===!1)return C("You have disabled the p2p function on the client side.");const D=this.getOptions(),{roomId:i}=D,T=await this.getSelfInfo(),A=Mt(),U=new Date().getTime(),j=await this.getP2PIns(M);if(!j)return C("illegal user object.");if(!this.checkUserInRoom(M))return C("This user is not in the room.");const{prohibited_mediaTypes:K=[],subscribed_mediaTypes:Y=[]}=await this.checkSubscribed(M,B);K.length!==0&&this.p2p.reportP2PConnect("ignore",{desc:"P2P connections without a subscription relationship are not allowed.",pullId:this.options.userId,pushId:M,mediaTypes:K});try{if(this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${M}]: start connect p2p.`),j.checkActive()===!1&&await j.init(),(await j.initRecvs(Y)).length!==0){const ke=()=>new Promise(async(ue,fe)=>{try{const ye=await j.createOffer();this.debugSdp(ye.sdp,"p2p_offer");const oe=await j.getRecvTracks(Y),de=await this.cwsIns.sendMessage({event:"offer",data:{roomId:i,tracks:oe,sender:{id:T.id,callAction:T.callAction},receiverId:M,sdp:ye.sdp}}),{code:be=0,desc:_e}=de;if(be!==200)throw new Error(_e);ue(!0)}catch(ye){fe(ye)}}),ie=()=>kt(()=>new Promise(fe=>{const ye=async oe=>{const{code:de,data:be}=oe;if(de!==200)return;const{sender:_e,sdp:we,tracks:ge=[]}=be,{id:Ee}=_e;M===Ee&&fe({answer:{type:"answer",sdp:we},tracks:ge})};this.cwsIns.addNotify({event:"onAnswer",callback:ye,sn:`await_answer: ${A}`},!0),ke()}),{message:"await_answer is timeout.",timeout:2e4}),ce=()=>new Promise(async(ue,fe)=>{try{const ye=await kt(j.getIcecandidates,{message:"await get recv candidates is timeout.",timeout:1e4}),oe=Array.from(ye,({sdpMid:we,sdpMLineIndex:ge,candidate:Ee})=>({sdpMid:we,sdpMLineIndex:ge,sdp:Ee})),de=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:i,senderId:T.id,receiverId:M,candidates:oe,isSubscribeReceiver:!0}}),{code:be=0,desc:_e}=de;if(be!==200)throw new Error(_e);ue(!0)}catch(ye){fe(ye)}});kt(()=>new Promise(fe=>{const ye=async oe=>{const{code:de,data:be}=oe;if(de!==200)return;const{candidates:_e=[],isSubscribeReceiver:we=!1}=be;if(we===!1){const ge=Array.from(_e,({sdpMid:Ee,sdpMLineIndex:qe,sdp:Me})=>({sdpMid:Ee,sdpMLineIndex:qe,candidate:Me}));fe(ge)}};this.cwsIns.addNotify({event:"onCandidate",callback:ye,sn:`await_answer_candidates: ${A}`},!0),ce()}),{message:"await_answer_candidates is timeout.",timeout:2e4}).then(ue=>j.addCandidates(ue)).finally(()=>this.cwsIns.removeNotify([`onCandidate: ${A}`]));{const ue=await ie().finally(()=>{this.cwsIns.removeNotify([`onAnswer: ${A}`])}),{answer:fe,tracks:ye=[]}=ue;this.debugSdp(fe.sdp,"p2p.answer"),await j.setAnswer(fe);const oe=[],de=[];for(const be of ye){const{type:_e,mid:we,enabled:ge=!1}=be;if(_e===void 0)continue;const Ee=mediaType_keys[be.type];de.push(Ee),oe.push({mediaType:Ee,mid:we,enabled:ge})}await j.initSenders(oe),await this.p2p.replaceSenderStreams([M],de,!0),await j.pauseSends(de,!0)}}await kt(j.iceConnected,{message:"ice connect is timeout.",timeout:10*1e3}),await kt(j.remoteChannelConnected,{message:"remote_channel connect is timeout.",timeout:10*1e3}),await this.p2p.pauseRecvs([M],Y,!1);const se=`${new Date().getTime()-U}`;await this.p2p.reportP2PConnect("success",{desc:"P2P connection successful.",pullId:this.options.userId,pushId:M,mediaTypes:Y,connectedTime:se}),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${M}]: will compare the quality of P2P and SFU networks in 10 seconds.`);const re={microphoneCamera_video:!0,screenSharing_video:!0},pe=async()=>{const{averageQuality:ke,inboundBytes:ie}=j.analyze_stats_ins.getNetwork();if(this.p2pPull+=Math.ceil(ie/1024),ke!==0)for(const ce of Y){if(re[ce]===!1)continue;const{current_origin:he,suggest_origin:ue}=await this.#u(M,ce);if(he===ue){j.analyze_stats_ins.onNetwork=()=>{};continue}if(ue==="sfu"){if(j.analyze_stats_ins.onNetwork=()=>{},this.hasAsyncTask("subscribe"))continue;const{subscribed_mediaTypes:fe=[]}=await this.checkSubscribed(M,[ce]);if(fe.length===0)continue;await j.pauseRecvs([ce],!0),await this.p2p.reportP2PConnect("poor_network",{desc:`P2P quality is ${ke}.`,pullId:this.options.userId,pushId:M,mediaTypes:[ce]}),this.subscribe([{userId:M,mediaTypes:[ce]}])}if(ue==="p2p"&&re[ce]){re[ce]=!1,await this.#l(M,[ce],"p2p"),await this.emitNotifyUpdateUsers();const fe=this.createUserUpdateStreams([ce]);await this.emitNotifyUpdateUsersStreams([{userId:M,updateStreams:fe}]);const oe=(await this.getUser(M)).tracks.filter(de=>[ce].includes(de.mediaType));this.#c(oe)}}};j.analyze_stats_ins.onNetwork=()=>pe(),F(!0)}catch(te){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${M}]: connect p2p is error.`,te),await this.p2p.reportP2PConnect("fail",{desc:te.message||te,pullId:this.options.userId,pushId:M,mediaTypes:Y}),C(te)}}),replaceSenderStreams:async(M,B=[],F)=>{const C=this.getOptions();for(const D of M){const{userId:i}=C,T=await this.getP2PIns(D);if(T)for(const A of B){const U=T.send_transceiver_map.get(A);if(!U||U.direction==="stopped")continue;let j;const{sender:z}=U;F?j=this.getUserStream(i,A).clone():j=this.getPhoneyStreams(A);const[K]=j.getTracks();K&&await z.replaceTrack(K)}}},pauseSends:async(M,B=[],F)=>{for(const C of M){const D=await this.getP2PIns(C);D&&await D.pauseSends(B,F)}},pauseRecvs:async(M,B=[],F)=>{for(const C of M){const D=await this.getP2PIns(C);D&&await D.pauseRecvs(B,F)}await this.p2p.close(M)},reportNetwork:()=>new Promise(async(M,B)=>{try{let F=0;const{address:C,natType:D}=await h();switch(D){case"Symmetric":F=0;break;case"Full Cone":F=1;break;case"Port Restricted Cone":F=2;break;case"Restricted Cone":F=3;break}let i=0;{const T=isMobile(),U=(navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType;T||(["wifi","4g"].includes(U)?i=0:i=2),T&&(["wifi"].includes(U)?i=0:i=2)}await this.cwsConnected(),await this.cwsIns.sendMessage({event:"reportNetwork",data:{nat:F,type:i,ip:C}}),M(!0)}catch(F){B(F)}}),reportP2PConnect:(M,B)=>{let F;switch(M){case"success":F=0;break;case"fail":F=1;break;case"ignore":F=2;break;case"disconnect":F=3;break;case"poor_network":F=4;break}const{mediaTypes:C,...D}=B,i=[];for(const T of C){const A=mediaType_keys.findIndex(U=>U===T);i.push(A)}return this.cwsIns.sendMessage({event:"reportP2PConnectEx",data:{...D,code:F,types:i}})},close:async(M=[])=>{M.length===0&&(M=[...this.p2pMap.keys()]);for(const B of M){const F=await this.getP2PIns(B);!F||!F.peer_ins||F.peer_ins.connectionState!=="connected"||F.checkActive()===!0||(F.destroy(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: p2p.close: ${B}`))}}}}class Room extends RoomCalls{constructor(M){super(M)}}class QuickVO extends Room{#e=new Map;constructor(M){super(M),this.#t(),this.#n()}#n=()=>{{const M=async B=>{const{state:F}=B.data;if(F==="closed"){const{roomId:C,userId:D}=this.getOptions(),i={roomId:C,user:{id:D}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:i}),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}};this.cwsIns.addNotify({event:"onRoomState",callback:M},!0)}{const M=async B=>{const{state:F}=B.data;["closed","failed"].includes(F)&&this.restoreICE()};this.cwsIns.addNotify({event:"onIceState",callback:M},!0)}{const M=async B=>{const{qualities:F=[]}=B.data,[C]=F,{userId:D}=this.getOptions();if(!(C&&C.userId===D&&F.length===1)){for(const i of F){const{userId:T,egress:A,ingress:U}=i;this.checkUserInRoom(T)&&await this.updateUserNetwork(T,{egress:A,ingress:U})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:M},!0)}{const M=async B=>{const F=B.data.user;await this.removeUsers([F.id]),await this.updateUsers([F]),await this.updateUsertracks(F.id,F.track,!1),await this.updateUserBehaviors(F.id,F.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:M},!0)}{const M=async B=>{await this.removeUsers([B.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:M},!0)}{const M=async B=>{const{user:F}=B.data,{id:C,tracks:D=[],callAction:i=0}=F;if(await this.updateUserCallAction(C,i),await this.updateUserPermissions(C,3),await this.updateUsertracks(C,D,!0),this.await_remote_publish_users.length!==0&&this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ignore some user track releases.",this.await_remote_publish_users),this.options.newPublishAutoSubscribe){const T=(K,Y)=>{const te=this.await_remote_publish_users.find(se=>se.id===K);return!(!te||te.tracks.findIndex(se=>se.type===Y)===-1)},A=[];if(!this.checkUserInRoom(C))return;const j=await this.getUser(C);for(const K of j.tracks)for(const Y of D)K.type===Y.type&&T(C,Y.type)===!1&&A.push(Y.mediaType);const z=[...new Set(A)];if(z.length!==0){const K=[{userId:C,mediaTypes:z}];await this.subscribe(K)}}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:M},!0)}{const M=async B=>{const{id:F,tracks:C}=B.data.user,{userId:D}=this.getOptions();if(F===D)return;const i=Array.from(C,j=>j.trackName),T=await this.getUser(F),A=[];for(const j of T.tracks)i.includes(j.trackName)&&A.push(j.mediaType);if(await this.stopSubscribe([{userId:F,mediaTypes:A}]),this.checkUserInRoom(F)){const j=T.tracks.filter(z=>!i.includes(z.trackName));await this.updateUsertracks(F,j,!1),await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onCloseTrack",callback:M},!0)}{const M=async B=>{const{id:F,callAction:C}=B.data.user;this.checkUserInRoom(F)&&(await this.updateUserCallAction(F,C),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:M},!0)}{const M=async B=>{const{roomId:F,remoteUserId:C}=B.data,D=this.getOptions();this.checkUserInRoom(C)&&F===D.roomId&&await this.p2p.close([C])};this.cwsIns.addNotify({event:"onDisconnectedP2P",callback:M},!0)}{const M=async B=>{const{roomId:F,remotePullPeerId:C}=B.data,D=this.getOptions();F===D.roomId&&this.p2p.pauseSends([C],["microphoneCamera_audio","microphoneCamera_video","screenSharing_audio","screenSharing_video"],!1)};this.cwsIns.addNotify({event:"onRemotePeerReady",callback:M},!0)}{const M=async B=>{const{user:F}=B.data,{id:C,permissions:D=1}=F;D===1?await this.removeUsers([C]):D===3&&await this.updateUsers([F]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:M},!0)}{const M=async B=>{const{users:F}=B.data;for(const C of F){const{id:D,behavior:i}=C;await this.updateUserBehaviors(D,i)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:M},!0)}{const M=async B=>{const{roomId:F,pushId:C,types:D=[]}=B.data;if(!this.checkUserInRoom(C)||D.length===0||this.options.roomId!==F)return;await new Promise(T=>setTimeout(()=>T(!0),1e3));const i=[];for(const T of D){const A=mediaType_keys[T];i.push(A)}this.p2p.open(C,i)};this.cwsIns.addNotify({event:"onAttemptP2PEx",callback:M},!0)}{const M=async B=>{const{session:F,sessionIsValid:C=!0,tracks:D=[]}=B.data;if(F!==this.sdk_session||C===!1)return this.restoreICE();const i=[],T=Array.from(D,U=>U.trackName),A=await this.getUserTrackByTrackName(T);for(const U of A)U&&U.mediaType&&i.push(U.mediaType);await this.stopPublish(i),await this.publish(i)};this.cwsIns.addNotify({event:"onTrackInactive",callback:M},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async M=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)};addNotify=M=>this.cwsIns.addNotify(M);#t=()=>{this.cwsIns.prws.checkReconnect=async M=>M.code===1e3?(this.setRoomState("closed"),!1):M.code===4001?(this.setRoomState("closed"),!1):M.code===4002?(this.setRoomState("closed"),!1):M.code===4003?(this.setRoomState("closed"),!1):(this.setSession(),M.code===4010?(this.setRoomState("connecting"),!0):(this.setRoomState("connecting"),!0)),this.cwsIns.prws.onReconnectSuccess=async M=>{this.setRoomState("connected"),await this.restoreRoom(),await this.prResolves.emit("cwsConnected")},this.cwsIns.prws.onReconnectStop=async M=>{this.setRoomState("closed")}};addRequestAnimationFrame=async(M,B)=>{{const C=this.#e.get(M);C&&cancelAnimationFrame(C)}const F=(C=Date.now())=>{B(C);const D=requestAnimationFrame(F);this.#e.set(M,D)};F()};clearRequestAnimationFrame=async(M=[])=>{M.length===0&&(M=[...this.#e.keys()]);const B=[];for(const F of M){const C=this.#e.get(F);C&&(cancelAnimationFrame(C),B.push(C))}return B};destroy=async()=>{this.stopPhoneyStreams(),this.stopLocalStreams(),this.stopGetPeerStats(),this.quitRoom(),this.clearUsers(),this.clearUserStreams(),this.stopHeartbeat(),await new Promise(M=>setTimeout(()=>M(!0),300)),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.cwsIns.close(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK")}}exports.QuickVO=QuickVO,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));