@convergence/convergence
Version:
Convergence JavaScript Client
6 lines • 389 kB
JavaScript
/**!
Copyright © 2016-2020 - Convergence Labs, Inc.
@version 1.0.0-rc.12
@license Licensed under the terms of the GNU Lesser General Public License version 3 (GPLv3). See https://www.gnu.org/licenses/lgpl-3.0.html
*/
define("Convergence",["rxjs"],(function(__WEBPACK_EXTERNAL_MODULE__4__){return function(e){var t={};function s(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}return s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"h",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.h)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(i,n,function(t){return e[t]}.bind(null,n));return i},s.n=function(e){var t=e&&e.h?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=44)}([function(e,t,s){const i=s(4);e.exports=i.operators},function(e,t,s){"use strict";var i,n,r=e.exports=s(2),o=s(16);r.codegen=s(41),r.fetch=s(42),r.path=s(43),r.fs=r.inquire("fs"),r.toArray=function(e){if(e){for(var t=Object.keys(e),s=new Array(t.length),i=0;i<t.length;)s[i]=e[t[i++]];return s}return[]},r.toObject=function(e){for(var t={},s=0;s<e.length;){var i=e[s++],n=e[s++];void 0!==n&&(t[i]=n)}return t};var a=/\\/g,c=/"/g;r.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)},r.safeProp=function(e){return!/^[$\w_]+$/.test(e)||r.isReserved(e)?'["'+e.replace(a,"\\\\").replace(c,'\\"')+'"]':"."+e},r.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var h=/_([a-z])/g;r.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(h,(function(e,t){return t.toUpperCase()}))},r.compareFieldsById=function(e,t){return e.id-t.id},r.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(r.decorateRoot.remove(e.$type),e.$type.name=t,r.decorateRoot.add(e.$type)),e.$type;i||(i=s(18));var n=new i(t||e.name);return r.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var u=0;r.decorateEnum=function(e){if(e.$type)return e.$type;n||(n=s(3));var t=new n("Enum"+u++,e);return r.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},r.setProperty=function(e,t,s){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,s,i){var n=s.shift();if(s.length>0)t[n]=e(t[n]||{},s,i);else{var r=t[n];r&&(i=[].concat(r).concat(i)),t[n]=i}return t}(e,t=t.split("."),s)},Object.defineProperty(r,"decorateRoot",{get:function(){return o.decorated||(o.decorated=new(s(26)))}})},function(e,t,s){"use strict";(function(e){var i=t;function n(e,t,s){for(var i=Object.keys(t),n=0;n<i.length;++n)void 0!==e[i[n]]&&s||(e[i[n]]=t[i[n]]);return e}function r(e){function t(e,s){if(!(this instanceof t))return new t(e,s);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),s&&n(this,s)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}i.asPromise=s(13),i.base64=s(32),i.EventEmitter=s(33),i.float=s(34),i.inquire=s(14),i.utf8=s(35),i.pool=s(36),i.LongBits=s(37),i.isNode=Boolean(void 0!==e&&e&&e.process&&e.process.versions&&e.process.versions.node),i.global=i.isNode&&e||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},i.isString=function(e){return"string"==typeof e||e instanceof String},i.isObject=function(e){return e&&"object"==typeof e},i.isset=i.isSet=function(e,t){var s=e[t];return!(null==s||!e.hasOwnProperty(t))&&("object"!=typeof s||(Array.isArray(s)?s.length:Object.keys(s).length)>0)},i.Buffer=function(){try{var e=i.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),i.u=null,i.g=null,i.newBuffer=function(e){return"number"==typeof e?i.Buffer?i.g(e):new i.Array(e):i.Buffer?i.u(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(e){return e?i.LongBits.from(e).toHash():i.LongBits.zeroHash},i.longFromHash=function(e,t){var s=i.LongBits.fromHash(e);return i.Long?i.Long.fromBits(s.lo,s.hi,t):s.toNumber(Boolean(t))},i.merge=n,i.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(e){for(var t={},s=0;s<e.length;++s)t[e[s]]=1;return function(){for(var e=Object.keys(this),s=e.length-1;s>-1;--s)if(1===t[e[s]]&&void 0!==this[e[s]]&&null!==this[e[s]])return e[s]}},i.oneOfSetter=function(e){return function(t){for(var s=0;s<e.length;++s)e[s]!==t&&delete this[e[s]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i.v=function(){var e=i.Buffer;e?(i.u=e.from!==Uint8Array.from&&e.from||function(t,s){return new e(t,s)},i.g=e.allocUnsafe||function(t){return new e(t)}):i.u=i.g=null}}).call(this,s(31))},function(e,t,s){"use strict";e.exports=o;var i=s(5);((o.prototype=Object.create(i.prototype)).constructor=o).className="Enum";var n=s(7),r=s(1);function o(e,t,s,n,r){if(i.call(this,e,s),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=r||{},this.reserved=void 0,t)for(var o=Object.keys(t),a=0;a<o.length;++a)"number"==typeof t[o[a]]&&(this.valuesById[this.values[o[a]]=t[o[a]]]=o[a])}o.fromJSON=function(e,t){var s=new o(e,t.values,t.options,t.comment,t.comments);return s.reserved=t.reserved,s},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["options",this.options,"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,s){if(!r.isString(e))throw TypeError("name must be a string");if(!r.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 this.comments[e]=s||null,this},o.prototype.remove=function(e){if(!r.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},o.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},o.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)}},function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE__4__},function(e,t,s){"use strict";e.exports=r,r.className="ReflectionObject";var i,n=s(1);function r(e,t){if(!n.isString(e))throw TypeError("name must be a string");if(t&&!n.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(r.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(".")}}}),r.prototype.toJSON=function(){throw Error()},r.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 i&&t.O(this)},r.prototype.onRemove=function(e){var t=e.root;t instanceof i&&t.R(this),this.parent=null,this.resolved=!1},r.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},r.prototype.getOption=function(e){if(this.options)return this.options[e]},r.prototype.setOption=function(e,t,s){return s&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},r.prototype.setParsedOption=function(e,t,s){this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(s){var r=i.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(r){var o=r[e];n.setProperty(o,s,t)}else(r={})[e]=n.setProperty({},s,t),i.push(r)}else{var a={};a[e]=t,i.push(a)}return this},r.prototype.setOptions=function(e,t){if(e)for(var s=Object.keys(e),i=0;i<s.length;++i)this.setOption(s[i],e[s[i]],t);return this},r.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},r.v=function(e){i=e}},function(e,t,s){"use strict";e.exports=h;var i=s(5);((h.prototype=Object.create(i.prototype)).constructor=h).className="Field";var n,r=s(3),o=s(8),a=s(1),c=/^required|optional|repeated$/;function h(e,t,s,n,r,h,u){if(a.isObject(n)?(u=r,h=n,n=r=void 0):a.isObject(r)&&(u=h,h=r,r=void 0),i.call(this,e,h),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(s))throw TypeError("type must be a string");if(void 0!==n&&!c.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==r&&!a.isString(r))throw TypeError("extend must be a string");"proto3_optional"===n&&(n="optional"),this.rule=n&&"optional"!==n?n:void 0,this.type=s,this.id=t,this.extend=r||void 0,this.required="required"===n,this.optional=!this.required,this.repeated="repeated"===n,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==o.long[s],this.bytes="bytes"===s,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.M=null,this.comment=u}h.fromJSON=function(e,t){return new h(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(h.prototype,"packed",{get:function(){return null===this.M&&(this.M=!1!==this.getOption("packed")),this.M}}),h.prototype.setOption=function(e,t,s){return"packed"===e&&(this.M=null),i.prototype.setOption.call(this,e,t,s)},h.prototype.toJSON=function(e){var t=!!e&&Boolean(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])},h.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.type),this.resolvedType instanceof n?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof r&&"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 r)||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 n&&(this.parent.ctor.prototype[this.name]=this.defaultValue),i.prototype.resolve.call(this)},h.d=function(e,t,s,i){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(n,r){a.decorateType(n.constructor).add(new h(r,e,t,s,{default:i}))}},h.v=function(e){n=e}},function(e,t,s){"use strict";e.exports=d;var i=s(5);((d.prototype=Object.create(i.prototype)).constructor=d).className="Namespace";var n,r,o,a=s(6),c=s(9),h=s(1);function u(e,t){if(e&&e.length){for(var s={},i=0;i<e.length;++i)s[e[i].name]=e[i].toJSON(t);return s}}function d(e,t){i.call(this,e,t),this.nested=void 0,this.S=null}function l(e){return e.S=null,e}d.fromJSON=function(e,t){return new d(e,t.options).addJSON(t.nested)},d.arrayToJSON=u,d.isReservedId=function(e,t){if(e)for(var s=0;s<e.length;++s)if("string"!=typeof e[s]&&e[s][0]<=t&&e[s][1]>t)return!0;return!1},d.isReservedName=function(e,t){if(e)for(var s=0;s<e.length;++s)if(e[s]===t)return!0;return!1},Object.defineProperty(d.prototype,"nestedArray",{get:function(){return this.S||(this.S=h.toArray(this.nested))}}),d.prototype.toJSON=function(e){return h.toObject(["options",this.options,"nested",u(this.nestedArray,e)])},d.prototype.addJSON=function(e){if(e)for(var t,s=Object.keys(e),i=0;i<s.length;++i)t=e[s[i]],this.add((void 0!==t.fields?n.fromJSON:void 0!==t.values?o.fromJSON:void 0!==t.methods?r.fromJSON:void 0!==t.id?a.fromJSON:d.fromJSON)(s[i],t));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 o)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 n||e instanceof o||e instanceof r||e instanceof d||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof d&&e instanceof d)||t instanceof n||t instanceof r)throw Error("duplicate name '"+e.name+"' in "+this);for(var s=t.nestedArray,i=0;i<s.length;++i)e.add(s[i]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),l(this)},d.prototype.remove=function(e){if(!(e instanceof i))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),l(this)},d.prototype.define=function(e,t){if(h.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 s=this;e.length>0;){var i=e.shift();if(s.nested&&s.nested[i]){if(!((s=s.nested[i])instanceof d))throw Error("path conflicts with non-namespace objects")}else s.add(s=new d(i))}return t&&s.addJSON(t),s},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,s){if("boolean"==typeof t?(s=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),h.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 i=this.get(e[0]);if(i){if(1===e.length){if(!t||t.indexOf(i.constructor)>-1)return i}else if(i instanceof d&&(i=i.lookup(e.slice(1),t,!0)))return i}else for(var n=0;n<this.nestedArray.length;++n)if(this.S[n]instanceof d&&(i=this.S[n].lookup(e,t,!0)))return i;return null===this.parent||s?null:this.parent.lookup(e,t)},d.prototype.lookupType=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such type: "+e);return t},d.prototype.lookupEnum=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},d.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[n,o]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},d.prototype.lookupService=function(e){var t=this.lookup(e,[r]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},d.v=function(e,t,s){n=e,r=t,o=s}},function(e,t,s){"use strict";var i=t,n=s(1),r=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function o(e,t){var s=0,i={};for(t|=0;s<e.length;)i[r[s+t]]=e[s++];return i}i.basic=o([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),i.defaults=o([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",n.emptyArray,null]),i.long=o([0,0,0,1,1],7),i.mapKey=o([0,0,0,5,5,0,0,0,1,1,0,2],2),i.packed=o([1,5,0,0,0,5,5,0,0,0,1,1,0])},function(e,t,s){"use strict";e.exports=o;var i=s(5);((o.prototype=Object.create(i.prototype)).constructor=o).className="OneOf";var n=s(6),r=s(1);function o(e,t,s,n){if(Array.isArray(t)||(s=t,t=void 0),i.call(this,e,s),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=n}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&&Boolean(e.keepComments);return r.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},o.prototype.add=function(e){if(!(e instanceof n))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 n))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){i.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var s=e.get(this.oneof[t]);s&&!s.partOf&&(s.partOf=this,this.fieldsArray.push(s))}a(this)},o.prototype.onRemove=function(e){for(var t,s=0;s<this.fieldsArray.length;++s)(t=this.fieldsArray[s]).parent&&t.parent.remove(t);i.prototype.onRemove.call(this,e)},o.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,s){r.decorateType(t.constructor).add(new o(s,e)),Object.defineProperty(t,s,{get:r.oneOfGetter(e),set:r.oneOfSetter(e)})}}},function(e,t,s){"use strict";e.exports=d;var i,n=s(2),r=n.LongBits,o=n.base64,a=n.utf8;function c(e,t,s){this.fn=e,this.len=t,this.next=void 0,this.val=s}function h(){}function u(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 c(h,0,0),this.tail=this.head,this.states=null}var l=function(){return n.Buffer?function(){return(d.create=function(){return new i})()}:function(){return new d}};function p(e,t,s){t[s]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,s){for(;e.hi;)t[s++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[s++]=127&e.lo|128,e.lo=e.lo>>>7;t[s++]=e.lo}function g(e,t,s){t[s]=255&e,t[s+1]=e>>>8&255,t[s+2]=e>>>16&255,t[s+3]=e>>>24}d.create=l(),d.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(d.alloc=n.pool(d.alloc,n.Array.prototype.subarray)),d.prototype.C=function(e,t,s){return this.tail=this.tail.next=new c(e,t,s),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,s){for(;e>127;)t[s++]=127&e|128,e>>>=7;t[s]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this.C(m,10,r.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=r.from(e);return this.C(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=r.from(e).zzEncode();return this.C(m,t.length(),t)},d.prototype.bool=function(e){return this.C(p,1,e?1:0)},d.prototype.fixed32=function(e){return this.C(g,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=r.from(e);return this.C(g,4,t.lo).C(g,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this.C(n.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this.C(n.float.writeDoubleLE,8,e)};var v=n.Array.prototype.set?function(e,t,s){t.set(e,s)}:function(e,t,s){for(var i=0;i<e.length;++i)t[s+i]=e[i]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this.C(p,1,0);if(n.isString(e)){var s=d.alloc(t=o.length(e));o.decode(e,s,0),e=s}return this.uint32(t).C(v,t,e)},d.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t).C(a.write,t,e):this.C(p,1,0)},d.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(h,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 c(h,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,s=this.len;return this.reset().uint32(s),s&&(this.tail.next=e.next,this.tail=t,this.len+=s),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),s=0;e;)e.fn(e.val,t,s),s+=e.len,e=e.next;return t},d.v=function(e){i=e,d.create=l(),i.v()}},function(e,t,s){"use strict";e.exports=c;var i,n=s(2),r=n.LongBits,o=n.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var h,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},d=function(){return n.Buffer?function(e){return(c.create=function(e){return n.Buffer.isBuffer(e)?new i(e):u(e)})(e)}:u};function l(){var e=new r(0,0),t=0;if(!(this.len-this.pos>4)){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}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;if(t=0,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 p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.create=d(),c.prototype.I=n.Array.prototype.subarray||n.Array.prototype.slice,c.prototype.uint32=(h=4294967295,function(){if(h=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return h;if(h=(h|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return h;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return h}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|p(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,s=this.pos+e;if(s>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,s):t===s?new this.buf.constructor(0):this.I.call(this.buf,t,s)},c.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},c.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},c.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},c.v=function(e){i=e,c.create=d(),i.v();var t=n.Long?"toLong":"toNumber";n.merge(c.prototype,{int64:function(){return l.call(this)[t](!1)},uint64:function(){return l.call(this)[t](!0)},sint64:function(){return l.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},function(e,t,s){"use strict";e.exports=n;var i=s(2);function n(e){if(e)for(var t=Object.keys(e),s=0;s<t.length;++s)this[t[s]]=e[t[s]]}n.create=function(e){return this.$type.create(e)},n.encode=function(e,t){return this.$type.encode(e,t)},n.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},n.decode=function(e){return this.$type.decode(e)},n.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},n.verify=function(e){return this.$type.verify(e)},n.fromObject=function(e){return this.$type.fromObject(e)},n.toObject=function(e,t){return this.$type.toObject(e,t)},n.prototype.toJSON=function(){return this.$type.toObject(this,i.toJSONOptions)}},function(e,t,s){"use strict";e.exports=function(e,t){var s=new Array(arguments.length-1),i=0,n=2,r=!0;for(;n<arguments.length;)s[i++]=arguments[n++];return new Promise((function(n,o){s[i]=function(e){if(r)if(r=!1,e)o(e);else{for(var t=new Array(arguments.length-1),s=0;s<t.length;)t[s++]=arguments[s];n.apply(null,t)}};try{e.apply(t||null,s)}catch(e){r&&(r=!1,o(e))}}))}},function(module,exports,__webpack_require__){"use strict";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}module.exports=inquire},function(e,t,s){"use strict";t.Service=s(40)},function(e,t,s){"use strict";e.exports={}},function(e,t,s){"use strict";e.exports=function(e){for(var t,s=r.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(r.compareFieldsById),c=0;c<a.length;++c){var h=a[c].resolve(),u=e._.indexOf(h),d=h.resolvedType instanceof i?"int32":h.type,l=n.basic[d];t="m"+r.safeProp(h.name),h.map?(s("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,h.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(h.id<<3|2)>>>0,8|n.mapKey[h.keyType],h.keyType),void 0===l?s("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,t):s(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|l,d,t),s("}")("}")):h.repeated?(s("if(%s!=null&&%s.length){",t,t),h.packed&&void 0!==n.packed[d]?s("w.uint32(%i).fork()",(h.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",d,t)("w.ldelim()"):(s("for(var i=0;i<%s.length;++i)",t),void 0===l?o(s,h,u,t+"[i]"):s("w.uint32(%i).%s(%s[i])",(h.id<<3|l)>>>0,d,t)),s("}")):(h.optional&&s("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,h.name),void 0===l?o(s,h,u,t):s("w.uint32(%i).%s(%s)",(h.id<<3|l)>>>0,d,t))}return s("return w")};var i=s(3),n=s(8),r=s(1);function o(e,t,s,i){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",s,i,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",s,i,(t.id<<3|2)>>>0)}},function(e,t,s){"use strict";e.exports=y;var i=s(7);((y.prototype=Object.create(i.prototype)).constructor=y).className="Type";var n=s(3),r=s(9),o=s(6),a=s(19),c=s(20),h=s(12),u=s(11),d=s(10),l=s(1),p=s(17),f=s(22),m=s(23),g=s(24),v=s(25);function y(e,t){i.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this.D=null,this._=null,this.T=null,this.j=null}function w(e){return e.D=e._=e.T=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(y.prototype,{fieldsById:{get:function(){if(this.D)return this.D;this.D={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var s=this.fields[e[t]],i=s.id;if(this.D[i])throw Error("duplicate id "+i+" in "+this);this.D[i]=s}return this.D}},fieldsArray:{get:function(){return this._||(this._=l.toArray(this.fields))}},oneofsArray:{get:function(){return this.T||(this.T=l.toArray(this.oneofs))}},ctor:{get:function(){return this.j||(this.ctor=y.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof h||((e.prototype=new h).constructor=e,l.merge(e.prototype,t)),e.$type=e.prototype.$type=this,l.merge(e,h,!0),this.j=e;for(var s=0;s<this.fieldsArray.length;++s)this._[s].resolve();var i={};for(s=0;s<this.oneofsArray.length;++s)i[this.T[s].resolve().name]={get:l.oneOfGetter(this.T[s].oneof),set:l.oneOfSetter(this.T[s].oneof)};s&&Object.defineProperties(e.prototype,i)}}}),y.generateConstructor=function(e){for(var t,s=l.codegen(["p"],e.name),i=0;i<e.fieldsArray.length;++i)(t=e._[i]).map?s("this%s={}",l.safeProp(t.name)):t.repeated&&s("this%s=[]",l.safeProp(t.name));return s("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]]")},y.fromJSON=function(e,t){var s=new y(e,t.options);s.extensions=t.extensions,s.reserved=t.reserved;for(var h=Object.keys(t.fields),u=0;u<h.length;++u)s.add((void 0!==t.fields[h[u]].keyType?a.fromJSON:o.fromJSON)(h[u],t.fields[h[u]]));if(t.oneofs)for(h=Object.keys(t.oneofs),u=0;u<h.length;++u)s.add(r.fromJSON(h[u],t.oneofs[h[u]]));if(t.nested)for(h=Object.keys(t.nested),u=0;u<h.length;++u){var d=t.nested[h[u]];s.add((void 0!==d.id?o.fromJSON:void 0!==d.fields?y.fromJSON:void 0!==d.values?n.fromJSON:void 0!==d.methods?c.fromJSON:i.fromJSON)(h[u],d))}return t.extensions&&t.extensions.length&&(s.extensions=t.extensions),t.reserved&&t.reserved.length&&(s.reserved=t.reserved),t.group&&(s.group=!0),t.comment&&(s.comment=t.comment),s},y.prototype.toJSON=function(e){var t=i.prototype.toJSON.call(this,e),s=!!e&&Boolean(e.keepComments);return l.toObject(["options",t&&t.options||void 0,"oneofs",i.arrayToJSON(this.oneofsArray,e),"fields",i.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",s?this.comment:void 0])},y.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var s=this.oneofsArray;for(t=0;t<s.length;)s[t++].resolve();return i.prototype.resolveAll.call(this)},y.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},y.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof o&&void 0===e.extend){if(this.D?this.D[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),w(this)}return e instanceof r?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),w(this)):i.prototype.add.call(this,e)},y.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),w(this)}if(e instanceof r){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),w(this)}return i.prototype.remove.call(this,e)},y.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},y.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)},y.prototype.create=function(e){return new this.ctor(e)},y.prototype.setup=function(){for(var e=this.fullName,t=[],s=0;s<this.fieldsArray.length;++s)t.push(this._[s].resolve().resolvedType);this.encode=p(this)({Writer:d,types:t,util:l}),this.decode=f(this)({Reader:u,types:t,util:l}),this.verify=m(this)({types:t,util:l}),this.fromObject=g.fromObject(this)({types:t,util:l}),this.toObject=g.toObject(this)({types:t,util:l});var i=v[e];if(i){var n=Object.create(this);n.fromObject=this.fromObject,this.fromObject=i.fromObject.bind(n),n.toObject=this.toObject,this.toObject=i.toObject.bind(n)}return this},y.prototype.encode=function(e,t){return this.setup().encode(e,t)},y.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},y.prototype.decode=function(e,t){return this.setup().decode(e,t)},y.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},y.prototype.verify=function(e){return this.setup().verify(e)},y.prototype.fromObject=function(e){return this.setup().fromObject(e)},y.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},y.d=function(e){return function(t){l.decorateType(t,e)}}},function(e,t,s){"use strict";e.exports=o;var i=s(6);((o.prototype=Object.create(i.prototype)).constructor=o).className="MapField";var n=s(8),r=s(1);function o(e,t,s,n,o,a){if(i.call(this,e,t,n,void 0,void 0,o,a),!r.isString(s))throw TypeError("keyType must be a string");this.keyType=s,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&&Boolean(e.keepComments);return r.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===n.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return i.prototype.resolve.call(this)},o.d=function(e,t,s){return"function"==typeof s?s=r.decorateType(s).name:s&&"object"==typeof s&&(s=r.decorateEnum(s).name),function(i,n){r.decorateType(i.constructor).add(new o(n,e,t,s))}}},function(e,t,s){"use strict";e.exports=a;var i=s(7);((a.prototype=Object.create(i.prototype)).constructor=a).className="Service";var n=s(21),r=s(1),o=s(15);function a(e,t){i.call(this,e,t),this.methods={},this.A=null}function c(e){return e.A=null,e}a.fromJSON=function(e,t){var s=new a(e,t.options);if(t.methods)for(var i=Object.keys(t.methods),r=0;r<i.length;++r)s.add(n.fromJSON(i[r],t.methods[i[r]]));return t.nested&&s.addJSON(t.nested),s.comment=t.comment,s},a.prototype.toJSON=function(e){var t=i.prototype.toJSON.call(this,e),s=!!e&&Boolean(e.keepComments);return r.toObject(["options",t&&t.options||void 0,"methods",i.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",s?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this.A||(this.A=r.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||i.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return i.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof n?(this.methods[e.name]=e,e.parent=this,c(this)):i.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof n){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return i.prototype.remove.call(this,e)},a.prototype.create=function(e,t,s){for(var i,n=new o.Service(e,t,s),a=0;a<this.methodsArray.length;++a){var c=r.lcFirst((i=this.A[a]).resolve().name).replace(/[^$\w_]/g,"");n[c]=r.codegen(["r","c"],r.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return n}},function(e,t,s){"use strict";e.exports=r;var i=s(5);((r.prototype=Object.create(i.prototype)).constructor=r).className="Method";var n=s(1);function r(e,t,s,r,o,a,c,h,u){if(n.isObject(o)?(c=o,o=a=void 0):n.isObject(a)&&(c=a,a=void 0),void 0!==t&&!n.isString(t))throw TypeError("type must be a string");if(!n.isString(s))throw TypeError("requestType must be a string");if(!n.isString(r))throw TypeError("responseType must be a string");i.call(this,e,c),this.type=t||"rpc",this.requestType=s,this.requestStream=!!o||void 0,this.responseType=r,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=h,this.parsedOptions=u}r.fromJSON=function(e,t){return new r(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},r.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.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])},r.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),i.prototype.resolve.call(this))}},function(e,t,s){"use strict";e.exports=function(e){var t=r.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 s=0;s<e.fieldsArray.length;++s){var a=e._[s].resolve(),c=a.resolvedType instanceof i?"int32":a.type,h="m"+r.safeProp(a.name);t("case %i:",a.id),a.map?(t("if(%s===util.emptyObject)",h)("%s={}",h)("var c2 = r.uint32()+r.pos"),void 0!==n.defaults[a.keyType]?t("k=%j",n.defaults[a.keyType]):t("k=null"),void 0!==n.defaults[c]?t("value=%j",n.defaults[c]):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===n.basic[c]?t("value=types[%i].decode(r,r.uint32())",s):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==n.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',h):t("%s[k]=value",h)):a.repeated?(t("if(!(%s&&%s.length))",h,h)("%s=[]",h),void 0!==n.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",h,c)("}else"),void 0===n.basic[c]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",h,s):t("%s.push(r.%s())",h,c)):void 0===n.basic[c]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",h,s):t("%s=r.%s()",h,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),s=0;s<e._.length;++s){var u=e._[s];u.required&&t("if(!m.hasOwnProperty(%j))",u.name)("throw util.ProtocolError(%j,{instance:m})",o(u))}return t("return m")};var i=s(3),n=s(8),r=s(1);function o(e){return"missing required '"+e.name+"'"}},function(e,t,s){"use strict";e.exports=function(e){var t=n.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),s=e.oneofsArray,i={};s.length&&t("var p={}");for(var c=0;c<e.fieldsArray.length;++c){var h=e._[c].resolve(),u="m"+n.safeProp(h.name);if(h.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,h.name),h.map)t("if(!util.isObject(%s))",u)("return%j",r(h,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),a(t,h,"k[i]"),o(t,h,c,u+"[k[i]]")("}");else if(h.repeated)t("if(!Array.isArray(%s))",u)("return%j",r(h,"array"))("for(var i=0;i<%s.length;++i){",u),o(t,h,c,u+"[i]")("}");else{if(h.partOf){var d=n.safeProp(h.partOf.name);1===i[h.partOf.name]&&t("if(p%s===1)",d)("return%j",h.partOf.name+": multiple values"),i[h.partOf.name]=1,t("p%s=1",d)}o(t,h,c,u)}h.optional&&t("}")}return t("return null")};var i=s(3),n=s(1);function r(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function o(e,t,s,n){if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(%s){",n)("default:")("return%j",r(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);",s,n)("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))",n)("return%j",r(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)))",n,n,n,n)("return%j",r(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',n)("return%j",r(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',n)("return%j",r(t,"boolean"));break;case"string":e("if(!util.isString(%s))",n)("return%j",r(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",r(t,"buffer"))}return e}function a(e,t,s){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",s)("return%j",r(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",s)("return%j",r(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",s)("return%j",r(t,"boolean key"))}return e}},function(e,t,s){"use strict";var i=t,n=s(3),r=s(1);function o(e,t,s,i){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(d%s){",i);for(var r=t.resolvedType.values,o=Object.keys(r),a=0;a<o.length;++a)t.repeated&&r[o[a]]===t.typeDefault&&e("default:"),e("case%j:",o[a])("case %i:",r[o[a]])("m%s=%j",i,r[o[a]])("break");e("}")}else e('if(typeof d%s!=="object")',i)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",i,s,i);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",i,i);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",i,i);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",i,i);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,c)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length)",i)("m%s=d%s",i,i);break;case"string":e("m%s=String(d%s)",i,i);break;case"bool":e("m%s=Boolean(d%s)",i,i)}}return e}function a(e,t,s,i){if(t.resolvedType)t.resolvedType instanceof n?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",i,s,i,i):e("d%s=types[%i].toObject(m%s,o)",i,s,i);else{var r=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":r=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("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",i,i,i,i,r?"true":"",i);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",i,i,i,i,i);break;default:e("d%s=m%s",i,i)}}return e}i.fromObject=function(e){var t=e.fieldsArray,s=r.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return s("return new this.ctor");s("var m=new this.ctor");for(var i=0;i<t.length;++i){var a=t[i].resolve(),c=r.safeProp(a.name);a.map?(s("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),o(s,a,i,c+"[ks[i]]")("}")("}")):a.repeated?(s("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),o(s,a,i,c+"[i]")("}")("}")):(a.resolvedType instanceof n||s("if(d%s!=null){",c),o(s,a,i,c),a.resolvedType instanceof n||s("}"))}return s("return m")},i.toObject=function(e){var t=e.fieldsArray.slice().sort(r.compareFieldsById);if(!t.length)return r.codegen()("return {}");for(var s=r.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),i=[],o=[],c=[],h=0;h<t.length;++h)t[h].partOf||(t[h].resolve().repeated?i:t[h].map?o:c).push(t[h]);if(i.length){for(s("if(o.arrays||o.defaults){"),h=0;h<i.length;++h)s("d%s=[]",r.safeProp(i[h].name));s("}")}if(o.length){for(s("if(o.objects||o.defaults){"),h=0;h<o.length;++h)s("d%s={}",r.safeProp(o[h].name));s("}")}if(c.length){for(s("if(o.defaults){"),h=0;h<c.length;++h){var u=c[h],d=r.safeProp(u.name);if(u.resolvedType instanceof n)s("d%s=o.enums===String?%j:%j",d,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)s("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.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,u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var l="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]";s("if(o.bytes===String)d%s=%j",d,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",d,l)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",d,d)("}")}else s("d%s=%j",d,u.typeDefault)}s("}")}var p=!1;for(h=0;h<t.length;++h){u=t[h];var f=e._.indexOf(u);d=r.safeProp(u.name);u.map?(p||(p=!0,s("var ks2")),s("if(m%s&&(ks2=Object.keys(m%s)).length){",d,d)("d%s={}",d)("for(var j=0;j<ks2.length;++j){"),a(s,u,f,d+"[ks2[j]]")("}")):u.repeated?(s("if(m%s&&m%s.length){",d,d)("d%s=[]",d)("for(var j=0;j<m%s.length;++j){",d),a(s,u,f,d+"[j]")("}")):(s("if(m%s!=null&&m.hasOwnProperty(%j)){",d,u.name),a(s,u,f,d),u.partOf&&s("if(o.oneofs)")("d%s=%j",r.safeProp(u.partOf.name),u.name)),s("}")}return s("return d")}},function(e,t,s){"use strict";var i=t,n=s(12);i[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),s=this.lookup(t);if(s){var i="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===i.indexOf("/")&&(i="/"+i),this.create({type_url:i,value:s.encode(s.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var s="",i="";if(t&&t.json&&e.type_url&&e.value){i=e.type_url.substring(e.type_url.lastIndexOf("/")+1),s=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var r=this.lookup(i);r&&(e=r.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof n){var o=e.$type.toObject(e,t);return""===s&&(s="type.googleapis.com/"),i=s+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),o["@type"]=i,o}return this.toObject(e,t)}}},function(e,t,s){"use strict";e.exports=d;var i=s(7);((d.prototype=Object.create(i.prototype)).constructor=d).className="Root";var n,r,o,a=s(6),c=s(3),h=s(9),u=s(1);function d(e){i.call(this,"",e),this.deferred=[],this.files=[]}function l(){}d.fromJSON=function(e,t){return t||(t=new d),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=u.path.resolve,d.prototype.fetch=u.fetch,d.prototype.load=function e(t,s,i){"function"==typeof s&&(i=s,s=void 0);var n=this;if(!i)return u.asPromise(e,n,t,s);var a=i===l;function c(e,t){if(i){var s=i;if(i=null,a)throw e;s(e,t)}}function h(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var s=e.substring(t);if(s in o)return s}return null}function d(e,t){try{if(u.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),u.isString(t)){r.filename=e;var i,o=r(t,n,s),d=0;if(o.imports)for(;d<o.imports.length;++d)(i=h(o.imports[d])||n.resolvePath(e,o.imports[d]))&&p(i);if(o.weakImports)for(d=0;d<o.weakImports.length;++d)(i=h(o.weakImports[d])||n.resolvePath(e,o.weakImports[d]))&&p(i,!0)}else n.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}a||f||c(null,n)}function p(e,t){if(!(n.files.indexOf(e)>-1))if(n.files.push(e),e in o)a?d(e,o[e])