1let idbProxyableTypes,cursorAdvanceMethods;import{Big as external_big_js_Big}from"big.js";import{Socket,SocketState}from"socket.ts";var __webpack_modules__={8315(e){e.exports=t;function t(e,t){for(var n=Array(arguments.length-1),r=0,i=2,s=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise(function(i,o){n[r]=function(e){if(s)if(s=!1,e)o(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){s&&(s=!1,o(e))}})}},2939(e,t){var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=Array(64),i=Array(123),s=0;s<64;)i[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;n.encode=function(e,t,n){for(var i,s=null,o=[],a=0,l=0;t<n;){var u=e[t++];switch(l){case 0:o[a++]=r[u>>2],i=(3&u)<<4,l=1;break;case 1:o[a++]=r[i|u>>4],i=(15&u)<<2,l=2;break;case 2:o[a++]=r[i|u>>6],o[a++]=r[63&u],l=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return(l&&(o[a++]=r[i],o[a++]=61,1===l&&(o[a++]=61)),s)?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};var o="invalid encoding";n.decode=function(e,t,n){for(var r,s=n,a=0,l=0;l<e.length;){var u=e.charCodeAt(l++);if(61===u&&a>1)break;if(void 0===(u=i[u]))throw Error(o);switch(a){case 0:r=u,a=1;break;case 1:t[n++]=r<<2|(48&u)>>4,r=u,a=2;break;case 2:t[n++]=(15&r)<<4|(60&u)>>2,r=u,a=3;break;case 3:t[n++]=(3&r)<<6|u,a=0}}if(1===a)throw Error(o);return n-s},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},7259(e){function t(e,n){"string"==typeof e&&(n=e,e=void 0);var r=[];function i(e){if("string"!=typeof e){var n=s();if(t.verbose&&console.log("codegen: "+n),n="return "+n,e){for(var o=Object.keys(e),a=Array(o.length+1),l=Array(o.length),u=0;u<o.length;)a[u]=o[u],l[u]=e[o[u++]];return a[u]=n,Function.apply(null,a).apply(null,l)}return Function(n)()}for(var c=Array(arguments.length-1),d=0;d<c.length;)c[d]=arguments[++d];if(d=0,e=e.replace(/%([%dfijs])/g,function(e,t){var n=c[d++];switch(t){case"d":case"f":return String(Number(n));case"i":return String(Math.floor(n));case"j":return JSON.stringify(n);case"s":return String(n)}return"%"}),d!==c.length)throw Error("parameter count mismatch");return r.push(e),i}function s(t){return"function "+(t||n||"")+"("+(e&&e.join(",")||"")+"){\n "+r.join("\n ")+"\n}"}return i.toString=s,i}e.exports=t,t.verbose=!1},5985(e){function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},7531(e,t,n){e.exports=s;var r=n(8315),i=n(7789)("fs");function s(e,t,n){return("function"==typeof t?(n=t,t={}):t||(t={}),n)?!t.xhr&&i&&i.readFile?i.readFile(e,function(r,i){return r&&"u">typeof XMLHttpRequest?s.xhr(e,t,n):r?n(r):n(null,t.binary?i:i.toString("utf8"))}):s.xhr(e,t,n):r(s,this,e,t)}s.xhr=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){if(0!==r.status&&200!==r.status)return n(Error("status "+r.status));if(t.binary){var e=r.response;if(!e){e=[];for(var i=0;i<r.responseText.length;++i)e.push(255&r.responseText.charCodeAt(i))}return n(null,"u">typeof Uint8Array?new Uint8Array(e):e)}return n(null,r.responseText)}},t.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",e),r.send()}},8424(e){function t(e){return"u">typeof Float32Array?!function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}
1function s(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function a(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?i:s,e.writeFloatBE=r?s:i,e.readFloatLE=r?o:a,e.readFloatBE=r?a:o}():!function(){function t(e,t,n,r){var i=+(t<0);if(i&&(t=-t),0===t)e(1/t>0?0:0x80000000,n,r);else if(isNaN(t))e(0x7fc00000,n,r);else if(t>34028234663852886e22)e((i<<31|0x7f800000)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var s=Math.floor(Math.log(t)/Math.LN2),o=8388607&Math.round(t*Math.pow(2,-s)*8388608);e((i<<31|s+127<<23|o)>>>0,n,r)}}function o(e,t,n){var r=e(t,n),i=(r>>31)*2+1,s=r>>>23&255,o=8388607&r;return 255===s?o?NaN:1/0*i:0===s?1401298464324817e-60*i*o:i*Math.pow(2,s-150)*(o+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=o.bind(null,i),e.readFloatBE=o.bind(null,s)}(),"u">typeof Float64Array?!function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function s(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function a(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?i:s,e.writeDoubleBE=r?s:i,e.readDoubleLE=r?o:a,e.readDoubleBE=r?a:o}():!function(){function t(e,t,n,r,i,s){var o,a=+(r<0);if(a&&(r=-r),0===r)e(0,i,s+t),e(1/r>0?0:0x80000000,i,s+n);else if(isNaN(r))e(0,i,s+t),e(0x7ff80000,i,s+n);else if(r>17976931348623157e292)e(0,i,s+t),e((a<<31|0x7ff00000)>>>0,i,s+n);else if(r<22250738585072014e-324)e((o=r/5e-324)>>>0,i,s+t),e((a<<31|o/0x100000000)>>>0,i,s+n);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),e(0x10000000000000*(o=r*Math.pow(2,-l))>>>0,i,s+t),e((a<<31|l+1023<<20|1048576*o&1048575)>>>0,i,s+n)}}function o(e,t,n,r,i){var s=e(r,i+t),o=e(r,i+n),a=(o>>31)*2+1,l=o>>>20&2047,u=0x100000000*(1048575&o)+s;return 2047===l?u?NaN:1/0*a:0===l?5e-324*a*u:a*Math.pow(2,l-1075)*(u+0x10000000000000)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=o.bind(null,i,0,4),e.readDoubleBE=o.bind(null,s,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7789(module){module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},5211(e,t){var n=t,r=n.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=n.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=r(e),i="";n&&(i=t.shift()+"/");for(var s=0;s<t.length;)".."===t[s]?s>0&&".."!==t[s-1]?t.splice(--s,2):n?t.splice(s,1):++s:"."===t[s]?t.splice(s,1):++s;return i+t.join("/")};n.resolve=function(e,t,n){return(n||(t=i(t)),r(t))?t:(n||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},5057(e){e.exports=t;function t(e,t,n){var r=n||8192,i=r>>>1,s=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(s=e(r),o=0);var a=t.call(s,o,o+=n);return 7&o&&(o=(7|o)+1),a}}},2025(e,t){var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:(64512&n)==55296&&(64512&e.charCodeAt(r+1))==56320?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,i=null,s=[],o=0;t<n;)(r=e[t++])<128?s[o++]=r:r>191&&r<224?s[o++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[o++]=55296+(r>>10),s[o++]=56320+(1023&r)):s[o++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))},n.write=function(e,t,n){for(var r,i,s=n,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t[n++]=r:(r<2048?t[n++]=r>>
16|192:((64512&r)==55296&&(64512&(i=e.charCodeAt(o+1)))==56320?(r=65536+((1023&r)<<10)+(1023&i),++o,t[n++]=r>>18|240,t[n++]=r>>12&63|128):t[n++]=r>>12|224,t[n++]=r>>6&63|128),t[n++]=63&r|128);return n-s}},9820(e){!function(t,n,r){"use strict";"u">typeof window&&"function"==typeof define&&define.amd?define(r):e.exports?e.exports=r():n.exports?n.exports=r():n[t]=r()}("Fingerprint2",this,function(){"use strict";void 0===Array.isArray&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var e=function(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]},t=function(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]},n=function(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])},r=function(e,t){return 0==(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]},i=function(e,t){return[e[0]^t[0],e[1]^t[1]]},s=function(e){return e=t(e=i(e,[0,e[0]>>>1]),[0xff51afd7,0xed558ccd]),e=t(e=i(e,[0,e[0]>>>1]),[0xc4ceb9fe,0x1a85ec53]),e=i(e,[0,e[0]>>>1])},o=function(o,a){a=a||0;for(var l=(o=o||"").length%16,u=o.length-l,c=[0,a],d=[0,a],h=[0,0],p=[0,0],f=[0x87c37b91,0x114253d5],g=[0x4cf5ad43,0x2745937f],m=0;m<u;m+=16)h=[255&o.charCodeAt(m+4)|(255&o.charCodeAt(m+5))<<8|(255&o.charCodeAt(m+6))<<16|(255&o.charCodeAt(m+7))<<24,255&o.charCodeAt(m)|(255&o.charCodeAt(m+1))<<8|(255&o.charCodeAt(m+2))<<16|(255&o.charCodeAt(m+3))<<24],p=[255&o.charCodeAt(m+12)|(255&o.charCodeAt(m+13))<<8|(255&o.charCodeAt(m+14))<<16|(255&o.charCodeAt(m+15))<<24,255&o.charCodeAt(m+8)|(255&o.charCodeAt(m+9))<<8|(255&o.charCodeAt(m+10))<<16|(255&o.charCodeAt(m+11))<<24],h=n(h=t(h,f),31),c=e(c=n(c=i(c,h=t(h,g)),27),d),c=e(t(c,[0,5]),[0,0x52dce729]),p=n(p=t(p,g),33),d=e(d=n(d=i(d,p=t(p,f)),31),c),d=e(t(d,[0,5]),[0,0x38495ab5]);switch(h=[0,0],p=[0,0],l){case 15:p=i(p,r([0,o.charCodeAt(m+14)],48));case 14:p=i(p,r([0,o.charCodeAt(m+13)],40));case 13:p=i(p,r([0,o.charCodeAt(m+12)],32));case 12:p=i(p,r([0,o.charCodeAt(m+11)],24));case 11:p=i(p,r([0,o.charCodeAt(m+10)],16));case 10:p=i(p,r([0,o.charCodeAt(m+9)],8));case 9:p=n(p=t(p=i(p,[0,o.charCodeAt(m+8)]),g),33),d=i(d,p=t(p,f));case 8:h=i(h,r([0,o.charCodeAt(m+7)],56));case 7:h=i(h,r([0,o.charCodeAt(m+6)],48));case 6:h=i(h,r([0,o.charCodeAt(m+5)],40));case 5:h=i(h,r([0,o.charCodeAt(m+4)],32));case 4:h=i(h,r([0,o.charCodeAt(m+3)],24));case 3:h=i(h,r([0,o.charCodeAt(m+2)],16));case 2:h=i(h,r([0,o.charCodeAt(m+1)],8));case 1:h=n(h=t(h=i(h,[0,o.charCodeAt(m)]),f),31),c=i(c,h=t(h,g))}return c=e(c=i(c,[0,o.length]),d=i(d,[0,o.length])),d=e(d,c),c=e(c=s(c),d=s(d)),d=e(d,c),("00000000"+(c[0]>>>0).toString(16)).slice(-8)+("00000000"+(c[1]>>>0).toString(16)).slice(-8)+("00000000"+(d[0]>>>0).toString(16)).slice(-8)+("00000000"+(d[1]>>>0).toString(16)).slice(-8)},a={preprocessor:null,audio:{timeout:1e3,excludeIOS11:!0},fonts:{swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",userDefinedFonts:[],extendedJsFonts:!1},screen:{detectScreenOrientation:!0},plugins:{sortPluginsFor:[/palemoon/i],excludeIE:!1},extraComponents:[],excludes:{enumerateDevices:!0,pixelRatio:!0,doNotTrack:!0,fontsFlash:!0,adBlock:!0},NOT_AVAILABLE:"not available",ERROR:"error",EXCLUDED:"excluded"},l=function(e,t){if(Array.prototype.forEach&&e.forEach===Array.prototype.forEach)e.forEach(t);else if(e.length===+e.length)for(var n=0,r=e.length;n<r;n++)t(e[n],n,e);else for(var i in e)e.hasOwnProperty(i)&&t(e[i],i,e)},u=function(e,t){var n=[];return null==e?n:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(l(e,function(e,r,i){n.push(t(e,r,i))}),n)},c=function(e,t){var n,r;if(null==t)return e;for(r in t)null==(n=t[r])||Object.prototype.hasOwnProperty.call(e,r)||(e[r]=n);return e},d=function(){return navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices},h=function(e){var t=[window.screen.width,window.screen.height];return e.screen.detectScreenOrientation&&t.sort().reverse(),t}
vendor: 4,126 bytes, line 1
1,p=function(e){if(window.screen.availWidth&&window.screen.availHeight){var t=[window.screen.availHeight,window.screen.availWidth];return e.screen.detectScreenOrientation&&t.sort().reverse(),t}return e.NOT_AVAILABLE},f=function(e){if(null==navigator.plugins)return e.NOT_AVAILABLE;for(var t=[],n=0,r=navigator.plugins.length;n<r;n++)navigator.plugins[n]&&t.push(navigator.plugins[n]);return m(e)&&(t=t.sort(function(e,t){return e.name>t.name?1:e.name<t.name?-1:0})),u(t,function(e){var t=u(e,function(e){return[e.type,e.suffixes]});return[e.name,e.description,t]})},g=function(e){var t=[];return Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(window,"ActiveXObject")||"ActiveXObject"in window?t=u(["AcroPDF.PDF","Adodb.Stream","AgControl.AgControl","DevalVRXCtrl.DevalVRXCtrl.1","MacromediaFlashPaper.MacromediaFlashPaper","Msxml2.DOMDocument","Msxml2.XMLHTTP","PDF.PdfCtrl","QuickTime.QuickTime","QuickTimeCheckObject.QuickTimeCheck.1","RealPlayer","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","Scripting.Dictionary","SWCtl.SWCtl","Shell.UIHelper","ShockwaveFlash.ShockwaveFlash","Skype.Detection","TDCCtl.TDCCtl","WMPlayer.OCX","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1"],function(t){try{return new window.ActiveXObject(t),t}catch(t){return e.ERROR}}):t.push(e.NOT_AVAILABLE),navigator.plugins&&(t=t.concat(f(e))),t},m=function(e){for(var t=!1,n=0,r=e.plugins.sortPluginsFor.length;n<r;n++){var i=e.plugins.sortPluginsFor[n];if(navigator.userAgent.match(i)){t=!0;break}}return t},y=function(e){try{return!!window.sessionStorage}catch(t){return e.ERROR}},v=function(e){try{return!!window.localStorage}catch(t){return e.ERROR}},b=function(e){if(N())return e.EXCLUDED;try{return!!window.indexedDB}catch(t){return e.ERROR}},w=function(e){return navigator.hardwareConcurrency?navigator.hardwareConcurrency:e.NOT_AVAILABLE},O=function(e){return navigator.cpuClass||e.NOT_AVAILABLE},S=function(e){return navigator.platform?navigator.platform:e.NOT_AVAILABLE},A=function(e){return navigator.doNotTrack?navigator.doNotTrack:navigator.msDoNotTrack?navigator.msDoNotTrack:window.doNotTrack?window.doNotTrack:e.NOT_AVAILABLE},I=function(){var e,t=0;void 0!==navigator.maxTouchPoints?t=navigator.maxTouchPoints:void 0!==navigator.msMaxTouchPoints&&(t=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent"),e=!0}catch(t){e=!1}return[t,e,"ontouchstart"in window]},T=function(e){var t=[],n=document.createElement("canvas");n.width=2e3,n.height=200,n.style.display="inline";var r=n.getContext("2d");return r.rect(0,0,10,10),r.rect(2,2,6,6),t.push("canvas winding:"+(!1===r.isPointInPath(5,5,"evenodd")?"yes":"no")),r.textBaseline="alphabetic",r.fillStyle="#f60",r.fillRect(125,1,62,20),r.fillStyle="#069",e.dontUseFakeFontInCanvas?r.font="11pt Arial":r.font="11pt no-real-font-123",r.fillText("Cwm fjordbank glyphs vext quiz, \uD83D\uDE03",2,15),r.fillStyle="rgba(102, 204, 0, 0.2)",r.font="18pt Arial",r.fillText("Cwm fjordbank glyphs vext quiz, \uD83D\uDE03",4,45),r.globalCompositeOperation="multiply",r.fillStyle="rgb(255,0,255)",r.beginPath(),r.arc(50,50,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(0,255,255)",r.beginPath(),r.arc(100,50,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(255,255,0)",r.beginPath(),r.arc(75,100,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(255,0,255)",r.arc(75,75,75,0,2*Math.PI,!0),r.arc(75,75,25,0,2*Math.PI,!0),r.fill("evenodd"),n.toDataURL&&t.push("canvas fp:"+n.toDataURL()),t},E=function(){var e,t=function(t){return e.clearColor(0,0,0,1),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),"["+t[0]+", "+t[1]+"]"},n=function(e){var t=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic");if(!t)return null;var n=e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT);return 0===n&&(n=2),n};if(!(e=G()))return null;var r=[],i="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;
1void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",s="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o);var a=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);e.bufferData(e.ARRAY_BUFFER,a,e.STATIC_DRAW),o.itemSize=3,o.numItems=3;var u=e.createProgram(),c=e.createShader(e.VERTEX_SHADER);e.shaderSource(c,i),e.compileShader(c);var d=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(d,s),e.compileShader(d),e.attachShader(u,c),e.attachShader(u,d),e.linkProgram(u),e.useProgram(u),u.vertexPosAttrib=e.getAttribLocation(u,"attrVertex"),u.offsetUniform=e.getUniformLocation(u,"uniformOffset"),e.enableVertexAttribArray(u.vertexPosArray),e.vertexAttribPointer(u.vertexPosAttrib,o.itemSize,e.FLOAT,!1,0,0),e.uniform2f(u.offsetUniform,1,1),e.drawArrays(e.TRIANGLE_STRIP,0,o.numItems);try{r.push(e.canvas.toDataURL())}catch(e){}r.push("extensions:"+(e.getSupportedExtensions()||[]).join(";")),r.push("webgl aliased line width range:"+t(e.getParameter(e.ALIASED_LINE_WIDTH_RANGE))),r.push("webgl aliased point size range:"+t(e.getParameter(e.ALIASED_POINT_SIZE_RANGE))),r.push("webgl alpha bits:"+e.getParameter(e.ALPHA_BITS)),r.push("webgl antialiasing:"+(e.getContextAttributes().antialias?"yes":"no")),r.push("webgl blue bits:"+e.getParameter(e.BLUE_BITS)),r.push("webgl depth bits:"+e.getParameter(e.DEPTH_BITS)),r.push("webgl green bits:"+e.getParameter(e.GREEN_BITS)),r.push("webgl max anisotropy:"+n(e)),r.push("webgl max combined texture image units:"+e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),r.push("webgl max cube map texture size:"+e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),r.push("webgl max fragment uniform vectors:"+e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),r.push("webgl max render buffer size:"+e.getParameter(e.MAX_RENDERBUFFER_SIZE)),r.push("webgl max texture image units:"+e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),r.push("webgl max texture size:"+e.getParameter(e.MAX_TEXTURE_SIZE)),r.push("webgl max varying vectors:"+e.getParameter(e.MAX_VARYING_VECTORS)),r.push("webgl max vertex attribs:"+e.getParameter(e.MAX_VERTEX_ATTRIBS)),r.push("webgl max vertex texture image units:"+e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),r.push("webgl max vertex uniform vectors:"+e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),r.push("webgl max viewport dims:"+t(e.getParameter(e.MAX_VIEWPORT_DIMS))),r.push("webgl red bits:"+e.getParameter(e.RED_BITS)),r.push("webgl renderer:"+e.getParameter(e.RENDERER)),r.push("webgl shading language version:"+e.getParameter(e.SHADING_LANGUAGE_VERSION)),r.push("webgl stencil bits:"+e.getParameter(e.STENCIL_BITS)),r.push("webgl vendor:"+e.getParameter(e.VENDOR)),r.push("webgl version:"+e.getParameter(e.VERSION));try{var h=e.getExtension("WEBGL_debug_renderer_info");h&&(r.push("webgl unmasked vendor:"+e.getParameter(h.UNMASKED_VENDOR_WEBGL)),r.push("webgl unmasked renderer:"+e.getParameter(h.UNMASKED_RENDERER_WEBGL)))}catch(e){}return e.getShaderPrecisionFormat&&l(["FLOAT","INT"],function(t){l(["VERTEX","FRAGMENT"],function(n){l(["HIGH","MEDIUM","LOW"],function(i){l(["precision","rangeMin","rangeMax"],function(s){var o=e.getShaderPrecisionFormat(e[n+"_SHADER"],e[i+"_"+t])[s];"precision"!==s&&(s="precision "+s);var a=["webgl ",n.toLowerCase()," shader ",i.toLowerCase()," ",t.toLowerCase()," ",s,":",o].join("");r.push(a)})})})}),V(e),r},k=function(){try{var e=G(),t=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(t.UNMASKED_VENDOR_WEBGL)+"~"+e.getParameter(t.UNMASKED_RENDERER_WEBGL);return V(e),n}catch(e){return null}},_=function(){var e=document.createElement("div");e.innerHTML=" ",e.className="adsbox";var t=!1;try{document.body.appendChild(e),t=0===document.getElementsByClassName("adsbox")[0].offsetHeight,document.body.removeChild(e)}catch(e){t=!1}return t},x=function(){if(void 0!==navigator.languages)try{if(navigator.languages[0].substr(0,2)!==navigator.language.substr(0,2))return!0}catch(e){return!0}return!1}
1,M=function(){return window.screen.width<window.screen.availWidth||window.screen.height<window.screen.availHeight},C=function(){var e,t=navigator.userAgent.toLowerCase(),n=navigator.oscpu,r=navigator.platform.toLowerCase();if(e=t.indexOf("windows phone")>=0?"Windows Phone":t.indexOf("windows")>=0||t.indexOf("win16")>=0||t.indexOf("win32")>=0||t.indexOf("win64")>=0||t.indexOf("win95")>=0||t.indexOf("win98")>=0||t.indexOf("winnt")>=0||t.indexOf("wow64")>=0?"Windows":t.indexOf("android")>=0?"Android":t.indexOf("linux")>=0||t.indexOf("cros")>=0||t.indexOf("x11")>=0?"Linux":t.indexOf("iphone")>=0||t.indexOf("ipad")>=0||t.indexOf("ipod")>=0||t.indexOf("crios")>=0||t.indexOf("fxios")>=0?"iOS":t.indexOf("macintosh")>=0||t.indexOf("mac_powerpc)")>=0?"Mac":"Other",("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&"Windows"!==e&&"Windows Phone"!==e&&"Android"!==e&&"iOS"!==e&&"Other"!==e&&-1===t.indexOf("cros"))return!0;if(void 0!==n){if((n=n.toLowerCase()).indexOf("win")>=0&&"Windows"!==e&&"Windows Phone"!==e)return!0;if(n.indexOf("linux")>=0&&"Linux"!==e&&"Android"!==e)return!0;if(n.indexOf("mac")>=0&&"Mac"!==e&&"iOS"!==e)return!0;else if((-1===n.indexOf("win")&&-1===n.indexOf("linux")&&-1===n.indexOf("mac"))!=("Other"===e))return!0}return!!(r.indexOf("win")>=0&&"Windows"!==e&&"Windows Phone"!==e||(r.indexOf("linux")>=0||r.indexOf("android")>=0||r.indexOf("pike")>=0)&&"Linux"!==e&&"Android"!==e||(r.indexOf("mac")>=0||r.indexOf("ipad")>=0||r.indexOf("ipod")>=0||r.indexOf("iphone")>=0)&&"Mac"!==e&&"iOS"!==e)||!(r.indexOf("arm")>=0&&"Windows Phone"===e||r.indexOf("pike")>=0&&t.indexOf("opera mini")>=0)&&((0>r.indexOf("win")&&0>r.indexOf("linux")&&0>r.indexOf("mac")&&0>r.indexOf("iphone")&&0>r.indexOf("ipad")&&0>r.indexOf("ipod"))!=("Other"===e)||void 0===navigator.plugins&&"Windows"!==e&&"Windows Phone"!==e)},P=function(){var e,t,n=navigator.userAgent.toLowerCase(),r=navigator.productSub;if(n.indexOf("edge/")>=0||n.indexOf("iemobile/")>=0||n.indexOf("opera mini")>=0)return!1;if(("Chrome"===(e=n.indexOf("firefox/")>=0?"Firefox":n.indexOf("opera/")>=0||n.indexOf(" opr/")>=0?"Opera":n.indexOf("chrome/")>=0?"Chrome":n.indexOf("safari/")>=0?n.indexOf("android 1.")>=0||n.indexOf("android 2.")>=0||n.indexOf("android 3.")>=0||n.indexOf("android 4.")>=0?"AOSP":"Safari":n.indexOf("trident/")>=0?"Internet Explorer":"Other")||"Safari"===e||"Opera"===e)&&"20030107"!==r)return!0;var i=eval.toString().length;if(37===i&&"Safari"!==e&&"Firefox"!==e&&"Other"!==e||39===i&&"Internet Explorer"!==e&&"Other"!==e||33===i&&"Chrome"!==e&&"AOSP"!==e&&"Opera"!==e&&"Other"!==e)return!0;try{throw"a"}catch(e){try{e.toSource(),t=!0}catch(e){t=!1}}return t&&"Firefox"!==e&&"Other"!==e},B=function(){var e=document.createElement("canvas");return!!(e.getContext&&e.getContext("2d"))},L=function(){if(!B())return!1;var e=G(),t=!!window.WebGLRenderingContext&&!!e;return V(e),t},R=function(){return"Microsoft Internet Explorer"===navigator.appName||!!("Netscape"===navigator.appName&&/Trident/.test(navigator.userAgent))},N=function(){return("msWriteProfilerMark"in window)+("msLaunchUri"in navigator)+("msSaveBlob"in navigator)>=2},j=function(){return void 0!==window.swfobject},D=function(){return window.swfobject.hasFlashPlayerVersion("9.0.0")},U=function(e){var t=document.createElement("div");t.setAttribute("id",e.fonts.swfContainerId),document.body.appendChild(t)},F=function(e,t){var n="___fp_swf_loaded";window[n]=function(t){e(t)};var r=t.fonts.swfContainerId;U();var i={onReady:n},s={allowScriptAccess:"always",menu:"false"};window.swfobject.embedSWF(t.fonts.swfPath,r,"1","1","9.0.0",!1,i,s,{})},G=function(){var e=document.createElement("canvas"),t=null;try{t=e.getContext("webgl")||e.getContext("experimental-webgl")}catch(e){}return t||(t=null),t},V=function(e){var t=e.getExtension("WEBGL_lose_context");null!=t&&t.loseContext()},J=[{key:"userAgent",getData:function(e){e(navigator.userAgent)}},{key:"webdriver",getData:function(e,t){e(null==navigator.webdriver?t.NOT_AVAILABLE:navigator.webdriver)}},{key:"language",getData:function(e,t){e(navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||t.NOT_AVAILABLE)}},{key:"colorDepth",getData:function(e,t){e(window.screen.colorDepth||t.
1NOT_AVAILABLE)}},{key:"deviceMemory",getData:function(e,t){e(navigator.deviceMemory||t.NOT_AVAILABLE)}},{key:"pixelRatio",getData:function(e,t){e(window.devicePixelRatio||t.NOT_AVAILABLE)}},{key:"hardwareConcurrency",getData:function(e,t){e(w(t))}},{key:"screenResolution",getData:function(e,t){e(h(t))}},{key:"availableScreenResolution",getData:function(e,t){e(p(t))}},{key:"timezoneOffset",getData:function(e){e(new Date().getTimezoneOffset())}},{key:"timezone",getData:function(e,t){e(window.Intl&&window.Intl.DateTimeFormat&&new window.Intl.DateTimeFormat().resolvedOptions().timeZone||t.NOT_AVAILABLE)}},{key:"sessionStorage",getData:function(e,t){e(y(t))}},{key:"localStorage",getData:function(e,t){e(v(t))}},{key:"indexedDb",getData:function(e,t){e(b(t))}},{key:"addBehavior",getData:function(e){e(!!window.HTMLElement.prototype.addBehavior)}},{key:"openDatabase",getData:function(e){e(!!window.openDatabase)}},{key:"cpuClass",getData:function(e,t){e(O(t))}},{key:"platform",getData:function(e,t){e(S(t))}},{key:"doNotTrack",getData:function(e,t){e(A(t))}},{key:"plugins",getData:function(e,t){e(R()?t.plugins.excludeIE?t.EXCLUDED:g(t):f(t))}},{key:"canvas",getData:function(e,t){e(B()?T(t):t.NOT_AVAILABLE)}},{key:"webgl",getData:function(e,t){e(L()?E():t.NOT_AVAILABLE)}},{key:"webglVendorAndRenderer",getData:function(e){L()?e(k()):e()}},{key:"adBlock",getData:function(e){e(_())}},{key:"hasLiedLanguages",getData:function(e){e(x())}},{key:"hasLiedResolution",getData:function(e){e(M())}},{key:"hasLiedOs",getData:function(e){e(C())}},{key:"hasLiedBrowser",getData:function(e){e(P())}},{key:"touchSupport",getData:function(e){e(I())}},{key:"fonts",getData:function(e,t){var n=["monospace","sans-serif","serif"],r=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"];if(t.fonts.extendedJsFonts){var i=
vendor: 6,127 bytes, line 1
1["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"]
1;r=r.concat(i)}r=(r=r.concat(t.fonts.userDefinedFonts)).filter(function(e,t){return r.indexOf(e)===t});var s="mmmmmmmmmmlli",o="72px",a=document.getElementsByTagName("body")[0],l=document.createElement("div"),u=document.createElement("div"),c={},d={},h=function(){var e=document.createElement("span");return e.style.position="absolute",e.style.left="-9999px",e.style.fontSize=o,e.style.fontStyle="normal",e.style.fontWeight="normal",e.style.letterSpacing="normal",e.style.lineBreak="auto",e.style.lineHeight="normal",e.style.textTransform="none",e.style.textAlign="left",e.style.textDecoration="none",e.style.textShadow="none",e.style.whiteSpace="normal",e.style.wordBreak="normal",e.style.wordSpacing="normal",e.innerHTML=s,e},p=function(e,t){var n=h();return n.style.fontFamily="'"+e+"',"+t,n},f=function(){for(var e={},t=0,i=r.length;t<i;t++){for(var s=[],o=0,a=n.length;o<a;o++){var l=p(r[t],n[o]);u.appendChild(l),s.push(l)}e[r[t]]=s}return e},g=function(e){for(var t=!1,r=0;r<n.length&&!(t=e[r].offsetWidth!==c[n[r]]||e[r].offsetHeight!==d[n[r]]);r++);return t},m=function(){for(var e=[],t=0,r=n.length;t<r;t++){var i=h();i.style.fontFamily=n[t],l.appendChild(i),e.push(i)}return e}();a.appendChild(l);for(var y=0,v=n.length;y<v;y++)c[n[y]]=m[y].offsetWidth,d[n[y]]=m[y].offsetHeight;var b=f();a.appendChild(u);for(var w=[],O=0,S=r.length;O<S;O++)g(b[r[O]])&&w.push(r[O]);a.removeChild(u),a.removeChild(l),e(w)},pauseBefore:!0},{key:"fontsFlash",getData:function(e,t){return j()?D()?t.fonts.swfPath?void F(function(t){e(t)},t):e("missing options.fonts.swfPath"):e("flash not installed"):e("swf object not loaded")},pauseBefore:!0},{key:"audio",getData:function(e,t){var n=t.audio;if(n.excludeIOS11&&navigator.userAgent.match(/OS 11.+Version\/11.+Safari/))return e(t.EXCLUDED);var r=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(null==r)return e(t.NOT_AVAILABLE);var i=new r(1,44100,44100),s=i.createOscillator();s.type="triangle",s.frequency.setValueAtTime(1e4,i.currentTime);var o=i.createDynamicsCompressor();l([["threshold",-50],["knee",40],["ratio",12],["reduction",-20],["attack",0],["release",.25]],function(e){void 0!==o[e[0]]&&"function"==typeof o[e[0]].setValueAtTime&&o[e[0]].setValueAtTime(e[1],i.currentTime)}),s.connect(o),o.connect(i.destination),s.start(0),i.startRendering();var a=setTimeout(function(){return console.warn('Audio fingerprint timed out. Please report bug at https://github.com/fingerprintjs/fingerprintjs with your user agent: "'+navigator.userAgent+'".'),i.oncomplete=function(){},i=null,e("audioTimeout")},n.timeout);i.oncomplete=function(t){var n;try{clearTimeout(a),n=t.renderedBuffer.getChannelData(0).slice(4500,5e3).reduce(function(e,t){return e+Math.abs(t)},0).toString(),s.disconnect(),o.disconnect()}catch(t){e(t);return}e(n)}}},{key:"enumerateDevices",getData:function(e,t){if(!d())return e(t.NOT_AVAILABLE);navigator.mediaDevices.enumerateDevices().then(function(t){e(t.map(function(e){return"id="+e.deviceId+";gid="+e.groupId+";"+e.kind+";"+e.label}))}).catch(function(t){e(t)})}}],q=function(e){throw Error("'new Fingerprint()' is deprecated, see https://github.com/fingerprintjs/fingerprintjs#upgrade-guide-from-182-to-200")};return q.get=function(e,t){t?e||(e={}):(t=e,e={}),c(e,a),e.components=e.extraComponents.concat(J);var n={data:[],addPreprocessedComponent:function(t,r){"function"==typeof e.preprocessor&&(r=e.preprocessor(t,r)),n.data.push({key:t,value:r})}},r=-1,i=function(s){if((r+=1)>=e.components.length)return void t(n.data);var o=e.components[r];if(e.excludes[o.key])return void i(!1);if(!s&&o.pauseBefore){r-=1,setTimeout(function(){i(!0)},1);return}try{o.getData(function(e){n.addPreprocessedComponent(o.key,e),i(!1)},e)}catch(e){n.addPreprocessedComponent(o.key,String(e)),i(!1)}};i(!1)},q.getPromise=function(e){return new Promise(function(t,n){q.get(e,t)})},q.getV18=function(e,t){return null==t&&(t=e,e={}),q.get(e,function(n){for(var r=[],i=0;i<n.length;i++){var s=n[i];if(s.value===(e.NOT_AVAILABLE||"not available"))r.push({key:s.key,value:"unknown"});else if("plugins"===s.key)r.push({key:"plugins",value:u(s.value,function(e){var t=u(e[2],function(e){return e.join?e.
1join("~"):e}).join(",");return[e[0],e[1],t].join("::")})});else if(-1!==["canvas","webgl"].indexOf(s.key)&&Array.isArray(s.value))r.push({key:s.key,value:s.value.join("~")});else if(-1!==["sessionStorage","localStorage","indexedDb","addBehavior","openDatabase"].indexOf(s.key))if(!s.value)continue;else r.push({key:s.key,value:1});else s.value?r.push(s.value.join?{key:s.key,value:s.value.join(";")}:s):r.push({key:s.key,value:s.value})}var a=o(u(r,function(e){return e.value}).join("~~~"),31);t(a,r)})},q.x64hash128=o,q.VERSION="2.1.4",q})},5540(e,t,n){e.exports=n(5093)},9380(e){e.exports=r;var t,n=/\/|\./;function r(e,t){n.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),r[e]=t}r("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),r("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),r("timestamp",{Timestamp:t}),r("empty",{Empty:{fields:{}}}),r("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),r("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),r("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),r.get=function(e){return r[e]||null}},8833(e,t,n){var r=t,i=n(2764),s=n(8965);function o(e,t,n,r){var s=!1;if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",r);for(var o=t.resolvedType.values,a=Object.keys(o),l=0;l<a.length;++l)o[a[l]]!==t.typeDefault||s||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',r,r,r),t.repeated||e("break"),s=!0),e("case%j:",a[l])("case %i:",o[a[l]])("m%s=%j",r,o[a[l]])("break");e("}")}else e('if(typeof d%s!=="object")',r)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",r,n,r);else{var u=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",r,r);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",r,r);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",r,r);break;case"uint64":u=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,u)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,u?"true":"");break;case"bytes":e('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length >= 0)",r)("m%s=d%s",r,r);break;case"string":e("m%s=String(d%s)",r,r);break;case"bool":e("m%s=Boolean(d%s)",r,r)}}return e}function a(e,t,n,r){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?(types[%i].values[m
1%s]===undefined?m%s:types[%i].values[m%s]):m%s",r,n,r,r,n,r,r):e("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var s=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,s?"true":"",r);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:e("d%s=m%s",r,r)}}return e}r.fromObject=function(e){var t=e.fieldsArray,n=s.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r<t.length;++r){var a=t[r].resolve(),l=s.safeProp(a.name);a.map?(n("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),o(n,a,r,l+"[ks[i]]")("}")("}")):a.repeated?(n("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),o(n,a,r,l+"[i]")("}")("}")):(a.resolvedType instanceof i||n("if(d%s!=null){",l),o(n,a,r,l),a.resolvedType instanceof i||n("}"))}return n("return m")},r.toObject=function(e){var t=e.fieldsArray.slice().sort(s.compareFieldsById);if(!t.length)return s.codegen()("return {}");for(var n=s.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),r=[],o=[],l=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?r:t[u].map?o:l).push(t[u]);if(r.length){for(n("if(o.arrays||o.defaults){"),u=0;u<r.length;++u)n("d%s=[]",s.safeProp(r[u].name));n("}")}if(o.length){for(n("if(o.objects||o.defaults){"),u=0;u<o.length;++u)n("d%s={}",s.safeProp(o[u].name));n("}")}if(l.length){for(n("if(o.defaults){"),u=0;u<l.length;++u){var c=l[u],d=s.safeProp(c.name);if(c.resolvedType instanceof i)n("d%s=o.enums===String?%j:%j",d,c.resolvedType.valuesById[c.typeDefault],c.typeDefault);else if(c.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",c.typeDefault.low,c.typeDefault.high,c.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",d)("}else")("d%s=o.longs===String?%j:%i",d,c.typeDefault.toString(),c.typeDefault.toNumber());else if(c.bytes){var h="["+Array.prototype.slice.call(c.typeDefault).join(",")+"]";n("if(o.bytes===String)d%s=%j",d,String.fromCharCode.apply(String,c.typeDefault))("else{")("d%s=%s",d,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",d,d)("}")}else n("d%s=%j",d,c.typeDefault)}n("}")}var p=!1;for(u=0;u<t.length;++u){var c=t[u],f=e._fieldsArray.indexOf(c),d=s.safeProp(c.name);c.map?(p||(p=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",d,d)("d%s={}",d)("for(var j=0;j<ks2.length;++j){"),a(n,c,f,d+"[ks2[j]]")("}")):c.repeated?(n("if(m%s&&m%s.length){",d,d)("d%s=[]",d)("for(var j=0;j<m%s.length;++j){",d),a(n,c,f,d+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",d,c.name),a(n,c,f,d),c.partOf&&n("if(o.oneofs)")("d%s=%j",s.safeProp(c.partOf.name),c.name)),n("}")}return n("return d")}},5849(e,t,n){e.exports=a;var r=n(2764),i=n(5500),s=n(8965);function o(e){return"missing required '"+e.name+"'"}function a(e){var t=s.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter(function(e){return e.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var n=0;n<e.fieldsArray.length;++n){var a=e._fieldsArray[n].resolve(),l=a.resolvedType instanceof r?"int32":a.type,u="m"+s.safeProp(a.name);t("case %i: {",a.id),a.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==i.defaults[a.keyType]?t("k=%j",i.defaults[a.keyType]):t("k=null"),void 0!==i.defaults[l]?t("value=%j",i.defaults[l]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===i.basic[l]?t("value=types[%i].decode(r,r.uint32())",n):t("value=r.%s()",l),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==i.packed[l]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,l)("}else"),void 0===i.basic[l]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,n):t("%s.push(r.%s())",u,l)):void 0===i.basic[l]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,n):t("%s=r.%s()",u,l),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),n=0;n<e._fieldsArray.length;++n){var c=e._fieldsArray[n];c.required&&t("if(!m.hasOwnProperty(%j))",c.name)("throw util.ProtocolError(%j,{instance:m})",o(c))}return t("return m")}},4285(e,t,n){e.exports=a;var r=n(2764),i=n(5500),s=n(8965);function o(e,t,n,r){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(t.id<<3|2)>>>0)}
1function a(e){for(var t,n,a=s.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),l=e.fieldsArray.slice().sort(s.compareFieldsById),t=0;t<l.length;++t){var u=l[t].resolve(),c=e._fieldsArray.indexOf(u),d=u.resolvedType instanceof r?"int32":u.type,h=i.basic[d];n="m"+s.safeProp(u.name),u.map?(a("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",n,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",n)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|i.mapKey[u.keyType],u.keyType),void 0===h?a("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",c,n):a(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,d,n),a("}")("}")):u.repeated?(a("if(%s!=null&&%s.length){",n,n),u.packed&&void 0!==i.packed[d]?a("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",n)("w.%s(%s[i])",d,n)("w.ldelim()"):(a("for(var i=0;i<%s.length;++i)",n),void 0===h?o(a,u,c,n+"[i]"):a("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,d,n)),a("}")):(u.optional&&a("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",n,u.name),void 0===h?o(a,u,c,n):a("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,d,n))}return a("return w")}},2764(e,t,n){e.exports=o;var r=n(4998);((o.prototype=Object.create(r.prototype)).constructor=o).className="Enum";var i=n(1750),s=n(8965);function o(e,t,n,i,s,o){if(r.call(this,e,n),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=s||{},this.valuesOptions=o,this.reserved=void 0,t)for(var a=Object.keys(t),l=0;l<a.length;++l)"number"==typeof t[a[l]]&&(this.valuesById[this.values[a[l]]=t[a[l]]]=a[l])}o.fromJSON=function(e,t){var n=new o(e,t.values,t.options,t.comment,t.comments);return n.reserved=t.reserved,n},o.prototype.toJSON=function(e){var t=!!e&&!!e.keepComments;return s.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},o.prototype.add=function(e,t,n,r){if(!s.isString(e))throw TypeError("name must be a string");if(!s.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return r&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=r||null),this.comments[e]=n||null,this},o.prototype.remove=function(e){if(!s.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},o.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},o.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},9221(e,t,n){e.exports=u;var r,i=n(4998);((u.prototype=Object.create(i.prototype)).constructor=u).className="Field";var s=n(2764),o=n(5500),a=n(8965),l=/^required|optional|repeated$/;function u(e,t,n,r,s,u,c){if(a.isObject(r)?(c=s,u=r,r=s=void 0):a.isObject(s)&&(c=u,u=s,s=void 0),i.call(this,e,u),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(n))throw TypeError("type must be a string");if(void 0!==r&&!l.test(r=r.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==s&&!a.isString(s))throw TypeError("extend must be a string");"proto3_optional"===r&&(r="optional"),this.rule=r&&"optional"!==r?r:void 0,this.type=n,this.id=t,this.extend=s||void 0,this.required="required"===r,this.optional=!this.required,this.repeated="repeated"===r,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==o.long[n],this.bytes="bytes"===n,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=c}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,n){return"packed"===e&&(this._packed=null),i.prototype.setOption.call(this,e,t,n)},u.prototype.toJSON=function(e){var t=!!e&&!!e.keepComments;return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=o.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.t
1ype),this.resolvedType instanceof r?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof s&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof s)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof r&&(this.parent.ctor.prototype[this.name]=this.defaultValue),i.prototype.resolve.call(this)},u.d=function(e,t,n,r){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(i,s){a.decorateType(i.constructor).add(new u(s,e,t,n,{default:r}))}},u._configure=function(e){r=e}},5012(e,t,n){var r=e.exports=n(991);function i(e,t,n){return"function"==typeof t?(n=t,t=new r.Root):t||(t=new r.Root),t.load(e,n)}function s(e,t){return t||(t=new r.Root),t.loadSync(e)}r.build="light",r.load=i,r.loadSync=s,r.encoder=n(4285),r.decoder=n(5849),r.verifier=n(2043),r.converter=n(8833),r.ReflectionObject=n(4998),r.Namespace=n(1750),r.Root=n(7973),r.Enum=n(2764),r.Type=n(5769),r.Field=n(9221),r.OneOf=n(6724),r.MapField=n(5763),r.Service=n(4230),r.Method=n(3040),r.Message=n(1654),r.wrappers=n(1257),r.types=n(5500),r.util=n(8965),r.ReflectionObject._configure(r.Root),r.Namespace._configure(r.Type,r.Service,r.Enum),r.Root._configure(r.Type),r.Field._configure(r.Type)},991(e,t,n){var r=t;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(9970),r.BufferWriter=n(1475),r.Reader=n(562),r.BufferReader=n(5171),r.util=n(8045),r.rpc=n(3622),r.roots=n(1696),r.configure=i,i()},5093(e,t,n){var r=e.exports=n(5012);r.build="full",r.tokenize=n(3696),r.parse=n(4362),r.common=n(9380),r.Root._configure(r.Type,r.parse,r.common)},5763(e,t,n){e.exports=o;var r=n(9221);((o.prototype=Object.create(r.prototype)).constructor=o).className="MapField";var i=n(5500),s=n(8965);function o(e,t,n,i,o,a){if(r.call(this,e,t,i,void 0,void 0,o,a),!s.isString(n))throw TypeError("keyType must be a string");this.keyType=n,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(e,t){return new o(e,t.id,t.keyType,t.type,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&!!e.keepComments;return s.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return r.prototype.resolve.call(this)},o.d=function(e,t,n){return"function"==typeof n?n=s.decorateType(n).name:n&&"object"==typeof n&&(n=s.decorateEnum(n).name),function(r,i){s.decorateType(r.constructor).add(new o(i,e,t,n))}}},1654(e,t,n){e.exports=i;var r=n(8045);function i(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)this[t[n]]=e[t[n]]}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,r.toJSONOptions)}},3040(e,t,n){e.exports=s;var r=n(4998);((s.prototype=Object.create(r.prototype)).constructor=s).className="Method";var i=n(8965);function s(e,t,n,s,o,a,l,u,c){if(i.isObject(o)?(l=o,o=a=void 0):i.isObject(a)&&(l=a,a=void 0),!(void 0===t||i.isString(t)))throw TypeError("type must be a string");if(!i.isString(n))throw TypeError("requestType must be a string");if(!i.isString(s))throw TypeError("responseType must be a string");r.call(this,e,l),this.type=t||"rpc",this.requestType=n,this.requestStream=!!o||void 0,this.responseType=s,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=c}s.fromJSON=function(e,t){return new s(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},s.prototype.toJSON=function(e){var t=!!e&&!!e.keepComments;return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},s.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),r.prototype.resolve.call(this))}},1750(e,t,n){e.exports=d;var r,i,s,o=n(4998);((d.prototype=Object.create(o.prototype)).constructor=d).className="Namespace";var a=n(9221),l=n(8965),u=n(6724);function c(e,t){if(e&&e.length){for(var n={},r=0;r<e.length;++r)n[e[r].name]=e[r].toJSON(t);return n}}function d(e,t){o.call(this,e,t),this.nested=void 0,this._nestedArray=null}function h(e){return e._nestedArray=null,e}d.fromJSON=function(e,t){return new d(e,t.options).addJSON(t.nested)},d.arrayToJSON=c,d.isReservedId=function(e,t){if(e){for(var n=0;n<e.length;++n)if("string"!=typeof e[n]&&e[n][0]<=t&&e[n][1]>t)return!0}return!1},d.isReservedName=function(e,t){if(e){for(var n=0;n<e.length;++n)if(e[n]===t)return!0}return!1},Object.defineProperty(d.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=l.toArray(this.nested))}}),d.prototype.toJSON=function(e){return l.toObject(["options",this.options,"nested",c(this.nestedArray,e)])},d.prototype.addJSON=function(e){var t=this;if(e)for(var n,o=Object.keys(e),l=0;l<o.length;++l)n=e[o[l]],t.add((void 0!==n.fields?r.fromJSON:void 0!==n.values?s.fromJSON:void 0!==n.methods?i.fromJSON:void 0!==n.id?a.fromJSON:d.fromJSON)(o[l],n));return this},d.prototype.get=function(e){return this.nested&&this.nested[e]||null},d.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},d.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof r||e instanceof u||e instanceof s||e instanceof i||e instanceof d))throw TypeError("object must be a valid nested object");
1if(this.nested){var t=this.get(e.name);if(t)if(t instanceof d&&e instanceof d&&!(t instanceof r||t instanceof i)){for(var n=t.nestedArray,o=0;o<n.length;++o)e.add(n[o]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}else throw Error("duplicate name '"+e.name+"' in "+this)}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),h(this)},d.prototype.remove=function(e){if(!(e instanceof o))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),h(this)},d.prototype.define=function(e,t){if(l.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var n=this;e.length>0;){var r=e.shift();if(n.nested&&n.nested[r]){if(!((n=n.nested[r])instanceof d))throw Error("path conflicts with non-namespace objects")}else n.add(n=new d(r))}return t&&n.addJSON(t),n},d.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof d?e[t++].resolveAll():e[t++].resolve();return this.resolve()},d.prototype.lookup=function(e,t,n){if("boolean"==typeof t?(n=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),l.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var r=this.get(e[0]);if(r){if(1===e.length){if(!t||t.indexOf(r.constructor)>-1)return r}else if(r instanceof d&&(r=r.lookup(e.slice(1),t,!0)))return r}else for(var i=0;i<this.nestedArray.length;++i)if(this._nestedArray[i]instanceof d&&(r=this._nestedArray[i].lookup(e,t,!0)))return r;return null===this.parent||n?null:this.parent.lookup(e,t)},d.prototype.lookupType=function(e){var t=this.lookup(e,[r]);if(!t)throw Error("no such type: "+e);return t},d.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},d.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[r,s]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},d.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},d._configure=function(e,t,n){r=e,i=t,s=n}},4998(e,t,n){e.exports=s,s.className="ReflectionObject";var r,i=n(8965);function s(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(s.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),s.prototype.toJSON=function(){throw Error()},s.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof r&&t._handleAdd(this)},s.prototype.onRemove=function(e){var t=e.root;t instanceof r&&t._handleRemove(this),this.parent=null,this.resolved=!1},s.prototype.resolve=function(){return this.resolved||this.root instanceof r&&(this.resolved=!0),this},s.prototype.getOption=function(e){if(this.options)return this.options[e]},s.prototype.setOption=function(e,t,n){return n&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},s.prototype.setParsedOption=function(e,t,n){this.parsedOptions||(this.parsedOptions=[]);var r=this.parsedOptions;if(n){var s=r.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(s){var o=s[e];i.setProperty(o,n,t)}else(s={})[e]=i.setProperty({},n,t),r.push(s)}else{var a={};a[e]=t,r.push(a)}return this},s.prototype.setOptions=function(e,t){if(e)for(var n=Object.keys(e),r=0;r<n.length;++r)this.setOption(n[r],e[n[r]],t);return this},s.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},s._configure=function(e){r=e}},6724(e,t,n){e.exports=o;var r=n(4998);((o.prototype=Object.create(r.prototype)).constructor=o).className="OneOf";var i=n(9221),s=n(8965);function o(e,t,n,i){if(Array.isArray(t)||(n=t,t=void 0),r.call(this,e,n),!(void 0===t||Array.isArray(t)))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}o.fromJSON=function(e,t){return new o(e,t.oneof,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&!!e.keepComments;return s.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},o.prototype.add=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},o.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},o.prototype.onAdd=function(e){r.prototype.onAdd.call(this,e);for(var t=this,n=0;n<this.oneof.length;++n){var i=e.get(this.oneof[n]);i&&!i.partOf&&(i.partOf=t,t.fieldsArray.push(i))}a(this)},o.prototype.onRemove=function(e){for(var t,n=0;n<this.fieldsArray.length;++n)(t=this.fieldsArray[n]).parent&&t.parent.remove(t);r.prototype.onRemove.call(this,e)},o.d=function(){for(var e=Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){s.decorateType(t.constructor).add(new o(n,e)),Object.defineProperty(t,n,{get:s.oneOfGetter(e),set:s.oneOfSetter(e)})}}},4362(e,t,n){e.exports=I,I.filename=null,I.defaults={keepCase:!1};var r=n(3696),i=n(7973),s=n(5769),o=n(9221),a=n(5763),l=n(6724),u=n(2764),c=n(4230),d=n(3040),h=n(5500),p=n(8965),f=/^[1-9][0-9]*$/,g=/^-?[1-9][0-9]*$/,m=/^0[x][0-9a-fA-F]+$/,y=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,b=/^-?0[0-7]+$/,w=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,O=/^[a-zA-Z_][a-zA-Z_0-9]*$/,S=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,A=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function I(e,t,n){t instanceof i||(n=t,t=new i),n||(n=I.defaults);var T,E,k,_,x,M=n.preferTrailingComment||!1,C=r(e,n.alternateCommentMode||!1),P=C.next,B=C.push,L=C.peek,R=C.skip,N=C.cmnt,j=!0,D=!1,U=t,F=n.keepCase?function(e){return e}:p.camelCase;function G(e,t,n){var r=I.filename;return n||(I.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(r?r+", ":"")+"line "+C.line+")")}function V(){var e,t=[];do{if('"'!==(e=P())&&"'"!==e)throw G(e);t.push(P()),R(e),e=L()}while('"'===e||"'"===e);return t.join("")}function J(e){var t=P();switch(t){case"'":case'"':return B(t),V();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return H(t,!0)}catch(n){if(e&&S.test(t))return t;throw G(t,"value")}}function q(e,t){var n,r;do t&&('"'===(n=L())||"'"===n)?e.push(V()):e.push([r=z(P()),R("to",!0)?z(P()):r]);while(R(",",!0));R(";")}function H(e,t){var n=1;switch("-"===e.charAt(0)&&(n=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return 1/0*n;case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(f.test(e))return n*parseInt(e,10);if(m.test(e))return n*parseInt(e,16);if(v.test(e))return n*parseInt(e,8);if(w.test(e))return n*parseFloat(e);throw G(e,"number",t)}function z(e,t){switch(e){case"max":case"MAX":case"Max":return 0x1fffffff;case"0":return 0}if(!t&&"-"===e.charAt(0))throw G(e,"id");if(g.test(e))return parseInt(e,10);if(y.test(e))return parseInt(e,16);if(b.test(e))return parseInt(e,8);throw G(e,"id")}function W(){if(void 0!==E)throw G("package");if(E=P(),!S.test(E))throw G(E,"name");U=U.define(E),R(";")}function X(){var e,t=L();switch(t){case"weak":e=_||(_=[]),P();break;case"public":P();default:e=k||(k=[])}t=V(),R(";"),e.push(t)}function K(){if(R("="),!(D="proto3"===(x=V()))&&"proto2"!==x)throw G(x,"syntax");R(";")}function $(e,t){switch(t){case"option":return es(e,t),R(";"),!0;case"message":return Y(e,t),!0;case"enum":return er(e,t),!0;case"service":return ec(e,t),!0;case"extend":return eh(e,t),!0}return!1}function Z(e,t,n){var r,i=C.line;if(e&&("string"!=typeof e.comment&&(e.comment=N()),e.filename=I.filename),R("{",!0)){for(;"}
1"!==(r=P());)t(r);R(";",!0)}else n&&n(),R(";"),e&&("string"!=typeof e.comment||M)&&(e.comment=N(i)||e.comment)}function Y(e,t){if(!O.test(t=P()))throw G(t,"type name");var n=new s(t);Z(n,function(e){if(!$(n,e))switch(e){case"map":et(n,e);break;case"required":case"repeated":Q(n,e);break;case"optional":D?Q(n,"proto3_optional"):Q(n,"optional");break;case"oneof":en(n,e);break;case"extensions":q(n.extensions||(n.extensions=[]));break;case"reserved":q(n.reserved||(n.reserved=[]),!0);break;default:if(!D||!S.test(e))throw G(e);B(e),Q(n,"optional")}}),e.add(n)}function Q(e,t,n){var r=P();if("group"===r)return void ee(e,t);for(;r.endsWith(".")||L().startsWith(".");)r+=P();if(!S.test(r))throw G(r,"type");var i=P();if(!O.test(i))throw G(i,"name");i=F(i),R("=");var s=new o(i,z(P()),r,t,n);if(Z(s,function(e){if("option"===e)es(s,e),R(";");else throw G(e)},function(){eu(s)}),"proto3_optional"===t){var a=new l("_"+i);s.setOption("proto3_optional",!0),a.add(s),e.add(a)}else e.add(s);!D&&s.repeated&&(void 0!==h.packed[r]||void 0===h.basic[r])&&s.setOption("packed",!1,!0)}function ee(e,t){var n=P();if(!O.test(n))throw G(n,"name");var r=p.lcFirst(n);n===r&&(n=p.ucFirst(n)),R("=");var i=z(P()),a=new s(n);a.group=!0;var l=new o(r,i,n,t);l.filename=I.filename,Z(a,function(e){switch(e){case"option":es(a,e),R(";");break;case"required":case"repeated":Q(a,e);break;case"optional":D?Q(a,"proto3_optional"):Q(a,"optional");break;case"message":Y(a,e);break;case"enum":er(a,e);break;default:throw G(e)}}),e.add(a).add(l)}function et(e){R("<");var t=P();if(void 0===h.mapKey[t])throw G(t,"type");R(",");var n=P();if(!S.test(n))throw G(n,"type");R(">");var r=P();if(!O.test(r))throw G(r,"name");R("=");var i=new a(F(r),z(P()),t,n);Z(i,function(e){if("option"===e)es(i,e),R(";");else throw G(e)},function(){eu(i)}),e.add(i)}function en(e,t){if(!O.test(t=P()))throw G(t,"name");var n=new l(F(t));Z(n,function(e){"option"===e?(es(n,e),R(";")):(B(e),Q(n,"optional"))}),e.add(n)}function er(e,t){if(!O.test(t=P()))throw G(t,"name");var n=new u(t);Z(n,function(e){switch(e){case"option":es(n,e),R(";");break;case"reserved":q(n.reserved||(n.reserved=[]),!0);break;default:ei(n,e)}}),e.add(n)}function ei(e,t){if(!O.test(t))throw G(t,"name");R("=");var n=z(P(),!0),r={options:void 0};r.setOption=function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t},Z(r,function(e){if("option"===e)es(r,e),R(";");else throw G(e)},function(){eu(r)}),e.add(t,n,r.comment,r.options)}function es(e,t){var n,r=R("(",!0);if(!S.test(t=P()))throw G(t,"name");var i=t,s=i;r&&(R(")"),s=i="("+i+")",t=L(),A.test(t)&&(n=t.slice(1),i+=t,P())),R("=");var o=eo(e,i);el(e,s,o,n)}function eo(e,t){if(R("{",!0)){for(var n={};!R("}",!0);){if(!O.test(T=P()))throw G(T,"name");if(null===T)throw G(T,"end of input");var r,i,s=T;if(R(":",!0),"{"===L())r=eo(e,t+"."+T);else if("["===L()){if(r=[],R("[",!0)){do i=J(!0),r.push(i);while(R(",",!0));R("]"),void 0!==i&&ea(e,t+"."+T,i)}}else r=J(!0),ea(e,t+"."+T,r);var o=n[s];o&&(r=[].concat(o).concat(r)),n[s]=r,R(",",!0),R(";",!0)}return n}var a=J(!0);return ea(e,t,a),a}function ea(e,t,n){e.setOption&&e.setOption(t,n)}function el(e,t,n,r){e.setParsedOption&&e.setParsedOption(t,n,r)}function eu(e){if(R("[",!0)){do es(e,"option");while(R(",",!0));R("]")}return e}function ec(e,t){if(!O.test(t=P()))throw G(t,"service name");var n=new c(t);Z(n,function(e){if(!$(n,e))if("rpc"===e)ed(n,e);else throw G(e)}),e.add(n)}function ed(e,t){var n=N(),r=t;if(!O.test(t=P()))throw G(t,"name");var i,s,o,a,l=t;if(R("("),R("stream",!0)&&(s=!0),!S.test(t=P())||(i=t,R(")"),R("returns"),R("("),R("stream",!0)&&(a=!0),!S.test(t=P())))throw G(t);o=t,R(")");var u=new d(l,r,i,o,s,a);u.comment=n,Z(u,function(e){if("option"===e)es(u,e),R(";");else throw G(e)}),e.add(u)}function eh(e,t){if(!S.test(t=P()))throw G(t,"reference");var n=t;Z(null,function(t){switch(t){case"required":case"repeated":Q(e,t,n);break;case"optional":D?Q(e,"proto3_optional",n):Q(e,"optional",n);break;default:if(!D||!S.test(t))throw G(t);B(t),Q(e,"optional",n)}})}for(;null!==(T=P());)switch(T){case"package":if(!j)throw G(T);W();break;case"import":if(!j)throw G(T);X();break;case"syntax":if(!j)throw G(T);K();break;case"option":es(U,T),R(";");break;default:if($(U,T)){j=!1;continue}throw G(T)}return I.filename=null,{package:E,imports:k,weakImports:_,syntax:x,root:t}}},562(e,t,n){e.exports=l;var r,i=n(8045),s=i.LongBits,o=i.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var u="u">typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},c=function(){return i.Buffer?function(e){return(l.create=function(e){return i.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u};function d(){var e=new s(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new s(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}l.create=c(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=function(){var e=0xffffffff;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return e}}(),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var r=i.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)},l.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do if(this.pos>=this.len)throw a(this);while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e,l.create=c(),r._configure();var t=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},5171(e,t,n){e.exports=s;var r=n(562);(s.prototype=Object.create(r.prototype)).constructor=s;var i=n(8045);function s(e){r.call(this,e)}s._configure=function(){i.Buffer&&(s.prototype._slice=i.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},7973(e,t,n){e.exports=d;var r,i,s,o=n(1750);((d.prototype=Object.create(o.prototype)).constructor=d).className="Root";var a=n(9221),l=n(2764),u=n(6724),c=n(8965);function d(e){o.call(this,"",e),this.deferred=[],this.files=[]}function h(){}d.fromJSON=function(e,t){return t||(t=new d),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=c.path.resolve,d.prototype.fetch=c.fetch,d.prototype.load=function e(t,n,r){"function"==typeof n&&(r=n,n=void 0);var o=this;if(!r)return c.asPromise(e,o,t,n);var a=r===h;function l(e,t){if(r){if(a)throw e;var n=r;r=null,n(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var n=e.substring(t);if(n in s)return n}return null}function d(e,t){try{if(c.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),c.isString(t)){i.filename=e;var r,s=i(t,o,n),d=0;if(s.imports)for(;d<s.imports.length;++d)(r=u(s.imports[d])||o.resolvePath(e,s.imports[d]))&&p(r);if(s.weakImports)for(d=0;d<s.weakImports.length;++d)(r=u(s.weakImports[d])||o.resolvePath(e,s.weakImports[d]))&&p(r,!0)}else o.setOptions(t.options).addJSON(t.nested)}catch(e){l(e)}a||f||l(null,o)}function p(e,t){if(e=u(e)||e,!(o.files.indexOf(e)>
1-1)){if(o.files.push(e),e in s)return void(a?d(e,s[e]):(++f,setTimeout(function(){--f,d(e,s[e])})));if(a){var n;try{n=c.fs.readFileSync(e).toString("utf8")}catch(e){t||l(e);return}d(e,n)}else++f,o.fetch(e,function(n,i){if(--f,r){if(n)return void(t?f||l(null,o):l(n));d(e,i)}})}}var f=0;c.isString(t)&&(t=[t]);for(var g,m=0;m<t.length;++m)(g=o.resolvePath("",t[m]))&&p(g);if(a)return o;f||l(null,o)},d.prototype.loadSync=function(e,t){if(!c.isNode)throw Error("not supported");return this.load(e,t,h)},d.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return o.prototype.resolveAll.call(this)};var p=/^[A-Z]/;function f(e,t){var n=t.parent.lookup(t.extend);if(n){var r=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return!!n.get(r.name)||(r.declaringField=t,t.extensionField=r,n.add(r),!0)}return!1}d.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||f(this,e)||this.deferred.push(e);else if(e instanceof l)p.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof r)for(var t=0;t<this.deferred.length;)f(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);p.test(e.name)&&(e.parent[e.name]=e)}},d.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof l)p.test(e.name)&&delete e.parent[e.name];else if(e instanceof o){for(var n=0;n<e.nestedArray.length;++n)this._handleRemove(e._nestedArray[n]);p.test(e.name)&&delete e.parent[e.name]}},d._configure=function(e,t,n){r=e,i=t,s=n}},1696(e){e.exports={}},3622(e,t,n){t.Service=n(4454)},4454(e,t,n){e.exports=i;var r=n(8045);function i(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!n}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,n,i,s,o){if(!s)throw TypeError("request must be specified");var a=this;if(!o)return r.asPromise(e,a,t,n,i,s);if(!a.rpcImpl)return void setTimeout(function(){o(Error("already ended"))},0);try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),function(e,n){if(e)return a.emit("error",e,t),o(e);if(null===n)return void a.end(!0);if(!(n instanceof i))try{n=i[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",n,t),o(null,n)})}catch(e){a.emit("error",e,t),setTimeout(function(){o(e)},0);return}},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},4230(e,t,n){e.exports=a;var r=n(1750);((a.prototype=Object.create(r.prototype)).constructor=a).className="Service";var i=n(3040),s=n(8965),o=n(3622);function a(e,t){r.call(this,e,t),this.methods={},this._methodsArray=null}function l(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var n=new a(e,t.options);if(t.methods)for(var r=Object.keys(t.methods),s=0;s<r.length;++s)n.add(i.fromJSON(r[s],t.methods[r[s]]));return t.nested&&n.addJSON(t.nested),n.comment=t.comment,n},a.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),n=!!e&&!!e.keepComments;return s.toObject(["options",t&&t.options||void 0,"methods",r.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=s.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||r.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return r.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.n
1ame+"' in "+this);return e instanceof i?(this.methods[e.name]=e,e.parent=this,l(this)):r.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,l(this)}return r.prototype.remove.call(this,e)},a.prototype.create=function(e,t,n){for(var r,i=new o.Service(e,t,n),a=0;a<this.methodsArray.length;++a){var l=s.lcFirst((r=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");i[l]=s.codegen(["r","c"],s.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:r,q:r.resolvedRequestType.ctor,s:r.resolvedResponseType.ctor})}return i}},3696(e){e.exports=d;var t=/[\s{}=;:[\],'"()<>]/g,n=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,r=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,i=/^ *[*/]+ */,s=/^\s*\*?\/*/,o=/\n/g,a=/\s/,l=/\\(.?)/g,u={0:"\0",r:"\r",n:"\n",t:" "};function c(e){return e.replace(l,function(e,t){switch(t){case"\\":case"":return t;default:return u[t]||""}})}function d(e,l){e=e.toString();var u=0,d=e.length,h=1,p=0,f={},g=[],m=null;function y(e){return Error("illegal "+e+" (line "+h+")")}function v(){var t="'"===m?r:n;t.lastIndex=u-1;var i=t.exec(e);if(!i)throw y("string");return u=t.lastIndex,I(m),m=null,c(i[1])}function b(t){return e.charAt(t)}function w(t,n,r){var a,u={type:e.charAt(t++),lineEmpty:!1,leading:r},c=t-(l?2:3);do if(--c<0||"\n"===(a=e.charAt(c))){u.lineEmpty=!0;break}while(" "===a||" "===a);for(var d=e.substring(t,n).split(o),g=0;g<d.length;++g)d[g]=d[g].replace(l?s:i,"").trim();u.text=d.join("\n").trim(),f[h]=u,p=h}function O(t){var n=S(t),r=e.substring(t,n);return/^\s*\/\//.test(r)}function S(e){for(var t=e;t<d&&"\n"!==b(t);)t++;return t}function A(){if(g.length>0)return g.shift();if(m)return v();var n,r,i,s,o,c=0===u;do{if(u===d)return null;for(n=!1;a.test(i=b(u));)if("\n"===i&&(c=!0,++h),++u===d)return null;if("/"===b(u)){if(++u===d)throw y("comment");
1if("/"===b(u))if(l){if(s=u,o=!1,O(u-1)){o=!0;do if((u=S(u))===d||(u++,!c))break;while(O(u))}else u=Math.min(d,S(u)+1);o&&(w(s,u,c),c=!0),h++,n=!0}else{for(o="/"===b(s=u+1);"\n"!==b(++u);)if(u===d)return null;++u,o&&(w(s,u-1,c),c=!0),++h,n=!0}else{if("*"!==(i=b(u)))return"/";s=u+1,o=l||"*"===b(s);do{if("\n"===i&&++h,++u===d)throw y("comment");r=i,i=b(u)}while("*"!==r||"/"!==i);++u,o&&(w(s,u-2,c),c=!0),n=!0}}}while(n);var p=u;if(t.lastIndex=0,!t.test(b(p++)))for(;p<d&&!t.test(b(p));)++p;var f=e.substring(u,u=p);return('"'===f||"'"===f)&&(m=f),f}function I(e){g.push(e)}function T(){if(!g.length){var e=A();if(null===e)return null;I(e)}return g[0]}function E(e,t){var n=T();if(n===e)return A(),!0;if(!t)throw y("token '"+n+"', '"+e+"' expected");return!1}function k(e){var t,n=null;return void 0===e?(t=f[h-1],delete f[h-1],t&&(l||"*"===t.type||t.lineEmpty)&&(n=t.leading?t.text:null)):(p<e&&T(),t=f[e],delete f[e],t&&!t.lineEmpty&&(l||"/"===t.type)&&(n=t.leading?null:t.text)),n}return Object.defineProperty({next:A,peek:T,push:I,skip:E,cmnt:k},"line",{get:function(){return h}})}d.unescape=c},5769(e,t,n){e.exports=v;var r=n(1750);((v.prototype=Object.create(r.prototype)).constructor=v).className="Type";var i=n(2764),s=n(6724),o=n(9221),a=n(5763),l=n(4230),u=n(1654),c=n(562),d=n(9970),h=n(8965),p=n(4285),f=n(5849),g=n(2043),m=n(8833),y=n(1257);function v(e,t){r.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function b(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(v.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var n=this.fields[e[t]],r=n.id;if(this._fieldsById[r])throw Error("duplicate id "+r+" in "+this);this._fieldsById[r]=n}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=h.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=h.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=v.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,u,!0),this._ctor=e;for(var n=0;n<this.fieldsArray.length;++n)this._fieldsArray[n].resolve();var r={};for(n=0;n<this.oneofsArray.length;++n)r[this._oneofsArray[n].resolve().name]={get:h.oneOfGetter(this._oneofsArray[n].oneof),set:h.oneOfSetter(this._oneofsArray[n].oneof)};n&&Object.defineProperties(e.prototype,r)}}}),v.generateConstructor=function(e){for(var t,n=h.codegen(["p"],e.name),r=0;r<e.fieldsArray.length;++r)(t=e._fieldsArray[r]).map?n("this%s={}",h.safeProp(t.name)):t.repeated&&n("this%s=[]",h.safeProp(t.name));return n("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},v.fromJSON=function(e,t){var n=new v(e,t.options);n.extensions=t.extensions,n.reserved=t.reserved;for(var u=Object.keys(t.fields),c=0;c<u.length;++c)n.add((void 0!==t.fields[u[c]].keyType?a.fromJSON:o.fromJSON)(u[c],t.fields[u[c]]));if(t.oneofs)for(u=Object.keys(t.oneofs),c=0;c<u.length;++c)n.add(s.fromJSON(u[c],t.oneofs[u[c]]));if(t.nested)for(u=Object.keys(t.nested),c=0;c<u.length;++c){var d=t.nested[u[c]];n.add((void 0!==d.id?o.fromJSON:void 0!==d.fields?v.fromJSON:void 0!==d.values?i.fromJSON:void 0!==d.methods?l.fromJSON:r.fromJSON)(u[c],d))}return t.extensions&&t.extensions.length&&(n.extensions=t.extensions),t.reserved&&t.reserved.length&&(n.reserved=t.reserved),t.group&&(n.group=!0),t.comment&&(n.comment=t.comment),n},v.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),n=!!e&&!!e.keepComments;return h.toObject(["options",t&&t.options||void 0,"oneofs",r.arrayToJSON(this.oneofsArray,e),"fields",r.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])},v.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var n=this.oneofsArray;for(t=0;t<n.length;)n[t++].resolve();return r.prototype.resolveAll.call(this)},v.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},v.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.n
1ame+"' in "+this);if(e instanceof o&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),b(this)}return e instanceof s?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),b(this)):r.prototype.add.call(this,e)},v.prototype.remove=function(e){if(e instanceof o&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),b(this)}if(e instanceof s){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),b(this)}return r.prototype.remove.call(this,e)},v.prototype.isReservedId=function(e){return r.isReservedId(this.reserved,e)},v.prototype.isReservedName=function(e){return r.isReservedName(this.reserved,e)},v.prototype.create=function(e){return new this.ctor(e)},v.prototype.setup=function(){for(var e=this.fullName,t=[],n=0;n<this.fieldsArray.length;++n)t.push(this._fieldsArray[n].resolve().resolvedType);this.encode=p(this)({Writer:d,types:t,util:h}),this.decode=f(this)({Reader:c,types:t,util:h}),this.verify=g(this)({types:t,util:h}),this.fromObject=m.fromObject(this)({types:t,util:h}),this.toObject=m.toObject(this)({types:t,util:h});var r=y[e];if(r){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=r.fromObject.bind(i),i.toObject=this.toObject,this.toObject=r.toObject.bind(i)}return this},v.prototype.encode=function(e,t){return this.setup().encode(e,t)},v.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},v.prototype.decode=function(e,t){return this.setup().decode(e,t)},v.prototype.decodeDelimited=function(e){return e instanceof c||(e=c.create(e)),this.decode(e,e.uint32())},v.prototype.verify=function(e){return this.setup().verify(e)},v.prototype.fromObject=function(e){return this.setup().fromObject(e)},v.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},v.d=function(e){return function(t){h.decorateType(t,e)}}},5500(e,t,n){var r=t,i=n(8965),s=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function o(e,t){var n=0,r={};for(t|=0;n<e.length;)r[s[n+t]]=e[n++];return r}r.basic=o([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),r.defaults=o([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",i.emptyArray,null]),r.long=o([0,0,0,1,1],7),r.mapKey=o([0,0,0,5,5,0,0,0,1,1,0,2],2),r.packed=o([1,5,0,0,0,5,5,0,0,0,1,1,0])},8965(e,t,n){var r,i,s=e.exports=n(8045),o=n(1696);s.codegen=n(7259),s.fetch=n(7531),s.path=n(5211),s.fs=s.inquire("fs"),s.toArray=function(e){if(e){for(var t=Object.keys(e),n=Array(t.length),r=0;r<t.length;)n[r]=e[t[r++]];return n}return[]},s.toObject=function(e){for(var t={},n=0;n<e.length;){var r=e[n++],i=e[n++];void 0!==i&&(t[r]=i)}return t};var a=/\\/g,l=/"/g;s.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},s.safeProp=function(e){return!/^[$\w_]+$/.test(e)||s.isReserved(e)?'["'+e.replace(a,"\\\\").replace(l,'\\"')+'"]':"."+e},s.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;s.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,function(e,t){return t.toUpperCase()})},s.compareFieldsById=function(e,t){return e.id-t.id},s.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(s.decorateRoot.remove(e.$type),e.$type.name=t,s.decorateRoot.add(e.$type)),e.$type;r||(r=n(5769));var i=new r(t||e.name);return s.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i};var c=0;s.decorateEnum=function(e){if(e.$type)return e.$type;i||(i=n(2764));var t=new i("Enum"+c++,e);return s.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},s.setProperty=function(e,t,n){function r(e,t,n){var i=t.shift();if("__proto__"===i||"prototype"===i)return e;if(t.length>0)e[i]=r(e[i]||{},t,n);else{var s=e[i];s&&(n=[].concat(s).concat(n)),e[i]=n}return e}if("object"!=typeof e)throw TypeError("dst must be an object");
1if(!t)throw TypeError("path must be specified");return r(e,t=t.split("."),n)},Object.defineProperty(s,"decorateRoot",{get:function(){return o.decorated||(o.decorated=new(n(7973)))}})},1558(e,t,n){e.exports=i;var r=n(8045);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=i.zero=new i(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/0x100000000>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>0xffffffff&&(n=0,++r>0xffffffff&&(r=0))),new i(n,r)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(r.isString(e))if(!r.Long)return i.fromNumber(parseInt(e,10));else e=r.Long.fromString(e);return e.low||e.high?new i(e.low>>>0,e.high>>>0):s},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+0x100000000*n)}return this.lo+0x100000000*this.hi},i.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,!!e):{low:0|this.lo,high:0|this.hi,unsigned:!!e}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===o?s:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},8045(e,t,n){var r=t;function i(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)void 0!==e[r[i]]&&n||(e[r[i]]=t[r[i]]);return e}function s(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack||""}),n&&i(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(8315),r.base64=n(2939),r.EventEmitter=n(5985),r.float=n(8424),r.inquire=n(7789),r.utf8=n(2025),r.pool=n(5057),r.LongBits=n(1558),r.isNode=!!(void 0!==n.g&&n.g&&n.g.process&&n.g.process.versions&&n.g.process.versions.node),r.global=r.isNode&&n.g||"u">typeof window&&window||"u">typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!!(null!=n&&e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"u"<typeof Uint8Array?e:new Uint8Array(e)},r.Array="u">typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(!!t)},r.merge=i,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;if(!e){r._Buffer_from=r._Buffer_allocUnsafe=null;return}r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}},2043(e,t,n){e.exports=l;var r=n(2764),i=n(8965);function s(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function o(e,t,n,i){if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(%s){",i)("default:")("return%j",s(t,"enum value"));for(var o=Object.keys(t.resolvedType.values),a=0;a<o.length;++a)e("case %i:",t.resolvedType.values[o[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",n,i)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",i)("return%j",s(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",s(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",s(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",s(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",s(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",s(t,"buffer"))}return e}function a(e,t,n){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",n)("return%j",s(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",n)("return%j",s(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",n)("return%j",s(t,"boolean key"))}return e}function l(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),n=e.oneofsArray,r={};n.length&&t("var p={}");for(var l=0;l<e.fieldsArray.length;++l){var u=e._fieldsArray[l].resolve(),c="m"+i.safeProp(u.name);if(u.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",c,u.name),u.map)t("if(!util.isObject(%s))",c)("return%j",s(u,"object"))("var k=Object.keys(%s)",c)("for(var i=0;i<k.length;++i){"),a(t,u,"k[i]"),o(t,u,l,c+"[k[i]]")("}");else if(u.repeated)t("if(!Array.isArray(%s))",c)("return%j",s(u,"array"))("for(var i=0;i<%s.length;++i){",c),o(t,u,l,c+"[i]")("}");else{if(u.partOf){var d=i.safeProp(u.partOf.name);1===r[u.partOf.name]&&t("if(p%s===1)",d)("return%j",u.partOf.name+": multiple values"),r[u.partOf.name]=1,t("p%s=1",d)}o(t,u,l,c)}u.optional&&t("}")}return t("return null")}},1257(e,t,n){var r=t,i=n(1654);r[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),n=this.lookup(t);
vendor: 4,890 bytes, line 1
1if(n){var r="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return -1===r.indexOf("/")&&(r="/"+r),this.create({type_url:r,value:n.encode(n.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var n="type.googleapis.com/",r="",s="";if(t&&t.json&&e.type_url&&e.value){s=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(s);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var a=e.$type.toObject(e,t),l="."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName;return""===r&&(r=n),s=r+l,a["@type"]=s,a}return this.toObject(e,t)}}},9970(e,t,n){e.exports=d;var r,i=n(8045),s=i.LongBits,o=i.base64,a=i.utf8;function l(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new l(u,0,0),this.tail=this.head,this.states=null}var h=function(){return i.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};function p(e,t,n){t[n]=255&e}function f(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e}function g(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function y(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}d.create=h(),d.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(e,t,n){return this.tail=this.tail.next=new l(e,t,n),this.len+=t,this},g.prototype=Object.create(l.prototype),g.prototype.fn=f,d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new g((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,s.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=s.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(p,1,+!!e)},d.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=s.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var v=i.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(p,1,0);if(i.isString(e)){var n=d.alloc(t=o.length(e));o.decode(e,n,0),e=n}return this.uint32(t)._push(v,t,e)},d.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(p,1,0)},d.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new l(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},d._configure=function(e){r=e,d.create=h(),r._configure()}},1475(e,t,n){e.exports=s;var r=n(9970);(s.prototype=Object.create(r.prototype)).constructor=s;var i=n(8045);function s(){r.call(this)}function o(e,t,n){e.length<40?i.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}s._configure=function(){s.alloc=i._Buffer_allocUnsafe,s.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},s.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},s._configure()}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}(()=>{__webpack_require__.n=e=>
1{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t}})(),(()=>{__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{__webpack_require__.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();var protobufjs=__webpack_require__(5540);let $Reader=protobufjs.Reader,$Writer=protobufjs.Writer,$util=protobufjs.util,$root=protobufjs.roots.default||(protobufjs.roots.default={});$root.UserConversationReestablishNotification=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.version=$util.Long?$util.Long.fromBits(0,0,!1):0,e.prototype.convid="",e.prototype.conversationType="",e.prototype.prompt="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=$Writer.create()),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(8).int64(e.version),null!=e.convid&&Object.hasOwnProperty.call(e,"convid")&&t.uint32(18).string(e.convid),null!=e.conversationType&&Object.hasOwnProperty.call(e,"conversationType")&&t.uint32(26).string(e.conversationType),null!=e.prompt&&Object.hasOwnProperty.call(e,"prompt")&&t.uint32(34).string(e.prompt),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof $Reader||(e=$Reader.create(e));let n=void 0===t?e.len:e.pos+t,r=new $root.UserConversationReestablishNotification;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.version=e.int64();break;case 2:r.convid=e.string();break;case 3:r.conversationType=e.string();break;case 4:r.prompt=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.version&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)&&!(e.version&&$util.isInteger(e.version.low)&&$util.isInteger(e.version.high))?"version: integer|Long expected":null!=e.convid&&e.hasOwnProperty("convid")&&!$util.isString(e.convid)?"convid: string expected":null!=e.conversationType&&e.hasOwnProperty("conversationType")&&!$util.isString(e.conversationType)?"conversationType: string expected":null!=e.prompt&&e.hasOwnProperty("prompt")&&!$util.isString(e.prompt)?"prompt: string expected":null},e.fromObject=function(e){if(e instanceof $root.UserConversationReestablishNotification)return e;let t=new $root.UserConversationReestablishNotification;return null!=e.version&&($util.Long?(t.version=$util.Long.fromValue(e.version)).unsigned=!1:"string"==typeof e.version?t.version=parseInt(e.version,10):"number"==typeof e.version?t.version=e.version:"object"==typeof e.version&&(t.version=new $util.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),null!=e.convid&&(t.convid=String(e.convid)),null!=e.conversationType&&(t.conversationType=String(e.conversationType)),null!=e.prompt&&(t.prompt=String(e.prompt)),t},e.toObject=function(e,t){t||(t={});let n={};if(t.defaults){if($util.Long){let e=new $util.Long(0,0,!1);n.version=t.longs===String?e.toString():t.longs===Number?e.toNumber():e}else n.version=t.longs===String?"0":0;n.convid="",n.conversationType="",n.prompt=""}return null!=e.version&&e.hasOwnProperty("version")&&("number"==typeof e.version?n.version=t.longs===String?String(e.version):e.version:n.version=t.longs===String?$util.Long.prototype.toString.call(e.version):t.longs===Number?new $util.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),null!=e.convid&&e.hasOwnProperty("convid")&&(n.convid=e.convid),null!=e.conversationType&&e.hasOwnProperty("conversationType")&&(n.conversationType=e.conversationType),null!=e.prompt&&e.hasOwnProperty("prompt")&&(n.prompt=e.prompt),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,protobufjs.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/UserConversationReestablishNotification"},e})(),$root.UnreadAckNotification=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.version=$util.Long?$util.Long.fromBits(0,0,!1):0,e.prototype.convid="",e.prototype.count=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=$Writer.create()),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(8).int64(e.version),null!=e.convid&&Object.hasOwnProperty.call(e,"convid")&&t.uint32(18).string(e.convid),null!=e.count&&Object.hasOwnProperty.call(e,"count")&&t.uint32(24).int32(e.count),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof $Reader||(e=$Reader.create(e));let n=void 0===t?e.len:e.pos+t,r=new $root.UnreadAckNotification;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.version=e.int64();break;case 2:r.convid=e.string();break;case 3:r.count=e.int32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.version&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)&&!(e.version&&$util.isInteger(e.version.low)&&$util.isInteger(e.version.high))?"version: integer|Long expected":null!=e.convid&&e.hasOwnProperty("convid")&&!$util.isString(e.convid)?"convid: string expected":null!=e.count&&e.hasOwnProperty("count")&&!$util.isInteger(e.count)?"count: integer expected":null},e.fromObject=function(e){if(e instanceof $root.UnreadAckNotification)return e;let t=new $root.UnreadAckNotification;return null!=e.version&&($util.Long?(t.version=$util.Long.fromValue(e.version)).unsigned=!1:"string"==typeof e.ver
1sion?t.version=parseInt(e.version,10):"number"==typeof e.version?t.version=e.version:"object"==typeof e.version&&(t.version=new $util.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),null!=e.convid&&(t.convid=String(e.convid)),null!=e.count&&(t.count=0|e.count),t},e.toObject=function(e,t){t||(t={});let n={};if(t.defaults){if($util.Long){let e=new $util.Long(0,0,!1);n.version=t.longs===String?e.toString():t.longs===Number?e.toNumber():e}else n.version=t.longs===String?"0":0;n.convid="",n.count=0}return null!=e.version&&e.hasOwnProperty("version")&&("number"==typeof e.version?n.version=t.longs===String?String(e.version):e.version:n.version=t.longs===String?$util.Long.prototype.toString.call(e.version):t.longs===Number?new $util.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),null!=e.convid&&e.hasOwnProperty("convid")&&(n.convid=e.convid),null!=e.count&&e.hasOwnProperty("count")&&(n.count=e.count),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,protobufjs.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/UnreadAckNotification"},e})(),$root.OnlineMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.userId="",e.prototype.state="",e.prototype.timestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=$Writer.create()),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(18).string(e.state),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).int64(e.timestamp),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof $Reader||(e=$Reader.create(e));let n=void 0===t?e.len:e.pos+t,r=new $root.OnlineMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.userId=e.string();break;case 2:r.state=e.string();break;case 3:r.timestamp=e.int64();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.userId&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":null!=e.state&&e.hasOwnProperty("state")&&!$util.isString(e.state)?"state: string expected":null!=e.timestamp&&e.hasOwnProperty("timestamp")&&!$util.isInteger(e.timestamp)&&!(e.timestamp&&$util.isInteger(e.timestamp.low)&&$util.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":null},e.fromObject=function(e){if(e instanceof $root.OnlineMessage)return e;let t=new $root.OnlineMessage;return null!=e.userId&&(t.userId=String(e.userId)),null!=e.state&&(t.state=String(e.state)),null!=e.timestamp&&($util.Long?(t.timestamp=$util.Long.fromValue(e.timestamp)).unsigned=!1:"string"==typeof e.timestamp?t.timestamp=parseInt(e.timestamp,10):"number"==typeof e.timestamp?t.timestamp=e.timestamp:"object"==typeof e.timestamp&&(t.timestamp=new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),t},e.toObject=function(e,t){t||(t={});let n={};if(t.defaults)if(n.userId="",n.state="",$util.Long){let e=new $util.Long(0,0,!1);n.timestamp=t.longs===String?e.toString():t.longs===Number?e.toNumber():e}else n.timestamp=t.longs===String?"0":0;return null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&("number"==typeof e.timestamp?n.timestamp=t.longs===String?String(e.timestamp):e.timestamp:n.timestamp=t.longs===String?$util.Long.prototype.toString.call(e.timestamp):t.longs===Number?new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,protobufjs.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/OnlineMessage"},e})(),$root.ReactionMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.convId="",e.prototype.msgId="",e.prototype.userId="",e.prototype.key="",e.prototype.operate=0,e.prototype.timestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,e.prototype.state="",e.prototype.reacted=!1,e.prototype.count=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=$Writer.create()),null!=e.convId&&Object.hasOwnProperty.call(e,"convId")&&t.uint32(10).string(e.convId),null!=e.msgId&&Object.hasOwnProperty.call(e,"msgId")&&t.uint32(18).string(e.msgId),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(26).string(e.userId),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(34).string(e.key),null!=e.operate&&Object.hasOwnProperty.call(e,"operate")&&t.uint32(40).int32(e.operate),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(48).int64(e.timestamp),null!=e.state&&Object.hasOwnProperty.call(e,"state")&&t.uint32(58).string(e.state),null!=e.reacted&&Object.hasOwnProperty.call(e,"reacted")&&t.uint32(64).bool(e.reacted),null!=e.count&&Object.hasOwnProperty.call(e,"count")&&t.uint32(72).int32(e.count),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof $Reader||(e=$Reader.create(e));let n=void 0===t?e.len:e.pos+t,r=new $root.ReactionMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.convId=e.string();break;case 2:r.msgId=e.string();break;case 3:r.userId=e.string();break;case 4:r.key=e.string();break;case 5:r.operate=e.int32();break;case 6:r.timestamp=e.int64();break;case 7:r.state=e.string();break;case 8:r.reacted=e.bool();break;case 9:r.count=e.int32();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.convId&&e.hasOwnProperty("convId")&&!$util.isString(e.convId)?"convId: string expected":null!=e.msgId&&e.hasOwnProperty("msgId")&&!$util.isString(e.msgId)?"msgId: string expected":null!=e.userId&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":null!=e.key&&e.hasOwnProperty("key")&&!$util.isString(e.key)?"key: string expected":null!=e.operate&&e.hasOwnProperty("operate")&&!$util.isInteger(e.operate)?"operate: integer expected":null!=e.timestamp&&e.hasOwnProperty("timestamp")&&!$util.isInteger(e.timestamp)&&!(e.timestamp&&$util.isInteger(e.timestamp.low)&&$util.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":null!=e.state&&e.hasOwnProperty("state")&&!$util.isString(e.state)?"state: string expected":null!=e.reacted&&e.hasOwnProperty("reacted")&&"boolean"!=typeof e.reacted?"reacted: boolean expected":null!=e.count&&e.hasOwnProperty("count")&&!$util.isInteger(e.count)?"count: integer expected":null},e.fromObject=function(e){if(e instanceof $root.ReactionMessage)return e;let t=new $root.ReactionMessage;return null!=e.convId&&(t.convId=String(e.convId)),null!=e.msgId&&(t.msgId=String(e.msgId)),null!=e.userId&&(t.userId=String(e.userId)
1),null!=e.key&&(t.key=String(e.key)),null!=e.operate&&(t.operate=0|e.operate),null!=e.timestamp&&($util.Long?(t.timestamp=$util.Long.fromValue(e.timestamp)).unsigned=!1:"string"==typeof e.timestamp?t.timestamp=parseInt(e.timestamp,10):"number"==typeof e.timestamp?t.timestamp=e.timestamp:"object"==typeof e.timestamp&&(t.timestamp=new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),null!=e.state&&(t.state=String(e.state)),null!=e.reacted&&(t.reacted=!!e.reacted),null!=e.count&&(t.count=0|e.count),t},e.toObject=function(e,t){t||(t={});let n={};if(t.defaults){if(n.convId="",n.msgId="",n.userId="",n.key="",n.operate=0,$util.Long){let e=new $util.Long(0,0,!1);n.timestamp=t.longs===String?e.toString():t.longs===Number?e.toNumber():e}else n.timestamp=t.longs===String?"0":0;n.state="",n.reacted=!1,n.count=0}return null!=e.convId&&e.hasOwnProperty("convId")&&(n.convId=e.convId),null!=e.msgId&&e.hasOwnProperty("msgId")&&(n.msgId=e.msgId),null!=e.userId&&e.hasOwnProperty("userId")&&(n.userId=e.userId),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.operate&&e.hasOwnProperty("operate")&&(n.operate=e.operate),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&("number"==typeof e.timestamp?n.timestamp=t.longs===String?String(e.timestamp):e.timestamp:n.timestamp=t.longs===String?$util.Long.prototype.toString.call(e.timestamp):t.longs===Number?new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),null!=e.state&&e.hasOwnProperty("state")&&(n.state=e.state),null!=e.reacted&&e.hasOwnProperty("reacted")&&(n.reacted=e.reacted),null!=e.count&&e.hasOwnProperty("count")&&(n.count=e.count),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,protobufjs.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ReactionMessage"},e})(),$root.DataPacket=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.id=$util.Long?$util.Long.fromBits(0,0,!1):0,e.prototype.timestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,e.prototype.name="",e.prototype.payload=$util.newBuffer([]),e.prototype.arguments="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=$Writer.create()),null!=e.id&&Object.hasOwnProperty.call(e,"id")&&t.uint32(8).int64(e.id),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(16).int64(e.timestamp),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(26).string(e.name),null!=e.payload&&Object.hasOwnProperty.call(e,"payload")&&t.uint32(34).bytes(e.payload),null!=e.arguments&&Object.hasOwnProperty.call(e,"arguments")&&t.uint32(42).string(e.arguments),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof $Reader||(e=$Reader.create(e));let n=void 0===t?e.len:e.pos+t,r=new $root.DataPacket;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.id=e.int64();break;case 2:r.timestamp=e.int64();break;case 3:r.name=e.string();break;case 4:r.payload=e.bytes();break;case 5:r.arguments=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.id&&e.hasOwnProperty("id")&&!$util.isInteger(e.id)&&!(e.id&&$util.isInteger(e.id.low)&&$util.isInteger(e.id.high))?"id: integer|Long expected":null!=e.timestamp&&e.hasOwnProperty("timestamp")&&!$util.isInteger(e.timestamp)&&!(e.timestamp&&$util.isInteger(e.timestamp.low)&&$util.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":null!=e.name&&e.hasOwnProperty("name")&&!$util.isString(e.name)?"name: string expected":null!=e.payload&&e.hasOwnProperty("payload")&&!(e.payload&&"number"==typeof e.payload.length||$util.isString(e.payload))?"payload: buffer expected":null!=e.arguments&&e.hasOwnProperty("arguments")&&!$util.isString(e.arguments)?"arguments: string expected":null},e.fromObject=function(e){if(e instanceof $root.DataPacket)return e;let t=new $root.DataPacket;
1return null!=e.id&&($util.Long?(t.id=$util.Long.fromValue(e.id)).unsigned=!1:"string"==typeof e.id?t.id=parseInt(e.id,10):"number"==typeof e.id?t.id=e.id:"object"==typeof e.id&&(t.id=new $util.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber())),null!=e.timestamp&&($util.Long?(t.timestamp=$util.Long.fromValue(e.timestamp)).unsigned=!1:"string"==typeof e.timestamp?t.timestamp=parseInt(e.timestamp,10):"number"==typeof e.timestamp?t.timestamp=e.timestamp:"object"==typeof e.timestamp&&(t.timestamp=new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),null!=e.name&&(t.name=String(e.name)),null!=e.payload&&("string"==typeof e.payload?$util.base64.decode(e.payload,t.payload=$util.newBuffer($util.base64.length(e.payload)),0):e.payload.length>=0&&(t.payload=e.payload)),null!=e.arguments&&(t.arguments=String(e.arguments)),t},e.toObject=function(e,t){t||(t={});let n={};if(t.defaults){if($util.Long){let e=new $util.Long(0,0,!1);n.id=t.longs===String?e.toString():t.longs===Number?e.toNumber():e}else n.id=t.longs===String?"0":0;if($util.Long){let e=new $util.Long(0,0,!1);n.timestamp=t.longs===String?e.toString():t.longs===Number?e.toNumber():e}else n.timestamp=t.longs===String?"0":0;n.name="",t.bytes===String?n.payload="":(n.payload=[],t.bytes!==Array&&(n.payload=$util.newBuffer(n.payload))),n.arguments=""}return null!=e.id&&e.hasOwnProperty("id")&&("number"==typeof e.id?n.id=t.longs===String?String(e.id):e.id:n.id=t.longs===String?$util.Long.prototype.toString.call(e.id):t.longs===Number?new $util.LongBits(e.id.low>>>0,e.id.high>>>0).toNumber():e.id),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&("number"==typeof e.timestamp?n.timestamp=t.longs===String?String(e.timestamp):e.timestamp:n.timestamp=t.longs===String?$util.Long.prototype.toString.call(e.timestamp):t.longs===Number?new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.payload&&e.hasOwnProperty("payload")&&(n.payload=t.bytes===String?$util.base64.encode(e.payload,0,e.payload.length):t.bytes===Array?Array.prototype.slice.call(e.payload):e.payload),null!=e.arguments&&e.hasOwnProperty("arguments")&&(n.arguments=e.arguments),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,protobufjs.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/DataPacket"},e})(),$root.ErrorMessage=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.reason="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=$Writer.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).int32(e.code),null!=e.reason&&Object.hasOwnProperty.call(e,"reason")&&t.uint32(18).string(e.reason),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof $Reader||(e=$Reader.create(e));let n=void 0===t?e.len:e.pos+t,r=new $root.ErrorMessage;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:r.code=e.int32();break;case 2:r.reason=e.string();break;default:e.skipType(7&t)}}return r},e.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.code&&e.hasOwnProperty("code")&&!$util.isInteger(e.code)?"code: integer expected":null!=e.reason&&e.hasOwnProperty("reason")&&!$util.isString(e.reason)?"reason: string expected":null},e.fromObject=function(e){if(e instanceof $root.ErrorMessage)return e;let t=new $root.ErrorMessage;return null!=e.code&&(t.code=0|e.code),null!=e.reason&&(t.reason=String(e.reason)),t},e.toObject=function(e,t){t||(t={});let n={};return t.defaults&&(n.code=0,n.reason=""),null!=e.code&&e.hasOwnProperty("code")&&(n.code=e.code),null!=e.reason&&e.hasOwnProperty("reason")&&(n.reason=e.reason),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,protobufjs.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/ErrorMessage"},e})();var proto_NotificationType=function(e){return e.UserConversationReestablishNotification="UserConversationReestablishNotification",e.OnlineMessage="OnlineMessage",e.ReactionMessage="ReactionMessage",e}({});let parseMessageFromDataPacket=async e=>{try{var t;
1let n=await e.arrayBuffer(),r=new Uint8Array(n),i=$root.DataPacket.decode(r),s=i.name;if(s&&"function"==typeof(null==(t=$root[s])?void 0:t.decode))return{type:s,data:$root[s].decode(i.payload).toJSON()}}catch(e){console.warn("UnSupported DataPacket Type.")}return null};var fingerprint2=__webpack_require__(9820),fingerprint2_default=__webpack_require__.n(fingerprint2);function _define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class FingerPrint{async initMurmur(){if(this.murmur)return this.murmur;let e=(await fingerprint2_default().getPromise()).map(e=>e.value),t=fingerprint2_default().x64hash128(e.join(""),this.len);return this.murmur=t,t}create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return"".concat(this.murmur,"-").concat(e)}constructor(e){_define_property(this,"prefix",""),_define_property(this,"len",33),_define_property(this,"murmur",""),this.prefix=e}}let singleton=null;function getFingerPrint(e){return singleton||(singleton=new FingerPrint(e)),singleton}function noEnumerable(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];n.forEach(t=>{Object.defineProperty(e,t,{enumerable:!1})})}function parseJson(e){if(!e)return null;try{return JSON.parse(e)}catch(e){return null}}function lt(e,t){return new external_big_js_Big(e).lt(t)}function findNonContinuousRanges(e){let t=[];if(e.length<2)return t;for(let n=1;n<e.length;n++)e[n]!==e[n-1]+1&&t.push({start:e[n-1]+1,end:e[n]-1});return t}function isUserId(e){return!!Number(e)}function life_cycle_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class LifeCycle{init(){}destroy(){}bindIM(e){this.im=e}get fingerPrint(){return this.im.fingerPrint}get socket(){return this.im.socket}get _api(){return this.im._api}get db(){return this.im.db}get setting(){return this.im.setting}get conversation(){return this.im.conversation}get conversationPermission(){return this.im.conversationPermission}get message(){return this.im.message}get group(){return this.im.group}get category(){return this.im.category}get reaction(){return this.im.reaction}constructor(){life_cycle_define_property(this,"im",void 0),noEnumerable(this,"im")}}var request_BaseErrorCode=function(e){return e[e.DATA_ERROR=-1e4]="DATA_ERROR",e[e.REQUEST_FAILED=-10001]="REQUEST_FAILED",e[e.REQUEST_NOT_READY=-10002]="REQUEST_NOT_READY",e[e.REQUEST_PENDING=-10003]="REQUEST_PENDING",e}({}),request_SystemErrorCode=function(e){return e[e.INVALID_PARAM=1001]="INVALID_PARAM",e[e.FREQUENT_OPERATION=1002]="FREQUENT_OPERATION",e[e.NOT_PERMISSION=1003]="NOT_PERMISSION",e[e.EntityNotFound=1004]="EntityNotFound",e[e.RECALL_TIMEOUT=1010]="RECALL_TIMEOUT",e[e.GROUP_NOT_EXIST=1100]="GROUP_NOT_EXIST",e[e.GROUP_MEMBER_NOT_EXIST=1101]="GROUP_MEMBER_NOT_EXIST",e[e.GROUP_MEMBER_MUTE=1102]="GROUP_MEMBER_MUTE",e[e.GROUP_MEMBER_LIMIT=1103]="GROUP_MEMBER_LIMIT",e[e.GROUP_NOTICE_NOT_EXIST=1104]="GROUP_NOTICE_NOT_EXIST",e[e.GROUP_MANAGER_COUNT_LIMIT=1105]="GROUP_MANAGER_COUNT_LIMIT",e[e.GROUP_MEMBER_BLACK=1106]="GROUP_MEMBER_BLACK",e[e.GROUP_BAN=1107]="GROUP_BAN",e[e.GROUP_BAN_FOREVER=1108]="GROUP_BAN_FOREVER",e[e.GROUP_MEMBER_EXIST=1109]="GROUP_MEMBER_EXIST",e[e.APPROVAL_NOT_EXIST=1111]="APPROVAL_NOT_EXIST",e[e.APPROVAL_SUBMIT_FAIL=1112]="APPROVAL_SUBMIT_FAIL",e[e.APPROVAL_SUBMIT_REPEAT=1113]="APPROVAL_SUBMIT_REPEAT",e[e.INVITE_CODE_NOT_EXIST=1121]="INVITE_CODE_NOT_EXIST",e[e.INVITE_CODE_DISABLED=1122]="INVITE_CODE_DISABLED",e[e.GROUP_COUNT_LIMIT=1123]="GROUP_COUNT_LIMIT",e}({}),request_SendMessageErrorCode=function(e){return e[e.LIMIT=1]="LIMIT",e[e.MUTE=2]="MUTE",e[e.RECIPIENT=3]="RECIPIENT",e[e.NORMAL_FAILED=4]="NORMAL_FAILED",e[e.SEND_FAIL=1e4]="SEND_FAIL",e[e.TIMEOUT=10001]="TIMEOUT",e[e.VERIFY_EMAIL=10002]="VERIFY_EMAIL",e[e.VERIFY_PHONE=10003]="VERIFY_PHONE",e[e.EXCEED_REPLY_LIMIT=10004]="EXCEED_REPLY_LIMIT",e[e.EXCEED_STRANGER_LIMIT=10005]="EXCEED_STRANGER_LIMIT",e[e.CHAT_SETTING_DISABLED=10006]="CHAT_SETTING_DISABLED",e[e.CONVERSATION_LIMIT=10007]="
1CONVERSATION_LIMIT",e[e.MESSAGE_ILLEGAL=11e3]="MESSAGE_ILLEGAL",e[e.GUEST=19999]="GUEST",e}({});class Request extends LifeCycle{get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.im.options.request({method:"get",url:e,params:t,data:n})}post(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.im.options.request({method:"post",url:e,params:n,data:t})}put(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.im.options.request({method:"put",url:e,params:n,data:t})}delete(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.im.options.request({method:"delete",url:e,params:n,data:t})}patch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.im.options.request({method:"patch",url:e,params:n,data:t})}}class CategoryApi extends Request{async getCategory(e){return this.get("/chat/conversation/category/list",e)}async addCategory(e){return this.post("/chat/conversation/category/add",e)}async updateCategory(e){return this.post("/chat/conversation/category/update",e)}async reorderCategory(e){return this.post("/chat/conversation/category/reorder",e)}async deleteCategory(e){return this.post("/chat/conversation/category/delete",e)}}class ConversationApi extends Request{async getPermission(e){return this.get("/chat/conversation/permission",e)}async getList(e){return this.get("/chat/user-conversations",e)}async del(e){return this.delete("/chat/user-conversations",{},e)}async active(e){return this.post("/chat/activeConversation",{},e)}async create(e){return this.post("/chat/conversation",{},e)}async postUnreadAck(e){return this.post("/chat/unread/ack",{},e)}async setSilent(e){return this.patch("/chat/conversation/silent",{},e)}async removeSilent(e){return this.delete("/chat/conversation/silent",{},e)}async setSticky(e){return this.patch("/chat/conversation/sticky",{},e)}async removeSticky(e){return this.delete("/chat/conversation/sticky",{},e)}async setRemark(e){return this.patch("/chat/conversation/remark",{},e)}async removeBlock(e){return this.delete("/chat/conversation/block",{},e)}async setBlock(e){return this.post("/chat/conversation/block",{},e)}}class GlobalApi extends Request{async getToken(){return this.get("/api/v1/pro/im3biz/token/get")}}class GroupApi extends Request{async update(e){return this.post("/chat/group/update",e)}async disband(e){return this.post("/chat/group/delete",e)}async create(e){return this.post("/chat/group",e)}async info(e){return this.get("/chat/group",e)}async muteMembers(e){return this.post("/chat/groupPermission/muteMembers",e)}async removeManagers(e){return this.post("/chat/groupPermission/removeManagers",e)}async unmuteMembers(e){return this.post("/chat/groupPermission/unmuteMembers",e)}async manageList(e){return this.get("/chat/groupPermission/manageList",e)}async addManagers(e){return this.post("/chat/groupPermission/addManagers",e)}async addMembers(e){return this.post("/chat/groupMember/add",e)}async transferGroupMaster(e){return this.post("/chat/groupPermission/transferGroupMaster",e)}async setManagers(e){return this.post("/chat/groupPermission/setManagers",e)}async leave(e){return this.post("/chat/groupMember/leave",e)}async kick(e){return this.post("/chat/groupMember/kick",e)}async memberList(e){return this.get("/chat/groupMember/list",e)}async memberPageList(e){return this.get("/chat/groupMember/pageList",e)}async canApprovalJoin(e){return this.get("/chat/groupMember/canApprovalJoin?convId=".concat(e.convId))}async invite(e){return this.post("/chat/groupMember/invite",e)}async join(e){return this.post("/chat/groupMember/join",e)}async noticeList(e){return this.get("/chat/groupNotice/list",e)}async noticeDetail(e){return this.get("/chat/groupNotice/detail",e)}async noticeUpdate(e){return this.post("/chat/groupNotice/update",e)}async noticeAdd(e){return this.post("/chat/groupNotice/add",e)}async noticeDelete(e){return this.post("/chat/groupNotice/delete",e)}
1async noticeViewed(e){return this.post("/chat/group/setting/notice/disable",e)}async approvalApprove(e){return this.post("/chat/group/approval/approve",{},e)}async approvalReject(e){return this.post("/chat/group/approval/reject",{},e)}async joinApprovalEnable(e){return this.put("/chat/group/setting/join-approval-enable",{},e)}async inviteRevoke(e){return this.post("/chat/groupInvite/revoke",e)}async inviteList(e){return this.get("/chat/groupInvite/list",e)}async inviteJoin(e){return this.post("/chat/groupInvite/joinGroup",e)}async inviteInfo(e){return this.get("/chat/groupInvite/info",e)}async inviteAdd(e){return this.post("/chat/groupInvite/add",e)}async setSearch(e){return this.post("/chat/group/setting/search",{},e)}async getSettingInfo(e){return this.get("/chat/group/setting",e)}async setViewHistoryMessage(e){return this.post("/chat/group/setting/viewHistoryMessage",{},e)}async setDirectMessage(e){return this.post("/chat/group/setting/directMessage",{},e)}async getBlackList(e){return this.get("/chat/group/setting/blackList",e)}async removeBlackList(e){return this.post("/chat/group/setting/removeBlack",e)}async setMuteAll(e){return this.post("/chat/groupPermission/muteAll",e)}async setUnMuteAll(e){return this.post("/chat/groupPermission/unmuteAll",e)}}class MessageApi extends Request{async getList(e){return this.get("/chat/messages",e)}async send(e,t){return this.post("/chat/send",t,e)}async recall(e){return this.post("/chat/message/recall",{},e)}async search(e){return this.post("/chat/search/conversationMessage",e)}}class ReactionApi extends Request{async statistics(e){return this.get("/chat/reaction/statistics",e)}async statisticsDetail(e){return this.get("/chat/reaction/statisticsDetail",e)}async userList(e){return this.get("/chat/reaction/userList",e)}async list(e){let t="";return e.msgIds.filter(e=>!!e).forEach((e,n)=>{t=t.concat("&msgIds[".concat(n,"]=").concat(e))}),this.get("/chat/reaction/statistics/list?convId=".concat(e.convId).concat(t))}async del(e){return this.post("/chat/reaction/delete",e)}async add(e){return this.post("/chat/reaction/add",e)}}var request_type_ConversationType=function(e){return e.Unknown="UnKnown",e.P2P="P2P",e.Group="Group",e.ChatRoom="ChatRoom",e.MessageBox="MessageBox",e}({}),request_type_ConversationState=function(e){return e.Default="",e.Normal="Normal",e.Disband="Disband",e.Leave="Leave",e.Deleted="Deleted",e.Kickout="Kickout",e.Ban="Ban",e.BanForever="BanForever",e}({}),request_type_ConversationPermissionCode=function(e){return e[e.Unknown=-1]="Unknown",e[e.Normal=0]="Normal",e[e.Limit=1]="Limit",e[e.Mute=2]="Mute",e[e.Block=3]="Block",e[e.Ban=4]="Ban",e[e.BanForever=5]="BanForever",e[e.ConversationNotExist=11]="ConversationNotExist",e[e.Kickout=12]="Kickout",e[e.Leave=13]="Leave",e}({}),request_type_SendStatus=function(e){return e[e.Success=0]="Success",e[e.Sending=-1]="Sending",e[e.Timeout=-2]="Timeout",e[e.Failed=-3]="Failed",e}({}),request_type_MessageStatus=function(e){return e.Normal="Normal",e.Recall="Recall",e.Blocked="Blocked",e.Restricted="Restricted",e}({}),request_type_MemberRole=function(e){return e[e.Owner=1]="Owner",e[e.Manager=2]="Manager",e[e.Member=0]="Member",e[e.CustomerService=3]="CustomerService",e}({}),request_type_ConversationLabelsKey=function(e){return e.Sticky="Sticky",e.Silent="Silent",e.Block="Block",e.Bot="Bot",e.CustomerService="CustomerService",e.System="System",e.Deleted="Deleted",e}({});function api_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Api extends LifeCycle{init(){super.init(),this.conversationApi.init(),this.messageApi.init(),this.groupApi.init(),this.categoryApi.init(),this.reactionApi.init(),this.globalApi.init()}bindIM(e){super.bindIM(e),this.conversationApi.bindIM(e),this.messageApi.bindIM(e),this.groupApi.bindIM(e),this.categoryApi.bindIM(e),this.reactionApi.bindIM(e),this.globalApi.bindIM(e)}constructor(...e){super(...e),api_define_property(this,"conversationApi",new ConversationApi),api_define_property(this,"messageApi",new MessageApi),api_define_property(this,"groupApi",new GroupApi),api_define_property(this,"categoryApi",new CategoryApi),api_define_property(this,"reactionApi",new ReactionApi),api_define_property(this,"globalApi",new GlobalApi)}}let ValueTypes=["string","number","boolean"];class model_Model{fromJson(e){let t=e;
1return Object.keys(e).forEach(e=>{let n=t[e],r=this[e],i=typeof n;if(i===typeof r&&ValueTypes.includes(i)){this[e]=n;return}if(Array.isArray(n)){if(void 0===this.constructor[e])this[e]=n;else if(Object.getPrototypeOf(this.constructor[e])===model_Model){let t=this.constructor[e];this[e]=n.map(e=>new t().fromJson(e))}return}(n&&"object"===i||null===r)&&(r instanceof model_Model?r.fromJson(n):this[e]=n)}),this}}function base_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class PluginBase extends LifeCycle{createModel(e){let t=new this.Model;return t instanceof model_Model?t.fromJson(e):(Object.keys(e).forEach(n=>{if(n in t){let r=e[n];t[n]=r}}),t)}createByKeyModel(e){let t=new this.Model;return t[this.key]=e,t}constructor(e){super(),base_define_property(this,"key",void 0),base_define_property(this,"Model",void 0),this.key=e.key,this.Model=e.Model}}function custom_event_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class CustomEvent{get size(){return this._listeners.length}listen(e){this._listeners.push(e)}dispatchEvent(e){return this._listeners.map(t=>t(e))}removeListen(e){let t=this._listeners.indexOf(e);t>-1&&this._listeners.splice(t,1)}destroy(){this._listeners.slice(0)}constructor(){custom_event_define_property(this,"_listeners",[])}}function store_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Store{get list(){return this.gerRefValue(),this._list}gerRefValue(){return this.ref.value}get(e){var t;return this.gerRefValue(),null!=(t=this._map.get(e))?t:null}has(e){return this.gerRefValue(),this._map.has(e)}set(e,t){let n=this._indexes.indexOf(e);if(n>-1){this._indexes.splice(n,1,e);let[r]=this.list.splice(n,1,t);r instanceof model_Model&&(r.fromJson(t),t=r),this._map.set(e,t),this.onUpdated.dispatchEvent(t)}else this._indexes.push(e),this.list.push(t),this._map.set(e,t),this.onCreated.dispatchEvent(t);this._setState()}delete(e){let t=this._indexes.indexOf(e);if(-1===t)return;this._indexes.splice(t,1);let[n]=this.list.splice(t,1);this._map.delete(e),this.onDeleted.dispatchEvent(n),this._setState()}destroy(){this.onCreated.destroy(),this.onDeleted.destroy(),this.onUpdated.destroy(),this.onChanged.destroy()}_setState(e){e&&(this.markConcurrency++,e(),this.markConcurrency--),this.markConcurrency<=0&&(this.ref={value:++this.ref.value},this.onChanged.dispatchEvent(!0))}constructor(){store_define_property(this,"onCreated",new CustomEvent),store_define_property(this,"onDeleted",new CustomEvent),store_define_property(this,"onUpdated",new CustomEvent),store_define_property(this,"onChanged",new CustomEvent),store_define_property(this,"_list",[]),store_define_property(this,"_indexes",[]),store_define_property(this,"_map",new Map),store_define_property(this,"ref",{value:0}),store_define_property(this,"markConcurrency",0),noEnumerable(this,"onCreated","onDeleted","onUpdated","onChanged","_list","_indexes","_map","markConcurrency")}}class StorePlugin extends PluginBase{get onCreated(){return this.store.onCreated}get onUpdated(){return this.store.onUpdated}get onDeleted(){return this.store.onDeleted}get onChanged(){return this.store.onChanged}get list(){return this.store.list}get(e){return this.store.get(e)||null}getOrDefault(e){return this.get(e)||this.createByKeyModel(e)}getOrCreate(e){let t=this.get(e);return t||((t=this.createModel({}))[this.key]=e,this.set(t)),t}has(e){return!!this.get(e)}delete(e){this.store._setState(()=>{(Array.isArray(e)?e:[e]).forEach(e=>{this.store.delete(e)})})}set(e){this.store._setState(()=>{(Array.isArray(e)?e:[e]).forEach(e=>{e instanceof this.Model?this.store.set(e[this.key],e):this.store.set(e[this.key],this.createModel(e))})})}copy(e){let t=this.getOrDefault(e),n=this.createModel(t);return n[this.key]=e,n}constructor(e){super(e),store_define_property(this,"store",void 0),this.store=new Store}}function table_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class TablePlugin extends PluginBase{get name(){return this._name}async getAll(e,t,n){return(await this.db.getAll(this.name,e,t,n)).map(e=>this.createModel(e))}async query(e){return(await this.db.query(this.name,e)).map(e=>this.createModel(e))}async get(e){let t=await this.db.get(this.name,e);return t?Array.isArray(t)?t.map(e=>this.createModel(e)):this.createModel(t):null}async getOrDefault(e){let t=await this.get(e);return t||this.createByKeyModel(e)}async getMultiple(e){return await this.get(e)||[]}async has(e){let t=await this.db.getReadonlyStoreOrIdx(this.name);return await (null==t?void 0:t.getKey(e))!==void 0}async delete(e){return this.db.delete(this.name,e)}set(e){return this.db.put(this.name,e)}init(){super.init(),this.db.onUpgrade.listen(this.onUpgrade)}destroy(){this.db.onUpgrade.removeListen(this.onUpgrade),super.destroy()}constructor(e){super(e),table_define_property(this,"_name",void 0),table_define_property(this,"indexes",void 0),table_define_property(this,"onUpgrade",e=>{let{name:t,key:n,indexes:r}=this;if(e.objectStoreNames.contains(t))return;let i=e.createObjectStore(t,{keyPath:n});
1null==r||r.forEach(e=>{let t=void 0!==e.name?e.name:"string"==typeof e.keyPath?e.keyPath:e.keyPath.join(",");e.name=t,i.createIndex(t,e.keyPath,e.params)})}),this._name=e.name,this.indexes=e.indexes}}function ready_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ReadyPromise{get loading(){return!this.isError&&!this.finished}get value(){return this._value}error(e){this.isError=e}constructor(){ready_define_property(this,"finish",void 0),ready_define_property(this,"await",void 0),ready_define_property(this,"finished",!1),ready_define_property(this,"isError",!1),ready_define_property(this,"_value",null),this.await=new Promise(e=>{this.finish=t=>{this.finish=noon,this.finished=!0,this.isError=!1,this._value=t,e(t)}})}}function noon(){}function plugin_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class TableStoreWrapperPlugin extends PluginBase{init(){super.init(),this.store.init(),this.table.init()}destroy(){this.store.destroy(),this.table.destroy(),super.destroy()}bindIM(e){super.bindIM(e),this.store.bindIM(e),this.table.bindIM(e)}get list(){return this.store.list}get(e){return this.store.get(e)}getOrDefault(e){return this.store.getOrDefault(e)}getOrCreate(e){return this.store.getOrCreate(e)}has(e){return this.store.has(e)}copy(e){return this.store.copy(e)}async del(e){return this.store.delete(e),this.table.delete(e)}async set(e){return this.store.set(e),this.table.set(e)}async syncTableToStore(e){let t=e&&0!==e.length?await this.table.getMultiple(e):await this.table.getAll();this.store.set(t)}constructor({key:e,Model:t,name:n,indexes:r}){super({key:e,Model:t}),plugin_define_property(this,"store",void 0),plugin_define_property(this,"table",void 0),plugin_define_property(this,"ready",new ReadyPromise),plugin_define_property(this,"normalList",[]),this.store=new StorePlugin({key:e,Model:t}),this.table=new TablePlugin({key:e,Model:t,name:n,indexes:r})}}let instanceOfAny=(e,t)=>t.some(t=>e instanceof t);function getIdbProxyableTypes(){return idbProxyableTypes||(idbProxyableTypes=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function getCursorAdvanceMethods(){return cursorAdvanceMethods||(cursorAdvanceMethods=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}let cursorRequestMap=new WeakMap,transactionDoneMap=new WeakMap,transactionStoreNamesMap=new WeakMap,transformCache=new WeakMap,reverseTransformCache=new WeakMap;function promisifyRequest(e){let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{t(wrap(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&cursorRequestMap.set(t,e)}).catch(()=>{}),reverseTransformCache.set(t,e),t}function cacheDonePromiseForTransaction(e){if(transactionDoneMap.has(e))return;let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)});transactionDoneMap.set(e,t)}let idbProxyTraps={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return transactionDoneMap.get(e);if("objectStoreNames"===t)return e.objectStoreNames||transactionStoreNamesMap.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return wrap(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function replaceTraps(e){idbProxyTraps=e(idbProxyTraps)}function wrapFunction(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?getCursorAdvanceMethods().includes(e)?function(...t){return e.apply(unwrap(this),t),wrap(cursorRequestMap.get(this))}:function(...t){return wrap(e.apply(unwrap(this),t))}:function(t,...n){let r=e.call(unwrap(this),t,...n);return transactionStoreNamesMap.set(r,t.sort?t.sort():[t]),wrap(r)}}function transformCachableValue(e){return"function"==typeof e?wrapFunction(e):(e instanceof IDBTransaction&&cacheDonePromiseForTransaction(e),instanceOfAny(e,getIdbProxyableTypes()))?new Proxy(e,idbProxyTraps):e}function wrap(e){if(e instanceof IDBRequest)return promisifyRequest(e);
1if(transformCache.has(e))return transformCache.get(e);let t=transformCachableValue(e);return t!==e&&(transformCache.set(e,t),reverseTransformCache.set(t,e)),t}let unwrap=e=>reverseTransformCache.get(e);function openDB(e,t,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){let o=indexedDB.open(e,t),a=wrap(o);return r&&o.addEventListener("upgradeneeded",e=>{r(wrap(o.result),e.oldVersion,e.newVersion,wrap(o.transaction),e)}),n&&o.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),a.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}function deleteDB(e,{blocked:t}={}){let n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",e=>t(e.oldVersion,e)),wrap(n).then(()=>void 0)}let readMethods=["get","getKey","getAll","getAllKeys","count"],writeMethods=["put","add","delete","clear"],cachedMethods=new Map;function getMethod(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(cachedMethods.get(t))return cachedMethods.get(t);let n=t.replace(/FromIndex$/,""),r=t!==n,i=writeMethods.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||readMethods.includes(n)))return;let s=async function(e,...t){let s=this.transaction(e,i?"readwrite":"readonly"),o=s.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&s.done]))[0]};return cachedMethods.set(t,s),s}function db_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}replaceTraps(e=>({...e,get:(t,n,r)=>getMethod(t,n)||e.get(t,n,r),has:(t,n)=>!!getMethod(t,n)||e.has(t,n)}));class DB extends LifeCycle{async init(){super.init();let{options:e,userId:t}=this.im,n="".concat(e.dbPrefix,"_").concat(t),r=await openDB(n,e.dbVersion,{upgrade:(e,t,n)=>{n&&t&&n>t&&deleteDB(e.name),this.onUpgrade.dispatchEvent(e)}});this._db.finish(r)}async destroy(){let e=await this._db.await;e&&e.close(),super.destroy()}async get(e,t,n){try{let r=await this.getReadonlyStoreOrIdx(e,n);if(!r)return null;if("string"==typeof t)return r.get(t);return(await Promise.all(t.map(e=>r.get(e)))).filter(e=>!!e)}catch(e){return null}}async put(e,t){let n=await this.getTransaction(e,"readwrite");if(!n)return!1;try{let r=n.objectStore(e);if(Array.isArray(t))return await Promise.all(t.map(e=>r.put(e))),!0;return await r.put(t),!0}catch(e){return n.abort(),!1}}async delete(e,t){let n=await this._db.await;if(!n)return!1;let r=n.transaction(e,"readwrite");try{let n=r.objectStore(e);return"string"==typeof t?await n.delete(t):await Promise.all(t.map(e=>n.delete(e))),!0}catch(e){return r.abort(),!1}}async getAll(e,t,n,r){try{let i=await this.getReadonlyStoreOrIdx(e,t);if(!i)return[];return i.getAll(n,r)}catch(e){return[]}}async query(e,t){try{let r=await this.getReadonlyStoreOrIdx(e,t.index);if(!r)return[];let i=[],s=t.count||50,o=!!t.forceNext,a=t.filter||(()=>!0),l=await r.openCursor(t.query,t.direction);async function n(e){if(!(null==e?void 0:e.value))return;let t=a(e.value);if(t&&i.push(e.value),(t||o)&&i.length<s)return n(await e.continue())}return await n(l),i}catch(e){return[]}}async getDB(){return this._db.await}async getTransaction(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"readonly",n=this._db.finished?this._db.value:await this._db.await;return(null==n?void 0:n.transaction(e,t))||null}async getStore(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"readonly",n=await this.getTransaction(e,t);return(null==n?void 0:n.objectStore(e))||null}async getIndex(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"readonly",r=await this.get
1Store(e,n);return(null==r?void 0:r.index(t))||null}async getReadonlyStoreOrIdx(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"readonly";return t?this.getIndex(e,t,n):this.getStore(e,n)}async getCursorIterator(e,t,n){let r=await e,i=await (null==r?void 0:r.openCursor(t,n));return{[Symbol.asyncIterator]:()=>({async next(){if(!(null==i?void 0:i.value))return{value:void 0,done:!0};let e=i.value;return i=await i.continue(),{value:e,done:!1}},return:async()=>({value:void 0,done:!0}),throw:async()=>((null==i?void 0:i.value)&&r&&("objectStore"in r?r.objectStore.transaction.abort():r.transaction.abort()),{value:void 0,done:!0})})}}constructor(...e){super(...e),db_define_property(this,"onUpgrade",new CustomEvent),db_define_property(this,"_db",new ReadyPromise)}}let retryIntervalPlugin=e=>{if("object"!=typeof window)return;let t=()=>e.connect(),n=()=>{"visible"===document.visibilityState&&t()},r=null,i=()=>{r&&(window.removeEventListener("online",t),document.removeEventListener("visibilitychange",n),clearInterval(r),r=null)},s=()=>{r||(window.addEventListener("online",t),document.addEventListener("visibilitychange",n),r=setInterval(t,e.options.retryInterval||3e3),t())};e.subscribeState(t=>{if(!e.disabled)switch(t){case SocketState.stateless:case SocketState.open:i();break;case SocketState.close:case SocketState.error:s()}})};function socket_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let pingData=new Uint8Array([8,1,16,255,237,228,152,198,50,26,4,80,105,110,103]);class socket_Socket extends LifeCycle{async init(){super.init(),this._socket=new Socket({url:this.url,protocols:this.im.options.protocols,pingInterval:5e3,retryInterval:5e3,plugins:[retryIntervalPlugin],pingData}),this._socket.subscribeMessage(e=>{let t=!this._events.length;this._events.push(e),t&&this._parseEvent()}),this._socket.subscribeState(e=>{if(this.onState.dispatchEvent(e),e===SocketState.open){var t;null==(t=this._socket)||t.send(pingData),this.onOpen.dispatchEvent(SocketState.open)}}),this._socket.subscribeState(e=>{(e===SocketState.close||e===SocketState.error)&&this.onReconnect&&this.onReconnect()}),this._socket.connect()}get state(){var e;return(null==(e=this._socket)?void 0:e.state)||SocketState.stateless}reconnect(){var e;return null==(e=this._socket)?void 0:e.connect()}destroy(){var e;null==(e=this._socket)||e.dispose(),this.onMessage.destroy(),super.destroy()}async _parseEvent(){let e=this._events.shift();if(!e)return;let t=await parseMessageFromDataPacket(e.data);t&&this.onMessage.dispatchEvent(t),this._parseEvent()}constructor(...e){super(...e),socket_define_property(this,"url",""),socket_define_property(this,"onMessage",new CustomEvent),socket_define_property(this,"onState",new CustomEvent),socket_define_property(this,"onReconnect",()=>{}),socket_define_property(this,"onOpen",new CustomEvent),socket_define_property(this,"_socket",null),socket_define_property(this,"_events",[])}}function common_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Sender extends model_Model{constructor(...e){super(...e),common_define_property(this,"id",""),common_define_property(this,"name",""),common_define_property(this,"avatarUrl","")}}function event_message_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class EventMessageFields extends model_Model{getOldValue(){return"string"==typeof this.oldValue?this.oldValue:new Sender().fromJson(this.oldValue||{})}getNewValue(){return"string"==typeof this.newValue?this.newValue:new Sender().fromJson(this.newValue||{})}constructor(...e){super(...e),event_message_define_property(this,"operator",new Sender),event_message_define_property(this,"members",[]),event_message_define_property(this,"oldValue",null),event_message_define_property(this,"newValue",null),event_message_define_property(this,"code",0),event_message_define_property(this,"message","")}}
1class EventMessageGroupBanFields extends EventMessageFields{constructor(...e){super(...e),event_message_define_property(this,"groupId",""),event_message_define_property(this,"groupName",""),event_message_define_property(this,"groupAvatarUrl",""),event_message_define_property(this,"expiredTime",0),event_message_define_property(this,"duration","")}}var event_message_EventMessageType=function(e){return e.Unknown="",e.JoinGroupChatWelcomeEvent="JoinGroupChatWelcomeEvent",e.KickMemberEvent="KickMemberEvent",e.GroupMemberLeaveEvent="GroupMemberLeaveEvent",e.GroupMemberJoinEvent="GroupMemberJoinEvent",e.GroupNameChangeEvent="GroupNameChangeEvent",e.GroupAvatarChangeEvent="GroupAvatarChangeEvent",e.GroupMasterChangeEvent="GroupMasterChangeEvent",e.GroupCreateEvent="GroupCreateEvent",e.GroupDisbandEvent="GroupDisbandEvent",e.GroupAddManagerEvent="GroupAddManagerEvent",e.MessageRecall="MessageRecall",e.GlobalLocalError="GlobalLocalError",e.GroupUnBanEvent="GroupUnBanEvent",e.GroupBanEvent="GroupBanEvent",e.GroupBanForeverEvent="GroupBanForeverEvent",e}({});class EventMessage extends model_Model{get type(){return this.name}constructor(...e){super(...e),event_message_define_property(this,"name",""),event_message_define_property(this,"datas",{})}}function business_message_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var business_message_BusinessCardType=function(e){return e.Unknown="",e.User="User",e.Group="Group",e.Account="Account",e}({});class UserCardModel extends model_Model{get isBrand(){return this.brandStatus>0}constructor(...e){super(...e),business_message_define_property(this,"accountRole",0),business_message_define_property(this,"medalUrls",[]),business_message_define_property(this,"nation",""),business_message_define_property(this,"followers",0),business_message_define_property(this,"posts",0),business_message_define_property(this,"brandStatus",0)}}class GroupCardModel extends model_Model{constructor(...e){super(...e),business_message_define_property(this,"memberCount",0),business_message_define_property(this,"isSuper",!1)}}class AccountCardModel extends model_Model{get isSignal(){return 1===this.accountType}constructor(...e){super(...e),business_message_define_property(this,"accountIndex",0),business_message_define_property(this,"userId",0),business_message_define_property(this,"nation",""),business_message_define_property(this,"medalUrls",[]),business_message_define_property(this,"rank",0),business_message_define_property(this,"accountType",2),business_message_define_property(this,"subscribing",0),business_message_define_property(this,"totalSubscribed",0)}}class BusinessCardMessage extends model_Model{getMessageBody(){return parseJson(this.bizContent)}constructor(...e){super(...e),business_message_define_property(this,"id",""),business_message_define_property(this,"name",""),business_message_define_property(this,"introduction",""),business_message_define_property(this,"backgroundUrl",""),business_message_define_property(this,"avatarUrl",""),business_message_define_property(this,"type",""),business_message_define_property(this,"bizContent",""),business_message_define_property(this,"actionUrl","")}}function extension_message_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ExtensionMessage extends model_Model{getMessageBody(){try{return JSON.parse(this.content)}catch(e){return null}}constructor(...e){super(...e),extension_message_define_property(this,"type",""),extension_message_define_property(this,"content","")}}function message_type_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var message_type_MessageType=function(e){return e.Text="Text",e.Image="Image",e.File="File",e.Video="Video",e.Voice="Voice",e.Combined="Combined",e.Event="Event",e.Recall="Recall",e.Patch="Patch",e.GroupApproval="GroupApproval",e.GroupNotice="GroupNotice",e.Notification="Notification",e.Information="Information",e.BusinessCard="BusinessCard",e.Extension="Extension",e.Link="Link",e.News="News",e.ActionCard="ActionCard",e.Card="Card",e}({});class TextMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"content","")}}class ImageMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"uri",""),message_type_define_property(this,"width",0),message_type_define_property(this,"height",0),message_type_define_property(this,"mediaType","image")}}class FileMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"mediaType","file"),message_type_define_property(this,"uri",""),message_type_define_property(this,"file",""),message_type_define_property(this,"size",0),message_type_define_property(this,"uploadTime",0)}}class VideoMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"mediaType","video"),message_type_define_property(this,"uri",""),message_type_define_property(this,"previewsetUri",""),message_type_define_property(this,"thumb",""),message_type_define_property(this,"width",0),message_type_define_property(this,"height",0),message_type_define_property(this,"size",0),message_type_define_property(this,"duration",0)}}class VoiceMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"mediaType","voice"),message_type_define_property(this,"uri",""),message_type_define_property(this,"duration",0),message_type_define_property(this,"recognitionUri","")}}class CombinedMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"text",""),message_type_define_property(this,"attachments",[])}}class CardMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"title",""),message_type_define_property(this,"text",""),message_type_define_property(this,"tail",""),message_type_define_property(this,"actionUri","")}}class LinkMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"url",""),message_type_define_property(this,"caption",""),message_type_define_property(this,"description","")}}class NewsMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"articles",[])}}class RecallMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"msgid",""),message_type_define_property(this,"operator",new Sender),message_type_define_property(this,"timestamp",0)}}class ActionCardMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"title",""),message_type_define_property(this,"icon",""),message_type_define_property(this,"text",""),message_type_define_property(this,"actions",[]),message_type_define_property(this,"arguments",{})}}class GroupNoticeMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"content",""),message_type_define_property(this,"createTime",0),message_type_define_property(this,"id",""),message_type_define_property(this,"sticky",!1),message_type_define_property(this,"updateTime",0),message_type_define_property(this,"userId",""),message_type_define_property(this,"version",0)}}class PatchMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"target",""),message_type_define_property(this,"patch",null)}}var message_type_GroupApprovalType=function(e){return e.Unknown="",e.GroupInviteApproval="GroupInviteApproval",e.GroupJoinApproval="GroupJoinApproval",e.GroupJoinReject="GroupJoinReject",e.GroupKickout="GroupKickout",e}({}),message_type_GroupApprovalStatus=function(e){return e[e.Pending=0]="Pending",e[e.Approved=1]="Approved",e[e.Rejected=2]="Rejected",e[e.Invalid=3]="Invalid",e[e.Expired=9]="Expired",e}({});class GroupApprovalMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"transactionId",""),message_type_define_property(this,"sender",new Sender),message_type_define_property(this,"receiver",new Sender),message_type_define_property(this,"groupId",""),message_type_define_property(this,"groupName",""),message_type_define_property(this,"groupAvatar",""),message_type_define_property(this,"status",0),message_type_define_property(this,"approveCallback",""),message_type_define_property(this,"rejectCallback",""),message_type_define_property(this,"type","")}}class NotificationMessage extends model_Model{constructor(...e){super(...e),message_type_define_property(this,"actionUrl",""),message_type_define_property(this,"attachments",[]),message_type_define_property(this,"author",new Sender),message_type_define_property(this,"content",""),message_type_define_property(this,"title","")}}class InformationMessage extends NotificationMessage{constructor(...e){super(...e),message_type_define_property(this,"type","")}}let parseMessageBody=(e,t)=>{let n={Text:()=>new TextMessage().fromJson(t),Image:()=>new ImageMessage().fromJson(t),File:()=>new FileMessage().fromJson(t),Video:()=>new VideoMessage().fromJson(t),Voice:()=>new VoiceMessage().fromJson(t),Card:()=>new CardMessage().fromJson(t),Combined:()=>new CombinedMessage().fromJson(t),Event:()=>new EventMessage().fromJson(t),Link:()=>new LinkMessage().fromJson(t),News:()=>new NewsMessage().fromJson(t),Recall:()=>new RecallMessage().fromJson(t),ActionCard:()=>new ActionCardMessage().fromJson(t),Patch:()=>new PatchMessage().fromJson(t),GroupApproval:()=>new GroupApprovalMessage().fromJson(t),Extension:()=>new ExtensionMessage().fromJson(t),GroupNotice:()=>new GroupNoticeMessage().fromJson(t),Notification:()=>new NotificationMessage().fromJson(t),Information:()=>new InformationMessage().fromJson(t),BusinessCard:()=>new BusinessCardMessage().fromJson(t)};if(message_type_MessageType[e]){let t=n[e];if("function"==typeof t)return t()}return null};function model_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class MessageModel extends model_Model{static from(e){return new this().fromJson(e)}get senderId(){return this.sender.id}get uuid(){return"".concat(this.internalId,"_").concat(this.seqid,"_").concat(this.localSubSeqId)}get isRecallEvent(){var e;return this.msgtype===message_type_MessageType.Event&&(null==(e=this.getMessageBody())?void 0:e.type)===event_message_EventMessageType.MessageRecall}get isTypePatch(){return this.msgtype===message_type_MessageType.Patch}get isRecall(){return this.status===request_type_MessageStatus.Recall}get isBlocked(){return this.status===request_type_MessageStatus.Blocked}get isRestricted(){return this.status===request_type_MessageStatus.Restricted}get _visible(){return!this.isDeleted&&!this.isRecallEvent&&!this.isTypePatch&&!this.isBlocked}isVisible(e){return this._visible}get isConvVisible(){return!!this.isRecallEvent||this._visible}getMessageBody(){return this.body?parseMessageBody(this.msgtype,this.body):null}getReferenceMessage(){return this.referenceMessage?this.constructor.from(this.referenceMessage):null}clone(){return this.constructor.from(JSON.parse(JSON.stringify(this)))}
1getAffectedMsgDiff(){if(!this.body)return null;if(this.isTypePatch){let e=this.getMessageBody(),t=e.target;if(!t)return null;let n=e.patch,r={};return(n&&Object.keys(n).forEach(e=>{let t=n[e];if(t){if("status"===e&&!request_type_MessageStatus[t])return;r[e]=n[e]}}),Object.keys(r).length)?{msgId:t,diff:r}:null}if(this.isRecallEvent){var e,t,n;let r=this.getMessageBody(),i=r.datas.msgid;if(!i)return null;let s=(null==(e=r.datas.operator)?void 0:e.id)||"";return{msgId:i,diff:{msgtype:message_type_MessageType.Recall,status:request_type_MessageStatus.Recall,body:{operator:{id:s,name:(null==(t=r.datas.operator)?void 0:t.name)||"",avatarUrl:(null==(n=r.datas.operator)?void 0:n.avatarUrl)||""},timestamp:r.datas.timestamp}}}}return null}constructor(...e){super(...e),model_define_property(this,"internalId",""),model_define_property(this,"convid",""),model_define_property(this,"localId",""),model_define_property(this,"msgid",""),model_define_property(this,"seqid",0),model_define_property(this,"localSubSeqId",0),model_define_property(this,"msgtype",message_type_MessageType.Text),model_define_property(this,"sender",new Sender),model_define_property(this,"referenceMessage",null),model_define_property(this,"referenceMessageId",""),model_define_property(this,"sendStatus",request_type_SendStatus.Success),model_define_property(this,"status",request_type_MessageStatus.Normal),model_define_property(this,"isDeleted",!1),model_define_property(this,"isConsumed",!1),model_define_property(this,"timestamp",0),model_define_property(this,"extensions",{}),model_define_property(this,"body",null)}}let IdxName_Conv_Seq_SubSeq="localId,seqid,localSubSeqId",IdxName_Conv_Msg="localId,msgid",getLargerLocalId=e=>e.length?e.slice(0,-1)+String.fromCharCode(e.at(-1).charCodeAt(0)+1):"\0",convRange=e=>IDBKeyRange.bound([e],[getLargerLocalId(e)]);class Message extends TablePlugin{async getLastMsgFromDB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=await this.query({index:IdxName_Conv_Seq_SubSeq,direction:"prev",query:convRange(e),count:t});return await this._updateOtherMsgInfos(n),n}async getLastMsgFromServer(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;await this._getMsgListFromServer({convId:e,count:n});
1let r=null==(t=this.conversation.getLocalByRemoteId(e))?void 0:t.localId;return this.getLastMsgFromDB(r||e,n)}async set(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=(e=Array.isArray(e)?e:[e]).map(e=>e.clone());let n=(await this.get(e.map(e=>e.internalId))||[]).reduce((e,t)=>(e[t.internalId]=t,e),{});if(e=e.map(e=>{let t=n[e.internalId];return t&&(t.seqid===e.seqid||e.localSubSeqId||t.localSubSeqId||(e.internalId+="-".concat(e.seqid)),t.isDeleted&&e.fromJson({isDeleted:t.isDeleted})),e}),!t)return super.set(e);let r=!0;for(let t of e)await super.set(t)?await this._updateOtherMsgInfo(t)&&(r=await super.set(t.fromJson({isConsumed:!0}))&&r):r=!1;return r}async recall(e){let{msgid:t,localId:n}=e;if(!t)return[null,null];let r=await this._api.messageApi.recall({id:t,state:this.fingerPrint.create()});return 0!==r.code?[null,r]:[await this._updateMsg(n,t,{msgtype:message_type_MessageType.Recall,status:request_type_MessageStatus.Recall,body:{operator:{id:this.im.userId,name:"",avatarUrl:""},timestamp:e.timestamp}}),null]}async delMsg(e){if("internalId"in e){let t=await this.get(e.internalId);return t?(t.fromJson({isDeleted:!0}),await this.set(t,!1),[t,!0]):[null,!1]}let{msgid:t,localId:n}=e;return t?[await this._updateMsg(n,t,{isDeleted:!0}),!0]:[null,!1]}async clearConv(e){let{start:t,end:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=await this.db.getReadonlyStoreOrIdx(this.name,IdxName_Conv_Msg);if(!r)return;void 0!==t&&(t=~~t),void 0!==n&&(n=~~n),void 0!==t&&void 0!==n&&t>n&&([t,n]=[n,t]);let i=await r.getAllKeys(IDBKeyRange.bound(void 0!==t?[e,t]:[e],void 0!==n?[e,n+1]:[getLargerLocalId(e)]));await this.delete(i)}async getMsgListByRange(e,t,n,r,i,s){let o=(n=~~n)>(r=~~r)?"prev":"next";r=Math.max(0,n=Math.max(0,Math.min(n,r)),r);let a=await this._getMsgListFromDB(e,n,r,i,s);if(!t)return a;let l=[...new Set([Math.max(0,i?n:n-1),...a.map(e=>e.seqid),s?r:r+1])].sort((e,t)=>e-t);return(await Promise.all(findNonContinuousRanges(l).map(async t=>{var n;return this._getMsgListFromServer({convId:(null==(n=this.conversation.get(e))?void 0:n.id)||e,...t})}))).length?this._getMsgListFromDB(e,n,r,i,s,o):a}async getMsgList(e){var t,n;let{start:r,end:i,count:s,...o}=e,a="convId"in o?o.convId:null==(t=this.conversation.get(o.localId))?void 0:t.id,l="localId"in o?o.localId:null==(n=this.conversation.getL
1ocalByRemoteId(o.convId))?void 0:n.localId;if(!a||!l)return[];void 0!==r&&void 0!==i&&r[0]>i[0]&&([r,i]=[i,r]);let[u,c]=r||[],[d,h]=i||[];if(void 0!==r&&void 0!==i)return this.getMsgListByRange(l,o.needRemote,u,d,c,h);if(s)if(void 0!==r)return(await this.getMsgListByRange(l,o.needRemote,u,u+s-!c,c)).slice(0,s);else{if(void 0!==i)return(await this.getMsgListByRange(l,o.needRemote,d-s+1,d,0,h)).slice(-s);let e=o.needRemote?(await this.getLastMsgFromServer(a))[0]:(await this.getLastMsgFromDB(l))[0];return e?(await this.getMsgListByRange(e.localId,o.needRemote,e.seqid-s+1,e.seqid)).slice(-s):[]}if(void 0!==r||void 0!==i){let e=r||i||0;return(await this.getMsgListByRange(l,o.needRemote,e[0],e[0],e[1],e[1])).slice(0,1)}return(await this.getLastMsgFromServer(a,100)).reverse()}async _getMsgListFromDB(e,t,n,r,i){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"next",o=[e,t],a=[e];void 0!==r&&o.push(r),void 0!==i?a.push(n,i+1):a.push(n+1);let l=await this.getAll(IdxName_Conv_Seq_SubSeq,IDBKeyRange.bound(o,a,!1,!0));return await this._updateOtherMsgInfos(l),"prev"===s&&(l=l.reverse()),l}async _getMsgListFromServer(e){var t,n;let{convId:r,start:i=0,end:s=0,count:o=0}=e;if(!r)return[];let a=await this._api.messageApi.getList({convId:r,count:~~o,start:~~i,end:~~s});if(0!==a.code)return[];let l=(null==(t=a.data)?void 0:t.messages)||[],u=[],c=null==(n=this.conversation.getL
1ocalByRemoteId(r))?void 0:n.localId;for(let e of l){let t=MessageModel.from({...e,localId:c||r});await this.set(t,!0),u.push(t)}return u}async _updateOtherMsgInfos(e){let t=!0;for(let n of e.filter(e=>!e.isConsumed&&(e.isTypePatch||e.isRecallEvent))){let r=await this._updateOtherMsgInfo(n);if(r){let i=e.findIndex(e=>e.internalId===r.internalId);-1!==i&&(e[i]=r),t=await this.set(n.fromJson({isConsumed:!0}))&&t}}return t}async _updateOtherMsgInfo(e){let t=e.getAffectedMsgDiff();return t?await this._updateMsg(e.localId,t.msgId,t.diff):null}async getMsgByMsgId(e,t){return(await this.query({index:IdxName_Conv_Msg,direction:"next",query:IDBKeyRange.only([e,t]),count:1}))[0]||null}async getMsgByInternalId(e){return this.get(e)}async _updateMsg(e,t,n){let r=await this.getMsgByMsgId(e,t);return r?(r.fromJson(n),await this.set(r,!1),r):null}constructor(){super({name:"Message-next",key:"internalId",Model:MessageModel,indexes:[{name:IdxName_Conv_Seq_SubSeq,keyPath:["localId","seqid","localSubSeqId"],params:{unique:!0}},{name:IdxName_Conv_Msg,keyPath:["localId","msgid"],params:{unique:!1}}]})}}function conversation_model_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ConversationModel extends model_Model{getLastMessage(){let{latestMessage:e}=this;return e?MessageModel.from({...e,localId:this.localId}):null}get lastMsg(){return this.getLastMessage()}get isViewPermission(){return!this.limitPermission||!(1&this.limitPermission)}get isDeletePermission(){return!this.limitPermission||!(2&this.limitPermission)}get isStickyPermission(){return!this.limitPermission||!(4&this.limitPermission)}get isBlackPermission(){return!this.limitPermission||!(8&this.limitPermission)}get isReportPermission(){return!this.limitPermission||!(16&this.limitPermission)}get isSilentPermission(){return!this.limitPermission||!(32&this.limitPermission)}get isRemarkPermission(){return!this.limitPermission||!(64&this.limitPermission)}get isSticky(){return this.labels.includes(request_type_ConversationLabelsKey.Sticky)}get isSilent(){return this.labels.includes(request_type_ConversationLabelsKey.Silent)}get isBlock(){return this.labels.includes(request_type_ConversationLabelsKey.Block)}get isUser(){return this.type===request_type_ConversationType.P2P}get isGroup(){return this.type===request_type_ConversationType.Group}get isMessageBox(){return this.type===request_type_ConversationType.MessageBox}get isNormal(){return this.state===request_type_ConversationState.Normal||this.state===request_type_ConversationState.Default}get isDeleted(){return this.state===request_type_ConversationState.Deleted||this.state===request_type_ConversationState.Leave}get isBan(){return this.state===request_type_ConversationState.Ban||this.state===request_type_ConversationState.BanForever}constructor(){super(),conversation_model_define_property(this,"id",""),conversation_model_define_property(this,"type",request_type_ConversationType.Unknown),conversation_model_define_property(this,"timestamp",0),conversation_model_define_property(this,"name",""),conversation_model_define_property(this,"avatarUrl",""),conversation_model_define_property(this,"remark",""),conversation_model_define_property(this,"lastOnlineTime",0),conversation_model_define_property(this,"unreadCount",0),conversation_model_define_property(this,"toUser",""),conversation_model_define_property(this,"isRead",!1),conversation_model_define_property(this,"labels",[]),conversation_model_define_property(this,"latestMessage",null),conversation_model_define_property(this,"remoteLatestMsgSeqId",0),c
1onversation_model_define_property(this,"mentionCount",0),conversation_model_define_property(this,"messagePullStart",0),conversation_model_define_property(this,"messagePullEnd",0),conversation_model_define_property(this,"ackId",0),conversation_model_define_property(this,"medals",[]),conversation_model_define_property(this,"limitPermission",0),conversation_model_define_property(this,"state",request_type_ConversationState.Normal),conversation_model_define_property(this,"localId",""),Object.defineProperty(this,"localId",{enumerable:!0,get(){return this.isUser?this.toUser:this.id},set(e){}})}}function setting_model_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class SettingModel extends model_Model{constructor(...e){super(...e),setting_model_define_property(this,"key",""),setting_model_define_property(this,"value","")}}async function useVersion(e){await e.ready.await;let t="conversation.timestamp";return{get:()=>({timestamp:+e.getValue(t,"0")||0}),async set(n){await e.setValue(t,String(n.timestamp))}}}class Setting extends TableStoreWrapperPlugin{async init(){super.init(),await this.syncTableToStore(),this.ready.finish(!0)}destroy(){super.destroy()}getValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.get(e);return(null==n?void 0:n.value)||t}setValue(e,t){let n=this.createModel({key:e,value:t});return this.store.set(n),this.table.set(n)}constructor(){super({name:"Setting",key:"key",Model:SettingModel})}}async function updateLabels(e){let{item:t,label:n,add:r,remove:i,success:s}=e,o={code:-10001,message:"Not Found."};if(t){let e=t.labels.findIndex(e=>e===n);-1===e?(t.labels.push(n),o=await r()):(t.labels.splice(e,1),o=await i()),0===o.code&&await s(t)}return o}function conversation_plugin_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Conversation extends TableStoreWrapperPlugin{async init(){super.init();let{ready:e,socket:t,store:n}=this;n.onChanged.listen(this._onChanged),t.onMessage.listen(this._onMessage),await this.syncTable(),this.sync(),t.onOpen.listen(this.sync),e.finish(!0)}destroy(){this.socket.onMessage.removeListen(this._onMessage),this.socket.onOpen.removeListen(this.sync),super.destroy()}getLocalByRemoteId(e){return this.list.find(t=>t.id===e)||null}async syncTable(){let e=await this.table.getAll(),t=[],n=[];return e.forEach(e=>{e.isDeleted?t.push(e.localId):(e.isRead=!1,n.push(e))}),await this.remoteConversation(t),this.store.set(n),n.length>0}async remoteConversation(e){e.length&&await Promise.all(e.map(e=>this.delConversation(e)))}async _sync(){var e;let t=await useVersion(this.setting),n=t.get(),r=1e3,i=await this._api.conversationApi.getList({cursor:n.timestamp,count:r});if(0!==i.code)return!!await this.im.canRetry()&&this._sync();let s=null!=(e=i.data)?e:[],o=s.length,a=o>=r;if(s.length){s.sort((e,t)=>e.timestamp-t.timestamp),await t.set({timestamp:s[o-1].timestamp});let e=[],n=[];for(let t of s){let r=new ConversationModel().fromJson(t);r.type!==request_type_ConversationType.Unknown&&(r.isDeleted||r.labels.includes(request_type_ConversationLabelsKey.Deleted)?n.push(r.localId):e.push(r))}await this.remoteConversation(n),await this.saveStore(e)}return!a||this._sync()}async saveStore(e){e.forEach(async e=>{let t=this.get(e.localId),n=e.unreadCount;if(!t){await this.set(e),this.onChange.dispatchEvent({next:e,prev:t,unreadCount:n,newAfterSynching:this.ready.finished});return}let r=t.lastMsg,i=e.lastMsg;r&&i&&(r.seqid>i.seqid||t.remoteLatestMsgSeqId>i.seqid||!i.isConvVisible?e.fromJson({latestMessage:structuredClone(t.latestMessage),remoteLatestMsgSeqId:t.remoteLatestMsgSeqId}):e.fromJson({remoteLatestMsgSeqId:i.seqid})),t.isRead&&e.fromJson({isRead:!0,unreadCount:0,mentionCount:0}),await this.set(e),this.onChange.dispatchEvent({next:e,prev:t,unreadCount:n})})}async delConversation(e){return await this.del(e),await this.message.clearConv(e),!0}async active(e){return this._api.conversationApi.active(e)}async delConversationFromApiAndLocal(e){let t=this.get(e);return((null==t?!void 0:!t.id)||0===(await this._api.conversationApi.del({convid:t.
1id})).code)&&this.delConversation(e)}async updateStickyLabel(e){let t=this.get(e),n=(null==t?void 0:t.id)||"";return updateLabels({item:t,label:request_type_ConversationLabelsKey.Sticky,add:()=>this._api.conversationApi.setSticky({convId:n}),remove:()=>this._api.conversationApi.removeSticky({convId:n}),success:async e=>{this.set(e)}})}async updateSilentLabel(e){let t=this.get(e),n=(null==t?void 0:t.id)||"";return updateLabels({item:t,label:request_type_ConversationLabelsKey.Silent,add:()=>this._api.conversationApi.setSilent({convId:n}),remove:()=>this._api.conversationApi.removeSilent({convId:n}),success:async e=>{this.set(e)}})}async updateBlockLabel(e){let t=this.get(e),n=(null==t?void 0:t.id)||"";return updateLabels({item:t,label:request_type_ConversationLabelsKey.Block,add:()=>this._api.conversationApi.setBlock({convId:n}),remove:()=>this._api.conversationApi.removeBlock({convId:n}),success:async e=>{this.set(e)}})}async postUnreadAck(e){let t=this.get(e);(null==t?void 0:t.id)&&(await this._api.conversationApi.postUnreadAck({convId:t.id}),t.fromJson({isRead:!0,unreadCount:0,mentionCount:0}))}setRead(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this.get(e);n&&(n.isRead=t,this.store.set(n)),(null==n?void 0:n.id)&&this.table.set(n)}createLocal(e){let t=this.get(e);if(t)return t;let n=this.createModel({type:request_type_ConversationType.P2P,toUser:e,isRead:!1,timestamp:Date.now()});return this.store.set(n),n}async createGroup(e){let t=await this._api.groupApi.create(e);if(0===t.code){let n=t.data.id;if(!this.has(n)){let t=this.createModel({localId:n,id:n,timestamp:Date.now(),type:request_type_ConversationType.Group,name:e.name});this.set(t)}}return t}async createLocalGroup(e){let{id:t,name:n,avatarUrl:r}=e;if(!/^gc_/.test(t))return!1;if(!this.has(t)){let e=this.createModel({localId:t,id:t,timestamp:Date.now(),type:request_type_ConversationType.Group,name:n,avatarUrl:r});return this.set(e)}return!1}async _onSendBefore(e,t,n){let r=new ConversationModel().fromJson({...e,latestMessage:t.clone()});this.store.set(r);let i=await this.conversation.table.set(new ConversationModel().fromJson({...e,latestMessage:n}));return this.onChange.dispatchEvent({next:r,prev:e,unreadCount:0}),i}async _onSendAfter(e,t,n){let r=new ConversationModel().fromJson({...t,id:e,latestMessage:structuredClone(n)}),i=await this.set(r);return this.onChange.dispatchEvent({next:r,prev:t,unreadCount:0}),i}constructor(){super({name:"Conversation",key:"localId",Model:ConversationModel}),conversation_plugin_define_property(this,"onChange",new CustomEvent),conversation_plugin_define_property(this,"unread",0),conversation_plugin_define_property(this,"synching",!1),conversation_plugin_define_property(this,"_onChanged",()=>{let e=0;this.list.forEach(t=>{t.isSilent||(e+=t.unreadCount)}),this.unread=e}),conversation_plugin_define_property(this,"_onMessage",async e=>{let{type:t,data:n}=e;if(t===proto_NotificationType.UserConversationReestablishNotification){let e=Number(n.version)||0,t=(await useVersion(this.setting)).get();if(lt("".concat(t.timestamp),"".concat(e))&&this.sync(),"Deleted"===n.prompt){var r;let e=n.convid,t=null==(r=this.getLocalByRemoteId(e))?void 0:r.localId;t&&this.delConversation(t)}}}),conversation_plugin_define_property(this,"sync",async()=>{if(!this.synching){this.synching=!0;try{await this._sync()}catch(e){console.error(e)}this.synching=!1}})}}function conversation_permission_model_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class PermissionFeatureModel extends model_Model{constructor(...e){super(...e),conversation_permission_model_define_property(this,"key",""),conversation_permission_model_define_property(this,"value",request_type_ConversationPermissionCode.Unknown)}}class ConversationPermissionModel extends model_Model{getItem(e){return this.permissions.find(t=>t.key===e)||new PermissionFeatureModel().fromJson({key:e})}checkPermissionByKey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:request_type_ConversationPermissionCode.Normal;return this.getItem(e).value===t}get isInValid(){let e=this.getItem("talk");return[request_type_ConversationPermissionCode.ConversationNotExist,request_type_ConversationPermissionCode.Kickout,request_type_ConversationPermissionCode.Leave,request_type_ConversationPermissionCode.Ban,request_type_ConversationPermissionCode.BanForever].includes(e.value)}get canTalk(){return this.checkPermissionByKey("talk")}constructor(...e){super(...e),conversation_permission_model_define_property(this,"convId",""),conversation_permission_model_define_property(this,"permissions",[new PermissionFeatureModel().fromJson({key:"talk",value:request_type_ConversationPermissionCode.Normal})])}}function conversation_permission_plugin_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ConversationPermission extends StorePlugin{init(){this.onChange.listen(this.updatePermission)}destroy(){this.onChange.removeListen(this.updatePermission)}async getList(e){let t=await this._api.conversationApi.getPermission(e);if(0===t.code){let n=this.createModel({convId:e.convId,permissions:t.data.map(e=>new PermissionFeatureModel().fromJson(e))});this.set(n)}return t}constructor(){super({key:"convId",Model:ConversationPermissionModel}),conversation_permission_plugin_define_property(this,"onChange",new CustomEvent),conversation_permission_plugin_define_property(this,"updatePermission",async e=>{this.getList(e)})}}function message_store_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class State{constructor(){message_store_define_property(this,"seqid",null),message_store_define_property(this,"fetching",!1),message_store_define_property(this,"error",!1),message_store_define_property(this,"finished",!1)}}class Signal{get state(){return this.changedCount,this._state}set state(e){this._state=e}setState(e){this.dispatchCount++,e(),this.dispatchCount--,this.dispatchCount<=0&&this.changedCount++}get changed(){return this.changedCount}constructor(e){message_store_define_property(this,"_state",void 0),message_store_define_property(this,"dispatchCount",void 0),message_store_define_property(this,"changedCount",void 0),this._state=e,this.dispatchCount=0,this.changedCount=0,noEnumerable(this,"_state","dispatchCount")}}class MessageStore extends LifeCycle{get list(){return this.signal.state}get isEmpty(){return 0===this.list.length}async getList(e){if(this.loading)return[];let t=[];switch(this.loading=!0,e.dir){case"prev":t=await this.getPrevPage(e);break;case"next":t=await this.getNextPage(e)}return this.ready=!0,this.loading=!1,t}async getPrevPage(e){let t=this.prevState;if((t.finished||t.fetching)&&!e.force)return[];let{list:n}=this;null===t.seqid&&n.length&&(t.seqid=[n[0].seqid,n[0].localSubSeqId]);let r=e.pageSize;return(await fetchList({selfId:this.im.userId,getState:()=>this.prevState,pageSize:r,api:async t=>{let n={convId:e.convId,count:r,needRemote:e.needRemote};
1if(null!==t){if(t[0]<=0&&t[1]<=0)return[];n.end=0===t[1]?[t[0]-1]:[t[0],t[1]-1]}return this.message.getMsgList(n)},eachWithBreak(e,t){let n=e.length;for(;n--&&!1!==t(e[n]););},onSuccess:t=>{this.signal.setState(()=>{t.forEach(t=>this.put(t,e.dir))})}})).reverse()}async getNextPage(e){let t=this.nextState;if((t.finished||t.fetching)&&!e.force)return[];let{list:n}=this,r=n.at(-1);null===t.seqid&&r&&(t.seqid=[r.seqid,r.localSubSeqId]);let i=e.pageSize;return await fetchList({selfId:this.im.userId,getState:()=>this.nextState,pageSize:i,api:async t=>{let n={convId:e.convId,count:i,needRemote:e.needRemote};return null!==t&&(n.start=[t[0],t[1]+1]),await this.message.getMsgList(n)},eachWithBreak(e,t){for(let n of e)if(!1===t(n))break},onSuccess:(t,n)=>{this.signal.setState(()=>{n.forEach(e=>this.updateOtherMsgs(e)),t.forEach(t=>this.put(t,e.dir,!1))})}})}async goToSeqid(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return this.signal.setState(()=>{this.nextState=new State,this.prevState=new State,this.signal.state=[],this.set.clear(),this.prevState.seqid=[e+1,0]}),await this.getList({dir:"prev",pageSize:20,convId:t,needRemote:n})}findIndexByInternalId(e){let{internalId:t}=e;return this.set.has(t)?this.list.findIndex(e=>e.internalId===t):-1}updateOtherMsgs(e){if(e.isVisible(this.im.userId))return!1;let t=e.getAffectedMsgDiff();if(!t)return!1;let n=this.list,r=n.findLastIndex(e=>e.msgid===t.msgId);return -1!==r&&(this.signal.setState(()=>{n[r]=n[r].clone().fromJson(t.diff)}),!0)}put(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],{set:r}=this,{internalId:i}=e;!this.updateOtherMsgs(e)&&e.isVisible(this.im.userId)&&this.signal.setState(()=>{let s=this.signal.state;if(r.has(i)){let r=e=>e.internalId===i,o="next"===t?s.findLastIndex(r):s.findIndex(r);if(-1===o)throw Error("'this.set' and 'this._list' storage are inconsistent");let a=s[o];n||a.sendStatus!==request_type_SendStatus.Sending||e.sendStatus!==request_type_SendStatus.Failed||e.fromJson({sendStatus:a.sendStatus}),s[o]=e}else"next"===t?s.push(e):s.unshift(e),r.add(e.internalId)})}del(e){let t=this.findIndexByInternalId(e);t>-1&&this.signal.setState(()=>{let[e]=this.list.splice(t,1);this.set.delete(e.internalId)})}recall(e){let t=this.findIndexByInternalId(e);t>-1&&this.signal.setState(()=>{this.list[t]=e})}constructor(){super(),message_store_define_property(this,"loading",!1),message_store_define_property(this,"ready",!1),message_store_define_property(this,"signal",new Signal([])),message_store_define_property(this,"prevState",new State),message_store_define_property(this,"nextState",new State),message_store_define_property(this,"set",new Set),noEnumerable(this,"_list","prevState","nextState","set")}}async function fetchList(e){let{selfId:t,getState:n,api:r,pageSize:i,onSuccess:s,eachWithBreak:o}=e,a=n();if(a.fetching)return[];a.fetching=!0;let l=[],u=[],c=a.seqid,d=!1,h=async()=>{let e=await r(c),n=0;o(e,e=>(c=[e.seqid,e.localSubSeqId],e.isVisible(t)?l.push(e):u.push(e),n++,l.length<i)),d=e.length<i&&n===e.length,l.length<i&&!d&&await h()};return await h(),null!==c&&(a.seqid=c),a.fetching=!1,a.finished=d,s(l,u),l}var send_SendTypes=function(e){return e.text="text",e.singleFile="singleFile",e.asyncSignleFile="asyncSignleFile",e.multiFile="multiFile",e.message="message",e.local="local",e}({});function createMessage(e){var t,n,r;if("string"==typeof e)return createTextMessage({type:"text",text:e});if("type"in e)switch(e.type){case"text":return createTextMessage(e);case"singleFile":return createSingleFileMessage(e);case"asyncSignleFile":return{...createSingleFileMessage({type:"singleFile",attachment:e.decodedFileInfo}),sendType:"asyncSignleFile",fileInfos:[e.decodedFileInfo]};case"multiFile":return createMultiFileMessage(e);default:return{sendType:e.type,message:e.message}}return e.attachments&&!Array.isArray(e.attachments)?createSingleFileMessage({type:"singleFile",attachment:e.attachments}):Array.isArray(e.attachments)&&1===e.attachments.length&&!e.text?createSingleFileMessage({type:"singleFile",attachment:Array.isArray(e.attachments)?e.attachments[0]:e.attachments}):(null==(t=e.attachments)?void 0:t.length)?createMultiFileMessage({type:"multiFile",attachments:null!=(n=e.attachments)?n:[],text:e.text}):createTextMessage({type:"text",text:null!=(r=e.text)?r:""})}function createTextMessage(e){return{sendType:e.type,message:MessageModel.from({msgtype:message_type_MessageType.Text,body:{content:e.text}})}}function createMultiFileMessage(e){var t;return{sendType:e.type,message:MessageModel.from({msgtype:message_type_MessageType.Combined,body:{text:null!=(t=e.text)?t:"",attachments:e.attachments}})}}function createSingleFileMessage(e){let{attachment:t}=e;switch(t.mediaType){case"image":return{sendType:e.type,message:MessageModel.from({msgtype:message_type_MessageType.Image,body:{mediaType:t.mediaType,uri:t.uri,width:t.width,height:t.height}})};case"file":return{sendType:e.type,message:MessageModel.from({msgtype:message_type_MessageType.File,body:{mediaType:t.mediaType,file:t.name,uri:t.uri,size:t.size}})};case"video":return{sendType:e.type,message:MessageModel.from({msgtype:message_type_MessageType.Video,body:{mediaType:t.mediaType,uri:t.uri,previewsetUri:t.previewsetUri,thumb:t.thumb,width:t.width,height:t.height,size:t.size,duration:t.duration}})}}throw TypeError("Unknown ".concat(t.mediaType," type"))}function chat_window_plugin_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function createTimestampWithNoRepeat(){let e=Date.now();return()=>{let t=Date.now();return t<=e&&(t=e+1),e=t,t}}let getTimestampWithNoRepeat=createTimestampWithNoRepeat();
1class ChatWindowPlugin extends LifeCycle{get store(){return this.messageStore}get convId(){var e;return(null==(e=this.conversation.get(this.localId))?void 0:e.id)||""}get needRemote(){var e,t;return null==(e=null==(t=this.group.get(this.localId))?void 0:t.joined)||e}bindIM(e){super.bindIM(e),this.messageStore.bindIM(e)}get loading(){return this.messageStore.loading}get ready(){return this.messageStore.ready}get list(){return this.messageStore.list}init(){super.init(),this.conversation.onChange.listen(this.onConversationChanged),this.socket.onMessage.listen(this._onMessage)}destroy(){this.conversation.onChange.removeListen(this.onConversationChanged),this.socket.onMessage.removeListen(this._onMessage),this.messageStore.destroy(),super.destroy()}setReferenceMessage(e){this.referenceMessage=e||null}async getList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={dir:"next",pageSize:this.pageSize,convId:this.convId,needRemote:this.needRemote,...e};return await this.messageStore.getList(t)}async goToSeqid(e){return this.messageStore.goToSeqid(e,this.convId)}async send(e){var t,n,r,i,s;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.localId;await this.conversation.ready.await;let{referenceMessage:a,sendTypes:l}=this,u=this.conversation.get(o);if(!u)return!1;let c=u.id;c||(c=null!=(i=(await this._api.conversationApi.create({userId:o})).data)?i:"");let{sendType:d,message:h}=createMessage(e),p=getTimestampWithNoRepeat();a&&![l.local,l.message].includes(d)&&h.fromJson({referenceMessage:structuredClone(a),referenceMessageId:a.msgid}),h.fromJson({localId:o,convid:c,seqid:null!=(t=null==u||null==(r=u.latestMessage)?void 0:r.seqid)?t:0,sender:{id:this.im.userId},sendStatus:d===l.local?request_type_SendStatus.Success:request_type_SendStatus.Failed,localSubSeqId:p,internalId:getFingerPrint().create(p),timestamp:p});let f=h.clone(),g=d===l.local||!c;g||f.fromJson({sendStatus:request_type_SendStatus.Sending});let m=!1;if(m=await this.conversation._onSendBefore(u,f,h),u=null!=(n=this.conversation.get(o))?n:u,!m||!(m=await this.message.set(h)))return!1;if(a===this.referenceMessage&&this.setReferenceMessage(null),this.onNewMessage.dispatchEvent({message:f,maybeUpdateStore:!0,unreadCount:0}),g)return!0;let y=async()=>{let t=null;if(d===l.asyncSignleFile){let n=e;if(0!==(t=await n.uploadFileStore.msgUploadMedia(this.convId,h.internalId,n.decodedFileInfo)).code)return t;if(!t.data.url)return{res:request_BaseErrorCode.DATA_ERROR,message:"upload file failed - unknown url",code:request_SendMessageErrorCode.SEND_FAIL};h.fromJson({body:{...h.body,uri:t.data.url}})}let n={msgtype:h.msgtype,convId:c,state:h.internalId};return h.referenceMessageId&&(n.referenceId=h.referenceMessageId),t=await this._api.messageApi.send(n,h.body)},v=await y();return 0===v.code?(h.fromJson({msgid:v.data.msgid,timestamp:v.data.timestamp,sendStatus:request_type_SendStatus.Success}),"number"==typeof v.data.seqid&&h.fromJson({seqid:v.data.seqid,localSubSeqId:0})):v.code===request_BaseErrorCode.REQUEST_FAILED?h.fromJson({sendStatus:request_type_SendStatus.Timeout}):h.fromJson({sendStatus:request_type_SendStatus.Failed}),await this.message.set(h),await this.conversation._onSendAfter(c,u,h),v.code>0&&v.code in request_SendMessageErrorCode&&await this.send({type:send_SendTypes.local,message:new MessageModel().fromJson({msgtype:message_type_MessageType.Event,body:{name:event_message_EventMessageType.GlobalLocalError,datas:{code:v.code,message:null!=(s=v.message)?s:""}}})}),0===v.code}async setLatestVisibleMessage(e){var t;let n=this.conversation.get(this.localId);if(!n||(null==(t=n.latestMessage)?void 0:t.internalId)!==e.internalId)return!1;let r=n.id?await this.message.getMsgList({convId:n.id,count:30,needRemote:this.needRemote}):(await this.message.getLastMsgFromDB(this.localId,30)).reverse();for(;r.length;){let e=r.findLast(e=>e.isVisible(this.im.userId));if(e)return this.conversation.set(new ConversationModel().fromJson({...n,latestMessage:e.clone()})),!0;if(r.length<30||r[0].seqid<=0&&r[0].localSubSeqId<=0)break;let t=0===r[0].localSubSeqId?[r[0].seqid-1]:[r[0].seqid,r[0].localSubSeqId-1];r=await this.message.getMsgList({localId:this.localId,end:t,count:30,needRemote:this.needRemote})}return!1}async resend(e){return!!await this.message.delete(e.internalId)&&(this.messageStore.del(e),this.send({type:send_SendTypes.message,message:e}))}async delete(e){let[t,n]=await this.message.delMsg(e);n&&t&&(this.messageStore.del(t),await this.setLatestVisibleMessage(t))}async recall(e){let[t,n]=await this.message.recall(e);return t?(this.messageStore.recall(t),await this.setLatestVisibleMessage(t),null):n}forward(e,t){return Promise.all((Array.isArray(e)?e:[e]).map(e=>{this.send({type:this.sendTypes.message,message:t.clone().fromJson({referenceMessage:null,referenceMessageId:""})},e)}))}constructor(e){super(),chat_window_plugin_define_property(this,"localId",""),chat_window_plugin_define_property(this,"referenceMessage",null),chat_window_plugin_define_property(this,"onGroupInfoChange",new CustomEvent),chat_window_plugin_define_property(this,"onNewMessage",new CustomEvent),chat_window_plugin_define_property(this,"messageStore",void 0),chat_window_plugin_define_property(this,"sendTypes",send_SendTypes),chat_window_plugin_define_property(this,"pageSize",50),chat_window_plugin_define_property(this,"_onMessage",async e=>{let{type:t,data:n}=e;if(t===proto_NotificationType.UserConversationReestablishNotification&&this.convId===n.convid&&n.prompt){let e=this.conversation.get(this.localId);(null==e?void 0:e.isGroup)&&this.onGroupInfoChange.dispatchEvent(n.prompt)}}),chat_window_plugin_define_property(this,"onConversationChanged",async e=>{let{next:t,prev:n,unreadCount:r,newAfterSynching:i}=e,{localId:s,messageStore:o}=this;if(t.localId!==s)return;r&&this.conversation.postUnreadAck(t.localId);let a=t.getLastMessage();if(null==a?void 0:a.referenceMessageId){var l;a.fromJson({referenceMessage:null==n||null==(l=n.getLastMessage())?void 0:l.referenceMessage})}if(!a||!o.nextState.finished){t.remoteLatestMsgSeqId!==(null==n?void 0:n.remoteLatestMsgSeqId)&&this.onNewMessage.dispatchEvent({message:a,maybeUpdateStore:!1,unreadCount:r,newAfterSynching:null!=i&&i});return}let u=a.sendStatus!==request_type_SendStatus.Success,c=!!(n&&t.remoteLatestMsgSeqId-n.remoteLatestMsgSeqId==1),d=o.list.length,h=!!(d&&t.remoteLatestMsgSeqId-o.list[d-1].seqid<=1)&&(c||u);h&&o.put(a.clone(),"next");let p=u?[]:await this.getList({force:!0});t.remoteLatestMsgSeqId!==(null==n?void 0:n.remoteLatestMsgSeqId)&&this.onNewMessage.dispatchEvent({message:a,maybeUpdateStore:h||p.length>0,unreadCount:r,newAfterSynching:null!=i&&i})}),this.localId=e,this.messageStore=new MessageStore}}function category_model_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class CategoryModel extends model_Model{constructor(...e){super(...e),category_model_define_property(this,"id",0),category_model_define_property(this,"userId",""),category_model_define_property(this,"name",""),category_model_define_property(this,"description",""),category_model_define_property(this,"sortIndex",0),category_model_define_property(this,"flags",0),category_model_define_property(this,"sticky",!1),category_model_define_property(this,"updateTime",0),category_model_define_property(this,"createTime",0),category_model_define_property(this,"convIds",[])}}function category_plugin_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}
1class Category extends StorePlugin{async init(){super.init(),await this.getList(),this.ready.finish(!0)}async getList(){let e=await this._api.categoryApi.getCategory();if(0===e.code){let t=e.data.map(e=>this.createModel(e));this.set(t)}}setActiveId(e){this.activeId=e}async addCategory(e){let t=await this._api.categoryApi.addCategory(e);return 0===t.code&&await this.getList(),t}async updateCategory(e){let t=await this._api.categoryApi.updateCategory(e);return 0===t.code&&await this.getList(),t}async reorderCategory(e){let t=await this._api.categoryApi.reorderCategory(e);return 0===t.code&&await this.getList(),t}async deleteCategory(e){let t=await this._api.categoryApi.deleteCategory(e);return 0===t.code&&this.delete(e.id),t}constructor(){super({key:"id",Model:CategoryModel}),category_plugin_define_property(this,"ready",new ReadyPromise),category_plugin_define_property(this,"activeId",0)}}function reaction_model_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ReactionItem extends model_Model{constructor(...e){super(...e),reaction_model_define_property(this,"key",""),reaction_model_define_property(this,"count",0),reaction_model_define_property(this,"reacted",!1)}}class ReactionModel extends model_Model{constructor(...e){super(...e),reaction_model_define_property(this,"msgId",""),reaction_model_define_property(this,"reactions",[])}}function reaction_plugin_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Reaction extends StorePlugin{init(){super.init(),this.socket.onMessage.listen(this.onReactionMessage)}destroy(){this.socket.onMessage.removeListen(this.onReactionMessage),super.destroy()}updateReaction(e){let{msgId:t,key:n,operate:r,userId:i}=e,s=this.getOrCreate(t),o=[...s.reactions].map(e=>new ReactionItem().fromJson(e)),a=o.findIndex(t=>t.key===e.key),l=r>0;if(-1===a){if(l){let e=new ReactionItem().fromJson({key:n,count:r,reacted:i===this.im.userId});o.push(e)}}else{let e=o[a];e.fromJson({count:e.count+r}),i===this.im.userId&&e.fromJson({reacted:l})}s.fromJson({msgId:t,reactions:o.filter(e=>e.count>0)}),this.set(s)}async refresh(e){if(!e.convId)return!1;let t=e.msgIds.filter(e=>!this.has(e));if(!t.length)return!1;let n=await this._api.reactionApi.list({convId:e.convId,msgIds:t});if(0!==n.code)return!1;let r=n.data.map(e=>{let{msgId:t,reactions:n}=e;return new ReactionModel().fromJson({msgId:t,reactions:n})});return this.set(r),!0}async del(e){return this._api.reactionApi.del(e)}async add(e){return this._api.reactionApi.add(e)}async userList(e){return this._api.reactionApi.userList(e)}async statisticsDetail(e){return this._api.reactionApi.statisticsDetail(e)}async statistics(e){return this._api.reactionApi.statistics(e)}constructor(){super({key:"msgId",Model:ReactionModel}),reaction_plugin_define_property(this,"onReactionMessage",e=>{let{type:t,data:n}=e;t===proto_NotificationType.ReactionMessage&&this.updateReaction(n)})}}function group_model_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class GroupModel extends model_Model{isOwner(e){return this.masterId===e}isManager(e){return this.managers.includes(e)}getMemberRole(e){return this.isOwner(e)?request_type_MemberRole.Owner:this.isManager(e)?request_type_MemberRole.Manager:request_type_MemberRole.Member}constructor(...e){super(...e),group_model_define_property(this,"id",""),group_model_define_property(this,"name",""),group_model_define_property(this,"memberCount",0),group_model_define_property(this,"memberLimitCount",0),group_model_define_property(this,"avatarUrl",""),group_model_define_property(this,"introduce",""),group_model_define_property(this,"approvalEnable",!1),group_model_define_property(this,"isDelete",!1),group_model_define_property(this,"joined",!1),group_model_define_property(this,"masterId",""),group_model_define_property(this,"managers",[]),group_model_define_property(this,"members",[]),group_model_define_property(this,"tags",[]),group_model_define_property(this,"isSuper",!1)}}
1class Group extends TableStoreWrapperPlugin{async init(){super.init(),await this.syncTableToStore(),this.ready.finish(!0)}updateGroupInfo(e,t){let n=this.get(e);n&&(n.fromJson(t),this.set(n))}async setManagers(e,t){return this._api.groupApi.setManagers({convId:e,members:t.map(e=>({id:e,avatarUrl:"",name:""}))})}async addMembers(e){return this._api.groupApi.addMembers(e)}async invite(e){return this._api.groupApi.invite(e)}async kickMember(e){return this._api.groupApi.kick(e)}async muteMembers(e){return this._api.groupApi.muteMembers(e)}async unmuteMembers(e){return this._api.groupApi.unmuteMembers(e)}async setMuteAll(e){return this._api.groupApi.setMuteAll(e)}async setUnMuteAll(e){return this._api.groupApi.setUnMuteAll(e)}async info(e){let t=await this._api.groupApi.info(e);if(0===t.code){let e=this.createModel(t.data);await this.set(e)}return t}async update(e){let t=await this._api.groupApi.update(e);return 0===t.code&&this.updateGroupInfo(e.id,e),t}async leave(e){let t=await this._api.groupApi.leave(e);if(0===t.code){let{c
1onvId:t}=e;await this.conversation.delConversation(t),await this.del(t)}return t}async disband(e){let t=await this._api.groupApi.disband(e);if(0===t.code){let{convId:t}=e;await this.conversation.delConversation(t),await this.del(t)}return t}async canApprovalJoin(e){return this._api.groupApi.canApprovalJoin(e)}async inviteAdd(e){return this._api.groupApi.inviteAdd(e)}async inviteRevoke(e){return this._api.groupApi.inviteAdd(e)}async inviteJoin(e){return this._api.groupApi.inviteJoin(e)}async join(e){return this._api.groupApi.join(e)}async inviteInfo(e){return this._api.groupApi.inviteInfo(e)}async joinApprovalEnable(e){let t=await this._api.groupApi.joinApprovalEnable(e);return 0===t.code&&this.updateGroupInfo(e.convId,{approvalEnable:e.enable}),t}async transferGroupMaster(e){return this._api.groupApi.transferGroupMaster(e)}async noticeList(e){return this._api.groupApi.noticeList(e)}async noticeDetail(e){return this._api.groupApi.noticeDetail(e)}async noticeUpdate(e){return this._api.groupApi.noticeUpdate(e)}async noticeAdd(e){return this._api.groupApi.noticeAdd(e)}async noticeDelete(e){return this._api.groupApi.noticeDelete(e)}async noticeViewed(e){return this._api.groupApi.noticeViewed(e)}async approvalApprove(e){return this._api.groupApi.approvalApprove(e)}async approvalReject(e){return this._api.groupApi.approvalReject(e)}async setSearch(e){return this._api.groupApi.setSearch(e)}async getSettingInfo(e){return this._api.groupApi.getSettingInfo(e)}async setViewHistoryMessage(e){return this._api.groupApi.setViewHistoryMessage(e)}async setDirectMessage(e){return this._api.groupApi.setDirectMessage(e)}async getBlackList(e){return this._api.groupApi.getBlackList(e)}async removeBlackList(e){return this._api.groupApi.removeBlackList(e)}constructor(){super({name:"Group",key:"id",Model:GroupModel})}}function im_define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class IM{async init(e){if(this.userId)return this.ready.await;this.userId=e;let t=await this.fingerPrint.initMurmur(),n=new URL(this.options.baseUrl);return n.searchParams.set("device_identifier",t),this.socket.url=n.toString(),this.socket.onReconnect=()=>{this.conversation.sync()},this._plugins.map(e=>e.init()),this.ready.finish(!0),!0}canRetry(){if(this.destroyed)return Promise.resolve(!1);let{retryTime:e}=this.options;return new Promise(t=>{setTimeout(()=>{t(!this.destroyed)},e)})}use(e){return e.bindIM(this),this._plugins.push(e),this.ready.finished&&e.init(),this}useless(e){let t=this._plugins.indexOf(e);t>-1&&(e.destroy(),this._plugins.splice(t,1))}destroy(){let e=this._plugins.length-1;for(;e>=0;)this._plugins[e].destroy(),e--;this._plugins.splice(0),this.destroyed=!0}constructor(e){im_define_property(this,"ready",new ReadyPromise),im_define_property(this,"fingerPrint",getFingerPrint("device_")),im_define_property(this,"destroyed",!1),im_define_property(this,"_plugins",[]),im_define_property(this,"options",{dbPrefix:"webIm3.0",dbVersion:22,protocols:"protobuf",baseUrl:"",retryTime:5e3,request:e=>{throw Error("Please pass in the request object")}}),im_define_property(this,"userId",""),im_define_property(this,"socket",new socket_Socket),im_define_property(this,"db",new DB),im_define_property(this,"_api",new Api),im_define_property(this,"setting",new Setting),im_define_property(this,"conversation",new Conversation),im_define_property(this,"message",new Message),im_define_property(this,"group",new Group),im_define_property(this,"category",new Category),im_define_property(this,"reaction",new Reaction),im_define_property(this,"conversationPermission",new ConversationPermission),noEnumerable(this,"_plugins","socket","db","_api"),Object.assign(this.options,e),this.use(this.socket).use(this.db).use(this._api).use(this.setting).use(this.category).use(this.conversation).use(this.message).use(this.group).use(this.reaction).use(this.conversationPermission)}}export{AccountCardModel,BusinessCardMessage,business_message_BusinessCardType as BusinessCardType,CategoryModel,ChatWindowPlugin,CombinedMessage,request_type_ConversationLabelsKey as ConversationLabelsKey,ConversationModel,request_type_ConversationPermissionCode as ConversationPermissionCode,request_type_ConversationState as ConversationState,request_type_ConversationType as ConversationType,EventMessageFields,EventMessageGroupBanFields,event_message_EventMessageType as EventMessageType,FileMessage,GroupApprovalMessage,message_type_GroupApprovalStatus as GroupApprovalStatus,message_type_GroupApprovalType as GroupApprovalType,GroupCardModel,GroupNoticeMessage,IM,ImageMessage,InformationMessage,request_type_MemberRole as MemberRole,MessageModel,request_type_MessageStatus as MessageStatus,message_type_MessageType as MessageType,NotificationMessage,proto_NotificationType as NotificationType,RecallMessage,request_type_SendStatus as SendStatus,request_SystemErrorCode as SystemErrorCode,UserCardModel,VideoMessage,isUserId};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.