quickvo-sdk-js 0.6.8 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +153 -138
- package/dist/index.umd.cjs +2 -2
- package/dist/room/RoomCalls.d.ts +1 -1
- package/dist/room/RoomMedias.d.ts +6 -2
- package/dist/room/RoomPeer.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(dt,at){typeof exports=="object"&&typeof module<"u"?at(exports):typeof define=="function"&&define.amd?define(["exports"],at):(dt=typeof globalThis<"u"?globalThis:dt||self,at(dt["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var se=Object.defineProperty;var re=dt=>{throw TypeError(dt)};var ae=(dt,at,yt)=>at in dt?se(dt,at,{enumerable:!0,configurable:!0,writable:!0,value:yt}):dt[at]=yt;var Z=(dt,at,yt)=>ae(dt,typeof at!="symbol"?at+"":at,yt),ce=(dt,at,yt)=>at.has(dt)||re("Cannot "+yt);var Q=(dt,at,yt)=>(ce(dt,at,"read from private field"),yt?yt.call(dt):at.get(dt)),lt=(dt,at,yt)=>at.has(dt)?re("Cannot add the same private member more than once"):at instanceof WeakSet?at.add(dt):at.set(dt,yt),gt=(dt,at,yt,kt)=>(ce(dt,at,"write to private field"),kt?kt.call(dt,yt):at.set(dt,yt),yt);var dt,at,yt,kt,vt,Ut,Mt,Pt,Lt,Nt,Bt,jt,Zt,Ft,Rt,wt,bt,St,$t,Ht,zt,Et,Jt,Ot,Wt,At,Kt,Gt,Qt,Vt,xt,qt,Dt,Ct,Tt,Yt,Xt,te,ee;const ot=(u,I={})=>{const a={unit:"B",splitStr:" ",...I};let{unit:E,splitStr:_}=a;const k=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],e=k.findIndex($=>$===E),n=k.slice(e+1,k.length);let O=u;for(const $ of n)if(E=$,O=O/1024,O<1024)break;return`${O.toFixed(2)}${_}${E}`},L=(u,I=[])=>{const a={...u},E=Object.keys(a);for(const _ of E)I.findIndex(k=>String(k)===_)===-1&&delete a[_];return a},mt=(u,I=[],a=!0)=>{const E=new Map;for(const k of u){const e=[];for(const O of I)e.push(k[O]);const n=`map-${e.join("-")}`;if(!E.has(n)){E.set(n,k);continue}a&&E.set(n,k)}const _=E.entries();return Array.from(_,([k,e])=>e)},ft=(u,I=[])=>{const a=[];for(const E of u){const _=L(E,I);a.push(_)}return a},pt=(u,I="value",a="label")=>{const E=[],_=Object.entries(u);for(const[k,e]of _){const n={[a]:e,[I]:k};E.push(n)}return E},F=(u=0,I=1)=>{const a=Math.max(0,u),E=Math.max(1,I),_=Math.random()*(E-a+1)+a;return parseInt(`${_}`,10)},ht=(u=16,I=16)=>{const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),E=Math.min(a.length,I),_=Date.now().toString(E),k=_.split(""),e=Math.max(4,u-_.length);for(let n=0;n<e;n++){const O=F(0,E-1),$=a[O];k.push($)}return k.join("").toUpperCase()},W=(u,I)=>{try{let a=Number(u);if(isNaN(a)){const E=new Date(`${u}`);if(`${E}`=="Invalid Date")return 0;a=E.getTime()}if(I!==void 0){const E=new Date().getTimezoneOffset();a+=(E+I)*60*1e3}return a}catch(a){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:u,_offset:I,error:a}),0}},v$1=1e3,H=6e4,R$1=36e5,A=864e5,X={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},G=u=>W(u),U=(u,I="YYYY-MM-DD hh:mm:ss",a={})=>{const E={empty_str:"-",...a},{empty_str:_,offset:k}=E,e=W(u,k);if(Number(u)!==0&&e===0)return _;const n=new Date(e),O=`${n.getFullYear()}`,$=`${n.getMonth()+1}`,N=`${n.getDate()}`,D=`${n.getDay()===0?7:n.getDay()}`,q=`${n.getHours()}`,P=`${n.getMinutes()}`,j=`${n.getSeconds()}`,V=`${Math.ceil((e-G(`${O}/01/01 00:00:00`)+1)/864e5)}`,J=`${Math.ceil(((e-G(`${O}/01/01 00:00:00`))/864e5-Number(D))/7)+1}`,z=[{k:"Y+",v:O},{k:"M+",v:$},{k:"D+",v:N},{k:"W+",v:D},{k:"h+",v:q},{k:"m+",v:P},{k:"s+",v:j},{k:"d+",v:V},{k:"w+",v:J}];let Y;for(let{k:et,v:tt}of z)if(Y=new RegExp(`(${et})`).exec(I),Y){const nt=Y[1];let _t=tt.padStart(nt.length,"0");nt.includes("W")&&(_t=X[_t.slice(0,2)]),I=I.replace(nt,_t)}return I},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:{},lib={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var u=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(I){return I.encoding?"rtpmap:%d %s/%s/%s":I.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(I){return I.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(I){return I.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(I){return"extmap:%d"+(I.direction?"/%s":"%v")+(I["encrypt-uri"]?" %s":"%v")+" %s"+(I.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(I){return I.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"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%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(I){var a="candidate:%s %d %s %d %s %d typ %s";return a+=I.raddr!=null?" raddr %s rport %d":"%v%v",a+=I.tcptype!=null?" tcptype %s":"%v",I.generation!=null&&(a+=" generation %d"),a+=I["network-id"]!=null?" network-id %d":"%v",a+=I["network-cost"]!=null?" network-cost %d":"%v",a}},{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(I){var a="ssrc:%d";return I.attribute!=null&&(a+=" %s",I.value!=null&&(a+=":%s")),a}},{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(I){return I.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(I){return I.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(I){return"imageattr:%s %s %s"+(I.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(I){return"simulcast:%s %s"+(I.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(I){return"ts-refclk:%s"+(I.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(I){var a="mediaclk:";return a+=I.id!=null?"id=%s %s":"%v%s",a+=I.mediaClockValue!=null?"=%s":"",a+=I.rateNumerator!=null?" rate=%s":"",a+=I.rateDenominator!=null?"/%s":"",a}},{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(u).forEach(function(I){var a=u[I];a.forEach(function(E){E.reg||(E.reg=/(.*)/),E.format||(E.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(u){var I=function(n){return String(Number(n))===n?Number(n):n},a=function(n,O,$,N){if(N&&!$)O[N]=I(n[1]);else for(var D=0;D<$.length;D+=1)n[D+1]!=null&&(O[$[D]]=I(n[D+1]))},E=function(n,O,$){var N=n.name&&n.names;n.push&&!O[n.push]?O[n.push]=[]:N&&!O[n.name]&&(O[n.name]={});var D=n.push?{}:N?O[n.name]:O;a($.match(n.reg),D,n.names,n.name),n.push&&O[n.push].push(D)},_=requireGrammar(),k=RegExp.prototype.test.bind(/^([a-z])=(.*)/);u.parse=function(n){var O={},$=[],N=O;return n.split(/(\r\n|\r|\n)/).filter(k).forEach(function(D){var q=D[0],P=D.slice(2);q==="m"&&($.push({rtp:[],fmtp:[]}),N=$[$.length-1]);for(var j=0;j<(_[q]||[]).length;j+=1){var V=_[q][j];if(V.reg.test(P))return E(V,N,P)}}),O.media=$,O};var e=function(n,O){var $=O.split(/=(.+)/,2);return $.length===2?n[$[0]]=I($[1]):$.length===1&&O.length>1&&(n[$[0]]=void 0),n};u.parseParams=function(n){return n.split(/;\s?/).reduce(e,{})},u.parseFmtpConfig=u.parseParams,u.parsePayloads=function(n){return n.toString().split(" ").map(Number)},u.parseRemoteCandidates=function(n){for(var O=[],$=n.split(" ").map(I),N=0;N<$.length;N+=3)O.push({component:$[N],ip:$[N+1],port:$[N+2]});return O},u.parseImageAttributes=function(n){return n.split(" ").map(function(O){return O.substring(1,O.length-1).split(",").reduce(e,{})})},u.parseSimulcastStreamList=function(n){return n.split(";").map(function(O){return O.split(",").map(function($){var N,D=!1;return $[0]!=="~"?N=I($):(N=I($.substring(1,$.length)),D=!0),{scid:N,paused:D}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var u=requireGrammar(),I=/%[sdv%]/g,a=function(e){var n=1,O=arguments,$=O.length;return e.replace(I,function(N){if(n>=$)return N;var D=O[n];switch(n+=1,N){case"%%":return"%";case"%s":return String(D);case"%d":return Number(D);case"%v":return""}})},E=function(e,n,O){var $=n.format instanceof Function?n.format(n.push?O:O[n.name]):n.format,N=[e+"="+$];if(n.names)for(var D=0;D<n.names.length;D+=1){var q=n.names[D];n.name?N.push(O[n.name][q]):N.push(O[n.names[D]])}else N.push(O[n.name]);return a.apply(null,N)},_=["v","o","s","i","u","e","p","c","b","t","r","z","a"],k=["i","c","b","a"];return writer$1=function(e,n){n=n||{},e.version==null&&(e.version=0),e.name==null&&(e.name=" "),e.media.forEach(function(D){D.payloads==null&&(D.payloads="")});var O=n.outerOrder||_,$=n.innerOrder||k,N=[];return O.forEach(function(D){u[D].forEach(function(q){q.name in e&&e[q.name]!=null?N.push(E(D,q,e)):q.push in e&&e[q.push]!=null&&e[q.push].forEach(function(P){N.push(E(D,q,P))})})}),e.media.forEach(function(D){N.push(E("m",u.m[0],D)),$.forEach(function(q){u[q].forEach(function(P){P.name in D&&D[P.name]!=null?N.push(E(q,P,D)):P.push in D&&D[P.push]!=null&&D[P.push].forEach(function(j){N.push(E(q,P,j))})})})}),N.join(`\r
|
|
1
|
+
(function(dt,at){typeof exports=="object"&&typeof module<"u"?at(exports):typeof define=="function"&&define.amd?define(["exports"],at):(dt=typeof globalThis<"u"?globalThis:dt||self,at(dt["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var ce=Object.defineProperty;var oe=dt=>{throw TypeError(dt)};var se=(dt,at,yt)=>at in dt?ce(dt,at,{enumerable:!0,configurable:!0,writable:!0,value:yt}):dt[at]=yt;var Z=(dt,at,yt)=>se(dt,typeof at!="symbol"?at+"":at,yt),re=(dt,at,yt)=>at.has(dt)||oe("Cannot "+yt);var Q=(dt,at,yt)=>(re(dt,at,"read from private field"),yt?yt.call(dt):at.get(dt)),ut=(dt,at,yt)=>at.has(dt)?oe("Cannot add the same private member more than once"):at instanceof WeakSet?at.add(dt):at.set(dt,yt),gt=(dt,at,yt,kt)=>(re(dt,at,"write to private field"),kt?kt.call(dt,yt):at.set(dt,yt),yt);var dt,at,yt,kt,vt,Ct,Ut,Mt,Pt,Nt,Lt,Bt,jt,Zt,Rt,wt,bt,St,$t,Ft,Ht,Et,zt,Ot,Jt,Wt,Kt,Gt,Qt,xt,At,qt,Dt,Tt,Vt,Yt,Xt,te;const ot=(u,I={})=>{const a={unit:"B",splitStr:" ",...I};let{unit:E,splitStr:_}=a;const k=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],e=k.findIndex($=>$===E),n=k.slice(e+1,k.length);let O=u;for(const $ of n)if(E=$,O=O/1024,O<1024)break;return`${O.toFixed(2)}${_}${E}`},L=(u,I=[])=>{const a={...u},E=Object.keys(a);for(const _ of E)I.findIndex(k=>String(k)===_)===-1&&delete a[_];return a},mt=(u,I=[],a=!0)=>{const E=new Map;for(const k of u){const e=[];for(const O of I)e.push(k[O]);const n=`map-${e.join("-")}`;if(!E.has(n)){E.set(n,k);continue}a&&E.set(n,k)}const _=E.entries();return Array.from(_,([k,e])=>e)},ft=(u,I=[])=>{const a=[];for(const E of u){const _=L(E,I);a.push(_)}return a},pt=(u,I="value",a="label")=>{const E=[],_=Object.entries(u);for(const[k,e]of _){const n={[a]:e,[I]:k};E.push(n)}return E},F=(u=0,I=1)=>{const a=Math.max(0,u),E=Math.max(1,I),_=Math.random()*(E-a+1)+a;return parseInt(`${_}`,10)},ht=(u=16,I=16)=>{const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),E=Math.min(a.length,I),_=Date.now().toString(E),k=_.split(""),e=Math.max(4,u-_.length);for(let n=0;n<e;n++){const O=F(0,E-1),$=a[O];k.push($)}return k.join("").toUpperCase()},W=(u,I)=>{try{let a=Number(u);if(isNaN(a)){const E=new Date(`${u}`);if(`${E}`=="Invalid Date")return 0;a=E.getTime()}if(I!==void 0){const E=new Date().getTimezoneOffset();a+=(E+I)*60*1e3}return a}catch(a){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:u,_offset:I,error:a}),0}},v$1=1e3,H=6e4,R$1=36e5,A=864e5,X={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},G=u=>W(u),U=(u,I="YYYY-MM-DD hh:mm:ss",a={})=>{const E={empty_str:"-",...a},{empty_str:_,offset:k}=E,e=W(u,k);if(Number(u)!==0&&e===0)return _;const n=new Date(e),O=`${n.getFullYear()}`,$=`${n.getMonth()+1}`,N=`${n.getDate()}`,D=`${n.getDay()===0?7:n.getDay()}`,q=`${n.getHours()}`,P=`${n.getMinutes()}`,j=`${n.getSeconds()}`,V=`${Math.ceil((e-G(`${O}/01/01 00:00:00`)+1)/864e5)}`,J=`${Math.ceil(((e-G(`${O}/01/01 00:00:00`))/864e5-Number(D))/7)+1}`,z=[{k:"Y+",v:O},{k:"M+",v:$},{k:"D+",v:N},{k:"W+",v:D},{k:"h+",v:q},{k:"m+",v:P},{k:"s+",v:j},{k:"d+",v:V},{k:"w+",v:J}];let Y;for(let{k:et,v:tt}of z)if(Y=new RegExp(`(${et})`).exec(I),Y){const nt=Y[1];let _t=tt.padStart(nt.length,"0");nt.includes("W")&&(_t=X[_t.slice(0,2)]),I=I.replace(nt,_t)}return I},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:{},lib={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var u=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(I){return I.encoding?"rtpmap:%d %s/%s/%s":I.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(I){return I.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(I){return I.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(I){return"extmap:%d"+(I.direction?"/%s":"%v")+(I["encrypt-uri"]?" %s":"%v")+" %s"+(I.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(I){return I.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"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%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(I){var a="candidate:%s %d %s %d %s %d typ %s";return a+=I.raddr!=null?" raddr %s rport %d":"%v%v",a+=I.tcptype!=null?" tcptype %s":"%v",I.generation!=null&&(a+=" generation %d"),a+=I["network-id"]!=null?" network-id %d":"%v",a+=I["network-cost"]!=null?" network-cost %d":"%v",a}},{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(I){var a="ssrc:%d";return I.attribute!=null&&(a+=" %s",I.value!=null&&(a+=":%s")),a}},{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(I){return I.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(I){return I.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(I){return"imageattr:%s %s %s"+(I.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(I){return"simulcast:%s %s"+(I.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(I){return"ts-refclk:%s"+(I.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(I){var a="mediaclk:";return a+=I.id!=null?"id=%s %s":"%v%s",a+=I.mediaClockValue!=null?"=%s":"",a+=I.rateNumerator!=null?" rate=%s":"",a+=I.rateDenominator!=null?"/%s":"",a}},{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(u).forEach(function(I){var a=u[I];a.forEach(function(E){E.reg||(E.reg=/(.*)/),E.format||(E.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(u){var I=function(n){return String(Number(n))===n?Number(n):n},a=function(n,O,$,N){if(N&&!$)O[N]=I(n[1]);else for(var D=0;D<$.length;D+=1)n[D+1]!=null&&(O[$[D]]=I(n[D+1]))},E=function(n,O,$){var N=n.name&&n.names;n.push&&!O[n.push]?O[n.push]=[]:N&&!O[n.name]&&(O[n.name]={});var D=n.push?{}:N?O[n.name]:O;a($.match(n.reg),D,n.names,n.name),n.push&&O[n.push].push(D)},_=requireGrammar(),k=RegExp.prototype.test.bind(/^([a-z])=(.*)/);u.parse=function(n){var O={},$=[],N=O;return n.split(/(\r\n|\r|\n)/).filter(k).forEach(function(D){var q=D[0],P=D.slice(2);q==="m"&&($.push({rtp:[],fmtp:[]}),N=$[$.length-1]);for(var j=0;j<(_[q]||[]).length;j+=1){var V=_[q][j];if(V.reg.test(P))return E(V,N,P)}}),O.media=$,O};var e=function(n,O){var $=O.split(/=(.+)/,2);return $.length===2?n[$[0]]=I($[1]):$.length===1&&O.length>1&&(n[$[0]]=void 0),n};u.parseParams=function(n){return n.split(/;\s?/).reduce(e,{})},u.parseFmtpConfig=u.parseParams,u.parsePayloads=function(n){return n.toString().split(" ").map(Number)},u.parseRemoteCandidates=function(n){for(var O=[],$=n.split(" ").map(I),N=0;N<$.length;N+=3)O.push({component:$[N],ip:$[N+1],port:$[N+2]});return O},u.parseImageAttributes=function(n){return n.split(" ").map(function(O){return O.substring(1,O.length-1).split(",").reduce(e,{})})},u.parseSimulcastStreamList=function(n){return n.split(";").map(function(O){return O.split(",").map(function($){var N,D=!1;return $[0]!=="~"?N=I($):(N=I($.substring(1,$.length)),D=!0),{scid:N,paused:D}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var u=requireGrammar(),I=/%[sdv%]/g,a=function(e){var n=1,O=arguments,$=O.length;return e.replace(I,function(N){if(n>=$)return N;var D=O[n];switch(n+=1,N){case"%%":return"%";case"%s":return String(D);case"%d":return Number(D);case"%v":return""}})},E=function(e,n,O){var $=n.format instanceof Function?n.format(n.push?O:O[n.name]):n.format,N=[e+"="+$];if(n.names)for(var D=0;D<n.names.length;D+=1){var q=n.names[D];n.name?N.push(O[n.name][q]):N.push(O[n.names[D]])}else N.push(O[n.name]);return a.apply(null,N)},_=["v","o","s","i","u","e","p","c","b","t","r","z","a"],k=["i","c","b","a"];return writer$1=function(e,n){n=n||{},e.version==null&&(e.version=0),e.name==null&&(e.name=" "),e.media.forEach(function(D){D.payloads==null&&(D.payloads="")});var O=n.outerOrder||_,$=n.innerOrder||k,N=[];return O.forEach(function(D){u[D].forEach(function(q){q.name in e&&e[q.name]!=null?N.push(E(D,q,e)):q.push in e&&e[q.push]!=null&&e[q.push].forEach(function(P){N.push(E(D,q,P))})})}),e.media.forEach(function(D){N.push(E("m",u.m[0],D)),$.forEach(function(q){u[q].forEach(function(P){P.name in D&&D[P.name]!=null?N.push(E(q,P,D)):P.push in D&&D[P.push]!=null&&D[P.push].forEach(function(j){N.push(E(q,P,j))})})})}),N.join(`\r
|
|
2
2
|
`)+`\r
|
|
3
|
-
`},writer$1}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var u=requireParser(),I=requireWriter$1(),a=requireGrammar();return lib.grammar=a,lib.write=I,lib.parse=u.parse,lib.parseParams=u.parseParams,lib.parseFmtpConfig=u.parseFmtpConfig,lib.parsePayloads=u.parsePayloads,lib.parseRemoteCandidates=u.parseRemoteCandidates,lib.parseImageAttributes=u.parseImageAttributes,lib.parseSimulcastStreamList=u.parseSimulcastStreamList,lib}var libExports=requireLib();class AudioMediaContext{constructor(I){Z(this,"options",{autoGainControl:!1,noiseSuppression:!1,echoCancellation:!1});Z(this,"kind","audio");Z(this,"stream",new MediaStream);Z(this,"gain",1);Z(this,"enhanceGain",0);Z(this,"audio",new Audio);Z(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));Z(this,"mediaStreamAudioSourceNode");Z(this,"autoGainNode");Z(this,"biquadFilterNode");Z(this,"delayNode");Z(this,"gainNode");Z(this,"analyserNode");Z(this,"analyserArrayData");Z(this,"stop",()=>{{const I=this.stream.getTracks();for(const a of I)a.stop(),this.stream.removeTrack(a)}});Z(this,"replaceStream",I=>{const a=this.stream.getTracks();for(const _ of a)this.stream.removeTrack(_);const[E]=I.getAudioTracks();E&&this.stream.addTrack(E)});Z(this,"getStream",()=>this.mediaStreamAudioSourceNode.mediaStream);Z(this,"setMute",(I=!0)=>{I?this.gainNode.disconnect(this.audioContext.destination):this.gainNode.connect(this.audioContext.destination)});Z(this,"setGain",()=>{const I=(1+this.enhanceGain)*this.gain;this.gainNode.gain.setValueAtTime(I,this.audioContext.currentTime)});Z(this,"setEnhanceGain",async I=>{let a=Math.max(0,I);a=Math.min(a,1),this.enhanceGain=a,this.setGain()});Z(this,"setVolumeGain",I=>{this.gain=I,this.setGain()});Z(this,"getVolume",()=>{const{analyserNode:I,analyserArrayData:a}=this;I.getByteFrequencyData(a);let E=0;for(let k=0;k<a.length;k++)E+=a[k];return Math.ceil(E/a.length)});Z(this,"setFilter",(I={})=>{this.options={...this.options,...I};const{autoGainControl:a,noiseSuppression:E,echoCancellation:_}=this.options,{mediaStreamAudioSourceNode:k,autoGainNode:e,biquadFilterNode:n,delayNode:O,gainNode:$}=this;let N=k;return a&&N.connect(e),E&&N.connect(n),_&&N.connect(O),N.connect($),I});this.stream.addTrack(I),this.audio.srcObject=this.stream,this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.mediaStreamAudioSourceNode=this.audioContext.createMediaStreamSource(this.stream),this.autoGainNode=this.audioContext.createGain(),this.autoGainNode.gain.setValueAtTime(.8,this.audioContext.currentTime),this.biquadFilterNode=this.audioContext.createBiquadFilter(),this.biquadFilterNode.type="lowpass",this.biquadFilterNode.frequency.value=1e3,this.delayNode=this.audioContext.createDelay(),this.delayNode.delayTime.value=.5,this.gainNode=this.audioContext.createGain(),this.gainNode.gain.setValueAtTime(this.gain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount);const{gainNode:a,analyserNode:E}=this;a.connect(E),this.audioContext.state==="suspended"&&(this.audioContext.resume(),document.addEventListener("click",()=>this.audioContext.resume(),{once:!0})),this.setFilter()}}class VideoMediaContext{constructor(I){Z(this,"kind","video");Z(this,"stream",new MediaStream);Z(this,"stop",()=>{const I=this.stream.getTracks();for(const a of I)a.stop(),this.stream.removeTrack(a)});Z(this,"replaceStream",I=>{const a=this.stream.getTracks();for(const _ of a)this.stream.removeTrack(_);const[E]=I.getVideoTracks();E&&this.stream.addTrack(E)});Z(this,"getStream",()=>this.stream);Z(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(I)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",closed:"已关闭"};pt(enum_roomState);var C=Object.defineProperty,R=u=>{throw TypeError(u)},S=(u,I,a)=>I in u?C(u,I,{enumerable:!0,configurable:!0,writable:!0,value:a}):u[I]=a,l$1=(u,I,a)=>S(u,typeof I!="symbol"?I+"":I,a),v=(u,I,a)=>I.has(u)||R("Cannot "+a),t=(u,I,a)=>(v(u,I,"read from private field"),a?a.call(u):I.get(u)),c$1=(u,I,a)=>I.has(u)?R("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(u):I.set(u,a),i=(u,I,a,E)=>(v(u,I,"write to private field"),I.set(u,a),a),s,r,h$1,p$1,m,f$1,w,x$1,g$1,b$1,B,y$1,T,d$1;class M{constructor(I){c$1(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:a=>!0,onReconnectSuccess:async a=>{},onReconnectStop:async a=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:a=>{}}),l$1(this,"ws"),c$1(this,r,-1),c$1(this,h$1,-1),c$1(this,p$1,0),c$1(this,m,0),c$1(this,f$1,!1),c$1(this,w,a=>{}),l$1(this,"close",async(a=1e3,E="correctly close.")=>{var _;this.ws&&(i(this,f$1,!0),t(this,d$1).call(this),(_=this.ws)==null||_.close(a,E))}),l$1(this,"connect",()=>new Promise(async a=>{i(this,w,a),this.ws=new WebSocket(t(this,s).url),this.ws.binaryType=t(this,s).binaryType,this.ws.onopen=t(this,b$1),this.ws.onmessage=t(this,g$1),this.ws.onerror=t(this,B),this.ws.onclose=t(this,y$1)})),l$1(this,"reconnect",async a=>new Promise(E=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const _=k=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${k}`),t(this,s).onReconnectStop({msg:k}),E(k)};if(t(this,x$1).call(this)===!1)return _("stop reconnect. exceed maxReconnectionTime.");if(t(this,r)!==-1&&t(this,r)===0)return _("stop reconnect. surplusReconnectCount is 0.");if(!t(this,s).checkReconnect(a))return _("stop reconnect. checkReconnect is false.");t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,s).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,r)}`,a),i(this,p$1,setTimeout(async()=>{i(this,r,Math.max(-1,t(this,r)-1)),await this.connect();try{await t(this,s).onReconnectSuccess(this.ws)}catch(k){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",k)}E(!0)},t(this,s).reconnectIntervalTime))})),l$1(this,"sendMessage",async a=>{var E;(!this.ws||this.ws.readyState!==1)&&(t(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready."),t(this,s).sendBeforAutoConnect&&(t(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws connect."),await this.connect())),(E=this.ws)==null||E.send(a)}),c$1(this,x$1,()=>{const a=Date.now();return t(this,h$1)===-1&&i(this,h$1,a+t(this,s).reconnectTime),!(a>t(this,h$1))}),c$1(this,g$1,a=>{const{data:E}=a;t(this,s).onMessage(E)}),c$1(this,b$1,()=>{t(this,s).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is success.",this.ws),i(this,r,t(this,s).reconnectCount),i(this,h$1,-1),t(this,T).call(this),t(this,w).call(this,this.ws)}),c$1(this,B,a=>{t(this,s).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",a)}),c$1(this,y$1,a=>{if(t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${a.code}, permanentClosed is ${t(this,f$1)}.`,a),t(this,d$1).call(this),!t(this,f$1))return this.reconnect(a);this.ws=void 0}),c$1(this,T,()=>{i(this,m,setInterval(()=>{const a=t(this,s).getHeartbeatMsg();a&&this.sendMessage(a)},t(this,s).heartbeatIntervalTime))}),c$1(this,d$1,()=>{clearInterval(t(this,p$1)),clearInterval(t(this,m))}),i(this,s,{...t(this,s),...I}),i(this,r,t(this,s).reconnectCount)}}s=new WeakMap,r=new WeakMap,h$1=new WeakMap,p$1=new WeakMap,m=new WeakMap,f$1=new WeakMap,w=new WeakMap,x$1=new WeakMap,g$1=new WeakMap,b$1=new WeakMap,B=new WeakMap,y$1=new WeakMap,T=new WeakMap,d$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=u;function u(I,a){for(var E=new Array(arguments.length-1),_=0,k=2,e=!0;k<arguments.length;)E[_++]=arguments[k++];return new Promise(function(O,$){E[_]=function(D){if(e)if(e=!1,D)$(D);else{for(var q=new Array(arguments.length-1),P=0;P<q.length;)q[P++]=arguments[P];O.apply(null,q)}};try{I.apply(a||null,E)}catch(N){e&&(e=!1,$(N))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(u){var I=u;I.length=function(n){var O=n.length;if(!O)return 0;for(var $=0;--O%4>1&&n.charAt(O)==="=";)++$;return Math.ceil(n.length*3)/4-$};for(var a=new Array(64),E=new Array(123),_=0;_<64;)E[a[_]=_<26?_+65:_<52?_+71:_<62?_-4:_-59|43]=_++;I.encode=function(n,O,$){for(var N=null,D=[],q=0,P=0,j;O<$;){var V=n[O++];switch(P){case 0:D[q++]=a[V>>2],j=(V&3)<<4,P=1;break;case 1:D[q++]=a[j|V>>4],j=(V&15)<<2,P=2;break;case 2:D[q++]=a[j|V>>6],D[q++]=a[V&63],P=0;break}q>8191&&((N||(N=[])).push(String.fromCharCode.apply(String,D)),q=0)}return P&&(D[q++]=a[j],D[q++]=61,P===1&&(D[q++]=61)),N?(q&&N.push(String.fromCharCode.apply(String,D.slice(0,q))),N.join("")):String.fromCharCode.apply(String,D.slice(0,q))};var k="invalid encoding";I.decode=function(n,O,$){for(var N=$,D=0,q,P=0;P<n.length;){var j=n.charCodeAt(P++);if(j===61&&D>1)break;if((j=E[j])===void 0)throw Error(k);switch(D){case 0:q=j,D=1;break;case 1:O[$++]=q<<2|(j&48)>>4,q=j,D=2;break;case 2:O[$++]=(q&15)<<4|(j&60)>>2,q=j,D=3;break;case 3:O[$++]=(q&3)<<6|j,D=0;break}}if(D===1)throw Error(k);return $-N},I.test=function(n){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(n)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=u;function u(){this._listeners={}}return u.prototype.on=function(a,E,_){return(this._listeners[a]||(this._listeners[a]=[])).push({fn:E,ctx:_||this}),this},u.prototype.off=function(a,E){if(a===void 0)this._listeners={};else if(E===void 0)this._listeners[a]=[];else for(var _=this._listeners[a],k=0;k<_.length;)_[k].fn===E?_.splice(k,1):++k;return this},u.prototype.emit=function(a){var E=this._listeners[a];if(E){for(var _=[],k=1;k<arguments.length;)_.push(arguments[k++]);for(k=0;k<E.length;)E[k].fn.apply(E[k++].ctx,_)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=u(u);function u(k){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),O=n[3]===128;function $(P,j,V){e[0]=P,j[V]=n[0],j[V+1]=n[1],j[V+2]=n[2],j[V+3]=n[3]}function N(P,j,V){e[0]=P,j[V]=n[3],j[V+1]=n[2],j[V+2]=n[1],j[V+3]=n[0]}k.writeFloatLE=O?$:N,k.writeFloatBE=O?N:$;function D(P,j){return n[0]=P[j],n[1]=P[j+1],n[2]=P[j+2],n[3]=P[j+3],e[0]}function q(P,j){return n[3]=P[j],n[2]=P[j+1],n[1]=P[j+2],n[0]=P[j+3],e[0]}k.readFloatLE=O?D:q,k.readFloatBE=O?q:D}():function(){function e(O,$,N,D){var q=$<0?1:0;if(q&&($=-$),$===0)O(1/$>0?0:2147483648,N,D);else if(isNaN($))O(2143289344,N,D);else if($>34028234663852886e22)O((q<<31|2139095040)>>>0,N,D);else if($<11754943508222875e-54)O((q<<31|Math.round($/1401298464324817e-60))>>>0,N,D);else{var P=Math.floor(Math.log($)/Math.LN2),j=Math.round($*Math.pow(2,-P)*8388608)&8388607;O((q<<31|P+127<<23|j)>>>0,N,D)}}k.writeFloatLE=e.bind(null,I),k.writeFloatBE=e.bind(null,a);function n(O,$,N){var D=O($,N),q=(D>>31)*2+1,P=D>>>23&255,j=D&8388607;return P===255?j?NaN:q*(1/0):P===0?q*1401298464324817e-60*j:q*Math.pow(2,P-150)*(j+8388608)}k.readFloatLE=n.bind(null,E),k.readFloatBE=n.bind(null,_)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),O=n[7]===128;function $(P,j,V){e[0]=P,j[V]=n[0],j[V+1]=n[1],j[V+2]=n[2],j[V+3]=n[3],j[V+4]=n[4],j[V+5]=n[5],j[V+6]=n[6],j[V+7]=n[7]}function N(P,j,V){e[0]=P,j[V]=n[7],j[V+1]=n[6],j[V+2]=n[5],j[V+3]=n[4],j[V+4]=n[3],j[V+5]=n[2],j[V+6]=n[1],j[V+7]=n[0]}k.writeDoubleLE=O?$:N,k.writeDoubleBE=O?N:$;function D(P,j){return n[0]=P[j],n[1]=P[j+1],n[2]=P[j+2],n[3]=P[j+3],n[4]=P[j+4],n[5]=P[j+5],n[6]=P[j+6],n[7]=P[j+7],e[0]}function q(P,j){return n[7]=P[j],n[6]=P[j+1],n[5]=P[j+2],n[4]=P[j+3],n[3]=P[j+4],n[2]=P[j+5],n[1]=P[j+6],n[0]=P[j+7],e[0]}k.readDoubleLE=O?D:q,k.readDoubleBE=O?q:D}():function(){function e(O,$,N,D,q,P){var j=D<0?1:0;if(j&&(D=-D),D===0)O(0,q,P+$),O(1/D>0?0:2147483648,q,P+N);else if(isNaN(D))O(0,q,P+$),O(2146959360,q,P+N);else if(D>17976931348623157e292)O(0,q,P+$),O((j<<31|2146435072)>>>0,q,P+N);else{var V;if(D<22250738585072014e-324)V=D/5e-324,O(V>>>0,q,P+$),O((j<<31|V/4294967296)>>>0,q,P+N);else{var J=Math.floor(Math.log(D)/Math.LN2);J===1024&&(J=1023),V=D*Math.pow(2,-J),O(V*4503599627370496>>>0,q,P+$),O((j<<31|J+1023<<20|V*1048576&1048575)>>>0,q,P+N)}}}k.writeDoubleLE=e.bind(null,I,0,4),k.writeDoubleBE=e.bind(null,a,4,0);function n(O,$,N,D,q){var P=O(D,q+$),j=O(D,q+N),V=(j>>31)*2+1,J=j>>>20&2047,z=4294967296*(j&1048575)+P;return J===2047?z?NaN:V*(1/0):J===0?V*5e-324*z:V*Math.pow(2,J-1075)*(z+4503599627370496)}k.readDoubleLE=n.bind(null,E,0,4),k.readDoubleBE=n.bind(null,_,4,0)}(),k}function I(k,e,n){e[n]=k&255,e[n+1]=k>>>8&255,e[n+2]=k>>>16&255,e[n+3]=k>>>24}function a(k,e,n){e[n]=k>>>24,e[n+1]=k>>>16&255,e[n+2]=k>>>8&255,e[n+3]=k&255}function E(k,e){return(k[e]|k[e+1]<<8|k[e+2]<<16|k[e+3]<<24)>>>0}function _(k,e){return(k[e]<<24|k[e+1]<<16|k[e+2]<<8|k[e+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(u){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(u){var I=u;I.length=function(E){for(var _=0,k=0,e=0;e<E.length;++e)k=E.charCodeAt(e),k<128?_+=1:k<2048?_+=2:(k&64512)===55296&&(E.charCodeAt(e+1)&64512)===56320?(++e,_+=4):_+=3;return _},I.read=function(E,_,k){var e=k-_;if(e<1)return"";for(var n=null,O=[],$=0,N;_<k;)N=E[_++],N<128?O[$++]=N:N>191&&N<224?O[$++]=(N&31)<<6|E[_++]&63:N>239&&N<365?(N=((N&7)<<18|(E[_++]&63)<<12|(E[_++]&63)<<6|E[_++]&63)-65536,O[$++]=55296+(N>>10),O[$++]=56320+(N&1023)):O[$++]=(N&15)<<12|(E[_++]&63)<<6|E[_++]&63,$>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,O)),$=0);return n?($&&n.push(String.fromCharCode.apply(String,O.slice(0,$))),n.join("")):String.fromCharCode.apply(String,O.slice(0,$))},I.write=function(E,_,k){for(var e=k,n,O,$=0;$<E.length;++$)n=E.charCodeAt($),n<128?_[k++]=n:n<2048?(_[k++]=n>>6|192,_[k++]=n&63|128):(n&64512)===55296&&((O=E.charCodeAt($+1))&64512)===56320?(n=65536+((n&1023)<<10)+(O&1023),++$,_[k++]=n>>18|240,_[k++]=n>>12&63|128,_[k++]=n>>6&63|128,_[k++]=n&63|128):(_[k++]=n>>12|224,_[k++]=n>>6&63|128,_[k++]=n&63|128);return k-e}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=u;function u(I,a,E){var _=E||8192,k=_>>>1,e=null,n=_;return function($){if($<1||$>k)return I($);n+$>_&&(e=I(_),n=0);var N=a.call(e,n,n+=$);return n&7&&(n=(n|7)+1),N}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=I;var u=requireMinimal$1();function I(k,e){this.lo=k>>>0,this.hi=e>>>0}var a=I.zero=new I(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var E=I.zeroHash="\0\0\0\0\0\0\0\0";I.fromNumber=function(e){if(e===0)return a;var n=e<0;n&&(e=-e);var O=e>>>0,$=(e-O)/4294967296>>>0;return n&&($=~$>>>0,O=~O>>>0,++O>4294967295&&(O=0,++$>4294967295&&($=0))),new I(O,$)},I.from=function(e){if(typeof e=="number")return I.fromNumber(e);if(u.isString(e))if(u.Long)e=u.Long.fromString(e);else return I.fromNumber(parseInt(e,10));return e.low||e.high?new I(e.low>>>0,e.high>>>0):a},I.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var n=~this.lo+1>>>0,O=~this.hi>>>0;return n||(O=O+1>>>0),-(n+O*4294967296)}return this.lo+this.hi*4294967296},I.prototype.toLong=function(e){return u.Long?new u.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var _=String.prototype.charCodeAt;return I.fromHash=function(e){return e===E?a:new I((_.call(e,0)|_.call(e,1)<<8|_.call(e,2)<<16|_.call(e,3)<<24)>>>0,(_.call(e,4)|_.call(e,5)<<8|_.call(e,6)<<16|_.call(e,7)<<24)>>>0)},I.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)},I.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},I.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},I.prototype.length=function(){var e=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,O=this.hi>>>24;return O===0?n===0?e<16384?e<128?1:2:e<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:O<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(u){var I=u;I.asPromise=requireAspromise(),I.base64=requireBase64(),I.EventEmitter=requireEventemitter(),I.float=requireFloat(),I.inquire=requireInquire(),I.utf8=requireUtf8(),I.pool=requirePool(),I.LongBits=requireLongbits(),I.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),I.global=I.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,I.emptyArray=Object.freeze?Object.freeze([]):[],I.emptyObject=Object.freeze?Object.freeze({}):{},I.isInteger=Number.isInteger||function(k){return typeof k=="number"&&isFinite(k)&&Math.floor(k)===k},I.isString=function(k){return typeof k=="string"||k instanceof String},I.isObject=function(k){return k&&typeof k=="object"},I.isset=I.isSet=function(k,e){var n=k[e];return n!=null&&k.hasOwnProperty(e)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},I.Buffer=function(){try{var _=I.inquire("buffer").Buffer;return _.prototype.utf8Write?_:null}catch{return null}}(),I._Buffer_from=null,I._Buffer_allocUnsafe=null,I.newBuffer=function(k){return typeof k=="number"?I.Buffer?I._Buffer_allocUnsafe(k):new I.Array(k):I.Buffer?I._Buffer_from(k):typeof Uint8Array>"u"?k:new Uint8Array(k)},I.Array=typeof Uint8Array<"u"?Uint8Array:Array,I.Long=I.global.dcodeIO&&I.global.dcodeIO.Long||I.global.Long||I.inquire("long"),I.key2Re=/^true|false|0|1$/,I.key32Re=/^-?(?:0|[1-9][0-9]*)$/,I.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,I.longToHash=function(k){return k?I.LongBits.from(k).toHash():I.LongBits.zeroHash},I.longFromHash=function(k,e){var n=I.LongBits.fromHash(k);return I.Long?I.Long.fromBits(n.lo,n.hi,e):n.toNumber(!!e)};function a(_,k,e){for(var n=Object.keys(k),O=0;O<n.length;++O)(_[n[O]]===void 0||!e)&&(_[n[O]]=k[n[O]]);return _}I.merge=a,I.lcFirst=function(k){return k.charAt(0).toLowerCase()+k.substring(1)};function E(_){function k(e,n){if(!(this instanceof k))return new k(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,k):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&a(this,n)}return k.prototype=Object.create(Error.prototype,{constructor:{value:k,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return _},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),k}I.newError=E,I.ProtocolError=E("ProtocolError"),I.oneOfGetter=function(k){for(var e={},n=0;n<k.length;++n)e[k[n]]=1;return function(){for(var O=Object.keys(this),$=O.length-1;$>-1;--$)if(e[O[$]]===1&&this[O[$]]!==void 0&&this[O[$]]!==null)return O[$]}},I.oneOfSetter=function(k){return function(e){for(var n=0;n<k.length;++n)k[n]!==e&&delete this[k[n]]}},I.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},I._configure=function(){var _=I.Buffer;if(!_){I._Buffer_from=I._Buffer_allocUnsafe=null;return}I._Buffer_from=_.from!==Uint8Array.from&&_.from||function(e,n){return new _(e,n)},I._Buffer_allocUnsafe=_.allocUnsafe||function(e){return new _(e)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=O;var u=requireMinimal$1(),I,a=u.LongBits,E=u.base64,_=u.utf8;function k(J,z,Y){this.fn=J,this.len=z,this.next=void 0,this.val=Y}function e(){}function n(J){this.head=J.head,this.tail=J.tail,this.len=J.len,this.next=J.states}function O(){this.len=0,this.head=new k(e,0,0),this.tail=this.head,this.states=null}var $=function(){return u.Buffer?function(){return(O.create=function(){return new I})()}:function(){return new O}};O.create=$(),O.alloc=function(z){return new u.Array(z)},u.Array!==Array&&(O.alloc=u.pool(O.alloc,u.Array.prototype.subarray)),O.prototype._push=function(z,Y,et){return this.tail=this.tail.next=new k(z,Y,et),this.len+=Y,this};function N(J,z,Y){z[Y]=J&255}function D(J,z,Y){for(;J>127;)z[Y++]=J&127|128,J>>>=7;z[Y]=J}function q(J,z){this.len=J,this.next=void 0,this.val=z}q.prototype=Object.create(k.prototype),q.prototype.fn=D,O.prototype.uint32=function(z){return this.len+=(this.tail=this.tail.next=new q((z=z>>>0)<128?1:z<16384?2:z<2097152?3:z<268435456?4:5,z)).len,this},O.prototype.int32=function(z){return z<0?this._push(P,10,a.fromNumber(z)):this.uint32(z)},O.prototype.sint32=function(z){return this.uint32((z<<1^z>>31)>>>0)};function P(J,z,Y){for(;J.hi;)z[Y++]=J.lo&127|128,J.lo=(J.lo>>>7|J.hi<<25)>>>0,J.hi>>>=7;for(;J.lo>127;)z[Y++]=J.lo&127|128,J.lo=J.lo>>>7;z[Y++]=J.lo}O.prototype.uint64=function(z){var Y=a.from(z);return this._push(P,Y.length(),Y)},O.prototype.int64=O.prototype.uint64,O.prototype.sint64=function(z){var Y=a.from(z).zzEncode();return this._push(P,Y.length(),Y)},O.prototype.bool=function(z){return this._push(N,1,z?1:0)};function j(J,z,Y){z[Y]=J&255,z[Y+1]=J>>>8&255,z[Y+2]=J>>>16&255,z[Y+3]=J>>>24}O.prototype.fixed32=function(z){return this._push(j,4,z>>>0)},O.prototype.sfixed32=O.prototype.fixed32,O.prototype.fixed64=function(z){var Y=a.from(z);return this._push(j,4,Y.lo)._push(j,4,Y.hi)},O.prototype.sfixed64=O.prototype.fixed64,O.prototype.float=function(z){return this._push(u.float.writeFloatLE,4,z)},O.prototype.double=function(z){return this._push(u.float.writeDoubleLE,8,z)};var V=u.Array.prototype.set?function(z,Y,et){Y.set(z,et)}:function(z,Y,et){for(var tt=0;tt<z.length;++tt)Y[et+tt]=z[tt]};return O.prototype.bytes=function(z){var Y=z.length>>>0;if(!Y)return this._push(N,1,0);if(u.isString(z)){var et=O.alloc(Y=E.length(z));E.decode(z,et,0),z=et}return this.uint32(Y)._push(V,Y,z)},O.prototype.string=function(z){var Y=_.length(z);return Y?this.uint32(Y)._push(_.write,Y,z):this._push(N,1,0)},O.prototype.fork=function(){return this.states=new n(this),this.head=this.tail=new k(e,0,0),this.len=0,this},O.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 k(e,0,0),this.len=0),this},O.prototype.ldelim=function(){var z=this.head,Y=this.tail,et=this.len;return this.reset().uint32(et),et&&(this.tail.next=z.next,this.tail=Y,this.len+=et),this},O.prototype.finish=function(){for(var z=this.head.next,Y=this.constructor.alloc(this.len),et=0;z;)z.fn(z.val,Y,et),et+=z.len,z=z.next;return Y},O._configure=function(J){I=J,O.create=$(),I._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=a;var u=requireWriter();(a.prototype=Object.create(u.prototype)).constructor=a;var I=requireMinimal$1();function a(){u.call(this)}a._configure=function(){a.alloc=I._Buffer_allocUnsafe,a.writeBytesBuffer=I.Buffer&&I.Buffer.prototype instanceof Uint8Array&&I.Buffer.prototype.set.name==="set"?function(k,e,n){e.set(k,n)}:function(k,e,n){if(k.copy)k.copy(e,n,0,k.length);else for(var O=0;O<k.length;)e[n++]=k[O++]}},a.prototype.bytes=function(k){I.isString(k)&&(k=I._Buffer_from(k,"base64"));var e=k.length>>>0;return this.uint32(e),e&&this._push(a.writeBytesBuffer,e,k),this};function E(_,k,e){_.length<40?I.utf8.write(_,k,e):k.utf8Write?k.utf8Write(_,e):k.write(_,e)}return a.prototype.string=function(k){var e=I.Buffer.byteLength(k);return this.uint32(e),e&&this._push(E,e,k),this},a._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=k;var u=requireMinimal$1(),I,a=u.LongBits,E=u.utf8;function _(D,q){return RangeError("index out of range: "+D.pos+" + "+(q||1)+" > "+D.len)}function k(D){this.buf=D,this.pos=0,this.len=D.length}var e=typeof Uint8Array<"u"?function(q){if(q instanceof Uint8Array||Array.isArray(q))return new k(q);throw Error("illegal buffer")}:function(q){if(Array.isArray(q))return new k(q);throw Error("illegal buffer")},n=function(){return u.Buffer?function(P){return(k.create=function(V){return u.Buffer.isBuffer(V)?new I(V):e(V)})(P)}:e};k.create=n(),k.prototype._slice=u.Array.prototype.subarray||u.Array.prototype.slice,k.prototype.uint32=function(){var q=4294967295;return function(){if(q=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(q=(q|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return q;if((this.pos+=5)>this.len)throw this.pos=this.len,_(this,10);return q}}(),k.prototype.int32=function(){return this.uint32()|0},k.prototype.sint32=function(){var q=this.uint32();return q>>>1^-(q&1)|0};function O(){var D=new a(0,0),q=0;if(this.len-this.pos>4){for(;q<4;++q)if(D.lo=(D.lo|(this.buf[this.pos]&127)<<q*7)>>>0,this.buf[this.pos++]<128)return D;if(D.lo=(D.lo|(this.buf[this.pos]&127)<<28)>>>0,D.hi=(D.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return D;q=0}else{for(;q<3;++q){if(this.pos>=this.len)throw _(this);if(D.lo=(D.lo|(this.buf[this.pos]&127)<<q*7)>>>0,this.buf[this.pos++]<128)return D}return D.lo=(D.lo|(this.buf[this.pos++]&127)<<q*7)>>>0,D}if(this.len-this.pos>4){for(;q<5;++q)if(D.hi=(D.hi|(this.buf[this.pos]&127)<<q*7+3)>>>0,this.buf[this.pos++]<128)return D}else for(;q<5;++q){if(this.pos>=this.len)throw _(this);if(D.hi=(D.hi|(this.buf[this.pos]&127)<<q*7+3)>>>0,this.buf[this.pos++]<128)return D}throw Error("invalid varint encoding")}k.prototype.bool=function(){return this.uint32()!==0};function $(D,q){return(D[q-4]|D[q-3]<<8|D[q-2]<<16|D[q-1]<<24)>>>0}k.prototype.fixed32=function(){if(this.pos+4>this.len)throw _(this,4);return $(this.buf,this.pos+=4)},k.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _(this,4);return $(this.buf,this.pos+=4)|0};function N(){if(this.pos+8>this.len)throw _(this,8);return new a($(this.buf,this.pos+=4),$(this.buf,this.pos+=4))}return k.prototype.float=function(){if(this.pos+4>this.len)throw _(this,4);var q=u.float.readFloatLE(this.buf,this.pos);return this.pos+=4,q},k.prototype.double=function(){if(this.pos+8>this.len)throw _(this,4);var q=u.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,q},k.prototype.bytes=function(){var q=this.uint32(),P=this.pos,j=this.pos+q;if(j>this.len)throw _(this,q);if(this.pos+=q,Array.isArray(this.buf))return this.buf.slice(P,j);if(P===j){var V=u.Buffer;return V?V.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,P,j)},k.prototype.string=function(){var q=this.bytes();return E.read(q,0,q.length)},k.prototype.skip=function(q){if(typeof q=="number"){if(this.pos+q>this.len)throw _(this,q);this.pos+=q}else do if(this.pos>=this.len)throw _(this);while(this.buf[this.pos++]&128);return this},k.prototype.skipType=function(D){switch(D){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(D=this.uint32()&7)!==4;)this.skipType(D);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+D+" at offset "+this.pos)}return this},k._configure=function(D){I=D,k.create=n(),I._configure();var q=u.Long?"toLong":"toNumber";u.merge(k.prototype,{int64:function(){return O.call(this)[q](!1)},uint64:function(){return O.call(this)[q](!0)},sint64:function(){return O.call(this).zzDecode()[q](!1)},fixed64:function(){return N.call(this)[q](!0)},sfixed64:function(){return N.call(this)[q](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=a;var u=requireReader();(a.prototype=Object.create(u.prototype)).constructor=a;var I=requireMinimal$1();function a(E){u.call(this,E)}return a._configure=function(){I.Buffer&&(a.prototype._slice=I.Buffer.prototype.slice)},a.prototype.string=function(){var _=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+_,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+_,this.len))},a._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=I;var u=requireMinimal$1();(I.prototype=Object.create(u.EventEmitter.prototype)).constructor=I;function I(a,E,_){if(typeof a!="function")throw TypeError("rpcImpl must be a function");u.EventEmitter.call(this),this.rpcImpl=a,this.requestDelimited=!!E,this.responseDelimited=!!_}return I.prototype.rpcCall=function a(E,_,k,e,n){if(!e)throw TypeError("request must be specified");var O=this;if(!n)return u.asPromise(a,O,E,_,k,e);if(!O.rpcImpl){setTimeout(function(){n(Error("already ended"))},0);return}try{return O.rpcImpl(E,_[O.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(N,D){if(N)return O.emit("error",N,E),n(N);if(D===null){O.end(!0);return}if(!(D instanceof k))try{D=k[O.responseDelimited?"decodeDelimited":"decode"](D)}catch(q){return O.emit("error",q,E),n(q)}return O.emit("data",D,E),n(null,D)})}catch($){O.emit("error",$,E),setTimeout(function(){n($)},0);return}},I.prototype.end=function(E){return this.rpcImpl&&(E||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(u){var I=u;I.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(u){var I=u;I.build="minimal",I.Writer=requireWriter(),I.BufferWriter=requireWriter_buffer(),I.Reader=requireReader(),I.BufferReader=requireReader_buffer(),I.util=requireMinimal$1(),I.rpc=requireRpc(),I.roots=requireRoots(),I.configure=a;function a(){I.util._configure(),I.Writer._configure(I.BufferWriter),I.Reader._configure(I.BufferReader)}a()}(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 u={};return u.quick=function(){const I={};return I.voice=function(){const a={};return a.proto=function(){const E={};return E.CommonReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.event="",_.prototype.data=$util.newBuffer([]),_.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.version=0,_.prototype.compress=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&n.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&n.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&n.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&n.uint32(40).int64(e.valid),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&n.uint32(48).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&n.uint32(56).bool(e.compress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.event=e.string();break}case 2:{$.data=e.bytes();break}case 3:{$.sn=e.int64();break}case 4:{$.time=e.int64();break}case 5:{$.valid=e.int64();break}case 6:{$.version=e.int32();break}case 7:{$.compress=e.bool();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonReq)return e;let n=new $root.com.quick.voice.proto.CommonReq;return e.event!=null&&(n.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,n.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(n.data=e.data)),e.sn!=null&&($util.Long?(n.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?n.sn=parseInt(e.sn,10):typeof e.sn=="number"?n.sn=e.sn:typeof e.sn=="object"&&(n.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(n.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?n.valid=parseInt(e.valid,10):typeof e.valid=="number"?n.valid=e.valid:typeof e.valid=="object"&&(n.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.version!=null&&(n.version=e.version|0),e.compress!=null&&(n.compress=!!e.compress),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.event="",n.bytes===String?O.data="":(O.data=[],n.bytes!==Array&&(O.data=$util.newBuffer(O.data))),$util.Long){let $=new $util.Long(0,0,!1);O.sn=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.sn=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.valid=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.valid=n.longs===String?"0":0;O.version=0,O.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(O.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(O.data=n.bytes===String?$util.base64.encode(e.data,0,e.data.length):n.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?O.sn=n.longs===String?String(e.sn):e.sn:O.sn=n.longs===String?$util.Long.prototype.toString.call(e.sn):n.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?O.valid=n.longs===String?String(e.valid):e.valid:O.valid=n.longs===String?$util.Long.prototype.toString.call(e.valid):n.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.version!=null&&e.hasOwnProperty("version")&&(O.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(O.compress=e.compress),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonReq"},_}(),E.CommonRsp=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.event="",_.prototype.data=$util.newBuffer([]),_.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.code=0,_.prototype.desc="",_.prototype.version=0,_.prototype.compress=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&n.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&n.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&n.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&n.uint32(40).int64(e.valid),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&n.uint32(48).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&n.uint32(58).string(e.desc),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&n.uint32(64).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&n.uint32(72).bool(e.compress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.event=e.string();break}case 2:{$.data=e.bytes();break}case 3:{$.sn=e.int64();break}case 4:{$.time=e.int64();break}case 5:{$.valid=e.int64();break}case 6:{$.code=e.int32();break}case 7:{$.desc=e.string();break}case 8:{$.version=e.int32();break}case 9:{$.compress=e.bool();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.code!=null&&e.hasOwnProperty("code")&&!$util.isInteger(e.code)?"code: integer expected":e.desc!=null&&e.hasOwnProperty("desc")&&!$util.isString(e.desc)?"desc: string expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonRsp)return e;let n=new $root.com.quick.voice.proto.CommonRsp;return e.event!=null&&(n.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,n.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(n.data=e.data)),e.sn!=null&&($util.Long?(n.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?n.sn=parseInt(e.sn,10):typeof e.sn=="number"?n.sn=e.sn:typeof e.sn=="object"&&(n.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(n.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?n.valid=parseInt(e.valid,10):typeof e.valid=="number"?n.valid=e.valid:typeof e.valid=="object"&&(n.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.code!=null&&(n.code=e.code|0),e.desc!=null&&(n.desc=String(e.desc)),e.version!=null&&(n.version=e.version|0),e.compress!=null&&(n.compress=!!e.compress),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.event="",n.bytes===String?O.data="":(O.data=[],n.bytes!==Array&&(O.data=$util.newBuffer(O.data))),$util.Long){let $=new $util.Long(0,0,!1);O.sn=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.sn=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.valid=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.valid=n.longs===String?"0":0;O.code=0,O.desc="",O.version=0,O.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(O.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(O.data=n.bytes===String?$util.base64.encode(e.data,0,e.data.length):n.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?O.sn=n.longs===String?String(e.sn):e.sn:O.sn=n.longs===String?$util.Long.prototype.toString.call(e.sn):n.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?O.valid=n.longs===String?String(e.valid):e.valid:O.valid=n.longs===String?$util.Long.prototype.toString.call(e.valid):n.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.code!=null&&e.hasOwnProperty("code")&&(O.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(O.desc=e.desc),e.version!=null&&e.hasOwnProperty("version")&&(O.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(O.compress=e.compress),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonRsp"},_}(),E.User=function(){function _(e){if(this.tracks=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.id="",_.prototype.callAction=null,_.prototype.callState=null,_.prototype.joinTime=null,_.prototype.tracks=$util.emptyArray,_.prototype.permissions=null,_.prototype.isPublished=null,_.prototype.behavior=null;let k;return Object.defineProperty(_.prototype,"_callAction",{get:$util.oneOfGetter(k=["callAction"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_callState",{get:$util.oneOfGetter(k=["callState"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_joinTime",{get:$util.oneOfGetter(k=["joinTime"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_permissions",{get:$util.oneOfGetter(k=["permissions"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_isPublished",{get:$util.oneOfGetter(k=["isPublished"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_behavior",{get:$util.oneOfGetter(k=["behavior"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.id!=null&&Object.hasOwnProperty.call(n,"id")&&O.uint32(10).string(n.id),n.callAction!=null&&Object.hasOwnProperty.call(n,"callAction")&&O.uint32(16).int32(n.callAction),n.callState!=null&&Object.hasOwnProperty.call(n,"callState")&&O.uint32(24).int32(n.callState),n.joinTime!=null&&Object.hasOwnProperty.call(n,"joinTime")&&O.uint32(32).int64(n.joinTime),n.tracks!=null&&n.tracks.length)for(let $=0;$<n.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(n.tracks[$],O.uint32(42).fork()).ldelim();return n.permissions!=null&&Object.hasOwnProperty.call(n,"permissions")&&O.uint32(48).int32(n.permissions),n.isPublished!=null&&Object.hasOwnProperty.call(n,"isPublished")&&O.uint32(56).bool(n.isPublished),n.behavior!=null&&Object.hasOwnProperty.call(n,"behavior")&&O.uint32(64).int32(n.behavior),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.User;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.id=n.string();break}case 2:{N.callAction=n.int32();break}case 3:{N.callState=n.int32();break}case 4:{N.joinTime=n.int64();break}case 5:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 6:{N.permissions=n.int32();break}case 7:{N.isPublished=n.bool();break}case 8:{N.behavior=n.int32();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.id!=null&&n.hasOwnProperty("id")&&!$util.isString(n.id))return"id: string expected";if(n.callAction!=null&&n.hasOwnProperty("callAction")&&!$util.isInteger(n.callAction))return"callAction: integer expected";if(n.callState!=null&&n.hasOwnProperty("callState")&&!$util.isInteger(n.callState))return"callState: integer expected";if(n.joinTime!=null&&n.hasOwnProperty("joinTime")&&!$util.isInteger(n.joinTime)&&!(n.joinTime&&$util.isInteger(n.joinTime.low)&&$util.isInteger(n.joinTime.high)))return"joinTime: integer|Long expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let O=0;O<n.tracks.length;++O){let $=$root.com.quick.voice.proto.Track.verify(n.tracks[O]);if($)return"tracks."+$}}return n.permissions!=null&&n.hasOwnProperty("permissions")&&!$util.isInteger(n.permissions)?"permissions: integer expected":n.isPublished!=null&&n.hasOwnProperty("isPublished")&&typeof n.isPublished!="boolean"?"isPublished: boolean expected":n.behavior!=null&&n.hasOwnProperty("behavior")&&!$util.isInteger(n.behavior)?"behavior: integer expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.User)return n;let O=new $root.com.quick.voice.proto.User;if(n.id!=null&&(O.id=String(n.id)),n.callAction!=null&&(O.callAction=n.callAction|0),n.callState!=null&&(O.callState=n.callState|0),n.joinTime!=null&&($util.Long?(O.joinTime=$util.Long.fromValue(n.joinTime)).unsigned=!1:typeof n.joinTime=="string"?O.joinTime=parseInt(n.joinTime,10):typeof n.joinTime=="number"?O.joinTime=n.joinTime:typeof n.joinTime=="object"&&(O.joinTime=new $util.LongBits(n.joinTime.low>>>0,n.joinTime.high>>>0).toNumber())),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");O.tracks=[];for(let $=0;$<n.tracks.length;++$){if(typeof n.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");O.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[$])}}return n.permissions!=null&&(O.permissions=n.permissions|0),n.isPublished!=null&&(O.isPublished=!!n.isPublished),n.behavior!=null&&(O.behavior=n.behavior|0),O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.tracks=[]),O.defaults&&($.id=""),n.id!=null&&n.hasOwnProperty("id")&&($.id=n.id),n.callAction!=null&&n.hasOwnProperty("callAction")&&($.callAction=n.callAction,O.oneofs&&($._callAction="callAction")),n.callState!=null&&n.hasOwnProperty("callState")&&($.callState=n.callState,O.oneofs&&($._callState="callState")),n.joinTime!=null&&n.hasOwnProperty("joinTime")&&(typeof n.joinTime=="number"?$.joinTime=O.longs===String?String(n.joinTime):n.joinTime:$.joinTime=O.longs===String?$util.Long.prototype.toString.call(n.joinTime):O.longs===Number?new $util.LongBits(n.joinTime.low>>>0,n.joinTime.high>>>0).toNumber():n.joinTime,O.oneofs&&($._joinTime="joinTime")),n.tracks&&n.tracks.length){$.tracks=[];for(let N=0;N<n.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(n.tracks[N],O)}return n.permissions!=null&&n.hasOwnProperty("permissions")&&($.permissions=n.permissions,O.oneofs&&($._permissions="permissions")),n.isPublished!=null&&n.hasOwnProperty("isPublished")&&($.isPublished=n.isPublished,O.oneofs&&($._isPublished="isPublished")),n.behavior!=null&&n.hasOwnProperty("behavior")&&($.behavior=n.behavior,O.oneofs&&($._behavior="behavior")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.User"},_}(),E.Login=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.appid="",_.prototype.userId="",_.prototype.sdkToken="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.appid!=null&&Object.hasOwnProperty.call(e,"appid")&&n.uint32(10).string(e.appid),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(18).string(e.userId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&n.uint32(26).string(e.sdkToken),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.Login;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.appid=e.string();break}case 2:{$.userId=e.string();break}case 3:{$.sdkToken=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.appid!=null&&e.hasOwnProperty("appid")&&!$util.isString(e.appid)?"appid: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Login)return e;let n=new $root.com.quick.voice.proto.Login;return e.appid!=null&&(n.appid=String(e.appid)),e.userId!=null&&(n.userId=String(e.userId)),e.sdkToken!=null&&(n.sdkToken=String(e.sdkToken)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.appid="",O.userId="",O.sdkToken=""),e.appid!=null&&e.hasOwnProperty("appid")&&(O.appid=e.appid),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(O.sdkToken=e.sdkToken),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Login"},_}(),E.Track=function(){function _(e){if(e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.mid="",_.prototype.trackName=null,_.prototype.location=null,_.prototype.userId=null,_.prototype.code=null,_.prototype.desc=null,_.prototype.type=null,_.prototype.isValid=null;let k;return Object.defineProperty(_.prototype,"_trackName",{get:$util.oneOfGetter(k=["trackName"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_location",{get:$util.oneOfGetter(k=["location"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_userId",{get:$util.oneOfGetter(k=["userId"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_type",{get:$util.oneOfGetter(k=["type"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_isValid",{get:$util.oneOfGetter(k=["isValid"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){return O||(O=$Writer.create()),n.mid!=null&&Object.hasOwnProperty.call(n,"mid")&&O.uint32(10).string(n.mid),n.trackName!=null&&Object.hasOwnProperty.call(n,"trackName")&&O.uint32(18).string(n.trackName),n.location!=null&&Object.hasOwnProperty.call(n,"location")&&O.uint32(26).string(n.location),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&O.uint32(34).string(n.userId),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&O.uint32(40).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&O.uint32(50).string(n.desc),n.type!=null&&Object.hasOwnProperty.call(n,"type")&&O.uint32(56).int32(n.type),n.isValid!=null&&Object.hasOwnProperty.call(n,"isValid")&&O.uint32(64).bool(n.isValid),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.Track;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.mid=n.string();break}case 2:{N.trackName=n.string();break}case 3:{N.location=n.string();break}case 4:{N.userId=n.string();break}case 5:{N.code=n.int32();break}case 6:{N.desc=n.string();break}case 7:{N.type=n.int32();break}case 8:{N.isValid=n.bool();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.mid!=null&&n.hasOwnProperty("mid")&&!$util.isString(n.mid))return"mid: string expected";if(n.trackName!=null&&n.hasOwnProperty("trackName")&&!$util.isString(n.trackName))return"trackName: string expected";if(n.location!=null&&n.hasOwnProperty("location")&&!$util.isString(n.location))return"location: string expected";if(n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId))return"userId: string expected";if(n.code!=null&&n.hasOwnProperty("code")&&!$util.isInteger(n.code))return"code: integer expected";if(n.desc!=null&&n.hasOwnProperty("desc")&&!$util.isString(n.desc))return"desc: string expected";if(n.type!=null&&n.hasOwnProperty("type"))switch(n.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return n.isValid!=null&&n.hasOwnProperty("isValid")&&typeof n.isValid!="boolean"?"isValid: boolean expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.Track)return n;let O=new $root.com.quick.voice.proto.Track;switch(n.mid!=null&&(O.mid=String(n.mid)),n.trackName!=null&&(O.trackName=String(n.trackName)),n.location!=null&&(O.location=String(n.location)),n.userId!=null&&(O.userId=String(n.userId)),n.code!=null&&(O.code=n.code|0),n.desc!=null&&(O.desc=String(n.desc)),n.type){default:if(typeof n.type=="number"){O.type=n.type;break}break;case"Microphone":case 0:O.type=0;break;case"Camera":case 1:O.type=1;break;case"Screen":case 2:O.type=2;break;case"SystemVoice":case 3:O.type=3;break}return n.isValid!=null&&(O.isValid=!!n.isValid),O},_.toObject=function(n,O){O||(O={});let $={};return O.defaults&&($.mid=""),n.mid!=null&&n.hasOwnProperty("mid")&&($.mid=n.mid),n.trackName!=null&&n.hasOwnProperty("trackName")&&($.trackName=n.trackName,O.oneofs&&($._trackName="trackName")),n.location!=null&&n.hasOwnProperty("location")&&($.location=n.location,O.oneofs&&($._location="location")),n.userId!=null&&n.hasOwnProperty("userId")&&($.userId=n.userId,O.oneofs&&($._userId="userId")),n.code!=null&&n.hasOwnProperty("code")&&($.code=n.code,O.oneofs&&($._code="code")),n.desc!=null&&n.hasOwnProperty("desc")&&($.desc=n.desc,O.oneofs&&($._desc="desc")),n.type!=null&&n.hasOwnProperty("type")&&($.type=O.enums===String?$root.com.quick.voice.proto.TrackType[n.type]===void 0?n.type:$root.com.quick.voice.proto.TrackType[n.type]:n.type,O.oneofs&&($._type="type")),n.isValid!=null&&n.hasOwnProperty("isValid")&&($.isValid=n.isValid,O.oneofs&&($._isValid="isValid")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.Track"},_}(),E.JoinReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.prototype.callType=0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&n.uint32(24).int32(e.callType),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}case 3:{$.callType=e.int32();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinReq)return e;let n=new $root.com.quick.voice.proto.JoinReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}switch(e.callType){default:if(typeof e.callType=="number"){n.callType=e.callType;break}break;case"Normal":case 0:n.callType=0;break;case"Meeting":case 1:n.callType=1;break;case"Live":case 2:n.callType=2;break}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null,O.callType=n.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),e.callType!=null&&e.hasOwnProperty("callType")&&(O.callType=n.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinReq"},_}(),E.JoinRsp=function(){function _(k){if(this.roomUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.roomUsers=$util.emptyArray,_.prototype.callType=0,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.roomUsers!=null&&e.roomUsers.length)for(let O=0;O<e.roomUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.roomUsers[O],n.uint32(18).fork()).ldelim();return e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&n.uint32(24).int32(e.callType),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.roomUsers&&$.roomUsers.length||($.roomUsers=[]),$.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{$.callType=e.int32();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let n=0;n<e.roomUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.roomUsers[n]);if(O)return"roomUsers."+O}}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinRsp)return e;let n=new $root.com.quick.voice.proto.JoinRsp;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");n.roomUsers=[];for(let O=0;O<e.roomUsers.length;++O){if(typeof e.roomUsers[O]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");n.roomUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[O])}}switch(e.callType){default:if(typeof e.callType=="number"){n.callType=e.callType;break}break;case"Normal":case 0:n.callType=0;break;case"Meeting":case 1:n.callType=1;break;case"Live":case 2:n.callType=2;break}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.roomUsers=[]),n.defaults&&(O.roomId="",O.callType=n.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.roomUsers&&e.roomUsers.length){O.roomUsers=[];for(let $=0;$<e.roomUsers.length;++$)O.roomUsers[$]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[$],n)}return e.callType!=null&&e.hasOwnProperty("callType")&&(O.callType=n.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinRsp"},_}(),E.JoinNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinNotify)return e;let n=new $root.com.quick.voice.proto.JoinNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinNotify"},_}(),E.ConnectCFReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.sdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(10).string(e.sdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.sdp=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFReq)return e;let n=new $root.com.quick.voice.proto.ConnectCFReq;return e.sdp!=null&&(n.sdp=String(e.sdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFReq"},_}(),E.ConnectCFRsp=function(){function _(k){if(this.subscribeUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.subscribeUsers=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.subscribeUsers!=null&&e.subscribeUsers.length)for(let O=0;O<e.subscribeUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.subscribeUsers[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ConnectCFRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.subscribeUsers&&$.subscribeUsers.length||($.subscribeUsers=[]),$.subscribeUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.subscribeUsers!=null&&e.hasOwnProperty("subscribeUsers")){if(!Array.isArray(e.subscribeUsers))return"subscribeUsers: array expected";for(let n=0;n<e.subscribeUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.subscribeUsers[n]);if(O)return"subscribeUsers."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFRsp)return e;let n=new $root.com.quick.voice.proto.ConnectCFRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.subscribeUsers){if(!Array.isArray(e.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");n.subscribeUsers=[];for(let O=0;O<e.subscribeUsers.length;++O){if(typeof e.subscribeUsers[O]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");n.subscribeUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.subscribeUsers[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.subscribeUsers=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.subscribeUsers&&e.subscribeUsers.length){O.subscribeUsers=[];for(let $=0;$<e.subscribeUsers.length;++$)O.subscribeUsers[$]=$root.com.quick.voice.proto.User.toObject(e.subscribeUsers[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFRsp"},_}(),E.PublishReq=function(){function _(e){if(this.tracks=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.sdp="",_.prototype.tracks=$util.emptyArray,_.prototype.callAction=0,_.prototype.recreate=null;let k;return Object.defineProperty(_.prototype,"_recreate",{get:$util.oneOfGetter(k=["recreate"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.sdp!=null&&Object.hasOwnProperty.call(n,"sdp")&&O.uint32(10).string(n.sdp),n.tracks!=null&&n.tracks.length)for(let $=0;$<n.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(n.tracks[$],O.uint32(18).fork()).ldelim();return n.callAction!=null&&Object.hasOwnProperty.call(n,"callAction")&&O.uint32(24).int32(n.callAction),n.recreate!=null&&Object.hasOwnProperty.call(n,"recreate")&&O.uint32(32).bool(n.recreate),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.PublishReq;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.sdp=n.string();break}case 2:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 3:{N.callAction=n.int32();break}case 4:{N.recreate=n.bool();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.sdp!=null&&n.hasOwnProperty("sdp")&&!$util.isString(n.sdp))return"sdp: string expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let O=0;O<n.tracks.length;++O){let $=$root.com.quick.voice.proto.Track.verify(n.tracks[O]);if($)return"tracks."+$}}return n.callAction!=null&&n.hasOwnProperty("callAction")&&!$util.isInteger(n.callAction)?"callAction: integer expected":n.recreate!=null&&n.hasOwnProperty("recreate")&&typeof n.recreate!="boolean"?"recreate: boolean expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PublishReq)return n;let O=new $root.com.quick.voice.proto.PublishReq;if(n.sdp!=null&&(O.sdp=String(n.sdp)),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");O.tracks=[];for(let $=0;$<n.tracks.length;++$){if(typeof n.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");O.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[$])}}return n.callAction!=null&&(O.callAction=n.callAction|0),n.recreate!=null&&(O.recreate=!!n.recreate),O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.tracks=[]),O.defaults&&($.sdp="",$.callAction=0),n.sdp!=null&&n.hasOwnProperty("sdp")&&($.sdp=n.sdp),n.tracks&&n.tracks.length){$.tracks=[];for(let N=0;N<n.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(n.tracks[N],O)}return n.callAction!=null&&n.hasOwnProperty("callAction")&&($.callAction=n.callAction),n.recreate!=null&&n.hasOwnProperty("recreate")&&($.recreate=n.recreate,O.oneofs&&($._recreate="recreate")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PublishReq"},_}(),E.PublishRsp=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PublishRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp)?"remoteSdp: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishRsp)return e;let n=new $root.com.quick.voice.proto.PublishRsp;return e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishRsp"},_}(),E.PublishNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PublishNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishNotify)return e;let n=new $root.com.quick.voice.proto.PublishNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishNotify"},_}(),E.SubscribeReq=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(10).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SubscribeReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeReq)return e;let n=new $root.com.quick.voice.proto.SubscribeReq;if(e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeReq"},_}(),E.SubscribeRsp=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SubscribeRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeRsp)return e;let n=new $root.com.quick.voice.proto.SubscribeRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeRsp"},_}(),E.RenegotiateReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.sdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(18).string(e.sdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.sdp=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RenegotiateReq)return e;let n=new $root.com.quick.voice.proto.RenegotiateReq;return e.userId!=null&&(n.userId=String(e.userId)),e.sdp!=null&&(n.sdp=String(e.sdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.sdp=""),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RenegotiateReq"},_}(),E.QuitReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(18).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.QuitReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.QuitReq)return e;let n=new $root.com.quick.voice.proto.QuitReq;return e.userId!=null&&(n.userId=String(e.userId)),e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.roomId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.QuitReq"},_}(),E.QuitNotify=function(){function _(e){if(e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.roomId="",_.prototype.user=null,_.prototype.code=null,_.prototype.desc=null;let k;return Object.defineProperty(_.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){return O||(O=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&O.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,O.uint32(18).fork()).ldelim(),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&O.uint32(24).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&O.uint32(34).string(n.desc),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.QuitNotify;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.roomId=n.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}case 3:{N.code=n.int32();break}case 4:{N.desc=n.string();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let O=$root.com.quick.voice.proto.User.verify(n.user);if(O)return"user."+O}return n.code!=null&&n.hasOwnProperty("code")&&!$util.isInteger(n.code)?"code: integer expected":n.desc!=null&&n.hasOwnProperty("desc")&&!$util.isString(n.desc)?"desc: string expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.QuitNotify)return n;let O=new $root.com.quick.voice.proto.QuitNotify;if(n.roomId!=null&&(O.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");O.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return n.code!=null&&(O.code=n.code|0),n.desc!=null&&(O.desc=String(n.desc)),O},_.toObject=function(n,O){O||(O={});let $={};return O.defaults&&($.roomId="",$.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&($.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(n.user,O)),n.code!=null&&n.hasOwnProperty("code")&&($.code=n.code,O.oneofs&&($._code="code")),n.desc!=null&&n.hasOwnProperty("desc")&&($.desc=n.desc,O.oneofs&&($._desc="desc")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.QuitNotify"},_}(),E.TokenExpireNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.TokenExpireNotify)return e;let n=new $root.com.quick.voice.proto.TokenExpireNotify;return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.TokenExpireNotify"},_}(),E.UpdateTokenReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.sdkToken="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&n.uint32(18).string(e.sdkToken),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.sdkToken=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTokenReq)return e;let n=new $root.com.quick.voice.proto.UpdateTokenReq;return e.roomId!=null&&(n.roomId=String(e.roomId)),e.sdkToken!=null&&(n.sdkToken=String(e.sdkToken)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.sdkToken=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(O.sdkToken=e.sdkToken),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTokenReq"},_}(),E.NetQualityChange=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.roomId="",_.prototype.egress=0,_.prototype.ingress=0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(18).string(e.roomId),e.egress!=null&&Object.hasOwnProperty.call(e,"egress")&&n.uint32(24).int32(e.egress),e.ingress!=null&&Object.hasOwnProperty.call(e,"ingress")&&n.uint32(32).int32(e.ingress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.roomId=e.string();break}case 3:{$.egress=e.int32();break}case 4:{$.ingress=e.int32();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.egress!=null&&e.hasOwnProperty("egress")&&!$util.isInteger(e.egress)?"egress: integer expected":e.ingress!=null&&e.hasOwnProperty("ingress")&&!$util.isInteger(e.ingress)?"ingress: integer expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityChange)return e;let n=new $root.com.quick.voice.proto.NetQualityChange;return e.userId!=null&&(n.userId=String(e.userId)),e.roomId!=null&&(n.roomId=String(e.roomId)),e.egress!=null&&(n.egress=e.egress|0),e.ingress!=null&&(n.ingress=e.ingress|0),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.roomId="",O.egress=0,O.ingress=0),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.egress!=null&&e.hasOwnProperty("egress")&&(O.egress=e.egress),e.ingress!=null&&e.hasOwnProperty("ingress")&&(O.ingress=e.ingress),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityChange"},_}(),E.NetQualityNotify=function(){function _(k){if(this.qualities=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.qualities=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.qualities!=null&&e.qualities.length)for(let O=0;O<e.qualities.length;++O)$root.com.quick.voice.proto.NetQualityChange.encode(e.qualities[O],n.uint32(10).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.qualities&&$.qualities.length||($.qualities=[]),$.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.qualities!=null&&e.hasOwnProperty("qualities")){if(!Array.isArray(e.qualities))return"qualities: array expected";for(let n=0;n<e.qualities.length;++n){let O=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[n]);if(O)return"qualities."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityNotify)return e;let n=new $root.com.quick.voice.proto.NetQualityNotify;if(e.qualities){if(!Array.isArray(e.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");n.qualities=[];for(let O=0;O<e.qualities.length;++O){if(typeof e.qualities[O]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");n.qualities[O]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.qualities=[]),e.qualities&&e.qualities.length){O.qualities=[];for(let $=0;$<e.qualities.length;++$)O.qualities[$]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityNotify"},_}(),E.UpdateCall=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateCall)return e;let n=new $root.com.quick.voice.proto.UpdateCall;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateCall"},_}(),E.SyncRoomInfoReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return e;let n=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoReq"},_}(),E.SyncRoomInfoRsp=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.isValid=!1,_.prototype.users=$util.emptyArray,_.prototype.isActive=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.isValid!=null&&Object.hasOwnProperty.call(e,"isValid")&&n.uint32(16).bool(e.isValid),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(26).fork()).ldelim();return e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&n.uint32(32).bool(e.isActive),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.isValid=e.bool();break}case 3:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 4:{$.isActive=e.bool();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.isValid!=null&&e.hasOwnProperty("isValid")&&typeof e.isValid!="boolean")return"isValid: boolean expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return e;let n=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.isValid!=null&&(n.isValid=!!e.isValid),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return e.isActive!=null&&(n.isActive=!!e.isActive),n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId="",O.isValid=!1,O.isActive=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.isValid!=null&&e.hasOwnProperty("isValid")&&(O.isValid=e.isValid),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return e.isActive!=null&&e.hasOwnProperty("isActive")&&(O.isActive=e.isActive),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoRsp"},_}(),E.UpdateTime=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(8).int64(e.time),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.time=e.int64();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTime)return e;let n=new $root.com.quick.voice.proto.UpdateTime;return e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults)if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTime"},_}(),E.CloseTrackReq=function(){function _(k){if(this.tracks=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.sdp="",_.prototype.tracks=$util.emptyArray,_.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(10).string(e.sdp),e.tracks!=null&&e.tracks.length)for(let O=0;O<e.tracks.length;++O)$root.com.quick.voice.proto.Track.encode(e.tracks[O],n.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(26).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.sdp=e.string();break}case 2:{$.tracks&&$.tracks.length||($.tracks=[]),$.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp))return"sdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let n=0;n<e.tracks.length;++n){let O=$root.com.quick.voice.proto.Track.verify(e.tracks[n]);if(O)return"tracks."+O}}return e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackReq)return e;let n=new $root.com.quick.voice.proto.CloseTrackReq;if(e.sdp!=null&&(n.sdp=String(e.sdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");n.tracks=[];for(let O=0;O<e.tracks.length;++O){if(typeof e.tracks[O]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");n.tracks[O]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[O])}}return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.tracks=[]),n.defaults&&(O.sdp="",O.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),e.tracks&&e.tracks.length){O.tracks=[];for(let $=0;$<e.tracks.length;++$)O.tracks[$]=$root.com.quick.voice.proto.Track.toObject(e.tracks[$],n)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackReq"},_}(),E.CloseTrackRsp=function(){function _(k){if(this.tracks=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.tracks=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.tracks!=null&&e.tracks.length)for(let O=0;O<e.tracks.length;++O)$root.com.quick.voice.proto.Track.encode(e.tracks[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.tracks&&$.tracks.length||($.tracks=[]),$.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let n=0;n<e.tracks.length;++n){let O=$root.com.quick.voice.proto.Track.verify(e.tracks[n]);if(O)return"tracks."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackRsp)return e;let n=new $root.com.quick.voice.proto.CloseTrackRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");n.tracks=[];for(let O=0;O<e.tracks.length;++O){if(typeof e.tracks[O]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");n.tracks[O]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.tracks=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){O.tracks=[];for(let $=0;$<e.tracks.length;++$)O.tracks[$]=$root.com.quick.voice.proto.Track.toObject(e.tracks[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackRsp"},_}(),E.CloseTrackNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(10).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackNotify)return e;let n=new $root.com.quick.voice.proto.CloseTrackNotify;if(e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.user=null),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackNotify"},_}(),E.ToggleLiveRoomReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return e;let n=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomReq"},_}(),E.ToggleLiveRoomRsq=function(){function _(k){if(this.roomUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.hash="",_.prototype.roomUsers=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.hash!=null&&Object.hasOwnProperty.call(e,"hash")&&n.uint32(18).string(e.hash),e.roomUsers!=null&&e.roomUsers.length)for(let O=0;O<e.roomUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.roomUsers[O],n.uint32(26).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.hash=e.string();break}case 3:{$.roomUsers&&$.roomUsers.length||($.roomUsers=[]),$.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.hash!=null&&e.hasOwnProperty("hash")&&!$util.isString(e.hash))return"hash: string expected";if(e.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let n=0;n<e.roomUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.roomUsers[n]);if(O)return"roomUsers."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return e;let n=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.hash!=null&&(n.hash=String(e.hash)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");n.roomUsers=[];for(let O=0;O<e.roomUsers.length;++O){if(typeof e.roomUsers[O]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");n.roomUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.roomUsers=[]),n.defaults&&(O.roomId="",O.hash=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.hash!=null&&e.hasOwnProperty("hash")&&(O.hash=e.hash),e.roomUsers&&e.roomUsers.length){O.roomUsers=[];for(let $=0;$<e.roomUsers.length;++$)O.roomUsers[$]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomRsq"},_}(),E.TrackType=function(){const _={},k=Object.create(_);return k[_[0]="Microphone"]=0,k[_[1]="Camera"]=1,k[_[2]="Screen"]=2,k[_[3]="SystemVoice"]=3,k}(),E.ReportInfoReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.actionEvent="",_.prototype.userId="",_.prototype.platform="",_.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.actionData="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.actionEvent!=null&&Object.hasOwnProperty.call(e,"actionEvent")&&n.uint32(10).string(e.actionEvent),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(18).string(e.userId),e.platform!=null&&Object.hasOwnProperty.call(e,"platform")&&n.uint32(26).string(e.platform),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.actionData!=null&&Object.hasOwnProperty.call(e,"actionData")&&n.uint32(42).string(e.actionData),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ReportInfoReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.actionEvent=e.string();break}case 2:{$.userId=e.string();break}case 3:{$.platform=e.string();break}case 4:{$.time=e.int64();break}case 5:{$.actionData=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&!$util.isString(e.actionEvent)?"actionEvent: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.platform!=null&&e.hasOwnProperty("platform")&&!$util.isString(e.platform)?"platform: string expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.actionData!=null&&e.hasOwnProperty("actionData")&&!$util.isString(e.actionData)?"actionData: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ReportInfoReq)return e;let n=new $root.com.quick.voice.proto.ReportInfoReq;return e.actionEvent!=null&&(n.actionEvent=String(e.actionEvent)),e.userId!=null&&(n.userId=String(e.userId)),e.platform!=null&&(n.platform=String(e.platform)),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.actionData!=null&&(n.actionData=String(e.actionData)),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.actionEvent="",O.userId="",O.platform="",$util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;O.actionData=""}return e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&(O.actionEvent=e.actionEvent),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.platform!=null&&e.hasOwnProperty("platform")&&(O.platform=e.platform),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.actionData!=null&&e.hasOwnProperty("actionData")&&(O.actionData=e.actionData),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ReportInfoReq"},_}(),E.UpdatePermissions=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdatePermissions)return e;let n=new $root.com.quick.voice.proto.UpdatePermissions;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdatePermissions"},_}(),E.CallType=function(){const _={},k=Object.create(_);return k[_[0]="Normal"]=0,k[_[1]="Meeting"]=1,k[_[2]="Live"]=2,k}(),E.QuitNotifyCode=function(){const _={},k=Object.create(_);return k[_[0]="NormalQuit"]=0,k[_[2021]="Timeout"]=2021,k[_[2011]="TokenExpired"]=2011,k[_[2022]="KickOut"]=2022,k[_[2023]="EndPk"]=2023,k[_[2024]="EndLive"]=2024,k}(),E.UserBehavior=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.type=0,_.prototype.behavior=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&n.uint32(8).int32(e.type),e.behavior!=null&&Object.hasOwnProperty.call(e,"behavior")&&n.uint32(16).bool(e.behavior),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.type=e.int32();break}case 2:{$.behavior=e.bool();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return e.behavior!=null&&e.hasOwnProperty("behavior")&&typeof e.behavior!="boolean"?"behavior: boolean expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserBehavior)return e;let n=new $root.com.quick.voice.proto.UserBehavior;switch(e.type){default:if(typeof e.type=="number"){n.type=e.type;break}break;case"Microphone":case 0:n.type=0;break;case"Camera":case 1:n.type=1;break;case"Screen":case 2:n.type=2;break;case"SystemVoice":case 3:n.type=3;break}return e.behavior!=null&&(n.behavior=!!e.behavior),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.type=n.enums===String?"Microphone":0,O.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(O.type=n.enums===String?$root.com.quick.voice.proto.TrackType[e.type]===void 0?e.type:$root.com.quick.voice.proto.TrackType[e.type]:e.type),e.behavior!=null&&e.hasOwnProperty("behavior")&&(O.behavior=e.behavior),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserBehavior"},_}(),E.PreventUser=function(){function _(k){if(this.behaviors=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.id="",_.prototype.behaviors=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),e.behaviors!=null&&e.behaviors.length)for(let O=0;O<e.behaviors.length;++O)$root.com.quick.voice.proto.UserBehavior.encode(e.behaviors[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.id=e.string();break}case 2:{$.behaviors&&$.behaviors.length||($.behaviors=[]),$.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.id!=null&&e.hasOwnProperty("id")&&!$util.isString(e.id))return"id: string expected";if(e.behaviors!=null&&e.hasOwnProperty("behaviors")){if(!Array.isArray(e.behaviors))return"behaviors: array expected";for(let n=0;n<e.behaviors.length;++n){let O=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[n]);if(O)return"behaviors."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUser)return e;let n=new $root.com.quick.voice.proto.PreventUser;if(e.id!=null&&(n.id=String(e.id)),e.behaviors){if(!Array.isArray(e.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");n.behaviors=[];for(let O=0;O<e.behaviors.length;++O){if(typeof e.behaviors[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");n.behaviors[O]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.behaviors=[]),n.defaults&&(O.id=""),e.id!=null&&e.hasOwnProperty("id")&&(O.id=e.id),e.behaviors&&e.behaviors.length){O.behaviors=[];for(let $=0;$<e.behaviors.length;++$)O.behaviors[$]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUser"},_}(),E.PreventUsersBehaviorReq=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.PreventUser.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.PreventUser.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return e;let n=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");n.users[O]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorReq"},_}(),E.PreventUsersBehaviorNotify=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return e;let n=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},_}(),E.AccelerationAreas=function(){const _={},k=Object.create(_);return k[_[0]="chinaMainland"]=0,k[_[1]="global"]=1,k[_[2]="overseas"]=2,k}(),E.CountMethods=function(){const _={},k=Object.create(_);return k[_[0]="flow"]=0,k[_[1]="minutes"]=1,k}(),E.BaseCDNAddress=function(){function _(k){if(this.urlMap={},k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.area=0,_.prototype.countType=0,_.prototype.urlMap=$util.emptyObject,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.area!=null&&Object.hasOwnProperty.call(e,"area")&&n.uint32(8).int32(e.area),e.countType!=null&&Object.hasOwnProperty.call(e,"countType")&&n.uint32(16).int32(e.countType),e.urlMap!=null&&Object.hasOwnProperty.call(e,"urlMap"))for(let O=Object.keys(e.urlMap),$=0;$<O.length;++$)n.uint32(26).fork().uint32(10).string(O[$]).uint32(18).string(e.urlMap[O[$]]).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.BaseCDNAddress,N,D;for(;e.pos<O;){let q=e.uint32();switch(q>>>3){case 1:{$.area=e.int32();break}case 2:{$.countType=e.int32();break}case 3:{$.urlMap===$util.emptyObject&&($.urlMap={});let P=e.uint32()+e.pos;for(N="",D="";e.pos<P;){let j=e.uint32();switch(j>>>3){case 1:N=e.string();break;case 2:D=e.string();break;default:e.skipType(j&7);break}}$.urlMap[N]=D;break}default:e.skipType(q&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.area!=null&&e.hasOwnProperty("area"))switch(e.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(e.countType!=null&&e.hasOwnProperty("countType"))switch(e.countType){default:return"countType: enum value expected";case 0:case 1:break}if(e.urlMap!=null&&e.hasOwnProperty("urlMap")){if(!$util.isObject(e.urlMap))return"urlMap: object expected";let n=Object.keys(e.urlMap);for(let O=0;O<n.length;++O)if(!$util.isString(e.urlMap[n[O]]))return"urlMap: string{k:string} expected"}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.BaseCDNAddress)return e;let n=new $root.com.quick.voice.proto.BaseCDNAddress;switch(e.area){default:if(typeof e.area=="number"){n.area=e.area;break}break;case"chinaMainland":case 0:n.area=0;break;case"global":case 1:n.area=1;break;case"overseas":case 2:n.area=2;break}switch(e.countType){default:if(typeof e.countType=="number"){n.countType=e.countType;break}break;case"flow":case 0:n.countType=0;break;case"minutes":case 1:n.countType=1;break}if(e.urlMap){if(typeof e.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");n.urlMap={};for(let O=Object.keys(e.urlMap),$=0;$<O.length;++$)n.urlMap[O[$]]=String(e.urlMap[O[$]])}return n},_.toObject=function(e,n){n||(n={});let O={};(n.objects||n.defaults)&&(O.urlMap={}),n.defaults&&(O.area=n.enums===String?"chinaMainland":0,O.countType=n.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(O.area=n.enums===String?$root.com.quick.voice.proto.AccelerationAreas[e.area]===void 0?e.area:$root.com.quick.voice.proto.AccelerationAreas[e.area]:e.area),e.countType!=null&&e.hasOwnProperty("countType")&&(O.countType=n.enums===String?$root.com.quick.voice.proto.CountMethods[e.countType]===void 0?e.countType:$root.com.quick.voice.proto.CountMethods[e.countType]:e.countType);let $;if(e.urlMap&&($=Object.keys(e.urlMap)).length){O.urlMap={};for(let N=0;N<$.length;++N)O.urlMap[$[N]]=e.urlMap[$[N]]}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.BaseCDNAddress"},_}(),E.CDNPlayAddressNotify=function(){function _(e){if(this.standLines=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.roomId="",_.prototype.m3u8=null,_.prototype.rtmp=null,_.prototype.flv=null,_.prototype.rtmps=null,_.prototype.mainLine=null,_.prototype.standLines=$util.emptyArray;let k;return Object.defineProperty(_.prototype,"_m3u8",{get:$util.oneOfGetter(k=["m3u8"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_rtmp",{get:$util.oneOfGetter(k=["rtmp"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_flv",{get:$util.oneOfGetter(k=["flv"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_rtmps",{get:$util.oneOfGetter(k=["rtmps"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_mainLine",{get:$util.oneOfGetter(k=["mainLine"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&O.uint32(10).string(n.roomId),n.m3u8!=null&&Object.hasOwnProperty.call(n,"m3u8")&&O.uint32(18).string(n.m3u8),n.rtmp!=null&&Object.hasOwnProperty.call(n,"rtmp")&&O.uint32(26).string(n.rtmp),n.flv!=null&&Object.hasOwnProperty.call(n,"flv")&&O.uint32(34).string(n.flv),n.rtmps!=null&&Object.hasOwnProperty.call(n,"rtmps")&&O.uint32(42).string(n.rtmps),n.mainLine!=null&&Object.hasOwnProperty.call(n,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(n.mainLine,O.uint32(50).fork()).ldelim(),n.standLines!=null&&n.standLines.length)for(let $=0;$<n.standLines.length;++$)$root.com.quick.voice.proto.BaseCDNAddress.encode(n.standLines[$],O.uint32(58).fork()).ldelim();return O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.roomId=n.string();break}case 2:{N.m3u8=n.string();break}case 3:{N.rtmp=n.string();break}case 4:{N.flv=n.string();break}case 5:{N.rtmps=n.string();break}case 6:{N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(n,n.uint32());break}case 7:{N.standLines&&N.standLines.length||(N.standLines=[]),N.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(n,n.uint32()));break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.m3u8!=null&&n.hasOwnProperty("m3u8")&&!$util.isString(n.m3u8))return"m3u8: string expected";if(n.rtmp!=null&&n.hasOwnProperty("rtmp")&&!$util.isString(n.rtmp))return"rtmp: string expected";if(n.flv!=null&&n.hasOwnProperty("flv")&&!$util.isString(n.flv))return"flv: string expected";if(n.rtmps!=null&&n.hasOwnProperty("rtmps")&&!$util.isString(n.rtmps))return"rtmps: string expected";if(n.mainLine!=null&&n.hasOwnProperty("mainLine")){let O=$root.com.quick.voice.proto.BaseCDNAddress.verify(n.mainLine);if(O)return"mainLine."+O}if(n.standLines!=null&&n.hasOwnProperty("standLines")){if(!Array.isArray(n.standLines))return"standLines: array expected";for(let O=0;O<n.standLines.length;++O){let $=$root.com.quick.voice.proto.BaseCDNAddress.verify(n.standLines[O]);if($)return"standLines."+$}}return null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return n;let O=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(n.roomId!=null&&(O.roomId=String(n.roomId)),n.m3u8!=null&&(O.m3u8=String(n.m3u8)),n.rtmp!=null&&(O.rtmp=String(n.rtmp)),n.flv!=null&&(O.flv=String(n.flv)),n.rtmps!=null&&(O.rtmps=String(n.rtmps)),n.mainLine!=null){if(typeof n.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");O.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(n.mainLine)}if(n.standLines){if(!Array.isArray(n.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");O.standLines=[];for(let $=0;$<n.standLines.length;++$){if(typeof n.standLines[$]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");O.standLines[$]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(n.standLines[$])}}return O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.standLines=[]),O.defaults&&($.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&($.roomId=n.roomId),n.m3u8!=null&&n.hasOwnProperty("m3u8")&&($.m3u8=n.m3u8,O.oneofs&&($._m3u8="m3u8")),n.rtmp!=null&&n.hasOwnProperty("rtmp")&&($.rtmp=n.rtmp,O.oneofs&&($._rtmp="rtmp")),n.flv!=null&&n.hasOwnProperty("flv")&&($.flv=n.flv,O.oneofs&&($._flv="flv")),n.rtmps!=null&&n.hasOwnProperty("rtmps")&&($.rtmps=n.rtmps,O.oneofs&&($._rtmps="rtmps")),n.mainLine!=null&&n.hasOwnProperty("mainLine")&&($.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(n.mainLine,O),O.oneofs&&($._mainLine="mainLine")),n.standLines&&n.standLines.length){$.standLines=[];for(let N=0;N<n.standLines.length;++N)$.standLines[N]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(n.standLines[N],O)}return $},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CDNPlayAddressNotify"},_}(),E}(),a}(),I}(),u})(),ignoreEvent=["networkQualityChange","onNetQuality"],enum_notifyName={onChangeNetwork:"网络情况变更",healthCheck:"心跳检测",onNetQuality:"网络质量回调",onLogin:"登录回调",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",onRoomState:"房间状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",onUpdatePermissions:"更新推流权限通知",onTokenExpired:"Token已过期",onDestroyRoom:"直播模式房间销毁",destroyRoom:"服务器要求销毁房间",onCDNPlayUrlAdd:"cdn播放地址变化",onDestroy:"SDK销毁"};pt(enum_notifyName);const notifyName_keys=Object.keys(enum_notifyName);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(u){let I=u.length;for(;--I>=0;)u[I]=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(u,I,a,E,_){this.static_tree=u,this.extra_bits=I,this.extra_base=a,this.elems=E,this.max_length=_,this.has_stree=u&&u.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(u,I){this.dyn_tree=u,this.max_code=0,this.stat_desc=I}const d_code=u=>u<256?_dist_code[u]:_dist_code[256+(u>>>7)],put_short=(u,I)=>{u.pending_buf[u.pending++]=I&255,u.pending_buf[u.pending++]=I>>>8&255},send_bits=(u,I,a)=>{u.bi_valid>Buf_size-a?(u.bi_buf|=I<<u.bi_valid&65535,put_short(u,u.bi_buf),u.bi_buf=I>>Buf_size-u.bi_valid,u.bi_valid+=a-Buf_size):(u.bi_buf|=I<<u.bi_valid&65535,u.bi_valid+=a)},send_code=(u,I,a)=>{send_bits(u,a[I*2],a[I*2+1])},bi_reverse=(u,I)=>{let a=0;do a|=u&1,u>>>=1,a<<=1;while(--I>0);return a>>>1},bi_flush=u=>{u.bi_valid===16?(put_short(u,u.bi_buf),u.bi_buf=0,u.bi_valid=0):u.bi_valid>=8&&(u.pending_buf[u.pending++]=u.bi_buf&255,u.bi_buf>>=8,u.bi_valid-=8)},gen_bitlen=(u,I)=>{const a=I.dyn_tree,E=I.max_code,_=I.stat_desc.static_tree,k=I.stat_desc.has_stree,e=I.stat_desc.extra_bits,n=I.stat_desc.extra_base,O=I.stat_desc.max_length;let $,N,D,q,P,j,V=0;for(q=0;q<=MAX_BITS$1;q++)u.bl_count[q]=0;for(a[u.heap[u.heap_max]*2+1]=0,$=u.heap_max+1;$<HEAP_SIZE$1;$++)N=u.heap[$],q=a[a[N*2+1]*2+1]+1,q>O&&(q=O,V++),a[N*2+1]=q,!(N>E)&&(u.bl_count[q]++,P=0,N>=n&&(P=e[N-n]),j=a[N*2],u.opt_len+=j*(q+P),k&&(u.static_len+=j*(_[N*2+1]+P)));if(V!==0){do{for(q=O-1;u.bl_count[q]===0;)q--;u.bl_count[q]--,u.bl_count[q+1]+=2,u.bl_count[O]--,V-=2}while(V>0);for(q=O;q!==0;q--)for(N=u.bl_count[q];N!==0;)D=u.heap[--$],!(D>E)&&(a[D*2+1]!==q&&(u.opt_len+=(q-a[D*2+1])*a[D*2],a[D*2+1]=q),N--)}},gen_codes=(u,I,a)=>{const E=new Array(MAX_BITS$1+1);let _=0,k,e;for(k=1;k<=MAX_BITS$1;k++)_=_+a[k-1]<<1,E[k]=_;for(e=0;e<=I;e++){let n=u[e*2+1];n!==0&&(u[e*2]=bi_reverse(E[n]++,n))}},tr_static_init=()=>{let u,I,a,E,_;const k=new Array(MAX_BITS$1+1);for(a=0,E=0;E<LENGTH_CODES$1-1;E++)for(base_length[E]=a,u=0;u<1<<extra_lbits[E];u++)_length_code[a++]=E;for(_length_code[a-1]=E,_=0,E=0;E<16;E++)for(base_dist[E]=_,u=0;u<1<<extra_dbits[E];u++)_dist_code[_++]=E;for(_>>=7;E<D_CODES$1;E++)for(base_dist[E]=_<<7,u=0;u<1<<extra_dbits[E]-7;u++)_dist_code[256+_++]=E;for(I=0;I<=MAX_BITS$1;I++)k[I]=0;for(u=0;u<=143;)static_ltree[u*2+1]=8,u++,k[8]++;for(;u<=255;)static_ltree[u*2+1]=9,u++,k[9]++;for(;u<=279;)static_ltree[u*2+1]=7,u++,k[7]++;for(;u<=287;)static_ltree[u*2+1]=8,u++,k[8]++;for(gen_codes(static_ltree,L_CODES$1+1,k),u=0;u<D_CODES$1;u++)static_dtree[u*2+1]=5,static_dtree[u*2]=bi_reverse(u,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=u=>{let I;for(I=0;I<L_CODES$1;I++)u.dyn_ltree[I*2]=0;for(I=0;I<D_CODES$1;I++)u.dyn_dtree[I*2]=0;for(I=0;I<BL_CODES$1;I++)u.bl_tree[I*2]=0;u.dyn_ltree[END_BLOCK*2]=1,u.opt_len=u.static_len=0,u.sym_next=u.matches=0},bi_windup=u=>{u.bi_valid>8?put_short(u,u.bi_buf):u.bi_valid>0&&(u.pending_buf[u.pending++]=u.bi_buf),u.bi_buf=0,u.bi_valid=0},smaller=(u,I,a,E)=>{const _=I*2,k=a*2;return u[_]<u[k]||u[_]===u[k]&&E[I]<=E[a]},pqdownheap=(u,I,a)=>{const E=u.heap[a];let _=a<<1;for(;_<=u.heap_len&&(_<u.heap_len&&smaller(I,u.heap[_+1],u.heap[_],u.depth)&&_++,!smaller(I,E,u.heap[_],u.depth));)u.heap[a]=u.heap[_],a=_,_<<=1;u.heap[a]=E},compress_block=(u,I,a)=>{let E,_,k=0,e,n;if(u.sym_next!==0)do E=u.pending_buf[u.sym_buf+k++]&255,E+=(u.pending_buf[u.sym_buf+k++]&255)<<8,_=u.pending_buf[u.sym_buf+k++],E===0?send_code(u,_,I):(e=_length_code[_],send_code(u,e+LITERALS$1+1,I),n=extra_lbits[e],n!==0&&(_-=base_length[e],send_bits(u,_,n)),E--,e=d_code(E),send_code(u,e,a),n=extra_dbits[e],n!==0&&(E-=base_dist[e],send_bits(u,E,n)));while(k<u.sym_next);send_code(u,END_BLOCK,I)},build_tree=(u,I)=>{const a=I.dyn_tree,E=I.stat_desc.static_tree,_=I.stat_desc.has_stree,k=I.stat_desc.elems;let e,n,O=-1,$;for(u.heap_len=0,u.heap_max=HEAP_SIZE$1,e=0;e<k;e++)a[e*2]!==0?(u.heap[++u.heap_len]=O=e,u.depth[e]=0):a[e*2+1]=0;for(;u.heap_len<2;)$=u.heap[++u.heap_len]=O<2?++O:0,a[$*2]=1,u.depth[$]=0,u.opt_len--,_&&(u.static_len-=E[$*2+1]);for(I.max_code=O,e=u.heap_len>>1;e>=1;e--)pqdownheap(u,a,e);$=k;do e=u.heap[1],u.heap[1]=u.heap[u.heap_len--],pqdownheap(u,a,1),n=u.heap[1],u.heap[--u.heap_max]=e,u.heap[--u.heap_max]=n,a[$*2]=a[e*2]+a[n*2],u.depth[$]=(u.depth[e]>=u.depth[n]?u.depth[e]:u.depth[n])+1,a[e*2+1]=a[n*2+1]=$,u.heap[1]=$++,pqdownheap(u,a,1);while(u.heap_len>=2);u.heap[--u.heap_max]=u.heap[1],gen_bitlen(u,I),gen_codes(a,O,u.bl_count)},scan_tree=(u,I,a)=>{let E,_=-1,k,e=I[0*2+1],n=0,O=7,$=4;for(e===0&&(O=138,$=3),I[(a+1)*2+1]=65535,E=0;E<=a;E++)k=e,e=I[(E+1)*2+1],!(++n<O&&k===e)&&(n<$?u.bl_tree[k*2]+=n:k!==0?(k!==_&&u.bl_tree[k*2]++,u.bl_tree[REP_3_6*2]++):n<=10?u.bl_tree[REPZ_3_10*2]++:u.bl_tree[REPZ_11_138*2]++,n=0,_=k,e===0?(O=138,$=3):k===e?(O=6,$=3):(O=7,$=4))},send_tree=(u,I,a)=>{let E,_=-1,k,e=I[0*2+1],n=0,O=7,$=4;for(e===0&&(O=138,$=3),E=0;E<=a;E++)if(k=e,e=I[(E+1)*2+1],!(++n<O&&k===e)){if(n<$)do send_code(u,k,u.bl_tree);while(--n!==0);else k!==0?(k!==_&&(send_code(u,k,u.bl_tree),n--),send_code(u,REP_3_6,u.bl_tree),send_bits(u,n-3,2)):n<=10?(send_code(u,REPZ_3_10,u.bl_tree),send_bits(u,n-3,3)):(send_code(u,REPZ_11_138,u.bl_tree),send_bits(u,n-11,7));n=0,_=k,e===0?(O=138,$=3):k===e?(O=6,$=3):(O=7,$=4)}},build_bl_tree=u=>{let I;for(scan_tree(u,u.dyn_ltree,u.l_desc.max_code),scan_tree(u,u.dyn_dtree,u.d_desc.max_code),build_tree(u,u.bl_desc),I=BL_CODES$1-1;I>=3&&u.bl_tree[bl_order[I]*2+1]===0;I--);return u.opt_len+=3*(I+1)+5+5+4,I},send_all_trees=(u,I,a,E)=>{let _;for(send_bits(u,I-257,5),send_bits(u,a-1,5),send_bits(u,E-4,4),_=0;_<E;_++)send_bits(u,u.bl_tree[bl_order[_]*2+1],3);send_tree(u,u.dyn_ltree,I-1),send_tree(u,u.dyn_dtree,a-1)},detect_data_type=u=>{let I=4093624447,a;for(a=0;a<=31;a++,I>>>=1)if(I&1&&u.dyn_ltree[a*2]!==0)return Z_BINARY;if(u.dyn_ltree[9*2]!==0||u.dyn_ltree[10*2]!==0||u.dyn_ltree[13*2]!==0)return Z_TEXT;for(a=32;a<LITERALS$1;a++)if(u.dyn_ltree[a*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=u=>{static_init_done||(tr_static_init(),static_init_done=!0),u.l_desc=new TreeDesc(u.dyn_ltree,static_l_desc),u.d_desc=new TreeDesc(u.dyn_dtree,static_d_desc),u.bl_desc=new TreeDesc(u.bl_tree,static_bl_desc),u.bi_buf=0,u.bi_valid=0,init_block(u)},_tr_stored_block$1=(u,I,a,E)=>{send_bits(u,(STORED_BLOCK<<1)+(E?1:0),3),bi_windup(u),put_short(u,a),put_short(u,~a),a&&u.pending_buf.set(u.window.subarray(I,I+a),u.pending),u.pending+=a},_tr_align$1=u=>{send_bits(u,STATIC_TREES<<1,3),send_code(u,END_BLOCK,static_ltree),bi_flush(u)},_tr_flush_block$1=(u,I,a,E)=>{let _,k,e=0;u.level>0?(u.strm.data_type===Z_UNKNOWN$1&&(u.strm.data_type=detect_data_type(u)),build_tree(u,u.l_desc),build_tree(u,u.d_desc),e=build_bl_tree(u),_=u.opt_len+3+7>>>3,k=u.static_len+3+7>>>3,k<=_&&(_=k)):_=k=a+5,a+4<=_&&I!==-1?_tr_stored_block$1(u,I,a,E):u.strategy===Z_FIXED$1||k===_?(send_bits(u,(STATIC_TREES<<1)+(E?1:0),3),compress_block(u,static_ltree,static_dtree)):(send_bits(u,(DYN_TREES<<1)+(E?1:0),3),send_all_trees(u,u.l_desc.max_code+1,u.d_desc.max_code+1,e+1),compress_block(u,u.dyn_ltree,u.dyn_dtree)),init_block(u),E&&bi_windup(u)},_tr_tally$1=(u,I,a)=>(u.pending_buf[u.sym_buf+u.sym_next++]=I,u.pending_buf[u.sym_buf+u.sym_next++]=I>>8,u.pending_buf[u.sym_buf+u.sym_next++]=a,I===0?u.dyn_ltree[a*2]++:(u.matches++,I--,u.dyn_ltree[(_length_code[a]+LITERALS$1+1)*2]++,u.dyn_dtree[d_code(I)*2]++),u.sym_next===u.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=(u,I,a,E)=>{let _=u&65535|0,k=u>>>16&65535|0,e=0;for(;a!==0;){e=a>2e3?2e3:a,a-=e;do _=_+I[E++]|0,k=k+_|0;while(--e);_%=65521,k%=65521}return _|k<<16|0};var adler32_1=adler32;const makeTable=()=>{let u,I=[];for(var a=0;a<256;a++){u=a;for(var E=0;E<8;E++)u=u&1?3988292384^u>>>1:u>>>1;I[a]=u}return I},crcTable=new Uint32Array(makeTable()),crc32=(u,I,a,E)=>{const _=crcTable,k=E+a;u^=-1;for(let e=E;e<k;e++)u=u>>>8^_[(u^I[e])&255];return u^-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=(u,I)=>(u.msg=messages[I],I),rank=u=>u*2-(u>4?9:0),zero=u=>{let I=u.length;for(;--I>=0;)u[I]=0},slide_hash=u=>{let I,a,E,_=u.w_size;I=u.hash_size,E=I;do a=u.head[--E],u.head[E]=a>=_?a-_:0;while(--I);I=_,E=I;do a=u.prev[--E],u.prev[E]=a>=_?a-_:0;while(--I)};let HASH_ZLIB=(u,I,a)=>(I<<u.hash_shift^a)&u.hash_mask,HASH=HASH_ZLIB;const flush_pending=u=>{const I=u.state;let a=I.pending;a>u.avail_out&&(a=u.avail_out),a!==0&&(u.output.set(I.pending_buf.subarray(I.pending_out,I.pending_out+a),u.next_out),u.next_out+=a,I.pending_out+=a,u.total_out+=a,u.avail_out-=a,I.pending-=a,I.pending===0&&(I.pending_out=0))},flush_block_only=(u,I)=>{_tr_flush_block(u,u.block_start>=0?u.block_start:-1,u.strstart-u.block_start,I),u.block_start=u.strstart,flush_pending(u.strm)},put_byte=(u,I)=>{u.pending_buf[u.pending++]=I},putShortMSB=(u,I)=>{u.pending_buf[u.pending++]=I>>>8&255,u.pending_buf[u.pending++]=I&255},read_buf=(u,I,a,E)=>{let _=u.avail_in;return _>E&&(_=E),_===0?0:(u.avail_in-=_,I.set(u.input.subarray(u.next_in,u.next_in+_),a),u.state.wrap===1?u.adler=adler32_1(u.adler,I,_,a):u.state.wrap===2&&(u.adler=crc32_1(u.adler,I,_,a)),u.next_in+=_,u.total_in+=_,_)},longest_match=(u,I)=>{let a=u.max_chain_length,E=u.strstart,_,k,e=u.prev_length,n=u.nice_match;const O=u.strstart>u.w_size-MIN_LOOKAHEAD?u.strstart-(u.w_size-MIN_LOOKAHEAD):0,$=u.window,N=u.w_mask,D=u.prev,q=u.strstart+MAX_MATCH;let P=$[E+e-1],j=$[E+e];u.prev_length>=u.good_match&&(a>>=2),n>u.lookahead&&(n=u.lookahead);do if(_=I,!($[_+e]!==j||$[_+e-1]!==P||$[_]!==$[E]||$[++_]!==$[E+1])){E+=2,_++;do;while($[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&E<q);if(k=MAX_MATCH-(q-E),E=q-MAX_MATCH,k>e){if(u.match_start=I,e=k,k>=n)break;P=$[E+e-1],j=$[E+e]}}while((I=D[I&N])>O&&--a!==0);return e<=u.lookahead?e:u.lookahead},fill_window=u=>{const I=u.w_size;let a,E,_;do{if(E=u.window_size-u.lookahead-u.strstart,u.strstart>=I+(I-MIN_LOOKAHEAD)&&(u.window.set(u.window.subarray(I,I+I-E),0),u.match_start-=I,u.strstart-=I,u.block_start-=I,u.insert>u.strstart&&(u.insert=u.strstart),slide_hash(u),E+=I),u.strm.avail_in===0)break;if(a=read_buf(u.strm,u.window,u.strstart+u.lookahead,E),u.lookahead+=a,u.lookahead+u.insert>=MIN_MATCH)for(_=u.strstart-u.insert,u.ins_h=u.window[_],u.ins_h=HASH(u,u.ins_h,u.window[_+1]);u.insert&&(u.ins_h=HASH(u,u.ins_h,u.window[_+MIN_MATCH-1]),u.prev[_&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=_,_++,u.insert--,!(u.lookahead+u.insert<MIN_MATCH)););}while(u.lookahead<MIN_LOOKAHEAD&&u.strm.avail_in!==0)},deflate_stored=(u,I)=>{let a=u.pending_buf_size-5>u.w_size?u.w_size:u.pending_buf_size-5,E,_,k,e=0,n=u.strm.avail_in;do{if(E=65535,k=u.bi_valid+42>>3,u.strm.avail_out<k||(k=u.strm.avail_out-k,_=u.strstart-u.block_start,E>_+u.strm.avail_in&&(E=_+u.strm.avail_in),E>k&&(E=k),E<a&&(E===0&&I!==Z_FINISH$3||I===Z_NO_FLUSH$2||E!==_+u.strm.avail_in)))break;e=I===Z_FINISH$3&&E===_+u.strm.avail_in?1:0,_tr_stored_block(u,0,0,e),u.pending_buf[u.pending-4]=E,u.pending_buf[u.pending-3]=E>>8,u.pending_buf[u.pending-2]=~E,u.pending_buf[u.pending-1]=~E>>8,flush_pending(u.strm),_&&(_>E&&(_=E),u.strm.output.set(u.window.subarray(u.block_start,u.block_start+_),u.strm.next_out),u.strm.next_out+=_,u.strm.avail_out-=_,u.strm.total_out+=_,u.block_start+=_,E-=_),E&&(read_buf(u.strm,u.strm.output,u.strm.next_out,E),u.strm.next_out+=E,u.strm.avail_out-=E,u.strm.total_out+=E)}while(e===0);return n-=u.strm.avail_in,n&&(n>=u.w_size?(u.matches=2,u.window.set(u.strm.input.subarray(u.strm.next_in-u.w_size,u.strm.next_in),0),u.strstart=u.w_size,u.insert=u.strstart):(u.window_size-u.strstart<=n&&(u.strstart-=u.w_size,u.window.set(u.window.subarray(u.w_size,u.w_size+u.strstart),0),u.matches<2&&u.matches++,u.insert>u.strstart&&(u.insert=u.strstart)),u.window.set(u.strm.input.subarray(u.strm.next_in-n,u.strm.next_in),u.strstart),u.strstart+=n,u.insert+=n>u.w_size-u.insert?u.w_size-u.insert:n),u.block_start=u.strstart),u.high_water<u.strstart&&(u.high_water=u.strstart),e?BS_FINISH_DONE:I!==Z_NO_FLUSH$2&&I!==Z_FINISH$3&&u.strm.avail_in===0&&u.strstart===u.block_start?BS_BLOCK_DONE:(k=u.window_size-u.strstart,u.strm.avail_in>k&&u.block_start>=u.w_size&&(u.block_start-=u.w_size,u.strstart-=u.w_size,u.window.set(u.window.subarray(u.w_size,u.w_size+u.strstart),0),u.matches<2&&u.matches++,k+=u.w_size,u.insert>u.strstart&&(u.insert=u.strstart)),k>u.strm.avail_in&&(k=u.strm.avail_in),k&&(read_buf(u.strm,u.window,u.strstart,k),u.strstart+=k,u.insert+=k>u.w_size-u.insert?u.w_size-u.insert:k),u.high_water<u.strstart&&(u.high_water=u.strstart),k=u.bi_valid+42>>3,k=u.pending_buf_size-k>65535?65535:u.pending_buf_size-k,a=k>u.w_size?u.w_size:k,_=u.strstart-u.block_start,(_>=a||(_||I===Z_FINISH$3)&&I!==Z_NO_FLUSH$2&&u.strm.avail_in===0&&_<=k)&&(E=_>k?k:_,e=I===Z_FINISH$3&&u.strm.avail_in===0&&E===_?1:0,_tr_stored_block(u,u.block_start,E,e),u.block_start+=E,flush_pending(u.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(u,I)=>{let a,E;for(;;){if(u.lookahead<MIN_LOOKAHEAD){if(fill_window(u),u.lookahead<MIN_LOOKAHEAD&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(u.lookahead===0)break}if(a=0,u.lookahead>=MIN_MATCH&&(u.ins_h=HASH(u,u.ins_h,u.window[u.strstart+MIN_MATCH-1]),a=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart),a!==0&&u.strstart-a<=u.w_size-MIN_LOOKAHEAD&&(u.match_length=longest_match(u,a)),u.match_length>=MIN_MATCH)if(E=_tr_tally(u,u.strstart-u.match_start,u.match_length-MIN_MATCH),u.lookahead-=u.match_length,u.match_length<=u.max_lazy_match&&u.lookahead>=MIN_MATCH){u.match_length--;do u.strstart++,u.ins_h=HASH(u,u.ins_h,u.window[u.strstart+MIN_MATCH-1]),a=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart;while(--u.match_length!==0);u.strstart++}else u.strstart+=u.match_length,u.match_length=0,u.ins_h=u.window[u.strstart],u.ins_h=HASH(u,u.ins_h,u.window[u.strstart+1]);else E=_tr_tally(u,0,u.window[u.strstart]),u.lookahead--,u.strstart++;if(E&&(flush_block_only(u,!1),u.strm.avail_out===0))return BS_NEED_MORE}return u.insert=u.strstart<MIN_MATCH-1?u.strstart:MIN_MATCH-1,I===Z_FINISH$3?(flush_block_only(u,!0),u.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):u.sym_next&&(flush_block_only(u,!1),u.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(u,I)=>{let a,E,_;for(;;){if(u.lookahead<MIN_LOOKAHEAD){if(fill_window(u),u.lookahead<MIN_LOOKAHEAD&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(u.lookahead===0)break}if(a=0,u.lookahead>=MIN_MATCH&&(u.ins_h=HASH(u,u.ins_h,u.window[u.strstart+MIN_MATCH-1]),a=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart),u.prev_length=u.match_length,u.prev_match=u.match_start,u.match_length=MIN_MATCH-1,a!==0&&u.prev_length<u.max_lazy_match&&u.strstart-a<=u.w_size-MIN_LOOKAHEAD&&(u.match_length=longest_match(u,a),u.match_length<=5&&(u.strategy===Z_FILTERED||u.match_length===MIN_MATCH&&u.strstart-u.match_start>4096)&&(u.match_length=MIN_MATCH-1)),u.prev_length>=MIN_MATCH&&u.match_length<=u.prev_length){_=u.strstart+u.lookahead-MIN_MATCH,E=_tr_tally(u,u.strstart-1-u.prev_match,u.prev_length-MIN_MATCH),u.lookahead-=u.prev_length-1,u.prev_length-=2;do++u.strstart<=_&&(u.ins_h=HASH(u,u.ins_h,u.window[u.strstart+MIN_MATCH-1]),a=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart);while(--u.prev_length!==0);if(u.match_available=0,u.match_length=MIN_MATCH-1,u.strstart++,E&&(flush_block_only(u,!1),u.strm.avail_out===0))return BS_NEED_MORE}else if(u.match_available){if(E=_tr_tally(u,0,u.window[u.strstart-1]),E&&flush_block_only(u,!1),u.strstart++,u.lookahead--,u.strm.avail_out===0)return BS_NEED_MORE}else u.match_available=1,u.strstart++,u.lookahead--}return u.match_available&&(E=_tr_tally(u,0,u.window[u.strstart-1]),u.match_available=0),u.insert=u.strstart<MIN_MATCH-1?u.strstart:MIN_MATCH-1,I===Z_FINISH$3?(flush_block_only(u,!0),u.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):u.sym_next&&(flush_block_only(u,!1),u.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(u,I)=>{let a,E,_,k;const e=u.window;for(;;){if(u.lookahead<=MAX_MATCH){if(fill_window(u),u.lookahead<=MAX_MATCH&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(u.lookahead===0)break}if(u.match_length=0,u.lookahead>=MIN_MATCH&&u.strstart>0&&(_=u.strstart-1,E=e[_],E===e[++_]&&E===e[++_]&&E===e[++_])){k=u.strstart+MAX_MATCH;do;while(E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&_<k);u.match_length=MAX_MATCH-(k-_),u.match_length>u.lookahead&&(u.match_length=u.lookahead)}if(u.match_length>=MIN_MATCH?(a=_tr_tally(u,1,u.match_length-MIN_MATCH),u.lookahead-=u.match_length,u.strstart+=u.match_length,u.match_length=0):(a=_tr_tally(u,0,u.window[u.strstart]),u.lookahead--,u.strstart++),a&&(flush_block_only(u,!1),u.strm.avail_out===0))return BS_NEED_MORE}return u.insert=0,I===Z_FINISH$3?(flush_block_only(u,!0),u.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):u.sym_next&&(flush_block_only(u,!1),u.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(u,I)=>{let a;for(;;){if(u.lookahead===0&&(fill_window(u),u.lookahead===0)){if(I===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(u.match_length=0,a=_tr_tally(u,0,u.window[u.strstart]),u.lookahead--,u.strstart++,a&&(flush_block_only(u,!1),u.strm.avail_out===0))return BS_NEED_MORE}return u.insert=0,I===Z_FINISH$3?(flush_block_only(u,!0),u.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):u.sym_next&&(flush_block_only(u,!1),u.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(u,I,a,E,_){this.good_length=u,this.max_lazy=I,this.nice_length=a,this.max_chain=E,this.func=_}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=u=>{u.window_size=2*u.w_size,zero(u.head),u.max_lazy_match=configuration_table[u.level].max_lazy,u.good_match=configuration_table[u.level].good_length,u.nice_match=configuration_table[u.level].nice_length,u.max_chain_length=configuration_table[u.level].max_chain,u.strstart=0,u.block_start=0,u.lookahead=0,u.insert=0,u.match_length=u.prev_length=MIN_MATCH-1,u.match_available=0,u.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=u=>{if(!u)return 1;const I=u.state;return!I||I.strm!==u||I.status!==INIT_STATE&&I.status!==GZIP_STATE&&I.status!==EXTRA_STATE&&I.status!==NAME_STATE&&I.status!==COMMENT_STATE&&I.status!==HCRC_STATE&&I.status!==BUSY_STATE&&I.status!==FINISH_STATE?1:0},deflateResetKeep=u=>{if(deflateStateCheck(u))return err(u,Z_STREAM_ERROR$2);u.total_in=u.total_out=0,u.data_type=Z_UNKNOWN;const I=u.state;return I.pending=0,I.pending_out=0,I.wrap<0&&(I.wrap=-I.wrap),I.status=I.wrap===2?GZIP_STATE:I.wrap?INIT_STATE:BUSY_STATE,u.adler=I.wrap===2?0:1,I.last_flush=-2,_tr_init(I),Z_OK$3},deflateReset=u=>{const I=deflateResetKeep(u);return I===Z_OK$3&&lm_init(u.state),I},deflateSetHeader=(u,I)=>deflateStateCheck(u)||u.state.wrap!==2?Z_STREAM_ERROR$2:(u.state.gzhead=I,Z_OK$3),deflateInit2=(u,I,a,E,_,k)=>{if(!u)return Z_STREAM_ERROR$2;let e=1;if(I===Z_DEFAULT_COMPRESSION$1&&(I=6),E<0?(e=0,E=-E):E>15&&(e=2,E-=16),_<1||_>MAX_MEM_LEVEL||a!==Z_DEFLATED$2||E<8||E>15||I<0||I>9||k<0||k>Z_FIXED||E===8&&e!==1)return err(u,Z_STREAM_ERROR$2);E===8&&(E=9);const n=new DeflateState;return u.state=n,n.strm=u,n.status=INIT_STATE,n.wrap=e,n.gzhead=null,n.w_bits=E,n.w_size=1<<n.w_bits,n.w_mask=n.w_size-1,n.hash_bits=_+7,n.hash_size=1<<n.hash_bits,n.hash_mask=n.hash_size-1,n.hash_shift=~~((n.hash_bits+MIN_MATCH-1)/MIN_MATCH),n.window=new Uint8Array(n.w_size*2),n.head=new Uint16Array(n.hash_size),n.prev=new Uint16Array(n.w_size),n.lit_bufsize=1<<_+6,n.pending_buf_size=n.lit_bufsize*4,n.pending_buf=new Uint8Array(n.pending_buf_size),n.sym_buf=n.lit_bufsize,n.sym_end=(n.lit_bufsize-1)*3,n.level=I,n.strategy=k,n.method=a,deflateReset(u)},deflateInit=(u,I)=>deflateInit2(u,I,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(u,I)=>{if(deflateStateCheck(u)||I>Z_BLOCK$1||I<0)return u?err(u,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const a=u.state;if(!u.output||u.avail_in!==0&&!u.input||a.status===FINISH_STATE&&I!==Z_FINISH$3)return err(u,u.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const E=a.last_flush;if(a.last_flush=I,a.pending!==0){if(flush_pending(u),u.avail_out===0)return a.last_flush=-1,Z_OK$3}else if(u.avail_in===0&&rank(I)<=rank(E)&&I!==Z_FINISH$3)return err(u,Z_BUF_ERROR$1);if(a.status===FINISH_STATE&&u.avail_in!==0)return err(u,Z_BUF_ERROR$1);if(a.status===INIT_STATE&&a.wrap===0&&(a.status=BUSY_STATE),a.status===INIT_STATE){let _=Z_DEFLATED$2+(a.w_bits-8<<4)<<8,k=-1;if(a.strategy>=Z_HUFFMAN_ONLY||a.level<2?k=0:a.level<6?k=1:a.level===6?k=2:k=3,_|=k<<6,a.strstart!==0&&(_|=PRESET_DICT),_+=31-_%31,putShortMSB(a,_),a.strstart!==0&&(putShortMSB(a,u.adler>>>16),putShortMSB(a,u.adler&65535)),u.adler=1,a.status=BUSY_STATE,flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3}if(a.status===GZIP_STATE){if(u.adler=0,put_byte(a,31),put_byte(a,139),put_byte(a,8),a.gzhead)put_byte(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),put_byte(a,a.gzhead.time&255),put_byte(a,a.gzhead.time>>8&255),put_byte(a,a.gzhead.time>>16&255),put_byte(a,a.gzhead.time>>24&255),put_byte(a,a.level===9?2:a.strategy>=Z_HUFFMAN_ONLY||a.level<2?4:0),put_byte(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(put_byte(a,a.gzhead.extra.length&255),put_byte(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=EXTRA_STATE;else if(put_byte(a,0),put_byte(a,0),put_byte(a,0),put_byte(a,0),put_byte(a,0),put_byte(a,a.level===9?2:a.strategy>=Z_HUFFMAN_ONLY||a.level<2?4:0),put_byte(a,OS_CODE),a.status=BUSY_STATE,flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3}if(a.status===EXTRA_STATE){if(a.gzhead.extra){let _=a.pending,k=(a.gzhead.extra.length&65535)-a.gzindex;for(;a.pending+k>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_)),a.gzindex+=n,flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3;_=0,k-=n}let e=new Uint8Array(a.gzhead.extra);a.pending_buf.set(e.subarray(a.gzindex,a.gzindex+k),a.pending),a.pending+=k,a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_)),a.gzindex=0}a.status=NAME_STATE}if(a.status===NAME_STATE){if(a.gzhead.name){let _=a.pending,k;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_)),flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3;_=0}a.gzindex<a.gzhead.name.length?k=a.gzhead.name.charCodeAt(a.gzindex++)&255:k=0,put_byte(a,k)}while(k!==0);a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_)),a.gzindex=0}a.status=COMMENT_STATE}if(a.status===COMMENT_STATE){if(a.gzhead.comment){let _=a.pending,k;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_)),flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3;_=0}a.gzindex<a.gzhead.comment.length?k=a.gzhead.comment.charCodeAt(a.gzindex++)&255:k=0,put_byte(a,k)}while(k!==0);a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_))}a.status=HCRC_STATE}if(a.status===HCRC_STATE){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(flush_pending(u),a.pending!==0))return a.last_flush=-1,Z_OK$3;put_byte(a,u.adler&255),put_byte(a,u.adler>>8&255),u.adler=0}if(a.status=BUSY_STATE,flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3}if(u.avail_in!==0||a.lookahead!==0||I!==Z_NO_FLUSH$2&&a.status!==FINISH_STATE){let _=a.level===0?deflate_stored(a,I):a.strategy===Z_HUFFMAN_ONLY?deflate_huff(a,I):a.strategy===Z_RLE?deflate_rle(a,I):configuration_table[a.level].func(a,I);if((_===BS_FINISH_STARTED||_===BS_FINISH_DONE)&&(a.status=FINISH_STATE),_===BS_NEED_MORE||_===BS_FINISH_STARTED)return u.avail_out===0&&(a.last_flush=-1),Z_OK$3;if(_===BS_BLOCK_DONE&&(I===Z_PARTIAL_FLUSH?_tr_align(a):I!==Z_BLOCK$1&&(_tr_stored_block(a,0,0,!1),I===Z_FULL_FLUSH$1&&(zero(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),flush_pending(u),u.avail_out===0))return a.last_flush=-1,Z_OK$3}return I!==Z_FINISH$3?Z_OK$3:a.wrap<=0?Z_STREAM_END$3:(a.wrap===2?(put_byte(a,u.adler&255),put_byte(a,u.adler>>8&255),put_byte(a,u.adler>>16&255),put_byte(a,u.adler>>24&255),put_byte(a,u.total_in&255),put_byte(a,u.total_in>>8&255),put_byte(a,u.total_in>>16&255),put_byte(a,u.total_in>>24&255)):(putShortMSB(a,u.adler>>>16),putShortMSB(a,u.adler&65535)),flush_pending(u),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=u=>{if(deflateStateCheck(u))return Z_STREAM_ERROR$2;const I=u.state.status;return u.state=null,I===BUSY_STATE?err(u,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(u,I)=>{let a=I.length;if(deflateStateCheck(u))return Z_STREAM_ERROR$2;const E=u.state,_=E.wrap;if(_===2||_===1&&E.status!==INIT_STATE||E.lookahead)return Z_STREAM_ERROR$2;if(_===1&&(u.adler=adler32_1(u.adler,I,a,0)),E.wrap=0,a>=E.w_size){_===0&&(zero(E.head),E.strstart=0,E.block_start=0,E.insert=0);let O=new Uint8Array(E.w_size);O.set(I.subarray(a-E.w_size,a),0),I=O,a=E.w_size}const k=u.avail_in,e=u.next_in,n=u.input;for(u.avail_in=a,u.next_in=0,u.input=I,fill_window(E);E.lookahead>=MIN_MATCH;){let O=E.strstart,$=E.lookahead-(MIN_MATCH-1);do E.ins_h=HASH(E,E.ins_h,E.window[O+MIN_MATCH-1]),E.prev[O&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=O,O++;while(--$);E.strstart=O,E.lookahead=MIN_MATCH-1,fill_window(E)}return E.strstart+=E.lookahead,E.block_start=E.strstart,E.insert=E.lookahead,E.lookahead=0,E.match_length=E.prev_length=MIN_MATCH-1,E.match_available=0,u.next_in=e,u.input=n,u.avail_in=k,E.wrap=_,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=(u,I)=>Object.prototype.hasOwnProperty.call(u,I);var assign=function(u){const I=Array.prototype.slice.call(arguments,1);for(;I.length;){const a=I.shift();if(a){if(typeof a!="object")throw new TypeError(a+"must be non-object");for(const E in a)_has(a,E)&&(u[E]=a[E])}}return u},flattenChunks=u=>{let I=0;for(let E=0,_=u.length;E<_;E++)I+=u[E].length;const a=new Uint8Array(I);for(let E=0,_=0,k=u.length;E<k;E++){let e=u[E];a.set(e,_),_+=e.length}return a},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(u){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let u=0;u<256;u++)_utf8len[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=u=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(u);let I,a,E,_,k,e=u.length,n=0;for(_=0;_<e;_++)a=u.charCodeAt(_),(a&64512)===55296&&_+1<e&&(E=u.charCodeAt(_+1),(E&64512)===56320&&(a=65536+(a-55296<<10)+(E-56320),_++)),n+=a<128?1:a<2048?2:a<65536?3:4;for(I=new Uint8Array(n),k=0,_=0;k<n;_++)a=u.charCodeAt(_),(a&64512)===55296&&_+1<e&&(E=u.charCodeAt(_+1),(E&64512)===56320&&(a=65536+(a-55296<<10)+(E-56320),_++)),a<128?I[k++]=a:a<2048?(I[k++]=192|a>>>6,I[k++]=128|a&63):a<65536?(I[k++]=224|a>>>12,I[k++]=128|a>>>6&63,I[k++]=128|a&63):(I[k++]=240|a>>>18,I[k++]=128|a>>>12&63,I[k++]=128|a>>>6&63,I[k++]=128|a&63);return I};const buf2binstring=(u,I)=>{if(I<65534&&u.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,u.length===I?u:u.subarray(0,I));let a="";for(let E=0;E<I;E++)a+=String.fromCharCode(u[E]);return a};var buf2string=(u,I)=>{const a=I||u.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(u.subarray(0,I));let E,_;const k=new Array(a*2);for(_=0,E=0;E<a;){let e=u[E++];if(e<128){k[_++]=e;continue}let n=_utf8len[e];if(n>4){k[_++]=65533,E+=n-1;continue}for(e&=n===2?31:n===3?15:7;n>1&&E<a;)e=e<<6|u[E++]&63,n--;if(n>1){k[_++]=65533;continue}e<65536?k[_++]=e:(e-=65536,k[_++]=55296|e>>10&1023,k[_++]=56320|e&1023)}return buf2binstring(k,_)},utf8border=(u,I)=>{I=I||u.length,I>u.length&&(I=u.length);let a=I-1;for(;a>=0&&(u[a]&192)===128;)a--;return a<0||a===0?I:a+_utf8len[u[a]]>I?a:I},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(u){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},u||{});let I=this.options;I.raw&&I.windowBits>0?I.windowBits=-I.windowBits:I.gzip&&I.windowBits>0&&I.windowBits<16&&(I.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let a=deflate_1$2.deflateInit2(this.strm,I.level,I.method,I.windowBits,I.memLevel,I.strategy);if(a!==Z_OK$2)throw new Error(messages[a]);if(I.header&&deflate_1$2.deflateSetHeader(this.strm,I.header),I.dictionary){let E;if(typeof I.dictionary=="string"?E=strings.string2buf(I.dictionary):toString$1.call(I.dictionary)==="[object ArrayBuffer]"?E=new Uint8Array(I.dictionary):E=I.dictionary,a=deflate_1$2.deflateSetDictionary(this.strm,E),a!==Z_OK$2)throw new Error(messages[a]);this._dict_set=!0}}Deflate$1.prototype.push=function(u,I){const a=this.strm,E=this.options.chunkSize;let _,k;if(this.ended)return!1;for(I===~~I?k=I:k=I===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof u=="string"?a.input=strings.string2buf(u):toString$1.call(u)==="[object ArrayBuffer]"?a.input=new Uint8Array(u):a.input=u,a.next_in=0,a.avail_in=a.input.length;;){if(a.avail_out===0&&(a.output=new Uint8Array(E),a.next_out=0,a.avail_out=E),(k===Z_SYNC_FLUSH||k===Z_FULL_FLUSH)&&a.avail_out<=6){this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;continue}if(_=deflate_1$2.deflate(a,k),_===Z_STREAM_END$2)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),_=deflate_1$2.deflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===Z_OK$2;if(a.avail_out===0){this.onData(a.output);continue}if(k>0&&a.next_out>0){this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;continue}if(a.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(u){this.chunks.push(u)},Deflate$1.prototype.onEnd=function(u){u===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg};function deflate$1(u,I){const a=new Deflate$1(I);if(a.push(u,!0),a.err)throw a.msg||messages[a.err];return a.result}function deflateRaw$1(u,I){return I=I||{},I.raw=!0,deflate$1(u,I)}function gzip$1(u,I){return I=I||{},I.gzip=!0,deflate$1(u,I)}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 u(I,a){let E,_,k,e,n,O,$,N,D,q,P,j,V,J,z,Y,et,tt,nt,_t,it,ut,st,rt;const ct=I.state;E=I.next_in,st=I.input,_=E+(I.avail_in-5),k=I.next_out,rt=I.output,e=k-(a-I.avail_out),n=k+(I.avail_out-257),O=ct.dmax,$=ct.wsize,N=ct.whave,D=ct.wnext,q=ct.window,P=ct.hold,j=ct.bits,V=ct.lencode,J=ct.distcode,z=(1<<ct.lenbits)-1,Y=(1<<ct.distbits)-1;t:do{j<15&&(P+=st[E++]<<j,j+=8,P+=st[E++]<<j,j+=8),et=V[P&z];e:for(;;){if(tt=et>>>24,P>>>=tt,j-=tt,tt=et>>>16&255,tt===0)rt[k++]=et&65535;else if(tt&16){nt=et&65535,tt&=15,tt&&(j<tt&&(P+=st[E++]<<j,j+=8),nt+=P&(1<<tt)-1,P>>>=tt,j-=tt),j<15&&(P+=st[E++]<<j,j+=8,P+=st[E++]<<j,j+=8),et=J[P&Y];i:for(;;){if(tt=et>>>24,P>>>=tt,j-=tt,tt=et>>>16&255,tt&16){if(_t=et&65535,tt&=15,j<tt&&(P+=st[E++]<<j,j+=8,j<tt&&(P+=st[E++]<<j,j+=8)),_t+=P&(1<<tt)-1,_t>O){I.msg="invalid distance too far back",ct.mode=BAD$1;break t}if(P>>>=tt,j-=tt,tt=k-e,_t>tt){if(tt=_t-tt,tt>N&&ct.sane){I.msg="invalid distance too far back",ct.mode=BAD$1;break t}if(it=0,ut=q,D===0){if(it+=$-tt,tt<nt){nt-=tt;do rt[k++]=q[it++];while(--tt);it=k-_t,ut=rt}}else if(D<tt){if(it+=$+D-tt,tt-=D,tt<nt){nt-=tt;do rt[k++]=q[it++];while(--tt);if(it=0,D<nt){tt=D,nt-=tt;do rt[k++]=q[it++];while(--tt);it=k-_t,ut=rt}}}else if(it+=D-tt,tt<nt){nt-=tt;do rt[k++]=q[it++];while(--tt);it=k-_t,ut=rt}for(;nt>2;)rt[k++]=ut[it++],rt[k++]=ut[it++],rt[k++]=ut[it++],nt-=3;nt&&(rt[k++]=ut[it++],nt>1&&(rt[k++]=ut[it++]))}else{it=k-_t;do rt[k++]=rt[it++],rt[k++]=rt[it++],rt[k++]=rt[it++],nt-=3;while(nt>2);nt&&(rt[k++]=rt[it++],nt>1&&(rt[k++]=rt[it++]))}}else if((tt&64)===0){et=J[(et&65535)+(P&(1<<tt)-1)];continue i}else{I.msg="invalid distance code",ct.mode=BAD$1;break t}break}}else if((tt&64)===0){et=V[(et&65535)+(P&(1<<tt)-1)];continue e}else if(tt&32){ct.mode=TYPE$1;break t}else{I.msg="invalid literal/length code",ct.mode=BAD$1;break t}break}}while(E<_&&k<n);nt=j>>3,E-=nt,j-=nt<<3,P&=(1<<j)-1,I.next_in=E,I.next_out=k,I.avail_in=E<_?5+(_-E):5-(E-_),I.avail_out=k<n?257+(n-k):257-(k-n),ct.hold=P,ct.bits=j};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=(u,I,a,E,_,k,e,n)=>{const O=n.bits;let $=0,N=0,D=0,q=0,P=0,j=0,V=0,J=0,z=0,Y=0,et,tt,nt,_t,it,ut=null,st;const rt=new Uint16Array(MAXBITS+1),ct=new Uint16Array(MAXBITS+1);let It=null,oe,ie,ne;for($=0;$<=MAXBITS;$++)rt[$]=0;for(N=0;N<E;N++)rt[I[a+N]]++;for(P=O,q=MAXBITS;q>=1&&rt[q]===0;q--);if(P>q&&(P=q),q===0)return _[k++]=1<<24|64<<16|0,_[k++]=1<<24|64<<16|0,n.bits=1,0;for(D=1;D<q&&rt[D]===0;D++);for(P<D&&(P=D),J=1,$=1;$<=MAXBITS;$++)if(J<<=1,J-=rt[$],J<0)return-1;if(J>0&&(u===CODES$1||q!==1))return-1;for(ct[1]=0,$=1;$<MAXBITS;$++)ct[$+1]=ct[$]+rt[$];for(N=0;N<E;N++)I[a+N]!==0&&(e[ct[I[a+N]]++]=N);if(u===CODES$1?(ut=It=e,st=20):u===LENS$1?(ut=lbase,It=lext,st=257):(ut=dbase,It=dext,st=0),Y=0,N=0,$=D,it=k,j=P,V=0,nt=-1,z=1<<P,_t=z-1,u===LENS$1&&z>ENOUGH_LENS$1||u===DISTS$1&&z>ENOUGH_DISTS$1)return 1;for(;;){oe=$-V,e[N]+1<st?(ie=0,ne=e[N]):e[N]>=st?(ie=It[e[N]-st],ne=ut[e[N]-st]):(ie=96,ne=0),et=1<<$-V,tt=1<<j,D=tt;do tt-=et,_[it+(Y>>V)+tt]=oe<<24|ie<<16|ne|0;while(tt!==0);for(et=1<<$-1;Y&et;)et>>=1;if(et!==0?(Y&=et-1,Y+=et):Y=0,N++,--rt[$]===0){if($===q)break;$=I[a+e[N]]}if($>P&&(Y&_t)!==nt){for(V===0&&(V=P),it+=D,j=$-V,J=1<<j;j+V<q&&(J-=rt[j+V],!(J<=0));)j++,J<<=1;if(z+=1<<j,u===LENS$1&&z>ENOUGH_LENS$1||u===DISTS$1&&z>ENOUGH_DISTS$1)return 1;nt=Y&_t,_[nt]=P<<24|j<<16|it-k|0}}return Y!==0&&(_[it+Y]=$-V<<24|64<<16|0),n.bits=P,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=u=>(u>>>24&255)+(u>>>8&65280)+((u&65280)<<8)+((u&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=u=>{if(!u)return 1;const I=u.state;return!I||I.strm!==u||I.mode<HEAD||I.mode>SYNC?1:0},inflateResetKeep=u=>{if(inflateStateCheck(u))return Z_STREAM_ERROR$1;const I=u.state;return u.total_in=u.total_out=I.total=0,u.msg="",I.wrap&&(u.adler=I.wrap&1),I.mode=HEAD,I.last=0,I.havedict=0,I.flags=-1,I.dmax=32768,I.head=null,I.hold=0,I.bits=0,I.lencode=I.lendyn=new Int32Array(ENOUGH_LENS),I.distcode=I.distdyn=new Int32Array(ENOUGH_DISTS),I.sane=1,I.back=-1,Z_OK$1},inflateReset=u=>{if(inflateStateCheck(u))return Z_STREAM_ERROR$1;const I=u.state;return I.wsize=0,I.whave=0,I.wnext=0,inflateResetKeep(u)},inflateReset2=(u,I)=>{let a;if(inflateStateCheck(u))return Z_STREAM_ERROR$1;const E=u.state;return I<0?(a=0,I=-I):(a=(I>>4)+5,I<48&&(I&=15)),I&&(I<8||I>15)?Z_STREAM_ERROR$1:(E.window!==null&&E.wbits!==I&&(E.window=null),E.wrap=a,E.wbits=I,inflateReset(u))},inflateInit2=(u,I)=>{if(!u)return Z_STREAM_ERROR$1;const a=new InflateState;u.state=a,a.strm=u,a.window=null,a.mode=HEAD;const E=inflateReset2(u,I);return E!==Z_OK$1&&(u.state=null),E},inflateInit=u=>inflateInit2(u,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=u=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let I=0;for(;I<144;)u.lens[I++]=8;for(;I<256;)u.lens[I++]=9;for(;I<280;)u.lens[I++]=7;for(;I<288;)u.lens[I++]=8;for(inftrees(LENS,u.lens,0,288,lenfix,0,u.work,{bits:9}),I=0;I<32;)u.lens[I++]=5;inftrees(DISTS,u.lens,0,32,distfix,0,u.work,{bits:5}),virgin=!1}u.lencode=lenfix,u.lenbits=9,u.distcode=distfix,u.distbits=5},updatewindow=(u,I,a,E)=>{let _;const k=u.state;return k.window===null&&(k.wsize=1<<k.wbits,k.wnext=0,k.whave=0,k.window=new Uint8Array(k.wsize)),E>=k.wsize?(k.window.set(I.subarray(a-k.wsize,a),0),k.wnext=0,k.whave=k.wsize):(_=k.wsize-k.wnext,_>E&&(_=E),k.window.set(I.subarray(a-E,a-E+_),k.wnext),E-=_,E?(k.window.set(I.subarray(a-E,a),0),k.wnext=E,k.whave=k.wsize):(k.wnext+=_,k.wnext===k.wsize&&(k.wnext=0),k.whave<k.wsize&&(k.whave+=_))),0},inflate$2=(u,I)=>{let a,E,_,k,e,n,O,$,N,D,q,P,j,V,J=0,z,Y,et,tt,nt,_t,it,ut;const st=new Uint8Array(4);let rt,ct;const It=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(u)||!u.output||!u.input&&u.avail_in!==0)return Z_STREAM_ERROR$1;a=u.state,a.mode===TYPE&&(a.mode=TYPEDO),e=u.next_out,_=u.output,O=u.avail_out,k=u.next_in,E=u.input,n=u.avail_in,$=a.hold,N=a.bits,D=n,q=O,ut=Z_OK$1;t:for(;;)switch(a.mode){case HEAD:if(a.wrap===0){a.mode=TYPEDO;break}for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(a.wrap&2&&$===35615){a.wbits===0&&(a.wbits=15),a.check=0,st[0]=$&255,st[1]=$>>>8&255,a.check=crc32_1(a.check,st,2,0),$=0,N=0,a.mode=FLAGS;break}if(a.head&&(a.head.done=!1),!(a.wrap&1)||((($&255)<<8)+($>>8))%31){u.msg="incorrect header check",a.mode=BAD;break}if(($&15)!==Z_DEFLATED){u.msg="unknown compression method",a.mode=BAD;break}if($>>>=4,N-=4,it=($&15)+8,a.wbits===0&&(a.wbits=it),it>15||it>a.wbits){u.msg="invalid window size",a.mode=BAD;break}a.dmax=1<<a.wbits,a.flags=0,u.adler=a.check=1,a.mode=$&512?DICTID:TYPE,$=0,N=0;break;case FLAGS:for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(a.flags=$,(a.flags&255)!==Z_DEFLATED){u.msg="unknown compression method",a.mode=BAD;break}if(a.flags&57344){u.msg="unknown header flags set",a.mode=BAD;break}a.head&&(a.head.text=$>>8&1),a.flags&512&&a.wrap&4&&(st[0]=$&255,st[1]=$>>>8&255,a.check=crc32_1(a.check,st,2,0)),$=0,N=0,a.mode=TIME;case TIME:for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.head&&(a.head.time=$),a.flags&512&&a.wrap&4&&(st[0]=$&255,st[1]=$>>>8&255,st[2]=$>>>16&255,st[3]=$>>>24&255,a.check=crc32_1(a.check,st,4,0)),$=0,N=0,a.mode=OS;case OS:for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.head&&(a.head.xflags=$&255,a.head.os=$>>8),a.flags&512&&a.wrap&4&&(st[0]=$&255,st[1]=$>>>8&255,a.check=crc32_1(a.check,st,2,0)),$=0,N=0,a.mode=EXLEN;case EXLEN:if(a.flags&1024){for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.length=$,a.head&&(a.head.extra_len=$),a.flags&512&&a.wrap&4&&(st[0]=$&255,st[1]=$>>>8&255,a.check=crc32_1(a.check,st,2,0)),$=0,N=0}else a.head&&(a.head.extra=null);a.mode=EXTRA;case EXTRA:if(a.flags&1024&&(P=a.length,P>n&&(P=n),P&&(a.head&&(it=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(E.subarray(k,k+P),it)),a.flags&512&&a.wrap&4&&(a.check=crc32_1(a.check,E,P,k)),n-=P,k+=P,a.length-=P),a.length))break t;a.length=0,a.mode=NAME;case NAME:if(a.flags&2048){if(n===0)break t;P=0;do it=E[k+P++],a.head&&it&&a.length<65536&&(a.head.name+=String.fromCharCode(it));while(it&&P<n);if(a.flags&512&&a.wrap&4&&(a.check=crc32_1(a.check,E,P,k)),n-=P,k+=P,it)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=COMMENT;case COMMENT:if(a.flags&4096){if(n===0)break t;P=0;do it=E[k+P++],a.head&&it&&a.length<65536&&(a.head.comment+=String.fromCharCode(it));while(it&&P<n);if(a.flags&512&&a.wrap&4&&(a.check=crc32_1(a.check,E,P,k)),n-=P,k+=P,it)break t}else a.head&&(a.head.comment=null);a.mode=HCRC;case HCRC:if(a.flags&512){for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(a.wrap&4&&$!==(a.check&65535)){u.msg="header crc mismatch",a.mode=BAD;break}$=0,N=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),u.adler=a.check=0,a.mode=TYPE;break;case DICTID:for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.adler=a.check=zswap32($),$=0,N=0,a.mode=DICT;case DICT:if(a.havedict===0)return u.next_out=e,u.avail_out=O,u.next_in=k,u.avail_in=n,a.hold=$,a.bits=N,Z_NEED_DICT$1;u.adler=a.check=1,a.mode=TYPE;case TYPE:if(I===Z_BLOCK||I===Z_TREES)break t;case TYPEDO:if(a.last){$>>>=N&7,N-=N&7,a.mode=CHECK;break}for(;N<3;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}switch(a.last=$&1,$>>>=1,N-=1,$&3){case 0:a.mode=STORED;break;case 1:if(fixedtables(a),a.mode=LEN_,I===Z_TREES){$>>>=2,N-=2;break t}break;case 2:a.mode=TABLE;break;case 3:u.msg="invalid block type",a.mode=BAD}$>>>=2,N-=2;break;case STORED:for($>>>=N&7,N-=N&7;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(($&65535)!==($>>>16^65535)){u.msg="invalid stored block lengths",a.mode=BAD;break}if(a.length=$&65535,$=0,N=0,a.mode=COPY_,I===Z_TREES)break t;case COPY_:a.mode=COPY;case COPY:if(P=a.length,P){if(P>n&&(P=n),P>O&&(P=O),P===0)break t;_.set(E.subarray(k,k+P),e),n-=P,k+=P,O-=P,e+=P,a.length-=P;break}a.mode=TYPE;break;case TABLE:for(;N<14;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(a.nlen=($&31)+257,$>>>=5,N-=5,a.ndist=($&31)+1,$>>>=5,N-=5,a.ncode=($&15)+4,$>>>=4,N-=4,a.nlen>286||a.ndist>30){u.msg="too many length or distance symbols",a.mode=BAD;break}a.have=0,a.mode=LENLENS;case LENLENS:for(;a.have<a.ncode;){for(;N<3;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.lens[It[a.have++]]=$&7,$>>>=3,N-=3}for(;a.have<19;)a.lens[It[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,rt={bits:a.lenbits},ut=inftrees(CODES,a.lens,0,19,a.lencode,0,a.work,rt),a.lenbits=rt.bits,ut){u.msg="invalid code lengths set",a.mode=BAD;break}a.have=0,a.mode=CODELENS;case CODELENS:for(;a.have<a.nlen+a.ndist;){for(;J=a.lencode[$&(1<<a.lenbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(et<16)$>>>=z,N-=z,a.lens[a.have++]=et;else{if(et===16){for(ct=z+2;N<ct;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if($>>>=z,N-=z,a.have===0){u.msg="invalid bit length repeat",a.mode=BAD;break}it=a.lens[a.have-1],P=3+($&3),$>>>=2,N-=2}else if(et===17){for(ct=z+3;N<ct;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=z,N-=z,it=0,P=3+($&7),$>>>=3,N-=3}else{for(ct=z+7;N<ct;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=z,N-=z,it=0,P=11+($&127),$>>>=7,N-=7}if(a.have+P>a.nlen+a.ndist){u.msg="invalid bit length repeat",a.mode=BAD;break}for(;P--;)a.lens[a.have++]=it}}if(a.mode===BAD)break;if(a.lens[256]===0){u.msg="invalid code -- missing end-of-block",a.mode=BAD;break}if(a.lenbits=9,rt={bits:a.lenbits},ut=inftrees(LENS,a.lens,0,a.nlen,a.lencode,0,a.work,rt),a.lenbits=rt.bits,ut){u.msg="invalid literal/lengths set",a.mode=BAD;break}if(a.distbits=6,a.distcode=a.distdyn,rt={bits:a.distbits},ut=inftrees(DISTS,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,rt),a.distbits=rt.bits,ut){u.msg="invalid distances set",a.mode=BAD;break}if(a.mode=LEN_,I===Z_TREES)break t;case LEN_:a.mode=LEN;case LEN:if(n>=6&&O>=258){u.next_out=e,u.avail_out=O,u.next_in=k,u.avail_in=n,a.hold=$,a.bits=N,inffast(u,q),e=u.next_out,_=u.output,O=u.avail_out,k=u.next_in,E=u.input,n=u.avail_in,$=a.hold,N=a.bits,a.mode===TYPE&&(a.back=-1);break}for(a.back=0;J=a.lencode[$&(1<<a.lenbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(Y&&(Y&240)===0){for(tt=z,nt=Y,_t=et;J=a.lencode[_t+(($&(1<<tt+nt)-1)>>tt)],z=J>>>24,Y=J>>>16&255,et=J&65535,!(tt+z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=tt,N-=tt,a.back+=tt}if($>>>=z,N-=z,a.back+=z,a.length=et,Y===0){a.mode=LIT;break}if(Y&32){a.back=-1,a.mode=TYPE;break}if(Y&64){u.msg="invalid literal/length code",a.mode=BAD;break}a.extra=Y&15,a.mode=LENEXT;case LENEXT:if(a.extra){for(ct=a.extra;N<ct;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.length+=$&(1<<a.extra)-1,$>>>=a.extra,N-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=DIST;case DIST:for(;J=a.distcode[$&(1<<a.distbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if((Y&240)===0){for(tt=z,nt=Y,_t=et;J=a.distcode[_t+(($&(1<<tt+nt)-1)>>tt)],z=J>>>24,Y=J>>>16&255,et=J&65535,!(tt+z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=tt,N-=tt,a.back+=tt}if($>>>=z,N-=z,a.back+=z,Y&64){u.msg="invalid distance code",a.mode=BAD;break}a.offset=et,a.extra=Y&15,a.mode=DISTEXT;case DISTEXT:if(a.extra){for(ct=a.extra;N<ct;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.offset+=$&(1<<a.extra)-1,$>>>=a.extra,N-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){u.msg="invalid distance too far back",a.mode=BAD;break}a.mode=MATCH;case MATCH:if(O===0)break t;if(P=q-O,a.offset>P){if(P=a.offset-P,P>a.whave&&a.sane){u.msg="invalid distance too far back",a.mode=BAD;break}P>a.wnext?(P-=a.wnext,j=a.wsize-P):j=a.wnext-P,P>a.length&&(P=a.length),V=a.window}else V=_,j=e-a.offset,P=a.length;P>O&&(P=O),O-=P,a.length-=P;do _[e++]=V[j++];while(--P);a.length===0&&(a.mode=LEN);break;case LIT:if(O===0)break t;_[e++]=a.length,O--,a.mode=LEN;break;case CHECK:if(a.wrap){for(;N<32;){if(n===0)break t;n--,$|=E[k++]<<N,N+=8}if(q-=O,u.total_out+=q,a.total+=q,a.wrap&4&&q&&(u.adler=a.check=a.flags?crc32_1(a.check,_,q,e-q):adler32_1(a.check,_,q,e-q)),q=O,a.wrap&4&&(a.flags?$:zswap32($))!==a.check){u.msg="incorrect data check",a.mode=BAD;break}$=0,N=0}a.mode=LENGTH;case LENGTH:if(a.wrap&&a.flags){for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(a.wrap&4&&$!==(a.total&4294967295)){u.msg="incorrect length check",a.mode=BAD;break}$=0,N=0}a.mode=DONE;case DONE:ut=Z_STREAM_END$1;break t;case BAD:ut=Z_DATA_ERROR$1;break t;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return u.next_out=e,u.avail_out=O,u.next_in=k,u.avail_in=n,a.hold=$,a.bits=N,(a.wsize||q!==u.avail_out&&a.mode<BAD&&(a.mode<CHECK||I!==Z_FINISH$1))&&updatewindow(u,u.output,u.next_out,q-u.avail_out),D-=u.avail_in,q-=u.avail_out,u.total_in+=D,u.total_out+=q,a.total+=q,a.wrap&4&&q&&(u.adler=a.check=a.flags?crc32_1(a.check,_,q,u.next_out-q):adler32_1(a.check,_,q,u.next_out-q)),u.data_type=a.bits+(a.last?64:0)+(a.mode===TYPE?128:0)+(a.mode===LEN_||a.mode===COPY_?256:0),(D===0&&q===0||I===Z_FINISH$1)&&ut===Z_OK$1&&(ut=Z_BUF_ERROR),ut},inflateEnd=u=>{if(inflateStateCheck(u))return Z_STREAM_ERROR$1;let I=u.state;return I.window&&(I.window=null),u.state=null,Z_OK$1},inflateGetHeader=(u,I)=>{if(inflateStateCheck(u))return Z_STREAM_ERROR$1;const a=u.state;return(a.wrap&2)===0?Z_STREAM_ERROR$1:(a.head=I,I.done=!1,Z_OK$1)},inflateSetDictionary=(u,I)=>{const a=I.length;let E,_,k;return inflateStateCheck(u)||(E=u.state,E.wrap!==0&&E.mode!==DICT)?Z_STREAM_ERROR$1:E.mode===DICT&&(_=1,_=adler32_1(_,I,a,0),_!==E.check)?Z_DATA_ERROR$1:(k=updatewindow(u,I,a,a),k?(E.mode=MEM,Z_MEM_ERROR$1):(E.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(u){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},u||{});const I=this.options;I.raw&&I.windowBits>=0&&I.windowBits<16&&(I.windowBits=-I.windowBits,I.windowBits===0&&(I.windowBits=-15)),I.windowBits>=0&&I.windowBits<16&&!(u&&u.windowBits)&&(I.windowBits+=32),I.windowBits>15&&I.windowBits<48&&(I.windowBits&15)===0&&(I.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let a=inflate_1$2.inflateInit2(this.strm,I.windowBits);if(a!==Z_OK)throw new Error(messages[a]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),I.dictionary&&(typeof I.dictionary=="string"?I.dictionary=strings.string2buf(I.dictionary):toString.call(I.dictionary)==="[object ArrayBuffer]"&&(I.dictionary=new Uint8Array(I.dictionary)),I.raw&&(a=inflate_1$2.inflateSetDictionary(this.strm,I.dictionary),a!==Z_OK)))throw new Error(messages[a])}Inflate$1.prototype.push=function(u,I){const a=this.strm,E=this.options.chunkSize,_=this.options.dictionary;let k,e,n;if(this.ended)return!1;for(I===~~I?e=I:e=I===!0?Z_FINISH:Z_NO_FLUSH,toString.call(u)==="[object ArrayBuffer]"?a.input=new Uint8Array(u):a.input=u,a.next_in=0,a.avail_in=a.input.length;;){for(a.avail_out===0&&(a.output=new Uint8Array(E),a.next_out=0,a.avail_out=E),k=inflate_1$2.inflate(a,e),k===Z_NEED_DICT&&_&&(k=inflate_1$2.inflateSetDictionary(a,_),k===Z_OK?k=inflate_1$2.inflate(a,e):k===Z_DATA_ERROR&&(k=Z_NEED_DICT));a.avail_in>0&&k===Z_STREAM_END&&a.state.wrap>0&&u[a.next_in]!==0;)inflate_1$2.inflateReset(a),k=inflate_1$2.inflate(a,e);switch(k){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(k),this.ended=!0,!1}if(n=a.avail_out,a.next_out&&(a.avail_out===0||k===Z_STREAM_END))if(this.options.to==="string"){let O=strings.utf8border(a.output,a.next_out),$=a.next_out-O,N=strings.buf2string(a.output,O);a.next_out=$,a.avail_out=E-$,$&&a.output.set(a.output.subarray(O,O+$),0),this.onData(N)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(!(k===Z_OK&&n===0)){if(k===Z_STREAM_END)return k=inflate_1$2.inflateEnd(this.strm),this.onEnd(k),this.ended=!0,!0;if(a.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(u){this.chunks.push(u)},Inflate$1.prototype.onEnd=function(u){u===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg};function inflate$1(u,I){const a=new Inflate$1(I);if(a.push(u),a.err)throw a.msg||messages[a.err];return a.result}function inflateRaw$1(u,I){return I=I||{},I.raw=!0,inflate$1(u,I)}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 noLogEvents=["heartbeat","onNetQuality","networkQualityChange"],compressArrayBuffer=u=>{const I=new Uint8Array(u),a=pako.deflate(I,{gzip:!0});return new Uint8Array(a==null?void 0:a.buffer)},decompressArrayBuffer=u=>{const I=new Uint8Array(u),a=pako.inflate(I,{gzip:!0});return new Uint8Array(a==null?void 0:a.buffer)},sendMessageFormat=u=>{const{event:I}=u;switch(u.data_original=u.data,u.time&&(u.timeStr=U(u.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),I){case"login":u.data=com.quick.voice.proto.Login.encode(u.data).finish();break;case"joinRoom":case"joinRoomEx":u.data=com.quick.voice.proto.JoinReq.encode(u.data).finish();break;case"quitRoom":u.data=com.quick.voice.proto.QuitReq.encode(u.data).finish();break;case"connectCF":u.data=com.quick.voice.proto.ConnectCFReq.encode(u.data).finish(),u.data=compressArrayBuffer(u.data),u.compress=!0;break;case"publish":u.data=com.quick.voice.proto.PublishReq.encode(u.data).finish(),u.data=compressArrayBuffer(u.data),u.compress=!0;break;case"subscribe":u.data=com.quick.voice.proto.SubscribeReq.encode(u.data).finish();break;case"closeTrack":u.data=com.quick.voice.proto.CloseTrackReq.encode(u.data).finish(),u.data=compressArrayBuffer(u.data),u.compress=!0;break;case"renegotiate":u.data=com.quick.voice.proto.RenegotiateReq.encode(u.data).finish(),u.data=compressArrayBuffer(u.data),u.compress=!0;break;case"syncRoomInfo":u.data=com.quick.voice.proto.SyncRoomInfoReq.encode(u.data).finish();break;case"updateCall":u.data=com.quick.voice.proto.UpdateCall.encode(u.data).finish();break;case"networkQualityChange":u.data=com.quick.voice.proto.NetQualityChange.encode(u.data).finish();break;case"pubNotify":u.data=com.quick.voice.proto.PublishNotify.encode(u.data).finish();break;default:u.data=new Uint8Array;break}return u},onMessageFormat=u=>{const{event:I,compress:a=!1}=u;if(u.data_remote=u.data,u.time&&(u.timeStr=U(u.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),a)try{u.data=decompressArrayBuffer(u.data)}catch(E){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",E)}switch(I){case"login":u.data=com.quick.voice.proto.Login.decode(u.data);break;case"joinRoom":case"joinRoomEx":u.data=com.quick.voice.proto.JoinRsp.decode(u.data);break;case"onJoinRoom":u.data=com.quick.voice.proto.JoinNotify.decode(u.data);break;case"onQuitRoom":u.data=com.quick.voice.proto.QuitNotify.decode(u.data);break;case"connectCF":u.data=com.quick.voice.proto.ConnectCFRsp.decode(u.data);break;case"publish":u.data=com.quick.voice.proto.PublishRsp.decode(u.data);break;case"onPublish":u.data=com.quick.voice.proto.PublishNotify.decode(u.data);break;case"subscribe":u.data=com.quick.voice.proto.SubscribeRsp.decode(u.data);break;case"closeTrack":u.data=com.quick.voice.proto.CloseTrackRsp.decode(u.data);break;case"onCloseTrack":u.data=com.quick.voice.proto.CloseTrackNotify.decode(u.data);break;case"onUpdateCall":u.data=com.quick.voice.proto.UpdateCall.decode(u.data);break;case"onDestroyRoom":u.data=com.quick.voice.proto.QuitNotify.decode(u.data);break;case"onUpdatePermissions":u.data=com.quick.voice.proto.UpdatePermissions.decode(u.data);break;case"onNetQuality":u.data=com.quick.voice.proto.NetQualityNotify.decode(u.data);break;case"syncRoomInfo":u.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(u.data);break;case"onCDNPlayUrlAdd":u.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(u.data);break;case"debugger":u.data=JSON.parse(new TextDecoder().decode(u.data));break}return u};class CallsWebSocket{constructor(I){lt(this,dt);lt(this,at,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:30*1e3});lt(this,yt,"");lt(this,kt,{});lt(this,vt,{});Z(this,"state","closed");Z(this,"sendMessageBefore",async()=>{});Z(this,"onReconnectSuccess",I=>{});Z(this,"onReconnectStop",I=>{});lt(this,Ut,I=>{let a=!0;const{code:E=1e3,reason:_=""}=I;return E===1e3&&(_==="quit success!"||_==="replace old connection!")&&(a=!1),a});lt(this,Mt,async I=>{Q(this,at).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",I),this.state="connected",this.onReconnectSuccess(I)});lt(this,Pt,async I=>{Q(this,at).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",I),this.close(),this.state="closed",this.onReconnectStop(I)});lt(this,Lt,()=>{const I={event:"heartbeat",sn:+`${F(1e5,999999)}`};return com.quick.voice.proto.CommonReq.encode(I).finish()});lt(this,Nt,(I,a={})=>{try{const{time:E,event:_,data:k={},data_original:e={},data_remote:n,...O}=a,$=U(E,"YYYY-MM-DD hh:mm:ss",{offset:480});let N={};const D=(et={})=>{const tt=JSON.parse(JSON.stringify(et)),nt=Object.keys(tt);for(const _t of nt)(_t.includes("sdp")||_t.includes("Sdp"))&&(tt[_t]="");return tt};let q="res ↓";switch(I){case"res":q="res ↓",N=D(k);break;case"req":q="req ↑",N=D(e);break}let P="#quickvo.logs";ignoreEvent.includes(_)&&(P="#quickvo.ignoreEvents");const j={"#action":q,timeStr:$,event:_,data:N,time:E,...O},V=localStorage.getItem(P)||JSON.stringify([]),J=JSON.parse(V);let z=_==="heartbeat";const Y=[j];for(const et of J){const{event:tt}=et;if(tt==="heartbeat"){if(z)continue;z=!0}if(Y.length===200)break;Y.push(et)}localStorage.setItem(P,JSON.stringify(Y))}catch(E){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",E)}});lt(this,Bt,(I,{resolve:a,reject:E})=>{const{sn:_}=I,k=()=>{const n=Q(this,kt)[_];clearTimeout(n.destructionTimer),delete Q(this,kt)[_]},e=setTimeout(()=>{const n=Q(this,kt)[_];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",n.message),k(),E("event is timeout")},Q(this,at).timeout);Q(this,kt)[_]={message:I,resolve:a,reject:E,destruction:k,destructionTimer:e}});lt(this,jt,I=>Q(this,kt)[I]);lt(this,Zt,async I=>{const a=new Uint8Array(I),E=com.quick.voice.proto.CommonRsp.decode(a),{sn:_,event:k}=E,e=onMessageFormat(E);if(Q(this,at).debug&&(noLogEvents.includes(k)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",e),ignoreEvent.includes(k)||Q(this,Nt).call(this,"res",e)),notifyName_keys.includes(k))return this.emitNotify(k,L(e,["code","data","desc"]));const O=Q(this,jt).call(this,_);if(O){const{resolve:$=D=>{},destruction:N=()=>{}}=O;$(L(e,["code","data","desc"])),N()}});Z(this,"clearEvents",(I=[])=>{const a=Object.keys(Q(this,kt));I.length===0&&(I=a);for(const E of a){if(!I.includes(E))continue;const _=Q(this,kt)[E];clearTimeout(_.destructionTimer),delete Q(this,kt)[E]}});Z(this,"connect",async(I="")=>new Promise(async a=>{I&>(this,yt,I),Q(this,dt)&&(await Q(this,dt).close(),this.state="closed");const E=`${Q(this,at).url}?s=${Q(this,yt)}&t=${Date.now()}`;gt(this,dt,new M({...Q(this,at),url:E,binaryType:"arraybuffer",onMessage:Q(this,Zt),checkReconnect:Q(this,Ut),getHeartbeatMsg:Q(this,Lt),onReconnectSuccess:Q(this,Mt),onReconnectStop:Q(this,Pt)})),this.state="connecting",await Q(this,dt).connect(),this.state="connected",Q(this,at).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 当前广播事件",Q(this,vt)),a(Q(this,dt))}));Z(this,"close",async()=>{var a;Q(this,at).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const I=Object.keys(Q(this,kt));for(const E of I){const{destructionTimer:_}=Q(this,kt)[E];clearTimeout(_)}gt(this,kt,{}),await((a=Q(this,dt))==null?void 0:a.close()),gt(this,dt,void 0),this.state="closed"});Z(this,"sendMessage",(I,a=!0)=>new Promise(async(E,_)=>{var N;await this.sendMessageBefore();const{event:k,...e}=I,n=Date.now(),O=sendMessageFormat({event:k,sn:+`${n}${F(1e3,9999)}`,time:n,valid:Q(this,at).timeout,version:1,compress:!1,...e});Q(this,at).debug&&(noLogEvents.includes(k)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",O),ignoreEvent.includes(k)||Q(this,Nt).call(this,"req",O)),a&&Q(this,Bt).call(this,O,{resolve:E,reject:_});const $=com.quick.voice.proto.CommonReq.encode(O).finish();(N=Q(this,dt))==null||N.sendMessage($)}));Z(this,"emitNotify",async(I,a)=>{const E=Q(this,vt)[I]||[];for(const _ of E){const{callback:k=async()=>{}}=_;await k(a)}});Z(this,"addNotify",(I,a=!1)=>{const{event:E,sn:_=ht(32)}=I;Q(this,vt)[E]||(Q(this,vt)[E]=[]);const k=Q(this,vt)[E],e=k.findIndex(n=>n.sn===_);return e!==-1&&k.splice(e,1),a?k.unshift(I):k.push(I),_});Z(this,"removeNotify",(I=[])=>{if(I.length===0)gt(this,vt,{});else{const a=Object.keys(Q(this,vt));for(const E of a)Q(this,vt)[E]=Q(this,vt)[E].filter(_=>!I.includes(_.sn||""))}Q(this,at).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",Q(this,vt))});gt(this,at,{...Q(this,at),...I})}}dt=new WeakMap,at=new WeakMap,yt=new WeakMap,kt=new WeakMap,vt=new WeakMap,Ut=new WeakMap,Mt=new WeakMap,Pt=new WeakMap,Lt=new WeakMap,Nt=new WeakMap,Bt=new WeakMap,jt=new WeakMap,Zt=new WeakMap;var y=Object.defineProperty,x=u=>{throw TypeError(u)},g=(u,I,a)=>I in u?y(u,I,{enumerable:!0,configurable:!0,writable:!0,value:a}):u[I]=a,h=(u,I,a)=>g(u,typeof I!="symbol"?I+"":I,a),b=(u,I,a)=>I.has(u)||x("Cannot "+a),o=(u,I,a)=>(b(u,I,"read from private field"),a?a.call(u):I.get(u)),f=(u,I,a)=>I.has(u)?x("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(u):I.set(u,a),p=(u,I,a,E)=>(b(u,I,"write to private field"),I.set(u,a),a),d,c,l;class K{constructor(I){f(this,d,new Map),f(this,c,[]),h(this,"index"),h(this,"setCondition",(a,E)=>{o(this,d).set(a,E),E&&o(this,l).call(this)}),h(this,"addTask",(a,E,_={})=>{const k={key:"",strict:!1,describe:"",..._};let{key:e,strict:n,describe:O}=k;e?this.clear([e]):e=`${this.index++}`;const $={key:e,func:a,conditionKeys:E,describe:O,strict:n};return o(this,c).unshift($),this.checkConditions(E)&&(a(),n===!1&&this.clear([e])),e}),h(this,"clear",(a=[])=>{if(a.length===0){p(this,c,[]);return}for(const E of a){const _=o(this,c).findIndex(k=>k.key===E);_!==-1&&o(this,c).splice(_,1)}}),h(this,"getConditions",()=>Object.fromEntries(o(this,d))),h(this,"getTasks",()=>{const a=[];for(const E of o(this,c)){const{key:_,describe:k,conditionKeys:e}=E;a.push({key:_,describe:k,conditionKeys:e})}return a}),h(this,"checkConditions",a=>{let E=!0;for(const _ of a)if(o(this,d).get(_)===!1){E=!1;break}return E}),f(this,l,()=>{const a=o(this,c).length;for(let E=a;E>0;E--){const _=E-1,k=o(this,c)[_],{conditionKeys:e,func:n,strict:O}=k;this.checkConditions(e)&&(n(),O===!1&&o(this,c).splice(_,1))}}),this.index=0;for(const a of I)o(this,d).set(a,!0)}}d=new WeakMap,c=new WeakMap,l=new WeakMap;class RoomBase{constructor(I){Z(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:"",callType:0,debug:!1,logUrl:"https://log1.putplay.cc",newPublishAutoSubscribe:!0});Z(this,"prohibitNotify",!1);Z(this,"isEarly",!1);Z(this,"isInRoom",!1);Z(this,"taskQueue",new K(["createWs","createSession","ice","joinRoom","createTrack","subscribe","closeTrack"]));Z(this,"roomState","ready");Z(this,"createAt",Date.now());Z(this,"cwsIns");Z(this,"peerIns",new RTCPeerConnection({bundlePolicy:"max-bundle"}));Z(this,"transceiverMap",new Map);Z(this,"userMap",new Map);Z(this,"setLocalStreamActiveMap",new Map);Z(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});Z(this,"reportLogs",(I,a="未知错误")=>{const{appid:E,userId:_,earlyId:k="",logUrl:e}=this.options,n="web",O=$=>({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})[$].toString();{const $=O(I),N={origin:n,type:$,app_id:E,user_id:_,ins_id:k,desc:a},D=btoa(encodeURI(JSON.stringify(N))),q=`${e}/upload/log?log_key=${D}`;{const P=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),V=new TextEncoder().encode(P),J=pako.deflate(V,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:N,url:q,size:ot(J.byteLength)}),fetch(q,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:J})}}});lt(this,Ft,()=>{this.taskQueue.setCondition("createWs",!0),this.taskQueue.setCondition("createSession",!1),this.taskQueue.setCondition("ice",!1)});Z(this,"getRoomInfo",()=>{const{options:I,roomState:a,createAt:E}=this;return{...I,roomState:a,createAt:E}});Z(this,"setRoomState",I=>{this.roomState=I;const a=enum_roomState[I],E={state:I,stateStr:a};this.cwsIns.emitNotify("onRoomState",{code:200,data:E,desc:"room state is change."})});Z(this,"setOptions",async I=>{const a={...this.options,...I};this.options=a});Z(this,"stopStream",async I=>{const a=I.getTracks();for(const E of a)E.stop()});Z(this,"getMediaDevicesErrInfo",async()=>{try{const I=await navigator.mediaDevices.enumerateDevices();I.find(E=>E.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),I.find(E=>E.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(I){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",I)}return this.mediaDevicesErrInfo});Z(this,"getUserMediaKey",(I,a)=>`${I}-${a}`);Z(this,"getCallActionMap",(I=0)=>{const E=Number(I).toString(2).padStart(4,"0").split(""),[_,k,e,n]=E;return{microphoneCamera_audio:!!Number(n),microphoneCamera_video:!!Number(e),screenSharing_video:!!Number(k),screenSharing_audio:!!Number(_)}});Z(this,"getAverageVolume",(I,a)=>{I.getByteFrequencyData(a);let E=0;for(let k=0;k<a.length;k++)E+=a[k];return Math.ceil(E/a.length)});Z(this,"getCallAction",async I=>{let a="";const E=k=>I.findIndex(({type:n,enabled:O=!0})=>n===k&&O)===-1?"0":"1";return a=`${E(0)}${a}`,a=`${E(1)}${a}`,a=`${E(2)}${a}`,a=`${E(3)}${a}`,parseInt(a,2)});Z(this,"getTrackNamesFormTracks",(I,a=[],E="trackName")=>{const _=[];for(const k of I){const{type:e}=k;if(a.length===0||a.includes(e)){const n=k[E];n&&_.push(`${n}`)}}return _});Z(this,"usersFilter",I=>ft(I,["id","isSelf","joinTime","tracks","callAction","callActionStr","callActionMap","network","permissions","isPublished","updateStreams"]).sort((_,k)=>_.id.localeCompare(k.id,"en")));this.setOptions(I),this.cwsIns=new CallsWebSocket({...I}),Q(this,Ft).call(this)}}Ft=new WeakMap;class RoomMedias extends RoomBase{constructor(a){super(a);lt(this,Rt,[]);lt(this,wt,new Map);lt(this,bt,new Map);lt(this,St,new Map);lt(this,$t,new Map);Z(this,"localStreamsActionMap",new Map);lt(this,Ht,()=>{Q(this,bt).set("microphoneCamera_audio",{}),Q(this,bt).set("microphoneCamera_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),Q(this,bt).set("screenSharing_video",{width:{ideal:1920},height:{ideal:1080},frameRate:{min:10,ideal:30}}),Q(this,bt).set("screenSharing_audio",{})});lt(this,zt,()=>{Q(this,wt).set("audioinput","default"),Q(this,wt).set("videoinput","default"),Q(this,wt).set("audiooutput","default")});Z(this,"emitNotifyUpdateUsersStreams",async a=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:a,desc:"users streams is change."})});Z(this,"initUserMediaStreamContext",async(a,E,_)=>{var O;const[k]=_.getTracks();if(!k){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:a,mediaType:E,stream:_});return}this.removeUserMediaStreamContext(a,E);const e=this.getUserMediaKey(a,E),{kind:n}=k;switch(n){case"audio":{const $=new AudioMediaContext(k);Q(this,St).set(e,$)}break;case"video":{const $=new VideoMediaContext(k);Q(this,St).set(e,$)}break}{const $=this.getUserMediaStreamContext(a,E);if($&&$.kind==="audio")try{const N=Q(this,wt).get("audiooutput");(O=$.audioContext)==null||O.setSinkId(N)}catch(N){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error",N)}}});Z(this,"getUserMediaStreamContext",(a,E)=>{const _=this.getUserMediaKey(a,E);return Q(this,St).get(_)});Z(this,"getUserAudioMediaStreamContext",(a,E)=>{const _=this.getUserMediaKey(a,E);return Q(this,St).get(_)});Z(this,"removeUserMediaStreamContext",(a,E)=>{const _=this.getUserMediaKey(a,E),k=Q(this,St).get(_);k==null||k.stop(),Q(this,St).delete(_)});Z(this,"getUserStream",(a,E)=>{const _=this.getUserMediaStreamContext(a,E);return(_==null?void 0:_.getStream())||new MediaStream});Z(this,"getUserStreams",(a,E=[])=>{E.length===0&&(E=mediaType_keys);const _={};for(const k of E){const e=this.getUserStream(a,k);_[k]=e}return _});Z(this,"removeUserStreams",async(a,E=[])=>{E.length===0&&(E=mediaType_keys);for(const _ of E)this.removeUserMediaStreamContext(a,_)});Z(this,"clearUserStreams",()=>{const a=Q(this,St).values();for(const E of a)E.stop();gt(this,St,new Map)});Z(this,"setMediaTrackConstraints",async(a,E)=>{Q(this,bt).set(a,E);const k=this.getUserStream(this.options.userId,a).getTracks();if(k.length!==0)for(const e of k){const O={...e.getConstraints(),...E};await e.applyConstraints(O)}});Z(this,"stopLocalStreams",async(a=[])=>{a.length===0&&(a=mediaType_keys);for(const E of a){const _=Q(this,$t).get(E);_&&await this.stopStream(_),Q(this,$t).delete(E)}});Z(this,"addLocalStream",(a,E)=>{const _=Q(this,$t).get(a);_&&this.stopStream(_),Q(this,$t).set(a,E)});Z(this,"initLocalStream",async a=>{switch(a){case"microphoneCamera_audio":{const E=Q(this,wt).get("audioinput"),_=Q(this,bt).get("microphoneCamera_audio"),k=await navigator.mediaDevices.getUserMedia({audio:{deviceId:E,..._},video:!1});this.addLocalStream("microphoneCamera_audio",k)}break;case"microphoneCamera_video":{const E=Q(this,wt).get("videoinput"),_=Q(this,bt).get("microphoneCamera_video"),k=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:E,..._}});this.addLocalStream("microphoneCamera_video",k)}break;case"microphoneCamera":{const E=Q(this,wt).get("audioinput"),_=Q(this,wt).get("videoinput"),k=Q(this,bt).get("microphoneCamera_audio"),e=Q(this,bt).get("microphoneCamera_video"),O=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:E,...k},video:{deviceId:_,...e}})).getTracks();for(const $ of O){const{kind:N}=$;if(N==="audio"){const D=new MediaStream;D.addTrack($),this.addLocalStream("microphoneCamera_audio",D)}if(N==="video"){const D=new MediaStream;D.addTrack($),this.addLocalStream("microphoneCamera_video",D)}}}break;case"screenSharing_audio":{const E=Q(this,bt).get("screenSharing_audio"),k=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...E})).getTracks();for(const e of k){const{kind:n}=e;if(n==="audio"){const O=new MediaStream;O.addTrack(e),this.addLocalStream("screenSharing_audio",O)}}}break;case"screenSharing_video":{const E=Q(this,bt).get(a),k=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...E})).getTracks();for(const e of k){const{kind:n}=e;if(n==="video"){const O=new MediaStream;O.addTrack(e),this.addLocalStream("screenSharing_video",O)}}}break;case"screenSharing":{const E=Q(this,bt).get("screenSharing_audio"),_=Q(this,bt).get("screenSharing_video"),e=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...E,..._})).getTracks();for(const n of e){const{kind:O}=n;if(O==="audio"){const $=new MediaStream;$.addTrack(n),this.addLocalStream("screenSharing_audio",$)}if(O==="video"){const $=new MediaStream;$.addTrack(n),this.addLocalStream("screenSharing_video",$)}}}break}});Z(this,"getLocalStream",a=>Q(this,$t).get(a));Z(this,"getLocalStreams",(a=[])=>{a.length===0&&(a=mediaType_keys);const E={};for(const _ of a)E[_]=this.getLocalStream(_);return E});lt(this,Et,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(a=>{gt(this,Rt,a)}).catch(function(a){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",a)}),Q(this,Rt)));lt(this,Jt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await Q(this,Et).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),Q(this,Et).call(this)});Z(this,"getMediaDeviceKind",a=>Q(this,wt).get(a));Z(this,"setDeviceKind",async(a,E)=>{if(Q(this,wt).set(a,E),a==="audiooutput"){const _=Q(this,St).values();for(const k of _)if(k.kind==="audio"&&"setSinkId"in HTMLMediaElement.prototype)try{k.audioContext.setSinkId(E)}catch(e){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",e)}}});Z(this,"setAudioOutputDevice",a=>this.setDeviceKind("audiooutput",a));Z(this,"getEnumerateDevices",async a=>(await Q(this,Et).call(this),Q(this,Rt).filter(_=>_.kind===a)));Z(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));Z(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));Z(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));Q(this,Jt).call(this),Q(this,zt).call(this),Q(this,Ht).call(this)}}Rt=new WeakMap,wt=new WeakMap,bt=new WeakMap,St=new WeakMap,$t=new WeakMap,Ht=new WeakMap,zt=new WeakMap,Et=new WeakMap,Jt=new WeakMap;class RoomUsers extends RoomMedias{constructor(a){super(a);Z(this,"getMaxVolumeUser",()=>{const a=Array.from(this.userMap.values(),({id:_})=>_);if(a.length===0)return;let E=[];for(const _ of a){const k=this.getUserMediaStreamContext(_,"microphoneCamera_audio");if(!k||k.kind!=="audio")continue;const e=k.getVolume();E.push({id:_,volume:e})}return E=E.sort((_,k)=>_.volume-k.volume>0?-1:1),E[0]});Z(this,"setAudioFilter",async(a={})=>{const E=await this.getUsersId();for(const _ of E){{const k=this.getUserMediaStreamContext(_,"microphoneCamera_audio");(k==null?void 0:k.kind)==="audio"&&(k==null||k.setFilter(a))}{const k=this.getUserMediaStreamContext(_,"screenSharing_audio");(k==null?void 0:k.kind)==="audio"&&(k==null||k.setFilter(a))}}});Z(this,"setEnhanceGain",async(a,E,_)=>{const k=this.getUserMediaStreamContext(a,E);(k==null?void 0:k.kind)==="audio"&&(k==null||k.setEnhanceGain(_))});Z(this,"setVolume",(a,E,_)=>{const k=this.getUserMediaStreamContext(a,E);(k==null?void 0:k.kind)==="audio"&&(k==null||k.setVolumeGain(_))});Z(this,"getVolume",(a,E)=>{const _=this.getUserMediaStreamContext(a,E);let k=0;return(_==null?void 0:_.kind)==="audio"&&(k=_==null?void 0:_.getVolume()),k});Z(this,"clearUsers",()=>{this.userMap=new Map});Z(this,"removeUsers",async a=>{for(const E of a)this.userMap.delete(E),await this.removeUserStreams(E)});Z(this,"createUser",async a=>{const E=Date.now(),_={id:a,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isSelf:a===this.options.userId,isPublished:!1,joinTime:E,updateAt:E,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(a,_)});Z(this,"getUser",async a=>(this.userMap.has(a)||await this.createUser(a),this.userMap.get(a)));Z(this,"getUsers",async(a=[])=>{a.length===0&&(a=[...this.userMap.keys()]);const E=[];for(const _ of a){const k=await this.getUser(_);E.push(k)}return E});Z(this,"getAllUserTrackMids",async()=>{const a=await this.getUsers(),E=[];for(const _ of a){const{tracks:k=[]}=_;for(const e of k)E.push(e.mid)}return E});Z(this,"getUserTrackByTrackName",async a=>{const E=await this.getUsers(),_=[];for(const k of E){const{tracks:e=[]}=k;for(const n of e){const{trackName:O}=n;a.includes(O)&&_.push(n)}}return _});Z(this,"getUserTrackFromMid",async a=>{const E=await this.getUsers();let _;for(const k of E){const{tracks:e=[]}=k;for(const n of e)if(n.mid===a){_=n;break}}return _});Z(this,"checkUserInRoom",a=>this.userMap.has(a));Z(this,"getUsersId",async()=>[...this.userMap.keys()]);Z(this,"getCaller",async()=>await this.getUser(this.options.userId));Z(this,"updateIsPublished",async(a,E=!1)=>{const _=await this.getUser(a);_.isPublished=E});Z(this,"setUserUpdateStreams",async(a,E,_=!0)=>{const k=await this.getUser(a),e={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};e[E]=_,k.updateStreams=e});Z(this,"updateUsertracks",async(a,E=[],_)=>{const k=await this.getUser(a);_&&(E=[...k.tracks,...E]),E=E.filter(({mid:O=""})=>O!==""),E=mt(E,["type"]),E=E.sort((O,$)=>O.type-$.type<0?-1:1);for(const O of E)O.userId=a,O.mediaType=mediaType_keys[O.type],O.enabled===void 0&&(O.enabled=!0);k.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const e=ft(k.tracks,["mediaType","enabled","mid","msid","trackName"]),n=ft(E,["mediaType","enabled","mid","msid","trackName"]);{const O="microphoneCamera_audio",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="microphoneCamera_video",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="screenSharing_audio",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="screenSharing_video",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}k.tracks=E});Z(this,"updateUserCallAction",async(a,E=0)=>{const _=await this.getUser(a);_.callAction=E,_.callActionStr=E.toString(2).padStart(4,"0"),_.callActionMap=this.getCallActionMap(E)});Z(this,"updateUserNetwork",async(a,E={egress:5,ingress:5})=>{const _=await this.getUser(a);_.network=E});Z(this,"updateUserPermissions",async(a,E)=>{if(E){const _=await this.getUser(a);_.permissions=E}});Z(this,"updateUserBase",async a=>{const E=await this.getUser(a);E.isSelf=a===this.options.userId,E.updateAt=Date.now()});Z(this,"updateUsers",async a=>{for(const E of a){const{id:_,tracks:k,callAction:e,permissions:n,isPublished:O}=E;await this.updateUserBase(_),await this.updateIsPublished(_,O),await this.updateUserPermissions(_,n),await this.updateUsertracks(_,k,!0),await this.updateUserCallAction(_,e),await this.updateUserNetwork(_)}});Z(this,"emitNotifyUpdateUser",async a=>{const E=await this.getUsers([a]),[_]=this.usersFilter(E);this.cwsIns.emitNotify("onRoomUser",{code:200,data:_,desc:"user info is change."})});Z(this,"emitNotifyUpdateUsers",async()=>{const a=await this.getUsers(),E=this.usersFilter(a);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:E,desc:"all users info is change."})})}}const createMutedAudioStream=()=>{const u=new AudioContext,I=u.createOscillator();I.type="sine",I.frequency.setValueAtTime(0,u.currentTime);const a=u.createGain();a.gain.value=0,I.connect(a),a.connect(u.destination),I.start();const E=u.createMediaStreamDestination();return a.disconnect(),I.connect(E),E.stream},createFakeVideoStream=(u=10,I=10,a=30)=>{const E=document.createElement("canvas"),_=E.getContext("2d");E.width=u,E.height=I;let k=0;return setInterval(()=>{_.clearRect(0,0,E.width,E.height);const O=_.createLinearGradient(0,0,E.width,E.height);O.addColorStop(0,`hsla(${k}, 100%, 50%, 0)`),O.addColorStop(1,`hsla(${k+120}, 100%, 50%, 0)`),_.fillStyle=O,_.fillRect(0,0,E.width,E.height),k=(k+1)%360},100),E.captureStream(a)};class RoomPeer extends RoomUsers{constructor(a){super(a);lt(this,Ot,new Map);Z(this,"getPeerStatsTimer",0);Z(this,"reports",[]);Z(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Z(this,"initPeer",()=>{this.peerIns=new RTCPeerConnection({bundlePolicy:"max-bundle"}),this.transceiverMap=new Map,Q(this,Kt).call(this),Q(this,Qt).call(this)});lt(this,Wt,()=>{for(const a of mediaType_keys){const E=Q(this,Ot).get(a);if(E){const _=E.getTracks();for(const k of _)k.stop()}switch(a){case"microphoneCamera_audio":Q(this,Ot).set("microphoneCamera_audio",createMutedAudioStream());break;case"microphoneCamera_video":Q(this,Ot).set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":Q(this,Ot).set("screenSharing_audio",createMutedAudioStream());break;case"screenSharing_video":Q(this,Ot).set("screenSharing_video",createFakeVideoStream());break}}});lt(this,At,a=>Q(this,Ot).get(a));Z(this,"replaceSenderStream",async(a=[],E)=>{const{userId:_}=this.options;a.length===0&&(a=mediaType_keys);for(const k of a){const e=this.transceiverMap.get(k);let n;if(e){const{sender:O}=e;E?n=this.getUserStream(_,k):n=Q(this,At).call(this,k);const[$]=n.getTracks();$&&await O.replaceTrack($)}}});Z(this,"getSenderTracks",async(a=[])=>{const E=[];for(const _ of a){const k=this.transceiverMap.get(_);if(!k)continue;const{mid:e,sender:n}=k,{track:O}=n;if(!O)continue;const{id:$,enabled:N}=O,q={type:mediaType_keys.findIndex(P=>P===_),enabled:N,trackName:$,location:"local",mid:e};E.push(q)}return E});Z(this,"addSenders",async(a=[])=>{a.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const E=[];for(const _ of a){if(this.transceiverMap.get(_))continue;const e=Q(this,At).call(this,_),[n]=e.getTracks(),O=this.peerIns.addTransceiver(n,{direction:"sendonly"});this.transceiverMap.set(_,O),E.push(_)}if(a.length===0||E.length!==0){const _=await this.peerIns.createOffer();if(this.options.debug){const k=libExports.parse(_.sdp),e=ft(k.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:e,sdpJson:k,description:_})}await this.peerIns.setLocalDescription(_)}return E});Z(this,"removeSenders",async(a=[])=>{a.length===0&&(a=mediaType_keys);for(const E of a)this.transceiverMap.has(E)&&this.transceiverMap.delete(E)});Z(this,"clearTransceivers",async()=>{const a=await this.getAllUserTrackMids(),E=this.peerIns.getTransceivers();for(const _ of E){const{mid:k}=_;Number(k)===0||a.includes(k)||(_.stop(),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: clearTransceivers: ${k} is stop.`,_))}});Z(this,"onSubscribeUserTracks",a=>{let E=0;return new Promise(async _=>{const k=[];for(const e of a){const{tracks:n=[]}=e;for(const O of n){const{trackName:$,mid:N}=O,[D]=await this.getUserTrackByTrackName([$]);k.push({...D,mid:N})}}{let e=[];const n=async()=>{clearTimeout(E);const $=new Map;for(const D of e){const{userId:q,mediaType:P}=D;if(!q||!P)continue;$.has(q)||$.set(q,{userId:q,tracks:[],updateStreams:{}});const V=$.get(q);V.tracks.push(D),V.updateStreams[P]=!0}const N=[...$.values()];for(const D of N){const{userId:q,tracks:P}=D;await this.updateUsertracks(q,P,!0)}await this.emitNotifyUpdateUsersStreams(N),this.peerIns.removeEventListener("track",O),_(!0)},O=async $=>{const{streams:N,transceiver:D}=$,[q]=N,{mid:P,receiver:j}=D,{track:V}=j,{id:J,kind:z}=V,Y=k.find(nt=>nt.mid===`${P}`);if(!Y)return;const{userId:et,mediaType:tt}=Y;if(!(!et||!tt)){if(await this.initUserMediaStreamContext(et,tt,q),z==="audio"){const nt=this.getUserMediaStreamContext(et,tt);(nt==null?void 0:nt.kind)==="audio"&&nt.setMute(!1)}{const nt={...Y,mid:P,msid:J};e.push(nt)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${e.length}/${k.length}`,{mediaType:tt,mid:P,userTrack:Y,e:$}),k.length===e.length&&n()}};this.peerIns.addEventListener("track",O),E=setTimeout(()=>n(),5*1e3)}})});lt(this,Kt,()=>{let a=0;const E=()=>{this.setRoomState("closed")};this.peerIns.oniceconnectionstatechange=()=>{const _=this.peerIns.iceConnectionState;switch(this.taskQueue.setCondition("ice",!1),clearTimeout(a),_){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${_}`),this.taskQueue.setCondition("ice",!0);break;case"disconnected":a=setTimeout(E,30*1e3),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${_}`);break;case"failed":this.peerIns.restartIce();break;case"closed":E(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${_}`);break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${_}`);break}}});Z(this,"closeUserTracks",async(a,E=[],_=!1)=>{const k=[];for(const $ of E){const{mid:N,trackName:D,msid:q}=$;k.push(D),N&&k.push(N),q&&k.push(q)}const e=$=>k.includes($),n=this.peerIns.getTransceivers();for(const $ of n){const{mid:N}=$;N&&e(N)&&($.stop(),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver: ${N} is stop.`,$))}const O=await this.getUser(a);if(O){for(const $ of O.tracks){const{trackName:N,msid:D,userId:q,mediaType:P}=$;!q||!P||!e(N)||(this.removeUserMediaStreamContext(q,P),D&&delete $.msid)}if(_){const $=O.tracks.filter(({trackName:N})=>!e(N));await this.updateUsertracks(a,$,!1)}}});Z(this,"createOffer",async()=>{const a=await this.peerIns.createOffer();if(this.options.debug){const E=libExports.parse(a.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:_,sdpJson:E,description:a})}await this.peerIns.setLocalDescription(a)});Z(this,"createAnswer",async()=>{const a=await this.peerIns.createAnswer();if(this.options.debug){const E=libExports.parse(a.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:_,sdpJson:E,description:a})}await this.peerIns.setLocalDescription(a)});Z(this,"getSdp",()=>{var a;return(a=this.peerIns.localDescription)==null?void 0:a.sdp});Z(this,"setRemoteDescription",async a=>{if(this.options.debug){const E=libExports.parse(a.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:_,sdpJson:E,description:a})}return await this.peerIns.setRemoteDescription(a),a});Z(this,"getPeerNetwork",()=>this.peerNetwork);Z(this,"setCallStrategy",async(a,E=[])=>{E.length===0&&(E=mediaType_keys);let _="balanced";switch(a){case"qualityPriority":_="maintain-resolution";break;case"fluencyPriority":_="maintain-framerate";break;case"balancedDowngrade":_="balanced";break}const k=await this.getCaller(),e=Array.from(k.tracks,({trackName:O})=>O),n=this.peerIns.getSenders();for(const O of n){const{track:$}=O;if(!$||!e.includes($.id))continue;const N=O.getParameters();O.setParameters({...N,degradationPreference:_})}});Z(this,"setRTCRtpSenderParameters",a=>{try{const E=this.peerIns.getSenders();for(const _ of E){const k=_.getParameters();_.setParameters({...k,...a})}}catch(E){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",E)}});Z(this,"getReportsByMid",async(a=[])=>a.length===0?this.reports:this.reports.filter(E=>a.includes(E.mid)));Z(this,"getRoomNetwork",()=>this.peerNetwork);lt(this,Gt,async()=>{try{const a=await this.peerIns.getStats(),E=["inbound-rtp","remote-inbound-rtp","outbound-rtp"],k=[...a.values()].filter(nt=>E.includes(nt.type));let e=0,n=0,O=0,$=0,N=0,D=0,q=[],P=[];for(const nt of this.reports){const{packetsSent:_t,packetsLost:it}=nt;_t&&(O+=_t),it&&($+=it)}this.reports=k;for(const nt of this.reports){const{bytesReceived:_t,bytesSent:it,packetsSent:ut,packetsLost:st,jitter:rt,roundTripTime:ct}=nt;_t&&(e=_t),it&&(n=it),ut&&(N+=ut),st&&(D+=st),ct&&q.push((ct*100).toFixed(2)),rt&&P.push(rt.toFixed(2))}P.sort().reverse(),q.sort().reverse();const j=N-O,V=D-$,J=j===0?"0.00":(V/j).toFixed(2),[z="0"]=q,[Y="0"]=P,et={inboundBytes:e,outboundBytes:n,lostRate:J,roundTripTime:z,jitter:Y};this.peerNetwork=et;const tt=(nt,_t,it)=>{const ut=Number(nt),st=Number(_t),rt=Number(it);let ct="0";return ut<.03&&st<100&&rt<.05?ct="5":ut<.06&&st<160&&rt<.1?ct="4":ut<.1&&st<250&&rt<.15?ct="3":ut<.15&&st<400&&rt<.2?ct="2":ct="1",Number(ct)};{const nt=tt(J,z,Y),_t=await this.getCaller(),{network:it}=_t,ut={egress:nt,ingress:nt},st=JSON.stringify(it)!==JSON.stringify(ut);if(await this.updateUserNetwork(this.options.userId,ut),st){this.emitNotifyUpdateUsers();const{userId:rt,roomId:ct}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...ut,userId:rt,roomId:ct}},!1)}}}catch(a){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",a)}});lt(this,Qt,()=>{const a=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||Q(this,Gt).call(this)};this.getPeerStatsTimer=setInterval(a,1*1e3)});Z(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer));Q(this,Wt).call(this)}}Ot=new WeakMap,Wt=new WeakMap,At=new WeakMap,Kt=new WeakMap,Gt=new WeakMap,Qt=new WeakMap;class RoomCalls extends RoomPeer{constructor(a){super(a);Z(this,"sdk_service_version","1.0.5");lt(this,Vt,async a=>{const{roomId:E}=this.options;if(!E)return;const{id:_,tracks:k=[]}=await this.getCaller();if(k.length===0)return;const e=k.filter(n=>n.mediaType&&a.includes(n.mediaType));this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:E,user:{id:_,tracks:e}}})});lt(this,xt,async a=>new Promise(async(E,_)=>{const{roomId:k,userId:e}=this.options,n={roomId:k,user:{id:e,callAction:a}};await this.cwsIns.sendMessage({event:"updateCall",data:n}).then(async O=>{const{code:$=0}=O;if($!==200)return _(O);await this.updateUserCallAction(e,a),E(a)}).catch(O=>_(O))}));lt(this,qt,()=>new Promise(async(a,E)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return a(!0);this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:_}=this.options,{userId:k="",sdkToken:e,roomId:n}=this.options;if(!_)return E("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const O={a:e,b:k,c:_,r:n,v:this.sdk_service_version};if(this.isEarly){const N=ht();O.i=N,this.setOptions({earlyId:N})}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",O);const $=btoa(encodeURI(JSON.stringify(O)));await this.cwsIns.connect($),this.taskQueue.setCondition("createWs",!0),a(!0)}catch(_){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",_),this.reportLogs("ws_c_timeout",_.message||_),E(_)}}));lt(this,Dt,()=>{if(!["connecting","connected"].includes(this.roomState))return this.setRoomState("connecting"),new Promise(a=>{const E=async()=>{try{this.taskQueue.setCondition("createSession",!1),await this.addSenders(),await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async _=>{const{code:k=0,desc:e,data:n}=_;if(k!==200)throw new Error(e);const{remoteSdp:O}=n;this.taskQueue.setCondition("ice",!1),await this.setRemoteDescription({type:"answer",sdp:O}),this.taskQueue.setCondition("createSession",!0);{let $=0;$=setTimeout(()=>{this.reportLogs("webrtc_c_timeout","ice连接无响应(30s)")},3e4);const N=()=>clearTimeout($);this.taskQueue.addTask(N,["ice"],{describe:"createSession"})}a(!0)})}catch(_){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo create session is error.",_),this.taskQueue.setCondition("createSession",!0),this.reportLogs("ws_c_timeout",_.message||_)}};this.taskQueue.addTask(E,["createWs"],{key:"createSession",describe:"createSession"})})});Z(this,"earlyConnect",(a=[])=>{this.isEarly=!0,Q(this,qt).call(this),Q(this,Dt).call(this),a.length===0&&(a=["microphoneCamera_audio","microphoneCamera_video"]),Q(this,Ct).call(this,a)});lt(this,Ct,async a=>new Promise(E=>{const _=async()=>{try{this.taskQueue.setCondition("createTrack",!1);const k=await this.addSenders(a),e=await this.getSenderTracks(k);if(e.length===0)return this.taskQueue.setCondition("createTrack",!0),E(!0);await this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:e,callAction:0}}).then(async n=>{const{code:O=0,desc:$,data:N}=n;if(O!==200)throw new Error($);const{remoteSdp:D}=N;await this.setRemoteDescription({type:"answer",sdp:D}),this.taskQueue.setCondition("createTrack",!0),E(!0)})}catch(k){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createTrack is error.",k),await this.removeSenders(a),this.taskQueue.setCondition("createTrack",!0),this.reportLogs("publish_error",k.message||k),E(!0)}};this.taskQueue.addTask(_,["createWs","createSession","ice","subscribe","createTrack","closeTrack"],{describe:"createTrack"})}));Z(this,"setLocalStream",(a,E)=>new Promise(async(_,k)=>{try{typeof a=="string"&&(a=[a]);const{userId:e=""}=this.options;for(const O of a)this.localStreamsActionMap.set(O,E);if(E){if(a.includes("microphoneCamera_audio")&&a.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):a.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):a.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):a.includes("screenSharing_audio")&&a.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):a.includes("screenSharing_audio")&&!a.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):a.includes("screenSharing_video")&&!a.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),a.includes("screenSharing_audio")){const $=this.getUserStream(e,"screenSharing_audio").getTracks();for(const N of $)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}if(a.includes("screenSharing_video")){const $=this.getUserStream(e,"screenSharing_video").getTracks();for(const N of $)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}else await this.stopLocalStreams(a);const n=this.getLocalStreams(a);this.cwsIns.emitNotify("onLocalStream",{code:200,data:n,desc:"local stream is change."}),_(n)}catch(e){k(e)}}));Z(this,"setMediaDeviceKind",async(a,E)=>new Promise(async(_,k)=>{await this.setDeviceKind(a,E);const e=await this.getCaller(),{id:n,tracks:O=[],callActionMap:$}=e,N=[],D=async q=>{if(this.localStreamsActionMap.get(q)){N.push(q),await this.stopLocalStreams([q]);try{await this.initLocalStream(q)}catch(J){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",J),await this.inactiveTracks([q],!1),k(J)}}const j=O.find(J=>J.mediaType===q),V=$[q];if(j){const J=this.getLocalStream(q);if(J){const z=this.getUserMediaStreamContext(n,q);z==null||z.replaceStream(J),V&&await this.replaceSenderStream([q],!0)}}};a==="audioinput"&&await D("microphoneCamera_audio"),a==="videoinput"&&await D("microphoneCamera_video");{const q=this.getLocalStreams(N);this.cwsIns.emitNotify("onLocalStream",{code:200,data:q,desc:"local stream is change."}),_(q)}}));Z(this,"changeScreenSharing",async a=>{const E=await this.getCaller(),{tracks:_=[],callActionMap:k}=E;try{await this.setLocalStream(a,!0);for(const e of a)_.find(O=>O.mediaType===e&&k[e])&&await this.replaceSenderStream([e],!0)}catch(e){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",e)}});Z(this,"joinRoom",async a=>(this.setOptions(a),await Q(this,qt).call(this),new Promise((E,_)=>{this.clearUsers();let k="";const e=async()=>{this.taskQueue.clear([k]),await this.emitNotifyUpdateUsers();const O=await this.getUsers();this.taskQueue.setCondition("joinRoom",!0),E(O)},n=async()=>{try{this.taskQueue.setCondition("joinRoom",!1);const{roomId:O,userId:$,callType:N}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:N,roomId:O,user:{id:$,tracks:[],callAction:0}}}).then(async D=>{const{code:q=0,desc:P="服务器繁忙",data:j}=D;if(q!==200)return _(P);const{roomId:V="",roomUsers:J=[]}=j;if(V!==O)return _("加入的房间不匹配");this.isInRoom=!0,Q(this,Dt).call(this),await this.updateUsers(J),e()})}catch(O){this.taskQueue.setCondition("joinRoom",!0),this.reportLogs("join_room_error",O.message||O),_(`加入房间失败: ${O.message||O||"服务器繁忙"}`)}};k=this.taskQueue.addTask(n,["createWs","joinRoom"],{describe:"joinRoom",strict:!0})})));Z(this,"quitRoom",()=>new Promise(async a=>{const{roomId:E,userId:_}=this.options,k={roomId:E,user:{id:_}};try{this.isInRoom=!1,await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(e){this.reportLogs("quit_room_error",e.message||e)}await new Promise(e=>setTimeout(()=>e(!0),300)),this.taskQueue.setCondition("closeTrack",!0),this.cwsIns.sendMessage({event:"quitRoom",data:k}),a(!0)}));Z(this,"quitRoomEx",()=>new Promise(async a=>{const{roomId:E,userId:_}=this.options,k={roomId:E,user:{id:_}};try{this.isInRoom=!1,await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(e){this.reportLogs("quit_room_error",e.message||e)}await new Promise(e=>setTimeout(()=>e(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:k}),a(!0)}));Z(this,"syncRoomInfo",()=>new Promise((a,E)=>{const _=async()=>{const{userId:k}=this.options,e=await this.getUser(k),{id:n=k,callAction:O=0}=e;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:n,callAction:O}}}).then(async $=>{if($.code!==200)return E($.desc);const N=$.data.users;this.clearUsers(),await this.updateUsers(N),await this.updateUsertracks(e.id,e.tracks,!1),await this.subscribe();{const D=await this.getUsers();a(D)}}).catch($=>E($))};this.taskQueue.addTask(_,["createWs"],{describe:"syncRoomInfo"})}));Z(this,"publish",a=>new Promise(async(E,_)=>{const k=async()=>{try{const e=await this.getCaller();try{await this.setLocalStream(a,!0)}catch(q){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",q)}const n=[];for(const q of a){const P=this.getLocalStream(q);P?await this.initUserMediaStreamContext(e.id,q,P):n.push(q)}const O=a.filter(q=>!n.includes(q)||["microphoneCamera_audio","microphoneCamera_video"].includes(q));await this.replaceSenderStream(a,!1),await Q(this,Ct).call(this,O);const $=await this.getSenderTracks(O),N=[...e.tracks,...$];await this.updateUsertracks(e.id,N,!0);const D=await this.getCallAction(N);await Q(this,xt).call(this,D),n.length!==0&&await this.inactiveTracks(n,!1),O.length!==0&&await this.replaceSenderStream(O,!0),Q(this,Vt).call(this,a);{await this.emitNotifyUpdateUsers();const q=await this.getCaller();E(q)}}catch(e){this.reportLogs("publish_error",e.message||e),_(`publish is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","joinRoom","createTrack","subscribe"],{describe:"replaceSenderStream"})}));Z(this,"stopPublish",(a=[])=>new Promise((E,_)=>{const k=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getCaller();a.length===0&&(a=mediaType_keys);const n=e.tracks.filter(({mediaType:$})=>$&&a.includes($)),O=async()=>{this.taskQueue.setCondition("closeTrack",!0);const $=await this.getCaller();await this.emitNotifyUpdateUsers(),E($)};if(n.length===0)return O();await this.replaceSenderStream(a,!0),await this.closeUserTracks(e.id,n,!0),await this.removeSenders(a);{const $=await this.getCallAction(e.tracks);await Q(this,xt).call(this,$)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:n}}).then(async $=>{const{remoteSdp:N}=$.data;await this.setRemoteDescription({type:"answer",sdp:N})}),O()}catch(e){this.taskQueue.setCondition("closeTrack",!0),this.reportLogs("close_track_error",e.message||e),_(`stop publish is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","createTrack","subscribe"],{describe:"stopPublish"})}));Z(this,"subscribe",(a=[],E=3)=>new Promise((_,k)=>{const e=async()=>{try{this.taskQueue.setCondition("subscribe",!1);const n=await this.getUsers();let O=[];for(const q of n){const{isSelf:P,tracks:j=[]}=q;if(!P){const V=j.filter(({trackName:J,mid:z=""})=>z!==""&&(a.includes(J)||a.length===0));V.length!==0&&O.push({...q,tracks:V})}}const $=async()=>{const q=Array.from(O,({id:j})=>j),P=await this.getUsers(q);await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("subscribe",!0),_(P)};if(O.length===0)return $();const N=[];for(const q of O){const{id:P,tracks:j}=q,V=ft(j,["type","trackName"]),J={id:P,tracks:V};N.push(J)}const D=async()=>{this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: surplus subscribe count is ${E}`),await this.cwsIns.sendMessage({event:"subscribe",data:{users:N}}).then(async q=>{const{code:P=0,data:j,desc:V}=q;if(P!==200){if(E>0)return await new Promise(Y=>setTimeout(()=>Y(!0),300)),E=E-1,D();throw this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: subscribe is error. count 0",{trackNames:a}),new Error(V)}const{remoteSdp:J,users:z=[]}=j;this.onSubscribeUserTracks(z).then(async()=>{await this.renegotiate(),$()}),await this.setRemoteDescription({type:"offer",sdp:J})})};await D()}catch(n){this.taskQueue.setCondition("subscribe",!0),this.reportLogs("subscribe_error",n.message||n),k(`subscribe is error: ${n.message||n}`)}};this.taskQueue.addTask(e,["createWs","createSession","ice","createTrack","closeTrack"],{describe:"subscribe"})}));Z(this,"renegotiate",()=>new Promise(async(a,E)=>{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(_=>{if(_.code!==200)return E("协商流错误");a(!0)}).catch(_=>{console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",_),E(`协商流错误: ${_.message||_}`)})}));Z(this,"stopSubscribe",(a=[])=>new Promise((E,_)=>{const k=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getUsers(),n=[];for(const $ of e){const{tracks:N=[]}=$;for(const D of N){const{type:q,mid:P,trackName:j,mediaType:V,msid:J}=D;if(!(!V||!J)&&(a.length===0||a.includes(j))){const z={type:q,mid:P,trackName:J};n.push(z),await this.closeUserTracks($.id,[D])}}}const O=async()=>{await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("closeTrack",!0),E(!0)};if(n.length===0)return O();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:n}}).then(async $=>{const{remoteSdp:N}=$.data;await this.setRemoteDescription({type:"answer",sdp:N})}),O()}catch(e){this.taskQueue.setCondition("closeTrack",!0),this.reportLogs("close_track_error",e.message||e),_(`stop subscribe is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","createTrack","subscribe"],{describe:"closeTrack"})}));Z(this,"inactiveTracks",async(a,E)=>new Promise(async _=>{const k=await this.getCaller();if(!k||!k.id)return _(!0);const{tracks:e=[]}=k,n=[...e];await this.replaceSenderStream(a,!0);for(let $ of n){const{mediaType:N}=$;if(N&&a.includes(N)){$.enabled=E;const q=this.getUserStream(k.id,N).getTracks();for(const P of q)P.enabled=E}}const O=await this.getCallAction(n);await Q(this,xt).call(this,O),E===!1&&await this.replaceSenderStream(a,!1),await this.emitNotifyUpdateUsers(),_(!0)}));Z(this,"debugger",()=>new Promise(async(a,E)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async _=>{if(_.code!==200)return E(_.desc);a(!0)}).catch(_=>{E(_)})}))}}Vt=new WeakMap,xt=new WeakMap,qt=new WeakMap,Dt=new WeakMap,Ct=new WeakMap;class Room extends RoomCalls{constructor(I){super(I)}}class QuickVO extends Room{constructor(a){super(a);lt(this,Tt,new Map);lt(this,Yt,()=>{{const a=async E=>{const{qualities:_=[]}=E.data,[k]=_;if(!(k&&k.userId===this.options.userId&&_.length===1)){for(const e of _){const{userId:n,egress:O,ingress:$}=e;this.checkUserInRoom(n)&&await this.updateUserNetwork(n,{egress:O,ingress:$})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:a},!0)}{const a=async E=>{const _=E.data.user;await this.updateUsers([_]),await this.updateUsertracks(_.id,_.track,!1),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:a},!0)}{const a=async E=>{await this.removeUsers([E.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:a},!0)}{const a=async E=>{const{user:_}=E.data,{id:k,tracks:e=[],callAction:n=0}=_;await this.updateUserCallAction(k,n),await this.updateUserPermissions(k,3);const O=[];{const{tracks:$}=await this.getUser(k);for(const N of e){const{mid:D,trackName:q}=N;if($.find(j=>j.mid===D&&j.trackName===q))continue;O.push(N)}}if(O.length!==0)if(await this.updateUsertracks(k,O,!0),this.options.newPublishAutoSubscribe){const $=this.getTrackNamesFormTracks(O);await this.subscribe($)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:a},!0)}{const a=async E=>{const{id:_,tracks:k}=E.data.user;_!==this.options.userId&&(await this.closeUserTracks(_,k,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:a},!0)}{const a=async E=>{const{id:_,callAction:k}=E.data.user;this.checkUserInRoom(_)&&(await this.updateUserCallAction(_,k),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:a},!0)}{const a=async E=>{const{user:_}=E.data,{id:k,permissions:e=1}=_;e===1?await this.removeUsers([k]):e===3&&await this.updateUsers([_]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:a},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async a=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});Z(this,"addNotify",a=>this.cwsIns.addNotify(a));lt(this,Xt,()=>{});lt(this,te,()=>{this.cwsIns.onReconnectSuccess=async()=>{await this.syncRoomInfo()}});lt(this,ee,async()=>{});Z(this,"addRequestAnimationFrame",async(a,E)=>{{const k=Q(this,Tt).get(a);k&&cancelAnimationFrame(k)}const _=(k=Date.now())=>{E(k);const e=requestAnimationFrame(_);Q(this,Tt).set(a,e)};_()});Z(this,"clearRequestAnimationFrame",async(a=[])=>{a.length===0&&(a=[...Q(this,Tt).keys()]);const E=[];for(const _ of a){const k=Q(this,Tt).get(_);k&&(cancelAnimationFrame(k),E.push(k))}return E});Z(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.stopLocalStreams(),await new Promise(a=>setTimeout(()=>a(!0),300)),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.close()});Q(this,Xt).call(this),Q(this,te).call(this),Q(this,ee).call(this),Q(this,Yt).call(this)}}Tt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,te=new WeakMap,ee=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|
|
3
|
+
`},writer$1}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var u=requireParser(),I=requireWriter$1(),a=requireGrammar();return lib.grammar=a,lib.write=I,lib.parse=u.parse,lib.parseParams=u.parseParams,lib.parseFmtpConfig=u.parseFmtpConfig,lib.parsePayloads=u.parsePayloads,lib.parseRemoteCandidates=u.parseRemoteCandidates,lib.parseImageAttributes=u.parseImageAttributes,lib.parseSimulcastStreamList=u.parseSimulcastStreamList,lib}var libExports=requireLib();class AudioMediaContext{constructor(I){Z(this,"options",{autoGainControl:!1,noiseSuppression:!1,echoCancellation:!1});Z(this,"kind","audio");Z(this,"stream",new MediaStream);Z(this,"gain",1);Z(this,"enhanceGain",0);Z(this,"audio",new Audio);Z(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));Z(this,"mediaStreamAudioSourceNode");Z(this,"autoGainNode");Z(this,"biquadFilterNode");Z(this,"delayNode");Z(this,"gainNode");Z(this,"analyserNode");Z(this,"analyserArrayData");Z(this,"stop",()=>{{const I=this.stream.getTracks();for(const a of I)a.stop(),this.stream.removeTrack(a)}});Z(this,"replaceStream",I=>{const a=this.stream.getTracks();for(const _ of a)this.stream.removeTrack(_);const[E]=I.getAudioTracks();E&&this.stream.addTrack(E)});Z(this,"getStream",()=>this.mediaStreamAudioSourceNode.mediaStream);Z(this,"setMute",(I=!0)=>{I?this.gainNode.disconnect(this.audioContext.destination):this.gainNode.connect(this.audioContext.destination)});Z(this,"setGain",()=>{const I=(1+this.enhanceGain)*this.gain;this.gainNode.gain.setValueAtTime(I,this.audioContext.currentTime)});Z(this,"setEnhanceGain",async I=>{let a=Math.max(0,I);a=Math.min(a,1),this.enhanceGain=a,this.setGain()});Z(this,"setVolumeGain",I=>{this.gain=I,this.setGain()});Z(this,"getVolume",()=>{const{analyserNode:I,analyserArrayData:a}=this;I.getByteFrequencyData(a);let E=0;for(let k=0;k<a.length;k++)E+=a[k];return Math.ceil(E/a.length)});Z(this,"setFilter",(I={})=>{this.options={...this.options,...I};const{autoGainControl:a,noiseSuppression:E,echoCancellation:_}=this.options,{mediaStreamAudioSourceNode:k,autoGainNode:e,biquadFilterNode:n,delayNode:O,gainNode:$}=this;let N=k;return a&&N.connect(e),E&&N.connect(n),_&&N.connect(O),N.connect($),I});this.stream.addTrack(I),this.audio.srcObject=this.stream,this.audioContext=new(window.AudioContext||window.webkitAudioContext),this.mediaStreamAudioSourceNode=this.audioContext.createMediaStreamSource(this.stream),this.autoGainNode=this.audioContext.createGain(),this.autoGainNode.gain.setValueAtTime(.8,this.audioContext.currentTime),this.biquadFilterNode=this.audioContext.createBiquadFilter(),this.biquadFilterNode.type="lowpass",this.biquadFilterNode.frequency.value=1e3,this.delayNode=this.audioContext.createDelay(),this.delayNode.delayTime.value=.5,this.gainNode=this.audioContext.createGain(),this.gainNode.gain.setValueAtTime(this.gain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount);const{gainNode:a,analyserNode:E}=this;a.connect(E),this.audioContext.state==="suspended"&&(this.audioContext.resume(),document.addEventListener("click",()=>this.audioContext.resume(),{once:!0})),this.setFilter()}}class VideoMediaContext{constructor(I){Z(this,"kind","video");Z(this,"stream",new MediaStream);Z(this,"stop",()=>{const I=this.stream.getTracks();for(const a of I)a.stop(),this.stream.removeTrack(a)});Z(this,"replaceStream",I=>{const a=this.stream.getTracks();for(const _ of a)this.stream.removeTrack(_);const[E]=I.getVideoTracks();E&&this.stream.addTrack(E)});Z(this,"getStream",()=>this.stream);Z(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(I)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",closed:"已关闭"};pt(enum_roomState);var C=Object.defineProperty,R=u=>{throw TypeError(u)},S=(u,I,a)=>I in u?C(u,I,{enumerable:!0,configurable:!0,writable:!0,value:a}):u[I]=a,l$1=(u,I,a)=>S(u,typeof I!="symbol"?I+"":I,a),v=(u,I,a)=>I.has(u)||R("Cannot "+a),t=(u,I,a)=>(v(u,I,"read from private field"),a?a.call(u):I.get(u)),c$1=(u,I,a)=>I.has(u)?R("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(u):I.set(u,a),i=(u,I,a,E)=>(v(u,I,"write to private field"),I.set(u,a),a),s,r,h$1,p$1,m,f$1,w,x$1,g$1,b$1,B,y$1,T,d$1;class M{constructor(I){c$1(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:a=>!0,onReconnectSuccess:async a=>{},onReconnectStop:async a=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:a=>{}}),l$1(this,"ws"),c$1(this,r,-1),c$1(this,h$1,-1),c$1(this,p$1,0),c$1(this,m,0),c$1(this,f$1,!1),c$1(this,w,a=>{}),l$1(this,"close",async(a=1e3,E="correctly close.")=>{var _;this.ws&&(i(this,f$1,!0),t(this,d$1).call(this),(_=this.ws)==null||_.close(a,E))}),l$1(this,"connect",()=>new Promise(async a=>{i(this,w,a),this.ws=new WebSocket(t(this,s).url),this.ws.binaryType=t(this,s).binaryType,this.ws.onopen=t(this,b$1),this.ws.onmessage=t(this,g$1),this.ws.onerror=t(this,B),this.ws.onclose=t(this,y$1)})),l$1(this,"reconnect",async a=>new Promise(E=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const _=k=>{t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${k}`),t(this,s).onReconnectStop({msg:k}),E(k)};if(t(this,x$1).call(this)===!1)return _("stop reconnect. exceed maxReconnectionTime.");if(t(this,r)!==-1&&t(this,r)===0)return _("stop reconnect. surplusReconnectCount is 0.");if(!t(this,s).checkReconnect(a))return _("stop reconnect. checkReconnect is false.");t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,s).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,r)}`,a),i(this,p$1,setTimeout(async()=>{i(this,r,Math.max(-1,t(this,r)-1)),await this.connect();try{await t(this,s).onReconnectSuccess(this.ws)}catch(k){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",k)}E(!0)},t(this,s).reconnectIntervalTime))})),l$1(this,"sendMessage",async a=>{var E;(!this.ws||this.ws.readyState!==1)&&(t(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready."),t(this,s).sendBeforAutoConnect&&(t(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws connect."),await this.connect())),(E=this.ws)==null||E.send(a)}),c$1(this,x$1,()=>{const a=Date.now();return t(this,h$1)===-1&&i(this,h$1,a+t(this,s).reconnectTime),!(a>t(this,h$1))}),c$1(this,g$1,a=>{const{data:E}=a;t(this,s).onMessage(E)}),c$1(this,b$1,()=>{t(this,s).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is success.",this.ws),i(this,r,t(this,s).reconnectCount),i(this,h$1,-1),t(this,T).call(this),t(this,w).call(this,this.ws)}),c$1(this,B,a=>{t(this,s).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",a)}),c$1(this,y$1,a=>{if(t(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${a.code}, permanentClosed is ${t(this,f$1)}.`,a),t(this,d$1).call(this),!t(this,f$1))return this.reconnect(a);this.ws=void 0}),c$1(this,T,()=>{i(this,m,setInterval(()=>{const a=t(this,s).getHeartbeatMsg();a&&this.sendMessage(a)},t(this,s).heartbeatIntervalTime))}),c$1(this,d$1,()=>{clearInterval(t(this,p$1)),clearInterval(t(this,m))}),i(this,s,{...t(this,s),...I}),i(this,r,t(this,s).reconnectCount)}}s=new WeakMap,r=new WeakMap,h$1=new WeakMap,p$1=new WeakMap,m=new WeakMap,f$1=new WeakMap,w=new WeakMap,x$1=new WeakMap,g$1=new WeakMap,b$1=new WeakMap,B=new WeakMap,y$1=new WeakMap,T=new WeakMap,d$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=u;function u(I,a){for(var E=new Array(arguments.length-1),_=0,k=2,e=!0;k<arguments.length;)E[_++]=arguments[k++];return new Promise(function(O,$){E[_]=function(D){if(e)if(e=!1,D)$(D);else{for(var q=new Array(arguments.length-1),P=0;P<q.length;)q[P++]=arguments[P];O.apply(null,q)}};try{I.apply(a||null,E)}catch(N){e&&(e=!1,$(N))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(u){var I=u;I.length=function(n){var O=n.length;if(!O)return 0;for(var $=0;--O%4>1&&n.charAt(O)==="=";)++$;return Math.ceil(n.length*3)/4-$};for(var a=new Array(64),E=new Array(123),_=0;_<64;)E[a[_]=_<26?_+65:_<52?_+71:_<62?_-4:_-59|43]=_++;I.encode=function(n,O,$){for(var N=null,D=[],q=0,P=0,j;O<$;){var V=n[O++];switch(P){case 0:D[q++]=a[V>>2],j=(V&3)<<4,P=1;break;case 1:D[q++]=a[j|V>>4],j=(V&15)<<2,P=2;break;case 2:D[q++]=a[j|V>>6],D[q++]=a[V&63],P=0;break}q>8191&&((N||(N=[])).push(String.fromCharCode.apply(String,D)),q=0)}return P&&(D[q++]=a[j],D[q++]=61,P===1&&(D[q++]=61)),N?(q&&N.push(String.fromCharCode.apply(String,D.slice(0,q))),N.join("")):String.fromCharCode.apply(String,D.slice(0,q))};var k="invalid encoding";I.decode=function(n,O,$){for(var N=$,D=0,q,P=0;P<n.length;){var j=n.charCodeAt(P++);if(j===61&&D>1)break;if((j=E[j])===void 0)throw Error(k);switch(D){case 0:q=j,D=1;break;case 1:O[$++]=q<<2|(j&48)>>4,q=j,D=2;break;case 2:O[$++]=(q&15)<<4|(j&60)>>2,q=j,D=3;break;case 3:O[$++]=(q&3)<<6|j,D=0;break}}if(D===1)throw Error(k);return $-N},I.test=function(n){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(n)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=u;function u(){this._listeners={}}return u.prototype.on=function(a,E,_){return(this._listeners[a]||(this._listeners[a]=[])).push({fn:E,ctx:_||this}),this},u.prototype.off=function(a,E){if(a===void 0)this._listeners={};else if(E===void 0)this._listeners[a]=[];else for(var _=this._listeners[a],k=0;k<_.length;)_[k].fn===E?_.splice(k,1):++k;return this},u.prototype.emit=function(a){var E=this._listeners[a];if(E){for(var _=[],k=1;k<arguments.length;)_.push(arguments[k++]);for(k=0;k<E.length;)E[k].fn.apply(E[k++].ctx,_)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=u(u);function u(k){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),O=n[3]===128;function $(P,j,V){e[0]=P,j[V]=n[0],j[V+1]=n[1],j[V+2]=n[2],j[V+3]=n[3]}function N(P,j,V){e[0]=P,j[V]=n[3],j[V+1]=n[2],j[V+2]=n[1],j[V+3]=n[0]}k.writeFloatLE=O?$:N,k.writeFloatBE=O?N:$;function D(P,j){return n[0]=P[j],n[1]=P[j+1],n[2]=P[j+2],n[3]=P[j+3],e[0]}function q(P,j){return n[3]=P[j],n[2]=P[j+1],n[1]=P[j+2],n[0]=P[j+3],e[0]}k.readFloatLE=O?D:q,k.readFloatBE=O?q:D}():function(){function e(O,$,N,D){var q=$<0?1:0;if(q&&($=-$),$===0)O(1/$>0?0:2147483648,N,D);else if(isNaN($))O(2143289344,N,D);else if($>34028234663852886e22)O((q<<31|2139095040)>>>0,N,D);else if($<11754943508222875e-54)O((q<<31|Math.round($/1401298464324817e-60))>>>0,N,D);else{var P=Math.floor(Math.log($)/Math.LN2),j=Math.round($*Math.pow(2,-P)*8388608)&8388607;O((q<<31|P+127<<23|j)>>>0,N,D)}}k.writeFloatLE=e.bind(null,I),k.writeFloatBE=e.bind(null,a);function n(O,$,N){var D=O($,N),q=(D>>31)*2+1,P=D>>>23&255,j=D&8388607;return P===255?j?NaN:q*(1/0):P===0?q*1401298464324817e-60*j:q*Math.pow(2,P-150)*(j+8388608)}k.readFloatLE=n.bind(null,E),k.readFloatBE=n.bind(null,_)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),O=n[7]===128;function $(P,j,V){e[0]=P,j[V]=n[0],j[V+1]=n[1],j[V+2]=n[2],j[V+3]=n[3],j[V+4]=n[4],j[V+5]=n[5],j[V+6]=n[6],j[V+7]=n[7]}function N(P,j,V){e[0]=P,j[V]=n[7],j[V+1]=n[6],j[V+2]=n[5],j[V+3]=n[4],j[V+4]=n[3],j[V+5]=n[2],j[V+6]=n[1],j[V+7]=n[0]}k.writeDoubleLE=O?$:N,k.writeDoubleBE=O?N:$;function D(P,j){return n[0]=P[j],n[1]=P[j+1],n[2]=P[j+2],n[3]=P[j+3],n[4]=P[j+4],n[5]=P[j+5],n[6]=P[j+6],n[7]=P[j+7],e[0]}function q(P,j){return n[7]=P[j],n[6]=P[j+1],n[5]=P[j+2],n[4]=P[j+3],n[3]=P[j+4],n[2]=P[j+5],n[1]=P[j+6],n[0]=P[j+7],e[0]}k.readDoubleLE=O?D:q,k.readDoubleBE=O?q:D}():function(){function e(O,$,N,D,q,P){var j=D<0?1:0;if(j&&(D=-D),D===0)O(0,q,P+$),O(1/D>0?0:2147483648,q,P+N);else if(isNaN(D))O(0,q,P+$),O(2146959360,q,P+N);else if(D>17976931348623157e292)O(0,q,P+$),O((j<<31|2146435072)>>>0,q,P+N);else{var V;if(D<22250738585072014e-324)V=D/5e-324,O(V>>>0,q,P+$),O((j<<31|V/4294967296)>>>0,q,P+N);else{var J=Math.floor(Math.log(D)/Math.LN2);J===1024&&(J=1023),V=D*Math.pow(2,-J),O(V*4503599627370496>>>0,q,P+$),O((j<<31|J+1023<<20|V*1048576&1048575)>>>0,q,P+N)}}}k.writeDoubleLE=e.bind(null,I,0,4),k.writeDoubleBE=e.bind(null,a,4,0);function n(O,$,N,D,q){var P=O(D,q+$),j=O(D,q+N),V=(j>>31)*2+1,J=j>>>20&2047,z=4294967296*(j&1048575)+P;return J===2047?z?NaN:V*(1/0):J===0?V*5e-324*z:V*Math.pow(2,J-1075)*(z+4503599627370496)}k.readDoubleLE=n.bind(null,E,0,4),k.readDoubleBE=n.bind(null,_,4,0)}(),k}function I(k,e,n){e[n]=k&255,e[n+1]=k>>>8&255,e[n+2]=k>>>16&255,e[n+3]=k>>>24}function a(k,e,n){e[n]=k>>>24,e[n+1]=k>>>16&255,e[n+2]=k>>>8&255,e[n+3]=k&255}function E(k,e){return(k[e]|k[e+1]<<8|k[e+2]<<16|k[e+3]<<24)>>>0}function _(k,e){return(k[e]<<24|k[e+1]<<16|k[e+2]<<8|k[e+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(u){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(u){var I=u;I.length=function(E){for(var _=0,k=0,e=0;e<E.length;++e)k=E.charCodeAt(e),k<128?_+=1:k<2048?_+=2:(k&64512)===55296&&(E.charCodeAt(e+1)&64512)===56320?(++e,_+=4):_+=3;return _},I.read=function(E,_,k){var e=k-_;if(e<1)return"";for(var n=null,O=[],$=0,N;_<k;)N=E[_++],N<128?O[$++]=N:N>191&&N<224?O[$++]=(N&31)<<6|E[_++]&63:N>239&&N<365?(N=((N&7)<<18|(E[_++]&63)<<12|(E[_++]&63)<<6|E[_++]&63)-65536,O[$++]=55296+(N>>10),O[$++]=56320+(N&1023)):O[$++]=(N&15)<<12|(E[_++]&63)<<6|E[_++]&63,$>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,O)),$=0);return n?($&&n.push(String.fromCharCode.apply(String,O.slice(0,$))),n.join("")):String.fromCharCode.apply(String,O.slice(0,$))},I.write=function(E,_,k){for(var e=k,n,O,$=0;$<E.length;++$)n=E.charCodeAt($),n<128?_[k++]=n:n<2048?(_[k++]=n>>6|192,_[k++]=n&63|128):(n&64512)===55296&&((O=E.charCodeAt($+1))&64512)===56320?(n=65536+((n&1023)<<10)+(O&1023),++$,_[k++]=n>>18|240,_[k++]=n>>12&63|128,_[k++]=n>>6&63|128,_[k++]=n&63|128):(_[k++]=n>>12|224,_[k++]=n>>6&63|128,_[k++]=n&63|128);return k-e}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=u;function u(I,a,E){var _=E||8192,k=_>>>1,e=null,n=_;return function($){if($<1||$>k)return I($);n+$>_&&(e=I(_),n=0);var N=a.call(e,n,n+=$);return n&7&&(n=(n|7)+1),N}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=I;var u=requireMinimal$1();function I(k,e){this.lo=k>>>0,this.hi=e>>>0}var a=I.zero=new I(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var E=I.zeroHash="\0\0\0\0\0\0\0\0";I.fromNumber=function(e){if(e===0)return a;var n=e<0;n&&(e=-e);var O=e>>>0,$=(e-O)/4294967296>>>0;return n&&($=~$>>>0,O=~O>>>0,++O>4294967295&&(O=0,++$>4294967295&&($=0))),new I(O,$)},I.from=function(e){if(typeof e=="number")return I.fromNumber(e);if(u.isString(e))if(u.Long)e=u.Long.fromString(e);else return I.fromNumber(parseInt(e,10));return e.low||e.high?new I(e.low>>>0,e.high>>>0):a},I.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var n=~this.lo+1>>>0,O=~this.hi>>>0;return n||(O=O+1>>>0),-(n+O*4294967296)}return this.lo+this.hi*4294967296},I.prototype.toLong=function(e){return u.Long?new u.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var _=String.prototype.charCodeAt;return I.fromHash=function(e){return e===E?a:new I((_.call(e,0)|_.call(e,1)<<8|_.call(e,2)<<16|_.call(e,3)<<24)>>>0,(_.call(e,4)|_.call(e,5)<<8|_.call(e,6)<<16|_.call(e,7)<<24)>>>0)},I.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)},I.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},I.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},I.prototype.length=function(){var e=this.lo,n=(this.lo>>>28|this.hi<<4)>>>0,O=this.hi>>>24;return O===0?n===0?e<16384?e<128?1:2:e<2097152?3:4:n<16384?n<128?5:6:n<2097152?7:8:O<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(u){var I=u;I.asPromise=requireAspromise(),I.base64=requireBase64(),I.EventEmitter=requireEventemitter(),I.float=requireFloat(),I.inquire=requireInquire(),I.utf8=requireUtf8(),I.pool=requirePool(),I.LongBits=requireLongbits(),I.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),I.global=I.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,I.emptyArray=Object.freeze?Object.freeze([]):[],I.emptyObject=Object.freeze?Object.freeze({}):{},I.isInteger=Number.isInteger||function(k){return typeof k=="number"&&isFinite(k)&&Math.floor(k)===k},I.isString=function(k){return typeof k=="string"||k instanceof String},I.isObject=function(k){return k&&typeof k=="object"},I.isset=I.isSet=function(k,e){var n=k[e];return n!=null&&k.hasOwnProperty(e)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},I.Buffer=function(){try{var _=I.inquire("buffer").Buffer;return _.prototype.utf8Write?_:null}catch{return null}}(),I._Buffer_from=null,I._Buffer_allocUnsafe=null,I.newBuffer=function(k){return typeof k=="number"?I.Buffer?I._Buffer_allocUnsafe(k):new I.Array(k):I.Buffer?I._Buffer_from(k):typeof Uint8Array>"u"?k:new Uint8Array(k)},I.Array=typeof Uint8Array<"u"?Uint8Array:Array,I.Long=I.global.dcodeIO&&I.global.dcodeIO.Long||I.global.Long||I.inquire("long"),I.key2Re=/^true|false|0|1$/,I.key32Re=/^-?(?:0|[1-9][0-9]*)$/,I.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,I.longToHash=function(k){return k?I.LongBits.from(k).toHash():I.LongBits.zeroHash},I.longFromHash=function(k,e){var n=I.LongBits.fromHash(k);return I.Long?I.Long.fromBits(n.lo,n.hi,e):n.toNumber(!!e)};function a(_,k,e){for(var n=Object.keys(k),O=0;O<n.length;++O)(_[n[O]]===void 0||!e)&&(_[n[O]]=k[n[O]]);return _}I.merge=a,I.lcFirst=function(k){return k.charAt(0).toLowerCase()+k.substring(1)};function E(_){function k(e,n){if(!(this instanceof k))return new k(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,k):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&a(this,n)}return k.prototype=Object.create(Error.prototype,{constructor:{value:k,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return _},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),k}I.newError=E,I.ProtocolError=E("ProtocolError"),I.oneOfGetter=function(k){for(var e={},n=0;n<k.length;++n)e[k[n]]=1;return function(){for(var O=Object.keys(this),$=O.length-1;$>-1;--$)if(e[O[$]]===1&&this[O[$]]!==void 0&&this[O[$]]!==null)return O[$]}},I.oneOfSetter=function(k){return function(e){for(var n=0;n<k.length;++n)k[n]!==e&&delete this[k[n]]}},I.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},I._configure=function(){var _=I.Buffer;if(!_){I._Buffer_from=I._Buffer_allocUnsafe=null;return}I._Buffer_from=_.from!==Uint8Array.from&&_.from||function(e,n){return new _(e,n)},I._Buffer_allocUnsafe=_.allocUnsafe||function(e){return new _(e)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=O;var u=requireMinimal$1(),I,a=u.LongBits,E=u.base64,_=u.utf8;function k(J,z,Y){this.fn=J,this.len=z,this.next=void 0,this.val=Y}function e(){}function n(J){this.head=J.head,this.tail=J.tail,this.len=J.len,this.next=J.states}function O(){this.len=0,this.head=new k(e,0,0),this.tail=this.head,this.states=null}var $=function(){return u.Buffer?function(){return(O.create=function(){return new I})()}:function(){return new O}};O.create=$(),O.alloc=function(z){return new u.Array(z)},u.Array!==Array&&(O.alloc=u.pool(O.alloc,u.Array.prototype.subarray)),O.prototype._push=function(z,Y,et){return this.tail=this.tail.next=new k(z,Y,et),this.len+=Y,this};function N(J,z,Y){z[Y]=J&255}function D(J,z,Y){for(;J>127;)z[Y++]=J&127|128,J>>>=7;z[Y]=J}function q(J,z){this.len=J,this.next=void 0,this.val=z}q.prototype=Object.create(k.prototype),q.prototype.fn=D,O.prototype.uint32=function(z){return this.len+=(this.tail=this.tail.next=new q((z=z>>>0)<128?1:z<16384?2:z<2097152?3:z<268435456?4:5,z)).len,this},O.prototype.int32=function(z){return z<0?this._push(P,10,a.fromNumber(z)):this.uint32(z)},O.prototype.sint32=function(z){return this.uint32((z<<1^z>>31)>>>0)};function P(J,z,Y){for(;J.hi;)z[Y++]=J.lo&127|128,J.lo=(J.lo>>>7|J.hi<<25)>>>0,J.hi>>>=7;for(;J.lo>127;)z[Y++]=J.lo&127|128,J.lo=J.lo>>>7;z[Y++]=J.lo}O.prototype.uint64=function(z){var Y=a.from(z);return this._push(P,Y.length(),Y)},O.prototype.int64=O.prototype.uint64,O.prototype.sint64=function(z){var Y=a.from(z).zzEncode();return this._push(P,Y.length(),Y)},O.prototype.bool=function(z){return this._push(N,1,z?1:0)};function j(J,z,Y){z[Y]=J&255,z[Y+1]=J>>>8&255,z[Y+2]=J>>>16&255,z[Y+3]=J>>>24}O.prototype.fixed32=function(z){return this._push(j,4,z>>>0)},O.prototype.sfixed32=O.prototype.fixed32,O.prototype.fixed64=function(z){var Y=a.from(z);return this._push(j,4,Y.lo)._push(j,4,Y.hi)},O.prototype.sfixed64=O.prototype.fixed64,O.prototype.float=function(z){return this._push(u.float.writeFloatLE,4,z)},O.prototype.double=function(z){return this._push(u.float.writeDoubleLE,8,z)};var V=u.Array.prototype.set?function(z,Y,et){Y.set(z,et)}:function(z,Y,et){for(var tt=0;tt<z.length;++tt)Y[et+tt]=z[tt]};return O.prototype.bytes=function(z){var Y=z.length>>>0;if(!Y)return this._push(N,1,0);if(u.isString(z)){var et=O.alloc(Y=E.length(z));E.decode(z,et,0),z=et}return this.uint32(Y)._push(V,Y,z)},O.prototype.string=function(z){var Y=_.length(z);return Y?this.uint32(Y)._push(_.write,Y,z):this._push(N,1,0)},O.prototype.fork=function(){return this.states=new n(this),this.head=this.tail=new k(e,0,0),this.len=0,this},O.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 k(e,0,0),this.len=0),this},O.prototype.ldelim=function(){var z=this.head,Y=this.tail,et=this.len;return this.reset().uint32(et),et&&(this.tail.next=z.next,this.tail=Y,this.len+=et),this},O.prototype.finish=function(){for(var z=this.head.next,Y=this.constructor.alloc(this.len),et=0;z;)z.fn(z.val,Y,et),et+=z.len,z=z.next;return Y},O._configure=function(J){I=J,O.create=$(),I._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=a;var u=requireWriter();(a.prototype=Object.create(u.prototype)).constructor=a;var I=requireMinimal$1();function a(){u.call(this)}a._configure=function(){a.alloc=I._Buffer_allocUnsafe,a.writeBytesBuffer=I.Buffer&&I.Buffer.prototype instanceof Uint8Array&&I.Buffer.prototype.set.name==="set"?function(k,e,n){e.set(k,n)}:function(k,e,n){if(k.copy)k.copy(e,n,0,k.length);else for(var O=0;O<k.length;)e[n++]=k[O++]}},a.prototype.bytes=function(k){I.isString(k)&&(k=I._Buffer_from(k,"base64"));var e=k.length>>>0;return this.uint32(e),e&&this._push(a.writeBytesBuffer,e,k),this};function E(_,k,e){_.length<40?I.utf8.write(_,k,e):k.utf8Write?k.utf8Write(_,e):k.write(_,e)}return a.prototype.string=function(k){var e=I.Buffer.byteLength(k);return this.uint32(e),e&&this._push(E,e,k),this},a._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=k;var u=requireMinimal$1(),I,a=u.LongBits,E=u.utf8;function _(D,q){return RangeError("index out of range: "+D.pos+" + "+(q||1)+" > "+D.len)}function k(D){this.buf=D,this.pos=0,this.len=D.length}var e=typeof Uint8Array<"u"?function(q){if(q instanceof Uint8Array||Array.isArray(q))return new k(q);throw Error("illegal buffer")}:function(q){if(Array.isArray(q))return new k(q);throw Error("illegal buffer")},n=function(){return u.Buffer?function(P){return(k.create=function(V){return u.Buffer.isBuffer(V)?new I(V):e(V)})(P)}:e};k.create=n(),k.prototype._slice=u.Array.prototype.subarray||u.Array.prototype.slice,k.prototype.uint32=function(){var q=4294967295;return function(){if(q=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(q=(q|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(q=(q|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return q;if((this.pos+=5)>this.len)throw this.pos=this.len,_(this,10);return q}}(),k.prototype.int32=function(){return this.uint32()|0},k.prototype.sint32=function(){var q=this.uint32();return q>>>1^-(q&1)|0};function O(){var D=new a(0,0),q=0;if(this.len-this.pos>4){for(;q<4;++q)if(D.lo=(D.lo|(this.buf[this.pos]&127)<<q*7)>>>0,this.buf[this.pos++]<128)return D;if(D.lo=(D.lo|(this.buf[this.pos]&127)<<28)>>>0,D.hi=(D.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return D;q=0}else{for(;q<3;++q){if(this.pos>=this.len)throw _(this);if(D.lo=(D.lo|(this.buf[this.pos]&127)<<q*7)>>>0,this.buf[this.pos++]<128)return D}return D.lo=(D.lo|(this.buf[this.pos++]&127)<<q*7)>>>0,D}if(this.len-this.pos>4){for(;q<5;++q)if(D.hi=(D.hi|(this.buf[this.pos]&127)<<q*7+3)>>>0,this.buf[this.pos++]<128)return D}else for(;q<5;++q){if(this.pos>=this.len)throw _(this);if(D.hi=(D.hi|(this.buf[this.pos]&127)<<q*7+3)>>>0,this.buf[this.pos++]<128)return D}throw Error("invalid varint encoding")}k.prototype.bool=function(){return this.uint32()!==0};function $(D,q){return(D[q-4]|D[q-3]<<8|D[q-2]<<16|D[q-1]<<24)>>>0}k.prototype.fixed32=function(){if(this.pos+4>this.len)throw _(this,4);return $(this.buf,this.pos+=4)},k.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _(this,4);return $(this.buf,this.pos+=4)|0};function N(){if(this.pos+8>this.len)throw _(this,8);return new a($(this.buf,this.pos+=4),$(this.buf,this.pos+=4))}return k.prototype.float=function(){if(this.pos+4>this.len)throw _(this,4);var q=u.float.readFloatLE(this.buf,this.pos);return this.pos+=4,q},k.prototype.double=function(){if(this.pos+8>this.len)throw _(this,4);var q=u.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,q},k.prototype.bytes=function(){var q=this.uint32(),P=this.pos,j=this.pos+q;if(j>this.len)throw _(this,q);if(this.pos+=q,Array.isArray(this.buf))return this.buf.slice(P,j);if(P===j){var V=u.Buffer;return V?V.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,P,j)},k.prototype.string=function(){var q=this.bytes();return E.read(q,0,q.length)},k.prototype.skip=function(q){if(typeof q=="number"){if(this.pos+q>this.len)throw _(this,q);this.pos+=q}else do if(this.pos>=this.len)throw _(this);while(this.buf[this.pos++]&128);return this},k.prototype.skipType=function(D){switch(D){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(D=this.uint32()&7)!==4;)this.skipType(D);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+D+" at offset "+this.pos)}return this},k._configure=function(D){I=D,k.create=n(),I._configure();var q=u.Long?"toLong":"toNumber";u.merge(k.prototype,{int64:function(){return O.call(this)[q](!1)},uint64:function(){return O.call(this)[q](!0)},sint64:function(){return O.call(this).zzDecode()[q](!1)},fixed64:function(){return N.call(this)[q](!0)},sfixed64:function(){return N.call(this)[q](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=a;var u=requireReader();(a.prototype=Object.create(u.prototype)).constructor=a;var I=requireMinimal$1();function a(E){u.call(this,E)}return a._configure=function(){I.Buffer&&(a.prototype._slice=I.Buffer.prototype.slice)},a.prototype.string=function(){var _=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+_,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+_,this.len))},a._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=I;var u=requireMinimal$1();(I.prototype=Object.create(u.EventEmitter.prototype)).constructor=I;function I(a,E,_){if(typeof a!="function")throw TypeError("rpcImpl must be a function");u.EventEmitter.call(this),this.rpcImpl=a,this.requestDelimited=!!E,this.responseDelimited=!!_}return I.prototype.rpcCall=function a(E,_,k,e,n){if(!e)throw TypeError("request must be specified");var O=this;if(!n)return u.asPromise(a,O,E,_,k,e);if(!O.rpcImpl){setTimeout(function(){n(Error("already ended"))},0);return}try{return O.rpcImpl(E,_[O.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(N,D){if(N)return O.emit("error",N,E),n(N);if(D===null){O.end(!0);return}if(!(D instanceof k))try{D=k[O.responseDelimited?"decodeDelimited":"decode"](D)}catch(q){return O.emit("error",q,E),n(q)}return O.emit("data",D,E),n(null,D)})}catch($){O.emit("error",$,E),setTimeout(function(){n($)},0);return}},I.prototype.end=function(E){return this.rpcImpl&&(E||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(u){var I=u;I.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(u){var I=u;I.build="minimal",I.Writer=requireWriter(),I.BufferWriter=requireWriter_buffer(),I.Reader=requireReader(),I.BufferReader=requireReader_buffer(),I.util=requireMinimal$1(),I.rpc=requireRpc(),I.roots=requireRoots(),I.configure=a;function a(){I.util._configure(),I.Writer._configure(I.BufferWriter),I.Reader._configure(I.BufferReader)}a()}(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 u={};return u.quick=function(){const I={};return I.voice=function(){const a={};return a.proto=function(){const E={};return E.CommonReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.event="",_.prototype.data=$util.newBuffer([]),_.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.version=0,_.prototype.compress=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&n.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&n.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&n.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&n.uint32(40).int64(e.valid),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&n.uint32(48).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&n.uint32(56).bool(e.compress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.event=e.string();break}case 2:{$.data=e.bytes();break}case 3:{$.sn=e.int64();break}case 4:{$.time=e.int64();break}case 5:{$.valid=e.int64();break}case 6:{$.version=e.int32();break}case 7:{$.compress=e.bool();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonReq)return e;let n=new $root.com.quick.voice.proto.CommonReq;return e.event!=null&&(n.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,n.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(n.data=e.data)),e.sn!=null&&($util.Long?(n.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?n.sn=parseInt(e.sn,10):typeof e.sn=="number"?n.sn=e.sn:typeof e.sn=="object"&&(n.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(n.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?n.valid=parseInt(e.valid,10):typeof e.valid=="number"?n.valid=e.valid:typeof e.valid=="object"&&(n.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.version!=null&&(n.version=e.version|0),e.compress!=null&&(n.compress=!!e.compress),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.event="",n.bytes===String?O.data="":(O.data=[],n.bytes!==Array&&(O.data=$util.newBuffer(O.data))),$util.Long){let $=new $util.Long(0,0,!1);O.sn=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.sn=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.valid=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.valid=n.longs===String?"0":0;O.version=0,O.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(O.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(O.data=n.bytes===String?$util.base64.encode(e.data,0,e.data.length):n.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?O.sn=n.longs===String?String(e.sn):e.sn:O.sn=n.longs===String?$util.Long.prototype.toString.call(e.sn):n.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?O.valid=n.longs===String?String(e.valid):e.valid:O.valid=n.longs===String?$util.Long.prototype.toString.call(e.valid):n.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.version!=null&&e.hasOwnProperty("version")&&(O.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(O.compress=e.compress),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonReq"},_}(),E.CommonRsp=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.event="",_.prototype.data=$util.newBuffer([]),_.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.code=0,_.prototype.desc="",_.prototype.version=0,_.prototype.compress=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&n.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&n.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&n.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&n.uint32(40).int64(e.valid),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&n.uint32(48).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&n.uint32(58).string(e.desc),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&n.uint32(64).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&n.uint32(72).bool(e.compress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.event=e.string();break}case 2:{$.data=e.bytes();break}case 3:{$.sn=e.int64();break}case 4:{$.time=e.int64();break}case 5:{$.valid=e.int64();break}case 6:{$.code=e.int32();break}case 7:{$.desc=e.string();break}case 8:{$.version=e.int32();break}case 9:{$.compress=e.bool();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.code!=null&&e.hasOwnProperty("code")&&!$util.isInteger(e.code)?"code: integer expected":e.desc!=null&&e.hasOwnProperty("desc")&&!$util.isString(e.desc)?"desc: string expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonRsp)return e;let n=new $root.com.quick.voice.proto.CommonRsp;return e.event!=null&&(n.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,n.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(n.data=e.data)),e.sn!=null&&($util.Long?(n.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?n.sn=parseInt(e.sn,10):typeof e.sn=="number"?n.sn=e.sn:typeof e.sn=="object"&&(n.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(n.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?n.valid=parseInt(e.valid,10):typeof e.valid=="number"?n.valid=e.valid:typeof e.valid=="object"&&(n.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.code!=null&&(n.code=e.code|0),e.desc!=null&&(n.desc=String(e.desc)),e.version!=null&&(n.version=e.version|0),e.compress!=null&&(n.compress=!!e.compress),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.event="",n.bytes===String?O.data="":(O.data=[],n.bytes!==Array&&(O.data=$util.newBuffer(O.data))),$util.Long){let $=new $util.Long(0,0,!1);O.sn=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.sn=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;if($util.Long){let $=new $util.Long(0,0,!1);O.valid=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.valid=n.longs===String?"0":0;O.code=0,O.desc="",O.version=0,O.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(O.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(O.data=n.bytes===String?$util.base64.encode(e.data,0,e.data.length):n.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?O.sn=n.longs===String?String(e.sn):e.sn:O.sn=n.longs===String?$util.Long.prototype.toString.call(e.sn):n.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?O.valid=n.longs===String?String(e.valid):e.valid:O.valid=n.longs===String?$util.Long.prototype.toString.call(e.valid):n.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.code!=null&&e.hasOwnProperty("code")&&(O.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(O.desc=e.desc),e.version!=null&&e.hasOwnProperty("version")&&(O.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(O.compress=e.compress),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonRsp"},_}(),E.User=function(){function _(e){if(this.tracks=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.id="",_.prototype.callAction=null,_.prototype.callState=null,_.prototype.joinTime=null,_.prototype.tracks=$util.emptyArray,_.prototype.permissions=null,_.prototype.isPublished=null,_.prototype.behavior=null;let k;return Object.defineProperty(_.prototype,"_callAction",{get:$util.oneOfGetter(k=["callAction"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_callState",{get:$util.oneOfGetter(k=["callState"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_joinTime",{get:$util.oneOfGetter(k=["joinTime"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_permissions",{get:$util.oneOfGetter(k=["permissions"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_isPublished",{get:$util.oneOfGetter(k=["isPublished"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_behavior",{get:$util.oneOfGetter(k=["behavior"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.id!=null&&Object.hasOwnProperty.call(n,"id")&&O.uint32(10).string(n.id),n.callAction!=null&&Object.hasOwnProperty.call(n,"callAction")&&O.uint32(16).int32(n.callAction),n.callState!=null&&Object.hasOwnProperty.call(n,"callState")&&O.uint32(24).int32(n.callState),n.joinTime!=null&&Object.hasOwnProperty.call(n,"joinTime")&&O.uint32(32).int64(n.joinTime),n.tracks!=null&&n.tracks.length)for(let $=0;$<n.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(n.tracks[$],O.uint32(42).fork()).ldelim();return n.permissions!=null&&Object.hasOwnProperty.call(n,"permissions")&&O.uint32(48).int32(n.permissions),n.isPublished!=null&&Object.hasOwnProperty.call(n,"isPublished")&&O.uint32(56).bool(n.isPublished),n.behavior!=null&&Object.hasOwnProperty.call(n,"behavior")&&O.uint32(64).int32(n.behavior),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.User;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.id=n.string();break}case 2:{N.callAction=n.int32();break}case 3:{N.callState=n.int32();break}case 4:{N.joinTime=n.int64();break}case 5:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 6:{N.permissions=n.int32();break}case 7:{N.isPublished=n.bool();break}case 8:{N.behavior=n.int32();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.id!=null&&n.hasOwnProperty("id")&&!$util.isString(n.id))return"id: string expected";if(n.callAction!=null&&n.hasOwnProperty("callAction")&&!$util.isInteger(n.callAction))return"callAction: integer expected";if(n.callState!=null&&n.hasOwnProperty("callState")&&!$util.isInteger(n.callState))return"callState: integer expected";if(n.joinTime!=null&&n.hasOwnProperty("joinTime")&&!$util.isInteger(n.joinTime)&&!(n.joinTime&&$util.isInteger(n.joinTime.low)&&$util.isInteger(n.joinTime.high)))return"joinTime: integer|Long expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let O=0;O<n.tracks.length;++O){let $=$root.com.quick.voice.proto.Track.verify(n.tracks[O]);if($)return"tracks."+$}}return n.permissions!=null&&n.hasOwnProperty("permissions")&&!$util.isInteger(n.permissions)?"permissions: integer expected":n.isPublished!=null&&n.hasOwnProperty("isPublished")&&typeof n.isPublished!="boolean"?"isPublished: boolean expected":n.behavior!=null&&n.hasOwnProperty("behavior")&&!$util.isInteger(n.behavior)?"behavior: integer expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.User)return n;let O=new $root.com.quick.voice.proto.User;if(n.id!=null&&(O.id=String(n.id)),n.callAction!=null&&(O.callAction=n.callAction|0),n.callState!=null&&(O.callState=n.callState|0),n.joinTime!=null&&($util.Long?(O.joinTime=$util.Long.fromValue(n.joinTime)).unsigned=!1:typeof n.joinTime=="string"?O.joinTime=parseInt(n.joinTime,10):typeof n.joinTime=="number"?O.joinTime=n.joinTime:typeof n.joinTime=="object"&&(O.joinTime=new $util.LongBits(n.joinTime.low>>>0,n.joinTime.high>>>0).toNumber())),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");O.tracks=[];for(let $=0;$<n.tracks.length;++$){if(typeof n.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");O.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[$])}}return n.permissions!=null&&(O.permissions=n.permissions|0),n.isPublished!=null&&(O.isPublished=!!n.isPublished),n.behavior!=null&&(O.behavior=n.behavior|0),O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.tracks=[]),O.defaults&&($.id=""),n.id!=null&&n.hasOwnProperty("id")&&($.id=n.id),n.callAction!=null&&n.hasOwnProperty("callAction")&&($.callAction=n.callAction,O.oneofs&&($._callAction="callAction")),n.callState!=null&&n.hasOwnProperty("callState")&&($.callState=n.callState,O.oneofs&&($._callState="callState")),n.joinTime!=null&&n.hasOwnProperty("joinTime")&&(typeof n.joinTime=="number"?$.joinTime=O.longs===String?String(n.joinTime):n.joinTime:$.joinTime=O.longs===String?$util.Long.prototype.toString.call(n.joinTime):O.longs===Number?new $util.LongBits(n.joinTime.low>>>0,n.joinTime.high>>>0).toNumber():n.joinTime,O.oneofs&&($._joinTime="joinTime")),n.tracks&&n.tracks.length){$.tracks=[];for(let N=0;N<n.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(n.tracks[N],O)}return n.permissions!=null&&n.hasOwnProperty("permissions")&&($.permissions=n.permissions,O.oneofs&&($._permissions="permissions")),n.isPublished!=null&&n.hasOwnProperty("isPublished")&&($.isPublished=n.isPublished,O.oneofs&&($._isPublished="isPublished")),n.behavior!=null&&n.hasOwnProperty("behavior")&&($.behavior=n.behavior,O.oneofs&&($._behavior="behavior")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.User"},_}(),E.Login=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.appid="",_.prototype.userId="",_.prototype.sdkToken="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.appid!=null&&Object.hasOwnProperty.call(e,"appid")&&n.uint32(10).string(e.appid),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(18).string(e.userId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&n.uint32(26).string(e.sdkToken),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.Login;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.appid=e.string();break}case 2:{$.userId=e.string();break}case 3:{$.sdkToken=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.appid!=null&&e.hasOwnProperty("appid")&&!$util.isString(e.appid)?"appid: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Login)return e;let n=new $root.com.quick.voice.proto.Login;return e.appid!=null&&(n.appid=String(e.appid)),e.userId!=null&&(n.userId=String(e.userId)),e.sdkToken!=null&&(n.sdkToken=String(e.sdkToken)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.appid="",O.userId="",O.sdkToken=""),e.appid!=null&&e.hasOwnProperty("appid")&&(O.appid=e.appid),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(O.sdkToken=e.sdkToken),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Login"},_}(),E.Track=function(){function _(e){if(e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.mid="",_.prototype.trackName=null,_.prototype.location=null,_.prototype.userId=null,_.prototype.code=null,_.prototype.desc=null,_.prototype.type=null,_.prototype.isValid=null;let k;return Object.defineProperty(_.prototype,"_trackName",{get:$util.oneOfGetter(k=["trackName"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_location",{get:$util.oneOfGetter(k=["location"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_userId",{get:$util.oneOfGetter(k=["userId"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_type",{get:$util.oneOfGetter(k=["type"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_isValid",{get:$util.oneOfGetter(k=["isValid"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){return O||(O=$Writer.create()),n.mid!=null&&Object.hasOwnProperty.call(n,"mid")&&O.uint32(10).string(n.mid),n.trackName!=null&&Object.hasOwnProperty.call(n,"trackName")&&O.uint32(18).string(n.trackName),n.location!=null&&Object.hasOwnProperty.call(n,"location")&&O.uint32(26).string(n.location),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&O.uint32(34).string(n.userId),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&O.uint32(40).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&O.uint32(50).string(n.desc),n.type!=null&&Object.hasOwnProperty.call(n,"type")&&O.uint32(56).int32(n.type),n.isValid!=null&&Object.hasOwnProperty.call(n,"isValid")&&O.uint32(64).bool(n.isValid),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.Track;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.mid=n.string();break}case 2:{N.trackName=n.string();break}case 3:{N.location=n.string();break}case 4:{N.userId=n.string();break}case 5:{N.code=n.int32();break}case 6:{N.desc=n.string();break}case 7:{N.type=n.int32();break}case 8:{N.isValid=n.bool();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.mid!=null&&n.hasOwnProperty("mid")&&!$util.isString(n.mid))return"mid: string expected";if(n.trackName!=null&&n.hasOwnProperty("trackName")&&!$util.isString(n.trackName))return"trackName: string expected";if(n.location!=null&&n.hasOwnProperty("location")&&!$util.isString(n.location))return"location: string expected";if(n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId))return"userId: string expected";if(n.code!=null&&n.hasOwnProperty("code")&&!$util.isInteger(n.code))return"code: integer expected";if(n.desc!=null&&n.hasOwnProperty("desc")&&!$util.isString(n.desc))return"desc: string expected";if(n.type!=null&&n.hasOwnProperty("type"))switch(n.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return n.isValid!=null&&n.hasOwnProperty("isValid")&&typeof n.isValid!="boolean"?"isValid: boolean expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.Track)return n;let O=new $root.com.quick.voice.proto.Track;switch(n.mid!=null&&(O.mid=String(n.mid)),n.trackName!=null&&(O.trackName=String(n.trackName)),n.location!=null&&(O.location=String(n.location)),n.userId!=null&&(O.userId=String(n.userId)),n.code!=null&&(O.code=n.code|0),n.desc!=null&&(O.desc=String(n.desc)),n.type){default:if(typeof n.type=="number"){O.type=n.type;break}break;case"Microphone":case 0:O.type=0;break;case"Camera":case 1:O.type=1;break;case"Screen":case 2:O.type=2;break;case"SystemVoice":case 3:O.type=3;break}return n.isValid!=null&&(O.isValid=!!n.isValid),O},_.toObject=function(n,O){O||(O={});let $={};return O.defaults&&($.mid=""),n.mid!=null&&n.hasOwnProperty("mid")&&($.mid=n.mid),n.trackName!=null&&n.hasOwnProperty("trackName")&&($.trackName=n.trackName,O.oneofs&&($._trackName="trackName")),n.location!=null&&n.hasOwnProperty("location")&&($.location=n.location,O.oneofs&&($._location="location")),n.userId!=null&&n.hasOwnProperty("userId")&&($.userId=n.userId,O.oneofs&&($._userId="userId")),n.code!=null&&n.hasOwnProperty("code")&&($.code=n.code,O.oneofs&&($._code="code")),n.desc!=null&&n.hasOwnProperty("desc")&&($.desc=n.desc,O.oneofs&&($._desc="desc")),n.type!=null&&n.hasOwnProperty("type")&&($.type=O.enums===String?$root.com.quick.voice.proto.TrackType[n.type]===void 0?n.type:$root.com.quick.voice.proto.TrackType[n.type]:n.type,O.oneofs&&($._type="type")),n.isValid!=null&&n.hasOwnProperty("isValid")&&($.isValid=n.isValid,O.oneofs&&($._isValid="isValid")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.Track"},_}(),E.JoinReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.prototype.callType=0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&n.uint32(24).int32(e.callType),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}case 3:{$.callType=e.int32();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinReq)return e;let n=new $root.com.quick.voice.proto.JoinReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}switch(e.callType){default:if(typeof e.callType=="number"){n.callType=e.callType;break}break;case"Normal":case 0:n.callType=0;break;case"Meeting":case 1:n.callType=1;break;case"Live":case 2:n.callType=2;break}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null,O.callType=n.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),e.callType!=null&&e.hasOwnProperty("callType")&&(O.callType=n.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinReq"},_}(),E.JoinRsp=function(){function _(k){if(this.roomUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.roomUsers=$util.emptyArray,_.prototype.callType=0,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.roomUsers!=null&&e.roomUsers.length)for(let O=0;O<e.roomUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.roomUsers[O],n.uint32(18).fork()).ldelim();return e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&n.uint32(24).int32(e.callType),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.roomUsers&&$.roomUsers.length||($.roomUsers=[]),$.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{$.callType=e.int32();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let n=0;n<e.roomUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.roomUsers[n]);if(O)return"roomUsers."+O}}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinRsp)return e;let n=new $root.com.quick.voice.proto.JoinRsp;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");n.roomUsers=[];for(let O=0;O<e.roomUsers.length;++O){if(typeof e.roomUsers[O]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");n.roomUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[O])}}switch(e.callType){default:if(typeof e.callType=="number"){n.callType=e.callType;break}break;case"Normal":case 0:n.callType=0;break;case"Meeting":case 1:n.callType=1;break;case"Live":case 2:n.callType=2;break}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.roomUsers=[]),n.defaults&&(O.roomId="",O.callType=n.enums===String?"Normal":0),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.roomUsers&&e.roomUsers.length){O.roomUsers=[];for(let $=0;$<e.roomUsers.length;++$)O.roomUsers[$]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[$],n)}return e.callType!=null&&e.hasOwnProperty("callType")&&(O.callType=n.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinRsp"},_}(),E.JoinNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinNotify)return e;let n=new $root.com.quick.voice.proto.JoinNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinNotify"},_}(),E.ConnectCFReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.sdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(10).string(e.sdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.sdp=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFReq)return e;let n=new $root.com.quick.voice.proto.ConnectCFReq;return e.sdp!=null&&(n.sdp=String(e.sdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFReq"},_}(),E.ConnectCFRsp=function(){function _(k){if(this.subscribeUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.subscribeUsers=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.subscribeUsers!=null&&e.subscribeUsers.length)for(let O=0;O<e.subscribeUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.subscribeUsers[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ConnectCFRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.subscribeUsers&&$.subscribeUsers.length||($.subscribeUsers=[]),$.subscribeUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.subscribeUsers!=null&&e.hasOwnProperty("subscribeUsers")){if(!Array.isArray(e.subscribeUsers))return"subscribeUsers: array expected";for(let n=0;n<e.subscribeUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.subscribeUsers[n]);if(O)return"subscribeUsers."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFRsp)return e;let n=new $root.com.quick.voice.proto.ConnectCFRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.subscribeUsers){if(!Array.isArray(e.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");n.subscribeUsers=[];for(let O=0;O<e.subscribeUsers.length;++O){if(typeof e.subscribeUsers[O]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");n.subscribeUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.subscribeUsers[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.subscribeUsers=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.subscribeUsers&&e.subscribeUsers.length){O.subscribeUsers=[];for(let $=0;$<e.subscribeUsers.length;++$)O.subscribeUsers[$]=$root.com.quick.voice.proto.User.toObject(e.subscribeUsers[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFRsp"},_}(),E.PublishReq=function(){function _(e){if(this.tracks=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.sdp="",_.prototype.tracks=$util.emptyArray,_.prototype.callAction=0,_.prototype.recreate=null;let k;return Object.defineProperty(_.prototype,"_recreate",{get:$util.oneOfGetter(k=["recreate"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.sdp!=null&&Object.hasOwnProperty.call(n,"sdp")&&O.uint32(10).string(n.sdp),n.tracks!=null&&n.tracks.length)for(let $=0;$<n.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(n.tracks[$],O.uint32(18).fork()).ldelim();return n.callAction!=null&&Object.hasOwnProperty.call(n,"callAction")&&O.uint32(24).int32(n.callAction),n.recreate!=null&&Object.hasOwnProperty.call(n,"recreate")&&O.uint32(32).bool(n.recreate),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.PublishReq;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.sdp=n.string();break}case 2:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 3:{N.callAction=n.int32();break}case 4:{N.recreate=n.bool();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.sdp!=null&&n.hasOwnProperty("sdp")&&!$util.isString(n.sdp))return"sdp: string expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let O=0;O<n.tracks.length;++O){let $=$root.com.quick.voice.proto.Track.verify(n.tracks[O]);if($)return"tracks."+$}}return n.callAction!=null&&n.hasOwnProperty("callAction")&&!$util.isInteger(n.callAction)?"callAction: integer expected":n.recreate!=null&&n.hasOwnProperty("recreate")&&typeof n.recreate!="boolean"?"recreate: boolean expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PublishReq)return n;let O=new $root.com.quick.voice.proto.PublishReq;if(n.sdp!=null&&(O.sdp=String(n.sdp)),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");O.tracks=[];for(let $=0;$<n.tracks.length;++$){if(typeof n.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");O.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[$])}}return n.callAction!=null&&(O.callAction=n.callAction|0),n.recreate!=null&&(O.recreate=!!n.recreate),O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.tracks=[]),O.defaults&&($.sdp="",$.callAction=0),n.sdp!=null&&n.hasOwnProperty("sdp")&&($.sdp=n.sdp),n.tracks&&n.tracks.length){$.tracks=[];for(let N=0;N<n.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(n.tracks[N],O)}return n.callAction!=null&&n.hasOwnProperty("callAction")&&($.callAction=n.callAction),n.recreate!=null&&n.hasOwnProperty("recreate")&&($.recreate=n.recreate,O.oneofs&&($._recreate="recreate")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PublishReq"},_}(),E.PublishRsp=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PublishRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp)?"remoteSdp: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishRsp)return e;let n=new $root.com.quick.voice.proto.PublishRsp;return e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishRsp"},_}(),E.PublishNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PublishNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PublishNotify)return e;let n=new $root.com.quick.voice.proto.PublishNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PublishNotify"},_}(),E.SubscribeReq=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(10).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SubscribeReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeReq)return e;let n=new $root.com.quick.voice.proto.SubscribeReq;if(e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeReq"},_}(),E.SubscribeRsp=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SubscribeRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SubscribeRsp)return e;let n=new $root.com.quick.voice.proto.SubscribeRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SubscribeRsp"},_}(),E.RenegotiateReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.sdp="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(18).string(e.sdp),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.sdp=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RenegotiateReq)return e;let n=new $root.com.quick.voice.proto.RenegotiateReq;return e.userId!=null&&(n.userId=String(e.userId)),e.sdp!=null&&(n.sdp=String(e.sdp)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.sdp=""),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RenegotiateReq"},_}(),E.QuitReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(18).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.QuitReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.QuitReq)return e;let n=new $root.com.quick.voice.proto.QuitReq;return e.userId!=null&&(n.userId=String(e.userId)),e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.roomId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.QuitReq"},_}(),E.QuitNotify=function(){function _(e){if(e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.roomId="",_.prototype.user=null,_.prototype.code=null,_.prototype.desc=null;let k;return Object.defineProperty(_.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){return O||(O=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&O.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,O.uint32(18).fork()).ldelim(),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&O.uint32(24).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&O.uint32(34).string(n.desc),O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.QuitNotify;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.roomId=n.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}case 3:{N.code=n.int32();break}case 4:{N.desc=n.string();break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let O=$root.com.quick.voice.proto.User.verify(n.user);if(O)return"user."+O}return n.code!=null&&n.hasOwnProperty("code")&&!$util.isInteger(n.code)?"code: integer expected":n.desc!=null&&n.hasOwnProperty("desc")&&!$util.isString(n.desc)?"desc: string expected":null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.QuitNotify)return n;let O=new $root.com.quick.voice.proto.QuitNotify;if(n.roomId!=null&&(O.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");O.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return n.code!=null&&(O.code=n.code|0),n.desc!=null&&(O.desc=String(n.desc)),O},_.toObject=function(n,O){O||(O={});let $={};return O.defaults&&($.roomId="",$.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&($.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(n.user,O)),n.code!=null&&n.hasOwnProperty("code")&&($.code=n.code,O.oneofs&&($._code="code")),n.desc!=null&&n.hasOwnProperty("desc")&&($.desc=n.desc,O.oneofs&&($._desc="desc")),$},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.QuitNotify"},_}(),E.TokenExpireNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.TokenExpireNotify)return e;let n=new $root.com.quick.voice.proto.TokenExpireNotify;return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.TokenExpireNotify"},_}(),E.UpdateTokenReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.sdkToken="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&n.uint32(18).string(e.sdkToken),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.sdkToken=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTokenReq)return e;let n=new $root.com.quick.voice.proto.UpdateTokenReq;return e.roomId!=null&&(n.roomId=String(e.roomId)),e.sdkToken!=null&&(n.sdkToken=String(e.sdkToken)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.sdkToken=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(O.sdkToken=e.sdkToken),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTokenReq"},_}(),E.NetQualityChange=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.userId="",_.prototype.roomId="",_.prototype.egress=0,_.prototype.ingress=0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(18).string(e.roomId),e.egress!=null&&Object.hasOwnProperty.call(e,"egress")&&n.uint32(24).int32(e.egress),e.ingress!=null&&Object.hasOwnProperty.call(e,"ingress")&&n.uint32(32).int32(e.ingress),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.userId=e.string();break}case 2:{$.roomId=e.string();break}case 3:{$.egress=e.int32();break}case 4:{$.ingress=e.int32();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.egress!=null&&e.hasOwnProperty("egress")&&!$util.isInteger(e.egress)?"egress: integer expected":e.ingress!=null&&e.hasOwnProperty("ingress")&&!$util.isInteger(e.ingress)?"ingress: integer expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityChange)return e;let n=new $root.com.quick.voice.proto.NetQualityChange;return e.userId!=null&&(n.userId=String(e.userId)),e.roomId!=null&&(n.roomId=String(e.roomId)),e.egress!=null&&(n.egress=e.egress|0),e.ingress!=null&&(n.ingress=e.ingress|0),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.userId="",O.roomId="",O.egress=0,O.ingress=0),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.egress!=null&&e.hasOwnProperty("egress")&&(O.egress=e.egress),e.ingress!=null&&e.hasOwnProperty("ingress")&&(O.ingress=e.ingress),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityChange"},_}(),E.NetQualityNotify=function(){function _(k){if(this.qualities=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.qualities=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.qualities!=null&&e.qualities.length)for(let O=0;O<e.qualities.length;++O)$root.com.quick.voice.proto.NetQualityChange.encode(e.qualities[O],n.uint32(10).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.qualities&&$.qualities.length||($.qualities=[]),$.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.qualities!=null&&e.hasOwnProperty("qualities")){if(!Array.isArray(e.qualities))return"qualities: array expected";for(let n=0;n<e.qualities.length;++n){let O=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[n]);if(O)return"qualities."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityNotify)return e;let n=new $root.com.quick.voice.proto.NetQualityNotify;if(e.qualities){if(!Array.isArray(e.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");n.qualities=[];for(let O=0;O<e.qualities.length;++O){if(typeof e.qualities[O]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");n.qualities[O]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.qualities=[]),e.qualities&&e.qualities.length){O.qualities=[];for(let $=0;$<e.qualities.length;++$)O.qualities[$]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityNotify"},_}(),E.UpdateCall=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateCall)return e;let n=new $root.com.quick.voice.proto.UpdateCall;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateCall"},_}(),E.SyncRoomInfoReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return e;let n=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoReq"},_}(),E.SyncRoomInfoRsp=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.isValid=!1,_.prototype.users=$util.emptyArray,_.prototype.isActive=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.isValid!=null&&Object.hasOwnProperty.call(e,"isValid")&&n.uint32(16).bool(e.isValid),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(26).fork()).ldelim();return e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&n.uint32(32).bool(e.isActive),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.isValid=e.bool();break}case 3:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 4:{$.isActive=e.bool();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.isValid!=null&&e.hasOwnProperty("isValid")&&typeof e.isValid!="boolean")return"isValid: boolean expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return e;let n=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.isValid!=null&&(n.isValid=!!e.isValid),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return e.isActive!=null&&(n.isActive=!!e.isActive),n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId="",O.isValid=!1,O.isActive=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.isValid!=null&&e.hasOwnProperty("isValid")&&(O.isValid=e.isValid),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return e.isActive!=null&&e.hasOwnProperty("isActive")&&(O.isActive=e.isActive),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoRsp"},_}(),E.UpdateTime=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(8).int64(e.time),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.time=e.int64();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTime)return e;let n=new $root.com.quick.voice.proto.UpdateTime;return e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults)if($util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTime"},_}(),E.CloseTrackReq=function(){function _(k){if(this.tracks=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.sdp="",_.prototype.tracks=$util.emptyArray,_.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&n.uint32(10).string(e.sdp),e.tracks!=null&&e.tracks.length)for(let O=0;O<e.tracks.length;++O)$root.com.quick.voice.proto.Track.encode(e.tracks[O],n.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(26).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.sdp=e.string();break}case 2:{$.tracks&&$.tracks.length||($.tracks=[]),$.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp))return"sdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let n=0;n<e.tracks.length;++n){let O=$root.com.quick.voice.proto.Track.verify(e.tracks[n]);if(O)return"tracks."+O}}return e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackReq)return e;let n=new $root.com.quick.voice.proto.CloseTrackReq;if(e.sdp!=null&&(n.sdp=String(e.sdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");n.tracks=[];for(let O=0;O<e.tracks.length;++O){if(typeof e.tracks[O]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");n.tracks[O]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[O])}}return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.tracks=[]),n.defaults&&(O.sdp="",O.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(O.sdp=e.sdp),e.tracks&&e.tracks.length){O.tracks=[];for(let $=0;$<e.tracks.length;++$)O.tracks[$]=$root.com.quick.voice.proto.Track.toObject(e.tracks[$],n)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackReq"},_}(),E.CloseTrackRsp=function(){function _(k){if(this.tracks=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.remoteSdp="",_.prototype.tracks=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&n.uint32(10).string(e.remoteSdp),e.tracks!=null&&e.tracks.length)for(let O=0;O<e.tracks.length;++O)$root.com.quick.voice.proto.Track.encode(e.tracks[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.remoteSdp=e.string();break}case 2:{$.tracks&&$.tracks.length||($.tracks=[]),$.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let n=0;n<e.tracks.length;++n){let O=$root.com.quick.voice.proto.Track.verify(e.tracks[n]);if(O)return"tracks."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackRsp)return e;let n=new $root.com.quick.voice.proto.CloseTrackRsp;if(e.remoteSdp!=null&&(n.remoteSdp=String(e.remoteSdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");n.tracks=[];for(let O=0;O<e.tracks.length;++O){if(typeof e.tracks[O]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");n.tracks[O]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.tracks=[]),n.defaults&&(O.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(O.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){O.tracks=[];for(let $=0;$<e.tracks.length;++$)O.tracks[$]=$root.com.quick.voice.proto.Track.toObject(e.tracks[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackRsp"},_}(),E.CloseTrackNotify=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(10).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackNotify)return e;let n=new $root.com.quick.voice.proto.CloseTrackNotify;if(e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.user=null),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackNotify"},_}(),E.ToggleLiveRoomReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return e;let n=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return e.roomId!=null&&(n.roomId=String(e.roomId)),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomReq"},_}(),E.ToggleLiveRoomRsq=function(){function _(k){if(this.roomUsers=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.hash="",_.prototype.roomUsers=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.hash!=null&&Object.hasOwnProperty.call(e,"hash")&&n.uint32(18).string(e.hash),e.roomUsers!=null&&e.roomUsers.length)for(let O=0;O<e.roomUsers.length;++O)$root.com.quick.voice.proto.User.encode(e.roomUsers[O],n.uint32(26).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.hash=e.string();break}case 3:{$.roomUsers&&$.roomUsers.length||($.roomUsers=[]),$.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.hash!=null&&e.hasOwnProperty("hash")&&!$util.isString(e.hash))return"hash: string expected";if(e.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let n=0;n<e.roomUsers.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.roomUsers[n]);if(O)return"roomUsers."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return e;let n=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.hash!=null&&(n.hash=String(e.hash)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");n.roomUsers=[];for(let O=0;O<e.roomUsers.length;++O){if(typeof e.roomUsers[O]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");n.roomUsers[O]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.roomUsers=[]),n.defaults&&(O.roomId="",O.hash=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.hash!=null&&e.hasOwnProperty("hash")&&(O.hash=e.hash),e.roomUsers&&e.roomUsers.length){O.roomUsers=[];for(let $=0;$<e.roomUsers.length;++$)O.roomUsers[$]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ToggleLiveRoomRsq"},_}(),E.TrackType=function(){const _={},k=Object.create(_);return k[_[0]="Microphone"]=0,k[_[1]="Camera"]=1,k[_[2]="Screen"]=2,k[_[3]="SystemVoice"]=3,k}(),E.ReportInfoReq=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.actionEvent="",_.prototype.userId="",_.prototype.platform="",_.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,_.prototype.actionData="",_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.actionEvent!=null&&Object.hasOwnProperty.call(e,"actionEvent")&&n.uint32(10).string(e.actionEvent),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&n.uint32(18).string(e.userId),e.platform!=null&&Object.hasOwnProperty.call(e,"platform")&&n.uint32(26).string(e.platform),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&n.uint32(32).int64(e.time),e.actionData!=null&&Object.hasOwnProperty.call(e,"actionData")&&n.uint32(42).string(e.actionData),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.ReportInfoReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.actionEvent=e.string();break}case 2:{$.userId=e.string();break}case 3:{$.platform=e.string();break}case 4:{$.time=e.int64();break}case 5:{$.actionData=e.string();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){return typeof e!="object"||e===null?"object expected":e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&!$util.isString(e.actionEvent)?"actionEvent: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.platform!=null&&e.hasOwnProperty("platform")&&!$util.isString(e.platform)?"platform: string expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.actionData!=null&&e.hasOwnProperty("actionData")&&!$util.isString(e.actionData)?"actionData: string expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ReportInfoReq)return e;let n=new $root.com.quick.voice.proto.ReportInfoReq;return e.actionEvent!=null&&(n.actionEvent=String(e.actionEvent)),e.userId!=null&&(n.userId=String(e.userId)),e.platform!=null&&(n.platform=String(e.platform)),e.time!=null&&($util.Long?(n.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?n.time=parseInt(e.time,10):typeof e.time=="number"?n.time=e.time:typeof e.time=="object"&&(n.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.actionData!=null&&(n.actionData=String(e.actionData)),n},_.toObject=function(e,n){n||(n={});let O={};if(n.defaults){if(O.actionEvent="",O.userId="",O.platform="",$util.Long){let $=new $util.Long(0,0,!1);O.time=n.longs===String?$.toString():n.longs===Number?$.toNumber():$}else O.time=n.longs===String?"0":0;O.actionData=""}return e.actionEvent!=null&&e.hasOwnProperty("actionEvent")&&(O.actionEvent=e.actionEvent),e.userId!=null&&e.hasOwnProperty("userId")&&(O.userId=e.userId),e.platform!=null&&e.hasOwnProperty("platform")&&(O.platform=e.platform),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?O.time=n.longs===String?String(e.time):e.time:O.time=n.longs===String?$util.Long.prototype.toString.call(e.time):n.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.actionData!=null&&e.hasOwnProperty("actionData")&&(O.actionData=e.actionData),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ReportInfoReq"},_}(),E.UpdatePermissions=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.user=null,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,n.uint32(18).fork()).ldelim(),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let n=$root.com.quick.voice.proto.User.verify(e.user);if(n)return"user."+n}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdatePermissions)return e;let n=new $root.com.quick.voice.proto.UpdatePermissions;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");n.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.roomId="",O.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(O.user=$root.com.quick.voice.proto.User.toObject(e.user,n)),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdatePermissions"},_}(),E.CallType=function(){const _={},k=Object.create(_);return k[_[0]="Normal"]=0,k[_[1]="Meeting"]=1,k[_[2]="Live"]=2,k}(),E.QuitNotifyCode=function(){const _={},k=Object.create(_);return k[_[0]="NormalQuit"]=0,k[_[2021]="Timeout"]=2021,k[_[2011]="TokenExpired"]=2011,k[_[2022]="KickOut"]=2022,k[_[2023]="EndPk"]=2023,k[_[2024]="EndLive"]=2024,k}(),E.UserBehavior=function(){function _(k){if(k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.type=0,_.prototype.behavior=!1,_.create=function(e){return new _(e)},_.encode=function(e,n){return n||(n=$Writer.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&n.uint32(8).int32(e.type),e.behavior!=null&&Object.hasOwnProperty.call(e,"behavior")&&n.uint32(16).bool(e.behavior),n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.type=e.int32();break}case 2:{$.behavior=e.bool();break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return e.behavior!=null&&e.hasOwnProperty("behavior")&&typeof e.behavior!="boolean"?"behavior: boolean expected":null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserBehavior)return e;let n=new $root.com.quick.voice.proto.UserBehavior;switch(e.type){default:if(typeof e.type=="number"){n.type=e.type;break}break;case"Microphone":case 0:n.type=0;break;case"Camera":case 1:n.type=1;break;case"Screen":case 2:n.type=2;break;case"SystemVoice":case 3:n.type=3;break}return e.behavior!=null&&(n.behavior=!!e.behavior),n},_.toObject=function(e,n){n||(n={});let O={};return n.defaults&&(O.type=n.enums===String?"Microphone":0,O.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(O.type=n.enums===String?$root.com.quick.voice.proto.TrackType[e.type]===void 0?e.type:$root.com.quick.voice.proto.TrackType[e.type]:e.type),e.behavior!=null&&e.hasOwnProperty("behavior")&&(O.behavior=e.behavior),O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserBehavior"},_}(),E.PreventUser=function(){function _(k){if(this.behaviors=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.id="",_.prototype.behaviors=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&n.uint32(10).string(e.id),e.behaviors!=null&&e.behaviors.length)for(let O=0;O<e.behaviors.length;++O)$root.com.quick.voice.proto.UserBehavior.encode(e.behaviors[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.id=e.string();break}case 2:{$.behaviors&&$.behaviors.length||($.behaviors=[]),$.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.id!=null&&e.hasOwnProperty("id")&&!$util.isString(e.id))return"id: string expected";if(e.behaviors!=null&&e.hasOwnProperty("behaviors")){if(!Array.isArray(e.behaviors))return"behaviors: array expected";for(let n=0;n<e.behaviors.length;++n){let O=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[n]);if(O)return"behaviors."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUser)return e;let n=new $root.com.quick.voice.proto.PreventUser;if(e.id!=null&&(n.id=String(e.id)),e.behaviors){if(!Array.isArray(e.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");n.behaviors=[];for(let O=0;O<e.behaviors.length;++O){if(typeof e.behaviors[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");n.behaviors[O]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.behaviors=[]),n.defaults&&(O.id=""),e.id!=null&&e.hasOwnProperty("id")&&(O.id=e.id),e.behaviors&&e.behaviors.length){O.behaviors=[];for(let $=0;$<e.behaviors.length;++$)O.behaviors[$]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUser"},_}(),E.PreventUsersBehaviorReq=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.PreventUser.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.PreventUser.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return e;let n=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");n.users[O]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorReq"},_}(),E.PreventUsersBehaviorNotify=function(){function _(k){if(this.users=[],k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.roomId="",_.prototype.users=$util.emptyArray,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&n.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let O=0;O<e.users.length;++O)$root.com.quick.voice.proto.User.encode(e.users[O],n.uint32(18).fork()).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<O;){let N=e.uint32();switch(N>>>3){case 1:{$.roomId=e.string();break}case 2:{$.users&&$.users.length||($.users=[]),$.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(N&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let n=0;n<e.users.length;++n){let O=$root.com.quick.voice.proto.User.verify(e.users[n]);if(O)return"users."+O}}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return e;let n=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(e.roomId!=null&&(n.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");n.users=[];for(let O=0;O<e.users.length;++O){if(typeof e.users[O]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");n.users[O]=$root.com.quick.voice.proto.User.fromObject(e.users[O])}}return n},_.toObject=function(e,n){n||(n={});let O={};if((n.arrays||n.defaults)&&(O.users=[]),n.defaults&&(O.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(O.roomId=e.roomId),e.users&&e.users.length){O.users=[];for(let $=0;$<e.users.length;++$)O.users[$]=$root.com.quick.voice.proto.User.toObject(e.users[$],n)}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},_}(),E.AccelerationAreas=function(){const _={},k=Object.create(_);return k[_[0]="chinaMainland"]=0,k[_[1]="global"]=1,k[_[2]="overseas"]=2,k}(),E.CountMethods=function(){const _={},k=Object.create(_);return k[_[0]="flow"]=0,k[_[1]="minutes"]=1,k}(),E.BaseCDNAddress=function(){function _(k){if(this.urlMap={},k)for(let e=Object.keys(k),n=0;n<e.length;++n)k[e[n]]!=null&&(this[e[n]]=k[e[n]])}return _.prototype.area=0,_.prototype.countType=0,_.prototype.urlMap=$util.emptyObject,_.create=function(e){return new _(e)},_.encode=function(e,n){if(n||(n=$Writer.create()),e.area!=null&&Object.hasOwnProperty.call(e,"area")&&n.uint32(8).int32(e.area),e.countType!=null&&Object.hasOwnProperty.call(e,"countType")&&n.uint32(16).int32(e.countType),e.urlMap!=null&&Object.hasOwnProperty.call(e,"urlMap"))for(let O=Object.keys(e.urlMap),$=0;$<O.length;++$)n.uint32(26).fork().uint32(10).string(O[$]).uint32(18).string(e.urlMap[O[$]]).ldelim();return n},_.encodeDelimited=function(e,n){return this.encode(e,n).ldelim()},_.decode=function(e,n){e instanceof $Reader||(e=$Reader.create(e));let O=n===void 0?e.len:e.pos+n,$=new $root.com.quick.voice.proto.BaseCDNAddress,N,D;for(;e.pos<O;){let q=e.uint32();switch(q>>>3){case 1:{$.area=e.int32();break}case 2:{$.countType=e.int32();break}case 3:{$.urlMap===$util.emptyObject&&($.urlMap={});let P=e.uint32()+e.pos;for(N="",D="";e.pos<P;){let j=e.uint32();switch(j>>>3){case 1:N=e.string();break;case 2:D=e.string();break;default:e.skipType(j&7);break}}$.urlMap[N]=D;break}default:e.skipType(q&7);break}}return $},_.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},_.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.area!=null&&e.hasOwnProperty("area"))switch(e.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(e.countType!=null&&e.hasOwnProperty("countType"))switch(e.countType){default:return"countType: enum value expected";case 0:case 1:break}if(e.urlMap!=null&&e.hasOwnProperty("urlMap")){if(!$util.isObject(e.urlMap))return"urlMap: object expected";let n=Object.keys(e.urlMap);for(let O=0;O<n.length;++O)if(!$util.isString(e.urlMap[n[O]]))return"urlMap: string{k:string} expected"}return null},_.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.BaseCDNAddress)return e;let n=new $root.com.quick.voice.proto.BaseCDNAddress;switch(e.area){default:if(typeof e.area=="number"){n.area=e.area;break}break;case"chinaMainland":case 0:n.area=0;break;case"global":case 1:n.area=1;break;case"overseas":case 2:n.area=2;break}switch(e.countType){default:if(typeof e.countType=="number"){n.countType=e.countType;break}break;case"flow":case 0:n.countType=0;break;case"minutes":case 1:n.countType=1;break}if(e.urlMap){if(typeof e.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");n.urlMap={};for(let O=Object.keys(e.urlMap),$=0;$<O.length;++$)n.urlMap[O[$]]=String(e.urlMap[O[$]])}return n},_.toObject=function(e,n){n||(n={});let O={};(n.objects||n.defaults)&&(O.urlMap={}),n.defaults&&(O.area=n.enums===String?"chinaMainland":0,O.countType=n.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(O.area=n.enums===String?$root.com.quick.voice.proto.AccelerationAreas[e.area]===void 0?e.area:$root.com.quick.voice.proto.AccelerationAreas[e.area]:e.area),e.countType!=null&&e.hasOwnProperty("countType")&&(O.countType=n.enums===String?$root.com.quick.voice.proto.CountMethods[e.countType]===void 0?e.countType:$root.com.quick.voice.proto.CountMethods[e.countType]:e.countType);let $;if(e.urlMap&&($=Object.keys(e.urlMap)).length){O.urlMap={};for(let N=0;N<$.length;++N)O.urlMap[$[N]]=e.urlMap[$[N]]}return O},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.BaseCDNAddress"},_}(),E.CDNPlayAddressNotify=function(){function _(e){if(this.standLines=[],e)for(let n=Object.keys(e),O=0;O<n.length;++O)e[n[O]]!=null&&(this[n[O]]=e[n[O]])}_.prototype.roomId="",_.prototype.m3u8=null,_.prototype.rtmp=null,_.prototype.flv=null,_.prototype.rtmps=null,_.prototype.mainLine=null,_.prototype.standLines=$util.emptyArray;let k;return Object.defineProperty(_.prototype,"_m3u8",{get:$util.oneOfGetter(k=["m3u8"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_rtmp",{get:$util.oneOfGetter(k=["rtmp"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_flv",{get:$util.oneOfGetter(k=["flv"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_rtmps",{get:$util.oneOfGetter(k=["rtmps"]),set:$util.oneOfSetter(k)}),Object.defineProperty(_.prototype,"_mainLine",{get:$util.oneOfGetter(k=["mainLine"]),set:$util.oneOfSetter(k)}),_.create=function(n){return new _(n)},_.encode=function(n,O){if(O||(O=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&O.uint32(10).string(n.roomId),n.m3u8!=null&&Object.hasOwnProperty.call(n,"m3u8")&&O.uint32(18).string(n.m3u8),n.rtmp!=null&&Object.hasOwnProperty.call(n,"rtmp")&&O.uint32(26).string(n.rtmp),n.flv!=null&&Object.hasOwnProperty.call(n,"flv")&&O.uint32(34).string(n.flv),n.rtmps!=null&&Object.hasOwnProperty.call(n,"rtmps")&&O.uint32(42).string(n.rtmps),n.mainLine!=null&&Object.hasOwnProperty.call(n,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(n.mainLine,O.uint32(50).fork()).ldelim(),n.standLines!=null&&n.standLines.length)for(let $=0;$<n.standLines.length;++$)$root.com.quick.voice.proto.BaseCDNAddress.encode(n.standLines[$],O.uint32(58).fork()).ldelim();return O},_.encodeDelimited=function(n,O){return this.encode(n,O).ldelim()},_.decode=function(n,O){n instanceof $Reader||(n=$Reader.create(n));let $=O===void 0?n.len:n.pos+O,N=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;n.pos<$;){let D=n.uint32();switch(D>>>3){case 1:{N.roomId=n.string();break}case 2:{N.m3u8=n.string();break}case 3:{N.rtmp=n.string();break}case 4:{N.flv=n.string();break}case 5:{N.rtmps=n.string();break}case 6:{N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(n,n.uint32());break}case 7:{N.standLines&&N.standLines.length||(N.standLines=[]),N.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(n,n.uint32()));break}default:n.skipType(D&7);break}}return N},_.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},_.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.m3u8!=null&&n.hasOwnProperty("m3u8")&&!$util.isString(n.m3u8))return"m3u8: string expected";if(n.rtmp!=null&&n.hasOwnProperty("rtmp")&&!$util.isString(n.rtmp))return"rtmp: string expected";if(n.flv!=null&&n.hasOwnProperty("flv")&&!$util.isString(n.flv))return"flv: string expected";if(n.rtmps!=null&&n.hasOwnProperty("rtmps")&&!$util.isString(n.rtmps))return"rtmps: string expected";if(n.mainLine!=null&&n.hasOwnProperty("mainLine")){let O=$root.com.quick.voice.proto.BaseCDNAddress.verify(n.mainLine);if(O)return"mainLine."+O}if(n.standLines!=null&&n.hasOwnProperty("standLines")){if(!Array.isArray(n.standLines))return"standLines: array expected";for(let O=0;O<n.standLines.length;++O){let $=$root.com.quick.voice.proto.BaseCDNAddress.verify(n.standLines[O]);if($)return"standLines."+$}}return null},_.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return n;let O=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(n.roomId!=null&&(O.roomId=String(n.roomId)),n.m3u8!=null&&(O.m3u8=String(n.m3u8)),n.rtmp!=null&&(O.rtmp=String(n.rtmp)),n.flv!=null&&(O.flv=String(n.flv)),n.rtmps!=null&&(O.rtmps=String(n.rtmps)),n.mainLine!=null){if(typeof n.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");O.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(n.mainLine)}if(n.standLines){if(!Array.isArray(n.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");O.standLines=[];for(let $=0;$<n.standLines.length;++$){if(typeof n.standLines[$]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");O.standLines[$]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(n.standLines[$])}}return O},_.toObject=function(n,O){O||(O={});let $={};if((O.arrays||O.defaults)&&($.standLines=[]),O.defaults&&($.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&($.roomId=n.roomId),n.m3u8!=null&&n.hasOwnProperty("m3u8")&&($.m3u8=n.m3u8,O.oneofs&&($._m3u8="m3u8")),n.rtmp!=null&&n.hasOwnProperty("rtmp")&&($.rtmp=n.rtmp,O.oneofs&&($._rtmp="rtmp")),n.flv!=null&&n.hasOwnProperty("flv")&&($.flv=n.flv,O.oneofs&&($._flv="flv")),n.rtmps!=null&&n.hasOwnProperty("rtmps")&&($.rtmps=n.rtmps,O.oneofs&&($._rtmps="rtmps")),n.mainLine!=null&&n.hasOwnProperty("mainLine")&&($.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(n.mainLine,O),O.oneofs&&($._mainLine="mainLine")),n.standLines&&n.standLines.length){$.standLines=[];for(let N=0;N<n.standLines.length;++N)$.standLines[N]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(n.standLines[N],O)}return $},_.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},_.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CDNPlayAddressNotify"},_}(),E}(),a}(),I}(),u})(),ignoreEvent=["networkQualityChange","onNetQuality"],enum_notifyName={onChangeNetwork:"网络情况变更",healthCheck:"心跳检测",onNetQuality:"网络质量回调",onLogin:"登录回调",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",onRoomState:"房间状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",onUpdatePermissions:"更新推流权限通知",onTokenExpired:"Token已过期",onDestroyRoom:"直播模式房间销毁",destroyRoom:"服务器要求销毁房间",onCDNPlayUrlAdd:"cdn播放地址变化",onDestroy:"SDK销毁"};pt(enum_notifyName);const notifyName_keys=Object.keys(enum_notifyName);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(u){let I=u.length;for(;--I>=0;)u[I]=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(u,I,a,E,_){this.static_tree=u,this.extra_bits=I,this.extra_base=a,this.elems=E,this.max_length=_,this.has_stree=u&&u.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(u,I){this.dyn_tree=u,this.max_code=0,this.stat_desc=I}const d_code=u=>u<256?_dist_code[u]:_dist_code[256+(u>>>7)],put_short=(u,I)=>{u.pending_buf[u.pending++]=I&255,u.pending_buf[u.pending++]=I>>>8&255},send_bits=(u,I,a)=>{u.bi_valid>Buf_size-a?(u.bi_buf|=I<<u.bi_valid&65535,put_short(u,u.bi_buf),u.bi_buf=I>>Buf_size-u.bi_valid,u.bi_valid+=a-Buf_size):(u.bi_buf|=I<<u.bi_valid&65535,u.bi_valid+=a)},send_code=(u,I,a)=>{send_bits(u,a[I*2],a[I*2+1])},bi_reverse=(u,I)=>{let a=0;do a|=u&1,u>>>=1,a<<=1;while(--I>0);return a>>>1},bi_flush=u=>{u.bi_valid===16?(put_short(u,u.bi_buf),u.bi_buf=0,u.bi_valid=0):u.bi_valid>=8&&(u.pending_buf[u.pending++]=u.bi_buf&255,u.bi_buf>>=8,u.bi_valid-=8)},gen_bitlen=(u,I)=>{const a=I.dyn_tree,E=I.max_code,_=I.stat_desc.static_tree,k=I.stat_desc.has_stree,e=I.stat_desc.extra_bits,n=I.stat_desc.extra_base,O=I.stat_desc.max_length;let $,N,D,q,P,j,V=0;for(q=0;q<=MAX_BITS$1;q++)u.bl_count[q]=0;for(a[u.heap[u.heap_max]*2+1]=0,$=u.heap_max+1;$<HEAP_SIZE$1;$++)N=u.heap[$],q=a[a[N*2+1]*2+1]+1,q>O&&(q=O,V++),a[N*2+1]=q,!(N>E)&&(u.bl_count[q]++,P=0,N>=n&&(P=e[N-n]),j=a[N*2],u.opt_len+=j*(q+P),k&&(u.static_len+=j*(_[N*2+1]+P)));if(V!==0){do{for(q=O-1;u.bl_count[q]===0;)q--;u.bl_count[q]--,u.bl_count[q+1]+=2,u.bl_count[O]--,V-=2}while(V>0);for(q=O;q!==0;q--)for(N=u.bl_count[q];N!==0;)D=u.heap[--$],!(D>E)&&(a[D*2+1]!==q&&(u.opt_len+=(q-a[D*2+1])*a[D*2],a[D*2+1]=q),N--)}},gen_codes=(u,I,a)=>{const E=new Array(MAX_BITS$1+1);let _=0,k,e;for(k=1;k<=MAX_BITS$1;k++)_=_+a[k-1]<<1,E[k]=_;for(e=0;e<=I;e++){let n=u[e*2+1];n!==0&&(u[e*2]=bi_reverse(E[n]++,n))}},tr_static_init=()=>{let u,I,a,E,_;const k=new Array(MAX_BITS$1+1);for(a=0,E=0;E<LENGTH_CODES$1-1;E++)for(base_length[E]=a,u=0;u<1<<extra_lbits[E];u++)_length_code[a++]=E;for(_length_code[a-1]=E,_=0,E=0;E<16;E++)for(base_dist[E]=_,u=0;u<1<<extra_dbits[E];u++)_dist_code[_++]=E;for(_>>=7;E<D_CODES$1;E++)for(base_dist[E]=_<<7,u=0;u<1<<extra_dbits[E]-7;u++)_dist_code[256+_++]=E;for(I=0;I<=MAX_BITS$1;I++)k[I]=0;for(u=0;u<=143;)static_ltree[u*2+1]=8,u++,k[8]++;for(;u<=255;)static_ltree[u*2+1]=9,u++,k[9]++;for(;u<=279;)static_ltree[u*2+1]=7,u++,k[7]++;for(;u<=287;)static_ltree[u*2+1]=8,u++,k[8]++;for(gen_codes(static_ltree,L_CODES$1+1,k),u=0;u<D_CODES$1;u++)static_dtree[u*2+1]=5,static_dtree[u*2]=bi_reverse(u,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=u=>{let I;for(I=0;I<L_CODES$1;I++)u.dyn_ltree[I*2]=0;for(I=0;I<D_CODES$1;I++)u.dyn_dtree[I*2]=0;for(I=0;I<BL_CODES$1;I++)u.bl_tree[I*2]=0;u.dyn_ltree[END_BLOCK*2]=1,u.opt_len=u.static_len=0,u.sym_next=u.matches=0},bi_windup=u=>{u.bi_valid>8?put_short(u,u.bi_buf):u.bi_valid>0&&(u.pending_buf[u.pending++]=u.bi_buf),u.bi_buf=0,u.bi_valid=0},smaller=(u,I,a,E)=>{const _=I*2,k=a*2;return u[_]<u[k]||u[_]===u[k]&&E[I]<=E[a]},pqdownheap=(u,I,a)=>{const E=u.heap[a];let _=a<<1;for(;_<=u.heap_len&&(_<u.heap_len&&smaller(I,u.heap[_+1],u.heap[_],u.depth)&&_++,!smaller(I,E,u.heap[_],u.depth));)u.heap[a]=u.heap[_],a=_,_<<=1;u.heap[a]=E},compress_block=(u,I,a)=>{let E,_,k=0,e,n;if(u.sym_next!==0)do E=u.pending_buf[u.sym_buf+k++]&255,E+=(u.pending_buf[u.sym_buf+k++]&255)<<8,_=u.pending_buf[u.sym_buf+k++],E===0?send_code(u,_,I):(e=_length_code[_],send_code(u,e+LITERALS$1+1,I),n=extra_lbits[e],n!==0&&(_-=base_length[e],send_bits(u,_,n)),E--,e=d_code(E),send_code(u,e,a),n=extra_dbits[e],n!==0&&(E-=base_dist[e],send_bits(u,E,n)));while(k<u.sym_next);send_code(u,END_BLOCK,I)},build_tree=(u,I)=>{const a=I.dyn_tree,E=I.stat_desc.static_tree,_=I.stat_desc.has_stree,k=I.stat_desc.elems;let e,n,O=-1,$;for(u.heap_len=0,u.heap_max=HEAP_SIZE$1,e=0;e<k;e++)a[e*2]!==0?(u.heap[++u.heap_len]=O=e,u.depth[e]=0):a[e*2+1]=0;for(;u.heap_len<2;)$=u.heap[++u.heap_len]=O<2?++O:0,a[$*2]=1,u.depth[$]=0,u.opt_len--,_&&(u.static_len-=E[$*2+1]);for(I.max_code=O,e=u.heap_len>>1;e>=1;e--)pqdownheap(u,a,e);$=k;do e=u.heap[1],u.heap[1]=u.heap[u.heap_len--],pqdownheap(u,a,1),n=u.heap[1],u.heap[--u.heap_max]=e,u.heap[--u.heap_max]=n,a[$*2]=a[e*2]+a[n*2],u.depth[$]=(u.depth[e]>=u.depth[n]?u.depth[e]:u.depth[n])+1,a[e*2+1]=a[n*2+1]=$,u.heap[1]=$++,pqdownheap(u,a,1);while(u.heap_len>=2);u.heap[--u.heap_max]=u.heap[1],gen_bitlen(u,I),gen_codes(a,O,u.bl_count)},scan_tree=(u,I,a)=>{let E,_=-1,k,e=I[0*2+1],n=0,O=7,$=4;for(e===0&&(O=138,$=3),I[(a+1)*2+1]=65535,E=0;E<=a;E++)k=e,e=I[(E+1)*2+1],!(++n<O&&k===e)&&(n<$?u.bl_tree[k*2]+=n:k!==0?(k!==_&&u.bl_tree[k*2]++,u.bl_tree[REP_3_6*2]++):n<=10?u.bl_tree[REPZ_3_10*2]++:u.bl_tree[REPZ_11_138*2]++,n=0,_=k,e===0?(O=138,$=3):k===e?(O=6,$=3):(O=7,$=4))},send_tree=(u,I,a)=>{let E,_=-1,k,e=I[0*2+1],n=0,O=7,$=4;for(e===0&&(O=138,$=3),E=0;E<=a;E++)if(k=e,e=I[(E+1)*2+1],!(++n<O&&k===e)){if(n<$)do send_code(u,k,u.bl_tree);while(--n!==0);else k!==0?(k!==_&&(send_code(u,k,u.bl_tree),n--),send_code(u,REP_3_6,u.bl_tree),send_bits(u,n-3,2)):n<=10?(send_code(u,REPZ_3_10,u.bl_tree),send_bits(u,n-3,3)):(send_code(u,REPZ_11_138,u.bl_tree),send_bits(u,n-11,7));n=0,_=k,e===0?(O=138,$=3):k===e?(O=6,$=3):(O=7,$=4)}},build_bl_tree=u=>{let I;for(scan_tree(u,u.dyn_ltree,u.l_desc.max_code),scan_tree(u,u.dyn_dtree,u.d_desc.max_code),build_tree(u,u.bl_desc),I=BL_CODES$1-1;I>=3&&u.bl_tree[bl_order[I]*2+1]===0;I--);return u.opt_len+=3*(I+1)+5+5+4,I},send_all_trees=(u,I,a,E)=>{let _;for(send_bits(u,I-257,5),send_bits(u,a-1,5),send_bits(u,E-4,4),_=0;_<E;_++)send_bits(u,u.bl_tree[bl_order[_]*2+1],3);send_tree(u,u.dyn_ltree,I-1),send_tree(u,u.dyn_dtree,a-1)},detect_data_type=u=>{let I=4093624447,a;for(a=0;a<=31;a++,I>>>=1)if(I&1&&u.dyn_ltree[a*2]!==0)return Z_BINARY;if(u.dyn_ltree[9*2]!==0||u.dyn_ltree[10*2]!==0||u.dyn_ltree[13*2]!==0)return Z_TEXT;for(a=32;a<LITERALS$1;a++)if(u.dyn_ltree[a*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=u=>{static_init_done||(tr_static_init(),static_init_done=!0),u.l_desc=new TreeDesc(u.dyn_ltree,static_l_desc),u.d_desc=new TreeDesc(u.dyn_dtree,static_d_desc),u.bl_desc=new TreeDesc(u.bl_tree,static_bl_desc),u.bi_buf=0,u.bi_valid=0,init_block(u)},_tr_stored_block$1=(u,I,a,E)=>{send_bits(u,(STORED_BLOCK<<1)+(E?1:0),3),bi_windup(u),put_short(u,a),put_short(u,~a),a&&u.pending_buf.set(u.window.subarray(I,I+a),u.pending),u.pending+=a},_tr_align$1=u=>{send_bits(u,STATIC_TREES<<1,3),send_code(u,END_BLOCK,static_ltree),bi_flush(u)},_tr_flush_block$1=(u,I,a,E)=>{let _,k,e=0;u.level>0?(u.strm.data_type===Z_UNKNOWN$1&&(u.strm.data_type=detect_data_type(u)),build_tree(u,u.l_desc),build_tree(u,u.d_desc),e=build_bl_tree(u),_=u.opt_len+3+7>>>3,k=u.static_len+3+7>>>3,k<=_&&(_=k)):_=k=a+5,a+4<=_&&I!==-1?_tr_stored_block$1(u,I,a,E):u.strategy===Z_FIXED$1||k===_?(send_bits(u,(STATIC_TREES<<1)+(E?1:0),3),compress_block(u,static_ltree,static_dtree)):(send_bits(u,(DYN_TREES<<1)+(E?1:0),3),send_all_trees(u,u.l_desc.max_code+1,u.d_desc.max_code+1,e+1),compress_block(u,u.dyn_ltree,u.dyn_dtree)),init_block(u),E&&bi_windup(u)},_tr_tally$1=(u,I,a)=>(u.pending_buf[u.sym_buf+u.sym_next++]=I,u.pending_buf[u.sym_buf+u.sym_next++]=I>>8,u.pending_buf[u.sym_buf+u.sym_next++]=a,I===0?u.dyn_ltree[a*2]++:(u.matches++,I--,u.dyn_ltree[(_length_code[a]+LITERALS$1+1)*2]++,u.dyn_dtree[d_code(I)*2]++),u.sym_next===u.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=(u,I,a,E)=>{let _=u&65535|0,k=u>>>16&65535|0,e=0;for(;a!==0;){e=a>2e3?2e3:a,a-=e;do _=_+I[E++]|0,k=k+_|0;while(--e);_%=65521,k%=65521}return _|k<<16|0};var adler32_1=adler32;const makeTable=()=>{let u,I=[];for(var a=0;a<256;a++){u=a;for(var E=0;E<8;E++)u=u&1?3988292384^u>>>1:u>>>1;I[a]=u}return I},crcTable=new Uint32Array(makeTable()),crc32=(u,I,a,E)=>{const _=crcTable,k=E+a;u^=-1;for(let e=E;e<k;e++)u=u>>>8^_[(u^I[e])&255];return u^-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=(u,I)=>(u.msg=messages[I],I),rank=u=>u*2-(u>4?9:0),zero=u=>{let I=u.length;for(;--I>=0;)u[I]=0},slide_hash=u=>{let I,a,E,_=u.w_size;I=u.hash_size,E=I;do a=u.head[--E],u.head[E]=a>=_?a-_:0;while(--I);I=_,E=I;do a=u.prev[--E],u.prev[E]=a>=_?a-_:0;while(--I)};let HASH_ZLIB=(u,I,a)=>(I<<u.hash_shift^a)&u.hash_mask,HASH=HASH_ZLIB;const flush_pending=u=>{const I=u.state;let a=I.pending;a>u.avail_out&&(a=u.avail_out),a!==0&&(u.output.set(I.pending_buf.subarray(I.pending_out,I.pending_out+a),u.next_out),u.next_out+=a,I.pending_out+=a,u.total_out+=a,u.avail_out-=a,I.pending-=a,I.pending===0&&(I.pending_out=0))},flush_block_only=(u,I)=>{_tr_flush_block(u,u.block_start>=0?u.block_start:-1,u.strstart-u.block_start,I),u.block_start=u.strstart,flush_pending(u.strm)},put_byte=(u,I)=>{u.pending_buf[u.pending++]=I},putShortMSB=(u,I)=>{u.pending_buf[u.pending++]=I>>>8&255,u.pending_buf[u.pending++]=I&255},read_buf=(u,I,a,E)=>{let _=u.avail_in;return _>E&&(_=E),_===0?0:(u.avail_in-=_,I.set(u.input.subarray(u.next_in,u.next_in+_),a),u.state.wrap===1?u.adler=adler32_1(u.adler,I,_,a):u.state.wrap===2&&(u.adler=crc32_1(u.adler,I,_,a)),u.next_in+=_,u.total_in+=_,_)},longest_match=(u,I)=>{let a=u.max_chain_length,E=u.strstart,_,k,e=u.prev_length,n=u.nice_match;const O=u.strstart>u.w_size-MIN_LOOKAHEAD?u.strstart-(u.w_size-MIN_LOOKAHEAD):0,$=u.window,N=u.w_mask,D=u.prev,q=u.strstart+MAX_MATCH;let P=$[E+e-1],j=$[E+e];u.prev_length>=u.good_match&&(a>>=2),n>u.lookahead&&(n=u.lookahead);do if(_=I,!($[_+e]!==j||$[_+e-1]!==P||$[_]!==$[E]||$[++_]!==$[E+1])){E+=2,_++;do;while($[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&$[++E]===$[++_]&&E<q);if(k=MAX_MATCH-(q-E),E=q-MAX_MATCH,k>e){if(u.match_start=I,e=k,k>=n)break;P=$[E+e-1],j=$[E+e]}}while((I=D[I&N])>O&&--a!==0);return e<=u.lookahead?e:u.lookahead},fill_window=u=>{const I=u.w_size;let a,E,_;do{if(E=u.window_size-u.lookahead-u.strstart,u.strstart>=I+(I-MIN_LOOKAHEAD)&&(u.window.set(u.window.subarray(I,I+I-E),0),u.match_start-=I,u.strstart-=I,u.block_start-=I,u.insert>u.strstart&&(u.insert=u.strstart),slide_hash(u),E+=I),u.strm.avail_in===0)break;if(a=read_buf(u.strm,u.window,u.strstart+u.lookahead,E),u.lookahead+=a,u.lookahead+u.insert>=MIN_MATCH)for(_=u.strstart-u.insert,u.ins_h=u.window[_],u.ins_h=HASH(u,u.ins_h,u.window[_+1]);u.insert&&(u.ins_h=HASH(u,u.ins_h,u.window[_+MIN_MATCH-1]),u.prev[_&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=_,_++,u.insert--,!(u.lookahead+u.insert<MIN_MATCH)););}while(u.lookahead<MIN_LOOKAHEAD&&u.strm.avail_in!==0)},deflate_stored=(u,I)=>{let a=u.pending_buf_size-5>u.w_size?u.w_size:u.pending_buf_size-5,E,_,k,e=0,n=u.strm.avail_in;do{if(E=65535,k=u.bi_valid+42>>3,u.strm.avail_out<k||(k=u.strm.avail_out-k,_=u.strstart-u.block_start,E>_+u.strm.avail_in&&(E=_+u.strm.avail_in),E>k&&(E=k),E<a&&(E===0&&I!==Z_FINISH$3||I===Z_NO_FLUSH$2||E!==_+u.strm.avail_in)))break;e=I===Z_FINISH$3&&E===_+u.strm.avail_in?1:0,_tr_stored_block(u,0,0,e),u.pending_buf[u.pending-4]=E,u.pending_buf[u.pending-3]=E>>8,u.pending_buf[u.pending-2]=~E,u.pending_buf[u.pending-1]=~E>>8,flush_pending(u.strm),_&&(_>E&&(_=E),u.strm.output.set(u.window.subarray(u.block_start,u.block_start+_),u.strm.next_out),u.strm.next_out+=_,u.strm.avail_out-=_,u.strm.total_out+=_,u.block_start+=_,E-=_),E&&(read_buf(u.strm,u.strm.output,u.strm.next_out,E),u.strm.next_out+=E,u.strm.avail_out-=E,u.strm.total_out+=E)}while(e===0);return n-=u.strm.avail_in,n&&(n>=u.w_size?(u.matches=2,u.window.set(u.strm.input.subarray(u.strm.next_in-u.w_size,u.strm.next_in),0),u.strstart=u.w_size,u.insert=u.strstart):(u.window_size-u.strstart<=n&&(u.strstart-=u.w_size,u.window.set(u.window.subarray(u.w_size,u.w_size+u.strstart),0),u.matches<2&&u.matches++,u.insert>u.strstart&&(u.insert=u.strstart)),u.window.set(u.strm.input.subarray(u.strm.next_in-n,u.strm.next_in),u.strstart),u.strstart+=n,u.insert+=n>u.w_size-u.insert?u.w_size-u.insert:n),u.block_start=u.strstart),u.high_water<u.strstart&&(u.high_water=u.strstart),e?BS_FINISH_DONE:I!==Z_NO_FLUSH$2&&I!==Z_FINISH$3&&u.strm.avail_in===0&&u.strstart===u.block_start?BS_BLOCK_DONE:(k=u.window_size-u.strstart,u.strm.avail_in>k&&u.block_start>=u.w_size&&(u.block_start-=u.w_size,u.strstart-=u.w_size,u.window.set(u.window.subarray(u.w_size,u.w_size+u.strstart),0),u.matches<2&&u.matches++,k+=u.w_size,u.insert>u.strstart&&(u.insert=u.strstart)),k>u.strm.avail_in&&(k=u.strm.avail_in),k&&(read_buf(u.strm,u.window,u.strstart,k),u.strstart+=k,u.insert+=k>u.w_size-u.insert?u.w_size-u.insert:k),u.high_water<u.strstart&&(u.high_water=u.strstart),k=u.bi_valid+42>>3,k=u.pending_buf_size-k>65535?65535:u.pending_buf_size-k,a=k>u.w_size?u.w_size:k,_=u.strstart-u.block_start,(_>=a||(_||I===Z_FINISH$3)&&I!==Z_NO_FLUSH$2&&u.strm.avail_in===0&&_<=k)&&(E=_>k?k:_,e=I===Z_FINISH$3&&u.strm.avail_in===0&&E===_?1:0,_tr_stored_block(u,u.block_start,E,e),u.block_start+=E,flush_pending(u.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(u,I)=>{let a,E;for(;;){if(u.lookahead<MIN_LOOKAHEAD){if(fill_window(u),u.lookahead<MIN_LOOKAHEAD&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(u.lookahead===0)break}if(a=0,u.lookahead>=MIN_MATCH&&(u.ins_h=HASH(u,u.ins_h,u.window[u.strstart+MIN_MATCH-1]),a=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart),a!==0&&u.strstart-a<=u.w_size-MIN_LOOKAHEAD&&(u.match_length=longest_match(u,a)),u.match_length>=MIN_MATCH)if(E=_tr_tally(u,u.strstart-u.match_start,u.match_length-MIN_MATCH),u.lookahead-=u.match_length,u.match_length<=u.max_lazy_match&&u.lookahead>=MIN_MATCH){u.match_length--;do u.strstart++,u.ins_h=HASH(u,u.ins_h,u.window[u.strstart+MIN_MATCH-1]),a=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart;while(--u.match_length!==0);u.strstart++}else u.strstart+=u.match_length,u.match_length=0,u.ins_h=u.window[u.strstart],u.ins_h=HASH(u,u.ins_h,u.window[u.strstart+1]);else E=_tr_tally(u,0,u.window[u.strstart]),u.lookahead--,u.strstart++;if(E&&(flush_block_only(u,!1),u.strm.avail_out===0))return BS_NEED_MORE}return u.insert=u.strstart<MIN_MATCH-1?u.strstart:MIN_MATCH-1,I===Z_FINISH$3?(flush_block_only(u,!0),u.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):u.sym_next&&(flush_block_only(u,!1),u.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(u,I)=>{let a,E,_;for(;;){if(u.lookahead<MIN_LOOKAHEAD){if(fill_window(u),u.lookahead<MIN_LOOKAHEAD&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(u.lookahead===0)break}if(a=0,u.lookahead>=MIN_MATCH&&(u.ins_h=HASH(u,u.ins_h,u.window[u.strstart+MIN_MATCH-1]),a=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart),u.prev_length=u.match_length,u.prev_match=u.match_start,u.match_length=MIN_MATCH-1,a!==0&&u.prev_length<u.max_lazy_match&&u.strstart-a<=u.w_size-MIN_LOOKAHEAD&&(u.match_length=longest_match(u,a),u.match_length<=5&&(u.strategy===Z_FILTERED||u.match_length===MIN_MATCH&&u.strstart-u.match_start>4096)&&(u.match_length=MIN_MATCH-1)),u.prev_length>=MIN_MATCH&&u.match_length<=u.prev_length){_=u.strstart+u.lookahead-MIN_MATCH,E=_tr_tally(u,u.strstart-1-u.prev_match,u.prev_length-MIN_MATCH),u.lookahead-=u.prev_length-1,u.prev_length-=2;do++u.strstart<=_&&(u.ins_h=HASH(u,u.ins_h,u.window[u.strstart+MIN_MATCH-1]),a=u.prev[u.strstart&u.w_mask]=u.head[u.ins_h],u.head[u.ins_h]=u.strstart);while(--u.prev_length!==0);if(u.match_available=0,u.match_length=MIN_MATCH-1,u.strstart++,E&&(flush_block_only(u,!1),u.strm.avail_out===0))return BS_NEED_MORE}else if(u.match_available){if(E=_tr_tally(u,0,u.window[u.strstart-1]),E&&flush_block_only(u,!1),u.strstart++,u.lookahead--,u.strm.avail_out===0)return BS_NEED_MORE}else u.match_available=1,u.strstart++,u.lookahead--}return u.match_available&&(E=_tr_tally(u,0,u.window[u.strstart-1]),u.match_available=0),u.insert=u.strstart<MIN_MATCH-1?u.strstart:MIN_MATCH-1,I===Z_FINISH$3?(flush_block_only(u,!0),u.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):u.sym_next&&(flush_block_only(u,!1),u.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(u,I)=>{let a,E,_,k;const e=u.window;for(;;){if(u.lookahead<=MAX_MATCH){if(fill_window(u),u.lookahead<=MAX_MATCH&&I===Z_NO_FLUSH$2)return BS_NEED_MORE;if(u.lookahead===0)break}if(u.match_length=0,u.lookahead>=MIN_MATCH&&u.strstart>0&&(_=u.strstart-1,E=e[_],E===e[++_]&&E===e[++_]&&E===e[++_])){k=u.strstart+MAX_MATCH;do;while(E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&E===e[++_]&&_<k);u.match_length=MAX_MATCH-(k-_),u.match_length>u.lookahead&&(u.match_length=u.lookahead)}if(u.match_length>=MIN_MATCH?(a=_tr_tally(u,1,u.match_length-MIN_MATCH),u.lookahead-=u.match_length,u.strstart+=u.match_length,u.match_length=0):(a=_tr_tally(u,0,u.window[u.strstart]),u.lookahead--,u.strstart++),a&&(flush_block_only(u,!1),u.strm.avail_out===0))return BS_NEED_MORE}return u.insert=0,I===Z_FINISH$3?(flush_block_only(u,!0),u.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):u.sym_next&&(flush_block_only(u,!1),u.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(u,I)=>{let a;for(;;){if(u.lookahead===0&&(fill_window(u),u.lookahead===0)){if(I===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(u.match_length=0,a=_tr_tally(u,0,u.window[u.strstart]),u.lookahead--,u.strstart++,a&&(flush_block_only(u,!1),u.strm.avail_out===0))return BS_NEED_MORE}return u.insert=0,I===Z_FINISH$3?(flush_block_only(u,!0),u.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):u.sym_next&&(flush_block_only(u,!1),u.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(u,I,a,E,_){this.good_length=u,this.max_lazy=I,this.nice_length=a,this.max_chain=E,this.func=_}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=u=>{u.window_size=2*u.w_size,zero(u.head),u.max_lazy_match=configuration_table[u.level].max_lazy,u.good_match=configuration_table[u.level].good_length,u.nice_match=configuration_table[u.level].nice_length,u.max_chain_length=configuration_table[u.level].max_chain,u.strstart=0,u.block_start=0,u.lookahead=0,u.insert=0,u.match_length=u.prev_length=MIN_MATCH-1,u.match_available=0,u.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=u=>{if(!u)return 1;const I=u.state;return!I||I.strm!==u||I.status!==INIT_STATE&&I.status!==GZIP_STATE&&I.status!==EXTRA_STATE&&I.status!==NAME_STATE&&I.status!==COMMENT_STATE&&I.status!==HCRC_STATE&&I.status!==BUSY_STATE&&I.status!==FINISH_STATE?1:0},deflateResetKeep=u=>{if(deflateStateCheck(u))return err(u,Z_STREAM_ERROR$2);u.total_in=u.total_out=0,u.data_type=Z_UNKNOWN;const I=u.state;return I.pending=0,I.pending_out=0,I.wrap<0&&(I.wrap=-I.wrap),I.status=I.wrap===2?GZIP_STATE:I.wrap?INIT_STATE:BUSY_STATE,u.adler=I.wrap===2?0:1,I.last_flush=-2,_tr_init(I),Z_OK$3},deflateReset=u=>{const I=deflateResetKeep(u);return I===Z_OK$3&&lm_init(u.state),I},deflateSetHeader=(u,I)=>deflateStateCheck(u)||u.state.wrap!==2?Z_STREAM_ERROR$2:(u.state.gzhead=I,Z_OK$3),deflateInit2=(u,I,a,E,_,k)=>{if(!u)return Z_STREAM_ERROR$2;let e=1;if(I===Z_DEFAULT_COMPRESSION$1&&(I=6),E<0?(e=0,E=-E):E>15&&(e=2,E-=16),_<1||_>MAX_MEM_LEVEL||a!==Z_DEFLATED$2||E<8||E>15||I<0||I>9||k<0||k>Z_FIXED||E===8&&e!==1)return err(u,Z_STREAM_ERROR$2);E===8&&(E=9);const n=new DeflateState;return u.state=n,n.strm=u,n.status=INIT_STATE,n.wrap=e,n.gzhead=null,n.w_bits=E,n.w_size=1<<n.w_bits,n.w_mask=n.w_size-1,n.hash_bits=_+7,n.hash_size=1<<n.hash_bits,n.hash_mask=n.hash_size-1,n.hash_shift=~~((n.hash_bits+MIN_MATCH-1)/MIN_MATCH),n.window=new Uint8Array(n.w_size*2),n.head=new Uint16Array(n.hash_size),n.prev=new Uint16Array(n.w_size),n.lit_bufsize=1<<_+6,n.pending_buf_size=n.lit_bufsize*4,n.pending_buf=new Uint8Array(n.pending_buf_size),n.sym_buf=n.lit_bufsize,n.sym_end=(n.lit_bufsize-1)*3,n.level=I,n.strategy=k,n.method=a,deflateReset(u)},deflateInit=(u,I)=>deflateInit2(u,I,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(u,I)=>{if(deflateStateCheck(u)||I>Z_BLOCK$1||I<0)return u?err(u,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const a=u.state;if(!u.output||u.avail_in!==0&&!u.input||a.status===FINISH_STATE&&I!==Z_FINISH$3)return err(u,u.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const E=a.last_flush;if(a.last_flush=I,a.pending!==0){if(flush_pending(u),u.avail_out===0)return a.last_flush=-1,Z_OK$3}else if(u.avail_in===0&&rank(I)<=rank(E)&&I!==Z_FINISH$3)return err(u,Z_BUF_ERROR$1);if(a.status===FINISH_STATE&&u.avail_in!==0)return err(u,Z_BUF_ERROR$1);if(a.status===INIT_STATE&&a.wrap===0&&(a.status=BUSY_STATE),a.status===INIT_STATE){let _=Z_DEFLATED$2+(a.w_bits-8<<4)<<8,k=-1;if(a.strategy>=Z_HUFFMAN_ONLY||a.level<2?k=0:a.level<6?k=1:a.level===6?k=2:k=3,_|=k<<6,a.strstart!==0&&(_|=PRESET_DICT),_+=31-_%31,putShortMSB(a,_),a.strstart!==0&&(putShortMSB(a,u.adler>>>16),putShortMSB(a,u.adler&65535)),u.adler=1,a.status=BUSY_STATE,flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3}if(a.status===GZIP_STATE){if(u.adler=0,put_byte(a,31),put_byte(a,139),put_byte(a,8),a.gzhead)put_byte(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),put_byte(a,a.gzhead.time&255),put_byte(a,a.gzhead.time>>8&255),put_byte(a,a.gzhead.time>>16&255),put_byte(a,a.gzhead.time>>24&255),put_byte(a,a.level===9?2:a.strategy>=Z_HUFFMAN_ONLY||a.level<2?4:0),put_byte(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(put_byte(a,a.gzhead.extra.length&255),put_byte(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=EXTRA_STATE;else if(put_byte(a,0),put_byte(a,0),put_byte(a,0),put_byte(a,0),put_byte(a,0),put_byte(a,a.level===9?2:a.strategy>=Z_HUFFMAN_ONLY||a.level<2?4:0),put_byte(a,OS_CODE),a.status=BUSY_STATE,flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3}if(a.status===EXTRA_STATE){if(a.gzhead.extra){let _=a.pending,k=(a.gzhead.extra.length&65535)-a.gzindex;for(;a.pending+k>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_)),a.gzindex+=n,flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3;_=0,k-=n}let e=new Uint8Array(a.gzhead.extra);a.pending_buf.set(e.subarray(a.gzindex,a.gzindex+k),a.pending),a.pending+=k,a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_)),a.gzindex=0}a.status=NAME_STATE}if(a.status===NAME_STATE){if(a.gzhead.name){let _=a.pending,k;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_)),flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3;_=0}a.gzindex<a.gzhead.name.length?k=a.gzhead.name.charCodeAt(a.gzindex++)&255:k=0,put_byte(a,k)}while(k!==0);a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_)),a.gzindex=0}a.status=COMMENT_STATE}if(a.status===COMMENT_STATE){if(a.gzhead.comment){let _=a.pending,k;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_)),flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3;_=0}a.gzindex<a.gzhead.comment.length?k=a.gzhead.comment.charCodeAt(a.gzindex++)&255:k=0,put_byte(a,k)}while(k!==0);a.gzhead.hcrc&&a.pending>_&&(u.adler=crc32_1(u.adler,a.pending_buf,a.pending-_,_))}a.status=HCRC_STATE}if(a.status===HCRC_STATE){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(flush_pending(u),a.pending!==0))return a.last_flush=-1,Z_OK$3;put_byte(a,u.adler&255),put_byte(a,u.adler>>8&255),u.adler=0}if(a.status=BUSY_STATE,flush_pending(u),a.pending!==0)return a.last_flush=-1,Z_OK$3}if(u.avail_in!==0||a.lookahead!==0||I!==Z_NO_FLUSH$2&&a.status!==FINISH_STATE){let _=a.level===0?deflate_stored(a,I):a.strategy===Z_HUFFMAN_ONLY?deflate_huff(a,I):a.strategy===Z_RLE?deflate_rle(a,I):configuration_table[a.level].func(a,I);if((_===BS_FINISH_STARTED||_===BS_FINISH_DONE)&&(a.status=FINISH_STATE),_===BS_NEED_MORE||_===BS_FINISH_STARTED)return u.avail_out===0&&(a.last_flush=-1),Z_OK$3;if(_===BS_BLOCK_DONE&&(I===Z_PARTIAL_FLUSH?_tr_align(a):I!==Z_BLOCK$1&&(_tr_stored_block(a,0,0,!1),I===Z_FULL_FLUSH$1&&(zero(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),flush_pending(u),u.avail_out===0))return a.last_flush=-1,Z_OK$3}return I!==Z_FINISH$3?Z_OK$3:a.wrap<=0?Z_STREAM_END$3:(a.wrap===2?(put_byte(a,u.adler&255),put_byte(a,u.adler>>8&255),put_byte(a,u.adler>>16&255),put_byte(a,u.adler>>24&255),put_byte(a,u.total_in&255),put_byte(a,u.total_in>>8&255),put_byte(a,u.total_in>>16&255),put_byte(a,u.total_in>>24&255)):(putShortMSB(a,u.adler>>>16),putShortMSB(a,u.adler&65535)),flush_pending(u),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=u=>{if(deflateStateCheck(u))return Z_STREAM_ERROR$2;const I=u.state.status;return u.state=null,I===BUSY_STATE?err(u,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(u,I)=>{let a=I.length;if(deflateStateCheck(u))return Z_STREAM_ERROR$2;const E=u.state,_=E.wrap;if(_===2||_===1&&E.status!==INIT_STATE||E.lookahead)return Z_STREAM_ERROR$2;if(_===1&&(u.adler=adler32_1(u.adler,I,a,0)),E.wrap=0,a>=E.w_size){_===0&&(zero(E.head),E.strstart=0,E.block_start=0,E.insert=0);let O=new Uint8Array(E.w_size);O.set(I.subarray(a-E.w_size,a),0),I=O,a=E.w_size}const k=u.avail_in,e=u.next_in,n=u.input;for(u.avail_in=a,u.next_in=0,u.input=I,fill_window(E);E.lookahead>=MIN_MATCH;){let O=E.strstart,$=E.lookahead-(MIN_MATCH-1);do E.ins_h=HASH(E,E.ins_h,E.window[O+MIN_MATCH-1]),E.prev[O&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=O,O++;while(--$);E.strstart=O,E.lookahead=MIN_MATCH-1,fill_window(E)}return E.strstart+=E.lookahead,E.block_start=E.strstart,E.insert=E.lookahead,E.lookahead=0,E.match_length=E.prev_length=MIN_MATCH-1,E.match_available=0,u.next_in=e,u.input=n,u.avail_in=k,E.wrap=_,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=(u,I)=>Object.prototype.hasOwnProperty.call(u,I);var assign=function(u){const I=Array.prototype.slice.call(arguments,1);for(;I.length;){const a=I.shift();if(a){if(typeof a!="object")throw new TypeError(a+"must be non-object");for(const E in a)_has(a,E)&&(u[E]=a[E])}}return u},flattenChunks=u=>{let I=0;for(let E=0,_=u.length;E<_;E++)I+=u[E].length;const a=new Uint8Array(I);for(let E=0,_=0,k=u.length;E<k;E++){let e=u[E];a.set(e,_),_+=e.length}return a},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(u){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let u=0;u<256;u++)_utf8len[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=u=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(u);let I,a,E,_,k,e=u.length,n=0;for(_=0;_<e;_++)a=u.charCodeAt(_),(a&64512)===55296&&_+1<e&&(E=u.charCodeAt(_+1),(E&64512)===56320&&(a=65536+(a-55296<<10)+(E-56320),_++)),n+=a<128?1:a<2048?2:a<65536?3:4;for(I=new Uint8Array(n),k=0,_=0;k<n;_++)a=u.charCodeAt(_),(a&64512)===55296&&_+1<e&&(E=u.charCodeAt(_+1),(E&64512)===56320&&(a=65536+(a-55296<<10)+(E-56320),_++)),a<128?I[k++]=a:a<2048?(I[k++]=192|a>>>6,I[k++]=128|a&63):a<65536?(I[k++]=224|a>>>12,I[k++]=128|a>>>6&63,I[k++]=128|a&63):(I[k++]=240|a>>>18,I[k++]=128|a>>>12&63,I[k++]=128|a>>>6&63,I[k++]=128|a&63);return I};const buf2binstring=(u,I)=>{if(I<65534&&u.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,u.length===I?u:u.subarray(0,I));let a="";for(let E=0;E<I;E++)a+=String.fromCharCode(u[E]);return a};var buf2string=(u,I)=>{const a=I||u.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(u.subarray(0,I));let E,_;const k=new Array(a*2);for(_=0,E=0;E<a;){let e=u[E++];if(e<128){k[_++]=e;continue}let n=_utf8len[e];if(n>4){k[_++]=65533,E+=n-1;continue}for(e&=n===2?31:n===3?15:7;n>1&&E<a;)e=e<<6|u[E++]&63,n--;if(n>1){k[_++]=65533;continue}e<65536?k[_++]=e:(e-=65536,k[_++]=55296|e>>10&1023,k[_++]=56320|e&1023)}return buf2binstring(k,_)},utf8border=(u,I)=>{I=I||u.length,I>u.length&&(I=u.length);let a=I-1;for(;a>=0&&(u[a]&192)===128;)a--;return a<0||a===0?I:a+_utf8len[u[a]]>I?a:I},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(u){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},u||{});let I=this.options;I.raw&&I.windowBits>0?I.windowBits=-I.windowBits:I.gzip&&I.windowBits>0&&I.windowBits<16&&(I.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let a=deflate_1$2.deflateInit2(this.strm,I.level,I.method,I.windowBits,I.memLevel,I.strategy);if(a!==Z_OK$2)throw new Error(messages[a]);if(I.header&&deflate_1$2.deflateSetHeader(this.strm,I.header),I.dictionary){let E;if(typeof I.dictionary=="string"?E=strings.string2buf(I.dictionary):toString$1.call(I.dictionary)==="[object ArrayBuffer]"?E=new Uint8Array(I.dictionary):E=I.dictionary,a=deflate_1$2.deflateSetDictionary(this.strm,E),a!==Z_OK$2)throw new Error(messages[a]);this._dict_set=!0}}Deflate$1.prototype.push=function(u,I){const a=this.strm,E=this.options.chunkSize;let _,k;if(this.ended)return!1;for(I===~~I?k=I:k=I===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof u=="string"?a.input=strings.string2buf(u):toString$1.call(u)==="[object ArrayBuffer]"?a.input=new Uint8Array(u):a.input=u,a.next_in=0,a.avail_in=a.input.length;;){if(a.avail_out===0&&(a.output=new Uint8Array(E),a.next_out=0,a.avail_out=E),(k===Z_SYNC_FLUSH||k===Z_FULL_FLUSH)&&a.avail_out<=6){this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;continue}if(_=deflate_1$2.deflate(a,k),_===Z_STREAM_END$2)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),_=deflate_1$2.deflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===Z_OK$2;if(a.avail_out===0){this.onData(a.output);continue}if(k>0&&a.next_out>0){this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;continue}if(a.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(u){this.chunks.push(u)},Deflate$1.prototype.onEnd=function(u){u===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg};function deflate$1(u,I){const a=new Deflate$1(I);if(a.push(u,!0),a.err)throw a.msg||messages[a.err];return a.result}function deflateRaw$1(u,I){return I=I||{},I.raw=!0,deflate$1(u,I)}function gzip$1(u,I){return I=I||{},I.gzip=!0,deflate$1(u,I)}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 u(I,a){let E,_,k,e,n,O,$,N,D,q,P,j,V,J,z,Y,et,tt,nt,_t,it,lt,st,rt;const ct=I.state;E=I.next_in,st=I.input,_=E+(I.avail_in-5),k=I.next_out,rt=I.output,e=k-(a-I.avail_out),n=k+(I.avail_out-257),O=ct.dmax,$=ct.wsize,N=ct.whave,D=ct.wnext,q=ct.window,P=ct.hold,j=ct.bits,V=ct.lencode,J=ct.distcode,z=(1<<ct.lenbits)-1,Y=(1<<ct.distbits)-1;t:do{j<15&&(P+=st[E++]<<j,j+=8,P+=st[E++]<<j,j+=8),et=V[P&z];e:for(;;){if(tt=et>>>24,P>>>=tt,j-=tt,tt=et>>>16&255,tt===0)rt[k++]=et&65535;else if(tt&16){nt=et&65535,tt&=15,tt&&(j<tt&&(P+=st[E++]<<j,j+=8),nt+=P&(1<<tt)-1,P>>>=tt,j-=tt),j<15&&(P+=st[E++]<<j,j+=8,P+=st[E++]<<j,j+=8),et=J[P&Y];i:for(;;){if(tt=et>>>24,P>>>=tt,j-=tt,tt=et>>>16&255,tt&16){if(_t=et&65535,tt&=15,j<tt&&(P+=st[E++]<<j,j+=8,j<tt&&(P+=st[E++]<<j,j+=8)),_t+=P&(1<<tt)-1,_t>O){I.msg="invalid distance too far back",ct.mode=BAD$1;break t}if(P>>>=tt,j-=tt,tt=k-e,_t>tt){if(tt=_t-tt,tt>N&&ct.sane){I.msg="invalid distance too far back",ct.mode=BAD$1;break t}if(it=0,lt=q,D===0){if(it+=$-tt,tt<nt){nt-=tt;do rt[k++]=q[it++];while(--tt);it=k-_t,lt=rt}}else if(D<tt){if(it+=$+D-tt,tt-=D,tt<nt){nt-=tt;do rt[k++]=q[it++];while(--tt);if(it=0,D<nt){tt=D,nt-=tt;do rt[k++]=q[it++];while(--tt);it=k-_t,lt=rt}}}else if(it+=D-tt,tt<nt){nt-=tt;do rt[k++]=q[it++];while(--tt);it=k-_t,lt=rt}for(;nt>2;)rt[k++]=lt[it++],rt[k++]=lt[it++],rt[k++]=lt[it++],nt-=3;nt&&(rt[k++]=lt[it++],nt>1&&(rt[k++]=lt[it++]))}else{it=k-_t;do rt[k++]=rt[it++],rt[k++]=rt[it++],rt[k++]=rt[it++],nt-=3;while(nt>2);nt&&(rt[k++]=rt[it++],nt>1&&(rt[k++]=rt[it++]))}}else if((tt&64)===0){et=J[(et&65535)+(P&(1<<tt)-1)];continue i}else{I.msg="invalid distance code",ct.mode=BAD$1;break t}break}}else if((tt&64)===0){et=V[(et&65535)+(P&(1<<tt)-1)];continue e}else if(tt&32){ct.mode=TYPE$1;break t}else{I.msg="invalid literal/length code",ct.mode=BAD$1;break t}break}}while(E<_&&k<n);nt=j>>3,E-=nt,j-=nt<<3,P&=(1<<j)-1,I.next_in=E,I.next_out=k,I.avail_in=E<_?5+(_-E):5-(E-_),I.avail_out=k<n?257+(n-k):257-(k-n),ct.hold=P,ct.bits=j};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=(u,I,a,E,_,k,e,n)=>{const O=n.bits;let $=0,N=0,D=0,q=0,P=0,j=0,V=0,J=0,z=0,Y=0,et,tt,nt,_t,it,lt=null,st;const rt=new Uint16Array(MAXBITS+1),ct=new Uint16Array(MAXBITS+1);let It=null,ne,ee,ie;for($=0;$<=MAXBITS;$++)rt[$]=0;for(N=0;N<E;N++)rt[I[a+N]]++;for(P=O,q=MAXBITS;q>=1&&rt[q]===0;q--);if(P>q&&(P=q),q===0)return _[k++]=1<<24|64<<16|0,_[k++]=1<<24|64<<16|0,n.bits=1,0;for(D=1;D<q&&rt[D]===0;D++);for(P<D&&(P=D),J=1,$=1;$<=MAXBITS;$++)if(J<<=1,J-=rt[$],J<0)return-1;if(J>0&&(u===CODES$1||q!==1))return-1;for(ct[1]=0,$=1;$<MAXBITS;$++)ct[$+1]=ct[$]+rt[$];for(N=0;N<E;N++)I[a+N]!==0&&(e[ct[I[a+N]]++]=N);if(u===CODES$1?(lt=It=e,st=20):u===LENS$1?(lt=lbase,It=lext,st=257):(lt=dbase,It=dext,st=0),Y=0,N=0,$=D,it=k,j=P,V=0,nt=-1,z=1<<P,_t=z-1,u===LENS$1&&z>ENOUGH_LENS$1||u===DISTS$1&&z>ENOUGH_DISTS$1)return 1;for(;;){ne=$-V,e[N]+1<st?(ee=0,ie=e[N]):e[N]>=st?(ee=It[e[N]-st],ie=lt[e[N]-st]):(ee=96,ie=0),et=1<<$-V,tt=1<<j,D=tt;do tt-=et,_[it+(Y>>V)+tt]=ne<<24|ee<<16|ie|0;while(tt!==0);for(et=1<<$-1;Y&et;)et>>=1;if(et!==0?(Y&=et-1,Y+=et):Y=0,N++,--rt[$]===0){if($===q)break;$=I[a+e[N]]}if($>P&&(Y&_t)!==nt){for(V===0&&(V=P),it+=D,j=$-V,J=1<<j;j+V<q&&(J-=rt[j+V],!(J<=0));)j++,J<<=1;if(z+=1<<j,u===LENS$1&&z>ENOUGH_LENS$1||u===DISTS$1&&z>ENOUGH_DISTS$1)return 1;nt=Y&_t,_[nt]=P<<24|j<<16|it-k|0}}return Y!==0&&(_[it+Y]=$-V<<24|64<<16|0),n.bits=P,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=u=>(u>>>24&255)+(u>>>8&65280)+((u&65280)<<8)+((u&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=u=>{if(!u)return 1;const I=u.state;return!I||I.strm!==u||I.mode<HEAD||I.mode>SYNC?1:0},inflateResetKeep=u=>{if(inflateStateCheck(u))return Z_STREAM_ERROR$1;const I=u.state;return u.total_in=u.total_out=I.total=0,u.msg="",I.wrap&&(u.adler=I.wrap&1),I.mode=HEAD,I.last=0,I.havedict=0,I.flags=-1,I.dmax=32768,I.head=null,I.hold=0,I.bits=0,I.lencode=I.lendyn=new Int32Array(ENOUGH_LENS),I.distcode=I.distdyn=new Int32Array(ENOUGH_DISTS),I.sane=1,I.back=-1,Z_OK$1},inflateReset=u=>{if(inflateStateCheck(u))return Z_STREAM_ERROR$1;const I=u.state;return I.wsize=0,I.whave=0,I.wnext=0,inflateResetKeep(u)},inflateReset2=(u,I)=>{let a;if(inflateStateCheck(u))return Z_STREAM_ERROR$1;const E=u.state;return I<0?(a=0,I=-I):(a=(I>>4)+5,I<48&&(I&=15)),I&&(I<8||I>15)?Z_STREAM_ERROR$1:(E.window!==null&&E.wbits!==I&&(E.window=null),E.wrap=a,E.wbits=I,inflateReset(u))},inflateInit2=(u,I)=>{if(!u)return Z_STREAM_ERROR$1;const a=new InflateState;u.state=a,a.strm=u,a.window=null,a.mode=HEAD;const E=inflateReset2(u,I);return E!==Z_OK$1&&(u.state=null),E},inflateInit=u=>inflateInit2(u,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=u=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let I=0;for(;I<144;)u.lens[I++]=8;for(;I<256;)u.lens[I++]=9;for(;I<280;)u.lens[I++]=7;for(;I<288;)u.lens[I++]=8;for(inftrees(LENS,u.lens,0,288,lenfix,0,u.work,{bits:9}),I=0;I<32;)u.lens[I++]=5;inftrees(DISTS,u.lens,0,32,distfix,0,u.work,{bits:5}),virgin=!1}u.lencode=lenfix,u.lenbits=9,u.distcode=distfix,u.distbits=5},updatewindow=(u,I,a,E)=>{let _;const k=u.state;return k.window===null&&(k.wsize=1<<k.wbits,k.wnext=0,k.whave=0,k.window=new Uint8Array(k.wsize)),E>=k.wsize?(k.window.set(I.subarray(a-k.wsize,a),0),k.wnext=0,k.whave=k.wsize):(_=k.wsize-k.wnext,_>E&&(_=E),k.window.set(I.subarray(a-E,a-E+_),k.wnext),E-=_,E?(k.window.set(I.subarray(a-E,a),0),k.wnext=E,k.whave=k.wsize):(k.wnext+=_,k.wnext===k.wsize&&(k.wnext=0),k.whave<k.wsize&&(k.whave+=_))),0},inflate$2=(u,I)=>{let a,E,_,k,e,n,O,$,N,D,q,P,j,V,J=0,z,Y,et,tt,nt,_t,it,lt;const st=new Uint8Array(4);let rt,ct;const It=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(u)||!u.output||!u.input&&u.avail_in!==0)return Z_STREAM_ERROR$1;a=u.state,a.mode===TYPE&&(a.mode=TYPEDO),e=u.next_out,_=u.output,O=u.avail_out,k=u.next_in,E=u.input,n=u.avail_in,$=a.hold,N=a.bits,D=n,q=O,lt=Z_OK$1;t:for(;;)switch(a.mode){case HEAD:if(a.wrap===0){a.mode=TYPEDO;break}for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(a.wrap&2&&$===35615){a.wbits===0&&(a.wbits=15),a.check=0,st[0]=$&255,st[1]=$>>>8&255,a.check=crc32_1(a.check,st,2,0),$=0,N=0,a.mode=FLAGS;break}if(a.head&&(a.head.done=!1),!(a.wrap&1)||((($&255)<<8)+($>>8))%31){u.msg="incorrect header check",a.mode=BAD;break}if(($&15)!==Z_DEFLATED){u.msg="unknown compression method",a.mode=BAD;break}if($>>>=4,N-=4,it=($&15)+8,a.wbits===0&&(a.wbits=it),it>15||it>a.wbits){u.msg="invalid window size",a.mode=BAD;break}a.dmax=1<<a.wbits,a.flags=0,u.adler=a.check=1,a.mode=$&512?DICTID:TYPE,$=0,N=0;break;case FLAGS:for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(a.flags=$,(a.flags&255)!==Z_DEFLATED){u.msg="unknown compression method",a.mode=BAD;break}if(a.flags&57344){u.msg="unknown header flags set",a.mode=BAD;break}a.head&&(a.head.text=$>>8&1),a.flags&512&&a.wrap&4&&(st[0]=$&255,st[1]=$>>>8&255,a.check=crc32_1(a.check,st,2,0)),$=0,N=0,a.mode=TIME;case TIME:for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.head&&(a.head.time=$),a.flags&512&&a.wrap&4&&(st[0]=$&255,st[1]=$>>>8&255,st[2]=$>>>16&255,st[3]=$>>>24&255,a.check=crc32_1(a.check,st,4,0)),$=0,N=0,a.mode=OS;case OS:for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.head&&(a.head.xflags=$&255,a.head.os=$>>8),a.flags&512&&a.wrap&4&&(st[0]=$&255,st[1]=$>>>8&255,a.check=crc32_1(a.check,st,2,0)),$=0,N=0,a.mode=EXLEN;case EXLEN:if(a.flags&1024){for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.length=$,a.head&&(a.head.extra_len=$),a.flags&512&&a.wrap&4&&(st[0]=$&255,st[1]=$>>>8&255,a.check=crc32_1(a.check,st,2,0)),$=0,N=0}else a.head&&(a.head.extra=null);a.mode=EXTRA;case EXTRA:if(a.flags&1024&&(P=a.length,P>n&&(P=n),P&&(a.head&&(it=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(E.subarray(k,k+P),it)),a.flags&512&&a.wrap&4&&(a.check=crc32_1(a.check,E,P,k)),n-=P,k+=P,a.length-=P),a.length))break t;a.length=0,a.mode=NAME;case NAME:if(a.flags&2048){if(n===0)break t;P=0;do it=E[k+P++],a.head&&it&&a.length<65536&&(a.head.name+=String.fromCharCode(it));while(it&&P<n);if(a.flags&512&&a.wrap&4&&(a.check=crc32_1(a.check,E,P,k)),n-=P,k+=P,it)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=COMMENT;case COMMENT:if(a.flags&4096){if(n===0)break t;P=0;do it=E[k+P++],a.head&&it&&a.length<65536&&(a.head.comment+=String.fromCharCode(it));while(it&&P<n);if(a.flags&512&&a.wrap&4&&(a.check=crc32_1(a.check,E,P,k)),n-=P,k+=P,it)break t}else a.head&&(a.head.comment=null);a.mode=HCRC;case HCRC:if(a.flags&512){for(;N<16;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(a.wrap&4&&$!==(a.check&65535)){u.msg="header crc mismatch",a.mode=BAD;break}$=0,N=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),u.adler=a.check=0,a.mode=TYPE;break;case DICTID:for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}u.adler=a.check=zswap32($),$=0,N=0,a.mode=DICT;case DICT:if(a.havedict===0)return u.next_out=e,u.avail_out=O,u.next_in=k,u.avail_in=n,a.hold=$,a.bits=N,Z_NEED_DICT$1;u.adler=a.check=1,a.mode=TYPE;case TYPE:if(I===Z_BLOCK||I===Z_TREES)break t;case TYPEDO:if(a.last){$>>>=N&7,N-=N&7,a.mode=CHECK;break}for(;N<3;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}switch(a.last=$&1,$>>>=1,N-=1,$&3){case 0:a.mode=STORED;break;case 1:if(fixedtables(a),a.mode=LEN_,I===Z_TREES){$>>>=2,N-=2;break t}break;case 2:a.mode=TABLE;break;case 3:u.msg="invalid block type",a.mode=BAD}$>>>=2,N-=2;break;case STORED:for($>>>=N&7,N-=N&7;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(($&65535)!==($>>>16^65535)){u.msg="invalid stored block lengths",a.mode=BAD;break}if(a.length=$&65535,$=0,N=0,a.mode=COPY_,I===Z_TREES)break t;case COPY_:a.mode=COPY;case COPY:if(P=a.length,P){if(P>n&&(P=n),P>O&&(P=O),P===0)break t;_.set(E.subarray(k,k+P),e),n-=P,k+=P,O-=P,e+=P,a.length-=P;break}a.mode=TYPE;break;case TABLE:for(;N<14;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(a.nlen=($&31)+257,$>>>=5,N-=5,a.ndist=($&31)+1,$>>>=5,N-=5,a.ncode=($&15)+4,$>>>=4,N-=4,a.nlen>286||a.ndist>30){u.msg="too many length or distance symbols",a.mode=BAD;break}a.have=0,a.mode=LENLENS;case LENLENS:for(;a.have<a.ncode;){for(;N<3;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.lens[It[a.have++]]=$&7,$>>>=3,N-=3}for(;a.have<19;)a.lens[It[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,rt={bits:a.lenbits},lt=inftrees(CODES,a.lens,0,19,a.lencode,0,a.work,rt),a.lenbits=rt.bits,lt){u.msg="invalid code lengths set",a.mode=BAD;break}a.have=0,a.mode=CODELENS;case CODELENS:for(;a.have<a.nlen+a.ndist;){for(;J=a.lencode[$&(1<<a.lenbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(et<16)$>>>=z,N-=z,a.lens[a.have++]=et;else{if(et===16){for(ct=z+2;N<ct;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if($>>>=z,N-=z,a.have===0){u.msg="invalid bit length repeat",a.mode=BAD;break}it=a.lens[a.have-1],P=3+($&3),$>>>=2,N-=2}else if(et===17){for(ct=z+3;N<ct;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=z,N-=z,it=0,P=3+($&7),$>>>=3,N-=3}else{for(ct=z+7;N<ct;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=z,N-=z,it=0,P=11+($&127),$>>>=7,N-=7}if(a.have+P>a.nlen+a.ndist){u.msg="invalid bit length repeat",a.mode=BAD;break}for(;P--;)a.lens[a.have++]=it}}if(a.mode===BAD)break;if(a.lens[256]===0){u.msg="invalid code -- missing end-of-block",a.mode=BAD;break}if(a.lenbits=9,rt={bits:a.lenbits},lt=inftrees(LENS,a.lens,0,a.nlen,a.lencode,0,a.work,rt),a.lenbits=rt.bits,lt){u.msg="invalid literal/lengths set",a.mode=BAD;break}if(a.distbits=6,a.distcode=a.distdyn,rt={bits:a.distbits},lt=inftrees(DISTS,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,rt),a.distbits=rt.bits,lt){u.msg="invalid distances set",a.mode=BAD;break}if(a.mode=LEN_,I===Z_TREES)break t;case LEN_:a.mode=LEN;case LEN:if(n>=6&&O>=258){u.next_out=e,u.avail_out=O,u.next_in=k,u.avail_in=n,a.hold=$,a.bits=N,inffast(u,q),e=u.next_out,_=u.output,O=u.avail_out,k=u.next_in,E=u.input,n=u.avail_in,$=a.hold,N=a.bits,a.mode===TYPE&&(a.back=-1);break}for(a.back=0;J=a.lencode[$&(1<<a.lenbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(Y&&(Y&240)===0){for(tt=z,nt=Y,_t=et;J=a.lencode[_t+(($&(1<<tt+nt)-1)>>tt)],z=J>>>24,Y=J>>>16&255,et=J&65535,!(tt+z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=tt,N-=tt,a.back+=tt}if($>>>=z,N-=z,a.back+=z,a.length=et,Y===0){a.mode=LIT;break}if(Y&32){a.back=-1,a.mode=TYPE;break}if(Y&64){u.msg="invalid literal/length code",a.mode=BAD;break}a.extra=Y&15,a.mode=LENEXT;case LENEXT:if(a.extra){for(ct=a.extra;N<ct;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.length+=$&(1<<a.extra)-1,$>>>=a.extra,N-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=DIST;case DIST:for(;J=a.distcode[$&(1<<a.distbits)-1],z=J>>>24,Y=J>>>16&255,et=J&65535,!(z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if((Y&240)===0){for(tt=z,nt=Y,_t=et;J=a.distcode[_t+(($&(1<<tt+nt)-1)>>tt)],z=J>>>24,Y=J>>>16&255,et=J&65535,!(tt+z<=N);){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}$>>>=tt,N-=tt,a.back+=tt}if($>>>=z,N-=z,a.back+=z,Y&64){u.msg="invalid distance code",a.mode=BAD;break}a.offset=et,a.extra=Y&15,a.mode=DISTEXT;case DISTEXT:if(a.extra){for(ct=a.extra;N<ct;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}a.offset+=$&(1<<a.extra)-1,$>>>=a.extra,N-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){u.msg="invalid distance too far back",a.mode=BAD;break}a.mode=MATCH;case MATCH:if(O===0)break t;if(P=q-O,a.offset>P){if(P=a.offset-P,P>a.whave&&a.sane){u.msg="invalid distance too far back",a.mode=BAD;break}P>a.wnext?(P-=a.wnext,j=a.wsize-P):j=a.wnext-P,P>a.length&&(P=a.length),V=a.window}else V=_,j=e-a.offset,P=a.length;P>O&&(P=O),O-=P,a.length-=P;do _[e++]=V[j++];while(--P);a.length===0&&(a.mode=LEN);break;case LIT:if(O===0)break t;_[e++]=a.length,O--,a.mode=LEN;break;case CHECK:if(a.wrap){for(;N<32;){if(n===0)break t;n--,$|=E[k++]<<N,N+=8}if(q-=O,u.total_out+=q,a.total+=q,a.wrap&4&&q&&(u.adler=a.check=a.flags?crc32_1(a.check,_,q,e-q):adler32_1(a.check,_,q,e-q)),q=O,a.wrap&4&&(a.flags?$:zswap32($))!==a.check){u.msg="incorrect data check",a.mode=BAD;break}$=0,N=0}a.mode=LENGTH;case LENGTH:if(a.wrap&&a.flags){for(;N<32;){if(n===0)break t;n--,$+=E[k++]<<N,N+=8}if(a.wrap&4&&$!==(a.total&4294967295)){u.msg="incorrect length check",a.mode=BAD;break}$=0,N=0}a.mode=DONE;case DONE:lt=Z_STREAM_END$1;break t;case BAD:lt=Z_DATA_ERROR$1;break t;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return u.next_out=e,u.avail_out=O,u.next_in=k,u.avail_in=n,a.hold=$,a.bits=N,(a.wsize||q!==u.avail_out&&a.mode<BAD&&(a.mode<CHECK||I!==Z_FINISH$1))&&updatewindow(u,u.output,u.next_out,q-u.avail_out),D-=u.avail_in,q-=u.avail_out,u.total_in+=D,u.total_out+=q,a.total+=q,a.wrap&4&&q&&(u.adler=a.check=a.flags?crc32_1(a.check,_,q,u.next_out-q):adler32_1(a.check,_,q,u.next_out-q)),u.data_type=a.bits+(a.last?64:0)+(a.mode===TYPE?128:0)+(a.mode===LEN_||a.mode===COPY_?256:0),(D===0&&q===0||I===Z_FINISH$1)&<===Z_OK$1&&(lt=Z_BUF_ERROR),lt},inflateEnd=u=>{if(inflateStateCheck(u))return Z_STREAM_ERROR$1;let I=u.state;return I.window&&(I.window=null),u.state=null,Z_OK$1},inflateGetHeader=(u,I)=>{if(inflateStateCheck(u))return Z_STREAM_ERROR$1;const a=u.state;return(a.wrap&2)===0?Z_STREAM_ERROR$1:(a.head=I,I.done=!1,Z_OK$1)},inflateSetDictionary=(u,I)=>{const a=I.length;let E,_,k;return inflateStateCheck(u)||(E=u.state,E.wrap!==0&&E.mode!==DICT)?Z_STREAM_ERROR$1:E.mode===DICT&&(_=1,_=adler32_1(_,I,a,0),_!==E.check)?Z_DATA_ERROR$1:(k=updatewindow(u,I,a,a),k?(E.mode=MEM,Z_MEM_ERROR$1):(E.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(u){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},u||{});const I=this.options;I.raw&&I.windowBits>=0&&I.windowBits<16&&(I.windowBits=-I.windowBits,I.windowBits===0&&(I.windowBits=-15)),I.windowBits>=0&&I.windowBits<16&&!(u&&u.windowBits)&&(I.windowBits+=32),I.windowBits>15&&I.windowBits<48&&(I.windowBits&15)===0&&(I.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let a=inflate_1$2.inflateInit2(this.strm,I.windowBits);if(a!==Z_OK)throw new Error(messages[a]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),I.dictionary&&(typeof I.dictionary=="string"?I.dictionary=strings.string2buf(I.dictionary):toString.call(I.dictionary)==="[object ArrayBuffer]"&&(I.dictionary=new Uint8Array(I.dictionary)),I.raw&&(a=inflate_1$2.inflateSetDictionary(this.strm,I.dictionary),a!==Z_OK)))throw new Error(messages[a])}Inflate$1.prototype.push=function(u,I){const a=this.strm,E=this.options.chunkSize,_=this.options.dictionary;let k,e,n;if(this.ended)return!1;for(I===~~I?e=I:e=I===!0?Z_FINISH:Z_NO_FLUSH,toString.call(u)==="[object ArrayBuffer]"?a.input=new Uint8Array(u):a.input=u,a.next_in=0,a.avail_in=a.input.length;;){for(a.avail_out===0&&(a.output=new Uint8Array(E),a.next_out=0,a.avail_out=E),k=inflate_1$2.inflate(a,e),k===Z_NEED_DICT&&_&&(k=inflate_1$2.inflateSetDictionary(a,_),k===Z_OK?k=inflate_1$2.inflate(a,e):k===Z_DATA_ERROR&&(k=Z_NEED_DICT));a.avail_in>0&&k===Z_STREAM_END&&a.state.wrap>0&&u[a.next_in]!==0;)inflate_1$2.inflateReset(a),k=inflate_1$2.inflate(a,e);switch(k){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(k),this.ended=!0,!1}if(n=a.avail_out,a.next_out&&(a.avail_out===0||k===Z_STREAM_END))if(this.options.to==="string"){let O=strings.utf8border(a.output,a.next_out),$=a.next_out-O,N=strings.buf2string(a.output,O);a.next_out=$,a.avail_out=E-$,$&&a.output.set(a.output.subarray(O,O+$),0),this.onData(N)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(!(k===Z_OK&&n===0)){if(k===Z_STREAM_END)return k=inflate_1$2.inflateEnd(this.strm),this.onEnd(k),this.ended=!0,!0;if(a.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(u){this.chunks.push(u)},Inflate$1.prototype.onEnd=function(u){u===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg};function inflate$1(u,I){const a=new Inflate$1(I);if(a.push(u),a.err)throw a.msg||messages[a.err];return a.result}function inflateRaw$1(u,I){return I=I||{},I.raw=!0,inflate$1(u,I)}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 noLogEvents=["heartbeat","onNetQuality","networkQualityChange"],compressArrayBuffer=u=>{const I=new Uint8Array(u),a=pako.deflate(I,{gzip:!0});return new Uint8Array(a==null?void 0:a.buffer)},decompressArrayBuffer=u=>{const I=new Uint8Array(u),a=pako.inflate(I,{gzip:!0});return new Uint8Array(a==null?void 0:a.buffer)},sendMessageFormat=u=>{const{event:I}=u;switch(u.data_original=u.data,u.time&&(u.timeStr=U(u.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),I){case"login":u.data=com.quick.voice.proto.Login.encode(u.data).finish();break;case"joinRoom":case"joinRoomEx":u.data=com.quick.voice.proto.JoinReq.encode(u.data).finish();break;case"quitRoom":u.data=com.quick.voice.proto.QuitReq.encode(u.data).finish();break;case"connectCF":u.data=com.quick.voice.proto.ConnectCFReq.encode(u.data).finish(),u.data=compressArrayBuffer(u.data),u.compress=!0;break;case"publish":u.data=com.quick.voice.proto.PublishReq.encode(u.data).finish(),u.data=compressArrayBuffer(u.data),u.compress=!0;break;case"subscribe":u.data=com.quick.voice.proto.SubscribeReq.encode(u.data).finish();break;case"closeTrack":u.data=com.quick.voice.proto.CloseTrackReq.encode(u.data).finish(),u.data=compressArrayBuffer(u.data),u.compress=!0;break;case"renegotiate":u.data=com.quick.voice.proto.RenegotiateReq.encode(u.data).finish(),u.data=compressArrayBuffer(u.data),u.compress=!0;break;case"syncRoomInfo":u.data=com.quick.voice.proto.SyncRoomInfoReq.encode(u.data).finish();break;case"updateCall":u.data=com.quick.voice.proto.UpdateCall.encode(u.data).finish();break;case"networkQualityChange":u.data=com.quick.voice.proto.NetQualityChange.encode(u.data).finish();break;case"pubNotify":u.data=com.quick.voice.proto.PublishNotify.encode(u.data).finish();break;default:u.data=new Uint8Array;break}return u},onMessageFormat=u=>{const{event:I,compress:a=!1}=u;if(u.data_remote=u.data,u.time&&(u.timeStr=U(u.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),a)try{u.data=decompressArrayBuffer(u.data)}catch(E){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",E)}switch(I){case"login":u.data=com.quick.voice.proto.Login.decode(u.data);break;case"joinRoom":case"joinRoomEx":u.data=com.quick.voice.proto.JoinRsp.decode(u.data);break;case"onJoinRoom":u.data=com.quick.voice.proto.JoinNotify.decode(u.data);break;case"onQuitRoom":u.data=com.quick.voice.proto.QuitNotify.decode(u.data);break;case"connectCF":u.data=com.quick.voice.proto.ConnectCFRsp.decode(u.data);break;case"publish":u.data=com.quick.voice.proto.PublishRsp.decode(u.data);break;case"onPublish":u.data=com.quick.voice.proto.PublishNotify.decode(u.data);break;case"subscribe":u.data=com.quick.voice.proto.SubscribeRsp.decode(u.data);break;case"closeTrack":u.data=com.quick.voice.proto.CloseTrackRsp.decode(u.data);break;case"onCloseTrack":u.data=com.quick.voice.proto.CloseTrackNotify.decode(u.data);break;case"onUpdateCall":u.data=com.quick.voice.proto.UpdateCall.decode(u.data);break;case"onDestroyRoom":u.data=com.quick.voice.proto.QuitNotify.decode(u.data);break;case"onUpdatePermissions":u.data=com.quick.voice.proto.UpdatePermissions.decode(u.data);break;case"onNetQuality":u.data=com.quick.voice.proto.NetQualityNotify.decode(u.data);break;case"syncRoomInfo":u.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(u.data);break;case"onCDNPlayUrlAdd":u.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(u.data);break;case"debugger":u.data=JSON.parse(new TextDecoder().decode(u.data));break}return u};class CallsWebSocket{constructor(I){ut(this,dt);ut(this,at,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:30*1e3});ut(this,yt,"");ut(this,kt,{});ut(this,vt,{});Z(this,"state","closed");Z(this,"sendMessageBefore",async()=>{});Z(this,"onReconnectSuccess",I=>{});Z(this,"onReconnectStop",I=>{});ut(this,Ct,I=>{let a=!0;const{code:E=1e3,reason:_=""}=I;return E===1e3&&(_==="quit success!"||_==="replace old connection!")&&(a=!1),a});ut(this,Ut,async I=>{Q(this,at).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",I),this.state="connected",this.onReconnectSuccess(I)});ut(this,Mt,async I=>{Q(this,at).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",I),this.close(),this.state="closed",this.onReconnectStop(I)});ut(this,Pt,()=>{const I={event:"heartbeat",sn:+`${F(1e5,999999)}`};return com.quick.voice.proto.CommonReq.encode(I).finish()});ut(this,Nt,(I,a={})=>{try{const{time:E,event:_,data:k={},data_original:e={},data_remote:n,...O}=a,$=U(E,"YYYY-MM-DD hh:mm:ss",{offset:480});let N={};const D=(et={})=>{const tt=JSON.parse(JSON.stringify(et)),nt=Object.keys(tt);for(const _t of nt)(_t.includes("sdp")||_t.includes("Sdp"))&&(tt[_t]="");return tt};let q="res ↓";switch(I){case"res":q="res ↓",N=D(k);break;case"req":q="req ↑",N=D(e);break}let P="#quickvo.logs";ignoreEvent.includes(_)&&(P="#quickvo.ignoreEvents");const j={"#action":q,timeStr:$,event:_,data:N,time:E,...O},V=localStorage.getItem(P)||JSON.stringify([]),J=JSON.parse(V);let z=_==="heartbeat";const Y=[j];for(const et of J){const{event:tt}=et;if(tt==="heartbeat"){if(z)continue;z=!0}if(Y.length===200)break;Y.push(et)}localStorage.setItem(P,JSON.stringify(Y))}catch(E){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",E)}});ut(this,Lt,(I,{resolve:a,reject:E})=>{const{sn:_}=I,k=()=>{const n=Q(this,kt)[_];clearTimeout(n.destructionTimer),delete Q(this,kt)[_]},e=setTimeout(()=>{const n=Q(this,kt)[_];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",n.message),k(),E("event is timeout")},Q(this,at).timeout);Q(this,kt)[_]={message:I,resolve:a,reject:E,destruction:k,destructionTimer:e}});ut(this,Bt,I=>Q(this,kt)[I]);ut(this,jt,async I=>{const a=new Uint8Array(I),E=com.quick.voice.proto.CommonRsp.decode(a),{sn:_,event:k}=E,e=onMessageFormat(E);if(Q(this,at).debug&&(noLogEvents.includes(k)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",e),ignoreEvent.includes(k)||Q(this,Nt).call(this,"res",e)),notifyName_keys.includes(k))return this.emitNotify(k,L(e,["code","data","desc"]));const O=Q(this,Bt).call(this,_);if(O){const{resolve:$=D=>{},destruction:N=()=>{}}=O;$(L(e,["code","data","desc"])),N()}});Z(this,"clearEvents",(I=[])=>{const a=Object.keys(Q(this,kt));I.length===0&&(I=a);for(const E of a){if(!I.includes(E))continue;const _=Q(this,kt)[E];clearTimeout(_.destructionTimer),delete Q(this,kt)[E]}});Z(this,"connect",async(I="")=>new Promise(async a=>{I&>(this,yt,I),Q(this,dt)&&(await Q(this,dt).close(),this.state="closed");const E=`${Q(this,at).url}?s=${Q(this,yt)}&t=${Date.now()}`;gt(this,dt,new M({...Q(this,at),url:E,binaryType:"arraybuffer",onMessage:Q(this,jt),checkReconnect:Q(this,Ct),getHeartbeatMsg:Q(this,Pt),onReconnectSuccess:Q(this,Ut),onReconnectStop:Q(this,Mt)})),this.state="connecting",await Q(this,dt).connect(),this.state="connected",Q(this,at).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 当前广播事件",Q(this,vt)),a(Q(this,dt))}));Z(this,"close",async()=>{var a;Q(this,at).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const I=Object.keys(Q(this,kt));for(const E of I){const{destructionTimer:_}=Q(this,kt)[E];clearTimeout(_)}gt(this,kt,{}),await((a=Q(this,dt))==null?void 0:a.close()),gt(this,dt,void 0),this.state="closed"});Z(this,"sendMessage",(I,a=!0)=>new Promise(async(E,_)=>{var N;await this.sendMessageBefore();const{event:k,...e}=I,n=Date.now(),O=sendMessageFormat({event:k,sn:+`${n}${F(1e3,9999)}`,time:n,valid:Q(this,at).timeout,version:1,compress:!1,...e});Q(this,at).debug&&(noLogEvents.includes(k)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",O),ignoreEvent.includes(k)||Q(this,Nt).call(this,"req",O)),a&&Q(this,Lt).call(this,O,{resolve:E,reject:_});const $=com.quick.voice.proto.CommonReq.encode(O).finish();(N=Q(this,dt))==null||N.sendMessage($)}));Z(this,"emitNotify",async(I,a)=>{const E=Q(this,vt)[I]||[];for(const _ of E){const{callback:k=async()=>{}}=_;await k(a)}});Z(this,"addNotify",(I,a=!1)=>{const{event:E,sn:_=ht(32)}=I;Q(this,vt)[E]||(Q(this,vt)[E]=[]);const k=Q(this,vt)[E],e=k.findIndex(n=>n.sn===_);return e!==-1&&k.splice(e,1),a?k.unshift(I):k.push(I),_});Z(this,"removeNotify",(I=[])=>{if(I.length===0)gt(this,vt,{});else{const a=Object.keys(Q(this,vt));for(const E of a)Q(this,vt)[E]=Q(this,vt)[E].filter(_=>!I.includes(_.sn||""))}Q(this,at).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",Q(this,vt))});gt(this,at,{...Q(this,at),...I})}}dt=new WeakMap,at=new WeakMap,yt=new WeakMap,kt=new WeakMap,vt=new WeakMap,Ct=new WeakMap,Ut=new WeakMap,Mt=new WeakMap,Pt=new WeakMap,Nt=new WeakMap,Lt=new WeakMap,Bt=new WeakMap,jt=new WeakMap;var y=Object.defineProperty,x=u=>{throw TypeError(u)},g=(u,I,a)=>I in u?y(u,I,{enumerable:!0,configurable:!0,writable:!0,value:a}):u[I]=a,h=(u,I,a)=>g(u,typeof I!="symbol"?I+"":I,a),b=(u,I,a)=>I.has(u)||x("Cannot "+a),o=(u,I,a)=>(b(u,I,"read from private field"),a?a.call(u):I.get(u)),f=(u,I,a)=>I.has(u)?x("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(u):I.set(u,a),p=(u,I,a,E)=>(b(u,I,"write to private field"),I.set(u,a),a),d,c,l;class K{constructor(I){f(this,d,new Map),f(this,c,[]),h(this,"index"),h(this,"setCondition",(a,E)=>{o(this,d).set(a,E),E&&o(this,l).call(this)}),h(this,"addTask",(a,E,_={})=>{const k={key:"",strict:!1,describe:"",..._};let{key:e,strict:n,describe:O}=k;e?this.clear([e]):e=`${this.index++}`;const $={key:e,func:a,conditionKeys:E,describe:O,strict:n};return o(this,c).unshift($),this.checkConditions(E)&&(a(),n===!1&&this.clear([e])),e}),h(this,"clear",(a=[])=>{if(a.length===0){p(this,c,[]);return}for(const E of a){const _=o(this,c).findIndex(k=>k.key===E);_!==-1&&o(this,c).splice(_,1)}}),h(this,"getConditions",()=>Object.fromEntries(o(this,d))),h(this,"getTasks",()=>{const a=[];for(const E of o(this,c)){const{key:_,describe:k,conditionKeys:e}=E;a.push({key:_,describe:k,conditionKeys:e})}return a}),h(this,"checkConditions",a=>{let E=!0;for(const _ of a)if(o(this,d).get(_)===!1){E=!1;break}return E}),f(this,l,()=>{const a=o(this,c).length;for(let E=a;E>0;E--){const _=E-1,k=o(this,c)[_],{conditionKeys:e,func:n,strict:O}=k;this.checkConditions(e)&&(n(),O===!1&&o(this,c).splice(_,1))}}),this.index=0;for(const a of I)o(this,d).set(a,!0)}}d=new WeakMap,c=new WeakMap,l=new WeakMap;class RoomBase{constructor(I){Z(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:"",callType:0,debug:!1,logUrl:"https://log1.putplay.cc",newPublishAutoSubscribe:!0});Z(this,"prohibitNotify",!1);Z(this,"isEarly",!1);Z(this,"isInRoom",!1);Z(this,"taskQueue",new K(["createWs","createSession","ice","joinRoom","createTrack","subscribe","closeTrack"]));Z(this,"roomState","ready");Z(this,"createAt",Date.now());Z(this,"cwsIns");Z(this,"peerIns",new RTCPeerConnection({bundlePolicy:"max-bundle"}));Z(this,"transceiverMap",new Map);Z(this,"userMap",new Map);Z(this,"setLocalStreamActiveMap",new Map);Z(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});Z(this,"reportLogs",(I,a="未知错误")=>{const{appid:E,userId:_,earlyId:k="",logUrl:e}=this.options,n="web",O=$=>({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})[$].toString();{const $=O(I),N={origin:n,type:$,app_id:E,user_id:_,ins_id:k,desc:a},D=btoa(encodeURI(JSON.stringify(N))),q=`${e}/upload/log?log_key=${D}`;{const P=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),V=new TextEncoder().encode(P),J=pako.deflate(V,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:N,url:q,size:ot(J.byteLength)}),fetch(q,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:J})}}});ut(this,Zt,()=>{this.taskQueue.setCondition("createWs",!0),this.taskQueue.setCondition("createSession",!1),this.taskQueue.setCondition("ice",!1)});Z(this,"getRoomInfo",()=>{const{options:I,roomState:a,createAt:E}=this;return{...I,roomState:a,createAt:E}});Z(this,"setRoomState",I=>{this.roomState=I;const a=enum_roomState[I],E={state:I,stateStr:a};this.cwsIns.emitNotify("onRoomState",{code:200,data:E,desc:"room state is change."})});Z(this,"setOptions",async I=>{const a={...this.options,...I};this.options=a});Z(this,"stopStream",async I=>{const a=I.getTracks();for(const E of a)E.stop()});Z(this,"getMediaDevicesErrInfo",async()=>{try{const I=await navigator.mediaDevices.enumerateDevices();I.find(E=>E.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),I.find(E=>E.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(I){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",I)}return this.mediaDevicesErrInfo});Z(this,"getUserMediaKey",(I,a)=>`${I}-${a}`);Z(this,"getCallActionMap",(I=0)=>{const E=Number(I).toString(2).padStart(4,"0").split(""),[_,k,e,n]=E;return{microphoneCamera_audio:!!Number(n),microphoneCamera_video:!!Number(e),screenSharing_video:!!Number(k),screenSharing_audio:!!Number(_)}});Z(this,"getAverageVolume",(I,a)=>{I.getByteFrequencyData(a);let E=0;for(let k=0;k<a.length;k++)E+=a[k];return Math.ceil(E/a.length)});Z(this,"getCallAction",async I=>{let a="";const E=k=>I.findIndex(({type:n,enabled:O=!0})=>n===k&&O)===-1?"0":"1";return a=`${E(0)}${a}`,a=`${E(1)}${a}`,a=`${E(2)}${a}`,a=`${E(3)}${a}`,parseInt(a,2)});Z(this,"getTrackNamesFormTracks",(I,a=[],E="trackName")=>{const _=[];for(const k of I){const{type:e}=k;if(a.length===0||a.includes(e)){const n=k[E];n&&_.push(`${n}`)}}return _});Z(this,"usersFilter",I=>ft(I,["id","isSelf","joinTime","tracks","callAction","callActionStr","callActionMap","network","permissions","isPublished","updateStreams"]).sort((_,k)=>_.id.localeCompare(k.id,"en")));this.setOptions(I),this.cwsIns=new CallsWebSocket({...I}),Q(this,Zt).call(this)}}Zt=new WeakMap;class RoomMedias extends RoomBase{constructor(a){super(a);ut(this,Rt,[]);ut(this,wt,new Map);ut(this,bt,new Map);ut(this,St,new Map);ut(this,$t,new Map);Z(this,"localStreamsActionMap",new Map);ut(this,Ft,()=>{Q(this,bt).set("microphoneCamera_audio",{}),Q(this,bt).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),Q(this,bt).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),Q(this,bt).set("screenSharing_audio",{})});ut(this,Ht,()=>{Q(this,wt).set("audioinput","default"),Q(this,wt).set("videoinput","default"),Q(this,wt).set("audiooutput","default")});Z(this,"emitNotifyUpdateUsersStreams",async a=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:a,desc:"users streams is change."})});Z(this,"initUserMediaStreamContext",async(a,E,_)=>{var O;const[k]=_.getTracks();if(!k){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:a,mediaType:E,stream:_});return}this.removeUserMediaStreamContext(a,E);const e=this.getUserMediaKey(a,E),{kind:n}=k;switch(n){case"audio":{const $=new AudioMediaContext(k);Q(this,St).set(e,$)}break;case"video":{const $=new VideoMediaContext(k);Q(this,St).set(e,$)}break}{const $=this.getUserMediaStreamContext(a,E);if($&&$.kind==="audio")try{const N=Q(this,wt).get("audiooutput");(O=$.audioContext)==null||O.setSinkId(N)}catch(N){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error",N)}}});Z(this,"getUserMediaStreamContext",(a,E)=>{const _=this.getUserMediaKey(a,E);return Q(this,St).get(_)});Z(this,"getUserAudioMediaStreamContext",(a,E)=>{const _=this.getUserMediaKey(a,E);return Q(this,St).get(_)});Z(this,"removeUserMediaStreamContext",(a,E)=>{const _=this.getUserMediaKey(a,E),k=Q(this,St).get(_);k==null||k.stop(),Q(this,St).delete(_)});Z(this,"getUserStream",(a,E)=>{const _=this.getUserMediaStreamContext(a,E);return(_==null?void 0:_.getStream())||new MediaStream});Z(this,"getUserStreams",(a,E=[])=>{E.length===0&&(E=mediaType_keys);const _={};for(const k of E){const e=this.getUserStream(a,k);_[k]=e}return _});Z(this,"removeUserStreams",async(a,E=[])=>{E.length===0&&(E=mediaType_keys);for(const _ of E)this.removeUserMediaStreamContext(a,_)});Z(this,"clearUserStreams",()=>{const a=Q(this,St).values();for(const E of a)E.stop();gt(this,St,new Map)});Z(this,"setMediaTrackConstraints",async(a,E)=>{Q(this,bt).set(a,E);const k=this.getUserStream(this.options.userId,a).getTracks();if(k.length!==0)for(const e of k){const O={...e.getConstraints(),...E};await e.applyConstraints(O)}});Z(this,"stopLocalStreams",async(a=[])=>{a.length===0&&(a=mediaType_keys);for(const E of a){const _=Q(this,$t).get(E);_&&await this.stopStream(_),Q(this,$t).delete(E)}});Z(this,"addLocalStream",(a,E)=>{const _=Q(this,$t).get(a);_&&this.stopStream(_),Q(this,$t).set(a,E)});Z(this,"initLocalStream",async a=>{switch(a){case"microphoneCamera_audio":{const E=Q(this,wt).get("audioinput"),_=Q(this,bt).get("microphoneCamera_audio"),k=await navigator.mediaDevices.getUserMedia({audio:{deviceId:E,..._},video:!1});this.addLocalStream("microphoneCamera_audio",k)}break;case"microphoneCamera_video":{const E=Q(this,wt).get("videoinput"),_=Q(this,bt).get("microphoneCamera_video"),k=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:E,..._}});this.addLocalStream("microphoneCamera_video",k)}break;case"microphoneCamera":{const E=Q(this,wt).get("audioinput"),_=Q(this,wt).get("videoinput"),k=Q(this,bt).get("microphoneCamera_audio"),e=Q(this,bt).get("microphoneCamera_video"),O=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:E,...k},video:{deviceId:_,...e}})).getTracks();for(const $ of O){const{kind:N}=$;if(N==="audio"){const D=new MediaStream;D.addTrack($),this.addLocalStream("microphoneCamera_audio",D)}if(N==="video"){const D=new MediaStream;D.addTrack($),this.addLocalStream("microphoneCamera_video",D)}}}break;case"screenSharing_audio":{const E=Q(this,bt).get("screenSharing_audio"),k=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...E})).getTracks();for(const e of k){const{kind:n}=e;if(n==="audio"){const O=new MediaStream;O.addTrack(e),this.addLocalStream("screenSharing_audio",O)}}}break;case"screenSharing_video":{const E=Q(this,bt).get(a),k=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...E})).getTracks();for(const e of k){const{kind:n}=e;if(n==="video"){const O=new MediaStream;O.addTrack(e),this.addLocalStream("screenSharing_video",O)}}}break;case"screenSharing":{const E=Q(this,bt).get("screenSharing_audio"),_=Q(this,bt).get("screenSharing_video"),e=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...E,..._})).getTracks();for(const n of e){const{kind:O}=n;if(O==="audio"){const $=new MediaStream;$.addTrack(n),this.addLocalStream("screenSharing_audio",$)}if(O==="video"){const $=new MediaStream;$.addTrack(n),this.addLocalStream("screenSharing_video",$)}}}break}});Z(this,"getLocalStream",a=>Q(this,$t).get(a));Z(this,"getLocalStreams",(a=[])=>{a.length===0&&(a=mediaType_keys);const E={};for(const _ of a)E[_]=this.getLocalStream(_);return E});ut(this,Et,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(a=>{gt(this,Rt,a.sort((E,_)=>E.label.localeCompare(_.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(a){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",a)}),Q(this,Rt)));ut(this,zt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await Q(this,Et).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),Q(this,Et).call(this)});Z(this,"getMediaDeviceKind",a=>Q(this,wt).get(a));Z(this,"changeAudiooutput",()=>{const a=Q(this,St).values();for(const E of a)if(E.kind==="audio"&&"setSinkId"in HTMLMediaElement.prototype)try{E.audioContext.setSinkId(deviceId)}catch(_){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",_)}});Z(this,"setDeviceKind",(a,E)=>{Q(this,wt).set(a,E)});Z(this,"setAudioOutputDevice",a=>this.setDeviceKind("audiooutput",a));Z(this,"getEnumerateDevices",async a=>(await Q(this,Et).call(this),Q(this,Rt).filter(_=>_.kind===a)));Z(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));Z(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));Z(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));Q(this,zt).call(this),Q(this,Ht).call(this),Q(this,Ft).call(this)}}Rt=new WeakMap,wt=new WeakMap,bt=new WeakMap,St=new WeakMap,$t=new WeakMap,Ft=new WeakMap,Ht=new WeakMap,Et=new WeakMap,zt=new WeakMap;class RoomUsers extends RoomMedias{constructor(a){super(a);Z(this,"getMaxVolumeUser",()=>{const a=Array.from(this.userMap.values(),({id:_})=>_);if(a.length===0)return;let E=[];for(const _ of a){const k=this.getUserMediaStreamContext(_,"microphoneCamera_audio");if(!k||k.kind!=="audio")continue;const e=k.getVolume();E.push({id:_,volume:e})}return E=E.sort((_,k)=>_.volume-k.volume>0?-1:1),E[0]});Z(this,"setAudioFilter",async(a={})=>{const E=await this.getUsersId();for(const _ of E){{const k=this.getUserMediaStreamContext(_,"microphoneCamera_audio");(k==null?void 0:k.kind)==="audio"&&(k==null||k.setFilter(a))}{const k=this.getUserMediaStreamContext(_,"screenSharing_audio");(k==null?void 0:k.kind)==="audio"&&(k==null||k.setFilter(a))}}});Z(this,"setEnhanceGain",async(a,E,_)=>{const k=this.getUserMediaStreamContext(a,E);(k==null?void 0:k.kind)==="audio"&&(k==null||k.setEnhanceGain(_))});Z(this,"setVolume",(a,E,_)=>{const k=this.getUserMediaStreamContext(a,E);(k==null?void 0:k.kind)==="audio"&&(k==null||k.setVolumeGain(_))});Z(this,"getVolume",(a,E)=>{const _=this.getUserMediaStreamContext(a,E);let k=0;return(_==null?void 0:_.kind)==="audio"&&(k=_==null?void 0:_.getVolume()),k});Z(this,"clearUsers",()=>{this.userMap=new Map});Z(this,"removeUsers",async a=>{for(const E of a)this.userMap.delete(E),await this.removeUserStreams(E)});Z(this,"createUser",async a=>{const E=Date.now(),_={id:a,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isSelf:a===this.options.userId,isPublished:!1,joinTime:E,updateAt:E,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(a,_)});Z(this,"getUser",async a=>(this.userMap.has(a)||await this.createUser(a),this.userMap.get(a)));Z(this,"getUsers",async(a=[])=>{a.length===0&&(a=[...this.userMap.keys()]);const E=[];for(const _ of a){const k=await this.getUser(_);E.push(k)}return E});Z(this,"getAllUserTrackMids",async()=>{const a=await this.getUsers(),E=[];for(const _ of a){const{tracks:k=[]}=_;for(const e of k)E.push(e.mid)}return E});Z(this,"getUserTrackByTrackName",async a=>{const E=await this.getUsers(),_=[];for(const k of E){const{tracks:e=[]}=k;for(const n of e){const{trackName:O}=n;a.includes(O)&&_.push(n)}}return _});Z(this,"getUserTrackFromMid",async a=>{const E=await this.getUsers();let _;for(const k of E){const{tracks:e=[]}=k;for(const n of e)if(n.mid===a){_=n;break}}return _});Z(this,"checkUserInRoom",a=>this.userMap.has(a));Z(this,"getUsersId",async()=>[...this.userMap.keys()]);Z(this,"getCaller",async()=>await this.getUser(this.options.userId));Z(this,"updateIsPublished",async(a,E=!1)=>{const _=await this.getUser(a);_.isPublished=E});Z(this,"setUserUpdateStreams",async(a,E,_=!0)=>{const k=await this.getUser(a),e={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};e[E]=_,k.updateStreams=e});Z(this,"updateUsertracks",async(a,E=[],_)=>{const k=await this.getUser(a);_&&(E=[...k.tracks,...E]),E=E.filter(({mid:O=""})=>O!==""),E=mt(E,["type"]),E=E.sort((O,$)=>O.type-$.type<0?-1:1);for(const O of E)O.userId=a,O.mediaType=mediaType_keys[O.type],O.enabled===void 0&&(O.enabled=!0);k.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const e=ft(k.tracks,["mediaType","enabled","mid","msid","trackName"]),n=ft(E,["mediaType","enabled","mid","msid","trackName"]);{const O="microphoneCamera_audio",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="microphoneCamera_video",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="screenSharing_audio",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}{const O="screenSharing_video",$=n.find(q=>q.mediaType===O),N=e.find(q=>q.mediaType===O),D=JSON.stringify($)!==JSON.stringify(N);k.updateStreams[O]=D}k.tracks=E});Z(this,"updateUserCallAction",async(a,E=0)=>{const _=await this.getUser(a);_.callAction=E,_.callActionStr=E.toString(2).padStart(4,"0"),_.callActionMap=this.getCallActionMap(E)});Z(this,"updateUserNetwork",async(a,E={egress:5,ingress:5})=>{const _=await this.getUser(a);_.network=E});Z(this,"updateUserPermissions",async(a,E)=>{if(E){const _=await this.getUser(a);_.permissions=E}});Z(this,"updateUserBase",async a=>{const E=await this.getUser(a);E.isSelf=a===this.options.userId,E.updateAt=Date.now()});Z(this,"updateUsers",async a=>{for(const E of a){const{id:_,tracks:k,callAction:e,permissions:n,isPublished:O}=E;await this.updateUserBase(_),await this.updateIsPublished(_,O),await this.updateUserPermissions(_,n),await this.updateUsertracks(_,k,!0),await this.updateUserCallAction(_,e),await this.updateUserNetwork(_)}});Z(this,"emitNotifyUpdateUser",async a=>{const E=await this.getUsers([a]),[_]=this.usersFilter(E);this.cwsIns.emitNotify("onRoomUser",{code:200,data:_,desc:"user info is change."})});Z(this,"emitNotifyUpdateUsers",async()=>{const a=await this.getUsers(),E=this.usersFilter(a);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:E,desc:"all users info is change."})})}}const createMutedAudioStream=()=>{const u=new AudioContext,I=u.createOscillator();I.type="sine",I.frequency.setValueAtTime(0,u.currentTime);const a=u.createGain();a.gain.value=0,I.connect(a),a.connect(u.destination),I.start();const E=u.createMediaStreamDestination();return a.disconnect(),I.connect(E),E.stream},createFakeVideoStream=(u=10,I=10,a=30)=>{const E=document.createElement("canvas"),_=E.getContext("2d");E.width=u,E.height=I;let k=0;return setInterval(()=>{_.clearRect(0,0,E.width,E.height);const O=_.createLinearGradient(0,0,E.width,E.height);O.addColorStop(0,`hsla(${k}, 100%, 50%, 0)`),O.addColorStop(1,`hsla(${k+120}, 100%, 50%, 0)`),_.fillStyle=O,_.fillRect(0,0,E.width,E.height),k=(k+1)%360},100),E.captureStream(a)};class RoomPeer extends RoomUsers{constructor(a){super(a);ut(this,Ot,new Map);Z(this,"getPeerStatsTimer",0);Z(this,"reports",[]);Z(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Z(this,"initPeer",()=>{this.peerIns=new RTCPeerConnection({bundlePolicy:"max-bundle"}),this.transceiverMap=new Map,Q(this,Wt).call(this),Q(this,Gt).call(this)});ut(this,Jt,()=>{for(const a of mediaType_keys){const E=Q(this,Ot).get(a);if(E){const _=E.getTracks();for(const k of _)k.stop()}switch(a){case"microphoneCamera_audio":Q(this,Ot).set("microphoneCamera_audio",createMutedAudioStream());break;case"microphoneCamera_video":Q(this,Ot).set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":Q(this,Ot).set("screenSharing_audio",createMutedAudioStream());break;case"screenSharing_video":Q(this,Ot).set("screenSharing_video",createFakeVideoStream());break}}});Z(this,"getPhoneyStreams",a=>Q(this,Ot).get(a));Z(this,"replaceSenderStream",async(a=[],E)=>{a.length===0&&(a=mediaType_keys);for(const _ of a){const k=this.transceiverMap.get(_);let e;if(k){const{sender:n}=k;E?e=this.getLocalStream(_):e=this.getPhoneyStreams(_);const[O]=(e==null?void 0:e.getTracks())||[];O&&await n.replaceTrack(O)}}});Z(this,"getSenderTracks",async(a=[])=>{const E=[];for(const _ of a){const k=this.transceiverMap.get(_);if(!k)continue;const{mid:e,sender:n}=k,{track:O}=n;if(!O)continue;const{id:$,enabled:N}=O,q={type:mediaType_keys.findIndex(P=>P===_),enabled:N,trackName:$,location:"local",mid:e};E.push(q)}return E});Z(this,"addSenders",async(a=[])=>{a.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const E=[];for(const _ of a){if(this.transceiverMap.get(_))continue;const e=this.getPhoneyStreams(_),[n]=e.getTracks(),O=this.peerIns.addTransceiver(n,{direction:"sendonly"});this.transceiverMap.set(_,O),E.push(_)}if(a.length===0||E.length!==0){const _=await this.peerIns.createOffer();if(this.options.debug){const k=libExports.parse(_.sdp),e=ft(k.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:e,sdpJson:k,description:_})}await this.peerIns.setLocalDescription(_)}return E});Z(this,"removeSenders",async(a=[])=>{a.length===0&&(a=mediaType_keys);for(const E of a)this.transceiverMap.has(E)&&this.transceiverMap.delete(E)});Z(this,"clearTransceivers",async()=>{const a=await this.getAllUserTrackMids(),E=this.peerIns.getTransceivers();for(const _ of E){const{mid:k}=_;Number(k)===0||a.includes(k)||(_.stop(),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: clearTransceivers: ${k} is stop.`,_))}});Z(this,"onSubscribeUserTracks",a=>{let E=0;return new Promise(async _=>{const k=[];for(const e of a){const{tracks:n=[]}=e;for(const O of n){const{trackName:$,mid:N}=O,[D]=await this.getUserTrackByTrackName([$]);k.push({...D,mid:N})}}{let e=[];const n=async()=>{clearTimeout(E);const $=new Map;for(const D of e){const{userId:q,mediaType:P}=D;if(!q||!P)continue;$.has(q)||$.set(q,{userId:q,tracks:[],updateStreams:{}});const V=$.get(q);V.tracks.push(D),V.updateStreams[P]=!0}const N=[...$.values()];for(const D of N){const{userId:q,tracks:P}=D;await this.updateUsertracks(q,P,!0)}await this.emitNotifyUpdateUsersStreams(N),this.peerIns.removeEventListener("track",O),_(!0)},O=async $=>{const{streams:N,transceiver:D}=$,[q]=N,{mid:P,receiver:j}=D,{track:V}=j,{id:J,kind:z}=V,Y=k.find(nt=>nt.mid===`${P}`);if(!Y)return;const{userId:et,mediaType:tt}=Y;if(!(!et||!tt)){if(await this.initUserMediaStreamContext(et,tt,q),z==="audio"){const nt=this.getUserMediaStreamContext(et,tt);(nt==null?void 0:nt.kind)==="audio"&&nt.setMute(!1)}{const nt={...Y,mid:P,msid:J};e.push(nt)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${e.length}/${k.length}`,{mediaType:tt,mid:P,userTrack:Y,e:$}),k.length===e.length&&n()}};this.peerIns.addEventListener("track",O),E=setTimeout(()=>n(),5*1e3)}})});ut(this,Wt,()=>{let a=0;const E=()=>{this.setRoomState("closed")};this.peerIns.oniceconnectionstatechange=()=>{const _=this.peerIns.iceConnectionState;switch(this.taskQueue.setCondition("ice",!1),clearTimeout(a),_){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${_}`),this.taskQueue.setCondition("ice",!0);break;case"disconnected":a=setTimeout(E,30*1e3),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${_}`);break;case"failed":this.peerIns.restartIce();break;case"closed":E(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${_}`);break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${_}`);break}}});Z(this,"closeUserTracks",async(a,E=[],_=!1)=>{const k=[];for(const $ of E){const{mid:N,trackName:D,msid:q}=$;k.push(D),N&&k.push(N),q&&k.push(q)}const e=$=>k.includes($),n=this.peerIns.getTransceivers();for(const $ of n){const{mid:N}=$;N&&e(N)&&($.stop(),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver: ${N} is stop.`,$))}const O=await this.getUser(a);if(O){for(const $ of O.tracks){const{trackName:N,msid:D,userId:q,mediaType:P}=$;!q||!P||!e(N)||(this.removeUserMediaStreamContext(q,P),D&&delete $.msid)}if(_){const $=O.tracks.filter(({trackName:N})=>!e(N));await this.updateUsertracks(a,$,!1)}}});Z(this,"createOffer",async()=>{const a=await this.peerIns.createOffer();if(this.options.debug){const E=libExports.parse(a.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:_,sdpJson:E,description:a})}await this.peerIns.setLocalDescription(a)});Z(this,"createAnswer",async()=>{const a=await this.peerIns.createAnswer();if(this.options.debug){const E=libExports.parse(a.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:_,sdpJson:E,description:a})}await this.peerIns.setLocalDescription(a)});Z(this,"getSdp",()=>{var a;return(a=this.peerIns.localDescription)==null?void 0:a.sdp});Z(this,"setRemoteDescription",async a=>{if(this.options.debug){const E=libExports.parse(a.sdp),_=ft(E.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:_,sdpJson:E,description:a})}return await this.peerIns.setRemoteDescription(a),a});Z(this,"getPeerNetwork",()=>this.peerNetwork);Z(this,"setCallStrategy",async(a,E=[])=>{E.length===0&&(E=mediaType_keys);let _="balanced";switch(a){case"qualityPriority":_="maintain-resolution";break;case"fluencyPriority":_="maintain-framerate";break;case"balancedDowngrade":_="balanced";break}const k=await this.getCaller(),e=Array.from(k.tracks,({trackName:O})=>O),n=this.peerIns.getSenders();for(const O of n){const{track:$}=O;if(!$||!e.includes($.id))continue;const N=O.getParameters();O.setParameters({...N,degradationPreference:_})}});Z(this,"setRTCRtpSenderParameters",a=>{try{const E=this.peerIns.getSenders();for(const _ of E){const k=_.getParameters();_.setParameters({...k,...a})}}catch(E){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",E)}});Z(this,"getReportsByMid",async(a=[])=>a.length===0?this.reports:this.reports.filter(E=>a.includes(E.mid)));Z(this,"getRoomNetwork",()=>this.peerNetwork);ut(this,Kt,async()=>{try{const a=await this.peerIns.getStats(),E=["inbound-rtp","remote-inbound-rtp","outbound-rtp"],k=[...a.values()].filter(nt=>E.includes(nt.type));let e=0,n=0,O=0,$=0,N=0,D=0,q=[],P=[];for(const nt of this.reports){const{packetsSent:_t,packetsLost:it}=nt;_t&&(O+=_t),it&&($+=it)}this.reports=k;for(const nt of this.reports){const{bytesReceived:_t,bytesSent:it,packetsSent:lt,packetsLost:st,jitter:rt,roundTripTime:ct}=nt;_t&&(e=_t),it&&(n=it),lt&&(N+=lt),st&&(D+=st),ct&&q.push((ct*100).toFixed(2)),rt&&P.push(rt.toFixed(2))}P.sort().reverse(),q.sort().reverse();const j=N-O,V=D-$,J=j===0?"0.00":(V/j).toFixed(2),[z="0"]=q,[Y="0"]=P,et={inboundBytes:e,outboundBytes:n,lostRate:J,roundTripTime:z,jitter:Y};this.peerNetwork=et;const tt=(nt,_t,it)=>{const lt=Number(nt),st=Number(_t),rt=Number(it);let ct="0";return lt<.03&&st<100&&rt<.05?ct="5":lt<.06&&st<160&&rt<.1?ct="4":lt<.1&&st<250&&rt<.15?ct="3":lt<.15&&st<400&&rt<.2?ct="2":ct="1",Number(ct)};{const nt=tt(J,z,Y),_t=await this.getCaller(),{network:it}=_t,lt={egress:nt,ingress:nt},st=JSON.stringify(it)!==JSON.stringify(lt);if(await this.updateUserNetwork(this.options.userId,lt),st){this.emitNotifyUpdateUsers();const{userId:rt,roomId:ct}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...lt,userId:rt,roomId:ct}},!1)}}}catch(a){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",a)}});ut(this,Gt,()=>{const a=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||Q(this,Kt).call(this)};this.getPeerStatsTimer=setInterval(a,1*1e3)});Z(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer));Q(this,Jt).call(this)}}Ot=new WeakMap,Jt=new WeakMap,Wt=new WeakMap,Kt=new WeakMap,Gt=new WeakMap;class RoomCalls extends RoomPeer{constructor(a){super(a);Z(this,"sdk_service_version","1.0.5");ut(this,Qt,async a=>{const{roomId:E}=this.options;if(!E)return;const{id:_,tracks:k=[]}=await this.getCaller();if(k.length===0)return;const e=k.filter(n=>n.mediaType&&a.includes(n.mediaType));this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:E,user:{id:_,tracks:e}}})});ut(this,xt,async a=>new Promise(async(E,_)=>{const{roomId:k,userId:e}=this.options,n={roomId:k,user:{id:e,callAction:a}};await this.cwsIns.sendMessage({event:"updateCall",data:n}).then(async O=>{const{code:$=0}=O;if($!==200)return _(O);await this.updateUserCallAction(e,a),E(a)}).catch(O=>_(O))}));ut(this,At,()=>new Promise(async(a,E)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return a(!0);this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:_}=this.options,{userId:k="",sdkToken:e,roomId:n}=this.options;if(!_)return E("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const O={a:e,b:k,c:_,r:n,v:this.sdk_service_version};if(this.isEarly){const N=ht();O.i=N,this.setOptions({earlyId:N})}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",O);const $=btoa(encodeURI(JSON.stringify(O)));await this.cwsIns.connect($),this.taskQueue.setCondition("createWs",!0),a(!0)}catch(_){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",_),this.reportLogs("ws_c_timeout",_.message||_),E(_)}}));ut(this,qt,()=>{if(!["connecting","connected"].includes(this.roomState))return this.setRoomState("connecting"),new Promise(a=>{const E=async()=>{try{this.taskQueue.setCondition("createSession",!1),await this.addSenders(),await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async _=>{const{code:k=0,desc:e,data:n}=_;if(k!==200)throw new Error(e);const{remoteSdp:O}=n;this.taskQueue.setCondition("ice",!1),await this.setRemoteDescription({type:"answer",sdp:O}),this.taskQueue.setCondition("createSession",!0);{let $=0;$=setTimeout(()=>{this.reportLogs("webrtc_c_timeout","ice连接无响应(30s)")},3e4);const N=()=>clearTimeout($);this.taskQueue.addTask(N,["ice"],{describe:"createSession"})}a(!0)})}catch(_){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo create session is error.",_),this.taskQueue.setCondition("createSession",!0),this.reportLogs("ws_c_timeout",_.message||_)}};this.taskQueue.addTask(E,["createWs"],{key:"createSession",describe:"createSession"})})});Z(this,"earlyConnect",(a=[])=>{this.isEarly=!0,Q(this,At).call(this),Q(this,qt).call(this),a.length===0&&(a=["microphoneCamera_audio","microphoneCamera_video"]),Q(this,Dt).call(this,a)});ut(this,Dt,async a=>new Promise(E=>{const _=async()=>{try{this.taskQueue.setCondition("createTrack",!1);const k=await this.addSenders(a),e=await this.getSenderTracks(k);if(e.length===0)return this.taskQueue.setCondition("createTrack",!0),E(!0);await this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:e,callAction:0}}).then(async n=>{const{code:O=0,desc:$,data:N}=n;if(O!==200)throw new Error($);const{remoteSdp:D}=N;await this.setRemoteDescription({type:"answer",sdp:D}),this.taskQueue.setCondition("createTrack",!0),E(!0)})}catch(k){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createTrack is error.",k),await this.removeSenders(a),this.taskQueue.setCondition("createTrack",!0),this.reportLogs("publish_error",k.message||k),E(!0)}};this.taskQueue.addTask(_,["createWs","createSession","ice","subscribe","createTrack","closeTrack"],{describe:"createTrack"})}));Z(this,"setLocalStream",(a,E)=>new Promise(async(_,k)=>{try{typeof a=="string"&&(a=[a]);const{userId:e=""}=this.options;for(const O of a)this.localStreamsActionMap.set(O,E);if(E){if(a.includes("microphoneCamera_audio")&&a.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):a.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):a.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):a.includes("screenSharing_audio")&&a.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):a.includes("screenSharing_audio")&&!a.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):a.includes("screenSharing_video")&&!a.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),a.includes("screenSharing_audio")){const $=this.getUserStream(e,"screenSharing_audio").getTracks();for(const N of $)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}if(a.includes("screenSharing_video")){const $=this.getUserStream(e,"screenSharing_video").getTracks();for(const N of $)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}else await this.stopLocalStreams(a);const n=this.getLocalStreams(a);this.cwsIns.emitNotify("onLocalStream",{code:200,data:n,desc:"local stream is change."}),_(n)}catch(e){k(e)}}));Z(this,"setMediaDeviceKind",(a,E)=>new Promise(async(_,k)=>{this.setDeviceKind(a,E);const e=await this.getCaller(),{id:n,tracks:O=[],callActionMap:$}=e,N=[],D=async q=>{const P=this.localStreamsActionMap.get(q),j=O.find(J=>J.mediaType===q),V=$[q];if(P){N.push(q),await this.stopLocalStreams([q]);try{await this.initLocalStream(q)}catch(J){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",J),await this.inactiveTracks([q],!1),k(J)}}if(j){const J=this.getLocalStream(q);if(J){const z=this.getUserMediaStreamContext(n,q);z==null||z.replaceStream(J),V&&await this.replaceSenderStream([q],!0)}}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setMediaDeviceKind",{mediaType:q,isOpen:P,hadTrack:j,isActive:V});{const J=this.getLocalStreams(N);this.cwsIns.emitNotify("onLocalStream",{code:200,data:J,desc:"local stream is change."}),_(!0)}};a==="audioinput"&&D("microphoneCamera_audio"),a==="videoinput"&&D("microphoneCamera_video"),a==="audiooutput"&&(this.changeAudiooutput(),_(!0))}));Z(this,"changeScreenSharing",async a=>{const E=await this.getCaller(),{tracks:_=[],callActionMap:k}=E;try{await this.setLocalStream(a,!0);for(const e of a)_.find(O=>O.mediaType===e&&k[e])&&await this.replaceSenderStream([e],!0)}catch(e){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",e)}});Z(this,"joinRoom",async a=>(this.setOptions(a),await Q(this,At).call(this),new Promise((E,_)=>{this.clearUsers();let k="";const e=async()=>{this.taskQueue.clear([k]),await this.emitNotifyUpdateUsers();const O=await this.getUsers();this.taskQueue.setCondition("joinRoom",!0),E(O)},n=async()=>{try{this.taskQueue.setCondition("joinRoom",!1);const{roomId:O,userId:$,callType:N}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:N,roomId:O,user:{id:$,tracks:[],callAction:0}}}).then(async D=>{const{code:q=0,desc:P="服务器繁忙",data:j}=D;if(q!==200)return _(P);const{roomId:V="",roomUsers:J=[]}=j;if(V!==O)return _("加入的房间不匹配");this.isInRoom=!0,Q(this,qt).call(this),await this.updateUsers(J),e()})}catch(O){this.taskQueue.setCondition("joinRoom",!0),this.reportLogs("join_room_error",O.message||O),_(`加入房间失败: ${O.message||O||"服务器繁忙"}`)}};k=this.taskQueue.addTask(n,["createWs","joinRoom"],{describe:"joinRoom",strict:!0})})));Z(this,"quitRoom",()=>new Promise(async a=>{const{roomId:E,userId:_}=this.options,k={roomId:E,user:{id:_}};try{this.isInRoom=!1,await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(e){this.reportLogs("quit_room_error",e.message||e)}await new Promise(e=>setTimeout(()=>e(!0),300)),this.taskQueue.setCondition("closeTrack",!0),this.cwsIns.sendMessage({event:"quitRoom",data:k}),a(!0)}));Z(this,"quitRoomEx",()=>new Promise(async a=>{const{roomId:E,userId:_}=this.options,k={roomId:E,user:{id:_}};try{this.isInRoom=!1,await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(e){this.reportLogs("quit_room_error",e.message||e)}await new Promise(e=>setTimeout(()=>e(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:k}),a(!0)}));Z(this,"syncRoomInfo",()=>new Promise((a,E)=>{const _=async()=>{const{userId:k}=this.options,e=await this.getUser(k),{id:n=k,callAction:O=0}=e;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:n,callAction:O}}}).then(async $=>{if($.code!==200)return E($.desc);const N=$.data.users;this.clearUsers(),await this.updateUsers(N),await this.updateUsertracks(e.id,e.tracks,!1),await this.subscribe();{const D=await this.getUsers();a(D)}}).catch($=>E($))};this.taskQueue.addTask(_,["createWs"],{describe:"syncRoomInfo"})}));Z(this,"publish",a=>new Promise(async(E,_)=>{const k=async()=>{try{const e=await this.getCaller();try{await this.setLocalStream(a,!0)}catch(q){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",q)}const n=[];for(const q of a){{const P=this.getPhoneyStreams(q);await this.initUserMediaStreamContext(e.id,q,P)}{const P=this.getLocalStream(q);if(P){const j=this.getUserMediaStreamContext(e.id,q);j==null||j.replaceStream(P)}else n.push(q)}}const O=a.filter(q=>!n.includes(q)||["microphoneCamera_audio","microphoneCamera_video"].includes(q));await this.replaceSenderStream(a,!1),await Q(this,Dt).call(this,O);const $=await this.getSenderTracks(O),N=[...e.tracks,...$];await this.updateUsertracks(e.id,N,!0);const D=await this.getCallAction(N);await Q(this,xt).call(this,D),n.length!==0&&await this.inactiveTracks(n,!1),O.length!==0&&await this.replaceSenderStream(O,!0),Q(this,Qt).call(this,a);{await this.emitNotifyUpdateUsers();const q=await this.getCaller();E(q)}}catch(e){this.reportLogs("publish_error",e.message||e),_(`publish is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","joinRoom","createTrack","subscribe"],{describe:"replaceSenderStream"})}));Z(this,"stopPublish",(a=[])=>new Promise((E,_)=>{const k=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getCaller();a.length===0&&(a=mediaType_keys);const n=e.tracks.filter(({mediaType:$})=>$&&a.includes($)),O=async()=>{this.taskQueue.setCondition("closeTrack",!0);const $=await this.getCaller();await this.emitNotifyUpdateUsers(),E($)};if(n.length===0)return O();await this.replaceSenderStream(a,!0),await this.closeUserTracks(e.id,n,!0),await this.removeSenders(a);{const $=await this.getCallAction(e.tracks);await Q(this,xt).call(this,$)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:n}}).then(async $=>{const{remoteSdp:N}=$.data;await this.setRemoteDescription({type:"answer",sdp:N})}),O()}catch(e){this.taskQueue.setCondition("closeTrack",!0),this.reportLogs("close_track_error",e.message||e),_(`stop publish is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","createTrack","subscribe"],{describe:"stopPublish"})}));Z(this,"subscribe",(a=[],E=3)=>new Promise((_,k)=>{const e=async()=>{try{this.taskQueue.setCondition("subscribe",!1);const n=await this.getUsers();let O=[];for(const q of n){const{isSelf:P,tracks:j=[]}=q;if(!P){const V=j.filter(({trackName:J,mid:z=""})=>z!==""&&(a.includes(J)||a.length===0));V.length!==0&&O.push({...q,tracks:V})}}const $=async()=>{const q=Array.from(O,({id:j})=>j),P=await this.getUsers(q);await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("subscribe",!0),_(P)};if(O.length===0)return $();const N=[];for(const q of O){const{id:P,tracks:j}=q,V=ft(j,["type","trackName"]),J={id:P,tracks:V};N.push(J)}const D=async()=>{this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: surplus subscribe count is ${E}`),await this.cwsIns.sendMessage({event:"subscribe",data:{users:N}}).then(async q=>{const{code:P=0,data:j,desc:V}=q;if(P!==200){if(E>0)return await new Promise(Y=>setTimeout(()=>Y(!0),300)),E=E-1,D();throw this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: subscribe is error. count 0",{trackNames:a}),new Error(V)}const{remoteSdp:J,users:z=[]}=j;this.onSubscribeUserTracks(z).then(async()=>{await this.renegotiate(),$()}),await this.setRemoteDescription({type:"offer",sdp:J})})};await D()}catch(n){this.taskQueue.setCondition("subscribe",!0),this.reportLogs("subscribe_error",n.message||n),k(`subscribe is error: ${n.message||n}`)}};this.taskQueue.addTask(e,["createWs","createSession","ice","createTrack","closeTrack"],{describe:"subscribe"})}));Z(this,"renegotiate",()=>new Promise(async(a,E)=>{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(_=>{if(_.code!==200)return E("协商流错误");a(!0)}).catch(_=>{console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe:error",_),E(`协商流错误: ${_.message||_}`)})}));Z(this,"stopSubscribe",(a=[])=>new Promise((E,_)=>{const k=async()=>{try{this.taskQueue.setCondition("closeTrack",!1);const e=await this.getUsers(),n=[];for(const $ of e){const{tracks:N=[]}=$;for(const D of N){const{type:q,mid:P,trackName:j,mediaType:V,msid:J}=D;if(!(!V||!J)&&(a.length===0||a.includes(j))){const z={type:q,mid:P,trackName:J};n.push(z),await this.closeUserTracks($.id,[D])}}}const O=async()=>{await this.emitNotifyUpdateUsers(),this.taskQueue.setCondition("closeTrack",!0),E(!0)};if(n.length===0)return O();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:n}}).then(async $=>{const{remoteSdp:N}=$.data;await this.setRemoteDescription({type:"answer",sdp:N})}),O()}catch(e){this.taskQueue.setCondition("closeTrack",!0),this.reportLogs("close_track_error",e.message||e),_(`stop subscribe is error: ${e.message||e}`)}};this.taskQueue.addTask(k,["createWs","createSession","ice","createTrack","subscribe"],{describe:"closeTrack"})}));Z(this,"inactiveTracks",async(a,E)=>new Promise(async _=>{const k=await this.getCaller();if(!k||!k.id)return _(!0);const{tracks:e=[]}=k,n=[...e];for(let $ of n){const{mediaType:N}=$;if(N&&a.includes(N)){$.enabled=E;const D=this.getLocalStream(N);if(!D)continue;const q=D.getTracks();for(const P of q)P.enabled=E}}const O=await this.getCallAction(n);await Q(this,xt).call(this,O),await this.replaceSenderStream(a,E),await this.emitNotifyUpdateUsers(),_(!0)}));Z(this,"debugger",()=>new Promise(async(a,E)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async _=>{if(_.code!==200)return E(_.desc);a(!0)}).catch(_=>{E(_)})}))}}Qt=new WeakMap,xt=new WeakMap,At=new WeakMap,qt=new WeakMap,Dt=new WeakMap;class Room extends RoomCalls{constructor(I){super(I)}}class QuickVO extends Room{constructor(a){super(a);ut(this,Tt,new Map);ut(this,Vt,()=>{{const a=async E=>{const{qualities:_=[]}=E.data,[k]=_;if(!(k&&k.userId===this.options.userId&&_.length===1)){for(const e of _){const{userId:n,egress:O,ingress:$}=e;this.checkUserInRoom(n)&&await this.updateUserNetwork(n,{egress:O,ingress:$})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:a},!0)}{const a=async E=>{const _=E.data.user;await this.updateUsers([_]),await this.updateUsertracks(_.id,_.track,!1),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:a},!0)}{const a=async E=>{await this.removeUsers([E.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:a},!0)}{const a=async E=>{const{user:_}=E.data,{id:k,tracks:e=[],callAction:n=0}=_;await this.updateUserCallAction(k,n),await this.updateUserPermissions(k,3);const O=[];{const{tracks:$}=await this.getUser(k);for(const N of e){const{mid:D,trackName:q}=N;if($.find(j=>j.mid===D&&j.trackName===q))continue;O.push(N)}}if(O.length!==0)if(await this.updateUsertracks(k,O,!0),this.options.newPublishAutoSubscribe){const $=this.getTrackNamesFormTracks(O);await this.subscribe($)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:a},!0)}{const a=async E=>{const{id:_,tracks:k}=E.data.user;_!==this.options.userId&&(await this.closeUserTracks(_,k,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:a},!0)}{const a=async E=>{const{id:_,callAction:k}=E.data.user;this.checkUserInRoom(_)&&(await this.updateUserCallAction(_,k),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:a},!0)}{const a=async E=>{const{user:_}=E.data,{id:k,permissions:e=1}=_;e===1?await this.removeUsers([k]):e===3&&await this.updateUsers([_]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:a},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async a=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});Z(this,"addNotify",a=>this.cwsIns.addNotify(a));ut(this,Yt,()=>{});ut(this,Xt,()=>{this.cwsIns.onReconnectSuccess=async()=>{await this.syncRoomInfo()}});ut(this,te,async()=>{});Z(this,"addRequestAnimationFrame",async(a,E)=>{{const k=Q(this,Tt).get(a);k&&cancelAnimationFrame(k)}const _=(k=Date.now())=>{E(k);const e=requestAnimationFrame(_);Q(this,Tt).set(a,e)};_()});Z(this,"clearRequestAnimationFrame",async(a=[])=>{a.length===0&&(a=[...Q(this,Tt).keys()]);const E=[];for(const _ of a){const k=Q(this,Tt).get(_);k&&(cancelAnimationFrame(k),E.push(k))}return E});Z(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.stopLocalStreams(),await new Promise(a=>setTimeout(()=>a(!0),300)),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.close()});Q(this,Yt).call(this),Q(this,Xt).call(this),Q(this,te).call(this),Q(this,Vt).call(this)}}Tt=new WeakMap,Vt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap,te=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|