text: (window.webpackJsonp=window.webpackJsonp||[]).push([[0],{109:function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},110:function(t,e,n){var r=n(153);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},111:function(t,e,n){var r=n(271),i=n(411),o=n(97);t.exports=function(t){return o(t)?r(t):i(t)}},117:function(t,e,n){var r=n(416),i=n(417),o=n(418),a=n(419),s=n(420);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},118:function(t,e,n){var r=n(91);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},119:function(t,e,n){var r=n(60)(Object,"create");t.exports=r},120:function(t,e,n){var r=n(434);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},121:function(t,e,n){var r=n(131),i=1/0;t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e}},130:function(t,e,n){var r=n(61),i=n(56),o="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";t.exports=function(t){if(!i(t))return!1;var e=r(t);return e==a||e==s||e==o||e==u}},131:function(t,e,n){function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(61),o=n(62),a="[object Symbol]";t.exports=function(t){return"symbol"==r(t)||o(t)&&i(t)==a}},141:function(t,e,n){(function(e){function n(t){return(n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r="object"==("undefined"===typeof e?"undefined":n(e))&&e&&e.Object===Object&&e;t.exports=r}).call(this,n(25))},1416:function(t,e,n){"use strict";n.r(e);n(682),n(1417),n(1418),n(1423),n(1425),n(1430),n(1435),n(1438),n(1450)},1417:function(t,e,n){"use strict";(function(t,e){function n(t){return(n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r=setTimeout;function i(){}function o(t){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function a(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(i){return void u(e.promise,i)}s(e.promise,r)}else(1===t._state?s:u)(e.promise,t._value)})):t._deferreds.push(e)}function s(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===n(e)||"function"===typeof e)){var r=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"===typeof r)return void l((i=r,a=e,function(){i.apply(a,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(s){u(t,s)}var i,a}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn(function(){t._handled||o._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function h(t,e,n){this.onFulfilled="function"===typeof t?t:null,this.onRejected="function"===typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t(function(t){n||(n=!0,s(e,t))},function(t){n||(n=!0,u(e,t))})}catch(r){if(n)return;n=!0,u(e,r)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(i);return a(this,new h(t,e,n)),n},o.prototype.finally=function(t){var e=this.constructor;return this.then(function(n){return e.resolve(t()).then(function(){return n})},function(n){return e.resolve(t()).then(function(){return e.reject(n)})})},o.all=function(t){return new o(function(e,r){if(!t||"undefined"===typeof t.length)throw new TypeError("Promise.all accepts an array");var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var o=i.length;function a(t,s){try{if(s&&("object"===n(s)||"function"===typeof s)){var u=s.then;if("function"===typeof u)return void u.call(s,function(e){a(t,e)},r)}i[t]=s,0===--o&&e(i)}catch(c){r(c)}}for(var s=0;s<i.length;s++)a(s,i[s])})},o.resolve=function(t){return t&&"object"===n(t)&&t.constructor===o?t:new o(function(e){e(t)})},o.reject=function(t){return new o(function(e,n){n(t)})},o.race=function(t){return new o(function(e,n){for(var r=0,i=t.length;r<i;r++)t[r].then(e,n)})},o._immediateFn="function"===typeof t&&function(e){t(e)}||function(t){r(t,0)},o._unhandledRejectionFn=function(t){"undefined"!==typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var f=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof e)return e;throw new Error("unable to locate global object")}();f.Promise||(f.Promise=o)}).call(this,n(401).setImmediate,n(25))},1418:function(t,e,n){n(1419),t.exports=n(210).Array.find},1419:function(t,e,n){"use strict";var r=n(278),i=n(856)(5),o=!0;"find"in[]&&Array(1).find(function(){o=!1}),r(r.P+r.F*o,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(688)("find")},142:function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(e){}try{return t+""}catch(e){}}return""}},1420:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},1421:function(t,e,n){var r=n(1422);t.exports=function(t,e){return new(r(t))(e)}},1422:function(t,e,n){var r=n(280),i=n(857),o=n(144)("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},1423:function(t,e,n){n(1424),t.exports=n(210).Array.findIndex},1424:function(t,e,n){"use strict";var r=n(278),i=n(856)(6),o="findIndex",a=!0;o in[]&&Array(1)[o](function(){a=!1}),r(r.P+r.F*a,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(688)(o)},1425:function(t,e,n){n(1426),t.exports=n(210).Object.assign},1426:function(t,e,n){var r=n(278);r(r.S+r.F,"Object",{assign:n(1427)})},1427:function(t,e,n){"use strict";var r=n(467),i=n(691),o=n(540),a=n(685),s=n(684),u=Object.assign;t.exports=!u||n(463)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r})?function(t,e){for(var n=a(t),u=arguments.length,c=1,h=i.f,l=o.f;u>c;)for(var f,p=s(arguments[c++]),d=h?r(p).concat(h(p)):r(p),y=d.length,v=0;y>v;)l.call(p,f=d[v++])&&(n[f]=p[f]);return n}:u},1428:function(t,e,n){var r=n(336),i=n(686),o=n(1429);t.exports=function(t){return function(e,n,a){var s,u=r(e),c=i(u.length),h=o(a,c);if(t&&n!=n){for(;c>h;)if((s=u[h++])!=s)return!0}else for(;c>h;h++)if((t||h in u)&&u[h]===n)return t||h||0;return!t&&-1}}},1429:function(t,e,n){var r=n(539),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},1430:function(t,e,n){n(1431),t.exports=n(210).String.startsWith},1431:function(t,e,n){"use strict";var r=n(278),i=n(686),o=n(1432),a="".startsWith;r(r.P+r.F*n(1434)("startsWith"),"String",{startsWith:function(t){var e=o(this,t,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return a?a.call(e,r,n):e.slice(n,n+r.length)===r}})},1432:function(t,e,n){var r=n(1433),i=n(466);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},1433:function(t,e,n){var r=n(280),i=n(538),o=n(144)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},1434:function(t,e,n){var r=n(144)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(i){}}return!0}},1435:function(t,e,n){n(1436),t.exports=n(210).String.repeat},1436:function(t,e,n){var r=n(278);r(r.P,"String",{repeat:n(1437)})},1437:function(t,e,n){"use strict";var r=n(539),i=n(466);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},1438:function(t,e,n){n(1439),n(1446),n(1448),n(1449),t.exports=n(210).Symbol},1439:function(t,e,n){"use strict";var r=n(209),i=n(281),o=n(335),a=n(278),s=n(464),u=n(1440).KEY,c=n(463),h=n(687),l=n(692),f=n(465),p=n(144),d=n(693),y=n(694),v=n(1441),g=n(857),m=n(536),_=n(280),b=n(336),w=n(683),E=n(537),S=n(859),C=n(1444),T=n(1445),I=n(334),N=n(467),O=T.f,A=I.f,x=C.f,P=r.Symbol,k=r.JSON,R=k&&k.stringify,D=p("_hidden"),L=p("toPrimitive"),M={}.propertyIsEnumerable,F=h("symbol-registry"),j=h("symbols"),U=h("op-symbols"),W=Object.prototype,V="function"==typeof P,q=r.QObject,B=!q||!q.prototype||!q.prototype.findChild,H=o&&c(function(){return 7!=S(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=O(W,e);r&&delete W[e],A(t,e,n),r&&t!==W&&A(W,e,r)}:A,K=function(t){var e=j[t]=S(P.prototype);return e._k=t,e},Q=V&&"symbol"==typeof P.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof P},G=function(t,e,n){return t===W&&G(U,e,n),m(t),e=w(e,!0),m(n),i(j,e)?(n.enumerable?(i(t,D)&&t[D][e]&&(t[D][e]=!1),n=S(n,{enumerable:E(0,!1)})):(i(t,D)||A(t,D,E(1,{})),t[D][e]=!0),H(t,e,n)):A(t,e,n)},z=function(t,e){m(t);for(var n,r=v(e=b(e)),i=0,o=r.length;o>i;)G(t,n=r[i++],e[n]);return t},X=function(t){var e=M.call(this,t=w(t,!0));return!(this===W&&i(j,t)&&!i(U,t))&&(!(e||!i(this,t)||!i(j,t)||i(this,D)&&this[D][t])||e)},Y=function(t,e){if(t=b(t),e=w(e,!0),t!==W||!i(j,e)||i(U,e)){var n=O(t,e);return!n||!i(j,e)||i(t,D)&&t[D][e]||(n.enumerable=!0),n}},$=function(t){for(var e,n=x(b(t)),r=[],o=0;n.length>o;)i(j,e=n[o++])||e==D||e==u||r.push(e);return r},J=function(t){for(var e,n=t===W,r=x(n?U:b(t)),o=[],a=0;r.length>a;)!i(j,e=r[a++])||n&&!i(W,e)||o.push(j[e]);return o};V||(s((P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(n){this===W&&e.call(U,n),i(this,D)&&i(this[D],t)&&(this[D][t]=!1),H(this,t,E(1,n))};return o&&B&&H(W,t,{configurable:!0,set:e}),K(t)}).prototype,"toString",function(){return this._k}),T.f=Y,I.f=G,n(860).f=C.f=$,n(540).f=X,n(691).f=J,o&&!n(695)&&s(W,"propertyIsEnumerable",X,!0),d.f=function(t){return K(p(t))}),a(a.G+a.W+a.F*!V,{Symbol:P});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;Z.length>tt;)p(Z[tt++]);for(var et=N(p.store),nt=0;et.length>nt;)y(et[nt++]);a(a.S+a.F*!V,"Symbol",{for:function(t){return i(F,t+="")?F[t]:F[t]=P(t)},keyFor:function(t){if(!Q(t))throw TypeError(t+" is not a symbol!");for(var e in F)if(F[e]===t)return e},useSetter:function(){B=!0},useSimple:function(){B=!1}}),a(a.S+a.F*!V,"Object",{create:function(t,e){return void 0===e?S(t):z(S(t),e)},defineProperty:G,defineProperties:z,getOwnPropertyDescriptor:Y,getOwnPropertyNames:$,getOwnPropertySymbols:J}),k&&a(a.S+a.F*(!V||c(function(){var t=P();return"[null]"!=R([t])||"{}"!=R({a:t})||"{}"!=R(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(_(e)||void 0!==t)&&!Q(t))return g(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Q(e))return e}),r[1]=e,R.apply(k,r)}}),P.prototype[L]||n(279)(P.prototype,L,P.prototype.valueOf),l(P,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},144:function(t,e,n){var r=n(687)("wks"),i=n(465),o=n(209).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},1440:function(t,e,n){var r=n(465)("meta"),i=n(280),o=n(281),a=n(334).f,s=0,u=Object.isExtensible||function(){return!0},c=!n(463)(function(){return u(Object.preventExtensions({}))}),h=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},l=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!u(t))return"F";if(!e)return"E";h(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!u(t))return!0;if(!e)return!1;h(t)}return t[r].w},onFreeze:function(t){return c&&l.NEED&&u(t)&&!o(t,r)&&h(t),t}}},1441:function(t,e,n){var r=n(467),i=n(691),o=n(540);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,s=n(t),u=o.f,c=0;s.length>c;)u.call(t,a=s[c++])&&e.push(a);return e}},1442:function(t,e,n){var r=n(334),i=n(536),o=n(467);t.exports=n(335)?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),s=a.length,u=0;s>u;)r.f(t,n=a[u++],e[n]);return t}},1443:function(t,e,n){var r=n(209).document;t.exports=r&&r.documentElement},1444:function(t,e,n){var r=n(336),i=n(860).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(e){return a.slice()}}(t):i(r(t))}},1445:function(t,e,n){var r=n(540),i=n(537),o=n(336),a=n(683),s=n(281),u=n(853),c=Object.getOwnPropertyDescriptor;e.f=n(335)?c:function(t,e){if(t=o(t),e=a(e,!0),u)try{return c(t,e)}catch(n){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},1446:function(t,e,n){"use strict";var r=n(1447),i={};i[n(144)("toStringTag")]="z",i+""!="[object z]"&&n(464)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},1447:function(t,e,n){var r=n(538),i=n(144)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(n){}}(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},1448:function(t,e,n){n(694)("asyncIterator")},1449:function(t,e,n){n(694)("observable")},1450:function(t,e,n){n(1451),n(1455),t.exports=n(693).f("iterator")},1451:function(t,e,n){"use strict";var r=n(1452)(!0);n(861)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},1452:function(t,e,n){var r=n(539),i=n(466);t.exports=function(t){return function(e,n){var o,a,s=String(i(e)),u=r(n),c=s.length;return u<0||u>=c?t?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):o:t?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},1453:function(t,e,n){"use strict";var r=n(859),i=n(537),o=n(692),a={};n(279)(a,n(144)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},1454:function(t,e,n){var r=n(281),i=n(685),o=n(689)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},1455:function(t,e,n){for(var r=n(1456),i=n(467),o=n(464),a=n(209),s=n(279),u=n(696),c=n(144),h=c("iterator"),l=c("toStringTag"),f=u.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},d=i(p),y=0;y<d.length;y++){var v,g=d[y],m=p[g],_=a[g],b=_&&_.prototype;if(b&&(b[h]||s(b,h,f),b[l]||s(b,l,g),u[g]=f,m))for(v in r)b[v]||o(b,v,r[v],!0)}},1456:function(t,e,n){"use strict";var r=n(688),i=n(1457),o=n(696),a=n(336);t.exports=n(861)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},1457:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},1458:function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.r(e),n.d(e,"__extends",function(){return o}),n.d(e,"__assign",function(){return a}),n.d(e,"__rest",function(){return s}),n.d(e,"__decorate",function(){return u}),n.d(e,"__param",function(){return c}),n.d(e,"__metadata",function(){return h}),n.d(e,"__awaiter",function(){return l}),n.d(e,"__generator",function(){return f}),n.d(e,"__exportStar",function(){return p}),n.d(e,"__values",function(){return d}),n.d(e,"__read",function(){return y}),n.d(e,"__spread",function(){return v}),n.d(e,"__await",function(){return g}),n.d(e,"__asyncGenerator",function(){return m}),n.d(e,"__asyncDelegator",function(){return _}),n.d(e,"__asyncValues",function(){return b}),n.d(e,"__makeTemplateObject",function(){return w}),n.d(e,"__importStar",function(){return E}),n.d(e,"__importDefault",function(){return S});var i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function o(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}function u(t,e,n,i){var o,a=arguments.length,s=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===("undefined"===typeof Reflect?"undefined":r(Reflect))&&"function"===typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(s=(a<3?o(s):a>3?o(e,n,s):o(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s}function c(t,e){return function(n,r){e(n,r,t)}}function h(t,e){if("object"===("undefined"===typeof Reflect?"undefined":r(Reflect))&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(a,s)}u((r=r.apply(t,e||[])).next())})}function f(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function p(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}function d(t){var e="function"===typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function y(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function v(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(y(arguments[e]));return t}function g(t){return this instanceof g?(this.v=t,this):new g(t)}function m(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise(function(n,r){o.push([t,e,n,r])>1||s(t,e)})})}function s(t,e){try{(n=i[t](e)).value instanceof g?Promise.resolve(n.value.v).then(u,c):h(o[0][2],n)}catch(r){h(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function h(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",function(t){throw t}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){t[r]&&(e[r]=function(e){return(n=!n)?{value:g(t[r](e)),done:"return"===r}:i?i(e):e})}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):d(t)}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function E(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function S(t){return t&&t.__esModule?t:{default:t}}},1459:function(t,e,n){"use strict";n.r(e),n.d(e,"setLogLevel",function(){return u}),n.d(e,"Logger",function(){return s}),n.d(e,"LogLevel",function(){return r});var r,i=[];!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(r||(r={}));var o=r.INFO,a=function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(e<t.logLevel)){var o=(new Date).toISOString();switch(e){case r.DEBUG:case r.VERBOSE:console.log.apply(console,["["+o+"]  "+t.name+":"].concat(n));break;case r.INFO:console.info.apply(console,["["+o+"]  "+t.name+":"].concat(n));break;case r.WARN:console.warn.apply(console,["["+o+"]  "+t.name+":"].concat(n));break;case r.ERROR:console.error.apply(console,["["+o+"]  "+t.name+":"].concat(n));break;default:throw new Error("Attempted to log a message with an invalid logType (value: "+e+")")}}},s=function(){function t(t){this.name=t,this._logLevel=o,this._logHandler=a,i.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in r))throw new TypeError("Invalid value assigned to `logLevel`");this._logLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"logHandler",{get:function(){return this._logHandler},set:function(t){if("function"!==typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t},enumerable:!0,configurable:!0}),t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._logHandler.apply(this,[this,r.DEBUG].concat(t))},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._logHandler.apply(this,[this,r.VERBOSE].concat(t))},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._logHandler.apply(this,[this,r.INFO].concat(t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._logHandler.apply(this,[this,r.WARN].concat(t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._logHandler.apply(this,[this,r.ERROR].concat(t))},t}();function u(t){i.forEach(function(e){e.logLevel=t})}},1460:function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.r(e),n.d(e,"__extends",function(){return o}),n.d(e,"__assign",function(){return a}),n.d(e,"__rest",function(){return s}),n.d(e,"__decorate",function(){return u}),n.d(e,"__param",function(){return c}),n.d(e,"__metadata",function(){return h}),n.d(e,"__awaiter",function(){return l}),n.d(e,"__generator",function(){return f}),n.d(e,"__exportStar",function(){return p}),n.d(e,"__values",function(){return d}),n.d(e,"__read",function(){return y}),n.d(e,"__spread",function(){return v}),n.d(e,"__await",function(){return g}),n.d(e,"__asyncGenerator",function(){return m}),n.d(e,"__asyncDelegator",function(){return _}),n.d(e,"__asyncValues",function(){return b}),n.d(e,"__makeTemplateObject",function(){return w}),n.d(e,"__importStar",function(){return E}),n.d(e,"__importDefault",function(){return S});var i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function o(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}function u(t,e,n,i){var o,a=arguments.length,s=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===("undefined"===typeof Reflect?"undefined":r(Reflect))&&"function"===typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(s=(a<3?o(s):a>3?o(e,n,s):o(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s}function c(t,e){return function(n,r){e(n,r,t)}}function h(t,e){if("object"===("undefined"===typeof Reflect?"undefined":r(Reflect))&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(a,s)}u((r=r.apply(t,e||[])).next())})}function f(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function p(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}function d(t){var e="function"===typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function y(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function v(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(y(arguments[e]));return t}function g(t){return this instanceof g?(this.v=t,this):new g(t)}function m(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise(function(n,r){o.push([t,e,n,r])>1||s(t,e)})})}function s(t,e){try{(n=i[t](e)).value instanceof g?Promise.resolve(n.value.v).then(u,c):h(o[0][2],n)}catch(r){h(o[0][3],r)}var n}function u(t){s("next",t)}function c(t){s("throw",t)}function h(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",function(t){throw t}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){t[r]&&(e[r]=function(e){return(n=!n)?{value:g(t[r](e)),done:"return"===r}:i?i(e):e})}}function b(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):d(t)}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function E(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function S(t){return t&&t.__esModule?t:{default:t}}},152:function(t,e,n){var r=n(110),i=n(91),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];o.call(t,e)&&i(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},153:function(t,e,n){var r=n(60),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();t.exports=i},154:function(t,e,n){var r=n(408),i=n(62),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return i(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},155:function(t,e){var n=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}},156:function(t,e,n){var r=n(60)(n(40),"Map");t.exports=r},157:function(t,e,n){var r=n(426),i=n(433),o=n(435),a=n(436),s=n(437);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},158:function(t,e,n){function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(36),o=n(131),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=function(t,e){if(i(t))return!1;var n=r(t);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||(s.test(t)||!a.test(t)||null!=e&&t in Object(e))}},159:function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},180:function(t,e,n){(function(t){function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(40),o=n(409),a="object"==r(e)&&e&&!e.nodeType&&e,s=a&&"object"==r(t)&&t&&!t.nodeType&&t,u=s&&s.exports===a?i.Buffer:void 0,c=(u?u.isBuffer:void 0)||o;t.exports=c}).call(this,n(109)(t))},181:function(t,e){function n(t){return(n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r=9007199254740991,i=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var o=n(t);return!!(e=null==e?r:e)&&("number"==o||"symbol"!=o&&i.test(t))&&t>-1&&t%1==0&&t<e}},182:function(t,e){t.exports=function(t){return function(e){return t(e)}}},183:function(t,e,n){var r=n(117),i=n(421),o=n(422),a=n(423),s=n(424),u=n(425);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,t.exports=c},184:function(t,e,n){var r=n(331);t.exports=function(t){return null==t?"":r(t)}},185:function(t,e){t.exports=function(t){return t}},198:function(t,e,n){var r=n(130),i=n(201),o=n(56),a=n(142),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,h=u.toString,l=c.hasOwnProperty,f=RegExp("^"+h.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?f:s).test(a(t))}},199:function(t,e,n){var r=n(70),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(u){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},200:function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},201:function(t,e,n){var r,i=n(202),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},202:function(t,e,n){var r=n(40)["__core-js_shared__"];t.exports=r},203:function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},204:function(t,e,n){var r=n(410),i=n(182),o=n(272),a=o&&o.isTypedArray,s=a?i(a):r;t.exports=s},205:function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},206:function(t,e,n){var r=n(444),i=n(156),o=n(445),a=n(328),s=n(446),u=n(61),c=n(142),h=c(r),l=c(i),f=c(o),p=c(a),d=c(s),y=u;(r&&"[object DataView]"!=y(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=y(new i)||o&&"[object Promise]"!=y(o.resolve())||a&&"[object Set]"!=y(new a)||s&&"[object WeakMap]"!=y(new s))&&(y=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case h:return"[object DataView]";case l:return"[object Map]";case f:return"[object Promise]";case p:return"[object Set]";case d:return"[object WeakMap]"}return e}),t.exports=y},209:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},210:function(t,e){var n=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=n)},215:function(t,e,n){var r=n(61),i=n(36),o=n(62),a="[object String]";t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&r(t)==a}},232:function(t,e,n){function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(414),o=n(448),a=n(185),s=n(36),u=n(453);t.exports=function(t){return"function"==typeof t?t:null==t?a:"object"==r(t)?s(t)?o(t[0],t[1]):i(t):u(t)}},233:function(t,e,n){var r=n(438),i=n(62);t.exports=function t(e,n,o,a,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!==e&&n!==n:r(e,n,o,a,t,s))}},234:function(t,e,n){var r=n(235),i=n(441),o=n(236),a=1,s=2;t.exports=function(t,e,n,u,c,h){var l=n&a,f=t.length,p=e.length;if(f!=p&&!(l&&p>f))return!1;var d=h.get(t);if(d&&h.get(e))return d==e;var y=-1,v=!0,g=n&s?new r:void 0;for(h.set(t,e),h.set(e,t);++y<f;){var m=t[y],_=e[y];if(u)var b=l?u(_,m,y,e,t,h):u(m,_,y,t,e,h);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(e,function(t,e){if(!o(g,e)&&(m===t||c(m,t,n,u,h)))return g.push(e)})){v=!1;break}}else if(m!==_&&!c(m,_,n,u,h)){v=!1;break}}return h.delete(t),h.delete(e),v}},235:function(t,e,n){var r=n(157),i=n(439),o=n(440);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,t.exports=a},236:function(t,e){t.exports=function(t,e){return t.has(e)}},237:function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}},238:function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},239:function(t,e,n){var r=n(56);t.exports=function(t){return t===t&&!r(t)}},240:function(t,e){t.exports=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}},241:function(t,e,n){var r=n(242),i=n(121);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},242:function(t,e,n){var r=n(36),i=n(158),o=n(449),a=n(184);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(a(t))}},25:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},268:function(t,e){(function(e){t.exports=e}).call(this,{})},269:function(t,e){t.exports=function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:void 0;n(a,t[r],s)}return a}},270:function(t,e,n){var r=n(322),i=n(111);t.exports=function(t,e){return t&&r(t,e,i)}},271:function(t,e,n){var r=n(407),i=n(154),o=n(36),a=n(180),s=n(181),u=n(204),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=o(t),h=!n&&i(t),l=!n&&!h&&a(t),f=!n&&!h&&!l&&u(t),p=n||h||l||f,d=p?r(t.length,String):[],y=d.length;for(var v in t)!e&&!c.call(t,v)||p&&("length"==v||l&&("offset"==v||"parent"==v)||f&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,y))||d.push(v);return d}},272:function(t,e,n){(function(t){function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(141),o="object"==r(e)&&e&&!e.nodeType&&e,a=o&&"object"==r(t)&&t&&!t.nodeType&&t,s=a&&a.exports===o&&i.process,u=function(){try{var t=a&&a.require&&a.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(e){}}();t.exports=u}).call(this,n(109)(t))},273:function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},274:function(t,e,n){var r=n(40).Uint8Array;t.exports=r},275:function(t,e,n){var r=n(326),i=n(327),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),function(e){return o.call(t,e)}))}:i;t.exports=s},278:function(t,e,n){var r=n(209),i=n(210),o=n(279),a=n(464),s=n(855),u=function(t,e,n){var c,h,l,f,p=t&u.F,d=t&u.G,y=t&u.S,v=t&u.P,g=t&u.B,m=d?r:y?r[e]||(r[e]={}):(r[e]||{}).prototype,_=d?i:i[e]||(i[e]={}),b=_.prototype||(_.prototype={});for(c in d&&(n=e),n)l=((h=!p&&m&&void 0!==m[c])?m:n)[c],f=g&&h?s(l,r):v&&"function"==typeof l?s(Function.call,l):l,m&&a(m,c,l,t&u.U),_[c]!=l&&o(_,c,f),v&&b[c]!=l&&(b[c]=l)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},279:function(t,e,n){var r=n(334),i=n(537);t.exports=n(335)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},280:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},281:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},295:function(t,e){t.exports=function(t){return null==t}},296:function(t,e,n){var r=n(61),i=n(62),o="[object Number]";t.exports=function(t){return"number"==typeof t||i(t)&&r(t)==o}},297:function(t,e,n){var r=n(531),i=n(321),o=n(232),a=n(666),s=n(36);t.exports=function(t,e,n){var u=s(t)?r:a,c=arguments.length<3;return u(t,o(e,4),n,c,i)}},32:function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(862),o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a="[DEFAULT]",s=[],u=function(){function t(t,e,n){this.firebase_=n,this.isDeleted_=!1,this.services_={},this.name_=e.name,this._automaticDataCollectionEnabled=e.automaticDataCollectionEnabled||!1,this.options_=i.deepCopy(t),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(t){s.push(t),setTimeout(function(){return t(null)},0)},removeAuthTokenListener:function(t){s=s.filter(function(e){return e!==t})}}}return Object.defineProperty(t.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this._automaticDataCollectionEnabled},set:function(t){this.checkDestroyed_(),this._automaticDataCollectionEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),t.prototype.delete=function(){var t=this;return new Promise(function(e){t.checkDestroyed_(),e()}).then(function(){t.firebase_.INTERNAL.removeApp(t.name_);var e=[];return Object.keys(t.services_).forEach(function(n){Object.keys(t.services_[n]).forEach(function(r){e.push(t.services_[n][r])})}),Promise.all(e.map(function(t){return t.INTERNAL.delete()}))}).then(function(){t.isDeleted_=!0,t.services_={}})},t.prototype._getService=function(t,e){if(void 0===e&&(e=a),this.checkDestroyed_(),this.services_[t]||(this.services_[t]={}),!this.services_[t][e]){var n=e!==a?e:void 0,r=this.firebase_.INTERNAL.factories[t](this,this.extendApp.bind(this),n);this.services_[t][e]=r}return this.services_[t][e]},t.prototype.extendApp=function(t){var e=this;i.deepExtend(this,t),t.INTERNAL&&t.INTERNAL.addAuthTokenListener&&(s.forEach(function(t){e.INTERNAL.addAuthTokenListener(t)}),s=[])},t.prototype.checkDestroyed_=function(){this.isDeleted_&&c("app-deleted",{name:this.name_})},t}();function c(t,e){throw h.create(t,e)}u.prototype.name&&u.prototype.options||u.prototype.delete||console.log("dc");var h=new i.ErrorFactory("app","Firebase",{"no-app":"No Firebase App '{$name}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$name}","duplicate-app":"Firebase App named '{$name}' already exists","app-deleted":"Firebase App named '{$name}' already deleted","duplicate-service":"Firebase service named '{$name}' already registered","sa-not-supported":"Initializing the Firebase SDK with a service account is only allowed in a Node.js environment. On client devices, you should instead initialize the SDK with an api key and auth domain","invalid-app-argument":"firebase.{$name}() takes either no argument or a Firebase App instance."}),l=function t(){var e={},n={},s={},h={__esModule:!0,initializeApp:function(t,n){void 0===n&&(n={}),"object"===r(n)&&null!==n||(n={name:n});var i=n;void 0===i.name&&(i.name=a);var s=i.name;"string"===typeof s&&s||c("bad-app-name",{name:s+""}),o(e,s)&&c("duplicate-app",{name:s});var l=new u(t,i,h);return e[s]=l,p(l,"create"),l},app:l,apps:null,Promise:Promise,SDK_VERSION:"5.7.3",INTERNAL:{registerService:function(t,e,r,o,a){n[t]&&c("duplicate-service",{name:t}),n[t]=e,o&&(s[t]=o,f().forEach(function(t){o("create",t)}));var p=function(e){return void 0===e&&(e=l()),"function"!==typeof e[t]&&c("invalid-app-argument",{name:t}),e[t]()};return void 0!==r&&i.deepExtend(p,r),h[t]=p,u.prototype[t]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this._getService.bind(this,t);return r.apply(this,a?e:[])},p},createFirebaseNamespace:t,extendNamespace:function(t){i.deepExtend(h,t)},createSubscribe:i.createSubscribe,ErrorFactory:i.ErrorFactory,removeApp:function(t){p(e[t],"delete"),delete e[t]},factories:n,useAsService:d,Promise:Promise,deepExtend:i.deepExtend}};function l(t){return o(e,t=t||a)||c("no-app",{name:t}),e[t]}function f(){return Object.keys(e).map(function(t){return e[t]})}function p(t,e){Object.keys(n).forEach(function(n){var r=d(t,n);null!==r&&s[r]&&s[r](e,t)})}function d(t,e){if("serverAuth"===e)return null;var n=e;return t.options,n}return i.patchProperty(h,"default",h),Object.defineProperty(h,"apps",{get:f}),i.patchProperty(l,"App",u),h}();e.firebase=l,e.default=l},321:function(t,e,n){var r=n(270),i=n(413)(r);t.exports=i},322:function(t,e,n){var r=n(406)();t.exports=r},323:function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}},324:function(t,e,n){var r=n(325),i=n(275),o=n(111);t.exports=function(t){return r(t,o,i)}},325:function(t,e,n){var r=n(238),i=n(36);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},326:function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}},327:function(t,e){t.exports=function(){return[]}},328:function(t,e,n){var r=n(60)(n(40),"Set");t.exports=r},329:function(t,e,n){var r=n(241);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},330:function(t,e,n){var r=n(157),i="Expected a function";function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(i);var n=function n(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},331:function(t,e,n){var r=n(70),i=n(159),o=n(36),a=n(131),s=1/0,u=r?r.prototype:void 0,c=u?u.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return c?c.call(e):"";var n=e+"";return"0"==n&&1/e==-s?"-0":n}},332:function(t,e,n){var r=n(242),i=n(154),o=n(36),a=n(181),s=n(155),u=n(121);t.exports=function(t,e,n){for(var c=-1,h=(e=r(e,t)).length,l=!1;++c<h;){var f=u(e[c]);if(!(l=null!=t&&n(t,f)))break;t=t[f]}return l||++c!=h?l:!!(h=null==t?0:t.length)&&s(h)&&a(f,h)&&(o(t)||i(t))}},334:function(t,e,n){var r=n(536),i=n(853),o=n(683),a=Object.defineProperty;e.f=n(335)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},335:function(t,e,n){t.exports=!n(463)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},336:function(t,e,n){var r=n(684),i=n(466);t.exports=function(t){return r(i(t))}},36:function(t,e){var n=Array.isArray;t.exports=n},40:function(t,e,n){function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(141),o="object"==("undefined"===typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,a=i||o||Function("return this")();t.exports=a},401:function(t,e,n){(function(t){var r="undefined"!==typeof t&&t||"undefined"!==typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(826),e.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(25))},406:function(t,e){t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++i];if(!1===n(o[u],u,o))break}return e}}},407:function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},408:function(t,e,n){var r=n(61),i=n(62),o="[object Arguments]";t.exports=function(t){return i(t)&&r(t)==o}},409:function(t,e){t.exports=function(){return!1}},410:function(t,e,n){var r=n(61),i=n(155),o=n(62),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!a[r(t)]}},411:function(t,e,n){var r=n(205),i=n(412),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},412:function(t,e,n){var r=n(273)(Object.keys,Object);t.exports=r},413:function(t,e,n){var r=n(97);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,a=e?o:-1,s=Object(n);(e?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},414:function(t,e,n){var r=n(415),i=n(447),o=n(240);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},415:function(t,e,n){var r=n(183),i=n(233),o=1,a=2;t.exports=function(t,e,n,s){var u=n.length,c=u,h=!s;if(null==t)return!c;for(t=Object(t);u--;){var l=n[u];if(h&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++u<c;){var f=(l=n[u])[0],p=t[f],d=l[1];if(h&&l[2]){if(void 0===p&&!(f in t))return!1}else{var y=new r;if(s)var v=s(p,d,f,t,e,y);if(!(void 0===v?i(d,p,o|a,s,y):v))return!1}}return!0}},416:function(t,e){t.exports=function(){this.__data__=[],this.size=0}},417:function(t,e,n){var r=n(118),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},418:function(t,e,n){var r=n(118);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},419:function(t,e,n){var r=n(118);t.exports=function(t){return r(this.__data__,t)>-1}},420:function(t,e,n){var r=n(118);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},421:function(t,e,n){var r=n(117);t.exports=function(){this.__data__=new r,this.size=0}},422:function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},423:function(t,e){t.exports=function(t){return this.__data__.get(t)}},424:function(t,e){t.exports=function(t){return this.__data__.has(t)}},425:function(t,e,n){var r=n(117),i=n(156),o=n(157),a=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<a-1)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(t,e),this.size=n.size,this}},426:function(t,e,n){var r=n(427),i=n(117),o=n(156);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},427:function(t,e,n){var r=n(428),i=n(429),o=n(430),a=n(431),s=n(432);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,t.exports=u},428:function(t,e,n){var r=n(119);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},429:function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},430:function(t,e,n){var r=n(119),i="__lodash_hash_undefined__",o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return n===i?void 0:n}return o.call(e,t)?e[t]:void 0}},431:function(t,e,n){var r=n(119),i=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:i.call(e,t)}},432:function(t,e,n){var r=n(119),i="__lodash_hash_undefined__";t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?i:e,this}},433:function(t,e,n){var r=n(120);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},434:function(t,e){function n(t){return(n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){var e=n(t);return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},435:function(t,e,n){var r=n(120);t.exports=function(t){return r(this,t).get(t)}},436:function(t,e,n){var r=n(120);t.exports=function(t){return r(this,t).has(t)}},437:function(t,e,n){var r=n(120);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},438:function(t,e,n){var r=n(183),i=n(234),o=n(442),a=n(443),s=n(206),u=n(36),c=n(180),h=n(204),l=1,f="[object Arguments]",p="[object Array]",d="[object Object]",y=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,v,g,m){var _=u(t),b=u(e),w=_?p:s(t),E=b?p:s(e),S=(w=w==f?d:w)==d,C=(E=E==f?d:E)==d,T=w==E;if(T&&c(t)){if(!c(e))return!1;_=!0,S=!1}if(T&&!S)return m||(m=new r),_||h(t)?i(t,e,n,v,g,m):o(t,e,w,n,v,g,m);if(!(n&l)){var I=S&&y.call(t,"__wrapped__"),N=C&&y.call(e,"__wrapped__");if(I||N){var O=I?t.value():t,A=N?e.value():e;return m||(m=new r),g(O,A,n,v,m)}}return!!T&&(m||(m=new r),a(t,e,n,v,g,m))}},439:function(t,e){var n="__lodash_hash_undefined__";t.exports=function(t){return this.__data__.set(t,n),this}},440:function(t,e){t.exports=function(t){return this.__data__.has(t)}},441:function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},442:function(t,e,n){var r=n(70),i=n(274),o=n(91),a=n(234),s=n(323),u=n(237),c=1,h=2,l="[object Boolean]",f="[object Date]",p="[object Error]",d="[object Map]",y="[object Number]",v="[object RegExp]",g="[object Set]",m="[object String]",_="[object Symbol]",b="[object ArrayBuffer]",w="[object DataView]",E=r?r.prototype:void 0,S=E?E.valueOf:void 0;t.exports=function(t,e,n,r,E,C,T){switch(n){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case b:return!(t.byteLength!=e.byteLength||!C(new i(t),new i(e)));case l:case f:case y:return o(+t,+e);case p:return t.name==e.name&&t.message==e.message;case v:case m:return t==e+"";case d:var I=s;case g:var N=r&c;if(I||(I=u),t.size!=e.size&&!N)return!1;var O=T.get(t);if(O)return O==e;r|=h,T.set(t,e);var A=a(I(t),I(e),r,E,C,T);return T.delete(t),A;case _:if(S)return S.call(t)==S.call(e)}return!1}},443:function(t,e,n){var r=n(324),i=1,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,a,s,u){var c=n&i,h=r(t),l=h.length;if(l!=r(e).length&&!c)return!1;for(var f=l;f--;){var p=h[f];if(!(c?p in e:o.call(e,p)))return!1}var d=u.get(t);if(d&&u.get(e))return d==e;var y=!0;u.set(t,e),u.set(e,t);for(var v=c;++f<l;){var g=t[p=h[f]],m=e[p];if(a)var _=c?a(m,g,p,e,t,u):a(g,m,p,t,e,u);if(!(void 0===_?g===m||s(g,m,n,a,u):_)){y=!1;break}v||(v="constructor"==p)}if(y&&!v){var b=t.constructor,w=e.constructor;b!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(y=!1)}return u.delete(t),u.delete(e),y}},444:function(t,e,n){var r=n(60)(n(40),"DataView");t.exports=r},445:function(t,e,n){var r=n(60)(n(40),"Promise");t.exports=r},446:function(t,e,n){var r=n(60)(n(40),"WeakMap");t.exports=r},447:function(t,e,n){var r=n(239),i=n(111);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],a=t[o];e[n]=[o,a,r(a)]}return e}},448:function(t,e,n){var r=n(233),i=n(329),o=n(451),a=n(158),s=n(239),u=n(240),c=n(121),h=1,l=2;t.exports=function(t,e){return a(t)&&s(e)?u(c(t),e):function(n){var a=i(n,t);return void 0===a&&a===e?o(n,t):r(e,a,h|l)}}},449:function(t,e,n){var r=n(450),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)}),e});t.exports=a},450:function(t,e,n){var r=n(330),i=500;t.exports=function(t){var e=r(t,function(t){return n.size===i&&n.clear(),t}),n=e.cache;return e}},451:function(t,e,n){var r=n(452),i=n(332);t.exports=function(t,e){return null!=t&&i(t,e,r)}},452:function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},453:function(t,e,n){var r=n(454),i=n(455),o=n(158),a=n(121);t.exports=function(t){return o(t)?r(a(t)):i(t)}},454:function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},455:function(t,e,n){var r=n(241);t.exports=function(t){return function(e){return r(e,t)}}},463:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},464:function(t,e,n){var r=n(209),i=n(279),o=n(281),a=n(465)("src"),s=Function.toString,u=(""+s).split("toString");n(210).inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(c&&(o(n,a)||i(n,a,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:s?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},465:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},466:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},467:function(t,e,n){var r=n(858),i=n(690);t.exports=Object.keys||function(t){return r(t,i)}},531:function(t,e){t.exports=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}},536:function(t,e,n){var r=n(280);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},537:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},538:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},539:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},540:function(t,e){e.f={}.propertyIsEnumerable},56:function(t,e){function n(t){return(n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){var e=n(t);return null!=t&&("object"==e||"function"==e)}},57:function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"===typeof btoa){var i=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[n].concat(o).concat([i]).join("\n")}var a;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,n){"string"===typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];null!=o&&(r[o]=!0)}for(i=0;i<t.length;i++){var a=t[i];null!=a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},60:function(t,e,n){var r=n(198),i=n(203);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},61:function(t,e,n){var r=n(70),i=n(199),o=n(200),a="[object Null]",s="[object Undefined]",u=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?s:a:u&&u in Object(t)?i(t):o(t)}},62:function(t,e){function n(t){return(n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return null!=t&&"object"==n(t)}},63:function(t,e,n){"use strict";var r,i={},o=function(){return"undefined"===typeof r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var t={};return function(e){if("undefined"===typeof t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(r){n=null}t[e]=n}return t[e]}}();function s(t,e){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i],a=e.base?o[0]+e.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};r[a]?r[a].parts.push(s):n.push(r[a]={id:a,parts:[s]})}return n}function u(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=i[r.id],a=0;if(o){for(o.refs++;a<o.parts.length;a++)o.parts[a](r.parts[a]);for(;a<r.parts.length;a++)o.parts.push(y(r.parts[a],e))}else{for(var s=[];a<r.parts.length;a++)s.push(y(r.parts[a],e));i[r.id]={id:r.id,refs:1,parts:s}}}}function c(t){var e=document.createElement("style");if("undefined"===typeof t.attributes.nonce){var r=n.nc;r&&(t.attributes.nonce=r)}if(Object.keys(t.attributes).forEach(function(n){e.setAttribute(n,t.attributes[n])}),"function"===typeof t.insert)t.insert(e);else{var i=a(t.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(e)}return e}var h,l=(h=[],function(t,e){return h[t]=e,h.filter(Boolean).join("\n")});function f(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=l(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}var p=null,d=0;function y(t,e){var n,r,i;if(e.singleton){var o=d++;n=p||(p=c(e)),r=f.bind(null,n,o,!1),i=f.bind(null,n,o,!0)}else n=c(e),r=function(t,e,n){var r=n.css,i=n.media,o=n.sourceMap;if(i&&t.setAttribute("media",i),o&&btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).attributes="object"===typeof e.attributes?e.attributes:{},e.singleton||"boolean"===typeof e.singleton||(e.singleton=o());var n=s(t,e);return u(n,e),function(t){for(var r=[],o=0;o<n.length;o++){var a=n[o],c=i[a.id];c&&(c.refs--,r.push(c))}t&&u(s(t,e),e);for(var h=0;h<r.length;h++){var l=r[h];if(0===l.refs){for(var f=0;f<l.parts.length;f++)l.parts[f]();delete i[l.id]}}}}},666:function(t,e){t.exports=function(t,e,n,r,i){return i(t,function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)}),n}},682:function(t,e){!function(t){"use strict";if(!t.fetch){var e={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(e.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=function(t){return t&&DataView.prototype.isPrototypeOf(t)},i=ArrayBuffer.isView||function(t){return t&&n.indexOf(Object.prototype.toString.call(t))>-1};h.prototype.append=function(t,e){t=s(t),e=u(e);var n=this.map[t];this.map[t]=n?n+","+e:e},h.prototype.delete=function(t){delete this.map[s(t)]},h.prototype.get=function(t){return t=s(t),this.has(t)?this.map[t]:null},h.prototype.has=function(t){return this.map.hasOwnProperty(s(t))},h.prototype.set=function(t,e){this.map[s(t)]=u(e)},h.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},h.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),c(t)},h.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),c(t)},h.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),c(t)},e.iterable&&(h.prototype[Symbol.iterator]=h.prototype.entries);var o=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},y.call(v.prototype),y.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var a=[301,302,303,307,308];m.redirect=function(t,e){if(-1===a.indexOf(e))throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})},t.Headers=h,t.Request=v,t.Response=m,t.fetch=function(t,n){return new Promise(function(r,i){var o=new v(t,n),a=new XMLHttpRequest;a.onload=function(){var t,e,n={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new h,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}}),e)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;r(new m(i,n))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&e.blob&&(a.responseType="blob"),o.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),a.send("undefined"===typeof o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}function s(t){if("string"!==typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function u(t){return"string"!==typeof t&&(t=String(t)),t}function c(t){var n={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return e.iterable&&(n[Symbol.iterator]=function(){return n}),n}function h(t){this.map={},t instanceof h?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function l(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function p(t){var e=new FileReader,n=f(e);return e.readAsArrayBuffer(t),n}function d(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"===typeof t)this._bodyText=t;else if(e.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(e.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(e.arrayBuffer&&e.blob&&r(t))this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!e.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!i(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=d(t)}else this._bodyText="";this.headers.get("content-type")||("string"===typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.blob&&(this.blob=function(){var t=l(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var t,e,n,r=l(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=f(e),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},e.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}function v(t,e){var n,r,i=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new h(t.headers)),this.method=t.method,this.mode=t.mode,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new h(e.headers)),this.method=(n=e.method||this.method||"GET",r=n.toUpperCase(),o.indexOf(r)>-1?r:n),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function g(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function m(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new h(e.headers),this.url=e.url||"",this._initBody(t)}}("undefined"!==typeof self?self:this)},683:function(t,e,n){var r=n(280);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},684:function(t,e,n){var r=n(538);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},685:function(t,e,n){var r=n(466);t.exports=function(t){return Object(r(t))}},686:function(t,e,n){var r=n(539),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},687:function(t,e,n){var r=n(209),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},688:function(t,e,n){var r=n(144)("unscopables"),i=Array.prototype;void 0==i[r]&&n(279)(i,r,{}),t.exports=function(t){i[r][t]=!0}},689:function(t,e,n){var r=n(687)("keys"),i=n(465);t.exports=function(t){return r[t]||(r[t]=i(t))}},690:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},691:function(t,e){e.f=Object.getOwnPropertySymbols},692:function(t,e,n){var r=n(334).f,i=n(281),o=n(144)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},693:function(t,e,n){e.f=n(144)},694:function(t,e,n){var r=n(209),i=n(210),o=n(695),a=n(693),s=n(334).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},695:function(t,e){t.exports=!1},696:function(t,e){t.exports={}},70:function(t,e,n){var r=n(40).Symbol;t.exports=r},74:function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n(1416);var i,o=(i=n(32))&&"object"===r(i)&&"default"in i?i.default:i;t.exports=o},77:function(t,e,n){var r=n(152),i=n(269);t.exports=function(t,e){return i(t||[],e||[],r)}},782:function(t,e,n){(function(t,r){var i;function o(t){return(o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}(function(){"use strict";var a={function:!0,object:!0},s=a["undefined"===typeof window?"undefined":o(window)]&&window||this,u=a[o(e)]&&e,c=a[o(t)]&&t&&!t.nodeType&&t,h=u&&c&&"object"==("undefined"===typeof r?"undefined":o(r))&&r;!h||h.global!==h&&h.window!==h&&h.self!==h||(s=h);var l=Math.pow(2,53)-1,f=/\bOpera/,p=Object.prototype,d=p.hasOwnProperty,y=p.toString;function v(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function g(t){return t=E(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:v(t)}function m(t,e){for(var n in t)d.call(t,n)&&e(t[n],n,t)}function _(t){return null==t?v(t):y.call(t).slice(8,-1)}function b(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function w(t,e){var n=null;return function(t,e){var n=-1,r=t?t.length:0;if("number"==typeof r&&r>-1&&r<=l)for(;++n<r;)e(t[n],n,t);else m(t,e)}(t,function(r,i){n=e(n,r,i,t)}),n}function E(t){return String(t).replace(/^ +| +$/g,"")}var S=function t(e){var n=s,r=e&&"object"==o(e)&&"String"!=_(e);r&&(n=e,e=null);var i=n.navigator||{},a=i.userAgent||"";e||(e=a);var u,c,h,l,p,d=r?!!i.likeChrome:/\bChrome\b/.test(e)&&!/internal|\n/i.test(y.toString()),v=r?"Object":"ScriptBridgingProxyObject",S=r?"Object":"Environment",C=r&&n.java?"JavaPackage":_(n.java),T=r?"Object":"RuntimeObject",I=/\bJava/.test(C)&&n.java,N=I&&_(n.environment)==S,O=I?"a":"\u03b1",A=I?"b":"\u03b2",x=n.document||{},P=n.operamini||n.opera,k=f.test(k=r&&P?P["[[Class]]"]:_(P))?k:P=null,R=e,D=[],L=null,M=e==a,F=M&&P&&"function"==typeof P.version&&P.version(),j=w([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],function(t,n){return t||RegExp("\\b"+(n.pattern||b(n))+"\\b","i").exec(e)&&(n.label||n)}),U=function(t){return w(t,function(t,n){return t||RegExp("\\b"+(n.pattern||b(n))+"\\b","i").exec(e)&&(n.label||n)})}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"Edge"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Waterfox","WebPositive","Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chrome",{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),W=B([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),V=function(t){return w(t,function(t,n,r){return t||(n[W]||n[/^[a-z]+(?: +[a-z]+\b)*/i.exec(W)]||RegExp("\\b"+b(r)+"(?:\\b|\\w*\\d)","i").exec(e))&&r})}({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1}}),q=function(t){return w(t,function(t,n){var r=n.pattern||b(n);return!t&&(t=RegExp("\\b"+r+"(?:/[\\d.]+|[ \\w.]*)","i").exec(e))&&(t=function(t,e,n){var r={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return e&&n&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(r=r[/[\d.]+$/.exec(t)])&&(t="Windows "+r),t=String(t),e&&n&&(t=t.replace(RegExp(e,"i"),n)),t=g(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(t,r,n.label||n)),t})}(["Windows Phone","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function B(t){return w(t,function(t,n){var r=n.pattern||b(n);return!t&&(t=RegExp("\\b"+r+" *\\d+[.\\w_]*","i").exec(e)||RegExp("\\b"+r+" *\\w+-[\\w]*","i").exec(e)||RegExp("\\b"+r+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(e))&&((t=String(n.label&&!RegExp(r,"i").test(n.label)?n.label:t).split("/"))[1]&&!/[\d.]+/.test(t[0])&&(t[0]+=" "+t[1]),n=n.label||n,t=g(t[0].replace(RegExp(r,"i"),n).replace(RegExp("; *(?:"+n+"[_-])?","i")," ").replace(RegExp("("+n+")[-_.]?(\\w)","i"),"$1 $2"))),t})}if(j&&(j=[j]),V&&!W&&(W=B([V])),(u=/\bGoogle TV\b/.exec(W))&&(W=u[0]),/\bSimulator\b/i.test(e)&&(W=(W?W+" ":"")+"Simulator"),"Opera Mini"==U&&/\bOPiOS\b/.test(e)&&D.push("running in Turbo/Uncompressed mode"),"IE"==U&&/\blike iPhone OS\b/.test(e)?(V=(u=t(e.replace(/like iPhone OS/,""))).manufacturer,W=u.product):/^iP/.test(W)?(U||(U="Safari"),q="iOS"+((u=/ OS ([\d_]+)/i.exec(e))?" "+u[1].replace(/_/g,"."):"")):"Konqueror"!=U||/buntu/i.test(q)?V&&"Google"!=V&&(/Chrome/.test(U)&&!/\bMobile Safari\b/i.test(e)||/\bVita\b/.test(W))||/\bAndroid\b/.test(q)&&/^Chrome/.test(U)&&/\bVersion\//i.test(e)?(U="Android Browser",q=/\bAndroid\b/.test(q)?q:"Android"):"Silk"==U?(/\bMobi/i.test(e)||(q="Android",D.unshift("desktop mode")),/Accelerated *= *true/i.test(e)&&D.unshift("accelerated")):"PaleMoon"==U&&(u=/\bFirefox\/([\d.]+)\b/.exec(e))?D.push("identifying as Firefox "+u[1]):"Firefox"==U&&(u=/\b(Mobile|Tablet|TV)\b/i.exec(e))?(q||(q="Firefox OS"),W||(W=u[1])):!U||(u=!/\bMinefield\b/i.test(e)&&/\b(?:Firefox|Safari)\b/.exec(U))?(U&&!W&&/[\/,]|^[^(]+?\)/.test(e.slice(e.indexOf(u+"/")+8))&&(U=null),(u=W||V||q)&&(W||V||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(q))&&(U=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(q)?q:u)+" Browser")):"Electron"==U&&(u=(/\bChrome\/([\d.]+)\b/.exec(e)||0)[1])&&D.push("Chromium "+u):q="Kubuntu",F||(F=w(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",b(U),"(?:Firefox|Minefield|NetFront)"],function(t,n){return t||(RegExp(n+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(e)||0)[1]||null})),(u=("iCab"==j&&parseFloat(F)>3?"WebKit":/\bOpera\b/.test(U)&&(/\bOPR\b/.test(e)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(e)&&!/^(?:Trident|EdgeHTML)$/.test(j)&&"WebKit"||!j&&/\bMSIE\b/i.test(e)&&("Mac OS"==q?"Tasman":"Trident")||"WebKit"==j&&/\bPlayStation\b(?! Vita\b)/i.test(U)&&"NetFront")&&(j=[u]),"IE"==U&&(u=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(e)||0)[1])?(U+=" Mobile",q="Windows Phone "+(/\+$/.test(u)?u:u+".x"),D.unshift("desktop mode")):/\bWPDesktop\b/i.test(e)?(U="IE Mobile",q="Windows Phone 8.x",D.unshift("desktop mode"),F||(F=(/\brv:([\d.]+)/.exec(e)||0)[1])):"IE"!=U&&"Trident"==j&&(u=/\brv:([\d.]+)/.exec(e))&&(U&&D.push("identifying as "+U+(F?" "+F:"")),U="IE",F=u[1]),M){if(l="global",p=null!=(h=n)?o(h[l]):"number",/^(?:boolean|number|string|undefined)$/.test(p)||"object"==p&&!h[l])_(u=n.runtime)==v?(U="Adobe AIR",q=u.flash.system.Capabilities.os):_(u=n.phantom)==T?(U="PhantomJS",F=(u=u.version||null)&&u.major+"."+u.minor+"."+u.patch):"number"==typeof x.documentMode&&(u=/\bTrident\/(\d+)/i.exec(e))?(F=[F,x.documentMode],(u=+u[1]+4)!=F[1]&&(D.push("IE "+F[1]+" mode"),j&&(j[1]=""),F[1]=u),F="IE"==U?String(F[1].toFixed(1)):F[0]):"number"==typeof x.documentMode&&/^(?:Chrome|Firefox)\b/.test(U)&&(D.push("masking as "+U+" "+F),U="IE",F="11.0",j=["Trident"],q="Windows");else if(I&&(R=(u=I.lang.System).getProperty("os.arch"),q=q||u.getProperty("os.name")+" "+u.getProperty("os.version")),N){try{F=n.require("ringo/engine").version.join("."),U="RingoJS"}catch(K){(u=n.system)&&u.global.system==n.system&&(U="Narwhal",q||(q=u[0].os||null))}U||(U="Rhino")}else"object"==o(n.process)&&!n.process.browser&&(u=n.process)&&("object"==o(u.versions)&&("string"==typeof u.versions.electron?(D.push("Node "+u.versions.node),U="Electron",F=u.versions.electron):"string"==typeof u.versions.nw&&(D.push("Chromium "+F,"Node "+u.versions.node),U="NW.js",F=u.versions.nw)),U||(U="Node.js",R=u.arch,q=u.platform,F=(F=/[\d.]+/.exec(u.version))?F[0]:null));q=q&&g(q)}if(F&&(u=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(F)||/(?:alpha|beta)(?: ?\d)?/i.exec(e+";"+(M&&i.appMinorVersion))||/\bMinefield\b/i.test(e)&&"a")&&(L=/b/i.test(u)?"beta":"alpha",F=F.replace(RegExp(u+"\\+?$"),"")+("beta"==L?A:O)+(/\d+\+?/.exec(u)||"")),"Fennec"==U||"Firefox"==U&&/\b(?:Android|Firefox OS)\b/.test(q))U="Firefox Mobile";else if("Maxthon"==U&&F)F=F.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(W))"Xbox 360"==W&&(q=null),"Xbox 360"==W&&/\bIEMobile\b/.test(e)&&D.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(U)&&(!U||W||/Browser|Mobi/.test(U))||"Windows CE"!=q&&!/Mobi/i.test(e))if("IE"==U&&M)try{null===n.external&&D.unshift("platform preview")}catch(K){D.unshift("embedded")}else(/\bBlackBerry\b/.test(W)||/\bBB10\b/.test(e))&&(u=(RegExp(W.replace(/ +/g," *")+"/([.\\d]+)","i").exec(e)||0)[1]||F)?(q=((u=[u,/BB10/.test(e)])[1]?(W=null,V="BlackBerry"):"Device Software")+" "+u[0],F=null):this!=m&&"Wii"!=W&&(M&&P||/Opera/.test(U)&&/\b(?:MSIE|Firefox)\b/i.test(e)||"Firefox"==U&&/\bOS X (?:\d+\.){2,}/.test(q)||"IE"==U&&(q&&!/^Win/.test(q)&&F>5.5||/\bWindows XP\b/.test(q)&&F>8||8==F&&!/\bTrident\b/.test(e)))&&!f.test(u=t.call(m,e.replace(f,"")+";"))&&u.name&&(u="ing as "+u.name+((u=u.version)?" "+u:""),f.test(U)?(/\bIE\b/.test(u)&&"Mac OS"==q&&(q=null),u="identify"+u):(u="mask"+u,U=k?g(k.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(u)&&(q=null),M||(F=null)),j=["Presto"],D.push(u));else U+=" Mobile";(u=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(e)||0)[1])&&(u=[parseFloat(u.replace(/\.(\d)$/,".0$1")),u],"Safari"==U&&"+"==u[1].slice(-1)?(U="WebKit Nightly",L="alpha",F=u[1].slice(0,-1)):F!=u[1]&&F!=(u[2]=(/\bSafari\/([\d.]+\+?)/i.exec(e)||0)[1])||(F=null),u[1]=(/\bChrome\/([\d.]+)/i.exec(e)||0)[1],537.36==u[0]&&537.36==u[2]&&parseFloat(u[1])>=28&&"WebKit"==j&&(j=["Blink"]),M&&(d||u[1])?(j&&(j[1]="like Chrome"),u=u[1]||((u=u[0])<530?1:u<532?2:u<532.05?3:u<533?4:u<534.03?5:u<534.07?6:u<534.1?7:u<534.13?8:u<534.16?9:u<534.24?10:u<534.3?11:u<535.01?12:u<535.02?"13+":u<535.07?15:u<535.11?16:u<535.19?17:u<536.05?18:u<536.1?19:u<537.01?20:u<537.11?"21+":u<537.13?23:u<537.18?24:u<537.24?25:u<537.36?26:"Blink"!=j?"27":"28")):(j&&(j[1]="like Safari"),u=(u=u[0])<400?1:u<500?2:u<526?3:u<533?4:u<534?"4+":u<535?5:u<537?6:u<538?7:u<601?8:"8"),j&&(j[1]+=" "+(u+="number"==typeof u?".x":/[.+]/.test(u)?"":"+")),"Safari"==U&&(!F||parseInt(F)>45)&&(F=u)),"Opera"==U&&(u=/\bzbov|zvav$/.exec(q))?(U+=" ",D.unshift("desktop mode"),"zvav"==u?(U+="Mini",F=null):U+="Mobile",q=q.replace(RegExp(" *"+u+"$"),"")):"Safari"==U&&/\bChrome\b/.exec(j&&j[1])&&(D.unshift("desktop mode"),U="Chrome Mobile",F=null,/\bOS X\b/.test(q)?(V="Apple",q="iOS 4.3+"):q=null),F&&0==F.indexOf(u=/[\d.]+$/.exec(q))&&e.indexOf("/"+u+"-")>-1&&(q=E(q.replace(u,""))),j&&!/\b(?:Avant|Nook)\b/.test(U)&&(/Browser|Lunascape|Maxthon/.test(U)||"Safari"!=U&&/^iOS/.test(q)&&/\bSafari\b/.test(j[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(U)&&j[1])&&(u=j[j.length-1])&&D.push(u),D.length&&(D=["("+D.join("; ")+")"]),V&&W&&W.indexOf(V)<0&&D.push("on "+V),W&&D.push((/^on /.test(D[D.length-1])?"":"on ")+W),q&&(u=/ ([\d.+]+)$/.exec(q),c=u&&"/"==q.charAt(q.length-u[0].length-1),q={architecture:32,family:u&&!c?q.replace(u[0],""):q,version:u?u[1]:null,toString:function(){var t=this.version;return this.family+(t&&!c?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(u=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(R))&&!/\bi686\b/i.test(R)?(q&&(q.architecture=64,q.family=q.family.replace(RegExp(" *"+u),"")),U&&(/\bWOW64\b/i.test(e)||M&&/\w(?:86|32)$/.test(i.cpuClass||i.platform)&&!/\bWin64; x64\b/i.test(e))&&D.unshift("32-bit")):q&&/^OS X/.test(q.family)&&"Chrome"==U&&parseFloat(F)>=39&&(q.architecture=64),e||(e=null);var H={};return H.description=e,H.layout=j&&j[0],H.manufacturer=V,H.name=U,H.prerelease=L,H.product=W,H.ua=e,H.version=U&&F,H.os=q||{architecture:null,family:null,version:null,toString:function(){return"null"}},H.parse=t,H.toString=function(){return this.description||""},H.version&&D.unshift(F),H.name&&D.unshift(U),q&&U&&(q!=String(q).split(" ")[0]||q!=U.split(" ")[0]&&!W)&&D.push(W?"("+q+")":"on "+q),D.length&&(H.description=D.join(" ")),H}();"object"==o(n(268))&&n(268)?(s.platform=S,void 0===(i=function(){return S}.call(e,n,e,t))||(t.exports=i)):u&&c?m(S,function(t,e){u[e]=t}):s.platform=S}).call(this)}).call(this,n(109)(t),n(25))},826:function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,a,s,u=1,c={},h=!1,l=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick(function(){d(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},r=function(t){o.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,r=function(t){var e=l.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(d,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"===typeof e.data&&0===e.data.indexOf(a)&&d(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),f.setImmediate=function(t){"function"!==typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var i={callback:t,args:e};return c[u]=i,r(u),u++},f.clearImmediate=p}function p(t){delete c[t]}function d(t){if(h)setTimeout(d,0,t);else{var e=c[t];if(e){h=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}(e)}finally{p(t),h=!1}}}}}("undefined"===typeof self?"undefined"===typeof t?this:t:self)}).call(this,n(25),n(93))},853:function(t,e,n){t.exports=!n(335)&&!n(463)(function(){return 7!=Object.defineProperty(n(854)("div"),"a",{get:function(){return 7}}).a})},854:function(t,e,n){var r=n(280),i=n(209).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},855:function(t,e,n){var r=n(1420);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},856:function(t,e,n){var r=n(855),i=n(684),o=n(685),a=n(686),s=n(1421);t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,h=4==t,l=6==t,f=5==t||l,p=e||s;return function(e,s,d){for(var y,v,g=o(e),m=i(g),_=r(s,d,3),b=a(m.length),w=0,E=n?p(e,b):u?p(e,0):void 0;b>w;w++)if((f||w in m)&&(v=_(y=m[w],w,g),t))if(n)E[w]=v;else if(v)switch(t){case 3:return!0;case 5:return y;case 6:return w;case 2:E.push(y)}else if(h)return!1;return l?-1:c||h?h:E}}},857:function(t,e,n){var r=n(538);t.exports=Array.isArray||function(t){return"Array"==r(t)}},858:function(t,e,n){var r=n(281),i=n(336),o=n(1428)(!1),a=n(689)("IE_PROTO");t.exports=function(t,e){var n,s=i(t),u=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;e.length>u;)r(s,n=e[u++])&&(~o(c,n)||c.push(n));return c}},859:function(t,e,n){var r=n(536),i=n(1442),o=n(690),a=n(689)("IE_PROTO"),s=function(){},u=function(){var t,e=n(854)("iframe"),r=o.length;for(e.style.display="none",n(1443).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[a]=t):n=u(),void 0===e?n:i(n,e)}},860:function(t,e,n){var r=n(858),i=n(690).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},861:function(t,e,n){"use strict";var r=n(695),i=n(278),o=n(464),a=n(279),s=n(696),u=n(1453),c=n(692),h=n(1454),l=n(144)("iterator"),f=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,d,y,v,g){u(n,e,d);var m,_,b,w=function(t){if(!f&&t in T)return T[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},E=e+" Iterator",S="values"==y,C=!1,T=t.prototype,I=T[l]||T["@@iterator"]||y&&T[y],N=I||w(y),O=y?S?w("entries"):N:void 0,A="Array"==e&&T.entries||I;if(A&&(b=h(A.call(new t)))!==Object.prototype&&b.next&&(c(b,E,!0),r||"function"==typeof b[l]||a(b,l,p)),S&&I&&"values"!==I.name&&(C=!0,N=function(){return I.call(this)}),r&&!g||!f&&!C&&T[l]||a(T,l,N),s[e]=N,s[E]=p,y)if(m={values:S?N:w("values"),keys:v?N:w("keys"),entries:O},g)for(_ in m)_ in T||o(T,_,m[_]);else i(i.P+i.F*(f||C),e,m);return m}},862:function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1458),o={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},a=function(t,e){if(!t)throw s(e)},s=function(t){return new Error("Firebase Database ("+o.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)},u=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1<t.length&&56320==(64512&t.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&t.charCodeAt(++r)),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},c={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<t.length;i+=3){var o=t[i],a=i+1<t.length,s=a?t[i+1]:0,u=i+2<t.length,c=u?t[i+2]:0,h=o>>2,l=(3&o)<<4|s>>4,f=(15&s)<<2|c>>6,p=63&c;u||(p=64,a||(f=64)),r.push(n[h],n[l],n[f],n[p])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(u(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n<t.length;){var i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(1023&a))}else{o=t[n++];var s=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<t.length;){var o=n[t.charAt(i++)],a=i<t.length?n[t.charAt(i)]:0,s=++i<t.length?n[t.charAt(i)]:64,u=++i<t.length?n[t.charAt(i)]:64;if(++i,null==o||null==a||null==s||null==u)throw Error();var c=o<<2|a>>4;if(r.push(c),64!=s){var h=a<<4&240|s>>2;if(r.push(h),64!=u){var l=s<<6&192|u;r.push(l)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},h=function(t){try{return c.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function l(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n in e)e.hasOwnProperty(n)&&(t[n]=l(t[n],e[n]));return t}var f=function(){function t(){var t=this;this.promise=new Promise(function(e,n){t.resolve=e,t.reject=n})}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"===typeof t&&(e.promise.catch(function(){}),1===t.length?t(n):t(n,r))}},t}(),p=function(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""},d="FirebaseError",y=Error.captureStackTrace;var v=function(t,e){if(this.code=t,this.message=e,y)y(this,g.prototype.create);else try{throw Error.apply(this,arguments)}catch(n){this.name=d,Object.defineProperty(this,"stack",{get:function(){return n.stack}})}};v.prototype=Object.create(Error.prototype),v.prototype.constructor=v,v.prototype.name=d;var g=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n,this.pattern=/\{\$([^}]+)}/g}return t.prototype.create=function(t,e){void 0===e&&(e={});var n,r=this.errors[t],i=this.service+"/"+t;n=void 0===r?"Error":r.replace(this.pattern,function(t,n){var r=e[n];return void 0!==r?r.toString():"<"+n+"?>"}),n=this.serviceName+": "+n+" ("+i+").";var o=new v(i,n);for(var a in e)e.hasOwnProperty(a)&&"_"!==a.slice(-1)&&(o[a]=e[a]);return o},t}();function m(t){return JSON.parse(t)}var _=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=m(h(o[0])||""),n=m(h(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(a){}return{header:e,claims:n,data:r,signature:i}},b=function(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])},w=function(t,e){return b(e,function(e,n){t[e]=n}),t},E=function(t,e,n){for(var r in t)if(e.call(n,t[r],r,t))return r},S=function(t){function e(){var e=t.call(this)||this;e.chain_=[],e.buf_=[],e.W_=[],e.pad_=[],e.inbuf_=0,e.total_=0,e.blockSize=64,e.pad_[0]=128;for(var n=1;n<e.blockSize;++n)e.pad_[n]=0;return e.reset(),e}return i.__extends(e,t),e.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},e.prototype.compress_=function(t,e){e||(e=0);var n=this.W_;if("string"===typeof t)for(var r=0;r<16;r++)n[r]=t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|t.charCodeAt(e+3),e+=4;else for(r=0;r<16;r++)n[r]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],e+=4;for(r=16;r<80;r++){var i=n[r-3]^n[r-8]^n[r-14]^n[r-16];n[r]=4294967295&(i<<1|i>>>31)}var o,a,s=this.chain_[0],u=this.chain_[1],c=this.chain_[2],h=this.chain_[3],l=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(o=h^u&(c^h),a=1518500249):(o=u^c^h,a=1859775393):r<60?(o=u&c|h&(u|c),a=2400959708):(o=u^c^h,a=3395469782);i=(s<<5|s>>>27)+o+l+a+n[r]&4294967295;l=h,h=c,c=4294967295&(u<<30|u>>>2),u=s,s=i}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+h&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295},e.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r<e;){if(0==o)for(;r<=n;)this.compress_(t,r),r+=this.blockSize;if("string"===typeof t){for(;r<e;)if(i[o]=t.charCodeAt(r),++r,++o==this.blockSize){this.compress_(i),o=0;break}}else for(;r<e;)if(i[o]=t[r],++r,++o==this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=e}},e.prototype.digest=function(){var t=[],e=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&e,e/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.chain_[n]>>i&255,++r;return t},e}(function(){this.blockSize=-1});var C=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then(function(){t(n)}).catch(function(t){n.error(t)})}return t.prototype.next=function(t){this.forEachObserver(function(e){e.next(t)})},t.prototype.error=function(t){this.forEachObserver(function(e){e.error(t)}),this.close(t)},t.prototype.complete=function(){this.forEachObserver(function(t){t.complete()}),this.close()},t.prototype.subscribe=function(t,e,n){var i,o=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(i=function(t,e){if("object"!==r(t)||null===t)return!1;for(var n=0,i=e;n<i.length;n++){var o=i[n];if(o in t&&"function"===typeof t[o])return!0}return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:n}).next&&(i.next=T),void 0===i.error&&(i.error=T),void 0===i.complete&&(i.complete=T);var a=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{o.finalError?i.error(o.finalError):i.complete()}catch(t){}}),this.observers.push(i),a},t.prototype.unsubscribeOne=function(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},t.prototype.forEachObserver=function(t){if(!this.finalized)for(var e=0;e<this.observers.length;e++)this.sendOne(e,t)},t.prototype.sendOne=function(t,e){var n=this;this.task.then(function(){if(void 0!==n.observers&&void 0!==n.observers[t])try{e(n.observers[t])}catch(r){"undefined"!==typeof console&&console.error&&console.error(r)}})},t.prototype.close=function(t){var e=this;this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then(function(){e.observers=void 0,e.onNoObservers=void 0}))},t}();function T(){}function I(t,e,n){var r="";switch(e){case 1:r=n?"first":"First";break;case 2:r=n?"second":"Second";break;case 3:r=n?"third":"Third";break;case 4:r=n?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4.  Need to update it?")}var i=t+" failed: ";return i+=r+" argument "}e.assert=a,e.assertionError=s,e.base64=c,e.base64Decode=h,e.base64Encode=function(t){var e=u(t);return c.encodeByteArray(e,!0)},e.CONSTANTS=o,e.deepCopy=function(t){return l(void 0,t)},e.deepExtend=l,e.patchProperty=function(t,e,n){t[e]=n},e.Deferred=f,e.getUA=p,e.isMobileCordova=function(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())},e.isNodeSdk=function(){return!0===o.NODE_CLIENT||!0===o.NODE_ADMIN},e.isReactNative=function(){return"object"===("undefined"===typeof navigator?"undefined":r(navigator))&&"ReactNative"===navigator.product},e.ErrorFactory=g,e.FirebaseError=v,e.patchCapture=function(t){var e=y;return y=t,e},e.jsonEval=m,e.stringify=function(t){return JSON.stringify(t)},e.decode=_,e.isAdmin=function(t){var e=_(t).claims;return"object"===r(e)&&!0===e.admin},e.issuedAtTime=function(t){var e=_(t).claims;return"object"===r(e)&&e.hasOwnProperty("iat")?e.iat:null},e.isValidFormat=function(t){var e=_(t).claims;return!!e&&"object"===r(e)&&e.hasOwnProperty("iat")},e.isValidTimestamp=function(t){var e,n,i=_(t).claims,o=Math.floor((new Date).getTime()/1e3);return"object"===r(i)&&(i.hasOwnProperty("nbf")?e=i.nbf:i.hasOwnProperty("iat")&&(e=i.iat),n=i.hasOwnProperty("exp")?i.exp:e+86400),o&&e&&n&&o>=e&&o<=n},e.clone=function(t){return w({},t)},e.contains=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.every=function(t,e){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&!e(n,t[n]))return!1;return!0},e.extend=w,e.findKey=E,e.findValue=function(t,e,n){var r=E(t,e,n);return r&&t[r]},e.forEach=b,e.getAnyKey=function(t){for(var e in t)return e},e.getCount=function(t){var e=0;for(var n in t)e++;return e},e.getValues=function(t){var e=[],n=0;for(var r in t)e[n++]=t[r];return e},e.isEmpty=function(t){for(var e in t)return!1;return!0},e.isNonNullObject=function(t){return"object"===r(t)&&null!==t},e.map=function(t,e,n){var r={};for(var i in t)r[i]=e.call(n,t[i],i,t);return r},e.safeGet=function(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]},e.querystring=function(t){var e=[];return b(t,function(t,n){Array.isArray(n)?n.forEach(function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}),e.length?"&"+e.join("&"):""},e.querystringDecode=function(t){var e={};return t.replace(/^\?/,"").split("&").forEach(function(t){if(t){var n=t.split("=");e[n[0]]=n[1]}}),e},e.Sha1=S,e.async=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Promise.resolve(!0).then(function(){t.apply(void 0,n)}).catch(function(t){e&&e(t)})}},e.createSubscribe=function(t,e){var n=new C(t,e);return n.subscribe.bind(n)},e.errorPrefix=I,e.validateArgCount=function(t,e,n,r){var i;if(r<e?i="at least "+e:r>n&&(i=0===n?"none":"no more than "+n),i)throw new Error(t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},e.validateCallback=function(t,e,n,r){if((!r||n)&&"function"!==typeof n)throw new Error(I(t,e,r)+"must be a valid function.")},e.validateContextObject=function(t,e,n,i){if((!i||n)&&("object"!==r(n)||null===n))throw new Error(I(t,e,i)+"must be a valid context object.")},e.validateNamespace=function(t,e,n,r){if((!r||n)&&"string"!==typeof n)throw new Error(I(t,e,r)+"must be a valid firebase namespace.")},e.stringLength=function(t){for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e},e.stringToByteArray=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);if(i>=55296&&i<=56319){var o=i-55296;a(++r<t.length,"Surrogate pair missing trail surrogate."),i=65536+(o<<10)+(t.charCodeAt(r)-56320)}i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):i<65536?(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e}},863:function(t,e,n){"use strict";(function(r){function i(t){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(e,"__esModule",{value:!0});var o,a,s=n(862),u=n(1459),c=n(1460),h=(o=n(32))&&"object"===i(o)&&"default"in o?o.default:o,l=function(){function t(t){this.domStorage_=t,this.prefix_="firebase:"}return t.prototype.set=function(t,e){null==e?this.domStorage_.removeItem(this.prefixedName_(t)):this.domStorage_.setItem(this.prefixedName_(t),s.stringify(e))},t.prototype.get=function(t){var e=this.domStorage_.getItem(this.prefixedName_(t));return null==e?null:s.jsonEval(e)},t.prototype.remove=function(t){this.domStorage_.removeItem(this.prefixedName_(t))},t.prototype.prefixedName_=function(t){return this.prefix_+t},t.prototype.toString=function(){return this.domStorage_.toString()},t}(),f=function(){function t(){this.cache_={},this.isInMemoryStorage=!0}return t.prototype.set=function(t,e){null==e?delete this.cache_[t]:this.cache_[t]=e},t.prototype.get=function(t){return s.contains(this.cache_,t)?this.cache_[t]:null},t.prototype.remove=function(t){delete this.cache_[t]},t}(),p=function(t){try{if("undefined"!==typeof window&&"undefined"!==typeof window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new l(e)}}catch(n){}return new f},d=p("localStorage"),y=p("sessionStorage"),v=new u.Logger("@firebase/database"),g=(a=1,function(){return a++}),m=function(t){var e=s.stringToByteArray(t),n=new s.Sha1;n.update(e);var r=n.digest();return s.base64.encodeByteArray(r)},_=function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r="",o=0;o<e.length;o++)Array.isArray(e[o])||e[o]&&"object"===i(e[o])&&"number"===typeof e[o].length?r+=t.apply(null,e[o]):"object"===i(e[o])?r+=s.stringify(e[o]):r+=e[o],r+=" ";return r},b=null,w=!0,E=function(t,e){s.assert(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?(v.logLevel=u.LogLevel.VERBOSE,b=v.log.bind(v),e&&y.set("logging_enabled",!0)):"function"===typeof t?b=t:(b=null,y.remove("logging_enabled"))},S=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!0===w&&(w=!1,null===b&&!0===y.get("logging_enabled")&&E(!0)),b){var n=_.apply(null,t);b(n)}},C=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];S.apply(void 0,[t].concat(e))}},T=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE INTERNAL ERROR: "+_.apply(void 0,t);v.error(n)},I=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE FATAL ERROR: "+_.apply(void 0,t);throw v.error(n),new Error(n)},N=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE WARNING: "+_.apply(void 0,t);v.warn(n)},O=function(t){return"number"===typeof t&&(t!=t||t==Number.POSITIVE_INFINITY||t==Number.NEGATIVE_INFINITY)},A="[MIN_NAME]",x="[MAX_NAME]",P=function(t,e){if(t===e)return 0;if(t===A||e===x)return-1;if(e===A||t===x)return 1;var n=U(t),r=U(e);return null!==n?null!==r?n-r==0?t.length-e.length:n-r:-1:null!==r?1:t<e?-1:1},k=function(t,e){return t===e?0:t<e?-1:1},R=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+s.stringify(e))},D=function t(e){if("object"!==i(e)||null===e)return s.stringify(e);var n=[];for(var r in e)n.push(r);n.sort();for(var o="{",a=0;a<n.length;a++)0!==a&&(o+=","),o+=s.stringify(n[a]),o+=":",o+=t(e[n[a]]);return o+="}"},L=function(t,e){var n=t.length;if(n<=e)return[t];for(var r=[],i=0;i<n;i+=e)i+e>n?r.push(t.substring(i,n)):r.push(t.substring(i,i+e));return r},M=function(t,e){if(Array.isArray(t))for(var n=0;n<t.length;++n)e(n,t[n]);else s.forEach(t,function(t,n){return e(n,t)})},F=function(t){s.assert(!O(t),"Invalid JSON number");var e,n,r,i,o,a,u;for(0===t?(n=0,r=0,e=1/t===-1/0?1:0):(e=t<0,(t=Math.abs(t))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023))+1023,r=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(t/Math.pow(2,-1074)))),a=[],o=52;o;o-=1)a.push(r%2?1:0),r=Math.floor(r/2);for(o=11;o;o-=1)a.push(n%2?1:0),n=Math.floor(n/2);a.push(e?1:0),a.reverse(),u=a.join("");var c="";for(o=0;o<64;o+=8){var h=parseInt(u.substr(o,8),2).toString(16);1===h.length&&(h="0"+h),c+=h}return c.toLowerCase()},j=new RegExp("^-?\\d{1,10}$"),U=function(t){if(j.test(t)){var e=Number(t);if(e>=-2147483648&&e<=2147483647)return e}return null},W=function(t){try{t()}catch(e){setTimeout(function(){var t=e.stack||"";throw N("Exception was thrown by user callback.",t),e},Math.floor(0))}},V=function(){return("object"===("undefined"===typeof window?"undefined":i(window))&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},q=function(t,e){var n=setTimeout(t,e);return"object"===i(n)&&n.unref&&n.unref(),n},B=function(){function t(t,e){if(void 0===e){this.pieces_=t.split("/");for(var n=0,r=0;r<this.pieces_.length;r++)this.pieces_[r].length>0&&(this.pieces_[n]=this.pieces_[r],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=t,this.pieceNum_=e}return Object.defineProperty(t,"Empty",{get:function(){return new t("")},enumerable:!0,configurable:!0}),t.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},t.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},t.prototype.popFront=function(){var e=this.pieceNum_;return e<this.pieces_.length&&e++,new t(this.pieces_,e)},t.prototype.getBack=function(){return this.pieceNum_<this.pieces_.length?this.pieces_[this.pieces_.length-1]:null},t.prototype.toString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+this.pieces_[e]);return t||"/"},t.prototype.toUrlEncodedString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+encodeURIComponent(String(this.pieces_[e])));return t||"/"},t.prototype.slice=function(t){return void 0===t&&(t=0),this.pieces_.slice(this.pieceNum_+t)},t.prototype.parent=function(){if(this.pieceNum_>=this.pieces_.length)return null;for(var e=[],n=this.pieceNum_;n<this.pieces_.length-1;n++)e.push(this.pieces_[n]);return new t(e,0)},t.prototype.child=function(e){for(var n=[],r=this.pieceNum_;r<this.pieces_.length;r++)n.push(this.pieces_[r]);if(e instanceof t)for(r=e.pieceNum_;r<e.pieces_.length;r++)n.push(e.pieces_[r]);else{var i=e.split("/");for(r=0;r<i.length;r++)i[r].length>0&&n.push(i[r])}return new t(n,0)},t.prototype.isEmpty=function(){return this.pieceNum_>=this.pieces_.length},t.relativePath=function(e,n){var r=e.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return t.relativePath(e.popFront(),n.popFront());throw new Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+e+")")},t.comparePaths=function(t,e){for(var n=t.slice(),r=e.slice(),i=0;i<n.length&&i<r.length;i++){var o=P(n[i],r[i]);if(0!==o)return o}return n.length===r.length?0:n.length<r.length?-1:1},t.prototype.equals=function(t){if(this.getLength()!==t.getLength())return!1;for(var e=this.pieceNum_,n=t.pieceNum_;e<=this.pieces_.length;e++,n++)if(this.pieces_[e]!==t.pieces_[n])return!1;return!0},t.prototype.contains=function(t){var e=this.pieceNum_,n=t.pieceNum_;if(this.getLength()>t.getLength())return!1;for(;e<this.pieces_.length;){if(this.pieces_[e]!==t.pieces_[n])return!1;++e,++n}return!0},t}(),H=function(){function t(t,e){this.errorPrefix_=e,this.parts_=t.slice(),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n<this.parts_.length;n++)this.byteLength_+=s.stringLength(this.parts_[n]);this.checkValid_()}return Object.defineProperty(t,"MAX_PATH_DEPTH",{get:function(){return 32},enumerable:!0,configurable:!0}),Object.defineProperty(t,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!0,configurable:!0}),t.prototype.push=function(t){this.parts_.length>0&&(this.byteLength_+=1),this.parts_.push(t),this.byteLength_+=s.stringLength(t),this.checkValid_()},t.prototype.pop=function(){var t=this.parts_.pop();this.byteLength_-=s.stringLength(t),this.parts_.length>0&&(this.byteLength_-=1)},t.prototype.checkValid_=function(){if(this.byteLength_>t.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+t.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");if(this.parts_.length>t.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+t.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},t.prototype.toErrorString=function(){return 0==this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},t}(),K="long_polling",Q=function(){function t(t,e,n,r,i){void 0===i&&(i=""),this.secure=e,this.namespace=n,this.webSocketOnly=r,this.persistenceKey=i,this.host=t.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=d.get("host:"+t)||this.host}return t.prototype.needsQueryParam=function(){return this.host!==this.internalHost||this.isCustomHost()},t.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},t.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},t.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},t.prototype.updateHost=function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&d.set("host:"+this.host,this.internalHost))},t.prototype.connectionURL=function(t,e){var n;if(s.assert("string"===typeof t,"typeof type must == string"),s.assert("object"===i(e),"typeof params must == object"),"websocket"===t)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if(t!==K)throw new Error("Unknown connection type: "+t);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(e.ns=this.namespace);var r=[];return s.forEach(e,function(t,e){r.push(t+"="+e)}),n+r.join("&")},t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t},t.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},t}();var G,z,X,Y,$,J=function(t){var e=Z(t),n=e.subdomain;"firebase"===e.domain&&I(e.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!=n||"localhost"===e.domain||I("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),e.secure||"undefined"!==typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&N("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var r="ws"===e.scheme||"wss"===e.scheme;return{repoInfo:new Q(e.host,e.secure,n,r),path:new B(e.pathString)}},Z=function(t){var e="",n="",r="",i="",o=!0,a="https",s=443;if("string"===typeof t){var u=t.indexOf("//");u>=0&&(a=t.substring(0,u-1),t=t.substring(u+2));var c=t.indexOf("/");-1===c&&(c=t.length);var h=t.indexOf("?");-1===h&&(h=t.length),e=t.substring(0,Math.min(c,h)),c<h&&(i=function(t){for(var e="",n=t.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(o){}e+="/"+i}return e}(t.substring(c,h)));var l=function(t){var e={};"?"===t.charAt(0)&&(t=t.substring(1));for(var n=0,r=t.split("&");n<r.length;n++){var i=r[n];if(0!==i.length){var o=i.split("=");2===o.length?e[decodeURIComponent(o[0])]=decodeURIComponent(o[1]):N("Invalid query segment '"+i+"' in query '"+t+"'")}}return e}(t.substring(Math.min(t.length,h)));(u=e.indexOf(":"))>=0?(o="https"===a||"wss"===a,s=parseInt(e.substring(u+1),10)):u=t.length;var f=e.split(".");3===f.length?(n=f[1],r=f[0].toLowerCase()):2===f.length?n=f[0]:"localhost"===f[0].slice(0,u).toLowerCase()&&(n="localhost"),""===r&&"ns"in l&&(r=l.ns)}return{host:e,port:s,domain:n,subdomain:r,secure:o,scheme:a,pathString:i}},tt=/[\[\].#$\/\u0000-\u001F\u007F]/,et=/[\[\].#$\u0000-\u001F\u007F]/,nt=function(t){return"string"===typeof t&&0!==t.length&&!tt.test(t)},rt=function(t){return"string"===typeof t&&0!==t.length&&!et.test(t)},it=function(t){return null===t||"string"===typeof t||"number"===typeof t&&!O(t)||t&&"object"===i(t)&&s.contains(t,".sv")},ot=function(t,e,n,r,i){i&&void 0===n||at(s.errorPrefix(t,e,i),n,r)},at=function t(e,n,r){var o=r instanceof B?new H(r,e):r;if(void 0===n)throw new Error(e+"contains undefined "+o.toErrorString());if("function"===typeof n)throw new Error(e+"contains a function "+o.toErrorString()+" with contents = "+n.toString());if(O(n))throw new Error(e+"contains "+n.toString()+" "+o.toErrorString());if("string"===typeof n&&n.length>10485760/3&&s.stringLength(n)>10485760)throw new Error(e+"contains a string greater than 10485760 utf8 bytes "+o.toErrorString()+" ('"+n.substring(0,50)+"...')");if(n&&"object"===i(n)){var a=!1,u=!1;if(s.forEach(n,function(n,r){if(".value"===n)a=!0;else if(".priority"!==n&&".sv"!==n&&(u=!0,!nt(n)))throw new Error(e+" contains an invalid key ("+n+") "+o.toErrorString()+'.  Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');o.push(n),t(e,r,o),o.pop()}),a&&u)throw new Error(e+' contains ".value" child '+o.toErrorString()+" in addition to actual children.")}},st=function(t,e,n,r,o){if(!o||void 0!==n){var a=s.errorPrefix(t,e,o);if(!n||"object"!==i(n)||Array.isArray(n))throw new Error(a+" must be an object containing the children to replace.");var u=[];s.forEach(n,function(t,e){var n=new B(t);if(at(a,e,r.child(n)),".priority"===n.getBack()&&!it(e))throw new Error(a+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");u.push(n)}),function(t,e){var n,r;for(n=0;n<e.length;n++)for(var i=(r=e[n]).slice(),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!nt(i[o]))throw new Error(t+"contains an invalid key ("+i[o]+") in path "+r.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');e.sort(B.comparePaths);var a=null;for(n=0;n<e.length;n++){if(r=e[n],null!==a&&a.contains(r))throw new Error(t+"contains a path "+a.toString()+" that is ancestor of another path "+r.toString());a=r}}(a,u)}},ut=function(t,e,n,r){if(!r||void 0!==n){if(O(n))throw new Error(s.errorPrefix(t,e,r)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!it(n))throw new Error(s.errorPrefix(t,e,r)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},ct=function(t,e,n,r){if(!r||void 0!==n)switch(n){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(s.errorPrefix(t,e,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},ht=function(t,e,n,r){if((!r||void 0!==n)&&!nt(n))throw new Error(s.errorPrefix(t,e,r)+'was an invalid key = "'+n+'".  Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},lt=function(t,e,n,r){if((!r||void 0!==n)&&!rt(n))throw new Error(s.errorPrefix(t,e,r)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},ft=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),lt(t,e,n,r)},pt=function(t,e){if(".info"===e.getFront())throw new Error(t+" failed = Can't modify data under /.info/")},dt=function(t,e,n){var r=n.path.toString();if("string"!==typeof n.repoInfo.host||0===n.repoInfo.host.length||!nt(n.repoInfo.namespace)&&"localhost"!==n.repoInfo.host.split(":")[0]||0!==r.length&&!function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),rt(t)}(r))throw new Error(s.errorPrefix(t,e,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},yt=function(t,e,n,r){if((!r||void 0!==n)&&"boolean"!==typeof n)throw new Error(s.errorPrefix(t,e,r)+"must be a boolean.")},vt=function(){function t(t,e){this.repo_=t,this.path_=e}return t.prototype.cancel=function(t){s.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),s.validateCallback("OnDisconnect.cancel",1,t,!0);var e=new s.Deferred;return this.repo_.onDisconnectCancel(this.path_,e.wrapCallback(t)),e.promise},t.prototype.remove=function(t){s.validateArgCount("OnDisconnect.remove",0,1,arguments.length),pt("OnDisconnect.remove",this.path_),s.validateCallback("OnDisconnect.remove",1,t,!0);var e=new s.Deferred;return this.repo_.onDisconnectSet(this.path_,null,e.wrapCallback(t)),e.promise},t.prototype.set=function(t,e){s.validateArgCount("OnDisconnect.set",1,2,arguments.length),pt("OnDisconnect.set",this.path_),ot("OnDisconnect.set",1,t,this.path_,!1),s.validateCallback("OnDisconnect.set",2,e,!0);var n=new s.Deferred;return this.repo_.onDisconnectSet(this.path_,t,n.wrapCallback(e)),n.promise},t.prototype.setWithPriority=function(t,e,n){s.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),pt("OnDisconnect.setWithPriority",this.path_),ot("OnDisconnect.setWithPriority",1,t,this.path_,!1),ut("OnDisconnect.setWithPriority",2,e,!1),s.validateCallback("OnDisconnect.setWithPriority",3,n,!0);var r=new s.Deferred;return this.repo_.onDisconnectSetWithPriority(this.path_,t,e,r.wrapCallback(n)),r.promise},t.prototype.update=function(t,e){if(s.validateArgCount("OnDisconnect.update",1,2,arguments.length),pt("OnDisconnect.update",this.path_),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,N("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}st("OnDisconnect.update",1,t,this.path_,!1),s.validateCallback("OnDisconnect.update",2,e,!0);var i=new s.Deferred;return this.repo_.onDisconnectUpdate(this.path_,t,i.wrapCallback(e)),i.promise},t}(),gt=function(){function t(t,e){this.committed=t,this.snapshot=e}return t.prototype.toJSON=function(){return s.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}(),mt=(G="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",z=0,X=[],function(t){var e,n=t===z;z=t;var r=new Array(8);for(e=7;e>=0;e--)r[e]=G.charAt(t%64),t=Math.floor(t/64);s.assert(0===t,"Cannot push at time == 0");var i=r.join("");if(n){for(e=11;e>=0&&63===X[e];e--)X[e]=0;X[e]++}else for(e=0;e<12;e++)X[e]=Math.floor(64*Math.random());for(e=0;e<12;e++)i+=G.charAt(X[e]);return s.assert(20===i.length,"nextPushId: Length should be 20."),i}),_t=function(){function t(t,e){this.name=t,this.node=e}return t.Wrap=function(e,n){return new t(e,n)},t}(),bt=function(){function t(){}return t.prototype.getCompare=function(){return this.compare.bind(this)},t.prototype.indexedValueChanged=function(t,e){var n=new _t(A,t),r=new _t(A,e);return 0!==this.compare(n,r)},t.prototype.minPost=function(){return _t.MIN},t}(),wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c.__extends(e,t),Object.defineProperty(e,"__EMPTY_NODE",{get:function(){return Y},set:function(t){Y=t},enumerable:!0,configurable:!0}),e.prototype.compare=function(t,e){return P(t.name,e.name)},e.prototype.isDefinedOn=function(t){throw s.assertionError("KeyIndex.isDefinedOn not expected to be called.")},e.prototype.indexedValueChanged=function(t,e){return!1},e.prototype.minPost=function(){return _t.MIN},e.prototype.maxPost=function(){return new _t(x,Y)},e.prototype.makePost=function(t,e){return s.assert("string"===typeof t,"KeyIndex indexValue must always be a string."),new _t(t,Y)},e.prototype.toString=function(){return".key"},e}(bt),Et=new wt;var St,Ct,Tt,It=function(t){return"number"===typeof t?"number:"+F(t):"string:"+t},Nt=function(t){if(t.isLeafNode()){var e=t.val();s.assert("string"===typeof e||"number"===typeof e||"object"===i(e)&&s.contains(e,".sv"),"Priority must be a string or number.")}else s.assert(t===$||t.isEmpty(),"priority of unexpected type.");s.assert(t===$||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},Ot=function(){function t(e,n){void 0===n&&(n=t.__childrenNodeConstructor.EMPTY_NODE),this.value_=e,this.priorityNode_=n,this.lazyHash_=null,s.assert(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),Nt(this.priorityNode_)}return Object.defineProperty(t,"__childrenNodeConstructor",{get:function(){return St},set:function(t){St=t},enumerable:!0,configurable:!0}),t.prototype.isLeafNode=function(){return!0},t.prototype.getPriority=function(){return this.priorityNode_},t.prototype.updatePriority=function(e){return new t(this.value_,e)},t.prototype.getImmediateChild=function(e){return".priority"===e?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.getChild=function(e){return e.isEmpty()?this:".priority"===e.getFront()?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.hasChild=function(){return!1},t.prototype.getPredecessorChildName=function(t,e){return null},t.prototype.updateImmediateChild=function(e,n){return".priority"===e?this.updatePriority(n):n.isEmpty()&&".priority"!==e?this:t.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)},t.prototype.updateChild=function(e,n){var r=e.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(s.assert(".priority"!==r||1===e.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,t.__childrenNodeConstructor.EMPTY_NODE.updateChild(e.popFront(),n)))},t.prototype.isEmpty=function(){return!1},t.prototype.numChildren=function(){return 0},t.prototype.forEachChild=function(t,e){return!1},t.prototype.val=function(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.priorityNode_.isEmpty()||(t+="priority:"+It(this.priorityNode_.val())+":");var e=i(this.value_);t+=e+":",t+="number"===e?F(this.value_):this.value_,this.lazyHash_=m(t)}return this.lazyHash_},t.prototype.getValue=function(){return this.value_},t.prototype.compareTo=function(e){return e===t.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof t.__childrenNodeConstructor?-1:(s.assert(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))},t.prototype.compareToLeafNode_=function(e){var n=i(e.value_),r=i(this.value_),o=t.VALUE_TYPE_ORDER.indexOf(n),a=t.VALUE_TYPE_ORDER.indexOf(r);return s.assert(o>=0,"Unknown leaf type: "+n),s.assert(a>=0,"Unknown leaf type: "+r),o===a?"object"===r?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:a-o},t.prototype.withIndex=function(){return this},t.prototype.isIndexed=function(){return!0},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode()){var e=t;return this.value_===e.value_&&this.priorityNode_.equals(e.priorityNode_)}return!1},t.VALUE_TYPE_ORDER=["object","boolean","number","string"],t}();var At,xt,Pt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c.__extends(e,t),e.prototype.compare=function(t,e){var n=t.node.getPriority(),r=e.node.getPriority(),i=n.compareTo(r);return 0===i?P(t.name,e.name):i},e.prototype.isDefinedOn=function(t){return!t.getPriority().isEmpty()},e.prototype.indexedValueChanged=function(t,e){return!t.getPriority().equals(e.getPriority())},e.prototype.minPost=function(){return _t.MIN},e.prototype.maxPost=function(){return new _t(x,new Ot("[PRIORITY-POST]",Tt))},e.prototype.makePost=function(t,e){var n=Ct(t);return new _t(e,new Ot("[PRIORITY-POST]",n))},e.prototype.toString=function(){return".priority"},e}(bt)),kt=function(){function t(t,e,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var o=1;!t.isEmpty();)if(t=t,o=e?n(t.key,e):1,r&&(o*=-1),o<0)t=this.isReverse_?t.left:t.right;else{if(0===o){this.nodeStack_.push(t);break}this.nodeStack_.push(t),t=this.isReverse_?t.right:t.left}}return t.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var t,e=this.nodeStack_.pop();if(t=this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return t},t.prototype.hasNext=function(){return this.nodeStack_.length>0},t.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var t=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value}},t}(),Rt=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:Lt.EMPTY_NODE,this.right=null!=o?o:Lt.EMPTY_NODE}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.count=function(){return this.left.count()+1+this.right.count()},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},t.prototype.minKey=function(){return this.min_().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r,i;return(i=(r=n(t,(i=this).key))<0?i.copy(null,null,null,i.left.insert(t,e,n),null):0===r?i.copy(null,e,null,null,null):i.copy(null,null,null,null,i.right.insert(t,e,n))).fixUp_()},t.prototype.removeMin_=function(){if(this.left.isEmpty())return Lt.EMPTY_NODE;var t=this;return t.left.isRed_()||t.left.left.isRed_()||(t=t.moveRedLeft_()),(t=t.copy(null,null,null,t.left.removeMin_(),null)).fixUp_()},t.prototype.remove=function(t,e){var n,r;if(e(t,(n=this).key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(t,e),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===e(t,n.key)){if(n.right.isEmpty())return Lt.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(t,e))}return n.fixUp_()},t.prototype.isRed_=function(){return this.color},t.prototype.fixUp_=function(){var t=this;return t.right.isRed_()&&!t.left.isRed_()&&(t=t.rotateLeft_()),t.left.isRed_()&&t.left.left.isRed_()&&(t=t.rotateRight_()),t.left.isRed_()&&t.right.isRed_()&&(t=t.colorFlip_()),t},t.prototype.moveRedLeft_=function(){var t=this.colorFlip_();return t.right.left.isRed_()&&(t=(t=(t=t.copy(null,null,null,null,t.right.rotateRight_())).rotateLeft_()).colorFlip_()),t},t.prototype.moveRedRight_=function(){var t=this.colorFlip_();return t.left.left.isRed_()&&(t=(t=t.rotateRight_()).colorFlip_()),t},t.prototype.rotateLeft_=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight_=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip_=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth_=function(){var t=this.check_();return Math.pow(2,t)<=this.count()+1},t.prototype.check_=function(){var t;if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");if((t=this.left.check_())!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)},t.RED=!0,t.BLACK=!1,t}(),Dt=function(){function t(){}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new Rt(t,e,null)},t.prototype.remove=function(t,e){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.check_=function(){return 0},t.prototype.isRed_=function(){return!1},t}(),Lt=function(){function t(e,n){void 0===n&&(n=t.EMPTY_NODE),this.comparator_=e,this.root_=n}return t.prototype.insert=function(e,n){return new t(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,Rt.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,Rt.BLACK,null,null))},t.prototype.get=function(t){for(var e,n=this.root_;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key)))return n.value;e<0?n=n.left:e>0&&(n=n.right)}return null},t.prototype.getPredecessorKey=function(t){for(var e,n=this.root_,r=null;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}e<0?n=n.left:e>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key.  What gives?")},t.prototype.isEmpty=function(){return this.root_.isEmpty()},t.prototype.count=function(){return this.root_.count()},t.prototype.minKey=function(){return this.root_.minKey()},t.prototype.maxKey=function(){return this.root_.maxKey()},t.prototype.inorderTraversal=function(t){return this.root_.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.root_.reverseTraversal(t)},t.prototype.getIterator=function(t){return new kt(this.root_,null,this.comparator_,!1,t)},t.prototype.getIteratorFrom=function(t,e){return new kt(this.root_,t,this.comparator_,!1,e)},t.prototype.getReverseIteratorFrom=function(t,e){return new kt(this.root_,t,this.comparator_,!0,e)},t.prototype.getReverseIterator=function(t){return new kt(this.root_,null,this.comparator_,!0,t)},t.EMPTY_NODE=new Dt,t}(),Mt=Math.log(2),Ft=function(){function t(t){var e;this.count=(e=t+1,parseInt(Math.log(e)/Mt,10)),this.current_=this.count-1;var n,r=(n=this.count,parseInt(Array(n+1).join("1"),2));this.bits_=t+1&r}return t.prototype.nextBitIsOne=function(){var t=!(this.bits_&1<<this.current_);return this.current_--,t},t}(),jt=function(t,e,n,r){t.sort(e);var i=function(e){for(var r=null,i=null,o=t.length,a=function(e,r){var i=o-e,a=o;o-=e;var u=function e(r,i){var o,a,s=i-r;if(0==s)return null;if(1==s)return o=t[r],a=n?n(o):o,new Rt(a,o.node,Rt.BLACK,null,null);var u=parseInt(s/2,10)+r,c=e(r,u),h=e(u+1,i);return o=t[u],a=n?n(o):o,new Rt(a,o.node,Rt.BLACK,c,h)}(i+1,a),c=t[i],h=n?n(c):c;s(new Rt(h,c.node,r,null,u))},s=function(t){r?(r.left=t,r=t):(i=t,r=t)},u=0;u<e.count;++u){var c=e.nextBitIsOne(),h=Math.pow(2,e.count-(u+1));c?a(h,Rt.BLACK):(a(h,Rt.BLACK),a(h,Rt.RED))}return i}(new Ft(t.length));return new Lt(r||e,i)},Ut={},Wt=function(){function t(t,e){this.indexes_=t,this.indexSet_=e}return Object.defineProperty(t,"Default",{get:function(){return s.assert(Ut&&Pt,"ChildrenNode.ts has not been loaded"),At=At||new t({".priority":Ut},{".priority":Pt})},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var e=s.safeGet(this.indexes_,t);if(!e)throw new Error("No index defined for "+t);return e===Ut?null:e},t.prototype.hasIndex=function(t){return s.contains(this.indexSet_,t.toString())},t.prototype.addIndex=function(e,n){s.assert(e!==Et,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r,i=[],o=!1,a=n.getIterator(_t.Wrap),u=a.getNext();u;)o=o||e.isDefinedOn(u.node),i.push(u),u=a.getNext();r=o?jt(i,e.getCompare()):Ut;var c=e.toString(),h=s.clone(this.indexSet_);h[c]=e;var l=s.clone(this.indexes_);return l[c]=r,new t(l,h)},t.prototype.addToIndexes=function(e,n){var r=this;return new t(s.map(this.indexes_,function(t,i){var o=s.safeGet(r.indexSet_,i);if(s.assert(o,"Missing index implementation for "+i),t===Ut){if(o.isDefinedOn(e.node)){for(var a=[],u=n.getIterator(_t.Wrap),c=u.getNext();c;)c.name!=e.name&&a.push(c),c=u.getNext();return a.push(e),jt(a,o.getCompare())}return Ut}var h=n.get(e.name),l=t;return h&&(l=l.remove(new _t(e.name,h))),l.insert(e,e.node)}),this.indexSet_)},t.prototype.removeFromIndexes=function(e,n){return new t(s.map(this.indexes_,function(t){if(t===Ut)return t;var r=n.get(e.name);return r?t.remove(new _t(e.name,r)):t}),this.indexSet_)},t}();function Vt(t,e){return P(t.name,e.name)}function qt(t,e){return P(t,e)}var Bt=function(){function t(t,e,n){this.children_=t,this.priorityNode_=e,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&Nt(this.priorityNode_),this.children_.isEmpty()&&s.assert(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(t,"EMPTY_NODE",{get:function(){return xt||(xt=new t(new Lt(qt),null,Wt.Default))},enumerable:!0,configurable:!0}),t.prototype.isLeafNode=function(){return!1},t.prototype.getPriority=function(){return this.priorityNode_||xt},t.prototype.updatePriority=function(e){return this.children_.isEmpty()?this:new t(this.children_,e,this.indexMap_)},t.prototype.getImmediateChild=function(t){if(".priority"===t)return this.getPriority();var e=this.children_.get(t);return null===e?xt:e},t.prototype.getChild=function(t){var e=t.getFront();return null===e?this:this.getImmediateChild(e).getChild(t.popFront())},t.prototype.hasChild=function(t){return null!==this.children_.get(t)},t.prototype.updateImmediateChild=function(e,n){if(s.assert(n,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(n);var r,i=new _t(e,n),o=void 0,a=void 0;return n.isEmpty()?(o=this.children_.remove(e),a=this.indexMap_.removeFromIndexes(i,this.children_)):(o=this.children_.insert(e,n),a=this.indexMap_.addToIndexes(i,this.children_)),r=o.isEmpty()?xt:this.priorityNode_,new t(o,r,a)},t.prototype.updateChild=function(t,e){var n=t.getFront();if(null===n)return e;s.assert(".priority"!==t.getFront()||1===t.getLength(),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(t.popFront(),e);return this.updateImmediateChild(n,r)},t.prototype.isEmpty=function(){return this.children_.isEmpty()},t.prototype.numChildren=function(){return this.children_.count()},t.prototype.val=function(e){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(Pt,function(a,s){n[a]=s.val(e),r++,o&&t.INTEGER_REGEXP_.test(a)?i=Math.max(i,Number(a)):o=!1}),!e&&o&&i<2*r){var a=[];for(var s in n)a[s]=n[s];return a}return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.getPriority().isEmpty()||(t+="priority:"+It(this.getPriority().val())+":"),this.forEachChild(Pt,function(e,n){var r=n.hash();""!==r&&(t+=":"+e+":"+r)}),this.lazyHash_=""===t?"":m(t)}return this.lazyHash_},t.prototype.getPredecessorChildName=function(t,e,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new _t(t,e));return i?i.name:null}return this.children_.getPredecessorKey(t)},t.prototype.getFirstChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.minKey();return n&&n.name}return this.children_.minKey()},t.prototype.getFirstChild=function(t){var e=this.getFirstChildName(t);return e?new _t(e,this.children_.get(e)):null},t.prototype.getLastChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.maxKey();return n&&n.name}return this.children_.maxKey()},t.prototype.getLastChild=function(t){var e=this.getLastChildName(t);return e?new _t(e,this.children_.get(e)):null},t.prototype.forEachChild=function(t,e){var n=this.resolveIndex_(t);return n?n.inorderTraversal(function(t){return e(t.name,t.node)}):this.children_.inorderTraversal(e)},t.prototype.getIterator=function(t){return this.getIteratorFrom(t.minPost(),t)},t.prototype.getIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getIteratorFrom(t,function(t){return t});for(var r=this.children_.getIteratorFrom(t.name,_t.Wrap),i=r.peek();null!=i&&e.compare(i,t)<0;)r.getNext(),i=r.peek();return r},t.prototype.getReverseIterator=function(t){return this.getReverseIteratorFrom(t.maxPost(),t)},t.prototype.getReverseIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getReverseIteratorFrom(t,function(t){return t});for(var r=this.children_.getReverseIteratorFrom(t.name,_t.Wrap),i=r.peek();null!=i&&e.compare(i,t)>0;)r.getNext(),i=r.peek();return r},t.prototype.compareTo=function(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===Ht?-1:0},t.prototype.withIndex=function(e){if(e===Et||this.indexMap_.hasIndex(e))return this;var n=this.indexMap_.addIndex(e,this.children_);return new t(this.children_,this.priorityNode_,n)},t.prototype.isIndexed=function(t){return t===Et||this.indexMap_.hasIndex(t)},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode())return!1;var e=t;if(this.getPriority().equals(e.getPriority())){if(this.children_.count()===e.children_.count()){for(var n=this.getIterator(Pt),r=e.getIterator(Pt),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},t.prototype.resolveIndex_=function(t){return t===Et?null:this.indexMap_.get(t.toString())},t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t}(),Ht=new(function(t){function e(){return t.call(this,new Lt(qt),Bt.EMPTY_NODE,Wt.Default)||this}return c.__extends(e,t),e.prototype.compareTo=function(t){return t===this?0:1},e.prototype.equals=function(t){return t===this},e.prototype.getPriority=function(){return this},e.prototype.getImmediateChild=function(t){return Bt.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}(Bt));Object.defineProperties(_t,{MIN:{value:new _t(A,Bt.EMPTY_NODE)},MAX:{value:new _t(x,Ht)}}),wt.__EMPTY_NODE=Bt.EMPTY_NODE,Ot.__childrenNodeConstructor=Bt,$=Ht,function(t){Tt=t}(Ht);var Kt=!0;function Qt(t,e){if(void 0===e&&(e=null),null===t)return Bt.EMPTY_NODE;if("object"===i(t)&&".priority"in t&&(e=t[".priority"]),s.assert(null===e||"string"===typeof e||"number"===typeof e||"object"===i(e)&&".sv"in e,"Invalid priority type found: "+i(e)),"object"===i(t)&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!==i(t)||".sv"in t)return new Ot(t,Qt(e));if(t instanceof Array||!Kt){var n=Bt.EMPTY_NODE,r=t;return s.forEach(r,function(t,e){if(s.contains(r,t)&&"."!==t.substring(0,1)){var i=Qt(e);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(t,i))}}),n.updatePriority(Qt(e))}var o=[],a=!1,u=t;if(s.forEach(u,function(t,e){if("string"!==typeof t||"."!==t.substring(0,1)){var n=Qt(u[t]);n.isEmpty()||(a=a||!n.getPriority().isEmpty(),o.push(new _t(t,n)))}}),0==o.length)return Bt.EMPTY_NODE;var c=jt(o,Vt,function(t){return t.name},qt);if(a){var h=jt(o,Pt.getCompare());return new Bt(c,Qt(e),new Wt({".priority":h},{".priority":Pt}))}return new Bt(c,Qt(e),Wt.Default)}!function(t){Ct=t}(Qt);var Gt,zt,Xt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c.__extends(e,t),e.prototype.compare=function(t,e){var n=t.node.compareTo(e.node);return 0===n?P(t.name,e.name):n},e.prototype.isDefinedOn=function(t){return!0},e.prototype.indexedValueChanged=function(t,e){return!t.equals(e)},e.prototype.minPost=function(){return _t.MIN},e.prototype.maxPost=function(){return _t.MAX},e.prototype.makePost=function(t,e){var n=Qt(t);return new _t(e,n)},e.prototype.toString=function(){return".value"},e}(bt)),Yt=function(t){function e(e){var n=t.call(this)||this;return n.indexPath_=e,s.assert(!e.isEmpty()&&".priority"!==e.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return c.__extends(e,t),e.prototype.extractChild=function(t){return t.getChild(this.indexPath_)},e.prototype.isDefinedOn=function(t){return!t.getChild(this.indexPath_).isEmpty()},e.prototype.compare=function(t,e){var n=this.extractChild(t.node),r=this.extractChild(e.node),i=n.compareTo(r);return 0===i?P(t.name,e.name):i},e.prototype.makePost=function(t,e){var n=Qt(t),r=Bt.EMPTY_NODE.updateChild(this.indexPath_,n);return new _t(e,r)},e.prototype.maxPost=function(){var t=Bt.EMPTY_NODE.updateChild(this.indexPath_,Ht);return new _t(x,t)},e.prototype.toString=function(){return this.indexPath_.slice().join("/")},e}(bt),$t=function(){function t(t,e,n){this.node_=t,this.ref_=e,this.index_=n}return t.prototype.val=function(){return s.validateArgCount("DataSnapshot.val",0,0,arguments.length),this.node_.val()},t.prototype.exportVal=function(){return s.validateArgCount("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},t.prototype.toJSON=function(){return s.validateArgCount("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},t.prototype.exists=function(){return s.validateArgCount("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},t.prototype.child=function(e){s.validateArgCount("DataSnapshot.child",0,1,arguments.length),e=String(e),lt("DataSnapshot.child",1,e,!1);var n=new B(e),r=this.ref_.child(n);return new t(this.node_.getChild(n),r,Pt)},t.prototype.hasChild=function(t){s.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),lt("DataSnapshot.hasChild",1,t,!1);var e=new B(t);return!this.node_.getChild(e).isEmpty()},t.prototype.getPriority=function(){return s.validateArgCount("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},t.prototype.forEach=function(e){var n=this;if(s.validateArgCount("DataSnapshot.forEach",1,1,arguments.length),s.validateCallback("DataSnapshot.forEach",1,e,!1),this.node_.isLeafNode())return!1;var r=this.node_;return!!r.forEachChild(this.index_,function(r,i){return e(new t(i,n.ref_.child(r),Pt))})},t.prototype.hasChildren=function(){return s.validateArgCount("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(t.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!0,configurable:!0}),t.prototype.numChildren=function(){return s.validateArgCount("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},t.prototype.getRef=function(){return s.validateArgCount("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),t}(),Jt=function(){function t(t,e,n,r){this.eventType=t,this.eventRegistration=e,this.snapshot=n,this.prevName=r}return t.prototype.getPath=function(){var t=this.snapshot.getRef();return"value"===this.eventType?t.path:t.getParent().path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+s.stringify(this.snapshot.exportVal())},t}(),Zt=function(){function t(t,e,n){this.eventRegistration=t,this.error=e,this.path=n}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return"cancel"},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path.toString()+":cancel"},t}(),te=function(){function t(t,e,n){this.callback_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){return"value"===t},t.prototype.createEvent=function(t,e){var n=e.getQueryParams().getIndex();return new Jt("value",this,new $t(t.snapshotNode,e.getRef(),n))},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){s.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callback_;return function(){r.call(e,t.snapshot)}},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new Zt(this,t,e):null},t.prototype.matches=function(e){return e instanceof t&&(!e.callback_||!this.callback_||e.callback_===this.callback_&&e.context_===this.context_)},t.prototype.hasAnyCallback=function(){return null!==this.callback_},t}(),ee=function(){function t(t,e,n){this.callbacks_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){var e="children_added"===t?"child_added":t;return e="children_removed"===e?"child_removed":e,s.contains(this.callbacks_,e)},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new Zt(this,t,e):null},t.prototype.createEvent=function(t,e){s.assert(null!=t.childName,"Child events should have a childName.");var n=e.getRef().child(t.childName),r=e.getQueryParams().getIndex();return new Jt(t.type,this,new $t(t.snapshotNode,n,r),t.prevName)},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){s.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callbacks_[t.eventType];return function(){r.call(e,t.snapshot,t.prevName)}},t.prototype.matches=function(e){if(e instanceof t){if(!this.callbacks_||!e.callbacks_)return!0;if(this.context_===e.context_){var n=s.getCount(e.callbacks_);if(n===s.getCount(this.callbacks_)){if(1===n){var r=s.getAnyKey(e.callbacks_),i=s.getAnyKey(this.callbacks_);return i===r&&(!e.callbacks_[r]||!this.callbacks_[i]||e.callbacks_[r]===this.callbacks_[i])}return s.every(this.callbacks_,function(t,n){return e.callbacks_[t]===n})}}}return!1},t.prototype.hasAnyCallback=function(){return null!==this.callbacks_},t}(),ne=function(){function t(t,e,n,r){this.repo=t,this.path=e,this.queryParams_=n,this.orderByCalled_=r}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return s.assert(Gt,"Reference.ts has not been loaded"),Gt},set:function(t){Gt=t},enumerable:!0,configurable:!0}),t.validateQueryEndpoints_=function(t){var e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===Et){var r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",o="Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.";if(t.hasStart()){if(t.getIndexStartName()!=A)throw new Error(r);if("string"!==typeof e)throw new Error(o)}if(t.hasEnd()){if(t.getIndexEndName()!=x)throw new Error(r);if("string"!==typeof n)throw new Error(o)}}else if(t.getIndex()===Pt){if(null!=e&&!it(e)||null!=n&&!it(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(s.assert(t.getIndex()instanceof Yt||t.getIndex()===Xt,"unknown index type."),null!=e&&"object"===i(e)||null!=n&&"object"===i(n))throw new Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},t.validateLimit_=function(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},t.prototype.validateNoPreviousOrderByCall_=function(t){if(!0===this.orderByCalled_)throw new Error(t+": You can't combine multiple orderBy calls.")},t.prototype.getQueryParams=function(){return this.queryParams_},t.prototype.getRef=function(){return s.validateArgCount("Query.ref",0,0,arguments.length),new t.__referenceConstructor(this.repo,this.path)},t.prototype.on=function(e,n,r,i){s.validateArgCount("Query.on",2,4,arguments.length),ct("Query.on",1,e,!1),s.validateCallback("Query.on",2,n,!1);var o=t.getCancelAndContextArgs_("Query.on",r,i);if("value"===e)this.onValueEvent(n,o.cancel,o.context);else{var a={};a[e]=n,this.onChildEvent(a,o.cancel,o.context)}return n},t.prototype.onValueEvent=function(t,e,n){var r=new te(t,e||null,n||null);this.repo.addEventCallbackForQuery(this,r)},t.prototype.onChildEvent=function(t,e,n){var r=new ee(t,e,n);this.repo.addEventCallbackForQuery(this,r)},t.prototype.off=function(t,e,n){s.validateArgCount("Query.off",0,3,arguments.length),ct("Query.off",1,t,!0),s.validateCallback("Query.off",2,e,!0),s.validateContextObject("Query.off",3,n,!0);var r=null,i=null;if("value"===t){var o=e||null;r=new te(o,null,n||null)}else t&&(e&&((i={})[t]=e),r=new ee(i,null,n||null));this.repo.removeEventCallbackForQuery(this,r)},t.prototype.once=function(e,n,r,i){var o=this;s.validateArgCount("Query.once",1,4,arguments.length),ct("Query.once",1,e,!1),s.validateCallback("Query.once",2,n,!0);var a=t.getCancelAndContextArgs_("Query.once",r,i),u=!0,c=new s.Deferred;c.promise.catch(function(){});var h=function t(r){u&&(u=!1,o.off(e,t),n&&n.bind(a.context)(r),c.resolve(r))};return this.on(e,h,function(t){o.off(e,h),a.cancel&&a.cancel.bind(a.context)(t),c.reject(t)}),c.promise},t.prototype.limitToFirst=function(e){if(s.validateArgCount("Query.limitToFirst",1,1,arguments.length),"number"!==typeof e||Math.floor(e)!==e||e<=0)throw new Error("Query.limitToFirst: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,this.queryParams_.limitToFirst(e),this.orderByCalled_)},t.prototype.limitToLast=function(e){if(s.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!==typeof e||Math.floor(e)!==e||e<=0)throw new Error("Query.limitToLast: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,this.queryParams_.limitToLast(e),this.orderByCalled_)},t.prototype.orderByChild=function(e){if(s.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===e)throw new Error('Query.orderByChild: "$key" is invalid.  Use Query.orderByKey() instead.');if("$priority"===e)throw new Error('Query.orderByChild: "$priority" is invalid.  Use Query.orderByPriority() instead.');if("$value"===e)throw new Error('Query.orderByChild: "$value" is invalid.  Use Query.orderByValue() instead.');lt("Query.orderByChild",1,e,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new B(e);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path.  Use Query.orderByValue() instead.");var r=new Yt(n),i=this.queryParams_.orderBy(r);return t.validateQueryEndpoints_(i),new t(this.repo,this.path,i,!0)},t.prototype.orderByKey=function(){s.validateArgCount("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var e=this.queryParams_.orderBy(Et);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByPriority=function(){s.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var e=this.queryParams_.orderBy(Pt);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByValue=function(){s.validateArgCount("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var e=this.queryParams_.orderBy(Xt);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.startAt=function(e,n){void 0===e&&(e=null),s.validateArgCount("Query.startAt",0,2,arguments.length),ot("Query.startAt",1,e,this.path,!0),ht("Query.startAt",2,n,!0);var r=this.queryParams_.startAt(e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasStart())throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===e&&(e=null,n=null),new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.endAt=function(e,n){void 0===e&&(e=null),s.validateArgCount("Query.endAt",0,2,arguments.length),ot("Query.endAt",1,e,this.path,!0),ht("Query.endAt",2,n,!0);var r=this.queryParams_.endAt(e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.equalTo=function(t,e){if(s.validateArgCount("Query.equalTo",1,2,arguments.length),ot("Query.equalTo",1,t,this.path,!1),ht("Query.equalTo",2,e,!0),this.queryParams_.hasStart())throw new Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.queryParams_.hasEnd())throw new Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(t,e).endAt(t,e)},t.prototype.toString=function(){return s.validateArgCount("Query.toString",0,0,arguments.length),this.repo.toString()+this.path.toUrlEncodedString()},t.prototype.toJSON=function(){return s.validateArgCount("Query.toJSON",0,1,arguments.length),this.toString()},t.prototype.queryObject=function(){return this.queryParams_.getQueryObject()},t.prototype.queryIdentifier=function(){var t=this.queryObject(),e=D(t);return"{}"===e?"default":e},t.prototype.isEqual=function(e){if(s.validateArgCount("Query.isEqual",1,1,arguments.length),!(e instanceof t)){var n="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(n)}var r=this.repo===e.repo,i=this.path.equals(e.path),o=this.queryIdentifier()===e.queryIdentifier();return r&&i&&o},t.getCancelAndContextArgs_=function(t,e,n){var r={cancel:null,context:null};if(e&&n)r.cancel=e,s.validateCallback(t,3,r.cancel,!0),r.context=n,s.validateContextObject(t,4,r.context,!0);else if(e)if("object"===i(e)&&null!==e)r.context=e;else{if("function"!==typeof e)throw new Error(s.errorPrefix(t,3,!0)+" must either be a cancel callback or a context object.");r.cancel=e}return r},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),t}(),re=function(){function t(){this.set={}}return t.prototype.add=function(t,e){this.set[t]=null===e||e},t.prototype.contains=function(t){return s.contains(this.set,t)},t.prototype.get=function(t){return this.contains(t)?this.set[t]:void 0},t.prototype.remove=function(t){delete this.set[t]},t.prototype.clear=function(){this.set={}},t.prototype.isEmpty=function(){return s.isEmpty(this.set)},t.prototype.count=function(){return s.getCount(this.set)},t.prototype.each=function(t){s.forEach(this.set,function(e,n){return t(e,n)})},t.prototype.keys=function(){var t=[];return s.forEach(this.set,function(e){t.push(e)}),t},t}(),ie=function(){function t(){this.value_=null,this.children_=null}return t.prototype.find=function(t){if(null!=this.value_)return this.value_.getChild(t);if(t.isEmpty()||null==this.children_)return null;var e=t.getFront();return t=t.popFront(),this.children_.contains(e)?this.children_.get(e).find(t):null},t.prototype.remember=function(e,n){if(e.isEmpty())this.value_=n,this.children_=null;else if(null!==this.value_)this.value_=this.value_.updateChild(e,n);else{null==this.children_&&(this.children_=new re);var r=e.getFront();this.children_.contains(r)||this.children_.add(r,new t);var i=this.children_.get(r);e=e.popFront(),i.remember(e,n)}},t.prototype.forget=function(t){if(t.isEmpty())return this.value_=null,this.children_=null,!0;if(null!==this.value_){if(this.value_.isLeafNode())return!1;var e=this.value_;this.value_=null;var n=this;return e.forEachChild(Pt,function(t,e){n.remember(new B(t),e)}),this.forget(t)}if(null!==this.children_){var r=t.getFront();if(t=t.popFront(),this.children_.contains(r))this.children_.get(r).forget(t)&&this.children_.remove(r);return!!this.children_.isEmpty()&&(this.children_=null,!0)}return!0},t.prototype.forEachTree=function(t,e){null!==this.value_?e(t,this.value_):this.forEachChild(function(n,r){var i=new B(t.toString()+"/"+n);r.forEachTree(i,e)})},t.prototype.forEachChild=function(t){null!==this.children_&&this.children_.each(function(e,n){t(e,n)})},t}(),oe=function(t,e){return t&&"object"===i(t)?(s.assert(".sv"in t,"Unexpected leaf node or priority contents"),e[t[".sv"]]):t},ae=function t(e,n){var r,i=e.getPriority().val(),o=oe(i,n);if(e.isLeafNode()){var a=e,s=oe(a.getValue(),n);return s!==a.getValue()||o!==a.getPriority().val()?new Ot(s,Qt(o)):e}var u=e;return r=u,o!==u.getPriority().val()&&(r=r.updatePriority(new Ot(o))),u.forEachChild(Pt,function(e,i){var o=t(i,n);o!==i&&(r=r.updateImmediateChild(e,o))}),r};!function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(zt||(zt={}));var se,ue,ce=function(){function t(t,e,n,r){this.fromUser=t,this.fromServer=e,this.queryId=n,this.tagged=r,s.assert(!r||e,"Tagged queries must be from server.")}return t.User=new t(!0,!1,null,!1),t.Server=new t(!1,!0,null,!1),t.forServerTaggedQuery=function(e){return new t(!1,!0,e,!0)},t}(),he=function(){function t(t,e,n){this.path=t,this.affectedTree=e,this.revert=n,this.type=zt.ACK_USER_WRITE,this.source=ce.User}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){if(null!=this.affectedTree.value)return s.assert(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new B(e));return new t(B.Empty,n,this.revert)}return s.assert(this.path.getFront()===e,"operationForChild called for unrelated child."),new t(this.path.popFront(),this.affectedTree,this.revert)},t}(),le=function(){return se||(se=new Lt(k)),se},fe=function(){function t(t,e){void 0===e&&(e=le()),this.value=t,this.children=e}return t.fromObject=function(e){var n=t.Empty;return s.forEach(e,function(t,e){n=n.set(new B(t),e)}),n},t.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},t.prototype.findRootMostMatchingPathAndValue=function(t,e){if(null!=this.value&&e(this.value))return{path:B.Empty,value:this.value};if(t.isEmpty())return null;var n=t.getFront(),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(t.popFront(),e);return null!=i?{path:new B(n).child(i.path),value:i.value}:null}return null},t.prototype.findRootMostValueAndPath=function(t){return this.findRootMostMatchingPathAndValue(t,function(){return!0})},t.prototype.subtree=function(e){if(e.isEmpty())return this;var n=e.getFront(),r=this.children.get(n);return null!==r?r.subtree(e.popFront()):t.Empty},t.prototype.set=function(e,n){if(e.isEmpty())return new t(n,this.children);var r=e.getFront(),i=(this.children.get(r)||t.Empty).set(e.popFront(),n),o=this.children.insert(r,i);return new t(this.value,o)},t.prototype.remove=function(e){if(e.isEmpty())return this.children.isEmpty()?t.Empty:new t(null,this.children);var n=e.getFront(),r=this.children.get(n);if(r){var i=r.remove(e.popFront()),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?t.Empty:new t(this.value,o)}return this},t.prototype.get=function(t){if(t.isEmpty())return this.value;var e=t.getFront(),n=this.children.get(e);return n?n.get(t.popFront()):null},t.prototype.setTree=function(e,n){if(e.isEmpty())return n;var r=e.getFront(),i=(this.children.get(r)||t.Empty).setTree(e.popFront(),n),o=void 0;return o=i.isEmpty()?this.children.remove(r):this.children.insert(r,i),new t(this.value,o)},t.prototype.fold=function(t){return this.fold_(B.Empty,t)},t.prototype.fold_=function(t,e){var n={};return this.children.inorderTraversal(function(r,i){n[r]=i.fold_(t.child(r),e)}),e(t,this.value,n)},t.prototype.findOnPath=function(t,e){return this.findOnPath_(t,B.Empty,e)},t.prototype.findOnPath_=function(t,e,n){var r=!!this.value&&n(e,this.value);if(r)return r;if(t.isEmpty())return null;var i=t.getFront(),o=this.children.get(i);return o?o.findOnPath_(t.popFront(),e.child(i),n):null},t.prototype.foreachOnPath=function(t,e){return this.foreachOnPath_(t,B.Empty,e)},t.prototype.foreachOnPath_=function(e,n,r){if(e.isEmpty())return this;this.value&&r(n,this.value);var i=e.getFront(),o=this.children.get(i);return o?o.foreachOnPath_(e.popFront(),n.child(i),r):t.Empty},t.prototype.foreach=function(t){this.foreach_(B.Empty,t)},t.prototype.foreach_=function(t,e){this.children.inorderTraversal(function(n,r){r.foreach_(t.child(n),e)}),this.value&&e(t,this.value)},t.prototype.foreachChild=function(t){this.children.inorderTraversal(function(e,n){n.value&&t(e,n.value)})},t.Empty=new t(null),t}(),pe=function(){function t(t,e){this.source=t,this.path=e,this.type=zt.LISTEN_COMPLETE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,B.Empty):new t(this.source,this.path.popFront())},t}(),de=function(){function t(t,e,n){this.source=t,this.path=e,this.snap=n,this.type=zt.OVERWRITE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,B.Empty,this.snap.getImmediateChild(e)):new t(this.source,this.path.popFront(),this.snap)},t}(),ye=function(){function t(t,e,n){this.source=t,this.path=e,this.children=n,this.type=zt.MERGE}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){var n=this.children.subtree(new B(e));return n.isEmpty()?null:n.value?new de(this.source,B.Empty,n.value):new t(this.source,B.Empty,n)}return s.assert(this.path.getFront()===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,this.path.popFront(),this.children)},t.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},t}(),ve=function(){function t(t,e,n){this.node_=t,this.fullyInitialized_=e,this.filtered_=n}return t.prototype.isFullyInitialized=function(){return this.fullyInitialized_},t.prototype.isFiltered=function(){return this.filtered_},t.prototype.isCompleteForPath=function(t){if(t.isEmpty())return this.isFullyInitialized()&&!this.filtered_;var e=t.getFront();return this.isCompleteForChild(e)},t.prototype.isCompleteForChild=function(t){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(t)},t.prototype.getNode=function(){return this.node_},t}(),ge=function(){function t(t,e){this.eventCache_=t,this.serverCache_=e}return t.prototype.updateEventSnap=function(e,n,r){return new t(new ve(e,n,r),this.serverCache_)},t.prototype.updateServerSnap=function(e,n,r){return new t(this.eventCache_,new ve(e,n,r))},t.prototype.getEventCache=function(){return this.eventCache_},t.prototype.getCompleteEventSnap=function(){return this.eventCache_.isFullyInitialized()?this.eventCache_.getNode():null},t.prototype.getServerCache=function(){return this.serverCache_},t.prototype.getCompleteServerSnap=function(){return this.serverCache_.isFullyInitialized()?this.serverCache_.getNode():null},t.Empty=new t(new ve(Bt.EMPTY_NODE,!1,!1),new ve(Bt.EMPTY_NODE,!1,!1)),t}(),me=function(){function t(t,e,n,r,i){this.type=t,this.snapshotNode=e,this.childName=n,this.oldSnap=r,this.prevName=i}return t.valueChange=function(e){return new t(t.VALUE,e)},t.childAddedChange=function(e,n){return new t(t.CHILD_ADDED,n,e)},t.childRemovedChange=function(e,n){return new t(t.CHILD_REMOVED,n,e)},t.childChangedChange=function(e,n,r){return new t(t.CHILD_CHANGED,n,e,r)},t.childMovedChange=function(e,n){return new t(t.CHILD_MOVED,n,e)},t.CHILD_ADDED="child_added",t.CHILD_REMOVED="child_removed",t.CHILD_CHANGED="child_changed",t.CHILD_MOVED="child_moved",t.VALUE="value",t}(),_e=function(){function t(t){this.index_=t}return t.prototype.updateChild=function(t,e,n,r,i,o){s.assert(t.isIndexed(this.index_),"A node must be indexed if only a child is updated");var a=t.getImmediateChild(e);return a.getChild(r).equals(n.getChild(r))&&a.isEmpty()==n.isEmpty()?t:(null!=o&&(n.isEmpty()?t.hasChild(e)?o.trackChildChange(me.childRemovedChange(e,a)):s.assert(t.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?o.trackChildChange(me.childAddedChange(e,n)):o.trackChildChange(me.childChangedChange(e,n,a))),t.isLeafNode()&&n.isEmpty()?t:t.updateImmediateChild(e,n).withIndex(this.index_))},t.prototype.updateFullNode=function(t,e,n){return null!=n&&(t.isLeafNode()||t.forEachChild(Pt,function(t,r){e.hasChild(t)||n.trackChildChange(me.childRemovedChange(t,r))}),e.isLeafNode()||e.forEachChild(Pt,function(e,r){if(t.hasChild(e)){var i=t.getImmediateChild(e);i.equals(r)||n.trackChildChange(me.childChangedChange(e,r,i))}else n.trackChildChange(me.childAddedChange(e,r))})),e.withIndex(this.index_)},t.prototype.updatePriority=function(t,e){return t.isEmpty()?Bt.EMPTY_NODE:t.updatePriority(e)},t.prototype.filtersNodes=function(){return!1},t.prototype.getIndexedFilter=function(){return this},t.prototype.getIndex=function(){return this.index_},t}(),be=function(){function t(){this.changeMap_={}}return t.prototype.trackChildChange=function(t){var e=t.type,n=t.childName;s.assert(e==me.CHILD_ADDED||e==me.CHILD_CHANGED||e==me.CHILD_REMOVED,"Only child changes supported for tracking"),s.assert(".priority"!==n,"Only non-priority child changes can be tracked.");var r=s.safeGet(this.changeMap_,n);if(r){var i=r.type;if(e==me.CHILD_ADDED&&i==me.CHILD_REMOVED)this.changeMap_[n]=me.childChangedChange(n,t.snapshotNode,r.snapshotNode);else if(e==me.CHILD_REMOVED&&i==me.CHILD_ADDED)delete this.changeMap_[n];else if(e==me.CHILD_REMOVED&&i==me.CHILD_CHANGED)this.changeMap_[n]=me.childRemovedChange(n,r.oldSnap);else if(e==me.CHILD_CHANGED&&i==me.CHILD_ADDED)this.changeMap_[n]=me.childAddedChange(n,t.snapshotNode);else{if(e!=me.CHILD_CHANGED||i!=me.CHILD_CHANGED)throw s.assertionError("Illegal combination of changes: "+t+" occurred after "+r);this.changeMap_[n]=me.childChangedChange(n,t.snapshotNode,r.oldSnap)}}else this.changeMap_[n]=t},t.prototype.getChanges=function(){return s.getValues(this.changeMap_)},t}(),we=new(function(){function t(){}return t.prototype.getCompleteChild=function(t){return null},t.prototype.getChildAfterChild=function(t,e,n){return null},t}()),Ee=function(){function t(t,e,n){void 0===n&&(n=null),this.writes_=t,this.viewCache_=e,this.optCompleteServerCache_=n}return t.prototype.getCompleteChild=function(t){var e=this.viewCache_.getEventCache();if(e.isCompleteForChild(t))return e.getNode().getImmediateChild(t);var n=null!=this.optCompleteServerCache_?new ve(this.optCompleteServerCache_,!0,!1):this.viewCache_.getServerCache();return this.writes_.calcCompleteChild(t,n)},t.prototype.getChildAfterChild=function(t,e,n){var r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:this.viewCache_.getCompleteServerSnap(),i=this.writes_.calcIndexedSlice(r,e,1,n,t);return 0===i.length?null:i[0]},t}(),Se=function(t,e){this.viewCache=t,this.changes=e},Ce=function(){function t(t){this.filter_=t}return t.prototype.assertIndexed=function(t){s.assert(t.getEventCache().getNode().isIndexed(this.filter_.getIndex()),"Event snap not indexed"),s.assert(t.getServerCache().getNode().isIndexed(this.filter_.getIndex()),"Server snap not indexed")},t.prototype.applyOperation=function(e,n,r,i){var o,a,u=new be;if(n.type===zt.OVERWRITE){var c=n;c.source.fromUser?o=this.applyUserOverwrite_(e,c.path,c.snap,r,i,u):(s.assert(c.source.fromServer,"Unknown source."),a=c.source.tagged||e.getServerCache().isFiltered()&&!c.path.isEmpty(),o=this.applyServerOverwrite_(e,c.path,c.snap,r,i,a,u))}else if(n.type===zt.MERGE){var h=n;h.source.fromUser?o=this.applyUserMerge_(e,h.path,h.children,r,i,u):(s.assert(h.source.fromServer,"Unknown source."),a=h.source.tagged||e.getServerCache().isFiltered(),o=this.applyServerMerge_(e,h.path,h.children,r,i,a,u))}else if(n.type===zt.ACK_USER_WRITE){var l=n;o=l.revert?this.revertUserWrite_(e,l.path,r,i,u):this.ackUserWrite_(e,l.path,l.affectedTree,r,i,u)}else{if(n.type!==zt.LISTEN_COMPLETE)throw s.assertionError("Unknown operation type: "+n.type);o=this.listenComplete_(e,n.path,r,u)}var f=u.getChanges();return t.maybeAddValueEvent_(e,o,f),new Se(o,f)},t.maybeAddValueEvent_=function(t,e,n){var r=e.getEventCache();if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=t.getCompleteEventSnap();(n.length>0||!t.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(me.valueChange(e.getCompleteEventSnap()))}},t.prototype.generateEventCacheAfterServerEvent_=function(t,e,n,r,i){var o=t.getEventCache();if(null!=n.shadowingWrite(e))return t;var a=void 0,u=void 0;if(e.isEmpty())if(s.assert(t.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),t.getServerCache().isFiltered()){var c=t.getCompleteServerSnap(),h=c instanceof Bt?c:Bt.EMPTY_NODE,l=n.calcCompleteEventChildren(h);a=this.filter_.updateFullNode(t.getEventCache().getNode(),l,i)}else{var f=n.calcCompleteEventCache(t.getCompleteServerSnap());a=this.filter_.updateFullNode(t.getEventCache().getNode(),f,i)}else{var p=e.getFront();if(".priority"==p){s.assert(1==e.getLength(),"Can't have a priority with additional path components");var d=o.getNode();u=t.getServerCache().getNode();var y=n.calcEventCacheAfterServerOverwrite(e,d,u);a=null!=y?this.filter_.updatePriority(d,y):o.getNode()}else{var v=e.popFront(),g=void 0;if(o.isCompleteForChild(p)){u=t.getServerCache().getNode();var m=n.calcEventCacheAfterServerOverwrite(e,o.getNode(),u);g=null!=m?o.getNode().getImmediateChild(p).updateChild(v,m):o.getNode().getImmediateChild(p)}else g=n.calcCompleteChild(p,t.getServerCache());a=null!=g?this.filter_.updateChild(o.getNode(),p,g,v,r,i):o.getNode()}}return t.updateEventSnap(a,o.isFullyInitialized()||e.isEmpty(),this.filter_.filtersNodes())},t.prototype.applyServerOverwrite_=function(t,e,n,r,i,o,a){var s,u=t.getServerCache(),c=o?this.filter_:this.filter_.getIndexedFilter();if(e.isEmpty())s=c.updateFullNode(u.getNode(),n,null);else if(c.filtersNodes()&&!u.isFiltered()){var h=u.getNode().updateChild(e,n);s=c.updateFullNode(u.getNode(),h,null)}else{var l=e.getFront();if(!u.isCompleteForPath(e)&&e.getLength()>1)return t;var f=e.popFront(),p=u.getNode().getImmediateChild(l).updateChild(f,n);s=".priority"==l?c.updatePriority(u.getNode(),p):c.updateChild(u.getNode(),l,p,f,we,null)}var d=t.updateServerSnap(s,u.isFullyInitialized()||e.isEmpty(),c.filtersNodes()),y=new Ee(r,d,i);return this.generateEventCacheAfterServerEvent_(d,e,r,y,a)},t.prototype.applyUserOverwrite_=function(t,e,n,r,i,o){var a,s,u=t.getEventCache(),c=new Ee(r,t,i);if(e.isEmpty())s=this.filter_.updateFullNode(t.getEventCache().getNode(),n,o),a=t.updateEventSnap(s,!0,this.filter_.filtersNodes());else{var h=e.getFront();if(".priority"===h)s=this.filter_.updatePriority(t.getEventCache().getNode(),n),a=t.updateEventSnap(s,u.isFullyInitialized(),u.isFiltered());else{var l=e.popFront(),f=u.getNode().getImmediateChild(h),p=void 0;if(l.isEmpty())p=n;else{var d=c.getCompleteChild(h);p=null!=d?".priority"===l.getBack()&&d.getChild(l.parent()).isEmpty()?d:d.updateChild(l,n):Bt.EMPTY_NODE}if(f.equals(p))a=t;else{var y=this.filter_.updateChild(u.getNode(),h,p,l,c,o);a=t.updateEventSnap(y,u.isFullyInitialized(),this.filter_.filtersNodes())}}}return a},t.cacheHasChild_=function(t,e){return t.getEventCache().isCompleteForChild(e)},t.prototype.applyUserMerge_=function(e,n,r,i,o,a){var s=this,u=e;return r.foreach(function(r,c){var h=n.child(r);t.cacheHasChild_(e,h.getFront())&&(u=s.applyUserOverwrite_(u,h,c,i,o,a))}),r.foreach(function(r,c){var h=n.child(r);t.cacheHasChild_(e,h.getFront())||(u=s.applyUserOverwrite_(u,h,c,i,o,a))}),u},t.prototype.applyMerge_=function(t,e){return e.foreach(function(e,n){t=t.updateChild(e,n)}),t},t.prototype.applyServerMerge_=function(t,e,n,r,i,o,a){var s=this;if(t.getServerCache().getNode().isEmpty()&&!t.getServerCache().isFullyInitialized())return t;var u,c=t;u=e.isEmpty()?n:fe.Empty.setTree(e,n);var h=t.getServerCache().getNode();return u.children.inorderTraversal(function(e,n){if(h.hasChild(e)){var u=t.getServerCache().getNode().getImmediateChild(e),l=s.applyMerge_(u,n);c=s.applyServerOverwrite_(c,new B(e),l,r,i,o,a)}}),u.children.inorderTraversal(function(e,n){var u=!t.getServerCache().isCompleteForChild(e)&&null==n.value;if(!h.hasChild(e)&&!u){var l=t.getServerCache().getNode().getImmediateChild(e),f=s.applyMerge_(l,n);c=s.applyServerOverwrite_(c,new B(e),f,r,i,o,a)}}),c},t.prototype.ackUserWrite_=function(t,e,n,r,i,o){if(null!=r.shadowingWrite(e))return t;var a=t.getServerCache().isFiltered(),s=t.getServerCache();if(null!=n.value){if(e.isEmpty()&&s.isFullyInitialized()||s.isCompleteForPath(e))return this.applyServerOverwrite_(t,e,s.getNode().getChild(e),r,i,a,o);if(e.isEmpty()){var u=fe.Empty;return s.getNode().forEachChild(Et,function(t,e){u=u.set(new B(t),e)}),this.applyServerMerge_(t,e,u,r,i,a,o)}return t}var c=fe.Empty;return n.foreach(function(t,n){var r=e.child(t);s.isCompleteForPath(r)&&(c=c.set(t,s.getNode().getChild(r)))}),this.applyServerMerge_(t,e,c,r,i,a,o)},t.prototype.listenComplete_=function(t,e,n,r){var i=t.getServerCache(),o=t.updateServerSnap(i.getNode(),i.isFullyInitialized()||e.isEmpty(),i.isFiltered());return this.generateEventCacheAfterServerEvent_(o,e,n,we,r)},t.prototype.revertUserWrite_=function(t,e,n,r,i){var o;if(null!=n.shadowingWrite(e))return t;var a=new Ee(n,t,r),u=t.getEventCache().getNode(),c=void 0;if(e.isEmpty()||".priority"===e.getFront()){var h=void 0;if(t.getServerCache().isFullyInitialized())h=n.calcCompleteEventCache(t.getCompleteServerSnap());else{var l=t.getServerCache().getNode();s.assert(l instanceof Bt,"serverChildren would be complete if leaf node"),h=n.calcCompleteEventChildren(l)}h=h,c=this.filter_.updateFullNode(u,h,i)}else{var f=e.getFront(),p=n.calcCompleteChild(f,t.getServerCache());null==p&&t.getServerCache().isCompleteForChild(f)&&(p=u.getImmediateChild(f)),(c=null!=p?this.filter_.updateChild(u,f,p,e.popFront(),a,i):t.getEventCache().getNode().hasChild(f)?this.filter_.updateChild(u,f,Bt.EMPTY_NODE,e.popFront(),a,i):u).isEmpty()&&t.getServerCache().isFullyInitialized()&&(o=n.calcCompleteEventCache(t.getCompleteServerSnap())).isLeafNode()&&(c=this.filter_.updateFullNode(c,o,i))}return o=t.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(B.Empty),t.updateEventSnap(c,o,this.filter_.filtersNodes())},t}(),Te=function(){function t(t){this.query_=t,this.index_=this.query_.getQueryParams().getIndex()}return t.prototype.generateEventsForChanges=function(t,e,n){var r=this,i=[],o=[];return t.forEach(function(t){t.type===me.CHILD_CHANGED&&r.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&o.push(me.childMovedChange(t.childName,t.snapshotNode))}),this.generateEventsForType_(i,me.CHILD_REMOVED,t,n,e),this.generateEventsForType_(i,me.CHILD_ADDED,t,n,e),this.generateEventsForType_(i,me.CHILD_MOVED,o,n,e),this.generateEventsForType_(i,me.CHILD_CHANGED,t,n,e),this.generateEventsForType_(i,me.VALUE,t,n,e),i},t.prototype.generateEventsForType_=function(t,e,n,r,i){var o=this,a=n.filter(function(t){return t.type===e});a.sort(this.compareChanges_.bind(this)),a.forEach(function(e){var n=o.materializeSingleChange_(e,i);r.forEach(function(r){r.respondsTo(e.type)&&t.push(r.createEvent(n,o.query_))})})},t.prototype.materializeSingleChange_=function(t,e){return"value"===t.type||"child_removed"===t.type?t:(t.prevName=e.getPredecessorChildName(t.childName,t.snapshotNode,this.index_),t)},t.prototype.compareChanges_=function(t,e){if(null==t.childName||null==e.childName)throw s.assertionError("Should only compare child_ events.");var n=new _t(t.childName,t.snapshotNode),r=new _t(e.childName,e.snapshotNode);return this.index_.compare(n,r)},t}(),Ie=function(){function t(t,e){this.query_=t,this.eventRegistrations_=[];var n=this.query_.getQueryParams(),r=new _e(n.getIndex()),i=n.getNodeFilter();this.processor_=new Ce(i);var o=e.getServerCache(),a=e.getEventCache(),s=r.updateFullNode(Bt.EMPTY_NODE,o.getNode(),null),u=i.updateFullNode(Bt.EMPTY_NODE,a.getNode(),null),c=new ve(s,o.isFullyInitialized(),r.filtersNodes()),h=new ve(u,a.isFullyInitialized(),i.filtersNodes());this.viewCache_=new ge(h,c),this.eventGenerator_=new Te(this.query_)}return t.prototype.getQuery=function(){return this.query_},t.prototype.getServerCache=function(){return this.viewCache_.getServerCache().getNode()},t.prototype.getCompleteServerCache=function(t){var e=this.viewCache_.getCompleteServerSnap();return e&&(this.query_.getQueryParams().loadsAllData()||!t.isEmpty()&&!e.getImmediateChild(t.getFront()).isEmpty())?e.getChild(t):null},t.prototype.isEmpty=function(){return 0===this.eventRegistrations_.length},t.prototype.addEventRegistration=function(t){this.eventRegistrations_.push(t)},t.prototype.removeEventRegistration=function(t,e){var n=[];if(e){s.assert(null==t,"A cancel should cancel all event registrations.");var r=this.query_.path;this.eventRegistrations_.forEach(function(t){e=e;var i=t.createCancelEvent(e,r);i&&n.push(i)})}if(t){for(var i=[],o=0;o<this.eventRegistrations_.length;++o){var a=this.eventRegistrations_[o];if(a.matches(t)){if(t.hasAnyCallback()){i=i.concat(this.eventRegistrations_.slice(o+1));break}}else i.push(a)}this.eventRegistrations_=i}else this.eventRegistrations_=[];return n},t.prototype.applyOperation=function(t,e,n){t.type===zt.MERGE&&null!==t.source.queryId&&(s.assert(this.viewCache_.getCompleteServerSnap(),"We should always have a full cache before handling merges"),s.assert(this.viewCache_.getCompleteEventSnap(),"Missing event cache, even though we have a server cache"));var r=this.viewCache_,i=this.processor_.applyOperation(r,t,e,n);return this.processor_.assertIndexed(i.viewCache),s.assert(i.viewCache.getServerCache().isFullyInitialized()||!r.getServerCache().isFullyInitialized(),"Once a server snap is complete, it should never go back"),this.viewCache_=i.viewCache,this.generateEventsForChanges_(i.changes,i.viewCache.getEventCache().getNode(),null)},t.prototype.getInitialEvents=function(t){var e=this.viewCache_.getEventCache(),n=[];e.getNode().isLeafNode()||e.getNode().forEachChild(Pt,function(t,e){n.push(me.childAddedChange(t,e))});return e.isFullyInitialized()&&n.push(me.valueChange(e.getNode())),this.generateEventsForChanges_(n,e.getNode(),t)},t.prototype.generateEventsForChanges_=function(t,e,n){var r=n?[n]:this.eventRegistrations_;return this.eventGenerator_.generateEventsForChanges(t,e,r)},t}(),Ne=function(){function t(){this.views_={}}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return s.assert(ue,"Reference.ts has not been loaded"),ue},set:function(t){s.assert(!ue,"__referenceConstructor has already been defined"),ue=t},enumerable:!0,configurable:!0}),t.prototype.isEmpty=function(){return s.isEmpty(this.views_)},t.prototype.applyOperation=function(t,e,n){var r=t.source.queryId;if(null!==r){var i=s.safeGet(this.views_,r);return s.assert(null!=i,"SyncTree gave us an op for an invalid query."),i.applyOperation(t,e,n)}var o=[];return s.forEach(this.views_,function(r,i){o=o.concat(i.applyOperation(t,e,n))}),o},t.prototype.addEventRegistration=function(t,e,n,r,i){var o=t.queryIdentifier(),a=s.safeGet(this.views_,o);if(!a){var u=n.calcCompleteEventCache(i?r:null),c=!1;u?c=!0:r instanceof Bt?(u=n.calcCompleteEventChildren(r),c=!1):(u=Bt.EMPTY_NODE,c=!1);var h=new ge(new ve(u,c,!1),new ve(r,i,!1));a=new Ie(t,h),this.views_[o]=a}return a.addEventRegistration(e),a.getInitialEvents(e)},t.prototype.removeEventRegistration=function(e,n,r){var i=e.queryIdentifier(),o=[],a=[],u=this.hasCompleteView();if("default"===i){var c=this;s.forEach(this.views_,function(t,e){a=a.concat(e.removeEventRegistration(n,r)),e.isEmpty()&&(delete c.views_[t],e.getQuery().getQueryParams().loadsAllData()||o.push(e.getQuery()))})}else{var h=s.safeGet(this.views_,i);h&&(a=a.concat(h.removeEventRegistration(n,r)),h.isEmpty()&&(delete this.views_[i],h.getQuery().getQueryParams().loadsAllData()||o.push(h.getQuery())))}return u&&!this.hasCompleteView()&&o.push(new t.__referenceConstructor(e.repo,e.path)),{removed:o,events:a}},t.prototype.getQueryViews=function(){var t=this;return Object.keys(this.views_).map(function(e){return t.views_[e]}).filter(function(t){return!t.getQuery().getQueryParams().loadsAllData()})},t.prototype.getCompleteServerCache=function(t){var e=null;return s.forEach(this.views_,function(n,r){e=e||r.getCompleteServerCache(t)}),e},t.prototype.viewForQuery=function(t){if(t.getQueryParams().loadsAllData())return this.getCompleteView();var e=t.queryIdentifier();return s.safeGet(this.views_,e)},t.prototype.viewExistsForQuery=function(t){return null!=this.viewForQuery(t)},t.prototype.hasCompleteView=function(){return null!=this.getCompleteView()},t.prototype.getCompleteView=function(){return s.findValue(this.views_,function(t){return t.getQuery().getQueryParams().loadsAllData()})||null},t}(),Oe=function(){function t(t){this.writeTree_=t}return t.prototype.addWrite=function(e,n){if(e.isEmpty())return new t(new fe(n));var r=this.writeTree_.findRootMostValueAndPath(e);if(null!=r){var i=r.path,o=r.value,a=B.relativePath(i,e);return o=o.updateChild(a,n),new t(this.writeTree_.set(i,o))}var s=new fe(n);return new t(this.writeTree_.setTree(e,s))},t.prototype.addWrites=function(t,e){var n=this;return s.forEach(e,function(e,r){n=n.addWrite(t.child(e),r)}),n},t.prototype.removeWrite=function(e){return e.isEmpty()?t.Empty:new t(this.writeTree_.setTree(e,fe.Empty))},t.prototype.hasCompleteWrite=function(t){return null!=this.getCompleteNode(t)},t.prototype.getCompleteNode=function(t){var e=this.writeTree_.findRootMostValueAndPath(t);return null!=e?this.writeTree_.get(e.path).getChild(B.relativePath(e.path,t)):null},t.prototype.getCompleteChildren=function(){var t=[],e=this.writeTree_.value;return null!=e?e.isLeafNode()||e.forEachChild(Pt,function(e,n){t.push(new _t(e,n))}):this.writeTree_.children.inorderTraversal(function(e,n){null!=n.value&&t.push(new _t(e,n.value))}),t},t.prototype.childCompoundWrite=function(e){if(e.isEmpty())return this;var n=this.getCompleteNode(e);return new t(null!=n?new fe(n):this.writeTree_.subtree(e))},t.prototype.isEmpty=function(){return this.writeTree_.isEmpty()},t.prototype.apply=function(e){return t.applySubtreeWrite_(B.Empty,this.writeTree_,e)},t.Empty=new t(new fe(null)),t.applySubtreeWrite_=function(e,n,r){if(null!=n.value)return r.updateChild(e,n.value);var i=null;return n.children.inorderTraversal(function(n,o){".priority"===n?(s.assert(null!==o.value,"Priority writes must always be leaf nodes"),i=o.value):r=t.applySubtreeWrite_(e.child(n),o,r)}),r.getChild(e).isEmpty()||null===i||(r=r.updateChild(e.child(".priority"),i)),r},t}(),Ae=function(){function t(){this.visibleWrites_=Oe.Empty,this.allWrites_=[],this.lastWriteId_=-1}return t.prototype.childWrites=function(t){return new xe(t,this)},t.prototype.addOverwrite=function(t,e,n,r){s.assert(n>this.lastWriteId_,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),this.allWrites_.push({path:t,snap:e,writeId:n,visible:r}),r&&(this.visibleWrites_=this.visibleWrites_.addWrite(t,e)),this.lastWriteId_=n},t.prototype.addMerge=function(t,e,n){s.assert(n>this.lastWriteId_,"Stacking an older merge on top of newer ones"),this.allWrites_.push({path:t,children:e,writeId:n,visible:!0}),this.visibleWrites_=this.visibleWrites_.addWrites(t,e),this.lastWriteId_=n},t.prototype.getWrite=function(t){for(var e=0;e<this.allWrites_.length;e++){var n=this.allWrites_[e];if(n.writeId===t)return n}return null},t.prototype.removeWrite=function(t){var e=this,n=this.allWrites_.findIndex(function(e){return e.writeId===t});s.assert(n>=0,"removeWrite called with nonexistent writeId.");var r=this.allWrites_[n];this.allWrites_.splice(n,1);for(var i=r.visible,o=!1,a=this.allWrites_.length-1;i&&a>=0;){var u=this.allWrites_[a];u.visible&&(a>=n&&this.recordContainsPath_(u,r.path)?i=!1:r.path.contains(u.path)&&(o=!0)),a--}if(i){if(o)return this.resetTree_(),!0;if(r.snap)this.visibleWrites_=this.visibleWrites_.removeWrite(r.path);else{var c=r.children;s.forEach(c,function(t){e.visibleWrites_=e.visibleWrites_.removeWrite(r.path.child(t))})}return!0}return!1},t.prototype.getCompleteWriteData=function(t){return this.visibleWrites_.getCompleteNode(t)},t.prototype.calcCompleteEventCache=function(e,n,r,i){if(r||i){var o=this.visibleWrites_.childCompoundWrite(e);if(!i&&o.isEmpty())return n;if(i||null!=n||o.hasCompleteWrite(B.Empty)){var a=t.layerTree_(this.allWrites_,function(t){return(t.visible||i)&&(!r||!~r.indexOf(t.writeId))&&(t.path.contains(e)||e.contains(t.path))},e);c=n||Bt.EMPTY_NODE;return a.apply(c)}return null}var s=this.visibleWrites_.getCompleteNode(e);if(null!=s)return s;var u=this.visibleWrites_.childCompoundWrite(e);if(u.isEmpty())return n;if(null!=n||u.hasCompleteWrite(B.Empty)){var c=n||Bt.EMPTY_NODE;return u.apply(c)}return null},t.prototype.calcCompleteEventChildren=function(t,e){var n=Bt.EMPTY_NODE,r=this.visibleWrites_.getCompleteNode(t);if(r)return r.isLeafNode()||r.forEachChild(Pt,function(t,e){n=n.updateImmediateChild(t,e)}),n;if(e){var i=this.visibleWrites_.childCompoundWrite(t);return e.forEachChild(Pt,function(t,e){var r=i.childCompoundWrite(new B(t)).apply(e);n=n.updateImmediateChild(t,r)}),i.getCompleteChildren().forEach(function(t){n=n.updateImmediateChild(t.name,t.node)}),n}return this.visibleWrites_.childCompoundWrite(t).getCompleteChildren().forEach(function(t){n=n.updateImmediateChild(t.name,t.node)}),n},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n,r){s.assert(n||r,"Either existingEventSnap or existingServerSnap must exist");var i=t.child(e);if(this.visibleWrites_.hasCompleteWrite(i))return null;var o=this.visibleWrites_.childCompoundWrite(i);return o.isEmpty()?r.getChild(e):o.apply(r.getChild(e))},t.prototype.calcCompleteChild=function(t,e,n){var r=t.child(e),i=this.visibleWrites_.getCompleteNode(r);return null!=i?i:n.isCompleteForChild(e)?this.visibleWrites_.childCompoundWrite(r).apply(n.getNode().getImmediateChild(e)):null},t.prototype.shadowingWrite=function(t){return this.visibleWrites_.getCompleteNode(t)},t.prototype.calcIndexedSlice=function(t,e,n,r,i,o){var a,s=this.visibleWrites_.childCompoundWrite(t),u=s.getCompleteNode(B.Empty);if(null!=u)a=u;else{if(null==e)return[];a=s.apply(e)}if((a=a.withIndex(o)).isEmpty()||a.isLeafNode())return[];for(var c=[],h=o.getCompare(),l=i?a.getReverseIteratorFrom(n,o):a.getIteratorFrom(n,o),f=l.getNext();f&&c.length<r;)0!==h(f,n)&&c.push(f),f=l.getNext();return c},t.prototype.recordContainsPath_=function(t,e){return t.snap?t.path.contains(e):!!s.findKey(t.children,function(n,r){return t.path.child(r).contains(e)})},t.prototype.resetTree_=function(){this.visibleWrites_=t.layerTree_(this.allWrites_,t.DefaultFilter_,B.Empty),this.allWrites_.length>0?this.lastWriteId_=this.allWrites_[this.allWrites_.length-1].writeId:this.lastWriteId_=-1},t.DefaultFilter_=function(t){return t.visible},t.layerTree_=function(t,e,n){for(var r=Oe.Empty,i=0;i<t.length;++i){var o=t[i];if(e(o)){var a=o.path,u=void 0;if(o.snap)n.contains(a)?(u=B.relativePath(n,a),r=r.addWrite(u,o.snap)):a.contains(n)&&(u=B.relativePath(a,n),r=r.addWrite(B.Empty,o.snap.getChild(u)));else{if(!o.children)throw s.assertionError("WriteRecord should have .snap or .children");if(n.contains(a))u=B.relativePath(n,a),r=r.addWrites(u,o.children);else if(a.contains(n))if((u=B.relativePath(a,n)).isEmpty())r=r.addWrites(B.Empty,o.children);else{var c=s.safeGet(o.children,u.getFront());if(c){var h=c.getChild(u.popFront());r=r.addWrite(B.Empty,h)}}}}}return r},t}(),xe=function(){function t(t,e){this.treePath_=t,this.writeTree_=e}return t.prototype.calcCompleteEventCache=function(t,e,n){return this.writeTree_.calcCompleteEventCache(this.treePath_,t,e,n)},t.prototype.calcCompleteEventChildren=function(t){return this.writeTree_.calcCompleteEventChildren(this.treePath_,t)},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n){return this.writeTree_.calcEventCacheAfterServerOverwrite(this.treePath_,t,e,n)},t.prototype.shadowingWrite=function(t){return this.writeTree_.shadowingWrite(this.treePath_.child(t))},t.prototype.calcIndexedSlice=function(t,e,n,r,i){return this.writeTree_.calcIndexedSlice(this.treePath_,t,e,n,r,i)},t.prototype.calcCompleteChild=function(t,e){return this.writeTree_.calcCompleteChild(this.treePath_,t,e)},t.prototype.child=function(e){return new t(this.treePath_.child(e),this.writeTree_)},t}(),Pe=function(){function t(t){this.listenProvider_=t,this.syncPointTree_=fe.Empty,this.pendingWriteTree_=new Ae,this.tagToQueryMap_={},this.queryToTagMap_={}}return t.prototype.applyUserOverwrite=function(t,e,n,r){return this.pendingWriteTree_.addOverwrite(t,e,n,r),r?this.applyOperationToSyncPoints_(new de(ce.User,t,e)):[]},t.prototype.applyUserMerge=function(t,e,n){this.pendingWriteTree_.addMerge(t,e,n);var r=fe.fromObject(e);return this.applyOperationToSyncPoints_(new ye(ce.User,t,r))},t.prototype.ackUserWrite=function(t,e){void 0===e&&(e=!1);var n=this.pendingWriteTree_.getWrite(t);if(this.pendingWriteTree_.removeWrite(t)){var r=fe.Empty;return null!=n.snap?r=r.set(B.Empty,!0):s.forEach(n.children,function(t,e){r=r.set(new B(t),e)}),this.applyOperationToSyncPoints_(new he(n.path,r,e))}return[]},t.prototype.applyServerOverwrite=function(t,e){return this.applyOperationToSyncPoints_(new de(ce.Server,t,e))},t.prototype.applyServerMerge=function(t,e){var n=fe.fromObject(e);return this.applyOperationToSyncPoints_(new ye(ce.Server,t,n))},t.prototype.applyListenComplete=function(t){return this.applyOperationToSyncPoints_(new pe(ce.Server,t))},t.prototype.applyTaggedQueryOverwrite=function(e,n,r){var i=this.queryKeyForTag_(r);if(null!=i){var o=t.parseQueryKey_(i),a=o.path,s=o.queryId,u=B.relativePath(a,e),c=new de(ce.forServerTaggedQuery(s),u,n);return this.applyTaggedOperation_(a,c)}return[]},t.prototype.applyTaggedQueryMerge=function(e,n,r){var i=this.queryKeyForTag_(r);if(i){var o=t.parseQueryKey_(i),a=o.path,s=o.queryId,u=B.relativePath(a,e),c=fe.fromObject(n),h=new ye(ce.forServerTaggedQuery(s),u,c);return this.applyTaggedOperation_(a,h)}return[]},t.prototype.applyTaggedListenComplete=function(e,n){var r=this.queryKeyForTag_(n);if(r){var i=t.parseQueryKey_(r),o=i.path,a=i.queryId,s=B.relativePath(o,e),u=new pe(ce.forServerTaggedQuery(a),s);return this.applyTaggedOperation_(o,u)}return[]},t.prototype.addEventRegistration=function(e,n){var r=e.path,i=null,o=!1;this.syncPointTree_.foreachOnPath(r,function(t,e){var n=B.relativePath(t,r);i=i||e.getCompleteServerCache(n),o=o||e.hasCompleteView()});var a,u=this.syncPointTree_.get(r);(u?(o=o||u.hasCompleteView(),i=i||u.getCompleteServerCache(B.Empty)):(u=new Ne,this.syncPointTree_=this.syncPointTree_.set(r,u)),null!=i)?a=!0:(a=!1,i=Bt.EMPTY_NODE,this.syncPointTree_.subtree(r).foreachChild(function(t,e){var n=e.getCompleteServerCache(B.Empty);n&&(i=i.updateImmediateChild(t,n))}));var c=u.viewExistsForQuery(e);if(!c&&!e.getQueryParams().loadsAllData()){var h=t.makeQueryKey_(e);s.assert(!(h in this.queryToTagMap_),"View does not exist, but we have a tag");var l=t.getNextQueryTag_();this.queryToTagMap_[h]=l,this.tagToQueryMap_["_"+l]=h}var f=this.pendingWriteTree_.childWrites(r),p=u.addEventRegistration(e,n,f,i,a);if(!c&&!o){var d=u.viewForQuery(e);p=p.concat(this.setupListener_(e,d))}return p},t.prototype.removeEventRegistration=function(e,n,r){var i=this,o=e.path,a=this.syncPointTree_.get(o),s=[];if(a&&("default"===e.queryIdentifier()||a.viewExistsForQuery(e))){var u=a.removeEventRegistration(e,n,r);a.isEmpty()&&(this.syncPointTree_=this.syncPointTree_.remove(o));var c=u.removed;s=u.events;var h=-1!==c.findIndex(function(t){return t.getQueryParams().loadsAllData()}),l=this.syncPointTree_.findOnPath(o,function(t,e){return e.hasCompleteView()});if(h&&!l){var f=this.syncPointTree_.subtree(o);if(!f.isEmpty())for(var p=this.collectDistinctViewsForSubTree_(f),d=0;d<p.length;++d){var y=p[d],v=y.getQuery(),g=this.createListenerForView_(y);this.listenProvider_.startListening(t.queryForListening_(v),this.tagForQuery_(v),g.hashFn,g.onComplete)}}if(!l&&c.length>0&&!r)if(h){this.listenProvider_.stopListening(t.queryForListening_(e),null)}else c.forEach(function(e){var n=i.queryToTagMap_[t.makeQueryKey_(e)];i.listenProvider_.stopListening(t.queryForListening_(e),n)});this.removeTags_(c)}return s},t.prototype.calcCompleteEventCache=function(t,e){var n=this.pendingWriteTree_,r=this.syncPointTree_.findOnPath(t,function(e,n){var r=B.relativePath(e,t),i=n.getCompleteServerCache(r);if(i)return i});return n.calcCompleteEventCache(t,r,e,!0)},t.prototype.collectDistinctViewsForSubTree_=function(t){return t.fold(function(t,e,n){if(e&&e.hasCompleteView())return[e.getCompleteView()];var r=[];return e&&(r=e.getQueryViews()),s.forEach(n,function(t,e){r=r.concat(e)}),r})},t.prototype.removeTags_=function(e){for(var n=0;n<e.length;++n){var r=e[n];if(!r.getQueryParams().loadsAllData()){var i=t.makeQueryKey_(r),o=this.queryToTagMap_[i];delete this.queryToTagMap_[i],delete this.tagToQueryMap_["_"+o]}}},t.queryForListening_=function(t){return t.getQueryParams().loadsAllData()&&!t.getQueryParams().isDefault()?t.getRef():t},t.prototype.setupListener_=function(e,n){var r=e.path,i=this.tagForQuery_(e),o=this.createListenerForView_(n),a=this.listenProvider_.startListening(t.queryForListening_(e),i,o.hashFn,o.onComplete),u=this.syncPointTree_.subtree(r);if(i)s.assert(!u.value.hasCompleteView(),"If we're adding a query, it shouldn't be shadowed");else for(var c=u.fold(function(t,e,n){if(!t.isEmpty()&&e&&e.hasCompleteView())return[e.getCompleteView().getQuery()];var r=[];return e&&(r=r.concat(e.getQueryViews().map(function(t){return t.getQuery()}))),s.forEach(n,function(t,e){r=r.concat(e)}),r}),h=0;h<c.length;++h){var l=c[h];this.listenProvider_.stopListening(t.queryForListening_(l),this.tagForQuery_(l))}return a},t.prototype.createListenerForView_=function(t){var e=this,n=t.getQuery(),r=this.tagForQuery_(n);return{hashFn:function(){return(t.getServerCache()||Bt.EMPTY_NODE).hash()},onComplete:function(t){if("ok"===t)return r?e.applyTaggedListenComplete(n.path,r):e.applyListenComplete(n.path);var i=function(t,e){var n="Unknown Error";"too_big"===t?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==t?n="Client doesn't have permission to access the desired data.":"unavailable"==t&&(n="The service is unavailable");var r=new Error(t+" at "+e.path.toString()+": "+n);return r.code=t.toUpperCase(),r}(t,n);return e.removeEventRegistration(n,null,i)}}},t.makeQueryKey_=function(t){return t.path.toString()+"$"+t.queryIdentifier()},t.parseQueryKey_=function(t){var e=t.indexOf("$");return s.assert(-1!==e&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new B(t.substr(0,e))}},t.prototype.queryKeyForTag_=function(t){return this.tagToQueryMap_["_"+t]},t.prototype.tagForQuery_=function(e){var n=t.makeQueryKey_(e);return s.safeGet(this.queryToTagMap_,n)},t.getNextQueryTag_=function(){return t.nextQueryTag_++},t.prototype.applyTaggedOperation_=function(t,e){var n=this.syncPointTree_.get(t);s.assert(n,"Missing sync point for query tag that we're tracking");var r=this.pendingWriteTree_.childWrites(t);return n.applyOperation(e,r,null)},t.prototype.applyOperationToSyncPoints_=function(t){return this.applyOperationHelper_(t,this.syncPointTree_,null,this.pendingWriteTree_.childWrites(B.Empty))},t.prototype.applyOperationHelper_=function(t,e,n,r){if(t.path.isEmpty())return this.applyOperationDescendantsHelper_(t,e,n,r);var i=e.get(B.Empty);null==n&&null!=i&&(n=i.getCompleteServerCache(B.Empty));var o=[],a=t.path.getFront(),s=t.operationForChild(a),u=e.children.get(a);if(u&&s){var c=n?n.getImmediateChild(a):null,h=r.child(a);o=o.concat(this.applyOperationHelper_(s,u,c,h))}return i&&(o=o.concat(i.applyOperation(t,r,n))),o},t.prototype.applyOperationDescendantsHelper_=function(t,e,n,r){var i=this,o=e.get(B.Empty);null==n&&null!=o&&(n=o.getCompleteServerCache(B.Empty));var a=[];return e.children.inorderTraversal(function(e,o){var s=n?n.getImmediateChild(e):null,u=r.child(e),c=t.operationForChild(e);c&&(a=a.concat(i.applyOperationDescendantsHelper_(c,o,s,u)))}),o&&(a=a.concat(o.applyOperation(t,r,n))),a},t.nextQueryTag_=1,t}(),ke=function(){function t(){this.rootNode_=Bt.EMPTY_NODE}return t.prototype.getNode=function(t){return this.rootNode_.getChild(t)},t.prototype.updateSnapshot=function(t,e){this.rootNode_=this.rootNode_.updateChild(t,e)},t}(),Re=function(){function t(t){this.app_=t}return t.prototype.getToken=function(t){return this.app_.INTERNAL.getToken(t).then(null,function(t){return t&&"auth/token-not-initialized"===t.code?(S("Got auth/token-not-initialized error.  Treating as null token."),null):Promise.reject(t)})},t.prototype.addTokenChangeListener=function(t){this.app_.INTERNAL.addAuthTokenListener(t)},t.prototype.removeTokenChangeListener=function(t){this.app_.INTERNAL.removeAuthTokenListener(t)},t.prototype.notifyForInvalidToken=function(){var t='Provided authentication credentials for the app named "'+this.app_.name+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.app_.options?t+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.app_.options?t+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':t+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',N(t)},t}(),De=function(){function t(){this.counters_={}}return t.prototype.incrementCounter=function(t,e){void 0===e&&(e=1),s.contains(this.counters_,t)||(this.counters_[t]=0),this.counters_[t]+=e},t.prototype.get=function(){return s.deepCopy(this.counters_)},t}(),Le=function(){function t(){}return t.getCollection=function(t){var e=t.toString();return this.collections_[e]||(this.collections_[e]=new De),this.collections_[e]},t.getOrCreateReporter=function(t,e){var n=t.toString();return this.reporters_[n]||(this.reporters_[n]=e()),this.reporters_[n]},t.collections_={},t.reporters_={},t}(),Me=function(){function t(t){this.collection_=t,this.last_=null}return t.prototype.get=function(){var t=this.collection_.get(),e=s.clone(t);return this.last_&&s.forEach(this.last_,function(t,n){e[t]=e[t]-n}),this.last_=t,e},t}(),Fe=1e4,je=3e4,Ue=function(){function t(t,e){this.server_=e,this.statsToReport_={},this.statsListener_=new Me(t);var n=Fe+(je-Fe)*Math.random();q(this.reportStats_.bind(this),Math.floor(n))}return t.prototype.includeStat=function(t){this.statsToReport_[t]=!0},t.prototype.reportStats_=function(){var t=this,e=this.statsListener_.get(),n={},r=!1;s.forEach(e,function(e,i){i>0&&s.contains(t.statsToReport_,e)&&(n[e]=i,r=!0)}),r&&this.server_.reportStats(n),q(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},t}(),We=function(){function t(){this.eventLists_=[],this.recursionDepth_=0}return t.prototype.queueEvents=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n],i=r.getPath();null===e||i.equals(e.getPath())||(this.eventLists_.push(e),e=null),null===e&&(e=new Ve(i)),e.add(r)}e&&this.eventLists_.push(e)},t.prototype.raiseEventsAtPath=function(t,e){this.queueEvents(e),this.raiseQueuedEventsMatchingPredicate_(function(e){return e.equals(t)})},t.prototype.raiseEventsForChangedPath=function(t,e){this.queueEvents(e),this.raiseQueuedEventsMatchingPredicate_(function(e){return e.contains(t)||t.contains(e)})},t.prototype.raiseQueuedEventsMatchingPredicate_=function(t){this.recursionDepth_++;for(var e=!0,n=0;n<this.eventLists_.length;n++){var r=this.eventLists_[n];if(r)t(r.getPath())?(this.eventLists_[n].raise(),this.eventLists_[n]=null):e=!1}e&&(this.eventLists_=[]),this.recursionDepth_--},t}(),Ve=function(){function t(t){this.path_=t,this.events_=[]}return t.prototype.add=function(t){this.events_.push(t)},t.prototype.raise=function(){for(var t=0;t<this.events_.length;t++){var e=this.events_[t];if(null!==e){this.events_[t]=null;var n=e.getEventRunner();b&&S("event: "+e.toString()),W(n)}}},t.prototype.getPath=function(){return this.path_},t}(),qe=function(){function t(t){this.allowedEvents_=t,this.listeners_={},s.assert(Array.isArray(t)&&t.length>0,"Requires a non-empty array")}return t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Array.isArray(this.listeners_[t]))for(var r=this.listeners_[t].slice(),i=0;i<r.length;i++)r[i].callback.apply(r[i].context,e)},t.prototype.on=function(t,e,n){this.validateEventType_(t),this.listeners_[t]=this.listeners_[t]||[],this.listeners_[t].push({callback:e,context:n});var r=this.getInitialEvent(t);r&&e.apply(n,r)},t.prototype.off=function(t,e,n){this.validateEventType_(t);for(var r=this.listeners_[t]||[],i=0;i<r.length;i++)if(r[i].callback===e&&(!n||n===r[i].context))return void r.splice(i,1)},t.prototype.validateEventType_=function(t){s.assert(this.allowedEvents_.find(function(e){return e===t}),"Unknown event: "+t)},t}(),Be=function(t){function e(){var e,n,r=t.call(this,["visible"])||this;return"undefined"!==typeof document&&"undefined"!==typeof document.addEventListener&&("undefined"!==typeof document.hidden?(n="visibilitychange",e="hidden"):"undefined"!==typeof document.mozHidden?(n="mozvisibilitychange",e="mozHidden"):"undefined"!==typeof document.msHidden?(n="msvisibilitychange",e="msHidden"):"undefined"!==typeof document.webkitHidden&&(n="webkitvisibilitychange",e="webkitHidden")),r.visible_=!0,n&&document.addEventListener(n,function(){var t=!document[e];t!==r.visible_&&(r.visible_=t,r.trigger("visible",t))},!1),r}return c.__extends(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return s.assert("visible"===t,"Unknown event type: "+t),[this.visible_]},e}(qe),He=function(t){function e(){var e=t.call(this,["online"])||this;return e.online_=!0,"undefined"===typeof window||"undefined"===typeof window.addEventListener||s.isMobileCordova()||(window.addEventListener("online",function(){e.online_||(e.online_=!0,e.trigger("online",!0))},!1),window.addEventListener("offline",function(){e.online_&&(e.online_=!1,e.trigger("online",!1))},!1)),e}return c.__extends(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return s.assert("online"===t,"Unknown event type: "+t),[this.online_]},e.prototype.currentlyOnline=function(){return this.online_},e}(qe),Ke=function(){function t(t){this.onMessage_=t,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return t.prototype.closeAfter=function(t,e){this.closeAfterResponse=t,this.onClose=e,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},t.prototype.handleResponse=function(t,e){var n=this;this.pendingResponses[t]=e;for(var r=function(){var t=i.pendingResponses[i.currentResponseNum];delete i.pendingResponses[i.currentResponseNum];for(var e=function(e){t[e]&&W(function(){n.onMessage_(t[e])})},r=0;r<t.length;++r)e(r);if(i.currentResponseNum===i.closeAfterResponse)return i.onClose&&(i.onClose(),i.onClose=null),"break";i.currentResponseNum++},i=this;this.pendingResponses[this.currentResponseNum];){if("break"===r())break}},t}(),Qe="pLPCommand",Ge="pRTLPCB",ze=function(){function t(t,e,n,r){this.connId=t,this.repoInfo=e,this.transportSessionId=n,this.lastSessionId=r,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=C(t),this.stats_=Le.getCollection(e),this.urlFn=function(t){return e.connectionURL(K,t)}}return t.prototype.open=function(t,e){var n=this;this.curSegmentNum=0,this.onDisconnect_=e,this.myPacketOrderer=new Ke(t),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(function(){n.log_("Timed out trying to connect."),n.onClosed_(),n.connectTimeoutTimer_=null},Math.floor(3e4)),function(t){if(s.isNodeSdk()||"complete"===document.readyState)t();else{var e=!1,n=function n(){document.body?e||(e=!0,t()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}}(function(){if(!n.isClosed_){n.scriptTagHolder=new Xe(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],i=t[1],o=t[2];if(n.incrementIncomingBytes_(t),n.scriptTagHolder)if(n.connectTimeoutTimer_&&(clearTimeout(n.connectTimeoutTimer_),n.connectTimeoutTimer_=null),n.everConnected_=!0,"start"==r)n.id=i,n.password=o;else{if("close"!==r)throw new Error("Unrecognized command received: "+r);i?(n.scriptTagHolder.sendNewPolls=!1,n.myPacketOrderer.closeAfter(i,function(){n.onClosed_()})):n.onClosed_()}},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],i=t[1];n.incrementIncomingBytes_(t),n.myPacketOrderer.handleResponse(r,i)},function(){n.onClosed_()},n.urlFn);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),n.scriptTagHolder.uniqueCallbackIdentifier&&(t.cb=n.scriptTagHolder.uniqueCallbackIdentifier),t.v="5",n.transportSessionId&&(t.s=n.transportSessionId),n.lastSessionId&&(t.ls=n.lastSessionId),!s.isNodeSdk()&&"undefined"!==typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f");var e=n.urlFn(t);n.log_("Connecting via long-poll to "+e),n.scriptTagHolder.addTag(e,function(){})}})},t.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},t.forceAllow=function(){t.forceAllow_=!0},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){return t.forceAllow_||!t.forceDisallow_&&"undefined"!==typeof document&&null!=document.createElement&&!("object"===("undefined"===typeof window?"undefined":i(window))&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"===("undefined"===typeof Windows?"undefined":i(Windows))&&"object"===i(Windows.UI))&&!s.isNodeSdk()},t.prototype.markConnectionHealthy=function(){},t.prototype.shutdown_=function(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))},t.prototype.close=function(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())},t.prototype.send=function(t){var e=s.stringify(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);for(var n=s.base64Encode(e),r=L(n,1840),i=0;i<r.length;i++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,r.length,r[i]),this.curSegmentNum++},t.prototype.addDisconnectPingFrame=function(t,e){if(!s.isNodeSdk()){this.myDisconnFrame=document.createElement("iframe");var n={dframe:"t"};n.id=t,n.pw=e,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},t.prototype.incrementIncomingBytes_=function(t){var e=s.stringify(t).length;this.bytesReceived+=e,this.stats_.incrementCounter("bytes_received",e)},t}(),Xe=function(){function t(e,n,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new re,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,s.isNodeSdk())this.commandCB=e,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=g(),window[Qe+this.uniqueCallbackIdentifier]=e,window[Ge+this.uniqueCallbackIdentifier]=n,this.myIFrame=t.createIFrame_();var o="";if(this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,"javascript:".length))o='<script>document.domain="'+document.domain+'";<\/script>';var a="<html><body>"+o+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(a),this.myIFrame.doc.close()}catch(u){S("frame writing exception"),u.stack&&S(u.stack),S(u)}}}return t.createIFrame_=function(){var t=document.createElement("iframe");if(t.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||S("No IE domain setting required")}catch(n){var e=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+e+"';document.close();})())"}return t.contentDocument?t.doc=t.contentDocument:t.contentWindow?t.doc=t.contentWindow.document:t.document&&(t.doc=t.document),t},t.prototype.close=function(){var e=this;if(this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(function(){null!==e.myIFrame&&(document.body.removeChild(e.myIFrame),e.myIFrame=null)},Math.floor(0))),s.isNodeSdk()&&this.myID){var n={disconn:"t"};n.id=this.myID,n.pw=this.myPW;var r=this.urlFn(n);t.nodeRestRequest(r)}var i=this.onDisconnect;i&&(this.onDisconnect=null,i())},t.prototype.startLongPoll=function(t,e){for(this.myID=t,this.myPW=e,this.alive=!0;this.newRequest_(););},t.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.count()<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var t={};t.id=this.myID,t.pw=this.myPW,t.ser=this.currentSerial;for(var e=this.urlFn(t),n="",r=0;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+n.length<=1870))break;var i=this.pendingSegs.shift();n=n+"&seg"+r+"="+i.seg+"&ts"+r+"="+i.ts+"&d"+r+"="+i.d,r++}return e+=n,this.addLongPollTag_(e,this.currentSerial),!0}return!1},t.prototype.enqueueSegment=function(t,e,n){this.pendingSegs.push({seg:t,ts:e,d:n}),this.alive&&this.newRequest_()},t.prototype.addLongPollTag_=function(t,e){var n=this;this.outstandingRequests.add(e,1);var r=function(){n.outstandingRequests.remove(e),n.newRequest_()},i=setTimeout(r,Math.floor(25e3));this.addTag(t,function(){clearTimeout(i),r()})},t.prototype.addTag=function(t,e){var n=this;s.isNodeSdk()?this.doNodeLongPoll(t,e):setTimeout(function(){try{if(!n.sendNewPolls)return;var r=n.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=t,r.onload=r.onreadystatechange=function(){var t=r.readyState;t&&"loaded"!==t&&"complete"!==t||(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),e())},r.onerror=function(){S("Long-poll script failed to load: "+t),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(i){}},Math.floor(1))},t}(),Ye=null;"undefined"!==typeof MozWebSocket?Ye=MozWebSocket:"undefined"!==typeof WebSocket&&(Ye=WebSocket);var $e=function(){function t(e,n,r,i){this.connId=e,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=C(this.connId),this.stats_=Le.getCollection(n),this.connURL=t.connectionURL_(n,r,i)}return t.connectionURL_=function(t,e,n){var r={v:"5"};return!s.isNodeSdk()&&"undefined"!==typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(r.r="f"),e&&(r.s=e),n&&(r.ls=n),t.connectionURL("websocket",r)},t.prototype.open=function(t,e){var n=this;this.onDisconnect=e,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,d.set("previous_websocket_failure",!0);try{if(s.isNodeSdk()){var i=s.CONSTANTS.NODE_ADMIN?"AdminNode":"Node",o={headers:{"User-Agent":"Firebase/5/"+h.SDK_VERSION+"/"+r.platform+"/"+i}},a=r.env,u=0==this.connURL.indexOf("wss://")?a.HTTPS_PROXY||a.https_proxy:a.HTTP_PROXY||a.http_proxy;u&&(o.proxy={origin:u}),this.mySock=new Ye(this.connURL,[],o)}else this.mySock=new Ye(this.connURL)}catch(l){this.log_("Error instantiating WebSocket.");var c=l.message||l.data;return c&&this.log_(c),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0},this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(t){n.handleIncomingFrame(t)},this.mySock.onerror=function(t){n.log_("WebSocket error.  Closing connection.");var e=t.message||t.data;e&&n.log_(e),n.onClosed_()}},t.prototype.start=function(){},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){var e=!1;if("undefined"!==typeof navigator&&navigator.userAgent){var n=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);n&&n.length>1&&parseFloat(n[1])<4.4&&(e=!0)}return!e&&null!==Ye&&!t.forceDisallow_},t.previouslyFailed=function(){return d.isInMemoryStorage||!0===d.get("previous_websocket_failure")},t.prototype.markConnectionHealthy=function(){d.remove("previous_websocket_failure")},t.prototype.appendFrame_=function(t){if(this.frames.push(t),this.frames.length==this.totalFrames){var e=this.frames.join("");this.frames=null;var n=s.jsonEval(e);this.onMessage(n)}},t.prototype.handleNewFrameCount_=function(t){this.totalFrames=t,this.frames=[]},t.prototype.extractFrameCount_=function(t){if(s.assert(null===this.frames,"We already have a frame buffer"),t.length<=6){var e=Number(t);if(!isNaN(e))return this.handleNewFrameCount_(e),null}return this.handleNewFrameCount_(1),t},t.prototype.handleIncomingFrame=function(t){if(null!==this.mySock){var e=t.data;if(this.bytesReceived+=e.length,this.stats_.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(e);else{var n=this.extractFrameCount_(e);null!==n&&this.appendFrame_(n)}}},t.prototype.send=function(t){this.resetKeepAlive();var e=s.stringify(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);var n=L(e,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r<n.length;r++)this.sendString_(n[r])},t.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},t.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},t.prototype.resetKeepAlive=function(){var t=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(function(){t.mySock&&t.sendString_("0"),t.resetKeepAlive()},Math.floor(45e3))},t.prototype.sendString_=function(t){try{this.mySock.send(t)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},t.responsesRequiredToBeHealthy=2,t.healthyTimeout=3e4,t}(),Je=function(){function t(t){this.initTransports_(t)}return Object.defineProperty(t,"ALL_TRANSPORTS",{get:function(){return[ze,$e]},enumerable:!0,configurable:!0}),t.prototype.initTransports_=function(e){var n=$e&&$e.isAvailable(),r=n&&!$e.previouslyFailed();if(e.webSocketOnly&&(n||N("wss:// URL used, but browser isn't known to support websockets.  Trying anyway."),r=!0),r)this.transports_=[$e];else{var i=this.transports_=[];M(t.ALL_TRANSPORTS,function(t,e){e&&e.isAvailable()&&i.push(e)})}},t.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},t.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},t}(),Ze=function(){function t(t,e,n,r,i,o,a){this.id=t,this.repoInfo_=e,this.onMessage_=n,this.onReady_=r,this.onDisconnect_=i,this.onKill_=o,this.lastSessionId=a,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=C("c:"+this.id+":"),this.transportManager_=new Je(e),this.log_("Connection created"),this.start_()}return t.prototype.start_=function(){var t=this,e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,void 0,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(function(){t.conn_&&t.conn_.open(n,r)},Math.floor(0));var i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=q(function(){t.healthyTimeout_=null,t.isHealthy_||(t.conn_&&t.conn_.bytesReceived>102400?(t.log_("Connection exceeded healthy timeout but has received "+t.conn_.bytesReceived+" bytes.  Marking connection healthy."),t.isHealthy_=!0,t.conn_.markConnectionHealthy()):t.conn_&&t.conn_.bytesSent>10240?t.log_("Connection exceeded healthy timeout but has sent "+t.conn_.bytesSent+" bytes.  Leaving connection alive."):(t.log_("Closing unhealthy connection after timeout."),t.close()))},Math.floor(i)))},t.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},t.prototype.disconnReceiver_=function(t){var e=this;return function(n){t===e.conn_?e.onConnectionLost_(n):t===e.secondaryConn_?(e.log_("Secondary connection lost."),e.onSecondaryConnectionLost_()):e.log_("closing an old connection")}},t.prototype.connReceiver_=function(t){var e=this;return function(n){2!=e.state_&&(t===e.rx_?e.onPrimaryMessageReceived_(n):t===e.secondaryConn_?e.onSecondaryMessageReceived_(n):e.log_("message on old connection"))}},t.prototype.sendRequest=function(t){var e={t:"d",d:t};this.sendData_(e)},t.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},t.prototype.onSecondaryControl_=function(t){if("t"in t){var e=t.t;"a"===e?this.upgradeIfSecondaryHealthy_():"r"===e?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===e&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},t.prototype.onSecondaryMessageReceived_=function(t){var e=R("t",t),n=R("d",t);if("c"==e)this.onSecondaryControl_(n);else{if("d"!=e)throw new Error("Unknown protocol layer: "+e);this.pendingDataMessages.push(n)}},t.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))},t.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},t.prototype.onPrimaryMessageReceived_=function(t){var e=R("t",t),n=R("d",t);"c"==e?this.onControl_(n):"d"==e&&this.onDataMessage_(n)},t.prototype.onDataMessage_=function(t){this.onPrimaryResponse_(),this.onMessage_(t)},t.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},t.prototype.onControl_=function(t){var e=R("t",t);if("d"in t){var n=t.d;if("h"===e)this.onHandshake_(n);else if("n"===e){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r<this.pendingDataMessages.length;++r)this.onDataMessage_(this.pendingDataMessages[r]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===e?this.onConnectionShutdown_(n):"r"===e?this.onReset_(n):"e"===e?T("Server Error: "+n):"o"===e?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):T("Unknown control packet command: "+e)}},t.prototype.onHandshake_=function(t){var e=t.ts,n=t.v,r=t.h;this.sessionId=t.s,this.repoInfo_.updateHost(r),0==this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,e),"5"!==n&&N("Protocol version mismatch detected"),this.tryStartUpgrade_())},t.prototype.tryStartUpgrade_=function(){var t=this.transportManager_.upgradeTransport();t&&this.startUpgrade_(t)},t.prototype.startUpgrade_=function(t){var e=this;this.secondaryConn_=new t(this.nextTransportId_(),this.repoInfo_,this.sessionId),this.secondaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),q(function(){e.secondaryConn_&&(e.log_("Timed out trying to upgrade."),e.secondaryConn_.close())},Math.floor(6e4))},t.prototype.onReset_=function(t){this.log_("Reset packet received.  New host: "+t),this.repoInfo_.updateHost(t),1===this.state_?this.close():(this.closeConnections_(),this.start_())},t.prototype.onConnectionEstablished_=function(t,e){var n=this;this.log_("Realtime connection established."),this.conn_=t,this.state_=1,this.onReady_&&(this.onReady_(e,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):q(function(){n.sendPingOnPrimaryIfNecessary_()},Math.floor(5e3))},t.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},t.prototype.onSecondaryConnectionLost_=function(){var t=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==t&&this.rx_!==t||this.close()},t.prototype.onConnectionLost_=function(t){this.conn_=null,t||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(d.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},t.prototype.onConnectionShutdown_=function(t){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(t),this.onKill_=null),this.onDisconnect_=null,this.close()},t.prototype.sendData_=function(t){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(t)},t.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},t.prototype.closeConnections_=function(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)},t}(),tn=function(){function t(){}return t.prototype.put=function(t,e,n,r){},t.prototype.merge=function(t,e,n,r){},t.prototype.refreshAuthToken=function(t){},t.prototype.onDisconnectPut=function(t,e,n){},t.prototype.onDisconnectMerge=function(t,e,n){},t.prototype.onDisconnectCancel=function(t,e){},t.prototype.reportStats=function(t){},t}(),en=1e3,nn=3e5,rn=function(t){function e(n,r,i,o,a,u){var c=t.call(this)||this;if(c.repoInfo_=n,c.onDataUpdate_=r,c.onConnectStatus_=i,c.onServerInfoUpdate_=o,c.authTokenProvider_=a,c.authOverride_=u,c.id=e.nextPersistentConnectionId_++,c.log_=C("p:"+c.id+":"),c.interruptReasons_={},c.listens_={},c.outstandingPuts_=[],c.outstandingPutCount_=0,c.onDisconnectRequestQueue_=[],c.connected_=!1,c.reconnectDelay_=en,c.maxReconnectDelay_=nn,c.securityDebugCallback_=null,c.lastSessionId=null,c.establishConnectionTimer_=null,c.visible_=!1,c.requestCBHash_={},c.requestNumber_=0,c.realtime_=null,c.authToken_=null,c.forceTokenRefresh_=!1,c.invalidAuthTokenCount_=0,c.firstConnection_=!0,c.lastConnectionAttemptTime_=null,c.lastConnectionEstablishedTime_=null,u&&!s.isNodeSdk())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return c.scheduleConnect_(0),Be.getInstance().on("visible",c.onVisible_,c),-1===n.host.indexOf("fblocal")&&He.getInstance().on("online",c.onOnline_,c),c}return c.__extends(e,t),e.prototype.sendRequest=function(t,e,n){var r=++this.requestNumber_,i={r:r,a:t,b:e};this.log_(s.stringify(i)),s.assert(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)},e.prototype.listen=function(t,e,n,r){var i=t.queryIdentifier(),o=t.path.toString();this.log_("Listen called for "+o+" "+i),this.listens_[o]=this.listens_[o]||{},s.assert(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),s.assert(!this.listens_[o][i],"listen() called twice for same path/queryId.");var a={onComplete:r,hashFn:e,query:t,tag:n};this.listens_[o][i]=a,this.connected_&&this.sendListen_(a)},e.prototype.sendListen_=function(t){var n=this,r=t.query,i=r.path.toString(),o=r.queryIdentifier();this.log_("Listen on "+i+" for "+o);var a={p:i};t.tag&&(a.q=r.queryObject(),a.t=t.tag),a.h=t.hashFn(),this.sendRequest("q",a,function(a){var s=a.d,u=a.s;e.warnOnListenWarnings_(s,r),(n.listens_[i]&&n.listens_[i][o])===t&&(n.log_("listen response",a),"ok"!==u&&n.removeListen_(i,o),t.onComplete&&t.onComplete(u,s))})},e.warnOnListenWarnings_=function(t,e){if(t&&"object"===i(t)&&s.contains(t,"w")){var n=s.safeGet(t,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+e.getQueryParams().getIndex().toString()+'"',o=e.path.toString();N("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+r+" at "+o+" to your security rules for better performance.")}}},e.prototype.refreshAuthToken=function(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},function(){}),this.reduceReconnectDelayIfAdminCredential_(t)},e.prototype.reduceReconnectDelayIfAdminCredential_=function(t){(t&&40===t.length||s.isAdmin(t))&&(this.log_("Admin auth credential detected.  Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},e.prototype.tryAuth=function(){var t=this;if(this.connected_&&this.authToken_){var e=this.authToken_,n=s.isValidFormat(e)?"auth":"gauth",r={cred:e};null===this.authOverride_?r.noauth=!0:"object"===i(this.authOverride_)&&(r.authvar=this.authOverride_),this.sendRequest(n,r,function(n){var r=n.s,i=n.d||"error";t.authToken_===e&&("ok"===r?t.invalidAuthTokenCount_=0:t.onAuthRevoked_(r,i))})}},e.prototype.unlisten=function(t,e){var n=t.path.toString(),r=t.queryIdentifier();this.log_("Unlisten called for "+n+" "+r),s.assert(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,t.queryObject(),e)},e.prototype.sendUnlisten_=function(t,e,n,r){this.log_("Unlisten on "+t+" for "+e);var i={p:t};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},e.prototype.onDisconnectPut=function(t,e,n){this.connected_?this.sendOnDisconnect_("o",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:e,onComplete:n})},e.prototype.onDisconnectMerge=function(t,e,n){this.connected_?this.sendOnDisconnect_("om",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:e,onComplete:n})},e.prototype.onDisconnectCancel=function(t,e){this.connected_?this.sendOnDisconnect_("oc",t,null,e):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:e})},e.prototype.sendOnDisconnect_=function(t,e,n,r){var i={p:e,d:n};this.log_("onDisconnect "+t,i),this.sendRequest(t,i,function(t){r&&setTimeout(function(){r(t.s,t.d)},Math.floor(0))})},e.prototype.put=function(t,e,n,r){this.putInternal("p",t,e,n,r)},e.prototype.merge=function(t,e,n,r){this.putInternal("m",t,e,n,r)},e.prototype.putInternal=function(t,e,n,r,i){var o={p:e,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:t,request:o,onComplete:r}),this.outstandingPutCount_++;var a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+e)},e.prototype.sendPut_=function(t){var e=this,n=this.outstandingPuts_[t].action,r=this.outstandingPuts_[t].request,i=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(n,r,function(r){e.log_(n+" response",r),delete e.outstandingPuts_[t],e.outstandingPutCount_--,0===e.outstandingPutCount_&&(e.outstandingPuts_=[]),i&&i(r.s,r.d)})},e.prototype.reportStats=function(t){var e=this;if(this.connected_){var n={c:t};this.log_("reportStats",n),this.sendRequest("s",n,function(t){if("ok"!==t.s){var n=t.d;e.log_("reportStats","Error sending stats: "+n)}})}},e.prototype.onDataMessage_=function(t){if("r"in t){this.log_("from server: "+s.stringify(t));var e=t.r,n=this.requestCBHash_[e];n&&(delete this.requestCBHash_[e],n(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.onDataPush_(t.a,t.b)}},e.prototype.onDataPush_=function(t,e){this.log_("handleServerMessage",t,e),"d"===t?this.onDataUpdate_(e.p,e.d,!1,e.t):"m"===t?this.onDataUpdate_(e.p,e.d,!0,e.t):"c"===t?this.onListenRevoked_(e.p,e.q):"ac"===t?this.onAuthRevoked_(e.s,e.d):"sd"===t?this.onSecurityDebugPacket_(e):T("Unrecognized action received from server: "+s.stringify(t)+"\nAre you using the latest client?")},e.prototype.onReady_=function(t,e){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(t),this.lastSessionId=e,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},e.prototype.scheduleConnect_=function(t){var e=this;s.assert(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(function(){e.establishConnectionTimer_=null,e.establishConnection_()},Math.floor(t))},e.prototype.onVisible_=function(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible.  Reducing delay."),this.reconnectDelay_=en,this.realtime_||this.scheduleConnect_(0)),this.visible_=t},e.prototype.onOnline_=function(t){t?(this.log_("Browser went online."),this.reconnectDelay_=en,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline.  Killing connection."),this.realtime_&&this.realtime_.close())},e.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=en),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible.  Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var t=(new Date).getTime()-this.lastConnectionAttemptTime_,e=Math.max(0,this.reconnectDelay_-t);e=Math.random()*e,this.log_("Trying to reconnect in "+e+"ms"),this.scheduleConnect_(e),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},e.prototype.establishConnection_=function(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var t=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+e.nextConnectionId_++,o=this,a=this.lastSessionId,u=!1,c=null,h=function(){c?c.close():(u=!0,r())};this.realtime_={close:h,sendRequest:function(t){s.assert(c,"sendRequest call when we're not connected not allowed."),c.sendRequest(t)}};var l=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(l).then(function(e){u?S("getToken() completed but was canceled"):(S("getToken() completed. Creating connection."),o.authToken_=e&&e.accessToken,c=new Ze(i,o.repoInfo_,t,n,r,function(t){N(t+" ("+o.repoInfo_.toString()+")"),o.interrupt("server_kill")},a))}).then(null,function(t){o.log_("Failed to get token: "+t),u||(s.CONSTANTS.NODE_ADMIN&&N(t),h())})}},e.prototype.interrupt=function(t){S("Interrupting connection for reason: "+t),this.interruptReasons_[t]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},e.prototype.resume=function(t){S("Resuming connection for reason: "+t),delete this.interruptReasons_[t],s.isEmpty(this.interruptReasons_)&&(this.reconnectDelay_=en,this.realtime_||this.scheduleConnect_(0))},e.prototype.handleTimestamp_=function(t){var e=t-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:e})},e.prototype.cancelSentTransactions_=function(){for(var t=0;t<this.outstandingPuts_.length;t++){var e=this.outstandingPuts_[t];e&&"h"in e.request&&e.queued&&(e.onComplete&&e.onComplete("disconnect"),delete this.outstandingPuts_[t],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},e.prototype.onListenRevoked_=function(t,e){var n;n=e?e.map(function(t){return D(t)}).join("$"):"default";var r=this.removeListen_(t,n);r&&r.onComplete&&r.onComplete("permission_denied")},e.prototype.removeListen_=function(t,e){var n,r=new B(t).toString();return void 0!==this.listens_[r]?(n=this.listens_[r][e],delete this.listens_[r][e],0===s.getCount(this.listens_[r])&&delete this.listens_[r]):n=void 0,n},e.prototype.onAuthRevoked_=function(t,e){S("Auth token revoked: "+t+"/"+e),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},e.prototype.onSecurityDebugPacket_=function(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace("\n","\nFIREBASE: "))},e.prototype.restoreState_=function(){var t=this;this.tryAuth(),s.forEach(this.listens_,function(e,n){s.forEach(n,function(e,n){t.sendListen_(n)})});for(var e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){var n=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(n.action,n.pathString,n.data,n.onComplete)}},e.prototype.sendConnectStats_=function(){var t={},e="js";s.CONSTANTS.NODE_ADMIN?e="admin_node":s.CONSTANTS.NODE_CLIENT&&(e="node"),t["sdk."+e+"."+h.SDK_VERSION.replace(/\./g,"-")]=1,s.isMobileCordova()?t["framework.cordova"]=1:s.isReactNative()&&(t["framework.reactnative"]=1),this.reportStats(t)},e.prototype.shouldReconnect_=function(){var t=He.getInstance().currentlyOnline();return s.isEmpty(this.interruptReasons_)&&t},e.nextPersistentConnectionId_=0,e.nextConnectionId_=0,e}(tn),on=function(t){function e(e,n,r){var i=t.call(this)||this;return i.repoInfo_=e,i.onDataUpdate_=n,i.authTokenProvider_=r,i.log_=C("p:rest:"),i.listens_={},i}return c.__extends(e,t),e.prototype.reportStats=function(t){throw new Error("Method not implemented.")},e.getListenId_=function(t,e){return void 0!==e?"tag$"+e:(s.assert(t.getQueryParams().isDefault(),"should have a tag if it's not a default query."),t.path.toString())},e.prototype.listen=function(t,n,r,i){var o=this,a=t.path.toString();this.log_("Listen called for "+a+" "+t.queryIdentifier());var u=e.getListenId_(t,r),c={};this.listens_[u]=c;var h=t.getQueryParams().toRestQueryStringParameters();this.restRequest_(a+".json",h,function(t,e){var n=e;(404===t&&(n=null,t=null),null===t&&o.onDataUpdate_(a,n,!1,r),s.safeGet(o.listens_,u)===c)&&i(t?401==t?"permission_denied":"rest_error:"+t:"ok",null)})},e.prototype.unlisten=function(t,n){var r=e.getListenId_(t,n);delete this.listens_[r]},e.prototype.refreshAuthToken=function(t){},e.prototype.restRequest_=function(t,e,n){var r=this;void 0===e&&(e={}),e.format="export",this.authTokenProvider_.getToken(!1).then(function(i){var o=i&&i.accessToken;o&&(e.auth=o);var a=(r.repoInfo_.secure?"https://":"http://")+r.repoInfo_.host+t+"?ns="+r.repoInfo_.namespace+s.querystring(e);r.log_("Sending REST request for "+a);var u=new XMLHttpRequest;u.onreadystatechange=function(){if(n&&4===u.readyState){r.log_("REST Response for "+a+" received. status:",u.status,"response:",u.responseText);var t=null;if(u.status>=200&&u.status<300){try{t=s.jsonEval(u.responseText)}catch(e){N("Failed to parse JSON response for "+a+": "+u.responseText)}n(null,t)}else 401!==u.status&&404!==u.status&&N("Got unsuccessful REST response for "+a+" Status: "+u.status),n(u.status);n=null}},u.open("GET",a,!0),u.send()})},e}(tn),an=function(){function t(t,e,n){var r=this;this.repoInfo_=t,this.app=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new We,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new ie,this.persistentConnection_=null;var o=new Re(n);if(this.stats_=Le.getCollection(t),e||V())this.server_=new on(this.repoInfo_,this.onDataUpdate_.bind(this),o),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var a=n.options.databaseAuthVariableOverride;if("undefined"!==typeof a&&null!==a){if("object"!==i(a))throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{s.stringify(a)}catch(u){throw new Error("Invalid authOverride provided: "+u)}}this.persistentConnection_=new rn(this.repoInfo_,this.onDataUpdate_.bind(this),this.onConnectStatus_.bind(this),this.onServerInfoUpdate_.bind(this),o,a),this.server_=this.persistentConnection_}o.addTokenChangeListener(function(t){r.server_.refreshAuthToken(t)}),this.statsReporter_=Le.getOrCreateReporter(t,function(){return new Ue(r.stats_,r.server_)}),this.transactions_init_(),this.infoData_=new ke,this.infoSyncTree_=new Pe({startListening:function(t,e,n,i){var o=[],a=r.infoData_.getNode(t.path);return a.isEmpty()||(o=r.infoSyncTree_.applyServerOverwrite(t.path,a),setTimeout(function(){i("ok")},0)),o},stopListening:function(){}}),this.updateInfo_("connected",!1),this.serverSyncTree_=new Pe({startListening:function(t,e,n,i){return r.server_.listen(t,n,e,function(e,n){var o=i(e,n);r.eventQueue_.raiseEventsForChangedPath(t.path,o)}),[]},stopListening:function(t,e){r.server_.unlisten(t,e)}})}return t.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},t.prototype.name=function(){return this.repoInfo_.namespace},t.prototype.serverTime=function(){var t=this.infoData_.getNode(new B(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t},t.prototype.generateServerValues=function(){return(t=(t={timestamp:this.serverTime()})||{}).timestamp=t.timestamp||(new Date).getTime(),t;var t},t.prototype.onDataUpdate_=function(t,e,n,r){this.dataUpdateCount++;var i=new B(t);e=this.interceptServerDataCallback_?this.interceptServerDataCallback_(t,e):e;var o=[];if(r)if(n){var a=s.map(e,function(t){return Qt(t)});o=this.serverSyncTree_.applyTaggedQueryMerge(i,a,r)}else{var u=Qt(e);o=this.serverSyncTree_.applyTaggedQueryOverwrite(i,u,r)}else if(n){var c=s.map(e,function(t){return Qt(t)});o=this.serverSyncTree_.applyServerMerge(i,c)}else{var h=Qt(e);o=this.serverSyncTree_.applyServerOverwrite(i,h)}var l=i;o.length>0&&(l=this.rerunTransactions_(i)),this.eventQueue_.raiseEventsForChangedPath(l,o)},t.prototype.interceptServerData_=function(t){this.interceptServerDataCallback_=t},t.prototype.onConnectStatus_=function(t){this.updateInfo_("connected",t),!1===t&&this.runOnDisconnectEvents_()},t.prototype.onServerInfoUpdate_=function(t){var e=this;M(t,function(t,n){e.updateInfo_(n,t)})},t.prototype.updateInfo_=function(t,e){var n=new B("/.info/"+t),r=Qt(e);this.infoData_.updateSnapshot(n,r);var i=this.infoSyncTree_.applyServerOverwrite(n,r);this.eventQueue_.raiseEventsForChangedPath(n,i)},t.prototype.getNextWriteId_=function(){return this.nextWriteId_++},t.prototype.setWithPriority=function(t,e,n,r){var i=this;this.log_("set",{path:t.toString(),value:e,priority:n});var o=this.generateServerValues(),a=Qt(e,n),s=ae(a,o),u=this.getNextWriteId_(),c=this.serverSyncTree_.applyUserOverwrite(t,s,u,!0);this.eventQueue_.queueEvents(c),this.server_.put(t.toString(),a.val(!0),function(e,n){var o="ok"===e;o||N("set at "+t+" failed: "+e);var a=i.serverSyncTree_.ackUserWrite(u,!o);i.eventQueue_.raiseEventsForChangedPath(t,a),i.callOnCompleteCallback(r,e,n)});var h=this.abortTransactions_(t);this.rerunTransactions_(h),this.eventQueue_.raiseEventsForChangedPath(h,[])},t.prototype.update=function(t,e,n){var r=this;this.log_("update",{path:t.toString(),value:e});var i=!0,o=this.generateServerValues(),a={};if(s.forEach(e,function(t,e){i=!1;var n=Qt(e);a[t]=ae(n,o)}),i)S("update() called with empty data.  Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var u=this.getNextWriteId_(),c=this.serverSyncTree_.applyUserMerge(t,a,u);this.eventQueue_.queueEvents(c),this.server_.merge(t.toString(),e,function(e,i){var o="ok"===e;o||N("update at "+t+" failed: "+e);var a=r.serverSyncTree_.ackUserWrite(u,!o),s=a.length>0?r.rerunTransactions_(t):t;r.eventQueue_.raiseEventsForChangedPath(s,a),r.callOnCompleteCallback(n,e,i)}),s.forEach(e,function(e){var n=r.abortTransactions_(t.child(e));r.rerunTransactions_(n)}),this.eventQueue_.raiseEventsForChangedPath(t,[])}},t.prototype.runOnDisconnectEvents_=function(){var t=this;this.log_("onDisconnectEvents");var e=this.generateServerValues(),n=function(t,e){var n=new ie;return t.forEachTree(new B(""),function(t,r){n.remember(t,ae(r,e))}),n}(this.onDisconnect_,e),r=[];n.forEachTree(B.Empty,function(e,n){r=r.concat(t.serverSyncTree_.applyServerOverwrite(e,n));var i=t.abortTransactions_(e);t.rerunTransactions_(i)}),this.onDisconnect_=new ie,this.eventQueue_.raiseEventsForChangedPath(B.Empty,r)},t.prototype.onDisconnectCancel=function(t,e){var n=this;this.server_.onDisconnectCancel(t.toString(),function(r,i){"ok"===r&&n.onDisconnect_.forget(t),n.callOnCompleteCallback(e,r,i)})},t.prototype.onDisconnectSet=function(t,e,n){var r=this,i=Qt(e);this.server_.onDisconnectPut(t.toString(),i.val(!0),function(e,o){"ok"===e&&r.onDisconnect_.remember(t,i),r.callOnCompleteCallback(n,e,o)})},t.prototype.onDisconnectSetWithPriority=function(t,e,n,r){var i=this,o=Qt(e,n);this.server_.onDisconnectPut(t.toString(),o.val(!0),function(e,n){"ok"===e&&i.onDisconnect_.remember(t,o),i.callOnCompleteCallback(r,e,n)})},t.prototype.onDisconnectUpdate=function(t,e,n){var r=this;if(s.isEmpty(e))return S("onDisconnect().update() called with empty data.  Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.server_.onDisconnectMerge(t.toString(),e,function(i,o){"ok"===i&&s.forEach(e,function(e,n){var i=Qt(n);r.onDisconnect_.remember(t.child(e),i)}),r.callOnCompleteCallback(n,i,o)})},t.prototype.addEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.infoSyncTree_.addEventRegistration(t,e):this.serverSyncTree_.addEventRegistration(t,e),this.eventQueue_.raiseEventsAtPath(t.path,n)},t.prototype.removeEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.infoSyncTree_.removeEventRegistration(t,e):this.serverSyncTree_.removeEventRegistration(t,e),this.eventQueue_.raiseEventsAtPath(t.path,n)},t.prototype.interrupt=function(){this.persistentConnection_&&this.persistentConnection_.interrupt("repo_interrupt")},t.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume("repo_interrupt")},t.prototype.stats=function(t){if(void 0===t&&(t=!1),"undefined"!==typeof console){var e;t?(this.statsListener_||(this.statsListener_=new Me(this.stats_)),e=this.statsListener_.get()):e=this.stats_.get();var n=Object.keys(e).reduce(function(t,e){return Math.max(e.length,t)},0);s.forEach(e,function(t,e){for(var r=t.length;r<n+2;r++)t+=" ";console.log(t+e)})}},t.prototype.statsIncrementCounter=function(t){this.stats_.incrementCounter(t),this.statsReporter_.includeStat(t)},t.prototype.log_=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="";this.persistentConnection_&&(n=this.persistentConnection_.id+":"),S.apply(void 0,[n].concat(t))},t.prototype.callOnCompleteCallback=function(t,e,n){t&&W(function(){if("ok"==e)t(null);else{var r=(e||"error").toUpperCase(),i=r;n&&(i+=": "+n);var o=new Error(i);o.code=r,t(o)}})},Object.defineProperty(t.prototype,"database",{get:function(){return this.__database||(this.__database=new vn(this))},enumerable:!0,configurable:!0}),t}(),sn=function(){function t(e){this.indexedFilter_=new _e(e.getIndex()),this.index_=e.getIndex(),this.startPost_=t.getStartPost_(e),this.endPost_=t.getEndPost_(e)}return t.prototype.getStartPost=function(){return this.startPost_},t.prototype.getEndPost=function(){return this.endPost_},t.prototype.matches=function(t){return this.index_.compare(this.getStartPost(),t)<=0&&this.index_.compare(t,this.getEndPost())<=0},t.prototype.updateChild=function(t,e,n,r,i,o){return this.matches(new _t(e,n))||(n=Bt.EMPTY_NODE),this.indexedFilter_.updateChild(t,e,n,r,i,o)},t.prototype.updateFullNode=function(t,e,n){e.isLeafNode()&&(e=Bt.EMPTY_NODE);var r=e.withIndex(this.index_);r=r.updatePriority(Bt.EMPTY_NODE);var i=this;return e.forEachChild(Pt,function(t,e){i.matches(new _t(t,e))||(r=r.updateImmediateChild(t,Bt.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.indexedFilter_},t.prototype.getIndex=function(){return this.index_},t.getStartPost_=function(t){if(t.hasStart()){var e=t.getIndexStartName();return t.getIndex().makePost(t.getIndexStartValue(),e)}return t.getIndex().minPost()},t.getEndPost_=function(t){if(t.hasEnd()){var e=t.getIndexEndName();return t.getIndex().makePost(t.getIndexEndValue(),e)}return t.getIndex().maxPost()},t}(),un=function(){function t(t){this.rangedFilter_=new sn(t),this.index_=t.getIndex(),this.limit_=t.getLimit(),this.reverse_=!t.isViewFromLeft()}return t.prototype.updateChild=function(t,e,n,r,i,o){return this.rangedFilter_.matches(new _t(e,n))||(n=Bt.EMPTY_NODE),t.getImmediateChild(e).equals(n)?t:t.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(t,e,n,r,i,o):this.fullLimitUpdateChild_(t,e,n,i,o)},t.prototype.updateFullNode=function(t,e,n){var r;if(e.isLeafNode()||e.isEmpty())r=Bt.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<e.numChildren()&&e.isIndexed(this.index_)){r=Bt.EMPTY_NODE.withIndex(this.index_);var i=void 0;i=this.reverse_?e.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):e.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var o=0;i.hasNext()&&o<this.limit_;){var a=i.getNext();if(!(this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),a)<=0:this.index_.compare(a,this.rangedFilter_.getEndPost())<=0))break;r=r.updateImmediateChild(a.name,a.node),o++}}else{r=(r=e.withIndex(this.index_)).updatePriority(Bt.EMPTY_NODE);var s=void 0,u=void 0,c=void 0;i=void 0;if(this.reverse_){i=r.getReverseIterator(this.index_),s=this.rangedFilter_.getEndPost(),u=this.rangedFilter_.getStartPost();var h=this.index_.getCompare();c=function(t,e){return h(e,t)}}else i=r.getIterator(this.index_),s=this.rangedFilter_.getStartPost(),u=this.rangedFilter_.getEndPost(),c=this.index_.getCompare();o=0;for(var l=!1;i.hasNext();){a=i.getNext();!l&&c(s,a)<=0&&(l=!0),l&&o<this.limit_&&c(a,u)<=0?o++:r=r.updateImmediateChild(a.name,Bt.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},t.prototype.getIndex=function(){return this.index_},t.prototype.fullLimitUpdateChild_=function(t,e,n,r,i){var o;if(this.reverse_){var a=this.index_.getCompare();o=function(t,e){return a(e,t)}}else o=this.index_.getCompare();var u=t;s.assert(u.numChildren()==this.limit_,"");var c=new _t(e,n),h=this.reverse_?u.getFirstChild(this.index_):u.getLastChild(this.index_),l=this.rangedFilter_.matches(c);if(u.hasChild(e)){for(var f=u.getImmediateChild(e),p=r.getChildAfterChild(this.index_,h,this.reverse_);null!=p&&(p.name==e||u.hasChild(p.name));)p=r.getChildAfterChild(this.index_,p,this.reverse_);var d=null==p?1:o(p,c);if(l&&!n.isEmpty()&&d>=0)return null!=i&&i.trackChildChange(me.childChangedChange(e,n,f)),u.updateImmediateChild(e,n);null!=i&&i.trackChildChange(me.childRemovedChange(e,f));var y=u.updateImmediateChild(e,Bt.EMPTY_NODE);return null!=p&&this.rangedFilter_.matches(p)?(null!=i&&i.trackChildChange(me.childAddedChange(p.name,p.node)),y.updateImmediateChild(p.name,p.node)):y}return n.isEmpty()?t:l&&o(h,c)>=0?(null!=i&&(i.trackChildChange(me.childRemovedChange(h.name,h.node)),i.trackChildChange(me.childAddedChange(e,n))),u.updateImmediateChild(e,n).updateImmediateChild(h.name,Bt.EMPTY_NODE)):t},t}(),cn=function(){function t(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Pt}return t.prototype.hasStart=function(){return this.startSet_},t.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:this.viewFrom_===t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT},t.prototype.getIndexStartValue=function(){return s.assert(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},t.prototype.getIndexStartName=function(){return s.assert(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:A},t.prototype.hasEnd=function(){return this.endSet_},t.prototype.getIndexEndValue=function(){return s.assert(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},t.prototype.getIndexEndName=function(){return s.assert(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:x},t.prototype.hasLimit=function(){return this.limitSet_},t.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},t.prototype.getLimit=function(){return s.assert(this.limitSet_,"Only valid if limit has been set"),this.limit_},t.prototype.getIndex=function(){return this.index_},t.prototype.copy_=function(){var e=new t;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e},t.prototype.limit=function(t){var e=this.copy_();return e.limitSet_=!0,e.limit_=t,e.viewFrom_="",e},t.prototype.limitToFirst=function(e){var n=this.copy_();return n.limitSet_=!0,n.limit_=e,n.viewFrom_=t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT,n},t.prototype.limitToLast=function(e){var n=this.copy_();return n.limitSet_=!0,n.limit_=e,n.viewFrom_=t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT,n},t.prototype.startAt=function(t,e){var n=this.copy_();return n.startSet_=!0,void 0===t&&(t=null),n.indexStartValue_=t,null!=e?(n.startNameSet_=!0,n.indexStartName_=e):(n.startNameSet_=!1,n.indexStartName_=""),n},t.prototype.endAt=function(t,e){var n=this.copy_();return n.endSet_=!0,void 0===t&&(t=null),n.indexEndValue_=t,void 0!==e?(n.endNameSet_=!0,n.indexEndName_=e):(n.endNameSet_=!1,n.indexEndName_=""),n},t.prototype.orderBy=function(t){var e=this.copy_();return e.index_=t,e},t.prototype.getQueryObject=function(){var e=t.WIRE_PROTOCOL_CONSTANTS_,n={};if(this.startSet_&&(n[e.INDEX_START_VALUE]=this.indexStartValue_,this.startNameSet_&&(n[e.INDEX_START_NAME]=this.indexStartName_)),this.endSet_&&(n[e.INDEX_END_VALUE]=this.indexEndValue_,this.endNameSet_&&(n[e.INDEX_END_NAME]=this.indexEndName_)),this.limitSet_){n[e.LIMIT]=this.limit_;var r=this.viewFrom_;""===r&&(r=this.isViewFromLeft()?e.VIEW_FROM_LEFT:e.VIEW_FROM_RIGHT),n[e.VIEW_FROM]=r}return this.index_!==Pt&&(n[e.INDEX]=this.index_.toString()),n},t.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},t.prototype.isDefault=function(){return this.loadsAllData()&&this.index_==Pt},t.prototype.getNodeFilter=function(){return this.loadsAllData()?new _e(this.getIndex()):this.hasLimit()?new un(this):new sn(this)},t.prototype.toRestQueryStringParameters=function(){var e,n=t.REST_QUERY_CONSTANTS_,r={};return this.isDefault()?r:(this.index_===Pt?e=n.PRIORITY_INDEX:this.index_===Xt?e=n.VALUE_INDEX:this.index_===Et?e=n.KEY_INDEX:(s.assert(this.index_ instanceof Yt,"Unrecognized index type!"),e=this.index_.toString()),r[n.ORDER_BY]=s.stringify(e),this.startSet_&&(r[n.START_AT]=s.stringify(this.indexStartValue_),this.startNameSet_&&(r[n.START_AT]+=","+s.stringify(this.indexStartName_))),this.endSet_&&(r[n.END_AT]=s.stringify(this.indexEndValue_),this.endNameSet_&&(r[n.END_AT]+=","+s.stringify(this.indexEndName_))),this.limitSet_&&(this.isViewFromLeft()?r[n.LIMIT_TO_FIRST]=this.limit_:r[n.LIMIT_TO_LAST]=this.limit_),r)},t.WIRE_PROTOCOL_CONSTANTS_={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},t.REST_QUERY_CONSTANTS_={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},t.DEFAULT=new t,t}(),hn=function(t){function e(e,n){if(!(e instanceof an))throw new Error("new Reference() no longer supported - use app.database().");return t.call(this,e,n,cn.DEFAULT,!1)||this}return c.__extends(e,t),e.prototype.getKey=function(){return s.validateArgCount("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},e.prototype.child=function(t){return s.validateArgCount("Reference.child",1,1,arguments.length),"number"===typeof t?t=String(t):t instanceof B||(null===this.path.getFront()?ft("Reference.child",1,t,!1):lt("Reference.child",1,t,!1)),new e(this.repo,this.path.child(t))},e.prototype.getParent=function(){s.validateArgCount("Reference.parent",0,0,arguments.length);var t=this.path.parent();return null===t?null:new e(this.repo,t)},e.prototype.getRoot=function(){s.validateArgCount("Reference.root",0,0,arguments.length);for(var t=this;null!==t.getParent();)t=t.getParent();return t},e.prototype.databaseProp=function(){return this.repo.database},e.prototype.set=function(t,e){s.validateArgCount("Reference.set",1,2,arguments.length),pt("Reference.set",this.path),ot("Reference.set",1,t,this.path,!1),s.validateCallback("Reference.set",2,e,!0);var n=new s.Deferred;return this.repo.setWithPriority(this.path,t,null,n.wrapCallback(e)),n.promise},e.prototype.update=function(t,e){if(s.validateArgCount("Reference.update",1,2,arguments.length),pt("Reference.update",this.path),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,N("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}st("Reference.update",1,t,this.path,!1),s.validateCallback("Reference.update",2,e,!0);var i=new s.Deferred;return this.repo.update(this.path,t,i.wrapCallback(e)),i.promise},e.prototype.setWithPriority=function(t,e,n){if(s.validateArgCount("Reference.setWithPriority",2,3,arguments.length),pt("Reference.setWithPriority",this.path),ot("Reference.setWithPriority",1,t,this.path,!1),ut("Reference.setWithPriority",2,e,!1),s.validateCallback("Reference.setWithPriority",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.setWithPriority failed: "+this.getKey()+" is a read-only object.";var r=new s.Deferred;return this.repo.setWithPriority(this.path,t,e,r.wrapCallback(n)),r.promise},e.prototype.remove=function(t){return s.validateArgCount("Reference.remove",0,1,arguments.length),pt("Reference.remove",this.path),s.validateCallback("Reference.remove",1,t,!0),this.set(null,t)},e.prototype.transaction=function(t,e,n){if(s.validateArgCount("Reference.transaction",1,3,arguments.length),pt("Reference.transaction",this.path),s.validateCallback("Reference.transaction",1,t,!1),s.validateCallback("Reference.transaction",2,e,!0),yt("Reference.transaction",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.transaction failed: "+this.getKey()+" is a read-only object.";void 0===n&&(n=!0);var r=new s.Deferred;"function"===typeof e&&r.promise.catch(function(){});var i=function(t,n,i){t?r.reject(t):r.resolve(new gt(n,i)),"function"===typeof e&&e(t,n,i)};return this.repo.startTransaction(this.path,t,i,n),r.promise},e.prototype.setPriority=function(t,e){s.validateArgCount("Reference.setPriority",1,2,arguments.length),pt("Reference.setPriority",this.path),ut("Reference.setPriority",1,t,!1),s.validateCallback("Reference.setPriority",2,e,!0);var n=new s.Deferred;return this.repo.setWithPriority(this.path.child(".priority"),t,null,n.wrapCallback(e)),n.promise},e.prototype.push=function(t,e){s.validateArgCount("Reference.push",0,2,arguments.length),pt("Reference.push",this.path),ot("Reference.push",1,t,this.path,!0),s.validateCallback("Reference.push",2,e,!0);var n,r=this.repo.serverTime(),i=mt(r),o=this.child(i),a=this.child(i);return n=null!=t?o.set(t,e).then(function(){return a}):Promise.resolve(a),o.then=n.then.bind(n),o.catch=n.then.bind(n,void 0),"function"===typeof e&&n.catch(function(){}),o},e.prototype.onDisconnect=function(){return pt("Reference.onDisconnect",this.path),new vt(this.repo,this.path)},Object.defineProperty(e.prototype,"database",{get:function(){return this.databaseProp()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this.getKey()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.getParent()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this.getRoot()},enumerable:!0,configurable:!0}),e}(ne);ne.__referenceConstructor=hn,Ne.__referenceConstructor=hn;var ln,fn=function(){this.children={},this.childCount=0,this.value=null},pn=function(){function t(t,e,n){void 0===t&&(t=""),void 0===e&&(e=null),void 0===n&&(n=new fn),this.name_=t,this.parent_=e,this.node_=n}return t.prototype.subTree=function(e){for(var n,r=e instanceof B?e:new B(e),i=this;null!==(n=r.getFront());){i=new t(n,i,s.safeGet(i.node_.children,n)||new fn),r=r.popFront()}return i},t.prototype.getValue=function(){return this.node_.value},t.prototype.setValue=function(t){s.assert("undefined"!==typeof t,"Cannot set value to undefined"),this.node_.value=t,this.updateParents_()},t.prototype.clear=function(){this.node_.value=null,this.node_.children={},this.node_.childCount=0,this.updateParents_()},t.prototype.hasChildren=function(){return this.node_.childCount>0},t.prototype.isEmpty=function(){return null===this.getValue()&&!this.hasChildren()},t.prototype.forEachChild=function(e){var n=this;s.forEach(this.node_.children,function(r,i){e(new t(r,n,i))})},t.prototype.forEachDescendant=function(t,e,n){e&&!n&&t(this),this.forEachChild(function(e){e.forEachDescendant(t,!0,n)}),e&&n&&t(this)},t.prototype.forEachAncestor=function(t,e){for(var n=e?this:this.parent();null!==n;){if(t(n))return!0;n=n.parent()}return!1},t.prototype.forEachImmediateDescendantWithValue=function(t){this.forEachChild(function(e){null!==e.getValue()?t(e):e.forEachImmediateDescendantWithValue(t)})},t.prototype.path=function(){return new B(null===this.parent_?this.name_:this.parent_.path()+"/"+this.name_)},t.prototype.name=function(){return this.name_},t.prototype.parent=function(){return this.parent_},t.prototype.updateParents_=function(){null!==this.parent_&&this.parent_.updateChild_(this.name_,this)},t.prototype.updateChild_=function(t,e){var n=e.isEmpty(),r=s.contains(this.node_.children,t);n&&r?(delete this.node_.children[t],this.node_.childCount--,this.updateParents_()):n||r||(this.node_.children[t]=e.node_,this.node_.childCount++,this.updateParents_())},t}();!function(t){t[t.RUN=0]="RUN",t[t.SENT=1]="SENT",t[t.COMPLETED=2]="COMPLETED",t[t.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",t[t.NEEDS_ABORT=4]="NEEDS_ABORT"}(ln||(ln={})),an.MAX_TRANSACTION_RETRIES_=25,an.prototype.transactions_init_=function(){this.transactionQueueTree_=new pn},an.prototype.startTransaction=function(t,e,n,r){this.log_("transaction on "+t);var o=function(){},a=new hn(this,t);a.on("value",o);var u={path:t,update:e,onComplete:n,status:null,order:g(),applyLocally:r,retryCount:0,unwatcher:function(){a.off("value",o)},abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},c=this.getLatestState_(t);u.currentInputSnapshot=c;var h=u.update(c.val());if(void 0===h){if(u.unwatcher(),u.currentOutputSnapshotRaw=null,u.currentOutputSnapshotResolved=null,u.onComplete){var l=new $t(u.currentInputSnapshot,new hn(this,u.path),Pt);u.onComplete(null,!1,l)}}else{at("transaction failed: Data returned ",h,u.path),u.status=ln.RUN;var f=this.transactionQueueTree_.subTree(t),p=f.getValue()||[];p.push(u),f.setValue(p);var d=void 0;if("object"===i(h)&&null!==h&&s.contains(h,".priority"))d=s.safeGet(h,".priority"),s.assert(it(d),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.");else d=(this.serverSyncTree_.calcCompleteEventCache(t)||Bt.EMPTY_NODE).getPriority().val();d=d;var y=this.generateServerValues(),v=Qt(h,d),m=ae(v,y);u.currentOutputSnapshotRaw=v,u.currentOutputSnapshotResolved=m,u.currentWriteId=this.getNextWriteId_();var _=this.serverSyncTree_.applyUserOverwrite(t,m,u.currentWriteId,u.applyLocally);this.eventQueue_.raiseEventsForChangedPath(t,_),this.sendReadyTransactions_()}},an.prototype.getLatestState_=function(t,e){return this.serverSyncTree_.calcCompleteEventCache(t,e)||Bt.EMPTY_NODE},an.prototype.sendReadyTransactions_=function(t){var e=this;if(void 0===t&&(t=this.transactionQueueTree_),t||this.pruneCompletedTransactionsBelowNode_(t),null!==t.getValue()){var n=this.buildTransactionQueue_(t);s.assert(n.length>0,"Sending zero length transaction queue"),n.every(function(t){return t.status===ln.RUN})&&this.sendTransactionQueue_(t.path(),n)}else t.hasChildren()&&t.forEachChild(function(t){e.sendReadyTransactions_(t)})},an.prototype.sendTransactionQueue_=function(t,e){for(var n=this,r=e.map(function(t){return t.currentWriteId}),i=this.getLatestState_(t,r),o=i,a=i.hash(),u=0;u<e.length;u++){var c=e[u];s.assert(c.status===ln.RUN,"tryToSendTransactionQueue_: items in queue should all be run."),c.status=ln.SENT,c.retryCount++;var h=B.relativePath(t,c.path);o=o.updateChild(h,c.currentOutputSnapshotRaw)}var l=o.val(!0),f=t;this.server_.put(f.toString(),l,function(r){n.log_("transaction put response",{path:f.toString(),status:r});var i=[];if("ok"===r){for(var o=[],a=0;a<e.length;a++){if(e[a].status=ln.COMPLETED,i=i.concat(n.serverSyncTree_.ackUserWrite(e[a].currentWriteId)),e[a].onComplete){var s=e[a].currentOutputSnapshotResolved,u=new hn(n,e[a].path),c=new $t(s,u,Pt);o.push(e[a].onComplete.bind(null,null,!0,c))}e[a].unwatcher()}n.pruneCompletedTransactionsBelowNode_(n.transactionQueueTree_.subTree(t)),n.sendReadyTransactions_(),n.eventQueue_.raiseEventsForChangedPath(t,i);for(a=0;a<o.length;a++)W(o[a])}else{if("datastale"===r)for(a=0;a<e.length;a++)e[a].status===ln.SENT_NEEDS_ABORT?e[a].status=ln.NEEDS_ABORT:e[a].status=ln.RUN;else{N("transaction at "+f.toString()+" failed: "+r);for(a=0;a<e.length;a++)e[a].status=ln.NEEDS_ABORT,e[a].abortReason=r}n.rerunTransactions_(t)}},a)},an.prototype.rerunTransactions_=function(t){var e=this.getAncestorTransactionNode_(t),n=e.path(),r=this.buildTransactionQueue_(e);return this.rerunTransactionQueue_(r,n),n},an.prototype.rerunTransactionQueue_=function(t,e){if(0!==t.length){for(var n,r=[],o=[],a=t.filter(function(t){return t.status===ln.RUN}).map(function(t){return t.currentWriteId}),u=0;u<t.length;u++){var c=t[u],h=B.relativePath(e,c.path),l=!1,f=void 0;if(s.assert(null!==h,"rerunTransactionsUnderNode_: relativePath should not be null."),c.status===ln.NEEDS_ABORT)l=!0,f=c.abortReason,o=o.concat(this.serverSyncTree_.ackUserWrite(c.currentWriteId,!0));else if(c.status===ln.RUN)if(c.retryCount>=an.MAX_TRANSACTION_RETRIES_)l=!0,f="maxretry",o=o.concat(this.serverSyncTree_.ackUserWrite(c.currentWriteId,!0));else{var p=this.getLatestState_(c.path,a);c.currentInputSnapshot=p;var d=t[u].update(p.val());if(void 0!==d){at("transaction failed: Data returned ",d,c.path);var y=Qt(d);"object"===i(d)&&null!=d&&s.contains(d,".priority")||(y=y.updatePriority(p.getPriority()));var v=c.currentWriteId,g=this.generateServerValues(),m=ae(y,g);c.currentOutputSnapshotRaw=y,c.currentOutputSnapshotResolved=m,c.currentWriteId=this.getNextWriteId_(),a.splice(a.indexOf(v),1),o=(o=o.concat(this.serverSyncTree_.applyUserOverwrite(c.path,m,c.currentWriteId,c.applyLocally))).concat(this.serverSyncTree_.ackUserWrite(v,!0))}else l=!0,f="nodata",o=o.concat(this.serverSyncTree_.ackUserWrite(c.currentWriteId,!0))}if(this.eventQueue_.raiseEventsForChangedPath(e,o),o=[],l&&(t[u].status=ln.COMPLETED,n=t[u].unwatcher,setTimeout(n,Math.floor(0)),t[u].onComplete))if("nodata"===f){var _=new hn(this,t[u].path),b=t[u].currentInputSnapshot,w=new $t(b,_,Pt);r.push(t[u].onComplete.bind(null,null,!1,w))}else r.push(t[u].onComplete.bind(null,new Error(f),!1,null))}this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_);for(u=0;u<r.length;u++)W(r[u]);this.sendReadyTransactions_()}},an.prototype.getAncestorTransactionNode_=function(t){for(var e,n=this.transactionQueueTree_;null!==(e=t.getFront())&&null===n.getValue();)n=n.subTree(e),t=t.popFront();return n},an.prototype.buildTransactionQueue_=function(t){var e=[];return this.aggregateTransactionQueuesForNode_(t,e),e.sort(function(t,e){return t.order-e.order}),e},an.prototype.aggregateTransactionQueuesForNode_=function(t,e){var n=this,r=t.getValue();if(null!==r)for(var i=0;i<r.length;i++)e.push(r[i]);t.forEachChild(function(t){n.aggregateTransactionQueuesForNode_(t,e)})},an.prototype.pruneCompletedTransactionsBelowNode_=function(t){var e=this,n=t.getValue();if(n){for(var r=0,i=0;i<n.length;i++)n[i].status!==ln.COMPLETED&&(n[r]=n[i],r++);n.length=r,t.setValue(n.length>0?n:null)}t.forEachChild(function(t){e.pruneCompletedTransactionsBelowNode_(t)})},an.prototype.abortTransactions_=function(t){var e=this,n=this.getAncestorTransactionNode_(t).path(),r=this.transactionQueueTree_.subTree(t);return r.forEachAncestor(function(t){e.abortTransactionsOnNode_(t)}),this.abortTransactionsOnNode_(r),r.forEachDescendant(function(t){e.abortTransactionsOnNode_(t)}),n},an.prototype.abortTransactionsOnNode_=function(t){var e=t.getValue();if(null!==e){for(var n=[],r=[],i=-1,o=0;o<e.length;o++)if(e[o].status===ln.SENT_NEEDS_ABORT);else if(e[o].status===ln.SENT)s.assert(i===o-1,"All SENT items should be at beginning of queue."),i=o,e[o].status=ln.SENT_NEEDS_ABORT,e[o].abortReason="set";else if(s.assert(e[o].status===ln.RUN,"Unexpected transaction status in abort"),e[o].unwatcher(),r=r.concat(this.serverSyncTree_.ackUserWrite(e[o].currentWriteId,!0)),e[o].onComplete){n.push(e[o].onComplete.bind(null,new Error("set"),!1,null))}-1===i?t.setValue(null):e.length=i+1,this.eventQueue_.raiseEventsForChangedPath(t.path(),r);for(o=0;o<n.length;o++)W(n[o])}};var dn,yn=function(){function t(){this.repos_={},this.useRestClient_=!1}return t.getInstance=function(){return dn||(dn=new t),dn},t.prototype.interrupt=function(){for(var t in this.repos_)for(var e in this.repos_[t])this.repos_[t][e].interrupt()},t.prototype.resume=function(){for(var t in this.repos_)for(var e in this.repos_[t])this.repos_[t][e].resume()},t.prototype.databaseFromApp=function(t,e){var n=e||t.options.databaseURL;void 0===n&&I("Can't determine Firebase Database URL.  Be sure to include databaseURL option when calling firebase.initializeApp().");var r=J(n),i=r.repoInfo;return dt("Invalid Firebase Database URL",1,r),r.path.isEmpty()||I("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(i,t).database},t.prototype.deleteRepo=function(t){var e=s.safeGet(this.repos_,t.app.name);e&&s.safeGet(e,t.repoInfo_.toURLString())===t||I("Database "+t.app.name+"("+t.repoInfo_+") has already been deleted."),t.interrupt(),delete e[t.repoInfo_.toURLString()]},t.prototype.createRepo=function(t,e){var n=s.safeGet(this.repos_,e.name);n||(n={},this.repos_[e.name]=n);var r=s.safeGet(n,t.toURLString());return r&&I("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),r=new an(t,this.useRestClient_,e),n[t.toURLString()]=r,r},t.prototype.forceRestClient=function(t){this.useRestClient_=t},t}(),vn=function(){function t(t){this.repo_=t,t instanceof an||I("Don't call new Database() directly - please use firebase.database()."),this.root_=new hn(t,B.Empty),this.INTERNAL=new gn(this)}return Object.defineProperty(t.prototype,"app",{get:function(){return this.repo_.app},enumerable:!0,configurable:!0}),t.prototype.ref=function(t){return this.checkDeleted_("ref"),s.validateArgCount("database.ref",0,1,arguments.length),t instanceof hn?this.refFromURL(t.toString()):void 0!==t?this.root_.child(t):this.root_},t.prototype.refFromURL=function(t){var e="database.refFromURL";this.checkDeleted_(e),s.validateArgCount(e,1,1,arguments.length);var n=J(t);dt(e,1,n);var r=n.repoInfo;return r.host!==this.repo_.repoInfo_.host&&I(e+": Host name does not match the current database: (found "+r.host+" but expected "+this.repo_.repoInfo_.host+")"),this.ref(n.path.toString())},t.prototype.checkDeleted_=function(t){null===this.repo_&&I("Cannot call "+t+" on a deleted database.")},t.prototype.goOffline=function(){s.validateArgCount("database.goOffline",0,0,arguments.length),this.checkDeleted_("goOffline"),this.repo_.interrupt()},t.prototype.goOnline=function(){s.validateArgCount("database.goOnline",0,0,arguments.length),this.checkDeleted_("goOnline"),this.repo_.resume()},t.ServerValue={TIMESTAMP:{".sv":"timestamp"}},t}(),gn=function(){function t(t){this.database=t}return t.prototype.delete=function(){return c.__awaiter(this,void 0,void 0,function(){return c.__generator(this,function(t){return this.database.checkDeleted_("delete"),yn.getInstance().deleteRepo(this.database.repo_),this.database.repo_=null,this.database.root_=null,this.database.INTERNAL=null,this.database=null,[2]})})},t}(),mn=Object.freeze({forceLongPolling:function(){$e.forceDisallow(),ze.forceAllow()},forceWebSockets:function(){ze.forceDisallow()},isWebSocketsAvailable:function(){return $e.isAvailable()},setSecurityDebugCallback:function(t,e){t.repo.persistentConnection_.securityDebugCallback_=e},stats:function(t,e){t.repo.stats(e)},statsIncrementCounter:function(t,e){t.repo.statsIncrementCounter(e)},dataUpdateCount:function(t){return t.repo.dataUpdateCount},interceptServerData:function(t,e){return t.repo.interceptServerData_(e)}}),_n=rn;rn.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)},rn.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};var bn=Ze,wn=Q,En=Object.freeze({DataConnection:_n,RealTimeConnection:bn,hijackHash:function(t){var e=rn.prototype.put;return rn.prototype.put=function(n,r,i,o){void 0!==o&&(o=t()),e.call(this,n,r,i,o)},function(){rn.prototype.put=e}},ConnectionTarget:wn,queryIdentifier:function(t){return t.queryIdentifier()},listens:function(t){return t.repo.persistentConnection_.listens_},forceRestClient:function(t){yn.getInstance().forceRestClient(t)}}),Sn=vn.ServerValue;function Cn(e){var n=e.INTERNAL.registerService("database",function(t,e,n){return yn.getInstance().databaseFromApp(t,n)},{Reference:hn,Query:ne,Database:vn,enableLogging:E,INTERNAL:mn,ServerValue:Sn,TEST_ACCESS:En},null,!0);s.isNodeSdk()&&(t.exports=n)}Cn(h),e.registerDatabase=Cn,e.Database=vn,e.Query=ne,e.Reference=hn,e.enableLogging=E,e.ServerValue=Sn,e.DataSnapshot=$t,e.OnDisconnect=vt}).call(this,n(93))},864:function(t,e,n){"use strict";(function(t){var e=n(32),r=n.n(e);function i(t){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}(function(){var t,e=e||{},n=this;function o(t){return"string"==typeof t}function a(t){return"boolean"==typeof t}function s(){}function u(t){var e=i(t);if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&"undefined"!=typeof t.splice&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof t.call&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&"undefined"==typeof t.call)return"object";return e}function c(t){return null===t}function h(t){return"array"==u(t)}function l(t){var e=u(t);return"array"==e||"object"==e&&"number"==typeof t.length}function f(t){return"function"==u(t)}function p(t){var e=i(t);return"object"==e&&null!=t||"function"==e}var d="closure_uid_"+(1e9*Math.random()>>>0),y=0;function v(t,e,n){return t.call.apply(t.bind,arguments)}function g(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function m(t,e,n){return(m=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?v:g).apply(null,arguments)}function _(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}var b=Date.now||function(){return+new Date};function w(t,e){function n(){}n.prototype=e.prototype,t.ob=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.ed=function(t,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return e.prototype[n].apply(t,i)}}function E(t){t.prototype.then=t.prototype.then,t.prototype.$goog_Thenable=!0}function S(t){if(!t)return!1;try{return!!t.$goog_Thenable}catch(e){return!1}}function C(t){if(Error.captureStackTrace)Error.captureStackTrace(this,C);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function T(t,e){for(var n="",r=(t=t.split("%s")).length-1,i=0;i<r;i++)n+=t[i]+(i<e.length?e[i]:"%s");C.call(this,n+t[r])}function I(t,e){throw new T("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function N(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function O(t,e){t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}function A(){this.b=this.a=null}w(C,Error),C.prototype.name="CustomError",w(T,C),T.prototype.name="AssertionError",N.prototype.get=function(){if(0<this.b){this.b--;var t=this.a;this.a=t.next,t.next=null}else t=this.c();return t};var x=new N(function(){return new k},function(t){t.reset()});function P(){var t=dt,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function k(){this.next=this.b=this.a=null}A.prototype.add=function(t,e){var n=x.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},k.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},k.prototype.reset=function(){this.next=this.b=this.a=null};var R=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if(o(t))return o(e)&&1==e.length?t.indexOf(e,0):-1;for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},D=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i=o(t)?t.split(""):t,a=0;a<r;a++)a in i&&e.call(n,i[a],a,t)};var L=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=Array(n),i=o(t)?t.split(""):t,a=0;a<n;a++)a in i&&(r[a]=e.call(void 0,i[a],a,t));return r},M=Array.prototype.some?function(t,e){return Array.prototype.some.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=o(t)?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t))return!0;return!1};function F(t,e){return 0<=R(t,e)}function j(t,e){var n;return(n=0<=(e=R(t,e)))&&Array.prototype.splice.call(t,e,1),n}function U(t,e){!function(t,e){var n=t.length,r=o(t)?t.split(""):t;for(--n;0<=n;--n)n in r&&e.call(void 0,r[n],n,t)}(t,function(n,r){e.call(void 0,n,r,t)&&1==Array.prototype.splice.call(t,r,1).length&&0})}function W(t){return Array.prototype.concat.apply([],arguments)}function V(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}function q(t,e){for(var n=t.split("%s"),r="",i=Array.prototype.slice.call(arguments,1);i.length&&1<n.length;)r+=n.shift()+i.shift();return r+n.join("%s")}var B=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function H(t){return J.test(t)?(-1!=t.indexOf("&")&&(t=t.replace(Q,"&amp;")),-1!=t.indexOf("<")&&(t=t.replace(G,"&lt;")),-1!=t.indexOf(">")&&(t=t.replace(z,"&gt;")),-1!=t.indexOf('"')&&(t=t.replace(X,"&quot;")),-1!=t.indexOf("'")&&(t=t.replace(Y,"&#39;")),-1!=t.indexOf("\0")&&(t=t.replace($,"&#0;")),t):t}var K,Q=/&/g,G=/</g,z=/>/g,X=/"/g,Y=/'/g,$=/\x00/g,J=/[\x00&<>"']/;function Z(t,e){return-1!=t.indexOf(e)}function tt(t,e){return t<e?-1:t>e?1:0}t:{var et=n.navigator;if(et){var nt=et.userAgent;if(nt){K=nt;break t}}K=""}function rt(t){return Z(K,t)}function it(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function ot(t){for(var e in t)return!1;return!0}function at(t){var e,n={};for(e in t)n[e]=t[e];return n}var st,ut,ct="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function ht(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<ct.length;o++)n=ct[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function lt(t){n.setTimeout(function(){throw t},0)}function ft(t,e){ut||function(){if(n.Promise&&n.Promise.resolve){var t=n.Promise.resolve(void 0);ut=function(){t.then(yt)}}else ut=function(){var t=yt;!f(n.setImmediate)||n.Window&&n.Window.prototype&&!rt("Edge")&&n.Window.prototype.setImmediate==n.setImmediate?(st||(st=function(){var t=n.MessageChannel;if("undefined"===typeof t&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!rt("Presto")&&(t=function(){var t=document.createElement("IFRAME");t.style.display="none",t.src="",document.documentElement.appendChild(t);var e=t.contentWindow;t=e.document,t.open(),t.write(""),t.close();var n="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=m(function(t){"*"!=r&&t.origin!=r||t.data!=n||this.port1.onmessage()},this),e.addEventListener("message",t,!1),this.port1={},this.port2={postMessage:function(){e.postMessage(n,r)}}}),"undefined"!==typeof t&&!rt("Trident")&&!rt("MSIE")){var e=new t,r={},i=r;return e.port1.onmessage=function(){if(void 0!==r.next){var t=(r=r.next).wb;r.wb=null,t()}},function(t){i.next={wb:t},i=i.next,e.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(t){var e=document.createElement("SCRIPT");e.onreadystatechange=function(){e.onreadystatechange=null,e.parentNode.removeChild(e),e=null,t(),t=null},document.documentElement.appendChild(e)}:function(t){n.setTimeout(t,0)}}()),st(t)):n.setImmediate(t)}}(),pt||(ut(),pt=!0),dt.add(t,e)}var pt=!1,dt=new A;function yt(){for(var t;t=P();){try{t.a.call(t.b)}catch(e){lt(e)}O(x,t)}pt=!1}function vt(t,e){if(this.a=gt,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,t!=s)try{var n=this;t.call(e,function(t){At(n,mt,t)},function(t){if(!(t instanceof Mt))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(e){}At(n,_t,t)})}catch(r){At(this,_t,r)}}var gt=0,mt=2,_t=3;function bt(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}bt.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var wt=new N(function(){return new bt},function(t){t.reset()});function Et(t,e,n){var r=wt.get();return r.g=t,r.b=e,r.f=n,r}function St(t){if(t instanceof vt)return t;var e=new vt(s);return At(e,mt,t),e}function Ct(t){return new vt(function(e,n){n(t)})}function Tt(t,e,n){xt(t,e,n,null)||ft(_(e,t))}function It(t){return new vt(function(e){var n=t.length,r=[];if(n)for(var i=function(t,i,o){n--,r[t]=i?{Db:!0,value:o}:{Db:!1,reason:o},0==n&&e(r)},o=0;o<t.length;o++)Tt(t[o],_(i,o,!0),_(i,o,!1));else e(r)})}function Nt(t,e){t.b||t.a!=mt&&t.a!=_t||Pt(t),t.f?t.f.next=e:t.b=e,t.f=e}function Ot(t,e,n,r){var i=Et(null,null,null);return i.a=new vt(function(t,o){i.g=e?function(n){try{var i=e.call(r,n);t(i)}catch(a){o(a)}}:t,i.b=n?function(e){try{var i=n.call(r,e);void 0===i&&e instanceof Mt?o(e):t(i)}catch(a){o(a)}}:o}),i.a.c=t,Nt(t,i),i.a}function At(t,e,n){t.a==gt&&(t===n&&(e=_t,n=new TypeError("Promise cannot resolve to itself")),t.a=1,xt(n,t.Nc,t.Oc,t)||(t.i=n,t.a=e,t.c=null,Pt(t),e!=_t||n instanceof Mt||function(t,e){t.g=!0,ft(function(){t.g&&Lt.call(null,e)})}(t,n)))}function xt(t,e,n,r){if(t instanceof vt)return Nt(t,Et(e||s,n||null,r)),!0;if(S(t))return t.then(e,n,r),!0;if(p(t))try{var i=t.then;if(f(i))return function(t,e,n,r,i){function o(t){a||(a=!0,r.call(i,t))}var a=!1;try{e.call(t,function(t){a||(a=!0,n.call(i,t))},o)}catch(s){o(s)}}(t,i,e,n,r),!0}catch(o){return n.call(r,o),!0}return!1}function Pt(t){t.h||(t.h=!0,ft(t.Yb,t))}function kt(t){var e=null;return t.b&&(e=t.b,t.b=e.next,e.next=null),t.b||(t.f=null),e}function Rt(t,e,n,r){if(n==_t&&e.b&&!e.c)for(;t&&t.g;t=t.c)t.g=!1;if(e.a)e.a.c=null,Dt(e,n,r);else try{e.c?e.g.call(e.f):Dt(e,n,r)}catch(i){Lt.call(null,i)}O(wt,e)}function Dt(t,e,n){e==mt?t.g.call(t.f,n):t.b&&t.b.call(t.f,n)}vt.prototype.then=function(t,e,n){return Ot(this,f(t)?t:null,f(e)?e:null,n)},E(vt),(t=vt.prototype).ia=function(t,e){return(t=Et(t,t,e)).c=!0,Nt(this,t),this},t.s=function(t,e){return Ot(this,null,t,e)},t.cancel=function(t){this.a==gt&&ft(function(){!function t(e,n){if(e.a==gt)if(e.c){var r=e.c;if(r.b){for(var i=0,o=null,a=null,s=r.b;s&&(s.c||(i++,s.a==e&&(o=s),!(o&&1<i)));s=s.next)o||(a=s);o&&(r.a==gt&&1==i?t(r,n):(a?((i=a).next==r.f&&(r.f=i),i.next=i.next.next):kt(r),Rt(r,o,_t,n)))}e.c=null}else At(e,_t,n)}(this,new Mt(t))},this)},t.Nc=function(t){this.a=gt,At(this,mt,t)},t.Oc=function(t){this.a=gt,At(this,_t,t)},t.Yb=function(){for(var t;t=kt(this);)Rt(this,t,this.a,this.i);this.h=!1};var Lt=lt;function Mt(t){C.call(this,t)}function Ft(){0!=jt&&(Ut[this[d]||(this[d]=++y)]=this),this.qa=this.qa,this.ja=this.ja}w(Mt,C),Mt.prototype.name="cancel";var jt=0,Ut={};function Wt(t){if(!t.qa&&(t.qa=!0,t.va(),0!=jt)){var e=t[d]||(t[d]=++y);if(0!=jt&&t.ja&&0<t.ja.length)throw Error(t+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete Ut[e]}}function Vt(t){return Vt[" "](t),t}Ft.prototype.qa=!1,Ft.prototype.va=function(){if(this.ja)for(;this.ja.length;)this.ja.shift()()},Vt[" "]=s;var qt,Bt,Ht=rt("Opera"),Kt=rt("Trident")||rt("MSIE"),Qt=rt("Edge"),Gt=Qt||Kt,zt=rt("Gecko")&&!(Z(K.toLowerCase(),"webkit")&&!rt("Edge"))&&!(rt("Trident")||rt("MSIE"))&&!rt("Edge"),Xt=Z(K.toLowerCase(),"webkit")&&!rt("Edge");function Yt(){var t=n.document;return t?t.documentMode:void 0}t:{var $t="",Jt=(Bt=K,zt?/rv:([^\);]+)(\)|;)/.exec(Bt):Qt?/Edge\/([\d\.]+)/.exec(Bt):Kt?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(Bt):Xt?/WebKit\/(\S+)/.exec(Bt):Ht?/(?:Version)[ \/]?(\S+)/.exec(Bt):void 0);if(Jt&&($t=Jt?Jt[1]:""),Kt){var Zt=Yt();if(null!=Zt&&Zt>parseFloat($t)){qt=String(Zt);break t}}qt=$t}var te,ee={};function ne(t){return function(t,e){var n=ee;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}(t,function(){for(var e=0,n=B(String(qt)).split("."),r=B(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var a=n[o]||"",s=r[o]||"";do{if(a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==a[0].length&&0==s[0].length)break;e=tt(0==a[1].length?0:parseInt(a[1],10),0==s[1].length?0:parseInt(s[1],10))||tt(0==a[2].length,0==s[2].length)||tt(a[2],s[2]),a=a[3],s=s[3]}while(0==e)}return 0<=e})}var re=n.document;te=re&&Kt?Yt()||("CSS1Compat"==re.compatMode?parseInt(qt,10):5):void 0;var ie=Object.freeze||function(t){return t},oe=!Kt||9<=Number(te),ae=Kt&&!ne("9"),se=function(){if(!n.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});return n.addEventListener("test",s,e),n.removeEventListener("test",s,e),t}();function ue(t,e){this.type=t,this.b=this.target=e,this.Kb=!0}function ce(t,e){if(ue.call(this,t?t.type:""),this.relatedTarget=this.b=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.a=null,t){var n=this.type=t.type,r=t.changedTouches?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.b=e,e=t.relatedTarget){if(zt){t:{try{Vt(e.nodeName);var i=!0;break t}catch(a){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,null===r?(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0):(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType=o(t.pointerType)?t.pointerType:he[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.preventDefault()}}ue.prototype.preventDefault=function(){this.Kb=!1},w(ce,ue);var he=ie({2:"touch",3:"pen",4:"mouse"});ce.prototype.preventDefault=function(){ce.ob.preventDefault.call(this);var t=this.a;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,ae)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}},ce.prototype.f=function(){return this.a};var le="closure_listenable_"+(1e6*Math.random()|0),fe=0;function pe(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.La=i,this.key=++fe,this.oa=this.Ia=!1}function de(t){t.oa=!0,t.listener=null,t.proxy=null,t.src=null,t.La=null}function ye(t){this.src=t,this.a={},this.b=0}function ve(t,e){var n=e.type;n in t.a&&j(t.a[n],e)&&(de(e),0==t.a[n].length&&(delete t.a[n],t.b--))}function ge(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.oa&&o.listener==e&&o.capture==!!n&&o.La==r)return i}return-1}ye.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var a=ge(t,e,r,i);return-1<a?(e=t[a],n||(e.Ia=!1)):((e=new pe(e,this.src,o,!!r,i)).Ia=n,t.push(e)),e};var me="closure_lm_"+(1e6*Math.random()|0),_e={};function be(t,e,n,r,i){if(r&&r.once)Ee(t,e,n,r,i);else if(h(e))for(var o=0;o<e.length;o++)be(t,e[o],n,r,i);else n=Pe(n),t&&t[le]?Re(t,e,n,p(r)?!!r.capture:!!r,i):we(t,e,n,!1,r,i)}function we(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var a=p(i)?!!i.capture:!!i,s=Ae(t);if(s||(t[me]=s=new ye(t)),!(n=s.add(e,n,r,a,o)).proxy){if(r=function(){var t=Oe,e=oe?function(n){return t.call(e.src,e.listener,n)}:function(n){if(!(n=t.call(e.src,e.listener,n)))return n};return e}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)se||(i=a),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(Te(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}0}}function Ee(t,e,n,r,i){if(h(e))for(var o=0;o<e.length;o++)Ee(t,e[o],n,r,i);else n=Pe(n),t&&t[le]?De(t,e,n,p(r)?!!r.capture:!!r,i):we(t,e,n,!0,r,i)}function Se(t,e,n,r,i){if(h(e))for(var o=0;o<e.length;o++)Se(t,e[o],n,r,i);else r=p(r)?!!r.capture:!!r,n=Pe(n),t&&t[le]?(t=t.l,(e=String(e).toString())in t.a&&(-1<(n=ge(o=t.a[e],n,r,i))&&(de(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--)))):t&&(t=Ae(t))&&(e=t.a[e.toString()],t=-1,e&&(t=ge(e,n,r,i)),(n=-1<t?e[t]:null)&&Ce(n))}function Ce(t){if("number"!=typeof t&&t&&!t.oa){var e=t.src;if(e&&e[le])ve(e.l,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(Te(n),r):e.addListener&&e.removeListener&&e.removeListener(r),0,(n=Ae(e))?(ve(n,t),0==n.b&&(n.src=null,e[me]=null)):de(t)}}}function Te(t){return t in _e?_e[t]:_e[t]="on"+t}function Ie(t,e,n,r){var i=!0;if((t=Ae(t))&&(e=t.a[e.toString()]))for(e=e.concat(),t=0;t<e.length;t++){var o=e[t];o&&o.capture==n&&!o.oa&&(o=Ne(o,r),i=i&&!1!==o)}return i}function Ne(t,e){var n=t.listener,r=t.La||t.src;return t.Ia&&Ce(t),n.call(r,e)}function Oe(t,e){if(t.oa)return!0;if(!oe){if(!e)t:{e=["window","event"];for(var r=n,i=0;i<e.length;i++)if(null==(r=r[e[i]])){e=null;break t}e=r}if(e=new ce(i=e,this),r=!0,!(0>i.keyCode||void 0!=i.returnValue)){t:{var o=!1;if(0==i.keyCode)try{i.keyCode=-1;break t}catch(s){o=!0}(o||void 0==i.returnValue)&&(i.returnValue=!0)}for(i=[],o=e.b;o;o=o.parentNode)i.push(o);for(t=t.type,o=i.length-1;0<=o;o--){e.b=i[o];var a=Ie(i[o],t,!0,e);r=r&&a}for(o=0;o<i.length;o++)e.b=i[o],a=Ie(i[o],t,!1,e),r=r&&a}return r}return Ne(t,new ce(e,this))}function Ae(t){return(t=t[me])instanceof ye?t:null}var xe="__closure_events_fn_"+(1e9*Math.random()>>>0);function Pe(t){return f(t)?t:(t[xe]||(t[xe]=function(e){return t.handleEvent(e)}),t[xe])}function ke(){Ft.call(this),this.l=new ye(this),this.Rb=this,this.Va=null}function Re(t,e,n,r,i){t.l.add(String(e),n,!1,r,i)}function De(t,e,n,r,i){t.l.add(String(e),n,!0,r,i)}function Le(t,e,n,r){if(!(e=t.l.a[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var a=e[o];if(a&&!a.oa&&a.capture==n){var s=a.listener,u=a.La||a.src;a.Ia&&ve(t.l,a),i=!1!==s.call(u,r)&&i}}return i&&0!=r.Kb}function Me(t,e,r){if(f(t))r&&(t=m(t,r));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=m(t.handleEvent,t)}return 2147483647<Number(e)?-1:n.setTimeout(t,e||0)}function Fe(t){var e=null;return new vt(function(n,r){-1==(e=Me(function(){n(void 0)},t))&&r(Error("Failed to schedule timer."))}).s(function(t){throw n.clearTimeout(e),t})}function je(t){if(t.S&&"function"==typeof t.S)return t.S();if(o(t))return t.split("");if(l(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}function Ue(t){if(t.U&&"function"==typeof t.U)return t.U();if(!t.S||"function"!=typeof t.S){if(l(t)||o(t)){var e=[];t=t.length;for(var n=0;n<t;n++)e.push(n);return e}for(var r in e=[],n=0,t)e[n++]=r;return e}}function We(t,e){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof We)for(n=t.U(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function Ve(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];qe(t.b,r)&&(t.a[n++]=r),e++}t.a.length=n}if(t.c!=t.a.length){var i={};for(n=e=0;e<t.a.length;)qe(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function qe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}w(ke,Ft),ke.prototype[le]=!0,ke.prototype.addEventListener=function(t,e,n,r){be(this,t,e,n,r)},ke.prototype.removeEventListener=function(t,e,n,r){Se(this,t,e,n,r)},ke.prototype.dispatchEvent=function(t){var e,n=this.Va;if(n)for(e=[];n;n=n.Va)e.push(n);n=this.Rb;var r=t.type||t;if(o(t))t=new ue(t,n);else if(t instanceof ue)t.target=t.target||n;else{var i=t;ht(t=new ue(r,n),i)}if(i=!0,e)for(var a=e.length-1;0<=a;a--){var s=t.b=e[a];i=Le(s,r,!0,t)&&i}if(i=Le(s=t.b=n,r,!0,t)&&i,i=Le(s,r,!1,t)&&i,e)for(a=0;a<e.length;a++)i=Le(s=t.b=e[a],r,!1,t)&&i;return i},ke.prototype.va=function(){if(ke.ob.va.call(this),this.l){var t,e=this.l;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)0,de(n[r]);delete e.a[t],e.b--}}this.Va=null},(t=We.prototype).S=function(){Ve(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},t.U=function(){return Ve(this),this.a.concat()},t.clear=function(){this.b={},this.c=this.a.length=0},t.get=function(t,e){return qe(this.b,t)?this.b[t]:e},t.set=function(t,e){qe(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},t.forEach=function(t,e){for(var n=this.U(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Be=/^(?:([^:\/?#.]+):)?(?:\/\/(?:([^\/?#]*)@)?([^\/#?]*?)(?::([0-9]+))?(?=[\/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function He(t,e){if(this.b=this.l=this.c="",this.i=null,this.h=this.g="",this.f=!1,t instanceof He){this.f=void 0!==e?e:t.f,Ke(this,t.c),this.l=t.l,this.b=t.b,Qe(this,t.i),this.g=t.g,e=t.a;var n=new sn;n.c=e.c,e.a&&(n.a=new We(e.a),n.b=e.b),Ge(this,n),this.h=t.h}else t&&(n=String(t).match(Be))?(this.f=!!e,Ke(this,n[1]||"",!0),this.l=Je(n[2]||""),this.b=Je(n[3]||"",!0),Qe(this,n[4]),this.g=Je(n[5]||"",!0),Ge(this,n[6]||"",!0),this.h=Je(n[7]||"")):(this.f=!!e,this.a=new sn(null,this.f))}function Ke(t,e,n){t.c=n?Je(e,!0):e,t.c&&(t.c=t.c.replace(/:$/,""))}function Qe(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.i=e}else t.i=null}function Ge(t,e,n){e instanceof sn?(t.a=e,function(t,e){e&&!t.f&&(un(t),t.c=null,t.a.forEach(function(t,e){var n=e.toLowerCase();e!=n&&(hn(this,e),fn(this,n,t))},t)),t.f=e}(t.a,t.f)):(n||(e=Ze(e,on)),t.a=new sn(e,t.f))}function ze(t,e,n){t.a.set(e,n)}function Xe(t,e){return t.a.get(e)}function Ye(t){return t instanceof He?new He(t):new He(t,void 0)}function $e(t,e){var n=new He(null,void 0);return Ke(n,"https"),t&&(n.b=t),e&&(n.g=e),n}function Je(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function Ze(t,e,n){return o(t)?(t=encodeURI(t).replace(e,tn),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function tn(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}He.prototype.toString=function(){var t=[],e=this.c;e&&t.push(Ze(e,en,!0),":");var n=this.b;return(n||"file"==e)&&(t.push("//"),(e=this.l)&&t.push(Ze(e,en,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.i)&&t.push(":",String(n))),(n=this.g)&&(this.b&&"/"!=n.charAt(0)&&t.push("/"),t.push(Ze(n,"/"==n.charAt(0)?rn:nn,!0))),(n=this.a.toString())&&t.push("?",n),(n=this.h)&&t.push("#",Ze(n,an)),t.join("")};var en=/[#\/\?@]/g,nn=/[#\?:]/g,rn=/[#\?]/g,on=/[#\?@]/g,an=/#/g;function sn(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function un(t){t.a||(t.a=new We,t.b=0,t.c&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.c,function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)}))}function cn(t){var e=Ue(t);if("undefined"==typeof e)throw Error("Keys are undefined");var n=new sn(null,void 0);t=je(t);for(var r=0;r<e.length;r++){var i=e[r],o=t[r];h(o)?fn(n,i,o):n.add(i,o)}return n}function hn(t,e){un(t),e=pn(t,e),qe(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,qe((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Ve(t)))}function ln(t,e){return un(t),e=pn(t,e),qe(t.a.b,e)}function fn(t,e,n){hn(t,e),0<n.length&&(t.c=null,t.a.set(pn(t,e),V(n)),t.b+=n.length)}function pn(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}(t=sn.prototype).add=function(t,e){un(this),this.c=null,t=pn(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},t.clear=function(){this.a=this.c=null,this.b=0},t.forEach=function(t,e){un(this),this.a.forEach(function(n,r){D(n,function(n){t.call(e,n,r,this)},this)},this)},t.U=function(){un(this);for(var t=this.a.S(),e=this.a.U(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},t.S=function(t){un(this);var e=[];if(o(t))ln(this,t)&&(e=W(e,this.a.get(pn(this,t))));else{t=this.a.S();for(var n=0;n<t.length;n++)e=W(e,t[n])}return e},t.set=function(t,e){return un(this),this.c=null,ln(this,t=pn(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},t.get=function(t,e){return 0<(t=t?this.S(t):[]).length?String(t[0]):e},t.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.U(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.S(r);for(var o=0;o<r.length;o++){var a=i;""!==r[o]&&(a+="="+encodeURIComponent(String(r[o]))),t.push(a)}}return this.c=t.join("&")};var dn=!Kt||9<=Number(te);function yn(){this.a="",this.b=gn}function vn(t){return t instanceof yn&&t.constructor===yn&&t.b===gn?t.a:(I("expected object of type Const, got '"+t+"'"),"type_error:Const")}yn.prototype.na=!0,yn.prototype.ma=function(){return this.a},yn.prototype.toString=function(){return"Const{"+this.a+"}"};var gn={};function mn(t){var e=new yn;return e.a=t,e}function _n(){this.a="",this.b=Cn}function bn(t){return t instanceof _n&&t.constructor===_n&&t.b===Cn?t.a:(I("expected object of type TrustedResourceUrl, got '"+t+"' of type "+u(t)),"type_error:TrustedResourceUrl")}function wn(t,e){var n=vn(t);if(!Sn.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return function(t){var e=new _n;return e.a=t,e}(t=n.replace(En,function(t,r){if(!Object.prototype.hasOwnProperty.call(e,r))throw Error('Found marker, "'+r+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(e));return(t=e[r])instanceof yn?vn(t):encodeURIComponent(String(t))}))}mn(""),_n.prototype.na=!0,_n.prototype.ma=function(){return this.a},_n.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var En=/%{(\w+)}/g,Sn=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank#/i,Cn={};function Tn(){this.a="",this.b=An}function In(t){return t instanceof Tn&&t.constructor===Tn&&t.b===An?t.a:(I("expected object of type SafeUrl, got '"+t+"' of type "+u(t)),"type_error:SafeUrl")}Tn.prototype.na=!0,Tn.prototype.ma=function(){return this.a},Tn.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Nn=/^(?:(?:https?|mailto|ftp):|[^:\/?#]*(?:[\/?#]|$))/i;function On(t){return t instanceof Tn?t:(t=t.na?t.ma():String(t),Nn.test(t)||(t="about:invalid#zClosurez"),xn(t))}var An={};function xn(t){var e=new Tn;return e.a=t,e}function Pn(){this.a="",this.b=kn}xn("about:blank"),Pn.prototype.na=!0,Pn.prototype.ma=function(){return this.a},Pn.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var kn={};function Rn(t){var e=new Pn;return e.a=t,e}function Dn(t){var e=document;return o(t)?e.getElementById(t):t}function Ln(t,e){it(e,function(e,n){e&&e.na&&(e=e.ma()),"style"==n?t.style.cssText=e:"class"==n?t.className=e:"for"==n?t.htmlFor=e:Mn.hasOwnProperty(n)?t.setAttribute(Mn[n],e):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?t.setAttribute(n,e):t[n]=e})}Rn("<!DOCTYPE html>"),Rn(""),Rn("<br>");var Mn={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};function Fn(t,e,n){var r=arguments,i=document,a=String(r[0]),s=r[1];if(!dn&&s&&(s.name||s.type)){if(a=["<",a],s.name&&a.push(' name="',H(s.name),'"'),s.type){a.push(' type="',H(s.type),'"');var u={};ht(u,s),delete u.type,s=u}a.push(">"),a=a.join("")}return a=i.createElement(a),s&&(o(s)?a.className=s:h(s)?a.className=s.join(" "):Ln(a,s)),2<r.length&&function(t,e,n){function r(n){n&&e.appendChild(o(n)?t.createTextNode(n):n)}for(var i=2;i<n.length;i++){var a=n[i];!l(a)||p(a)&&0<a.nodeType?r(a):D(jn(a)?V(a):a,r)}}(i,a,r),a}function jn(t){if(t&&"number"==typeof t.length){if(p(t))return"function"==typeof t.item||"string"==typeof t.item;if(f(t))return"function"==typeof t.item}return!1}function Un(t){var e=[];return function t(e,n,r){if(null==n)r.push("null");else{if("object"==i(n)){if(h(n)){var o=n;n=o.length,r.push("[");for(var a="",s=0;s<n;s++)r.push(a),t(e,o[s],r),a=",";return void r.push("]")}if(!(n instanceof String||n instanceof Number||n instanceof Boolean)){for(o in r.push("{"),a="",n)Object.prototype.hasOwnProperty.call(n,o)&&("function"!=typeof(s=n[o])&&(r.push(a),Bn(o,r),r.push(":"),t(e,s,r),a=","));return void r.push("}")}n=n.valueOf()}switch(i(n)){case"string":Bn(n,r);break;case"number":r.push(isFinite(n)&&!isNaN(n)?String(n):"null");break;case"boolean":r.push(String(n));break;case"function":r.push("null");break;default:throw Error("Unknown type: "+i(n))}}}(new Wn,t,e),e.join("")}function Wn(){}var Vn={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},qn=/\uffff/.test("\uffff")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function Bn(t,e){e.push('"',t.replace(qn,function(t){var e=Vn[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),Vn[t]=e),e}),'"')}function Hn(){var t=cr();return Kt&&!!te&&11==te||/Edge\/\d+/.test(t)}function Kn(){return n.window&&n.window.location.href||self&&self.location&&self.location.href||""}function Qn(t,e){e=e||n.window;var r="about:blank";t&&(r=In(On(t))),e.location.href=r}function Gn(t){return!!((t=(t||cr()).toLowerCase()).match(/android/)||t.match(/webos/)||t.match(/iphone|ipad|ipod/)||t.match(/blackberry/)||t.match(/windows phone/)||t.match(/iemobile/))}function zn(t){t=t||n.window;try{t.close()}catch(e){}}function Xn(t,e,n){var r=Math.floor(1e9*Math.random()).toString();e=e||500,n=n||600;var i=(window.screen.availHeight-n)/2,o=(window.screen.availWidth-e)/2;for(a in e={width:e,height:n,top:0<i?i:0,left:0<o?o:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},n=cr().toLowerCase(),r&&(e.target=r,Z(n,"crios/")&&(e.target="_blank")),ar(cr())==ir&&(t=t||"http://localhost",e.scrollbars=!0),n=t||"",(t=e)||(t={}),r=window,e=n instanceof Tn?n:On("undefined"!=typeof n.href?n.href:String(n)),n=t.target||n.target,i=[],t)switch(a){case"width":case"height":case"top":case"left":i.push(a+"="+t[a]);break;case"target":case"noopener":case"noreferrer":break;default:i.push(a+"="+(t[a]?1:0))}var a=i.join(",");if((rt("iPhone")&&!rt("iPod")&&!rt("iPad")||rt("iPad")||rt("iPod"))&&r.navigator&&r.navigator.standalone&&n&&"_self"!=n?(a=r.document.createElement("A"),e instanceof Tn||e instanceof Tn||(e=e.na?e.ma():String(e),Nn.test(e)||(e="about:invalid#zClosurez"),e=xn(e)),a.href=In(e),a.setAttribute("target",n),t.noreferrer&&a.setAttribute("rel","noreferrer"),(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,r,1),a.dispatchEvent(t),a={}):t.noreferrer?(a=r.open("",n,a),t=In(e),a&&(Gt&&Z(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),a.opener=null,mn("b/12014412, meta tag with sanitized URL"),t=Rn(t='<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+H(t)+'">'),a.document.write(function(t){return t instanceof Pn&&t.constructor===Pn&&t.b===kn?t.a:(I("expected object of type SafeHtml, got '"+t+"' of type "+u(t)),"type_error:SafeHtml")}(t)),a.document.close())):(a=r.open(In(e),n,a))&&t.noopener&&(a.opener=null),a)try{a.focus()}catch(s){}return a}var Yn=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,$n=/^[^@]+@[^@]+$/;function Jn(){var t=null;return new vt(function(e){"complete"==n.document.readyState?e():(t=function(){e()},Ee(window,"load",t))}).s(function(e){throw Se(window,"load",t),e})}function Zn(t){return t=t||cr(),!("file:"!==dr()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function tr(){var t=n.window;try{return!(!t||t==t.top)}catch(e){return!1}}function er(){return"object"!==i(n.window)&&"function"===typeof n.importScripts}function nr(){return r.a.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":r.a.INTERNAL.hasOwnProperty("node")?"Node":er()?"Worker":"Browser"}function rr(){var t=nr();return"ReactNative"===t||"Node"===t}var ir="Firefox",or="Chrome";function ar(t){var e=t.toLowerCase();return Z(e,"opera/")||Z(e,"opr/")||Z(e,"opios/")?"Opera":Z(e,"iemobile")?"IEMobile":Z(e,"msie")||Z(e,"trident/")?"IE":Z(e,"edge/")?"Edge":Z(e,"firefox/")?ir:Z(e,"silk/")?"Silk":Z(e,"blackberry")?"Blackberry":Z(e,"webos")?"Webos":!Z(e,"safari/")||Z(e,"chrome/")||Z(e,"crios/")||Z(e,"android")?!Z(e,"chrome/")&&!Z(e,"crios/")||Z(e,"edge/")?Z(e,"android")?"Android":(t=t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==t.length?t[1]:"Other":or:"Safari"}var sr={Uc:"FirebaseCore-web",Wc:"FirebaseUI-web"};function ur(t,e){e=e||[];var n,r=[],i={};for(n in sr)i[sr[n]]=!0;for(n=0;n<e.length;n++)"undefined"!==typeof i[e[n]]&&(delete i[e[n]],r.push(e[n]));return r.sort(),(e=r).length||(e=["FirebaseCore-web"]),"Browser"===(r=nr())?r=ar(i=cr()):"Worker"===r&&(r=ar(i=cr())+"-"+r),r+"/JsCore/"+t+"/"+e.join(",")}function cr(){return n.navigator&&n.navigator.userAgent||""}function hr(t,e){t=t.split("."),e=e||n;for(var r=0;r<t.length&&"object"==i(e)&&null!=e;r++)e=e[t[r]];return r!=t.length&&(e=void 0),e}function lr(){try{var t=n.localStorage,e=_r();if(t)return t.setItem(e,"1"),t.removeItem(e),!Hn()||!!n.indexedDB}catch(r){return er()&&!!n.indexedDB}return!1}function fr(){return(pr()||"chrome-extension:"===dr()||Zn())&&!rr()&&lr()&&!er()}function pr(){return"http:"===dr()||"https:"===dr()}function dr(){return n.location&&n.location.protocol||null}function yr(t){return!Gn(t=t||cr())&&ar(t)!=ir}function vr(t){return"undefined"===typeof t?null:Un(t)}function gr(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&null!==t[e]&&void 0!==t[e]&&(n[e]=t[e]);return n}function mr(t){if(null!==t)return JSON.parse(t)}function _r(t){return t||Math.floor(1e9*Math.random()).toString()}function br(t){return"Safari"!=ar(t=t||cr())&&!t.toLowerCase().match(/iphone|ipad|ipod/)}function wr(){var t=n.___jsl;if(t&&t.H)for(var e in t.H)if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=t.H[e].L.concat(),t.CP)for(var r=0;r<t.CP.length;r++)t.CP[r]=null}function Er(t,e){if(t>e)throw Error("Short delay should be less than long delay!");this.a=t,this.c=e,t=cr(),e=nr(),this.b=Gn(t)||"ReactNative"===e}function Sr(){var t=n.document;return!t||"undefined"===typeof t.visibilityState||"visible"==t.visibilityState}function Cr(t){try{var e=new Date(parseInt(t,10));if(!isNaN(e.getTime())&&!/[^0-9]/.test(t))return e.toUTCString()}catch(n){}return null}function Tr(){return!(!hr("fireauth.oauthhelper",n)&&!hr("fireauth.iframe",n))}Er.prototype.get=function(){var t=n.navigator;return!t||"boolean"!==typeof t.onLine||!pr()&&"chrome-extension:"!==dr()&&"undefined"===typeof t.connection||t.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var Ir,Nr={};function Or(t){Nr[t]||(Nr[t]=!0,"undefined"!==typeof console&&"function"===typeof console.warn&&console.warn(t))}try{var Ar={};Object.defineProperty(Ar,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Ar,"abcd",{configurable:!0,enumerable:!0,value:2}),Ir=2==Ar.abcd}catch(Bt){Ir=!1}function xr(t,e,n){Ir?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}):t[e]=n}function Pr(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&xr(t,n,e[n])}function kr(t){var e={};return Pr(e,t),e}function Rr(t){var e=t;if("object"==i(t)&&null!=t)for(var n in e="length"in t?[]:{},t)xr(e,n,Rr(t[n]));return e}function Dr(t){var e={},n=t[Mr],r=t[Fr];if(!(t=t[jr])||t!=Lr&&!n)throw Error("Invalid provider user info!");e[Wr]=r||null,e[Ur]=n||null,xr(this,qr,t),xr(this,Vr,Rr(e))}var Lr="EMAIL_SIGNIN",Mr="email",Fr="newEmail",jr="requestType",Ur="email",Wr="fromEmail",Vr="data",qr="operation";function Br(t,e){this.code=Kr+t,this.message=e||Qr[t]||""}function Hr(t){var e=t&&t.code;return e?new Br(e.substring(Kr.length),t.message):null}w(Br,Error),Br.prototype.C=function(){return{code:this.code,message:this.message}},Br.prototype.toJSON=function(){return this.C()};var Kr="auth/",Qr={"argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The OIDC ID token requires a valid unhashed nonce.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted.  Please whitelist the domain in the Firebase console.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","user-cancelled":"User did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."};function Gr(t){var e=t[Jr];if("undefined"===typeof e)throw new Br("missing-continue-uri");if("string"!==typeof e||"string"===typeof e&&!e.length)throw new Br("invalid-continue-uri");this.h=e,this.b=this.a=null,this.g=!1;var n=t[zr];if(n&&"object"===i(n)){e=n[ei];var r=n[Zr];if(n=n[ti],"string"===typeof e&&e.length){if(this.a=e,"undefined"!==typeof r&&"boolean"!==typeof r)throw new Br("argument-error",Zr+" property must be a boolean when specified.");if(this.g=!!r,"undefined"!==typeof n&&("string"!==typeof n||"string"===typeof n&&!n.length))throw new Br("argument-error",ti+" property must be a non empty string when specified.");this.b=n||null}else{if("undefined"!==typeof e)throw new Br("argument-error",ei+" property must be a non empty string when specified.");if("undefined"!==typeof r||"undefined"!==typeof n)throw new Br("missing-android-pkg-name")}}else if("undefined"!==typeof n)throw new Br("argument-error",zr+" property must be a non null object when specified.");if(this.f=null,(e=t[$r])&&"object"===i(e)){if("string"===typeof(e=e[ni])&&e.length)this.f=e;else if("undefined"!==typeof e)throw new Br("argument-error",ni+" property must be a non empty string when specified.")}else if("undefined"!==typeof e)throw new Br("argument-error",$r+" property must be a non null object when specified.");if("undefined"!==typeof(e=t[Yr])&&"boolean"!==typeof e)throw new Br("argument-error",Yr+" property must be a boolean when specified.");if(this.c=!!e,"undefined"!==typeof(t=t[Xr])&&("string"!==typeof t||"string"===typeof t&&!t.length))throw new Br("argument-error",Xr+" property must be a non empty string when specified.");this.i=t||null}var zr="android",Xr="dynamicLinkDomain",Yr="handleCodeInApp",$r="iOS",Jr="url",Zr="installApp",ti="minimumVersion",ei="packageName",ni="bundleId";function ri(t){var e={};for(var n in e.continueUrl=t.h,e.canHandleCodeInApp=t.c,(e.androidPackageName=t.a)&&(e.androidMinimumVersion=t.b,e.androidInstallApp=t.g),e.iOSBundleId=t.f,e.dynamicLinkDomain=t.i,e)null===e[n]&&delete e[n];return e}var ii=null,oi=null;function ai(t){var e="";return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=oi[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}!function(){if(!ii){ii={},oi={};for(var t=0;65>t;t++)ii[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t),oi[ii[t]]=t,62<=t&&(oi["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(t)]=t)}}();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),s=n(64);if(64===s&&-1===i)break;e(i<<2|o>>4),64!=a&&(e(o<<4&240|a>>2),64!=s&&e(a<<6&192|s))}}(t,function(t){e+=String.fromCharCode(t)}),e}function si(t){this.c=t.sub,b(),this.a=t.provider_id||t.firebase&&t.firebase.sign_in_provider||null,this.b=!!t.is_anonymous||"anonymous"==this.a}function ui(t){return(t=ci(t))&&t.sub&&t.iss&&t.aud&&t.exp?new si(t):null}function ci(t){if(!t)return null;if(3!=(t=t.split(".")).length)return null;for(var e=(4-(t=t[1]).length%4)%4,n=0;n<e;n++)t+=".";try{return JSON.parse(ai(t))}catch(r){}return null}si.prototype.f=function(){return this.b};var hi,li={$c:{ab:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",ib:"https://securetoken.googleapis.com/v1/token",id:"p"},bd:{ab:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",ib:"https://staging-securetoken.sandbox.googleapis.com/v1/token",id:"s"},cd:{ab:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",ib:"https://test-securetoken.sandbox.googleapis.com/v1/token",id:"t"}};function fi(t){for(var e in li)if(li[e].id===t)return{firebaseEndpoint:(t=li[e]).ab,secureTokenEndpoint:t.ib};return null}hi=fi("__EID__")?"__EID__":void 0;var pi="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),di=["client_id","response_type","scope","redirect_uri","state"],yi={Vc:{Ma:"locale",Ba:500,Aa:600,Na:"facebook.com",hb:di},Xc:{Ma:null,Ba:500,Aa:620,Na:"github.com",hb:di},Yc:{Ma:"hl",Ba:515,Aa:680,Na:"google.com",hb:di},dd:{Ma:"lang",Ba:485,Aa:705,Na:"twitter.com",hb:pi}};function vi(t){for(var e in yi)if(yi[e].Na==t)return yi[e];return null}function gi(t){var e={};e["facebook.com"]=Ei,e["google.com"]=Ci,e["github.com"]=Si,e["twitter.com"]=Ti;var n=t&&t[_i];try{if(n)return e[n]?new e[n](t):new wi(t);if("undefined"!==typeof t[mi])return new bi(t)}catch(r){}return null}var mi="idToken",_i="providerId";function bi(t){var e=t[_i];if(!e&&t[mi]){var n=ui(t[mi]);n&&n.a&&(e=n.a)}if(!e)throw Error("Invalid additional user info!");"anonymous"!=e&&"custom"!=e||(e=null),n=!1,"undefined"!==typeof t.isNewUser?n=!!t.isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(n=!0),xr(this,"providerId",e),xr(this,"isNewUser",n)}function wi(t){bi.call(this,t),xr(this,"profile",Rr((t=mr(t.rawUserInfo||"{}"))||{}))}function Ei(t){if(wi.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function Si(t){if(wi.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");xr(this,"username",this.profile&&this.profile.login||null)}function Ci(t){if(wi.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function Ti(t){if(wi.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");xr(this,"username",t.screenName||null)}function Ii(t){this.a=Ye(t)}function Ni(t){var e=Ye(t),n=Xe(e,"link"),r=Xe(Ye(n),"link");return e=Xe(e,"deep_link_id"),Xe(Ye(e),"link")||e||r||n||t}function Oi(t,e){return t.then(function(t){if(t[ha]){var n=ui(t[ha]);if(!n||e!=n.c)throw new Br("user-mismatch");return t}throw new Br("user-mismatch")}).s(function(t){throw t&&t.code&&t.code==Kr+"user-not-found"?new Br("user-mismatch"):t})}function Ai(t,e){if(!e)throw new Br("internal-error","failed to construct a credential");this.a=e,xr(this,"providerId",t),xr(this,"signInMethod",t)}function xi(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function Pi(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&xr(this,"idToken",e.idToken),e.accessToken&&xr(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&xr(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new Br("internal-error","failed to construct a credential");xr(this,"accessToken",e.oauthToken),xr(this,"secret",e.oauthTokenSecret)}xr(this,"providerId",t),xr(this,"signInMethod",n)}function ki(t){var e={};return t.idToken&&(e.id_token=t.idToken),t.accessToken&&(e.access_token=t.accessToken),t.secret&&(e.oauth_token_secret=t.secret),e.providerId=t.providerId,t.nonce&&!t.a&&(e.nonce=t.nonce),e={postBody:cn(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function Ri(t,e){this.Dc=e||[],Pr(this,{providerId:t,isOAuthProvider:!0}),this.yb={},this.cb=(vi(t)||{}).Ma||null,this.$a=null}function Di(t){if("string"!==typeof t||0!=t.indexOf("saml."))throw new Br("argument-error",'SAML provider IDs must be prefixed with "saml."');Ri.call(this,t,[])}function Li(t){Ri.call(this,t,di),this.a=[]}function Mi(){Li.call(this,"facebook.com")}function Fi(t){if(!t)throw new Br("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return p(t)&&(e=t.accessToken),(new Mi).credential(null,e)}function ji(){Li.call(this,"github.com")}function Ui(t){if(!t)throw new Br("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return p(t)&&(e=t.accessToken),(new ji).credential(null,e)}function Wi(){Li.call(this,"google.com"),this.ua("profile")}function Vi(t,e){var n=t;return p(t)&&(n=t.idToken,e=t.accessToken),(new Wi).credential(n,e)}function qi(){Ri.call(this,"twitter.com",pi)}function Bi(t,e){var n=t;if(p(n)||(n={oauthToken:t,oauthTokenSecret:e}),!n.oauthToken||!n.oauthTokenSecret)throw new Br("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new Pi("twitter.com",n,"twitter.com")}function Hi(t,e,n){this.a=t,this.c=e,xr(this,"providerId","password"),xr(this,"signInMethod",n===Ki.EMAIL_LINK_SIGN_IN_METHOD?Ki.EMAIL_LINK_SIGN_IN_METHOD:Ki.EMAIL_PASSWORD_SIGN_IN_METHOD)}function Ki(){Pr(this,{providerId:"password",isOAuthProvider:!1})}function Qi(t,e){if(!(e=Gi(e)))throw new Br("argument-error","Invalid email link!");return new Hi(t,e,Ki.EMAIL_LINK_SIGN_IN_METHOD)}function Gi(t){var e=Xe((t=new Ii(t=Ni(t))).a,"oobCode")||null;return"signIn"===(Xe(t.a,"mode")||null)&&e?e:null}function zi(t){if(!(t.Ta&&t.Sa||t.Fa&&t.$))throw new Br("internal-error");this.a=t,xr(this,"providerId","phone"),xr(this,"signInMethod","phone")}function Xi(t){return t.a.Fa&&t.a.$?{temporaryProof:t.a.Fa,phoneNumber:t.a.$}:{sessionInfo:t.a.Ta,code:t.a.Sa}}function Yi(t){try{this.a=t||r.a.auth()}catch(e){throw new Br("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}Pr(this,{providerId:"phone",isOAuthProvider:!1})}function $i(t,e){if(!t)throw new Br("missing-verification-id");if(!e)throw new Br("missing-verification-code");return new zi({Ta:t,Sa:e})}function Ji(t){if(t.temporaryProof&&t.phoneNumber)return new zi({Fa:t.temporaryProof,$:t.phoneNumber});var e=t&&t.providerId;if(!e||"password"===e)return null;var n=t&&t.oauthAccessToken,r=t&&t.oauthTokenSecret,i=t&&t.nonce,o=t&&t.oauthIdToken,a=t&&t.pendingToken;try{switch(e){case"google.com":return Vi(o,n);case"facebook.com":return Fi(n);case"github.com":return Ui(n);case"twitter.com":return Bi(n,r);default:return n||r||o||a?a?0==e.indexOf("saml.")?new Ai(e,a):new Pi(e,{pendingToken:a,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new Li(e).credential(o,n,i):null}}catch(s){return null}}function Zi(t){if(!t.isOAuthProvider)throw new Br("invalid-oauth-provider")}function to(t,e,n,r,i,o){if(this.b=t,this.c=e||null,this.f=n||null,this.g=r||null,this.h=o||null,this.a=i||null,!this.f&&!this.a)throw new Br("invalid-auth-event");if(this.f&&this.a)throw new Br("invalid-auth-event");if(this.f&&!this.g)throw new Br("invalid-auth-event")}function eo(t){return(t=t||{}).type?new to(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&Hr(t.error),t.postBody):null}function no(){this.b=null,this.a=[]}w(wi,bi),w(Ei,wi),w(Si,wi),w(Ci,wi),w(Ti,wi),Ai.prototype.la=function(t){return Oa(t,xi(this))},Ai.prototype.b=function(t,e){var n=xi(this);return n.idToken=e,Aa(t,n)},Ai.prototype.f=function(t,e){return Oi(xa(t,xi(this)),e)},Ai.prototype.C=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},Pi.prototype.la=function(t){return Oa(t,ki(this))},Pi.prototype.b=function(t,e){var n=ki(this);return n.idToken=e,Aa(t,n)},Pi.prototype.f=function(t,e){return Oi(xa(t,ki(this)),e)},Pi.prototype.C=function(){var t={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(t.oauthIdToken=this.idToken),this.accessToken&&(t.oauthAccessToken=this.accessToken),this.secret&&(t.oauthTokenSecret=this.secret),this.nonce&&(t.nonce=this.nonce),this.a&&(t.pendingToken=this.a),t},Ri.prototype.Da=function(t){return this.yb=at(t),this},w(Di,Ri),w(Li,Ri),Li.prototype.ua=function(t){return F(this.a,t)||this.a.push(t),this},Li.prototype.Eb=function(){return V(this.a)},Li.prototype.credential=function(t,e,n){if(!t&&!e)throw new Br("argument-error","credential failed: must provide the ID token and/or the access token.");return new Pi(this.providerId,{idToken:t||null,accessToken:e||null,nonce:n||null},this.providerId)},w(Mi,Li),xr(Mi,"PROVIDER_ID","facebook.com"),xr(Mi,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),w(ji,Li),xr(ji,"PROVIDER_ID","github.com"),xr(ji,"GITHUB_SIGN_IN_METHOD","github.com"),w(Wi,Li),xr(Wi,"PROVIDER_ID","google.com"),xr(Wi,"GOOGLE_SIGN_IN_METHOD","google.com"),w(qi,Ri),xr(qi,"PROVIDER_ID","twitter.com"),xr(qi,"TWITTER_SIGN_IN_METHOD","twitter.com"),Hi.prototype.la=function(t){return this.signInMethod==Ki.EMAIL_LINK_SIGN_IN_METHOD?os(t,ja,{email:this.a,oobCode:this.c}):os(t,es,{email:this.a,password:this.c})},Hi.prototype.b=function(t,e){return this.signInMethod==Ki.EMAIL_LINK_SIGN_IN_METHOD?os(t,Ua,{idToken:e,email:this.a,oobCode:this.c}):os(t,Xa,{idToken:e,email:this.a,password:this.c})},Hi.prototype.f=function(t,e){return Oi(this.la(t),e)},Hi.prototype.C=function(){return{email:this.a,password:this.c,signInMethod:this.signInMethod}},Pr(Ki,{PROVIDER_ID:"password"}),Pr(Ki,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),Pr(Ki,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),zi.prototype.la=function(t){return t.Ua(Xi(this))},zi.prototype.b=function(t,e){var n=Xi(this);return n.idToken=e,os(t,rs,n)},zi.prototype.f=function(t,e){var n=Xi(this);return n.operation="REAUTH",Oi(t=os(t,is,n),e)},zi.prototype.C=function(){var t={providerId:"phone"};return this.a.Ta&&(t.verificationId=this.a.Ta),this.a.Sa&&(t.verificationCode=this.a.Sa),this.a.Fa&&(t.temporaryProof=this.a.Fa),this.a.$&&(t.phoneNumber=this.a.$),t},Yi.prototype.Ua=function(t,e){var n=this.a.b;return St(e.verify()).then(function(r){if(!o(r))throw new Br("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(e.type){case"recaptcha":return function(t,e){return os(t,Ga,e)}(n,{phoneNumber:t,recaptchaToken:r}).then(function(t){return"function"===typeof e.reset&&e.reset(),t},function(t){throw"function"===typeof e.reset&&e.reset(),t});default:throw new Br("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}})},Pr(Yi,{PROVIDER_ID:"phone"}),Pr(Yi,{PHONE_SIGN_IN_METHOD:"phone"}),to.prototype.C=function(){return{type:this.b,eventId:this.c,urlResponse:this.f,sessionId:this.g,postBody:this.h,error:this.a&&this.a.C()}};var ro,io=null;function oo(t){var e="unauthorized-domain",n=void 0,r=Ye(t);t=r.b,"chrome-extension"==(r=r.c)?n=q("This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):"http"==r||"https"==r?n=q("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):e="operation-not-supported-in-this-environment",Br.call(this,e,n)}function ao(t,e,n){Br.call(this,t,n),(t=e||{}).zb&&xr(this,"email",t.zb),t.$&&xr(this,"phoneNumber",t.$),t.credential&&xr(this,"credential",t.credential)}function so(t){if(t.code){var e=t.code||"";0==e.indexOf(Kr)&&(e=e.substring(Kr.length));var n={credential:Ji(t)};if(t.email)n.zb=t.email;else if(t.phoneNumber)n.$=t.phoneNumber;else if(!n.credential)return new Br(e,t.message||void 0);return new ao(e,n,t.message)}return null}function uo(){}function co(t){return t.c||(t.c=t.b())}function ho(){}function lo(t){if(!t.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n<e.length;n++){var r=e[n];try{return new ActiveXObject(r),t.f=r}catch(i){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return t.f}function fo(){}function po(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseText="",this.status=-1,this.statusText="",this.a.onload=m(this.ec,this),this.a.onerror=m(this.Fb,this),this.a.onprogress=m(this.fc,this),this.a.ontimeout=m(this.ic,this)}function yo(t,e){t.readyState=e,t.onreadystatechange&&t.onreadystatechange()}function vo(t,e,n){this.reset(t,e,n,void 0,void 0)}no.prototype.subscribe=function(t){var e=this;this.a.push(t),this.b||(this.b=function(t){for(var n=0;n<e.a.length;n++)e.a[n](t)},"function"===typeof(t=hr("universalLinks.subscribe",n))&&t(null,this.b))},no.prototype.unsubscribe=function(t){U(this.a,function(e){return e==t})},w(oo,Br),w(ao,Br),ao.prototype.C=function(){var t={code:this.code,message:this.message};this.email&&(t.email=this.email),this.phoneNumber&&(t.phoneNumber=this.phoneNumber);var e=this.credential&&this.credential.C();return e&&ht(t,e),t},ao.prototype.toJSON=function(){return this.C()},uo.prototype.c=null,w(ho,uo),ho.prototype.a=function(){var t=lo(this);return t?new ActiveXObject(t):new XMLHttpRequest},ho.prototype.b=function(){var t={};return lo(this)&&(t[0]=!0,t[1]=!0),t},ro=new ho,w(fo,uo),fo.prototype.a=function(){var t=new XMLHttpRequest;if("withCredentials"in t)return t;if("undefined"!=typeof XDomainRequest)return new po;throw Error("Unsupported browser")},fo.prototype.b=function(){return{}},(t=po.prototype).open=function(t,e,n){if(null!=n&&!n)throw Error("Only async requests are supported.");this.a.open(t,e)},t.send=function(t){if(t){if("string"!=typeof t)throw Error("Only string data is supported");this.a.send(t)}else this.a.send()},t.abort=function(){this.a.abort()},t.setRequestHeader=function(){},t.getResponseHeader=function(t){return"content-type"==t.toLowerCase()?this.a.contentType:""},t.ec=function(){this.status=200,this.responseText=this.a.responseText,yo(this,4)},t.Fb=function(){this.status=500,this.responseText="",yo(this,4)},t.ic=function(){this.Fb()},t.fc=function(){this.status=200,yo(this,1)},t.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},vo.prototype.a=null;function go(t){this.f=t,this.b=this.c=this.a=null}function mo(t,e){this.name=t,this.value=e}vo.prototype.reset=function(t,e,n,r,i){"number"==typeof i||0,r||b(),delete this.a},mo.prototype.toString=function(){return this.name};var _o=new mo("SEVERE",1e3),bo=new mo("WARNING",900),wo=new mo("CONFIG",700),Eo=new mo("FINE",500);go.prototype.log=function(t,e,n){if(t.value>=function t(e){return e.c?e.c:e.a?t(e.a):(I("Root logger has no level set."),null)}(this).value)for(f(e)&&(e=e()),t=new vo(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var So={},Co=null;function To(t){var e;if(Co||(Co=new go(""),So[""]=Co,Co.c=wo),!(e=So[t])){e=new go(t);var n=t.lastIndexOf("."),r=t.substr(n+1);(n=To(t.substr(0,n))).b||(n.b={}),n.b[r]=e,e.a=n,So[t]=e}return e}function Io(t,e){t&&t.log(Eo,e,void 0)}function No(t){this.f=t}function Oo(t){ke.call(this),this.i=t,this.readyState=Ao,this.status=0,this.responseText=this.statusText="",this.onreadystatechange=null,this.g=new Headers,this.b=null,this.h="GET",this.c="",this.a=!1,this.f=To("goog.net.FetchXmlHttp")}w(No,uo),No.prototype.a=function(){return new Oo(this.f)},No.prototype.b=function(t){return function(){return t}}({}),w(Oo,ke);var Ao=0;function xo(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function Po(t){ke.call(this),this.headers=new We,this.D=t||null,this.c=!1,this.w=this.a=null,this.h=this.N=this.m="",this.f=this.I=this.i=this.G=!1,this.g=0,this.u=null,this.o=ko,this.v=this.O=!1}(t=Oo.prototype).open=function(t,e){if(this.readyState!=Ao)throw this.abort(),Error("Error reopening a connection");this.h=t,this.c=e,this.readyState=1,xo(this)},t.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var e={headers:this.g,method:this.h,credentials:void 0,cache:void 0};t&&(e.body=t),this.i.fetch(new Request(this.c,e)).then(this.hc.bind(this),this.Gb.bind(this))},t.abort=function(){this.responseText="",this.g=new Headers,this.status=0,1<=this.readyState&&this.a&&4!=this.readyState&&(this.readyState=4,this.a=!1,xo(this)),this.readyState=Ao},t.hc=function(t){this.a&&(this.b||(this.b=t.headers,this.readyState=2,xo(this)),this.a&&(this.readyState=3,xo(this),this.a&&t.text().then(this.gc.bind(this,t),this.Gb.bind(this))))},t.gc=function(t,e){this.a&&(this.status=t.status,this.statusText=t.statusText,this.responseText=e,this.readyState=4,xo(this))},t.Gb=function(t){var e=this.f;e&&e.log(bo,"Failed to fetch url "+this.c,t instanceof Error?t:Error(t)),this.a&&(this.readyState=4,xo(this))},t.setRequestHeader=function(t,e){this.g.append(t,e)},t.getResponseHeader=function(t){return this.b?this.b.get(t.toLowerCase())||"":((t=this.f)&&t.log(bo,"Attempting to get response header but no headers have been received for url: "+this.c,void 0),"")},t.getAllResponseHeaders=function(){if(!this.b){var t=this.f;return t&&t.log(bo,"Attempting to get all response headers but no headers have been received for url: "+this.c,void 0),""}t=[];for(var e=this.b.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},w(Po,ke);var ko="";Po.prototype.b=To("goog.net.XhrIo");var Ro=/^https?$/i,Do=["POST","PUT"];function Lo(t,e,r,i,a){if(t.a)throw Error("[goog.net.XhrIo] Object is active with another request="+t.m+"; newUri="+e);r=r?r.toUpperCase():"GET",t.m=e,t.h="",t.N=r,t.G=!1,t.c=!0,t.a=t.D?t.D.a():ro.a(),t.w=t.D?co(t.D):co(ro),t.a.onreadystatechange=m(t.Jb,t);try{Io(t.b,Ho(t,"Opening Xhr")),t.I=!0,t.a.open(r,String(e),!0),t.I=!1}catch(u){return Io(t.b,Ho(t,"Error opening Xhr: "+u.message)),void Fo(t,u)}e=i||"";var s=new We(t.headers);a&&function(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(l(t)||o(t))D(t,e,void 0);else for(var n=Ue(t),r=je(t),i=r.length,a=0;a<i;a++)e.call(void 0,r[a],n&&n[a],t)}(a,function(t,e){s.set(e,t)}),a=function(t){t:{for(var e=Mo,n=t.length,r=o(t)?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:o(t)?t.charAt(e):t[e]}(s.U()),i=n.FormData&&e instanceof n.FormData,!F(Do,r)||a||i||s.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),s.forEach(function(t,e){this.a.setRequestHeader(e,t)},t),t.o&&(t.a.responseType=t.o),"withCredentials"in t.a&&t.a.withCredentials!==t.O&&(t.a.withCredentials=t.O);try{Vo(t),0<t.g&&(t.v=function(t){return Kt&&ne(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(t.a),Io(t.b,Ho(t,"Will abort after "+t.g+"ms if incomplete, xhr2 "+t.v)),t.v?(t.a.timeout=t.g,t.a.ontimeout=m(t.Ga,t)):t.u=Me(t.Ga,t.g,t)),Io(t.b,Ho(t,"Sending request")),t.i=!0,t.a.send(e),t.i=!1}catch(u){Io(t.b,Ho(t,"Send error: "+u.message)),Fo(t,u)}}function Mo(t){return"content-type"==t.toLowerCase()}function Fo(t,e){t.c=!1,t.a&&(t.f=!0,t.a.abort(),t.f=!1),t.h=e,jo(t),Wo(t)}function jo(t){t.G||(t.G=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function Uo(t){if(t.c&&"undefined"!=typeof e)if(t.w[1]&&4==qo(t)&&2==Bo(t))Io(t.b,Ho(t,"Local request error detected and ignored"));else if(t.i&&4==qo(t))Me(t.Jb,0,t);else if(t.dispatchEvent("readystatechange"),4==qo(t)){Io(t.b,Ho(t,"Request complete")),t.c=!1;try{var r,i=Bo(t);t:switch(i){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var o=!0;break t;default:o=!1}if(!(r=o)){var a;if(a=0===i){var s=String(t.m).match(Be)[1]||null;if(!s&&n.self&&n.self.location){var u=n.self.location.protocol;s=u.substr(0,u.length-1)}a=!Ro.test(s?s.toLowerCase():"")}r=a}if(r)t.dispatchEvent("complete"),t.dispatchEvent("success");else{try{var c=2<qo(t)?t.a.statusText:""}catch(h){Io(t.b,"Can not get status: "+h.message),c=""}t.h=c+" ["+Bo(t)+"]",jo(t)}}finally{Wo(t)}}}function Wo(t,e){if(t.a){Vo(t);var n=t.a,r=t.w[0]?s:null;t.a=null,t.w=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(i){(t=t.b)&&t.log(_o,"Problem encountered resetting onreadystatechange: "+i.message,void 0)}}}function Vo(t){t.a&&t.v&&(t.a.ontimeout=null),t.u&&(n.clearTimeout(t.u),t.u=null)}function qo(t){return t.a?t.a.readyState:0}function Bo(t){try{return 2<qo(t)?t.a.status:-1}catch(e){return-1}}function Ho(t,e){return e+" ["+t.N+" "+t.m+" "+Bo(t)+"]"}function Ko(t,e){this.g=[],this.v=t,this.u=e||null,this.f=this.a=!1,this.c=void 0,this.m=this.w=this.i=!1,this.h=0,this.b=null,this.l=0}function Qo(t,e,n){t.a=!0,t.c=n,t.f=!e,Yo(t)}function Go(t){if(t.a){if(!t.m)throw new $o(t);t.m=!1}}function zo(t,e,n,r){t.g.push([e,n,r]),t.a&&Yo(t)}function Xo(t){return M(t.g,function(t){return f(t[1])})}function Yo(t){if(t.h&&t.a&&Xo(t)){var e=t.h,r=ta[e];r&&(n.clearTimeout(r.a),delete ta[e]),t.h=0}t.b&&(t.b.l--,delete t.b),e=t.c;for(var i=r=!1;t.g.length&&!t.i;){var o=t.g.shift(),a=o[0],s=o[1];if(o=o[2],a=t.f?s:a)try{var u=a.call(o||t.u,e);void 0!==u&&(t.f=t.f&&(u==e||u instanceof Error),t.c=e=u),(S(e)||"function"===typeof n.Promise&&e instanceof n.Promise)&&(i=!0,t.i=!0)}catch(c){e=c,t.f=!0,Xo(t)||(r=!0)}}t.c=e,i&&(u=m(t.o,t,!0),i=m(t.o,t,!1),e instanceof Ko?(zo(e,u,i),e.w=!0):e.then(u,i)),r&&(e=new Zo(e),ta[e.a]=e,t.h=e.a)}function $o(){C.call(this)}function Jo(){C.call(this)}function Zo(t){this.a=n.setTimeout(m(this.c,this),0),this.b=t}(t=Po.prototype).Ga=function(){"undefined"!=typeof e&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",Io(this.b,Ho(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},t.abort=function(){this.a&&this.c&&(Io(this.b,Ho(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Wo(this))},t.va=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),Wo(this,!0)),Po.ob.va.call(this)},t.Jb=function(){this.qa||(this.I||this.i||this.f?Uo(this):this.wc())},t.wc=function(){Uo(this)},t.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.o){case ko:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var t=this.b;return t&&t.log(_o,"Response type "+this.o+" is not supported on this browser",void 0),null}catch(e){return Io(this.b,"Can not get response: "+e.message),null}},Ko.prototype.cancel=function(t){if(this.a)this.c instanceof Ko&&this.c.cancel();else{if(this.b){var e=this.b;delete this.b,t?e.cancel(t):(e.l--,0>=e.l&&e.cancel())}this.v?this.v.call(this.u,this):this.m=!0,this.a||(t=new Jo(this),Go(this),Qo(this,!1,t))}},Ko.prototype.o=function(t,e){this.i=!1,Qo(this,t,e)},Ko.prototype.D=function(){Go(this),Qo(this,!0,null)},Ko.prototype.then=function(t,e,n){var r,i,o=new vt(function(t,e){r=t,i=e});return zo(this,r,function(t){t instanceof Jo?o.cancel():i(t)}),o.then(t,e,n)},E(Ko),w($o,C),$o.prototype.message="Deferred has already fired",$o.prototype.name="AlreadyCalledError",w(Jo,C),Jo.prototype.message="Deferred was canceled",Jo.prototype.name="CanceledError",Zo.prototype.c=function(){throw delete ta[this.a],this.b};var ta={};function ea(t){var e={},n=e.document||document,r=bn(t),i=document.createElement("SCRIPT"),o={Lb:i,Ga:void 0},a=new Ko(na,o),s=null,u=null!=e.timeout?e.timeout:5e3;return 0<u&&(s=window.setTimeout(function(){ra(i,!0);var t=new aa(oa,"Timeout reached for loading script "+r);Go(a),Qo(a,!1,t)},u),o.Ga=s),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(ra(i,e.fd||!1,s),a.D())},i.onerror=function(){ra(i,!0,s);var t=new aa(ia,"Error while loading script "+r);Go(a),Qo(a,!1,t)},ht(o=e.attributes||{},{type:"text/javascript",charset:"UTF-8"}),Ln(i,o),i.src=bn(t),function(t){var e;return(e=(t||document).getElementsByTagName("HEAD"))&&0!=e.length?e[0]:t.documentElement}(n).appendChild(i),a}function na(){if(this&&this.Lb){var t=this.Lb;t&&"SCRIPT"==t.tagName&&ra(t,!0,this.Ga)}}function ra(t,e,r){null!=r&&n.clearTimeout(r),t.onload=s,t.onerror=s,t.onreadystatechange=s,e&&window.setTimeout(function(){t&&t.parentNode&&t.parentNode.removeChild(t)},0)}var ia=0,oa=1;function aa(t,e){var n="Jsloader error (code #"+t+")";e&&(n+=": "+e),C.call(this,n),this.code=t}function sa(t){this.f=t}function ua(t,e,i){if(this.b=t,t=e||{},this.i=t.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.l=t.secureTokenTimeout||la,this.f=at(t.secureTokenHeaders||fa),this.g=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.h=t.firebaseTimeout||pa,this.a=at(t.firebaseHeaders||da),i&&(this.a["X-Client-Version"]=i,this.f["X-Client-Version"]=i),i="Node"==nr(),!(i=n.XMLHttpRequest||i&&r.a.INTERNAL.node&&r.a.INTERNAL.node.XMLHttpRequest)&&!er())throw new Br("internal-error","The XMLHttpRequest compatibility library was not found.");this.c=void 0,er()?this.c=new No(self):rr()?this.c=new sa(i):this.c=new fo}w(aa,C),w(sa,uo),sa.prototype.a=function(){return new this.f},sa.prototype.b=function(){return{}};var ca,ha="idToken",la=new Er(3e4,6e4),fa={"Content-Type":"application/x-www-form-urlencoded"},pa=new Er(3e4,6e4),da={"Content-Type":"application/json"};function ya(t,e){e?t.a["X-Firebase-Locale"]=e:delete t.a["X-Firebase-Locale"]}function va(t,e){e?(t.a["X-Client-Version"]=e,t.f["X-Client-Version"]=e):(delete t.a["X-Client-Version"],delete t.f["X-Client-Version"])}function ga(t,e,r,i,o,a,s){(function(){var t=cr();return!((t=ar(t)!=or?null:(t=t.match(/\sChrome\/(\d+)/i))&&2==t.length?parseInt(t[1],10):null)&&30>t)&&(!Kt||!te||9<te)})()||er()?t=m(t.o,t):(ca||(ca=new vt(function(t,e){!function(t,e){if(((window.gapi||{}).client||{}).request)t();else{n[_a]=function(){((window.gapi||{}).client||{}).request?t():e(Error("CORS_UNSUPPORTED"))},function(t,e){zo(t,null,e,void 0)}(ea(wn(ma,{onload:_a})),function(){e(Error("CORS_UNSUPPORTED"))})}}(t,e)})),t=m(t.m,t)),t(e,r,i,o,a,s)}ua.prototype.o=function(t,e,r,i,o,a){if(er()&&("undefined"===typeof n.fetch||"undefined"===typeof n.Headers||"undefined"===typeof n.Request))throw new Br("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var s=new Po(this.c);if(a){s.g=Math.max(0,a);var u=setTimeout(function(){s.dispatchEvent("timeout")},a)}Re(s,"complete",function(){u&&clearTimeout(u);var t=null;try{t=JSON.parse(function(t){try{return t.a?t.a.responseText:""}catch(e){return Io(t.b,"Can not get responseText: "+e.message),""}}(this))||null}catch(n){t=null}e&&e(t)}),De(s,"ready",function(){u&&clearTimeout(u),Wt(this)}),De(s,"timeout",function(){u&&clearTimeout(u),Wt(this),e&&e(null)}),Lo(s,t,r,i,o)};var ma=mn("https://apis.google.com/js/client.js?onload=%{onload}"),_a="__fcb"+Math.floor(1e6*Math.random()).toString();function ba(t){if(!o(t=t.email)||!$n.test(t))throw new Br("invalid-email")}function wa(t){"email"in t&&ba(t)}function Ea(t){if(!t[ha])throw new Br("internal-error")}function Sa(t){if(t.phoneNumber||t.temporaryProof){if(!t.phoneNumber||!t.temporaryProof)throw new Br("internal-error")}else{if(!t.sessionInfo)throw new Br("missing-verification-id");if(!t.code)throw new Br("missing-verification-code")}}ua.prototype.m=function(t,e,n,r,i){var o=this;ca.then(function(){window.gapi.client.setApiKey(o.b);var a=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:t,method:n,body:r,headers:i,authType:"none",callback:function(t){window.gapi.auth.setToken(a),e&&e(t)}})}).s(function(t){e&&e({error:{message:t&&t.message||"CORS_UNSUPPORTED"}})})},ua.prototype.Qa=function(){return os(this,Ya,{})},ua.prototype.pb=function(t,e){return os(this,za,{idToken:t,email:e})},ua.prototype.qb=function(t,e){return os(this,Xa,{idToken:t,password:e})};var Ca={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function Ta(t){if(!t.requestUri||!t.sessionId&&!t.postBody&&!t.pendingToken)throw new Br("internal-error")}function Ia(t,e){return e.oauthIdToken&&e.providerId&&0==e.providerId.indexOf("oidc.")&&!e.pendingToken&&(t.sessionId?e.nonce=t.sessionId:t.postBody&&(ln(t=new sn(t.postBody),"nonce")&&(e.nonce=t.get("nonce")))),e}function Na(t){var e=null;if(t.needConfirmation?(t.code="account-exists-with-different-credential",e=so(t)):"FEDERATED_USER_ID_ALREADY_LINKED"==t.errorMessage?(t.code="credential-already-in-use",e=so(t)):"EMAIL_EXISTS"==t.errorMessage?(t.code="email-already-in-use",e=so(t)):t.errorMessage&&(e=as(t.errorMessage)),e)throw e;if(!t[ha])throw new Br("internal-error")}function Oa(t,e){return e.returnIdpCredential=!0,os(t,$a,e)}function Aa(t,e){return e.returnIdpCredential=!0,os(t,Za,e)}function xa(t,e){return e.returnIdpCredential=!0,e.autoCreate=!1,os(t,Ja,e)}function Pa(t){if(!t.oobCode)throw new Br("invalid-action-code")}(t=ua.prototype).rb=function(t,e){var n={idToken:t},r=[];return it(Ca,function(t,i){var o=e[i];null===o?r.push(t):i in e&&(n[i]=o)}),r.length&&(n.deleteAttribute=r),os(this,za,n)},t.kb=function(t,e){return ht(t={requestType:"PASSWORD_RESET",email:t},e),os(this,Ba,t)},t.lb=function(t,e){return ht(t={requestType:"EMAIL_SIGNIN",email:t},e),os(this,Va,t)},t.jb=function(t,e){return ht(t={requestType:"VERIFY_EMAIL",idToken:t},e),os(this,qa,t)},t.Ua=function(t){return os(this,ns,t)},t.Za=function(t,e){return os(this,Qa,{oobCode:t,newPassword:e})},t.Ja=function(t){return os(this,Ra,{oobCode:t})},t.Wa=function(t){return os(this,ka,{oobCode:t})};var ka={endpoint:"setAccountInfo",B:Pa,da:"email"},Ra={endpoint:"resetPassword",B:Pa,J:function(t){var e=t.requestType;if(!e||!t.email&&"EMAIL_SIGNIN"!=e)throw new Br("internal-error")}},Da={endpoint:"signupNewUser",B:function(t){if(ba(t),!t.password)throw new Br("weak-password")},J:Ea,R:!0},La={endpoint:"createAuthUri"},Ma={endpoint:"deleteAccount",T:["idToken"]},Fa={endpoint:"setAccountInfo",T:["idToken","deleteProvider"],B:function(t){if(!h(t.deleteProvider))throw new Br("internal-error")}},ja={endpoint:"emailLinkSignin",T:["email","oobCode"],B:ba,J:Ea,R:!0},Ua={endpoint:"emailLinkSignin",T:["idToken","email","oobCode"],B:ba,J:Ea,R:!0},Wa={endpoint:"getAccountInfo"},Va={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(t){if("EMAIL_SIGNIN"!=t.requestType)throw new Br("internal-error");ba(t)},da:"email"},qa={endpoint:"getOobConfirmationCode",T:["idToken","requestType"],B:function(t){if("VERIFY_EMAIL"!=t.requestType)throw new Br("internal-error")},da:"email"},Ba={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(t){if("PASSWORD_RESET"!=t.requestType)throw new Br("internal-error");ba(t)},da:"email"},Ha={ub:!0,endpoint:"getProjectConfig",Ib:"GET"},Ka={ub:!0,endpoint:"getRecaptchaParam",Ib:"GET",J:function(t){if(!t.recaptchaSiteKey)throw new Br("internal-error")}},Qa={endpoint:"resetPassword",B:Pa,da:"email"},Ga={endpoint:"sendVerificationCode",T:["phoneNumber","recaptchaToken"],da:"sessionInfo"},za={endpoint:"setAccountInfo",T:["idToken"],B:wa,R:!0},Xa={endpoint:"setAccountInfo",T:["idToken"],B:function(t){if(wa(t),!t.password)throw new Br("weak-password")},J:Ea,R:!0},Ya={endpoint:"signupNewUser",J:Ea,R:!0},$a={endpoint:"verifyAssertion",B:Ta,Oa:Ia,J:Na,R:!0},Ja={endpoint:"verifyAssertion",B:Ta,Oa:Ia,J:function(t){if(t.errorMessage&&"USER_NOT_FOUND"==t.errorMessage)throw new Br("user-not-found");if(t.errorMessage)throw as(t.errorMessage);if(!t[ha])throw new Br("internal-error")},R:!0},Za={endpoint:"verifyAssertion",B:function(t){if(Ta(t),!t.idToken)throw new Br("internal-error")},Oa:Ia,J:Na,R:!0},ts={endpoint:"verifyCustomToken",B:function(t){if(!t.token)throw new Br("invalid-custom-token")},J:Ea,R:!0},es={endpoint:"verifyPassword",B:function(t){if(ba(t),!t.password)throw new Br("wrong-password")},J:Ea,R:!0},ns={endpoint:"verifyPhoneNumber",B:Sa,J:Ea},rs={endpoint:"verifyPhoneNumber",B:function(t){if(!t.idToken)throw new Br("internal-error");Sa(t)},J:function(t){if(t.temporaryProof)throw t.code="credential-already-in-use",so(t);Ea(t)}},is={Xb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",B:Sa,J:Ea};function os(t,e,n){if(!function(t,e){if(!e||!e.length)return!0;if(!t)return!1;for(var n=0;n<e.length;n++){var r=t[e[n]];if(void 0===r||null===r||""===r)return!1}return!0}(n,e.T))return Ct(new Br("internal-error"));var r,i=e.Ib||"POST";return St(n).then(e.B).then(function(){return e.R&&(n.returnSecureToken=!0),function(t,e,n,r,i,o){var a=Ye(t.g+e);ze(a,"key",t.b),o&&ze(a,"cb",b().toString());var s="GET"==n;if(s)for(var u in r)r.hasOwnProperty(u)&&ze(a,u,r[u]);return new vt(function(e,o){ga(t,a.toString(),function(t){t?t.error?o(ss(t,i||{})):e(t):o(new Br("network-request-failed"))},n,s?void 0:Un(gr(r)),t.a,t.h.get())})}(t,e.endpoint,i,n,e.Xb,e.ub||!1)}).then(function(t){return r=t,e.Oa?e.Oa(n,r):r}).then(e.J).then(function(){if(!e.da)return r;if(!(e.da in r))throw new Br("internal-error");return r[e.da]})}function as(t){return ss({error:{errors:[{message:t}],code:400,message:t}})}function ss(t,e){var n=(t.error&&t.error.errors&&t.error.errors[0]||{}).reason||"",r={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(n=r[n]?new Br(r[n]):null)return n;for(var i in n=t.error&&t.error.message||"",ht(r={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_OR_INVALID_NONCE:"missing-or-invalid-nonce",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",INVALID_PROVIDER_ID:"invalid-provider-id",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",REJECTED_CREDENTIAL:"rejected-credential",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_DYNAMIC_LINK_DOMAIN:"invalid-dynamic-link-domain",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash"},e||{}),e=(e=n.match(/^[^\s]+\s*:\s*(.*)$/))&&1<e.length?e[1]:void 0,r)if(0===n.indexOf(i))return new Br(r[i],e);return!e&&t&&(e=vr(t)),new Br("internal-error",e)}function us(t){this.b=t,this.a=null,this.fb=function(t){return(fs||(fs=new vt(function(t,e){function r(){wr(),hr("gapi.load")("gapi.iframes",{callback:t,ontimeout:function(){wr(),e(Error("Network Error"))},timeout:hs.get()})}if(hr("gapi.iframes.Iframe"))t();else if(hr("gapi.load"))r();else{var i="__iframefcb"+Math.floor(1e6*Math.random()).toString();n[i]=function(){hr("gapi.load")?r():e(Error("Network Error"))},St(ea(i=wn(cs,{onload:i}))).s(function(){e(Error("Network Error"))})}}).s(function(t){throw fs=null,t}))).then(function(){return new vt(function(e,n){hr("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:hr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},function(r){function i(){clearTimeout(o),e()}t.a=r,t.a.restyle({setHideOnLeave:!1});var o=setTimeout(function(){n(Error("Network Error"))},ls.get());r.ping(i).then(i,function(){n(Error("Network Error"))})})})})}(this)}var cs=mn("https://apis.google.com/js/api.js?onload=%{onload}"),hs=new Er(3e4,6e4),ls=new Er(5e3,15e3),fs=null;function ps(t,e,n){this.i=t,this.g=e,this.h=n,this.f=null,this.a=$e(this.i,"/__/auth/iframe"),ze(this.a,"apiKey",this.g),ze(this.a,"appName",this.h),this.b=null,this.c=[]}function ds(t,e,n,r,i){this.o=t,this.m=e,this.c=n,this.l=r,this.h=this.g=this.i=null,this.a=i,this.f=null}function ys(t){try{return r.a.app(t).auth().ya()}catch(e){return[]}}function vs(t,e,n,r,i){this.m=t,this.f=e,this.b=n,this.c=r||null,this.h=i||null,this.o=this.u=this.v=null,this.g=[],this.l=this.a=null}function gs(t){var e=Kn();return function(t){return os(t,Ha,{}).then(function(t){return t.authorizedDomains||[]})}(t).then(function(t){t:{var n=Ye(e),r=n.c;n=n.b;for(var i=0;i<t.length;i++){var o=t[i],a=n,s=r;if(0==o.indexOf("chrome-extension://")?a=Ye(o).b==a&&"chrome-extension"==s:"http"!=s&&"https"!=s?a=!1:Yn.test(o)?a=a==o:(o=o.split(".").join("\\."),a=new RegExp("^(.+\\."+o+"|"+o+")$","i").test(a)),a){t=!0;break t}}t=!1}if(!t)throw new oo(Kn())})}function ms(t){return t.l?t.l:(t.l=Jn().then(function(){if(!t.u){var e=t.c,n=t.h,r=ys(t.b),i=new ps(t.m,t.f,t.b);i.f=e,i.b=n,i.c=V(r||[]),t.u=i.toString()}t.i=new us(t.u),function(t){if(!t.i)throw Error("IfcHandler must be initialized!");!function(t,e){t.fb.then(function(){t.a.register("authEvent",e,hr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})}(t.i,function(e){var n={};if(e&&e.authEvent){var r=!1;for(e=eo(e.authEvent),n=0;n<t.g.length;n++)r=t.g[n](e)||r;return(n={}).status=r?"ACK":"ERROR",St(n)}return n.status="ERROR",St(n)})}(t)}),t.l)}function _s(t){return t.o||(t.v=t.c?ur(t.c,ys(t.b)):null,t.o=new ua(t.f,fi(t.h),t.v)),t.o}function bs(t,e,n,r,i,o,a,s,u,c){return(t=new ds(t,e,n,r,i)).i=o,t.g=a,t.h=s,t.b=at(u||null),t.f=c,t.toString()}function ws(t){if(this.a=t||r.a.INTERNAL.reactNative&&r.a.INTERNAL.reactNative.AsyncStorage,!this.a)throw new Br("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function Es(t){this.b=t,this.a={},this.c=m(this.f,this)}ps.prototype.toString=function(){return this.f?ze(this.a,"v",this.f):hn(this.a.a,"v"),this.b?ze(this.a,"eid",this.b):hn(this.a.a,"eid"),this.c.length?ze(this.a,"fw",this.c.join(",")):hn(this.a.a,"fw"),this.a.toString()},ds.prototype.toString=function(){var t=$e(this.o,"/__/auth/handler");if(ze(t,"apiKey",this.m),ze(t,"appName",this.c),ze(t,"authType",this.l),this.a.isOAuthProvider){var e=this.a;try{var n=r.a.app(this.c).auth().ea()}catch(u){n=null}for(var i in e.$a=n,ze(t,"providerId",this.a.providerId),n=gr((e=this.a).yb))n[i]=n[i].toString();i=e.Dc,n=at(n);for(var o=0;o<i.length;o++){var a=i[o];a in n&&delete n[a]}e.cb&&e.$a&&!n[e.cb]&&(n[e.cb]=e.$a),ot(n)||ze(t,"customParameters",vr(n))}if("function"===typeof this.a.Eb&&((e=this.a.Eb()).length&&ze(t,"scopes",e.join(","))),this.i?ze(t,"redirectUrl",this.i):hn(t.a,"redirectUrl"),this.g?ze(t,"eventId",this.g):hn(t.a,"eventId"),this.h?ze(t,"v",this.h):hn(t.a,"v"),this.b)for(var s in this.b)this.b.hasOwnProperty(s)&&!Xe(t,s)&&ze(t,s,this.b[s]);return this.f?ze(t,"eid",this.f):hn(t.a,"eid"),(s=ys(this.c)).length&&ze(t,"fw",s.join(",")),t.toString()},(t=vs.prototype).Ea=function(t,e,n){var r=new Br("popup-closed-by-user"),i=new Br("web-storage-unsupported"),o=this,a=!1;return this.ga().then(function(){(function(t){var e={type:"webStorageSupport"};return ms(t).then(function(){return function(t,e){return t.fb.then(function(){return new vt(function(n){t.a.send(e.type,e,n,hr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})})}(t.i,e)}).then(function(t){if(t&&t.length&&"undefined"!==typeof t[0].webStorageSupport)return t[0].webStorageSupport;throw Error()})})(o).then(function(n){n||(t&&zn(t),e(i),a=!0)})}).s(function(){}).then(function(){if(!a)return function(t){return new vt(function(e){return function n(){Fe(2e3).then(function(){if(t&&!t.closed)return n();e()})}()})}(t)}).then(function(){if(!a)return Fe(n).then(function(){e(r)})})},t.Mb=function(){var t=cr();return!yr(t)&&!br(t)},t.Hb=function(){return!1},t.Cb=function(t,e,n,r,i,o,a){if(!t)return Ct(new Br("popup-blocked"));if(a&&!yr())return this.ga().s(function(e){zn(t),i(e)}),r(),St();this.a||(this.a=gs(_s(this)));var s=this;return this.a.then(function(){var e=s.ga().s(function(e){throw zn(t),i(e),e});return r(),e}).then(function(){(Zi(n),a)||Qn(bs(s.m,s.f,s.b,e,n,null,o,s.c,void 0,s.h),t)}).s(function(t){throw"auth/network-request-failed"==t.code&&(s.a=null),t})},t.Ca=function(t,e,n){this.a||(this.a=gs(_s(this)));var r=this;return this.a.then(function(){Zi(e),Qn(bs(r.m,r.f,r.b,t,e,Kn(),n,r.c,void 0,r.h))}).s(function(t){throw"auth/network-request-failed"==t.code&&(r.a=null),t})},t.ga=function(){var t=this;return ms(this).then(function(){return t.i.fb}).s(function(){throw t.a=null,new Br("network-request-failed")})},t.Qb=function(){return!0},t.wa=function(t){this.g.push(t)},t.Ka=function(t){U(this.g,function(e){return e==t})},(t=ws.prototype).get=function(t){return St(this.a.getItem(t)).then(function(t){return t&&mr(t)})},t.set=function(t,e){return St(this.a.setItem(t,vr(e)))},t.P=function(t){return St(this.a.removeItem(t))},t.Y=function(){},t.ca=function(){};var Ss,Cs=[];function Ts(t){this.a=t}function Is(t){this.c=t,this.b=!1,this.a=[]}function Ns(t,e,n,r){var i,o,a,s,u=n||{},c=null;if(t.b)return Ct(Error("connection_unavailable"));var h=r?800:50,l="undefined"!==typeof MessageChannel?new MessageChannel:null;return new vt(function(n,r){l?(i=Math.floor(Math.random()*Math.pow(10,20)).toString(),l.port1.start(),a=setTimeout(function(){r(Error("unsupported_event"))},h),c={messageChannel:l,onMessage:o=function(t){t.data.eventId===i&&("ack"===t.data.status?(clearTimeout(a),s=setTimeout(function(){r(Error("timeout"))},3e3)):"done"===t.data.status?(clearTimeout(s),"undefined"!==typeof t.data.response?n(t.data.response):r(Error("unknown_error"))):(clearTimeout(a),clearTimeout(s),r(Error("invalid_response"))))}},t.a.push(c),l.port1.addEventListener("message",o),t.c.postMessage({eventType:e,eventId:i,data:u},[l.port2])):r(Error("connection_unavailable"))}).then(function(e){return Os(t,c),e}).s(function(e){throw Os(t,c),e})}function Os(t,e){if(e){var n=e.messageChannel,r=e.onMessage;n&&(n.port1.removeEventListener("message",r),n.port1.close()),U(t.a,function(t){return t==e})}}function As(){if(!ks())throw new Br("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.m=n.indexedDB,this.type="indexedDB",this.g=this.l=this.f=this.i=null,this.u=!1,this.h=null;var t=this;er()&&self?(this.l=function(){var t=er()?self:null;if(D(Cs,function(n){n.b==t&&(e=n)}),!e){var e=new Es(t);Cs.push(e)}return e}(),this.l.subscribe("keyChanged",function(e,n){return Fs(t).then(function(e){return 0<e.length&&D(t.a,function(t){t(e)}),{keyProcessed:F(e,n.key)}})}),this.l.subscribe("ping",function(){return St(["keyChanged"])})):function(){var t=n.navigator;return t&&t.serviceWorker?St().then(function(){return t.serviceWorker.ready}).then(function(t){return t.active||null}).s(function(){return null}):St(null)}().then(function(e){(t.h=e)&&(t.g=new Is(new Ts(e)),Ns(t.g,"ping",null,!0).then(function(e){e[0].fulfilled&&F(e[0].value,"keyChanged")&&(t.u=!0)}).s(function(){}))})}function xs(t){return new vt(function(e,n){var r=t.m.open("firebaseLocalStorageDb",1);r.onerror=function(t){try{t.preventDefault()}catch(e){}n(Error(t.target.error))},r.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){n(e)}},r.onsuccess=function(r){(r=r.target.result).objectStoreNames.contains("firebaseLocalStorage")?e(r):function(t){return new vt(function(e,n){var r=t.m.deleteDatabase("firebaseLocalStorageDb");r.onsuccess=function(){e()},r.onerror=function(t){n(Error(t.target.error))}})}(t).then(function(){return xs(t)}).then(function(t){e(t)}).s(function(t){n(t)})}})}function Ps(t){return t.o||(t.o=xs(t)),t.o}function ks(){try{return!!n.indexedDB}catch(Bt){return!1}}function Rs(t){return t.objectStore("firebaseLocalStorage")}function Ds(t,e){return t.transaction(["firebaseLocalStorage"],e?"readwrite":"readonly")}function Ls(t){return new vt(function(e,n){t.onsuccess=function(t){t&&t.target?e(t.target.result):e()},t.onerror=function(t){n(t.target.error)}})}function Ms(t,e){return t.g&&t.h&&function(){var t=n.navigator;return t&&t.serviceWorker&&t.serviceWorker.controller||null}()===t.h?Ns(t.g,"keyChanged",{key:e},t.u).then(function(){}).s(function(){}):St()}function Fs(t){return Ps(t).then(function(t){var e=Rs(Ds(t,!1));return e.getAll?Ls(e.getAll()):new vt(function(t,n){var r=[],i=e.openCursor();i.onsuccess=function(e){(e=e.target.result)?(r.push(e.value),e.continue()):t(r)},i.onerror=function(t){n(t.target.error)}})}).then(function(e){var n={},r=[];if(0==t.b){for(r=0;r<e.length;r++)n[e[r].fbase_key]=e[r].value;r=function t(e,n){var r,o=[];for(r in e)r in n?i(e[r])!=i(n[r])?o.push(r):"object"==i(e[r])&&null!=e[r]&&null!=n[r]?0<t(e[r],n[r]).length&&o.push(r):e[r]!==n[r]&&o.push(r):o.push(r);for(r in n)r in e||o.push(r);return o}(t.c,n),t.c=n}return r})}function js(t){t.i&&t.i.cancel("STOP_EVENT"),t.f&&(clearTimeout(t.f),t.f=null)}function Us(t){var e=this,n=null;this.a=[],this.type="indexedDB",this.c=t,this.b=St().then(function(){if(ks()){var t=_r(),r="__sak"+t;return Ss||(Ss=new As),(n=Ss).set(r,t).then(function(){return n.get(r)}).then(function(e){if(e!==t)throw Error("indexedDB not supported!");return n.P(r)}).then(function(){return n}).s(function(){return e.c})}return e.c}).then(function(t){return e.type=t.type,t.Y(function(t){D(e.a,function(e){e(t)})}),t})}function Ws(){this.a={},this.type="inMemory"}function Vs(){if(!function(){var t="Node"==nr();if(!(t=qs()||t&&r.a.INTERNAL.node&&r.a.INTERNAL.node.localStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}()){if("Node"==nr())throw new Br("internal-error","The LocalStorage compatibility library was not found.");throw new Br("web-storage-unsupported")}this.a=qs()||r.a.INTERNAL.node.localStorage,this.type="localStorage"}function qs(){try{var t=n.localStorage,e=_r();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(r){return null}}function Bs(){this.type="nullStorage"}function Hs(){if(!function(){var t="Node"==nr();if(!(t=Ks()||t&&r.a.INTERNAL.node&&r.a.INTERNAL.node.sessionStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}()){if("Node"==nr())throw new Br("internal-error","The SessionStorage compatibility library was not found.");throw new Br("web-storage-unsupported")}this.a=Ks()||r.a.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function Ks(){try{var t=n.sessionStorage,e=_r();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(r){return null}}function Qs(){var t={};t.Browser=Xs,t.Node=Ys,t.ReactNative=$s,t.Worker=Js,this.a=t[nr()]}Es.prototype.f=function(t){var e=t.data.eventType,n=t.data.eventId,r=this.a[e];if(r&&0<r.length){t.ports[0].postMessage({status:"ack",eventId:n,eventType:e,response:null});var i=[];D(r,function(e){i.push(St().then(function(){return e(t.origin,t.data.data)}))}),It(i).then(function(r){var i=[];D(r,function(t){i.push({fulfilled:t.Db,value:t.value,reason:t.reason?t.reason.message:void 0})}),D(i,function(t){for(var e in t)"undefined"===typeof t[e]&&delete t[e]}),t.ports[0].postMessage({status:"done",eventId:n,eventType:e,response:i})})}},Es.prototype.subscribe=function(t,e){ot(this.a)&&this.b.addEventListener("message",this.c),"undefined"===typeof this.a[t]&&(this.a[t]=[]),this.a[t].push(e)},Es.prototype.unsubscribe=function(t,e){"undefined"!==typeof this.a[t]&&e?(U(this.a[t],function(t){return t==e}),0==this.a[t].length&&delete this.a[t]):e||delete this.a[t],ot(this.a)&&this.b.removeEventListener("message",this.c)},Ts.prototype.postMessage=function(t,e){this.a.postMessage(t,e)},Is.prototype.close=function(){for(;0<this.a.length;)Os(this,this.a[0]);this.b=!0},(t=As.prototype).set=function(t,e){var n,r=!1,i=this;return Ps(this).then(function(e){return Ls((e=Rs(Ds(n=e,!0))).get(t))}).then(function(o){var a=Rs(Ds(n,!0));return o?(o.value=e,Ls(a.put(o))):(i.b++,r=!0,(o={}).fbase_key=t,o.value=e,Ls(a.add(o)))}).then(function(){return i.c[t]=e,Ms(i,t)}).ia(function(){r&&i.b--})},t.get=function(t){return Ps(this).then(function(e){return Ls(Rs(Ds(e,!1)).get(t))}).then(function(t){return t&&t.value})},t.P=function(t){var e=!1,n=this;return Ps(this).then(function(r){return e=!0,n.b++,Ls(Rs(Ds(r,!0)).delete(t))}).then(function(){return delete n.c[t],Ms(n,t)}).ia(function(){e&&n.b--})},t.Y=function(t){0==this.a.length&&function(t){js(t),function e(){t.f=setTimeout(function(){t.i=Fs(t).then(function(e){0<e.length&&D(t.a,function(t){t(e)})}).then(function(){e()}).s(function(t){"STOP_EVENT"!=t.message&&e()})},800)}()}(this),this.a.push(t)},t.ca=function(t){U(this.a,function(e){return e==t}),0==this.a.length&&js(this)},(t=Us.prototype).get=function(t){return this.b.then(function(e){return e.get(t)})},t.set=function(t,e){return this.b.then(function(n){return n.set(t,e)})},t.P=function(t){return this.b.then(function(e){return e.P(t)})},t.Y=function(t){this.a.push(t)},t.ca=function(t){U(this.a,function(e){return e==t})},(t=Ws.prototype).get=function(t){return St(this.a[t])},t.set=function(t,e){return this.a[t]=e,St()},t.P=function(t){return delete this.a[t],St()},t.Y=function(){},t.ca=function(){},(t=Vs.prototype).get=function(t){var e=this;return St().then(function(){return mr(e.a.getItem(t))})},t.set=function(t,e){var n=this;return St().then(function(){var r=vr(e);null===r?n.P(t):n.a.setItem(t,r)})},t.P=function(t){var e=this;return St().then(function(){e.a.removeItem(t)})},t.Y=function(t){n.window&&be(n.window,"storage",t)},t.ca=function(t){n.window&&Se(n.window,"storage",t)},(t=Bs.prototype).get=function(){return St(null)},t.set=function(){return St()},t.P=function(){return St()},t.Y=function(){},t.ca=function(){},(t=Hs.prototype).get=function(t){var e=this;return St().then(function(){return mr(e.a.getItem(t))})},t.set=function(t,e){var n=this;return St().then(function(){var r=vr(e);null===r?n.P(t):n.a.setItem(t,r)})},t.P=function(t){var e=this;return St().then(function(){e.a.removeItem(t)})},t.Y=function(){},t.ca=function(){};var Gs,zs,Xs={A:Vs,Ra:Hs},Ys={A:Vs,Ra:Hs},$s={A:ws,Ra:Bs},Js={A:Vs,Ra:Bs},Zs={Zc:"local",NONE:"none",ad:"session"};function tu(){var t=!(br(cr())||!tr()),e=yr(),r=lr();this.o=t,this.h=e,this.l=r,this.a={},Gs||(Gs=new Qs),t=Gs;try{this.g=!Hn()&&Tr()||!n.indexedDB?new t.a.A:new Us(er()?new Ws:new t.a.A)}catch(i){this.g=new Ws,this.h=!0}try{this.i=new t.a.Ra}catch(i){this.i=new Ws}this.m=new Ws,this.f=m(this.Pb,this),this.b={}}function eu(){return zs||(zs=new tu),zs}function nu(t,e){switch(e){case"session":return t.i;case"none":return t.m;default:return t.g}}function ru(t,e){return"firebase:"+t.name+(e?":"+e:"")}function iu(t,e,n){return n=ru(e,n),"local"==e.A&&(t.b[n]=null),nu(t,e.A).P(n)}function ou(t){t.c&&(clearInterval(t.c),t.c=null)}function au(t){this.a=t,this.b=eu()}(t=tu.prototype).get=function(t,e){return nu(this,t.A).get(ru(t,e))},t.set=function(t,e,n){var r=ru(t,n),i=this,o=nu(this,t.A);return o.set(r,e).then(function(){return o.get(r)}).then(function(e){"local"==t.A&&(i.b[r]=e)})},t.addListener=function(t,e,r){t=ru(t,e),this.l&&(this.b[t]=n.localStorage.getItem(t)),ot(this.a)&&(nu(this,"local").Y(this.f),this.h||(Hn()||!Tr())&&n.indexedDB||!this.l||function(t){ou(t),t.c=setInterval(function(){for(var e in t.a){var r=n.localStorage.getItem(e),i=t.b[e];r!=i&&(t.b[e]=r,r=new ce({type:"storage",key:e,target:window,oldValue:i,newValue:r,a:!0}),t.Pb(r))}},1e3)}(this)),this.a[t]||(this.a[t]=[]),this.a[t].push(r)},t.removeListener=function(t,e,n){t=ru(t,e),this.a[t]&&(U(this.a[t],function(t){return t==n}),0==this.a[t].length&&delete this.a[t]),ot(this.a)&&(nu(this,"local").ca(this.f),ou(this))},t.Pb=function(t){if(t&&t.f){var e=t.a.key;if(null==e)for(var r in this.a){var i=this.b[r];"undefined"===typeof i&&(i=null);var o=n.localStorage.getItem(r);o!==i&&(this.b[r]=o,this.Xa(r))}else if(0==e.indexOf("firebase:")&&this.a[e]){if("undefined"!==typeof t.a.a?nu(this,"local").ca(this.f):ou(this),this.o)if(r=n.localStorage.getItem(e),(i=t.a.newValue)!==r)null!==i?n.localStorage.setItem(e,i):n.localStorage.removeItem(e);else if(this.b[e]===i&&"undefined"===typeof t.a.a)return;var a=this;r=function(){"undefined"===typeof t.a.a&&a.b[e]===n.localStorage.getItem(e)||(a.b[e]=n.localStorage.getItem(e),a.Xa(e))},Kt&&te&&10==te&&n.localStorage.getItem(e)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(r,10):r()}}else D(t,m(this.Xa,this))},t.Xa=function(t){this.a[t]&&D(this.a[t],function(t){t()})};var su,uu={name:"authEvent",A:"local"};function cu(){this.a=eu()}function hu(t,e){this.b=lu,this.f=n.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=t,this.h=e,this.l=n.Int32Array?new Int32Array(64):Array(64),void 0!==su||(su=n.Int32Array?new Int32Array(mu):mu),this.reset()}w(hu,function(){this.b=-1});for(var lu=64,fu=lu-1,pu=[],du=0;du<fu;du++)pu[du]=0;var yu=W(128,pu);function vu(t){for(var e=t.f,n=t.l,r=0,i=0;i<e.length;)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3],i=4*r;for(e=16;64>e;e++){i=0|n[e-15],r=0|n[e-2];var o=(0|n[e-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)|0,a=(0|n[e-7])+((r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)|0;n[e]=o+a|0}r=0|t.a[0],i=0|t.a[1];var s=0|t.a[2],u=0|t.a[3],c=0|t.a[4],h=0|t.a[5],l=0|t.a[6];for(o=0|t.a[7],e=0;64>e;e++){var f=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&s^i&s)|0;a=(o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0)+((a=(a=c&h^~c&l)+(0|su[e])|0)+(0|n[e])|0)|0,o=l,l=h,h=c,c=u+a|0,u=s,s=i,i=r,r=a+f|0}t.a[0]=t.a[0]+r|0,t.a[1]=t.a[1]+i|0,t.a[2]=t.a[2]+s|0,t.a[3]=t.a[3]+u|0,t.a[4]=t.a[4]+c|0,t.a[5]=t.a[5]+h|0,t.a[6]=t.a[6]+l|0,t.a[7]=t.a[7]+o|0}function gu(t,e,n){void 0===n&&(n=e.length);var r=0,i=t.c;if(o(e))for(;r<n;)t.f[i++]=e.charCodeAt(r++),i==t.b&&(vu(t),i=0);else{if(!l(e))throw Error("message must be string or array");for(;r<n;){var a=e[r++];if(!("number"==typeof a&&0<=a&&255>=a&&a==(0|a)))throw Error("message must be a byte array");t.f[i++]=a,i==t.b&&(vu(t),i=0)}}t.c=i,t.g+=n}hu.prototype.reset=function(){this.g=this.c=0,this.a=n.Int32Array?new Int32Array(this.h):V(this.h)};var mu=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function _u(){hu.call(this,8,bu)}w(_u,hu);var bu=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function wu(t,e,n,r,i){this.m=t,this.i=e,this.l=n,this.o=r||null,this.u=i||null,this.h=e+":"+n,this.v=new cu,this.g=new au(this.h),this.f=null,this.b=[],this.a=this.c=null}function Eu(t){return new Br("invalid-cordova-configuration",t)}function Su(t){var e=new _u;gu(e,t),t=[];var n=8*e.g;56>e.c?gu(e,yu,56-e.c):gu(e,yu,e.b-(e.c-56));for(var r=63;56<=r;r--)e.f[r]=255&n,n/=256;for(vu(e),r=n=0;r<e.i;r++)for(var i=24;0<=i;i-=8)t[n++]=e.a[r]>>i&255;return function(t){return L(t,function(t){return 1<(t=t.toString(16)).length?t:"0"+t}).join("")}(t)}function Cu(t,e){for(var n=0;n<t.b.length;n++)try{t.b[n](e)}catch(r){}}function Tu(t){return t.f||(t.f=t.ga().then(function(){return new vt(function(e){t.wa(function n(r){return e(r),t.Ka(n),!1}),function(t){function e(e){o=!0,a&&a.cancel(),Iu(t).then(function(n){var o=r;if(n&&e&&e.url){var a=null;-1!=(o=Ni(e.url)).indexOf("/__/auth/callback")&&(a=(a="object"===i(a=mr(Xe(a=Ye(o),"firebaseError")||null))?Hr(a):null)?new to(n.b,n.c,null,null,a):new to(n.b,n.c,o,n.g)),o=a||r}Cu(t,o)})}var r=new to("unknown",null,null,null,new Br("no-auth-event")),o=!1,a=Fe(500).then(function(){return Iu(t).then(function(){o||Cu(t,r)})}),s=n.handleOpenURL;n.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(hr("BuildInfo.packageName",n).toLowerCase()+"://")&&e({url:t}),"function"===typeof s)try{s(t)}catch(r){console.error(r)}},io||(io=new no),io.subscribe(e)}(t)})})),t.f}function Iu(t){var e=null;return function(t){return t.b.get(uu,t.a).then(function(t){return eo(t)})}(t.g).then(function(n){return e=n,iu((n=t.g).b,uu,n.a)}).then(function(){return e})}function Nu(t){this.a=t,this.b=eu()}(t=wu.prototype).ga=function(){return this.za?this.za:this.za=(Zn(void 0)?Jn().then(function(){return new vt(function(t,e){var r=n.document,i=setTimeout(function(){e(Error("Cordova framework is not ready."))},1e3);r.addEventListener("deviceready",function(){clearTimeout(i),t()},!1)})}):Ct(Error("Cordova must run in an Android or iOS file scheme."))).then(function(){if("function"!==typeof hr("universalLinks.subscribe",n))throw Eu("cordova-universal-links-plugin-fix is not installed");if("undefined"===typeof hr("BuildInfo.packageName",n))throw Eu("cordova-plugin-buildinfo is not installed");if("function"!==typeof hr("cordova.plugins.browsertab.openUrl",n))throw Eu("cordova-plugin-browsertab is not installed");if("function"!==typeof hr("cordova.InAppBrowser.open",n))throw Eu("cordova-plugin-inappbrowser is not installed")},function(){throw new Br("cordova-not-ready")})},t.Ea=function(t,e){return e(new Br("operation-not-supported-in-this-environment")),St()},t.Cb=function(){return Ct(new Br("operation-not-supported-in-this-environment"))},t.Qb=function(){return!1},t.Mb=function(){return!0},t.Hb=function(){return!0},t.Ca=function(t,e,r){if(this.c)return Ct(new Br("redirect-operation-pending"));var i=this,o=n.document,a=null,s=null,u=null,c=null;return this.c=St().then(function(){return Zi(e),Tu(i)}).then(function(){return function(t,e,r,i){var o=function(){for(var t=20,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}(),a=new to(e,i,null,o,new Br("no-auth-event")),s=hr("BuildInfo.packageName",n);if("string"!==typeof s)throw new Br("invalid-cordova-configuration");var u=hr("BuildInfo.displayName",n),c={};if(cr().toLowerCase().match(/iphone|ipad|ipod/))c.ibi=s;else{if(!cr().toLowerCase().match(/android/))return Ct(new Br("operation-not-supported-in-this-environment"));c.apn=s}u&&(c.appDisplayName=u),o=Su(o),c.sessionId=o;var h=bs(t.m,t.i,t.l,e,r,null,i,t.o,c,t.u);return t.ga().then(function(){var e=t.h;return t.v.a.set(uu,a.C(),e)}).then(function(){var e=hr("cordova.plugins.browsertab.isAvailable",n);if("function"!==typeof e)throw new Br("invalid-cordova-configuration");var r=null;e(function(e){if(e){if("function"!==typeof(r=hr("cordova.plugins.browsertab.openUrl",n)))throw new Br("invalid-cordova-configuration");r(h)}else{if("function"!==typeof(r=hr("cordova.InAppBrowser.open",n)))throw new Br("invalid-cordova-configuration");e=!(!(e=cr()).match(/(iPad|iPhone|iPod).*OS 7_\d/i)&&!e.match(/(iPad|iPhone|iPod).*OS 8_\d/i)),t.a=r(h,e?"_blank":"_system","location=yes")}})})}(i,t,e,r)}).then(function(){return new vt(function(t,e){s=function(){var e=hr("cordova.plugins.browsertab.close",n);return t(),"function"===typeof e&&e(),i.a&&"function"===typeof i.a.close&&(i.a.close(),i.a=null),!1},i.wa(s),u=function(){a||(a=Fe(2e3).then(function(){e(new Br("redirect-cancelled-by-user"))}))},c=function(){Sr()&&u()},o.addEventListener("resume",u,!1),cr().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",c,!1)}).s(function(t){return Iu(i).then(function(){throw t})})}).ia(function(){u&&o.removeEventListener("resume",u,!1),c&&o.removeEventListener("visibilitychange",c,!1),a&&a.cancel(),s&&i.Ka(s),i.c=null})},t.wa=function(t){this.b.push(t),Tu(this).s(function(e){"auth/invalid-cordova-configuration"===e.code&&(e=new to("unknown",null,null,null,new Br("no-auth-event")),t(e))})},t.Ka=function(t){U(this.b,function(e){return e==t})};var Ou={name:"pendingRedirect",A:"session"};function Au(t){return iu(t.b,Ou,t.a)}function xu(t,e,n){this.u=t,this.l=e,this.m=n,this.h=[],this.f=!1,this.i=m(this.bb,this),this.b=new Wu,this.o=new Hu,this.g=new Nu(this.l+":"+this.m),this.c={},this.c.unknown=this.b,this.c.signInViaRedirect=this.b,this.c.linkViaRedirect=this.b,this.c.reauthViaRedirect=this.b,this.c.signInViaPopup=this.o,this.c.linkViaPopup=this.o,this.c.reauthViaPopup=this.o,this.a=Pu(this.u,this.l,this.m,hi)}function Pu(t,e,n,i){var o=r.a.SDK_VERSION||null;return Zn()?new wu(t,e,n,o,i):new vs(t,e,n,o,i)}function ku(t){t.f||(t.f=!0,t.a.wa(t.i));var e=t.a;return t.a.ga().s(function(n){throw t.a==e&&t.reset(),n})}function Ru(t){t.a.Mb()&&ku(t).s(function(e){var n=new to("unknown",null,null,null,new Br("operation-not-supported-in-this-environment"));Fu(e)&&t.bb(n)}),t.a.Hb()||Vu(t.b)}(t=xu.prototype).reset=function(){this.f=!1,this.a.Ka(this.i),this.a=Pu(this.u,this.l,this.m)},t.Ya=function(){this.b.Ya()},t.subscribe=function(t){if(F(this.h,t)||this.h.push(t),!this.f){var e=this;(function(t){return t.b.get(Ou,t.a).then(function(t){return"pending"==t})})(this.g).then(function(t){t?Au(e.g).then(function(){ku(e).s(function(t){var n=new to("unknown",null,null,null,new Br("operation-not-supported-in-this-environment"));Fu(t)&&e.bb(n)})}):Ru(e)}).s(function(){Ru(e)})}},t.unsubscribe=function(t){U(this.h,function(e){return e==t})},t.bb=function(t){if(!t)throw new Br("invalid-auth-event");for(var e=!1,n=0;n<this.h.length;n++){var r=this.h[n];if(r.vb(t.b,t.c)){(e=this.c[t.b])&&e.h(t,r),e=!0;break}}return Vu(this.b),e};var Du=new Er(2e3,1e4),Lu=new Er(3e4,6e4);function Mu(t,e,n,r,i,o){return t.a.Cb(e,n,r,function(){t.f||(t.f=!0,t.a.wa(t.i))},function(){t.reset()},i,o)}function Fu(t){return!(!t||"auth/cordova-not-ready"!=t.code)}xu.prototype.fa=function(){return this.b.fa()},xu.prototype.Ca=function(t,e,n){var r,i=this;return function(t){return t.b.set(Ou,"pending",t.a)}(this.g).then(function(){return i.a.Ca(t,e,n).s(function(t){if(Fu(t))throw new Br("operation-not-supported-in-this-environment");return r=t,Au(i.g).then(function(){throw r})}).then(function(){return i.a.Qb()?new vt(function(){}):Au(i.g).then(function(){return i.fa()}).then(function(){}).s(function(){})})})},xu.prototype.Ea=function(t,e,n,r){return this.a.Ea(n,function(n){t.ha(e,null,n,r)},Du.get())};var ju={};function Uu(t,e,n){var r=e+":"+n;return ju[r]||(ju[r]=new xu(t,e,n)),ju[r]}function Wu(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function Vu(t){t.g||(t.g=!0,Bu(t,!1,null,null))}function qu(t,e){if(t.b=function(){return St(e)},t.f.length)for(var n=0;n<t.f.length;n++)t.f[n](e)}function Bu(t,e,n,r){e?r?function(t,e){if(t.b=function(){return Ct(e)},t.c.length)for(var n=0;n<t.c.length;n++)t.c[n](e)}(t,r):qu(t,n):qu(t,{user:null}),t.f=[],t.c=[]}function Hu(){}function Ku(){this.sb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.sb},set:function(t){this.sb=t},enumerable:!1})}function Qu(t,e){this.a=e,xr(this,"verificationId",t)}function Gu(t,e,n,r){return new Yi(t).Ua(e,n).then(function(t){return new Qu(t,r)})}function zu(t){var e=ci(t);if(!(e&&e.exp&&e.auth_time&&e.iat))throw new Br("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");Pr(this,{token:t,expirationTime:Cr(1e3*e.exp),authTime:Cr(1e3*e.auth_time),issuedAtTime:Cr(1e3*e.iat),signInProvider:e.firebase&&e.firebase.sign_in_provider?e.firebase.sign_in_provider:null,claims:e})}function Xu(t,e,n){if(this.h=t,this.i=e,this.g=n,this.c=3e4,this.f=96e4,this.b=null,this.a=this.c,this.f<this.c)throw Error("Proactive refresh lower bound greater than upper bound!")}function Yu(t){this.f=t,this.b=this.a=null,this.c=0}function $u(t,e){var n=e[ha],r=e.refreshToken;e=Ju(e.expiresIn),t.b=n,t.c=e,t.a=r}function Ju(t){return b()+1e3*parseInt(t,10)}function Zu(t,e){return function(t,e){return new vt(function(n,r){"refresh_token"==e.grant_type&&e.refresh_token||"authorization_code"==e.grant_type&&e.code?ga(t,t.i+"?key="+encodeURIComponent(t.b),function(t){t?t.error?r(ss(t)):t.access_token&&t.refresh_token?n(t):r(new Br("internal-error")):r(new Br("network-request-failed"))},"POST",cn(e).toString(),t.f,t.l.get()):r(new Br("internal-error"))})}(t.f,e).then(function(e){return t.b=e.access_token,t.c=Ju(e.expires_in),t.a=e.refresh_token,{accessToken:t.b,expirationTime:t.c,refreshToken:t.a}}).s(function(e){throw"auth/user-token-expired"==e.code&&(t.a=null),e})}function tc(t,e){this.a=t||null,this.b=e||null,Pr(this,{lastSignInTime:Cr(e||null),creationTime:Cr(t||null)})}function ec(t,e,n,r,i,o){Pr(this,{uid:t,displayName:r||null,photoURL:i||null,email:n||null,phoneNumber:o||null,providerId:e})}function nc(t,e){for(var n in ue.call(this,t),e)this[n]=e[n]}function rc(t,e,n){this.G=[],this.m=t.apiKey,this.o=t.appName,this.u=t.authDomain||null,t=r.a.SDK_VERSION?ur(r.a.SDK_VERSION):null,this.b=new ua(this.m,fi(hi),t),this.h=new Yu(this.b),hc(this,e[ha]),$u(this.h,e),xr(this,"refreshToken",this.h.a),pc(this,n||{}),ke.call(this),this.I=!1,this.u&&fr()&&(this.a=Uu(this.u,this.m,this.o)),this.N=[],this.i=null,this.w=function(t){return new Xu(function(){return t.F(!0)},function(t){return!(!t||"auth/network-request-failed"!=t.code)},function(){var e=t.h.c-b()-3e5;return 0<e?e:0})}(this),this.V=m(this.Ha,this);var i=this;this.ka=null,this.ta=function(t){i.pa(t.g)},this.X=null,this.O=[],this.sa=function(t){oc(i,t.c)},this.W=null}function ic(t,e){t.X&&Se(t.X,"languageCodeChanged",t.ta),(t.X=e)&&be(e,"languageCodeChanged",t.ta)}function oc(t,e){t.O=e,va(t.b,r.a.SDK_VERSION?ur(r.a.SDK_VERSION,t.O):null)}function ac(t,e){t.W&&Se(t.W,"frameworkChanged",t.sa),(t.W=e)&&be(e,"frameworkChanged",t.sa)}function sc(t){try{return r.a.app(t.o).auth()}catch(e){throw new Br("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.o+"'!")}}function uc(t){t.D||t.w.b||(t.w.start(),Se(t,"tokenChanged",t.V),be(t,"tokenChanged",t.V))}function cc(t){Se(t,"tokenChanged",t.V),t.w.stop()}function hc(t,e){t.ra=e,xr(t,"_lat",e)}function lc(t){for(var e=[],n=0;n<t.N.length;n++)e.push(t.N[n](t));return It(e).then(function(){return t})}function fc(t){t.a&&!t.I&&(t.I=!0,t.a.subscribe(t))}function pc(t,e){Pr(t,{uid:e.uid,displayName:e.displayName||null,photoURL:e.photoURL||null,email:e.email||null,emailVerified:e.emailVerified||!1,phoneNumber:e.phoneNumber||null,isAnonymous:e.isAnonymous||!1,metadata:new tc(e.createdAt,e.lastLoginAt),providerData:[]})}function dc(){}function yc(t){return St().then(function(){if(t.D)throw new Br("app-deleted")})}function vc(t){return L(t.providerData,function(t){return t.providerId})}function gc(t,e){e&&(mc(t,e.providerId),t.providerData.push(e))}function mc(t,e){U(t.providerData,function(t){return t.providerId==e})}function _c(t,e,n){("uid"!=e||n)&&t.hasOwnProperty(e)&&xr(t,e,n)}function bc(t,e){t!=e&&(Pr(t,{uid:e.uid,displayName:e.displayName,photoURL:e.photoURL,email:e.email,emailVerified:e.emailVerified,phoneNumber:e.phoneNumber,isAnonymous:e.isAnonymous,providerData:[]}),e.metadata?xr(t,"metadata",function(t){return new tc(t.a,t.b)}(e.metadata)):xr(t,"metadata",new tc),D(e.providerData,function(e){gc(t,e)}),function(t,e){t.b=e.b,t.a=e.a,t.c=e.c}(t.h,e.h),xr(t,"refreshToken",t.h.a))}function wc(t){return t.F().then(function(e){var n=t.isAnonymous;return function(t,e){return os(t.b,Wa,{idToken:e}).then(m(t.xc,t))}(t,e).then(function(){return n||_c(t,"isAnonymous",!1),e})})}function Ec(t,e){e[ha]&&t.ra!=e[ha]&&($u(t.h,e),t.dispatchEvent(new nc("tokenChanged")),hc(t,e[ha]),_c(t,"refreshToken",t.h.a))}function Sc(t,e){return wc(t).then(function(){if(F(vc(t),e))return lc(t).then(function(){throw new Br("provider-already-linked")})})}function Cc(t,e,n){return kr({user:t,credential:Ji(e),additionalUserInfo:e=gi(e),operationType:n})}function Tc(t,e){return Ec(t,e),t.reload().then(function(){return t})}function Ic(t,e,n,i,o){if(!fr())return Ct(new Br("operation-not-supported-in-this-environment"));if(t.i&&!o)return Ct(t.i);var a=vi(n.providerId),s=_r(t.uid+":::"),u=null;(!yr()||tr())&&t.u&&n.isOAuthProvider&&(u=bs(t.u,t.m,t.o,e,n,null,s,r.a.SDK_VERSION||null));var c=Xn(u,a&&a.Ba,a&&a.Aa);return i=i().then(function(){if(Oc(t),!o)return t.F().then(function(){})}).then(function(){return Mu(t.a,c,e,n,s,!!u)}).then(function(){return new vt(function(n,r){t.ha(e,null,new Br("cancelled-popup-request"),t.g||null),t.f=n,t.v=r,t.g=s,t.c=t.a.Ea(t,e,c,s)})}).then(function(t){return c&&zn(c),t?kr(t):null}).s(function(t){throw c&&zn(c),t}),Ac(t,i,o)}function Nc(t,e,n,r,i){if(!fr())return Ct(new Br("operation-not-supported-in-this-environment"));if(t.i&&!i)return Ct(t.i);var o=null,a=_r(t.uid+":::");return r=r().then(function(){if(Oc(t),!i)return t.F().then(function(){})}).then(function(){return t.aa=a,lc(t)}).then(function(e){return t.ba&&(e=(e=t.ba).b.set(kc,t.C(),e.a)),e}).then(function(){return t.a.Ca(e,n,a)}).s(function(e){if(o=e,t.ba)return Rc(t.ba);throw o}).then(function(){if(o)throw o}),Ac(t,r,i)}function Oc(t){if(!t.a||!t.I){if(t.a&&!t.I)throw new Br("internal-error");throw new Br("auth-domain-config-required")}}function Ac(t,e,n){var r=function(t,e,n){return t.i&&!n?(e.cancel(),Ct(t.i)):e.s(function(e){throw!e||"auth/user-disabled"!=e.code&&"auth/user-token-expired"!=e.code||(t.i||t.dispatchEvent(new nc("userInvalidated")),t.i=e),e})}(t,e,n);return t.G.push(r),r.ia(function(){j(t.G,r)}),r}function xc(t){if(!t.apiKey)return null;var e={apiKey:t.apiKey,authDomain:t.authDomain,appName:t.appName},n={};if(!(t.stsTokenManager&&t.stsTokenManager.accessToken&&t.stsTokenManager.expirationTime))return null;n[ha]=t.stsTokenManager.accessToken,n.refreshToken=t.stsTokenManager.refreshToken||null,n.expiresIn=(t.stsTokenManager.expirationTime-b())/1e3;var r=new rc(e,n,t);return t.providerData&&D(t.providerData,function(t){t&&gc(r,kr(t))}),t.redirectEventId&&(r.aa=t.redirectEventId),r}function Pc(t){this.a=t,this.b=eu()}Wu.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Wu.prototype.h=function(t,e){if(t){this.reset(),this.g=!0;var n=t.b,r=t.c,i=t.a&&"auth/web-storage-unsupported"==t.a.code,o=t.a&&"auth/operation-not-supported-in-this-environment"==t.a.code;this.i=!(!i&&!o),"unknown"!=n||i||o?t.a?(Bu(this,!0,null,t.a),St()):e.xa(n,r)?function(t,e,n){n=n.xa(e.b,e.c);var r=e.f,i=e.g,o=e.h,a=!!e.b.match(/Redirect$/);n(r,i,o).then(function(e){Bu(t,a,e,null)}).s(function(e){Bu(t,a,null,e)})}(this,t,e):Ct(new Br("invalid-auth-event")):(Bu(this,!1,null,null),St())}else Ct(new Br("invalid-auth-event"))},Wu.prototype.Ya=function(){this.g&&!this.i&&Bu(this,!1,null,null)},Wu.prototype.fa=function(){var t=this;return new vt(function(e,n){t.b?t.b().then(e,n):(t.f.push(e),t.c.push(n),function(t){var e=new Br("timeout");t.a&&t.a.cancel(),t.a=Fe(Lu.get()).then(function(){t.b||(t.g=!0,Bu(t,!0,null,e))})}(t))})},Hu.prototype.h=function(t,e){if(t){var n=t.b,r=t.c;t.a?(e.ha(t.b,null,t.a,t.c),St()):e.xa(n,r)?function(t,e){var n=t.c,r=t.b;e.xa(r,n)(t.f,t.g,t.h).then(function(t){e.ha(r,t,null,n)}).s(function(t){e.ha(r,null,t,n)})}(t,e):Ct(new Br("invalid-auth-event"))}else Ct(new Br("invalid-auth-event"))},Qu.prototype.confirm=function(t){return t=$i(this.verificationId,t),this.a(t)},Xu.prototype.start=function(){this.a=this.c,function t(e,r){e.stop();e.b=Fe(function(t,e){return e?(t.a=t.c,t.g()):(e=t.a,t.a*=2,t.a>t.f&&(t.a=t.f),e)}(e,r)).then(function(){return function(){var t=n.document,e=null;return Sr()||!t?St():new vt(function(n){e=function(){Sr()&&(t.removeEventListener("visibilitychange",e,!1),n())},t.addEventListener("visibilitychange",e,!1)}).s(function(n){throw t.removeEventListener("visibilitychange",e,!1),n})}()}).then(function(){return e.h()}).then(function(){t(e,!0)}).s(function(n){e.i(n)&&t(e,!1)})}(this,!0)},Xu.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},Yu.prototype.C=function(){return{apiKey:this.f.b,refreshToken:this.a,accessToken:this.b,expirationTime:this.c}},Yu.prototype.getToken=function(t){return t=!!t,this.b&&!this.a?Ct(new Br("user-token-expired")):t||!this.b||b()>this.c-3e4?this.a?Zu(this,{grant_type:"refresh_token",refresh_token:this.a}):St(null):St({accessToken:this.b,expirationTime:this.c,refreshToken:this.a})},tc.prototype.C=function(){return{lastLoginAt:this.b,createdAt:this.a}},w(nc,ue),w(rc,ke),rc.prototype.pa=function(t){this.ka=t,ya(this.b,t)},rc.prototype.ea=function(){return this.ka},rc.prototype.ya=function(){return V(this.O)},rc.prototype.Ha=function(){this.w.b&&(this.w.stop(),this.w.start())},xr(rc.prototype,"providerId","firebase"),(t=rc.prototype).reload=function(){var t=this;return Ac(this,yc(this).then(function(){return wc(t).then(function(){return lc(t)}).then(dc)}))},t.dc=function(t){return this.F(t).then(function(t){return new zu(t)})},t.F=function(t){var e=this;return Ac(this,yc(this).then(function(){return e.h.getToken(t)}).then(function(t){if(!t)throw new Br("internal-error");return t.accessToken!=e.ra&&(hc(e,t.accessToken),e.dispatchEvent(new nc("tokenChanged"))),_c(e,"refreshToken",t.refreshToken),t.accessToken}))},t.xc=function(t){if(!(t=t.users)||!t.length)throw new Br("internal-error");pc(this,{uid:(t=t[0]).localId,displayName:t.displayName,photoURL:t.photoUrl,email:t.email,emailVerified:!!t.emailVerified,phoneNumber:t.phoneNumber,lastLoginAt:t.lastLoginAt,createdAt:t.createdAt});for(var e=function(t){return(t=t.providerUserInfo)&&t.length?L(t,function(t){return new ec(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)}):[]}(t),n=0;n<e.length;n++)gc(this,e[n]);_c(this,"isAnonymous",!(this.email&&t.passwordHash)&&!(this.providerData&&this.providerData.length))},t.gb=function(t){var e=this,n=null;return Ac(this,t.f(this.b,this.uid).then(function(t){return Ec(e,t),n=Cc(e,t,"reauthenticate"),e.i=null,e.reload()}).then(function(){return n}),!0)},t.yc=function(t){return Or("firebase.User.prototype.reauthenticateWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential instead."),this.gb(t).then(function(){})},t.eb=function(t){var e=this,n=null;return Ac(this,Sc(this,t.providerId).then(function(){return e.F()}).then(function(n){return t.b(e.b,n)}).then(function(t){return n=Cc(e,t,"link"),Tc(e,t)}).then(function(){return n}))},t.pc=function(t){return Or("firebase.User.prototype.linkWithCredential is deprecated. Please use firebase.User.prototype.linkAndRetrieveDataWithCredential instead."),this.eb(t).then(function(t){return t.user})},t.qc=function(t,e){var n=this;return Ac(this,Sc(this,"phone").then(function(){return Gu(sc(n),t,e,m(n.eb,n))}))},t.zc=function(t,e){var n=this;return Ac(this,St().then(function(){return Gu(sc(n),t,e,m(n.gb,n))}),!0)},t.pb=function(t){var e=this;return Ac(this,this.F().then(function(n){return e.b.pb(n,t)}).then(function(t){return Ec(e,t),e.reload()}))},t.Rc=function(t){var e=this;return Ac(this,this.F().then(function(n){return t.b(e.b,n)}).then(function(t){return Ec(e,t),e.reload()}))},t.qb=function(t){var e=this;return Ac(this,this.F().then(function(n){return e.b.qb(n,t)}).then(function(t){return Ec(e,t),e.reload()}))},t.rb=function(t){if(void 0===t.displayName&&void 0===t.photoURL)return yc(this);var e=this;return Ac(this,this.F().then(function(n){return e.b.rb(n,{displayName:t.displayName,photoUrl:t.photoURL})}).then(function(t){return Ec(e,t),_c(e,"displayName",t.displayName||null),_c(e,"photoURL",t.photoUrl||null),D(e.providerData,function(t){"password"===t.providerId&&(xr(t,"displayName",e.displayName),xr(t,"photoURL",e.photoURL))}),lc(e)}).then(dc))},t.Pc=function(t){var e=this;return Ac(this,wc(this).then(function(n){return F(vc(e),t)?function(t,e,n){return os(t,Fa,{idToken:e,deleteProvider:n})}(e.b,n,[t]).then(function(t){var n={};return D(t.providerUserInfo||[],function(t){n[t.providerId]=!0}),D(vc(e),function(t){n[t]||mc(e,t)}),n[Yi.PROVIDER_ID]||xr(e,"phoneNumber",null),lc(e)}):lc(e).then(function(){throw new Br("no-such-provider")})}))},t.delete=function(){var t=this;return Ac(this,this.F().then(function(e){return os(t.b,Ma,{idToken:e})}).then(function(){t.dispatchEvent(new nc("userDeleted"))})).then(function(){for(var e=0;e<t.G.length;e++)t.G[e].cancel("app-deleted");ic(t,null),ac(t,null),t.G=[],t.D=!0,cc(t),xr(t,"refreshToken",null),t.a&&t.a.unsubscribe(t)})},t.vb=function(t,e){return!!("linkViaPopup"==t&&(this.g||null)==e&&this.f||"reauthViaPopup"==t&&(this.g||null)==e&&this.f||"linkViaRedirect"==t&&(this.aa||null)==e||"reauthViaRedirect"==t&&(this.aa||null)==e)},t.ha=function(t,e,n,r){"linkViaPopup"!=t&&"reauthViaPopup"!=t||r!=(this.g||null)||(n&&this.v?this.v(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.v)},t.xa=function(t,e){return"linkViaPopup"==t&&e==(this.g||null)?m(this.Ab,this):"reauthViaPopup"==t&&e==(this.g||null)?m(this.Bb,this):"linkViaRedirect"==t&&(this.aa||null)==e?m(this.Ab,this):"reauthViaRedirect"==t&&(this.aa||null)==e?m(this.Bb,this):null},t.rc=function(t){var e=this;return Ic(this,"linkViaPopup",t,function(){return Sc(e,t.providerId).then(function(){return lc(e)})},!1)},t.Ac=function(t){return Ic(this,"reauthViaPopup",t,function(){return St()},!0)},t.sc=function(t){var e=this;return Nc(this,"linkViaRedirect",t,function(){return Sc(e,t.providerId)},!1)},t.Bc=function(t){return Nc(this,"reauthViaRedirect",t,function(){return St()},!0)},t.Ab=function(t,e,n){var r=this;this.c&&(this.c.cancel(),this.c=null);var i=null;return Ac(this,this.F().then(function(i){return Aa(r.b,{requestUri:t,postBody:n,sessionId:e,idToken:i})}).then(function(t){return i=Cc(r,t,"link"),Tc(r,t)}).then(function(){return i}))},t.Bb=function(t,e,n){var r=this;this.c&&(this.c.cancel(),this.c=null);var i=null;return Ac(this,St().then(function(){return Oi(xa(r.b,{requestUri:t,sessionId:e,postBody:n}),r.uid)}).then(function(t){return i=Cc(r,t,"reauthenticate"),Ec(r,t),r.i=null,r.reload()}).then(function(){return i}),!0)},t.jb=function(t){var e=this,n=null;return Ac(this,this.F().then(function(e){return n=e,"undefined"===typeof t||ot(t)?{}:ri(new Gr(t))}).then(function(t){return e.b.jb(n,t)}).then(function(t){if(e.email!=t)return e.reload()}).then(function(){}))},t.toJSON=function(){return this.C()},t.C=function(){var t={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,providerData:[],apiKey:this.m,appName:this.o,authDomain:this.u,stsTokenManager:this.h.C(),redirectEventId:this.aa||null};return this.metadata&&ht(t,this.metadata.C()),D(this.providerData,function(e){t.providerData.push(function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}(e))}),t};var kc={name:"redirectUser",A:"session"};function Rc(t){return iu(t.b,kc,t.a)}function Dc(t){this.a=t,this.b=eu(),this.c=null,this.f=function(t){var e=Fc("local"),r=Fc("session"),i=Fc("none");return function(t,e,r){var i=ru(e,r),o=nu(t,e.A);return t.get(e,r).then(function(a){var s=null;try{s=mr(n.localStorage.getItem(i))}catch(u){}if(s&&!a)return n.localStorage.removeItem(i),t.set(e,s,r);s&&a&&"localStorage"!=o.type&&n.localStorage.removeItem(i)})}(t.b,e,t.a).then(function(){return t.b.get(r,t.a)}).then(function(n){return n?r:t.b.get(i,t.a).then(function(n){return n?i:t.b.get(e,t.a).then(function(n){return n?e:t.b.get(Mc,t.a).then(function(t){return t?Fc(t):e})})})}).then(function(e){return t.c=e,Lc(t,e.A)}).s(function(){t.c||(t.c=e)})}(this),this.b.addListener(Fc("local"),this.a,m(this.g,this))}function Lc(t,e){var n,r=[];for(n in Zs)Zs[n]!==e&&r.push(iu(t.b,Fc(Zs[n]),t.a));return r.push(iu(t.b,Mc,t.a)),function(t){return new vt(function(e,n){var r=t.length,i=[];if(r)for(var o=function(t,n){r--,i[t]=n,0==r&&e(i)},a=function(t){n(t)},s=0;s<t.length;s++)Tt(t[s],_(o,s),a);else e(i)})}(r)}Dc.prototype.g=function(){var t=this,e=Fc("local");Vc(this,function(){return St().then(function(){return t.c&&"local"!=t.c.A?t.b.get(e,t.a):null}).then(function(n){if(n)return Lc(t,"local").then(function(){t.c=e})})})};var Mc={name:"persistence",A:"session"};function Fc(t){return{name:"authUser",A:t}}function jc(t,e){return Vc(t,function(){return t.b.set(t.c,e.C(),t.a)})}function Uc(t){return Vc(t,function(){return iu(t.b,t.c,t.a)})}function Wc(t,e){return Vc(t,function(){return t.b.get(t.c,t.a).then(function(t){return t&&e&&(t.authDomain=e),xc(t||{})})})}function Vc(t,e){return t.f=t.f.then(e,e),t.f}function qc(t){if(this.m=!1,xr(this,"settings",new Ku),xr(this,"app",t),!Xc(this).options||!Xc(this).options.apiKey)throw new Br("invalid-api-key");t=r.a.SDK_VERSION?ur(r.a.SDK_VERSION):null,this.b=new ua(Xc(this).options&&Xc(this).options.apiKey,fi(hi),t),this.N=[],this.o=[],this.I=[],this.Tb=r.a.INTERNAL.createSubscribe(m(this.mc,this)),this.O=void 0,this.Ub=r.a.INTERNAL.createSubscribe(m(this.nc,this)),Gc(this,null),this.h=new Dc(Xc(this).options.apiKey+":"+Xc(this).name),this.w=new Pc(Xc(this).options.apiKey+":"+Xc(this).name),this.V=Zc(this,function(t){var e=Xc(t).options.authDomain,n=function(t){var e=function(t,e){return t.b.get(kc,t.a).then(function(t){return t&&e&&(t.authDomain=e),xc(t||{})})}(t.w,Xc(t).options.authDomain).then(function(e){return(t.D=e)&&(e.ba=t.w),Rc(t.w)});return Zc(t,e)}(t).then(function(){return Wc(t.h,e)}).then(function(e){return e?(e.ba=t.w,t.D&&(t.D.aa||null)==(e.aa||null)?e:e.reload().then(function(){return jc(t.h,e).then(function(){return e})}).s(function(n){return"auth/network-request-failed"==n.code?e:Uc(t.h)})):null}).then(function(e){Gc(t,e||null)});return Zc(t,n)}(this)),this.i=Zc(this,function(t){return t.V.then(function(){return t.fa()}).s(function(){}).then(function(){if(!t.m)return t.ka()}).s(function(){}).then(function(){if(!t.m){t.X=!0;var e=t.h;e.b.addListener(Fc("local"),e.a,t.ka)}})}(this)),this.X=!1,this.ka=m(this.Mc,this),this.Ha=m(this.Z,this),this.ra=m(this.bc,this),this.sa=m(this.jc,this),this.ta=m(this.kc,this),function(t){var e=Xc(t).options.authDomain,n=Xc(t).options.apiKey;e&&fr()&&(t.Sb=t.V.then(function(){if(!t.m){if(t.a=Uu(e,n,Xc(t).name),t.a.subscribe(t),Yc(t)&&fc(Yc(t)),t.D){fc(t.D);var r=t.D;r.pa(t.ea()),ic(r,t),oc(r=t.D,t.G),ac(r,t),t.D=null}return t.a}}))}(this),this.INTERNAL={},this.INTERNAL.delete=m(this.delete,this),this.INTERNAL.logFramework=m(this.tc,this),this.u=0,ke.call(this),function(t){Object.defineProperty(t,"lc",{get:function(){return this.ea()},set:function(t){this.pa(t)},enumerable:!1}),t.W=null}(this),this.G=[]}function Bc(t){ue.call(this,"languageCodeChanged"),this.g=t}function Hc(t){ue.call(this,"frameworkChanged"),this.c=t}function Kc(t){return t.Sb||Ct(new Br("auth-domain-config-required"))}function Qc(t,e){var n={};return n.apiKey=Xc(t).options.apiKey,n.authDomain=Xc(t).options.authDomain,n.appName=Xc(t).name,t.V.then(function(){return function(t,e,n,r){var i=new rc(t,e);return n&&(i.ba=n),r&&oc(i,r),i.reload().then(function(){return i})}(n,e,t.w,t.ya())}).then(function(e){return Yc(t)&&e.uid==Yc(t).uid?(bc(Yc(t),e),t.Z(e)):(Gc(t,e),fc(e),t.Z(e))}).then(function(){Jc(t)})}function Gc(t,e){Yc(t)&&(function(t,e){U(t.N,function(t){return t==e})}(Yc(t),t.Ha),Se(Yc(t),"tokenChanged",t.ra),Se(Yc(t),"userDeleted",t.sa),Se(Yc(t),"userInvalidated",t.ta),cc(Yc(t))),e&&(e.N.push(t.Ha),be(e,"tokenChanged",t.ra),be(e,"userDeleted",t.sa),be(e,"userInvalidated",t.ta),0<t.u&&uc(e)),xr(t,"currentUser",e),e&&(e.pa(t.ea()),ic(e,t),oc(e,t.G),ac(e,t))}function zc(t,e){var n=null,r=null;return Zc(t,e.then(function(e){return n=Ji(e),r=gi(e),Qc(t,e)}).then(function(){return kr({user:Yc(t),credential:n,additionalUserInfo:r,operationType:"signIn"})}))}function Xc(t){return t.app}function Yc(t){return t.currentUser}function $c(t){return Yc(t)&&Yc(t)._lat||null}function Jc(t){if(t.X){for(var e=0;e<t.o.length;e++)t.o[e]&&t.o[e]($c(t));if(t.O!==t.getUid()&&t.I.length)for(t.O=t.getUid(),e=0;e<t.I.length;e++)t.I[e]&&t.I[e]($c(t))}}function Zc(t,e){return t.N.push(e),e.ia(function(){j(t.N,e)}),e}function th(){}function eh(){this.a={},this.b=1e12}Dc.prototype.mb=function(t){var e=null,n=this;return function(t){var e=new Br("invalid-persistence-type"),n=new Br("unsupported-persistence-type");t:{for(r in Zs)if(Zs[r]==t){var r=!0;break t}r=!1}if(!r||"string"!==typeof t)throw e;switch(nr()){case"ReactNative":if("session"===t)throw n;break;case"Node":if("none"!==t)throw n;break;default:if(!lr()&&"none"!==t)throw n}}(t),Vc(this,function(){return t!=n.c.A?n.b.get(n.c,n.a).then(function(r){return e=r,Lc(n,t)}).then(function(){if(n.c=Fc(t),e)return n.b.set(n.c,e,n.a)}):St()})},w(qc,ke),w(Bc,ue),w(Hc,ue),(t=qc.prototype).mb=function(t){return Zc(this,t=this.h.mb(t))},t.pa=function(t){this.W===t||this.m||(this.W=t,ya(this.b,this.W),this.dispatchEvent(new Bc(this.ea())))},t.ea=function(){return this.W},t.Sc=function(){var t=n.navigator;this.pa(t&&(t.languages&&t.languages[0]||t.language||t.userLanguage)||null)},t.tc=function(t){this.G.push(t),va(this.b,r.a.SDK_VERSION?ur(r.a.SDK_VERSION,this.G):null),this.dispatchEvent(new Hc(this.G))},t.ya=function(){return V(this.G)},t.toJSON=function(){return{apiKey:Xc(this).options.apiKey,authDomain:Xc(this).options.authDomain,appName:Xc(this).name,currentUser:Yc(this)&&Yc(this).C()}},t.vb=function(t,e){switch(t){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==e&&!!this.f;default:return!1}},t.ha=function(t,e,n,r){"signInViaPopup"==t&&this.g==r&&(n&&this.v?this.v(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.v)},t.xa=function(t,e){return"signInViaRedirect"==t||"signInViaPopup"==t&&this.g==e&&this.f?m(this.ac,this):null},t.ac=function(t,e,n){var r=this;t={requestUri:t,postBody:n,sessionId:e},this.c&&(this.c.cancel(),this.c=null);var i=null,o=null,a=Oa(r.b,t).then(function(t){return i=Ji(t),o=gi(t),t});return Zc(this,t=r.V.then(function(){return a}).then(function(t){return Qc(r,t)}).then(function(){return kr({user:Yc(r),credential:i,additionalUserInfo:o,operationType:"signIn"})}))},t.Kc=function(t){if(!fr())return Ct(new Br("operation-not-supported-in-this-environment"));var e=this,n=vi(t.providerId),i=_r(),o=null;(!yr()||tr())&&Xc(this).options.authDomain&&t.isOAuthProvider&&(o=bs(Xc(this).options.authDomain,Xc(this).options.apiKey,Xc(this).name,"signInViaPopup",t,null,i,r.a.SDK_VERSION||null));var a=Xn(o,n&&n.Ba,n&&n.Aa);return Zc(this,n=Kc(this).then(function(e){return Mu(e,a,"signInViaPopup",t,i,!!o)}).then(function(){return new vt(function(t,n){e.ha("signInViaPopup",null,new Br("cancelled-popup-request"),e.g),e.f=t,e.v=n,e.g=i,e.c=e.a.Ea(e,"signInViaPopup",a,i)})}).then(function(t){return a&&zn(a),t?kr(t):null}).s(function(t){throw a&&zn(a),t}))},t.Lc=function(t){if(!fr())return Ct(new Br("operation-not-supported-in-this-environment"));var e=this;return Zc(this,Kc(this).then(function(){return function(t){return Vc(t,function(){return t.b.set(Mc,t.c.A,t.a)})}(e.h)}).then(function(){return e.a.Ca("signInViaRedirect",t)}))},t.fa=function(){if(!fr())return Ct(new Br("operation-not-supported-in-this-environment"));var t=this;return Zc(this,Kc(this).then(function(){return t.a.fa()}).then(function(t){return t?kr(t):null}))},t.Qc=function(t){if(!t)return Ct(new Br("null-user"));var e=this,n={};n.apiKey=Xc(this).options.apiKey,n.authDomain=Xc(this).options.authDomain,n.appName=Xc(this).name;var r=function(t,e,n,r){e=e||{apiKey:t.m,authDomain:t.u,appName:t.o};var i=t.h,o={};return o[ha]=i.b,o.refreshToken=i.a,o.expiresIn=(i.c-b())/1e3,e=new rc(e,o),n&&(e.ba=n),r&&oc(e,r),bc(e,t),e}(t,n,e.w,e.ya());return Zc(this,this.i.then(function(){if(Xc(e).options.apiKey!=t.m)return r.reload()}).then(function(){return Yc(e)&&t.uid==Yc(e).uid?(bc(Yc(e),t),e.Z(t)):(Gc(e,r),fc(r),e.Z(r))}).then(function(){Jc(e)}))},t.nb=function(){var t=this;return Zc(this,this.i.then(function(){return Yc(t)?(Gc(t,null),Uc(t.h).then(function(){Jc(t)})):St()}))},t.Mc=function(){var t=this;return Wc(this.h,Xc(this).options.authDomain).then(function(e){if(!t.m){var n;if(n=Yc(t)&&e){n=Yc(t).uid;var r=e.uid;n=void 0!==n&&null!==n&&""!==n&&void 0!==r&&null!==r&&""!==r&&n==r}if(n)return bc(Yc(t),e),Yc(t).F();(Yc(t)||e)&&(Gc(t,e),e&&(fc(e),e.ba=t.w),t.a&&t.a.subscribe(t),Jc(t))}})},t.Z=function(t){return jc(this.h,t)},t.bc=function(){Jc(this),this.Z(Yc(this))},t.jc=function(){this.nb()},t.kc=function(){this.nb()},t.mc=function(t){var e=this;this.addAuthTokenListener(function(){t.next(Yc(e))})},t.nc=function(t){var e=this;!function(t,e){t.I.push(e),Zc(t,t.i.then(function(){!t.m&&F(t.I,e)&&t.O!==t.getUid()&&(t.O=t.getUid(),e($c(t)))}))}(this,function(){t.next(Yc(e))})},t.vc=function(t,e,n){var i=this;return this.X&&r.a.Promise.resolve().then(function(){f(t)?t(Yc(i)):f(t.next)&&t.next(Yc(i))}),this.Tb(t,e,n)},t.uc=function(t,e,n){var i=this;return this.X&&r.a.Promise.resolve().then(function(){i.O=i.getUid(),f(t)?t(Yc(i)):f(t.next)&&t.next(Yc(i))}),this.Ub(t,e,n)},t.cc=function(t){var e=this;return Zc(this,this.i.then(function(){return Yc(e)?Yc(e).F(t).then(function(t){return{accessToken:t}}):null}))},t.Nb=function(t){var e=this;return this.i.then(function(){return zc(e,os(e.b,ts,{token:t}))}).then(function(t){var n=t.user;return _c(n,"isAnonymous",!1),e.Z(n),t})},t.Ec=function(t){return Or("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCustomToken is deprecated. Please use firebase.auth.Auth.prototype.signInWithCustomToken instead."),this.Nb(t)},t.Fc=function(t,e){return Or("firebase.auth.Auth.prototype.signInAndRetrieveDataWithEmailAndPassword is deprecated. Please use firebase.auth.Auth.prototype.signInWithEmailAndPassword instead."),this.Ob(t,e)},t.Ob=function(t,e){var n=this;return this.i.then(function(){return zc(n,os(n.b,es,{email:t,password:e}))})},t.xb=function(t,e){var n=this;return this.i.then(function(){return zc(n,os(n.b,Da,{email:t,password:e}))})},t.Wb=function(t,e){return Or("firebase.auth.Auth.prototype.createUserAndRetrieveDataWithEmailAndPassword is deprecated. Please use firebase.auth.Auth.prototype.createUserWithEmailAndPassword instead."),this.xb(t,e)},t.Hc=function(t){return Or("firebase.auth.Auth.prototype.signInWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential instead."),this.Pa(t).then(function(t){return t.user})},t.Pa=function(t){var e=this;return this.i.then(function(){return zc(e,t.la(e.b))})},t.Qa=function(){var t=this;return this.i.then(function(){var e=Yc(t);if(e&&e.isAnonymous){var n=kr({providerId:null,isNewUser:!1});return kr({user:e,credential:null,additionalUserInfo:n,operationType:"signIn"})}return zc(t,t.b.Qa()).then(function(e){var n=e.user;return _c(n,"isAnonymous",!0),t.Z(n),e})})},t.Gc=function(){return Or("firebase.auth.Auth.prototype.signInAnonymouslyAndRetrieveData is deprecated. Please use firebase.auth.Auth.prototype.signInAnonymously instead."),this.Qa()},t.getUid=function(){return Yc(this)&&Yc(this).uid||null},t.Vb=function(t){this.addAuthTokenListener(t),this.u++,0<this.u&&Yc(this)&&uc(Yc(this))},t.Cc=function(t){var e=this;D(this.o,function(n){n==t&&e.u--}),0>this.u&&(this.u=0),0==this.u&&Yc(this)&&cc(Yc(this)),this.removeAuthTokenListener(t)},t.addAuthTokenListener=function(t){var e=this;this.o.push(t),Zc(this,this.i.then(function(){e.m||F(e.o,t)&&t($c(e))}))},t.removeAuthTokenListener=function(t){U(this.o,function(e){return e==t})},t.delete=function(){this.m=!0;for(var t=0;t<this.N.length;t++)this.N[t].cancel("app-deleted");return this.N=[],this.h&&(t=this.h).b.removeListener(Fc("local"),t.a,this.ka),this.a&&(this.a.unsubscribe(this),this.a.Ya()),r.a.Promise.resolve()},t.Zb=function(t){return Or("firebase.auth.Auth.prototype.fetchProvidersForEmail is deprecated. Please use firebase.auth.Auth.prototype.fetchSignInMethodsForEmail instead."),Zc(this,function(t,e){return os(t,La,{identifier:e,continueUri:pr()?Kn():"http://localhost"}).then(function(t){return t.allProviders||[]})}(this.b,t))},t.$b=function(t){return Zc(this,function(t,e){return os(t,La,{identifier:e,continueUri:pr()?Kn():"http://localhost"}).then(function(t){return t.signinMethods||[]})}(this.b,t))},t.oc=function(t){return!!Gi(t)},t.lb=function(t,e){var n=this;return Zc(this,St().then(function(){var t=new Gr(e);if(!t.c)throw new Br("argument-error",Yr+" must be true when sending sign in link to email");return ri(t)}).then(function(e){return n.b.lb(t,e)}).then(function(){}))},t.Tc=function(t){return this.Ja(t).then(function(t){return t.data.email})},t.Za=function(t,e){return Zc(this,this.b.Za(t,e).then(function(){}))},t.Ja=function(t){return Zc(this,this.b.Ja(t).then(function(t){return new Dr(t)}))},t.Wa=function(t){return Zc(this,this.b.Wa(t).then(function(){}))},t.kb=function(t,e){var n=this;return Zc(this,St().then(function(){return"undefined"===typeof e||ot(e)?{}:ri(new Gr(e))}).then(function(e){return n.b.kb(t,e)}).then(function(){}))},t.Jc=function(t,e){return Zc(this,Gu(this,t,e,m(this.Pa,this)))},t.Ic=function(t,e){var n=this;return Zc(this,St().then(function(){var r=Qi(t,e||Kn());return n.Pa(r)}))},th.prototype.render=function(){},th.prototype.reset=function(){},th.prototype.getResponse=function(){},th.prototype.execute=function(){};var nh=null;function rh(t,e){return(e=ih(e))&&t.a[e]||null}function ih(t){return(t="undefined"===typeof t?1e12:t)?t.toString():null}function oh(t,e){this.g=!1,this.c=e,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=Dn(t);var n=this;this.i=function(){n.execute()},this.h?this.execute():be(this.f,"click",this.i)}function ah(t){if(t.g)throw Error("reCAPTCHA mock was already deleted!")}function sh(){}eh.prototype.render=function(t,e){return this.a[this.b.toString()]=new oh(t,e),this.b++},eh.prototype.reset=function(t){var e=rh(this,t);t=ih(t),e&&t&&(e.delete(),delete this.a[t])},eh.prototype.getResponse=function(t){return(t=rh(this,t))?t.getResponse():null},eh.prototype.execute=function(t){(t=rh(this,t))&&t.execute()},oh.prototype.getResponse=function(){return ah(this),this.b},oh.prototype.execute=function(){ah(this);var t=this;this.a||(this.a=setTimeout(function(){t.b=function(){for(var t=50,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}();var e=t.c.callback,n=t.c["expired-callback"];if(e)try{e(t.b)}catch(r){}t.a=setTimeout(function(){if(t.a=null,t.b=null,n)try{n()}catch(r){}t.h&&t.execute()},6e4)},500))},oh.prototype.delete=function(){ah(this),this.g=!0,clearTimeout(this.a),this.a=null,Se(this.f,"click",this.i)},sh.prototype.g=function(){return nh||(nh=new eh),St(nh)},sh.prototype.c=function(){};var uh=null;function ch(){this.b=n.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var hh=mn("https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),lh=new Er(3e4,6e4);ch.prototype.g=function(t){var e=this;return new vt(function(r,i){var o=setTimeout(function(){i(new Br("network-request-failed"))},lh.get());!n.grecaptcha||t!==e.f&&!e.b?(n[e.a]=function(){if(n.grecaptcha){e.f=t;var a=n.grecaptcha.render;n.grecaptcha.render=function(t,n){return t=a(t,n),e.b++,t},clearTimeout(o),r(n.grecaptcha)}else clearTimeout(o),i(new Br("internal-error"));delete n[e.a]},St(ea(wn(hh,{onload:e.a,hl:t||""}))).s(function(){clearTimeout(o),i(new Br("internal-error","Unable to load external reCAPTCHA dependencies!"))})):(clearTimeout(o),r(n.grecaptcha))})},ch.prototype.c=function(){this.b--};var fh=null;function ph(t,e,r,i,o,a,s){if(xr(this,"type","recaptcha"),this.c=this.f=null,this.D=!1,this.m=e,this.g=null,s?(uh||(uh=new sh),s=uh):(fh||(fh=new ch),s=fh),this.o=s,this.a=r||{theme:"light",type:"image"},this.h=[],this.a[vh])throw new Br("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[gh],!n.document)throw new Br("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!Dn(e)||!this.i&&Dn(e).hasChildNodes())throw new Br("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.u=new ua(t,a||null,o||null),this.v=i||function(){return null};var u=this;this.l=[];var c=this.a[dh];this.a[dh]=function(t){if(mh(u,t),"function"===typeof c)c(t);else if("string"===typeof c){var e=hr(c,n);"function"===typeof e&&e(t)}};var h=this.a[yh];this.a[yh]=function(){if(mh(u,null),"function"===typeof h)h();else if("string"===typeof h){var t=hr(h,n);"function"===typeof t&&t()}}}var dh="callback",yh="expired-callback",vh="sitekey",gh="size";function mh(t,e){for(var n=0;n<t.l.length;n++)try{t.l[n](e)}catch(r){}}function _h(t,e){return t.h.push(e),e.ia(function(){j(t.h,e)}),e}function bh(t){if(t.D)throw new Br("internal-error","RecaptchaVerifier instance has been destroyed.")}function wh(t,e,n){var i=!1;try{this.b=n||r.a.app()}catch(s){throw new Br("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new Br("invalid-api-key");n=this.b.options.apiKey;var o=this,a=null;try{a=this.b.auth().ya()}catch(s){}try{i=this.b.auth().settings.appVerificationDisabledForTesting}catch(s){}a=r.a.SDK_VERSION?ur(r.a.SDK_VERSION,a):null,ph.call(this,n,t,e,function(){try{var t=o.b.auth().ea()}catch(e){t=null}return t},a,fi(hi),i)}function Eh(t,e,n,r){t:{n=Array.prototype.slice.call(n);for(var i=0,o=!1,a=0;a<e.length;a++)if(e[a].optional)o=!0;else{if(o)throw new Br("internal-error","Argument validator encountered a required argument after an optional argument.");i++}if(o=e.length,n.length<i||o<n.length)r="Expected "+(i==o?1==i?"1 argument":i+" arguments":i+"-"+o+" arguments")+" but got "+n.length+".";else{for(i=0;i<n.length;i++)if(o=e[i].optional&&void 0===n[i],!e[i].M(n[i])&&!o){if(e=e[i],0>i||i>=Sh.length)throw new Br("internal-error","Argument validator received an unsupported number of arguments.");n=Sh[i],r=(r?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.K+".";break t}r=null}}if(r)throw new Br("argument-error",t+" failed: "+r)}(t=ph.prototype).za=function(){var t=this;return this.f?this.f:this.f=_h(this,St().then(function(){if(pr()&&!er())return Jn();throw new Br("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")}).then(function(){return t.o.g(t.v())}).then(function(e){return t.g=e,os(t.u,Ka,{})}).then(function(e){t.a[vh]=e.recaptchaSiteKey}).s(function(e){throw t.f=null,e}))},t.render=function(){bh(this);var t=this;return _h(this,this.za().then(function(){if(null===t.c){var e=t.m;if(!t.i){var n=Dn(e);e=Fn("DIV"),n.appendChild(e)}t.c=t.g.render(e,t.a)}return t.c}))},t.verify=function(){bh(this);var t=this;return _h(this,this.render().then(function(e){return new vt(function(n){var r=t.g.getResponse(e);if(r)n(r);else{t.l.push(function e(r){r&&(function(t,e){U(t.l,function(t){return t==e})}(t,e),n(r))}),t.i&&t.g.execute(t.c)}})}))},t.reset=function(){bh(this),null!==this.c&&this.g.reset(this.c)},t.clear=function(){bh(this),this.D=!0,this.o.c();for(var t=0;t<this.h.length;t++)this.h[t].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){t=Dn(this.m);for(var e;e=t.firstChild;)t.removeChild(e)}},w(wh,ph);var Sh="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function Ch(t,e){return{name:t||"",K:"a valid string",optional:!!e,M:o}}function Th(t,e){return{name:t||"",K:"a boolean",optional:!!e,M:a}}function Ih(t,e){return{name:t||"",K:"a valid object",optional:!!e,M:p}}function Nh(t,e){return{name:t||"",K:"a function",optional:!!e,M:f}}function Oh(t,e){return{name:t||"",K:"null",optional:!!e,M:c}}function Ah(t){return{name:t?t+"Credential":"credential",K:t?"a valid "+t+" credential":"a valid credential",optional:!1,M:function(e){if(!e)return!1;var n=!t||e.providerId===t;return!(!e.la||!n)}}}function xh(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(t){return!!(t&&o(t.type)&&f(t.verify))}}}function Ph(t,e,n,r){return{name:n||"",K:t.K+" or "+e.K,optional:!!r,M:function(n){return t.M(n)||e.M(n)}}}function kh(t,e){for(var n in e){var r=e[n].name;t[r]=Lh(r,t[n],e[n].j)}}function Rh(t,e){for(var n in e){var r=e[n].name;r!==n&&Object.defineProperty(t,r,{get:_(function(t){return this[t]},n),set:_(function(t,e,n,r){Eh(t,[n],[r],!0),this[e]=r},r,n,e[n].tb),enumerable:!0})}}function Dh(t,e,n,r){t[e]=Lh(e,n,r)}function Lh(t,e,n){function r(){var t=Array.prototype.slice.call(arguments);return Eh(o,n,t),e.apply(this,t)}if(!n)return e;var i,o=function(t){return(t=t.split("."))[t.length-1]}(t);for(i in e)r[i]=e[i];for(i in e.prototype)r.prototype[i]=e.prototype[i];return r}kh(qc.prototype,{Wa:{name:"applyActionCode",j:[Ch("code")]},Ja:{name:"checkActionCode",j:[Ch("code")]},Za:{name:"confirmPasswordReset",j:[Ch("code"),Ch("newPassword")]},xb:{name:"createUserWithEmailAndPassword",j:[Ch("email"),Ch("password")]},Wb:{name:"createUserAndRetrieveDataWithEmailAndPassword",j:[Ch("email"),Ch("password")]},Zb:{name:"fetchProvidersForEmail",j:[Ch("email")]},$b:{name:"fetchSignInMethodsForEmail",j:[Ch("email")]},fa:{name:"getRedirectResult",j:[]},oc:{name:"isSignInWithEmailLink",j:[Ch("emailLink")]},uc:{name:"onAuthStateChanged",j:[Ph(Ih(),Nh(),"nextOrObserver"),Nh("opt_error",!0),Nh("opt_completed",!0)]},vc:{name:"onIdTokenChanged",j:[Ph(Ih(),Nh(),"nextOrObserver"),Nh("opt_error",!0),Nh("opt_completed",!0)]},kb:{name:"sendPasswordResetEmail",j:[Ch("email"),Ph(Ih("opt_actionCodeSettings",!0),Oh(null,!0),"opt_actionCodeSettings",!0)]},lb:{name:"sendSignInLinkToEmail",j:[Ch("email"),Ih("actionCodeSettings")]},mb:{name:"setPersistence",j:[Ch("persistence")]},Pa:{name:"signInAndRetrieveDataWithCredential",j:[Ah()]},Qa:{name:"signInAnonymously",j:[]},Gc:{name:"signInAnonymouslyAndRetrieveData",j:[]},Hc:{name:"signInWithCredential",j:[Ah()]},Nb:{name:"signInWithCustomToken",j:[Ch("token")]},Ec:{name:"signInAndRetrieveDataWithCustomToken",j:[Ch("token")]},Ob:{name:"signInWithEmailAndPassword",j:[Ch("email"),Ch("password")]},Ic:{name:"signInWithEmailLink",j:[Ch("email"),Ch("emailLink",!0)]},Fc:{name:"signInAndRetrieveDataWithEmailAndPassword",j:[Ch("email"),Ch("password")]},Jc:{name:"signInWithPhoneNumber",j:[Ch("phoneNumber"),xh()]},Kc:{name:"signInWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Lc:{name:"signInWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Qc:{name:"updateCurrentUser",j:[Ph({name:"user",K:"an instance of Firebase User",optional:!1,M:function(t){return!!(t&&t instanceof rc)}},Oh(),"user")]},nb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[Ch(null,!0)]},Sc:{name:"useDeviceLanguage",j:[]},Tc:{name:"verifyPasswordResetCode",j:[Ch("code")]}}),Rh(qc.prototype,{lc:{name:"languageCode",tb:Ph(Ch(),Oh(),"languageCode")}}),qc.Persistence=Zs,qc.Persistence.LOCAL="local",qc.Persistence.SESSION="session",qc.Persistence.NONE="none",kh(rc.prototype,{delete:{name:"delete",j:[]},dc:{name:"getIdTokenResult",j:[Th("opt_forceRefresh",!0)]},F:{name:"getIdToken",j:[Th("opt_forceRefresh",!0)]},eb:{name:"linkAndRetrieveDataWithCredential",j:[Ah()]},pc:{name:"linkWithCredential",j:[Ah()]},qc:{name:"linkWithPhoneNumber",j:[Ch("phoneNumber"),xh()]},rc:{name:"linkWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},sc:{name:"linkWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},gb:{name:"reauthenticateAndRetrieveDataWithCredential",j:[Ah()]},yc:{name:"reauthenticateWithCredential",j:[Ah()]},zc:{name:"reauthenticateWithPhoneNumber",j:[Ch("phoneNumber"),xh()]},Ac:{name:"reauthenticateWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Bc:{name:"reauthenticateWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},reload:{name:"reload",j:[]},jb:{name:"sendEmailVerification",j:[Ph(Ih("opt_actionCodeSettings",!0),Oh(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[Ch(null,!0)]},Pc:{name:"unlink",j:[Ch("provider")]},pb:{name:"updateEmail",j:[Ch("email")]},qb:{name:"updatePassword",j:[Ch("password")]},Rc:{name:"updatePhoneNumber",j:[Ah("phone")]},rb:{name:"updateProfile",j:[Ih("profile")]}}),kh(eh.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),kh(th.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),kh(vt.prototype,{ia:{name:"finally"},s:{name:"catch"},then:{name:"then"}}),Rh(Ku.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",tb:Th("appVerificationDisabledForTesting")}}),kh(Qu.prototype,{confirm:{name:"confirm",j:[Ch("verificationCode")]}}),Dh(Ki,"credential",function(t,e){return new Hi(t,e)},[Ch("email"),Ch("password")]),kh(Mi.prototype,{ua:{name:"addScope",j:[Ch("scope")]},Da:{name:"setCustomParameters",j:[Ih("customOAuthParameters")]}}),Dh(Mi,"credential",Fi,[Ph(Ch(),Ih(),"token")]),Dh(Ki,"credentialWithLink",Qi,[Ch("email"),Ch("emailLink")]),kh(ji.prototype,{ua:{name:"addScope",j:[Ch("scope")]},Da:{name:"setCustomParameters",j:[Ih("customOAuthParameters")]}}),Dh(ji,"credential",Ui,[Ph(Ch(),Ih(),"token")]),kh(Wi.prototype,{ua:{name:"addScope",j:[Ch("scope")]},Da:{name:"setCustomParameters",j:[Ih("customOAuthParameters")]}}),Dh(Wi,"credential",Vi,[Ph(Ch(),Ph(Ih(),Oh()),"idToken"),Ph(Ch(),Oh(),"accessToken",!0)]),kh(qi.prototype,{Da:{name:"setCustomParameters",j:[Ih("customOAuthParameters")]}}),Dh(qi,"credential",Bi,[Ph(Ch(),Ih(),"token"),Ch("secret",!0)]),kh(Li.prototype,{ua:{name:"addScope",j:[Ch("scope")]},credential:{name:"credential",j:[Ph(Ch(),Oh(),"idToken",!0),Ph(Ch(),Oh(),"accessToken",!0),Ph(Ch(),Oh(),"nonce",!0)]},Da:{name:"setCustomParameters",j:[Ih("customOAuthParameters")]}}),Dh(Yi,"credential",$i,[Ch("verificationId"),Ch("verificationCode")]),kh(Yi.prototype,{Ua:{name:"verifyPhoneNumber",j:[Ch("phoneNumber"),xh()]}}),kh(Br.prototype,{toJSON:{name:"toJSON",j:[Ch(null,!0)]}}),kh(ao.prototype,{toJSON:{name:"toJSON",j:[Ch(null,!0)]}}),kh(oo.prototype,{toJSON:{name:"toJSON",j:[Ch(null,!0)]}}),kh(wh.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),function(){if("undefined"===typeof r.a||!r.a.INTERNAL||!r.a.INTERNAL.registerService)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var t={Auth:qc,Error:Br};Dh(t,"EmailAuthProvider",Ki,[]),Dh(t,"FacebookAuthProvider",Mi,[]),Dh(t,"GithubAuthProvider",ji,[]),Dh(t,"GoogleAuthProvider",Wi,[]),Dh(t,"TwitterAuthProvider",qi,[]),Dh(t,"OAuthProvider",Li,[Ch("providerId")]),Dh(t,"SAMLAuthProvider",Di,[Ch("providerId")]),Dh(t,"PhoneAuthProvider",Yi,[{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(t){return!!(t&&t instanceof qc)}}]),Dh(t,"RecaptchaVerifier",wh,[Ph(Ch(),{name:"",K:"an HTML element",optional:!1,M:function(t){return!!(t&&t instanceof Element)}},"recaptchaContainer"),Ih("recaptchaParameters",!0),{name:"app",K:"an instance of Firebase App",optional:!0,M:function(t){return!!(t&&t instanceof r.a.app.App)}}]),r.a.INTERNAL.registerService("auth",function(t,e){return e({INTERNAL:{getUid:m((t=new qc(t)).getUid,t),getToken:m(t.cc,t),addAuthTokenListener:m(t.Vb,t),removeAuthTokenListener:m(t.Cc,t)}}),t},t,function(t,e){if("create"===t)try{e.auth()}catch(n){}}),r.a.INTERNAL.extendNamespace({User:rc})}()}).apply("undefined"!==typeof t?t:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})}).call(this,n(25))},91:function(t,e){t.exports=function(t,e){return t===e||t!==t&&e!==e}},93:function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],h=!1,l=-1;function f(){h&&u&&(h=!1,u.length?c=u.concat(c):l=-1,c.length&&p())}function p(){if(!h){var t=s(f);h=!0;for(var e=c.length;e;){for(u=c,c=[];++l<e;)u&&u[l].run();l=-1,e=c.length}u=null,h=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||h||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},97:function(t,e,n){var r=n(130),i=n(155);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}}}]);