@bitrix24/b24jssdk
Version:
Bitrix24 REST API JavaScript SDK
1 lines • 459 kB
Source Map (JSON)
{"version":3,"file":"protobuf.mjs","sources":["../../../../src/pullClient/protobuf/protobuf.js"],"sourcesContent":["/*!\n * protobuf.js v6.8.6 (c) 2016, daniel wirtz\n * compiled mon, 26 feb 2018 11:35:34 utc\n * licensed under the bsd-3-clause license\n * see: https://github.com/dcodeio/protobuf.js for details\n *\n * Modify a list for integration with Bitrix Framework:\n * - removed integration with RequireJS and AMD package builders;\n */\n(function(undefined){\"use strict\";(function prelude(modules, cache, entries) {\n\n // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n // sources through a conflict-free require shim and is again wrapped within an iife that\n // provides a unified `global` and a minification-friendly `undefined` var plus a global\n // \"use strict\" directive so that minification can remove the directives of each module.\n\n function $require(name) {\n var $module = cache[name];\n if (!$module)\n modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n return $module.exports;\n }\n\n // Expose globally (__not__)\n var protobuf = $require(entries[0]);\n\n // Be nice to AMD\n /*/\n if (typeof define === \"function\" && define.amd)\n define([\"long\"], function(Long) {\n if (Long && Long.isLong) {\n protobuf.util.Long = Long;\n protobuf.configure();\n }\n return protobuf;\n });\n //*/\n\n // Be nice to CommonJS\n //*/\n if (typeof module === \"object\" && module && module.exports)\n module.exports = protobuf;\n //*/\n\n})/* end of prelude */({1:[function(require,module,exports){\n\"use strict\";\nmodule.exports = asPromise;\n\n/**\n * Callback as used by {@link util.asPromise}.\n * @typedef asPromiseCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {...*} params Additional arguments\n * @returns {undefined}\n */\n\n/**\n * Returns a promise from a node-style callback function.\n * @memberof util\n * @param {asPromiseCallback} fn Function to call\n * @param {*} ctx Function context\n * @param {...*} params Function arguments\n * @returns {Promise<*>} Promisified function\n */\nfunction asPromise(fn, ctx/*, varargs */) {\n var params = new Array(arguments.length - 1),\n offset = 0,\n index = 2,\n pending = true;\n while (index < arguments.length)\n params[offset++] = arguments[index++];\n return new Promise(function executor(resolve, reject) {\n params[offset] = function callback(err/*, varargs */) {\n if (pending) {\n pending = false;\n if (err)\n reject(err);\n else {\n var params = new Array(arguments.length - 1),\n offset = 0;\n while (offset < params.length)\n params[offset++] = arguments[offset];\n resolve.apply(null, params);\n }\n }\n };\n try {\n fn.apply(ctx || null, params);\n } catch (err) {\n if (pending) {\n pending = false;\n reject(err);\n }\n }\n });\n}\n\n},{}],2:[function(require,module,exports){\n\"use strict\";\n\n/**\n * A minimal base64 implementation for number arrays.\n * @memberof util\n * @namespace\n */\nvar base64 = exports;\n\n/**\n * Calculates the byte length of a base64 encoded string.\n * @param {string} string Base64 encoded string\n * @returns {number} Byte length\n */\nbase64.length = function length(string) {\n var p = string.length;\n if (!p)\n return 0;\n var n = 0;\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\n ++n;\n return Math.ceil(string.length * 3) / 4 - n;\n};\n\n// Base64 encoding table\nvar b64 = new Array(64);\n\n// Base64 decoding table\nvar s64 = new Array(123);\n\n// 65..90, 97..122, 48..57, 43, 47\nfor (var i = 0; i < 64;)\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\n\n/**\n * Encodes a buffer to a base64 encoded string.\n * @param {Uint8Array} buffer Source buffer\n * @param {number} start Source start\n * @param {number} end Source end\n * @returns {string} Base64 encoded string\n */\nbase64.encode = function encode(buffer, start, end) {\n var parts = null,\n chunk = [];\n var i = 0, // output index\n j = 0, // goto index\n t; // temporary\n while (start < end) {\n var b = buffer[start++];\n switch (j) {\n case 0:\n chunk[i++] = b64[b >> 2];\n t = (b & 3) << 4;\n j = 1;\n break;\n case 1:\n chunk[i++] = b64[t | b >> 4];\n t = (b & 15) << 2;\n j = 2;\n break;\n case 2:\n chunk[i++] = b64[t | b >> 6];\n chunk[i++] = b64[b & 63];\n j = 0;\n break;\n }\n if (i > 8191) {\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\n i = 0;\n }\n }\n if (j) {\n chunk[i++] = b64[t];\n chunk[i++] = 61;\n if (j === 1)\n chunk[i++] = 61;\n }\n if (parts) {\n if (i)\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\n return parts.join(\"\");\n }\n return String.fromCharCode.apply(String, chunk.slice(0, i));\n};\n\nvar invalidEncoding = \"invalid encoding\";\n\n/**\n * Decodes a base64 encoded string to a buffer.\n * @param {string} string Source string\n * @param {Uint8Array} buffer Destination buffer\n * @param {number} offset Destination offset\n * @returns {number} Number of bytes written\n * @throws {Error} If encoding is invalid\n */\nbase64.decode = function decode(string, buffer, offset) {\n var start = offset;\n var j = 0, // goto index\n t; // temporary\n for (var i = 0; i < string.length;) {\n var c = string.charCodeAt(i++);\n if (c === 61 && j > 1)\n break;\n if ((c = s64[c]) === undefined)\n throw Error(invalidEncoding);\n switch (j) {\n case 0:\n t = c;\n j = 1;\n break;\n case 1:\n buffer[offset++] = t << 2 | (c & 48) >> 4;\n t = c;\n j = 2;\n break;\n case 2:\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\n t = c;\n j = 3;\n break;\n case 3:\n buffer[offset++] = (t & 3) << 6 | c;\n j = 0;\n break;\n }\n }\n if (j === 1)\n throw Error(invalidEncoding);\n return offset - start;\n};\n\n/**\n * Tests if the specified string appears to be base64 encoded.\n * @param {string} string String to test\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\n */\nbase64.test = function test(string) {\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\n};\n\n},{}],3:[function(require,module,exports){\n\"use strict\";\nmodule.exports = codegen;\n\n/**\n * Begins generating a function.\n * @memberof util\n * @param {string[]} functionParams Function parameter names\n * @param {string} [functionName] Function name if not anonymous\n * @returns {Codegen} Appender that appends code to the function's body\n */\nfunction codegen(functionParams, functionName) {\n\n /* istanbul ignore if */\n if (typeof functionParams === \"string\") {\n functionName = functionParams;\n functionParams = undefined;\n }\n\n var body = [];\n\n /**\n * Appends code to the function's body or finishes generation.\n * @typedef Codegen\n * @type {function}\n * @param {string|Object.<string,*>} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\n * @param {...*} [formatParams] Format parameters\n * @returns {Codegen|Function} Itself or the generated function if finished\n * @throws {Error} If format parameter counts do not match\n */\n\n function Codegen(formatStringOrScope) {\n // note that explicit array handling below makes this ~50% faster\n\n // finish the function\n if (typeof formatStringOrScope !== \"string\") {\n var source = toString();\n if (codegen.verbose)\n console.log(\"codegen: \" + source); // eslint-disable-line no-console\n source = \"return \" + source;\n if (formatStringOrScope) {\n var scopeKeys = Object.keys(formatStringOrScope),\n scopeParams = new Array(scopeKeys.length + 1),\n scopeValues = new Array(scopeKeys.length),\n scopeOffset = 0;\n while (scopeOffset < scopeKeys.length) {\n scopeParams[scopeOffset] = scopeKeys[scopeOffset];\n scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\n }\n scopeParams[scopeOffset] = source;\n return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\n }\n return Function(source)(); // eslint-disable-line no-new-func\n }\n\n // otherwise append to body\n var formatParams = new Array(arguments.length - 1),\n formatOffset = 0;\n while (formatOffset < formatParams.length)\n formatParams[formatOffset] = arguments[++formatOffset];\n formatOffset = 0;\n formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\n var value = formatParams[formatOffset++];\n switch ($1) {\n case \"d\": case \"f\": return String(Number(value));\n case \"i\": return String(Math.floor(value));\n case \"j\": return JSON.stringify(value);\n case \"s\": return String(value);\n }\n return \"%\";\n });\n if (formatOffset !== formatParams.length)\n throw Error(\"parameter count mismatch\");\n body.push(formatStringOrScope);\n return Codegen;\n }\n\n function toString(functionNameOverride) {\n return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n \" + body.join(\"\\n \") + \"\\n}\";\n }\n\n Codegen.toString = toString;\n return Codegen;\n}\n\n/**\n * Begins generating a function.\n * @memberof util\n * @function codegen\n * @param {string} [functionName] Function name if not anonymous\n * @returns {Codegen} Appender that appends code to the function's body\n * @variation 2\n */\n\n/**\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\n * @name util.codegen.verbose\n * @type {boolean}\n */\ncodegen.verbose = false;\n\n},{}],4:[function(require,module,exports){\n\"use strict\";\nmodule.exports = EventEmitter;\n\n/**\n * Constructs a new event emitter instance.\n * @classdesc A minimal event emitter.\n * @memberof util\n * @constructor\n */\nfunction EventEmitter() {\n\n /**\n * Registered listeners.\n * @type {Object.<string,*>}\n * @private\n */\n this._listeners = {};\n}\n\n/**\n * Registers an event listener.\n * @param {string} evt Event name\n * @param {function} fn Listener\n * @param {*} [ctx] Listener context\n * @returns {util.EventEmitter} `this`\n */\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\n fn : fn,\n ctx : ctx || this\n });\n return this;\n};\n\n/**\n * Removes an event listener or any matching listeners if arguments are omitted.\n * @param {string} [evt] Event name. Removes all listeners if omitted.\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\n * @returns {util.EventEmitter} `this`\n */\nEventEmitter.prototype.off = function off(evt, fn) {\n if (evt === undefined)\n this._listeners = {};\n else {\n if (fn === undefined)\n this._listeners[evt] = [];\n else {\n var listeners = this._listeners[evt];\n for (var i = 0; i < listeners.length;)\n if (listeners[i].fn === fn)\n listeners.splice(i, 1);\n else\n ++i;\n }\n }\n return this;\n};\n\n/**\n * Emits an event by calling its listeners with the specified arguments.\n * @param {string} evt Event name\n * @param {...*} args Arguments\n * @returns {util.EventEmitter} `this`\n */\nEventEmitter.prototype.emit = function emit(evt) {\n var listeners = this._listeners[evt];\n if (listeners) {\n var args = [],\n i = 1;\n for (; i < arguments.length;)\n args.push(arguments[i++]);\n for (i = 0; i < listeners.length;)\n listeners[i].fn.apply(listeners[i++].ctx, args);\n }\n return this;\n};\n\n},{}],5:[function(require,module,exports){\n\"use strict\";\nmodule.exports = fetch;\n\nvar asPromise = require(1),\n inquire = require(7);\n\nvar fs = inquire(\"fs\");\n\n/**\n * Node-style callback as used by {@link util.fetch}.\n * @typedef FetchCallback\n * @type {function}\n * @param {?Error} error Error, if any, otherwise `null`\n * @param {string} [contents] File contents, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Options as used by {@link util.fetch}.\n * @typedef FetchOptions\n * @type {Object}\n * @property {boolean} [binary=false] Whether expecting a binary response\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\n */\n\n/**\n * Fetches the contents of a file.\n * @memberof util\n * @param {string} filename File path or url\n * @param {FetchOptions} options Fetch options\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n */\nfunction fetch(filename, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = {};\n } else if (!options)\n options = {};\n\n if (!callback)\n return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\n\n // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\n if (!options.xhr && fs && fs.readFile)\n return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\n return err && typeof XMLHttpRequest !== \"undefined\"\n ? fetch.xhr(filename, options, callback)\n : err\n ? callback(err)\n : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\n });\n\n // use the XHR version otherwise.\n return fetch.xhr(filename, options, callback);\n}\n\n/**\n * Fetches the contents of a file.\n * @name util.fetch\n * @function\n * @param {string} path File path or url\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n\n/**\n * Fetches the contents of a file.\n * @name util.fetch\n * @function\n * @param {string} path File path or url\n * @param {FetchOptions} [options] Fetch options\n * @returns {Promise<string|Uint8Array>} Promise\n * @variation 3\n */\n\n/**/\nfetch.xhr = function fetch_xhr(filename, options, callback) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\n\n if (xhr.readyState !== 4)\n return undefined;\n\n // local cors security errors return status 0 / empty string, too. afaik this cannot be\n // reliably distinguished from an actually empty file for security reasons. feel free\n // to send a pull request if you are aware of a solution.\n if (xhr.status !== 0 && xhr.status !== 200)\n return callback(Error(\"status \" + xhr.status));\n\n // if binary data is expected, make sure that some sort of array is returned, even if\n // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\n if (options.binary) {\n var buffer = xhr.response;\n if (!buffer) {\n buffer = [];\n for (var i = 0; i < xhr.responseText.length; ++i)\n buffer.push(xhr.responseText.charCodeAt(i) & 255);\n }\n return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\n }\n return callback(null, xhr.responseText);\n };\n\n if (options.binary) {\n // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\n if (\"overrideMimeType\" in xhr)\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\n xhr.responseType = \"arraybuffer\";\n }\n\n xhr.open(\"GET\", filename);\n xhr.send();\n};\n\n},{\"1\":1,\"7\":7}],6:[function(require,module,exports){\n\"use strict\";\n\nmodule.exports = factory(factory);\n\n/**\n * Reads / writes floats / doubles from / to buffers.\n * @name util.float\n * @namespace\n */\n\n/**\n * Writes a 32 bit float to a buffer using little endian byte order.\n * @name util.float.writeFloatLE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\n\n/**\n * Writes a 32 bit float to a buffer using big endian byte order.\n * @name util.float.writeFloatBE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\n\n/**\n * Reads a 32 bit float from a buffer using little endian byte order.\n * @name util.float.readFloatLE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\n\n/**\n * Reads a 32 bit float from a buffer using big endian byte order.\n * @name util.float.readFloatBE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\n\n/**\n * Writes a 64 bit double to a buffer using little endian byte order.\n * @name util.float.writeDoubleLE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\n\n/**\n * Writes a 64 bit double to a buffer using big endian byte order.\n * @name util.float.writeDoubleBE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\n\n/**\n * Reads a 64 bit double from a buffer using little endian byte order.\n * @name util.float.readDoubleLE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\n\n/**\n * Reads a 64 bit double from a buffer using big endian byte order.\n * @name util.float.readDoubleBE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\n\n// Factory function for the purpose of node-based testing in modified global environments\nfunction factory(exports) {\n\n // float: typed array\n if (typeof Float32Array !== \"undefined\") (function() {\n\n var f32 = new Float32Array([ -0 ]),\n f8b = new Uint8Array(f32.buffer),\n le = f8b[3] === 128;\n\n function writeFloat_f32_cpy(val, buf, pos) {\n f32[0] = val;\n buf[pos ] = f8b[0];\n buf[pos + 1] = f8b[1];\n buf[pos + 2] = f8b[2];\n buf[pos + 3] = f8b[3];\n }\n\n function writeFloat_f32_rev(val, buf, pos) {\n f32[0] = val;\n buf[pos ] = f8b[3];\n buf[pos + 1] = f8b[2];\n buf[pos + 2] = f8b[1];\n buf[pos + 3] = f8b[0];\n }\n\n /* istanbul ignore next */\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\n /* istanbul ignore next */\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\n\n function readFloat_f32_cpy(buf, pos) {\n f8b[0] = buf[pos ];\n f8b[1] = buf[pos + 1];\n f8b[2] = buf[pos + 2];\n f8b[3] = buf[pos + 3];\n return f32[0];\n }\n\n function readFloat_f32_rev(buf, pos) {\n f8b[3] = buf[pos ];\n f8b[2] = buf[pos + 1];\n f8b[1] = buf[pos + 2];\n f8b[0] = buf[pos + 3];\n return f32[0];\n }\n\n /* istanbul ignore next */\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\n /* istanbul ignore next */\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\n\n // float: ieee754\n })(); else (function() {\n\n function writeFloat_ieee754(writeUint, val, buf, pos) {\n var sign = val < 0 ? 1 : 0;\n if (sign)\n val = -val;\n if (val === 0)\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\n else if (isNaN(val))\n writeUint(2143289344, buf, pos);\n else if (val > 3.4028234663852886e+38) // +-Infinity\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\n else if (val < 1.1754943508222875e-38) // denormal\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\n else {\n var exponent = Math.floor(Math.log(val) / Math.LN2),\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\n }\n }\n\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\n\n function readFloat_ieee754(readUint, buf, pos) {\n var uint = readUint(buf, pos),\n sign = (uint >> 31) * 2 + 1,\n exponent = uint >>> 23 & 255,\n mantissa = uint & 8388607;\n return exponent === 255\n ? mantissa\n ? NaN\n : sign * Infinity\n : exponent === 0 // denormal\n ? sign * 1.401298464324817e-45 * mantissa\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\n }\n\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\n\n })();\n\n // double: typed array\n if (typeof Float64Array !== \"undefined\") (function() {\n\n var f64 = new Float64Array([-0]),\n f8b = new Uint8Array(f64.buffer),\n le = f8b[7] === 128;\n\n function writeDouble_f64_cpy(val, buf, pos) {\n f64[0] = val;\n buf[pos ] = f8b[0];\n buf[pos + 1] = f8b[1];\n buf[pos + 2] = f8b[2];\n buf[pos + 3] = f8b[3];\n buf[pos + 4] = f8b[4];\n buf[pos + 5] = f8b[5];\n buf[pos + 6] = f8b[6];\n buf[pos + 7] = f8b[7];\n }\n\n function writeDouble_f64_rev(val, buf, pos) {\n f64[0] = val;\n buf[pos ] = f8b[7];\n buf[pos + 1] = f8b[6];\n buf[pos + 2] = f8b[5];\n buf[pos + 3] = f8b[4];\n buf[pos + 4] = f8b[3];\n buf[pos + 5] = f8b[2];\n buf[pos + 6] = f8b[1];\n buf[pos + 7] = f8b[0];\n }\n\n /* istanbul ignore next */\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\n /* istanbul ignore next */\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\n\n function readDouble_f64_cpy(buf, pos) {\n f8b[0] = buf[pos ];\n f8b[1] = buf[pos + 1];\n f8b[2] = buf[pos + 2];\n f8b[3] = buf[pos + 3];\n f8b[4] = buf[pos + 4];\n f8b[5] = buf[pos + 5];\n f8b[6] = buf[pos + 6];\n f8b[7] = buf[pos + 7];\n return f64[0];\n }\n\n function readDouble_f64_rev(buf, pos) {\n f8b[7] = buf[pos ];\n f8b[6] = buf[pos + 1];\n f8b[5] = buf[pos + 2];\n f8b[4] = buf[pos + 3];\n f8b[3] = buf[pos + 4];\n f8b[2] = buf[pos + 5];\n f8b[1] = buf[pos + 6];\n f8b[0] = buf[pos + 7];\n return f64[0];\n }\n\n /* istanbul ignore next */\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\n /* istanbul ignore next */\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\n\n // double: ieee754\n })(); else (function() {\n\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\n var sign = val < 0 ? 1 : 0;\n if (sign)\n val = -val;\n if (val === 0) {\n writeUint(0, buf, pos + off0);\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\n } else if (isNaN(val)) {\n writeUint(0, buf, pos + off0);\n writeUint(2146959360, buf, pos + off1);\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\n writeUint(0, buf, pos + off0);\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\n } else {\n var mantissa;\n if (val < 2.2250738585072014e-308) { // denormal\n mantissa = val / 5e-324;\n writeUint(mantissa >>> 0, buf, pos + off0);\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\n } else {\n var exponent = Math.floor(Math.log(val) / Math.LN2);\n if (exponent === 1024)\n exponent = 1023;\n mantissa = val * Math.pow(2, -exponent);\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\n }\n }\n }\n\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\n\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\n var lo = readUint(buf, pos + off0),\n hi = readUint(buf, pos + off1);\n var sign = (hi >> 31) * 2 + 1,\n exponent = hi >>> 20 & 2047,\n mantissa = 4294967296 * (hi & 1048575) + lo;\n return exponent === 2047\n ? mantissa\n ? NaN\n : sign * Infinity\n : exponent === 0 // denormal\n ? sign * 5e-324 * mantissa\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\n }\n\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\n\n })();\n\n return exports;\n}\n\n// uint helpers\n\nfunction writeUintLE(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\nfunction writeUintBE(val, buf, pos) {\n buf[pos ] = val >>> 24;\n buf[pos + 1] = val >>> 16 & 255;\n buf[pos + 2] = val >>> 8 & 255;\n buf[pos + 3] = val & 255;\n}\n\nfunction readUintLE(buf, pos) {\n return (buf[pos ]\n | buf[pos + 1] << 8\n | buf[pos + 2] << 16\n | buf[pos + 3] << 24) >>> 0;\n}\n\nfunction readUintBE(buf, pos) {\n return (buf[pos ] << 24\n | buf[pos + 1] << 16\n | buf[pos + 2] << 8\n | buf[pos + 3]) >>> 0;\n}\n\n},{}],7:[function(require,module,exports){\n\"use strict\";\nmodule.exports = inquire;\n\n/**\n * Requires a module only if available.\n * @memberof util\n * @param {string} moduleName Module to require\n * @returns {?Object} Required module if available and not empty, otherwise `null`\n */\nfunction inquire(moduleName) {\n try {\n /**\n * @memo change by shevchik\n *\n * @see https://github.com/protobufjs/protobuf.js/issues/1754\n */\n // var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval ////\n var mod = require(moduleName); // eslint-disable-line no-eval\n if (mod && (mod.length || Object.keys(mod).length))\n return mod;\n } catch (e) {} // eslint-disable-line no-empty\n return null;\n}\n\n},{}],8:[function(require,module,exports){\n\"use strict\";\n\n/**\n * A minimal path module to resolve Unix, Windows and URL paths alike.\n * @memberof util\n * @namespace\n */\nvar path = exports;\n\nvar isAbsolute =\n/**\n * Tests if the specified path is absolute.\n * @param {string} path Path to test\n * @returns {boolean} `true` if path is absolute\n */\npath.isAbsolute = function isAbsolute(path) {\n return /^(?:\\/|\\w+:)/.test(path);\n};\n\nvar normalize =\n/**\n * Normalizes the specified path.\n * @param {string} path Path to normalize\n * @returns {string} Normalized path\n */\npath.normalize = function normalize(path) {\n path = path.replace(/\\\\/g, \"/\")\n .replace(/\\/{2,}/g, \"/\");\n var parts = path.split(\"/\"),\n absolute = isAbsolute(path),\n prefix = \"\";\n if (absolute)\n prefix = parts.shift() + \"/\";\n for (var i = 0; i < parts.length;) {\n if (parts[i] === \"..\") {\n if (i > 0 && parts[i - 1] !== \"..\")\n parts.splice(--i, 2);\n else if (absolute)\n parts.splice(i, 1);\n else\n ++i;\n } else if (parts[i] === \".\")\n parts.splice(i, 1);\n else\n ++i;\n }\n return prefix + parts.join(\"/\");\n};\n\n/**\n * Resolves the specified include path against the specified origin path.\n * @param {string} originPath Path to the origin file\n * @param {string} includePath Include path relative to origin path\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\n * @returns {string} Path to the include file\n */\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\n if (!alreadyNormalized)\n includePath = normalize(includePath);\n if (isAbsolute(includePath))\n return includePath;\n if (!alreadyNormalized)\n originPath = normalize(originPath);\n return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\n};\n\n},{}],9:[function(require,module,exports){\n\"use strict\";\nmodule.exports = pool;\n\n/**\n * An allocator as used by {@link util.pool}.\n * @typedef PoolAllocator\n * @type {function}\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\n\n/**\n * A slicer as used by {@link util.pool}.\n * @typedef PoolSlicer\n * @type {function}\n * @param {number} start Start offset\n * @param {number} end End offset\n * @returns {Uint8Array} Buffer slice\n * @this {Uint8Array}\n */\n\n/**\n * A general purpose buffer pool.\n * @memberof util\n * @function\n * @param {PoolAllocator} alloc Allocator\n * @param {PoolSlicer} slice Slicer\n * @param {number} [size=8192] Slab size\n * @returns {PoolAllocator} Pooled allocator\n */\nfunction pool(alloc, slice, size) {\n var SIZE = size || 8192;\n var MAX = SIZE >>> 1;\n var slab = null;\n var offset = SIZE;\n return function pool_alloc(size) {\n if (size < 1 || size > MAX)\n return alloc(size);\n if (offset + size > SIZE) {\n slab = alloc(SIZE);\n offset = 0;\n }\n var buf = slice.call(slab, offset, offset += size);\n if (offset & 7) // align to 32 bit\n offset = (offset | 7) + 1;\n return buf;\n };\n}\n\n},{}],10:[function(require,module,exports){\n\"use strict\";\n\n/**\n * A minimal UTF8 implementation for number arrays.\n * @memberof util\n * @namespace\n */\nvar utf8 = exports;\n\n/**\n * Calculates the UTF8 byte length of a string.\n * @param {string} string String\n * @returns {number} Byte length\n */\nutf8.length = function utf8_length(string) {\n var len = 0,\n c = 0;\n for (var i = 0; i < string.length; ++i) {\n c = string.charCodeAt(i);\n if (c < 128)\n len += 1;\n else if (c < 2048)\n len += 2;\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\n ++i;\n len += 4;\n } else\n len += 3;\n }\n return len;\n};\n\n/**\n * Reads UTF8 bytes as a string.\n * @param {Uint8Array} buffer Source buffer\n * @param {number} start Source start\n * @param {number} end Source end\n * @returns {string} String read\n */\nutf8.read = function utf8_read(buffer, start, end) {\n var len = end - start;\n if (len < 1)\n return \"\";\n var parts = null,\n chunk = [],\n i = 0, // char offset\n t; // temporary\n while (start < end) {\n t = buffer[start++];\n if (t < 128)\n chunk[i++] = t;\n else if (t > 191 && t < 224)\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\n else if (t > 239 && t < 365) {\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\n chunk[i++] = 0xD800 + (t >> 10);\n chunk[i++] = 0xDC00 + (t & 1023);\n } else\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\n if (i > 8191) {\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\n i = 0;\n }\n }\n if (parts) {\n if (i)\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\n return parts.join(\"\");\n }\n return String.fromCharCode.apply(String, chunk.slice(0, i));\n};\n\n/**\n * Writes a string as UTF8 bytes.\n * @param {string} string Source string\n * @param {Uint8Array} buffer Destination buffer\n * @param {number} offset Destination offset\n * @returns {number} Bytes written\n */\nutf8.write = function utf8_write(string, buffer, offset) {\n var start = offset,\n c1, // character 1\n c2; // character 2\n for (var i = 0; i < string.length; ++i) {\n c1 = string.charCodeAt(i);\n if (c1 < 128) {\n buffer[offset++] = c1;\n } else if (c1 < 2048) {\n buffer[offset++] = c1 >> 6 | 192;\n buffer[offset++] = c1 & 63 | 128;\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\n ++i;\n buffer[offset++] = c1 >> 18 | 240;\n buffer[offset++] = c1 >> 12 & 63 | 128;\n buffer[offset++] = c1 >> 6 & 63 | 128;\n buffer[offset++] = c1 & 63 | 128;\n } else {\n buffer[offset++] = c1 >> 12 | 224;\n buffer[offset++] = c1 >> 6 & 63 | 128;\n buffer[offset++] = c1 & 63 | 128;\n }\n }\n return offset - start;\n};\n\n},{}],11:[function(require,module,exports){\n\"use strict\";\nmodule.exports = common;\n\nvar commonRe = /\\/|\\./;\n\n/**\n * Provides common type definitions.\n * Can also be used to provide additional google types or your own custom types.\n * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name\n * @param {Object.<string,*>} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\n * @returns {undefined}\n * @property {INamespace} google/protobuf/any.proto Any\n * @property {INamespace} google/protobuf/duration.proto Duration\n * @property {INamespace} google/protobuf/empty.proto Empty\n * @property {INamespace} google/protobuf/field_mask.proto FieldMask\n * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue\n * @property {INamespace} google/protobuf/timestamp.proto Timestamp\n * @property {INamespace} google/protobuf/wrappers.proto Wrappers\n * @example\n * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)\n * protobuf.common(\"descriptor\", descriptorJson);\n *\n * // manually provides a custom definition (uses my.foo namespace)\n * protobuf.common(\"my/foo/bar.proto\", myFooBarJson);\n */\nfunction common(name, json) {\n if (!commonRe.test(name)) {\n name = \"google/protobuf/\" + name + \".proto\";\n json = { nested: { google: { nested: { protobuf: { nested: json } } } } };\n }\n common[name] = json;\n}\n\n// Not provided because of limited use (feel free to discuss or to provide yourself):\n//\n// google/protobuf/descriptor.proto\n// google/protobuf/source_context.proto\n// google/protobuf/type.proto\n//\n// Stripped and pre-parsed versions of these non-bundled files are instead available as part of\n// the repository or package within the google/protobuf directory.\n\ncommon(\"any\", {\n\n /**\n * Properties of a google.protobuf.Any message.\n * @interface IAny\n * @type {Object}\n * @property {string} [typeUrl]\n * @property {Uint8Array} [bytes]\n * @memberof common\n */\n Any: {\n fields: {\n type_url: {\n type: \"string\",\n id: 1\n },\n value: {\n type: \"bytes\",\n id: 2\n }\n }\n }\n});\n\nvar timeType;\n\ncommon(\"duration\", {\n\n /**\n * Properties of a google.protobuf.Duration message.\n * @interface IDuration\n * @type {Object}\n * @property {number|Long} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Duration: timeType = {\n fields: {\n seconds: {\n type: \"int64\",\n id: 1\n },\n nanos: {\n type: \"int32\",\n id: 2\n }\n }\n }\n});\n\ncommon(\"timestamp\", {\n\n /**\n * Properties of a google.protobuf.Timestamp message.\n * @interface ITimestamp\n * @type {Object}\n * @property {number|Long} [seconds]\n * @property {number} [nanos]\n * @memberof common\n */\n Timestamp: timeType\n});\n\ncommon(\"empty\", {\n\n /**\n * Properties of a google.protobuf.Empty message.\n * @interface IEmpty\n * @memberof common\n */\n Empty: {\n fields: {}\n }\n});\n\ncommon(\"struct\", {\n\n /**\n * Properties of a google.protobuf.Struct message.\n * @interface IStruct\n * @type {Object}\n * @property {Object.<string,IValue>} [fields]\n * @memberof common\n */\n Struct: {\n fields: {\n fields: {\n keyType: \"string\",\n type: \"Value\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Value message.\n * @interface IValue\n * @type {Object}\n * @property {string} [kind]\n * @property {0} [nullValue]\n * @property {number} [numberValue]\n * @property {string} [stringValue]\n * @property {boolean} [boolValue]\n * @property {IStruct} [structValue]\n * @property {IListValue} [listValue]\n * @memberof common\n */\n Value: {\n oneofs: {\n kind: {\n oneof: [\n \"nullValue\",\n \"numberValue\",\n \"stringValue\",\n \"boolValue\",\n \"structValue\",\n \"listValue\"\n ]\n }\n },\n fields: {\n nullValue: {\n type: \"NullValue\",\n id: 1\n },\n numberValue: {\n type: \"double\",\n id: 2\n },\n stringValue: {\n type: \"string\",\n id: 3\n },\n boolValue: {\n type: \"bool\",\n id: 4\n },\n structValue: {\n type: \"Struct\",\n id: 5\n },\n listValue: {\n type: \"ListValue\",\n id: 6\n }\n }\n },\n\n NullValue: {\n values: {\n NULL_VALUE: 0\n }\n },\n\n /**\n * Properties of a google.protobuf.ListValue message.\n * @interface IListValue\n * @type {Object}\n * @property {Array.<IValue>} [values]\n * @memberof common\n */\n ListValue: {\n fields: {\n values: {\n rule: \"repeated\",\n type: \"Value\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"wrappers\", {\n\n /**\n * Properties of a google.protobuf.DoubleValue message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n DoubleValue: {\n fields: {\n value: {\n type: \"double\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.FloatValue message.\n * @interface IFloatValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FloatValue: {\n fields: {\n value: {\n type: \"float\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int64Value message.\n * @interface IInt64Value\n * @type {Object}\n * @property {number|Long} [value]\n * @memberof common\n */\n Int64Value: {\n fields: {\n value: {\n type: \"int64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt64Value message.\n * @interface IUInt64Value\n * @type {Object}\n * @property {number|Long} [value]\n * @memberof common\n */\n UInt64Value: {\n fields: {\n value: {\n type: \"uint64\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.Int32Value message.\n * @interface IInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n Int32Value: {\n fields: {\n value: {\n type: \"int32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.UInt32Value message.\n * @interface IUInt32Value\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n UInt32Value: {\n fields: {\n value: {\n type: \"uint32\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BoolValue message.\n * @interface IBoolValue\n * @type {Object}\n * @property {boolean} [value]\n * @memberof common\n */\n BoolValue: {\n fields: {\n value: {\n type: \"bool\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.StringValue message.\n * @interface IStringValue\n * @type {Object}\n * @property {string} [value]\n * @memberof common\n */\n StringValue: {\n fields: {\n value: {\n type: \"string\",\n id: 1\n }\n }\n },\n\n /**\n * Properties of a google.protobuf.BytesValue message.\n * @interface IBytesValue\n * @type {Object}\n * @property {Uint8Array} [value]\n * @memberof common\n */\n BytesValue: {\n fields: {\n value: {\n type: \"bytes\",\n id: 1\n }\n }\n }\n});\n\ncommon(\"field_mask\", {\n\n /**\n * Properties of a google.protobuf.FieldMask message.\n * @interface IDoubleValue\n * @type {Object}\n * @property {number} [value]\n * @memberof common\n */\n FieldMask: {\n fields: {\n paths: {\n rule: \"repeated\",\n type: \"string\",\n id: 1\n }\n }\n }\n});\n\n/**\n * Gets the root definition of the specified common proto file.\n *\n * Bundled definitions are:\n * - google/protobuf/any.proto\n * - google/protobuf/duration.proto\n * - google/protobuf/empty.proto\n * - google/protobuf/field_mask.proto\n * - google/protobuf/struct.proto\n * - google/protobuf/timestamp.proto\n * - google/protobuf/wrappers.proto\n *\n * @param {string} file Proto file name\n * @returns {INamespace|null} Root definition or `null` if not defined\n */\ncommon.get = function get(file) {\n return common[file] || null;\n};\n\n},{}],12:[function(require,module,exports){\n\"use strict\";\n/**\n * Runtime message from/to plain object converters.\n * @namespace\n */\nvar converter = exports;\n\nvar Enum = require(15),\n util = require(37);\n\n/**\n * Generates a partial value fromObject conveter.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} prop Property reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop) {\n /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n if (field.resolvedType) {\n if (field.resolvedType instanceof Enum) { gen\n (\"switch(d%s){\", prop);\n for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\n if (field.repeated && values[keys[i]] === field.typeDefault) gen\n (\"default:\");\n gen\n (\"case%j:\", keys[i])\n (\"case %i:\", values[keys[i]])\n (\"m%s=%j\", prop, values[keys[i]])\n (\"break\");\n } gen\n (\"}\");\n } else gen\n (\"if(typeof d%s!==\\\"object\\\")\", prop)\n (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n (\"m%s=types[%i].fromObject(d%s)\", prop, fieldIndex, prop);\n } else {\n var isUnsigned = false;\n switch (field.type) {\n case \"double\":\n case \"float\": gen\n (\"m%s=Number(d%s)\", prop, prop); // also catches \"NaN\", \"Infinity\"\n break;\n case \"uint32\":\n case \"fixed32\": gen\n (\"m%s=d%s>>>0\", prop, prop);\n break;\n case \"int32\":\n case \"sint32\":\n case \"sfixed32\": gen\n (\"m%s=d%s|0\", prop, prop);\n break;\n case \"uint64\":\n isUnsigned = true;\n // eslint-disable-line no-fallthrough\n case \"int64\":\n case \"sint64\":\n case \"fixed64\":\n case \"sfixed64\": gen\n (\"if(util.Long)\")\n (\"(m%s=util.Long.fromValue(d%s)).unsigned=%j\", prop, prop, isUnsigned)\n (\"else if(typeof d%s===\\\"string\\\")\", prop)\n (\"m%s=parseInt(d%s,10)\", prop, prop)\n (\"else if(typeof d%s===\\\"number\\\")\", prop)\n (\"m%s=d%s\", prop, prop)\n (\"else if(typeof d%s===\\\"object\\\")\", prop)\n (\"m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)\", prop, prop, prop, isUnsigned ? \"true\" : \"\");\n break;\n case \"bytes\": gen\n (\"if(typeof d%s===\\\"string\\\")\", prop)\n (\"util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)\", prop, prop, prop)\n (\"else if(d%s.length)\", prop)\n (\"m%s=d%s\", prop, prop);\n break;\n case \"string\": gen\n (\"m%s=String(d%s)\", prop, prop);\n break;\n case \"bool\": gen\n (\"m%s=Boolean(d%s)\", prop, prop);\n break;\n /* default: gen\n