quickvo-player 0.0.5 → 0.0.7
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/QuickVoPlayer.d.ts +5 -1
- package/dist/index.js +1441 -1276
- package/dist/index.umd.cjs +4 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,71 +1,84 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var Z = Object.defineProperty;
|
|
2
|
+
var X = (h) => {
|
|
3
|
+
throw TypeError(h);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
const L = '(function(){"use strict";const U=new TextDecoder("utf-8"),H=(e,s)=>{const a=e.getUint8(s),t=a>>7&1,n=a>>5&3,r=a&31;return{forbidden_zero_bit:t,nal_ref_idc:n,nal_unit_type:r}},b=(e,s)=>e.getUint8(s),P=(e,s,a)=>{const t=new Uint8Array(e.buffer.slice(s,s+a));return U?.decode(t)||""},T=(e,s,a)=>{let t=s,n,r=0;switch(a){case 0:n=e.getFloat64(t,!1),r=8;break;case 1:n=!!e.getUint8(t),r=1;break;case 2:{n="";const o=e.getUint16(t,!1);t=t+2;const c=new Int8Array(e.buffer,t,o).filter(d=>d!==0);n=(U?.decode(c)||"").trim(),r=2+o}break;case 3:for(n={};t<e.byteLength;){const o=e.getUint16(t,!1);if(o===0)break;t=t+2;const c=P(e,t,o);t=t+o;const g=b(e,t);if(g===6)break;t=t+1;const d=T(e,t,g);t=t+d.length,n[c]=d.value,r=2+o+1+d.length}break;case 8:{n={};const o=e.getUint32(t,!1);t=t+4;for(let c=0;c<o;c++){const g=e.getUint16(t,!1);t=t+2;const d=P(e,t,g);t=t+g;const h=b(e,t);t=t+1;const l=T(e,t,h);t=t+l.length,n[d]=l.value,r=2+g+1+l.length}}break;case 10:{n=[];const o=e.getUint32(t,!1);t=t+4;for(let c=0;c<o;c++){const g=b(e,t);t=t+1;const d=T(e,t,g);t=t+d.length,n.push(d.value),r=1+d.length}}break}return{amfType:a,length:r,value:n}},m=(e,s)=>e.getUint8(s)<<16|e.getUint8(s+1)<<8|e.getUint8(s+2);var u={header:{getSignature:e=>{const s=new Int8Array(e.buffer.slice(0,3));return U?.decode(s)||""},getVersion:e=>e.getUint8(3),getFlags:e=>{const a=e.getUint8(0).toString(2).padStart(5,"0").split(""),[,,t,,n]=a;return{audio:n==="1",video:t==="1"}},getDataOffset:e=>e.getUint32(5)},getPreviousTagSize:(e,s)=>e.getUint32(s),isSurplusTag:(e,s)=>{let a=!0;const t=e.byteLength;if(s+4>t)a=!1;else if(s+4+11>t)a=!1;else{const n=m(e,s+4+1);s+4+11+n>t&&(a=!1)}return a},tag:{tagHeader:{getTagType:(e,s)=>{const a=e.getUint8(s);let t;switch(a){case 18:t="script";break;case 8:t="audio";break;case 9:t="video";break}return t},getDataSize:(e,s)=>m(e,s+1),getTimestamp:(e,s)=>m(e,s+4),getTimestampExtended:(e,s)=>e.getUint8(s+7),getStreamID:(e,s)=>m(e,s+8)},tagBody:{parseAudio:(e,s,a)=>{let t=s;const n=e.getUint8(t),r=n>>4&15,i=n>>2&3,o=n>>1&1,c=n&1;t=t+1;const g=e.getUint8(t);t=t+1;const d=a-2,h=new Uint8Array(e.buffer.slice(t,t+d));if(r===10&&g===0){const l=e.getUint8(t),p=e.getUint8(t+1),f=(l&248)>>3,y=(l&7)<<1|p>>7,S=(p&120)>>3,A=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],D=`mp4a.40.${f}`,z=A[y];return{soundFormat:r,soundRate:i,soundSize:o,soundType:c,accPacketType:g,data:h,audioObjectType:f,samplingFrequencyIndex:y,channelConfiguration:S,codec:D,sampleRate:z}}return{soundFormat:r,soundRate:i,soundSize:o,soundType:c,accPacketType:g,data:h}},parseVideo:(e,s,a)=>{let t=s;const n=e.getUint8(t),r=n>>4&15,i=n&15;t=t+1;const o=e.getUint8(t);t=t+1;const c=m(e,t);t=t+3;const g=a-5,d=new Uint8Array(e.buffer.slice(t,t+g));switch(i){case 7:if(o===0){const h=e.getUint8(t);if(t=t+1,h!==1)throw new Error("Invalid AVC version");const l=e.getUint8(t)&255;t=t+1;const p=e.getUint8(t)&255;t=t+1;const f=e.getUint8(t)&255;t=t+1;const A=`avc1.${Array.from([l,p,f],E=>E.toString(16).padStart(2,"0")).join("")}`,D=(e.getUint8(t)&3)-1;t=t+1;const z=e.getUint8(t)&31;t=t+1;const _=e.getUint16(t,!1);t=t+2;const O=new Uint8Array(e.buffer.slice(t,t+_));t=t+_;const I=e.getUint8(t)&31;t=t+1;const x=e.getUint16(t,!1);t=t+2;const M=new Uint8Array(e.buffer.slice(t,t+x));return t=t+x,{frameType:r,codecID:i,avcPacketType:o,cts:c,data:d,version:h,codec:A,profile:l,compatibility:p,level:f,lengthSizeMinusOne:D,numOfSequenceParameterSets:z,sequenceParameterSetLength:_,sps:O,numOfPictureParameterSets:I,pictureParameterSetLength:x,pps:M}}else if(o===1){const h=[],l=t+a-5;for(;t+4<l;){const p=e.getUint32(t,!1);t=t+4;const f=H(e,t);t=t+1;const y=p-1,S=new Uint8Array(e.buffer.slice(t,t+y));t=t+y,h.push({size:p,header:f,payload:S})}return{frameType:r,codecID:i,avcPacketType:o,cts:c,data:d,nalus:h}}break;default:throw new Error("Unsupported codecID")}return{frameType:r,codecID:i,avcPacketType:o,cts:c,data:d}},parseMetaData:(e,s)=>{let a=s;{if(e.getUint8(a)!==2)throw new Error("Invalid AMF type for onMetaData (expected 0x02)");a=a+1}const t=e.getUint16(a,!1);a=a+2;{const i=new Int8Array(e.buffer.slice(a,a+t));if((U?.decode(i)||"")!=="onMetaData")throw new Error("Expected \'onMetaData\' string");a=a+t}const n=b(e,a);return a=a+1,T(e,a,n).value}}}};class L{parseSpeed=8;pendingPayloads=[];payload=new Uint8Array(0);offset=0;is_parsing=!1;header;tag;on={};constructor(){}init=()=>{this.destroy()};push=s=>{this.pendingPayloads.push(s),this.is_parsing||this.parse()};destroy=()=>{this.pendingPayloads=[],this.payload=new Uint8Array(0),this.offset=0,this.is_parsing=!1,this.header=void 0,this.tag=void 0};parse=async()=>{for(this.is_parsing=!0;;){const s=this.pendingPayloads.shift();if(!s)break;const a=new Uint8Array(this.payload.byteLength+s.byteLength);a.set(this.payload,0),a.set(s,this.payload.byteLength),this.payload=a;const t=new DataView(this.payload.buffer);this.header||this.parseHeader(t),await this.parseTag(t)}this.is_parsing=!1};parseHeader=s=>(this.header={signature:u.header.getSignature(s),version:u.header.getVersion(s),flags:u.header.getFlags(s),dataOffset:u.header.getDataOffset(s)},this.offset=this.header?.dataOffset,this.on.header&&this.on.header(this.header),this.header);parseTag=async s=>{const a=(n,r)=>({tagType:u.tag.tagHeader.getTagType(n,r),dataSize:u.tag.tagHeader.getDataSize(n,r),timestamp:u.tag.tagHeader.getTimestamp(n,r),timestampExtended:u.tag.tagHeader.getTimestampExtended(n,r),streamID:u.tag.tagHeader.getStreamID(n,r)}),t=(n,r,i,o)=>{let c;switch(n){case"script":c=u.tag.tagBody.parseMetaData(r,i);break;case"audio":c=u.tag.tagBody.parseAudio(r,i,o);break;case"video":c=u.tag.tagBody.parseVideo(r,i,o);break}return c};for(;this.offset<s.byteLength;){if(u.isSurplusTag(s,this.offset)===!1){this.payload=this.payload.slice(this.offset),this.offset=0;break}const r=a(s,this.offset+4),{tagType:i,dataSize:o}=r;if(!i)break;const c=t(i,s,this.offset+4+11,o);this.tag={header:r,body:c},this.on.tag&&this.on.tag(this.tag),this.offset=this.offset+4+11+o,await new Promise(g=>setTimeout(()=>g(!0),this.parseSpeed))}}}const k=new L;k.on.header=e=>postMessage({action:"onHeader",data:e}),k.on.tag=e=>postMessage({action:"onTag",data:e}),onmessage=e=>{const{action:s,data:a}=e.data,t=k[s];t&&t(a)}})();\n', A = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", L], { type: "text/javascript;charset=utf-8" });
|
|
9
|
-
function
|
|
5
|
+
var tt = (h, o, a) => o in h ? Z(h, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : h[o] = a;
|
|
6
|
+
var m = (h, o, a) => tt(h, typeof o != "symbol" ? o + "" : o, a), Q = (h, o, a) => o.has(h) || X("Cannot " + a);
|
|
7
|
+
var I = (h, o, a) => (Q(h, o, "read from private field"), a ? a.call(h) : o.get(h)), J = (h, o, a) => o.has(h) ? X("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(h) : o.set(h, a), K = (h, o, a, u) => (Q(h, o, "write to private field"), u ? u.call(h, a) : o.set(h, a), a);
|
|
8
|
+
const D = '(function(){"use strict";class P{pendingPayloads=[];payload=new Uint8Array(0);chunks=[];push=t=>{this.pendingPayloads.push(t)};next=(t=0)=>{this.payload=this.payload.slice(t);const s=this.pendingPayloads.shift();if(!s)return!1;const e=new Uint8Array(this.payload.byteLength+s.byteLength);return e.set(this.payload,0),e.set(s,this.payload.byteLength),this.payload=e,new DataView(this.payload.buffer)};pushChunk=t=>{this.chunks.push(t),this.chunks.length>1e3&&this.chunks.shift()};destroy=()=>{this.pendingPayloads=[],this.payload=new Uint8Array(0),this.chunks=[]}}const I=(y,t)=>{const s=new Uint8Array(y),e=new Uint8Array(t),n=new Uint8Array(11+s.length+e.length);let a=0;return n[a++]=1,n[a++]=s[1],n[a++]=s[2],n[a++]=s[3],n[a++]=255,n[a++]=225,n[a++]=s.length>>8&255,n[a++]=s.length&255,n.set(s,a),a+=s.length,n[a++]=1,n[a++]=e.length>>8&255,n[a++]=e.length&255,n.set(e,a),n},T=y=>{let t=0;const s=new DataView(y.buffer),e=s.getUint8(t);if(t=t+1,e!==1)throw new Error("Invalid AVC version");const n=s.getUint8(t)&255;t=t+1;const a=s.getUint8(t)&255;t=t+1;const o=s.getUint8(t)&255;t=t+1;const c=`avc1.${Array.from([n,a,o],U=>U.toString(16).padStart(2,"0")).join("")}`,r=(s.getUint8(t)&3)-1;t=t+1;const g=s.getUint8(t)&31;t=t+1;const p=s.getUint16(t,!1);t=t+2;const h=new Uint8Array(s.buffer.slice(t,t+p));t=t+p;const d=s.getUint8(t)&31;t=t+1;const u=s.getUint16(t,!1);t=t+2;const f=new Uint8Array(s.buffer.slice(t,t+u));return t=t+u,{version:e,codec:c,profile:n,compatibility:a,level:o,lengthSizeMinusOne:r,numOfSequenceParameterSets:g,sequenceParameterSetLength:p,sps:h,numOfPictureParameterSets:d,pictureParameterSetLength:u,pps:f}},M=y=>{const t=new Uint8Array(4+y.length);return new DataView(t.buffer).setUint32(0,y.length,!1),t.set(y,4),t},C=y=>{let t=0;for(const n of y)t+=n.length;const s=new Uint8Array(t);let e=0;for(const n of y){const a=n;s.set(a,e),e+=a.length}return s},D=y=>{let t="unknown";switch(y){case 1:case 2:case 27:case 36:t="video";break;case 3:case 4:case 15:t="audio";break;case 6:t="subtitle";break;case 134:t="ad";break}return t};class x{pat;pmt;audioConfig;videoConfig;payloadMap=new Map;on={};constructor(){}parse=async t=>{let s=0;for(;!(s+188>t.byteLength);){if(t.getInt8(s)!=71){s++;continue}await this.parsePacket(t,s),s+=188}return s};parsePacket=async(t,s)=>{if(s+188>t.byteLength)throw new Error("Invalid TS packet");if(t.getUint8(s)!==71)throw new Error("Invalid TS packet");let e=s;const n=this.parseHeader(t,e);e+=4;const{transport_error_indicator:a,pid:o,payload_unit_start_indicator:l,adaptation_field_control:i}=n;if(a===1||o===void 0)return;let c=184;if(i===2||i===3){const r=t.getUint8(e);e+=1,this.parseAdaptationField(t,e),e+=r,c-=r}if(i===3&&(c-=1),i===1||i===3){const r=new Uint8Array(t.buffer.slice(e,e+c));if(o===0)return this.parsePAT(t,e);{const{programs:h=[]}=this.pat||{};if(h.find(u=>u.pmt_pid===o))return this.parsePMT(t,e)}const{streams:g=[]}=this.pmt||{},p=g.find(h=>h.elementary_pid===o);if(p){if(l===1){const h=this.payloadMap.get(o);if(h){switch(p.kind){case"audio":{const d=await this.parseAudio(h);this.on.chunk&&this.on.chunk(d)}break;case"video":{const d=await this.parseVideo(h);this.on.chunk&&this.on.chunk(d),await new Promise(u=>setTimeout(()=>u(!0),8))}break}this.payloadMap.delete(o)}}{this.payloadMap.has(o)||this.payloadMap.set(o,new Uint8Array);const h=this.payloadMap.get(o),d=new Uint8Array(h.byteLength+r.byteLength);d.set(h,0),d.set(r,h.byteLength),this.payloadMap.set(o,d)}}}};parseHeader=(t,s)=>{let e=s;const n=t.getUint8(e),a=t.getUint8(e+1),o=t.getUint8(e+2),l=t.getUint8(e+3),i=(a&128)>>7;if(i===1)return{sync_byte:n,transport_error_indicator:i};const c=(a&64)>>6,r=(a&32)>>5,g=(a&31)<<8|o,p=(l&192)>>6,h=l>>4&3,d=l&15;return{sync_byte:n,transport_error_indicator:i,payload_unit_start_indicator:c,transport_priority:r,pid:g,transport_scrambling_control:p,adaptation_field_control:h,continuity_counter:d}};parsePAT=(t,s)=>{let e=s,n;{const l=t.getUint8(e);e+=1;const i=t.getUint8(e);if(e+=1,i!==0)throw new Error("Invalid PAT table_id");const c=t.getUint16(e)&4095;e+=2;const r=t.getUint16(e);e+=2;const g=(t.getUint8(e)&62)>>1,p=t.getUint8(e)&1;e+=1;const h=t.getUint8(e);e+=1;const d=t.getUint8(e);e+=1,n={pointer_field:l,table_id:i,section_length:c,transport_stream_id:r,version_number:g,current_next_indicator:p,section_number:h,last_section_number:d}}const a=[];{const l=n.section_length-5-4,i=e+l;for(;e<i;){const c=t.getUint16(e),r=t.getUint16(e+2)&8191;e+=4,c!==0&&r>=32&&r<=8190&&a.push({program_number:c,pmt_pid:r})}}const o=t.getUint32(e);this.pat={header:n,programs:a,crc32:o},this.on.debug&&this.on.debug({pat:this.pat})};parsePMT=(t,s)=>{let e=s,n;{const l=t.getUint8(e);e+=1;const i=t.getUint8(e);if(e+=1,i!==2)throw new Error("Invalid PMT table_id");const c=t.getUint16(e)&4095;e+=2;const r=t.getUint16(e);e+=2;const g=(t.getUint8(e)&62)>>1,p=t.getUint8(e)&1;e+=1;const h=t.getUint8(e);e+=1;const d=t.getUint8(e);e+=1;const u=t.getUint16(e)&8191;e+=2;const f=t.getUint16(e)&4095;e+=2,n={pointer_field:l,table_id:i,section_length:c,transport_stream_id:r,version_number:g,current_next_indicator:p,section_number:h,last_section_number:d,pcr_pid:u,program_info_length:f}}const a=[];{const l=n.section_length-9-4,i=e+l;for(;e<i;){const c=t.getUint8(e),r=D(c),g=t.getUint16(e+1)&8191,p=t.getUint16(e+3)&4095;if(e+=5,g<32||g>8190){console.warn(`Invalid elementary_pid: 0x${g.toString(16)}`);continue}a.push({kind:r,stream_type:c,elementary_pid:g,es_info_length:p})}}const o=t.getUint32(e);this.pmt={header:n,streams:a,crc32:o},this.on.debug&&this.on.debug({pmt:this.pmt})};parseAdaptationField=(t,s)=>{let e=s,n,a,o,l;const i=t.getUint8(e),c=!!(i&128),r=!!(i&64),g=!!(i&32),p=!!(i&16),h=!!(i&8),d=!!(i&4),u=!!(i&2),f=!!(i&1);e+=1;const U=(_,m)=>{let b=BigInt(0);b|=BigInt(_.getUint16(m))<<25n,b|=BigInt(_.getUint16(m+1))<<17n,b|=BigInt(_.getUint16(m+2))<<9n,b|=BigInt(_.getUint16(m+3))<<1n,b|=BigInt(_.getUint16(m+4)>>7);const S=(_.getUint16(m+4)&1)<<8|_.getUint16(m+5);return b=b*300n+BigInt(S),b};if(p&&(n=U(t,e),e+=6),h&&(a=U(t,e),e+=6),d&&(o=t.getInt8(e),e+=1),u){const _=t.getUint8(e);e+=1,l=new Uint8Array(t.buffer,e,_),e+=_}return{discontinuity_indicator:c,random_access_indicator:r,elementary_stream_priority_indicator:g,pcr_flag:p,opcr_flag:h,splicing_point_flag:d,transport_private_data_flag:u,adaptation_field_extension_flag:f,pcr:n,opcr:a,splice_countdown:o,transport_private_data:l}};parseAudio=async t=>{const s=new DataView(t.buffer);let e=0,n,a;{const o=s.getUint8(e)===0&&s.getUint8(e+1)===0&&s.getUint8(e+2)===1;if(e+=3,!o)throw new Error("invalid ts audio payload.");const l=s.getUint8(e);e+=1;const i=s.getUint8(e)<<8|s.getUint8(e+1);e+=2;let c,r,g,p,h;{const f=s.getUint8(e);e+=1,c=f>>4&3,r=(f>>3&1)===1,g=(f>>2&1)===1,p=(f>>1&1)===1,h=(f&1)===1}let d,u;{const f=s.getUint8(e);e+=1;const U=f>>6,_=s.getUint8(e);e+=1,(U&2)===2&&(d=this.parsePtsDts(s,e)),(U&1)===1?u=this.parsePtsDts(s,e+5):u=d,e+=_}n={stream_id:l,pes_packet_length:i,scrambling_control:c,priority:r,data_alignment:g,copyright:p,original_copy:h,pts:d,dts:u}}a=t.slice(e);{if(!this.audioConfig){const r=s.getUint8(e);if(e+=1,r===255){const g=s.getUint8(e),p=s.getUint8(e+1),h=p>>2&3,d=(g&248)>>3&3,u=p>>6&3,U=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][h],_=`mp4a.40.${d}`,m=u===3?1:2;this.audioConfig={kind:"audio",codec:_,sampleRate:U,numberOfChannels:m},this.on.config&&this.on.config(this.audioConfig)}}const{dts:o=0,pts:l=0}=n,i=l-o,c=a.slice(7);return{kind:"audio",type:"key",dts:o,pts:l,cts:i,data:c,pes_payload:a}}};parseVideo=async t=>{const s=new DataView(t.buffer);let e=0,n,a;{const o=s.getUint8(e)===0&&s.getUint8(e+1)===0&&s.getUint8(e+2)===1;if(e+=3,!o)throw new Error("invalid ts video payload.");const l=s.getUint8(e);e+=1;const i=s.getUint8(e)<<8|s.getUint8(e+1);e+=2;let c,r,g,p,h;{const f=s.getUint8(e);e+=1,c=f>>4&3,r=(f>>3&1)===1,g=(f>>2&1)===1,p=(f>>1&1)===1,h=(f&1)===1}let d,u;{const f=s.getUint8(e);e+=1;const U=f>>6,_=s.getUint8(e);e+=1,(U&2)===2&&(d=this.parsePtsDts(s,e)),(U&1)===1?u=this.parsePtsDts(s,e+5):u=d,e+=_}n={stream_id:l,pes_packet_length:i,scrambling_control:c,priority:r,data_alignment:g,copyright:p,original_copy:h,pts:d,dts:u}}a=t.slice(e);{const o=this.getNalus(a);if(!this.videoConfig){let h,d;if(h=o.find(f=>f.type===7)?.nalu.slice(4),d=o.find(f=>f.type===8)?.nalu.slice(4),h&&d){const u=I(h,d),{codec:f}=T(u);this.videoConfig={kind:"video",codec:f,description:u,sps:h,pps:d},this.on.config&&this.on.config(this.videoConfig)}}const l=[];let i="delta";for(const h of o){const{type:d,nalu:u}=h;switch(d){case 6:case 9:l.push(u);break;case 1:i="delta",l.push(u);break;case 5:i="key",l.push(u);break}}const c=C(l),{dts:r=0,pts:g=0}=n,p=g-r;return{kind:"video",type:i,dts:r,pts:g,cts:p,data:c,nalus:l}}};parsePtsDts(t,s){const e=t.getUint8(s),n=t.getUint8(s+1),a=t.getUint8(s+2),o=t.getUint8(s+3),l=t.getUint8(s+4),i=(BigInt(e)&0b00001110n)<<29n|(BigInt(n)&0b11111111n)<<22n|(BigInt(a)&0b11111110n)<<14n|(BigInt(o)&0b11111111n)<<7n|(BigInt(l)&0b11111110n)>>1n;return Number(i)/90}getNalus=t=>{const s=[];let e=0;for(;!(e+4>t.byteLength);){if(t[e]!==0||t[e+1]!==0||t[e+2]!==1){e+=1;continue}e+=3;let n=e;const a=t[e]&31;for(e+=1;!(e+1>t.byteLength);){if(t[e]!==0||t[e+1]!==0||t[e+2]!==1){e+=1;continue}break}let o=e-n;if(t[e-1]===0&&(o-=1),o!==0){const l=t.slice(n,n+o),i=M(l);s.push({type:a,nalu:i})}}return s}}const k=(y,t)=>y.getUint8(t)<<16|y.getUint8(t+1)<<8|y.getUint8(t+2);class O{audioConfig;videoConfig;header;textDecoder=new TextDecoder("utf-8");on={};constructor(){}parse=async t=>{let s=0;for(this.header||(this.parseHeader(t,s),s+=9);this.isSurplusTag(t,s)!==!1;){const n=this.parseTagHeader(t,s+4),{tagType:a,dataSize:o,timestamp:l}=n;if(a){const i=this.parseTagBody(a,t,s+4+11,o);switch(a){case"script":this.on.info&&this.on.info(i);break;case"audio":{const{accPacketType:c}=i;if(c===0){const{codec:r,sampleRate:g,channelConfiguration:p}=i;this.audioConfig={kind:"audio",codec:r,sampleRate:g,numberOfChannels:p},this.on.config&&this.on.config(this.audioConfig)}else{const{cts:r,data:g}=i,p="key",h=r===void 0?void 0:r+l;this.on.chunk&&this.on.chunk({kind:"audio",type:p,dts:l,pts:h,cts:r,data:g})}}break;case"video":{const{avcPacketType:c}=i;if(c===0){const{codec:r,sps:g,pps:p,data:h}=i;this.videoConfig={kind:"video",codec:r,description:h,sps:g,pps:p},this.on.config&&this.on.config(this.videoConfig)}else{const{frameType:r,cts:g,data:p,nalus:h}=i,d=r===1?"key":"delta",u=g===void 0?void 0:g+l;this.on.chunk&&this.on.chunk({kind:"video",type:d,dts:l,pts:u,cts:g,data:p,nalus:h})}}break}s=s+4+11+o}await new Promise(i=>setTimeout(()=>i(!0),8))}return s};parseHeader=(t,s)=>{let e,n,a,o;e=t.getUint8(s)<<16|t.getUint8(s+1)<<8|t.getUint8(s+2),n=t.getUint8(3);{const i=t.getUint8(0).toString(2).padStart(5,"0").split(""),[,,c,,r]=i;a={audio:r==="1",video:c==="1"}}o=t.getUint32(5),this.header={signature:e,version:n,flags:a,dataOffset:o}};isSurplusTag=(t,s)=>{let e=!0;const n=t.byteLength;if(s+4>n)e=!1;else if(s+4+11>n)e=!1;else{const a=k(t,s+4+1);s+4+11+a>n&&(e=!1)}return e};parseTagHeader=(t,s)=>{let e,n,a,o,l;{const i=t.getUint8(s);let c;switch(i){case 18:c="script";break;case 8:c="audio";break;case 9:c="video";break}e=c}return n=k(t,s+1),a=k(t,s+4),o=t.getUint8(s+7),l=k(t,s+8),{tagType:e,dataSize:n,timestamp:a,timestampExtended:o,streamID:l}};parseTagBody=(t,s,e,n)=>{let a;switch(t){case"script":a=this.parseMetaData(s,e);break;case"audio":a=this.parseAudio(s,e,n);break;case"video":a=this.parseVideo(s,e,n);break}return a};parseMetaData=(t,s)=>{let e=s;{if(t.getUint8(e)!==2)throw new Error("Invalid AMF type for onMetaData (expected 0x02)");e=e+1}const n=t.getUint16(e,!1);e=e+2;{const l=new Int8Array(t.buffer.slice(e,e+n));if((this.textDecoder?.decode(l)||"")!=="onMetaData")throw new Error("Expected \'onMetaData\' string");e=e+n}const a=this.getAmfType(t,e);return e=e+1,this.getAMFValue(t,e,a).value};parseAudio=(t,s,e)=>{let n=s;const a=t.getUint8(n),o=a>>4&15,l=a>>2&3,i=a>>1&1,c=a&1;n=n+1;const r=t.getUint8(n);n=n+1;const g=e-2,p=new Uint8Array(t.buffer.slice(n,n+g));if(o===10&&r===0){const h=t.getUint8(n),d=t.getUint8(n+1),u=(h&248)>>3,f=(h&7)<<1|d>>7,U=(d&120)>>3,_=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],m=`mp4a.40.${u}`,b=_[f];return{soundFormat:o,soundRate:l,soundSize:i,soundType:c,accPacketType:r,data:p,audioObjectType:u,samplingFrequencyIndex:f,channelConfiguration:U,codec:m,sampleRate:b}}return{soundFormat:o,soundRate:l,soundSize:i,soundType:c,accPacketType:r,data:p}};parseVideo=(t,s,e)=>{let n=s;const a=t.getUint8(n),o=a>>4&15,l=a&15;n=n+1;const i=t.getUint8(n);n=n+1;const c=k(t,n);n=n+3;const r=e-5,g=new Uint8Array(t.buffer.slice(n,n+r));switch(l){case 7:if(i===0){const p=T(g);return{frameType:o,codecID:l,avcPacketType:i,cts:c,data:g,...p}}else if(i===1){const p=[],h=n+e-5;for(;!(n+4>h);){const d=t.getUint32(n,!1),u=new Uint8Array(t.buffer.slice(n,n+4+d));n+=4+d,p.push(u)}return{frameType:o,codecID:l,avcPacketType:i,cts:c,data:g,nalus:p}}break;default:throw new Error("Unsupported codecID")}return{frameType:o,codecID:l,avcPacketType:i,cts:c,data:g}};getAmfType=(t,s)=>t.getUint8(s);getAMFName=(t,s,e)=>{const n=new Uint8Array(t.buffer.slice(s,s+e));return this.textDecoder?.decode(n)||""};getAMFValue=(t,s,e)=>{let n=s,a,o=0;switch(e){case 0:a=t.getFloat64(n,!1),o=8;break;case 1:a=!!t.getUint8(n),o=1;break;case 2:{a="";const i=t.getUint16(n,!1);n=n+2;const c=new Int8Array(t.buffer,n,i).filter(g=>g!==0);a=(this.textDecoder?.decode(c)||"").trim(),o=2+i}break;case 3:for(a={};n<t.byteLength;){const i=t.getUint16(n,!1);if(i===0)break;n=n+2;const c=this.getAMFName(t,n,i);n=n+i;const r=this.getAmfType(t,n);if(r===6)break;n=n+1;const g=this.getAMFValue(t,n,r);n=n+g.length,a[c]=g.value,o=2+i+1+g.length}break;case 8:{a={};const i=t.getUint32(n,!1);n=n+4;for(let c=0;c<i;c++){const r=t.getUint16(n,!1);n=n+2;const g=this.getAMFName(t,n,r);n=n+r;const p=this.getAmfType(t,n);n=n+1;const h=this.getAMFValue(t,n,p);n=n+h.length,a[g]=h.value,o=2+r+1+h.length}}break;case 10:{a=[];const i=t.getUint32(n,!1);n=n+4;for(let c=0;c<i;c++){const r=this.getAmfType(t,n);n=n+1;const g=this.getAMFValue(t,n,r);n=n+g.length,a.push(g.value),o=1+g.length}}break}return{amfType:e,length:o,value:a}}}class L{pattern;cacher=new P;isParseing=!1;offset=0;on={};parser;constructor(){}init=t=>{switch(this.destroy(),this.pattern=t,this.pattern){case"flv":this.parser=new O;break;case"hls":this.parser=new x;break;default:throw new Error("is error pattern.")}this.parser.on.debug=s=>this.on.debug&&this.on.debug(s),this.parser.on.info=s=>this.on.info&&this.on.info(s),this.parser.on.config=s=>this.on.config&&this.on.config(s),this.parser.on.chunk=s=>{this.cacher.pushChunk(s),this.on.chunk&&this.on.chunk(s)}};push=t=>{this.cacher.push(t),this.isParseing===!1&&this.parse()};destroy=()=>{this.cacher.destroy(),this.isParseing=!1,this.offset=0};parse=async()=>{try{if(this.isParseing=!0,!this.pattern)throw new Error("You need to set the pattern.");if(!this.parser)throw new Error("You need to init parser.");for(;;){const t=this.cacher.next(this.offset);if(this.offset=0,!t)break;this.offset=await this.parser.parse(t)}this.isParseing=!1}catch{this.destroy()}}}const A=new L;A.on.debug=y=>postMessage({action:"onDebug",data:y}),A.on.info=y=>postMessage({action:"onInfo",data:y}),A.on.config=y=>postMessage({action:"onConfig",data:y}),A.on.chunk=y=>postMessage({action:"onChunk",data:y}),onmessage=y=>{const{action:t,data:s}=y.data,e=A[t];e&&e(s)}})();\n', v = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", D], { type: "text/javascript;charset=utf-8" });
|
|
9
|
+
function B(h) {
|
|
10
10
|
let o;
|
|
11
11
|
try {
|
|
12
|
-
if (o =
|
|
13
|
-
const
|
|
14
|
-
name:
|
|
12
|
+
if (o = v && (self.URL || self.webkitURL).createObjectURL(v), !o) throw "";
|
|
13
|
+
const a = new Worker(o, {
|
|
14
|
+
name: h == null ? void 0 : h.name
|
|
15
15
|
});
|
|
16
|
-
return
|
|
16
|
+
return a.addEventListener("error", () => {
|
|
17
17
|
(self.URL || self.webkitURL).revokeObjectURL(o);
|
|
18
|
-
}),
|
|
18
|
+
}), a;
|
|
19
19
|
} catch {
|
|
20
20
|
return new Worker(
|
|
21
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
21
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(D),
|
|
22
22
|
{
|
|
23
|
-
name:
|
|
23
|
+
name: h == null ? void 0 : h.name
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
class
|
|
28
|
+
class L {
|
|
29
29
|
constructor() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
m(this, "worker", new B());
|
|
31
|
+
m(this, "on", {});
|
|
32
|
+
m(this, "init", (o) => this.worker.postMessage({ action: "init", data: o }));
|
|
33
|
+
m(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
|
|
34
|
+
m(this, "destroy", () => {
|
|
35
35
|
this.worker.postMessage({ action: "destroy", data: {} }), this.worker.terminate();
|
|
36
36
|
});
|
|
37
37
|
this.worker.onmessage = (o) => {
|
|
38
|
-
const { action:
|
|
39
|
-
|
|
38
|
+
const { action: a, data: u } = o.data;
|
|
39
|
+
switch (a) {
|
|
40
|
+
case "onInfo":
|
|
41
|
+
this.on.info && this.on.info(u);
|
|
42
|
+
break;
|
|
43
|
+
case "onConfig":
|
|
44
|
+
this.on.config && this.on.config(u);
|
|
45
|
+
break;
|
|
46
|
+
case "onDebug":
|
|
47
|
+
this.on.debug && this.on.debug(u);
|
|
48
|
+
break;
|
|
49
|
+
case "onChunk":
|
|
50
|
+
this.on.chunk && this.on.chunk(u);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
40
53
|
};
|
|
41
54
|
}
|
|
42
55
|
}
|
|
43
|
-
const
|
|
44
|
-
`,
|
|
45
|
-
function
|
|
56
|
+
const M = `(function(){"use strict";class r{audioDecoderConfig;audioDecoder;videoDecoderConfig;videoDecoder;hasKeyFrame=!1;on={audio:{},video:{}};constructor(){}audio={init:i=>{this.audio.destroy(),this.audioDecoderConfig={...i},this.audioDecoder=new AudioDecoder({output:e=>{this.on.audio.decode&&this.on.audio.decode(e)},error:e=>{this.on.audio.error&&this.on.audio.error(e)}}),this.audioDecoder.configure(this.audioDecoderConfig)},decode:i=>{if(!this.audioDecoder)return;const e=new EncodedAudioChunk(i);this.audioDecoder.decode(e)},flush:()=>{this.audioDecoder?.flush()},destroy:()=>{this.audioDecoderConfig=void 0,this.audioDecoder?.close(),this.audioDecoder=void 0}};video={init:i=>{this.video.destroy(),this.videoDecoderConfig={...i},this.videoDecoder=new VideoDecoder({output:async e=>{const d=await createImageBitmap(e),s=e.timestamp;e.close(),d.width>0&&d.height>0?this.on.video.decode&&this.on.video.decode({timestamp:s,bitmap:d}):d.close()},error:e=>{console.log("\\x1B[38;2;0;151;255m%c%s\\x1B[0m","color:#0097ff;","------->Breathe: e",e),this.on.video.error&&this.on.video.error(e)}}),this.videoDecoder.configure(this.videoDecoderConfig)},decode:i=>{if(this.videoDecoder&&(i.type==="key"&&(this.hasKeyFrame=!0),this.hasKeyFrame&&this.videoDecoder.decodeQueueSize<2)){const e=new EncodedVideoChunk(i);this.videoDecoder.decode(e)}},flush:()=>{this.videoDecoder?.flush()},destroy:()=>{this.videoDecoderConfig=void 0,this.videoDecoder?.close(),this.videoDecoder=void 0,this.hasKeyFrame=!1}}}const t=new r;t.on.audio.decode=o=>postMessage({type:"audio",action:"onDecode",data:o}),t.on.audio.error=o=>postMessage({type:"audio",action:"onError",data:o}),t.on.video.decode=o=>postMessage({type:"video",action:"onDecode",data:o}),t.on.video.error=o=>postMessage({type:"video",action:"onError",data:o}),onmessage=o=>{const{type:i,action:e,data:d}=o.data,s=t[i][e];s&&s(d)}})();
|
|
57
|
+
`, T = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", M], { type: "text/javascript;charset=utf-8" });
|
|
58
|
+
function F(h) {
|
|
46
59
|
let o;
|
|
47
60
|
try {
|
|
48
|
-
if (o =
|
|
49
|
-
const
|
|
50
|
-
name:
|
|
61
|
+
if (o = T && (self.URL || self.webkitURL).createObjectURL(T), !o) throw "";
|
|
62
|
+
const a = new Worker(o, {
|
|
63
|
+
name: h == null ? void 0 : h.name
|
|
51
64
|
});
|
|
52
|
-
return
|
|
65
|
+
return a.addEventListener("error", () => {
|
|
53
66
|
(self.URL || self.webkitURL).revokeObjectURL(o);
|
|
54
|
-
}),
|
|
67
|
+
}), a;
|
|
55
68
|
} catch {
|
|
56
69
|
return new Worker(
|
|
57
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
70
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(M),
|
|
58
71
|
{
|
|
59
|
-
name:
|
|
72
|
+
name: h == null ? void 0 : h.name
|
|
60
73
|
}
|
|
61
74
|
);
|
|
62
75
|
}
|
|
63
76
|
}
|
|
64
|
-
class
|
|
77
|
+
class N {
|
|
65
78
|
constructor() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
79
|
+
m(this, "worker", new F());
|
|
80
|
+
m(this, "on", { audio: {}, video: {} });
|
|
81
|
+
m(this, "audio", {
|
|
69
82
|
init: (o) => this.worker.postMessage({ type: "audio", action: "init", data: o }),
|
|
70
83
|
decode: (o) => this.worker.postMessage({ type: "audio", action: "decode", data: o }),
|
|
71
84
|
flush: () => this.worker.postMessage({ type: "audio", action: "flush" }),
|
|
@@ -73,7 +86,7 @@ class j {
|
|
|
73
86
|
this.worker.postMessage({ type: "audio", action: "destroy" });
|
|
74
87
|
}
|
|
75
88
|
});
|
|
76
|
-
|
|
89
|
+
m(this, "video", {
|
|
77
90
|
init: (o) => this.worker.postMessage({ type: "video", action: "init", data: o }),
|
|
78
91
|
decode: (o) => this.worker.postMessage({ type: "video", action: "decode", data: o }),
|
|
79
92
|
flush: () => this.worker.postMessage({ type: "video", action: "flush" }),
|
|
@@ -81,160 +94,125 @@ class j {
|
|
|
81
94
|
this.worker.postMessage({ type: "video", action: "destroy", data: {} });
|
|
82
95
|
}
|
|
83
96
|
});
|
|
84
|
-
|
|
97
|
+
m(this, "destroy", () => {
|
|
85
98
|
this.worker.postMessage({ type: "audio", action: "destroy" }), this.worker.postMessage({ type: "video", action: "destroy", data: {} }), this.worker.terminate();
|
|
86
99
|
});
|
|
87
100
|
this.worker.onmessage = (o) => {
|
|
88
|
-
const { type:
|
|
89
|
-
switch (
|
|
101
|
+
const { type: a, action: u, data: n } = o.data;
|
|
102
|
+
switch (a) {
|
|
90
103
|
case "audio":
|
|
91
|
-
|
|
104
|
+
u === "onDecode" && this.on.audio.decode && this.on.audio.decode(n), u === "onError" && this.on.audio.error && this.on.audio.error(n);
|
|
92
105
|
break;
|
|
93
106
|
case "video":
|
|
94
|
-
|
|
107
|
+
u === "onDecode" && this.on.video.decode && this.on.video.decode(n), u === "onError" && this.on.video.error && this.on.video.error(n);
|
|
95
108
|
break;
|
|
96
109
|
}
|
|
97
110
|
};
|
|
98
111
|
}
|
|
99
112
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
try {
|
|
105
|
-
if (o = M && (self.URL || self.webkitURL).createObjectURL(M), !o) throw "";
|
|
106
|
-
const u = new Worker(o, {
|
|
107
|
-
name: f == null ? void 0 : f.name
|
|
108
|
-
});
|
|
109
|
-
return u.addEventListener("error", () => {
|
|
110
|
-
(self.URL || self.webkitURL).revokeObjectURL(o);
|
|
111
|
-
}), u;
|
|
112
|
-
} catch {
|
|
113
|
-
return new Worker(
|
|
114
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(F),
|
|
115
|
-
{
|
|
116
|
-
name: f == null ? void 0 : f.name
|
|
117
|
-
}
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
class $ {
|
|
122
|
-
constructor() {
|
|
123
|
-
b(this, "worker", new H());
|
|
124
|
-
b(this, "init", ({ offscreenCanvas: o, baseTime: u = 0, writable: c }) => this.worker.postMessage({ action: "init", data: { offscreenCanvas: o, baseTime: u, writable: c } }, [o, c]));
|
|
125
|
-
b(this, "setShader", (o) => this.worker.postMessage({ action: "setShader", data: o }));
|
|
126
|
-
b(this, "setSize", ({ width: o, height: u }) => this.worker.postMessage({ action: "setSize", data: { width: o, height: u } }));
|
|
127
|
-
b(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
|
|
128
|
-
b(this, "setCut", async (o) => this.worker.postMessage({ action: "setCut", data: o }));
|
|
129
|
-
b(this, "setPause", (o) => this.worker.postMessage({ action: "setPause", data: o }));
|
|
130
|
-
b(this, "destroy", () => {
|
|
131
|
-
this.worker.postMessage({ action: "destroy", data: {} }), this.worker.terminate();
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
var q = Object.defineProperty, K = (f, o, u) => o in f ? q(f, o, { enumerable: !0, configurable: !0, writable: !0, value: u }) : f[o] = u, h = (f, o, u) => K(f, typeof o != "symbol" ? o + "" : o, u);
|
|
136
|
-
class Q {
|
|
137
|
-
constructor(o, u) {
|
|
138
|
-
h(this, "inputStream", new MediaStream()), h(this, "outputStream", new MediaStream()), h(this, "inputGain", 1), h(this, "enhanceGain", 1), h(this, "bgsGain", 1), h(this, "bgmGain", 1), h(this, "outputGain", 1), h(this, "mixAudioMap", /* @__PURE__ */ new Map()), h(this, "audioContext", new AudioContext()), h(this, "sourceNode"), h(this, "inputGainNode"), h(this, "enhanceGainNode"), h(this, "bgsGainNode"), h(this, "bgmGainNode"), h(this, "analyserNode"), h(this, "analyserArrayData"), h(this, "outputGainNode"), h(this, "destinationNode"), h(this, "filterStream", (c) => c), h(this, "stop", () => {
|
|
113
|
+
var E = Object.defineProperty, G = (h, o, a) => o in h ? E(h, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : h[o] = a, y = (h, o, a) => G(h, typeof o != "symbol" ? o + "" : o, a);
|
|
114
|
+
class O {
|
|
115
|
+
constructor(o, a) {
|
|
116
|
+
y(this, "inputStream", new MediaStream()), y(this, "outputStream", new MediaStream()), y(this, "inputGain", 1), y(this, "enhanceGain", 1), y(this, "bgsGain", 1), y(this, "bgmGain", 1), y(this, "outputGain", 1), y(this, "mixAudioMap", /* @__PURE__ */ new Map()), y(this, "audioContext", new AudioContext()), y(this, "sourceNode"), y(this, "inputGainNode"), y(this, "enhanceGainNode"), y(this, "bgsGainNode"), y(this, "bgmGainNode"), y(this, "analyserNode"), y(this, "analyserArrayData"), y(this, "outputGainNode"), y(this, "destinationNode"), y(this, "filterStream", (u) => u), y(this, "stop", () => {
|
|
139
117
|
{
|
|
140
|
-
const
|
|
141
|
-
for (const
|
|
142
|
-
|
|
118
|
+
const u = this.inputStream.getTracks();
|
|
119
|
+
for (const n of u)
|
|
120
|
+
n.stop(), this.inputStream.removeTrack(n);
|
|
143
121
|
}
|
|
144
|
-
}),
|
|
145
|
-
|
|
146
|
-
}),
|
|
147
|
-
this.inputGain =
|
|
148
|
-
}),
|
|
149
|
-
this.enhanceGain =
|
|
150
|
-
}),
|
|
151
|
-
this.bgsGain =
|
|
152
|
-
}),
|
|
153
|
-
this.bgmGain =
|
|
154
|
-
}),
|
|
155
|
-
this.outputGain =
|
|
156
|
-
}),
|
|
157
|
-
const { analyserNode:
|
|
158
|
-
|
|
159
|
-
let
|
|
160
|
-
for (let i = 0; i <
|
|
161
|
-
|
|
162
|
-
return Math.ceil(
|
|
163
|
-
}),
|
|
122
|
+
}), y(this, "getStream", () => this.filterStream(this.outputStream)), y(this, "setMute", (u = !0) => {
|
|
123
|
+
u ? this.analyserNode.disconnect(this.outputGainNode) : this.analyserNode.connect(this.outputGainNode);
|
|
124
|
+
}), y(this, "setInputGain", (u) => {
|
|
125
|
+
this.inputGain = u, this.inputGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
|
|
126
|
+
}), y(this, "setEnhanceGain", async (u) => {
|
|
127
|
+
this.enhanceGain = u + 1, this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain, this.audioContext.currentTime);
|
|
128
|
+
}), y(this, "setBgsGain", (u) => {
|
|
129
|
+
this.bgsGain = u, this.bgsGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
|
|
130
|
+
}), y(this, "setBgmGain", (u) => {
|
|
131
|
+
this.bgmGain = u, this.bgmGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
|
|
132
|
+
}), y(this, "setOutputGain", (u) => {
|
|
133
|
+
this.outputGain = u, this.outputGainNode.gain.setValueAtTime(this.outputGain, this.audioContext.currentTime);
|
|
134
|
+
}), y(this, "getVolume", () => {
|
|
135
|
+
const { analyserNode: u, analyserArrayData: n } = this;
|
|
136
|
+
u.getByteFrequencyData(n);
|
|
137
|
+
let r = 0;
|
|
138
|
+
for (let i = 0; i < n.length; i++)
|
|
139
|
+
r += n[i];
|
|
140
|
+
return Math.ceil(r / n.length);
|
|
141
|
+
}), y(this, "mixAudio", (u, n = "bgm") => new Promise(async (r, i) => {
|
|
164
142
|
try {
|
|
165
143
|
{
|
|
166
|
-
const s = this.mixAudioMap.get(
|
|
144
|
+
const s = this.mixAudioMap.get(n);
|
|
167
145
|
s && s.stop();
|
|
168
146
|
}
|
|
169
|
-
const
|
|
170
|
-
this.mixAudioMap.set(
|
|
171
|
-
|
|
172
|
-
},
|
|
173
|
-
} catch (
|
|
174
|
-
i(
|
|
147
|
+
const t = n === "bgs" ? this.bgsGainNode : this.bgmGainNode, e = this.audioContext.createBufferSource();
|
|
148
|
+
this.mixAudioMap.set(n, e), e.buffer = u, e.connect(t), e.onended = () => {
|
|
149
|
+
e.disconnect(t), this.mixAudioMap.delete(n), r(!0);
|
|
150
|
+
}, e.start(0);
|
|
151
|
+
} catch (t) {
|
|
152
|
+
i(t);
|
|
175
153
|
}
|
|
176
|
-
})),
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
}),
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
}),
|
|
154
|
+
})), y(this, "mixAudioStop", (u) => {
|
|
155
|
+
const n = this.mixAudioMap.get(u);
|
|
156
|
+
n == null || n.stop();
|
|
157
|
+
}), y(this, "changeMix", (u, n) => {
|
|
158
|
+
const r = u === "bgs" ? this.bgsGainNode : this.bgmGainNode;
|
|
159
|
+
n ? r.connect(this.destinationNode) : r.disconnect(this.destinationNode);
|
|
160
|
+
}), a && (this.audioContext = a), this.inputStream = o, this.sourceNode = this.audioContext.createMediaStreamSource(this.inputStream), this.inputGainNode = this.audioContext.createGain(), this.inputGainNode.gain.setValueAtTime(this.inputGain, this.audioContext.currentTime), this.enhanceGainNode = this.audioContext.createGain(), this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain, this.audioContext.currentTime), this.bgsGainNode = this.audioContext.createGain(), this.bgsGainNode.gain.setValueAtTime(this.bgsGain, this.audioContext.currentTime), this.bgmGainNode = this.audioContext.createGain(), this.bgmGainNode.gain.setValueAtTime(this.bgmGain, this.audioContext.currentTime), this.analyserNode = this.audioContext.createAnalyser(), this.analyserNode.fftSize = 512, this.analyserArrayData = new Uint8Array(this.analyserNode.frequencyBinCount), this.outputGainNode = this.audioContext.createGain(), this.outputGainNode.gain.setValueAtTime(this.outputGain, this.audioContext.currentTime), this.destinationNode = this.audioContext.createMediaStreamDestination(), this.outputStream = this.destinationNode.stream;
|
|
183
161
|
{
|
|
184
|
-
const { sourceNode:
|
|
185
|
-
|
|
162
|
+
const { sourceNode: u, inputGainNode: n, enhanceGainNode: r, bgsGainNode: i, bgmGainNode: t, analyserNode: e, outputGainNode: s, destinationNode: l } = this;
|
|
163
|
+
u.connect(n), n.connect(r), r.connect(e), i.connect(e), t.connect(e), r.connect(l), i.connect(l), t.connect(l), e.connect(s), s.connect(this.audioContext.destination);
|
|
186
164
|
}
|
|
187
165
|
this.setMute(!0), this.audioContext.resume();
|
|
188
166
|
}
|
|
189
167
|
}
|
|
190
|
-
const
|
|
168
|
+
const W = async (h, o) => {
|
|
191
169
|
try {
|
|
192
|
-
const { format:
|
|
193
|
-
for (let
|
|
194
|
-
const
|
|
195
|
-
o.copyTo(s, { planeIndex:
|
|
196
|
-
const l = new DataView(s.buffer),
|
|
197
|
-
for (let d = 0; d <
|
|
198
|
-
let
|
|
199
|
-
switch (
|
|
170
|
+
const { format: a, numberOfChannels: u, numberOfFrames: n, sampleRate: r } = o, i = h.createBuffer(u, n, r);
|
|
171
|
+
for (let t = 0; t < u; t++) {
|
|
172
|
+
const e = o.allocationSize({ planeIndex: t }), s = new Uint8Array(e);
|
|
173
|
+
o.copyTo(s, { planeIndex: t });
|
|
174
|
+
const l = new DataView(s.buffer), c = i.getChannelData(t);
|
|
175
|
+
for (let d = 0; d < n; d++) {
|
|
176
|
+
let p;
|
|
177
|
+
switch (a) {
|
|
200
178
|
case "s16":
|
|
201
179
|
// 16-bit signed PCM (范围: -32768 ~ 32767)
|
|
202
180
|
case "s16-planar":
|
|
203
|
-
|
|
181
|
+
p = l.getInt16(d * 2, !0) / 32768;
|
|
204
182
|
break;
|
|
205
183
|
case "f32":
|
|
206
184
|
// 32-bit float (范围: -1.0 ~ 1.0)
|
|
207
185
|
case "f32-planar":
|
|
208
|
-
|
|
186
|
+
p = l.getFloat32(d * 4, !0);
|
|
209
187
|
break;
|
|
210
188
|
case "u8":
|
|
211
189
|
// 8-bit unsigned (范围: 0 ~ 255)
|
|
212
190
|
case "u8-planar":
|
|
213
|
-
|
|
191
|
+
p = (l.getUint8(d) - 128) / 128;
|
|
214
192
|
break;
|
|
215
193
|
default:
|
|
216
|
-
throw new Error(`Unsupported audio format: ${
|
|
194
|
+
throw new Error(`Unsupported audio format: ${a}`);
|
|
217
195
|
}
|
|
218
|
-
|
|
196
|
+
c[d] = Math.max(-1, Math.min(1, p));
|
|
219
197
|
}
|
|
220
198
|
}
|
|
221
199
|
return i;
|
|
222
|
-
} catch (
|
|
223
|
-
throw console.error("Failed to convert AudioData to AudioBuffer:",
|
|
200
|
+
} catch (a) {
|
|
201
|
+
throw console.error("Failed to convert AudioData to AudioBuffer:", a), a;
|
|
224
202
|
}
|
|
225
203
|
};
|
|
226
|
-
class
|
|
204
|
+
class V {
|
|
227
205
|
constructor() {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
o || (o = new (window.AudioContext || window.webkitAudioContext)()), this.audioContext = o, this.destination = this.audioContext.createMediaStreamDestination(), this.stream = new MediaStream(), this.stream.addTrack(this.destination.stream.getAudioTracks()[0]), this.prAudioStream = new
|
|
206
|
+
m(this, "prAudioStream");
|
|
207
|
+
m(this, "audioContext");
|
|
208
|
+
m(this, "destination");
|
|
209
|
+
m(this, "stream", new MediaStream());
|
|
210
|
+
m(this, "nextStartTime", 0);
|
|
211
|
+
m(this, "pendingSources", []);
|
|
212
|
+
m(this, "init", (o) => {
|
|
213
|
+
o || (o = new (window.AudioContext || window.webkitAudioContext)()), this.audioContext = o, this.destination = this.audioContext.createMediaStreamDestination(), this.stream = new MediaStream(), this.stream.addTrack(this.destination.stream.getAudioTracks()[0]), this.prAudioStream = new O(this.stream, this.audioContext), this.nextStartTime = 0, this.pendingSources = [];
|
|
236
214
|
});
|
|
237
|
-
|
|
215
|
+
m(this, "getStream", () => {
|
|
238
216
|
var o;
|
|
239
217
|
return (o = this.prAudioStream) == null ? void 0 : o.getStream();
|
|
240
218
|
});
|
|
@@ -242,297 +220,479 @@ class X {
|
|
|
242
220
|
async push(o) {
|
|
243
221
|
try {
|
|
244
222
|
if (!this.audioContext || !this.destination) return;
|
|
245
|
-
const
|
|
246
|
-
if (!
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
this.nextStartTime =
|
|
251
|
-
this.pendingSources = this.pendingSources.filter((
|
|
223
|
+
const a = await W(this.audioContext, o);
|
|
224
|
+
if (!a) return;
|
|
225
|
+
const u = this.audioContext.createBufferSource();
|
|
226
|
+
u.buffer = a, u.connect(this.destination);
|
|
227
|
+
const n = Math.max(this.nextStartTime, this.audioContext.currentTime);
|
|
228
|
+
this.nextStartTime = n + a.duration, u.start(n), this.pendingSources.push(u), u.onended = () => {
|
|
229
|
+
this.pendingSources = this.pendingSources.filter((r) => r !== u);
|
|
252
230
|
}, this.audioContext.state === "suspended" && await this.audioContext.resume();
|
|
253
231
|
} finally {
|
|
254
232
|
o.close();
|
|
255
233
|
}
|
|
256
234
|
}
|
|
257
235
|
destroy() {
|
|
258
|
-
var o,
|
|
259
|
-
(o = this.audioContext) == null || o.close(), this.audioContext = void 0, this.destination = void 0, this.nextStartTime = 0, (
|
|
236
|
+
var o, a;
|
|
237
|
+
(o = this.audioContext) == null || o.close(), this.audioContext = void 0, this.destination = void 0, this.nextStartTime = 0, (a = this.prAudioStream) == null || a.stop(), this.pendingSources.forEach((u) => u.stop()), this.pendingSources = [];
|
|
260
238
|
}
|
|
261
239
|
}
|
|
262
|
-
|
|
263
|
-
|
|
240
|
+
const S = `(function(){"use strict";class r{isRendering=!1;pendingFrames=[];offscreenCanvas;writable;writer;ctx;cutOption;baseTime=0;pause=!1;shader=["stream"];constructor(){}init=({offscreenCanvas:e,writable:t})=>{this.destroy(),this.offscreenCanvas=e,this.writable=t,this.writer=this.writable.getWriter(),this.ctx=this.offscreenCanvas.getContext("2d")};setBaseTime=e=>{this.baseTime=e};setShader=e=>{this.shader=e};setSize=({width:e,height:t})=>{this.offscreenCanvas&&(this.offscreenCanvas.width=e,this.offscreenCanvas.height=t)};destroy=()=>{this.isRendering=!1,this.pendingFrames=[],this.offscreenCanvas=void 0,this.ctx=void 0,this.baseTime=0};push=e=>{this.pendingFrames.push(e),this.isRendering===!1&&setTimeout(this.renderFrame,0)};setCut=e=>{this.cutOption=e};setPause=e=>{this.pause=e,this.isRendering===!1&&setTimeout(this.renderFrame,0)};calculateTimeUntilNextFrame=e=>{const t=performance.timeOrigin+performance.now(),i=this.baseTime+e/1e3-t;return Math.max(0,i)};renderFrame=async()=>{for(this.isRendering=!0;;){const e=this.pendingFrames.shift();if(!e)break;let{timestamp:t,bitmap:s}=e;if(this.cutOption){const{sx:a=0,sy:c=0,sw:m=s.width,sh:o=s.height}=this.cutOption;s=await createImageBitmap(s,a,c,m,o)}const i=this.calculateTimeUntilNextFrame(t);await new Promise(a=>setTimeout(()=>a(!0),i)),this.drawImage({timestamp:t,bitmap:s}),this.cutOption&&s.close()}this.isRendering=!1};drawImage=e=>{if(this.pause!==!0){if(this.shader.includes("stream")){const t=new VideoFrame(e.bitmap,{timestamp:e.timestamp});this.writer.write(t),t.close()}this.shader.includes("canvas")&&this.ctx&&this.offscreenCanvas&&this.ctx.drawImage(e.bitmap,0,0,this.offscreenCanvas.width,this.offscreenCanvas.height)}}}const h=new r;onmessage=n=>{const{action:e,data:t}=n.data,s=h[e];s&&s(t)}})();
|
|
241
|
+
`, x = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", S], { type: "text/javascript;charset=utf-8" });
|
|
242
|
+
function j(h) {
|
|
243
|
+
let o;
|
|
244
|
+
try {
|
|
245
|
+
if (o = x && (self.URL || self.webkitURL).createObjectURL(x), !o) throw "";
|
|
246
|
+
const a = new Worker(o, {
|
|
247
|
+
name: h == null ? void 0 : h.name
|
|
248
|
+
});
|
|
249
|
+
return a.addEventListener("error", () => {
|
|
250
|
+
(self.URL || self.webkitURL).revokeObjectURL(o);
|
|
251
|
+
}), a;
|
|
252
|
+
} catch {
|
|
253
|
+
return new Worker(
|
|
254
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(S),
|
|
255
|
+
{
|
|
256
|
+
name: h == null ? void 0 : h.name
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
class z {
|
|
262
|
+
constructor() {
|
|
263
|
+
m(this, "worker", new j());
|
|
264
|
+
m(this, "init", ({ offscreenCanvas: o, writable: a }) => this.worker.postMessage({ action: "init", data: { offscreenCanvas: o, writable: a } }, [o, a]));
|
|
265
|
+
m(this, "setShader", (o) => this.worker.postMessage({ action: "setShader", data: o }));
|
|
266
|
+
m(this, "setBaseTime", (o) => this.worker.postMessage({ action: "setBaseTime", data: o }));
|
|
267
|
+
m(this, "setSize", ({ width: o, height: a }) => this.worker.postMessage({ action: "setSize", data: { width: o, height: a } }));
|
|
268
|
+
m(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
|
|
269
|
+
m(this, "setCut", async (o) => this.worker.postMessage({ action: "setCut", data: o }));
|
|
270
|
+
m(this, "setPause", (o) => this.worker.postMessage({ action: "setPause", data: o }));
|
|
271
|
+
m(this, "destroy", () => {
|
|
272
|
+
this.worker.postMessage({ action: "destroy", data: {} }), this.worker.terminate();
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
const $ = (h) => {
|
|
277
|
+
const o = h.toLowerCase();
|
|
278
|
+
return o.includes(".m3u8") || o.includes("hls") || o.includes("master.m3u8") || o.match(/index\d*\.m3u8/) ? "hls" : o.includes(".mpd") || o.includes("dash") ? "dash" : o.startsWith("rtmp://") || o.startsWith("rtmps://") ? "rtmp" : o.includes(".flv") || o.includes("flv") && !o.includes("flash") ? "flv" : "unknown";
|
|
279
|
+
}, P = (h) => {
|
|
280
|
+
const o = (h == null ? void 0 : h.getTracks()) || [];
|
|
281
|
+
for (const a of o)
|
|
282
|
+
a.stop();
|
|
283
|
+
}, A = () => {
|
|
284
|
+
const h = new z(), o = document.createElement("canvas"), a = o.transferControlToOffscreen(), u = new MediaStreamTrackGenerator({ kind: "video" }), n = new MediaStream([u]), r = () => {
|
|
285
|
+
h.destroy(), P(n);
|
|
286
|
+
};
|
|
287
|
+
return h.init({ offscreenCanvas: a, writable: u.writable }), { worker: h, canvas: o, stream: n, destroy: r };
|
|
288
|
+
};
|
|
289
|
+
class H {
|
|
290
|
+
constructor() {
|
|
291
|
+
m(this, "resolvesMap", /* @__PURE__ */ new Map());
|
|
292
|
+
m(this, "index", 0);
|
|
293
|
+
/**
|
|
294
|
+
*
|
|
295
|
+
* @param eventKey 唯一key
|
|
296
|
+
* @param checkFun 检测函数
|
|
297
|
+
* @param timeout 超时时间 ms
|
|
298
|
+
* @returns
|
|
299
|
+
*/
|
|
300
|
+
m(this, "add", (o, a = () => !1, u = 0) => new Promise((n) => {
|
|
301
|
+
var t, e;
|
|
302
|
+
if (a()) return n(!0);
|
|
303
|
+
this.resolvesMap.has(o) || this.resolvesMap.set(o, /* @__PURE__ */ new Map()), this.index++;
|
|
304
|
+
const r = `${this.index}`;
|
|
305
|
+
if (u = Math.max(0, u), u === 0) {
|
|
306
|
+
(t = this.resolvesMap.get(o)) == null || t.set(r, { resolve: n, timer: 0 });
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const i = window.setTimeout(() => {
|
|
310
|
+
this.emit(o);
|
|
311
|
+
}, u);
|
|
312
|
+
(e = this.resolvesMap.get(o)) == null || e.set(r, { resolve: n, timer: i });
|
|
313
|
+
}));
|
|
314
|
+
m(this, "emit", async (o) => {
|
|
315
|
+
const a = this.resolvesMap.get(o);
|
|
316
|
+
if (!a) return;
|
|
317
|
+
const u = [...a.keys()];
|
|
318
|
+
for (const n of u) {
|
|
319
|
+
const r = a.get(n);
|
|
320
|
+
r && (clearTimeout(r.timer), r.resolve(), a.delete(n));
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const Y = (h) => {
|
|
326
|
+
const o = new DataView(h.buffer);
|
|
327
|
+
let a = 0, u, n, r;
|
|
328
|
+
u = o.getUint32(a, !1), a += 4;
|
|
329
|
+
{
|
|
330
|
+
const i = o.getUint8(a), t = i >> 7 & 1, e = i >> 5 & 3, s = i & 31;
|
|
331
|
+
n = { forbidden_zero_bit: t, nal_ref_idc: e, nal_unit_type: s }, a += 1;
|
|
332
|
+
}
|
|
333
|
+
{
|
|
334
|
+
const i = u - 1;
|
|
335
|
+
r = new Uint8Array(o.buffer.slice(a, a + i));
|
|
336
|
+
}
|
|
337
|
+
return { size: u, header: n, data: r };
|
|
338
|
+
};
|
|
339
|
+
var q, U;
|
|
340
|
+
class C {
|
|
264
341
|
constructor(o = {}) {
|
|
265
|
-
|
|
266
|
-
timeout: 5 * 1e3
|
|
342
|
+
J(this, q, {
|
|
343
|
+
timeout: 5 * 1e3,
|
|
344
|
+
check: !1
|
|
267
345
|
});
|
|
268
|
-
|
|
346
|
+
J(this, U);
|
|
269
347
|
/**
|
|
270
348
|
*
|
|
271
349
|
* @param input string | URL | Request
|
|
272
350
|
* @param init RequestInit
|
|
273
351
|
*/
|
|
274
|
-
|
|
352
|
+
m(this, "check", (o, a) => new Promise(async (u, n) => {
|
|
275
353
|
var i;
|
|
276
|
-
this.stop(),
|
|
277
|
-
const
|
|
278
|
-
var
|
|
279
|
-
(
|
|
280
|
-
},
|
|
354
|
+
this.stop(), K(this, U, new AbortController());
|
|
355
|
+
const r = window.setTimeout(() => {
|
|
356
|
+
var t;
|
|
357
|
+
(t = I(this, U)) == null || t.abort("Timeout."), n({ status: "timeout", reason: "" });
|
|
358
|
+
}, I(this, q).timeout);
|
|
281
359
|
try {
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
} catch (
|
|
285
|
-
|
|
360
|
+
const t = await fetch(o, { ...a, method: "HEAD", signal: (i = I(this, U)) == null ? void 0 : i.signal });
|
|
361
|
+
t.status === 200 ? u({ status: "successed", reason: "" }) : n({ status: "failed", reason: `${t.status}` });
|
|
362
|
+
} catch (t) {
|
|
363
|
+
n({ status: "error", reason: t.message });
|
|
286
364
|
}
|
|
287
|
-
clearTimeout(
|
|
365
|
+
clearTimeout(r);
|
|
288
366
|
}));
|
|
289
367
|
/**
|
|
290
368
|
*
|
|
291
369
|
* @param input string | URL | Request
|
|
292
370
|
* @param init RequestInit
|
|
293
371
|
*/
|
|
294
|
-
|
|
295
|
-
var
|
|
372
|
+
m(this, "request", async (o, a) => new Promise(async (u, n) => {
|
|
373
|
+
var r;
|
|
296
374
|
try {
|
|
297
|
-
await this.check(o,
|
|
298
|
-
const i = await fetch(o, { ...
|
|
299
|
-
|
|
375
|
+
I(this, q).check && await this.check(o, a), K(this, U, new AbortController());
|
|
376
|
+
const i = await fetch(o, { ...a, signal: (r = I(this, U)) == null ? void 0 : r.signal });
|
|
377
|
+
u(i);
|
|
300
378
|
} catch (i) {
|
|
301
|
-
this.stop(),
|
|
379
|
+
this.stop(), n(i);
|
|
302
380
|
}
|
|
303
381
|
}));
|
|
304
382
|
/**
|
|
305
383
|
* stop
|
|
306
384
|
*/
|
|
307
|
-
|
|
385
|
+
m(this, "stop", () => {
|
|
308
386
|
var o;
|
|
309
|
-
((o =
|
|
387
|
+
((o = I(this, U)) == null ? void 0 : o.signal.aborted) === !1 && I(this, U).abort("Actively stop.");
|
|
310
388
|
});
|
|
311
|
-
|
|
389
|
+
K(this, q, { ...I(this, q), ...o });
|
|
312
390
|
}
|
|
313
391
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
b(this, "renderBaseTime", 0);
|
|
333
|
-
b(this, "stream");
|
|
334
|
-
b(this, "canvas");
|
|
335
|
-
b(this, "on", { demuxer: {}, decoder: {} });
|
|
336
|
-
b(this, "cutRenders", /* @__PURE__ */ new Map());
|
|
392
|
+
q = new WeakMap(), U = new WeakMap();
|
|
393
|
+
class et {
|
|
394
|
+
constructor(o = {}) {
|
|
395
|
+
m(this, "option", {
|
|
396
|
+
debug: !1
|
|
397
|
+
});
|
|
398
|
+
m(this, "prFetch", new C());
|
|
399
|
+
m(this, "prResolves", new H());
|
|
400
|
+
m(this, "url", "");
|
|
401
|
+
m(this, "demuxerWorker");
|
|
402
|
+
m(this, "decoderWorker");
|
|
403
|
+
m(this, "audioPlayer");
|
|
404
|
+
m(this, "renderWorker");
|
|
405
|
+
m(this, "renderBaseTime");
|
|
406
|
+
m(this, "stream");
|
|
407
|
+
m(this, "canvas");
|
|
408
|
+
m(this, "on", { demuxer: {}, decoder: {} });
|
|
409
|
+
m(this, "cutRenders", /* @__PURE__ */ new Map());
|
|
337
410
|
// @ts-ignore
|
|
338
|
-
|
|
411
|
+
m(this, "trackGenerator");
|
|
339
412
|
/**
|
|
340
413
|
* 初始化
|
|
341
414
|
*/
|
|
342
|
-
|
|
343
|
-
this.
|
|
415
|
+
m(this, "init", () => {
|
|
416
|
+
this.initDecoder(), this.audioPlayer = new V(), this.audioPlayer.init(), this.initRender();
|
|
344
417
|
});
|
|
345
418
|
/**
|
|
346
419
|
* 开始播放
|
|
347
420
|
* @param url : string
|
|
348
421
|
*/
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
}).catch((u) => {
|
|
363
|
-
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: err", u);
|
|
364
|
-
})));
|
|
422
|
+
m(this, "start", async (o) => {
|
|
423
|
+
this.stop(), this.url = o, this.init();
|
|
424
|
+
const a = $(o);
|
|
425
|
+
if (a === "unknown") throw new Error("This address cannot be parsed.");
|
|
426
|
+
switch (this.initDemuxer(a), a) {
|
|
427
|
+
case "flv":
|
|
428
|
+
this.flv.start();
|
|
429
|
+
break;
|
|
430
|
+
case "hls":
|
|
431
|
+
this.hls.start();
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
});
|
|
365
435
|
/**
|
|
366
436
|
* 停止
|
|
367
437
|
*/
|
|
368
|
-
|
|
369
|
-
var u,
|
|
438
|
+
m(this, "stop", async () => {
|
|
439
|
+
var a, u, n, r;
|
|
370
440
|
try {
|
|
371
|
-
this.prFetch.stop();
|
|
441
|
+
clearInterval(this.hls.getSegmentsTimer), this.prFetch.stop();
|
|
372
442
|
} catch (i) {
|
|
373
|
-
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->
|
|
443
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: error", i);
|
|
374
444
|
}
|
|
375
|
-
(
|
|
445
|
+
(a = this.demuxerWorker) == null || a.destroy(), (u = this.decoderWorker) == null || u.destroy(), (n = this.renderWorker) == null || n.destroy(), P(this.stream);
|
|
376
446
|
const o = [...this.cutRenders.keys()];
|
|
377
447
|
for (const i of o)
|
|
378
448
|
this.cut.remove(i);
|
|
379
|
-
(
|
|
380
|
-
});
|
|
381
|
-
/**
|
|
382
|
-
* 监听媒体 tag
|
|
383
|
-
*/
|
|
384
|
-
b(this, "onTag", (o) => {
|
|
385
|
-
var i;
|
|
386
|
-
if (!this.decoderWorker) return;
|
|
387
|
-
const { header: u, body: c } = o, { tagType: r, timestamp: n } = u;
|
|
388
|
-
switch (r) {
|
|
389
|
-
case "script":
|
|
390
|
-
{
|
|
391
|
-
const { width: e, height: t } = c;
|
|
392
|
-
(i = this.renderWorker) == null || i.setSize({ width: e, height: t }), this.on.demuxer.script && this.on.demuxer.script(o);
|
|
393
|
-
}
|
|
394
|
-
break;
|
|
395
|
-
case "audio":
|
|
396
|
-
{
|
|
397
|
-
const { accPacketType: e, data: t } = c;
|
|
398
|
-
if (e === 0) {
|
|
399
|
-
const { codec: s, sampleRate: l, channelConfiguration: a } = c, d = { codec: s, sampleRate: l, numberOfChannels: a, description: new Uint8Array([]) };
|
|
400
|
-
this.decoderWorker.audio.init(d);
|
|
401
|
-
} else e === 1 && this.decoderWorker.audio.decode({ type: "key", timestamp: n * 1, data: t });
|
|
402
|
-
this.on.demuxer.audio && this.on.demuxer.audio(o);
|
|
403
|
-
}
|
|
404
|
-
break;
|
|
405
|
-
case "video":
|
|
406
|
-
{
|
|
407
|
-
const { avcPacketType: e, frameType: t, data: s, nalus: l = [] } = c;
|
|
408
|
-
if (e === 0) {
|
|
409
|
-
const { codec: a, data: d } = c;
|
|
410
|
-
this.decoderWorker.video.init({ codec: a, description: d });
|
|
411
|
-
} else if (e === 1) {
|
|
412
|
-
const a = t === 1 ? "key" : "delta";
|
|
413
|
-
this.decoderWorker.video.decode({ type: a, timestamp: n * 1e3, data: s });
|
|
414
|
-
for (const d of l) {
|
|
415
|
-
const { header: y, payload: p } = d, { nal_unit_type: w } = y;
|
|
416
|
-
w === 6 && this.on.demuxer.sei && this.on.demuxer.sei(p);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
this.on.demuxer.video && this.on.demuxer.video(o);
|
|
420
|
-
}
|
|
421
|
-
break;
|
|
422
|
-
}
|
|
449
|
+
(r = this.audioPlayer) == null || r.destroy(), this.renderBaseTime = void 0, this.canvas = void 0;
|
|
423
450
|
});
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
});
|
|
430
|
-
/**
|
|
431
|
-
* 初始化解码器
|
|
432
|
-
*/
|
|
433
|
-
b(this, "initDecoder", () => {
|
|
434
|
-
this.decoderWorker = new j(), this.decoderWorker.on.audio.decode = (o) => {
|
|
435
|
-
var u;
|
|
436
|
-
(u = this.audioPlayer) == null || u.push(o), this.on.decoder.audio && this.on.decoder.audio(o);
|
|
437
|
-
}, this.decoderWorker.on.audio.error = (o) => {
|
|
438
|
-
this.stop(), this.on.error && this.on.error(o);
|
|
439
|
-
}, this.decoderWorker.on.video.decode = async (o) => {
|
|
440
|
-
var c, r;
|
|
441
|
-
(c = this.renderWorker) == null || c.push(o);
|
|
442
|
-
const u = [...this.cutRenders.keys()];
|
|
443
|
-
for (const n of u)
|
|
444
|
-
(r = this.cutRenders.get(n)) == null || r.worker.push(o);
|
|
445
|
-
this.on.decoder.video && this.on.decoder.video(o), o.bitmap.close();
|
|
446
|
-
}, this.decoderWorker.on.video.error = (o) => {
|
|
447
|
-
this.stop(), this.on.error && this.on.error(o);
|
|
448
|
-
};
|
|
449
|
-
});
|
|
450
|
-
/**
|
|
451
|
-
* 初始化渲染器
|
|
452
|
-
*/
|
|
453
|
-
b(this, "initRender", () => {
|
|
454
|
-
const { worker: o, canvas: u, stream: c } = G(this.renderBaseTime);
|
|
455
|
-
this.renderWorker = o, this.canvas = u, this.stream = c, this.renderWorker.setPause(!1);
|
|
456
|
-
});
|
|
457
|
-
b(this, "getCanvas", () => this.canvas);
|
|
458
|
-
b(this, "getStream", () => this.stream);
|
|
459
|
-
b(this, "setPause", (o) => {
|
|
460
|
-
var u;
|
|
461
|
-
(u = this.renderWorker) == null || u.setPause(o);
|
|
451
|
+
m(this, "getCanvas", () => this.canvas);
|
|
452
|
+
m(this, "getStream", () => this.stream);
|
|
453
|
+
m(this, "setPause", (o) => {
|
|
454
|
+
var a;
|
|
455
|
+
(a = this.renderWorker) == null || a.setPause(o);
|
|
462
456
|
});
|
|
463
457
|
/**
|
|
464
458
|
* 设置渲染模式
|
|
465
459
|
*/
|
|
466
|
-
|
|
467
|
-
var
|
|
468
|
-
(
|
|
460
|
+
m(this, "setShader", (o) => {
|
|
461
|
+
var a;
|
|
462
|
+
(a = this.renderWorker) == null || a.setShader(o);
|
|
469
463
|
});
|
|
470
464
|
/**
|
|
471
465
|
* 是否静音 默认为true
|
|
472
466
|
* @param state?: boolean
|
|
473
467
|
*/
|
|
474
|
-
|
|
475
|
-
var
|
|
476
|
-
return (
|
|
468
|
+
m(this, "setMute", (o) => {
|
|
469
|
+
var a, u;
|
|
470
|
+
return (u = (a = this.audioPlayer) == null ? void 0 : a.prAudioStream) == null ? void 0 : u.setMute(o);
|
|
477
471
|
});
|
|
478
|
-
|
|
472
|
+
/**
|
|
473
|
+
* 是否已准备好
|
|
474
|
+
*/
|
|
475
|
+
m(this, "isReady", () => {
|
|
476
|
+
const o = () => {
|
|
477
|
+
var a;
|
|
478
|
+
return ((a = this.stream) == null ? void 0 : a.active) === !0;
|
|
479
|
+
};
|
|
480
|
+
return this.prResolves.add("isReady", o);
|
|
481
|
+
});
|
|
482
|
+
m(this, "cut", {
|
|
479
483
|
/**
|
|
480
484
|
* 创建剪切
|
|
481
485
|
*/
|
|
482
|
-
create: (o,
|
|
483
|
-
let
|
|
484
|
-
return
|
|
486
|
+
create: (o, a) => {
|
|
487
|
+
let u = this.cutRenders.get(o);
|
|
488
|
+
return u ? (u.worker.setCut(a), u.worker.setPause(!1), u) : (u = A(), u.worker.setBaseTime(this.renderBaseTime || 0), u.worker.setCut(a), this.cutRenders.set(o, u), u);
|
|
485
489
|
},
|
|
486
490
|
getCanvas: (o) => {
|
|
487
|
-
var
|
|
488
|
-
return (
|
|
491
|
+
var a;
|
|
492
|
+
return (a = this.cutRenders.get(o)) == null ? void 0 : a.canvas;
|
|
489
493
|
},
|
|
490
494
|
getStream: (o) => {
|
|
491
|
-
var
|
|
492
|
-
return (
|
|
495
|
+
var a;
|
|
496
|
+
return (a = this.cutRenders.get(o)) == null ? void 0 : a.stream;
|
|
493
497
|
},
|
|
494
|
-
setPause: (o,
|
|
495
|
-
var
|
|
496
|
-
(
|
|
498
|
+
setPause: (o, a) => {
|
|
499
|
+
var u;
|
|
500
|
+
(u = this.cutRenders.get(o)) == null || u.worker.setPause(a);
|
|
497
501
|
},
|
|
498
502
|
/**
|
|
499
503
|
* 设置渲染模式
|
|
500
504
|
*/
|
|
501
|
-
setShader: (o,
|
|
502
|
-
var
|
|
503
|
-
(
|
|
505
|
+
setShader: (o, a) => {
|
|
506
|
+
var u;
|
|
507
|
+
(u = this.cutRenders.get(o)) == null || u.worker.setShader(a);
|
|
504
508
|
},
|
|
505
509
|
/**
|
|
506
510
|
* 移除剪切
|
|
507
511
|
*/
|
|
508
512
|
remove: (o) => {
|
|
509
|
-
var
|
|
510
|
-
(
|
|
513
|
+
var a;
|
|
514
|
+
(a = this.cutRenders.get(o)) == null || a.destroy(), this.cutRenders.delete(o);
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
/**
|
|
518
|
+
* 初始化解复器
|
|
519
|
+
*/
|
|
520
|
+
m(this, "initDemuxer", (o) => {
|
|
521
|
+
this.demuxerWorker = new L(), this.demuxerWorker.init(o), this.demuxerWorker.on.debug = (a) => {
|
|
522
|
+
this.option.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: debug", a);
|
|
523
|
+
}, this.demuxerWorker.on.info = (a) => {
|
|
524
|
+
this.option.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: info", a), this.on.demuxer.info && this.on.demuxer.info(a);
|
|
525
|
+
}, this.demuxerWorker.on.config = (a) => {
|
|
526
|
+
var n, r;
|
|
527
|
+
this.option.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: config", a), this.on.demuxer.config && this.on.demuxer.config(a);
|
|
528
|
+
const { kind: u } = a;
|
|
529
|
+
switch (u) {
|
|
530
|
+
case "audio":
|
|
531
|
+
{
|
|
532
|
+
const { codec: i, sampleRate: t, numberOfChannels: e } = a;
|
|
533
|
+
(n = this.decoderWorker) == null || n.audio.init({ codec: i, sampleRate: t, numberOfChannels: e });
|
|
534
|
+
}
|
|
535
|
+
break;
|
|
536
|
+
case "video":
|
|
537
|
+
{
|
|
538
|
+
const { codec: i, description: t } = a;
|
|
539
|
+
(r = this.decoderWorker) == null || r.video.init({ codec: i, description: t });
|
|
540
|
+
}
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
}, this.demuxerWorker.on.chunk = (a) => {
|
|
544
|
+
var n;
|
|
545
|
+
if (this.on.demuxer.chunk && this.on.demuxer.chunk(a), !this.decoderWorker) return;
|
|
546
|
+
const { kind: u } = a;
|
|
547
|
+
switch (u) {
|
|
548
|
+
case "audio":
|
|
549
|
+
{
|
|
550
|
+
const { type: r, dts: i, data: t } = a, e = i * 1;
|
|
551
|
+
this.decoderWorker.audio.decode({ type: r, timestamp: e, data: t });
|
|
552
|
+
}
|
|
553
|
+
break;
|
|
554
|
+
case "video":
|
|
555
|
+
{
|
|
556
|
+
const { type: r, dts: i, data: t, nalus: e = [] } = a;
|
|
557
|
+
if (this.renderBaseTime === void 0) {
|
|
558
|
+
const l = (/* @__PURE__ */ new Date()).getTime();
|
|
559
|
+
this.renderBaseTime = l - i, (n = this.renderWorker) == null || n.setBaseTime(this.renderBaseTime);
|
|
560
|
+
}
|
|
561
|
+
const s = i * 1e3;
|
|
562
|
+
this.decoderWorker.video.decode({ type: r, timestamp: s, data: t });
|
|
563
|
+
for (const l of e) {
|
|
564
|
+
if (l.byteLength <= 4) continue;
|
|
565
|
+
const { header: c, data: d } = Y(l), { nal_unit_type: p } = c;
|
|
566
|
+
p === 6 && this.on.demuxer.sei && this.on.demuxer.sei(d);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
});
|
|
573
|
+
/**
|
|
574
|
+
* 初始化解码器
|
|
575
|
+
*/
|
|
576
|
+
m(this, "initDecoder", () => {
|
|
577
|
+
this.decoderWorker = new N(), this.decoderWorker.on.audio.decode = (o) => {
|
|
578
|
+
var a;
|
|
579
|
+
(a = this.audioPlayer) == null || a.push(o), this.on.decoder.audio && this.on.decoder.audio(o);
|
|
580
|
+
}, this.decoderWorker.on.audio.error = (o) => {
|
|
581
|
+
this.stop(), this.on.error && this.on.error(o);
|
|
582
|
+
}, this.decoderWorker.on.video.decode = async (o) => {
|
|
583
|
+
var u, n;
|
|
584
|
+
(u = this.renderWorker) == null || u.push(o);
|
|
585
|
+
const a = [...this.cutRenders.keys()];
|
|
586
|
+
for (const r of a)
|
|
587
|
+
(n = this.cutRenders.get(r)) == null || n.worker.push(o);
|
|
588
|
+
this.on.decoder.video && this.on.decoder.video(o), o.bitmap.close();
|
|
589
|
+
}, this.decoderWorker.on.video.error = (o) => {
|
|
590
|
+
this.stop(), this.on.error && this.on.error(o);
|
|
591
|
+
};
|
|
592
|
+
});
|
|
593
|
+
/**
|
|
594
|
+
* 初始化渲染器
|
|
595
|
+
*/
|
|
596
|
+
m(this, "initRender", () => {
|
|
597
|
+
const { worker: o, canvas: a, stream: u } = A();
|
|
598
|
+
this.renderWorker = o, this.canvas = a, this.stream = u, this.renderWorker.setPause(!1);
|
|
599
|
+
});
|
|
600
|
+
m(this, "flv", {
|
|
601
|
+
start: async () => {
|
|
602
|
+
var o, a;
|
|
603
|
+
try {
|
|
604
|
+
const u = (o = (await this.prFetch.request(this.url)).body) == null ? void 0 : o.getReader();
|
|
605
|
+
if (!u) throw new Error("reader is error.");
|
|
606
|
+
for (; ; ) {
|
|
607
|
+
const { done: n, value: r } = await u.read();
|
|
608
|
+
if (r && ((a = this.demuxerWorker) == null || a.push(r)), n) break;
|
|
609
|
+
}
|
|
610
|
+
} catch (u) {
|
|
611
|
+
if ((u == null ? void 0 : u.name) !== "AbortError") throw Error(u);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
m(this, "hls", {
|
|
616
|
+
isLive: !1,
|
|
617
|
+
urls: [],
|
|
618
|
+
url: "",
|
|
619
|
+
getSegmentsTimer: 0,
|
|
620
|
+
parse: async (o) => {
|
|
621
|
+
const a = new TextDecoder("utf-8").decode(o).split(`
|
|
622
|
+
`).map((e) => e.replace("\r", "")), u = this.url.substring(0, this.url.lastIndexOf("/") + 1);
|
|
623
|
+
let n = 4, r = 0, i = !1;
|
|
624
|
+
const t = [];
|
|
625
|
+
for (const e of a)
|
|
626
|
+
e.startsWith("#EXTINF:") ? n = parseFloat(e.split(":")[1].split(",")[0]) : e.startsWith("#EXT-X-TARGETDURATION:") ? r = parseInt(e.split(":")[1]) : e.startsWith("#EXT-X-ENDLIST") ? i = !1 : e.startsWith("#EXT-X-MEDIA-SEQUENCE:") ? i = !0 : e.includes(".ts") && !e.startsWith("#") && t.push({
|
|
627
|
+
url: e.startsWith("http") ? e : u + e,
|
|
628
|
+
duration: n,
|
|
629
|
+
isLive: i
|
|
630
|
+
});
|
|
631
|
+
return { baseUrl: u, targetDuration: r, isLive: i, segments: t };
|
|
632
|
+
},
|
|
633
|
+
getSegments: async () => {
|
|
634
|
+
var a;
|
|
635
|
+
const o = (a = (await new C().request(this.url)).body) == null ? void 0 : a.getReader();
|
|
636
|
+
if (!o) throw new Error("reader is error.");
|
|
637
|
+
for (; ; ) {
|
|
638
|
+
const { done: u, value: n } = await o.read();
|
|
639
|
+
if (n) {
|
|
640
|
+
const r = await this.hls.parse(n), { segments: i = [], isLive: t = !1 } = r;
|
|
641
|
+
this.hls.isLive = t;
|
|
642
|
+
let e = Array.from(i, (l) => l.url);
|
|
643
|
+
const s = e.findIndex((l) => l === this.hls.url);
|
|
644
|
+
s !== -1 && (e = e.slice(s + 1)), this.hls.urls = e;
|
|
645
|
+
}
|
|
646
|
+
if (u) break;
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
getData: async () => {
|
|
650
|
+
},
|
|
651
|
+
start: async () => {
|
|
652
|
+
var o, a;
|
|
653
|
+
try {
|
|
654
|
+
for (await this.hls.getSegments(), this.hls.getSegmentsTimer = window.setInterval(this.hls.getSegments, 1e3), this.hls.isLive === !1 && clearInterval(this.hls.getSegmentsTimer); ; ) {
|
|
655
|
+
const u = this.hls.urls.shift();
|
|
656
|
+
if (u) {
|
|
657
|
+
this.hls.url = u;
|
|
658
|
+
const n = (o = (await this.prFetch.request(u)).body) == null ? void 0 : o.getReader();
|
|
659
|
+
if (!n) throw new Error("segment reader is error.");
|
|
660
|
+
for (; ; ) {
|
|
661
|
+
const { done: r, value: i } = await n.read();
|
|
662
|
+
if (i && ((a = this.demuxerWorker) == null || a.push(i)), r) break;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
await new Promise((n) => setTimeout(() => n(!0), 500));
|
|
666
|
+
}
|
|
667
|
+
} catch (u) {
|
|
668
|
+
if ((u == null ? void 0 : u.name) !== "AbortError") throw Error(u);
|
|
669
|
+
}
|
|
511
670
|
}
|
|
512
671
|
});
|
|
672
|
+
const { debug: a = !1 } = o;
|
|
673
|
+
this.option.debug = a;
|
|
513
674
|
}
|
|
514
675
|
}
|
|
515
|
-
new TextDecoder("utf-8");
|
|
516
676
|
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, indexMinimal = {}, minimal$1 = {}, aspromise, hasRequiredAspromise;
|
|
517
677
|
function requireAspromise() {
|
|
518
678
|
if (hasRequiredAspromise) return aspromise;
|
|
519
|
-
hasRequiredAspromise = 1, aspromise =
|
|
520
|
-
function
|
|
521
|
-
for (var
|
|
522
|
-
|
|
523
|
-
return new Promise(function(
|
|
524
|
-
|
|
679
|
+
hasRequiredAspromise = 1, aspromise = h;
|
|
680
|
+
function h(o, a) {
|
|
681
|
+
for (var u = new Array(arguments.length - 1), n = 0, r = 2, i = !0; r < arguments.length; )
|
|
682
|
+
u[n++] = arguments[r++];
|
|
683
|
+
return new Promise(function(e, s) {
|
|
684
|
+
u[n] = function(c) {
|
|
525
685
|
if (i)
|
|
526
|
-
if (i = !1,
|
|
527
|
-
s(
|
|
686
|
+
if (i = !1, c)
|
|
687
|
+
s(c);
|
|
528
688
|
else {
|
|
529
|
-
for (var d = new Array(arguments.length - 1),
|
|
530
|
-
d[
|
|
531
|
-
|
|
689
|
+
for (var d = new Array(arguments.length - 1), p = 0; p < d.length; )
|
|
690
|
+
d[p++] = arguments[p];
|
|
691
|
+
e.apply(null, d);
|
|
532
692
|
}
|
|
533
693
|
};
|
|
534
694
|
try {
|
|
535
|
-
o.apply(
|
|
695
|
+
o.apply(a || null, u);
|
|
536
696
|
} catch (l) {
|
|
537
697
|
i && (i = !1, s(l));
|
|
538
698
|
}
|
|
@@ -542,95 +702,95 @@ function requireAspromise() {
|
|
|
542
702
|
}
|
|
543
703
|
var base64 = {}, hasRequiredBase64;
|
|
544
704
|
function requireBase64() {
|
|
545
|
-
return hasRequiredBase64 || (hasRequiredBase64 = 1, function(
|
|
546
|
-
var o =
|
|
547
|
-
o.length = function(
|
|
548
|
-
var
|
|
549
|
-
if (!
|
|
705
|
+
return hasRequiredBase64 || (hasRequiredBase64 = 1, function(h) {
|
|
706
|
+
var o = h;
|
|
707
|
+
o.length = function(t) {
|
|
708
|
+
var e = t.length;
|
|
709
|
+
if (!e)
|
|
550
710
|
return 0;
|
|
551
|
-
for (var s = 0; --
|
|
711
|
+
for (var s = 0; --e % 4 > 1 && t.charAt(e) === "="; )
|
|
552
712
|
++s;
|
|
553
|
-
return Math.ceil(
|
|
713
|
+
return Math.ceil(t.length * 3) / 4 - s;
|
|
554
714
|
};
|
|
555
|
-
for (var
|
|
556
|
-
|
|
557
|
-
o.encode = function(
|
|
558
|
-
for (var l = null,
|
|
559
|
-
var w = e
|
|
560
|
-
switch (
|
|
715
|
+
for (var a = new Array(64), u = new Array(123), n = 0; n < 64; )
|
|
716
|
+
u[a[n] = n < 26 ? n + 65 : n < 52 ? n + 71 : n < 62 ? n - 4 : n - 59 | 43] = n++;
|
|
717
|
+
o.encode = function(t, e, s) {
|
|
718
|
+
for (var l = null, c = [], d = 0, p = 0, f; e < s; ) {
|
|
719
|
+
var w = t[e++];
|
|
720
|
+
switch (p) {
|
|
561
721
|
case 0:
|
|
562
|
-
|
|
722
|
+
c[d++] = a[w >> 2], f = (w & 3) << 4, p = 1;
|
|
563
723
|
break;
|
|
564
724
|
case 1:
|
|
565
|
-
|
|
725
|
+
c[d++] = a[f | w >> 4], f = (w & 15) << 2, p = 2;
|
|
566
726
|
break;
|
|
567
727
|
case 2:
|
|
568
|
-
|
|
728
|
+
c[d++] = a[f | w >> 6], c[d++] = a[w & 63], p = 0;
|
|
569
729
|
break;
|
|
570
730
|
}
|
|
571
|
-
d > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String,
|
|
731
|
+
d > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String, c)), d = 0);
|
|
572
732
|
}
|
|
573
|
-
return
|
|
733
|
+
return p && (c[d++] = a[f], c[d++] = 61, p === 1 && (c[d++] = 61)), l ? (d && l.push(String.fromCharCode.apply(String, c.slice(0, d))), l.join("")) : String.fromCharCode.apply(String, c.slice(0, d));
|
|
574
734
|
};
|
|
575
|
-
var
|
|
576
|
-
o.decode = function(
|
|
577
|
-
for (var l = s,
|
|
578
|
-
var
|
|
579
|
-
if (
|
|
735
|
+
var r = "invalid encoding";
|
|
736
|
+
o.decode = function(t, e, s) {
|
|
737
|
+
for (var l = s, c = 0, d, p = 0; p < t.length; ) {
|
|
738
|
+
var f = t.charCodeAt(p++);
|
|
739
|
+
if (f === 61 && c > 1)
|
|
580
740
|
break;
|
|
581
|
-
if ((
|
|
582
|
-
throw Error(
|
|
583
|
-
switch (
|
|
741
|
+
if ((f = u[f]) === void 0)
|
|
742
|
+
throw Error(r);
|
|
743
|
+
switch (c) {
|
|
584
744
|
case 0:
|
|
585
|
-
d =
|
|
745
|
+
d = f, c = 1;
|
|
586
746
|
break;
|
|
587
747
|
case 1:
|
|
588
|
-
|
|
748
|
+
e[s++] = d << 2 | (f & 48) >> 4, d = f, c = 2;
|
|
589
749
|
break;
|
|
590
750
|
case 2:
|
|
591
|
-
|
|
751
|
+
e[s++] = (d & 15) << 4 | (f & 60) >> 2, d = f, c = 3;
|
|
592
752
|
break;
|
|
593
753
|
case 3:
|
|
594
|
-
|
|
754
|
+
e[s++] = (d & 3) << 6 | f, c = 0;
|
|
595
755
|
break;
|
|
596
756
|
}
|
|
597
757
|
}
|
|
598
|
-
if (
|
|
599
|
-
throw Error(
|
|
758
|
+
if (c === 1)
|
|
759
|
+
throw Error(r);
|
|
600
760
|
return s - l;
|
|
601
|
-
}, o.test = function(
|
|
602
|
-
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(
|
|
761
|
+
}, o.test = function(t) {
|
|
762
|
+
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t);
|
|
603
763
|
};
|
|
604
764
|
}(base64)), base64;
|
|
605
765
|
}
|
|
606
766
|
var eventemitter, hasRequiredEventemitter;
|
|
607
767
|
function requireEventemitter() {
|
|
608
768
|
if (hasRequiredEventemitter) return eventemitter;
|
|
609
|
-
hasRequiredEventemitter = 1, eventemitter =
|
|
610
|
-
function
|
|
769
|
+
hasRequiredEventemitter = 1, eventemitter = h;
|
|
770
|
+
function h() {
|
|
611
771
|
this._listeners = {};
|
|
612
772
|
}
|
|
613
|
-
return
|
|
614
|
-
return (this._listeners[
|
|
615
|
-
fn:
|
|
616
|
-
ctx:
|
|
773
|
+
return h.prototype.on = function(a, u, n) {
|
|
774
|
+
return (this._listeners[a] || (this._listeners[a] = [])).push({
|
|
775
|
+
fn: u,
|
|
776
|
+
ctx: n || this
|
|
617
777
|
}), this;
|
|
618
|
-
},
|
|
619
|
-
if (
|
|
778
|
+
}, h.prototype.off = function(a, u) {
|
|
779
|
+
if (a === void 0)
|
|
620
780
|
this._listeners = {};
|
|
621
|
-
else if (
|
|
622
|
-
this._listeners[
|
|
781
|
+
else if (u === void 0)
|
|
782
|
+
this._listeners[a] = [];
|
|
623
783
|
else
|
|
624
|
-
for (var
|
|
625
|
-
r
|
|
784
|
+
for (var n = this._listeners[a], r = 0; r < n.length; )
|
|
785
|
+
n[r].fn === u ? n.splice(r, 1) : ++r;
|
|
626
786
|
return this;
|
|
627
|
-
},
|
|
628
|
-
var
|
|
629
|
-
if (
|
|
630
|
-
for (var
|
|
631
|
-
|
|
632
|
-
for (
|
|
633
|
-
|
|
787
|
+
}, h.prototype.emit = function(a) {
|
|
788
|
+
var u = this._listeners[a];
|
|
789
|
+
if (u) {
|
|
790
|
+
for (var n = [], r = 1; r < arguments.length; )
|
|
791
|
+
n.push(arguments[r++]);
|
|
792
|
+
for (r = 0; r < u.length; )
|
|
793
|
+
u[r].fn.apply(u[r++].ctx, n);
|
|
634
794
|
}
|
|
635
795
|
return this;
|
|
636
796
|
}, eventemitter;
|
|
@@ -638,112 +798,112 @@ function requireEventemitter() {
|
|
|
638
798
|
var float, hasRequiredFloat;
|
|
639
799
|
function requireFloat() {
|
|
640
800
|
if (hasRequiredFloat) return float;
|
|
641
|
-
hasRequiredFloat = 1, float =
|
|
642
|
-
function
|
|
801
|
+
hasRequiredFloat = 1, float = h(h);
|
|
802
|
+
function h(r) {
|
|
643
803
|
return typeof Float32Array < "u" ? function() {
|
|
644
|
-
var i = new Float32Array([-0]),
|
|
645
|
-
function s(
|
|
646
|
-
i[0] =
|
|
804
|
+
var i = new Float32Array([-0]), t = new Uint8Array(i.buffer), e = t[3] === 128;
|
|
805
|
+
function s(p, f, w) {
|
|
806
|
+
i[0] = p, f[w] = t[0], f[w + 1] = t[1], f[w + 2] = t[2], f[w + 3] = t[3];
|
|
647
807
|
}
|
|
648
|
-
function l(
|
|
649
|
-
i[0] =
|
|
808
|
+
function l(p, f, w) {
|
|
809
|
+
i[0] = p, f[w] = t[3], f[w + 1] = t[2], f[w + 2] = t[1], f[w + 3] = t[0];
|
|
650
810
|
}
|
|
651
|
-
|
|
652
|
-
function
|
|
653
|
-
return
|
|
811
|
+
r.writeFloatLE = e ? s : l, r.writeFloatBE = e ? l : s;
|
|
812
|
+
function c(p, f) {
|
|
813
|
+
return t[0] = p[f], t[1] = p[f + 1], t[2] = p[f + 2], t[3] = p[f + 3], i[0];
|
|
654
814
|
}
|
|
655
|
-
function d(
|
|
656
|
-
return
|
|
815
|
+
function d(p, f) {
|
|
816
|
+
return t[3] = p[f], t[2] = p[f + 1], t[1] = p[f + 2], t[0] = p[f + 3], i[0];
|
|
657
817
|
}
|
|
658
|
-
|
|
818
|
+
r.readFloatLE = e ? c : d, r.readFloatBE = e ? d : c;
|
|
659
819
|
}() : function() {
|
|
660
|
-
function i(
|
|
820
|
+
function i(e, s, l, c) {
|
|
661
821
|
var d = s < 0 ? 1 : 0;
|
|
662
822
|
if (d && (s = -s), s === 0)
|
|
663
|
-
|
|
823
|
+
e(1 / s > 0 ? (
|
|
664
824
|
/* positive */
|
|
665
825
|
0
|
|
666
826
|
) : (
|
|
667
827
|
/* negative 0 */
|
|
668
828
|
2147483648
|
|
669
|
-
), l,
|
|
829
|
+
), l, c);
|
|
670
830
|
else if (isNaN(s))
|
|
671
|
-
|
|
831
|
+
e(2143289344, l, c);
|
|
672
832
|
else if (s > 34028234663852886e22)
|
|
673
|
-
|
|
833
|
+
e((d << 31 | 2139095040) >>> 0, l, c);
|
|
674
834
|
else if (s < 11754943508222875e-54)
|
|
675
|
-
|
|
835
|
+
e((d << 31 | Math.round(s / 1401298464324817e-60)) >>> 0, l, c);
|
|
676
836
|
else {
|
|
677
|
-
var
|
|
678
|
-
|
|
837
|
+
var p = Math.floor(Math.log(s) / Math.LN2), f = Math.round(s * Math.pow(2, -p) * 8388608) & 8388607;
|
|
838
|
+
e((d << 31 | p + 127 << 23 | f) >>> 0, l, c);
|
|
679
839
|
}
|
|
680
840
|
}
|
|
681
|
-
|
|
682
|
-
function e
|
|
683
|
-
var
|
|
684
|
-
return
|
|
841
|
+
r.writeFloatLE = i.bind(null, o), r.writeFloatBE = i.bind(null, a);
|
|
842
|
+
function t(e, s, l) {
|
|
843
|
+
var c = e(s, l), d = (c >> 31) * 2 + 1, p = c >>> 23 & 255, f = c & 8388607;
|
|
844
|
+
return p === 255 ? f ? NaN : d * (1 / 0) : p === 0 ? d * 1401298464324817e-60 * f : d * Math.pow(2, p - 150) * (f + 8388608);
|
|
685
845
|
}
|
|
686
|
-
|
|
846
|
+
r.readFloatLE = t.bind(null, u), r.readFloatBE = t.bind(null, n);
|
|
687
847
|
}(), typeof Float64Array < "u" ? function() {
|
|
688
|
-
var i = new Float64Array([-0]),
|
|
689
|
-
function s(
|
|
690
|
-
i[0] =
|
|
848
|
+
var i = new Float64Array([-0]), t = new Uint8Array(i.buffer), e = t[7] === 128;
|
|
849
|
+
function s(p, f, w) {
|
|
850
|
+
i[0] = p, f[w] = t[0], f[w + 1] = t[1], f[w + 2] = t[2], f[w + 3] = t[3], f[w + 4] = t[4], f[w + 5] = t[5], f[w + 6] = t[6], f[w + 7] = t[7];
|
|
691
851
|
}
|
|
692
|
-
function l(
|
|
693
|
-
i[0] =
|
|
852
|
+
function l(p, f, w) {
|
|
853
|
+
i[0] = p, f[w] = t[7], f[w + 1] = t[6], f[w + 2] = t[5], f[w + 3] = t[4], f[w + 4] = t[3], f[w + 5] = t[2], f[w + 6] = t[1], f[w + 7] = t[0];
|
|
694
854
|
}
|
|
695
|
-
|
|
696
|
-
function
|
|
697
|
-
return
|
|
855
|
+
r.writeDoubleLE = e ? s : l, r.writeDoubleBE = e ? l : s;
|
|
856
|
+
function c(p, f) {
|
|
857
|
+
return t[0] = p[f], t[1] = p[f + 1], t[2] = p[f + 2], t[3] = p[f + 3], t[4] = p[f + 4], t[5] = p[f + 5], t[6] = p[f + 6], t[7] = p[f + 7], i[0];
|
|
698
858
|
}
|
|
699
|
-
function d(
|
|
700
|
-
return
|
|
859
|
+
function d(p, f) {
|
|
860
|
+
return t[7] = p[f], t[6] = p[f + 1], t[5] = p[f + 2], t[4] = p[f + 3], t[3] = p[f + 4], t[2] = p[f + 5], t[1] = p[f + 6], t[0] = p[f + 7], i[0];
|
|
701
861
|
}
|
|
702
|
-
|
|
862
|
+
r.readDoubleLE = e ? c : d, r.readDoubleBE = e ? d : c;
|
|
703
863
|
}() : function() {
|
|
704
|
-
function i(
|
|
705
|
-
var
|
|
706
|
-
if (
|
|
707
|
-
|
|
864
|
+
function i(e, s, l, c, d, p) {
|
|
865
|
+
var f = c < 0 ? 1 : 0;
|
|
866
|
+
if (f && (c = -c), c === 0)
|
|
867
|
+
e(0, d, p + s), e(1 / c > 0 ? (
|
|
708
868
|
/* positive */
|
|
709
869
|
0
|
|
710
870
|
) : (
|
|
711
871
|
/* negative 0 */
|
|
712
872
|
2147483648
|
|
713
|
-
), d,
|
|
714
|
-
else if (isNaN(
|
|
715
|
-
|
|
716
|
-
else if (
|
|
717
|
-
|
|
873
|
+
), d, p + l);
|
|
874
|
+
else if (isNaN(c))
|
|
875
|
+
e(0, d, p + s), e(2146959360, d, p + l);
|
|
876
|
+
else if (c > 17976931348623157e292)
|
|
877
|
+
e(0, d, p + s), e((f << 31 | 2146435072) >>> 0, d, p + l);
|
|
718
878
|
else {
|
|
719
879
|
var w;
|
|
720
|
-
if (
|
|
721
|
-
w =
|
|
880
|
+
if (c < 22250738585072014e-324)
|
|
881
|
+
w = c / 5e-324, e(w >>> 0, d, p + s), e((f << 31 | w / 4294967296) >>> 0, d, p + l);
|
|
722
882
|
else {
|
|
723
|
-
var
|
|
724
|
-
|
|
883
|
+
var b = Math.floor(Math.log(c) / Math.LN2);
|
|
884
|
+
b === 1024 && (b = 1023), w = c * Math.pow(2, -b), e(w * 4503599627370496 >>> 0, d, p + s), e((f << 31 | b + 1023 << 20 | w * 1048576 & 1048575) >>> 0, d, p + l);
|
|
725
885
|
}
|
|
726
886
|
}
|
|
727
887
|
}
|
|
728
|
-
|
|
729
|
-
function e
|
|
730
|
-
var
|
|
731
|
-
return
|
|
888
|
+
r.writeDoubleLE = i.bind(null, o, 0, 4), r.writeDoubleBE = i.bind(null, a, 4, 0);
|
|
889
|
+
function t(e, s, l, c, d) {
|
|
890
|
+
var p = e(c, d + s), f = e(c, d + l), w = (f >> 31) * 2 + 1, b = f >>> 20 & 2047, g = 4294967296 * (f & 1048575) + p;
|
|
891
|
+
return b === 2047 ? g ? NaN : w * (1 / 0) : b === 0 ? w * 5e-324 * g : w * Math.pow(2, b - 1075) * (g + 4503599627370496);
|
|
732
892
|
}
|
|
733
|
-
|
|
734
|
-
}(),
|
|
893
|
+
r.readDoubleLE = t.bind(null, u, 0, 4), r.readDoubleBE = t.bind(null, n, 4, 0);
|
|
894
|
+
}(), r;
|
|
735
895
|
}
|
|
736
|
-
function o(
|
|
737
|
-
i[
|
|
896
|
+
function o(r, i, t) {
|
|
897
|
+
i[t] = r & 255, i[t + 1] = r >>> 8 & 255, i[t + 2] = r >>> 16 & 255, i[t + 3] = r >>> 24;
|
|
738
898
|
}
|
|
739
|
-
function
|
|
740
|
-
i[
|
|
899
|
+
function a(r, i, t) {
|
|
900
|
+
i[t] = r >>> 24, i[t + 1] = r >>> 16 & 255, i[t + 2] = r >>> 8 & 255, i[t + 3] = r & 255;
|
|
741
901
|
}
|
|
742
|
-
function
|
|
743
|
-
return (
|
|
902
|
+
function u(r, i) {
|
|
903
|
+
return (r[i] | r[i + 1] << 8 | r[i + 2] << 16 | r[i + 3] << 24) >>> 0;
|
|
744
904
|
}
|
|
745
|
-
function r
|
|
746
|
-
return (
|
|
905
|
+
function n(r, i) {
|
|
906
|
+
return (r[i] << 24 | r[i + 1] << 16 | r[i + 2] << 8 | r[i + 3]) >>> 0;
|
|
747
907
|
}
|
|
748
908
|
return float;
|
|
749
909
|
}
|
|
@@ -756,7 +916,7 @@ function requireInquire() {
|
|
|
756
916
|
var mod = eval("quire".replace(/^/, "re"))(moduleName);
|
|
757
917
|
if (mod && (mod.length || Object.keys(mod).length))
|
|
758
918
|
return mod;
|
|
759
|
-
} catch (
|
|
919
|
+
} catch (h) {
|
|
760
920
|
}
|
|
761
921
|
return null;
|
|
762
922
|
}
|
|
@@ -764,38 +924,38 @@ function requireInquire() {
|
|
|
764
924
|
}
|
|
765
925
|
var utf8 = {}, hasRequiredUtf8;
|
|
766
926
|
function requireUtf8() {
|
|
767
|
-
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(
|
|
768
|
-
var o =
|
|
769
|
-
o.length = function(
|
|
770
|
-
for (var
|
|
771
|
-
|
|
772
|
-
return
|
|
773
|
-
}, o.read = function(
|
|
774
|
-
var i =
|
|
927
|
+
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(h) {
|
|
928
|
+
var o = h;
|
|
929
|
+
o.length = function(u) {
|
|
930
|
+
for (var n = 0, r = 0, i = 0; i < u.length; ++i)
|
|
931
|
+
r = u.charCodeAt(i), r < 128 ? n += 1 : r < 2048 ? n += 2 : (r & 64512) === 55296 && (u.charCodeAt(i + 1) & 64512) === 56320 ? (++i, n += 4) : n += 3;
|
|
932
|
+
return n;
|
|
933
|
+
}, o.read = function(u, n, r) {
|
|
934
|
+
var i = r - n;
|
|
775
935
|
if (i < 1)
|
|
776
936
|
return "";
|
|
777
|
-
for (var
|
|
778
|
-
l =
|
|
779
|
-
return
|
|
780
|
-
}, o.write = function(
|
|
781
|
-
for (var i =
|
|
782
|
-
|
|
783
|
-
return
|
|
937
|
+
for (var t = null, e = [], s = 0, l; n < r; )
|
|
938
|
+
l = u[n++], l < 128 ? e[s++] = l : l > 191 && l < 224 ? e[s++] = (l & 31) << 6 | u[n++] & 63 : l > 239 && l < 365 ? (l = ((l & 7) << 18 | (u[n++] & 63) << 12 | (u[n++] & 63) << 6 | u[n++] & 63) - 65536, e[s++] = 55296 + (l >> 10), e[s++] = 56320 + (l & 1023)) : e[s++] = (l & 15) << 12 | (u[n++] & 63) << 6 | u[n++] & 63, s > 8191 && ((t || (t = [])).push(String.fromCharCode.apply(String, e)), s = 0);
|
|
939
|
+
return t ? (s && t.push(String.fromCharCode.apply(String, e.slice(0, s))), t.join("")) : String.fromCharCode.apply(String, e.slice(0, s));
|
|
940
|
+
}, o.write = function(u, n, r) {
|
|
941
|
+
for (var i = r, t, e, s = 0; s < u.length; ++s)
|
|
942
|
+
t = u.charCodeAt(s), t < 128 ? n[r++] = t : t < 2048 ? (n[r++] = t >> 6 | 192, n[r++] = t & 63 | 128) : (t & 64512) === 55296 && ((e = u.charCodeAt(s + 1)) & 64512) === 56320 ? (t = 65536 + ((t & 1023) << 10) + (e & 1023), ++s, n[r++] = t >> 18 | 240, n[r++] = t >> 12 & 63 | 128, n[r++] = t >> 6 & 63 | 128, n[r++] = t & 63 | 128) : (n[r++] = t >> 12 | 224, n[r++] = t >> 6 & 63 | 128, n[r++] = t & 63 | 128);
|
|
943
|
+
return r - i;
|
|
784
944
|
};
|
|
785
945
|
}(utf8)), utf8;
|
|
786
946
|
}
|
|
787
947
|
var pool_1, hasRequiredPool;
|
|
788
948
|
function requirePool() {
|
|
789
949
|
if (hasRequiredPool) return pool_1;
|
|
790
|
-
hasRequiredPool = 1, pool_1 =
|
|
791
|
-
function
|
|
792
|
-
var
|
|
950
|
+
hasRequiredPool = 1, pool_1 = h;
|
|
951
|
+
function h(o, a, u) {
|
|
952
|
+
var n = u || 8192, r = n >>> 1, i = null, t = n;
|
|
793
953
|
return function(s) {
|
|
794
|
-
if (s < 1 || s >
|
|
954
|
+
if (s < 1 || s > r)
|
|
795
955
|
return o(s);
|
|
796
|
-
|
|
797
|
-
var l =
|
|
798
|
-
return
|
|
956
|
+
t + s > n && (i = o(n), t = 0);
|
|
957
|
+
var l = a.call(i, t, t += s);
|
|
958
|
+
return t & 7 && (t = (t | 7) + 1), l;
|
|
799
959
|
};
|
|
800
960
|
}
|
|
801
961
|
return pool_1;
|
|
@@ -804,49 +964,49 @@ var longbits, hasRequiredLongbits;
|
|
|
804
964
|
function requireLongbits() {
|
|
805
965
|
if (hasRequiredLongbits) return longbits;
|
|
806
966
|
hasRequiredLongbits = 1, longbits = o;
|
|
807
|
-
var
|
|
808
|
-
function o(
|
|
809
|
-
this.lo =
|
|
967
|
+
var h = requireMinimal$1();
|
|
968
|
+
function o(r, i) {
|
|
969
|
+
this.lo = r >>> 0, this.hi = i >>> 0;
|
|
810
970
|
}
|
|
811
|
-
var
|
|
812
|
-
|
|
971
|
+
var a = o.zero = new o(0, 0);
|
|
972
|
+
a.toNumber = function() {
|
|
813
973
|
return 0;
|
|
814
|
-
},
|
|
974
|
+
}, a.zzEncode = a.zzDecode = function() {
|
|
815
975
|
return this;
|
|
816
|
-
},
|
|
976
|
+
}, a.length = function() {
|
|
817
977
|
return 1;
|
|
818
978
|
};
|
|
819
|
-
var
|
|
979
|
+
var u = o.zeroHash = "\0\0\0\0\0\0\0\0";
|
|
820
980
|
o.fromNumber = function(i) {
|
|
821
981
|
if (i === 0)
|
|
822
|
-
return
|
|
823
|
-
var
|
|
824
|
-
|
|
825
|
-
var
|
|
826
|
-
return
|
|
982
|
+
return a;
|
|
983
|
+
var t = i < 0;
|
|
984
|
+
t && (i = -i);
|
|
985
|
+
var e = i >>> 0, s = (i - e) / 4294967296 >>> 0;
|
|
986
|
+
return t && (s = ~s >>> 0, e = ~e >>> 0, ++e > 4294967295 && (e = 0, ++s > 4294967295 && (s = 0))), new o(e, s);
|
|
827
987
|
}, o.from = function(i) {
|
|
828
988
|
if (typeof i == "number")
|
|
829
989
|
return o.fromNumber(i);
|
|
830
|
-
if (
|
|
831
|
-
if (
|
|
832
|
-
i =
|
|
990
|
+
if (h.isString(i))
|
|
991
|
+
if (h.Long)
|
|
992
|
+
i = h.Long.fromString(i);
|
|
833
993
|
else
|
|
834
994
|
return o.fromNumber(parseInt(i, 10));
|
|
835
|
-
return i.low || i.high ? new o(i.low >>> 0, i.high >>> 0) :
|
|
995
|
+
return i.low || i.high ? new o(i.low >>> 0, i.high >>> 0) : a;
|
|
836
996
|
}, o.prototype.toNumber = function(i) {
|
|
837
997
|
if (!i && this.hi >>> 31) {
|
|
838
|
-
var
|
|
839
|
-
return
|
|
998
|
+
var t = ~this.lo + 1 >>> 0, e = ~this.hi >>> 0;
|
|
999
|
+
return t || (e = e + 1 >>> 0), -(t + e * 4294967296);
|
|
840
1000
|
}
|
|
841
1001
|
return this.lo + this.hi * 4294967296;
|
|
842
1002
|
}, o.prototype.toLong = function(i) {
|
|
843
|
-
return
|
|
1003
|
+
return h.Long ? new h.Long(this.lo | 0, this.hi | 0, !!i) : { low: this.lo | 0, high: this.hi | 0, unsigned: !!i };
|
|
844
1004
|
};
|
|
845
|
-
var
|
|
1005
|
+
var n = String.prototype.charCodeAt;
|
|
846
1006
|
return o.fromHash = function(i) {
|
|
847
|
-
return i ===
|
|
848
|
-
(
|
|
849
|
-
(
|
|
1007
|
+
return i === u ? a : new o(
|
|
1008
|
+
(n.call(i, 0) | n.call(i, 1) << 8 | n.call(i, 2) << 16 | n.call(i, 3) << 24) >>> 0,
|
|
1009
|
+
(n.call(i, 4) | n.call(i, 5) << 8 | n.call(i, 6) << 16 | n.call(i, 7) << 24) >>> 0
|
|
850
1010
|
);
|
|
851
1011
|
}, o.prototype.toHash = function() {
|
|
852
1012
|
return String.fromCharCode(
|
|
@@ -866,14 +1026,14 @@ function requireLongbits() {
|
|
|
866
1026
|
var i = -(this.lo & 1);
|
|
867
1027
|
return this.lo = ((this.lo >>> 1 | this.hi << 31) ^ i) >>> 0, this.hi = (this.hi >>> 1 ^ i) >>> 0, this;
|
|
868
1028
|
}, o.prototype.length = function() {
|
|
869
|
-
var i = this.lo,
|
|
870
|
-
return
|
|
1029
|
+
var i = this.lo, t = (this.lo >>> 28 | this.hi << 4) >>> 0, e = this.hi >>> 24;
|
|
1030
|
+
return e === 0 ? t === 0 ? i < 16384 ? i < 128 ? 1 : 2 : i < 2097152 ? 3 : 4 : t < 16384 ? t < 128 ? 5 : 6 : t < 2097152 ? 7 : 8 : e < 128 ? 9 : 10;
|
|
871
1031
|
}, longbits;
|
|
872
1032
|
}
|
|
873
1033
|
var hasRequiredMinimal$1;
|
|
874
1034
|
function requireMinimal$1() {
|
|
875
|
-
return hasRequiredMinimal$1 || (hasRequiredMinimal$1 = 1, function(
|
|
876
|
-
var o =
|
|
1035
|
+
return hasRequiredMinimal$1 || (hasRequiredMinimal$1 = 1, function(h) {
|
|
1036
|
+
var o = h;
|
|
877
1037
|
o.asPromise = requireAspromise(), o.base64 = requireBase64(), o.EventEmitter = requireEventemitter(), o.float = requireFloat(), o.inquire = requireInquire(), o.utf8 = requireUtf8(), o.pool = requirePool(), o.LongBits = requireLongbits(), o.isNode = !!(typeof commonjsGlobal < "u" && commonjsGlobal && commonjsGlobal.process && commonjsGlobal.process.versions && commonjsGlobal.process.versions.node), o.global = o.isNode && commonjsGlobal || typeof window < "u" && window || typeof self < "u" && self || minimal$1, o.emptyArray = Object.freeze ? Object.freeze([]) : (
|
|
878
1038
|
/* istanbul ignore next */
|
|
879
1039
|
[]
|
|
@@ -881,68 +1041,68 @@ function requireMinimal$1() {
|
|
|
881
1041
|
/* istanbul ignore next */
|
|
882
1042
|
{}
|
|
883
1043
|
), o.isInteger = Number.isInteger || /* istanbul ignore next */
|
|
884
|
-
function(
|
|
885
|
-
return typeof
|
|
886
|
-
}, o.isString = function(
|
|
887
|
-
return typeof
|
|
888
|
-
}, o.isObject = function(
|
|
889
|
-
return
|
|
1044
|
+
function(r) {
|
|
1045
|
+
return typeof r == "number" && isFinite(r) && Math.floor(r) === r;
|
|
1046
|
+
}, o.isString = function(r) {
|
|
1047
|
+
return typeof r == "string" || r instanceof String;
|
|
1048
|
+
}, o.isObject = function(r) {
|
|
1049
|
+
return r && typeof r == "object";
|
|
890
1050
|
}, o.isset = /**
|
|
891
1051
|
* Checks if a property on a message is considered to be present.
|
|
892
1052
|
* @param {Object} obj Plain object or message instance
|
|
893
1053
|
* @param {string} prop Property name
|
|
894
1054
|
* @returns {boolean} `true` if considered to be present, otherwise `false`
|
|
895
1055
|
*/
|
|
896
|
-
o.isSet = function(
|
|
897
|
-
var
|
|
898
|
-
return
|
|
1056
|
+
o.isSet = function(r, i) {
|
|
1057
|
+
var t = r[i];
|
|
1058
|
+
return t != null && r.hasOwnProperty(i) ? typeof t != "object" || (Array.isArray(t) ? t.length : Object.keys(t).length) > 0 : !1;
|
|
899
1059
|
}, o.Buffer = function() {
|
|
900
1060
|
try {
|
|
901
|
-
var
|
|
902
|
-
return
|
|
1061
|
+
var n = o.inquire("buffer").Buffer;
|
|
1062
|
+
return n.prototype.utf8Write ? n : (
|
|
903
1063
|
/* istanbul ignore next */
|
|
904
1064
|
null
|
|
905
1065
|
);
|
|
906
1066
|
} catch {
|
|
907
1067
|
return null;
|
|
908
1068
|
}
|
|
909
|
-
}(), o._Buffer_from = null, o._Buffer_allocUnsafe = null, o.newBuffer = function(
|
|
910
|
-
return typeof
|
|
1069
|
+
}(), o._Buffer_from = null, o._Buffer_allocUnsafe = null, o.newBuffer = function(r) {
|
|
1070
|
+
return typeof r == "number" ? o.Buffer ? o._Buffer_allocUnsafe(r) : new o.Array(r) : o.Buffer ? o._Buffer_from(r) : typeof Uint8Array > "u" ? r : new Uint8Array(r);
|
|
911
1071
|
}, o.Array = typeof Uint8Array < "u" ? Uint8Array : Array, o.Long = /* istanbul ignore next */
|
|
912
1072
|
o.global.dcodeIO && /* istanbul ignore next */
|
|
913
1073
|
o.global.dcodeIO.Long || /* istanbul ignore next */
|
|
914
|
-
o.global.Long || o.inquire("long"), o.key2Re = /^true|false|0|1$/, o.key32Re = /^-?(?:0|[1-9][0-9]*)$/, o.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/, o.longToHash = function(
|
|
915
|
-
return
|
|
916
|
-
}, o.longFromHash = function(
|
|
917
|
-
var
|
|
918
|
-
return o.Long ? o.Long.fromBits(
|
|
1074
|
+
o.global.Long || o.inquire("long"), o.key2Re = /^true|false|0|1$/, o.key32Re = /^-?(?:0|[1-9][0-9]*)$/, o.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/, o.longToHash = function(r) {
|
|
1075
|
+
return r ? o.LongBits.from(r).toHash() : o.LongBits.zeroHash;
|
|
1076
|
+
}, o.longFromHash = function(r, i) {
|
|
1077
|
+
var t = o.LongBits.fromHash(r);
|
|
1078
|
+
return o.Long ? o.Long.fromBits(t.lo, t.hi, i) : t.toNumber(!!i);
|
|
919
1079
|
};
|
|
920
|
-
function
|
|
921
|
-
for (var
|
|
922
|
-
(
|
|
923
|
-
return
|
|
1080
|
+
function a(n, r, i) {
|
|
1081
|
+
for (var t = Object.keys(r), e = 0; e < t.length; ++e)
|
|
1082
|
+
(n[t[e]] === void 0 || !i) && (n[t[e]] = r[t[e]]);
|
|
1083
|
+
return n;
|
|
924
1084
|
}
|
|
925
|
-
o.merge =
|
|
926
|
-
return
|
|
1085
|
+
o.merge = a, o.lcFirst = function(r) {
|
|
1086
|
+
return r.charAt(0).toLowerCase() + r.substring(1);
|
|
927
1087
|
};
|
|
928
|
-
function
|
|
929
|
-
function
|
|
930
|
-
if (!(this instanceof
|
|
931
|
-
return new
|
|
1088
|
+
function u(n) {
|
|
1089
|
+
function r(i, t) {
|
|
1090
|
+
if (!(this instanceof r))
|
|
1091
|
+
return new r(i, t);
|
|
932
1092
|
Object.defineProperty(this, "message", { get: function() {
|
|
933
1093
|
return i;
|
|
934
|
-
} }), Error.captureStackTrace ? Error.captureStackTrace(this,
|
|
1094
|
+
} }), Error.captureStackTrace ? Error.captureStackTrace(this, r) : Object.defineProperty(this, "stack", { value: new Error().stack || "" }), t && a(this, t);
|
|
935
1095
|
}
|
|
936
|
-
return
|
|
1096
|
+
return r.prototype = Object.create(Error.prototype, {
|
|
937
1097
|
constructor: {
|
|
938
|
-
value:
|
|
1098
|
+
value: r,
|
|
939
1099
|
writable: !0,
|
|
940
1100
|
enumerable: !1,
|
|
941
1101
|
configurable: !0
|
|
942
1102
|
},
|
|
943
1103
|
name: {
|
|
944
1104
|
get: function() {
|
|
945
|
-
return
|
|
1105
|
+
return n;
|
|
946
1106
|
},
|
|
947
1107
|
set: void 0,
|
|
948
1108
|
enumerable: !1,
|
|
@@ -960,20 +1120,20 @@ function requireMinimal$1() {
|
|
|
960
1120
|
enumerable: !1,
|
|
961
1121
|
configurable: !0
|
|
962
1122
|
}
|
|
963
|
-
}),
|
|
1123
|
+
}), r;
|
|
964
1124
|
}
|
|
965
|
-
o.newError =
|
|
966
|
-
for (var i = {},
|
|
967
|
-
i[
|
|
1125
|
+
o.newError = u, o.ProtocolError = u("ProtocolError"), o.oneOfGetter = function(r) {
|
|
1126
|
+
for (var i = {}, t = 0; t < r.length; ++t)
|
|
1127
|
+
i[r[t]] = 1;
|
|
968
1128
|
return function() {
|
|
969
|
-
for (var
|
|
970
|
-
if (i[
|
|
971
|
-
return
|
|
1129
|
+
for (var e = Object.keys(this), s = e.length - 1; s > -1; --s)
|
|
1130
|
+
if (i[e[s]] === 1 && this[e[s]] !== void 0 && this[e[s]] !== null)
|
|
1131
|
+
return e[s];
|
|
972
1132
|
};
|
|
973
|
-
}, o.oneOfSetter = function(
|
|
1133
|
+
}, o.oneOfSetter = function(r) {
|
|
974
1134
|
return function(i) {
|
|
975
|
-
for (var
|
|
976
|
-
|
|
1135
|
+
for (var t = 0; t < r.length; ++t)
|
|
1136
|
+
r[t] !== i && delete this[r[t]];
|
|
977
1137
|
};
|
|
978
1138
|
}, o.toJSONOptions = {
|
|
979
1139
|
longs: String,
|
|
@@ -981,17 +1141,17 @@ function requireMinimal$1() {
|
|
|
981
1141
|
bytes: String,
|
|
982
1142
|
json: !0
|
|
983
1143
|
}, o._configure = function() {
|
|
984
|
-
var
|
|
985
|
-
if (!
|
|
1144
|
+
var n = o.Buffer;
|
|
1145
|
+
if (!n) {
|
|
986
1146
|
o._Buffer_from = o._Buffer_allocUnsafe = null;
|
|
987
1147
|
return;
|
|
988
1148
|
}
|
|
989
|
-
o._Buffer_from =
|
|
990
|
-
function(i,
|
|
991
|
-
return new
|
|
992
|
-
}, o._Buffer_allocUnsafe =
|
|
1149
|
+
o._Buffer_from = n.from !== Uint8Array.from && n.from || /* istanbul ignore next */
|
|
1150
|
+
function(i, t) {
|
|
1151
|
+
return new n(i, t);
|
|
1152
|
+
}, o._Buffer_allocUnsafe = n.allocUnsafe || /* istanbul ignore next */
|
|
993
1153
|
function(i) {
|
|
994
|
-
return new
|
|
1154
|
+
return new n(i);
|
|
995
1155
|
};
|
|
996
1156
|
};
|
|
997
1157
|
}(minimal$1)), minimal$1;
|
|
@@ -999,277 +1159,277 @@ function requireMinimal$1() {
|
|
|
999
1159
|
var writer, hasRequiredWriter;
|
|
1000
1160
|
function requireWriter() {
|
|
1001
1161
|
if (hasRequiredWriter) return writer;
|
|
1002
|
-
hasRequiredWriter = 1, writer =
|
|
1003
|
-
var
|
|
1004
|
-
function
|
|
1005
|
-
this.fn =
|
|
1162
|
+
hasRequiredWriter = 1, writer = e;
|
|
1163
|
+
var h = requireMinimal$1(), o, a = h.LongBits, u = h.base64, n = h.utf8;
|
|
1164
|
+
function r(b, g, k) {
|
|
1165
|
+
this.fn = b, this.len = g, this.next = void 0, this.val = k;
|
|
1006
1166
|
}
|
|
1007
1167
|
function i() {
|
|
1008
1168
|
}
|
|
1009
|
-
function
|
|
1010
|
-
this.head =
|
|
1169
|
+
function t(b) {
|
|
1170
|
+
this.head = b.head, this.tail = b.tail, this.len = b.len, this.next = b.states;
|
|
1011
1171
|
}
|
|
1012
|
-
function
|
|
1013
|
-
this.len = 0, this.head = new
|
|
1172
|
+
function e() {
|
|
1173
|
+
this.len = 0, this.head = new r(i, 0, 0), this.tail = this.head, this.states = null;
|
|
1014
1174
|
}
|
|
1015
1175
|
var s = function() {
|
|
1016
|
-
return
|
|
1017
|
-
return (
|
|
1176
|
+
return h.Buffer ? function() {
|
|
1177
|
+
return (e.create = function() {
|
|
1018
1178
|
return new o();
|
|
1019
1179
|
})();
|
|
1020
1180
|
} : function() {
|
|
1021
|
-
return new
|
|
1181
|
+
return new e();
|
|
1022
1182
|
};
|
|
1023
1183
|
};
|
|
1024
|
-
|
|
1025
|
-
return new
|
|
1026
|
-
},
|
|
1027
|
-
return this.tail = this.tail.next = new
|
|
1184
|
+
e.create = s(), e.alloc = function(g) {
|
|
1185
|
+
return new h.Array(g);
|
|
1186
|
+
}, h.Array !== Array && (e.alloc = h.pool(e.alloc, h.Array.prototype.subarray)), e.prototype._push = function(g, k, _) {
|
|
1187
|
+
return this.tail = this.tail.next = new r(g, k, _), this.len += k, this;
|
|
1028
1188
|
};
|
|
1029
|
-
function l(
|
|
1030
|
-
|
|
1189
|
+
function l(b, g, k) {
|
|
1190
|
+
g[k] = b & 255;
|
|
1031
1191
|
}
|
|
1032
|
-
function
|
|
1033
|
-
for (;
|
|
1034
|
-
|
|
1035
|
-
|
|
1192
|
+
function c(b, g, k) {
|
|
1193
|
+
for (; b > 127; )
|
|
1194
|
+
g[k++] = b & 127 | 128, b >>>= 7;
|
|
1195
|
+
g[k] = b;
|
|
1036
1196
|
}
|
|
1037
|
-
function d(
|
|
1038
|
-
this.len =
|
|
1197
|
+
function d(b, g) {
|
|
1198
|
+
this.len = b, this.next = void 0, this.val = g;
|
|
1039
1199
|
}
|
|
1040
|
-
d.prototype = Object.create(
|
|
1200
|
+
d.prototype = Object.create(r.prototype), d.prototype.fn = c, e.prototype.uint32 = function(g) {
|
|
1041
1201
|
return this.len += (this.tail = this.tail.next = new d(
|
|
1042
|
-
(
|
|
1043
|
-
|
|
1202
|
+
(g = g >>> 0) < 128 ? 1 : g < 16384 ? 2 : g < 2097152 ? 3 : g < 268435456 ? 4 : 5,
|
|
1203
|
+
g
|
|
1044
1204
|
)).len, this;
|
|
1045
|
-
},
|
|
1046
|
-
return
|
|
1047
|
-
},
|
|
1048
|
-
return this.uint32((
|
|
1205
|
+
}, e.prototype.int32 = function(g) {
|
|
1206
|
+
return g < 0 ? this._push(p, 10, a.fromNumber(g)) : this.uint32(g);
|
|
1207
|
+
}, e.prototype.sint32 = function(g) {
|
|
1208
|
+
return this.uint32((g << 1 ^ g >> 31) >>> 0);
|
|
1049
1209
|
};
|
|
1050
|
-
function
|
|
1051
|
-
for (;
|
|
1052
|
-
|
|
1053
|
-
for (;
|
|
1054
|
-
|
|
1055
|
-
|
|
1210
|
+
function p(b, g, k) {
|
|
1211
|
+
for (; b.hi; )
|
|
1212
|
+
g[k++] = b.lo & 127 | 128, b.lo = (b.lo >>> 7 | b.hi << 25) >>> 0, b.hi >>>= 7;
|
|
1213
|
+
for (; b.lo > 127; )
|
|
1214
|
+
g[k++] = b.lo & 127 | 128, b.lo = b.lo >>> 7;
|
|
1215
|
+
g[k++] = b.lo;
|
|
1056
1216
|
}
|
|
1057
|
-
|
|
1058
|
-
var
|
|
1059
|
-
return this._push(
|
|
1060
|
-
},
|
|
1061
|
-
var
|
|
1062
|
-
return this._push(
|
|
1063
|
-
},
|
|
1064
|
-
return this._push(l, 1,
|
|
1217
|
+
e.prototype.uint64 = function(g) {
|
|
1218
|
+
var k = a.from(g);
|
|
1219
|
+
return this._push(p, k.length(), k);
|
|
1220
|
+
}, e.prototype.int64 = e.prototype.uint64, e.prototype.sint64 = function(g) {
|
|
1221
|
+
var k = a.from(g).zzEncode();
|
|
1222
|
+
return this._push(p, k.length(), k);
|
|
1223
|
+
}, e.prototype.bool = function(g) {
|
|
1224
|
+
return this._push(l, 1, g ? 1 : 0);
|
|
1065
1225
|
};
|
|
1066
|
-
function
|
|
1067
|
-
|
|
1226
|
+
function f(b, g, k) {
|
|
1227
|
+
g[k] = b & 255, g[k + 1] = b >>> 8 & 255, g[k + 2] = b >>> 16 & 255, g[k + 3] = b >>> 24;
|
|
1068
1228
|
}
|
|
1069
|
-
|
|
1070
|
-
return this._push(
|
|
1071
|
-
},
|
|
1072
|
-
var
|
|
1073
|
-
return this._push(
|
|
1074
|
-
},
|
|
1075
|
-
return this._push(
|
|
1076
|
-
},
|
|
1077
|
-
return this._push(
|
|
1229
|
+
e.prototype.fixed32 = function(g) {
|
|
1230
|
+
return this._push(f, 4, g >>> 0);
|
|
1231
|
+
}, e.prototype.sfixed32 = e.prototype.fixed32, e.prototype.fixed64 = function(g) {
|
|
1232
|
+
var k = a.from(g);
|
|
1233
|
+
return this._push(f, 4, k.lo)._push(f, 4, k.hi);
|
|
1234
|
+
}, e.prototype.sfixed64 = e.prototype.fixed64, e.prototype.float = function(g) {
|
|
1235
|
+
return this._push(h.float.writeFloatLE, 4, g);
|
|
1236
|
+
}, e.prototype.double = function(g) {
|
|
1237
|
+
return this._push(h.float.writeDoubleLE, 8, g);
|
|
1078
1238
|
};
|
|
1079
|
-
var w =
|
|
1080
|
-
|
|
1081
|
-
} : function(
|
|
1082
|
-
for (var
|
|
1083
|
-
|
|
1239
|
+
var w = h.Array.prototype.set ? function(g, k, _) {
|
|
1240
|
+
k.set(g, _);
|
|
1241
|
+
} : function(g, k, _) {
|
|
1242
|
+
for (var R = 0; R < g.length; ++R)
|
|
1243
|
+
k[_ + R] = g[R];
|
|
1084
1244
|
};
|
|
1085
|
-
return
|
|
1086
|
-
var
|
|
1087
|
-
if (!
|
|
1245
|
+
return e.prototype.bytes = function(g) {
|
|
1246
|
+
var k = g.length >>> 0;
|
|
1247
|
+
if (!k)
|
|
1088
1248
|
return this._push(l, 1, 0);
|
|
1089
|
-
if (
|
|
1090
|
-
var
|
|
1091
|
-
|
|
1249
|
+
if (h.isString(g)) {
|
|
1250
|
+
var _ = e.alloc(k = u.length(g));
|
|
1251
|
+
u.decode(g, _, 0), g = _;
|
|
1092
1252
|
}
|
|
1093
|
-
return this.uint32(
|
|
1094
|
-
},
|
|
1095
|
-
var
|
|
1096
|
-
return
|
|
1097
|
-
},
|
|
1098
|
-
return this.states = new
|
|
1099
|
-
},
|
|
1100
|
-
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
|
|
1101
|
-
},
|
|
1102
|
-
var
|
|
1103
|
-
return this.reset().uint32(
|
|
1104
|
-
},
|
|
1105
|
-
for (var
|
|
1106
|
-
|
|
1107
|
-
return
|
|
1108
|
-
},
|
|
1109
|
-
o =
|
|
1253
|
+
return this.uint32(k)._push(w, k, g);
|
|
1254
|
+
}, e.prototype.string = function(g) {
|
|
1255
|
+
var k = n.length(g);
|
|
1256
|
+
return k ? this.uint32(k)._push(n.write, k, g) : this._push(l, 1, 0);
|
|
1257
|
+
}, e.prototype.fork = function() {
|
|
1258
|
+
return this.states = new t(this), this.head = this.tail = new r(i, 0, 0), this.len = 0, this;
|
|
1259
|
+
}, e.prototype.reset = function() {
|
|
1260
|
+
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 r(i, 0, 0), this.len = 0), this;
|
|
1261
|
+
}, e.prototype.ldelim = function() {
|
|
1262
|
+
var g = this.head, k = this.tail, _ = this.len;
|
|
1263
|
+
return this.reset().uint32(_), _ && (this.tail.next = g.next, this.tail = k, this.len += _), this;
|
|
1264
|
+
}, e.prototype.finish = function() {
|
|
1265
|
+
for (var g = this.head.next, k = this.constructor.alloc(this.len), _ = 0; g; )
|
|
1266
|
+
g.fn(g.val, k, _), _ += g.len, g = g.next;
|
|
1267
|
+
return k;
|
|
1268
|
+
}, e._configure = function(b) {
|
|
1269
|
+
o = b, e.create = s(), o._configure();
|
|
1110
1270
|
}, writer;
|
|
1111
1271
|
}
|
|
1112
1272
|
var writer_buffer, hasRequiredWriter_buffer;
|
|
1113
1273
|
function requireWriter_buffer() {
|
|
1114
1274
|
if (hasRequiredWriter_buffer) return writer_buffer;
|
|
1115
|
-
hasRequiredWriter_buffer = 1, writer_buffer =
|
|
1116
|
-
var
|
|
1117
|
-
(
|
|
1275
|
+
hasRequiredWriter_buffer = 1, writer_buffer = a;
|
|
1276
|
+
var h = requireWriter();
|
|
1277
|
+
(a.prototype = Object.create(h.prototype)).constructor = a;
|
|
1118
1278
|
var o = requireMinimal$1();
|
|
1119
|
-
function
|
|
1120
|
-
|
|
1279
|
+
function a() {
|
|
1280
|
+
h.call(this);
|
|
1121
1281
|
}
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
i.set(
|
|
1125
|
-
} : function(
|
|
1126
|
-
if (
|
|
1127
|
-
|
|
1128
|
-
else for (var
|
|
1129
|
-
i[
|
|
1282
|
+
a._configure = function() {
|
|
1283
|
+
a.alloc = o._Buffer_allocUnsafe, a.writeBytesBuffer = o.Buffer && o.Buffer.prototype instanceof Uint8Array && o.Buffer.prototype.set.name === "set" ? function(r, i, t) {
|
|
1284
|
+
i.set(r, t);
|
|
1285
|
+
} : function(r, i, t) {
|
|
1286
|
+
if (r.copy)
|
|
1287
|
+
r.copy(i, t, 0, r.length);
|
|
1288
|
+
else for (var e = 0; e < r.length; )
|
|
1289
|
+
i[t++] = r[e++];
|
|
1130
1290
|
};
|
|
1131
|
-
},
|
|
1132
|
-
o.isString(
|
|
1133
|
-
var i =
|
|
1134
|
-
return this.uint32(i), i && this._push(
|
|
1291
|
+
}, a.prototype.bytes = function(r) {
|
|
1292
|
+
o.isString(r) && (r = o._Buffer_from(r, "base64"));
|
|
1293
|
+
var i = r.length >>> 0;
|
|
1294
|
+
return this.uint32(i), i && this._push(a.writeBytesBuffer, i, r), this;
|
|
1135
1295
|
};
|
|
1136
|
-
function
|
|
1137
|
-
|
|
1296
|
+
function u(n, r, i) {
|
|
1297
|
+
n.length < 40 ? o.utf8.write(n, r, i) : r.utf8Write ? r.utf8Write(n, i) : r.write(n, i);
|
|
1138
1298
|
}
|
|
1139
|
-
return
|
|
1140
|
-
var i = o.Buffer.byteLength(
|
|
1141
|
-
return this.uint32(i), i && this._push(
|
|
1142
|
-
},
|
|
1299
|
+
return a.prototype.string = function(r) {
|
|
1300
|
+
var i = o.Buffer.byteLength(r);
|
|
1301
|
+
return this.uint32(i), i && this._push(u, i, r), this;
|
|
1302
|
+
}, a._configure(), writer_buffer;
|
|
1143
1303
|
}
|
|
1144
1304
|
var reader, hasRequiredReader;
|
|
1145
1305
|
function requireReader() {
|
|
1146
1306
|
if (hasRequiredReader) return reader;
|
|
1147
|
-
hasRequiredReader = 1, reader =
|
|
1148
|
-
var
|
|
1149
|
-
function
|
|
1150
|
-
return RangeError("index out of range: " +
|
|
1307
|
+
hasRequiredReader = 1, reader = r;
|
|
1308
|
+
var h = requireMinimal$1(), o, a = h.LongBits, u = h.utf8;
|
|
1309
|
+
function n(c, d) {
|
|
1310
|
+
return RangeError("index out of range: " + c.pos + " + " + (d || 1) + " > " + c.len);
|
|
1151
1311
|
}
|
|
1152
|
-
function
|
|
1153
|
-
this.buf =
|
|
1312
|
+
function r(c) {
|
|
1313
|
+
this.buf = c, this.pos = 0, this.len = c.length;
|
|
1154
1314
|
}
|
|
1155
1315
|
var i = typeof Uint8Array < "u" ? function(d) {
|
|
1156
1316
|
if (d instanceof Uint8Array || Array.isArray(d))
|
|
1157
|
-
return new
|
|
1317
|
+
return new r(d);
|
|
1158
1318
|
throw Error("illegal buffer");
|
|
1159
1319
|
} : function(d) {
|
|
1160
1320
|
if (Array.isArray(d))
|
|
1161
|
-
return new
|
|
1321
|
+
return new r(d);
|
|
1162
1322
|
throw Error("illegal buffer");
|
|
1163
|
-
},
|
|
1164
|
-
return
|
|
1165
|
-
return (
|
|
1166
|
-
return
|
|
1167
|
-
})(
|
|
1323
|
+
}, t = function() {
|
|
1324
|
+
return h.Buffer ? function(p) {
|
|
1325
|
+
return (r.create = function(w) {
|
|
1326
|
+
return h.Buffer.isBuffer(w) ? new o(w) : i(w);
|
|
1327
|
+
})(p);
|
|
1168
1328
|
} : i;
|
|
1169
1329
|
};
|
|
1170
|
-
|
|
1171
|
-
|
|
1330
|
+
r.create = t(), r.prototype._slice = h.Array.prototype.subarray || /* istanbul ignore next */
|
|
1331
|
+
h.Array.prototype.slice, r.prototype.uint32 = /* @__PURE__ */ function() {
|
|
1172
1332
|
var d = 4294967295;
|
|
1173
1333
|
return function() {
|
|
1174
1334
|
if (d = (this.buf[this.pos] & 127) >>> 0, this.buf[this.pos++] < 128 || (d = (d | (this.buf[this.pos] & 127) << 7) >>> 0, this.buf[this.pos++] < 128) || (d = (d | (this.buf[this.pos] & 127) << 14) >>> 0, this.buf[this.pos++] < 128) || (d = (d | (this.buf[this.pos] & 127) << 21) >>> 0, this.buf[this.pos++] < 128) || (d = (d | (this.buf[this.pos] & 15) << 28) >>> 0, this.buf[this.pos++] < 128)) return d;
|
|
1175
1335
|
if ((this.pos += 5) > this.len)
|
|
1176
|
-
throw this.pos = this.len,
|
|
1336
|
+
throw this.pos = this.len, n(this, 10);
|
|
1177
1337
|
return d;
|
|
1178
1338
|
};
|
|
1179
|
-
}(),
|
|
1339
|
+
}(), r.prototype.int32 = function() {
|
|
1180
1340
|
return this.uint32() | 0;
|
|
1181
|
-
},
|
|
1341
|
+
}, r.prototype.sint32 = function() {
|
|
1182
1342
|
var d = this.uint32();
|
|
1183
1343
|
return d >>> 1 ^ -(d & 1) | 0;
|
|
1184
1344
|
};
|
|
1185
|
-
function
|
|
1186
|
-
var
|
|
1345
|
+
function e() {
|
|
1346
|
+
var c = new a(0, 0), d = 0;
|
|
1187
1347
|
if (this.len - this.pos > 4) {
|
|
1188
1348
|
for (; d < 4; ++d)
|
|
1189
|
-
if (
|
|
1190
|
-
return
|
|
1191
|
-
if (
|
|
1192
|
-
return
|
|
1349
|
+
if (c.lo = (c.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
|
|
1350
|
+
return c;
|
|
1351
|
+
if (c.lo = (c.lo | (this.buf[this.pos] & 127) << 28) >>> 0, c.hi = (c.hi | (this.buf[this.pos] & 127) >> 4) >>> 0, this.buf[this.pos++] < 128)
|
|
1352
|
+
return c;
|
|
1193
1353
|
d = 0;
|
|
1194
1354
|
} else {
|
|
1195
1355
|
for (; d < 3; ++d) {
|
|
1196
1356
|
if (this.pos >= this.len)
|
|
1197
|
-
throw
|
|
1198
|
-
if (
|
|
1199
|
-
return
|
|
1357
|
+
throw n(this);
|
|
1358
|
+
if (c.lo = (c.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
|
|
1359
|
+
return c;
|
|
1200
1360
|
}
|
|
1201
|
-
return
|
|
1361
|
+
return c.lo = (c.lo | (this.buf[this.pos++] & 127) << d * 7) >>> 0, c;
|
|
1202
1362
|
}
|
|
1203
1363
|
if (this.len - this.pos > 4) {
|
|
1204
1364
|
for (; d < 5; ++d)
|
|
1205
|
-
if (
|
|
1206
|
-
return
|
|
1365
|
+
if (c.hi = (c.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
|
|
1366
|
+
return c;
|
|
1207
1367
|
} else
|
|
1208
1368
|
for (; d < 5; ++d) {
|
|
1209
1369
|
if (this.pos >= this.len)
|
|
1210
|
-
throw
|
|
1211
|
-
if (
|
|
1212
|
-
return
|
|
1370
|
+
throw n(this);
|
|
1371
|
+
if (c.hi = (c.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
|
|
1372
|
+
return c;
|
|
1213
1373
|
}
|
|
1214
1374
|
throw Error("invalid varint encoding");
|
|
1215
1375
|
}
|
|
1216
|
-
|
|
1376
|
+
r.prototype.bool = function() {
|
|
1217
1377
|
return this.uint32() !== 0;
|
|
1218
1378
|
};
|
|
1219
|
-
function s(
|
|
1220
|
-
return (
|
|
1379
|
+
function s(c, d) {
|
|
1380
|
+
return (c[d - 4] | c[d - 3] << 8 | c[d - 2] << 16 | c[d - 1] << 24) >>> 0;
|
|
1221
1381
|
}
|
|
1222
|
-
|
|
1382
|
+
r.prototype.fixed32 = function() {
|
|
1223
1383
|
if (this.pos + 4 > this.len)
|
|
1224
|
-
throw
|
|
1384
|
+
throw n(this, 4);
|
|
1225
1385
|
return s(this.buf, this.pos += 4);
|
|
1226
|
-
},
|
|
1386
|
+
}, r.prototype.sfixed32 = function() {
|
|
1227
1387
|
if (this.pos + 4 > this.len)
|
|
1228
|
-
throw
|
|
1388
|
+
throw n(this, 4);
|
|
1229
1389
|
return s(this.buf, this.pos += 4) | 0;
|
|
1230
1390
|
};
|
|
1231
1391
|
function l() {
|
|
1232
1392
|
if (this.pos + 8 > this.len)
|
|
1233
|
-
throw
|
|
1234
|
-
return new
|
|
1393
|
+
throw n(this, 8);
|
|
1394
|
+
return new a(s(this.buf, this.pos += 4), s(this.buf, this.pos += 4));
|
|
1235
1395
|
}
|
|
1236
|
-
return
|
|
1396
|
+
return r.prototype.float = function() {
|
|
1237
1397
|
if (this.pos + 4 > this.len)
|
|
1238
|
-
throw
|
|
1239
|
-
var d =
|
|
1398
|
+
throw n(this, 4);
|
|
1399
|
+
var d = h.float.readFloatLE(this.buf, this.pos);
|
|
1240
1400
|
return this.pos += 4, d;
|
|
1241
|
-
},
|
|
1401
|
+
}, r.prototype.double = function() {
|
|
1242
1402
|
if (this.pos + 8 > this.len)
|
|
1243
|
-
throw
|
|
1244
|
-
var d =
|
|
1403
|
+
throw n(this, 4);
|
|
1404
|
+
var d = h.float.readDoubleLE(this.buf, this.pos);
|
|
1245
1405
|
return this.pos += 8, d;
|
|
1246
|
-
},
|
|
1247
|
-
var d = this.uint32(),
|
|
1248
|
-
if (
|
|
1249
|
-
throw
|
|
1406
|
+
}, r.prototype.bytes = function() {
|
|
1407
|
+
var d = this.uint32(), p = this.pos, f = this.pos + d;
|
|
1408
|
+
if (f > this.len)
|
|
1409
|
+
throw n(this, d);
|
|
1250
1410
|
if (this.pos += d, Array.isArray(this.buf))
|
|
1251
|
-
return this.buf.slice(
|
|
1252
|
-
if (
|
|
1253
|
-
var w =
|
|
1411
|
+
return this.buf.slice(p, f);
|
|
1412
|
+
if (p === f) {
|
|
1413
|
+
var w = h.Buffer;
|
|
1254
1414
|
return w ? w.alloc(0) : new this.buf.constructor(0);
|
|
1255
1415
|
}
|
|
1256
|
-
return this._slice.call(this.buf,
|
|
1257
|
-
},
|
|
1416
|
+
return this._slice.call(this.buf, p, f);
|
|
1417
|
+
}, r.prototype.string = function() {
|
|
1258
1418
|
var d = this.bytes();
|
|
1259
|
-
return
|
|
1260
|
-
},
|
|
1419
|
+
return u.read(d, 0, d.length);
|
|
1420
|
+
}, r.prototype.skip = function(d) {
|
|
1261
1421
|
if (typeof d == "number") {
|
|
1262
1422
|
if (this.pos + d > this.len)
|
|
1263
|
-
throw
|
|
1423
|
+
throw n(this, d);
|
|
1264
1424
|
this.pos += d;
|
|
1265
1425
|
} else
|
|
1266
1426
|
do
|
|
1267
1427
|
if (this.pos >= this.len)
|
|
1268
|
-
throw
|
|
1428
|
+
throw n(this);
|
|
1269
1429
|
while (this.buf[this.pos++] & 128);
|
|
1270
1430
|
return this;
|
|
1271
|
-
},
|
|
1272
|
-
switch (
|
|
1431
|
+
}, r.prototype.skipType = function(c) {
|
|
1432
|
+
switch (c) {
|
|
1273
1433
|
case 0:
|
|
1274
1434
|
this.skip();
|
|
1275
1435
|
break;
|
|
@@ -1280,32 +1440,32 @@ function requireReader() {
|
|
|
1280
1440
|
this.skip(this.uint32());
|
|
1281
1441
|
break;
|
|
1282
1442
|
case 3:
|
|
1283
|
-
for (; (
|
|
1284
|
-
this.skipType(
|
|
1443
|
+
for (; (c = this.uint32() & 7) !== 4; )
|
|
1444
|
+
this.skipType(c);
|
|
1285
1445
|
break;
|
|
1286
1446
|
case 5:
|
|
1287
1447
|
this.skip(4);
|
|
1288
1448
|
break;
|
|
1289
1449
|
/* istanbul ignore next */
|
|
1290
1450
|
default:
|
|
1291
|
-
throw Error("invalid wire type " +
|
|
1451
|
+
throw Error("invalid wire type " + c + " at offset " + this.pos);
|
|
1292
1452
|
}
|
|
1293
1453
|
return this;
|
|
1294
|
-
},
|
|
1295
|
-
o =
|
|
1296
|
-
var d =
|
|
1454
|
+
}, r._configure = function(c) {
|
|
1455
|
+
o = c, r.create = t(), o._configure();
|
|
1456
|
+
var d = h.Long ? "toLong" : (
|
|
1297
1457
|
/* istanbul ignore next */
|
|
1298
1458
|
"toNumber"
|
|
1299
1459
|
);
|
|
1300
|
-
|
|
1460
|
+
h.merge(r.prototype, {
|
|
1301
1461
|
int64: function() {
|
|
1302
|
-
return
|
|
1462
|
+
return e.call(this)[d](!1);
|
|
1303
1463
|
},
|
|
1304
1464
|
uint64: function() {
|
|
1305
|
-
return
|
|
1465
|
+
return e.call(this)[d](!0);
|
|
1306
1466
|
},
|
|
1307
1467
|
sint64: function() {
|
|
1308
|
-
return
|
|
1468
|
+
return e.call(this).zzDecode()[d](!1);
|
|
1309
1469
|
},
|
|
1310
1470
|
fixed64: function() {
|
|
1311
1471
|
return l.call(this)[d](!0);
|
|
@@ -1319,80 +1479,80 @@ function requireReader() {
|
|
|
1319
1479
|
var reader_buffer, hasRequiredReader_buffer;
|
|
1320
1480
|
function requireReader_buffer() {
|
|
1321
1481
|
if (hasRequiredReader_buffer) return reader_buffer;
|
|
1322
|
-
hasRequiredReader_buffer = 1, reader_buffer =
|
|
1323
|
-
var
|
|
1324
|
-
(
|
|
1482
|
+
hasRequiredReader_buffer = 1, reader_buffer = a;
|
|
1483
|
+
var h = requireReader();
|
|
1484
|
+
(a.prototype = Object.create(h.prototype)).constructor = a;
|
|
1325
1485
|
var o = requireMinimal$1();
|
|
1326
|
-
function u
|
|
1327
|
-
|
|
1486
|
+
function a(u) {
|
|
1487
|
+
h.call(this, u);
|
|
1328
1488
|
}
|
|
1329
|
-
return
|
|
1330
|
-
o.Buffer && (
|
|
1331
|
-
},
|
|
1332
|
-
var
|
|
1333
|
-
return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos +
|
|
1334
|
-
},
|
|
1489
|
+
return a._configure = function() {
|
|
1490
|
+
o.Buffer && (a.prototype._slice = o.Buffer.prototype.slice);
|
|
1491
|
+
}, a.prototype.string = function() {
|
|
1492
|
+
var n = this.uint32();
|
|
1493
|
+
return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + n, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + n, this.len));
|
|
1494
|
+
}, a._configure(), reader_buffer;
|
|
1335
1495
|
}
|
|
1336
1496
|
var rpc = {}, service, hasRequiredService;
|
|
1337
1497
|
function requireService() {
|
|
1338
1498
|
if (hasRequiredService) return service;
|
|
1339
1499
|
hasRequiredService = 1, service = o;
|
|
1340
|
-
var
|
|
1341
|
-
(o.prototype = Object.create(
|
|
1342
|
-
function o(
|
|
1343
|
-
if (typeof
|
|
1500
|
+
var h = requireMinimal$1();
|
|
1501
|
+
(o.prototype = Object.create(h.EventEmitter.prototype)).constructor = o;
|
|
1502
|
+
function o(a, u, n) {
|
|
1503
|
+
if (typeof a != "function")
|
|
1344
1504
|
throw TypeError("rpcImpl must be a function");
|
|
1345
|
-
|
|
1505
|
+
h.EventEmitter.call(this), this.rpcImpl = a, this.requestDelimited = !!u, this.responseDelimited = !!n;
|
|
1346
1506
|
}
|
|
1347
|
-
return o.prototype.rpcCall = function u
|
|
1507
|
+
return o.prototype.rpcCall = function a(u, n, r, i, t) {
|
|
1348
1508
|
if (!i)
|
|
1349
1509
|
throw TypeError("request must be specified");
|
|
1350
|
-
var
|
|
1351
|
-
if (!
|
|
1352
|
-
return
|
|
1353
|
-
if (!
|
|
1510
|
+
var e = this;
|
|
1511
|
+
if (!t)
|
|
1512
|
+
return h.asPromise(a, e, u, n, r, i);
|
|
1513
|
+
if (!e.rpcImpl) {
|
|
1354
1514
|
setTimeout(function() {
|
|
1355
|
-
|
|
1515
|
+
t(Error("already ended"));
|
|
1356
1516
|
}, 0);
|
|
1357
1517
|
return;
|
|
1358
1518
|
}
|
|
1359
1519
|
try {
|
|
1360
|
-
return
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
function(l,
|
|
1520
|
+
return e.rpcImpl(
|
|
1521
|
+
u,
|
|
1522
|
+
n[e.requestDelimited ? "encodeDelimited" : "encode"](i).finish(),
|
|
1523
|
+
function(l, c) {
|
|
1364
1524
|
if (l)
|
|
1365
|
-
return
|
|
1366
|
-
if (
|
|
1367
|
-
|
|
1525
|
+
return e.emit("error", l, u), t(l);
|
|
1526
|
+
if (c === null) {
|
|
1527
|
+
e.end(
|
|
1368
1528
|
/* endedByRPC */
|
|
1369
1529
|
!0
|
|
1370
1530
|
);
|
|
1371
1531
|
return;
|
|
1372
1532
|
}
|
|
1373
|
-
if (!(
|
|
1533
|
+
if (!(c instanceof r))
|
|
1374
1534
|
try {
|
|
1375
|
-
|
|
1535
|
+
c = r[e.responseDelimited ? "decodeDelimited" : "decode"](c);
|
|
1376
1536
|
} catch (d) {
|
|
1377
|
-
return
|
|
1537
|
+
return e.emit("error", d, u), t(d);
|
|
1378
1538
|
}
|
|
1379
|
-
return
|
|
1539
|
+
return e.emit("data", c, u), t(null, c);
|
|
1380
1540
|
}
|
|
1381
1541
|
);
|
|
1382
1542
|
} catch (s) {
|
|
1383
|
-
|
|
1384
|
-
|
|
1543
|
+
e.emit("error", s, u), setTimeout(function() {
|
|
1544
|
+
t(s);
|
|
1385
1545
|
}, 0);
|
|
1386
1546
|
return;
|
|
1387
1547
|
}
|
|
1388
|
-
}, o.prototype.end = function(
|
|
1389
|
-
return this.rpcImpl && (
|
|
1548
|
+
}, o.prototype.end = function(u) {
|
|
1549
|
+
return this.rpcImpl && (u || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this;
|
|
1390
1550
|
}, service;
|
|
1391
1551
|
}
|
|
1392
1552
|
var hasRequiredRpc;
|
|
1393
1553
|
function requireRpc() {
|
|
1394
|
-
return hasRequiredRpc || (hasRequiredRpc = 1, function(
|
|
1395
|
-
var o =
|
|
1554
|
+
return hasRequiredRpc || (hasRequiredRpc = 1, function(h) {
|
|
1555
|
+
var o = h;
|
|
1396
1556
|
o.Service = requireService();
|
|
1397
1557
|
}(rpc)), rpc;
|
|
1398
1558
|
}
|
|
@@ -1402,13 +1562,13 @@ function requireRoots() {
|
|
|
1402
1562
|
}
|
|
1403
1563
|
var hasRequiredIndexMinimal;
|
|
1404
1564
|
function requireIndexMinimal() {
|
|
1405
|
-
return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(
|
|
1406
|
-
var o =
|
|
1407
|
-
o.build = "minimal", o.Writer = requireWriter(), o.BufferWriter = requireWriter_buffer(), o.Reader = requireReader(), o.BufferReader = requireReader_buffer(), o.util = requireMinimal$1(), o.rpc = requireRpc(), o.roots = requireRoots(), o.configure =
|
|
1408
|
-
function
|
|
1565
|
+
return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(h) {
|
|
1566
|
+
var o = h;
|
|
1567
|
+
o.build = "minimal", o.Writer = requireWriter(), o.BufferWriter = requireWriter_buffer(), o.Reader = requireReader(), o.BufferReader = requireReader_buffer(), o.util = requireMinimal$1(), o.rpc = requireRpc(), o.roots = requireRoots(), o.configure = a;
|
|
1568
|
+
function a() {
|
|
1409
1569
|
o.util._configure(), o.Writer._configure(o.BufferWriter), o.Reader._configure(o.BufferReader);
|
|
1410
1570
|
}
|
|
1411
|
-
|
|
1571
|
+
a();
|
|
1412
1572
|
}(indexMinimal)), indexMinimal;
|
|
1413
1573
|
}
|
|
1414
1574
|
var minimal, hasRequiredMinimal;
|
|
@@ -1417,42 +1577,42 @@ function requireMinimal() {
|
|
|
1417
1577
|
}
|
|
1418
1578
|
var minimalExports = requireMinimal();
|
|
1419
1579
|
const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util = minimalExports.util, $root = minimalExports.roots.default || (minimalExports.roots.default = {}), com = $root.com = (() => {
|
|
1420
|
-
const
|
|
1421
|
-
return
|
|
1580
|
+
const h = {};
|
|
1581
|
+
return h.quick = function() {
|
|
1422
1582
|
const o = {};
|
|
1423
1583
|
return o.voice = function() {
|
|
1424
|
-
const
|
|
1425
|
-
return
|
|
1426
|
-
const
|
|
1427
|
-
return
|
|
1428
|
-
function r
|
|
1429
|
-
if (
|
|
1584
|
+
const a = {};
|
|
1585
|
+
return a.proto = function() {
|
|
1586
|
+
const u = {};
|
|
1587
|
+
return u.SeiData = function() {
|
|
1588
|
+
function n(r) {
|
|
1589
|
+
if (r) for (let i = Object.keys(r), t = 0; t < i.length; ++t) r[i[t]] != null && (this[i[t]] = r[i[t]]);
|
|
1430
1590
|
}
|
|
1431
|
-
return
|
|
1432
|
-
return new
|
|
1433
|
-
},
|
|
1434
|
-
return
|
|
1591
|
+
return n.prototype.event = 0, n.prototype.data = $util.newBuffer([]), n.prototype.compress = !1, n.prototype.version = 0, n.create = function(i) {
|
|
1592
|
+
return new n(i);
|
|
1593
|
+
}, n.encode = function(i, t) {
|
|
1594
|
+
return t || (t = $Writer.create()), i.event != null && Object.hasOwnProperty.call(i, "event") && t.uint32(
|
|
1435
1595
|
/* id 1, wireType 0 =*/
|
|
1436
1596
|
8
|
|
1437
|
-
).int32(i.event), i.data != null && Object.hasOwnProperty.call(i, "data") &&
|
|
1597
|
+
).int32(i.event), i.data != null && Object.hasOwnProperty.call(i, "data") && t.uint32(
|
|
1438
1598
|
/* id 2, wireType 2 =*/
|
|
1439
1599
|
18
|
|
1440
|
-
).bytes(i.data), i.compress != null && Object.hasOwnProperty.call(i, "compress") &&
|
|
1600
|
+
).bytes(i.data), i.compress != null && Object.hasOwnProperty.call(i, "compress") && t.uint32(
|
|
1441
1601
|
/* id 3, wireType 0 =*/
|
|
1442
1602
|
24
|
|
1443
|
-
).bool(i.compress), i.version != null && Object.hasOwnProperty.call(i, "version") &&
|
|
1603
|
+
).bool(i.compress), i.version != null && Object.hasOwnProperty.call(i, "version") && t.uint32(
|
|
1444
1604
|
/* id 4, wireType 0 =*/
|
|
1445
1605
|
32
|
|
1446
|
-
).int32(i.version),
|
|
1447
|
-
},
|
|
1448
|
-
return this.encode(i,
|
|
1449
|
-
},
|
|
1606
|
+
).int32(i.version), t;
|
|
1607
|
+
}, n.encodeDelimited = function(i, t) {
|
|
1608
|
+
return this.encode(i, t).ldelim();
|
|
1609
|
+
}, n.decode = function(i, t, e) {
|
|
1450
1610
|
i instanceof $Reader || (i = $Reader.create(i));
|
|
1451
|
-
let s =
|
|
1611
|
+
let s = t === void 0 ? i.len : i.pos + t, l = new $root.com.quick.voice.proto.SeiData();
|
|
1452
1612
|
for (; i.pos < s; ) {
|
|
1453
|
-
let
|
|
1454
|
-
if (
|
|
1455
|
-
switch (
|
|
1613
|
+
let c = i.uint32();
|
|
1614
|
+
if (c === e) break;
|
|
1615
|
+
switch (c >>> 3) {
|
|
1456
1616
|
case 1: {
|
|
1457
1617
|
l.event = i.int32();
|
|
1458
1618
|
break;
|
|
@@ -1470,14 +1630,14 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1470
1630
|
break;
|
|
1471
1631
|
}
|
|
1472
1632
|
default:
|
|
1473
|
-
i.skipType(
|
|
1633
|
+
i.skipType(c & 7);
|
|
1474
1634
|
break;
|
|
1475
1635
|
}
|
|
1476
1636
|
}
|
|
1477
1637
|
return l;
|
|
1478
|
-
},
|
|
1638
|
+
}, n.decodeDelimited = function(i) {
|
|
1479
1639
|
return i instanceof $Reader || (i = new $Reader(i)), this.decode(i, i.uint32());
|
|
1480
|
-
},
|
|
1640
|
+
}, n.verify = function(i) {
|
|
1481
1641
|
if (typeof i != "object" || i === null) return "object expected";
|
|
1482
1642
|
if (i.event != null && i.hasOwnProperty("event"))
|
|
1483
1643
|
switch (i.event) {
|
|
@@ -1488,126 +1648,126 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1488
1648
|
break;
|
|
1489
1649
|
}
|
|
1490
1650
|
return i.data != null && i.hasOwnProperty("data") && !(i.data && typeof i.data.length == "number" || $util.isString(i.data)) ? "data: buffer expected" : i.compress != null && i.hasOwnProperty("compress") && typeof i.compress != "boolean" ? "compress: boolean expected" : i.version != null && i.hasOwnProperty("version") && !$util.isInteger(i.version) ? "version: integer expected" : null;
|
|
1491
|
-
},
|
|
1651
|
+
}, n.fromObject = function(i) {
|
|
1492
1652
|
if (i instanceof $root.com.quick.voice.proto.SeiData) return i;
|
|
1493
|
-
let
|
|
1653
|
+
let t = new $root.com.quick.voice.proto.SeiData();
|
|
1494
1654
|
switch (i.event) {
|
|
1495
1655
|
default:
|
|
1496
1656
|
if (typeof i.event == "number") {
|
|
1497
|
-
|
|
1657
|
+
t.event = i.event;
|
|
1498
1658
|
break;
|
|
1499
1659
|
}
|
|
1500
1660
|
break;
|
|
1501
1661
|
case "Layout":
|
|
1502
1662
|
case 0:
|
|
1503
|
-
|
|
1663
|
+
t.event = 0;
|
|
1504
1664
|
break;
|
|
1505
1665
|
case "Custom":
|
|
1506
1666
|
case 1:
|
|
1507
|
-
|
|
1667
|
+
t.event = 1;
|
|
1508
1668
|
break;
|
|
1509
1669
|
}
|
|
1510
|
-
return i.data != null && (typeof i.data == "string" ? $util.base64.decode(i.data,
|
|
1511
|
-
},
|
|
1512
|
-
|
|
1513
|
-
let
|
|
1514
|
-
return
|
|
1515
|
-
},
|
|
1670
|
+
return i.data != null && (typeof i.data == "string" ? $util.base64.decode(i.data, t.data = $util.newBuffer($util.base64.length(i.data)), 0) : i.data.length >= 0 && (t.data = i.data)), i.compress != null && (t.compress = !!i.compress), i.version != null && (t.version = i.version | 0), t;
|
|
1671
|
+
}, n.toObject = function(i, t) {
|
|
1672
|
+
t || (t = {});
|
|
1673
|
+
let e = {};
|
|
1674
|
+
return t.defaults && (e.event = t.enums === String ? "Layout" : 0, t.bytes === String ? e.data = "" : (e.data = [], t.bytes !== Array && (e.data = $util.newBuffer(e.data))), e.compress = !1, e.version = 0), i.event != null && i.hasOwnProperty("event") && (e.event = t.enums === String ? $root.com.quick.voice.proto.EventType[i.event] === void 0 ? i.event : $root.com.quick.voice.proto.EventType[i.event] : i.event), i.data != null && i.hasOwnProperty("data") && (e.data = t.bytes === String ? $util.base64.encode(i.data, 0, i.data.length) : t.bytes === Array ? Array.prototype.slice.call(i.data) : i.data), i.compress != null && i.hasOwnProperty("compress") && (e.compress = i.compress), i.version != null && i.hasOwnProperty("version") && (e.version = i.version), e;
|
|
1675
|
+
}, n.prototype.toJSON = function() {
|
|
1516
1676
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
1517
|
-
},
|
|
1677
|
+
}, n.getTypeUrl = function(i) {
|
|
1518
1678
|
return i === void 0 && (i = "type.googleapis.com"), i + "/com.quick.voice.proto.SeiData";
|
|
1519
|
-
},
|
|
1520
|
-
}(),
|
|
1521
|
-
const
|
|
1522
|
-
return n[
|
|
1523
|
-
}(),
|
|
1524
|
-
function
|
|
1525
|
-
if (this.userMap = {}, i) for (let
|
|
1679
|
+
}, n;
|
|
1680
|
+
}(), u.EventType = function() {
|
|
1681
|
+
const n = {}, r = Object.create(n);
|
|
1682
|
+
return r[n[0] = "Layout"] = 0, r[n[1] = "Custom"] = 1, r;
|
|
1683
|
+
}(), u.LayoutData = function() {
|
|
1684
|
+
function n(i) {
|
|
1685
|
+
if (this.userMap = {}, i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
1526
1686
|
}
|
|
1527
|
-
|
|
1528
|
-
let
|
|
1529
|
-
return Object.defineProperty(
|
|
1530
|
-
get: $util.oneOfGetter(
|
|
1531
|
-
set: $util.oneOfSetter(
|
|
1532
|
-
}),
|
|
1533
|
-
return new
|
|
1534
|
-
},
|
|
1535
|
-
if (
|
|
1687
|
+
n.prototype.roomId = "", n.prototype.type = 0, n.prototype.userMap = $util.emptyObject, n.prototype.globalCustom = null;
|
|
1688
|
+
let r;
|
|
1689
|
+
return Object.defineProperty(n.prototype, "_globalCustom", {
|
|
1690
|
+
get: $util.oneOfGetter(r = ["globalCustom"]),
|
|
1691
|
+
set: $util.oneOfSetter(r)
|
|
1692
|
+
}), n.create = function(t) {
|
|
1693
|
+
return new n(t);
|
|
1694
|
+
}, n.encode = function(t, e) {
|
|
1695
|
+
if (e || (e = $Writer.create()), t.roomId != null && Object.hasOwnProperty.call(t, "roomId") && e.uint32(
|
|
1536
1696
|
/* id 1, wireType 2 =*/
|
|
1537
1697
|
10
|
|
1538
|
-
).string(
|
|
1698
|
+
).string(t.roomId), t.type != null && Object.hasOwnProperty.call(t, "type") && e.uint32(
|
|
1539
1699
|
/* id 2, wireType 0 =*/
|
|
1540
1700
|
16
|
|
1541
|
-
).int32(
|
|
1542
|
-
for (let s = Object.keys(
|
|
1543
|
-
|
|
1701
|
+
).int32(t.type), t.userMap != null && Object.hasOwnProperty.call(t, "userMap"))
|
|
1702
|
+
for (let s = Object.keys(t.userMap), l = 0; l < s.length; ++l)
|
|
1703
|
+
e.uint32(
|
|
1544
1704
|
/* id 3, wireType 2 =*/
|
|
1545
1705
|
26
|
|
1546
1706
|
).fork().uint32(
|
|
1547
1707
|
/* id 1, wireType 2 =*/
|
|
1548
1708
|
10
|
|
1549
|
-
).string(s[l]), $root.com.quick.voice.proto.UserInfo.encode(
|
|
1709
|
+
).string(s[l]), $root.com.quick.voice.proto.UserInfo.encode(t.userMap[s[l]], e.uint32(
|
|
1550
1710
|
/* id 2, wireType 2 =*/
|
|
1551
1711
|
18
|
|
1552
1712
|
).fork()).ldelim().ldelim();
|
|
1553
|
-
return
|
|
1713
|
+
return t.globalCustom != null && Object.hasOwnProperty.call(t, "globalCustom") && $root.com.quick.voice.proto.CustomInfo.encode(t.globalCustom, e.uint32(
|
|
1554
1714
|
/* id 4, wireType 2 =*/
|
|
1555
1715
|
34
|
|
1556
|
-
).fork()).ldelim(),
|
|
1557
|
-
},
|
|
1558
|
-
return this.encode(
|
|
1559
|
-
},
|
|
1560
|
-
|
|
1561
|
-
let l =
|
|
1562
|
-
for (;
|
|
1563
|
-
let
|
|
1564
|
-
if (
|
|
1565
|
-
switch (
|
|
1716
|
+
).fork()).ldelim(), e;
|
|
1717
|
+
}, n.encodeDelimited = function(t, e) {
|
|
1718
|
+
return this.encode(t, e).ldelim();
|
|
1719
|
+
}, n.decode = function(t, e, s) {
|
|
1720
|
+
t instanceof $Reader || (t = $Reader.create(t));
|
|
1721
|
+
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.LayoutData(), d, p;
|
|
1722
|
+
for (; t.pos < l; ) {
|
|
1723
|
+
let f = t.uint32();
|
|
1724
|
+
if (f === s) break;
|
|
1725
|
+
switch (f >>> 3) {
|
|
1566
1726
|
case 1: {
|
|
1567
|
-
|
|
1727
|
+
c.roomId = t.string();
|
|
1568
1728
|
break;
|
|
1569
1729
|
}
|
|
1570
1730
|
case 2: {
|
|
1571
|
-
|
|
1731
|
+
c.type = t.int32();
|
|
1572
1732
|
break;
|
|
1573
1733
|
}
|
|
1574
1734
|
case 3: {
|
|
1575
|
-
|
|
1576
|
-
let w =
|
|
1577
|
-
for (d = "",
|
|
1578
|
-
let
|
|
1579
|
-
switch (
|
|
1735
|
+
c.userMap === $util.emptyObject && (c.userMap = {});
|
|
1736
|
+
let w = t.uint32() + t.pos;
|
|
1737
|
+
for (d = "", p = null; t.pos < w; ) {
|
|
1738
|
+
let b = t.uint32();
|
|
1739
|
+
switch (b >>> 3) {
|
|
1580
1740
|
case 1:
|
|
1581
|
-
d =
|
|
1741
|
+
d = t.string();
|
|
1582
1742
|
break;
|
|
1583
1743
|
case 2:
|
|
1584
|
-
|
|
1744
|
+
p = $root.com.quick.voice.proto.UserInfo.decode(t, t.uint32());
|
|
1585
1745
|
break;
|
|
1586
1746
|
default:
|
|
1587
|
-
|
|
1747
|
+
t.skipType(b & 7);
|
|
1588
1748
|
break;
|
|
1589
1749
|
}
|
|
1590
1750
|
}
|
|
1591
|
-
|
|
1751
|
+
c.userMap[d] = p;
|
|
1592
1752
|
break;
|
|
1593
1753
|
}
|
|
1594
1754
|
case 4: {
|
|
1595
|
-
|
|
1755
|
+
c.globalCustom = $root.com.quick.voice.proto.CustomInfo.decode(t, t.uint32());
|
|
1596
1756
|
break;
|
|
1597
1757
|
}
|
|
1598
1758
|
default:
|
|
1599
|
-
|
|
1759
|
+
t.skipType(f & 7);
|
|
1600
1760
|
break;
|
|
1601
1761
|
}
|
|
1602
1762
|
}
|
|
1603
|
-
return
|
|
1604
|
-
},
|
|
1605
|
-
return
|
|
1606
|
-
},
|
|
1607
|
-
if (typeof
|
|
1608
|
-
if (
|
|
1609
|
-
if (
|
|
1610
|
-
switch (
|
|
1763
|
+
return c;
|
|
1764
|
+
}, n.decodeDelimited = function(t) {
|
|
1765
|
+
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
1766
|
+
}, n.verify = function(t) {
|
|
1767
|
+
if (typeof t != "object" || t === null) return "object expected";
|
|
1768
|
+
if (t.roomId != null && t.hasOwnProperty("roomId") && !$util.isString(t.roomId)) return "roomId: string expected";
|
|
1769
|
+
if (t.type != null && t.hasOwnProperty("type"))
|
|
1770
|
+
switch (t.type) {
|
|
1611
1771
|
default:
|
|
1612
1772
|
return "type: enum value expected";
|
|
1613
1773
|
case 0:
|
|
@@ -1615,440 +1775,440 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1615
1775
|
case 2:
|
|
1616
1776
|
break;
|
|
1617
1777
|
}
|
|
1618
|
-
if (
|
|
1619
|
-
if (!$util.isObject(
|
|
1620
|
-
let
|
|
1621
|
-
for (let s = 0; s <
|
|
1622
|
-
let l = $root.com.quick.voice.proto.UserInfo.verify(
|
|
1778
|
+
if (t.userMap != null && t.hasOwnProperty("userMap")) {
|
|
1779
|
+
if (!$util.isObject(t.userMap)) return "userMap: object expected";
|
|
1780
|
+
let e = Object.keys(t.userMap);
|
|
1781
|
+
for (let s = 0; s < e.length; ++s) {
|
|
1782
|
+
let l = $root.com.quick.voice.proto.UserInfo.verify(t.userMap[e[s]]);
|
|
1623
1783
|
if (l) return "userMap." + l;
|
|
1624
1784
|
}
|
|
1625
1785
|
}
|
|
1626
|
-
if (
|
|
1627
|
-
let
|
|
1628
|
-
if (
|
|
1786
|
+
if (t.globalCustom != null && t.hasOwnProperty("globalCustom")) {
|
|
1787
|
+
let e = $root.com.quick.voice.proto.CustomInfo.verify(t.globalCustom);
|
|
1788
|
+
if (e) return "globalCustom." + e;
|
|
1629
1789
|
}
|
|
1630
1790
|
return null;
|
|
1631
|
-
},
|
|
1632
|
-
if (
|
|
1633
|
-
let
|
|
1634
|
-
switch (
|
|
1791
|
+
}, n.fromObject = function(t) {
|
|
1792
|
+
if (t instanceof $root.com.quick.voice.proto.LayoutData) return t;
|
|
1793
|
+
let e = new $root.com.quick.voice.proto.LayoutData();
|
|
1794
|
+
switch (t.roomId != null && (e.roomId = String(t.roomId)), t.type) {
|
|
1635
1795
|
default:
|
|
1636
|
-
if (typeof
|
|
1637
|
-
|
|
1796
|
+
if (typeof t.type == "number") {
|
|
1797
|
+
e.type = t.type;
|
|
1638
1798
|
break;
|
|
1639
1799
|
}
|
|
1640
1800
|
break;
|
|
1641
1801
|
case "AudioAndVideo":
|
|
1642
1802
|
case 0:
|
|
1643
|
-
|
|
1803
|
+
e.type = 0;
|
|
1644
1804
|
break;
|
|
1645
1805
|
case "OnlyAudio":
|
|
1646
1806
|
case 1:
|
|
1647
|
-
|
|
1807
|
+
e.type = 1;
|
|
1648
1808
|
break;
|
|
1649
1809
|
case "OnlyVideo":
|
|
1650
1810
|
case 2:
|
|
1651
|
-
|
|
1811
|
+
e.type = 2;
|
|
1652
1812
|
break;
|
|
1653
1813
|
}
|
|
1654
|
-
if (
|
|
1655
|
-
if (typeof
|
|
1656
|
-
|
|
1657
|
-
for (let s = Object.keys(
|
|
1658
|
-
if (typeof
|
|
1659
|
-
|
|
1814
|
+
if (t.userMap) {
|
|
1815
|
+
if (typeof t.userMap != "object") throw TypeError(".com.quick.voice.proto.LayoutData.userMap: object expected");
|
|
1816
|
+
e.userMap = {};
|
|
1817
|
+
for (let s = Object.keys(t.userMap), l = 0; l < s.length; ++l) {
|
|
1818
|
+
if (typeof t.userMap[s[l]] != "object") throw TypeError(".com.quick.voice.proto.LayoutData.userMap: object expected");
|
|
1819
|
+
e.userMap[s[l]] = $root.com.quick.voice.proto.UserInfo.fromObject(t.userMap[s[l]]);
|
|
1660
1820
|
}
|
|
1661
1821
|
}
|
|
1662
|
-
if (
|
|
1663
|
-
if (typeof
|
|
1664
|
-
|
|
1822
|
+
if (t.globalCustom != null) {
|
|
1823
|
+
if (typeof t.globalCustom != "object") throw TypeError(".com.quick.voice.proto.LayoutData.globalCustom: object expected");
|
|
1824
|
+
e.globalCustom = $root.com.quick.voice.proto.CustomInfo.fromObject(t.globalCustom);
|
|
1665
1825
|
}
|
|
1666
|
-
return
|
|
1667
|
-
},
|
|
1668
|
-
|
|
1826
|
+
return e;
|
|
1827
|
+
}, n.toObject = function(t, e) {
|
|
1828
|
+
e || (e = {});
|
|
1669
1829
|
let s = {};
|
|
1670
|
-
(
|
|
1830
|
+
(e.objects || e.defaults) && (s.userMap = {}), e.defaults && (s.roomId = "", s.type = e.enums === String ? "AudioAndVideo" : 0), t.roomId != null && t.hasOwnProperty("roomId") && (s.roomId = t.roomId), t.type != null && t.hasOwnProperty("type") && (s.type = e.enums === String ? $root.com.quick.voice.proto.LayoutType[t.type] === void 0 ? t.type : $root.com.quick.voice.proto.LayoutType[t.type] : t.type);
|
|
1671
1831
|
let l;
|
|
1672
|
-
if (
|
|
1832
|
+
if (t.userMap && (l = Object.keys(t.userMap)).length) {
|
|
1673
1833
|
s.userMap = {};
|
|
1674
|
-
for (let
|
|
1834
|
+
for (let c = 0; c < l.length; ++c) s.userMap[l[c]] = $root.com.quick.voice.proto.UserInfo.toObject(t.userMap[l[c]], e);
|
|
1675
1835
|
}
|
|
1676
|
-
return
|
|
1677
|
-
},
|
|
1836
|
+
return t.globalCustom != null && t.hasOwnProperty("globalCustom") && (s.globalCustom = $root.com.quick.voice.proto.CustomInfo.toObject(t.globalCustom, e), e.oneofs && (s._globalCustom = "globalCustom")), s;
|
|
1837
|
+
}, n.prototype.toJSON = function() {
|
|
1678
1838
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
1679
|
-
},
|
|
1680
|
-
return
|
|
1681
|
-
},
|
|
1682
|
-
}(),
|
|
1683
|
-
function
|
|
1684
|
-
if (this.audios = [], this.videos = [], i) for (let
|
|
1839
|
+
}, n.getTypeUrl = function(t) {
|
|
1840
|
+
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.LayoutData";
|
|
1841
|
+
}, n;
|
|
1842
|
+
}(), u.UserInfo = function() {
|
|
1843
|
+
function n(i) {
|
|
1844
|
+
if (this.audios = [], this.videos = [], i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
1685
1845
|
}
|
|
1686
|
-
|
|
1687
|
-
let
|
|
1688
|
-
return Object.defineProperty(
|
|
1689
|
-
get: $util.oneOfGetter(
|
|
1690
|
-
set: $util.oneOfSetter(
|
|
1691
|
-
}),
|
|
1692
|
-
return new
|
|
1693
|
-
},
|
|
1694
|
-
if (
|
|
1846
|
+
n.prototype.id = "", n.prototype.audios = $util.emptyArray, n.prototype.videos = $util.emptyArray, n.prototype.custom = null;
|
|
1847
|
+
let r;
|
|
1848
|
+
return Object.defineProperty(n.prototype, "_custom", {
|
|
1849
|
+
get: $util.oneOfGetter(r = ["custom"]),
|
|
1850
|
+
set: $util.oneOfSetter(r)
|
|
1851
|
+
}), n.create = function(t) {
|
|
1852
|
+
return new n(t);
|
|
1853
|
+
}, n.encode = function(t, e) {
|
|
1854
|
+
if (e || (e = $Writer.create()), t.id != null && Object.hasOwnProperty.call(t, "id") && e.uint32(
|
|
1695
1855
|
/* id 1, wireType 2 =*/
|
|
1696
1856
|
10
|
|
1697
|
-
).string(
|
|
1857
|
+
).string(t.id), t.audios != null && t.audios.length) for (let s = 0; s < t.audios.length; ++s) $root.com.quick.voice.proto.AudioInfo.encode(t.audios[s], e.uint32(
|
|
1698
1858
|
/* id 2, wireType 2 =*/
|
|
1699
1859
|
18
|
|
1700
1860
|
).fork()).ldelim();
|
|
1701
|
-
if (
|
|
1861
|
+
if (t.videos != null && t.videos.length) for (let s = 0; s < t.videos.length; ++s) $root.com.quick.voice.proto.VideoInfo.encode(t.videos[s], e.uint32(
|
|
1702
1862
|
/* id 3, wireType 2 =*/
|
|
1703
1863
|
26
|
|
1704
1864
|
).fork()).ldelim();
|
|
1705
|
-
return
|
|
1865
|
+
return t.custom != null && Object.hasOwnProperty.call(t, "custom") && $root.com.quick.voice.proto.CustomInfo.encode(t.custom, e.uint32(
|
|
1706
1866
|
/* id 4, wireType 2 =*/
|
|
1707
1867
|
34
|
|
1708
|
-
).fork()).ldelim(),
|
|
1709
|
-
},
|
|
1710
|
-
return this.encode(
|
|
1711
|
-
},
|
|
1712
|
-
|
|
1713
|
-
let l =
|
|
1714
|
-
for (;
|
|
1715
|
-
let d =
|
|
1868
|
+
).fork()).ldelim(), e;
|
|
1869
|
+
}, n.encodeDelimited = function(t, e) {
|
|
1870
|
+
return this.encode(t, e).ldelim();
|
|
1871
|
+
}, n.decode = function(t, e, s) {
|
|
1872
|
+
t instanceof $Reader || (t = $Reader.create(t));
|
|
1873
|
+
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.UserInfo();
|
|
1874
|
+
for (; t.pos < l; ) {
|
|
1875
|
+
let d = t.uint32();
|
|
1716
1876
|
if (d === s) break;
|
|
1717
1877
|
switch (d >>> 3) {
|
|
1718
1878
|
case 1: {
|
|
1719
|
-
|
|
1879
|
+
c.id = t.string();
|
|
1720
1880
|
break;
|
|
1721
1881
|
}
|
|
1722
1882
|
case 2: {
|
|
1723
|
-
|
|
1883
|
+
c.audios && c.audios.length || (c.audios = []), c.audios.push($root.com.quick.voice.proto.AudioInfo.decode(t, t.uint32()));
|
|
1724
1884
|
break;
|
|
1725
1885
|
}
|
|
1726
1886
|
case 3: {
|
|
1727
|
-
|
|
1887
|
+
c.videos && c.videos.length || (c.videos = []), c.videos.push($root.com.quick.voice.proto.VideoInfo.decode(t, t.uint32()));
|
|
1728
1888
|
break;
|
|
1729
1889
|
}
|
|
1730
1890
|
case 4: {
|
|
1731
|
-
|
|
1891
|
+
c.custom = $root.com.quick.voice.proto.CustomInfo.decode(t, t.uint32());
|
|
1732
1892
|
break;
|
|
1733
1893
|
}
|
|
1734
1894
|
default:
|
|
1735
|
-
|
|
1895
|
+
t.skipType(d & 7);
|
|
1736
1896
|
break;
|
|
1737
1897
|
}
|
|
1738
1898
|
}
|
|
1739
|
-
return
|
|
1740
|
-
},
|
|
1741
|
-
return
|
|
1742
|
-
},
|
|
1743
|
-
if (typeof
|
|
1744
|
-
if (
|
|
1745
|
-
if (
|
|
1746
|
-
if (!Array.isArray(
|
|
1747
|
-
for (let
|
|
1748
|
-
let s = $root.com.quick.voice.proto.AudioInfo.verify(
|
|
1899
|
+
return c;
|
|
1900
|
+
}, n.decodeDelimited = function(t) {
|
|
1901
|
+
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
1902
|
+
}, n.verify = function(t) {
|
|
1903
|
+
if (typeof t != "object" || t === null) return "object expected";
|
|
1904
|
+
if (t.id != null && t.hasOwnProperty("id") && !$util.isString(t.id)) return "id: string expected";
|
|
1905
|
+
if (t.audios != null && t.hasOwnProperty("audios")) {
|
|
1906
|
+
if (!Array.isArray(t.audios)) return "audios: array expected";
|
|
1907
|
+
for (let e = 0; e < t.audios.length; ++e) {
|
|
1908
|
+
let s = $root.com.quick.voice.proto.AudioInfo.verify(t.audios[e]);
|
|
1749
1909
|
if (s) return "audios." + s;
|
|
1750
1910
|
}
|
|
1751
1911
|
}
|
|
1752
|
-
if (
|
|
1753
|
-
if (!Array.isArray(
|
|
1754
|
-
for (let
|
|
1755
|
-
let s = $root.com.quick.voice.proto.VideoInfo.verify(
|
|
1912
|
+
if (t.videos != null && t.hasOwnProperty("videos")) {
|
|
1913
|
+
if (!Array.isArray(t.videos)) return "videos: array expected";
|
|
1914
|
+
for (let e = 0; e < t.videos.length; ++e) {
|
|
1915
|
+
let s = $root.com.quick.voice.proto.VideoInfo.verify(t.videos[e]);
|
|
1756
1916
|
if (s) return "videos." + s;
|
|
1757
1917
|
}
|
|
1758
1918
|
}
|
|
1759
|
-
if (
|
|
1760
|
-
let
|
|
1761
|
-
if (
|
|
1919
|
+
if (t.custom != null && t.hasOwnProperty("custom")) {
|
|
1920
|
+
let e = $root.com.quick.voice.proto.CustomInfo.verify(t.custom);
|
|
1921
|
+
if (e) return "custom." + e;
|
|
1762
1922
|
}
|
|
1763
1923
|
return null;
|
|
1764
|
-
},
|
|
1765
|
-
if (
|
|
1766
|
-
let
|
|
1767
|
-
if (
|
|
1768
|
-
if (!Array.isArray(
|
|
1769
|
-
|
|
1770
|
-
for (let s = 0; s <
|
|
1771
|
-
if (typeof
|
|
1772
|
-
|
|
1924
|
+
}, n.fromObject = function(t) {
|
|
1925
|
+
if (t instanceof $root.com.quick.voice.proto.UserInfo) return t;
|
|
1926
|
+
let e = new $root.com.quick.voice.proto.UserInfo();
|
|
1927
|
+
if (t.id != null && (e.id = String(t.id)), t.audios) {
|
|
1928
|
+
if (!Array.isArray(t.audios)) throw TypeError(".com.quick.voice.proto.UserInfo.audios: array expected");
|
|
1929
|
+
e.audios = [];
|
|
1930
|
+
for (let s = 0; s < t.audios.length; ++s) {
|
|
1931
|
+
if (typeof t.audios[s] != "object") throw TypeError(".com.quick.voice.proto.UserInfo.audios: object expected");
|
|
1932
|
+
e.audios[s] = $root.com.quick.voice.proto.AudioInfo.fromObject(t.audios[s]);
|
|
1773
1933
|
}
|
|
1774
1934
|
}
|
|
1775
|
-
if (
|
|
1776
|
-
if (!Array.isArray(
|
|
1777
|
-
|
|
1778
|
-
for (let s = 0; s <
|
|
1779
|
-
if (typeof
|
|
1780
|
-
|
|
1935
|
+
if (t.videos) {
|
|
1936
|
+
if (!Array.isArray(t.videos)) throw TypeError(".com.quick.voice.proto.UserInfo.videos: array expected");
|
|
1937
|
+
e.videos = [];
|
|
1938
|
+
for (let s = 0; s < t.videos.length; ++s) {
|
|
1939
|
+
if (typeof t.videos[s] != "object") throw TypeError(".com.quick.voice.proto.UserInfo.videos: object expected");
|
|
1940
|
+
e.videos[s] = $root.com.quick.voice.proto.VideoInfo.fromObject(t.videos[s]);
|
|
1781
1941
|
}
|
|
1782
1942
|
}
|
|
1783
|
-
if (
|
|
1784
|
-
if (typeof
|
|
1785
|
-
|
|
1943
|
+
if (t.custom != null) {
|
|
1944
|
+
if (typeof t.custom != "object") throw TypeError(".com.quick.voice.proto.UserInfo.custom: object expected");
|
|
1945
|
+
e.custom = $root.com.quick.voice.proto.CustomInfo.fromObject(t.custom);
|
|
1786
1946
|
}
|
|
1787
|
-
return
|
|
1788
|
-
},
|
|
1789
|
-
|
|
1947
|
+
return e;
|
|
1948
|
+
}, n.toObject = function(t, e) {
|
|
1949
|
+
e || (e = {});
|
|
1790
1950
|
let s = {};
|
|
1791
|
-
if ((
|
|
1951
|
+
if ((e.arrays || e.defaults) && (s.audios = [], s.videos = []), e.defaults && (s.id = ""), t.id != null && t.hasOwnProperty("id") && (s.id = t.id), t.audios && t.audios.length) {
|
|
1792
1952
|
s.audios = [];
|
|
1793
|
-
for (let l = 0; l <
|
|
1953
|
+
for (let l = 0; l < t.audios.length; ++l) s.audios[l] = $root.com.quick.voice.proto.AudioInfo.toObject(t.audios[l], e);
|
|
1794
1954
|
}
|
|
1795
|
-
if (
|
|
1955
|
+
if (t.videos && t.videos.length) {
|
|
1796
1956
|
s.videos = [];
|
|
1797
|
-
for (let l = 0; l <
|
|
1957
|
+
for (let l = 0; l < t.videos.length; ++l) s.videos[l] = $root.com.quick.voice.proto.VideoInfo.toObject(t.videos[l], e);
|
|
1798
1958
|
}
|
|
1799
|
-
return
|
|
1800
|
-
},
|
|
1959
|
+
return t.custom != null && t.hasOwnProperty("custom") && (s.custom = $root.com.quick.voice.proto.CustomInfo.toObject(t.custom, e), e.oneofs && (s._custom = "custom")), s;
|
|
1960
|
+
}, n.prototype.toJSON = function() {
|
|
1801
1961
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
1802
|
-
},
|
|
1803
|
-
return
|
|
1804
|
-
},
|
|
1805
|
-
}(),
|
|
1806
|
-
function
|
|
1807
|
-
if (i) for (let
|
|
1962
|
+
}, n.getTypeUrl = function(t) {
|
|
1963
|
+
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.UserInfo";
|
|
1964
|
+
}, n;
|
|
1965
|
+
}(), u.AudioInfo = function() {
|
|
1966
|
+
function n(i) {
|
|
1967
|
+
if (i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
1808
1968
|
}
|
|
1809
|
-
|
|
1810
|
-
let
|
|
1811
|
-
return Object.defineProperty(
|
|
1812
|
-
get: $util.oneOfGetter(
|
|
1813
|
-
set: $util.oneOfSetter(
|
|
1814
|
-
}),
|
|
1815
|
-
return new
|
|
1816
|
-
},
|
|
1817
|
-
return
|
|
1969
|
+
n.prototype.type = 0, n.prototype.isEnable = !1, n.prototype.isMute = !1, n.prototype.volume = 0, n.prototype.updateTime = null;
|
|
1970
|
+
let r;
|
|
1971
|
+
return Object.defineProperty(n.prototype, "_updateTime", {
|
|
1972
|
+
get: $util.oneOfGetter(r = ["updateTime"]),
|
|
1973
|
+
set: $util.oneOfSetter(r)
|
|
1974
|
+
}), n.create = function(t) {
|
|
1975
|
+
return new n(t);
|
|
1976
|
+
}, n.encode = function(t, e) {
|
|
1977
|
+
return e || (e = $Writer.create()), t.type != null && Object.hasOwnProperty.call(t, "type") && e.uint32(
|
|
1818
1978
|
/* id 1, wireType 0 =*/
|
|
1819
1979
|
8
|
|
1820
|
-
).int32(
|
|
1980
|
+
).int32(t.type), t.isEnable != null && Object.hasOwnProperty.call(t, "isEnable") && e.uint32(
|
|
1821
1981
|
/* id 2, wireType 0 =*/
|
|
1822
1982
|
16
|
|
1823
|
-
).bool(
|
|
1983
|
+
).bool(t.isEnable), t.isMute != null && Object.hasOwnProperty.call(t, "isMute") && e.uint32(
|
|
1824
1984
|
/* id 3, wireType 0 =*/
|
|
1825
1985
|
24
|
|
1826
|
-
).bool(
|
|
1986
|
+
).bool(t.isMute), t.volume != null && Object.hasOwnProperty.call(t, "volume") && e.uint32(
|
|
1827
1987
|
/* id 4, wireType 1 =*/
|
|
1828
1988
|
33
|
|
1829
|
-
).double(
|
|
1989
|
+
).double(t.volume), t.updateTime != null && Object.hasOwnProperty.call(t, "updateTime") && e.uint32(
|
|
1830
1990
|
/* id 5, wireType 0 =*/
|
|
1831
1991
|
40
|
|
1832
|
-
).int64(
|
|
1833
|
-
},
|
|
1834
|
-
return this.encode(
|
|
1835
|
-
},
|
|
1836
|
-
|
|
1837
|
-
let l =
|
|
1838
|
-
for (;
|
|
1839
|
-
let d =
|
|
1992
|
+
).int64(t.updateTime), e;
|
|
1993
|
+
}, n.encodeDelimited = function(t, e) {
|
|
1994
|
+
return this.encode(t, e).ldelim();
|
|
1995
|
+
}, n.decode = function(t, e, s) {
|
|
1996
|
+
t instanceof $Reader || (t = $Reader.create(t));
|
|
1997
|
+
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.AudioInfo();
|
|
1998
|
+
for (; t.pos < l; ) {
|
|
1999
|
+
let d = t.uint32();
|
|
1840
2000
|
if (d === s) break;
|
|
1841
2001
|
switch (d >>> 3) {
|
|
1842
2002
|
case 1: {
|
|
1843
|
-
|
|
2003
|
+
c.type = t.int32();
|
|
1844
2004
|
break;
|
|
1845
2005
|
}
|
|
1846
2006
|
case 2: {
|
|
1847
|
-
|
|
2007
|
+
c.isEnable = t.bool();
|
|
1848
2008
|
break;
|
|
1849
2009
|
}
|
|
1850
2010
|
case 3: {
|
|
1851
|
-
|
|
2011
|
+
c.isMute = t.bool();
|
|
1852
2012
|
break;
|
|
1853
2013
|
}
|
|
1854
2014
|
case 4: {
|
|
1855
|
-
|
|
2015
|
+
c.volume = t.double();
|
|
1856
2016
|
break;
|
|
1857
2017
|
}
|
|
1858
2018
|
case 5: {
|
|
1859
|
-
|
|
2019
|
+
c.updateTime = t.int64();
|
|
1860
2020
|
break;
|
|
1861
2021
|
}
|
|
1862
2022
|
default:
|
|
1863
|
-
|
|
2023
|
+
t.skipType(d & 7);
|
|
1864
2024
|
break;
|
|
1865
2025
|
}
|
|
1866
2026
|
}
|
|
1867
|
-
return
|
|
1868
|
-
},
|
|
1869
|
-
return
|
|
1870
|
-
},
|
|
1871
|
-
if (typeof
|
|
1872
|
-
if (
|
|
1873
|
-
switch (
|
|
2027
|
+
return c;
|
|
2028
|
+
}, n.decodeDelimited = function(t) {
|
|
2029
|
+
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
2030
|
+
}, n.verify = function(t) {
|
|
2031
|
+
if (typeof t != "object" || t === null) return "object expected";
|
|
2032
|
+
if (t.type != null && t.hasOwnProperty("type"))
|
|
2033
|
+
switch (t.type) {
|
|
1874
2034
|
default:
|
|
1875
2035
|
return "type: enum value expected";
|
|
1876
2036
|
case 0:
|
|
1877
2037
|
case 1:
|
|
1878
2038
|
break;
|
|
1879
2039
|
}
|
|
1880
|
-
return
|
|
1881
|
-
},
|
|
1882
|
-
if (
|
|
1883
|
-
let
|
|
1884
|
-
switch (
|
|
2040
|
+
return t.isEnable != null && t.hasOwnProperty("isEnable") && typeof t.isEnable != "boolean" ? "isEnable: boolean expected" : t.isMute != null && t.hasOwnProperty("isMute") && typeof t.isMute != "boolean" ? "isMute: boolean expected" : t.volume != null && t.hasOwnProperty("volume") && typeof t.volume != "number" ? "volume: number expected" : t.updateTime != null && t.hasOwnProperty("updateTime") && !$util.isInteger(t.updateTime) && !(t.updateTime && $util.isInteger(t.updateTime.low) && $util.isInteger(t.updateTime.high)) ? "updateTime: integer|Long expected" : null;
|
|
2041
|
+
}, n.fromObject = function(t) {
|
|
2042
|
+
if (t instanceof $root.com.quick.voice.proto.AudioInfo) return t;
|
|
2043
|
+
let e = new $root.com.quick.voice.proto.AudioInfo();
|
|
2044
|
+
switch (t.type) {
|
|
1885
2045
|
default:
|
|
1886
|
-
if (typeof
|
|
1887
|
-
|
|
2046
|
+
if (typeof t.type == "number") {
|
|
2047
|
+
e.type = t.type;
|
|
1888
2048
|
break;
|
|
1889
2049
|
}
|
|
1890
2050
|
break;
|
|
1891
2051
|
case "Microphone":
|
|
1892
2052
|
case 0:
|
|
1893
|
-
|
|
2053
|
+
e.type = 0;
|
|
1894
2054
|
break;
|
|
1895
2055
|
case "SystemVoice":
|
|
1896
2056
|
case 1:
|
|
1897
|
-
|
|
2057
|
+
e.type = 1;
|
|
1898
2058
|
break;
|
|
1899
2059
|
}
|
|
1900
|
-
return
|
|
1901
|
-
},
|
|
1902
|
-
|
|
2060
|
+
return t.isEnable != null && (e.isEnable = !!t.isEnable), t.isMute != null && (e.isMute = !!t.isMute), t.volume != null && (e.volume = Number(t.volume)), t.updateTime != null && ($util.Long ? (e.updateTime = $util.Long.fromValue(t.updateTime)).unsigned = !1 : typeof t.updateTime == "string" ? e.updateTime = parseInt(t.updateTime, 10) : typeof t.updateTime == "number" ? e.updateTime = t.updateTime : typeof t.updateTime == "object" && (e.updateTime = new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber())), e;
|
|
2061
|
+
}, n.toObject = function(t, e) {
|
|
2062
|
+
e || (e = {});
|
|
1903
2063
|
let s = {};
|
|
1904
|
-
return
|
|
1905
|
-
},
|
|
2064
|
+
return e.defaults && (s.type = e.enums === String ? "Microphone" : 0, s.isEnable = !1, s.isMute = !1, s.volume = 0), t.type != null && t.hasOwnProperty("type") && (s.type = e.enums === String ? $root.com.quick.voice.proto.AudioType[t.type] === void 0 ? t.type : $root.com.quick.voice.proto.AudioType[t.type] : t.type), t.isEnable != null && t.hasOwnProperty("isEnable") && (s.isEnable = t.isEnable), t.isMute != null && t.hasOwnProperty("isMute") && (s.isMute = t.isMute), t.volume != null && t.hasOwnProperty("volume") && (s.volume = e.json && !isFinite(t.volume) ? String(t.volume) : t.volume), t.updateTime != null && t.hasOwnProperty("updateTime") && (typeof t.updateTime == "number" ? s.updateTime = e.longs === String ? String(t.updateTime) : t.updateTime : s.updateTime = e.longs === String ? $util.Long.prototype.toString.call(t.updateTime) : e.longs === Number ? new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber() : t.updateTime, e.oneofs && (s._updateTime = "updateTime")), s;
|
|
2065
|
+
}, n.prototype.toJSON = function() {
|
|
1906
2066
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
1907
|
-
},
|
|
1908
|
-
return
|
|
1909
|
-
},
|
|
1910
|
-
}(),
|
|
1911
|
-
function
|
|
1912
|
-
if (i) for (let
|
|
2067
|
+
}, n.getTypeUrl = function(t) {
|
|
2068
|
+
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.AudioInfo";
|
|
2069
|
+
}, n;
|
|
2070
|
+
}(), u.VideoInfo = function() {
|
|
2071
|
+
function n(i) {
|
|
2072
|
+
if (i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
1913
2073
|
}
|
|
1914
|
-
|
|
1915
|
-
let
|
|
1916
|
-
return Object.defineProperty(
|
|
1917
|
-
get: $util.oneOfGetter(
|
|
1918
|
-
set: $util.oneOfSetter(
|
|
1919
|
-
}),
|
|
1920
|
-
return new
|
|
1921
|
-
},
|
|
1922
|
-
return
|
|
2074
|
+
n.prototype.type = 0, n.prototype.isEnable = !1, n.prototype.isMute = !1, n.prototype.width = 0, n.prototype.height = 0, n.prototype.x = 0, n.prototype.y = 0, n.prototype.updateTime = null;
|
|
2075
|
+
let r;
|
|
2076
|
+
return Object.defineProperty(n.prototype, "_updateTime", {
|
|
2077
|
+
get: $util.oneOfGetter(r = ["updateTime"]),
|
|
2078
|
+
set: $util.oneOfSetter(r)
|
|
2079
|
+
}), n.create = function(t) {
|
|
2080
|
+
return new n(t);
|
|
2081
|
+
}, n.encode = function(t, e) {
|
|
2082
|
+
return e || (e = $Writer.create()), t.type != null && Object.hasOwnProperty.call(t, "type") && e.uint32(
|
|
1923
2083
|
/* id 1, wireType 0 =*/
|
|
1924
2084
|
8
|
|
1925
|
-
).int32(
|
|
2085
|
+
).int32(t.type), t.isEnable != null && Object.hasOwnProperty.call(t, "isEnable") && e.uint32(
|
|
1926
2086
|
/* id 2, wireType 0 =*/
|
|
1927
2087
|
16
|
|
1928
|
-
).bool(
|
|
2088
|
+
).bool(t.isEnable), t.isMute != null && Object.hasOwnProperty.call(t, "isMute") && e.uint32(
|
|
1929
2089
|
/* id 3, wireType 0 =*/
|
|
1930
2090
|
24
|
|
1931
|
-
).bool(
|
|
2091
|
+
).bool(t.isMute), t.width != null && Object.hasOwnProperty.call(t, "width") && e.uint32(
|
|
1932
2092
|
/* id 4, wireType 0 =*/
|
|
1933
2093
|
32
|
|
1934
|
-
).int32(
|
|
2094
|
+
).int32(t.width), t.height != null && Object.hasOwnProperty.call(t, "height") && e.uint32(
|
|
1935
2095
|
/* id 5, wireType 0 =*/
|
|
1936
2096
|
40
|
|
1937
|
-
).int32(
|
|
2097
|
+
).int32(t.height), t.x != null && Object.hasOwnProperty.call(t, "x") && e.uint32(
|
|
1938
2098
|
/* id 6, wireType 0 =*/
|
|
1939
2099
|
48
|
|
1940
|
-
).int32(
|
|
2100
|
+
).int32(t.x), t.y != null && Object.hasOwnProperty.call(t, "y") && e.uint32(
|
|
1941
2101
|
/* id 7, wireType 0 =*/
|
|
1942
2102
|
56
|
|
1943
|
-
).int32(
|
|
2103
|
+
).int32(t.y), t.updateTime != null && Object.hasOwnProperty.call(t, "updateTime") && e.uint32(
|
|
1944
2104
|
/* id 8, wireType 0 =*/
|
|
1945
2105
|
64
|
|
1946
|
-
).int64(
|
|
1947
|
-
},
|
|
1948
|
-
return this.encode(
|
|
1949
|
-
},
|
|
1950
|
-
|
|
1951
|
-
let l =
|
|
1952
|
-
for (;
|
|
1953
|
-
let d =
|
|
2106
|
+
).int64(t.updateTime), e;
|
|
2107
|
+
}, n.encodeDelimited = function(t, e) {
|
|
2108
|
+
return this.encode(t, e).ldelim();
|
|
2109
|
+
}, n.decode = function(t, e, s) {
|
|
2110
|
+
t instanceof $Reader || (t = $Reader.create(t));
|
|
2111
|
+
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.VideoInfo();
|
|
2112
|
+
for (; t.pos < l; ) {
|
|
2113
|
+
let d = t.uint32();
|
|
1954
2114
|
if (d === s) break;
|
|
1955
2115
|
switch (d >>> 3) {
|
|
1956
2116
|
case 1: {
|
|
1957
|
-
|
|
2117
|
+
c.type = t.int32();
|
|
1958
2118
|
break;
|
|
1959
2119
|
}
|
|
1960
2120
|
case 2: {
|
|
1961
|
-
|
|
2121
|
+
c.isEnable = t.bool();
|
|
1962
2122
|
break;
|
|
1963
2123
|
}
|
|
1964
2124
|
case 3: {
|
|
1965
|
-
|
|
2125
|
+
c.isMute = t.bool();
|
|
1966
2126
|
break;
|
|
1967
2127
|
}
|
|
1968
2128
|
case 4: {
|
|
1969
|
-
|
|
2129
|
+
c.width = t.int32();
|
|
1970
2130
|
break;
|
|
1971
2131
|
}
|
|
1972
2132
|
case 5: {
|
|
1973
|
-
|
|
2133
|
+
c.height = t.int32();
|
|
1974
2134
|
break;
|
|
1975
2135
|
}
|
|
1976
2136
|
case 6: {
|
|
1977
|
-
|
|
2137
|
+
c.x = t.int32();
|
|
1978
2138
|
break;
|
|
1979
2139
|
}
|
|
1980
2140
|
case 7: {
|
|
1981
|
-
|
|
2141
|
+
c.y = t.int32();
|
|
1982
2142
|
break;
|
|
1983
2143
|
}
|
|
1984
2144
|
case 8: {
|
|
1985
|
-
|
|
2145
|
+
c.updateTime = t.int64();
|
|
1986
2146
|
break;
|
|
1987
2147
|
}
|
|
1988
2148
|
default:
|
|
1989
|
-
|
|
2149
|
+
t.skipType(d & 7);
|
|
1990
2150
|
break;
|
|
1991
2151
|
}
|
|
1992
2152
|
}
|
|
1993
|
-
return
|
|
1994
|
-
},
|
|
1995
|
-
return
|
|
1996
|
-
},
|
|
1997
|
-
if (typeof
|
|
1998
|
-
if (
|
|
1999
|
-
switch (
|
|
2153
|
+
return c;
|
|
2154
|
+
}, n.decodeDelimited = function(t) {
|
|
2155
|
+
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
2156
|
+
}, n.verify = function(t) {
|
|
2157
|
+
if (typeof t != "object" || t === null) return "object expected";
|
|
2158
|
+
if (t.type != null && t.hasOwnProperty("type"))
|
|
2159
|
+
switch (t.type) {
|
|
2000
2160
|
default:
|
|
2001
2161
|
return "type: enum value expected";
|
|
2002
2162
|
case 0:
|
|
2003
2163
|
case 1:
|
|
2004
2164
|
break;
|
|
2005
2165
|
}
|
|
2006
|
-
return
|
|
2007
|
-
},
|
|
2008
|
-
if (
|
|
2009
|
-
let
|
|
2010
|
-
switch (
|
|
2166
|
+
return t.isEnable != null && t.hasOwnProperty("isEnable") && typeof t.isEnable != "boolean" ? "isEnable: boolean expected" : t.isMute != null && t.hasOwnProperty("isMute") && typeof t.isMute != "boolean" ? "isMute: boolean expected" : t.width != null && t.hasOwnProperty("width") && !$util.isInteger(t.width) ? "width: integer expected" : t.height != null && t.hasOwnProperty("height") && !$util.isInteger(t.height) ? "height: integer expected" : t.x != null && t.hasOwnProperty("x") && !$util.isInteger(t.x) ? "x: integer expected" : t.y != null && t.hasOwnProperty("y") && !$util.isInteger(t.y) ? "y: integer expected" : t.updateTime != null && t.hasOwnProperty("updateTime") && !$util.isInteger(t.updateTime) && !(t.updateTime && $util.isInteger(t.updateTime.low) && $util.isInteger(t.updateTime.high)) ? "updateTime: integer|Long expected" : null;
|
|
2167
|
+
}, n.fromObject = function(t) {
|
|
2168
|
+
if (t instanceof $root.com.quick.voice.proto.VideoInfo) return t;
|
|
2169
|
+
let e = new $root.com.quick.voice.proto.VideoInfo();
|
|
2170
|
+
switch (t.type) {
|
|
2011
2171
|
default:
|
|
2012
|
-
if (typeof
|
|
2013
|
-
|
|
2172
|
+
if (typeof t.type == "number") {
|
|
2173
|
+
e.type = t.type;
|
|
2014
2174
|
break;
|
|
2015
2175
|
}
|
|
2016
2176
|
break;
|
|
2017
2177
|
case "Camera":
|
|
2018
2178
|
case 0:
|
|
2019
|
-
|
|
2179
|
+
e.type = 0;
|
|
2020
2180
|
break;
|
|
2021
2181
|
case "Screen":
|
|
2022
2182
|
case 1:
|
|
2023
|
-
|
|
2183
|
+
e.type = 1;
|
|
2024
2184
|
break;
|
|
2025
2185
|
}
|
|
2026
|
-
return
|
|
2027
|
-
},
|
|
2028
|
-
|
|
2186
|
+
return t.isEnable != null && (e.isEnable = !!t.isEnable), t.isMute != null && (e.isMute = !!t.isMute), t.width != null && (e.width = t.width | 0), t.height != null && (e.height = t.height | 0), t.x != null && (e.x = t.x | 0), t.y != null && (e.y = t.y | 0), t.updateTime != null && ($util.Long ? (e.updateTime = $util.Long.fromValue(t.updateTime)).unsigned = !1 : typeof t.updateTime == "string" ? e.updateTime = parseInt(t.updateTime, 10) : typeof t.updateTime == "number" ? e.updateTime = t.updateTime : typeof t.updateTime == "object" && (e.updateTime = new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber())), e;
|
|
2187
|
+
}, n.toObject = function(t, e) {
|
|
2188
|
+
e || (e = {});
|
|
2029
2189
|
let s = {};
|
|
2030
|
-
return
|
|
2031
|
-
},
|
|
2190
|
+
return e.defaults && (s.type = e.enums === String ? "Camera" : 0, s.isEnable = !1, s.isMute = !1, s.width = 0, s.height = 0, s.x = 0, s.y = 0), t.type != null && t.hasOwnProperty("type") && (s.type = e.enums === String ? $root.com.quick.voice.proto.VideoType[t.type] === void 0 ? t.type : $root.com.quick.voice.proto.VideoType[t.type] : t.type), t.isEnable != null && t.hasOwnProperty("isEnable") && (s.isEnable = t.isEnable), t.isMute != null && t.hasOwnProperty("isMute") && (s.isMute = t.isMute), t.width != null && t.hasOwnProperty("width") && (s.width = t.width), t.height != null && t.hasOwnProperty("height") && (s.height = t.height), t.x != null && t.hasOwnProperty("x") && (s.x = t.x), t.y != null && t.hasOwnProperty("y") && (s.y = t.y), t.updateTime != null && t.hasOwnProperty("updateTime") && (typeof t.updateTime == "number" ? s.updateTime = e.longs === String ? String(t.updateTime) : t.updateTime : s.updateTime = e.longs === String ? $util.Long.prototype.toString.call(t.updateTime) : e.longs === Number ? new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber() : t.updateTime, e.oneofs && (s._updateTime = "updateTime")), s;
|
|
2191
|
+
}, n.prototype.toJSON = function() {
|
|
2032
2192
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
2033
|
-
},
|
|
2034
|
-
return
|
|
2035
|
-
},
|
|
2036
|
-
}(),
|
|
2037
|
-
function
|
|
2038
|
-
if (this.customKeyMap = {}, i) for (let
|
|
2193
|
+
}, n.getTypeUrl = function(t) {
|
|
2194
|
+
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.VideoInfo";
|
|
2195
|
+
}, n;
|
|
2196
|
+
}(), u.CustomInfo = function() {
|
|
2197
|
+
function n(i) {
|
|
2198
|
+
if (this.customKeyMap = {}, i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
2039
2199
|
}
|
|
2040
|
-
|
|
2041
|
-
let
|
|
2042
|
-
return Object.defineProperty(
|
|
2043
|
-
get: $util.oneOfGetter(
|
|
2044
|
-
set: $util.oneOfSetter(
|
|
2045
|
-
}),
|
|
2046
|
-
return new
|
|
2047
|
-
},
|
|
2048
|
-
if (
|
|
2200
|
+
n.prototype.roomId = "", n.prototype.customKeyMap = $util.emptyObject, n.prototype.updateTime = null;
|
|
2201
|
+
let r;
|
|
2202
|
+
return Object.defineProperty(n.prototype, "_updateTime", {
|
|
2203
|
+
get: $util.oneOfGetter(r = ["updateTime"]),
|
|
2204
|
+
set: $util.oneOfSetter(r)
|
|
2205
|
+
}), n.create = function(t) {
|
|
2206
|
+
return new n(t);
|
|
2207
|
+
}, n.encode = function(t, e) {
|
|
2208
|
+
if (e || (e = $Writer.create()), t.roomId != null && Object.hasOwnProperty.call(t, "roomId") && e.uint32(
|
|
2049
2209
|
/* id 1, wireType 2 =*/
|
|
2050
2210
|
10
|
|
2051
|
-
).string(
|
|
2211
|
+
).string(t.roomId), t.customKeyMap != null && Object.hasOwnProperty.call(t, "customKeyMap")) for (let s = Object.keys(t.customKeyMap), l = 0; l < s.length; ++l) e.uint32(
|
|
2052
2212
|
/* id 2, wireType 2 =*/
|
|
2053
2213
|
18
|
|
2054
2214
|
).fork().uint32(
|
|
@@ -2057,102 +2217,102 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2057
2217
|
).string(s[l]).uint32(
|
|
2058
2218
|
/* id 2, wireType 2 =*/
|
|
2059
2219
|
18
|
|
2060
|
-
).string(
|
|
2061
|
-
return
|
|
2220
|
+
).string(t.customKeyMap[s[l]]).ldelim();
|
|
2221
|
+
return t.updateTime != null && Object.hasOwnProperty.call(t, "updateTime") && e.uint32(
|
|
2062
2222
|
/* id 3, wireType 0 =*/
|
|
2063
2223
|
24
|
|
2064
|
-
).int64(
|
|
2065
|
-
},
|
|
2066
|
-
return this.encode(
|
|
2067
|
-
},
|
|
2068
|
-
|
|
2069
|
-
let l =
|
|
2070
|
-
for (;
|
|
2071
|
-
let
|
|
2072
|
-
if (
|
|
2073
|
-
switch (
|
|
2224
|
+
).int64(t.updateTime), e;
|
|
2225
|
+
}, n.encodeDelimited = function(t, e) {
|
|
2226
|
+
return this.encode(t, e).ldelim();
|
|
2227
|
+
}, n.decode = function(t, e, s) {
|
|
2228
|
+
t instanceof $Reader || (t = $Reader.create(t));
|
|
2229
|
+
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.CustomInfo(), d, p;
|
|
2230
|
+
for (; t.pos < l; ) {
|
|
2231
|
+
let f = t.uint32();
|
|
2232
|
+
if (f === s) break;
|
|
2233
|
+
switch (f >>> 3) {
|
|
2074
2234
|
case 1: {
|
|
2075
|
-
|
|
2235
|
+
c.roomId = t.string();
|
|
2076
2236
|
break;
|
|
2077
2237
|
}
|
|
2078
2238
|
case 2: {
|
|
2079
|
-
|
|
2080
|
-
let w =
|
|
2081
|
-
for (d = "",
|
|
2082
|
-
let
|
|
2083
|
-
switch (
|
|
2239
|
+
c.customKeyMap === $util.emptyObject && (c.customKeyMap = {});
|
|
2240
|
+
let w = t.uint32() + t.pos;
|
|
2241
|
+
for (d = "", p = ""; t.pos < w; ) {
|
|
2242
|
+
let b = t.uint32();
|
|
2243
|
+
switch (b >>> 3) {
|
|
2084
2244
|
case 1:
|
|
2085
|
-
d =
|
|
2245
|
+
d = t.string();
|
|
2086
2246
|
break;
|
|
2087
2247
|
case 2:
|
|
2088
|
-
|
|
2248
|
+
p = t.string();
|
|
2089
2249
|
break;
|
|
2090
2250
|
default:
|
|
2091
|
-
|
|
2251
|
+
t.skipType(b & 7);
|
|
2092
2252
|
break;
|
|
2093
2253
|
}
|
|
2094
2254
|
}
|
|
2095
|
-
|
|
2255
|
+
c.customKeyMap[d] = p;
|
|
2096
2256
|
break;
|
|
2097
2257
|
}
|
|
2098
2258
|
case 3: {
|
|
2099
|
-
|
|
2259
|
+
c.updateTime = t.int64();
|
|
2100
2260
|
break;
|
|
2101
2261
|
}
|
|
2102
2262
|
default:
|
|
2103
|
-
|
|
2263
|
+
t.skipType(f & 7);
|
|
2104
2264
|
break;
|
|
2105
2265
|
}
|
|
2106
2266
|
}
|
|
2107
|
-
return
|
|
2108
|
-
},
|
|
2109
|
-
return
|
|
2110
|
-
},
|
|
2111
|
-
if (typeof
|
|
2112
|
-
if (
|
|
2113
|
-
if (
|
|
2114
|
-
if (!$util.isObject(
|
|
2115
|
-
let
|
|
2116
|
-
for (let s = 0; s <
|
|
2267
|
+
return c;
|
|
2268
|
+
}, n.decodeDelimited = function(t) {
|
|
2269
|
+
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
2270
|
+
}, n.verify = function(t) {
|
|
2271
|
+
if (typeof t != "object" || t === null) return "object expected";
|
|
2272
|
+
if (t.roomId != null && t.hasOwnProperty("roomId") && !$util.isString(t.roomId)) return "roomId: string expected";
|
|
2273
|
+
if (t.customKeyMap != null && t.hasOwnProperty("customKeyMap")) {
|
|
2274
|
+
if (!$util.isObject(t.customKeyMap)) return "customKeyMap: object expected";
|
|
2275
|
+
let e = Object.keys(t.customKeyMap);
|
|
2276
|
+
for (let s = 0; s < e.length; ++s) if (!$util.isString(t.customKeyMap[e[s]])) return "customKeyMap: string{k:string} expected";
|
|
2117
2277
|
}
|
|
2118
|
-
return
|
|
2119
|
-
},
|
|
2120
|
-
if (
|
|
2121
|
-
let
|
|
2122
|
-
if (
|
|
2123
|
-
if (typeof
|
|
2124
|
-
|
|
2125
|
-
for (let s = Object.keys(
|
|
2278
|
+
return t.updateTime != null && t.hasOwnProperty("updateTime") && !$util.isInteger(t.updateTime) && !(t.updateTime && $util.isInteger(t.updateTime.low) && $util.isInteger(t.updateTime.high)) ? "updateTime: integer|Long expected" : null;
|
|
2279
|
+
}, n.fromObject = function(t) {
|
|
2280
|
+
if (t instanceof $root.com.quick.voice.proto.CustomInfo) return t;
|
|
2281
|
+
let e = new $root.com.quick.voice.proto.CustomInfo();
|
|
2282
|
+
if (t.roomId != null && (e.roomId = String(t.roomId)), t.customKeyMap) {
|
|
2283
|
+
if (typeof t.customKeyMap != "object") throw TypeError(".com.quick.voice.proto.CustomInfo.customKeyMap: object expected");
|
|
2284
|
+
e.customKeyMap = {};
|
|
2285
|
+
for (let s = Object.keys(t.customKeyMap), l = 0; l < s.length; ++l) e.customKeyMap[s[l]] = String(t.customKeyMap[s[l]]);
|
|
2126
2286
|
}
|
|
2127
|
-
return
|
|
2128
|
-
},
|
|
2129
|
-
|
|
2287
|
+
return t.updateTime != null && ($util.Long ? (e.updateTime = $util.Long.fromValue(t.updateTime)).unsigned = !1 : typeof t.updateTime == "string" ? e.updateTime = parseInt(t.updateTime, 10) : typeof t.updateTime == "number" ? e.updateTime = t.updateTime : typeof t.updateTime == "object" && (e.updateTime = new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber())), e;
|
|
2288
|
+
}, n.toObject = function(t, e) {
|
|
2289
|
+
e || (e = {});
|
|
2130
2290
|
let s = {};
|
|
2131
|
-
(
|
|
2291
|
+
(e.objects || e.defaults) && (s.customKeyMap = {}), e.defaults && (s.roomId = ""), t.roomId != null && t.hasOwnProperty("roomId") && (s.roomId = t.roomId);
|
|
2132
2292
|
let l;
|
|
2133
|
-
if (
|
|
2293
|
+
if (t.customKeyMap && (l = Object.keys(t.customKeyMap)).length) {
|
|
2134
2294
|
s.customKeyMap = {};
|
|
2135
|
-
for (let
|
|
2295
|
+
for (let c = 0; c < l.length; ++c) s.customKeyMap[l[c]] = t.customKeyMap[l[c]];
|
|
2136
2296
|
}
|
|
2137
|
-
return
|
|
2138
|
-
},
|
|
2297
|
+
return t.updateTime != null && t.hasOwnProperty("updateTime") && (typeof t.updateTime == "number" ? s.updateTime = e.longs === String ? String(t.updateTime) : t.updateTime : s.updateTime = e.longs === String ? $util.Long.prototype.toString.call(t.updateTime) : e.longs === Number ? new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber() : t.updateTime, e.oneofs && (s._updateTime = "updateTime")), s;
|
|
2298
|
+
}, n.prototype.toJSON = function() {
|
|
2139
2299
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
2140
|
-
},
|
|
2141
|
-
return
|
|
2142
|
-
},
|
|
2143
|
-
}(),
|
|
2144
|
-
const
|
|
2145
|
-
return n[
|
|
2146
|
-
}(),
|
|
2147
|
-
const
|
|
2148
|
-
return n[
|
|
2149
|
-
}(),
|
|
2150
|
-
const
|
|
2151
|
-
return n[
|
|
2152
|
-
}(),
|
|
2153
|
-
}(),
|
|
2300
|
+
}, n.getTypeUrl = function(t) {
|
|
2301
|
+
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.CustomInfo";
|
|
2302
|
+
}, n;
|
|
2303
|
+
}(), u.LayoutType = function() {
|
|
2304
|
+
const n = {}, r = Object.create(n);
|
|
2305
|
+
return r[n[0] = "AudioAndVideo"] = 0, r[n[1] = "OnlyAudio"] = 1, r[n[2] = "OnlyVideo"] = 2, r;
|
|
2306
|
+
}(), u.AudioType = function() {
|
|
2307
|
+
const n = {}, r = Object.create(n);
|
|
2308
|
+
return r[n[0] = "Microphone"] = 0, r[n[1] = "SystemVoice"] = 1, r;
|
|
2309
|
+
}(), u.VideoType = function() {
|
|
2310
|
+
const n = {}, r = Object.create(n);
|
|
2311
|
+
return r[n[0] = "Camera"] = 0, r[n[1] = "Screen"] = 1, r;
|
|
2312
|
+
}(), u;
|
|
2313
|
+
}(), a;
|
|
2154
2314
|
}(), o;
|
|
2155
|
-
}(),
|
|
2315
|
+
}(), h;
|
|
2156
2316
|
})(), createAudioInfo = () => ({
|
|
2157
2317
|
remove: !1,
|
|
2158
2318
|
isEnable: !1,
|
|
@@ -2171,85 +2331,85 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2171
2331
|
});
|
|
2172
2332
|
class RoomUser {
|
|
2173
2333
|
constructor() {
|
|
2174
|
-
|
|
2175
|
-
|
|
2334
|
+
m(this, "userId", "");
|
|
2335
|
+
m(this, "mc_audio");
|
|
2176
2336
|
// 麦克风
|
|
2177
|
-
|
|
2337
|
+
m(this, "mc_video");
|
|
2178
2338
|
// 摄像头
|
|
2179
|
-
|
|
2339
|
+
m(this, "ss_audio");
|
|
2180
2340
|
// 屏幕共享视频
|
|
2181
|
-
|
|
2341
|
+
m(this, "ss_video");
|
|
2182
2342
|
// 屏幕共享音频
|
|
2183
|
-
|
|
2184
|
-
|
|
2343
|
+
m(this, "updateTime", 0);
|
|
2344
|
+
m(this, "getUpdateTimeKey", () => {
|
|
2185
2345
|
const o = [];
|
|
2186
2346
|
return this.mc_audio && o.push(this.mc_audio.updateTime), this.mc_video && o.push(this.mc_video.updateTime), this.ss_audio && o.push(this.ss_audio.updateTime), this.ss_video && o.push(this.ss_video.updateTime), o.join("_");
|
|
2187
2347
|
});
|
|
2188
|
-
|
|
2189
|
-
var
|
|
2190
|
-
const { id:
|
|
2191
|
-
this.userId =
|
|
2192
|
-
const
|
|
2348
|
+
m(this, "init", (o) => {
|
|
2349
|
+
var t, e, s, l;
|
|
2350
|
+
const { id: a, audios: u = [], videos: n = [] } = o;
|
|
2351
|
+
this.userId = a;
|
|
2352
|
+
const r = this.getUpdateTimeKey();
|
|
2193
2353
|
this.mc_audio && (this.mc_audio.remove = !0), this.mc_video && (this.mc_video.remove = !0), this.ss_audio && (this.ss_audio.remove = !0), this.ss_video && (this.ss_video.remove = !0);
|
|
2194
|
-
for (const
|
|
2195
|
-
const { type: d = 0, isEnable:
|
|
2354
|
+
for (const c of u) {
|
|
2355
|
+
const { type: d = 0, isEnable: p = !1, isMute: f = !1, updateTime: w, volume: b = 0 } = c;
|
|
2196
2356
|
switch (d) {
|
|
2197
2357
|
case 0:
|
|
2198
2358
|
{
|
|
2199
2359
|
if (this.mc_audio || (this.mc_audio = createAudioInfo()), this.mc_audio.remove = !1, this.mc_audio.updateTime === w) break;
|
|
2200
|
-
this.mc_audio.isEnable = !!
|
|
2360
|
+
this.mc_audio.isEnable = !!p, this.mc_audio.isMute = !!f, this.mc_audio.updateTime = Number(w), this.mc_audio.volume = Number(b);
|
|
2201
2361
|
}
|
|
2202
2362
|
break;
|
|
2203
2363
|
case 1:
|
|
2204
2364
|
{
|
|
2205
2365
|
if (this.ss_audio || (this.ss_audio = createAudioInfo()), this.ss_audio.remove = !1, this.ss_audio.updateTime === w) break;
|
|
2206
|
-
this.ss_audio.isEnable = !!
|
|
2366
|
+
this.ss_audio.isEnable = !!p, this.ss_audio.isMute = !!f, this.ss_audio.updateTime = Number(w), this.ss_audio.volume = Number(b);
|
|
2207
2367
|
}
|
|
2208
2368
|
break;
|
|
2209
2369
|
}
|
|
2210
2370
|
}
|
|
2211
|
-
for (const
|
|
2212
|
-
const { type: d = 0, isEnable:
|
|
2371
|
+
for (const c of n) {
|
|
2372
|
+
const { type: d = 0, isEnable: p, isMute: f, updateTime: w, width: b, height: g, x: k, y: _ } = c;
|
|
2213
2373
|
switch (d) {
|
|
2214
2374
|
case 0:
|
|
2215
2375
|
{
|
|
2216
2376
|
if (this.mc_video || (this.mc_video = createVideoInfo()), this.mc_video.remove = !1, this.mc_video.updateTime === w) break;
|
|
2217
|
-
this.mc_video.isEnable = !!
|
|
2377
|
+
this.mc_video.isEnable = !!p, this.mc_video.isMute = !!f, this.mc_video.updateTime = Number(w) || 0, this.mc_video.sx = k || 0, this.mc_video.sy = _ || 0, this.mc_video.sw = b || 0, this.mc_video.sh = g || 0;
|
|
2218
2378
|
}
|
|
2219
2379
|
break;
|
|
2220
2380
|
case 1:
|
|
2221
2381
|
{
|
|
2222
2382
|
if (this.ss_video || (this.ss_video = createVideoInfo()), this.ss_video.remove = !1, this.ss_video.updateTime === w) break;
|
|
2223
|
-
this.ss_video.isEnable = !!
|
|
2383
|
+
this.ss_video.isEnable = !!p, this.ss_video.isMute = !!f, this.ss_video.updateTime = Number(w) || 0, this.ss_video.sx = k || 0, this.ss_video.sy = _ || 0, this.ss_video.sw = b || 0, this.ss_video.sh = g || 0;
|
|
2224
2384
|
}
|
|
2225
2385
|
break;
|
|
2226
2386
|
}
|
|
2227
2387
|
}
|
|
2228
|
-
(
|
|
2388
|
+
(t = this.mc_audio) != null && t.remove && (this.mc_audio = void 0), (e = this.mc_video) != null && e.remove && (this.mc_video = void 0), (s = this.ss_audio) != null && s.remove && (this.ss_audio = void 0), (l = this.ss_video) != null && l.remove && (this.ss_video = void 0);
|
|
2229
2389
|
const i = this.getUpdateTimeKey();
|
|
2230
|
-
|
|
2390
|
+
r !== i && (this.updateTime = (/* @__PURE__ */ new Date()).getTime());
|
|
2231
2391
|
});
|
|
2232
|
-
|
|
2233
|
-
var o,
|
|
2234
|
-
(o = this.mc_video) != null && o.destroy && this.mc_video.destroy(), (
|
|
2392
|
+
m(this, "destroy", () => {
|
|
2393
|
+
var o, a;
|
|
2394
|
+
(o = this.mc_video) != null && o.destroy && this.mc_video.destroy(), (a = this.ss_video) != null && a.destroy && this.ss_video.destroy(), this.mc_audio = void 0, this.mc_video = void 0, this.ss_audio = void 0, this.ss_video = void 0;
|
|
2235
2395
|
});
|
|
2236
2396
|
}
|
|
2237
2397
|
}
|
|
2238
|
-
const parseSEI = (
|
|
2239
|
-
let o = 0,
|
|
2398
|
+
const parseSEI = (h) => {
|
|
2399
|
+
let o = 0, a = 0;
|
|
2240
2400
|
for (; ; ) {
|
|
2241
|
-
const
|
|
2242
|
-
if (
|
|
2401
|
+
const n = h[o];
|
|
2402
|
+
if (a = a + n, o = o + 1, n !== 255) break;
|
|
2243
2403
|
}
|
|
2244
|
-
let
|
|
2404
|
+
let u = 0;
|
|
2245
2405
|
for (; ; ) {
|
|
2246
|
-
const
|
|
2247
|
-
if (
|
|
2406
|
+
const n = h[o];
|
|
2407
|
+
if (u = u + n, o = o + 1, n !== 255) break;
|
|
2248
2408
|
}
|
|
2249
|
-
if (
|
|
2250
|
-
const
|
|
2409
|
+
if (a === 5) {
|
|
2410
|
+
const n = h.slice(o, o + 16), i = Array.from(n, (f) => f.toString(16).padStart(2, "0")).join("");
|
|
2251
2411
|
o = o + 16;
|
|
2252
|
-
const
|
|
2412
|
+
const t = u - 16, e = h.slice(o, o + t), s = com.quick.voice.proto.SeiData.decode(e), { event: l = 0 } = s, c = s.data;
|
|
2253
2413
|
let d;
|
|
2254
2414
|
switch (l) {
|
|
2255
2415
|
case 0:
|
|
@@ -2259,65 +2419,68 @@ const parseSEI = (f) => {
|
|
|
2259
2419
|
d = com.quick.voice.proto.CustomInfo.decode(s.data);
|
|
2260
2420
|
break;
|
|
2261
2421
|
}
|
|
2262
|
-
return { uuid: i, ...s, event: l, data_remote:
|
|
2422
|
+
return { uuid: i, ...s, event: l, data_remote: c, data: d };
|
|
2263
2423
|
}
|
|
2264
2424
|
};
|
|
2265
2425
|
class QuickVoPlayer {
|
|
2266
|
-
constructor() {
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2426
|
+
constructor(o = {}) {
|
|
2427
|
+
m(this, "option", {
|
|
2428
|
+
debug: !1
|
|
2429
|
+
});
|
|
2430
|
+
m(this, "displayMode", "original");
|
|
2431
|
+
m(this, "prPlayer");
|
|
2432
|
+
m(this, "dom");
|
|
2433
|
+
m(this, "room", {
|
|
2271
2434
|
roomId: "",
|
|
2272
2435
|
updateTime: "",
|
|
2273
2436
|
author: "",
|
|
2274
2437
|
version: ""
|
|
2275
2438
|
});
|
|
2276
|
-
|
|
2277
|
-
|
|
2439
|
+
m(this, "usersMap", /* @__PURE__ */ new Map());
|
|
2440
|
+
m(this, "on", {
|
|
2278
2441
|
users: (o) => {
|
|
2279
2442
|
}
|
|
2280
2443
|
});
|
|
2281
|
-
|
|
2444
|
+
m(this, "init", () => {
|
|
2282
2445
|
this.prPlayer.init();
|
|
2283
2446
|
});
|
|
2284
|
-
|
|
2285
|
-
|
|
2447
|
+
m(this, "start", async (o) => (this.stop(), this.prPlayer.start(o)));
|
|
2448
|
+
m(this, "stop", () => {
|
|
2286
2449
|
this.prPlayer.stop(), this.usersMap = /* @__PURE__ */ new Map(), this.room.roomId = "", this.room.author = "", this.room.updateTime = "", this.room.version = "";
|
|
2287
2450
|
});
|
|
2288
|
-
|
|
2451
|
+
m(this, "setMute", (o) => {
|
|
2289
2452
|
this.prPlayer.setMute(o);
|
|
2290
2453
|
});
|
|
2291
|
-
|
|
2292
|
-
|
|
2454
|
+
m(this, "getStream", () => this.prPlayer.getStream());
|
|
2455
|
+
m(this, "getAllUseUpdateKey", () => {
|
|
2293
2456
|
const o = [...this.usersMap.values()];
|
|
2294
|
-
return Array.from(o, (
|
|
2457
|
+
return Array.from(o, (u) => u.updateTime).join("_");
|
|
2295
2458
|
});
|
|
2296
|
-
|
|
2297
|
-
var
|
|
2459
|
+
m(this, "checkAndCreateUser", (o, a) => {
|
|
2460
|
+
var u, n;
|
|
2298
2461
|
if (this.usersMap.has(o)) {
|
|
2299
|
-
const
|
|
2300
|
-
if (
|
|
2301
|
-
const { sx: i, sy:
|
|
2302
|
-
(
|
|
2462
|
+
const r = this.usersMap.get(o);
|
|
2463
|
+
if (r == null || r.init(a), r != null && r.mc_video) {
|
|
2464
|
+
const { sx: i, sy: t, sw: e, sh: s } = r.mc_video;
|
|
2465
|
+
(u = r == null ? void 0 : r.mc_video.worker) == null || u.setCut({ sx: i, sy: t, sw: e, sh: s });
|
|
2303
2466
|
}
|
|
2304
|
-
if (
|
|
2305
|
-
const { sx: i, sy:
|
|
2306
|
-
(
|
|
2467
|
+
if (r != null && r.ss_video) {
|
|
2468
|
+
const { sx: i, sy: t, sw: e, sh: s } = r.ss_video;
|
|
2469
|
+
(n = r == null ? void 0 : r.ss_video.worker) == null || n.setCut({ sx: i, sy: t, sw: e, sh: s });
|
|
2307
2470
|
}
|
|
2308
2471
|
} else {
|
|
2309
|
-
const
|
|
2310
|
-
if (this.usersMap.set(o,
|
|
2311
|
-
if (
|
|
2312
|
-
const { sx: i, sy:
|
|
2313
|
-
|
|
2314
|
-
|
|
2472
|
+
const r = new RoomUser();
|
|
2473
|
+
if (this.usersMap.set(o, r), r.init(a), r) {
|
|
2474
|
+
if (r.mc_video) {
|
|
2475
|
+
const { sx: i, sy: t, sw: e, sh: s } = r.mc_video, l = `${r.userId}_mc_video`, { worker: c, stream: d, destroy: p } = this.prPlayer.cut.create(l, { sx: i, sy: t, sw: e, sh: s });
|
|
2476
|
+
r.mc_video.worker = c, this.displayMode === "original" && c.setPause(!0), r.mc_video.stream = d, r.mc_video.destroy = () => {
|
|
2477
|
+
p(), this.prPlayer.cut.remove(l), this.usersMap.delete(r.userId);
|
|
2315
2478
|
};
|
|
2316
2479
|
}
|
|
2317
|
-
if (
|
|
2318
|
-
const { sx: i, sy:
|
|
2319
|
-
|
|
2320
|
-
|
|
2480
|
+
if (r.ss_video) {
|
|
2481
|
+
const { sx: i, sy: t, sw: e, sh: s } = r.ss_video, l = `${r.userId}_ss_video`, { worker: c, stream: d, destroy: p } = this.prPlayer.cut.create(l, { sx: i, sy: t, sw: e, sh: s });
|
|
2482
|
+
r.ss_video.worker = c, this.displayMode === "original" && c.setPause(!0), r.ss_video.stream = d, r.ss_video.destroy = () => {
|
|
2483
|
+
p(), this.prPlayer.cut.remove(l), this.usersMap.delete(r.userId);
|
|
2321
2484
|
};
|
|
2322
2485
|
}
|
|
2323
2486
|
}
|
|
@@ -2326,66 +2489,68 @@ class QuickVoPlayer {
|
|
|
2326
2489
|
/**
|
|
2327
2490
|
* 监听SEI信息
|
|
2328
2491
|
*/
|
|
2329
|
-
|
|
2492
|
+
m(this, "onSEI", (o) => {
|
|
2330
2493
|
try {
|
|
2331
|
-
const
|
|
2332
|
-
if (!
|
|
2333
|
-
const { event:
|
|
2334
|
-
switch (
|
|
2494
|
+
const a = parseSEI(o);
|
|
2495
|
+
if (!a) return;
|
|
2496
|
+
const { event: u, data: n } = a;
|
|
2497
|
+
switch (u) {
|
|
2335
2498
|
case 0:
|
|
2336
2499
|
{
|
|
2337
|
-
const { roomId:
|
|
2338
|
-
if (
|
|
2339
|
-
const
|
|
2500
|
+
const { roomId: r, userMap: i } = n;
|
|
2501
|
+
if (r !== this.room.roomId) return;
|
|
2502
|
+
const t = this.getAllUseUpdateKey(), e = Object.keys(i);
|
|
2340
2503
|
{
|
|
2341
2504
|
const l = [...this.usersMap.values()];
|
|
2342
|
-
for (const
|
|
2343
|
-
|
|
2505
|
+
for (const c of l)
|
|
2506
|
+
e.includes(c.userId) || c == null || c.destroy();
|
|
2344
2507
|
}
|
|
2345
|
-
for (const l of
|
|
2346
|
-
const
|
|
2347
|
-
this.checkAndCreateUser(l,
|
|
2508
|
+
for (const l of e) {
|
|
2509
|
+
const c = i[l];
|
|
2510
|
+
this.checkAndCreateUser(l, c);
|
|
2348
2511
|
}
|
|
2349
2512
|
const s = this.getAllUseUpdateKey();
|
|
2350
|
-
if (
|
|
2351
|
-
const l = [...this.usersMap.values()],
|
|
2352
|
-
this.on.users(
|
|
2513
|
+
if (t !== s && this.on.users) {
|
|
2514
|
+
const l = [...this.usersMap.values()], c = Array.from(l, ({ userId: d, mc_audio: p, mc_video: f, ss_audio: w, ss_video: b, updateTime: g }) => ({ userId: d, mc_audio: p, mc_video: f, ss_audio: w, ss_video: b, updateTime: g }));
|
|
2515
|
+
this.on.users(c);
|
|
2353
2516
|
}
|
|
2354
2517
|
}
|
|
2355
2518
|
break;
|
|
2356
2519
|
case 1:
|
|
2357
2520
|
{
|
|
2358
|
-
const { roomId:
|
|
2359
|
-
this.room.roomId =
|
|
2521
|
+
const { roomId: r, updateTime: i } = n, { author: t, version: e } = n.customKeyMap;
|
|
2522
|
+
this.room.roomId = r, this.room.updateTime = i, this.room.author = t, this.room.version = e;
|
|
2360
2523
|
}
|
|
2361
2524
|
break;
|
|
2362
2525
|
}
|
|
2363
|
-
} catch (
|
|
2364
|
-
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->onSEI: error",
|
|
2526
|
+
} catch (a) {
|
|
2527
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->onSEI: error", a);
|
|
2365
2528
|
}
|
|
2366
2529
|
});
|
|
2367
|
-
|
|
2368
|
-
var u,
|
|
2530
|
+
m(this, "setDisplayMode", (o) => {
|
|
2531
|
+
var a, u, n, r, i, t, e, s;
|
|
2369
2532
|
switch (this.displayMode = o, o) {
|
|
2370
2533
|
case "original":
|
|
2371
2534
|
{
|
|
2372
2535
|
this.prPlayer.setPause(!1);
|
|
2373
2536
|
const l = [...this.usersMap.values()];
|
|
2374
|
-
for (const
|
|
2375
|
-
(
|
|
2537
|
+
for (const c of l)
|
|
2538
|
+
(u = (a = c.mc_video) == null ? void 0 : a.worker) == null || u.setPause(!0), (r = (n = c.ss_video) == null ? void 0 : n.worker) == null || r.setPause(!0);
|
|
2376
2539
|
}
|
|
2377
2540
|
break;
|
|
2378
2541
|
case "cut":
|
|
2379
2542
|
{
|
|
2380
2543
|
this.prPlayer.setPause(!0);
|
|
2381
2544
|
const l = [...this.usersMap.values()];
|
|
2382
|
-
for (const
|
|
2383
|
-
(
|
|
2545
|
+
for (const c of l)
|
|
2546
|
+
(t = (i = c.mc_video) == null ? void 0 : i.worker) == null || t.setPause(!1), (s = (e = c.ss_video) == null ? void 0 : e.worker) == null || s.setPause(!1);
|
|
2384
2547
|
}
|
|
2385
2548
|
break;
|
|
2386
2549
|
}
|
|
2387
2550
|
});
|
|
2388
|
-
|
|
2551
|
+
const { debug: a = !1 } = o;
|
|
2552
|
+
this.option.debug = a, this.prPlayer = new et({ debug: a }), this.prPlayer.on.demuxer.sei = this.onSEI, this.prPlayer.on.demuxer.chunk = (u) => {
|
|
2553
|
+
};
|
|
2389
2554
|
}
|
|
2390
2555
|
}
|
|
2391
2556
|
export {
|