UNPKG

372 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AV=t():e.AV=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=208)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(224);n.d(t,"default",function(){return r.a});var i=n(90);n.d(t,"VERSION",function(){return i.VERSION}),n.d(t,"restArguments",function(){return i.restArguments}),n.d(t,"isObject",function(){return i.isObject}),n.d(t,"isNull",function(){return i.isNull}),n.d(t,"isUndefined",function(){return i.isUndefined}),n.d(t,"isBoolean",function(){return i.isBoolean}),n.d(t,"isElement",function(){return i.isElement}),n.d(t,"isString",function(){return i.isString}),n.d(t,"isNumber",function(){return i.isNumber}),n.d(t,"isDate",function(){return i.isDate}),n.d(t,"isRegExp",function(){return i.isRegExp}),n.d(t,"isError",function(){return i.isError}),n.d(t,"isSymbol",function(){return i.isSymbol}),n.d(t,"isArrayBuffer",function(){return i.isArrayBuffer}),n.d(t,"isDataView",function(){return i.isDataView}),n.d(t,"isArray",function(){return i.isArray}),n.d(t,"isFunction",function(){return i.isFunction}),n.d(t,"isArguments",function(){return i.isArguments}),n.d(t,"isFinite",function(){return i.isFinite}),n.d(t,"isNaN",function(){return i.isNaN}),n.d(t,"isTypedArray",function(){return i.isTypedArray}),n.d(t,"isEmpty",function(){return i.isEmpty}),n.d(t,"isMatch",function(){return i.isMatch}),n.d(t,"isEqual",function(){return i.isEqual}),n.d(t,"isMap",function(){return i.isMap}),n.d(t,"isWeakMap",function(){return i.isWeakMap}),n.d(t,"isSet",function(){return i.isSet}),n.d(t,"isWeakSet",function(){return i.isWeakSet}),n.d(t,"keys",function(){return i.keys}),n.d(t,"allKeys",function(){return i.allKeys}),n.d(t,"values",function(){return i.values}),n.d(t,"pairs",function(){return i.pairs}),n.d(t,"invert",function(){return i.invert}),n.d(t,"functions",function(){return i.functions}),n.d(t,"methods",function(){return i.methods}),n.d(t,"extend",function(){return i.extend}),n.d(t,"extendOwn",function(){return i.extendOwn}),n.d(t,"assign",function(){return i.assign}),n.d(t,"defaults",function(){return i.defaults}),n.d(t,"create",function(){return i.create}),n.d(t,"clone",function(){return i.clone}),n.d(t,"tap",function(){return i.tap}),n.d(t,"get",function(){return i.get}),n.d(t,"has",function(){return i.has}),n.d(t,"mapObject",function(){return i.mapObject}),n.d(t,"identity",function(){return i.identity}),n.d(t,"constant",function(){return i.constant}),n.d(t,"noop",function(){return i.noop}),n.d(t,"toPath",function(){return i.toPath}),n.d(t,"property",function(){return i.property}),n.d(t,"propertyOf",function(){return i.propertyOf}),n.d(t,"matcher",function(){return i.matcher}),n.d(t,"matches",function(){return i.matches}),n.d(t,"times",function(){return i.times}),n.d(t,"random",function(){return i.random}),n.d(t,"now",function(){return i.now}),n.d(t,"escape",function(){return i.escape}),n.d(t,"unescape",function(){return i.unescape}),n.d(t,"templateSettings",function(){return i.templateSettings}),n.d(t,"template",function(){return i.template}),n.d(t,"result",function(){return i.result}),n.d(t,"uniqueId",function(){return i.uniqueId}),n.d(t,"chain",function(){return i.chain}),n.d(t,"iteratee",function(){return i.iteratee}),n.d(t,"partial",function(){return i.partial}),n.d(t,"bind",function(){return i.bind}),n.d(t,"bindAll",function(){return i.bindAll}),n.d(t,"memoize",function(){return i.memoize}),n.d(t,"delay",function(){return i.delay}),n.d(t,"defer",function(){return i.defer}),n.d(t,"throttle",function(){return i.throttle}),n.d(t,"debounce",function(){return i.debounce}),n.d(t,"wrap",function(){return i.wrap}),n.d(t,"negate",function(){return i.negate}),n.d(t,"compose",function(){return i.compose}),n.d(t,"after",function(){return i.after}),n.d(t,"before",function(){return i.before}),n.d(t,"once",function(){return i.once}),n.d(t,"findKey",function(){return i.findKey}),n.d(t,"findIndex",function(){return i.findIndex}),n.d(t,"findLastIndex",function(){return i.findLastIndex}),n.d(t,"sortedIndex",function(){return i.sortedIndex}),n.d(t,"indexOf",function(){return i.indexOf}),n.d(t,"lastIndexOf",function(){return i.lastIndexOf}),n.d(t,"find",function(){return i.find}),n.d(t,"detect",function(){return i.detect}),n.d(t,"findWhere",function(){return i.findWhere}),n.d(t,"each",function(){return i.each}),n.d(t,"forEach",function(){return i.forEach}),n.d(t,"map",function(){return i.map}),n.d(t,"collect",function(){return i.collect}),n.d(t,"reduce",function(){return i.reduce}),n.d(t,"foldl",function(){return i.foldl}),n.d(t,"inject",function(){return i.inject}),n.d(t,"reduceRight",function(){return i.reduceRight}),n.d(t,"foldr",function(){return i.foldr}),n.d(t,"filter",function(){return i.filter}),n.d(t,"select",function(){return i.select}),n.d(t,"reject",function(){return i.reject}),n.d(t,"every",function(){return i.every}),n.d(t,"all",function(){return i.all}),n.d(t,"some",function(){return i.some}),n.d(t,"any",function(){return i.any}),n.d(t,"contains",function(){return i.contains}),n.d(t,"includes",function(){return i.includes}),n.d(t,"include",function(){return i.include}),n.d(t,"invoke",function(){return i.invoke}),n.d(t,"pluck",function(){return i.pluck}),n.d(t,"where",function(){return i.where}),n.d(t,"max",function(){return i.max}),n.d(t,"min",function(){return i.min}),n.d(t,"shuffle",function(){return i.shuffle}),n.d(t,"sample",function(){return i.sample}),n.d(t,"sortBy",function(){return i.sortBy}),n.d(t,"groupBy",function(){return i.groupBy}),n.d(t,"indexBy",function(){return i.indexBy}),n.d(t,"countBy",function(){return i.countBy}),n.d(t,"partition",function(){return i.partition}),n.d(t,"toArray",function(){return i.toArray}),n.d(t,"size",function(){return i.size}),n.d(t,"pick",function(){return i.pick}),n.d(t,"omit",function(){return i.omit}),n.d(t,"first",function(){return i.first}),n.d(t,"head",function(){return i.head}),n.d(t,"take",function(){return i.take}),n.d(t,"initial",function(){return i.initial}),n.d(t,"last",function(){return i.last}),n.d(t,"rest",function(){return i.rest}),n.d(t,"tail",function(){return i.tail}),n.d(t,"drop",function(){return i.drop}),n.d(t,"compact",function(){return i.compact}),n.d(t,"flatten",function(){return i.flatten}),n.d(t,"without",function(){return i.without}),n.d(t,"uniq",function(){return i.uniq}),n.d(t,"unique",function(){return i.unique}),n.d(t,"union",function(){return i.union}),n.d(t,"intersection",function(){return i.intersection}),n.d(t,"difference",function(){return i.difference}),n.d(t,"unzip",function(){return i.unzip}),n.d(t,"transpose",function(){return i.transpose}),n.d(t,"zip",function(){return i.zip}),n.d(t,"object",function(){return i.object}),n.d(t,"range",function(){return i.range}),n.d(t,"chunk",function(){return i.chunk}),n.d(t,"mixin",function(){return i.mixin})},function(e,t){var n=e.exports={version:"2.6.9"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";(function(e){n.d(t,"e",function(){return r}),n.d(t,"p",function(){return i}),n.d(t,"a",function(){return o}),n.d(t,"c",function(){return a}),n.d(t,"d",function(){return s}),n.d(t,"o",function(){return u}),n.d(t,"q",function(){return c}),n.d(t,"t",function(){return f}),n.d(t,"i",function(){return l}),n.d(t,"r",function(){return h}),n.d(t,"s",function(){return d}),n.d(t,"k",function(){return p}),n.d(t,"m",function(){return v}),n.d(t,"j",function(){return m}),n.d(t,"l",function(){return g}),n.d(t,"g",function(){return y}),n.d(t,"f",function(){return b}),n.d(t,"h",function(){return _}),n.d(t,"n",function(){return w}),n.d(t,"b",function(){return E});var r="1.12.1",i="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||Function("return this")()||{},o=Array.prototype,a=Object.prototype,s="undefined"!=typeof Symbol?Symbol.prototype:null,u=o.push,c=o.slice,f=a.toString,l=a.hasOwnProperty,h="undefined"!=typeof ArrayBuffer,d="undefined"!=typeof DataView,p=Array.isArray,v=Object.keys,m=Object.create,g=h&&ArrayBuffer.isView,y=isNaN,b=isFinite,_=!{toString:null}.propertyIsEnumerable("toString"),w=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],E=Math.pow(2,53)-1}).call(t,n(65))},function(e,t,n){e.exports={default:n(211),__esModule:!0}},function(e,t,n){var r=n(5),i=n(1),o=n(22),a=n(23),s=n(24),u=function(e,t,n){var c,f,l,h=e&u.F,d=e&u.G,p=e&u.S,v=e&u.P,m=e&u.B,g=e&u.W,y=d?i:i[t]||(i[t]={}),b=y.prototype,_=d?r:p?r[t]:(r[t]||{}).prototype;d&&(n=t);for(c in n)(f=!h&&_&&void 0!==_[c])&&s(y,c)||(l=f?_[c]:n[c],y[c]=d&&"function"!=typeof _[c]?n[c]:m&&f?o(l,r):g&&_[c]==l?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((y.virtual||(y.virtual={}))[c]=l,e&u.R&&b&&!b[c]&&a(b,c,l)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";function r(e){if(!Object(i.a)(e))return[];if(o.m)return Object(o.m)(e);var t=[];for(var n in e)Object(a.a)(e,n)&&t.push(n);return o.h&&Object(s.a)(e,t),t}t.a=r;var i=n(29),o=n(2),a=n(26),s=n(136)},function(e,t,n){"use strict";function r(e){var t="[object "+e+"]";return function(e){return i.t.call(e)===t}}t.a=r;var i=n(2)},function(e,t,n){var r=n(86)("wks"),i=n(61),o=n(5).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){"use strict";function r(e,t,n){return i.a.iteratee!==a.a?i.a.iteratee(e,t):Object(o.a)(e,t,n)}t.a=r;var i=n(12),o=n(146),a=n(147)},function(e,t,n){"use strict";function r(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var o=Array(t+1);for(i=0;i<t;i++)o[i]=arguments[i];return o[t]=r,e.apply(this,o)}}t.a=r},function(e,t,n){"use strict";function r(e){return e instanceof r?e:this instanceof r?void(this._wrapped=e):new r(e)}t.a=r;var i=n(2);r.VERSION=i.e,r.prototype.value=function(){return this._wrapped},r.prototype.valueOf=r.prototype.toJSON=r.prototype.value,r.prototype.toString=function(){return String(this._wrapped)}},function(e,t,n){"use strict";var r=n(134),i=n(18);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";var r=n(3),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(0),a=n(338),s=n(0),u=s.extend,c=n(41),f=n(19),l=f.getSessionToken,h=n(71),d=function(e,t){var n=(new Date).getTime(),r=a(n+e);return t?r+","+n+",master":r+","+n},p=function(e,t){t?e["X-LC-Sign"]=d(c.applicationKey):e["X-LC-Key"]=c.applicationKey},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],n={"X-LC-Id":c.applicationId,"Content-Type":"application/json;charset=UTF-8"},r=!1;return"boolean"==typeof e.useMasterKey?r=e.useMasterKey:"boolean"==typeof c._config.useMasterKey&&(r=c._config.useMasterKey),r?c.masterKey?t?n["X-LC-Sign"]=d(c.masterKey,!0):n["X-LC-Key"]=c.masterKey+",master":(console.warn("masterKey is not set, fall back to use appKey"),p(n,t)):p(n,t),c.hookKey&&(n["X-LC-Hook-Key"]=c.hookKey),null!==c._config.production&&(n["X-LC-Prod"]=String(c._config.production)),n["X-LC-UA"]=c._sharedConfig.userAgent,i.default.resolve().then(function(){var t=l(e);if(t)n["X-LC-Session"]=t;else if(!c._config.disableCurrentUser)return c.User.currentAsync().then(function(e){return e&&e._sessionToken&&(n["X-LC-Session"]=e._sessionToken),n});return n})},m=function(e){var t=e.service,n=void 0===t?"api":t,r=e.version,i=void 0===r?"1.1":r,o=e.path,a=c._config.serverURLs[n];if(!a)throw new Error("undefined server URL for "+n);return"/"!==a.charAt(a.length-1)&&(a+="/"),a+=i,o&&(a+=o),a},g=function(e){var t=e.service,n=e.version,r=e.method,i=e.path,a=e.query,s=e.data,u=e.authOptions,f=e.signKey,l=void 0===f||f;if(!c.applicationId||!c.applicationKey&&!c.masterKey)throw new Error("Not initialized");c._appRouter&&c._appRouter.refresh();var d=c._config.requestTimeout,p=m({service:t,path:i,version:n});return v(u,l).then(function(e){return h({method:r,url:p,query:a,data:s,headers:e,timeout:d}).catch(function(e){var t={code:e.code||-1,error:e.message||e.responseText};if(e.response&&e.response.code)t=e.response;else if(e.responseText)try{t=JSON.parse(e.responseText)}catch(e){}t.rawMessage=t.rawMessage||t.error,c._sharedConfig.keepErrorRawMessage||(t.error+=" ["+(e.statusCode||"N/A")+" "+r+" "+p+"]");var n=new Error(t.error);throw delete t.error,o.extend(n,t)})})},y=function(e,t,n,r,i,o,a){var s="";if(e&&(s+="/"+e),t&&(s+="/"+t),n&&(s+="/"+n),i&&i._fetchWhenSave)throw new Error("_fetchWhenSave should be in the query");if(i&&i._where)throw new Error("_where should be in the query");return r&&"get"===r.toLowerCase()&&(a=u({},a,i),i=null),g({method:r,path:s,query:a,data:i,authOptions:o})};c.request=g,e.exports={_request:y,request:g}},function(e,t,n){var r=n(9);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(27)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";var r=n(7),i=n(2),o=Object(r.a)("Function"),a=i.p.document&&i.p.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof a&&(o=function(e){return"function"==typeof e||!1}),t.a=o},function(e,t,n){"use strict";var r=n(135);t.a=Object(r.a)("length")},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(175),s=r(a),u=n(0),c=function(e){return u.isNull(e)||u.isUndefined(e)},f=function(e){return u.isArray(e)?e:void 0===e||null===e?[]:[e]},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.keys,n=e.include,r=e.includeACL,i={};return t&&(i.keys=f(t).join(",")),n&&(i.include=f(n).join(",")),r&&(i.returnACL=r),i},h=function(e){return e.sessionToken?e.sessionToken:e.user&&"function"==typeof e.user.getSessionToken?e.user.getSessionToken():void 0},d=function(e){return function(t){return e(t),t}},p=function(){},v=function(e,t,n){var r;return r=t&&t.hasOwnProperty("constructor")?t.constructor:function(){e.apply(this,arguments)},u.extend(r,e),p.prototype=e.prototype,r.prototype=new p,t&&u.extend(r.prototype,t),n&&u.extend(r,n),r.prototype.constructor=r,r.__super__=e.prototype,r},m=function(e){return new Date(e)},g=function(e,t,n){var r=t.split("."),i=r.pop(),o=e;return r.forEach(function(e){void 0===o[e]&&(o[e]={}),o=o[e]}),o[i]=n,e},y=function(e,t){for(var n=t.split("."),r=n[0],i=n.pop(),o=e,a=0;a<n.length;a++)if(void 0===(o=o[n[a]]))return[void 0,void 0,i];return[o[i],o,i,r]},b=function(e){return u.isObject(e)&&(0,s.default)(e)===Object.prototype},_=function e(t,n){return t()?n().then(function(){return e(t,n)}):o.default.resolve()};e.exports={isNullOrUndefined:c,ensureArray:f,transformFetchOptions:l,getSessionToken:h,tap:d,inherits:v,parseDate:m,setValue:g,findValue:y,isPlainObject:b,continueWhile:_}},function(e,t,n){var r=n(15),i=n(112),o=n(82),a=Object.defineProperty;t.f=n(16)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports={default:n(296),__esModule:!0}},function(e,t,n){var r=n(46);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(20),i=n(47);e.exports=n(16)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(84),i=n(79);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";function r(e,t){return null!=e&&i.i.call(e,t)}t.a=r;var i=n(2)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(79);e.exports=function(e){return Object(r(e))}},function(e,t,n){"use strict";function r(e){var t=typeof e;return"function"===t||"object"===t&&!!e}t.a=r},function(e,t,n){"use strict";var r=n(2),i=n(7);t.a=r.k||Object(i.a)("Array")},function(e,t,n){"use strict";function r(e,t,n){t=Object(i.a)(t,n);var r,s;if(Object(o.a)(e))for(r=0,s=e.length;r<s;r++)t(e[r],r,e);else{var u=Object(a.a)(e);for(r=0,s=u.length;r<s;r++)t(e[u[r]],u[r],e)}return e}t.a=r;var i=n(54),o=n(13),a=n(6)},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function o(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),this.useColors){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(r++,"%c"===e&&(i=r))}),t.splice(i,0,n)}}function a(){var e;return"object"===("undefined"==typeof console?"undefined":r(console))&&console.log&&(e=console).log.apply(e,arguments)}function s(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}}function u(){var e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}t.log=a,t.formatArgs=o,t.save=s,t.load=u,t.useColors=i,t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(301)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},function(e,t,n){"use strict";function r(e,t){var n=new Error(t);return n.code=e,n}n(0).extend(r,{OTHER_CAUSE:-1,INTERNAL_SERVER_ERROR:1,CONNECTION_FAILED:100,OBJECT_NOT_FOUND:101,INVALID_QUERY:102,INVALID_CLASS_NAME:103,MISSING_OBJECT_ID:104,INVALID_KEY_NAME:105,INVALID_POINTER:106,INVALID_JSON:107,COMMAND_UNAVAILABLE:108,NOT_INITIALIZED:109,INCORRECT_TYPE:111,INVALID_CHANNEL_NAME:112,PUSH_MISCONFIGURED:115,OBJECT_TOO_LARGE:116,OPERATION_FORBIDDEN:119,CACHE_MISS:120,INVALID_NESTED_KEY:121,INVALID_FILE_NAME:122,INVALID_ACL:123,TIMEOUT:124,INVALID_EMAIL_ADDRESS:125,MISSING_CONTENT_TYPE:126,MISSING_CONTENT_LENGTH:127,INVALID_CONTENT_LENGTH:128,FILE_TOO_LARGE:129,FILE_SAVE_ERROR:130,FILE_DELETE_ERROR:153,DUPLICATE_VALUE:137,INVALID_ROLE_NAME:139,EXCEEDED_QUOTA:140,SCRIPT_FAILED:141,VALIDATION_ERROR:142,INVALID_IMAGE_DATA:150,UNSAVED_FILE_ERROR:151,INVALID_PUSH_TIME_ERROR:152,USERNAME_MISSING:200,PASSWORD_MISSING:201,USERNAME_TAKEN:202,EMAIL_TAKEN:203,EMAIL_MISSING:204,EMAIL_NOT_FOUND:205,SESSION_MISSING:206,MUST_CREATE_USER_THROUGH_SIGNUP:207,ACCOUNT_ALREADY_LINKED:208,LINKED_ID_MISSING:250,INVALID_LINKED_SESSION:251,UNSUPPORTED_SERVICE:252,X_DOMAIN_REQUEST:602}),e.exports=r},function(e,t,n){"use strict";var r=n(212)(!0);n(80)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t){e.exports={}},function(e,t,n){n(216);for(var r=n(5),i=n(23),o=n(35),a=n(8)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<s.length;u++){var c=s[u],f=r[c],l=f&&f.prototype;l&&!l[a]&&i(l,a,c),o[c]=o.Array}},function(e,t,n){var r=n(22),i=n(118),o=n(119),a=n(15),s=n(60),u=n(88),c={},f={},t=e.exports=function(e,t,n,l,h){var d,p,v,m,g=h?function(){return e}:u(e),y=r(n,l,t?2:1),b=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(d=s(e.length);d>b;b++)if((m=t?y(a(p=e[b])[0],p[1]):y(e[b]))===c||m===f)return m}else for(v=g.call(e);!(p=v.next()).done;)if((m=i(v,y,p.value,t))===c||m===f)return m};t.BREAK=c,t.RETURN=f},function(e,t,n){"use strict";function r(e){for(var t=Object(i.a)(e),n=t.length,r=Array(n),o=0;o<n;o++)r[o]=e[t[o]];return r}t.a=r;var i=n(6)},function(e,t,n){"use strict";function r(e,t,n,u){if(u=u||[],t||0===t){if(t<=0)return u.concat(e)}else t=1/0;for(var c=u.length,f=0,l=Object(i.a)(e);f<l;f++){var h=e[f];if(Object(o.a)(h)&&(Object(a.a)(h)||Object(s.a)(h)))if(t>1)r(h,t-1,n,u),c=u.length;else for(var d=0,p=h.length;d<p;)u[c++]=h[d++];else n||(u[c++]=h)}return u}t.a=r;var i=n(18),o=n(13),a=n(30),s=n(93)},function(e,t,n){"use strict";function r(e,t,n){t=Object(i.a)(t,n);for(var r=!Object(o.a)(e)&&Object(a.a)(e),s=(r||e).length,u=Array(s),c=0;c<s;c++){var f=r?r[c]:c;u[c]=t(e[f],f,e)}return u}t.a=r;var i=n(10),o=n(13),a=n(6)},function(e,t,n){"use strict";(function(t){function r(e){return e&&e.__esModule?e:{default:e}}var i=n(21),o=r(i),a=n(105),s=r(a),u=n(3),c=r(u),f=n(0),l=n(174),h=n(32),d=n(19),p=d.inherits,v=d.parseDate,m=n(176),g=n(42),y=g.setAdapters,b=g.adapterManager,_=t.AV||{};_._config={serverURLs:{},useMasterKey:!1,production:null,realtime:null,requestTimeout:null};var w="LeanCloud-JS-SDK/"+m;_._sharedConfig={userAgent:w,liveQueryRealtime:null},b.on("platformInfo",function(e){var t=w;if(e)if(e.userAgent)t=e.userAgent;else{var n=e.name;e.version&&(n+="/"+e.version),e.extra&&(n+="; "+e.extra),t+=" ("+n+")"}_._sharedConfig.userAgent=t}),_._getAVPath=function(e){if(!_.applicationId)throw new Error("You need to call AV.initialize before using AV.");if(e||(e=""),!f.isString(e))throw new Error("Tried to get a localStorage path that wasn't a String.");return"/"===e[0]&&(e=e.substring(1)),"AV/"+_.applicationId+"/"+e},_._installationId=null,_._getInstallationId=function(){if(_._installationId)return c.default.resolve(_._installationId);var e=_._getAVPath("installationId");return _.localStorage.getItemAsync(e).then(function(t){return _._installationId=t,_._installationId?t:(_._installationId=t=l(),_.localStorage.setItemAsync(e,t).then(function(){return t}))})},_._subscriptionId=null,_._refreshSubscriptionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_._getAVPath("subscriptionId"),t=_._subscriptionId=l();return _.localStorage.setItemAsync(e,t).then(function(){return t})},_._getSubscriptionId=function(){if(_._subscriptionId)return c.default.resolve(_._subscriptionId);var e=_._getAVPath("subscriptionId");return _.localStorage.getItemAsync(e).then(function(t){return _._subscriptionId=t,_._subscriptionId||(t=_._refreshSubscriptionId(e)),t})},_._parseDate=v,_._extend=function(e,t){var n=p(this,e,t);return n.extend=this.extend,n},_._encode=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof _.Object){if(n)throw new Error("AV.Objects not allowed here");return t&&!f.include(t,e)&&e._hasData?e._toFullJSON(t.concat(e),r):e._toPointer()}if(e instanceof _.ACL)return e.toJSON();if(f.isDate(e))return r?{__type:"Date",iso:e.toJSON()}:e.toJSON();if(e instanceof _.GeoPoint)return e.toJSON();if(f.isArray(e))return f.map(e,function(e){return _._encode(e,t,n,r)});if(f.isRegExp(e))return e.source;if(e instanceof _.Relation)return e.toJSON();if(e instanceof _.Op)return e.toJSON();if(e instanceof _.File){if(!e.url()&&!e.id)throw new Error("Tried to save an object containing an unsaved file.");return e._toFullJSON(t,r)}return f.isObject(e)?f.mapObject(e,function(e,i){return _._encode(e,t,n,r)}):e},_._decode=function(e,t){if(!f.isObject(e)||f.isDate(e))return e;if(f.isArray(e))return f.map(e,function(e){return _._decode(e)});if(e instanceof _.Object)return e;if(e instanceof _.File)return e;if(e instanceof _.Op)return e;if(e instanceof _.GeoPoint)return e;if(e instanceof _.ACL)return e;if("ACL"===t)return new _.ACL(e);if(e.__op)return _.Op._decode(e);var n;if("Pointer"===e.__type){n=e.className;var r=_.Object._create(n);if((0,s.default)(e).length>3){var i=f.clone(e);delete i.__type,delete i.className,r._finishFetch(i,!0)}else r._finishFetch({objectId:e.objectId},!1);return r}if("Object"===e.__type){n=e.className;var o=f.clone(e);delete o.__type,delete o.className;var a=_.Object._create(n);return a._finishFetch(o,!0),a}if("Date"===e.__type)return _._parseDate(e.iso);if("GeoPoint"===e.__type)return new _.GeoPoint({latitude:e.latitude,longitude:e.longitude});if("Relation"===e.__type){if(!t)throw new Error("key missing decoding a Relation");var u=new _.Relation(null,t);return u.targetClassName=e.className,u}if("File"===e.__type){var c=new _.File(e.name),l=f.clone(e);return delete l.__type,c._finishFetch(l),c}return f.mapObject(e,_._decode)},_.parseJSON=_._decode,_.parse=function(e){return _.parseJSON(JSON.parse(e))},_.stringify=function(e){return(0,o.default)(_._encode(e,[],!1,!0))},_._encodeObjectOrArray=function(e){var t=function(e){return e&&e._toFullJSON&&(e=e._toFullJSON([])),f.mapObject(e,function(e){return _._encode(e,[])})};return f.isArray(e)?e.map(function(e){return t(e)}):t(e)},_._arrayEach=f.each,_._traverse=function(e,t,n){if(e instanceof _.Object){if(n=n||[],f.indexOf(n,e)>=0)return;return n.push(e),_._traverse(e.attributes,t,n),t(e)}return e instanceof _.Relation||e instanceof _.File?t(e):f.isArray(e)?(f.each(e,function(r,i){var o=_._traverse(r,t,n);o&&(e[i]=o)}),t(e)):f.isObject(e)?(_._each(e,function(r,i){var o=_._traverse(r,t,n);o&&(e[i]=o)}),t(e)):t(e)},_._objectEach=_._each=function(e,t){f.isObject(e)?f.each(f.keys(e),function(n){t(e[n],n)}):f.each(e,t)},_.debug={enable:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"leancloud*";return h.enable(e)},disable:h.disable},_.setAdapters=y,e.exports=_}).call(t,n(65))},function(e,t,n){"use strict";var r=n(0),i=n(177),o=n(19),a=o.inherits,s=a(i,{constructor:function(){i.apply(this),this._adapters={}},getAdapter:function(e){var t=this._adapters[e];if(void 0===t)throw new Error(e+" adapter is not configured");return t},setAdapters:function(e){var t=this;r.extend(this._adapters,e),r.keys(e).forEach(function(n){return t.emit(n,e[n])})}}),u=new s;e.exports={getAdapter:u.getAdapter.bind(u),setAdapters:u.setAdapters.bind(u),adapterManager:u}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(309),o=r(i),a=n(180),s=r(a),u="function"==typeof s.default&&"symbol"==typeof o.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};t.default="function"==typeof s.default&&"symbol"===u(o.default)?function(e){return void 0===e?"undefined":u(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":void 0===e?"undefined":u(e)}},function(e,t,n){var r=n(61)("meta"),i=n(9),o=n(24),a=n(20).f,s=0,u=Object.isExtensible||function(){return!0},c=!n(27)(function(){return u(Object.preventExtensions({}))}),f=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},l=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!u(e))return"F";if(!t)return"E";f(e)}return e[r].i},h=function(e,t){if(!o(e,r)){if(!u(e))return!0;if(!t)return!1;f(e)}return e[r].w},d=function(e){return c&&p.NEED&&u(e)&&!o(e,r)&&f(e),e},p=e.exports={KEY:r,NEED:!1,fastKey:l,getWeak:h,onFreeze:d}},function(e,t){e.exports=!0},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(114),i=n(87);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(20).f,i=n(24),o=n(8)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return a});var r=n(2),i=n(230),o=r.s&&Object(i.a)(new DataView(new ArrayBuffer(8))),a="undefined"!=typeof Map&&Object(i.a)(new Map)},function(e,t,n){"use strict";function r(e){if(!Object(i.a)(e))return[];var t=[];for(var n in e)t.push(n);return o.h&&Object(a.a)(e,t),t}t.a=r;var i=n(29),o=n(2),a=n(136)},function(e,t,n){"use strict";function r(e){return i.a.toPath(e)}t.a=r;var i=n(12);n(145)},function(e,t,n){"use strict";function r(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}}t.a=r},function(e,t,n){"use strict";function r(e,t,n){var r=[];return t=Object(i.a)(t,n),Object(o.a)(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}t.a=r;var i=n(10),o=n(31)},function(e,t,n){"use strict";function r(e,t,n,r){return Object(i.a)(e)||(e=Object(o.a)(e)),("number"!=typeof n||r)&&(n=0),Object(a.a)(e,t,n)>=0}t.a=r;var i=n(13),o=n(38),a=n(161)},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t){},function(e,t,n){var r=n(15),i=n(113),o=n(87),a=n(85)("IE_PROTO"),s=function(){},u=function(){var e,t=n(81)("iframe"),r=o.length;for(t.style.display="none",n(115).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;r--;)delete u.prototype[o[r]];return u()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=u(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(78),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(49),i=n(8)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(23);e.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return e=Object(i.a)({},e),function(t){return Object(o.a)(t,e)}}t.a=r;var i=n(97),o=n(137)},function(e,t,n){"use strict";var r=n(11),i=n(153),o=n(12),a=Object(r.a)(function(e,t){var n=a.placeholder,r=function(){for(var o=0,a=t.length,s=Array(a),u=0;u<a;u++)s[u]=t[u]===n?arguments[o++]:t[u];for(;o<arguments.length;)s.push(arguments[o++]);return Object(i.a)(e,r,this,this,s)};return r});a.placeholder=o.a,t.a=a},function(e,t,n){"use strict";function r(e,t){return function(n,r,a){var s=t?[[],[]]:{};return r=Object(i.a)(r,a),Object(o.a)(n,function(t,i){var o=r(t,i,n);e(s,t,o)}),s}}t.a=r;var i=n(10),o=n(31)},function(e,t,n){var r=n(4),i=n(1),o=n(27);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",a)}},function(e,t,n){e.exports={default:n(306),__esModule:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(21),o=r(i),a=n(43),s=r(a),u=n(105),c=r(u),f=(n(0),n(183)),l=f.timeout,h=n(32),d=h("leancloud:request"),p=h("leancloud:request:error"),v=n(42),m=v.getAdapter,g=0,y=function(e){var t=e.method,n=e.url,r=e.query,i=e.data,a=e.headers,u=void 0===a?{}:a,f=e.timeout,v=e.onprogress;if(r){var y=(0,c.default)(r).map(function(e){var t=r[e];if(void 0!==t){var n="object"===(void 0===t?"undefined":(0,s.default)(t))?(0,o.default)(t):t;return encodeURIComponent(e)+"="+encodeURIComponent(n)}}).filter(function(e){return e}).join("&");n=n+"?"+y}var b=g++;d("request(%d) %s %s %o %o %o",b,t,n,r,i,u);var _=m("request"),w=_(n,{method:t,headers:u,data:i,onprogress:v}).then(function(e){if(d("response(%d) %d %O %o",b,e.status,e.data||e.text,e.header),!1===e.ok){var t=new Error;throw t.response=e,t}return e.data}).catch(function(e){throw e.response&&(h.enabled("leancloud:request")||p("request(%d) %s %s %o %o %o",b,t,n,r,i,u),p("response(%d) %d %O %o",b,e.response.status,e.response.data||e.response.text,e.response.header),e.statusCode=e.response.status,e.responseText=e.response.text,e.response=e.response.data),e});return f?l(w,f):w};e.exports=y},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(73),i=n(47),o=n(25),a=n(82),s=n(24),u=n(112),c=Object.getOwnPropertyDescriptor;t.f=n(16)?c:function(e,t){if(e=o(e),t=a(t,!0),u)try{return c(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){},function(e,t,n){function r(e){return null==e?void 0===e?u:s:c&&c in Object(e)?o(e):a(e)}var i=n(201),o=n(421),a=n(422),s="[object Null]",u="[object Undefined]",c=i?i.toStringTag:void 0;e.exports=r},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";var r=n(45),i=n(4),o=n(83),a=n(23),s=n(35),u=n(213),c=n(50),f=n(116),l=n(8)("iterator"),h=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,n,p,v,m,g){u(n,t,p);var y,b,_,w=function(e){if(!h&&e in S)return S[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},E=t+" Iterator",O="values"==v,T=!1,S=e.prototype,A=S[l]||S["@@iterator"]||v&&S[v],I=A||w(v),j=v?O?w("entries"):I:void 0,C="Array"==t?S.entries||A:A;if(C&&(_=f(C.call(new e)))!==Object.prototype&&_.next&&(c(_,E,!0),r||"function"==typeof _[l]||a(_,l,d)),O&&A&&"values"!==A.name&&(T=!0,I=function(){return A.call(this)}),r&&!g||!h&&!T&&S[l]||a(S,l,I),s[t]=I,s[E]=d,v)if(y={values:O?I:w("values"),keys:m?I:w("keys"),entries:j},g)for(b in y)b in S||o(S,b,y[b]);else i(i.P+i.F*(h||T),t,y);return y}},function(e,t,n){var r=n(9),i=n(5).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(23)},function(e,t,n){var r=n(49);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(86)("keys"),i=n(61);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(1),i=n(5),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(45)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(62),i=n(8)("iterator"),o=n(35);e.exports=n(1).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(46);e.exports.f=function(e){return new r(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);n.d(t,"VERSION",function(){return r.e});var i=n(11);n.d(t,"restArguments",function(){return i.a});var o=n(29);n.d(t,"isObject",function(){return o.a});var a=n(225);n.d(t,"isNull",function(){return a.a});var s=n(126);n.d(t,"isUndefined",function(){return s.a});var u=n(127);n.d(t,"isBoolean",function(){return u.a});var c=n(226);n.d(t,"isElement",function(){return c.a});var f=n(91);n.d(t,"isString",function(){return f.a});var l=n(128);n.d(t,"isNumber",function(){return l.a});var h=n(227);n.d(t,"isDate",function(){return h.a});var d=n(228);n.d(t,"isRegExp",function(){return d.a});var p=n(229);n.d(t,"isError",function(){return p.a});var v=n(129);n.d(t,"isSymbol",function(){return v.a});var m=n(130);n.d(t,"isArrayBuffer",function(){return m.a});var g=n(92);n.d(t,"isDataView",function(){return g.a});var y=n(30);n.d(t,"isArray",function(){return y.a});var b=n(17);n.d(t,"isFunction",function(){return b.a});var _=n(93);n.d(t,"isArguments",function(){return _.a});var w=n(231);n.d(t,"isFinite",function(){return w.a});var E=n(131);n.d(t,"isNaN",function(){return E.a});var O=n(132);n.d(t,"isTypedArray",function(){return O.a});var T=n(233);n.d(t,"isEmpty",function(){return T.a});var S=n(137);n.d(t,"isMatch",function(){return S.a});var A=n(234);n.d(t,"isEqual",function(){return A.a});var I=n(236);n.d(t,"isMap",function(){return I.a});var j=n(237);n.d(t,"isWeakMap",function(){return j.a});var C=n(238);n.d(t,"isSet",function(){return C.a});var x=n(239);n.d(t,"isWeakSet",function(){return x.a});var N=n(6);n.d(t,"keys",function(){return N.a});var P=n(52);n.d(t,"allKeys",function(){return P.a});var R=n(38);n.d(t,"values",function(){return R.a});var U=n(240);n.d(t,"pairs",function(){return U.a});var L=n(138);n.d(t,"invert",function(){return L.a});var k=n(139);n.d(t,"functions",function(){return k.a}),n.d(t,"methods",function(){return k.a});var M=n(140);n.d(t,"extend",function(){return M.a});var D=n(97);n.d(t,"extendOwn",function(){return D.a}),n.d(t,"assign",function(){return D.a});var F=n(141);n.d(t,"defaults",function(){return F.a});var V=n(241);n.d(t,"create",function(){return V.a});var B=n(143);n.d(t,"clone",function(){return B.a});var q=n(242);n.d(t,"tap",function(){return q.a});var W=n(144);n.d(t,"get",function(){return W.a});var Y=n(243);n.d(t,"has",function(){return Y.a});var z=n(244);n.d(t,"mapObject",function(){return z.a});var Q=n(99);n.d(t,"identity",function(){return Q.a});var G=n(133);n.d(t,"constant",function(){return G.a});var K=n(148);n.d(t,"noop",function(){return K.a});var J=n(145);n.d(t,"toPath",function(){return J.a});var $=n(100);n.d(t,"property",function(){return $.a});var H=n(245);n.d(t,"propertyOf",function(){return H.a});var Z=n(66);n.d(t,"matcher",function(){return Z.a}),n.d(t,"matches",function(){return Z.a});var X=n(246);n.d(t,"times",function(){return X.a});var ee=n(149);n.d(t,"random",function(){return ee.a});var te=n(101);n.d(t,"now",function(){return te.a});var ne=n(247);n.d(t,"escape",function(){return ne.a});var re=n(248);n.d(t,"unescape",function(){return re.a});var ie=n(152);n.d(t,"templateSettings",function(){return ie.a});var oe=n(250);n.d(t,"template",function(){return oe.a});var ae=n(251);n.d(t,"result",function(){return ae.a});var se=n(252);n.d(t,"uniqueId",function(){return se.a});var ue=n(253);n.d(t,"chain",function(){return ue.a});var ce=n(147);n.d(t,"iteratee",function(){return ce.a});var fe=n(67);n.d(t,"partial",function(){return fe.a});var le=n(154);n.d(t,"bind",function(){return le.a});var he=n(254);n.d(t,"bindAll",function(){return he.a});var de=n(255);n.d(t,"memoize",function(){return de.a});var pe=n(155);n.d(t,"delay",function(){return pe.a});var ve=n(256);n.d(t,"defer",function(){return ve.a});var me=n(257);n.d(t,"throttle",function(){return me.a});var ge=n(258);n.d(t,"debounce",function(){return ge.a});var ye=n(259);n.d(t,"wrap",function(){return ye.a});var be=n(102);n.d(t,"negate",function(){return be.a});var _e=n(260);n.d(t,"compose",function(){return _e.a});var we=n(261);n.d(t,"after",function(){return we.a});var Ee=n(156);n.d(t,"before",function(){return Ee.a});var Oe=n(262);n.d(t,"once",function(){return Oe.a});var Te=n(157);n.d(t,"findKey",function(){return Te.a});var Se=n(103);n.d(t,"findIndex",function(){return Se.a});var Ae=n(159);n.d(t,"findLastIndex",function(){return Ae.a});var Ie=n(160);n.d(t,"sortedIndex",function(){return Ie.a});var je=n(161);n.d(t,"indexOf",function(){return je.a});var Ce=n(263);n.d(t,"lastIndexOf",function(){return Ce.a});var xe=n(163);n.d(t,"find",function(){return xe.a}),n.d(t,"detect",function(){return xe.a});var Ne=n(264);n.d(t,"findWhere",function(){return Ne.a});var Pe=n(31);n.d(t,"each",function(){return Pe.a}),n.d(t,"forEach",function(){return Pe.a});var Re=n(40);n.d(t,"map",function(){return Re.a}),n.d(t,"collect",function(){return Re.a});var Ue=n(265);n.d(t,"reduce",function(){return Ue.a}),n.d(t,"foldl",function(){return Ue.a}),n.d(t,"inject",function(){return Ue.a});var Le=n(266);n.d(t,"reduceRight",function(){return Le.a}),n.d(t,"foldr",function(){return Le.a});var ke=n(55);n.d(t,"filter",function(){return ke.a}),n.d(t,"select",function(){return ke.a});var Me=n(267);n.d(t,"reject",function(){return Me.a});var De=n(268);n.d(t,"every",function(){return De.a}),n.d(t,"all",function(){return De.a});var Fe=n(269);n.d(t,"some",function(){return Fe.a}),n.d(t,"any",function(){return Fe.a});var Ve=n(56);n.d(t,"contains",function(){return Ve.a}),n.d(t,"includes",function(){return Ve.a}),n.d(t,"include",function(){return Ve.a});var Be=n(270);n.d(t,"invoke",function(){return Be.a});var qe=n(104);n.d(t,"pluck",function(){return qe.a});var We=n(271);n.d(t,"where",function(){return We.a});var Ye=n(165);n.d(t,"max",function(){return Ye.a});var ze=n(272);n.d(t,"min",function(){return ze.a});var Qe=n(273);n.d(t,"shuffle",function(){return Qe.a});var Ge=n(166);n.d(t,"sample",function(){return Ge.a});var Ke=n(274);n.d(t,"sortBy",function(){return Ke.a});var Je=n(275);n.d(t,"groupBy",function(){return Je.a});var $e=n(276);n.d(t,"indexBy",function(){return $e.a});var He=n(277);n.d(t,"countBy",function(){return He.a});var Ze=n(278);n.d(t,"partition",function(){return Ze.a});var Xe=n(279);n.d(t,"toArray",function(){return Xe.a});var et=n(280);n.d(t,"size",function(){return et.a});var tt=n(167);n.d(t,"pick",function(){return tt.a});var nt=n(282);n.d(t,"omit",function(){return nt.a});var rt=n(283);n.d(t,"first",function(){return rt.a}),n.d(t,"head",function(){return rt.a}),n.d(t,"take",function(){return rt.a});var it=n(168);n.d(t,"initial",function(){return it.a});var ot=n(284);n.d(t,"last",function(){return ot.a});var at=n(169);n.d(t,"rest",function(){return at.a}),n.d(t,"tail",function(){return at.a}),n.d(t,"drop",function(){return at.a});var st=n(285);n.d(t,"compact",function(){return st.a});var ut=n(286);n.d(t,"flatten",function(){return ut.a});var ct=n(287);n.d(t,"without",function(){return ct.a});var ft=n(171);n.d(t,"uniq",function(){return ft.a}),n.d(t,"unique",function(){return ft.a});var lt=n(288);n.d(t,"union",function(){return lt.a});var ht=n(289);n.d(t,"intersection",function(){return ht.a});var dt=n(170);n.d(t,"difference",function(){return dt.a});var pt=n(172);n.d(t,"unzip",function(){return pt.a}),n.d(t,"transpose",function(){return pt.a});var vt=n(290);n.d(t,"zip",function(){return vt.a});var mt=n(291);n.d(t,"object",function(){return mt.a});var gt=n(292);n.d(t,"range",function(){return gt.a});var yt=n(293);n.d(t,"chunk",function(){return yt.a});var bt=n(294);n.d(t,"mixin",function(){return bt.a});var _t=n(295);n.d(t,"default",function(){return _t.a})},function(e,t,n){"use strict";var r=n(7);t.a=Object(r.a)("String")},function(e,t,n){"use strict";function r(e){return null!=e&&Object(o.a)(e.getInt8)&&Object(a.a)(e.buffer)}var i=n(7),o=n(17),a=n(130),s=n(51),u=Object(i.a)("DataView");t.a=s.a?r:u},function(e,t,n){"use strict";var r=n(7),i=n(26),o=Object(r.a)("Arguments");!function(){o(arguments)||(o=function(e){return Object(i.a)(e,"callee")})}(),t.a=o},function(e,t,n){"use strict";var r=n(135);t.a=Object(r.a)("byteLength")},function(e,t,n){"use strict";function r(e){var t=Object(i.a)(e);return function(n){if(null==n)return!1;var r=Object(a.a)(n);if(Object(i.a)(r))return!1;for(var u=0;u<t;u++)if(!Object(o.a)(n[e[u]]))return!1;return e!==l||!Object(o.a)(n[s])}}t.a=r,n.d(t,"b",function(){return f}),n.d(t,"d",function(){return l}),n.d(t,"c",function(){return h});var i=n(18),o=n(17),a=n(52),s="forEach",u=["clear","delete"],c=["get","has","set"],f=u.concat(s,c),l=u.concat(c),h=["add"].concat(u,s,"has")},function(e,t,n){"use strict";function r(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=e(o),s=a.length,u=0;u<s;u++){var c=a[u];t&&void 0!==n[c]||(n[c]=o[c])}return n}}t.a=r},function(e,t,n){"use strict";var r=n(96),i=n(6);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e,t){for(var n=t.length,r=0;r<n;r++){if(null==e)return;e=e[t[r]]}return n?e:void 0}t.a=r},function(e,t,n){"use strict";function r(e){return e}t.a=r},function(e,t,n){"use strict";function r(e){return e=Object(o.a)(e),function(t){return Object(i.a)(t,e)}}t.a=r;var i=n(98),o=n(53)},function(e,t,n){"use strict";t.a=Date.now||function(){return(new Date).getTime()}},function(e,t,n){"use strict";function r(e){return function(){return!e.apply(this,arguments)}}t.a=r},function(e,t,n){"use strict";var r=n(158);t.a=Object(r.a)(1)},function(e,t,n){"use strict";function r(e,t){return Object(i.a)(e,Object(o.a)(t))}t.a=r;var i=n(40),o=n(100)},function(e,t,n){e.exports={default:n(297),__esModule:!0}},function(e,t,n){t.f=n(8)},function(e,t,n){var r=n(5),i=n(1),o=n(45),a=n(106),s=n(20).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(114),i=n(87).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){e.exports={default:n(330),__esModule:!0}},function(e,t,n){"use strict";e.exports=n(363)},function(e,t,n){var r=n(22),i=n(84),o=n(28),a=n(60),s=n(367);e.exports=function(e,t){var n=1==e,u=2==e,c=3==e,f=4==e,l=6==e,h=5==e||l,d=t||s;return function(t,s,p){for(var v,m,g=o(t),y=i(g),b=r(s,p,3),_=a(y.length),w=0,E=n?d(t,_):u?d(t,0):void 0;_>w;w++)if((h||w in y)&&(v=y[w],m=b(v,w,g),e))if(n)E[w]=m;else if(m)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:E.push(v)}else if(f)return!1;return l?-1:c||f?f:E}}},function(e,t,n){e.exports=!n(16)&&!n(27)(function(){return 7!=Object.defineProperty(n(81)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(20),i=n(15),o=n(48);e.exports=n(16)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,u=0;s>u;)r.f(e,n=a[u++],t[n]);return e}},function(e,t,n){var r=n(24),i=n(25),o=n(214)(!1),a=n(85)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>u;)r(s,n=t[u++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var r=n(5).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(24),i=n(28),o=n(85)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var r=n(15);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){var r=n(35),i=n(8)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(15),i=n(46),o=n(8)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[o])?t:i(n)}},function(e,t,n){var r,i,o,a=n(22),s=n(219),u=n(115),c=n(81),f=n(5),l=f.process,h=f.setImmediate,d=f.clearImmediate,p=f.MessageChannel,v=f.Dispatch,m=0,g={},y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};h&&d||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return g[++m]=function(){s("function"==typeof e?e:Function(e),t)},r(m),m},d=function(e){delete g[e]},"process"==n(49)(l)?r=function(e){l.nextTick(a(y,e,1))}:v&&v.now?r=function(e){v.now(a(y,e,1))}:p?(i=new p,o=i.port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(e){f.postMessage(e+"","*")},f.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),e.exports={set:h,clear:d}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(15),i=n(9),o=n(89);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(5),i=n(1),o=n(20),a=n(16),s=n(8)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:r[e];a&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(8)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t,n){"use strict";function r(e){return void 0===e}t.a=r},function(e,t,n){"use strict";function r(e){return!0===e||!1===e||"[object Boolean]"===i.t.call(e)}t.a=r;var i=n(2)},function(e,t,n){"use strict";var r=n(7);t.a=Object(r.a)("Number")},function(e,t,n){"use strict";var r=n(7);t.a=Object(r.a)("Symbol")},function(e,t,n){"use strict";var r=n(7);t.a=Object(r.a)("ArrayBuffer")},function(e,t,n){"use strict";function r(e){return Object(o.a)(e)&&Object(i.g)(e)}t.a=r;var i=n(2),o=n(128)},function(e,t,n){"use strict";function r(e){return i.l?Object(i.l)(e)&&!Object(o.a)(e):Object(s.a)(e)&&u.test(i.t.call(e))}var i=n(2),o=n(92),a=n(133),s=n(232),u=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;t.a=i.r?r:Object(a.a)(!1)},function(e,t,n){"use strict";function r(e){return function(){return e}}t.a=r},function(e,t,n){"use strict";function r(e){return function(t){var n=e(t);return"number"==typeof n&&n>=0&&n<=i.b}}t.a=r;var i=n(2)},function(e,t,n){"use strict";function r(e){return function(t){return null==t?void 0:t[e]}}t.a=r},function(e,t,n){"use strict";function r(e){for(var t={},n=e.length,r=0;r<n;++r)t[e[r]]=!0;return{contains:function(e){return t[e]},push:function(n){return t[n]=!0,e.push(n)}}}function i(e,t){t=r(t);var n=o.n.length,i=e.constructor,u=Object(a.a)(i)&&i.prototype||o.c,c="constructor";for(Object(s.a)(e,c)&&!t.contains(c)&&t.push(c);n--;)(c=o.n[n])in e&&e[c]!==u[c]&&!t.contains(c)&&t.push(c)}t.a=i;var o=n(2),a=n(17),s=n(26)},function(e,t,n){"use strict";function r(e,t){var n=Object(i.a)(t),r=n.length;if(null==e)return!r;for(var o=Object(e),a=0;a<r;a++){var s=n[a];if(t[s]!==o[s]||!(s in o))return!1}return!0}t.a=r;var i=n(6)},function(e,t,n){"use strict";function r(e){for(var t={},n=Object(i.a)(e),r=0,o=n.length;r<o;r++)t[e[n[r]]]=n[r];return t}t.a=r;var i=n(6)},function(e,t,n){"use strict";function r(e){var t=[];for(var n in e)Object(i.a)(e[n])&&t.push(n);return t.sort()}t.a=r;var i=n(17)},function(e,t,n){"use strict";var r=n(96),i=n(52);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";var r=n(96),i=n(52);t.a=Object(r.a)(i.a,!0)},function(e,t,n){"use strict";function r(){return function(){}}function i(e){if(!Object(o.a)(e))return{};if(a.j)return Object(a.j)(e);var t=r();t.prototype=e;var n=new t;return t.prototype=null,n}t.a=i;var o=n(29),a=n(2)},function(e,t,n){"use strict";function r(e){return Object(i.a)(e)?Object(o.a)(e)?e.slice():Object(a.a)({},e):e}t.a=r;var i=n(29),o=n(30),a=n(140)},function(e,t,n){"use strict";function r(e,t,n){var r=Object(o.a)(e,Object(i.a)(t));return Object(a.a)(r)?n:r}t.a=r;var i=n(53),o=n(98),a=n(126)},function(e,t,n){"use strict";function r(e){return Object(o.a)(e)?e:[e]}t.a=r;var i=n(12),o=n(30);i.a.toPath=r},function(e,t,n){"use strict";function r(e,t,n){return null==e?i.a:Object(o.a)(e)?Object(f.a)(e,t,n):Object(a.a)(e)&&!Object(s.a)(e)?Object(u.a)(e):Object(c.a)(e)}t.a=r;var i=n(99),o=n(17),a=n(29),s=n(30),u=n(66),c=n(100),f=n(54)},function(e,t,n){"use strict";function r(e,t){return Object(o.a)(e,t,1/0)}t.a=r;var i=n(12),o=n(146);i.a.iteratee=r},function(e,t,n){"use strict";function r(){}t.a=r},function(e,t,n){"use strict";function r(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}t.a=r},function(e,t,n){"use strict";function r(e){var t=function(t){return e[t]},n="(?:"+Object(i.a)(e).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(o,t):e}}t.a=r;var i=n(6)},function(e,t,n){"use strict";t.a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"}},function(e,t,n){"use strict";var r=n(12);t.a=r.a.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g}},function(e,t,n){"use strict";function r(e,t,n,r,a){if(!(r instanceof t))return e.apply(n,a);var s=Object(i.a)(e.prototype),u=e.apply(s,a);return Object(o.a)(u)?u:s}t.a=r;var i=n(142),o=n(29)},function(e,t,n){"use strict";var r=n(11),i=n(17),o=n(153);t.a=Object(r.a)(function(e,t,n){if(!Object(i.a)(e))throw new TypeError("Bind must be called on a function");var a=Object(r.a)(function(r){return Object(o.a)(e,a,t,this,n.concat(r))});return a})},function(e,t,n){"use strict";var r=n(11);t.a=Object(r.a)(function(e,t,n){return setTimeout(function(){return e.apply(null,n)},t)})},function(e,t,n){"use strict";function r(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}t.a=r},function(e,t,n){"use strict";function r(e,t,n){t=Object(i.a)(t,n);for(var r,a=Object(o.a)(e),s=0,u=a.length;s<u;s++)if(r=a[s],t(e[r],r,e))return r}t.a=r;var i=n(10),o=n(6)},function(e,t,n){"use strict";function r(e){return function(t,n,r){n=Object(i.a)(n,r);for(var a=Object(o.a)(t),s=e>0?0:a-1;s>=0&&s<a;s+=e)if(n(t[s],s,t))return s;return-1}}t.a=r;var i=n(10),o=n(18)},function(e,t,n){"use strict";var r=n(158);t.a=Object(r.a)(-1)},function(e,t,n){"use strict";function r(e,t,n,r){n=Object(i.a)(n,r,1);for(var a=n(t),s=0,u=Object(o.a)(e);s<u;){var c=Math.floor((s+u)/2);n(e[c])<a?s=c+1:u=c}return s}t.a=r;var i=n(10),o=n(18)},function(e,t,n){"use strict";var r=n(160),i=n(103),o=n(162);t.a=Object(o.a)(1,i.a,r.a)},function(e,t,n){"use strict";function r(e,t,n){return function(r,s,u){var c=0,f=Object(i.a)(r);if("number"==typeof u)e>0?c=u>=0?u:Math.max(u+f,c):f=u>=0?Math.min(u+1,f):u+f+1;else if(n&&u&&f)return u=n(r,s),r[u]===s?u:-1;if(s!==s)return u=t(o.q.call(r,c,f),a.a),u>=0?u+c:-1;for(u=e>0?c:f-1;u>=0&&u<f;u+=e)if(r[u]===s)return u;return-1}}t.a=r;var i=n(18),o=n(2),a=n(131)},function(e,t,n){"use strict";function r(e,t,n){var r=Object(i.a)(e)?o.a:a.a,s=r(e,t,n);if(void 0!==s&&-1!==s)return e[s]}t.a=r;var i=n(13),o=n(103),a=n(157)},function(e,t,n){"use strict";function r(e){var t=function(t,n,r,a){var s=!Object(i.a)(t)&&Object(o.a)(t),u=(s||t).length,c=e>0?0:u-1;for(a||(r=t[s?s[c]:c],c+=e);c>=0&&c<u;c+=e){var f=s?s[c]:c;r=n(r,t[f],f,t)}return r};return function(e,n,r,i){var o=arguments.length>=3;return t(e,Object(a.a)(n,i,4),r,o)}}t.a=r;var i=n(13),o=n(6),a=n(54)},function(e,t,n){"use strict";function r(e,t,n){var r,u,c=-1/0,f=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=Object(i.a)(e)?e:Object(o.a)(e);for(var l=0,h=e.length;l<h;l++)null!=(r=e[l])&&r>c&&(c=r)}else t=Object(a.a)(t,n),Object(s.a)(e,function(e,n,r){((u=t(e,n,r))>f||u===-1/0&&c===-1/0)&&(c=e,f=u)});return c}t.a=r;var i=n(13),o=n(38),a=n(10),s=n(31)},function(e,t,n){"use strict";function r(e,t,n){if(null==t||n)return Object(i.a)(e)||(e=Object(a.a)(e)),e[Object(u.a)(e.length-1)];var r=Object(i.a)(e)?Object(o.a)(e):Object(a.a)(e),c=Object(s.a)(r);t=Math.max(Math.min(t,c),0);for(var f=c-1,l=0;l<t;l++){var h=Object(u.a)(l,f),d=r[l];r[l]=r[h],r[h]=d}return r.slice(0,t)}t.a=r;var i=n(13),o=n(143),a=n(38),s=n(18),u=n(149)},function(e,t,n){"use strict";var r=n(11),i=n(17),o=n(54),a=n(52),s=n(281),u=n(39);t.a=Object(r.a)(function(e,t){var n={},r=t[0];if(null==e)return n;Object(i.a)(r)?(t.length>1&&(r=Object(o.a)(r,t[1])),t=Object(a.a)(e)):(r=s.a,t=Object(u.a)(t,!1,!1),e=Object(e));for(var c=0,f=t.length;c<f;c++){var l=t[c],h=e[l];r(h,l,e)&&(n[l]=h)}return n})},function(e,t,n){"use strict";function r(e,t,n){return i.q.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}t.a=r;var i=n(2)},function(e,t,n){"use strict";function r(e,t,n){return i.q.call(e,null==t||n?1:t)}t.a=r;var i=n(2)},function(e,t,n){"use strict";var r=n(11),i=n(39),o=n(55),a=n(56);t.a=Object(r.a)(function(e,t){return t=Object(i.a)(t,!0,!0),Object(o.a)(e,function(e){return!Object(a.a)(t,e)})})},function(e,t,n){"use strict";function r(e,t,n,r){Object(i.a)(t)||(r=n,n=t,t=!1),null!=n&&(n=Object(o.a)(n,r));for(var u=[],c=[],f=0,l=Object(a.a)(e);f<l;f++){var h=e[f],d=n?n(h,f,e):h;t&&!n?(f&&c===d||u.push(h),c=d):n?Object(s.a)(c,d)||(c.push(d),u.push(h)):Object(s.a)(u,h)||u.push(h)}return u}t.a=r;var i=n(127),o=n(10),a=n(18),s=n(56)},function(e,t,n){"use strict";function r(e){for(var t=e&&Object(i.a)(e,o.a).length||0,n=Array(t),r=0;r<t;r++)n[r]=Object(a.a)(e,r);return n}t.a=r;var i=n(165),o=n(18),a=n(104)},function(e,t,n){"use strict";function r(e,t){return e._chain?Object(i.a)(t).chain():t}t.a=r;var i=n(12)},function(e,t,n){function r(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null),e=e||{};var a=e.random||(e.rng||i)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[r+s]=a[s];return t||o(a)}var i=n(299),o=n(300);e.exports=r},function(e,t,n){e.exports={default:n(303),__esModule:!0}},function(e,t,n){"use strict";e.exports="4.12.2"},function(e,t,n){"use strict";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(){this._events=new r,this._eventsCount=0}var a=Object.prototype.hasOwnProperty,s="~";Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),o.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)a.call(e,t)&&n.push(s?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},o.prototype.listeners=function(e,t){var n=s?s+e:e,r=this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},o.prototype.emit=function(e,t,n,r,i,o){var a=s?s+e:e;if(!this._events[a])return!1;var u,c,f=this._events[a],l=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),l){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,n),!0;case 4:return f.fn.call(f.context,t,n,r),!0;case 5:return f.fn.call(f.context,t,n,r,i),!0;case 6:return f.fn.call(f.context,t,n,r,i,o),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=arguments[c];f.fn.apply(f.context,u)}else{var h,d=f.length;for(c=0;c<d;c++)switch(f[c].once&&this.removeListener(e,f[c].fn,void 0,!0),l){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,t);break;case 3:f[c].fn.call(f[c].context,t,n);break;case 4:f[c].fn.call(f[c].context,t,n,r);break;default:if(!u)for(h=1,u=new Array(l-1);h<l;h++)u[h-1]=arguments[h];f[c].fn.apply(f[c].context,u)}}return!0},o.prototype.on=function(e,t,n){var r=new i(t,n||this),o=s?s+e:e;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],r]:this._events[o].push(r):(this._events[o]=r,this._eventsCount++),this},o.prototype.once=function(e,t,n){var r=new i(t,n||this,!0),o=s?s+e:e;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],r]:this._events[o].push(r):(this._events[o]=r,this._eventsCount++),this},o.prototype.removeListener=function(e,t,n,i){var o=s?s+e:e;if(!this._events[o])return this;if(!t)return 0==--this._eventsCount?this._events=new r:delete this._events[o],this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||n&&a.context!==n||(0==--this._eventsCount?this._events=new r:delete this._events[o]);else{for(var u=0,c=[],f=a.length;u<f;u++)(a[u].fn!==t||i&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[o]=1===c.length?c[0]:c:0==--this._eventsCount?this._events=new r:delete this._events[o]}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=s?s+e:e,this._events[t]&&(0==--this._eventsCount?this._events=new r:delete this._events[t])):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prototype.setMaxListeners=function(){return this},o.prefixed=s,o.EventEmitter=o,e.exports=o},function(e,t,n){"use strict";var r=n(3),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(42),a=o.getAdapter,s=["getItem","setItem","removeItem","clear"],u={get async(){return a("storage").async}};s.forEach(function(e){u[e+"Async"]=function(){var t=a("storage");return i.default.resolve(t[e].apply(t,arguments))},u[e]=function(){var t=a("storage");if(!t.async)return t[e].apply(t,arguments);var n=new Error("Synchronous API ["+e+"] is not available in this runtime.");throw n.code="SYNC_API_NOT_AVAILABLE",n}}),e.exports=u},function(e,t,n){"use strict";var r=n(21),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(178),a=n(41),s=t.removeAsync=o.removeItemAsync.bind(o),u=function(e,t){try{e=JSON.parse(e)}catch(e){return null}if(e){return e.expiredAt&&e.expiredAt<Date.now()?s(t).then(function(){return null}):e.value}return null};t.getAsync=function(e){return e="AV/"+a.applicationId+"/"+e,o.getItemAsync(e).then(function(t){return u(t,e)})},t.setAsync=function(e,t,n){var r={value:t};return"number"==typeof n&&(r.expiredAt=Date.now()+n),o.setItemAsync("AV/"+a.applicationId+"/"+e,(0,i.default)(r))}},function(e,t,n){e.exports={default:n(311),__esModule:!0}},function(e,t,n){"use strict";var r=n(5),i=n(24),o=n(16),a=n(4),s=n(83),u=n(44).KEY,c=n(27),f=n(86),l=n(50),h=n(61),d=n(8),p=n(106),v=n(107),m=n(312),g=n(182),y=n(15),b=n(9),_=n(28),w=n(25),E=n(82),O=n(47),T=n(59),S=n(313),A=n(74),I=n(72),j=n(20),C=n(48),x=A.f,N=j.f,P=S.f,R=r.Symbol,U=r.JSON,L=U&&U.stringify,k=d("_hidden"),M=d("toPrimitive"),D={}.propertyIsEnumerable,F=f("symbol-registry"),V=f("symbols"),B=f("op-symbols"),q=Object.prototype,W="function"==typeof R&&!!I.f,Y=r.QObject,z=!Y||!Y.prototype||!Y.prototype.findChild,Q=o&&c(function(){return 7!=T(N({},"a",{get:function(){return N(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=x(q,t);r&&delete q[t],N(e,t,n),r&&e!==q&&N(q,t,r)}:N,G=function(e){var t=V[e]=T(R.prototype);return t._k=e,t},K=W&&"symbol"==typeof R.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof R},J=function(e,t,n){return e===q&&J(B,t,n),y(e),t=E(t,!0),y(n),i(V,t)?(n.enumerable?(i(e,k)&&e[k][t]&&(e[k][t]=!1),n=T(n,{enumerable:O(0,!1)})):(i(e,k)||N(e,k,O(1,{})),e[k][t]=!0),Q(e,t,n)):N(e,t,n)},$=function(e,t){y(e);for(var n,r=m(t=w(t)),i=0,o=r.length;o>i;)J(e,n=r[i++],t[n]);return e},H=function(e,t){return void 0===t?T(e):$(T(e),t)},Z=function(e){var t=D.call(this,e=E(e,!0));return!(this===q&&i(V,e)&&!i(B,e))&&(!(t||!i(this,e)||!i(V,e)||i(this,k)&&this[k][e])||t)},X=function(e,t){if(e=w(e),t=E(t,!0),e!==q||!i(V,t)||i(B,t)){var n=x(e,t);return!n||!i(V,t)||i(e,k)&&e[k][t]||(n.enumerable=!0),n}},ee=function(e){for(var t,n=P(w(e)),r=[],o=0;n.length>o;)i(V,t=n[o++])||t==k||t==u||r.push(t);return r},te=function(e){for(var t,n=e===q,r=P(n?B:w(e)),o=[],a=0;r.length>a;)!i(V,t=r[a++])||n&&!i(q,t)||o.push(V[t]);return o};W||(R=function(){if(this instanceof R)throw TypeError("Symbol is not a constructor!");var e=h(arguments.length>0?arguments[0]:void 0),t=function(n){this===q&&t.call(B,n),i(this,k)&&i(this[k],e)&&(this[k][e]=!1),Q(this,e,O(1,n))};return o&&z&&Q(q,e,{configurable:!0,set:t}),G(e)},s(R.prototype,"toString",function(){return this._k}),A.f=X,j.f=J,n(108).f=S.f=ee,n(73).f=Z,I.f=te,o&&!n(45)&&s(q,"propertyIsEnumerable",Z,!0),p.f=function(e){return G(d(e))}),a(a.G+a.W+a.F*!W,{Symbol:R});for(var ne="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;ne.length>re;)d(ne[re++]);for(var ie=C(d.store),oe=0;ie.length>oe;)v(ie[oe++]);a(a.S+a.F*!W,"Symbol",{for:function(e){return i(F,e+="")?F[e]:F[e]=R(e)},keyFor:function(e){if(!K(e))throw TypeError(e+" is not a symbol!");for(var t in F)if(F[t]===e)return t},useSetter:function(){z=!0},useSimple:function(){z=!1}}),a(a.S+a.F*!W,"Object",{create:H,defineProperty:J,defineProperties:$,getOwnPropertyDescriptor:X,getOwnPropertyNames:ee,getOwnPropertySymbols:te});var ae=c(function(){I.f(1)});a(a.S+a.F*ae,"Object",{getOwnPropertySymbols:function(e){return I.f(_(e))}}),U&&a(a.S+a.F*(!W||c(function(){var e=R();return"[null]"!=L([e])||"{}"!=L({a:e})||"{}"!=L(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(b(t)||void 0!==e)&&!K(e))return g(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!K(t))return t}),r[1]=t,L.apply(U,r)}}),R.prototype[M]||n(23)(R.prototype,M,R.prototype.valueOf),l(R,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},function(e,t,n){var r=n(49);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){"use strict";var r;e.exports.timeout=function(e,t){var n,i=new r;return Promise.race([e,new Promise(function(e,r){n=setTimeout(function(){r(i)},t)})]).then(function(e){return clearTimeout(n),e},function(e){throw clearTimeout(n),e})};r=e.exports.TimeoutError=function(){Error.call(this),this.stack=Error().stack,this.message="Timeout"},r.prototype=Object.create(Error.prototype),r.prototype.name="TimeoutError"},function(e,t,n){e.exports={default:n(334),__esModule:!0}},function(e,t){var n={utf8:{stringToBytes:function(e){return n.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(n.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};e.exports=n},function(e,t,n){e.exports={default:n(343),__esModule:!0}},function(e,t,n){e.exports={default:n(346),__esModule:!0}},function(e,t,n){e.exports={default:n(364),__esModule:!0}},function(e,t,n){"use strict";var r=n(5),i=n(4),o=n(44),a=n(27),s=n(23),u=n(64),c=n(37),f=n(63),l=n(9),h=n(50),d=n(20).f,p=n(111)(0),v=n(16);e.exports=function(e,t,n,m,g,y){var b=r[e],_=b,w=g?"set":"add",E=_&&_.prototype,O={};return v&&"function"==typeof _&&(y||E.forEach&&!a(function(){(new _).entries().next()}))?(_=t(function(t,n){f(t,_,e,"_c"),t._c=new b,void 0!=n&&c(n,g,t[w],t)}),p("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in E&&(!y||"clear"!=e)&&s(_.prototype,e,function(n,r){if(f(this,_,e),!t&&y&&!l(n))return"get"==e&&void 0;var i=this._c[e](0===n?0:n,r);return t?this:i})}),y||d(_.prototype,"size",{get:function(){return this._c.size}})):(_=m.getConstructor(t,e,g,w),u(_.prototype,n),o.NEED=!0),h(_,e),O[e]=_,i(i.G+i.W+i.F,O),y||m.setStrong(_,e,g),_}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){"use strict";var r=n(4),i=n(46),o=n(22),a=n(37);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,s,u=arguments[1];return i(this),t=void 0!==u,t&&i(u),void 0==e?new this:(n=[],t?(r=0,s=o(u,arguments[2],2),a(e,!1,function(e){n.push(s(e,r++))})):a(e,!1,n.push,n),new this(n))}})}},function(e,t,n){"use strict";var r=n(16),i=n(48),o=n(72),a=n(73),s=n(28),u=n(84),c=Object.assign;e.exports=!c||n(27)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=c({},e)[n]||Object.keys(c({},t)).join("")!=r})?function(e,t){for(var n=s(e),c=arguments.length,f=1,l=o.f,h=a.f;c>f;)for(var d,p=u(arguments[f++]),v=l?i(p).concat(l(p)):i(p),m=v.length,g=0;m>g;)d=v[g++],r&&!h.call(p,d)||(n[d]=p[d]);return n}:c},function(e,t,n){"use strict";var r=n(20),i=n(47);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){e.exports={default:n(387),__esModule:!0}},function(e,t,n){e.exports={default:n(388),__esModule:!0}},function(e,t){function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=n},function(e,t){function n(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}e.exports=n},function(e,t,n){function r(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}var i=n(196);e.exports=r},function(e,t,n){function r(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n<t;){var a=i(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var i=n(412);e.exports=r},function(e,t,n){function r(e){return null==e?[]:i(e,o(e))}var i=n(414),o=n(416);e.exports=r},function(e,t,n){var r=n(202),i=r.Symbol;e.exports=i},function(e,t,n){var r=n(203),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(t,n(65))},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){function n(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}var r=9007199254740991;e.exports=n},function(e,t){function n(e,t){return function(n){return e(t(n))}}e.exports=n},function(e,t,n){"use strict";var r=n(209),i=n(362);e.exports=i(r)},function(e,t,n){"use strict";e.exports=n(210)},function(e,t,n){"use strict";var r=n(3),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(0),a=n(41);a._=o,a.version=n(176),a.Promise=i.default,a.localStorage=n(178),a.Cache=n(179),a.Error=n(33),n(305),n(316)(a),n(317)(a),n(318)(a),n(319)(a),n(320)(a),n(321)(a),n(342)(a),n(348)(a),n(349)(a),n(351)(a),n(352)(a),n(353)(a),n(354)(a),n(355)(a),n(356)(a),n(357)(a),n(358)(a),n(359)(a),a.Conversation=n(360),n(361),e.exports=a},function(e,t,n){n(58),n(34),n(36),n(218),n(222),n(223),e.exports=n(1).Promise},function(e,t,n){var r=n(78),i=n(79);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),u=r(n),c=s.length;return u<0||u>=c?e?"":void 0:(o=s.charCodeAt(u),o<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536)}}},function(e,t,n){"use strict";var r=n(59),i=n(47),o=n(50),a={};n(23)(a,n(8)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(25),i=n(60),o=n(215);e.exports=function(e){return function(t,n,a){var s,u=r(t),c=i(u.length),f=o(a,c);if(e&&n!=n){for(;c>f;)if((s=u[f++])!=s)return!0}else for(;c>f;f++)if((e||f in u)&&u[f]===n)return e||f||0;return!e&&-1}}},function(e,t,n){var r=n(78),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},function(e,t,n){"use strict";var r=n(217),i=n(117),o=n(35),a=n(25);e.exports=n(80)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t,n){"use strict";var r,i,o,a,s=n(45),u=n(5),c=n(22),f=n(62),l=n(4),h=n(9),d=n(46),p=n(63),v=n(37),m=n(120),g=n(121).set,y=n(220)(),b=n(89),_=n(122),w=n(221),E=n(123),O=u.TypeError,T=u.process,S=T&&T.versions,A=S&&S.v8||"",I=u.Promise,j="process"==f(T),C=function(){},x=i=b.f,N=!!function(){try{var e=I.resolve(1),t=(e.constructor={})[n(8)("species")]=function(e){e(C,C)};return(j||"function"==typeof PromiseRejectionEvent)&&e.then(C)instanceof t&&0!==A.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(e){}}(),P=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},R=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,i=1==e._s,o=0;n.length>o;)!function(t){var n,o,a,s=i?t.ok:t.fail,u=t.resolve,c=t.reject,f=t.domain;try{s?(i||(2==e._h&&k(e),e._h=1),!0===s?n=r:(f&&f.enter(),n=s(r),f&&(f.exit(),a=!0)),n===t.promise?c(O("Promise-chain cycle")):(o=P(n))?o.call(n,u,c):u(n)):c(r)}catch(e){f&&!a&&f.exit(),c(e)}}(n[o++]);e._c=[],e._n=!1,t&&!e._h&&U(e)})}},U=function(e){g.call(u,function(){var t,n,r,i=e._v,o=L(e);if(o&&(t=_(function(){j?T.emit("unhandledRejection",i,e):(n=u.onunhandledrejection)?n({promise:e,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=j||L(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},L=function(e){return 1!==e._h&&0===(e._a||e._c).length},k=function(e){g.call(u,function(){var t;j?T.emit("rejectionHandled",e):(t=u.onrejectionhandled)&&t({promise:e,reason:e._v})})},M=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),R(t,!0))},D=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw O("Promise can't be resolved itself");(t=P(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,c(D,r,1),c(M,r,1))}catch(e){M.call(r,e)}}):(n._v=e,n._s=1,R(n,!1))}catch(e){M.call({_w:n,_d:!1},e)}}};N||(I=function(e){p(this,I,"Promise","_h"),d(e),r.call(this);try{e(c(D,this,1),c(M,this,1))}catch(e){M.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(64)(I.prototype,{then:function(e,t){var n=x(m(this,I));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=j?T.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&R(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=c(D,e,1),this.reject=c(M,e,1)},b.f=x=function(e){return e===I||e===a?new o(e):i(e)}),l(l.G+l.W+l.F*!N,{Promise:I}),n(50)(I,"Promise"),n(124)("Promise"),a=n(1).Promise,l(l.S+l.F*!N,"Promise",{reject:function(e){var t=x(this);return(0,t.reject)(e),t.promise}}),l(l.S+l.F*(s||!N),"Promise",{resolve:function(e){return E(s&&this===a?I:this,e)}}),l(l.S+l.F*!(N&&n(125)(function(e){I.all(e).catch(C)})),"Promise",{all:function(e){var t=this,n=x(t),r=n.resolve,i=n.reject,o=_(function(){var n=[],o=0,a=1;v(e,!1,function(e){var s=o++,u=!1;n.push(void 0),a++,t.resolve(e).then(function(e){u||(u=!0,n[s]=e,--a||r(n))},i)}),--a||r(n)});return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=x(t),r=n.reject,i=_(function(){v(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(5),i=n(121).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(49)(a);e.exports=function(){var e,t,n,c=function(){var r,i;for(u&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(u)n=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var f=s.resolve(void 0);n=function(){f.then(c)}}else n=function(){i.call(r,c)};else{var l=!0,h=document.createTextNode("");new o(c).observe(h,{characterData:!0}),n=function(){h.data=l=!l}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(5),i=r.navigator;e.exports=i&&i.userAgent||""},function(e,t,n){"use strict";var r=n(4),i=n(1),o=n(5),a=n(120),s=n(123);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then(function(){return n})}:e,n?function(n){return s(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(4),i=n(89),o=n(122);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){"use strict";var r=n(90),i=Object(r.mixin)(r);i._=i,t.a=i},function(e,t,n){"use strict";function r(e){return null===e}t.a=r},function(e,t,n){"use strict";function r(e){return!(!e||1!==e.nodeType)}t.a=r},function(e,t,n){"use strict";var r=n(7);t.a=Object(r.a)("Date")},function(e,t,n){"use strict";var r=n(7);t.a=Object(r.a)("RegExp")},function(e,t,n){"use strict";var r=n(7);t.a=Object(r.a)("Error")},function(e,t,n){"use strict";var r=n(7);t.a=Object(r.a)("Object")},function(e,t,n){"use strict";function r(e){return!Object(o.a)(e)&&Object(i.f)(e)&&!isNaN(parseFloat(e))}t.a=r;var i=n(2),o=n(129)},function(e,t,n){"use strict";var r=n(134),i=n(94);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e){if(null==e)return!0;var t=Object(i.a)(e);return"number"==typeof t&&(Object(o.a)(e)||Object(a.a)(e)||Object(s.a)(e))?0===t:0===Object(i.a)(Object(u.a)(e))}t.a=r;var i=n(18),o=n(30),a=n(91),s=n(93),u=n(6)},function(e,t,n){"use strict";function r(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!==e)return t!==t;var o=typeof e;return("function"===o||"object"===o||"object"==typeof t)&&i(e,t,n,r)}function i(e,t,n,o){e instanceof a.a&&(e=e._wrapped),t instanceof a.a&&(t=t._wrapped);var g=s.t.call(e);if(g!==s.t.call(t))return!1;if(l.a&&"[object Object]"==g&&Object(h.a)(e)){if(!Object(h.a)(t))return!1;g=m}switch(g){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return s.d.valueOf.call(e)===s.d.valueOf.call(t);case"[object ArrayBuffer]":case m:return i(Object(v.a)(e),Object(v.a)(t),n,o)}var y="[object Array]"===g;if(!y&&Object(c.a)(e)){if(Object(u.a)(e)!==Object(u.a)(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)return!0;y=!0}if(!y){if("object"!=typeof e||"object"!=typeof t)return!1;var b=e.constructor,_=t.constructor;if(b!==_&&!(Object(f.a)(b)&&b instanceof b&&Object(f.a)(_)&&_ instanceof _)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],o=o||[];for(var w=n.length;w--;)if(n[w]===e)return o[w]===t;if(n.push(e),o.push(t),y){if((w=e.length)!==t.length)return!1;for(;w--;)if(!r(e[w],t[w],n,o))return!1}else{var E,O=Object(d.a)(e);if(w=O.length,Object(d.a)(t).length!==w)return!1;for(;w--;)if(E=O[w],!Object(p.a)(t,E)||!r(e[E],t[E],n,o))return!1}return n.pop(),o.pop(),!0}function o(e,t){return r(e,t)}t.a=o;var a=n(12),s=n(2),u=n(94),c=n(132),f=n(17),l=n(51),h=n(92),d=n(6),p=n(26),v=n(235),m="[object DataView]"},function(e,t,n){"use strict";function r(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,Object(i.a)(e))}t.a=r;var i=n(94)},function(e,t,n){"use strict";var r=n(7),i=n(51),o=n(95);t.a=i.b?Object(o.a)(o.b):Object(r.a)("Map")},function(e,t,n){"use strict";var r=n(7),i=n(51),o=n(95);t.a=i.b?Object(o.a)(o.d):Object(r.a)("WeakMap")},function(e,t,n){"use strict";var r=n(7),i=n(51),o=n(95);t.a=i.b?Object(o.a)(o.c):Object(r.a)("Set")},function(e,t,n){"use strict";var r=n(7);t.a=Object(r.a)("WeakSet")},function(e,t,n){"use strict";function r(e){for(var t=Object(i.a)(e),n=t.length,r=Array(n),o=0;o<n;o++)r[o]=[t[o],e[t[o]]];return r}t.a=r;var i=n(6)},function(e,t,n){"use strict";function r(e,t){var n=Object(i.a)(e);return t&&Object(o.a)(n,t),n}t.a=r;var i=n(142),o=n(97)},function(e,t,n){"use strict";function r(e,t){return t(e),e}t.a=r},function(e,t,n){"use strict";function r(e,t){t=Object(o.a)(t);for(var n=t.length,r=0;r<n;r++){var a=t[r];if(!Object(i.a)(e,a))return!1;e=e[a]}return!!n}t.a=r;var i=n(26),o=n(53)},function(e,t,n){"use strict";function r(e,t,n){t=Object(i.a)(t,n);for(var r=Object(o.a)(e),a=r.length,s={},u=0;u<a;u++){var c=r[u];s[c]=t(e[c],c,e)}return s}t.a=r;var i=n(10),o=n(6)},function(e,t,n){"use strict";function r(e){return null==e?i.a:function(t){return Object(o.a)(e,t)}}t.a=r;var i=n(148),o=n(144)},function(e,t,n){"use strict";function r(e,t,n){var r=Array(Math.max(0,e));t=Object(i.a)(t,n,1);for(var o=0;o<e;o++)r[o]=t(o);return r}t.a=r;var i=n(54)},function(e,t,n){"use strict";var r=n(150),i=n(151);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";var r=n(150),i=n(249);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";var r=n(138),i=n(151);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e){return"\\"+u[e]}function i(e,t,n){!t&&n&&(t=n),t=Object(o.a)({},t,a.a.templateSettings);var i=RegExp([(t.escape||s).source,(t.interpolate||s).source,(t.evaluate||s).source].join("|")+"|$","g"),u=0,l="__p+='";e.replace(i,function(t,n,i,o,a){return l+=e.slice(u,a).replace(c,r),u=a+t.length,n?l+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?l+="'+\n((__t=("+i+"))==null?'':__t)+\n'":o&&(l+="';\n"+o+"\n__p+='"),t}),l+="';\n";var h=t.variable;if(h){if(!f.test(h))throw new Error(h)}else l="with(obj||{}){\n"+l+"}\n",h="obj";l="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+l+"return __p;\n";var d;try{d=new Function(h,"_",l)}catch(e){throw e.source=l,e}var p=function(e){return d.call(this,e,a.a)};return p.source="function("+h+"){\n"+l+"}",p}t.a=i;var o=n(141),a=n(12),s=(n(152),/(.)^/),u={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},c=/\\|'|\r|\n|\u2028|\u2029/g,f=/^\s*(\w|\$)+\s*$/},function(e,t,n){"use strict";function r(e,t,n){t=Object(o.a)(t);var r=t.length;if(!r)return Object(i.a)(n)?n.call(e):n;for(var a=0;a<r;a++){var s=null==e?void 0:e[t[a]];void 0===s&&(s=n,a=r),e=Object(i.a)(s)?s.call(e):s}return e}t.a=r;var i=n(17),o=n(53)},function(e,t,n){"use strict";function r(e){var t=++i+"";return e?e+t:t}t.a=r;var i=0},function(e,t,n){"use strict";function r(e){var t=Object(i.a)(e);return t._chain=!0,t}t.a=r;var i=n(12)},function(e,t,n){"use strict";var r=n(11),i=n(39),o=n(154);t.a=Object(r.a)(function(e,t){t=Object(i.a)(t,!1,!1);var n=t.length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=Object(o.a)(e[r],e)}return e})},function(e,t,n){"use strict";function r(e,t){var n=function(r){var o=n.cache,a=""+(t?t.apply(this,arguments):r);return Object(i.a)(o,a)||(o[a]=e.apply(this,arguments)),o[a]};return n.cache={},n}t.a=r;var i=n(26)},function(e,t,n){"use strict";var r=n(67),i=n(155),o=n(12);t.a=Object(r.a)(i.a,o.a,1)},function(e,t,n){"use strict";function r(e,t,n){var r,o,a,s,u=0;n||(n={});var c=function(){u=!1===n.leading?0:Object(i.a)(),r=null,s=e.apply(o,a),r||(o=a=null)},f=function(){var f=Object(i.a)();u||!1!==n.leading||(u=f);var l=t-(f-u);return o=this,a=arguments,l<=0||l>t?(r&&(clearTimeout(r),r=null),u=f,s=e.apply(o,a),r||(o=a=null)):r||!1===n.trailing||(r=setTimeout(c,l)),s};return f.cancel=function(){clearTimeout(r),u=0,r=o=a=null},f}t.a=r;var i=n(101)},function(e,t,n){"use strict";function r(e,t,n){var r,a,s,u,c,f=function(){var i=Object(o.a)()-a;t>i?r=setTimeout(f,t-i):(r=null,n||(u=e.apply(c,s)),r||(s=c=null))},l=Object(i.a)(function(i){return c=this,s=i,a=Object(o.a)(),r||(r=setTimeout(f,t),n&&(u=e.apply(c,s))),u});return l.cancel=function(){clearTimeout(r),r=s=c=null},l}t.a=r;var i=n(11),o=n(101)},function(e,t,n){"use strict";function r(e,t){return Object(i.a)(t,e)}t.a=r;var i=n(67)},function(e,t,n){"use strict";function r(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}}t.a=r},function(e,t,n){"use strict";function r(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}t.a=r},function(e,t,n){"use strict";var r=n(67),i=n(156);t.a=Object(r.a)(i.a,2)},function(e,t,n){"use strict";var r=n(159),i=n(162);t.a=Object(i.a)(-1,r.a)},function(e,t,n){"use strict";function r(e,t){return Object(i.a)(e,Object(o.a)(t))}t.a=r;var i=n(163),o=n(66)},function(e,t,n){"use strict";var r=n(164);t.a=Object(r.a)(1)},function(e,t,n){"use strict";var r=n(164);t.a=Object(r.a)(-1)},function(e,t,n){"use strict";function r(e,t,n){return Object(i.a)(e,Object(o.a)(Object(a.a)(t)),n)}t.a=r;var i=n(55),o=n(102),a=n(10)},function(e,t,n){"use strict";function r(e,t,n){t=Object(i.a)(t,n);for(var r=!Object(o.a)(e)&&Object(a.a)(e),s=(r||e).length,u=0;u<s;u++){var c=r?r[u]:u;if(!t(e[c],c,e))return!1}return!0}t.a=r;var i=n(10),o=n(13),a=n(6)},function(e,t,n){"use strict";function r(e,t,n){t=Object(i.a)(t,n);for(var r=!Object(o.a)(e)&&Object(a.a)(e),s=(r||e).length,u=0;u<s;u++){var c=r?r[u]:u;if(t(e[c],c,e))return!0}return!1}t.a=r;var i=n(10),o=n(13),a=n(6)},function(e,t,n){"use strict";var r=n(11),i=n(17),o=n(40),a=n(98),s=n(53);t.a=Object(r.a)(function(e,t,n){var r,u;return Object(i.a)(t)?u=t:(t=Object(s.a)(t),r=t.slice(0,-1),t=t[t.length-1]),Object(o.a)(e,function(e){var i=u;if(!i){if(r&&r.length&&(e=Object(a.a)(e,r)),null==e)return;i=e[t]}return null==i?i:i.apply(e,n)})})},function(e,t,n){"use strict";function r(e,t){return Object(i.a)(e,Object(o.a)(t))}t.a=r;var i=n(55),o=n(66)},function(e,t,n){"use strict";function r(e,t,n){var r,u,c=1/0,f=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e){e=Object(i.a)(e)?e:Object(o.a)(e);for(var l=0,h=e.length;l<h;l++)null!=(r=e[l])&&r<c&&(c=r)}else t=Object(a.a)(t,n),Object(s.a)(e,function(e,n,r){((u=t(e,n,r))<f||u===1/0&&c===1/0)&&(c=e,f=u)});return c}t.a=r;var i=n(13),o=n(38),a=n(10),s=n(31)},function(e,t,n){"use strict";function r(e){return Object(i.a)(e,1/0)}t.a=r;var i=n(166)},function(e,t,n){"use strict";function r(e,t,n){var r=0;return t=Object(i.a)(t,n),Object(o.a)(Object(a.a)(e,function(e,n,i){return{value:e,index:r++,criteria:t(e,n,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return e.index-t.index}),"value")}t.a=r;var i=n(10),o=n(104),a=n(40)},function(e,t,n){"use strict";var r=n(68),i=n(26);t.a=Object(r.a)(function(e,t,n){Object(i.a)(e,n)?e[n].push(t):e[n]=[t]})},function(e,t,n){"use strict";var r=n(68);t.a=Object(r.a)(function(e,t,n){e[n]=t})},function(e,t,n){"use strict";var r=n(68),i=n(26);t.a=Object(r.a)(function(e,t,n){Object(i.a)(e,n)?e[n]++:e[n]=1})},function(e,t,n){"use strict";var r=n(68);t.a=Object(r.a)(function(e,t,n){e[n?0:1].push(t)},!0)},function(e,t,n){"use strict";function r(e){return e?Object(i.a)(e)?o.q.call(e):Object(a.a)(e)?e.match(l):Object(s.a)(e)?Object(u.a)(e,c.a):Object(f.a)(e):[]}t.a=r;var i=n(30),o=n(2),a=n(91),s=n(13),u=n(40),c=n(99),f=n(38),l=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g},function(e,t,n){"use strict";function r(e){return null==e?0:Object(i.a)(e)?e.length:Object(o.a)(e).length}t.a=r;var i=n(13),o=n(6)},function(e,t,n){"use strict";function r(e,t,n){return t in n}t.a=r},function(e,t,n){"use strict";var r=n(11),i=n(17),o=n(102),a=n(40),s=n(39),u=n(56),c=n(167);t.a=Object(r.a)(function(e,t){var n,r=t[0];return Object(i.a)(r)?(r=Object(o.a)(r),t.length>1&&(n=t[1])):(t=Object(a.a)(Object(s.a)(t,!1,!1),String),r=function(e,n){return!Object(u.a)(t,n)}),Object(c.a)(e,r,n)})},function(e,t,n){"use strict";function r(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:Object(i.a)(e,e.length-t)}t.a=r;var i=n(168)},function(e,t,n){"use strict";function r(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[e.length-1]:Object(i.a)(e,Math.max(0,e.length-t))}t.a=r;var i=n(169)},function(e,t,n){"use strict";function r(e){return Object(i.a)(e,Boolean)}t.a=r;var i=n(55)},function(e,t,n){"use strict";function r(e,t){return Object(i.a)(e,t,!1)}t.a=r;var i=n(39)},function(e,t,n){"use strict";var r=n(11),i=n(170);t.a=Object(r.a)(function(e,t){return Object(i.a)(e,t)})},function(e,t,n){"use strict";var r=n(11),i=n(171),o=n(39);t.a=Object(r.a)(function(e){return Object(i.a)(Object(o.a)(e,!0,!0))})},function(e,t,n){"use strict";function r(e){for(var t=[],n=arguments.length,r=0,a=Object(i.a)(e);r<a;r++){var s=e[r];if(!Object(o.a)(t,s)){var u;for(u=1;u<n&&Object(o.a)(arguments[u],s);u++);u===n&&t.push(s)}}return t}t.a=r;var i=n(18),o=n(56)},function(e,t,n){"use strict";var r=n(11),i=n(172);t.a=Object(r.a)(i.a)},function(e,t,n){"use strict";function r(e,t){for(var n={},r=0,o=Object(i.a)(e);r<o;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n}t.a=r;var i=n(18)},function(e,t,n){"use strict";function r(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),o=0;o<r;o++,e+=n)i[o]=e;return i}t.a=r},function(e,t,n){"use strict";function r(e,t){if(null==t||t<1)return[];for(var n=[],r=0,o=e.length;r<o;)n.push(i.q.call(e,r,r+=t));return n}t.a=r;var i=n(2)},function(e,t,n){"use strict";function r(e){return Object(o.a)(Object(a.a)(e),function(t){var n=i.a[t]=e[t];i.a.prototype[t]=function(){var e=[this._wrapped];return s.o.apply(e,arguments),Object(u.a)(this,n.apply(i.a,e))}}),i.a}t.a=r;var i=n(12),o=n(31),a=n(139),s=n(2),u=n(173)},function(e,t,n){"use strict";var r=n(12),i=n(31),o=n(2),a=n(173);Object(i.a)(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=o.a[e];r.a.prototype[e]=function(){var n=this._wrapped;return null!=n&&(t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0]),Object(a.a)(this,n)}}),Object(i.a)(["concat","join","slice"],function(e){var t=o.a[e];r.a.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),Object(a.a)(this,e)}}),t.a=r.a},function(e,t,n){var r=n(1),i=r.JSON||(r.JSON={stringify:JSON.stringify});e.exports=function(e){return i.stringify.apply(i,arguments)}},function(e,t,n){n(298),e.exports=n(1).Object.keys},function(e,t,n){var r=n(28),i=n(48);n(69)("keys",function(){return function(e){return i(r(e))}})},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var i=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}},function(e,t){function n(e,t){var n=t||0,i=r;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}for(var r=[],i=0;i<256;++i)r[i]=(i+256).toString(16).substr(1);e.exports=n},function(e,t,n){"use strict";function r(e){function t(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return r.colors[Math.abs(t)%r.colors.length]}function r(e){function n(){if(n.enabled){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var o=n,s=Number(new Date),u=s-(a||s);o.diff=u,o.prev=a,o.curr=s,a=s,t[0]=r.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");var c=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,function(e,n){if("%%"===e)return e;c++;var i=r.formatters[n];if("function"==typeof i){var a=t[c];e=i.call(o,a),t.splice(c,1),c--}return e}),r.formatArgs.call(o,t);(o.log||r.log).apply(o,t)}}var a;return n.namespace=e,n.enabled=r.enabled(e),n.useColors=r.useColors(),n.color=t(e),n.destroy=i,n.extend=o,"function"==typeof r.init&&r.init(n),r.instances.push(n),n}function i(){var e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function o(e,t){return r(this.namespace+(void 0===t?":":t)+e)}function a(e){r.save(e),r.names=[],r.skips=[];var t,n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(t=0;t<i;t++)n[t]&&(e=n[t].replace(/\*/g,".*?"),"-"===e[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")));for(t=0;t<r.instances.length;t++){var o=r.instances[t];o.enabled=r.enabled(o.namespace)}}function s(){r.enable("")}function u(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}return r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=a,r.enabled=u,r.humanize=n(302),Object.keys(e).forEach(function(t){r[t]=e[t]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=t,r.enable(r.load()),r}e.exports=r},function(e,t){function n(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*l;case"weeks":case"week":case"w":return n*f;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*u;case"minutes":case"minute":case"mins":case"min":case"m":return n*s;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(e){var t=Math.abs(e);return t>=c?Math.round(e/c)+"d":t>=u?Math.round(e/u)+"h":t>=s?Math.round(e/s)+"m":t>=a?Math.round(e/a)+"s":e+"ms"}function i(e){var t=Math.abs(e);return t>=c?o(e,t,c,"day"):t>=u?o(e,t,u,"hour"):t>=s?o(e,t,s,"minute"):t>=a?o(e,t,a,"second"):e+" ms"}function o(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}var a=1e3,s=60*a,u=60*s,c=24*u,f=7*c,l=365.25*c;e.exports=function(e,t){t=t||{};var o=typeof e;if("string"===o&&e.length>0)return n(e);if("number"===o&&isFinite(e))return t.long?i(e):r(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,n){n(304),e.exports=n(1).Object.getPrototypeOf},function(e,t,n){var r=n(28),i=n(116);n(69)("getPrototypeOf",function(){return function(e){return i(r(e))}})},function(e,t,n){"use strict";function r(e){if(p(e))return{};var t=e.slice(0,8).toLowerCase(),n="lncldglobal.com";return{push:"https://"+t+".push."+n,stats:"https://"+t+".stats."+n,engine:"https://"+t+".engine."+n,api:"https://"+t+".api."+n,rtm:"https://"+t+".rtm."+n}}var i=n(70),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(41),s=n(308),u=n(19),c=u.isNullOrUndefined,f=n(0),l=f.extend,h=f.isObject,d=f.isEmpty,p=function(e){return"-MdYXbMMI"!==e.slice(-9)},v=function(e){return{push:e,stats:e,engine:e,api:e,rtm:e}},m=!1,g=!1;a.init=function(e){if(!h(e))return a.init({appId:e,appKey:arguments.length<=1?void 0:arguments[1],masterKey:arguments.length<=2?void 0:arguments[2]});var t=e.appId,n=e.appKey,i=e.masterKey,o=e.hookKey,u=e.serverURL,f=e.serverURLs,y=void 0===f?u:f,b=e.disableCurrentUser,_=e.production,w=e.realtime;if(g&&console.warn("Initializing LeanCloud Storage SDK which has already been initialized. Reinitializing the SDK might cause problems like unexpected cross-app data writing and invalid relations."),!t)throw new TypeError("appId must be a string");if(!n)throw new TypeError("appKey must be a string");if(i&&console.warn("MasterKey is not supposed to be used at client side."),p(t)&&!y&&d(a._config.serverURLs))throw new TypeError("serverURL option is required for apps from CN region");t!==a._config.applicationId?(a._config.masterKey=i,a._config.hookKey=o):(i&&(a._config.masterKey=i),o&&(a._config.hookKey=o)),a._config.applicationId=t,a._config.applicationKey=n,c(_)||a.setProduction(_),void 0!==b&&(a._config.disableCurrentUser=b);var E=m||void 0!==y;if(E||(a._appRouter=new s(a)),a._setServerURLs(l({},r(t),a._config.serverURLs,"string"==typeof y?v(y):y),E),w)a._config.realtime=w;else if(a._sharedConfig.liveQueryRealtime){var O=a._config.serverURLs,T=O.api,S=O.rtm;a._config.realtime=new a._sharedConfig.liveQueryRealtime({appId:t,appKey:n,server:{api:T,RTMRouter:S}})}g=!0},a.setProduction=function(e){c(e)?a._config.production=null:a._config.production=e?1:0},a._setServerURLs=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"string"!=typeof e?l(a._config.serverURLs,e):a._config.serverURLs=v(e),t&&(a._appRouter?a._appRouter.disable():m=!0)},a.setServerURL=function(e){return a._setServerURLs(e)},a.setServerURLs=a.setServerURL,a.keepErrorRawMessage=function(e){a._sharedConfig.keepErrorRawMessage=e},a.setRequestTimeout=function(e){a._config.requestTimeout=e},a.initialize=a.init,["applicationId","applicationKey","masterKey","hookKey"].forEach(function(e){return(0,o.default)(a,e,{get:function(){return a._config[e]},set:function(t){a._config[e]=t}})})},function(e,t,n){n(307);var r=n(1).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){var r=n(4);r(r.S+r.F*!n(16),"Object",{defineProperty:n(20).f})},function(e,t,n){"use strict";function r(e){var t=this;this.AV=e,this.lockedUntil=0,o.getAsync("serverURLs").then(function(e){if(!t.disabled){if(!e)return t.lock(0);var n=e.serverURLs,r=e.lockedUntil;t.AV._setServerURLs(n,!1),t.lockedUntil=r}}).catch(function(){return t.lock(0)})}var i=n(71),o=n(179);r.prototype.disable=function(){this.disabled=!0},r.prototype.lock=function(e){this.lockedUntil=Date.now()+e},r.prototype.refresh=function(){var e=this;if(!(this.disabled||Date.now()<this.lockedUntil)){this.lock(10);return i({method:"get",url:"https://app-router.com/2/route",query:{appId:this.AV.applicationId}}).then(function(t){if(!e.disabled){var n=t.ttl;if(!n)throw new Error("missing ttl");n*=1e3;var r={push:"https://"+t.push_server,stats:"https://"+t.stats_server,engine:"https://"+t.engine_server,api:"https://"+t.api_server};return e.AV._setServerURLs(r,!1),e.lock(n),o.setAsync("serverURLs",{serverURLs:r,lockedUntil:e.lockedUntil},n)}}).catch(function(t){console.warn("refresh server URLs failed: "+t.message),e.lock(600)})}},e.exports=r},function(e,t,n){e.exports={default:n(310),__esModule:!0}},function(e,t,n){n(34),n(36),e.exports=n(106).f("iterator")},function(e,t,n){n(181),n(58),n(314),n(315),e.exports=n(1).Symbol},function(e,t,n){var r=n(48),i=n(72),o=n(73);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,s=n(e),u=o.f,c=0;s.length>c;)u.call(e,a=s[c++])&&t.push(a);return t}},function(e,t,n){var r=n(25),i=n(108).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch(e){return a.slice()}};e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?s(e):i(r(e))}},function(e,t,n){n(107)("asyncIterator")},function(e,t,n){n(107)("observable")},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){var t=/\s+/,n=Array.prototype.slice;e.Events={on:function(e,n,r){var i,o,a,s,u;if(!n)return this;for(e=e.split(t),i=this._callbacks||(this._callbacks={}),o=e.shift();o;)u=i[o],a=u?u.tail:{},a.next=s={},a.context=r,a.callback=n,i[o]={tail:s,next:u?u.next:a},o=e.shift();return this},off:function(e,n,i){var o,a,s,u,c,f;if(a=this._callbacks){if(!(e||n||i))return delete this._callbacks,this;for(e=e?e.split(t):r.keys(a),o=e.shift();o;)if(s=a[o],delete a[o],s&&(n||i)){for(u=s.tail,s=s.next;s!==u;)c=s.callback,f=s.context,(n&&c!==n||i&&f!==i)&&this.on(o,c,f),s=s.next;o=e.shift()}return this}},trigger:function(e){var r,i,o,a,s,u,c;if(!(o=this._callbacks))return this;for(u=o.all,e=e.split(t),c=n.call(arguments,1),r=e.shift();r;){if(i=o[r])for(a=i.tail;(i=i.next)!==a;)i.callback.apply(i.context||this,c);if(i=u)for(a=i.tail,s=[r].concat(c);(i=i.next)!==a;)i.callback.apply(i.context||this,s);r=e.shift()}return this}},e.Events.bind=e.Events.on,e.Events.unbind=e.Events.off}},function(e,t,n){"use strict";var r=n(3),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(0);e.exports=function(e){e.GeoPoint=function(t,n){o.isArray(t)?(e.GeoPoint._validate(t[0],t[1]),this.latitude=t[0],this.longitude=t[1]):o.isObject(t)?(e.GeoPoint._validate(t.latitude,t.longitude),this.latitude=t.latitude,this.longitude=t.longitude):o.isNumber(t)&&o.isNumber(n)?(e.GeoPoint._validate(t,n),this.latitude=t,this.longitude=n):(this.latitude=0,this.longitude=0);var r=this;this.__defineGetter__&&this.__defineSetter__&&(this._latitude=this.latitude,this._longitude=this.longitude,this.__defineGetter__("latitude",function(){return r._latitude}),this.__defineGetter__("longitude",function(){return r._longitude}),this.__defineSetter__("latitude",function(t){e.GeoPoint._validate(t,r.longitude),r._latitude=t}),this.__defineSetter__("longitude",function(t){e.GeoPoint._validate(r.latitude,t),r._longitude=t}))},e.GeoPoint._validate=function(e,t){if(e<-90)throw new Error("AV.GeoPoint latitude "+e+" < -90.0.");if(e>90)throw new Error("AV.GeoPoint latitude "+e+" > 90.0.");if(t<-180)throw new Error("AV.GeoPoint longitude "+t+" < -180.0.");if(t>180)throw new Error("AV.GeoPoint longitude "+t+" > 180.0.")},e.GeoPoint.current=function(){return new i.default(function(t,n){navigator.geolocation.getCurrentPosition(function(n){t(new e.GeoPoint({latitude:n.coords.latitude,longitude:n.coords.longitude}))},n)})},o.extend(e.GeoPoint.prototype,{toJSON:function(){return e.GeoPoint._validate(this.latitude,this.longitude),{__type:"GeoPoint",latitude:this.latitude,longitude:this.longitude}},radiansTo:function(e){var t=Math.PI/180,n=this.latitude*t,r=this.longitude*t,i=e.latitude*t,o=e.longitude*t,a=n-i,s=r-o,u=Math.sin(a/2),c=Math.sin(s/2),f=u*u+Math.cos(n)*Math.cos(i)*c*c;return f=Math.min(1,f),2*Math.asin(Math.sqrt(f))},kilometersTo:function(e){return 6371*this.radiansTo(e)},milesTo:function(e){return 3958.8*this.radiansTo(e)}})}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){e.ACL=function(t){var n=this;if(n.permissionsById={},r.isObject(t))if(t instanceof e.User)n.setReadAccess(t,!0),n.setWriteAccess(t,!0);else{if(r.isFunction(t))throw new Error("AV.ACL() called with a function. Did you forget ()?");e._objectEach(t,function(t,i){if(!r.isString(i))throw new Error("Tried to create an ACL with an invalid userId.");n.permissionsById[i]={},e._objectEach(t,function(e,t){if("read"!==t&&"write"!==t)throw new Error("Tried to create an ACL with an invalid permission type.");if(!r.isBoolean(e))throw new Error("Tried to create an ACL with an invalid permission value.");n.permissionsById[i][t]=e})})}},e.ACL.prototype.toJSON=function(){return r.clone(this.permissionsById)},e.ACL.prototype._setAccess=function(t,n,i){if(n instanceof e.User?n=n.id:n instanceof e.Role&&(n="role:"+n.getName()),!r.isString(n))throw new Error("userId must be a string.");if(!r.isBoolean(i))throw new Error("allowed must be either true or false.");var o=this.permissionsById[n];if(!o){if(!i)return;o={},this.permissionsById[n]=o}i?this.permissionsById[n][t]=!0:(delete o[t],r.isEmpty(o)&&delete this.permissionsById[n])},e.ACL.prototype._getAccess=function(t,n){n instanceof e.User?n=n.id:n instanceof e.Role&&(n="role:"+n.getName());var r=this.permissionsById[n];return!!r&&!!r[t]},e.ACL.prototype.setReadAccess=function(e,t){this._setAccess("read",e,t)},e.ACL.prototype.getReadAccess=function(e){return this._getAccess("read",e)},e.ACL.prototype.setWriteAccess=function(e,t){this._setAccess("write",e,t)},e.ACL.prototype.getWriteAccess=function(e){return this._getAccess("write",e)},e.ACL.prototype.setPublicReadAccess=function(e){this.setReadAccess("*",e)},e.ACL.prototype.getPublicReadAccess=function(){return this.getReadAccess("*")},e.ACL.prototype.setPublicWriteAccess=function(e){this.setWriteAccess("*",e)},e.ACL.prototype.getPublicWriteAccess=function(){return this.getWriteAccess("*")},e.ACL.prototype.getRoleReadAccess=function(t){if(t instanceof e.Role&&(t=t.getName()),r.isString(t))return this.getReadAccess("role:"+t);throw new Error("role must be a AV.Role or a String")},e.ACL.prototype.getRoleWriteAccess=function(t){if(t instanceof e.Role&&(t=t.getName()),r.isString(t))return this.getWriteAccess("role:"+t);throw new Error("role must be a AV.Role or a String")},e.ACL.prototype.setRoleReadAccess=function(t,n){if(t instanceof e.Role&&(t=t.getName()),r.isString(t))return void this.setReadAccess("role:"+t,n);throw new Error("role must be a AV.Role or a String")},e.ACL.prototype.setRoleWriteAccess=function(t,n){if(t instanceof e.Role&&(t=t.getName()),r.isString(t))return void this.setWriteAccess("role:"+t,n);throw new Error("role must be a AV.Role or a String")}}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){e.Op=function(){this._initialize.apply(this,arguments)},r.extend(e.Op.prototype,{_initialize:function(){}}),r.extend(e.Op,{_extend:e._extend,_opDecoderMap:{},_registerDecoder:function(t,n){e.Op._opDecoderMap[t]=n},_decode:function(t){var n=e.Op._opDecoderMap[t.__op];return n?n(t):void 0}}),e.Op._registerDecoder("Batch",function(t){var n=null;return e._arrayEach(t.ops,function(t){t=e.Op._decode(t),n=t._mergeWithPrevious(n)}),n}),e.Op.Set=e.Op._extend({_initialize:function(e){this._value=e},value:function(){return this._value},toJSON:function(){return e._encode(this.value())},_mergeWithPrevious:function(e){return this},_estimate:function(e){return this.value()}}),e.Op._UNSET={},e.Op.Unset=e.Op._extend({toJSON:function(){return{__op:"Delete"}},_mergeWithPrevious:function(e){return this},_estimate:function(t){return e.Op._UNSET}}),e.Op._registerDecoder("Delete",function(t){return new e.Op.Unset}),e.Op.Increment=e.Op._extend({_initialize:function(e){this._amount=e},amount:function(){return this._amount},toJSON:function(){return{__op:"Increment",amount:this._amount}},_mergeWithPrevious:function(t){if(t){if(t instanceof e.Op.Unset)return new e.Op.Set(this.amount());if(t instanceof e.Op.Set)return new e.Op.Set(t.value()+this.amount());if(t instanceof e.Op.Increment)return new e.Op.Increment(this.amount()+t.amount());throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e){return e?e+this.amount():this.amount()}}),e.Op._registerDecoder("Increment",function(t){return new e.Op.Increment(t.amount)}),e.Op.BitAnd=e.Op._extend({_initialize:function(e){this._value=e},value:function(){return this._value},toJSON:function(){return{__op:"BitAnd",value:this.value()}},_mergeWithPrevious:function(t){if(t){if(t instanceof e.Op.Unset)return new e.Op.Set(0);if(t instanceof e.Op.Set)return new e.Op.Set(t.value()&this.value());throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e){return e&this.value()}}),e.Op._registerDecoder("BitAnd",function(t){return new e.Op.BitAnd(t.value)}),e.Op.BitOr=e.Op._extend({_initialize:function(e){this._value=e},value:function(){return this._value},toJSON:function(){return{__op:"BitOr",value:this.value()}},_mergeWithPrevious:function(t){if(t){if(t instanceof e.Op.Unset)return new e.Op.Set(this.value());if(t instanceof e.Op.Set)return new e.Op.Set(t.value()|this.value());throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e){return e|this.value()}}),e.Op._registerDecoder("BitOr",function(t){return new e.Op.BitOr(t.value)}),e.Op.BitXor=e.Op._extend({_initialize:function(e){this._value=e},value:function(){return this._value},toJSON:function(){return{__op:"BitXor",value:this.value()}},_mergeWithPrevious:function(t){if(t){if(t instanceof e.Op.Unset)return new e.Op.Set(this.value());if(t instanceof e.Op.Set)return new e.Op.Set(t.value()^this.value());throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e){return e^this.value()}}),e.Op._registerDecoder("BitXor",function(t){return new e.Op.BitXor(t.value)}),e.Op.Add=e.Op._extend({_initialize:function(e){this._objects=e},objects:function(){return this._objects},toJSON:function(){return{__op:"Add",objects:e._encode(this.objects())}},_mergeWithPrevious:function(t){if(t){if(t instanceof e.Op.Unset)return new e.Op.Set(this.objects());if(t instanceof e.Op.Set)return new e.Op.Set(this._estimate(t.value()));if(t instanceof e.Op.Add)return new e.Op.Add(t.objects().concat(this.objects()));throw new Error("Op is invalid after previous op.")}return this},_estimate:function(e){return e?e.concat(this.objects()):r.clone(this.objects())}}),e.Op._registerDecoder("Add",function(t){return new e.Op.Add(e._decode(t.objects))}),e.Op.AddUnique=e.Op._extend({_initialize:function(e){this._objects=r.uniq(e)},objects:function(){return this._objects},toJSON:function(){return{__op:"AddUnique",objects:e._encode(this.objects())}},_mergeWithPrevious:function(t){if(t){if(t instanceof e.Op.Unset)return new e.Op.Set(this.objects());if(t instanceof e.Op.Set)return new e.Op.Set(this._estimate(t.value()));if(t instanceof e.Op.AddUnique)return new e.Op.AddUnique(this._estimate(t.objects()));throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t){if(t){var n=r.clone(t);return e._arrayEach(this.objects(),function(t){if(t instanceof e.Object&&t.id){var i=r.find(n,function(n){return n instanceof e.Object&&n.id===t.id});if(i){var o=r.indexOf(n,i);n[o]=t}else n.push(t)}else r.contains(n,t)||n.push(t)}),n}return r.clone(this.objects())}}),e.Op._registerDecoder("AddUnique",function(t){return new e.Op.AddUnique(e._decode(t.objects))}),e.Op.Remove=e.Op._extend({_initialize:function(e){this._objects=r.uniq(e)},objects:function(){return this._objects},toJSON:function(){return{__op:"Remove",objects:e._encode(this.objects())}},_mergeWithPrevious:function(t){if(t){if(t instanceof e.Op.Unset)return t;if(t instanceof e.Op.Set)return new e.Op.Set(this._estimate(t.value()));if(t instanceof e.Op.Remove)return new e.Op.Remove(r.union(t.objects(),this.objects()));throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t){if(t){var n=r.difference(t,this.objects());return e._arrayEach(this.objects(),function(t){t instanceof e.Object&&t.id&&(n=r.reject(n,function(n){return n instanceof e.Object&&n.id===t.id}))}),n}return[]}}),e.Op._registerDecoder("Remove",function(t){return new e.Op.Remove(e._decode(t.objects))}),e.Op.Relation=e.Op._extend({_initialize:function(t,n){this._targetClassName=null;var i=this,o=function(t){if(t instanceof e.Object){if(!t.id)throw new Error("You can't add an unsaved AV.Object to a relation.");if(i._targetClassName||(i._targetClassName=t.className),i._targetClassName!==t.className)throw new Error("Tried to create a AV.Relation with 2 different types: "+i._targetClassName+" and "+t.className+".");return t.id}return t};this.relationsToAdd=r.uniq(r.map(t,o)),this.relationsToRemove=r.uniq(r.map(n,o))},added:function(){var t=this;return r.map(this.relationsToAdd,function(n){var r=e.Object._create(t._targetClassName);return r.id=n,r})},removed:function(){var t=this;return r.map(this.relationsToRemove,function(n){var r=e.Object._create(t._targetClassName);return r.id=n,r})},toJSON:function(){var e=null,t=null,n=this,i=function(e){return{__type:"Pointer",className:n._targetClassName,objectId:e}},o=null;return this.relationsToAdd.length>0&&(o=r.map(this.relationsToAdd,i),e={__op:"AddRelation",objects:o}),this.relationsToRemove.length>0&&(o=r.map(this.relationsToRemove,i),t={__op:"RemoveRelation",objects:o}),e&&t?{__op:"Batch",ops:[e,t]}:e||t||{}},_mergeWithPrevious:function(t){if(t){if(t instanceof e.Op.Unset)throw new Error("You can't modify a relation after deleting it.");if(t instanceof e.Op.Relation){if(t._targetClassName&&t._targetClassName!==this._targetClassName)throw new Error("Related object must be of class "+t._targetClassName+", but "+this._targetClassName+" was passed in.");var n=r.union(r.difference(t.relationsToAdd,this.relationsToRemove),this.relationsToAdd),i=r.union(r.difference(t.relationsToRemove,this.relationsToAdd),this.relationsToRemove),o=new e.Op.Relation(n,i);return o._targetClassName=this._targetClassName,o}throw new Error("Op is invalid after previous op.")}return this},_estimate:function(t,n,r){if(t){if(t instanceof e.Relation){if(this._targetClassName)if(t.targetClassName){if(t.targetClassName!==this._targetClassName)throw new Error("Related object must be a "+t.targetClassName+", but a "+this._targetClassName+" was passed in.")}else t.targetClassName=this._targetClassName;return t}throw new Error("Op is invalid after previous op.")}new e.Relation(n,r).targetClassName=this._targetClassName}}),e.Op._registerDecoder("AddRelation",function(t){return new e.Op.Relation(e._decode(t.objects),[])}),e.Op._registerDecoder("RemoveRelation",function(t){return new e.Op.Relation([],e._decode(t.objects))})}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){e.Relation=function(e,t){if(!r.isString(t))throw new TypeError("key must be a string");this.parent=e,this.key=t,this.targetClassName=null},e.Relation.reverseQuery=function(t,n,r){var i=new e.Query(t);return i.equalTo(n,r._toPointer()),i},r.extend(e.Relation.prototype,{_ensureParentAndKey:function(e,t){if(this.parent=this.parent||e,this.key=this.key||t,this.parent!==e)throw new Error("Internal Error. Relation retrieved from two different Objects.");if(this.key!==t)throw new Error("Internal Error. Relation retrieved from two different keys.")},add:function(t){r.isArray(t)||(t=[t]);var n=new e.Op.Relation(t,[]);this.parent.set(this.key,n),this.targetClassName=n._targetClassName},remove:function(t){r.isArray(t)||(t=[t]);var n=new e.Op.Relation([],t);this.parent.set(this.key,n),this.targetClassName=n._targetClassName},toJSON:function(){return{__type:"Relation",className:this.targetClassName}},query:function(){var t,n;return this.targetClassName?(t=e.Object._getSubclass(this.targetClassName),n=new e.Query(t)):(t=e.Object._getSubclass(this.parent.className),n=new e.Query(t),n._defaultParams.redirectClassNameForKey=this.key),n._addCondition("$relatedTo","object",this.parent._toPointer()),n._addCondition("$relatedTo","key",this.key),n}})}},function(e,t,n){"use strict";var r=n(3),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(0),a=n(322),s=n(323),u=n(337),c=n(33),f=n(14)._request,l=n(19),h=l.tap,d=l.transformFetchOptions,p=n(32)("leancloud:file"),v=n(341);e.exports=function(e){var t=function(e){return o.isString(e)?e.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4]:""},n=function(e){if(e<26)return String.fromCharCode(65+e);if(e<52)return String.fromCharCode(e-26+97);if(e<62)return String.fromCharCode(e-52+48);if(62===e)return"+";if(63===e)return"/";throw new Error("Tried to encode large digit "+e+" in base64.")},r=function(e){var t=[];return t.length=Math.ceil(e.length/3),o.times(t.length,function(r){var i=e[3*r],o=e[3*r+1]||0,a=e[3*r+2]||0,s=3*r+1<e.length,u=3*r+2<e.length;t[r]=[n(i>>2&63),n(i<<4&48|o>>4&15),s?n(o<<2&60|a>>6&3):"=",u?n(63&a):"="].join("")}),t.join("")};e.File=function(n,i,a){if(this.attributes={name:n,url:"",metaData:{},base64:""},o.isString(i))throw new TypeError("Creating an AV.File from a String is not yet supported.");o.isArray(i)&&(this.attributes.metaData.size=i.length,i={base64:r(i)}),this._extName="",this._data=i,this._uploadHeaders={},i&&i.blob&&"string"==typeof i.blob.uri&&(this._extName=t(i.blob.uri)),"undefined"!=typeof Blob&&i instanceof Blob&&(i.size&&(this.attributes.metaData.size=i.size),i.name&&(this._extName=t(i.name)));var s=void 0;if(i&&i.owner)s=i.owner;else if(!e._config.disableCurrentUser)try{s=e.User.current()}catch(e){if("SYNC_API_NOT_AVAILABLE"!==e.code)throw e}this.attributes.metaData.owner=s?s.id:"unknown",this.set("mime_type",a)},e.File.withURL=function(t,n,r,i){if(!t||!n)throw new Error("Please provide file name and url");var o=new e.File(t,null,i);if(r)for(var a in r)o.attributes.metaData[a]||(o.attributes.metaData[a]=r[a]);return o.attributes.url=n,o.attributes.metaData.__source="external",o.attributes.metaData.size=0,o},e.File.createWithoutData=function(t){if(!t)throw new TypeError("The objectId must be provided");var n=new e.File;return n.id=t,n},o.extend(e.File.prototype,{className:"_File",_toFullJSON:function(t){var n=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=o.clone(this.attributes);return e._objectEach(i,function(n,o){i[o]=e._encode(n,t,void 0,r)}),e._objectEach(this._operations,function(e,t){i[t]=e}),o.has(this,"id")&&(i.objectId=this.id),["createdAt","updatedAt"].forEach(function(e){if(o.has(n,e)){var t=n[e];i[e]=o.isDate(t)?t.toJSON():t}}),r&&(i.__type="File"),i},toFullJSON:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this._toFullJSON(e)},toJSON:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[this];return this._toFullJSON(n,!1)},_toPointer:function(){return{__type:"Pointer",className:this.className,objectId:this.id}},getACL:function(){return this._acl},setACL:function(t){return t instanceof e.ACL?(this._acl=t,this):new c(c.OTHER_CAUSE,"ACL must be a AV.ACL.")},name:function(){return this.get("name")},url:function(){return this.get("url")},get:function(e){switch(e){case"objectId":return this.id;case"url":case"name":case"mime_type":case"metaData":case"createdAt":case"updatedAt":return this.attributes[e];default:return this.attributes.metaData[e]}},set:function(){for(var e=this,t=function(t,n){switch(t){case"name":case"url":case"mime_type":case"base64":case"metaData":e.attributes[t]=n;break;default:e.attributes.metaData[t]=n}},n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];switch(r.length){case 1:for(var o in r[0])t(o,r[0][o]);break;case 2:t(r[0],r[1])}return this},setUploadHeader:function(e,t){return this._uploadHeaders[e]=t,this},metaData:function(e,t){return e&&t?(this.attributes.metaData[e]=t,this):e&&!t?this.attributes.metaData[e]:this.attributes.metaData},thumbnailURL:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"png",o=this.attributes.url;if(!o)throw new Error("Invalid url.");if(!e||!t||e<=0||t<=0)throw new Error("Invalid width or height value.");if(n<=0||n>100)throw new Error("Invalid quality value.");return o+"?imageView/"+(r?2:1)+"/w/"+e+"/h/"+t+"/q/"+n+"/format/"+i},size:function(){return this.metaData().size},ownerId:function(){return this.metaData().owner},destroy:function(e){return this.id?f("files",null,this.id,"DELETE",null,e):i.default.reject(new Error("The file id does not eixst."))},_fileToken:function(e,n){var r=this.attributes.name,i=t(r);!i&&this._extName&&(r+=this._extName,i=this._extName);var o={name:r,keep_file_name:n.keepFileName,key:n.key,ACL:this._acl,mime_type:e,metaData:this.attributes.metaData};return f("fileTokens",null,null,"POST",o,n)},save:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.id)throw new Error("File is already saved.");if(!this._previousSave)if(this._data){var n=this.get("mime_type");this._previousSave=this._fileToken(n,t).then(function(r){return r.mime_type&&(n=r.mime_type,e.set("mime_type",n)),e._token=r.token,i.default.resolve().then(function(){var t=e._data;if(t&&t.base64)return v(t.base64,n);if(t&&t.blob)return!t.blob.type&&n&&(t.blob.type=n),t.blob.name||(t.blob.name=e.get("name")),t.blob;if("undefined"!=typeof Blob&&t instanceof Blob)return t;throw new TypeError("malformed file data")}).then(function(n){var i=o.extend({},t);switch(t.onprogress&&(i.onprogress=function(e){if("download"!==e.direction)return t.onprogress(e)}),r.provider){case"s3":return u(r,n,e,i);case"qcloud":return a(r,n,e,i);case"qiniu":default:return s(r,n,e,i)}}).then(h(function(){return e._callback(!0)}),function(t){throw e._callback(!1),t})})}else if(this.attributes.url&&"external"===this.attributes.metaData.__source){var r={name:this.attributes.name,ACL:this._acl,metaData:this.attributes.metaData,mime_type:this.mimeType,url:this.attributes.url};this._previousSave=f("files",null,null,"post",r,t).then(function(t){return e.id=t.objectId,e})}return this._previousSave},_callback:function(e){f("fileCallback",null,null,"post",{token:this._token,result:e}).catch(p),delete this._token,delete this._data},fetch:function(e,t){if(!this.id)throw new Error("Cannot fetch unsaved file");return f("files",null,this.id,"GET",d(e),t).then(this._finishFetch.bind(this))},_finishFetch:function(t){var n=e.Object.prototype.parse(t);return n.attributes={name:n.name,url:n.url,mime_type:n.mime_type,bucket:n.bucket},n.attributes.metaData=n.metaData||{},n.id=n.objectId,delete n.objectId,delete n.metaData,delete n.url,delete n.name,delete n.mime_type,delete n.bucket,o.extend(this,n),this}})}},function(e,t,n){"use strict";var r=n(42),i=r.getAdapter,o=n(32)("cos");e.exports=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=e.upload_url+"?sign="+encodeURIComponent(e.token),s={field:"fileContent",data:t,name:n.attributes.name},u={headers:n._uploadHeaders,data:{op:"upload"},onprogress:r.onprogress};return o("url: %s, file: %o, options: %o",a,s,u),i("upload")(a,s,u).then(function(t){if(o(t.status,t.data),!1===t.ok){var r=new Error(t.status);throw r.response=t,r}return n.attributes.url=e.url,n._bucket=e.bucket,n.id=e.objectId,n},function(e){var t=e.response;throw t&&(o(t.status,t.data),e.statusCode=t.status,e.response=t.data),e})}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=e.token,o=e.upload_url||"https://upload.qiniup.com",a={field:"file",data:t,name:n.attributes.name},s={headers:n._uploadHeaders,data:{name:n.attributes.name,key:e.key,token:i},onprogress:r.onprogress};return S("url: %s, file: %o, options: %o",o,a,s),T("upload")(o,a,s).then(function(t){if(S(t.status,t.data),!1===t.ok){var r=t.status;t.data&&(r=t.data.error?t.data.error:(0,E.default)(t.data));var i=new Error(r);throw i.response=t,i}return n.attributes.url=e.url,n._bucket=e.bucket,n.id=e.objectId,n},function(e){var t=e.response;throw t&&(S(t.status,t.data),e.statusCode=t.status,e.response=t.data),e})}function o(e){var t=I(unescape(encodeURIComponent(e))),n="",r=!0,i=!1,o=void 0;try{for(var a,s=(0,_.default)(t);!(r=(a=s.next()).done);r=!0){var u=a.value;switch(u){case"+":n+="-";break;case"/":n+="_";break;default:n+=u}}}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}function a(e){return"undefined"!=typeof Blob&&e instanceof Blob}var s=n(175),u=r(s),c=n(324),f=r(c),l=n(325),h=r(l),d=n(3),p=r(d),v=n(332),m=r(v),g=n(333),y=r(g),b=n(184),_=r(b),w=n(21),E=r(w),O=n(42),T=O.getAdapter,S=n(32)("leancloud:qiniu"),A=n(71),I=n(336),j=16777216,C=function(){function e(t,n,r,i){var a=this;(0,m.default)(this,e),this.uploadInfo=t,this.data=n,this.file=r,this.size=void 0,this.offset=0,this.uploadedChunks=0;var s=o(t.key),u=t.upload_url||"https://upload.qiniup.com";this.baseURL=u+"/buckets/"+t.bucket+"/objects/"+s+"/uploads",this.upToken="UpToken "+t.token,this.uploaded=0,i&&i.onprogress&&(this.onProgress=function(e){var t=e.loaded;(t+=a.uploadedChunks*j)<=a.uploaded||(a.size?i.onprogress({loaded:t,total:a.size,percent:t/a.size*100}):i.onprogress({loaded:t}),a.uploaded=t)})}return(0,y.default)(e,[{key:"getUploadId",value:function(){return A({method:"POST",url:this.baseURL,headers:{Authorization:this.upToken}}).then(function(e){return e.uploadId})}},{key:"getChunk",value:function(){throw new Error("Not implemented")}},{key:"uploadPart",value:function(e,t,n){return A({method:"PUT",url:this.baseURL+"/"+e+"/"+t,headers:{Authorization:this.upToken},data:n,onprogress:this.onProgress}).then(function(e){var n=e.etag;return{partNumber:t,etag:n}})}},{key:"stopUpload",value:function(e){return A({method:"DELETE",url:this.baseURL+"/"+e,headers:{Authorization:this.upToken}})}},{key:"upload",value:function(){var e=this,t=[];return this.getUploadId().then(function(n){return function r(){return p.default.resolve(e.getChunk()).then(function(i){if(i){var o=t.length+1;return e.uploadPart(n,o,i).then(function(n){return t.push(n),e.uploadedChunks++,r()})}}).catch(function(t){return e.stopUpload(n).then(function(){return p.default.reject(t)})})}().then(function(){return A({method:"POST",url:e.baseURL+"/"+n,headers:{Authorization:e.upToken},data:{parts:t,fname:e.file.attributes.name,mimeType:e.file.attributes.mime_type}})})}).then(function(){return e.file.attributes.url=e.uploadInfo.url,e.file._bucket=e.uploadInfo.bucket,e.file.id=e.uploadInfo.objectId,e.file})}}]),e}(),x=function(e){function t(e,n,r,i){(0,m.default)(this,t);var o=(0,f.default)(this,(t.__proto__||(0,u.default)(t)).call(this,e,n,r,i));return o.size=n.size,o}return(0,h.default)(t,e),(0,y.default)(t,[{key:"getChunk",value:function(){if(this.offset>=this.size)return null;var e=this.data.slice(this.offset,this.offset+j);return this.offset+=e.size,e}}]),t}(C);e.exports=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return a(t)&&t.size>=67108864?new x(e,t,n,r).upload():i(e,t,n,r)}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(43),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(326),o=r(i),a=n(109),s=r(a),u=n(43),c=r(u);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,c.default)(t)));e.prototype=(0,s.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(o.default?(0,o.default)(e,t):e.__proto__=t)}},function(e,t,n){e.exports={default:n(327),__esModule:!0}},function(e,t,n){n(328),e.exports=n(1).Object.setPrototypeOf},function(e,t,n){var r=n(4);r(r.S,"Object",{setPrototypeOf:n(329).set})},function(e,t,n){var r=n(9),i=n(15),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{r=n(22)(Function.call,n(74).f(Object.prototype,"__proto__").set,2),r(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t,n){n(331);var r=n(1).Object;e.exports=function(e,t){return r.create(e,t)}},function(e,t,n){var r=n(4);r(r.S,"Object",{create:n(59)})},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(70),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){n(36),n(34),e.exports=n(335)},function(e,t,n){var r=n(15),i=n(88);e.exports=n(1).getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},function(e,t,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.exports=function(e){for(var t="",n=0;n<e.length;){var i=e.charCodeAt(n++),o=e.charCodeAt(n++),a=e.charCodeAt(n++);if(i>255||o>255||a>255)throw new TypeError("Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.");var s=i<<16|o<<8|a;t+=r.charAt(s>>18&63)+r.charAt(s>>12&63)+r.charAt(s>>6&63)+r.charAt(63&s)}var u=e.length%3;return u?t.slice(0,u-3)+"===".substring(u):t}},function(e,t,n){"use strict";var r=n(0),i=n(71);e.exports=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return i({url:e.upload_url,method:"PUT",data:t,headers:r.extend({"Content-Type":n.get("mime_type"),"Cache-Control":"public, max-age=31536000"},n._uploadHeaders),onprogress:o.onprogress}).then(function(){return n.attributes.url=e.url,n._bucket=e.bucket,n.id=e.objectId,n})}},function(e,t,n){!function(){var t=n(339),r=n(185).utf8,i=n(340),o=n(185).bin,a=function(e,n){e.constructor==String?e=n&&"binary"===n.encoding?o.stringToBytes(e):r.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var s=t.bytesToWords(e),u=8*e.length,c=1732584193,f=-271733879,l=-1732584194,h=271733878,d=0;d<s.length;d++)s[d]=16711935&(s[d]<<8|s[d]>>>24)|4278255360&(s[d]<<24|s[d]>>>8);s[u>>>5]|=128<<u%32,s[14+(u+64>>>9<<4)]=u;for(var p=a._ff,v=a._gg,m=a._hh,g=a._ii,d=0;d<s.length;d+=16){var y=c,b=f,_=l,w=h;c=p(c,f,l,h,s[d+0],7,-680876936),h=p(h,c,f,l,s[d+1],12,-389564586),l=p(l,h,c,f,s[d+2],17,606105819),f=p(f,l,h,c,s[d+3],22,-1044525330),c=p(c,f,l,h,s[d+4],7,-176418897),h=p(h,c,f,l,s[d+5],12,1200080426),l=p(l,h,c,f,s[d+6],17,-1473231341),f=p(f,l,h,c,s[d+7],22,-45705983),c=p(c,f,l,h,s[d+8],7,1770035416),h=p(h,c,f,l,s[d+9],12,-1958414417),l=p(l,h,c,f,s[d+10],17,-42063),f=p(f,l,h,c,s[d+11],22,-1990404162),c=p(c,f,l,h,s[d+12],7,1804603682),h=p(h,c,f,l,s[d+13],12,-40341101),l=p(l,h,c,f,s[d+14],17,-1502002290),f=p(f,l,h,c,s[d+15],22,1236535329),c=v(c,f,l,h,s[d+1],5,-165796510),h=v(h,c,f,l,s[d+6],9,-1069501632),l=v(l,h,c,f,s[d+11],14,643717713),f=v(f,l,h,c,s[d+0],20,-373897302),c=v(c,f,l,h,s[d+5],5,-701558691),h=v(h,c,f,l,s[d+10],9,38016083),l=v(l,h,c,f,s[d+15],14,-660478335),f=v(f,l,h,c,s[d+4],20,-405537848),c=v(c,f,l,h,s[d+9],5,568446438),h=v(h,c,f,l,s[d+14],9,-1019803690),l=v(l,h,c,f,s[d+3],14,-187363961),f=v(f,l,h,c,s[d+8],20,1163531501),c=v(c,f,l,h,s[d+13],5,-1444681467),h=v(h,c,f,l,s[d+2],9,-51403784),l=v(l,h,c,f,s[d+7],14,1735328473),f=v(f,l,h,c,s[d+12],20,-1926607734),c=m(c,f,l,h,s[d+5],4,-378558),h=m(h,c,f,l,s[d+8],11,-2022574463),l=m(l,h,c,f,s[d+11],16,1839030562),f=m(f,l,h,c,s[d+14],23,-35309556),c=m(c,f,l,h,s[d+1],4,-1530992060),h=m(h,c,f,l,s[d+4],11,1272893353),l=m(l,h,c,f,s[d+7],16,-155497632),f=m(f,l,h,c,s[d+10],23,-1094730640),c=m(c,f,l,h,s[d+13],4,681279174),h=m(h,c,f,l,s[d+0],11,-358537222),l=m(l,h,c,f,s[d+3],16,-722521979),f=m(f,l,h,c,s[d+6],23,76029189),c=m(c,f,l,h,s[d+9],4,-640364487),h=m(h,c,f,l,s[d+12],11,-421815835),l=m(l,h,c,f,s[d+15],16,530742520),f=m(f,l,h,c,s[d+2],23,-995338651),c=g(c,f,l,h,s[d+0],6,-198630844),h=g(h,c,f,l,s[d+7],10,1126891415),l=g(l,h,c,f,s[d+14],15,-1416354905),f=g(f,l,h,c,s[d+5],21,-57434055),c=g(c,f,l,h,s[d+12],6,1700485571),h=g(h,c,f,l,s[d+3],10,-1894986606),l=g(l,h,c,f,s[d+10],15,-1051523),f=g(f,l,h,c,s[d+1],21,-2054922799),c=g(c,f,l,h,s[d+8],6,1873313359),h=g(h,c,f,l,s[d+15],10,-30611744),l=g(l,h,c,f,s[d+6],15,-1560198380),f=g(f,l,h,c,s[d+13],21,1309151649),c=g(c,f,l,h,s[d+4],6,-145523070),h=g(h,c,f,l,s[d+11],10,-1120210379),l=g(l,h,c,f,s[d+2],15,718787259),f=g(f,l,h,c,s[d+9],21,-343485551),c=c+y>>>0,f=f+b>>>0,l=l+_>>>0,h=h+w>>>0}return t.endian([c,f,l,h])};a._ff=function(e,t,n,r,i,o,a){var s=e+(t&n|~t&r)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},a._gg=function(e,t,n,r,i,o,a){var s=e+(t&r|n&~r)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},a._hh=function(e,t,n,r,i,o,a){var s=e+(t^n^r)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},a._ii=function(e,t,n,r,i,o,a){var s=e+(n^(t|~r))+(i>>>0)+a;return(s<<o|s>>>32-o)+t},a._blocksize=16,a._digestsize=16,e.exports=function(e,n){if(void 0===e||null===e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(a(e,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):t.bytesToHex(r)}}()},function(e,t){!function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var i=e[r]<<16|e[r+1]<<8|e[r+2],o=0;o<4;o++)8*r+6*o<=8*e.length?n.push(t.charAt(i>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r<e.length;i=++r%4)0!=i&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(e.charAt(r))>>>6-2*i);return n}};e.exports=n}()},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function r(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}/*!
2 * Determine if an object is a Buffer
3 *
4 * @author Feross Aboukhadijeh <https://feross.org>
5 * @license MIT
6 */
7e.exports=function(e){return null!=e&&(n(e)||r(e)||!!e._isBuffer)}},function(e,t,n){"use strict";var r=function(e,t){var n;e.indexOf("base64")<0?n=atob(e):e.split(",")[0].indexOf("base64")>=0?(t=t||e.split(",")[0].split(":")[1].split(";")[0],n=atob(e.split(",")[1])):n=unescape(e.split(",")[1]);for(var r=new Uint8Array(n.length),i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return new Blob([r],{type:t})};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return e&&e[t]?d.isFunction(e[t])?e[t]():e[t]:null}var o=n(186),a=r(o),s=n(21),u=r(s),c=n(345),f=r(c),l=n(3),h=r(l),d=n(0),p=n(33),v=n(14),m=v._request,g=n(19),y=g.isNullOrUndefined,b=g.ensureArray,_=g.transformFetchOptions,w=g.setValue,E=g.findValue,O=g.isPlainObject,T=g.continueWhile,S=function e(t){return d.isArray(t)?t.map(e):O(t)?d.mapObject(t,e):d.isObject(t)&&t._toPointer?t._toPointer():t},A=["objectId","createdAt","updatedAt"],I=function(e){if(-1!==A.indexOf(e))throw new Error("key["+e+"] is reserved")},j=function(e){var t=d.find(e,function(e){return e instanceof Error});if(!t)return e;var n=new p(t.code,t.message);throw n.results=e,n};e.exports=function(e){e.Object=function(t,n){if(d.isString(t))return e.Object._create.apply(this,arguments);t=t||{},n&&n.parse&&(t=this.parse(t),t=this._mergeMagicFields(t));var r=i(this,"defaults");r&&(t=d.extend({},r,t)),n&&n.collection&&(this.collection=n.collection),this._serverData={},this._opSetQueue=[{}],this._flags={},this.attributes={},this._hashedJSON={},this._escapedAttributes={},this.cid=d.uniqueId("c"),this.changed={},this._silent={},this._pending={},this.set(t,{silent:!0}),this.changed={},this._silent={},this._pending={},this._hasData=!0,this._previousAttributes=d.clone(this.attributes),this.initialize.apply(this,arguments)},e.Object.saveAll=function(t,n){return e.Object._deepSaveAsync(t,null,n)},e.Object.fetchAll=function(e,t){return h.default.resolve().then(function(){return m("batch",null,null,"POST",{requests:d.map(e,function(e){if(!e.className)throw new Error("object must have className to fetch");if(!e.id)throw new Error("object must have id to fetch");if(e.dirty())throw new Error("object is modified but not saved");return{method:"GET",path:"/1.1/classes/"+e.className+"/"+e.id}})},t)}).then(function(t){var n=d.map(e,function(e,n){if(t[n].success){var r=e.parse(t[n].success);return e._cleanupUnsetKeys(r),e._finishFetch(r),e}return null===t[n].success?new p(p.OBJECT_NOT_FOUND,"Object not found."):new p(t[n].error.code,t[n].error.error)});return j(n)})},d.extend(e.Object.prototype,e.Events,{_fetchWhenSave:!1,initialize:function(){},fetchWhenSave:function(e){if(console.warn("AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead."),!d.isBoolean(e))throw new Error("Expect boolean value for fetchWhenSave");this._fetchWhenSave=e},getObjectId:function(){return this.id},getCreatedAt:function(){return this.createdAt},getUpdatedAt:function(){return this.updatedAt},toJSON:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return this._toFullJSON(n,!1)},toFullJSON:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this._toFullJSON(e)},_toFullJSON:function(t){var n=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=d.clone(this.attributes);if(d.isArray(t))var o=t.concat(this);return e._objectEach(i,function(t,n){i[n]=e._encode(t,o,void 0,r)}),e._objectEach(this._operations,function(e,t){i[t]=e}),d.has(this,"id")&&(i.objectId=this.id),["createdAt","updatedAt"].forEach(function(e){if(d.has(n,e)){var t=n[e];i[e]=d.isDate(t)?t.toJSON():t}}),r&&(i.__type="Object",d.isArray(t)&&t.length&&(i.__type="Pointer"),i.className=this.className),i},_refreshCache:function(){var t=this;t._refreshingCache||(t._refreshingCache=!0,e._objectEach(this.attributes,function(n,r){n instanceof e.Object?n._refreshCache():d.isObject(n)&&t._resetCacheForKey(r)&&t.set(r,new e.Op.Set(n),{silent:!0})}),delete t._refreshingCache)},dirty:function(e){this._refreshCache();var t=d.last(this._opSetQueue);return e?!!t[e]:!this.id||d.keys(t).length>0},dirtyKeys:function(){this._refreshCache();var e=d.last(this._opSetQueue);return d.keys(e)},_toPointer:function(){return{__type:"Pointer",className:this.className,objectId:this.id}},get:function(e){switch(e){case"objectId":return this.id;case"createdAt":case"updatedAt":return this[e];default:return this.attributes[e]}},relation:function(t){var n=this.get(t);if(n){if(!(n instanceof e.Relation))throw new Error("Called relation() on non-relation field "+t);return n._ensureParentAndKey(this,t),n}return new e.Relation(this,t)},escape:function(e){var t=this._escapedAttributes[e];if(t)return t;var n,r=this.attributes[e];return n=y(r)?"":d.escape(r.toString()),this._escapedAttributes[e]=n,n},has:function(e){return!y(this.attributes[e])},_mergeMagicFields:function(t){var n=this,r=["objectId","createdAt","updatedAt"];return e._arrayEach(r,function(r){t[r]&&("objectId"===r?n.id=t[r]:"createdAt"!==r&&"updatedAt"!==r||d.isDate(t[r])?n[r]=t[r]:n[r]=e._parseDate(t[r]),delete t[r])}),t},_startSave:function(){this._opSetQueue.push({})},_cancelSave:function(){var t=d.first(this._opSetQueue);this._opSetQueue=d.rest(this._opSetQueue);var n=d.first(this._opSetQueue);e._objectEach(t,function(e,r){var i=t[r],o=n[r];i&&o?n[r]=o._mergeWithPrevious(i):i&&(n[r]=i)}),this._saving=this._saving-1},_finishSave:function(t){var n={};e._traverse(this.attributes,function(t){t instanceof e.Object&&t.id&&t._hasData&&(n[t.id]=t)});var r=d.first(this._opSetQueue);this._opSetQueue=d.rest(this._opSetQueue),this._applyOpSet(r,this._serverData),this._mergeMagicFields(t);var i=this;e._objectEach(t,function(t,r){i._serverData[r]=e._decode(t,r);var o=e._traverse(i._serverData[r],function(t){if(t instanceof e.Object&&n[t.id])return n[t.id]});o&&(i._serverData[r]=o)}),this._rebuildAllEstimatedData();var o=this._opSetQueue.map(d.clone);this._refreshCache(),this._opSetQueue=o,this._saving=this._saving-1},_finishFetch:function(t,n){this._opSetQueue=[{}],this._mergeMagicFields(t);var r=this;e._objectEach(t,function(t,n){r._serverData[n]=e._decode(t,n)}),this._rebuildAllEstimatedData(),this._refreshCache(),this._opSetQueue=[{}],this._hasData=n},_applyOpSet:function(t,n){var r=this;e._objectEach(t,function(t,i){var o=E(n,i),a=(0,f.default)(o,3),s=a[0],u=a[1],c=a[2];w(n,i,t._estimate(s,r,i)),u&&u[c]===e.Op._UNSET&&delete u[c]})},_resetCacheForKey:function(t){var n=this.attributes[t];if(d.isObject(n)&&!(n instanceof e.Object)&&!(n instanceof e.File)){var r=(0,u.default)(S(n));if(this._hashedJSON[t]!==r){var i=!!this._hashedJSON[t];return this._hashedJSON[t]=r,i}}return!1},_rebuildEstimatedDataForKey:function(t){var n=this;delete this.attributes[t],this._serverData[t]&&(this.attributes[t]=this._serverData[t]),e._arrayEach(this._opSetQueue,function(r){var i=r[t];if(i){var o=E(n.attributes,t),a=(0,f.default)(o,4),s=a[0],u=a[1],c=a[2],l=a[3];w(n.attributes,t,i._estimate(s,n,t)),u&&u[c]===e.Op._UNSET&&delete u[c],n._resetCacheForKey(l)}})},_rebuildAllEstimatedData:function(){var t=this,n=d.clone(this.attributes);this.attributes=d.clone(this._serverData),e._arrayEach(this._opSetQueue,function(n){t._applyOpSet(n,t.attributes),e._objectEach(n,function(e,n){t._resetCacheForKey(n)})}),e._objectEach(n,function(e,n){t.attributes[n]!==e&&t.trigger("change:"+n,t,t.attributes[n],{})}),e._objectEach(this.attributes,function(e,r){d.has(n,r)||t.trigger("change:"+r,t,e,{})})},set:function(t,n,r){var i;if(d.isObject(t)||y(t)?(i=d.mapObject(t,function(t,n){return I(n),e._decode(t,n)}),r=n):(i={},I(t),i[t]=e._decode(n,t)),r=r||{},!i)return this;i instanceof e.Object&&(i=i.attributes),r.unset&&e._objectEach(i,function(t,n){i[n]=new e.Op.Unset});var o=d.clone(i),a=this;e._objectEach(o,function(t,n){t instanceof e.Op&&(o[n]=t._estimate(a.attributes[n],a,n),o[n]===e.Op._UNSET&&delete o[n])}),this._validate(i,r),r.changes={};var s=this._escapedAttributes;return e._arrayEach(d.keys(i),function(t){var n=i[t];n instanceof e.Relation&&(n.parent=a),n instanceof e.Op||(n=new e.Op.Set(n));var o=!0;n instanceof e.Op.Set&&d.isEqual(a.attributes[t],n.value)&&(o=!1),o&&(delete s[t],r.silent?a._silent[t]=!0:r.changes[t]=!0);var u=d.last(a._opSetQueue);u[t]=n._mergeWithPrevious(u[t]),a._rebuildEstimatedDataForKey(t),o?(a.changed[t]=a.attributes[t],r.silent||(a._pending[t]=!0)):(delete a.changed[t],delete a._pending[t])}),r.silent||this.change(r),this},unset:function(e,t){return t=t||{},t.unset=!0,this.set(e,null,t)},increment:function(t,n){return(d.isUndefined(n)||d.isNull(n))&&(n=1),this.set(t,new e.Op.Increment(n))},add:function(t,n){return this.set(t,new e.Op.Add(b(n)))},addUnique:function(t,n){return this.set(t,new e.Op.AddUnique(b(n)))},remove:function(t,n){return this.set(t,new e.Op.Remove(b(n)))},bitAnd:function(t,n){return this.set(t,new e.Op.BitAnd(n))},bitOr:function(t,n){return this.set(t,new e.Op.BitOr(n))},bitXor:function(t,n){return this.set(t,new e.Op.BitXor(n))},op:function(e){return d.last(this._opSetQueue)[e]},clear:function(e){e=e||{},e.unset=!0;var t=d.extend(this.attributes,this._operations);return this.set(t,e)},revert:function(e){var t=d.last(this._opSetQueue);return b(e||d.keys(t)).forEach(function(e){delete t[e]}),this._rebuildAllEstimatedData(),this},_getSaveJSON:function(){var t=d.clone(d.first(this._opSetQueue));return e._objectEach(t,function(e,n){t[n]=e.toJSON()}),t},_canBeSerialized:function(){return e.Object._canBeSerializedAsValue(this.attributes)},fetch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(!this.id)throw new Error("Cannot fetch unsaved object");var n=this;return m("classes",this.className,this.id,"GET",_(e),t).then(function(t){var r=n.parse(t);return n._cleanupUnsetKeys(r,e.keys?b(e.keys).join(",").split(","):void 0),n._finishFetch(r,!0),n})},_cleanupUnsetKeys:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d.keys(this._serverData);d.forEach(n,function(n){void 0===e[n]&&delete t._serverData[n]})},save:function(t,n,r){var i,o,a;d.isObject(t)||y(t)?(i=t,a=n):(i={},i[t]=n,a=r),a=d.clone(a)||{},a.wait&&(o=d.clone(this.attributes));var s=d.clone(a)||{};s.wait&&(s.silent=!0),i&&this.set(i,s);var u=this,c=[],f=[];return e.Object._findUnsavedChildren(u,c,f),c.length+f.length>1?e.Object._deepSaveAsync(this,u,a):(this._startSave(),this._saving=(this._saving||0)+1,this._allPreviousSaves=this._allPreviousSaves||h.default.resolve(),this._allPreviousSaves=this._allPreviousSaves.catch(function(e){}).then(function(){var e=u.id?"PUT":"POST",t=u._getSaveJSON(),n={};if((u._fetchWhenSave||a.fetchWhenSave)&&(n.new="true"),a._failOnNotExist&&(n.failOnNotExist="true"),a.query){var r;if("function"==typeof a.query._getParams&&(r=a.query._getParams())&&(n.where=r.where),!n.where){throw new Error("options.query is not an AV.Query")}}d.extend(t,u._flags);var c="classes",f=u.className;"_User"!==u.className||u.id||(c="users",f=null);var l=a._makeRequest||m,h=l(c,f,u.id,e,t,a,n);return h=h.then(function(e){var t=u.parse(e);return a.wait&&(t=d.extend(i||{},t)),u._finishSave(t),a.wait&&u.set(o,s),u},function(e){throw u._cancelSave(),e})}),this._allPreviousSaves)},destroy:function(e){e=e||{};var t=this,n=function(){t.trigger("destroy",t,t.collection,e)};return this.id?(e.wait||n(),m("classes",this.className,this.id,"DELETE",this._flags,e).then(function(){return e.wait&&n(),t})):n()},parse:function(t){var n=d.clone(t);return["createdAt","updatedAt"].forEach(function(t){n[t]&&(n[t]=e._parseDate(n[t]))}),n.createdAt&&!n.updatedAt&&(n.updatedAt=n.createdAt),n},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.id},change:function(t){t=t||{};var n=this._changing;this._changing=!0;var r=this;e._objectEach(this._silent,function(e){r._pending[e]=!0});var i=d.extend({},t.changes,this._silent);if(this._silent={},e._objectEach(i,function(e,n){r.trigger("change:"+n,r,r.get(n),t)}),n)return this;for(var o=function(e,t){r._pending[t]||r._silent[t]||delete r.changed[t]};!d.isEmpty(this._pending);)this._pending={},this.trigger("change",this,t),e._objectEach(this.changed,o),r._previousAttributes=d.clone(this.attributes);return this._changing=!1,this},previous:function(e){return arguments.length&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return d.clone(this._previousAttributes)},isValid:function(){try{this.validate(this.attributes)}catch(e){return!1}return!0},validate:function(t){if(d.has(t,"ACL")&&!(t.ACL instanceof e.ACL))throw new p(p.OTHER_CAUSE,"ACL must be a AV.ACL.")},_validate:function(e,t){!t.silent&&this.validate&&(e=d.extend({},this.attributes,e),this.validate(e))},getACL:function(){return this.get("ACL")},setACL:function(e,t){return this.set("ACL",e,t)},disableBeforeHook:function(){this.ignoreHook("beforeSave"),this.ignoreHook("beforeUpdate"),this.ignoreHook("beforeDelete")},disableAfterHook:function(){this.ignoreHook("afterSave"),this.ignoreHook("afterUpdate"),this.ignoreHook("afterDelete")},ignoreHook:function(t){if(!d.contains(["beforeSave","afterSave","beforeUpdate","afterUpdate","beforeDelete","afterDelete"],t))throw new Error("Unsupported hookName: "+t);if(!e.hookKey)throw new Error("ignoreHook required hookKey");this._flags.__ignore_hooks||(this._flags.__ignore_hooks=[]),this._flags.__ignore_hooks.push(t)}}),e.Object.createWithoutData=function(t,n,r){var i=void 0;if(d.isString(t))i=e.Object._getSubclass(t);else{if(!(t.prototype&&t.prototype instanceof e.Object))throw new Error("class must be a string or a subclass of AV.Object.");i=t}if(!n)throw new TypeError("The objectId must be provided");var o=new i;return o.id=n,o._hasData=r,o},e.Object.destroyAll=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||0===e.length)return h.default.resolve();var n=d.groupBy(e,function(e){return(0,u.default)({className:e.className,flags:e._flags})}),r={requests:d.map(n,function(e){var t=d.map(e,"id").join(",");return{method:"DELETE",path:"/1.1/classes/"+e[0].className+"/"+t,body:e[0]._flags}})};return m("batch",null,null,"POST",r,t).then(function(e){var t=d.find(e,function(e){return!e.success});if(t)throw new p(t.error.code,t.error.error)})},e.Object._getSubclass=function(t){if(!d.isString(t))throw new Error("AV.Object._getSubclass requires a string argument.");var n=e.Object._classMap[t];return n||(n=e.Object.extend(t),e.Object._classMap[t]=n),n},e.Object._create=function(t,n,r){return new(e.Object._getSubclass(t))(n,r)},e.Object._classMap={},e.Object._extend=e._extend,e.Object.new=function(t,n){return new e.Object(t,n)},e.Object.extend=function(t,n,r){if(!d.isString(t)){if(t&&d.has(t,"className"))return e.Object.extend(t.className,t,n);throw new Error("AV.Object.extend's first argument should be the className.")}"User"===t&&(t="_User");var i=null;if(d.has(e.Object._classMap,t)){var o=e.Object._classMap[t];if(!n&&!r)return o;i=o._extend(n,r)}else n=n||{},n._className=t,i=this._extend(n,r);return i.extend=function(n){if(d.isString(n)||n&&d.has(n,"className"))return e.Object.extend.apply(i,arguments);var r=[t].concat(d.toArray(arguments));return e.Object.extend.apply(i,r)},Object.defineProperty(i,"query",(0,a.default)(e.Object,"query")),i.new=function(e,t){return new i(e,t)},e.Object._classMap[t]=i,i},Object.defineProperty(e.Object.prototype,"className",{get:function(){var e=this._className||this.constructor._LCClassName||this.constructor.name;return"User"===e?"_User":e}}),e.Object.register=function(t,n){if(!(t.prototype instanceof e.Object))throw new Error("registered class is not a subclass of AV.Object");var r=n||t.name;if(!r.length)throw new Error("registered class must be named");n&&(t._LCClassName=n),e.Object._classMap[r]=t},Object.defineProperty(e.Object,"query",{get:function(){return new e.Query(this.prototype.className)}}),e.Object._findUnsavedChildren=function(t,n,r){e._traverse(t,function(t){return t instanceof e.Object?void(t.dirty()&&n.push(t)):t instanceof e.File?void(t.id||r.push(t)):void 0})},e.Object._canBeSerializedAsValue=function(t){var n=!0;return t instanceof e.Object||t instanceof e.File?n=!!t.id:d.isArray(t)?e._arrayEach(t,function(t){e.Object._canBeSerializedAsValue(t)||(n=!1)}):d.isObject(t)&&e._objectEach(t,function(t){e.Object._canBeSerializedAsValue(t)||(n=!1)}),n},e.Object._deepSaveAsync=function(t,n,r){var i=[],o=[];e.Object._findUnsavedChildren(t,i,o),o=d.uniq(o);var a=h.default.resolve();d.each(o,function(e){a=a.then(function(){return e.save()})});var s=d.uniq(i),u=d.uniq(s);return a.then(function(){return T(function(){return u.length>0},function(){var t=[],n=[];if(e._arrayEach(u,function(e){e._canBeSerialized()?t.push(e):n.push(e)}),u=n,0===t.length)return h.default.reject(new p(p.OTHER_CAUSE,"Tried to save a batch with a cycle."));var i=h.default.resolve(d.map(t,function(e){return e._allPreviousSaves||h.default.resolve()})),o=i.then(function(){return m("batch",null,null,"POST",{requests:d.map(t,function(e){var t=e.id?"PUT":"POST",n=e._getSaveJSON();d.extend(n,e._flags);var i=e.className,o="/classes/"+i;"_User"!==e.className||e.id||(o="/users");var o="/1.1"+o;return e.id&&(o=o+"/"+e.id),e._startSave(),{method:t,path:o,body:n,params:r&&r.fetchWhenSave?{fetchWhenSave:!0}:void 0}})},r).then(function(e){var n=d.map(t,function(t,n){return e[n].success?(t._finishSave(t.parse(e[n].success)),t):(t._cancelSave(),new p(e[n].error.code,e[n].error.error))});return j(n)})});return e._arrayEach(t,function(e){e._allPreviousSaves=o}),o})}).then(function(){return t})}}},function(e,t,n){n(344);var r=n(1).Object;e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)}},function(e,t,n){var r=n(25),i=n(74).f;n(69)("getOwnPropertyDescriptor",function(){return function(e,t){return i(r(e),t)}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(187),o=r(i),a=n(184),s=r(a);t.default=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=(0,s.default)(e);!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if((0,o.default)(Object(t)))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(e,t,n){n(36),n(34),e.exports=n(347)},function(e,t,n){var r=n(62),i=n(8)("iterator"),o=n(35);e.exports=n(1).isIterable=function(e){var t=Object(e);return void 0!==t[i]||"@@iterator"in t||o.hasOwnProperty(r(t))}},function(e,t,n){"use strict";var r=n(0),i=n(33);e.exports=function(e){e.Role=e.Object.extend("_Role",{constructor:function(t,n){if(r.isString(t)?(e.Object.prototype.constructor.call(this,null,null),this.setName(t)):e.Object.prototype.constructor.call(this,t,n),n){if(!(n instanceof e.ACL))throw new TypeError("acl must be an instance of AV.ACL");this.setACL(n)}},getName:function(){return this.get("name")},setName:function(e,t){return this.set("name",e,t)},getUsers:function(){return this.relation("users")},getRoles:function(){return this.relation("roles")},validate:function(t,n){if("name"in t&&t.name!==this.getName()){var o=t.name;if(this.id&&this.id!==t.objectId)return new i(i.OTHER_CAUSE,"A role's name can only be set before it has been saved.");if(!r.isString(o))return new i(i.OTHER_CAUSE,"A role's name must be a String.");if(!/^[0-9a-zA-Z\-_ ]+$/.test(o))return new i(i.OTHER_CAUSE,"A role's name can only contain alphanumeric characters, _, -, and spaces.")}return!!e.Object.prototype.validate&&e.Object.prototype.validate.call(this,t,n)}})}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(21),o=r(i),a=n(350),s=r(a),u=n(3),c=r(u),f=n(0),l=n(174),h=n(33),d=n(14),p=d._request,v=d.request,m=n(42),g=m.getAdapter,y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"weixin";return function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.unionIdPlatform,o=void 0===i?e:i,a=r.asMainAccount,s=void 0!==a&&a;if("string"!=typeof n)throw new h(h.OTHER_CAUSE,"unionId is not a string");if("string"!=typeof o)throw new h(h.OTHER_CAUSE,"unionIdPlatform is not a string");return f.extend({},t,{platform:o,unionid:n,main_account:Boolean(s)})}};e.exports=function(e){e.User=e.Object.extend("_User",{_isCurrentUser:!1,_mergeMagicFields:function(t){return t.sessionToken&&(this._sessionToken=t.sessionToken,delete t.sessionToken),e.User.__super__._mergeMagicFields.call(this,t)},_cleanupAuthData:function(){if(this.isCurrent()){var t=this.get("authData");t&&e._objectEach(this.get("authData"),function(e,n){t[n]||delete t[n]})}},_synchronizeAllAuthData:function(){if(this.get("authData")){var t=this;e._objectEach(this.get("authData"),function(e,n){t._synchronizeAuthData(n)})}},_synchronizeAuthData:function(t){if(this.isCurrent()){var n;f.isString(t)?(n=t,t=e.User._authProviders[n]):n=t.getAuthType();var r=this.get("authData");if(r&&t){t.restoreAuthentication(r[n])||this.dissociateAuthData(t)}}},_handleSaveResult:function(t){return t&&!e._config.disableCurrentUser&&(this._isCurrentUser=!0),this._cleanupAuthData(),this._synchronizeAllAuthData(),delete this._serverData.password,this._rebuildEstimatedDataForKey("password"),this._refreshCache(),!t&&!this.isCurrent()||e._config.disableCurrentUser?c.default.resolve():c.default.resolve(e.User._saveCurrentUser(this))},_linkWith:function(t,n){var r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o.failOnNotExist,u=void 0!==a&&a;return f.isString(t)?(r=t,t=e.User._authProviders[t]):r=t.getAuthType(),n?this.save({authData:(0,s.default)({},r,n)},{fetchWhenSave:!!this.get("authData"),_failOnNotExist:u}).then(function(e){return e._handleSaveResult(!0).then(function(){return e})}):t.authenticate().then(function(e){return i._linkWith(t,e)})},associateWithAuthData:function(e,t){return this._linkWith(t,e)},associateWithAuthDataAndUnionId:function(e,t,n,r){return this._linkWith(t,y()(e,n,r))},associateWithMiniApp:function(e,t){var n=this;if(void 0===e){return g("getAuthInfo")().then(function(e){return n._linkWith(e.provider,e.authData,t)})}return this._linkWith(e.provider,e.authData,t)},associateWithQQApp:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.preferUnionId,r=void 0!==n&&n,i=t.unionIdPlatform,o=void 0===i?"qq":i,a=t.asMainAccount,s=void 0===a||a;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(t){return t.provider="lc_qqapp",e.associateWithMiniApp(t)})},associateWithWeapp:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.preferUnionId,r=void 0!==n&&n,i=t.unionIdPlatform,o=void 0===i?"weixin":i,a=t.asMainAccount,s=void 0===a||a;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(t){return e.associateWithMiniApp(t)})},linkWithWeapp:function(e){return console.warn("DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替"),this.associateWithWeapp(e)},associateWithQQAppWithUnionId:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"qq":i,a=r.asMainAccount,s=void 0!==a&&a;return g("getAuthInfo")({platform:o}).then(function(r){return r=e.User.mergeUnionId(r,t,{asMainAccount:s}),r.provider="lc_qqapp",n.associateWithMiniApp(r)})},associateWithWeappWithUnionId:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"weixin":i,a=r.asMainAccount,s=void 0!==a&&a;return g("getAuthInfo")({platform:o}).then(function(r){return r=e.User.mergeUnionId(r,t,{asMainAccount:s}),n.associateWithMiniApp(r)})},dissociateAuthData:function(e){return this.unset("authData."+e),this.save().then(function(e){return e._handleSaveResult(!0).then(function(){return e})})},_unlinkFrom:function(e){return console.warn("DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替"),this.dissociateAuthData(e)},_isLinked:function(e){var t;return t=f.isString(e)?e:e.getAuthType(),!!(this.get("authData")||{})[t]},isAnonymous:function(){return this._isLinked("anonymous")},logOut:function(){this._logOutWithAll(),this._isCurrentUser=!1},_logOutWithAll:function(){if(this.get("authData")){var t=this;e._objectEach(this.get("authData"),function(e,n){t._logOutWith(n)})}},_logOutWith:function(t){this.isCurrent()&&(f.isString(t)&&(t=e.User._authProviders[t]),t&&t.deauthenticate&&t.deauthenticate())},signUp:function(e,t){var n=e&&e.username||this.get("username");if(!n||""===n)throw new h(h.OTHER_CAUSE,"Cannot sign up user with an empty name.");var r=e&&e.password||this.get("password");if(!r||""===r)throw new h(h.OTHER_CAUSE,"Cannot sign up user with an empty password.");return this.save(e,t).then(function(e){return e.isAnonymous()&&(e.unset("authData.anonymous"),e._opSetQueue=[{}]),e._handleSaveResult(!0).then(function(){return e})})},signUpOrlogInWithMobilePhone:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e&&e.mobilePhoneNumber||this.get("mobilePhoneNumber");if(!n||""===n)throw new h(h.OTHER_CAUSE,"Cannot sign up or login user by mobilePhoneNumber with an empty mobilePhoneNumber.");var r=e&&e.smsCode||this.get("smsCode");if(!r||""===r)throw new h(h.OTHER_CAUSE,"Cannot sign up or login user by mobilePhoneNumber with an empty smsCode.");return t._makeRequest=function(e,t,n,r,i){return p("usersByMobilePhone",null,null,"POST",i)},this.save(e,t).then(function(e){return delete e.attributes.smsCode,delete e._serverData.smsCode,e._handleSaveResult(!0).then(function(){return e})})},loginWithAuthData:function(e,t,n){return this._linkWith(t,e,n)},loginWithAuthDataAndUnionId:function(e,t,n,r){return this.loginWithAuthData(y()(e,n,r),t,r)},loginWithWeapp:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.preferUnionId,r=void 0!==n&&n,i=t.unionIdPlatform,o=void 0===i?"weixin":i,a=t.asMainAccount,s=void 0===a||a,u=t.failOnNotExist,c=void 0!==u&&u;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(t){return e.loginWithMiniApp(t,{failOnNotExist:c})})},loginWithWeappWithUnionId:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"weixin":i,a=r.asMainAccount,s=void 0!==a&&a,u=r.failOnNotExist,c=void 0!==u&&u;return g("getAuthInfo")({platform:o}).then(function(r){return r=e.User.mergeUnionId(r,t,{asMainAccount:s}),n.loginWithMiniApp(r,{failOnNotExist:c})})},loginWithQQApp:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.preferUnionId,r=void 0!==n&&n,i=t.unionIdPlatform,o=void 0===i?"qq":i,a=t.asMainAccount,s=void 0===a||a,u=t.failOnNotExist,c=void 0!==u&&u;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(t){return t.provider="lc_qqapp",e.loginWithMiniApp(t,{failOnNotExist:c})})},loginWithQQAppWithUnionId:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"qq":i,a=r.asMainAccount,s=void 0!==a&&a,u=r.failOnNotExist,c=void 0!==u&&u;return g("getAuthInfo")({platform:o}).then(function(r){return r=e.User.mergeUnionId(r,t,{asMainAccount:s}),r.provider="lc_qqapp",n.loginWithMiniApp(r,{failOnNotExist:c})})},loginWithMiniApp:function(e,t){var n=this;if(void 0===e){return g("getAuthInfo")().then(function(e){return n.loginWithAuthData(e.authData,e.provider,t)})}return this.loginWithAuthData(e.authData,e.provider,t)},logIn:function(){var e=this;return p("login",null,null,"POST",this.toJSON()).then(function(t){var n=e.parse(t);return e._finishFetch(n),e._handleSaveResult(!0).then(function(){return n.smsCode||delete e.attributes.smsCode,e})})},save:function(t,n,r){var i,o;return f.isObject(t)||f.isNull(t)||f.isUndefined(t)?(i=t,o=n):(i={},i[t]=n,o=r),o=o||{},e.Object.prototype.save.call(this,i,o).then(function(e){return e._handleSaveResult(!1).then(function(){return e})})},follow:function(t,n){if(!this.id)throw new Error("Please signin.");var r=void 0,i=void 0;t.user?(r=t.user,i=t.attributes):r=t;var o=f.isString(r)?r:r.id;if(!o)throw new Error("Invalid target user.");var a="users/"+this.id+"/friendship/"+o;return p(a,null,null,"POST",e._encode(i),n)},unfollow:function(e,t){if(!this.id)throw new Error("Please signin.");var n=void 0;n=e.user?e.user:e;var r=f.isString(n)?n:n.id;if(!r)throw new Error("Invalid target user.");var i="users/"+this.id+"/friendship/"+r;return p(i,null,null,"DELETE",null,t)},getFollowersAndFollowees:function(t,n){if(!this.id)throw new Error("Please signin.");return v({method:"GET",path:"/users/"+this.id+"/followersAndFollowees",query:{skip:t&&t.skip,limit:t&&t.limit,include:"follower,followee",keys:"follower,followee"},authOptions:n}).then(function(t){var n=t.followers,r=t.followees;return{followers:n.map(function(t){var n=t.follower;return e._decode(n)}),followees:r.map(function(t){var n=t.followee;return e._decode(n)})}})},followerQuery:function(){return e.User.followerQuery(this.id)},followeeQuery:function(){return e.User.followeeQuery(this.id)},fetch:function(t,n){return e.Object.prototype.fetch.call(this,t,n).then(function(e){return e._handleSaveResult(!1).then(function(){return e})})},updatePassword:function(e,t,n){var r=this,i="users/"+this.id+"/updatePassword";return p(i,null,null,"PUT",{old_password:e,new_password:t},n).then(function(e){return r._finishFetch(r.parse(e)),r._handleSaveResult(!0).then(function(){return e})})},isCurrent:function(){return this._isCurrentUser},getUsername:function(){return this.get("username")},getMobilePhoneNumber:function(){return this.get("mobilePhoneNumber")},setMobilePhoneNumber:function(e,t){return this.set("mobilePhoneNumber",e,t)},setUsername:function(e,t){return this.set("username",e,t)},setPassword:function(e,t){return this.set("password",e,t)},getEmail:function(){return this.get("email")},setEmail:function(e,t){return this.set("email",e,t)},authenticated:function(){return console.warn("DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。"),!!this._sessionToken&&!e._config.disableCurrentUser&&e.User.current()&&e.User.current().id===this.id},isAuthenticated:function(){var t=this;return c.default.resolve().then(function(){return!!t._sessionToken&&e.User._fetchUserBySessionToken(t._sessionToken).then(function(){return!0},function(e){if(211===e.code)return!1;throw e})})},getSessionToken:function(){return this._sessionToken},refreshSessionToken:function(e){var t=this;return p("users/"+this.id+"/refreshSessionToken",null,null,"PUT",null,e).then(function(e){return t._finishFetch(e),t._handleSaveResult(!0).then(function(){return t})})},getRoles:function(t){return e.Relation.reverseQuery("_Role","users",this).find(t)}},{_currentUser:null,_currentUserMatchesDisk:!1,_CURRENT_USER_KEY:"currentUser",_authProviders:{},signUp:function(t,n,r,i){return r=r||{},r.username=t,r.password=n,e.Object._create("_User").signUp(r,i)},logIn:function(t,n){var r=e.Object._create("_User");return r._finishFetch({username:t,password:n}),r.logIn()},become:function(e){return this._fetchUserBySessionToken(e).then(function(e){return e._handleSaveResult(!0).then(function(){return e})})},_fetchUserBySessionToken:function(t){if(void 0===t)return c.default.reject(new Error("The sessionToken cannot be undefined"));var n=e.Object._create("_User");return v({method:"GET",path:"/users/me",authOptions:{sessionToken:t}}).then(function(e){var t=n.parse(e);return n._finishFetch(t),n})},logInWithMobilePhoneSmsCode:function(t,n){var r=e.Object._create("_User");return r._finishFetch({mobilePhoneNumber:t,smsCode:n}),r.logIn()},signUpOrlogInWithMobilePhone:function(t,n,r,i){return r=r||{},r.mobilePhoneNumber=t,r.smsCode=n,e.Object._create("_User").signUpOrlogInWithMobilePhone(r,i)},logInWithMobilePhone:function(t,n){var r=e.Object._create("_User");return r._finishFetch({mobilePhoneNumber:t,password:n}),r.logIn()},loginWithEmail:function(t,n){var r=e.Object._create("_User");return r._finishFetch({email:t,password:n}),r.logIn()},loginWithAuthData:function(t,n,r){return e.User._logInWith(n,t,r)},signUpOrlogInWithAuthData:function(){return console.warn("DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替"),this.loginWithAuthData.apply(this,arguments)},loginWithAuthDataAndUnionId:function(e,t,n,r){return this.loginWithAuthData(y()(e,n,r),t,r)},signUpOrlogInWithAuthDataAndUnionId:function(){return console.warn("DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替"),this.loginWithAuthDataAndUnionId.apply(this,arguments)},mergeUnionId:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.asMainAccount,i=void 0!==r&&r;e=JSON.parse((0,o.default)(e));var a=e,s=a.authData,u=a.platform;return s.platform=u,s.main_account=i,s.unionid=t,e},loginWithWeapp:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.preferUnionId,r=void 0!==n&&n,i=t.unionIdPlatform,o=void 0===i?"weixin":i,a=t.asMainAccount,s=void 0===a||a,u=t.failOnNotExist,c=void 0!==u&&u;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(t){return e.loginWithMiniApp(t,{failOnNotExist:c})})},loginWithWeappWithUnionId:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"weixin":i,a=r.asMainAccount,s=void 0!==a&&a,u=r.failOnNotExist,c=void 0!==u&&u;return g("getAuthInfo")({platform:o}).then(function(r){return r=e.User.mergeUnionId(r,t,{asMainAccount:s}),n.loginWithMiniApp(r,{failOnNotExist:c})})},loginWithQQApp:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.preferUnionId,r=void 0!==n&&n,i=t.unionIdPlatform,o=void 0===i?"qq":i,a=t.asMainAccount,s=void 0===a||a,u=t.failOnNotExist,c=void 0!==u&&u;return g("getAuthInfo")({preferUnionId:r,asMainAccount:s,platform:o}).then(function(t){return t.provider="lc_qqapp",e.loginWithMiniApp(t,{failOnNotExist:c})})},loginWithQQAppWithUnionId:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.unionIdPlatform,o=void 0===i?"qq":i,a=r.asMainAccount,s=void 0!==a&&a,u=r.failOnNotExist,c=void 0!==u&&u;return g("getAuthInfo")({platform:o}).then(function(r){return r=e.User.mergeUnionId(r,t,{asMainAccount:s}),r.provider="lc_qqapp",n.loginWithMiniApp(r,{failOnNotExist:c})})},loginWithMiniApp:function(e,t){var n=this;if(void 0===e){return g("getAuthInfo")().then(function(e){return n.loginWithAuthData(e.authData,e.provider,t)})}return this.loginWithAuthData(e.authData,e.provider,t)},_genId:function(){return l()},loginAnonymously:function(){return this.loginWithAuthData({id:e.User._genId()},"anonymous")},associateWithAuthData:function(e,t,n){return console.warn("DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替"),e._linkWith(t,n)},logOut:function(){return e._config.disableCurrentUser?(console.warn("AV.User.current() was disabled in multi-user environment, call logOut() from user object instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),c.default.resolve(null)):(null!==e.User._currentUser&&(e.User._currentUser._logOutWithAll(),e.User._currentUser._isCurrentUser=!1),e.User._currentUserMatchesDisk=!0,e.User._currentUser=null,e.localStorage.removeItemAsync(e._getAVPath(e.User._CURRENT_USER_KEY)).then(function(){return e._refreshSubscriptionId()}))},followerQuery:function(t){if(!t||!f.isString(t))throw new Error("Invalid user object id.");var n=new e.FriendShipQuery("_Follower");return n._friendshipTag="follower",n.equalTo("user",e.Object.createWithoutData("_User",t)),n},followeeQuery:function(t){if(!t||!f.isString(t))throw new Error("Invalid user object id.");var n=new e.FriendShipQuery("_Followee");return n._friendshipTag="followee",n.equalTo("user",e.Object.createWithoutData("_User",t)),n},requestPasswordReset:function(e){return p("requestPasswordReset",null,null,"POST",{email:e})},requestEmailVerify:function(e){return p("requestEmailVerify",null,null,"POST",{email:e})},requestMobilePhoneVerify:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={mobilePhoneNumber:e};return t.validateToken&&(n.validate_token=t.validateToken),p("requestMobilePhoneVerify",null,null,"POST",n,t)},requestPasswordResetBySmsCode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={mobilePhoneNumber:e};return t.validateToken&&(n.validate_token=t.validateToken),p("requestPasswordResetBySmsCode",null,null,"POST",n,t)},requestChangePhoneNumber:function(e,t,n){var r={mobilePhoneNumber:e};return t&&(r.ttl=n.ttl),n&&n.validateToken&&(r.validate_token=n.validateToken),p("requestChangePhoneNumber",null,null,"POST",r,n)},changePhoneNumber:function(e,t){return p("changePhoneNumber",null,null,"POST",{mobilePhoneNumber:e,code:t})},resetPasswordBySmsCode:function(e,t){return p("resetPasswordBySmsCode",null,e,"PUT",{password:t})},verifyMobilePhone:function(e){return p("verifyMobilePhone",null,e,"POST",null)},requestLoginSmsCode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={mobilePhoneNumber:e};return t.validateToken&&(n.validate_token=t.validateToken),p("requestLoginSmsCode",null,null,"POST",n,t)},currentAsync:function(){return e._config.disableCurrentUser?(console.warn("AV.User.currentAsync() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),c.default.resolve(null)):e.User._currentUser?c.default.resolve(e.User._currentUser):e.User._currentUserMatchesDisk?c.default.resolve(e.User._currentUser):e.localStorage.getItemAsync(e._getAVPath(e.User._CURRENT_USER_KEY)).then(function(t){if(!t)return null;e.User._currentUserMatchesDisk=!0,e.User._currentUser=e.Object._create("_User"),e.User._currentUser._isCurrentUser=!0;var n=JSON.parse(t);return e.User._currentUser.id=n._id,delete n._id,e.User._currentUser._sessionToken=n._sessionToken,delete n._sessionToken,e.User._currentUser._finishFetch(n),e.User._currentUser._synchronizeAllAuthData(),e.User._currentUser._refreshCache(),e.User._currentUser._opSetQueue=[{}],e.User._currentUser})},current:function(){if(e._config.disableCurrentUser)return console.warn("AV.User.current() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html"),null;if(e.localStorage.async){var t=new Error("Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.");throw t.code="SYNC_API_NOT_AVAILABLE",t}if(e.User._currentUser)return e.User._currentUser;if(e.User._currentUserMatchesDisk)return e.User._currentUser;e.User._currentUserMatchesDisk=!0;var n=e.localStorage.getItem(e._getAVPath(e.User._CURRENT_USER_KEY));if(!n)return null;e.User._currentUser=e.Object._create("_User"),e.User._currentUser._isCurrentUser=!0;var r=JSON.parse(n);return e.User._currentUser.id=r._id,delete r._id,e.User._currentUser._sessionToken=r._sessionToken,delete r._sessionToken,e.User._currentUser._finishFetch(r),e.User._currentUser._synchronizeAllAuthData(),e.User._currentUser._refreshCache(),e.User._currentUser._opSetQueue=[{}],e.User._currentUser},_saveCurrentUser:function(t){var n;return n=e.User._currentUser!==t?e.User.logOut():c.default.resolve(),n.then(function(){t._isCurrentUser=!0,e.User._currentUser=t;var n=t._toFullJSON();return n._id=t.id,n._sessionToken=t._sessionToken,e.localStorage.setItemAsync(e._getAVPath(e.User._CURRENT_USER_KEY),(0,o.default)(n)).then(function(){return e.User._currentUserMatchesDisk=!0,e._refreshSubscriptionId()})})},_registerAuthenticationProvider:function(t){e.User._authProviders[t.getAuthType()]=t,!e._config.disableCurrentUser&&e.User.current()&&e.User.current()._synchronizeAuthData(t.getAuthType())},_logInWith:function(t,n,r){return e.Object._create("_User")._linkWith(t,n,r)}})}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(70),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e,t,n){return t in e?(0,i.default)(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(21),o=r(i),a=n(3),s=r(a),u=n(0),c=n(32)("leancloud:query"),f=n(33),l=n(14),h=l._request,d=l.request,p=n(19),v=p.ensureArray,m=p.transformFetchOptions,g=p.continueWhile,y=function(e,t){if(void 0===e)throw new Error(t)};e.exports=function(e){e.Query=function(t){u.isString(t)&&(t=e.Object._getSubclass(t)),this.objectClass=t,this.className=t.prototype.className,this._where={},this._include=[],this._select=[],this._limit=-1,this._skip=0,this._defaultParams={}},e.Query.or=function(){var t=u.toArray(arguments),n=null;e._arrayEach(t,function(e){if(u.isNull(n)&&(n=e.className),n!==e.className)throw new Error("All queries must be for the same class")});var r=new e.Query(n);return r._orQuery(t),r},e.Query.and=function(){var t=u.toArray(arguments),n=null;e._arrayEach(t,function(e){if(u.isNull(n)&&(n=e.className),n!==e.className)throw new Error("All queries must be for the same class")});var r=new e.Query(n);return r._andQuery(t),r},e.Query.doCloudQuery=function(t,n,r){var i={cql:t};return u.isArray(n)?i.pvalues=n:r=n,h("cloudQuery",null,null,"GET",i,r).then(function(t){var n=new e.Query(t.className);return{results:u.map(t.results,function(e){var r=n._newObject(t);return r._finishFetch&&r._finishFetch(n._processResult(e),!0),r}),count:t.count,className:t.className}})},e.Query.fromJSON=function(t){var n=t.className,r=t.where,i=t.include,o=t.select,a=t.includeACL,s=t.limit,c=t.skip,f=t.order;if("string"!=typeof n)throw new TypeError("Invalid Query JSON, className must be a String.");var l=new e.Query(n);return u.extend(l,{_where:r,_include:i,_select:o,_includeACL:a,_limit:s,_skip:c,_order:f}),l},e.Query._extend=e._extend,u.extend(e.Query.prototype,{_processResult:function(e){return e},get:function(e,t){if(!u.isString(e))throw new Error("objectId must be a string");if(""===e)return s.default.reject(new f(f.OBJECT_NOT_FOUND,"Object not found."));var n=this._newObject();n.id=e;var r=this._getParams(),i={};return r.keys&&(i.keys=r.keys),r.include&&(i.include=r.include),r.includeACL&&(i.includeACL=r.includeACL),h("classes",this.className,e,"GET",m(i),t).then(function(e){if(u.isEmpty(e))throw new f(f.OBJECT_NOT_FOUND,"Object not found.");return n._finishFetch(n.parse(e),!0),n})},toJSON:function(){return{className:this.className,where:this._where,include:this._include,select:this._select,includeACL:this._includeACL,limit:this._limit,skip:this._skip,order:this._order}},_getParams:function(){var e=u.extend({},this._defaultParams,{where:this._where});return this._include.length>0&&(e.include=this._include.join(",")),this._select.length>0&&(e.keys=this._select.join(",")),void 0!==this._includeACL&&(e.returnACL=this._includeACL),this._limit>=0&&(e.limit=this._limit),this._skip>0&&(e.skip=this._skip),void 0!==this._order&&(e.order=this._order),e},_newObject:function(t){return t&&t.className?new e.Object(t.className):new this.objectClass},_createRequest:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._getParams(),t=arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/classes/"+this.className;if(encodeURIComponent((0,o.default)(e)).length>2e3){return d({path:"/batch",method:"POST",data:{requests:[{method:"GET",path:"/1.1"+n,params:e}]},authOptions:t}).then(function(e){var t=e[0];if(t.success)return t.success;var n=new Error(t.error.error||"Unknown batch error");throw n.code=t.error.code,n})}return d({method:"GET",path:n,query:e,authOptions:t})},_parseResponse:function(e){var t=this;return u.map(e.results,function(n){var r=t._newObject(e);return r._finishFetch&&r._finishFetch(t._processResult(n),!0),r})},find:function(e){return this._createRequest(void 0,e).then(this._parseResponse.bind(this))},findAndCount:function(e){var t=this,n=this._getParams();return n.count=1,this._createRequest(n,e).then(function(e){return[t._parseResponse(e),e.count]})},scan:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.orderedBy,r=t.batchSize,i=arguments[1],o=this._getParams();c("scan %O",o),o.order&&(console.warn("The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan."),delete o.order),o.skip&&(console.warn("The skip option of the query is ignored for Query#scan."),delete o.skip),o.limit&&(console.warn("The limit option of the query is ignored for Query#scan."),delete o.limit),n&&(o.scan_key=n),r&&(o.limit=r);var a=s.default.resolve([]),f=void 0,l=!1;return{next:function(){return a=a.then(function(t){return l?[]:t.length>1?t:f||0===t.length?h("scan/classes",e.className,null,"GET",f?u.extend({},o,{cursor:f}):o,i).then(function(t){return f=t.cursor,e._parseResponse(t)}).then(function(e){return e.length||(l=!0),t.concat(e)}):(l=!0,t)}),a.then(function(e){return e.shift()}).then(function(e){return{value:e,done:void 0===e}})}}},destroyAll:function(t){return this.find(t).then(function(n){return e.Object.destroyAll(n,t)})},count:function(e){var t=this._getParams();return t.limit=0,t.count=1,this._createRequest(t,e).then(function(e){return e.count})},first:function(e){var t=this,n=this._getParams();return n.limit=1,this._createRequest(n,e).then(function(e){return u.map(e.results,function(e){var n=t._newObject();return n._finishFetch&&n._finishFetch(t._processResult(e),!0),n})[0]})},skip:function(e){return y(e,"undefined is not a valid skip value"),this._skip=e,this},limit:function(e){return y(e,"undefined is not a valid limit value"),this._limit=e,this},equalTo:function(t,n){return y(t,"undefined is not a valid key"),y(n,"undefined is not a valid value"),this._where[t]=e._encode(n),this},_addCondition:function(t,n,r){return y(t,"undefined is not a valid condition key"),y(n,"undefined is not a valid condition"),y(r,"undefined is not a valid condition value"),this._where[t]||(this._where[t]={}),this._where[t][n]=e._encode(r),this},sizeEqualTo:function(e,t){return this._addCondition(e,"$size",t),this},notEqualTo:function(e,t){return this._addCondition(e,"$ne",t),this},lessThan:function(e,t){return this._addCondition(e,"$lt",t),this},greaterThan:function(e,t){return this._addCondition(e,"$gt",t),this},lessThanOrEqualTo:function(e,t){return this._addCondition(e,"$lte",t),this},greaterThanOrEqualTo:function(e,t){return this._addCondition(e,"$gte",t),this},containedIn:function(e,t){return this._addCondition(e,"$in",t),this},notContainedIn:function(e,t){return this._addCondition(e,"$nin",t),this},containsAll:function(e,t){return this._addCondition(e,"$all",t),this},exists:function(e){return this._addCondition(e,"$exists",!0),this},doesNotExist:function(e){return this._addCondition(e,"$exists",!1),this},matches:function(e,t,n){return this._addCondition(e,"$regex",t),n||(n=""),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),n&&n.length&&this._addCondition(e,"$options",n),this},matchesQuery:function(e,t){var n=t._getParams();return n.className=t.className,this._addCondition(e,"$inQuery",n),this},doesNotMatchQuery:function(e,t){var n=t._getParams();return n.className=t.className,this._addCondition(e,"$notInQuery",n),this},matchesKeyInQuery:function(e,t,n){var r=n._getParams();return r.className=n.className,this._addCondition(e,"$select",{key:t,query:r}),this},doesNotMatchKeyInQuery:function(e,t,n){var r=n._getParams();return r.className=n.className,this._addCondition(e,"$dontSelect",{key:t,query:r}),this},_orQuery:function(e){var t=u.map(e,function(e){return e._getParams().where});return this._where.$or=t,this},_andQuery:function(e){var t=u.map(e,function(e){return e._getParams().where});return this._where.$and=t,this},_quote:function(e){return"\\Q"+e.replace("\\E","\\E\\\\E\\Q")+"\\E"},contains:function(e,t){return this._addCondition(e,"$regex",this._quote(t)),this},startsWith:function(e,t){return this._addCondition(e,"$regex","^"+this._quote(t)),this},endsWith:function(e,t){return this._addCondition(e,"$regex",this._quote(t)+"$"),this},ascending:function(e){return y(e,"undefined is not a valid key"),this._order=e,this},addAscending:function(e){return y(e,"undefined is not a valid key"),this._order?this._order+=","+e:this._order=e,this},descending:function(e){return y(e,"undefined is not a valid key"),this._order="-"+e,this},addDescending:function(e){return y(e,"undefined is not a valid key"),this._order?this._order+=",-"+e:this._order="-"+e,this},near:function(t,n){return n instanceof e.GeoPoint||(n=new e.GeoPoint(n)),this._addCondition(t,"$nearSphere",n),this},withinRadians:function(e,t,n){return this.near(e,t),this._addCondition(e,"$maxDistance",n),this},withinMiles:function(e,t,n){return this.withinRadians(e,t,n/3958.8)},withinKilometers:function(e,t,n){return this.withinRadians(e,t,n/6371)},withinGeoBox:function(t,n,r){return n instanceof e.GeoPoint||(n=new e.GeoPoint(n)),r instanceof e.GeoPoint||(r=new e.GeoPoint(r)),this._addCondition(t,"$within",{$box:[n,r]}),this},include:function(e){var t=this;return y(e,"undefined is not a valid key"),u.forEach(arguments,function(e){t._include=t._include.concat(v(e))}),this},includeACL:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._includeACL=e,this},select:function(e){var t=this;return y(e,"undefined is not a valid key"),u.forEach(arguments,function(e){t._select=t._select.concat(v(e))}),this},each:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._order||this._skip||this._limit>=0){var r=new Error("Cannot iterate on a query with sort, skip, or limit.");return s.default.reject(r)}var i=new e.Query(this.objectClass);i._limit=n.batchSize||100,i._where=u.clone(this._where),i._include=u.clone(this._include),i.ascending("objectId");var o=!1;return g(function(){return!o},function(){return i.find(n).then(function(e){var n=s.default.resolve();return u.each(e,function(e){n=n.then(function(){return t(e)})}),n.then(function(){e.length>=i._limit?i.greaterThan("objectId",e[e.length-1].id):o=!0})})})},subscribe:function(t){return e.LiveQuery.init(this,t)}}),e.FriendShipQuery=e.Query._extend({_newObject:function(){return new(e.Object._getSubclass("_User"))},_processResult:function(e){if(e&&e[this._friendshipTag]){var t=e[this._friendshipTag];return"Pointer"===t.__type&&"_User"===t.className&&(delete t.__type,delete t.className),t}return null}})}},function(e,t,n){"use strict";var r=n(3),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(0),a=n(177),s=n(19),u=s.inherits,c=n(14),f=c.request,l=function(e,t){return f({method:"POST",path:"/LiveQuery/subscribe",data:{query:e,id:t}})};e.exports=function(e){var t=function(){if(!e._config.realtime)throw new Error("LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query")};e.LiveQuery=u(a,{constructor:function(e,t,n,r){var i=this;a.apply(this),this.id=e,this._client=t,this._client.register(this),this._queryJSON=n,this._subscriptionId=r,this._onMessage=this._dispatch.bind(this),this._onReconnect=function(){l(i._queryJSON,i._subscriptionId).catch(function(e){return console.error("LiveQuery resubscribe error: "+e.message)})},t.on("message",this._onMessage),t.on("reconnect",this._onReconnect)},_dispatch:function(t){var n=this;t.forEach(function(t){var r=t.op,i=t.object,a=t.query_id,s=t.updatedKeys;if(a===n.id){var u=e.parseJSON(o.extend({__type:"_File"===i.className?"File":"Object"},i));s?n.emit(r,u,s):n.emit(r,u)}})},unsubscribe:function(){var e=this._client;return e.off("message",this._onMessage),e.off("reconnect",this._onReconnect),e.deregister(this),f({method:"POST",path:"/LiveQuery/unsubscribe",data:{id:e.id,query_id:this.id}})}},{init:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.subscriptionId,a=void 0===o?e._getSubscriptionId():o;if(t(),!(n instanceof e.Query))throw new TypeError("LiveQuery must be inited with a Query");return i.default.resolve(a).then(function(t){return e._config.realtime.createLiveQueryClient(t).then(function(r){var i=n._getParams(),o=i.where,a=i.keys,s=i.returnACL,u={where:o,keys:a,returnACL:s,className:n.className},c=l(u,t).then(function(n){var i=n.query_id;return new e.LiveQuery(i,r,u,t)}).finally(function(){r.deregister(c)});return r.register(c),c})})},pause:function(){return t(),e._config.realtime.pause()},resume:function(){return t(),e._config.realtime.resume()}})}},function(e,t,n){"use strict";var r=n(0),i=n(19),o=i.tap;e.exports=function(e){e.Captcha=function(e,t){this._options=e,this._authOptions=t,this.url=void 0,this.captchaToken=void 0,this.validateToken=void 0},e.Captcha.prototype.refresh=function(){var t=this;return e.Cloud._requestCaptcha(this._options,this._authOptions).then(function(e){var n=e.captchaToken,i=e.url;return r.extend(t,{captchaToken:n,url:i}),i})},e.Captcha.prototype.verify=function(t){var n=this;return e.Cloud.verifyCaptcha(t,this.captchaToken).then(o(function(e){return n.validateToken=e}))},e.Captcha.request=function(t,n){var r=new e.Captcha(t,n);return r.refresh().then(function(){return r})}}},function(e,t,n){"use strict";var r=n(3),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(0),a=n(14),s=a._request,u=a.request;e.exports=function(e){e.Cloud=e.Cloud||{},o.extend(e.Cloud,{run:function(t,n,r){return u({service:"engine",method:"POST",path:"/functions/"+t,data:e._encode(n,null,!0),authOptions:r}).then(function(t){return e._decode(t).result})},rpc:function(t,n,r){return o.isArray(n)?i.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK.")):u({service:"engine",method:"POST",path:"/call/"+t,data:e._encodeObjectOrArray(n),authOptions:r}).then(function(t){return e._decode(t).result})},getServerDate:function(){return s("date",null,null,"GET").then(function(t){return e._decode(t)})},requestSmsCode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o.isString(e)&&(e={mobilePhoneNumber:e}),!e.mobilePhoneNumber)throw new Error("Missing mobilePhoneNumber.");return t.validateToken&&(e=o.extend({},e,{validate_token:t.validateToken})),s("requestSmsCode",null,null,"POST",e,t)},verifySmsCode:function(e,t){if(!e)throw new Error("Missing sms code.");var n={};return o.isString(t)&&(n.mobilePhoneNumber=t),s("verifySmsCode",e,null,"POST",n)},_requestCaptcha:function(e,t){return s("requestCaptcha",null,null,"GET",e,t).then(function(e){var t=e.captcha_url;return{captchaToken:e.captcha_token,url:t}})},requestCaptcha:e.Captcha.request,verifyCaptcha:function(e,t){return s("verifyCaptcha",null,null,"POST",{captcha_code:e,captcha_token:t}).then(function(e){return e.validate_token})}})}},function(e,t,n){"use strict";var r=n(14).request;e.exports=function(e){e.Installation=e.Object.extend("_Installation"),e.Push=e.Push||{},e.Push.send=function(e,t){if(e.where&&(e.where=e.where._getParams().where),e.where&&e.cql)throw new Error("Both where and cql can't be set");if(e.push_time&&(e.push_time=e.push_time.toJSON()),e.expiration_time&&(e.expiration_time=e.expiration_time.toJSON()),e.expiration_time&&e.expiration_interval)throw new Error("Both expiration_time and expiration_interval can't be set");return r({service:"push",method:"POST",path:"/push",data:e,authOptions:t})}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(3),o=r(i),a=n(43),s=r(a),u=n(0),c=n(14)._request,f=n(19),l=f.getSessionToken;e.exports=function(e){var t=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return l(t)?e.User._fetchUserBySessionToken(l(t)):e.User.currentAsync()},n=function(n){return t(n).then(function(t){return e.Object.createWithoutData("_User",t.id)._toPointer()})};e.Status=function(e,t){return this.data={},this.inboxType="default",this.query=null,e&&"object"===(void 0===e?"undefined":(0,s.default)(e))?this.data=e:(e&&(this.data.image=e),t&&(this.data.message=t)),this},u.extend(e.Status.prototype,{get:function(e){return this.data[e]},set:function(e,t){return this.data[e]=t,this},destroy:function(e){return this.id?c("statuses",null,this.id,"DELETE",e):o.default.reject(new Error("The status id is not exists."))},toObject:function(){return this.id?e.Object.createWithoutData("_Status",this.id):null},_getDataJSON:function(){var t=u.clone(this.data);return e._encode(t)},send:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!l(r)&&!e.User.current())throw new Error("Please signin an user.");return this.query?n(r).then(function(e){var n=t.query._getParams();n.className=t.query.className;var i={};return i.query=n,t.data=t.data||{},t.data.source=t.data.source||e,i.data=t._getDataJSON(),i.inboxType=t.inboxType||"default",c("statuses",null,null,"POST",i,r)}).then(function(n){return t.id=n.objectId,t.createdAt=e._parseDate(n.createdAt),t}):e.Status.sendStatusToFollowers(this,r)},_finishFetch:function(t){this.id=t.objectId,this.createdAt=e._parseDate(t.createdAt),this.updatedAt=e._parseDate(t.updatedAt),this.messageId=t.messageId,delete t.messageId,delete t.objectId,delete t.createdAt,delete t.updatedAt,this.data=e._decode(t)}}),e.Status.sendStatusToFollowers=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!l(r)&&!e.User.current())throw new Error("Please signin an user.");return n(r).then(function(n){var i={};i.className="_Follower",i.keys="follower",i.where={user:n};var o={};return o.query=i,t.data=t.data||{},t.data.source=t.data.source||n,o.data=t._getDataJSON(),o.inboxType=t.inboxType||"default",c("statuses",null,null,"POST",o,r).then(function(n){return t.id=n.objectId,t.createdAt=e._parseDate(n.createdAt),t})})},e.Status.sendPrivateStatus=function(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!l(i)&&!e.User.current())throw new Error("Please signin an user.");if(!r)throw new Error("Invalid target user.");var o=u.isString(r)?r:r.id;if(!o)throw new Error("Invalid target user.");return n(i).then(function(n){var r={};r.className="_User",r.where={objectId:o};var a={};return a.query=r,t.data=t.data||{},t.data.source=t.data.source||n,a.data=t._getDataJSON(),a.inboxType="private",t.inboxType="private",c("statuses",null,null,"POST",a,i).then(function(n){return t.id=n.objectId,t.createdAt=e._parseDate(n.createdAt),t})})},e.Status.countUnreadStatuses=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(u.isString(r)||(i=r),!l(i)&&null==n&&!e.User.current())throw new Error("Please signin an user or pass the owner objectId.");return o.default.resolve(n||t(i)).then(function(t){var n={};return n.inboxType=e._encode(r),n.owner=e._encode(t),c("subscribe/statuses/count",null,null,"GET",n,i)})},e.Status.resetUnreadCount=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(u.isString(r)||(i=r),!l(i)&&null==n&&!e.User.current())throw new Error("Please signin an user or pass the owner objectId.");return o.default.resolve(n||t(i)).then(function(t){var n={};return n.inboxType=e._encode(r),n.owner=e._encode(t),c("subscribe/statuses/resetUnreadCount",null,null,"POST",n,i)})},e.Status.statusQuery=function(t){var n=new e.Query("_Status");return t&&n.equalTo("source",t),n},e.InboxQuery=e.Query._extend({_objectClass:e.Status,_sinceId:0,_maxId:0,_inboxType:"default",_owner:null,_newObject:function(){return new e.Status},_createRequest:function(t,n){return e.InboxQuery.__super__._createRequest.call(this,t,n,"/subscribe/statuses")},sinceId:function(e){return this._sinceId=e,this},maxId:function(e){return this._maxId=e,this},owner:function(e){return this._owner=e,this},inboxType:function(e){return this._inboxType=e,this},_getParams:function(){var t=e.InboxQuery.__super__._getParams.call(this);return t.owner=e._encode(this._owner),t.inboxType=e._encode(this._inboxType),t.sinceId=e._encode(this._sinceId),t.maxId=e._encode(this._maxId),t}}),e.Status.inboxQuery=function(t,n){var r=new e.InboxQuery(e.Status);return t&&(r._owner=t),n&&(r._inboxType=n),r}}},function(e,t,n){"use strict";var r=n(21),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(0),a=n(14)._request;e.exports=function(e){e.SearchSortBuilder=function(){this._sortFields=[]},o.extend(e.SearchSortBuilder.prototype,{_addField:function(e,t,n,r){var i={};return i[e]={order:t||"asc",mode:n||"avg",missing:"_"+(r||"last")},this._sortFields.push(i),this},ascending:function(e,t,n){return this._addField(e,"asc",t,n)},descending:function(e,t,n){return this._addField(e,"desc",t,n)},whereNear:function(e,t,n){n=n||{};var r={},i={lat:t.latitude,lon:t.longitude},o={order:n.order||"asc",mode:n.mode||"avg",unit:n.unit||"km"};return o[e]=i,r._geo_distance=o,this._sortFields.push(r),this},build:function(){return(0,i.default)(e._encode(this._sortFields))}}),e.SearchQuery=e.Query._extend({_sid:null,_hits:0,_queryString:null,_highlights:null,_sortBuilder:null,_clazz:null,constructor:function(t){t?this._clazz=t:t="__INVALID_CLASS",e.Query.call(this,t)},_createRequest:function(e,t){return a("search/select",null,null,"GET",e||this._getParams(),t)},sid:function(e){return this._sid=e,this},queryString:function(e){return this._queryString=e,this},highlights:function(e){var t;return t=e&&o.isString(e)?o.toArray(arguments):e,this._highlights=t,this},sortBy:function(e){return this._sortBuilder=e,this},hits:function(){return this._hits||(this._hits=0),this._hits},_processResult:function(e){return delete e.className,delete e._app_url,delete e._deeplink,e},hasMore:function(){return!this._hitEnd},reset:function(){this._hitEnd=!1,this._sid=null,this._hits=0},find:function(e){var t=this;return this._createRequest(void 0,e).then(function(e){return e.sid?(t._oldSid=t._sid,t._sid=e.sid):(t._sid=null,t._hitEnd=!0),t._hits=e.hits||0,o.map(e.results,function(n){n.className&&(e.className=n.className);var r=t._newObject(e);return r.appURL=n._app_url,r._finishFetch(t._processResult(n),!0),r})})},_getParams:function(){var t=e.SearchQuery.__super__._getParams.call(this);if(delete t.where,this._clazz&&(t.clazz=this.className),this._sid&&(t.sid=this._sid),!this._queryString)throw new Error("Please set query string.");if(t.q=this._queryString,this._highlights&&(t.highlights=this._highlights.join(",")),this._sortBuilder&&t.order)throw new Error("sort and order can not be set at same time.");return this._sortBuilder&&(t.sort=this._sortBuilder.build()),t}})}},function(e,t,n){"use strict";var r=n(3),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(0),a=n(33),s=n(14),u=s.request;e.exports=function(e){e.Insight=e.Insight||{},o.extend(e.Insight,{startJob:function(t,n){if(!t||!t.sql)throw new Error("Please provide the sql to run the job.");var r={jobConfig:t,appId:e.applicationId};return u({path:"/bigquery/jobs",method:"POST",data:e._encode(r,null,!0),authOptions:n,signKey:!1}).then(function(t){return e._decode(t).id})},on:function(e,t){}}),e.Insight.JobQuery=function(e,t){if(!e)throw new Error("Please provide the job id.");this.id=e,this.className=t,this._skip=0,this._limit=100},o.extend(e.Insight.JobQuery.prototype,{skip:function(e){return this._skip=e,this},limit:function(e){return this._limit=e,this},find:function(e){var t={skip:this._skip,limit:this._limit};return u({path:"/bigquery/jobs/"+this.id,method:"GET",query:t,authOptions:e,signKey:!1}).then(function(e){return e.error?i.default.reject(new a(e.code,e.error)):i.default.resolve(e)})}})}},function(e,t,n){"use strict";var r=n(0),i=n(14),o=i.request,a=n(19),s=a.getSessionToken;e.exports=function(e){e.Friendship={request:function(t,n){if(!e.User.current())throw new Error("Please signin an user.");var i=void 0,a=void 0;t.friend?(i=t.friend,a=t.attributes):i=t;var s=r.isString(i)?e.Object.createWithoutData("_User",i):i;return o({method:"POST",path:"/users/friendshipRequests",data:e._encode({user:e.User.current(),friend:s,friendship:a}),authOptions:n})},acceptRequest:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!s(n)&&!e.User.current())throw new Error("Please signin an user.");var i=void 0,a=void 0;t.request?(i=t.request,a=t.attributes):i=t;var u=r.isString(i)?i:i.id;return o({method:"PUT",path:"/users/friendshipRequests/"+u+"/accept",data:{friendship:e._encode(a)},authOptions:n})},declineRequest:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!s(n)&&!e.User.current())throw new Error("Please signin an user.");var i=r.isString(t)?t:t.id;return o({method:"PUT",path:"/users/friendshipRequests/"+i+"/decline",authOptions:n})}}}},function(e,t,n){"use strict";var r=n(21),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=n(0),a=n(14),s=a._request,u=n(41),c=function(e){return"string"==typeof e?e:"function"==typeof e.getPayload?(0,i.default)(e.getPayload()):(0,i.default)(e)};e.exports=u.Object.extend("_Conversation",{constructor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u.Object.prototype.constructor.call(this,null,null),this.set("name",e),void 0!==t.isSystem&&this.set("sys",!!t.isSystem),void 0!==t.isTransient&&this.set("tr",!!t.isTransient)},getCreator:function(){return this.get("c")},getLastMessageAt:function(){return this.get("lm")},getMembers:function(){return this.get("m")},addMember:function(e){return this.add("m",e)},getMutedMembers:function(){return this.get("mu")},getName:function(){return this.get("name")},isTransient:function(){return this.get("tr")},isSystem:function(){return this.get("sys")},send:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={from_peer:e,conv_id:this.id,transient:!1,message:c(t)};return void 0!==n.toClients&&(i.to_peers=n.toClients),void 0!==n.transient&&(i.transient=!!n.transient),void 0!==n.pushData&&(i.push_data=n.pushData),s("rtm","messages",null,"POST",i,r)},broadcast:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={from_peer:e,conv_id:this.id,message:c(t)};if(void 0!==n.pushData&&(i.push=n.pushData),void 0!==n.validTill){var a=n.validTill;o.isDate(a)&&(a=a.getTime()),n.valid_till=a}return s("rtm","broadcast",null,"POST",i,r)}})},function(e,t,n){"use strict";function r(e){var t=e.name,n=e.value,r=e.version;this.name=t,this.value=n,this.version=r}var i=n(3),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(0),s=n(14),u=s.request,c=n(19),f=c.ensureArray,l=c.parseDate,h=n(41);h.LeaderboardVersionChangeInterval={NEVER:"never",DAY:"day",WEEK:"week",MONTH:"month"},h.LeaderboardOrder={ASCENDING:"ascending",DESCENDING:"descending"},h.LeaderboardUpdateStrategy={BETTER:"better",LAST:"last",SUM:"sum"};var d=function(e){var t=h._decode(e);return new r({name:t.statisticName,value:t.statisticValue,version:t.version})};h.Leaderboard=function(e){this.statisticName=e,this.order=void 0,this.updateStrategy=void 0,this.versionChangeInterval=void 0,this.version=void 0,this.nextResetAt=void 0,this.createdAt=void 0};var p=h.Leaderboard;h.Leaderboard.createWithoutData=function(e){return new p(e)},h.Leaderboard.createLeaderboard=function(e,t){var n=e.statisticName,r=e.order,i=e.versionChangeInterval,o=e.updateStrategy;return u({method:"POST",path:"/leaderboard/leaderboards",data:{statisticName:n,order:r,versionChangeInterval:i,updateStrategy:o},authOptions:t}).then(function(e){return new p(n)._finishFetch(e)})},h.Leaderboard.getLeaderboard=function(e,t){return p.createWithoutData(e).fetch(t)},h.Leaderboard.getStatistics=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.statisticNames,r=arguments[2];return o.default.resolve().then(function(){if(!e||!e.id)throw new Error("user must be an AV.User");return u({method:"GET",path:"/leaderboard/users/"+e.id+"/statistics",query:{statistics:n?f(n).join(","):void 0},authOptions:r}).then(function(e){return e.results.map(d)})})},h.Leaderboard.updateStatistics=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return o.default.resolve().then(function(){if(!e||!e.id)throw new Error("user must be an AV.User");var r=a.map(t,function(e,t){return{statisticName:t,statisticValue:e}}),i=n.overwrite;return u({method:"POST",path:"/leaderboard/users/"+e.id+"/statistics",query:{overwrite:i?1:void 0},data:r,authOptions:n}).then(function(e){return e.results.map(d)})})},h.Leaderboard.deleteStatistics=function(e,t,n){return o.default.resolve().then(function(){if(!e||!e.id)throw new Error("user must be an AV.User");return u({method:"DELETE",path:"/leaderboard/users/"+e.id+"/statistics",query:{statistics:f(t).join(",")},authOptions:n}).then(function(){})})},a.extend(p.prototype,{_finishFetch:function(e){var t=this;return a.forEach(e,function(e,n){"updatedAt"!==n&&"objectId"!==n&&("expiredAt"===n&&(n="nextResetAt"),"createdAt"===n&&(e=l(e)),e&&"Date"===e.__type&&(e=l(e.iso)),t[n]=e)}),this},fetch:function(e){var t=this;return u({method:"GET",path:"/leaderboard/leaderboards/"+this.statisticName,authOptions:e}).then(function(e){return t._finishFetch(e)})},count:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=arguments[1];return u({method:"GET",path:"/leaderboard/leaderboards/"+this.statisticName+"/ranks",query:{count:1,limit:0,version:t},authOptions:n}).then(function(e){return e.count})},_getResults:function(e,t,n){var r=e.skip,i=e.limit,o=e.selectUserKeys,s=e.includeUserKeys,c=e.includeStatistics,l=e.version;return u({method:"GET",path:"/leaderboard/leaderboards/"+this.statisticName+"/ranks"+(n?"/"+n:""),query:{skip:r,limit:i,selectUserKeys:a.union(f(o),f(s)).join(",")||void 0,includeUser:s?f(s).join(","):void 0,includeStatistics:c?f(c).join(","):void 0,version:l},authOptions:t}).then(function(e){return e.results.map(function(e){var t=h._decode(e),n=t.user,r=t.statisticValue,i=t.rank,o=t.statistics;return{user:n,value:r,rank:i,includedStatistics:(void 0===o?[]:o).map(d)}})})},getResults:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.skip,n=e.limit,r=e.selectUserKeys,i=e.includeUserKeys,o=e.includeStatistics,a=e.version,s=arguments[1];return this._getResults({skip:t,limit:n,selectUserKeys:r,includeUserKeys:i,includeStatistics:o,version:a},s)},getResultsAroundUser:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];if(e&&"string"!=typeof e.id)return this.getResultsAroundUser(void 0,e,t);var r=t.limit,i=t.selectUserKeys,o=t.includeUserKeys,a=t.includeStatistics,s=t.version;return this._getResults({limit:r,selectUserKeys:i,includeUserKeys:o,includeStatistics:a,version:s},n,e?e.id:"self")},_update:function(e,t){var n=this;return u({method:"PUT",path:"/leaderboard/leaderboards/"+this.statisticName,data:e,authOptions:t}).then(function(e){return n._finishFetch(e)})},updateVersionChangeInterval:function(e,t){return this._update({versionChangeInterval:e},t)},updateUpdateStrategy:function(e,t){return this._update({updateStrategy:e},t)},reset:function(e){var t=this;return u({method:"PUT",path:"/leaderboard/leaderboards/"+this.statisticName+"/incrementVersion",authOptions:e}).then(function(e){return t._finishFetch(e)})},destroy:function(e){return h.request({method:"DELETE",path:"/leaderboard/leaderboards/"+this.statisticName,authOptions:e}).then(function(){})},getArchives:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.skip,r=t.limit,i=arguments[1];return u({method:"GET",path:"/leaderboard/leaderboards/"+this.statisticName+"/archives",query:{skip:n,limit:r},authOptions:i}).then(function(t){return t.results.map(function(t){var n=t.version,r=t.status,i=t.url,o=t.activatedAt,a=t.deactivatedAt;return{statisticName:e.statisticName,version:n,status:r,url:i,activatedAt:l(o.iso),deactivatedAt:l(a.iso)}})})}})},function(e,t,n){"use strict";var r=n(110),i=r.Realtime,o=r.setAdapters,a=n(445),s=a.LiveQueryPlugin;i.__preRegisteredPlugins=[s],e.exports=function(e){e._sharedConfig.liveQueryRealtime=i;var t=e.setAdapters;return e.setAdapters=function(e){t(e),o(e)},e}},function(e,t,n){"use strict";(function(e){function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return e&&"object"===(void 0===e?"undefined":(0,D.default)(e))&&"default"in e?e.default:e}function o(e,t){var n=(0,x.default)(e);if(j.default){var r=(0,j.default)(e);t&&(r=r.filter(function(t){return(0,A.default)(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){Y(e,t,n[t])}):T.default?(0,E.default)(e,(0,T.default)(n)):o(Object(n)).forEach(function(t){(0,_.default)(e,t,(0,A.default)(n,t))})}return e}function s(e,t){var n=(0,x.default)(e);if(j.default){var r=(0,j.default)(e);t&&(r=r.filter(function(t){return(0,A.default)(e,t).enumerable})),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){Y(e,t,n[t])}):T.default?(0,E.default)(e,(0,T.default)(n)):s(Object(n)).forEach(function(t){(0,_.default)(e,t,(0,A.default)(n,t))})}return e}function c(e,t){var n=(0,x.default)(e);if(j.default){var r=(0,j.default)(e);t&&(r=r.filter(function(t){return(0,A.default)(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach(function(t){Y(e,t,n[t])}):T.default?(0,E.default)(e,(0,T.default)(n)):c(Object(n)).forEach(function(t){(0,_.default)(e,t,(0,A.default)(n,t))})}return e}var l=n(188),h=r(l),d=n(21),p=r(d),v=n(374),m=r(v),g=n(3),y=r(g),b=n(70),_=r(b),w=n(380),E=r(w),O=n(383),T=r(O),S=n(186),A=r(S),I=n(194),j=r(I),C=n(105),x=r(C),N=n(180),P=r(N),R=n(195),U=r(R),L=n(390),k=r(L),M=n(43),D=r(M);Object.defineProperty(t,"__esModule",{value:!0});var F=i(n(393)),V=i(n(397)),B=i(n(398)),q=i(n(400)),W=i(n(401)),Y=i(n(404)),z=i(n(405)),Q=i(n(407)),G=i(n(408)),K=i(n(32)),J=i(n(409)),$=i(n(200)),H=i(n(436)),Z=i(n(439)),X=i(n(440)),ee=i(n(441)),te=i(n(442)),ne=i(n(443)),re=n(183),ie=F.newBuilder({}).import({package:"push_server.messages2",syntax:"proto2",options:{objc_class_prefix:"AVIM"},messages:[{name:"JsonObjectMessage",syntax:"proto2",fields:[{rule:"required",type:"string",name:"data",id:1}]},{name:"UnreadTuple",syntax:"proto2",fields:[{rule:"required",type:"string",name:"cid",id:1},{rule:"required",type:"int32",name:"unread",id:2},{rule:"optional",type:"string",name:"mid",id:3},{rule:"optional",type:"int64",name:"timestamp",id:4},{rule:"optional",type:"string",name:"from",id:5},{rule:"optional",type:"string",name:"data",id:6},{rule:"optional",type:"int64",name:"patchTimestamp",id:7},{rule:"optional",type:"bool",name:"mentioned",id:8},{rule:"optional",type:"bytes",name:"binaryMsg",id:9},{rule:"optional",type:"int32",name:"convType",id:10}]},{name:"LogItem",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"from",id:1},{rule:"optional",type:"string",name:"data",id:2},{rule:"optional",type:"int64",name:"timestamp",id:3},{rule:"optional",type:"string",name:"msgId",id:4},{rule:"optional",type:"int64",name:"ackAt",id:5},{rule:"optional",type:"int64",name:"readAt",id:6},{rule:"optional",type:"int64",name:"patchTimestamp",id:7},{rule:"optional",type:"bool",name:"mentionAll",id:8},{rule:"repeated",type:"string",name:"mentionPids",id:9},{rule:"optional",type:"bool",name:"bin",id:10},{rule:"optional",type:"int32",name:"convType",id:11}]},{name:"ConvMemberInfo",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"pid",id:1},{rule:"optional",type:"string",name:"role",id:2},{rule:"optional",type:"string",name:"infoId",id:3}]},{name:"DataCommand",syntax:"proto2",fields:[{rule:"repeated",type:"string",name:"ids",id:1},{rule:"repeated",type:"JsonObjectMessage",name:"msg",id:2},{rule:"optional",type:"bool",name:"offline",id:3}]},{name:"SessionCommand",syntax:"proto2",fields:[{rule:"optional",type:"int64",name:"t",id:1},{rule:"optional",type:"string",name:"n",id:2},{rule:"optional",type:"string",name:"s",id:3},{rule:"optional",type:"string",name:"ua",id:4},{rule:"optional",type:"bool",name:"r",id:5},{rule:"optional",type:"string",name:"tag",id:6},{rule:"optional",type:"string",name:"deviceId",id:7},{rule:"repeated",type:"string",name:"sessionPeerIds",id:8},{rule:"repeated",type:"string",name:"onlineSessionPeerIds",id:9},{rule:"optional",type:"string",name:"st",id:10},{rule:"optional",type:"int32",name:"stTtl",id:11},{rule:"optional",type:"int32",name:"code",id:12},{rule:"optional",type:"string",name:"reason",id:13},{rule:"optional",type:"string",name:"deviceToken",id:14},{rule:"optional",type:"bool",name:"sp",id:15},{rule:"optional",type:"string",name:"detail",id:16},{rule:"optional",type:"int64",name:"lastUnreadNotifTime",id:17},{rule:"optional",type:"int64",name:"lastPatchTime",id:18},{rule:"optional",type:"int64",name:"configBitmap",id:19}]},{name:"ErrorCommand",syntax:"proto2",fields:[{rule:"required",type:"int32",name:"code",id:1},{rule:"required",type:"string",name:"reason",id:2},{rule:"optional",type:"int32",name:"appCode",id:3},{rule:"optional",type:"string",name:"detail",id:4},{rule:"repeated",type:"string",name:"pids",id:5},{rule:"optional",type:"string",name:"appMsg",id:6}]},{name:"DirectCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"msg",id:1},{rule:"optional",type:"string",name:"uid",id:2},{rule:"optional",type:"string",name:"fromPeerId",id:3},{rule:"optional",type:"int64",name:"timestamp",id:4},{rule:"optional",type:"bool",name:"offline",id:5},{rule:"optional",type:"bool",name:"hasMore",id:6},{rule:"repeated",type:"string",name:"toPeerIds",id:7},{rule:"optional",type:"bool",name:"r",id:10},{rule:"optional",type:"string",name:"cid",id:11},{rule:"optional",type:"string",name:"id",id:12},{rule:"optional",type:"bool",name:"transient",id:13},{rule:"optional",type:"string",name:"dt",id:14},{rule:"optional",type:"string",name:"roomId",id:15},{rule:"optional",type:"string",name:"pushData",id:16},{rule:"optional",type:"bool",name:"will",id:17},{rule:"optional",type:"int64",name:"patchTimestamp",id:18},{rule:"optional",type:"bytes",name:"binaryMsg",id:19},{rule:"repeated",type:"string",name:"mentionPids",id:20},{rule:"optional",type:"bool",name:"mentionAll",id:21},{rule:"optional",type:"int32",name:"convType",id:22}]},{name:"AckCommand",syntax:"proto2",fields:[{rule:"optional",type:"int32",name:"code",id:1},{rule:"optional",type:"string",name:"reason",id:2},{rule:"optional",type:"string",name:"mid",id:3},{rule:"optional",type:"string",name:"cid",id:4},{rule:"optional",type:"int64",name:"t",id:5},{rule:"optional",type:"string",name:"uid",id:6},{rule:"optional",type:"int64",name:"fromts",id:7},{rule:"optional",type:"int64",name:"tots",id:8},{rule:"optional",type:"string",name:"type",id:9},{rule:"repeated",type:"string",name:"ids",id:10},{rule:"optional",type:"int32",name:"appCode",id:11},{rule:"optional",type:"string",name:"appMsg",id:12}]},{name:"UnreadCommand",syntax:"proto2",fields:[{rule:"repeated",type:"UnreadTuple",name:"convs",id:1},{rule:"optional",type:"int64",name:"notifTime",id:2}]},{name:"ConvCommand",syntax:"proto2",fields:[{rule:"repeated",type:"string",name:"m",id:1},{rule:"optional",type:"bool",name:"transient",id:2},{rule:"optional",type:"bool",name:"unique",id:3},{rule:"optional",type:"string",name:"cid",id:4},{rule:"optional",type:"string",name:"cdate",id:5},{rule:"optional",type:"string",name:"initBy",id:6},{rule:"optional",type:"string",name:"sort",id:7},{rule:"optional",type:"int32",name:"limit",id:8},{rule:"optional",type:"int32",name:"skip",id:9},{rule:"optional",type:"int32",name:"flag",id:10},{rule:"optional",type:"int32",name:"count",id:11},{rule:"optional",type:"string",name:"udate",id:12},{rule:"optional",type:"int64",name:"t",id:13},{rule:"optional",type:"string",name:"n",id:14},{rule:"optional",type:"string",name:"s",id:15},{rule:"optional",type:"bool",name:"statusSub",id:16},{rule:"optional",type:"bool",name:"statusPub",id:17},{rule:"optional",type:"int32",name:"statusTTL",id:18},{rule:"optional",type:"string",name:"uniqueId",id:19},{rule:"optional",type:"string",name:"targetClientId",id:20},{rule:"optional",type:"int64",name:"maxReadTimestamp",id:21},{rule:"optional",type:"int64",name:"maxAckTimestamp",id:22},{rule:"optional",type:"bool",name:"queryAllMembers",id:23},{rule:"repeated",type:"MaxReadTuple",name:"maxReadTuples",id:24},{rule:"repeated",type:"string",name:"cids",id:25},{rule:"optional",type:"ConvMemberInfo",name:"info",id:26},{rule:"optional",type:"bool",name:"tempConv",id:27},{rule:"optional",type:"int32",name:"tempConvTTL",id:28},{rule:"repeated",type:"string",name:"tempConvIds",id:29},{rule:"repeated",type:"string",name:"allowedPids",id:30},{rule:"repeated",type:"ErrorCommand",name:"failedPids",id:31},{rule:"optional",type:"string",name:"next",id:40},{rule:"optional",type:"JsonObjectMessage",name:"results",id:100},{rule:"optional",type:"JsonObjectMessage",name:"where",id:101},{rule:"optional",type:"JsonObjectMessage",name:"attr",id:103},{rule:"optional",type:"JsonObjectMessage",name:"attrModified",id:104}]},{name:"RoomCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"roomId",id:1},{rule:"optional",type:"string",name:"s",id:2},{rule:"optional",type:"int64",name:"t",id:3},{rule:"optional",type:"string",name:"n",id:4},{rule:"optional",type:"bool",name:"transient",id:5},{rule:"repeated",type:"string",name:"roomPeerIds",id:6},{rule:"optional",type:"string",name:"byPeerId",id:7}]},{name:"LogsCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"cid",id:1},{rule:"optional",type:"int32",name:"l",id:2},{rule:"optional",type:"int32",name:"limit",id:3},{rule:"optional",type:"int64",name:"t",id:4},{rule:"optional",type:"int64",name:"tt",id:5},{rule:"optional",type:"string",name:"tmid",id:6},{rule:"optional",type:"string",name:"mid",id:7},{rule:"optional",type:"string",name:"checksum",id:8},{rule:"optional",type:"bool",name:"stored",id:9},{rule:"optional",type:"QueryDirection",name:"direction",id:10,options:{default:"OLD"}},{rule:"optional",type:"bool",name:"tIncluded",id:11},{rule:"optional",type:"bool",name:"ttIncluded",id:12},{rule:"optional",type:"int32",name:"lctype",id:13},{rule:"repeated",type:"LogItem",name:"logs",id:105}],enums:[{name:"QueryDirection",syntax:"proto2",values:[{name:"OLD",id:1},{name:"NEW",id:2}]}]},{name:"RcpCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"id",id:1},{rule:"optional",type:"string",name:"cid",id:2},{rule:"optional",type:"int64",name:"t",id:3},{rule:"optional",type:"bool",name:"read",id:4},{rule:"optional",type:"string",name:"from",id:5}]},{name:"ReadTuple",syntax:"proto2",fields:[{rule:"required",type:"string",name:"cid",id:1},{rule:"optional",type:"int64",name:"timestamp",id:2},{rule:"optional",type:"string",name:"mid",id:3}]},{name:"MaxReadTuple",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"pid",id:1},{rule:"optional",type:"int64",name:"maxAckTimestamp",id:2},{rule:"optional",type:"int64",name:"maxReadTimestamp",id:3}]},{name:"ReadCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"cid",id:1},{rule:"repeated",type:"string",name:"cids",id:2},{rule:"repeated",type:"ReadTuple",name:"convs",id:3}]},{name:"PresenceCommand",syntax:"proto2",fields:[{rule:"optional",type:"StatusType",name:"status",id:1},{rule:"repeated",type:"string",name:"sessionPeerIds",id:2},{rule:"optional",type:"string",name:"cid",id:3}]},{name:"ReportCommand",syntax:"proto2",fields:[{rule:"optional",type:"bool",name:"initiative",id:1},{rule:"optional",type:"string",name:"type",id:2},{rule:"optional",type:"string",name:"data",id:3}]},{name:"PatchItem",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"cid",id:1},{rule:"optional",type:"string",name:"mid",id:2},{rule:"optional",type:"int64",name:"timestamp",id:3},{rule:"optional",type:"bool",name:"recall",id:4},{rule:"optional",type:"string",name:"data",id:5},{rule:"optional",type:"int64",name:"patchTimestamp",id:6},{rule:"optional",type:"string",name:"from",id:7},{rule:"optional",type:"bytes",name:"binaryMsg",id:8},{rule:"optional",type:"bool",name:"mentionAll",id:9},{rule:"repeated",type:"string",name:"mentionPids",id:10},{rule:"optional",type:"int64",name:"patchCode",id:11},{rule:"optional",type:"string",name:"patchReason",id:12}]},{name:"PatchCommand",syntax:"proto2",fields:[{rule:"repeated",type:"PatchItem",name:"patches",id:1},{rule:"optional",type:"int64",name:"lastPatchTime",id:2}]},{name:"PubsubCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"cid",id:1},{rule:"repeated",type:"string",name:"cids",id:2},{rule:"optional",type:"string",name:"topic",id:3},{rule:"optional",type:"string",name:"subtopic",id:4},{rule:"repeated",type:"string",name:"topics",id:5},{rule:"repeated",type:"string",name:"subtopics",id:6},{rule:"optional",type:"JsonObjectMessage",name:"results",id:7}]},{name:"BlacklistCommand",syntax:"proto2",fields:[{rule:"optional",type:"string",name:"srcCid",id:1},{rule:"repeated",type:"string",name:"toPids",id:2},{rule:"optional",type:"string",name:"srcPid",id:3},{rule:"repeated",type:"string",name:"toCids",id:4},{rule:"optional",type:"int32",name:"limit",id:5},{rule:"optional",type:"string",name:"next",id:6},{rule:"repeated",type:"string",name:"blockedPids",id:8},{rule:"repeated",type:"string",name:"blockedCids",id:9},{rule:"repeated",type:"string",name:"allowedPids",id:10},{rule:"repeated",type:"ErrorCommand",name:"failedPids",id:11},{rule:"optional",type:"int64",name:"t",id:12},{rule:"optional",type:"string",name:"n",id:13},{rule:"optional",type:"string",name:"s",id:14}]},{name:"GenericCommand",syntax:"proto2",fields:[{rule:"optional",type:"CommandType",name:"cmd",id:1},{rule:"optional",type:"OpType",name:"op",id:2},{rule:"optional",type:"string",name:"appId",id:3},{rule:"optional",type:"string",name:"peerId",id:4},{rule:"optional",type:"int32",name:"i",id:5},{rule:"optional",type:"string",name:"installationId",id:6},{rule:"optional",type:"int32",name:"priority",id:7},{rule:"optional",type:"int32",name:"service",id:8},{rule:"optional",type:"int64",name:"serverTs",id:9},{rule:"optional",type:"int64",name:"clientTs",id:10},{rule:"optional",type:"int32",name:"notificationType",id:11},{rule:"optional",type:"DataCommand",name:"dataMessage",id:101},{rule:"optional",type:"SessionCommand",name:"sessionMessage",id:102},{rule:"optional",type:"ErrorCommand",name:"errorMessage",id:103},{rule:"optional",type:"DirectCommand",name:"directMessage",id:104},{rule:"optional",type:"AckCommand",name:"ackMessage",id:105},{rule:"optional",type:"UnreadCommand",name:"unreadMessage",id:106},{rule:"optional",type:"ReadCommand",name:"readMessage",id:107},{rule:"optional",type:"RcpCommand",name:"rcpMessage",id:108},{rule:"optional",type:"LogsCommand",name:"logsMessage",id:109},{rule:"optional",type:"ConvCommand",name:"convMessage",id:110},{rule:"optional",type:"RoomCommand",name:"roomMessage",id:111},{rule:"optional",type:"PresenceCommand",name:"presenceMessage",id:112},{rule:"optional",type:"ReportCommand",name:"reportMessage",id:113},{rule:"optional",type:"PatchCommand",name:"patchMessage",id:114},{rule:"optional",type:"PubsubCommand",name:"pubsubMessage",id:115},{rule:"optional",type:"BlacklistCommand",name:"blacklistMessage",id:116}]}],enums:[{name:"CommandType",syntax:"proto2",values:[{name:"session",id:0},{name:"conv",id:1},{name:"direct",id:2},{name:"ack",id:3},{name:"rcp",id:4},{name:"unread",id:5},{name:"logs",id:6},{name:"error",id:7},{name:"login",id:8},{name:"data",id:9},{name:"room",id:10},{name:"read",id:11},{name:"presence",id:12},{name:"report",id:13},{name:"echo",id:14},{name:"loggedin",id:15},{name:"logout",id:16},{name:"loggedout",id:17},{name:"patch",id:18},{name:"pubsub",id:19},{name:"blacklist",id:20},{name:"goaway",id:21}]},{name:"OpType",syntax:"proto2",values:[{name:"open",id:1},{name:"add",id:2},{name:"remove",id:3},{name:"close",id:4},{name:"opened",id:5},{name:"closed",id:6},{name:"query",id:7},{name:"query_result",id:8},{name:"conflict",id:9},{name:"added",id:10},{name:"removed",id:11},{name:"refresh",id:12},{name:"refreshed",id:13},{name:"start",id:30},{name:"started",id:31},{name:"joined",id:32},{name:"members_joined",id:33},{name:"left",id:39},{name:"members_left",id:40},{name:"results",id:42},{name:"count",id:43},{name:"result",id:44},{name:"update",id:45},{name:"updated",id:46},{name:"mute",id:47},{name:"unmute",id:48},{name:"status",id:49},{name:"members",id:50},{name:"max_read",id:51},{name:"is_member",id:52},{name:"member_info_update",id:53},{name:"member_info_updated",id:54},{name:"member_info_changed",id:55},{name:"join",id:80},{name:"invite",id:81},{name:"leave",id:82},{name:"kick",id:83},{name:"reject",id:84},{name:"invited",id:85},{name:"kicked",id:86},{name:"upload",id:100},{name:"uploaded",id:101},{name:"subscribe",id:120},{name:"subscribed",id:121},{name:"unsubscribe",id:122},{name:"unsubscribed",id:123},{name:"is_subscribed",id:124},{name:"modify",id:150},{name:"modified",id:151},{name:"block",id:170},{name:"unblock",id:171},{name:"blocked",id:172},{name:"unblocked",id:173},{name:"members_blocked",id:174},{name:"members_unblocked",id:175},{name:"check_block",id:176},{name:"check_result",id:177},{name:"add_shutup",id:180},{name:"remove_shutup",id:181},{name:"query_shutup",id:182},{name:"shutup_added",id:183},{name:"shutup_removed",id:184},{name:"shutup_result",id:185},{name:"shutuped",id:186},{name:"unshutuped",id:187},{name:"members_shutuped",id:188},{name:"members_unshutuped",id:189},{name:"check_shutup",id:190}]},{name:"StatusType",syntax:"proto2",values:[{name:"on",id:1},{name:"off",id:2}]}],isNamespace:!0}).build(),oe=ie.push_server.messages2,ae=oe.JsonObjectMessage,se=oe.UnreadTuple,ue=oe.LogItem,ce=oe.DataCommand,fe=oe.SessionCommand,le=oe.ErrorCommand,he=oe.DirectCommand,de=oe.AckCommand,pe=oe.UnreadCommand,ve=oe.ConvCommand,me=oe.RoomCommand,ge=oe.LogsCommand,ye=oe.RcpCommand,be=oe.ReadTuple,_e=oe.MaxReadTuple,we=oe.ReadCommand,Ee=oe.PresenceCommand,Oe=oe.ReportCommand,Te=oe.GenericCommand,Se=oe.BlacklistCommand,Ae=oe.PatchCommand,Ie=oe.PatchItem,je=oe.ConvMemberInfo,Ce=oe.CommandType,xe=oe.OpType,Ne=oe.StatusType,Pe=(0,k.default)({__proto__:null,JsonObjectMessage:ae,UnreadTuple:se,LogItem:ue,DataCommand:ce,SessionCommand:fe,ErrorCommand:le,DirectCommand:he,AckCommand:de,UnreadCommand:pe,ConvCommand:ve,RoomCommand:me,LogsCommand:ge,RcpCommand:ye,ReadTuple:be,MaxReadTuple:_e,ReadCommand:we,PresenceCommand:Ee,ReportCommand:Oe,GenericCommand:Te,BlacklistCommand:Se,PatchCommand:Ae,PatchItem:Ie,ConvMemberInfo:je,CommandType:Ce,OpType:xe,StatusType:Ne}),Re={},Ue=function(e){var t=Re[e];if(void 0===t)throw new Error("".concat(e," adapter is not configured"));return t},Le=function(e){(0,U.default)(Re,e)},ke=void 0!==e?e:"undefined"!=typeof window?window:{},Me=(0,P.default)("expired"),De=K("LC:Expirable"),Fe=function(){function e(e,t){this.originalValue=e,"number"==typeof t&&(this.expiredAt=Date.now()+t)}return Z(e,[{key:"value",get:function(){var e=this.expiredAt&&this.expiredAt<=Date.now();return e&&De("expired: ".concat(this.originalValue)),e?Me:this.originalValue}}]),e}();Fe.EXPIRED=Me;var Ve,Be=K("LC:Cache"),qe=function(){function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"anonymous";this.name=e,this._map={}}var t=e.prototype;return t.get=function(e){var t=this._map[e];if(t){var n=t.value;if(n!==Fe.EXPIRED)return Be("[%s] hit: %s",this.name,e),n;delete this._map[e]}return Be("[".concat(this.name,"] missed: ").concat(e)),null},t.set=function(e,t,n){Be("[%s] set: %s %d",this.name,e,n),this._map[e]=new Fe(t,n)},e}(),We={enable:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"LC*";return K.enable(e)},disable:K.disable},Ye=function e(t){var n=new y.default(t[0]);return 1===t.length?n:n.catch(function(){return e(t.slice(1))})},ze=function(e){return function(t){return e(t),t}},Qe=(ke.navigator&&ke.navigator.userAgent&&ke.navigator.userAgent.indexOf("MSIE 10."),new m.default),Ge=function(e){return Qe.has(e)||Qe.set(e,{}),Qe.get(e)},Ke=function e(t,n){if(!ne(t))return t;var r=a({},t);return(0,x.default)(r).forEach(function(t){var i=r[t];i===n?delete r[t]:r[t]=e(i,n)}),r},Je=function(e){return Ke(e,null)},$e=function(e){return Je(JSON.parse((0,p.default)(e)))},He=function(e){return Array.isArray(e)?e:void 0===e||null===e?[]:[e]},Ze="object"===("undefined"==typeof wx?"undefined":te(wx))&&"function"==typeof wx.connectSocket,Xe=function(e){return"-MdYXbMMI"!==e.slice(-9)},et=function(e,t){if(!e||!t)return!1;if(e.byteLength!==t.byteLength)return!1;var n=new Uint8Array(e),r=new Uint8Array(t);return!n.some(function(e,t){return e!==r[t]})},tt=K("LC:WebSocketPlus"),nt=function(e){return Math.min(1e3*Math.pow(2,e),3e5)},rt=function(e,t,n){return u(u({},n),{},{value:function(){var e;this.checkConnectionAvailability(t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=n.value).call.apply(e,[this].concat(i))}})},it=(Ve=function(e){function t(t,n){var r;return r=e.call(this)||this,r.init(),r._protocol=n,y.default.resolve("function"==typeof t?t():t).then(He).then(function(e){return r._urls=e,r._open()}).then(function(){r.__postponeTimeoutTimer=r._postponeTimeoutTimer.bind(Q(r)),ke.addEventListener&&(r.__pause=function(){r.can("pause")&&r.pause()},r.__resume=function(){r.can("resume")&&r.resume()},ke.addEventListener("offline",r.__pause),ke.addEventListener("online",r.__resume)),r.open()}).catch(r.throw.bind(Q(r))),r}G(t,e),Z(t,[{key:"urls",get:function(){return this._urls},set:function(e){this._urls=He(e)}}]);var n=t.prototype;return n._open=function(){var e=this;return this._createWs(this._urls,this._protocol).then(function(t){var n=H(e._urls),r=n[0],i=n.slice(1);return e._urls=[].concat(W(i),[r]),t})},n._createWs=function(e,t){var n=this;return Ye(e.map(function(e){return function(r,i){tt("connect [".concat(e,"] ").concat(t));var o=Ue("WebSocket"),a=t?new o(e,t):new o(e);a.binaryType=n.binaryType||"arraybuffer",a.onopen=function(){return r(a)},a.onclose=function(t){return i(t instanceof Error?t:new Error("Failed to connect [".concat(e,"]")))},a.onerror=a.onclose}})).then(function(e){return n._ws=e,n._ws.onclose=n._handleClose.bind(n),n._ws.onmessage=n._handleMessage.bind(n),e})},n._destroyWs=function(){var e=this._ws;e&&(e.onopen=null,e.onclose=null,e.onerror=null,e.onmessage=null,this._ws=null,e.close())},n.onbeforeevent=function(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];tt("".concat(e,": ").concat(t," -> ").concat(n," %o"),i)},n.onopen=function(){this.emit("open")},n.onconnected=function(){this._startConnectionKeeper()},n.onleaveconnected=function(e,t,n){this._stopConnectionKeeper(),this._destroyWs(),"offline"!==n&&"disconnected"!==n||this.emit("disconnect")},n.onpause=function(){this.emit("offline")},n.onbeforeresume=function(){this.emit("online")},n.onreconnect=function(){this.emit("reconnect")},n.ondisconnected=function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o="offline"===t?0:nt.call(null,i);tt("schedule attempt=".concat(i," delay=").concat(o)),this.emit("schedule",i,o),this.__scheduledRetry&&clearTimeout(this.__scheduledRetry),this.__scheduledRetry=setTimeout(function(){r.is("disconnected")&&r.retry(i)},o)},n.onretry=function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.emit("retry",i),this._open().then(function(){return r.can("reconnect")&&r.reconnect()},function(){return r.can("fail")&&r.fail(i+1)})},n.onerror=function(e,t,n,r){this.emit("error",r)},n.onclose=function(){ke.removeEventListener&&(this.__pause&&ke.removeEventListener("offline",this.__pause),this.__resume&&ke.removeEventListener("online",this.__resume))},n.checkConnectionAvailability=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"API";if(!this.is("connected")){var t=this.current;throw console.warn("".concat(e," should not be called when the connection is ").concat(t)),(this.is("disconnected")||this.is("reconnecting"))&&console.warn("disconnect and reconnect event should be handled to avoid such calls."),new Error("Connection unavailable")}},n._ping=function(){tt("ping");try{this.ping()}catch(e){console.warn("websocket ping error: ".concat(e.message))}},n.ping=function(){this._ws.ping?this._ws.ping():console.warn("The WebSocket implement does not support sending ping frame.\n Override ping method to use application defined ping/pong mechanism.")},n._postponeTimeoutTimer=function(){var e=this;tt("_postponeTimeoutTimer"),this._clearTimeoutTimers(),this._timeoutTimer=setTimeout(function(){tt("timeout"),e.disconnect()},38e4)},n._clearTimeoutTimers=function(){this._timeoutTimer&&clearTimeout(this._timeoutTimer)},n._startConnectionKeeper=function(){tt("start connection keeper"),this._heartbeatTimer=setInterval(this._ping.bind(this),18e4);var e=this._ws.addListener||this._ws.addEventListener;if(!e)return void tt("connection keeper disabled due to the lack of #addEventListener.");e.call(this._ws,"message",this.__postponeTimeoutTimer),e.call(this._ws,"pong",this.__postponeTimeoutTimer),this._postponeTimeoutTimer()},n._stopConnectionKeeper=function(){tt("stop connection keeper");var e=this._ws.removeListener||this._ws.removeEventListener;e&&(e.call(this._ws,"message",this.__postponeTimeoutTimer),e.call(this._ws,"pong",this.__postponeTimeoutTimer),this._clearTimeoutTimers()),this._heartbeatTimer&&clearInterval(this._heartbeatTimer)},n._handleClose=function(e){tt("ws closed [".concat(e.code,"] ").concat(e.reason)),this.isFinished()||this.handleClose(e)},n.handleClose=function(){this.disconnect()},n.send=function(e){tt("send",e),this._ws.send(e)},n._handleMessage=function(e){tt("message",e.data),this.handleMessage(e.data)},n.handleMessage=function(e){this.emit("message",e)},t}(V),X(Ve.prototype,"_ping",[rt],(0,A.default)(Ve.prototype,"_ping"),Ve.prototype),X(Ve.prototype,"send",[rt],(0,A.default)(Ve.prototype,"send"),Ve.prototype),Ve);ee.create({target:it.prototype,initial:{state:"initialized",event:"init",defer:!0},terminal:"closed",events:[{name:"open",from:"initialized",to:"connected"},{name:"disconnect",from:"connected",to:"disconnected"},{name:"retry",from:"disconnected",to:"reconnecting"},{name:"fail",from:"reconnecting",to:"disconnected"},{name:"reconnect",from:"reconnecting",to:"connected"},{name:"pause",from:["connected","disconnected","reconnecting"],to:"offline"},{},{name:"resume",from:"offline",to:"disconnected"},{name:"close",from:["connected","disconnected","reconnecting","offline"],to:"closed"},{name:"throw",from:"*",to:"error"}]});var ot=(0,k.default)({1e3:{name:"CLOSE_NORMAL"},1006:{name:"CLOSE_ABNORMAL"},4100:{name:"APP_NOT_AVAILABLE",message:"App not exists or realtime message service is disabled."},4102:{name:"SIGNATURE_FAILED",message:"Login signature mismatch."},4103:{name:"INVALID_LOGIN",message:"Malformed clientId."},4105:{name:"SESSION_REQUIRED",message:"Message sent before session opened."},4107:{name:"READ_TIMEOUT"},4108:{name:"LOGIN_TIMEOUT"},4109:{name:"FRAME_TOO_LONG"},4110:{name:"INVALID_ORIGIN",message:"Access denied by domain whitelist."},4111:{name:"SESSION_CONFLICT"},4112:{name:"SESSION_TOKEN_EXPIRED"},4113:{name:"APP_QUOTA_EXCEEDED",message:"The daily active users limit exceeded."},4116:{name:"MESSAGE_SENT_QUOTA_EXCEEDED",message:"Command sent too fast."},4200:{name:"INTERNAL_ERROR",message:"Internal error, please contact LeanCloud for support."},4301:{name:"CONVERSATION_API_FAILED",message:"Upstream Conversatoin API failed, see error.detail for details."},4302:{name:"CONVERSATION_SIGNATURE_FAILED",message:"Conversation action signature mismatch."},4303:{name:"CONVERSATION_NOT_FOUND"},4304:{name:"CONVERSATION_FULL"},4305:{name:"CONVERSATION_REJECTED_BY_APP",message:"Conversation action rejected by hook."},4306:{name:"CONVERSATION_UPDATE_FAILED"},4307:{name:"CONVERSATION_READ_ONLY"},4308:{name:"CONVERSATION_NOT_ALLOWED"},4309:{name:"CONVERSATION_UPDATE_REJECTED",message:"Conversation update rejected because the client is not a member."},4310:{name:"CONVERSATION_QUERY_FAILED",message:"Conversation query failed because it is too expansive."},4311:{name:"CONVERSATION_LOG_FAILED"},4312:{name:"CONVERSATION_LOG_REJECTED",message:"Message query rejected because the client is not a member of the conversation."},4313:{name:"SYSTEM_CONVERSATION_REQUIRED"},4314:{name:"NORMAL_CONVERSATION_REQUIRED"},4315:{name:"CONVERSATION_BLACKLISTED",message:"Blacklisted in the conversation."},4316:{name:"TRANSIENT_CONVERSATION_REQUIRED"},4317:{name:"CONVERSATION_MEMBERSHIP_REQUIRED"},4318:{name:"CONVERSATION_API_QUOTA_EXCEEDED",message:"LeanCloud API quota exceeded. You may upgrade your plan."},4323:{name:"TEMPORARY_CONVERSATION_EXPIRED",message:"Temporary conversation expired or does not exist."},4401:{name:"INVALID_MESSAGING_TARGET",message:"Conversation does not exist or client is not a member."},4402:{name:"MESSAGE_REJECTED_BY_APP",message:"Message rejected by hook."},4403:{name:"MESSAGE_OWNERSHIP_REQUIRED"},4404:{name:"MESSAGE_NOT_FOUND"},4405:{name:"MESSAGE_UPDATE_REJECTED_BY_APP",message:"Message update rejected by hook."},4406:{name:"MESSAGE_EDIT_DISABLED"},4407:{name:"MESSAGE_RECALL_DISABLED"},5130:{name:"OWNER_PROMOTION_NOT_ALLOWED",message:"Updating a member's role to owner is not allowed."}}),at=(0,k.default)((0,x.default)(ot).reduce(function(e,t){return(0,U.default)(e,Y({},ot[t].name,Number(t)))},{})),st=function(e){var t=e.code,n=e.reason,r=e.appCode,i=e.detail,o=e.error,a=n||i||o,s=n;!a&&ot[t]&&(s=ot[t].name,a=ot[t].message||s),a||(a="Unknow Error: ".concat(t));var u=new Error(a);return(0,U.default)(u,{code:t,appCode:r,detail:i,name:s})},ut=K("LC:Connection"),ct=(0,P.default)("expire"),ft=function(e){return!(e.cmd===Ce.direct||e.cmd===Ce.session&&e.op===xe.open||e.cmd===Ce.conv&&(e.op===xe.start||e.op===xe.update||e.op===xe.members))},lt=function(e){function t(t,n){var r,i=n.format,o=n.version;ut("initializing Connection");var a="lc.".concat(i,".").concat(o);return r=e.call(this,t,a)||this,r._protocolFormat=i,r._commands={},r._serialId=0,r}G(t,e);var n=t.prototype;return n.send=function(){function t(e){return n.apply(this,arguments)}var n=q(B.mark(function t(n){var r,i,o,a,s,u,c=this,f=arguments;return B.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=!(f.length>1&&void 0!==f[1])||f[1])){t.next=11;break}if(!ft(n)){t.next=8;break}if(i=n.toArrayBuffer(),!(a=$(this._commands).find(function(e){var t=e.buffer,r=e.command;return r.cmd===n.cmd&&r.op===n.op&&et(t,i)}))){t.next=8;break}return console.warn("Duplicated command [cmd:".concat(n.cmd," op:").concat(n.op,"] is throttled.")),t.abrupt("return",a.promise);case 8:this._serialId+=1,o=this._serialId,n.i=o;case 11:if(ut.enabled&&ut("↑ %O sent",$e(n)),"proto2base64"===this._protocolFormat?s=n.toBase64():n.toArrayBuffer&&(s=n.toArrayBuffer()),s){t.next=15;break}throw new TypeError("".concat(n," is not a GenericCommand"));case 15:if(e.prototype.send.call(this,s),r){t.next=18;break}return t.abrupt("return",void 0);case 18:return u=new y.default(function(e,t){c._commands[o]={command:n,buffer:i,resolve:e,reject:t,timeout:setTimeout(function(){c._commands[o]&&(ut.enabled&&ut("✗ %O timeout",$e(n)),t(st({error:"Command Timeout [cmd:".concat(n.cmd," op:").concat(n.op,"]"),name:"COMMAND_TIMEOUT"})),delete c._commands[o])},2e4)}}),this._commands[o].promise=u,t.abrupt("return",u);case 21:case"end":return t.stop()}},t,this)}));return t}(),n.handleMessage=function(e){var t;try{t=Te.decode(e),ut.enabled&&ut("↓ %O received",$e(t))}catch(t){return void console.warn("Decode message failed:",t.message,e)}var n=t.i;if(n)this._commands[n]?(clearTimeout(this._commands[n].timeout),t.cmd===Ce.error?this._commands[n].reject(st(t.errorMessage)):this._commands[n].resolve(t),delete this._commands[n]):console.warn("Unexpected command received with serialId [".concat(n,"],\n which have timed out or never been requested."));else switch(t.cmd){case Ce.error:return void this.emit("error",st(t.errorMessage));case Ce.goaway:return void this.emit(ct);default:this.emit("message",t)}},n.ping=function(){return this.send(new Te({cmd:Ce.echo})).catch(function(e){return ut("ping failed:",e)})},t}(it),ht=K("LC:request"),dt=function(e){var t=e.method,n=void 0===t?"GET":t,r=e.url,i=e.query,o=e.headers,a=e.data,s=e.timeout,u=r;if(i){var c=(0,x.default)(i).map(function(e){var t=i[e];if(void 0!==t){var n=ne(t)?(0,p.default)(t):t;return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(n))}}).filter(function(e){return e}).join("&");u="".concat(u,"?").concat(c)}ht("Req: %O %O %O",n,u,{headers:o,data:a});var f=Ue("request"),l=f(u,{method:n,headers:o,data:a}).then(function(e){if(!1===e.ok){var t=st(e.data);throw t.response=e,t}return ht("Res: %O %O %O",u,e.status,e.data),e.data}).catch(function(e){throw e.response&&ht("Error: %O %O %O",u,e.response.status,e.response.data),e});return s?re.timeout(l,s):l},pt=function(e,t){e&&e.forEach(function(e){try{e(t)}catch(t){throw e._pluginName&&(t.message+="[".concat(e._pluginName,"]")),t}})},vt=function(e,t){return He(e).reduce(function(e,n){return e.then(function(e){return!1!==e&&n.apply(void 0,W(t))}).catch(function(e){throw n._pluginName&&(e.message+="[".concat(n._pluginName,"]")),e})},y.default.resolve(!0))},mt="5.0.0-rc.4",gt=K("LC:Realtime"),yt=new qe("push-router"),bt={},_t=function(e){function t(n){var r,i=n.plugins,o=z(n,["plugins"]);gt("initializing Realtime %s %O",mt,o),r=e.call(this)||this;var a=o.appId;if("string"!=typeof a)throw new TypeError("appId [".concat(a,"] is not a string"));if(bt[a])throw new Error("App [".concat(a,"] is aleady initialized."));if(bt[a]=!0,"string"!=typeof o.appKey)throw new TypeError("appKey [".concat(o.appKey,"] is not a string"));if(Xe(a)&&!o.server)throw new TypeError("server option is required for apps from CN region");r._options=f({appId:void 0,appKey:void 0,pushOfflineMessages:!1,noBinary:!1,ssl:!0,RTMServerName:"undefined"!=typeof process?process.env.RTM_SERVER_NAME:void 0},o),r._cache=new qe("endpoints");var s=Ge(Q(r));s.clients=new h.default,s.pendingClients=new h.default;var u=[].concat(W(He(t.__preRegisteredPlugins)),W(He(i)));return gt("Using plugins %o",u.map(function(e){return e.name})),r._plugins=u.reduce(function(e,t){return(0,x.default)(t).forEach(function(n){({}).hasOwnProperty.call(t,n)&&"name"!==n&&(t.name&&He(t[n]).forEach(function(e){e._pluginName=t.name}),e[n]=He(e[n]).concat(t[n]))}),e},{}),pt(r._plugins.onRealtimeCreate,Q(r)),r}G(t,e);var n=t.prototype;return n._request=function(){function e(e){return t.apply(this,arguments)}var t=q(B.mark(function e(t){var n,r,i,o,a,s,u,c,l,h,d,p,v,m;return B.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.method,r=t.url,i=t.version,o=void 0===i?"1.1":i,a=t.path,s=t.query,u=t.headers,c=t.data,l=r){e.next=9;break}return h=this._options,d=h.appId,p=h.server,e.next=6,this.constructor._getServerUrls({appId:d,server:p});case 6:v=e.sent,m=v.api,l="".concat(m,"/").concat(o).concat(a);case 9:return e.abrupt("return",dt({url:l,method:n,query:s,headers:f({"X-LC-Id":this._options.appId,"X-LC-Key":this._options.appKey},u),data:c}));case 10:case"end":return e.stop()}},e,this)}));return e}(),n._open=function(){var e=this;if(this._openPromise)return this._openPromise;var t="protobuf2";this._options.noBinary&&(t="proto2base64");var n=3;this._options.pushOfflineMessages&&(n=1);var r={format:t,version:n};return this._openPromise=new y.default(function(t,n){gt("No connection established, create a new one.");var i=new lt(function(){return e._getRTMServers(e._options)},r);i.on("open",function(){return t(i)}).on("error",n).on(ct,q(B.mark(function t(){return B.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return gt("Connection expired. Refresh endpoints."),e._cache.set("endpoints",null,0),t.next=4,e._getRTMServers(e._options);case 4:i.urls=t.sent,i.disconnect();case 6:case"end":return t.stop()}},t)}))).on("message",e._dispatchCommand.bind(e)),["disconnect","reconnect","retry","schedule","offline","online"].forEach(function(t){return i.on(t,function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];gt("".concat(t," event emitted. %o"),r),e.emit.apply(e,[t].concat(r)),"reconnect"!==t&&Ge(e).clients.forEach(function(e){e.emit.apply(e,[t].concat(r))})})}),i.handleClose=function(e){[at.APP_NOT_AVAILABLE,at.INVALID_LOGIN,at.INVALID_ORIGIN].some(function(t){return t===e.code})?this.throw(st(e)):this.disconnect()},Ge(e).connection=i}),this._openPromise},n._getRTMServers=function(){function e(e){return t.apply(this,arguments)}var t=q(B.mark(function e(t){var n,r,i,o,a,s;return B.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.RTMServers){e.next=2;break}return e.abrupt("return",J(He(t.RTMServers)));case 2:if(!(r=this._cache.get("endpoints"))){e.next=7;break}n=r,e.next=14;break;case 7:return e.next=9,this.constructor._fetchRTMServers(t);case 9:if(n=e.sent,i=n,o=i.server,a=i.secondary,s=i.ttl,"string"==typeof o||"string"==typeof a||"number"==typeof s){e.next=13;break}throw new Error("malformed RTM route response: ".concat((0,p.default)(n)));case 13:this._cache.set("endpoints",n,1e3*n.ttl);case 14:return gt("endpoint info: %O",n),e.abrupt("return",[n.server,n.secondary]);case 16:case"end":return e.stop()}},e,this)}));return e}(),t._getServerUrls=function(){function e(e){return t.apply(this,arguments)}var t=q(B.mark(function e(t){var n,r,i,o;return B.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.appId,r=t.server,gt("fetch server urls"),!r){e.next=6;break}if("string"==typeof r){e.next=5;break}return e.abrupt("return",r);case 5:return e.abrupt("return",{RTMRouter:r,api:r});case 6:if(!(i=yt.get(n))){e.next=9;break}return e.abrupt("return",i);case 9:return o="https://",e.abrupt("return",dt({url:"https://app-router.com/2/route",query:{appId:n},timeout:2e4}).then(ze(gt)).then(function(e){var t=e.rtm_router_server,r=e.api_server,i=e.ttl,a=void 0===i?3600:i;if(!t)throw new Error("rtm router not exists");var s={RTMRouter:"".concat(o).concat(t),api:"".concat(o).concat(r)};return yt.set(n,s,1e3*a),s}).catch(function(){var e=n.slice(0,8).toLowerCase();return{RTMRouter:"".concat(o).concat(e,".rtm.").concat("lncldglobal.com"),api:"".concat(o).concat(e,".api.").concat("lncldglobal.com")}}));case 11:case"end":return e.stop()}},e)}));return e}(),t._fetchRTMServers=function(e){var t=e.appId,n=e.ssl,r=e.server,i=e.RTMServerName;return gt("fetch endpoint info"),this._getServerUrls({appId:t,server:r}).then(ze(gt)).then(function(e){var r=e.RTMRouter;return dt({url:"".concat(r,"/v1/route"),query:{appId:t,secure:n,features:Ze?"wechat":void 0,server:i,_t:Date.now()},timeout:2e4}).then(ze(gt))})},n._close=function(){this._openPromise&&this._openPromise.then(function(e){return e.close()}),delete this._openPromise},n.retry=function(){var e=Ge(this),t=e.connection;if(!t)throw new Error("no connection established");if(t.cannot("retry"))throw new Error("retrying not allowed when not disconnected. the connection is now ".concat(t.current));return t.retry()},n.pause=function(){var e=Ge(this),t=e.connection;t&&t.can("pause")&&t.pause()},n.resume=function(){var e=Ge(this),t=e.connection;t&&t.can("resume")&&t.resume()},n._registerPending=function(e){Ge(this).pendingClients.add(e)},n._deregisterPending=function(e){Ge(this).pendingClients.delete(e)},n._register=function(e){Ge(this).clients.add(e)},n._deregister=function(e){var t=Ge(this);t.clients.delete(e),t.clients.size+t.pendingClients.size===0&&this._close()},n._dispatchCommand=function(e){return vt(this._plugins.beforeCommandDispatch,[e,this]).then(function(t){return!!t&&gt("[WARN] Unexpected message received: %O",$e(e))})},t}(V),wt=y.default;t.EventEmitter=V,t.Promise=wt,t.Protocals=Pe,t.Protocols=Pe,t.Realtime=_t,t.debug=We,t.getAdapter=Ue,t.setAdapters=Le}).call(t,n(65))},function(e,t,n){n(58),n(34),n(36),n(365),n(369),n(372),n(373),e.exports=n(1).Set},function(e,t,n){"use strict";var r=n(366),i=n(57);e.exports=n(189)("Set",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(i(this,"Set"),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r=n(20).f,i=n(59),o=n(64),a=n(22),s=n(63),u=n(37),c=n(80),f=n(117),l=n(124),h=n(16),d=n(44).fastKey,p=n(57),v=h?"_s":"size",m=function(e,t){var n,r=d(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,c){var f=e(function(e,r){s(e,f,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[v]=0,void 0!=r&&u(r,n,e[c],e)});return o(f.prototype,{clear:function(){for(var e=p(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[v]=0},delete:function(e){var n=p(this,t),r=m(n,e);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[v]--}return!!r},forEach:function(e){p(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!m(p(this,t),e)}}),h&&r(f.prototype,"size",{get:function(){return p(this,t)[v]}}),f},def:function(e,t,n){var r,i,o=m(e,t);return o?o.v=n:(e._l=o={i:i=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=o),r&&(r.n=o),e[v]++,"F"!==i&&(e._i[i]=o)),e},getEntry:m,setStrong:function(e,t,n){c(e,t,function(e,n){this._t=p(e,t),this._k=n,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?"keys"==t?f(0,n.k):"values"==t?f(0,n.v):f(0,[n.k,n.v]):(e._t=void 0,f(1))},n?"entries":"values",!n,!0),l(t)}}},function(e,t,n){var r=n(368);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(9),i=n(182),o=n(8)("species");e.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){var r=n(4);r(r.P+r.R,"Set",{toJSON:n(370)("Set")})},function(e,t,n){var r=n(62),i=n(371);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},function(e,t,n){var r=n(37);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t,n){n(190)("Set")},function(e,t,n){n(191)("Set")},function(e,t,n){e.exports={default:n(375),__esModule:!0}},function(e,t,n){n(58),n(36),n(376),n(378),n(379),e.exports=n(1).WeakMap},function(e,t,n){"use strict";var r,i=n(5),o=n(111)(0),a=n(83),s=n(44),u=n(192),c=n(377),f=n(9),l=n(57),h=n(57),d=!i.ActiveXObject&&"ActiveXObject"in i,p=s.getWeak,v=Object.isExtensible,m=c.ufstore,g=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(e){if(f(e)){var t=p(e);return!0===t?m(l(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return c.def(l(this,"WeakMap"),e,t)}},b=e.exports=n(189)("WeakMap",g,y,c,!0,!0);h&&d&&(r=c.getConstructor(g,"WeakMap"),u(r.prototype,y),s.NEED=!0,o(["delete","has","get","set"],function(e){var t=b.prototype,n=t[e];a(t,e,function(t,i){if(f(t)&&!v(t)){this._f||(this._f=new r);var o=this._f[e](t,i);return"set"==e?this:o}return n.call(this,t,i)})}))},function(e,t,n){"use strict";var r=n(64),i=n(44).getWeak,o=n(15),a=n(9),s=n(63),u=n(37),c=n(111),f=n(24),l=n(57),h=c(5),d=c(6),p=0,v=function(e){return e._l||(e._l=new m)},m=function(){this.a=[]},g=function(e,t){return h(e.a,function(e){return e[0]===t})};m.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var n=g(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=d(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,o){var c=e(function(e,r){s(e,c,t,"_i"),e._t=t,e._i=p++,e._l=void 0,void 0!=r&&u(r,n,e[o],e)});return r(c.prototype,{delete:function(e){if(!a(e))return!1;var n=i(e);return!0===n?v(l(this,t)).delete(e):n&&f(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=i(e);return!0===n?v(l(this,t)).has(e):n&&f(n,this._i)}}),c},def:function(e,t,n){var r=i(o(t),!0);return!0===r?v(e).set(t,n):r[e._i]=n,e},ufstore:v}},function(e,t,n){n(190)("WeakMap")},function(e,t,n){n(191)("WeakMap")},function(e,t,n){e.exports={default:n(381),__esModule:!0}},function(e,t,n){n(382);var r=n(1).Object;e.exports=function(e,t){return r.defineProperties(e,t)}},function(e,t,n){var r=n(4);r(r.S+r.F*!n(16),"Object",{defineProperties:n(113)})},function(e,t,n){e.exports={default:n(384),__esModule:!0}},function(e,t,n){n(385),e.exports=n(1).Object.getOwnPropertyDescriptors},function(e,t,n){var r=n(4),i=n(386),o=n(25),a=n(74),s=n(193);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),u=a.f,c=i(r),f={},l=0;c.length>l;)void 0!==(n=u(r,t=c[l++]))&&s(f,t,n);return f}})},function(e,t,n){var r=n(108),i=n(72),o=n(15),a=n(5).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(o(e)),n=i.f;return n?t.concat(n(e)):t}},function(e,t,n){n(181),e.exports=n(1).Object.getOwnPropertySymbols},function(e,t,n){n(389),e.exports=n(1).Object.assign},function(e,t,n){var r=n(4);r(r.S+r.F,"Object",{assign:n(192)})},function(e,t,n){e.exports={default:n(391),__esModule:!0}},function(e,t,n){n(392),e.exports=n(1).Object.freeze},function(e,t,n){var r=n(9),i=n(44).onFreeze;n(69)("freeze",function(e){return function(t){return e&&r(t)?e(i(t)):t}})},function(e,t,n){var r,i,o;/**
8 * @license protobuf.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
9 * Released under the Apache License, Version 2.0
10 * see: https://github.com/dcodeIO/protobuf.js for details
11 */
12!function(a,s){i=[n(394)],r=s,void 0!==(o="function"==typeof r?r.apply(t,i):r)&&(e.exports=o)}(0,function(e,t){"use strict";var r={};return r.ByteBuffer=e,r.Long=e.Long||null,r.VERSION="5.0.3",r.WIRE_TYPES={},r.WIRE_TYPES.VARINT=0,r.WIRE_TYPES.BITS64=1,r.WIRE_TYPES.LDELIM=2,r.WIRE_TYPES.STARTGROUP=3,r.WIRE_TYPES.ENDGROUP=4,r.WIRE_TYPES.BITS32=5,r.PACKABLE_WIRE_TYPES=[r.WIRE_TYPES.VARINT,r.WIRE_TYPES.BITS64,r.WIRE_TYPES.BITS32],r.TYPES={int32:{name:"int32",wireType:r.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:r.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:r.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:r.WIRE_TYPES.VARINT,defaultValue:r.Long?r.Long.ZERO:void 0},uint64:{name:"uint64",wireType:r.WIRE_TYPES.VARINT,defaultValue:r.Long?r.Long.UZERO:void 0},sint64:{name:"sint64",wireType:r.WIRE_TYPES.VARINT,defaultValue:r.Long?r.Long.ZERO:void 0},bool:{name:"bool",wireType:r.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:r.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:r.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:r.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:r.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:r.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:r.WIRE_TYPES.BITS64,defaultValue:r.Long?r.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:r.WIRE_TYPES.BITS64,defaultValue:r.Long?r.Long.ZERO:void 0},float:{name:"float",wireType:r.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:r.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:r.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:r.WIRE_TYPES.STARTGROUP,defaultValue:null}},r.MAP_KEY_TYPES=[r.TYPES.int32,r.TYPES.sint32,r.TYPES.sfixed32,r.TYPES.uint32,r.TYPES.fixed32,r.TYPES.int64,r.TYPES.sint64,r.TYPES.sfixed64,r.TYPES.uint64,r.TYPES.fixed64,r.TYPES.bool,r.TYPES.string,r.TYPES.bytes],r.ID_MIN=1,r.ID_MAX=536870911,r.convertFieldsToCamelCase=!1,r.populateAccessors=!0,r.populateDefaults=!0,r.Util=function(){var e={};return e.IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.XHR=function(){for(var e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=null,n=0;n<e.length;n++){try{t=e[n]()}catch(e){continue}break}if(!t)throw Error("XMLHttpRequest is not supported");return t},e.fetch=function(t,r){if(r&&"function"!=typeof r&&(r=null),e.IS_NODE){var i=n(396);if(r)i.readFile(t,function(e,t){r(e?null:""+t)});else try{return i.readFileSync(t)}catch(e){return null}}else{var o=e.XHR();if(o.open("GET",t,!!r),o.setRequestHeader("Accept","text/plain"),"function"==typeof o.overrideMimeType&&o.overrideMimeType("text/plain"),!r)return o.send(null),200==o.status||0==o.status&&"string"==typeof o.responseText?o.responseText:null;if(o.onreadystatechange=function(){4==o.readyState&&r(200==o.status||0==o.status&&"string"==typeof o.responseText?o.responseText:null)},4==o.readyState)return;o.send(null)}},e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,function(e,t){return t.toUpperCase()})},e}(),r.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,FQTYPEREF:/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},r.Reflect=function(t){function n(n){if("string"==typeof n&&(n=t.TYPES[n]),void 0===n.defaultValue)throw Error("default value for type "+n.name+" is not supported");return n==t.TYPES.bytes?new e(0):n.defaultValue}function r(e,n){if(e&&"number"==typeof e.low&&"number"==typeof e.high&&"boolean"==typeof e.unsigned&&e.low===e.low&&e.high===e.high)return new t.Long(e.low,e.high,void 0===n?e.unsigned:n);if("string"==typeof e)return t.Long.fromString(e,n||!1,10);if("number"==typeof e)return t.Long.fromNumber(e,n||!1);throw Error("not convertible to Long")}function i(e,n){var r=n.readVarint32(),o=7&r,a=r>>>3;switch(o){case t.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(128==(128&r));break;case t.WIRE_TYPES.BITS64:n.offset+=8;break;case t.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case t.WIRE_TYPES.STARTGROUP:i(a,n);break;case t.WIRE_TYPES.ENDGROUP:if(a===e)return!1;throw Error("Illegal GROUPEND after unknown group: "+a+" ("+e+" expected)");case t.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+e+": "+o)}return!0}var o={},a=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},s=a.prototype;s.fqn=function(){for(var e=this.name,t=this;;){if(null==(t=t.parent))break;e=t.name+"."+e}return e},s.toString=function(e){return(e?this.className+" ":"")+this.fqn()},s.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},o.T=a;var u=function(e,t,n,r,i){a.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},c=u.prototype=Object.create(a.prototype);c.getChildren=function(e){if(null==(e=e||null))return this.children.slice();for(var t=[],n=0,r=this.children.length;n<r;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},c.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof h.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof h.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},c.getChild=function(e){for(var t="number"==typeof e?"id":"name",n=0,r=this.children.length;n<r;++n)if(this.children[n][t]===e)return this.children[n];return null},c.resolve=function(e,t){var n="string"==typeof e?e.split("."):e,r=this,i=0;if(""===n[i]){for(;null!==r.parent;)r=r.parent;i++}var a;do{do{if(!(r instanceof o.Namespace)){r=null;break}if(!(a=r.getChild(n[i]))||!(a instanceof o.T)||t&&!(a instanceof o.Namespace)){r=null;break}r=a,i++}while(i<n.length);if(null!=r)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=r);return r},c.qn=function(e){var t=[],n=e;do{t.unshift(n.name),n=n.parent}while(null!==n);for(var r=1;r<=t.length;r++){var i=t.slice(t.length-r);if(e===this.resolve(i,e instanceof o.Namespace))return i.join(".")}return e.fqn()},c.build=function(){for(var e,t={},n=this.children,r=0,i=n.length;r<i;++r)(e=n[r])instanceof u&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},c.buildOpt=function(){for(var e={},t=Object.keys(this.options),n=0,r=t.length;n<r;++n){var i=t[n],o=this.options[t[n]];e[i]=o}return e},c.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},o.Namespace=u;var f=function(e,n,r,i,o){if(this.type=e,this.resolvedType=n,this.isMapKey=r,this.syntax=i,this.name=o,r&&t.MAP_KEY_TYPES.indexOf(e)<0)throw Error("Invalid map key type: "+e.name)},l=f.prototype;f.defaultFieldValue=n,l.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"},l.verifyValue=function(n){function i(e,t){throw Error("Illegal value for "+o.toString(!0)+" of type "+o.type.name+": "+e+" ("+t+")")}var o=this;switch(this.type){case t.TYPES.int32:case t.TYPES.sint32:case t.TYPES.sfixed32:return("number"!=typeof n||n===n&&n%1!=0)&&i(typeof n,"not an integer"),n>4294967295?0|n:n;case t.TYPES.uint32:case t.TYPES.fixed32:return("number"!=typeof n||n===n&&n%1!=0)&&i(typeof n,"not an integer"),n<0?n>>>0:n;case t.TYPES.int64:case t.TYPES.sint64:case t.TYPES.sfixed64:if(t.Long)try{return r(n,!1)}catch(e){i(typeof n,e.message)}else i(typeof n,"requires Long.js");case t.TYPES.uint64:case t.TYPES.fixed64:if(t.Long)try{return r(n,!0)}catch(e){i(typeof n,e.message)}else i(typeof n,"requires Long.js");case t.TYPES.bool:return"boolean"!=typeof n&&i(typeof n,"not a boolean"),n;case t.TYPES.float:case t.TYPES.double:return"number"!=typeof n&&i(typeof n,"not a number"),n;case t.TYPES.string:return"string"==typeof n||n&&n instanceof String||i(typeof n,"not a string"),""+n;case t.TYPES.bytes:return e.isByteBuffer(n)?n:e.wrap(n,"base64");case t.TYPES.enum:var a=this.resolvedType.getChildren(t.Reflect.Enum.Value);for(u=0;u<a.length;u++){if(a[u].name==n)return a[u].id;if(a[u].id==n)return a[u].id}if("proto3"===this.syntax)return("number"!=typeof n||n===n&&n%1!=0)&&i(typeof n,"not an integer"),(n>4294967295||n<0)&&i(typeof n,"not in range for uint32"),n;i(n,"not a valid enum value");case t.TYPES.group:case t.TYPES.message:if(n&&"object"==typeof n||i(typeof n,"object expected"),n instanceof this.resolvedType.clazz)return n;if(n instanceof t.Builder.Message){var s={};for(var u in n)n.hasOwnProperty(u)&&(s[u]=n[u]);n=s}return new this.resolvedType.clazz(n)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+n+" (undefined type "+this.type+")")},l.calculateLength=function(n,r){if(null===r)return 0;var i;switch(this.type){case t.TYPES.int32:return r<0?e.calculateVarint64(r):e.calculateVarint32(r);case t.TYPES.uint32:return e.calculateVarint32(r);case t.TYPES.sint32:return e.calculateVarint32(e.zigZagEncode32(r));case t.TYPES.fixed32:case t.TYPES.sfixed32:case t.TYPES.float:return 4;case t.TYPES.int64:case t.TYPES.uint64:return e.calculateVarint64(r);case t.TYPES.sint64:return e.calculateVarint64(e.zigZagEncode64(r));case t.TYPES.fixed64:case t.TYPES.sfixed64:return 8;case t.TYPES.bool:return 1;case t.TYPES.enum:return e.calculateVarint32(r);case t.TYPES.double:return 8;case t.TYPES.string:return i=e.calculateUTF8Bytes(r),e.calculateVarint32(i)+i;case t.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");return e.calculateVarint32(r.remaining())+r.remaining();case t.TYPES.message:return i=this.resolvedType.calculate(r),e.calculateVarint32(i)+i;case t.TYPES.group:return(i=this.resolvedType.calculate(r))+e.calculateVarint32(n<<3|t.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")},l.encodeValue=function(n,r,i){if(null===r)return i;switch(this.type){case t.TYPES.int32:r<0?i.writeVarint64(r):i.writeVarint32(r);break;case t.TYPES.uint32:i.writeVarint32(r);break;case t.TYPES.sint32:i.writeVarint32ZigZag(r);break;case t.TYPES.fixed32:i.writeUint32(r);break;case t.TYPES.sfixed32:i.writeInt32(r);break;case t.TYPES.int64:case t.TYPES.uint64:i.writeVarint64(r);break;case t.TYPES.sint64:i.writeVarint64ZigZag(r);break;case t.TYPES.fixed64:i.writeUint64(r);break;case t.TYPES.sfixed64:i.writeInt64(r);break;case t.TYPES.bool:"string"==typeof r?i.writeVarint32("false"===r.toLowerCase()?0:!!r):i.writeVarint32(r?1:0);break;case t.TYPES.enum:i.writeVarint32(r);break;case t.TYPES.float:i.writeFloat32(r);break;case t.TYPES.double:i.writeFloat64(r);break;case t.TYPES.string:i.writeVString(r);break;case t.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");var o=r.offset;i.writeVarint32(r.remaining()),i.append(r),r.offset=o;break;case t.TYPES.message:var a=(new e).LE();this.resolvedType.encode(r,a),i.writeVarint32(a.offset),i.append(a.flip());break;case t.TYPES.group:this.resolvedType.encode(r,i),i.writeVarint32(n<<3|t.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")}return i},l.decode=function(e,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case t.TYPES.int32:return 0|e.readVarint32();case t.TYPES.uint32:return e.readVarint32()>>>0;case t.TYPES.sint32:return 0|e.readVarint32ZigZag();case t.TYPES.fixed32:return e.readUint32()>>>0;case t.TYPES.sfixed32:return 0|e.readInt32();case t.TYPES.int64:return e.readVarint64();case t.TYPES.uint64:return e.readVarint64().toUnsigned();case t.TYPES.sint64:return e.readVarint64ZigZag();case t.TYPES.fixed64:return e.readUint64();case t.TYPES.sfixed64:return e.readInt64();case t.TYPES.bool:return!!e.readVarint32();case t.TYPES.enum:return e.readVarint32();case t.TYPES.float:return e.readFloat();case t.TYPES.double:return e.readDouble();case t.TYPES.string:return e.readVString();case t.TYPES.bytes:if(o=e.readVarint32(),e.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+e.remaining());return i=e.clone(),i.limit=i.offset+o,e.offset+=o,i;case t.TYPES.message:return o=e.readVarint32(),this.resolvedType.decode(e,o);case t.TYPES.group:return this.resolvedType.decode(e,-1,r)}throw Error("[INTERNAL] Illegal decode type")},l.valueFromString=function(n){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case t.TYPES.int32:case t.TYPES.sint32:case t.TYPES.sfixed32:case t.TYPES.uint32:case t.TYPES.fixed32:return this.verifyValue(parseInt(n));case t.TYPES.int64:case t.TYPES.sint64:case t.TYPES.sfixed64:case t.TYPES.uint64:case t.TYPES.fixed64:return this.verifyValue(n);case t.TYPES.bool:return"true"===n;case t.TYPES.string:return this.verifyValue(n);case t.TYPES.bytes:return e.fromBinary(n)}},l.valueToString=function(e){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===t.TYPES.bytes?e.toString("binary"):e.toString()},o.Element=f;var h=function(e,t,n,r,i,o){u.call(this,e,t,n,r,o),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},d=h.prototype=Object.create(u.prototype);d.build=function(n){if(this.clazz&&!n)return this.clazz;var r=function(t,n){function r(n,i,o,a){if(null===n||"object"!=typeof n){if(a&&a instanceof t.Reflect.Enum){var s=t.Reflect.Enum.getName(a.object,n);if(null!==s)return s}return n}if(e.isByteBuffer(n))return i?n.toBase64():n.toBuffer();if(t.Long.isLong(n))return o?n.toString():t.Long.fromValue(n);var u;if(Array.isArray(n))return u=[],n.forEach(function(e,t){u[t]=r(e,i,o,a)}),u;if(u={},n instanceof t.Map){for(var c=n.entries(),f=c.next();!f.done;f=c.next())u[n.keyElem.valueToString(f.value[0])]=r(f.value[1],i,o,n.valueElem.resolvedType);return u}var l=n.$type,h=void 0;for(var d in n)n.hasOwnProperty(d)&&(l&&(h=l.getChild(d))?u[d]=r(n[d],i,o,h.resolvedType):u[d]=r(n[d],i,o));return u}var i=n.getChildren(t.Reflect.Message.Field),o=n.getChildren(t.Reflect.Message.OneOf),a=function(r,s){t.Builder.Message.call(this);for(var u=0,c=o.length;u<c;++u)this[o[u].name]=null;for(u=0,c=i.length;u<c;++u){var f=i[u];this[f.name]=f.repeated?[]:f.map?new t.Map(f):null,!f.required&&"proto3"!==n.syntax||null===f.defaultValue||(this[f.name]=f.defaultValue)}if(arguments.length>0){var l;if(1!==arguments.length||null===r||"object"!=typeof r||!("function"!=typeof r.encode||r instanceof a)||Array.isArray(r)||r instanceof t.Map||e.isByteBuffer(r)||r instanceof ArrayBuffer||t.Long&&r instanceof t.Long)for(u=0,c=arguments.length;u<c;++u)void 0!==(l=arguments[u])&&this.$set(i[u].name,l);else this.$set(r)}},s=a.prototype=Object.create(t.Builder.Message.prototype);s.add=function(e,r,i){var o=n._fieldsByName[e];if(!i){if(!o)throw Error(this+"#"+e+" is undefined");if(!(o instanceof t.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+e+" is not a repeated field");r=o.verifyValue(r,!0)}return null===this[e]&&(this[e]=[]),this[e].push(r),this},s.$add=s.add,s.set=function(e,r,i){if(e&&"object"==typeof e){i=r;for(var o in e)e.hasOwnProperty(o)&&void 0!==(r=e[o])&&void 0===n._oneofsByName[o]&&this.$set(o,r,i);return this}var a=n._fieldsByName[e];if(i)this[e]=r;else{if(!a)throw Error(this+"#"+e+" is not a field: undefined");if(!(a instanceof t.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+a.toString(!0));this[a.name]=r=a.verifyValue(r)}if(a&&a.oneof){var s=this[a.oneof.name];null!==r?(null!==s&&s!==a.name&&(this[s]=null),this[a.oneof.name]=a.name):s===e&&(this[a.oneof.name]=null)}return this},s.$set=s.set,s.get=function(e,r){if(r)return this[e];var i=n._fieldsByName[e];if(!(i&&i instanceof t.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: undefined");if(!(i instanceof t.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+i.toString(!0));return this[i.name]},s.$get=s.get;for(var u=0;u<i.length;u++){var c=i[u];c instanceof t.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(e){var t=e.originalName.replace(/(_[a-zA-Z])/g,function(e){return e.toUpperCase().replace("_","")});t=t.substring(0,1).toUpperCase()+t.substring(1);var r=e.originalName.replace(/([A-Z])/g,function(e){return"_"+e}),i=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},o=function(){return this[e.name]};null===n.getChild("set"+t)&&(s["set"+t]=i),null===n.getChild("set_"+r)&&(s["set_"+r]=i),null===n.getChild("get"+t)&&(s["get"+t]=o),null===n.getChild("get_"+r)&&(s["get_"+r]=o)}(c)}s.encode=function(t,r){"boolean"==typeof t&&(r=t,t=void 0);var i=!1;t||(t=new e,i=!0);var o=t.littleEndian;try{return n.encode(this,t.LE(),r),(i?t.flip():t).LE(o)}catch(e){throw t.LE(o),e}},a.encode=function(e,t,n){return new a(e).encode(t,n)},s.calculate=function(){return n.calculate(this)},s.encodeDelimited=function(t,r){var i=!1;t||(t=new e,i=!0);var o=(new e).LE();return n.encode(this,o,r).flip(),t.writeVarint32(o.remaining()),t.append(o),i?t.flip():t},s.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},s.toArrayBuffer=s.encodeAB,s.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},s.toBuffer=s.encodeNB,s.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},s.toBase64=s.encode64,s.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},s.toHex=s.encodeHex,s.toRaw=function(e,t){return r(this,!!e,!!t,this.$type)},s.encodeJSON=function(){return JSON.stringify(r(this,!0,!0,this.$type))},a.decode=function(t,r,i){"string"==typeof r&&(i=r,r=-1),"string"==typeof t?t=e.wrap(t,i||"base64"):e.isByteBuffer(t)||(t=e.wrap(t));var o=t.littleEndian;try{var a=n.decode(t.LE(),r);return t.LE(o),a}catch(e){throw t.LE(o),e}},a.decodeDelimited=function(t,r){if("string"==typeof t?t=e.wrap(t,r||"base64"):e.isByteBuffer(t)||(t=e.wrap(t)),t.remaining()<1)return null;var i=t.offset,o=t.readVarint32();if(t.remaining()<o)return t.offset=i,null;try{var a=n.decode(t.slice(t.offset,t.offset+o).LE());return t.offset+=o,a}catch(e){throw t.offset+=o,e}},a.decode64=function(e){return a.decode(e,"base64")},a.decodeHex=function(e){return a.decode(e,"hex")},a.decodeJSON=function(e){return new a(JSON.parse(e))},s.toString=function(){return n.toString()};return Object.defineProperty&&(Object.defineProperty(a,"$options",{value:n.buildOpt()}),Object.defineProperty(s,"$options",{value:a.$options}),Object.defineProperty(a,"$type",{value:n}),Object.defineProperty(s,"$type",{value:n})),a}(t,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var i,o=0,a=this.children.length;o<a;o++)if((i=this.children[o])instanceof y||i instanceof h||i instanceof w){if(r.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");r[i.name]=i.build()}else if(i instanceof h.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(i instanceof h.OneOf)this._oneofsByName[i.name]=i;else if(!(i instanceof h.OneOf||i instanceof _))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=r},d.encode=function(e,t,n){for(var r,i,o=null,a=0,s=this._fields.length;a<s;++a)r=this._fields[a],i=e[r.name],r.required&&null===i?null===o&&(o=r):r.encode(n?i:r.verifyValue(i),t,e);if(null!==o){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+o);throw u.encoded=t,u}return t},d.calculate=function(e){for(var t,n,r=0,i=0,o=this._fields.length;i<o;++i){if(t=this._fields[i],n=e[t.name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},d.decode=function(e,n,r){"number"!=typeof n&&(n=-1);for(var o,a,s,u,c=e.offset,f=new this.clazz;e.offset<c+n||-1===n&&e.remaining()>0;){if(o=e.readVarint32(),a=7&o,s=o>>>3,a===t.WIRE_TYPES.ENDGROUP){if(s!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+s+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[s]){if(u.repeated&&!u.options.packed)f[u.name].push(u.decode(a,e));else if(u.map){var l=u.decode(a,e);f[u.name].set(l[0],l[1])}else if(f[u.name]=u.decode(a,e),u.oneof){var h=f[u.oneof.name];null!==h&&h!==u.name&&(f[h]=null),f[u.oneof.name]=u.name}}else switch(a){case t.WIRE_TYPES.VARINT:e.readVarint32();break;case t.WIRE_TYPES.BITS32:e.offset+=4;break;case t.WIRE_TYPES.BITS64:e.offset+=8;break;case t.WIRE_TYPES.LDELIM:var d=e.readVarint32();e.offset+=d;break;case t.WIRE_TYPES.STARTGROUP:for(;i(s,e););break;default:throw Error("Illegal wire type for unknown field "+s+" in "+this.toString(!0)+"#decode: "+a)}}for(var p=0,v=this._fields.length;p<v;++p)if(u=this._fields[p],null===f[u.name])if("proto3"===this.syntax)f[u.name]=u.defaultValue;else{if(u.required){var m=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name);throw m.decoded=f,m}t.populateDefaults&&null!==u.defaultValue&&(f[u.name]=u.defaultValue)}return f},o.Message=h;var p=function(e,n,r,i,o,s,u,c,f,l){a.call(this,e,n,s),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=u,this.options=c||{},this.defaultValue=null,this.oneof=f||null,this.syntax=l||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof h.ExtensionField||(this.name=t.Util.toCamelCase(this.name))},v=p.prototype=Object.create(a.prototype);v.build=function(){this.element=new f(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new f(this.keyType,void 0,!0,this.syntax,this.name)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=f.defaultFieldValue(this.type)},v.verifyValue=function(e,n){function r(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}n=n||!1;var i=this;if(null===e)return this.required&&r(typeof e,"required"),"proto3"===this.syntax&&this.type!==t.TYPES.message&&r(typeof e,"proto3 field without field presence cannot be null"),null;var o;if(this.repeated&&!n){Array.isArray(e)||(e=[e]);var a=[];for(o=0;o<e.length;o++)a.push(this.element.verifyValue(e[o]));return a}return this.map&&!n?e instanceof t.Map?e:(e instanceof Object||r(typeof e,"expected ProtoBuf.Map or raw object for map field"),new t.Map(this,e)):(!this.repeated&&Array.isArray(e)&&r(typeof e,"no array expected"),this.element.verifyValue(e))},v.hasWirePresence=function(e,n){if("proto3"!==this.syntax)return null!==e;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case t.TYPES.int32:case t.TYPES.sint32:case t.TYPES.sfixed32:case t.TYPES.uint32:case t.TYPES.fixed32:return 0!==e;case t.TYPES.int64:case t.TYPES.sint64:case t.TYPES.sfixed64:case t.TYPES.uint64:case t.TYPES.fixed64:return 0!==e.low||0!==e.high;case t.TYPES.bool:return e;case t.TYPES.float:case t.TYPES.double:return 0!==e;case t.TYPES.string:return e.length>0;case t.TYPES.bytes:return e.remaining()>0;case t.TYPES.enum:return 0!==e;case t.TYPES.message:return null!==e;default:return!0}},v.encode=function(n,r,i){if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===n||this.repeated&&0==n.length)return r;try{if(this.repeated){var o;if(this.options.packed&&t.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){r.writeVarint32(this.id<<3|t.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1);var a=r.offset;for(o=0;o<n.length;o++)this.element.encodeValue(this.id,n[o],r);var s=r.offset-a,u=e.calculateVarint32(s);if(u>1){var c=r.slice(a,r.offset);a+=u-1,r.offset=a,r.append(c)}r.writeVarint32(s,a-u)}else for(o=0;o<n.length;o++)r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,n[o],r)}else this.map?n.forEach(function(n,i,o){var a=e.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+e.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,n);r.writeVarint32(this.id<<3|t.WIRE_TYPES.LDELIM),r.writeVarint32(a),r.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,r),r.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,n,r)},this):this.hasWirePresence(n,i)&&(r.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,n,r))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+n+" ("+e+")")}return r},v.calculate=function(n,r){if(n=this.verifyValue(n),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===n||this.repeated&&0==n.length)return 0;var i=0;try{if(this.repeated){var o,a;if(this.options.packed&&t.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=e.calculateVarint32(this.id<<3|t.WIRE_TYPES.LDELIM),a=0,o=0;o<n.length;o++)a+=this.element.calculateLength(this.id,n[o]);i+=e.calculateVarint32(a),i+=a}else for(o=0;o<n.length;o++)i+=e.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,n[o])}else this.map?n.forEach(function(n,r,o){var a=e.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+e.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,n);i+=e.calculateVarint32(this.id<<3|t.WIRE_TYPES.LDELIM),i+=e.calculateVarint32(a),i+=a},this):this.hasWirePresence(n,r)&&(i+=e.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,n))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+n+" ("+e+")")}return i},v.decode=function(e,n,r){var i,o;if(!(!this.map&&e==this.type.wireType||!r&&this.repeated&&this.options.packed&&e==t.WIRE_TYPES.LDELIM||this.map&&e==t.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+e+" ("+this.type.wireType+" expected)");if(e==t.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&t.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){o=n.readVarint32(),o=n.offset+o;for(var a=[];n.offset<o;)a.push(this.decode(this.type.wireType,n,!0));return a}if(this.map){var s=f.defaultFieldValue(this.keyType);if(i=f.defaultFieldValue(this.type),o=n.readVarint32(),n.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+n.remaining());var u=n.clone();for(u.limit=u.offset+o,n.offset+=o;u.remaining()>0;){var c=u.readVarint32();e=7&c;var l=c>>>3;if(1===l)s=this.keyElement.decode(u,e,l);else{if(2!==l)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(u,e,l)}}return[s,i]}return this.element.decode(n,e,this.id)},o.Message.Field=p;var m=function(e,t,n,r,i,o,a){p.call(this,e,t,n,null,r,i,o,a),this.extension};m.prototype=Object.create(p.prototype),o.Message.ExtensionField=m;var g=function(e,t,n){a.call(this,e,t,n),this.fields=[]};o.Message.OneOf=g;var y=function(e,t,n,r,i){u.call(this,e,t,n,r,i),this.className="Enum",this.object=null};y.getName=function(e,t){for(var n,r=Object.keys(e),i=0;i<r.length;++i)if(e[n=r[i]]===t)return n;return null},(y.prototype=Object.create(u.prototype)).build=function(e){if(this.object&&!e)return this.object;for(var n=new t.Builder.Enum,r=this.getChildren(y.Value),i=0,o=r.length;i<o;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},o.Enum=y;var b=function(e,t,n,r){a.call(this,e,t,n),this.className="Enum.Value",this.id=r};b.prototype=Object.create(a.prototype),o.Enum.Value=b;var _=function(e,t,n,r){a.call(this,e,t,n),this.field=r};_.prototype=Object.create(a.prototype),o.Extension=_;var w=function(e,t,n,r){u.call(this,e,t,n,r),this.className="Service",this.clazz=null};(w.prototype=Object.create(u.prototype)).build=function(n){return this.clazz&&!n?this.clazz:this.clazz=function(t,n){for(var r=function(e){t.Builder.Service.call(this),this.rpcImpl=e||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=r.prototype=Object.create(t.Builder.Service.prototype),o=n.getChildren(t.Reflect.Service.RPCMethod),a=0;a<o.length;a++)!function(t){i[t.name]=function(r,i){try{try{r=t.resolvedRequestType.clazz.decode(e.wrap(r))}catch(e){if(!(e instanceof TypeError))throw e}if(null===r||"object"!=typeof r)throw Error("Illegal arguments");r instanceof t.resolvedRequestType.clazz||(r=new t.resolvedRequestType.clazz(r)),this.rpcImpl(t.fqn(),r,function(e,r){if(e)return void i(e);null===r&&(r="");try{r=t.resolvedResponseType.clazz.decode(r)}catch(e){}if(!(r&&r instanceof t.resolvedResponseType.clazz))return void i(Error("Illegal response type received in service method "+n.name+"#"+t.name));i(null,r)})}catch(e){setTimeout(i.bind(this,e),0)}},r[t.name]=function(e,n,i){new r(e)[t.name](n,i)},Object.defineProperty&&(Object.defineProperty(r[t.name],"$options",{value:t.buildOpt()}),Object.defineProperty(i[t.name],"$options",{value:r[t.name].$options}))}(o[a]);return Object.defineProperty&&(Object.defineProperty(r,"$options",{value:n.buildOpt()}),Object.defineProperty(i,"$options",{value:r.$options}),Object.defineProperty(r,"$type",{value:n}),Object.defineProperty(i,"$type",{value:n})),r}(t,this)},o.Service=w;var E=function(e,t,n,r){a.call(this,e,t,n),this.className="Service.Method",this.options=r||{}};(E.prototype=Object.create(a.prototype)).buildOpt=c.buildOpt,o.Service.Method=E;var O=function(e,t,n,r,i,o,a,s){E.call(this,e,t,n,s),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=a,this.resolvedRequestType=null,this.resolvedResponseType=null};return O.prototype=Object.create(E.prototype),o.Service.RPCMethod=O,o}(r),r.Builder=function(e,t,r){function i(e){e.messages&&e.messages.forEach(function(t){t.syntax=e.syntax,i(t)}),e.enums&&e.enums.forEach(function(t){t.syntax=e.syntax})}var o=function(e){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},a=o.prototype;return o.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},o.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},o.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},o.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},o.isExtend=function(e){return"string"==typeof e.ref},a.reset=function(){return this.ptr=this.ns,this},a.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach(function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new r.Namespace(this,this.ptr,e)),this.ptr=t},this),this},a.create=function(t){if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(var n=[t];n.length>0;){if(t=n.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var i=t.shift();if(o.isMessage(i)){var a=new r.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax),s={};i.oneofs&&Object.keys(i.oneofs).forEach(function(e){a.addChild(s[e]=new r.Message.OneOf(this,a,e))},this),i.fields&&i.fields.forEach(function(e){if(null!==a.getChild(0|e.id))throw Error("duplicate or invalid field id in "+a.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+a.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=s[e.oneof]))throw Error("illegal oneof in "+a.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),t&&t.fields.push(e),a.addChild(e)},this);var u=[];if(i.enums&&i.enums.forEach(function(e){u.push(e)}),i.messages&&i.messages.forEach(function(e){u.push(e)}),i.services&&i.services.forEach(function(e){u.push(e)}),i.extensions&&("number"==typeof i.extensions[0]?a.extensions=[i.extensions]:a.extensions=i.extensions),this.ptr.addChild(a),u.length>0){n.push(t),t=u,u=null,this.ptr=a,a=null;continue}u=null}else if(o.isEnum(i))a=new r.Enum(this,this.ptr,i.name,i.options,i.syntax),i.values.forEach(function(e){a.addChild(new r.Enum.Value(this,a,e.name,e.id))},this),this.ptr.addChild(a);else if(o.isService(i))a=new r.Service(this,this.ptr,i.name,i.options),Object.keys(i.rpc).forEach(function(e){var t=i.rpc[e];a.addChild(new r.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))},this),this.ptr.addChild(a);else{if(!o.isExtend(i))throw Error("not a valid definition: "+JSON.stringify(i));if(a=this.ptr.resolve(i.ref,!0))i.fields.forEach(function(t){if(null!==a.getChild(0|t.id))throw Error("duplicate extended field id in "+a.name+": "+t.id);if(a.extensions){var n=!1;if(a.extensions.forEach(function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)}),!n)throw Error("illegal extended field id in "+a.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var o=new r.Message.ExtensionField(this,a,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),s=new r.Extension(this,this.ptr,t.name,o);o.extension=s,this.ptr.addChild(s),a.addChild(o)},this);else if(!/\.?google\.protobuf\./.test(i.ref))throw Error("extended message "+i.ref+" is not defined")}i=null,a=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},a.import=function(t,r){var o="/";if("string"==typeof r){if(e.Util.IS_NODE&&(r=n(75).resolve(r)),!0===this.files[r])return this.reset();this.files[r]=!0}else if("object"==typeof r){var a=r.root;e.Util.IS_NODE&&(a=n(75).resolve(a)),(a.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(o="\\");var s;if(s=e.Util.IS_NODE?n(75).join(a,r.file):a+o+r.file,!0===this.files[s])return this.reset();this.files[s]=!0}if(t.imports&&t.imports.length>0){var u,c=!1;"object"==typeof r?(this.importRoot=r.root,c=!0,u=this.importRoot,r=r.file,(u.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(o="\\")):"string"==typeof r?this.importRoot?u=this.importRoot:r.indexOf("/")>=0?""===(u=r.replace(/\/[^\/]*$/,""))&&(u="/"):r.indexOf("\\")>=0?(u=r.replace(/\\[^\\]*$/,""),o="\\"):u=".":u=null;for(var f=0;f<t.imports.length;f++)if("string"==typeof t.imports[f]){if(!u)throw Error("cannot determine import root");var l=t.imports[f];if("google/protobuf/descriptor.proto"===l)continue;if(l=e.Util.IS_NODE?n(75).join(u,l):u+o+l,!0===this.files[l])continue;/\.proto$/i.test(l)&&!e.DotProto&&(l=l.replace(/\.proto$/,".json"));var h=e.Util.fetch(l);if(null===h)throw Error("failed to import '"+l+"' in '"+r+"': file not found");/\.json$/i.test(l)?this.import(JSON.parse(h+""),l):this.import(e.DotProto.Parser.parse(h),l)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[f],r.replace(/^(.+)\.(\w+)$/,function(e,t,n){return t+"_import"+f+"."+n})):this.import(t.imports[f],r+"_import"+f):this.import(t.imports[f]);c&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&i(t);var d=this.ptr;return t.options&&Object.keys(t.options).forEach(function(e){d.options[e]=t.options[e]}),t.messages&&(this.create(t.messages),this.ptr=d),t.enums&&(this.create(t.enums),this.ptr=d),t.services&&(this.create(t.services),this.ptr=d),t.extends&&this.create(t.extends),this.reset()},a.resolveAll=function(){var n;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach(function(e){this.ptr=e,this.resolveAll()},this);else if(this.ptr instanceof r.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(n=(this.ptr instanceof r.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=n,n instanceof r.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==n.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(n instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=n.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==e.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&(this.ptr.options.packed=!0)}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((n=this.ptr.parent.resolve(this.ptr.requestName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=n,!((n=this.ptr.parent.resolve(this.ptr.responseName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=n}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},a.build=function(e){if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(var t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},a.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},a.toString=function(){return"Builder"},o.Message=function(){},o.Enum=function(){},o.Service=function(){},o}(r,r.Lang,r.Reflect),r.Map=function(e,t){function n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),n)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=this.keyElem.valueFromString(r[i]),a=this.valueElem.verifyValue(n[r[i]]);this.map[this.keyElem.valueToString(o)]={key:o,value:a}}},i=r.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},i.entries=function(){for(var e,t=[],r=Object.keys(this.map),i=0;i<r.length;i++)t.push([(e=this.map[r[i]]).key,e.value]);return n(t)},i.keys=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].key);return n(e)},i.values=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].value);return n(e)},i.forEach=function(e,t){for(var n,r=Object.keys(this.map),i=0;i<r.length;i++)e.call(t,(n=this.map[r[i]]).value,n.key,this)},i.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},i.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},r}(0,r.Reflect),r.newBuilder=function(e){return e=e||{},void 0===e.convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=r.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=r.populateAccessors),new r.Builder(e)},r.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"==typeof t||(t=r.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},r.loadJsonFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return r.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,function(i){if(null===i)return void t(Error("Failed to fetch file"));try{t(null,r.loadJson(JSON.parse(i),n,e))}catch(e){t(e)}});var i=r.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===i?null:r.loadJson(JSON.parse(i),n,e)},r})},function(e,t,n){var r,i,o;/**
13 * @license bytebuffer.js (c) 2015 Daniel Wirtz <dcode@dcode.io>
14 * Backing buffer: ArrayBuffer, Accessor: Uint8Array
15 * Released under the Apache License, Version 2.0
16 * see: https://github.com/dcodeIO/bytebuffer.js for details
17 */
18!function(a,s){i=[n(395)],r=s,void 0!==(o="function"==typeof r?r.apply(t,i):r)&&(e.exports=o)}(0,function(e){"use strict";function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+u.apply(String,e);e.length+arguments.length>1024&&(t.push(u.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function r(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,f=-7,l=n?i-1:0,h=n?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)}function i(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+l>=1?h/u:h*Math.pow(2,1-l),t*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+d]=255&a,d+=p,a/=256,c-=8);e[n+d-p]|=128*v}var o=function(e,t,n){if(void 0===e&&(e=o.DEFAULT_CAPACITY),void 0===t&&(t=o.DEFAULT_ENDIAN),void 0===n&&(n=o.DEFAULT_NOASSERT),!n){if((e|=0)<0)throw RangeError("Illegal capacity");t=!!t,n=!!n}this.buffer=0===e?s:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=n};o.VERSION="5.0.1",o.LITTLE_ENDIAN=!0,o.BIG_ENDIAN=!1,o.DEFAULT_CAPACITY=16,o.DEFAULT_ENDIAN=o.BIG_ENDIAN,o.DEFAULT_NOASSERT=!1,o.Long=e||null;var a=o.prototype;a.__isByteBuffer__,Object.defineProperty(a,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var s=new ArrayBuffer(0),u=String.fromCharCode;o.accessor=function(){return Uint8Array},o.allocate=function(e,t,n){return new o(e,t,n)},o.concat=function(e,t,n,r){"boolean"!=typeof t&&"string"==typeof t||(r=n,n=t,t=void 0);for(var i,a=0,s=0,u=e.length;s<u;++s)o.isByteBuffer(e[s])||(e[s]=o.wrap(e[s],t)),(i=e[s].limit-e[s].offset)>0&&(a+=i);if(0===a)return new o(0,n,r);var c,f=new o(a,n,r);for(s=0;s<u;)c=e[s++],(i=c.limit-c.offset)<=0||(f.view.set(c.view.subarray(c.offset,c.limit),f.offset),f.offset+=i);return f.limit=f.offset,f.offset=0,f},o.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},o.type=function(){return ArrayBuffer},o.wrap=function(e,t,n,r){if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return o.fromBase64(e,n);case"hex":return o.fromHex(e,n);case"binary":return o.fromBinary(e,n);case"utf8":return o.fromUTF8(e,n);case"debug":return o.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var i;if(o.isByteBuffer(e))return i=a.clone.call(e),i.markedOffset=-1,i;if(e instanceof Uint8Array)i=new o(0,n,r),e.length>0&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new o(0,n,r),e.byteLength>0&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");i=new o(e.length,n,r),i.limit=e.length;for(var s=0;s<e.length;++s)i.view[s]=e[s]}return i},a.writeBitSet=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=t,o=e.length,a=o>>3,s=0;for(t+=this.writeVarint32(o,t);a--;)r=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(r,t++);if(s<o){var u=0;for(r=0;s<o;)r|=(1&!!e[s++])<<u++;this.writeByte(r,t++)}return n?(this.offset=t,this):t-i},a.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var n,r=this.readVarint32(e),i=r.value,o=i>>3,a=0,s=[];for(e+=r.length;o--;)n=this.readByte(e++),s[a++]=!!(1&n),s[a++]=!!(2&n),s[a++]=!!(4&n),s[a++]=!!(8&n),s[a++]=!!(16&n),s[a++]=!!(32&n),s[a++]=!!(64&n),s[a++]=!!(128&n);if(a<i){var u=0;for(n=this.readByte(e++);a<i;)s[a++]=!!(n>>u++&1)}return t&&(this.offset=e),s},a.readBytes=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var r=this.slice(t,t+e);return n&&(this.offset+=e),r},a.writeBytes=a.append,a.writeInt8=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},a.writeByte=a.writeInt8,a.readInt8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return 128==(128&n)&&(n=-(255-n+1)),t&&(this.offset+=1),n},a.readByte=a.readInt8,a.writeUint8=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,n&&(this.offset+=1),this},a.writeUInt8=a.writeUint8,a.readUint8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=this.view[e];return t&&(this.offset+=1),n},a.readUInt8=a.readUint8,a.writeInt16=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},a.writeShort=a.writeInt16,a.readInt16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),32768==(32768&n)&&(n=-(65535-n+1)),t&&(this.offset+=2),n},a.readShort=a.readInt16,a.writeUint16=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),n&&(this.offset+=2),this},a.writeUInt16=a.writeUint16,a.readUint16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e],n|=this.view[e+1]<<8):(n=this.view[e]<<8,n|=this.view[e+1]),t&&(this.offset+=2),n},a.readUInt16=a.readUint16,a.writeInt32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},a.writeInt=a.writeInt32,a.readInt32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),n|=0,t&&(this.offset+=4),n},a.readInt=a.readInt32,a.writeUint32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),n&&(this.offset+=4),this},a.writeUInt32=a.writeUint32,a.readUint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=0;return this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0):(n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0),t&&(this.offset+=4),n},a.readUInt32=a.readUint32,e&&(a.writeInt64=function(t,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=t.low,a=t.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},a.writeLong=a.writeInt64,a.readInt64=function(t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0);var o=new e(r,i,!1);return n&&(this.offset+=8),o},a.readLong=a.readInt64,a.writeUint64=function(t,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),n+=8;var i=this.buffer.byteLength;n>i&&this.resize((i*=2)>n?i:n),n-=8;var o=t.low,a=t.high;return this.littleEndian?(this.view[n+3]=o>>>24&255,this.view[n+2]=o>>>16&255,this.view[n+1]=o>>>8&255,this.view[n]=255&o,n+=4,this.view[n+3]=a>>>24&255,this.view[n+2]=a>>>16&255,this.view[n+1]=a>>>8&255,this.view[n]=255&a):(this.view[n]=a>>>24&255,this.view[n+1]=a>>>16&255,this.view[n+2]=a>>>8&255,this.view[n+3]=255&a,n+=4,this.view[n]=o>>>24&255,this.view[n+1]=o>>>16&255,this.view[n+2]=o>>>8&255,this.view[n+3]=255&o),r&&(this.offset+=8),this},a.writeUInt64=a.writeUint64,a.readUint64=function(t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=0,i=0;this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0);var o=new e(r,i,!0);return n&&(this.offset+=8),o},a.readUInt64=a.readUint64),a.writeFloat32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),n&&(this.offset+=4),this},a.writeFloat=a.writeFloat32,a.readFloat32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=r(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),n},a.readFloat=a.readFloat32,a.writeFloat64=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),n&&(this.offset+=8),this},a.writeDouble=a.writeFloat64,a.readFloat64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=r(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),n},a.readDouble=a.readFloat64,o.MAX_VARINT32_BYTES=5,o.calculateVarint32=function(e){return e>>>=0,e<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},o.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},o.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},a.writeVarint32=function(e,t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,i=o.calculateVarint32(e);t+=i;var a=this.buffer.byteLength;for(t>a&&this.resize((a*=2)>t?a:t),t-=i,e>>>=0;e>=128;)r=127&e|128,this.view[t++]=r,e>>>=7;return this.view[t++]=e,n?(this.offset=t,this):i},a.writeVarint32ZigZag=function(e,t){return this.writeVarint32(o.zigZagEncode32(e),t)},a.readVarint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n,r=0,i=0;do{if(!this.noAssert&&e>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}n=this.view[e++],r<5&&(i|=(127&n)<<7*r),++r}while(0!=(128&n));return i|=0,t?(this.offset=e,i):{value:i,length:r}},a.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=o.zigZagDecode32(t.value):t=o.zigZagDecode32(t),t},e&&(o.MAX_VARINT64_BYTES=10,o.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:n<1<<21?3:4:r<16384?r<128?5:6:r<1<<21?7:8:i<128?9:10},o.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},o.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},a.writeVarint64=function(t,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned());var i=o.calculateVarint64(t),a=t.toInt()>>>0,s=t.shiftRightUnsigned(28).toInt()>>>0,u=t.shiftRightUnsigned(56).toInt()>>>0;n+=i;var c=this.buffer.byteLength;switch(n>c&&this.resize((c*=2)>n?c:n),n-=i,i){case 10:this.view[n+9]=u>>>7&1;case 9:this.view[n+8]=9!==i?128|u:127&u;case 8:this.view[n+7]=8!==i?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==i?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==i?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==i?128|s:127&s;case 4:this.view[n+3]=4!==i?a>>>21|128:a>>>21&127;case 3:this.view[n+2]=3!==i?a>>>14|128:a>>>14&127;case 2:this.view[n+1]=2!==i?a>>>7|128:a>>>7&127;case 1:this.view[n]=1!==i?128|a:127&a}return r?(this.offset+=i,this):i},a.writeVarint64ZigZag=function(e,t){return this.writeVarint64(o.zigZagEncode64(e),t)},a.readVarint64=function(t){var n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=t,i=0,o=0,a=0,s=0;if(s=this.view[t++],i=127&s,128&s&&(s=this.view[t++],i|=(127&s)<<7,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],i|=(127&s)<<14,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],i|=(127&s)<<21,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],o=127&s,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],o|=(127&s)<<7,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],o|=(127&s)<<14,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],o|=(127&s)<<21,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],a=127&s,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],a|=(127&s)<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|o<<28,o>>>4|a<<24,!1);return n?(this.offset=t,u):{value:u,length:t-r}},a.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=o.zigZagDecode64(n.value):n=o.zigZagDecode64(n),n}),a.writeCString=function(e,n){var r=void 0===n;r&&(n=this.offset);var i,o=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i<o;++i)if(0===e.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}o=f.calculateUTF16asUTF8(t(e))[1],n+=o+1;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=o+1,f.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,r?(this.offset=n,this):o},a.readCString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=e,o=-1;return f.decodeUTF8toUTF16(function(){if(0===o)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return o=this.view[e++],0===o?null:o}.bind(this),r=n(),!0),t?(this.offset=e,r()):{string:r(),length:e-i}},a.writeIString=function(e,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o=n;i=f.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+i;var a=this.buffer.byteLength;if(n>a&&this.resize((a*=2)>n?a:n),n-=4+i,this.littleEndian?(this.view[n+3]=i>>>24&255,this.view[n+2]=i>>>16&255,this.view[n+1]=i>>>8&255,this.view[n]=255&i):(this.view[n]=i>>>24&255,this.view[n+1]=i>>>16&255,this.view[n+2]=i>>>8&255,this.view[n+3]=255&i),n+=4,f.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==o+4+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+i));return r?(this.offset=n,this):n-o},a.readIString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=e,r=this.readUint32(e),i=this.readUTF8String(r,o.METRICS_BYTES,e+=4);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},o.METRICS_CHARS="c",o.METRICS_BYTES="b",a.writeUTF8String=function(e,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,o=n;i=f.calculateUTF16asUTF8(t(e))[1],n+=i;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=i,f.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),r?(this.offset=n,this):n-o},a.writeString=a.writeUTF8String,o.calculateUTF8Chars=function(e){return f.calculateUTF16asUTF8(t(e))[0]},o.calculateUTF8Bytes=function(e){return f.calculateUTF16asUTF8(t(e))[1]},o.calculateString=o.calculateUTF8Bytes,a.readUTF8String=function(e,t,r){"number"==typeof t&&(r=t,t=void 0);var i=void 0===r;if(i&&(r=this.offset),void 0===t&&(t=o.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var a,s=0,u=r;if(t===o.METRICS_CHARS){if(a=n(),f.decodeUTF8(function(){return s<e&&r<this.limit?this.view[r++]:null}.bind(this),function(e){++s,f.UTF8toUTF16(e,a)}),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=r,a()):{string:a(),length:r-u}}if(t===o.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}var c=r+e;if(f.decodeUTF8toUTF16(function(){return r<c?this.view[r++]:null}.bind(this),a=n(),this.noAssert),r!==c)throw RangeError("Illegal range: Truncated data, "+r+" == "+c);return i?(this.offset=r,a()):{string:a(),length:r-u}}throw TypeError("Unsupported metrics: "+t)},a.readString=a.readUTF8String,a.writeVString=function(e,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var i,a,s=n;i=f.calculateUTF16asUTF8(t(e),this.noAssert)[1],a=o.calculateVarint32(i),n+=a+i;var u=this.buffer.byteLength;if(n>u&&this.resize((u*=2)>n?u:n),n-=a+i,n+=this.writeVarint32(i,n),f.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==s+i+a)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+i+a));return r?(this.offset=n,this):n-s},a.readVString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,r=this.readVarint32(e),i=this.readUTF8String(r.value,o.METRICS_BYTES,e+=r.length);return e+=i.length,t?(this.offset=e,i.string):{string:i.string,length:e-n}},a.append=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof o||(e=o.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;n+=i;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i),this},a.appendTo=function(e,t){return e.append(this,t),this},a.assert=function(e){return this.noAssert=!e,this},a.capacity=function(){return this.buffer.byteLength},a.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},a.clone=function(e){var t=new o(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},a.compact=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var n=t-e;if(0===n)return this.buffer=s,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var r=new ArrayBuffer(n),i=new Uint8Array(r);return i.set(this.view.subarray(e,t)),this.buffer=r,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this},a.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new o(0,this.littleEndian,this.noAssert);var n=t-e,r=new o(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},a.copyTo=function(e,t,n,r){var i,a;if(!this.noAssert&&!o.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(a=void 0===t)?e.offset:0|t,n=(i=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var s=r-n;return 0===s?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=s),a&&(e.offset+=s),this)},a.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},a.fill=function(e,t,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;t<n;)this.view[t++]=e;return r&&(this.offset=t),this},a.flip=function(){return this.limit=this.offset,this.offset=0,this},a.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},a.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},a.LE=function(e){return this.littleEndian=void 0===e||!!e,this},a.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},a.prepend=function(e,t,n){"number"!=typeof t&&"string"==typeof t||(n=t,t=void 0);var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof o||(e=o.wrap(e,t));var i=e.limit-e.offset;if(i<=0)return this;var a=i-n;if(a>0){var s=new ArrayBuffer(this.buffer.byteLength+a),u=new Uint8Array(s);u.set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=s,this.view=u,this.offset+=a,this.markedOffset>=0&&(this.markedOffset+=a),this.limit+=a,n+=a}else{new Uint8Array(this.buffer)}return this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(this.offset-=i),this},a.prependTo=function(e,t){return e.prepend(this,t),this},a.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},a.remaining=function(){return this.limit-this.offset},a.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},a.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),n=new Uint8Array(t);n.set(this.view),this.buffer=t,this.view=n}return this},a.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t?this:(Array.prototype.reverse.call(this.view.subarray(e,t)),this)},a.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},a.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},a.toBuffer=function(e){var t=this.offset,n=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal limit: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(!e&&0===t&&n===this.buffer.byteLength)return this.buffer;if(t===n)return s;var r=new ArrayBuffer(n-t);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(t,n),0),r},a.toArrayBuffer=a.toBuffer,a.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(e="utf8",t=e,n=t),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var c=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],n=[],r=0,i=t.length;r<i;++r)n[t[r]]=r;return e.encode=function(e,n){for(var r,i;null!==(r=e());)n(t[r>>2&63]),i=(3&r)<<4,null!==(r=e())?(i|=r>>4&15,n(t[63&(i|r>>4&15)]),i=(15&r)<<2,null!==(r=e())?(n(t[63&(i|r>>6&3)]),n(t[63&r])):(n(t[63&i]),n(61))):(n(t[63&i]),n(61),n(61))},e.decode=function(e,t){function r(e){throw Error("Illegal character code: "+e)}for(var i,o,a;null!==(i=e());)if(o=n[i],void 0===o&&r(i),null!==(i=e())&&(a=n[i],void 0===a&&r(i),t(o<<2>>>0|(48&a)>>4),null!==(i=e()))){if(void 0===(o=n[i])){if(61===i)break;r(i)}if(t((15&a)<<4>>>0|(60&o)>>2),null!==(i=e())){if(void 0===(a=n[i])){if(61===i)break;r(i)}t((3&o)<<6>>>0|a)}}},e.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},e}();a.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return c.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=n()),r()},o.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new o(e.length/4*3,n),i=0;return c.decode(t(e),function(e){r.view[i++]=e}),r.limit=i,r},o.btoa=function(e){return o.fromBinary(e).toBase64()},o.atob=function(e){return o.fromBase64(e).toBinary()},a.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),e|=0,t|=0,e<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];e<t;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},o.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,a=new o(i,t);r<i;){if((n=e.charCodeAt(r))>255)throw RangeError("illegal char code: "+n);a.view[r++]=n}return a.limit=i,a},a.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",a="";n<r;){if(-1!==n&&(t=this.view[n],i+=t<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";a+=i+o+"\n",i=o=""}n===this.offset&&n===this.limit?i+=n===this.markedOffset?"!":"|":n===this.offset?i+=n===this.markedOffset?"[":"<":n===this.limit?i+=n===this.markedOffset?"]":">":i+=n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";a+=i+o+"\n"}return e?a:i},o.fromDebug=function(e,t,n){for(var r,i,a=e.length,s=new o((a+1)/3|0,t,n),u=0,c=0,f=!1,l=!1,h=!1,d=!1,p=!1;u<a;){switch(r=e.charAt(u++)){case"!":if(!n){if(l||h||d){p=!0;break}l=h=d=!0}s.offset=s.markedOffset=s.limit=c,f=!1;break;case"|":if(!n){if(l||d){p=!0;break}l=d=!0}s.offset=s.limit=c,f=!1;break;case"[":if(!n){if(l||h){p=!0;break}l=h=!0}s.offset=s.markedOffset=c,f=!1;break;case"<":if(!n){if(l){p=!0;break}l=!0}s.offset=c,f=!1;break;case"]":if(!n){if(d||h){p=!0;break}d=h=!0}s.limit=s.markedOffset=c,f=!1;break;case">":if(!n){if(d){p=!0;break}d=!0}s.limit=c,f=!1;break;case"'":if(!n){if(h){p=!0;break}h=!0}s.markedOffset=c,f=!1;break;case" ":f=!1;break;default:if(!n&&f){p=!0;break}if(i=parseInt(r+e.charAt(u++),16),!n&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[c++]=i,f=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!l||!d)throw TypeError("Illegal str: Missing offset or limit");if(c<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+c+" < "+a)}return s},a.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);e<t;)n=this.view[e++],n<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},o.fromHex=function(e,t,n){if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var r,i=e.length,a=new o(i/2|0,t),s=0,u=0;s<i;s+=2){if(r=parseInt(e.substring(s,s+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");a.view[u++]=r}return a.limit=u,a};var f=function(){var e={};return e.MAX_CODEPOINT=1114111,e.encodeUTF8=function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(n>>6&31|192),t(63&n|128)):n<65536?(t(n>>12&15|224),t(n>>6&63|128),t(63&n|128)):(t(n>>18&7|240),t(n>>12&63|128),t(n>>6&63|128),t(63&n|128)),n=null},e.decodeUTF8=function(e,t){for(var n,r,i,o,a=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(0==(128&n))t(n);else if(192==(224&n))null===(r=e())&&a([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))(null===(r=e())||null===(i=e()))&&a([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(o=e()))&&a([n,r,i,o]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}},e.UTF16toUTF8=function(e,t){for(var n,r=null;;){if(null===(n=null!==r?r:e()))break;n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n)}null!==r&&t(r)},e.UTF8toUTF16=function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(n-=65536,t(55296+(n>>10)),t(n%1024+56320)),n=null},e.encodeUTF16toUTF8=function(t,n){e.UTF16toUTF8(t,function(t){e.encodeUTF8(t,n)})},e.decodeUTF8toUTF16=function(t,n){e.decodeUTF8(t,function(t){e.UTF8toUTF16(t,n)})},e.calculateCodePoint=function(e){return e<128?1:e<2048?2:e<65536?3:4},e.calculateUTF8=function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},e.calculateUTF16asUTF8=function(t){var n=0,r=0;return e.UTF16toUTF8(t,function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4}),[n,r]},e}();return a.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{f.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},o.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new o(f.calculateUTF16asUTF8(t(e),!0)[1],n,r),a=0;return f.encodeUTF16toUTF8(t(e),function(e){i.view[a++]=e}),i.limit=a,i},o})},function(e,t,n){var r,i,o;/**
19 * @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
20 * Released under the Apache License, Version 2.0
21 * see: https://github.com/dcodeIO/long.js for details
22 */
23!function(n,a){i=[],r=a,void 0!==(o="function"==typeof r?r.apply(t,i):r)&&(e.exports=o)}(0,function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,r,o;return t?(e>>>=0,(o=0<=e&&e<256)&&(r=u[e])?r:(n=i(e,(0|e)<0?-1:0,!0),o&&(u[e]=n),n)):(e|=0,(o=-128<=e&&e<128)&&(r=s[e])?r:(n=i(e,e<0?-1:0,!1),o&&(s[e]=n),n))}function r(e,t){if(isNaN(e)||!isFinite(e))return t?v:p;if(t){if(e<0)return v;if(e>=l)return _}else{if(e<=-h)return w;if(e+1>=h)return b}return e<0?r(-e,t).neg():i(e%f|0,e/f|0,t)}function i(t,n,r){return new e(t,n,r)}function o(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return p;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(e.substring(1),t,n).neg();for(var a=r(c(n,8)),s=p,u=0;u<e.length;u+=8){var f=Math.min(8,e.length-u),l=parseInt(e.substring(u,u+f),n);if(f<8){var h=r(c(n,f));s=s.mul(h).add(r(l))}else s=s.mul(a),s=s.add(r(l))}return s.unsigned=t,s}function a(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?o(t):i(t.low,t.high,t.unsigned)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var s={},u={};e.fromInt=n,e.fromNumber=r,e.fromBits=i;var c=Math.pow;e.fromString=o,e.fromValue=a;var f=4294967296,l=f*f,h=l/2,d=n(1<<24),p=n(0);e.ZERO=p;var v=n(0,!0);e.UZERO=v;var m=n(1);e.ONE=m;var g=n(1,!0);e.UONE=g;var y=n(-1);e.NEG_ONE=y;var b=i(-1,2147483647,!1);e.MAX_VALUE=b;var _=i(-1,-1,!0);e.MAX_UNSIGNED_VALUE=_;var w=i(0,-2147483648,!1);e.MIN_VALUE=w;var E=e.prototype;return E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},E.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(w)){var t=r(e),n=this.div(t),i=n.mul(t).sub(this);return n.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var o=r(c(e,6),this.unsigned),a=this,s="";;){var u=a.div(o),f=a.sub(u.mul(o)).toInt()>>>0,l=f.toString(e);if(a=u,a.isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},E.isZero=function(){return 0===this.high&&0===this.low},E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return 1==(1&this.low)},E.isEven=function(){return 0==(1&this.low)},E.equals=function(e){return t(e)||(e=a(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},E.eq=E.equals,E.notEquals=function(e){return!this.eq(e)},E.neq=E.notEquals,E.lessThan=function(e){return this.comp(e)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(e){return this.comp(e)<=0},E.lte=E.lessThanOrEqual,E.greaterThan=function(e){return this.comp(e)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(e){return this.comp(e)>=0},E.gte=E.greaterThanOrEqual,E.compare=function(e){if(t(e)||(e=a(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(m)},E.neg=E.negate,E.add=function(e){t(e)||(e=a(e));var n=this.high>>>16,r=65535&this.high,o=this.low>>>16,s=65535&this.low,u=e.high>>>16,c=65535&e.high,f=e.low>>>16,l=65535&e.low,h=0,d=0,p=0,v=0;return v+=s+l,p+=v>>>16,v&=65535,p+=o+f,d+=p>>>16,p&=65535,d+=r+c,h+=d>>>16,d&=65535,h+=n+u,h&=65535,i(p<<16|v,h<<16|d,this.unsigned)},E.subtract=function(e){return t(e)||(e=a(e)),this.add(e.neg())},E.sub=E.subtract,E.multiply=function(e){if(this.isZero())return p;if(t(e)||(e=a(e)),e.isZero())return p;if(this.eq(w))return e.isOdd()?w:p;if(e.eq(w))return this.isOdd()?w:p;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return r(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,s=this.low>>>16,u=65535&this.low,c=e.high>>>16,f=65535&e.high,l=e.low>>>16,h=65535&e.low,v=0,m=0,g=0,y=0;return y+=u*h,g+=y>>>16,y&=65535,g+=s*h,m+=g>>>16,g&=65535,g+=u*l,m+=g>>>16,g&=65535,m+=o*h,v+=m>>>16,m&=65535,m+=s*l,v+=m>>>16,m&=65535,m+=u*f,v+=m>>>16,m&=65535,v+=n*h+o*l+s*f+u*c,v&=65535,i(g<<16|y,v<<16|m,this.unsigned)},E.mul=E.multiply,E.divide=function(e){if(t(e)||(e=a(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?v:p;var n,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return v;if(e.gt(this.shru(1)))return g;o=v}else{if(this.eq(w)){if(e.eq(m)||e.eq(y))return w;if(e.eq(w))return m;return n=this.shr(1).div(e).shl(1),n.eq(p)?e.isNegative()?m:y:(i=this.sub(e.mul(n)),o=n.add(i.div(e)))}if(e.eq(w))return this.unsigned?v:p;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=p}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:c(2,s-48),f=r(n),l=f.mul(e);l.isNegative()||l.gt(i);)n-=u,f=r(n,this.unsigned),l=f.mul(e);f.isZero()&&(f=m),o=o.add(f),i=i.sub(l)}return o},E.div=E.divide,E.modulo=function(e){return t(e)||(e=a(e)),this.sub(this.div(e).mul(e))},E.mod=E.modulo,E.not=function(){return i(~this.low,~this.high,this.unsigned)},E.and=function(e){return t(e)||(e=a(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},E.or=function(e){return t(e)||(e=a(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},E.xor=function(e){return t(e)||(e=a(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},E.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):i(0,this.low<<e-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var n=this.high;if(e<32){return i(this.low>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?i(n,0,this.unsigned):i(n>>>e-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},E.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},E.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})},function(e,t){},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new o(n,r||e,i),s=p?p+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],a]:e._events[s].push(a):(e._events[s]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function u(){this._events=new i,this._eventsCount=0}var c=n(194),f=r(c),l=n(109),h=r(l),d=Object.prototype.hasOwnProperty,p="~";h.default&&(i.prototype=(0,h.default)(null),(new i).__proto__||(p=!1)),u.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)d.call(e,t)&&n.push(p?t.slice(1):t);return f.default?n.concat((0,f.default)(e)):n},u.prototype.listeners=function(e){var t=p?p+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,o=new Array(i);r<i;r++)o[r]=n[r].fn;return o},u.prototype.listenerCount=function(e){var t=p?p+e:e,n=this._events[t];return n?n.fn?1:n.length:0},u.prototype.emit=function(e,t,n,r,i,o){var a=p?p+e:e;if(!this._events[a])return!1;var s,u,c=this._events[a],f=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,i),!0;case 6:return c.fn.call(c.context,t,n,r,i,o),!0}for(u=1,s=new Array(f-1);u<f;u++)s[u-1]=arguments[u];c.fn.apply(c.context,s)}else{var l,h=c.length;for(u=0;u<h;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),f){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,r);break;default:if(!s)for(l=1,s=new Array(f-1);l<f;l++)s[l-1]=arguments[l];c[u].fn.apply(c[u].context,s)}}return!0},u.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},u.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},u.prototype.removeListener=function(e,t,n,r){var i=p?p+e:e;if(!this._events[i])return this;if(!t)return s(this,i),this;var o=this._events[i];if(o.fn)o.fn!==t||r&&!o.once||n&&o.context!==n||s(this,i);else{for(var a=0,u=[],c=o.length;a<c;a++)(o[a].fn!==t||r&&!o[a].once||n&&o[a].context!==n)&&u.push(o[a]);u.length?this._events[i]=1===u.length?u[0]:u:s(this,i)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=p?p+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=p,u.EventEmitter=u,e.exports=u},function(e,t,n){e.exports=n(399)},function(e,t,n){var r=function(e){"use strict";function t(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}function n(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,a=Object.create(o.prototype),s=new d(r||[]);return a._invoke=c(e,n,s),a}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function o(){}function a(){}function s(e){["next","throw","return"].forEach(function(n){t(e,n,function(e){return this._invoke(n,e)})})}function u(e,t){function n(i,o,a,s){var u=r(e[i],e,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&y.call(f,"__await")?t.resolve(f.__await).then(function(e){n("next",e,a,s)},function(e){n("throw",e,a,s)}):t.resolve(f).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,s)})}s(u.arg)}function i(e,r){function i(){return new t(function(t,i){n(e,r,t,i)})}return o=o?o.then(i,i):i()}var o;this._invoke=i}function c(e,t,n){var i=O;return function(o,a){if(i===S)throw new Error("Generator is already running");if(i===A){if("throw"===o)throw a;return v()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=f(s,n);if(u){if(u===I)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===O)throw i=A,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=S;var c=r(e,t,n);if("normal"===c.type){if(i=n.done?A:T,c.arg===I)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=A,n.method="throw",n.arg=c.arg)}}}function f(e,t){var n=e.iterator[t.method];if(n===m){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=m,f(e,t),"throw"===t.method))return I;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return I}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,I;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=m),t.delegate=null,I):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,I)}function l(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function h(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(l,this),this.reset(!0)}function p(e){if(e){var t=e[_];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(y.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=m,t.done=!0,t};return r.next=r}}return{next:v}}function v(){return{value:m,done:!0}}var m,g=Object.prototype,y=g.hasOwnProperty,b="function"==typeof Symbol?Symbol:{},_=b.iterator||"@@iterator",w=b.asyncIterator||"@@asyncIterator",E=b.toStringTag||"@@toStringTag";try{t({},"")}catch(e){t=function(e,t,n){return e[t]=n}}e.wrap=n;var O="suspendedStart",T="suspendedYield",S="executing",A="completed",I={},j={};j[_]=function(){return this};var C=Object.getPrototypeOf,x=C&&C(C(p([])));x&&x!==g&&y.call(x,_)&&(j=x);var N=a.prototype=i.prototype=Object.create(j);return o.prototype=N.constructor=a,a.constructor=o,o.displayName=t(a,E,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===o||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,t(e,E,"GeneratorFunction")),e.prototype=Object.create(N),e},e.awrap=function(e){return{__await:e}},s(u.prototype),u.prototype[w]=function(){return this},e.AsyncIterator=u,e.async=function(t,r,i,o,a){void 0===a&&(a=Promise);var s=new u(n(t,r,i,o),a);return e.isGeneratorFunction(r)?s:s.next().then(function(e){return e.done?e.value:s.next()})},s(N),t(N,E,"Generator"),N[_]=function(){return this},N.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=p,d.prototype={constructor:d,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(h),!e)for(var t in this)"t"===t.charAt(0)&&y.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=m)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,r){return o.type="throw",o.arg=e,n.next=t,r&&(n.method="next",n.arg=m),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,I):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),I},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),h(n),I}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;h(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:p(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=m),I}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},function(e,t){function n(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,o){function a(e){n(u,i,o,a,s,"next",e)}function s(e){n(u,i,o,a,s,"throw",e)}var u=e.apply(t,r);a(void 0)})}}e.exports=r},function(e,t,n){function r(e){return i(e)||o(e)||a(e)||s()}var i=n(402),o=n(197),a=n(198),s=n(403);e.exports=r},function(e,t,n){function r(e){if(Array.isArray(e))return i(e)}var i=n(196);e.exports=r},function(e,t){function n(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}e.exports=n},function(e,t){function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}e.exports=n},function(e,t,n){function r(e,t){if(null==e)return{};var n,r,o=i(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var i=n(406);e.exports=r},function(e,t){function n(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}e.exports=n},function(e,t){function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}e.exports=n},function(e,t){function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}e.exports=n},function(e,t,n){function r(e){return(a(e)?i:o)(e)}var i=n(410),o=n(413),a=n(204);e.exports=r},function(e,t,n){function r(e){return o(i(e))}var i=n(411),o=n(199);e.exports=r},function(e,t){function n(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}e.exports=n},function(e,t){function n(e,t){return e+r(i()*(t-e+1))}var r=Math.floor,i=Math.random;e.exports=n},function(e,t,n){function r(e){return i(o(e))}var i=n(199),o=n(200);e.exports=r},function(e,t,n){function r(e,t){return i(t,function(t){return e[t]})}var i=n(415);e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}e.exports=n},function(e,t,n){function r(e){return a(e)?i(e):o(e)}var i=n(417),o=n(430),a=n(433);e.exports=r},function(e,t,n){function r(e,t){var n=a(e),r=!n&&o(e),f=!n&&!r&&s(e),h=!n&&!r&&!f&&c(e),d=n||r||f||h,p=d?i(e.length,String):[],v=p.length;for(var m in e)!t&&!l.call(e,m)||d&&("length"==m||f&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||u(m,v))||p.push(m);return p}var i=n(418),o=n(419),a=n(204),s=n(423),u=n(425),c=n(426),f=Object.prototype,l=f.hasOwnProperty;e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}e.exports=n},function(e,t,n){var r=n(420),i=n(77),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},function(e,t,n){function r(e){return o(e)&&i(e)==a}var i=n(76),o=n(77),a="[object Arguments]";e.exports=r},function(e,t,n){function r(e){var t=a.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[u]=n:delete e[u]),i}var i=n(201),o=Object.prototype,a=o.hasOwnProperty,s=o.toString,u=i?i.toStringTag:void 0;e.exports=r},function(e,t){function n(e){return i.call(e)}var r=Object.prototype,i=r.toString;e.exports=n},function(e,t,n){(function(e){var r=n(202),i=n(424),o="object"==typeof t&&t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o,u=s?r.Buffer:void 0,c=u?u.isBuffer:void 0,f=c||i;e.exports=f}).call(t,n(205)(e))},function(e,t){function n(){return!1}e.exports=n},function(e,t){function n(e,t){var n=typeof e;return!!(t=null==t?r:t)&&("number"==n||"symbol"!=n&&i.test(e))&&e>-1&&e%1==0&&e<t}var r=9007199254740991,i=/^(?:0|[1-9]\d*)$/;e.exports=n},function(e,t,n){var r=n(427),i=n(428),o=n(429),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},function(e,t,n){function r(e){return a(e)&&o(e.length)&&!!s[i(e)]}var i=n(76),o=n(206),a=n(77),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=r},function(e,t){function n(e){return function(t){return e(t)}}e.exports=n},function(e,t,n){(function(e){var r=n(203),i="object"==typeof t&&t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i,s=a&&r.process,u=function(){try{var e=o&&o.require&&o.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=u}).call(t,n(205)(e))},function(e,t,n){function r(e){if(!i(e))return o(e);var t=[];for(var n in Object(e))s.call(e,n)&&"constructor"!=n&&t.push(n);return t}var i=n(431),o=n(432),a=Object.prototype,s=a.hasOwnProperty;e.exports=r},function(e,t){function n(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}var r=Object.prototype;e.exports=n},function(e,t,n){var r=n(207),i=r(Object.keys,Object);e.exports=i},function(e,t,n){function r(e){return null!=e&&o(e.length)&&!i(e)}var i=n(434),o=n(206);e.exports=r},function(e,t,n){function r(e){if(!o(e))return!1;var t=i(e);return t==s||t==u||t==a||t==c}var i=n(76),o=n(435),a="[object AsyncFunction]",s="[object Function]",u="[object GeneratorFunction]",c="[object Proxy]";e.exports=r},function(e,t){function n(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=n},function(e,t,n){function r(e){return i(e)||o(e)||a(e)||s()}var i=n(437),o=n(197),a=n(198),s=n(438);e.exports=r},function(e,t){function n(e){if(Array.isArray(e))return e}e.exports=n},function(e,t){function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}e.exports=n},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}e.exports=r},function(e,t){function n(e,t,n,r,i){var o={};return Object.keys(r).forEach(function(e){o[e]=r[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce(function(n,r){return r(e,t,n)||n},o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}e.exports=n},function(e,t,n){!function(){var n={VERSION:"2.4.0",Result:{SUCCEEDED:1,NOTRANSITION:2,CANCELLED:3,PENDING:4},Error:{INVALID_TRANSITION:100,PENDING_TRANSITION:200,INVALID_CALLBACK:300},WILDCARD:"*",ASYNC:"async",create:function(e,t){var r="string"==typeof e.initial?{state:e.initial}:e.initial,i=e.terminal||e.final,o=t||e.target||{},a=e.events||[],s=e.callbacks||{},u={},c={},f=function(e){var t=Array.isArray(e.from)?e.from:e.from?[e.from]:[n.WILDCARD];u[e.name]=u[e.name]||{};for(var r=0;r<t.length;r++)c[t[r]]=c[t[r]]||[],c[t[r]].push(e.name),u[e.name][t[r]]=e.to||t[r];e.to&&(c[e.to]=c[e.to]||[])};r&&(r.event=r.event||"startup",f({name:r.event,from:"none",to:r.state}));for(var l=0;l<a.length;l++)f(a[l]);for(var h in u)u.hasOwnProperty(h)&&(o[h]=n.buildEvent(h,u[h]));for(var h in s)s.hasOwnProperty(h)&&(o[h]=s[h]);return o.current="none",o.is=function(e){return Array.isArray(e)?e.indexOf(this.current)>=0:this.current===e},o.can=function(e){return!this.transition&&void 0!==u[e]&&(u[e].hasOwnProperty(this.current)||u[e].hasOwnProperty(n.WILDCARD))},o.cannot=function(e){return!this.can(e)},o.transitions=function(){return(c[this.current]||[]).concat(c[n.WILDCARD]||[])},o.isFinished=function(){return this.is(i)},o.error=e.error||function(e,t,n,r,i,o,a){throw a||o},o.states=function(){return Object.keys(c).sort()},r&&!r.defer&&o[r.event](),o},doCallback:function(e,t,r,i,o,a){if(t)try{return t.apply(e,[r,i,o].concat(a))}catch(t){return e.error(r,i,o,a,n.Error.INVALID_CALLBACK,"an exception occurred in a caller-provided callback function",t)}},beforeAnyEvent:function(e,t,r,i,o){return n.doCallback(e,e.onbeforeevent,t,r,i,o)},afterAnyEvent:function(e,t,r,i,o){return n.doCallback(e,e.onafterevent||e.onevent,t,r,i,o)},leaveAnyState:function(e,t,r,i,o){return n.doCallback(e,e.onleavestate,t,r,i,o)},enterAnyState:function(e,t,r,i,o){return n.doCallback(e,e.onenterstate||e.onstate,t,r,i,o)},changeState:function(e,t,r,i,o){return n.doCallback(e,e.onchangestate,t,r,i,o)},beforeThisEvent:function(e,t,r,i,o){return n.doCallback(e,e["onbefore"+t],t,r,i,o)},afterThisEvent:function(e,t,r,i,o){return n.doCallback(e,e["onafter"+t]||e["on"+t],t,r,i,o)},leaveThisState:function(e,t,r,i,o){return n.doCallback(e,e["onleave"+r],t,r,i,o)},enterThisState:function(e,t,r,i,o){return n.doCallback(e,e["onenter"+i]||e["on"+i],t,r,i,o)},beforeEvent:function(e,t,r,i,o){if(!1===n.beforeThisEvent(e,t,r,i,o)||!1===n.beforeAnyEvent(e,t,r,i,o))return!1},afterEvent:function(e,t,r,i,o){n.afterThisEvent(e,t,r,i,o),n.afterAnyEvent(e,t,r,i,o)},leaveState:function(e,t,r,i,o){var a=n.leaveThisState(e,t,r,i,o),s=n.leaveAnyState(e,t,r,i,o);return!1!==a&&!1!==s&&(n.ASYNC===a||n.ASYNC===s?n.ASYNC:void 0)},enterState:function(e,t,r,i,o){n.enterThisState(e,t,r,i,o),n.enterAnyState(e,t,r,i,o)},buildEvent:function(e,t){return function(){var r=this.current,i=t[r]||(t[n.WILDCARD]!=n.WILDCARD?t[n.WILDCARD]:r)||r,o=Array.prototype.slice.call(arguments);if(this.transition)return this.error(e,r,i,o,n.Error.PENDING_TRANSITION,"event "+e+" inappropriate because previous transition did not complete");if(this.cannot(e))return this.error(e,r,i,o,n.Error.INVALID_TRANSITION,"event "+e+" inappropriate in current state "+this.current);if(!1===n.beforeEvent(this,e,r,i,o))return n.Result.CANCELLED;if(r===i)return n.afterEvent(this,e,r,i,o),n.Result.NOTRANSITION;var a=this;this.transition=function(){return a.transition=null,a.current=i,n.enterState(a,e,r,i,o),n.changeState(a,e,r,i,o),n.afterEvent(a,e,r,i,o),n.Result.SUCCEEDED},this.transition.cancel=function(){a.transition=null,n.afterEvent(a,e,r,i,o)};var s=n.leaveState(this,e,r,i,o);return!1===s?(this.transition=null,n.Result.CANCELLED):n.ASYNC===s?n.Result.PENDING:this.transition?this.transition():void 0}}};void 0!==e&&e.exports&&(t=e.exports=n),t.StateMachine=n}()},function(e,t){function n(t){"@babel/helpers - typeof";return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){function r(e){if(!a(e)||i(e)!=s)return!1;var t=o(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&f.call(n)==h}var i=n(76),o=n(444),a=n(77),s="[object Object]",u=Function.prototype,c=Object.prototype,f=u.toString,l=c.hasOwnProperty,h=f.call(Object);e.exports=r},function(e,t,n){var r=n(207),i=r(Object.getPrototypeOf,Object);e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i,o,a,s=n(195),u=r(s),c=n(188),f=r(c),l=n(446),h=r(l),d=n(187),p=r(d),v=n(109),m=r(v),g=n(43),y=r(g);!function(r,s){"object"===(0,y.default)(t)&&void 0!==e?s(t,n(110)):(o=[t,n(110)],i=s,void 0!==(a="function"==typeof i?i.apply(t,o):i)&&(e.exports=a))}(0,function(e,t){function n(e,t){e.prototype=(0,m.default)(t.prototype),e.prototype.constructor=e,e.__proto__=t}function r(e){return i(e)||o(e)||a()}function i(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function o(e){if((0,p.default)(Object(e))||"[object Arguments]"===Object.prototype.toString.call(e))return(0,h.default)(e)}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance")}if(!t.Protocals)throw new Error("LeanCloud Realtime SDK not installed");var s=t.Protocals.CommandType,c=t.Protocals.GenericCommand,l=t.Protocals.AckCommand,d=function(e){return console.warn(e.message)},v=function(e){function r(n,r,i){var o;return o=e.call(this)||this,o._appId=n,o.id=r,o._connection=i,o._eventemitter=new t.EventEmitter,o._querys=new f.default,o}n(r,e);var i=r.prototype;return i._send=function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return(t=this._connection).send.apply(t,[(0,u.default)(e,{appId:this._appId,installationId:this.id,service:1})].concat(r))},i._open=function(){return this._send(new c({cmd:s.login}))},i.close=function(){var e=this._eventemitter;return e.emit("beforeclose"),this._send(new c({cmd:s.logout})).then(function(){return e.emit("close")})},i.register=function(e){this._querys.add(e)},i.deregister=function(e){var t=this;this._querys.delete(e),setTimeout(function(){t._querys.size||t.close().catch(d)},0)},i._dispatchCommand=function(e){return e.cmd!==s.data?(this.emit("unhandledmessage",e),t.Promise.resolve()):this._dispatchDataCommand(e)},i._dispatchDataCommand=function(e){var t=e.dataMessage,n=t.ids,r=t.msg;this.emit("message",r.map(function(e){var t=e.data;return JSON.parse(t)}));var i=new c({cmd:s.ack,ackMessage:new l({ids:n})});return this._send(i,!1).catch(d)},r}(t.EventEmitter),g=function(e){return[function(t){return e(),t},function(t){throw e(),t}]},y=function(e){e._liveQueryClients={},e.createLiveQueryClient=function(n){var i;if(void 0!==e._liveQueryClients[n])return t.Promise.resolve(e._liveQueryClients[n]);var o=(i=e._open().then(function(t){var r=new v(e._options.appId,n,t);return t.on("reconnect",function(){return r._open().then(function(){return r.emit("reconnect")},function(e){return r.emit("reconnecterror",e)})}),r._eventemitter.on("beforeclose",function(){delete e._liveQueryClients[r.id]},e),r._eventemitter.on("close",function(){e._deregister(r)},e),r._open().then(function(){return e._liveQueryClients[r.id]=r,e._register(r),r})})).then.apply(i,r(g(function(){e._deregisterPending&&e._deregisterPending(o)})));return e._liveQueryClients[n]=o,e._registerPending&&e._registerPending(o),o}},b=function(e,t){if(!e.installationId||1!==e.service)return!0;var n=t._liveQueryClients[e.installationId];return n?n._dispatchCommand(e).catch(function(e){return console.warn(e)}):console.warn("Unexpected message received without any live client match: %O",e),!1},_={name:"leancloud-realtime-plugin-live-query",onRealtimeCreate:y,beforeCommandDispatch:b};e.LiveQueryPlugin=_,Object.defineProperty(e,"__esModule",{value:!0})})},function(e,t,n){e.exports={default:n(447),__esModule:!0}},function(e,t,n){n(34),n(448),e.exports=n(1).Array.from},function(e,t,n){"use strict";var r=n(22),i=n(4),o=n(28),a=n(118),s=n(119),u=n(60),c=n(193),f=n(88);i(i.S+i.F*!n(125)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,i,l,h=o(e),d="function"==typeof this?this:Array,p=arguments.length,v=p>1?arguments[1]:void 0,m=void 0!==v,g=0,y=f(h);if(m&&(v=r(v,p>2?arguments[2]:void 0,2)),void 0==y||d==Array&&s(y))for(t=u(h.length),n=new d(t);t>g;g++)c(n,g,m?v(h[g],g):h[g]);else for(l=y.call(h),n=new d;!(i=l.next()).done;g++)c(n,g,m?a(l,v,[i.value,g],!0):i.value);return n.length=g,n}})}])});
24//# sourceMappingURL=av-live-query-core-min.js.map
\No newline at end of file