ots-client 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/adapters/type-adapter.d.ts +6 -0
  2. package/dist/client/base-client.d.ts +59 -0
  3. package/dist/client/index.d.ts +3 -0
  4. package/dist/client/query-builder.d.ts +23 -0
  5. package/dist/decorators/index.d.ts +56 -0
  6. package/dist/deps/acorn-BOl0sFTPW7-g7l5tn7d4.js +16 -0
  7. package/dist/deps/acorn-BOl0sFTPW7-hklkvjepo.js +3005 -0
  8. package/dist/deps/angular-XNXkkMW2x2-7du6op6fw.js +2533 -0
  9. package/dist/deps/angular-XNXkkMW2x2-we6wvxttc.js +3 -0
  10. package/dist/deps/babel-JmunAd9gx3-6dq643w5b.js +7217 -0
  11. package/dist/deps/babel-JmunAd9gx3-wao5c2v19.js +15 -0
  12. package/dist/deps/estree-QR0a7eAiZm-36ju20hxl.js +4528 -0
  13. package/dist/deps/estree-QR0a7eAiZm-t0kwe9gae.js +44 -0
  14. package/dist/deps/flow-GdDnVSvT5w-rgi5vp4qm.js +27411 -0
  15. package/dist/deps/flow-GdDnVSvT5w-rnla0vmdw.js +20 -0
  16. package/dist/deps/glimmer-Yu8RjFE1-a-5ivcwuhu1.js +37 -0
  17. package/dist/deps/glimmer-Yu8RjFE1-a-60xpuum9o.js +2703 -0
  18. package/dist/deps/graphql-b_914AArZY-uwrebifsb.js +28 -0
  19. package/dist/deps/graphql-b_914AArZY-yc77nhrwj.js +1221 -0
  20. package/dist/deps/html-6ymxY6PL6B-ge7hzyfqj.js +2791 -0
  21. package/dist/deps/html-6ymxY6PL6B-ug8ebf4sa.js +25 -0
  22. package/dist/deps/index-apktVSn0Wa-1pqh8j69b.js +7 -0
  23. package/dist/deps/index-apktVSn0Wa-m4m4s4pcy.js +24535 -0
  24. package/dist/deps/markdown-44cJkal_TC-rli9cqus2.js +3190 -0
  25. package/dist/deps/markdown-44cJkal_TC-t8vpmxjyl.js +62 -0
  26. package/dist/deps/meriyah-IwksJmaFJr-1kz9p5807.js +5 -0
  27. package/dist/deps/meriyah-IwksJmaFJr-aj8jxnzem.js +2645 -0
  28. package/dist/deps/postcss-gD1c7_GzEP-7h0ly93la.js +61 -0
  29. package/dist/deps/postcss-gD1c7_GzEP-kecpdijjx.js +4739 -0
  30. package/dist/deps/typescript-tYbKJGRdB5-3c3whaiss.js +12947 -0
  31. package/dist/deps/typescript-tYbKJGRdB5-4n3mbr7g0.js +21 -0
  32. package/dist/deps/yaml-LL7qhBUJFz-xb6k8do2g.js +4079 -0
  33. package/dist/deps/yaml-LL7qhBUJFz-zl5hfpq31.js +159 -0
  34. package/dist/generate.cjs +42349 -0
  35. package/dist/generate.d.ts +1 -0
  36. package/dist/generate.js +241530 -0
  37. package/dist/generator/index.d.ts +6 -0
  38. package/dist/generator/parser.d.ts +20 -0
  39. package/dist/generator/table-generator.d.ts +3 -0
  40. package/dist/generator/type-generator.d.ts +6 -0
  41. package/dist/index.cjs +1 -0
  42. package/dist/index.d.ts +4 -0
  43. package/dist/index.js +726 -0
  44. package/dist/init/index.d.ts +3 -0
  45. package/dist/types/client.d.ts +35 -0
  46. package/dist/types/index.d.ts +98 -0
  47. package/dist/utils/index.d.ts +31 -0
  48. package/package.json +47 -0
@@ -0,0 +1,7 @@
1
+ "use strict";const require$$1=require("crypto");require("os");const require$$4=require("buffer"),require$$5=require("url"),fs=require("fs"),require$$0=require("util"),require$$0$1=require("stream"),require$$3=require("https"),require$$4$1=require("http"),VectorMetricType={VM_EUCLIDEAN:0,VM_COSINE:1,VM_DOT_PRODUCT:2};var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function getAugmentedNamespace(u){if(u.__esModule)return u;var c=u.default;if(typeof c=="function"){var n=function o(){return this instanceof o?Reflect.construct(c,arguments,this.constructor):c.apply(this,arguments)};n.prototype=c.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(u).forEach(function(o){var t=Object.getOwnPropertyDescriptor(u,o);Object.defineProperty(n,o,t.get?t:{enumerable:!0,get:function(){return u[o]}})}),n}function commonjsRequire(u){throw new Error('Could not dynamically require "'+u+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var int64Buffer={};(function(u){(function(c){var n="undefined",o=n!==typeof Buffer&&Buffer,t=n!==typeof Uint8Array&&Uint8Array,e=n!==typeof ArrayBuffer&&ArrayBuffer,r=[0,0,0,0,0,0,0,0],i=Array.isArray||S,l=4294967296,a=16777216,f;s("Uint64BE",!0,!0),s("Int64BE",!0,!1),s("Uint64LE",!1,!0),s("Int64LE",!1,!1);function s(y,h,m){var p=h?0:4,x=h?4:0,v=h?0:3,P=h?1:2,M=h?2:1,F=h?3:0,U=h?A:E,K=h?C:_,G=V.prototype,Q="is"+y,H="_"+Q;return G.buffer=void 0,G.offset=0,G[H]=!0,G.toNumber=J,G.toString=Z,G.toJSON=J,G.toArray=d,o&&(G.toBuffer=O),t&&(G.toArrayBuffer=b),V[Q]=W,c[y]=V,V;function V(T,R,$,N){return this instanceof V?Y(this,T,R,$,N):new V(T,R,$,N)}function W(T){return!!(T&&T[H])}function Y(T,R,$,N,I){if(t&&e&&(R instanceof e&&(R=new t(R)),N instanceof e&&(N=new t(N))),!R&&!$&&!N&&!f){T.buffer=B(r,0);return}if(!w(R,$)){var k=f||Array;I=$,N=R,$=0,R=new k(8)}T.buffer=R,T.offset=$|=0,n!==typeof N&&(typeof N=="string"?X(R,$,N,I||10):w(N,I)?g(R,$,N,I):typeof I=="number"?(q(R,$+p,N),q(R,$+x,I)):N>0?U(R,$,N):N<0?K(R,$,N):g(R,$,r,0))}function X(T,R,$,N){var I=0,k=$.length,L=0,D=0;$[0]==="-"&&I++;for(var tt=I;I<k;){var z=parseInt($[I++],N);if(!(z>=0))break;D=D*N+z,L=L*N+Math.floor(D/l),D%=l}tt&&(L=~L,D?D=l-D:L++),q(T,R+p,L),q(T,R+x,D)}function J(){var T=this.buffer,R=this.offset,$=j(T,R+p),N=j(T,R+x);return m||($|=0),$?$*l+N:N}function Z(T){var R=this.buffer,$=this.offset,N=j(R,$+p),I=j(R,$+x),k="",L=!m&&N&2147483648;for(L&&(N=~N,I=l-I),T=T||10;;){var D=N%T*l+I;if(N=Math.floor(N/T),I=Math.floor(D/T),k=(D%T).toString(T)+k,!N&&!I)break}return L&&(k="-"+k),k}function q(T,R,$){T[R+F]=$&255,$=$>>8,T[R+M]=$&255,$=$>>8,T[R+P]=$&255,$=$>>8,T[R+v]=$&255}function j(T,R){return T[R+v]*a+(T[R+P]<<16)+(T[R+M]<<8)+T[R+F]}}function d(y){var h=this.buffer,m=this.offset;return f=null,y!==!1&&m===0&&h.length===8&&i(h)?h:B(h,m)}function O(y){var h=this.buffer,m=this.offset;if(f=o,y!==!1&&m===0&&h.length===8&&Buffer.isBuffer(h))return h;var p=new o(8);return g(p,0,h,m),p}function b(y){var h=this.buffer,m=this.offset,p=h.buffer;if(f=t,y!==!1&&m===0&&p instanceof e&&p.byteLength===8)return p;var x=new t(8);return g(x,0,h,m),x.buffer}function w(y,h){var m=y&&y.length;return h|=0,m&&h+8<=m&&typeof y[h]!="string"}function g(y,h,m,p){h|=0,p|=0;for(var x=0;x<8;x++)y[h++]=m[p++]&255}function B(y,h){return Array.prototype.slice.call(y,h,h+8)}function A(y,h,m){for(var p=h+8;p>h;)y[--p]=m&255,m/=256}function C(y,h,m){var p=h+8;for(m++;p>h;)y[--p]=-m&255^255,m/=256}function E(y,h,m){for(var p=h+8;h<p;)y[h++]=m&255,m/=256}function _(y,h,m){var p=h+8;for(m++;h<p;)y[h++]=-m&255^255,m/=256}function S(y){return!!y&&Object.prototype.toString.call(y)=="[object Array]"}})(typeof u.nodeName!="string"?u:commonjsGlobal||{})})(int64Buffer);var util$5,hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util$5;hasRequiredUtil=1;var u=requireCore(),c=require$$1,n=int64Buffer,o=require$$4.Buffer;return u.util={engine:function(){return u.util.isBrowser()&&typeof navigator<"u"?navigator.userAgent:process.platform+"/"+process.version},userAgent:function(){return""},isBrowser:function(){return typeof window<"u"},isNode:function(){return!u.util.isBrowser()},nodeRequire:function(e){if(u.util.isNode())return commonjsRequire(e)},topEscape:function(t){var e="",r=0;t=t.toString();for(var i=/(^[a-zA-Z0-9-_.~]*)/;r<t.length;){var l=i.exec(t.substr(r));if(l!=null&&l.length>1&&l[1]!="")e+=l[1],r+=l[1].length;else{if(t[r]==" ")e+="%20";else{var a=t.charCodeAt(r),f=a.toString(16);e+="%"+(f.length<2?"0":"")+f.toUpperCase()}r++}}return e},popEscape:function(t){return t=t.toString(),t=encodeURIComponent(t).replace(/\!/gi,"%21").replace(/\'/gi,"%27").replace(/\(/gi,"%28").replace(/\)/gi,"%29").replace(/\*/gi,"%2A"),t},uriEscape:function(e){var r=encodeURIComponent(e);return r=r.replace(/[^A-Za-z0-9_.~\-%]+/g,escape),r=r.replace(/[*]/g,function(i){return"%"+i.charCodeAt(0).toString(16).toUpperCase()}),r},uriEscapePath:function(e){var r=[];return u.util.arrayEach(e.split("/"),function(i){r.push(u.util.uriEscape(i))}),r.join("/")},urlParse:function(e){return require$$5.parse(e)},urlFormat:function(e){return require$$5.format(e)},uuid:function(){var e=new Date().getTime();window.performance&&typeof window.performance.now=="function"&&(e+=performance.now());var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var l=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(i=="x"?l:l&3|8).toString(16)});return r},queryParamsToString:function(e){var r=[],i=u.util.uriEscape,l=Object.keys(e).sort();return u.util.arrayEach(l,function(a){var f=e[a],s=i(a),d=s;if(Array.isArray(f)){var O=[];u.util.arrayEach(f,function(b){O.push(i(b))}),d=s+"="+O.sort().join("&"+s+"=")}else f!=null&&(d=s+"="+i(f));r.push(d)}),r.join("&")},readFileSync:function(e){return typeof window<"u"?null:fs.readFileSync(e,"utf-8")},base64:{encode:function(e){return new o(e).toString("base64")},decode:function(e){return new o(e,"base64").toString()}},Buffer:o,buffer:{concat:function(t){var e=0,r=0,i=null,l;for(l=0;l<t.length;l++)e+=t[l].length;for(i=new o(e),l=0;l<t.length;l++)t[l].copy(i,r),r+=t[l].length;return i}},Int64:{doubleToRawLongBits:function(t){var e=new o(8);e.fill(0),e.writeDoubleLE(t,0);var r=new n.Int64LE(e);return r}},string:{byteLength:function(e){if(e==null)return 0;if(typeof e=="string"&&(e=new o(e)),typeof e.byteLength=="number")return e.byteLength;if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.path=="string")return fs.lstatSync(e.path).size;throw u.util.error(new Error("Cannot determine length of "+e),{object:e})},upperFirst:function(e){return e[0].toUpperCase()+e.substr(1)},lowerFirst:function(e){return e[0].toLowerCase()+e.substr(1)}},date:{getDate:function(){return new Date},top:function(e,r){r=r||"%Y-%M-%dT%H:%m:%sZ";function i(l){return l.toString().length<2?"0"+l:l}return r.replace(/%([a-zA-Z])/g,function(l,a){switch(a){case"Y":return e.getUTCFullYear();case"M":return i(e.getUTCMonth()+1);case"d":return i(e.getUTCDate());case"H":return i(e.getUTCHours());case"m":return i(e.getUTCMinutes());case"s":return i(e.getUTCSeconds());default:throw new Error("Unsupported format code: "+a)}})},iso8601:function(e){return e===void 0&&(e=u.util.date.getDate()),e.toISOString()},rfc822:function(e){return e===void 0&&(e=u.util.date.getDate()),e.toUTCString().replace("UTC","GMT")},unixSeconds:function(e){return e===void 0&&(e=u.util.date.getDate()),Math.floor(e.getTime()/1e3)},unixMilliseconds:function(e){return e===void 0&&(e=u.util.date.getDate()),e.getTime()},from:function(e){return typeof e=="number"?e.toString().length==10?new Date(e*1e3):new Date(e):Object.prototype.toString.call(e)==="[object Date]"?e:new Date(e)},format:function(e,r){return r||(r="unixSeconds"),u.util.date[r](u.util.date.from(e))}},crypto:{crc32Table:[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],crc32:function(e){var r=u.util.crypto.crc32Table,i=-1;typeof e=="string"&&(e=new o(e));for(var l=0;l<e.length;l++){var a=e.readUInt8(l);i=i>>>8^r[(i^a)&255]}return(i^-1)>>>0},hmac:function(e,r,i,l){return i||(i="binary"),i==="buffer"&&(i=void 0),l||(l="sha256"),typeof r=="string"&&(r=new o(r)),c.createHmac(l,e).update(r).digest(i)},md5:function(e,r){return r||(r="binary"),r==="buffer"&&(r=void 0),typeof e=="string"&&(e=new o(e)),u.util.crypto.createHash("md5").update(e).digest(r)},sha256:function(e,r){return r||(r="binary"),r==="buffer"&&(r=void 0),typeof e=="string"&&(e=new o(e)),u.util.crypto.createHash("sha256").update(e).digest(r)},toHex:function(e){for(var r=[],i=0;i<e.length;i++)r.push(("0"+e.charCodeAt(i).toString(16)).substr(-2,2));return r.join("")},createHash:function(e){return c.createHash(e)}},abort:{},each:function(e,r){for(var i in e)if(e.hasOwnProperty(i)){var l=r.call(this,i,e[i]);if(l===u.util.abort)break}},arrayEach:function(e,r){for(var i in e)if(e.hasOwnProperty(i)){var l=r.call(this,e[i],parseInt(i,10));if(l===u.util.abort)break}},update:function(e,r){return u.util.each(r,function(l,a){e[l]=a}),e},merge:function(e,r){return u.util.update(u.util.copy(e),r)},copy:function(e){if(e==null)return e;var r={};for(var i in e)r[i]=e[i];return r},isEmpty:function(e){for(var r in e)if(e.hasOwnProperty(r))return!1;return!0},isType:function(e,r){return typeof r=="function"&&(r=u.util.typeName(r)),Object.prototype.toString.call(e)==="[object "+r+"]"},typeName:function(e){if(e.hasOwnProperty("name"))return e.name;var r=e.toString(),i=r.match(/^\s*function (.+)\(/);return i?i[1]:r},error:function(e,r){var i=null;return typeof e.message=="string"&&e.message!==""&&(typeof r=="string"||r&&r.message)&&(i=u.util.copy(e),i.message=e.message),e.message=e.message||null,typeof r=="string"?e.message=r:typeof r=="object"&&(u.util.update(e,r),r.message&&(e.message=r.message),(r.code||r.name)&&(e.code=r.code||r.name),r.stack&&(e.stack=r.stack),r.requestId&&(e.requestId=r.requestId)),typeof Object.defineProperty=="function"&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=e.name||e.code||"Error",e.time=new Date,i&&(e.originalError=i),e},inherit:function(e,r){var i=null;if(r===void 0)r=e,e=Object,i={};else{var l=function(){};l.prototype=e.prototype,i=new l}return r.constructor===Object&&(r.constructor=function(){if(e!==Object)return e.apply(this,arguments)}),r.constructor.prototype=i,u.util.update(r.constructor.prototype,r),r.constructor.__super__=e,r.constructor},mixin:function(){for(var e=arguments[0],r=1;r<arguments.length;r++)for(var i in arguments[r].prototype){var l=arguments[r].prototype[i];i!="constructor"&&(e.prototype[i]=l)}return e},hideProperties:function(e,r){typeof Object.defineProperty=="function"&&u.util.arrayEach(r,function(i){Object.defineProperty(e,i,{enumerable:!1,writable:!0,configurable:!0})})}},util$5=u.util,util$5}var metadata={},hasRequiredMetadata;function requireMetadata(){if(hasRequiredMetadata)return metadata;hasRequiredMetadata=1;var u=requireCore();return u.util.inherit,u.rowExistenceExpectation={IGNORE:"IGNORE",EXPECT_EXIST:"EXPECT_EXIST",EXPECT_NOT_EXIST:"EXPECT_NOT_EXIST"},u.Direction={FORWARD:"FORWARD",BACKWARD:"BACKWARD"},u.UpdateType={PUT:"PUT",DELETE:"DELETE",DELETE_ALL:"DELETE_ALL",INCREMENT:"INCREMENT"},u.BatchWriteType={PUT:1,UPDATE:2,DELETE:3},u.ReturnType={NONE:0,Primarykey:1,AfterModify:2},u.DefinedColumnType={DCT_INTEGER:1,DCT_DOUBLE:2,DCT_BOOLEAN:3,DCT_STRING:4},u.PrimaryKeyType={INTEGER:1,STRING:2,BINARY:3},u.PrimaryKeyOption={AUTO_INCREMENT:1},u.IndexUpdateMode={IUM_ASYNC_INDEX:0,IUM_SYNC_INDEX:1},u.IndexType={IT_GLOBAL_INDEX:0,IT_LOCAL_INDEX:1},u.INF_MIN={},u.INF_MAX={},u.PK_AUTO_INCR={},metadata}var long={},hasRequiredLong;function requireLong(){if(hasRequiredLong)return long;hasRequiredLong=1;var u=requireCore(),c=int64Buffer;return u.Long={fromNumber:function(n){return this.int64=new c.Int64LE(n),this.int64},fromString:function(n){return this.int64=new c.Int64LE(n,10),this.int64},toBuffer:function(){return this.int64.toBuffer()},toNumber:function(){return this.int64.toNumber()}},long}var plain_buffer_consts={},hasRequiredPlain_buffer_consts;function requirePlain_buffer_consts(){if(hasRequiredPlain_buffer_consts)return plain_buffer_consts;hasRequiredPlain_buffer_consts=1;var u=requireCore();return u.plainBufferConsts={HEADER:117,TAG_ROW_PK:1,TAG_ROW_DATA:2,TAG_CELL:3,TAG_CELL_NAME:4,TAG_CELL_VALUE:5,TAG_CELL_TYPE:6,TAG_CELL_TIMESTAMP:7,TAG_DELETE_ROW_MARKER:8,TAG_ROW_CHECKSUM:9,TAG_CELL_CHECKSUM:10,TAG_EXTENSION:11,TAG_SEQ_INFO:12,TAG_SEQ_INFO_EPOCH:13,TAG_SEQ_INFO_TS:14,TAG_SEQ_INFO_ROW_INDEX:15,DELETE_ALL_VERSION:1,DELETE_ONE_VERSION:3,INCREMENT:4,VT_INTEGER:0,VT_DOUBLE:1,VT_BOOLEAN:2,VT_STRING:3,VT_NULL:6,VT_BLOB:7,VT_INF_MIN:9,VT_INF_MAX:10,VT_AUTO_INCREMENT:11,LITTLE_ENDIAN_32_SIZE:4,LITTLE_ENDIAN_64_SIZE:8,MAX_BUFFER_SIZE:64*1024*1024},plain_buffer_consts}var plain_buffer_crc8={},hasRequiredPlain_buffer_crc8;function requirePlain_buffer_crc8(){if(hasRequiredPlain_buffer_crc8)return plain_buffer_crc8;hasRequiredPlain_buffer_crc8=1;var u=requireCore(),c=u.util.Buffer,n=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];return u.plainBufferCrc8={update:function(o,t){return u.plainBufferCrc8._update(o,t)},_update:function(o,t){for(var e=new c(t),r=0;r<e.length;r++)o=n[o&255^e[r]];return o},crcString:function(o,t){return this.update(o,t)},crcInt8:function(o,t){return n[o&255^t]},crcInt32:function(o,t){for(var e=0;e<4;e++)o=this.crcInt8(o,t>>e*8&255);return o},crcInt64Buf:function(o,t){return o=this.crcInt8(o,t[0]&255),o=this.crcInt8(o,t[1]&255),o=this.crcInt8(o,t[2]&255),o=this.crcInt8(o,t[3]&255),o=this.crcInt8(o,t[4]&255),o=this.crcInt8(o,t[5]&255),o=this.crcInt8(o,t[6]&255),o=this.crcInt8(o,t[7]&255),o}},plain_buffer_crc8}var plain_buffer_stream={},hasRequiredPlain_buffer_stream;function requirePlain_buffer_stream(){if(hasRequiredPlain_buffer_stream)return plain_buffer_stream;hasRequiredPlain_buffer_stream=1;var u=requireCore(),c=int64Buffer,n=u.util.Buffer,o=u.util.inherit;return u.PlainBufferInputStream=o({constructor:function(t){u.util.Buffer.isBuffer(t.buffer)?this.buffer=t.buffer:this.buffer=new u.util.Buffer(t.buffer),this.bufferLimit=t.limit,this.curPos=t.offset,this.lastTag=0},isAtEnd:function(){return this.bufferLimit===this.curPos},readTag:function(){return this.isAtEnd()?(this.lastTag=0,0):(this.lastTag=this.readRawByte(),this.lastTag)},checkLastTagWas:function(t){return this.lastTag===t},getLastTag:function(){return this.lastTag},readRawByte:function(){if(this.isAtEnd())throw new Error("Read raw byte encountered EOF.");var t=this.curPos;return this.curPos+=1,this.buffer[t]},readRawLittleEndian64:function(){var t=this.readRawByte(),e=this.readRawByte(),r=this.readRawByte(),i=this.readRawByte(),l=this.readRawByte(),a=this.readRawByte(),f=this.readRawByte(),s=this.readRawByte(),d=new n([t,e,r,i,l,a,f,s]);return d},readRawLittleEndian32:function(){var t=this.readRawByte(),e=this.readRawByte(),r=this.readRawByte(),i=this.readRawByte();return t&255|(e&255)<<8|(r&255)<<16|(i&255)<<24},readBoolean:function(){return this.readRawByte()!=0},readDoubleAndInt64:function(){var t=this.readRawLittleEndian64(),e=t.readDoubleLE(0),r=new c.Int64LE(t);return{doubleVal:e,int64LE:r}},readInt32:function(){return this.readRawLittleEndian32()},readInt64:function(){var t=this.readRawLittleEndian64(),e=new c.Int64LE(t);return e},readBytes:function(t){if(this.buffer.length-this.curPos<t)throw new Error("Read bytes encountered EOF.");var e=this.curPos;this.curPos+=t;var r=new n(t);return this.buffer.copy(r,0,e,this.curPos),r},readUtfString:function(t){if(this.buffer.length-this.curPos<t)throw new Error("Read UTF string encountered EOF.");var e=this.buffer.toString("utf8",this.curPos,this.curPos+t);return this.curPos+=t,e}}),u.PlainBufferOutputStream=o({constructor:function(t){this.buffer=new n(t),this.buffer.fill(0),this.capacity=t,this.pos=0},getBuffer:function(){return this.buffer},isFull:function(){return this.pos===this.capacity},count:function(){return this.pos},remain:function(){return this.capacity-this.pos},clear:function(){this.pos=0,this.buffer=[]},writeRawByte:function(t){if(this.isFull())throw new Error("The buffer is full");this.buffer[this.pos++]=t},writeRawLittleEndian32:function(t){this.writeRawByte(t&255),this.writeRawByte(t>>8&255),this.writeRawByte(t>>16&255),this.writeRawByte(t>>24&255)},writeRawLittleEndian64:function(t){for(var e=0;e<t.length;e++){var r=t[e]>127?t[e]-256:t[e];this.writeRawByte(r&255)}},writeInt64LE:function(t){var e=t.toBuffer();this.writeRawLittleEndian64(e)},writeDouble:function(t){var e=u.util.Int64.doubleToRawLongBits(t);this.writeRawLittleEndian64(e.toBuffer())},writeBoolean:function(t){t?this.writeRawByte(1):this.writeRawByte(0)},writeBytes:function(t){var e=null;if(t instanceof n?e=t:typeof t=="string"&&(e=new n(t)),this.pos+e.length>this.capacity)throw Error("The buffer is full.");if(t instanceof n)t.copy(this.buffer,this.pos);else if(typeof t=="string")this.buffer.write(t,this.pos);else throw new Error("expect Buffer or string,but it was:"+typeof t);this.pos+=e.length}}),plain_buffer_stream}var plain_buffer_coded_stream={},hasRequiredPlain_buffer_coded_stream;function requirePlain_buffer_coded_stream(){if(hasRequiredPlain_buffer_coded_stream)return plain_buffer_coded_stream;hasRequiredPlain_buffer_coded_stream=1;var u=requireCore(),c=int64Buffer,n=u.util.inherit;return u.PlainBufferCodedInputStream=n({constructor:function(o){this.inputStream=o},readTag:function(){return this.inputStream.readTag()},checkLastTagWas:function(o){return this.inputStream.checkLastTagWas(o)},getLastTag:function(){return this.inputStream.getLastTag()},readHeader:function(){return this.inputStream.readInt32()},readPrimaryKeyValue:function(o){if(!this.checkLastTagWas(u.plainBufferConsts.TAG_CELL_VALUE))throw new Error("Expect TAG_CELL_VALUE but it was"+this.getLastTag());this.inputStream.readRawLittleEndian32();var t=this.inputStream.readRawByte(),e=void 0;if(t===u.plainBufferConsts.VT_INTEGER){var r=this.inputStream.readInt64();o=u.plainBufferCrc8.crcInt8(o,u.plainBufferConsts.VT_INTEGER),o=u.plainBufferCrc8.crcInt64Buf(o,r.toBuffer()),this.readTag(),e=r}else if(t===u.plainBufferConsts.VT_STRING){var i=this.inputStream.readInt32(),l=this.inputStream.readUtfString(i);o=u.plainBufferCrc8.crcInt8(o,u.plainBufferConsts.VT_STRING),o=u.plainBufferCrc8.crcInt32(o,i),o=u.plainBufferCrc8.crcString(o,l),this.readTag(),e=l}else if(t===u.plainBufferConsts.VT_BLOB){var i=this.inputStream.readInt32(),a=this.inputStream.readBytes(i);o=u.plainBufferCrc8.crcInt8(o,u.plainBufferConsts.VT_BLOB),o=u.plainBufferCrc8.crcInt32(o,i),o=u.plainBufferCrc8.crcString(o,a),this.readTag(),e=a}else throw new Error("Unsupported primary key type"+t);return{pkVal:e,cellCheckSum:o}},readColumnValue:function(o){if(!this.checkLastTagWas(u.plainBufferConsts.TAG_CELL_VALUE))throw new Error("Expect TAG_CELL_VALUE but it was"+this.getLastTag());var t=void 0;this.inputStream.readRawLittleEndian32();var e=this.inputStream.readRawByte();if(e==u.plainBufferConsts.VT_INTEGER){var r=this.inputStream.readInt64();o=u.plainBufferCrc8.crcInt8(o,u.plainBufferConsts.VT_INTEGER),o=u.plainBufferCrc8.crcInt64Buf(o,r.toBuffer()),this.readTag(),t=r}else if(e==u.plainBufferConsts.VT_STRING){var i=this.inputStream.readInt32(),l=this.inputStream.readUtfString(i);o=u.plainBufferCrc8.crcInt8(o,u.plainBufferConsts.VT_STRING),o=u.plainBufferCrc8.crcInt32(o,i),o=u.plainBufferCrc8.crcString(o,l),this.readTag(),t=l}else if(e==u.plainBufferConsts.VT_BLOB){var i=this.inputStream.readInt32(),a=this.inputStream.readBytes(i);o=u.plainBufferCrc8.crcInt8(o,u.plainBufferConsts.VT_BLOB),o=u.plainBufferCrc8.crcInt32(o,i),o=u.plainBufferCrc8.crcString(o,a),this.readTag(),t=a}else if(e==u.plainBufferConsts.VT_BOOLEAN){var f=this.inputStream.readBoolean(),o=u.plainBufferCrc8.crcInt8(o,u.plainBufferConsts.VT_BOOLEAN),s=f==!0;o=u.plainBufferCrc8.crcInt8(o,s),this.readTag(),t=f}else if(e==u.plainBufferConsts.VT_DOUBLE){var d=this.inputStream.readDoubleAndInt64(),r=d.int64LE,O=d.doubleVal;o=u.plainBufferCrc8.crcInt8(o,u.plainBufferConsts.VT_DOUBLE),o=u.plainBufferCrc8.crcInt64Buf(o,r.toBuffer()),this.readTag(),t=O}else throw new Error("Unsupported column type: "+e);return{columnVal:t,cellCheckSum:o}},readSearchVariant:function(){let o=this.inputStream.readRawByte();if(o===u.plainBufferConsts.VT_INTEGER)return this.inputStream.readInt64();if(o===u.plainBufferConsts.VT_STRING){let t=this.inputStream.readInt32();return this.inputStream.readUtfString(t)}else{if(o===u.plainBufferConsts.VT_BOOLEAN)return this.inputStream.readBoolean();if(o===u.plainBufferConsts.VT_DOUBLE)return this.inputStream.readDoubleAndInt64().doubleVal;throw new Error("Unsupported SearchVariant type: "+o)}},readPrimaryKeyColumn:function(f){if(!this.checkLastTagWas(u.plainBufferConsts.TAG_CELL))throw new Error("Expect TAG_CELL but it was "+this.getLastTag());if(this.readTag(),!this.checkLastTagWas(u.plainBufferConsts.TAG_CELL_NAME))throw new Error("Expect TAG_CELL_NAME but it was "+this.getLastTag());var i=0,t=this.inputStream.readRawLittleEndian32(),e=this.inputStream.readUtfString(t),i=u.plainBufferCrc8.crcString(i,e);if(this.readTag(),!this.checkLastTagWas(u.plainBufferConsts.TAG_CELL_VALUE))throw new Error("Expect TAG_CELL_VALUE but it was "+this.getLastTag());var r,i,l=this.readPrimaryKeyValue(i);if(r=l.pkVal,i=l.cellCheckSum,this.getLastTag()==u.plainBufferConsts.TAG_CELL_CHECKSUM){var a=this.inputStream.readRawByte();if(a!=i)throw new Error("Checksum mismatch. expected:"+a+",actual:"+i);this.readTag()}else throw new Error("Expect TAG_CELL_CHECKSUM but it was "+this.getLastTag());var f=u.plainBufferCrc8.crcInt8(f,i);return{columnName:e,primaryKeyValue:r,rowCheckSum:f}},readColumn:function(d){if(!this.checkLastTagWas(u.plainBufferConsts.TAG_CELL))throw new Error("Expect TAG_CELL but it was "+this.getLastTag());if(this.readTag(),!this.checkLastTagWas(u.plainBufferConsts.TAG_CELL_NAME))throw new Error("Expect TAG_CELL_NAME but it was "+this.getLastTag());var l=0,i=null,t=null,e=null,r=this.inputStream.readRawLittleEndian32(),i=this.inputStream.readUtfString(r),l=u.plainBufferCrc8.crcString(l,i);if(this.readTag(),this.getLastTag()==u.plainBufferConsts.TAG_CELL_VALUE){var a=this.readColumnValue(l);t=a.columnVal,l=a.cellCheckSum}if(this.getLastTag()==u.plainBufferConsts.TAG_CELL_TYPE&&(cell_type=u.plainBufferCrc8.crcInt8(l,cell_type),this.readTag()),this.getLastTag()==u.plainBufferConsts.TAG_CELL_TIMESTAMP){var f=this.inputStream.readInt64();e=f,l=u.plainBufferCrc8.crcInt64Buf(l,f.toBuffer()),this.readTag()}if(this.getLastTag()==u.plainBufferConsts.TAG_CELL_CHECKSUM){var s=this.inputStream.readRawByte();if(s!=l)throw new Error("Checksum mismatch.");this.readTag()}else throw new Error("Expect TAG_CELL_CHECKSUM but it was "+this.getLastTag());var d=u.plainBufferCrc8.crcInt8(d,l);return{columnName:i,columnValue:t,timestamp:e,rowCheckSum:d}},readRowWithoutHeader:function(){var o=0,t=[],e=[];if(this.checkLastTagWas(u.plainBufferConsts.TAG_ROW_PK))for(this.readTag();this.checkLastTagWas(u.plainBufferConsts.TAG_CELL);){var r=this.readPrimaryKeyColumn(o);t.push({name:r.columnName,value:r.primaryKeyValue}),o=r.rowCheckSum}if(this.checkLastTagWas(u.plainBufferConsts.TAG_ROW_DATA))for(this.readTag();this.checkLastTagWas(u.plainBufferConsts.TAG_CELL);){var i=this.readColumn(o);e.push({columnName:i.columnName,columnValue:i.columnValue,timestamp:i.timestamp}),o=i.rowCheckSum}if(this.checkLastTagWas(u.plainBufferConsts.TAG_DELETE_ROW_MARKER)?(this.readTag(),o=u.plainBufferCrc8.crcInt8(o,1)):o=u.plainBufferCrc8.crcInt8(o,0),this.checkLastTagWas(u.plainBufferConsts.TAG_ROW_CHECKSUM)){var l=this.inputStream.readRawByte();if(l!=o)throw new Error("Checksum is mismatch.");this.readTag()}else throw new Error("Expect TAG_ROW_CHECKSUM but it was "+this.getLastTag());return{primaryKey:t,attributes:e}},readRow:function(){if(this.readHeader()!=u.plainBufferConsts.HEADER)throw new Error("Invalid header from plain buffer.");return this.readTag(),this.readRowWithoutHeader()},readRows:function(){if(this.readHeader()!=u.plainBufferConsts.HEADER)throw new Error("Invalid header from plain buffer.");this.readTag();for(var o=[];!this.inputStream.isAtEnd();){var t=this.readRowWithoutHeader();o.push({primaryKey:t.primaryKey,attributes:t.attributes})}return o}}),u.PlainBufferCodedOutputStream=n({constructor:function(o){this.outputStream=o},writeHeader:function(){this.outputStream.writeRawLittleEndian32(u.plainBufferConsts.HEADER)},writeTag:function(o){this.outputStream.writeRawByte(o)},writeCellName:function(o,t){return this.writeTag(u.plainBufferConsts.TAG_CELL_NAME),this.outputStream.writeRawLittleEndian32(o.length),this.outputStream.writeBytes(o),t=u.plainBufferCrc8.crcString(t,o),t},writePrimaryKeyValue:function(o,t){if(this.writeTag(u.plainBufferConsts.TAG_CELL_VALUE),o===u.INF_MIN)this.outputStream.writeRawLittleEndian32(1),this.outputStream.writeRawByte(u.plainBufferConsts.VT_INF_MIN),t=u.plainBufferCrc8.crcInt8(t,u.plainBufferConsts.VT_INF_MIN);else if(o===u.INF_MAX)this.outputStream.writeRawLittleEndian32(1),this.outputStream.writeRawByte(u.plainBufferConsts.VT_INF_MAX),t=u.plainBufferCrc8.crcInt8(t,u.plainBufferConsts.VT_INF_MAX);else if(o===u.PK_AUTO_INCR)this.outputStream.writeRawLittleEndian32(1),this.outputStream.writeRawByte(u.plainBufferConsts.VT_AUTO_INCREMENT),t=u.plainBufferCrc8.crcInt8(t,u.plainBufferConsts.VT_AUTO_INCREMENT);else if(o instanceof c.Int64LE)this.outputStream.writeRawLittleEndian32(1+u.plainBufferConsts.LITTLE_ENDIAN_64_SIZE),this.outputStream.writeRawByte(u.plainBufferConsts.VT_INTEGER),this.outputStream.writeInt64LE(o),t=u.plainBufferCrc8.crcInt8(t,u.plainBufferConsts.VT_INTEGER),t=u.plainBufferCrc8.crcInt64Buf(t,o.toBuffer());else if(typeof o=="string"){var e=o,r=u.util.string.byteLength(e),i=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE+1;this.outputStream.writeRawLittleEndian32(i+r),this.outputStream.writeRawByte(u.plainBufferConsts.VT_STRING),this.outputStream.writeRawLittleEndian32(r),this.outputStream.writeBytes(e),t=u.plainBufferCrc8.crcInt8(t,u.plainBufferConsts.VT_STRING),t=u.plainBufferCrc8.crcInt32(t,r),t=u.plainBufferCrc8.crcString(t,e)}else if(o instanceof Buffer){var l=o,i=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE+1;this.outputStream.writeRawLittleEndian32(i+l.length),this.outputStream.writeRawByte(u.plainBufferConsts.VT_BLOB),this.outputStream.writeRawLittleEndian32(l.length),this.outputStream.writeBytes(l),t=u.plainBufferCrc8.crcInt8(t,u.plainBufferConsts.VT_BLOB),t=u.plainBufferCrc8.crcInt32(t,l.length),t=u.plainBufferCrc8.crcString(t,l)}else throw new Error("Unsupported primary key type: "+typeof o);return t},writeColumnValueWithChecksum:function(o,t){if(this.writeTag(u.plainBufferConsts.TAG_CELL_VALUE),o instanceof c.Int64LE)this.outputStream.writeRawLittleEndian32(1+u.plainBufferConsts.LITTLE_ENDIAN_64_SIZE),this.outputStream.writeRawByte(u.plainBufferConsts.VT_INTEGER),this.outputStream.writeInt64LE(o),t=u.plainBufferCrc8.crcInt8(t,u.plainBufferConsts.VT_INTEGER),t=u.plainBufferCrc8.crcInt64Buf(t,o.toBuffer());else if(typeof o=="string"){var e=u.util.string.byteLength(o),r=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE+1;this.outputStream.writeRawLittleEndian32(r+e),this.outputStream.writeRawByte(u.plainBufferConsts.VT_STRING),this.outputStream.writeRawLittleEndian32(e),this.outputStream.writeBytes(o),t=u.plainBufferCrc8.crcInt8(t,u.plainBufferConsts.VT_STRING),t=u.plainBufferCrc8.crcInt32(t,e),t=u.plainBufferCrc8.crcString(t,o)}else if(o instanceof Buffer)r=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE+1,this.outputStream.writeRawLittleEndian32(r+o.length),this.outputStream.writeRawByte(u.plainBufferConsts.VT_BLOB),this.outputStream.writeRawLittleEndian32(o.length),this.outputStream.writeBytes(o),t=u.plainBufferCrc8.crcInt8(t,u.plainBufferConsts.VT_BLOB),t=u.plainBufferCrc8.crcInt32(t,o.length),t=u.plainBufferCrc8.crcString(t,o);else if(typeof o=="boolean")this.outputStream.writeRawLittleEndian32(2),this.outputStream.writeRawByte(u.plainBufferConsts.VT_BOOLEAN),this.outputStream.writeBoolean(o),t=u.plainBufferCrc8.crcInt8(t,u.plainBufferConsts.VT_BOOLEAN),o?t=u.plainBufferCrc8.crcInt8(t,1):t=u.plainBufferCrc8.crcInt8(t,0);else if(typeof o=="number"){var i=u.util.Int64.doubleToRawLongBits(o);this.outputStream.writeRawLittleEndian32(1+u.plainBufferConsts.LITTLE_ENDIAN_64_SIZE),this.outputStream.writeRawByte(u.plainBufferConsts.VT_DOUBLE),this.outputStream.writeDouble(o),t=u.plainBufferCrc8.crcInt8(t,u.plainBufferConsts.VT_DOUBLE),t=u.plainBufferCrc8.crcInt64Buf(t,i.toBuffer())}else throw new Error("Unsupported column type "+typeof o);return t},writeColumnValue:function(o){if(o instanceof c.Int64LE)this.outputStream.writeRawByte(u.plainBufferConsts.VT_INTEGER),this.outputStream.writeInt64LE(o);else if(typeof o=="string")this.outputStream.writeRawByte(u.plainBufferConsts.VT_STRING),this.outputStream.writeRawLittleEndian32(u.util.string.byteLength(o)),this.outputStream.writeBytes(o);else if(o instanceof Buffer)this.outputStream.writeRawByte(u.plainBufferConsts.VT_BLOB),this.outputStream.writeRawLittleEndian32(o.length),this.outputStream.writeBytes(o);else if(typeof o=="boolean")this.outputStream.writeRawByte(u.plainBufferConsts.VT_BOOLEAN),this.outputStream.writeBoolean(o);else if(typeof o=="number")this.outputStream.writeRawByte(u.plainBufferConsts.VT_DOUBLE),this.outputStream.writeDouble(o);else throw new Error("Unsupported column type: "+typeof o)},writePrimaryKeyColumn:function(o,t,e){var r=0;return this.writeTag(u.plainBufferConsts.TAG_CELL),r=this.writeCellName(o,r),r=this.writePrimaryKeyValue(t,r),this.writeTag(u.plainBufferConsts.TAG_CELL_CHECKSUM),this.outputStream.writeRawByte(r),e=u.plainBufferCrc8.crcInt8(e,r),e},writeColumn:function(o,t,e,r){var i=0;if(this.writeTag(u.plainBufferConsts.TAG_CELL),i=this.writeCellName(o,i),i=this.writeColumnValueWithChecksum(t,i),e!=null){this.writeTag(u.plainBufferConsts.TAG_CELL_TIMESTAMP);var l=u.Long.fromNumber(e);this.outputStream.writeInt64LE(l),i=u.plainBufferCrc8.crcInt64Buf(i,l.toBuffer())}return this.writeTag(u.plainBufferConsts.TAG_CELL_CHECKSUM),this.outputStream.writeRawByte(i),r=u.plainBufferCrc8.crcInt8(r,i),r},writeUpdateColumn:function(o,t,e,r){var i=0;this.writeTag(u.plainBufferConsts.TAG_CELL);var i=this.writeCellName(t,i),l=null;if(e!=null&&(e instanceof Array?(e[0]!=null&&(i=this.writeColumnValueWithChecksum(e[0],i)),e[1]!=null&&(l=e[1])):i=this.writeColumnValueWithChecksum(e,i)),o===u.UpdateType.DELETE?(this.writeTag(u.plainBufferConsts.TAG_CELL_TYPE),this.outputStream.writeRawByte(u.plainBufferConsts.DELETE_ONE_VERSION)):o==u.UpdateType.DELETE_ALL?(this.writeTag(u.plainBufferConsts.TAG_CELL_TYPE),this.outputStream.writeRawByte(u.plainBufferConsts.DELETE_ALL_VERSION)):o==u.UpdateType.INCREMENT&&(this.writeTag(u.plainBufferConsts.TAG_CELL_TYPE),this.outputStream.writeRawByte(u.plainBufferConsts.INCREMENT)),l!=null){this.writeTag(u.plainBufferConsts.TAG_CELL_TIMESTAMP);var a=u.Long.fromNumber(l);this.outputStream.writeInt64LE(a)}if(l!=null){var a=u.Long.fromNumber(l);i=u.plainBufferCrc8.crcInt64Buf(i,a.toBuffer())}return o===u.UpdateType.DELETE&&(i=u.plainBufferCrc8.crcInt8(i,u.plainBufferConsts.DELETE_ONE_VERSION)),o===u.UpdateType.DELETE_ALL&&(i=u.plainBufferCrc8.crcInt8(i,u.plainBufferConsts.DELETE_ALL_VERSION)),o===u.UpdateType.INCREMENT&&(i=u.plainBufferCrc8.crcInt8(i,u.plainBufferConsts.INCREMENT)),this.writeTag(u.plainBufferConsts.TAG_CELL_CHECKSUM),this.outputStream.writeRawByte(i),r=u.plainBufferCrc8.crcInt8(r,i),r},writePrimaryKey:function(o,t){if(!(o instanceof Array))throw new Error("Invalid primaryKey, the type of primaryKey should be array.");this.writeTag(u.plainBufferConsts.TAG_ROW_PK);for(var e=0;e<o.length;e++)for(var r in o[e])t=this.writePrimaryKeyColumn(r,o[e][r],t);return t},writeColumns:function(o,t){if(!(o instanceof Array))throw new Error("Invalid attributeColumns, the type of attributeColumns should be array.");if(o!=null&&o.length!=0){this.writeTag(u.plainBufferConsts.TAG_ROW_DATA);for(var e=0;e<o.length;e++)for(var r in o[e]){t=this.writeColumn(r,o[e][r],o[e].timestamp,t);break}}return t},writeUpdateColumns:function(o,t){if(!(o instanceof Array))throw new Error("Invalid attributeColumns, the type of attributeColumns should be array.");if(o.length==0)return t;this.writeTag(u.plainBufferConsts.TAG_ROW_DATA);for(var e=0;e<o.length;e++)for(var r in o[e]){var i=o[e][r];for(var l in i)if(u.UpdateType.DELETE_ALL===r)t=this.writeUpdateColumn(r,i[l],null,t);else if(u.UpdateType.DELETE===r)for(var a in i[l])t=this.writeUpdateColumn(r,a,[null,i[l][a]],t);else if(u.UpdateType.PUT===r)if(i[l].timestamp!==void 0)for(var a in i[l]){t=this.writeUpdateColumn(r,a,[i[l][a],i[l].timestamp],t);break}else for(var a in i[l]){t=this.writeUpdateColumn(r,a,i[l][a],t);break}else if(u.UpdateType.INCREMENT===r)if(i[l].timestamp!==void 0)for(var a in i[l]){t=this.writeUpdateColumn(r,a,[i[l][a],i[l].timestamp],t);break}else for(var a in i[l]){t=this.writeUpdateColumn(r,a,i[l][a],t);break}}return t},writeDeleteMarker:function(o){return this.writeTag(u.plainBufferConsts.TAG_DELETE_ROW_MARKER),u.plainBufferCrc8.crcInt8(o,1)},writeRowChecksum:function(o){this.writeTag(u.plainBufferConsts.TAG_ROW_CHECKSUM),this.outputStream.writeRawByte(o)},writeSearchValue:function(o){if(o instanceof c.Int64LE)this.outputStream.writeRawByte(u.plainBufferConsts.VT_INTEGER),this.outputStream.writeInt64LE(o);else if(typeof o=="string")this.outputStream.writeRawByte(u.plainBufferConsts.VT_STRING),this.outputStream.writeRawLittleEndian32(u.util.string.byteLength(o)),this.outputStream.writeBytes(o);else if(typeof o=="boolean")this.outputStream.writeRawByte(u.plainBufferConsts.VT_BOOLEAN),this.outputStream.writeBoolean(o);else if(typeof o=="number")this.outputStream.writeRawByte(u.plainBufferConsts.VT_DOUBLE),this.outputStream.writeDouble(o);else throw new Error("Unsupported column type: "+typeof o)}}),plain_buffer_coded_stream}var plian_buffer_builder={},hasRequiredPlian_buffer_builder;function requirePlian_buffer_builder(){if(hasRequiredPlian_buffer_builder)return plian_buffer_builder;hasRequiredPlian_buffer_builder=1;var u=requireCore(),c=int64Buffer;return u.PlainBufferBuilder={computePrimaryKeyValueSize:function(n){var o=1;if(o+=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE+1,n===u.INF_MIN||n===u.INF_MAX||n===u.PK_AUTO_INCR)return o+=1,o;if(n instanceof c.Int64LE)o+=8;else if(typeof n=="string")o+=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE,o+=u.util.string.byteLength(n);else if(n instanceof Buffer)o+=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE,o+=n.length;else throw new Error("Unsupported primary key type:"+typeof n);return o},computeVariantValueSize:function(n){return this.computePrimaryKeyValueSize(n)-u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE-1},computePrimaryKeyColumnSize:function(n,o){var t=1;return t+=1+u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE,t+=n.length,t+=this.computePrimaryKeyValueSize(o),t+=2,t},computeColumnValueSize:function(n){var o=1;if(o+=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE+1,typeof n=="number")o+=u.plainBufferConsts.LITTLE_ENDIAN_64_SIZE;else if(typeof n=="string")o+=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE,o+=u.util.string.byteLength(n);else if(n instanceof Buffer)o+=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE,o+=n.length;else if(typeof n=="boolean")o+=1;else if(n instanceof c.Int64LE)o+=u.plainBufferConsts.LITTLE_ENDIAN_64_SIZE;else throw new Error("Unsupported column type: "+typeof n);return o},computeVariantValueSize:function(n){return this.computeColumnValueSize(n)-u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE-1},computeColumnSize:function(n,o,t){var e=1;return e+=1+u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE,e+=u.util.string.byteLength(n),o!==null&&(e+=this.computeColumnValueSize(o)),t!==void 0&&(e+=1+u.plainBufferConsts.LITTLE_ENDIAN_64_SIZE),e+=2,e},computeUpdateColumnSize:function(n,o,t){var e=this.computeColumnSize(n,o);return(t===u.UpdateType.DELETE||t===u.UpdateType.DELETE_ALL||t===u.UpdateType.INCREMENT)&&(e+=2),e},computePrimaryKeySize:function(n){for(var o=1,t=0;t<n.length;t++)for(key in n[t])o+=this.computePrimaryKeyColumnSize(key,n[t][key]);return o},computePutRowSize:function(n,o){var t=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE;if(t+=this.computePrimaryKeySize(n),o&&o.length!=0){t+=1;for(var e=0;e<o.length;e++)if(o[e].timestamp===void 0)for(var r in o[e])t+=this.computeColumnSize(r,o[e][r]);else for(var r in o[e]){t+=this.computeColumnSize(r,o[e][r],o[e].timestamp);break}}return t+=2,t},computeUpdateRowSize:function(n,o){var t=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE;if(t+=this.computePrimaryKeySize(n),o.length!=0){t+=1;for(var e=0;e<o.length;e++)for(var r in o[e]){var i=o[e][r];if(!i instanceof Array)throw new Error("Unsupported column type:"+typeof i);for(var l in i)if(r===u.UpdateType.DELETE_ALL)t+=this.computeUpdateColumnSize(i[l],null,r);else if(r===u.UpdateType.PUT||r===u.UpdateType.DELETE||r===u.UpdateType.INCREMENT)for(var a in i[l])t+=this.computeUpdateColumnSize(a,i[l][a],r);else throw new Error("Expect TableStore.UpdateType but it was:"+r);break}}return t+=2,t},computeDeleteRowSize:function(n){return size=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE,size+=this.computePrimaryKeySize(n),size+=3,size},serializePrimaryKeyValue:function(n){var o=this.computeVariantValueSize(n),t=new u.PlainBufferOutputStream(o),e=new u.PlainBufferCodedOutputStream(t);return e.writePrimaryKeyValue(n),t.getBuffer()},serializeColumnValue:function(n){var o=this.computeVariantValueSize(n),t=new u.PlainBufferOutputStream(o),e=new u.PlainBufferCodedOutputStream(t);return e.writeColumnValue(n),t.getBuffer()},serializePrimaryKey:function(n){var o=u.plainBufferConsts.LITTLE_ENDIAN_32_SIZE;o+=this.computePrimaryKeySize(n),o+=2;var t=new u.PlainBufferOutputStream(o),e=new u.PlainBufferCodedOutputStream(t),r=0;return e.writeHeader(),r=e.writePrimaryKey(n,r),r=u.plainBufferCrc8.crcInt8(r,0),e.writeRowChecksum(r),t.getBuffer()},serializeForPutRow:function(n,o){var t=this.computePutRowSize(n,o),e=new u.PlainBufferOutputStream(t),r=new u.PlainBufferCodedOutputStream(e),i=0;return r.writeHeader(),i=r.writePrimaryKey(n,i),i=r.writeColumns(o,i),i=u.plainBufferCrc8.crcInt8(i,0),r.writeRowChecksum(i),e.getBuffer()},serializeForUpdateRow:function(n,o){var t=this.computeUpdateRowSize(n,o),e=new u.PlainBufferOutputStream(t),r=new u.PlainBufferCodedOutputStream(e),i=0;return r.writeHeader(),i=r.writePrimaryKey(n,i),i=r.writeUpdateColumns(o,i),i=u.plainBufferCrc8.crcInt8(i,0),r.writeRowChecksum(i),e.getBuffer()},serializeForDeleteRow:function(n){var o=this.computeDeleteRowSize(n),t=new u.PlainBufferOutputStream(o),e=new u.PlainBufferCodedOutputStream(t),r=0;return e.writeHeader(),r=e.writePrimaryKey(n,r),r=e.writeDeleteMarker(r),e.writeRowChecksum(r),t.getBuffer()},serializeSearchValue:function(n,o){if(n==null)throw new Error("Expect ["+o+"] but it was: "+n);var t=this.computeVariantValueSize(n),e=new u.PlainBufferOutputStream(t),r=new u.PlainBufferCodedOutputStream(e);return r.writeSearchValue(n),e.getBuffer()}},plian_buffer_builder}var filter={},indexMinimal={},minimal$1={},aspromise=asPromise;function asPromise(u,c){for(var n=new Array(arguments.length-1),o=0,t=2,e=!0;t<arguments.length;)n[o++]=arguments[t++];return new Promise(function(i,l){n[o]=function(f){if(e)if(e=!1,f)l(f);else{for(var s=new Array(arguments.length-1),d=0;d<s.length;)s[d++]=arguments[d];i.apply(null,s)}};try{u.apply(c||null,n)}catch(a){e&&(e=!1,l(a))}})}var base64$1={};(function(u){var c=u;c.length=function(i){var l=i.length;if(!l)return 0;for(var a=0;--l%4>1&&i.charAt(l)==="=";)++a;return Math.ceil(i.length*3)/4-a};for(var n=new Array(64),o=new Array(123),t=0;t<64;)o[n[t]=t<26?t+65:t<52?t+71:t<62?t-4:t-59|43]=t++;c.encode=function(i,l,a){for(var f=null,s=[],d=0,O=0,b;l<a;){var w=i[l++];switch(O){case 0:s[d++]=n[w>>2],b=(w&3)<<4,O=1;break;case 1:s[d++]=n[b|w>>4],b=(w&15)<<2,O=2;break;case 2:s[d++]=n[b|w>>6],s[d++]=n[w&63],O=0;break}d>8191&&((f||(f=[])).push(String.fromCharCode.apply(String,s)),d=0)}return O&&(s[d++]=n[b],s[d++]=61,O===1&&(s[d++]=61)),f?(d&&f.push(String.fromCharCode.apply(String,s.slice(0,d))),f.join("")):String.fromCharCode.apply(String,s.slice(0,d))};var e="invalid encoding";c.decode=function(i,l,a){for(var f=a,s=0,d,O=0;O<i.length;){var b=i.charCodeAt(O++);if(b===61&&s>1)break;if((b=o[b])===void 0)throw Error(e);switch(s){case 0:d=b,s=1;break;case 1:l[a++]=d<<2|(b&48)>>4,d=b,s=2;break;case 2:l[a++]=(d&15)<<4|(b&60)>>2,d=b,s=3;break;case 3:l[a++]=(d&3)<<6|b,s=0;break}}if(s===1)throw Error(e);return a-f},c.test=function(i){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(i)}})(base64$1);var eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(c,n,o){return(this._listeners[c]||(this._listeners[c]=[])).push({fn:n,ctx:o||this}),this};EventEmitter.prototype.off=function(c,n){if(c===void 0)this._listeners={};else if(n===void 0)this._listeners[c]=[];else for(var o=this._listeners[c],t=0;t<o.length;)o[t].fn===n?o.splice(t,1):++t;return this};EventEmitter.prototype.emit=function(c){var n=this._listeners[c];if(n){for(var o=[],t=1;t<arguments.length;)o.push(arguments[t++]);for(t=0;t<n.length;)n[t].fn.apply(n[t++].ctx,o)}return this};var float=factory$1(factory$1);function factory$1(u){return typeof Float32Array<"u"?function(){var c=new Float32Array([-0]),n=new Uint8Array(c.buffer),o=n[3]===128;function t(l,a,f){c[0]=l,a[f]=n[0],a[f+1]=n[1],a[f+2]=n[2],a[f+3]=n[3]}function e(l,a,f){c[0]=l,a[f]=n[3],a[f+1]=n[2],a[f+2]=n[1],a[f+3]=n[0]}u.writeFloatLE=o?t:e,u.writeFloatBE=o?e:t;function r(l,a){return n[0]=l[a],n[1]=l[a+1],n[2]=l[a+2],n[3]=l[a+3],c[0]}function i(l,a){return n[3]=l[a],n[2]=l[a+1],n[1]=l[a+2],n[0]=l[a+3],c[0]}u.readFloatLE=o?r:i,u.readFloatBE=o?i:r}():function(){function c(o,t,e,r){var i=t<0?1:0;if(i&&(t=-t),t===0)o(1/t>0?0:2147483648,e,r);else if(isNaN(t))o(2143289344,e,r);else if(t>34028234663852886e22)o((i<<31|2139095040)>>>0,e,r);else if(t<11754943508222875e-54)o((i<<31|Math.round(t/1401298464324817e-60))>>>0,e,r);else{var l=Math.floor(Math.log(t)/Math.LN2),a=Math.round(t*Math.pow(2,-l)*8388608)&8388607;o((i<<31|l+127<<23|a)>>>0,e,r)}}u.writeFloatLE=c.bind(null,writeUintLE),u.writeFloatBE=c.bind(null,writeUintBE);function n(o,t,e){var r=o(t,e),i=(r>>31)*2+1,l=r>>>23&255,a=r&8388607;return l===255?a?NaN:i*(1/0):l===0?i*1401298464324817e-60*a:i*Math.pow(2,l-150)*(a+8388608)}u.readFloatLE=n.bind(null,readUintLE),u.readFloatBE=n.bind(null,readUintBE)}(),typeof Float64Array<"u"?function(){var c=new Float64Array([-0]),n=new Uint8Array(c.buffer),o=n[7]===128;function t(l,a,f){c[0]=l,a[f]=n[0],a[f+1]=n[1],a[f+2]=n[2],a[f+3]=n[3],a[f+4]=n[4],a[f+5]=n[5],a[f+6]=n[6],a[f+7]=n[7]}function e(l,a,f){c[0]=l,a[f]=n[7],a[f+1]=n[6],a[f+2]=n[5],a[f+3]=n[4],a[f+4]=n[3],a[f+5]=n[2],a[f+6]=n[1],a[f+7]=n[0]}u.writeDoubleLE=o?t:e,u.writeDoubleBE=o?e:t;function r(l,a){return n[0]=l[a],n[1]=l[a+1],n[2]=l[a+2],n[3]=l[a+3],n[4]=l[a+4],n[5]=l[a+5],n[6]=l[a+6],n[7]=l[a+7],c[0]}function i(l,a){return n[7]=l[a],n[6]=l[a+1],n[5]=l[a+2],n[4]=l[a+3],n[3]=l[a+4],n[2]=l[a+5],n[1]=l[a+6],n[0]=l[a+7],c[0]}u.readDoubleLE=o?r:i,u.readDoubleBE=o?i:r}():function(){function c(o,t,e,r,i,l){var a=r<0?1:0;if(a&&(r=-r),r===0)o(0,i,l+t),o(1/r>0?0:2147483648,i,l+e);else if(isNaN(r))o(0,i,l+t),o(2146959360,i,l+e);else if(r>17976931348623157e292)o(0,i,l+t),o((a<<31|2146435072)>>>0,i,l+e);else{var f;if(r<22250738585072014e-324)f=r/5e-324,o(f>>>0,i,l+t),o((a<<31|f/4294967296)>>>0,i,l+e);else{var s=Math.floor(Math.log(r)/Math.LN2);s===1024&&(s=1023),f=r*Math.pow(2,-s),o(f*4503599627370496>>>0,i,l+t),o((a<<31|s+1023<<20|f*1048576&1048575)>>>0,i,l+e)}}}u.writeDoubleLE=c.bind(null,writeUintLE,0,4),u.writeDoubleBE=c.bind(null,writeUintBE,4,0);function n(o,t,e,r,i){var l=o(r,i+t),a=o(r,i+e),f=(a>>31)*2+1,s=a>>>20&2047,d=4294967296*(a&1048575)+l;return s===2047?d?NaN:f*(1/0):s===0?f*5e-324*d:f*Math.pow(2,s-1075)*(d+4503599627370496)}u.readDoubleLE=n.bind(null,readUintLE,0,4),u.readDoubleBE=n.bind(null,readUintBE,4,0)}(),u}function writeUintLE(u,c,n){c[n]=u&255,c[n+1]=u>>>8&255,c[n+2]=u>>>16&255,c[n+3]=u>>>24}function writeUintBE(u,c,n){c[n]=u>>>24,c[n+1]=u>>>16&255,c[n+2]=u>>>8&255,c[n+3]=u&255}function readUintLE(u,c){return(u[c]|u[c+1]<<8|u[c+2]<<16|u[c+3]<<24)>>>0}function readUintBE(u,c){return(u[c]<<24|u[c+1]<<16|u[c+2]<<8|u[c+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(u){}return null}var utf8$2={};(function(u){var c=u;c.length=function(o){for(var t=0,e=0,r=0;r<o.length;++r)e=o.charCodeAt(r),e<128?t+=1:e<2048?t+=2:(e&64512)===55296&&(o.charCodeAt(r+1)&64512)===56320?(++r,t+=4):t+=3;return t},c.read=function(o,t,e){var r=e-t;if(r<1)return"";for(var i=null,l=[],a=0,f;t<e;)f=o[t++],f<128?l[a++]=f:f>191&&f<224?l[a++]=(f&31)<<6|o[t++]&63:f>239&&f<365?(f=((f&7)<<18|(o[t++]&63)<<12|(o[t++]&63)<<6|o[t++]&63)-65536,l[a++]=55296+(f>>10),l[a++]=56320+(f&1023)):l[a++]=(f&15)<<12|(o[t++]&63)<<6|o[t++]&63,a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,l)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,l.slice(0,a))),i.join("")):String.fromCharCode.apply(String,l.slice(0,a))},c.write=function(o,t,e){for(var r=e,i,l,a=0;a<o.length;++a)i=o.charCodeAt(a),i<128?t[e++]=i:i<2048?(t[e++]=i>>6|192,t[e++]=i&63|128):(i&64512)===55296&&((l=o.charCodeAt(a+1))&64512)===56320?(i=65536+((i&1023)<<10)+(l&1023),++a,t[e++]=i>>18|240,t[e++]=i>>12&63|128,t[e++]=i>>6&63|128,t[e++]=i&63|128):(t[e++]=i>>12|224,t[e++]=i>>6&63|128,t[e++]=i&63|128);return e-r}})(utf8$2);var pool_1=pool;function pool(u,c,n){var o=n||8192,t=o>>>1,e=null,r=o;return function(l){if(l<1||l>t)return u(l);r+l>o&&(e=u(o),r=0);var a=c.call(e,r,r+=l);return r&7&&(r=(r|7)+1),a}}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=c;var u=requireMinimal();function c(e,r){this.lo=e>>>0,this.hi=r>>>0}var n=c.zero=new c(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var o=c.zeroHash="\0\0\0\0\0\0\0\0";c.fromNumber=function(r){if(r===0)return n;var i=r<0;i&&(r=-r);var l=r>>>0,a=(r-l)/4294967296>>>0;return i&&(a=~a>>>0,l=~l>>>0,++l>4294967295&&(l=0,++a>4294967295&&(a=0))),new c(l,a)},c.from=function(r){if(typeof r=="number")return c.fromNumber(r);if(u.isString(r))if(u.Long)r=u.Long.fromString(r);else return c.fromNumber(parseInt(r,10));return r.low||r.high?new c(r.low>>>0,r.high>>>0):n},c.prototype.toNumber=function(r){if(!r&&this.hi>>>31){var i=~this.lo+1>>>0,l=~this.hi>>>0;return i||(l=l+1>>>0),-(i+l*4294967296)}return this.lo+this.hi*4294967296},c.prototype.toLong=function(r){return u.Long?new u.Long(this.lo|0,this.hi|0,!!r):{low:this.lo|0,high:this.hi|0,unsigned:!!r}};var t=String.prototype.charCodeAt;return c.fromHash=function(r){return r===o?n:new c((t.call(r,0)|t.call(r,1)<<8|t.call(r,2)<<16|t.call(r,3)<<24)>>>0,(t.call(r,4)|t.call(r,5)<<8|t.call(r,6)<<16|t.call(r,7)<<24)>>>0)},c.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},c.prototype.zzEncode=function(){var r=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^r)>>>0,this.lo=(this.lo<<1^r)>>>0,this},c.prototype.zzDecode=function(){var r=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^r)>>>0,this.hi=(this.hi>>>1^r)>>>0,this},c.prototype.length=function(){var r=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,l=this.hi>>>24;return l===0?i===0?r<16384?r<128?1:2:r<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:l<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(u){var c=u;c.asPromise=aspromise,c.base64=base64$1,c.EventEmitter=eventemitter,c.float=float,c.inquire=inquire_1,c.utf8=utf8$2,c.pool=pool_1,c.LongBits=requireLongbits(),c.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),c.global=c.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,c.emptyArray=Object.freeze?Object.freeze([]):[],c.emptyObject=Object.freeze?Object.freeze({}):{},c.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},c.isString=function(e){return typeof e=="string"||e instanceof String},c.isObject=function(e){return e&&typeof e=="object"},c.isset=c.isSet=function(e,r){var i=e[r];return i!=null&&e.hasOwnProperty(r)?typeof i!="object"||(Array.isArray(i)?i.length:Object.keys(i).length)>0:!1},c.Buffer=function(){try{var t=c.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch{return null}}(),c._Buffer_from=null,c._Buffer_allocUnsafe=null,c.newBuffer=function(e){return typeof e=="number"?c.Buffer?c._Buffer_allocUnsafe(e):new c.Array(e):c.Buffer?c._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)},c.Array=typeof Uint8Array<"u"?Uint8Array:Array,c.Long=c.global.dcodeIO&&c.global.dcodeIO.Long||c.global.Long||c.inquire("long"),c.key2Re=/^true|false|0|1$/,c.key32Re=/^-?(?:0|[1-9][0-9]*)$/,c.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,c.longToHash=function(e){return e?c.LongBits.from(e).toHash():c.LongBits.zeroHash},c.longFromHash=function(e,r){var i=c.LongBits.fromHash(e);return c.Long?c.Long.fromBits(i.lo,i.hi,r):i.toNumber(!!r)};function n(t,e,r){for(var i=Object.keys(e),l=0;l<i.length;++l)(t[i[l]]===void 0||!r)&&(t[i[l]]=e[i[l]]);return t}c.merge=n,c.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function o(t){function e(r,i){if(!(this instanceof e))return new e(r,i);Object.defineProperty(this,"message",{get:function(){return r}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),i&&n(this,i)}return(e.prototype=Object.create(Error.prototype)).constructor=e,Object.defineProperty(e.prototype,"name",{get:function(){return t}}),e.prototype.toString=function(){return this.name+": "+this.message},e}c.newError=o,c.ProtocolError=o("ProtocolError"),c.oneOfGetter=function(e){for(var r={},i=0;i<e.length;++i)r[e[i]]=1;return function(){for(var l=Object.keys(this),a=l.length-1;a>-1;--a)if(r[l[a]]===1&&this[l[a]]!==void 0&&this[l[a]]!==null)return l[a]}},c.oneOfSetter=function(e){return function(r){for(var i=0;i<e.length;++i)e[i]!==r&&delete this[e[i]]}},c.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},c._configure=function(){var t=c.Buffer;if(!t){c._Buffer_from=c._Buffer_allocUnsafe=null;return}c._Buffer_from=t.from!==Uint8Array.from&&t.from||function(r,i){return new t(r,i)},c._Buffer_allocUnsafe=t.allocUnsafe||function(r){return new t(r)}}}(minimal$1)),minimal$1}var writer=Writer$1,util$4=requireMinimal(),BufferWriter$1,LongBits$1=util$4.LongBits,base64=util$4.base64,utf8$1=util$4.utf8;function Op(u,c,n){this.fn=u,this.len=c,this.next=void 0,this.val=n}function noop(){}function State(u){this.head=u.head,this.tail=u.tail,this.len=u.len,this.next=u.states}function Writer$1(){this.len=0,this.head=new Op(noop,0,0),this.tail=this.head,this.states=null}var create$1=function u(){return util$4.Buffer?function(){return(Writer$1.create=function(){return new BufferWriter$1})()}:function(){return new Writer$1}};Writer$1.create=create$1();Writer$1.alloc=function u(c){return new util$4.Array(c)};util$4.Array!==Array&&(Writer$1.alloc=util$4.pool(Writer$1.alloc,util$4.Array.prototype.subarray));Writer$1.prototype._push=function u(c,n,o){return this.tail=this.tail.next=new Op(c,n,o),this.len+=n,this};function writeByte(u,c,n){c[n]=u&255}function writeVarint32(u,c,n){for(;u>127;)c[n++]=u&127|128,u>>>=7;c[n]=u}function VarintOp(u,c){this.len=u,this.next=void 0,this.val=c}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function u(c){return this.len+=(this.tail=this.tail.next=new VarintOp((c=c>>>0)<128?1:c<16384?2:c<2097152?3:c<268435456?4:5,c)).len,this};Writer$1.prototype.int32=function u(c){return c<0?this._push(writeVarint64,10,LongBits$1.fromNumber(c)):this.uint32(c)};Writer$1.prototype.sint32=function u(c){return this.uint32((c<<1^c>>31)>>>0)};function writeVarint64(u,c,n){for(;u.hi;)c[n++]=u.lo&127|128,u.lo=(u.lo>>>7|u.hi<<25)>>>0,u.hi>>>=7;for(;u.lo>127;)c[n++]=u.lo&127|128,u.lo=u.lo>>>7;c[n++]=u.lo}Writer$1.prototype.uint64=function u(c){var n=LongBits$1.from(c);return this._push(writeVarint64,n.length(),n)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function u(c){var n=LongBits$1.from(c).zzEncode();return this._push(writeVarint64,n.length(),n)};Writer$1.prototype.bool=function u(c){return this._push(writeByte,1,c?1:0)};function writeFixed32(u,c,n){c[n]=u&255,c[n+1]=u>>>8&255,c[n+2]=u>>>16&255,c[n+3]=u>>>24}Writer$1.prototype.fixed32=function u(c){return this._push(writeFixed32,4,c>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function u(c){var n=LongBits$1.from(c);return this._push(writeFixed32,4,n.lo)._push(writeFixed32,4,n.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function u(c){return this._push(util$4.float.writeFloatLE,4,c)};Writer$1.prototype.double=function u(c){return this._push(util$4.float.writeDoubleLE,8,c)};var writeBytes=util$4.Array.prototype.set?function u(c,n,o){n.set(c,o)}:function u(c,n,o){for(var t=0;t<c.length;++t)n[o+t]=c[t]};Writer$1.prototype.bytes=function u(c){var n=c.length>>>0;if(!n)return this._push(writeByte,1,0);if(util$4.isString(c)){var o=Writer$1.alloc(n=base64.length(c));base64.decode(c,o,0),c=o}return this.uint32(n)._push(writeBytes,n,c)};Writer$1.prototype.string=function u(c){var n=utf8$1.length(c);return n?this.uint32(n)._push(utf8$1.write,n,c):this._push(writeByte,1,0)};Writer$1.prototype.fork=function u(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this};Writer$1.prototype.reset=function u(){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 Op(noop,0,0),this.len=0),this};Writer$1.prototype.ldelim=function u(){var c=this.head,n=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=c.next,this.tail=n,this.len+=o),this};Writer$1.prototype.finish=function u(){for(var c=this.head.next,n=this.constructor.alloc(this.len),o=0;c;)c.fn(c.val,n,o),o+=c.len,c=c.next;return n};Writer$1._configure=function(u){BufferWriter$1=u,Writer$1.create=create$1(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$3=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$3._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$3.Buffer&&util$3.Buffer.prototype instanceof Uint8Array&&util$3.Buffer.prototype.set.name==="set"?function(c,n,o){n.set(c,o)}:function(c,n,o){if(c.copy)c.copy(n,o,0,c.length);else for(var t=0;t<c.length;)n[o++]=c[t++]}};BufferWriter.prototype.bytes=function u(c){util$3.isString(c)&&(c=util$3._Buffer_from(c,"base64"));var n=c.length>>>0;return this.uint32(n),n&&this._push(BufferWriter.writeBytesBuffer,n,c),this};function writeStringBuffer(u,c,n){u.length<40?util$3.utf8.write(u,c,n):c.utf8Write?c.utf8Write(u,n):c.write(u,n)}BufferWriter.prototype.string=function u(c){var n=util$3.Buffer.byteLength(c);return this.uint32(n),n&&this._push(writeStringBuffer,n,c),this};BufferWriter._configure();var reader=Reader$1,util$2=requireMinimal(),BufferReader$1,LongBits=util$2.LongBits,utf8=util$2.utf8;function indexOutOfRange(u,c){return RangeError("index out of range: "+u.pos+" + "+(c||1)+" > "+u.len)}function Reader$1(u){this.buf=u,this.pos=0,this.len=u.length}var create_array=typeof Uint8Array<"u"?function u(c){if(c instanceof Uint8Array||Array.isArray(c))return new Reader$1(c);throw Error("illegal buffer")}:function u(c){if(Array.isArray(c))return new Reader$1(c);throw Error("illegal buffer")},create=function u(){return util$2.Buffer?function(n){return(Reader$1.create=function(t){return util$2.Buffer.isBuffer(t)?new BufferReader$1(t):create_array(t)})(n)}:create_array};Reader$1.create=create();Reader$1.prototype._slice=util$2.Array.prototype.subarray||util$2.Array.prototype.slice;Reader$1.prototype.uint32=function u(){var c=4294967295;return function(){if(c=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(c=(c|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(c=(c|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(c=(c|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(c=(c|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return c;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return c}}();Reader$1.prototype.int32=function u(){return this.uint32()|0};Reader$1.prototype.sint32=function u(){var c=this.uint32();return c>>>1^-(c&1)|0};function readLongVarint(){var u=new LongBits(0,0),c=0;if(this.len-this.pos>4){for(;c<4;++c)if(u.lo=(u.lo|(this.buf[this.pos]&127)<<c*7)>>>0,this.buf[this.pos++]<128)return u;if(u.lo=(u.lo|(this.buf[this.pos]&127)<<28)>>>0,u.hi=(u.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return u;c=0}else{for(;c<3;++c){if(this.pos>=this.len)throw indexOutOfRange(this);if(u.lo=(u.lo|(this.buf[this.pos]&127)<<c*7)>>>0,this.buf[this.pos++]<128)return u}return u.lo=(u.lo|(this.buf[this.pos++]&127)<<c*7)>>>0,u}if(this.len-this.pos>4){for(;c<5;++c)if(u.hi=(u.hi|(this.buf[this.pos]&127)<<c*7+3)>>>0,this.buf[this.pos++]<128)return u}else for(;c<5;++c){if(this.pos>=this.len)throw indexOutOfRange(this);if(u.hi=(u.hi|(this.buf[this.pos]&127)<<c*7+3)>>>0,this.buf[this.pos++]<128)return u}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function u(){return this.uint32()!==0};function readFixed32_end(u,c){return(u[c-4]|u[c-3]<<8|u[c-2]<<16|u[c-1]<<24)>>>0}Reader$1.prototype.fixed32=function u(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function u(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function u(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var c=util$2.float.readFloatLE(this.buf,this.pos);return this.pos+=4,c};Reader$1.prototype.double=function u(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var c=util$2.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,c};Reader$1.prototype.bytes=function u(){var c=this.uint32(),n=this.pos,o=this.pos+c;if(o>this.len)throw indexOutOfRange(this,c);return this.pos+=c,Array.isArray(this.buf)?this.buf.slice(n,o):n===o?new this.buf.constructor(0):this._slice.call(this.buf,n,o)};Reader$1.prototype.string=function u(){var c=this.bytes();return utf8.read(c,0,c.length)};Reader$1.prototype.skip=function u(c){if(typeof c=="number"){if(this.pos+c>this.len)throw indexOutOfRange(this,c);this.pos+=c}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(u){switch(u){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(u=this.uint32()&7)!==4;)this.skipType(u);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+u+" at offset "+this.pos)}return this};Reader$1._configure=function(u){BufferReader$1=u,Reader$1.create=create(),BufferReader$1._configure();var c=util$2.Long?"toLong":"toNumber";util$2.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[c](!1)},uint64:function(){return readLongVarint.call(this)[c](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[c](!1)},fixed64:function(){return readFixed64.call(this)[c](!0)},sfixed64:function(){return readFixed64.call(this)[c](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$1=requireMinimal();function BufferReader(u){Reader.call(this,u)}BufferReader._configure=function(){util$1.Buffer&&(BufferReader.prototype._slice=util$1.Buffer.prototype.slice)};BufferReader.prototype.string=function u(){var c=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+c,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+c,this.len))};BufferReader._configure();var rpc={},service=Service,util=requireMinimal();(Service.prototype=Object.create(util.EventEmitter.prototype)).constructor=Service;function Service(u,c,n){if(typeof u!="function")throw TypeError("rpcImpl must be a function");util.EventEmitter.call(this),this.rpcImpl=u,this.requestDelimited=!!c,this.responseDelimited=!!n}Service.prototype.rpcCall=function u(c,n,o,t,e){if(!t)throw TypeError("request must be specified");var r=this;if(!e)return util.asPromise(u,r,c,n,o,t);if(!r.rpcImpl){setTimeout(function(){e(Error("already ended"))},0);return}try{return r.rpcImpl(c,n[r.requestDelimited?"encodeDelimited":"encode"](t).finish(),function(l,a){if(l)return r.emit("error",l,c),e(l);if(a===null){r.end(!0);return}if(!(a instanceof o))try{a=o[r.responseDelimited?"decodeDelimited":"decode"](a)}catch(f){return r.emit("error",f,c),e(f)}return r.emit("data",a,c),e(null,a)})}catch(i){r.emit("error",i,c),setTimeout(function(){e(i)},0);return}};Service.prototype.end=function u(c){return this.rpcImpl&&(c||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(u){var c=u;c.Service=service})(rpc);var roots={};(function(u){var c=u;c.build="minimal",c.Writer=writer,c.BufferWriter=writer_buffer,c.Reader=reader,c.BufferReader=reader_buffer,c.util=requireMinimal(),c.rpc=rpc,c.roots=roots,c.configure=n;function n(){c.util._configure(),c.Writer._configure(c.BufferWriter),c.Reader._configure(c.BufferReader)}n()})(indexMinimal);var minimal=indexMinimal,$protobuf=minimal,$Reader=$protobuf.Reader,$Writer=$protobuf.Writer,$util=$protobuf.util,$root=$protobuf.roots.default||($protobuf.roots.default={});$root.main=function(){var u={};return u.proto=function(){var c={};return c.Error=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.code="",n.prototype.message="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.code),t.message!=null&&Object.hasOwnProperty.call(t,"message")&&e.uint32(18).string(t.message),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.Error;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.code=t.string();break;case 2:i.message=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("code"))throw $util.ProtocolError("missing required 'code'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.code)?t.message!=null&&t.hasOwnProperty("message")&&!$util.isString(t.message)?"message: string expected":null:"code: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.Error)return t;var e=new $root.main.proto.Error;return t.code!=null&&(e.code=String(t.code)),t.message!=null&&(e.message=String(t.message)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.code="",r.message=""),t.code!=null&&t.hasOwnProperty("code")&&(r.code=t.code),t.message!=null&&t.hasOwnProperty("message")&&(r.message=t.message),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.PrimaryKeyType=function(){var n={},o=Object.create(n);return o[n[1]="INTEGER"]=1,o[n[2]="STRING"]=2,o[n[3]="BINARY"]=3,o}(),c.DefinedColumnType=function(){var n={},o=Object.create(n);return o[n[1]="DCT_INTEGER"]=1,o[n[2]="DCT_DOUBLE"]=2,o[n[3]="DCT_BOOLEAN"]=3,o[n[4]="DCT_STRING"]=4,o[n[7]="DCT_BLOB"]=7,o}(),c.PrimaryKeyOption=function(){var n={},o=Object.create(n);return o[n[1]="AUTO_INCREMENT"]=1,o}(),c.PrimaryKeySchema=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.name="",n.prototype.type=1,n.prototype.option=1,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.name),e.uint32(16).int32(t.type),t.option!=null&&Object.hasOwnProperty.call(t,"option")&&e.uint32(24).int32(t.option),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.PrimaryKeySchema;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.name=t.string();break;case 2:i.type=t.int32();break;case 3:i.option=t.int32();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("name"))throw $util.ProtocolError("missing required 'name'",{instance:i});if(!i.hasOwnProperty("type"))throw $util.ProtocolError("missing required 'type'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.name))return"name: string expected";switch(t.type){default:return"type: enum value expected";case 1:case 2:case 3:break}if(t.option!=null&&t.hasOwnProperty("option"))switch(t.option){default:return"option: enum value expected";case 1:break}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.PrimaryKeySchema)return t;var e=new $root.main.proto.PrimaryKeySchema;switch(t.name!=null&&(e.name=String(t.name)),t.type){case"INTEGER":case 1:e.type=1;break;case"STRING":case 2:e.type=2;break;case"BINARY":case 3:e.type=3;break}switch(t.option){case"AUTO_INCREMENT":case 1:e.option=1;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.name="",r.type=e.enums===String?"INTEGER":1,r.option=e.enums===String?"AUTO_INCREMENT":1),t.name!=null&&t.hasOwnProperty("name")&&(r.name=t.name),t.type!=null&&t.hasOwnProperty("type")&&(r.type=e.enums===String?$root.main.proto.PrimaryKeyType[t.type]:t.type),t.option!=null&&t.hasOwnProperty("option")&&(r.option=e.enums===String?$root.main.proto.PrimaryKeyOption[t.option]:t.option),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DefinedColumnSchema=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.name="",n.prototype.type=1,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.name),e.uint32(16).int32(t.type),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.DefinedColumnSchema;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.name=t.string();break;case 2:i.type=t.int32();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("name"))throw $util.ProtocolError("missing required 'name'",{instance:i});if(!i.hasOwnProperty("type"))throw $util.ProtocolError("missing required 'type'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.name))return"name: string expected";switch(t.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 7:break}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.DefinedColumnSchema)return t;var e=new $root.main.proto.DefinedColumnSchema;switch(t.name!=null&&(e.name=String(t.name)),t.type){case"DCT_INTEGER":case 1:e.type=1;break;case"DCT_DOUBLE":case 2:e.type=2;break;case"DCT_BOOLEAN":case 3:e.type=3;break;case"DCT_STRING":case 4:e.type=4;break;case"DCT_BLOB":case 7:e.type=7;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.name="",r.type=e.enums===String?"DCT_INTEGER":1),t.name!=null&&t.hasOwnProperty("name")&&(r.name=t.name),t.type!=null&&t.hasOwnProperty("type")&&(r.type=e.enums===String?$root.main.proto.DefinedColumnType[t.type]:t.type),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.PartitionRange=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.begin=$util.newBuffer([]),n.prototype.end=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).bytes(t.begin),e.uint32(18).bytes(t.end),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.PartitionRange;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.begin=t.bytes();break;case 2:i.end=t.bytes();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("begin"))throw $util.ProtocolError("missing required 'begin'",{instance:i});if(!i.hasOwnProperty("end"))throw $util.ProtocolError("missing required 'end'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.begin&&typeof t.begin.length=="number"||$util.isString(t.begin)?t.end&&typeof t.end.length=="number"||$util.isString(t.end)?null:"end: buffer expected":"begin: buffer expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.PartitionRange)return t;var e=new $root.main.proto.PartitionRange;return t.begin!=null&&(typeof t.begin=="string"?$util.base64.decode(t.begin,e.begin=$util.newBuffer($util.base64.length(t.begin)),0):t.begin.length&&(e.begin=t.begin)),t.end!=null&&(typeof t.end=="string"?$util.base64.decode(t.end,e.end=$util.newBuffer($util.base64.length(t.end)),0):t.end.length&&(e.end=t.end)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(e.bytes===String?r.begin="":(r.begin=[],e.bytes!==Array&&(r.begin=$util.newBuffer(r.begin))),e.bytes===String?r.end="":(r.end=[],e.bytes!==Array&&(r.end=$util.newBuffer(r.end)))),t.begin!=null&&t.hasOwnProperty("begin")&&(r.begin=e.bytes===String?$util.base64.encode(t.begin,0,t.begin.length):e.bytes===Array?Array.prototype.slice.call(t.begin):t.begin),t.end!=null&&t.hasOwnProperty("end")&&(r.end=e.bytes===String?$util.base64.encode(t.end,0,t.end.length):e.bytes===Array?Array.prototype.slice.call(t.end):t.end),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.BloomFilterType=function(){var n={},o=Object.create(n);return o[n[1]="NONE"]=1,o[n[2]="CELL"]=2,o[n[3]="ROW"]=3,o}(),c.DataBlockType=function(){var n={},o=Object.create(n);return o[n[0]="DBT_PLAIN_BUFFER"]=0,o[n[1]="DBT_SIMPLE_ROW_MATRIX"]=1,o}(),c.CompressType=function(){var n={},o=Object.create(n);return o[n[0]="CPT_NONE"]=0,o}(),c.TableOptions=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.timeToLive=0,n.prototype.maxVersions=0,n.prototype.bloomFilterType=1,n.prototype.blockSize=0,n.prototype.deviationCellVersionInSec=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.allowUpdate=!1,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.timeToLive!=null&&Object.hasOwnProperty.call(t,"timeToLive")&&e.uint32(8).int32(t.timeToLive),t.maxVersions!=null&&Object.hasOwnProperty.call(t,"maxVersions")&&e.uint32(16).int32(t.maxVersions),t.bloomFilterType!=null&&Object.hasOwnProperty.call(t,"bloomFilterType")&&e.uint32(24).int32(t.bloomFilterType),t.blockSize!=null&&Object.hasOwnProperty.call(t,"blockSize")&&e.uint32(32).int32(t.blockSize),t.deviationCellVersionInSec!=null&&Object.hasOwnProperty.call(t,"deviationCellVersionInSec")&&e.uint32(40).int64(t.deviationCellVersionInSec),t.allowUpdate!=null&&Object.hasOwnProperty.call(t,"allowUpdate")&&e.uint32(48).bool(t.allowUpdate),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.TableOptions;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.timeToLive=t.int32();break;case 2:i.maxVersions=t.int32();break;case 3:i.bloomFilterType=t.int32();break;case 4:i.blockSize=t.int32();break;case 5:i.deviationCellVersionInSec=t.int64();break;case 6:i.allowUpdate=t.bool();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.timeToLive!=null&&t.hasOwnProperty("timeToLive")&&!$util.isInteger(t.timeToLive))return"timeToLive: integer expected";if(t.maxVersions!=null&&t.hasOwnProperty("maxVersions")&&!$util.isInteger(t.maxVersions))return"maxVersions: integer expected";if(t.bloomFilterType!=null&&t.hasOwnProperty("bloomFilterType"))switch(t.bloomFilterType){default:return"bloomFilterType: enum value expected";case 1:case 2:case 3:break}return t.blockSize!=null&&t.hasOwnProperty("blockSize")&&!$util.isInteger(t.blockSize)?"blockSize: integer expected":t.deviationCellVersionInSec!=null&&t.hasOwnProperty("deviationCellVersionInSec")&&!$util.isInteger(t.deviationCellVersionInSec)&&!(t.deviationCellVersionInSec&&$util.isInteger(t.deviationCellVersionInSec.low)&&$util.isInteger(t.deviationCellVersionInSec.high))?"deviationCellVersionInSec: integer|Long expected":t.allowUpdate!=null&&t.hasOwnProperty("allowUpdate")&&typeof t.allowUpdate!="boolean"?"allowUpdate: boolean expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.TableOptions)return t;var e=new $root.main.proto.TableOptions;switch(t.timeToLive!=null&&(e.timeToLive=t.timeToLive|0),t.maxVersions!=null&&(e.maxVersions=t.maxVersions|0),t.bloomFilterType){case"NONE":case 1:e.bloomFilterType=1;break;case"CELL":case 2:e.bloomFilterType=2;break;case"ROW":case 3:e.bloomFilterType=3;break}return t.blockSize!=null&&(e.blockSize=t.blockSize|0),t.deviationCellVersionInSec!=null&&($util.Long?(e.deviationCellVersionInSec=$util.Long.fromValue(t.deviationCellVersionInSec)).unsigned=!1:typeof t.deviationCellVersionInSec=="string"?e.deviationCellVersionInSec=parseInt(t.deviationCellVersionInSec,10):typeof t.deviationCellVersionInSec=="number"?e.deviationCellVersionInSec=t.deviationCellVersionInSec:typeof t.deviationCellVersionInSec=="object"&&(e.deviationCellVersionInSec=new $util.LongBits(t.deviationCellVersionInSec.low>>>0,t.deviationCellVersionInSec.high>>>0).toNumber())),t.allowUpdate!=null&&(e.allowUpdate=!!t.allowUpdate),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(r.timeToLive=0,r.maxVersions=0,r.bloomFilterType=e.enums===String?"NONE":1,r.blockSize=0,$util.Long){var i=new $util.Long(0,0,!1);r.deviationCellVersionInSec=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.deviationCellVersionInSec=e.longs===String?"0":0;r.allowUpdate=!1}return t.timeToLive!=null&&t.hasOwnProperty("timeToLive")&&(r.timeToLive=t.timeToLive),t.maxVersions!=null&&t.hasOwnProperty("maxVersions")&&(r.maxVersions=t.maxVersions),t.bloomFilterType!=null&&t.hasOwnProperty("bloomFilterType")&&(r.bloomFilterType=e.enums===String?$root.main.proto.BloomFilterType[t.bloomFilterType]:t.bloomFilterType),t.blockSize!=null&&t.hasOwnProperty("blockSize")&&(r.blockSize=t.blockSize),t.deviationCellVersionInSec!=null&&t.hasOwnProperty("deviationCellVersionInSec")&&(typeof t.deviationCellVersionInSec=="number"?r.deviationCellVersionInSec=e.longs===String?String(t.deviationCellVersionInSec):t.deviationCellVersionInSec:r.deviationCellVersionInSec=e.longs===String?$util.Long.prototype.toString.call(t.deviationCellVersionInSec):e.longs===Number?new $util.LongBits(t.deviationCellVersionInSec.low>>>0,t.deviationCellVersionInSec.high>>>0).toNumber():t.deviationCellVersionInSec),t.allowUpdate!=null&&t.hasOwnProperty("allowUpdate")&&(r.allowUpdate=t.allowUpdate),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.IndexUpdateMode=function(){var n={},o=Object.create(n);return o[n[0]="IUM_ASYNC_INDEX"]=0,o[n[1]="IUM_SYNC_INDEX"]=1,o}(),c.IndexType=function(){var n={},o=Object.create(n);return o[n[0]="IT_GLOBAL_INDEX"]=0,o[n[1]="IT_LOCAL_INDEX"]=1,o}(),c.IndexSyncPhase=function(){var n={},o=Object.create(n);return o[n[0]="ISP_INVALID"]=0,o[n[1]="ISP_FULL"]=1,o[n[2]="ISP_INCR"]=2,o}(),c.IndexMeta=function(){function n(o){if(this.primaryKey=[],this.definedColumn=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.name="",n.prototype.primaryKey=$util.emptyArray,n.prototype.definedColumn=$util.emptyArray,n.prototype.indexUpdateMode=0,n.prototype.indexType=0,n.prototype.indexSyncPhase=0,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),e.uint32(10).string(t.name),t.primaryKey!=null&&t.primaryKey.length)for(var r=0;r<t.primaryKey.length;++r)e.uint32(18).string(t.primaryKey[r]);if(t.definedColumn!=null&&t.definedColumn.length)for(var r=0;r<t.definedColumn.length;++r)e.uint32(26).string(t.definedColumn[r]);return e.uint32(32).int32(t.indexUpdateMode),e.uint32(40).int32(t.indexType),t.indexSyncPhase!=null&&Object.hasOwnProperty.call(t,"indexSyncPhase")&&e.uint32(48).int32(t.indexSyncPhase),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.IndexMeta;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.name=t.string();break;case 2:i.primaryKey&&i.primaryKey.length||(i.primaryKey=[]),i.primaryKey.push(t.string());break;case 3:i.definedColumn&&i.definedColumn.length||(i.definedColumn=[]),i.definedColumn.push(t.string());break;case 4:i.indexUpdateMode=t.int32();break;case 5:i.indexType=t.int32();break;case 6:i.indexSyncPhase=t.int32();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("name"))throw $util.ProtocolError("missing required 'name'",{instance:i});if(!i.hasOwnProperty("indexUpdateMode"))throw $util.ProtocolError("missing required 'indexUpdateMode'",{instance:i});if(!i.hasOwnProperty("indexType"))throw $util.ProtocolError("missing required 'indexType'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.name))return"name: string expected";if(t.primaryKey!=null&&t.hasOwnProperty("primaryKey")){if(!Array.isArray(t.primaryKey))return"primaryKey: array expected";for(var e=0;e<t.primaryKey.length;++e)if(!$util.isString(t.primaryKey[e]))return"primaryKey: string[] expected"}if(t.definedColumn!=null&&t.hasOwnProperty("definedColumn")){if(!Array.isArray(t.definedColumn))return"definedColumn: array expected";for(var e=0;e<t.definedColumn.length;++e)if(!$util.isString(t.definedColumn[e]))return"definedColumn: string[] expected"}switch(t.indexUpdateMode){default:return"indexUpdateMode: enum value expected";case 0:case 1:break}switch(t.indexType){default:return"indexType: enum value expected";case 0:case 1:break}if(t.indexSyncPhase!=null&&t.hasOwnProperty("indexSyncPhase"))switch(t.indexSyncPhase){default:return"indexSyncPhase: enum value expected";case 0:case 1:case 2:break}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.IndexMeta)return t;var e=new $root.main.proto.IndexMeta;if(t.name!=null&&(e.name=String(t.name)),t.primaryKey){if(!Array.isArray(t.primaryKey))throw TypeError(".main.proto.IndexMeta.primaryKey: array expected");e.primaryKey=[];for(var r=0;r<t.primaryKey.length;++r)e.primaryKey[r]=String(t.primaryKey[r])}if(t.definedColumn){if(!Array.isArray(t.definedColumn))throw TypeError(".main.proto.IndexMeta.definedColumn: array expected");e.definedColumn=[];for(var r=0;r<t.definedColumn.length;++r)e.definedColumn[r]=String(t.definedColumn[r])}switch(t.indexUpdateMode){case"IUM_ASYNC_INDEX":case 0:e.indexUpdateMode=0;break;case"IUM_SYNC_INDEX":case 1:e.indexUpdateMode=1;break}switch(t.indexType){case"IT_GLOBAL_INDEX":case 0:e.indexType=0;break;case"IT_LOCAL_INDEX":case 1:e.indexType=1;break}switch(t.indexSyncPhase){case"ISP_INVALID":case 0:e.indexSyncPhase=0;break;case"ISP_FULL":case 1:e.indexSyncPhase=1;break;case"ISP_INCR":case 2:e.indexSyncPhase=2;break}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.primaryKey=[],r.definedColumn=[]),e.defaults&&(r.name="",r.indexUpdateMode=e.enums===String?"IUM_ASYNC_INDEX":0,r.indexType=e.enums===String?"IT_GLOBAL_INDEX":0,r.indexSyncPhase=e.enums===String?"ISP_INVALID":0),t.name!=null&&t.hasOwnProperty("name")&&(r.name=t.name),t.primaryKey&&t.primaryKey.length){r.primaryKey=[];for(var i=0;i<t.primaryKey.length;++i)r.primaryKey[i]=t.primaryKey[i]}if(t.definedColumn&&t.definedColumn.length){r.definedColumn=[];for(var i=0;i<t.definedColumn.length;++i)r.definedColumn[i]=t.definedColumn[i]}return t.indexUpdateMode!=null&&t.hasOwnProperty("indexUpdateMode")&&(r.indexUpdateMode=e.enums===String?$root.main.proto.IndexUpdateMode[t.indexUpdateMode]:t.indexUpdateMode),t.indexType!=null&&t.hasOwnProperty("indexType")&&(r.indexType=e.enums===String?$root.main.proto.IndexType[t.indexType]:t.indexType),t.indexSyncPhase!=null&&t.hasOwnProperty("indexSyncPhase")&&(r.indexSyncPhase=e.enums===String?$root.main.proto.IndexSyncPhase[t.indexSyncPhase]:t.indexSyncPhase),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TableMeta=function(){function n(o){if(this.primaryKey=[],this.definedColumn=[],this.indexMeta=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.primaryKey=$util.emptyArray,n.prototype.definedColumn=$util.emptyArray,n.prototype.indexMeta=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),e.uint32(10).string(t.tableName),t.primaryKey!=null&&t.primaryKey.length)for(var r=0;r<t.primaryKey.length;++r)$root.main.proto.PrimaryKeySchema.encode(t.primaryKey[r],e.uint32(18).fork()).ldelim();if(t.definedColumn!=null&&t.definedColumn.length)for(var r=0;r<t.definedColumn.length;++r)$root.main.proto.DefinedColumnSchema.encode(t.definedColumn[r],e.uint32(26).fork()).ldelim();if(t.indexMeta!=null&&t.indexMeta.length)for(var r=0;r<t.indexMeta.length;++r)$root.main.proto.IndexMeta.encode(t.indexMeta[r],e.uint32(34).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.TableMeta;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.primaryKey&&i.primaryKey.length||(i.primaryKey=[]),i.primaryKey.push($root.main.proto.PrimaryKeySchema.decode(t,t.uint32()));break;case 3:i.definedColumn&&i.definedColumn.length||(i.definedColumn=[]),i.definedColumn.push($root.main.proto.DefinedColumnSchema.decode(t,t.uint32()));break;case 4:i.indexMeta&&i.indexMeta.length||(i.indexMeta=[]),i.indexMeta.push($root.main.proto.IndexMeta.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(t.primaryKey!=null&&t.hasOwnProperty("primaryKey")){if(!Array.isArray(t.primaryKey))return"primaryKey: array expected";for(var e=0;e<t.primaryKey.length;++e){var r=$root.main.proto.PrimaryKeySchema.verify(t.primaryKey[e]);if(r)return"primaryKey."+r}}if(t.definedColumn!=null&&t.hasOwnProperty("definedColumn")){if(!Array.isArray(t.definedColumn))return"definedColumn: array expected";for(var e=0;e<t.definedColumn.length;++e){var r=$root.main.proto.DefinedColumnSchema.verify(t.definedColumn[e]);if(r)return"definedColumn."+r}}if(t.indexMeta!=null&&t.hasOwnProperty("indexMeta")){if(!Array.isArray(t.indexMeta))return"indexMeta: array expected";for(var e=0;e<t.indexMeta.length;++e){var r=$root.main.proto.IndexMeta.verify(t.indexMeta[e]);if(r)return"indexMeta."+r}}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.TableMeta)return t;var e=new $root.main.proto.TableMeta;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.primaryKey){if(!Array.isArray(t.primaryKey))throw TypeError(".main.proto.TableMeta.primaryKey: array expected");e.primaryKey=[];for(var r=0;r<t.primaryKey.length;++r){if(typeof t.primaryKey[r]!="object")throw TypeError(".main.proto.TableMeta.primaryKey: object expected");e.primaryKey[r]=$root.main.proto.PrimaryKeySchema.fromObject(t.primaryKey[r])}}if(t.definedColumn){if(!Array.isArray(t.definedColumn))throw TypeError(".main.proto.TableMeta.definedColumn: array expected");e.definedColumn=[];for(var r=0;r<t.definedColumn.length;++r){if(typeof t.definedColumn[r]!="object")throw TypeError(".main.proto.TableMeta.definedColumn: object expected");e.definedColumn[r]=$root.main.proto.DefinedColumnSchema.fromObject(t.definedColumn[r])}}if(t.indexMeta){if(!Array.isArray(t.indexMeta))throw TypeError(".main.proto.TableMeta.indexMeta: array expected");e.indexMeta=[];for(var r=0;r<t.indexMeta.length;++r){if(typeof t.indexMeta[r]!="object")throw TypeError(".main.proto.TableMeta.indexMeta: object expected");e.indexMeta[r]=$root.main.proto.IndexMeta.fromObject(t.indexMeta[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.primaryKey=[],r.definedColumn=[],r.indexMeta=[]),e.defaults&&(r.tableName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.primaryKey&&t.primaryKey.length){r.primaryKey=[];for(var i=0;i<t.primaryKey.length;++i)r.primaryKey[i]=$root.main.proto.PrimaryKeySchema.toObject(t.primaryKey[i],e)}if(t.definedColumn&&t.definedColumn.length){r.definedColumn=[];for(var i=0;i<t.definedColumn.length;++i)r.definedColumn[i]=$root.main.proto.DefinedColumnSchema.toObject(t.definedColumn[i],e)}if(t.indexMeta&&t.indexMeta.length){r.indexMeta=[];for(var i=0;i<t.indexMeta.length;++i)r.indexMeta[i]=$root.main.proto.IndexMeta.toObject(t.indexMeta[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TableStatus=function(){var n={},o=Object.create(n);return o[n[1]="ACTIVE"]=1,o[n[2]="INACTIVE"]=2,o[n[3]="LOADING"]=3,o[n[4]="UNLOADING"]=4,o[n[5]="UPDATING"]=5,o}(),c.RowExistenceExpectation=function(){var n={},o=Object.create(n);return o[n[0]="IGNORE"]=0,o[n[1]="EXPECT_EXIST"]=1,o[n[2]="EXPECT_NOT_EXIST"]=2,o}(),c.Condition=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.rowExistence=0,n.prototype.columnCondition=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(8).int32(t.rowExistence),t.columnCondition!=null&&Object.hasOwnProperty.call(t,"columnCondition")&&e.uint32(18).bytes(t.columnCondition),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.Condition;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.rowExistence=t.int32();break;case 2:i.columnCondition=t.bytes();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("rowExistence"))throw $util.ProtocolError("missing required 'rowExistence'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";switch(t.rowExistence){default:return"rowExistence: enum value expected";case 0:case 1:case 2:break}return t.columnCondition!=null&&t.hasOwnProperty("columnCondition")&&!(t.columnCondition&&typeof t.columnCondition.length=="number"||$util.isString(t.columnCondition))?"columnCondition: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.Condition)return t;var e=new $root.main.proto.Condition;switch(t.rowExistence){case"IGNORE":case 0:e.rowExistence=0;break;case"EXPECT_EXIST":case 1:e.rowExistence=1;break;case"EXPECT_NOT_EXIST":case 2:e.rowExistence=2;break}return t.columnCondition!=null&&(typeof t.columnCondition=="string"?$util.base64.decode(t.columnCondition,e.columnCondition=$util.newBuffer($util.base64.length(t.columnCondition)),0):t.columnCondition.length&&(e.columnCondition=t.columnCondition)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.rowExistence=e.enums===String?"IGNORE":0,e.bytes===String?r.columnCondition="":(r.columnCondition=[],e.bytes!==Array&&(r.columnCondition=$util.newBuffer(r.columnCondition)))),t.rowExistence!=null&&t.hasOwnProperty("rowExistence")&&(r.rowExistence=e.enums===String?$root.main.proto.RowExistenceExpectation[t.rowExistence]:t.rowExistence),t.columnCondition!=null&&t.hasOwnProperty("columnCondition")&&(r.columnCondition=e.bytes===String?$util.base64.encode(t.columnCondition,0,t.columnCondition.length):e.bytes===Array?Array.prototype.slice.call(t.columnCondition):t.columnCondition),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.CapacityUnit=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.read=0,n.prototype.write=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.read!=null&&Object.hasOwnProperty.call(t,"read")&&e.uint32(8).int32(t.read),t.write!=null&&Object.hasOwnProperty.call(t,"write")&&e.uint32(16).int32(t.write),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.CapacityUnit;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.read=t.int32();break;case 2:i.write=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.read!=null&&t.hasOwnProperty("read")&&!$util.isInteger(t.read)?"read: integer expected":t.write!=null&&t.hasOwnProperty("write")&&!$util.isInteger(t.write)?"write: integer expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.CapacityUnit)return t;var e=new $root.main.proto.CapacityUnit;return t.read!=null&&(e.read=t.read|0),t.write!=null&&(e.write=t.write|0),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.read=0,r.write=0),t.read!=null&&t.hasOwnProperty("read")&&(r.read=t.read),t.write!=null&&t.hasOwnProperty("write")&&(r.write=t.write),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ReservedThroughputDetails=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.capacityUnit=null,n.prototype.lastIncreaseTime=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.lastDecreaseTime=$util.Long?$util.Long.fromBits(0,0,!1):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),$root.main.proto.CapacityUnit.encode(t.capacityUnit,e.uint32(10).fork()).ldelim(),e.uint32(16).int64(t.lastIncreaseTime),t.lastDecreaseTime!=null&&Object.hasOwnProperty.call(t,"lastDecreaseTime")&&e.uint32(24).int64(t.lastDecreaseTime),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.ReservedThroughputDetails;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.capacityUnit=$root.main.proto.CapacityUnit.decode(t,t.uint32());break;case 2:i.lastIncreaseTime=t.int64();break;case 3:i.lastDecreaseTime=t.int64();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("capacityUnit"))throw $util.ProtocolError("missing required 'capacityUnit'",{instance:i});if(!i.hasOwnProperty("lastIncreaseTime"))throw $util.ProtocolError("missing required 'lastIncreaseTime'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.CapacityUnit.verify(t.capacityUnit);if(e)return"capacityUnit."+e}return!$util.isInteger(t.lastIncreaseTime)&&!(t.lastIncreaseTime&&$util.isInteger(t.lastIncreaseTime.low)&&$util.isInteger(t.lastIncreaseTime.high))?"lastIncreaseTime: integer|Long expected":t.lastDecreaseTime!=null&&t.hasOwnProperty("lastDecreaseTime")&&!$util.isInteger(t.lastDecreaseTime)&&!(t.lastDecreaseTime&&$util.isInteger(t.lastDecreaseTime.low)&&$util.isInteger(t.lastDecreaseTime.high))?"lastDecreaseTime: integer|Long expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.ReservedThroughputDetails)return t;var e=new $root.main.proto.ReservedThroughputDetails;if(t.capacityUnit!=null){if(typeof t.capacityUnit!="object")throw TypeError(".main.proto.ReservedThroughputDetails.capacityUnit: object expected");e.capacityUnit=$root.main.proto.CapacityUnit.fromObject(t.capacityUnit)}return t.lastIncreaseTime!=null&&($util.Long?(e.lastIncreaseTime=$util.Long.fromValue(t.lastIncreaseTime)).unsigned=!1:typeof t.lastIncreaseTime=="string"?e.lastIncreaseTime=parseInt(t.lastIncreaseTime,10):typeof t.lastIncreaseTime=="number"?e.lastIncreaseTime=t.lastIncreaseTime:typeof t.lastIncreaseTime=="object"&&(e.lastIncreaseTime=new $util.LongBits(t.lastIncreaseTime.low>>>0,t.lastIncreaseTime.high>>>0).toNumber())),t.lastDecreaseTime!=null&&($util.Long?(e.lastDecreaseTime=$util.Long.fromValue(t.lastDecreaseTime)).unsigned=!1:typeof t.lastDecreaseTime=="string"?e.lastDecreaseTime=parseInt(t.lastDecreaseTime,10):typeof t.lastDecreaseTime=="number"?e.lastDecreaseTime=t.lastDecreaseTime:typeof t.lastDecreaseTime=="object"&&(e.lastDecreaseTime=new $util.LongBits(t.lastDecreaseTime.low>>>0,t.lastDecreaseTime.high>>>0).toNumber())),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(r.capacityUnit=null,$util.Long){var i=new $util.Long(0,0,!1);r.lastIncreaseTime=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.lastIncreaseTime=e.longs===String?"0":0;if($util.Long){var i=new $util.Long(0,0,!1);r.lastDecreaseTime=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.lastDecreaseTime=e.longs===String?"0":0}return t.capacityUnit!=null&&t.hasOwnProperty("capacityUnit")&&(r.capacityUnit=$root.main.proto.CapacityUnit.toObject(t.capacityUnit,e)),t.lastIncreaseTime!=null&&t.hasOwnProperty("lastIncreaseTime")&&(typeof t.lastIncreaseTime=="number"?r.lastIncreaseTime=e.longs===String?String(t.lastIncreaseTime):t.lastIncreaseTime:r.lastIncreaseTime=e.longs===String?$util.Long.prototype.toString.call(t.lastIncreaseTime):e.longs===Number?new $util.LongBits(t.lastIncreaseTime.low>>>0,t.lastIncreaseTime.high>>>0).toNumber():t.lastIncreaseTime),t.lastDecreaseTime!=null&&t.hasOwnProperty("lastDecreaseTime")&&(typeof t.lastDecreaseTime=="number"?r.lastDecreaseTime=e.longs===String?String(t.lastDecreaseTime):t.lastDecreaseTime:r.lastDecreaseTime=e.longs===String?$util.Long.prototype.toString.call(t.lastDecreaseTime):e.longs===Number?new $util.LongBits(t.lastDecreaseTime.low>>>0,t.lastDecreaseTime.high>>>0).toNumber():t.lastDecreaseTime),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ReservedThroughput=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.capacityUnit=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),$root.main.proto.CapacityUnit.encode(t.capacityUnit,e.uint32(10).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.ReservedThroughput;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.capacityUnit=$root.main.proto.CapacityUnit.decode(t,t.uint32());break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("capacityUnit"))throw $util.ProtocolError("missing required 'capacityUnit'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.CapacityUnit.verify(t.capacityUnit);if(e)return"capacityUnit."+e}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.ReservedThroughput)return t;var e=new $root.main.proto.ReservedThroughput;if(t.capacityUnit!=null){if(typeof t.capacityUnit!="object")throw TypeError(".main.proto.ReservedThroughput.capacityUnit: object expected");e.capacityUnit=$root.main.proto.CapacityUnit.fromObject(t.capacityUnit)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.capacityUnit=null),t.capacityUnit!=null&&t.hasOwnProperty("capacityUnit")&&(r.capacityUnit=$root.main.proto.CapacityUnit.toObject(t.capacityUnit,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ConsumedCapacity=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.capacityUnit=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),$root.main.proto.CapacityUnit.encode(t.capacityUnit,e.uint32(10).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.ConsumedCapacity;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.capacityUnit=$root.main.proto.CapacityUnit.decode(t,t.uint32());break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("capacityUnit"))throw $util.ProtocolError("missing required 'capacityUnit'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.CapacityUnit.verify(t.capacityUnit);if(e)return"capacityUnit."+e}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.ConsumedCapacity)return t;var e=new $root.main.proto.ConsumedCapacity;if(t.capacityUnit!=null){if(typeof t.capacityUnit!="object")throw TypeError(".main.proto.ConsumedCapacity.capacityUnit: object expected");e.capacityUnit=$root.main.proto.CapacityUnit.fromObject(t.capacityUnit)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.capacityUnit=null),t.capacityUnit!=null&&t.hasOwnProperty("capacityUnit")&&(r.capacityUnit=$root.main.proto.CapacityUnit.toObject(t.capacityUnit,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.StreamSpecification=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.enableStream=!1,n.prototype.expirationTime=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(8).bool(t.enableStream),t.expirationTime!=null&&Object.hasOwnProperty.call(t,"expirationTime")&&e.uint32(16).int32(t.expirationTime),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.StreamSpecification;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.enableStream=t.bool();break;case 2:i.expirationTime=t.int32();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("enableStream"))throw $util.ProtocolError("missing required 'enableStream'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":typeof t.enableStream!="boolean"?"enableStream: boolean expected":t.expirationTime!=null&&t.hasOwnProperty("expirationTime")&&!$util.isInteger(t.expirationTime)?"expirationTime: integer expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.StreamSpecification)return t;var e=new $root.main.proto.StreamSpecification;return t.enableStream!=null&&(e.enableStream=!!t.enableStream),t.expirationTime!=null&&(e.expirationTime=t.expirationTime|0),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.enableStream=!1,r.expirationTime=0),t.enableStream!=null&&t.hasOwnProperty("enableStream")&&(r.enableStream=t.enableStream),t.expirationTime!=null&&t.hasOwnProperty("expirationTime")&&(r.expirationTime=t.expirationTime),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.StreamDetails=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.enableStream=!1,n.prototype.streamId="",n.prototype.expirationTime=0,n.prototype.lastEnableTime=$util.Long?$util.Long.fromBits(0,0,!1):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(8).bool(t.enableStream),t.streamId!=null&&Object.hasOwnProperty.call(t,"streamId")&&e.uint32(18).string(t.streamId),t.expirationTime!=null&&Object.hasOwnProperty.call(t,"expirationTime")&&e.uint32(24).int32(t.expirationTime),t.lastEnableTime!=null&&Object.hasOwnProperty.call(t,"lastEnableTime")&&e.uint32(32).int64(t.lastEnableTime),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.StreamDetails;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.enableStream=t.bool();break;case 2:i.streamId=t.string();break;case 3:i.expirationTime=t.int32();break;case 4:i.lastEnableTime=t.int64();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("enableStream"))throw $util.ProtocolError("missing required 'enableStream'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":typeof t.enableStream!="boolean"?"enableStream: boolean expected":t.streamId!=null&&t.hasOwnProperty("streamId")&&!$util.isString(t.streamId)?"streamId: string expected":t.expirationTime!=null&&t.hasOwnProperty("expirationTime")&&!$util.isInteger(t.expirationTime)?"expirationTime: integer expected":t.lastEnableTime!=null&&t.hasOwnProperty("lastEnableTime")&&!$util.isInteger(t.lastEnableTime)&&!(t.lastEnableTime&&$util.isInteger(t.lastEnableTime.low)&&$util.isInteger(t.lastEnableTime.high))?"lastEnableTime: integer|Long expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.StreamDetails)return t;var e=new $root.main.proto.StreamDetails;return t.enableStream!=null&&(e.enableStream=!!t.enableStream),t.streamId!=null&&(e.streamId=String(t.streamId)),t.expirationTime!=null&&(e.expirationTime=t.expirationTime|0),t.lastEnableTime!=null&&($util.Long?(e.lastEnableTime=$util.Long.fromValue(t.lastEnableTime)).unsigned=!1:typeof t.lastEnableTime=="string"?e.lastEnableTime=parseInt(t.lastEnableTime,10):typeof t.lastEnableTime=="number"?e.lastEnableTime=t.lastEnableTime:typeof t.lastEnableTime=="object"&&(e.lastEnableTime=new $util.LongBits(t.lastEnableTime.low>>>0,t.lastEnableTime.high>>>0).toNumber())),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults)if(r.enableStream=!1,r.streamId="",r.expirationTime=0,$util.Long){var i=new $util.Long(0,0,!1);r.lastEnableTime=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.lastEnableTime=e.longs===String?"0":0;return t.enableStream!=null&&t.hasOwnProperty("enableStream")&&(r.enableStream=t.enableStream),t.streamId!=null&&t.hasOwnProperty("streamId")&&(r.streamId=t.streamId),t.expirationTime!=null&&t.hasOwnProperty("expirationTime")&&(r.expirationTime=t.expirationTime),t.lastEnableTime!=null&&t.hasOwnProperty("lastEnableTime")&&(typeof t.lastEnableTime=="number"?r.lastEnableTime=e.longs===String?String(t.lastEnableTime):t.lastEnableTime:r.lastEnableTime=e.longs===String?$util.Long.prototype.toString.call(t.lastEnableTime):e.longs===Number?new $util.LongBits(t.lastEnableTime.low>>>0,t.lastEnableTime.high>>>0).toNumber():t.lastEnableTime),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.CreateTableRequest=function(){function n(o){if(this.partitions=[],this.indexMetas=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableMeta=null,n.prototype.reservedThroughput=null,n.prototype.tableOptions=null,n.prototype.partitions=$util.emptyArray,n.prototype.streamSpec=null,n.prototype.indexMetas=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),$root.main.proto.TableMeta.encode(t.tableMeta,e.uint32(10).fork()).ldelim(),$root.main.proto.ReservedThroughput.encode(t.reservedThroughput,e.uint32(18).fork()).ldelim(),t.tableOptions!=null&&Object.hasOwnProperty.call(t,"tableOptions")&&$root.main.proto.TableOptions.encode(t.tableOptions,e.uint32(26).fork()).ldelim(),t.partitions!=null&&t.partitions.length)for(var r=0;r<t.partitions.length;++r)$root.main.proto.PartitionRange.encode(t.partitions[r],e.uint32(34).fork()).ldelim();if(t.streamSpec!=null&&Object.hasOwnProperty.call(t,"streamSpec")&&$root.main.proto.StreamSpecification.encode(t.streamSpec,e.uint32(42).fork()).ldelim(),t.indexMetas!=null&&t.indexMetas.length)for(var r=0;r<t.indexMetas.length;++r)$root.main.proto.IndexMeta.encode(t.indexMetas[r],e.uint32(58).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.CreateTableRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableMeta=$root.main.proto.TableMeta.decode(t,t.uint32());break;case 2:i.reservedThroughput=$root.main.proto.ReservedThroughput.decode(t,t.uint32());break;case 3:i.tableOptions=$root.main.proto.TableOptions.decode(t,t.uint32());break;case 4:i.partitions&&i.partitions.length||(i.partitions=[]),i.partitions.push($root.main.proto.PartitionRange.decode(t,t.uint32()));break;case 5:i.streamSpec=$root.main.proto.StreamSpecification.decode(t,t.uint32());break;case 7:i.indexMetas&&i.indexMetas.length||(i.indexMetas=[]),i.indexMetas.push($root.main.proto.IndexMeta.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableMeta"))throw $util.ProtocolError("missing required 'tableMeta'",{instance:i});if(!i.hasOwnProperty("reservedThroughput"))throw $util.ProtocolError("missing required 'reservedThroughput'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.TableMeta.verify(t.tableMeta);if(e)return"tableMeta."+e}{var e=$root.main.proto.ReservedThroughput.verify(t.reservedThroughput);if(e)return"reservedThroughput."+e}if(t.tableOptions!=null&&t.hasOwnProperty("tableOptions")){var e=$root.main.proto.TableOptions.verify(t.tableOptions);if(e)return"tableOptions."+e}if(t.partitions!=null&&t.hasOwnProperty("partitions")){if(!Array.isArray(t.partitions))return"partitions: array expected";for(var r=0;r<t.partitions.length;++r){var e=$root.main.proto.PartitionRange.verify(t.partitions[r]);if(e)return"partitions."+e}}if(t.streamSpec!=null&&t.hasOwnProperty("streamSpec")){var e=$root.main.proto.StreamSpecification.verify(t.streamSpec);if(e)return"streamSpec."+e}if(t.indexMetas!=null&&t.hasOwnProperty("indexMetas")){if(!Array.isArray(t.indexMetas))return"indexMetas: array expected";for(var r=0;r<t.indexMetas.length;++r){var e=$root.main.proto.IndexMeta.verify(t.indexMetas[r]);if(e)return"indexMetas."+e}}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.CreateTableRequest)return t;var e=new $root.main.proto.CreateTableRequest;if(t.tableMeta!=null){if(typeof t.tableMeta!="object")throw TypeError(".main.proto.CreateTableRequest.tableMeta: object expected");e.tableMeta=$root.main.proto.TableMeta.fromObject(t.tableMeta)}if(t.reservedThroughput!=null){if(typeof t.reservedThroughput!="object")throw TypeError(".main.proto.CreateTableRequest.reservedThroughput: object expected");e.reservedThroughput=$root.main.proto.ReservedThroughput.fromObject(t.reservedThroughput)}if(t.tableOptions!=null){if(typeof t.tableOptions!="object")throw TypeError(".main.proto.CreateTableRequest.tableOptions: object expected");e.tableOptions=$root.main.proto.TableOptions.fromObject(t.tableOptions)}if(t.partitions){if(!Array.isArray(t.partitions))throw TypeError(".main.proto.CreateTableRequest.partitions: array expected");e.partitions=[];for(var r=0;r<t.partitions.length;++r){if(typeof t.partitions[r]!="object")throw TypeError(".main.proto.CreateTableRequest.partitions: object expected");e.partitions[r]=$root.main.proto.PartitionRange.fromObject(t.partitions[r])}}if(t.streamSpec!=null){if(typeof t.streamSpec!="object")throw TypeError(".main.proto.CreateTableRequest.streamSpec: object expected");e.streamSpec=$root.main.proto.StreamSpecification.fromObject(t.streamSpec)}if(t.indexMetas){if(!Array.isArray(t.indexMetas))throw TypeError(".main.proto.CreateTableRequest.indexMetas: array expected");e.indexMetas=[];for(var r=0;r<t.indexMetas.length;++r){if(typeof t.indexMetas[r]!="object")throw TypeError(".main.proto.CreateTableRequest.indexMetas: object expected");e.indexMetas[r]=$root.main.proto.IndexMeta.fromObject(t.indexMetas[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.partitions=[],r.indexMetas=[]),e.defaults&&(r.tableMeta=null,r.reservedThroughput=null,r.tableOptions=null,r.streamSpec=null),t.tableMeta!=null&&t.hasOwnProperty("tableMeta")&&(r.tableMeta=$root.main.proto.TableMeta.toObject(t.tableMeta,e)),t.reservedThroughput!=null&&t.hasOwnProperty("reservedThroughput")&&(r.reservedThroughput=$root.main.proto.ReservedThroughput.toObject(t.reservedThroughput,e)),t.tableOptions!=null&&t.hasOwnProperty("tableOptions")&&(r.tableOptions=$root.main.proto.TableOptions.toObject(t.tableOptions,e)),t.partitions&&t.partitions.length){r.partitions=[];for(var i=0;i<t.partitions.length;++i)r.partitions[i]=$root.main.proto.PartitionRange.toObject(t.partitions[i],e)}if(t.streamSpec!=null&&t.hasOwnProperty("streamSpec")&&(r.streamSpec=$root.main.proto.StreamSpecification.toObject(t.streamSpec,e)),t.indexMetas&&t.indexMetas.length){r.indexMetas=[];for(var i=0;i<t.indexMetas.length;++i)r.indexMetas[i]=$root.main.proto.IndexMeta.toObject(t.indexMetas[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.CreateTableResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.CreateTableResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.main.proto.CreateTableResponse?t:new $root.main.proto.CreateTableResponse},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.CreateIndexRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.mainTableName="",n.prototype.indexMeta=null,n.prototype.includeBaseData=!1,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.mainTableName),$root.main.proto.IndexMeta.encode(t.indexMeta,e.uint32(18).fork()).ldelim(),t.includeBaseData!=null&&Object.hasOwnProperty.call(t,"includeBaseData")&&e.uint32(24).bool(t.includeBaseData),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.CreateIndexRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.mainTableName=t.string();break;case 2:i.indexMeta=$root.main.proto.IndexMeta.decode(t,t.uint32());break;case 3:i.includeBaseData=t.bool();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("mainTableName"))throw $util.ProtocolError("missing required 'mainTableName'",{instance:i});if(!i.hasOwnProperty("indexMeta"))throw $util.ProtocolError("missing required 'indexMeta'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.mainTableName))return"mainTableName: string expected";{var e=$root.main.proto.IndexMeta.verify(t.indexMeta);if(e)return"indexMeta."+e}return t.includeBaseData!=null&&t.hasOwnProperty("includeBaseData")&&typeof t.includeBaseData!="boolean"?"includeBaseData: boolean expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.CreateIndexRequest)return t;var e=new $root.main.proto.CreateIndexRequest;if(t.mainTableName!=null&&(e.mainTableName=String(t.mainTableName)),t.indexMeta!=null){if(typeof t.indexMeta!="object")throw TypeError(".main.proto.CreateIndexRequest.indexMeta: object expected");e.indexMeta=$root.main.proto.IndexMeta.fromObject(t.indexMeta)}return t.includeBaseData!=null&&(e.includeBaseData=!!t.includeBaseData),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.mainTableName="",r.indexMeta=null,r.includeBaseData=!1),t.mainTableName!=null&&t.hasOwnProperty("mainTableName")&&(r.mainTableName=t.mainTableName),t.indexMeta!=null&&t.hasOwnProperty("indexMeta")&&(r.indexMeta=$root.main.proto.IndexMeta.toObject(t.indexMeta,e)),t.includeBaseData!=null&&t.hasOwnProperty("includeBaseData")&&(r.includeBaseData=t.includeBaseData),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.CreateIndexResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.CreateIndexResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.main.proto.CreateIndexResponse?t:new $root.main.proto.CreateIndexResponse},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DropIndexRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.mainTableName="",n.prototype.indexName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.mainTableName),e.uint32(18).string(t.indexName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.DropIndexRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.mainTableName=t.string();break;case 2:i.indexName=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("mainTableName"))throw $util.ProtocolError("missing required 'mainTableName'",{instance:i});if(!i.hasOwnProperty("indexName"))throw $util.ProtocolError("missing required 'indexName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.mainTableName)?$util.isString(t.indexName)?null:"indexName: string expected":"mainTableName: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.DropIndexRequest)return t;var e=new $root.main.proto.DropIndexRequest;return t.mainTableName!=null&&(e.mainTableName=String(t.mainTableName)),t.indexName!=null&&(e.indexName=String(t.indexName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.mainTableName="",r.indexName=""),t.mainTableName!=null&&t.hasOwnProperty("mainTableName")&&(r.mainTableName=t.mainTableName),t.indexName!=null&&t.hasOwnProperty("indexName")&&(r.indexName=t.indexName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DropIndexResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.DropIndexResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.main.proto.DropIndexResponse?t:new $root.main.proto.DropIndexResponse},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.UpdateTableRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.reservedThroughput=null,n.prototype.tableOptions=null,n.prototype.streamSpec=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.tableName),t.reservedThroughput!=null&&Object.hasOwnProperty.call(t,"reservedThroughput")&&$root.main.proto.ReservedThroughput.encode(t.reservedThroughput,e.uint32(18).fork()).ldelim(),t.tableOptions!=null&&Object.hasOwnProperty.call(t,"tableOptions")&&$root.main.proto.TableOptions.encode(t.tableOptions,e.uint32(26).fork()).ldelim(),t.streamSpec!=null&&Object.hasOwnProperty.call(t,"streamSpec")&&$root.main.proto.StreamSpecification.encode(t.streamSpec,e.uint32(34).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.UpdateTableRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.reservedThroughput=$root.main.proto.ReservedThroughput.decode(t,t.uint32());break;case 3:i.tableOptions=$root.main.proto.TableOptions.decode(t,t.uint32());break;case 4:i.streamSpec=$root.main.proto.StreamSpecification.decode(t,t.uint32());break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(t.reservedThroughput!=null&&t.hasOwnProperty("reservedThroughput")){var e=$root.main.proto.ReservedThroughput.verify(t.reservedThroughput);if(e)return"reservedThroughput."+e}if(t.tableOptions!=null&&t.hasOwnProperty("tableOptions")){var e=$root.main.proto.TableOptions.verify(t.tableOptions);if(e)return"tableOptions."+e}if(t.streamSpec!=null&&t.hasOwnProperty("streamSpec")){var e=$root.main.proto.StreamSpecification.verify(t.streamSpec);if(e)return"streamSpec."+e}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.UpdateTableRequest)return t;var e=new $root.main.proto.UpdateTableRequest;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.reservedThroughput!=null){if(typeof t.reservedThroughput!="object")throw TypeError(".main.proto.UpdateTableRequest.reservedThroughput: object expected");e.reservedThroughput=$root.main.proto.ReservedThroughput.fromObject(t.reservedThroughput)}if(t.tableOptions!=null){if(typeof t.tableOptions!="object")throw TypeError(".main.proto.UpdateTableRequest.tableOptions: object expected");e.tableOptions=$root.main.proto.TableOptions.fromObject(t.tableOptions)}if(t.streamSpec!=null){if(typeof t.streamSpec!="object")throw TypeError(".main.proto.UpdateTableRequest.streamSpec: object expected");e.streamSpec=$root.main.proto.StreamSpecification.fromObject(t.streamSpec)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",r.reservedThroughput=null,r.tableOptions=null,r.streamSpec=null),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.reservedThroughput!=null&&t.hasOwnProperty("reservedThroughput")&&(r.reservedThroughput=$root.main.proto.ReservedThroughput.toObject(t.reservedThroughput,e)),t.tableOptions!=null&&t.hasOwnProperty("tableOptions")&&(r.tableOptions=$root.main.proto.TableOptions.toObject(t.tableOptions,e)),t.streamSpec!=null&&t.hasOwnProperty("streamSpec")&&(r.streamSpec=$root.main.proto.StreamSpecification.toObject(t.streamSpec,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.UpdateTableResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.reservedThroughputDetails=null,n.prototype.tableOptions=null,n.prototype.streamDetails=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),$root.main.proto.ReservedThroughputDetails.encode(t.reservedThroughputDetails,e.uint32(10).fork()).ldelim(),$root.main.proto.TableOptions.encode(t.tableOptions,e.uint32(18).fork()).ldelim(),t.streamDetails!=null&&Object.hasOwnProperty.call(t,"streamDetails")&&$root.main.proto.StreamDetails.encode(t.streamDetails,e.uint32(26).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.UpdateTableResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.reservedThroughputDetails=$root.main.proto.ReservedThroughputDetails.decode(t,t.uint32());break;case 2:i.tableOptions=$root.main.proto.TableOptions.decode(t,t.uint32());break;case 3:i.streamDetails=$root.main.proto.StreamDetails.decode(t,t.uint32());break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("reservedThroughputDetails"))throw $util.ProtocolError("missing required 'reservedThroughputDetails'",{instance:i});if(!i.hasOwnProperty("tableOptions"))throw $util.ProtocolError("missing required 'tableOptions'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.ReservedThroughputDetails.verify(t.reservedThroughputDetails);if(e)return"reservedThroughputDetails."+e}{var e=$root.main.proto.TableOptions.verify(t.tableOptions);if(e)return"tableOptions."+e}if(t.streamDetails!=null&&t.hasOwnProperty("streamDetails")){var e=$root.main.proto.StreamDetails.verify(t.streamDetails);if(e)return"streamDetails."+e}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.UpdateTableResponse)return t;var e=new $root.main.proto.UpdateTableResponse;if(t.reservedThroughputDetails!=null){if(typeof t.reservedThroughputDetails!="object")throw TypeError(".main.proto.UpdateTableResponse.reservedThroughputDetails: object expected");e.reservedThroughputDetails=$root.main.proto.ReservedThroughputDetails.fromObject(t.reservedThroughputDetails)}if(t.tableOptions!=null){if(typeof t.tableOptions!="object")throw TypeError(".main.proto.UpdateTableResponse.tableOptions: object expected");e.tableOptions=$root.main.proto.TableOptions.fromObject(t.tableOptions)}if(t.streamDetails!=null){if(typeof t.streamDetails!="object")throw TypeError(".main.proto.UpdateTableResponse.streamDetails: object expected");e.streamDetails=$root.main.proto.StreamDetails.fromObject(t.streamDetails)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.reservedThroughputDetails=null,r.tableOptions=null,r.streamDetails=null),t.reservedThroughputDetails!=null&&t.hasOwnProperty("reservedThroughputDetails")&&(r.reservedThroughputDetails=$root.main.proto.ReservedThroughputDetails.toObject(t.reservedThroughputDetails,e)),t.tableOptions!=null&&t.hasOwnProperty("tableOptions")&&(r.tableOptions=$root.main.proto.TableOptions.toObject(t.tableOptions,e)),t.streamDetails!=null&&t.hasOwnProperty("streamDetails")&&(r.streamDetails=$root.main.proto.StreamDetails.toObject(t.streamDetails,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DescribeTableRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.DescribeTableRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.tableName)?null:"tableName: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.DescribeTableRequest)return t;var e=new $root.main.proto.DescribeTableRequest;return t.tableName!=null&&(e.tableName=String(t.tableName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DescribeTableResponse=function(){function n(o){if(this.shardSplits=[],this.indexMetas=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableMeta=null,n.prototype.reservedThroughputDetails=null,n.prototype.tableOptions=null,n.prototype.tableStatus=1,n.prototype.streamDetails=null,n.prototype.shardSplits=$util.emptyArray,n.prototype.indexMetas=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),$root.main.proto.TableMeta.encode(t.tableMeta,e.uint32(10).fork()).ldelim(),$root.main.proto.ReservedThroughputDetails.encode(t.reservedThroughputDetails,e.uint32(18).fork()).ldelim(),$root.main.proto.TableOptions.encode(t.tableOptions,e.uint32(26).fork()).ldelim(),e.uint32(32).int32(t.tableStatus),t.streamDetails!=null&&Object.hasOwnProperty.call(t,"streamDetails")&&$root.main.proto.StreamDetails.encode(t.streamDetails,e.uint32(42).fork()).ldelim(),t.shardSplits!=null&&t.shardSplits.length)for(var r=0;r<t.shardSplits.length;++r)e.uint32(50).bytes(t.shardSplits[r]);if(t.indexMetas!=null&&t.indexMetas.length)for(var r=0;r<t.indexMetas.length;++r)$root.main.proto.IndexMeta.encode(t.indexMetas[r],e.uint32(66).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.DescribeTableResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableMeta=$root.main.proto.TableMeta.decode(t,t.uint32());break;case 2:i.reservedThroughputDetails=$root.main.proto.ReservedThroughputDetails.decode(t,t.uint32());break;case 3:i.tableOptions=$root.main.proto.TableOptions.decode(t,t.uint32());break;case 4:i.tableStatus=t.int32();break;case 5:i.streamDetails=$root.main.proto.StreamDetails.decode(t,t.uint32());break;case 6:i.shardSplits&&i.shardSplits.length||(i.shardSplits=[]),i.shardSplits.push(t.bytes());break;case 8:i.indexMetas&&i.indexMetas.length||(i.indexMetas=[]),i.indexMetas.push($root.main.proto.IndexMeta.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableMeta"))throw $util.ProtocolError("missing required 'tableMeta'",{instance:i});if(!i.hasOwnProperty("reservedThroughputDetails"))throw $util.ProtocolError("missing required 'reservedThroughputDetails'",{instance:i});if(!i.hasOwnProperty("tableOptions"))throw $util.ProtocolError("missing required 'tableOptions'",{instance:i});if(!i.hasOwnProperty("tableStatus"))throw $util.ProtocolError("missing required 'tableStatus'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.TableMeta.verify(t.tableMeta);if(e)return"tableMeta."+e}{var e=$root.main.proto.ReservedThroughputDetails.verify(t.reservedThroughputDetails);if(e)return"reservedThroughputDetails."+e}{var e=$root.main.proto.TableOptions.verify(t.tableOptions);if(e)return"tableOptions."+e}switch(t.tableStatus){default:return"tableStatus: enum value expected";case 1:case 2:case 3:case 4:case 5:break}if(t.streamDetails!=null&&t.hasOwnProperty("streamDetails")){var e=$root.main.proto.StreamDetails.verify(t.streamDetails);if(e)return"streamDetails."+e}if(t.shardSplits!=null&&t.hasOwnProperty("shardSplits")){if(!Array.isArray(t.shardSplits))return"shardSplits: array expected";for(var r=0;r<t.shardSplits.length;++r)if(!(t.shardSplits[r]&&typeof t.shardSplits[r].length=="number"||$util.isString(t.shardSplits[r])))return"shardSplits: buffer[] expected"}if(t.indexMetas!=null&&t.hasOwnProperty("indexMetas")){if(!Array.isArray(t.indexMetas))return"indexMetas: array expected";for(var r=0;r<t.indexMetas.length;++r){var e=$root.main.proto.IndexMeta.verify(t.indexMetas[r]);if(e)return"indexMetas."+e}}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.DescribeTableResponse)return t;var e=new $root.main.proto.DescribeTableResponse;if(t.tableMeta!=null){if(typeof t.tableMeta!="object")throw TypeError(".main.proto.DescribeTableResponse.tableMeta: object expected");e.tableMeta=$root.main.proto.TableMeta.fromObject(t.tableMeta)}if(t.reservedThroughputDetails!=null){if(typeof t.reservedThroughputDetails!="object")throw TypeError(".main.proto.DescribeTableResponse.reservedThroughputDetails: object expected");e.reservedThroughputDetails=$root.main.proto.ReservedThroughputDetails.fromObject(t.reservedThroughputDetails)}if(t.tableOptions!=null){if(typeof t.tableOptions!="object")throw TypeError(".main.proto.DescribeTableResponse.tableOptions: object expected");e.tableOptions=$root.main.proto.TableOptions.fromObject(t.tableOptions)}switch(t.tableStatus){case"ACTIVE":case 1:e.tableStatus=1;break;case"INACTIVE":case 2:e.tableStatus=2;break;case"LOADING":case 3:e.tableStatus=3;break;case"UNLOADING":case 4:e.tableStatus=4;break;case"UPDATING":case 5:e.tableStatus=5;break}if(t.streamDetails!=null){if(typeof t.streamDetails!="object")throw TypeError(".main.proto.DescribeTableResponse.streamDetails: object expected");e.streamDetails=$root.main.proto.StreamDetails.fromObject(t.streamDetails)}if(t.shardSplits){if(!Array.isArray(t.shardSplits))throw TypeError(".main.proto.DescribeTableResponse.shardSplits: array expected");e.shardSplits=[];for(var r=0;r<t.shardSplits.length;++r)typeof t.shardSplits[r]=="string"?$util.base64.decode(t.shardSplits[r],e.shardSplits[r]=$util.newBuffer($util.base64.length(t.shardSplits[r])),0):t.shardSplits[r].length&&(e.shardSplits[r]=t.shardSplits[r])}if(t.indexMetas){if(!Array.isArray(t.indexMetas))throw TypeError(".main.proto.DescribeTableResponse.indexMetas: array expected");e.indexMetas=[];for(var r=0;r<t.indexMetas.length;++r){if(typeof t.indexMetas[r]!="object")throw TypeError(".main.proto.DescribeTableResponse.indexMetas: object expected");e.indexMetas[r]=$root.main.proto.IndexMeta.fromObject(t.indexMetas[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.shardSplits=[],r.indexMetas=[]),e.defaults&&(r.tableMeta=null,r.reservedThroughputDetails=null,r.tableOptions=null,r.tableStatus=e.enums===String?"ACTIVE":1,r.streamDetails=null),t.tableMeta!=null&&t.hasOwnProperty("tableMeta")&&(r.tableMeta=$root.main.proto.TableMeta.toObject(t.tableMeta,e)),t.reservedThroughputDetails!=null&&t.hasOwnProperty("reservedThroughputDetails")&&(r.reservedThroughputDetails=$root.main.proto.ReservedThroughputDetails.toObject(t.reservedThroughputDetails,e)),t.tableOptions!=null&&t.hasOwnProperty("tableOptions")&&(r.tableOptions=$root.main.proto.TableOptions.toObject(t.tableOptions,e)),t.tableStatus!=null&&t.hasOwnProperty("tableStatus")&&(r.tableStatus=e.enums===String?$root.main.proto.TableStatus[t.tableStatus]:t.tableStatus),t.streamDetails!=null&&t.hasOwnProperty("streamDetails")&&(r.streamDetails=$root.main.proto.StreamDetails.toObject(t.streamDetails,e)),t.shardSplits&&t.shardSplits.length){r.shardSplits=[];for(var i=0;i<t.shardSplits.length;++i)r.shardSplits[i]=e.bytes===String?$util.base64.encode(t.shardSplits[i],0,t.shardSplits[i].length):e.bytes===Array?Array.prototype.slice.call(t.shardSplits[i]):t.shardSplits[i]}if(t.indexMetas&&t.indexMetas.length){r.indexMetas=[];for(var i=0;i<t.indexMetas.length;++i)r.indexMetas[i]=$root.main.proto.IndexMeta.toObject(t.indexMetas[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ListTableRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.ListTableRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.main.proto.ListTableRequest?t:new $root.main.proto.ListTableRequest},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ListTableResponse=function(){function n(o){if(this.tableNames=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableNames=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.tableNames!=null&&t.tableNames.length)for(var r=0;r<t.tableNames.length;++r)e.uint32(10).string(t.tableNames[r]);return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.ListTableResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableNames&&i.tableNames.length||(i.tableNames=[]),i.tableNames.push(t.string());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.tableNames!=null&&t.hasOwnProperty("tableNames")){if(!Array.isArray(t.tableNames))return"tableNames: array expected";for(var e=0;e<t.tableNames.length;++e)if(!$util.isString(t.tableNames[e]))return"tableNames: string[] expected"}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.ListTableResponse)return t;var e=new $root.main.proto.ListTableResponse;if(t.tableNames){if(!Array.isArray(t.tableNames))throw TypeError(".main.proto.ListTableResponse.tableNames: array expected");e.tableNames=[];for(var r=0;r<t.tableNames.length;++r)e.tableNames[r]=String(t.tableNames[r])}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.tableNames=[]),t.tableNames&&t.tableNames.length){r.tableNames=[];for(var i=0;i<t.tableNames.length;++i)r.tableNames[i]=t.tableNames[i]}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DeleteTableRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.DeleteTableRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.tableName)?null:"tableName: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.DeleteTableRequest)return t;var e=new $root.main.proto.DeleteTableRequest;return t.tableName!=null&&(e.tableName=String(t.tableName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DeleteTableResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.DeleteTableResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.main.proto.DeleteTableResponse?t:new $root.main.proto.DeleteTableResponse},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.LoadTableRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.LoadTableRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.tableName)?null:"tableName: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.LoadTableRequest)return t;var e=new $root.main.proto.LoadTableRequest;return t.tableName!=null&&(e.tableName=String(t.tableName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.LoadTableResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.LoadTableResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.main.proto.LoadTableResponse?t:new $root.main.proto.LoadTableResponse},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.UnloadTableRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.UnloadTableRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.tableName)?null:"tableName: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.UnloadTableRequest)return t;var e=new $root.main.proto.UnloadTableRequest;return t.tableName!=null&&(e.tableName=String(t.tableName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.UnloadTableResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.UnloadTableResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.main.proto.UnloadTableResponse?t:new $root.main.proto.UnloadTableResponse},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TimeRange=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.startTime=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.endTime=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.specificTime=$util.Long?$util.Long.fromBits(0,0,!1):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.startTime!=null&&Object.hasOwnProperty.call(t,"startTime")&&e.uint32(8).int64(t.startTime),t.endTime!=null&&Object.hasOwnProperty.call(t,"endTime")&&e.uint32(16).int64(t.endTime),t.specificTime!=null&&Object.hasOwnProperty.call(t,"specificTime")&&e.uint32(24).int64(t.specificTime),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.TimeRange;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.startTime=t.int64();break;case 2:i.endTime=t.int64();break;case 3:i.specificTime=t.int64();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.startTime!=null&&t.hasOwnProperty("startTime")&&!$util.isInteger(t.startTime)&&!(t.startTime&&$util.isInteger(t.startTime.low)&&$util.isInteger(t.startTime.high))?"startTime: integer|Long expected":t.endTime!=null&&t.hasOwnProperty("endTime")&&!$util.isInteger(t.endTime)&&!(t.endTime&&$util.isInteger(t.endTime.low)&&$util.isInteger(t.endTime.high))?"endTime: integer|Long expected":t.specificTime!=null&&t.hasOwnProperty("specificTime")&&!$util.isInteger(t.specificTime)&&!(t.specificTime&&$util.isInteger(t.specificTime.low)&&$util.isInteger(t.specificTime.high))?"specificTime: integer|Long expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.TimeRange)return t;var e=new $root.main.proto.TimeRange;return t.startTime!=null&&($util.Long?(e.startTime=$util.Long.fromValue(t.startTime)).unsigned=!1:typeof t.startTime=="string"?e.startTime=parseInt(t.startTime,10):typeof t.startTime=="number"?e.startTime=t.startTime:typeof t.startTime=="object"&&(e.startTime=new $util.LongBits(t.startTime.low>>>0,t.startTime.high>>>0).toNumber())),t.endTime!=null&&($util.Long?(e.endTime=$util.Long.fromValue(t.endTime)).unsigned=!1:typeof t.endTime=="string"?e.endTime=parseInt(t.endTime,10):typeof t.endTime=="number"?e.endTime=t.endTime:typeof t.endTime=="object"&&(e.endTime=new $util.LongBits(t.endTime.low>>>0,t.endTime.high>>>0).toNumber())),t.specificTime!=null&&($util.Long?(e.specificTime=$util.Long.fromValue(t.specificTime)).unsigned=!1:typeof t.specificTime=="string"?e.specificTime=parseInt(t.specificTime,10):typeof t.specificTime=="number"?e.specificTime=t.specificTime:typeof t.specificTime=="object"&&(e.specificTime=new $util.LongBits(t.specificTime.low>>>0,t.specificTime.high>>>0).toNumber())),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if($util.Long){var i=new $util.Long(0,0,!1);r.startTime=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.startTime=e.longs===String?"0":0;if($util.Long){var i=new $util.Long(0,0,!1);r.endTime=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.endTime=e.longs===String?"0":0;if($util.Long){var i=new $util.Long(0,0,!1);r.specificTime=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.specificTime=e.longs===String?"0":0}return t.startTime!=null&&t.hasOwnProperty("startTime")&&(typeof t.startTime=="number"?r.startTime=e.longs===String?String(t.startTime):t.startTime:r.startTime=e.longs===String?$util.Long.prototype.toString.call(t.startTime):e.longs===Number?new $util.LongBits(t.startTime.low>>>0,t.startTime.high>>>0).toNumber():t.startTime),t.endTime!=null&&t.hasOwnProperty("endTime")&&(typeof t.endTime=="number"?r.endTime=e.longs===String?String(t.endTime):t.endTime:r.endTime=e.longs===String?$util.Long.prototype.toString.call(t.endTime):e.longs===Number?new $util.LongBits(t.endTime.low>>>0,t.endTime.high>>>0).toNumber():t.endTime),t.specificTime!=null&&t.hasOwnProperty("specificTime")&&(typeof t.specificTime=="number"?r.specificTime=e.longs===String?String(t.specificTime):t.specificTime:r.specificTime=e.longs===String?$util.Long.prototype.toString.call(t.specificTime):e.longs===Number?new $util.LongBits(t.specificTime.low>>>0,t.specificTime.high>>>0).toNumber():t.specificTime),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ReturnType=function(){var n={},o=Object.create(n);return o[n[0]="RT_NONE"]=0,o[n[1]="RT_PK"]=1,o[n[2]="RT_AFTER_MODIFY"]=2,o}(),c.ReturnContent=function(){function n(o){if(this.returnColumnNames=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.returnType=0,n.prototype.returnColumnNames=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.returnType!=null&&Object.hasOwnProperty.call(t,"returnType")&&e.uint32(8).int32(t.returnType),t.returnColumnNames!=null&&t.returnColumnNames.length)for(var r=0;r<t.returnColumnNames.length;++r)e.uint32(18).string(t.returnColumnNames[r]);return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.ReturnContent;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.returnType=t.int32();break;case 2:i.returnColumnNames&&i.returnColumnNames.length||(i.returnColumnNames=[]),i.returnColumnNames.push(t.string());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.returnType!=null&&t.hasOwnProperty("returnType"))switch(t.returnType){default:return"returnType: enum value expected";case 0:case 1:case 2:break}if(t.returnColumnNames!=null&&t.hasOwnProperty("returnColumnNames")){if(!Array.isArray(t.returnColumnNames))return"returnColumnNames: array expected";for(var e=0;e<t.returnColumnNames.length;++e)if(!$util.isString(t.returnColumnNames[e]))return"returnColumnNames: string[] expected"}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.ReturnContent)return t;var e=new $root.main.proto.ReturnContent;switch(t.returnType){case"RT_NONE":case 0:e.returnType=0;break;case"RT_PK":case 1:e.returnType=1;break;case"RT_AFTER_MODIFY":case 2:e.returnType=2;break}if(t.returnColumnNames){if(!Array.isArray(t.returnColumnNames))throw TypeError(".main.proto.ReturnContent.returnColumnNames: array expected");e.returnColumnNames=[];for(var r=0;r<t.returnColumnNames.length;++r)e.returnColumnNames[r]=String(t.returnColumnNames[r])}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.returnColumnNames=[]),e.defaults&&(r.returnType=e.enums===String?"RT_NONE":0),t.returnType!=null&&t.hasOwnProperty("returnType")&&(r.returnType=e.enums===String?$root.main.proto.ReturnType[t.returnType]:t.returnType),t.returnColumnNames&&t.returnColumnNames.length){r.returnColumnNames=[];for(var i=0;i<t.returnColumnNames.length;++i)r.returnColumnNames[i]=t.returnColumnNames[i]}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GetRowRequest=function(){function n(o){if(this.columnsToGet=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.primaryKey=$util.newBuffer([]),n.prototype.columnsToGet=$util.emptyArray,n.prototype.timeRange=null,n.prototype.maxVersions=0,n.prototype.cacheBlocks=!0,n.prototype.filter=$util.newBuffer([]),n.prototype.startColumn="",n.prototype.endColumn="",n.prototype.token=$util.newBuffer([]),n.prototype.transactionId="",n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e.uint32(18).bytes(t.primaryKey),t.columnsToGet!=null&&t.columnsToGet.length)for(var r=0;r<t.columnsToGet.length;++r)e.uint32(26).string(t.columnsToGet[r]);return t.timeRange!=null&&Object.hasOwnProperty.call(t,"timeRange")&&$root.main.proto.TimeRange.encode(t.timeRange,e.uint32(34).fork()).ldelim(),t.maxVersions!=null&&Object.hasOwnProperty.call(t,"maxVersions")&&e.uint32(40).int32(t.maxVersions),t.cacheBlocks!=null&&Object.hasOwnProperty.call(t,"cacheBlocks")&&e.uint32(48).bool(t.cacheBlocks),t.filter!=null&&Object.hasOwnProperty.call(t,"filter")&&e.uint32(58).bytes(t.filter),t.startColumn!=null&&Object.hasOwnProperty.call(t,"startColumn")&&e.uint32(66).string(t.startColumn),t.endColumn!=null&&Object.hasOwnProperty.call(t,"endColumn")&&e.uint32(74).string(t.endColumn),t.token!=null&&Object.hasOwnProperty.call(t,"token")&&e.uint32(82).bytes(t.token),t.transactionId!=null&&Object.hasOwnProperty.call(t,"transactionId")&&e.uint32(90).string(t.transactionId),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.GetRowRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.primaryKey=t.bytes();break;case 3:i.columnsToGet&&i.columnsToGet.length||(i.columnsToGet=[]),i.columnsToGet.push(t.string());break;case 4:i.timeRange=$root.main.proto.TimeRange.decode(t,t.uint32());break;case 5:i.maxVersions=t.int32();break;case 6:i.cacheBlocks=t.bool();break;case 7:i.filter=t.bytes();break;case 8:i.startColumn=t.string();break;case 9:i.endColumn=t.string();break;case 10:i.token=t.bytes();break;case 11:i.transactionId=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});if(!i.hasOwnProperty("primaryKey"))throw $util.ProtocolError("missing required 'primaryKey'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(!(t.primaryKey&&typeof t.primaryKey.length=="number"||$util.isString(t.primaryKey)))return"primaryKey: buffer expected";if(t.columnsToGet!=null&&t.hasOwnProperty("columnsToGet")){if(!Array.isArray(t.columnsToGet))return"columnsToGet: array expected";for(var e=0;e<t.columnsToGet.length;++e)if(!$util.isString(t.columnsToGet[e]))return"columnsToGet: string[] expected"}if(t.timeRange!=null&&t.hasOwnProperty("timeRange")){var r=$root.main.proto.TimeRange.verify(t.timeRange);if(r)return"timeRange."+r}return t.maxVersions!=null&&t.hasOwnProperty("maxVersions")&&!$util.isInteger(t.maxVersions)?"maxVersions: integer expected":t.cacheBlocks!=null&&t.hasOwnProperty("cacheBlocks")&&typeof t.cacheBlocks!="boolean"?"cacheBlocks: boolean expected":t.filter!=null&&t.hasOwnProperty("filter")&&!(t.filter&&typeof t.filter.length=="number"||$util.isString(t.filter))?"filter: buffer expected":t.startColumn!=null&&t.hasOwnProperty("startColumn")&&!$util.isString(t.startColumn)?"startColumn: string expected":t.endColumn!=null&&t.hasOwnProperty("endColumn")&&!$util.isString(t.endColumn)?"endColumn: string expected":t.token!=null&&t.hasOwnProperty("token")&&!(t.token&&typeof t.token.length=="number"||$util.isString(t.token))?"token: buffer expected":t.transactionId!=null&&t.hasOwnProperty("transactionId")&&!$util.isString(t.transactionId)?"transactionId: string expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.GetRowRequest)return t;var e=new $root.main.proto.GetRowRequest;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.primaryKey!=null&&(typeof t.primaryKey=="string"?$util.base64.decode(t.primaryKey,e.primaryKey=$util.newBuffer($util.base64.length(t.primaryKey)),0):t.primaryKey.length&&(e.primaryKey=t.primaryKey)),t.columnsToGet){if(!Array.isArray(t.columnsToGet))throw TypeError(".main.proto.GetRowRequest.columnsToGet: array expected");e.columnsToGet=[];for(var r=0;r<t.columnsToGet.length;++r)e.columnsToGet[r]=String(t.columnsToGet[r])}if(t.timeRange!=null){if(typeof t.timeRange!="object")throw TypeError(".main.proto.GetRowRequest.timeRange: object expected");e.timeRange=$root.main.proto.TimeRange.fromObject(t.timeRange)}return t.maxVersions!=null&&(e.maxVersions=t.maxVersions|0),t.cacheBlocks!=null&&(e.cacheBlocks=!!t.cacheBlocks),t.filter!=null&&(typeof t.filter=="string"?$util.base64.decode(t.filter,e.filter=$util.newBuffer($util.base64.length(t.filter)),0):t.filter.length&&(e.filter=t.filter)),t.startColumn!=null&&(e.startColumn=String(t.startColumn)),t.endColumn!=null&&(e.endColumn=String(t.endColumn)),t.token!=null&&(typeof t.token=="string"?$util.base64.decode(t.token,e.token=$util.newBuffer($util.base64.length(t.token)),0):t.token.length&&(e.token=t.token)),t.transactionId!=null&&(e.transactionId=String(t.transactionId)),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.columnsToGet=[]),e.defaults&&(r.tableName="",e.bytes===String?r.primaryKey="":(r.primaryKey=[],e.bytes!==Array&&(r.primaryKey=$util.newBuffer(r.primaryKey))),r.timeRange=null,r.maxVersions=0,r.cacheBlocks=!0,e.bytes===String?r.filter="":(r.filter=[],e.bytes!==Array&&(r.filter=$util.newBuffer(r.filter))),r.startColumn="",r.endColumn="",e.bytes===String?r.token="":(r.token=[],e.bytes!==Array&&(r.token=$util.newBuffer(r.token))),r.transactionId=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.primaryKey!=null&&t.hasOwnProperty("primaryKey")&&(r.primaryKey=e.bytes===String?$util.base64.encode(t.primaryKey,0,t.primaryKey.length):e.bytes===Array?Array.prototype.slice.call(t.primaryKey):t.primaryKey),t.columnsToGet&&t.columnsToGet.length){r.columnsToGet=[];for(var i=0;i<t.columnsToGet.length;++i)r.columnsToGet[i]=t.columnsToGet[i]}return t.timeRange!=null&&t.hasOwnProperty("timeRange")&&(r.timeRange=$root.main.proto.TimeRange.toObject(t.timeRange,e)),t.maxVersions!=null&&t.hasOwnProperty("maxVersions")&&(r.maxVersions=t.maxVersions),t.cacheBlocks!=null&&t.hasOwnProperty("cacheBlocks")&&(r.cacheBlocks=t.cacheBlocks),t.filter!=null&&t.hasOwnProperty("filter")&&(r.filter=e.bytes===String?$util.base64.encode(t.filter,0,t.filter.length):e.bytes===Array?Array.prototype.slice.call(t.filter):t.filter),t.startColumn!=null&&t.hasOwnProperty("startColumn")&&(r.startColumn=t.startColumn),t.endColumn!=null&&t.hasOwnProperty("endColumn")&&(r.endColumn=t.endColumn),t.token!=null&&t.hasOwnProperty("token")&&(r.token=e.bytes===String?$util.base64.encode(t.token,0,t.token.length):e.bytes===Array?Array.prototype.slice.call(t.token):t.token),t.transactionId!=null&&t.hasOwnProperty("transactionId")&&(r.transactionId=t.transactionId),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GetRowResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.consumed=null,n.prototype.row=$util.newBuffer([]),n.prototype.nextToken=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),$root.main.proto.ConsumedCapacity.encode(t.consumed,e.uint32(10).fork()).ldelim(),e.uint32(18).bytes(t.row),t.nextToken!=null&&Object.hasOwnProperty.call(t,"nextToken")&&e.uint32(26).bytes(t.nextToken),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.GetRowResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.consumed=$root.main.proto.ConsumedCapacity.decode(t,t.uint32());break;case 2:i.row=t.bytes();break;case 3:i.nextToken=t.bytes();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("consumed"))throw $util.ProtocolError("missing required 'consumed'",{instance:i});if(!i.hasOwnProperty("row"))throw $util.ProtocolError("missing required 'row'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.ConsumedCapacity.verify(t.consumed);if(e)return"consumed."+e}return t.row&&typeof t.row.length=="number"||$util.isString(t.row)?t.nextToken!=null&&t.hasOwnProperty("nextToken")&&!(t.nextToken&&typeof t.nextToken.length=="number"||$util.isString(t.nextToken))?"nextToken: buffer expected":null:"row: buffer expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.GetRowResponse)return t;var e=new $root.main.proto.GetRowResponse;if(t.consumed!=null){if(typeof t.consumed!="object")throw TypeError(".main.proto.GetRowResponse.consumed: object expected");e.consumed=$root.main.proto.ConsumedCapacity.fromObject(t.consumed)}return t.row!=null&&(typeof t.row=="string"?$util.base64.decode(t.row,e.row=$util.newBuffer($util.base64.length(t.row)),0):t.row.length&&(e.row=t.row)),t.nextToken!=null&&(typeof t.nextToken=="string"?$util.base64.decode(t.nextToken,e.nextToken=$util.newBuffer($util.base64.length(t.nextToken)),0):t.nextToken.length&&(e.nextToken=t.nextToken)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.consumed=null,e.bytes===String?r.row="":(r.row=[],e.bytes!==Array&&(r.row=$util.newBuffer(r.row))),e.bytes===String?r.nextToken="":(r.nextToken=[],e.bytes!==Array&&(r.nextToken=$util.newBuffer(r.nextToken)))),t.consumed!=null&&t.hasOwnProperty("consumed")&&(r.consumed=$root.main.proto.ConsumedCapacity.toObject(t.consumed,e)),t.row!=null&&t.hasOwnProperty("row")&&(r.row=e.bytes===String?$util.base64.encode(t.row,0,t.row.length):e.bytes===Array?Array.prototype.slice.call(t.row):t.row),t.nextToken!=null&&t.hasOwnProperty("nextToken")&&(r.nextToken=e.bytes===String?$util.base64.encode(t.nextToken,0,t.nextToken.length):e.bytes===Array?Array.prototype.slice.call(t.nextToken):t.nextToken),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.UpdateRowRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.rowChange=$util.newBuffer([]),n.prototype.condition=null,n.prototype.returnContent=null,n.prototype.transactionId="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e.uint32(18).bytes(t.rowChange),$root.main.proto.Condition.encode(t.condition,e.uint32(26).fork()).ldelim(),t.returnContent!=null&&Object.hasOwnProperty.call(t,"returnContent")&&$root.main.proto.ReturnContent.encode(t.returnContent,e.uint32(34).fork()).ldelim(),t.transactionId!=null&&Object.hasOwnProperty.call(t,"transactionId")&&e.uint32(42).string(t.transactionId),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.UpdateRowRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.rowChange=t.bytes();break;case 3:i.condition=$root.main.proto.Condition.decode(t,t.uint32());break;case 4:i.returnContent=$root.main.proto.ReturnContent.decode(t,t.uint32());break;case 5:i.transactionId=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});if(!i.hasOwnProperty("rowChange"))throw $util.ProtocolError("missing required 'rowChange'",{instance:i});if(!i.hasOwnProperty("condition"))throw $util.ProtocolError("missing required 'condition'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(!(t.rowChange&&typeof t.rowChange.length=="number"||$util.isString(t.rowChange)))return"rowChange: buffer expected";{var e=$root.main.proto.Condition.verify(t.condition);if(e)return"condition."+e}if(t.returnContent!=null&&t.hasOwnProperty("returnContent")){var e=$root.main.proto.ReturnContent.verify(t.returnContent);if(e)return"returnContent."+e}return t.transactionId!=null&&t.hasOwnProperty("transactionId")&&!$util.isString(t.transactionId)?"transactionId: string expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.UpdateRowRequest)return t;var e=new $root.main.proto.UpdateRowRequest;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.rowChange!=null&&(typeof t.rowChange=="string"?$util.base64.decode(t.rowChange,e.rowChange=$util.newBuffer($util.base64.length(t.rowChange)),0):t.rowChange.length&&(e.rowChange=t.rowChange)),t.condition!=null){if(typeof t.condition!="object")throw TypeError(".main.proto.UpdateRowRequest.condition: object expected");e.condition=$root.main.proto.Condition.fromObject(t.condition)}if(t.returnContent!=null){if(typeof t.returnContent!="object")throw TypeError(".main.proto.UpdateRowRequest.returnContent: object expected");e.returnContent=$root.main.proto.ReturnContent.fromObject(t.returnContent)}return t.transactionId!=null&&(e.transactionId=String(t.transactionId)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",e.bytes===String?r.rowChange="":(r.rowChange=[],e.bytes!==Array&&(r.rowChange=$util.newBuffer(r.rowChange))),r.condition=null,r.returnContent=null,r.transactionId=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.rowChange!=null&&t.hasOwnProperty("rowChange")&&(r.rowChange=e.bytes===String?$util.base64.encode(t.rowChange,0,t.rowChange.length):e.bytes===Array?Array.prototype.slice.call(t.rowChange):t.rowChange),t.condition!=null&&t.hasOwnProperty("condition")&&(r.condition=$root.main.proto.Condition.toObject(t.condition,e)),t.returnContent!=null&&t.hasOwnProperty("returnContent")&&(r.returnContent=$root.main.proto.ReturnContent.toObject(t.returnContent,e)),t.transactionId!=null&&t.hasOwnProperty("transactionId")&&(r.transactionId=t.transactionId),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.UpdateRowResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.consumed=null,n.prototype.row=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),$root.main.proto.ConsumedCapacity.encode(t.consumed,e.uint32(10).fork()).ldelim(),t.row!=null&&Object.hasOwnProperty.call(t,"row")&&e.uint32(18).bytes(t.row),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.UpdateRowResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.consumed=$root.main.proto.ConsumedCapacity.decode(t,t.uint32());break;case 2:i.row=t.bytes();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("consumed"))throw $util.ProtocolError("missing required 'consumed'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.ConsumedCapacity.verify(t.consumed);if(e)return"consumed."+e}return t.row!=null&&t.hasOwnProperty("row")&&!(t.row&&typeof t.row.length=="number"||$util.isString(t.row))?"row: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.UpdateRowResponse)return t;var e=new $root.main.proto.UpdateRowResponse;if(t.consumed!=null){if(typeof t.consumed!="object")throw TypeError(".main.proto.UpdateRowResponse.consumed: object expected");e.consumed=$root.main.proto.ConsumedCapacity.fromObject(t.consumed)}return t.row!=null&&(typeof t.row=="string"?$util.base64.decode(t.row,e.row=$util.newBuffer($util.base64.length(t.row)),0):t.row.length&&(e.row=t.row)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.consumed=null,e.bytes===String?r.row="":(r.row=[],e.bytes!==Array&&(r.row=$util.newBuffer(r.row)))),t.consumed!=null&&t.hasOwnProperty("consumed")&&(r.consumed=$root.main.proto.ConsumedCapacity.toObject(t.consumed,e)),t.row!=null&&t.hasOwnProperty("row")&&(r.row=e.bytes===String?$util.base64.encode(t.row,0,t.row.length):e.bytes===Array?Array.prototype.slice.call(t.row):t.row),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.PutRowRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.row=$util.newBuffer([]),n.prototype.condition=null,n.prototype.returnContent=null,n.prototype.transactionId="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e.uint32(18).bytes(t.row),$root.main.proto.Condition.encode(t.condition,e.uint32(26).fork()).ldelim(),t.returnContent!=null&&Object.hasOwnProperty.call(t,"returnContent")&&$root.main.proto.ReturnContent.encode(t.returnContent,e.uint32(34).fork()).ldelim(),t.transactionId!=null&&Object.hasOwnProperty.call(t,"transactionId")&&e.uint32(42).string(t.transactionId),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.PutRowRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.row=t.bytes();break;case 3:i.condition=$root.main.proto.Condition.decode(t,t.uint32());break;case 4:i.returnContent=$root.main.proto.ReturnContent.decode(t,t.uint32());break;case 5:i.transactionId=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});if(!i.hasOwnProperty("row"))throw $util.ProtocolError("missing required 'row'",{instance:i});if(!i.hasOwnProperty("condition"))throw $util.ProtocolError("missing required 'condition'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(!(t.row&&typeof t.row.length=="number"||$util.isString(t.row)))return"row: buffer expected";{var e=$root.main.proto.Condition.verify(t.condition);if(e)return"condition."+e}if(t.returnContent!=null&&t.hasOwnProperty("returnContent")){var e=$root.main.proto.ReturnContent.verify(t.returnContent);if(e)return"returnContent."+e}return t.transactionId!=null&&t.hasOwnProperty("transactionId")&&!$util.isString(t.transactionId)?"transactionId: string expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.PutRowRequest)return t;var e=new $root.main.proto.PutRowRequest;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.row!=null&&(typeof t.row=="string"?$util.base64.decode(t.row,e.row=$util.newBuffer($util.base64.length(t.row)),0):t.row.length&&(e.row=t.row)),t.condition!=null){if(typeof t.condition!="object")throw TypeError(".main.proto.PutRowRequest.condition: object expected");e.condition=$root.main.proto.Condition.fromObject(t.condition)}if(t.returnContent!=null){if(typeof t.returnContent!="object")throw TypeError(".main.proto.PutRowRequest.returnContent: object expected");e.returnContent=$root.main.proto.ReturnContent.fromObject(t.returnContent)}return t.transactionId!=null&&(e.transactionId=String(t.transactionId)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",e.bytes===String?r.row="":(r.row=[],e.bytes!==Array&&(r.row=$util.newBuffer(r.row))),r.condition=null,r.returnContent=null,r.transactionId=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.row!=null&&t.hasOwnProperty("row")&&(r.row=e.bytes===String?$util.base64.encode(t.row,0,t.row.length):e.bytes===Array?Array.prototype.slice.call(t.row):t.row),t.condition!=null&&t.hasOwnProperty("condition")&&(r.condition=$root.main.proto.Condition.toObject(t.condition,e)),t.returnContent!=null&&t.hasOwnProperty("returnContent")&&(r.returnContent=$root.main.proto.ReturnContent.toObject(t.returnContent,e)),t.transactionId!=null&&t.hasOwnProperty("transactionId")&&(r.transactionId=t.transactionId),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.PutRowResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.consumed=null,n.prototype.row=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),$root.main.proto.ConsumedCapacity.encode(t.consumed,e.uint32(10).fork()).ldelim(),t.row!=null&&Object.hasOwnProperty.call(t,"row")&&e.uint32(18).bytes(t.row),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.PutRowResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.consumed=$root.main.proto.ConsumedCapacity.decode(t,t.uint32());break;case 2:i.row=t.bytes();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("consumed"))throw $util.ProtocolError("missing required 'consumed'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.ConsumedCapacity.verify(t.consumed);if(e)return"consumed."+e}return t.row!=null&&t.hasOwnProperty("row")&&!(t.row&&typeof t.row.length=="number"||$util.isString(t.row))?"row: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.PutRowResponse)return t;var e=new $root.main.proto.PutRowResponse;if(t.consumed!=null){if(typeof t.consumed!="object")throw TypeError(".main.proto.PutRowResponse.consumed: object expected");e.consumed=$root.main.proto.ConsumedCapacity.fromObject(t.consumed)}return t.row!=null&&(typeof t.row=="string"?$util.base64.decode(t.row,e.row=$util.newBuffer($util.base64.length(t.row)),0):t.row.length&&(e.row=t.row)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.consumed=null,e.bytes===String?r.row="":(r.row=[],e.bytes!==Array&&(r.row=$util.newBuffer(r.row)))),t.consumed!=null&&t.hasOwnProperty("consumed")&&(r.consumed=$root.main.proto.ConsumedCapacity.toObject(t.consumed,e)),t.row!=null&&t.hasOwnProperty("row")&&(r.row=e.bytes===String?$util.base64.encode(t.row,0,t.row.length):e.bytes===Array?Array.prototype.slice.call(t.row):t.row),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DeleteRowRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.primaryKey=$util.newBuffer([]),n.prototype.condition=null,n.prototype.returnContent=null,n.prototype.transactionId="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e.uint32(18).bytes(t.primaryKey),$root.main.proto.Condition.encode(t.condition,e.uint32(26).fork()).ldelim(),t.returnContent!=null&&Object.hasOwnProperty.call(t,"returnContent")&&$root.main.proto.ReturnContent.encode(t.returnContent,e.uint32(34).fork()).ldelim(),t.transactionId!=null&&Object.hasOwnProperty.call(t,"transactionId")&&e.uint32(42).string(t.transactionId),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.DeleteRowRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.primaryKey=t.bytes();break;case 3:i.condition=$root.main.proto.Condition.decode(t,t.uint32());break;case 4:i.returnContent=$root.main.proto.ReturnContent.decode(t,t.uint32());break;case 5:i.transactionId=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});if(!i.hasOwnProperty("primaryKey"))throw $util.ProtocolError("missing required 'primaryKey'",{instance:i});if(!i.hasOwnProperty("condition"))throw $util.ProtocolError("missing required 'condition'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(!(t.primaryKey&&typeof t.primaryKey.length=="number"||$util.isString(t.primaryKey)))return"primaryKey: buffer expected";{var e=$root.main.proto.Condition.verify(t.condition);if(e)return"condition."+e}if(t.returnContent!=null&&t.hasOwnProperty("returnContent")){var e=$root.main.proto.ReturnContent.verify(t.returnContent);if(e)return"returnContent."+e}return t.transactionId!=null&&t.hasOwnProperty("transactionId")&&!$util.isString(t.transactionId)?"transactionId: string expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.DeleteRowRequest)return t;var e=new $root.main.proto.DeleteRowRequest;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.primaryKey!=null&&(typeof t.primaryKey=="string"?$util.base64.decode(t.primaryKey,e.primaryKey=$util.newBuffer($util.base64.length(t.primaryKey)),0):t.primaryKey.length&&(e.primaryKey=t.primaryKey)),t.condition!=null){if(typeof t.condition!="object")throw TypeError(".main.proto.DeleteRowRequest.condition: object expected");e.condition=$root.main.proto.Condition.fromObject(t.condition)}if(t.returnContent!=null){if(typeof t.returnContent!="object")throw TypeError(".main.proto.DeleteRowRequest.returnContent: object expected");e.returnContent=$root.main.proto.ReturnContent.fromObject(t.returnContent)}return t.transactionId!=null&&(e.transactionId=String(t.transactionId)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",e.bytes===String?r.primaryKey="":(r.primaryKey=[],e.bytes!==Array&&(r.primaryKey=$util.newBuffer(r.primaryKey))),r.condition=null,r.returnContent=null,r.transactionId=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.primaryKey!=null&&t.hasOwnProperty("primaryKey")&&(r.primaryKey=e.bytes===String?$util.base64.encode(t.primaryKey,0,t.primaryKey.length):e.bytes===Array?Array.prototype.slice.call(t.primaryKey):t.primaryKey),t.condition!=null&&t.hasOwnProperty("condition")&&(r.condition=$root.main.proto.Condition.toObject(t.condition,e)),t.returnContent!=null&&t.hasOwnProperty("returnContent")&&(r.returnContent=$root.main.proto.ReturnContent.toObject(t.returnContent,e)),t.transactionId!=null&&t.hasOwnProperty("transactionId")&&(r.transactionId=t.transactionId),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DeleteRowResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.consumed=null,n.prototype.row=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),$root.main.proto.ConsumedCapacity.encode(t.consumed,e.uint32(10).fork()).ldelim(),t.row!=null&&Object.hasOwnProperty.call(t,"row")&&e.uint32(18).bytes(t.row),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.DeleteRowResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.consumed=$root.main.proto.ConsumedCapacity.decode(t,t.uint32());break;case 2:i.row=t.bytes();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("consumed"))throw $util.ProtocolError("missing required 'consumed'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.ConsumedCapacity.verify(t.consumed);if(e)return"consumed."+e}return t.row!=null&&t.hasOwnProperty("row")&&!(t.row&&typeof t.row.length=="number"||$util.isString(t.row))?"row: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.DeleteRowResponse)return t;var e=new $root.main.proto.DeleteRowResponse;if(t.consumed!=null){if(typeof t.consumed!="object")throw TypeError(".main.proto.DeleteRowResponse.consumed: object expected");e.consumed=$root.main.proto.ConsumedCapacity.fromObject(t.consumed)}return t.row!=null&&(typeof t.row=="string"?$util.base64.decode(t.row,e.row=$util.newBuffer($util.base64.length(t.row)),0):t.row.length&&(e.row=t.row)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.consumed=null,e.bytes===String?r.row="":(r.row=[],e.bytes!==Array&&(r.row=$util.newBuffer(r.row)))),t.consumed!=null&&t.hasOwnProperty("consumed")&&(r.consumed=$root.main.proto.ConsumedCapacity.toObject(t.consumed,e)),t.row!=null&&t.hasOwnProperty("row")&&(r.row=e.bytes===String?$util.base64.encode(t.row,0,t.row.length):e.bytes===Array?Array.prototype.slice.call(t.row):t.row),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TableInBatchGetRowRequest=function(){function n(o){if(this.primaryKey=[],this.token=[],this.columnsToGet=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.primaryKey=$util.emptyArray,n.prototype.token=$util.emptyArray,n.prototype.columnsToGet=$util.emptyArray,n.prototype.timeRange=null,n.prototype.maxVersions=0,n.prototype.cacheBlocks=!0,n.prototype.filter=$util.newBuffer([]),n.prototype.startColumn="",n.prototype.endColumn="",n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),e.uint32(10).string(t.tableName),t.primaryKey!=null&&t.primaryKey.length)for(var r=0;r<t.primaryKey.length;++r)e.uint32(18).bytes(t.primaryKey[r]);if(t.token!=null&&t.token.length)for(var r=0;r<t.token.length;++r)e.uint32(26).bytes(t.token[r]);if(t.columnsToGet!=null&&t.columnsToGet.length)for(var r=0;r<t.columnsToGet.length;++r)e.uint32(34).string(t.columnsToGet[r]);return t.timeRange!=null&&Object.hasOwnProperty.call(t,"timeRange")&&$root.main.proto.TimeRange.encode(t.timeRange,e.uint32(42).fork()).ldelim(),t.maxVersions!=null&&Object.hasOwnProperty.call(t,"maxVersions")&&e.uint32(48).int32(t.maxVersions),t.cacheBlocks!=null&&Object.hasOwnProperty.call(t,"cacheBlocks")&&e.uint32(56).bool(t.cacheBlocks),t.filter!=null&&Object.hasOwnProperty.call(t,"filter")&&e.uint32(66).bytes(t.filter),t.startColumn!=null&&Object.hasOwnProperty.call(t,"startColumn")&&e.uint32(74).string(t.startColumn),t.endColumn!=null&&Object.hasOwnProperty.call(t,"endColumn")&&e.uint32(82).string(t.endColumn),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.TableInBatchGetRowRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.primaryKey&&i.primaryKey.length||(i.primaryKey=[]),i.primaryKey.push(t.bytes());break;case 3:i.token&&i.token.length||(i.token=[]),i.token.push(t.bytes());break;case 4:i.columnsToGet&&i.columnsToGet.length||(i.columnsToGet=[]),i.columnsToGet.push(t.string());break;case 5:i.timeRange=$root.main.proto.TimeRange.decode(t,t.uint32());break;case 6:i.maxVersions=t.int32();break;case 7:i.cacheBlocks=t.bool();break;case 8:i.filter=t.bytes();break;case 9:i.startColumn=t.string();break;case 10:i.endColumn=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(t.primaryKey!=null&&t.hasOwnProperty("primaryKey")){if(!Array.isArray(t.primaryKey))return"primaryKey: array expected";for(var e=0;e<t.primaryKey.length;++e)if(!(t.primaryKey[e]&&typeof t.primaryKey[e].length=="number"||$util.isString(t.primaryKey[e])))return"primaryKey: buffer[] expected"}if(t.token!=null&&t.hasOwnProperty("token")){if(!Array.isArray(t.token))return"token: array expected";for(var e=0;e<t.token.length;++e)if(!(t.token[e]&&typeof t.token[e].length=="number"||$util.isString(t.token[e])))return"token: buffer[] expected"}if(t.columnsToGet!=null&&t.hasOwnProperty("columnsToGet")){if(!Array.isArray(t.columnsToGet))return"columnsToGet: array expected";for(var e=0;e<t.columnsToGet.length;++e)if(!$util.isString(t.columnsToGet[e]))return"columnsToGet: string[] expected"}if(t.timeRange!=null&&t.hasOwnProperty("timeRange")){var r=$root.main.proto.TimeRange.verify(t.timeRange);if(r)return"timeRange."+r}return t.maxVersions!=null&&t.hasOwnProperty("maxVersions")&&!$util.isInteger(t.maxVersions)?"maxVersions: integer expected":t.cacheBlocks!=null&&t.hasOwnProperty("cacheBlocks")&&typeof t.cacheBlocks!="boolean"?"cacheBlocks: boolean expected":t.filter!=null&&t.hasOwnProperty("filter")&&!(t.filter&&typeof t.filter.length=="number"||$util.isString(t.filter))?"filter: buffer expected":t.startColumn!=null&&t.hasOwnProperty("startColumn")&&!$util.isString(t.startColumn)?"startColumn: string expected":t.endColumn!=null&&t.hasOwnProperty("endColumn")&&!$util.isString(t.endColumn)?"endColumn: string expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.TableInBatchGetRowRequest)return t;var e=new $root.main.proto.TableInBatchGetRowRequest;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.primaryKey){if(!Array.isArray(t.primaryKey))throw TypeError(".main.proto.TableInBatchGetRowRequest.primaryKey: array expected");e.primaryKey=[];for(var r=0;r<t.primaryKey.length;++r)typeof t.primaryKey[r]=="string"?$util.base64.decode(t.primaryKey[r],e.primaryKey[r]=$util.newBuffer($util.base64.length(t.primaryKey[r])),0):t.primaryKey[r].length&&(e.primaryKey[r]=t.primaryKey[r])}if(t.token){if(!Array.isArray(t.token))throw TypeError(".main.proto.TableInBatchGetRowRequest.token: array expected");e.token=[];for(var r=0;r<t.token.length;++r)typeof t.token[r]=="string"?$util.base64.decode(t.token[r],e.token[r]=$util.newBuffer($util.base64.length(t.token[r])),0):t.token[r].length&&(e.token[r]=t.token[r])}if(t.columnsToGet){if(!Array.isArray(t.columnsToGet))throw TypeError(".main.proto.TableInBatchGetRowRequest.columnsToGet: array expected");e.columnsToGet=[];for(var r=0;r<t.columnsToGet.length;++r)e.columnsToGet[r]=String(t.columnsToGet[r])}if(t.timeRange!=null){if(typeof t.timeRange!="object")throw TypeError(".main.proto.TableInBatchGetRowRequest.timeRange: object expected");e.timeRange=$root.main.proto.TimeRange.fromObject(t.timeRange)}return t.maxVersions!=null&&(e.maxVersions=t.maxVersions|0),t.cacheBlocks!=null&&(e.cacheBlocks=!!t.cacheBlocks),t.filter!=null&&(typeof t.filter=="string"?$util.base64.decode(t.filter,e.filter=$util.newBuffer($util.base64.length(t.filter)),0):t.filter.length&&(e.filter=t.filter)),t.startColumn!=null&&(e.startColumn=String(t.startColumn)),t.endColumn!=null&&(e.endColumn=String(t.endColumn)),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.primaryKey=[],r.token=[],r.columnsToGet=[]),e.defaults&&(r.tableName="",r.timeRange=null,r.maxVersions=0,r.cacheBlocks=!0,e.bytes===String?r.filter="":(r.filter=[],e.bytes!==Array&&(r.filter=$util.newBuffer(r.filter))),r.startColumn="",r.endColumn=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.primaryKey&&t.primaryKey.length){r.primaryKey=[];for(var i=0;i<t.primaryKey.length;++i)r.primaryKey[i]=e.bytes===String?$util.base64.encode(t.primaryKey[i],0,t.primaryKey[i].length):e.bytes===Array?Array.prototype.slice.call(t.primaryKey[i]):t.primaryKey[i]}if(t.token&&t.token.length){r.token=[];for(var i=0;i<t.token.length;++i)r.token[i]=e.bytes===String?$util.base64.encode(t.token[i],0,t.token[i].length):e.bytes===Array?Array.prototype.slice.call(t.token[i]):t.token[i]}if(t.columnsToGet&&t.columnsToGet.length){r.columnsToGet=[];for(var i=0;i<t.columnsToGet.length;++i)r.columnsToGet[i]=t.columnsToGet[i]}return t.timeRange!=null&&t.hasOwnProperty("timeRange")&&(r.timeRange=$root.main.proto.TimeRange.toObject(t.timeRange,e)),t.maxVersions!=null&&t.hasOwnProperty("maxVersions")&&(r.maxVersions=t.maxVersions),t.cacheBlocks!=null&&t.hasOwnProperty("cacheBlocks")&&(r.cacheBlocks=t.cacheBlocks),t.filter!=null&&t.hasOwnProperty("filter")&&(r.filter=e.bytes===String?$util.base64.encode(t.filter,0,t.filter.length):e.bytes===Array?Array.prototype.slice.call(t.filter):t.filter),t.startColumn!=null&&t.hasOwnProperty("startColumn")&&(r.startColumn=t.startColumn),t.endColumn!=null&&t.hasOwnProperty("endColumn")&&(r.endColumn=t.endColumn),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.BatchGetRowRequest=function(){function n(o){if(this.tables=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tables=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.tables!=null&&t.tables.length)for(var r=0;r<t.tables.length;++r)$root.main.proto.TableInBatchGetRowRequest.encode(t.tables[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.BatchGetRowRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tables&&i.tables.length||(i.tables=[]),i.tables.push($root.main.proto.TableInBatchGetRowRequest.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.tables!=null&&t.hasOwnProperty("tables")){if(!Array.isArray(t.tables))return"tables: array expected";for(var e=0;e<t.tables.length;++e){var r=$root.main.proto.TableInBatchGetRowRequest.verify(t.tables[e]);if(r)return"tables."+r}}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.BatchGetRowRequest)return t;var e=new $root.main.proto.BatchGetRowRequest;if(t.tables){if(!Array.isArray(t.tables))throw TypeError(".main.proto.BatchGetRowRequest.tables: array expected");e.tables=[];for(var r=0;r<t.tables.length;++r){if(typeof t.tables[r]!="object")throw TypeError(".main.proto.BatchGetRowRequest.tables: object expected");e.tables[r]=$root.main.proto.TableInBatchGetRowRequest.fromObject(t.tables[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.tables=[]),t.tables&&t.tables.length){r.tables=[];for(var i=0;i<t.tables.length;++i)r.tables[i]=$root.main.proto.TableInBatchGetRowRequest.toObject(t.tables[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.RowInBatchGetRowResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.isOk=!1,n.prototype.error=null,n.prototype.consumed=null,n.prototype.row=$util.newBuffer([]),n.prototype.nextToken=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(8).bool(t.isOk),t.error!=null&&Object.hasOwnProperty.call(t,"error")&&$root.main.proto.Error.encode(t.error,e.uint32(18).fork()).ldelim(),t.consumed!=null&&Object.hasOwnProperty.call(t,"consumed")&&$root.main.proto.ConsumedCapacity.encode(t.consumed,e.uint32(26).fork()).ldelim(),t.row!=null&&Object.hasOwnProperty.call(t,"row")&&e.uint32(34).bytes(t.row),t.nextToken!=null&&Object.hasOwnProperty.call(t,"nextToken")&&e.uint32(42).bytes(t.nextToken),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.RowInBatchGetRowResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.isOk=t.bool();break;case 2:i.error=$root.main.proto.Error.decode(t,t.uint32());break;case 3:i.consumed=$root.main.proto.ConsumedCapacity.decode(t,t.uint32());break;case 4:i.row=t.bytes();break;case 5:i.nextToken=t.bytes();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("isOk"))throw $util.ProtocolError("missing required 'isOk'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(typeof t.isOk!="boolean")return"isOk: boolean expected";if(t.error!=null&&t.hasOwnProperty("error")){var e=$root.main.proto.Error.verify(t.error);if(e)return"error."+e}if(t.consumed!=null&&t.hasOwnProperty("consumed")){var e=$root.main.proto.ConsumedCapacity.verify(t.consumed);if(e)return"consumed."+e}return t.row!=null&&t.hasOwnProperty("row")&&!(t.row&&typeof t.row.length=="number"||$util.isString(t.row))?"row: buffer expected":t.nextToken!=null&&t.hasOwnProperty("nextToken")&&!(t.nextToken&&typeof t.nextToken.length=="number"||$util.isString(t.nextToken))?"nextToken: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.RowInBatchGetRowResponse)return t;var e=new $root.main.proto.RowInBatchGetRowResponse;if(t.isOk!=null&&(e.isOk=!!t.isOk),t.error!=null){if(typeof t.error!="object")throw TypeError(".main.proto.RowInBatchGetRowResponse.error: object expected");e.error=$root.main.proto.Error.fromObject(t.error)}if(t.consumed!=null){if(typeof t.consumed!="object")throw TypeError(".main.proto.RowInBatchGetRowResponse.consumed: object expected");e.consumed=$root.main.proto.ConsumedCapacity.fromObject(t.consumed)}return t.row!=null&&(typeof t.row=="string"?$util.base64.decode(t.row,e.row=$util.newBuffer($util.base64.length(t.row)),0):t.row.length&&(e.row=t.row)),t.nextToken!=null&&(typeof t.nextToken=="string"?$util.base64.decode(t.nextToken,e.nextToken=$util.newBuffer($util.base64.length(t.nextToken)),0):t.nextToken.length&&(e.nextToken=t.nextToken)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.isOk=!1,r.error=null,r.consumed=null,e.bytes===String?r.row="":(r.row=[],e.bytes!==Array&&(r.row=$util.newBuffer(r.row))),e.bytes===String?r.nextToken="":(r.nextToken=[],e.bytes!==Array&&(r.nextToken=$util.newBuffer(r.nextToken)))),t.isOk!=null&&t.hasOwnProperty("isOk")&&(r.isOk=t.isOk),t.error!=null&&t.hasOwnProperty("error")&&(r.error=$root.main.proto.Error.toObject(t.error,e)),t.consumed!=null&&t.hasOwnProperty("consumed")&&(r.consumed=$root.main.proto.ConsumedCapacity.toObject(t.consumed,e)),t.row!=null&&t.hasOwnProperty("row")&&(r.row=e.bytes===String?$util.base64.encode(t.row,0,t.row.length):e.bytes===Array?Array.prototype.slice.call(t.row):t.row),t.nextToken!=null&&t.hasOwnProperty("nextToken")&&(r.nextToken=e.bytes===String?$util.base64.encode(t.nextToken,0,t.nextToken.length):e.bytes===Array?Array.prototype.slice.call(t.nextToken):t.nextToken),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TableInBatchGetRowResponse=function(){function n(o){if(this.rows=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.rows=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),e.uint32(10).string(t.tableName),t.rows!=null&&t.rows.length)for(var r=0;r<t.rows.length;++r)$root.main.proto.RowInBatchGetRowResponse.encode(t.rows[r],e.uint32(18).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.TableInBatchGetRowResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.rows&&i.rows.length||(i.rows=[]),i.rows.push($root.main.proto.RowInBatchGetRowResponse.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(t.rows!=null&&t.hasOwnProperty("rows")){if(!Array.isArray(t.rows))return"rows: array expected";for(var e=0;e<t.rows.length;++e){var r=$root.main.proto.RowInBatchGetRowResponse.verify(t.rows[e]);if(r)return"rows."+r}}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.TableInBatchGetRowResponse)return t;var e=new $root.main.proto.TableInBatchGetRowResponse;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.rows){if(!Array.isArray(t.rows))throw TypeError(".main.proto.TableInBatchGetRowResponse.rows: array expected");e.rows=[];for(var r=0;r<t.rows.length;++r){if(typeof t.rows[r]!="object")throw TypeError(".main.proto.TableInBatchGetRowResponse.rows: object expected");e.rows[r]=$root.main.proto.RowInBatchGetRowResponse.fromObject(t.rows[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.rows=[]),e.defaults&&(r.tableName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.rows&&t.rows.length){r.rows=[];for(var i=0;i<t.rows.length;++i)r.rows[i]=$root.main.proto.RowInBatchGetRowResponse.toObject(t.rows[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.BatchGetRowResponse=function(){function n(o){if(this.tables=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tables=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.tables!=null&&t.tables.length)for(var r=0;r<t.tables.length;++r)$root.main.proto.TableInBatchGetRowResponse.encode(t.tables[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.BatchGetRowResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tables&&i.tables.length||(i.tables=[]),i.tables.push($root.main.proto.TableInBatchGetRowResponse.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.tables!=null&&t.hasOwnProperty("tables")){if(!Array.isArray(t.tables))return"tables: array expected";for(var e=0;e<t.tables.length;++e){var r=$root.main.proto.TableInBatchGetRowResponse.verify(t.tables[e]);if(r)return"tables."+r}}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.BatchGetRowResponse)return t;var e=new $root.main.proto.BatchGetRowResponse;if(t.tables){if(!Array.isArray(t.tables))throw TypeError(".main.proto.BatchGetRowResponse.tables: array expected");e.tables=[];for(var r=0;r<t.tables.length;++r){if(typeof t.tables[r]!="object")throw TypeError(".main.proto.BatchGetRowResponse.tables: object expected");e.tables[r]=$root.main.proto.TableInBatchGetRowResponse.fromObject(t.tables[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.tables=[]),t.tables&&t.tables.length){r.tables=[];for(var i=0;i<t.tables.length;++i)r.tables[i]=$root.main.proto.TableInBatchGetRowResponse.toObject(t.tables[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.OperationType=function(){var n={},o=Object.create(n);return o[n[1]="PUT"]=1,o[n[2]="UPDATE"]=2,o[n[3]="DELETE"]=3,o}(),c.RowInBatchWriteRowRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.type=1,n.prototype.rowChange=$util.newBuffer([]),n.prototype.condition=null,n.prototype.returnContent=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(8).int32(t.type),e.uint32(18).bytes(t.rowChange),$root.main.proto.Condition.encode(t.condition,e.uint32(26).fork()).ldelim(),t.returnContent!=null&&Object.hasOwnProperty.call(t,"returnContent")&&$root.main.proto.ReturnContent.encode(t.returnContent,e.uint32(34).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.RowInBatchWriteRowRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.type=t.int32();break;case 2:i.rowChange=t.bytes();break;case 3:i.condition=$root.main.proto.Condition.decode(t,t.uint32());break;case 4:i.returnContent=$root.main.proto.ReturnContent.decode(t,t.uint32());break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("type"))throw $util.ProtocolError("missing required 'type'",{instance:i});if(!i.hasOwnProperty("rowChange"))throw $util.ProtocolError("missing required 'rowChange'",{instance:i});if(!i.hasOwnProperty("condition"))throw $util.ProtocolError("missing required 'condition'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";switch(t.type){default:return"type: enum value expected";case 1:case 2:case 3:break}if(!(t.rowChange&&typeof t.rowChange.length=="number"||$util.isString(t.rowChange)))return"rowChange: buffer expected";{var e=$root.main.proto.Condition.verify(t.condition);if(e)return"condition."+e}if(t.returnContent!=null&&t.hasOwnProperty("returnContent")){var e=$root.main.proto.ReturnContent.verify(t.returnContent);if(e)return"returnContent."+e}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.RowInBatchWriteRowRequest)return t;var e=new $root.main.proto.RowInBatchWriteRowRequest;switch(t.type){case"PUT":case 1:e.type=1;break;case"UPDATE":case 2:e.type=2;break;case"DELETE":case 3:e.type=3;break}if(t.rowChange!=null&&(typeof t.rowChange=="string"?$util.base64.decode(t.rowChange,e.rowChange=$util.newBuffer($util.base64.length(t.rowChange)),0):t.rowChange.length&&(e.rowChange=t.rowChange)),t.condition!=null){if(typeof t.condition!="object")throw TypeError(".main.proto.RowInBatchWriteRowRequest.condition: object expected");e.condition=$root.main.proto.Condition.fromObject(t.condition)}if(t.returnContent!=null){if(typeof t.returnContent!="object")throw TypeError(".main.proto.RowInBatchWriteRowRequest.returnContent: object expected");e.returnContent=$root.main.proto.ReturnContent.fromObject(t.returnContent)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.type=e.enums===String?"PUT":1,e.bytes===String?r.rowChange="":(r.rowChange=[],e.bytes!==Array&&(r.rowChange=$util.newBuffer(r.rowChange))),r.condition=null,r.returnContent=null),t.type!=null&&t.hasOwnProperty("type")&&(r.type=e.enums===String?$root.main.proto.OperationType[t.type]:t.type),t.rowChange!=null&&t.hasOwnProperty("rowChange")&&(r.rowChange=e.bytes===String?$util.base64.encode(t.rowChange,0,t.rowChange.length):e.bytes===Array?Array.prototype.slice.call(t.rowChange):t.rowChange),t.condition!=null&&t.hasOwnProperty("condition")&&(r.condition=$root.main.proto.Condition.toObject(t.condition,e)),t.returnContent!=null&&t.hasOwnProperty("returnContent")&&(r.returnContent=$root.main.proto.ReturnContent.toObject(t.returnContent,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TableInBatchWriteRowRequest=function(){function n(o){if(this.rows=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.rows=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),e.uint32(10).string(t.tableName),t.rows!=null&&t.rows.length)for(var r=0;r<t.rows.length;++r)$root.main.proto.RowInBatchWriteRowRequest.encode(t.rows[r],e.uint32(18).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.TableInBatchWriteRowRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.rows&&i.rows.length||(i.rows=[]),i.rows.push($root.main.proto.RowInBatchWriteRowRequest.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(t.rows!=null&&t.hasOwnProperty("rows")){if(!Array.isArray(t.rows))return"rows: array expected";for(var e=0;e<t.rows.length;++e){var r=$root.main.proto.RowInBatchWriteRowRequest.verify(t.rows[e]);if(r)return"rows."+r}}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.TableInBatchWriteRowRequest)return t;var e=new $root.main.proto.TableInBatchWriteRowRequest;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.rows){if(!Array.isArray(t.rows))throw TypeError(".main.proto.TableInBatchWriteRowRequest.rows: array expected");e.rows=[];for(var r=0;r<t.rows.length;++r){if(typeof t.rows[r]!="object")throw TypeError(".main.proto.TableInBatchWriteRowRequest.rows: object expected");e.rows[r]=$root.main.proto.RowInBatchWriteRowRequest.fromObject(t.rows[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.rows=[]),e.defaults&&(r.tableName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.rows&&t.rows.length){r.rows=[];for(var i=0;i<t.rows.length;++i)r.rows[i]=$root.main.proto.RowInBatchWriteRowRequest.toObject(t.rows[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.BatchWriteRowRequest=function(){function n(o){if(this.tables=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tables=$util.emptyArray,n.prototype.transactionId="",n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.tables!=null&&t.tables.length)for(var r=0;r<t.tables.length;++r)$root.main.proto.TableInBatchWriteRowRequest.encode(t.tables[r],e.uint32(10).fork()).ldelim();return t.transactionId!=null&&Object.hasOwnProperty.call(t,"transactionId")&&e.uint32(18).string(t.transactionId),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.BatchWriteRowRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tables&&i.tables.length||(i.tables=[]),i.tables.push($root.main.proto.TableInBatchWriteRowRequest.decode(t,t.uint32()));break;case 2:i.transactionId=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.tables!=null&&t.hasOwnProperty("tables")){if(!Array.isArray(t.tables))return"tables: array expected";for(var e=0;e<t.tables.length;++e){var r=$root.main.proto.TableInBatchWriteRowRequest.verify(t.tables[e]);if(r)return"tables."+r}}return t.transactionId!=null&&t.hasOwnProperty("transactionId")&&!$util.isString(t.transactionId)?"transactionId: string expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.BatchWriteRowRequest)return t;var e=new $root.main.proto.BatchWriteRowRequest;if(t.tables){if(!Array.isArray(t.tables))throw TypeError(".main.proto.BatchWriteRowRequest.tables: array expected");e.tables=[];for(var r=0;r<t.tables.length;++r){if(typeof t.tables[r]!="object")throw TypeError(".main.proto.BatchWriteRowRequest.tables: object expected");e.tables[r]=$root.main.proto.TableInBatchWriteRowRequest.fromObject(t.tables[r])}}return t.transactionId!=null&&(e.transactionId=String(t.transactionId)),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.tables=[]),e.defaults&&(r.transactionId=""),t.tables&&t.tables.length){r.tables=[];for(var i=0;i<t.tables.length;++i)r.tables[i]=$root.main.proto.TableInBatchWriteRowRequest.toObject(t.tables[i],e)}return t.transactionId!=null&&t.hasOwnProperty("transactionId")&&(r.transactionId=t.transactionId),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.RowInBatchWriteRowResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.isOk=!1,n.prototype.error=null,n.prototype.consumed=null,n.prototype.row=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(8).bool(t.isOk),t.error!=null&&Object.hasOwnProperty.call(t,"error")&&$root.main.proto.Error.encode(t.error,e.uint32(18).fork()).ldelim(),t.consumed!=null&&Object.hasOwnProperty.call(t,"consumed")&&$root.main.proto.ConsumedCapacity.encode(t.consumed,e.uint32(26).fork()).ldelim(),t.row!=null&&Object.hasOwnProperty.call(t,"row")&&e.uint32(34).bytes(t.row),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.RowInBatchWriteRowResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.isOk=t.bool();break;case 2:i.error=$root.main.proto.Error.decode(t,t.uint32());break;case 3:i.consumed=$root.main.proto.ConsumedCapacity.decode(t,t.uint32());break;case 4:i.row=t.bytes();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("isOk"))throw $util.ProtocolError("missing required 'isOk'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(typeof t.isOk!="boolean")return"isOk: boolean expected";if(t.error!=null&&t.hasOwnProperty("error")){var e=$root.main.proto.Error.verify(t.error);if(e)return"error."+e}if(t.consumed!=null&&t.hasOwnProperty("consumed")){var e=$root.main.proto.ConsumedCapacity.verify(t.consumed);if(e)return"consumed."+e}return t.row!=null&&t.hasOwnProperty("row")&&!(t.row&&typeof t.row.length=="number"||$util.isString(t.row))?"row: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.RowInBatchWriteRowResponse)return t;var e=new $root.main.proto.RowInBatchWriteRowResponse;if(t.isOk!=null&&(e.isOk=!!t.isOk),t.error!=null){if(typeof t.error!="object")throw TypeError(".main.proto.RowInBatchWriteRowResponse.error: object expected");e.error=$root.main.proto.Error.fromObject(t.error)}if(t.consumed!=null){if(typeof t.consumed!="object")throw TypeError(".main.proto.RowInBatchWriteRowResponse.consumed: object expected");e.consumed=$root.main.proto.ConsumedCapacity.fromObject(t.consumed)}return t.row!=null&&(typeof t.row=="string"?$util.base64.decode(t.row,e.row=$util.newBuffer($util.base64.length(t.row)),0):t.row.length&&(e.row=t.row)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.isOk=!1,r.error=null,r.consumed=null,e.bytes===String?r.row="":(r.row=[],e.bytes!==Array&&(r.row=$util.newBuffer(r.row)))),t.isOk!=null&&t.hasOwnProperty("isOk")&&(r.isOk=t.isOk),t.error!=null&&t.hasOwnProperty("error")&&(r.error=$root.main.proto.Error.toObject(t.error,e)),t.consumed!=null&&t.hasOwnProperty("consumed")&&(r.consumed=$root.main.proto.ConsumedCapacity.toObject(t.consumed,e)),t.row!=null&&t.hasOwnProperty("row")&&(r.row=e.bytes===String?$util.base64.encode(t.row,0,t.row.length):e.bytes===Array?Array.prototype.slice.call(t.row):t.row),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TableInBatchWriteRowResponse=function(){function n(o){if(this.rows=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.rows=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),e.uint32(10).string(t.tableName),t.rows!=null&&t.rows.length)for(var r=0;r<t.rows.length;++r)$root.main.proto.RowInBatchWriteRowResponse.encode(t.rows[r],e.uint32(18).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.TableInBatchWriteRowResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.rows&&i.rows.length||(i.rows=[]),i.rows.push($root.main.proto.RowInBatchWriteRowResponse.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(t.rows!=null&&t.hasOwnProperty("rows")){if(!Array.isArray(t.rows))return"rows: array expected";for(var e=0;e<t.rows.length;++e){var r=$root.main.proto.RowInBatchWriteRowResponse.verify(t.rows[e]);if(r)return"rows."+r}}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.TableInBatchWriteRowResponse)return t;var e=new $root.main.proto.TableInBatchWriteRowResponse;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.rows){if(!Array.isArray(t.rows))throw TypeError(".main.proto.TableInBatchWriteRowResponse.rows: array expected");e.rows=[];for(var r=0;r<t.rows.length;++r){if(typeof t.rows[r]!="object")throw TypeError(".main.proto.TableInBatchWriteRowResponse.rows: object expected");e.rows[r]=$root.main.proto.RowInBatchWriteRowResponse.fromObject(t.rows[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.rows=[]),e.defaults&&(r.tableName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.rows&&t.rows.length){r.rows=[];for(var i=0;i<t.rows.length;++i)r.rows[i]=$root.main.proto.RowInBatchWriteRowResponse.toObject(t.rows[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.BatchWriteRowResponse=function(){function n(o){if(this.tables=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tables=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.tables!=null&&t.tables.length)for(var r=0;r<t.tables.length;++r)$root.main.proto.TableInBatchWriteRowResponse.encode(t.tables[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.BatchWriteRowResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tables&&i.tables.length||(i.tables=[]),i.tables.push($root.main.proto.TableInBatchWriteRowResponse.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.tables!=null&&t.hasOwnProperty("tables")){if(!Array.isArray(t.tables))return"tables: array expected";for(var e=0;e<t.tables.length;++e){var r=$root.main.proto.TableInBatchWriteRowResponse.verify(t.tables[e]);if(r)return"tables."+r}}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.BatchWriteRowResponse)return t;var e=new $root.main.proto.BatchWriteRowResponse;if(t.tables){if(!Array.isArray(t.tables))throw TypeError(".main.proto.BatchWriteRowResponse.tables: array expected");e.tables=[];for(var r=0;r<t.tables.length;++r){if(typeof t.tables[r]!="object")throw TypeError(".main.proto.BatchWriteRowResponse.tables: object expected");e.tables[r]=$root.main.proto.TableInBatchWriteRowResponse.fromObject(t.tables[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.tables=[]),t.tables&&t.tables.length){r.tables=[];for(var i=0;i<t.tables.length;++i)r.tables[i]=$root.main.proto.TableInBatchWriteRowResponse.toObject(t.tables[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.Direction=function(){var n={},o=Object.create(n);return o[n[0]="FORWARD"]=0,o[n[1]="BACKWARD"]=1,o}(),c.GetRangeRequest=function(){function n(o){if(this.columnsToGet=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.direction=0,n.prototype.columnsToGet=$util.emptyArray,n.prototype.timeRange=null,n.prototype.maxVersions=0,n.prototype.limit=0,n.prototype.inclusiveStartPrimaryKey=$util.newBuffer([]),n.prototype.exclusiveEndPrimaryKey=$util.newBuffer([]),n.prototype.cacheBlocks=!0,n.prototype.filter=$util.newBuffer([]),n.prototype.startColumn="",n.prototype.endColumn="",n.prototype.token=$util.newBuffer([]),n.prototype.transactionId="",n.prototype.dataBlockTypeHint=0,n.prototype.returnEntirePrimaryKeys=!0,n.prototype.compressTypeHint=0,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e.uint32(16).int32(t.direction),t.columnsToGet!=null&&t.columnsToGet.length)for(var r=0;r<t.columnsToGet.length;++r)e.uint32(26).string(t.columnsToGet[r]);return t.timeRange!=null&&Object.hasOwnProperty.call(t,"timeRange")&&$root.main.proto.TimeRange.encode(t.timeRange,e.uint32(34).fork()).ldelim(),t.maxVersions!=null&&Object.hasOwnProperty.call(t,"maxVersions")&&e.uint32(40).int32(t.maxVersions),t.limit!=null&&Object.hasOwnProperty.call(t,"limit")&&e.uint32(48).int32(t.limit),e.uint32(58).bytes(t.inclusiveStartPrimaryKey),e.uint32(66).bytes(t.exclusiveEndPrimaryKey),t.cacheBlocks!=null&&Object.hasOwnProperty.call(t,"cacheBlocks")&&e.uint32(72).bool(t.cacheBlocks),t.filter!=null&&Object.hasOwnProperty.call(t,"filter")&&e.uint32(82).bytes(t.filter),t.startColumn!=null&&Object.hasOwnProperty.call(t,"startColumn")&&e.uint32(90).string(t.startColumn),t.endColumn!=null&&Object.hasOwnProperty.call(t,"endColumn")&&e.uint32(98).string(t.endColumn),t.token!=null&&Object.hasOwnProperty.call(t,"token")&&e.uint32(106).bytes(t.token),t.transactionId!=null&&Object.hasOwnProperty.call(t,"transactionId")&&e.uint32(114).string(t.transactionId),t.dataBlockTypeHint!=null&&Object.hasOwnProperty.call(t,"dataBlockTypeHint")&&e.uint32(120).int32(t.dataBlockTypeHint),t.returnEntirePrimaryKeys!=null&&Object.hasOwnProperty.call(t,"returnEntirePrimaryKeys")&&e.uint32(128).bool(t.returnEntirePrimaryKeys),t.compressTypeHint!=null&&Object.hasOwnProperty.call(t,"compressTypeHint")&&e.uint32(136).int32(t.compressTypeHint),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.GetRangeRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.direction=t.int32();break;case 3:i.columnsToGet&&i.columnsToGet.length||(i.columnsToGet=[]),i.columnsToGet.push(t.string());break;case 4:i.timeRange=$root.main.proto.TimeRange.decode(t,t.uint32());break;case 5:i.maxVersions=t.int32();break;case 6:i.limit=t.int32();break;case 7:i.inclusiveStartPrimaryKey=t.bytes();break;case 8:i.exclusiveEndPrimaryKey=t.bytes();break;case 9:i.cacheBlocks=t.bool();break;case 10:i.filter=t.bytes();break;case 11:i.startColumn=t.string();break;case 12:i.endColumn=t.string();break;case 13:i.token=t.bytes();break;case 14:i.transactionId=t.string();break;case 15:i.dataBlockTypeHint=t.int32();break;case 16:i.returnEntirePrimaryKeys=t.bool();break;case 17:i.compressTypeHint=t.int32();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});if(!i.hasOwnProperty("direction"))throw $util.ProtocolError("missing required 'direction'",{instance:i});if(!i.hasOwnProperty("inclusiveStartPrimaryKey"))throw $util.ProtocolError("missing required 'inclusiveStartPrimaryKey'",{instance:i});if(!i.hasOwnProperty("exclusiveEndPrimaryKey"))throw $util.ProtocolError("missing required 'exclusiveEndPrimaryKey'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";switch(t.direction){default:return"direction: enum value expected";case 0:case 1:break}if(t.columnsToGet!=null&&t.hasOwnProperty("columnsToGet")){if(!Array.isArray(t.columnsToGet))return"columnsToGet: array expected";for(var e=0;e<t.columnsToGet.length;++e)if(!$util.isString(t.columnsToGet[e]))return"columnsToGet: string[] expected"}if(t.timeRange!=null&&t.hasOwnProperty("timeRange")){var r=$root.main.proto.TimeRange.verify(t.timeRange);if(r)return"timeRange."+r}if(t.maxVersions!=null&&t.hasOwnProperty("maxVersions")&&!$util.isInteger(t.maxVersions))return"maxVersions: integer expected";if(t.limit!=null&&t.hasOwnProperty("limit")&&!$util.isInteger(t.limit))return"limit: integer expected";if(!(t.inclusiveStartPrimaryKey&&typeof t.inclusiveStartPrimaryKey.length=="number"||$util.isString(t.inclusiveStartPrimaryKey)))return"inclusiveStartPrimaryKey: buffer expected";if(!(t.exclusiveEndPrimaryKey&&typeof t.exclusiveEndPrimaryKey.length=="number"||$util.isString(t.exclusiveEndPrimaryKey)))return"exclusiveEndPrimaryKey: buffer expected";if(t.cacheBlocks!=null&&t.hasOwnProperty("cacheBlocks")&&typeof t.cacheBlocks!="boolean")return"cacheBlocks: boolean expected";if(t.filter!=null&&t.hasOwnProperty("filter")&&!(t.filter&&typeof t.filter.length=="number"||$util.isString(t.filter)))return"filter: buffer expected";if(t.startColumn!=null&&t.hasOwnProperty("startColumn")&&!$util.isString(t.startColumn))return"startColumn: string expected";if(t.endColumn!=null&&t.hasOwnProperty("endColumn")&&!$util.isString(t.endColumn))return"endColumn: string expected";if(t.token!=null&&t.hasOwnProperty("token")&&!(t.token&&typeof t.token.length=="number"||$util.isString(t.token)))return"token: buffer expected";if(t.transactionId!=null&&t.hasOwnProperty("transactionId")&&!$util.isString(t.transactionId))return"transactionId: string expected";if(t.dataBlockTypeHint!=null&&t.hasOwnProperty("dataBlockTypeHint"))switch(t.dataBlockTypeHint){default:return"dataBlockTypeHint: enum value expected";case 0:case 1:break}if(t.returnEntirePrimaryKeys!=null&&t.hasOwnProperty("returnEntirePrimaryKeys")&&typeof t.returnEntirePrimaryKeys!="boolean")return"returnEntirePrimaryKeys: boolean expected";if(t.compressTypeHint!=null&&t.hasOwnProperty("compressTypeHint"))switch(t.compressTypeHint){default:return"compressTypeHint: enum value expected";case 0:break}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.GetRangeRequest)return t;var e=new $root.main.proto.GetRangeRequest;switch(t.tableName!=null&&(e.tableName=String(t.tableName)),t.direction){case"FORWARD":case 0:e.direction=0;break;case"BACKWARD":case 1:e.direction=1;break}if(t.columnsToGet){if(!Array.isArray(t.columnsToGet))throw TypeError(".main.proto.GetRangeRequest.columnsToGet: array expected");e.columnsToGet=[];for(var r=0;r<t.columnsToGet.length;++r)e.columnsToGet[r]=String(t.columnsToGet[r])}if(t.timeRange!=null){if(typeof t.timeRange!="object")throw TypeError(".main.proto.GetRangeRequest.timeRange: object expected");e.timeRange=$root.main.proto.TimeRange.fromObject(t.timeRange)}switch(t.maxVersions!=null&&(e.maxVersions=t.maxVersions|0),t.limit!=null&&(e.limit=t.limit|0),t.inclusiveStartPrimaryKey!=null&&(typeof t.inclusiveStartPrimaryKey=="string"?$util.base64.decode(t.inclusiveStartPrimaryKey,e.inclusiveStartPrimaryKey=$util.newBuffer($util.base64.length(t.inclusiveStartPrimaryKey)),0):t.inclusiveStartPrimaryKey.length&&(e.inclusiveStartPrimaryKey=t.inclusiveStartPrimaryKey)),t.exclusiveEndPrimaryKey!=null&&(typeof t.exclusiveEndPrimaryKey=="string"?$util.base64.decode(t.exclusiveEndPrimaryKey,e.exclusiveEndPrimaryKey=$util.newBuffer($util.base64.length(t.exclusiveEndPrimaryKey)),0):t.exclusiveEndPrimaryKey.length&&(e.exclusiveEndPrimaryKey=t.exclusiveEndPrimaryKey)),t.cacheBlocks!=null&&(e.cacheBlocks=!!t.cacheBlocks),t.filter!=null&&(typeof t.filter=="string"?$util.base64.decode(t.filter,e.filter=$util.newBuffer($util.base64.length(t.filter)),0):t.filter.length&&(e.filter=t.filter)),t.startColumn!=null&&(e.startColumn=String(t.startColumn)),t.endColumn!=null&&(e.endColumn=String(t.endColumn)),t.token!=null&&(typeof t.token=="string"?$util.base64.decode(t.token,e.token=$util.newBuffer($util.base64.length(t.token)),0):t.token.length&&(e.token=t.token)),t.transactionId!=null&&(e.transactionId=String(t.transactionId)),t.dataBlockTypeHint){case"DBT_PLAIN_BUFFER":case 0:e.dataBlockTypeHint=0;break;case"DBT_SIMPLE_ROW_MATRIX":case 1:e.dataBlockTypeHint=1;break}switch(t.returnEntirePrimaryKeys!=null&&(e.returnEntirePrimaryKeys=!!t.returnEntirePrimaryKeys),t.compressTypeHint){case"CPT_NONE":case 0:e.compressTypeHint=0;break}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.columnsToGet=[]),e.defaults&&(r.tableName="",r.direction=e.enums===String?"FORWARD":0,r.timeRange=null,r.maxVersions=0,r.limit=0,e.bytes===String?r.inclusiveStartPrimaryKey="":(r.inclusiveStartPrimaryKey=[],e.bytes!==Array&&(r.inclusiveStartPrimaryKey=$util.newBuffer(r.inclusiveStartPrimaryKey))),e.bytes===String?r.exclusiveEndPrimaryKey="":(r.exclusiveEndPrimaryKey=[],e.bytes!==Array&&(r.exclusiveEndPrimaryKey=$util.newBuffer(r.exclusiveEndPrimaryKey))),r.cacheBlocks=!0,e.bytes===String?r.filter="":(r.filter=[],e.bytes!==Array&&(r.filter=$util.newBuffer(r.filter))),r.startColumn="",r.endColumn="",e.bytes===String?r.token="":(r.token=[],e.bytes!==Array&&(r.token=$util.newBuffer(r.token))),r.transactionId="",r.dataBlockTypeHint=e.enums===String?"DBT_PLAIN_BUFFER":0,r.returnEntirePrimaryKeys=!0,r.compressTypeHint=e.enums===String?"CPT_NONE":0),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.direction!=null&&t.hasOwnProperty("direction")&&(r.direction=e.enums===String?$root.main.proto.Direction[t.direction]:t.direction),t.columnsToGet&&t.columnsToGet.length){r.columnsToGet=[];for(var i=0;i<t.columnsToGet.length;++i)r.columnsToGet[i]=t.columnsToGet[i]}return t.timeRange!=null&&t.hasOwnProperty("timeRange")&&(r.timeRange=$root.main.proto.TimeRange.toObject(t.timeRange,e)),t.maxVersions!=null&&t.hasOwnProperty("maxVersions")&&(r.maxVersions=t.maxVersions),t.limit!=null&&t.hasOwnProperty("limit")&&(r.limit=t.limit),t.inclusiveStartPrimaryKey!=null&&t.hasOwnProperty("inclusiveStartPrimaryKey")&&(r.inclusiveStartPrimaryKey=e.bytes===String?$util.base64.encode(t.inclusiveStartPrimaryKey,0,t.inclusiveStartPrimaryKey.length):e.bytes===Array?Array.prototype.slice.call(t.inclusiveStartPrimaryKey):t.inclusiveStartPrimaryKey),t.exclusiveEndPrimaryKey!=null&&t.hasOwnProperty("exclusiveEndPrimaryKey")&&(r.exclusiveEndPrimaryKey=e.bytes===String?$util.base64.encode(t.exclusiveEndPrimaryKey,0,t.exclusiveEndPrimaryKey.length):e.bytes===Array?Array.prototype.slice.call(t.exclusiveEndPrimaryKey):t.exclusiveEndPrimaryKey),t.cacheBlocks!=null&&t.hasOwnProperty("cacheBlocks")&&(r.cacheBlocks=t.cacheBlocks),t.filter!=null&&t.hasOwnProperty("filter")&&(r.filter=e.bytes===String?$util.base64.encode(t.filter,0,t.filter.length):e.bytes===Array?Array.prototype.slice.call(t.filter):t.filter),t.startColumn!=null&&t.hasOwnProperty("startColumn")&&(r.startColumn=t.startColumn),t.endColumn!=null&&t.hasOwnProperty("endColumn")&&(r.endColumn=t.endColumn),t.token!=null&&t.hasOwnProperty("token")&&(r.token=e.bytes===String?$util.base64.encode(t.token,0,t.token.length):e.bytes===Array?Array.prototype.slice.call(t.token):t.token),t.transactionId!=null&&t.hasOwnProperty("transactionId")&&(r.transactionId=t.transactionId),t.dataBlockTypeHint!=null&&t.hasOwnProperty("dataBlockTypeHint")&&(r.dataBlockTypeHint=e.enums===String?$root.main.proto.DataBlockType[t.dataBlockTypeHint]:t.dataBlockTypeHint),t.returnEntirePrimaryKeys!=null&&t.hasOwnProperty("returnEntirePrimaryKeys")&&(r.returnEntirePrimaryKeys=t.returnEntirePrimaryKeys),t.compressTypeHint!=null&&t.hasOwnProperty("compressTypeHint")&&(r.compressTypeHint=e.enums===String?$root.main.proto.CompressType[t.compressTypeHint]:t.compressTypeHint),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GetRangeResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.consumed=null,n.prototype.rows=$util.newBuffer([]),n.prototype.nextStartPrimaryKey=$util.newBuffer([]),n.prototype.nextToken=$util.newBuffer([]),n.prototype.dataBlockType=0,n.prototype.compressType=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),$root.main.proto.ConsumedCapacity.encode(t.consumed,e.uint32(10).fork()).ldelim(),e.uint32(18).bytes(t.rows),t.nextStartPrimaryKey!=null&&Object.hasOwnProperty.call(t,"nextStartPrimaryKey")&&e.uint32(26).bytes(t.nextStartPrimaryKey),t.nextToken!=null&&Object.hasOwnProperty.call(t,"nextToken")&&e.uint32(34).bytes(t.nextToken),t.dataBlockType!=null&&Object.hasOwnProperty.call(t,"dataBlockType")&&e.uint32(40).int32(t.dataBlockType),t.compressType!=null&&Object.hasOwnProperty.call(t,"compressType")&&e.uint32(48).int32(t.compressType),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.GetRangeResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.consumed=$root.main.proto.ConsumedCapacity.decode(t,t.uint32());break;case 2:i.rows=t.bytes();break;case 3:i.nextStartPrimaryKey=t.bytes();break;case 4:i.nextToken=t.bytes();break;case 5:i.dataBlockType=t.int32();break;case 6:i.compressType=t.int32();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("consumed"))throw $util.ProtocolError("missing required 'consumed'",{instance:i});if(!i.hasOwnProperty("rows"))throw $util.ProtocolError("missing required 'rows'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.ConsumedCapacity.verify(t.consumed);if(e)return"consumed."+e}if(!(t.rows&&typeof t.rows.length=="number"||$util.isString(t.rows)))return"rows: buffer expected";if(t.nextStartPrimaryKey!=null&&t.hasOwnProperty("nextStartPrimaryKey")&&!(t.nextStartPrimaryKey&&typeof t.nextStartPrimaryKey.length=="number"||$util.isString(t.nextStartPrimaryKey)))return"nextStartPrimaryKey: buffer expected";if(t.nextToken!=null&&t.hasOwnProperty("nextToken")&&!(t.nextToken&&typeof t.nextToken.length=="number"||$util.isString(t.nextToken)))return"nextToken: buffer expected";if(t.dataBlockType!=null&&t.hasOwnProperty("dataBlockType"))switch(t.dataBlockType){default:return"dataBlockType: enum value expected";case 0:case 1:break}if(t.compressType!=null&&t.hasOwnProperty("compressType"))switch(t.compressType){default:return"compressType: enum value expected";case 0:break}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.GetRangeResponse)return t;var e=new $root.main.proto.GetRangeResponse;if(t.consumed!=null){if(typeof t.consumed!="object")throw TypeError(".main.proto.GetRangeResponse.consumed: object expected");e.consumed=$root.main.proto.ConsumedCapacity.fromObject(t.consumed)}switch(t.rows!=null&&(typeof t.rows=="string"?$util.base64.decode(t.rows,e.rows=$util.newBuffer($util.base64.length(t.rows)),0):t.rows.length&&(e.rows=t.rows)),t.nextStartPrimaryKey!=null&&(typeof t.nextStartPrimaryKey=="string"?$util.base64.decode(t.nextStartPrimaryKey,e.nextStartPrimaryKey=$util.newBuffer($util.base64.length(t.nextStartPrimaryKey)),0):t.nextStartPrimaryKey.length&&(e.nextStartPrimaryKey=t.nextStartPrimaryKey)),t.nextToken!=null&&(typeof t.nextToken=="string"?$util.base64.decode(t.nextToken,e.nextToken=$util.newBuffer($util.base64.length(t.nextToken)),0):t.nextToken.length&&(e.nextToken=t.nextToken)),t.dataBlockType){case"DBT_PLAIN_BUFFER":case 0:e.dataBlockType=0;break;case"DBT_SIMPLE_ROW_MATRIX":case 1:e.dataBlockType=1;break}switch(t.compressType){case"CPT_NONE":case 0:e.compressType=0;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.consumed=null,e.bytes===String?r.rows="":(r.rows=[],e.bytes!==Array&&(r.rows=$util.newBuffer(r.rows))),e.bytes===String?r.nextStartPrimaryKey="":(r.nextStartPrimaryKey=[],e.bytes!==Array&&(r.nextStartPrimaryKey=$util.newBuffer(r.nextStartPrimaryKey))),e.bytes===String?r.nextToken="":(r.nextToken=[],e.bytes!==Array&&(r.nextToken=$util.newBuffer(r.nextToken))),r.dataBlockType=e.enums===String?"DBT_PLAIN_BUFFER":0,r.compressType=e.enums===String?"CPT_NONE":0),t.consumed!=null&&t.hasOwnProperty("consumed")&&(r.consumed=$root.main.proto.ConsumedCapacity.toObject(t.consumed,e)),t.rows!=null&&t.hasOwnProperty("rows")&&(r.rows=e.bytes===String?$util.base64.encode(t.rows,0,t.rows.length):e.bytes===Array?Array.prototype.slice.call(t.rows):t.rows),t.nextStartPrimaryKey!=null&&t.hasOwnProperty("nextStartPrimaryKey")&&(r.nextStartPrimaryKey=e.bytes===String?$util.base64.encode(t.nextStartPrimaryKey,0,t.nextStartPrimaryKey.length):e.bytes===Array?Array.prototype.slice.call(t.nextStartPrimaryKey):t.nextStartPrimaryKey),t.nextToken!=null&&t.hasOwnProperty("nextToken")&&(r.nextToken=e.bytes===String?$util.base64.encode(t.nextToken,0,t.nextToken.length):e.bytes===Array?Array.prototype.slice.call(t.nextToken):t.nextToken),t.dataBlockType!=null&&t.hasOwnProperty("dataBlockType")&&(r.dataBlockType=e.enums===String?$root.main.proto.DataBlockType[t.dataBlockType]:t.dataBlockType),t.compressType!=null&&t.hasOwnProperty("compressType")&&(r.compressType=e.enums===String?$root.main.proto.CompressType[t.compressType]:t.compressType),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.StartLocalTransactionRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.key=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e.uint32(18).bytes(t.key),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.StartLocalTransactionRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.key=t.bytes();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});if(!i.hasOwnProperty("key"))throw $util.ProtocolError("missing required 'key'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.tableName)?t.key&&typeof t.key.length=="number"||$util.isString(t.key)?null:"key: buffer expected":"tableName: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.StartLocalTransactionRequest)return t;var e=new $root.main.proto.StartLocalTransactionRequest;return t.tableName!=null&&(e.tableName=String(t.tableName)),t.key!=null&&(typeof t.key=="string"?$util.base64.decode(t.key,e.key=$util.newBuffer($util.base64.length(t.key)),0):t.key.length&&(e.key=t.key)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",e.bytes===String?r.key="":(r.key=[],e.bytes!==Array&&(r.key=$util.newBuffer(r.key)))),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.key!=null&&t.hasOwnProperty("key")&&(r.key=e.bytes===String?$util.base64.encode(t.key,0,t.key.length):e.bytes===Array?Array.prototype.slice.call(t.key):t.key),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.StartLocalTransactionResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.transactionId="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.transactionId),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.StartLocalTransactionResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.transactionId=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("transactionId"))throw $util.ProtocolError("missing required 'transactionId'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.transactionId)?null:"transactionId: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.StartLocalTransactionResponse)return t;var e=new $root.main.proto.StartLocalTransactionResponse;return t.transactionId!=null&&(e.transactionId=String(t.transactionId)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.transactionId=""),t.transactionId!=null&&t.hasOwnProperty("transactionId")&&(r.transactionId=t.transactionId),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.CommitTransactionRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.transactionId="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.transactionId),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.CommitTransactionRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.transactionId=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("transactionId"))throw $util.ProtocolError("missing required 'transactionId'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.transactionId)?null:"transactionId: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.CommitTransactionRequest)return t;var e=new $root.main.proto.CommitTransactionRequest;return t.transactionId!=null&&(e.transactionId=String(t.transactionId)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.transactionId=""),t.transactionId!=null&&t.hasOwnProperty("transactionId")&&(r.transactionId=t.transactionId),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.CommitTransactionResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.CommitTransactionResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.main.proto.CommitTransactionResponse?t:new $root.main.proto.CommitTransactionResponse},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.AbortTransactionRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.transactionId="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.transactionId),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.AbortTransactionRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.transactionId=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("transactionId"))throw $util.ProtocolError("missing required 'transactionId'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.transactionId)?null:"transactionId: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.AbortTransactionRequest)return t;var e=new $root.main.proto.AbortTransactionRequest;return t.transactionId!=null&&(e.transactionId=String(t.transactionId)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.transactionId=""),t.transactionId!=null&&t.hasOwnProperty("transactionId")&&(r.transactionId=t.transactionId),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.AbortTransactionResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.AbortTransactionResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.main.proto.AbortTransactionResponse?t:new $root.main.proto.AbortTransactionResponse},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ListStreamRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.tableName!=null&&Object.hasOwnProperty.call(t,"tableName")&&e.uint32(10).string(t.tableName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.ListStreamRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.tableName!=null&&t.hasOwnProperty("tableName")&&!$util.isString(t.tableName)?"tableName: string expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.ListStreamRequest)return t;var e=new $root.main.proto.ListStreamRequest;return t.tableName!=null&&(e.tableName=String(t.tableName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.Stream=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.streamId="",n.prototype.tableName="",n.prototype.creationTime=$util.Long?$util.Long.fromBits(0,0,!1):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.streamId),e.uint32(18).string(t.tableName),e.uint32(24).int64(t.creationTime),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.Stream;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.streamId=t.string();break;case 2:i.tableName=t.string();break;case 3:i.creationTime=t.int64();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("streamId"))throw $util.ProtocolError("missing required 'streamId'",{instance:i});if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});if(!i.hasOwnProperty("creationTime"))throw $util.ProtocolError("missing required 'creationTime'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.streamId)?$util.isString(t.tableName)?!$util.isInteger(t.creationTime)&&!(t.creationTime&&$util.isInteger(t.creationTime.low)&&$util.isInteger(t.creationTime.high))?"creationTime: integer|Long expected":null:"tableName: string expected":"streamId: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.Stream)return t;var e=new $root.main.proto.Stream;return t.streamId!=null&&(e.streamId=String(t.streamId)),t.tableName!=null&&(e.tableName=String(t.tableName)),t.creationTime!=null&&($util.Long?(e.creationTime=$util.Long.fromValue(t.creationTime)).unsigned=!1:typeof t.creationTime=="string"?e.creationTime=parseInt(t.creationTime,10):typeof t.creationTime=="number"?e.creationTime=t.creationTime:typeof t.creationTime=="object"&&(e.creationTime=new $util.LongBits(t.creationTime.low>>>0,t.creationTime.high>>>0).toNumber())),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults)if(r.streamId="",r.tableName="",$util.Long){var i=new $util.Long(0,0,!1);r.creationTime=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.creationTime=e.longs===String?"0":0;return t.streamId!=null&&t.hasOwnProperty("streamId")&&(r.streamId=t.streamId),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.creationTime!=null&&t.hasOwnProperty("creationTime")&&(typeof t.creationTime=="number"?r.creationTime=e.longs===String?String(t.creationTime):t.creationTime:r.creationTime=e.longs===String?$util.Long.prototype.toString.call(t.creationTime):e.longs===Number?new $util.LongBits(t.creationTime.low>>>0,t.creationTime.high>>>0).toNumber():t.creationTime),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ListStreamResponse=function(){function n(o){if(this.streams=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.streams=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.streams!=null&&t.streams.length)for(var r=0;r<t.streams.length;++r)$root.main.proto.Stream.encode(t.streams[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.ListStreamResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.streams&&i.streams.length||(i.streams=[]),i.streams.push($root.main.proto.Stream.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.streams!=null&&t.hasOwnProperty("streams")){if(!Array.isArray(t.streams))return"streams: array expected";for(var e=0;e<t.streams.length;++e){var r=$root.main.proto.Stream.verify(t.streams[e]);if(r)return"streams."+r}}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.ListStreamResponse)return t;var e=new $root.main.proto.ListStreamResponse;if(t.streams){if(!Array.isArray(t.streams))throw TypeError(".main.proto.ListStreamResponse.streams: array expected");e.streams=[];for(var r=0;r<t.streams.length;++r){if(typeof t.streams[r]!="object")throw TypeError(".main.proto.ListStreamResponse.streams: object expected");e.streams[r]=$root.main.proto.Stream.fromObject(t.streams[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.streams=[]),t.streams&&t.streams.length){r.streams=[];for(var i=0;i<t.streams.length;++i)r.streams[i]=$root.main.proto.Stream.toObject(t.streams[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.StreamShard=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.shardId="",n.prototype.parentId="",n.prototype.parentSiblingId="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.shardId),t.parentId!=null&&Object.hasOwnProperty.call(t,"parentId")&&e.uint32(18).string(t.parentId),t.parentSiblingId!=null&&Object.hasOwnProperty.call(t,"parentSiblingId")&&e.uint32(26).string(t.parentSiblingId),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.StreamShard;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.shardId=t.string();break;case 2:i.parentId=t.string();break;case 3:i.parentSiblingId=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("shardId"))throw $util.ProtocolError("missing required 'shardId'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.shardId)?t.parentId!=null&&t.hasOwnProperty("parentId")&&!$util.isString(t.parentId)?"parentId: string expected":t.parentSiblingId!=null&&t.hasOwnProperty("parentSiblingId")&&!$util.isString(t.parentSiblingId)?"parentSiblingId: string expected":null:"shardId: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.StreamShard)return t;var e=new $root.main.proto.StreamShard;return t.shardId!=null&&(e.shardId=String(t.shardId)),t.parentId!=null&&(e.parentId=String(t.parentId)),t.parentSiblingId!=null&&(e.parentSiblingId=String(t.parentSiblingId)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.shardId="",r.parentId="",r.parentSiblingId=""),t.shardId!=null&&t.hasOwnProperty("shardId")&&(r.shardId=t.shardId),t.parentId!=null&&t.hasOwnProperty("parentId")&&(r.parentId=t.parentId),t.parentSiblingId!=null&&t.hasOwnProperty("parentSiblingId")&&(r.parentSiblingId=t.parentSiblingId),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.StreamStatus=function(){var n={},o=Object.create(n);return o[n[1]="STREAM_ENABLING"]=1,o[n[2]="STREAM_ACTIVE"]=2,o}(),c.DescribeStreamRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.streamId="",n.prototype.inclusiveStartShardId="",n.prototype.shardLimit=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.streamId),t.inclusiveStartShardId!=null&&Object.hasOwnProperty.call(t,"inclusiveStartShardId")&&e.uint32(18).string(t.inclusiveStartShardId),t.shardLimit!=null&&Object.hasOwnProperty.call(t,"shardLimit")&&e.uint32(24).int32(t.shardLimit),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.DescribeStreamRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.streamId=t.string();break;case 2:i.inclusiveStartShardId=t.string();break;case 3:i.shardLimit=t.int32();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("streamId"))throw $util.ProtocolError("missing required 'streamId'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.streamId)?t.inclusiveStartShardId!=null&&t.hasOwnProperty("inclusiveStartShardId")&&!$util.isString(t.inclusiveStartShardId)?"inclusiveStartShardId: string expected":t.shardLimit!=null&&t.hasOwnProperty("shardLimit")&&!$util.isInteger(t.shardLimit)?"shardLimit: integer expected":null:"streamId: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.DescribeStreamRequest)return t;var e=new $root.main.proto.DescribeStreamRequest;return t.streamId!=null&&(e.streamId=String(t.streamId)),t.inclusiveStartShardId!=null&&(e.inclusiveStartShardId=String(t.inclusiveStartShardId)),t.shardLimit!=null&&(e.shardLimit=t.shardLimit|0),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.streamId="",r.inclusiveStartShardId="",r.shardLimit=0),t.streamId!=null&&t.hasOwnProperty("streamId")&&(r.streamId=t.streamId),t.inclusiveStartShardId!=null&&t.hasOwnProperty("inclusiveStartShardId")&&(r.inclusiveStartShardId=t.inclusiveStartShardId),t.shardLimit!=null&&t.hasOwnProperty("shardLimit")&&(r.shardLimit=t.shardLimit),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DescribeStreamResponse=function(){function n(o){if(this.shards=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.streamId="",n.prototype.expirationTime=0,n.prototype.tableName="",n.prototype.creationTime=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.streamStatus=1,n.prototype.shards=$util.emptyArray,n.prototype.nextShardId="",n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),e.uint32(10).string(t.streamId),e.uint32(16).int32(t.expirationTime),e.uint32(26).string(t.tableName),e.uint32(32).int64(t.creationTime),e.uint32(40).int32(t.streamStatus),t.shards!=null&&t.shards.length)for(var r=0;r<t.shards.length;++r)$root.main.proto.StreamShard.encode(t.shards[r],e.uint32(50).fork()).ldelim();return t.nextShardId!=null&&Object.hasOwnProperty.call(t,"nextShardId")&&e.uint32(58).string(t.nextShardId),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.DescribeStreamResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.streamId=t.string();break;case 2:i.expirationTime=t.int32();break;case 3:i.tableName=t.string();break;case 4:i.creationTime=t.int64();break;case 5:i.streamStatus=t.int32();break;case 6:i.shards&&i.shards.length||(i.shards=[]),i.shards.push($root.main.proto.StreamShard.decode(t,t.uint32()));break;case 7:i.nextShardId=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("streamId"))throw $util.ProtocolError("missing required 'streamId'",{instance:i});if(!i.hasOwnProperty("expirationTime"))throw $util.ProtocolError("missing required 'expirationTime'",{instance:i});if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});if(!i.hasOwnProperty("creationTime"))throw $util.ProtocolError("missing required 'creationTime'",{instance:i});if(!i.hasOwnProperty("streamStatus"))throw $util.ProtocolError("missing required 'streamStatus'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.streamId))return"streamId: string expected";if(!$util.isInteger(t.expirationTime))return"expirationTime: integer expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(!$util.isInteger(t.creationTime)&&!(t.creationTime&&$util.isInteger(t.creationTime.low)&&$util.isInteger(t.creationTime.high)))return"creationTime: integer|Long expected";switch(t.streamStatus){default:return"streamStatus: enum value expected";case 1:case 2:break}if(t.shards!=null&&t.hasOwnProperty("shards")){if(!Array.isArray(t.shards))return"shards: array expected";for(var e=0;e<t.shards.length;++e){var r=$root.main.proto.StreamShard.verify(t.shards[e]);if(r)return"shards."+r}}return t.nextShardId!=null&&t.hasOwnProperty("nextShardId")&&!$util.isString(t.nextShardId)?"nextShardId: string expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.DescribeStreamResponse)return t;var e=new $root.main.proto.DescribeStreamResponse;switch(t.streamId!=null&&(e.streamId=String(t.streamId)),t.expirationTime!=null&&(e.expirationTime=t.expirationTime|0),t.tableName!=null&&(e.tableName=String(t.tableName)),t.creationTime!=null&&($util.Long?(e.creationTime=$util.Long.fromValue(t.creationTime)).unsigned=!1:typeof t.creationTime=="string"?e.creationTime=parseInt(t.creationTime,10):typeof t.creationTime=="number"?e.creationTime=t.creationTime:typeof t.creationTime=="object"&&(e.creationTime=new $util.LongBits(t.creationTime.low>>>0,t.creationTime.high>>>0).toNumber())),t.streamStatus){case"STREAM_ENABLING":case 1:e.streamStatus=1;break;case"STREAM_ACTIVE":case 2:e.streamStatus=2;break}if(t.shards){if(!Array.isArray(t.shards))throw TypeError(".main.proto.DescribeStreamResponse.shards: array expected");e.shards=[];for(var r=0;r<t.shards.length;++r){if(typeof t.shards[r]!="object")throw TypeError(".main.proto.DescribeStreamResponse.shards: object expected");e.shards[r]=$root.main.proto.StreamShard.fromObject(t.shards[r])}}return t.nextShardId!=null&&(e.nextShardId=String(t.nextShardId)),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.shards=[]),e.defaults){if(r.streamId="",r.expirationTime=0,r.tableName="",$util.Long){var i=new $util.Long(0,0,!1);r.creationTime=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.creationTime=e.longs===String?"0":0;r.streamStatus=e.enums===String?"STREAM_ENABLING":1,r.nextShardId=""}if(t.streamId!=null&&t.hasOwnProperty("streamId")&&(r.streamId=t.streamId),t.expirationTime!=null&&t.hasOwnProperty("expirationTime")&&(r.expirationTime=t.expirationTime),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.creationTime!=null&&t.hasOwnProperty("creationTime")&&(typeof t.creationTime=="number"?r.creationTime=e.longs===String?String(t.creationTime):t.creationTime:r.creationTime=e.longs===String?$util.Long.prototype.toString.call(t.creationTime):e.longs===Number?new $util.LongBits(t.creationTime.low>>>0,t.creationTime.high>>>0).toNumber():t.creationTime),t.streamStatus!=null&&t.hasOwnProperty("streamStatus")&&(r.streamStatus=e.enums===String?$root.main.proto.StreamStatus[t.streamStatus]:t.streamStatus),t.shards&&t.shards.length){r.shards=[];for(var l=0;l<t.shards.length;++l)r.shards[l]=$root.main.proto.StreamShard.toObject(t.shards[l],e)}return t.nextShardId!=null&&t.hasOwnProperty("nextShardId")&&(r.nextShardId=t.nextShardId),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GetShardIteratorRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.streamId="",n.prototype.shardId="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.streamId),e.uint32(18).string(t.shardId),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.GetShardIteratorRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.streamId=t.string();break;case 2:i.shardId=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("streamId"))throw $util.ProtocolError("missing required 'streamId'",{instance:i});if(!i.hasOwnProperty("shardId"))throw $util.ProtocolError("missing required 'shardId'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.streamId)?$util.isString(t.shardId)?null:"shardId: string expected":"streamId: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.GetShardIteratorRequest)return t;var e=new $root.main.proto.GetShardIteratorRequest;return t.streamId!=null&&(e.streamId=String(t.streamId)),t.shardId!=null&&(e.shardId=String(t.shardId)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.streamId="",r.shardId=""),t.streamId!=null&&t.hasOwnProperty("streamId")&&(r.streamId=t.streamId),t.shardId!=null&&t.hasOwnProperty("shardId")&&(r.shardId=t.shardId),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GetShardIteratorResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.shardIterator="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.shardIterator),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.GetShardIteratorResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.shardIterator=t.string();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("shardIterator"))throw $util.ProtocolError("missing required 'shardIterator'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.shardIterator)?null:"shardIterator: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.GetShardIteratorResponse)return t;var e=new $root.main.proto.GetShardIteratorResponse;return t.shardIterator!=null&&(e.shardIterator=String(t.shardIterator)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.shardIterator=""),t.shardIterator!=null&&t.hasOwnProperty("shardIterator")&&(r.shardIterator=t.shardIterator),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GetStreamRecordRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.shardIterator="",n.prototype.limit=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.shardIterator),t.limit!=null&&Object.hasOwnProperty.call(t,"limit")&&e.uint32(16).int32(t.limit),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.GetStreamRecordRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.shardIterator=t.string();break;case 2:i.limit=t.int32();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("shardIterator"))throw $util.ProtocolError("missing required 'shardIterator'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.shardIterator)?t.limit!=null&&t.hasOwnProperty("limit")&&!$util.isInteger(t.limit)?"limit: integer expected":null:"shardIterator: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.GetStreamRecordRequest)return t;var e=new $root.main.proto.GetStreamRecordRequest;return t.shardIterator!=null&&(e.shardIterator=String(t.shardIterator)),t.limit!=null&&(e.limit=t.limit|0),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.shardIterator="",r.limit=0),t.shardIterator!=null&&t.hasOwnProperty("shardIterator")&&(r.shardIterator=t.shardIterator),t.limit!=null&&t.hasOwnProperty("limit")&&(r.limit=t.limit),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ActionType=function(){var n={},o=Object.create(n);return o[n[1]="PUT_ROW"]=1,o[n[2]="UPDATE_ROW"]=2,o[n[3]="DELETE_ROW"]=3,o}(),c.GetStreamRecordResponse=function(){function n(o){if(this.streamRecords=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.streamRecords=$util.emptyArray,n.prototype.nextShardIterator="",n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.streamRecords!=null&&t.streamRecords.length)for(var r=0;r<t.streamRecords.length;++r)$root.main.proto.GetStreamRecordResponse.StreamRecord.encode(t.streamRecords[r],e.uint32(10).fork()).ldelim();return t.nextShardIterator!=null&&Object.hasOwnProperty.call(t,"nextShardIterator")&&e.uint32(18).string(t.nextShardIterator),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.GetStreamRecordResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.streamRecords&&i.streamRecords.length||(i.streamRecords=[]),i.streamRecords.push($root.main.proto.GetStreamRecordResponse.StreamRecord.decode(t,t.uint32()));break;case 2:i.nextShardIterator=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.streamRecords!=null&&t.hasOwnProperty("streamRecords")){if(!Array.isArray(t.streamRecords))return"streamRecords: array expected";for(var e=0;e<t.streamRecords.length;++e){var r=$root.main.proto.GetStreamRecordResponse.StreamRecord.verify(t.streamRecords[e]);if(r)return"streamRecords."+r}}return t.nextShardIterator!=null&&t.hasOwnProperty("nextShardIterator")&&!$util.isString(t.nextShardIterator)?"nextShardIterator: string expected":null},n.fromObject=function(t){if(t instanceof $root.main.proto.GetStreamRecordResponse)return t;var e=new $root.main.proto.GetStreamRecordResponse;if(t.streamRecords){if(!Array.isArray(t.streamRecords))throw TypeError(".main.proto.GetStreamRecordResponse.streamRecords: array expected");e.streamRecords=[];for(var r=0;r<t.streamRecords.length;++r){if(typeof t.streamRecords[r]!="object")throw TypeError(".main.proto.GetStreamRecordResponse.streamRecords: object expected");e.streamRecords[r]=$root.main.proto.GetStreamRecordResponse.StreamRecord.fromObject(t.streamRecords[r])}}return t.nextShardIterator!=null&&(e.nextShardIterator=String(t.nextShardIterator)),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.streamRecords=[]),e.defaults&&(r.nextShardIterator=""),t.streamRecords&&t.streamRecords.length){r.streamRecords=[];for(var i=0;i<t.streamRecords.length;++i)r.streamRecords[i]=$root.main.proto.GetStreamRecordResponse.StreamRecord.toObject(t.streamRecords[i],e)}return t.nextShardIterator!=null&&t.hasOwnProperty("nextShardIterator")&&(r.nextShardIterator=t.nextShardIterator),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n.StreamRecord=function(){function o(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return o.prototype.actionType=1,o.prototype.record=$util.newBuffer([]),o.create=function(e){return new o(e)},o.encode=function(e,r){return r||(r=$Writer.create()),r.uint32(8).int32(e.actionType),r.uint32(18).bytes(e.record),r},o.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},o.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=r===void 0?e.len:e.pos+r,l=new $root.main.proto.GetStreamRecordResponse.StreamRecord;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:l.actionType=e.int32();break;case 2:l.record=e.bytes();break;default:e.skipType(a&7);break}}if(!l.hasOwnProperty("actionType"))throw $util.ProtocolError("missing required 'actionType'",{instance:l});if(!l.hasOwnProperty("record"))throw $util.ProtocolError("missing required 'record'",{instance:l});return l},o.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},o.verify=function(e){if(typeof e!="object"||e===null)return"object expected";switch(e.actionType){default:return"actionType: enum value expected";case 1:case 2:case 3:break}return e.record&&typeof e.record.length=="number"||$util.isString(e.record)?null:"record: buffer expected"},o.fromObject=function(e){if(e instanceof $root.main.proto.GetStreamRecordResponse.StreamRecord)return e;var r=new $root.main.proto.GetStreamRecordResponse.StreamRecord;switch(e.actionType){case"PUT_ROW":case 1:r.actionType=1;break;case"UPDATE_ROW":case 2:r.actionType=2;break;case"DELETE_ROW":case 3:r.actionType=3;break}return e.record!=null&&(typeof e.record=="string"?$util.base64.decode(e.record,r.record=$util.newBuffer($util.base64.length(e.record)),0):e.record.length&&(r.record=e.record)),r},o.toObject=function(e,r){r||(r={});var i={};return r.defaults&&(i.actionType=r.enums===String?"PUT_ROW":1,r.bytes===String?i.record="":(i.record=[],r.bytes!==Array&&(i.record=$util.newBuffer(i.record)))),e.actionType!=null&&e.hasOwnProperty("actionType")&&(i.actionType=r.enums===String?$root.main.proto.ActionType[e.actionType]:e.actionType),e.record!=null&&e.hasOwnProperty("record")&&(i.record=r.bytes===String?$util.base64.encode(e.record,0,e.record.length):r.bytes===Array?Array.prototype.slice.call(e.record):e.record),i},o.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},o}(),n}(),c.ComputeSplitPointsBySizeRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.splitSize=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.splitSizeUnitInByte=$util.Long?$util.Long.fromBits(0,0,!1):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e.uint32(16).int64(t.splitSize),t.splitSizeUnitInByte!=null&&Object.hasOwnProperty.call(t,"splitSizeUnitInByte")&&e.uint32(24).int64(t.splitSizeUnitInByte),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.ComputeSplitPointsBySizeRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.splitSize=t.int64();break;case 3:i.splitSizeUnitInByte=t.int64();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});if(!i.hasOwnProperty("splitSize"))throw $util.ProtocolError("missing required 'splitSize'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isString(t.tableName)?!$util.isInteger(t.splitSize)&&!(t.splitSize&&$util.isInteger(t.splitSize.low)&&$util.isInteger(t.splitSize.high))?"splitSize: integer|Long expected":t.splitSizeUnitInByte!=null&&t.hasOwnProperty("splitSizeUnitInByte")&&!$util.isInteger(t.splitSizeUnitInByte)&&!(t.splitSizeUnitInByte&&$util.isInteger(t.splitSizeUnitInByte.low)&&$util.isInteger(t.splitSizeUnitInByte.high))?"splitSizeUnitInByte: integer|Long expected":null:"tableName: string expected"},n.fromObject=function(t){if(t instanceof $root.main.proto.ComputeSplitPointsBySizeRequest)return t;var e=new $root.main.proto.ComputeSplitPointsBySizeRequest;return t.tableName!=null&&(e.tableName=String(t.tableName)),t.splitSize!=null&&($util.Long?(e.splitSize=$util.Long.fromValue(t.splitSize)).unsigned=!1:typeof t.splitSize=="string"?e.splitSize=parseInt(t.splitSize,10):typeof t.splitSize=="number"?e.splitSize=t.splitSize:typeof t.splitSize=="object"&&(e.splitSize=new $util.LongBits(t.splitSize.low>>>0,t.splitSize.high>>>0).toNumber())),t.splitSizeUnitInByte!=null&&($util.Long?(e.splitSizeUnitInByte=$util.Long.fromValue(t.splitSizeUnitInByte)).unsigned=!1:typeof t.splitSizeUnitInByte=="string"?e.splitSizeUnitInByte=parseInt(t.splitSizeUnitInByte,10):typeof t.splitSizeUnitInByte=="number"?e.splitSizeUnitInByte=t.splitSizeUnitInByte:typeof t.splitSizeUnitInByte=="object"&&(e.splitSizeUnitInByte=new $util.LongBits(t.splitSizeUnitInByte.low>>>0,t.splitSizeUnitInByte.high>>>0).toNumber())),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(r.tableName="",$util.Long){var i=new $util.Long(0,0,!1);r.splitSize=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.splitSize=e.longs===String?"0":0;if($util.Long){var i=new $util.Long(0,0,!1);r.splitSizeUnitInByte=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.splitSizeUnitInByte=e.longs===String?"0":0}return t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.splitSize!=null&&t.hasOwnProperty("splitSize")&&(typeof t.splitSize=="number"?r.splitSize=e.longs===String?String(t.splitSize):t.splitSize:r.splitSize=e.longs===String?$util.Long.prototype.toString.call(t.splitSize):e.longs===Number?new $util.LongBits(t.splitSize.low>>>0,t.splitSize.high>>>0).toNumber():t.splitSize),t.splitSizeUnitInByte!=null&&t.hasOwnProperty("splitSizeUnitInByte")&&(typeof t.splitSizeUnitInByte=="number"?r.splitSizeUnitInByte=e.longs===String?String(t.splitSizeUnitInByte):t.splitSizeUnitInByte:r.splitSizeUnitInByte=e.longs===String?$util.Long.prototype.toString.call(t.splitSizeUnitInByte):e.longs===Number?new $util.LongBits(t.splitSizeUnitInByte.low>>>0,t.splitSizeUnitInByte.high>>>0).toNumber():t.splitSizeUnitInByte),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ComputeSplitPointsBySizeResponse=function(){function n(o){if(this.schema=[],this.splitPoints=[],this.locations=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.consumed=null,n.prototype.schema=$util.emptyArray,n.prototype.splitPoints=$util.emptyArray,n.prototype.locations=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),$root.main.proto.ConsumedCapacity.encode(t.consumed,e.uint32(10).fork()).ldelim(),t.schema!=null&&t.schema.length)for(var r=0;r<t.schema.length;++r)$root.main.proto.PrimaryKeySchema.encode(t.schema[r],e.uint32(18).fork()).ldelim();if(t.splitPoints!=null&&t.splitPoints.length)for(var r=0;r<t.splitPoints.length;++r)e.uint32(26).bytes(t.splitPoints[r]);if(t.locations!=null&&t.locations.length)for(var r=0;r<t.locations.length;++r)$root.main.proto.ComputeSplitPointsBySizeResponse.SplitLocation.encode(t.locations[r],e.uint32(34).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.ComputeSplitPointsBySizeResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.consumed=$root.main.proto.ConsumedCapacity.decode(t,t.uint32());break;case 2:i.schema&&i.schema.length||(i.schema=[]),i.schema.push($root.main.proto.PrimaryKeySchema.decode(t,t.uint32()));break;case 3:i.splitPoints&&i.splitPoints.length||(i.splitPoints=[]),i.splitPoints.push(t.bytes());break;case 4:i.locations&&i.locations.length||(i.locations=[]),i.locations.push($root.main.proto.ComputeSplitPointsBySizeResponse.SplitLocation.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("consumed"))throw $util.ProtocolError("missing required 'consumed'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{var e=$root.main.proto.ConsumedCapacity.verify(t.consumed);if(e)return"consumed."+e}if(t.schema!=null&&t.hasOwnProperty("schema")){if(!Array.isArray(t.schema))return"schema: array expected";for(var r=0;r<t.schema.length;++r){var e=$root.main.proto.PrimaryKeySchema.verify(t.schema[r]);if(e)return"schema."+e}}if(t.splitPoints!=null&&t.hasOwnProperty("splitPoints")){if(!Array.isArray(t.splitPoints))return"splitPoints: array expected";for(var r=0;r<t.splitPoints.length;++r)if(!(t.splitPoints[r]&&typeof t.splitPoints[r].length=="number"||$util.isString(t.splitPoints[r])))return"splitPoints: buffer[] expected"}if(t.locations!=null&&t.hasOwnProperty("locations")){if(!Array.isArray(t.locations))return"locations: array expected";for(var r=0;r<t.locations.length;++r){var e=$root.main.proto.ComputeSplitPointsBySizeResponse.SplitLocation.verify(t.locations[r]);if(e)return"locations."+e}}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.ComputeSplitPointsBySizeResponse)return t;var e=new $root.main.proto.ComputeSplitPointsBySizeResponse;if(t.consumed!=null){if(typeof t.consumed!="object")throw TypeError(".main.proto.ComputeSplitPointsBySizeResponse.consumed: object expected");e.consumed=$root.main.proto.ConsumedCapacity.fromObject(t.consumed)}if(t.schema){if(!Array.isArray(t.schema))throw TypeError(".main.proto.ComputeSplitPointsBySizeResponse.schema: array expected");e.schema=[];for(var r=0;r<t.schema.length;++r){if(typeof t.schema[r]!="object")throw TypeError(".main.proto.ComputeSplitPointsBySizeResponse.schema: object expected");e.schema[r]=$root.main.proto.PrimaryKeySchema.fromObject(t.schema[r])}}if(t.splitPoints){if(!Array.isArray(t.splitPoints))throw TypeError(".main.proto.ComputeSplitPointsBySizeResponse.splitPoints: array expected");e.splitPoints=[];for(var r=0;r<t.splitPoints.length;++r)typeof t.splitPoints[r]=="string"?$util.base64.decode(t.splitPoints[r],e.splitPoints[r]=$util.newBuffer($util.base64.length(t.splitPoints[r])),0):t.splitPoints[r].length&&(e.splitPoints[r]=t.splitPoints[r])}if(t.locations){if(!Array.isArray(t.locations))throw TypeError(".main.proto.ComputeSplitPointsBySizeResponse.locations: array expected");e.locations=[];for(var r=0;r<t.locations.length;++r){if(typeof t.locations[r]!="object")throw TypeError(".main.proto.ComputeSplitPointsBySizeResponse.locations: object expected");e.locations[r]=$root.main.proto.ComputeSplitPointsBySizeResponse.SplitLocation.fromObject(t.locations[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.schema=[],r.splitPoints=[],r.locations=[]),e.defaults&&(r.consumed=null),t.consumed!=null&&t.hasOwnProperty("consumed")&&(r.consumed=$root.main.proto.ConsumedCapacity.toObject(t.consumed,e)),t.schema&&t.schema.length){r.schema=[];for(var i=0;i<t.schema.length;++i)r.schema[i]=$root.main.proto.PrimaryKeySchema.toObject(t.schema[i],e)}if(t.splitPoints&&t.splitPoints.length){r.splitPoints=[];for(var i=0;i<t.splitPoints.length;++i)r.splitPoints[i]=e.bytes===String?$util.base64.encode(t.splitPoints[i],0,t.splitPoints[i].length):e.bytes===Array?Array.prototype.slice.call(t.splitPoints[i]):t.splitPoints[i]}if(t.locations&&t.locations.length){r.locations=[];for(var i=0;i<t.locations.length;++i)r.locations[i]=$root.main.proto.ComputeSplitPointsBySizeResponse.SplitLocation.toObject(t.locations[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n.SplitLocation=function(){function o(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return o.prototype.location="",o.prototype.repeat=$util.Long?$util.Long.fromBits(0,0,!1):0,o.create=function(e){return new o(e)},o.encode=function(e,r){return r||(r=$Writer.create()),r.uint32(10).string(e.location),r.uint32(16).sint64(e.repeat),r},o.encodeDelimited=function(e,r){return this.encode(e,r).ldelim()},o.decode=function(e,r){e instanceof $Reader||(e=$Reader.create(e));for(var i=r===void 0?e.len:e.pos+r,l=new $root.main.proto.ComputeSplitPointsBySizeResponse.SplitLocation;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:l.location=e.string();break;case 2:l.repeat=e.sint64();break;default:e.skipType(a&7);break}}if(!l.hasOwnProperty("location"))throw $util.ProtocolError("missing required 'location'",{instance:l});if(!l.hasOwnProperty("repeat"))throw $util.ProtocolError("missing required 'repeat'",{instance:l});return l},o.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},o.verify=function(e){return typeof e!="object"||e===null?"object expected":$util.isString(e.location)?!$util.isInteger(e.repeat)&&!(e.repeat&&$util.isInteger(e.repeat.low)&&$util.isInteger(e.repeat.high))?"repeat: integer|Long expected":null:"location: string expected"},o.fromObject=function(e){if(e instanceof $root.main.proto.ComputeSplitPointsBySizeResponse.SplitLocation)return e;var r=new $root.main.proto.ComputeSplitPointsBySizeResponse.SplitLocation;return e.location!=null&&(r.location=String(e.location)),e.repeat!=null&&($util.Long?(r.repeat=$util.Long.fromValue(e.repeat)).unsigned=!1:typeof e.repeat=="string"?r.repeat=parseInt(e.repeat,10):typeof e.repeat=="number"?r.repeat=e.repeat:typeof e.repeat=="object"&&(r.repeat=new $util.LongBits(e.repeat.low>>>0,e.repeat.high>>>0).toNumber())),r},o.toObject=function(e,r){r||(r={});var i={};if(r.defaults)if(i.location="",$util.Long){var l=new $util.Long(0,0,!1);i.repeat=r.longs===String?l.toString():r.longs===Number?l.toNumber():l}else i.repeat=r.longs===String?"0":0;return e.location!=null&&e.hasOwnProperty("location")&&(i.location=e.location),e.repeat!=null&&e.hasOwnProperty("repeat")&&(typeof e.repeat=="number"?i.repeat=r.longs===String?String(e.repeat):e.repeat:i.repeat=r.longs===String?$util.Long.prototype.toString.call(e.repeat):r.longs===Number?new $util.LongBits(e.repeat.low>>>0,e.repeat.high>>>0).toNumber():e.repeat),i},o.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},o}(),n}(),c.SQLPayloadVersion=function(){var n={},o=Object.create(n);return o[n[2]="SQL_FLAT_BUFFERS"]=2,o}(),c.SQLStatementType=function(){var n={},o=Object.create(n);return o[n[1]="SQL_SELECT"]=1,o[n[2]="SQL_CREATE_TABLE"]=2,o[n[3]="SQL_SHOW_TABLE"]=3,o[n[4]="SQL_DESCRIBE_TABLE"]=4,o[n[5]="SQL_DROP_TABLE"]=5,o[n[6]="SQL_ALTER_TABLE"]=6,o}(),c.SQLQueryRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.query="",n.prototype.version=2,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.query),t.version!=null&&Object.hasOwnProperty.call(t,"version")&&e.uint32(16).int32(t.version),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.SQLQueryRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.query=t.string();break;case 2:i.version=t.int32();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("query"))throw $util.ProtocolError("missing required 'query'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.query))return"query: string expected";if(t.version!=null&&t.hasOwnProperty("version"))switch(t.version){default:return"version: enum value expected";case 2:break}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.SQLQueryRequest)return t;var e=new $root.main.proto.SQLQueryRequest;switch(t.query!=null&&(e.query=String(t.query)),t.version){case"SQL_FLAT_BUFFERS":case 2:e.version=2;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.query="",r.version=e.enums===String?"SQL_FLAT_BUFFERS":2),t.query!=null&&t.hasOwnProperty("query")&&(r.query=t.query),t.version!=null&&t.hasOwnProperty("version")&&(r.version=e.enums===String?$root.main.proto.SQLPayloadVersion[t.version]:t.version),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TableConsumedCapacity=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.consumed=null,n.prototype.reservedThroughput=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.tableName!=null&&Object.hasOwnProperty.call(t,"tableName")&&e.uint32(10).string(t.tableName),t.consumed!=null&&Object.hasOwnProperty.call(t,"consumed")&&$root.main.proto.ConsumedCapacity.encode(t.consumed,e.uint32(18).fork()).ldelim(),t.reservedThroughput!=null&&Object.hasOwnProperty.call(t,"reservedThroughput")&&$root.main.proto.ReservedThroughput.encode(t.reservedThroughput,e.uint32(26).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.TableConsumedCapacity;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.consumed=$root.main.proto.ConsumedCapacity.decode(t,t.uint32());break;case 3:i.reservedThroughput=$root.main.proto.ReservedThroughput.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.tableName!=null&&t.hasOwnProperty("tableName")&&!$util.isString(t.tableName))return"tableName: string expected";if(t.consumed!=null&&t.hasOwnProperty("consumed")){var e=$root.main.proto.ConsumedCapacity.verify(t.consumed);if(e)return"consumed."+e}if(t.reservedThroughput!=null&&t.hasOwnProperty("reservedThroughput")){var e=$root.main.proto.ReservedThroughput.verify(t.reservedThroughput);if(e)return"reservedThroughput."+e}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.TableConsumedCapacity)return t;var e=new $root.main.proto.TableConsumedCapacity;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.consumed!=null){if(typeof t.consumed!="object")throw TypeError(".main.proto.TableConsumedCapacity.consumed: object expected");e.consumed=$root.main.proto.ConsumedCapacity.fromObject(t.consumed)}if(t.reservedThroughput!=null){if(typeof t.reservedThroughput!="object")throw TypeError(".main.proto.TableConsumedCapacity.reservedThroughput: object expected");e.reservedThroughput=$root.main.proto.ReservedThroughput.fromObject(t.reservedThroughput)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",r.consumed=null,r.reservedThroughput=null),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.consumed!=null&&t.hasOwnProperty("consumed")&&(r.consumed=$root.main.proto.ConsumedCapacity.toObject(t.consumed,e)),t.reservedThroughput!=null&&t.hasOwnProperty("reservedThroughput")&&(r.reservedThroughput=$root.main.proto.ReservedThroughput.toObject(t.reservedThroughput,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SQLQueryResponse=function(){function n(o){if(this.consumes=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.consumes=$util.emptyArray,n.prototype.rows=$util.newBuffer([]),n.prototype.version=2,n.prototype.type=1,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.consumes!=null&&t.consumes.length)for(var r=0;r<t.consumes.length;++r)$root.main.proto.TableConsumedCapacity.encode(t.consumes[r],e.uint32(10).fork()).ldelim();return t.rows!=null&&Object.hasOwnProperty.call(t,"rows")&&e.uint32(18).bytes(t.rows),t.version!=null&&Object.hasOwnProperty.call(t,"version")&&e.uint32(24).int32(t.version),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&e.uint32(32).int32(t.type),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.main.proto.SQLQueryResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.consumes&&i.consumes.length||(i.consumes=[]),i.consumes.push($root.main.proto.TableConsumedCapacity.decode(t,t.uint32()));break;case 2:i.rows=t.bytes();break;case 3:i.version=t.int32();break;case 4:i.type=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.consumes!=null&&t.hasOwnProperty("consumes")){if(!Array.isArray(t.consumes))return"consumes: array expected";for(var e=0;e<t.consumes.length;++e){var r=$root.main.proto.TableConsumedCapacity.verify(t.consumes[e]);if(r)return"consumes."+r}}if(t.rows!=null&&t.hasOwnProperty("rows")&&!(t.rows&&typeof t.rows.length=="number"||$util.isString(t.rows)))return"rows: buffer expected";if(t.version!=null&&t.hasOwnProperty("version"))switch(t.version){default:return"version: enum value expected";case 2:break}if(t.type!=null&&t.hasOwnProperty("type"))switch(t.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:break}return null},n.fromObject=function(t){if(t instanceof $root.main.proto.SQLQueryResponse)return t;var e=new $root.main.proto.SQLQueryResponse;if(t.consumes){if(!Array.isArray(t.consumes))throw TypeError(".main.proto.SQLQueryResponse.consumes: array expected");e.consumes=[];for(var r=0;r<t.consumes.length;++r){if(typeof t.consumes[r]!="object")throw TypeError(".main.proto.SQLQueryResponse.consumes: object expected");e.consumes[r]=$root.main.proto.TableConsumedCapacity.fromObject(t.consumes[r])}}switch(t.rows!=null&&(typeof t.rows=="string"?$util.base64.decode(t.rows,e.rows=$util.newBuffer($util.base64.length(t.rows)),0):t.rows.length&&(e.rows=t.rows)),t.version){case"SQL_FLAT_BUFFERS":case 2:e.version=2;break}switch(t.type){case"SQL_SELECT":case 1:e.type=1;break;case"SQL_CREATE_TABLE":case 2:e.type=2;break;case"SQL_SHOW_TABLE":case 3:e.type=3;break;case"SQL_DESCRIBE_TABLE":case 4:e.type=4;break;case"SQL_DROP_TABLE":case 5:e.type=5;break;case"SQL_ALTER_TABLE":case 6:e.type=6;break}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.consumes=[]),e.defaults&&(e.bytes===String?r.rows="":(r.rows=[],e.bytes!==Array&&(r.rows=$util.newBuffer(r.rows))),r.version=e.enums===String?"SQL_FLAT_BUFFERS":2,r.type=e.enums===String?"SQL_SELECT":1),t.consumes&&t.consumes.length){r.consumes=[];for(var i=0;i<t.consumes.length;++i)r.consumes[i]=$root.main.proto.TableConsumedCapacity.toObject(t.consumes[i],e)}return t.rows!=null&&t.hasOwnProperty("rows")&&(r.rows=e.bytes===String?$util.base64.encode(t.rows,0,t.rows.length):e.bytes===Array?Array.prototype.slice.call(t.rows):t.rows),t.version!=null&&t.hasOwnProperty("version")&&(r.version=e.enums===String?$root.main.proto.SQLPayloadVersion[t.version]:t.version),t.type!=null&&t.hasOwnProperty("type")&&(r.type=e.enums===String?$root.main.proto.SQLStatementType[t.type]:t.type),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c}(),u}();$root.filter=function(){var u={};return u.proto=function(){var c={};return c.FilterType=function(){var n={},o=Object.create(n);return o[n[1]="FT_SINGLE_COLUMN_VALUE"]=1,o[n[2]="FT_COMPOSITE_COLUMN_VALUE"]=2,o[n[3]="FT_COLUMN_PAGINATION"]=3,o}(),c.ComparatorType=function(){var n={},o=Object.create(n);return o[n[1]="CT_EQUAL"]=1,o[n[2]="CT_NOT_EQUAL"]=2,o[n[3]="CT_GREATER_THAN"]=3,o[n[4]="CT_GREATER_EQUAL"]=4,o[n[5]="CT_LESS_THAN"]=5,o[n[6]="CT_LESS_EQUAL"]=6,o}(),c.SingleColumnValueFilter=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.comparator=1,n.prototype.columnName="",n.prototype.columnValue=$util.newBuffer([]),n.prototype.filterIfMissing=!1,n.prototype.latestVersionOnly=!1,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(8).int32(t.comparator),e.uint32(18).string(t.columnName),e.uint32(26).bytes(t.columnValue),e.uint32(32).bool(t.filterIfMissing),e.uint32(40).bool(t.latestVersionOnly),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.filter.proto.SingleColumnValueFilter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.comparator=t.int32();break;case 2:i.columnName=t.string();break;case 3:i.columnValue=t.bytes();break;case 4:i.filterIfMissing=t.bool();break;case 5:i.latestVersionOnly=t.bool();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("comparator"))throw $util.ProtocolError("missing required 'comparator'",{instance:i});if(!i.hasOwnProperty("columnName"))throw $util.ProtocolError("missing required 'columnName'",{instance:i});if(!i.hasOwnProperty("columnValue"))throw $util.ProtocolError("missing required 'columnValue'",{instance:i});if(!i.hasOwnProperty("filterIfMissing"))throw $util.ProtocolError("missing required 'filterIfMissing'",{instance:i});if(!i.hasOwnProperty("latestVersionOnly"))throw $util.ProtocolError("missing required 'latestVersionOnly'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";switch(t.comparator){default:return"comparator: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:break}return $util.isString(t.columnName)?t.columnValue&&typeof t.columnValue.length=="number"||$util.isString(t.columnValue)?typeof t.filterIfMissing!="boolean"?"filterIfMissing: boolean expected":typeof t.latestVersionOnly!="boolean"?"latestVersionOnly: boolean expected":null:"columnValue: buffer expected":"columnName: string expected"},n.fromObject=function(t){if(t instanceof $root.filter.proto.SingleColumnValueFilter)return t;var e=new $root.filter.proto.SingleColumnValueFilter;switch(t.comparator){case"CT_EQUAL":case 1:e.comparator=1;break;case"CT_NOT_EQUAL":case 2:e.comparator=2;break;case"CT_GREATER_THAN":case 3:e.comparator=3;break;case"CT_GREATER_EQUAL":case 4:e.comparator=4;break;case"CT_LESS_THAN":case 5:e.comparator=5;break;case"CT_LESS_EQUAL":case 6:e.comparator=6;break}return t.columnName!=null&&(e.columnName=String(t.columnName)),t.columnValue!=null&&(typeof t.columnValue=="string"?$util.base64.decode(t.columnValue,e.columnValue=$util.newBuffer($util.base64.length(t.columnValue)),0):t.columnValue.length&&(e.columnValue=t.columnValue)),t.filterIfMissing!=null&&(e.filterIfMissing=!!t.filterIfMissing),t.latestVersionOnly!=null&&(e.latestVersionOnly=!!t.latestVersionOnly),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.comparator=e.enums===String?"CT_EQUAL":1,r.columnName="",e.bytes===String?r.columnValue="":(r.columnValue=[],e.bytes!==Array&&(r.columnValue=$util.newBuffer(r.columnValue))),r.filterIfMissing=!1,r.latestVersionOnly=!1),t.comparator!=null&&t.hasOwnProperty("comparator")&&(r.comparator=e.enums===String?$root.filter.proto.ComparatorType[t.comparator]:t.comparator),t.columnName!=null&&t.hasOwnProperty("columnName")&&(r.columnName=t.columnName),t.columnValue!=null&&t.hasOwnProperty("columnValue")&&(r.columnValue=e.bytes===String?$util.base64.encode(t.columnValue,0,t.columnValue.length):e.bytes===Array?Array.prototype.slice.call(t.columnValue):t.columnValue),t.filterIfMissing!=null&&t.hasOwnProperty("filterIfMissing")&&(r.filterIfMissing=t.filterIfMissing),t.latestVersionOnly!=null&&t.hasOwnProperty("latestVersionOnly")&&(r.latestVersionOnly=t.latestVersionOnly),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.LogicalOperator=function(){var n={},o=Object.create(n);return o[n[1]="LO_NOT"]=1,o[n[2]="LO_AND"]=2,o[n[3]="LO_OR"]=3,o}(),c.CompositeColumnValueFilter=function(){function n(o){if(this.subFilters=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.combinator=1,n.prototype.subFilters=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),e.uint32(8).int32(t.combinator),t.subFilters!=null&&t.subFilters.length)for(var r=0;r<t.subFilters.length;++r)$root.filter.proto.Filter.encode(t.subFilters[r],e.uint32(18).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.filter.proto.CompositeColumnValueFilter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.combinator=t.int32();break;case 2:i.subFilters&&i.subFilters.length||(i.subFilters=[]),i.subFilters.push($root.filter.proto.Filter.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("combinator"))throw $util.ProtocolError("missing required 'combinator'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";switch(t.combinator){default:return"combinator: enum value expected";case 1:case 2:case 3:break}if(t.subFilters!=null&&t.hasOwnProperty("subFilters")){if(!Array.isArray(t.subFilters))return"subFilters: array expected";for(var e=0;e<t.subFilters.length;++e){var r=$root.filter.proto.Filter.verify(t.subFilters[e]);if(r)return"subFilters."+r}}return null},n.fromObject=function(t){if(t instanceof $root.filter.proto.CompositeColumnValueFilter)return t;var e=new $root.filter.proto.CompositeColumnValueFilter;switch(t.combinator){case"LO_NOT":case 1:e.combinator=1;break;case"LO_AND":case 2:e.combinator=2;break;case"LO_OR":case 3:e.combinator=3;break}if(t.subFilters){if(!Array.isArray(t.subFilters))throw TypeError(".filter.proto.CompositeColumnValueFilter.subFilters: array expected");e.subFilters=[];for(var r=0;r<t.subFilters.length;++r){if(typeof t.subFilters[r]!="object")throw TypeError(".filter.proto.CompositeColumnValueFilter.subFilters: object expected");e.subFilters[r]=$root.filter.proto.Filter.fromObject(t.subFilters[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.subFilters=[]),e.defaults&&(r.combinator=e.enums===String?"LO_NOT":1),t.combinator!=null&&t.hasOwnProperty("combinator")&&(r.combinator=e.enums===String?$root.filter.proto.LogicalOperator[t.combinator]:t.combinator),t.subFilters&&t.subFilters.length){r.subFilters=[];for(var i=0;i<t.subFilters.length;++i)r.subFilters[i]=$root.filter.proto.Filter.toObject(t.subFilters[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ColumnPaginationFilter=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.offset=0,n.prototype.limit=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(8).int32(t.offset),e.uint32(16).int32(t.limit),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.filter.proto.ColumnPaginationFilter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.offset=t.int32();break;case 2:i.limit=t.int32();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("offset"))throw $util.ProtocolError("missing required 'offset'",{instance:i});if(!i.hasOwnProperty("limit"))throw $util.ProtocolError("missing required 'limit'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":$util.isInteger(t.offset)?$util.isInteger(t.limit)?null:"limit: integer expected":"offset: integer expected"},n.fromObject=function(t){if(t instanceof $root.filter.proto.ColumnPaginationFilter)return t;var e=new $root.filter.proto.ColumnPaginationFilter;return t.offset!=null&&(e.offset=t.offset|0),t.limit!=null&&(e.limit=t.limit|0),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.offset=0,r.limit=0),t.offset!=null&&t.hasOwnProperty("offset")&&(r.offset=t.offset),t.limit!=null&&t.hasOwnProperty("limit")&&(r.limit=t.limit),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.Filter=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.type=1,n.prototype.filter=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(8).int32(t.type),e.uint32(18).bytes(t.filter),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.filter.proto.Filter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.type=t.int32();break;case 2:i.filter=t.bytes();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("type"))throw $util.ProtocolError("missing required 'type'",{instance:i});if(!i.hasOwnProperty("filter"))throw $util.ProtocolError("missing required 'filter'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";switch(t.type){default:return"type: enum value expected";case 1:case 2:case 3:break}return t.filter&&typeof t.filter.length=="number"||$util.isString(t.filter)?null:"filter: buffer expected"},n.fromObject=function(t){if(t instanceof $root.filter.proto.Filter)return t;var e=new $root.filter.proto.Filter;switch(t.type){case"FT_SINGLE_COLUMN_VALUE":case 1:e.type=1;break;case"FT_COMPOSITE_COLUMN_VALUE":case 2:e.type=2;break;case"FT_COLUMN_PAGINATION":case 3:e.type=3;break}return t.filter!=null&&(typeof t.filter=="string"?$util.base64.decode(t.filter,e.filter=$util.newBuffer($util.base64.length(t.filter)),0):t.filter.length&&(e.filter=t.filter)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.type=e.enums===String?"FT_SINGLE_COLUMN_VALUE":1,e.bytes===String?r.filter="":(r.filter=[],e.bytes!==Array&&(r.filter=$util.newBuffer(r.filter)))),t.type!=null&&t.hasOwnProperty("type")&&(r.type=e.enums===String?$root.filter.proto.FilterType[t.type]:t.type),t.filter!=null&&t.hasOwnProperty("filter")&&(r.filter=e.bytes===String?$util.base64.encode(t.filter,0,t.filter.length):e.bytes===Array?Array.prototype.slice.call(t.filter):t.filter),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c}(),u}();$root.search=function(){var u={};return u.proto=function(){var c={};return c.AggregationType=function(){var n={},o=Object.create(n);return o[n[1]="AGG_AVG"]=1,o[n[2]="AGG_MAX"]=2,o[n[3]="AGG_MIN"]=3,o[n[4]="AGG_SUM"]=4,o[n[5]="AGG_COUNT"]=5,o[n[6]="AGG_DISTINCT_COUNT"]=6,o[n[7]="AGG_TOP_ROWS"]=7,o[n[8]="AGG_PERCENTILES"]=8,o}(),c.GroupByType=function(){var n={},o=Object.create(n);return o[n[1]="GROUP_BY_FIELD"]=1,o[n[2]="GROUP_BY_RANGE"]=2,o[n[3]="GROUP_BY_FILTER"]=3,o[n[4]="GROUP_BY_GEO_DISTANCE"]=4,o[n[5]="GROUP_BY_HISTOGRAM"]=5,o[n[6]="GROUP_BY_DATE_HISTOGRAM"]=6,o[n[7]="GROUP_BY_GEO_GRID"]=7,o[n[8]="GROUP_BY_COMPOSITE"]=8,o}(),c.Aggregation=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.name="",n.prototype.type=1,n.prototype.body=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.name!=null&&Object.hasOwnProperty.call(t,"name")&&e.uint32(10).string(t.name),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&e.uint32(16).int32(t.type),t.body!=null&&Object.hasOwnProperty.call(t,"body")&&e.uint32(26).bytes(t.body),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.Aggregation;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.name=t.string();break;case 2:i.type=t.int32();break;case 3:i.body=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.name!=null&&t.hasOwnProperty("name")&&!$util.isString(t.name))return"name: string expected";if(t.type!=null&&t.hasOwnProperty("type"))switch(t.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:break}return t.body!=null&&t.hasOwnProperty("body")&&!(t.body&&typeof t.body.length=="number"||$util.isString(t.body))?"body: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.Aggregation)return t;var e=new $root.search.proto.Aggregation;switch(t.name!=null&&(e.name=String(t.name)),t.type){case"AGG_AVG":case 1:e.type=1;break;case"AGG_MAX":case 2:e.type=2;break;case"AGG_MIN":case 3:e.type=3;break;case"AGG_SUM":case 4:e.type=4;break;case"AGG_COUNT":case 5:e.type=5;break;case"AGG_DISTINCT_COUNT":case 6:e.type=6;break;case"AGG_TOP_ROWS":case 7:e.type=7;break;case"AGG_PERCENTILES":case 8:e.type=8;break}return t.body!=null&&(typeof t.body=="string"?$util.base64.decode(t.body,e.body=$util.newBuffer($util.base64.length(t.body)),0):t.body.length&&(e.body=t.body)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.name="",r.type=e.enums===String?"AGG_AVG":1,e.bytes===String?r.body="":(r.body=[],e.bytes!==Array&&(r.body=$util.newBuffer(r.body)))),t.name!=null&&t.hasOwnProperty("name")&&(r.name=t.name),t.type!=null&&t.hasOwnProperty("type")&&(r.type=e.enums===String?$root.search.proto.AggregationType[t.type]:t.type),t.body!=null&&t.hasOwnProperty("body")&&(r.body=e.bytes===String?$util.base64.encode(t.body,0,t.body.length):e.bytes===Array?Array.prototype.slice.call(t.body):t.body),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.Aggregations=function(){function n(o){if(this.aggs=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.aggs=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.aggs!=null&&t.aggs.length)for(var r=0;r<t.aggs.length;++r)$root.search.proto.Aggregation.encode(t.aggs[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.Aggregations;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.aggs&&i.aggs.length||(i.aggs=[]),i.aggs.push($root.search.proto.Aggregation.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.aggs!=null&&t.hasOwnProperty("aggs")){if(!Array.isArray(t.aggs))return"aggs: array expected";for(var e=0;e<t.aggs.length;++e){var r=$root.search.proto.Aggregation.verify(t.aggs[e]);if(r)return"aggs."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.Aggregations)return t;var e=new $root.search.proto.Aggregations;if(t.aggs){if(!Array.isArray(t.aggs))throw TypeError(".search.proto.Aggregations.aggs: array expected");e.aggs=[];for(var r=0;r<t.aggs.length;++r){if(typeof t.aggs[r]!="object")throw TypeError(".search.proto.Aggregations.aggs: object expected");e.aggs[r]=$root.search.proto.Aggregation.fromObject(t.aggs[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.aggs=[]),t.aggs&&t.aggs.length){r.aggs=[];for(var i=0;i<t.aggs.length;++i)r.aggs[i]=$root.search.proto.Aggregation.toObject(t.aggs[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupBy=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.name="",n.prototype.type=1,n.prototype.body=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.name!=null&&Object.hasOwnProperty.call(t,"name")&&e.uint32(10).string(t.name),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&e.uint32(16).int32(t.type),t.body!=null&&Object.hasOwnProperty.call(t,"body")&&e.uint32(26).bytes(t.body),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupBy;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.name=t.string();break;case 2:i.type=t.int32();break;case 3:i.body=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.name!=null&&t.hasOwnProperty("name")&&!$util.isString(t.name))return"name: string expected";if(t.type!=null&&t.hasOwnProperty("type"))switch(t.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:break}return t.body!=null&&t.hasOwnProperty("body")&&!(t.body&&typeof t.body.length=="number"||$util.isString(t.body))?"body: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupBy)return t;var e=new $root.search.proto.GroupBy;switch(t.name!=null&&(e.name=String(t.name)),t.type){case"GROUP_BY_FIELD":case 1:e.type=1;break;case"GROUP_BY_RANGE":case 2:e.type=2;break;case"GROUP_BY_FILTER":case 3:e.type=3;break;case"GROUP_BY_GEO_DISTANCE":case 4:e.type=4;break;case"GROUP_BY_HISTOGRAM":case 5:e.type=5;break;case"GROUP_BY_DATE_HISTOGRAM":case 6:e.type=6;break;case"GROUP_BY_GEO_GRID":case 7:e.type=7;break;case"GROUP_BY_COMPOSITE":case 8:e.type=8;break}return t.body!=null&&(typeof t.body=="string"?$util.base64.decode(t.body,e.body=$util.newBuffer($util.base64.length(t.body)),0):t.body.length&&(e.body=t.body)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.name="",r.type=e.enums===String?"GROUP_BY_FIELD":1,e.bytes===String?r.body="":(r.body=[],e.bytes!==Array&&(r.body=$util.newBuffer(r.body)))),t.name!=null&&t.hasOwnProperty("name")&&(r.name=t.name),t.type!=null&&t.hasOwnProperty("type")&&(r.type=e.enums===String?$root.search.proto.GroupByType[t.type]:t.type),t.body!=null&&t.hasOwnProperty("body")&&(r.body=e.bytes===String?$util.base64.encode(t.body,0,t.body.length):e.bytes===Array?Array.prototype.slice.call(t.body):t.body),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupBys=function(){function n(o){if(this.groupBys=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.groupBys=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.groupBys!=null&&t.groupBys.length)for(var r=0;r<t.groupBys.length;++r)$root.search.proto.GroupBy.encode(t.groupBys[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupBys;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.groupBys&&i.groupBys.length||(i.groupBys=[]),i.groupBys.push($root.search.proto.GroupBy.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.groupBys!=null&&t.hasOwnProperty("groupBys")){if(!Array.isArray(t.groupBys))return"groupBys: array expected";for(var e=0;e<t.groupBys.length;++e){var r=$root.search.proto.GroupBy.verify(t.groupBys[e]);if(r)return"groupBys."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupBys)return t;var e=new $root.search.proto.GroupBys;if(t.groupBys){if(!Array.isArray(t.groupBys))throw TypeError(".search.proto.GroupBys.groupBys: array expected");e.groupBys=[];for(var r=0;r<t.groupBys.length;++r){if(typeof t.groupBys[r]!="object")throw TypeError(".search.proto.GroupBys.groupBys: object expected");e.groupBys[r]=$root.search.proto.GroupBy.fromObject(t.groupBys[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.groupBys=[]),t.groupBys&&t.groupBys.length){r.groupBys=[];for(var i=0;i<t.groupBys.length;++i)r.groupBys[i]=$root.search.proto.GroupBy.toObject(t.groupBys[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.AvgAggregation=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.missing=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.missing!=null&&Object.hasOwnProperty.call(t,"missing")&&e.uint32(18).bytes(t.missing),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.AvgAggregation;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.missing=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.missing!=null&&t.hasOwnProperty("missing")&&!(t.missing&&typeof t.missing.length=="number"||$util.isString(t.missing))?"missing: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.AvgAggregation)return t;var e=new $root.search.proto.AvgAggregation;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.missing!=null&&(typeof t.missing=="string"?$util.base64.decode(t.missing,e.missing=$util.newBuffer($util.base64.length(t.missing)),0):t.missing.length&&(e.missing=t.missing)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",e.bytes===String?r.missing="":(r.missing=[],e.bytes!==Array&&(r.missing=$util.newBuffer(r.missing)))),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.missing!=null&&t.hasOwnProperty("missing")&&(r.missing=e.bytes===String?$util.base64.encode(t.missing,0,t.missing.length):e.bytes===Array?Array.prototype.slice.call(t.missing):t.missing),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.MaxAggregation=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.missing=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.missing!=null&&Object.hasOwnProperty.call(t,"missing")&&e.uint32(18).bytes(t.missing),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.MaxAggregation;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.missing=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.missing!=null&&t.hasOwnProperty("missing")&&!(t.missing&&typeof t.missing.length=="number"||$util.isString(t.missing))?"missing: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.MaxAggregation)return t;var e=new $root.search.proto.MaxAggregation;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.missing!=null&&(typeof t.missing=="string"?$util.base64.decode(t.missing,e.missing=$util.newBuffer($util.base64.length(t.missing)),0):t.missing.length&&(e.missing=t.missing)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",e.bytes===String?r.missing="":(r.missing=[],e.bytes!==Array&&(r.missing=$util.newBuffer(r.missing)))),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.missing!=null&&t.hasOwnProperty("missing")&&(r.missing=e.bytes===String?$util.base64.encode(t.missing,0,t.missing.length):e.bytes===Array?Array.prototype.slice.call(t.missing):t.missing),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.MinAggregation=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.missing=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.missing!=null&&Object.hasOwnProperty.call(t,"missing")&&e.uint32(18).bytes(t.missing),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.MinAggregation;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.missing=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.missing!=null&&t.hasOwnProperty("missing")&&!(t.missing&&typeof t.missing.length=="number"||$util.isString(t.missing))?"missing: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.MinAggregation)return t;var e=new $root.search.proto.MinAggregation;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.missing!=null&&(typeof t.missing=="string"?$util.base64.decode(t.missing,e.missing=$util.newBuffer($util.base64.length(t.missing)),0):t.missing.length&&(e.missing=t.missing)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",e.bytes===String?r.missing="":(r.missing=[],e.bytes!==Array&&(r.missing=$util.newBuffer(r.missing)))),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.missing!=null&&t.hasOwnProperty("missing")&&(r.missing=e.bytes===String?$util.base64.encode(t.missing,0,t.missing.length):e.bytes===Array?Array.prototype.slice.call(t.missing):t.missing),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SumAggregation=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.missing=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.missing!=null&&Object.hasOwnProperty.call(t,"missing")&&e.uint32(18).bytes(t.missing),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SumAggregation;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.missing=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.missing!=null&&t.hasOwnProperty("missing")&&!(t.missing&&typeof t.missing.length=="number"||$util.isString(t.missing))?"missing: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.SumAggregation)return t;var e=new $root.search.proto.SumAggregation;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.missing!=null&&(typeof t.missing=="string"?$util.base64.decode(t.missing,e.missing=$util.newBuffer($util.base64.length(t.missing)),0):t.missing.length&&(e.missing=t.missing)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",e.bytes===String?r.missing="":(r.missing=[],e.bytes!==Array&&(r.missing=$util.newBuffer(r.missing)))),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.missing!=null&&t.hasOwnProperty("missing")&&(r.missing=e.bytes===String?$util.base64.encode(t.missing,0,t.missing.length):e.bytes===Array?Array.prototype.slice.call(t.missing):t.missing),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.CountAggregation=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.CountAggregation;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.CountAggregation)return t;var e=new $root.search.proto.CountAggregation;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName=""),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DistinctCountAggregation=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.missing=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.missing!=null&&Object.hasOwnProperty.call(t,"missing")&&e.uint32(18).bytes(t.missing),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DistinctCountAggregation;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.missing=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.missing!=null&&t.hasOwnProperty("missing")&&!(t.missing&&typeof t.missing.length=="number"||$util.isString(t.missing))?"missing: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.DistinctCountAggregation)return t;var e=new $root.search.proto.DistinctCountAggregation;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.missing!=null&&(typeof t.missing=="string"?$util.base64.decode(t.missing,e.missing=$util.newBuffer($util.base64.length(t.missing)),0):t.missing.length&&(e.missing=t.missing)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",e.bytes===String?r.missing="":(r.missing=[],e.bytes!==Array&&(r.missing=$util.newBuffer(r.missing)))),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.missing!=null&&t.hasOwnProperty("missing")&&(r.missing=e.bytes===String?$util.base64.encode(t.missing,0,t.missing.length):e.bytes===Array?Array.prototype.slice.call(t.missing):t.missing),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TopRowsAggregation=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.limit=0,n.prototype.sort=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.limit!=null&&Object.hasOwnProperty.call(t,"limit")&&e.uint32(8).int32(t.limit),t.sort!=null&&Object.hasOwnProperty.call(t,"sort")&&$root.search.proto.Sort.encode(t.sort,e.uint32(18).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.TopRowsAggregation;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.limit=t.int32();break;case 2:i.sort=$root.search.proto.Sort.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.limit!=null&&t.hasOwnProperty("limit")&&!$util.isInteger(t.limit))return"limit: integer expected";if(t.sort!=null&&t.hasOwnProperty("sort")){var e=$root.search.proto.Sort.verify(t.sort);if(e)return"sort."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.TopRowsAggregation)return t;var e=new $root.search.proto.TopRowsAggregation;if(t.limit!=null&&(e.limit=t.limit|0),t.sort!=null){if(typeof t.sort!="object")throw TypeError(".search.proto.TopRowsAggregation.sort: object expected");e.sort=$root.search.proto.Sort.fromObject(t.sort)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.limit=0,r.sort=null),t.limit!=null&&t.hasOwnProperty("limit")&&(r.limit=t.limit),t.sort!=null&&t.hasOwnProperty("sort")&&(r.sort=$root.search.proto.Sort.toObject(t.sort,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.PercentilesAggregation=function(){function n(o){if(this.percentiles=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.percentiles=$util.emptyArray,n.prototype.missing=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.percentiles!=null&&t.percentiles.length)for(var r=0;r<t.percentiles.length;++r)e.uint32(17).double(t.percentiles[r]);return t.missing!=null&&Object.hasOwnProperty.call(t,"missing")&&e.uint32(26).bytes(t.missing),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.PercentilesAggregation;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:if(i.percentiles&&i.percentiles.length||(i.percentiles=[]),(l&7)===2)for(var a=t.uint32()+t.pos;t.pos<a;)i.percentiles.push(t.double());else i.percentiles.push(t.double());break;case 3:i.missing=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.percentiles!=null&&t.hasOwnProperty("percentiles")){if(!Array.isArray(t.percentiles))return"percentiles: array expected";for(var e=0;e<t.percentiles.length;++e)if(typeof t.percentiles[e]!="number")return"percentiles: number[] expected"}return t.missing!=null&&t.hasOwnProperty("missing")&&!(t.missing&&typeof t.missing.length=="number"||$util.isString(t.missing))?"missing: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.PercentilesAggregation)return t;var e=new $root.search.proto.PercentilesAggregation;if(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.percentiles){if(!Array.isArray(t.percentiles))throw TypeError(".search.proto.PercentilesAggregation.percentiles: array expected");e.percentiles=[];for(var r=0;r<t.percentiles.length;++r)e.percentiles[r]=Number(t.percentiles[r])}return t.missing!=null&&(typeof t.missing=="string"?$util.base64.decode(t.missing,e.missing=$util.newBuffer($util.base64.length(t.missing)),0):t.missing.length&&(e.missing=t.missing)),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.percentiles=[]),e.defaults&&(r.fieldName="",e.bytes===String?r.missing="":(r.missing=[],e.bytes!==Array&&(r.missing=$util.newBuffer(r.missing)))),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.percentiles&&t.percentiles.length){r.percentiles=[];for(var i=0;i<t.percentiles.length;++i)r.percentiles[i]=e.json&&!isFinite(t.percentiles[i])?String(t.percentiles[i]):t.percentiles[i]}return t.missing!=null&&t.hasOwnProperty("missing")&&(r.missing=e.bytes===String?$util.base64.encode(t.missing,0,t.missing.length):e.bytes===Array?Array.prototype.slice.call(t.missing):t.missing),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.FieldRange=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.min=$util.newBuffer([]),n.prototype.max=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.min!=null&&Object.hasOwnProperty.call(t,"min")&&e.uint32(10).bytes(t.min),t.max!=null&&Object.hasOwnProperty.call(t,"max")&&e.uint32(18).bytes(t.max),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.FieldRange;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.min=t.bytes();break;case 2:i.max=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.min!=null&&t.hasOwnProperty("min")&&!(t.min&&typeof t.min.length=="number"||$util.isString(t.min))?"min: buffer expected":t.max!=null&&t.hasOwnProperty("max")&&!(t.max&&typeof t.max.length=="number"||$util.isString(t.max))?"max: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.FieldRange)return t;var e=new $root.search.proto.FieldRange;return t.min!=null&&(typeof t.min=="string"?$util.base64.decode(t.min,e.min=$util.newBuffer($util.base64.length(t.min)),0):t.min.length&&(e.min=t.min)),t.max!=null&&(typeof t.max=="string"?$util.base64.decode(t.max,e.max=$util.newBuffer($util.base64.length(t.max)),0):t.max.length&&(e.max=t.max)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(e.bytes===String?r.min="":(r.min=[],e.bytes!==Array&&(r.min=$util.newBuffer(r.min))),e.bytes===String?r.max="":(r.max=[],e.bytes!==Array&&(r.max=$util.newBuffer(r.max)))),t.min!=null&&t.hasOwnProperty("min")&&(r.min=e.bytes===String?$util.base64.encode(t.min,0,t.min.length):e.bytes===Array?Array.prototype.slice.call(t.min):t.min),t.max!=null&&t.hasOwnProperty("max")&&(r.max=e.bytes===String?$util.base64.encode(t.max,0,t.max.length):e.bytes===Array?Array.prototype.slice.call(t.max):t.max),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByDateHistogram=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.interval=null,n.prototype.fieldRange=null,n.prototype.missing=$util.newBuffer([]),n.prototype.minDocCount=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.timeZone="",n.prototype.sort=null,n.prototype.subAggs=null,n.prototype.subGroupBys=null,n.prototype.offset=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.interval!=null&&Object.hasOwnProperty.call(t,"interval")&&$root.search.proto.DateTimeValue.encode(t.interval,e.uint32(18).fork()).ldelim(),t.fieldRange!=null&&Object.hasOwnProperty.call(t,"fieldRange")&&$root.search.proto.FieldRange.encode(t.fieldRange,e.uint32(26).fork()).ldelim(),t.missing!=null&&Object.hasOwnProperty.call(t,"missing")&&e.uint32(34).bytes(t.missing),t.minDocCount!=null&&Object.hasOwnProperty.call(t,"minDocCount")&&e.uint32(40).int64(t.minDocCount),t.timeZone!=null&&Object.hasOwnProperty.call(t,"timeZone")&&e.uint32(50).string(t.timeZone),t.sort!=null&&Object.hasOwnProperty.call(t,"sort")&&$root.search.proto.GroupBySort.encode(t.sort,e.uint32(58).fork()).ldelim(),t.subAggs!=null&&Object.hasOwnProperty.call(t,"subAggs")&&$root.search.proto.Aggregations.encode(t.subAggs,e.uint32(66).fork()).ldelim(),t.subGroupBys!=null&&Object.hasOwnProperty.call(t,"subGroupBys")&&$root.search.proto.GroupBys.encode(t.subGroupBys,e.uint32(74).fork()).ldelim(),t.offset!=null&&Object.hasOwnProperty.call(t,"offset")&&$root.search.proto.DateTimeValue.encode(t.offset,e.uint32(82).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByDateHistogram;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.interval=$root.search.proto.DateTimeValue.decode(t,t.uint32());break;case 3:i.fieldRange=$root.search.proto.FieldRange.decode(t,t.uint32());break;case 4:i.missing=t.bytes();break;case 5:i.minDocCount=t.int64();break;case 6:i.timeZone=t.string();break;case 7:i.sort=$root.search.proto.GroupBySort.decode(t,t.uint32());break;case 8:i.subAggs=$root.search.proto.Aggregations.decode(t,t.uint32());break;case 9:i.subGroupBys=$root.search.proto.GroupBys.decode(t,t.uint32());break;case 10:i.offset=$root.search.proto.DateTimeValue.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.interval!=null&&t.hasOwnProperty("interval")){var e=$root.search.proto.DateTimeValue.verify(t.interval);if(e)return"interval."+e}if(t.fieldRange!=null&&t.hasOwnProperty("fieldRange")){var e=$root.search.proto.FieldRange.verify(t.fieldRange);if(e)return"fieldRange."+e}if(t.missing!=null&&t.hasOwnProperty("missing")&&!(t.missing&&typeof t.missing.length=="number"||$util.isString(t.missing)))return"missing: buffer expected";if(t.minDocCount!=null&&t.hasOwnProperty("minDocCount")&&!$util.isInteger(t.minDocCount)&&!(t.minDocCount&&$util.isInteger(t.minDocCount.low)&&$util.isInteger(t.minDocCount.high)))return"minDocCount: integer|Long expected";if(t.timeZone!=null&&t.hasOwnProperty("timeZone")&&!$util.isString(t.timeZone))return"timeZone: string expected";if(t.sort!=null&&t.hasOwnProperty("sort")){var e=$root.search.proto.GroupBySort.verify(t.sort);if(e)return"sort."+e}if(t.subAggs!=null&&t.hasOwnProperty("subAggs")){var e=$root.search.proto.Aggregations.verify(t.subAggs);if(e)return"subAggs."+e}if(t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")){var e=$root.search.proto.GroupBys.verify(t.subGroupBys);if(e)return"subGroupBys."+e}if(t.offset!=null&&t.hasOwnProperty("offset")){var e=$root.search.proto.DateTimeValue.verify(t.offset);if(e)return"offset."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByDateHistogram)return t;var e=new $root.search.proto.GroupByDateHistogram;if(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.interval!=null){if(typeof t.interval!="object")throw TypeError(".search.proto.GroupByDateHistogram.interval: object expected");e.interval=$root.search.proto.DateTimeValue.fromObject(t.interval)}if(t.fieldRange!=null){if(typeof t.fieldRange!="object")throw TypeError(".search.proto.GroupByDateHistogram.fieldRange: object expected");e.fieldRange=$root.search.proto.FieldRange.fromObject(t.fieldRange)}if(t.missing!=null&&(typeof t.missing=="string"?$util.base64.decode(t.missing,e.missing=$util.newBuffer($util.base64.length(t.missing)),0):t.missing.length&&(e.missing=t.missing)),t.minDocCount!=null&&($util.Long?(e.minDocCount=$util.Long.fromValue(t.minDocCount)).unsigned=!1:typeof t.minDocCount=="string"?e.minDocCount=parseInt(t.minDocCount,10):typeof t.minDocCount=="number"?e.minDocCount=t.minDocCount:typeof t.minDocCount=="object"&&(e.minDocCount=new $util.LongBits(t.minDocCount.low>>>0,t.minDocCount.high>>>0).toNumber())),t.timeZone!=null&&(e.timeZone=String(t.timeZone)),t.sort!=null){if(typeof t.sort!="object")throw TypeError(".search.proto.GroupByDateHistogram.sort: object expected");e.sort=$root.search.proto.GroupBySort.fromObject(t.sort)}if(t.subAggs!=null){if(typeof t.subAggs!="object")throw TypeError(".search.proto.GroupByDateHistogram.subAggs: object expected");e.subAggs=$root.search.proto.Aggregations.fromObject(t.subAggs)}if(t.subGroupBys!=null){if(typeof t.subGroupBys!="object")throw TypeError(".search.proto.GroupByDateHistogram.subGroupBys: object expected");e.subGroupBys=$root.search.proto.GroupBys.fromObject(t.subGroupBys)}if(t.offset!=null){if(typeof t.offset!="object")throw TypeError(".search.proto.GroupByDateHistogram.offset: object expected");e.offset=$root.search.proto.DateTimeValue.fromObject(t.offset)}return e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(r.fieldName="",r.interval=null,r.fieldRange=null,e.bytes===String?r.missing="":(r.missing=[],e.bytes!==Array&&(r.missing=$util.newBuffer(r.missing))),$util.Long){var i=new $util.Long(0,0,!1);r.minDocCount=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.minDocCount=e.longs===String?"0":0;r.timeZone="",r.sort=null,r.subAggs=null,r.subGroupBys=null,r.offset=null}return t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.interval!=null&&t.hasOwnProperty("interval")&&(r.interval=$root.search.proto.DateTimeValue.toObject(t.interval,e)),t.fieldRange!=null&&t.hasOwnProperty("fieldRange")&&(r.fieldRange=$root.search.proto.FieldRange.toObject(t.fieldRange,e)),t.missing!=null&&t.hasOwnProperty("missing")&&(r.missing=e.bytes===String?$util.base64.encode(t.missing,0,t.missing.length):e.bytes===Array?Array.prototype.slice.call(t.missing):t.missing),t.minDocCount!=null&&t.hasOwnProperty("minDocCount")&&(typeof t.minDocCount=="number"?r.minDocCount=e.longs===String?String(t.minDocCount):t.minDocCount:r.minDocCount=e.longs===String?$util.Long.prototype.toString.call(t.minDocCount):e.longs===Number?new $util.LongBits(t.minDocCount.low>>>0,t.minDocCount.high>>>0).toNumber():t.minDocCount),t.timeZone!=null&&t.hasOwnProperty("timeZone")&&(r.timeZone=t.timeZone),t.sort!=null&&t.hasOwnProperty("sort")&&(r.sort=$root.search.proto.GroupBySort.toObject(t.sort,e)),t.subAggs!=null&&t.hasOwnProperty("subAggs")&&(r.subAggs=$root.search.proto.Aggregations.toObject(t.subAggs,e)),t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")&&(r.subGroupBys=$root.search.proto.GroupBys.toObject(t.subGroupBys,e)),t.offset!=null&&t.hasOwnProperty("offset")&&(r.offset=$root.search.proto.DateTimeValue.toObject(t.offset,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByHistogram=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.interval=$util.newBuffer([]),n.prototype.missing=$util.newBuffer([]),n.prototype.minDocCount=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.sort=null,n.prototype.fieldRange=null,n.prototype.subAggs=null,n.prototype.subGroupBys=null,n.prototype.offset=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.interval!=null&&Object.hasOwnProperty.call(t,"interval")&&e.uint32(18).bytes(t.interval),t.missing!=null&&Object.hasOwnProperty.call(t,"missing")&&e.uint32(26).bytes(t.missing),t.minDocCount!=null&&Object.hasOwnProperty.call(t,"minDocCount")&&e.uint32(32).int64(t.minDocCount),t.sort!=null&&Object.hasOwnProperty.call(t,"sort")&&$root.search.proto.GroupBySort.encode(t.sort,e.uint32(42).fork()).ldelim(),t.fieldRange!=null&&Object.hasOwnProperty.call(t,"fieldRange")&&$root.search.proto.FieldRange.encode(t.fieldRange,e.uint32(50).fork()).ldelim(),t.subAggs!=null&&Object.hasOwnProperty.call(t,"subAggs")&&$root.search.proto.Aggregations.encode(t.subAggs,e.uint32(58).fork()).ldelim(),t.subGroupBys!=null&&Object.hasOwnProperty.call(t,"subGroupBys")&&$root.search.proto.GroupBys.encode(t.subGroupBys,e.uint32(66).fork()).ldelim(),t.offset!=null&&Object.hasOwnProperty.call(t,"offset")&&e.uint32(74).bytes(t.offset),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByHistogram;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.interval=t.bytes();break;case 3:i.missing=t.bytes();break;case 4:i.minDocCount=t.int64();break;case 5:i.sort=$root.search.proto.GroupBySort.decode(t,t.uint32());break;case 6:i.fieldRange=$root.search.proto.FieldRange.decode(t,t.uint32());break;case 7:i.subAggs=$root.search.proto.Aggregations.decode(t,t.uint32());break;case 8:i.subGroupBys=$root.search.proto.GroupBys.decode(t,t.uint32());break;case 9:i.offset=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.interval!=null&&t.hasOwnProperty("interval")&&!(t.interval&&typeof t.interval.length=="number"||$util.isString(t.interval)))return"interval: buffer expected";if(t.missing!=null&&t.hasOwnProperty("missing")&&!(t.missing&&typeof t.missing.length=="number"||$util.isString(t.missing)))return"missing: buffer expected";if(t.minDocCount!=null&&t.hasOwnProperty("minDocCount")&&!$util.isInteger(t.minDocCount)&&!(t.minDocCount&&$util.isInteger(t.minDocCount.low)&&$util.isInteger(t.minDocCount.high)))return"minDocCount: integer|Long expected";if(t.sort!=null&&t.hasOwnProperty("sort")){var e=$root.search.proto.GroupBySort.verify(t.sort);if(e)return"sort."+e}if(t.fieldRange!=null&&t.hasOwnProperty("fieldRange")){var e=$root.search.proto.FieldRange.verify(t.fieldRange);if(e)return"fieldRange."+e}if(t.subAggs!=null&&t.hasOwnProperty("subAggs")){var e=$root.search.proto.Aggregations.verify(t.subAggs);if(e)return"subAggs."+e}if(t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")){var e=$root.search.proto.GroupBys.verify(t.subGroupBys);if(e)return"subGroupBys."+e}return t.offset!=null&&t.hasOwnProperty("offset")&&!(t.offset&&typeof t.offset.length=="number"||$util.isString(t.offset))?"offset: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByHistogram)return t;var e=new $root.search.proto.GroupByHistogram;if(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.interval!=null&&(typeof t.interval=="string"?$util.base64.decode(t.interval,e.interval=$util.newBuffer($util.base64.length(t.interval)),0):t.interval.length&&(e.interval=t.interval)),t.missing!=null&&(typeof t.missing=="string"?$util.base64.decode(t.missing,e.missing=$util.newBuffer($util.base64.length(t.missing)),0):t.missing.length&&(e.missing=t.missing)),t.minDocCount!=null&&($util.Long?(e.minDocCount=$util.Long.fromValue(t.minDocCount)).unsigned=!1:typeof t.minDocCount=="string"?e.minDocCount=parseInt(t.minDocCount,10):typeof t.minDocCount=="number"?e.minDocCount=t.minDocCount:typeof t.minDocCount=="object"&&(e.minDocCount=new $util.LongBits(t.minDocCount.low>>>0,t.minDocCount.high>>>0).toNumber())),t.sort!=null){if(typeof t.sort!="object")throw TypeError(".search.proto.GroupByHistogram.sort: object expected");e.sort=$root.search.proto.GroupBySort.fromObject(t.sort)}if(t.fieldRange!=null){if(typeof t.fieldRange!="object")throw TypeError(".search.proto.GroupByHistogram.fieldRange: object expected");e.fieldRange=$root.search.proto.FieldRange.fromObject(t.fieldRange)}if(t.subAggs!=null){if(typeof t.subAggs!="object")throw TypeError(".search.proto.GroupByHistogram.subAggs: object expected");e.subAggs=$root.search.proto.Aggregations.fromObject(t.subAggs)}if(t.subGroupBys!=null){if(typeof t.subGroupBys!="object")throw TypeError(".search.proto.GroupByHistogram.subGroupBys: object expected");e.subGroupBys=$root.search.proto.GroupBys.fromObject(t.subGroupBys)}return t.offset!=null&&(typeof t.offset=="string"?$util.base64.decode(t.offset,e.offset=$util.newBuffer($util.base64.length(t.offset)),0):t.offset.length&&(e.offset=t.offset)),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(r.fieldName="",e.bytes===String?r.interval="":(r.interval=[],e.bytes!==Array&&(r.interval=$util.newBuffer(r.interval))),e.bytes===String?r.missing="":(r.missing=[],e.bytes!==Array&&(r.missing=$util.newBuffer(r.missing))),$util.Long){var i=new $util.Long(0,0,!1);r.minDocCount=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.minDocCount=e.longs===String?"0":0;r.sort=null,r.fieldRange=null,r.subAggs=null,r.subGroupBys=null,e.bytes===String?r.offset="":(r.offset=[],e.bytes!==Array&&(r.offset=$util.newBuffer(r.offset)))}return t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.interval!=null&&t.hasOwnProperty("interval")&&(r.interval=e.bytes===String?$util.base64.encode(t.interval,0,t.interval.length):e.bytes===Array?Array.prototype.slice.call(t.interval):t.interval),t.missing!=null&&t.hasOwnProperty("missing")&&(r.missing=e.bytes===String?$util.base64.encode(t.missing,0,t.missing.length):e.bytes===Array?Array.prototype.slice.call(t.missing):t.missing),t.minDocCount!=null&&t.hasOwnProperty("minDocCount")&&(typeof t.minDocCount=="number"?r.minDocCount=e.longs===String?String(t.minDocCount):t.minDocCount:r.minDocCount=e.longs===String?$util.Long.prototype.toString.call(t.minDocCount):e.longs===Number?new $util.LongBits(t.minDocCount.low>>>0,t.minDocCount.high>>>0).toNumber():t.minDocCount),t.sort!=null&&t.hasOwnProperty("sort")&&(r.sort=$root.search.proto.GroupBySort.toObject(t.sort,e)),t.fieldRange!=null&&t.hasOwnProperty("fieldRange")&&(r.fieldRange=$root.search.proto.FieldRange.toObject(t.fieldRange,e)),t.subAggs!=null&&t.hasOwnProperty("subAggs")&&(r.subAggs=$root.search.proto.Aggregations.toObject(t.subAggs,e)),t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")&&(r.subGroupBys=$root.search.proto.GroupBys.toObject(t.subGroupBys,e)),t.offset!=null&&t.hasOwnProperty("offset")&&(r.offset=e.bytes===String?$util.base64.encode(t.offset,0,t.offset.length):e.bytes===Array?Array.prototype.slice.call(t.offset):t.offset),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupKeySort=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.order=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.order!=null&&Object.hasOwnProperty.call(t,"order")&&e.uint32(8).int32(t.order),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupKeySort;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.order=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.order!=null&&t.hasOwnProperty("order"))switch(t.order){default:return"order: enum value expected";case 0:case 1:break}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupKeySort)return t;var e=new $root.search.proto.GroupKeySort;switch(t.order){case"SORT_ORDER_ASC":case 0:e.order=0;break;case"SORT_ORDER_DESC":case 1:e.order=1;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.order=e.enums===String?"SORT_ORDER_ASC":0),t.order!=null&&t.hasOwnProperty("order")&&(r.order=e.enums===String?$root.search.proto.SortOrder[t.order]:t.order),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.RowCountSort=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.order=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.order!=null&&Object.hasOwnProperty.call(t,"order")&&e.uint32(8).int32(t.order),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.RowCountSort;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.order=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.order!=null&&t.hasOwnProperty("order"))switch(t.order){default:return"order: enum value expected";case 0:case 1:break}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.RowCountSort)return t;var e=new $root.search.proto.RowCountSort;switch(t.order){case"SORT_ORDER_ASC":case 0:e.order=0;break;case"SORT_ORDER_DESC":case 1:e.order=1;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.order=e.enums===String?"SORT_ORDER_ASC":0),t.order!=null&&t.hasOwnProperty("order")&&(r.order=e.enums===String?$root.search.proto.SortOrder[t.order]:t.order),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SubAggSort=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.subAggName="",n.prototype.order=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.subAggName!=null&&Object.hasOwnProperty.call(t,"subAggName")&&e.uint32(10).string(t.subAggName),t.order!=null&&Object.hasOwnProperty.call(t,"order")&&e.uint32(16).int32(t.order),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SubAggSort;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.subAggName=t.string();break;case 2:i.order=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.subAggName!=null&&t.hasOwnProperty("subAggName")&&!$util.isString(t.subAggName))return"subAggName: string expected";if(t.order!=null&&t.hasOwnProperty("order"))switch(t.order){default:return"order: enum value expected";case 0:case 1:break}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.SubAggSort)return t;var e=new $root.search.proto.SubAggSort;switch(t.subAggName!=null&&(e.subAggName=String(t.subAggName)),t.order){case"SORT_ORDER_ASC":case 0:e.order=0;break;case"SORT_ORDER_DESC":case 1:e.order=1;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.subAggName="",r.order=e.enums===String?"SORT_ORDER_ASC":0),t.subAggName!=null&&t.hasOwnProperty("subAggName")&&(r.subAggName=t.subAggName),t.order!=null&&t.hasOwnProperty("order")&&(r.order=e.enums===String?$root.search.proto.SortOrder[t.order]:t.order),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupBySorter=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.groupKeySort=null,n.prototype.rowCountSort=null,n.prototype.subAggSort=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.groupKeySort!=null&&Object.hasOwnProperty.call(t,"groupKeySort")&&$root.search.proto.GroupKeySort.encode(t.groupKeySort,e.uint32(10).fork()).ldelim(),t.rowCountSort!=null&&Object.hasOwnProperty.call(t,"rowCountSort")&&$root.search.proto.RowCountSort.encode(t.rowCountSort,e.uint32(18).fork()).ldelim(),t.subAggSort!=null&&Object.hasOwnProperty.call(t,"subAggSort")&&$root.search.proto.SubAggSort.encode(t.subAggSort,e.uint32(26).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupBySorter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.groupKeySort=$root.search.proto.GroupKeySort.decode(t,t.uint32());break;case 2:i.rowCountSort=$root.search.proto.RowCountSort.decode(t,t.uint32());break;case 3:i.subAggSort=$root.search.proto.SubAggSort.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.groupKeySort!=null&&t.hasOwnProperty("groupKeySort")){var e=$root.search.proto.GroupKeySort.verify(t.groupKeySort);if(e)return"groupKeySort."+e}if(t.rowCountSort!=null&&t.hasOwnProperty("rowCountSort")){var e=$root.search.proto.RowCountSort.verify(t.rowCountSort);if(e)return"rowCountSort."+e}if(t.subAggSort!=null&&t.hasOwnProperty("subAggSort")){var e=$root.search.proto.SubAggSort.verify(t.subAggSort);if(e)return"subAggSort."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupBySorter)return t;var e=new $root.search.proto.GroupBySorter;if(t.groupKeySort!=null){if(typeof t.groupKeySort!="object")throw TypeError(".search.proto.GroupBySorter.groupKeySort: object expected");e.groupKeySort=$root.search.proto.GroupKeySort.fromObject(t.groupKeySort)}if(t.rowCountSort!=null){if(typeof t.rowCountSort!="object")throw TypeError(".search.proto.GroupBySorter.rowCountSort: object expected");e.rowCountSort=$root.search.proto.RowCountSort.fromObject(t.rowCountSort)}if(t.subAggSort!=null){if(typeof t.subAggSort!="object")throw TypeError(".search.proto.GroupBySorter.subAggSort: object expected");e.subAggSort=$root.search.proto.SubAggSort.fromObject(t.subAggSort)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.groupKeySort=null,r.rowCountSort=null,r.subAggSort=null),t.groupKeySort!=null&&t.hasOwnProperty("groupKeySort")&&(r.groupKeySort=$root.search.proto.GroupKeySort.toObject(t.groupKeySort,e)),t.rowCountSort!=null&&t.hasOwnProperty("rowCountSort")&&(r.rowCountSort=$root.search.proto.RowCountSort.toObject(t.rowCountSort,e)),t.subAggSort!=null&&t.hasOwnProperty("subAggSort")&&(r.subAggSort=$root.search.proto.SubAggSort.toObject(t.subAggSort,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupBySort=function(){function n(o){if(this.sorters=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.sorters=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.sorters!=null&&t.sorters.length)for(var r=0;r<t.sorters.length;++r)$root.search.proto.GroupBySorter.encode(t.sorters[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupBySort;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.sorters&&i.sorters.length||(i.sorters=[]),i.sorters.push($root.search.proto.GroupBySorter.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.sorters!=null&&t.hasOwnProperty("sorters")){if(!Array.isArray(t.sorters))return"sorters: array expected";for(var e=0;e<t.sorters.length;++e){var r=$root.search.proto.GroupBySorter.verify(t.sorters[e]);if(r)return"sorters."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupBySort)return t;var e=new $root.search.proto.GroupBySort;if(t.sorters){if(!Array.isArray(t.sorters))throw TypeError(".search.proto.GroupBySort.sorters: array expected");e.sorters=[];for(var r=0;r<t.sorters.length;++r){if(typeof t.sorters[r]!="object")throw TypeError(".search.proto.GroupBySort.sorters: object expected");e.sorters[r]=$root.search.proto.GroupBySorter.fromObject(t.sorters[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.sorters=[]),t.sorters&&t.sorters.length){r.sorters=[];for(var i=0;i<t.sorters.length;++i)r.sorters[i]=$root.search.proto.GroupBySorter.toObject(t.sorters[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByComposite=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.sources=null,n.prototype.size=0,n.prototype.subAggs=null,n.prototype.subGroupBys=null,n.prototype.nextToken="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.sources!=null&&Object.hasOwnProperty.call(t,"sources")&&$root.search.proto.GroupBys.encode(t.sources,e.uint32(10).fork()).ldelim(),t.size!=null&&Object.hasOwnProperty.call(t,"size")&&e.uint32(16).int32(t.size),t.subAggs!=null&&Object.hasOwnProperty.call(t,"subAggs")&&$root.search.proto.Aggregations.encode(t.subAggs,e.uint32(34).fork()).ldelim(),t.subGroupBys!=null&&Object.hasOwnProperty.call(t,"subGroupBys")&&$root.search.proto.GroupBys.encode(t.subGroupBys,e.uint32(42).fork()).ldelim(),t.nextToken!=null&&Object.hasOwnProperty.call(t,"nextToken")&&e.uint32(50).string(t.nextToken),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByComposite;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.sources=$root.search.proto.GroupBys.decode(t,t.uint32());break;case 2:i.size=t.int32();break;case 4:i.subAggs=$root.search.proto.Aggregations.decode(t,t.uint32());break;case 5:i.subGroupBys=$root.search.proto.GroupBys.decode(t,t.uint32());break;case 6:i.nextToken=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.sources!=null&&t.hasOwnProperty("sources")){var e=$root.search.proto.GroupBys.verify(t.sources);if(e)return"sources."+e}if(t.size!=null&&t.hasOwnProperty("size")&&!$util.isInteger(t.size))return"size: integer expected";if(t.subAggs!=null&&t.hasOwnProperty("subAggs")){var e=$root.search.proto.Aggregations.verify(t.subAggs);if(e)return"subAggs."+e}if(t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")){var e=$root.search.proto.GroupBys.verify(t.subGroupBys);if(e)return"subGroupBys."+e}return t.nextToken!=null&&t.hasOwnProperty("nextToken")&&!$util.isString(t.nextToken)?"nextToken: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByComposite)return t;var e=new $root.search.proto.GroupByComposite;if(t.sources!=null){if(typeof t.sources!="object")throw TypeError(".search.proto.GroupByComposite.sources: object expected");e.sources=$root.search.proto.GroupBys.fromObject(t.sources)}if(t.size!=null&&(e.size=t.size|0),t.subAggs!=null){if(typeof t.subAggs!="object")throw TypeError(".search.proto.GroupByComposite.subAggs: object expected");e.subAggs=$root.search.proto.Aggregations.fromObject(t.subAggs)}if(t.subGroupBys!=null){if(typeof t.subGroupBys!="object")throw TypeError(".search.proto.GroupByComposite.subGroupBys: object expected");e.subGroupBys=$root.search.proto.GroupBys.fromObject(t.subGroupBys)}return t.nextToken!=null&&(e.nextToken=String(t.nextToken)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.sources=null,r.size=0,r.subAggs=null,r.subGroupBys=null,r.nextToken=""),t.sources!=null&&t.hasOwnProperty("sources")&&(r.sources=$root.search.proto.GroupBys.toObject(t.sources,e)),t.size!=null&&t.hasOwnProperty("size")&&(r.size=t.size),t.subAggs!=null&&t.hasOwnProperty("subAggs")&&(r.subAggs=$root.search.proto.Aggregations.toObject(t.subAggs,e)),t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")&&(r.subGroupBys=$root.search.proto.GroupBys.toObject(t.subGroupBys,e)),t.nextToken!=null&&t.hasOwnProperty("nextToken")&&(r.nextToken=t.nextToken),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByCompositeResultItem=function(){function n(o){if(this.keys=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.keys=$util.emptyArray,n.prototype.rowCount=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.subAggsResult=null,n.prototype.subGroupBysResult=null,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.keys!=null&&t.keys.length)for(var r=0;r<t.keys.length;++r)e.uint32(10).string(t.keys[r]);return t.rowCount!=null&&Object.hasOwnProperty.call(t,"rowCount")&&e.uint32(16).int64(t.rowCount),t.subAggsResult!=null&&Object.hasOwnProperty.call(t,"subAggsResult")&&$root.search.proto.AggregationsResult.encode(t.subAggsResult,e.uint32(26).fork()).ldelim(),t.subGroupBysResult!=null&&Object.hasOwnProperty.call(t,"subGroupBysResult")&&$root.search.proto.GroupBysResult.encode(t.subGroupBysResult,e.uint32(34).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByCompositeResultItem;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.keys&&i.keys.length||(i.keys=[]),i.keys.push(t.string());break;case 2:i.rowCount=t.int64();break;case 3:i.subAggsResult=$root.search.proto.AggregationsResult.decode(t,t.uint32());break;case 4:i.subGroupBysResult=$root.search.proto.GroupBysResult.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.keys!=null&&t.hasOwnProperty("keys")){if(!Array.isArray(t.keys))return"keys: array expected";for(var e=0;e<t.keys.length;++e)if(!$util.isString(t.keys[e]))return"keys: string[] expected"}if(t.rowCount!=null&&t.hasOwnProperty("rowCount")&&!$util.isInteger(t.rowCount)&&!(t.rowCount&&$util.isInteger(t.rowCount.low)&&$util.isInteger(t.rowCount.high)))return"rowCount: integer|Long expected";if(t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")){var r=$root.search.proto.AggregationsResult.verify(t.subAggsResult);if(r)return"subAggsResult."+r}if(t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")){var r=$root.search.proto.GroupBysResult.verify(t.subGroupBysResult);if(r)return"subGroupBysResult."+r}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByCompositeResultItem)return t;var e=new $root.search.proto.GroupByCompositeResultItem;if(t.keys){if(!Array.isArray(t.keys))throw TypeError(".search.proto.GroupByCompositeResultItem.keys: array expected");e.keys=[];for(var r=0;r<t.keys.length;++r)e.keys[r]=String(t.keys[r])}if(t.rowCount!=null&&($util.Long?(e.rowCount=$util.Long.fromValue(t.rowCount)).unsigned=!1:typeof t.rowCount=="string"?e.rowCount=parseInt(t.rowCount,10):typeof t.rowCount=="number"?e.rowCount=t.rowCount:typeof t.rowCount=="object"&&(e.rowCount=new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber())),t.subAggsResult!=null){if(typeof t.subAggsResult!="object")throw TypeError(".search.proto.GroupByCompositeResultItem.subAggsResult: object expected");e.subAggsResult=$root.search.proto.AggregationsResult.fromObject(t.subAggsResult)}if(t.subGroupBysResult!=null){if(typeof t.subGroupBysResult!="object")throw TypeError(".search.proto.GroupByCompositeResultItem.subGroupBysResult: object expected");e.subGroupBysResult=$root.search.proto.GroupBysResult.fromObject(t.subGroupBysResult)}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.keys=[]),e.defaults){if($util.Long){var i=new $util.Long(0,0,!1);r.rowCount=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.rowCount=e.longs===String?"0":0;r.subAggsResult=null,r.subGroupBysResult=null}if(t.keys&&t.keys.length){r.keys=[];for(var l=0;l<t.keys.length;++l)r.keys[l]=t.keys[l]}return t.rowCount!=null&&t.hasOwnProperty("rowCount")&&(typeof t.rowCount=="number"?r.rowCount=e.longs===String?String(t.rowCount):t.rowCount:r.rowCount=e.longs===String?$util.Long.prototype.toString.call(t.rowCount):e.longs===Number?new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber():t.rowCount),t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")&&(r.subAggsResult=$root.search.proto.AggregationsResult.toObject(t.subAggsResult,e)),t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")&&(r.subGroupBysResult=$root.search.proto.GroupBysResult.toObject(t.subGroupBysResult,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByCompositeResult=function(){function n(o){if(this.groupByCompositeResultItems=[],this.sourceGroupByNames=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.groupByCompositeResultItems=$util.emptyArray,n.prototype.sourceGroupByNames=$util.emptyArray,n.prototype.nextToken="",n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.groupByCompositeResultItems!=null&&t.groupByCompositeResultItems.length)for(var r=0;r<t.groupByCompositeResultItems.length;++r)$root.search.proto.GroupByCompositeResultItem.encode(t.groupByCompositeResultItems[r],e.uint32(10).fork()).ldelim();if(t.sourceGroupByNames!=null&&t.sourceGroupByNames.length)for(var r=0;r<t.sourceGroupByNames.length;++r)e.uint32(18).string(t.sourceGroupByNames[r]);return t.nextToken!=null&&Object.hasOwnProperty.call(t,"nextToken")&&e.uint32(26).string(t.nextToken),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByCompositeResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.groupByCompositeResultItems&&i.groupByCompositeResultItems.length||(i.groupByCompositeResultItems=[]),i.groupByCompositeResultItems.push($root.search.proto.GroupByCompositeResultItem.decode(t,t.uint32()));break;case 2:i.sourceGroupByNames&&i.sourceGroupByNames.length||(i.sourceGroupByNames=[]),i.sourceGroupByNames.push(t.string());break;case 3:i.nextToken=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.groupByCompositeResultItems!=null&&t.hasOwnProperty("groupByCompositeResultItems")){if(!Array.isArray(t.groupByCompositeResultItems))return"groupByCompositeResultItems: array expected";for(var e=0;e<t.groupByCompositeResultItems.length;++e){var r=$root.search.proto.GroupByCompositeResultItem.verify(t.groupByCompositeResultItems[e]);if(r)return"groupByCompositeResultItems."+r}}if(t.sourceGroupByNames!=null&&t.hasOwnProperty("sourceGroupByNames")){if(!Array.isArray(t.sourceGroupByNames))return"sourceGroupByNames: array expected";for(var e=0;e<t.sourceGroupByNames.length;++e)if(!$util.isString(t.sourceGroupByNames[e]))return"sourceGroupByNames: string[] expected"}return t.nextToken!=null&&t.hasOwnProperty("nextToken")&&!$util.isString(t.nextToken)?"nextToken: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByCompositeResult)return t;var e=new $root.search.proto.GroupByCompositeResult;if(t.groupByCompositeResultItems){if(!Array.isArray(t.groupByCompositeResultItems))throw TypeError(".search.proto.GroupByCompositeResult.groupByCompositeResultItems: array expected");e.groupByCompositeResultItems=[];for(var r=0;r<t.groupByCompositeResultItems.length;++r){if(typeof t.groupByCompositeResultItems[r]!="object")throw TypeError(".search.proto.GroupByCompositeResult.groupByCompositeResultItems: object expected");e.groupByCompositeResultItems[r]=$root.search.proto.GroupByCompositeResultItem.fromObject(t.groupByCompositeResultItems[r])}}if(t.sourceGroupByNames){if(!Array.isArray(t.sourceGroupByNames))throw TypeError(".search.proto.GroupByCompositeResult.sourceGroupByNames: array expected");e.sourceGroupByNames=[];for(var r=0;r<t.sourceGroupByNames.length;++r)e.sourceGroupByNames[r]=String(t.sourceGroupByNames[r])}return t.nextToken!=null&&(e.nextToken=String(t.nextToken)),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.groupByCompositeResultItems=[],r.sourceGroupByNames=[]),e.defaults&&(r.nextToken=""),t.groupByCompositeResultItems&&t.groupByCompositeResultItems.length){r.groupByCompositeResultItems=[];for(var i=0;i<t.groupByCompositeResultItems.length;++i)r.groupByCompositeResultItems[i]=$root.search.proto.GroupByCompositeResultItem.toObject(t.groupByCompositeResultItems[i],e)}if(t.sourceGroupByNames&&t.sourceGroupByNames.length){r.sourceGroupByNames=[];for(var i=0;i<t.sourceGroupByNames.length;++i)r.sourceGroupByNames[i]=t.sourceGroupByNames[i]}return t.nextToken!=null&&t.hasOwnProperty("nextToken")&&(r.nextToken=t.nextToken),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByField=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.size=0,n.prototype.sort=null,n.prototype.subAggs=null,n.prototype.subGroupBys=null,n.prototype.minDocCount=$util.Long?$util.Long.fromBits(0,0,!1):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.size!=null&&Object.hasOwnProperty.call(t,"size")&&e.uint32(16).int32(t.size),t.sort!=null&&Object.hasOwnProperty.call(t,"sort")&&$root.search.proto.GroupBySort.encode(t.sort,e.uint32(26).fork()).ldelim(),t.subAggs!=null&&Object.hasOwnProperty.call(t,"subAggs")&&$root.search.proto.Aggregations.encode(t.subAggs,e.uint32(34).fork()).ldelim(),t.subGroupBys!=null&&Object.hasOwnProperty.call(t,"subGroupBys")&&$root.search.proto.GroupBys.encode(t.subGroupBys,e.uint32(42).fork()).ldelim(),t.minDocCount!=null&&Object.hasOwnProperty.call(t,"minDocCount")&&e.uint32(48).int64(t.minDocCount),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByField;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.size=t.int32();break;case 3:i.sort=$root.search.proto.GroupBySort.decode(t,t.uint32());break;case 4:i.subAggs=$root.search.proto.Aggregations.decode(t,t.uint32());break;case 5:i.subGroupBys=$root.search.proto.GroupBys.decode(t,t.uint32());break;case 6:i.minDocCount=t.int64();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.size!=null&&t.hasOwnProperty("size")&&!$util.isInteger(t.size))return"size: integer expected";if(t.sort!=null&&t.hasOwnProperty("sort")){var e=$root.search.proto.GroupBySort.verify(t.sort);if(e)return"sort."+e}if(t.subAggs!=null&&t.hasOwnProperty("subAggs")){var e=$root.search.proto.Aggregations.verify(t.subAggs);if(e)return"subAggs."+e}if(t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")){var e=$root.search.proto.GroupBys.verify(t.subGroupBys);if(e)return"subGroupBys."+e}return t.minDocCount!=null&&t.hasOwnProperty("minDocCount")&&!$util.isInteger(t.minDocCount)&&!(t.minDocCount&&$util.isInteger(t.minDocCount.low)&&$util.isInteger(t.minDocCount.high))?"minDocCount: integer|Long expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByField)return t;var e=new $root.search.proto.GroupByField;if(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.size!=null&&(e.size=t.size|0),t.sort!=null){if(typeof t.sort!="object")throw TypeError(".search.proto.GroupByField.sort: object expected");e.sort=$root.search.proto.GroupBySort.fromObject(t.sort)}if(t.subAggs!=null){if(typeof t.subAggs!="object")throw TypeError(".search.proto.GroupByField.subAggs: object expected");e.subAggs=$root.search.proto.Aggregations.fromObject(t.subAggs)}if(t.subGroupBys!=null){if(typeof t.subGroupBys!="object")throw TypeError(".search.proto.GroupByField.subGroupBys: object expected");e.subGroupBys=$root.search.proto.GroupBys.fromObject(t.subGroupBys)}return t.minDocCount!=null&&($util.Long?(e.minDocCount=$util.Long.fromValue(t.minDocCount)).unsigned=!1:typeof t.minDocCount=="string"?e.minDocCount=parseInt(t.minDocCount,10):typeof t.minDocCount=="number"?e.minDocCount=t.minDocCount:typeof t.minDocCount=="object"&&(e.minDocCount=new $util.LongBits(t.minDocCount.low>>>0,t.minDocCount.high>>>0).toNumber())),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults)if(r.fieldName="",r.size=0,r.sort=null,r.subAggs=null,r.subGroupBys=null,$util.Long){var i=new $util.Long(0,0,!1);r.minDocCount=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.minDocCount=e.longs===String?"0":0;return t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.size!=null&&t.hasOwnProperty("size")&&(r.size=t.size),t.sort!=null&&t.hasOwnProperty("sort")&&(r.sort=$root.search.proto.GroupBySort.toObject(t.sort,e)),t.subAggs!=null&&t.hasOwnProperty("subAggs")&&(r.subAggs=$root.search.proto.Aggregations.toObject(t.subAggs,e)),t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")&&(r.subGroupBys=$root.search.proto.GroupBys.toObject(t.subGroupBys,e)),t.minDocCount!=null&&t.hasOwnProperty("minDocCount")&&(typeof t.minDocCount=="number"?r.minDocCount=e.longs===String?String(t.minDocCount):t.minDocCount:r.minDocCount=e.longs===String?$util.Long.prototype.toString.call(t.minDocCount):e.longs===Number?new $util.LongBits(t.minDocCount.low>>>0,t.minDocCount.high>>>0).toNumber():t.minDocCount),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.Range=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.from=0,n.prototype.to=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.from!=null&&Object.hasOwnProperty.call(t,"from")&&e.uint32(9).double(t.from),t.to!=null&&Object.hasOwnProperty.call(t,"to")&&e.uint32(17).double(t.to),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.Range;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.from=t.double();break;case 2:i.to=t.double();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.from!=null&&t.hasOwnProperty("from")&&typeof t.from!="number"?"from: number expected":t.to!=null&&t.hasOwnProperty("to")&&typeof t.to!="number"?"to: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.Range)return t;var e=new $root.search.proto.Range;return t.from!=null&&(e.from=Number(t.from)),t.to!=null&&(e.to=Number(t.to)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.from=0,r.to=0),t.from!=null&&t.hasOwnProperty("from")&&(r.from=e.json&&!isFinite(t.from)?String(t.from):t.from),t.to!=null&&t.hasOwnProperty("to")&&(r.to=e.json&&!isFinite(t.to)?String(t.to):t.to),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByRange=function(){function n(o){if(this.ranges=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.ranges=$util.emptyArray,n.prototype.subAggs=null,n.prototype.subGroupBys=null,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.ranges!=null&&t.ranges.length)for(var r=0;r<t.ranges.length;++r)$root.search.proto.Range.encode(t.ranges[r],e.uint32(18).fork()).ldelim();return t.subAggs!=null&&Object.hasOwnProperty.call(t,"subAggs")&&$root.search.proto.Aggregations.encode(t.subAggs,e.uint32(26).fork()).ldelim(),t.subGroupBys!=null&&Object.hasOwnProperty.call(t,"subGroupBys")&&$root.search.proto.GroupBys.encode(t.subGroupBys,e.uint32(34).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByRange;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.ranges&&i.ranges.length||(i.ranges=[]),i.ranges.push($root.search.proto.Range.decode(t,t.uint32()));break;case 3:i.subAggs=$root.search.proto.Aggregations.decode(t,t.uint32());break;case 4:i.subGroupBys=$root.search.proto.GroupBys.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.ranges!=null&&t.hasOwnProperty("ranges")){if(!Array.isArray(t.ranges))return"ranges: array expected";for(var e=0;e<t.ranges.length;++e){var r=$root.search.proto.Range.verify(t.ranges[e]);if(r)return"ranges."+r}}if(t.subAggs!=null&&t.hasOwnProperty("subAggs")){var r=$root.search.proto.Aggregations.verify(t.subAggs);if(r)return"subAggs."+r}if(t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")){var r=$root.search.proto.GroupBys.verify(t.subGroupBys);if(r)return"subGroupBys."+r}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByRange)return t;var e=new $root.search.proto.GroupByRange;if(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.ranges){if(!Array.isArray(t.ranges))throw TypeError(".search.proto.GroupByRange.ranges: array expected");e.ranges=[];for(var r=0;r<t.ranges.length;++r){if(typeof t.ranges[r]!="object")throw TypeError(".search.proto.GroupByRange.ranges: object expected");e.ranges[r]=$root.search.proto.Range.fromObject(t.ranges[r])}}if(t.subAggs!=null){if(typeof t.subAggs!="object")throw TypeError(".search.proto.GroupByRange.subAggs: object expected");e.subAggs=$root.search.proto.Aggregations.fromObject(t.subAggs)}if(t.subGroupBys!=null){if(typeof t.subGroupBys!="object")throw TypeError(".search.proto.GroupByRange.subGroupBys: object expected");e.subGroupBys=$root.search.proto.GroupBys.fromObject(t.subGroupBys)}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.ranges=[]),e.defaults&&(r.fieldName="",r.subAggs=null,r.subGroupBys=null),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.ranges&&t.ranges.length){r.ranges=[];for(var i=0;i<t.ranges.length;++i)r.ranges[i]=$root.search.proto.Range.toObject(t.ranges[i],e)}return t.subAggs!=null&&t.hasOwnProperty("subAggs")&&(r.subAggs=$root.search.proto.Aggregations.toObject(t.subAggs,e)),t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")&&(r.subGroupBys=$root.search.proto.GroupBys.toObject(t.subGroupBys,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByFilter=function(){function n(o){if(this.filters=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.filters=$util.emptyArray,n.prototype.subAggs=null,n.prototype.subGroupBys=null,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.filters!=null&&t.filters.length)for(var r=0;r<t.filters.length;++r)$root.search.proto.Query.encode(t.filters[r],e.uint32(10).fork()).ldelim();return t.subAggs!=null&&Object.hasOwnProperty.call(t,"subAggs")&&$root.search.proto.Aggregations.encode(t.subAggs,e.uint32(18).fork()).ldelim(),t.subGroupBys!=null&&Object.hasOwnProperty.call(t,"subGroupBys")&&$root.search.proto.GroupBys.encode(t.subGroupBys,e.uint32(26).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByFilter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.filters&&i.filters.length||(i.filters=[]),i.filters.push($root.search.proto.Query.decode(t,t.uint32()));break;case 2:i.subAggs=$root.search.proto.Aggregations.decode(t,t.uint32());break;case 3:i.subGroupBys=$root.search.proto.GroupBys.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.filters!=null&&t.hasOwnProperty("filters")){if(!Array.isArray(t.filters))return"filters: array expected";for(var e=0;e<t.filters.length;++e){var r=$root.search.proto.Query.verify(t.filters[e]);if(r)return"filters."+r}}if(t.subAggs!=null&&t.hasOwnProperty("subAggs")){var r=$root.search.proto.Aggregations.verify(t.subAggs);if(r)return"subAggs."+r}if(t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")){var r=$root.search.proto.GroupBys.verify(t.subGroupBys);if(r)return"subGroupBys."+r}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByFilter)return t;var e=new $root.search.proto.GroupByFilter;if(t.filters){if(!Array.isArray(t.filters))throw TypeError(".search.proto.GroupByFilter.filters: array expected");e.filters=[];for(var r=0;r<t.filters.length;++r){if(typeof t.filters[r]!="object")throw TypeError(".search.proto.GroupByFilter.filters: object expected");e.filters[r]=$root.search.proto.Query.fromObject(t.filters[r])}}if(t.subAggs!=null){if(typeof t.subAggs!="object")throw TypeError(".search.proto.GroupByFilter.subAggs: object expected");e.subAggs=$root.search.proto.Aggregations.fromObject(t.subAggs)}if(t.subGroupBys!=null){if(typeof t.subGroupBys!="object")throw TypeError(".search.proto.GroupByFilter.subGroupBys: object expected");e.subGroupBys=$root.search.proto.GroupBys.fromObject(t.subGroupBys)}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.filters=[]),e.defaults&&(r.subAggs=null,r.subGroupBys=null),t.filters&&t.filters.length){r.filters=[];for(var i=0;i<t.filters.length;++i)r.filters[i]=$root.search.proto.Query.toObject(t.filters[i],e)}return t.subAggs!=null&&t.hasOwnProperty("subAggs")&&(r.subAggs=$root.search.proto.Aggregations.toObject(t.subAggs,e)),t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")&&(r.subGroupBys=$root.search.proto.GroupBys.toObject(t.subGroupBys,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GeoPoint=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.lat=0,n.prototype.lon=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.lat!=null&&Object.hasOwnProperty.call(t,"lat")&&e.uint32(9).double(t.lat),t.lon!=null&&Object.hasOwnProperty.call(t,"lon")&&e.uint32(17).double(t.lon),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GeoPoint;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.lat=t.double();break;case 2:i.lon=t.double();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.lat!=null&&t.hasOwnProperty("lat")&&typeof t.lat!="number"?"lat: number expected":t.lon!=null&&t.hasOwnProperty("lon")&&typeof t.lon!="number"?"lon: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.GeoPoint)return t;var e=new $root.search.proto.GeoPoint;return t.lat!=null&&(e.lat=Number(t.lat)),t.lon!=null&&(e.lon=Number(t.lon)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.lat=0,r.lon=0),t.lat!=null&&t.hasOwnProperty("lat")&&(r.lat=e.json&&!isFinite(t.lat)?String(t.lat):t.lat),t.lon!=null&&t.hasOwnProperty("lon")&&(r.lon=e.json&&!isFinite(t.lon)?String(t.lon):t.lon),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByGeoDistance=function(){function n(o){if(this.ranges=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.origin=null,n.prototype.ranges=$util.emptyArray,n.prototype.subAggs=null,n.prototype.subGroupBys=null,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.origin!=null&&Object.hasOwnProperty.call(t,"origin")&&$root.search.proto.GeoPoint.encode(t.origin,e.uint32(18).fork()).ldelim(),t.ranges!=null&&t.ranges.length)for(var r=0;r<t.ranges.length;++r)$root.search.proto.Range.encode(t.ranges[r],e.uint32(26).fork()).ldelim();return t.subAggs!=null&&Object.hasOwnProperty.call(t,"subAggs")&&$root.search.proto.Aggregations.encode(t.subAggs,e.uint32(34).fork()).ldelim(),t.subGroupBys!=null&&Object.hasOwnProperty.call(t,"subGroupBys")&&$root.search.proto.GroupBys.encode(t.subGroupBys,e.uint32(42).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByGeoDistance;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.origin=$root.search.proto.GeoPoint.decode(t,t.uint32());break;case 3:i.ranges&&i.ranges.length||(i.ranges=[]),i.ranges.push($root.search.proto.Range.decode(t,t.uint32()));break;case 4:i.subAggs=$root.search.proto.Aggregations.decode(t,t.uint32());break;case 5:i.subGroupBys=$root.search.proto.GroupBys.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.origin!=null&&t.hasOwnProperty("origin")){var e=$root.search.proto.GeoPoint.verify(t.origin);if(e)return"origin."+e}if(t.ranges!=null&&t.hasOwnProperty("ranges")){if(!Array.isArray(t.ranges))return"ranges: array expected";for(var r=0;r<t.ranges.length;++r){var e=$root.search.proto.Range.verify(t.ranges[r]);if(e)return"ranges."+e}}if(t.subAggs!=null&&t.hasOwnProperty("subAggs")){var e=$root.search.proto.Aggregations.verify(t.subAggs);if(e)return"subAggs."+e}if(t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")){var e=$root.search.proto.GroupBys.verify(t.subGroupBys);if(e)return"subGroupBys."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByGeoDistance)return t;var e=new $root.search.proto.GroupByGeoDistance;if(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.origin!=null){if(typeof t.origin!="object")throw TypeError(".search.proto.GroupByGeoDistance.origin: object expected");e.origin=$root.search.proto.GeoPoint.fromObject(t.origin)}if(t.ranges){if(!Array.isArray(t.ranges))throw TypeError(".search.proto.GroupByGeoDistance.ranges: array expected");e.ranges=[];for(var r=0;r<t.ranges.length;++r){if(typeof t.ranges[r]!="object")throw TypeError(".search.proto.GroupByGeoDistance.ranges: object expected");e.ranges[r]=$root.search.proto.Range.fromObject(t.ranges[r])}}if(t.subAggs!=null){if(typeof t.subAggs!="object")throw TypeError(".search.proto.GroupByGeoDistance.subAggs: object expected");e.subAggs=$root.search.proto.Aggregations.fromObject(t.subAggs)}if(t.subGroupBys!=null){if(typeof t.subGroupBys!="object")throw TypeError(".search.proto.GroupByGeoDistance.subGroupBys: object expected");e.subGroupBys=$root.search.proto.GroupBys.fromObject(t.subGroupBys)}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.ranges=[]),e.defaults&&(r.fieldName="",r.origin=null,r.subAggs=null,r.subGroupBys=null),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.origin!=null&&t.hasOwnProperty("origin")&&(r.origin=$root.search.proto.GeoPoint.toObject(t.origin,e)),t.ranges&&t.ranges.length){r.ranges=[];for(var i=0;i<t.ranges.length;++i)r.ranges[i]=$root.search.proto.Range.toObject(t.ranges[i],e)}return t.subAggs!=null&&t.hasOwnProperty("subAggs")&&(r.subAggs=$root.search.proto.Aggregations.toObject(t.subAggs,e)),t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")&&(r.subGroupBys=$root.search.proto.GroupBys.toObject(t.subGroupBys,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByGeoGrid=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.precision=1,n.prototype.size=0,n.prototype.subAggs=null,n.prototype.subGroupBys=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.precision!=null&&Object.hasOwnProperty.call(t,"precision")&&e.uint32(16).int32(t.precision),t.size!=null&&Object.hasOwnProperty.call(t,"size")&&e.uint32(24).int32(t.size),t.subAggs!=null&&Object.hasOwnProperty.call(t,"subAggs")&&$root.search.proto.Aggregations.encode(t.subAggs,e.uint32(34).fork()).ldelim(),t.subGroupBys!=null&&Object.hasOwnProperty.call(t,"subGroupBys")&&$root.search.proto.GroupBys.encode(t.subGroupBys,e.uint32(42).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByGeoGrid;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.precision=t.int32();break;case 3:i.size=t.int32();break;case 4:i.subAggs=$root.search.proto.Aggregations.decode(t,t.uint32());break;case 5:i.subGroupBys=$root.search.proto.GroupBys.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.precision!=null&&t.hasOwnProperty("precision"))switch(t.precision){default:return"precision: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break}if(t.size!=null&&t.hasOwnProperty("size")&&!$util.isInteger(t.size))return"size: integer expected";if(t.subAggs!=null&&t.hasOwnProperty("subAggs")){var e=$root.search.proto.Aggregations.verify(t.subAggs);if(e)return"subAggs."+e}if(t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")){var e=$root.search.proto.GroupBys.verify(t.subGroupBys);if(e)return"subGroupBys."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByGeoGrid)return t;var e=new $root.search.proto.GroupByGeoGrid;switch(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.precision){case"GHP_5009KM_4992KM_1":case 1:e.precision=1;break;case"GHP_1252KM_624KM_2":case 2:e.precision=2;break;case"GHP_156KM_156KM_3":case 3:e.precision=3;break;case"GHP_39KM_19KM_4":case 4:e.precision=4;break;case"GHP_4900M_4900M_5":case 5:e.precision=5;break;case"GHP_1200M_609M_6":case 6:e.precision=6;break;case"GHP_152M_152M_7":case 7:e.precision=7;break;case"GHP_38M_19M_8":case 8:e.precision=8;break;case"GHP_480CM_480CM_9":case 9:e.precision=9;break;case"GHP_120CM_595MM_10":case 10:e.precision=10;break;case"GHP_149MM_149MM_11":case 11:e.precision=11;break;case"GHP_37MM_19MM_12":case 12:e.precision=12;break}if(t.size!=null&&(e.size=t.size|0),t.subAggs!=null){if(typeof t.subAggs!="object")throw TypeError(".search.proto.GroupByGeoGrid.subAggs: object expected");e.subAggs=$root.search.proto.Aggregations.fromObject(t.subAggs)}if(t.subGroupBys!=null){if(typeof t.subGroupBys!="object")throw TypeError(".search.proto.GroupByGeoGrid.subGroupBys: object expected");e.subGroupBys=$root.search.proto.GroupBys.fromObject(t.subGroupBys)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",r.precision=e.enums===String?"GHP_5009KM_4992KM_1":1,r.size=0,r.subAggs=null,r.subGroupBys=null),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.precision!=null&&t.hasOwnProperty("precision")&&(r.precision=e.enums===String?$root.search.proto.GeoHashPrecision[t.precision]:t.precision),t.size!=null&&t.hasOwnProperty("size")&&(r.size=t.size),t.subAggs!=null&&t.hasOwnProperty("subAggs")&&(r.subAggs=$root.search.proto.Aggregations.toObject(t.subAggs,e)),t.subGroupBys!=null&&t.hasOwnProperty("subGroupBys")&&(r.subGroupBys=$root.search.proto.GroupBys.toObject(t.subGroupBys,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GeoHashPrecision=function(){var n={},o=Object.create(n);return o[n[1]="GHP_5009KM_4992KM_1"]=1,o[n[2]="GHP_1252KM_624KM_2"]=2,o[n[3]="GHP_156KM_156KM_3"]=3,o[n[4]="GHP_39KM_19KM_4"]=4,o[n[5]="GHP_4900M_4900M_5"]=5,o[n[6]="GHP_1200M_609M_6"]=6,o[n[7]="GHP_152M_152M_7"]=7,o[n[8]="GHP_38M_19M_8"]=8,o[n[9]="GHP_480CM_480CM_9"]=9,o[n[10]="GHP_120CM_595MM_10"]=10,o[n[11]="GHP_149MM_149MM_11"]=11,o[n[12]="GHP_37MM_19MM_12"]=12,o}(),c.GeoGrid=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.topLeft=null,n.prototype.bottomRight=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.topLeft!=null&&Object.hasOwnProperty.call(t,"topLeft")&&$root.search.proto.GeoPoint.encode(t.topLeft,e.uint32(10).fork()).ldelim(),t.bottomRight!=null&&Object.hasOwnProperty.call(t,"bottomRight")&&$root.search.proto.GeoPoint.encode(t.bottomRight,e.uint32(18).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GeoGrid;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.topLeft=$root.search.proto.GeoPoint.decode(t,t.uint32());break;case 2:i.bottomRight=$root.search.proto.GeoPoint.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.topLeft!=null&&t.hasOwnProperty("topLeft")){var e=$root.search.proto.GeoPoint.verify(t.topLeft);if(e)return"topLeft."+e}if(t.bottomRight!=null&&t.hasOwnProperty("bottomRight")){var e=$root.search.proto.GeoPoint.verify(t.bottomRight);if(e)return"bottomRight."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GeoGrid)return t;var e=new $root.search.proto.GeoGrid;if(t.topLeft!=null){if(typeof t.topLeft!="object")throw TypeError(".search.proto.GeoGrid.topLeft: object expected");e.topLeft=$root.search.proto.GeoPoint.fromObject(t.topLeft)}if(t.bottomRight!=null){if(typeof t.bottomRight!="object")throw TypeError(".search.proto.GeoGrid.bottomRight: object expected");e.bottomRight=$root.search.proto.GeoPoint.fromObject(t.bottomRight)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.topLeft=null,r.bottomRight=null),t.topLeft!=null&&t.hasOwnProperty("topLeft")&&(r.topLeft=$root.search.proto.GeoPoint.toObject(t.topLeft,e)),t.bottomRight!=null&&t.hasOwnProperty("bottomRight")&&(r.bottomRight=$root.search.proto.GeoPoint.toObject(t.bottomRight,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.AvgAggregationResult=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.value=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&e.uint32(9).double(t.value),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.AvgAggregationResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.value=t.double();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.value!=null&&t.hasOwnProperty("value")&&typeof t.value!="number"?"value: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.AvgAggregationResult)return t;var e=new $root.search.proto.AvgAggregationResult;return t.value!=null&&(e.value=Number(t.value)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.value=0),t.value!=null&&t.hasOwnProperty("value")&&(r.value=e.json&&!isFinite(t.value)?String(t.value):t.value),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TopRowsAggregationResult=function(){function n(o){if(this.rows=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.rows=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.rows!=null&&t.rows.length)for(var r=0;r<t.rows.length;++r)e.uint32(10).bytes(t.rows[r]);return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.TopRowsAggregationResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.rows&&i.rows.length||(i.rows=[]),i.rows.push(t.bytes());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.rows!=null&&t.hasOwnProperty("rows")){if(!Array.isArray(t.rows))return"rows: array expected";for(var e=0;e<t.rows.length;++e)if(!(t.rows[e]&&typeof t.rows[e].length=="number"||$util.isString(t.rows[e])))return"rows: buffer[] expected"}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.TopRowsAggregationResult)return t;var e=new $root.search.proto.TopRowsAggregationResult;if(t.rows){if(!Array.isArray(t.rows))throw TypeError(".search.proto.TopRowsAggregationResult.rows: array expected");e.rows=[];for(var r=0;r<t.rows.length;++r)typeof t.rows[r]=="string"?$util.base64.decode(t.rows[r],e.rows[r]=$util.newBuffer($util.base64.length(t.rows[r])),0):t.rows[r].length&&(e.rows[r]=t.rows[r])}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.rows=[]),t.rows&&t.rows.length){r.rows=[];for(var i=0;i<t.rows.length;++i)r.rows[i]=e.bytes===String?$util.base64.encode(t.rows[i],0,t.rows[i].length):e.bytes===Array?Array.prototype.slice.call(t.rows[i]):t.rows[i]}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.PercentilesAggregationItem=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.key=0,n.prototype.value=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.key!=null&&Object.hasOwnProperty.call(t,"key")&&e.uint32(9).double(t.key),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&e.uint32(18).bytes(t.value),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.PercentilesAggregationItem;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.key=t.double();break;case 2:i.value=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.key!=null&&t.hasOwnProperty("key")&&typeof t.key!="number"?"key: number expected":t.value!=null&&t.hasOwnProperty("value")&&!(t.value&&typeof t.value.length=="number"||$util.isString(t.value))?"value: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.PercentilesAggregationItem)return t;var e=new $root.search.proto.PercentilesAggregationItem;return t.key!=null&&(e.key=Number(t.key)),t.value!=null&&(typeof t.value=="string"?$util.base64.decode(t.value,e.value=$util.newBuffer($util.base64.length(t.value)),0):t.value.length&&(e.value=t.value)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.key=0,e.bytes===String?r.value="":(r.value=[],e.bytes!==Array&&(r.value=$util.newBuffer(r.value)))),t.key!=null&&t.hasOwnProperty("key")&&(r.key=e.json&&!isFinite(t.key)?String(t.key):t.key),t.value!=null&&t.hasOwnProperty("value")&&(r.value=e.bytes===String?$util.base64.encode(t.value,0,t.value.length):e.bytes===Array?Array.prototype.slice.call(t.value):t.value),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.PercentilesAggregationResult=function(){function n(o){if(this.percentilesAggregationItems=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.percentilesAggregationItems=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.percentilesAggregationItems!=null&&t.percentilesAggregationItems.length)for(var r=0;r<t.percentilesAggregationItems.length;++r)$root.search.proto.PercentilesAggregationItem.encode(t.percentilesAggregationItems[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.PercentilesAggregationResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.percentilesAggregationItems&&i.percentilesAggregationItems.length||(i.percentilesAggregationItems=[]),i.percentilesAggregationItems.push($root.search.proto.PercentilesAggregationItem.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.percentilesAggregationItems!=null&&t.hasOwnProperty("percentilesAggregationItems")){if(!Array.isArray(t.percentilesAggregationItems))return"percentilesAggregationItems: array expected";for(var e=0;e<t.percentilesAggregationItems.length;++e){var r=$root.search.proto.PercentilesAggregationItem.verify(t.percentilesAggregationItems[e]);if(r)return"percentilesAggregationItems."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.PercentilesAggregationResult)return t;var e=new $root.search.proto.PercentilesAggregationResult;if(t.percentilesAggregationItems){if(!Array.isArray(t.percentilesAggregationItems))throw TypeError(".search.proto.PercentilesAggregationResult.percentilesAggregationItems: array expected");e.percentilesAggregationItems=[];for(var r=0;r<t.percentilesAggregationItems.length;++r){if(typeof t.percentilesAggregationItems[r]!="object")throw TypeError(".search.proto.PercentilesAggregationResult.percentilesAggregationItems: object expected");e.percentilesAggregationItems[r]=$root.search.proto.PercentilesAggregationItem.fromObject(t.percentilesAggregationItems[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.percentilesAggregationItems=[]),t.percentilesAggregationItems&&t.percentilesAggregationItems.length){r.percentilesAggregationItems=[];for(var i=0;i<t.percentilesAggregationItems.length;++i)r.percentilesAggregationItems[i]=$root.search.proto.PercentilesAggregationItem.toObject(t.percentilesAggregationItems[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DistinctCountAggregationResult=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.value=$util.Long?$util.Long.fromBits(0,0,!1):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&e.uint32(8).int64(t.value),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DistinctCountAggregationResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.value=t.int64();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.value!=null&&t.hasOwnProperty("value")&&!$util.isInteger(t.value)&&!(t.value&&$util.isInteger(t.value.low)&&$util.isInteger(t.value.high))?"value: integer|Long expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.DistinctCountAggregationResult)return t;var e=new $root.search.proto.DistinctCountAggregationResult;return t.value!=null&&($util.Long?(e.value=$util.Long.fromValue(t.value)).unsigned=!1:typeof t.value=="string"?e.value=parseInt(t.value,10):typeof t.value=="number"?e.value=t.value:typeof t.value=="object"&&(e.value=new $util.LongBits(t.value.low>>>0,t.value.high>>>0).toNumber())),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults)if($util.Long){var i=new $util.Long(0,0,!1);r.value=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.value=e.longs===String?"0":0;return t.value!=null&&t.hasOwnProperty("value")&&(typeof t.value=="number"?r.value=e.longs===String?String(t.value):t.value:r.value=e.longs===String?$util.Long.prototype.toString.call(t.value):e.longs===Number?new $util.LongBits(t.value.low>>>0,t.value.high>>>0).toNumber():t.value),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.MaxAggregationResult=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.value=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&e.uint32(9).double(t.value),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.MaxAggregationResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.value=t.double();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.value!=null&&t.hasOwnProperty("value")&&typeof t.value!="number"?"value: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.MaxAggregationResult)return t;var e=new $root.search.proto.MaxAggregationResult;return t.value!=null&&(e.value=Number(t.value)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.value=0),t.value!=null&&t.hasOwnProperty("value")&&(r.value=e.json&&!isFinite(t.value)?String(t.value):t.value),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.MinAggregationResult=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.value=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&e.uint32(9).double(t.value),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.MinAggregationResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.value=t.double();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.value!=null&&t.hasOwnProperty("value")&&typeof t.value!="number"?"value: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.MinAggregationResult)return t;var e=new $root.search.proto.MinAggregationResult;return t.value!=null&&(e.value=Number(t.value)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.value=0),t.value!=null&&t.hasOwnProperty("value")&&(r.value=e.json&&!isFinite(t.value)?String(t.value):t.value),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SumAggregationResult=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.value=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&e.uint32(9).double(t.value),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SumAggregationResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.value=t.double();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.value!=null&&t.hasOwnProperty("value")&&typeof t.value!="number"?"value: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.SumAggregationResult)return t;var e=new $root.search.proto.SumAggregationResult;return t.value!=null&&(e.value=Number(t.value)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.value=0),t.value!=null&&t.hasOwnProperty("value")&&(r.value=e.json&&!isFinite(t.value)?String(t.value):t.value),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.CountAggregationResult=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.value=$util.Long?$util.Long.fromBits(0,0,!1):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&e.uint32(8).int64(t.value),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.CountAggregationResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.value=t.int64();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.value!=null&&t.hasOwnProperty("value")&&!$util.isInteger(t.value)&&!(t.value&&$util.isInteger(t.value.low)&&$util.isInteger(t.value.high))?"value: integer|Long expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.CountAggregationResult)return t;var e=new $root.search.proto.CountAggregationResult;return t.value!=null&&($util.Long?(e.value=$util.Long.fromValue(t.value)).unsigned=!1:typeof t.value=="string"?e.value=parseInt(t.value,10):typeof t.value=="number"?e.value=t.value:typeof t.value=="object"&&(e.value=new $util.LongBits(t.value.low>>>0,t.value.high>>>0).toNumber())),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults)if($util.Long){var i=new $util.Long(0,0,!1);r.value=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.value=e.longs===String?"0":0;return t.value!=null&&t.hasOwnProperty("value")&&(typeof t.value=="number"?r.value=e.longs===String?String(t.value):t.value:r.value=e.longs===String?$util.Long.prototype.toString.call(t.value):e.longs===Number?new $util.LongBits(t.value.low>>>0,t.value.high>>>0).toNumber():t.value),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.AggregationResult=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.name="",n.prototype.type=1,n.prototype.aggResult=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.name!=null&&Object.hasOwnProperty.call(t,"name")&&e.uint32(10).string(t.name),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&e.uint32(16).int32(t.type),t.aggResult!=null&&Object.hasOwnProperty.call(t,"aggResult")&&e.uint32(26).bytes(t.aggResult),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.AggregationResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.name=t.string();break;case 2:i.type=t.int32();break;case 3:i.aggResult=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.name!=null&&t.hasOwnProperty("name")&&!$util.isString(t.name))return"name: string expected";if(t.type!=null&&t.hasOwnProperty("type"))switch(t.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:break}return t.aggResult!=null&&t.hasOwnProperty("aggResult")&&!(t.aggResult&&typeof t.aggResult.length=="number"||$util.isString(t.aggResult))?"aggResult: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.AggregationResult)return t;var e=new $root.search.proto.AggregationResult;switch(t.name!=null&&(e.name=String(t.name)),t.type){case"AGG_AVG":case 1:e.type=1;break;case"AGG_MAX":case 2:e.type=2;break;case"AGG_MIN":case 3:e.type=3;break;case"AGG_SUM":case 4:e.type=4;break;case"AGG_COUNT":case 5:e.type=5;break;case"AGG_DISTINCT_COUNT":case 6:e.type=6;break;case"AGG_TOP_ROWS":case 7:e.type=7;break;case"AGG_PERCENTILES":case 8:e.type=8;break}return t.aggResult!=null&&(typeof t.aggResult=="string"?$util.base64.decode(t.aggResult,e.aggResult=$util.newBuffer($util.base64.length(t.aggResult)),0):t.aggResult.length&&(e.aggResult=t.aggResult)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.name="",r.type=e.enums===String?"AGG_AVG":1,e.bytes===String?r.aggResult="":(r.aggResult=[],e.bytes!==Array&&(r.aggResult=$util.newBuffer(r.aggResult)))),t.name!=null&&t.hasOwnProperty("name")&&(r.name=t.name),t.type!=null&&t.hasOwnProperty("type")&&(r.type=e.enums===String?$root.search.proto.AggregationType[t.type]:t.type),t.aggResult!=null&&t.hasOwnProperty("aggResult")&&(r.aggResult=e.bytes===String?$util.base64.encode(t.aggResult,0,t.aggResult.length):e.bytes===Array?Array.prototype.slice.call(t.aggResult):t.aggResult),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.AggregationsResult=function(){function n(o){if(this.aggResults=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.aggResults=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.aggResults!=null&&t.aggResults.length)for(var r=0;r<t.aggResults.length;++r)$root.search.proto.AggregationResult.encode(t.aggResults[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.AggregationsResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.aggResults&&i.aggResults.length||(i.aggResults=[]),i.aggResults.push($root.search.proto.AggregationResult.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.aggResults!=null&&t.hasOwnProperty("aggResults")){if(!Array.isArray(t.aggResults))return"aggResults: array expected";for(var e=0;e<t.aggResults.length;++e){var r=$root.search.proto.AggregationResult.verify(t.aggResults[e]);if(r)return"aggResults."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.AggregationsResult)return t;var e=new $root.search.proto.AggregationsResult;if(t.aggResults){if(!Array.isArray(t.aggResults))throw TypeError(".search.proto.AggregationsResult.aggResults: array expected");e.aggResults=[];for(var r=0;r<t.aggResults.length;++r){if(typeof t.aggResults[r]!="object")throw TypeError(".search.proto.AggregationsResult.aggResults: object expected");e.aggResults[r]=$root.search.proto.AggregationResult.fromObject(t.aggResults[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.aggResults=[]),t.aggResults&&t.aggResults.length){r.aggResults=[];for(var i=0;i<t.aggResults.length;++i)r.aggResults[i]=$root.search.proto.AggregationResult.toObject(t.aggResults[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByFieldResultItem=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.key="",n.prototype.rowCount=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.subAggsResult=null,n.prototype.subGroupBysResult=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.key!=null&&Object.hasOwnProperty.call(t,"key")&&e.uint32(10).string(t.key),t.rowCount!=null&&Object.hasOwnProperty.call(t,"rowCount")&&e.uint32(16).int64(t.rowCount),t.subAggsResult!=null&&Object.hasOwnProperty.call(t,"subAggsResult")&&$root.search.proto.AggregationsResult.encode(t.subAggsResult,e.uint32(26).fork()).ldelim(),t.subGroupBysResult!=null&&Object.hasOwnProperty.call(t,"subGroupBysResult")&&$root.search.proto.GroupBysResult.encode(t.subGroupBysResult,e.uint32(34).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByFieldResultItem;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.key=t.string();break;case 2:i.rowCount=t.int64();break;case 3:i.subAggsResult=$root.search.proto.AggregationsResult.decode(t,t.uint32());break;case 4:i.subGroupBysResult=$root.search.proto.GroupBysResult.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.key!=null&&t.hasOwnProperty("key")&&!$util.isString(t.key))return"key: string expected";if(t.rowCount!=null&&t.hasOwnProperty("rowCount")&&!$util.isInteger(t.rowCount)&&!(t.rowCount&&$util.isInteger(t.rowCount.low)&&$util.isInteger(t.rowCount.high)))return"rowCount: integer|Long expected";if(t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")){var e=$root.search.proto.AggregationsResult.verify(t.subAggsResult);if(e)return"subAggsResult."+e}if(t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")){var e=$root.search.proto.GroupBysResult.verify(t.subGroupBysResult);if(e)return"subGroupBysResult."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByFieldResultItem)return t;var e=new $root.search.proto.GroupByFieldResultItem;if(t.key!=null&&(e.key=String(t.key)),t.rowCount!=null&&($util.Long?(e.rowCount=$util.Long.fromValue(t.rowCount)).unsigned=!1:typeof t.rowCount=="string"?e.rowCount=parseInt(t.rowCount,10):typeof t.rowCount=="number"?e.rowCount=t.rowCount:typeof t.rowCount=="object"&&(e.rowCount=new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber())),t.subAggsResult!=null){if(typeof t.subAggsResult!="object")throw TypeError(".search.proto.GroupByFieldResultItem.subAggsResult: object expected");e.subAggsResult=$root.search.proto.AggregationsResult.fromObject(t.subAggsResult)}if(t.subGroupBysResult!=null){if(typeof t.subGroupBysResult!="object")throw TypeError(".search.proto.GroupByFieldResultItem.subGroupBysResult: object expected");e.subGroupBysResult=$root.search.proto.GroupBysResult.fromObject(t.subGroupBysResult)}return e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(r.key="",$util.Long){var i=new $util.Long(0,0,!1);r.rowCount=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.rowCount=e.longs===String?"0":0;r.subAggsResult=null,r.subGroupBysResult=null}return t.key!=null&&t.hasOwnProperty("key")&&(r.key=t.key),t.rowCount!=null&&t.hasOwnProperty("rowCount")&&(typeof t.rowCount=="number"?r.rowCount=e.longs===String?String(t.rowCount):t.rowCount:r.rowCount=e.longs===String?$util.Long.prototype.toString.call(t.rowCount):e.longs===Number?new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber():t.rowCount),t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")&&(r.subAggsResult=$root.search.proto.AggregationsResult.toObject(t.subAggsResult,e)),t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")&&(r.subGroupBysResult=$root.search.proto.GroupBysResult.toObject(t.subGroupBysResult,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByFieldResult=function(){function n(o){if(this.groupByFieldResultItems=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.groupByFieldResultItems=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.groupByFieldResultItems!=null&&t.groupByFieldResultItems.length)for(var r=0;r<t.groupByFieldResultItems.length;++r)$root.search.proto.GroupByFieldResultItem.encode(t.groupByFieldResultItems[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByFieldResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.groupByFieldResultItems&&i.groupByFieldResultItems.length||(i.groupByFieldResultItems=[]),i.groupByFieldResultItems.push($root.search.proto.GroupByFieldResultItem.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.groupByFieldResultItems!=null&&t.hasOwnProperty("groupByFieldResultItems")){if(!Array.isArray(t.groupByFieldResultItems))return"groupByFieldResultItems: array expected";for(var e=0;e<t.groupByFieldResultItems.length;++e){var r=$root.search.proto.GroupByFieldResultItem.verify(t.groupByFieldResultItems[e]);if(r)return"groupByFieldResultItems."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByFieldResult)return t;var e=new $root.search.proto.GroupByFieldResult;if(t.groupByFieldResultItems){if(!Array.isArray(t.groupByFieldResultItems))throw TypeError(".search.proto.GroupByFieldResult.groupByFieldResultItems: array expected");e.groupByFieldResultItems=[];for(var r=0;r<t.groupByFieldResultItems.length;++r){if(typeof t.groupByFieldResultItems[r]!="object")throw TypeError(".search.proto.GroupByFieldResult.groupByFieldResultItems: object expected");e.groupByFieldResultItems[r]=$root.search.proto.GroupByFieldResultItem.fromObject(t.groupByFieldResultItems[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.groupByFieldResultItems=[]),t.groupByFieldResultItems&&t.groupByFieldResultItems.length){r.groupByFieldResultItems=[];for(var i=0;i<t.groupByFieldResultItems.length;++i)r.groupByFieldResultItems[i]=$root.search.proto.GroupByFieldResultItem.toObject(t.groupByFieldResultItems[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByRangeResultItem=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.from=0,n.prototype.to=0,n.prototype.rowCount=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.subAggsResult=null,n.prototype.subGroupBysResult=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.from!=null&&Object.hasOwnProperty.call(t,"from")&&e.uint32(9).double(t.from),t.to!=null&&Object.hasOwnProperty.call(t,"to")&&e.uint32(17).double(t.to),t.rowCount!=null&&Object.hasOwnProperty.call(t,"rowCount")&&e.uint32(24).int64(t.rowCount),t.subAggsResult!=null&&Object.hasOwnProperty.call(t,"subAggsResult")&&$root.search.proto.AggregationsResult.encode(t.subAggsResult,e.uint32(34).fork()).ldelim(),t.subGroupBysResult!=null&&Object.hasOwnProperty.call(t,"subGroupBysResult")&&$root.search.proto.GroupBysResult.encode(t.subGroupBysResult,e.uint32(42).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByRangeResultItem;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.from=t.double();break;case 2:i.to=t.double();break;case 3:i.rowCount=t.int64();break;case 4:i.subAggsResult=$root.search.proto.AggregationsResult.decode(t,t.uint32());break;case 5:i.subGroupBysResult=$root.search.proto.GroupBysResult.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.from!=null&&t.hasOwnProperty("from")&&typeof t.from!="number")return"from: number expected";if(t.to!=null&&t.hasOwnProperty("to")&&typeof t.to!="number")return"to: number expected";if(t.rowCount!=null&&t.hasOwnProperty("rowCount")&&!$util.isInteger(t.rowCount)&&!(t.rowCount&&$util.isInteger(t.rowCount.low)&&$util.isInteger(t.rowCount.high)))return"rowCount: integer|Long expected";if(t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")){var e=$root.search.proto.AggregationsResult.verify(t.subAggsResult);if(e)return"subAggsResult."+e}if(t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")){var e=$root.search.proto.GroupBysResult.verify(t.subGroupBysResult);if(e)return"subGroupBysResult."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByRangeResultItem)return t;var e=new $root.search.proto.GroupByRangeResultItem;if(t.from!=null&&(e.from=Number(t.from)),t.to!=null&&(e.to=Number(t.to)),t.rowCount!=null&&($util.Long?(e.rowCount=$util.Long.fromValue(t.rowCount)).unsigned=!1:typeof t.rowCount=="string"?e.rowCount=parseInt(t.rowCount,10):typeof t.rowCount=="number"?e.rowCount=t.rowCount:typeof t.rowCount=="object"&&(e.rowCount=new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber())),t.subAggsResult!=null){if(typeof t.subAggsResult!="object")throw TypeError(".search.proto.GroupByRangeResultItem.subAggsResult: object expected");e.subAggsResult=$root.search.proto.AggregationsResult.fromObject(t.subAggsResult)}if(t.subGroupBysResult!=null){if(typeof t.subGroupBysResult!="object")throw TypeError(".search.proto.GroupByRangeResultItem.subGroupBysResult: object expected");e.subGroupBysResult=$root.search.proto.GroupBysResult.fromObject(t.subGroupBysResult)}return e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(r.from=0,r.to=0,$util.Long){var i=new $util.Long(0,0,!1);r.rowCount=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.rowCount=e.longs===String?"0":0;r.subAggsResult=null,r.subGroupBysResult=null}return t.from!=null&&t.hasOwnProperty("from")&&(r.from=e.json&&!isFinite(t.from)?String(t.from):t.from),t.to!=null&&t.hasOwnProperty("to")&&(r.to=e.json&&!isFinite(t.to)?String(t.to):t.to),t.rowCount!=null&&t.hasOwnProperty("rowCount")&&(typeof t.rowCount=="number"?r.rowCount=e.longs===String?String(t.rowCount):t.rowCount:r.rowCount=e.longs===String?$util.Long.prototype.toString.call(t.rowCount):e.longs===Number?new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber():t.rowCount),t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")&&(r.subAggsResult=$root.search.proto.AggregationsResult.toObject(t.subAggsResult,e)),t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")&&(r.subGroupBysResult=$root.search.proto.GroupBysResult.toObject(t.subGroupBysResult,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByRangeResult=function(){function n(o){if(this.groupByRangeResultItems=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.groupByRangeResultItems=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.groupByRangeResultItems!=null&&t.groupByRangeResultItems.length)for(var r=0;r<t.groupByRangeResultItems.length;++r)$root.search.proto.GroupByRangeResultItem.encode(t.groupByRangeResultItems[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByRangeResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.groupByRangeResultItems&&i.groupByRangeResultItems.length||(i.groupByRangeResultItems=[]),i.groupByRangeResultItems.push($root.search.proto.GroupByRangeResultItem.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.groupByRangeResultItems!=null&&t.hasOwnProperty("groupByRangeResultItems")){if(!Array.isArray(t.groupByRangeResultItems))return"groupByRangeResultItems: array expected";for(var e=0;e<t.groupByRangeResultItems.length;++e){var r=$root.search.proto.GroupByRangeResultItem.verify(t.groupByRangeResultItems[e]);if(r)return"groupByRangeResultItems."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByRangeResult)return t;var e=new $root.search.proto.GroupByRangeResult;if(t.groupByRangeResultItems){if(!Array.isArray(t.groupByRangeResultItems))throw TypeError(".search.proto.GroupByRangeResult.groupByRangeResultItems: array expected");e.groupByRangeResultItems=[];for(var r=0;r<t.groupByRangeResultItems.length;++r){if(typeof t.groupByRangeResultItems[r]!="object")throw TypeError(".search.proto.GroupByRangeResult.groupByRangeResultItems: object expected");e.groupByRangeResultItems[r]=$root.search.proto.GroupByRangeResultItem.fromObject(t.groupByRangeResultItems[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.groupByRangeResultItems=[]),t.groupByRangeResultItems&&t.groupByRangeResultItems.length){r.groupByRangeResultItems=[];for(var i=0;i<t.groupByRangeResultItems.length;++i)r.groupByRangeResultItems[i]=$root.search.proto.GroupByRangeResultItem.toObject(t.groupByRangeResultItems[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByGeoDistanceResultItem=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.from=0,n.prototype.to=0,n.prototype.rowCount=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.subAggsResult=null,n.prototype.subGroupBysResult=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.from!=null&&Object.hasOwnProperty.call(t,"from")&&e.uint32(9).double(t.from),t.to!=null&&Object.hasOwnProperty.call(t,"to")&&e.uint32(17).double(t.to),t.rowCount!=null&&Object.hasOwnProperty.call(t,"rowCount")&&e.uint32(24).int64(t.rowCount),t.subAggsResult!=null&&Object.hasOwnProperty.call(t,"subAggsResult")&&$root.search.proto.AggregationsResult.encode(t.subAggsResult,e.uint32(34).fork()).ldelim(),t.subGroupBysResult!=null&&Object.hasOwnProperty.call(t,"subGroupBysResult")&&$root.search.proto.GroupBysResult.encode(t.subGroupBysResult,e.uint32(42).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByGeoDistanceResultItem;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.from=t.double();break;case 2:i.to=t.double();break;case 3:i.rowCount=t.int64();break;case 4:i.subAggsResult=$root.search.proto.AggregationsResult.decode(t,t.uint32());break;case 5:i.subGroupBysResult=$root.search.proto.GroupBysResult.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.from!=null&&t.hasOwnProperty("from")&&typeof t.from!="number")return"from: number expected";if(t.to!=null&&t.hasOwnProperty("to")&&typeof t.to!="number")return"to: number expected";if(t.rowCount!=null&&t.hasOwnProperty("rowCount")&&!$util.isInteger(t.rowCount)&&!(t.rowCount&&$util.isInteger(t.rowCount.low)&&$util.isInteger(t.rowCount.high)))return"rowCount: integer|Long expected";if(t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")){var e=$root.search.proto.AggregationsResult.verify(t.subAggsResult);if(e)return"subAggsResult."+e}if(t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")){var e=$root.search.proto.GroupBysResult.verify(t.subGroupBysResult);if(e)return"subGroupBysResult."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByGeoDistanceResultItem)return t;var e=new $root.search.proto.GroupByGeoDistanceResultItem;if(t.from!=null&&(e.from=Number(t.from)),t.to!=null&&(e.to=Number(t.to)),t.rowCount!=null&&($util.Long?(e.rowCount=$util.Long.fromValue(t.rowCount)).unsigned=!1:typeof t.rowCount=="string"?e.rowCount=parseInt(t.rowCount,10):typeof t.rowCount=="number"?e.rowCount=t.rowCount:typeof t.rowCount=="object"&&(e.rowCount=new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber())),t.subAggsResult!=null){if(typeof t.subAggsResult!="object")throw TypeError(".search.proto.GroupByGeoDistanceResultItem.subAggsResult: object expected");e.subAggsResult=$root.search.proto.AggregationsResult.fromObject(t.subAggsResult)}if(t.subGroupBysResult!=null){if(typeof t.subGroupBysResult!="object")throw TypeError(".search.proto.GroupByGeoDistanceResultItem.subGroupBysResult: object expected");e.subGroupBysResult=$root.search.proto.GroupBysResult.fromObject(t.subGroupBysResult)}return e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(r.from=0,r.to=0,$util.Long){var i=new $util.Long(0,0,!1);r.rowCount=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.rowCount=e.longs===String?"0":0;r.subAggsResult=null,r.subGroupBysResult=null}return t.from!=null&&t.hasOwnProperty("from")&&(r.from=e.json&&!isFinite(t.from)?String(t.from):t.from),t.to!=null&&t.hasOwnProperty("to")&&(r.to=e.json&&!isFinite(t.to)?String(t.to):t.to),t.rowCount!=null&&t.hasOwnProperty("rowCount")&&(typeof t.rowCount=="number"?r.rowCount=e.longs===String?String(t.rowCount):t.rowCount:r.rowCount=e.longs===String?$util.Long.prototype.toString.call(t.rowCount):e.longs===Number?new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber():t.rowCount),t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")&&(r.subAggsResult=$root.search.proto.AggregationsResult.toObject(t.subAggsResult,e)),t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")&&(r.subGroupBysResult=$root.search.proto.GroupBysResult.toObject(t.subGroupBysResult,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByGeoDistanceResult=function(){function n(o){if(this.groupByGeoDistanceResultItems=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.groupByGeoDistanceResultItems=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.groupByGeoDistanceResultItems!=null&&t.groupByGeoDistanceResultItems.length)for(var r=0;r<t.groupByGeoDistanceResultItems.length;++r)$root.search.proto.GroupByGeoDistanceResultItem.encode(t.groupByGeoDistanceResultItems[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByGeoDistanceResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.groupByGeoDistanceResultItems&&i.groupByGeoDistanceResultItems.length||(i.groupByGeoDistanceResultItems=[]),i.groupByGeoDistanceResultItems.push($root.search.proto.GroupByGeoDistanceResultItem.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.groupByGeoDistanceResultItems!=null&&t.hasOwnProperty("groupByGeoDistanceResultItems")){if(!Array.isArray(t.groupByGeoDistanceResultItems))return"groupByGeoDistanceResultItems: array expected";for(var e=0;e<t.groupByGeoDistanceResultItems.length;++e){var r=$root.search.proto.GroupByGeoDistanceResultItem.verify(t.groupByGeoDistanceResultItems[e]);if(r)return"groupByGeoDistanceResultItems."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByGeoDistanceResult)return t;var e=new $root.search.proto.GroupByGeoDistanceResult;if(t.groupByGeoDistanceResultItems){if(!Array.isArray(t.groupByGeoDistanceResultItems))throw TypeError(".search.proto.GroupByGeoDistanceResult.groupByGeoDistanceResultItems: array expected");e.groupByGeoDistanceResultItems=[];for(var r=0;r<t.groupByGeoDistanceResultItems.length;++r){if(typeof t.groupByGeoDistanceResultItems[r]!="object")throw TypeError(".search.proto.GroupByGeoDistanceResult.groupByGeoDistanceResultItems: object expected");e.groupByGeoDistanceResultItems[r]=$root.search.proto.GroupByGeoDistanceResultItem.fromObject(t.groupByGeoDistanceResultItems[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.groupByGeoDistanceResultItems=[]),t.groupByGeoDistanceResultItems&&t.groupByGeoDistanceResultItems.length){r.groupByGeoDistanceResultItems=[];for(var i=0;i<t.groupByGeoDistanceResultItems.length;++i)r.groupByGeoDistanceResultItems[i]=$root.search.proto.GroupByGeoDistanceResultItem.toObject(t.groupByGeoDistanceResultItems[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByFilterResultItem=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.rowCount=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.subAggsResult=null,n.prototype.subGroupBysResult=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.rowCount!=null&&Object.hasOwnProperty.call(t,"rowCount")&&e.uint32(8).int64(t.rowCount),t.subAggsResult!=null&&Object.hasOwnProperty.call(t,"subAggsResult")&&$root.search.proto.AggregationsResult.encode(t.subAggsResult,e.uint32(18).fork()).ldelim(),t.subGroupBysResult!=null&&Object.hasOwnProperty.call(t,"subGroupBysResult")&&$root.search.proto.GroupBysResult.encode(t.subGroupBysResult,e.uint32(26).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByFilterResultItem;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.rowCount=t.int64();break;case 2:i.subAggsResult=$root.search.proto.AggregationsResult.decode(t,t.uint32());break;case 3:i.subGroupBysResult=$root.search.proto.GroupBysResult.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.rowCount!=null&&t.hasOwnProperty("rowCount")&&!$util.isInteger(t.rowCount)&&!(t.rowCount&&$util.isInteger(t.rowCount.low)&&$util.isInteger(t.rowCount.high)))return"rowCount: integer|Long expected";if(t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")){var e=$root.search.proto.AggregationsResult.verify(t.subAggsResult);if(e)return"subAggsResult."+e}if(t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")){var e=$root.search.proto.GroupBysResult.verify(t.subGroupBysResult);if(e)return"subGroupBysResult."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByFilterResultItem)return t;var e=new $root.search.proto.GroupByFilterResultItem;if(t.rowCount!=null&&($util.Long?(e.rowCount=$util.Long.fromValue(t.rowCount)).unsigned=!1:typeof t.rowCount=="string"?e.rowCount=parseInt(t.rowCount,10):typeof t.rowCount=="number"?e.rowCount=t.rowCount:typeof t.rowCount=="object"&&(e.rowCount=new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber())),t.subAggsResult!=null){if(typeof t.subAggsResult!="object")throw TypeError(".search.proto.GroupByFilterResultItem.subAggsResult: object expected");e.subAggsResult=$root.search.proto.AggregationsResult.fromObject(t.subAggsResult)}if(t.subGroupBysResult!=null){if(typeof t.subGroupBysResult!="object")throw TypeError(".search.proto.GroupByFilterResultItem.subGroupBysResult: object expected");e.subGroupBysResult=$root.search.proto.GroupBysResult.fromObject(t.subGroupBysResult)}return e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if($util.Long){var i=new $util.Long(0,0,!1);r.rowCount=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.rowCount=e.longs===String?"0":0;r.subAggsResult=null,r.subGroupBysResult=null}return t.rowCount!=null&&t.hasOwnProperty("rowCount")&&(typeof t.rowCount=="number"?r.rowCount=e.longs===String?String(t.rowCount):t.rowCount:r.rowCount=e.longs===String?$util.Long.prototype.toString.call(t.rowCount):e.longs===Number?new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber():t.rowCount),t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")&&(r.subAggsResult=$root.search.proto.AggregationsResult.toObject(t.subAggsResult,e)),t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")&&(r.subGroupBysResult=$root.search.proto.GroupBysResult.toObject(t.subGroupBysResult,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByFilterResult=function(){function n(o){if(this.groupByFilterResultItems=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.groupByFilterResultItems=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.groupByFilterResultItems!=null&&t.groupByFilterResultItems.length)for(var r=0;r<t.groupByFilterResultItems.length;++r)$root.search.proto.GroupByFilterResultItem.encode(t.groupByFilterResultItems[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByFilterResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.groupByFilterResultItems&&i.groupByFilterResultItems.length||(i.groupByFilterResultItems=[]),i.groupByFilterResultItems.push($root.search.proto.GroupByFilterResultItem.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.groupByFilterResultItems!=null&&t.hasOwnProperty("groupByFilterResultItems")){if(!Array.isArray(t.groupByFilterResultItems))return"groupByFilterResultItems: array expected";for(var e=0;e<t.groupByFilterResultItems.length;++e){var r=$root.search.proto.GroupByFilterResultItem.verify(t.groupByFilterResultItems[e]);if(r)return"groupByFilterResultItems."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByFilterResult)return t;var e=new $root.search.proto.GroupByFilterResult;if(t.groupByFilterResultItems){if(!Array.isArray(t.groupByFilterResultItems))throw TypeError(".search.proto.GroupByFilterResult.groupByFilterResultItems: array expected");e.groupByFilterResultItems=[];for(var r=0;r<t.groupByFilterResultItems.length;++r){if(typeof t.groupByFilterResultItems[r]!="object")throw TypeError(".search.proto.GroupByFilterResult.groupByFilterResultItems: object expected");e.groupByFilterResultItems[r]=$root.search.proto.GroupByFilterResultItem.fromObject(t.groupByFilterResultItems[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.groupByFilterResultItems=[]),t.groupByFilterResultItems&&t.groupByFilterResultItems.length){r.groupByFilterResultItems=[];for(var i=0;i<t.groupByFilterResultItems.length;++i)r.groupByFilterResultItems[i]=$root.search.proto.GroupByFilterResultItem.toObject(t.groupByFilterResultItems[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByResult=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.name="",n.prototype.type=1,n.prototype.groupByResult=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.name!=null&&Object.hasOwnProperty.call(t,"name")&&e.uint32(10).string(t.name),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&e.uint32(16).int32(t.type),t.groupByResult!=null&&Object.hasOwnProperty.call(t,"groupByResult")&&e.uint32(26).bytes(t.groupByResult),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.name=t.string();break;case 2:i.type=t.int32();break;case 3:i.groupByResult=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.name!=null&&t.hasOwnProperty("name")&&!$util.isString(t.name))return"name: string expected";if(t.type!=null&&t.hasOwnProperty("type"))switch(t.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:break}return t.groupByResult!=null&&t.hasOwnProperty("groupByResult")&&!(t.groupByResult&&typeof t.groupByResult.length=="number"||$util.isString(t.groupByResult))?"groupByResult: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByResult)return t;var e=new $root.search.proto.GroupByResult;switch(t.name!=null&&(e.name=String(t.name)),t.type){case"GROUP_BY_FIELD":case 1:e.type=1;break;case"GROUP_BY_RANGE":case 2:e.type=2;break;case"GROUP_BY_FILTER":case 3:e.type=3;break;case"GROUP_BY_GEO_DISTANCE":case 4:e.type=4;break;case"GROUP_BY_HISTOGRAM":case 5:e.type=5;break;case"GROUP_BY_DATE_HISTOGRAM":case 6:e.type=6;break;case"GROUP_BY_GEO_GRID":case 7:e.type=7;break;case"GROUP_BY_COMPOSITE":case 8:e.type=8;break}return t.groupByResult!=null&&(typeof t.groupByResult=="string"?$util.base64.decode(t.groupByResult,e.groupByResult=$util.newBuffer($util.base64.length(t.groupByResult)),0):t.groupByResult.length&&(e.groupByResult=t.groupByResult)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.name="",r.type=e.enums===String?"GROUP_BY_FIELD":1,e.bytes===String?r.groupByResult="":(r.groupByResult=[],e.bytes!==Array&&(r.groupByResult=$util.newBuffer(r.groupByResult)))),t.name!=null&&t.hasOwnProperty("name")&&(r.name=t.name),t.type!=null&&t.hasOwnProperty("type")&&(r.type=e.enums===String?$root.search.proto.GroupByType[t.type]:t.type),t.groupByResult!=null&&t.hasOwnProperty("groupByResult")&&(r.groupByResult=e.bytes===String?$util.base64.encode(t.groupByResult,0,t.groupByResult.length):e.bytes===Array?Array.prototype.slice.call(t.groupByResult):t.groupByResult),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupBysResult=function(){function n(o){if(this.groupByResults=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.groupByResults=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.groupByResults!=null&&t.groupByResults.length)for(var r=0;r<t.groupByResults.length;++r)$root.search.proto.GroupByResult.encode(t.groupByResults[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupBysResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.groupByResults&&i.groupByResults.length||(i.groupByResults=[]),i.groupByResults.push($root.search.proto.GroupByResult.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.groupByResults!=null&&t.hasOwnProperty("groupByResults")){if(!Array.isArray(t.groupByResults))return"groupByResults: array expected";for(var e=0;e<t.groupByResults.length;++e){var r=$root.search.proto.GroupByResult.verify(t.groupByResults[e]);if(r)return"groupByResults."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupBysResult)return t;var e=new $root.search.proto.GroupBysResult;if(t.groupByResults){if(!Array.isArray(t.groupByResults))throw TypeError(".search.proto.GroupBysResult.groupByResults: array expected");e.groupByResults=[];for(var r=0;r<t.groupByResults.length;++r){if(typeof t.groupByResults[r]!="object")throw TypeError(".search.proto.GroupBysResult.groupByResults: object expected");e.groupByResults[r]=$root.search.proto.GroupByResult.fromObject(t.groupByResults[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.groupByResults=[]),t.groupByResults&&t.groupByResults.length){r.groupByResults=[];for(var i=0;i<t.groupByResults.length;++i)r.groupByResults[i]=$root.search.proto.GroupByResult.toObject(t.groupByResults[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByHistogramItem=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.key=$util.newBuffer([]),n.prototype.value=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.subAggsResult=null,n.prototype.subGroupBysResult=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.key!=null&&Object.hasOwnProperty.call(t,"key")&&e.uint32(10).bytes(t.key),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&e.uint32(16).int64(t.value),t.subAggsResult!=null&&Object.hasOwnProperty.call(t,"subAggsResult")&&$root.search.proto.AggregationsResult.encode(t.subAggsResult,e.uint32(26).fork()).ldelim(),t.subGroupBysResult!=null&&Object.hasOwnProperty.call(t,"subGroupBysResult")&&$root.search.proto.GroupBysResult.encode(t.subGroupBysResult,e.uint32(34).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByHistogramItem;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.key=t.bytes();break;case 2:i.value=t.int64();break;case 3:i.subAggsResult=$root.search.proto.AggregationsResult.decode(t,t.uint32());break;case 4:i.subGroupBysResult=$root.search.proto.GroupBysResult.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.key!=null&&t.hasOwnProperty("key")&&!(t.key&&typeof t.key.length=="number"||$util.isString(t.key)))return"key: buffer expected";if(t.value!=null&&t.hasOwnProperty("value")&&!$util.isInteger(t.value)&&!(t.value&&$util.isInteger(t.value.low)&&$util.isInteger(t.value.high)))return"value: integer|Long expected";if(t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")){var e=$root.search.proto.AggregationsResult.verify(t.subAggsResult);if(e)return"subAggsResult."+e}if(t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")){var e=$root.search.proto.GroupBysResult.verify(t.subGroupBysResult);if(e)return"subGroupBysResult."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByHistogramItem)return t;var e=new $root.search.proto.GroupByHistogramItem;if(t.key!=null&&(typeof t.key=="string"?$util.base64.decode(t.key,e.key=$util.newBuffer($util.base64.length(t.key)),0):t.key.length&&(e.key=t.key)),t.value!=null&&($util.Long?(e.value=$util.Long.fromValue(t.value)).unsigned=!1:typeof t.value=="string"?e.value=parseInt(t.value,10):typeof t.value=="number"?e.value=t.value:typeof t.value=="object"&&(e.value=new $util.LongBits(t.value.low>>>0,t.value.high>>>0).toNumber())),t.subAggsResult!=null){if(typeof t.subAggsResult!="object")throw TypeError(".search.proto.GroupByHistogramItem.subAggsResult: object expected");e.subAggsResult=$root.search.proto.AggregationsResult.fromObject(t.subAggsResult)}if(t.subGroupBysResult!=null){if(typeof t.subGroupBysResult!="object")throw TypeError(".search.proto.GroupByHistogramItem.subGroupBysResult: object expected");e.subGroupBysResult=$root.search.proto.GroupBysResult.fromObject(t.subGroupBysResult)}return e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(e.bytes===String?r.key="":(r.key=[],e.bytes!==Array&&(r.key=$util.newBuffer(r.key))),$util.Long){var i=new $util.Long(0,0,!1);r.value=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.value=e.longs===String?"0":0;r.subAggsResult=null,r.subGroupBysResult=null}return t.key!=null&&t.hasOwnProperty("key")&&(r.key=e.bytes===String?$util.base64.encode(t.key,0,t.key.length):e.bytes===Array?Array.prototype.slice.call(t.key):t.key),t.value!=null&&t.hasOwnProperty("value")&&(typeof t.value=="number"?r.value=e.longs===String?String(t.value):t.value:r.value=e.longs===String?$util.Long.prototype.toString.call(t.value):e.longs===Number?new $util.LongBits(t.value.low>>>0,t.value.high>>>0).toNumber():t.value),t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")&&(r.subAggsResult=$root.search.proto.AggregationsResult.toObject(t.subAggsResult,e)),t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")&&(r.subGroupBysResult=$root.search.proto.GroupBysResult.toObject(t.subGroupBysResult,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByHistogramResult=function(){function n(o){if(this.groupByHistogramItems=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.groupByHistogramItems=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.groupByHistogramItems!=null&&t.groupByHistogramItems.length)for(var r=0;r<t.groupByHistogramItems.length;++r)$root.search.proto.GroupByHistogramItem.encode(t.groupByHistogramItems[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByHistogramResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.groupByHistogramItems&&i.groupByHistogramItems.length||(i.groupByHistogramItems=[]),i.groupByHistogramItems.push($root.search.proto.GroupByHistogramItem.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.groupByHistogramItems!=null&&t.hasOwnProperty("groupByHistogramItems")){if(!Array.isArray(t.groupByHistogramItems))return"groupByHistogramItems: array expected";for(var e=0;e<t.groupByHistogramItems.length;++e){var r=$root.search.proto.GroupByHistogramItem.verify(t.groupByHistogramItems[e]);if(r)return"groupByHistogramItems."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByHistogramResult)return t;var e=new $root.search.proto.GroupByHistogramResult;if(t.groupByHistogramItems){if(!Array.isArray(t.groupByHistogramItems))throw TypeError(".search.proto.GroupByHistogramResult.groupByHistogramItems: array expected");e.groupByHistogramItems=[];for(var r=0;r<t.groupByHistogramItems.length;++r){if(typeof t.groupByHistogramItems[r]!="object")throw TypeError(".search.proto.GroupByHistogramResult.groupByHistogramItems: object expected");e.groupByHistogramItems[r]=$root.search.proto.GroupByHistogramItem.fromObject(t.groupByHistogramItems[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.groupByHistogramItems=[]),t.groupByHistogramItems&&t.groupByHistogramItems.length){r.groupByHistogramItems=[];for(var i=0;i<t.groupByHistogramItems.length;++i)r.groupByHistogramItems[i]=$root.search.proto.GroupByHistogramItem.toObject(t.groupByHistogramItems[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByDateHistogramItem=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.timestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.rowCount=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.subAggsResult=null,n.prototype.subGroupBysResult=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.timestamp!=null&&Object.hasOwnProperty.call(t,"timestamp")&&e.uint32(8).int64(t.timestamp),t.rowCount!=null&&Object.hasOwnProperty.call(t,"rowCount")&&e.uint32(16).int64(t.rowCount),t.subAggsResult!=null&&Object.hasOwnProperty.call(t,"subAggsResult")&&$root.search.proto.AggregationsResult.encode(t.subAggsResult,e.uint32(26).fork()).ldelim(),t.subGroupBysResult!=null&&Object.hasOwnProperty.call(t,"subGroupBysResult")&&$root.search.proto.GroupBysResult.encode(t.subGroupBysResult,e.uint32(34).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByDateHistogramItem;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.timestamp=t.int64();break;case 2:i.rowCount=t.int64();break;case 3:i.subAggsResult=$root.search.proto.AggregationsResult.decode(t,t.uint32());break;case 4:i.subGroupBysResult=$root.search.proto.GroupBysResult.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.timestamp!=null&&t.hasOwnProperty("timestamp")&&!$util.isInteger(t.timestamp)&&!(t.timestamp&&$util.isInteger(t.timestamp.low)&&$util.isInteger(t.timestamp.high)))return"timestamp: integer|Long expected";if(t.rowCount!=null&&t.hasOwnProperty("rowCount")&&!$util.isInteger(t.rowCount)&&!(t.rowCount&&$util.isInteger(t.rowCount.low)&&$util.isInteger(t.rowCount.high)))return"rowCount: integer|Long expected";if(t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")){var e=$root.search.proto.AggregationsResult.verify(t.subAggsResult);if(e)return"subAggsResult."+e}if(t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")){var e=$root.search.proto.GroupBysResult.verify(t.subGroupBysResult);if(e)return"subGroupBysResult."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByDateHistogramItem)return t;var e=new $root.search.proto.GroupByDateHistogramItem;if(t.timestamp!=null&&($util.Long?(e.timestamp=$util.Long.fromValue(t.timestamp)).unsigned=!1:typeof t.timestamp=="string"?e.timestamp=parseInt(t.timestamp,10):typeof t.timestamp=="number"?e.timestamp=t.timestamp:typeof t.timestamp=="object"&&(e.timestamp=new $util.LongBits(t.timestamp.low>>>0,t.timestamp.high>>>0).toNumber())),t.rowCount!=null&&($util.Long?(e.rowCount=$util.Long.fromValue(t.rowCount)).unsigned=!1:typeof t.rowCount=="string"?e.rowCount=parseInt(t.rowCount,10):typeof t.rowCount=="number"?e.rowCount=t.rowCount:typeof t.rowCount=="object"&&(e.rowCount=new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber())),t.subAggsResult!=null){if(typeof t.subAggsResult!="object")throw TypeError(".search.proto.GroupByDateHistogramItem.subAggsResult: object expected");e.subAggsResult=$root.search.proto.AggregationsResult.fromObject(t.subAggsResult)}if(t.subGroupBysResult!=null){if(typeof t.subGroupBysResult!="object")throw TypeError(".search.proto.GroupByDateHistogramItem.subGroupBysResult: object expected");e.subGroupBysResult=$root.search.proto.GroupBysResult.fromObject(t.subGroupBysResult)}return e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if($util.Long){var i=new $util.Long(0,0,!1);r.timestamp=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.timestamp=e.longs===String?"0":0;if($util.Long){var i=new $util.Long(0,0,!1);r.rowCount=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.rowCount=e.longs===String?"0":0;r.subAggsResult=null,r.subGroupBysResult=null}return t.timestamp!=null&&t.hasOwnProperty("timestamp")&&(typeof t.timestamp=="number"?r.timestamp=e.longs===String?String(t.timestamp):t.timestamp:r.timestamp=e.longs===String?$util.Long.prototype.toString.call(t.timestamp):e.longs===Number?new $util.LongBits(t.timestamp.low>>>0,t.timestamp.high>>>0).toNumber():t.timestamp),t.rowCount!=null&&t.hasOwnProperty("rowCount")&&(typeof t.rowCount=="number"?r.rowCount=e.longs===String?String(t.rowCount):t.rowCount:r.rowCount=e.longs===String?$util.Long.prototype.toString.call(t.rowCount):e.longs===Number?new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber():t.rowCount),t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")&&(r.subAggsResult=$root.search.proto.AggregationsResult.toObject(t.subAggsResult,e)),t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")&&(r.subGroupBysResult=$root.search.proto.GroupBysResult.toObject(t.subGroupBysResult,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByDateHistogramResult=function(){function n(o){if(this.groupByDateHistogramItems=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.groupByDateHistogramItems=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.groupByDateHistogramItems!=null&&t.groupByDateHistogramItems.length)for(var r=0;r<t.groupByDateHistogramItems.length;++r)$root.search.proto.GroupByDateHistogramItem.encode(t.groupByDateHistogramItems[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByDateHistogramResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.groupByDateHistogramItems&&i.groupByDateHistogramItems.length||(i.groupByDateHistogramItems=[]),i.groupByDateHistogramItems.push($root.search.proto.GroupByDateHistogramItem.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.groupByDateHistogramItems!=null&&t.hasOwnProperty("groupByDateHistogramItems")){if(!Array.isArray(t.groupByDateHistogramItems))return"groupByDateHistogramItems: array expected";for(var e=0;e<t.groupByDateHistogramItems.length;++e){var r=$root.search.proto.GroupByDateHistogramItem.verify(t.groupByDateHistogramItems[e]);if(r)return"groupByDateHistogramItems."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByDateHistogramResult)return t;var e=new $root.search.proto.GroupByDateHistogramResult;if(t.groupByDateHistogramItems){if(!Array.isArray(t.groupByDateHistogramItems))throw TypeError(".search.proto.GroupByDateHistogramResult.groupByDateHistogramItems: array expected");e.groupByDateHistogramItems=[];for(var r=0;r<t.groupByDateHistogramItems.length;++r){if(typeof t.groupByDateHistogramItems[r]!="object")throw TypeError(".search.proto.GroupByDateHistogramResult.groupByDateHistogramItems: object expected");e.groupByDateHistogramItems[r]=$root.search.proto.GroupByDateHistogramItem.fromObject(t.groupByDateHistogramItems[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.groupByDateHistogramItems=[]),t.groupByDateHistogramItems&&t.groupByDateHistogramItems.length){r.groupByDateHistogramItems=[];for(var i=0;i<t.groupByDateHistogramItems.length;++i)r.groupByDateHistogramItems[i]=$root.search.proto.GroupByDateHistogramItem.toObject(t.groupByDateHistogramItems[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByGeoGridResultItem=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.key="",n.prototype.geoGrid=null,n.prototype.rowCount=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.subAggsResult=null,n.prototype.subGroupBysResult=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.key!=null&&Object.hasOwnProperty.call(t,"key")&&e.uint32(10).string(t.key),t.geoGrid!=null&&Object.hasOwnProperty.call(t,"geoGrid")&&$root.search.proto.GeoGrid.encode(t.geoGrid,e.uint32(18).fork()).ldelim(),t.rowCount!=null&&Object.hasOwnProperty.call(t,"rowCount")&&e.uint32(24).int64(t.rowCount),t.subAggsResult!=null&&Object.hasOwnProperty.call(t,"subAggsResult")&&$root.search.proto.AggregationsResult.encode(t.subAggsResult,e.uint32(34).fork()).ldelim(),t.subGroupBysResult!=null&&Object.hasOwnProperty.call(t,"subGroupBysResult")&&$root.search.proto.GroupBysResult.encode(t.subGroupBysResult,e.uint32(42).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByGeoGridResultItem;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.key=t.string();break;case 2:i.geoGrid=$root.search.proto.GeoGrid.decode(t,t.uint32());break;case 3:i.rowCount=t.int64();break;case 4:i.subAggsResult=$root.search.proto.AggregationsResult.decode(t,t.uint32());break;case 5:i.subGroupBysResult=$root.search.proto.GroupBysResult.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.key!=null&&t.hasOwnProperty("key")&&!$util.isString(t.key))return"key: string expected";if(t.geoGrid!=null&&t.hasOwnProperty("geoGrid")){var e=$root.search.proto.GeoGrid.verify(t.geoGrid);if(e)return"geoGrid."+e}if(t.rowCount!=null&&t.hasOwnProperty("rowCount")&&!$util.isInteger(t.rowCount)&&!(t.rowCount&&$util.isInteger(t.rowCount.low)&&$util.isInteger(t.rowCount.high)))return"rowCount: integer|Long expected";if(t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")){var e=$root.search.proto.AggregationsResult.verify(t.subAggsResult);if(e)return"subAggsResult."+e}if(t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")){var e=$root.search.proto.GroupBysResult.verify(t.subGroupBysResult);if(e)return"subGroupBysResult."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByGeoGridResultItem)return t;var e=new $root.search.proto.GroupByGeoGridResultItem;if(t.key!=null&&(e.key=String(t.key)),t.geoGrid!=null){if(typeof t.geoGrid!="object")throw TypeError(".search.proto.GroupByGeoGridResultItem.geoGrid: object expected");e.geoGrid=$root.search.proto.GeoGrid.fromObject(t.geoGrid)}if(t.rowCount!=null&&($util.Long?(e.rowCount=$util.Long.fromValue(t.rowCount)).unsigned=!1:typeof t.rowCount=="string"?e.rowCount=parseInt(t.rowCount,10):typeof t.rowCount=="number"?e.rowCount=t.rowCount:typeof t.rowCount=="object"&&(e.rowCount=new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber())),t.subAggsResult!=null){if(typeof t.subAggsResult!="object")throw TypeError(".search.proto.GroupByGeoGridResultItem.subAggsResult: object expected");e.subAggsResult=$root.search.proto.AggregationsResult.fromObject(t.subAggsResult)}if(t.subGroupBysResult!=null){if(typeof t.subGroupBysResult!="object")throw TypeError(".search.proto.GroupByGeoGridResultItem.subGroupBysResult: object expected");e.subGroupBysResult=$root.search.proto.GroupBysResult.fromObject(t.subGroupBysResult)}return e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(r.key="",r.geoGrid=null,$util.Long){var i=new $util.Long(0,0,!1);r.rowCount=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.rowCount=e.longs===String?"0":0;r.subAggsResult=null,r.subGroupBysResult=null}return t.key!=null&&t.hasOwnProperty("key")&&(r.key=t.key),t.geoGrid!=null&&t.hasOwnProperty("geoGrid")&&(r.geoGrid=$root.search.proto.GeoGrid.toObject(t.geoGrid,e)),t.rowCount!=null&&t.hasOwnProperty("rowCount")&&(typeof t.rowCount=="number"?r.rowCount=e.longs===String?String(t.rowCount):t.rowCount:r.rowCount=e.longs===String?$util.Long.prototype.toString.call(t.rowCount):e.longs===Number?new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber():t.rowCount),t.subAggsResult!=null&&t.hasOwnProperty("subAggsResult")&&(r.subAggsResult=$root.search.proto.AggregationsResult.toObject(t.subAggsResult,e)),t.subGroupBysResult!=null&&t.hasOwnProperty("subGroupBysResult")&&(r.subGroupBysResult=$root.search.proto.GroupBysResult.toObject(t.subGroupBysResult,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GroupByGeoGridResult=function(){function n(o){if(this.groupByGeoGridResultItems=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.groupByGeoGridResultItems=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.groupByGeoGridResultItems!=null&&t.groupByGeoGridResultItems.length)for(var r=0;r<t.groupByGeoGridResultItems.length;++r)$root.search.proto.GroupByGeoGridResultItem.encode(t.groupByGeoGridResultItems[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GroupByGeoGridResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.groupByGeoGridResultItems&&i.groupByGeoGridResultItems.length||(i.groupByGeoGridResultItems=[]),i.groupByGeoGridResultItems.push($root.search.proto.GroupByGeoGridResultItem.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.groupByGeoGridResultItems!=null&&t.hasOwnProperty("groupByGeoGridResultItems")){if(!Array.isArray(t.groupByGeoGridResultItems))return"groupByGeoGridResultItems: array expected";for(var e=0;e<t.groupByGeoGridResultItems.length;++e){var r=$root.search.proto.GroupByGeoGridResultItem.verify(t.groupByGeoGridResultItems[e]);if(r)return"groupByGeoGridResultItems."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GroupByGeoGridResult)return t;var e=new $root.search.proto.GroupByGeoGridResult;if(t.groupByGeoGridResultItems){if(!Array.isArray(t.groupByGeoGridResultItems))throw TypeError(".search.proto.GroupByGeoGridResult.groupByGeoGridResultItems: array expected");e.groupByGeoGridResultItems=[];for(var r=0;r<t.groupByGeoGridResultItems.length;++r){if(typeof t.groupByGeoGridResultItems[r]!="object")throw TypeError(".search.proto.GroupByGeoGridResult.groupByGeoGridResultItems: object expected");e.groupByGeoGridResultItems[r]=$root.search.proto.GroupByGeoGridResultItem.fromObject(t.groupByGeoGridResultItems[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.groupByGeoGridResultItems=[]),t.groupByGeoGridResultItems&&t.groupByGeoGridResultItems.length){r.groupByGeoGridResultItems=[];for(var i=0;i<t.groupByGeoGridResultItems.length;++i)r.groupByGeoGridResultItems[i]=$root.search.proto.GroupByGeoGridResultItem.toObject(t.groupByGeoGridResultItems[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.QueryType=function(){var n={},o=Object.create(n);return o[n[1]="MATCH_QUERY"]=1,o[n[2]="MATCH_PHRASE_QUERY"]=2,o[n[3]="TERM_QUERY"]=3,o[n[4]="RANGE_QUERY"]=4,o[n[5]="PREFIX_QUERY"]=5,o[n[6]="BOOL_QUERY"]=6,o[n[7]="CONST_SCORE_QUERY"]=7,o[n[8]="FUNCTION_SCORE_QUERY"]=8,o[n[9]="NESTED_QUERY"]=9,o[n[10]="WILDCARD_QUERY"]=10,o[n[11]="MATCH_ALL_QUERY"]=11,o[n[12]="GEO_BOUNDING_BOX_QUERY"]=12,o[n[13]="GEO_DISTANCE_QUERY"]=13,o[n[14]="GEO_POLYGON_QUERY"]=14,o[n[15]="TERMS_QUERY"]=15,o[n[16]="EXISTS_QUERY"]=16,o[n[17]="KNN_VECTOR_QUERY"]=17,o[n[18]="FUNCTIONS_SCORE_QUERY"]=18,o}(),c.QueryOperator=function(){var n={},o=Object.create(n);return o[n[1]="OR"]=1,o[n[2]="AND"]=2,o}(),c.MatchQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.text="",n.prototype.minimumShouldMatch=0,n.prototype.operator=1,n.prototype.weight=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.text!=null&&Object.hasOwnProperty.call(t,"text")&&e.uint32(18).string(t.text),t.minimumShouldMatch!=null&&Object.hasOwnProperty.call(t,"minimumShouldMatch")&&e.uint32(24).int32(t.minimumShouldMatch),t.operator!=null&&Object.hasOwnProperty.call(t,"operator")&&e.uint32(32).int32(t.operator),t.weight!=null&&Object.hasOwnProperty.call(t,"weight")&&e.uint32(45).float(t.weight),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.MatchQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.text=t.string();break;case 3:i.minimumShouldMatch=t.int32();break;case 4:i.operator=t.int32();break;case 5:i.weight=t.float();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.text!=null&&t.hasOwnProperty("text")&&!$util.isString(t.text))return"text: string expected";if(t.minimumShouldMatch!=null&&t.hasOwnProperty("minimumShouldMatch")&&!$util.isInteger(t.minimumShouldMatch))return"minimumShouldMatch: integer expected";if(t.operator!=null&&t.hasOwnProperty("operator"))switch(t.operator){default:return"operator: enum value expected";case 1:case 2:break}return t.weight!=null&&t.hasOwnProperty("weight")&&typeof t.weight!="number"?"weight: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.MatchQuery)return t;var e=new $root.search.proto.MatchQuery;switch(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.text!=null&&(e.text=String(t.text)),t.minimumShouldMatch!=null&&(e.minimumShouldMatch=t.minimumShouldMatch|0),t.operator){case"OR":case 1:e.operator=1;break;case"AND":case 2:e.operator=2;break}return t.weight!=null&&(e.weight=Number(t.weight)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",r.text="",r.minimumShouldMatch=0,r.operator=e.enums===String?"OR":1,r.weight=0),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.text!=null&&t.hasOwnProperty("text")&&(r.text=t.text),t.minimumShouldMatch!=null&&t.hasOwnProperty("minimumShouldMatch")&&(r.minimumShouldMatch=t.minimumShouldMatch),t.operator!=null&&t.hasOwnProperty("operator")&&(r.operator=e.enums===String?$root.search.proto.QueryOperator[t.operator]:t.operator),t.weight!=null&&t.hasOwnProperty("weight")&&(r.weight=e.json&&!isFinite(t.weight)?String(t.weight):t.weight),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.MatchPhraseQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.text="",n.prototype.weight=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.text!=null&&Object.hasOwnProperty.call(t,"text")&&e.uint32(18).string(t.text),t.weight!=null&&Object.hasOwnProperty.call(t,"weight")&&e.uint32(29).float(t.weight),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.MatchPhraseQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.text=t.string();break;case 3:i.weight=t.float();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.text!=null&&t.hasOwnProperty("text")&&!$util.isString(t.text)?"text: string expected":t.weight!=null&&t.hasOwnProperty("weight")&&typeof t.weight!="number"?"weight: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.MatchPhraseQuery)return t;var e=new $root.search.proto.MatchPhraseQuery;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.text!=null&&(e.text=String(t.text)),t.weight!=null&&(e.weight=Number(t.weight)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",r.text="",r.weight=0),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.text!=null&&t.hasOwnProperty("text")&&(r.text=t.text),t.weight!=null&&t.hasOwnProperty("weight")&&(r.weight=e.json&&!isFinite(t.weight)?String(t.weight):t.weight),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.MatchAllQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.MatchAllQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.search.proto.MatchAllQuery?t:new $root.search.proto.MatchAllQuery},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TermQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.term=$util.newBuffer([]),n.prototype.weight=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.term!=null&&Object.hasOwnProperty.call(t,"term")&&e.uint32(18).bytes(t.term),t.weight!=null&&Object.hasOwnProperty.call(t,"weight")&&e.uint32(29).float(t.weight),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.TermQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.term=t.bytes();break;case 3:i.weight=t.float();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.term!=null&&t.hasOwnProperty("term")&&!(t.term&&typeof t.term.length=="number"||$util.isString(t.term))?"term: buffer expected":t.weight!=null&&t.hasOwnProperty("weight")&&typeof t.weight!="number"?"weight: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.TermQuery)return t;var e=new $root.search.proto.TermQuery;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.term!=null&&(typeof t.term=="string"?$util.base64.decode(t.term,e.term=$util.newBuffer($util.base64.length(t.term)),0):t.term.length&&(e.term=t.term)),t.weight!=null&&(e.weight=Number(t.weight)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",e.bytes===String?r.term="":(r.term=[],e.bytes!==Array&&(r.term=$util.newBuffer(r.term))),r.weight=0),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.term!=null&&t.hasOwnProperty("term")&&(r.term=e.bytes===String?$util.base64.encode(t.term,0,t.term.length):e.bytes===Array?Array.prototype.slice.call(t.term):t.term),t.weight!=null&&t.hasOwnProperty("weight")&&(r.weight=e.json&&!isFinite(t.weight)?String(t.weight):t.weight),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.TermsQuery=function(){function n(o){if(this.terms=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.terms=$util.emptyArray,n.prototype.weight=0,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.terms!=null&&t.terms.length)for(var r=0;r<t.terms.length;++r)e.uint32(18).bytes(t.terms[r]);return t.weight!=null&&Object.hasOwnProperty.call(t,"weight")&&e.uint32(29).float(t.weight),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.TermsQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.terms&&i.terms.length||(i.terms=[]),i.terms.push(t.bytes());break;case 3:i.weight=t.float();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.terms!=null&&t.hasOwnProperty("terms")){if(!Array.isArray(t.terms))return"terms: array expected";for(var e=0;e<t.terms.length;++e)if(!(t.terms[e]&&typeof t.terms[e].length=="number"||$util.isString(t.terms[e])))return"terms: buffer[] expected"}return t.weight!=null&&t.hasOwnProperty("weight")&&typeof t.weight!="number"?"weight: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.TermsQuery)return t;var e=new $root.search.proto.TermsQuery;if(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.terms){if(!Array.isArray(t.terms))throw TypeError(".search.proto.TermsQuery.terms: array expected");e.terms=[];for(var r=0;r<t.terms.length;++r)typeof t.terms[r]=="string"?$util.base64.decode(t.terms[r],e.terms[r]=$util.newBuffer($util.base64.length(t.terms[r])),0):t.terms[r].length&&(e.terms[r]=t.terms[r])}return t.weight!=null&&(e.weight=Number(t.weight)),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.terms=[]),e.defaults&&(r.fieldName="",r.weight=0),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.terms&&t.terms.length){r.terms=[];for(var i=0;i<t.terms.length;++i)r.terms[i]=e.bytes===String?$util.base64.encode(t.terms[i],0,t.terms[i].length):e.bytes===Array?Array.prototype.slice.call(t.terms[i]):t.terms[i]}return t.weight!=null&&t.hasOwnProperty("weight")&&(r.weight=e.json&&!isFinite(t.weight)?String(t.weight):t.weight),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.RangeQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.rangeFrom=$util.newBuffer([]),n.prototype.rangeTo=$util.newBuffer([]),n.prototype.includeLower=!1,n.prototype.includeUpper=!1,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.rangeFrom!=null&&Object.hasOwnProperty.call(t,"rangeFrom")&&e.uint32(18).bytes(t.rangeFrom),t.rangeTo!=null&&Object.hasOwnProperty.call(t,"rangeTo")&&e.uint32(26).bytes(t.rangeTo),t.includeLower!=null&&Object.hasOwnProperty.call(t,"includeLower")&&e.uint32(32).bool(t.includeLower),t.includeUpper!=null&&Object.hasOwnProperty.call(t,"includeUpper")&&e.uint32(40).bool(t.includeUpper),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.RangeQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.rangeFrom=t.bytes();break;case 3:i.rangeTo=t.bytes();break;case 4:i.includeLower=t.bool();break;case 5:i.includeUpper=t.bool();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.rangeFrom!=null&&t.hasOwnProperty("rangeFrom")&&!(t.rangeFrom&&typeof t.rangeFrom.length=="number"||$util.isString(t.rangeFrom))?"rangeFrom: buffer expected":t.rangeTo!=null&&t.hasOwnProperty("rangeTo")&&!(t.rangeTo&&typeof t.rangeTo.length=="number"||$util.isString(t.rangeTo))?"rangeTo: buffer expected":t.includeLower!=null&&t.hasOwnProperty("includeLower")&&typeof t.includeLower!="boolean"?"includeLower: boolean expected":t.includeUpper!=null&&t.hasOwnProperty("includeUpper")&&typeof t.includeUpper!="boolean"?"includeUpper: boolean expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.RangeQuery)return t;var e=new $root.search.proto.RangeQuery;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.rangeFrom!=null&&(typeof t.rangeFrom=="string"?$util.base64.decode(t.rangeFrom,e.rangeFrom=$util.newBuffer($util.base64.length(t.rangeFrom)),0):t.rangeFrom.length&&(e.rangeFrom=t.rangeFrom)),t.rangeTo!=null&&(typeof t.rangeTo=="string"?$util.base64.decode(t.rangeTo,e.rangeTo=$util.newBuffer($util.base64.length(t.rangeTo)),0):t.rangeTo.length&&(e.rangeTo=t.rangeTo)),t.includeLower!=null&&(e.includeLower=!!t.includeLower),t.includeUpper!=null&&(e.includeUpper=!!t.includeUpper),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",e.bytes===String?r.rangeFrom="":(r.rangeFrom=[],e.bytes!==Array&&(r.rangeFrom=$util.newBuffer(r.rangeFrom))),e.bytes===String?r.rangeTo="":(r.rangeTo=[],e.bytes!==Array&&(r.rangeTo=$util.newBuffer(r.rangeTo))),r.includeLower=!1,r.includeUpper=!1),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.rangeFrom!=null&&t.hasOwnProperty("rangeFrom")&&(r.rangeFrom=e.bytes===String?$util.base64.encode(t.rangeFrom,0,t.rangeFrom.length):e.bytes===Array?Array.prototype.slice.call(t.rangeFrom):t.rangeFrom),t.rangeTo!=null&&t.hasOwnProperty("rangeTo")&&(r.rangeTo=e.bytes===String?$util.base64.encode(t.rangeTo,0,t.rangeTo.length):e.bytes===Array?Array.prototype.slice.call(t.rangeTo):t.rangeTo),t.includeLower!=null&&t.hasOwnProperty("includeLower")&&(r.includeLower=t.includeLower),t.includeUpper!=null&&t.hasOwnProperty("includeUpper")&&(r.includeUpper=t.includeUpper),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.PrefixQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.prefix="",n.prototype.weight=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.prefix!=null&&Object.hasOwnProperty.call(t,"prefix")&&e.uint32(18).string(t.prefix),t.weight!=null&&Object.hasOwnProperty.call(t,"weight")&&e.uint32(29).float(t.weight),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.PrefixQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.prefix=t.string();break;case 3:i.weight=t.float();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.prefix!=null&&t.hasOwnProperty("prefix")&&!$util.isString(t.prefix)?"prefix: string expected":t.weight!=null&&t.hasOwnProperty("weight")&&typeof t.weight!="number"?"weight: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.PrefixQuery)return t;var e=new $root.search.proto.PrefixQuery;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.prefix!=null&&(e.prefix=String(t.prefix)),t.weight!=null&&(e.weight=Number(t.weight)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",r.prefix="",r.weight=0),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.prefix!=null&&t.hasOwnProperty("prefix")&&(r.prefix=t.prefix),t.weight!=null&&t.hasOwnProperty("weight")&&(r.weight=e.json&&!isFinite(t.weight)?String(t.weight):t.weight),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.WildcardQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.value="",n.prototype.weight=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&e.uint32(18).string(t.value),t.weight!=null&&Object.hasOwnProperty.call(t,"weight")&&e.uint32(29).float(t.weight),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.WildcardQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.value=t.string();break;case 3:i.weight=t.float();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.value!=null&&t.hasOwnProperty("value")&&!$util.isString(t.value)?"value: string expected":t.weight!=null&&t.hasOwnProperty("weight")&&typeof t.weight!="number"?"weight: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.WildcardQuery)return t;var e=new $root.search.proto.WildcardQuery;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.value!=null&&(e.value=String(t.value)),t.weight!=null&&(e.weight=Number(t.weight)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",r.value="",r.weight=0),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.value!=null&&t.hasOwnProperty("value")&&(r.value=t.value),t.weight!=null&&t.hasOwnProperty("weight")&&(r.weight=e.json&&!isFinite(t.weight)?String(t.weight):t.weight),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.BoolQuery=function(){function n(o){if(this.mustQueries=[],this.mustNotQueries=[],this.filterQueries=[],this.shouldQueries=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.mustQueries=$util.emptyArray,n.prototype.mustNotQueries=$util.emptyArray,n.prototype.filterQueries=$util.emptyArray,n.prototype.shouldQueries=$util.emptyArray,n.prototype.minimumShouldMatch=0,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.mustQueries!=null&&t.mustQueries.length)for(var r=0;r<t.mustQueries.length;++r)$root.search.proto.Query.encode(t.mustQueries[r],e.uint32(10).fork()).ldelim();if(t.mustNotQueries!=null&&t.mustNotQueries.length)for(var r=0;r<t.mustNotQueries.length;++r)$root.search.proto.Query.encode(t.mustNotQueries[r],e.uint32(18).fork()).ldelim();if(t.filterQueries!=null&&t.filterQueries.length)for(var r=0;r<t.filterQueries.length;++r)$root.search.proto.Query.encode(t.filterQueries[r],e.uint32(26).fork()).ldelim();if(t.shouldQueries!=null&&t.shouldQueries.length)for(var r=0;r<t.shouldQueries.length;++r)$root.search.proto.Query.encode(t.shouldQueries[r],e.uint32(34).fork()).ldelim();return t.minimumShouldMatch!=null&&Object.hasOwnProperty.call(t,"minimumShouldMatch")&&e.uint32(40).int32(t.minimumShouldMatch),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.BoolQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.mustQueries&&i.mustQueries.length||(i.mustQueries=[]),i.mustQueries.push($root.search.proto.Query.decode(t,t.uint32()));break;case 2:i.mustNotQueries&&i.mustNotQueries.length||(i.mustNotQueries=[]),i.mustNotQueries.push($root.search.proto.Query.decode(t,t.uint32()));break;case 3:i.filterQueries&&i.filterQueries.length||(i.filterQueries=[]),i.filterQueries.push($root.search.proto.Query.decode(t,t.uint32()));break;case 4:i.shouldQueries&&i.shouldQueries.length||(i.shouldQueries=[]),i.shouldQueries.push($root.search.proto.Query.decode(t,t.uint32()));break;case 5:i.minimumShouldMatch=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.mustQueries!=null&&t.hasOwnProperty("mustQueries")){if(!Array.isArray(t.mustQueries))return"mustQueries: array expected";for(var e=0;e<t.mustQueries.length;++e){var r=$root.search.proto.Query.verify(t.mustQueries[e]);if(r)return"mustQueries."+r}}if(t.mustNotQueries!=null&&t.hasOwnProperty("mustNotQueries")){if(!Array.isArray(t.mustNotQueries))return"mustNotQueries: array expected";for(var e=0;e<t.mustNotQueries.length;++e){var r=$root.search.proto.Query.verify(t.mustNotQueries[e]);if(r)return"mustNotQueries."+r}}if(t.filterQueries!=null&&t.hasOwnProperty("filterQueries")){if(!Array.isArray(t.filterQueries))return"filterQueries: array expected";for(var e=0;e<t.filterQueries.length;++e){var r=$root.search.proto.Query.verify(t.filterQueries[e]);if(r)return"filterQueries."+r}}if(t.shouldQueries!=null&&t.hasOwnProperty("shouldQueries")){if(!Array.isArray(t.shouldQueries))return"shouldQueries: array expected";for(var e=0;e<t.shouldQueries.length;++e){var r=$root.search.proto.Query.verify(t.shouldQueries[e]);if(r)return"shouldQueries."+r}}return t.minimumShouldMatch!=null&&t.hasOwnProperty("minimumShouldMatch")&&!$util.isInteger(t.minimumShouldMatch)?"minimumShouldMatch: integer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.BoolQuery)return t;var e=new $root.search.proto.BoolQuery;if(t.mustQueries){if(!Array.isArray(t.mustQueries))throw TypeError(".search.proto.BoolQuery.mustQueries: array expected");e.mustQueries=[];for(var r=0;r<t.mustQueries.length;++r){if(typeof t.mustQueries[r]!="object")throw TypeError(".search.proto.BoolQuery.mustQueries: object expected");e.mustQueries[r]=$root.search.proto.Query.fromObject(t.mustQueries[r])}}if(t.mustNotQueries){if(!Array.isArray(t.mustNotQueries))throw TypeError(".search.proto.BoolQuery.mustNotQueries: array expected");e.mustNotQueries=[];for(var r=0;r<t.mustNotQueries.length;++r){if(typeof t.mustNotQueries[r]!="object")throw TypeError(".search.proto.BoolQuery.mustNotQueries: object expected");e.mustNotQueries[r]=$root.search.proto.Query.fromObject(t.mustNotQueries[r])}}if(t.filterQueries){if(!Array.isArray(t.filterQueries))throw TypeError(".search.proto.BoolQuery.filterQueries: array expected");e.filterQueries=[];for(var r=0;r<t.filterQueries.length;++r){if(typeof t.filterQueries[r]!="object")throw TypeError(".search.proto.BoolQuery.filterQueries: object expected");e.filterQueries[r]=$root.search.proto.Query.fromObject(t.filterQueries[r])}}if(t.shouldQueries){if(!Array.isArray(t.shouldQueries))throw TypeError(".search.proto.BoolQuery.shouldQueries: array expected");e.shouldQueries=[];for(var r=0;r<t.shouldQueries.length;++r){if(typeof t.shouldQueries[r]!="object")throw TypeError(".search.proto.BoolQuery.shouldQueries: object expected");e.shouldQueries[r]=$root.search.proto.Query.fromObject(t.shouldQueries[r])}}return t.minimumShouldMatch!=null&&(e.minimumShouldMatch=t.minimumShouldMatch|0),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.mustQueries=[],r.mustNotQueries=[],r.filterQueries=[],r.shouldQueries=[]),e.defaults&&(r.minimumShouldMatch=0),t.mustQueries&&t.mustQueries.length){r.mustQueries=[];for(var i=0;i<t.mustQueries.length;++i)r.mustQueries[i]=$root.search.proto.Query.toObject(t.mustQueries[i],e)}if(t.mustNotQueries&&t.mustNotQueries.length){r.mustNotQueries=[];for(var i=0;i<t.mustNotQueries.length;++i)r.mustNotQueries[i]=$root.search.proto.Query.toObject(t.mustNotQueries[i],e)}if(t.filterQueries&&t.filterQueries.length){r.filterQueries=[];for(var i=0;i<t.filterQueries.length;++i)r.filterQueries[i]=$root.search.proto.Query.toObject(t.filterQueries[i],e)}if(t.shouldQueries&&t.shouldQueries.length){r.shouldQueries=[];for(var i=0;i<t.shouldQueries.length;++i)r.shouldQueries[i]=$root.search.proto.Query.toObject(t.shouldQueries[i],e)}return t.minimumShouldMatch!=null&&t.hasOwnProperty("minimumShouldMatch")&&(r.minimumShouldMatch=t.minimumShouldMatch),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ConstScoreQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.filter=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.filter!=null&&Object.hasOwnProperty.call(t,"filter")&&$root.search.proto.Query.encode(t.filter,e.uint32(10).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.ConstScoreQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.filter=$root.search.proto.Query.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.filter!=null&&t.hasOwnProperty("filter")){var e=$root.search.proto.Query.verify(t.filter);if(e)return"filter."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.ConstScoreQuery)return t;var e=new $root.search.proto.ConstScoreQuery;if(t.filter!=null){if(typeof t.filter!="object")throw TypeError(".search.proto.ConstScoreQuery.filter: object expected");e.filter=$root.search.proto.Query.fromObject(t.filter)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.filter=null),t.filter!=null&&t.hasOwnProperty("filter")&&(r.filter=$root.search.proto.Query.toObject(t.filter,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.FieldValueFactor=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.FieldValueFactor;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.FieldValueFactor)return t;var e=new $root.search.proto.FieldValueFactor;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName=""),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.FunctionScoreQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.query=null,n.prototype.fieldValueFactor=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.query!=null&&Object.hasOwnProperty.call(t,"query")&&$root.search.proto.Query.encode(t.query,e.uint32(10).fork()).ldelim(),t.fieldValueFactor!=null&&Object.hasOwnProperty.call(t,"fieldValueFactor")&&$root.search.proto.FieldValueFactor.encode(t.fieldValueFactor,e.uint32(18).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.FunctionScoreQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.query=$root.search.proto.Query.decode(t,t.uint32());break;case 2:i.fieldValueFactor=$root.search.proto.FieldValueFactor.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.query!=null&&t.hasOwnProperty("query")){var e=$root.search.proto.Query.verify(t.query);if(e)return"query."+e}if(t.fieldValueFactor!=null&&t.hasOwnProperty("fieldValueFactor")){var e=$root.search.proto.FieldValueFactor.verify(t.fieldValueFactor);if(e)return"fieldValueFactor."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.FunctionScoreQuery)return t;var e=new $root.search.proto.FunctionScoreQuery;if(t.query!=null){if(typeof t.query!="object")throw TypeError(".search.proto.FunctionScoreQuery.query: object expected");e.query=$root.search.proto.Query.fromObject(t.query)}if(t.fieldValueFactor!=null){if(typeof t.fieldValueFactor!="object")throw TypeError(".search.proto.FunctionScoreQuery.fieldValueFactor: object expected");e.fieldValueFactor=$root.search.proto.FieldValueFactor.fromObject(t.fieldValueFactor)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.query=null,r.fieldValueFactor=null),t.query!=null&&t.hasOwnProperty("query")&&(r.query=$root.search.proto.Query.toObject(t.query,e)),t.fieldValueFactor!=null&&t.hasOwnProperty("fieldValueFactor")&&(r.fieldValueFactor=$root.search.proto.FieldValueFactor.toObject(t.fieldValueFactor,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.FunctionsScoreQuery=function(){function n(o){if(this.functions=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.query=null,n.prototype.functions=$util.emptyArray,n.prototype.scoreMode=1,n.prototype.combineMode=1,n.prototype.minScore=0,n.prototype.maxScore=0,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.query!=null&&Object.hasOwnProperty.call(t,"query")&&$root.search.proto.Query.encode(t.query,e.uint32(10).fork()).ldelim(),t.functions!=null&&t.functions.length)for(var r=0;r<t.functions.length;++r)$root.search.proto.Function.encode(t.functions[r],e.uint32(18).fork()).ldelim();return t.scoreMode!=null&&Object.hasOwnProperty.call(t,"scoreMode")&&e.uint32(24).int32(t.scoreMode),t.combineMode!=null&&Object.hasOwnProperty.call(t,"combineMode")&&e.uint32(32).int32(t.combineMode),t.minScore!=null&&Object.hasOwnProperty.call(t,"minScore")&&e.uint32(45).float(t.minScore),t.maxScore!=null&&Object.hasOwnProperty.call(t,"maxScore")&&e.uint32(53).float(t.maxScore),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.FunctionsScoreQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.query=$root.search.proto.Query.decode(t,t.uint32());break;case 2:i.functions&&i.functions.length||(i.functions=[]),i.functions.push($root.search.proto.Function.decode(t,t.uint32()));break;case 3:i.scoreMode=t.int32();break;case 4:i.combineMode=t.int32();break;case 5:i.minScore=t.float();break;case 6:i.maxScore=t.float();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.query!=null&&t.hasOwnProperty("query")){var e=$root.search.proto.Query.verify(t.query);if(e)return"query."+e}if(t.functions!=null&&t.hasOwnProperty("functions")){if(!Array.isArray(t.functions))return"functions: array expected";for(var r=0;r<t.functions.length;++r){var e=$root.search.proto.Function.verify(t.functions[r]);if(e)return"functions."+e}}if(t.scoreMode!=null&&t.hasOwnProperty("scoreMode"))switch(t.scoreMode){default:return"scoreMode: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:break}if(t.combineMode!=null&&t.hasOwnProperty("combineMode"))switch(t.combineMode){default:return"combineMode: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:break}return t.minScore!=null&&t.hasOwnProperty("minScore")&&typeof t.minScore!="number"?"minScore: number expected":t.maxScore!=null&&t.hasOwnProperty("maxScore")&&typeof t.maxScore!="number"?"maxScore: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.FunctionsScoreQuery)return t;var e=new $root.search.proto.FunctionsScoreQuery;if(t.query!=null){if(typeof t.query!="object")throw TypeError(".search.proto.FunctionsScoreQuery.query: object expected");e.query=$root.search.proto.Query.fromObject(t.query)}if(t.functions){if(!Array.isArray(t.functions))throw TypeError(".search.proto.FunctionsScoreQuery.functions: array expected");e.functions=[];for(var r=0;r<t.functions.length;++r){if(typeof t.functions[r]!="object")throw TypeError(".search.proto.FunctionsScoreQuery.functions: object expected");e.functions[r]=$root.search.proto.Function.fromObject(t.functions[r])}}switch(t.scoreMode){case"FSM_AVG":case 1:e.scoreMode=1;break;case"FSM_MAX":case 2:e.scoreMode=2;break;case"FSM_SUM":case 3:e.scoreMode=3;break;case"FSM_MIN":case 4:e.scoreMode=4;break;case"FSM_MULTIPLY":case 5:e.scoreMode=5;break;case"FSM_FIRST":case 6:e.scoreMode=6;break}switch(t.combineMode){case"FCM_MULTIPLY":case 1:e.combineMode=1;break;case"FCM_AVG":case 2:e.combineMode=2;break;case"FCM_MAX":case 3:e.combineMode=3;break;case"FCM_SUM":case 4:e.combineMode=4;break;case"FCM_MIN":case 5:e.combineMode=5;break;case"FCM_REPLACE":case 6:e.combineMode=6;break}return t.minScore!=null&&(e.minScore=Number(t.minScore)),t.maxScore!=null&&(e.maxScore=Number(t.maxScore)),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.functions=[]),e.defaults&&(r.query=null,r.scoreMode=e.enums===String?"FSM_AVG":1,r.combineMode=e.enums===String?"FCM_MULTIPLY":1,r.minScore=0,r.maxScore=0),t.query!=null&&t.hasOwnProperty("query")&&(r.query=$root.search.proto.Query.toObject(t.query,e)),t.functions&&t.functions.length){r.functions=[];for(var i=0;i<t.functions.length;++i)r.functions[i]=$root.search.proto.Function.toObject(t.functions[i],e)}return t.scoreMode!=null&&t.hasOwnProperty("scoreMode")&&(r.scoreMode=e.enums===String?$root.search.proto.FunctionScoreMode[t.scoreMode]:t.scoreMode),t.combineMode!=null&&t.hasOwnProperty("combineMode")&&(r.combineMode=e.enums===String?$root.search.proto.FunctionCombineMode[t.combineMode]:t.combineMode),t.minScore!=null&&t.hasOwnProperty("minScore")&&(r.minScore=e.json&&!isFinite(t.minScore)?String(t.minScore):t.minScore),t.maxScore!=null&&t.hasOwnProperty("maxScore")&&(r.maxScore=e.json&&!isFinite(t.maxScore)?String(t.maxScore):t.maxScore),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.Function=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldValueFactor=null,n.prototype.random=null,n.prototype.decay=null,n.prototype.weight=0,n.prototype.filter=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldValueFactor!=null&&Object.hasOwnProperty.call(t,"fieldValueFactor")&&$root.search.proto.FieldValueFactorFunction.encode(t.fieldValueFactor,e.uint32(10).fork()).ldelim(),t.random!=null&&Object.hasOwnProperty.call(t,"random")&&$root.search.proto.RandomScoreFunction.encode(t.random,e.uint32(18).fork()).ldelim(),t.decay!=null&&Object.hasOwnProperty.call(t,"decay")&&$root.search.proto.DecayFunction.encode(t.decay,e.uint32(26).fork()).ldelim(),t.weight!=null&&Object.hasOwnProperty.call(t,"weight")&&e.uint32(37).float(t.weight),t.filter!=null&&Object.hasOwnProperty.call(t,"filter")&&$root.search.proto.Query.encode(t.filter,e.uint32(42).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.Function;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldValueFactor=$root.search.proto.FieldValueFactorFunction.decode(t,t.uint32());break;case 2:i.random=$root.search.proto.RandomScoreFunction.decode(t,t.uint32());break;case 3:i.decay=$root.search.proto.DecayFunction.decode(t,t.uint32());break;case 4:i.weight=t.float();break;case 5:i.filter=$root.search.proto.Query.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldValueFactor!=null&&t.hasOwnProperty("fieldValueFactor")){var e=$root.search.proto.FieldValueFactorFunction.verify(t.fieldValueFactor);if(e)return"fieldValueFactor."+e}if(t.random!=null&&t.hasOwnProperty("random")){var e=$root.search.proto.RandomScoreFunction.verify(t.random);if(e)return"random."+e}if(t.decay!=null&&t.hasOwnProperty("decay")){var e=$root.search.proto.DecayFunction.verify(t.decay);if(e)return"decay."+e}if(t.weight!=null&&t.hasOwnProperty("weight")&&typeof t.weight!="number")return"weight: number expected";if(t.filter!=null&&t.hasOwnProperty("filter")){var e=$root.search.proto.Query.verify(t.filter);if(e)return"filter."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.Function)return t;var e=new $root.search.proto.Function;if(t.fieldValueFactor!=null){if(typeof t.fieldValueFactor!="object")throw TypeError(".search.proto.Function.fieldValueFactor: object expected");e.fieldValueFactor=$root.search.proto.FieldValueFactorFunction.fromObject(t.fieldValueFactor)}if(t.random!=null){if(typeof t.random!="object")throw TypeError(".search.proto.Function.random: object expected");e.random=$root.search.proto.RandomScoreFunction.fromObject(t.random)}if(t.decay!=null){if(typeof t.decay!="object")throw TypeError(".search.proto.Function.decay: object expected");e.decay=$root.search.proto.DecayFunction.fromObject(t.decay)}if(t.weight!=null&&(e.weight=Number(t.weight)),t.filter!=null){if(typeof t.filter!="object")throw TypeError(".search.proto.Function.filter: object expected");e.filter=$root.search.proto.Query.fromObject(t.filter)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldValueFactor=null,r.random=null,r.decay=null,r.weight=0,r.filter=null),t.fieldValueFactor!=null&&t.hasOwnProperty("fieldValueFactor")&&(r.fieldValueFactor=$root.search.proto.FieldValueFactorFunction.toObject(t.fieldValueFactor,e)),t.random!=null&&t.hasOwnProperty("random")&&(r.random=$root.search.proto.RandomScoreFunction.toObject(t.random,e)),t.decay!=null&&t.hasOwnProperty("decay")&&(r.decay=$root.search.proto.DecayFunction.toObject(t.decay,e)),t.weight!=null&&t.hasOwnProperty("weight")&&(r.weight=e.json&&!isFinite(t.weight)?String(t.weight):t.weight),t.filter!=null&&t.hasOwnProperty("filter")&&(r.filter=$root.search.proto.Query.toObject(t.filter,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.FieldValueFactorFunction=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.factor=0,n.prototype.modifier=1,n.prototype.missing=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.factor!=null&&Object.hasOwnProperty.call(t,"factor")&&e.uint32(21).float(t.factor),t.modifier!=null&&Object.hasOwnProperty.call(t,"modifier")&&e.uint32(24).int32(t.modifier),t.missing!=null&&Object.hasOwnProperty.call(t,"missing")&&e.uint32(33).double(t.missing),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.FieldValueFactorFunction;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.factor=t.float();break;case 3:i.modifier=t.int32();break;case 4:i.missing=t.double();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.factor!=null&&t.hasOwnProperty("factor")&&typeof t.factor!="number")return"factor: number expected";if(t.modifier!=null&&t.hasOwnProperty("modifier"))switch(t.modifier){default:return"modifier: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:break}return t.missing!=null&&t.hasOwnProperty("missing")&&typeof t.missing!="number"?"missing: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.FieldValueFactorFunction)return t;var e=new $root.search.proto.FieldValueFactorFunction;switch(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.factor!=null&&(e.factor=Number(t.factor)),t.modifier){case"FM_NONE":case 1:e.modifier=1;break;case"FM_LOG":case 2:e.modifier=2;break;case"FM_LOG1P":case 3:e.modifier=3;break;case"FM_LOG2P":case 4:e.modifier=4;break;case"FM_LN":case 5:e.modifier=5;break;case"FM_LN1P":case 6:e.modifier=6;break;case"FM_LN2P":case 7:e.modifier=7;break;case"FM_SQUARE":case 8:e.modifier=8;break;case"FM_SQRT":case 9:e.modifier=9;break;case"FM_RECIPROCAL":case 10:e.modifier=10;break}return t.missing!=null&&(e.missing=Number(t.missing)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",r.factor=0,r.modifier=e.enums===String?"FM_NONE":1,r.missing=0),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.factor!=null&&t.hasOwnProperty("factor")&&(r.factor=e.json&&!isFinite(t.factor)?String(t.factor):t.factor),t.modifier!=null&&t.hasOwnProperty("modifier")&&(r.modifier=e.enums===String?$root.search.proto.FunctionModifier[t.modifier]:t.modifier),t.missing!=null&&t.hasOwnProperty("missing")&&(r.missing=e.json&&!isFinite(t.missing)?String(t.missing):t.missing),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.FunctionModifier=function(){var n={},o=Object.create(n);return o[n[1]="FM_NONE"]=1,o[n[2]="FM_LOG"]=2,o[n[3]="FM_LOG1P"]=3,o[n[4]="FM_LOG2P"]=4,o[n[5]="FM_LN"]=5,o[n[6]="FM_LN1P"]=6,o[n[7]="FM_LN2P"]=7,o[n[8]="FM_SQUARE"]=8,o[n[9]="FM_SQRT"]=9,o[n[10]="FM_RECIPROCAL"]=10,o}(),c.DecayFunction=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.mathFunction=1,n.prototype.paramType=1,n.prototype.param=$util.newBuffer([]),n.prototype.decay=0,n.prototype.multiValueMode=1,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.mathFunction!=null&&Object.hasOwnProperty.call(t,"mathFunction")&&e.uint32(16).int32(t.mathFunction),t.paramType!=null&&Object.hasOwnProperty.call(t,"paramType")&&e.uint32(24).int32(t.paramType),t.param!=null&&Object.hasOwnProperty.call(t,"param")&&e.uint32(34).bytes(t.param),t.decay!=null&&Object.hasOwnProperty.call(t,"decay")&&e.uint32(41).double(t.decay),t.multiValueMode!=null&&Object.hasOwnProperty.call(t,"multiValueMode")&&e.uint32(48).int32(t.multiValueMode),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DecayFunction;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.mathFunction=t.int32();break;case 3:i.paramType=t.int32();break;case 4:i.param=t.bytes();break;case 5:i.decay=t.double();break;case 6:i.multiValueMode=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.mathFunction!=null&&t.hasOwnProperty("mathFunction"))switch(t.mathFunction){default:return"mathFunction: enum value expected";case 1:case 2:case 3:break}if(t.paramType!=null&&t.hasOwnProperty("paramType"))switch(t.paramType){default:return"paramType: enum value expected";case 1:case 2:case 3:break}if(t.param!=null&&t.hasOwnProperty("param")&&!(t.param&&typeof t.param.length=="number"||$util.isString(t.param)))return"param: buffer expected";if(t.decay!=null&&t.hasOwnProperty("decay")&&typeof t.decay!="number")return"decay: number expected";if(t.multiValueMode!=null&&t.hasOwnProperty("multiValueMode"))switch(t.multiValueMode){default:return"multiValueMode: enum value expected";case 1:case 2:case 3:case 4:break}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.DecayFunction)return t;var e=new $root.search.proto.DecayFunction;switch(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.mathFunction){case"GAUSS":case 1:e.mathFunction=1;break;case"EXP":case 2:e.mathFunction=2;break;case"LINEAR":case 3:e.mathFunction=3;break}switch(t.paramType){case"DF_DATE_PARAM":case 1:e.paramType=1;break;case"DF_NUMERIC_PARAM":case 2:e.paramType=2;break;case"DF_GEO_PARAM":case 3:e.paramType=3;break}switch(t.param!=null&&(typeof t.param=="string"?$util.base64.decode(t.param,e.param=$util.newBuffer($util.base64.length(t.param)),0):t.param.length&&(e.param=t.param)),t.decay!=null&&(e.decay=Number(t.decay)),t.multiValueMode){case"MVM_MAX":case 1:e.multiValueMode=1;break;case"MVM_MIN":case 2:e.multiValueMode=2;break;case"MVM_SUM":case 3:e.multiValueMode=3;break;case"MVM_AVG":case 4:e.multiValueMode=4;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",r.mathFunction=e.enums===String?"GAUSS":1,r.paramType=e.enums===String?"DF_DATE_PARAM":1,e.bytes===String?r.param="":(r.param=[],e.bytes!==Array&&(r.param=$util.newBuffer(r.param))),r.decay=0,r.multiValueMode=e.enums===String?"MVM_MAX":1),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.mathFunction!=null&&t.hasOwnProperty("mathFunction")&&(r.mathFunction=e.enums===String?$root.search.proto.DecayMathFunction[t.mathFunction]:t.mathFunction),t.paramType!=null&&t.hasOwnProperty("paramType")&&(r.paramType=e.enums===String?$root.search.proto.DecayFuncParamType[t.paramType]:t.paramType),t.param!=null&&t.hasOwnProperty("param")&&(r.param=e.bytes===String?$util.base64.encode(t.param,0,t.param.length):e.bytes===Array?Array.prototype.slice.call(t.param):t.param),t.decay!=null&&t.hasOwnProperty("decay")&&(r.decay=e.json&&!isFinite(t.decay)?String(t.decay):t.decay),t.multiValueMode!=null&&t.hasOwnProperty("multiValueMode")&&(r.multiValueMode=e.enums===String?$root.search.proto.MultiValueMode[t.multiValueMode]:t.multiValueMode),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DecayFuncParamType=function(){var n={},o=Object.create(n);return o[n[1]="DF_DATE_PARAM"]=1,o[n[2]="DF_NUMERIC_PARAM"]=2,o[n[3]="DF_GEO_PARAM"]=3,o}(),c.DecayFuncDateParam=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.originLong=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.originString="",n.prototype.scale=null,n.prototype.offset=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.originLong!=null&&Object.hasOwnProperty.call(t,"originLong")&&e.uint32(8).int64(t.originLong),t.originString!=null&&Object.hasOwnProperty.call(t,"originString")&&e.uint32(18).string(t.originString),t.scale!=null&&Object.hasOwnProperty.call(t,"scale")&&$root.search.proto.DateTimeValue.encode(t.scale,e.uint32(26).fork()).ldelim(),t.offset!=null&&Object.hasOwnProperty.call(t,"offset")&&$root.search.proto.DateTimeValue.encode(t.offset,e.uint32(34).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DecayFuncDateParam;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.originLong=t.int64();break;case 2:i.originString=t.string();break;case 3:i.scale=$root.search.proto.DateTimeValue.decode(t,t.uint32());break;case 4:i.offset=$root.search.proto.DateTimeValue.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.originLong!=null&&t.hasOwnProperty("originLong")&&!$util.isInteger(t.originLong)&&!(t.originLong&&$util.isInteger(t.originLong.low)&&$util.isInteger(t.originLong.high)))return"originLong: integer|Long expected";if(t.originString!=null&&t.hasOwnProperty("originString")&&!$util.isString(t.originString))return"originString: string expected";if(t.scale!=null&&t.hasOwnProperty("scale")){var e=$root.search.proto.DateTimeValue.verify(t.scale);if(e)return"scale."+e}if(t.offset!=null&&t.hasOwnProperty("offset")){var e=$root.search.proto.DateTimeValue.verify(t.offset);if(e)return"offset."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.DecayFuncDateParam)return t;var e=new $root.search.proto.DecayFuncDateParam;if(t.originLong!=null&&($util.Long?(e.originLong=$util.Long.fromValue(t.originLong)).unsigned=!1:typeof t.originLong=="string"?e.originLong=parseInt(t.originLong,10):typeof t.originLong=="number"?e.originLong=t.originLong:typeof t.originLong=="object"&&(e.originLong=new $util.LongBits(t.originLong.low>>>0,t.originLong.high>>>0).toNumber())),t.originString!=null&&(e.originString=String(t.originString)),t.scale!=null){if(typeof t.scale!="object")throw TypeError(".search.proto.DecayFuncDateParam.scale: object expected");e.scale=$root.search.proto.DateTimeValue.fromObject(t.scale)}if(t.offset!=null){if(typeof t.offset!="object")throw TypeError(".search.proto.DecayFuncDateParam.offset: object expected");e.offset=$root.search.proto.DateTimeValue.fromObject(t.offset)}return e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if($util.Long){var i=new $util.Long(0,0,!1);r.originLong=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.originLong=e.longs===String?"0":0;r.originString="",r.scale=null,r.offset=null}return t.originLong!=null&&t.hasOwnProperty("originLong")&&(typeof t.originLong=="number"?r.originLong=e.longs===String?String(t.originLong):t.originLong:r.originLong=e.longs===String?$util.Long.prototype.toString.call(t.originLong):e.longs===Number?new $util.LongBits(t.originLong.low>>>0,t.originLong.high>>>0).toNumber():t.originLong),t.originString!=null&&t.hasOwnProperty("originString")&&(r.originString=t.originString),t.scale!=null&&t.hasOwnProperty("scale")&&(r.scale=$root.search.proto.DateTimeValue.toObject(t.scale,e)),t.offset!=null&&t.hasOwnProperty("offset")&&(r.offset=$root.search.proto.DateTimeValue.toObject(t.offset,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DecayFuncNumericParam=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.origin=0,n.prototype.scale=0,n.prototype.offset=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.origin!=null&&Object.hasOwnProperty.call(t,"origin")&&e.uint32(9).double(t.origin),t.scale!=null&&Object.hasOwnProperty.call(t,"scale")&&e.uint32(17).double(t.scale),t.offset!=null&&Object.hasOwnProperty.call(t,"offset")&&e.uint32(25).double(t.offset),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DecayFuncNumericParam;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.origin=t.double();break;case 2:i.scale=t.double();break;case 3:i.offset=t.double();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.origin!=null&&t.hasOwnProperty("origin")&&typeof t.origin!="number"?"origin: number expected":t.scale!=null&&t.hasOwnProperty("scale")&&typeof t.scale!="number"?"scale: number expected":t.offset!=null&&t.hasOwnProperty("offset")&&typeof t.offset!="number"?"offset: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.DecayFuncNumericParam)return t;var e=new $root.search.proto.DecayFuncNumericParam;return t.origin!=null&&(e.origin=Number(t.origin)),t.scale!=null&&(e.scale=Number(t.scale)),t.offset!=null&&(e.offset=Number(t.offset)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.origin=0,r.scale=0,r.offset=0),t.origin!=null&&t.hasOwnProperty("origin")&&(r.origin=e.json&&!isFinite(t.origin)?String(t.origin):t.origin),t.scale!=null&&t.hasOwnProperty("scale")&&(r.scale=e.json&&!isFinite(t.scale)?String(t.scale):t.scale),t.offset!=null&&t.hasOwnProperty("offset")&&(r.offset=e.json&&!isFinite(t.offset)?String(t.offset):t.offset),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DecayFuncGeoParam=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.origin="",n.prototype.scale=0,n.prototype.offset=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.origin!=null&&Object.hasOwnProperty.call(t,"origin")&&e.uint32(10).string(t.origin),t.scale!=null&&Object.hasOwnProperty.call(t,"scale")&&e.uint32(17).double(t.scale),t.offset!=null&&Object.hasOwnProperty.call(t,"offset")&&e.uint32(25).double(t.offset),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DecayFuncGeoParam;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.origin=t.string();break;case 2:i.scale=t.double();break;case 3:i.offset=t.double();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.origin!=null&&t.hasOwnProperty("origin")&&!$util.isString(t.origin)?"origin: string expected":t.scale!=null&&t.hasOwnProperty("scale")&&typeof t.scale!="number"?"scale: number expected":t.offset!=null&&t.hasOwnProperty("offset")&&typeof t.offset!="number"?"offset: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.DecayFuncGeoParam)return t;var e=new $root.search.proto.DecayFuncGeoParam;return t.origin!=null&&(e.origin=String(t.origin)),t.scale!=null&&(e.scale=Number(t.scale)),t.offset!=null&&(e.offset=Number(t.offset)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.origin="",r.scale=0,r.offset=0),t.origin!=null&&t.hasOwnProperty("origin")&&(r.origin=t.origin),t.scale!=null&&t.hasOwnProperty("scale")&&(r.scale=e.json&&!isFinite(t.scale)?String(t.scale):t.scale),t.offset!=null&&t.hasOwnProperty("offset")&&(r.offset=e.json&&!isFinite(t.offset)?String(t.offset):t.offset),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DecayMathFunction=function(){var n={},o=Object.create(n);return o[n[1]="GAUSS"]=1,o[n[2]="EXP"]=2,o[n[3]="LINEAR"]=3,o}(),c.MultiValueMode=function(){var n={},o=Object.create(n);return o[n[1]="MVM_MAX"]=1,o[n[2]="MVM_MIN"]=2,o[n[3]="MVM_SUM"]=3,o[n[4]="MVM_AVG"]=4,o}(),c.RandomScoreFunction=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.RandomScoreFunction;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.search.proto.RandomScoreFunction?t:new $root.search.proto.RandomScoreFunction},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.FunctionScoreMode=function(){var n={},o=Object.create(n);return o[n[1]="FSM_AVG"]=1,o[n[2]="FSM_MAX"]=2,o[n[3]="FSM_SUM"]=3,o[n[4]="FSM_MIN"]=4,o[n[5]="FSM_MULTIPLY"]=5,o[n[6]="FSM_FIRST"]=6,o}(),c.FunctionCombineMode=function(){var n={},o=Object.create(n);return o[n[1]="FCM_MULTIPLY"]=1,o[n[2]="FCM_AVG"]=2,o[n[3]="FCM_MAX"]=3,o[n[4]="FCM_SUM"]=4,o[n[5]="FCM_MIN"]=5,o[n[6]="FCM_REPLACE"]=6,o}(),c.ScoreMode=function(){var n={},o=Object.create(n);return o[n[1]="SCORE_MODE_NONE"]=1,o[n[2]="SCORE_MODE_AVG"]=2,o[n[3]="SCORE_MODE_MAX"]=3,o[n[4]="SCORE_MODE_TOTAL"]=4,o[n[5]="SCORE_MODE_MIN"]=5,o}(),c.NestedQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.path="",n.prototype.query=null,n.prototype.scoreMode=1,n.prototype.weight=0,n.prototype.innerHits=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.path!=null&&Object.hasOwnProperty.call(t,"path")&&e.uint32(10).string(t.path),t.query!=null&&Object.hasOwnProperty.call(t,"query")&&$root.search.proto.Query.encode(t.query,e.uint32(18).fork()).ldelim(),t.scoreMode!=null&&Object.hasOwnProperty.call(t,"scoreMode")&&e.uint32(24).int32(t.scoreMode),t.weight!=null&&Object.hasOwnProperty.call(t,"weight")&&e.uint32(37).float(t.weight),t.innerHits!=null&&Object.hasOwnProperty.call(t,"innerHits")&&$root.search.proto.InnerHits.encode(t.innerHits,e.uint32(42).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.NestedQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.path=t.string();break;case 2:i.query=$root.search.proto.Query.decode(t,t.uint32());break;case 3:i.scoreMode=t.int32();break;case 4:i.weight=t.float();break;case 5:i.innerHits=$root.search.proto.InnerHits.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.path!=null&&t.hasOwnProperty("path")&&!$util.isString(t.path))return"path: string expected";if(t.query!=null&&t.hasOwnProperty("query")){var e=$root.search.proto.Query.verify(t.query);if(e)return"query."+e}if(t.scoreMode!=null&&t.hasOwnProperty("scoreMode"))switch(t.scoreMode){default:return"scoreMode: enum value expected";case 1:case 2:case 3:case 4:case 5:break}if(t.weight!=null&&t.hasOwnProperty("weight")&&typeof t.weight!="number")return"weight: number expected";if(t.innerHits!=null&&t.hasOwnProperty("innerHits")){var e=$root.search.proto.InnerHits.verify(t.innerHits);if(e)return"innerHits."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.NestedQuery)return t;var e=new $root.search.proto.NestedQuery;if(t.path!=null&&(e.path=String(t.path)),t.query!=null){if(typeof t.query!="object")throw TypeError(".search.proto.NestedQuery.query: object expected");e.query=$root.search.proto.Query.fromObject(t.query)}switch(t.scoreMode){case"SCORE_MODE_NONE":case 1:e.scoreMode=1;break;case"SCORE_MODE_AVG":case 2:e.scoreMode=2;break;case"SCORE_MODE_MAX":case 3:e.scoreMode=3;break;case"SCORE_MODE_TOTAL":case 4:e.scoreMode=4;break;case"SCORE_MODE_MIN":case 5:e.scoreMode=5;break}if(t.weight!=null&&(e.weight=Number(t.weight)),t.innerHits!=null){if(typeof t.innerHits!="object")throw TypeError(".search.proto.NestedQuery.innerHits: object expected");e.innerHits=$root.search.proto.InnerHits.fromObject(t.innerHits)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.path="",r.query=null,r.scoreMode=e.enums===String?"SCORE_MODE_NONE":1,r.weight=0,r.innerHits=null),t.path!=null&&t.hasOwnProperty("path")&&(r.path=t.path),t.query!=null&&t.hasOwnProperty("query")&&(r.query=$root.search.proto.Query.toObject(t.query,e)),t.scoreMode!=null&&t.hasOwnProperty("scoreMode")&&(r.scoreMode=e.enums===String?$root.search.proto.ScoreMode[t.scoreMode]:t.scoreMode),t.weight!=null&&t.hasOwnProperty("weight")&&(r.weight=e.json&&!isFinite(t.weight)?String(t.weight):t.weight),t.innerHits!=null&&t.hasOwnProperty("innerHits")&&(r.innerHits=$root.search.proto.InnerHits.toObject(t.innerHits,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.InnerHits=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.sort=null,n.prototype.offset=0,n.prototype.limit=0,n.prototype.highlight=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.sort!=null&&Object.hasOwnProperty.call(t,"sort")&&$root.search.proto.Sort.encode(t.sort,e.uint32(10).fork()).ldelim(),t.offset!=null&&Object.hasOwnProperty.call(t,"offset")&&e.uint32(16).int32(t.offset),t.limit!=null&&Object.hasOwnProperty.call(t,"limit")&&e.uint32(24).int32(t.limit),t.highlight!=null&&Object.hasOwnProperty.call(t,"highlight")&&$root.search.proto.Highlight.encode(t.highlight,e.uint32(34).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.InnerHits;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.sort=$root.search.proto.Sort.decode(t,t.uint32());break;case 2:i.offset=t.int32();break;case 3:i.limit=t.int32();break;case 4:i.highlight=$root.search.proto.Highlight.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.sort!=null&&t.hasOwnProperty("sort")){var e=$root.search.proto.Sort.verify(t.sort);if(e)return"sort."+e}if(t.offset!=null&&t.hasOwnProperty("offset")&&!$util.isInteger(t.offset))return"offset: integer expected";if(t.limit!=null&&t.hasOwnProperty("limit")&&!$util.isInteger(t.limit))return"limit: integer expected";if(t.highlight!=null&&t.hasOwnProperty("highlight")){var e=$root.search.proto.Highlight.verify(t.highlight);if(e)return"highlight."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.InnerHits)return t;var e=new $root.search.proto.InnerHits;if(t.sort!=null){if(typeof t.sort!="object")throw TypeError(".search.proto.InnerHits.sort: object expected");e.sort=$root.search.proto.Sort.fromObject(t.sort)}if(t.offset!=null&&(e.offset=t.offset|0),t.limit!=null&&(e.limit=t.limit|0),t.highlight!=null){if(typeof t.highlight!="object")throw TypeError(".search.proto.InnerHits.highlight: object expected");e.highlight=$root.search.proto.Highlight.fromObject(t.highlight)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.sort=null,r.offset=0,r.limit=0,r.highlight=null),t.sort!=null&&t.hasOwnProperty("sort")&&(r.sort=$root.search.proto.Sort.toObject(t.sort,e)),t.offset!=null&&t.hasOwnProperty("offset")&&(r.offset=t.offset),t.limit!=null&&t.hasOwnProperty("limit")&&(r.limit=t.limit),t.highlight!=null&&t.hasOwnProperty("highlight")&&(r.highlight=$root.search.proto.Highlight.toObject(t.highlight,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GeoBoundingBoxQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.topLeft="",n.prototype.bottomRight="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.topLeft!=null&&Object.hasOwnProperty.call(t,"topLeft")&&e.uint32(18).string(t.topLeft),t.bottomRight!=null&&Object.hasOwnProperty.call(t,"bottomRight")&&e.uint32(26).string(t.bottomRight),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GeoBoundingBoxQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.topLeft=t.string();break;case 3:i.bottomRight=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.topLeft!=null&&t.hasOwnProperty("topLeft")&&!$util.isString(t.topLeft)?"topLeft: string expected":t.bottomRight!=null&&t.hasOwnProperty("bottomRight")&&!$util.isString(t.bottomRight)?"bottomRight: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.GeoBoundingBoxQuery)return t;var e=new $root.search.proto.GeoBoundingBoxQuery;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.topLeft!=null&&(e.topLeft=String(t.topLeft)),t.bottomRight!=null&&(e.bottomRight=String(t.bottomRight)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",r.topLeft="",r.bottomRight=""),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.topLeft!=null&&t.hasOwnProperty("topLeft")&&(r.topLeft=t.topLeft),t.bottomRight!=null&&t.hasOwnProperty("bottomRight")&&(r.bottomRight=t.bottomRight),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GeoDistanceQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.centerPoint="",n.prototype.distance=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.centerPoint!=null&&Object.hasOwnProperty.call(t,"centerPoint")&&e.uint32(18).string(t.centerPoint),t.distance!=null&&Object.hasOwnProperty.call(t,"distance")&&e.uint32(25).double(t.distance),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GeoDistanceQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.centerPoint=t.string();break;case 3:i.distance=t.double();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":t.centerPoint!=null&&t.hasOwnProperty("centerPoint")&&!$util.isString(t.centerPoint)?"centerPoint: string expected":t.distance!=null&&t.hasOwnProperty("distance")&&typeof t.distance!="number"?"distance: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.GeoDistanceQuery)return t;var e=new $root.search.proto.GeoDistanceQuery;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.centerPoint!=null&&(e.centerPoint=String(t.centerPoint)),t.distance!=null&&(e.distance=Number(t.distance)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",r.centerPoint="",r.distance=0),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.centerPoint!=null&&t.hasOwnProperty("centerPoint")&&(r.centerPoint=t.centerPoint),t.distance!=null&&t.hasOwnProperty("distance")&&(r.distance=e.json&&!isFinite(t.distance)?String(t.distance):t.distance),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GeoPolygonQuery=function(){function n(o){if(this.points=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.points=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.points!=null&&t.points.length)for(var r=0;r<t.points.length;++r)e.uint32(18).string(t.points[r]);return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GeoPolygonQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.points&&i.points.length||(i.points=[]),i.points.push(t.string());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.points!=null&&t.hasOwnProperty("points")){if(!Array.isArray(t.points))return"points: array expected";for(var e=0;e<t.points.length;++e)if(!$util.isString(t.points[e]))return"points: string[] expected"}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GeoPolygonQuery)return t;var e=new $root.search.proto.GeoPolygonQuery;if(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.points){if(!Array.isArray(t.points))throw TypeError(".search.proto.GeoPolygonQuery.points: array expected");e.points=[];for(var r=0;r<t.points.length;++r)e.points[r]=String(t.points[r])}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.points=[]),e.defaults&&(r.fieldName=""),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.points&&t.points.length){r.points=[];for(var i=0;i<t.points.length;++i)r.points[i]=t.points[i]}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ExistsQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.ExistsQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.ExistsQuery)return t;var e=new $root.search.proto.ExistsQuery;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName=""),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.KnnVectorQuery=function(){function n(o){if(this.float32QueryVector=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.topK=0,n.prototype.float32QueryVector=$util.emptyArray,n.prototype.filter=null,n.prototype.weight=0,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.topK!=null&&Object.hasOwnProperty.call(t,"topK")&&e.uint32(16).int32(t.topK),t.float32QueryVector!=null&&t.float32QueryVector.length)for(var r=0;r<t.float32QueryVector.length;++r)e.uint32(37).float(t.float32QueryVector[r]);return t.filter!=null&&Object.hasOwnProperty.call(t,"filter")&&$root.search.proto.Query.encode(t.filter,e.uint32(42).fork()).ldelim(),t.weight!=null&&Object.hasOwnProperty.call(t,"weight")&&e.uint32(53).float(t.weight),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.KnnVectorQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.topK=t.int32();break;case 4:if(i.float32QueryVector&&i.float32QueryVector.length||(i.float32QueryVector=[]),(l&7)===2)for(var a=t.uint32()+t.pos;t.pos<a;)i.float32QueryVector.push(t.float());else i.float32QueryVector.push(t.float());break;case 5:i.filter=$root.search.proto.Query.decode(t,t.uint32());break;case 6:i.weight=t.float();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.topK!=null&&t.hasOwnProperty("topK")&&!$util.isInteger(t.topK))return"topK: integer expected";if(t.float32QueryVector!=null&&t.hasOwnProperty("float32QueryVector")){if(!Array.isArray(t.float32QueryVector))return"float32QueryVector: array expected";for(var e=0;e<t.float32QueryVector.length;++e)if(typeof t.float32QueryVector[e]!="number")return"float32QueryVector: number[] expected"}if(t.filter!=null&&t.hasOwnProperty("filter")){var r=$root.search.proto.Query.verify(t.filter);if(r)return"filter."+r}return t.weight!=null&&t.hasOwnProperty("weight")&&typeof t.weight!="number"?"weight: number expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.KnnVectorQuery)return t;var e=new $root.search.proto.KnnVectorQuery;if(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.topK!=null&&(e.topK=t.topK|0),t.float32QueryVector){if(!Array.isArray(t.float32QueryVector))throw TypeError(".search.proto.KnnVectorQuery.float32QueryVector: array expected");e.float32QueryVector=[];for(var r=0;r<t.float32QueryVector.length;++r)e.float32QueryVector[r]=Number(t.float32QueryVector[r])}if(t.filter!=null){if(typeof t.filter!="object")throw TypeError(".search.proto.KnnVectorQuery.filter: object expected");e.filter=$root.search.proto.Query.fromObject(t.filter)}return t.weight!=null&&(e.weight=Number(t.weight)),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.float32QueryVector=[]),e.defaults&&(r.fieldName="",r.topK=0,r.filter=null,r.weight=0),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.topK!=null&&t.hasOwnProperty("topK")&&(r.topK=t.topK),t.float32QueryVector&&t.float32QueryVector.length){r.float32QueryVector=[];for(var i=0;i<t.float32QueryVector.length;++i)r.float32QueryVector[i]=e.json&&!isFinite(t.float32QueryVector[i])?String(t.float32QueryVector[i]):t.float32QueryVector[i]}return t.filter!=null&&t.hasOwnProperty("filter")&&(r.filter=$root.search.proto.Query.toObject(t.filter,e)),t.weight!=null&&t.hasOwnProperty("weight")&&(r.weight=e.json&&!isFinite(t.weight)?String(t.weight):t.weight),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.Query=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.type=1,n.prototype.query=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&e.uint32(8).int32(t.type),t.query!=null&&Object.hasOwnProperty.call(t,"query")&&e.uint32(18).bytes(t.query),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.Query;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.type=t.int32();break;case 2:i.query=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.type!=null&&t.hasOwnProperty("type"))switch(t.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:break}return t.query!=null&&t.hasOwnProperty("query")&&!(t.query&&typeof t.query.length=="number"||$util.isString(t.query))?"query: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.Query)return t;var e=new $root.search.proto.Query;switch(t.type){case"MATCH_QUERY":case 1:e.type=1;break;case"MATCH_PHRASE_QUERY":case 2:e.type=2;break;case"TERM_QUERY":case 3:e.type=3;break;case"RANGE_QUERY":case 4:e.type=4;break;case"PREFIX_QUERY":case 5:e.type=5;break;case"BOOL_QUERY":case 6:e.type=6;break;case"CONST_SCORE_QUERY":case 7:e.type=7;break;case"FUNCTION_SCORE_QUERY":case 8:e.type=8;break;case"NESTED_QUERY":case 9:e.type=9;break;case"WILDCARD_QUERY":case 10:e.type=10;break;case"MATCH_ALL_QUERY":case 11:e.type=11;break;case"GEO_BOUNDING_BOX_QUERY":case 12:e.type=12;break;case"GEO_DISTANCE_QUERY":case 13:e.type=13;break;case"GEO_POLYGON_QUERY":case 14:e.type=14;break;case"TERMS_QUERY":case 15:e.type=15;break;case"EXISTS_QUERY":case 16:e.type=16;break;case"KNN_VECTOR_QUERY":case 17:e.type=17;break;case"FUNCTIONS_SCORE_QUERY":case 18:e.type=18;break}return t.query!=null&&(typeof t.query=="string"?$util.base64.decode(t.query,e.query=$util.newBuffer($util.base64.length(t.query)),0):t.query.length&&(e.query=t.query)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.type=e.enums===String?"MATCH_QUERY":1,e.bytes===String?r.query="":(r.query=[],e.bytes!==Array&&(r.query=$util.newBuffer(r.query)))),t.type!=null&&t.hasOwnProperty("type")&&(r.type=e.enums===String?$root.search.proto.QueryType[t.type]:t.type),t.query!=null&&t.hasOwnProperty("query")&&(r.query=e.bytes===String?$util.base64.encode(t.query,0,t.query.length):e.bytes===Array?Array.prototype.slice.call(t.query):t.query),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.Collapse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.Collapse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName)?"fieldName: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.Collapse)return t;var e=new $root.search.proto.Collapse;return t.fieldName!=null&&(e.fieldName=String(t.fieldName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName=""),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.NestedFilter=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.path="",n.prototype.filter=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.path!=null&&Object.hasOwnProperty.call(t,"path")&&e.uint32(10).string(t.path),t.filter!=null&&Object.hasOwnProperty.call(t,"filter")&&$root.search.proto.Query.encode(t.filter,e.uint32(18).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.NestedFilter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.path=t.string();break;case 2:i.filter=$root.search.proto.Query.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.path!=null&&t.hasOwnProperty("path")&&!$util.isString(t.path))return"path: string expected";if(t.filter!=null&&t.hasOwnProperty("filter")){var e=$root.search.proto.Query.verify(t.filter);if(e)return"filter."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.NestedFilter)return t;var e=new $root.search.proto.NestedFilter;if(t.path!=null&&(e.path=String(t.path)),t.filter!=null){if(typeof t.filter!="object")throw TypeError(".search.proto.NestedFilter.filter: object expected");e.filter=$root.search.proto.Query.fromObject(t.filter)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.path="",r.filter=null),t.path!=null&&t.hasOwnProperty("path")&&(r.path=t.path),t.filter!=null&&t.hasOwnProperty("filter")&&(r.filter=$root.search.proto.Query.toObject(t.filter,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SortOrder=function(){var n={},o=Object.create(n);return o[n[0]="SORT_ORDER_ASC"]=0,o[n[1]="SORT_ORDER_DESC"]=1,o}(),c.SortMode=function(){var n={},o=Object.create(n);return o[n[0]="SORT_MODE_MIN"]=0,o[n[1]="SORT_MODE_MAX"]=1,o[n[2]="SORT_MODE_AVG"]=2,o}(),c.ScoreSort=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.order=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.order!=null&&Object.hasOwnProperty.call(t,"order")&&e.uint32(8).int32(t.order),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.ScoreSort;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.order=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.order!=null&&t.hasOwnProperty("order"))switch(t.order){default:return"order: enum value expected";case 0:case 1:break}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.ScoreSort)return t;var e=new $root.search.proto.ScoreSort;switch(t.order){case"SORT_ORDER_ASC":case 0:e.order=0;break;case"SORT_ORDER_DESC":case 1:e.order=1;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.order=e.enums===String?"SORT_ORDER_ASC":0),t.order!=null&&t.hasOwnProperty("order")&&(r.order=e.enums===String?$root.search.proto.SortOrder[t.order]:t.order),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.FieldSort=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.order=0,n.prototype.mode=0,n.prototype.nestedFilter=null,n.prototype.missingValue=$util.newBuffer([]),n.prototype.missingField="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.order!=null&&Object.hasOwnProperty.call(t,"order")&&e.uint32(16).int32(t.order),t.mode!=null&&Object.hasOwnProperty.call(t,"mode")&&e.uint32(24).int32(t.mode),t.nestedFilter!=null&&Object.hasOwnProperty.call(t,"nestedFilter")&&$root.search.proto.NestedFilter.encode(t.nestedFilter,e.uint32(34).fork()).ldelim(),t.missingValue!=null&&Object.hasOwnProperty.call(t,"missingValue")&&e.uint32(42).bytes(t.missingValue),t.missingField!=null&&Object.hasOwnProperty.call(t,"missingField")&&e.uint32(50).string(t.missingField),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.FieldSort;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.order=t.int32();break;case 3:i.mode=t.int32();break;case 4:i.nestedFilter=$root.search.proto.NestedFilter.decode(t,t.uint32());break;case 5:i.missingValue=t.bytes();break;case 6:i.missingField=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.order!=null&&t.hasOwnProperty("order"))switch(t.order){default:return"order: enum value expected";case 0:case 1:break}if(t.mode!=null&&t.hasOwnProperty("mode"))switch(t.mode){default:return"mode: enum value expected";case 0:case 1:case 2:break}if(t.nestedFilter!=null&&t.hasOwnProperty("nestedFilter")){var e=$root.search.proto.NestedFilter.verify(t.nestedFilter);if(e)return"nestedFilter."+e}return t.missingValue!=null&&t.hasOwnProperty("missingValue")&&!(t.missingValue&&typeof t.missingValue.length=="number"||$util.isString(t.missingValue))?"missingValue: buffer expected":t.missingField!=null&&t.hasOwnProperty("missingField")&&!$util.isString(t.missingField)?"missingField: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.FieldSort)return t;var e=new $root.search.proto.FieldSort;switch(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.order){case"SORT_ORDER_ASC":case 0:e.order=0;break;case"SORT_ORDER_DESC":case 1:e.order=1;break}switch(t.mode){case"SORT_MODE_MIN":case 0:e.mode=0;break;case"SORT_MODE_MAX":case 1:e.mode=1;break;case"SORT_MODE_AVG":case 2:e.mode=2;break}if(t.nestedFilter!=null){if(typeof t.nestedFilter!="object")throw TypeError(".search.proto.FieldSort.nestedFilter: object expected");e.nestedFilter=$root.search.proto.NestedFilter.fromObject(t.nestedFilter)}return t.missingValue!=null&&(typeof t.missingValue=="string"?$util.base64.decode(t.missingValue,e.missingValue=$util.newBuffer($util.base64.length(t.missingValue)),0):t.missingValue.length&&(e.missingValue=t.missingValue)),t.missingField!=null&&(e.missingField=String(t.missingField)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",r.order=e.enums===String?"SORT_ORDER_ASC":0,r.mode=e.enums===String?"SORT_MODE_MIN":0,r.nestedFilter=null,e.bytes===String?r.missingValue="":(r.missingValue=[],e.bytes!==Array&&(r.missingValue=$util.newBuffer(r.missingValue))),r.missingField=""),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.order!=null&&t.hasOwnProperty("order")&&(r.order=e.enums===String?$root.search.proto.SortOrder[t.order]:t.order),t.mode!=null&&t.hasOwnProperty("mode")&&(r.mode=e.enums===String?$root.search.proto.SortMode[t.mode]:t.mode),t.nestedFilter!=null&&t.hasOwnProperty("nestedFilter")&&(r.nestedFilter=$root.search.proto.NestedFilter.toObject(t.nestedFilter,e)),t.missingValue!=null&&t.hasOwnProperty("missingValue")&&(r.missingValue=e.bytes===String?$util.base64.encode(t.missingValue,0,t.missingValue.length):e.bytes===Array?Array.prototype.slice.call(t.missingValue):t.missingValue),t.missingField!=null&&t.hasOwnProperty("missingField")&&(r.missingField=t.missingField),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DocSort=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.order=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.order!=null&&Object.hasOwnProperty.call(t,"order")&&e.uint32(8).int32(t.order),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DocSort;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.order=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.order!=null&&t.hasOwnProperty("order"))switch(t.order){default:return"order: enum value expected";case 0:case 1:break}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.DocSort)return t;var e=new $root.search.proto.DocSort;switch(t.order){case"SORT_ORDER_ASC":case 0:e.order=0;break;case"SORT_ORDER_DESC":case 1:e.order=1;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.order=e.enums===String?"SORT_ORDER_ASC":0),t.order!=null&&t.hasOwnProperty("order")&&(r.order=e.enums===String?$root.search.proto.SortOrder[t.order]:t.order),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.GeoDistanceType=function(){var n={},o=Object.create(n);return o[n[0]="GEO_DISTANCE_ARC"]=0,o[n[1]="GEO_DISTANCE_PLANE"]=1,o}(),c.GeoDistanceSort=function(){function n(o){if(this.points=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.points=$util.emptyArray,n.prototype.order=0,n.prototype.mode=0,n.prototype.distanceType=0,n.prototype.nestedFilter=null,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.points!=null&&t.points.length)for(var r=0;r<t.points.length;++r)e.uint32(18).string(t.points[r]);return t.order!=null&&Object.hasOwnProperty.call(t,"order")&&e.uint32(24).int32(t.order),t.mode!=null&&Object.hasOwnProperty.call(t,"mode")&&e.uint32(32).int32(t.mode),t.distanceType!=null&&Object.hasOwnProperty.call(t,"distanceType")&&e.uint32(40).int32(t.distanceType),t.nestedFilter!=null&&Object.hasOwnProperty.call(t,"nestedFilter")&&$root.search.proto.NestedFilter.encode(t.nestedFilter,e.uint32(50).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.GeoDistanceSort;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.points&&i.points.length||(i.points=[]),i.points.push(t.string());break;case 3:i.order=t.int32();break;case 4:i.mode=t.int32();break;case 5:i.distanceType=t.int32();break;case 6:i.nestedFilter=$root.search.proto.NestedFilter.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.points!=null&&t.hasOwnProperty("points")){if(!Array.isArray(t.points))return"points: array expected";for(var e=0;e<t.points.length;++e)if(!$util.isString(t.points[e]))return"points: string[] expected"}if(t.order!=null&&t.hasOwnProperty("order"))switch(t.order){default:return"order: enum value expected";case 0:case 1:break}if(t.mode!=null&&t.hasOwnProperty("mode"))switch(t.mode){default:return"mode: enum value expected";case 0:case 1:case 2:break}if(t.distanceType!=null&&t.hasOwnProperty("distanceType"))switch(t.distanceType){default:return"distanceType: enum value expected";case 0:case 1:break}if(t.nestedFilter!=null&&t.hasOwnProperty("nestedFilter")){var r=$root.search.proto.NestedFilter.verify(t.nestedFilter);if(r)return"nestedFilter."+r}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.GeoDistanceSort)return t;var e=new $root.search.proto.GeoDistanceSort;if(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.points){if(!Array.isArray(t.points))throw TypeError(".search.proto.GeoDistanceSort.points: array expected");e.points=[];for(var r=0;r<t.points.length;++r)e.points[r]=String(t.points[r])}switch(t.order){case"SORT_ORDER_ASC":case 0:e.order=0;break;case"SORT_ORDER_DESC":case 1:e.order=1;break}switch(t.mode){case"SORT_MODE_MIN":case 0:e.mode=0;break;case"SORT_MODE_MAX":case 1:e.mode=1;break;case"SORT_MODE_AVG":case 2:e.mode=2;break}switch(t.distanceType){case"GEO_DISTANCE_ARC":case 0:e.distanceType=0;break;case"GEO_DISTANCE_PLANE":case 1:e.distanceType=1;break}if(t.nestedFilter!=null){if(typeof t.nestedFilter!="object")throw TypeError(".search.proto.GeoDistanceSort.nestedFilter: object expected");e.nestedFilter=$root.search.proto.NestedFilter.fromObject(t.nestedFilter)}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.points=[]),e.defaults&&(r.fieldName="",r.order=e.enums===String?"SORT_ORDER_ASC":0,r.mode=e.enums===String?"SORT_MODE_MIN":0,r.distanceType=e.enums===String?"GEO_DISTANCE_ARC":0,r.nestedFilter=null),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.points&&t.points.length){r.points=[];for(var i=0;i<t.points.length;++i)r.points[i]=t.points[i]}return t.order!=null&&t.hasOwnProperty("order")&&(r.order=e.enums===String?$root.search.proto.SortOrder[t.order]:t.order),t.mode!=null&&t.hasOwnProperty("mode")&&(r.mode=e.enums===String?$root.search.proto.SortMode[t.mode]:t.mode),t.distanceType!=null&&t.hasOwnProperty("distanceType")&&(r.distanceType=e.enums===String?$root.search.proto.GeoDistanceType[t.distanceType]:t.distanceType),t.nestedFilter!=null&&t.hasOwnProperty("nestedFilter")&&(r.nestedFilter=$root.search.proto.NestedFilter.toObject(t.nestedFilter,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.PrimaryKeySort=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.order=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.order!=null&&Object.hasOwnProperty.call(t,"order")&&e.uint32(8).int32(t.order),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.PrimaryKeySort;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.order=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.order!=null&&t.hasOwnProperty("order"))switch(t.order){default:return"order: enum value expected";case 0:case 1:break}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.PrimaryKeySort)return t;var e=new $root.search.proto.PrimaryKeySort;switch(t.order){case"SORT_ORDER_ASC":case 0:e.order=0;break;case"SORT_ORDER_DESC":case 1:e.order=1;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.order=e.enums===String?"SORT_ORDER_ASC":0),t.order!=null&&t.hasOwnProperty("order")&&(r.order=e.enums===String?$root.search.proto.SortOrder[t.order]:t.order),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.Sorter=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldSort=null,n.prototype.geoDistanceSort=null,n.prototype.scoreSort=null,n.prototype.pkSort=null,n.prototype.docSort=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldSort!=null&&Object.hasOwnProperty.call(t,"fieldSort")&&$root.search.proto.FieldSort.encode(t.fieldSort,e.uint32(10).fork()).ldelim(),t.geoDistanceSort!=null&&Object.hasOwnProperty.call(t,"geoDistanceSort")&&$root.search.proto.GeoDistanceSort.encode(t.geoDistanceSort,e.uint32(18).fork()).ldelim(),t.scoreSort!=null&&Object.hasOwnProperty.call(t,"scoreSort")&&$root.search.proto.ScoreSort.encode(t.scoreSort,e.uint32(26).fork()).ldelim(),t.pkSort!=null&&Object.hasOwnProperty.call(t,"pkSort")&&$root.search.proto.PrimaryKeySort.encode(t.pkSort,e.uint32(34).fork()).ldelim(),t.docSort!=null&&Object.hasOwnProperty.call(t,"docSort")&&$root.search.proto.DocSort.encode(t.docSort,e.uint32(42).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.Sorter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldSort=$root.search.proto.FieldSort.decode(t,t.uint32());break;case 2:i.geoDistanceSort=$root.search.proto.GeoDistanceSort.decode(t,t.uint32());break;case 3:i.scoreSort=$root.search.proto.ScoreSort.decode(t,t.uint32());break;case 4:i.pkSort=$root.search.proto.PrimaryKeySort.decode(t,t.uint32());break;case 5:i.docSort=$root.search.proto.DocSort.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldSort!=null&&t.hasOwnProperty("fieldSort")){var e=$root.search.proto.FieldSort.verify(t.fieldSort);if(e)return"fieldSort."+e}if(t.geoDistanceSort!=null&&t.hasOwnProperty("geoDistanceSort")){var e=$root.search.proto.GeoDistanceSort.verify(t.geoDistanceSort);if(e)return"geoDistanceSort."+e}if(t.scoreSort!=null&&t.hasOwnProperty("scoreSort")){var e=$root.search.proto.ScoreSort.verify(t.scoreSort);if(e)return"scoreSort."+e}if(t.pkSort!=null&&t.hasOwnProperty("pkSort")){var e=$root.search.proto.PrimaryKeySort.verify(t.pkSort);if(e)return"pkSort."+e}if(t.docSort!=null&&t.hasOwnProperty("docSort")){var e=$root.search.proto.DocSort.verify(t.docSort);if(e)return"docSort."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.Sorter)return t;var e=new $root.search.proto.Sorter;if(t.fieldSort!=null){if(typeof t.fieldSort!="object")throw TypeError(".search.proto.Sorter.fieldSort: object expected");e.fieldSort=$root.search.proto.FieldSort.fromObject(t.fieldSort)}if(t.geoDistanceSort!=null){if(typeof t.geoDistanceSort!="object")throw TypeError(".search.proto.Sorter.geoDistanceSort: object expected");e.geoDistanceSort=$root.search.proto.GeoDistanceSort.fromObject(t.geoDistanceSort)}if(t.scoreSort!=null){if(typeof t.scoreSort!="object")throw TypeError(".search.proto.Sorter.scoreSort: object expected");e.scoreSort=$root.search.proto.ScoreSort.fromObject(t.scoreSort)}if(t.pkSort!=null){if(typeof t.pkSort!="object")throw TypeError(".search.proto.Sorter.pkSort: object expected");e.pkSort=$root.search.proto.PrimaryKeySort.fromObject(t.pkSort)}if(t.docSort!=null){if(typeof t.docSort!="object")throw TypeError(".search.proto.Sorter.docSort: object expected");e.docSort=$root.search.proto.DocSort.fromObject(t.docSort)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldSort=null,r.geoDistanceSort=null,r.scoreSort=null,r.pkSort=null,r.docSort=null),t.fieldSort!=null&&t.hasOwnProperty("fieldSort")&&(r.fieldSort=$root.search.proto.FieldSort.toObject(t.fieldSort,e)),t.geoDistanceSort!=null&&t.hasOwnProperty("geoDistanceSort")&&(r.geoDistanceSort=$root.search.proto.GeoDistanceSort.toObject(t.geoDistanceSort,e)),t.scoreSort!=null&&t.hasOwnProperty("scoreSort")&&(r.scoreSort=$root.search.proto.ScoreSort.toObject(t.scoreSort,e)),t.pkSort!=null&&t.hasOwnProperty("pkSort")&&(r.pkSort=$root.search.proto.PrimaryKeySort.toObject(t.pkSort,e)),t.docSort!=null&&t.hasOwnProperty("docSort")&&(r.docSort=$root.search.proto.DocSort.toObject(t.docSort,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.Sort=function(){function n(o){if(this.sorter=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.sorter=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.sorter!=null&&t.sorter.length)for(var r=0;r<t.sorter.length;++r)$root.search.proto.Sorter.encode(t.sorter[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.Sort;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.sorter&&i.sorter.length||(i.sorter=[]),i.sorter.push($root.search.proto.Sorter.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.sorter!=null&&t.hasOwnProperty("sorter")){if(!Array.isArray(t.sorter))return"sorter: array expected";for(var e=0;e<t.sorter.length;++e){var r=$root.search.proto.Sorter.verify(t.sorter[e]);if(r)return"sorter."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.Sort)return t;var e=new $root.search.proto.Sort;if(t.sorter){if(!Array.isArray(t.sorter))throw TypeError(".search.proto.Sort.sorter: array expected");e.sorter=[];for(var r=0;r<t.sorter.length;++r){if(typeof t.sorter[r]!="object")throw TypeError(".search.proto.Sort.sorter: object expected");e.sorter[r]=$root.search.proto.Sorter.fromObject(t.sorter[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.sorter=[]),t.sorter&&t.sorter.length){r.sorter=[];for(var i=0;i<t.sorter.length;++i)r.sorter[i]=$root.search.proto.Sorter.toObject(t.sorter[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SearchQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.offset=0,n.prototype.limit=0,n.prototype.query=null,n.prototype.collapse=null,n.prototype.sort=null,n.prototype.getTotalCount=!1,n.prototype.token=$util.newBuffer([]),n.prototype.aggs=null,n.prototype.groupBys=null,n.prototype.highlight=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.offset!=null&&Object.hasOwnProperty.call(t,"offset")&&e.uint32(8).int32(t.offset),t.limit!=null&&Object.hasOwnProperty.call(t,"limit")&&e.uint32(16).int32(t.limit),t.query!=null&&Object.hasOwnProperty.call(t,"query")&&$root.search.proto.Query.encode(t.query,e.uint32(34).fork()).ldelim(),t.collapse!=null&&Object.hasOwnProperty.call(t,"collapse")&&$root.search.proto.Collapse.encode(t.collapse,e.uint32(42).fork()).ldelim(),t.sort!=null&&Object.hasOwnProperty.call(t,"sort")&&$root.search.proto.Sort.encode(t.sort,e.uint32(50).fork()).ldelim(),t.getTotalCount!=null&&Object.hasOwnProperty.call(t,"getTotalCount")&&e.uint32(64).bool(t.getTotalCount),t.token!=null&&Object.hasOwnProperty.call(t,"token")&&e.uint32(74).bytes(t.token),t.aggs!=null&&Object.hasOwnProperty.call(t,"aggs")&&$root.search.proto.Aggregations.encode(t.aggs,e.uint32(82).fork()).ldelim(),t.groupBys!=null&&Object.hasOwnProperty.call(t,"groupBys")&&$root.search.proto.GroupBys.encode(t.groupBys,e.uint32(90).fork()).ldelim(),t.highlight!=null&&Object.hasOwnProperty.call(t,"highlight")&&$root.search.proto.Highlight.encode(t.highlight,e.uint32(98).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SearchQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.offset=t.int32();break;case 2:i.limit=t.int32();break;case 4:i.query=$root.search.proto.Query.decode(t,t.uint32());break;case 5:i.collapse=$root.search.proto.Collapse.decode(t,t.uint32());break;case 6:i.sort=$root.search.proto.Sort.decode(t,t.uint32());break;case 8:i.getTotalCount=t.bool();break;case 9:i.token=t.bytes();break;case 10:i.aggs=$root.search.proto.Aggregations.decode(t,t.uint32());break;case 11:i.groupBys=$root.search.proto.GroupBys.decode(t,t.uint32());break;case 12:i.highlight=$root.search.proto.Highlight.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.offset!=null&&t.hasOwnProperty("offset")&&!$util.isInteger(t.offset))return"offset: integer expected";if(t.limit!=null&&t.hasOwnProperty("limit")&&!$util.isInteger(t.limit))return"limit: integer expected";if(t.query!=null&&t.hasOwnProperty("query")){var e=$root.search.proto.Query.verify(t.query);if(e)return"query."+e}if(t.collapse!=null&&t.hasOwnProperty("collapse")){var e=$root.search.proto.Collapse.verify(t.collapse);if(e)return"collapse."+e}if(t.sort!=null&&t.hasOwnProperty("sort")){var e=$root.search.proto.Sort.verify(t.sort);if(e)return"sort."+e}if(t.getTotalCount!=null&&t.hasOwnProperty("getTotalCount")&&typeof t.getTotalCount!="boolean")return"getTotalCount: boolean expected";if(t.token!=null&&t.hasOwnProperty("token")&&!(t.token&&typeof t.token.length=="number"||$util.isString(t.token)))return"token: buffer expected";if(t.aggs!=null&&t.hasOwnProperty("aggs")){var e=$root.search.proto.Aggregations.verify(t.aggs);if(e)return"aggs."+e}if(t.groupBys!=null&&t.hasOwnProperty("groupBys")){var e=$root.search.proto.GroupBys.verify(t.groupBys);if(e)return"groupBys."+e}if(t.highlight!=null&&t.hasOwnProperty("highlight")){var e=$root.search.proto.Highlight.verify(t.highlight);if(e)return"highlight."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.SearchQuery)return t;var e=new $root.search.proto.SearchQuery;if(t.offset!=null&&(e.offset=t.offset|0),t.limit!=null&&(e.limit=t.limit|0),t.query!=null){if(typeof t.query!="object")throw TypeError(".search.proto.SearchQuery.query: object expected");e.query=$root.search.proto.Query.fromObject(t.query)}if(t.collapse!=null){if(typeof t.collapse!="object")throw TypeError(".search.proto.SearchQuery.collapse: object expected");e.collapse=$root.search.proto.Collapse.fromObject(t.collapse)}if(t.sort!=null){if(typeof t.sort!="object")throw TypeError(".search.proto.SearchQuery.sort: object expected");e.sort=$root.search.proto.Sort.fromObject(t.sort)}if(t.getTotalCount!=null&&(e.getTotalCount=!!t.getTotalCount),t.token!=null&&(typeof t.token=="string"?$util.base64.decode(t.token,e.token=$util.newBuffer($util.base64.length(t.token)),0):t.token.length&&(e.token=t.token)),t.aggs!=null){if(typeof t.aggs!="object")throw TypeError(".search.proto.SearchQuery.aggs: object expected");e.aggs=$root.search.proto.Aggregations.fromObject(t.aggs)}if(t.groupBys!=null){if(typeof t.groupBys!="object")throw TypeError(".search.proto.SearchQuery.groupBys: object expected");e.groupBys=$root.search.proto.GroupBys.fromObject(t.groupBys)}if(t.highlight!=null){if(typeof t.highlight!="object")throw TypeError(".search.proto.SearchQuery.highlight: object expected");e.highlight=$root.search.proto.Highlight.fromObject(t.highlight)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.offset=0,r.limit=0,r.query=null,r.collapse=null,r.sort=null,r.getTotalCount=!1,e.bytes===String?r.token="":(r.token=[],e.bytes!==Array&&(r.token=$util.newBuffer(r.token))),r.aggs=null,r.groupBys=null,r.highlight=null),t.offset!=null&&t.hasOwnProperty("offset")&&(r.offset=t.offset),t.limit!=null&&t.hasOwnProperty("limit")&&(r.limit=t.limit),t.query!=null&&t.hasOwnProperty("query")&&(r.query=$root.search.proto.Query.toObject(t.query,e)),t.collapse!=null&&t.hasOwnProperty("collapse")&&(r.collapse=$root.search.proto.Collapse.toObject(t.collapse,e)),t.sort!=null&&t.hasOwnProperty("sort")&&(r.sort=$root.search.proto.Sort.toObject(t.sort,e)),t.getTotalCount!=null&&t.hasOwnProperty("getTotalCount")&&(r.getTotalCount=t.getTotalCount),t.token!=null&&t.hasOwnProperty("token")&&(r.token=e.bytes===String?$util.base64.encode(t.token,0,t.token.length):e.bytes===Array?Array.prototype.slice.call(t.token):t.token),t.aggs!=null&&t.hasOwnProperty("aggs")&&(r.aggs=$root.search.proto.Aggregations.toObject(t.aggs,e)),t.groupBys!=null&&t.hasOwnProperty("groupBys")&&(r.groupBys=$root.search.proto.GroupBys.toObject(t.groupBys,e)),t.highlight!=null&&t.hasOwnProperty("highlight")&&(r.highlight=$root.search.proto.Highlight.toObject(t.highlight,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.Highlight=function(){function n(o){if(this.highlightParameters=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.highlightParameters=$util.emptyArray,n.prototype.highlightEncoder=1,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.highlightParameters!=null&&t.highlightParameters.length)for(var r=0;r<t.highlightParameters.length;++r)$root.search.proto.HighlightParameter.encode(t.highlightParameters[r],e.uint32(10).fork()).ldelim();return t.highlightEncoder!=null&&Object.hasOwnProperty.call(t,"highlightEncoder")&&e.uint32(16).int32(t.highlightEncoder),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.Highlight;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.highlightParameters&&i.highlightParameters.length||(i.highlightParameters=[]),i.highlightParameters.push($root.search.proto.HighlightParameter.decode(t,t.uint32()));break;case 2:i.highlightEncoder=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.highlightParameters!=null&&t.hasOwnProperty("highlightParameters")){if(!Array.isArray(t.highlightParameters))return"highlightParameters: array expected";for(var e=0;e<t.highlightParameters.length;++e){var r=$root.search.proto.HighlightParameter.verify(t.highlightParameters[e]);if(r)return"highlightParameters."+r}}if(t.highlightEncoder!=null&&t.hasOwnProperty("highlightEncoder"))switch(t.highlightEncoder){default:return"highlightEncoder: enum value expected";case 1:case 2:break}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.Highlight)return t;var e=new $root.search.proto.Highlight;if(t.highlightParameters){if(!Array.isArray(t.highlightParameters))throw TypeError(".search.proto.Highlight.highlightParameters: array expected");e.highlightParameters=[];for(var r=0;r<t.highlightParameters.length;++r){if(typeof t.highlightParameters[r]!="object")throw TypeError(".search.proto.Highlight.highlightParameters: object expected");e.highlightParameters[r]=$root.search.proto.HighlightParameter.fromObject(t.highlightParameters[r])}}switch(t.highlightEncoder){case"PLAIN_MODE":case 1:e.highlightEncoder=1;break;case"HTML_MODE":case 2:e.highlightEncoder=2;break}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.highlightParameters=[]),e.defaults&&(r.highlightEncoder=e.enums===String?"PLAIN_MODE":1),t.highlightParameters&&t.highlightParameters.length){r.highlightParameters=[];for(var i=0;i<t.highlightParameters.length;++i)r.highlightParameters[i]=$root.search.proto.HighlightParameter.toObject(t.highlightParameters[i],e)}return t.highlightEncoder!=null&&t.hasOwnProperty("highlightEncoder")&&(r.highlightEncoder=e.enums===String?$root.search.proto.HighlightEncoder[t.highlightEncoder]:t.highlightEncoder),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.HighlightParameter=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.numberOfFragments=0,n.prototype.fragmentSize=0,n.prototype.preTag="",n.prototype.postTag="",n.prototype.fragmentsOrder=1,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.numberOfFragments!=null&&Object.hasOwnProperty.call(t,"numberOfFragments")&&e.uint32(16).int32(t.numberOfFragments),t.fragmentSize!=null&&Object.hasOwnProperty.call(t,"fragmentSize")&&e.uint32(24).int32(t.fragmentSize),t.preTag!=null&&Object.hasOwnProperty.call(t,"preTag")&&e.uint32(34).string(t.preTag),t.postTag!=null&&Object.hasOwnProperty.call(t,"postTag")&&e.uint32(42).string(t.postTag),t.fragmentsOrder!=null&&Object.hasOwnProperty.call(t,"fragmentsOrder")&&e.uint32(48).int32(t.fragmentsOrder),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.HighlightParameter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.numberOfFragments=t.int32();break;case 3:i.fragmentSize=t.int32();break;case 4:i.preTag=t.string();break;case 5:i.postTag=t.string();break;case 6:i.fragmentsOrder=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.numberOfFragments!=null&&t.hasOwnProperty("numberOfFragments")&&!$util.isInteger(t.numberOfFragments))return"numberOfFragments: integer expected";if(t.fragmentSize!=null&&t.hasOwnProperty("fragmentSize")&&!$util.isInteger(t.fragmentSize))return"fragmentSize: integer expected";if(t.preTag!=null&&t.hasOwnProperty("preTag")&&!$util.isString(t.preTag))return"preTag: string expected";if(t.postTag!=null&&t.hasOwnProperty("postTag")&&!$util.isString(t.postTag))return"postTag: string expected";if(t.fragmentsOrder!=null&&t.hasOwnProperty("fragmentsOrder"))switch(t.fragmentsOrder){default:return"fragmentsOrder: enum value expected";case 1:case 2:break}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.HighlightParameter)return t;var e=new $root.search.proto.HighlightParameter;switch(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.numberOfFragments!=null&&(e.numberOfFragments=t.numberOfFragments|0),t.fragmentSize!=null&&(e.fragmentSize=t.fragmentSize|0),t.preTag!=null&&(e.preTag=String(t.preTag)),t.postTag!=null&&(e.postTag=String(t.postTag)),t.fragmentsOrder){case"TEXT_SEQUENCE":case 1:e.fragmentsOrder=1;break;case"SCORE":case 2:e.fragmentsOrder=2;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.fieldName="",r.numberOfFragments=0,r.fragmentSize=0,r.preTag="",r.postTag="",r.fragmentsOrder=e.enums===String?"TEXT_SEQUENCE":1),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.numberOfFragments!=null&&t.hasOwnProperty("numberOfFragments")&&(r.numberOfFragments=t.numberOfFragments),t.fragmentSize!=null&&t.hasOwnProperty("fragmentSize")&&(r.fragmentSize=t.fragmentSize),t.preTag!=null&&t.hasOwnProperty("preTag")&&(r.preTag=t.preTag),t.postTag!=null&&t.hasOwnProperty("postTag")&&(r.postTag=t.postTag),t.fragmentsOrder!=null&&t.hasOwnProperty("fragmentsOrder")&&(r.fragmentsOrder=e.enums===String?$root.search.proto.HighlightFragmentOrder[t.fragmentsOrder]:t.fragmentsOrder),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.HighlightFragmentOrder=function(){var n={},o=Object.create(n);return o[n[1]="TEXT_SEQUENCE"]=1,o[n[2]="SCORE"]=2,o}(),c.HighlightEncoder=function(){var n={},o=Object.create(n);return o[n[1]="PLAIN_MODE"]=1,o[n[2]="HTML_MODE"]=2,o}(),c.ColumnReturnType=function(){var n={},o=Object.create(n);return o[n[1]="RETURN_ALL"]=1,o[n[2]="RETURN_SPECIFIED"]=2,o[n[3]="RETURN_NONE"]=3,o[n[4]="RETURN_ALL_FROM_INDEX"]=4,o}(),c.ColumnsToGet=function(){function n(o){if(this.columnNames=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.returnType=1,n.prototype.columnNames=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.returnType!=null&&Object.hasOwnProperty.call(t,"returnType")&&e.uint32(8).int32(t.returnType),t.columnNames!=null&&t.columnNames.length)for(var r=0;r<t.columnNames.length;++r)e.uint32(18).string(t.columnNames[r]);return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.ColumnsToGet;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.returnType=t.int32();break;case 2:i.columnNames&&i.columnNames.length||(i.columnNames=[]),i.columnNames.push(t.string());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.returnType!=null&&t.hasOwnProperty("returnType"))switch(t.returnType){default:return"returnType: enum value expected";case 1:case 2:case 3:case 4:break}if(t.columnNames!=null&&t.hasOwnProperty("columnNames")){if(!Array.isArray(t.columnNames))return"columnNames: array expected";for(var e=0;e<t.columnNames.length;++e)if(!$util.isString(t.columnNames[e]))return"columnNames: string[] expected"}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.ColumnsToGet)return t;var e=new $root.search.proto.ColumnsToGet;switch(t.returnType){case"RETURN_ALL":case 1:e.returnType=1;break;case"RETURN_SPECIFIED":case 2:e.returnType=2;break;case"RETURN_NONE":case 3:e.returnType=3;break;case"RETURN_ALL_FROM_INDEX":case 4:e.returnType=4;break}if(t.columnNames){if(!Array.isArray(t.columnNames))throw TypeError(".search.proto.ColumnsToGet.columnNames: array expected");e.columnNames=[];for(var r=0;r<t.columnNames.length;++r)e.columnNames[r]=String(t.columnNames[r])}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.columnNames=[]),e.defaults&&(r.returnType=e.enums===String?"RETURN_ALL":1),t.returnType!=null&&t.hasOwnProperty("returnType")&&(r.returnType=e.enums===String?$root.search.proto.ColumnReturnType[t.returnType]:t.returnType),t.columnNames&&t.columnNames.length){r.columnNames=[];for(var i=0;i<t.columnNames.length;++i)r.columnNames[i]=t.columnNames[i]}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SearchRequest=function(){function n(o){if(this.routingValues=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.indexName="",n.prototype.columnsToGet=null,n.prototype.searchQuery=$util.newBuffer([]),n.prototype.routingValues=$util.emptyArray,n.prototype.timeoutMs=0,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.tableName!=null&&Object.hasOwnProperty.call(t,"tableName")&&e.uint32(10).string(t.tableName),t.indexName!=null&&Object.hasOwnProperty.call(t,"indexName")&&e.uint32(18).string(t.indexName),t.columnsToGet!=null&&Object.hasOwnProperty.call(t,"columnsToGet")&&$root.search.proto.ColumnsToGet.encode(t.columnsToGet,e.uint32(26).fork()).ldelim(),t.searchQuery!=null&&Object.hasOwnProperty.call(t,"searchQuery")&&e.uint32(34).bytes(t.searchQuery),t.routingValues!=null&&t.routingValues.length)for(var r=0;r<t.routingValues.length;++r)e.uint32(42).bytes(t.routingValues[r]);return t.timeoutMs!=null&&Object.hasOwnProperty.call(t,"timeoutMs")&&e.uint32(48).int32(t.timeoutMs),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SearchRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.indexName=t.string();break;case 3:i.columnsToGet=$root.search.proto.ColumnsToGet.decode(t,t.uint32());break;case 4:i.searchQuery=t.bytes();break;case 5:i.routingValues&&i.routingValues.length||(i.routingValues=[]),i.routingValues.push(t.bytes());break;case 6:i.timeoutMs=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.tableName!=null&&t.hasOwnProperty("tableName")&&!$util.isString(t.tableName))return"tableName: string expected";if(t.indexName!=null&&t.hasOwnProperty("indexName")&&!$util.isString(t.indexName))return"indexName: string expected";if(t.columnsToGet!=null&&t.hasOwnProperty("columnsToGet")){var e=$root.search.proto.ColumnsToGet.verify(t.columnsToGet);if(e)return"columnsToGet."+e}if(t.searchQuery!=null&&t.hasOwnProperty("searchQuery")&&!(t.searchQuery&&typeof t.searchQuery.length=="number"||$util.isString(t.searchQuery)))return"searchQuery: buffer expected";if(t.routingValues!=null&&t.hasOwnProperty("routingValues")){if(!Array.isArray(t.routingValues))return"routingValues: array expected";for(var r=0;r<t.routingValues.length;++r)if(!(t.routingValues[r]&&typeof t.routingValues[r].length=="number"||$util.isString(t.routingValues[r])))return"routingValues: buffer[] expected"}return t.timeoutMs!=null&&t.hasOwnProperty("timeoutMs")&&!$util.isInteger(t.timeoutMs)?"timeoutMs: integer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.SearchRequest)return t;var e=new $root.search.proto.SearchRequest;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.indexName!=null&&(e.indexName=String(t.indexName)),t.columnsToGet!=null){if(typeof t.columnsToGet!="object")throw TypeError(".search.proto.SearchRequest.columnsToGet: object expected");e.columnsToGet=$root.search.proto.ColumnsToGet.fromObject(t.columnsToGet)}if(t.searchQuery!=null&&(typeof t.searchQuery=="string"?$util.base64.decode(t.searchQuery,e.searchQuery=$util.newBuffer($util.base64.length(t.searchQuery)),0):t.searchQuery.length&&(e.searchQuery=t.searchQuery)),t.routingValues){if(!Array.isArray(t.routingValues))throw TypeError(".search.proto.SearchRequest.routingValues: array expected");e.routingValues=[];for(var r=0;r<t.routingValues.length;++r)typeof t.routingValues[r]=="string"?$util.base64.decode(t.routingValues[r],e.routingValues[r]=$util.newBuffer($util.base64.length(t.routingValues[r])),0):t.routingValues[r].length&&(e.routingValues[r]=t.routingValues[r])}return t.timeoutMs!=null&&(e.timeoutMs=t.timeoutMs|0),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.routingValues=[]),e.defaults&&(r.tableName="",r.indexName="",r.columnsToGet=null,e.bytes===String?r.searchQuery="":(r.searchQuery=[],e.bytes!==Array&&(r.searchQuery=$util.newBuffer(r.searchQuery))),r.timeoutMs=0),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.indexName!=null&&t.hasOwnProperty("indexName")&&(r.indexName=t.indexName),t.columnsToGet!=null&&t.hasOwnProperty("columnsToGet")&&(r.columnsToGet=$root.search.proto.ColumnsToGet.toObject(t.columnsToGet,e)),t.searchQuery!=null&&t.hasOwnProperty("searchQuery")&&(r.searchQuery=e.bytes===String?$util.base64.encode(t.searchQuery,0,t.searchQuery.length):e.bytes===Array?Array.prototype.slice.call(t.searchQuery):t.searchQuery),t.routingValues&&t.routingValues.length){r.routingValues=[];for(var i=0;i<t.routingValues.length;++i)r.routingValues[i]=e.bytes===String?$util.base64.encode(t.routingValues[i],0,t.routingValues[i].length):e.bytes===Array?Array.prototype.slice.call(t.routingValues[i]):t.routingValues[i]}return t.timeoutMs!=null&&t.hasOwnProperty("timeoutMs")&&(r.timeoutMs=t.timeoutMs),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SearchResponse=function(){function n(o){if(this.rows=[],this.searchHits=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.totalHits=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.rows=$util.emptyArray,n.prototype.isAllSucceeded=!1,n.prototype.searchHits=$util.emptyArray,n.prototype.nextToken=$util.newBuffer([]),n.prototype.aggs=$util.newBuffer([]),n.prototype.groupBys=$util.newBuffer([]),n.prototype.consumed=null,n.prototype.reservedConsumed=null,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.totalHits!=null&&Object.hasOwnProperty.call(t,"totalHits")&&e.uint32(8).int64(t.totalHits),t.rows!=null&&t.rows.length)for(var r=0;r<t.rows.length;++r)e.uint32(18).bytes(t.rows[r]);if(t.isAllSucceeded!=null&&Object.hasOwnProperty.call(t,"isAllSucceeded")&&e.uint32(24).bool(t.isAllSucceeded),t.searchHits!=null&&t.searchHits.length)for(var r=0;r<t.searchHits.length;++r)$root.search.proto.SearchHit.encode(t.searchHits[r],e.uint32(42).fork()).ldelim();return t.nextToken!=null&&Object.hasOwnProperty.call(t,"nextToken")&&e.uint32(50).bytes(t.nextToken),t.aggs!=null&&Object.hasOwnProperty.call(t,"aggs")&&e.uint32(58).bytes(t.aggs),t.groupBys!=null&&Object.hasOwnProperty.call(t,"groupBys")&&e.uint32(66).bytes(t.groupBys),t.consumed!=null&&Object.hasOwnProperty.call(t,"consumed")&&$root.main.proto.ConsumedCapacity.encode(t.consumed,e.uint32(74).fork()).ldelim(),t.reservedConsumed!=null&&Object.hasOwnProperty.call(t,"reservedConsumed")&&$root.main.proto.ConsumedCapacity.encode(t.reservedConsumed,e.uint32(82).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SearchResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.totalHits=t.int64();break;case 2:i.rows&&i.rows.length||(i.rows=[]),i.rows.push(t.bytes());break;case 3:i.isAllSucceeded=t.bool();break;case 5:i.searchHits&&i.searchHits.length||(i.searchHits=[]),i.searchHits.push($root.search.proto.SearchHit.decode(t,t.uint32()));break;case 6:i.nextToken=t.bytes();break;case 7:i.aggs=t.bytes();break;case 8:i.groupBys=t.bytes();break;case 9:i.consumed=$root.main.proto.ConsumedCapacity.decode(t,t.uint32());break;case 10:i.reservedConsumed=$root.main.proto.ConsumedCapacity.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.totalHits!=null&&t.hasOwnProperty("totalHits")&&!$util.isInteger(t.totalHits)&&!(t.totalHits&&$util.isInteger(t.totalHits.low)&&$util.isInteger(t.totalHits.high)))return"totalHits: integer|Long expected";if(t.rows!=null&&t.hasOwnProperty("rows")){if(!Array.isArray(t.rows))return"rows: array expected";for(var e=0;e<t.rows.length;++e)if(!(t.rows[e]&&typeof t.rows[e].length=="number"||$util.isString(t.rows[e])))return"rows: buffer[] expected"}if(t.isAllSucceeded!=null&&t.hasOwnProperty("isAllSucceeded")&&typeof t.isAllSucceeded!="boolean")return"isAllSucceeded: boolean expected";if(t.searchHits!=null&&t.hasOwnProperty("searchHits")){if(!Array.isArray(t.searchHits))return"searchHits: array expected";for(var e=0;e<t.searchHits.length;++e){var r=$root.search.proto.SearchHit.verify(t.searchHits[e]);if(r)return"searchHits."+r}}if(t.nextToken!=null&&t.hasOwnProperty("nextToken")&&!(t.nextToken&&typeof t.nextToken.length=="number"||$util.isString(t.nextToken)))return"nextToken: buffer expected";if(t.aggs!=null&&t.hasOwnProperty("aggs")&&!(t.aggs&&typeof t.aggs.length=="number"||$util.isString(t.aggs)))return"aggs: buffer expected";if(t.groupBys!=null&&t.hasOwnProperty("groupBys")&&!(t.groupBys&&typeof t.groupBys.length=="number"||$util.isString(t.groupBys)))return"groupBys: buffer expected";if(t.consumed!=null&&t.hasOwnProperty("consumed")){var r=$root.main.proto.ConsumedCapacity.verify(t.consumed);if(r)return"consumed."+r}if(t.reservedConsumed!=null&&t.hasOwnProperty("reservedConsumed")){var r=$root.main.proto.ConsumedCapacity.verify(t.reservedConsumed);if(r)return"reservedConsumed."+r}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.SearchResponse)return t;var e=new $root.search.proto.SearchResponse;if(t.totalHits!=null&&($util.Long?(e.totalHits=$util.Long.fromValue(t.totalHits)).unsigned=!1:typeof t.totalHits=="string"?e.totalHits=parseInt(t.totalHits,10):typeof t.totalHits=="number"?e.totalHits=t.totalHits:typeof t.totalHits=="object"&&(e.totalHits=new $util.LongBits(t.totalHits.low>>>0,t.totalHits.high>>>0).toNumber())),t.rows){if(!Array.isArray(t.rows))throw TypeError(".search.proto.SearchResponse.rows: array expected");e.rows=[];for(var r=0;r<t.rows.length;++r)typeof t.rows[r]=="string"?$util.base64.decode(t.rows[r],e.rows[r]=$util.newBuffer($util.base64.length(t.rows[r])),0):t.rows[r].length&&(e.rows[r]=t.rows[r])}if(t.isAllSucceeded!=null&&(e.isAllSucceeded=!!t.isAllSucceeded),t.searchHits){if(!Array.isArray(t.searchHits))throw TypeError(".search.proto.SearchResponse.searchHits: array expected");e.searchHits=[];for(var r=0;r<t.searchHits.length;++r){if(typeof t.searchHits[r]!="object")throw TypeError(".search.proto.SearchResponse.searchHits: object expected");e.searchHits[r]=$root.search.proto.SearchHit.fromObject(t.searchHits[r])}}if(t.nextToken!=null&&(typeof t.nextToken=="string"?$util.base64.decode(t.nextToken,e.nextToken=$util.newBuffer($util.base64.length(t.nextToken)),0):t.nextToken.length&&(e.nextToken=t.nextToken)),t.aggs!=null&&(typeof t.aggs=="string"?$util.base64.decode(t.aggs,e.aggs=$util.newBuffer($util.base64.length(t.aggs)),0):t.aggs.length&&(e.aggs=t.aggs)),t.groupBys!=null&&(typeof t.groupBys=="string"?$util.base64.decode(t.groupBys,e.groupBys=$util.newBuffer($util.base64.length(t.groupBys)),0):t.groupBys.length&&(e.groupBys=t.groupBys)),t.consumed!=null){if(typeof t.consumed!="object")throw TypeError(".search.proto.SearchResponse.consumed: object expected");e.consumed=$root.main.proto.ConsumedCapacity.fromObject(t.consumed)}if(t.reservedConsumed!=null){if(typeof t.reservedConsumed!="object")throw TypeError(".search.proto.SearchResponse.reservedConsumed: object expected");e.reservedConsumed=$root.main.proto.ConsumedCapacity.fromObject(t.reservedConsumed)}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.rows=[],r.searchHits=[]),e.defaults){if($util.Long){var i=new $util.Long(0,0,!1);r.totalHits=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.totalHits=e.longs===String?"0":0;r.isAllSucceeded=!1,e.bytes===String?r.nextToken="":(r.nextToken=[],e.bytes!==Array&&(r.nextToken=$util.newBuffer(r.nextToken))),e.bytes===String?r.aggs="":(r.aggs=[],e.bytes!==Array&&(r.aggs=$util.newBuffer(r.aggs))),e.bytes===String?r.groupBys="":(r.groupBys=[],e.bytes!==Array&&(r.groupBys=$util.newBuffer(r.groupBys))),r.consumed=null,r.reservedConsumed=null}if(t.totalHits!=null&&t.hasOwnProperty("totalHits")&&(typeof t.totalHits=="number"?r.totalHits=e.longs===String?String(t.totalHits):t.totalHits:r.totalHits=e.longs===String?$util.Long.prototype.toString.call(t.totalHits):e.longs===Number?new $util.LongBits(t.totalHits.low>>>0,t.totalHits.high>>>0).toNumber():t.totalHits),t.rows&&t.rows.length){r.rows=[];for(var l=0;l<t.rows.length;++l)r.rows[l]=e.bytes===String?$util.base64.encode(t.rows[l],0,t.rows[l].length):e.bytes===Array?Array.prototype.slice.call(t.rows[l]):t.rows[l]}if(t.isAllSucceeded!=null&&t.hasOwnProperty("isAllSucceeded")&&(r.isAllSucceeded=t.isAllSucceeded),t.searchHits&&t.searchHits.length){r.searchHits=[];for(var l=0;l<t.searchHits.length;++l)r.searchHits[l]=$root.search.proto.SearchHit.toObject(t.searchHits[l],e)}return t.nextToken!=null&&t.hasOwnProperty("nextToken")&&(r.nextToken=e.bytes===String?$util.base64.encode(t.nextToken,0,t.nextToken.length):e.bytes===Array?Array.prototype.slice.call(t.nextToken):t.nextToken),t.aggs!=null&&t.hasOwnProperty("aggs")&&(r.aggs=e.bytes===String?$util.base64.encode(t.aggs,0,t.aggs.length):e.bytes===Array?Array.prototype.slice.call(t.aggs):t.aggs),t.groupBys!=null&&t.hasOwnProperty("groupBys")&&(r.groupBys=e.bytes===String?$util.base64.encode(t.groupBys,0,t.groupBys.length):e.bytes===Array?Array.prototype.slice.call(t.groupBys):t.groupBys),t.consumed!=null&&t.hasOwnProperty("consumed")&&(r.consumed=$root.main.proto.ConsumedCapacity.toObject(t.consumed,e)),t.reservedConsumed!=null&&t.hasOwnProperty("reservedConsumed")&&(r.reservedConsumed=$root.main.proto.ConsumedCapacity.toObject(t.reservedConsumed,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SearchHit=function(){function n(o){if(this.searchInnerHits=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.score=0,n.prototype.highlightResult=null,n.prototype.searchInnerHits=$util.emptyArray,n.prototype.nestedDocOffset=0,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.score!=null&&Object.hasOwnProperty.call(t,"score")&&e.uint32(25).double(t.score),t.highlightResult!=null&&Object.hasOwnProperty.call(t,"highlightResult")&&$root.search.proto.HighlightResult.encode(t.highlightResult,e.uint32(34).fork()).ldelim(),t.searchInnerHits!=null&&t.searchInnerHits.length)for(var r=0;r<t.searchInnerHits.length;++r)$root.search.proto.SearchInnerHit.encode(t.searchInnerHits[r],e.uint32(42).fork()).ldelim();return t.nestedDocOffset!=null&&Object.hasOwnProperty.call(t,"nestedDocOffset")&&e.uint32(48).int32(t.nestedDocOffset),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SearchHit;t.pos<r;){var l=t.uint32();switch(l>>>3){case 3:i.score=t.double();break;case 4:i.highlightResult=$root.search.proto.HighlightResult.decode(t,t.uint32());break;case 5:i.searchInnerHits&&i.searchInnerHits.length||(i.searchInnerHits=[]),i.searchInnerHits.push($root.search.proto.SearchInnerHit.decode(t,t.uint32()));break;case 6:i.nestedDocOffset=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.score!=null&&t.hasOwnProperty("score")&&typeof t.score!="number")return"score: number expected";if(t.highlightResult!=null&&t.hasOwnProperty("highlightResult")){var e=$root.search.proto.HighlightResult.verify(t.highlightResult);if(e)return"highlightResult."+e}if(t.searchInnerHits!=null&&t.hasOwnProperty("searchInnerHits")){if(!Array.isArray(t.searchInnerHits))return"searchInnerHits: array expected";for(var r=0;r<t.searchInnerHits.length;++r){var e=$root.search.proto.SearchInnerHit.verify(t.searchInnerHits[r]);if(e)return"searchInnerHits."+e}}return t.nestedDocOffset!=null&&t.hasOwnProperty("nestedDocOffset")&&!$util.isInteger(t.nestedDocOffset)?"nestedDocOffset: integer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.SearchHit)return t;var e=new $root.search.proto.SearchHit;if(t.score!=null&&(e.score=Number(t.score)),t.highlightResult!=null){if(typeof t.highlightResult!="object")throw TypeError(".search.proto.SearchHit.highlightResult: object expected");e.highlightResult=$root.search.proto.HighlightResult.fromObject(t.highlightResult)}if(t.searchInnerHits){if(!Array.isArray(t.searchInnerHits))throw TypeError(".search.proto.SearchHit.searchInnerHits: array expected");e.searchInnerHits=[];for(var r=0;r<t.searchInnerHits.length;++r){if(typeof t.searchInnerHits[r]!="object")throw TypeError(".search.proto.SearchHit.searchInnerHits: object expected");e.searchInnerHits[r]=$root.search.proto.SearchInnerHit.fromObject(t.searchInnerHits[r])}}return t.nestedDocOffset!=null&&(e.nestedDocOffset=t.nestedDocOffset|0),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.searchInnerHits=[]),e.defaults&&(r.score=0,r.highlightResult=null,r.nestedDocOffset=0),t.score!=null&&t.hasOwnProperty("score")&&(r.score=e.json&&!isFinite(t.score)?String(t.score):t.score),t.highlightResult!=null&&t.hasOwnProperty("highlightResult")&&(r.highlightResult=$root.search.proto.HighlightResult.toObject(t.highlightResult,e)),t.searchInnerHits&&t.searchInnerHits.length){r.searchInnerHits=[];for(var i=0;i<t.searchInnerHits.length;++i)r.searchInnerHits[i]=$root.search.proto.SearchInnerHit.toObject(t.searchInnerHits[i],e)}return t.nestedDocOffset!=null&&t.hasOwnProperty("nestedDocOffset")&&(r.nestedDocOffset=t.nestedDocOffset),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SearchInnerHit=function(){function n(o){if(this.searchHits=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.path="",n.prototype.searchHits=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.path!=null&&Object.hasOwnProperty.call(t,"path")&&e.uint32(10).string(t.path),t.searchHits!=null&&t.searchHits.length)for(var r=0;r<t.searchHits.length;++r)$root.search.proto.SearchHit.encode(t.searchHits[r],e.uint32(18).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SearchInnerHit;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.path=t.string();break;case 2:i.searchHits&&i.searchHits.length||(i.searchHits=[]),i.searchHits.push($root.search.proto.SearchHit.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.path!=null&&t.hasOwnProperty("path")&&!$util.isString(t.path))return"path: string expected";if(t.searchHits!=null&&t.hasOwnProperty("searchHits")){if(!Array.isArray(t.searchHits))return"searchHits: array expected";for(var e=0;e<t.searchHits.length;++e){var r=$root.search.proto.SearchHit.verify(t.searchHits[e]);if(r)return"searchHits."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.SearchInnerHit)return t;var e=new $root.search.proto.SearchInnerHit;if(t.path!=null&&(e.path=String(t.path)),t.searchHits){if(!Array.isArray(t.searchHits))throw TypeError(".search.proto.SearchInnerHit.searchHits: array expected");e.searchHits=[];for(var r=0;r<t.searchHits.length;++r){if(typeof t.searchHits[r]!="object")throw TypeError(".search.proto.SearchInnerHit.searchHits: object expected");e.searchHits[r]=$root.search.proto.SearchHit.fromObject(t.searchHits[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.searchHits=[]),e.defaults&&(r.path=""),t.path!=null&&t.hasOwnProperty("path")&&(r.path=t.path),t.searchHits&&t.searchHits.length){r.searchHits=[];for(var i=0;i<t.searchHits.length;++i)r.searchHits[i]=$root.search.proto.SearchHit.toObject(t.searchHits[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.HighlightResult=function(){function n(o){if(this.highlightFields=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.highlightFields=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.highlightFields!=null&&t.highlightFields.length)for(var r=0;r<t.highlightFields.length;++r)$root.search.proto.HighlightField.encode(t.highlightFields[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.HighlightResult;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.highlightFields&&i.highlightFields.length||(i.highlightFields=[]),i.highlightFields.push($root.search.proto.HighlightField.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.highlightFields!=null&&t.hasOwnProperty("highlightFields")){if(!Array.isArray(t.highlightFields))return"highlightFields: array expected";for(var e=0;e<t.highlightFields.length;++e){var r=$root.search.proto.HighlightField.verify(t.highlightFields[e]);if(r)return"highlightFields."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.HighlightResult)return t;var e=new $root.search.proto.HighlightResult;if(t.highlightFields){if(!Array.isArray(t.highlightFields))throw TypeError(".search.proto.HighlightResult.highlightFields: array expected");e.highlightFields=[];for(var r=0;r<t.highlightFields.length;++r){if(typeof t.highlightFields[r]!="object")throw TypeError(".search.proto.HighlightResult.highlightFields: object expected");e.highlightFields[r]=$root.search.proto.HighlightField.fromObject(t.highlightFields[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.highlightFields=[]),t.highlightFields&&t.highlightFields.length){r.highlightFields=[];for(var i=0;i<t.highlightFields.length;++i)r.highlightFields[i]=$root.search.proto.HighlightField.toObject(t.highlightFields[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.HighlightField=function(){function n(o){if(this.fieldFragments=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.fieldFragments=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.fieldFragments!=null&&t.fieldFragments.length)for(var r=0;r<t.fieldFragments.length;++r)e.uint32(18).string(t.fieldFragments[r]);return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.HighlightField;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.fieldFragments&&i.fieldFragments.length||(i.fieldFragments=[]),i.fieldFragments.push(t.string());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.fieldFragments!=null&&t.hasOwnProperty("fieldFragments")){if(!Array.isArray(t.fieldFragments))return"fieldFragments: array expected";for(var e=0;e<t.fieldFragments.length;++e)if(!$util.isString(t.fieldFragments[e]))return"fieldFragments: string[] expected"}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.HighlightField)return t;var e=new $root.search.proto.HighlightField;if(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.fieldFragments){if(!Array.isArray(t.fieldFragments))throw TypeError(".search.proto.HighlightField.fieldFragments: array expected");e.fieldFragments=[];for(var r=0;r<t.fieldFragments.length;++r)e.fieldFragments[r]=String(t.fieldFragments[r])}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.fieldFragments=[]),e.defaults&&(r.fieldName=""),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.fieldFragments&&t.fieldFragments.length){r.fieldFragments=[];for(var i=0;i<t.fieldFragments.length;++i)r.fieldFragments[i]=t.fieldFragments[i]}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.IndexOptions=function(){var n={},o=Object.create(n);return o[n[1]="DOCS"]=1,o[n[2]="FREQS"]=2,o[n[3]="POSITIONS"]=3,o[n[4]="OFFSETS"]=4,o}(),c.FieldType=function(){var n={},o=Object.create(n);return o[n[1]="LONG"]=1,o[n[2]="DOUBLE"]=2,o[n[3]="BOOLEAN"]=3,o[n[4]="KEYWORD"]=4,o[n[5]="TEXT"]=5,o[n[6]="NESTED"]=6,o[n[7]="GEO_POINT"]=7,o[n[8]="DATE"]=8,o[n[9]="VECTOR"]=9,o}(),c.DateTimeUnit=function(){var n={},o=Object.create(n);return o[n[1]="YEAR"]=1,o[n[2]="QUARTER_YEAR"]=2,o[n[3]="MONTH"]=3,o[n[4]="WEEK"]=4,o[n[5]="DAY"]=5,o[n[6]="HOUR"]=6,o[n[7]="MINUTE"]=7,o[n[8]="SECOND"]=8,o[n[9]="MILLISECOND"]=9,o}(),c.DateTimeValue=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.value=0,n.prototype.unit=1,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.value!=null&&Object.hasOwnProperty.call(t,"value")&&e.uint32(8).int32(t.value),t.unit!=null&&Object.hasOwnProperty.call(t,"unit")&&e.uint32(16).int32(t.unit),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DateTimeValue;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.value=t.int32();break;case 2:i.unit=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.value!=null&&t.hasOwnProperty("value")&&!$util.isInteger(t.value))return"value: integer expected";if(t.unit!=null&&t.hasOwnProperty("unit"))switch(t.unit){default:return"unit: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:break}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.DateTimeValue)return t;var e=new $root.search.proto.DateTimeValue;switch(t.value!=null&&(e.value=t.value|0),t.unit){case"YEAR":case 1:e.unit=1;break;case"QUARTER_YEAR":case 2:e.unit=2;break;case"MONTH":case 3:e.unit=3;break;case"WEEK":case 4:e.unit=4;break;case"DAY":case 5:e.unit=5;break;case"HOUR":case 6:e.unit=6;break;case"MINUTE":case 7:e.unit=7;break;case"SECOND":case 8:e.unit=8;break;case"MILLISECOND":case 9:e.unit=9;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.value=0,r.unit=e.enums===String?"YEAR":1),t.value!=null&&t.hasOwnProperty("value")&&(r.value=t.value),t.unit!=null&&t.hasOwnProperty("unit")&&(r.unit=e.enums===String?$root.search.proto.DateTimeUnit[t.unit]:t.unit),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SingleWordAnalyzerParameter=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.caseSensitive=!1,n.prototype.delimitWord=!1,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.caseSensitive!=null&&Object.hasOwnProperty.call(t,"caseSensitive")&&e.uint32(8).bool(t.caseSensitive),t.delimitWord!=null&&Object.hasOwnProperty.call(t,"delimitWord")&&e.uint32(16).bool(t.delimitWord),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SingleWordAnalyzerParameter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.caseSensitive=t.bool();break;case 2:i.delimitWord=t.bool();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.caseSensitive!=null&&t.hasOwnProperty("caseSensitive")&&typeof t.caseSensitive!="boolean"?"caseSensitive: boolean expected":t.delimitWord!=null&&t.hasOwnProperty("delimitWord")&&typeof t.delimitWord!="boolean"?"delimitWord: boolean expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.SingleWordAnalyzerParameter)return t;var e=new $root.search.proto.SingleWordAnalyzerParameter;return t.caseSensitive!=null&&(e.caseSensitive=!!t.caseSensitive),t.delimitWord!=null&&(e.delimitWord=!!t.delimitWord),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.caseSensitive=!1,r.delimitWord=!1),t.caseSensitive!=null&&t.hasOwnProperty("caseSensitive")&&(r.caseSensitive=t.caseSensitive),t.delimitWord!=null&&t.hasOwnProperty("delimitWord")&&(r.delimitWord=t.delimitWord),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SplitAnalyzerParameter=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.delimiter="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.delimiter!=null&&Object.hasOwnProperty.call(t,"delimiter")&&e.uint32(10).string(t.delimiter),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SplitAnalyzerParameter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.delimiter=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.delimiter!=null&&t.hasOwnProperty("delimiter")&&!$util.isString(t.delimiter)?"delimiter: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.SplitAnalyzerParameter)return t;var e=new $root.search.proto.SplitAnalyzerParameter;return t.delimiter!=null&&(e.delimiter=String(t.delimiter)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.delimiter=""),t.delimiter!=null&&t.hasOwnProperty("delimiter")&&(r.delimiter=t.delimiter),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.FuzzyAnalyzerParameter=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.minChars=0,n.prototype.maxChars=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.minChars!=null&&Object.hasOwnProperty.call(t,"minChars")&&e.uint32(8).int32(t.minChars),t.maxChars!=null&&Object.hasOwnProperty.call(t,"maxChars")&&e.uint32(16).int32(t.maxChars),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.FuzzyAnalyzerParameter;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.minChars=t.int32();break;case 2:i.maxChars=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.minChars!=null&&t.hasOwnProperty("minChars")&&!$util.isInteger(t.minChars)?"minChars: integer expected":t.maxChars!=null&&t.hasOwnProperty("maxChars")&&!$util.isInteger(t.maxChars)?"maxChars: integer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.FuzzyAnalyzerParameter)return t;var e=new $root.search.proto.FuzzyAnalyzerParameter;return t.minChars!=null&&(e.minChars=t.minChars|0),t.maxChars!=null&&(e.maxChars=t.maxChars|0),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.minChars=0,r.maxChars=0),t.minChars!=null&&t.hasOwnProperty("minChars")&&(r.minChars=t.minChars),t.maxChars!=null&&t.hasOwnProperty("maxChars")&&(r.maxChars=t.maxChars),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.FieldSchema=function(){function n(o){if(this.fieldSchemas=[],this.sourceFieldNames=[],this.dateFormats=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldName="",n.prototype.fieldType=1,n.prototype.indexOptions=1,n.prototype.analyzer="",n.prototype.index=!1,n.prototype.docValues=!1,n.prototype.store=!1,n.prototype.fieldSchemas=$util.emptyArray,n.prototype.isArray=!1,n.prototype.analyzerParameter=$util.newBuffer([]),n.prototype.isVirtualField=!1,n.prototype.sourceFieldNames=$util.emptyArray,n.prototype.dateFormats=$util.emptyArray,n.prototype.enableHighlighting=!1,n.prototype.vectorOptions=null,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.fieldName!=null&&Object.hasOwnProperty.call(t,"fieldName")&&e.uint32(10).string(t.fieldName),t.fieldType!=null&&Object.hasOwnProperty.call(t,"fieldType")&&e.uint32(16).int32(t.fieldType),t.indexOptions!=null&&Object.hasOwnProperty.call(t,"indexOptions")&&e.uint32(24).int32(t.indexOptions),t.analyzer!=null&&Object.hasOwnProperty.call(t,"analyzer")&&e.uint32(34).string(t.analyzer),t.index!=null&&Object.hasOwnProperty.call(t,"index")&&e.uint32(40).bool(t.index),t.docValues!=null&&Object.hasOwnProperty.call(t,"docValues")&&e.uint32(48).bool(t.docValues),t.store!=null&&Object.hasOwnProperty.call(t,"store")&&e.uint32(56).bool(t.store),t.fieldSchemas!=null&&t.fieldSchemas.length)for(var r=0;r<t.fieldSchemas.length;++r)$root.search.proto.FieldSchema.encode(t.fieldSchemas[r],e.uint32(66).fork()).ldelim();if(t.isArray!=null&&Object.hasOwnProperty.call(t,"isArray")&&e.uint32(72).bool(t.isArray),t.analyzerParameter!=null&&Object.hasOwnProperty.call(t,"analyzerParameter")&&e.uint32(82).bytes(t.analyzerParameter),t.isVirtualField!=null&&Object.hasOwnProperty.call(t,"isVirtualField")&&e.uint32(88).bool(t.isVirtualField),t.sourceFieldNames!=null&&t.sourceFieldNames.length)for(var r=0;r<t.sourceFieldNames.length;++r)e.uint32(98).string(t.sourceFieldNames[r]);if(t.dateFormats!=null&&t.dateFormats.length)for(var r=0;r<t.dateFormats.length;++r)e.uint32(106).string(t.dateFormats[r]);return t.enableHighlighting!=null&&Object.hasOwnProperty.call(t,"enableHighlighting")&&e.uint32(112).bool(t.enableHighlighting),t.vectorOptions!=null&&Object.hasOwnProperty.call(t,"vectorOptions")&&$root.search.proto.VectorOptions.encode(t.vectorOptions,e.uint32(122).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.FieldSchema;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldName=t.string();break;case 2:i.fieldType=t.int32();break;case 3:i.indexOptions=t.int32();break;case 4:i.analyzer=t.string();break;case 5:i.index=t.bool();break;case 6:i.docValues=t.bool();break;case 7:i.store=t.bool();break;case 8:i.fieldSchemas&&i.fieldSchemas.length||(i.fieldSchemas=[]),i.fieldSchemas.push($root.search.proto.FieldSchema.decode(t,t.uint32()));break;case 9:i.isArray=t.bool();break;case 10:i.analyzerParameter=t.bytes();break;case 11:i.isVirtualField=t.bool();break;case 12:i.sourceFieldNames&&i.sourceFieldNames.length||(i.sourceFieldNames=[]),i.sourceFieldNames.push(t.string());break;case 13:i.dateFormats&&i.dateFormats.length||(i.dateFormats=[]),i.dateFormats.push(t.string());break;case 14:i.enableHighlighting=t.bool();break;case 15:i.vectorOptions=$root.search.proto.VectorOptions.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldName!=null&&t.hasOwnProperty("fieldName")&&!$util.isString(t.fieldName))return"fieldName: string expected";if(t.fieldType!=null&&t.hasOwnProperty("fieldType"))switch(t.fieldType){default:return"fieldType: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:break}if(t.indexOptions!=null&&t.hasOwnProperty("indexOptions"))switch(t.indexOptions){default:return"indexOptions: enum value expected";case 1:case 2:case 3:case 4:break}if(t.analyzer!=null&&t.hasOwnProperty("analyzer")&&!$util.isString(t.analyzer))return"analyzer: string expected";if(t.index!=null&&t.hasOwnProperty("index")&&typeof t.index!="boolean")return"index: boolean expected";if(t.docValues!=null&&t.hasOwnProperty("docValues")&&typeof t.docValues!="boolean")return"docValues: boolean expected";if(t.store!=null&&t.hasOwnProperty("store")&&typeof t.store!="boolean")return"store: boolean expected";if(t.fieldSchemas!=null&&t.hasOwnProperty("fieldSchemas")){if(!Array.isArray(t.fieldSchemas))return"fieldSchemas: array expected";for(var e=0;e<t.fieldSchemas.length;++e){var r=$root.search.proto.FieldSchema.verify(t.fieldSchemas[e]);if(r)return"fieldSchemas."+r}}if(t.isArray!=null&&t.hasOwnProperty("isArray")&&typeof t.isArray!="boolean")return"isArray: boolean expected";if(t.analyzerParameter!=null&&t.hasOwnProperty("analyzerParameter")&&!(t.analyzerParameter&&typeof t.analyzerParameter.length=="number"||$util.isString(t.analyzerParameter)))return"analyzerParameter: buffer expected";if(t.isVirtualField!=null&&t.hasOwnProperty("isVirtualField")&&typeof t.isVirtualField!="boolean")return"isVirtualField: boolean expected";if(t.sourceFieldNames!=null&&t.hasOwnProperty("sourceFieldNames")){if(!Array.isArray(t.sourceFieldNames))return"sourceFieldNames: array expected";for(var e=0;e<t.sourceFieldNames.length;++e)if(!$util.isString(t.sourceFieldNames[e]))return"sourceFieldNames: string[] expected"}if(t.dateFormats!=null&&t.hasOwnProperty("dateFormats")){if(!Array.isArray(t.dateFormats))return"dateFormats: array expected";for(var e=0;e<t.dateFormats.length;++e)if(!$util.isString(t.dateFormats[e]))return"dateFormats: string[] expected"}if(t.enableHighlighting!=null&&t.hasOwnProperty("enableHighlighting")&&typeof t.enableHighlighting!="boolean")return"enableHighlighting: boolean expected";if(t.vectorOptions!=null&&t.hasOwnProperty("vectorOptions")){var r=$root.search.proto.VectorOptions.verify(t.vectorOptions);if(r)return"vectorOptions."+r}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.FieldSchema)return t;var e=new $root.search.proto.FieldSchema;switch(t.fieldName!=null&&(e.fieldName=String(t.fieldName)),t.fieldType){case"LONG":case 1:e.fieldType=1;break;case"DOUBLE":case 2:e.fieldType=2;break;case"BOOLEAN":case 3:e.fieldType=3;break;case"KEYWORD":case 4:e.fieldType=4;break;case"TEXT":case 5:e.fieldType=5;break;case"NESTED":case 6:e.fieldType=6;break;case"GEO_POINT":case 7:e.fieldType=7;break;case"DATE":case 8:e.fieldType=8;break;case"VECTOR":case 9:e.fieldType=9;break}switch(t.indexOptions){case"DOCS":case 1:e.indexOptions=1;break;case"FREQS":case 2:e.indexOptions=2;break;case"POSITIONS":case 3:e.indexOptions=3;break;case"OFFSETS":case 4:e.indexOptions=4;break}if(t.analyzer!=null&&(e.analyzer=String(t.analyzer)),t.index!=null&&(e.index=!!t.index),t.docValues!=null&&(e.docValues=!!t.docValues),t.store!=null&&(e.store=!!t.store),t.fieldSchemas){if(!Array.isArray(t.fieldSchemas))throw TypeError(".search.proto.FieldSchema.fieldSchemas: array expected");e.fieldSchemas=[];for(var r=0;r<t.fieldSchemas.length;++r){if(typeof t.fieldSchemas[r]!="object")throw TypeError(".search.proto.FieldSchema.fieldSchemas: object expected");e.fieldSchemas[r]=$root.search.proto.FieldSchema.fromObject(t.fieldSchemas[r])}}if(t.isArray!=null&&(e.isArray=!!t.isArray),t.analyzerParameter!=null&&(typeof t.analyzerParameter=="string"?$util.base64.decode(t.analyzerParameter,e.analyzerParameter=$util.newBuffer($util.base64.length(t.analyzerParameter)),0):t.analyzerParameter.length&&(e.analyzerParameter=t.analyzerParameter)),t.isVirtualField!=null&&(e.isVirtualField=!!t.isVirtualField),t.sourceFieldNames){if(!Array.isArray(t.sourceFieldNames))throw TypeError(".search.proto.FieldSchema.sourceFieldNames: array expected");e.sourceFieldNames=[];for(var r=0;r<t.sourceFieldNames.length;++r)e.sourceFieldNames[r]=String(t.sourceFieldNames[r])}if(t.dateFormats){if(!Array.isArray(t.dateFormats))throw TypeError(".search.proto.FieldSchema.dateFormats: array expected");e.dateFormats=[];for(var r=0;r<t.dateFormats.length;++r)e.dateFormats[r]=String(t.dateFormats[r])}if(t.enableHighlighting!=null&&(e.enableHighlighting=!!t.enableHighlighting),t.vectorOptions!=null){if(typeof t.vectorOptions!="object")throw TypeError(".search.proto.FieldSchema.vectorOptions: object expected");e.vectorOptions=$root.search.proto.VectorOptions.fromObject(t.vectorOptions)}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.fieldSchemas=[],r.sourceFieldNames=[],r.dateFormats=[]),e.defaults&&(r.fieldName="",r.fieldType=e.enums===String?"LONG":1,r.indexOptions=e.enums===String?"DOCS":1,r.analyzer="",r.index=!1,r.docValues=!1,r.store=!1,r.isArray=!1,e.bytes===String?r.analyzerParameter="":(r.analyzerParameter=[],e.bytes!==Array&&(r.analyzerParameter=$util.newBuffer(r.analyzerParameter))),r.isVirtualField=!1,r.enableHighlighting=!1,r.vectorOptions=null),t.fieldName!=null&&t.hasOwnProperty("fieldName")&&(r.fieldName=t.fieldName),t.fieldType!=null&&t.hasOwnProperty("fieldType")&&(r.fieldType=e.enums===String?$root.search.proto.FieldType[t.fieldType]:t.fieldType),t.indexOptions!=null&&t.hasOwnProperty("indexOptions")&&(r.indexOptions=e.enums===String?$root.search.proto.IndexOptions[t.indexOptions]:t.indexOptions),t.analyzer!=null&&t.hasOwnProperty("analyzer")&&(r.analyzer=t.analyzer),t.index!=null&&t.hasOwnProperty("index")&&(r.index=t.index),t.docValues!=null&&t.hasOwnProperty("docValues")&&(r.docValues=t.docValues),t.store!=null&&t.hasOwnProperty("store")&&(r.store=t.store),t.fieldSchemas&&t.fieldSchemas.length){r.fieldSchemas=[];for(var i=0;i<t.fieldSchemas.length;++i)r.fieldSchemas[i]=$root.search.proto.FieldSchema.toObject(t.fieldSchemas[i],e)}if(t.isArray!=null&&t.hasOwnProperty("isArray")&&(r.isArray=t.isArray),t.analyzerParameter!=null&&t.hasOwnProperty("analyzerParameter")&&(r.analyzerParameter=e.bytes===String?$util.base64.encode(t.analyzerParameter,0,t.analyzerParameter.length):e.bytes===Array?Array.prototype.slice.call(t.analyzerParameter):t.analyzerParameter),t.isVirtualField!=null&&t.hasOwnProperty("isVirtualField")&&(r.isVirtualField=t.isVirtualField),t.sourceFieldNames&&t.sourceFieldNames.length){r.sourceFieldNames=[];for(var i=0;i<t.sourceFieldNames.length;++i)r.sourceFieldNames[i]=t.sourceFieldNames[i]}if(t.dateFormats&&t.dateFormats.length){r.dateFormats=[];for(var i=0;i<t.dateFormats.length;++i)r.dateFormats[i]=t.dateFormats[i]}return t.enableHighlighting!=null&&t.hasOwnProperty("enableHighlighting")&&(r.enableHighlighting=t.enableHighlighting),t.vectorOptions!=null&&t.hasOwnProperty("vectorOptions")&&(r.vectorOptions=$root.search.proto.VectorOptions.toObject(t.vectorOptions,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.VectorDataType=function(){var n={},o=Object.create(n);return o[n[2]="VD_FLOAT_32"]=2,o}(),c.VectorOptions=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.dataType=2,n.prototype.dimension=0,n.prototype.metricType=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.dataType!=null&&Object.hasOwnProperty.call(t,"dataType")&&e.uint32(8).int32(t.dataType),t.dimension!=null&&Object.hasOwnProperty.call(t,"dimension")&&e.uint32(16).int32(t.dimension),t.metricType!=null&&Object.hasOwnProperty.call(t,"metricType")&&e.uint32(24).int32(t.metricType),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.VectorOptions;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.dataType=t.int32();break;case 2:i.dimension=t.int32();break;case 3:i.metricType=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.dataType!=null&&t.hasOwnProperty("dataType"))switch(t.dataType){default:return"dataType: enum value expected";case 2:break}if(t.dimension!=null&&t.hasOwnProperty("dimension")&&!$util.isInteger(t.dimension))return"dimension: integer expected";if(t.metricType!=null&&t.hasOwnProperty("metricType"))switch(t.metricType){default:return"metricType: enum value expected";case 0:case 1:case 2:break}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.VectorOptions)return t;var e=new $root.search.proto.VectorOptions;switch(t.dataType){case"VD_FLOAT_32":case 2:e.dataType=2;break}switch(t.dimension!=null&&(e.dimension=t.dimension|0),t.metricType){case"VM_EUCLIDEAN":case 0:e.metricType=0;break;case"VM_COSINE":case 1:e.metricType=1;break;case"VM_DOT_PRODUCT":case 2:e.metricType=2;break}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.dataType=e.enums===String?"VD_FLOAT_32":2,r.dimension=0,r.metricType=e.enums===String?"VM_EUCLIDEAN":0),t.dataType!=null&&t.hasOwnProperty("dataType")&&(r.dataType=e.enums===String?$root.search.proto.VectorDataType[t.dataType]:t.dataType),t.dimension!=null&&t.hasOwnProperty("dimension")&&(r.dimension=t.dimension),t.metricType!=null&&t.hasOwnProperty("metricType")&&(r.metricType=e.enums===String?$root.search.proto.VectorMetricType[t.metricType]:t.metricType),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.VectorMetricType=function(){var n={},o=Object.create(n);return o[n[0]="VM_EUCLIDEAN"]=0,o[n[1]="VM_COSINE"]=1,o[n[2]="VM_DOT_PRODUCT"]=2,o}(),c.IndexSchema=function(){function n(o){if(this.fieldSchemas=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.fieldSchemas=$util.emptyArray,n.prototype.indexSetting=null,n.prototype.indexSort=null,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.fieldSchemas!=null&&t.fieldSchemas.length)for(var r=0;r<t.fieldSchemas.length;++r)$root.search.proto.FieldSchema.encode(t.fieldSchemas[r],e.uint32(10).fork()).ldelim();return t.indexSetting!=null&&Object.hasOwnProperty.call(t,"indexSetting")&&$root.search.proto.IndexSetting.encode(t.indexSetting,e.uint32(18).fork()).ldelim(),t.indexSort!=null&&Object.hasOwnProperty.call(t,"indexSort")&&$root.search.proto.Sort.encode(t.indexSort,e.uint32(26).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.IndexSchema;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.fieldSchemas&&i.fieldSchemas.length||(i.fieldSchemas=[]),i.fieldSchemas.push($root.search.proto.FieldSchema.decode(t,t.uint32()));break;case 2:i.indexSetting=$root.search.proto.IndexSetting.decode(t,t.uint32());break;case 3:i.indexSort=$root.search.proto.Sort.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.fieldSchemas!=null&&t.hasOwnProperty("fieldSchemas")){if(!Array.isArray(t.fieldSchemas))return"fieldSchemas: array expected";for(var e=0;e<t.fieldSchemas.length;++e){var r=$root.search.proto.FieldSchema.verify(t.fieldSchemas[e]);if(r)return"fieldSchemas."+r}}if(t.indexSetting!=null&&t.hasOwnProperty("indexSetting")){var r=$root.search.proto.IndexSetting.verify(t.indexSetting);if(r)return"indexSetting."+r}if(t.indexSort!=null&&t.hasOwnProperty("indexSort")){var r=$root.search.proto.Sort.verify(t.indexSort);if(r)return"indexSort."+r}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.IndexSchema)return t;var e=new $root.search.proto.IndexSchema;if(t.fieldSchemas){if(!Array.isArray(t.fieldSchemas))throw TypeError(".search.proto.IndexSchema.fieldSchemas: array expected");e.fieldSchemas=[];for(var r=0;r<t.fieldSchemas.length;++r){if(typeof t.fieldSchemas[r]!="object")throw TypeError(".search.proto.IndexSchema.fieldSchemas: object expected");e.fieldSchemas[r]=$root.search.proto.FieldSchema.fromObject(t.fieldSchemas[r])}}if(t.indexSetting!=null){if(typeof t.indexSetting!="object")throw TypeError(".search.proto.IndexSchema.indexSetting: object expected");e.indexSetting=$root.search.proto.IndexSetting.fromObject(t.indexSetting)}if(t.indexSort!=null){if(typeof t.indexSort!="object")throw TypeError(".search.proto.IndexSchema.indexSort: object expected");e.indexSort=$root.search.proto.Sort.fromObject(t.indexSort)}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.fieldSchemas=[]),e.defaults&&(r.indexSetting=null,r.indexSort=null),t.fieldSchemas&&t.fieldSchemas.length){r.fieldSchemas=[];for(var i=0;i<t.fieldSchemas.length;++i)r.fieldSchemas[i]=$root.search.proto.FieldSchema.toObject(t.fieldSchemas[i],e)}return t.indexSetting!=null&&t.hasOwnProperty("indexSetting")&&(r.indexSetting=$root.search.proto.IndexSetting.toObject(t.indexSetting,e)),t.indexSort!=null&&t.hasOwnProperty("indexSort")&&(r.indexSort=$root.search.proto.Sort.toObject(t.indexSort,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.IndexSetting=function(){function n(o){if(this.routingFields=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.numberOfShards=0,n.prototype.routingFields=$util.emptyArray,n.prototype.routingPartitionSize=0,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.numberOfShards!=null&&Object.hasOwnProperty.call(t,"numberOfShards")&&e.uint32(8).int32(t.numberOfShards),t.routingFields!=null&&t.routingFields.length)for(var r=0;r<t.routingFields.length;++r)e.uint32(18).string(t.routingFields[r]);return t.routingPartitionSize!=null&&Object.hasOwnProperty.call(t,"routingPartitionSize")&&e.uint32(24).int32(t.routingPartitionSize),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.IndexSetting;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.numberOfShards=t.int32();break;case 2:i.routingFields&&i.routingFields.length||(i.routingFields=[]),i.routingFields.push(t.string());break;case 3:i.routingPartitionSize=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.numberOfShards!=null&&t.hasOwnProperty("numberOfShards")&&!$util.isInteger(t.numberOfShards))return"numberOfShards: integer expected";if(t.routingFields!=null&&t.hasOwnProperty("routingFields")){if(!Array.isArray(t.routingFields))return"routingFields: array expected";for(var e=0;e<t.routingFields.length;++e)if(!$util.isString(t.routingFields[e]))return"routingFields: string[] expected"}return t.routingPartitionSize!=null&&t.hasOwnProperty("routingPartitionSize")&&!$util.isInteger(t.routingPartitionSize)?"routingPartitionSize: integer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.IndexSetting)return t;var e=new $root.search.proto.IndexSetting;if(t.numberOfShards!=null&&(e.numberOfShards=t.numberOfShards|0),t.routingFields){if(!Array.isArray(t.routingFields))throw TypeError(".search.proto.IndexSetting.routingFields: array expected");e.routingFields=[];for(var r=0;r<t.routingFields.length;++r)e.routingFields[r]=String(t.routingFields[r])}return t.routingPartitionSize!=null&&(e.routingPartitionSize=t.routingPartitionSize|0),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.routingFields=[]),e.defaults&&(r.numberOfShards=0,r.routingPartitionSize=0),t.numberOfShards!=null&&t.hasOwnProperty("numberOfShards")&&(r.numberOfShards=t.numberOfShards),t.routingFields&&t.routingFields.length){r.routingFields=[];for(var i=0;i<t.routingFields.length;++i)r.routingFields[i]=t.routingFields[i]}return t.routingPartitionSize!=null&&t.hasOwnProperty("routingPartitionSize")&&(r.routingPartitionSize=t.routingPartitionSize),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.CreateSearchIndexRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.indexName="",n.prototype.schema=null,n.prototype.sourceIndexName="",n.prototype.timeToLive=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e.uint32(10).string(t.tableName),e.uint32(18).string(t.indexName),t.schema!=null&&Object.hasOwnProperty.call(t,"schema")&&$root.search.proto.IndexSchema.encode(t.schema,e.uint32(26).fork()).ldelim(),t.sourceIndexName!=null&&Object.hasOwnProperty.call(t,"sourceIndexName")&&e.uint32(34).string(t.sourceIndexName),t.timeToLive!=null&&Object.hasOwnProperty.call(t,"timeToLive")&&e.uint32(40).int32(t.timeToLive),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.CreateSearchIndexRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.indexName=t.string();break;case 3:i.schema=$root.search.proto.IndexSchema.decode(t,t.uint32());break;case 4:i.sourceIndexName=t.string();break;case 5:i.timeToLive=t.int32();break;default:t.skipType(l&7);break}}if(!i.hasOwnProperty("tableName"))throw $util.ProtocolError("missing required 'tableName'",{instance:i});if(!i.hasOwnProperty("indexName"))throw $util.ProtocolError("missing required 'indexName'",{instance:i});return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!$util.isString(t.tableName))return"tableName: string expected";if(!$util.isString(t.indexName))return"indexName: string expected";if(t.schema!=null&&t.hasOwnProperty("schema")){var e=$root.search.proto.IndexSchema.verify(t.schema);if(e)return"schema."+e}return t.sourceIndexName!=null&&t.hasOwnProperty("sourceIndexName")&&!$util.isString(t.sourceIndexName)?"sourceIndexName: string expected":t.timeToLive!=null&&t.hasOwnProperty("timeToLive")&&!$util.isInteger(t.timeToLive)?"timeToLive: integer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.CreateSearchIndexRequest)return t;var e=new $root.search.proto.CreateSearchIndexRequest;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.indexName!=null&&(e.indexName=String(t.indexName)),t.schema!=null){if(typeof t.schema!="object")throw TypeError(".search.proto.CreateSearchIndexRequest.schema: object expected");e.schema=$root.search.proto.IndexSchema.fromObject(t.schema)}return t.sourceIndexName!=null&&(e.sourceIndexName=String(t.sourceIndexName)),t.timeToLive!=null&&(e.timeToLive=t.timeToLive|0),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",r.indexName="",r.schema=null,r.sourceIndexName="",r.timeToLive=0),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.indexName!=null&&t.hasOwnProperty("indexName")&&(r.indexName=t.indexName),t.schema!=null&&t.hasOwnProperty("schema")&&(r.schema=$root.search.proto.IndexSchema.toObject(t.schema,e)),t.sourceIndexName!=null&&t.hasOwnProperty("sourceIndexName")&&(r.sourceIndexName=t.sourceIndexName),t.timeToLive!=null&&t.hasOwnProperty("timeToLive")&&(r.timeToLive=t.timeToLive),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.CreateSearchIndexResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.CreateSearchIndexResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.search.proto.CreateSearchIndexResponse?t:new $root.search.proto.CreateSearchIndexResponse},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.UpdateSearchIndexRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.indexName="",n.prototype.timeToLive=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.tableName!=null&&Object.hasOwnProperty.call(t,"tableName")&&e.uint32(10).string(t.tableName),t.indexName!=null&&Object.hasOwnProperty.call(t,"indexName")&&e.uint32(18).string(t.indexName),t.timeToLive!=null&&Object.hasOwnProperty.call(t,"timeToLive")&&e.uint32(40).int32(t.timeToLive),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.UpdateSearchIndexRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.indexName=t.string();break;case 5:i.timeToLive=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.tableName!=null&&t.hasOwnProperty("tableName")&&!$util.isString(t.tableName)?"tableName: string expected":t.indexName!=null&&t.hasOwnProperty("indexName")&&!$util.isString(t.indexName)?"indexName: string expected":t.timeToLive!=null&&t.hasOwnProperty("timeToLive")&&!$util.isInteger(t.timeToLive)?"timeToLive: integer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.UpdateSearchIndexRequest)return t;var e=new $root.search.proto.UpdateSearchIndexRequest;return t.tableName!=null&&(e.tableName=String(t.tableName)),t.indexName!=null&&(e.indexName=String(t.indexName)),t.timeToLive!=null&&(e.timeToLive=t.timeToLive|0),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",r.indexName="",r.timeToLive=0),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.indexName!=null&&t.hasOwnProperty("indexName")&&(r.indexName=t.indexName),t.timeToLive!=null&&t.hasOwnProperty("timeToLive")&&(r.timeToLive=t.timeToLive),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.UpdateSearchIndexResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.UpdateSearchIndexResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.search.proto.UpdateSearchIndexResponse?t:new $root.search.proto.UpdateSearchIndexResponse},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.IndexInfo=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.indexName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.tableName!=null&&Object.hasOwnProperty.call(t,"tableName")&&e.uint32(10).string(t.tableName),t.indexName!=null&&Object.hasOwnProperty.call(t,"indexName")&&e.uint32(18).string(t.indexName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.IndexInfo;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.indexName=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.tableName!=null&&t.hasOwnProperty("tableName")&&!$util.isString(t.tableName)?"tableName: string expected":t.indexName!=null&&t.hasOwnProperty("indexName")&&!$util.isString(t.indexName)?"indexName: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.IndexInfo)return t;var e=new $root.search.proto.IndexInfo;return t.tableName!=null&&(e.tableName=String(t.tableName)),t.indexName!=null&&(e.indexName=String(t.indexName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",r.indexName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.indexName!=null&&t.hasOwnProperty("indexName")&&(r.indexName=t.indexName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ListSearchIndexRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.tableName!=null&&Object.hasOwnProperty.call(t,"tableName")&&e.uint32(10).string(t.tableName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.ListSearchIndexRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.tableName!=null&&t.hasOwnProperty("tableName")&&!$util.isString(t.tableName)?"tableName: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.ListSearchIndexRequest)return t;var e=new $root.search.proto.ListSearchIndexRequest;return t.tableName!=null&&(e.tableName=String(t.tableName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ListSearchIndexResponse=function(){function n(o){if(this.indices=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.indices=$util.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.indices!=null&&t.indices.length)for(var r=0;r<t.indices.length;++r)$root.search.proto.IndexInfo.encode(t.indices[r],e.uint32(10).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.ListSearchIndexResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.indices&&i.indices.length||(i.indices=[]),i.indices.push($root.search.proto.IndexInfo.decode(t,t.uint32()));break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.indices!=null&&t.hasOwnProperty("indices")){if(!Array.isArray(t.indices))return"indices: array expected";for(var e=0;e<t.indices.length;++e){var r=$root.search.proto.IndexInfo.verify(t.indices[e]);if(r)return"indices."+r}}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.ListSearchIndexResponse)return t;var e=new $root.search.proto.ListSearchIndexResponse;if(t.indices){if(!Array.isArray(t.indices))throw TypeError(".search.proto.ListSearchIndexResponse.indices: array expected");e.indices=[];for(var r=0;r<t.indices.length;++r){if(typeof t.indices[r]!="object")throw TypeError(".search.proto.ListSearchIndexResponse.indices: object expected");e.indices[r]=$root.search.proto.IndexInfo.fromObject(t.indices[r])}}return e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.indices=[]),t.indices&&t.indices.length){r.indices=[];for(var i=0;i<t.indices.length;++i)r.indices[i]=$root.search.proto.IndexInfo.toObject(t.indices[i],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DeleteSearchIndexRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.indexName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.tableName!=null&&Object.hasOwnProperty.call(t,"tableName")&&e.uint32(10).string(t.tableName),t.indexName!=null&&Object.hasOwnProperty.call(t,"indexName")&&e.uint32(18).string(t.indexName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DeleteSearchIndexRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.indexName=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.tableName!=null&&t.hasOwnProperty("tableName")&&!$util.isString(t.tableName)?"tableName: string expected":t.indexName!=null&&t.hasOwnProperty("indexName")&&!$util.isString(t.indexName)?"indexName: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.DeleteSearchIndexRequest)return t;var e=new $root.search.proto.DeleteSearchIndexRequest;return t.tableName!=null&&(e.tableName=String(t.tableName)),t.indexName!=null&&(e.indexName=String(t.indexName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",r.indexName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.indexName!=null&&t.hasOwnProperty("indexName")&&(r.indexName=t.indexName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DeleteSearchIndexResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DeleteSearchIndexResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":null},n.fromObject=function(t){return t instanceof $root.search.proto.DeleteSearchIndexResponse?t:new $root.search.proto.DeleteSearchIndexResponse},n.toObject=function(){return{}},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SyncPhase=function(){var n={},o=Object.create(n);return o[n[1]="FULL"]=1,o[n[2]="INCR"]=2,o}(),c.SyncStat=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.syncPhase=1,n.prototype.currentSyncTimestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.syncPhase!=null&&Object.hasOwnProperty.call(t,"syncPhase")&&e.uint32(8).int32(t.syncPhase),t.currentSyncTimestamp!=null&&Object.hasOwnProperty.call(t,"currentSyncTimestamp")&&e.uint32(16).int64(t.currentSyncTimestamp),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SyncStat;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.syncPhase=t.int32();break;case 2:i.currentSyncTimestamp=t.int64();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.syncPhase!=null&&t.hasOwnProperty("syncPhase"))switch(t.syncPhase){default:return"syncPhase: enum value expected";case 1:case 2:break}return t.currentSyncTimestamp!=null&&t.hasOwnProperty("currentSyncTimestamp")&&!$util.isInteger(t.currentSyncTimestamp)&&!(t.currentSyncTimestamp&&$util.isInteger(t.currentSyncTimestamp.low)&&$util.isInteger(t.currentSyncTimestamp.high))?"currentSyncTimestamp: integer|Long expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.SyncStat)return t;var e=new $root.search.proto.SyncStat;switch(t.syncPhase){case"FULL":case 1:e.syncPhase=1;break;case"INCR":case 2:e.syncPhase=2;break}return t.currentSyncTimestamp!=null&&($util.Long?(e.currentSyncTimestamp=$util.Long.fromValue(t.currentSyncTimestamp)).unsigned=!1:typeof t.currentSyncTimestamp=="string"?e.currentSyncTimestamp=parseInt(t.currentSyncTimestamp,10):typeof t.currentSyncTimestamp=="number"?e.currentSyncTimestamp=t.currentSyncTimestamp:typeof t.currentSyncTimestamp=="object"&&(e.currentSyncTimestamp=new $util.LongBits(t.currentSyncTimestamp.low>>>0,t.currentSyncTimestamp.high>>>0).toNumber())),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults)if(r.syncPhase=e.enums===String?"FULL":1,$util.Long){var i=new $util.Long(0,0,!1);r.currentSyncTimestamp=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.currentSyncTimestamp=e.longs===String?"0":0;return t.syncPhase!=null&&t.hasOwnProperty("syncPhase")&&(r.syncPhase=e.enums===String?$root.search.proto.SyncPhase[t.syncPhase]:t.syncPhase),t.currentSyncTimestamp!=null&&t.hasOwnProperty("currentSyncTimestamp")&&(typeof t.currentSyncTimestamp=="number"?r.currentSyncTimestamp=e.longs===String?String(t.currentSyncTimestamp):t.currentSyncTimestamp:r.currentSyncTimestamp=e.longs===String?$util.Long.prototype.toString.call(t.currentSyncTimestamp):e.longs===Number?new $util.LongBits(t.currentSyncTimestamp.low>>>0,t.currentSyncTimestamp.high>>>0).toNumber():t.currentSyncTimestamp),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.MeteringInfo=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.storageSize=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.rowCount=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.reservedReadCu=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.timestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.storageSize!=null&&Object.hasOwnProperty.call(t,"storageSize")&&e.uint32(8).int64(t.storageSize),t.rowCount!=null&&Object.hasOwnProperty.call(t,"rowCount")&&e.uint32(16).int64(t.rowCount),t.reservedReadCu!=null&&Object.hasOwnProperty.call(t,"reservedReadCu")&&e.uint32(24).int64(t.reservedReadCu),t.timestamp!=null&&Object.hasOwnProperty.call(t,"timestamp")&&e.uint32(32).int64(t.timestamp),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.MeteringInfo;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.storageSize=t.int64();break;case 2:i.rowCount=t.int64();break;case 3:i.reservedReadCu=t.int64();break;case 4:i.timestamp=t.int64();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.storageSize!=null&&t.hasOwnProperty("storageSize")&&!$util.isInteger(t.storageSize)&&!(t.storageSize&&$util.isInteger(t.storageSize.low)&&$util.isInteger(t.storageSize.high))?"storageSize: integer|Long expected":t.rowCount!=null&&t.hasOwnProperty("rowCount")&&!$util.isInteger(t.rowCount)&&!(t.rowCount&&$util.isInteger(t.rowCount.low)&&$util.isInteger(t.rowCount.high))?"rowCount: integer|Long expected":t.reservedReadCu!=null&&t.hasOwnProperty("reservedReadCu")&&!$util.isInteger(t.reservedReadCu)&&!(t.reservedReadCu&&$util.isInteger(t.reservedReadCu.low)&&$util.isInteger(t.reservedReadCu.high))?"reservedReadCu: integer|Long expected":t.timestamp!=null&&t.hasOwnProperty("timestamp")&&!$util.isInteger(t.timestamp)&&!(t.timestamp&&$util.isInteger(t.timestamp.low)&&$util.isInteger(t.timestamp.high))?"timestamp: integer|Long expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.MeteringInfo)return t;var e=new $root.search.proto.MeteringInfo;return t.storageSize!=null&&($util.Long?(e.storageSize=$util.Long.fromValue(t.storageSize)).unsigned=!1:typeof t.storageSize=="string"?e.storageSize=parseInt(t.storageSize,10):typeof t.storageSize=="number"?e.storageSize=t.storageSize:typeof t.storageSize=="object"&&(e.storageSize=new $util.LongBits(t.storageSize.low>>>0,t.storageSize.high>>>0).toNumber())),t.rowCount!=null&&($util.Long?(e.rowCount=$util.Long.fromValue(t.rowCount)).unsigned=!1:typeof t.rowCount=="string"?e.rowCount=parseInt(t.rowCount,10):typeof t.rowCount=="number"?e.rowCount=t.rowCount:typeof t.rowCount=="object"&&(e.rowCount=new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber())),t.reservedReadCu!=null&&($util.Long?(e.reservedReadCu=$util.Long.fromValue(t.reservedReadCu)).unsigned=!1:typeof t.reservedReadCu=="string"?e.reservedReadCu=parseInt(t.reservedReadCu,10):typeof t.reservedReadCu=="number"?e.reservedReadCu=t.reservedReadCu:typeof t.reservedReadCu=="object"&&(e.reservedReadCu=new $util.LongBits(t.reservedReadCu.low>>>0,t.reservedReadCu.high>>>0).toNumber())),t.timestamp!=null&&($util.Long?(e.timestamp=$util.Long.fromValue(t.timestamp)).unsigned=!1:typeof t.timestamp=="string"?e.timestamp=parseInt(t.timestamp,10):typeof t.timestamp=="number"?e.timestamp=t.timestamp:typeof t.timestamp=="object"&&(e.timestamp=new $util.LongBits(t.timestamp.low>>>0,t.timestamp.high>>>0).toNumber())),e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if($util.Long){var i=new $util.Long(0,0,!1);r.storageSize=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.storageSize=e.longs===String?"0":0;if($util.Long){var i=new $util.Long(0,0,!1);r.rowCount=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.rowCount=e.longs===String?"0":0;if($util.Long){var i=new $util.Long(0,0,!1);r.reservedReadCu=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.reservedReadCu=e.longs===String?"0":0;if($util.Long){var i=new $util.Long(0,0,!1);r.timestamp=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.timestamp=e.longs===String?"0":0}return t.storageSize!=null&&t.hasOwnProperty("storageSize")&&(typeof t.storageSize=="number"?r.storageSize=e.longs===String?String(t.storageSize):t.storageSize:r.storageSize=e.longs===String?$util.Long.prototype.toString.call(t.storageSize):e.longs===Number?new $util.LongBits(t.storageSize.low>>>0,t.storageSize.high>>>0).toNumber():t.storageSize),t.rowCount!=null&&t.hasOwnProperty("rowCount")&&(typeof t.rowCount=="number"?r.rowCount=e.longs===String?String(t.rowCount):t.rowCount:r.rowCount=e.longs===String?$util.Long.prototype.toString.call(t.rowCount):e.longs===Number?new $util.LongBits(t.rowCount.low>>>0,t.rowCount.high>>>0).toNumber():t.rowCount),t.reservedReadCu!=null&&t.hasOwnProperty("reservedReadCu")&&(typeof t.reservedReadCu=="number"?r.reservedReadCu=e.longs===String?String(t.reservedReadCu):t.reservedReadCu:r.reservedReadCu=e.longs===String?$util.Long.prototype.toString.call(t.reservedReadCu):e.longs===Number?new $util.LongBits(t.reservedReadCu.low>>>0,t.reservedReadCu.high>>>0).toNumber():t.reservedReadCu),t.timestamp!=null&&t.hasOwnProperty("timestamp")&&(typeof t.timestamp=="number"?r.timestamp=e.longs===String?String(t.timestamp):t.timestamp:r.timestamp=e.longs===String?$util.Long.prototype.toString.call(t.timestamp):e.longs===Number?new $util.LongBits(t.timestamp.low>>>0,t.timestamp.high>>>0).toNumber():t.timestamp),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DescribeSearchIndexRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.indexName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.tableName!=null&&Object.hasOwnProperty.call(t,"tableName")&&e.uint32(10).string(t.tableName),t.indexName!=null&&Object.hasOwnProperty.call(t,"indexName")&&e.uint32(18).string(t.indexName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DescribeSearchIndexRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.indexName=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.tableName!=null&&t.hasOwnProperty("tableName")&&!$util.isString(t.tableName)?"tableName: string expected":t.indexName!=null&&t.hasOwnProperty("indexName")&&!$util.isString(t.indexName)?"indexName: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.DescribeSearchIndexRequest)return t;var e=new $root.search.proto.DescribeSearchIndexRequest;return t.tableName!=null&&(e.tableName=String(t.tableName)),t.indexName!=null&&(e.indexName=String(t.indexName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",r.indexName=""),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.indexName!=null&&t.hasOwnProperty("indexName")&&(r.indexName=t.indexName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.DescribeSearchIndexResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.schema=null,n.prototype.syncStat=null,n.prototype.meteringInfo=null,n.prototype.brotherIndexName="",n.prototype.createTime=$util.Long?$util.Long.fromBits(0,0,!1):0,n.prototype.timeToLive=0,n.prototype.indexStatus=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.schema!=null&&Object.hasOwnProperty.call(t,"schema")&&$root.search.proto.IndexSchema.encode(t.schema,e.uint32(10).fork()).ldelim(),t.syncStat!=null&&Object.hasOwnProperty.call(t,"syncStat")&&$root.search.proto.SyncStat.encode(t.syncStat,e.uint32(18).fork()).ldelim(),t.meteringInfo!=null&&Object.hasOwnProperty.call(t,"meteringInfo")&&$root.search.proto.MeteringInfo.encode(t.meteringInfo,e.uint32(26).fork()).ldelim(),t.brotherIndexName!=null&&Object.hasOwnProperty.call(t,"brotherIndexName")&&e.uint32(34).string(t.brotherIndexName),t.createTime!=null&&Object.hasOwnProperty.call(t,"createTime")&&e.uint32(48).int64(t.createTime),t.timeToLive!=null&&Object.hasOwnProperty.call(t,"timeToLive")&&e.uint32(56).int32(t.timeToLive),t.indexStatus!=null&&Object.hasOwnProperty.call(t,"indexStatus")&&$root.search.proto.IndexStatus.encode(t.indexStatus,e.uint32(66).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.DescribeSearchIndexResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.schema=$root.search.proto.IndexSchema.decode(t,t.uint32());break;case 2:i.syncStat=$root.search.proto.SyncStat.decode(t,t.uint32());break;case 3:i.meteringInfo=$root.search.proto.MeteringInfo.decode(t,t.uint32());break;case 4:i.brotherIndexName=t.string();break;case 6:i.createTime=t.int64();break;case 7:i.timeToLive=t.int32();break;case 8:i.indexStatus=$root.search.proto.IndexStatus.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.schema!=null&&t.hasOwnProperty("schema")){var e=$root.search.proto.IndexSchema.verify(t.schema);if(e)return"schema."+e}if(t.syncStat!=null&&t.hasOwnProperty("syncStat")){var e=$root.search.proto.SyncStat.verify(t.syncStat);if(e)return"syncStat."+e}if(t.meteringInfo!=null&&t.hasOwnProperty("meteringInfo")){var e=$root.search.proto.MeteringInfo.verify(t.meteringInfo);if(e)return"meteringInfo."+e}if(t.brotherIndexName!=null&&t.hasOwnProperty("brotherIndexName")&&!$util.isString(t.brotherIndexName))return"brotherIndexName: string expected";if(t.createTime!=null&&t.hasOwnProperty("createTime")&&!$util.isInteger(t.createTime)&&!(t.createTime&&$util.isInteger(t.createTime.low)&&$util.isInteger(t.createTime.high)))return"createTime: integer|Long expected";if(t.timeToLive!=null&&t.hasOwnProperty("timeToLive")&&!$util.isInteger(t.timeToLive))return"timeToLive: integer expected";if(t.indexStatus!=null&&t.hasOwnProperty("indexStatus")){var e=$root.search.proto.IndexStatus.verify(t.indexStatus);if(e)return"indexStatus."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.DescribeSearchIndexResponse)return t;var e=new $root.search.proto.DescribeSearchIndexResponse;if(t.schema!=null){if(typeof t.schema!="object")throw TypeError(".search.proto.DescribeSearchIndexResponse.schema: object expected");e.schema=$root.search.proto.IndexSchema.fromObject(t.schema)}if(t.syncStat!=null){if(typeof t.syncStat!="object")throw TypeError(".search.proto.DescribeSearchIndexResponse.syncStat: object expected");e.syncStat=$root.search.proto.SyncStat.fromObject(t.syncStat)}if(t.meteringInfo!=null){if(typeof t.meteringInfo!="object")throw TypeError(".search.proto.DescribeSearchIndexResponse.meteringInfo: object expected");e.meteringInfo=$root.search.proto.MeteringInfo.fromObject(t.meteringInfo)}if(t.brotherIndexName!=null&&(e.brotherIndexName=String(t.brotherIndexName)),t.createTime!=null&&($util.Long?(e.createTime=$util.Long.fromValue(t.createTime)).unsigned=!1:typeof t.createTime=="string"?e.createTime=parseInt(t.createTime,10):typeof t.createTime=="number"?e.createTime=t.createTime:typeof t.createTime=="object"&&(e.createTime=new $util.LongBits(t.createTime.low>>>0,t.createTime.high>>>0).toNumber())),t.timeToLive!=null&&(e.timeToLive=t.timeToLive|0),t.indexStatus!=null){if(typeof t.indexStatus!="object")throw TypeError(".search.proto.DescribeSearchIndexResponse.indexStatus: object expected");e.indexStatus=$root.search.proto.IndexStatus.fromObject(t.indexStatus)}return e},n.toObject=function(t,e){e||(e={});var r={};if(e.defaults){if(r.schema=null,r.syncStat=null,r.meteringInfo=null,r.brotherIndexName="",$util.Long){var i=new $util.Long(0,0,!1);r.createTime=e.longs===String?i.toString():e.longs===Number?i.toNumber():i}else r.createTime=e.longs===String?"0":0;r.timeToLive=0,r.indexStatus=null}return t.schema!=null&&t.hasOwnProperty("schema")&&(r.schema=$root.search.proto.IndexSchema.toObject(t.schema,e)),t.syncStat!=null&&t.hasOwnProperty("syncStat")&&(r.syncStat=$root.search.proto.SyncStat.toObject(t.syncStat,e)),t.meteringInfo!=null&&t.hasOwnProperty("meteringInfo")&&(r.meteringInfo=$root.search.proto.MeteringInfo.toObject(t.meteringInfo,e)),t.brotherIndexName!=null&&t.hasOwnProperty("brotherIndexName")&&(r.brotherIndexName=t.brotherIndexName),t.createTime!=null&&t.hasOwnProperty("createTime")&&(typeof t.createTime=="number"?r.createTime=e.longs===String?String(t.createTime):t.createTime:r.createTime=e.longs===String?$util.Long.prototype.toString.call(t.createTime):e.longs===Number?new $util.LongBits(t.createTime.low>>>0,t.createTime.high>>>0).toNumber():t.createTime),t.timeToLive!=null&&t.hasOwnProperty("timeToLive")&&(r.timeToLive=t.timeToLive),t.indexStatus!=null&&t.hasOwnProperty("indexStatus")&&(r.indexStatus=$root.search.proto.IndexStatus.toObject(t.indexStatus,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.IndexStatus=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.status=1,n.prototype.statusDescription="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.status!=null&&Object.hasOwnProperty.call(t,"status")&&e.uint32(8).int32(t.status),t.statusDescription!=null&&Object.hasOwnProperty.call(t,"statusDescription")&&e.uint32(18).string(t.statusDescription),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.IndexStatus;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.status=t.int32();break;case 2:i.statusDescription=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.status!=null&&t.hasOwnProperty("status"))switch(t.status){default:return"status: enum value expected";case 1:case 2:case 3:break}return t.statusDescription!=null&&t.hasOwnProperty("statusDescription")&&!$util.isString(t.statusDescription)?"statusDescription: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.IndexStatus)return t;var e=new $root.search.proto.IndexStatus;switch(t.status){case"PENDING":case 1:e.status=1;break;case"FAILED":case 2:e.status=2;break;case"RUNNING":case 3:e.status=3;break}return t.statusDescription!=null&&(e.statusDescription=String(t.statusDescription)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.status=e.enums===String?"PENDING":1,r.statusDescription=""),t.status!=null&&t.hasOwnProperty("status")&&(r.status=e.enums===String?$root.search.proto.IndexStatusEnum[t.status]:t.status),t.statusDescription!=null&&t.hasOwnProperty("statusDescription")&&(r.statusDescription=t.statusDescription),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.IndexStatusEnum=function(){var n={},o=Object.create(n);return o[n[1]="PENDING"]=1,o[n[2]="FAILED"]=2,o[n[3]="RUNNING"]=3,o}(),c.ComputeSplitsRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.searchIndexSplitsOptions=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.tableName!=null&&Object.hasOwnProperty.call(t,"tableName")&&e.uint32(10).string(t.tableName),t.searchIndexSplitsOptions!=null&&Object.hasOwnProperty.call(t,"searchIndexSplitsOptions")&&$root.search.proto.SearchIndexSplitsOptions.encode(t.searchIndexSplitsOptions,e.uint32(18).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.ComputeSplitsRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.searchIndexSplitsOptions=$root.search.proto.SearchIndexSplitsOptions.decode(t,t.uint32());break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.tableName!=null&&t.hasOwnProperty("tableName")&&!$util.isString(t.tableName))return"tableName: string expected";if(t.searchIndexSplitsOptions!=null&&t.hasOwnProperty("searchIndexSplitsOptions")){var e=$root.search.proto.SearchIndexSplitsOptions.verify(t.searchIndexSplitsOptions);if(e)return"searchIndexSplitsOptions."+e}return null},n.fromObject=function(t){if(t instanceof $root.search.proto.ComputeSplitsRequest)return t;var e=new $root.search.proto.ComputeSplitsRequest;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.searchIndexSplitsOptions!=null){if(typeof t.searchIndexSplitsOptions!="object")throw TypeError(".search.proto.ComputeSplitsRequest.searchIndexSplitsOptions: object expected");e.searchIndexSplitsOptions=$root.search.proto.SearchIndexSplitsOptions.fromObject(t.searchIndexSplitsOptions)}return e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",r.searchIndexSplitsOptions=null),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.searchIndexSplitsOptions!=null&&t.hasOwnProperty("searchIndexSplitsOptions")&&(r.searchIndexSplitsOptions=$root.search.proto.SearchIndexSplitsOptions.toObject(t.searchIndexSplitsOptions,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.SearchIndexSplitsOptions=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.indexName="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.indexName!=null&&Object.hasOwnProperty.call(t,"indexName")&&e.uint32(10).string(t.indexName),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.SearchIndexSplitsOptions;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.indexName=t.string();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.indexName!=null&&t.hasOwnProperty("indexName")&&!$util.isString(t.indexName)?"indexName: string expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.SearchIndexSplitsOptions)return t;var e=new $root.search.proto.SearchIndexSplitsOptions;return t.indexName!=null&&(e.indexName=String(t.indexName)),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.indexName=""),t.indexName!=null&&t.hasOwnProperty("indexName")&&(r.indexName=t.indexName),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ComputeSplitsResponse=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.sessionId=$util.newBuffer([]),n.prototype.splitsSize=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.sessionId!=null&&Object.hasOwnProperty.call(t,"sessionId")&&e.uint32(10).bytes(t.sessionId),t.splitsSize!=null&&Object.hasOwnProperty.call(t,"splitsSize")&&e.uint32(16).int32(t.splitsSize),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.ComputeSplitsResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.sessionId=t.bytes();break;case 2:i.splitsSize=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":t.sessionId!=null&&t.hasOwnProperty("sessionId")&&!(t.sessionId&&typeof t.sessionId.length=="number"||$util.isString(t.sessionId))?"sessionId: buffer expected":t.splitsSize!=null&&t.hasOwnProperty("splitsSize")&&!$util.isInteger(t.splitsSize)?"splitsSize: integer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.ComputeSplitsResponse)return t;var e=new $root.search.proto.ComputeSplitsResponse;return t.sessionId!=null&&(typeof t.sessionId=="string"?$util.base64.decode(t.sessionId,e.sessionId=$util.newBuffer($util.base64.length(t.sessionId)),0):t.sessionId.length&&(e.sessionId=t.sessionId)),t.splitsSize!=null&&(e.splitsSize=t.splitsSize|0),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(e.bytes===String?r.sessionId="":(r.sessionId=[],e.bytes!==Array&&(r.sessionId=$util.newBuffer(r.sessionId))),r.splitsSize=0),t.sessionId!=null&&t.hasOwnProperty("sessionId")&&(r.sessionId=e.bytes===String?$util.base64.encode(t.sessionId,0,t.sessionId.length):e.bytes===Array?Array.prototype.slice.call(t.sessionId):t.sessionId),t.splitsSize!=null&&t.hasOwnProperty("splitsSize")&&(r.splitsSize=t.splitsSize),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ScanQuery=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.query=null,n.prototype.limit=0,n.prototype.aliveTime=0,n.prototype.token=$util.newBuffer([]),n.prototype.currentParallelId=0,n.prototype.maxParallel=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.query!=null&&Object.hasOwnProperty.call(t,"query")&&$root.search.proto.Query.encode(t.query,e.uint32(10).fork()).ldelim(),t.limit!=null&&Object.hasOwnProperty.call(t,"limit")&&e.uint32(16).int32(t.limit),t.aliveTime!=null&&Object.hasOwnProperty.call(t,"aliveTime")&&e.uint32(24).int32(t.aliveTime),t.token!=null&&Object.hasOwnProperty.call(t,"token")&&e.uint32(34).bytes(t.token),t.currentParallelId!=null&&Object.hasOwnProperty.call(t,"currentParallelId")&&e.uint32(40).int32(t.currentParallelId),t.maxParallel!=null&&Object.hasOwnProperty.call(t,"maxParallel")&&e.uint32(48).int32(t.maxParallel),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.ScanQuery;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.query=$root.search.proto.Query.decode(t,t.uint32());break;case 2:i.limit=t.int32();break;case 3:i.aliveTime=t.int32();break;case 4:i.token=t.bytes();break;case 5:i.currentParallelId=t.int32();break;case 6:i.maxParallel=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.query!=null&&t.hasOwnProperty("query")){var e=$root.search.proto.Query.verify(t.query);if(e)return"query."+e}return t.limit!=null&&t.hasOwnProperty("limit")&&!$util.isInteger(t.limit)?"limit: integer expected":t.aliveTime!=null&&t.hasOwnProperty("aliveTime")&&!$util.isInteger(t.aliveTime)?"aliveTime: integer expected":t.token!=null&&t.hasOwnProperty("token")&&!(t.token&&typeof t.token.length=="number"||$util.isString(t.token))?"token: buffer expected":t.currentParallelId!=null&&t.hasOwnProperty("currentParallelId")&&!$util.isInteger(t.currentParallelId)?"currentParallelId: integer expected":t.maxParallel!=null&&t.hasOwnProperty("maxParallel")&&!$util.isInteger(t.maxParallel)?"maxParallel: integer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.ScanQuery)return t;var e=new $root.search.proto.ScanQuery;if(t.query!=null){if(typeof t.query!="object")throw TypeError(".search.proto.ScanQuery.query: object expected");e.query=$root.search.proto.Query.fromObject(t.query)}return t.limit!=null&&(e.limit=t.limit|0),t.aliveTime!=null&&(e.aliveTime=t.aliveTime|0),t.token!=null&&(typeof t.token=="string"?$util.base64.decode(t.token,e.token=$util.newBuffer($util.base64.length(t.token)),0):t.token.length&&(e.token=t.token)),t.currentParallelId!=null&&(e.currentParallelId=t.currentParallelId|0),t.maxParallel!=null&&(e.maxParallel=t.maxParallel|0),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.query=null,r.limit=0,r.aliveTime=0,e.bytes===String?r.token="":(r.token=[],e.bytes!==Array&&(r.token=$util.newBuffer(r.token))),r.currentParallelId=0,r.maxParallel=0),t.query!=null&&t.hasOwnProperty("query")&&(r.query=$root.search.proto.Query.toObject(t.query,e)),t.limit!=null&&t.hasOwnProperty("limit")&&(r.limit=t.limit),t.aliveTime!=null&&t.hasOwnProperty("aliveTime")&&(r.aliveTime=t.aliveTime),t.token!=null&&t.hasOwnProperty("token")&&(r.token=e.bytes===String?$util.base64.encode(t.token,0,t.token.length):e.bytes===Array?Array.prototype.slice.call(t.token):t.token),t.currentParallelId!=null&&t.hasOwnProperty("currentParallelId")&&(r.currentParallelId=t.currentParallelId),t.maxParallel!=null&&t.hasOwnProperty("maxParallel")&&(r.maxParallel=t.maxParallel),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ParallelScanRequest=function(){function n(o){if(o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.tableName="",n.prototype.indexName="",n.prototype.columnsToGet=null,n.prototype.sessionId=$util.newBuffer([]),n.prototype.scanQuery=null,n.prototype.timeoutMs=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=$Writer.create()),t.tableName!=null&&Object.hasOwnProperty.call(t,"tableName")&&e.uint32(10).string(t.tableName),t.indexName!=null&&Object.hasOwnProperty.call(t,"indexName")&&e.uint32(18).string(t.indexName),t.columnsToGet!=null&&Object.hasOwnProperty.call(t,"columnsToGet")&&$root.search.proto.ColumnsToGet.encode(t.columnsToGet,e.uint32(26).fork()).ldelim(),t.sessionId!=null&&Object.hasOwnProperty.call(t,"sessionId")&&e.uint32(34).bytes(t.sessionId),t.scanQuery!=null&&Object.hasOwnProperty.call(t,"scanQuery")&&$root.search.proto.ScanQuery.encode(t.scanQuery,e.uint32(42).fork()).ldelim(),t.timeoutMs!=null&&Object.hasOwnProperty.call(t,"timeoutMs")&&e.uint32(48).int32(t.timeoutMs),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.ParallelScanRequest;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.tableName=t.string();break;case 2:i.indexName=t.string();break;case 3:i.columnsToGet=$root.search.proto.ColumnsToGet.decode(t,t.uint32());break;case 4:i.sessionId=t.bytes();break;case 5:i.scanQuery=$root.search.proto.ScanQuery.decode(t,t.uint32());break;case 6:i.timeoutMs=t.int32();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.tableName!=null&&t.hasOwnProperty("tableName")&&!$util.isString(t.tableName))return"tableName: string expected";if(t.indexName!=null&&t.hasOwnProperty("indexName")&&!$util.isString(t.indexName))return"indexName: string expected";if(t.columnsToGet!=null&&t.hasOwnProperty("columnsToGet")){var e=$root.search.proto.ColumnsToGet.verify(t.columnsToGet);if(e)return"columnsToGet."+e}if(t.sessionId!=null&&t.hasOwnProperty("sessionId")&&!(t.sessionId&&typeof t.sessionId.length=="number"||$util.isString(t.sessionId)))return"sessionId: buffer expected";if(t.scanQuery!=null&&t.hasOwnProperty("scanQuery")){var e=$root.search.proto.ScanQuery.verify(t.scanQuery);if(e)return"scanQuery."+e}return t.timeoutMs!=null&&t.hasOwnProperty("timeoutMs")&&!$util.isInteger(t.timeoutMs)?"timeoutMs: integer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.ParallelScanRequest)return t;var e=new $root.search.proto.ParallelScanRequest;if(t.tableName!=null&&(e.tableName=String(t.tableName)),t.indexName!=null&&(e.indexName=String(t.indexName)),t.columnsToGet!=null){if(typeof t.columnsToGet!="object")throw TypeError(".search.proto.ParallelScanRequest.columnsToGet: object expected");e.columnsToGet=$root.search.proto.ColumnsToGet.fromObject(t.columnsToGet)}if(t.sessionId!=null&&(typeof t.sessionId=="string"?$util.base64.decode(t.sessionId,e.sessionId=$util.newBuffer($util.base64.length(t.sessionId)),0):t.sessionId.length&&(e.sessionId=t.sessionId)),t.scanQuery!=null){if(typeof t.scanQuery!="object")throw TypeError(".search.proto.ParallelScanRequest.scanQuery: object expected");e.scanQuery=$root.search.proto.ScanQuery.fromObject(t.scanQuery)}return t.timeoutMs!=null&&(e.timeoutMs=t.timeoutMs|0),e},n.toObject=function(t,e){e||(e={});var r={};return e.defaults&&(r.tableName="",r.indexName="",r.columnsToGet=null,e.bytes===String?r.sessionId="":(r.sessionId=[],e.bytes!==Array&&(r.sessionId=$util.newBuffer(r.sessionId))),r.scanQuery=null,r.timeoutMs=0),t.tableName!=null&&t.hasOwnProperty("tableName")&&(r.tableName=t.tableName),t.indexName!=null&&t.hasOwnProperty("indexName")&&(r.indexName=t.indexName),t.columnsToGet!=null&&t.hasOwnProperty("columnsToGet")&&(r.columnsToGet=$root.search.proto.ColumnsToGet.toObject(t.columnsToGet,e)),t.sessionId!=null&&t.hasOwnProperty("sessionId")&&(r.sessionId=e.bytes===String?$util.base64.encode(t.sessionId,0,t.sessionId.length):e.bytes===Array?Array.prototype.slice.call(t.sessionId):t.sessionId),t.scanQuery!=null&&t.hasOwnProperty("scanQuery")&&(r.scanQuery=$root.search.proto.ScanQuery.toObject(t.scanQuery,e)),t.timeoutMs!=null&&t.hasOwnProperty("timeoutMs")&&(r.timeoutMs=t.timeoutMs),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c.ParallelScanResponse=function(){function n(o){if(this.rows=[],o)for(var t=Object.keys(o),e=0;e<t.length;++e)o[t[e]]!=null&&(this[t[e]]=o[t[e]])}return n.prototype.rows=$util.emptyArray,n.prototype.nextToken=$util.newBuffer([]),n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=$Writer.create()),t.rows!=null&&t.rows.length)for(var r=0;r<t.rows.length;++r)e.uint32(10).bytes(t.rows[r]);return t.nextToken!=null&&Object.hasOwnProperty.call(t,"nextToken")&&e.uint32(18).bytes(t.nextToken),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof $Reader||(t=$Reader.create(t));for(var r=e===void 0?t.len:t.pos+e,i=new $root.search.proto.ParallelScanResponse;t.pos<r;){var l=t.uint32();switch(l>>>3){case 1:i.rows&&i.rows.length||(i.rows=[]),i.rows.push(t.bytes());break;case 2:i.nextToken=t.bytes();break;default:t.skipType(l&7);break}}return i},n.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.rows!=null&&t.hasOwnProperty("rows")){if(!Array.isArray(t.rows))return"rows: array expected";for(var e=0;e<t.rows.length;++e)if(!(t.rows[e]&&typeof t.rows[e].length=="number"||$util.isString(t.rows[e])))return"rows: buffer[] expected"}return t.nextToken!=null&&t.hasOwnProperty("nextToken")&&!(t.nextToken&&typeof t.nextToken.length=="number"||$util.isString(t.nextToken))?"nextToken: buffer expected":null},n.fromObject=function(t){if(t instanceof $root.search.proto.ParallelScanResponse)return t;var e=new $root.search.proto.ParallelScanResponse;if(t.rows){if(!Array.isArray(t.rows))throw TypeError(".search.proto.ParallelScanResponse.rows: array expected");e.rows=[];for(var r=0;r<t.rows.length;++r)typeof t.rows[r]=="string"?$util.base64.decode(t.rows[r],e.rows[r]=$util.newBuffer($util.base64.length(t.rows[r])),0):t.rows[r].length&&(e.rows[r]=t.rows[r])}return t.nextToken!=null&&(typeof t.nextToken=="string"?$util.base64.decode(t.nextToken,e.nextToken=$util.newBuffer($util.base64.length(t.nextToken)),0):t.nextToken.length&&(e.nextToken=t.nextToken)),e},n.toObject=function(t,e){e||(e={});var r={};if((e.arrays||e.defaults)&&(r.rows=[]),e.defaults&&(e.bytes===String?r.nextToken="":(r.nextToken=[],e.bytes!==Array&&(r.nextToken=$util.newBuffer(r.nextToken)))),t.rows&&t.rows.length){r.rows=[];for(var i=0;i<t.rows.length;++i)r.rows[i]=e.bytes===String?$util.base64.encode(t.rows[i],0,t.rows[i].length):e.bytes===Array?Array.prototype.slice.call(t.rows[i]):t.rows[i]}return t.nextToken!=null&&t.hasOwnProperty("nextToken")&&(r.nextToken=e.bytes===String?$util.base64.encode(t.nextToken,0,t.nextToken.length):e.bytes===Array?Array.prototype.slice.call(t.nextToken):t.nextToken),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},n}(),c}(),u}();var tablestore_compiled_proto=$root,hasRequiredFilter;function requireFilter(){if(hasRequiredFilter)return filter;hasRequiredFilter=1;var u=requireCore(),c=tablestore_compiled_proto.filter.proto,n=u.util.inherit;return u.LogicalOperator={NOT:c.LogicalOperator.LO_NOT,AND:c.LogicalOperator.LO_AND,OR:c.LogicalOperator.LO_OR},u.ColumnConditionType={COMPOSITE_COLUMN_CONDITION:0,SINGLE_COLUMN_CONDITION:1},u.ComparatorType={EQUAL:c.ComparatorType.CT_EQUAL,NOT_EQUAL:c.ComparatorType.CT_NOT_EQUAL,GREATER_THAN:c.ComparatorType.CT_GREATER_THAN,GREATER_EQUAL:c.ComparatorType.CT_GREATER_EQUAL,LESS_THAN:c.ComparatorType.CT_LESS_THAN,LESS_EQUAL:c.ComparatorType.CT_LESS_EQUAL},u.RowExistenceExpectation={IGNORE:0,EXPECT_EXIST:1,EXPECT_NOT_EXIST:2},u.ColumnCondition=n({}),u.CompositeCondition=n(u.ColumnCondition,{constructor:function(o){this.sub_conditions=[],this.setCombinator(o)},getType:function(){return c.FilterType.FT_COMPOSITE_COLUMN_VALUE},setCombinator:function(o){var t=!1;for(pro in u.LogicalOperator)if(u.LogicalOperator[pro]===o){t=!0;break}if(!t)throw new Error("Expect input combinator should be one of TableStore.LogicalOperator");this.combinator=o},getCombinator:function(){return combinator},addSubCondition:function(o){if(!o instanceof u.ColumnCondition)throw new Error("The input condition should be an instance of TableStore.ColumnCondition");this.sub_conditions.push(o)},clearSubCondition:function(){this.sub_conditions=[]}}),u.SingleColumnCondition=n(u.ColumnCondition,{constructor:function(o,t,e,r,i){r===void 0&&(r=!0),i===void 0&&(i=!0),this.columnName=o,this.columnValue=t,this.comparator=null,this.passIfMissing=null,this.latestVersionOnly=null,this.setComparator(e),this.setPassIfMissing(r),this.setLatestVersionOnly(i)},getType:function(){return c.FilterType.FT_SINGLE_COLUMN_VALUE},setPassIfMissing:function(o){if(!1==="boolean")throw new Error("The input passIfMissing should be an instance of Bool");this.passIfMissing=o},getPassIfMissing:function(){return this.passIfMissing},setLatestVersionOnly:function(o){if(!1==="boolean")throw new Error("The input passIfMissing should be an instance of Bool");this.latestVersionOnly=o},getLatestVersionOnly:function(){return this.latestVersionOnly},setColumnName:function(o){this.columnName=o},getColumnName:function(){return this.columnName},setColumnValue:function(o){this.columnValue=o},getColumnValue:function(){return this.columnValue},setComparator:function(o){var t=!1;for(pro in u.ComparatorType)if(u.ComparatorType[pro]===o){t=!0;break}if(!t)throw new Error("Expect input comparator should be one of TableStore.ComparatorType");this.comparator=o},getComparator:function(){return this.comparator}}),u.Condition=n({constructor:function(o,t){this.rowExistenceExpectation=null,this.columnCondition=null,t===void 0&&(t=null),this.setRowExistenceExpectation(o),t!=null&&this.setColumnCondition(t)},setRowExistenceExpectation:function(o){var t=!1;for(pro in u.RowExistenceExpectation)if(u.RowExistenceExpectation[pro]===o){t=!0;break}if(!t)throw new Error("Expect input rowExistenceExpectation should be one of TableStore.RowExistenceExpectation");this.rowExistenceExpectation=o},getRowExistenceExpectation:function(){return this.rowExistenceExpectation},setColumnCondition:function(o){if(!o instanceof u.ColumnCondition)throw new Error("The input columnCondition should be an instance of TableStore.ColumnCondition");this.columnCondition=o},getColumnCondition:function(){this.columnCondition}}),u.ColumnPaginationFilter=n({constructor:function(o,t){this.limit=o===void 0?1:o,this.offset=t===void 0?0:t},getType:function(){return c.FilterType.FT_COLUMN_PAGINATION}}),filter}var encoder={},hasRequiredEncoder;function requireEncoder(){if(hasRequiredEncoder)return encoder;hasRequiredEncoder=1;var u=requireCore(),c=tablestore_compiled_proto,n=c.main.proto,o=c.filter.proto,t=c.search.proto;o.FT_COMPOSITE_COLUMN_VALUE,o.FT_SINGLE_COLUMN_VALUE,u.encoder={encode:function(r,i){return e[r](i)},encodeCreateTable:function(r){if(!r.reservedThroughput||!r.tableOptions)throw new Error("reservedThroughput and tableOptions are required");var i={},l=[];if(u.util.arrayEach(r.tableMeta.primaryKey,function(s){l.push({name:s.name,type:u.PrimaryKeyType[s.type]||s.type,option:u.PrimaryKeyOption[s.option]||s.option})}),i.tableMeta={tableName:r.tableMeta.tableName,primaryKey:l},i.reservedThroughput={capacityUnit:r.reservedThroughput.capacityUnit},Object.prototype.toString.call(r.tableMeta.definedColumn)==="[object Array]"&&(i.tableMeta.definedColumn=r.tableMeta.definedColumn),r.tableOptions&&(i.tableOptions={timeToLive:r.tableOptions.timeToLive,maxVersions:r.tableOptions.maxVersions,allowUpdate:r.tableOptions.allowUpdate},r.tableOptions.maxTimeDeviation&&(i.tableOptions.deviationCellVersionInSec=r.tableOptions.maxTimeDeviation)),r.streamSpecification&&(i.streamSpec={enableStream:r.streamSpecification.enableStream,expirationTime:r.streamSpecification.expirationTime}),Object.prototype.toString.call(r.indexMetas)==="[object Array]"){var a=[];u.util.arrayEach(r.indexMetas,function(s){a.push({name:s.name,primaryKey:s.primaryKey,definedColumn:s.definedColumn,indexUpdateMode:s.indexUpdateMode||u.IndexUpdateMode.IUM_ASYNC_INDEX,indexType:s.indexType||u.IndexType.IT_GLOBAL_INDEX})}),i.indexMetas=a}var f=n.CreateTableRequest.create(i);return f},encodeListTable:function(){var r=n.ListTableRequest.create();return r},encodeDeleteTable:function(r){var i={tableName:r.tableName},l=n.DeleteTableRequest.create(i);return l},encodeUpdateTable:function(r){var i={tableName:r.tableName,tableOptions:{timeToLive:r.tableOptions.timeToLive,maxVersions:r.tableOptions.maxVersions,allowUpdate:r.tableOptions.allowUpdate,deviationCellVersionInSec:r.tableOptions.maxTimeDeviation}};r.reservedThroughput&&(i.reservedThroughput={capacityUnit:r.reservedThroughput.capacityUnit}),r.streamSpecification&&(i.streamSpec={enableStream:r.streamSpecification.enableStream,expirationTime:r.streamSpecification.expirationTime});var l=n.UpdateTableRequest.create(i);return l},encodeDescribeTable:function(r){var i={tableName:r.tableName},l=n.DescribeTableRequest.create(i);return l},encodeGetRow:function(r){var i={tableName:r.tableName,primaryKey:u.PlainBufferBuilder.serializePrimaryKey(r.primaryKey),attributeColumns:r.attributeColumns};if(r.maxVersions?i.maxVersions=r.maxVersions:i.maxVersions=1,r.columnFilter){var l={};u.encoder._makeColumnCondition(l,r.columnFilter);var a=o.Filter.create(l),f=o.Filter.encode(a);i.filter=f.finish()}r.timeRange&&(i.timeRange={startTime:r.timeRange.startTime,endTime:r.timeRange.endTime,specificTime:r.timeRange.specificTime}),r.startColumn&&(i.startColumn=r.startColumn),r.endColumn&&(i.endColumn=r.endColumn),r.columnsToGet&&(i.columnsToGet=r.columnsToGet),r.transactionId&&(i.transactionId=r.transactionId),r.maxVersions?i.maxVersions=r.maxVersions:i.maxVersions=1;var s=n.GetRowRequest.create(i);return s},encodePutRow:function(r){var i={tableName:r.tableName,row:u.PlainBufferBuilder.serializeForPutRow(r.primaryKey,r.attributeColumns)};(r.condition===void 0||r.condition===null)&&(i.condtion=new u.Condition(u.RowExistenceExpectation.IGNORE,null)),i.condition={},u.encoder._makeCondition(i.condition,r.condition),r.returnContent&&r.returnContent.returnType&&(i.returnContent={returnType:r.returnContent.returnType}),r.transactionId&&(i.transactionId=r.transactionId);var l=n.PutRowRequest.create(i);return l},encodeUpdateRow:function(r){var i={tableName:r.tableName,rowChange:u.PlainBufferBuilder.serializeForUpdateRow(r.primaryKey,r.updateOfAttributeColumns)};(r.condition===void 0||r.condition===null)&&(r.condtion=new u.Condition(u.RowExistenceExpectation.IGNORE,null)),i.condition={},u.encoder._makeCondition(i.condition,r.condition),r.returnContent&&r.returnContent.returnType&&(i.returnContent={returnType:r.returnContent.returnType,returnColumnNames:r.returnContent.returnColumns}),r.transactionId&&(i.transactionId=r.transactionId);var l=n.UpdateRowRequest.create(i);return l},encodeDeleteRow:function(r){var i={tableName:r.tableName,primaryKey:u.PlainBufferBuilder.serializeForDeleteRow(r.primaryKey)};(r.condition===void 0||r.condition===null)&&(r.condtion=new u.Condition(u.RowExistenceExpectation.IGNORE,null)),i.condition={},u.encoder._makeCondition(i.condition,r.condition),r.returnContent&&r.returnContent.returnType&&(i.returnContent={returnType:r.returnContent.returnType}),r.transactionId&&(i.transactionId=r.transactionId);var l=n.DeleteRowRequest.create(i);return l},encodeGetRange:function(r){var i={tableName:r.tableName,inclusiveStartPrimaryKey:u.PlainBufferBuilder.serializePrimaryKey(r.inclusiveStartPrimaryKey),exclusiveEndPrimaryKey:u.PlainBufferBuilder.serializePrimaryKey(r.exclusiveEndPrimaryKey),direction:n.Direction[r.direction]};if(r.maxVersions?i.maxVersions=r.maxVersions:i.maxVersions=1,r.columnFilter){var l={};u.encoder._makeColumnCondition(l,r.columnFilter);var a=o.Filter.create(l),f=o.Filter.encode(a);i.filter=f.finish()}r.limit&&(i.limit=r.limit),r.timeRange&&(i.timeRange={startTime:r.timeRange.startTime,endTime:r.timeRange.endTime,specificTime:r.timeRange.specificTime}),r.startColumn&&(i.startColumn=r.startColumn),r.endColumn&&(i.endColumn=r.endColumn),r.columnsToGet&&(i.columnsToGet=r.columnsToGet),r.transactionId&&(i.transactionId=r.transactionId);var s=n.GetRangeRequest.create(i);return s},encodeBatchGetRow:function(r){if(r.tables===void 0||r.tables===null)throw new Error("params.tables is not correct");for(var i={tables:[]},l=0;l<r.tables.length;l++){var a={tableName:r.tables[l].tableName,primaryKey:[]};for(var f in r.tables[l].primaryKey)a.primaryKey.push(u.PlainBufferBuilder.serializePrimaryKey(r.tables[l].primaryKey[f]));if(r.tables[l].columnFilter){var s={};u.encoder._makeColumnCondition(s,r.tables[l].columnFilter);var d=o.Filter.create(s),O=o.Filter.encode(d);a.filter=O.finish()}r.tables[l].maxVersions?a.maxVersions=r.tables[l].maxVersions:a.maxVersions=1,r.tables[l].timeRange&&(a.timeRange={startTime:r.tables[l].timeRange.startTime,endTime:r.tables[l].timeRange.endTime,specificTime:r.tables[l].timeRange.specificTime}),r.tables[l].startColumn&&(a.startColumn=r.tables[l].startColumn),r.tables[l].endColumn&&(a.endColumn=r.tables[l].endColumn),r.tables[l].columnsToGet&&(a.columnsToGet=r.tables[l].columnsToGet),i.tables.push(a)}r.transactionId&&(i.transactionId=r.transactionId);var b=n.BatchGetRowRequest.create(i);return b},encodeBatchWriteRow:function(r){if(r.tables===void 0||r.tables===null||r.tables.length<=0)throw new Error("params.tables is not correct");for(var i={tables:[]},l=0;l<r.tables.length;l++){var a={tableName:r.tables[l].tableName,rows:[]};for(var f in r.tables[l].rows){var s={},d=r.tables[l].rows[f].type;switch(s.type=~["PUT","UPDATE","DELETE"].indexOf(d)?u.BatchWriteType[d]:d,d){case"PUT":s.rowChange=u.PlainBufferBuilder.serializeForPutRow(r.tables[l].rows[f].primaryKey,r.tables[l].rows[f].attributeColumns);break;case"UPDATE":s.rowChange=u.PlainBufferBuilder.serializeForUpdateRow(r.tables[l].rows[f].primaryKey,r.tables[l].rows[f].attributeColumns);break;case"DELETE":s.rowChange=u.PlainBufferBuilder.serializeForDeleteRow(r.tables[l].rows[f].primaryKey,r.tables[l].rows[f].attributeColumns);break;default:throw new Error("batchwriterow type is error:"+r.tables[l].rows[f].type)}r.tables[l].rows[f].condition&&(s.condition={},u.encoder._makeCondition(s.condition,r.tables[l].rows[f].condition)),r.tables[l].rows[f].returnContent&&r.tables[l].rows[f].returnContent.returnType&&(s.returnContent={returnType:r.tables[l].rows[f].returnContent.returnType},r.tables[l].rows[f].returnContent.returnColumns&&(s.returnContent.returnColumnNames=r.tables[l].rows[f].returnContent.returnColumns)),a.rows.push(s)}i.tables.push(a)}r.transactionId&&(i.transactionId=r.transactionId);var O=n.BatchWriteRowRequest.create(i);return O},_makeColumnCondition:function(r,i){if(i!==null){if(!i instanceof u.ColumnCondition)throw new Error("column condition should be an instance of ColumnCondition");if(r.type=i.getType(),r.type===null)throw new Error("column_condition_type should be one of TableStore.ColumnConditionType");if(i instanceof u.CompositeCondition)r.filter=u.encoder._makeCompositeCondition(i);else if(i instanceof u.SingleColumnCondition)r.filter=u.encoder._makeSingleColumnCondition(i);else if(i instanceof u.ColumnPaginationFilter)r.filter=u.encoder._makeColumnPaginationFilter(i);else throw new Error("expect CompositeCondition, RelationCondition, ColumnPaginationFilter but not ")}},_makeCompositeCondition:function(r){if(r.combinator===void 0||r.combinator===null)throw new Error("LogicalOperator should be one of TableStore.LogicalOperator");var i=[];for(sub in r.sub_conditions){var l={};u.encoder._makeColumnCondition(l,r.sub_conditions[sub]),i.push(l)}var a={combinator:r.combinator,subFilters:i},f=o.CompositeColumnValueFilter.create(a),s=o.CompositeColumnValueFilter.encode(f);return s.finish()},_makeSingleColumnCondition:function(r){if(r.comparator===null)throw new Error("ComparatorType should be one of [%s], not %s");var i={comparator:r.comparator,columnName:r.columnName,columnValue:u.PlainBufferBuilder.serializeColumnValue(r.columnValue),filterIfMissing:!r.passIfMissing,latestVersionOnly:r.latestVersionOnly},l=o.SingleColumnValueFilter.create(i),a=o.SingleColumnValueFilter.encode(l);return a.finish()},_makeColumnPaginationFilter:function(r){var i={offset:r.offset,limit:r.limit},l=o.ColumnPaginationFilter.create(i),a=o.ColumnPaginationFilter.encode(l);return a.finish()},_makeCondition:function(r,i){if(!i instanceof u.Condition)throw new Error("condition should be an instance of TableStore.Condition");if(r.rowExistence=i.rowExistenceExpectation,r.rowExistence===void 0||r.rowExistence===null)throw new Error("rowExistenceExpectation should be one of TableStore.RowExistenceExpectation");if(i.columnCondition!=null){var l={};u.encoder._makeColumnCondition(l,i.columnCondition);var a=o.Filter.create(l),f=o.Filter.encode(a);r.columnCondition=f.finish()}},encodeListSearchIndex:function(r){var i=t.ListSearchIndexRequest.create({tableName:r.tableName});return i},encodeDescribeSearchIndex:function(r){var i=t.DescribeSearchIndexRequest.create({tableName:r.tableName,indexName:r.indexName});return i},encodeUpdateSearchIndex:function(r){return t.UpdateSearchIndexRequest.create({tableName:r.tableName,indexName:r.indexName,timeToLive:r.timeToLive})},encodeCreateSearchIndex:function(r){const i={tableName:r.tableName,indexName:r.indexName,sourceIndexName:r.sourceIndexName,timeToLive:r.timeToLive,schema:u.encoder._makeIndexSchema(r.schema)};var l=t.CreateSearchIndexRequest.create(i);return l},_makeIndexSchema:function(r){var i={fieldSchemas:u.encoder._makeFieldSchemaArray(r.fieldSchemas),indexSetting:u.encoder._makeIndexSetting(r.indexSetting)};r.indexSort&&(i.indexSort=u.encoder._makeSort(r.indexSort));var l=t.IndexSchema.create(i);return l},_makeSingleWordAnalyzerParameter:function(r){const i={caseSensitive:r.caseSensitive,delimitWord:r.delimitWord};return t.SingleWordAnalyzerParameter.encode(i).finish()},_makeSplitAnalyzerParameter:function(r){const i={delimiter:r.delimiter};return t.SplitAnalyzerParameter.encode(i).finish()},_makeFuzzyAnalyzerParameter:function(r){const i={minChars:r.minChars,maxChars:r.maxChars};return t.FuzzyAnalyzerParameter.encode(i).finish()},_makeAnalyzerParameter:function(r){if(r.analyzer){if(r.analyzer==="single_word")return u.encoder._makeSingleWordAnalyzerParameter(r.analyzerParameter);if(r.analyzer==="split")return u.encoder._makeSplitAnalyzerParameter(r.analyzerParameter);if(r.analyzer==="fuzzy")return u.encoder._makeFuzzyAnalyzerParameter(r.analyzerParameter)}return null},_makeFieldSchemaArray:function(r){if(!r)return null;var i=[];return u.util.arrayEach(r,function(l){i.push(u.encoder._makeFieldSchema(l))}),i},_makeFieldSchema:function(r){const i={fieldName:r.fieldName,fieldType:r.fieldType,indexOptions:r.indexOptions||null,enableHighlighting:r.enableHighlighting||null,analyzer:r.analyzer||null,index:r.index||null,docValues:r.enableSortAndAgg||null,store:r.store||null,isArray:r.isAnArray||null,fieldSchemas:u.encoder._makeFieldSchemaArray(r.fieldSchemas),analyzerParameter:u.encoder._makeAnalyzerParameter(r),isVirtualField:r.isVirtualField||null,sourceFieldNames:r.sourceFieldNames||null,dateFormats:r.dateFormats||null,vectorOptions:r.vectorOptions||null};return t.FieldSchema.create(i)},_makeIndexSetting:function(r){var i={numberOfShards:1,routingFields:r&&r.routingFields||null,routingPartitionSize:r&&r.routingPartitionSize||null},l=t.IndexSetting.create(i);return l},encodeDeleteSearchIndex:function(r){var i={tableName:r.tableName,indexName:r.indexName},l=t.DeleteSearchIndexRequest.create(i);return l},encodeSearch:function(r){const i={tableName:r.tableName,indexName:r.indexName,searchQuery:u.encoder._makeSearchQuery(r.searchQuery),columnsToGet:u.encoder._makeColumnToGet(r.columnToGet),timeoutMs:r.timeoutMs||1e4};return Object.prototype.toString.call(r.routingValues)==="[object Array]"&&(i.routingValues=u.encoder._makeRoutingValues(r.routingValues)),t.SearchRequest.create(i)},encodeComputeSplits:function(r){let i={tableName:r.tableName};return r.searchIndexSplitsOptions&&(i.searchIndexSplitsOptions={indexName:r.searchIndexSplitsOptions.indexName}),t.ComputeSplitsRequest.create(i)},encodeParallelScan:function(r){let i={tableName:r.tableName,indexName:r.indexName,columnsToGet:u.encoder._makeColumnToGet(r.columnToGet),sessionId:r.sessionId,scanQuery:u.encoder._makeScanQuery(r.scanQuery),timeoutMs:r.timeoutMs||2e4};return t.ParallelScanRequest.create(i)},_makeScanQuery(r){let i={query:u.encoder._makeQuery(r.query),limit:r.limit,aliveTime:r.aliveTime,token:r.token,currentParallelId:r.currentParallelId,maxParallel:r.maxParallel};return t.ScanQuery.create(i)},_makeSearchQuery(r){var i={offset:r.offset,limit:r.limit,query:u.encoder._makeQuery(r.query),getTotalCount:r.getTotalCount||!1};r.token&&(i.token=r.token),r.sort&&(i.sort=u.encoder._makeSort(r.sort)),r.aggs&&(i.aggs=u.encoder._makeAggregations(r.aggs)),r.groupBys&&(i.groupBys=u.encoder._makeGroupBys(r.groupBys)),r.highlight&&(i.highlight=u.encoder._makeHighlight(r.highlight)),r.collapse&&(i.collapse=u.encoder._makeCollapse(r.collapse));var l=t.SearchQuery.create(i),a=t.SearchQuery.encode(l);return a.finish()},_makeQuery(r){var a=u.encoder._constrctQueryParam(r.queryType,r.query),i=Object.getPrototypeOf(a).constructor.encode(a),l={type:r.queryType,query:i.finish()},a=t.Query.create(l);return a},_makeCollapse(r){const i={};return r.fieldName&&(i.fieldName=r.fieldName),t.Collapse.create(i)},_makeAggregations(r){let i=[];for(let l of r.aggs)i.push(u.encoder._makeAggregation(l));return{aggs:i}},_makeAggregation(r){const i=u.encoder._constructAggregationParam(r.type,r.body),l=Object.getPrototypeOf(i).constructor.encode(i),a={name:r.name,type:r.type,body:l.finish()};return t.Aggregation.create(a)},_constructAggregationParam(r,i){switch(r){case u.AggregationType.AGG_AVG:{const l={fieldName:i.fieldName};return i.missing&&(l.missing=u.PlainBufferBuilder.serializeSearchValue(i.missing,"agg.missing")),t.AvgAggregation.create(l)}case u.AggregationType.AGG_MAX:{const l={fieldName:i.fieldName};return i.missing&&(l.missing=u.PlainBufferBuilder.serializeSearchValue(i.missing,"agg.missing")),t.MaxAggregation.create(l)}case u.AggregationType.AGG_MIN:{const l={fieldName:i.fieldName};return i.missing&&(l.missing=u.PlainBufferBuilder.serializeSearchValue(i.missing,"agg.missing")),t.MinAggregation.create(l)}case u.AggregationType.AGG_SUM:{const l={fieldName:i.fieldName};return i.missing&&(l.missing=u.PlainBufferBuilder.serializeSearchValue(i.missing,"agg.missing")),t.SumAggregation.create(l)}case u.AggregationType.AGG_COUNT:{const l={fieldName:i.fieldName};return t.CountAggregation.create(l)}case u.AggregationType.AGG_DISTINCT_COUNT:{const l={fieldName:i.fieldName};return i.missing&&(l.missing=u.PlainBufferBuilder.serializeSearchValue(i.missing,"agg.missing")),t.DistinctCountAggregation.create(l)}case u.AggregationType.AGG_TOP_ROWS:{const l={limit:i.limit};return i.sort&&(l.sort=u.encoder._makeSort(i.sort)),t.TopRowsAggregation.create(l)}case u.AggregationType.AGG_PERCENTILES:{const l={fieldName:i.fieldName,percentiles:i.percentiles};return i.missing&&(l.missing=u.PlainBufferBuilder.serializeSearchValue(i.missing,"agg.missing")),t.PercentilesAggregation.create(l)}default:throw new Error("not exist AggregationType: "+r)}},_makeGroupBys(r){let i=[];for(let l of r.groupBys)i.push(u.encoder._makeGroupBy(l));return{groupBys:i}},_makeGroupBy(r){const i=u.encoder._constructGroupByParam(r.type,r.body),l=Object.getPrototypeOf(i).constructor.encode(i),a={name:r.name,type:r.type,body:l.finish()};return t.GroupBy.create(a)},_constructGroupByParam(r,i){switch(r){case u.GroupByType.GROUP_BY_FIELD:{let l={fieldName:i.fieldName,size:i.size,minDocCount:i.minDocCount};return i.sort&&(l.sort=u.encoder._makeGroupBySort(i.sort)),u.encoder._makeSubAggsAndSubGroupBys(l,i),t.GroupByField.create(l)}case u.GroupByType.GROUP_BY_RANGE:{const l={fieldName:i.fieldName,ranges:u.encoder._makeRange(i.ranges)};return u.encoder._makeSubAggsAndSubGroupBys(l,i),t.GroupByRange.create(l)}case u.GroupByType.GROUP_BY_FILTER:{const l={filters:[]};return u.util.arrayEach(i.filters,function(a){let f=u.encoder._makeQuery(a);l.filters.push(f)}),u.encoder._makeSubAggsAndSubGroupBys(l,i),t.GroupByFilter.create(l)}case u.GroupByType.GROUP_BY_GEO_DISTANCE:{const l={fieldName:i.fieldName,ranges:u.encoder._makeRange(i.ranges),origin:t.GeoPoint.create(i.origin)};return u.encoder._makeSubAggsAndSubGroupBys(l,i),t.GroupByGeoDistance.create(l)}case u.GroupByType.GROUP_BY_HISTOGRAM:{const l={fieldName:i.fieldName,minDocCount:i.minDocCount};return i.sort&&(l.sort=u.encoder._makeGroupBySort(i.sort)),i.fieldRange&&(l.fieldRange=u.encoder._makeFieldRange(i.fieldRange)),i.interval&&(l.interval=u.PlainBufferBuilder.serializeSearchValue(i.interval,"groupBy.interval")),i.missing&&(l.missing=u.PlainBufferBuilder.serializeSearchValue(i.missing,"groupByHistogram.missing")),i.offset&&(l.offset=u.PlainBufferBuilder.serializeSearchValue(i.offset,"groupByHistogram.offset")),u.encoder._makeSubAggsAndSubGroupBys(l,i),t.GroupByHistogram.create(l)}case u.GroupByType.GROUP_BY_DATE_HISTOGRAM:{const l={fieldName:i.fieldName,minDocCount:i.minDocCount};return i.sort&&(l.sort=u.encoder._makeGroupBySort(i.sort)),i.fieldRange&&(l.fieldRange=u.encoder._makeFieldRange(i.fieldRange)),i.interval&&(l.interval=u.encoder._makeDateTimeValue(i.interval)),i.missing&&(l.missing=u.PlainBufferBuilder.serializeSearchValue(i.missing,"groupByDateHistogram.missing")),i.offset&&(l.offset=u.encoder._makeDateTimeValue(i.offset)),i.timeZone&&(l.timeZone=i.timeZone),u.encoder._makeSubAggsAndSubGroupBys(l,i),t.GroupByDateHistogram.create(l)}case u.GroupByType.GROUP_BY_GEO_GRID:{const l={fieldName:i.fieldName};return i.precision&&(l.precision=i.precision),i.size&&(l.size=i.size),u.encoder._makeSubAggsAndSubGroupBys(l,i),t.GroupByGeoGrid.create(l)}case u.GroupByType.GROUP_BY_COMPOSITE:{const l={};return i.nextToken&&(l.nextToken=i.nextToken),i.size&&(l.size=i.size),i.sources&&(l.sources=u.encoder._makeGroupBys(i.sources)),u.encoder._makeSubAggsAndSubGroupBys(l,i),t.GroupByComposite.create(l)}default:throw new Error("not exist GroupByType: "+r)}},_makeSubAggsAndSubGroupBys(r,i){i.subAggs&&(r.subAggs=u.encoder._makeAggregations(i.subAggs)),i.subGroupBys&&(r.subGroupBys=u.encoder._makeGroupBys(i.subGroupBys))},_makeRange(r){let i=[];return u.util.arrayEach(r,function(l){i.push(t.Range.create(l))}),i},_makeFieldRange(r){return{min:u.PlainBufferBuilder.serializeSearchValue(r.min,"FieldRange.min"),max:u.PlainBufferBuilder.serializeSearchValue(r.max,"FieldRange.max")}},_constrctQueryParam(r,i){switch(r){case u.QueryType.MATCH_QUERY:var p={fieldName:i.fieldName,text:i.text,weight:i.weight};typeof i.minimumShouldMatch=="number"&&(p.minimumShouldMatch=i.minimumShouldMatch),i.operator&&(p.operator=i.operator);var l=t.MatchQuery.create(p);return l;case u.QueryType.MATCH_PHRASE_QUERY:var p={fieldName:i.fieldName,text:i.text,weight:i.weight},a=t.MatchPhraseQuery.create(p);return a;case u.QueryType.TERM_QUERY:var p={fieldName:i.fieldName,term:u.PlainBufferBuilder.serializeSearchValue(i.term,"term"),weight:i.weight},f=t.TermQuery.create(p);return f;case u.QueryType.RANGE_QUERY:var p={fieldName:i.fieldName};i.rangeFrom!==void 0&&i.rangeFrom!==null&&(p.rangeFrom=u.PlainBufferBuilder.serializeSearchValue(i.rangeFrom,"rangeFrom"),i.includeLower!==void 0&&(p.includeLower=i.includeLower)),i.rangeTo!==void 0&&i.rangeTo!==null&&(p.rangeTo=u.PlainBufferBuilder.serializeSearchValue(i.rangeTo,"rangeTo"),i.includeUpper!==void 0&&(p.includeUpper=i.includeUpper));var s=t.RangeQuery.create(p);return s;case u.QueryType.PREFIX_QUERY:var p={fieldName:i.fieldName,prefix:i.prefix,weight:i.weight},d=t.PrefixQuery.create(p);return d;case u.QueryType.BOOL_QUERY:var p={};if(Object.prototype.toString.call(i.mustQueries)==="[object Array]"&&(p.mustQueries=[],u.util.arrayEach(i.mustQueries,function(v){p.mustQueries.push(u.encoder._makeQuery(v))})),Object.prototype.toString.call(i.mustNotQueries)==="[object Array]"&&(p.mustNotQueries=[],u.util.arrayEach(i.mustNotQueries,function(v){p.mustNotQueries.push(u.encoder._makeQuery(v))})),Object.prototype.toString.call(i.filterQueries)==="[object Array]"&&(p.filterQueries=[],u.util.arrayEach(i.filterQueries,function(v){p.filterQueries.push(u.encoder._makeQuery(v))})),Object.prototype.toString.call(i.shouldQueries)==="[object Array]"){if(typeof i.minimumShouldMatch!="number"||i.minimumShouldMatch%1!==0)throw new Error("Expect minimumShouldMatch which should be an int32 number");p.minimumShouldMatch=i.minimumShouldMatch,p.shouldQueries=[],u.util.arrayEach(i.shouldQueries,function(v){p.shouldQueries.push(u.encoder._makeQuery(v))})}var O=t.BoolQuery.create(p);return O;case u.QueryType.CONST_SCORE_QUERY:var p={filter:u.encoder._makeQuery(i.filter)},b=t.ConstScoreQuery.create(p);return b;case u.QueryType.FUNCTION_SCORE_QUERY:var p={query:u.encoder._makeQuery(i.query)};if(!i.fieldValueFactor||typeof i.fieldValueFactor.fieldName!="string")throw new Error("Except fieldValueFactor.fieldName which should be string");var w={fieldName:i.fieldValueFactor.fieldName},g=t.FieldValueFactor.create(w);p.fieldValueFactor=g;var B=t.FunctionScoreQuery.create(p);return B;case u.QueryType.NESTED_QUERY:var p={path:i.path,query:u.encoder._makeQuery(i.query),scoreMode:i.scoreMode||u.ScoreMode.SCORE_MODE_AVG,weight:i.weight};i.innerHits&&(p.innerHits=u.encoder._makeInnerHits(i.innerHits));var A=t.NestedQuery.create(p);return A;case u.QueryType.WILDCARD_QUERY:var p={fieldName:i.fieldName,value:i.value,weight:i.weight},C=t.WildcardQuery.create(p);return C;case u.QueryType.MATCH_ALL_QUERY:var E=t.MatchAllQuery.create();return E;case u.QueryType.GEO_BOUNDING_BOX_QUERY:var p={fieldName:i.fieldName,topLeft:i.topLeft,bottomRight:i.bottomRight},_=t.GeoBoundingBoxQuery.create(p);return _;case u.QueryType.GEO_DISTANCE_QUERY:var p={fieldName:i.fieldName,centerPoint:i.centerPoint,distance:i.distance},S=t.GeoDistanceQuery.create(p);return S;case u.QueryType.GEO_POLYGON_QUERY:var p={fieldName:i.fieldName,points:i.points},y=t.GeoPolygonQuery.create(p);return y;case u.QueryType.TERMS_QUERY:var p={fieldName:i.fieldName,terms:u.encoder._makeTerms(i.terms),weight:i.weight},h=t.TermsQuery.create(p);return h;case u.QueryType.EXISTS_QUERY:var p={fieldName:i.fieldName},h=t.TermsQuery.create(p);return h;case u.QueryType.KNN_VECTOR_QUERY:var p={fieldName:i.fieldName};i.topK&&(p.topK=i.topK),i.float32QueryVector&&(p.float32QueryVector=i.float32QueryVector),i.filter&&(p.filter=u.encoder._makeQuery(i.filter)),i.weight&&(p.weight=i.weight);var m=t.KnnVectorQuery.create(p);return m;case u.QueryType.FUNCTIONS_SCORE_QUERY:var p={};i.query&&(p.query=u.encoder._makeQuery(i.query)),i.minScore&&(p.minScore=i.minScore),i.maxScore&&(p.maxScore=i.maxScore),i.scoreMode&&(p.scoreMode=i.scoreMode),i.combineMode&&(p.combineMode=i.combineMode),p.functions=[],i.functions&&u.util.arrayEach(i.functions,function(v){var P={weight:v.weight||null};if(v.filter&&(P.filter=u.encoder._makeQuery(v.filter)),v.fieldValueFactorFunction&&(P.fieldValueFactor=t.FieldValueFactorFunction.create(v.fieldValueFactorFunction)),v.decayFunction){const F=u.encoder._constructDecayParam(v.decayFunction.decayParamType,v.decayFunction.decayParam),U=Object.getPrototypeOf(F).constructor.encode(F);var M={fieldName:v.decayFunction.fieldName,mathFunction:v.decayFunction.mathFunction||null,paramType:v.decayFunction.decayParamType,param:U.finish(),decay:v.decayFunction.decay||null,multiValueMode:v.decayFunction.multiValueMode||null};P.decay=t.DecayFunction.create(M)}v.randomFunction&&(P.random=t.RandomScoreFunction.create(v.randomFunction)),p.functions.push(P)});var x=t.FunctionsScoreQuery.create(p);return x;default:throw new Error("queryTypeExpectation not exist queryType: "+r)}},_constructDecayParam(r,i){return r===u.DecayFuncParamType.DF_DATE_PARAM?t.DecayFuncDateParam.create(i):r===u.DecayFuncParamType.DF_GEO_PARAM?t.DecayFuncGeoParam.create(i):r===u.DecayFuncParamType.DF_NUMERIC_PARAM?t.DecayFuncNumericParam.create(i):null},_makeColumnToGet(r){var i={returnType:r.returnType};r.returnType===u.ColumnReturnType.RETURN_SPECIFIED&&(i.columnNames=r.returnNames);var l=t.ColumnsToGet.create(i);return l},_makeRoutingValues(r){var i=[];return u.util.arrayEach(r,function(l){i.push(u.PlainBufferBuilder.serializePrimaryKey(l))}),i},_makeTerms(r){var i=[];return Object.prototype.toString.call(r)!=="[object Array]"||u.util.arrayEach(r,function(l){var a=u.PlainBufferBuilder.serializeSearchValue(l,"term");i.push(a)}),i},_makeSort(r){var i={sorter:[]};u.util.arrayEach(r.sorters,function(a){var f=u.encoder._makeSorter(a);i.sorter.push(f)});var l=t.Sort.create(i);return l},_makeSorter(r){const i={};if(r.fieldSort){var l={fieldName:r.fieldSort.fieldName,order:r.fieldSort.order,mode:r.fieldSort.mode};if(r.fieldSort.missingValue?l.missingValue=u.PlainBufferBuilder.serializeSearchValue(r.fieldSort.missingValue,"missingValue"):r.fieldSort.missing&&(l.missingValue=u.PlainBufferBuilder.serializeSearchValue(r.fieldSort.missing,"missing")),r.fieldSort.nestedFilter){var a={path:r.fieldSort.nestedFilter.path,filter:u.encoder._makeQuery(r.fieldSort.nestedFilter.filter)};l.nestedFilter=t.NestedFilter.create(a)}r.fieldSort.missingField&&(l.missingField=r.fieldSort.missingField),i.fieldSort=t.FieldSort.create(l)}else if(r.geoDistanceSort){var f={fieldName:r.geoDistanceSort.fieldName,points:r.geoDistanceSort.points,order:r.geoDistanceSort.order,mode:r.geoDistanceSort.mode,distanceType:r.geoDistanceSort.distanceType};if(r.geoDistanceSort.nestedFilter){var a={path:r.geoDistanceSort.nestedFilter.path,filter:u.encoder._makeQuery(r.geoDistanceSort.nestedFilter.filter)};f.nestedFilter=t.NestedFilter.create(a)}var s=t.GeoDistanceSort.create(f);i.geoDistanceSort=s}else if(r.scoreSort){var d={order:r.scoreSort.order},O=t.ScoreSort.create(d);i.scoreSort=O}else if(r.primaryKeySort){var b={order:r.primaryKeySort.order},w=t.PrimaryKeySort.create(b);i.pkSort=w}else if(r.docSort){var g={order:r.docSort.order},B=t.DocSort.create(g);i.docSort=B}return t.Sorter.create(i)},_makeGroupBySort:function(r){const i={sorters:[]};return u.util.arrayEach(r.sorters,function(l){const a=u.encoder._makeGroupBySorter(l);i.sorters.push(a)}),t.GroupBySort.create(i)},_makeGroupBySorter(r){const i={};if(r.groupKeySort){const l={order:r.groupKeySort.order};i.groupKeySort=t.GroupKeySort.create(l)}else if(r.rowCountSort){const l={order:r.rowCountSort.order};i.rowCountSort=t.RowCountSort.create(l)}else if(r.subAggSort){const l={subAggName:r.subAggSort.subAggName,order:r.subAggSort.order};i.subAggSort=t.SubAggSort.create(l)}return t.GroupBySorter.create(i)},_makeDateTimeValue(r){const i={value:r.value,unit:r.unit};return t.DateTimeValue.create(i)},_makeInnerHits(r){var i={offset:r.offset||null,limit:r.limit||null};return r.sort&&(i.sort=u.encoder._makeSort(r.sort)),r.highlight&&(i.highlight=u.encoder._makeHighlight(r.highlight)),t.InnerHits.create(i)},_makeHighlight(r){var i={highlightEncoder:r.highlightEncoder,highlightParameters:r.highlightParameters};return t.Highlight.create(i)},encodeCreateIndex:function(r){var i=n.CreateIndexRequest.create({mainTableName:r.mainTableName,includeBaseData:r.includeBaseData||!1,indexMeta:new n.IndexMeta({name:r.indexMeta.name,primaryKey:r.indexMeta.primaryKey,definedColumn:r.indexMeta.definedColumn,indexUpdateMode:r.indexMeta.indexUpdateMode||u.IndexUpdateMode.IUM_ASYNC_INDEX,indexType:r.indexMeta.indexType||u.IndexType.IT_GLOBAL_INDEX})});return i},encodeDropIndex:function(r){var i=n.DropIndexRequest.create({mainTableName:r.mainTableName,indexName:r.indexName});return i},encodeStartLocalTransaction:function(r){var i=n.StartLocalTransactionRequest.create({tableName:r.tableName,key:u.PlainBufferBuilder.serializePrimaryKey(r.primaryKey)});return i},encodeCommitTransaction:function(r){var i=n.CommitTransactionRequest.create({transactionId:typeof r=="string"?r:r.transactionId});return i},encodeAbortTransaction:function(r){var i=n.AbortTransactionRequest.create({transactionId:typeof r=="string"?r:r.transactionId});return i},encodeSQLQuery:function(r){if(r.version&&r.version!==u.SQLPayloadVersion.SQL_FLAT_BUFFERS)throw new Error("SQL payload version only support: 'TableStore.SQLPayloadVersion.SQL_FLAT_BUFFERS', please use fixed tablestore node sdk version '5.2.2' to use 'TableStore.SQLPayloadVersion.SQL_PLAIN_BUFFER'");const i={query:r.query,version:u.SQLPayloadVersion.SQL_FLAT_BUFFERS};return n.SQLQueryRequest.create(i)}};var e={createTable:u.encoder.encodeCreateTable,listTable:u.encoder.encodeListTable,deleteTable:u.encoder.encodeDeleteTable,updateTable:u.encoder.encodeUpdateTable,describeTable:u.encoder.encodeDescribeTable,getRow:u.encoder.encodeGetRow,putRow:u.encoder.encodePutRow,updateRow:u.encoder.encodeUpdateRow,deleteRow:u.encoder.encodeDeleteRow,getRange:u.encoder.encodeGetRange,batchGetRow:u.encoder.encodeBatchGetRow,batchWriteRow:u.encoder.encodeBatchWriteRow,listSearchIndex:u.encoder.encodeListSearchIndex,describeSearchIndex:u.encoder.encodeDescribeSearchIndex,updateSearchIndex:u.encoder.encodeUpdateSearchIndex,createSearchIndex:u.encoder.encodeCreateSearchIndex,deleteSearchIndex:u.encoder.encodeDeleteSearchIndex,search:u.encoder.encodeSearch,computeSplits:u.encoder.encodeComputeSplits,parallelScan:u.encoder.encodeParallelScan,createIndex:u.encoder.encodeCreateIndex,dropIndex:u.encoder.encodeDropIndex,startLocalTransaction:u.encoder.encodeStartLocalTransaction,commitTransaction:u.encoder.encodeCommitTransaction,abortTransaction:u.encoder.encodeAbortTransaction,SQLQuery:u.encoder.encodeSQLQuery};return encoder}var decoder={},flatbuffers={};flatbuffers.Offset;flatbuffers.Table;flatbuffers.SIZEOF_SHORT=2;flatbuffers.SIZEOF_INT=4;flatbuffers.FILE_IDENTIFIER_LENGTH=4;flatbuffers.SIZE_PREFIX_LENGTH=4;flatbuffers.Encoding={UTF8_BYTES:1,UTF16_STRING:2};flatbuffers.int32=new Int32Array(2);flatbuffers.float32=new Float32Array(flatbuffers.int32.buffer);flatbuffers.float64=new Float64Array(flatbuffers.int32.buffer);flatbuffers.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;flatbuffers.Long=function(u,c){this.low=u|0,this.high=c|0};flatbuffers.Long.create=function(u,c){return u==0&&c==0?flatbuffers.Long.ZERO:new flatbuffers.Long(u,c)};flatbuffers.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296};flatbuffers.Long.prototype.equals=function(u){return this.low==u.low&&this.high==u.high};flatbuffers.Long.ZERO=new flatbuffers.Long(0,0);flatbuffers.Builder=function(u){if(u)var c=u;else var c=1024;this.bb=flatbuffers.ByteBuffer.allocate(c),this.space=c,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1};flatbuffers.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1};flatbuffers.Builder.prototype.forceDefaults=function(u){this.force_defaults=u};flatbuffers.Builder.prototype.dataBuffer=function(){return this.bb};flatbuffers.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())};flatbuffers.Builder.prototype.prep=function(u,c){u>this.minalign&&(this.minalign=u);for(var n=~(this.bb.capacity()-this.space+c)+1&u-1;this.space<n+u+c;){var o=this.bb.capacity();this.bb=flatbuffers.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-o}this.pad(n)};flatbuffers.Builder.prototype.pad=function(u){for(var c=0;c<u;c++)this.bb.writeInt8(--this.space,0)};flatbuffers.Builder.prototype.writeInt8=function(u){this.bb.writeInt8(this.space-=1,u)};flatbuffers.Builder.prototype.writeInt16=function(u){this.bb.writeInt16(this.space-=2,u)};flatbuffers.Builder.prototype.writeInt32=function(u){this.bb.writeInt32(this.space-=4,u)};flatbuffers.Builder.prototype.writeInt64=function(u){this.bb.writeInt64(this.space-=8,u)};flatbuffers.Builder.prototype.writeFloat32=function(u){this.bb.writeFloat32(this.space-=4,u)};flatbuffers.Builder.prototype.writeFloat64=function(u){this.bb.writeFloat64(this.space-=8,u)};flatbuffers.Builder.prototype.addInt8=function(u){this.prep(1,0),this.writeInt8(u)};flatbuffers.Builder.prototype.addInt16=function(u){this.prep(2,0),this.writeInt16(u)};flatbuffers.Builder.prototype.addInt32=function(u){this.prep(4,0),this.writeInt32(u)};flatbuffers.Builder.prototype.addInt64=function(u){this.prep(8,0),this.writeInt64(u)};flatbuffers.Builder.prototype.addFloat32=function(u){this.prep(4,0),this.writeFloat32(u)};flatbuffers.Builder.prototype.addFloat64=function(u){this.prep(8,0),this.writeFloat64(u)};flatbuffers.Builder.prototype.addFieldInt8=function(u,c,n){(this.force_defaults||c!=n)&&(this.addInt8(c),this.slot(u))};flatbuffers.Builder.prototype.addFieldInt16=function(u,c,n){(this.force_defaults||c!=n)&&(this.addInt16(c),this.slot(u))};flatbuffers.Builder.prototype.addFieldInt32=function(u,c,n){(this.force_defaults||c!=n)&&(this.addInt32(c),this.slot(u))};flatbuffers.Builder.prototype.addFieldInt64=function(u,c,n){(this.force_defaults||!c.equals(n))&&(this.addInt64(c),this.slot(u))};flatbuffers.Builder.prototype.addFieldFloat32=function(u,c,n){(this.force_defaults||c!=n)&&(this.addFloat32(c),this.slot(u))};flatbuffers.Builder.prototype.addFieldFloat64=function(u,c,n){(this.force_defaults||c!=n)&&(this.addFloat64(c),this.slot(u))};flatbuffers.Builder.prototype.addFieldOffset=function(u,c,n){(this.force_defaults||c!=n)&&(this.addOffset(c),this.slot(u))};flatbuffers.Builder.prototype.addFieldStruct=function(u,c,n){c!=n&&(this.nested(c),this.slot(u))};flatbuffers.Builder.prototype.nested=function(u){if(u!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")};flatbuffers.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")};flatbuffers.Builder.prototype.slot=function(u){this.vtable[u]=this.offset()};flatbuffers.Builder.prototype.offset=function(){return this.bb.capacity()-this.space};flatbuffers.Builder.growByteBuffer=function(u){var c=u.capacity();if(c&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var n=c<<1,o=flatbuffers.ByteBuffer.allocate(n);return o.setPosition(n-c),o.bytes().set(u.bytes(),n-c),o};flatbuffers.Builder.prototype.addOffset=function(u){this.prep(flatbuffers.SIZEOF_INT,0),this.writeInt32(this.offset()-u+flatbuffers.SIZEOF_INT)};flatbuffers.Builder.prototype.startObject=function(u){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=u;for(var c=0;c<u;c++)this.vtable[c]=0;this.isNested=!0,this.object_start=this.offset()};flatbuffers.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var u=this.offset(),c=this.vtable_in_use-1;c>=0&&this.vtable[c]==0;c--);for(var n=c+1;c>=0;c--)this.addInt16(this.vtable[c]!=0?u-this.vtable[c]:0);var o=2;this.addInt16(u-this.object_start);var t=(n+o)*flatbuffers.SIZEOF_SHORT;this.addInt16(t);var e=0,r=this.space;t:for(c=0;c<this.vtables.length;c++){var i=this.bb.capacity()-this.vtables[c];if(t==this.bb.readInt16(i)){for(var l=flatbuffers.SIZEOF_SHORT;l<t;l+=flatbuffers.SIZEOF_SHORT)if(this.bb.readInt16(r+l)!=this.bb.readInt16(i+l))continue t;e=this.vtables[c];break}}return e?(this.space=this.bb.capacity()-u,this.bb.writeInt32(this.space,e-u)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-u,this.offset()-u)),this.isNested=!1,u};flatbuffers.Builder.prototype.finish=function(u,c,n){var o=n?flatbuffers.SIZE_PREFIX_LENGTH:0;if(c){var t=c;if(this.prep(this.minalign,flatbuffers.SIZEOF_INT+flatbuffers.FILE_IDENTIFIER_LENGTH+o),t.length!=flatbuffers.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+flatbuffers.FILE_IDENTIFIER_LENGTH);for(var e=flatbuffers.FILE_IDENTIFIER_LENGTH-1;e>=0;e--)this.writeInt8(t.charCodeAt(e))}this.prep(this.minalign,flatbuffers.SIZEOF_INT+o),this.addOffset(u),o&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)};flatbuffers.Builder.prototype.finishSizePrefixed=function(u,c){this.finish(u,c,!0)};flatbuffers.Builder.prototype.requiredField=function(u,c){var n=this.bb.capacity()-u,o=n-this.bb.readInt32(n),t=this.bb.readInt16(o+c)!=0;if(!t)throw new Error("FlatBuffers: field "+c+" must be set")};flatbuffers.Builder.prototype.startVector=function(u,c,n){this.notNested(),this.vector_num_elems=c,this.prep(flatbuffers.SIZEOF_INT,u*c),this.prep(n,u*c)};flatbuffers.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()};flatbuffers.Builder.prototype.createString=function(u){if(u instanceof Uint8Array)var c=u;else for(var c=[],n=0;n<u.length;){var o,t=u.charCodeAt(n++);if(t<55296||t>=56320)o=t;else{var e=u.charCodeAt(n++);o=(t<<10)+e+-56613888}o<128?c.push(o):(o<2048?c.push(o>>6&31|192):(o<65536?c.push(o>>12&15|224):c.push(o>>18&7|240,o>>12&63|128),c.push(o>>6&63|128)),c.push(o&63|128))}this.addInt8(0),this.startVector(1,c.length,1),this.bb.setPosition(this.space-=c.length);for(var n=0,r=this.space,i=this.bb.bytes();n<c.length;n++)i[r++]=c[n];return this.endVector()};flatbuffers.Builder.prototype.createLong=function(u,c){return flatbuffers.Long.create(u,c)};flatbuffers.ByteBuffer=function(u){this.bytes_=u,this.position_=0};flatbuffers.ByteBuffer.allocate=function(u){return new flatbuffers.ByteBuffer(new Uint8Array(u))};flatbuffers.ByteBuffer.prototype.clear=function(){this.position_=0};flatbuffers.ByteBuffer.prototype.bytes=function(){return this.bytes_};flatbuffers.ByteBuffer.prototype.position=function(){return this.position_};flatbuffers.ByteBuffer.prototype.setPosition=function(u){this.position_=u};flatbuffers.ByteBuffer.prototype.capacity=function(){return this.bytes_.length};flatbuffers.ByteBuffer.prototype.readInt8=function(u){return this.readUint8(u)<<24>>24};flatbuffers.ByteBuffer.prototype.readUint8=function(u){return this.bytes_[u]};flatbuffers.ByteBuffer.prototype.readInt16=function(u){return this.readUint16(u)<<16>>16};flatbuffers.ByteBuffer.prototype.readUint16=function(u){return this.bytes_[u]|this.bytes_[u+1]<<8};flatbuffers.ByteBuffer.prototype.readInt32=function(u){return this.bytes_[u]|this.bytes_[u+1]<<8|this.bytes_[u+2]<<16|this.bytes_[u+3]<<24};flatbuffers.ByteBuffer.prototype.readUint32=function(u){return this.readInt32(u)>>>0};flatbuffers.ByteBuffer.prototype.readInt64=function(u){return new flatbuffers.Long(this.readInt32(u),this.readInt32(u+4))};flatbuffers.ByteBuffer.prototype.readUint64=function(u){return new flatbuffers.Long(this.readUint32(u),this.readUint32(u+4))};flatbuffers.ByteBuffer.prototype.readFloat32=function(u){return flatbuffers.int32[0]=this.readInt32(u),flatbuffers.float32[0]};flatbuffers.ByteBuffer.prototype.readFloat64=function(u){return flatbuffers.int32[flatbuffers.isLittleEndian?0:1]=this.readInt32(u),flatbuffers.int32[flatbuffers.isLittleEndian?1:0]=this.readInt32(u+4),flatbuffers.float64[0]};flatbuffers.ByteBuffer.prototype.writeInt8=function(u,c){this.bytes_[u]=c};flatbuffers.ByteBuffer.prototype.writeUint8=function(u,c){this.bytes_[u]=c};flatbuffers.ByteBuffer.prototype.writeInt16=function(u,c){this.bytes_[u]=c,this.bytes_[u+1]=c>>8};flatbuffers.ByteBuffer.prototype.writeUint16=function(u,c){this.bytes_[u]=c,this.bytes_[u+1]=c>>8};flatbuffers.ByteBuffer.prototype.writeInt32=function(u,c){this.bytes_[u]=c,this.bytes_[u+1]=c>>8,this.bytes_[u+2]=c>>16,this.bytes_[u+3]=c>>24};flatbuffers.ByteBuffer.prototype.writeUint32=function(u,c){this.bytes_[u]=c,this.bytes_[u+1]=c>>8,this.bytes_[u+2]=c>>16,this.bytes_[u+3]=c>>24};flatbuffers.ByteBuffer.prototype.writeInt64=function(u,c){this.writeInt32(u,c.low),this.writeInt32(u+4,c.high)};flatbuffers.ByteBuffer.prototype.writeUint64=function(u,c){this.writeUint32(u,c.low),this.writeUint32(u+4,c.high)};flatbuffers.ByteBuffer.prototype.writeFloat32=function(u,c){flatbuffers.float32[0]=c,this.writeInt32(u,flatbuffers.int32[0])};flatbuffers.ByteBuffer.prototype.writeFloat64=function(u,c){flatbuffers.float64[0]=c,this.writeInt32(u,flatbuffers.int32[flatbuffers.isLittleEndian?0:1]),this.writeInt32(u+4,flatbuffers.int32[flatbuffers.isLittleEndian?1:0])};flatbuffers.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+flatbuffers.SIZEOF_INT+flatbuffers.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var u="",c=0;c<flatbuffers.FILE_IDENTIFIER_LENGTH;c++)u+=String.fromCharCode(this.readInt8(this.position_+flatbuffers.SIZEOF_INT+c));return u};flatbuffers.ByteBuffer.prototype.__offset=function(u,c){var n=u-this.readInt32(u);return c<this.readInt16(n)?this.readInt16(n+c):0};flatbuffers.ByteBuffer.prototype.__union=function(u,c){return u.bb_pos=c+this.readInt32(c),u.bb=this,u};flatbuffers.ByteBuffer.prototype.__string=function(u,c){u+=this.readInt32(u);var n=this.readInt32(u),o="",t=0;if(u+=flatbuffers.SIZEOF_INT,c===flatbuffers.Encoding.UTF8_BYTES)return this.bytes_.subarray(u,u+n);for(;t<n;){var e,r=this.readUint8(u+t++);if(r<192)e=r;else{var i=this.readUint8(u+t++);if(r<224)e=(r&31)<<6|i&63;else{var l=this.readUint8(u+t++);if(r<240)e=(r&15)<<12|(i&63)<<6|l&63;else{var a=this.readUint8(u+t++);e=(r&7)<<18|(i&63)<<12|(l&63)<<6|a&63}}}e<65536?o+=String.fromCharCode(e):(e-=65536,o+=String.fromCharCode((e>>10)+55296,(e&1023)+56320))}return o};flatbuffers.ByteBuffer.prototype.__indirect=function(u){return u+this.readInt32(u)};flatbuffers.ByteBuffer.prototype.__vector=function(u){return u+this.readInt32(u)+flatbuffers.SIZEOF_INT};flatbuffers.ByteBuffer.prototype.__vector_len=function(u){return this.readInt32(u+this.readInt32(u))};flatbuffers.ByteBuffer.prototype.__has_identifier=function(u){if(u.length!=flatbuffers.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+flatbuffers.FILE_IDENTIFIER_LENGTH);for(var c=0;c<flatbuffers.FILE_IDENTIFIER_LENGTH;c++)if(u.charCodeAt(c)!=this.readInt8(this.position_+flatbuffers.SIZEOF_INT+c))return!1;return!0};flatbuffers.ByteBuffer.prototype.createLong=function(u,c){return flatbuffers.Long.create(u,c)};const flatbuffers$1=Object.freeze(Object.defineProperty({__proto__:null,flatbuffers},Symbol.toStringTag,{value:"Module"})),require$$2=getAugmentedNamespace(flatbuffers$1);var sql_generated={},DataType={NONE:0,LONG:1,BOOLEAN:2,DOUBLE:3,STRING:4,BINARY:5,STRING_RLE:6},DataTypeName={0:"NONE",1:"LONG",2:"BOOLEAN",3:"DOUBLE",4:"STRING",5:"BINARY",6:"STRING_RLE"};function BytesValue(){this.bb=null,this.bb_pos=0}BytesValue.prototype.__init=function(u,c){return this.bb_pos=u,this.bb=c,this};BytesValue.getRootAsBytesValue=function(u,c){return(c||new BytesValue).__init(u.readInt32(u.position())+u.position(),u)};BytesValue.prototype.value=function(u){var c=this.bb.__offset(this.bb_pos,4);return c?this.bb.readInt8(this.bb.__vector(this.bb_pos+c)+u):0};BytesValue.prototype.valueLength=function(){var u=this.bb.__offset(this.bb_pos,4);return u?this.bb.__vector_len(this.bb_pos+u):0};BytesValue.prototype.valueArray=function(){var u=this.bb.__offset(this.bb_pos,4);return u?new Int8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+u),this.bb.__vector_len(this.bb_pos+u)):null};BytesValue.startBytesValue=function(u){u.startObject(1)};BytesValue.addValue=function(u,c){u.addFieldOffset(0,c,0)};BytesValue.createValueVector=function(u,c){u.startVector(1,c.length,1);for(var n=c.length-1;n>=0;n--)u.addInt8(c[n]);return u.endVector()};BytesValue.startValueVector=function(u,c){u.startVector(1,c,1)};BytesValue.endBytesValue=function(u){var c=u.endObject();return c};BytesValue.createBytesValue=function(u,c){return BytesValue.startBytesValue(u),BytesValue.addValue(u,c),BytesValue.endBytesValue(u)};function RLEStringValues(){this.bb=null,this.bb_pos=0}RLEStringValues.prototype.__init=function(u,c){return this.bb_pos=u,this.bb=c,this};RLEStringValues.getRootAsRLEStringValues=function(u,c){return(c||new RLEStringValues).__init(u.readInt32(u.position())+u.position(),u)};RLEStringValues.prototype.array=function(u,c){var n=this.bb.__offset(this.bb_pos,4);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+u*4,c):null};RLEStringValues.prototype.arrayLength=function(){var u=this.bb.__offset(this.bb_pos,4);return u?this.bb.__vector_len(this.bb_pos+u):0};RLEStringValues.prototype.indexMapping=function(u){var c=this.bb.__offset(this.bb_pos,6);return c?this.bb.readInt32(this.bb.__vector(this.bb_pos+c)+u*4):0};RLEStringValues.prototype.indexMappingLength=function(){var u=this.bb.__offset(this.bb_pos,6);return u?this.bb.__vector_len(this.bb_pos+u):0};RLEStringValues.prototype.indexMappingArray=function(){var u=this.bb.__offset(this.bb_pos,6);return u?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+u),this.bb.__vector_len(this.bb_pos+u)):null};RLEStringValues.startRLEStringValues=function(u){u.startObject(2)};RLEStringValues.addArray=function(u,c){u.addFieldOffset(0,c,0)};RLEStringValues.createArrayVector=function(u,c){u.startVector(4,c.length,4);for(var n=c.length-1;n>=0;n--)u.addOffset(c[n]);return u.endVector()};RLEStringValues.startArrayVector=function(u,c){u.startVector(4,c,4)};RLEStringValues.addIndexMapping=function(u,c){u.addFieldOffset(1,c,0)};RLEStringValues.createIndexMappingVector=function(u,c){u.startVector(4,c.length,4);for(var n=c.length-1;n>=0;n--)u.addInt32(c[n]);return u.endVector()};RLEStringValues.startIndexMappingVector=function(u,c){u.startVector(4,c,4)};RLEStringValues.endRLEStringValues=function(u){var c=u.endObject();return c};RLEStringValues.createRLEStringValues=function(u,c,n){return RLEStringValues.startRLEStringValues(u),RLEStringValues.addArray(u,c),RLEStringValues.addIndexMapping(u,n),RLEStringValues.endRLEStringValues(u)};function ColumnValues(){this.bb=null,this.bb_pos=0}ColumnValues.prototype.__init=function(u,c){return this.bb_pos=u,this.bb=c,this};ColumnValues.getRootAsColumnValues=function(u,c){return(c||new ColumnValues).__init(u.readInt32(u.position())+u.position(),u)};ColumnValues.prototype.isNullvalues=function(u){var c=this.bb.__offset(this.bb_pos,4);return c?!!this.bb.readInt8(this.bb.__vector(this.bb_pos+c)+u):!1};ColumnValues.prototype.isNullvaluesLength=function(){var u=this.bb.__offset(this.bb_pos,4);return u?this.bb.__vector_len(this.bb_pos+u):0};ColumnValues.prototype.isNullvaluesArray=function(){var u=this.bb.__offset(this.bb_pos,4);return u?new Int8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+u),this.bb.__vector_len(this.bb_pos+u)):null};ColumnValues.prototype.longValues=function(u){var c=this.bb.__offset(this.bb_pos,6);return c?this.bb.readInt64(this.bb.__vector(this.bb_pos+c)+u*8):this.bb.createLong(0,0)};ColumnValues.prototype.longValuesLength=function(){var u=this.bb.__offset(this.bb_pos,6);return u?this.bb.__vector_len(this.bb_pos+u):0};ColumnValues.prototype.boolValues=function(u){var c=this.bb.__offset(this.bb_pos,8);return c?!!this.bb.readInt8(this.bb.__vector(this.bb_pos+c)+u):!1};ColumnValues.prototype.boolValuesLength=function(){var u=this.bb.__offset(this.bb_pos,8);return u?this.bb.__vector_len(this.bb_pos+u):0};ColumnValues.prototype.boolValuesArray=function(){var u=this.bb.__offset(this.bb_pos,8);return u?new Int8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+u),this.bb.__vector_len(this.bb_pos+u)):null};ColumnValues.prototype.doubleValues=function(u){var c=this.bb.__offset(this.bb_pos,10);return c?this.bb.readFloat64(this.bb.__vector(this.bb_pos+c)+u*8):0};ColumnValues.prototype.doubleValuesLength=function(){var u=this.bb.__offset(this.bb_pos,10);return u?this.bb.__vector_len(this.bb_pos+u):0};ColumnValues.prototype.doubleValuesArray=function(){var u=this.bb.__offset(this.bb_pos,10);return u?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+u),this.bb.__vector_len(this.bb_pos+u)):null};ColumnValues.prototype.stringValues=function(u,c){var n=this.bb.__offset(this.bb_pos,12);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+u*4,c):null};ColumnValues.prototype.stringValuesLength=function(){var u=this.bb.__offset(this.bb_pos,12);return u?this.bb.__vector_len(this.bb_pos+u):0};ColumnValues.prototype.binaryValues=function(u,c){var n=this.bb.__offset(this.bb_pos,14);return n?(c||new BytesValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+u*4),this.bb):null};ColumnValues.prototype.binaryValuesLength=function(){var u=this.bb.__offset(this.bb_pos,14);return u?this.bb.__vector_len(this.bb_pos+u):0};ColumnValues.prototype.rleStringValues=function(u){var c=this.bb.__offset(this.bb_pos,16);return c?(u||new RLEStringValues).__init(this.bb.__indirect(this.bb_pos+c),this.bb):null};ColumnValues.startColumnValues=function(u){u.startObject(7)};ColumnValues.addIsNullvalues=function(u,c){u.addFieldOffset(0,c,0)};ColumnValues.createIsNullvaluesVector=function(u,c){u.startVector(1,c.length,1);for(var n=c.length-1;n>=0;n--)u.addInt8(+c[n]);return u.endVector()};ColumnValues.startIsNullvaluesVector=function(u,c){u.startVector(1,c,1)};ColumnValues.addLongValues=function(u,c){u.addFieldOffset(1,c,0)};ColumnValues.createLongValuesVector=function(u,c){u.startVector(8,c.length,8);for(var n=c.length-1;n>=0;n--)u.addInt64(c[n]);return u.endVector()};ColumnValues.startLongValuesVector=function(u,c){u.startVector(8,c,8)};ColumnValues.addBoolValues=function(u,c){u.addFieldOffset(2,c,0)};ColumnValues.createBoolValuesVector=function(u,c){u.startVector(1,c.length,1);for(var n=c.length-1;n>=0;n--)u.addInt8(+c[n]);return u.endVector()};ColumnValues.startBoolValuesVector=function(u,c){u.startVector(1,c,1)};ColumnValues.addDoubleValues=function(u,c){u.addFieldOffset(3,c,0)};ColumnValues.createDoubleValuesVector=function(u,c){u.startVector(8,c.length,8);for(var n=c.length-1;n>=0;n--)u.addFloat64(c[n]);return u.endVector()};ColumnValues.startDoubleValuesVector=function(u,c){u.startVector(8,c,8)};ColumnValues.addStringValues=function(u,c){u.addFieldOffset(4,c,0)};ColumnValues.createStringValuesVector=function(u,c){u.startVector(4,c.length,4);for(var n=c.length-1;n>=0;n--)u.addOffset(c[n]);return u.endVector()};ColumnValues.startStringValuesVector=function(u,c){u.startVector(4,c,4)};ColumnValues.addBinaryValues=function(u,c){u.addFieldOffset(5,c,0)};ColumnValues.createBinaryValuesVector=function(u,c){u.startVector(4,c.length,4);for(var n=c.length-1;n>=0;n--)u.addOffset(c[n]);return u.endVector()};ColumnValues.startBinaryValuesVector=function(u,c){u.startVector(4,c,4)};ColumnValues.addRleStringValues=function(u,c){u.addFieldOffset(6,c,0)};ColumnValues.endColumnValues=function(u){var c=u.endObject();return c};ColumnValues.createColumnValues=function(u,c,n,o,t,e,r,i){return ColumnValues.startColumnValues(u),ColumnValues.addIsNullvalues(u,c),ColumnValues.addLongValues(u,n),ColumnValues.addBoolValues(u,o),ColumnValues.addDoubleValues(u,t),ColumnValues.addStringValues(u,e),ColumnValues.addBinaryValues(u,r),ColumnValues.addRleStringValues(u,i),ColumnValues.endColumnValues(u)};function SQLResponseColumn(){this.bb=null,this.bb_pos=0}SQLResponseColumn.prototype.__init=function(u,c){return this.bb_pos=u,this.bb=c,this};SQLResponseColumn.getRootAsSQLResponseColumn=function(u,c){return(c||new SQLResponseColumn).__init(u.readInt32(u.position())+u.position(),u)};SQLResponseColumn.prototype.columnName=function(u){var c=this.bb.__offset(this.bb_pos,4);return c?this.bb.__string(this.bb_pos+c,u):null};SQLResponseColumn.prototype.columnType=function(){var u=this.bb.__offset(this.bb_pos,6);return u?this.bb.readInt8(this.bb_pos+u):DataType.NONE};SQLResponseColumn.prototype.columnValue=function(u){var c=this.bb.__offset(this.bb_pos,8);return c?(u||new ColumnValues).__init(this.bb.__indirect(this.bb_pos+c),this.bb):null};SQLResponseColumn.startSQLResponseColumn=function(u){u.startObject(3)};SQLResponseColumn.addColumnName=function(u,c){u.addFieldOffset(0,c,0)};SQLResponseColumn.addColumnType=function(u,c){u.addFieldInt8(1,c,DataType.NONE)};SQLResponseColumn.addColumnValue=function(u,c){u.addFieldOffset(2,c,0)};SQLResponseColumn.endSQLResponseColumn=function(u){var c=u.endObject();return c};SQLResponseColumn.createSQLResponseColumn=function(u,c,n,o){return SQLResponseColumn.startSQLResponseColumn(u),SQLResponseColumn.addColumnName(u,c),SQLResponseColumn.addColumnType(u,n),SQLResponseColumn.addColumnValue(u,o),SQLResponseColumn.endSQLResponseColumn(u)};function SQLResponseColumns(){this.bb=null,this.bb_pos=0}SQLResponseColumns.prototype.__init=function(u,c){return this.bb_pos=u,this.bb=c,this};SQLResponseColumns.getRootAsSQLResponseColumns=function(u,c){return(c||new SQLResponseColumns).__init(u.readInt32(u.position())+u.position(),u)};SQLResponseColumns.prototype.columns=function(u,c){var n=this.bb.__offset(this.bb_pos,4);return n?(c||new SQLResponseColumn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+u*4),this.bb):null};SQLResponseColumns.prototype.columnsLength=function(){var u=this.bb.__offset(this.bb_pos,4);return u?this.bb.__vector_len(this.bb_pos+u):0};SQLResponseColumns.prototype.rowCount=function(){var u=this.bb.__offset(this.bb_pos,6);return u?this.bb.readInt64(this.bb_pos+u):this.bb.createLong(0,0)};SQLResponseColumns.startSQLResponseColumns=function(u){u.startObject(2)};SQLResponseColumns.addColumns=function(u,c){u.addFieldOffset(0,c,0)};SQLResponseColumns.createColumnsVector=function(u,c){u.startVector(4,c.length,4);for(var n=c.length-1;n>=0;n--)u.addOffset(c[n]);return u.endVector()};SQLResponseColumns.startColumnsVector=function(u,c){u.startVector(4,c,4)};SQLResponseColumns.addRowCount=function(u,c){u.addFieldInt64(1,c,u.createLong(0,0))};SQLResponseColumns.endSQLResponseColumns=function(u){var c=u.endObject();return c};SQLResponseColumns.finishSQLResponseColumnsBuffer=function(u,c){u.finish(c)};SQLResponseColumns.createSQLResponseColumns=function(u,c,n){return SQLResponseColumns.startSQLResponseColumns(u),SQLResponseColumns.addColumns(u,c),SQLResponseColumns.addRowCount(u,n),SQLResponseColumns.endSQLResponseColumns(u)};commonjsGlobal.DataType=DataType;commonjsGlobal.DataTypeName=DataTypeName;commonjsGlobal.BytesValue=BytesValue;commonjsGlobal.RLEStringValues=RLEStringValues;commonjsGlobal.ColumnValues=ColumnValues;commonjsGlobal.SQLResponseColumn=SQLResponseColumn;commonjsGlobal.SQLResponseColumns=SQLResponseColumns;var hasRequiredDecoder;function requireDecoder(){if(hasRequiredDecoder)return decoder;hasRequiredDecoder=1;var u=requireCore(),c=tablestore_compiled_proto,n=c.main.proto;c.filter.proto;var o=c.search.proto;const{flatbuffers:t}=require$$2,e=sql_generated.SQLResponseColumns;u.decoder={decode:function(i,l){return r[i](l)},decodeCreateTable:function(i){var l=n.CreateTableResponse.decode(i);return l},decodeListTable:function(i){var l=n.ListTableResponse.decode(i);return l},decodeDeleteTable:function(i){var l=n.DeleteTableResponse.decode(i);return l},decodeUpdateTable:function(i){var l=n.UpdateTableResponse.decode(i);return l},decodeDescribeTable:function(i){var l=n.DescribeTableResponse.decode(i);for(var a in l.indexMetas){var f=l.indexMetas[a];f.indexSyncPhase===n.IndexSyncPhase.ISP_INCR?l.indexMetas[a].indexSyncPhase=u.SyncPhase.INCR:l.indexMetas[a].indexSyncPhase=u.SyncPhase.FULL}return l},_parseRowItem:function(i){if(i.limit=i.offset+i.length,i&&i.limit>i.offset){var l=new u.PlainBufferInputStream(i),a=new u.PlainBufferCodedInputStream(l);i=a.readRow()}else i={};return i},decodeGetRow:function(i){return u.decoder._decodeRowResponse(i,n.GetRowResponse)},decodePutRow:function(i){return u.decoder._decodeRowResponse(i,n.PutRowResponse)},decodeUpdateRow:function(i){return u.decoder._decodeRowResponse(i,n.UpdateRowResponse)},decodeDeleteRow:function(i){return u.decoder._decodeRowResponse(i,n.DeleteRowResponse)},_decodeRowResponse:function(i,l){var a={},f=l.decode(i);return a.consumed=f.consumed,a.row=u.decoder._parseRowItem(f.row),a},decodeGetRange:function(i){var l={},a=n.GetRangeResponse.decode(i);if(l.consumed=a.consumed,a.rows.limit=a.rows.offset+a.rows.length,a.rows&&a.rows.limit>a.rows.offset){var f=new u.PlainBufferInputStream(a.rows),s=new u.PlainBufferCodedInputStream(f);l.rows=s.readRows()}else l.rows=[];if(a.nextStartPrimaryKey&&a.nextStartPrimaryKey.length>0){var d=new u.PlainBufferInputStream(a.nextStartPrimaryKey),O=new u.PlainBufferCodedInputStream(d),b=O.readRow();l.nextStartPrimaryKey=b.primaryKey}else l.nextStartPrimaryKey=null;return l.compressType=a.compressType,l.dataBlockType=a.dataBlockType,l.nextToken=a.nextToken,l},decodeBatchGetRow:function(i){var l=n.BatchGetRowResponse.decode(i);return{tables:u.decoder._parseBatchGetRow(l.tables)}},_parseBatchGetRow:function(i){var l=[];for(var a in i)l.push(u.decoder._parseBatchGetRowItem(i[a].rows,i[a].tableName));return l},_parseBatchGetRowItem:function(i,l){var a=[];for(var f in i){var s=null,d=null,O=null,b=null;if(i[f].isOk){if(i[f].row&&i[f].row.length!=0){var w=new u.PlainBufferInputStream(i[f].row),g=new u.PlainBufferCodedInputStream(w),B=g.readRow();s=B.primaryKey,d=B.attributes}}else O=i[f].error.code,b=i[f].error.message;var A={isOk:i[f].isOk,errorCode:O,errorMessage:b,tableName:l,capacityUnit:i[f].consumed==null?"":i[f].consumed.capacityUnit,primaryKey:s,attributes:d};a.push(A)}return a},decodeBatchWriteRow:function(i){var l=n.BatchWriteRowResponse.decode(i);return l.tables=u.decoder._parseBatchWriteRow(l.tables),l},_parseBatchWriteRow:function(i){var l=[];for(var a in i){var f=i[a].tableName;for(var s in i[a].rows){var s=u.decoder._parseWriteRowItem(i[a].rows[s],f);l.push(s)}}return l},_parseWriteRowItem:function(i,l){var a=null,f=null,s=null,d=null;if(i.isOk){if(i.row!=null&&i.row.length!=0){var O=new u.PlainBufferInputStream(i.row),b=new u.PlainBufferCodedInputStream(O),w=b.readRow();a=w.primaryKey,f=w.attributes}}else s=i.error.code,d=i.error.message;var g={isOk:i.isOk,errorCode:s,errorMessage:d,tableName:l,capacityUnit:i.consumed==null?"":i.consumed.capacityUnit,primaryKey:a,attributes:f};return g},decodeListSearchIndex:function(i){return o.ListSearchIndexResponse.decode(i)},_parseSingleWordAnalyzerParameter:function(i){return o.SingleWordAnalyzerParameter.decode(i)},_parseSplitAnalyzerParameter:function(i){return o.SplitAnalyzerParameter.decode(i)},_parseFuzzyAnalyzerParameter:function(i){return o.FuzzyAnalyzerParameter.decode(i)},decodeDescribeSearchIndex:function(i){const l=o.DescribeSearchIndexResponse.decode(i);for(let a of l.schema.fieldSchemas)a.analyzer&&(a.analyzer==="single_word"&&(a.analyzerParameter=u.decoder._parseSingleWordAnalyzerParameter(a.analyzerParameter)),a.analyzer==="split"&&(a.analyzerParameter=u.decoder._parseSplitAnalyzerParameter(a.analyzerParameter)),a.analyzer==="fuzzy"&&(a.analyzerParameter=u.decoder._parseFuzzyAnalyzerParameter(a.analyzerParameter)));return l.indexStatus=u.decoder._parseIndexStatus(l.indexStatus),l},_parseIndexStatus:function(i){var l={statusDescription:i.statusDescription};switch(i.status){case o.IndexStatusEnum.PENDING:{l.status=u.IndexStatus.PENDING;break}case o.IndexStatusEnum.FAILED:{l.status=u.IndexStatus.FAILED;break}case o.IndexStatusEnum.RUNNING:{l.status=u.IndexStatus.RUNNING;break}default:l.status=u.IndexStatus.UNKNOWN}return l},decodeUpdateSearchIndex:function(i){return o.UpdateSearchIndexResponse.decode(i)},decodeCreateSearchIndex:function(i){var l=o.CreateSearchIndexResponse.decode(i);return l},decodeDeleteSearchIndex:function(i){var l=o.DeleteSearchIndexResponse.decode(i);return l},decodeSearch:function(i){var l=o.SearchResponse.decode(i),a={},f=l.totalHits.toString();f!="-1"&&(a.totalCounts=f),a.isAllSucceeded=l.isAllSucceeded,a.nextToken=l.nextToken;var s=[];if(u.util.arrayEach(l.rows,function(d){var O=new u.PlainBufferInputStream(d),b=new u.PlainBufferCodedInputStream(O),w=b.readRow();s.push(w)}),a.rows=s,l.aggs&&l.aggs.length>0&&(a.aggs=u.decoder._parseAggs(l.aggs)),l.groupBys&&l.groupBys.length>0&&(a.groupBys=u.decoder._parseGroupBys(l.groupBys)),a.searchHits=[],l.rows.length!==l.searchHits.length&&l.searchHits.length!==0)console.log("the row count is not equal to search extra result item count in server response body, ignore the search extra result items.");else for(let d in l.searchHits)a.searchHits.push(u.decoder._parseSearchHit(l.searchHits[d],s[d]));return l.consumed&&(a.consumed=l.consumed),l.reservedConsumed&&(a.reservedConsumed=l.reservedConsumed),a},_parseSearchHit(i,l){var a={row:l};i.nestedDocOffset&&(a.nestedDocOffset=i.nestedDocOffset),i.score&&(a.score=i.score),i.highlightResult&&(a.highlightResultItem=u.decoder._parseHighlightResultItem(i)),a.searchInnerHits=new Map;for(var f in i.searchInnerHits){var s=i.searchInnerHits[f];a.searchInnerHits.set(s.path,u.decoder._parseSearchInnerHit(s))}return a},_parseSearchInnerHit(i){var l={path:i.path};l.subSearchHits=[];for(var a in i.searchHits)l.subSearchHits.push(this._parseSearchHit(i.searchHits[a],null));return l},_parseHighlightResultItem(i){var l=new Map;for(var a in i.highlightResult.highlightFields){var f={fragments:i.highlightResult.highlightFields[a].fieldFragments};l.set(i.highlightResult.highlightFields[a].fieldName,f)}var s={highlightFields:l};return s},_parseSearchVariant(i){let l=new u.PlainBufferInputStream(i);return new u.PlainBufferCodedInputStream(l).readSearchVariant()},decodeComputeSplits:function(i){return o.ComputeSplitsResponse.decode(i)},_parseRows(i){let l=[];return u.util.arrayEach(i,function(a){let f=new u.PlainBufferInputStream(a),d=new u.PlainBufferCodedInputStream(f).readRow();l.push(d)}),l},_parseSQLRows(i){let l=new u.PlainBufferInputStream(i);return new u.PlainBufferCodedInputStream(l).readRows()},decodeParallelScan:function(i){let l=o.ParallelScanResponse.decode(i),a={};return a.nextToken=l.nextToken,a.rows=u.decoder._parseRows(l.rows),a},_parseAggs(i){let l=[],a=u.decoder._isBuffer(i)?o.AggregationsResult.decode(i):i;return u.util.arrayEach(a.aggResults,function(f){let s=u.decoder._parseAgg(f);l.push(s)}),{aggResults:l}},_isBuffer:function(i){return i&&typeof i=="object"&&Buffer.isBuffer(i)},_parseAgg(i){return{name:i.name,type:i.type,aggResult:u.decoder._parseAggResult(i.type,i.aggResult)}},_parseAggResult(i,l){switch(i){case o.AggregationType.AGG_AVG:return o.AvgAggregationResult.decode(l);case o.AggregationType.AGG_MAX:return o.MaxAggregationResult.decode(l);case o.AggregationType.AGG_MIN:return o.MinAggregationResult.decode(l);case o.AggregationType.AGG_SUM:return o.SumAggregationResult.decode(l);case o.AggregationType.AGG_COUNT:return o.CountAggregationResult.decode(l);case o.AggregationType.AGG_DISTINCT_COUNT:return o.DistinctCountAggregationResult.decode(l);case o.AggregationType.AGG_TOP_ROWS:{let a=o.TopRowsAggregationResult.decode(l);return{rows:u.decoder._parseRows(a.rows)}}case o.AggregationType.AGG_PERCENTILES:{let a=o.PercentilesAggregationResult.decode(l),f=[];for(let s of a.percentilesAggregationItems)f.push({item:{key:s.key,value:u.decoder._parseSearchVariant(s.value)}});return{items:f}}default:throw new Error("not exist AggregationType: "+i)}},_parseGroupBys(i){let l=[],a=u.decoder._isBuffer(i)?o.GroupBysResult.decode(i):i;return u.util.arrayEach(a.groupByResults,function(f){let s=u.decoder._parseGroupBy(f);l.push(s)}),{groupByResults:l}},_parseGroupBy(i){return{name:i.name,type:i.type,groupByResult:u.decoder._parseGroupByResult(i.type,i.groupByResult)}},_parseSubAggAndGroupByResult(i,l){l.subAggsResult&&(i.subAggsResult=u.decoder._parseAggs(l.subAggsResult)),l.subGroupBysResult&&(i.subGroupBysResult=u.decoder._parseGroupBys(l.subGroupBysResult))},_parseGroupByResult(i,l){switch(i){case o.GroupByType.GROUP_BY_FIELD:{let a=o.GroupByFieldResult.decode(l),f=[];return u.util.arrayEach(a.groupByFieldResultItems,function(s){let d={key:s.key,rowCount:s.rowCount};u.decoder._parseSubAggAndGroupByResult(d,s),f.push(d)}),{items:f}}case o.GroupByType.GROUP_BY_RANGE:{let a=o.GroupByRangeResult.decode(l),f=[];return u.util.arrayEach(a.groupByRangeResultItems,function(s){let d={from:s.from,to:s.to,rowCount:s.rowCount};u.decoder._parseSubAggAndGroupByResult(d,s),f.push(d)}),{items:f}}case o.GroupByType.GROUP_BY_FILTER:{let a=o.GroupByFilterResult.decode(l),f=[];return u.util.arrayEach(a.groupByFilterResultItems,function(s){let d={rowCount:s.rowCount};u.decoder._parseSubAggAndGroupByResult(d,s),f.push(d)}),{items:f}}case o.GroupByType.GROUP_BY_GEO_DISTANCE:{let a=o.GroupByGeoDistanceResult.decode(l),f=[];return u.util.arrayEach(a.groupByGeoDistanceResultItems,function(s){let d={from:s.from,to:s.to,rowCount:s.rowCount};u.decoder._parseSubAggAndGroupByResult(d,s),f.push(d)}),{items:f}}case o.GroupByType.GROUP_BY_HISTOGRAM:{let a=o.GroupByHistogramResult.decode(l),f=[];return u.util.arrayEach(a.groupByHistogramItems,function(s){let d={key:u.decoder._parseSearchVariant(s.key),value:s.value};u.decoder._parseSubAggAndGroupByResult(d,s),f.push(d)}),{items:f}}case o.GroupByType.GROUP_BY_DATE_HISTOGRAM:{let a=o.GroupByDateHistogramResult.decode(l),f=[];return u.util.arrayEach(a.groupByDateHistogramItems,function(s){let d={timeStamp:s.timestamp,rowCount:s.rowCount};u.decoder._parseSubAggAndGroupByResult(d,s),f.push(d)}),{items:f}}case o.GroupByType.GROUP_BY_GEO_GRID:{let a=o.GroupByGeoGridResult.decode(l),f=[];return u.util.arrayEach(a.groupByGeoGridResultItems,function(s){let d={key:s.key,rowCount:s.rowCount,geoGrid:s.geoGrid};u.decoder._parseSubAggAndGroupByResult(d,s),f.push(d)}),{items:f}}case o.GroupByType.GROUP_BY_COMPOSITE:{let a=o.GroupByCompositeResult.decode(l),f=[];return u.util.arrayEach(a.groupByCompositeResultItems,function(s){let d={keys:s.keys,rowCount:s.rowCount};u.decoder._parseSubAggAndGroupByResult(d,s),f.push(d)}),{sourceNames:a.sourceGroupByNames,nextToken:a.nextToken||null,items:f}}default:throw new Error("not exist groupByType: "+i)}},decodeCreateIndex:function(i){var l=o.CreateSearchIndexResponse.decode(i);return l},decodeDropIndex:function(i){var l=o.DeleteSearchIndexResponse.decode(i);return l},decodeStartLocalTransaction:function(i){var l=n.StartLocalTransactionResponse.decode(i);return l.transactionId=l.transactionId,l},decodeCommitTransaction:function(i){var l=n.CommitTransactionResponse.decode(i);return l},decodeAbortTransaction:function(i){var l=n.AbortTransactionRequest.decode(i);return l},decodeSQLQuery:function(i){const l=n.SQLQueryResponse.decode(i),a={};if(l.consumes&&(a.consumes=l.consumes),l.version&&(a.version=l.version),l.rows)switch(l.version){case n.SQLPayloadVersion.SQL_FLAT_BUFFERS:{let f=new t.ByteBuffer(l.rows),s=e.getRootAsSQLResponseColumns(f);a.sqlRows=new u.SQLRows(s);break}default:throw new Error("not exist SQLPayloadVersion: "+l.version)}return l.type&&(a.type=l.type),a}};var r={createTable:u.decoder.decodeCreateTable,listTable:u.decoder.decodeListTable,deleteTable:u.decoder.decodeDeleteTable,updateTable:u.decoder.decodeUpdateTable,describeTable:u.decoder.decodeDescribeTable,getRow:u.decoder.decodeGetRow,putRow:u.decoder.decodePutRow,updateRow:u.decoder.decodeUpdateRow,deleteRow:u.decoder.decodeDeleteRow,getRange:u.decoder.decodeGetRange,batchGetRow:u.decoder.decodeBatchGetRow,batchWriteRow:u.decoder.decodeBatchWriteRow,listSearchIndex:u.decoder.decodeListSearchIndex,describeSearchIndex:u.decoder.decodeDescribeSearchIndex,updateSearchIndex:u.decoder.decodeUpdateSearchIndex,createSearchIndex:u.decoder.decodeCreateSearchIndex,deleteSearchIndex:u.decoder.decodeDeleteSearchIndex,search:u.decoder.decodeSearch,computeSplits:u.decoder.decodeComputeSplits,parallelScan:u.decoder.decodeParallelScan,createIndex:u.decoder.decodeCreateIndex,dropIndex:u.decoder.decodeDropIndex,startLocalTransaction:u.decoder.decodeStartLocalTransaction,commitTransaction:u.decoder.decodeCommitTransaction,abortTransaction:u.decoder.decodeAbortTransaction,SQLQuery:u.decoder.decodeSQLQuery};return decoder}var config={},hasRequiredConfig;function requireConfig(){if(hasRequiredConfig)return config;hasRequiredConfig=1;var u=requireCore();return u.Config=u.util.inherit({constructor:function(n){n===void 0&&(n={}),u.util.each.call(this,this.keys,function(o,t){var e=n[o];typeof n[o]=="string"&&(e=n[o].replace(/^\s+/g,"")),this.set(o,e,t)})},clear:function(){u.util.each.call(this,this.keys,function(n){delete this[n]}),this.set("credentials",void 0),this.set("credentialProvider",void 0)},getCredentials:function(){return{accessKeyId:this.accessKeyId,secretAccessKey:this.secretAccessKey||this.accessKeySecret,securityToken:this.stsToken||this.securityToken}},set:function(n,o,t){o===void 0?(t===void 0&&(t=this.keys[n]),typeof t=="function"?this[n]=t.call(this):this[n]=t):this[n]=o},keys:{accessKeyId:null,secretAccessKey:null,accessKeySecret:null,stsToken:null,securityToken:null,logger:null,endpoint:void 0,httpOptions:{},maxRetries:void 0,instancename:void 0,computeChecksums:!0}}),config}var http={},hasRequiredHttp;function requireHttp(){if(hasRequiredHttp)return http;hasRequiredHttp=1;var u=requireCore(),c=u.util.inherit;return u.Endpoint=c({constructor:function(o){if(u.util.hideProperties(this,["slashes","auth","hash","search","query"]),typeof o>"u"||o===null)throw new Error("Invalid endpoint: "+o);if(!o.match(/^http/))throw new Error("错误的 endpoint 格式, 需要以 http 或者 https 开头");u.util.update(this,u.util.urlParse(o)),this.port?this.port=parseInt(this.port,10):this.port=this.protocol==="https:"?443:80}}),u.HttpRequest=c({constructor:function(o,t){this.method="POST",this.path=o.path||"/",this.headers={},this.body="",this.endpoint=o,this.region=t},pathname:function(){return this.path.split("?",1)[0]},search:function(){return this.path.split("?",2)[1]||""},debug:function(){if(process.env.DEBUG=="aliyun"){console.log("-------- HttpRequest Start: --------"),console.log("method:",this.method),console.log("path:",this.path),console.log("headers:");for(var n in this.headers)n!="constructor"&&console.log(n,":",this.headers[n])}}}),u.HttpResponse=c({constructor:function(){this.statusCode=void 0,this.headers={},this.body=void 0}}),u.HttpClient=c({}),u.HttpClient.getInstance=function(){return this.singleton===void 0&&(this.singleton=new this),this.singleton},http}var sequential_executor={},hasRequiredSequential_executor;function requireSequential_executor(){if(hasRequiredSequential_executor)return sequential_executor;hasRequiredSequential_executor=1;var u=requireCore();return u.SequentialExecutor=u.util.inherit({constructor:function(){this._events={}},listeners:function(n){return this._events[n]?this._events[n].slice(0):[]},on:function(n,o){return this._events[n]?this._events[n].push(o):this._events[n]=[o],this},onAsync:function(n,o){return o._isAsync=!0,this.on(n,o)},removeListener:function(n,o){var t=this._events[n];if(t){for(var e=t.length,r=-1,i=0;i<e;++i)t[i]===o&&(r=i);r>-1&&t.splice(r,1)}return this},removeAllListeners:function(n){return n?delete this._events[n]:this._events={},this},emit:async function(n,o,t){t||(t=this.unhandledErrorCallback),process.env.DEBUG=="aliyun"&&console.log("emit",n);var e=this.listeners(n),r=e.length;try{await this.callListeners(e,o,t)}catch(i){t.call(this,i)}return r>0},callListeners:async function(n,o,t){if(n.length===0)t.call(this);else{var e=n.shift();if(e._isAsync)try{await new Promise((r,i)=>{e.apply(this,o.concat([function(l){l?i(l):r()}]))}),await this.callListeners(n,o,t)}catch(r){t.call(this,r)}else try{e.apply(this,o),await this.callListeners(n,o,t)}catch(r){t.call(this,r)}}},addListeners:function(n){var o=this;return n._events&&(n=n._events),u.util.each(n,function(t,e){typeof e=="function"&&(e=[e]),u.util.arrayEach(e,function(r){o.on(t,r)})}),o},addNamedListener:function(n,o,t){return this[n]=t,this.addListener(o,t),this},addNamedAsyncListener:function(n,o,t){return t._isAsync=!0,this.addNamedListener(n,o,t)},addNamedListeners:function(n){var o=this;return n(function(){o.addNamedListener.apply(o,arguments)},function(){o.addNamedAsyncListener.apply(o,arguments)}),this}}),u.SequentialExecutor.prototype.addListener=u.SequentialExecutor.prototype.on,u.SequentialExecutor.prototype.addAsyncListener=u.SequentialExecutor.prototype.onAsync,sequential_executor}var event_listeners={},hasRequiredEvent_listeners;function requireEvent_listeners(){if(hasRequiredEvent_listeners)return event_listeners;hasRequiredEvent_listeners=1;var u=requireCore();return requireSequential_executor(),u.EventListeners={Core:{}},u.EventListeners={Core:new u.SequentialExecutor().addNamedListeners(function(c,n){c("SET_CONTENT_LENGTH","afterBuild",function(t){if(t.httpRequest.headers["Content-Length"]===void 0){var e=u.util.string.byteLength(t.httpRequest.body);t.httpRequest.headers["Content-Length"]=e}}),c("SET_HTTP_HOST","afterBuild",function(t){t.httpRequest.headers.Host=t.httpRequest.endpoint.host}),n("SIGN","sign",function(t,e){var r=t.config.getCredentials();try{var i=u.util.date.getDate(),l=new u.Signer(t.httpRequest);l.addAuthorization(r,i)}catch(a){t.response.error=a}e()}),c("VALIDATE_RESPONSE","validateResponse",function(t){t.httpResponse.statusCode<300?(t.data={},t.error=null):(t.data=null,t.error=u.util.error(new Error,{code:"UnknownError",message:"An unknown error occurred."}))}),n("SEND","send",function(t,e){function r(d){t.httpResponse.stream=d,t.httpResponse._abortCallback=e,d.on("headers",function(b,w){t.request.emit("httpHeaders",[b,w,t]),t.request.httpRequest._streaming||(u.HttpClient.streamsApiVersion===2?d.on("readable",function(){var B=d.read();B!==null&&t.request.emit("httpData",[B,t])}):d.on("data",function(B){t.request.emit("httpData",[B,t])}))}),d.on("end",function(){t.request.emit("httpDone"),e()})}function i(d){d.on("sendProgress",function(b){t.request.emit("httpUploadProgress",[b,t])}),d.on("receiveProgress",function(b){t.request.emit("httpDownloadProgress",[b,t])})}function l(d){t.error=u.util.error(d,{code:"NetworkingError",region:t.request.httpRequest.region,hostname:t.request.httpRequest.endpoint.hostname,retryable:!0}),t.request.emit("httpError",[t.error,t],function(){e()})}t.error=null,t.data=null;var a=u.HttpClient.getInstance(),f=t.request.config.httpOptions||{},s=a.handleRequest(this.httpRequest,f,r,l);i(s)}),c("HTTP_HEADERS","httpHeaders",function(t,e,r){r.httpResponse.statusCode=t,r.httpResponse.headers=e,r.httpResponse.body=new u.util.Buffer(""),r.httpResponse.buffers=[],r.httpResponse.numBytes=0}),c("HTTP_DATA","httpData",function(t,e){if(t){e.httpResponse.numBytes+=t.length;var r=e.httpResponse.headers["content-length"],i={loaded:e.httpResponse.numBytes,total:r};e.request.emit("httpDownloadProgress",[i,e]),e.httpResponse.buffers.push(new u.util.Buffer(t))}}),c("HTTP_DONE","httpDone",function(t){if(t.httpResponse.buffers&&t.httpResponse.buffers.length>0){var e=u.util.buffer.concat(t.httpResponse.buffers);t.httpResponse.body=e}delete t.httpResponse.numBytes,delete t.httpResponse.buffers}),c("RETRY_CHECK","retry",function(t){t.error&&(t.error.retryable=u.DefaultRetryPolicy.shouldRetry(t.retryCount,t.error,t.request.operation))}),n("RESET_RETRY_STATE","afterRetry",function(t,e){var r,i=!1;if(t.error){r=u.DefaultRetryPolicy.getRetryDelay(t.retryCount,t.error);var l=u.DefaultRetryPolicy.maxRetryTimes;t.error.retryable&&t.retryCount<l&&(t.retryCount++,i=!0)}i?(t.error=null,setTimeout(e,r)):e()})}),Logger:new u.SequentialExecutor().addNamedListeners(function(c){c("LOG_REQUEST","complete",function(o){var t=o.request,e=t.config.logger;if(!e)return;function r(){var l=u.util.date.getDate().getTime(),a=(l-t.startTime.getTime())/1e3,f=!!e.isTTY,s=o.httpResponse.statusCode,d=require$$0.inspect(t.params,!0,!0),O="";return f&&(O+="\x1B[33m"),O+="[TableStore "+t.service.serviceIdentifier+" "+s,O+=" "+a.toString()+"s "+o.retryCount+" retries]",f&&(O+="\x1B[0;1m"),O+=" "+t.operation+"("+d+")",f&&(O+="\x1B[0m"),O}var i=r();typeof e.log=="function"?e.log(i):typeof e.write=="function"&&e.write(i+`
2
+ `)})})},event_listeners}var request={},hasRequiredRequest;function requireRequest(){if(hasRequiredRequest)return request;hasRequiredRequest=1;var u=requireCore(),c=u.util.inherit,n={success:1,error:1,complete:1};function o(r){return Object.prototype.hasOwnProperty.call(n,r._asm.currentState)}function t(r,i){this.currentState=i||null,this.states=r||{}}t.prototype.runTo=async function(i,l,a,f){typeof i=="function"&&(f=a,a=l,l=i,i=null);try{var s=this,d=s.states[s.currentState];await d.fn.call(a||s,f,async O=>{if(O)if(a.logger&&a.logger.log(s.currentState,"->",d.fail,O),d.fail)s.currentState=d.fail;else return l?l(O):null;else if(a.logger&&a.logger.log(s.currentState,"->",d.accept),d.accept)s.currentState=d.accept;else return l?l():null;if(s.currentState===i)return l?l(O):null;await s.runTo(i,l,a,O)})}catch(O){l&&l(O)}},t.prototype.addState=function(i,l,a,f){return typeof l=="function"?(f=l,l=null,a=null):typeof a=="function"&&(f=a,a=null),this.currentState||(this.currentState=i),this.states[i]={accept:l,fail:a,fn:f},this};var e=new t;return e.setupStates=function(){var r=async function(l,a){var f=this;f.response.error;try{await f.emit(f._asm.currentState,async s=>{if(s){if(o(f))throw s;f.response.error=s,a(s)}else a(f.response.error)})}catch(s){if(o(f))throw s;f.response.error=s,a(s)}};this.addState("restart","build","error",async function(i,l){if(i=this.response.error,!i)return l();if(i.retryable=u.DefaultRetryPolicy.shouldRetry(this.response.retryCount,this.response.error,this.response.request.operation),!i.retryable)return l(i);this.response.retryCount<u.DefaultRetryPolicy.maxRetryTimes?(this.response.retryCount++,l()):l(i)}),this.addState("build","afterBuild","restart",r),this.addState("afterBuild","sign","restart",r),this.addState("sign","send","retry",r),this.addState("retry","afterRetry","afterRetry",r),this.addState("afterRetry","sign","error",r),this.addState("send","validateResponse","retry",r),this.addState("validateResponse","extractData","extractError",r),this.addState("extractError","extractData","retry",r),this.addState("extractData","success","retry",r),this.addState("success","complete","complete",r),this.addState("error","complete","complete",r),this.addState("complete",null,null,r)},e.setupStates(),u.Request=c({constructor:function(i,l,a){var f=new u.Endpoint(i.endpoint),s=i.region;this.config=i,i.maxRetries!==void 0&&(u.DefaultRetryPolicy.maxRetryTimes=i.maxRetries),this.operation=l,this.params=a||{},this.httpRequest=new u.HttpRequest(f,s),this.startTime=u.util.date.getDate(),this.response=new u.Response(this),this.restartCount=0,this._asm=new t(e.states,"build"),u.SequentialExecutor.call(this),this.emit=this.emitEvent},send:async function(i){return i&&this.on("complete",function(l){i.call(l,l.error,l.data)}),await this.runTo(),this.response},build:async function(i){await this.runTo("send",i)},runTo:async function(i,l){return await this._asm.runTo(i,l,this),this},emitEvent:async function(i,l,a){typeof l=="function"&&(a=l,l=null),a||(a=function(){}),l||(l=this.eventParameters(i,this.response));var f=u.SequentialExecutor.prototype.emit;try{await f.call(this,i,l,async s=>{s&&(this.response.error=s),a.call(this,s)})}catch(s){a&&a(s)}},eventParameters:function(i){switch(i){case"validate":case"sign":case"build":case"afterBuild":return[this];case"error":return[this.response.error,this.response];default:return[this.response]}}}),u.util.mixin(u.Request,u.SequentialExecutor),u.Response=c({constructor:function(i){this.request=i,this.data=null,this.error=null,this.retryCount=0,this.httpResponse=new u.HttpResponse}}),request}var signer,hasRequiredSigner;function requireSigner(){if(hasRequiredSigner)return signer;hasRequiredSigner=1;var u=requireCore(),c=u.util.inherit;return u.Signer=c({constructor:function(o){this.request=o},addAuthorization:function(o,t){this.request.headers["x-ots-date"]=u.util.date.iso8601(t),this.request.headers["x-ots-accesskeyid"]=o.accessKeyId,o.securityToken&&(this.request.headers["x-ots-ststoken"]=o.securityToken),delete this.request.headers["x-ots-signature"];var e=this.sign(o.secretAccessKey,this.stringToSign());this.request.headers["x-ots-signature"]=e},stringToSign:function(){var o=this.request,t=[];t.push(o.path),t.push(o.method+`
3
+ `);var e=this.canonicalizedHeaders();return e&&t.push(e),t.join(`
4
+ `)+`
5
+ `},canonicalizedHeaders:function(){var o=[];u.util.each(this.request.headers,function(e){e.match(/^x-ots-/i)&&o.push(e)}),o.sort(function(e,r){return e.toLowerCase()<r.toLowerCase()?-1:1});var t=[];return u.util.arrayEach.call(this,o,function(e){t.push(e.toLowerCase()+":"+String(this.request.headers[e]))}),t.join(`
6
+ `)},sign:function(o,t){return process.env.DEBUG=="aliyun"&&(console.log("----------- sign string start -----------"),console.log(t),console.log("----------- sign string end -----------")),u.util.crypto.hmac(o,t,"base64","sha1")}}),signer=u.Signer,signer}var node={},hasRequiredNode;function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var u=requireCore(),c=require$$0$1.Stream,n=require$$0$1.Writable,o=require$$0$1.Readable;return requireHttp(),u.NodeHttpClient=u.util.inherit({handleRequest:function(e,r,i,l){var a=e.endpoint,f="";r||(r={});var s=a.protocol==="https:",d=s?require$$3:require$$4$1;r.maxSockets?d.globalAgent.maxSockets=r.maxSockets:d.globalAgent.maxSockets=300;var O={host:a.hostname,port:a.port,method:e.method,headers:e.headers,path:f+e.path};s&&!r.agent&&(O.agent=this.sslAgent()),u.util.update(O,r),delete O.proxy,delete O.timeout,delete O.maxSockets;var b=d.request(O,function(w){i(w),w.emit("headers",w.statusCode,w.headers)});return e.stream=b,b.setTimeout(r.timeout||0),b.once("timeout",function(){var w="Connection timed out after "+r.timeout+"ms";l(u.util.error(new Error(w),{code:"TimeoutError"})),b.removeListener("error",l),b.on("error",function(){}),b.abort()}),b.on("error",l),this.writeBody(b,e),b},writeBody:function(e,r){var i=r.body;i&&n&&o&&(i instanceof c||(i=this.bufferToStream(i)),i.pipe(this.progressStream(e,r))),i instanceof c?i.pipe(e):i?e.end(i):e.end()},sslAgent:function(){var e=require$$3;return u.NodeHttpClient.sslAgent||(u.NodeHttpClient.sslAgent=new e.Agent({rejectUnauthorized:!0}),u.NodeHttpClient.sslAgent.setMaxListeners(0),Object.defineProperty(u.NodeHttpClient.sslAgent,"maxSockets",{enumerable:!0,get:function(){return e.globalAgent.maxSockets}})),u.NodeHttpClient.sslAgent},progressStream:function(e,r){var i=0,l=r.headers["Content-Length"],a=new n;return a._write=function(f,s,d){f&&(i+=f.length,e.emit("sendProgress",{loaded:i,total:l})),d()},a},bufferToStream:function(e){u.util.Buffer.isBuffer(e)||(e=new u.util.Buffer(e));var r=new o,i=0;return r._read=function(l){if(i>=e.length)return r.push(null);var a=i+l;a>e.length&&(a=e.length),r.push(e.slice(i,a)),i=a},r},emitter:null}),u.HttpClient.prototype=u.NodeHttpClient.prototype,u.HttpClient.streamsApiVersion=o?2:1,node}var retry_util={},hasRequiredRetry_util;function requireRetry_util(){if(hasRequiredRetry_util)return retry_util;hasRequiredRetry_util=1;var u=requireCore();return u.RetryUtil={shouldRetryNoMatterWhichApi:function(c){var n=c.code,o=c.message;return n=="OTSRowOperationConflict"||n=="OTSNotEnoughCapacityUnit"||n=="OTSTableNotReady"||n=="OTSPartitionUnavailable"||n=="OTSServerBusy"||n=="OTSOperationThrottled"||n=="OTSQuotaExhausted"&&o=="Too frequent table operations."},isRepeatableApi:function(c){c=u.util.string.upperFirst(c);const n=["ListTable","DescribeTable","GetRow","BatchGetRow","GetRange","DescribeSearchIndex","ListSearchIndex","ComputeSplits","ParallelScan","Search","SQLQuery"];for(const o in n)if(n[o]===c)return!0},shouldRetryWhenApiRepeatable:function(c,n,o){var t=n.code;return n.message,t=="OTSTimeout"||t=="OTSInternalServerError"||t=="OTSServerUnavailable"||t=="NetworkingError"||t==500||t==502||t==503},isServerThrottlingException:function(c){var n=c.code,o=c.message;return n=="OTSServerBusy"||n=="OTSNotEnoughCapacityUnit"||n=="OTSOperationThrottled"||n=="OTSQuotaExhausted"&&o=="Too frequent table operations."}},retry_util}var default_retry_policy={},hasRequiredDefault_retry_policy;function requireDefault_retry_policy(){if(hasRequiredDefault_retry_policy)return default_retry_policy;hasRequiredDefault_retry_policy=1;var u=requireCore();return u.DefaultRetryPolicy={maxRetryTimes:20,maxRetryDelay:3e3,scaleFactor:2,serverThrottlingExceptionDelayFactor:500,stabilityExceptionDelayFactor:200,_maxRetryTimeReached:function(c,n,o){return c>=u.DefaultRetryPolicy.maxRetryTimes},isRepeatableApi:function(c){return u.RetryUtil.isRepeatableApi(c)},_canRetry:function(c,n,o){return!!(u.RetryUtil.shouldRetryNoMatterWhichApi(n)||u.DefaultRetryPolicy.isRepeatableApi(o)&&u.RetryUtil.shouldRetryWhenApiRepeatable(c,n,o))},getRetryDelay:function(c,n){var o;u.RetryUtil.isServerThrottlingException(n)?o=u.DefaultRetryPolicy.serverThrottlingExceptionDelayFactor:o=u.DefaultRetryPolicy.stabilityExceptionDelayFactor;var t=o*Math.pow(u.DefaultRetryPolicy.scaleFactor,c);t>=u.DefaultRetryPolicy.maxRetryDelay&&(t=u.DefaultRetryPolicy.maxRetryDelay);var e=t*.5+t*.5*Math.random();return e},shouldRetry:function(c,n,o){return u.DefaultRetryPolicy._maxRetryTimeReached(c,n,o)?!1:!!u.DefaultRetryPolicy._canRetry(c,n,o)}},default_retry_policy}var client={},hasRequiredClient;function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1;var u=requireCore(),c=u.util.inherit;return u.Client=c({constructor:function(n){this.config=new u.Config(n)},setupRequestListeners:function(n){n.addListener("build",this.populateHeader),n.addListener("build",this.populateURI),n.addListener("build",this.buildContent),n.addListener("build",this.computeContentMd5),n.addListener("extractError",this.extractError),n.addListener("extractData",this.extractData)},populateURI:function(n){var o=n.httpRequest;o.endpoint.host=o.endpoint.hostname,o.path="/"+u.util.string.upperFirst(n.operation)},populateHeader:function(n){var o=n.httpRequest;o.headers["x-ots-apiversion"]="2015-12-31",o.headers["x-ots-instancename"]=n.config.instancename},buildContent:function(n){var o=u.encoder.encode(n.operation,n.params),t=Object.getPrototypeOf(o).constructor.encode(o);n.httpRequest.body=t.finish()},computeContentMd5:function(n){var o=u.util.crypto.md5(n.httpRequest.body,"base64");n.httpRequest.headers["x-ots-contentmd5"]=o},extractData:function(n){n.data=u.decoder.decode(n.request.operation,n.httpResponse.body),n.data.RequestId=n.httpResponse.headers["x-ots-request-id"]||n.httpResponse.headers["x-ots-requestid"]},extractError:function(n){var o={304:"NotModified",403:"Forbidden",400:"BadRequest",404:"NotFound"},t=n.httpResponse.statusCode,e=n.httpResponse.body;let r=n.httpResponse.headers["x-ots-request-id"]||n.httpResponse.headers["x-ots-requestid"]||"";if(o[t]&&e.length===0)n.error=u.util.error(new Error,{code:o[n.httpResponse.statusCode],message:r,headers:n.httpResponse.headers});else{var i;try{i=new u.XML.Parser({}).parse(e.toString()),n.error=u.util.error(new Error,{code:i.Code||t,message:i.Message||r,headers:n.httpResponse.headers})}catch{i=e.toString()+" requestId:"+r,n.error=u.util.error(new Error,{code:t,message:i,headers:n.httpResponse.headers})}}},makeRequest:function(n,o,t){typeof o=="function"&&(t=o,o=null);var e=new u.Request(this.config,n,o);return this.addAllRequestListeners(e),t?(e.send(t),e):new Promise(function(r,i){e.send(function(l,a){if(l)return i(l);r(a)})})},addAllRequestListeners:function(n){for(var o=[u.events,u.EventListeners.Core],t=0;t<o.length;t++)o[t]&&n.addListeners(o[t]);this.config.logger&&n.addListeners(u.EventListeners.Logger),this.setupRequestListeners(n)},createTable:function(n,o){return this.makeRequest("createTable",n,o)},listTable:function(n,o){return this.makeRequest("listTable",n,o)},deleteTable:function(n,o){return this.makeRequest("deleteTable",n,o)},updateTable:function(n,o){return this.makeRequest("updateTable",n,o)},describeTable:function(n,o){return this.makeRequest("describeTable",n,o)},getRow:function(n,o){return this.makeRequest("getRow",n,o)},putRow:function(n,o){return this.makeRequest("putRow",n,o)},updateRow:function(n,o){return this.makeRequest("updateRow",n,o)},deleteRow:function(n,o){return this.makeRequest("deleteRow",n,o)},getRange:function(n,o){return this.makeRequest("getRange",n,o)},batchGetRow:function(n,o){return this.makeRequest("batchGetRow",n,o)},batchWriteRow:function(n,o){return this.makeRequest("batchWriteRow",n,o)},listSearchIndex:function(n,o){return this.makeRequest("listSearchIndex",n,o)},describeSearchIndex:function(n,o){return this.makeRequest("describeSearchIndex",n,o)},updateSearchIndex:function(n,o){return this.makeRequest("updateSearchIndex",n,o)},createSearchIndex:function(n,o){return this.makeRequest("createSearchIndex",n,o)},deleteSearchIndex:function(n,o){return this.makeRequest("deleteSearchIndex",n,o)},search:function(n,o){return this.makeRequest("search",n,o)},computeSplits:function(n,o){return this.makeRequest("computeSplits",n,o)},parallelScan:function(n,o){return this.makeRequest("parallelScan",n,o)},createIndex:function(n,o){return this.makeRequest("createIndex",n,o)},dropIndex:function(n,o){return this.makeRequest("dropIndex",n,o)},startLocalTransaction:function(n,o){return this.makeRequest("startLocalTransaction",n,o)},commitTransaction:function(n,o){return this.makeRequest("commitTransaction",n,o)},abortTransaction:function(n,o){return this.makeRequest("abortTransaction",n,o)},sqlQuery:function(n,o){return this.makeRequest("SQLQuery",n,o)}}),client}var search={},hasRequiredSearch;function requireSearch(){if(hasRequiredSearch)return search;hasRequiredSearch=1;var u=requireCore();return u.util.inherit,u.QueryType={MATCH_QUERY:1,MATCH_PHRASE_QUERY:2,TERM_QUERY:3,RANGE_QUERY:4,PREFIX_QUERY:5,BOOL_QUERY:6,CONST_SCORE_QUERY:7,FUNCTION_SCORE_QUERY:8,NESTED_QUERY:9,WILDCARD_QUERY:10,MATCH_ALL_QUERY:11,GEO_BOUNDING_BOX_QUERY:12,GEO_DISTANCE_QUERY:13,GEO_POLYGON_QUERY:14,TERMS_QUERY:15,EXISTS_QUERY:16,KNN_VECTOR_QUERY:17,FUNCTIONS_SCORE_QUERY:18},u.ScoreMode={SCORE_MODE_NONE:1,SCORE_MODE_AVG:2,SCORE_MODE_MAX:3,SCORE_MODE_TOTAL:4,SCORE_MODE_MIN:5},u.SortOrder={SORT_ORDER_ASC:0,SORT_ORDER_DESC:1},u.SortMode={SORT_MODE_MIN:0,SORT_MODE_MAX:1,SORT_MODE_AVG:2},u.FieldType={LONG:1,DOUBLE:2,BOOLEAN:3,KEYWORD:4,TEXT:5,NESTED:6,GEO_POINT:7,DATE:8,VECTOR:9},u.ColumnReturnType={RETURN_ALL:1,RETURN_SPECIFIED:2,RETURN_NONE:3,RETURN_ALL_FROM_INDEX:4},u.GeoDistanceType={GEO_DISTANCE_ARC:0,GEO_DISTANCE_PLANE:1},u.IndexOptions={DOCS:1,FREQS:2,POSITIONS:3,OFFSETS:4},u.QueryOperator={OR:1,AND:2},u.AggregationType={AGG_AVG:1,AGG_MAX:2,AGG_MIN:3,AGG_SUM:4,AGG_COUNT:5,AGG_DISTINCT_COUNT:6,AGG_TOP_ROWS:7,AGG_PERCENTILES:8},u.GroupByType={GROUP_BY_FIELD:1,GROUP_BY_RANGE:2,GROUP_BY_FILTER:3,GROUP_BY_GEO_DISTANCE:4,GROUP_BY_HISTOGRAM:5,GROUP_BY_DATE_HISTOGRAM:6,GROUP_BY_GEO_GRID:7,GROUP_BY_COMPOSITE:8},u.DateTimeUnit={YEAR:1,QUARTER_YEAR:2,MONTH:3,WEEK:4,DAY:5,HOUR:6,MINUTE:7,SECOND:8,MILLISECOND:9},u.GeoHashPrecision={GHP_5009KM_4992KM_1:1,GHP_1252KM_624KM_2:2,GHP_156KM_156KM_3:3,GHP_39KM_19KM_4:4,GHP_4900M_4900M_5:5,GHP_1200M_609M_6:6,GHP_152M_152M_7:7,GHP_38M_19M_8:8,GHP_480CM_480CM_9:9,GHP_120CM_595MM_10:10,GHP_149MM_149MM_11:11,GHP_37MM_19MM_12:12},u.FSMScoreMode={FSM_AVG:1,FSM_MAX:2,FSM_SUM:3,FSM_MIN:4,FSM_MULTIPLY:5,FSM_FIRST:6},u.FSMCombineMode={FCM_MULTIPLY:1,FCM_AVG:2,FCM_MAX:3,FCM_SUM:4,FCM_MIN:5,FCM_REPLACE:6},u.MathFunction={GAUSS:1,EXP:2,LINEAR:3},u.MultiValueMode={MVM_MAX:1,MVM_MIN:2,MVM_SUM:3,MVM_AVG:4},u.DecayFuncParamType={DF_DATE_PARAM:1,DF_NUMERIC_PARAM:2,DF_GEO_PARAM:3},u.FunctionModifier={FM_NONE:1,FM_LOG:2,FM_LOG1P:3,FM_LOG2P:4,FM_LN:5,FM_LN1P:6,FM_LN2P:7,FM_SQUARE:8,FM_SQRT:9,FM_RECIPROCAL:10},u.VectorDataType={VD_FLOAT_32:2},u.VectorMetricType={VM_EUCLIDEAN:0,VM_COSINE:1,VM_DOT_PRODUCT:2},u.HighlightFragmentOrder={TEXT_SEQUENCE:1,SCORE:2},u.HighlightEncoder={PLAIN_MODE:1,HTML_MODE:2},u.IndexStatus={PENDING:"pending",FAILED:"failed",RUNNING:"running",UNKNOWN:"unknown"},u.SyncPhase={INCR:"INCR",FULL:"FULL"},search}var sql={},hasRequiredSql;function requireSql(){if(hasRequiredSql)return sql;hasRequiredSql=1;const u=requireCore(),{DataType:c,DataTypeName:n}=sql_generated;return u.SQLPayloadVersion={SQL_FLAT_BUFFERS:2},u.SQLStatementType={SQL_SELECT:1,SQL_CREATE_TABLE:2,SQL_SHOW_TABLE:3,SQL_DESCRIBE_TABLE:4,SQL_DROP_TABLE:5,SQL_ALTER_TABLE:6},u.SQLDataType=c,u.SQLDataTypeName=n,u.SQLRows=function(o){this.rowCount=o.rowCount(),this.columnCount=o.columnsLength(),this._columnNames=[],this._columnTypes=[],this._columnTypeNames=[],this._columnValues=[],this._rleStringValues=[];for(let t=0;t<o.columnsLength();t++){let e=o.columns(t);this._columnNames[t]=e.columnName(),this._columnTypes[t]=e.columnType(),this._columnTypeNames[t]=u.SQLDataTypeName[e.columnType()],this._columnValues[t]=e.columnValue(),this._rleStringValues[t]=this._columnValues[t].rleStringValues()}this.get=function(t,e){if(t>=this.rowCount||t<0)throw new Error("Row index "+e+" out of range");if(e>=this.columnCount||e<0)throw new Error("Column index "+e+" out of range");let r=this._columnTypes[e],i=this._columnValues[e];switch(r){case u.SQLDataType.LONG:return i.isNullvalues(t)?null:i.longValues(t);case u.SQLDataType.BOOLEAN:return i.isNullvalues(t)?null:i.boolValues(t);case u.SQLDataType.DOUBLE:return i.isNullvalues(t)?null:i.doubleValues(t);case u.SQLDataType.STRING:return i.isNullvalues(t)?null:i.stringValues(t);case u.SQLDataType.BINARY:return i.isNullvalues(t)?null:i.binaryValues(t);case u.SQLDataType.STRING_RLE:if(i.isNullvalues(t))return null;{let l=this._rleStringValues[e];return this._resolveRLEString(l,t)}default:throw new Error("not supported column type in flatBuffers: "+r)}},this._resolveRLEString=function(t,e){return t.array(t.indexMapping(e))},this._resolveSQLTableMetaFromColumns=function(){let t=[],e={};for(let r=0;r<this.columnCount;r++){let i={name:this._columnNames[r],type:this._columnTypes[r],typeName:this._columnTypeNames[r]};t.push(i),e[this._columnNames[r]]=r}return{schemas:t,columnsMap:e}},this.sqlTableMeta=this._resolveSQLTableMetaFromColumns()},sql}var core,hasRequiredCore;function requireCore(){if(hasRequiredCore)return core;hasRequiredCore=1;var u={};return core=u,requireUtil(),requireMetadata(),requireLong(),requirePlain_buffer_consts(),requirePlain_buffer_crc8(),requirePlain_buffer_stream(),requirePlain_buffer_coded_stream(),requirePlian_buffer_builder(),requireFilter(),requireEncoder(),requireDecoder(),requireMetadata(),requireConfig(),requireHttp(),requireSequential_executor(),requireEvent_listeners(),requireRequest(),requireSigner(),u.events=new u.SequentialExecutor,requireNode(),requireRetry_util(),requireDefault_retry_policy(),requireClient(),requireSearch(),requireSql(),core}var TableStore$1=requireCore(),tablestore=TableStore$1;const TableStore=getDefaultExportFromCjs(tablestore);var UNDEFINED="undefined",BUFFER=UNDEFINED!==typeof Buffer&&Buffer,UINT8ARRAY=UNDEFINED!==typeof Uint8Array&&Uint8Array,ARRAYBUFFER=UNDEFINED!==typeof ArrayBuffer&&ArrayBuffer,ZERO=[0,0,0,0,0,0,0,0],isArray=Array.isArray||_isArray,BIT32=4294967296,BIT24=16777216,storage;const Int64LE=factory("Int64LE",!1,!1);function factory(u,c,n){var o=c?0:4,t=c?4:0,e=c?0:3,r=c?1:2,i=c?2:1,l=c?3:0,a=c?fromPositiveBE:fromPositiveLE,f=c?fromNegativeBE:fromNegativeLE,s=b.prototype,d="is"+u,O="_"+d;return s.buffer=void 0,s.offset=0,s[O]=!0,s.toNumber=A,s.toString=C,s.toJSON=A,s.toArray=toArray,BUFFER&&(s.toBuffer=toBuffer),UINT8ARRAY&&(s.toArrayBuffer=toArrayBuffer),b[d]=w,b;function b(S,y,h,m){return this instanceof b?g(this,S,y,h,m):new b(S,y,h,m)}function w(S){return!!(S&&S[O])}function g(S,y,h,m,p){if(UINT8ARRAY&&ARRAYBUFFER&&(y instanceof ARRAYBUFFER&&(y=new UINT8ARRAY(y)),m instanceof ARRAYBUFFER&&(m=new UINT8ARRAY(m))),!y&&!h&&!m&&!storage){S.buffer=newArray(ZERO,0);return}if(!isValidBuffer(y,h)){var x=storage||Array;p=h,m=y,h=0,y=storage===BUFFER?BUFFER.alloc(8):new x(8)}S.buffer=y,S.offset=h|=0,UNDEFINED!==typeof m&&(typeof m=="string"?B(y,h,m,p||10):isValidBuffer(m,p)?fromArray(y,h,m,p):typeof p=="number"?(E(y,h+o,m),E(y,h+t,p)):m>0?a(y,h,m):m<0?f(y,h,m):fromArray(y,h,ZERO,0))}function B(S,y,h,m){var p=0,x=h.length,v=0,P=0;h[0]==="-"&&p++;for(var M=p;p<x;){var F=parseInt(h[p++],m);if(!(F>=0))break;P=P*m+F,v=v*m+Math.floor(P/BIT32),P%=BIT32}M&&(v=~v,P?P=BIT32-P:v++),E(S,y+o,v),E(S,y+t,P)}function A(){var S=this.buffer,y=this.offset,h=_(S,y+o),m=_(S,y+t);return n||(h|=0),h?h*BIT32+m:m}function C(S){var y=this.buffer,h=this.offset,m=_(y,h+o),p=_(y,h+t),x="",v=!n&&m&2147483648;for(v&&(m=~m,p=BIT32-p),S=S||10;;){var P=m%S*BIT32+p;if(m=Math.floor(m/S),p=Math.floor(P/S),x=(P%S).toString(S)+x,!m&&!p)break}return v&&(x="-"+x),x}function E(S,y,h){S[y+l]=h&255,h=h>>8,S[y+i]=h&255,h=h>>8,S[y+r]=h&255,h=h>>8,S[y+e]=h&255}function _(S,y){return S[y+e]*BIT24+(S[y+r]<<16)+(S[y+i]<<8)+S[y+l]}}function toArray(u){var c=this.buffer,n=this.offset;return storage=null,u!==!1&&isArray(c)?c.length===8?c:c.slice(n,n+8):newArray(c,n)}function toBuffer(u){var c=this.buffer,n=this.offset;return storage=BUFFER,u!==!1&&BUFFER.isBuffer(c)?c.length===8?c:c.slice(n,n+8):BUFFER.from(toArrayBuffer.call(this,u))}function toArrayBuffer(u){var c=this.buffer,n=this.offset,o=c.buffer;if(storage=UINT8ARRAY,u!==!1&&!c.offset&&o instanceof ARRAYBUFFER)return o.byteLength===8?o:o.slice(n,n+8);var t=new UINT8ARRAY(8);return fromArray(t,0,c,n),t.buffer}function isValidBuffer(u,c){var n=u&&u.length;return c|=0,n&&c+8<=n&&typeof u[c]!="string"}function fromArray(u,c,n,o){c|=0,o|=0;for(var t=0;t<8;t++)u[c++]=n[o++]&255}function newArray(u,c){return Array.prototype.slice.call(u,c,c+8)}function fromPositiveBE(u,c,n){for(var o=c+8;o>c;)u[--o]=n&255,n/=256}function fromNegativeBE(u,c,n){var o=c+8;for(n++;o>c;)u[--o]=-n&255^255,n/=256}function fromPositiveLE(u,c,n){for(var o=c+8;c<o;)u[c++]=n&255,n/=256}function fromNegativeLE(u,c,n){var o=c+8;for(n++;c<o;)u[c++]=-n&255^255,n/=256}function _isArray(u){return!!u&&Object.prototype.toString.call(u)=="[object Array]"}class TypeAdapter{static toOTS(c,n){if(c==null)return c;switch(n){case"long":return typeof c=="object"&&"$increment"in c?{$increment:TableStore.Long.fromNumber(c.$increment)}:TableStore.Long.fromNumber(c);case"json":return typeof c=="string"?c:JSON.stringify(c);case"date":return c instanceof Date?c.toISOString():c;case"number":case"boolean":case"string":default:return c}}static fromOTS(c,n){if(Int64LE.isInt64LE(c))return c.toNumber();if(n==="json"&&typeof c=="string")try{return JSON.parse(c)}catch{return c}return n==="date"&&typeof c=="string"?new Date(c):c}}function resolveDefaultValue(u,c,n){return typeof u=="function"?u(c,n):u}function fillPartitionKey(u,c,n){const o={...u};return!c||o[c.name]!==void 0&&o[c.name]!==null||c.auto&&(o[c.name]=c.auto(u,n)),o}function applyDefaultValues(u,c,n){const o={...u},t=new Date;for(const e of c.columns)if(!(o[e.name]!==void 0&&o[e.name]!==null)){if(e.createdAt){o[e.name]=t;continue}if(e.updatedAt){o[e.name]=t;continue}e.default!==void 0&&(o[e.name]=resolveDefaultValue(e.default,u,n))}return o}function applyUpdateValues(u,c){var o;const n=new Date;return(o=c==null?void 0:c.columns)==null||o.forEach(t=>{t.updatedAt&&u.push({[t.name]:TypeAdapter.toOTS(n,"date")})}),u}function validatePartitionKey(u,c){if(c&&(u[c.name]===void 0||u[c.name]===null)&&!c.auto)throw new Error(`Partition key '${c.name}' is required but not provided, and no auto function is defined.`)}function objectToSource(u){const c=" ",o="'",t=new WeakSet;let e=0;function r(i,l=""){if(i!==null&&typeof i=="object"&&t.has(i))return"[Circular]";if(i===null)return"null";const a=typeof i;if(a==="undefined")return"undefined";if(a==="boolean")return String(i);if(a==="number")return Number.isNaN(i)?"NaN":i===1/0?"Infinity":i===-1/0?"-Infinity":String(i);if(a==="bigint")return`${i}n`;if(a==="symbol")return`Symbol(${i.description?o+i.description+o:""})`;if(a==="string"){const w=i.replace(/\\/g,"\\\\").replace(new RegExp(o,"g"),"\\"+o).replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");return o+w+o}if(a==="function"){const w=i.toString();return w.includes("=>")&&!w.startsWith("function"),w}if(e>=10)return"[Max Depth Reached]";e++,t.add(i);const f=l+c,s=`
7
+ `,d=" ",O="";let b;if(i instanceof Date)b=`new Date(${o}${i.toISOString()}${o})`;else if(i instanceof RegExp)b=i.toString();else if(i instanceof Map){const w=Array.from(i.entries()).map(([g,B])=>{const A=typeof g=="string"&&isValidIdentifier(g)?g:r(g,f);return`${f}[${A},${d}${r(B,f)}]`});b=`new Map([${s}${w.join(","+s)}${s}${l}])`}else if(i instanceof Set){const w=Array.from(i).map(g=>`${f}${r(g,f)}`);b=`new Set([${s}${w.join(","+s)}${O}${s}${l}])`}else if(Array.isArray(i))if(i.length===0)b="[]";else{const w=i.map(B=>`${f}${r(B,f)}`);b=`[${s}${w.join(","+s)}${s}${l}]`}else{const w=Object.keys(i),g=Object.getOwnPropertySymbols(i);if(w.length===0&&g.length===0)b="{}";else{const A=[...w,...g.map(C=>`[Symbol(${C.description?o+C.description+o:""})]`)].map(C=>{const E=i[C],_=typeof C=="symbol"||isValidIdentifier(C)?C:`${o}${C}${o}`;return`${f}${_}:${d}${r(E,f)}`});b=`{${s}${A.join(","+s)}${s}${l}}`}}return t.delete(i),e--,b}return r(u)}function isValidIdentifier(u){return/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(u)}exports.TableStore=TableStore;exports.TypeAdapter=TypeAdapter;exports.VectorMetricType=VectorMetricType;exports.applyDefaultValues=applyDefaultValues;exports.applyUpdateValues=applyUpdateValues;exports.commonjsGlobal=commonjsGlobal;exports.commonjsRequire=commonjsRequire;exports.fillPartitionKey=fillPartitionKey;exports.getDefaultExportFromCjs=getDefaultExportFromCjs;exports.objectToSource=objectToSource;exports.tablestore=tablestore;exports.validatePartitionKey=validatePartitionKey;